@microsoft/agents-copilotstudio-client 1.3.0-beta.10.gf7fc2bf267 → 1.3.0-beta.13.g4c051861c4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../node_modules/ms/index.js", "../../../../node_modules/debug/src/common.js", "../../../../node_modules/debug/src/browser.js", "../../../agents-activity/src/logger.ts", "../../../../node_modules/zod/v3/helpers/util.cjs", "../../../../node_modules/zod/v3/ZodError.cjs", "../../../../node_modules/zod/v3/locales/en.cjs", "../../../../node_modules/zod/v3/errors.cjs", "../../../../node_modules/zod/v3/helpers/parseUtil.cjs", "../../../../node_modules/zod/v3/helpers/typeAliases.cjs", "../../../../node_modules/zod/v3/helpers/errorUtil.cjs", "../../../../node_modules/zod/v3/types.cjs", "../../../../node_modules/zod/v3/external.cjs", "../../../../node_modules/zod/index.cjs", "../../../agents-activity/src/action/actionTypes.ts", "../../../agents-activity/src/action/semanticActionStateTypes.ts", "../../../agents-activity/src/attachment/attachmentLayoutTypes.ts", "../../../agents-activity/src/conversation/channels.ts", "../../../agents-activity/src/conversation/endOfConversationCodes.ts", "../../../agents-activity/src/conversation/membershipSourceTypes.ts", "../../../agents-activity/src/conversation/membershipTypes.ts", "../../../agents-activity/src/conversation/roleTypes.ts", "../../../agents-activity/src/entity/AIEntity.ts", "../../../agents-activity/src/invoke/adaptiveCardInvokeAction.ts", "../../../../node_modules/uuid/dist/cjs-browser/max.js", "../../../../node_modules/uuid/dist/cjs-browser/nil.js", "../../../../node_modules/uuid/dist/cjs-browser/regex.js", "../../../../node_modules/uuid/dist/cjs-browser/validate.js", "../../../../node_modules/uuid/dist/cjs-browser/parse.js", "../../../../node_modules/uuid/dist/cjs-browser/stringify.js", "../../../../node_modules/uuid/dist/cjs-browser/rng.js", "../../../../node_modules/uuid/dist/cjs-browser/v1.js", "../../../../node_modules/uuid/dist/cjs-browser/v1ToV6.js", "../../../../node_modules/uuid/dist/cjs-browser/md5.js", "../../../../node_modules/uuid/dist/cjs-browser/v35.js", "../../../../node_modules/uuid/dist/cjs-browser/v3.js", "../../../../node_modules/uuid/dist/cjs-browser/native.js", "../../../../node_modules/uuid/dist/cjs-browser/v4.js", "../../../../node_modules/uuid/dist/cjs-browser/sha1.js", "../../../../node_modules/uuid/dist/cjs-browser/v5.js", "../../../../node_modules/uuid/dist/cjs-browser/v6.js", "../../../../node_modules/uuid/dist/cjs-browser/v6ToV1.js", "../../../../node_modules/uuid/dist/cjs-browser/v7.js", "../../../../node_modules/uuid/dist/cjs-browser/version.js", "../../../../node_modules/uuid/dist/cjs-browser/index.js", "../../../agents-activity/src/entity/entity.ts", "../../../agents-activity/src/action/semanticAction.ts", "../../../agents-activity/src/action/cardAction.ts", "../../../agents-activity/src/action/suggestedActions.ts", "../../../agents-activity/src/activityEventNames.ts", "../../../agents-activity/src/activityImportance.ts", "../../../agents-activity/src/activityTypes.ts", "../../../agents-activity/src/attachment/attachment.ts", "../../../agents-activity/src/entity/productInfo.ts", "../../../agents-activity/src/conversation/channelAccount.ts", "../../../agents-activity/src/conversation/conversationAccount.ts", "../../../agents-activity/src/conversation/conversationReference.ts", "../../../agents-activity/src/deliveryModes.ts", "../../../agents-activity/src/inputHints.ts", "../../../agents-activity/src/messageReactionTypes.ts", "../../../agents-activity/src/messageReaction.ts", "../../../agents-activity/src/textFormatTypes.ts", "../../../agents-activity/src/textHighlight.ts", "../../../agents-activity/src/exceptionHelper.ts", "../../../agents-activity/src/errorHelper.ts", "../../../agents-activity/src/activity.ts", "../../../agents-activity/src/activityTreatments.ts", "../../../agents-activity/src/index.ts", "../../src/agentType.ts", "../../src/powerPlatformCloud.ts", "../../src/connectionSettings.ts", "../../../../node_modules/eventsource-parser/src/errors.ts", "../../../../node_modules/eventsource-parser/src/parse.ts", "../../../../node_modules/eventsource-client/src/constants.ts", "../../../../node_modules/eventsource-client/src/client.ts", "../../../../node_modules/eventsource-client/src/default.ts", "../../src/powerPlatformEnvironment.ts", "../../src/strategies/prebuiltBotStrategy.ts", "../../src/strategies/publishedBotStrategy.ts", "../../src/copilotStudioClient.ts", "../../src/executeTurnRequest.ts", "../../package.json", "../../src/browser/os.ts", "../../../../node_modules/uuid/dist/esm-browser/stringify.js", "../../../../node_modules/uuid/dist/esm-browser/rng.js", "../../../../node_modules/uuid/dist/esm-browser/native.js", "../../../../node_modules/uuid/dist/esm-browser/v4.js", "../../src/copilotStudioWebChat.ts", "../../../../node_modules/tslib/tslib.es6.mjs", "../../../../node_modules/rxjs/src/internal/util/isFunction.ts", "../../../../node_modules/rxjs/src/internal/util/createErrorClass.ts", "../../../../node_modules/rxjs/src/internal/util/UnsubscriptionError.ts", "../../../../node_modules/rxjs/src/internal/util/arrRemove.ts", "../../../../node_modules/rxjs/src/internal/Subscription.ts", "../../../../node_modules/rxjs/src/internal/config.ts", "../../../../node_modules/rxjs/src/internal/scheduler/timeoutProvider.ts", "../../../../node_modules/rxjs/src/internal/util/reportUnhandledError.ts", "../../../../node_modules/rxjs/src/internal/util/noop.ts", "../../../../node_modules/rxjs/src/internal/NotificationFactories.ts", "../../../../node_modules/rxjs/src/internal/util/errorContext.ts", "../../../../node_modules/rxjs/src/internal/Subscriber.ts", "../../../../node_modules/rxjs/src/internal/symbol/observable.ts", "../../../../node_modules/rxjs/src/internal/util/identity.ts", "../../../../node_modules/rxjs/src/internal/util/pipe.ts", "../../../../node_modules/rxjs/src/internal/Observable.ts", "../../../../node_modules/rxjs/src/internal/util/ObjectUnsubscribedError.ts", "../../../../node_modules/rxjs/src/internal/Subject.ts", "../../../../node_modules/rxjs/src/internal/BehaviorSubject.ts"],
4
- "sourcesContent": ["/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function (val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n", "\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '')\n\t\t\t.trim()\n\t\t\t.replace(/\\s+/g, ',')\n\t\t\t.split(',')\n\t\t\t.filter(Boolean);\n\n\t\tfor (const ns of split) {\n\t\t\tif (ns[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(ns.slice(1));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(ns);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Checks if the given string matches a namespace template, honoring\n\t * asterisks as wildcards.\n\t *\n\t * @param {String} search\n\t * @param {String} template\n\t * @return {Boolean}\n\t */\n\tfunction matchesTemplate(search, template) {\n\t\tlet searchIndex = 0;\n\t\tlet templateIndex = 0;\n\t\tlet starIndex = -1;\n\t\tlet matchIndex = 0;\n\n\t\twhile (searchIndex < search.length) {\n\t\t\tif (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {\n\t\t\t\t// Match character or proceed with wildcard\n\t\t\t\tif (template[templateIndex] === '*') {\n\t\t\t\t\tstarIndex = templateIndex;\n\t\t\t\t\tmatchIndex = searchIndex;\n\t\t\t\t\ttemplateIndex++; // Skip the '*'\n\t\t\t\t} else {\n\t\t\t\t\tsearchIndex++;\n\t\t\t\t\ttemplateIndex++;\n\t\t\t\t}\n\t\t\t} else if (starIndex !== -1) { // eslint-disable-line no-negated-condition\n\t\t\t\t// Backtrack to the last '*' and try to match more characters\n\t\t\t\ttemplateIndex = starIndex + 1;\n\t\t\t\tmatchIndex++;\n\t\t\t\tsearchIndex = matchIndex;\n\t\t\t} else {\n\t\t\t\treturn false; // No match\n\t\t\t}\n\t\t}\n\n\t\t// Handle trailing '*' in template\n\t\twhile (templateIndex < template.length && template[templateIndex] === '*') {\n\t\t\ttemplateIndex++;\n\t\t}\n\n\t\treturn templateIndex === template.length;\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names,\n\t\t\t...createDebug.skips.map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tfor (const skip of createDebug.skips) {\n\t\t\tif (matchesTemplate(name, skip)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (const ns of createDebug.names) {\n\t\t\tif (matchesTemplate(name, ns)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n", "/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\tlet m;\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\t// eslint-disable-next-line no-return-assign\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)) && parseInt(m[1], 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG') ;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport createDebug, { Debugger } from 'debug'\n\nconst loggerLevels = [\n 'info',\n 'warn',\n 'error',\n 'debug',\n] as const\n\ntype LoggerLevels = typeof loggerLevels[number]\n\n/**\n * Logger class that provides colored logging functionality using the debug package.\n * Supports different log levels: info, warn, error, and debug.\n */\nexport class Logger {\n private loggers: { [K in LoggerLevels]: Debugger } = {} as any\n\n /**\n * Creates a new Logger instance with the specified namespace.\n * @param namespace The namespace to use for the logger\n */\n constructor (namespace: string = '') {\n this.initializeLoggers(namespace)\n }\n\n private initializeLoggers (namespace: string) {\n for (const level of loggerLevels) {\n const logger = createDebug(`${namespace}:${level}`)\n logger.color = this.getPlatformColor(level)\n this.loggers[level] = logger\n }\n }\n\n private getPlatformColor (level: LoggerLevels): string {\n const platform = typeof window !== 'undefined' ? 'browser' : 'node'\n const colors = {\n node: {\n info: '2', // Green\n warn: '3', // Yellow\n error: '1', // Red\n debug: '4', // Blue\n },\n browser: {\n info: '#33CC99', // Green\n warn: '#CCCC33', // Yellow\n error: '#CC3366', // Red\n debug: '#0066FF', // Blue\n },\n }\n\n return colors[platform][level]\n }\n\n /**\n * Logs an informational message.\n * @param message The message to log\n * @param args Additional arguments to include in the log\n */\n info (message: string, ...args: any[]) {\n this.loggers.info(message, ...args)\n }\n\n /**\n * Logs a warning message.\n * @param message The message to log\n * @param args Additional arguments to include in the log\n */\n warn (message: string, ...args: any[]) {\n this.loggers.warn(message, ...args)\n }\n\n /**\n * Logs an error message.\n * @param message The message to log\n * @param args Additional arguments to include in the log\n */\n error (message: string, ...args: any[]) {\n this.loggers.error(message, ...args)\n }\n\n /**\n * Logs a debug message.\n * @param message The message to log\n * @param args Additional arguments to include in the log\n */\n debug (message: string, ...args: any[]) {\n this.loggers.debug(message, ...args)\n }\n}\n\n/**\n * Creates a new Logger instance with the specified namespace.\n * @param namespace The namespace to use for the logger\n * @returns A new Logger instance\n */\nexport function debug (namespace: string): Logger {\n return new Logger(namespace)\n}\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getParsedType = exports.ZodParsedType = exports.objectUtil = exports.util = void 0;\nvar util;\n(function (util) {\n util.assertEqual = (_) => { };\n function assertIs(_arg) { }\n util.assertIs = assertIs;\n function assertNever(_x) {\n throw new Error();\n }\n util.assertNever = assertNever;\n util.arrayToEnum = (items) => {\n const obj = {};\n for (const item of items) {\n obj[item] = item;\n }\n return obj;\n };\n util.getValidEnumValues = (obj) => {\n const validKeys = util.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== \"number\");\n const filtered = {};\n for (const k of validKeys) {\n filtered[k] = obj[k];\n }\n return util.objectValues(filtered);\n };\n util.objectValues = (obj) => {\n return util.objectKeys(obj).map(function (e) {\n return obj[e];\n });\n };\n util.objectKeys = typeof Object.keys === \"function\" // eslint-disable-line ban/ban\n ? (obj) => Object.keys(obj) // eslint-disable-line ban/ban\n : (object) => {\n const keys = [];\n for (const key in object) {\n if (Object.prototype.hasOwnProperty.call(object, key)) {\n keys.push(key);\n }\n }\n return keys;\n };\n util.find = (arr, checker) => {\n for (const item of arr) {\n if (checker(item))\n return item;\n }\n return undefined;\n };\n util.isInteger = typeof Number.isInteger === \"function\"\n ? (val) => Number.isInteger(val) // eslint-disable-line ban/ban\n : (val) => typeof val === \"number\" && Number.isFinite(val) && Math.floor(val) === val;\n function joinValues(array, separator = \" | \") {\n return array.map((val) => (typeof val === \"string\" ? `'${val}'` : val)).join(separator);\n }\n util.joinValues = joinValues;\n util.jsonStringifyReplacer = (_, value) => {\n if (typeof value === \"bigint\") {\n return value.toString();\n }\n return value;\n };\n})(util || (exports.util = util = {}));\nvar objectUtil;\n(function (objectUtil) {\n objectUtil.mergeShapes = (first, second) => {\n return {\n ...first,\n ...second, // second overwrites first\n };\n };\n})(objectUtil || (exports.objectUtil = objectUtil = {}));\nexports.ZodParsedType = util.arrayToEnum([\n \"string\",\n \"nan\",\n \"number\",\n \"integer\",\n \"float\",\n \"boolean\",\n \"date\",\n \"bigint\",\n \"symbol\",\n \"function\",\n \"undefined\",\n \"null\",\n \"array\",\n \"object\",\n \"unknown\",\n \"promise\",\n \"void\",\n \"never\",\n \"map\",\n \"set\",\n]);\nconst getParsedType = (data) => {\n const t = typeof data;\n switch (t) {\n case \"undefined\":\n return exports.ZodParsedType.undefined;\n case \"string\":\n return exports.ZodParsedType.string;\n case \"number\":\n return Number.isNaN(data) ? exports.ZodParsedType.nan : exports.ZodParsedType.number;\n case \"boolean\":\n return exports.ZodParsedType.boolean;\n case \"function\":\n return exports.ZodParsedType.function;\n case \"bigint\":\n return exports.ZodParsedType.bigint;\n case \"symbol\":\n return exports.ZodParsedType.symbol;\n case \"object\":\n if (Array.isArray(data)) {\n return exports.ZodParsedType.array;\n }\n if (data === null) {\n return exports.ZodParsedType.null;\n }\n if (data.then && typeof data.then === \"function\" && data.catch && typeof data.catch === \"function\") {\n return exports.ZodParsedType.promise;\n }\n if (typeof Map !== \"undefined\" && data instanceof Map) {\n return exports.ZodParsedType.map;\n }\n if (typeof Set !== \"undefined\" && data instanceof Set) {\n return exports.ZodParsedType.set;\n }\n if (typeof Date !== \"undefined\" && data instanceof Date) {\n return exports.ZodParsedType.date;\n }\n return exports.ZodParsedType.object;\n default:\n return exports.ZodParsedType.unknown;\n }\n};\nexports.getParsedType = getParsedType;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ZodError = exports.quotelessJson = exports.ZodIssueCode = void 0;\nconst util_js_1 = require(\"./helpers/util.cjs\");\nexports.ZodIssueCode = util_js_1.util.arrayToEnum([\n \"invalid_type\",\n \"invalid_literal\",\n \"custom\",\n \"invalid_union\",\n \"invalid_union_discriminator\",\n \"invalid_enum_value\",\n \"unrecognized_keys\",\n \"invalid_arguments\",\n \"invalid_return_type\",\n \"invalid_date\",\n \"invalid_string\",\n \"too_small\",\n \"too_big\",\n \"invalid_intersection_types\",\n \"not_multiple_of\",\n \"not_finite\",\n]);\nconst quotelessJson = (obj) => {\n const json = JSON.stringify(obj, null, 2);\n return json.replace(/\"([^\"]+)\":/g, \"$1:\");\n};\nexports.quotelessJson = quotelessJson;\nclass ZodError extends Error {\n get errors() {\n return this.issues;\n }\n constructor(issues) {\n super();\n this.issues = [];\n this.addIssue = (sub) => {\n this.issues = [...this.issues, sub];\n };\n this.addIssues = (subs = []) => {\n this.issues = [...this.issues, ...subs];\n };\n const actualProto = new.target.prototype;\n if (Object.setPrototypeOf) {\n // eslint-disable-next-line ban/ban\n Object.setPrototypeOf(this, actualProto);\n }\n else {\n this.__proto__ = actualProto;\n }\n this.name = \"ZodError\";\n this.issues = issues;\n }\n format(_mapper) {\n const mapper = _mapper ||\n function (issue) {\n return issue.message;\n };\n const fieldErrors = { _errors: [] };\n const processError = (error) => {\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\") {\n issue.unionErrors.map(processError);\n }\n else if (issue.code === \"invalid_return_type\") {\n processError(issue.returnTypeError);\n }\n else if (issue.code === \"invalid_arguments\") {\n processError(issue.argumentsError);\n }\n else if (issue.path.length === 0) {\n fieldErrors._errors.push(mapper(issue));\n }\n else {\n let curr = fieldErrors;\n let i = 0;\n while (i < issue.path.length) {\n const el = issue.path[i];\n const terminal = i === issue.path.length - 1;\n if (!terminal) {\n curr[el] = curr[el] || { _errors: [] };\n // if (typeof el === \"string\") {\n // curr[el] = curr[el] || { _errors: [] };\n // } else if (typeof el === \"number\") {\n // const errorArray: any = [];\n // errorArray._errors = [];\n // curr[el] = curr[el] || errorArray;\n // }\n }\n else {\n curr[el] = curr[el] || { _errors: [] };\n curr[el]._errors.push(mapper(issue));\n }\n curr = curr[el];\n i++;\n }\n }\n }\n };\n processError(this);\n return fieldErrors;\n }\n static assert(value) {\n if (!(value instanceof ZodError)) {\n throw new Error(`Not a ZodError: ${value}`);\n }\n }\n toString() {\n return this.message;\n }\n get message() {\n return JSON.stringify(this.issues, util_js_1.util.jsonStringifyReplacer, 2);\n }\n get isEmpty() {\n return this.issues.length === 0;\n }\n flatten(mapper = (issue) => issue.message) {\n const fieldErrors = {};\n const formErrors = [];\n for (const sub of this.issues) {\n if (sub.path.length > 0) {\n const firstEl = sub.path[0];\n fieldErrors[firstEl] = fieldErrors[firstEl] || [];\n fieldErrors[firstEl].push(mapper(sub));\n }\n else {\n formErrors.push(mapper(sub));\n }\n }\n return { formErrors, fieldErrors };\n }\n get formErrors() {\n return this.flatten();\n }\n}\nexports.ZodError = ZodError;\nZodError.create = (issues) => {\n const error = new ZodError(issues);\n return error;\n};\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst ZodError_js_1 = require(\"../ZodError.cjs\");\nconst util_js_1 = require(\"../helpers/util.cjs\");\nconst errorMap = (issue, _ctx) => {\n let message;\n switch (issue.code) {\n case ZodError_js_1.ZodIssueCode.invalid_type:\n if (issue.received === util_js_1.ZodParsedType.undefined) {\n message = \"Required\";\n }\n else {\n message = `Expected ${issue.expected}, received ${issue.received}`;\n }\n break;\n case ZodError_js_1.ZodIssueCode.invalid_literal:\n message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util_js_1.util.jsonStringifyReplacer)}`;\n break;\n case ZodError_js_1.ZodIssueCode.unrecognized_keys:\n message = `Unrecognized key(s) in object: ${util_js_1.util.joinValues(issue.keys, \", \")}`;\n break;\n case ZodError_js_1.ZodIssueCode.invalid_union:\n message = `Invalid input`;\n break;\n case ZodError_js_1.ZodIssueCode.invalid_union_discriminator:\n message = `Invalid discriminator value. Expected ${util_js_1.util.joinValues(issue.options)}`;\n break;\n case ZodError_js_1.ZodIssueCode.invalid_enum_value:\n message = `Invalid enum value. Expected ${util_js_1.util.joinValues(issue.options)}, received '${issue.received}'`;\n break;\n case ZodError_js_1.ZodIssueCode.invalid_arguments:\n message = `Invalid function arguments`;\n break;\n case ZodError_js_1.ZodIssueCode.invalid_return_type:\n message = `Invalid function return type`;\n break;\n case ZodError_js_1.ZodIssueCode.invalid_date:\n message = `Invalid date`;\n break;\n case ZodError_js_1.ZodIssueCode.invalid_string:\n if (typeof issue.validation === \"object\") {\n if (\"includes\" in issue.validation) {\n message = `Invalid input: must include \"${issue.validation.includes}\"`;\n if (typeof issue.validation.position === \"number\") {\n message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;\n }\n }\n else if (\"startsWith\" in issue.validation) {\n message = `Invalid input: must start with \"${issue.validation.startsWith}\"`;\n }\n else if (\"endsWith\" in issue.validation) {\n message = `Invalid input: must end with \"${issue.validation.endsWith}\"`;\n }\n else {\n util_js_1.util.assertNever(issue.validation);\n }\n }\n else if (issue.validation !== \"regex\") {\n message = `Invalid ${issue.validation}`;\n }\n else {\n message = \"Invalid\";\n }\n break;\n case ZodError_js_1.ZodIssueCode.too_small:\n if (issue.type === \"array\")\n message = `Array must contain ${issue.exact ? \"exactly\" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;\n else if (issue.type === \"string\")\n message = `String must contain ${issue.exact ? \"exactly\" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;\n else if (issue.type === \"number\")\n message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;\n else if (issue.type === \"bigint\")\n message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;\n else if (issue.type === \"date\")\n message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;\n else\n message = \"Invalid input\";\n break;\n case ZodError_js_1.ZodIssueCode.too_big:\n if (issue.type === \"array\")\n message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;\n else if (issue.type === \"string\")\n message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;\n else if (issue.type === \"number\")\n message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;\n else if (issue.type === \"bigint\")\n message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;\n else if (issue.type === \"date\")\n message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`;\n else\n message = \"Invalid input\";\n break;\n case ZodError_js_1.ZodIssueCode.custom:\n message = `Invalid input`;\n break;\n case ZodError_js_1.ZodIssueCode.invalid_intersection_types:\n message = `Intersection results could not be merged`;\n break;\n case ZodError_js_1.ZodIssueCode.not_multiple_of:\n message = `Number must be a multiple of ${issue.multipleOf}`;\n break;\n case ZodError_js_1.ZodIssueCode.not_finite:\n message = \"Number must be finite\";\n break;\n default:\n message = _ctx.defaultError;\n util_js_1.util.assertNever(issue);\n }\n return { message };\n};\nexports.default = errorMap;\n", "\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.defaultErrorMap = void 0;\nexports.setErrorMap = setErrorMap;\nexports.getErrorMap = getErrorMap;\nconst en_js_1 = __importDefault(require(\"./locales/en.cjs\"));\nexports.defaultErrorMap = en_js_1.default;\nlet overrideErrorMap = en_js_1.default;\nfunction setErrorMap(map) {\n overrideErrorMap = map;\n}\nfunction getErrorMap() {\n return overrideErrorMap;\n}\n", "\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isAsync = exports.isValid = exports.isDirty = exports.isAborted = exports.OK = exports.DIRTY = exports.INVALID = exports.ParseStatus = exports.EMPTY_PATH = exports.makeIssue = void 0;\nexports.addIssueToContext = addIssueToContext;\nconst errors_js_1 = require(\"../errors.cjs\");\nconst en_js_1 = __importDefault(require(\"../locales/en.cjs\"));\nconst makeIssue = (params) => {\n const { data, path, errorMaps, issueData } = params;\n const fullPath = [...path, ...(issueData.path || [])];\n const fullIssue = {\n ...issueData,\n path: fullPath,\n };\n if (issueData.message !== undefined) {\n return {\n ...issueData,\n path: fullPath,\n message: issueData.message,\n };\n }\n let errorMessage = \"\";\n const maps = errorMaps\n .filter((m) => !!m)\n .slice()\n .reverse();\n for (const map of maps) {\n errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message;\n }\n return {\n ...issueData,\n path: fullPath,\n message: errorMessage,\n };\n};\nexports.makeIssue = makeIssue;\nexports.EMPTY_PATH = [];\nfunction addIssueToContext(ctx, issueData) {\n const overrideMap = (0, errors_js_1.getErrorMap)();\n const issue = (0, exports.makeIssue)({\n issueData: issueData,\n data: ctx.data,\n path: ctx.path,\n errorMaps: [\n ctx.common.contextualErrorMap, // contextual error map is first priority\n ctx.schemaErrorMap, // then schema-bound map if available\n overrideMap, // then global override map\n overrideMap === en_js_1.default ? undefined : en_js_1.default, // then global default map\n ].filter((x) => !!x),\n });\n ctx.common.issues.push(issue);\n}\nclass ParseStatus {\n constructor() {\n this.value = \"valid\";\n }\n dirty() {\n if (this.value === \"valid\")\n this.value = \"dirty\";\n }\n abort() {\n if (this.value !== \"aborted\")\n this.value = \"aborted\";\n }\n static mergeArray(status, results) {\n const arrayValue = [];\n for (const s of results) {\n if (s.status === \"aborted\")\n return exports.INVALID;\n if (s.status === \"dirty\")\n status.dirty();\n arrayValue.push(s.value);\n }\n return { status: status.value, value: arrayValue };\n }\n static async mergeObjectAsync(status, pairs) {\n const syncPairs = [];\n for (const pair of pairs) {\n const key = await pair.key;\n const value = await pair.value;\n syncPairs.push({\n key,\n value,\n });\n }\n return ParseStatus.mergeObjectSync(status, syncPairs);\n }\n static mergeObjectSync(status, pairs) {\n const finalObject = {};\n for (const pair of pairs) {\n const { key, value } = pair;\n if (key.status === \"aborted\")\n return exports.INVALID;\n if (value.status === \"aborted\")\n return exports.INVALID;\n if (key.status === \"dirty\")\n status.dirty();\n if (value.status === \"dirty\")\n status.dirty();\n if (key.value !== \"__proto__\" && (typeof value.value !== \"undefined\" || pair.alwaysSet)) {\n finalObject[key.value] = value.value;\n }\n }\n return { status: status.value, value: finalObject };\n }\n}\nexports.ParseStatus = ParseStatus;\nexports.INVALID = Object.freeze({\n status: \"aborted\",\n});\nconst DIRTY = (value) => ({ status: \"dirty\", value });\nexports.DIRTY = DIRTY;\nconst OK = (value) => ({ status: \"valid\", value });\nexports.OK = OK;\nconst isAborted = (x) => x.status === \"aborted\";\nexports.isAborted = isAborted;\nconst isDirty = (x) => x.status === \"dirty\";\nexports.isDirty = isDirty;\nconst isValid = (x) => x.status === \"valid\";\nexports.isValid = isValid;\nconst isAsync = (x) => typeof Promise !== \"undefined\" && x instanceof Promise;\nexports.isAsync = isAsync;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.errorUtil = void 0;\nvar errorUtil;\n(function (errorUtil) {\n errorUtil.errToObj = (message) => typeof message === \"string\" ? { message } : message || {};\n // biome-ignore lint:\n errorUtil.toString = (message) => typeof message === \"string\" ? message : message?.message;\n})(errorUtil || (exports.errorUtil = errorUtil = {}));\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.discriminatedUnion = exports.date = exports.boolean = exports.bigint = exports.array = exports.any = exports.coerce = exports.ZodFirstPartyTypeKind = exports.late = exports.ZodSchema = exports.Schema = exports.ZodReadonly = exports.ZodPipeline = exports.ZodBranded = exports.BRAND = exports.ZodNaN = exports.ZodCatch = exports.ZodDefault = exports.ZodNullable = exports.ZodOptional = exports.ZodTransformer = exports.ZodEffects = exports.ZodPromise = exports.ZodNativeEnum = exports.ZodEnum = exports.ZodLiteral = exports.ZodLazy = exports.ZodFunction = exports.ZodSet = exports.ZodMap = exports.ZodRecord = exports.ZodTuple = exports.ZodIntersection = exports.ZodDiscriminatedUnion = exports.ZodUnion = exports.ZodObject = exports.ZodArray = exports.ZodVoid = exports.ZodNever = exports.ZodUnknown = exports.ZodAny = exports.ZodNull = exports.ZodUndefined = exports.ZodSymbol = exports.ZodDate = exports.ZodBoolean = exports.ZodBigInt = exports.ZodNumber = exports.ZodString = exports.ZodType = void 0;\nexports.NEVER = exports.void = exports.unknown = exports.union = exports.undefined = exports.tuple = exports.transformer = exports.symbol = exports.string = exports.strictObject = exports.set = exports.record = exports.promise = exports.preprocess = exports.pipeline = exports.ostring = exports.optional = exports.onumber = exports.oboolean = exports.object = exports.number = exports.nullable = exports.null = exports.never = exports.nativeEnum = exports.nan = exports.map = exports.literal = exports.lazy = exports.intersection = exports.instanceof = exports.function = exports.enum = exports.effect = void 0;\nexports.datetimeRegex = datetimeRegex;\nexports.custom = custom;\nconst ZodError_js_1 = require(\"./ZodError.cjs\");\nconst errors_js_1 = require(\"./errors.cjs\");\nconst errorUtil_js_1 = require(\"./helpers/errorUtil.cjs\");\nconst parseUtil_js_1 = require(\"./helpers/parseUtil.cjs\");\nconst util_js_1 = require(\"./helpers/util.cjs\");\nclass ParseInputLazyPath {\n constructor(parent, value, path, key) {\n this._cachedPath = [];\n this.parent = parent;\n this.data = value;\n this._path = path;\n this._key = key;\n }\n get path() {\n if (!this._cachedPath.length) {\n if (Array.isArray(this._key)) {\n this._cachedPath.push(...this._path, ...this._key);\n }\n else {\n this._cachedPath.push(...this._path, this._key);\n }\n }\n return this._cachedPath;\n }\n}\nconst handleResult = (ctx, result) => {\n if ((0, parseUtil_js_1.isValid)(result)) {\n return { success: true, data: result.value };\n }\n else {\n if (!ctx.common.issues.length) {\n throw new Error(\"Validation failed but no issues detected.\");\n }\n return {\n success: false,\n get error() {\n if (this._error)\n return this._error;\n const error = new ZodError_js_1.ZodError(ctx.common.issues);\n this._error = error;\n return this._error;\n },\n };\n }\n};\nfunction processCreateParams(params) {\n if (!params)\n return {};\n const { errorMap, invalid_type_error, required_error, description } = params;\n if (errorMap && (invalid_type_error || required_error)) {\n throw new Error(`Can't use \"invalid_type_error\" or \"required_error\" in conjunction with custom error map.`);\n }\n if (errorMap)\n return { errorMap: errorMap, description };\n const customMap = (iss, ctx) => {\n const { message } = params;\n if (iss.code === \"invalid_enum_value\") {\n return { message: message ?? ctx.defaultError };\n }\n if (typeof ctx.data === \"undefined\") {\n return { message: message ?? required_error ?? ctx.defaultError };\n }\n if (iss.code !== \"invalid_type\")\n return { message: ctx.defaultError };\n return { message: message ?? invalid_type_error ?? ctx.defaultError };\n };\n return { errorMap: customMap, description };\n}\nclass ZodType {\n get description() {\n return this._def.description;\n }\n _getType(input) {\n return (0, util_js_1.getParsedType)(input.data);\n }\n _getOrReturnCtx(input, ctx) {\n return (ctx || {\n common: input.parent.common,\n data: input.data,\n parsedType: (0, util_js_1.getParsedType)(input.data),\n schemaErrorMap: this._def.errorMap,\n path: input.path,\n parent: input.parent,\n });\n }\n _processInputParams(input) {\n return {\n status: new parseUtil_js_1.ParseStatus(),\n ctx: {\n common: input.parent.common,\n data: input.data,\n parsedType: (0, util_js_1.getParsedType)(input.data),\n schemaErrorMap: this._def.errorMap,\n path: input.path,\n parent: input.parent,\n },\n };\n }\n _parseSync(input) {\n const result = this._parse(input);\n if ((0, parseUtil_js_1.isAsync)(result)) {\n throw new Error(\"Synchronous parse encountered promise.\");\n }\n return result;\n }\n _parseAsync(input) {\n const result = this._parse(input);\n return Promise.resolve(result);\n }\n parse(data, params) {\n const result = this.safeParse(data, params);\n if (result.success)\n return result.data;\n throw result.error;\n }\n safeParse(data, params) {\n const ctx = {\n common: {\n issues: [],\n async: params?.async ?? false,\n contextualErrorMap: params?.errorMap,\n },\n path: params?.path || [],\n schemaErrorMap: this._def.errorMap,\n parent: null,\n data,\n parsedType: (0, util_js_1.getParsedType)(data),\n };\n const result = this._parseSync({ data, path: ctx.path, parent: ctx });\n return handleResult(ctx, result);\n }\n \"~validate\"(data) {\n const ctx = {\n common: {\n issues: [],\n async: !!this[\"~standard\"].async,\n },\n path: [],\n schemaErrorMap: this._def.errorMap,\n parent: null,\n data,\n parsedType: (0, util_js_1.getParsedType)(data),\n };\n if (!this[\"~standard\"].async) {\n try {\n const result = this._parseSync({ data, path: [], parent: ctx });\n return (0, parseUtil_js_1.isValid)(result)\n ? {\n value: result.value,\n }\n : {\n issues: ctx.common.issues,\n };\n }\n catch (err) {\n if (err?.message?.toLowerCase()?.includes(\"encountered\")) {\n this[\"~standard\"].async = true;\n }\n ctx.common = {\n issues: [],\n async: true,\n };\n }\n }\n return this._parseAsync({ data, path: [], parent: ctx }).then((result) => (0, parseUtil_js_1.isValid)(result)\n ? {\n value: result.value,\n }\n : {\n issues: ctx.common.issues,\n });\n }\n async parseAsync(data, params) {\n const result = await this.safeParseAsync(data, params);\n if (result.success)\n return result.data;\n throw result.error;\n }\n async safeParseAsync(data, params) {\n const ctx = {\n common: {\n issues: [],\n contextualErrorMap: params?.errorMap,\n async: true,\n },\n path: params?.path || [],\n schemaErrorMap: this._def.errorMap,\n parent: null,\n data,\n parsedType: (0, util_js_1.getParsedType)(data),\n };\n const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx });\n const result = await ((0, parseUtil_js_1.isAsync)(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult));\n return handleResult(ctx, result);\n }\n refine(check, message) {\n const getIssueProperties = (val) => {\n if (typeof message === \"string\" || typeof message === \"undefined\") {\n return { message };\n }\n else if (typeof message === \"function\") {\n return message(val);\n }\n else {\n return message;\n }\n };\n return this._refinement((val, ctx) => {\n const result = check(val);\n const setError = () => ctx.addIssue({\n code: ZodError_js_1.ZodIssueCode.custom,\n ...getIssueProperties(val),\n });\n if (typeof Promise !== \"undefined\" && result instanceof Promise) {\n return result.then((data) => {\n if (!data) {\n setError();\n return false;\n }\n else {\n return true;\n }\n });\n }\n if (!result) {\n setError();\n return false;\n }\n else {\n return true;\n }\n });\n }\n refinement(check, refinementData) {\n return this._refinement((val, ctx) => {\n if (!check(val)) {\n ctx.addIssue(typeof refinementData === \"function\" ? refinementData(val, ctx) : refinementData);\n return false;\n }\n else {\n return true;\n }\n });\n }\n _refinement(refinement) {\n return new ZodEffects({\n schema: this,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect: { type: \"refinement\", refinement },\n });\n }\n superRefine(refinement) {\n return this._refinement(refinement);\n }\n constructor(def) {\n /** Alias of safeParseAsync */\n this.spa = this.safeParseAsync;\n this._def = def;\n this.parse = this.parse.bind(this);\n this.safeParse = this.safeParse.bind(this);\n this.parseAsync = this.parseAsync.bind(this);\n this.safeParseAsync = this.safeParseAsync.bind(this);\n this.spa = this.spa.bind(this);\n this.refine = this.refine.bind(this);\n this.refinement = this.refinement.bind(this);\n this.superRefine = this.superRefine.bind(this);\n this.optional = this.optional.bind(this);\n this.nullable = this.nullable.bind(this);\n this.nullish = this.nullish.bind(this);\n this.array = this.array.bind(this);\n this.promise = this.promise.bind(this);\n this.or = this.or.bind(this);\n this.and = this.and.bind(this);\n this.transform = this.transform.bind(this);\n this.brand = this.brand.bind(this);\n this.default = this.default.bind(this);\n this.catch = this.catch.bind(this);\n this.describe = this.describe.bind(this);\n this.pipe = this.pipe.bind(this);\n this.readonly = this.readonly.bind(this);\n this.isNullable = this.isNullable.bind(this);\n this.isOptional = this.isOptional.bind(this);\n this[\"~standard\"] = {\n version: 1,\n vendor: \"zod\",\n validate: (data) => this[\"~validate\"](data),\n };\n }\n optional() {\n return ZodOptional.create(this, this._def);\n }\n nullable() {\n return ZodNullable.create(this, this._def);\n }\n nullish() {\n return this.nullable().optional();\n }\n array() {\n return ZodArray.create(this);\n }\n promise() {\n return ZodPromise.create(this, this._def);\n }\n or(option) {\n return ZodUnion.create([this, option], this._def);\n }\n and(incoming) {\n return ZodIntersection.create(this, incoming, this._def);\n }\n transform(transform) {\n return new ZodEffects({\n ...processCreateParams(this._def),\n schema: this,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect: { type: \"transform\", transform },\n });\n }\n default(def) {\n const defaultValueFunc = typeof def === \"function\" ? def : () => def;\n return new ZodDefault({\n ...processCreateParams(this._def),\n innerType: this,\n defaultValue: defaultValueFunc,\n typeName: ZodFirstPartyTypeKind.ZodDefault,\n });\n }\n brand() {\n return new ZodBranded({\n typeName: ZodFirstPartyTypeKind.ZodBranded,\n type: this,\n ...processCreateParams(this._def),\n });\n }\n catch(def) {\n const catchValueFunc = typeof def === \"function\" ? def : () => def;\n return new ZodCatch({\n ...processCreateParams(this._def),\n innerType: this,\n catchValue: catchValueFunc,\n typeName: ZodFirstPartyTypeKind.ZodCatch,\n });\n }\n describe(description) {\n const This = this.constructor;\n return new This({\n ...this._def,\n description,\n });\n }\n pipe(target) {\n return ZodPipeline.create(this, target);\n }\n readonly() {\n return ZodReadonly.create(this);\n }\n isOptional() {\n return this.safeParse(undefined).success;\n }\n isNullable() {\n return this.safeParse(null).success;\n }\n}\nexports.ZodType = ZodType;\nexports.Schema = ZodType;\nexports.ZodSchema = ZodType;\nconst cuidRegex = /^c[^\\s-]{8,}$/i;\nconst cuid2Regex = /^[0-9a-z]+$/;\nconst ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/i;\n// const uuidRegex =\n// /^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i;\nconst uuidRegex = /^[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;\nconst nanoidRegex = /^[a-z0-9_-]{21}$/i;\nconst jwtRegex = /^[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]*$/;\nconst durationRegex = /^[-+]?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)?)??$/;\n// from https://stackoverflow.com/a/46181/1550155\n// old version: too slow, didn't support unicode\n// const emailRegex = /^((([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))$/i;\n//old email regex\n// const emailRegex = /^(([^<>()[\\].,;:\\s@\"]+(\\.[^<>()[\\].,;:\\s@\"]+)*)|(\".+\"))@((?!-)([^<>()[\\].,;:\\s@\"]+\\.)+[^<>()[\\].,;:\\s@\"]{1,})[^-<>()[\\].,;:\\s@\"]$/i;\n// eslint-disable-next-line\n// const emailRegex =\n// /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[(((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}))\\])|(\\[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})))\\])|([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*(\\.[A-Za-z]{2,})+))$/;\n// const emailRegex =\n// /^[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])?)*$/;\n// const emailRegex =\n// /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])$/i;\nconst emailRegex = /^(?!\\.)(?!.*\\.\\.)([A-Z0-9_'+\\-\\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\\-]*\\.)+[A-Z]{2,}$/i;\n// const emailRegex =\n// /^[a-z0-9.!#$%&\u2019*+/=?^_`{|}~-]+@[a-z0-9-]+(?:\\.[a-z0-9\\-]+)*$/i;\n// from https://thekevinscott.com/emojis-in-javascript/#writing-a-regular-expression\nconst _emojiRegex = `^(\\\\p{Extended_Pictographic}|\\\\p{Emoji_Component})+$`;\nlet emojiRegex;\n// faster, simpler, safer\nconst ipv4Regex = /^(?:(?: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])$/;\nconst ipv4CidrRegex = /^(?:(?: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])$/;\n// const ipv6Regex =\n// /^(([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})))$/;\nconst ipv6Regex = /^(([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]))$/;\nconst ipv6CidrRegex = /^(([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])$/;\n// https://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript\nconst base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;\n// https://base64.guru/standards/base64url\nconst base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;\n// simple\n// const dateRegexSource = `\\\\d{4}-\\\\d{2}-\\\\d{2}`;\n// no leap year validation\n// const dateRegexSource = `\\\\d{4}-((0[13578]|10|12)-31|(0[13-9]|1[0-2])-30|(0[1-9]|1[0-2])-(0[1-9]|1\\\\d|2\\\\d))`;\n// with leap year validation\nconst dateRegexSource = `((\\\\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])))`;\nconst dateRegex = new RegExp(`^${dateRegexSource}$`);\nfunction timeRegexSource(args) {\n let secondsRegexSource = `[0-5]\\\\d`;\n if (args.precision) {\n secondsRegexSource = `${secondsRegexSource}\\\\.\\\\d{${args.precision}}`;\n }\n else if (args.precision == null) {\n secondsRegexSource = `${secondsRegexSource}(\\\\.\\\\d+)?`;\n }\n const secondsQuantifier = args.precision ? \"+\" : \"?\"; // require seconds if precision is nonzero\n return `([01]\\\\d|2[0-3]):[0-5]\\\\d(:${secondsRegexSource})${secondsQuantifier}`;\n}\nfunction timeRegex(args) {\n return new RegExp(`^${timeRegexSource(args)}$`);\n}\n// Adapted from https://stackoverflow.com/a/3143231\nfunction datetimeRegex(args) {\n let regex = `${dateRegexSource}T${timeRegexSource(args)}`;\n const opts = [];\n opts.push(args.local ? `Z?` : `Z`);\n if (args.offset)\n opts.push(`([+-]\\\\d{2}:?\\\\d{2})`);\n regex = `${regex}(${opts.join(\"|\")})`;\n return new RegExp(`^${regex}$`);\n}\nfunction isValidIP(ip, version) {\n if ((version === \"v4\" || !version) && ipv4Regex.test(ip)) {\n return true;\n }\n if ((version === \"v6\" || !version) && ipv6Regex.test(ip)) {\n return true;\n }\n return false;\n}\nfunction isValidJWT(jwt, alg) {\n if (!jwtRegex.test(jwt))\n return false;\n try {\n const [header] = jwt.split(\".\");\n if (!header)\n return false;\n // Convert base64url to base64\n const base64 = header\n .replace(/-/g, \"+\")\n .replace(/_/g, \"/\")\n .padEnd(header.length + ((4 - (header.length % 4)) % 4), \"=\");\n const decoded = JSON.parse(atob(base64));\n if (typeof decoded !== \"object\" || decoded === null)\n return false;\n if (\"typ\" in decoded && decoded?.typ !== \"JWT\")\n return false;\n if (!decoded.alg)\n return false;\n if (alg && decoded.alg !== alg)\n return false;\n return true;\n }\n catch {\n return false;\n }\n}\nfunction isValidCidr(ip, version) {\n if ((version === \"v4\" || !version) && ipv4CidrRegex.test(ip)) {\n return true;\n }\n if ((version === \"v6\" || !version) && ipv6CidrRegex.test(ip)) {\n return true;\n }\n return false;\n}\nclass ZodString extends ZodType {\n _parse(input) {\n if (this._def.coerce) {\n input.data = String(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== util_js_1.ZodParsedType.string) {\n const ctx = this._getOrReturnCtx(input);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n expected: util_js_1.ZodParsedType.string,\n received: ctx.parsedType,\n });\n return parseUtil_js_1.INVALID;\n }\n const status = new parseUtil_js_1.ParseStatus();\n let ctx = undefined;\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n if (input.data.length < check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.too_small,\n minimum: check.value,\n type: \"string\",\n inclusive: true,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n if (input.data.length > check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.too_big,\n maximum: check.value,\n type: \"string\",\n inclusive: true,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"length\") {\n const tooBig = input.data.length > check.value;\n const tooSmall = input.data.length < check.value;\n if (tooBig || tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n if (tooBig) {\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.too_big,\n maximum: check.value,\n type: \"string\",\n inclusive: true,\n exact: true,\n message: check.message,\n });\n }\n else if (tooSmall) {\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.too_small,\n minimum: check.value,\n type: \"string\",\n inclusive: true,\n exact: true,\n message: check.message,\n });\n }\n status.dirty();\n }\n }\n else if (check.kind === \"email\") {\n if (!emailRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n validation: \"email\",\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"emoji\") {\n if (!emojiRegex) {\n emojiRegex = new RegExp(_emojiRegex, \"u\");\n }\n if (!emojiRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n validation: \"emoji\",\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"uuid\") {\n if (!uuidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n validation: \"uuid\",\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"nanoid\") {\n if (!nanoidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n validation: \"nanoid\",\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"cuid\") {\n if (!cuidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n validation: \"cuid\",\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"cuid2\") {\n if (!cuid2Regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n validation: \"cuid2\",\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"ulid\") {\n if (!ulidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n validation: \"ulid\",\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"url\") {\n try {\n new URL(input.data);\n }\n catch {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n validation: \"url\",\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"regex\") {\n check.regex.lastIndex = 0;\n const testResult = check.regex.test(input.data);\n if (!testResult) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n validation: \"regex\",\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"trim\") {\n input.data = input.data.trim();\n }\n else if (check.kind === \"includes\") {\n if (!input.data.includes(check.value, check.position)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n validation: { includes: check.value, position: check.position },\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"toLowerCase\") {\n input.data = input.data.toLowerCase();\n }\n else if (check.kind === \"toUpperCase\") {\n input.data = input.data.toUpperCase();\n }\n else if (check.kind === \"startsWith\") {\n if (!input.data.startsWith(check.value)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n validation: { startsWith: check.value },\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"endsWith\") {\n if (!input.data.endsWith(check.value)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n validation: { endsWith: check.value },\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"datetime\") {\n const regex = datetimeRegex(check);\n if (!regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n validation: \"datetime\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"date\") {\n const regex = dateRegex;\n if (!regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n validation: \"date\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"time\") {\n const regex = timeRegex(check);\n if (!regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n validation: \"time\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"duration\") {\n if (!durationRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n validation: \"duration\",\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"ip\") {\n if (!isValidIP(input.data, check.version)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n validation: \"ip\",\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"jwt\") {\n if (!isValidJWT(input.data, check.alg)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n validation: \"jwt\",\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"cidr\") {\n if (!isValidCidr(input.data, check.version)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n validation: \"cidr\",\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"base64\") {\n if (!base64Regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n validation: \"base64\",\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"base64url\") {\n if (!base64urlRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n validation: \"base64url\",\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else {\n util_js_1.util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n _regex(regex, validation, message) {\n return this.refinement((data) => regex.test(data), {\n validation,\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n ...errorUtil_js_1.errorUtil.errToObj(message),\n });\n }\n _addCheck(check) {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n email(message) {\n return this._addCheck({ kind: \"email\", ...errorUtil_js_1.errorUtil.errToObj(message) });\n }\n url(message) {\n return this._addCheck({ kind: \"url\", ...errorUtil_js_1.errorUtil.errToObj(message) });\n }\n emoji(message) {\n return this._addCheck({ kind: \"emoji\", ...errorUtil_js_1.errorUtil.errToObj(message) });\n }\n uuid(message) {\n return this._addCheck({ kind: \"uuid\", ...errorUtil_js_1.errorUtil.errToObj(message) });\n }\n nanoid(message) {\n return this._addCheck({ kind: \"nanoid\", ...errorUtil_js_1.errorUtil.errToObj(message) });\n }\n cuid(message) {\n return this._addCheck({ kind: \"cuid\", ...errorUtil_js_1.errorUtil.errToObj(message) });\n }\n cuid2(message) {\n return this._addCheck({ kind: \"cuid2\", ...errorUtil_js_1.errorUtil.errToObj(message) });\n }\n ulid(message) {\n return this._addCheck({ kind: \"ulid\", ...errorUtil_js_1.errorUtil.errToObj(message) });\n }\n base64(message) {\n return this._addCheck({ kind: \"base64\", ...errorUtil_js_1.errorUtil.errToObj(message) });\n }\n base64url(message) {\n // base64url encoding is a modification of base64 that can safely be used in URLs and filenames\n return this._addCheck({\n kind: \"base64url\",\n ...errorUtil_js_1.errorUtil.errToObj(message),\n });\n }\n jwt(options) {\n return this._addCheck({ kind: \"jwt\", ...errorUtil_js_1.errorUtil.errToObj(options) });\n }\n ip(options) {\n return this._addCheck({ kind: \"ip\", ...errorUtil_js_1.errorUtil.errToObj(options) });\n }\n cidr(options) {\n return this._addCheck({ kind: \"cidr\", ...errorUtil_js_1.errorUtil.errToObj(options) });\n }\n datetime(options) {\n if (typeof options === \"string\") {\n return this._addCheck({\n kind: \"datetime\",\n precision: null,\n offset: false,\n local: false,\n message: options,\n });\n }\n return this._addCheck({\n kind: \"datetime\",\n precision: typeof options?.precision === \"undefined\" ? null : options?.precision,\n offset: options?.offset ?? false,\n local: options?.local ?? false,\n ...errorUtil_js_1.errorUtil.errToObj(options?.message),\n });\n }\n date(message) {\n return this._addCheck({ kind: \"date\", message });\n }\n time(options) {\n if (typeof options === \"string\") {\n return this._addCheck({\n kind: \"time\",\n precision: null,\n message: options,\n });\n }\n return this._addCheck({\n kind: \"time\",\n precision: typeof options?.precision === \"undefined\" ? null : options?.precision,\n ...errorUtil_js_1.errorUtil.errToObj(options?.message),\n });\n }\n duration(message) {\n return this._addCheck({ kind: \"duration\", ...errorUtil_js_1.errorUtil.errToObj(message) });\n }\n regex(regex, message) {\n return this._addCheck({\n kind: \"regex\",\n regex: regex,\n ...errorUtil_js_1.errorUtil.errToObj(message),\n });\n }\n includes(value, options) {\n return this._addCheck({\n kind: \"includes\",\n value: value,\n position: options?.position,\n ...errorUtil_js_1.errorUtil.errToObj(options?.message),\n });\n }\n startsWith(value, message) {\n return this._addCheck({\n kind: \"startsWith\",\n value: value,\n ...errorUtil_js_1.errorUtil.errToObj(message),\n });\n }\n endsWith(value, message) {\n return this._addCheck({\n kind: \"endsWith\",\n value: value,\n ...errorUtil_js_1.errorUtil.errToObj(message),\n });\n }\n min(minLength, message) {\n return this._addCheck({\n kind: \"min\",\n value: minLength,\n ...errorUtil_js_1.errorUtil.errToObj(message),\n });\n }\n max(maxLength, message) {\n return this._addCheck({\n kind: \"max\",\n value: maxLength,\n ...errorUtil_js_1.errorUtil.errToObj(message),\n });\n }\n length(len, message) {\n return this._addCheck({\n kind: \"length\",\n value: len,\n ...errorUtil_js_1.errorUtil.errToObj(message),\n });\n }\n /**\n * Equivalent to `.min(1)`\n */\n nonempty(message) {\n return this.min(1, errorUtil_js_1.errorUtil.errToObj(message));\n }\n trim() {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"trim\" }],\n });\n }\n toLowerCase() {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"toLowerCase\" }],\n });\n }\n toUpperCase() {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"toUpperCase\" }],\n });\n }\n get isDatetime() {\n return !!this._def.checks.find((ch) => ch.kind === \"datetime\");\n }\n get isDate() {\n return !!this._def.checks.find((ch) => ch.kind === \"date\");\n }\n get isTime() {\n return !!this._def.checks.find((ch) => ch.kind === \"time\");\n }\n get isDuration() {\n return !!this._def.checks.find((ch) => ch.kind === \"duration\");\n }\n get isEmail() {\n return !!this._def.checks.find((ch) => ch.kind === \"email\");\n }\n get isURL() {\n return !!this._def.checks.find((ch) => ch.kind === \"url\");\n }\n get isEmoji() {\n return !!this._def.checks.find((ch) => ch.kind === \"emoji\");\n }\n get isUUID() {\n return !!this._def.checks.find((ch) => ch.kind === \"uuid\");\n }\n get isNANOID() {\n return !!this._def.checks.find((ch) => ch.kind === \"nanoid\");\n }\n get isCUID() {\n return !!this._def.checks.find((ch) => ch.kind === \"cuid\");\n }\n get isCUID2() {\n return !!this._def.checks.find((ch) => ch.kind === \"cuid2\");\n }\n get isULID() {\n return !!this._def.checks.find((ch) => ch.kind === \"ulid\");\n }\n get isIP() {\n return !!this._def.checks.find((ch) => ch.kind === \"ip\");\n }\n get isCIDR() {\n return !!this._def.checks.find((ch) => ch.kind === \"cidr\");\n }\n get isBase64() {\n return !!this._def.checks.find((ch) => ch.kind === \"base64\");\n }\n get isBase64url() {\n // base64url encoding is a modification of base64 that can safely be used in URLs and filenames\n return !!this._def.checks.find((ch) => ch.kind === \"base64url\");\n }\n get minLength() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxLength() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n}\nexports.ZodString = ZodString;\nZodString.create = (params) => {\n return new ZodString({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodString,\n coerce: params?.coerce ?? false,\n ...processCreateParams(params),\n });\n};\n// https://stackoverflow.com/questions/3966484/why-does-modulus-operator-return-fractional-number-in-javascript/31711034#31711034\nfunction floatSafeRemainder(val, step) {\n const valDecCount = (val.toString().split(\".\")[1] || \"\").length;\n const stepDecCount = (step.toString().split(\".\")[1] || \"\").length;\n const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;\n const valInt = Number.parseInt(val.toFixed(decCount).replace(\".\", \"\"));\n const stepInt = Number.parseInt(step.toFixed(decCount).replace(\".\", \"\"));\n return (valInt % stepInt) / 10 ** decCount;\n}\nclass ZodNumber extends ZodType {\n constructor() {\n super(...arguments);\n this.min = this.gte;\n this.max = this.lte;\n this.step = this.multipleOf;\n }\n _parse(input) {\n if (this._def.coerce) {\n input.data = Number(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== util_js_1.ZodParsedType.number) {\n const ctx = this._getOrReturnCtx(input);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n expected: util_js_1.ZodParsedType.number,\n received: ctx.parsedType,\n });\n return parseUtil_js_1.INVALID;\n }\n let ctx = undefined;\n const status = new parseUtil_js_1.ParseStatus();\n for (const check of this._def.checks) {\n if (check.kind === \"int\") {\n if (!util_js_1.util.isInteger(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n expected: \"integer\",\n received: \"float\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"min\") {\n const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;\n if (tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.too_small,\n minimum: check.value,\n type: \"number\",\n inclusive: check.inclusive,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;\n if (tooBig) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.too_big,\n maximum: check.value,\n type: \"number\",\n inclusive: check.inclusive,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"multipleOf\") {\n if (floatSafeRemainder(input.data, check.value) !== 0) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.not_multiple_of,\n multipleOf: check.value,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"finite\") {\n if (!Number.isFinite(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.not_finite,\n message: check.message,\n });\n status.dirty();\n }\n }\n else {\n util_js_1.util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n gte(value, message) {\n return this.setLimit(\"min\", value, true, errorUtil_js_1.errorUtil.toString(message));\n }\n gt(value, message) {\n return this.setLimit(\"min\", value, false, errorUtil_js_1.errorUtil.toString(message));\n }\n lte(value, message) {\n return this.setLimit(\"max\", value, true, errorUtil_js_1.errorUtil.toString(message));\n }\n lt(value, message) {\n return this.setLimit(\"max\", value, false, errorUtil_js_1.errorUtil.toString(message));\n }\n setLimit(kind, value, inclusive, message) {\n return new ZodNumber({\n ...this._def,\n checks: [\n ...this._def.checks,\n {\n kind,\n value,\n inclusive,\n message: errorUtil_js_1.errorUtil.toString(message),\n },\n ],\n });\n }\n _addCheck(check) {\n return new ZodNumber({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n int(message) {\n return this._addCheck({\n kind: \"int\",\n message: errorUtil_js_1.errorUtil.toString(message),\n });\n }\n positive(message) {\n return this._addCheck({\n kind: \"min\",\n value: 0,\n inclusive: false,\n message: errorUtil_js_1.errorUtil.toString(message),\n });\n }\n negative(message) {\n return this._addCheck({\n kind: \"max\",\n value: 0,\n inclusive: false,\n message: errorUtil_js_1.errorUtil.toString(message),\n });\n }\n nonpositive(message) {\n return this._addCheck({\n kind: \"max\",\n value: 0,\n inclusive: true,\n message: errorUtil_js_1.errorUtil.toString(message),\n });\n }\n nonnegative(message) {\n return this._addCheck({\n kind: \"min\",\n value: 0,\n inclusive: true,\n message: errorUtil_js_1.errorUtil.toString(message),\n });\n }\n multipleOf(value, message) {\n return this._addCheck({\n kind: \"multipleOf\",\n value: value,\n message: errorUtil_js_1.errorUtil.toString(message),\n });\n }\n finite(message) {\n return this._addCheck({\n kind: \"finite\",\n message: errorUtil_js_1.errorUtil.toString(message),\n });\n }\n safe(message) {\n return this._addCheck({\n kind: \"min\",\n inclusive: true,\n value: Number.MIN_SAFE_INTEGER,\n message: errorUtil_js_1.errorUtil.toString(message),\n })._addCheck({\n kind: \"max\",\n inclusive: true,\n value: Number.MAX_SAFE_INTEGER,\n message: errorUtil_js_1.errorUtil.toString(message),\n });\n }\n get minValue() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxValue() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n get isInt() {\n return !!this._def.checks.find((ch) => ch.kind === \"int\" || (ch.kind === \"multipleOf\" && util_js_1.util.isInteger(ch.value)));\n }\n get isFinite() {\n let max = null;\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"finite\" || ch.kind === \"int\" || ch.kind === \"multipleOf\") {\n return true;\n }\n else if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n else if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return Number.isFinite(min) && Number.isFinite(max);\n }\n}\nexports.ZodNumber = ZodNumber;\nZodNumber.create = (params) => {\n return new ZodNumber({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodNumber,\n coerce: params?.coerce || false,\n ...processCreateParams(params),\n });\n};\nclass ZodBigInt extends ZodType {\n constructor() {\n super(...arguments);\n this.min = this.gte;\n this.max = this.lte;\n }\n _parse(input) {\n if (this._def.coerce) {\n try {\n input.data = BigInt(input.data);\n }\n catch {\n return this._getInvalidInput(input);\n }\n }\n const parsedType = this._getType(input);\n if (parsedType !== util_js_1.ZodParsedType.bigint) {\n return this._getInvalidInput(input);\n }\n let ctx = undefined;\n const status = new parseUtil_js_1.ParseStatus();\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;\n if (tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.too_small,\n type: \"bigint\",\n minimum: check.value,\n inclusive: check.inclusive,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;\n if (tooBig) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.too_big,\n type: \"bigint\",\n maximum: check.value,\n inclusive: check.inclusive,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"multipleOf\") {\n if (input.data % check.value !== BigInt(0)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.not_multiple_of,\n multipleOf: check.value,\n message: check.message,\n });\n status.dirty();\n }\n }\n else {\n util_js_1.util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n _getInvalidInput(input) {\n const ctx = this._getOrReturnCtx(input);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n expected: util_js_1.ZodParsedType.bigint,\n received: ctx.parsedType,\n });\n return parseUtil_js_1.INVALID;\n }\n gte(value, message) {\n return this.setLimit(\"min\", value, true, errorUtil_js_1.errorUtil.toString(message));\n }\n gt(value, message) {\n return this.setLimit(\"min\", value, false, errorUtil_js_1.errorUtil.toString(message));\n }\n lte(value, message) {\n return this.setLimit(\"max\", value, true, errorUtil_js_1.errorUtil.toString(message));\n }\n lt(value, message) {\n return this.setLimit(\"max\", value, false, errorUtil_js_1.errorUtil.toString(message));\n }\n setLimit(kind, value, inclusive, message) {\n return new ZodBigInt({\n ...this._def,\n checks: [\n ...this._def.checks,\n {\n kind,\n value,\n inclusive,\n message: errorUtil_js_1.errorUtil.toString(message),\n },\n ],\n });\n }\n _addCheck(check) {\n return new ZodBigInt({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n positive(message) {\n return this._addCheck({\n kind: \"min\",\n value: BigInt(0),\n inclusive: false,\n message: errorUtil_js_1.errorUtil.toString(message),\n });\n }\n negative(message) {\n return this._addCheck({\n kind: \"max\",\n value: BigInt(0),\n inclusive: false,\n message: errorUtil_js_1.errorUtil.toString(message),\n });\n }\n nonpositive(message) {\n return this._addCheck({\n kind: \"max\",\n value: BigInt(0),\n inclusive: true,\n message: errorUtil_js_1.errorUtil.toString(message),\n });\n }\n nonnegative(message) {\n return this._addCheck({\n kind: \"min\",\n value: BigInt(0),\n inclusive: true,\n message: errorUtil_js_1.errorUtil.toString(message),\n });\n }\n multipleOf(value, message) {\n return this._addCheck({\n kind: \"multipleOf\",\n value,\n message: errorUtil_js_1.errorUtil.toString(message),\n });\n }\n get minValue() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxValue() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n}\nexports.ZodBigInt = ZodBigInt;\nZodBigInt.create = (params) => {\n return new ZodBigInt({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodBigInt,\n coerce: params?.coerce ?? false,\n ...processCreateParams(params),\n });\n};\nclass ZodBoolean extends ZodType {\n _parse(input) {\n if (this._def.coerce) {\n input.data = Boolean(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== util_js_1.ZodParsedType.boolean) {\n const ctx = this._getOrReturnCtx(input);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n expected: util_js_1.ZodParsedType.boolean,\n received: ctx.parsedType,\n });\n return parseUtil_js_1.INVALID;\n }\n return (0, parseUtil_js_1.OK)(input.data);\n }\n}\nexports.ZodBoolean = ZodBoolean;\nZodBoolean.create = (params) => {\n return new ZodBoolean({\n typeName: ZodFirstPartyTypeKind.ZodBoolean,\n coerce: params?.coerce || false,\n ...processCreateParams(params),\n });\n};\nclass ZodDate extends ZodType {\n _parse(input) {\n if (this._def.coerce) {\n input.data = new Date(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== util_js_1.ZodParsedType.date) {\n const ctx = this._getOrReturnCtx(input);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n expected: util_js_1.ZodParsedType.date,\n received: ctx.parsedType,\n });\n return parseUtil_js_1.INVALID;\n }\n if (Number.isNaN(input.data.getTime())) {\n const ctx = this._getOrReturnCtx(input);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_date,\n });\n return parseUtil_js_1.INVALID;\n }\n const status = new parseUtil_js_1.ParseStatus();\n let ctx = undefined;\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n if (input.data.getTime() < check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.too_small,\n message: check.message,\n inclusive: true,\n exact: false,\n minimum: check.value,\n type: \"date\",\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n if (input.data.getTime() > check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.too_big,\n message: check.message,\n inclusive: true,\n exact: false,\n maximum: check.value,\n type: \"date\",\n });\n status.dirty();\n }\n }\n else {\n util_js_1.util.assertNever(check);\n }\n }\n return {\n status: status.value,\n value: new Date(input.data.getTime()),\n };\n }\n _addCheck(check) {\n return new ZodDate({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n min(minDate, message) {\n return this._addCheck({\n kind: \"min\",\n value: minDate.getTime(),\n message: errorUtil_js_1.errorUtil.toString(message),\n });\n }\n max(maxDate, message) {\n return this._addCheck({\n kind: \"max\",\n value: maxDate.getTime(),\n message: errorUtil_js_1.errorUtil.toString(message),\n });\n }\n get minDate() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min != null ? new Date(min) : null;\n }\n get maxDate() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max != null ? new Date(max) : null;\n }\n}\nexports.ZodDate = ZodDate;\nZodDate.create = (params) => {\n return new ZodDate({\n checks: [],\n coerce: params?.coerce || false,\n typeName: ZodFirstPartyTypeKind.ZodDate,\n ...processCreateParams(params),\n });\n};\nclass ZodSymbol extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== util_js_1.ZodParsedType.symbol) {\n const ctx = this._getOrReturnCtx(input);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n expected: util_js_1.ZodParsedType.symbol,\n received: ctx.parsedType,\n });\n return parseUtil_js_1.INVALID;\n }\n return (0, parseUtil_js_1.OK)(input.data);\n }\n}\nexports.ZodSymbol = ZodSymbol;\nZodSymbol.create = (params) => {\n return new ZodSymbol({\n typeName: ZodFirstPartyTypeKind.ZodSymbol,\n ...processCreateParams(params),\n });\n};\nclass ZodUndefined extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== util_js_1.ZodParsedType.undefined) {\n const ctx = this._getOrReturnCtx(input);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n expected: util_js_1.ZodParsedType.undefined,\n received: ctx.parsedType,\n });\n return parseUtil_js_1.INVALID;\n }\n return (0, parseUtil_js_1.OK)(input.data);\n }\n}\nexports.ZodUndefined = ZodUndefined;\nZodUndefined.create = (params) => {\n return new ZodUndefined({\n typeName: ZodFirstPartyTypeKind.ZodUndefined,\n ...processCreateParams(params),\n });\n};\nclass ZodNull extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== util_js_1.ZodParsedType.null) {\n const ctx = this._getOrReturnCtx(input);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n expected: util_js_1.ZodParsedType.null,\n received: ctx.parsedType,\n });\n return parseUtil_js_1.INVALID;\n }\n return (0, parseUtil_js_1.OK)(input.data);\n }\n}\nexports.ZodNull = ZodNull;\nZodNull.create = (params) => {\n return new ZodNull({\n typeName: ZodFirstPartyTypeKind.ZodNull,\n ...processCreateParams(params),\n });\n};\nclass ZodAny extends ZodType {\n constructor() {\n super(...arguments);\n // to prevent instances of other classes from extending ZodAny. this causes issues with catchall in ZodObject.\n this._any = true;\n }\n _parse(input) {\n return (0, parseUtil_js_1.OK)(input.data);\n }\n}\nexports.ZodAny = ZodAny;\nZodAny.create = (params) => {\n return new ZodAny({\n typeName: ZodFirstPartyTypeKind.ZodAny,\n ...processCreateParams(params),\n });\n};\nclass ZodUnknown extends ZodType {\n constructor() {\n super(...arguments);\n // required\n this._unknown = true;\n }\n _parse(input) {\n return (0, parseUtil_js_1.OK)(input.data);\n }\n}\nexports.ZodUnknown = ZodUnknown;\nZodUnknown.create = (params) => {\n return new ZodUnknown({\n typeName: ZodFirstPartyTypeKind.ZodUnknown,\n ...processCreateParams(params),\n });\n};\nclass ZodNever extends ZodType {\n _parse(input) {\n const ctx = this._getOrReturnCtx(input);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n expected: util_js_1.ZodParsedType.never,\n received: ctx.parsedType,\n });\n return parseUtil_js_1.INVALID;\n }\n}\nexports.ZodNever = ZodNever;\nZodNever.create = (params) => {\n return new ZodNever({\n typeName: ZodFirstPartyTypeKind.ZodNever,\n ...processCreateParams(params),\n });\n};\nclass ZodVoid extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== util_js_1.ZodParsedType.undefined) {\n const ctx = this._getOrReturnCtx(input);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n expected: util_js_1.ZodParsedType.void,\n received: ctx.parsedType,\n });\n return parseUtil_js_1.INVALID;\n }\n return (0, parseUtil_js_1.OK)(input.data);\n }\n}\nexports.ZodVoid = ZodVoid;\nZodVoid.create = (params) => {\n return new ZodVoid({\n typeName: ZodFirstPartyTypeKind.ZodVoid,\n ...processCreateParams(params),\n });\n};\nclass ZodArray extends ZodType {\n _parse(input) {\n const { ctx, status } = this._processInputParams(input);\n const def = this._def;\n if (ctx.parsedType !== util_js_1.ZodParsedType.array) {\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n expected: util_js_1.ZodParsedType.array,\n received: ctx.parsedType,\n });\n return parseUtil_js_1.INVALID;\n }\n if (def.exactLength !== null) {\n const tooBig = ctx.data.length > def.exactLength.value;\n const tooSmall = ctx.data.length < def.exactLength.value;\n if (tooBig || tooSmall) {\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: tooBig ? ZodError_js_1.ZodIssueCode.too_big : ZodError_js_1.ZodIssueCode.too_small,\n minimum: (tooSmall ? def.exactLength.value : undefined),\n maximum: (tooBig ? def.exactLength.value : undefined),\n type: \"array\",\n inclusive: true,\n exact: true,\n message: def.exactLength.message,\n });\n status.dirty();\n }\n }\n if (def.minLength !== null) {\n if (ctx.data.length < def.minLength.value) {\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.too_small,\n minimum: def.minLength.value,\n type: \"array\",\n inclusive: true,\n exact: false,\n message: def.minLength.message,\n });\n status.dirty();\n }\n }\n if (def.maxLength !== null) {\n if (ctx.data.length > def.maxLength.value) {\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.too_big,\n maximum: def.maxLength.value,\n type: \"array\",\n inclusive: true,\n exact: false,\n message: def.maxLength.message,\n });\n status.dirty();\n }\n }\n if (ctx.common.async) {\n return Promise.all([...ctx.data].map((item, i) => {\n return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));\n })).then((result) => {\n return parseUtil_js_1.ParseStatus.mergeArray(status, result);\n });\n }\n const result = [...ctx.data].map((item, i) => {\n return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));\n });\n return parseUtil_js_1.ParseStatus.mergeArray(status, result);\n }\n get element() {\n return this._def.type;\n }\n min(minLength, message) {\n return new ZodArray({\n ...this._def,\n minLength: { value: minLength, message: errorUtil_js_1.errorUtil.toString(message) },\n });\n }\n max(maxLength, message) {\n return new ZodArray({\n ...this._def,\n maxLength: { value: maxLength, message: errorUtil_js_1.errorUtil.toString(message) },\n });\n }\n length(len, message) {\n return new ZodArray({\n ...this._def,\n exactLength: { value: len, message: errorUtil_js_1.errorUtil.toString(message) },\n });\n }\n nonempty(message) {\n return this.min(1, message);\n }\n}\nexports.ZodArray = ZodArray;\nZodArray.create = (schema, params) => {\n return new ZodArray({\n type: schema,\n minLength: null,\n maxLength: null,\n exactLength: null,\n typeName: ZodFirstPartyTypeKind.ZodArray,\n ...processCreateParams(params),\n });\n};\nfunction deepPartialify(schema) {\n if (schema instanceof ZodObject) {\n const newShape = {};\n for (const key in schema.shape) {\n const fieldSchema = schema.shape[key];\n newShape[key] = ZodOptional.create(deepPartialify(fieldSchema));\n }\n return new ZodObject({\n ...schema._def,\n shape: () => newShape,\n });\n }\n else if (schema instanceof ZodArray) {\n return new ZodArray({\n ...schema._def,\n type: deepPartialify(schema.element),\n });\n }\n else if (schema instanceof ZodOptional) {\n return ZodOptional.create(deepPartialify(schema.unwrap()));\n }\n else if (schema instanceof ZodNullable) {\n return ZodNullable.create(deepPartialify(schema.unwrap()));\n }\n else if (schema instanceof ZodTuple) {\n return ZodTuple.create(schema.items.map((item) => deepPartialify(item)));\n }\n else {\n return schema;\n }\n}\nclass ZodObject extends ZodType {\n constructor() {\n super(...arguments);\n this._cached = null;\n /**\n * @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped.\n * If you want to pass through unknown properties, use `.passthrough()` instead.\n */\n this.nonstrict = this.passthrough;\n // extend<\n // Augmentation extends ZodRawShape,\n // NewOutput extends util.flatten<{\n // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation\n // ? Augmentation[k][\"_output\"]\n // : k extends keyof Output\n // ? Output[k]\n // : never;\n // }>,\n // NewInput extends util.flatten<{\n // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation\n // ? Augmentation[k][\"_input\"]\n // : k extends keyof Input\n // ? Input[k]\n // : never;\n // }>\n // >(\n // augmentation: Augmentation\n // ): ZodObject<\n // extendShape<T, Augmentation>,\n // UnknownKeys,\n // Catchall,\n // NewOutput,\n // NewInput\n // > {\n // return new ZodObject({\n // ...this._def,\n // shape: () => ({\n // ...this._def.shape(),\n // ...augmentation,\n // }),\n // }) as any;\n // }\n /**\n * @deprecated Use `.extend` instead\n * */\n this.augment = this.extend;\n }\n _getCached() {\n if (this._cached !== null)\n return this._cached;\n const shape = this._def.shape();\n const keys = util_js_1.util.objectKeys(shape);\n this._cached = { shape, keys };\n return this._cached;\n }\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== util_js_1.ZodParsedType.object) {\n const ctx = this._getOrReturnCtx(input);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n expected: util_js_1.ZodParsedType.object,\n received: ctx.parsedType,\n });\n return parseUtil_js_1.INVALID;\n }\n const { status, ctx } = this._processInputParams(input);\n const { shape, keys: shapeKeys } = this._getCached();\n const extraKeys = [];\n if (!(this._def.catchall instanceof ZodNever && this._def.unknownKeys === \"strip\")) {\n for (const key in ctx.data) {\n if (!shapeKeys.includes(key)) {\n extraKeys.push(key);\n }\n }\n }\n const pairs = [];\n for (const key of shapeKeys) {\n const keyValidator = shape[key];\n const value = ctx.data[key];\n pairs.push({\n key: { status: \"valid\", value: key },\n value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),\n alwaysSet: key in ctx.data,\n });\n }\n if (this._def.catchall instanceof ZodNever) {\n const unknownKeys = this._def.unknownKeys;\n if (unknownKeys === \"passthrough\") {\n for (const key of extraKeys) {\n pairs.push({\n key: { status: \"valid\", value: key },\n value: { status: \"valid\", value: ctx.data[key] },\n });\n }\n }\n else if (unknownKeys === \"strict\") {\n if (extraKeys.length > 0) {\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.unrecognized_keys,\n keys: extraKeys,\n });\n status.dirty();\n }\n }\n else if (unknownKeys === \"strip\") {\n }\n else {\n throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);\n }\n }\n else {\n // run catchall validation\n const catchall = this._def.catchall;\n for (const key of extraKeys) {\n const value = ctx.data[key];\n pairs.push({\n key: { status: \"valid\", value: key },\n value: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key) //, ctx.child(key), value, getParsedType(value)\n ),\n alwaysSet: key in ctx.data,\n });\n }\n }\n if (ctx.common.async) {\n return Promise.resolve()\n .then(async () => {\n const syncPairs = [];\n for (const pair of pairs) {\n const key = await pair.key;\n const value = await pair.value;\n syncPairs.push({\n key,\n value,\n alwaysSet: pair.alwaysSet,\n });\n }\n return syncPairs;\n })\n .then((syncPairs) => {\n return parseUtil_js_1.ParseStatus.mergeObjectSync(status, syncPairs);\n });\n }\n else {\n return parseUtil_js_1.ParseStatus.mergeObjectSync(status, pairs);\n }\n }\n get shape() {\n return this._def.shape();\n }\n strict(message) {\n errorUtil_js_1.errorUtil.errToObj;\n return new ZodObject({\n ...this._def,\n unknownKeys: \"strict\",\n ...(message !== undefined\n ? {\n errorMap: (issue, ctx) => {\n const defaultError = this._def.errorMap?.(issue, ctx).message ?? ctx.defaultError;\n if (issue.code === \"unrecognized_keys\")\n return {\n message: errorUtil_js_1.errorUtil.errToObj(message).message ?? defaultError,\n };\n return {\n message: defaultError,\n };\n },\n }\n : {}),\n });\n }\n strip() {\n return new ZodObject({\n ...this._def,\n unknownKeys: \"strip\",\n });\n }\n passthrough() {\n return new ZodObject({\n ...this._def,\n unknownKeys: \"passthrough\",\n });\n }\n // const AugmentFactory =\n // <Def extends ZodObjectDef>(def: Def) =>\n // <Augmentation extends ZodRawShape>(\n // augmentation: Augmentation\n // ): ZodObject<\n // extendShape<ReturnType<Def[\"shape\"]>, Augmentation>,\n // Def[\"unknownKeys\"],\n // Def[\"catchall\"]\n // > => {\n // return new ZodObject({\n // ...def,\n // shape: () => ({\n // ...def.shape(),\n // ...augmentation,\n // }),\n // }) as any;\n // };\n extend(augmentation) {\n return new ZodObject({\n ...this._def,\n shape: () => ({\n ...this._def.shape(),\n ...augmentation,\n }),\n });\n }\n /**\n * Prior to zod@1.0.12 there was a bug in the\n * inferred type of merged objects. Please\n * upgrade if you are experiencing issues.\n */\n merge(merging) {\n const merged = new ZodObject({\n unknownKeys: merging._def.unknownKeys,\n catchall: merging._def.catchall,\n shape: () => ({\n ...this._def.shape(),\n ...merging._def.shape(),\n }),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n });\n return merged;\n }\n // merge<\n // Incoming extends AnyZodObject,\n // Augmentation extends Incoming[\"shape\"],\n // NewOutput extends {\n // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation\n // ? Augmentation[k][\"_output\"]\n // : k extends keyof Output\n // ? Output[k]\n // : never;\n // },\n // NewInput extends {\n // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation\n // ? Augmentation[k][\"_input\"]\n // : k extends keyof Input\n // ? Input[k]\n // : never;\n // }\n // >(\n // merging: Incoming\n // ): ZodObject<\n // extendShape<T, ReturnType<Incoming[\"_def\"][\"shape\"]>>,\n // Incoming[\"_def\"][\"unknownKeys\"],\n // Incoming[\"_def\"][\"catchall\"],\n // NewOutput,\n // NewInput\n // > {\n // const merged: any = new ZodObject({\n // unknownKeys: merging._def.unknownKeys,\n // catchall: merging._def.catchall,\n // shape: () =>\n // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),\n // typeName: ZodFirstPartyTypeKind.ZodObject,\n // }) as any;\n // return merged;\n // }\n setKey(key, schema) {\n return this.augment({ [key]: schema });\n }\n // merge<Incoming extends AnyZodObject>(\n // merging: Incoming\n // ): //ZodObject<T & Incoming[\"_shape\"], UnknownKeys, Catchall> = (merging) => {\n // ZodObject<\n // extendShape<T, ReturnType<Incoming[\"_def\"][\"shape\"]>>,\n // Incoming[\"_def\"][\"unknownKeys\"],\n // Incoming[\"_def\"][\"catchall\"]\n // > {\n // // const mergedShape = objectUtil.mergeShapes(\n // // this._def.shape(),\n // // merging._def.shape()\n // // );\n // const merged: any = new ZodObject({\n // unknownKeys: merging._def.unknownKeys,\n // catchall: merging._def.catchall,\n // shape: () =>\n // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),\n // typeName: ZodFirstPartyTypeKind.ZodObject,\n // }) as any;\n // return merged;\n // }\n catchall(index) {\n return new ZodObject({\n ...this._def,\n catchall: index,\n });\n }\n pick(mask) {\n const shape = {};\n for (const key of util_js_1.util.objectKeys(mask)) {\n if (mask[key] && this.shape[key]) {\n shape[key] = this.shape[key];\n }\n }\n return new ZodObject({\n ...this._def,\n shape: () => shape,\n });\n }\n omit(mask) {\n const shape = {};\n for (const key of util_js_1.util.objectKeys(this.shape)) {\n if (!mask[key]) {\n shape[key] = this.shape[key];\n }\n }\n return new ZodObject({\n ...this._def,\n shape: () => shape,\n });\n }\n /**\n * @deprecated\n */\n deepPartial() {\n return deepPartialify(this);\n }\n partial(mask) {\n const newShape = {};\n for (const key of util_js_1.util.objectKeys(this.shape)) {\n const fieldSchema = this.shape[key];\n if (mask && !mask[key]) {\n newShape[key] = fieldSchema;\n }\n else {\n newShape[key] = fieldSchema.optional();\n }\n }\n return new ZodObject({\n ...this._def,\n shape: () => newShape,\n });\n }\n required(mask) {\n const newShape = {};\n for (const key of util_js_1.util.objectKeys(this.shape)) {\n if (mask && !mask[key]) {\n newShape[key] = this.shape[key];\n }\n else {\n const fieldSchema = this.shape[key];\n let newField = fieldSchema;\n while (newField instanceof ZodOptional) {\n newField = newField._def.innerType;\n }\n newShape[key] = newField;\n }\n }\n return new ZodObject({\n ...this._def,\n shape: () => newShape,\n });\n }\n keyof() {\n return createZodEnum(util_js_1.util.objectKeys(this.shape));\n }\n}\nexports.ZodObject = ZodObject;\nZodObject.create = (shape, params) => {\n return new ZodObject({\n shape: () => shape,\n unknownKeys: \"strip\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params),\n });\n};\nZodObject.strictCreate = (shape, params) => {\n return new ZodObject({\n shape: () => shape,\n unknownKeys: \"strict\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params),\n });\n};\nZodObject.lazycreate = (shape, params) => {\n return new ZodObject({\n shape,\n unknownKeys: \"strip\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params),\n });\n};\nclass ZodUnion extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const options = this._def.options;\n function handleResults(results) {\n // return first issue-free validation if it exists\n for (const result of results) {\n if (result.result.status === \"valid\") {\n return result.result;\n }\n }\n for (const result of results) {\n if (result.result.status === \"dirty\") {\n // add issues from dirty option\n ctx.common.issues.push(...result.ctx.common.issues);\n return result.result;\n }\n }\n // return invalid\n const unionErrors = results.map((result) => new ZodError_js_1.ZodError(result.ctx.common.issues));\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_union,\n unionErrors,\n });\n return parseUtil_js_1.INVALID;\n }\n if (ctx.common.async) {\n return Promise.all(options.map(async (option) => {\n const childCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: [],\n },\n parent: null,\n };\n return {\n result: await option._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: childCtx,\n }),\n ctx: childCtx,\n };\n })).then(handleResults);\n }\n else {\n let dirty = undefined;\n const issues = [];\n for (const option of options) {\n const childCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: [],\n },\n parent: null,\n };\n const result = option._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: childCtx,\n });\n if (result.status === \"valid\") {\n return result;\n }\n else if (result.status === \"dirty\" && !dirty) {\n dirty = { result, ctx: childCtx };\n }\n if (childCtx.common.issues.length) {\n issues.push(childCtx.common.issues);\n }\n }\n if (dirty) {\n ctx.common.issues.push(...dirty.ctx.common.issues);\n return dirty.result;\n }\n const unionErrors = issues.map((issues) => new ZodError_js_1.ZodError(issues));\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_union,\n unionErrors,\n });\n return parseUtil_js_1.INVALID;\n }\n }\n get options() {\n return this._def.options;\n }\n}\nexports.ZodUnion = ZodUnion;\nZodUnion.create = (types, params) => {\n return new ZodUnion({\n options: types,\n typeName: ZodFirstPartyTypeKind.ZodUnion,\n ...processCreateParams(params),\n });\n};\n/////////////////////////////////////////////////////\n/////////////////////////////////////////////////////\n////////// //////////\n////////// ZodDiscriminatedUnion //////////\n////////// //////////\n/////////////////////////////////////////////////////\n/////////////////////////////////////////////////////\nconst getDiscriminator = (type) => {\n if (type instanceof ZodLazy) {\n return getDiscriminator(type.schema);\n }\n else if (type instanceof ZodEffects) {\n return getDiscriminator(type.innerType());\n }\n else if (type instanceof ZodLiteral) {\n return [type.value];\n }\n else if (type instanceof ZodEnum) {\n return type.options;\n }\n else if (type instanceof ZodNativeEnum) {\n // eslint-disable-next-line ban/ban\n return util_js_1.util.objectValues(type.enum);\n }\n else if (type instanceof ZodDefault) {\n return getDiscriminator(type._def.innerType);\n }\n else if (type instanceof ZodUndefined) {\n return [undefined];\n }\n else if (type instanceof ZodNull) {\n return [null];\n }\n else if (type instanceof ZodOptional) {\n return [undefined, ...getDiscriminator(type.unwrap())];\n }\n else if (type instanceof ZodNullable) {\n return [null, ...getDiscriminator(type.unwrap())];\n }\n else if (type instanceof ZodBranded) {\n return getDiscriminator(type.unwrap());\n }\n else if (type instanceof ZodReadonly) {\n return getDiscriminator(type.unwrap());\n }\n else if (type instanceof ZodCatch) {\n return getDiscriminator(type._def.innerType);\n }\n else {\n return [];\n }\n};\nclass ZodDiscriminatedUnion extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== util_js_1.ZodParsedType.object) {\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n expected: util_js_1.ZodParsedType.object,\n received: ctx.parsedType,\n });\n return parseUtil_js_1.INVALID;\n }\n const discriminator = this.discriminator;\n const discriminatorValue = ctx.data[discriminator];\n const option = this.optionsMap.get(discriminatorValue);\n if (!option) {\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_union_discriminator,\n options: Array.from(this.optionsMap.keys()),\n path: [discriminator],\n });\n return parseUtil_js_1.INVALID;\n }\n if (ctx.common.async) {\n return option._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n }\n else {\n return option._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n }\n }\n get discriminator() {\n return this._def.discriminator;\n }\n get options() {\n return this._def.options;\n }\n get optionsMap() {\n return this._def.optionsMap;\n }\n /**\n * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.\n * However, it only allows a union of objects, all of which need to share a discriminator property. This property must\n * have a different value for each object in the union.\n * @param discriminator the name of the discriminator property\n * @param types an array of object schemas\n * @param params\n */\n static create(discriminator, options, params) {\n // Get all the valid discriminator values\n const optionsMap = new Map();\n // try {\n for (const type of options) {\n const discriminatorValues = getDiscriminator(type.shape[discriminator]);\n if (!discriminatorValues.length) {\n throw new Error(`A discriminator value for key \\`${discriminator}\\` could not be extracted from all schema options`);\n }\n for (const value of discriminatorValues) {\n if (optionsMap.has(value)) {\n throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`);\n }\n optionsMap.set(value, type);\n }\n }\n return new ZodDiscriminatedUnion({\n typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion,\n discriminator,\n options,\n optionsMap,\n ...processCreateParams(params),\n });\n }\n}\nexports.ZodDiscriminatedUnion = ZodDiscriminatedUnion;\nfunction mergeValues(a, b) {\n const aType = (0, util_js_1.getParsedType)(a);\n const bType = (0, util_js_1.getParsedType)(b);\n if (a === b) {\n return { valid: true, data: a };\n }\n else if (aType === util_js_1.ZodParsedType.object && bType === util_js_1.ZodParsedType.object) {\n const bKeys = util_js_1.util.objectKeys(b);\n const sharedKeys = util_js_1.util.objectKeys(a).filter((key) => bKeys.indexOf(key) !== -1);\n const newObj = { ...a, ...b };\n for (const key of sharedKeys) {\n const sharedValue = mergeValues(a[key], b[key]);\n if (!sharedValue.valid) {\n return { valid: false };\n }\n newObj[key] = sharedValue.data;\n }\n return { valid: true, data: newObj };\n }\n else if (aType === util_js_1.ZodParsedType.array && bType === util_js_1.ZodParsedType.array) {\n if (a.length !== b.length) {\n return { valid: false };\n }\n const newArray = [];\n for (let index = 0; index < a.length; index++) {\n const itemA = a[index];\n const itemB = b[index];\n const sharedValue = mergeValues(itemA, itemB);\n if (!sharedValue.valid) {\n return { valid: false };\n }\n newArray.push(sharedValue.data);\n }\n return { valid: true, data: newArray };\n }\n else if (aType === util_js_1.ZodParsedType.date && bType === util_js_1.ZodParsedType.date && +a === +b) {\n return { valid: true, data: a };\n }\n else {\n return { valid: false };\n }\n}\nclass ZodIntersection extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n const handleParsed = (parsedLeft, parsedRight) => {\n if ((0, parseUtil_js_1.isAborted)(parsedLeft) || (0, parseUtil_js_1.isAborted)(parsedRight)) {\n return parseUtil_js_1.INVALID;\n }\n const merged = mergeValues(parsedLeft.value, parsedRight.value);\n if (!merged.valid) {\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_intersection_types,\n });\n return parseUtil_js_1.INVALID;\n }\n if ((0, parseUtil_js_1.isDirty)(parsedLeft) || (0, parseUtil_js_1.isDirty)(parsedRight)) {\n status.dirty();\n }\n return { status: status.value, value: merged.data };\n };\n if (ctx.common.async) {\n return Promise.all([\n this._def.left._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }),\n this._def.right._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }),\n ]).then(([left, right]) => handleParsed(left, right));\n }\n else {\n return handleParsed(this._def.left._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }), this._def.right._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }));\n }\n }\n}\nexports.ZodIntersection = ZodIntersection;\nZodIntersection.create = (left, right, params) => {\n return new ZodIntersection({\n left: left,\n right: right,\n typeName: ZodFirstPartyTypeKind.ZodIntersection,\n ...processCreateParams(params),\n });\n};\n// type ZodTupleItems = [ZodTypeAny, ...ZodTypeAny[]];\nclass ZodTuple extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== util_js_1.ZodParsedType.array) {\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n expected: util_js_1.ZodParsedType.array,\n received: ctx.parsedType,\n });\n return parseUtil_js_1.INVALID;\n }\n if (ctx.data.length < this._def.items.length) {\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.too_small,\n minimum: this._def.items.length,\n inclusive: true,\n exact: false,\n type: \"array\",\n });\n return parseUtil_js_1.INVALID;\n }\n const rest = this._def.rest;\n if (!rest && ctx.data.length > this._def.items.length) {\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.too_big,\n maximum: this._def.items.length,\n inclusive: true,\n exact: false,\n type: \"array\",\n });\n status.dirty();\n }\n const items = [...ctx.data]\n .map((item, itemIndex) => {\n const schema = this._def.items[itemIndex] || this._def.rest;\n if (!schema)\n return null;\n return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));\n })\n .filter((x) => !!x); // filter nulls\n if (ctx.common.async) {\n return Promise.all(items).then((results) => {\n return parseUtil_js_1.ParseStatus.mergeArray(status, results);\n });\n }\n else {\n return parseUtil_js_1.ParseStatus.mergeArray(status, items);\n }\n }\n get items() {\n return this._def.items;\n }\n rest(rest) {\n return new ZodTuple({\n ...this._def,\n rest,\n });\n }\n}\nexports.ZodTuple = ZodTuple;\nZodTuple.create = (schemas, params) => {\n if (!Array.isArray(schemas)) {\n throw new Error(\"You must pass an array of schemas to z.tuple([ ... ])\");\n }\n return new ZodTuple({\n items: schemas,\n typeName: ZodFirstPartyTypeKind.ZodTuple,\n rest: null,\n ...processCreateParams(params),\n });\n};\nclass ZodRecord extends ZodType {\n get keySchema() {\n return this._def.keyType;\n }\n get valueSchema() {\n return this._def.valueType;\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== util_js_1.ZodParsedType.object) {\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n expected: util_js_1.ZodParsedType.object,\n received: ctx.parsedType,\n });\n return parseUtil_js_1.INVALID;\n }\n const pairs = [];\n const keyType = this._def.keyType;\n const valueType = this._def.valueType;\n for (const key in ctx.data) {\n pairs.push({\n key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),\n value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),\n alwaysSet: key in ctx.data,\n });\n }\n if (ctx.common.async) {\n return parseUtil_js_1.ParseStatus.mergeObjectAsync(status, pairs);\n }\n else {\n return parseUtil_js_1.ParseStatus.mergeObjectSync(status, pairs);\n }\n }\n get element() {\n return this._def.valueType;\n }\n static create(first, second, third) {\n if (second instanceof ZodType) {\n return new ZodRecord({\n keyType: first,\n valueType: second,\n typeName: ZodFirstPartyTypeKind.ZodRecord,\n ...processCreateParams(third),\n });\n }\n return new ZodRecord({\n keyType: ZodString.create(),\n valueType: first,\n typeName: ZodFirstPartyTypeKind.ZodRecord,\n ...processCreateParams(second),\n });\n }\n}\nexports.ZodRecord = ZodRecord;\nclass ZodMap extends ZodType {\n get keySchema() {\n return this._def.keyType;\n }\n get valueSchema() {\n return this._def.valueType;\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== util_js_1.ZodParsedType.map) {\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n expected: util_js_1.ZodParsedType.map,\n received: ctx.parsedType,\n });\n return parseUtil_js_1.INVALID;\n }\n const keyType = this._def.keyType;\n const valueType = this._def.valueType;\n const pairs = [...ctx.data.entries()].map(([key, value], index) => {\n return {\n key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index, \"key\"])),\n value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, \"value\"])),\n };\n });\n if (ctx.common.async) {\n const finalMap = new Map();\n return Promise.resolve().then(async () => {\n for (const pair of pairs) {\n const key = await pair.key;\n const value = await pair.value;\n if (key.status === \"aborted\" || value.status === \"aborted\") {\n return parseUtil_js_1.INVALID;\n }\n if (key.status === \"dirty\" || value.status === \"dirty\") {\n status.dirty();\n }\n finalMap.set(key.value, value.value);\n }\n return { status: status.value, value: finalMap };\n });\n }\n else {\n const finalMap = new Map();\n for (const pair of pairs) {\n const key = pair.key;\n const value = pair.value;\n if (key.status === \"aborted\" || value.status === \"aborted\") {\n return parseUtil_js_1.INVALID;\n }\n if (key.status === \"dirty\" || value.status === \"dirty\") {\n status.dirty();\n }\n finalMap.set(key.value, value.value);\n }\n return { status: status.value, value: finalMap };\n }\n }\n}\nexports.ZodMap = ZodMap;\nZodMap.create = (keyType, valueType, params) => {\n return new ZodMap({\n valueType,\n keyType,\n typeName: ZodFirstPartyTypeKind.ZodMap,\n ...processCreateParams(params),\n });\n};\nclass ZodSet extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== util_js_1.ZodParsedType.set) {\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n expected: util_js_1.ZodParsedType.set,\n received: ctx.parsedType,\n });\n return parseUtil_js_1.INVALID;\n }\n const def = this._def;\n if (def.minSize !== null) {\n if (ctx.data.size < def.minSize.value) {\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.too_small,\n minimum: def.minSize.value,\n type: \"set\",\n inclusive: true,\n exact: false,\n message: def.minSize.message,\n });\n status.dirty();\n }\n }\n if (def.maxSize !== null) {\n if (ctx.data.size > def.maxSize.value) {\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.too_big,\n maximum: def.maxSize.value,\n type: \"set\",\n inclusive: true,\n exact: false,\n message: def.maxSize.message,\n });\n status.dirty();\n }\n }\n const valueType = this._def.valueType;\n function finalizeSet(elements) {\n const parsedSet = new Set();\n for (const element of elements) {\n if (element.status === \"aborted\")\n return parseUtil_js_1.INVALID;\n if (element.status === \"dirty\")\n status.dirty();\n parsedSet.add(element.value);\n }\n return { status: status.value, value: parsedSet };\n }\n const elements = [...ctx.data.values()].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i)));\n if (ctx.common.async) {\n return Promise.all(elements).then((elements) => finalizeSet(elements));\n }\n else {\n return finalizeSet(elements);\n }\n }\n min(minSize, message) {\n return new ZodSet({\n ...this._def,\n minSize: { value: minSize, message: errorUtil_js_1.errorUtil.toString(message) },\n });\n }\n max(maxSize, message) {\n return new ZodSet({\n ...this._def,\n maxSize: { value: maxSize, message: errorUtil_js_1.errorUtil.toString(message) },\n });\n }\n size(size, message) {\n return this.min(size, message).max(size, message);\n }\n nonempty(message) {\n return this.min(1, message);\n }\n}\nexports.ZodSet = ZodSet;\nZodSet.create = (valueType, params) => {\n return new ZodSet({\n valueType,\n minSize: null,\n maxSize: null,\n typeName: ZodFirstPartyTypeKind.ZodSet,\n ...processCreateParams(params),\n });\n};\nclass ZodFunction extends ZodType {\n constructor() {\n super(...arguments);\n this.validate = this.implement;\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== util_js_1.ZodParsedType.function) {\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n expected: util_js_1.ZodParsedType.function,\n received: ctx.parsedType,\n });\n return parseUtil_js_1.INVALID;\n }\n function makeArgsIssue(args, error) {\n return (0, parseUtil_js_1.makeIssue)({\n data: args,\n path: ctx.path,\n errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, (0, errors_js_1.getErrorMap)(), errors_js_1.defaultErrorMap].filter((x) => !!x),\n issueData: {\n code: ZodError_js_1.ZodIssueCode.invalid_arguments,\n argumentsError: error,\n },\n });\n }\n function makeReturnsIssue(returns, error) {\n return (0, parseUtil_js_1.makeIssue)({\n data: returns,\n path: ctx.path,\n errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, (0, errors_js_1.getErrorMap)(), errors_js_1.defaultErrorMap].filter((x) => !!x),\n issueData: {\n code: ZodError_js_1.ZodIssueCode.invalid_return_type,\n returnTypeError: error,\n },\n });\n }\n const params = { errorMap: ctx.common.contextualErrorMap };\n const fn = ctx.data;\n if (this._def.returns instanceof ZodPromise) {\n // Would love a way to avoid disabling this rule, but we need\n // an alias (using an arrow function was what caused 2651).\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const me = this;\n return (0, parseUtil_js_1.OK)(async function (...args) {\n const error = new ZodError_js_1.ZodError([]);\n const parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => {\n error.addIssue(makeArgsIssue(args, e));\n throw error;\n });\n const result = await Reflect.apply(fn, this, parsedArgs);\n const parsedReturns = await me._def.returns._def.type\n .parseAsync(result, params)\n .catch((e) => {\n error.addIssue(makeReturnsIssue(result, e));\n throw error;\n });\n return parsedReturns;\n });\n }\n else {\n // Would love a way to avoid disabling this rule, but we need\n // an alias (using an arrow function was what caused 2651).\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const me = this;\n return (0, parseUtil_js_1.OK)(function (...args) {\n const parsedArgs = me._def.args.safeParse(args, params);\n if (!parsedArgs.success) {\n throw new ZodError_js_1.ZodError([makeArgsIssue(args, parsedArgs.error)]);\n }\n const result = Reflect.apply(fn, this, parsedArgs.data);\n const parsedReturns = me._def.returns.safeParse(result, params);\n if (!parsedReturns.success) {\n throw new ZodError_js_1.ZodError([makeReturnsIssue(result, parsedReturns.error)]);\n }\n return parsedReturns.data;\n });\n }\n }\n parameters() {\n return this._def.args;\n }\n returnType() {\n return this._def.returns;\n }\n args(...items) {\n return new ZodFunction({\n ...this._def,\n args: ZodTuple.create(items).rest(ZodUnknown.create()),\n });\n }\n returns(returnType) {\n return new ZodFunction({\n ...this._def,\n returns: returnType,\n });\n }\n implement(func) {\n const validatedFunc = this.parse(func);\n return validatedFunc;\n }\n strictImplement(func) {\n const validatedFunc = this.parse(func);\n return validatedFunc;\n }\n static create(args, returns, params) {\n return new ZodFunction({\n args: (args ? args : ZodTuple.create([]).rest(ZodUnknown.create())),\n returns: returns || ZodUnknown.create(),\n typeName: ZodFirstPartyTypeKind.ZodFunction,\n ...processCreateParams(params),\n });\n }\n}\nexports.ZodFunction = ZodFunction;\nclass ZodLazy extends ZodType {\n get schema() {\n return this._def.getter();\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const lazySchema = this._def.getter();\n return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx });\n }\n}\nexports.ZodLazy = ZodLazy;\nZodLazy.create = (getter, params) => {\n return new ZodLazy({\n getter: getter,\n typeName: ZodFirstPartyTypeKind.ZodLazy,\n ...processCreateParams(params),\n });\n};\nclass ZodLiteral extends ZodType {\n _parse(input) {\n if (input.data !== this._def.value) {\n const ctx = this._getOrReturnCtx(input);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n received: ctx.data,\n code: ZodError_js_1.ZodIssueCode.invalid_literal,\n expected: this._def.value,\n });\n return parseUtil_js_1.INVALID;\n }\n return { status: \"valid\", value: input.data };\n }\n get value() {\n return this._def.value;\n }\n}\nexports.ZodLiteral = ZodLiteral;\nZodLiteral.create = (value, params) => {\n return new ZodLiteral({\n value: value,\n typeName: ZodFirstPartyTypeKind.ZodLiteral,\n ...processCreateParams(params),\n });\n};\nfunction createZodEnum(values, params) {\n return new ZodEnum({\n values,\n typeName: ZodFirstPartyTypeKind.ZodEnum,\n ...processCreateParams(params),\n });\n}\nclass ZodEnum extends ZodType {\n _parse(input) {\n if (typeof input.data !== \"string\") {\n const ctx = this._getOrReturnCtx(input);\n const expectedValues = this._def.values;\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n expected: util_js_1.util.joinValues(expectedValues),\n received: ctx.parsedType,\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n });\n return parseUtil_js_1.INVALID;\n }\n if (!this._cache) {\n this._cache = new Set(this._def.values);\n }\n if (!this._cache.has(input.data)) {\n const ctx = this._getOrReturnCtx(input);\n const expectedValues = this._def.values;\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n received: ctx.data,\n code: ZodError_js_1.ZodIssueCode.invalid_enum_value,\n options: expectedValues,\n });\n return parseUtil_js_1.INVALID;\n }\n return (0, parseUtil_js_1.OK)(input.data);\n }\n get options() {\n return this._def.values;\n }\n get enum() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n get Values() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n get Enum() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n extract(values, newDef = this._def) {\n return ZodEnum.create(values, {\n ...this._def,\n ...newDef,\n });\n }\n exclude(values, newDef = this._def) {\n return ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), {\n ...this._def,\n ...newDef,\n });\n }\n}\nexports.ZodEnum = ZodEnum;\nZodEnum.create = createZodEnum;\nclass ZodNativeEnum extends ZodType {\n _parse(input) {\n const nativeEnumValues = util_js_1.util.getValidEnumValues(this._def.values);\n const ctx = this._getOrReturnCtx(input);\n if (ctx.parsedType !== util_js_1.ZodParsedType.string && ctx.parsedType !== util_js_1.ZodParsedType.number) {\n const expectedValues = util_js_1.util.objectValues(nativeEnumValues);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n expected: util_js_1.util.joinValues(expectedValues),\n received: ctx.parsedType,\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n });\n return parseUtil_js_1.INVALID;\n }\n if (!this._cache) {\n this._cache = new Set(util_js_1.util.getValidEnumValues(this._def.values));\n }\n if (!this._cache.has(input.data)) {\n const expectedValues = util_js_1.util.objectValues(nativeEnumValues);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n received: ctx.data,\n code: ZodError_js_1.ZodIssueCode.invalid_enum_value,\n options: expectedValues,\n });\n return parseUtil_js_1.INVALID;\n }\n return (0, parseUtil_js_1.OK)(input.data);\n }\n get enum() {\n return this._def.values;\n }\n}\nexports.ZodNativeEnum = ZodNativeEnum;\nZodNativeEnum.create = (values, params) => {\n return new ZodNativeEnum({\n values: values,\n typeName: ZodFirstPartyTypeKind.ZodNativeEnum,\n ...processCreateParams(params),\n });\n};\nclass ZodPromise extends ZodType {\n unwrap() {\n return this._def.type;\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== util_js_1.ZodParsedType.promise && ctx.common.async === false) {\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n expected: util_js_1.ZodParsedType.promise,\n received: ctx.parsedType,\n });\n return parseUtil_js_1.INVALID;\n }\n const promisified = ctx.parsedType === util_js_1.ZodParsedType.promise ? ctx.data : Promise.resolve(ctx.data);\n return (0, parseUtil_js_1.OK)(promisified.then((data) => {\n return this._def.type.parseAsync(data, {\n path: ctx.path,\n errorMap: ctx.common.contextualErrorMap,\n });\n }));\n }\n}\nexports.ZodPromise = ZodPromise;\nZodPromise.create = (schema, params) => {\n return new ZodPromise({\n type: schema,\n typeName: ZodFirstPartyTypeKind.ZodPromise,\n ...processCreateParams(params),\n });\n};\nclass ZodEffects extends ZodType {\n innerType() {\n return this._def.schema;\n }\n sourceType() {\n return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects\n ? this._def.schema.sourceType()\n : this._def.schema;\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n const effect = this._def.effect || null;\n const checkCtx = {\n addIssue: (arg) => {\n (0, parseUtil_js_1.addIssueToContext)(ctx, arg);\n if (arg.fatal) {\n status.abort();\n }\n else {\n status.dirty();\n }\n },\n get path() {\n return ctx.path;\n },\n };\n checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);\n if (effect.type === \"preprocess\") {\n const processed = effect.transform(ctx.data, checkCtx);\n if (ctx.common.async) {\n return Promise.resolve(processed).then(async (processed) => {\n if (status.value === \"aborted\")\n return parseUtil_js_1.INVALID;\n const result = await this._def.schema._parseAsync({\n data: processed,\n path: ctx.path,\n parent: ctx,\n });\n if (result.status === \"aborted\")\n return parseUtil_js_1.INVALID;\n if (result.status === \"dirty\")\n return (0, parseUtil_js_1.DIRTY)(result.value);\n if (status.value === \"dirty\")\n return (0, parseUtil_js_1.DIRTY)(result.value);\n return result;\n });\n }\n else {\n if (status.value === \"aborted\")\n return parseUtil_js_1.INVALID;\n const result = this._def.schema._parseSync({\n data: processed,\n path: ctx.path,\n parent: ctx,\n });\n if (result.status === \"aborted\")\n return parseUtil_js_1.INVALID;\n if (result.status === \"dirty\")\n return (0, parseUtil_js_1.DIRTY)(result.value);\n if (status.value === \"dirty\")\n return (0, parseUtil_js_1.DIRTY)(result.value);\n return result;\n }\n }\n if (effect.type === \"refinement\") {\n const executeRefinement = (acc) => {\n const result = effect.refinement(acc, checkCtx);\n if (ctx.common.async) {\n return Promise.resolve(result);\n }\n if (result instanceof Promise) {\n throw new Error(\"Async refinement encountered during synchronous parse operation. Use .parseAsync instead.\");\n }\n return acc;\n };\n if (ctx.common.async === false) {\n const inner = this._def.schema._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (inner.status === \"aborted\")\n return parseUtil_js_1.INVALID;\n if (inner.status === \"dirty\")\n status.dirty();\n // return value is ignored\n executeRefinement(inner.value);\n return { status: status.value, value: inner.value };\n }\n else {\n return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((inner) => {\n if (inner.status === \"aborted\")\n return parseUtil_js_1.INVALID;\n if (inner.status === \"dirty\")\n status.dirty();\n return executeRefinement(inner.value).then(() => {\n return { status: status.value, value: inner.value };\n });\n });\n }\n }\n if (effect.type === \"transform\") {\n if (ctx.common.async === false) {\n const base = this._def.schema._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (!(0, parseUtil_js_1.isValid)(base))\n return parseUtil_js_1.INVALID;\n const result = effect.transform(base.value, checkCtx);\n if (result instanceof Promise) {\n throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);\n }\n return { status: status.value, value: result };\n }\n else {\n return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {\n if (!(0, parseUtil_js_1.isValid)(base))\n return parseUtil_js_1.INVALID;\n return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({\n status: status.value,\n value: result,\n }));\n });\n }\n }\n util_js_1.util.assertNever(effect);\n }\n}\nexports.ZodEffects = ZodEffects;\nexports.ZodTransformer = ZodEffects;\nZodEffects.create = (schema, effect, params) => {\n return new ZodEffects({\n schema,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect,\n ...processCreateParams(params),\n });\n};\nZodEffects.createWithPreprocess = (preprocess, schema, params) => {\n return new ZodEffects({\n schema,\n effect: { type: \"preprocess\", transform: preprocess },\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n ...processCreateParams(params),\n });\n};\nclass ZodOptional extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType === util_js_1.ZodParsedType.undefined) {\n return (0, parseUtil_js_1.OK)(undefined);\n }\n return this._def.innerType._parse(input);\n }\n unwrap() {\n return this._def.innerType;\n }\n}\nexports.ZodOptional = ZodOptional;\nZodOptional.create = (type, params) => {\n return new ZodOptional({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodOptional,\n ...processCreateParams(params),\n });\n};\nclass ZodNullable extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType === util_js_1.ZodParsedType.null) {\n return (0, parseUtil_js_1.OK)(null);\n }\n return this._def.innerType._parse(input);\n }\n unwrap() {\n return this._def.innerType;\n }\n}\nexports.ZodNullable = ZodNullable;\nZodNullable.create = (type, params) => {\n return new ZodNullable({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodNullable,\n ...processCreateParams(params),\n });\n};\nclass ZodDefault extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n let data = ctx.data;\n if (ctx.parsedType === util_js_1.ZodParsedType.undefined) {\n data = this._def.defaultValue();\n }\n return this._def.innerType._parse({\n data,\n path: ctx.path,\n parent: ctx,\n });\n }\n removeDefault() {\n return this._def.innerType;\n }\n}\nexports.ZodDefault = ZodDefault;\nZodDefault.create = (type, params) => {\n return new ZodDefault({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodDefault,\n defaultValue: typeof params.default === \"function\" ? params.default : () => params.default,\n ...processCreateParams(params),\n });\n};\nclass ZodCatch extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n // newCtx is used to not collect issues from inner types in ctx\n const newCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: [],\n },\n };\n const result = this._def.innerType._parse({\n data: newCtx.data,\n path: newCtx.path,\n parent: {\n ...newCtx,\n },\n });\n if ((0, parseUtil_js_1.isAsync)(result)) {\n return result.then((result) => {\n return {\n status: \"valid\",\n value: result.status === \"valid\"\n ? result.value\n : this._def.catchValue({\n get error() {\n return new ZodError_js_1.ZodError(newCtx.common.issues);\n },\n input: newCtx.data,\n }),\n };\n });\n }\n else {\n return {\n status: \"valid\",\n value: result.status === \"valid\"\n ? result.value\n : this._def.catchValue({\n get error() {\n return new ZodError_js_1.ZodError(newCtx.common.issues);\n },\n input: newCtx.data,\n }),\n };\n }\n }\n removeCatch() {\n return this._def.innerType;\n }\n}\nexports.ZodCatch = ZodCatch;\nZodCatch.create = (type, params) => {\n return new ZodCatch({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodCatch,\n catchValue: typeof params.catch === \"function\" ? params.catch : () => params.catch,\n ...processCreateParams(params),\n });\n};\nclass ZodNaN extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== util_js_1.ZodParsedType.nan) {\n const ctx = this._getOrReturnCtx(input);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n expected: util_js_1.ZodParsedType.nan,\n received: ctx.parsedType,\n });\n return parseUtil_js_1.INVALID;\n }\n return { status: \"valid\", value: input.data };\n }\n}\nexports.ZodNaN = ZodNaN;\nZodNaN.create = (params) => {\n return new ZodNaN({\n typeName: ZodFirstPartyTypeKind.ZodNaN,\n ...processCreateParams(params),\n });\n};\nexports.BRAND = Symbol(\"zod_brand\");\nclass ZodBranded extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const data = ctx.data;\n return this._def.type._parse({\n data,\n path: ctx.path,\n parent: ctx,\n });\n }\n unwrap() {\n return this._def.type;\n }\n}\nexports.ZodBranded = ZodBranded;\nclass ZodPipeline extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.common.async) {\n const handleAsync = async () => {\n const inResult = await this._def.in._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (inResult.status === \"aborted\")\n return parseUtil_js_1.INVALID;\n if (inResult.status === \"dirty\") {\n status.dirty();\n return (0, parseUtil_js_1.DIRTY)(inResult.value);\n }\n else {\n return this._def.out._parseAsync({\n data: inResult.value,\n path: ctx.path,\n parent: ctx,\n });\n }\n };\n return handleAsync();\n }\n else {\n const inResult = this._def.in._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (inResult.status === \"aborted\")\n return parseUtil_js_1.INVALID;\n if (inResult.status === \"dirty\") {\n status.dirty();\n return {\n status: \"dirty\",\n value: inResult.value,\n };\n }\n else {\n return this._def.out._parseSync({\n data: inResult.value,\n path: ctx.path,\n parent: ctx,\n });\n }\n }\n }\n static create(a, b) {\n return new ZodPipeline({\n in: a,\n out: b,\n typeName: ZodFirstPartyTypeKind.ZodPipeline,\n });\n }\n}\nexports.ZodPipeline = ZodPipeline;\nclass ZodReadonly extends ZodType {\n _parse(input) {\n const result = this._def.innerType._parse(input);\n const freeze = (data) => {\n if ((0, parseUtil_js_1.isValid)(data)) {\n data.value = Object.freeze(data.value);\n }\n return data;\n };\n return (0, parseUtil_js_1.isAsync)(result) ? result.then((data) => freeze(data)) : freeze(result);\n }\n unwrap() {\n return this._def.innerType;\n }\n}\nexports.ZodReadonly = ZodReadonly;\nZodReadonly.create = (type, params) => {\n return new ZodReadonly({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodReadonly,\n ...processCreateParams(params),\n });\n};\n////////////////////////////////////////\n////////////////////////////////////////\n////////// //////////\n////////// z.custom //////////\n////////// //////////\n////////////////////////////////////////\n////////////////////////////////////////\nfunction cleanParams(params, data) {\n const p = typeof params === \"function\" ? params(data) : typeof params === \"string\" ? { message: params } : params;\n const p2 = typeof p === \"string\" ? { message: p } : p;\n return p2;\n}\nfunction custom(check, _params = {}, \n/**\n * @deprecated\n *\n * Pass `fatal` into the params object instead:\n *\n * ```ts\n * z.string().custom((val) => val.length > 5, { fatal: false })\n * ```\n *\n */\nfatal) {\n if (check)\n return ZodAny.create().superRefine((data, ctx) => {\n const r = check(data);\n if (r instanceof Promise) {\n return r.then((r) => {\n if (!r) {\n const params = cleanParams(_params, data);\n const _fatal = params.fatal ?? fatal ?? true;\n ctx.addIssue({ code: \"custom\", ...params, fatal: _fatal });\n }\n });\n }\n if (!r) {\n const params = cleanParams(_params, data);\n const _fatal = params.fatal ?? fatal ?? true;\n ctx.addIssue({ code: \"custom\", ...params, fatal: _fatal });\n }\n return;\n });\n return ZodAny.create();\n}\nexports.late = {\n object: ZodObject.lazycreate,\n};\nvar ZodFirstPartyTypeKind;\n(function (ZodFirstPartyTypeKind) {\n ZodFirstPartyTypeKind[\"ZodString\"] = \"ZodString\";\n ZodFirstPartyTypeKind[\"ZodNumber\"] = \"ZodNumber\";\n ZodFirstPartyTypeKind[\"ZodNaN\"] = \"ZodNaN\";\n ZodFirstPartyTypeKind[\"ZodBigInt\"] = \"ZodBigInt\";\n ZodFirstPartyTypeKind[\"ZodBoolean\"] = \"ZodBoolean\";\n ZodFirstPartyTypeKind[\"ZodDate\"] = \"ZodDate\";\n ZodFirstPartyTypeKind[\"ZodSymbol\"] = \"ZodSymbol\";\n ZodFirstPartyTypeKind[\"ZodUndefined\"] = \"ZodUndefined\";\n ZodFirstPartyTypeKind[\"ZodNull\"] = \"ZodNull\";\n ZodFirstPartyTypeKind[\"ZodAny\"] = \"ZodAny\";\n ZodFirstPartyTypeKind[\"ZodUnknown\"] = \"ZodUnknown\";\n ZodFirstPartyTypeKind[\"ZodNever\"] = \"ZodNever\";\n ZodFirstPartyTypeKind[\"ZodVoid\"] = \"ZodVoid\";\n ZodFirstPartyTypeKind[\"ZodArray\"] = \"ZodArray\";\n ZodFirstPartyTypeKind[\"ZodObject\"] = \"ZodObject\";\n ZodFirstPartyTypeKind[\"ZodUnion\"] = \"ZodUnion\";\n ZodFirstPartyTypeKind[\"ZodDiscriminatedUnion\"] = \"ZodDiscriminatedUnion\";\n ZodFirstPartyTypeKind[\"ZodIntersection\"] = \"ZodIntersection\";\n ZodFirstPartyTypeKind[\"ZodTuple\"] = \"ZodTuple\";\n ZodFirstPartyTypeKind[\"ZodRecord\"] = \"ZodRecord\";\n ZodFirstPartyTypeKind[\"ZodMap\"] = \"ZodMap\";\n ZodFirstPartyTypeKind[\"ZodSet\"] = \"ZodSet\";\n ZodFirstPartyTypeKind[\"ZodFunction\"] = \"ZodFunction\";\n ZodFirstPartyTypeKind[\"ZodLazy\"] = \"ZodLazy\";\n ZodFirstPartyTypeKind[\"ZodLiteral\"] = \"ZodLiteral\";\n ZodFirstPartyTypeKind[\"ZodEnum\"] = \"ZodEnum\";\n ZodFirstPartyTypeKind[\"ZodEffects\"] = \"ZodEffects\";\n ZodFirstPartyTypeKind[\"ZodNativeEnum\"] = \"ZodNativeEnum\";\n ZodFirstPartyTypeKind[\"ZodOptional\"] = \"ZodOptional\";\n ZodFirstPartyTypeKind[\"ZodNullable\"] = \"ZodNullable\";\n ZodFirstPartyTypeKind[\"ZodDefault\"] = \"ZodDefault\";\n ZodFirstPartyTypeKind[\"ZodCatch\"] = \"ZodCatch\";\n ZodFirstPartyTypeKind[\"ZodPromise\"] = \"ZodPromise\";\n ZodFirstPartyTypeKind[\"ZodBranded\"] = \"ZodBranded\";\n ZodFirstPartyTypeKind[\"ZodPipeline\"] = \"ZodPipeline\";\n ZodFirstPartyTypeKind[\"ZodReadonly\"] = \"ZodReadonly\";\n})(ZodFirstPartyTypeKind || (exports.ZodFirstPartyTypeKind = ZodFirstPartyTypeKind = {}));\n// requires TS 4.4+\nclass Class {\n constructor(..._) { }\n}\nconst instanceOfType = (\n// const instanceOfType = <T extends new (...args: any[]) => any>(\ncls, params = {\n message: `Input not instance of ${cls.name}`,\n}) => custom((data) => data instanceof cls, params);\nexports.instanceof = instanceOfType;\nconst stringType = ZodString.create;\nexports.string = stringType;\nconst numberType = ZodNumber.create;\nexports.number = numberType;\nconst nanType = ZodNaN.create;\nexports.nan = nanType;\nconst bigIntType = ZodBigInt.create;\nexports.bigint = bigIntType;\nconst booleanType = ZodBoolean.create;\nexports.boolean = booleanType;\nconst dateType = ZodDate.create;\nexports.date = dateType;\nconst symbolType = ZodSymbol.create;\nexports.symbol = symbolType;\nconst undefinedType = ZodUndefined.create;\nexports.undefined = undefinedType;\nconst nullType = ZodNull.create;\nexports.null = nullType;\nconst anyType = ZodAny.create;\nexports.any = anyType;\nconst unknownType = ZodUnknown.create;\nexports.unknown = unknownType;\nconst neverType = ZodNever.create;\nexports.never = neverType;\nconst voidType = ZodVoid.create;\nexports.void = voidType;\nconst arrayType = ZodArray.create;\nexports.array = arrayType;\nconst objectType = ZodObject.create;\nexports.object = objectType;\nconst strictObjectType = ZodObject.strictCreate;\nexports.strictObject = strictObjectType;\nconst unionType = ZodUnion.create;\nexports.union = unionType;\nconst discriminatedUnionType = ZodDiscriminatedUnion.create;\nexports.discriminatedUnion = discriminatedUnionType;\nconst intersectionType = ZodIntersection.create;\nexports.intersection = intersectionType;\nconst tupleType = ZodTuple.create;\nexports.tuple = tupleType;\nconst recordType = ZodRecord.create;\nexports.record = recordType;\nconst mapType = ZodMap.create;\nexports.map = mapType;\nconst setType = ZodSet.create;\nexports.set = setType;\nconst functionType = ZodFunction.create;\nexports.function = functionType;\nconst lazyType = ZodLazy.create;\nexports.lazy = lazyType;\nconst literalType = ZodLiteral.create;\nexports.literal = literalType;\nconst enumType = ZodEnum.create;\nexports.enum = enumType;\nconst nativeEnumType = ZodNativeEnum.create;\nexports.nativeEnum = nativeEnumType;\nconst promiseType = ZodPromise.create;\nexports.promise = promiseType;\nconst effectsType = ZodEffects.create;\nexports.effect = effectsType;\nexports.transformer = effectsType;\nconst optionalType = ZodOptional.create;\nexports.optional = optionalType;\nconst nullableType = ZodNullable.create;\nexports.nullable = nullableType;\nconst preprocessType = ZodEffects.createWithPreprocess;\nexports.preprocess = preprocessType;\nconst pipelineType = ZodPipeline.create;\nexports.pipeline = pipelineType;\nconst ostring = () => stringType().optional();\nexports.ostring = ostring;\nconst onumber = () => numberType().optional();\nexports.onumber = onumber;\nconst oboolean = () => booleanType().optional();\nexports.oboolean = oboolean;\nexports.coerce = {\n string: ((arg) => ZodString.create({ ...arg, coerce: true })),\n number: ((arg) => ZodNumber.create({ ...arg, coerce: true })),\n boolean: ((arg) => ZodBoolean.create({\n ...arg,\n coerce: true,\n })),\n bigint: ((arg) => ZodBigInt.create({ ...arg, coerce: true })),\n date: ((arg) => ZodDate.create({ ...arg, coerce: true })),\n};\nexports.NEVER = parseUtil_js_1.INVALID;\n", "\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./errors.cjs\"), exports);\n__exportStar(require(\"./helpers/parseUtil.cjs\"), exports);\n__exportStar(require(\"./helpers/typeAliases.cjs\"), exports);\n__exportStar(require(\"./helpers/util.cjs\"), exports);\n__exportStar(require(\"./types.cjs\"), exports);\n__exportStar(require(\"./ZodError.cjs\"), exports);\n", "\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.z = void 0;\nconst z = __importStar(require(\"./v3/external.cjs\"));\nexports.z = z;\n__exportStar(require(\"./v3/external.cjs\"), exports);\nexports.default = z;\n", "/**\n * Copyright(c) Microsoft Corporation.All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\n\n/**\n * Enum representing the types of actions.\n */\nexport enum ActionTypes {\n /**\n * Opens a URL in the default browser.\n */\n OpenUrl = 'openUrl',\n\n /**\n * Sends a message back to the bot as a simple string.\n */\n ImBack = 'imBack',\n\n /**\n * Sends a message back to the bot with additional data.\n */\n PostBack = 'postBack',\n\n /**\n * Plays an audio file.\n */\n PlayAudio = 'playAudio',\n\n /**\n * Plays a video file.\n */\n PlayVideo = 'playVideo',\n\n /**\n * Displays an image.\n */\n ShowImage = 'showImage',\n\n /**\n * Downloads a file.\n */\n DownloadFile = 'downloadFile',\n\n /**\n * Initiates a sign-in process.\n */\n Signin = 'signin',\n\n /**\n * Initiates a phone call.\n */\n Call = 'call',\n\n /**\n * Sends a message back to the bot with additional metadata.\n */\n MessageBack = 'messageBack',\n\n /**\n * Opens an application.\n */\n OpenApp = 'openApp',\n}\n\n/**\n * Zod schema for validating ActionTypes.\n */\nexport const actionTypesZodSchema = z.enum(['openUrl', 'imBack', 'postBack', 'playAudio', 'showImage', 'downloadFile', 'signin', 'call', 'messageBack', 'openApp'])\n", "/**\n * Copyright(c) Microsoft Corporation.All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\n\n/**\n * Enum representing the state types of a semantic action.\n */\nexport enum SemanticActionStateTypes {\n /**\n * Indicates the start of a semantic action.\n */\n Start = 'start',\n\n /**\n * Indicates the continuation of a semantic action.\n */\n Continue = 'continue',\n\n /**\n * Indicates the completion of a semantic action.\n */\n Done = 'done',\n}\n\n/**\n * Zod schema for validating SemanticActionStateTypes.\n */\nexport const semanticActionStateTypesZodSchema = z.enum(['start', 'continue', 'done'])\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\n\n/**\n * Enum representing the layout types for attachments.\n */\nexport enum AttachmentLayoutTypes {\n /**\n * Displays attachments in a list format.\n */\n List = 'list',\n\n /**\n * Displays attachments in a carousel format.\n */\n Carousel = 'carousel',\n}\n\n/**\n * Zod schema for validating attachment layout types.\n */\nexport const attachmentLayoutTypesZodSchema = z.enum(['list', 'carousel'])\n", "/**\n * Copyright(c) Microsoft Corporation.All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Enum representing the different channels an agent can communicate through.\n */\nexport enum Channels {\n /**\n * Represents an agentic channel\n */\n Agents = 'agents',\n /**\n * Represents the Alexa channel.\n */\n Alexa = 'alexa',\n\n /**\n * Represents the Console channel.\n */\n Console = 'console',\n\n /**\n * Represents the Directline channel.\n */\n Directline = 'directline',\n\n /**\n * Represents the Directline Speech channel.\n */\n DirectlineSpeech = 'directlinespeech',\n\n /**\n * Represents the Email channel.\n */\n Email = 'email',\n\n /**\n * Represents the Emulator channel.\n */\n Emulator = 'emulator',\n\n /**\n * Represents the Facebook channel.\n */\n Facebook = 'facebook',\n\n /**\n * Represents the GroupMe channel.\n */\n Groupme = 'groupme',\n\n /**\n * Represents the Line channel.\n */\n Line = 'line',\n\n /**\n * Represents the Microsoft Teams channel.\n */\n Msteams = 'msteams',\n\n /**\n * M365 Copilot Teams Subchannel.\n */\n M365CopilotSubChannel = 'COPILOT',\n M365Copilot = `${Msteams}:${M365CopilotSubChannel}`,\n\n /**\n * Represents the Omnichannel.\n */\n Omni = 'omnichannel',\n\n /**\n * Represents the Outlook channel.\n */\n Outlook = 'outlook',\n\n /**\n * Represents the Skype channel.\n */\n Skype = 'skype',\n\n /**\n * Represents the Slack channel.\n */\n Slack = 'slack',\n\n /**\n * Represents the SMS channel.\n */\n Sms = 'sms',\n\n /**\n * Represents the Telegram channel.\n */\n Telegram = 'telegram',\n\n /**\n * Represents the Telephony channel.\n */\n Telephony = 'telephony',\n\n /**\n * Represents the Test channel.\n */\n Test = 'test',\n\n /**\n * Represents the Webchat channel.\n */\n Webchat = 'webchat',\n}\n", "/**\n * Copyright(c) Microsoft Corporation.All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\n\n/**\n * Enum representing the different end of conversation codes.\n */\nexport enum EndOfConversationCodes {\n /**\n * The end of conversation reason is unknown.\n */\n Unknown = 'unknown',\n\n /**\n * The conversation completed successfully.\n */\n CompletedSuccessfully = 'completedSuccessfully',\n\n /**\n * The user cancelled the conversation.\n */\n UserCancelled = 'userCancelled',\n\n /**\n * The agent timed out during the conversation.\n */\n AgentTimedOut = 'agentTimedOut',\n\n /**\n * The agent issued an invalid message.\n */\n AgentIssuedInvalidMessage = 'agentIssuedInvalidMessage',\n\n /**\n * The channel failed during the conversation.\n */\n ChannelFailed = 'channelFailed',\n}\n\n/**\n * Zod schema for validating end of conversation codes.\n */\nexport const endOfConversationCodesZodSchema = z.enum(['unknown', 'completedSuccessfully', 'userCancelled', 'agentTimedOut', 'agentIssuedInvalidMessage', 'channelFailed'])\n", "/**\n * Copyright(c) Microsoft Corporation.All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\n\n/**\n * Enum defining the type of roster the user is a member of.\n */\nexport enum MembershipSourceTypes {\n /**\n * The source is that of a channel and the user is a member of that channel.\n */\n Channel = 'channel',\n\n /**\n * The source is that of a team and the user is a member of that team.\n */\n Team = 'team',\n}\n\n/**\n * Zod schema for validating membership source types.\n */\nexport const membershipSourceTypeZodSchema = z.enum(['channel', 'team'])\n", "/**\n * Copyright(c) Microsoft Corporation.All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\n\n/**\n * Enum expressing the users relationship to the current channel.\n */\nexport enum MembershipTypes {\n /**\n * The user is a direct member of a channel.\n */\n Direct = 'direct',\n\n /**\n * The user is a member of a channel through a group.\n */\n Transitive = 'transitive',\n}\n\n/**\n * Zod schema for validating membership source types.\n */\nexport const membershipTypeZodSchema = z.enum(['direct', 'transitive'])\n", "/**\n * Copyright(c) Microsoft Corporation.All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\n\n/**\n * Enum representing the different role types in a conversation.\n */\nexport enum RoleTypes {\n /**\n * Represents a user in the conversation.\n */\n User = 'user',\n\n /**\n * Represents an agent or bot in the conversation.\n */\n Agent = 'bot',\n\n /**\n * Represents a skill in the conversation.\n */\n Skill = 'skill',\n\n /**\n * Agentic AI - AAI role\n */\n AgenticIdentity = 'agenticAppInstance',\n\n /**\n * Agentic AI - AAI role.\n */\n AgenticUser = 'agenticUser'\n}\n\n/**\n * Zod schema for validating role types.\n */\nexport const roleTypeZodSchema = z.enum(['user', 'bot', 'skill', 'agenticAppInstance', 'agenticUser'])\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Activity } from '../activity'\nimport { Entity } from './entity'\n\n/**\n * Supported icon names for client citations. These icons are displayed in Teams to help users\n * identify the type of content being referenced in AI-generated responses.\n */\nexport type ClientCitationIconName =\n /** Microsoft Word document icon */\n | 'Microsoft Word'\n /** Microsoft Excel spreadsheet icon */\n | 'Microsoft Excel'\n /** Microsoft PowerPoint presentation icon */\n | 'Microsoft PowerPoint'\n /** Microsoft OneNote notebook icon */\n | 'Microsoft OneNote'\n /** Microsoft SharePoint site or document icon */\n | 'Microsoft SharePoint'\n /** Microsoft Visio diagram icon */\n | 'Microsoft Visio'\n /** Microsoft Loop component icon */\n | 'Microsoft Loop'\n /** Microsoft Whiteboard icon */\n | 'Microsoft Whiteboard'\n /** Adobe Illustrator vector graphics icon */\n | 'Adobe Illustrator'\n /** Adobe Photoshop image editing icon */\n | 'Adobe Photoshop'\n /** Adobe InDesign layout design icon */\n | 'Adobe InDesign'\n /** Adobe Flash multimedia icon */\n | 'Adobe Flash'\n /** Sketch design tool icon */\n | 'Sketch'\n /** Source code file icon */\n | 'Source Code'\n /** Generic image file icon */\n | 'Image'\n /** Animated GIF image icon */\n | 'GIF'\n /** Video file icon */\n | 'Video'\n /** Audio/sound file icon */\n | 'Sound'\n /** ZIP archive file icon */\n | 'ZIP'\n /** Plain text file icon */\n | 'Text'\n /** PDF document icon */\n | 'PDF'\n\n/**\n * Represents a Teams client citation to be included in a message.\n *\n * @remarks\n * [Learn more about Bot messages with AI-generated content](https://learn.microsoft.com/microsoftteams/platform/bots/how-to/bot-messages-ai-generated-content?tabs=before%2Cbotmessage)\n */\nexport interface ClientCitation {\n /**\n * Required; must be \"Claim\"\n */\n '@type': 'Claim';\n\n /**\n * Required. Number and position of the citation.\n */\n position: number;\n /**\n * Optional; if provided, the citation will be displayed in the message.\n */\n appearance: {\n /**\n * Required; Must be 'DigitalDocument'\n */\n '@type': 'DigitalDocument';\n\n /**\n * Name of the document. (max length 80)\n */\n name: string;\n\n /**\n * Stringified adaptive card with additional information about the citation.\n * It is rendered within the modal.\n */\n text?: string;\n\n /**\n * URL of the document. This will make the name of the citation clickable and direct the user to the specified URL.\n */\n url?: string;\n\n /**\n * Extract of the referenced content. (max length 160)\n */\n abstract: string;\n\n /**\n * Encoding format of the `citation.appearance.text` field.\n */\n encodingFormat?: 'application/vnd.microsoft.card.adaptive';\n\n /**\n * Information about the citation\u2019s icon.\n */\n image?: {\n '@type': 'ImageObject';\n\n /**\n * The image/icon name\n */\n name: ClientCitationIconName;\n };\n\n /**\n * Optional; set by developer. (max length 3) (max keyword length 28)\n */\n keywords?: string[];\n\n /**\n * Optional sensitivity content information.\n */\n usageInfo?: SensitivityUsageInfo;\n };\n}\n\n/**\n * Sensitivity usage info for content sent to the user.\n *\n * @remarks\n * This is used to provide information about the content to the user. See {@link ClientCitation} for more information.\n */\nexport interface SensitivityUsageInfo {\n /**\n * Must be \"https://schema.org/Message\"\n */\n type: 'https://schema.org/Message';\n\n /**\n * Required; Set to CreativeWork;\n */\n '@type': 'CreativeWork';\n\n /**\n * Sensitivity description of the content\n */\n description?: string;\n\n /**\n * Sensitivity title of the content\n */\n name: string;\n\n /**\n * Optional; ignored in Teams.\n */\n position?: number;\n\n /**\n * Optional; if provided, the content is considered sensitive and should be handled accordingly.\n */\n pattern?: {\n /**\n * Set to DefinedTerm\n */\n '@type': 'DefinedTerm';\n\n inDefinedTermSet: string;\n\n /**\n * Color\n */\n name: string;\n\n /**\n * e.g. #454545\n */\n termCode: string;\n };\n}\n\nexport interface AIEntity extends Entity {\n /**\n * Required as 'https://schema.org/Message'\n */\n type: 'https://schema.org/Message';\n\n /**\n * Required as 'Message\n */\n '@type': 'Message';\n\n /**\n * Required as 'https://schema.org\n */\n '@context': 'https://schema.org';\n\n /**\n * Must be left blank. This is for Bot Framework schema.\n */\n '@id': '';\n\n /**\n * Indicate that the content was generated by AI.\n */\n additionalType: ['AIGeneratedContent'];\n\n /**\n * Optional; if citations object is included, the sent activity will include the citations, referenced in the activity text.\n */\n citation?: ClientCitation[];\n\n /**\n * Optional; if usage_info object is included, the sent activity will include the sensitivity usage information.\n */\n usageInfo?: SensitivityUsageInfo;\n}\n\n/**\n * Adds an AI entity to an activity to indicate that the content was generated by AI.\n *\n * @param activity - The activity to which the AI entity will be added. The activity's entities array will be initialized if it doesn't exist.\n * @param citations - Optional array of client citations to include with the AI-generated content.\n * Citations provide references to sources used in generating the content and are displayed in Teams.\n * @param usageInfo - Optional sensitivity usage information that provides context about the content's sensitivity level.\n * This helps users understand any special handling requirements for the content.\n *\n * @remarks\n * This function enhances the activity with metadata that helps clients (like Microsoft Teams)\n * understand that the content is AI-generated and optionally includes citations and sensitivity information.\n *\n * @example\n * ```typescript\n * import { Activity } from '../activity';\n * import { addAIToActivity, ClientCitation } from './AIEntity';\n *\n * const activity: Activity = {\n * type: 'message',\n * text: 'Based on the documents, here are the key findings...'\n * };\n *\n * const citations: ClientCitation[] = [{\n * '@type': 'Claim',\n * position: 1,\n * appearance: {\n * '@type': 'DigitalDocument',\n * name: 'Research Report 2024',\n * abstract: 'Key findings from the annual research report',\n * url: 'https://example.com/report.pdf',\n * image: {\n * '@type': 'ImageObject',\n * name: 'PDF'\n * }\n * }\n * }];\n *\n * // Add AI entity with citations\n * addAIToActivity(activity, citations);\n * ```\n */\nexport const addAIToActivity = (\n activity: Activity,\n citations?: ClientCitation[],\n usageInfo?: SensitivityUsageInfo\n): void => {\n const aiEntity: AIEntity = {\n type: 'https://schema.org/Message',\n '@type': 'Message',\n '@context': 'https://schema.org',\n '@id': '',\n additionalType: ['AIGeneratedContent'],\n citation: citations,\n usageInfo\n }\n activity.entities ??= []\n activity.entities.push(aiEntity)\n}\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\n\n/**\n * Represents an adaptive card invoke action.\n */\nexport interface AdaptiveCardInvokeAction {\n /**\n * The type of the action.\n */\n type: string\n /**\n * The unique identifier of the action.\n */\n id?: string\n /**\n * The verb associated with the action.\n */\n verb: string\n /**\n * Additional data associated with the action.\n */\n data: Record<string, any>\n}\n\n/**\n * Zod schema for validating an adaptive card invoke action.\n */\nexport const adaptiveCardInvokeActionZodSchema = z.object({\n type: z.string().min(1),\n id: z.string().optional(),\n verb: z.string().min(1),\n data: z.record(z.string().min(1), z.any())\n})\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = 'ffffffff-ffff-ffff-ffff-ffffffffffff';\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = '00000000-0000-0000-0000-000000000000';\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = /^(?:[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;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst regex_js_1 = require(\"./regex.js\");\nfunction validate(uuid) {\n return typeof uuid === 'string' && regex_js_1.default.test(uuid);\n}\nexports.default = validate;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst validate_js_1 = require(\"./validate.js\");\nfunction parse(uuid) {\n if (!(0, validate_js_1.default)(uuid)) {\n throw TypeError('Invalid UUID');\n }\n let v;\n return Uint8Array.of((v = parseInt(uuid.slice(0, 8), 16)) >>> 24, (v >>> 16) & 0xff, (v >>> 8) & 0xff, v & 0xff, (v = parseInt(uuid.slice(9, 13), 16)) >>> 8, v & 0xff, (v = parseInt(uuid.slice(14, 18), 16)) >>> 8, v & 0xff, (v = parseInt(uuid.slice(19, 23), 16)) >>> 8, v & 0xff, ((v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000) & 0xff, (v / 0x100000000) & 0xff, (v >>> 24) & 0xff, (v >>> 16) & 0xff, (v >>> 8) & 0xff, v & 0xff);\n}\nexports.default = parse;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unsafeStringify = void 0;\nconst validate_js_1 = require(\"./validate.js\");\nconst byteToHex = [];\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\nfunction unsafeStringify(arr, offset = 0) {\n return (byteToHex[arr[offset + 0]] +\n byteToHex[arr[offset + 1]] +\n byteToHex[arr[offset + 2]] +\n byteToHex[arr[offset + 3]] +\n '-' +\n byteToHex[arr[offset + 4]] +\n byteToHex[arr[offset + 5]] +\n '-' +\n byteToHex[arr[offset + 6]] +\n byteToHex[arr[offset + 7]] +\n '-' +\n byteToHex[arr[offset + 8]] +\n byteToHex[arr[offset + 9]] +\n '-' +\n byteToHex[arr[offset + 10]] +\n byteToHex[arr[offset + 11]] +\n byteToHex[arr[offset + 12]] +\n byteToHex[arr[offset + 13]] +\n byteToHex[arr[offset + 14]] +\n byteToHex[arr[offset + 15]]).toLowerCase();\n}\nexports.unsafeStringify = unsafeStringify;\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset);\n if (!(0, validate_js_1.default)(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n return uuid;\n}\nexports.default = stringify;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nlet getRandomValues;\nconst rnds8 = new Uint8Array(16);\nfunction rng() {\n if (!getRandomValues) {\n if (typeof crypto === 'undefined' || !crypto.getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n getRandomValues = crypto.getRandomValues.bind(crypto);\n }\n return getRandomValues(rnds8);\n}\nexports.default = rng;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.updateV1State = void 0;\nconst rng_js_1 = require(\"./rng.js\");\nconst stringify_js_1 = require(\"./stringify.js\");\nconst _state = {};\nfunction v1(options, buf, offset) {\n let bytes;\n const isV6 = options?._v6 ?? false;\n if (options) {\n const optionsKeys = Object.keys(options);\n if (optionsKeys.length === 1 && optionsKeys[0] === '_v6') {\n options = undefined;\n }\n }\n if (options) {\n bytes = v1Bytes(options.random ?? options.rng?.() ?? (0, rng_js_1.default)(), options.msecs, options.nsecs, options.clockseq, options.node, buf, offset);\n }\n else {\n const now = Date.now();\n const rnds = (0, rng_js_1.default)();\n updateV1State(_state, now, rnds);\n bytes = v1Bytes(rnds, _state.msecs, _state.nsecs, isV6 ? undefined : _state.clockseq, isV6 ? undefined : _state.node, buf, offset);\n }\n return buf ?? (0, stringify_js_1.unsafeStringify)(bytes);\n}\nfunction updateV1State(state, now, rnds) {\n state.msecs ??= -Infinity;\n state.nsecs ??= 0;\n if (now === state.msecs) {\n state.nsecs++;\n if (state.nsecs >= 10000) {\n state.node = undefined;\n state.nsecs = 0;\n }\n }\n else if (now > state.msecs) {\n state.nsecs = 0;\n }\n else if (now < state.msecs) {\n state.node = undefined;\n }\n if (!state.node) {\n state.node = rnds.slice(10, 16);\n state.node[0] |= 0x01;\n state.clockseq = ((rnds[8] << 8) | rnds[9]) & 0x3fff;\n }\n state.msecs = now;\n return state;\n}\nexports.updateV1State = updateV1State;\nfunction v1Bytes(rnds, msecs, nsecs, clockseq, node, buf, offset = 0) {\n if (rnds.length < 16) {\n throw new Error('Random bytes length must be >= 16');\n }\n if (!buf) {\n buf = new Uint8Array(16);\n offset = 0;\n }\n else {\n if (offset < 0 || offset + 16 > buf.length) {\n throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);\n }\n }\n msecs ??= Date.now();\n nsecs ??= 0;\n clockseq ??= ((rnds[8] << 8) | rnds[9]) & 0x3fff;\n node ??= rnds.slice(10, 16);\n msecs += 12219292800000;\n const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n buf[offset++] = (tl >>> 24) & 0xff;\n buf[offset++] = (tl >>> 16) & 0xff;\n buf[offset++] = (tl >>> 8) & 0xff;\n buf[offset++] = tl & 0xff;\n const tmh = ((msecs / 0x100000000) * 10000) & 0xfffffff;\n buf[offset++] = (tmh >>> 8) & 0xff;\n buf[offset++] = tmh & 0xff;\n buf[offset++] = ((tmh >>> 24) & 0xf) | 0x10;\n buf[offset++] = (tmh >>> 16) & 0xff;\n buf[offset++] = (clockseq >>> 8) | 0x80;\n buf[offset++] = clockseq & 0xff;\n for (let n = 0; n < 6; ++n) {\n buf[offset++] = node[n];\n }\n return buf;\n}\nexports.default = v1;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst parse_js_1 = require(\"./parse.js\");\nconst stringify_js_1 = require(\"./stringify.js\");\nfunction v1ToV6(uuid) {\n const v1Bytes = typeof uuid === 'string' ? (0, parse_js_1.default)(uuid) : uuid;\n const v6Bytes = _v1ToV6(v1Bytes);\n return typeof uuid === 'string' ? (0, stringify_js_1.unsafeStringify)(v6Bytes) : v6Bytes;\n}\nexports.default = v1ToV6;\nfunction _v1ToV6(v1Bytes) {\n return Uint8Array.of(((v1Bytes[6] & 0x0f) << 4) | ((v1Bytes[7] >> 4) & 0x0f), ((v1Bytes[7] & 0x0f) << 4) | ((v1Bytes[4] & 0xf0) >> 4), ((v1Bytes[4] & 0x0f) << 4) | ((v1Bytes[5] & 0xf0) >> 4), ((v1Bytes[5] & 0x0f) << 4) | ((v1Bytes[0] & 0xf0) >> 4), ((v1Bytes[0] & 0x0f) << 4) | ((v1Bytes[1] & 0xf0) >> 4), ((v1Bytes[1] & 0x0f) << 4) | ((v1Bytes[2] & 0xf0) >> 4), 0x60 | (v1Bytes[2] & 0x0f), v1Bytes[3], v1Bytes[8], v1Bytes[9], v1Bytes[10], v1Bytes[11], v1Bytes[12], v1Bytes[13], v1Bytes[14], v1Bytes[15]);\n}\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction md5(bytes) {\n const words = uint8ToUint32(bytes);\n const md5Bytes = wordsToMd5(words, bytes.length * 8);\n return uint32ToUint8(md5Bytes);\n}\nfunction uint32ToUint8(input) {\n const bytes = new Uint8Array(input.length * 4);\n for (let i = 0; i < input.length * 4; i++) {\n bytes[i] = (input[i >> 2] >>> ((i % 4) * 8)) & 0xff;\n }\n return bytes;\n}\nfunction getOutputLength(inputLength8) {\n return (((inputLength8 + 64) >>> 9) << 4) + 14 + 1;\n}\nfunction wordsToMd5(x, len) {\n const xpad = new Uint32Array(getOutputLength(len)).fill(0);\n xpad.set(x);\n xpad[len >> 5] |= 0x80 << len % 32;\n xpad[xpad.length - 1] = len;\n x = xpad;\n let a = 1732584193;\n let b = -271733879;\n let c = -1732584194;\n let d = 271733878;\n for (let i = 0; i < x.length; i += 16) {\n const olda = a;\n const oldb = b;\n const oldc = c;\n const oldd = d;\n a = md5ff(a, b, c, d, x[i], 7, -680876936);\n d = md5ff(d, a, b, c, x[i + 1], 12, -389564586);\n c = md5ff(c, d, a, b, x[i + 2], 17, 606105819);\n b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330);\n a = md5ff(a, b, c, d, x[i + 4], 7, -176418897);\n d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426);\n c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341);\n b = md5ff(b, c, d, a, x[i + 7], 22, -45705983);\n a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416);\n d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417);\n c = md5ff(c, d, a, b, x[i + 10], 17, -42063);\n b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162);\n a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682);\n d = md5ff(d, a, b, c, x[i + 13], 12, -40341101);\n c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290);\n b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329);\n a = md5gg(a, b, c, d, x[i + 1], 5, -165796510);\n d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632);\n c = md5gg(c, d, a, b, x[i + 11], 14, 643717713);\n b = md5gg(b, c, d, a, x[i], 20, -373897302);\n a = md5gg(a, b, c, d, x[i + 5], 5, -701558691);\n d = md5gg(d, a, b, c, x[i + 10], 9, 38016083);\n c = md5gg(c, d, a, b, x[i + 15], 14, -660478335);\n b = md5gg(b, c, d, a, x[i + 4], 20, -405537848);\n a = md5gg(a, b, c, d, x[i + 9], 5, 568446438);\n d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690);\n c = md5gg(c, d, a, b, x[i + 3], 14, -187363961);\n b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501);\n a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467);\n d = md5gg(d, a, b, c, x[i + 2], 9, -51403784);\n c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473);\n b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734);\n a = md5hh(a, b, c, d, x[i + 5], 4, -378558);\n d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463);\n c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562);\n b = md5hh(b, c, d, a, x[i + 14], 23, -35309556);\n a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060);\n d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353);\n c = md5hh(c, d, a, b, x[i + 7], 16, -155497632);\n b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640);\n a = md5hh(a, b, c, d, x[i + 13], 4, 681279174);\n d = md5hh(d, a, b, c, x[i], 11, -358537222);\n c = md5hh(c, d, a, b, x[i + 3], 16, -722521979);\n b = md5hh(b, c, d, a, x[i + 6], 23, 76029189);\n a = md5hh(a, b, c, d, x[i + 9], 4, -640364487);\n d = md5hh(d, a, b, c, x[i + 12], 11, -421815835);\n c = md5hh(c, d, a, b, x[i + 15], 16, 530742520);\n b = md5hh(b, c, d, a, x[i + 2], 23, -995338651);\n a = md5ii(a, b, c, d, x[i], 6, -198630844);\n d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415);\n c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905);\n b = md5ii(b, c, d, a, x[i + 5], 21, -57434055);\n a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571);\n d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606);\n c = md5ii(c, d, a, b, x[i + 10], 15, -1051523);\n b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799);\n a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359);\n d = md5ii(d, a, b, c, x[i + 15], 10, -30611744);\n c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380);\n b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649);\n a = md5ii(a, b, c, d, x[i + 4], 6, -145523070);\n d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379);\n c = md5ii(c, d, a, b, x[i + 2], 15, 718787259);\n b = md5ii(b, c, d, a, x[i + 9], 21, -343485551);\n a = safeAdd(a, olda);\n b = safeAdd(b, oldb);\n c = safeAdd(c, oldc);\n d = safeAdd(d, oldd);\n }\n return Uint32Array.of(a, b, c, d);\n}\nfunction uint8ToUint32(input) {\n if (input.length === 0) {\n return new Uint32Array();\n }\n const output = new Uint32Array(getOutputLength(input.length * 8)).fill(0);\n for (let i = 0; i < input.length; i++) {\n output[i >> 2] |= (input[i] & 0xff) << ((i % 4) * 8);\n }\n return output;\n}\nfunction safeAdd(x, y) {\n const lsw = (x & 0xffff) + (y & 0xffff);\n const msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xffff);\n}\nfunction bitRotateLeft(num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt));\n}\nfunction md5cmn(q, a, b, x, s, t) {\n return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b);\n}\nfunction md5ff(a, b, c, d, x, s, t) {\n return md5cmn((b & c) | (~b & d), a, b, x, s, t);\n}\nfunction md5gg(a, b, c, d, x, s, t) {\n return md5cmn((b & d) | (c & ~d), a, b, x, s, t);\n}\nfunction md5hh(a, b, c, d, x, s, t) {\n return md5cmn(b ^ c ^ d, a, b, x, s, t);\n}\nfunction md5ii(a, b, c, d, x, s, t) {\n return md5cmn(c ^ (b | ~d), a, b, x, s, t);\n}\nexports.default = md5;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.URL = exports.DNS = exports.stringToBytes = void 0;\nconst parse_js_1 = require(\"./parse.js\");\nconst stringify_js_1 = require(\"./stringify.js\");\nfunction stringToBytes(str) {\n str = unescape(encodeURIComponent(str));\n const bytes = new Uint8Array(str.length);\n for (let i = 0; i < str.length; ++i) {\n bytes[i] = str.charCodeAt(i);\n }\n return bytes;\n}\nexports.stringToBytes = stringToBytes;\nexports.DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';\nexports.URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';\nfunction v35(version, hash, value, namespace, buf, offset) {\n const valueBytes = typeof value === 'string' ? stringToBytes(value) : value;\n const namespaceBytes = typeof namespace === 'string' ? (0, parse_js_1.default)(namespace) : namespace;\n if (typeof namespace === 'string') {\n namespace = (0, parse_js_1.default)(namespace);\n }\n if (namespace?.length !== 16) {\n throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');\n }\n let bytes = new Uint8Array(16 + valueBytes.length);\n bytes.set(namespaceBytes);\n bytes.set(valueBytes, namespaceBytes.length);\n bytes = hash(bytes);\n bytes[6] = (bytes[6] & 0x0f) | version;\n bytes[8] = (bytes[8] & 0x3f) | 0x80;\n if (buf) {\n offset = offset || 0;\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = bytes[i];\n }\n return buf;\n }\n return (0, stringify_js_1.unsafeStringify)(bytes);\n}\nexports.default = v35;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.URL = exports.DNS = void 0;\nconst md5_js_1 = require(\"./md5.js\");\nconst v35_js_1 = require(\"./v35.js\");\nvar v35_js_2 = require(\"./v35.js\");\nObject.defineProperty(exports, \"DNS\", { enumerable: true, get: function () { return v35_js_2.DNS; } });\nObject.defineProperty(exports, \"URL\", { enumerable: true, get: function () { return v35_js_2.URL; } });\nfunction v3(value, namespace, buf, offset) {\n return (0, v35_js_1.default)(0x30, md5_js_1.default, value, namespace, buf, offset);\n}\nv3.DNS = v35_js_1.DNS;\nv3.URL = v35_js_1.URL;\nexports.default = v3;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexports.default = { randomUUID };\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst native_js_1 = require(\"./native.js\");\nconst rng_js_1 = require(\"./rng.js\");\nconst stringify_js_1 = require(\"./stringify.js\");\nfunction v4(options, buf, offset) {\n if (native_js_1.default.randomUUID && !buf && !options) {\n return native_js_1.default.randomUUID();\n }\n options = options || {};\n const rnds = options.random ?? options.rng?.() ?? (0, rng_js_1.default)();\n if (rnds.length < 16) {\n throw new Error('Random bytes length must be >= 16');\n }\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n if (buf) {\n offset = offset || 0;\n if (offset < 0 || offset + 16 > buf.length) {\n throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);\n }\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n return buf;\n }\n return (0, stringify_js_1.unsafeStringify)(rnds);\n}\nexports.default = v4;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction f(s, x, y, z) {\n switch (s) {\n case 0:\n return (x & y) ^ (~x & z);\n case 1:\n return x ^ y ^ z;\n case 2:\n return (x & y) ^ (x & z) ^ (y & z);\n case 3:\n return x ^ y ^ z;\n }\n}\nfunction ROTL(x, n) {\n return (x << n) | (x >>> (32 - n));\n}\nfunction sha1(bytes) {\n const K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6];\n const H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0];\n const newBytes = new Uint8Array(bytes.length + 1);\n newBytes.set(bytes);\n newBytes[bytes.length] = 0x80;\n bytes = newBytes;\n const l = bytes.length / 4 + 2;\n const N = Math.ceil(l / 16);\n const M = new Array(N);\n for (let i = 0; i < N; ++i) {\n const arr = new Uint32Array(16);\n for (let j = 0; j < 16; ++j) {\n arr[j] =\n (bytes[i * 64 + j * 4] << 24) |\n (bytes[i * 64 + j * 4 + 1] << 16) |\n (bytes[i * 64 + j * 4 + 2] << 8) |\n bytes[i * 64 + j * 4 + 3];\n }\n M[i] = arr;\n }\n M[N - 1][14] = ((bytes.length - 1) * 8) / Math.pow(2, 32);\n M[N - 1][14] = Math.floor(M[N - 1][14]);\n M[N - 1][15] = ((bytes.length - 1) * 8) & 0xffffffff;\n for (let i = 0; i < N; ++i) {\n const W = new Uint32Array(80);\n for (let t = 0; t < 16; ++t) {\n W[t] = M[i][t];\n }\n for (let t = 16; t < 80; ++t) {\n W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1);\n }\n let a = H[0];\n let b = H[1];\n let c = H[2];\n let d = H[3];\n let e = H[4];\n for (let t = 0; t < 80; ++t) {\n const s = Math.floor(t / 20);\n const T = (ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[t]) >>> 0;\n e = d;\n d = c;\n c = ROTL(b, 30) >>> 0;\n b = a;\n a = T;\n }\n H[0] = (H[0] + a) >>> 0;\n H[1] = (H[1] + b) >>> 0;\n H[2] = (H[2] + c) >>> 0;\n H[3] = (H[3] + d) >>> 0;\n H[4] = (H[4] + e) >>> 0;\n }\n return Uint8Array.of(H[0] >> 24, H[0] >> 16, H[0] >> 8, H[0], H[1] >> 24, H[1] >> 16, H[1] >> 8, H[1], H[2] >> 24, H[2] >> 16, H[2] >> 8, H[2], H[3] >> 24, H[3] >> 16, H[3] >> 8, H[3], H[4] >> 24, H[4] >> 16, H[4] >> 8, H[4]);\n}\nexports.default = sha1;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.URL = exports.DNS = void 0;\nconst sha1_js_1 = require(\"./sha1.js\");\nconst v35_js_1 = require(\"./v35.js\");\nvar v35_js_2 = require(\"./v35.js\");\nObject.defineProperty(exports, \"DNS\", { enumerable: true, get: function () { return v35_js_2.DNS; } });\nObject.defineProperty(exports, \"URL\", { enumerable: true, get: function () { return v35_js_2.URL; } });\nfunction v5(value, namespace, buf, offset) {\n return (0, v35_js_1.default)(0x50, sha1_js_1.default, value, namespace, buf, offset);\n}\nv5.DNS = v35_js_1.DNS;\nv5.URL = v35_js_1.URL;\nexports.default = v5;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst stringify_js_1 = require(\"./stringify.js\");\nconst v1_js_1 = require(\"./v1.js\");\nconst v1ToV6_js_1 = require(\"./v1ToV6.js\");\nfunction v6(options, buf, offset) {\n options ??= {};\n offset ??= 0;\n let bytes = (0, v1_js_1.default)({ ...options, _v6: true }, new Uint8Array(16));\n bytes = (0, v1ToV6_js_1.default)(bytes);\n if (buf) {\n for (let i = 0; i < 16; i++) {\n buf[offset + i] = bytes[i];\n }\n return buf;\n }\n return (0, stringify_js_1.unsafeStringify)(bytes);\n}\nexports.default = v6;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst parse_js_1 = require(\"./parse.js\");\nconst stringify_js_1 = require(\"./stringify.js\");\nfunction v6ToV1(uuid) {\n const v6Bytes = typeof uuid === 'string' ? (0, parse_js_1.default)(uuid) : uuid;\n const v1Bytes = _v6ToV1(v6Bytes);\n return typeof uuid === 'string' ? (0, stringify_js_1.unsafeStringify)(v1Bytes) : v1Bytes;\n}\nexports.default = v6ToV1;\nfunction _v6ToV1(v6Bytes) {\n return Uint8Array.of(((v6Bytes[3] & 0x0f) << 4) | ((v6Bytes[4] >> 4) & 0x0f), ((v6Bytes[4] & 0x0f) << 4) | ((v6Bytes[5] & 0xf0) >> 4), ((v6Bytes[5] & 0x0f) << 4) | (v6Bytes[6] & 0x0f), v6Bytes[7], ((v6Bytes[1] & 0x0f) << 4) | ((v6Bytes[2] & 0xf0) >> 4), ((v6Bytes[2] & 0x0f) << 4) | ((v6Bytes[3] & 0xf0) >> 4), 0x10 | ((v6Bytes[0] & 0xf0) >> 4), ((v6Bytes[0] & 0x0f) << 4) | ((v6Bytes[1] & 0xf0) >> 4), v6Bytes[8], v6Bytes[9], v6Bytes[10], v6Bytes[11], v6Bytes[12], v6Bytes[13], v6Bytes[14], v6Bytes[15]);\n}\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.updateV7State = void 0;\nconst rng_js_1 = require(\"./rng.js\");\nconst stringify_js_1 = require(\"./stringify.js\");\nconst _state = {};\nfunction v7(options, buf, offset) {\n let bytes;\n if (options) {\n bytes = v7Bytes(options.random ?? options.rng?.() ?? (0, rng_js_1.default)(), options.msecs, options.seq, buf, offset);\n }\n else {\n const now = Date.now();\n const rnds = (0, rng_js_1.default)();\n updateV7State(_state, now, rnds);\n bytes = v7Bytes(rnds, _state.msecs, _state.seq, buf, offset);\n }\n return buf ?? (0, stringify_js_1.unsafeStringify)(bytes);\n}\nfunction updateV7State(state, now, rnds) {\n state.msecs ??= -Infinity;\n state.seq ??= 0;\n if (now > state.msecs) {\n state.seq = (rnds[6] << 23) | (rnds[7] << 16) | (rnds[8] << 8) | rnds[9];\n state.msecs = now;\n }\n else {\n state.seq = (state.seq + 1) | 0;\n if (state.seq === 0) {\n state.msecs++;\n }\n }\n return state;\n}\nexports.updateV7State = updateV7State;\nfunction v7Bytes(rnds, msecs, seq, buf, offset = 0) {\n if (rnds.length < 16) {\n throw new Error('Random bytes length must be >= 16');\n }\n if (!buf) {\n buf = new Uint8Array(16);\n offset = 0;\n }\n else {\n if (offset < 0 || offset + 16 > buf.length) {\n throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);\n }\n }\n msecs ??= Date.now();\n seq ??= ((rnds[6] * 0x7f) << 24) | (rnds[7] << 16) | (rnds[8] << 8) | rnds[9];\n buf[offset++] = (msecs / 0x10000000000) & 0xff;\n buf[offset++] = (msecs / 0x100000000) & 0xff;\n buf[offset++] = (msecs / 0x1000000) & 0xff;\n buf[offset++] = (msecs / 0x10000) & 0xff;\n buf[offset++] = (msecs / 0x100) & 0xff;\n buf[offset++] = msecs & 0xff;\n buf[offset++] = 0x70 | ((seq >>> 28) & 0x0f);\n buf[offset++] = (seq >>> 20) & 0xff;\n buf[offset++] = 0x80 | ((seq >>> 14) & 0x3f);\n buf[offset++] = (seq >>> 6) & 0xff;\n buf[offset++] = ((seq << 2) & 0xff) | (rnds[10] & 0x03);\n buf[offset++] = rnds[11];\n buf[offset++] = rnds[12];\n buf[offset++] = rnds[13];\n buf[offset++] = rnds[14];\n buf[offset++] = rnds[15];\n return buf;\n}\nexports.default = v7;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst validate_js_1 = require(\"./validate.js\");\nfunction version(uuid) {\n if (!(0, validate_js_1.default)(uuid)) {\n throw TypeError('Invalid UUID');\n }\n return parseInt(uuid.slice(14, 15), 16);\n}\nexports.default = version;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.version = exports.validate = exports.v7 = exports.v6ToV1 = exports.v6 = exports.v5 = exports.v4 = exports.v3 = exports.v1ToV6 = exports.v1 = exports.stringify = exports.parse = exports.NIL = exports.MAX = void 0;\nvar max_js_1 = require(\"./max.js\");\nObject.defineProperty(exports, \"MAX\", { enumerable: true, get: function () { return max_js_1.default; } });\nvar nil_js_1 = require(\"./nil.js\");\nObject.defineProperty(exports, \"NIL\", { enumerable: true, get: function () { return nil_js_1.default; } });\nvar parse_js_1 = require(\"./parse.js\");\nObject.defineProperty(exports, \"parse\", { enumerable: true, get: function () { return parse_js_1.default; } });\nvar stringify_js_1 = require(\"./stringify.js\");\nObject.defineProperty(exports, \"stringify\", { enumerable: true, get: function () { return stringify_js_1.default; } });\nvar v1_js_1 = require(\"./v1.js\");\nObject.defineProperty(exports, \"v1\", { enumerable: true, get: function () { return v1_js_1.default; } });\nvar v1ToV6_js_1 = require(\"./v1ToV6.js\");\nObject.defineProperty(exports, \"v1ToV6\", { enumerable: true, get: function () { return v1ToV6_js_1.default; } });\nvar v3_js_1 = require(\"./v3.js\");\nObject.defineProperty(exports, \"v3\", { enumerable: true, get: function () { return v3_js_1.default; } });\nvar v4_js_1 = require(\"./v4.js\");\nObject.defineProperty(exports, \"v4\", { enumerable: true, get: function () { return v4_js_1.default; } });\nvar v5_js_1 = require(\"./v5.js\");\nObject.defineProperty(exports, \"v5\", { enumerable: true, get: function () { return v5_js_1.default; } });\nvar v6_js_1 = require(\"./v6.js\");\nObject.defineProperty(exports, \"v6\", { enumerable: true, get: function () { return v6_js_1.default; } });\nvar v6ToV1_js_1 = require(\"./v6ToV1.js\");\nObject.defineProperty(exports, \"v6ToV1\", { enumerable: true, get: function () { return v6ToV1_js_1.default; } });\nvar v7_js_1 = require(\"./v7.js\");\nObject.defineProperty(exports, \"v7\", { enumerable: true, get: function () { return v7_js_1.default; } });\nvar validate_js_1 = require(\"./validate.js\");\nObject.defineProperty(exports, \"validate\", { enumerable: true, get: function () { return validate_js_1.default; } });\nvar version_js_1 = require(\"./version.js\");\nObject.defineProperty(exports, \"version\", { enumerable: true, get: function () { return version_js_1.default; } });\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\n\n/**\n * Represents a generic Entity.\n */\nexport interface Entity {\n /**\n * The type of the entity.\n */\n type: string\n /**\n * Additional properties of the entity.\n */\n [key: string]: unknown\n}\n\n/**\n * Zod schema for validating Entity objects.\n */\nexport const entityZodSchema = z.object({\n type: z.string().min(1)\n}).passthrough()\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\nimport { Entity, entityZodSchema } from '../entity/entity'\nimport { SemanticActionStateTypes, semanticActionStateTypesZodSchema } from './semanticActionStateTypes'\n\n/**\n * Represents a semantic action.\n */\nexport interface SemanticAction {\n /**\n * Unique identifier for the semantic action.\n */\n id: string\n /**\n * State of the semantic action.\n */\n state: SemanticActionStateTypes | string\n /**\n * Entities associated with the semantic action.\n */\n entities: { [propertyName: string]: Entity }\n}\n\n/**\n * Zod schema for validating SemanticAction.\n */\nexport const semanticActionZodSchema = z.object({\n id: z.string().min(1),\n state: z.union([semanticActionStateTypesZodSchema, z.string().min(1)]),\n entities: z.record(entityZodSchema)\n})\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\nimport { ActionTypes, actionTypesZodSchema } from './actionTypes'\n\n/**\n * Represents a card action.\n */\nexport interface CardAction {\n /**\n * Type of the action.\n */\n type: ActionTypes | string\n /**\n * Title of the action.\n */\n title: string\n /**\n * URL of the image associated with the action.\n */\n image?: string\n /**\n * Text associated with the action.\n */\n text?: string\n /**\n * Display text for the action.\n */\n displayText?: string\n /**\n * Value associated with the action.\n */\n value?: any\n /**\n * Channel-specific data associated with the action.\n */\n channelData?: unknown\n /**\n * Alt text for the image.\n */\n imageAltText?: string\n}\n\n/**\n * Zod schema for validating CardAction.\n */\nexport const cardActionZodSchema = z.object({\n type: z.union([actionTypesZodSchema, z.string().min(1)]),\n title: z.string().min(1),\n image: z.string().min(1).optional(),\n text: z.string().min(1).optional(),\n displayText: z.string().min(1).optional(),\n value: z.any().optional(),\n channelData: z.unknown().optional(),\n imageAltText: z.string().min(1).optional()\n})\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\nimport { CardAction, cardActionZodSchema } from './cardAction'\n\n/**\n * Represents suggested actions.\n */\nexport interface SuggestedActions {\n /**\n * Array of recipient IDs.\n */\n to: string[]\n /**\n * Array of card actions.\n */\n actions: CardAction[]\n}\n\n/**\n * Zod schema for validating SuggestedActions.\n */\nexport const suggestedActionsZodSchema = z.object({\n to: z.array(z.string().min(1)),\n actions: z.array(cardActionZodSchema)\n})\n", "/**\n * Copyright(c) Microsoft Corporation.All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\n\n/**\n * Enum representing activity event names.\n */\nexport enum ActivityEventNames {\n /**\n * Event name for continuing a conversation.\n */\n ContinueConversation = 'ContinueConversation',\n\n /**\n * Event name for creating a new conversation.\n */\n CreateConversation = 'CreateConversation',\n}\n\n/**\n * Zod schema for validating an ActivityEventNames enum.\n */\nexport const activityEventNamesZodSchema = z.enum(['ContinueConversation', 'CreateConversation'])\n", "/**\n * Copyright(c) Microsoft Corporation.All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\n\n/**\n * Enum representing activity importance levels.\n */\nexport enum ActivityImportance {\n /**\n * Indicates low importance.\n */\n Low = 'low',\n\n /**\n * Indicates normal importance.\n */\n Normal = 'normal',\n\n /**\n * Indicates high importance.\n */\n High = 'high',\n}\n\n/**\n * Zod schema for validating an ActivityImportance enum.\n */\nexport const activityImportanceZodSchema = z.enum(['low', 'normal', 'high'])\n", "/**\n * Copyright(c) Microsoft Corporation.All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\n\n/**\n * Enum representing activity types.\n */\nexport enum ActivityTypes {\n /**\n * A message activity.\n */\n Message = 'message',\n\n /**\n * An update to a contact relationship.\n */\n ContactRelationUpdate = 'contactRelationUpdate',\n\n /**\n * An update to a conversation.\n */\n ConversationUpdate = 'conversationUpdate',\n\n /**\n * A typing indicator activity.\n */\n Typing = 'typing',\n\n /**\n * Indicates the end of a conversation.\n */\n EndOfConversation = 'endOfConversation',\n\n /**\n * An event activity.\n */\n Event = 'event',\n\n /**\n * An invoke activity.\n */\n Invoke = 'invoke',\n\n /**\n * A response to an invoke activity.\n */\n InvokeResponse = 'invokeResponse',\n\n /**\n * An activity to delete user data.\n */\n DeleteUserData = 'deleteUserData',\n\n /**\n * An update to a message.\n */\n MessageUpdate = 'messageUpdate',\n\n /**\n * A deletion of a message.\n */\n MessageDelete = 'messageDelete',\n\n /**\n * An update to an installation.\n */\n InstallationUpdate = 'installationUpdate',\n\n /**\n * A reaction to a message.\n */\n MessageReaction = 'messageReaction',\n\n /**\n * A suggestion activity.\n */\n Suggestion = 'suggestion',\n\n /**\n * A trace activity for debugging.\n */\n Trace = 'trace',\n\n /**\n * A handoff activity to another bot or human.\n */\n Handoff = 'handoff',\n\n /**\n * A command activity.\n */\n Command = 'command',\n\n /**\n * A result of a command activity.\n */\n CommandResult = 'commandResult',\n}\n\n/**\n * Zod schema for validating an ActivityTypes enum.\n */\nexport const activityTypesZodSchema = z.enum([\n 'message',\n 'contactRelationUpdate',\n 'conversationUpdate',\n 'typing',\n 'endOfConversation',\n 'event',\n 'invoke',\n 'invokeResponse',\n 'deleteUserData',\n 'messageUpdate',\n 'messageDelete',\n 'installationUpdate',\n 'messageReaction',\n 'suggestion',\n 'trace',\n 'handoff',\n 'command',\n 'commandResult',\n])\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\n\n/**\n * Represents an attachment.\n */\nexport interface Attachment {\n /**\n * The MIME type of the attachment content.\n */\n contentType: string\n\n /**\n * The URL of the attachment content.\n */\n contentUrl?: string\n\n /**\n * The content of the attachment.\n */\n content?: unknown\n\n /**\n * The name of the attachment.\n */\n name?: string\n\n /**\n * The URL of the thumbnail for the attachment.\n */\n thumbnailUrl?: string\n}\n\n/**\n * Zod schema for validating attachments.\n */\nexport const attachmentZodSchema = z.object({\n contentType: z.string().min(1),\n contentUrl: z.string().min(1).optional(),\n content: z.unknown().optional(),\n name: z.string().min(1).optional(),\n thumbnailUrl: z.string().min(1).optional()\n})\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Activity } from '../activity'\nimport { Entity } from './entity'\n\nexport interface ProductInfo extends Entity {\n type: 'ProductInfo';\n id: string;\n}\n\n/**\n * Remove any ProductInfo entities from the activity\n * @param activity\n */\nexport const clearProductInfoFromActivity = (activity: Activity): void => {\n if (activity && activity.entities && activity.entities.length) {\n activity.entities = activity.entities.filter(e => e.type !== 'ProductInfo')\n }\n}\n\n/**\n * Add a new ProductInfo entity to the activity and ensure only one exists\n * @param activity\n * @param id\n */\nexport const addProductInfoToActivity = (activity: Activity, id: string) : void => {\n const productInfo: ProductInfo = {\n type: 'ProductInfo',\n id\n }\n activity.entities ??= []\n clearProductInfoFromActivity(activity)\n activity.entities?.push(productInfo)\n}\n", "/**\n * Copyright(c) Microsoft Corporation.All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\nimport { roleTypeZodSchema, RoleTypes } from './roleTypes'\nimport { MembershipSource } from './membershipSource'\n\n/**\n * Represents a channel account.\n */\nexport interface ChannelAccount {\n /**\n * The unique identifier of the channel account.\n */\n id?: string\n\n /**\n * The name of the channel account.\n */\n name?: string\n\n /**\n * The Azure Active Directory object ID of the channel account.\n */\n aadObjectId?: string\n\n /**\n * Tenant ID of the user.\n */\n tenantId?: string\n\n /**\n * The UPN of an agentic user\n */\n agenticUserId?: string\n\n /**\n * The client ID of an agentic app\n */\n agenticAppId?: string\n\n /**\n * The parent blueprint ID of an agentic instance\n */\n agenticAppBlueprintId?: string\n\n /**\n * The role of the channel account.\n */\n role?: RoleTypes | string\n\n /**\n * Additional properties of the channel account.\n */\n properties?: unknown\n\n /**\n * List of membership sources associated with the channel account.\n */\n membershipSources?: MembershipSource[]\n}\n\n/**\n * Zod schema for validating a channel account.\n */\nexport const channelAccountZodSchema = z.object({\n id: z.string().min(1).optional(),\n name: z.string().optional(),\n aadObjectId: z.string().min(1).optional(),\n tenantId: z.string().min(1).optional(),\n agenticUserId: z.string().min(1).optional(),\n agenticAppId: z.string().min(1).optional(),\n agenticAppBlueprintId: z.string().min(1).optional(),\n role: z.union([roleTypeZodSchema, z.string().min(1)]).optional(),\n properties: z.unknown().optional()\n})\n", "/**\n * Copyright(c) Microsoft Corporation.All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\nimport { roleTypeZodSchema, RoleTypes } from './roleTypes'\n\n/**\n * Represents a conversation account.\n */\nexport interface ConversationAccount {\n /**\n * The unique identifier of the conversation account.\n */\n id: string\n\n /**\n * The type of the conversation (e.g., personal, group, etc.).\n */\n conversationType?: string\n\n /**\n * The tenant ID associated with the conversation account.\n */\n tenantId?: string\n\n /**\n * Indicates whether the conversation is a group.\n */\n isGroup?: boolean\n\n /**\n * The name of the conversation account.\n */\n name?: string\n\n /**\n * The Azure Active Directory object ID of the conversation account.\n */\n aadObjectId?: string\n\n /**\n * The role of the conversation account.\n */\n role?: RoleTypes | string\n\n /**\n * Additional properties of the conversation account.\n */\n properties?: unknown\n}\n\n/**\n * Zod schema for validating a conversation account.\n */\nexport const conversationAccountZodSchema = z.object({\n isGroup: z.boolean().optional(),\n conversationType: z.string().min(1).optional(),\n tenantId: z.string().min(1).optional(),\n id: z.string().min(1),\n name: z.string().min(1).optional(),\n aadObjectId: z.string().min(1).optional(),\n role: z.union([roleTypeZodSchema, z.string().min(1)]).optional(),\n properties: z.unknown().optional()\n})\n", "/**\n * Copyright(c) Microsoft Corporation.All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\nimport { ChannelAccount, channelAccountZodSchema } from './channelAccount'\nimport { ConversationAccount, conversationAccountZodSchema } from './conversationAccount'\n\n/**\n * Represents a reference to a conversation.\n */\nexport interface ConversationReference {\n /**\n * The ID of the activity. Optional.\n */\n activityId?: string\n\n /**\n * The user involved in the conversation. Optional.\n */\n user?: ChannelAccount\n\n /**\n * The locale of the conversation. Optional.\n */\n locale?: string\n\n /**\n * The agent involved in the conversation. Can be undefined or null. Optional.\n */\n agent?: ChannelAccount | undefined | null\n\n /**\n * The conversation account details.\n */\n conversation: ConversationAccount\n\n /**\n * The ID of the channel where the conversation is taking place.\n */\n channelId: string\n\n /**\n * The service URL for the conversation. Optional.\n */\n serviceUrl?: string | undefined\n}\n\n/**\n * Zod schema for validating a conversation reference.\n */\nexport const conversationReferenceZodSchema = z.object({\n activityId: z.string().min(1).optional(),\n user: channelAccountZodSchema.optional(),\n locale: z.string().min(1).optional(),\n agent: channelAccountZodSchema.optional().nullable(),\n conversation: conversationAccountZodSchema,\n channelId: z.string().min(1),\n serviceUrl: z.string().min(1).optional()\n})\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\n\n/**\n * Enum representing delivery modes.\n */\nexport enum DeliveryModes {\n /**\n * Represents the normal delivery mode.\n */\n Normal = 'normal',\n\n /**\n * Represents a notification delivery mode.\n */\n Notification = 'notification',\n\n /**\n * Represents a delivery mode where replies are expected.\n */\n ExpectReplies = 'expectReplies',\n\n /**\n * Represents an ephemeral delivery mode.\n */\n Ephemeral = 'ephemeral',\n}\n\n/**\n * Zod schema for validating a DeliveryModes enum.\n */\nexport const deliveryModesZodSchema = z.enum(['normal', 'notification', 'expectReplies', 'ephemeral'])\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\n\n/**\n * Enum representing input hints.\n */\nexport enum InputHints {\n /**\n * Indicates that the bot is ready to accept input from the user.\n */\n AcceptingInput = 'acceptingInput',\n\n /**\n * Indicates that the bot is ignoring input from the user.\n */\n IgnoringInput = 'ignoringInput',\n\n /**\n * Indicates that the bot is expecting input from the user.\n */\n ExpectingInput = 'expectingInput',\n}\n\n/**\n * Zod schema for validating an InputHints enum.\n */\nexport const inputHintsZodSchema = z.enum(['acceptingInput', 'ignoringInput', 'expectingInput'])\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\n\n/**\n * Enum representing message reaction types.\n */\nexport enum MessageReactionTypes {\n /**\n * Represents a 'like' reaction to a message.\n */\n Like = 'like',\n\n /**\n * Represents a '+1' reaction to a message.\n */\n PlusOne = 'plusOne',\n}\n\n/**\n * Zod schema for validating MessageReactionTypes enum values.\n */\nexport const messageReactionTypesZodSchema = z.enum(['like', 'plusOne'])\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\nimport { MessageReactionTypes, messageReactionTypesZodSchema } from './messageReactionTypes'\n\n/**\n * Represents a message reaction.\n */\nexport interface MessageReaction {\n /**\n * The type of the reaction.\n */\n type: MessageReactionTypes | string\n}\n\n/**\n * Zod schema for validating a MessageReaction object.\n */\nexport const messageReactionZodSchema = z.object({\n type: z.union([messageReactionTypesZodSchema, z.string().min(1)])\n})\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\n\n/**\n * Enum representing text format types.\n */\nexport enum TextFormatTypes {\n /**\n * Represents text formatted using Markdown.\n */\n Markdown = 'markdown',\n\n /**\n * Represents plain text without any formatting.\n */\n Plain = 'plain',\n\n /**\n * Represents text formatted using XML.\n */\n Xml = 'xml',\n}\n\n/**\n * Zod schema for validating TextFormatTypes enum values.\n */\nexport const textFormatTypesZodSchema = z.enum(['markdown', 'plain', 'xml'])\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\n\n/**\n * Represents a text highlight.\n */\nexport interface TextHighlight {\n /**\n * The highlighted text.\n */\n text: string\n /**\n * The occurrence count of the highlighted text.\n */\n occurrence: number\n}\n\n/**\n * Zod schema for validating TextHighlight objects.\n */\nexport const textHighlightZodSchema = z.object({\n text: z.string().min(1),\n occurrence: z.number()\n})\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\n/**\n * Represents an error definition for the Agents SDK.\n * Each error definition includes an error code, description, and an optional help link.\n * If helplink is not provided, a default help link will be used.\n */\nexport interface AgentErrorDefinition {\n /**\n * Error code for the exception\n */\n code: number\n\n /**\n * Displayed error message\n */\n description: string\n\n /**\n * Optional help URL link for the error.\n * If not provided, the default help link will be used.\n */\n helplink?: string\n}\n\n/**\n * Enhanced error type with additional properties for error code, help link, and inner exception.\n * This interface extends the standard Error type with custom properties added by ExceptionHelper.\n */\nexport interface AgentError extends Error {\n /**\n * Error code for the exception\n */\n code: number\n\n /**\n * Help URL link for the error\n */\n helpLink: string\n\n /**\n * Optional inner exception\n */\n innerException?: Error\n}\n\n/**\n * Helper class for generating exceptions with error codes.\n */\nexport class ExceptionHelper {\n /**\n * Default help link template for error codes.\n * The {errorCode} token will be replaced with the actual error code.\n */\n static readonly DEFAULT_HELPLINK = 'https://aka.ms/M365AgentsErrorCodesJS/#{errorCode}'\n\n /**\n * Generates a typed exception with error code and help link.\n * The message format is: [CODE] - [message] - [helplink]\n * @param ErrorType The constructor of the error type to create\n * @param errorDefinition The error definition containing code, description, and optional help link\n * @param innerException Optional inner exception\n * @param params Optional parameters object for message formatting with key-value pairs\n * @returns A new exception instance with error code and help link, typed as AgentError\n */\n static generateException<T extends Error> (\n ErrorType: new (message: string, innerException?: Error) => T,\n errorDefinition: AgentErrorDefinition,\n innerException?: Error,\n params?: { [key: string]: string }\n ): T & AgentError {\n // Format the message with parameters if provided\n let description = errorDefinition.description\n if (params) {\n Object.keys(params).forEach((key) => {\n description = description.replace(`{${key}}`, params[key])\n })\n }\n\n // Use provided helplink or default if not provided\n const helplinkTemplate = errorDefinition.helplink ?? ExceptionHelper.DEFAULT_HELPLINK\n\n // Replace {errorCode} token in helplink with the actual error code\n const helplink = helplinkTemplate.replace('{errorCode}', errorDefinition.code.toString())\n\n // Format the full message as: [CODE] - [message] - [helplink]\n const message = `[${errorDefinition.code}] - ${description} - ${helplink}`\n\n // Create the exception\n const exception = new ErrorType(message) as T & AgentError\n\n // Set error code and help link as custom properties\n exception.code = errorDefinition.code\n exception.helpLink = helplink\n\n // Store inner exception as a custom property if provided\n if (innerException) {\n exception.innerException = innerException\n }\n\n return exception\n }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { AgentErrorDefinition } from './exceptionHelper'\n\n/**\n * Error definitions for the Activity system.\n * This contains localized error codes for the Activity subsystem of the AgentSDK.\n *\n * Each error definition includes an error code (starting from -110000), a description, and a help link\n * pointing to an AKA link to get help for the given error.\n *\n * Usage example:\n * ```\n * throw ExceptionHelper.generateException(\n * Error,\n * Errors.InvalidActivityTypeUndefined\n * );\n * ```\n */\nexport const Errors: { [key: string]: AgentErrorDefinition } = {\n /**\n * Error thrown when ActivityType is undefined.\n */\n InvalidActivityTypeUndefined: {\n code: -110000,\n description: 'Invalid ActivityType: undefined'\n },\n\n /**\n * Error thrown when ActivityType is null.\n */\n InvalidActivityTypeNull: {\n code: -110001,\n description: 'Invalid ActivityType: null'\n },\n\n /**\n * Error thrown when ActivityType is an empty string.\n */\n InvalidActivityTypeEmptyString: {\n code: -110002,\n description: 'Invalid ActivityType: empty string'\n },\n\n /**\n * Error thrown when channelId has a subChannel but no main channel.\n */\n InvalidChannelIdFormat: {\n code: -110003,\n description: 'Invalid channelId {channelId}. Found subChannel but no main channel.'\n },\n\n /**\n * Error thrown when attempting to set subChannel before setting the primary channel.\n */\n PrimaryChannelNotSet: {\n code: -110004,\n description: 'Primary channel must be set before setting subChannel'\n },\n\n /**\n * Error thrown when Activity Recipient is undefined.\n */\n ActivityRecipientUndefined: {\n code: -110005,\n description: 'Activity Recipient undefined'\n },\n\n /**\n * Error thrown when Activity Conversation is undefined.\n */\n ActivityConversationUndefined: {\n code: -110006,\n description: 'Activity Conversation undefined'\n },\n\n /**\n * Error thrown when Activity ChannelId is undefined.\n */\n ActivityChannelIdUndefined: {\n code: -110007,\n description: 'Activity ChannelId undefined'\n }\n}\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { v4 as uuid } from 'uuid'\nimport { z } from 'zod'\nimport { SemanticAction, semanticActionZodSchema } from './action/semanticAction'\nimport { SuggestedActions, suggestedActionsZodSchema } from './action/suggestedActions'\nimport { ActivityEventNames, activityEventNamesZodSchema } from './activityEventNames'\nimport { ActivityImportance, activityImportanceZodSchema } from './activityImportance'\nimport { ActivityTypes, activityTypesZodSchema } from './activityTypes'\nimport { Attachment, attachmentZodSchema } from './attachment/attachment'\nimport { AttachmentLayoutTypes, attachmentLayoutTypesZodSchema } from './attachment/attachmentLayoutTypes'\nimport { addProductInfoToActivity, clearProductInfoFromActivity } from './entity/productInfo'\nimport { ChannelAccount, channelAccountZodSchema } from './conversation/channelAccount'\nimport { Channels } from './conversation/channels'\nimport { ConversationAccount, conversationAccountZodSchema } from './conversation/conversationAccount'\nimport { ConversationReference, conversationReferenceZodSchema } from './conversation/conversationReference'\nimport { EndOfConversationCodes, endOfConversationCodesZodSchema } from './conversation/endOfConversationCodes'\nimport { DeliveryModes, deliveryModesZodSchema } from './deliveryModes'\nimport { Entity, entityZodSchema } from './entity/entity'\nimport { Mention } from './entity/mention'\nimport { InputHints, inputHintsZodSchema } from './inputHints'\nimport { MessageReaction, messageReactionZodSchema } from './messageReaction'\nimport { TextFormatTypes, textFormatTypesZodSchema } from './textFormatTypes'\nimport { TextHighlight, textHighlightZodSchema } from './textHighlight'\nimport { RoleTypes } from './conversation/roleTypes'\nimport { ExceptionHelper } from './exceptionHelper'\nimport { Errors } from './errorHelper'\n\n/**\n * Zod schema for validating an Activity object.\n */\nexport const activityZodSchema = z.object({\n type: z.union([activityTypesZodSchema, z.string().min(1)]),\n text: z.string().optional(),\n id: z.string().min(1).optional(),\n channelId: z.string().min(1).optional(),\n from: channelAccountZodSchema.optional(),\n timestamp: z.union([z.date(), z.string().min(1).transform(s => new Date(s))]).optional(),\n localTimestamp: z.union([z.date(), z.string().min(1).transform(s => new Date(s))]).optional(),\n localTimezone: z.string().min(1).optional(),\n callerId: z.string().min(1).optional(),\n serviceUrl: z.string().min(1).optional(),\n conversation: conversationAccountZodSchema.optional(),\n recipient: channelAccountZodSchema.optional(),\n textFormat: z.union([textFormatTypesZodSchema, z.string().min(1)]).optional(),\n attachmentLayout: z.union([attachmentLayoutTypesZodSchema, z.string().min(1)]).optional(),\n membersAdded: z.array(channelAccountZodSchema).optional(),\n membersRemoved: z.array(channelAccountZodSchema).optional(),\n reactionsAdded: z.array(messageReactionZodSchema).optional(),\n reactionsRemoved: z.array(messageReactionZodSchema).optional(),\n topicName: z.string().min(1).optional(),\n historyDisclosed: z.boolean().optional(),\n locale: z.string().min(1).optional(),\n speak: z.string().min(1).optional(),\n inputHint: z.union([inputHintsZodSchema, z.string().min(1)]).optional(),\n summary: z.string().min(1).optional(),\n suggestedActions: suggestedActionsZodSchema.optional(),\n attachments: z.array(attachmentZodSchema).optional(),\n entities: z.array(entityZodSchema.passthrough()).optional(),\n channelData: z.any().optional(),\n action: z.string().min(1).optional(),\n replyToId: z.string().min(1).optional(),\n label: z.string().min(1).optional(),\n valueType: z.string().min(1).optional(),\n value: z.unknown().optional(),\n name: z.union([activityEventNamesZodSchema, z.string().min(1)]).optional(),\n relatesTo: conversationReferenceZodSchema.optional(),\n code: z.union([endOfConversationCodesZodSchema, z.string().min(1)]).optional(),\n expiration: z.union([z.date(), z.string().min(1).transform(s => new Date(s))]).optional(),\n importance: z.union([activityImportanceZodSchema, z.string().min(1)]).optional(),\n deliveryMode: z.union([deliveryModesZodSchema, z.string().min(1)]).optional(),\n listenFor: z.array(z.string().min(1)).optional(),\n textHighlights: z.array(textHighlightZodSchema).optional(),\n semanticAction: semanticActionZodSchema.optional(),\n})\n\n/**\n * Represents an activity in a conversation.\n */\nexport class Activity {\n /**\n * The type of the activity.\n */\n type: ActivityTypes | string\n\n /**\n * The text content of the activity.\n */\n text?: string\n\n /**\n * The unique identifier of the activity.\n */\n id?: string\n\n /**\n * The primary channel ID where the activity originated.\n */\n _channelId?: string\n\n /**\n * The account of the sender of the activity.\n */\n from?: ChannelAccount\n\n /**\n * The timestamp of the activity.\n */\n timestamp?: Date | string\n\n /**\n * The local timestamp of the activity.\n */\n localTimestamp?: Date | string\n\n /**\n * The local timezone of the activity.\n */\n localTimezone?: string\n\n /**\n * The caller ID of the activity.\n */\n callerId?: string\n\n /**\n * The service URL of the activity.\n */\n serviceUrl?: string\n\n /**\n * The conversation account associated with the activity.\n */\n conversation?: ConversationAccount\n\n /**\n * The recipient of the activity.\n */\n recipient?: ChannelAccount\n\n /**\n * The text format of the activity.\n */\n textFormat?: TextFormatTypes | string\n\n /**\n * The attachment layout of the activity.\n */\n attachmentLayout?: AttachmentLayoutTypes | string\n\n /**\n * The members added to the conversation.\n */\n membersAdded?: ChannelAccount[]\n\n /**\n * The members removed from the conversation.\n */\n membersRemoved?: ChannelAccount[]\n\n /**\n * The reactions added to the activity.\n */\n reactionsAdded?: MessageReaction[]\n\n /**\n * The reactions removed from the activity.\n */\n reactionsRemoved?: MessageReaction[]\n\n /**\n * The topic name of the activity.\n */\n topicName?: string\n\n /**\n * Indicates whether the history is disclosed.\n */\n historyDisclosed?: boolean\n\n /**\n * The locale of the activity.\n */\n locale?: string\n\n /**\n * The speech text of the activity.\n */\n speak?: string\n\n /**\n * The input hint for the activity.\n */\n inputHint?: InputHints | string\n\n /**\n * The summary of the activity.\n */\n summary?: string\n\n /**\n * The suggested actions for the activity.\n */\n suggestedActions?: SuggestedActions\n\n /**\n * The attachments of the activity.\n */\n attachments?: Attachment[]\n\n /**\n * The entities associated with the activity.\n */\n entities?: Entity[]\n\n /**\n * The channel-specific data for the activity.\n */\n channelData?: any\n\n /**\n * The action associated with the activity.\n */\n action?: string\n\n /**\n * The ID of the activity being replied to.\n */\n replyToId?: string\n\n /**\n * The label for the activity.\n */\n label?: string\n\n /**\n * The value type of the activity.\n */\n valueType?: string\n\n /**\n * The value associated with the activity.\n */\n value?: unknown\n\n /**\n * The name of the activity event.\n */\n name?: ActivityEventNames | string\n\n /**\n * The conversation reference for the activity.\n */\n relatesTo?: ConversationReference\n\n /**\n * The end-of-conversation code for the activity.\n */\n code?: EndOfConversationCodes | string\n\n /**\n * The expiration time of the activity.\n */\n expiration?: string | Date\n\n /**\n * The importance of the activity.\n */\n importance?: ActivityImportance | string\n\n /**\n * The delivery mode of the activity.\n */\n deliveryMode?: DeliveryModes | string\n\n /**\n * The list of keywords to listen for in the activity.\n */\n listenFor?: string[]\n\n /**\n * The text highlights in the activity.\n */\n textHighlights?: TextHighlight[]\n\n /**\n * The semantic action associated with the activity.\n */\n semanticAction?: SemanticAction\n\n /**\n * The raw timestamp of the activity.\n */\n rawTimestamp?: string\n\n /**\n * The raw expiration time of the activity.\n */\n rawExpiration?: string\n\n /**\n * The raw local timestamp of the activity.\n */\n rawLocalTimestamp?: string\n\n /**\n * Additional properties of the activity.\n */\n [x: string]: unknown\n\n /**\n * Creates a new Activity instance.\n * @param t The type of the activity.\n * @throws Will throw an error if the activity type is invalid.\n */\n constructor (t: ActivityTypes | string) {\n if (t === undefined) {\n throw ExceptionHelper.generateException(\n Error,\n Errors.InvalidActivityTypeUndefined\n )\n }\n if (t === null) {\n throw ExceptionHelper.generateException(\n Error,\n Errors.InvalidActivityTypeNull\n )\n }\n if ((typeof t === 'string') && (t.length === 0)) {\n throw ExceptionHelper.generateException(\n Error,\n Errors.InvalidActivityTypeEmptyString\n )\n }\n\n this.type = t\n }\n\n /**\n * Creates an Activity instance from a JSON string.\n * @param json The JSON string representing the activity.\n * @returns The created Activity instance.\n */\n static fromJson (json: string): Activity {\n return this.fromObject(JSON.parse(json))\n }\n\n /**\n * Creates an Activity instance from an object.\n * @param o The object representing the activity.\n * @returns The created Activity instance.\n */\n static fromObject (o: object): Activity {\n const parsedActivity = activityZodSchema.passthrough().parse(o)\n const activity = new Activity(parsedActivity.type)\n Object.assign(activity, parsedActivity)\n return activity\n }\n\n /**\n * Return the combined channel:subChannel value like agent:email\n */\n get channelId (): string | undefined {\n return this._channelId?.concat(this.channelIdSubChannel ? `:${this.channelIdSubChannel}` : '')\n }\n\n /**\n * Given a composite channelId like agent:email, return the channel and subChannel.\n * @param value\n * @returns [channel, subChannel]\n */\n static parseChannelId (value: string): [string | undefined, string | undefined] {\n let channel\n let subChannel\n if (value && value.indexOf(':') !== -1) {\n channel = value.substring(0, value.indexOf(':'))\n subChannel = value.substring(value.indexOf(':') + 1)\n } else {\n channel = value\n }\n return [channel, subChannel]\n }\n\n /**\n * Sets the channel ID for the activity - if a subChannel is provided, will create the necessary ProductInfo entity\n * @param value The channel ID value.\n */\n set channelId (value: string) {\n const [channel, subChannel] = Activity.parseChannelId(value)\n\n // if they passed in a value but the channel is blank, this is invalid\n if (value && !channel) {\n throw ExceptionHelper.generateException(\n Error,\n Errors.InvalidChannelIdFormat,\n undefined,\n { channelId: value }\n )\n }\n this._channelId = channel\n if (subChannel) {\n addProductInfoToActivity(this, subChannel)\n } else {\n clearProductInfoFromActivity(this)\n }\n }\n\n /**\n * Sets the primary channel ID for the activity.\n */\n set channelIdChannel (value) {\n this._channelId = value\n }\n\n /**\n * Returns the primary channel ID for the activity.\n */\n get channelIdChannel () {\n return this._channelId\n }\n\n /**\n * Returns the sub-channel ID for the activity.\n */\n get channelIdSubChannel () {\n return this.entities?.find(e => e.type === 'ProductInfo')?.id\n }\n\n /**\n * Sets the sub-channel ID for the activity.\n */\n set channelIdSubChannel (value) {\n if (!this._channelId) {\n throw ExceptionHelper.generateException(\n Error,\n Errors.PrimaryChannelNotSet\n )\n }\n this.channelId = `${this._channelId}${value ? `:${value}` : ''}`\n }\n\n /**\n * Creates a continuation activity from a conversation reference.\n * @param reference The conversation reference.\n * @returns The created continuation activity.\n */\n static getContinuationActivity (reference: ConversationReference): Activity {\n const continuationActivityObj = {\n type: ActivityTypes.Event,\n name: ActivityEventNames.ContinueConversation,\n id: reference.activityId ?? uuid(),\n channelId: reference.channelId,\n locale: reference.locale,\n serviceUrl: reference.serviceUrl,\n conversation: reference.conversation,\n recipient: reference.agent,\n from: reference.user,\n relatesTo: reference\n }\n const continuationActivity: Activity = Activity.fromObject(continuationActivityObj)\n return continuationActivity\n }\n\n /**\n * Gets the appropriate reply-to ID for the activity.\n * @returns The reply-to ID, or undefined if not applicable.\n */\n private getAppropriateReplyToId (): string | undefined {\n if (\n this.type !== ActivityTypes.ConversationUpdate ||\n (this.channelId !== Channels.Directline && this.channelId !== Channels.Webchat)\n ) {\n return this.id\n }\n\n return undefined\n }\n\n /**\n * Gets the conversation reference for the activity.\n * @returns The conversation reference.\n * @throws Will throw an error if required properties are undefined.\n */\n public getConversationReference (): ConversationReference {\n if (this.recipient === null || this.recipient === undefined) {\n throw ExceptionHelper.generateException(\n Error,\n Errors.ActivityRecipientUndefined\n )\n }\n if (this.conversation === null || this.conversation === undefined) {\n throw ExceptionHelper.generateException(\n Error,\n Errors.ActivityConversationUndefined\n )\n }\n if (this.channelId === null || this.channelId === undefined) {\n throw ExceptionHelper.generateException(\n Error,\n Errors.ActivityChannelIdUndefined\n )\n }\n\n return {\n activityId: this.getAppropriateReplyToId(),\n user: this.from,\n agent: this.recipient,\n conversation: this.conversation,\n channelId: this.channelId,\n locale: this.locale,\n serviceUrl: this.serviceUrl\n }\n }\n\n /**\n * Applies a conversation reference to the activity.\n * @param reference The conversation reference.\n * @param isIncoming Whether the activity is incoming.\n * @returns The updated activity.\n */\n public applyConversationReference (\n reference: ConversationReference,\n isIncoming = false\n ): Activity {\n this.channelId = reference.channelId\n this.locale ??= reference.locale\n this.serviceUrl = reference.serviceUrl\n this.conversation = reference.conversation\n if (isIncoming) {\n this.from = reference.user\n this.recipient = reference.agent ?? undefined\n if (reference.activityId) {\n this.id = reference.activityId\n }\n } else {\n this.from = reference.agent ?? undefined\n this.recipient = reference.user\n if (reference.activityId) {\n this.replyToId = reference.activityId\n }\n }\n\n return this\n }\n\n public clone (): Activity {\n const activityCopy = JSON.parse(JSON.stringify(this))\n\n for (const key in activityCopy) {\n if (typeof activityCopy[key] === 'string' && !isNaN(Date.parse(activityCopy[key]))) {\n activityCopy[key] = new Date(activityCopy[key] as string)\n }\n }\n\n Object.setPrototypeOf(activityCopy, Activity.prototype)\n return activityCopy\n }\n\n /**\n * Gets the mentions in the activity.\n * @param activity The activity.\n * @returns The list of mentions.\n */\n public getMentions (activity: Activity): Mention[] {\n const result: Mention[] = []\n if (activity.entities !== undefined) {\n for (let i = 0; i < activity.entities.length; i++) {\n if (activity.entities[i].type.toLowerCase() === 'mention') {\n result.push(activity.entities[i] as unknown as Mention)\n }\n }\n }\n return result\n }\n\n /**\n * Normalizes mentions in the activity by removing mention tags and optionally removing recipient mention.\n * @param removeMention Whether to remove the recipient mention from the activity.\n */\n public normalizeMentions (removeMention: boolean = false): void {\n if (this.type === ActivityTypes.Message) {\n if (removeMention) {\n // Strip recipient mention tags and text\n this.removeRecipientMention()\n\n // Strip entity.mention records for recipient id\n if (this.entities !== undefined && this.recipient?.id) {\n this.entities = this.entities.filter((entity) => {\n if (entity.type.toLowerCase() === 'mention') {\n const mention = entity as unknown as Mention\n return mention.mentioned.id !== this.recipient?.id\n }\n return true\n })\n }\n }\n\n // Remove <at> </at> tags keeping the inner text\n if (this.text) {\n this.text = Activity.removeAt(this.text)\n }\n\n // Remove <at> </at> tags from mention records keeping the inner text\n if (this.entities !== undefined) {\n const mentions = this.getMentions(this)\n for (const mention of mentions) {\n if (mention.text) {\n mention.text = Activity.removeAt(mention.text)?.trim()\n }\n }\n }\n }\n }\n\n /**\n * Removes <at> </at> tags from the specified text.\n * @param text The text to process.\n * @returns The text with <at> </at> tags removed.\n */\n private static removeAt (text: string): string {\n if (!text) {\n return text\n }\n\n let foundTag: boolean\n do {\n foundTag = false\n const iAtStart = text.toLowerCase().indexOf('<at')\n if (iAtStart >= 0) {\n const iAtEnd = text.indexOf('>', iAtStart)\n if (iAtEnd > 0) {\n const iAtClose = text.toLowerCase().indexOf('</at>', iAtEnd)\n if (iAtClose > 0) {\n // Replace </at>\n let followingText = text.substring(iAtClose + 5)\n\n // If first char of followingText is not whitespace, insert space\n if (followingText.length > 0 && !(/\\s/.test(followingText[0]))) {\n followingText = ` ${followingText}`\n }\n\n text = text.substring(0, iAtClose) + followingText\n\n // Get tag content (text between <at...> and </at>)\n const tagContent = text.substring(iAtEnd + 1, iAtClose)\n\n // Replace <at ...> with just the tag content\n let prefixText = text.substring(0, iAtStart)\n\n // If prefixText is not empty and doesn't end with whitespace, add a space\n if (prefixText.length > 0 && !(/\\s$/.test(prefixText))) {\n prefixText += ' '\n }\n\n text = prefixText + tagContent + followingText\n\n // We found one, try again, there may be more\n foundTag = true\n }\n }\n }\n } while (foundTag)\n\n return text\n }\n\n /**\n * Removes the mention text for a given ID.\n * @param id The ID of the mention to remove.\n * @returns The updated text.\n */\n public removeMentionText (id: string): string {\n const mentions = this.getMentions(this)\n const mentionsFiltered = mentions.filter((mention): boolean => mention.mentioned.id === id)\n if ((mentionsFiltered.length > 0) && this.text) {\n this.text = this.text.replace(mentionsFiltered[0].text, '').trim()\n }\n return this.text || ''\n }\n\n /**\n * Removes the recipient mention from the activity text.\n * @returns The updated text.\n */\n public removeRecipientMention (): string {\n if ((this.recipient != null) && this.recipient.id) {\n return this.removeMentionText(this.recipient.id)\n }\n return ''\n }\n\n /**\n * Gets the conversation reference for a reply.\n * @param replyId The ID of the reply.\n * @returns The conversation reference.\n */\n public getReplyConversationReference (\n replyId: string\n ): ConversationReference {\n const reference: ConversationReference = this.getConversationReference()\n\n reference.activityId = replyId\n\n return reference\n }\n\n public toJsonString (): string {\n // Use channelId instead of _channelId when outputting json\n const copy = { ...this } as any\n copy.channelId = copy._channelId\n delete copy._channelId\n return JSON.stringify(copy)\n }\n\n /**\n * Does this activity represent an agentic request?\n * @returns True if agentic\n */\n public isAgenticRequest (): boolean {\n if (!this.recipient || !this.recipient.role) {\n return false\n }\n return this.recipient.role.toLowerCase() === RoleTypes.AgenticUser.toLowerCase() || this.recipient.role.toLowerCase() === RoleTypes.AgenticIdentity.toLowerCase()\n }\n\n /**\n * Retrieves the tenant ID associated with the agentic recipient of the activity, if available; otherwise, returns the tenant ID from the conversation.\n * @returns The tenant ID of the agentic recipient if present; otherwise, the tenant ID from the conversation. Returns undefined if neither is available.\n */\n public getAgenticTenantId (): string | undefined {\n return this.recipient?.tenantId ?? this.conversation?.tenantId\n }\n\n /**\n * Gets the agent instance ID from the context if its agentic\n * @returns agent instance id as string\n */\n public getAgenticInstanceId (): string | undefined {\n if (this.isAgenticRequest()) {\n return this.recipient?.agenticAppId\n }\n return undefined\n }\n\n /**\n * Gets the agentic user (UPN) from the context if it's an agentic request.\n */\n public getAgenticUser (): string | undefined {\n if (this.isAgenticRequest()) {\n return this.recipient?.agenticUserId\n }\n return undefined\n }\n}\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\n\n/**\n * Enum representing treatment types for the activity.\n */\nexport enum ActivityTreatments {\n /**\n * Indicates that only the recipient should be able to see the message even if the activity\n * is being sent to a group of people.\n */\n Targeted = 'targeted',\n}\n\n/**\n * Zod schema for validating an ActivityTreatments enum.\n */\nexport const activityTreatments = z.nativeEnum(ActivityTreatments)\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Export statements for various modules.\n */\nexport { ActionTypes } from './action/actionTypes'\nexport { CardAction } from './action/cardAction'\nexport { SemanticAction } from './action/semanticAction'\nexport { SemanticActionStateTypes } from './action/semanticActionStateTypes'\nexport { SuggestedActions } from './action/suggestedActions'\n\nexport { Attachment } from './attachment/attachment'\nexport { AttachmentLayoutTypes } from './attachment/attachmentLayoutTypes'\n\nexport { ChannelAccount } from './conversation/channelAccount'\nexport { Channels } from './conversation/channels'\nexport { ConversationAccount } from './conversation/conversationAccount'\nexport { ConversationReference } from './conversation/conversationReference'\nexport { EndOfConversationCodes } from './conversation/endOfConversationCodes'\nexport { ConversationParameters } from './conversation/conversationParameters'\nexport { MembershipSource } from './conversation/membershipSource'\nexport { MembershipSourceTypes } from './conversation/membershipSourceTypes'\nexport { MembershipTypes } from './conversation/membershipTypes'\nexport { RoleTypes } from './conversation/roleTypes'\n\nexport { Entity } from './entity/entity'\nexport { Mention } from './entity/mention'\nexport { GeoCoordinates } from './entity/geoCoordinates'\nexport { Place } from './entity/place'\nexport { Thing } from './entity/thing'\nexport * from './entity/AIEntity'\n\nexport * from './invoke/adaptiveCardInvokeAction'\n\nexport { Activity, activityZodSchema } from './activity'\nexport { ActivityEventNames } from './activityEventNames'\nexport { ActivityImportance } from './activityImportance'\nexport { ActivityTypes } from './activityTypes'\nexport { DeliveryModes } from './deliveryModes'\nexport { ExpectedReplies } from './expectedReplies'\nexport { InputHints } from './inputHints'\nexport { MessageReaction } from './messageReaction'\nexport { MessageReactionTypes } from './messageReactionTypes'\nexport { TextFormatTypes } from './textFormatTypes'\nexport { TextHighlight } from './textHighlight'\nexport { ActivityTreatments } from './activityTreatments'\nexport { debug, Logger } from './logger'\n\nexport { AgentErrorDefinition, AgentError, ExceptionHelper } from './exceptionHelper'\nexport { Errors as ActivityErrors } from './errorHelper'\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Enum representing the type of agent.\n */\nexport enum AgentType {\n /**\n * Represents a published agent.\n */\n Published = 'Published',\n /**\n * Represents a prebuilt agent.\n */\n Prebuilt = 'Prebuilt',\n}\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Enum representing different Power Platform cloud environments.\n */\nexport enum PowerPlatformCloud {\n /**\n * Unknown cloud environment.\n */\n Unknown = 'Unknown',\n /**\n * Experimental cloud environment.\n */\n Exp = 'Exp',\n /**\n * Development cloud environment.\n */\n Dev = 'Dev',\n /**\n * Test cloud environment.\n */\n Test = 'Test',\n /**\n * Pre-production cloud environment.\n */\n Preprod = 'Preprod',\n /**\n * First release cloud environment.\n */\n FirstRelease = 'FirstRelease',\n /**\n * Production cloud environment.\n */\n Prod = 'Prod',\n /**\n * Government cloud environment.\n */\n Gov = 'Gov',\n /**\n * High security cloud environment.\n */\n High = 'High',\n /**\n * Department of Defense cloud environment.\n */\n DoD = 'DoD',\n /**\n * Mooncake cloud environment.\n */\n Mooncake = 'Mooncake',\n /**\n * Ex cloud environment.\n */\n Ex = 'Ex',\n /**\n * Rx cloud environment.\n */\n Rx = 'Rx',\n /**\n * Private cloud environment.\n */\n Prv = 'Prv',\n /**\n * Local cloud environment.\n */\n Local = 'Local',\n /**\n * French government cloud environment.\n */\n GovFR = 'GovFR',\n /**\n * Other cloud environment.\n */\n Other = 'Other',\n}\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AgentType } from './agentType'\nimport { CopilotStudioConnectionSettings } from './copilotStudioConnectionSettings'\nimport { PowerPlatformCloud } from './powerPlatformCloud'\n\n/**\n * Configuration options for establishing a connection to Copilot Studio.\n */\nabstract class ConnectionOptions implements Omit<CopilotStudioConnectionSettings, 'cloud' | 'copilotAgentType'> {\n /**\n * The client ID of the application.\n * @deprecated This property will not be supported in future versions. Handle the auth properties in the agent.\n **/\n public appClientId?: string\n /**\n * The tenant ID of the application.\n *@deprecated This property will not be supported in future versions. Handle the auth properties in the agent.\n **/\n public tenantId?: string\n /**\n * The login authority to use for the connection.\n * @deprecated This property will not be supported in future versions. Handle the auth properties in the agent.\n **/\n public authority?: string\n /** The environment ID of the application. */\n public environmentId?: string\n /** The identifier of the agent.\n * @deprecated This property will not be supported in future versions. Use schemaName instead.\n **/\n public agentIdentifier?: string\n /** The identifier of the agent. */\n public schemaName?: string\n /** The cloud environment of the application. */\n public cloud?: PowerPlatformCloud | keyof typeof PowerPlatformCloud\n /** The custom Power Platform cloud URL, if any. */\n public customPowerPlatformCloud?: string\n /** The type of the Copilot agent. */\n public copilotAgentType?: AgentType | keyof typeof AgentType\n /** The URL to connect directly to Copilot Studio endpoint */\n public directConnectUrl?: string\n /** Flag to use the experimental endpoint if available */\n public useExperimentalEndpoint?: boolean = false\n}\n\n/**\n * Represents the settings required to establish a connection to Copilot Studio.\n */\nexport class ConnectionSettings extends ConnectionOptions {\n /** The cloud environment of the application. */\n public cloud?: PowerPlatformCloud\n /** The type of the Copilot agent. */\n public copilotAgentType?: AgentType\n\n /**\n * Default constructor for the ConnectionSettings class.\n */\n constructor ()\n\n /**\n * Creates an instance of ConnectionSettings.\n * @param options Represents the settings required to establish a direct connection to the engine.\n */\n constructor (options: ConnectionOptions)\n\n /**\n * @private\n */\n constructor (options?: ConnectionOptions) {\n super()\n\n if (!options) {\n return\n }\n\n const cloud = options.cloud?.trim() || PowerPlatformCloud.Prod\n const copilotAgentType = options.copilotAgentType?.trim() || AgentType.Published\n const authority = options.authority?.trim() || 'https://login.microsoftonline.com'\n\n if (!Object.values(PowerPlatformCloud).includes(cloud as PowerPlatformCloud)) {\n throw new Error(`Invalid PowerPlatformCloud: '${cloud}'. Supported values: ${Object.values(PowerPlatformCloud).join(', ')}`)\n }\n\n if (!Object.values(AgentType).includes(copilotAgentType as AgentType)) {\n throw new Error(`Invalid AgentType: '${copilotAgentType}'. Supported values: ${Object.values(AgentType).join(', ')}`)\n }\n\n Object.assign(this, { ...options, cloud, copilotAgentType, authority })\n }\n}\n\n/**\n * Loads the connection settings for Copilot Studio from environment variables.\n * @returns The connection settings.\n */\nexport const loadCopilotStudioConnectionSettingsFromEnv: () => ConnectionSettings = () => {\n return new ConnectionSettings({\n appClientId: process.env.appClientId ?? '',\n tenantId: process.env.tenantId ?? '',\n authority: process.env.authorityEndpoint ?? 'https://login.microsoftonline.com',\n environmentId: process.env.environmentId ?? '',\n agentIdentifier: process.env.agentIdentifier ?? '',\n schemaName: process.env.schemaName ?? '',\n cloud: process.env.cloud as PowerPlatformCloud,\n customPowerPlatformCloud: process.env.customPowerPlatformCloud,\n copilotAgentType: process.env.copilotAgentType as AgentType,\n directConnectUrl: process.env.directConnectUrl,\n useExperimentalEndpoint: process.env.useExperimentalEndpoint?.toLowerCase() === 'true'\n })\n}\n", "/**\n * The type of error that occurred.\n * @public\n */\nexport type ErrorType = 'invalid-retry' | 'unknown-field'\n\n/**\n * Error thrown when encountering an issue during parsing.\n *\n * @public\n */\nexport class ParseError extends Error {\n /**\n * The type of error that occurred.\n */\n type: ErrorType\n\n /**\n * In the case of an unknown field encountered in the stream, this will be the field name.\n */\n field?: string | undefined\n\n /**\n * In the case of an unknown field encountered in the stream, this will be the value of the field.\n */\n value?: string | undefined\n\n /**\n * The line that caused the error, if available.\n */\n line?: string | undefined\n\n constructor(\n message: string,\n options: {type: ErrorType; field?: string; value?: string; line?: string},\n ) {\n super(message)\n this.name = 'ParseError'\n this.type = options.type\n this.field = options.field\n this.value = options.value\n this.line = options.line\n }\n}\n", "/**\n * EventSource/Server-Sent Events parser\n * @see https://html.spec.whatwg.org/multipage/server-sent-events.html\n */\nimport {ParseError} from './errors.ts'\nimport type {EventSourceParser, ParserCallbacks} from './types.ts'\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction noop(_arg: unknown) {\n // intentional noop\n}\n\n/**\n * Creates a new EventSource parser.\n *\n * @param callbacks - Callbacks to invoke on different parsing events:\n * - `onEvent` when a new event is parsed\n * - `onError` when an error occurs\n * - `onRetry` when a new reconnection interval has been sent from the server\n * - `onComment` when a comment is encountered in the stream\n *\n * @returns A new EventSource parser, with `parse` and `reset` methods.\n * @public\n */\nexport function createParser(callbacks: ParserCallbacks): EventSourceParser {\n if (typeof callbacks === 'function') {\n throw new TypeError(\n '`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?',\n )\n }\n\n const {onEvent = noop, onError = noop, onRetry = noop, onComment} = callbacks\n\n let incompleteLine = ''\n\n let isFirstChunk = true\n let id: string | undefined\n let data = ''\n let eventType = ''\n\n function feed(newChunk: string) {\n // Strip any UTF8 byte order mark (BOM) at the start of the stream\n const chunk = isFirstChunk ? newChunk.replace(/^\\xEF\\xBB\\xBF/, '') : newChunk\n\n // If there was a previous incomplete line, append it to the new chunk,\n // so we may process it together as a new (hopefully complete) chunk.\n const [complete, incomplete] = splitLines(`${incompleteLine}${chunk}`)\n\n for (const line of complete) {\n parseLine(line)\n }\n\n incompleteLine = incomplete\n isFirstChunk = false\n }\n\n function parseLine(line: string) {\n // If the line is empty (a blank line), dispatch the event\n if (line === '') {\n dispatchEvent()\n return\n }\n\n // If the line starts with a U+003A COLON character (:), ignore the line.\n if (line.startsWith(':')) {\n if (onComment) {\n onComment(line.slice(line.startsWith(': ') ? 2 : 1))\n }\n return\n }\n\n // If the line contains a U+003A COLON character (:)\n const fieldSeparatorIndex = line.indexOf(':')\n if (fieldSeparatorIndex !== -1) {\n // Collect the characters on the line before the first U+003A COLON character (:),\n // and let `field` be that string.\n const field = line.slice(0, fieldSeparatorIndex)\n\n // Collect the characters on the line after the first U+003A COLON character (:),\n // and let `value` be that string. If value starts with a U+0020 SPACE character,\n // remove it from value.\n const offset = line[fieldSeparatorIndex + 1] === ' ' ? 2 : 1\n const value = line.slice(fieldSeparatorIndex + offset)\n\n processField(field, value, line)\n return\n }\n\n // Otherwise, the string is not empty but does not contain a U+003A COLON character (:)\n // Process the field using the whole line as the field name, and an empty string as the field value.\n // 👆 This is according to spec. That means that a line that has the value `data` will result in\n // a newline being added to the current `data` buffer, for instance.\n processField(line, '', line)\n }\n\n function processField(field: string, value: string, line: string) {\n // Field names must be compared literally, with no case folding performed.\n switch (field) {\n case 'event':\n // Set the `event type` buffer to field value\n eventType = value\n break\n case 'data':\n // Append the field value to the `data` buffer, then append a single U+000A LINE FEED(LF)\n // character to the `data` buffer.\n data = `${data}${value}\\n`\n break\n case 'id':\n // If the field value does not contain U+0000 NULL, then set the `ID` buffer to\n // the field value. Otherwise, ignore the field.\n id = value.includes('\\0') ? undefined : value\n break\n case 'retry':\n // If the field value consists of only ASCII digits, then interpret the field value as an\n // integer in base ten, and set the event stream's reconnection time to that integer.\n // Otherwise, ignore the field.\n if (/^\\d+$/.test(value)) {\n onRetry(parseInt(value, 10))\n } else {\n onError(\n new ParseError(`Invalid \\`retry\\` value: \"${value}\"`, {\n type: 'invalid-retry',\n value,\n line,\n }),\n )\n }\n break\n default:\n // Otherwise, the field is ignored.\n onError(\n new ParseError(\n `Unknown field \"${field.length > 20 ? `${field.slice(0, 20)}…` : field}\"`,\n {type: 'unknown-field', field, value, line},\n ),\n )\n break\n }\n }\n\n function dispatchEvent() {\n const shouldDispatch = data.length > 0\n if (shouldDispatch) {\n onEvent({\n id,\n event: eventType || undefined,\n // If the data buffer's last character is a U+000A LINE FEED (LF) character,\n // then remove the last character from the data buffer.\n data: data.endsWith('\\n') ? data.slice(0, -1) : data,\n })\n }\n\n // Reset for the next event\n id = undefined\n data = ''\n eventType = ''\n }\n\n function reset(options: {consume?: boolean} = {}) {\n if (incompleteLine && options.consume) {\n parseLine(incompleteLine)\n }\n\n isFirstChunk = true\n id = undefined\n data = ''\n eventType = ''\n incompleteLine = ''\n }\n\n return {feed, reset}\n}\n\n/**\n * For the given `chunk`, split it into lines according to spec, and return any remaining incomplete line.\n *\n * @param chunk - The chunk to split into lines\n * @returns A tuple containing an array of complete lines, and any remaining incomplete line\n * @internal\n */\nfunction splitLines(chunk: string): [complete: Array<string>, incomplete: string] {\n /**\n * According to the spec, a line is terminated by either:\n * - U+000D CARRIAGE RETURN U+000A LINE FEED (CRLF) character pair\n * - a single U+000A LINE FEED(LF) character not preceded by a U+000D CARRIAGE RETURN(CR) character\n * - a single U+000D CARRIAGE RETURN(CR) character not followed by a U+000A LINE FEED(LF) character\n */\n const lines: Array<string> = []\n let incompleteLine = ''\n let searchIndex = 0\n\n while (searchIndex < chunk.length) {\n // Find next line terminator\n const crIndex = chunk.indexOf('\\r', searchIndex)\n const lfIndex = chunk.indexOf('\\n', searchIndex)\n\n // Determine line end\n let lineEnd = -1\n if (crIndex !== -1 && lfIndex !== -1) {\n // CRLF case\n lineEnd = Math.min(crIndex, lfIndex)\n } else if (crIndex !== -1) {\n // CR at the end of a chunk might be part of a CRLF sequence that spans chunks,\n // so we shouldn't treat it as a line terminator (yet)\n if (crIndex === chunk.length - 1) {\n lineEnd = -1\n } else {\n lineEnd = crIndex\n }\n } else if (lfIndex !== -1) {\n lineEnd = lfIndex\n }\n\n // Extract line if terminator found\n if (lineEnd === -1) {\n // No terminator found, rest is incomplete\n incompleteLine = chunk.slice(searchIndex)\n break\n } else {\n const line = chunk.slice(searchIndex, lineEnd)\n lines.push(line)\n\n // Move past line terminator\n searchIndex = lineEnd + 1\n if (chunk[searchIndex - 1] === '\\r' && chunk[searchIndex] === '\\n') {\n searchIndex++\n }\n }\n }\n\n return [lines, incompleteLine]\n}\n", "// ReadyStates, mirrors WhatWG spec, but uses strings instead of numbers.\n// Why make it harder to read than it needs to be?\n\n/**\n * ReadyState representing a connection that is connecting or has been scheduled to reconnect.\n * @public\n */\nexport const CONNECTING = 'connecting'\n\n/**\n * ReadyState representing a connection that is open, eg connected.\n * @public\n */\nexport const OPEN = 'open'\n\n/**\n * ReadyState representing a connection that has been closed (manually, or due to an error).\n * @public\n */\nexport const CLOSED = 'closed'\n", "import {createParser} from 'eventsource-parser'\n\nimport type {EnvAbstractions, EventSourceAsyncValueResolver} from './abstractions.js'\nimport {CLOSED, CONNECTING, OPEN} from './constants.js'\nimport type {\n EventSourceClient,\n EventSourceMessage,\n EventSourceOptions,\n FetchLike,\n FetchLikeInit,\n FetchLikeResponse,\n ReadyState,\n} from './types.js'\n\n/**\n * Intentional noop function for eased control flow\n */\nconst noop = () => {\n /* intentional noop */\n}\n\n/**\n * Creates a new EventSource client. Used internally by the environment-specific entry points,\n * and should not be used directly by consumers.\n *\n * @param optionsOrUrl - Options for the client, or an URL/URL string.\n * @param abstractions - Abstractions for the environments.\n * @returns A new EventSource client instance\n * @internal\n */\nexport function createEventSource(\n optionsOrUrl: EventSourceOptions | string | URL,\n {getStream}: EnvAbstractions,\n): EventSourceClient {\n const options =\n typeof optionsOrUrl === 'string' || optionsOrUrl instanceof URL\n ? {url: optionsOrUrl}\n : optionsOrUrl\n const {\n onMessage,\n onComment = noop,\n onConnect = noop,\n onDisconnect = noop,\n onScheduleReconnect = noop,\n } = options\n const {fetch, url, initialLastEventId} = validate(options)\n const requestHeaders = {...options.headers} // Prevent post-creation mutations to headers\n\n const onCloseSubscribers: (() => void)[] = []\n const subscribers: ((event: EventSourceMessage) => void)[] = onMessage ? [onMessage] : []\n const emit = (event: EventSourceMessage) => subscribers.forEach((fn) => fn(event))\n const parser = createParser({onEvent, onRetry, onComment})\n\n // Client state\n let request: Promise<unknown> | null\n let currentUrl = url.toString()\n let controller = new AbortController()\n let lastEventId = initialLastEventId\n let reconnectMs = 2000\n let reconnectTimer: ReturnType<typeof setTimeout> | undefined\n let readyState: ReadyState = CLOSED\n\n // Let's go!\n connect()\n\n return {\n close,\n connect,\n [Symbol.iterator]: () => {\n throw new Error(\n 'EventSource does not support synchronous iteration. Use `for await` instead.',\n )\n },\n [Symbol.asyncIterator]: getEventIterator,\n get lastEventId() {\n return lastEventId\n },\n get url() {\n return currentUrl\n },\n get readyState() {\n return readyState\n },\n }\n\n function connect() {\n if (request) {\n return\n }\n\n readyState = CONNECTING\n controller = new AbortController()\n request = fetch(url, getRequestOptions())\n .then(onFetchResponse)\n .catch((err: Error & {type: string}) => {\n request = null\n\n // We expect abort errors when the user manually calls `close()` - ignore those\n if (err.name === 'AbortError' || err.type === 'aborted' || controller.signal.aborted) {\n return\n }\n\n scheduleReconnect()\n })\n }\n\n function close() {\n readyState = CLOSED\n controller.abort()\n parser.reset()\n clearTimeout(reconnectTimer)\n onCloseSubscribers.forEach((fn) => fn())\n }\n\n function getEventIterator(): AsyncGenerator<EventSourceMessage, void> {\n const pullQueue: EventSourceAsyncValueResolver[] = []\n const pushQueue: EventSourceMessage[] = []\n\n function pullValue() {\n return new Promise<IteratorResult<EventSourceMessage, void>>((resolve) => {\n const value = pushQueue.shift()\n if (value) {\n resolve({value, done: false})\n } else {\n pullQueue.push(resolve)\n }\n })\n }\n\n const pushValue = function (value: EventSourceMessage) {\n const resolve = pullQueue.shift()\n if (resolve) {\n resolve({value, done: false})\n } else {\n pushQueue.push(value)\n }\n }\n\n function unsubscribe() {\n subscribers.splice(subscribers.indexOf(pushValue), 1)\n while (pullQueue.shift()) {}\n while (pushQueue.shift()) {}\n }\n\n function onClose() {\n const resolve = pullQueue.shift()\n if (!resolve) {\n return\n }\n\n resolve({done: true, value: undefined})\n unsubscribe()\n }\n\n onCloseSubscribers.push(onClose)\n subscribers.push(pushValue)\n\n return {\n next() {\n return readyState === CLOSED ? this.return() : pullValue()\n },\n return() {\n unsubscribe()\n return Promise.resolve({done: true, value: undefined})\n },\n throw(error) {\n unsubscribe()\n return Promise.reject(error)\n },\n [Symbol.asyncIterator]() {\n return this\n },\n }\n }\n\n function scheduleReconnect() {\n onScheduleReconnect({delay: reconnectMs})\n if (controller.signal.aborted) {\n return\n }\n readyState = CONNECTING\n reconnectTimer = setTimeout(connect, reconnectMs)\n }\n\n async function onFetchResponse(response: FetchLikeResponse) {\n onConnect()\n parser.reset()\n\n const {body, redirected, status} = response\n\n // HTTP 204 means \"close the connection, no more data will be sent\"\n if (status === 204) {\n onDisconnect()\n close()\n return\n }\n\n if (!body) {\n throw new Error('Missing response body')\n }\n\n if (redirected) {\n currentUrl = response.url\n }\n\n // Ensure that the response stream is a web stream\n // @todo Figure out a way to make this work without casting\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const stream = getStream(body as any)\n const decoder = new TextDecoder()\n\n const reader = stream.getReader()\n let open = true\n\n readyState = OPEN\n\n do {\n const {done, value} = await reader.read()\n if (value) {\n parser.feed(decoder.decode(value, {stream: !done}))\n }\n\n if (!done) {\n continue\n }\n\n open = false\n request = null\n parser.reset()\n\n // EventSources never close unless explicitly handled with `.close()`:\n // Implementors should send an `done`/`complete`/`disconnect` event and\n // explicitly handle it in client code, or send an HTTP 204.\n scheduleReconnect()\n\n // Calling scheduleReconnect() prior to onDisconnect() allows consumers to\n // explicitly call .close() before the reconnection is performed.\n onDisconnect()\n } while (open)\n }\n\n function onEvent(msg: EventSourceMessage) {\n if (typeof msg.id === 'string') {\n lastEventId = msg.id\n }\n\n emit(msg)\n }\n\n function onRetry(ms: number) {\n reconnectMs = ms\n }\n\n function getRequestOptions(): FetchLikeInit {\n // @todo allow interception of options, but don't allow overriding signal\n const {mode, credentials, body, method, redirect, referrer, referrerPolicy} = options\n const lastEvent = lastEventId ? {'Last-Event-ID': lastEventId} : undefined\n const headers = {Accept: 'text/event-stream', ...requestHeaders, ...lastEvent}\n return {\n mode,\n credentials,\n body,\n method,\n redirect,\n referrer,\n referrerPolicy,\n headers,\n cache: 'no-store',\n signal: controller.signal,\n }\n }\n}\n\nfunction validate(options: EventSourceOptions): {\n fetch: FetchLike\n url: string | URL\n initialLastEventId: string | undefined\n} {\n const fetch = options.fetch || globalThis.fetch\n if (!isFetchLike(fetch)) {\n throw new Error('No fetch implementation provided, and one was not found on the global object.')\n }\n\n if (typeof AbortController !== 'function') {\n throw new Error('Missing AbortController implementation')\n }\n\n const {url, initialLastEventId} = options\n\n if (typeof url !== 'string' && !(url instanceof URL)) {\n throw new Error('Invalid URL provided - must be string or URL instance')\n }\n\n if (typeof initialLastEventId !== 'string' && initialLastEventId !== undefined) {\n throw new Error('Invalid initialLastEventId provided - must be string or undefined')\n }\n\n return {fetch, url, initialLastEventId}\n}\n\n// This is obviously naive, but hard to probe for full compatibility\nfunction isFetchLike(fetch: FetchLike | typeof globalThis.fetch): fetch is FetchLike {\n return typeof fetch === 'function'\n}\n", "import type {EnvAbstractions} from './abstractions.js'\nimport {createEventSource as createSource} from './client.js'\nimport type {EventSourceClient, EventSourceOptions} from './types.js'\n\nexport * from './constants.js'\nexport * from './types.js'\n\n/**\n * Default \"abstractions\", eg when all the APIs are globally available\n */\nconst defaultAbstractions: EnvAbstractions = {\n getStream,\n}\n\n/**\n * Creates a new EventSource client.\n *\n * @param optionsOrUrl - Options for the client, or an URL/URL string.\n * @returns A new EventSource client instance\n * @public\n */\nexport function createEventSource(\n optionsOrUrl: EventSourceOptions | URL | string,\n): EventSourceClient {\n return createSource(optionsOrUrl, defaultAbstractions)\n}\n\n/**\n * Returns a ReadableStream (Web Stream) from either an existing ReadableStream.\n * Only defined because of environment abstractions - is actually a 1:1 (passthrough).\n *\n * @param body - The body to convert\n * @returns A ReadableStream\n * @private\n */\nfunction getStream(\n body: NodeJS.ReadableStream | ReadableStream<Uint8Array>,\n): ReadableStream<Uint8Array> {\n if (!(body instanceof ReadableStream)) {\n throw new Error('Invalid stream, expected a web ReadableStream')\n }\n\n return body\n}\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AgentType } from './agentType'\nimport { ConnectionSettings } from './connectionSettings'\nimport { debug } from '@microsoft/agents-activity/logger'\nimport { PowerPlatformCloud } from './powerPlatformCloud'\nimport { PrebuiltBotStrategy } from './strategies/prebuiltBotStrategy'\nimport { PublishedBotStrategy } from './strategies/publishedBotStrategy'\n\nconst logger = debug('copilot-studio:power-platform')\n\n/**\n * Generates the connection URL for Copilot Studio.\n * @param settings - The connection settings.\n * @param conversationId - Optional conversation ID.\n * @returns The connection URL.\n * @throws Will throw an error if required settings are missing or invalid.\n */\nexport function getCopilotStudioConnectionUrl (\n settings: ConnectionSettings,\n conversationId?: string\n): string {\n const schemaName = settings.schemaName?.trim() || settings.agentIdentifier?.trim()\n if (!settings.directConnectUrl?.trim() && (!settings.environmentId?.trim() || !schemaName?.trim())) {\n throw new Error('Either directConnectUrl OR both environmentId and schemaName/agentIdentifier must be provided')\n }\n\n if (settings.directConnectUrl?.trim()) {\n logger.debug(`Using direct connection: ${settings.directConnectUrl}`)\n if (!isValidUri(settings.directConnectUrl)) {\n throw new Error('directConnectUrl must be a valid URL')\n }\n\n // FIX for Missing Tenant ID\n if (settings.directConnectUrl.toLowerCase().includes('tenants/00000000-0000-0000-0000-000000000000')) {\n logger.warn(`Direct connection cannot be used, forcing default settings flow. Tenant ID is missing in the URL: ${settings.directConnectUrl}`)\n // Direct connection cannot be used, ejecting and forcing the normal settings flow:\n return getCopilotStudioConnectionUrl({ ...settings, directConnectUrl: '' }, conversationId)\n }\n\n return createURL(settings.directConnectUrl, conversationId).href\n }\n\n const cloudSetting = settings.cloud ?? PowerPlatformCloud.Prod\n const agentType = settings.copilotAgentType ?? AgentType.Published\n\n logger.debug(`Using cloud setting: ${cloudSetting}`)\n logger.debug(`Using agent type: ${agentType}`)\n\n if (cloudSetting === PowerPlatformCloud.Other) {\n if (!settings.customPowerPlatformCloud?.trim()) {\n throw new Error('customPowerPlatformCloud must be provided when PowerPlatformCloud is Other')\n } else if (isValidUri(settings.customPowerPlatformCloud)) {\n logger.debug(`Using custom Power Platform cloud: ${settings.customPowerPlatformCloud}`)\n } else {\n throw new Error(\n 'customPowerPlatformCloud must be a valid URL'\n )\n }\n }\n\n const host = getEnvironmentEndpoint(cloudSetting, settings.environmentId!, settings.customPowerPlatformCloud)\n\n const strategy = {\n [AgentType.Published]: () => new PublishedBotStrategy({\n host,\n schema: schemaName!,\n }),\n [AgentType.Prebuilt]: () => new PrebuiltBotStrategy({\n host,\n schema: schemaName!,\n }),\n }[agentType]()\n\n const url = strategy.getConversationUrl(conversationId)\n logger.debug(`Generated Copilot Studio connection URL: ${url}`)\n return url\n}\n\n/**\n * Returns the Power Platform API Audience.\n * @param settings - Configuration Settings to use.\n * @param cloud - Optional Power Platform Cloud Hosting Agent.\n * @param cloudBaseAddress - Optional Power Platform API endpoint to use if Cloud is configured as \"other\".\n * @param directConnectUrl - Optional DirectConnection URL to a given Copilot Studio agent, if provided all other settings are ignored.\n * @returns The Power Platform Audience.\n * @throws Will throw an error if required settings are missing or invalid.\n */\nexport function getTokenAudience (\n settings?: ConnectionSettings,\n cloud: PowerPlatformCloud = PowerPlatformCloud.Unknown,\n cloudBaseAddress: string = '',\n directConnectUrl: string = ''): string {\n if (!directConnectUrl && !settings?.directConnectUrl) {\n if (cloud === PowerPlatformCloud.Other && !cloudBaseAddress) {\n throw new Error('cloudBaseAddress must be provided when PowerPlatformCloudCategory is Other')\n }\n if (!settings && cloud === PowerPlatformCloud.Unknown) {\n throw new Error('Either settings or cloud must be provided')\n }\n if (settings && settings.cloud && settings.cloud !== PowerPlatformCloud.Unknown) {\n cloud = settings.cloud\n }\n if (cloud === PowerPlatformCloud.Other) {\n if (cloudBaseAddress && isValidUri(cloudBaseAddress)) {\n cloud = PowerPlatformCloud.Other\n } else if (settings?.customPowerPlatformCloud && isValidUri(settings!.customPowerPlatformCloud)) {\n cloud = PowerPlatformCloud.Other\n cloudBaseAddress = settings.customPowerPlatformCloud\n } else {\n throw new Error('Either CustomPowerPlatformCloud or cloudBaseAddress must be provided when PowerPlatformCloudCategory is Other')\n }\n }\n cloudBaseAddress ??= 'api.unknown.powerplatform.com'\n return `https://${getEndpointSuffix(cloud, cloudBaseAddress)}/.default`\n } else {\n if (!directConnectUrl) {\n directConnectUrl = settings?.directConnectUrl ?? ''\n }\n if (directConnectUrl && isValidUri(directConnectUrl)) {\n if (decodeCloudFromURI(new URL(directConnectUrl)) === PowerPlatformCloud.Unknown) {\n const cloudToTest: PowerPlatformCloud = settings?.cloud ?? cloud\n\n if (cloudToTest === PowerPlatformCloud.Other || cloudToTest === PowerPlatformCloud.Unknown) {\n throw new Error('Unable to resolve the PowerPlatform Cloud from DirectConnectUrl. The Token Audience resolver requires a specific PowerPlatformCloudCategory.')\n }\n if ((cloudToTest as PowerPlatformCloud) !== PowerPlatformCloud.Unknown) {\n return `https://${getEndpointSuffix(cloudToTest, '')}/.default`\n } else {\n throw new Error('Unable to resolve the PowerPlatform Cloud from DirectConnectUrl. The Token Audience resolver requires a specific PowerPlatformCloudCategory.')\n }\n }\n return `https://${getEndpointSuffix(decodeCloudFromURI(new URL(directConnectUrl)), '')}/.default`\n } else {\n throw new Error('DirectConnectUrl must be provided when DirectConnectUrl is set')\n }\n }\n}\nfunction isValidUri (uri: string): boolean {\n try {\n const absoluteUrl = uri.startsWith('http') ? uri : `https://${uri}`\n const newUri = new URL(absoluteUrl)\n return !!newUri\n } catch {\n return false\n }\n}\n\nfunction createURL (base: string, conversationId?: string): URL {\n const url = new URL(base)\n\n if (!url.searchParams.has('api-version')) {\n url.searchParams.append('api-version', '2022-03-01-preview')\n }\n\n if (url.pathname.endsWith('/')) {\n url.pathname = url.pathname.slice(0, -1)\n }\n\n if (url.pathname.includes('/conversations')) {\n url.pathname = url.pathname.substring(0, url.pathname.indexOf('/conversations'))\n }\n\n url.pathname = `${url.pathname}/conversations`\n if (conversationId) {\n url.pathname = `${url.pathname}/${conversationId}`\n }\n\n return url\n}\n\nfunction getEnvironmentEndpoint (\n cloud: PowerPlatformCloud,\n environmentId: string,\n cloudBaseAddress?: string\n): URL {\n if (cloud === PowerPlatformCloud.Other && (!cloudBaseAddress || !cloudBaseAddress.trim())) {\n throw new Error('cloudBaseAddress must be provided when PowerPlatformCloud is Other')\n }\n\n cloudBaseAddress = cloudBaseAddress ?? 'api.unknown.powerplatform.com'\n\n const normalizedResourceId = environmentId.toLowerCase().replaceAll('-', '')\n const idSuffixLength = getIdSuffixLength(cloud)\n const hexPrefix = normalizedResourceId.substring(0, normalizedResourceId.length - idSuffixLength)\n const hexSuffix = normalizedResourceId.substring(normalizedResourceId.length - idSuffixLength)\n\n return new URL(`https://${hexPrefix}.${hexSuffix}.environment.${getEndpointSuffix(cloud, cloudBaseAddress)}`)\n}\n\nfunction getEndpointSuffix (\n category: PowerPlatformCloud,\n cloudBaseAddress: string\n): string {\n switch (category) {\n case PowerPlatformCloud.Local:\n return 'api.powerplatform.localhost'\n case PowerPlatformCloud.Exp:\n return 'api.exp.powerplatform.com'\n case PowerPlatformCloud.Dev:\n return 'api.dev.powerplatform.com'\n case PowerPlatformCloud.Prv:\n return 'api.prv.powerplatform.com'\n case PowerPlatformCloud.Test:\n return 'api.test.powerplatform.com'\n case PowerPlatformCloud.Preprod:\n return 'api.preprod.powerplatform.com'\n case PowerPlatformCloud.FirstRelease:\n case PowerPlatformCloud.Prod:\n return 'api.powerplatform.com'\n case PowerPlatformCloud.GovFR:\n return 'api.gov.powerplatform.microsoft.us'\n case PowerPlatformCloud.Gov:\n return 'api.gov.powerplatform.microsoft.us'\n case PowerPlatformCloud.High:\n return 'api.high.powerplatform.microsoft.us'\n case PowerPlatformCloud.DoD:\n return 'api.appsplatform.us'\n case PowerPlatformCloud.Mooncake:\n return 'api.powerplatform.partner.microsoftonline.cn'\n case PowerPlatformCloud.Ex:\n return 'api.powerplatform.eaglex.ic.gov'\n case PowerPlatformCloud.Rx:\n return 'api.powerplatform.microsoft.scloud'\n case PowerPlatformCloud.Other:\n return cloudBaseAddress\n default:\n throw new Error(`Invalid cluster category value: ${category}`)\n }\n}\n\nfunction getIdSuffixLength (cloud: PowerPlatformCloud): number {\n switch (cloud) {\n case PowerPlatformCloud.FirstRelease:\n case PowerPlatformCloud.Prod:\n return 2\n default:\n return 1\n }\n}\n\nfunction decodeCloudFromURI (uri: URL): PowerPlatformCloud {\n const host = uri.host.toLowerCase()\n\n switch (host) {\n case 'api.powerplatform.localhost':\n return PowerPlatformCloud.Local\n case 'api.exp.powerplatform.com':\n return PowerPlatformCloud.Exp\n case 'api.dev.powerplatform.com':\n return PowerPlatformCloud.Dev\n case 'api.prv.powerplatform.com':\n return PowerPlatformCloud.Prv\n case 'api.test.powerplatform.com':\n return PowerPlatformCloud.Test\n case 'api.preprod.powerplatform.com':\n return PowerPlatformCloud.Preprod\n case 'api.powerplatform.com':\n return PowerPlatformCloud.Prod\n case 'api.gov.powerplatform.microsoft.us':\n return PowerPlatformCloud.GovFR\n case 'api.high.powerplatform.microsoft.us':\n return PowerPlatformCloud.High\n case 'api.appsplatform.us':\n return PowerPlatformCloud.DoD\n case 'api.powerplatform.partner.microsoftonline.cn':\n return PowerPlatformCloud.Mooncake\n default:\n return PowerPlatformCloud.Unknown\n }\n}\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { Strategy, StrategySettings } from './strategy'\n\n/** @deprecated This interface will not be supported in future versions. Use StrategySettings instead. */\nexport interface PrebuiltBotStrategySettings {\n readonly host: URL;\n readonly identifier: string;\n}\n\n/**\n * Strategy for constructing PowerPlatform API connection URLs for prebuilt agents.\n */\nexport class PrebuiltBotStrategy implements Strategy {\n private readonly API_VERSION = '2022-03-01-preview'\n private baseURL: URL\n\n /**\n * @deprecated This constructor will not be supported in future versions. Use constructor (settings: StrategySettings).\n */\n constructor (settings: PrebuiltBotStrategySettings)\n constructor (settings: StrategySettings)\n constructor (settings: PrebuiltBotStrategySettings | StrategySettings) {\n const schema = 'schema' in settings ? settings.schema : settings.identifier\n const host = settings.host\n\n this.baseURL = new URL(\n `/copilotstudio/prebuilt/authenticated/bots/${schema}`,\n host\n )\n this.baseURL.searchParams.append('api-version', this.API_VERSION)\n }\n\n public getConversationUrl (conversationId?: string): string {\n const conversationUrl = new URL(this.baseURL.href)\n conversationUrl.pathname = `${conversationUrl.pathname}/conversations`\n\n if (conversationId) {\n conversationUrl.pathname = `${conversationUrl.pathname}/${conversationId}`\n }\n\n return conversationUrl.href\n }\n}\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { Strategy, StrategySettings } from './strategy'\n\n/** @deprecated This interface will not be supported in future versions. Use StrategySettings instead. */\nexport interface PublishedBotStrategySettings {\n readonly host: URL;\n readonly schema: string;\n}\n\n/**\n * Strategy for constructing PowerPlatform API connection URLs for published agents.\n */\nexport class PublishedBotStrategy implements Strategy {\n private readonly API_VERSION = '2022-03-01-preview'\n private baseURL: URL\n\n constructor (settings: PublishedBotStrategySettings)\n constructor (settings: StrategySettings) {\n const { schema, host } = settings\n\n this.baseURL = new URL(\n `/copilotstudio/dataverse-backed/authenticated/bots/${schema}`,\n host\n )\n this.baseURL.searchParams.append('api-version', this.API_VERSION)\n }\n\n public getConversationUrl (conversationId?: string): string {\n const conversationUrl = new URL(this.baseURL.href)\n conversationUrl.pathname = `${conversationUrl.pathname}/conversations`\n\n if (conversationId) {\n conversationUrl.pathname = `${conversationUrl.pathname}/${conversationId}`\n }\n\n return conversationUrl.href\n }\n}\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { createEventSource, EventSourceClient } from 'eventsource-client'\nimport { ConnectionSettings } from './connectionSettings'\nimport { getCopilotStudioConnectionUrl, getTokenAudience } from './powerPlatformEnvironment'\nimport { Activity, ActivityTypes, ConversationAccount } from '@microsoft/agents-activity'\nimport { ExecuteTurnRequest } from './executeTurnRequest'\nimport { debug } from '@microsoft/agents-activity/logger'\nimport { version } from '../package.json'\nimport os from 'os'\n\nconst logger = debug('copilot-studio:client')\n\n/**\n * Client for interacting with Microsoft Copilot Studio services.\n * Provides functionality to start conversations and send messages to Copilot Studio bots.\n */\nexport class CopilotStudioClient {\n /** Header key for conversation ID. */\n private static readonly conversationIdHeaderKey: string = 'x-ms-conversationid'\n /** Island Header key */\n private static readonly islandExperimentalUrlHeaderKey: string = 'x-ms-d2e-experimental'\n\n /** The ID of the current conversation. */\n private conversationId: string = ''\n /** The connection settings for the client. */\n private readonly settings: ConnectionSettings\n /** The authenticaton token. */\n private readonly token: string\n\n /**\n * Returns the scope URL needed to connect to Copilot Studio from the connection settings.\n * This is used for authentication token audience configuration.\n * @param settings Copilot Studio connection settings.\n * @returns The scope URL for token audience.\n */\n static scopeFromSettings: (settings: ConnectionSettings) => string = getTokenAudience\n\n /**\n * Creates an instance of CopilotStudioClient.\n * @param settings The connection settings.\n * @param token The authentication token.\n */\n constructor (settings: ConnectionSettings, token: string) {\n this.settings = settings\n this.token = token\n }\n\n /**\n * Streams activities from the Copilot Studio service using eventsource-client.\n * @param url The connection URL for Copilot Studio.\n * @param body Optional. The request body (for POST).\n * @param method Optional. The HTTP method (default: POST).\n * @returns An async generator yielding the Agent's Activities.\n */\n private async * postRequestAsync (url: string, body?: any, method: string = 'POST'): AsyncGenerator<Activity> {\n logger.debug(`>>> SEND TO ${url}`)\n\n const streamMap = new Map<string, { text: string, sequence: number }[]>()\n\n const eventSource: EventSourceClient = createEventSource({\n url,\n headers: {\n Authorization: `Bearer ${this.token}`,\n 'User-Agent': CopilotStudioClient.getProductInfo(),\n 'Content-Type': 'application/json',\n Accept: 'text/event-stream'\n },\n body: body ? JSON.stringify(body) : undefined,\n method,\n fetch: async (url, init) => {\n const response = await fetch(url, init)\n this.processResponseHeaders(response.headers)\n return response\n }\n })\n\n try {\n for await (const { data, event } of eventSource) {\n if (data && event === 'activity') {\n try {\n const activity = Activity.fromJson(data)\n\n // check to see if this activity is part of the streamed response, in which case we need to accumulate the text\n const streamingEntity = activity.entities?.find(e => e.type === 'streaminfo' && e.streamType === 'streaming')\n switch (activity.type) {\n case ActivityTypes.Message:\n if (!this.conversationId.trim()) { // Did not get it from the header.\n this.conversationId = activity.conversation?.id ?? ''\n logger.debug(`Conversation ID: ${this.conversationId}`)\n }\n yield activity\n break\n case ActivityTypes.Typing:\n logger.debug(`Activity type: ${activity.type}`)\n // Accumulate the text as it comes in from the stream.\n // This also accounts for the \"old style\" of streaming where the stream info is in channelData.\n if (streamingEntity || activity.channelData?.streamType === 'streaming') {\n const text = activity.text ?? ''\n const id = (streamingEntity?.streamId ?? activity.channelData?.streamId)\n const sequence = (streamingEntity?.streamSequence ?? activity.channelData?.streamSequence)\n // Accumulate the text chunks based on stream ID and sequence number.\n if (id && sequence) {\n if (streamMap.has(id)) {\n const existing = streamMap.get(id)!\n existing.push({ text, sequence })\n streamMap.set(id, existing)\n } else {\n streamMap.set(id, [{ text, sequence }])\n }\n activity.text = streamMap.get(id)?.sort((a, b) => a.sequence - b.sequence).map(item => item.text).join('') || ''\n }\n }\n yield activity\n break\n default:\n logger.debug(`Activity type: ${activity.type}`)\n yield activity\n break\n }\n } catch (error) {\n logger.error('Failed to parse activity:', error)\n }\n } else if (event === 'end') {\n logger.debug('Stream complete')\n break\n }\n\n if (eventSource.readyState === 'closed') {\n logger.debug('Connection closed')\n break\n }\n }\n } finally {\n eventSource.close()\n }\n }\n\n /**\n * Appends this package.json version to the User-Agent header.\n * - For browser environments, it includes the user agent of the browser.\n * - For Node.js environments, it includes the Node.js version, platform, architecture, and release.\n * @returns A string containing the product information, including version and user agent.\n */\n private static getProductInfo (): string {\n const versionString = `CopilotStudioClient.agents-sdk-js/${version}`\n let userAgent: string\n\n if (typeof window !== 'undefined' && window.navigator) {\n userAgent = `${versionString} ${navigator.userAgent}`\n } else {\n userAgent = `${versionString} nodejs/${process.version} ${os.platform()}-${os.arch()}/${os.release()}`\n }\n\n logger.debug(`User-Agent: ${userAgent}`)\n return userAgent\n }\n\n private processResponseHeaders (responseHeaders: Headers): void {\n if (this.settings.useExperimentalEndpoint && !this.settings.directConnectUrl?.trim()) {\n const islandExperimentalUrl = responseHeaders?.get(CopilotStudioClient.islandExperimentalUrlHeaderKey)\n if (islandExperimentalUrl) {\n this.settings.directConnectUrl = islandExperimentalUrl\n logger.debug(`Island Experimental URL: ${islandExperimentalUrl}`)\n }\n }\n\n this.conversationId = responseHeaders?.get(CopilotStudioClient.conversationIdHeaderKey) ?? ''\n if (this.conversationId) {\n logger.debug(`Conversation ID: ${this.conversationId}`)\n }\n\n const sanitizedHeaders = new Headers()\n responseHeaders.forEach((value, key) => {\n if (key.toLowerCase() !== 'authorization' && key.toLowerCase() !== CopilotStudioClient.conversationIdHeaderKey.toLowerCase()) {\n sanitizedHeaders.set(key, value)\n }\n })\n logger.debug('Headers received:', sanitizedHeaders)\n }\n\n /**\n * Starts a new conversation with the Copilot Studio service.\n * @param emitStartConversationEvent Whether to emit a start conversation event. Defaults to true.\n * @returns An async generator yielding the Agent's Activities.\n */\n public async * startConversationStreaming (emitStartConversationEvent: boolean = true): AsyncGenerator<Activity> {\n const uriStart: string = getCopilotStudioConnectionUrl(this.settings)\n const body = { emitStartConversationEvent }\n\n logger.info('Starting conversation ...')\n\n yield * this.postRequestAsync(uriStart, body, 'POST')\n }\n\n /**\n * Sends an activity to the Copilot Studio service and retrieves the response activities.\n * @param activity The activity to send.\n * @param conversationId The ID of the conversation. Defaults to the current conversation ID.\n * @returns An async generator yielding the Agent's Activities.\n */\n public async * sendActivityStreaming (activity: Activity, conversationId: string = this.conversationId) : AsyncGenerator<Activity> {\n const localConversationId = activity.conversation?.id ?? conversationId\n const uriExecute = getCopilotStudioConnectionUrl(this.settings, localConversationId)\n const qbody: ExecuteTurnRequest = new ExecuteTurnRequest(activity)\n\n logger.info('Sending activity...', activity)\n yield * this.postRequestAsync(uriExecute, qbody, 'POST')\n }\n\n /**\n * Starts a new conversation with the Copilot Studio service.\n * @param emitStartConversationEvent Whether to emit a start conversation event. Defaults to true.\n * @returns A promise yielding an array of activities.\n * @deprecated Use startConversationStreaming instead.\n */\n public async startConversationAsync (emitStartConversationEvent: boolean = true): Promise<Activity[]> {\n const result: Activity[] = []\n for await (const value of this.startConversationStreaming(emitStartConversationEvent)) {\n result.push(value)\n }\n return result\n }\n\n /**\n * Sends a question to the Copilot Studio service and retrieves the response activities.\n * @param question The question to ask.\n * @param conversationId The ID of the conversation. Defaults to the current conversation ID.\n * @returns A promise yielding an array of activities.\n * @deprecated Use sendActivityStreaming instead.\n */\n public async askQuestionAsync (question: string, conversationId?: string) : Promise<Activity[]> {\n const localConversationId = conversationId?.trim() ? conversationId : this.conversationId\n const conversationAccount: ConversationAccount = {\n id: localConversationId\n }\n const activityObj = {\n type: 'message',\n text: question,\n conversation: conversationAccount\n }\n const activity = Activity.fromObject(activityObj)\n\n const result: Activity[] = []\n for await (const value of this.sendActivityStreaming(activity, conversationId)) {\n result.push(value)\n }\n return result\n }\n\n /**\n * Sends an activity to the Copilot Studio service and retrieves the response activities.\n * @param activity The activity to send.\n * @param conversationId The ID of the conversation. Defaults to the current conversation ID.\n * @returns A promise yielding an array of activities.\n * @deprecated Use sendActivityStreaming instead.\n */\n public async sendActivity (activity: Activity, conversationId: string = this.conversationId) : Promise<Activity[]> {\n const result: Activity[] = []\n for await (const value of this.sendActivityStreaming(activity, conversationId)) {\n result.push(value)\n }\n return result\n }\n}\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Activity } from '@microsoft/agents-activity'\n\n/**\n * Represents a request to execute a turn in a conversation.\n * This class encapsulates the activity to be executed during the turn.\n */\nexport class ExecuteTurnRequest {\n /** The activity to be executed. */\n activity?: Activity\n\n /**\n * Creates an instance of ExecuteTurnRequest.\n * @param activity The activity to be executed.\n */\n constructor (activity?: Activity) {\n this.activity = activity\n }\n}\n", "{\n \"name\": \"@microsoft/agents-copilotstudio-client\",\n \"version\": \"1.3.0-beta.10.gf7fc2bf267\",\n \"homepage\": \"https://github.com/microsoft/Agents-for-js\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/microsoft/Agents-for-js.git\"\n },\n \"author\": {\n \"name\": \"Microsoft\",\n \"email\": \"agentssdk@microsoft.com\",\n \"url\": \"https://aka.ms/Agents\"\n },\n \"description\": \"Microsoft Copilot Studio Client for JavaScript. Copilot Studio Client.\",\n \"keywords\": [\n \"Agents\",\n \"copilotstudio\",\n \"powerplatform\"\n ],\n \"main\": \"dist/src/index.js\",\n \"types\": \"dist/src/index.d.ts\",\n \"browser\": {\n \"os\": \"./src/browser/os.ts\",\n \"crypto\": \"./src/browser/crypto.ts\"\n },\n \"scripts\": {\n \"build:browser\": \"esbuild --platform=browser --target=es2019 --format=esm --bundle --sourcemap --minify --outfile=dist/src/browser.mjs src/index.ts\"\n },\n \"dependencies\": {\n \"@microsoft/agents-activity\": \"1.3.0-beta.10.gf7fc2bf267\",\n \"eventsource-client\": \"^1.2.0\",\n \"rxjs\": \"7.8.2\",\n \"uuid\": \"^11.1.0\"\n },\n \"license\": \"MIT\",\n \"files\": [\n \"README.md\",\n \"dist/src\",\n \"src\",\n \"package.json\"\n ],\n \"exports\": {\n \".\": {\n \"types\": \"./dist/src/index.d.ts\",\n \"import\": {\n \"browser\": \"./dist/src/browser.mjs\",\n \"default\": \"./dist/src/index.js\"\n },\n \"require\": {\n \"default\": \"./dist/src/index.js\"\n }\n },\n \"./package.json\": \"./package.json\"\n },\n \"engines\": {\n \"node\": \">=20.0.0\"\n }\n}", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type * as osTypes from 'os'\n\nexport default {} as typeof osTypes\n", "import validate from './validate.js';\nconst byteToHex = [];\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\nexport function unsafeStringify(arr, offset = 0) {\n return (byteToHex[arr[offset + 0]] +\n byteToHex[arr[offset + 1]] +\n byteToHex[arr[offset + 2]] +\n byteToHex[arr[offset + 3]] +\n '-' +\n byteToHex[arr[offset + 4]] +\n byteToHex[arr[offset + 5]] +\n '-' +\n byteToHex[arr[offset + 6]] +\n byteToHex[arr[offset + 7]] +\n '-' +\n byteToHex[arr[offset + 8]] +\n byteToHex[arr[offset + 9]] +\n '-' +\n byteToHex[arr[offset + 10]] +\n byteToHex[arr[offset + 11]] +\n byteToHex[arr[offset + 12]] +\n byteToHex[arr[offset + 13]] +\n byteToHex[arr[offset + 14]] +\n byteToHex[arr[offset + 15]]).toLowerCase();\n}\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset);\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n return uuid;\n}\nexport default stringify;\n", "let getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n if (!getRandomValues) {\n if (typeof crypto === 'undefined' || !crypto.getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n getRandomValues = crypto.getRandomValues.bind(crypto);\n }\n return getRandomValues(rnds8);\n}\n", "const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default { randomUUID };\n", "import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n options = options || {};\n const rnds = options.random ?? options.rng?.() ?? rng();\n if (rnds.length < 16) {\n throw new Error('Random bytes length must be >= 16');\n }\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n if (buf) {\n offset = offset || 0;\n if (offset < 0 || offset + 16 > buf.length) {\n throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);\n }\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n return buf;\n }\n return unsafeStringify(rnds);\n}\nexport default v4;\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { v4 as uuid } from 'uuid'\n\nimport { Activity, Attachment, ConversationAccount } from '@microsoft/agents-activity'\nimport { Observable, BehaviorSubject, type Subscriber } from 'rxjs'\n\nimport { CopilotStudioClient } from './copilotStudioClient'\nimport { debug } from '@microsoft/agents-activity/logger'\n\nconst logger = debug('copilot-studio:webchat')\n\n/**\n * Configuration settings for the Copilot Studio WebChat connection.\n * These settings control the behavior and appearance of the WebChat interface\n * when connected to the Copilot Studio service.\n */\nexport interface CopilotStudioWebChatSettings {\n /**\n * Whether to show typing indicators in the WebChat when the agent is processing a response.\n * When enabled, users will see a typing indicator while waiting for the agent's reply,\n * providing visual feedback that their message is being processed.\n * @default false\n */\n showTyping?: boolean;\n}\n\n/**\n * Represents a connection interface for integrating Copilot Studio with WebChat.\n *\n * @remarks\n * This interface provides the necessary methods and observables to facilitate\n * bidirectional communication between a WebChat client and the Copilot Studio service.\n *\n * The connection follows the DirectLine protocol pattern, making it compatible with\n * Microsoft Bot Framework WebChat components.\n */\nexport interface CopilotStudioWebChatConnection {\n /**\n * An observable that emits the current connection status as numeric values.\n * This allows WebChat clients to monitor and react to connection state changes.\n *\n * Connection status values:\n * - 0: Disconnected - No active connection to the service\n * - 1: Connecting - Attempting to establish connection\n * - 2: Connected - Successfully connected and ready for communication\n */\n connectionStatus$: BehaviorSubject<number>;\n\n /**\n * An observable stream that emits incoming activities from the Copilot Studio service.\n * Each activity represents a message, card, or other interactive element sent by the agent.\n *\n * All emitted activities include:\n * - A timestamp indicating when the activity was received\n * - A 'webchat:sequence-id' in their channelData for proper message ordering\n * - Standard Bot Framework Activity properties (type, text, attachments, etc.)\n */\n activity$: Observable<Partial<Activity>>;\n\n /**\n * Posts a user activity to the Copilot Studio service and returns an observable\n * that emits the activity ID once the message is successfully sent.\n *\n * The method validates that the activity contains meaningful content and handles\n * the complete message flow including optional typing indicators.\n *\n * @param activity - The user activity to send.\n * @returns An observable that emits the unique activity ID upon successful posting.\n * @throws Error if the activity text is empty or if the connection is not properly initialized.\n */\n postActivity(activity: Activity): Observable<string>;\n\n /**\n * Gracefully terminates the connection to the Copilot Studio service.\n * This method ensures proper cleanup by completing all active observables\n * and releasing associated resources.\n *\n * After calling this method:\n * - The connectionStatus$ observable will be completed\n * - The activity$ observable will stop emitting new activities\n * - No further activities can be posted through this connection\n */\n end(): void;\n}\n\n/**\n * Creates a wrapper that invokes `fn` at most once.\n * On the first call the wrapper invokes `fn(value)` and returns whatever `fn` returns.\n * Subsequent calls do nothing and return `undefined`.\n *\n * @template T - Type of the single argument passed to the wrapped function.\n * @param fn Function to be invoked once.\n * @returns A wrapper function that calls `fn` at most once.\n */\nfunction once<T = void> (fn: (value: T) => Promise<void>): (value: T) => Promise<void> | void {\n let called = false\n\n return value => {\n if (!called) {\n called = true\n\n return fn(value)\n }\n }\n}\n\n/**\n * A utility class that provides WebChat integration capabilities for Copilot Studio services.\n *\n * @remarks\n * This class acts as a bridge between Microsoft Bot Framework WebChat and Copilot Studio,\n * enabling seamless communication through a DirectLine-compatible interface.\n *\n * ## Key Features:\n * - DirectLine protocol compatibility for easy WebChat integration\n * - Real-time bidirectional messaging with Copilot Studio agents\n * - Automatic conversation management and message sequencing\n * - Optional typing indicators for enhanced user experience\n * - Observable-based architecture for reactive programming patterns\n *\n * ## Usage Scenarios:\n * - Embedding Copilot Studio agents in web applications\n * - Creating custom chat interfaces with WebChat components\n * - Building conversational AI experiences with Microsoft's bot ecosystem\n *\n * @example Basic WebChat Integration\n * ```typescript\n * import { CopilotStudioClient } from '@microsoft/agents-copilotstudio-client';\n * import { CopilotStudioWebChat } from '@microsoft/agents-copilotstudio-client';\n *\n * // Initialize the Copilot Studio client\n * const client = new CopilotStudioClient({\n * botId: 'your-bot-id',\n * tenantId: 'your-tenant-id'\n * });\n *\n * // Create a WebChat-compatible connection\n * const directLine = CopilotStudioWebChat.createConnection(client, {\n * showTyping: true\n * });\n *\n * // Integrate with WebChat\n * window.WebChat.renderWebChat({\n * directLine: directLine,\n * // ... other WebChat options\n * }, document.getElementById('webchat'));\n * ```\n *\n * @example Advanced Usage with Connection Monitoring\n * ```typescript\n * const connection = CopilotStudioWebChat.createConnection(client);\n *\n * // Monitor connection status\n * connection.connectionStatus$.subscribe(status => {\n * switch (status) {\n * case 0: console.log('Disconnected'); break;\n * case 1: console.log('Connecting...'); break;\n * case 2: console.log('Connected and ready'); break;\n * }\n * });\n *\n * // Listen for incoming activities\n * connection.activity$.subscribe(activity => {\n * console.log('Received activity:', activity);\n * });\n * ```\n */\nexport class CopilotStudioWebChat {\n /**\n * Creates a DirectLine-compatible connection for integrating Copilot Studio with WebChat.\n *\n\n * @param client - A configured CopilotStudioClient instance that handles the underlying\n * communication with the Copilot Studio service. This client should be\n * properly authenticated and configured with the target bot details.\n *\n * @param settings - Optional configuration settings that control the behavior of the\n * WebChat connection. These settings allow customization of features\n * like typing indicators and other user experience enhancements.\n *\n * @returns A new CopilotStudioWebChatConnection instance that can be passed directly\n * to WebChat's renderWebChat function as the directLine parameter. The\n * connection is immediately ready for use and will automatically manage\n * the conversation lifecycle.\n *\n * @throws Error if the provided client is not properly configured or if there are\n * issues establishing the initial connection to the Copilot Studio service.\n *\n * @remarks\n * This method establishes a real-time communication channel between WebChat and the\n * Copilot Studio service. The returned connection object implements the DirectLine\n * protocol, making it fully compatible with Microsoft Bot Framework WebChat components.\n *\n * ## Connection Lifecycle:\n * 1. **Initialization**: Creates observables for connection status and activity streaming\n * 2. **Conversation Start**: Automatically initiates conversation when first activity is posted\n * 3. **Message Flow**: Handles bidirectional message exchange with proper sequencing\n * 4. **Cleanup**: Provides graceful connection termination\n *\n * ## Message Processing:\n * - User messages are validated and sent to Copilot Studio\n * - Agent responses are received and formatted for WebChat\n * - All activities include timestamps and sequence IDs for proper ordering\n * - Optional typing indicators provide visual feedback during processing\n *\n * @example\n * ```typescript\n * const connection = CopilotStudioWebChat.createConnection(client, {\n * showTyping: true\n * });\n *\n * // Use with WebChat\n * window.WebChat.renderWebChat({\n * directLine: connection\n * }, document.getElementById('webchat'));\n * ```\n */\n static createConnection (\n client: CopilotStudioClient,\n settings?: CopilotStudioWebChatSettings\n ): CopilotStudioWebChatConnection {\n logger.info('--> Creating connection between Copilot Studio and WebChat ...')\n let sequence = 0\n let activitySubscriber: Subscriber<Partial<Activity>> | undefined\n let conversation: ConversationAccount | undefined\n\n const connectionStatus$ = new BehaviorSubject(0)\n const activity$ = createObservable<Partial<Activity>>(async (subscriber) => {\n activitySubscriber = subscriber\n\n const handleAcknowledgementOnce = once(async (): Promise<void> => {\n connectionStatus$.next(2)\n await Promise.resolve() // Webchat requires an extra tick to process the connection status change\n })\n\n logger.debug('--> Connection established.')\n notifyTyping()\n\n if (connectionStatus$.value < 2) {\n for await (const activity of client.startConversationStreaming()) {\n delete activity.replyToId\n if (!conversation && activity.conversation) {\n conversation = activity.conversation\n await handleAcknowledgementOnce()\n }\n\n notifyActivity(activity)\n }\n // If no activities received from bot, we should still acknowledge.\n await handleAcknowledgementOnce()\n }\n })\n\n const notifyActivity = (activity: Partial<Activity>) => {\n const newActivity = {\n ...activity,\n timestamp: new Date().toISOString(),\n channelData: {\n ...activity.channelData,\n 'webchat:sequence-id': sequence,\n },\n }\n sequence++\n logger.debug(`Notify '${newActivity.type}' activity to WebChat:`, newActivity)\n activitySubscriber?.next(newActivity)\n }\n\n const notifyTyping = () => {\n if (!settings?.showTyping) {\n return\n }\n\n const from = conversation\n ? { id: conversation.id, name: conversation.name }\n : { id: 'agent', name: 'Agent' }\n notifyActivity({ type: 'typing', from })\n }\n\n return {\n connectionStatus$,\n activity$,\n postActivity (activity: Activity) {\n logger.info('--> Preparing to send activity to Copilot Studio ...')\n\n if (!activity) {\n throw new Error('Activity cannot be null.')\n }\n\n if (!activitySubscriber) {\n throw new Error('Activity subscriber is not initialized.')\n }\n\n return createObservable<string>(async (subscriber) => {\n try {\n logger.info('--> Sending activity to Copilot Studio ...')\n const newActivity = Activity.fromObject({\n ...activity,\n id: uuid(),\n attachments: await processAttachments(activity)\n })\n\n notifyActivity(newActivity)\n notifyTyping()\n\n // Notify WebChat immediately that the message was sent\n subscriber.next(newActivity.id!)\n\n // Stream the agent's response, but don't block the UI\n for await (const responseActivity of client.sendActivityStreaming(newActivity)) {\n notifyActivity(responseActivity)\n logger.info('<-- Activity received correctly from Copilot Studio.')\n }\n\n subscriber.complete()\n } catch (error) {\n logger.error('Error sending Activity to Copilot Studio:', error)\n subscriber.error(error)\n }\n })\n },\n\n end () {\n logger.info('--> Ending connection between Copilot Studio and WebChat ...')\n connectionStatus$.complete()\n if (activitySubscriber) {\n activitySubscriber.complete()\n activitySubscriber = undefined\n }\n },\n }\n }\n}\n\n/**\n * Processes activity attachments.\n * @param activity The activity to process for attachments.\n * @returns A promise that resolves to the activity with all attachments converted.\n */\nasync function processAttachments (activity: Activity): Promise<Attachment[]> {\n if (activity.type !== 'message' || !activity.attachments?.length) {\n return activity.attachments || []\n }\n\n const attachments: Attachment[] = []\n for (const attachment of activity.attachments) {\n const processed = await processBlobAttachment(attachment)\n attachments.push(processed)\n }\n\n return attachments\n}\n\n/**\n * Processes a blob attachment to convert its content URL to a data URL.\n * @param attachment The attachment to process.\n * @returns A promise that resolves to the processed attachment.\n */\nasync function processBlobAttachment (attachment: Attachment): Promise<Attachment> {\n let newContentUrl = attachment.contentUrl\n if (!newContentUrl?.startsWith('blob:')) {\n return attachment\n }\n\n try {\n const response = await fetch(newContentUrl)\n if (!response.ok) {\n throw new Error(`Failed to fetch blob URL: ${response.status} ${response.statusText}`)\n }\n\n const blob = await response.blob()\n const arrayBuffer = await blob.arrayBuffer()\n const base64 = arrayBufferToBase64(arrayBuffer)\n newContentUrl = `data:${blob.type};base64,${base64}`\n } catch (error) {\n newContentUrl = attachment.contentUrl\n logger.error('Error processing blob attachment:', newContentUrl, error)\n }\n\n return { ...attachment, contentUrl: newContentUrl }\n}\n\n/**\n * Converts an ArrayBuffer to a base64 string.\n * @param buffer The ArrayBuffer to convert.\n * @returns The base64 encoded string.\n */\nfunction arrayBufferToBase64 (buffer: ArrayBuffer): string {\n // Node.js environment\n const BufferClass = typeof globalThis.Buffer === 'function' ? globalThis.Buffer : undefined\n if (BufferClass && typeof BufferClass.from === 'function') {\n return BufferClass.from(buffer).toString('base64')\n }\n\n // Browser environment\n let binary = ''\n for (const byte of new Uint8Array(buffer)) {\n binary += String.fromCharCode(byte)\n }\n return btoa(binary)\n}\n\n/**\n * Creates an RxJS Observable that wraps an asynchronous function execution.\n *\n * @typeParam T - The type of value that the observable will emit\n * @param fn - An asynchronous function that receives a Subscriber and performs\n * the desired async operation. The function should call subscriber.next()\n * with results and subscriber.complete() when finished.\n * @returns A new Observable that executes the provided function and emits its results\n *\n * @remarks\n * This utility function provides a clean way to convert async/await patterns\n * into Observable streams, enabling integration with reactive programming patterns\n * used throughout the WebChat connection implementation.\n *\n * The created Observable handles promise resolution and rejection automatically,\n * converting them to appropriate next/error signals for subscribers.\n *\n * @example\n * ```typescript\n * const dataObservable = createObservable<string>(async (subscriber) => {\n * try {\n * const result = await fetchData();\n * subscriber.next(result);\n * subscriber.complete();\n * } catch (error) {\n * subscriber.error(error);\n * }\n * });\n * ```\n */\nfunction createObservable<T> (fn: (subscriber: Subscriber<T>) => void): Observable<T> {\n return new Observable<T>((subscriber: Subscriber<T>) => {\n Promise.resolve(fn(subscriber)).catch((error) => subscriber.error(error))\n })\n}\n", "/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nvar ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n __rewriteRelativeImportExtension,\n};\n", "/**\n * Returns true if the object is a function.\n * @param value The value to check\n */\nexport function isFunction(value: any): value is (...args: any[]) => any {\n return typeof value === 'function';\n}\n", "/**\n * Used to create Error subclasses until the community moves away from ES5.\n *\n * This is because compiling from TypeScript down to ES5 has issues with subclassing Errors\n * as well as other built-in types: https://github.com/Microsoft/TypeScript/issues/12123\n *\n * @param createImpl A factory function to create the actual constructor implementation. The returned\n * function should be a named function that calls `_super` internally.\n */\nexport function createErrorClass<T>(createImpl: (_super: any) => any): T {\n const _super = (instance: any) => {\n Error.call(instance);\n instance.stack = new Error().stack;\n };\n\n const ctorFunc = createImpl(_super);\n ctorFunc.prototype = Object.create(Error.prototype);\n ctorFunc.prototype.constructor = ctorFunc;\n return ctorFunc;\n}\n", "import { createErrorClass } from './createErrorClass';\n\nexport interface UnsubscriptionError extends Error {\n readonly errors: any[];\n}\n\nexport interface UnsubscriptionErrorCtor {\n /**\n * @deprecated Internal implementation detail. Do not construct error instances.\n * Cannot be tagged as internal: https://github.com/ReactiveX/rxjs/issues/6269\n */\n new (errors: any[]): UnsubscriptionError;\n}\n\n/**\n * An error thrown when one or more errors have occurred during the\n * `unsubscribe` of a {@link Subscription}.\n */\nexport const UnsubscriptionError: UnsubscriptionErrorCtor = createErrorClass(\n (_super) =>\n function UnsubscriptionErrorImpl(this: any, errors: (Error | string)[]) {\n _super(this);\n this.message = errors\n ? `${errors.length} errors occurred during unsubscription:\n${errors.map((err, i) => `${i + 1}) ${err.toString()}`).join('\\n ')}`\n : '';\n this.name = 'UnsubscriptionError';\n this.errors = errors;\n }\n);\n", "/**\n * Removes an item from an array, mutating it.\n * @param arr The array to remove the item from\n * @param item The item to remove\n */\nexport function arrRemove<T>(arr: T[] | undefined | null, item: T) {\n if (arr) {\n const index = arr.indexOf(item);\n 0 <= index && arr.splice(index, 1);\n }\n}\n", "import { isFunction } from './util/isFunction';\nimport { UnsubscriptionError } from './util/UnsubscriptionError';\nimport { SubscriptionLike, TeardownLogic, Unsubscribable } from './types';\nimport { arrRemove } from './util/arrRemove';\n\n/**\n * Represents a disposable resource, such as the execution of an Observable. A\n * Subscription has one important method, `unsubscribe`, that takes no argument\n * and just disposes the resource held by the subscription.\n *\n * Additionally, subscriptions may be grouped together through the `add()`\n * method, which will attach a child Subscription to the current Subscription.\n * When a Subscription is unsubscribed, all its children (and its grandchildren)\n * will be unsubscribed as well.\n */\nexport class Subscription implements SubscriptionLike {\n public static EMPTY = (() => {\n const empty = new Subscription();\n empty.closed = true;\n return empty;\n })();\n\n /**\n * A flag to indicate whether this Subscription has already been unsubscribed.\n */\n public closed = false;\n\n private _parentage: Subscription[] | Subscription | null = null;\n\n /**\n * The list of registered finalizers to execute upon unsubscription. Adding and removing from this\n * list occurs in the {@link #add} and {@link #remove} methods.\n */\n private _finalizers: Exclude<TeardownLogic, void>[] | null = null;\n\n /**\n * @param initialTeardown A function executed first as part of the finalization\n * process that is kicked off when {@link #unsubscribe} is called.\n */\n constructor(private initialTeardown?: () => void) {}\n\n /**\n * Disposes the resources held by the subscription. May, for instance, cancel\n * an ongoing Observable execution or cancel any other type of work that\n * started when the Subscription was created.\n */\n unsubscribe(): void {\n let errors: any[] | undefined;\n\n if (!this.closed) {\n this.closed = true;\n\n // Remove this from it's parents.\n const { _parentage } = this;\n if (_parentage) {\n this._parentage = null;\n if (Array.isArray(_parentage)) {\n for (const parent of _parentage) {\n parent.remove(this);\n }\n } else {\n _parentage.remove(this);\n }\n }\n\n const { initialTeardown: initialFinalizer } = this;\n if (isFunction(initialFinalizer)) {\n try {\n initialFinalizer();\n } catch (e) {\n errors = e instanceof UnsubscriptionError ? e.errors : [e];\n }\n }\n\n const { _finalizers } = this;\n if (_finalizers) {\n this._finalizers = null;\n for (const finalizer of _finalizers) {\n try {\n execFinalizer(finalizer);\n } catch (err) {\n errors = errors ?? [];\n if (err instanceof UnsubscriptionError) {\n errors = [...errors, ...err.errors];\n } else {\n errors.push(err);\n }\n }\n }\n }\n\n if (errors) {\n throw new UnsubscriptionError(errors);\n }\n }\n }\n\n /**\n * Adds a finalizer to this subscription, so that finalization will be unsubscribed/called\n * when this subscription is unsubscribed. If this subscription is already {@link #closed},\n * because it has already been unsubscribed, then whatever finalizer is passed to it\n * will automatically be executed (unless the finalizer itself is also a closed subscription).\n *\n * Closed Subscriptions cannot be added as finalizers to any subscription. Adding a closed\n * subscription to a any subscription will result in no operation. (A noop).\n *\n * Adding a subscription to itself, or adding `null` or `undefined` will not perform any\n * operation at all. (A noop).\n *\n * `Subscription` instances that are added to this instance will automatically remove themselves\n * if they are unsubscribed. Functions and {@link Unsubscribable} objects that you wish to remove\n * will need to be removed manually with {@link #remove}\n *\n * @param teardown The finalization logic to add to this subscription.\n */\n add(teardown: TeardownLogic): void {\n // Only add the finalizer if it's not undefined\n // and don't add a subscription to itself.\n if (teardown && teardown !== this) {\n if (this.closed) {\n // If this subscription is already closed,\n // execute whatever finalizer is handed to it automatically.\n execFinalizer(teardown);\n } else {\n if (teardown instanceof Subscription) {\n // We don't add closed subscriptions, and we don't add the same subscription\n // twice. Subscription unsubscribe is idempotent.\n if (teardown.closed || teardown._hasParent(this)) {\n return;\n }\n teardown._addParent(this);\n }\n (this._finalizers = this._finalizers ?? []).push(teardown);\n }\n }\n }\n\n /**\n * Checks to see if a this subscription already has a particular parent.\n * This will signal that this subscription has already been added to the parent in question.\n * @param parent the parent to check for\n */\n private _hasParent(parent: Subscription) {\n const { _parentage } = this;\n return _parentage === parent || (Array.isArray(_parentage) && _parentage.includes(parent));\n }\n\n /**\n * Adds a parent to this subscription so it can be removed from the parent if it\n * unsubscribes on it's own.\n *\n * NOTE: THIS ASSUMES THAT {@link _hasParent} HAS ALREADY BEEN CHECKED.\n * @param parent The parent subscription to add\n */\n private _addParent(parent: Subscription) {\n const { _parentage } = this;\n this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;\n }\n\n /**\n * Called on a child when it is removed via {@link #remove}.\n * @param parent The parent to remove\n */\n private _removeParent(parent: Subscription) {\n const { _parentage } = this;\n if (_parentage === parent) {\n this._parentage = null;\n } else if (Array.isArray(_parentage)) {\n arrRemove(_parentage, parent);\n }\n }\n\n /**\n * Removes a finalizer from this subscription that was previously added with the {@link #add} method.\n *\n * Note that `Subscription` instances, when unsubscribed, will automatically remove themselves\n * from every other `Subscription` they have been added to. This means that using the `remove` method\n * is not a common thing and should be used thoughtfully.\n *\n * If you add the same finalizer instance of a function or an unsubscribable object to a `Subscription` instance\n * more than once, you will need to call `remove` the same number of times to remove all instances.\n *\n * All finalizer instances are removed to free up memory upon unsubscription.\n *\n * @param teardown The finalizer to remove from this subscription\n */\n remove(teardown: Exclude<TeardownLogic, void>): void {\n const { _finalizers } = this;\n _finalizers && arrRemove(_finalizers, teardown);\n\n if (teardown instanceof Subscription) {\n teardown._removeParent(this);\n }\n }\n}\n\nexport const EMPTY_SUBSCRIPTION = Subscription.EMPTY;\n\nexport function isSubscription(value: any): value is Subscription {\n return (\n value instanceof Subscription ||\n (value && 'closed' in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe))\n );\n}\n\nfunction execFinalizer(finalizer: Unsubscribable | (() => void)) {\n if (isFunction(finalizer)) {\n finalizer();\n } else {\n finalizer.unsubscribe();\n }\n}\n", "import { Subscriber } from './Subscriber';\nimport { ObservableNotification } from './types';\n\n/**\n * The {@link GlobalConfig} object for RxJS. It is used to configure things\n * like how to react on unhandled errors.\n */\nexport const config: GlobalConfig = {\n onUnhandledError: null,\n onStoppedNotification: null,\n Promise: undefined,\n useDeprecatedSynchronousErrorHandling: false,\n useDeprecatedNextContext: false,\n};\n\n/**\n * The global configuration object for RxJS, used to configure things\n * like how to react on unhandled errors. Accessible via {@link config}\n * object.\n */\nexport interface GlobalConfig {\n /**\n * A registration point for unhandled errors from RxJS. These are errors that\n * cannot were not handled by consuming code in the usual subscription path. For\n * example, if you have this configured, and you subscribe to an observable without\n * providing an error handler, errors from that subscription will end up here. This\n * will _always_ be called asynchronously on another job in the runtime. This is because\n * we do not want errors thrown in this user-configured handler to interfere with the\n * behavior of the library.\n */\n onUnhandledError: ((err: any) => void) | null;\n\n /**\n * A registration point for notifications that cannot be sent to subscribers because they\n * have completed, errored or have been explicitly unsubscribed. By default, next, complete\n * and error notifications sent to stopped subscribers are noops. However, sometimes callers\n * might want a different behavior. For example, with sources that attempt to report errors\n * to stopped subscribers, a caller can configure RxJS to throw an unhandled error instead.\n * This will _always_ be called asynchronously on another job in the runtime. This is because\n * we do not want errors thrown in this user-configured handler to interfere with the\n * behavior of the library.\n */\n onStoppedNotification: ((notification: ObservableNotification<any>, subscriber: Subscriber<any>) => void) | null;\n\n /**\n * The promise constructor used by default for {@link Observable#toPromise toPromise} and {@link Observable#forEach forEach}\n * methods.\n *\n * @deprecated As of version 8, RxJS will no longer support this sort of injection of a\n * Promise constructor. If you need a Promise implementation other than native promises,\n * please polyfill/patch Promise as you see appropriate. Will be removed in v8.\n */\n Promise?: PromiseConstructorLike;\n\n /**\n * If true, turns on synchronous error rethrowing, which is a deprecated behavior\n * in v6 and higher. This behavior enables bad patterns like wrapping a subscribe\n * call in a try/catch block. It also enables producer interference, a nasty bug\n * where a multicast can be broken for all observers by a downstream consumer with\n * an unhandled error. DO NOT USE THIS FLAG UNLESS IT'S NEEDED TO BUY TIME\n * FOR MIGRATION REASONS.\n *\n * @deprecated As of version 8, RxJS will no longer support synchronous throwing\n * of unhandled errors. All errors will be thrown on a separate call stack to prevent bad\n * behaviors described above. Will be removed in v8.\n */\n useDeprecatedSynchronousErrorHandling: boolean;\n\n /**\n * If true, enables an as-of-yet undocumented feature from v5: The ability to access\n * `unsubscribe()` via `this` context in `next` functions created in observers passed\n * to `subscribe`.\n *\n * This is being removed because the performance was severely problematic, and it could also cause\n * issues when types other than POJOs are passed to subscribe as subscribers, as they will likely have\n * their `this` context overwritten.\n *\n * @deprecated As of version 8, RxJS will no longer support altering the\n * context of next functions provided as part of an observer to Subscribe. Instead,\n * you will have access to a subscription or a signal or token that will allow you to do things like\n * unsubscribe and test closed status. Will be removed in v8.\n */\n useDeprecatedNextContext: boolean;\n}\n", "import type { TimerHandle } from './timerHandle';\ntype SetTimeoutFunction = (handler: () => void, timeout?: number, ...args: any[]) => TimerHandle;\ntype ClearTimeoutFunction = (handle: TimerHandle) => void;\n\ninterface TimeoutProvider {\n setTimeout: SetTimeoutFunction;\n clearTimeout: ClearTimeoutFunction;\n delegate:\n | {\n setTimeout: SetTimeoutFunction;\n clearTimeout: ClearTimeoutFunction;\n }\n | undefined;\n}\n\nexport const timeoutProvider: TimeoutProvider = {\n // When accessing the delegate, use the variable rather than `this` so that\n // the functions can be called without being bound to the provider.\n setTimeout(handler: () => void, timeout?: number, ...args) {\n const { delegate } = timeoutProvider;\n if (delegate?.setTimeout) {\n return delegate.setTimeout(handler, timeout, ...args);\n }\n return setTimeout(handler, timeout, ...args);\n },\n clearTimeout(handle) {\n const { delegate } = timeoutProvider;\n return (delegate?.clearTimeout || clearTimeout)(handle as any);\n },\n delegate: undefined,\n};\n", "import { config } from '../config';\nimport { timeoutProvider } from '../scheduler/timeoutProvider';\n\n/**\n * Handles an error on another job either with the user-configured {@link onUnhandledError},\n * or by throwing it on that new job so it can be picked up by `window.onerror`, `process.on('error')`, etc.\n *\n * This should be called whenever there is an error that is out-of-band with the subscription\n * or when an error hits a terminal boundary of the subscription and no error handler was provided.\n *\n * @param err the error to report\n */\nexport function reportUnhandledError(err: any) {\n timeoutProvider.setTimeout(() => {\n const { onUnhandledError } = config;\n if (onUnhandledError) {\n // Execute the user-configured error handler.\n onUnhandledError(err);\n } else {\n // Throw so it is picked up by the runtime's uncaught error mechanism.\n throw err;\n }\n });\n}\n", "/* tslint:disable:no-empty */\nexport function noop() { }\n", "import { CompleteNotification, NextNotification, ErrorNotification } from './types';\n\n/**\n * A completion object optimized for memory use and created to be the\n * same \"shape\" as other notifications in v8.\n * @internal\n */\nexport const COMPLETE_NOTIFICATION = (() => createNotification('C', undefined, undefined) as CompleteNotification)();\n\n/**\n * Internal use only. Creates an optimized error notification that is the same \"shape\"\n * as other notifications.\n * @internal\n */\nexport function errorNotification(error: any): ErrorNotification {\n return createNotification('E', undefined, error) as any;\n}\n\n/**\n * Internal use only. Creates an optimized next notification that is the same \"shape\"\n * as other notifications.\n * @internal\n */\nexport function nextNotification<T>(value: T) {\n return createNotification('N', value, undefined) as NextNotification<T>;\n}\n\n/**\n * Ensures that all notifications created internally have the same \"shape\" in v8.\n *\n * TODO: This is only exported to support a crazy legacy test in `groupBy`.\n * @internal\n */\nexport function createNotification(kind: 'N' | 'E' | 'C', value: any, error: any) {\n return {\n kind,\n value,\n error,\n };\n}\n", "import { config } from '../config';\n\nlet context: { errorThrown: boolean; error: any } | null = null;\n\n/**\n * Handles dealing with errors for super-gross mode. Creates a context, in which\n * any synchronously thrown errors will be passed to {@link captureError}. Which\n * will record the error such that it will be rethrown after the call back is complete.\n * TODO: Remove in v8\n * @param cb An immediately executed function.\n */\nexport function errorContext(cb: () => void) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n const isRoot = !context;\n if (isRoot) {\n context = { errorThrown: false, error: null };\n }\n cb();\n if (isRoot) {\n const { errorThrown, error } = context!;\n context = null;\n if (errorThrown) {\n throw error;\n }\n }\n } else {\n // This is the general non-deprecated path for everyone that\n // isn't crazy enough to use super-gross mode (useDeprecatedSynchronousErrorHandling)\n cb();\n }\n}\n\n/**\n * Captures errors only in super-gross mode.\n * @param err the error to capture\n */\nexport function captureError(err: any) {\n if (config.useDeprecatedSynchronousErrorHandling && context) {\n context.errorThrown = true;\n context.error = err;\n }\n}\n", "import { isFunction } from './util/isFunction';\nimport { Observer, ObservableNotification } from './types';\nimport { isSubscription, Subscription } from './Subscription';\nimport { config } from './config';\nimport { reportUnhandledError } from './util/reportUnhandledError';\nimport { noop } from './util/noop';\nimport { nextNotification, errorNotification, COMPLETE_NOTIFICATION } from './NotificationFactories';\nimport { timeoutProvider } from './scheduler/timeoutProvider';\nimport { captureError } from './util/errorContext';\n\n/**\n * Implements the {@link Observer} interface and extends the\n * {@link Subscription} class. While the {@link Observer} is the public API for\n * consuming the values of an {@link Observable}, all Observers get converted to\n * a Subscriber, in order to provide Subscription-like capabilities such as\n * `unsubscribe`. Subscriber is a common type in RxJS, and crucial for\n * implementing operators, but it is rarely used as a public API.\n */\nexport class Subscriber<T> extends Subscription implements Observer<T> {\n /**\n * A static factory for a Subscriber, given a (potentially partial) definition\n * of an Observer.\n * @param next The `next` callback of an Observer.\n * @param error The `error` callback of an\n * Observer.\n * @param complete The `complete` callback of an\n * Observer.\n * @return A Subscriber wrapping the (partially defined)\n * Observer represented by the given arguments.\n * @deprecated Do not use. Will be removed in v8. There is no replacement for this\n * method, and there is no reason to be creating instances of `Subscriber` directly.\n * If you have a specific use case, please file an issue.\n */\n static create<T>(next?: (x?: T) => void, error?: (e?: any) => void, complete?: () => void): Subscriber<T> {\n return new SafeSubscriber(next, error, complete);\n }\n\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n protected isStopped: boolean = false;\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n protected destination: Subscriber<any> | Observer<any>; // this `any` is the escape hatch to erase extra type param (e.g. R)\n\n /**\n * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.\n * There is no reason to directly create an instance of Subscriber. This type is exported for typings reasons.\n */\n constructor(destination?: Subscriber<any> | Observer<any>) {\n super();\n if (destination) {\n this.destination = destination;\n // Automatically chain subscriptions together here.\n // if destination is a Subscription, then it is a Subscriber.\n if (isSubscription(destination)) {\n destination.add(this);\n }\n } else {\n this.destination = EMPTY_OBSERVER;\n }\n }\n\n /**\n * The {@link Observer} callback to receive notifications of type `next` from\n * the Observable, with a value. The Observable may call this method 0 or more\n * times.\n * @param value The `next` value.\n */\n next(value: T): void {\n if (this.isStopped) {\n handleStoppedNotification(nextNotification(value), this);\n } else {\n this._next(value!);\n }\n }\n\n /**\n * The {@link Observer} callback to receive notifications of type `error` from\n * the Observable, with an attached `Error`. Notifies the Observer that\n * the Observable has experienced an error condition.\n * @param err The `error` exception.\n */\n error(err?: any): void {\n if (this.isStopped) {\n handleStoppedNotification(errorNotification(err), this);\n } else {\n this.isStopped = true;\n this._error(err);\n }\n }\n\n /**\n * The {@link Observer} callback to receive a valueless notification of type\n * `complete` from the Observable. Notifies the Observer that the Observable\n * has finished sending push-based notifications.\n */\n complete(): void {\n if (this.isStopped) {\n handleStoppedNotification(COMPLETE_NOTIFICATION, this);\n } else {\n this.isStopped = true;\n this._complete();\n }\n }\n\n unsubscribe(): void {\n if (!this.closed) {\n this.isStopped = true;\n super.unsubscribe();\n this.destination = null!;\n }\n }\n\n protected _next(value: T): void {\n this.destination.next(value);\n }\n\n protected _error(err: any): void {\n try {\n this.destination.error(err);\n } finally {\n this.unsubscribe();\n }\n }\n\n protected _complete(): void {\n try {\n this.destination.complete();\n } finally {\n this.unsubscribe();\n }\n }\n}\n\n/**\n * This bind is captured here because we want to be able to have\n * compatibility with monoid libraries that tend to use a method named\n * `bind`. In particular, a library called Monio requires this.\n */\nconst _bind = Function.prototype.bind;\n\nfunction bind<Fn extends (...args: any[]) => any>(fn: Fn, thisArg: any): Fn {\n return _bind.call(fn, thisArg);\n}\n\n/**\n * Internal optimization only, DO NOT EXPOSE.\n * @internal\n */\nclass ConsumerObserver<T> implements Observer<T> {\n constructor(private partialObserver: Partial<Observer<T>>) {}\n\n next(value: T): void {\n const { partialObserver } = this;\n if (partialObserver.next) {\n try {\n partialObserver.next(value);\n } catch (error) {\n handleUnhandledError(error);\n }\n }\n }\n\n error(err: any): void {\n const { partialObserver } = this;\n if (partialObserver.error) {\n try {\n partialObserver.error(err);\n } catch (error) {\n handleUnhandledError(error);\n }\n } else {\n handleUnhandledError(err);\n }\n }\n\n complete(): void {\n const { partialObserver } = this;\n if (partialObserver.complete) {\n try {\n partialObserver.complete();\n } catch (error) {\n handleUnhandledError(error);\n }\n }\n }\n}\n\nexport class SafeSubscriber<T> extends Subscriber<T> {\n constructor(\n observerOrNext?: Partial<Observer<T>> | ((value: T) => void) | null,\n error?: ((e?: any) => void) | null,\n complete?: (() => void) | null\n ) {\n super();\n\n let partialObserver: Partial<Observer<T>>;\n if (isFunction(observerOrNext) || !observerOrNext) {\n // The first argument is a function, not an observer. The next\n // two arguments *could* be observers, or they could be empty.\n partialObserver = {\n next: (observerOrNext ?? undefined) as ((value: T) => void) | undefined,\n error: error ?? undefined,\n complete: complete ?? undefined,\n };\n } else {\n // The first argument is a partial observer.\n let context: any;\n if (this && config.useDeprecatedNextContext) {\n // This is a deprecated path that made `this.unsubscribe()` available in\n // next handler functions passed to subscribe. This only exists behind a flag\n // now, as it is *very* slow.\n context = Object.create(observerOrNext);\n context.unsubscribe = () => this.unsubscribe();\n partialObserver = {\n next: observerOrNext.next && bind(observerOrNext.next, context),\n error: observerOrNext.error && bind(observerOrNext.error, context),\n complete: observerOrNext.complete && bind(observerOrNext.complete, context),\n };\n } else {\n // The \"normal\" path. Just use the partial observer directly.\n partialObserver = observerOrNext;\n }\n }\n\n // Wrap the partial observer to ensure it's a full observer, and\n // make sure proper error handling is accounted for.\n this.destination = new ConsumerObserver(partialObserver);\n }\n}\n\nfunction handleUnhandledError(error: any) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n captureError(error);\n } else {\n // Ideal path, we report this as an unhandled error,\n // which is thrown on a new call stack.\n reportUnhandledError(error);\n }\n}\n\n/**\n * An error handler used when no error handler was supplied\n * to the SafeSubscriber -- meaning no error handler was supplied\n * do the `subscribe` call on our observable.\n * @param err The error to handle\n */\nfunction defaultErrorHandler(err: any) {\n throw err;\n}\n\n/**\n * A handler for notifications that cannot be sent to a stopped subscriber.\n * @param notification The notification being sent.\n * @param subscriber The stopped subscriber.\n */\nfunction handleStoppedNotification(notification: ObservableNotification<any>, subscriber: Subscriber<any>) {\n const { onStoppedNotification } = config;\n onStoppedNotification && timeoutProvider.setTimeout(() => onStoppedNotification(notification, subscriber));\n}\n\n/**\n * The observer used as a stub for subscriptions where the user did not\n * pass any arguments to `subscribe`. Comes with the default error handling\n * behavior.\n */\nexport const EMPTY_OBSERVER: Readonly<Observer<any>> & { closed: true } = {\n closed: true,\n next: noop,\n error: defaultErrorHandler,\n complete: noop,\n};\n", "/**\n * Symbol.observable or a string \"@@observable\". Used for interop\n *\n * @deprecated We will no longer be exporting this symbol in upcoming versions of RxJS.\n * Instead polyfill and use Symbol.observable directly *or* use https://www.npmjs.com/package/symbol-observable\n */\nexport const observable: string | symbol = (() => (typeof Symbol === 'function' && Symbol.observable) || '@@observable')();\n", "/**\n * This function takes one parameter and just returns it. Simply put,\n * this is like `<T>(x: T): T => x`.\n *\n * ## Examples\n *\n * This is useful in some cases when using things like `mergeMap`\n *\n * ```ts\n * import { interval, take, map, range, mergeMap, identity } from 'rxjs';\n *\n * const source$ = interval(1000).pipe(take(5));\n *\n * const result$ = source$.pipe(\n * map(i => range(i)),\n * mergeMap(identity) // same as mergeMap(x => x)\n * );\n *\n * result$.subscribe({\n * next: console.log\n * });\n * ```\n *\n * Or when you want to selectively apply an operator\n *\n * ```ts\n * import { interval, take, identity } from 'rxjs';\n *\n * const shouldLimit = () => Math.random() < 0.5;\n *\n * const source$ = interval(1000);\n *\n * const result$ = source$.pipe(shouldLimit() ? take(5) : identity);\n *\n * result$.subscribe({\n * next: console.log\n * });\n * ```\n *\n * @param x Any value that is returned by this function\n * @returns The value passed as the first parameter to this function\n */\nexport function identity<T>(x: T): T {\n return x;\n}\n", "import { identity } from './identity';\nimport { UnaryFunction } from '../types';\n\nexport function pipe(): typeof identity;\nexport function pipe<T, A>(fn1: UnaryFunction<T, A>): UnaryFunction<T, A>;\nexport function pipe<T, A, B>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>): UnaryFunction<T, B>;\nexport function pipe<T, A, B, C>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>, fn3: UnaryFunction<B, C>): UnaryFunction<T, C>;\nexport function pipe<T, A, B, C, D>(\n fn1: UnaryFunction<T, A>,\n fn2: UnaryFunction<A, B>,\n fn3: UnaryFunction<B, C>,\n fn4: UnaryFunction<C, D>\n): UnaryFunction<T, D>;\nexport function pipe<T, A, B, C, D, E>(\n fn1: UnaryFunction<T, A>,\n fn2: UnaryFunction<A, B>,\n fn3: UnaryFunction<B, C>,\n fn4: UnaryFunction<C, D>,\n fn5: UnaryFunction<D, E>\n): UnaryFunction<T, E>;\nexport function pipe<T, A, B, C, D, E, F>(\n fn1: UnaryFunction<T, A>,\n fn2: UnaryFunction<A, B>,\n fn3: UnaryFunction<B, C>,\n fn4: UnaryFunction<C, D>,\n fn5: UnaryFunction<D, E>,\n fn6: UnaryFunction<E, F>\n): UnaryFunction<T, F>;\nexport function pipe<T, A, B, C, D, E, F, G>(\n fn1: UnaryFunction<T, A>,\n fn2: UnaryFunction<A, B>,\n fn3: UnaryFunction<B, C>,\n fn4: UnaryFunction<C, D>,\n fn5: UnaryFunction<D, E>,\n fn6: UnaryFunction<E, F>,\n fn7: UnaryFunction<F, G>\n): UnaryFunction<T, G>;\nexport function pipe<T, A, B, C, D, E, F, G, H>(\n fn1: UnaryFunction<T, A>,\n fn2: UnaryFunction<A, B>,\n fn3: UnaryFunction<B, C>,\n fn4: UnaryFunction<C, D>,\n fn5: UnaryFunction<D, E>,\n fn6: UnaryFunction<E, F>,\n fn7: UnaryFunction<F, G>,\n fn8: UnaryFunction<G, H>\n): UnaryFunction<T, H>;\nexport function pipe<T, A, B, C, D, E, F, G, H, I>(\n fn1: UnaryFunction<T, A>,\n fn2: UnaryFunction<A, B>,\n fn3: UnaryFunction<B, C>,\n fn4: UnaryFunction<C, D>,\n fn5: UnaryFunction<D, E>,\n fn6: UnaryFunction<E, F>,\n fn7: UnaryFunction<F, G>,\n fn8: UnaryFunction<G, H>,\n fn9: UnaryFunction<H, I>\n): UnaryFunction<T, I>;\nexport function pipe<T, A, B, C, D, E, F, G, H, I>(\n fn1: UnaryFunction<T, A>,\n fn2: UnaryFunction<A, B>,\n fn3: UnaryFunction<B, C>,\n fn4: UnaryFunction<C, D>,\n fn5: UnaryFunction<D, E>,\n fn6: UnaryFunction<E, F>,\n fn7: UnaryFunction<F, G>,\n fn8: UnaryFunction<G, H>,\n fn9: UnaryFunction<H, I>,\n ...fns: UnaryFunction<any, any>[]\n): UnaryFunction<T, unknown>;\n\n/**\n * pipe() can be called on one or more functions, each of which can take one argument (\"UnaryFunction\")\n * and uses it to return a value.\n * It returns a function that takes one argument, passes it to the first UnaryFunction, and then\n * passes the result to the next one, passes that result to the next one, and so on. \n */\nexport function pipe(...fns: Array<UnaryFunction<any, any>>): UnaryFunction<any, any> {\n return pipeFromArray(fns);\n}\n\n/** @internal */\nexport function pipeFromArray<T, R>(fns: Array<UnaryFunction<T, R>>): UnaryFunction<T, R> {\n if (fns.length === 0) {\n return identity as UnaryFunction<any, any>;\n }\n\n if (fns.length === 1) {\n return fns[0];\n }\n\n return function piped(input: T): R {\n return fns.reduce((prev: any, fn: UnaryFunction<T, R>) => fn(prev), input as any);\n };\n}\n", "import { Operator } from './Operator';\nimport { SafeSubscriber, Subscriber } from './Subscriber';\nimport { isSubscription, Subscription } from './Subscription';\nimport { TeardownLogic, OperatorFunction, Subscribable, Observer } from './types';\nimport { observable as Symbol_observable } from './symbol/observable';\nimport { pipeFromArray } from './util/pipe';\nimport { config } from './config';\nimport { isFunction } from './util/isFunction';\nimport { errorContext } from './util/errorContext';\n\n/**\n * A representation of any set of values over any amount of time. This is the most basic building block\n * of RxJS.\n */\nexport class Observable<T> implements Subscribable<T> {\n /**\n * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.\n */\n source: Observable<any> | undefined;\n\n /**\n * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.\n */\n operator: Operator<any, T> | undefined;\n\n /**\n * @param subscribe The function that is called when the Observable is\n * initially subscribed to. This function is given a Subscriber, to which new values\n * can be `next`ed, or an `error` method can be called to raise an error, or\n * `complete` can be called to notify of a successful completion.\n */\n constructor(subscribe?: (this: Observable<T>, subscriber: Subscriber<T>) => TeardownLogic) {\n if (subscribe) {\n this._subscribe = subscribe;\n }\n }\n\n // HACK: Since TypeScript inherits static properties too, we have to\n // fight against TypeScript here so Subject can have a different static create signature\n /**\n * Creates a new Observable by calling the Observable constructor\n * @param subscribe the subscriber function to be passed to the Observable constructor\n * @return A new observable.\n * @deprecated Use `new Observable()` instead. Will be removed in v8.\n */\n static create: (...args: any[]) => any = <T>(subscribe?: (subscriber: Subscriber<T>) => TeardownLogic) => {\n return new Observable<T>(subscribe);\n };\n\n /**\n * Creates a new Observable, with this Observable instance as the source, and the passed\n * operator defined as the new observable's operator.\n * @param operator the operator defining the operation to take on the observable\n * @return A new observable with the Operator applied.\n * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.\n * If you have implemented an operator using `lift`, it is recommended that you create an\n * operator by simply returning `new Observable()` directly. See \"Creating new operators from\n * scratch\" section here: https://rxjs.dev/guide/operators\n */\n lift<R>(operator?: Operator<T, R>): Observable<R> {\n const observable = new Observable<R>();\n observable.source = this;\n observable.operator = operator;\n return observable;\n }\n\n subscribe(observerOrNext?: Partial<Observer<T>> | ((value: T) => void)): Subscription;\n /** @deprecated Instead of passing separate callback arguments, use an observer argument. Signatures taking separate callback arguments will be removed in v8. Details: https://rxjs.dev/deprecations/subscribe-arguments */\n subscribe(next?: ((value: T) => void) | null, error?: ((error: any) => void) | null, complete?: (() => void) | null): Subscription;\n /**\n * Invokes an execution of an Observable and registers Observer handlers for notifications it will emit.\n *\n * <span class=\"informal\">Use it when you have all these Observables, but still nothing is happening.</span>\n *\n * `subscribe` is not a regular operator, but a method that calls Observable's internal `subscribe` function. It\n * might be for example a function that you passed to Observable's constructor, but most of the time it is\n * a library implementation, which defines what will be emitted by an Observable, and when it be will emitted. This means\n * that calling `subscribe` is actually the moment when Observable starts its work, not when it is created, as it is often\n * the thought.\n *\n * Apart from starting the execution of an Observable, this method allows you to listen for values\n * that an Observable emits, as well as for when it completes or errors. You can achieve this in two\n * of the following ways.\n *\n * The first way is creating an object that implements {@link Observer} interface. It should have methods\n * defined by that interface, but note that it should be just a regular JavaScript object, which you can create\n * yourself in any way you want (ES6 class, classic function constructor, object literal etc.). In particular, do\n * not attempt to use any RxJS implementation details to create Observers - you don't need them. Remember also\n * that your object does not have to implement all methods. If you find yourself creating a method that doesn't\n * do anything, you can simply omit it. Note however, if the `error` method is not provided and an error happens,\n * it will be thrown asynchronously. Errors thrown asynchronously cannot be caught using `try`/`catch`. Instead,\n * use the {@link onUnhandledError} configuration option or use a runtime handler (like `window.onerror` or\n * `process.on('error)`) to be notified of unhandled errors. Because of this, it's recommended that you provide\n * an `error` method to avoid missing thrown errors.\n *\n * The second way is to give up on Observer object altogether and simply provide callback functions in place of its methods.\n * This means you can provide three functions as arguments to `subscribe`, where the first function is equivalent\n * of a `next` method, the second of an `error` method and the third of a `complete` method. Just as in case of an Observer,\n * if you do not need to listen for something, you can omit a function by passing `undefined` or `null`,\n * since `subscribe` recognizes these functions by where they were placed in function call. When it comes\n * to the `error` function, as with an Observer, if not provided, errors emitted by an Observable will be thrown asynchronously.\n *\n * You can, however, subscribe with no parameters at all. This may be the case where you're not interested in terminal events\n * and you also handled emissions internally by using operators (e.g. using `tap`).\n *\n * Whichever style of calling `subscribe` you use, in both cases it returns a Subscription object.\n * This object allows you to call `unsubscribe` on it, which in turn will stop the work that an Observable does and will clean\n * up all resources that an Observable used. Note that cancelling a subscription will not call `complete` callback\n * provided to `subscribe` function, which is reserved for a regular completion signal that comes from an Observable.\n *\n * Remember that callbacks provided to `subscribe` are not guaranteed to be called asynchronously.\n * It is an Observable itself that decides when these functions will be called. For example {@link of}\n * by default emits all its values synchronously. Always check documentation for how given Observable\n * will behave when subscribed and if its default behavior can be modified with a `scheduler`.\n *\n * #### Examples\n *\n * Subscribe with an {@link guide/observer Observer}\n *\n * ```ts\n * import { of } from 'rxjs';\n *\n * const sumObserver = {\n * sum: 0,\n * next(value) {\n * console.log('Adding: ' + value);\n * this.sum = this.sum + value;\n * },\n * error() {\n * // We actually could just remove this method,\n * // since we do not really care about errors right now.\n * },\n * complete() {\n * console.log('Sum equals: ' + this.sum);\n * }\n * };\n *\n * of(1, 2, 3) // Synchronously emits 1, 2, 3 and then completes.\n * .subscribe(sumObserver);\n *\n * // Logs:\n * // 'Adding: 1'\n * // 'Adding: 2'\n * // 'Adding: 3'\n * // 'Sum equals: 6'\n * ```\n *\n * Subscribe with functions ({@link deprecations/subscribe-arguments deprecated})\n *\n * ```ts\n * import { of } from 'rxjs'\n *\n * let sum = 0;\n *\n * of(1, 2, 3).subscribe(\n * value => {\n * console.log('Adding: ' + value);\n * sum = sum + value;\n * },\n * undefined,\n * () => console.log('Sum equals: ' + sum)\n * );\n *\n * // Logs:\n * // 'Adding: 1'\n * // 'Adding: 2'\n * // 'Adding: 3'\n * // 'Sum equals: 6'\n * ```\n *\n * Cancel a subscription\n *\n * ```ts\n * import { interval } from 'rxjs';\n *\n * const subscription = interval(1000).subscribe({\n * next(num) {\n * console.log(num)\n * },\n * complete() {\n * // Will not be called, even when cancelling subscription.\n * console.log('completed!');\n * }\n * });\n *\n * setTimeout(() => {\n * subscription.unsubscribe();\n * console.log('unsubscribed!');\n * }, 2500);\n *\n * // Logs:\n * // 0 after 1s\n * // 1 after 2s\n * // 'unsubscribed!' after 2.5s\n * ```\n *\n * @param observerOrNext Either an {@link Observer} with some or all callback methods,\n * or the `next` handler that is called for each value emitted from the subscribed Observable.\n * @param error A handler for a terminal event resulting from an error. If no error handler is provided,\n * the error will be thrown asynchronously as unhandled.\n * @param complete A handler for a terminal event resulting from successful completion.\n * @return A subscription reference to the registered handlers.\n */\n subscribe(\n observerOrNext?: Partial<Observer<T>> | ((value: T) => void) | null,\n error?: ((error: any) => void) | null,\n complete?: (() => void) | null\n ): Subscription {\n const subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error, complete);\n\n errorContext(() => {\n const { operator, source } = this;\n subscriber.add(\n operator\n ? // We're dealing with a subscription in the\n // operator chain to one of our lifted operators.\n operator.call(subscriber, source)\n : source\n ? // If `source` has a value, but `operator` does not, something that\n // had intimate knowledge of our API, like our `Subject`, must have\n // set it. We're going to just call `_subscribe` directly.\n this._subscribe(subscriber)\n : // In all other cases, we're likely wrapping a user-provided initializer\n // function, so we need to catch errors and handle them appropriately.\n this._trySubscribe(subscriber)\n );\n });\n\n return subscriber;\n }\n\n /** @internal */\n protected _trySubscribe(sink: Subscriber<T>): TeardownLogic {\n try {\n return this._subscribe(sink);\n } catch (err) {\n // We don't need to return anything in this case,\n // because it's just going to try to `add()` to a subscription\n // above.\n sink.error(err);\n }\n }\n\n /**\n * Used as a NON-CANCELLABLE means of subscribing to an observable, for use with\n * APIs that expect promises, like `async/await`. You cannot unsubscribe from this.\n *\n * **WARNING**: Only use this with observables you *know* will complete. If the source\n * observable does not complete, you will end up with a promise that is hung up, and\n * potentially all of the state of an async function hanging out in memory. To avoid\n * this situation, look into adding something like {@link timeout}, {@link take},\n * {@link takeWhile}, or {@link takeUntil} amongst others.\n *\n * #### Example\n *\n * ```ts\n * import { interval, take } from 'rxjs';\n *\n * const source$ = interval(1000).pipe(take(4));\n *\n * async function getTotal() {\n * let total = 0;\n *\n * await source$.forEach(value => {\n * total += value;\n * console.log('observable -> ' + value);\n * });\n *\n * return total;\n * }\n *\n * getTotal().then(\n * total => console.log('Total: ' + total)\n * );\n *\n * // Expected:\n * // 'observable -> 0'\n * // 'observable -> 1'\n * // 'observable -> 2'\n * // 'observable -> 3'\n * // 'Total: 6'\n * ```\n *\n * @param next A handler for each value emitted by the observable.\n * @return A promise that either resolves on observable completion or\n * rejects with the handled error.\n */\n forEach(next: (value: T) => void): Promise<void>;\n\n /**\n * @param next a handler for each value emitted by the observable\n * @param promiseCtor a constructor function used to instantiate the Promise\n * @return a promise that either resolves on observable completion or\n * rejects with the handled error\n * @deprecated Passing a Promise constructor will no longer be available\n * in upcoming versions of RxJS. This is because it adds weight to the library, for very\n * little benefit. If you need this functionality, it is recommended that you either\n * polyfill Promise, or you create an adapter to convert the returned native promise\n * to whatever promise implementation you wanted. Will be removed in v8.\n */\n forEach(next: (value: T) => void, promiseCtor: PromiseConstructorLike): Promise<void>;\n\n forEach(next: (value: T) => void, promiseCtor?: PromiseConstructorLike): Promise<void> {\n promiseCtor = getPromiseCtor(promiseCtor);\n\n return new promiseCtor<void>((resolve, reject) => {\n const subscriber = new SafeSubscriber<T>({\n next: (value) => {\n try {\n next(value);\n } catch (err) {\n reject(err);\n subscriber.unsubscribe();\n }\n },\n error: reject,\n complete: resolve,\n });\n this.subscribe(subscriber);\n }) as Promise<void>;\n }\n\n /** @internal */\n protected _subscribe(subscriber: Subscriber<any>): TeardownLogic {\n return this.source?.subscribe(subscriber);\n }\n\n /**\n * An interop point defined by the es7-observable spec https://github.com/zenparsing/es-observable\n * @return This instance of the observable.\n */\n [Symbol_observable]() {\n return this;\n }\n\n /* tslint:disable:max-line-length */\n pipe(): Observable<T>;\n pipe<A>(op1: OperatorFunction<T, A>): Observable<A>;\n pipe<A, B>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>): Observable<B>;\n pipe<A, B, C>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>): Observable<C>;\n pipe<A, B, C, D>(\n op1: OperatorFunction<T, A>,\n op2: OperatorFunction<A, B>,\n op3: OperatorFunction<B, C>,\n op4: OperatorFunction<C, D>\n ): Observable<D>;\n pipe<A, B, C, D, E>(\n op1: OperatorFunction<T, A>,\n op2: OperatorFunction<A, B>,\n op3: OperatorFunction<B, C>,\n op4: OperatorFunction<C, D>,\n op5: OperatorFunction<D, E>\n ): Observable<E>;\n pipe<A, B, C, D, E, F>(\n op1: OperatorFunction<T, A>,\n op2: OperatorFunction<A, B>,\n op3: OperatorFunction<B, C>,\n op4: OperatorFunction<C, D>,\n op5: OperatorFunction<D, E>,\n op6: OperatorFunction<E, F>\n ): Observable<F>;\n pipe<A, B, C, D, E, F, G>(\n op1: OperatorFunction<T, A>,\n op2: OperatorFunction<A, B>,\n op3: OperatorFunction<B, C>,\n op4: OperatorFunction<C, D>,\n op5: OperatorFunction<D, E>,\n op6: OperatorFunction<E, F>,\n op7: OperatorFunction<F, G>\n ): Observable<G>;\n pipe<A, B, C, D, E, F, G, H>(\n op1: OperatorFunction<T, A>,\n op2: OperatorFunction<A, B>,\n op3: OperatorFunction<B, C>,\n op4: OperatorFunction<C, D>,\n op5: OperatorFunction<D, E>,\n op6: OperatorFunction<E, F>,\n op7: OperatorFunction<F, G>,\n op8: OperatorFunction<G, H>\n ): Observable<H>;\n pipe<A, B, C, D, E, F, G, H, I>(\n op1: OperatorFunction<T, A>,\n op2: OperatorFunction<A, B>,\n op3: OperatorFunction<B, C>,\n op4: OperatorFunction<C, D>,\n op5: OperatorFunction<D, E>,\n op6: OperatorFunction<E, F>,\n op7: OperatorFunction<F, G>,\n op8: OperatorFunction<G, H>,\n op9: OperatorFunction<H, I>\n ): Observable<I>;\n pipe<A, B, C, D, E, F, G, H, I>(\n op1: OperatorFunction<T, A>,\n op2: OperatorFunction<A, B>,\n op3: OperatorFunction<B, C>,\n op4: OperatorFunction<C, D>,\n op5: OperatorFunction<D, E>,\n op6: OperatorFunction<E, F>,\n op7: OperatorFunction<F, G>,\n op8: OperatorFunction<G, H>,\n op9: OperatorFunction<H, I>,\n ...operations: OperatorFunction<any, any>[]\n ): Observable<unknown>;\n /* tslint:enable:max-line-length */\n\n /**\n * Used to stitch together functional operators into a chain.\n *\n * ## Example\n *\n * ```ts\n * import { interval, filter, map, scan } from 'rxjs';\n *\n * interval(1000)\n * .pipe(\n * filter(x => x % 2 === 0),\n * map(x => x + x),\n * scan((acc, x) => acc + x)\n * )\n * .subscribe(x => console.log(x));\n * ```\n *\n * @return The Observable result of all the operators having been called\n * in the order they were passed in.\n */\n pipe(...operations: OperatorFunction<any, any>[]): Observable<any> {\n return pipeFromArray(operations)(this);\n }\n\n /* tslint:disable:max-line-length */\n /** @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise */\n toPromise(): Promise<T | undefined>;\n /** @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise */\n toPromise(PromiseCtor: typeof Promise): Promise<T | undefined>;\n /** @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise */\n toPromise(PromiseCtor: PromiseConstructorLike): Promise<T | undefined>;\n /* tslint:enable:max-line-length */\n\n /**\n * Subscribe to this Observable and get a Promise resolving on\n * `complete` with the last emission (if any).\n *\n * **WARNING**: Only use this with observables you *know* will complete. If the source\n * observable does not complete, you will end up with a promise that is hung up, and\n * potentially all of the state of an async function hanging out in memory. To avoid\n * this situation, look into adding something like {@link timeout}, {@link take},\n * {@link takeWhile}, or {@link takeUntil} amongst others.\n *\n * @param [promiseCtor] a constructor function used to instantiate\n * the Promise\n * @return A Promise that resolves with the last value emit, or\n * rejects on an error. If there were no emissions, Promise\n * resolves with undefined.\n * @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise\n */\n toPromise(promiseCtor?: PromiseConstructorLike): Promise<T | undefined> {\n promiseCtor = getPromiseCtor(promiseCtor);\n\n return new promiseCtor((resolve, reject) => {\n let value: T | undefined;\n this.subscribe(\n (x: T) => (value = x),\n (err: any) => reject(err),\n () => resolve(value)\n );\n }) as Promise<T | undefined>;\n }\n}\n\n/**\n * Decides between a passed promise constructor from consuming code,\n * A default configured promise constructor, and the native promise\n * constructor and returns it. If nothing can be found, it will throw\n * an error.\n * @param promiseCtor The optional promise constructor to passed by consuming code\n */\nfunction getPromiseCtor(promiseCtor: PromiseConstructorLike | undefined) {\n return promiseCtor ?? config.Promise ?? Promise;\n}\n\nfunction isObserver<T>(value: any): value is Observer<T> {\n return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);\n}\n\nfunction isSubscriber<T>(value: any): value is Subscriber<T> {\n return (value && value instanceof Subscriber) || (isObserver(value) && isSubscription(value));\n}\n", "import { createErrorClass } from './createErrorClass';\n\nexport interface ObjectUnsubscribedError extends Error {}\n\nexport interface ObjectUnsubscribedErrorCtor {\n /**\n * @deprecated Internal implementation detail. Do not construct error instances.\n * Cannot be tagged as internal: https://github.com/ReactiveX/rxjs/issues/6269\n */\n new (): ObjectUnsubscribedError;\n}\n\n/**\n * An error thrown when an action is invalid because the object has been\n * unsubscribed.\n *\n * @see {@link Subject}\n * @see {@link BehaviorSubject}\n *\n * @class ObjectUnsubscribedError\n */\nexport const ObjectUnsubscribedError: ObjectUnsubscribedErrorCtor = createErrorClass(\n (_super) =>\n function ObjectUnsubscribedErrorImpl(this: any) {\n _super(this);\n this.name = 'ObjectUnsubscribedError';\n this.message = 'object unsubscribed';\n }\n);\n", "import { Operator } from './Operator';\nimport { Observable } from './Observable';\nimport { Subscriber } from './Subscriber';\nimport { Subscription, EMPTY_SUBSCRIPTION } from './Subscription';\nimport { Observer, SubscriptionLike, TeardownLogic } from './types';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\nimport { arrRemove } from './util/arrRemove';\nimport { errorContext } from './util/errorContext';\n\n/**\n * A Subject is a special type of Observable that allows values to be\n * multicasted to many Observers. Subjects are like EventEmitters.\n *\n * Every Subject is an Observable and an Observer. You can subscribe to a\n * Subject, and you can call next to feed values as well as error and complete.\n */\nexport class Subject<T> extends Observable<T> implements SubscriptionLike {\n closed = false;\n\n private currentObservers: Observer<T>[] | null = null;\n\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n observers: Observer<T>[] = [];\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n isStopped = false;\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n hasError = false;\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n thrownError: any = null;\n\n /**\n * Creates a \"subject\" by basically gluing an observer to an observable.\n *\n * @deprecated Recommended you do not use. Will be removed at some point in the future. Plans for replacement still under discussion.\n */\n static create: (...args: any[]) => any = <T>(destination: Observer<T>, source: Observable<T>): AnonymousSubject<T> => {\n return new AnonymousSubject<T>(destination, source);\n };\n\n constructor() {\n // NOTE: This must be here to obscure Observable's constructor.\n super();\n }\n\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n lift<R>(operator: Operator<T, R>): Observable<R> {\n const subject = new AnonymousSubject(this, this);\n subject.operator = operator as any;\n return subject as any;\n }\n\n /** @internal */\n protected _throwIfClosed() {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n }\n\n next(value: T) {\n errorContext(() => {\n this._throwIfClosed();\n if (!this.isStopped) {\n if (!this.currentObservers) {\n this.currentObservers = Array.from(this.observers);\n }\n for (const observer of this.currentObservers) {\n observer.next(value);\n }\n }\n });\n }\n\n error(err: any) {\n errorContext(() => {\n this._throwIfClosed();\n if (!this.isStopped) {\n this.hasError = this.isStopped = true;\n this.thrownError = err;\n const { observers } = this;\n while (observers.length) {\n observers.shift()!.error(err);\n }\n }\n });\n }\n\n complete() {\n errorContext(() => {\n this._throwIfClosed();\n if (!this.isStopped) {\n this.isStopped = true;\n const { observers } = this;\n while (observers.length) {\n observers.shift()!.complete();\n }\n }\n });\n }\n\n unsubscribe() {\n this.isStopped = this.closed = true;\n this.observers = this.currentObservers = null!;\n }\n\n get observed() {\n return this.observers?.length > 0;\n }\n\n /** @internal */\n protected _trySubscribe(subscriber: Subscriber<T>): TeardownLogic {\n this._throwIfClosed();\n return super._trySubscribe(subscriber);\n }\n\n /** @internal */\n protected _subscribe(subscriber: Subscriber<T>): Subscription {\n this._throwIfClosed();\n this._checkFinalizedStatuses(subscriber);\n return this._innerSubscribe(subscriber);\n }\n\n /** @internal */\n protected _innerSubscribe(subscriber: Subscriber<any>) {\n const { hasError, isStopped, observers } = this;\n if (hasError || isStopped) {\n return EMPTY_SUBSCRIPTION;\n }\n this.currentObservers = null;\n observers.push(subscriber);\n return new Subscription(() => {\n this.currentObservers = null;\n arrRemove(observers, subscriber);\n });\n }\n\n /** @internal */\n protected _checkFinalizedStatuses(subscriber: Subscriber<any>) {\n const { hasError, thrownError, isStopped } = this;\n if (hasError) {\n subscriber.error(thrownError);\n } else if (isStopped) {\n subscriber.complete();\n }\n }\n\n /**\n * Creates a new Observable with this Subject as the source. You can do this\n * to create custom Observer-side logic of the Subject and conceal it from\n * code that uses the Observable.\n * @return Observable that this Subject casts to.\n */\n asObservable(): Observable<T> {\n const observable: any = new Observable<T>();\n observable.source = this;\n return observable;\n }\n}\n\nexport class AnonymousSubject<T> extends Subject<T> {\n constructor(\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n public destination?: Observer<T>,\n source?: Observable<T>\n ) {\n super();\n this.source = source;\n }\n\n next(value: T) {\n this.destination?.next?.(value);\n }\n\n error(err: any) {\n this.destination?.error?.(err);\n }\n\n complete() {\n this.destination?.complete?.();\n }\n\n /** @internal */\n protected _subscribe(subscriber: Subscriber<T>): Subscription {\n return this.source?.subscribe(subscriber) ?? EMPTY_SUBSCRIPTION;\n }\n}\n", "import { Subject } from './Subject';\nimport { Subscriber } from './Subscriber';\nimport { Subscription } from './Subscription';\n\n/**\n * A variant of Subject that requires an initial value and emits its current\n * value whenever it is subscribed to.\n */\nexport class BehaviorSubject<T> extends Subject<T> {\n constructor(private _value: T) {\n super();\n }\n\n get value(): T {\n return this.getValue();\n }\n\n /** @internal */\n protected _subscribe(subscriber: Subscriber<T>): Subscription {\n const subscription = super._subscribe(subscriber);\n !subscription.closed && subscriber.next(this._value);\n return subscription;\n }\n\n getValue(): T {\n const { hasError, thrownError, _value } = this;\n if (hasError) {\n throw thrownError;\n }\n this._throwIfClosed();\n return _value;\n }\n\n next(value: T): void {\n super.next((this._value = value));\n }\n}\n"],
5
- "mappings": "yhBAAA,IAAAA,GAAAC,EAAA,CAAAC,GAAAC,KAAA,CAIA,IAAIC,GAAI,IACJC,GAAID,GAAI,GACRE,GAAID,GAAI,GACRE,GAAID,GAAI,GACRE,GAAID,GAAI,EACRE,GAAIF,GAAI,OAgBZJ,GAAO,QAAU,SAAUO,EAAKC,EAAS,CACvCA,EAAUA,GAAW,CAAC,EACtB,IAAIC,EAAO,OAAOF,EAClB,GAAIE,IAAS,UAAYF,EAAI,OAAS,EACpC,OAAOG,GAAMH,CAAG,EACX,GAAIE,IAAS,UAAY,SAASF,CAAG,EAC1C,OAAOC,EAAQ,KAAOG,GAAQJ,CAAG,EAAIK,GAASL,CAAG,EAEnD,MAAM,IAAI,MACR,wDACE,KAAK,UAAUA,CAAG,CACtB,CACF,EAUA,SAASG,GAAMG,EAAK,CAElB,GADAA,EAAM,OAAOA,CAAG,EACZ,EAAAA,EAAI,OAAS,KAGjB,KAAIC,EAA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AGa,CAAU,CAAC,EAAE,MAAOU,GAAUV,EAAW,MAAMU,CAAK,CAAC,CAC1E,CAAC,CACH",
6
- "names": ["require_ms", "__commonJSMin", "exports", "module", "s", "m", "h", "d", "w", "y", "val", "options", "type", "parse", "fmtLong", "fmtShort", "str", "match", "n", "ms", "msAbs", "plural", "name", "isPlural", "require_common", "__commonJSMin", "exports", "module", "setup", "env", "createDebug", "coerce", "disable", "enable", "enabled", "destroy", "key", "selectColor", "namespace", "hash", "i", "prevTime", "enableOverride", "namespacesCache", "enabledCache", "debug", "args", "self", "curr", "ms", "index", "match", "format", "formatter", "val", "extend", "v", "delimiter", "newDebug", "namespaces", "split", "ns", "matchesTemplate", "search", "template", "searchIndex", "templateIndex", "starIndex", "matchIndex", "name", "skip", "require_browser", "__commonJSMin", "exports", "module", "formatArgs", "save", "load", "useColors", "localstorage", "warned", "m", "args", "c", "index", "lastC", "match", "namespaces", "r", "formatters", "v", "error", "exports", "debug", "debug_1", "__importDefault", "loggerLevels", "Logger", "namespace", "level", "logger", "message", "args", "require_util", "__commonJSMin", "exports", "util", "_", "assertIs", "_arg", "assertNever", "_x", "items", "obj", "item", "validKeys", "k", "filtered", "e", "object", "keys", "key", "arr", "checker", "val", "joinValues", "array", "separator", "value", "objectUtil", "first", "second", "getParsedType", "data", "require_ZodError", "__commonJSMin", "exports", "util_js_1", "quotelessJson", "obj", "ZodError", "_ZodError", "issues", "sub", "subs", "actualProto", "_mapper", "mapper", "issue", "fieldErrors", "processError", "error", "curr", "i", "el", "value", "formErrors", "firstEl", "require_en", "__commonJSMin", "exports", "ZodError_js_1", "util_js_1", "errorMap", "issue", "_ctx", "message", "require_errors", "__commonJSMin", "exports", "__importDefault", "mod", "setErrorMap", "getErrorMap", "en_js_1", "overrideErrorMap", "map", "require_parseUtil", "__commonJSMin", "exports", "__importDefault", "mod", "addIssueToContext", "errors_js_1", "en_js_1", "makeIssue", "params", "data", "path", "errorMaps", "issueData", "fullPath", "fullIssue", "errorMessage", "maps", "m", "map", "ctx", "overrideMap", "issue", "x", "ParseStatus", "_ParseStatus", "status", "results", "arrayValue", "s", "pairs", "syncPairs", "pair", "key", "value", "finalObject", "DIRTY", "OK", "isAborted", "isDirty", "isValid", "isAsync", "require_typeAliases", "__commonJSMin", "exports", "require_errorUtil", "__commonJSMin", "exports", "errorUtil", "message", "require_types", "__commonJSMin", "exports", "datetimeRegex", "custom", "ZodError_js_1", "errors_js_1", "errorUtil_js_1", "parseUtil_js_1", "util_js_1", "ParseInputLazyPath", "parent", "value", "path", "key", "handleResult", "ctx", "result", "error", "processCreateParams", "params", "errorMap", "invalid_type_error", "required_error", "description", "iss", "_a", "_b", "message", "ZodType", "input", "data", "err", "maybeAsyncResult", "check", "getIssueProperties", "val", "setError", "refinementData", "refinement", "ZodEffects", "ZodFirstPartyTypeKind", "def", "ZodOptional", "ZodNullable", "ZodArray", "ZodPromise", "option", "ZodUnion", "incoming", "ZodIntersection", "transform", "defaultValueFunc", "ZodDefault", "ZodBranded", "catchValueFunc", "ZodCatch", "This", "target", "ZodPipeline", "ZodReadonly", "cuidRegex", "cuid2Regex", "ulidRegex", "uuidRegex", "nanoidRegex", "jwtRegex", "durationRegex", "emailRegex", "_emojiRegex", "emojiRegex", "ipv4Regex", "ipv4CidrRegex", "ipv6Regex", "ipv6CidrRegex", "base64Regex", "base64urlRegex", "dateRegexSource", "dateRegex", "timeRegexSource", "args", "secondsRegexSource", "secondsQuantifier", "timeRegex", "regex", "opts", "isValidIP", "ip", "version", "isValidJWT", "jwt", "alg", "header", "base64", "decoded", "isValidCidr", "ZodString", "_ZodString", "status", "tooBig", "tooSmall", "validation", "options", "minLength", "maxLength", "len", "ch", "min", "max", "floatSafeRemainder", "step", "valDecCount", "stepDecCount", "decCount", "valInt", "stepInt", "ZodNumber", "_ZodNumber", "kind", "inclusive", "ZodBigInt", "_ZodBigInt", "ZodBoolean", "ZodDate", "_ZodDate", "minDate", "maxDate", "ZodSymbol", "ZodUndefined", "ZodNull", "ZodAny", "ZodUnknown", "ZodNever", "ZodVoid", "_ZodArray", "item", "i", "schema", "deepPartialify", "ZodObject", "newShape", "fieldSchema", "ZodTuple", "_ZodObject", "shape", "keys", "shapeKeys", "extraKeys", "pairs", "keyValidator", "unknownKeys", "catchall", "syncPairs", "pair", "issue", "_c", "_d", "defaultError", "augmentation", "merging", "index", "mask", "newField", "createZodEnum", "handleResults", "results", "unionErrors", "childCtx", "dirty", "issues", "types", "getDiscriminator", "type", "ZodLazy", "ZodLiteral", "ZodEnum", "ZodNativeEnum", "ZodDiscriminatedUnion", "_ZodDiscriminatedUnion", "discriminator", "discriminatorValue", "optionsMap", "discriminatorValues", "mergeValues", "a", "b", "aType", "bType", "bKeys", "sharedKeys", "newObj", "sharedValue", "newArray", "itemA", "itemB", "handleParsed", "parsedLeft", "parsedRight", "merged", "left", "right", "_ZodTuple", "items", "itemIndex", "x", "rest", "schemas", "ZodRecord", "_ZodRecord", "keyType", "valueType", "first", "second", "third", "ZodMap", "finalMap", "ZodSet", "_ZodSet", "finalizeSet", "elements", "parsedSet", "element", "minSize", "maxSize", "size", "ZodFunction", "_ZodFunction", "makeArgsIssue", "makeReturnsIssue", "returns", "fn", "me", "parsedArgs", "e", "parsedReturns", "returnType", "func", "getter", "values", "_ZodEnum", "expectedValues", "enumValues", "newDef", "opt", "nativeEnumValues", "promisified", "effect", "checkCtx", "arg", "processed", "executeRefinement", "acc", "inner", "base", "preprocess", "newCtx", "ZodNaN", "_ZodPipeline", "inResult", "freeze", "cleanParams", "p", "_params", "fatal", "r", "_fatal", "instanceOfType", "cls", "stringType", "numberType", "nanType", "bigIntType", "booleanType", "dateType", "symbolType", "undefinedType", "nullType", "anyType", "unknownType", "neverType", "voidType", "arrayType", "objectType", "strictObjectType", "unionType", "discriminatedUnionType", "intersectionType", "tupleType", "recordType", "mapType", "setType", "functionType", "lazyType", "literalType", "enumType", "nativeEnumType", "promiseType", "effectsType", "optionalType", "nullableType", "preprocessType", "pipelineType", "ostring", "onumber", "oboolean", "require_external", "__commonJSMin", "exports", "__createBinding", "o", "m", "k", "k2", "desc", "__exportStar", "p", "require_zod", "__commonJSMin", "exports", "__createBinding", "o", "m", "k", "k2", "desc", "__setModuleDefault", "v", "__importStar", "mod", "result", "__exportStar", "p", "z", "zod_1", "ActionTypes", "exports", "zod_1", "SemanticActionStateTypes", "exports", "zod_1", "AttachmentLayoutTypes", "exports", "Channels", "exports", "zod_1", "EndOfConversationCodes", "exports", "zod_1", "MembershipSourceTypes", "exports", "zod_1", "MembershipTypes", "exports", "zod_1", "RoleTypes", "exports", "addAIToActivity", "activity", "citations", "usageInfo", "aiEntity", "_a", "exports", "zod_1", "exports", "require_max", "__commonJSMin", "exports", "require_nil", "__commonJSMin", "exports", "require_regex", "__commonJSMin", "exports", "require_validate", "__commonJSMin", "exports", "regex_js_1", "validate", "uuid", "require_parse", "__commonJSMin", "exports", "validate_js_1", "parse", "uuid", "v", "require_stringify", "__commonJSMin", "exports", "validate_js_1", "byteToHex", "i", "unsafeStringify", "arr", "offset", "stringify", "uuid", "require_rng", "__commonJSMin", "exports", "getRandomValues", "rnds8", "rng", "require_v1", "__commonJSMin", "exports", "rng_js_1", "stringify_js_1", "_state", "v1", "options", "buf", "offset", "_a", "_b", "_c", "_d", "bytes", "isV6", "optionsKeys", "v1Bytes", "now", "rnds", "updateV1State", "state", "msecs", "nsecs", "clockseq", "node", "tl", "tmh", "n", "require_v1ToV6", "__commonJSMin", "exports", "parse_js_1", "stringify_js_1", "v1ToV6", "uuid", "v1Bytes", "v6Bytes", "_v1ToV6", "require_md5", "__commonJSMin", "exports", "md5", "bytes", "words", "uint8ToUint32", "md5Bytes", "wordsToMd5", "uint32ToUint8", "input", "i", "getOutputLength", "inputLength8", "x", "len", "xpad", "a", "b", "c", "d", "olda", "oldb", "oldc", "oldd", "md5ff", "md5gg", "md5hh", "md5ii", "safeAdd", "output", "y", "lsw", "bitRotateLeft", "num", "cnt", "md5cmn", "q", "s", "t", "require_v35", "__commonJSMin", "exports", "parse_js_1", "stringify_js_1", "stringToBytes", "str", "bytes", "i", "v35", "version", "hash", "value", "namespace", "buf", "offset", "valueBytes", "namespaceBytes", "require_v3", "__commonJSMin", "exports", "md5_js_1", "v35_js_1", "v35_js_2", "v3", "value", "namespace", "buf", "offset", "require_native", "__commonJSMin", "exports", "randomUUID", "require_v4", "__commonJSMin", "exports", "native_js_1", "rng_js_1", "stringify_js_1", "v4", "options", "buf", "offset", "_a", "_b", "_c", "rnds", "i", "require_sha1", "__commonJSMin", "exports", "f", "s", "x", "y", "z", "ROTL", "n", "sha1", "bytes", "K", "H", "newBytes", "l", "N", "M", "i", "arr", "j", "W", "t", "a", "b", "c", "d", "e", "T", "require_v5", "__commonJSMin", "exports", "sha1_js_1", "v35_js_1", "v35_js_2", "v5", "value", "namespace", "buf", "offset", "require_v6", "__commonJSMin", "exports", "stringify_js_1", "v1_js_1", "v1ToV6_js_1", "v6", "options", "buf", "offset", "bytes", "i", "require_v6ToV1", "__commonJSMin", "exports", "parse_js_1", "stringify_js_1", "v6ToV1", "uuid", "v6Bytes", "v1Bytes", "_v6ToV1", "require_v7", "__commonJSMin", "exports", "rng_js_1", "stringify_js_1", "_state", "v7", "options", "buf", "offset", "_a", "_b", "_c", "bytes", "v7Bytes", "now", "rnds", "updateV7State", "state", "msecs", "seq", "require_version", "__commonJSMin", "exports", "validate_js_1", "version", "uuid", "require_cjs_browser", "__commonJSMin", "exports", "max_js_1", "nil_js_1", "parse_js_1", "stringify_js_1", "v1_js_1", "v1ToV6_js_1", "v3_js_1", "v4_js_1", "v5_js_1", "v6_js_1", "v6ToV1_js_1", "v7_js_1", "validate_js_1", "version_js_1", "zod_1", "exports", "zod_1", "entity_1", "semanticActionStateTypes_1", "exports", "zod_1", "actionTypes_1", "exports", "zod_1", "cardAction_1", "exports", "zod_1", "ActivityEventNames", "exports", "zod_1", "ActivityImportance", "exports", "zod_1", "ActivityTypes", "exports", "zod_1", "exports", "clearProductInfoFromActivity", "activity", "exports", "addProductInfoToActivity", "id", "productInfo", "_a", "_b", "zod_1", "roleTypes_1", "exports", "zod_1", "roleTypes_1", "exports", "zod_1", "channelAccount_1", "conversationAccount_1", "exports", "zod_1", "DeliveryModes", "exports", "zod_1", "InputHints", "exports", "zod_1", "MessageReactionTypes", "exports", "zod_1", "messageReactionTypes_1", "exports", "zod_1", "TextFormatTypes", "exports", "zod_1", "exports", "ExceptionHelper", "_ExceptionHelper", "ErrorType", "errorDefinition", "innerException", "params", "description", "key", "helplink", "_a", "message", "exception", "exports", "exports", "uuid_1", "zod_1", "semanticAction_1", "suggestedActions_1", "activityEventNames_1", "activityImportance_1", "activityTypes_1", "attachment_1", "attachmentLayoutTypes_1", "productInfo_1", "channelAccount_1", "channels_1", "conversationAccount_1", "conversationReference_1", "endOfConversationCodes_1", "deliveryModes_1", "entity_1", "inputHints_1", "messageReaction_1", "textFormatTypes_1", "textHighlight_1", "roleTypes_1", "exceptionHelper_1", "errorHelper_1", "exports", "s", "Activity", "_Activity", "t", "json", "o", "parsedActivity", "activity", "_a", "value", "channel", "subChannel", "_b", "e", "reference", "continuationActivityObj", "isIncoming", "_c", "activityCopy", "key", "result", "i", "removeMention", "entity", "mentions", "mention", "text", "foundTag", "iAtStart", "iAtEnd", "iAtClose", "followingText", "tagContent", "prefixText", "id", "mentionsFiltered", "replyId", "copy", "zod_1", "ActivityTreatments", "exports", "actionTypes_1", "exports", "semanticActionStateTypes_1", "attachmentLayoutTypes_1", "channels_1", "endOfConversationCodes_1", "membershipSourceTypes_1", "membershipTypes_1", "roleTypes_1", "__exportStar", "activity_1", "activityEventNames_1", "activityImportance_1", "activityTypes_1", "deliveryModes_1", "inputHints_1", "messageReactionTypes_1", "textFormatTypes_1", "activityTreatments_1", "logger_1", "exceptionHelper_1", "errorHelper_1", "AgentType", "PowerPlatformCloud", "ConnectionOptions", "ConnectionSettings", "options", "_a", "_b", "_c", "cloud", "copilotAgentType", "authority", "PowerPlatformCloud", "AgentType", "loadCopilotStudioConnectionSettingsFromEnv", "_d", "_e", "_f", "_g", "ParseError", "message", "options", "noop", "_arg", "createParser", "callbacks", "onEvent", "onError", "onRetry", "onComment", "incompleteLine", "isFirstChunk", "id", "data", "eventType", "feed", "newChunk", "chunk", "complete", "incomplete", "splitLines", "line", "parseLine", "dispatchEvent", "fieldSeparatorIndex", "field", "offset", "value", "processField", "reset", "lines", "searchIndex", "crIndex", "lfIndex", "lineEnd", "CONNECTING", "OPEN", "CLOSED", "noop", "createEventSource", "optionsOrUrl", "getStream", "options", "onMessage", "onComment", "onConnect", "onDisconnect", "onScheduleReconnect", "fetch", "url", "initialLastEventId", "validate", "requestHeaders", "onCloseSubscribers", "subscribers", "emit", "event", "fn", "parser", "createParser", "onEvent", "onRetry", "request", "currentUrl", "controller", "lastEventId", "reconnectMs", "reconnectTimer", "readyState", "connect", "close", "getEventIterator", "getRequestOptions", "onFetchResponse", "err", "scheduleReconnect", "pullQueue", "pushQueue", "pullValue", "resolve", "value", "pushValue", "unsubscribe", "onClose", "error", "response", "body", "redirected", "status", "stream", "decoder", "reader", "open", "done", "msg", "ms", "mode", "credentials", "method", "redirect", "referrer", "referrerPolicy", "headers", "isFetchLike", "defaultAbstractions", "createSource", "import_logger", "PrebuiltBotStrategy", "settings", "schema", "host", "conversationId", "conversationUrl", "PublishedBotStrategy", "settings", "schema", "host", "conversationId", "conversationUrl", "logger", "getCopilotStudioConnectionUrl", "settings", "conversationId", "_a", "_b", "_c", "_d", "_e", "_f", "_g", "_h", "schemaName", "isValidUri", "createURL", "cloudSetting", "agentType", "host", "getEnvironmentEndpoint", "url", "PublishedBotStrategy", "PrebuiltBotStrategy", "getTokenAudience", "cloud", "cloudBaseAddress", "directConnectUrl", "getEndpointSuffix", "decodeCloudFromURI", "cloudToTest", "uri", "absoluteUrl", "base", "environmentId", "normalizedResourceId", "idSuffixLength", "getIdSuffixLength", "hexPrefix", "hexSuffix", "category", "import_agents_activity", "ExecuteTurnRequest", "activity", "import_logger", "version", "os_default", "logger", "_CopilotStudioClient", "settings", "token", "url", "body", "method", "_a", "_b", "_c", "_d", "_e", "_f", "_g", "_h", "_i", "_j", "streamMap", "eventSource", "createEventSource", "init", "response", "data", "event", "activity", "streamingEntity", "e", "text", "id", "sequence", "existing", "a", "b", "item", "error", "versionString", "version", "userAgent", "os_default", "responseHeaders", "islandExperimentalUrl", "sanitizedHeaders", "value", "key", "emitStartConversationEvent", "uriStart", "getCopilotStudioConnectionUrl", "conversationId", "localConversationId", "uriExecute", "qbody", "ExecuteTurnRequest", "result", "question", "conversationAccount", "activityObj", "getTokenAudience", "CopilotStudioClient", "byteToHex", "i", "unsafeStringify", "arr", "offset", "getRandomValues", "rnds8", "rng", "randomUUID", "native_default", "v4", "options", "buf", "offset", "_a", "_b", "_c", "native_default", "rnds", "rng", "i", "unsafeStringify", "v4_default", "import_agents_activity", "extendStatics", "d", "b", "p", "__extends", "__", "__values", "o", "s", "m", "i", "__read", "n", "r", "ar", "e", "error", "__spreadArray", "to", "from", "pack", "i", "l", "ar", "isFunction", "value", "createErrorClass", "createImpl", "_super", "instance", "ctorFunc", "UnsubscriptionError", "createErrorClass", "_super", "errors", "err", "i", "arrRemove", "arr", "item", "index", "Subscription", "initialTeardown", "errors", "_parentage", "_parentage_1", "__values", "_parentage_1_1", "parent_1", "initialFinalizer", "isFunction", "e", "UnsubscriptionError", "_finalizers", "_finalizers_1", "_finalizers_1_1", "finalizer", "execFinalizer", "err", "__spreadArray", "__read", "teardown", "_a", "parent", "arrRemove", "empty", "EMPTY_SUBSCRIPTION", "Subscription", "isSubscription", "value", "isFunction", "execFinalizer", "finalizer", "config", "timeoutProvider", "handler", "timeout", "args", "_i", "delegate", "__spreadArray", "__read", "handle", "reportUnhandledError", "err", "timeoutProvider", "onUnhandledError", "config", "noop", "COMPLETE_NOTIFICATION", "createNotification", "errorNotification", "error", "nextNotification", "value", "kind", "context", "errorContext", "cb", "config", "isRoot", "_a", "errorThrown", "error", "captureError", "err", "Subscriber", "_super", "__extends", "destination", "_this", "isSubscription", "EMPTY_OBSERVER", "next", "error", "complete", "SafeSubscriber", "value", "handleStoppedNotification", "nextNotification", "err", "errorNotification", "COMPLETE_NOTIFICATION", "Subscription", "_bind", "bind", "fn", "thisArg", "ConsumerObserver", "partialObserver", "value", "error", "handleUnhandledError", "err", "SafeSubscriber", "_super", "__extends", "observerOrNext", "complete", "_this", "isFunction", "context_1", "config", "Subscriber", "handleUnhandledError", "error", "config", "captureError", "reportUnhandledError", "defaultErrorHandler", "err", "handleStoppedNotification", "notification", "subscriber", "onStoppedNotification", "timeoutProvider", "EMPTY_OBSERVER", "noop", "observable", "identity", "x", "pipeFromArray", "fns", "identity", "input", "prev", "fn", "Observable", "subscribe", "operator", "observable", "observerOrNext", "error", "complete", "_this", "subscriber", "isSubscriber", "SafeSubscriber", "errorContext", "_a", "source", "sink", "err", "next", "promiseCtor", "getPromiseCtor", "resolve", "reject", "value", "operations", "_i", "pipeFromArray", "x", "getPromiseCtor", "promiseCtor", "_a", "config", "isObserver", "value", "isFunction", "isSubscriber", "Subscriber", "isSubscription", "ObjectUnsubscribedError", "createErrorClass", "_super", "Subject", "_super", "__extends", "_this", "operator", "subject", "AnonymousSubject", "ObjectUnsubscribedError", "value", "errorContext", "_b", "__values", "_c", "observer", "err", "observers", "_a", "subscriber", "hasError", "isStopped", "EMPTY_SUBSCRIPTION", "Subscription", "arrRemove", "thrownError", "observable", "Observable", "destination", "source", "AnonymousSubject", "_super", "__extends", "destination", "source", "_this", "value", "_b", "_a", "err", "subscriber", "EMPTY_SUBSCRIPTION", "Subject", "BehaviorSubject", "_super", "__extends", "_value", "_this", "subscriber", "subscription", "_a", "hasError", "thrownError", "value", "Subject", "import_logger", "logger", "once", "fn", "called", "value", "CopilotStudioWebChat", "client", "settings", "sequence", "activitySubscriber", "conversation", "connectionStatus$", "BehaviorSubject", "activity$", "createObservable", "subscriber", "handleAcknowledgementOnce", "notifyTyping", "activity", "notifyActivity", "newActivity", "from", "v4_default", "processAttachments", "responseActivity", "error", "_a", "attachments", "attachment", "processed", "processBlobAttachment", "newContentUrl", "response", "blob", "arrayBuffer", "base64", "arrayBufferToBase64", "buffer", "BufferClass", "binary", "byte", "Observable"]
4
+ "sourcesContent": ["/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function (val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n", "\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '')\n\t\t\t.trim()\n\t\t\t.replace(/\\s+/g, ',')\n\t\t\t.split(',')\n\t\t\t.filter(Boolean);\n\n\t\tfor (const ns of split) {\n\t\t\tif (ns[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(ns.slice(1));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(ns);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Checks if the given string matches a namespace template, honoring\n\t * asterisks as wildcards.\n\t *\n\t * @param {String} search\n\t * @param {String} template\n\t * @return {Boolean}\n\t */\n\tfunction matchesTemplate(search, template) {\n\t\tlet searchIndex = 0;\n\t\tlet templateIndex = 0;\n\t\tlet starIndex = -1;\n\t\tlet matchIndex = 0;\n\n\t\twhile (searchIndex < search.length) {\n\t\t\tif (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {\n\t\t\t\t// Match character or proceed with wildcard\n\t\t\t\tif (template[templateIndex] === '*') {\n\t\t\t\t\tstarIndex = templateIndex;\n\t\t\t\t\tmatchIndex = searchIndex;\n\t\t\t\t\ttemplateIndex++; // Skip the '*'\n\t\t\t\t} else {\n\t\t\t\t\tsearchIndex++;\n\t\t\t\t\ttemplateIndex++;\n\t\t\t\t}\n\t\t\t} else if (starIndex !== -1) { // eslint-disable-line no-negated-condition\n\t\t\t\t// Backtrack to the last '*' and try to match more characters\n\t\t\t\ttemplateIndex = starIndex + 1;\n\t\t\t\tmatchIndex++;\n\t\t\t\tsearchIndex = matchIndex;\n\t\t\t} else {\n\t\t\t\treturn false; // No match\n\t\t\t}\n\t\t}\n\n\t\t// Handle trailing '*' in template\n\t\twhile (templateIndex < template.length && template[templateIndex] === '*') {\n\t\t\ttemplateIndex++;\n\t\t}\n\n\t\treturn templateIndex === template.length;\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names,\n\t\t\t...createDebug.skips.map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tfor (const skip of createDebug.skips) {\n\t\t\tif (matchesTemplate(name, skip)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (const ns of createDebug.names) {\n\t\t\tif (matchesTemplate(name, ns)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n", "/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\tlet m;\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\t// eslint-disable-next-line no-return-assign\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)) && parseInt(m[1], 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG') ;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport createDebug, { Debugger } from 'debug'\n\nconst loggerLevels = [\n 'info',\n 'warn',\n 'error',\n 'debug',\n] as const\n\ntype LoggerLevels = typeof loggerLevels[number]\n\n/**\n * Logger class that provides colored logging functionality using the debug package.\n * Supports different log levels: info, warn, error, and debug.\n */\nexport class Logger {\n private loggers: { [K in LoggerLevels]: Debugger } = {} as any\n\n /**\n * Creates a new Logger instance with the specified namespace.\n * @param namespace The namespace to use for the logger\n */\n constructor (namespace: string = '') {\n this.initializeLoggers(namespace)\n }\n\n private initializeLoggers (namespace: string) {\n for (const level of loggerLevels) {\n const logger = createDebug(`${namespace}:${level}`)\n logger.color = this.getPlatformColor(level)\n this.loggers[level] = logger\n }\n }\n\n private getPlatformColor (level: LoggerLevels): string {\n const platform = typeof window !== 'undefined' ? 'browser' : 'node'\n const colors = {\n node: {\n info: '2', // Green\n warn: '3', // Yellow\n error: '1', // Red\n debug: '4', // Blue\n },\n browser: {\n info: '#33CC99', // Green\n warn: '#CCCC33', // Yellow\n error: '#CC3366', // Red\n debug: '#0066FF', // Blue\n },\n }\n\n return colors[platform][level]\n }\n\n /**\n * Logs an informational message.\n * @param message The message to log\n * @param args Additional arguments to include in the log\n */\n info (message: string, ...args: any[]) {\n this.loggers.info(message, ...args)\n }\n\n /**\n * Logs a warning message.\n * @param message The message to log\n * @param args Additional arguments to include in the log\n */\n warn (message: string, ...args: any[]) {\n this.loggers.warn(message, ...args)\n }\n\n /**\n * Logs an error message.\n * @param message The message to log\n * @param args Additional arguments to include in the log\n */\n error (message: string, ...args: any[]) {\n this.loggers.error(message, ...args)\n }\n\n /**\n * Logs a debug message.\n * @param message The message to log\n * @param args Additional arguments to include in the log\n */\n debug (message: string, ...args: any[]) {\n this.loggers.debug(message, ...args)\n }\n}\n\n/**\n * Creates a new Logger instance with the specified namespace.\n * @param namespace The namespace to use for the logger\n * @returns A new Logger instance\n */\nexport function debug (namespace: string): Logger {\n return new Logger(namespace)\n}\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getParsedType = exports.ZodParsedType = exports.objectUtil = exports.util = void 0;\nvar util;\n(function (util) {\n util.assertEqual = (_) => { };\n function assertIs(_arg) { }\n util.assertIs = assertIs;\n function assertNever(_x) {\n throw new Error();\n }\n util.assertNever = assertNever;\n util.arrayToEnum = (items) => {\n const obj = {};\n for (const item of items) {\n obj[item] = item;\n }\n return obj;\n };\n util.getValidEnumValues = (obj) => {\n const validKeys = util.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== \"number\");\n const filtered = {};\n for (const k of validKeys) {\n filtered[k] = obj[k];\n }\n return util.objectValues(filtered);\n };\n util.objectValues = (obj) => {\n return util.objectKeys(obj).map(function (e) {\n return obj[e];\n });\n };\n util.objectKeys = typeof Object.keys === \"function\" // eslint-disable-line ban/ban\n ? (obj) => Object.keys(obj) // eslint-disable-line ban/ban\n : (object) => {\n const keys = [];\n for (const key in object) {\n if (Object.prototype.hasOwnProperty.call(object, key)) {\n keys.push(key);\n }\n }\n return keys;\n };\n util.find = (arr, checker) => {\n for (const item of arr) {\n if (checker(item))\n return item;\n }\n return undefined;\n };\n util.isInteger = typeof Number.isInteger === \"function\"\n ? (val) => Number.isInteger(val) // eslint-disable-line ban/ban\n : (val) => typeof val === \"number\" && Number.isFinite(val) && Math.floor(val) === val;\n function joinValues(array, separator = \" | \") {\n return array.map((val) => (typeof val === \"string\" ? `'${val}'` : val)).join(separator);\n }\n util.joinValues = joinValues;\n util.jsonStringifyReplacer = (_, value) => {\n if (typeof value === \"bigint\") {\n return value.toString();\n }\n return value;\n };\n})(util || (exports.util = util = {}));\nvar objectUtil;\n(function (objectUtil) {\n objectUtil.mergeShapes = (first, second) => {\n return {\n ...first,\n ...second, // second overwrites first\n };\n };\n})(objectUtil || (exports.objectUtil = objectUtil = {}));\nexports.ZodParsedType = util.arrayToEnum([\n \"string\",\n \"nan\",\n \"number\",\n \"integer\",\n \"float\",\n \"boolean\",\n \"date\",\n \"bigint\",\n \"symbol\",\n \"function\",\n \"undefined\",\n \"null\",\n \"array\",\n \"object\",\n \"unknown\",\n \"promise\",\n \"void\",\n \"never\",\n \"map\",\n \"set\",\n]);\nconst getParsedType = (data) => {\n const t = typeof data;\n switch (t) {\n case \"undefined\":\n return exports.ZodParsedType.undefined;\n case \"string\":\n return exports.ZodParsedType.string;\n case \"number\":\n return Number.isNaN(data) ? exports.ZodParsedType.nan : exports.ZodParsedType.number;\n case \"boolean\":\n return exports.ZodParsedType.boolean;\n case \"function\":\n return exports.ZodParsedType.function;\n case \"bigint\":\n return exports.ZodParsedType.bigint;\n case \"symbol\":\n return exports.ZodParsedType.symbol;\n case \"object\":\n if (Array.isArray(data)) {\n return exports.ZodParsedType.array;\n }\n if (data === null) {\n return exports.ZodParsedType.null;\n }\n if (data.then && typeof data.then === \"function\" && data.catch && typeof data.catch === \"function\") {\n return exports.ZodParsedType.promise;\n }\n if (typeof Map !== \"undefined\" && data instanceof Map) {\n return exports.ZodParsedType.map;\n }\n if (typeof Set !== \"undefined\" && data instanceof Set) {\n return exports.ZodParsedType.set;\n }\n if (typeof Date !== \"undefined\" && data instanceof Date) {\n return exports.ZodParsedType.date;\n }\n return exports.ZodParsedType.object;\n default:\n return exports.ZodParsedType.unknown;\n }\n};\nexports.getParsedType = getParsedType;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ZodError = exports.quotelessJson = exports.ZodIssueCode = void 0;\nconst util_js_1 = require(\"./helpers/util.cjs\");\nexports.ZodIssueCode = util_js_1.util.arrayToEnum([\n \"invalid_type\",\n \"invalid_literal\",\n \"custom\",\n \"invalid_union\",\n \"invalid_union_discriminator\",\n \"invalid_enum_value\",\n \"unrecognized_keys\",\n \"invalid_arguments\",\n \"invalid_return_type\",\n \"invalid_date\",\n \"invalid_string\",\n \"too_small\",\n \"too_big\",\n \"invalid_intersection_types\",\n \"not_multiple_of\",\n \"not_finite\",\n]);\nconst quotelessJson = (obj) => {\n const json = JSON.stringify(obj, null, 2);\n return json.replace(/\"([^\"]+)\":/g, \"$1:\");\n};\nexports.quotelessJson = quotelessJson;\nclass ZodError extends Error {\n get errors() {\n return this.issues;\n }\n constructor(issues) {\n super();\n this.issues = [];\n this.addIssue = (sub) => {\n this.issues = [...this.issues, sub];\n };\n this.addIssues = (subs = []) => {\n this.issues = [...this.issues, ...subs];\n };\n const actualProto = new.target.prototype;\n if (Object.setPrototypeOf) {\n // eslint-disable-next-line ban/ban\n Object.setPrototypeOf(this, actualProto);\n }\n else {\n this.__proto__ = actualProto;\n }\n this.name = \"ZodError\";\n this.issues = issues;\n }\n format(_mapper) {\n const mapper = _mapper ||\n function (issue) {\n return issue.message;\n };\n const fieldErrors = { _errors: [] };\n const processError = (error) => {\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\") {\n issue.unionErrors.map(processError);\n }\n else if (issue.code === \"invalid_return_type\") {\n processError(issue.returnTypeError);\n }\n else if (issue.code === \"invalid_arguments\") {\n processError(issue.argumentsError);\n }\n else if (issue.path.length === 0) {\n fieldErrors._errors.push(mapper(issue));\n }\n else {\n let curr = fieldErrors;\n let i = 0;\n while (i < issue.path.length) {\n const el = issue.path[i];\n const terminal = i === issue.path.length - 1;\n if (!terminal) {\n curr[el] = curr[el] || { _errors: [] };\n // if (typeof el === \"string\") {\n // curr[el] = curr[el] || { _errors: [] };\n // } else if (typeof el === \"number\") {\n // const errorArray: any = [];\n // errorArray._errors = [];\n // curr[el] = curr[el] || errorArray;\n // }\n }\n else {\n curr[el] = curr[el] || { _errors: [] };\n curr[el]._errors.push(mapper(issue));\n }\n curr = curr[el];\n i++;\n }\n }\n }\n };\n processError(this);\n return fieldErrors;\n }\n static assert(value) {\n if (!(value instanceof ZodError)) {\n throw new Error(`Not a ZodError: ${value}`);\n }\n }\n toString() {\n return this.message;\n }\n get message() {\n return JSON.stringify(this.issues, util_js_1.util.jsonStringifyReplacer, 2);\n }\n get isEmpty() {\n return this.issues.length === 0;\n }\n flatten(mapper = (issue) => issue.message) {\n const fieldErrors = {};\n const formErrors = [];\n for (const sub of this.issues) {\n if (sub.path.length > 0) {\n const firstEl = sub.path[0];\n fieldErrors[firstEl] = fieldErrors[firstEl] || [];\n fieldErrors[firstEl].push(mapper(sub));\n }\n else {\n formErrors.push(mapper(sub));\n }\n }\n return { formErrors, fieldErrors };\n }\n get formErrors() {\n return this.flatten();\n }\n}\nexports.ZodError = ZodError;\nZodError.create = (issues) => {\n const error = new ZodError(issues);\n return error;\n};\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst ZodError_js_1 = require(\"../ZodError.cjs\");\nconst util_js_1 = require(\"../helpers/util.cjs\");\nconst errorMap = (issue, _ctx) => {\n let message;\n switch (issue.code) {\n case ZodError_js_1.ZodIssueCode.invalid_type:\n if (issue.received === util_js_1.ZodParsedType.undefined) {\n message = \"Required\";\n }\n else {\n message = `Expected ${issue.expected}, received ${issue.received}`;\n }\n break;\n case ZodError_js_1.ZodIssueCode.invalid_literal:\n message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util_js_1.util.jsonStringifyReplacer)}`;\n break;\n case ZodError_js_1.ZodIssueCode.unrecognized_keys:\n message = `Unrecognized key(s) in object: ${util_js_1.util.joinValues(issue.keys, \", \")}`;\n break;\n case ZodError_js_1.ZodIssueCode.invalid_union:\n message = `Invalid input`;\n break;\n case ZodError_js_1.ZodIssueCode.invalid_union_discriminator:\n message = `Invalid discriminator value. Expected ${util_js_1.util.joinValues(issue.options)}`;\n break;\n case ZodError_js_1.ZodIssueCode.invalid_enum_value:\n message = `Invalid enum value. Expected ${util_js_1.util.joinValues(issue.options)}, received '${issue.received}'`;\n break;\n case ZodError_js_1.ZodIssueCode.invalid_arguments:\n message = `Invalid function arguments`;\n break;\n case ZodError_js_1.ZodIssueCode.invalid_return_type:\n message = `Invalid function return type`;\n break;\n case ZodError_js_1.ZodIssueCode.invalid_date:\n message = `Invalid date`;\n break;\n case ZodError_js_1.ZodIssueCode.invalid_string:\n if (typeof issue.validation === \"object\") {\n if (\"includes\" in issue.validation) {\n message = `Invalid input: must include \"${issue.validation.includes}\"`;\n if (typeof issue.validation.position === \"number\") {\n message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;\n }\n }\n else if (\"startsWith\" in issue.validation) {\n message = `Invalid input: must start with \"${issue.validation.startsWith}\"`;\n }\n else if (\"endsWith\" in issue.validation) {\n message = `Invalid input: must end with \"${issue.validation.endsWith}\"`;\n }\n else {\n util_js_1.util.assertNever(issue.validation);\n }\n }\n else if (issue.validation !== \"regex\") {\n message = `Invalid ${issue.validation}`;\n }\n else {\n message = \"Invalid\";\n }\n break;\n case ZodError_js_1.ZodIssueCode.too_small:\n if (issue.type === \"array\")\n message = `Array must contain ${issue.exact ? \"exactly\" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;\n else if (issue.type === \"string\")\n message = `String must contain ${issue.exact ? \"exactly\" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;\n else if (issue.type === \"number\")\n message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;\n else if (issue.type === \"bigint\")\n message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;\n else if (issue.type === \"date\")\n message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;\n else\n message = \"Invalid input\";\n break;\n case ZodError_js_1.ZodIssueCode.too_big:\n if (issue.type === \"array\")\n message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;\n else if (issue.type === \"string\")\n message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;\n else if (issue.type === \"number\")\n message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;\n else if (issue.type === \"bigint\")\n message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;\n else if (issue.type === \"date\")\n message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`;\n else\n message = \"Invalid input\";\n break;\n case ZodError_js_1.ZodIssueCode.custom:\n message = `Invalid input`;\n break;\n case ZodError_js_1.ZodIssueCode.invalid_intersection_types:\n message = `Intersection results could not be merged`;\n break;\n case ZodError_js_1.ZodIssueCode.not_multiple_of:\n message = `Number must be a multiple of ${issue.multipleOf}`;\n break;\n case ZodError_js_1.ZodIssueCode.not_finite:\n message = \"Number must be finite\";\n break;\n default:\n message = _ctx.defaultError;\n util_js_1.util.assertNever(issue);\n }\n return { message };\n};\nexports.default = errorMap;\n", "\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.defaultErrorMap = void 0;\nexports.setErrorMap = setErrorMap;\nexports.getErrorMap = getErrorMap;\nconst en_js_1 = __importDefault(require(\"./locales/en.cjs\"));\nexports.defaultErrorMap = en_js_1.default;\nlet overrideErrorMap = en_js_1.default;\nfunction setErrorMap(map) {\n overrideErrorMap = map;\n}\nfunction getErrorMap() {\n return overrideErrorMap;\n}\n", "\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isAsync = exports.isValid = exports.isDirty = exports.isAborted = exports.OK = exports.DIRTY = exports.INVALID = exports.ParseStatus = exports.EMPTY_PATH = exports.makeIssue = void 0;\nexports.addIssueToContext = addIssueToContext;\nconst errors_js_1 = require(\"../errors.cjs\");\nconst en_js_1 = __importDefault(require(\"../locales/en.cjs\"));\nconst makeIssue = (params) => {\n const { data, path, errorMaps, issueData } = params;\n const fullPath = [...path, ...(issueData.path || [])];\n const fullIssue = {\n ...issueData,\n path: fullPath,\n };\n if (issueData.message !== undefined) {\n return {\n ...issueData,\n path: fullPath,\n message: issueData.message,\n };\n }\n let errorMessage = \"\";\n const maps = errorMaps\n .filter((m) => !!m)\n .slice()\n .reverse();\n for (const map of maps) {\n errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message;\n }\n return {\n ...issueData,\n path: fullPath,\n message: errorMessage,\n };\n};\nexports.makeIssue = makeIssue;\nexports.EMPTY_PATH = [];\nfunction addIssueToContext(ctx, issueData) {\n const overrideMap = (0, errors_js_1.getErrorMap)();\n const issue = (0, exports.makeIssue)({\n issueData: issueData,\n data: ctx.data,\n path: ctx.path,\n errorMaps: [\n ctx.common.contextualErrorMap, // contextual error map is first priority\n ctx.schemaErrorMap, // then schema-bound map if available\n overrideMap, // then global override map\n overrideMap === en_js_1.default ? undefined : en_js_1.default, // then global default map\n ].filter((x) => !!x),\n });\n ctx.common.issues.push(issue);\n}\nclass ParseStatus {\n constructor() {\n this.value = \"valid\";\n }\n dirty() {\n if (this.value === \"valid\")\n this.value = \"dirty\";\n }\n abort() {\n if (this.value !== \"aborted\")\n this.value = \"aborted\";\n }\n static mergeArray(status, results) {\n const arrayValue = [];\n for (const s of results) {\n if (s.status === \"aborted\")\n return exports.INVALID;\n if (s.status === \"dirty\")\n status.dirty();\n arrayValue.push(s.value);\n }\n return { status: status.value, value: arrayValue };\n }\n static async mergeObjectAsync(status, pairs) {\n const syncPairs = [];\n for (const pair of pairs) {\n const key = await pair.key;\n const value = await pair.value;\n syncPairs.push({\n key,\n value,\n });\n }\n return ParseStatus.mergeObjectSync(status, syncPairs);\n }\n static mergeObjectSync(status, pairs) {\n const finalObject = {};\n for (const pair of pairs) {\n const { key, value } = pair;\n if (key.status === \"aborted\")\n return exports.INVALID;\n if (value.status === \"aborted\")\n return exports.INVALID;\n if (key.status === \"dirty\")\n status.dirty();\n if (value.status === \"dirty\")\n status.dirty();\n if (key.value !== \"__proto__\" && (typeof value.value !== \"undefined\" || pair.alwaysSet)) {\n finalObject[key.value] = value.value;\n }\n }\n return { status: status.value, value: finalObject };\n }\n}\nexports.ParseStatus = ParseStatus;\nexports.INVALID = Object.freeze({\n status: \"aborted\",\n});\nconst DIRTY = (value) => ({ status: \"dirty\", value });\nexports.DIRTY = DIRTY;\nconst OK = (value) => ({ status: \"valid\", value });\nexports.OK = OK;\nconst isAborted = (x) => x.status === \"aborted\";\nexports.isAborted = isAborted;\nconst isDirty = (x) => x.status === \"dirty\";\nexports.isDirty = isDirty;\nconst isValid = (x) => x.status === \"valid\";\nexports.isValid = isValid;\nconst isAsync = (x) => typeof Promise !== \"undefined\" && x instanceof Promise;\nexports.isAsync = isAsync;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.errorUtil = void 0;\nvar errorUtil;\n(function (errorUtil) {\n errorUtil.errToObj = (message) => typeof message === \"string\" ? { message } : message || {};\n // biome-ignore lint:\n errorUtil.toString = (message) => typeof message === \"string\" ? message : message?.message;\n})(errorUtil || (exports.errorUtil = errorUtil = {}));\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.discriminatedUnion = exports.date = exports.boolean = exports.bigint = exports.array = exports.any = exports.coerce = exports.ZodFirstPartyTypeKind = exports.late = exports.ZodSchema = exports.Schema = exports.ZodReadonly = exports.ZodPipeline = exports.ZodBranded = exports.BRAND = exports.ZodNaN = exports.ZodCatch = exports.ZodDefault = exports.ZodNullable = exports.ZodOptional = exports.ZodTransformer = exports.ZodEffects = exports.ZodPromise = exports.ZodNativeEnum = exports.ZodEnum = exports.ZodLiteral = exports.ZodLazy = exports.ZodFunction = exports.ZodSet = exports.ZodMap = exports.ZodRecord = exports.ZodTuple = exports.ZodIntersection = exports.ZodDiscriminatedUnion = exports.ZodUnion = exports.ZodObject = exports.ZodArray = exports.ZodVoid = exports.ZodNever = exports.ZodUnknown = exports.ZodAny = exports.ZodNull = exports.ZodUndefined = exports.ZodSymbol = exports.ZodDate = exports.ZodBoolean = exports.ZodBigInt = exports.ZodNumber = exports.ZodString = exports.ZodType = void 0;\nexports.NEVER = exports.void = exports.unknown = exports.union = exports.undefined = exports.tuple = exports.transformer = exports.symbol = exports.string = exports.strictObject = exports.set = exports.record = exports.promise = exports.preprocess = exports.pipeline = exports.ostring = exports.optional = exports.onumber = exports.oboolean = exports.object = exports.number = exports.nullable = exports.null = exports.never = exports.nativeEnum = exports.nan = exports.map = exports.literal = exports.lazy = exports.intersection = exports.instanceof = exports.function = exports.enum = exports.effect = void 0;\nexports.datetimeRegex = datetimeRegex;\nexports.custom = custom;\nconst ZodError_js_1 = require(\"./ZodError.cjs\");\nconst errors_js_1 = require(\"./errors.cjs\");\nconst errorUtil_js_1 = require(\"./helpers/errorUtil.cjs\");\nconst parseUtil_js_1 = require(\"./helpers/parseUtil.cjs\");\nconst util_js_1 = require(\"./helpers/util.cjs\");\nclass ParseInputLazyPath {\n constructor(parent, value, path, key) {\n this._cachedPath = [];\n this.parent = parent;\n this.data = value;\n this._path = path;\n this._key = key;\n }\n get path() {\n if (!this._cachedPath.length) {\n if (Array.isArray(this._key)) {\n this._cachedPath.push(...this._path, ...this._key);\n }\n else {\n this._cachedPath.push(...this._path, this._key);\n }\n }\n return this._cachedPath;\n }\n}\nconst handleResult = (ctx, result) => {\n if ((0, parseUtil_js_1.isValid)(result)) {\n return { success: true, data: result.value };\n }\n else {\n if (!ctx.common.issues.length) {\n throw new Error(\"Validation failed but no issues detected.\");\n }\n return {\n success: false,\n get error() {\n if (this._error)\n return this._error;\n const error = new ZodError_js_1.ZodError(ctx.common.issues);\n this._error = error;\n return this._error;\n },\n };\n }\n};\nfunction processCreateParams(params) {\n if (!params)\n return {};\n const { errorMap, invalid_type_error, required_error, description } = params;\n if (errorMap && (invalid_type_error || required_error)) {\n throw new Error(`Can't use \"invalid_type_error\" or \"required_error\" in conjunction with custom error map.`);\n }\n if (errorMap)\n return { errorMap: errorMap, description };\n const customMap = (iss, ctx) => {\n const { message } = params;\n if (iss.code === \"invalid_enum_value\") {\n return { message: message ?? ctx.defaultError };\n }\n if (typeof ctx.data === \"undefined\") {\n return { message: message ?? required_error ?? ctx.defaultError };\n }\n if (iss.code !== \"invalid_type\")\n return { message: ctx.defaultError };\n return { message: message ?? invalid_type_error ?? ctx.defaultError };\n };\n return { errorMap: customMap, description };\n}\nclass ZodType {\n get description() {\n return this._def.description;\n }\n _getType(input) {\n return (0, util_js_1.getParsedType)(input.data);\n }\n _getOrReturnCtx(input, ctx) {\n return (ctx || {\n common: input.parent.common,\n data: input.data,\n parsedType: (0, util_js_1.getParsedType)(input.data),\n schemaErrorMap: this._def.errorMap,\n path: input.path,\n parent: input.parent,\n });\n }\n _processInputParams(input) {\n return {\n status: new parseUtil_js_1.ParseStatus(),\n ctx: {\n common: input.parent.common,\n data: input.data,\n parsedType: (0, util_js_1.getParsedType)(input.data),\n schemaErrorMap: this._def.errorMap,\n path: input.path,\n parent: input.parent,\n },\n };\n }\n _parseSync(input) {\n const result = this._parse(input);\n if ((0, parseUtil_js_1.isAsync)(result)) {\n throw new Error(\"Synchronous parse encountered promise.\");\n }\n return result;\n }\n _parseAsync(input) {\n const result = this._parse(input);\n return Promise.resolve(result);\n }\n parse(data, params) {\n const result = this.safeParse(data, params);\n if (result.success)\n return result.data;\n throw result.error;\n }\n safeParse(data, params) {\n const ctx = {\n common: {\n issues: [],\n async: params?.async ?? false,\n contextualErrorMap: params?.errorMap,\n },\n path: params?.path || [],\n schemaErrorMap: this._def.errorMap,\n parent: null,\n data,\n parsedType: (0, util_js_1.getParsedType)(data),\n };\n const result = this._parseSync({ data, path: ctx.path, parent: ctx });\n return handleResult(ctx, result);\n }\n \"~validate\"(data) {\n const ctx = {\n common: {\n issues: [],\n async: !!this[\"~standard\"].async,\n },\n path: [],\n schemaErrorMap: this._def.errorMap,\n parent: null,\n data,\n parsedType: (0, util_js_1.getParsedType)(data),\n };\n if (!this[\"~standard\"].async) {\n try {\n const result = this._parseSync({ data, path: [], parent: ctx });\n return (0, parseUtil_js_1.isValid)(result)\n ? {\n value: result.value,\n }\n : {\n issues: ctx.common.issues,\n };\n }\n catch (err) {\n if (err?.message?.toLowerCase()?.includes(\"encountered\")) {\n this[\"~standard\"].async = true;\n }\n ctx.common = {\n issues: [],\n async: true,\n };\n }\n }\n return this._parseAsync({ data, path: [], parent: ctx }).then((result) => (0, parseUtil_js_1.isValid)(result)\n ? {\n value: result.value,\n }\n : {\n issues: ctx.common.issues,\n });\n }\n async parseAsync(data, params) {\n const result = await this.safeParseAsync(data, params);\n if (result.success)\n return result.data;\n throw result.error;\n }\n async safeParseAsync(data, params) {\n const ctx = {\n common: {\n issues: [],\n contextualErrorMap: params?.errorMap,\n async: true,\n },\n path: params?.path || [],\n schemaErrorMap: this._def.errorMap,\n parent: null,\n data,\n parsedType: (0, util_js_1.getParsedType)(data),\n };\n const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx });\n const result = await ((0, parseUtil_js_1.isAsync)(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult));\n return handleResult(ctx, result);\n }\n refine(check, message) {\n const getIssueProperties = (val) => {\n if (typeof message === \"string\" || typeof message === \"undefined\") {\n return { message };\n }\n else if (typeof message === \"function\") {\n return message(val);\n }\n else {\n return message;\n }\n };\n return this._refinement((val, ctx) => {\n const result = check(val);\n const setError = () => ctx.addIssue({\n code: ZodError_js_1.ZodIssueCode.custom,\n ...getIssueProperties(val),\n });\n if (typeof Promise !== \"undefined\" && result instanceof Promise) {\n return result.then((data) => {\n if (!data) {\n setError();\n return false;\n }\n else {\n return true;\n }\n });\n }\n if (!result) {\n setError();\n return false;\n }\n else {\n return true;\n }\n });\n }\n refinement(check, refinementData) {\n return this._refinement((val, ctx) => {\n if (!check(val)) {\n ctx.addIssue(typeof refinementData === \"function\" ? refinementData(val, ctx) : refinementData);\n return false;\n }\n else {\n return true;\n }\n });\n }\n _refinement(refinement) {\n return new ZodEffects({\n schema: this,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect: { type: \"refinement\", refinement },\n });\n }\n superRefine(refinement) {\n return this._refinement(refinement);\n }\n constructor(def) {\n /** Alias of safeParseAsync */\n this.spa = this.safeParseAsync;\n this._def = def;\n this.parse = this.parse.bind(this);\n this.safeParse = this.safeParse.bind(this);\n this.parseAsync = this.parseAsync.bind(this);\n this.safeParseAsync = this.safeParseAsync.bind(this);\n this.spa = this.spa.bind(this);\n this.refine = this.refine.bind(this);\n this.refinement = this.refinement.bind(this);\n this.superRefine = this.superRefine.bind(this);\n this.optional = this.optional.bind(this);\n this.nullable = this.nullable.bind(this);\n this.nullish = this.nullish.bind(this);\n this.array = this.array.bind(this);\n this.promise = this.promise.bind(this);\n this.or = this.or.bind(this);\n this.and = this.and.bind(this);\n this.transform = this.transform.bind(this);\n this.brand = this.brand.bind(this);\n this.default = this.default.bind(this);\n this.catch = this.catch.bind(this);\n this.describe = this.describe.bind(this);\n this.pipe = this.pipe.bind(this);\n this.readonly = this.readonly.bind(this);\n this.isNullable = this.isNullable.bind(this);\n this.isOptional = this.isOptional.bind(this);\n this[\"~standard\"] = {\n version: 1,\n vendor: \"zod\",\n validate: (data) => this[\"~validate\"](data),\n };\n }\n optional() {\n return ZodOptional.create(this, this._def);\n }\n nullable() {\n return ZodNullable.create(this, this._def);\n }\n nullish() {\n return this.nullable().optional();\n }\n array() {\n return ZodArray.create(this);\n }\n promise() {\n return ZodPromise.create(this, this._def);\n }\n or(option) {\n return ZodUnion.create([this, option], this._def);\n }\n and(incoming) {\n return ZodIntersection.create(this, incoming, this._def);\n }\n transform(transform) {\n return new ZodEffects({\n ...processCreateParams(this._def),\n schema: this,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect: { type: \"transform\", transform },\n });\n }\n default(def) {\n const defaultValueFunc = typeof def === \"function\" ? def : () => def;\n return new ZodDefault({\n ...processCreateParams(this._def),\n innerType: this,\n defaultValue: defaultValueFunc,\n typeName: ZodFirstPartyTypeKind.ZodDefault,\n });\n }\n brand() {\n return new ZodBranded({\n typeName: ZodFirstPartyTypeKind.ZodBranded,\n type: this,\n ...processCreateParams(this._def),\n });\n }\n catch(def) {\n const catchValueFunc = typeof def === \"function\" ? def : () => def;\n return new ZodCatch({\n ...processCreateParams(this._def),\n innerType: this,\n catchValue: catchValueFunc,\n typeName: ZodFirstPartyTypeKind.ZodCatch,\n });\n }\n describe(description) {\n const This = this.constructor;\n return new This({\n ...this._def,\n description,\n });\n }\n pipe(target) {\n return ZodPipeline.create(this, target);\n }\n readonly() {\n return ZodReadonly.create(this);\n }\n isOptional() {\n return this.safeParse(undefined).success;\n }\n isNullable() {\n return this.safeParse(null).success;\n }\n}\nexports.ZodType = ZodType;\nexports.Schema = ZodType;\nexports.ZodSchema = ZodType;\nconst cuidRegex = /^c[^\\s-]{8,}$/i;\nconst cuid2Regex = /^[0-9a-z]+$/;\nconst ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/i;\n// const uuidRegex =\n// /^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i;\nconst uuidRegex = /^[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;\nconst nanoidRegex = /^[a-z0-9_-]{21}$/i;\nconst jwtRegex = /^[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]*$/;\nconst durationRegex = /^[-+]?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)?)??$/;\n// from https://stackoverflow.com/a/46181/1550155\n// old version: too slow, didn't support unicode\n// const emailRegex = /^((([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))$/i;\n//old email regex\n// const emailRegex = /^(([^<>()[\\].,;:\\s@\"]+(\\.[^<>()[\\].,;:\\s@\"]+)*)|(\".+\"))@((?!-)([^<>()[\\].,;:\\s@\"]+\\.)+[^<>()[\\].,;:\\s@\"]{1,})[^-<>()[\\].,;:\\s@\"]$/i;\n// eslint-disable-next-line\n// const emailRegex =\n// /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[(((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}))\\])|(\\[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})))\\])|([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*(\\.[A-Za-z]{2,})+))$/;\n// const emailRegex =\n// /^[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])?)*$/;\n// const emailRegex =\n// /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])$/i;\nconst emailRegex = /^(?!\\.)(?!.*\\.\\.)([A-Z0-9_'+\\-\\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\\-]*\\.)+[A-Z]{2,}$/i;\n// const emailRegex =\n// /^[a-z0-9.!#$%&\u2019*+/=?^_`{|}~-]+@[a-z0-9-]+(?:\\.[a-z0-9\\-]+)*$/i;\n// from https://thekevinscott.com/emojis-in-javascript/#writing-a-regular-expression\nconst _emojiRegex = `^(\\\\p{Extended_Pictographic}|\\\\p{Emoji_Component})+$`;\nlet emojiRegex;\n// faster, simpler, safer\nconst ipv4Regex = /^(?:(?: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])$/;\nconst ipv4CidrRegex = /^(?:(?: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])$/;\n// const ipv6Regex =\n// /^(([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})))$/;\nconst ipv6Regex = /^(([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]))$/;\nconst ipv6CidrRegex = /^(([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])$/;\n// https://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript\nconst base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;\n// https://base64.guru/standards/base64url\nconst base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;\n// simple\n// const dateRegexSource = `\\\\d{4}-\\\\d{2}-\\\\d{2}`;\n// no leap year validation\n// const dateRegexSource = `\\\\d{4}-((0[13578]|10|12)-31|(0[13-9]|1[0-2])-30|(0[1-9]|1[0-2])-(0[1-9]|1\\\\d|2\\\\d))`;\n// with leap year validation\nconst dateRegexSource = `((\\\\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])))`;\nconst dateRegex = new RegExp(`^${dateRegexSource}$`);\nfunction timeRegexSource(args) {\n let secondsRegexSource = `[0-5]\\\\d`;\n if (args.precision) {\n secondsRegexSource = `${secondsRegexSource}\\\\.\\\\d{${args.precision}}`;\n }\n else if (args.precision == null) {\n secondsRegexSource = `${secondsRegexSource}(\\\\.\\\\d+)?`;\n }\n const secondsQuantifier = args.precision ? \"+\" : \"?\"; // require seconds if precision is nonzero\n return `([01]\\\\d|2[0-3]):[0-5]\\\\d(:${secondsRegexSource})${secondsQuantifier}`;\n}\nfunction timeRegex(args) {\n return new RegExp(`^${timeRegexSource(args)}$`);\n}\n// Adapted from https://stackoverflow.com/a/3143231\nfunction datetimeRegex(args) {\n let regex = `${dateRegexSource}T${timeRegexSource(args)}`;\n const opts = [];\n opts.push(args.local ? `Z?` : `Z`);\n if (args.offset)\n opts.push(`([+-]\\\\d{2}:?\\\\d{2})`);\n regex = `${regex}(${opts.join(\"|\")})`;\n return new RegExp(`^${regex}$`);\n}\nfunction isValidIP(ip, version) {\n if ((version === \"v4\" || !version) && ipv4Regex.test(ip)) {\n return true;\n }\n if ((version === \"v6\" || !version) && ipv6Regex.test(ip)) {\n return true;\n }\n return false;\n}\nfunction isValidJWT(jwt, alg) {\n if (!jwtRegex.test(jwt))\n return false;\n try {\n const [header] = jwt.split(\".\");\n if (!header)\n return false;\n // Convert base64url to base64\n const base64 = header\n .replace(/-/g, \"+\")\n .replace(/_/g, \"/\")\n .padEnd(header.length + ((4 - (header.length % 4)) % 4), \"=\");\n const decoded = JSON.parse(atob(base64));\n if (typeof decoded !== \"object\" || decoded === null)\n return false;\n if (\"typ\" in decoded && decoded?.typ !== \"JWT\")\n return false;\n if (!decoded.alg)\n return false;\n if (alg && decoded.alg !== alg)\n return false;\n return true;\n }\n catch {\n return false;\n }\n}\nfunction isValidCidr(ip, version) {\n if ((version === \"v4\" || !version) && ipv4CidrRegex.test(ip)) {\n return true;\n }\n if ((version === \"v6\" || !version) && ipv6CidrRegex.test(ip)) {\n return true;\n }\n return false;\n}\nclass ZodString extends ZodType {\n _parse(input) {\n if (this._def.coerce) {\n input.data = String(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== util_js_1.ZodParsedType.string) {\n const ctx = this._getOrReturnCtx(input);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n expected: util_js_1.ZodParsedType.string,\n received: ctx.parsedType,\n });\n return parseUtil_js_1.INVALID;\n }\n const status = new parseUtil_js_1.ParseStatus();\n let ctx = undefined;\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n if (input.data.length < check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.too_small,\n minimum: check.value,\n type: \"string\",\n inclusive: true,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n if (input.data.length > check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.too_big,\n maximum: check.value,\n type: \"string\",\n inclusive: true,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"length\") {\n const tooBig = input.data.length > check.value;\n const tooSmall = input.data.length < check.value;\n if (tooBig || tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n if (tooBig) {\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.too_big,\n maximum: check.value,\n type: \"string\",\n inclusive: true,\n exact: true,\n message: check.message,\n });\n }\n else if (tooSmall) {\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.too_small,\n minimum: check.value,\n type: \"string\",\n inclusive: true,\n exact: true,\n message: check.message,\n });\n }\n status.dirty();\n }\n }\n else if (check.kind === \"email\") {\n if (!emailRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n validation: \"email\",\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"emoji\") {\n if (!emojiRegex) {\n emojiRegex = new RegExp(_emojiRegex, \"u\");\n }\n if (!emojiRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n validation: \"emoji\",\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"uuid\") {\n if (!uuidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n validation: \"uuid\",\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"nanoid\") {\n if (!nanoidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n validation: \"nanoid\",\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"cuid\") {\n if (!cuidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n validation: \"cuid\",\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"cuid2\") {\n if (!cuid2Regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n validation: \"cuid2\",\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"ulid\") {\n if (!ulidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n validation: \"ulid\",\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"url\") {\n try {\n new URL(input.data);\n }\n catch {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n validation: \"url\",\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"regex\") {\n check.regex.lastIndex = 0;\n const testResult = check.regex.test(input.data);\n if (!testResult) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n validation: \"regex\",\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"trim\") {\n input.data = input.data.trim();\n }\n else if (check.kind === \"includes\") {\n if (!input.data.includes(check.value, check.position)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n validation: { includes: check.value, position: check.position },\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"toLowerCase\") {\n input.data = input.data.toLowerCase();\n }\n else if (check.kind === \"toUpperCase\") {\n input.data = input.data.toUpperCase();\n }\n else if (check.kind === \"startsWith\") {\n if (!input.data.startsWith(check.value)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n validation: { startsWith: check.value },\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"endsWith\") {\n if (!input.data.endsWith(check.value)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n validation: { endsWith: check.value },\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"datetime\") {\n const regex = datetimeRegex(check);\n if (!regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n validation: \"datetime\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"date\") {\n const regex = dateRegex;\n if (!regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n validation: \"date\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"time\") {\n const regex = timeRegex(check);\n if (!regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n validation: \"time\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"duration\") {\n if (!durationRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n validation: \"duration\",\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"ip\") {\n if (!isValidIP(input.data, check.version)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n validation: \"ip\",\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"jwt\") {\n if (!isValidJWT(input.data, check.alg)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n validation: \"jwt\",\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"cidr\") {\n if (!isValidCidr(input.data, check.version)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n validation: \"cidr\",\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"base64\") {\n if (!base64Regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n validation: \"base64\",\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"base64url\") {\n if (!base64urlRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n validation: \"base64url\",\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else {\n util_js_1.util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n _regex(regex, validation, message) {\n return this.refinement((data) => regex.test(data), {\n validation,\n code: ZodError_js_1.ZodIssueCode.invalid_string,\n ...errorUtil_js_1.errorUtil.errToObj(message),\n });\n }\n _addCheck(check) {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n email(message) {\n return this._addCheck({ kind: \"email\", ...errorUtil_js_1.errorUtil.errToObj(message) });\n }\n url(message) {\n return this._addCheck({ kind: \"url\", ...errorUtil_js_1.errorUtil.errToObj(message) });\n }\n emoji(message) {\n return this._addCheck({ kind: \"emoji\", ...errorUtil_js_1.errorUtil.errToObj(message) });\n }\n uuid(message) {\n return this._addCheck({ kind: \"uuid\", ...errorUtil_js_1.errorUtil.errToObj(message) });\n }\n nanoid(message) {\n return this._addCheck({ kind: \"nanoid\", ...errorUtil_js_1.errorUtil.errToObj(message) });\n }\n cuid(message) {\n return this._addCheck({ kind: \"cuid\", ...errorUtil_js_1.errorUtil.errToObj(message) });\n }\n cuid2(message) {\n return this._addCheck({ kind: \"cuid2\", ...errorUtil_js_1.errorUtil.errToObj(message) });\n }\n ulid(message) {\n return this._addCheck({ kind: \"ulid\", ...errorUtil_js_1.errorUtil.errToObj(message) });\n }\n base64(message) {\n return this._addCheck({ kind: \"base64\", ...errorUtil_js_1.errorUtil.errToObj(message) });\n }\n base64url(message) {\n // base64url encoding is a modification of base64 that can safely be used in URLs and filenames\n return this._addCheck({\n kind: \"base64url\",\n ...errorUtil_js_1.errorUtil.errToObj(message),\n });\n }\n jwt(options) {\n return this._addCheck({ kind: \"jwt\", ...errorUtil_js_1.errorUtil.errToObj(options) });\n }\n ip(options) {\n return this._addCheck({ kind: \"ip\", ...errorUtil_js_1.errorUtil.errToObj(options) });\n }\n cidr(options) {\n return this._addCheck({ kind: \"cidr\", ...errorUtil_js_1.errorUtil.errToObj(options) });\n }\n datetime(options) {\n if (typeof options === \"string\") {\n return this._addCheck({\n kind: \"datetime\",\n precision: null,\n offset: false,\n local: false,\n message: options,\n });\n }\n return this._addCheck({\n kind: \"datetime\",\n precision: typeof options?.precision === \"undefined\" ? null : options?.precision,\n offset: options?.offset ?? false,\n local: options?.local ?? false,\n ...errorUtil_js_1.errorUtil.errToObj(options?.message),\n });\n }\n date(message) {\n return this._addCheck({ kind: \"date\", message });\n }\n time(options) {\n if (typeof options === \"string\") {\n return this._addCheck({\n kind: \"time\",\n precision: null,\n message: options,\n });\n }\n return this._addCheck({\n kind: \"time\",\n precision: typeof options?.precision === \"undefined\" ? null : options?.precision,\n ...errorUtil_js_1.errorUtil.errToObj(options?.message),\n });\n }\n duration(message) {\n return this._addCheck({ kind: \"duration\", ...errorUtil_js_1.errorUtil.errToObj(message) });\n }\n regex(regex, message) {\n return this._addCheck({\n kind: \"regex\",\n regex: regex,\n ...errorUtil_js_1.errorUtil.errToObj(message),\n });\n }\n includes(value, options) {\n return this._addCheck({\n kind: \"includes\",\n value: value,\n position: options?.position,\n ...errorUtil_js_1.errorUtil.errToObj(options?.message),\n });\n }\n startsWith(value, message) {\n return this._addCheck({\n kind: \"startsWith\",\n value: value,\n ...errorUtil_js_1.errorUtil.errToObj(message),\n });\n }\n endsWith(value, message) {\n return this._addCheck({\n kind: \"endsWith\",\n value: value,\n ...errorUtil_js_1.errorUtil.errToObj(message),\n });\n }\n min(minLength, message) {\n return this._addCheck({\n kind: \"min\",\n value: minLength,\n ...errorUtil_js_1.errorUtil.errToObj(message),\n });\n }\n max(maxLength, message) {\n return this._addCheck({\n kind: \"max\",\n value: maxLength,\n ...errorUtil_js_1.errorUtil.errToObj(message),\n });\n }\n length(len, message) {\n return this._addCheck({\n kind: \"length\",\n value: len,\n ...errorUtil_js_1.errorUtil.errToObj(message),\n });\n }\n /**\n * Equivalent to `.min(1)`\n */\n nonempty(message) {\n return this.min(1, errorUtil_js_1.errorUtil.errToObj(message));\n }\n trim() {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"trim\" }],\n });\n }\n toLowerCase() {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"toLowerCase\" }],\n });\n }\n toUpperCase() {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"toUpperCase\" }],\n });\n }\n get isDatetime() {\n return !!this._def.checks.find((ch) => ch.kind === \"datetime\");\n }\n get isDate() {\n return !!this._def.checks.find((ch) => ch.kind === \"date\");\n }\n get isTime() {\n return !!this._def.checks.find((ch) => ch.kind === \"time\");\n }\n get isDuration() {\n return !!this._def.checks.find((ch) => ch.kind === \"duration\");\n }\n get isEmail() {\n return !!this._def.checks.find((ch) => ch.kind === \"email\");\n }\n get isURL() {\n return !!this._def.checks.find((ch) => ch.kind === \"url\");\n }\n get isEmoji() {\n return !!this._def.checks.find((ch) => ch.kind === \"emoji\");\n }\n get isUUID() {\n return !!this._def.checks.find((ch) => ch.kind === \"uuid\");\n }\n get isNANOID() {\n return !!this._def.checks.find((ch) => ch.kind === \"nanoid\");\n }\n get isCUID() {\n return !!this._def.checks.find((ch) => ch.kind === \"cuid\");\n }\n get isCUID2() {\n return !!this._def.checks.find((ch) => ch.kind === \"cuid2\");\n }\n get isULID() {\n return !!this._def.checks.find((ch) => ch.kind === \"ulid\");\n }\n get isIP() {\n return !!this._def.checks.find((ch) => ch.kind === \"ip\");\n }\n get isCIDR() {\n return !!this._def.checks.find((ch) => ch.kind === \"cidr\");\n }\n get isBase64() {\n return !!this._def.checks.find((ch) => ch.kind === \"base64\");\n }\n get isBase64url() {\n // base64url encoding is a modification of base64 that can safely be used in URLs and filenames\n return !!this._def.checks.find((ch) => ch.kind === \"base64url\");\n }\n get minLength() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxLength() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n}\nexports.ZodString = ZodString;\nZodString.create = (params) => {\n return new ZodString({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodString,\n coerce: params?.coerce ?? false,\n ...processCreateParams(params),\n });\n};\n// https://stackoverflow.com/questions/3966484/why-does-modulus-operator-return-fractional-number-in-javascript/31711034#31711034\nfunction floatSafeRemainder(val, step) {\n const valDecCount = (val.toString().split(\".\")[1] || \"\").length;\n const stepDecCount = (step.toString().split(\".\")[1] || \"\").length;\n const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;\n const valInt = Number.parseInt(val.toFixed(decCount).replace(\".\", \"\"));\n const stepInt = Number.parseInt(step.toFixed(decCount).replace(\".\", \"\"));\n return (valInt % stepInt) / 10 ** decCount;\n}\nclass ZodNumber extends ZodType {\n constructor() {\n super(...arguments);\n this.min = this.gte;\n this.max = this.lte;\n this.step = this.multipleOf;\n }\n _parse(input) {\n if (this._def.coerce) {\n input.data = Number(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== util_js_1.ZodParsedType.number) {\n const ctx = this._getOrReturnCtx(input);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n expected: util_js_1.ZodParsedType.number,\n received: ctx.parsedType,\n });\n return parseUtil_js_1.INVALID;\n }\n let ctx = undefined;\n const status = new parseUtil_js_1.ParseStatus();\n for (const check of this._def.checks) {\n if (check.kind === \"int\") {\n if (!util_js_1.util.isInteger(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n expected: \"integer\",\n received: \"float\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"min\") {\n const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;\n if (tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.too_small,\n minimum: check.value,\n type: \"number\",\n inclusive: check.inclusive,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;\n if (tooBig) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.too_big,\n maximum: check.value,\n type: \"number\",\n inclusive: check.inclusive,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"multipleOf\") {\n if (floatSafeRemainder(input.data, check.value) !== 0) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.not_multiple_of,\n multipleOf: check.value,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"finite\") {\n if (!Number.isFinite(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.not_finite,\n message: check.message,\n });\n status.dirty();\n }\n }\n else {\n util_js_1.util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n gte(value, message) {\n return this.setLimit(\"min\", value, true, errorUtil_js_1.errorUtil.toString(message));\n }\n gt(value, message) {\n return this.setLimit(\"min\", value, false, errorUtil_js_1.errorUtil.toString(message));\n }\n lte(value, message) {\n return this.setLimit(\"max\", value, true, errorUtil_js_1.errorUtil.toString(message));\n }\n lt(value, message) {\n return this.setLimit(\"max\", value, false, errorUtil_js_1.errorUtil.toString(message));\n }\n setLimit(kind, value, inclusive, message) {\n return new ZodNumber({\n ...this._def,\n checks: [\n ...this._def.checks,\n {\n kind,\n value,\n inclusive,\n message: errorUtil_js_1.errorUtil.toString(message),\n },\n ],\n });\n }\n _addCheck(check) {\n return new ZodNumber({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n int(message) {\n return this._addCheck({\n kind: \"int\",\n message: errorUtil_js_1.errorUtil.toString(message),\n });\n }\n positive(message) {\n return this._addCheck({\n kind: \"min\",\n value: 0,\n inclusive: false,\n message: errorUtil_js_1.errorUtil.toString(message),\n });\n }\n negative(message) {\n return this._addCheck({\n kind: \"max\",\n value: 0,\n inclusive: false,\n message: errorUtil_js_1.errorUtil.toString(message),\n });\n }\n nonpositive(message) {\n return this._addCheck({\n kind: \"max\",\n value: 0,\n inclusive: true,\n message: errorUtil_js_1.errorUtil.toString(message),\n });\n }\n nonnegative(message) {\n return this._addCheck({\n kind: \"min\",\n value: 0,\n inclusive: true,\n message: errorUtil_js_1.errorUtil.toString(message),\n });\n }\n multipleOf(value, message) {\n return this._addCheck({\n kind: \"multipleOf\",\n value: value,\n message: errorUtil_js_1.errorUtil.toString(message),\n });\n }\n finite(message) {\n return this._addCheck({\n kind: \"finite\",\n message: errorUtil_js_1.errorUtil.toString(message),\n });\n }\n safe(message) {\n return this._addCheck({\n kind: \"min\",\n inclusive: true,\n value: Number.MIN_SAFE_INTEGER,\n message: errorUtil_js_1.errorUtil.toString(message),\n })._addCheck({\n kind: \"max\",\n inclusive: true,\n value: Number.MAX_SAFE_INTEGER,\n message: errorUtil_js_1.errorUtil.toString(message),\n });\n }\n get minValue() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxValue() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n get isInt() {\n return !!this._def.checks.find((ch) => ch.kind === \"int\" || (ch.kind === \"multipleOf\" && util_js_1.util.isInteger(ch.value)));\n }\n get isFinite() {\n let max = null;\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"finite\" || ch.kind === \"int\" || ch.kind === \"multipleOf\") {\n return true;\n }\n else if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n else if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return Number.isFinite(min) && Number.isFinite(max);\n }\n}\nexports.ZodNumber = ZodNumber;\nZodNumber.create = (params) => {\n return new ZodNumber({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodNumber,\n coerce: params?.coerce || false,\n ...processCreateParams(params),\n });\n};\nclass ZodBigInt extends ZodType {\n constructor() {\n super(...arguments);\n this.min = this.gte;\n this.max = this.lte;\n }\n _parse(input) {\n if (this._def.coerce) {\n try {\n input.data = BigInt(input.data);\n }\n catch {\n return this._getInvalidInput(input);\n }\n }\n const parsedType = this._getType(input);\n if (parsedType !== util_js_1.ZodParsedType.bigint) {\n return this._getInvalidInput(input);\n }\n let ctx = undefined;\n const status = new parseUtil_js_1.ParseStatus();\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;\n if (tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.too_small,\n type: \"bigint\",\n minimum: check.value,\n inclusive: check.inclusive,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;\n if (tooBig) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.too_big,\n type: \"bigint\",\n maximum: check.value,\n inclusive: check.inclusive,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"multipleOf\") {\n if (input.data % check.value !== BigInt(0)) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.not_multiple_of,\n multipleOf: check.value,\n message: check.message,\n });\n status.dirty();\n }\n }\n else {\n util_js_1.util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n _getInvalidInput(input) {\n const ctx = this._getOrReturnCtx(input);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n expected: util_js_1.ZodParsedType.bigint,\n received: ctx.parsedType,\n });\n return parseUtil_js_1.INVALID;\n }\n gte(value, message) {\n return this.setLimit(\"min\", value, true, errorUtil_js_1.errorUtil.toString(message));\n }\n gt(value, message) {\n return this.setLimit(\"min\", value, false, errorUtil_js_1.errorUtil.toString(message));\n }\n lte(value, message) {\n return this.setLimit(\"max\", value, true, errorUtil_js_1.errorUtil.toString(message));\n }\n lt(value, message) {\n return this.setLimit(\"max\", value, false, errorUtil_js_1.errorUtil.toString(message));\n }\n setLimit(kind, value, inclusive, message) {\n return new ZodBigInt({\n ...this._def,\n checks: [\n ...this._def.checks,\n {\n kind,\n value,\n inclusive,\n message: errorUtil_js_1.errorUtil.toString(message),\n },\n ],\n });\n }\n _addCheck(check) {\n return new ZodBigInt({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n positive(message) {\n return this._addCheck({\n kind: \"min\",\n value: BigInt(0),\n inclusive: false,\n message: errorUtil_js_1.errorUtil.toString(message),\n });\n }\n negative(message) {\n return this._addCheck({\n kind: \"max\",\n value: BigInt(0),\n inclusive: false,\n message: errorUtil_js_1.errorUtil.toString(message),\n });\n }\n nonpositive(message) {\n return this._addCheck({\n kind: \"max\",\n value: BigInt(0),\n inclusive: true,\n message: errorUtil_js_1.errorUtil.toString(message),\n });\n }\n nonnegative(message) {\n return this._addCheck({\n kind: \"min\",\n value: BigInt(0),\n inclusive: true,\n message: errorUtil_js_1.errorUtil.toString(message),\n });\n }\n multipleOf(value, message) {\n return this._addCheck({\n kind: \"multipleOf\",\n value,\n message: errorUtil_js_1.errorUtil.toString(message),\n });\n }\n get minValue() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxValue() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n}\nexports.ZodBigInt = ZodBigInt;\nZodBigInt.create = (params) => {\n return new ZodBigInt({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodBigInt,\n coerce: params?.coerce ?? false,\n ...processCreateParams(params),\n });\n};\nclass ZodBoolean extends ZodType {\n _parse(input) {\n if (this._def.coerce) {\n input.data = Boolean(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== util_js_1.ZodParsedType.boolean) {\n const ctx = this._getOrReturnCtx(input);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n expected: util_js_1.ZodParsedType.boolean,\n received: ctx.parsedType,\n });\n return parseUtil_js_1.INVALID;\n }\n return (0, parseUtil_js_1.OK)(input.data);\n }\n}\nexports.ZodBoolean = ZodBoolean;\nZodBoolean.create = (params) => {\n return new ZodBoolean({\n typeName: ZodFirstPartyTypeKind.ZodBoolean,\n coerce: params?.coerce || false,\n ...processCreateParams(params),\n });\n};\nclass ZodDate extends ZodType {\n _parse(input) {\n if (this._def.coerce) {\n input.data = new Date(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== util_js_1.ZodParsedType.date) {\n const ctx = this._getOrReturnCtx(input);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n expected: util_js_1.ZodParsedType.date,\n received: ctx.parsedType,\n });\n return parseUtil_js_1.INVALID;\n }\n if (Number.isNaN(input.data.getTime())) {\n const ctx = this._getOrReturnCtx(input);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_date,\n });\n return parseUtil_js_1.INVALID;\n }\n const status = new parseUtil_js_1.ParseStatus();\n let ctx = undefined;\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n if (input.data.getTime() < check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.too_small,\n message: check.message,\n inclusive: true,\n exact: false,\n minimum: check.value,\n type: \"date\",\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n if (input.data.getTime() > check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.too_big,\n message: check.message,\n inclusive: true,\n exact: false,\n maximum: check.value,\n type: \"date\",\n });\n status.dirty();\n }\n }\n else {\n util_js_1.util.assertNever(check);\n }\n }\n return {\n status: status.value,\n value: new Date(input.data.getTime()),\n };\n }\n _addCheck(check) {\n return new ZodDate({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n min(minDate, message) {\n return this._addCheck({\n kind: \"min\",\n value: minDate.getTime(),\n message: errorUtil_js_1.errorUtil.toString(message),\n });\n }\n max(maxDate, message) {\n return this._addCheck({\n kind: \"max\",\n value: maxDate.getTime(),\n message: errorUtil_js_1.errorUtil.toString(message),\n });\n }\n get minDate() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min != null ? new Date(min) : null;\n }\n get maxDate() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max != null ? new Date(max) : null;\n }\n}\nexports.ZodDate = ZodDate;\nZodDate.create = (params) => {\n return new ZodDate({\n checks: [],\n coerce: params?.coerce || false,\n typeName: ZodFirstPartyTypeKind.ZodDate,\n ...processCreateParams(params),\n });\n};\nclass ZodSymbol extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== util_js_1.ZodParsedType.symbol) {\n const ctx = this._getOrReturnCtx(input);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n expected: util_js_1.ZodParsedType.symbol,\n received: ctx.parsedType,\n });\n return parseUtil_js_1.INVALID;\n }\n return (0, parseUtil_js_1.OK)(input.data);\n }\n}\nexports.ZodSymbol = ZodSymbol;\nZodSymbol.create = (params) => {\n return new ZodSymbol({\n typeName: ZodFirstPartyTypeKind.ZodSymbol,\n ...processCreateParams(params),\n });\n};\nclass ZodUndefined extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== util_js_1.ZodParsedType.undefined) {\n const ctx = this._getOrReturnCtx(input);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n expected: util_js_1.ZodParsedType.undefined,\n received: ctx.parsedType,\n });\n return parseUtil_js_1.INVALID;\n }\n return (0, parseUtil_js_1.OK)(input.data);\n }\n}\nexports.ZodUndefined = ZodUndefined;\nZodUndefined.create = (params) => {\n return new ZodUndefined({\n typeName: ZodFirstPartyTypeKind.ZodUndefined,\n ...processCreateParams(params),\n });\n};\nclass ZodNull extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== util_js_1.ZodParsedType.null) {\n const ctx = this._getOrReturnCtx(input);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n expected: util_js_1.ZodParsedType.null,\n received: ctx.parsedType,\n });\n return parseUtil_js_1.INVALID;\n }\n return (0, parseUtil_js_1.OK)(input.data);\n }\n}\nexports.ZodNull = ZodNull;\nZodNull.create = (params) => {\n return new ZodNull({\n typeName: ZodFirstPartyTypeKind.ZodNull,\n ...processCreateParams(params),\n });\n};\nclass ZodAny extends ZodType {\n constructor() {\n super(...arguments);\n // to prevent instances of other classes from extending ZodAny. this causes issues with catchall in ZodObject.\n this._any = true;\n }\n _parse(input) {\n return (0, parseUtil_js_1.OK)(input.data);\n }\n}\nexports.ZodAny = ZodAny;\nZodAny.create = (params) => {\n return new ZodAny({\n typeName: ZodFirstPartyTypeKind.ZodAny,\n ...processCreateParams(params),\n });\n};\nclass ZodUnknown extends ZodType {\n constructor() {\n super(...arguments);\n // required\n this._unknown = true;\n }\n _parse(input) {\n return (0, parseUtil_js_1.OK)(input.data);\n }\n}\nexports.ZodUnknown = ZodUnknown;\nZodUnknown.create = (params) => {\n return new ZodUnknown({\n typeName: ZodFirstPartyTypeKind.ZodUnknown,\n ...processCreateParams(params),\n });\n};\nclass ZodNever extends ZodType {\n _parse(input) {\n const ctx = this._getOrReturnCtx(input);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n expected: util_js_1.ZodParsedType.never,\n received: ctx.parsedType,\n });\n return parseUtil_js_1.INVALID;\n }\n}\nexports.ZodNever = ZodNever;\nZodNever.create = (params) => {\n return new ZodNever({\n typeName: ZodFirstPartyTypeKind.ZodNever,\n ...processCreateParams(params),\n });\n};\nclass ZodVoid extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== util_js_1.ZodParsedType.undefined) {\n const ctx = this._getOrReturnCtx(input);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n expected: util_js_1.ZodParsedType.void,\n received: ctx.parsedType,\n });\n return parseUtil_js_1.INVALID;\n }\n return (0, parseUtil_js_1.OK)(input.data);\n }\n}\nexports.ZodVoid = ZodVoid;\nZodVoid.create = (params) => {\n return new ZodVoid({\n typeName: ZodFirstPartyTypeKind.ZodVoid,\n ...processCreateParams(params),\n });\n};\nclass ZodArray extends ZodType {\n _parse(input) {\n const { ctx, status } = this._processInputParams(input);\n const def = this._def;\n if (ctx.parsedType !== util_js_1.ZodParsedType.array) {\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n expected: util_js_1.ZodParsedType.array,\n received: ctx.parsedType,\n });\n return parseUtil_js_1.INVALID;\n }\n if (def.exactLength !== null) {\n const tooBig = ctx.data.length > def.exactLength.value;\n const tooSmall = ctx.data.length < def.exactLength.value;\n if (tooBig || tooSmall) {\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: tooBig ? ZodError_js_1.ZodIssueCode.too_big : ZodError_js_1.ZodIssueCode.too_small,\n minimum: (tooSmall ? def.exactLength.value : undefined),\n maximum: (tooBig ? def.exactLength.value : undefined),\n type: \"array\",\n inclusive: true,\n exact: true,\n message: def.exactLength.message,\n });\n status.dirty();\n }\n }\n if (def.minLength !== null) {\n if (ctx.data.length < def.minLength.value) {\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.too_small,\n minimum: def.minLength.value,\n type: \"array\",\n inclusive: true,\n exact: false,\n message: def.minLength.message,\n });\n status.dirty();\n }\n }\n if (def.maxLength !== null) {\n if (ctx.data.length > def.maxLength.value) {\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.too_big,\n maximum: def.maxLength.value,\n type: \"array\",\n inclusive: true,\n exact: false,\n message: def.maxLength.message,\n });\n status.dirty();\n }\n }\n if (ctx.common.async) {\n return Promise.all([...ctx.data].map((item, i) => {\n return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));\n })).then((result) => {\n return parseUtil_js_1.ParseStatus.mergeArray(status, result);\n });\n }\n const result = [...ctx.data].map((item, i) => {\n return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));\n });\n return parseUtil_js_1.ParseStatus.mergeArray(status, result);\n }\n get element() {\n return this._def.type;\n }\n min(minLength, message) {\n return new ZodArray({\n ...this._def,\n minLength: { value: minLength, message: errorUtil_js_1.errorUtil.toString(message) },\n });\n }\n max(maxLength, message) {\n return new ZodArray({\n ...this._def,\n maxLength: { value: maxLength, message: errorUtil_js_1.errorUtil.toString(message) },\n });\n }\n length(len, message) {\n return new ZodArray({\n ...this._def,\n exactLength: { value: len, message: errorUtil_js_1.errorUtil.toString(message) },\n });\n }\n nonempty(message) {\n return this.min(1, message);\n }\n}\nexports.ZodArray = ZodArray;\nZodArray.create = (schema, params) => {\n return new ZodArray({\n type: schema,\n minLength: null,\n maxLength: null,\n exactLength: null,\n typeName: ZodFirstPartyTypeKind.ZodArray,\n ...processCreateParams(params),\n });\n};\nfunction deepPartialify(schema) {\n if (schema instanceof ZodObject) {\n const newShape = {};\n for (const key in schema.shape) {\n const fieldSchema = schema.shape[key];\n newShape[key] = ZodOptional.create(deepPartialify(fieldSchema));\n }\n return new ZodObject({\n ...schema._def,\n shape: () => newShape,\n });\n }\n else if (schema instanceof ZodArray) {\n return new ZodArray({\n ...schema._def,\n type: deepPartialify(schema.element),\n });\n }\n else if (schema instanceof ZodOptional) {\n return ZodOptional.create(deepPartialify(schema.unwrap()));\n }\n else if (schema instanceof ZodNullable) {\n return ZodNullable.create(deepPartialify(schema.unwrap()));\n }\n else if (schema instanceof ZodTuple) {\n return ZodTuple.create(schema.items.map((item) => deepPartialify(item)));\n }\n else {\n return schema;\n }\n}\nclass ZodObject extends ZodType {\n constructor() {\n super(...arguments);\n this._cached = null;\n /**\n * @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped.\n * If you want to pass through unknown properties, use `.passthrough()` instead.\n */\n this.nonstrict = this.passthrough;\n // extend<\n // Augmentation extends ZodRawShape,\n // NewOutput extends util.flatten<{\n // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation\n // ? Augmentation[k][\"_output\"]\n // : k extends keyof Output\n // ? Output[k]\n // : never;\n // }>,\n // NewInput extends util.flatten<{\n // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation\n // ? Augmentation[k][\"_input\"]\n // : k extends keyof Input\n // ? Input[k]\n // : never;\n // }>\n // >(\n // augmentation: Augmentation\n // ): ZodObject<\n // extendShape<T, Augmentation>,\n // UnknownKeys,\n // Catchall,\n // NewOutput,\n // NewInput\n // > {\n // return new ZodObject({\n // ...this._def,\n // shape: () => ({\n // ...this._def.shape(),\n // ...augmentation,\n // }),\n // }) as any;\n // }\n /**\n * @deprecated Use `.extend` instead\n * */\n this.augment = this.extend;\n }\n _getCached() {\n if (this._cached !== null)\n return this._cached;\n const shape = this._def.shape();\n const keys = util_js_1.util.objectKeys(shape);\n this._cached = { shape, keys };\n return this._cached;\n }\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== util_js_1.ZodParsedType.object) {\n const ctx = this._getOrReturnCtx(input);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n expected: util_js_1.ZodParsedType.object,\n received: ctx.parsedType,\n });\n return parseUtil_js_1.INVALID;\n }\n const { status, ctx } = this._processInputParams(input);\n const { shape, keys: shapeKeys } = this._getCached();\n const extraKeys = [];\n if (!(this._def.catchall instanceof ZodNever && this._def.unknownKeys === \"strip\")) {\n for (const key in ctx.data) {\n if (!shapeKeys.includes(key)) {\n extraKeys.push(key);\n }\n }\n }\n const pairs = [];\n for (const key of shapeKeys) {\n const keyValidator = shape[key];\n const value = ctx.data[key];\n pairs.push({\n key: { status: \"valid\", value: key },\n value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),\n alwaysSet: key in ctx.data,\n });\n }\n if (this._def.catchall instanceof ZodNever) {\n const unknownKeys = this._def.unknownKeys;\n if (unknownKeys === \"passthrough\") {\n for (const key of extraKeys) {\n pairs.push({\n key: { status: \"valid\", value: key },\n value: { status: \"valid\", value: ctx.data[key] },\n });\n }\n }\n else if (unknownKeys === \"strict\") {\n if (extraKeys.length > 0) {\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.unrecognized_keys,\n keys: extraKeys,\n });\n status.dirty();\n }\n }\n else if (unknownKeys === \"strip\") {\n }\n else {\n throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);\n }\n }\n else {\n // run catchall validation\n const catchall = this._def.catchall;\n for (const key of extraKeys) {\n const value = ctx.data[key];\n pairs.push({\n key: { status: \"valid\", value: key },\n value: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key) //, ctx.child(key), value, getParsedType(value)\n ),\n alwaysSet: key in ctx.data,\n });\n }\n }\n if (ctx.common.async) {\n return Promise.resolve()\n .then(async () => {\n const syncPairs = [];\n for (const pair of pairs) {\n const key = await pair.key;\n const value = await pair.value;\n syncPairs.push({\n key,\n value,\n alwaysSet: pair.alwaysSet,\n });\n }\n return syncPairs;\n })\n .then((syncPairs) => {\n return parseUtil_js_1.ParseStatus.mergeObjectSync(status, syncPairs);\n });\n }\n else {\n return parseUtil_js_1.ParseStatus.mergeObjectSync(status, pairs);\n }\n }\n get shape() {\n return this._def.shape();\n }\n strict(message) {\n errorUtil_js_1.errorUtil.errToObj;\n return new ZodObject({\n ...this._def,\n unknownKeys: \"strict\",\n ...(message !== undefined\n ? {\n errorMap: (issue, ctx) => {\n const defaultError = this._def.errorMap?.(issue, ctx).message ?? ctx.defaultError;\n if (issue.code === \"unrecognized_keys\")\n return {\n message: errorUtil_js_1.errorUtil.errToObj(message).message ?? defaultError,\n };\n return {\n message: defaultError,\n };\n },\n }\n : {}),\n });\n }\n strip() {\n return new ZodObject({\n ...this._def,\n unknownKeys: \"strip\",\n });\n }\n passthrough() {\n return new ZodObject({\n ...this._def,\n unknownKeys: \"passthrough\",\n });\n }\n // const AugmentFactory =\n // <Def extends ZodObjectDef>(def: Def) =>\n // <Augmentation extends ZodRawShape>(\n // augmentation: Augmentation\n // ): ZodObject<\n // extendShape<ReturnType<Def[\"shape\"]>, Augmentation>,\n // Def[\"unknownKeys\"],\n // Def[\"catchall\"]\n // > => {\n // return new ZodObject({\n // ...def,\n // shape: () => ({\n // ...def.shape(),\n // ...augmentation,\n // }),\n // }) as any;\n // };\n extend(augmentation) {\n return new ZodObject({\n ...this._def,\n shape: () => ({\n ...this._def.shape(),\n ...augmentation,\n }),\n });\n }\n /**\n * Prior to zod@1.0.12 there was a bug in the\n * inferred type of merged objects. Please\n * upgrade if you are experiencing issues.\n */\n merge(merging) {\n const merged = new ZodObject({\n unknownKeys: merging._def.unknownKeys,\n catchall: merging._def.catchall,\n shape: () => ({\n ...this._def.shape(),\n ...merging._def.shape(),\n }),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n });\n return merged;\n }\n // merge<\n // Incoming extends AnyZodObject,\n // Augmentation extends Incoming[\"shape\"],\n // NewOutput extends {\n // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation\n // ? Augmentation[k][\"_output\"]\n // : k extends keyof Output\n // ? Output[k]\n // : never;\n // },\n // NewInput extends {\n // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation\n // ? Augmentation[k][\"_input\"]\n // : k extends keyof Input\n // ? Input[k]\n // : never;\n // }\n // >(\n // merging: Incoming\n // ): ZodObject<\n // extendShape<T, ReturnType<Incoming[\"_def\"][\"shape\"]>>,\n // Incoming[\"_def\"][\"unknownKeys\"],\n // Incoming[\"_def\"][\"catchall\"],\n // NewOutput,\n // NewInput\n // > {\n // const merged: any = new ZodObject({\n // unknownKeys: merging._def.unknownKeys,\n // catchall: merging._def.catchall,\n // shape: () =>\n // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),\n // typeName: ZodFirstPartyTypeKind.ZodObject,\n // }) as any;\n // return merged;\n // }\n setKey(key, schema) {\n return this.augment({ [key]: schema });\n }\n // merge<Incoming extends AnyZodObject>(\n // merging: Incoming\n // ): //ZodObject<T & Incoming[\"_shape\"], UnknownKeys, Catchall> = (merging) => {\n // ZodObject<\n // extendShape<T, ReturnType<Incoming[\"_def\"][\"shape\"]>>,\n // Incoming[\"_def\"][\"unknownKeys\"],\n // Incoming[\"_def\"][\"catchall\"]\n // > {\n // // const mergedShape = objectUtil.mergeShapes(\n // // this._def.shape(),\n // // merging._def.shape()\n // // );\n // const merged: any = new ZodObject({\n // unknownKeys: merging._def.unknownKeys,\n // catchall: merging._def.catchall,\n // shape: () =>\n // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),\n // typeName: ZodFirstPartyTypeKind.ZodObject,\n // }) as any;\n // return merged;\n // }\n catchall(index) {\n return new ZodObject({\n ...this._def,\n catchall: index,\n });\n }\n pick(mask) {\n const shape = {};\n for (const key of util_js_1.util.objectKeys(mask)) {\n if (mask[key] && this.shape[key]) {\n shape[key] = this.shape[key];\n }\n }\n return new ZodObject({\n ...this._def,\n shape: () => shape,\n });\n }\n omit(mask) {\n const shape = {};\n for (const key of util_js_1.util.objectKeys(this.shape)) {\n if (!mask[key]) {\n shape[key] = this.shape[key];\n }\n }\n return new ZodObject({\n ...this._def,\n shape: () => shape,\n });\n }\n /**\n * @deprecated\n */\n deepPartial() {\n return deepPartialify(this);\n }\n partial(mask) {\n const newShape = {};\n for (const key of util_js_1.util.objectKeys(this.shape)) {\n const fieldSchema = this.shape[key];\n if (mask && !mask[key]) {\n newShape[key] = fieldSchema;\n }\n else {\n newShape[key] = fieldSchema.optional();\n }\n }\n return new ZodObject({\n ...this._def,\n shape: () => newShape,\n });\n }\n required(mask) {\n const newShape = {};\n for (const key of util_js_1.util.objectKeys(this.shape)) {\n if (mask && !mask[key]) {\n newShape[key] = this.shape[key];\n }\n else {\n const fieldSchema = this.shape[key];\n let newField = fieldSchema;\n while (newField instanceof ZodOptional) {\n newField = newField._def.innerType;\n }\n newShape[key] = newField;\n }\n }\n return new ZodObject({\n ...this._def,\n shape: () => newShape,\n });\n }\n keyof() {\n return createZodEnum(util_js_1.util.objectKeys(this.shape));\n }\n}\nexports.ZodObject = ZodObject;\nZodObject.create = (shape, params) => {\n return new ZodObject({\n shape: () => shape,\n unknownKeys: \"strip\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params),\n });\n};\nZodObject.strictCreate = (shape, params) => {\n return new ZodObject({\n shape: () => shape,\n unknownKeys: \"strict\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params),\n });\n};\nZodObject.lazycreate = (shape, params) => {\n return new ZodObject({\n shape,\n unknownKeys: \"strip\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params),\n });\n};\nclass ZodUnion extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const options = this._def.options;\n function handleResults(results) {\n // return first issue-free validation if it exists\n for (const result of results) {\n if (result.result.status === \"valid\") {\n return result.result;\n }\n }\n for (const result of results) {\n if (result.result.status === \"dirty\") {\n // add issues from dirty option\n ctx.common.issues.push(...result.ctx.common.issues);\n return result.result;\n }\n }\n // return invalid\n const unionErrors = results.map((result) => new ZodError_js_1.ZodError(result.ctx.common.issues));\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_union,\n unionErrors,\n });\n return parseUtil_js_1.INVALID;\n }\n if (ctx.common.async) {\n return Promise.all(options.map(async (option) => {\n const childCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: [],\n },\n parent: null,\n };\n return {\n result: await option._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: childCtx,\n }),\n ctx: childCtx,\n };\n })).then(handleResults);\n }\n else {\n let dirty = undefined;\n const issues = [];\n for (const option of options) {\n const childCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: [],\n },\n parent: null,\n };\n const result = option._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: childCtx,\n });\n if (result.status === \"valid\") {\n return result;\n }\n else if (result.status === \"dirty\" && !dirty) {\n dirty = { result, ctx: childCtx };\n }\n if (childCtx.common.issues.length) {\n issues.push(childCtx.common.issues);\n }\n }\n if (dirty) {\n ctx.common.issues.push(...dirty.ctx.common.issues);\n return dirty.result;\n }\n const unionErrors = issues.map((issues) => new ZodError_js_1.ZodError(issues));\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_union,\n unionErrors,\n });\n return parseUtil_js_1.INVALID;\n }\n }\n get options() {\n return this._def.options;\n }\n}\nexports.ZodUnion = ZodUnion;\nZodUnion.create = (types, params) => {\n return new ZodUnion({\n options: types,\n typeName: ZodFirstPartyTypeKind.ZodUnion,\n ...processCreateParams(params),\n });\n};\n/////////////////////////////////////////////////////\n/////////////////////////////////////////////////////\n////////// //////////\n////////// ZodDiscriminatedUnion //////////\n////////// //////////\n/////////////////////////////////////////////////////\n/////////////////////////////////////////////////////\nconst getDiscriminator = (type) => {\n if (type instanceof ZodLazy) {\n return getDiscriminator(type.schema);\n }\n else if (type instanceof ZodEffects) {\n return getDiscriminator(type.innerType());\n }\n else if (type instanceof ZodLiteral) {\n return [type.value];\n }\n else if (type instanceof ZodEnum) {\n return type.options;\n }\n else if (type instanceof ZodNativeEnum) {\n // eslint-disable-next-line ban/ban\n return util_js_1.util.objectValues(type.enum);\n }\n else if (type instanceof ZodDefault) {\n return getDiscriminator(type._def.innerType);\n }\n else if (type instanceof ZodUndefined) {\n return [undefined];\n }\n else if (type instanceof ZodNull) {\n return [null];\n }\n else if (type instanceof ZodOptional) {\n return [undefined, ...getDiscriminator(type.unwrap())];\n }\n else if (type instanceof ZodNullable) {\n return [null, ...getDiscriminator(type.unwrap())];\n }\n else if (type instanceof ZodBranded) {\n return getDiscriminator(type.unwrap());\n }\n else if (type instanceof ZodReadonly) {\n return getDiscriminator(type.unwrap());\n }\n else if (type instanceof ZodCatch) {\n return getDiscriminator(type._def.innerType);\n }\n else {\n return [];\n }\n};\nclass ZodDiscriminatedUnion extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== util_js_1.ZodParsedType.object) {\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n expected: util_js_1.ZodParsedType.object,\n received: ctx.parsedType,\n });\n return parseUtil_js_1.INVALID;\n }\n const discriminator = this.discriminator;\n const discriminatorValue = ctx.data[discriminator];\n const option = this.optionsMap.get(discriminatorValue);\n if (!option) {\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_union_discriminator,\n options: Array.from(this.optionsMap.keys()),\n path: [discriminator],\n });\n return parseUtil_js_1.INVALID;\n }\n if (ctx.common.async) {\n return option._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n }\n else {\n return option._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n }\n }\n get discriminator() {\n return this._def.discriminator;\n }\n get options() {\n return this._def.options;\n }\n get optionsMap() {\n return this._def.optionsMap;\n }\n /**\n * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.\n * However, it only allows a union of objects, all of which need to share a discriminator property. This property must\n * have a different value for each object in the union.\n * @param discriminator the name of the discriminator property\n * @param types an array of object schemas\n * @param params\n */\n static create(discriminator, options, params) {\n // Get all the valid discriminator values\n const optionsMap = new Map();\n // try {\n for (const type of options) {\n const discriminatorValues = getDiscriminator(type.shape[discriminator]);\n if (!discriminatorValues.length) {\n throw new Error(`A discriminator value for key \\`${discriminator}\\` could not be extracted from all schema options`);\n }\n for (const value of discriminatorValues) {\n if (optionsMap.has(value)) {\n throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`);\n }\n optionsMap.set(value, type);\n }\n }\n return new ZodDiscriminatedUnion({\n typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion,\n discriminator,\n options,\n optionsMap,\n ...processCreateParams(params),\n });\n }\n}\nexports.ZodDiscriminatedUnion = ZodDiscriminatedUnion;\nfunction mergeValues(a, b) {\n const aType = (0, util_js_1.getParsedType)(a);\n const bType = (0, util_js_1.getParsedType)(b);\n if (a === b) {\n return { valid: true, data: a };\n }\n else if (aType === util_js_1.ZodParsedType.object && bType === util_js_1.ZodParsedType.object) {\n const bKeys = util_js_1.util.objectKeys(b);\n const sharedKeys = util_js_1.util.objectKeys(a).filter((key) => bKeys.indexOf(key) !== -1);\n const newObj = { ...a, ...b };\n for (const key of sharedKeys) {\n const sharedValue = mergeValues(a[key], b[key]);\n if (!sharedValue.valid) {\n return { valid: false };\n }\n newObj[key] = sharedValue.data;\n }\n return { valid: true, data: newObj };\n }\n else if (aType === util_js_1.ZodParsedType.array && bType === util_js_1.ZodParsedType.array) {\n if (a.length !== b.length) {\n return { valid: false };\n }\n const newArray = [];\n for (let index = 0; index < a.length; index++) {\n const itemA = a[index];\n const itemB = b[index];\n const sharedValue = mergeValues(itemA, itemB);\n if (!sharedValue.valid) {\n return { valid: false };\n }\n newArray.push(sharedValue.data);\n }\n return { valid: true, data: newArray };\n }\n else if (aType === util_js_1.ZodParsedType.date && bType === util_js_1.ZodParsedType.date && +a === +b) {\n return { valid: true, data: a };\n }\n else {\n return { valid: false };\n }\n}\nclass ZodIntersection extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n const handleParsed = (parsedLeft, parsedRight) => {\n if ((0, parseUtil_js_1.isAborted)(parsedLeft) || (0, parseUtil_js_1.isAborted)(parsedRight)) {\n return parseUtil_js_1.INVALID;\n }\n const merged = mergeValues(parsedLeft.value, parsedRight.value);\n if (!merged.valid) {\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_intersection_types,\n });\n return parseUtil_js_1.INVALID;\n }\n if ((0, parseUtil_js_1.isDirty)(parsedLeft) || (0, parseUtil_js_1.isDirty)(parsedRight)) {\n status.dirty();\n }\n return { status: status.value, value: merged.data };\n };\n if (ctx.common.async) {\n return Promise.all([\n this._def.left._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }),\n this._def.right._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }),\n ]).then(([left, right]) => handleParsed(left, right));\n }\n else {\n return handleParsed(this._def.left._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }), this._def.right._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }));\n }\n }\n}\nexports.ZodIntersection = ZodIntersection;\nZodIntersection.create = (left, right, params) => {\n return new ZodIntersection({\n left: left,\n right: right,\n typeName: ZodFirstPartyTypeKind.ZodIntersection,\n ...processCreateParams(params),\n });\n};\n// type ZodTupleItems = [ZodTypeAny, ...ZodTypeAny[]];\nclass ZodTuple extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== util_js_1.ZodParsedType.array) {\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n expected: util_js_1.ZodParsedType.array,\n received: ctx.parsedType,\n });\n return parseUtil_js_1.INVALID;\n }\n if (ctx.data.length < this._def.items.length) {\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.too_small,\n minimum: this._def.items.length,\n inclusive: true,\n exact: false,\n type: \"array\",\n });\n return parseUtil_js_1.INVALID;\n }\n const rest = this._def.rest;\n if (!rest && ctx.data.length > this._def.items.length) {\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.too_big,\n maximum: this._def.items.length,\n inclusive: true,\n exact: false,\n type: \"array\",\n });\n status.dirty();\n }\n const items = [...ctx.data]\n .map((item, itemIndex) => {\n const schema = this._def.items[itemIndex] || this._def.rest;\n if (!schema)\n return null;\n return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));\n })\n .filter((x) => !!x); // filter nulls\n if (ctx.common.async) {\n return Promise.all(items).then((results) => {\n return parseUtil_js_1.ParseStatus.mergeArray(status, results);\n });\n }\n else {\n return parseUtil_js_1.ParseStatus.mergeArray(status, items);\n }\n }\n get items() {\n return this._def.items;\n }\n rest(rest) {\n return new ZodTuple({\n ...this._def,\n rest,\n });\n }\n}\nexports.ZodTuple = ZodTuple;\nZodTuple.create = (schemas, params) => {\n if (!Array.isArray(schemas)) {\n throw new Error(\"You must pass an array of schemas to z.tuple([ ... ])\");\n }\n return new ZodTuple({\n items: schemas,\n typeName: ZodFirstPartyTypeKind.ZodTuple,\n rest: null,\n ...processCreateParams(params),\n });\n};\nclass ZodRecord extends ZodType {\n get keySchema() {\n return this._def.keyType;\n }\n get valueSchema() {\n return this._def.valueType;\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== util_js_1.ZodParsedType.object) {\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n expected: util_js_1.ZodParsedType.object,\n received: ctx.parsedType,\n });\n return parseUtil_js_1.INVALID;\n }\n const pairs = [];\n const keyType = this._def.keyType;\n const valueType = this._def.valueType;\n for (const key in ctx.data) {\n pairs.push({\n key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),\n value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),\n alwaysSet: key in ctx.data,\n });\n }\n if (ctx.common.async) {\n return parseUtil_js_1.ParseStatus.mergeObjectAsync(status, pairs);\n }\n else {\n return parseUtil_js_1.ParseStatus.mergeObjectSync(status, pairs);\n }\n }\n get element() {\n return this._def.valueType;\n }\n static create(first, second, third) {\n if (second instanceof ZodType) {\n return new ZodRecord({\n keyType: first,\n valueType: second,\n typeName: ZodFirstPartyTypeKind.ZodRecord,\n ...processCreateParams(third),\n });\n }\n return new ZodRecord({\n keyType: ZodString.create(),\n valueType: first,\n typeName: ZodFirstPartyTypeKind.ZodRecord,\n ...processCreateParams(second),\n });\n }\n}\nexports.ZodRecord = ZodRecord;\nclass ZodMap extends ZodType {\n get keySchema() {\n return this._def.keyType;\n }\n get valueSchema() {\n return this._def.valueType;\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== util_js_1.ZodParsedType.map) {\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n expected: util_js_1.ZodParsedType.map,\n received: ctx.parsedType,\n });\n return parseUtil_js_1.INVALID;\n }\n const keyType = this._def.keyType;\n const valueType = this._def.valueType;\n const pairs = [...ctx.data.entries()].map(([key, value], index) => {\n return {\n key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index, \"key\"])),\n value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, \"value\"])),\n };\n });\n if (ctx.common.async) {\n const finalMap = new Map();\n return Promise.resolve().then(async () => {\n for (const pair of pairs) {\n const key = await pair.key;\n const value = await pair.value;\n if (key.status === \"aborted\" || value.status === \"aborted\") {\n return parseUtil_js_1.INVALID;\n }\n if (key.status === \"dirty\" || value.status === \"dirty\") {\n status.dirty();\n }\n finalMap.set(key.value, value.value);\n }\n return { status: status.value, value: finalMap };\n });\n }\n else {\n const finalMap = new Map();\n for (const pair of pairs) {\n const key = pair.key;\n const value = pair.value;\n if (key.status === \"aborted\" || value.status === \"aborted\") {\n return parseUtil_js_1.INVALID;\n }\n if (key.status === \"dirty\" || value.status === \"dirty\") {\n status.dirty();\n }\n finalMap.set(key.value, value.value);\n }\n return { status: status.value, value: finalMap };\n }\n }\n}\nexports.ZodMap = ZodMap;\nZodMap.create = (keyType, valueType, params) => {\n return new ZodMap({\n valueType,\n keyType,\n typeName: ZodFirstPartyTypeKind.ZodMap,\n ...processCreateParams(params),\n });\n};\nclass ZodSet extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== util_js_1.ZodParsedType.set) {\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n expected: util_js_1.ZodParsedType.set,\n received: ctx.parsedType,\n });\n return parseUtil_js_1.INVALID;\n }\n const def = this._def;\n if (def.minSize !== null) {\n if (ctx.data.size < def.minSize.value) {\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.too_small,\n minimum: def.minSize.value,\n type: \"set\",\n inclusive: true,\n exact: false,\n message: def.minSize.message,\n });\n status.dirty();\n }\n }\n if (def.maxSize !== null) {\n if (ctx.data.size > def.maxSize.value) {\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.too_big,\n maximum: def.maxSize.value,\n type: \"set\",\n inclusive: true,\n exact: false,\n message: def.maxSize.message,\n });\n status.dirty();\n }\n }\n const valueType = this._def.valueType;\n function finalizeSet(elements) {\n const parsedSet = new Set();\n for (const element of elements) {\n if (element.status === \"aborted\")\n return parseUtil_js_1.INVALID;\n if (element.status === \"dirty\")\n status.dirty();\n parsedSet.add(element.value);\n }\n return { status: status.value, value: parsedSet };\n }\n const elements = [...ctx.data.values()].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i)));\n if (ctx.common.async) {\n return Promise.all(elements).then((elements) => finalizeSet(elements));\n }\n else {\n return finalizeSet(elements);\n }\n }\n min(minSize, message) {\n return new ZodSet({\n ...this._def,\n minSize: { value: minSize, message: errorUtil_js_1.errorUtil.toString(message) },\n });\n }\n max(maxSize, message) {\n return new ZodSet({\n ...this._def,\n maxSize: { value: maxSize, message: errorUtil_js_1.errorUtil.toString(message) },\n });\n }\n size(size, message) {\n return this.min(size, message).max(size, message);\n }\n nonempty(message) {\n return this.min(1, message);\n }\n}\nexports.ZodSet = ZodSet;\nZodSet.create = (valueType, params) => {\n return new ZodSet({\n valueType,\n minSize: null,\n maxSize: null,\n typeName: ZodFirstPartyTypeKind.ZodSet,\n ...processCreateParams(params),\n });\n};\nclass ZodFunction extends ZodType {\n constructor() {\n super(...arguments);\n this.validate = this.implement;\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== util_js_1.ZodParsedType.function) {\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n expected: util_js_1.ZodParsedType.function,\n received: ctx.parsedType,\n });\n return parseUtil_js_1.INVALID;\n }\n function makeArgsIssue(args, error) {\n return (0, parseUtil_js_1.makeIssue)({\n data: args,\n path: ctx.path,\n errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, (0, errors_js_1.getErrorMap)(), errors_js_1.defaultErrorMap].filter((x) => !!x),\n issueData: {\n code: ZodError_js_1.ZodIssueCode.invalid_arguments,\n argumentsError: error,\n },\n });\n }\n function makeReturnsIssue(returns, error) {\n return (0, parseUtil_js_1.makeIssue)({\n data: returns,\n path: ctx.path,\n errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, (0, errors_js_1.getErrorMap)(), errors_js_1.defaultErrorMap].filter((x) => !!x),\n issueData: {\n code: ZodError_js_1.ZodIssueCode.invalid_return_type,\n returnTypeError: error,\n },\n });\n }\n const params = { errorMap: ctx.common.contextualErrorMap };\n const fn = ctx.data;\n if (this._def.returns instanceof ZodPromise) {\n // Would love a way to avoid disabling this rule, but we need\n // an alias (using an arrow function was what caused 2651).\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const me = this;\n return (0, parseUtil_js_1.OK)(async function (...args) {\n const error = new ZodError_js_1.ZodError([]);\n const parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => {\n error.addIssue(makeArgsIssue(args, e));\n throw error;\n });\n const result = await Reflect.apply(fn, this, parsedArgs);\n const parsedReturns = await me._def.returns._def.type\n .parseAsync(result, params)\n .catch((e) => {\n error.addIssue(makeReturnsIssue(result, e));\n throw error;\n });\n return parsedReturns;\n });\n }\n else {\n // Would love a way to avoid disabling this rule, but we need\n // an alias (using an arrow function was what caused 2651).\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const me = this;\n return (0, parseUtil_js_1.OK)(function (...args) {\n const parsedArgs = me._def.args.safeParse(args, params);\n if (!parsedArgs.success) {\n throw new ZodError_js_1.ZodError([makeArgsIssue(args, parsedArgs.error)]);\n }\n const result = Reflect.apply(fn, this, parsedArgs.data);\n const parsedReturns = me._def.returns.safeParse(result, params);\n if (!parsedReturns.success) {\n throw new ZodError_js_1.ZodError([makeReturnsIssue(result, parsedReturns.error)]);\n }\n return parsedReturns.data;\n });\n }\n }\n parameters() {\n return this._def.args;\n }\n returnType() {\n return this._def.returns;\n }\n args(...items) {\n return new ZodFunction({\n ...this._def,\n args: ZodTuple.create(items).rest(ZodUnknown.create()),\n });\n }\n returns(returnType) {\n return new ZodFunction({\n ...this._def,\n returns: returnType,\n });\n }\n implement(func) {\n const validatedFunc = this.parse(func);\n return validatedFunc;\n }\n strictImplement(func) {\n const validatedFunc = this.parse(func);\n return validatedFunc;\n }\n static create(args, returns, params) {\n return new ZodFunction({\n args: (args ? args : ZodTuple.create([]).rest(ZodUnknown.create())),\n returns: returns || ZodUnknown.create(),\n typeName: ZodFirstPartyTypeKind.ZodFunction,\n ...processCreateParams(params),\n });\n }\n}\nexports.ZodFunction = ZodFunction;\nclass ZodLazy extends ZodType {\n get schema() {\n return this._def.getter();\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const lazySchema = this._def.getter();\n return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx });\n }\n}\nexports.ZodLazy = ZodLazy;\nZodLazy.create = (getter, params) => {\n return new ZodLazy({\n getter: getter,\n typeName: ZodFirstPartyTypeKind.ZodLazy,\n ...processCreateParams(params),\n });\n};\nclass ZodLiteral extends ZodType {\n _parse(input) {\n if (input.data !== this._def.value) {\n const ctx = this._getOrReturnCtx(input);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n received: ctx.data,\n code: ZodError_js_1.ZodIssueCode.invalid_literal,\n expected: this._def.value,\n });\n return parseUtil_js_1.INVALID;\n }\n return { status: \"valid\", value: input.data };\n }\n get value() {\n return this._def.value;\n }\n}\nexports.ZodLiteral = ZodLiteral;\nZodLiteral.create = (value, params) => {\n return new ZodLiteral({\n value: value,\n typeName: ZodFirstPartyTypeKind.ZodLiteral,\n ...processCreateParams(params),\n });\n};\nfunction createZodEnum(values, params) {\n return new ZodEnum({\n values,\n typeName: ZodFirstPartyTypeKind.ZodEnum,\n ...processCreateParams(params),\n });\n}\nclass ZodEnum extends ZodType {\n _parse(input) {\n if (typeof input.data !== \"string\") {\n const ctx = this._getOrReturnCtx(input);\n const expectedValues = this._def.values;\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n expected: util_js_1.util.joinValues(expectedValues),\n received: ctx.parsedType,\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n });\n return parseUtil_js_1.INVALID;\n }\n if (!this._cache) {\n this._cache = new Set(this._def.values);\n }\n if (!this._cache.has(input.data)) {\n const ctx = this._getOrReturnCtx(input);\n const expectedValues = this._def.values;\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n received: ctx.data,\n code: ZodError_js_1.ZodIssueCode.invalid_enum_value,\n options: expectedValues,\n });\n return parseUtil_js_1.INVALID;\n }\n return (0, parseUtil_js_1.OK)(input.data);\n }\n get options() {\n return this._def.values;\n }\n get enum() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n get Values() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n get Enum() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n extract(values, newDef = this._def) {\n return ZodEnum.create(values, {\n ...this._def,\n ...newDef,\n });\n }\n exclude(values, newDef = this._def) {\n return ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), {\n ...this._def,\n ...newDef,\n });\n }\n}\nexports.ZodEnum = ZodEnum;\nZodEnum.create = createZodEnum;\nclass ZodNativeEnum extends ZodType {\n _parse(input) {\n const nativeEnumValues = util_js_1.util.getValidEnumValues(this._def.values);\n const ctx = this._getOrReturnCtx(input);\n if (ctx.parsedType !== util_js_1.ZodParsedType.string && ctx.parsedType !== util_js_1.ZodParsedType.number) {\n const expectedValues = util_js_1.util.objectValues(nativeEnumValues);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n expected: util_js_1.util.joinValues(expectedValues),\n received: ctx.parsedType,\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n });\n return parseUtil_js_1.INVALID;\n }\n if (!this._cache) {\n this._cache = new Set(util_js_1.util.getValidEnumValues(this._def.values));\n }\n if (!this._cache.has(input.data)) {\n const expectedValues = util_js_1.util.objectValues(nativeEnumValues);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n received: ctx.data,\n code: ZodError_js_1.ZodIssueCode.invalid_enum_value,\n options: expectedValues,\n });\n return parseUtil_js_1.INVALID;\n }\n return (0, parseUtil_js_1.OK)(input.data);\n }\n get enum() {\n return this._def.values;\n }\n}\nexports.ZodNativeEnum = ZodNativeEnum;\nZodNativeEnum.create = (values, params) => {\n return new ZodNativeEnum({\n values: values,\n typeName: ZodFirstPartyTypeKind.ZodNativeEnum,\n ...processCreateParams(params),\n });\n};\nclass ZodPromise extends ZodType {\n unwrap() {\n return this._def.type;\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== util_js_1.ZodParsedType.promise && ctx.common.async === false) {\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n expected: util_js_1.ZodParsedType.promise,\n received: ctx.parsedType,\n });\n return parseUtil_js_1.INVALID;\n }\n const promisified = ctx.parsedType === util_js_1.ZodParsedType.promise ? ctx.data : Promise.resolve(ctx.data);\n return (0, parseUtil_js_1.OK)(promisified.then((data) => {\n return this._def.type.parseAsync(data, {\n path: ctx.path,\n errorMap: ctx.common.contextualErrorMap,\n });\n }));\n }\n}\nexports.ZodPromise = ZodPromise;\nZodPromise.create = (schema, params) => {\n return new ZodPromise({\n type: schema,\n typeName: ZodFirstPartyTypeKind.ZodPromise,\n ...processCreateParams(params),\n });\n};\nclass ZodEffects extends ZodType {\n innerType() {\n return this._def.schema;\n }\n sourceType() {\n return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects\n ? this._def.schema.sourceType()\n : this._def.schema;\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n const effect = this._def.effect || null;\n const checkCtx = {\n addIssue: (arg) => {\n (0, parseUtil_js_1.addIssueToContext)(ctx, arg);\n if (arg.fatal) {\n status.abort();\n }\n else {\n status.dirty();\n }\n },\n get path() {\n return ctx.path;\n },\n };\n checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);\n if (effect.type === \"preprocess\") {\n const processed = effect.transform(ctx.data, checkCtx);\n if (ctx.common.async) {\n return Promise.resolve(processed).then(async (processed) => {\n if (status.value === \"aborted\")\n return parseUtil_js_1.INVALID;\n const result = await this._def.schema._parseAsync({\n data: processed,\n path: ctx.path,\n parent: ctx,\n });\n if (result.status === \"aborted\")\n return parseUtil_js_1.INVALID;\n if (result.status === \"dirty\")\n return (0, parseUtil_js_1.DIRTY)(result.value);\n if (status.value === \"dirty\")\n return (0, parseUtil_js_1.DIRTY)(result.value);\n return result;\n });\n }\n else {\n if (status.value === \"aborted\")\n return parseUtil_js_1.INVALID;\n const result = this._def.schema._parseSync({\n data: processed,\n path: ctx.path,\n parent: ctx,\n });\n if (result.status === \"aborted\")\n return parseUtil_js_1.INVALID;\n if (result.status === \"dirty\")\n return (0, parseUtil_js_1.DIRTY)(result.value);\n if (status.value === \"dirty\")\n return (0, parseUtil_js_1.DIRTY)(result.value);\n return result;\n }\n }\n if (effect.type === \"refinement\") {\n const executeRefinement = (acc) => {\n const result = effect.refinement(acc, checkCtx);\n if (ctx.common.async) {\n return Promise.resolve(result);\n }\n if (result instanceof Promise) {\n throw new Error(\"Async refinement encountered during synchronous parse operation. Use .parseAsync instead.\");\n }\n return acc;\n };\n if (ctx.common.async === false) {\n const inner = this._def.schema._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (inner.status === \"aborted\")\n return parseUtil_js_1.INVALID;\n if (inner.status === \"dirty\")\n status.dirty();\n // return value is ignored\n executeRefinement(inner.value);\n return { status: status.value, value: inner.value };\n }\n else {\n return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((inner) => {\n if (inner.status === \"aborted\")\n return parseUtil_js_1.INVALID;\n if (inner.status === \"dirty\")\n status.dirty();\n return executeRefinement(inner.value).then(() => {\n return { status: status.value, value: inner.value };\n });\n });\n }\n }\n if (effect.type === \"transform\") {\n if (ctx.common.async === false) {\n const base = this._def.schema._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (!(0, parseUtil_js_1.isValid)(base))\n return parseUtil_js_1.INVALID;\n const result = effect.transform(base.value, checkCtx);\n if (result instanceof Promise) {\n throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);\n }\n return { status: status.value, value: result };\n }\n else {\n return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {\n if (!(0, parseUtil_js_1.isValid)(base))\n return parseUtil_js_1.INVALID;\n return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({\n status: status.value,\n value: result,\n }));\n });\n }\n }\n util_js_1.util.assertNever(effect);\n }\n}\nexports.ZodEffects = ZodEffects;\nexports.ZodTransformer = ZodEffects;\nZodEffects.create = (schema, effect, params) => {\n return new ZodEffects({\n schema,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect,\n ...processCreateParams(params),\n });\n};\nZodEffects.createWithPreprocess = (preprocess, schema, params) => {\n return new ZodEffects({\n schema,\n effect: { type: \"preprocess\", transform: preprocess },\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n ...processCreateParams(params),\n });\n};\nclass ZodOptional extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType === util_js_1.ZodParsedType.undefined) {\n return (0, parseUtil_js_1.OK)(undefined);\n }\n return this._def.innerType._parse(input);\n }\n unwrap() {\n return this._def.innerType;\n }\n}\nexports.ZodOptional = ZodOptional;\nZodOptional.create = (type, params) => {\n return new ZodOptional({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodOptional,\n ...processCreateParams(params),\n });\n};\nclass ZodNullable extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType === util_js_1.ZodParsedType.null) {\n return (0, parseUtil_js_1.OK)(null);\n }\n return this._def.innerType._parse(input);\n }\n unwrap() {\n return this._def.innerType;\n }\n}\nexports.ZodNullable = ZodNullable;\nZodNullable.create = (type, params) => {\n return new ZodNullable({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodNullable,\n ...processCreateParams(params),\n });\n};\nclass ZodDefault extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n let data = ctx.data;\n if (ctx.parsedType === util_js_1.ZodParsedType.undefined) {\n data = this._def.defaultValue();\n }\n return this._def.innerType._parse({\n data,\n path: ctx.path,\n parent: ctx,\n });\n }\n removeDefault() {\n return this._def.innerType;\n }\n}\nexports.ZodDefault = ZodDefault;\nZodDefault.create = (type, params) => {\n return new ZodDefault({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodDefault,\n defaultValue: typeof params.default === \"function\" ? params.default : () => params.default,\n ...processCreateParams(params),\n });\n};\nclass ZodCatch extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n // newCtx is used to not collect issues from inner types in ctx\n const newCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: [],\n },\n };\n const result = this._def.innerType._parse({\n data: newCtx.data,\n path: newCtx.path,\n parent: {\n ...newCtx,\n },\n });\n if ((0, parseUtil_js_1.isAsync)(result)) {\n return result.then((result) => {\n return {\n status: \"valid\",\n value: result.status === \"valid\"\n ? result.value\n : this._def.catchValue({\n get error() {\n return new ZodError_js_1.ZodError(newCtx.common.issues);\n },\n input: newCtx.data,\n }),\n };\n });\n }\n else {\n return {\n status: \"valid\",\n value: result.status === \"valid\"\n ? result.value\n : this._def.catchValue({\n get error() {\n return new ZodError_js_1.ZodError(newCtx.common.issues);\n },\n input: newCtx.data,\n }),\n };\n }\n }\n removeCatch() {\n return this._def.innerType;\n }\n}\nexports.ZodCatch = ZodCatch;\nZodCatch.create = (type, params) => {\n return new ZodCatch({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodCatch,\n catchValue: typeof params.catch === \"function\" ? params.catch : () => params.catch,\n ...processCreateParams(params),\n });\n};\nclass ZodNaN extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== util_js_1.ZodParsedType.nan) {\n const ctx = this._getOrReturnCtx(input);\n (0, parseUtil_js_1.addIssueToContext)(ctx, {\n code: ZodError_js_1.ZodIssueCode.invalid_type,\n expected: util_js_1.ZodParsedType.nan,\n received: ctx.parsedType,\n });\n return parseUtil_js_1.INVALID;\n }\n return { status: \"valid\", value: input.data };\n }\n}\nexports.ZodNaN = ZodNaN;\nZodNaN.create = (params) => {\n return new ZodNaN({\n typeName: ZodFirstPartyTypeKind.ZodNaN,\n ...processCreateParams(params),\n });\n};\nexports.BRAND = Symbol(\"zod_brand\");\nclass ZodBranded extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const data = ctx.data;\n return this._def.type._parse({\n data,\n path: ctx.path,\n parent: ctx,\n });\n }\n unwrap() {\n return this._def.type;\n }\n}\nexports.ZodBranded = ZodBranded;\nclass ZodPipeline extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.common.async) {\n const handleAsync = async () => {\n const inResult = await this._def.in._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (inResult.status === \"aborted\")\n return parseUtil_js_1.INVALID;\n if (inResult.status === \"dirty\") {\n status.dirty();\n return (0, parseUtil_js_1.DIRTY)(inResult.value);\n }\n else {\n return this._def.out._parseAsync({\n data: inResult.value,\n path: ctx.path,\n parent: ctx,\n });\n }\n };\n return handleAsync();\n }\n else {\n const inResult = this._def.in._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (inResult.status === \"aborted\")\n return parseUtil_js_1.INVALID;\n if (inResult.status === \"dirty\") {\n status.dirty();\n return {\n status: \"dirty\",\n value: inResult.value,\n };\n }\n else {\n return this._def.out._parseSync({\n data: inResult.value,\n path: ctx.path,\n parent: ctx,\n });\n }\n }\n }\n static create(a, b) {\n return new ZodPipeline({\n in: a,\n out: b,\n typeName: ZodFirstPartyTypeKind.ZodPipeline,\n });\n }\n}\nexports.ZodPipeline = ZodPipeline;\nclass ZodReadonly extends ZodType {\n _parse(input) {\n const result = this._def.innerType._parse(input);\n const freeze = (data) => {\n if ((0, parseUtil_js_1.isValid)(data)) {\n data.value = Object.freeze(data.value);\n }\n return data;\n };\n return (0, parseUtil_js_1.isAsync)(result) ? result.then((data) => freeze(data)) : freeze(result);\n }\n unwrap() {\n return this._def.innerType;\n }\n}\nexports.ZodReadonly = ZodReadonly;\nZodReadonly.create = (type, params) => {\n return new ZodReadonly({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodReadonly,\n ...processCreateParams(params),\n });\n};\n////////////////////////////////////////\n////////////////////////////////////////\n////////// //////////\n////////// z.custom //////////\n////////// //////////\n////////////////////////////////////////\n////////////////////////////////////////\nfunction cleanParams(params, data) {\n const p = typeof params === \"function\" ? params(data) : typeof params === \"string\" ? { message: params } : params;\n const p2 = typeof p === \"string\" ? { message: p } : p;\n return p2;\n}\nfunction custom(check, _params = {}, \n/**\n * @deprecated\n *\n * Pass `fatal` into the params object instead:\n *\n * ```ts\n * z.string().custom((val) => val.length > 5, { fatal: false })\n * ```\n *\n */\nfatal) {\n if (check)\n return ZodAny.create().superRefine((data, ctx) => {\n const r = check(data);\n if (r instanceof Promise) {\n return r.then((r) => {\n if (!r) {\n const params = cleanParams(_params, data);\n const _fatal = params.fatal ?? fatal ?? true;\n ctx.addIssue({ code: \"custom\", ...params, fatal: _fatal });\n }\n });\n }\n if (!r) {\n const params = cleanParams(_params, data);\n const _fatal = params.fatal ?? fatal ?? true;\n ctx.addIssue({ code: \"custom\", ...params, fatal: _fatal });\n }\n return;\n });\n return ZodAny.create();\n}\nexports.late = {\n object: ZodObject.lazycreate,\n};\nvar ZodFirstPartyTypeKind;\n(function (ZodFirstPartyTypeKind) {\n ZodFirstPartyTypeKind[\"ZodString\"] = \"ZodString\";\n ZodFirstPartyTypeKind[\"ZodNumber\"] = \"ZodNumber\";\n ZodFirstPartyTypeKind[\"ZodNaN\"] = \"ZodNaN\";\n ZodFirstPartyTypeKind[\"ZodBigInt\"] = \"ZodBigInt\";\n ZodFirstPartyTypeKind[\"ZodBoolean\"] = \"ZodBoolean\";\n ZodFirstPartyTypeKind[\"ZodDate\"] = \"ZodDate\";\n ZodFirstPartyTypeKind[\"ZodSymbol\"] = \"ZodSymbol\";\n ZodFirstPartyTypeKind[\"ZodUndefined\"] = \"ZodUndefined\";\n ZodFirstPartyTypeKind[\"ZodNull\"] = \"ZodNull\";\n ZodFirstPartyTypeKind[\"ZodAny\"] = \"ZodAny\";\n ZodFirstPartyTypeKind[\"ZodUnknown\"] = \"ZodUnknown\";\n ZodFirstPartyTypeKind[\"ZodNever\"] = \"ZodNever\";\n ZodFirstPartyTypeKind[\"ZodVoid\"] = \"ZodVoid\";\n ZodFirstPartyTypeKind[\"ZodArray\"] = \"ZodArray\";\n ZodFirstPartyTypeKind[\"ZodObject\"] = \"ZodObject\";\n ZodFirstPartyTypeKind[\"ZodUnion\"] = \"ZodUnion\";\n ZodFirstPartyTypeKind[\"ZodDiscriminatedUnion\"] = \"ZodDiscriminatedUnion\";\n ZodFirstPartyTypeKind[\"ZodIntersection\"] = \"ZodIntersection\";\n ZodFirstPartyTypeKind[\"ZodTuple\"] = \"ZodTuple\";\n ZodFirstPartyTypeKind[\"ZodRecord\"] = \"ZodRecord\";\n ZodFirstPartyTypeKind[\"ZodMap\"] = \"ZodMap\";\n ZodFirstPartyTypeKind[\"ZodSet\"] = \"ZodSet\";\n ZodFirstPartyTypeKind[\"ZodFunction\"] = \"ZodFunction\";\n ZodFirstPartyTypeKind[\"ZodLazy\"] = \"ZodLazy\";\n ZodFirstPartyTypeKind[\"ZodLiteral\"] = \"ZodLiteral\";\n ZodFirstPartyTypeKind[\"ZodEnum\"] = \"ZodEnum\";\n ZodFirstPartyTypeKind[\"ZodEffects\"] = \"ZodEffects\";\n ZodFirstPartyTypeKind[\"ZodNativeEnum\"] = \"ZodNativeEnum\";\n ZodFirstPartyTypeKind[\"ZodOptional\"] = \"ZodOptional\";\n ZodFirstPartyTypeKind[\"ZodNullable\"] = \"ZodNullable\";\n ZodFirstPartyTypeKind[\"ZodDefault\"] = \"ZodDefault\";\n ZodFirstPartyTypeKind[\"ZodCatch\"] = \"ZodCatch\";\n ZodFirstPartyTypeKind[\"ZodPromise\"] = \"ZodPromise\";\n ZodFirstPartyTypeKind[\"ZodBranded\"] = \"ZodBranded\";\n ZodFirstPartyTypeKind[\"ZodPipeline\"] = \"ZodPipeline\";\n ZodFirstPartyTypeKind[\"ZodReadonly\"] = \"ZodReadonly\";\n})(ZodFirstPartyTypeKind || (exports.ZodFirstPartyTypeKind = ZodFirstPartyTypeKind = {}));\n// requires TS 4.4+\nclass Class {\n constructor(..._) { }\n}\nconst instanceOfType = (\n// const instanceOfType = <T extends new (...args: any[]) => any>(\ncls, params = {\n message: `Input not instance of ${cls.name}`,\n}) => custom((data) => data instanceof cls, params);\nexports.instanceof = instanceOfType;\nconst stringType = ZodString.create;\nexports.string = stringType;\nconst numberType = ZodNumber.create;\nexports.number = numberType;\nconst nanType = ZodNaN.create;\nexports.nan = nanType;\nconst bigIntType = ZodBigInt.create;\nexports.bigint = bigIntType;\nconst booleanType = ZodBoolean.create;\nexports.boolean = booleanType;\nconst dateType = ZodDate.create;\nexports.date = dateType;\nconst symbolType = ZodSymbol.create;\nexports.symbol = symbolType;\nconst undefinedType = ZodUndefined.create;\nexports.undefined = undefinedType;\nconst nullType = ZodNull.create;\nexports.null = nullType;\nconst anyType = ZodAny.create;\nexports.any = anyType;\nconst unknownType = ZodUnknown.create;\nexports.unknown = unknownType;\nconst neverType = ZodNever.create;\nexports.never = neverType;\nconst voidType = ZodVoid.create;\nexports.void = voidType;\nconst arrayType = ZodArray.create;\nexports.array = arrayType;\nconst objectType = ZodObject.create;\nexports.object = objectType;\nconst strictObjectType = ZodObject.strictCreate;\nexports.strictObject = strictObjectType;\nconst unionType = ZodUnion.create;\nexports.union = unionType;\nconst discriminatedUnionType = ZodDiscriminatedUnion.create;\nexports.discriminatedUnion = discriminatedUnionType;\nconst intersectionType = ZodIntersection.create;\nexports.intersection = intersectionType;\nconst tupleType = ZodTuple.create;\nexports.tuple = tupleType;\nconst recordType = ZodRecord.create;\nexports.record = recordType;\nconst mapType = ZodMap.create;\nexports.map = mapType;\nconst setType = ZodSet.create;\nexports.set = setType;\nconst functionType = ZodFunction.create;\nexports.function = functionType;\nconst lazyType = ZodLazy.create;\nexports.lazy = lazyType;\nconst literalType = ZodLiteral.create;\nexports.literal = literalType;\nconst enumType = ZodEnum.create;\nexports.enum = enumType;\nconst nativeEnumType = ZodNativeEnum.create;\nexports.nativeEnum = nativeEnumType;\nconst promiseType = ZodPromise.create;\nexports.promise = promiseType;\nconst effectsType = ZodEffects.create;\nexports.effect = effectsType;\nexports.transformer = effectsType;\nconst optionalType = ZodOptional.create;\nexports.optional = optionalType;\nconst nullableType = ZodNullable.create;\nexports.nullable = nullableType;\nconst preprocessType = ZodEffects.createWithPreprocess;\nexports.preprocess = preprocessType;\nconst pipelineType = ZodPipeline.create;\nexports.pipeline = pipelineType;\nconst ostring = () => stringType().optional();\nexports.ostring = ostring;\nconst onumber = () => numberType().optional();\nexports.onumber = onumber;\nconst oboolean = () => booleanType().optional();\nexports.oboolean = oboolean;\nexports.coerce = {\n string: ((arg) => ZodString.create({ ...arg, coerce: true })),\n number: ((arg) => ZodNumber.create({ ...arg, coerce: true })),\n boolean: ((arg) => ZodBoolean.create({\n ...arg,\n coerce: true,\n })),\n bigint: ((arg) => ZodBigInt.create({ ...arg, coerce: true })),\n date: ((arg) => ZodDate.create({ ...arg, coerce: true })),\n};\nexports.NEVER = parseUtil_js_1.INVALID;\n", "\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./errors.cjs\"), exports);\n__exportStar(require(\"./helpers/parseUtil.cjs\"), exports);\n__exportStar(require(\"./helpers/typeAliases.cjs\"), exports);\n__exportStar(require(\"./helpers/util.cjs\"), exports);\n__exportStar(require(\"./types.cjs\"), exports);\n__exportStar(require(\"./ZodError.cjs\"), exports);\n", "\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.z = void 0;\nconst z = __importStar(require(\"./v3/external.cjs\"));\nexports.z = z;\n__exportStar(require(\"./v3/external.cjs\"), exports);\nexports.default = z;\n", "/**\n * Copyright(c) Microsoft Corporation.All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\n\n/**\n * Enum representing the types of actions.\n */\nexport enum ActionTypes {\n /**\n * Opens a URL in the default browser.\n */\n OpenUrl = 'openUrl',\n\n /**\n * Sends a message back to the bot as a simple string.\n */\n ImBack = 'imBack',\n\n /**\n * Sends a message back to the bot with additional data.\n */\n PostBack = 'postBack',\n\n /**\n * Plays an audio file.\n */\n PlayAudio = 'playAudio',\n\n /**\n * Plays a video file.\n */\n PlayVideo = 'playVideo',\n\n /**\n * Displays an image.\n */\n ShowImage = 'showImage',\n\n /**\n * Downloads a file.\n */\n DownloadFile = 'downloadFile',\n\n /**\n * Initiates a sign-in process.\n */\n Signin = 'signin',\n\n /**\n * Initiates a phone call.\n */\n Call = 'call',\n\n /**\n * Sends a message back to the bot with additional metadata.\n */\n MessageBack = 'messageBack',\n\n /**\n * Opens an application.\n */\n OpenApp = 'openApp',\n}\n\n/**\n * Zod schema for validating ActionTypes.\n */\nexport const actionTypesZodSchema = z.enum(['openUrl', 'imBack', 'postBack', 'playAudio', 'showImage', 'downloadFile', 'signin', 'call', 'messageBack', 'openApp'])\n", "/**\n * Copyright(c) Microsoft Corporation.All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\n\n/**\n * Enum representing the state types of a semantic action.\n */\nexport enum SemanticActionStateTypes {\n /**\n * Indicates the start of a semantic action.\n */\n Start = 'start',\n\n /**\n * Indicates the continuation of a semantic action.\n */\n Continue = 'continue',\n\n /**\n * Indicates the completion of a semantic action.\n */\n Done = 'done',\n}\n\n/**\n * Zod schema for validating SemanticActionStateTypes.\n */\nexport const semanticActionStateTypesZodSchema = z.enum(['start', 'continue', 'done'])\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\n\n/**\n * Enum representing the layout types for attachments.\n */\nexport enum AttachmentLayoutTypes {\n /**\n * Displays attachments in a list format.\n */\n List = 'list',\n\n /**\n * Displays attachments in a carousel format.\n */\n Carousel = 'carousel',\n}\n\n/**\n * Zod schema for validating attachment layout types.\n */\nexport const attachmentLayoutTypesZodSchema = z.enum(['list', 'carousel'])\n", "/**\n * Copyright(c) Microsoft Corporation.All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Enum representing the different channels an agent can communicate through.\n */\nexport enum Channels {\n /**\n * Represents an agentic channel\n */\n Agents = 'agents',\n /**\n * Represents the Alexa channel.\n */\n Alexa = 'alexa',\n\n /**\n * Represents the Console channel.\n */\n Console = 'console',\n\n /**\n * Represents the Directline channel.\n */\n Directline = 'directline',\n\n /**\n * Represents the Directline Speech channel.\n */\n DirectlineSpeech = 'directlinespeech',\n\n /**\n * Represents the Email channel.\n */\n Email = 'email',\n\n /**\n * Represents the Emulator channel.\n */\n Emulator = 'emulator',\n\n /**\n * Represents the Facebook channel.\n */\n Facebook = 'facebook',\n\n /**\n * Represents the GroupMe channel.\n */\n Groupme = 'groupme',\n\n /**\n * Represents the Line channel.\n */\n Line = 'line',\n\n /**\n * Represents the Microsoft Teams channel.\n */\n Msteams = 'msteams',\n\n /**\n * M365 Copilot Teams Subchannel.\n */\n M365CopilotSubChannel = 'COPILOT',\n M365Copilot = `${Msteams}:${M365CopilotSubChannel}`,\n\n /**\n * Represents the Omnichannel.\n */\n Omni = 'omnichannel',\n\n /**\n * Represents the Outlook channel.\n */\n Outlook = 'outlook',\n\n /**\n * Represents the Skype channel.\n */\n Skype = 'skype',\n\n /**\n * Represents the Slack channel.\n */\n Slack = 'slack',\n\n /**\n * Represents the SMS channel.\n */\n Sms = 'sms',\n\n /**\n * Represents the Telegram channel.\n */\n Telegram = 'telegram',\n\n /**\n * Represents the Telephony channel.\n */\n Telephony = 'telephony',\n\n /**\n * Represents the Test channel.\n */\n Test = 'test',\n\n /**\n * Represents the Webchat channel.\n */\n Webchat = 'webchat',\n}\n", "/**\n * Copyright(c) Microsoft Corporation.All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\n\n/**\n * Enum representing the different end of conversation codes.\n */\nexport enum EndOfConversationCodes {\n /**\n * The end of conversation reason is unknown.\n */\n Unknown = 'unknown',\n\n /**\n * The conversation completed successfully.\n */\n CompletedSuccessfully = 'completedSuccessfully',\n\n /**\n * The user cancelled the conversation.\n */\n UserCancelled = 'userCancelled',\n\n /**\n * The agent timed out during the conversation.\n */\n AgentTimedOut = 'agentTimedOut',\n\n /**\n * The agent issued an invalid message.\n */\n AgentIssuedInvalidMessage = 'agentIssuedInvalidMessage',\n\n /**\n * The channel failed during the conversation.\n */\n ChannelFailed = 'channelFailed',\n}\n\n/**\n * Zod schema for validating end of conversation codes.\n */\nexport const endOfConversationCodesZodSchema = z.enum(['unknown', 'completedSuccessfully', 'userCancelled', 'agentTimedOut', 'agentIssuedInvalidMessage', 'channelFailed'])\n", "/**\n * Copyright(c) Microsoft Corporation.All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\n\n/**\n * Enum defining the type of roster the user is a member of.\n */\nexport enum MembershipSourceTypes {\n /**\n * The source is that of a channel and the user is a member of that channel.\n */\n Channel = 'channel',\n\n /**\n * The source is that of a team and the user is a member of that team.\n */\n Team = 'team',\n}\n\n/**\n * Zod schema for validating membership source types.\n */\nexport const membershipSourceTypeZodSchema = z.enum(['channel', 'team'])\n", "/**\n * Copyright(c) Microsoft Corporation.All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\n\n/**\n * Enum expressing the users relationship to the current channel.\n */\nexport enum MembershipTypes {\n /**\n * The user is a direct member of a channel.\n */\n Direct = 'direct',\n\n /**\n * The user is a member of a channel through a group.\n */\n Transitive = 'transitive',\n}\n\n/**\n * Zod schema for validating membership source types.\n */\nexport const membershipTypeZodSchema = z.enum(['direct', 'transitive'])\n", "/**\n * Copyright(c) Microsoft Corporation.All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\n\n/**\n * Enum representing the different role types in a conversation.\n */\nexport enum RoleTypes {\n /**\n * Represents a user in the conversation.\n */\n User = 'user',\n\n /**\n * Represents an agent or bot in the conversation.\n */\n Agent = 'bot',\n\n /**\n * Represents a skill in the conversation.\n */\n Skill = 'skill',\n\n /**\n * Agentic AI - AAI role\n */\n AgenticIdentity = 'agenticAppInstance',\n\n /**\n * Agentic AI - AAI role.\n */\n AgenticUser = 'agenticUser'\n}\n\n/**\n * Zod schema for validating role types.\n */\nexport const roleTypeZodSchema = z.enum(['user', 'bot', 'skill', 'agenticAppInstance', 'agenticUser'])\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Activity } from '../activity'\nimport { Entity } from './entity'\n\n/**\n * Supported icon names for client citations. These icons are displayed in Teams to help users\n * identify the type of content being referenced in AI-generated responses.\n */\nexport type ClientCitationIconName =\n /** Microsoft Word document icon */\n | 'Microsoft Word'\n /** Microsoft Excel spreadsheet icon */\n | 'Microsoft Excel'\n /** Microsoft PowerPoint presentation icon */\n | 'Microsoft PowerPoint'\n /** Microsoft OneNote notebook icon */\n | 'Microsoft OneNote'\n /** Microsoft SharePoint site or document icon */\n | 'Microsoft SharePoint'\n /** Microsoft Visio diagram icon */\n | 'Microsoft Visio'\n /** Microsoft Loop component icon */\n | 'Microsoft Loop'\n /** Microsoft Whiteboard icon */\n | 'Microsoft Whiteboard'\n /** Adobe Illustrator vector graphics icon */\n | 'Adobe Illustrator'\n /** Adobe Photoshop image editing icon */\n | 'Adobe Photoshop'\n /** Adobe InDesign layout design icon */\n | 'Adobe InDesign'\n /** Adobe Flash multimedia icon */\n | 'Adobe Flash'\n /** Sketch design tool icon */\n | 'Sketch'\n /** Source code file icon */\n | 'Source Code'\n /** Generic image file icon */\n | 'Image'\n /** Animated GIF image icon */\n | 'GIF'\n /** Video file icon */\n | 'Video'\n /** Audio/sound file icon */\n | 'Sound'\n /** ZIP archive file icon */\n | 'ZIP'\n /** Plain text file icon */\n | 'Text'\n /** PDF document icon */\n | 'PDF'\n\n/**\n * Represents a Teams client citation to be included in a message.\n *\n * @remarks\n * [Learn more about Bot messages with AI-generated content](https://learn.microsoft.com/microsoftteams/platform/bots/how-to/bot-messages-ai-generated-content?tabs=before%2Cbotmessage)\n */\nexport interface ClientCitation {\n /**\n * Required; must be \"Claim\"\n */\n '@type': 'Claim';\n\n /**\n * Required. Number and position of the citation.\n */\n position: number;\n /**\n * Optional; if provided, the citation will be displayed in the message.\n */\n appearance: {\n /**\n * Required; Must be 'DigitalDocument'\n */\n '@type': 'DigitalDocument';\n\n /**\n * Name of the document. (max length 80)\n */\n name: string;\n\n /**\n * Stringified adaptive card with additional information about the citation.\n * It is rendered within the modal.\n */\n text?: string;\n\n /**\n * URL of the document. This will make the name of the citation clickable and direct the user to the specified URL.\n */\n url?: string;\n\n /**\n * Extract of the referenced content. (max length 160)\n */\n abstract: string;\n\n /**\n * Encoding format of the `citation.appearance.text` field.\n */\n encodingFormat?: 'application/vnd.microsoft.card.adaptive';\n\n /**\n * Information about the citation\u2019s icon.\n */\n image?: {\n '@type': 'ImageObject';\n\n /**\n * The image/icon name\n */\n name: ClientCitationIconName;\n };\n\n /**\n * Optional; set by developer. (max length 3) (max keyword length 28)\n */\n keywords?: string[];\n\n /**\n * Optional sensitivity content information.\n */\n usageInfo?: SensitivityUsageInfo;\n };\n}\n\n/**\n * Sensitivity usage info for content sent to the user.\n *\n * @remarks\n * This is used to provide information about the content to the user. See {@link ClientCitation} for more information.\n */\nexport interface SensitivityUsageInfo {\n /**\n * Must be \"https://schema.org/Message\"\n */\n type: 'https://schema.org/Message';\n\n /**\n * Required; Set to CreativeWork;\n */\n '@type': 'CreativeWork';\n\n /**\n * Sensitivity description of the content\n */\n description?: string;\n\n /**\n * Sensitivity title of the content\n */\n name: string;\n\n /**\n * Optional; ignored in Teams.\n */\n position?: number;\n\n /**\n * Optional; if provided, the content is considered sensitive and should be handled accordingly.\n */\n pattern?: {\n /**\n * Set to DefinedTerm\n */\n '@type': 'DefinedTerm';\n\n inDefinedTermSet: string;\n\n /**\n * Color\n */\n name: string;\n\n /**\n * e.g. #454545\n */\n termCode: string;\n };\n}\n\nexport interface AIEntity extends Entity {\n /**\n * Required as 'https://schema.org/Message'\n */\n type: 'https://schema.org/Message';\n\n /**\n * Required as 'Message\n */\n '@type': 'Message';\n\n /**\n * Required as 'https://schema.org\n */\n '@context': 'https://schema.org';\n\n /**\n * Must be left blank. This is for Bot Framework schema.\n */\n '@id': '';\n\n /**\n * Indicate that the content was generated by AI.\n */\n additionalType: ['AIGeneratedContent'];\n\n /**\n * Optional; if citations object is included, the sent activity will include the citations, referenced in the activity text.\n */\n citation?: ClientCitation[];\n\n /**\n * Optional; if usage_info object is included, the sent activity will include the sensitivity usage information.\n */\n usageInfo?: SensitivityUsageInfo;\n}\n\n/**\n * Adds an AI entity to an activity to indicate that the content was generated by AI.\n *\n * @param activity - The activity to which the AI entity will be added. The activity's entities array will be initialized if it doesn't exist.\n * @param citations - Optional array of client citations to include with the AI-generated content.\n * Citations provide references to sources used in generating the content and are displayed in Teams.\n * @param usageInfo - Optional sensitivity usage information that provides context about the content's sensitivity level.\n * This helps users understand any special handling requirements for the content.\n *\n * @remarks\n * This function enhances the activity with metadata that helps clients (like Microsoft Teams)\n * understand that the content is AI-generated and optionally includes citations and sensitivity information.\n *\n * @example\n * ```typescript\n * import { Activity } from '../activity';\n * import { addAIToActivity, ClientCitation } from './AIEntity';\n *\n * const activity: Activity = {\n * type: 'message',\n * text: 'Based on the documents, here are the key findings...'\n * };\n *\n * const citations: ClientCitation[] = [{\n * '@type': 'Claim',\n * position: 1,\n * appearance: {\n * '@type': 'DigitalDocument',\n * name: 'Research Report 2024',\n * abstract: 'Key findings from the annual research report',\n * url: 'https://example.com/report.pdf',\n * image: {\n * '@type': 'ImageObject',\n * name: 'PDF'\n * }\n * }\n * }];\n *\n * // Add AI entity with citations\n * addAIToActivity(activity, citations);\n * ```\n */\nexport const addAIToActivity = (\n activity: Activity,\n citations?: ClientCitation[],\n usageInfo?: SensitivityUsageInfo\n): void => {\n const aiEntity: AIEntity = {\n type: 'https://schema.org/Message',\n '@type': 'Message',\n '@context': 'https://schema.org',\n '@id': '',\n additionalType: ['AIGeneratedContent'],\n citation: citations,\n usageInfo\n }\n activity.entities ??= []\n activity.entities.push(aiEntity)\n}\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\n\n/**\n * Represents an adaptive card invoke action.\n */\nexport interface AdaptiveCardInvokeAction {\n /**\n * The type of the action.\n */\n type: string\n /**\n * The unique identifier of the action.\n */\n id?: string\n /**\n * The verb associated with the action.\n */\n verb: string\n /**\n * Additional data associated with the action.\n */\n data: Record<string, any>\n}\n\n/**\n * Zod schema for validating an adaptive card invoke action.\n */\nexport const adaptiveCardInvokeActionZodSchema = z.object({\n type: z.string().min(1),\n id: z.string().optional(),\n verb: z.string().min(1),\n data: z.record(z.string().min(1), z.any())\n})\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = 'ffffffff-ffff-ffff-ffff-ffffffffffff';\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = '00000000-0000-0000-0000-000000000000';\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = /^(?:[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;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst regex_js_1 = require(\"./regex.js\");\nfunction validate(uuid) {\n return typeof uuid === 'string' && regex_js_1.default.test(uuid);\n}\nexports.default = validate;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst validate_js_1 = require(\"./validate.js\");\nfunction parse(uuid) {\n if (!(0, validate_js_1.default)(uuid)) {\n throw TypeError('Invalid UUID');\n }\n let v;\n return Uint8Array.of((v = parseInt(uuid.slice(0, 8), 16)) >>> 24, (v >>> 16) & 0xff, (v >>> 8) & 0xff, v & 0xff, (v = parseInt(uuid.slice(9, 13), 16)) >>> 8, v & 0xff, (v = parseInt(uuid.slice(14, 18), 16)) >>> 8, v & 0xff, (v = parseInt(uuid.slice(19, 23), 16)) >>> 8, v & 0xff, ((v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000) & 0xff, (v / 0x100000000) & 0xff, (v >>> 24) & 0xff, (v >>> 16) & 0xff, (v >>> 8) & 0xff, v & 0xff);\n}\nexports.default = parse;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unsafeStringify = void 0;\nconst validate_js_1 = require(\"./validate.js\");\nconst byteToHex = [];\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\nfunction unsafeStringify(arr, offset = 0) {\n return (byteToHex[arr[offset + 0]] +\n byteToHex[arr[offset + 1]] +\n byteToHex[arr[offset + 2]] +\n byteToHex[arr[offset + 3]] +\n '-' +\n byteToHex[arr[offset + 4]] +\n byteToHex[arr[offset + 5]] +\n '-' +\n byteToHex[arr[offset + 6]] +\n byteToHex[arr[offset + 7]] +\n '-' +\n byteToHex[arr[offset + 8]] +\n byteToHex[arr[offset + 9]] +\n '-' +\n byteToHex[arr[offset + 10]] +\n byteToHex[arr[offset + 11]] +\n byteToHex[arr[offset + 12]] +\n byteToHex[arr[offset + 13]] +\n byteToHex[arr[offset + 14]] +\n byteToHex[arr[offset + 15]]).toLowerCase();\n}\nexports.unsafeStringify = unsafeStringify;\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset);\n if (!(0, validate_js_1.default)(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n return uuid;\n}\nexports.default = stringify;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nlet getRandomValues;\nconst rnds8 = new Uint8Array(16);\nfunction rng() {\n if (!getRandomValues) {\n if (typeof crypto === 'undefined' || !crypto.getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n getRandomValues = crypto.getRandomValues.bind(crypto);\n }\n return getRandomValues(rnds8);\n}\nexports.default = rng;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.updateV1State = void 0;\nconst rng_js_1 = require(\"./rng.js\");\nconst stringify_js_1 = require(\"./stringify.js\");\nconst _state = {};\nfunction v1(options, buf, offset) {\n let bytes;\n const isV6 = options?._v6 ?? false;\n if (options) {\n const optionsKeys = Object.keys(options);\n if (optionsKeys.length === 1 && optionsKeys[0] === '_v6') {\n options = undefined;\n }\n }\n if (options) {\n bytes = v1Bytes(options.random ?? options.rng?.() ?? (0, rng_js_1.default)(), options.msecs, options.nsecs, options.clockseq, options.node, buf, offset);\n }\n else {\n const now = Date.now();\n const rnds = (0, rng_js_1.default)();\n updateV1State(_state, now, rnds);\n bytes = v1Bytes(rnds, _state.msecs, _state.nsecs, isV6 ? undefined : _state.clockseq, isV6 ? undefined : _state.node, buf, offset);\n }\n return buf ?? (0, stringify_js_1.unsafeStringify)(bytes);\n}\nfunction updateV1State(state, now, rnds) {\n state.msecs ??= -Infinity;\n state.nsecs ??= 0;\n if (now === state.msecs) {\n state.nsecs++;\n if (state.nsecs >= 10000) {\n state.node = undefined;\n state.nsecs = 0;\n }\n }\n else if (now > state.msecs) {\n state.nsecs = 0;\n }\n else if (now < state.msecs) {\n state.node = undefined;\n }\n if (!state.node) {\n state.node = rnds.slice(10, 16);\n state.node[0] |= 0x01;\n state.clockseq = ((rnds[8] << 8) | rnds[9]) & 0x3fff;\n }\n state.msecs = now;\n return state;\n}\nexports.updateV1State = updateV1State;\nfunction v1Bytes(rnds, msecs, nsecs, clockseq, node, buf, offset = 0) {\n if (rnds.length < 16) {\n throw new Error('Random bytes length must be >= 16');\n }\n if (!buf) {\n buf = new Uint8Array(16);\n offset = 0;\n }\n else {\n if (offset < 0 || offset + 16 > buf.length) {\n throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);\n }\n }\n msecs ??= Date.now();\n nsecs ??= 0;\n clockseq ??= ((rnds[8] << 8) | rnds[9]) & 0x3fff;\n node ??= rnds.slice(10, 16);\n msecs += 12219292800000;\n const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n buf[offset++] = (tl >>> 24) & 0xff;\n buf[offset++] = (tl >>> 16) & 0xff;\n buf[offset++] = (tl >>> 8) & 0xff;\n buf[offset++] = tl & 0xff;\n const tmh = ((msecs / 0x100000000) * 10000) & 0xfffffff;\n buf[offset++] = (tmh >>> 8) & 0xff;\n buf[offset++] = tmh & 0xff;\n buf[offset++] = ((tmh >>> 24) & 0xf) | 0x10;\n buf[offset++] = (tmh >>> 16) & 0xff;\n buf[offset++] = (clockseq >>> 8) | 0x80;\n buf[offset++] = clockseq & 0xff;\n for (let n = 0; n < 6; ++n) {\n buf[offset++] = node[n];\n }\n return buf;\n}\nexports.default = v1;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst parse_js_1 = require(\"./parse.js\");\nconst stringify_js_1 = require(\"./stringify.js\");\nfunction v1ToV6(uuid) {\n const v1Bytes = typeof uuid === 'string' ? (0, parse_js_1.default)(uuid) : uuid;\n const v6Bytes = _v1ToV6(v1Bytes);\n return typeof uuid === 'string' ? (0, stringify_js_1.unsafeStringify)(v6Bytes) : v6Bytes;\n}\nexports.default = v1ToV6;\nfunction _v1ToV6(v1Bytes) {\n return Uint8Array.of(((v1Bytes[6] & 0x0f) << 4) | ((v1Bytes[7] >> 4) & 0x0f), ((v1Bytes[7] & 0x0f) << 4) | ((v1Bytes[4] & 0xf0) >> 4), ((v1Bytes[4] & 0x0f) << 4) | ((v1Bytes[5] & 0xf0) >> 4), ((v1Bytes[5] & 0x0f) << 4) | ((v1Bytes[0] & 0xf0) >> 4), ((v1Bytes[0] & 0x0f) << 4) | ((v1Bytes[1] & 0xf0) >> 4), ((v1Bytes[1] & 0x0f) << 4) | ((v1Bytes[2] & 0xf0) >> 4), 0x60 | (v1Bytes[2] & 0x0f), v1Bytes[3], v1Bytes[8], v1Bytes[9], v1Bytes[10], v1Bytes[11], v1Bytes[12], v1Bytes[13], v1Bytes[14], v1Bytes[15]);\n}\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction md5(bytes) {\n const words = uint8ToUint32(bytes);\n const md5Bytes = wordsToMd5(words, bytes.length * 8);\n return uint32ToUint8(md5Bytes);\n}\nfunction uint32ToUint8(input) {\n const bytes = new Uint8Array(input.length * 4);\n for (let i = 0; i < input.length * 4; i++) {\n bytes[i] = (input[i >> 2] >>> ((i % 4) * 8)) & 0xff;\n }\n return bytes;\n}\nfunction getOutputLength(inputLength8) {\n return (((inputLength8 + 64) >>> 9) << 4) + 14 + 1;\n}\nfunction wordsToMd5(x, len) {\n const xpad = new Uint32Array(getOutputLength(len)).fill(0);\n xpad.set(x);\n xpad[len >> 5] |= 0x80 << len % 32;\n xpad[xpad.length - 1] = len;\n x = xpad;\n let a = 1732584193;\n let b = -271733879;\n let c = -1732584194;\n let d = 271733878;\n for (let i = 0; i < x.length; i += 16) {\n const olda = a;\n const oldb = b;\n const oldc = c;\n const oldd = d;\n a = md5ff(a, b, c, d, x[i], 7, -680876936);\n d = md5ff(d, a, b, c, x[i + 1], 12, -389564586);\n c = md5ff(c, d, a, b, x[i + 2], 17, 606105819);\n b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330);\n a = md5ff(a, b, c, d, x[i + 4], 7, -176418897);\n d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426);\n c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341);\n b = md5ff(b, c, d, a, x[i + 7], 22, -45705983);\n a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416);\n d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417);\n c = md5ff(c, d, a, b, x[i + 10], 17, -42063);\n b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162);\n a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682);\n d = md5ff(d, a, b, c, x[i + 13], 12, -40341101);\n c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290);\n b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329);\n a = md5gg(a, b, c, d, x[i + 1], 5, -165796510);\n d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632);\n c = md5gg(c, d, a, b, x[i + 11], 14, 643717713);\n b = md5gg(b, c, d, a, x[i], 20, -373897302);\n a = md5gg(a, b, c, d, x[i + 5], 5, -701558691);\n d = md5gg(d, a, b, c, x[i + 10], 9, 38016083);\n c = md5gg(c, d, a, b, x[i + 15], 14, -660478335);\n b = md5gg(b, c, d, a, x[i + 4], 20, -405537848);\n a = md5gg(a, b, c, d, x[i + 9], 5, 568446438);\n d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690);\n c = md5gg(c, d, a, b, x[i + 3], 14, -187363961);\n b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501);\n a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467);\n d = md5gg(d, a, b, c, x[i + 2], 9, -51403784);\n c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473);\n b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734);\n a = md5hh(a, b, c, d, x[i + 5], 4, -378558);\n d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463);\n c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562);\n b = md5hh(b, c, d, a, x[i + 14], 23, -35309556);\n a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060);\n d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353);\n c = md5hh(c, d, a, b, x[i + 7], 16, -155497632);\n b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640);\n a = md5hh(a, b, c, d, x[i + 13], 4, 681279174);\n d = md5hh(d, a, b, c, x[i], 11, -358537222);\n c = md5hh(c, d, a, b, x[i + 3], 16, -722521979);\n b = md5hh(b, c, d, a, x[i + 6], 23, 76029189);\n a = md5hh(a, b, c, d, x[i + 9], 4, -640364487);\n d = md5hh(d, a, b, c, x[i + 12], 11, -421815835);\n c = md5hh(c, d, a, b, x[i + 15], 16, 530742520);\n b = md5hh(b, c, d, a, x[i + 2], 23, -995338651);\n a = md5ii(a, b, c, d, x[i], 6, -198630844);\n d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415);\n c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905);\n b = md5ii(b, c, d, a, x[i + 5], 21, -57434055);\n a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571);\n d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606);\n c = md5ii(c, d, a, b, x[i + 10], 15, -1051523);\n b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799);\n a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359);\n d = md5ii(d, a, b, c, x[i + 15], 10, -30611744);\n c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380);\n b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649);\n a = md5ii(a, b, c, d, x[i + 4], 6, -145523070);\n d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379);\n c = md5ii(c, d, a, b, x[i + 2], 15, 718787259);\n b = md5ii(b, c, d, a, x[i + 9], 21, -343485551);\n a = safeAdd(a, olda);\n b = safeAdd(b, oldb);\n c = safeAdd(c, oldc);\n d = safeAdd(d, oldd);\n }\n return Uint32Array.of(a, b, c, d);\n}\nfunction uint8ToUint32(input) {\n if (input.length === 0) {\n return new Uint32Array();\n }\n const output = new Uint32Array(getOutputLength(input.length * 8)).fill(0);\n for (let i = 0; i < input.length; i++) {\n output[i >> 2] |= (input[i] & 0xff) << ((i % 4) * 8);\n }\n return output;\n}\nfunction safeAdd(x, y) {\n const lsw = (x & 0xffff) + (y & 0xffff);\n const msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xffff);\n}\nfunction bitRotateLeft(num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt));\n}\nfunction md5cmn(q, a, b, x, s, t) {\n return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b);\n}\nfunction md5ff(a, b, c, d, x, s, t) {\n return md5cmn((b & c) | (~b & d), a, b, x, s, t);\n}\nfunction md5gg(a, b, c, d, x, s, t) {\n return md5cmn((b & d) | (c & ~d), a, b, x, s, t);\n}\nfunction md5hh(a, b, c, d, x, s, t) {\n return md5cmn(b ^ c ^ d, a, b, x, s, t);\n}\nfunction md5ii(a, b, c, d, x, s, t) {\n return md5cmn(c ^ (b | ~d), a, b, x, s, t);\n}\nexports.default = md5;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.URL = exports.DNS = exports.stringToBytes = void 0;\nconst parse_js_1 = require(\"./parse.js\");\nconst stringify_js_1 = require(\"./stringify.js\");\nfunction stringToBytes(str) {\n str = unescape(encodeURIComponent(str));\n const bytes = new Uint8Array(str.length);\n for (let i = 0; i < str.length; ++i) {\n bytes[i] = str.charCodeAt(i);\n }\n return bytes;\n}\nexports.stringToBytes = stringToBytes;\nexports.DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';\nexports.URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';\nfunction v35(version, hash, value, namespace, buf, offset) {\n const valueBytes = typeof value === 'string' ? stringToBytes(value) : value;\n const namespaceBytes = typeof namespace === 'string' ? (0, parse_js_1.default)(namespace) : namespace;\n if (typeof namespace === 'string') {\n namespace = (0, parse_js_1.default)(namespace);\n }\n if (namespace?.length !== 16) {\n throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');\n }\n let bytes = new Uint8Array(16 + valueBytes.length);\n bytes.set(namespaceBytes);\n bytes.set(valueBytes, namespaceBytes.length);\n bytes = hash(bytes);\n bytes[6] = (bytes[6] & 0x0f) | version;\n bytes[8] = (bytes[8] & 0x3f) | 0x80;\n if (buf) {\n offset = offset || 0;\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = bytes[i];\n }\n return buf;\n }\n return (0, stringify_js_1.unsafeStringify)(bytes);\n}\nexports.default = v35;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.URL = exports.DNS = void 0;\nconst md5_js_1 = require(\"./md5.js\");\nconst v35_js_1 = require(\"./v35.js\");\nvar v35_js_2 = require(\"./v35.js\");\nObject.defineProperty(exports, \"DNS\", { enumerable: true, get: function () { return v35_js_2.DNS; } });\nObject.defineProperty(exports, \"URL\", { enumerable: true, get: function () { return v35_js_2.URL; } });\nfunction v3(value, namespace, buf, offset) {\n return (0, v35_js_1.default)(0x30, md5_js_1.default, value, namespace, buf, offset);\n}\nv3.DNS = v35_js_1.DNS;\nv3.URL = v35_js_1.URL;\nexports.default = v3;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexports.default = { randomUUID };\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst native_js_1 = require(\"./native.js\");\nconst rng_js_1 = require(\"./rng.js\");\nconst stringify_js_1 = require(\"./stringify.js\");\nfunction v4(options, buf, offset) {\n if (native_js_1.default.randomUUID && !buf && !options) {\n return native_js_1.default.randomUUID();\n }\n options = options || {};\n const rnds = options.random ?? options.rng?.() ?? (0, rng_js_1.default)();\n if (rnds.length < 16) {\n throw new Error('Random bytes length must be >= 16');\n }\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n if (buf) {\n offset = offset || 0;\n if (offset < 0 || offset + 16 > buf.length) {\n throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);\n }\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n return buf;\n }\n return (0, stringify_js_1.unsafeStringify)(rnds);\n}\nexports.default = v4;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction f(s, x, y, z) {\n switch (s) {\n case 0:\n return (x & y) ^ (~x & z);\n case 1:\n return x ^ y ^ z;\n case 2:\n return (x & y) ^ (x & z) ^ (y & z);\n case 3:\n return x ^ y ^ z;\n }\n}\nfunction ROTL(x, n) {\n return (x << n) | (x >>> (32 - n));\n}\nfunction sha1(bytes) {\n const K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6];\n const H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0];\n const newBytes = new Uint8Array(bytes.length + 1);\n newBytes.set(bytes);\n newBytes[bytes.length] = 0x80;\n bytes = newBytes;\n const l = bytes.length / 4 + 2;\n const N = Math.ceil(l / 16);\n const M = new Array(N);\n for (let i = 0; i < N; ++i) {\n const arr = new Uint32Array(16);\n for (let j = 0; j < 16; ++j) {\n arr[j] =\n (bytes[i * 64 + j * 4] << 24) |\n (bytes[i * 64 + j * 4 + 1] << 16) |\n (bytes[i * 64 + j * 4 + 2] << 8) |\n bytes[i * 64 + j * 4 + 3];\n }\n M[i] = arr;\n }\n M[N - 1][14] = ((bytes.length - 1) * 8) / Math.pow(2, 32);\n M[N - 1][14] = Math.floor(M[N - 1][14]);\n M[N - 1][15] = ((bytes.length - 1) * 8) & 0xffffffff;\n for (let i = 0; i < N; ++i) {\n const W = new Uint32Array(80);\n for (let t = 0; t < 16; ++t) {\n W[t] = M[i][t];\n }\n for (let t = 16; t < 80; ++t) {\n W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1);\n }\n let a = H[0];\n let b = H[1];\n let c = H[2];\n let d = H[3];\n let e = H[4];\n for (let t = 0; t < 80; ++t) {\n const s = Math.floor(t / 20);\n const T = (ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[t]) >>> 0;\n e = d;\n d = c;\n c = ROTL(b, 30) >>> 0;\n b = a;\n a = T;\n }\n H[0] = (H[0] + a) >>> 0;\n H[1] = (H[1] + b) >>> 0;\n H[2] = (H[2] + c) >>> 0;\n H[3] = (H[3] + d) >>> 0;\n H[4] = (H[4] + e) >>> 0;\n }\n return Uint8Array.of(H[0] >> 24, H[0] >> 16, H[0] >> 8, H[0], H[1] >> 24, H[1] >> 16, H[1] >> 8, H[1], H[2] >> 24, H[2] >> 16, H[2] >> 8, H[2], H[3] >> 24, H[3] >> 16, H[3] >> 8, H[3], H[4] >> 24, H[4] >> 16, H[4] >> 8, H[4]);\n}\nexports.default = sha1;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.URL = exports.DNS = void 0;\nconst sha1_js_1 = require(\"./sha1.js\");\nconst v35_js_1 = require(\"./v35.js\");\nvar v35_js_2 = require(\"./v35.js\");\nObject.defineProperty(exports, \"DNS\", { enumerable: true, get: function () { return v35_js_2.DNS; } });\nObject.defineProperty(exports, \"URL\", { enumerable: true, get: function () { return v35_js_2.URL; } });\nfunction v5(value, namespace, buf, offset) {\n return (0, v35_js_1.default)(0x50, sha1_js_1.default, value, namespace, buf, offset);\n}\nv5.DNS = v35_js_1.DNS;\nv5.URL = v35_js_1.URL;\nexports.default = v5;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst stringify_js_1 = require(\"./stringify.js\");\nconst v1_js_1 = require(\"./v1.js\");\nconst v1ToV6_js_1 = require(\"./v1ToV6.js\");\nfunction v6(options, buf, offset) {\n options ??= {};\n offset ??= 0;\n let bytes = (0, v1_js_1.default)({ ...options, _v6: true }, new Uint8Array(16));\n bytes = (0, v1ToV6_js_1.default)(bytes);\n if (buf) {\n for (let i = 0; i < 16; i++) {\n buf[offset + i] = bytes[i];\n }\n return buf;\n }\n return (0, stringify_js_1.unsafeStringify)(bytes);\n}\nexports.default = v6;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst parse_js_1 = require(\"./parse.js\");\nconst stringify_js_1 = require(\"./stringify.js\");\nfunction v6ToV1(uuid) {\n const v6Bytes = typeof uuid === 'string' ? (0, parse_js_1.default)(uuid) : uuid;\n const v1Bytes = _v6ToV1(v6Bytes);\n return typeof uuid === 'string' ? (0, stringify_js_1.unsafeStringify)(v1Bytes) : v1Bytes;\n}\nexports.default = v6ToV1;\nfunction _v6ToV1(v6Bytes) {\n return Uint8Array.of(((v6Bytes[3] & 0x0f) << 4) | ((v6Bytes[4] >> 4) & 0x0f), ((v6Bytes[4] & 0x0f) << 4) | ((v6Bytes[5] & 0xf0) >> 4), ((v6Bytes[5] & 0x0f) << 4) | (v6Bytes[6] & 0x0f), v6Bytes[7], ((v6Bytes[1] & 0x0f) << 4) | ((v6Bytes[2] & 0xf0) >> 4), ((v6Bytes[2] & 0x0f) << 4) | ((v6Bytes[3] & 0xf0) >> 4), 0x10 | ((v6Bytes[0] & 0xf0) >> 4), ((v6Bytes[0] & 0x0f) << 4) | ((v6Bytes[1] & 0xf0) >> 4), v6Bytes[8], v6Bytes[9], v6Bytes[10], v6Bytes[11], v6Bytes[12], v6Bytes[13], v6Bytes[14], v6Bytes[15]);\n}\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.updateV7State = void 0;\nconst rng_js_1 = require(\"./rng.js\");\nconst stringify_js_1 = require(\"./stringify.js\");\nconst _state = {};\nfunction v7(options, buf, offset) {\n let bytes;\n if (options) {\n bytes = v7Bytes(options.random ?? options.rng?.() ?? (0, rng_js_1.default)(), options.msecs, options.seq, buf, offset);\n }\n else {\n const now = Date.now();\n const rnds = (0, rng_js_1.default)();\n updateV7State(_state, now, rnds);\n bytes = v7Bytes(rnds, _state.msecs, _state.seq, buf, offset);\n }\n return buf ?? (0, stringify_js_1.unsafeStringify)(bytes);\n}\nfunction updateV7State(state, now, rnds) {\n state.msecs ??= -Infinity;\n state.seq ??= 0;\n if (now > state.msecs) {\n state.seq = (rnds[6] << 23) | (rnds[7] << 16) | (rnds[8] << 8) | rnds[9];\n state.msecs = now;\n }\n else {\n state.seq = (state.seq + 1) | 0;\n if (state.seq === 0) {\n state.msecs++;\n }\n }\n return state;\n}\nexports.updateV7State = updateV7State;\nfunction v7Bytes(rnds, msecs, seq, buf, offset = 0) {\n if (rnds.length < 16) {\n throw new Error('Random bytes length must be >= 16');\n }\n if (!buf) {\n buf = new Uint8Array(16);\n offset = 0;\n }\n else {\n if (offset < 0 || offset + 16 > buf.length) {\n throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);\n }\n }\n msecs ??= Date.now();\n seq ??= ((rnds[6] * 0x7f) << 24) | (rnds[7] << 16) | (rnds[8] << 8) | rnds[9];\n buf[offset++] = (msecs / 0x10000000000) & 0xff;\n buf[offset++] = (msecs / 0x100000000) & 0xff;\n buf[offset++] = (msecs / 0x1000000) & 0xff;\n buf[offset++] = (msecs / 0x10000) & 0xff;\n buf[offset++] = (msecs / 0x100) & 0xff;\n buf[offset++] = msecs & 0xff;\n buf[offset++] = 0x70 | ((seq >>> 28) & 0x0f);\n buf[offset++] = (seq >>> 20) & 0xff;\n buf[offset++] = 0x80 | ((seq >>> 14) & 0x3f);\n buf[offset++] = (seq >>> 6) & 0xff;\n buf[offset++] = ((seq << 2) & 0xff) | (rnds[10] & 0x03);\n buf[offset++] = rnds[11];\n buf[offset++] = rnds[12];\n buf[offset++] = rnds[13];\n buf[offset++] = rnds[14];\n buf[offset++] = rnds[15];\n return buf;\n}\nexports.default = v7;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst validate_js_1 = require(\"./validate.js\");\nfunction version(uuid) {\n if (!(0, validate_js_1.default)(uuid)) {\n throw TypeError('Invalid UUID');\n }\n return parseInt(uuid.slice(14, 15), 16);\n}\nexports.default = version;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.version = exports.validate = exports.v7 = exports.v6ToV1 = exports.v6 = exports.v5 = exports.v4 = exports.v3 = exports.v1ToV6 = exports.v1 = exports.stringify = exports.parse = exports.NIL = exports.MAX = void 0;\nvar max_js_1 = require(\"./max.js\");\nObject.defineProperty(exports, \"MAX\", { enumerable: true, get: function () { return max_js_1.default; } });\nvar nil_js_1 = require(\"./nil.js\");\nObject.defineProperty(exports, \"NIL\", { enumerable: true, get: function () { return nil_js_1.default; } });\nvar parse_js_1 = require(\"./parse.js\");\nObject.defineProperty(exports, \"parse\", { enumerable: true, get: function () { return parse_js_1.default; } });\nvar stringify_js_1 = require(\"./stringify.js\");\nObject.defineProperty(exports, \"stringify\", { enumerable: true, get: function () { return stringify_js_1.default; } });\nvar v1_js_1 = require(\"./v1.js\");\nObject.defineProperty(exports, \"v1\", { enumerable: true, get: function () { return v1_js_1.default; } });\nvar v1ToV6_js_1 = require(\"./v1ToV6.js\");\nObject.defineProperty(exports, \"v1ToV6\", { enumerable: true, get: function () { return v1ToV6_js_1.default; } });\nvar v3_js_1 = require(\"./v3.js\");\nObject.defineProperty(exports, \"v3\", { enumerable: true, get: function () { return v3_js_1.default; } });\nvar v4_js_1 = require(\"./v4.js\");\nObject.defineProperty(exports, \"v4\", { enumerable: true, get: function () { return v4_js_1.default; } });\nvar v5_js_1 = require(\"./v5.js\");\nObject.defineProperty(exports, \"v5\", { enumerable: true, get: function () { return v5_js_1.default; } });\nvar v6_js_1 = require(\"./v6.js\");\nObject.defineProperty(exports, \"v6\", { enumerable: true, get: function () { return v6_js_1.default; } });\nvar v6ToV1_js_1 = require(\"./v6ToV1.js\");\nObject.defineProperty(exports, \"v6ToV1\", { enumerable: true, get: function () { return v6ToV1_js_1.default; } });\nvar v7_js_1 = require(\"./v7.js\");\nObject.defineProperty(exports, \"v7\", { enumerable: true, get: function () { return v7_js_1.default; } });\nvar validate_js_1 = require(\"./validate.js\");\nObject.defineProperty(exports, \"validate\", { enumerable: true, get: function () { return validate_js_1.default; } });\nvar version_js_1 = require(\"./version.js\");\nObject.defineProperty(exports, \"version\", { enumerable: true, get: function () { return version_js_1.default; } });\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\n\n/**\n * Represents a generic Entity.\n */\nexport interface Entity {\n /**\n * The type of the entity.\n */\n type: string\n /**\n * Additional properties of the entity.\n */\n [key: string]: unknown\n}\n\n/**\n * Zod schema for validating Entity objects.\n */\nexport const entityZodSchema = z.object({\n type: z.string().min(1)\n}).passthrough()\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\nimport { Entity, entityZodSchema } from '../entity/entity'\nimport { SemanticActionStateTypes, semanticActionStateTypesZodSchema } from './semanticActionStateTypes'\n\n/**\n * Represents a semantic action.\n */\nexport interface SemanticAction {\n /**\n * Unique identifier for the semantic action.\n */\n id: string\n /**\n * State of the semantic action.\n */\n state: SemanticActionStateTypes | string\n /**\n * Entities associated with the semantic action.\n */\n entities: { [propertyName: string]: Entity }\n}\n\n/**\n * Zod schema for validating SemanticAction.\n */\nexport const semanticActionZodSchema = z.object({\n id: z.string().min(1),\n state: z.union([semanticActionStateTypesZodSchema, z.string().min(1)]),\n entities: z.record(entityZodSchema)\n})\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\nimport { ActionTypes, actionTypesZodSchema } from './actionTypes'\n\n/**\n * Represents a card action.\n */\nexport interface CardAction {\n /**\n * Type of the action.\n */\n type: ActionTypes | string\n /**\n * Title of the action.\n */\n title: string\n /**\n * URL of the image associated with the action.\n */\n image?: string\n /**\n * Text associated with the action.\n */\n text?: string\n /**\n * Display text for the action.\n */\n displayText?: string\n /**\n * Value associated with the action.\n */\n value?: any\n /**\n * Channel-specific data associated with the action.\n */\n channelData?: unknown\n /**\n * Alt text for the image.\n */\n imageAltText?: string\n}\n\n/**\n * Zod schema for validating CardAction.\n */\nexport const cardActionZodSchema = z.object({\n type: z.union([actionTypesZodSchema, z.string().min(1)]),\n title: z.string().min(1),\n image: z.string().min(1).optional(),\n text: z.string().min(1).optional(),\n displayText: z.string().min(1).optional(),\n value: z.any().optional(),\n channelData: z.unknown().optional(),\n imageAltText: z.string().min(1).optional()\n})\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\nimport { CardAction, cardActionZodSchema } from './cardAction'\n\n/**\n * Represents suggested actions.\n */\nexport interface SuggestedActions {\n /**\n * Array of recipient IDs.\n */\n to: string[]\n /**\n * Array of card actions.\n */\n actions: CardAction[]\n}\n\n/**\n * Zod schema for validating SuggestedActions.\n */\nexport const suggestedActionsZodSchema = z.object({\n to: z.array(z.string().min(1)),\n actions: z.array(cardActionZodSchema)\n})\n", "/**\n * Copyright(c) Microsoft Corporation.All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\n\n/**\n * Enum representing activity event names.\n */\nexport enum ActivityEventNames {\n /**\n * Event name for continuing a conversation.\n */\n ContinueConversation = 'ContinueConversation',\n\n /**\n * Event name for creating a new conversation.\n */\n CreateConversation = 'CreateConversation',\n}\n\n/**\n * Zod schema for validating an ActivityEventNames enum.\n */\nexport const activityEventNamesZodSchema = z.enum(['ContinueConversation', 'CreateConversation'])\n", "/**\n * Copyright(c) Microsoft Corporation.All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\n\n/**\n * Enum representing activity importance levels.\n */\nexport enum ActivityImportance {\n /**\n * Indicates low importance.\n */\n Low = 'low',\n\n /**\n * Indicates normal importance.\n */\n Normal = 'normal',\n\n /**\n * Indicates high importance.\n */\n High = 'high',\n}\n\n/**\n * Zod schema for validating an ActivityImportance enum.\n */\nexport const activityImportanceZodSchema = z.enum(['low', 'normal', 'high'])\n", "/**\n * Copyright(c) Microsoft Corporation.All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\n\n/**\n * Enum representing activity types.\n */\nexport enum ActivityTypes {\n /**\n * A message activity.\n */\n Message = 'message',\n\n /**\n * An update to a contact relationship.\n */\n ContactRelationUpdate = 'contactRelationUpdate',\n\n /**\n * An update to a conversation.\n */\n ConversationUpdate = 'conversationUpdate',\n\n /**\n * A typing indicator activity.\n */\n Typing = 'typing',\n\n /**\n * Indicates the end of a conversation.\n */\n EndOfConversation = 'endOfConversation',\n\n /**\n * An event activity.\n */\n Event = 'event',\n\n /**\n * An invoke activity.\n */\n Invoke = 'invoke',\n\n /**\n * A response to an invoke activity.\n */\n InvokeResponse = 'invokeResponse',\n\n /**\n * An activity to delete user data.\n */\n DeleteUserData = 'deleteUserData',\n\n /**\n * An update to a message.\n */\n MessageUpdate = 'messageUpdate',\n\n /**\n * A deletion of a message.\n */\n MessageDelete = 'messageDelete',\n\n /**\n * An update to an installation.\n */\n InstallationUpdate = 'installationUpdate',\n\n /**\n * A reaction to a message.\n */\n MessageReaction = 'messageReaction',\n\n /**\n * A suggestion activity.\n */\n Suggestion = 'suggestion',\n\n /**\n * A trace activity for debugging.\n */\n Trace = 'trace',\n\n /**\n * A handoff activity to another bot or human.\n */\n Handoff = 'handoff',\n\n /**\n * A command activity.\n */\n Command = 'command',\n\n /**\n * A result of a command activity.\n */\n CommandResult = 'commandResult',\n}\n\n/**\n * Zod schema for validating an ActivityTypes enum.\n */\nexport const activityTypesZodSchema = z.enum([\n 'message',\n 'contactRelationUpdate',\n 'conversationUpdate',\n 'typing',\n 'endOfConversation',\n 'event',\n 'invoke',\n 'invokeResponse',\n 'deleteUserData',\n 'messageUpdate',\n 'messageDelete',\n 'installationUpdate',\n 'messageReaction',\n 'suggestion',\n 'trace',\n 'handoff',\n 'command',\n 'commandResult',\n])\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\n\n/**\n * Represents an attachment.\n */\nexport interface Attachment {\n /**\n * The MIME type of the attachment content.\n */\n contentType: string\n\n /**\n * The URL of the attachment content.\n */\n contentUrl?: string\n\n /**\n * The content of the attachment.\n */\n content?: unknown\n\n /**\n * The name of the attachment.\n */\n name?: string\n\n /**\n * The URL of the thumbnail for the attachment.\n */\n thumbnailUrl?: string\n}\n\n/**\n * Zod schema for validating attachments.\n */\nexport const attachmentZodSchema = z.object({\n contentType: z.string().min(1),\n contentUrl: z.string().min(1).optional(),\n content: z.unknown().optional(),\n name: z.string().min(1).optional(),\n thumbnailUrl: z.string().min(1).optional()\n})\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Activity } from '../activity'\nimport { Entity } from './entity'\n\nexport interface ProductInfo extends Entity {\n type: 'ProductInfo';\n id: string;\n}\n\n/**\n * Remove any ProductInfo entities from the activity\n * @param activity\n */\nexport const clearProductInfoFromActivity = (activity: Activity): void => {\n if (activity && activity.entities && activity.entities.length) {\n activity.entities = activity.entities.filter(e => e.type !== 'ProductInfo')\n }\n}\n\n/**\n * Add a new ProductInfo entity to the activity and ensure only one exists\n * @param activity\n * @param id\n */\nexport const addProductInfoToActivity = (activity: Activity, id: string) : void => {\n const productInfo: ProductInfo = {\n type: 'ProductInfo',\n id\n }\n activity.entities ??= []\n clearProductInfoFromActivity(activity)\n activity.entities?.push(productInfo)\n}\n", "/**\n * Copyright(c) Microsoft Corporation.All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\nimport { roleTypeZodSchema, RoleTypes } from './roleTypes'\nimport { MembershipSource } from './membershipSource'\n\n/**\n * Represents a channel account.\n */\nexport interface ChannelAccount {\n /**\n * The unique identifier of the channel account.\n */\n id?: string\n\n /**\n * The name of the channel account.\n */\n name?: string\n\n /**\n * The Azure Active Directory object ID of the channel account.\n */\n aadObjectId?: string\n\n /**\n * Tenant ID of the user.\n */\n tenantId?: string\n\n /**\n * The UPN of an agentic user\n */\n agenticUserId?: string\n\n /**\n * The client ID of an agentic app\n */\n agenticAppId?: string\n\n /**\n * The parent blueprint ID of an agentic instance\n */\n agenticAppBlueprintId?: string\n\n /**\n * The role of the channel account.\n */\n role?: RoleTypes | string\n\n /**\n * Additional properties of the channel account.\n */\n properties?: unknown\n\n /**\n * List of membership sources associated with the channel account.\n */\n membershipSources?: MembershipSource[]\n}\n\n/**\n * Zod schema for validating a channel account.\n */\nexport const channelAccountZodSchema = z.object({\n id: z.string().min(1).optional(),\n name: z.string().optional(),\n aadObjectId: z.string().min(1).optional(),\n tenantId: z.string().min(1).optional(),\n agenticUserId: z.string().min(1).optional(),\n agenticAppId: z.string().min(1).optional(),\n agenticAppBlueprintId: z.string().min(1).optional(),\n role: z.union([roleTypeZodSchema, z.string().min(1)]).optional(),\n properties: z.unknown().optional()\n})\n", "/**\n * Copyright(c) Microsoft Corporation.All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\nimport { roleTypeZodSchema, RoleTypes } from './roleTypes'\n\n/**\n * Represents a conversation account.\n */\nexport interface ConversationAccount {\n /**\n * The unique identifier of the conversation account.\n */\n id: string\n\n /**\n * The type of the conversation (e.g., personal, group, etc.).\n */\n conversationType?: string\n\n /**\n * The tenant ID associated with the conversation account.\n */\n tenantId?: string\n\n /**\n * Indicates whether the conversation is a group.\n */\n isGroup?: boolean\n\n /**\n * The name of the conversation account.\n */\n name?: string\n\n /**\n * The Azure Active Directory object ID of the conversation account.\n */\n aadObjectId?: string\n\n /**\n * The role of the conversation account.\n */\n role?: RoleTypes | string\n\n /**\n * Additional properties of the conversation account.\n */\n properties?: unknown\n}\n\n/**\n * Zod schema for validating a conversation account.\n */\nexport const conversationAccountZodSchema = z.object({\n isGroup: z.boolean().optional(),\n conversationType: z.string().min(1).optional(),\n tenantId: z.string().min(1).optional(),\n id: z.string().min(1),\n name: z.string().min(1).optional(),\n aadObjectId: z.string().min(1).optional(),\n role: z.union([roleTypeZodSchema, z.string().min(1)]).optional(),\n properties: z.unknown().optional()\n})\n", "/**\n * Copyright(c) Microsoft Corporation.All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\nimport { ChannelAccount, channelAccountZodSchema } from './channelAccount'\nimport { ConversationAccount, conversationAccountZodSchema } from './conversationAccount'\n\n/**\n * Represents a reference to a conversation.\n */\nexport interface ConversationReference {\n /**\n * The ID of the activity. Optional.\n */\n activityId?: string\n\n /**\n * The user involved in the conversation. Optional.\n */\n user?: ChannelAccount\n\n /**\n * The locale of the conversation. Optional.\n */\n locale?: string\n\n /**\n * The agent involved in the conversation. Can be undefined or null. Optional.\n */\n agent?: ChannelAccount | undefined | null\n\n /**\n * The conversation account details.\n */\n conversation: ConversationAccount\n\n /**\n * The ID of the channel where the conversation is taking place.\n */\n channelId: string\n\n /**\n * The service URL for the conversation. Optional.\n */\n serviceUrl?: string | undefined\n}\n\n/**\n * Zod schema for validating a conversation reference.\n */\nexport const conversationReferenceZodSchema = z.object({\n activityId: z.string().min(1).optional(),\n user: channelAccountZodSchema.optional(),\n locale: z.string().min(1).optional(),\n agent: channelAccountZodSchema.optional().nullable(),\n conversation: conversationAccountZodSchema,\n channelId: z.string().min(1),\n serviceUrl: z.string().min(1).optional()\n})\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\n\n/**\n * Enum representing delivery modes.\n */\nexport enum DeliveryModes {\n /**\n * Represents the normal delivery mode.\n */\n Normal = 'normal',\n\n /**\n * Represents a notification delivery mode.\n */\n Notification = 'notification',\n\n /**\n * Represents a delivery mode where replies are expected.\n */\n ExpectReplies = 'expectReplies',\n\n /**\n * Represents an ephemeral delivery mode.\n */\n Ephemeral = 'ephemeral',\n}\n\n/**\n * Zod schema for validating a DeliveryModes enum.\n */\nexport const deliveryModesZodSchema = z.enum(['normal', 'notification', 'expectReplies', 'ephemeral'])\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\n\n/**\n * Enum representing input hints.\n */\nexport enum InputHints {\n /**\n * Indicates that the bot is ready to accept input from the user.\n */\n AcceptingInput = 'acceptingInput',\n\n /**\n * Indicates that the bot is ignoring input from the user.\n */\n IgnoringInput = 'ignoringInput',\n\n /**\n * Indicates that the bot is expecting input from the user.\n */\n ExpectingInput = 'expectingInput',\n}\n\n/**\n * Zod schema for validating an InputHints enum.\n */\nexport const inputHintsZodSchema = z.enum(['acceptingInput', 'ignoringInput', 'expectingInput'])\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\n\n/**\n * Enum representing message reaction types.\n */\nexport enum MessageReactionTypes {\n /**\n * Represents a 'like' reaction to a message.\n */\n Like = 'like',\n\n /**\n * Represents a '+1' reaction to a message.\n */\n PlusOne = 'plusOne',\n}\n\n/**\n * Zod schema for validating MessageReactionTypes enum values.\n */\nexport const messageReactionTypesZodSchema = z.enum(['like', 'plusOne'])\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\nimport { MessageReactionTypes, messageReactionTypesZodSchema } from './messageReactionTypes'\n\n/**\n * Represents a message reaction.\n */\nexport interface MessageReaction {\n /**\n * The type of the reaction.\n */\n type: MessageReactionTypes | string\n}\n\n/**\n * Zod schema for validating a MessageReaction object.\n */\nexport const messageReactionZodSchema = z.object({\n type: z.union([messageReactionTypesZodSchema, z.string().min(1)])\n})\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\n\n/**\n * Enum representing text format types.\n */\nexport enum TextFormatTypes {\n /**\n * Represents text formatted using Markdown.\n */\n Markdown = 'markdown',\n\n /**\n * Represents plain text without any formatting.\n */\n Plain = 'plain',\n\n /**\n * Represents text formatted using XML.\n */\n Xml = 'xml',\n}\n\n/**\n * Zod schema for validating TextFormatTypes enum values.\n */\nexport const textFormatTypesZodSchema = z.enum(['markdown', 'plain', 'xml'])\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\n\n/**\n * Represents a text highlight.\n */\nexport interface TextHighlight {\n /**\n * The highlighted text.\n */\n text: string\n /**\n * The occurrence count of the highlighted text.\n */\n occurrence: number\n}\n\n/**\n * Zod schema for validating TextHighlight objects.\n */\nexport const textHighlightZodSchema = z.object({\n text: z.string().min(1),\n occurrence: z.number()\n})\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\n/**\n * Represents an error definition for the Agents SDK.\n * Each error definition includes an error code, description, and an optional help link.\n * If helplink is not provided, a default help link will be used.\n */\nexport interface AgentErrorDefinition {\n /**\n * Error code for the exception\n */\n code: number\n\n /**\n * Displayed error message\n */\n description: string\n\n /**\n * Optional help URL link for the error.\n * If not provided, the default help link will be used.\n */\n helplink?: string\n}\n\n/**\n * Enhanced error type with additional properties for error code, help link, and inner exception.\n * This interface extends the standard Error type with custom properties added by ExceptionHelper.\n */\nexport interface AgentError extends Error {\n /**\n * Error code for the exception\n */\n code: number\n\n /**\n * Help URL link for the error\n */\n helpLink: string\n\n /**\n * Optional inner exception\n */\n innerException?: Error\n}\n\n/**\n * Helper class for generating exceptions with error codes.\n */\nexport class ExceptionHelper {\n /**\n * Default help link template for error codes.\n * The {errorCode} token will be replaced with the actual error code.\n */\n static readonly DEFAULT_HELPLINK = 'https://aka.ms/M365AgentsErrorCodesJS/#{errorCode}'\n\n /**\n * Generates a typed exception with error code and help link.\n * The message format is: [CODE] - [message] - [helplink]\n * @param ErrorType The constructor of the error type to create\n * @param errorDefinition The error definition containing code, description, and optional help link\n * @param innerException Optional inner exception\n * @param params Optional parameters object for message formatting with key-value pairs\n * @returns A new exception instance with error code and help link, typed as AgentError\n */\n static generateException<T extends Error> (\n ErrorType: new (message: string, innerException?: Error) => T,\n errorDefinition: AgentErrorDefinition,\n innerException?: Error,\n params?: { [key: string]: string }\n ): T & AgentError {\n // Format the message with parameters if provided\n let description = errorDefinition.description\n if (params) {\n Object.keys(params).forEach((key) => {\n description = description.replace(`{${key}}`, params[key])\n })\n }\n\n // Use provided helplink or default if not provided\n const helplinkTemplate = errorDefinition.helplink ?? ExceptionHelper.DEFAULT_HELPLINK\n\n // Replace {errorCode} token in helplink with the actual error code\n const helplink = helplinkTemplate.replace('{errorCode}', errorDefinition.code.toString())\n\n // Format the full message as: [CODE] - [message] - [helplink]\n const message = `[${errorDefinition.code}] - ${description} - ${helplink}`\n\n // Create the exception\n const exception = new ErrorType(message) as T & AgentError\n\n // Set error code and help link as custom properties\n exception.code = errorDefinition.code\n exception.helpLink = helplink\n\n // Store inner exception as a custom property if provided\n if (innerException) {\n exception.innerException = innerException\n }\n\n return exception\n }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { AgentErrorDefinition } from './exceptionHelper'\n\n/**\n * Error definitions for the Activity system.\n * This contains localized error codes for the Activity subsystem of the AgentSDK.\n *\n * Each error definition includes an error code (starting from -110000), a description, and a help link\n * pointing to an AKA link to get help for the given error.\n *\n * Usage example:\n * ```\n * throw ExceptionHelper.generateException(\n * Error,\n * Errors.InvalidActivityTypeUndefined\n * );\n * ```\n */\nexport const Errors: { [key: string]: AgentErrorDefinition } = {\n /**\n * Error thrown when ActivityType is undefined.\n */\n InvalidActivityTypeUndefined: {\n code: -110000,\n description: 'Invalid ActivityType: undefined'\n },\n\n /**\n * Error thrown when ActivityType is null.\n */\n InvalidActivityTypeNull: {\n code: -110001,\n description: 'Invalid ActivityType: null'\n },\n\n /**\n * Error thrown when ActivityType is an empty string.\n */\n InvalidActivityTypeEmptyString: {\n code: -110002,\n description: 'Invalid ActivityType: empty string'\n },\n\n /**\n * Error thrown when channelId has a subChannel but no main channel.\n */\n InvalidChannelIdFormat: {\n code: -110003,\n description: 'Invalid channelId {channelId}. Found subChannel but no main channel.'\n },\n\n /**\n * Error thrown when attempting to set subChannel before setting the primary channel.\n */\n PrimaryChannelNotSet: {\n code: -110004,\n description: 'Primary channel must be set before setting subChannel'\n },\n\n /**\n * Error thrown when Activity Recipient is undefined.\n */\n ActivityRecipientUndefined: {\n code: -110005,\n description: 'Activity Recipient undefined'\n },\n\n /**\n * Error thrown when Activity Conversation is undefined.\n */\n ActivityConversationUndefined: {\n code: -110006,\n description: 'Activity Conversation undefined'\n },\n\n /**\n * Error thrown when Activity ChannelId is undefined.\n */\n ActivityChannelIdUndefined: {\n code: -110007,\n description: 'Activity ChannelId undefined'\n }\n}\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { v4 as uuid } from 'uuid'\nimport { z } from 'zod'\nimport { SemanticAction, semanticActionZodSchema } from './action/semanticAction'\nimport { SuggestedActions, suggestedActionsZodSchema } from './action/suggestedActions'\nimport { ActivityEventNames, activityEventNamesZodSchema } from './activityEventNames'\nimport { ActivityImportance, activityImportanceZodSchema } from './activityImportance'\nimport { ActivityTypes, activityTypesZodSchema } from './activityTypes'\nimport { Attachment, attachmentZodSchema } from './attachment/attachment'\nimport { AttachmentLayoutTypes, attachmentLayoutTypesZodSchema } from './attachment/attachmentLayoutTypes'\nimport { addProductInfoToActivity, clearProductInfoFromActivity } from './entity/productInfo'\nimport { ChannelAccount, channelAccountZodSchema } from './conversation/channelAccount'\nimport { Channels } from './conversation/channels'\nimport { ConversationAccount, conversationAccountZodSchema } from './conversation/conversationAccount'\nimport { ConversationReference, conversationReferenceZodSchema } from './conversation/conversationReference'\nimport { EndOfConversationCodes, endOfConversationCodesZodSchema } from './conversation/endOfConversationCodes'\nimport { DeliveryModes, deliveryModesZodSchema } from './deliveryModes'\nimport { Entity, entityZodSchema } from './entity/entity'\nimport { Mention } from './entity/mention'\nimport { InputHints, inputHintsZodSchema } from './inputHints'\nimport { MessageReaction, messageReactionZodSchema } from './messageReaction'\nimport { TextFormatTypes, textFormatTypesZodSchema } from './textFormatTypes'\nimport { TextHighlight, textHighlightZodSchema } from './textHighlight'\nimport { RoleTypes } from './conversation/roleTypes'\nimport { ExceptionHelper } from './exceptionHelper'\nimport { Errors } from './errorHelper'\n\n/**\n * Zod schema for validating an Activity object.\n */\nexport const activityZodSchema = z.object({\n type: z.union([activityTypesZodSchema, z.string().min(1)]),\n text: z.string().optional(),\n id: z.string().min(1).optional(),\n channelId: z.string().min(1).optional(),\n from: channelAccountZodSchema.optional(),\n timestamp: z.union([z.date(), z.string().min(1).transform(s => new Date(s))]).optional(),\n localTimestamp: z.union([z.date(), z.string().min(1).transform(s => new Date(s))]).optional(),\n localTimezone: z.string().min(1).optional(),\n callerId: z.string().min(1).optional(),\n serviceUrl: z.string().min(1).optional(),\n conversation: conversationAccountZodSchema.optional(),\n recipient: channelAccountZodSchema.optional(),\n textFormat: z.union([textFormatTypesZodSchema, z.string().min(1)]).optional(),\n attachmentLayout: z.union([attachmentLayoutTypesZodSchema, z.string().min(1)]).optional(),\n membersAdded: z.array(channelAccountZodSchema).optional(),\n membersRemoved: z.array(channelAccountZodSchema).optional(),\n reactionsAdded: z.array(messageReactionZodSchema).optional(),\n reactionsRemoved: z.array(messageReactionZodSchema).optional(),\n topicName: z.string().min(1).optional(),\n historyDisclosed: z.boolean().optional(),\n locale: z.string().min(1).optional(),\n speak: z.string().min(1).optional(),\n inputHint: z.union([inputHintsZodSchema, z.string().min(1)]).optional(),\n summary: z.string().min(1).optional(),\n suggestedActions: suggestedActionsZodSchema.optional(),\n attachments: z.array(attachmentZodSchema).optional(),\n entities: z.array(entityZodSchema.passthrough()).optional(),\n channelData: z.any().optional(),\n action: z.string().min(1).optional(),\n replyToId: z.string().min(1).optional(),\n label: z.string().min(1).optional(),\n valueType: z.string().min(1).optional(),\n value: z.unknown().optional(),\n name: z.union([activityEventNamesZodSchema, z.string().min(1)]).optional(),\n relatesTo: conversationReferenceZodSchema.optional(),\n code: z.union([endOfConversationCodesZodSchema, z.string().min(1)]).optional(),\n expiration: z.union([z.date(), z.string().min(1).transform(s => new Date(s))]).optional(),\n importance: z.union([activityImportanceZodSchema, z.string().min(1)]).optional(),\n deliveryMode: z.union([deliveryModesZodSchema, z.string().min(1)]).optional(),\n listenFor: z.array(z.string().min(1)).optional(),\n textHighlights: z.array(textHighlightZodSchema).optional(),\n semanticAction: semanticActionZodSchema.optional(),\n})\n\n/**\n * Represents an activity in a conversation.\n */\nexport class Activity {\n /**\n * The type of the activity.\n */\n type: ActivityTypes | string\n\n /**\n * The text content of the activity.\n */\n text?: string\n\n /**\n * The unique identifier of the activity.\n */\n id?: string\n\n /**\n * The primary channel ID where the activity originated.\n */\n _channelId?: string\n\n /**\n * The account of the sender of the activity.\n */\n from?: ChannelAccount\n\n /**\n * The timestamp of the activity.\n */\n timestamp?: Date | string\n\n /**\n * The local timestamp of the activity.\n */\n localTimestamp?: Date | string\n\n /**\n * The local timezone of the activity.\n */\n localTimezone?: string\n\n /**\n * The caller ID of the activity.\n */\n callerId?: string\n\n /**\n * The service URL of the activity.\n */\n serviceUrl?: string\n\n /**\n * The conversation account associated with the activity.\n */\n conversation?: ConversationAccount\n\n /**\n * The recipient of the activity.\n */\n recipient?: ChannelAccount\n\n /**\n * The text format of the activity.\n */\n textFormat?: TextFormatTypes | string\n\n /**\n * The attachment layout of the activity.\n */\n attachmentLayout?: AttachmentLayoutTypes | string\n\n /**\n * The members added to the conversation.\n */\n membersAdded?: ChannelAccount[]\n\n /**\n * The members removed from the conversation.\n */\n membersRemoved?: ChannelAccount[]\n\n /**\n * The reactions added to the activity.\n */\n reactionsAdded?: MessageReaction[]\n\n /**\n * The reactions removed from the activity.\n */\n reactionsRemoved?: MessageReaction[]\n\n /**\n * The topic name of the activity.\n */\n topicName?: string\n\n /**\n * Indicates whether the history is disclosed.\n */\n historyDisclosed?: boolean\n\n /**\n * The locale of the activity.\n */\n locale?: string\n\n /**\n * The speech text of the activity.\n */\n speak?: string\n\n /**\n * The input hint for the activity.\n */\n inputHint?: InputHints | string\n\n /**\n * The summary of the activity.\n */\n summary?: string\n\n /**\n * The suggested actions for the activity.\n */\n suggestedActions?: SuggestedActions\n\n /**\n * The attachments of the activity.\n */\n attachments?: Attachment[]\n\n /**\n * The entities associated with the activity.\n */\n entities?: Entity[]\n\n /**\n * The channel-specific data for the activity.\n */\n channelData?: any\n\n /**\n * The action associated with the activity.\n */\n action?: string\n\n /**\n * The ID of the activity being replied to.\n */\n replyToId?: string\n\n /**\n * The label for the activity.\n */\n label?: string\n\n /**\n * The value type of the activity.\n */\n valueType?: string\n\n /**\n * The value associated with the activity.\n */\n value?: unknown\n\n /**\n * The name of the activity event.\n */\n name?: ActivityEventNames | string\n\n /**\n * The conversation reference for the activity.\n */\n relatesTo?: ConversationReference\n\n /**\n * The end-of-conversation code for the activity.\n */\n code?: EndOfConversationCodes | string\n\n /**\n * The expiration time of the activity.\n */\n expiration?: string | Date\n\n /**\n * The importance of the activity.\n */\n importance?: ActivityImportance | string\n\n /**\n * The delivery mode of the activity.\n */\n deliveryMode?: DeliveryModes | string\n\n /**\n * The list of keywords to listen for in the activity.\n */\n listenFor?: string[]\n\n /**\n * The text highlights in the activity.\n */\n textHighlights?: TextHighlight[]\n\n /**\n * The semantic action associated with the activity.\n */\n semanticAction?: SemanticAction\n\n /**\n * The raw timestamp of the activity.\n */\n rawTimestamp?: string\n\n /**\n * The raw expiration time of the activity.\n */\n rawExpiration?: string\n\n /**\n * The raw local timestamp of the activity.\n */\n rawLocalTimestamp?: string\n\n /**\n * Additional properties of the activity.\n */\n [x: string]: unknown\n\n /**\n * Creates a new Activity instance.\n * @param t The type of the activity.\n * @throws Will throw an error if the activity type is invalid.\n */\n constructor (t: ActivityTypes | string) {\n if (t === undefined) {\n throw ExceptionHelper.generateException(\n Error,\n Errors.InvalidActivityTypeUndefined\n )\n }\n if (t === null) {\n throw ExceptionHelper.generateException(\n Error,\n Errors.InvalidActivityTypeNull\n )\n }\n if ((typeof t === 'string') && (t.length === 0)) {\n throw ExceptionHelper.generateException(\n Error,\n Errors.InvalidActivityTypeEmptyString\n )\n }\n\n this.type = t\n }\n\n /**\n * Creates an Activity instance from a JSON string.\n * @param json The JSON string representing the activity.\n * @returns The created Activity instance.\n */\n static fromJson (json: string): Activity {\n return this.fromObject(JSON.parse(json))\n }\n\n /**\n * Creates an Activity instance from an object.\n * @param o The object representing the activity.\n * @returns The created Activity instance.\n */\n static fromObject (o: object): Activity {\n const parsedActivity = activityZodSchema.passthrough().parse(o)\n const activity = new Activity(parsedActivity.type)\n Object.assign(activity, parsedActivity)\n return activity\n }\n\n /**\n * Return the combined channel:subChannel value like agent:email\n */\n get channelId (): string | undefined {\n return this._channelId?.concat(this.channelIdSubChannel ? `:${this.channelIdSubChannel}` : '')\n }\n\n /**\n * Given a composite channelId like agent:email, return the channel and subChannel.\n * @param value\n * @returns [channel, subChannel]\n */\n static parseChannelId (value: string): [string | undefined, string | undefined] {\n let channel\n let subChannel\n if (value && value.indexOf(':') !== -1) {\n channel = value.substring(0, value.indexOf(':'))\n subChannel = value.substring(value.indexOf(':') + 1)\n } else {\n channel = value\n }\n return [channel, subChannel]\n }\n\n /**\n * Sets the channel ID for the activity - if a subChannel is provided, will create the necessary ProductInfo entity\n * @param value The channel ID value.\n */\n set channelId (value: string) {\n const [channel, subChannel] = Activity.parseChannelId(value)\n\n // if they passed in a value but the channel is blank, this is invalid\n if (value && !channel) {\n throw ExceptionHelper.generateException(\n Error,\n Errors.InvalidChannelIdFormat,\n undefined,\n { channelId: value }\n )\n }\n this._channelId = channel\n if (subChannel) {\n addProductInfoToActivity(this, subChannel)\n } else {\n clearProductInfoFromActivity(this)\n }\n }\n\n /**\n * Sets the primary channel ID for the activity.\n */\n set channelIdChannel (value) {\n this._channelId = value\n }\n\n /**\n * Returns the primary channel ID for the activity.\n */\n get channelIdChannel () {\n return this._channelId\n }\n\n /**\n * Returns the sub-channel ID for the activity.\n */\n get channelIdSubChannel () {\n return this.entities?.find(e => e.type === 'ProductInfo')?.id\n }\n\n /**\n * Sets the sub-channel ID for the activity.\n */\n set channelIdSubChannel (value) {\n if (!this._channelId) {\n throw ExceptionHelper.generateException(\n Error,\n Errors.PrimaryChannelNotSet\n )\n }\n this.channelId = `${this._channelId}${value ? `:${value}` : ''}`\n }\n\n /**\n * Creates a continuation activity from a conversation reference.\n * @param reference The conversation reference.\n * @returns The created continuation activity.\n */\n static getContinuationActivity (reference: ConversationReference): Activity {\n const continuationActivityObj = {\n type: ActivityTypes.Event,\n name: ActivityEventNames.ContinueConversation,\n id: reference.activityId ?? uuid(),\n channelId: reference.channelId,\n locale: reference.locale,\n serviceUrl: reference.serviceUrl,\n conversation: reference.conversation,\n recipient: reference.agent,\n from: reference.user,\n relatesTo: reference\n }\n const continuationActivity: Activity = Activity.fromObject(continuationActivityObj)\n return continuationActivity\n }\n\n /**\n * Gets the appropriate reply-to ID for the activity.\n * @returns The reply-to ID, or undefined if not applicable.\n */\n private getAppropriateReplyToId (): string | undefined {\n if (\n this.type !== ActivityTypes.ConversationUpdate ||\n (this.channelId !== Channels.Directline && this.channelId !== Channels.Webchat)\n ) {\n return this.id\n }\n\n return undefined\n }\n\n /**\n * Gets the conversation reference for the activity.\n * @returns The conversation reference.\n * @throws Will throw an error if required properties are undefined.\n */\n public getConversationReference (): ConversationReference {\n if (this.recipient === null || this.recipient === undefined) {\n throw ExceptionHelper.generateException(\n Error,\n Errors.ActivityRecipientUndefined\n )\n }\n if (this.conversation === null || this.conversation === undefined) {\n throw ExceptionHelper.generateException(\n Error,\n Errors.ActivityConversationUndefined\n )\n }\n if (this.channelId === null || this.channelId === undefined) {\n throw ExceptionHelper.generateException(\n Error,\n Errors.ActivityChannelIdUndefined\n )\n }\n\n return {\n activityId: this.getAppropriateReplyToId(),\n user: this.from,\n agent: this.recipient,\n conversation: this.conversation,\n channelId: this.channelId,\n locale: this.locale,\n serviceUrl: this.serviceUrl\n }\n }\n\n /**\n * Applies a conversation reference to the activity.\n * @param reference The conversation reference.\n * @param isIncoming Whether the activity is incoming.\n * @returns The updated activity.\n */\n public applyConversationReference (\n reference: ConversationReference,\n isIncoming = false\n ): Activity {\n this.channelId = reference.channelId\n this.locale ??= reference.locale\n this.serviceUrl = reference.serviceUrl\n this.conversation = reference.conversation\n if (isIncoming) {\n this.from = reference.user\n this.recipient = reference.agent ?? undefined\n if (reference.activityId) {\n this.id = reference.activityId\n }\n } else {\n this.from = reference.agent ?? undefined\n this.recipient = reference.user\n if (reference.activityId) {\n this.replyToId = reference.activityId\n }\n }\n\n return this\n }\n\n public clone (): Activity {\n const activityCopy = JSON.parse(JSON.stringify(this))\n\n for (const key in activityCopy) {\n if (typeof activityCopy[key] === 'string' && !isNaN(Date.parse(activityCopy[key]))) {\n activityCopy[key] = new Date(activityCopy[key] as string)\n }\n }\n\n Object.setPrototypeOf(activityCopy, Activity.prototype)\n return activityCopy\n }\n\n /**\n * Gets the mentions in the activity.\n * @param activity The activity.\n * @returns The list of mentions.\n */\n public getMentions (activity: Activity): Mention[] {\n const result: Mention[] = []\n if (activity.entities !== undefined) {\n for (let i = 0; i < activity.entities.length; i++) {\n if (activity.entities[i].type.toLowerCase() === 'mention') {\n result.push(activity.entities[i] as unknown as Mention)\n }\n }\n }\n return result\n }\n\n /**\n * Normalizes mentions in the activity by removing mention tags and optionally removing recipient mention.\n * @param removeMention Whether to remove the recipient mention from the activity.\n */\n public normalizeMentions (removeMention: boolean = false): void {\n if (this.type === ActivityTypes.Message) {\n if (removeMention) {\n // Strip recipient mention tags and text\n this.removeRecipientMention()\n\n // Strip entity.mention records for recipient id\n if (this.entities !== undefined && this.recipient?.id) {\n this.entities = this.entities.filter((entity) => {\n if (entity.type.toLowerCase() === 'mention') {\n const mention = entity as unknown as Mention\n return mention.mentioned.id !== this.recipient?.id\n }\n return true\n })\n }\n }\n\n // Remove <at> </at> tags keeping the inner text\n if (this.text) {\n this.text = Activity.removeAt(this.text)\n }\n\n // Remove <at> </at> tags from mention records keeping the inner text\n if (this.entities !== undefined) {\n const mentions = this.getMentions(this)\n for (const mention of mentions) {\n if (mention.text) {\n mention.text = Activity.removeAt(mention.text)?.trim()\n }\n }\n }\n }\n }\n\n /**\n * Removes <at> </at> tags from the specified text.\n * @param text The text to process.\n * @returns The text with <at> </at> tags removed.\n */\n private static removeAt (text: string): string {\n if (!text) {\n return text\n }\n\n let foundTag: boolean\n do {\n foundTag = false\n const iAtStart = text.toLowerCase().indexOf('<at')\n if (iAtStart >= 0) {\n const iAtEnd = text.indexOf('>', iAtStart)\n if (iAtEnd > 0) {\n const iAtClose = text.toLowerCase().indexOf('</at>', iAtEnd)\n if (iAtClose > 0) {\n // Replace </at>\n let followingText = text.substring(iAtClose + 5)\n\n // If first char of followingText is not whitespace, insert space\n if (followingText.length > 0 && !(/\\s/.test(followingText[0]))) {\n followingText = ` ${followingText}`\n }\n\n text = text.substring(0, iAtClose) + followingText\n\n // Get tag content (text between <at...> and </at>)\n const tagContent = text.substring(iAtEnd + 1, iAtClose)\n\n // Replace <at ...> with just the tag content\n let prefixText = text.substring(0, iAtStart)\n\n // If prefixText is not empty and doesn't end with whitespace, add a space\n if (prefixText.length > 0 && !(/\\s$/.test(prefixText))) {\n prefixText += ' '\n }\n\n text = prefixText + tagContent + followingText\n\n // We found one, try again, there may be more\n foundTag = true\n }\n }\n }\n } while (foundTag)\n\n return text\n }\n\n /**\n * Removes the mention text for a given ID.\n * @param id The ID of the mention to remove.\n * @returns The updated text.\n */\n public removeMentionText (id: string): string {\n const mentions = this.getMentions(this)\n const mentionsFiltered = mentions.filter((mention): boolean => mention.mentioned.id === id)\n if ((mentionsFiltered.length > 0) && this.text) {\n this.text = this.text.replace(mentionsFiltered[0].text, '').trim()\n }\n return this.text || ''\n }\n\n /**\n * Removes the recipient mention from the activity text.\n * @returns The updated text.\n */\n public removeRecipientMention (): string {\n if ((this.recipient != null) && this.recipient.id) {\n return this.removeMentionText(this.recipient.id)\n }\n return ''\n }\n\n /**\n * Gets the conversation reference for a reply.\n * @param replyId The ID of the reply.\n * @returns The conversation reference.\n */\n public getReplyConversationReference (\n replyId: string\n ): ConversationReference {\n const reference: ConversationReference = this.getConversationReference()\n\n reference.activityId = replyId\n\n return reference\n }\n\n /**\n * Converts the activity to a JSON string.\n * @param replacer A function that transforms the results.\n * @param space Adds indentation, white space, and line break characters to the return-value JSON text.\n * @returns The JSON string representation of the activity.\n */\n public toJsonString (replacer?: (this: any, key: string, value: any) => any, space?: string | number): string {\n // Use channelId instead of _channelId when outputting json\n const copy = { ...this } as any\n copy.channelId = copy._channelId\n delete copy._channelId\n return JSON.stringify(copy, replacer, space)\n }\n\n /**\n * Does this activity represent an agentic request?\n * @returns True if agentic\n */\n public isAgenticRequest (): boolean {\n if (!this.recipient || !this.recipient.role) {\n return false\n }\n return this.recipient.role.toLowerCase() === RoleTypes.AgenticUser.toLowerCase() || this.recipient.role.toLowerCase() === RoleTypes.AgenticIdentity.toLowerCase()\n }\n\n /**\n * Retrieves the tenant ID associated with the agentic recipient of the activity, if available; otherwise, returns the tenant ID from the conversation.\n * @returns The tenant ID of the agentic recipient if present; otherwise, the tenant ID from the conversation. Returns undefined if neither is available.\n */\n public getAgenticTenantId (): string | undefined {\n return this.recipient?.tenantId ?? this.conversation?.tenantId\n }\n\n /**\n * Gets the agent instance ID from the context if its agentic\n * @returns agent instance id as string\n */\n public getAgenticInstanceId (): string | undefined {\n if (this.isAgenticRequest()) {\n return this.recipient?.agenticAppId\n }\n return undefined\n }\n\n /**\n * Gets the agentic user (UPN) from the context if it's an agentic request.\n */\n public getAgenticUser (): string | undefined {\n if (this.isAgenticRequest()) {\n return this.recipient?.agenticUserId\n }\n return undefined\n }\n}\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { z } from 'zod'\n\n/**\n * Enum representing treatment types for the activity.\n */\nexport enum ActivityTreatments {\n /**\n * Indicates that only the recipient should be able to see the message even if the activity\n * is being sent to a group of people.\n */\n Targeted = 'targeted',\n}\n\n/**\n * Zod schema for validating an ActivityTreatments enum.\n */\nexport const activityTreatments = z.nativeEnum(ActivityTreatments)\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Export statements for various modules.\n */\nexport { ActionTypes } from './action/actionTypes'\nexport { CardAction } from './action/cardAction'\nexport { SemanticAction } from './action/semanticAction'\nexport { SemanticActionStateTypes } from './action/semanticActionStateTypes'\nexport { SuggestedActions } from './action/suggestedActions'\n\nexport { Attachment } from './attachment/attachment'\nexport { AttachmentLayoutTypes } from './attachment/attachmentLayoutTypes'\n\nexport { ChannelAccount } from './conversation/channelAccount'\nexport { Channels } from './conversation/channels'\nexport { ConversationAccount } from './conversation/conversationAccount'\nexport { ConversationReference } from './conversation/conversationReference'\nexport { EndOfConversationCodes } from './conversation/endOfConversationCodes'\nexport { ConversationParameters } from './conversation/conversationParameters'\nexport { MembershipSource } from './conversation/membershipSource'\nexport { MembershipSourceTypes } from './conversation/membershipSourceTypes'\nexport { MembershipTypes } from './conversation/membershipTypes'\nexport { RoleTypes } from './conversation/roleTypes'\n\nexport { Entity } from './entity/entity'\nexport { Mention } from './entity/mention'\nexport { GeoCoordinates } from './entity/geoCoordinates'\nexport { Place } from './entity/place'\nexport { Thing } from './entity/thing'\nexport * from './entity/AIEntity'\n\nexport * from './invoke/adaptiveCardInvokeAction'\n\nexport { Activity, activityZodSchema } from './activity'\nexport { ActivityEventNames } from './activityEventNames'\nexport { ActivityImportance } from './activityImportance'\nexport { ActivityTypes } from './activityTypes'\nexport { DeliveryModes } from './deliveryModes'\nexport { ExpectedReplies } from './expectedReplies'\nexport { InputHints } from './inputHints'\nexport { MessageReaction } from './messageReaction'\nexport { MessageReactionTypes } from './messageReactionTypes'\nexport { TextFormatTypes } from './textFormatTypes'\nexport { TextHighlight } from './textHighlight'\nexport { ActivityTreatments } from './activityTreatments'\nexport { debug, Logger } from './logger'\n\nexport { AgentErrorDefinition, AgentError, ExceptionHelper } from './exceptionHelper'\nexport { Errors as ActivityErrors } from './errorHelper'\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Enum representing the type of agent.\n */\nexport enum AgentType {\n /**\n * Represents a published agent.\n */\n Published = 'Published',\n /**\n * Represents a prebuilt agent.\n */\n Prebuilt = 'Prebuilt',\n}\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Enum representing different Power Platform cloud environments.\n */\nexport enum PowerPlatformCloud {\n /**\n * Unknown cloud environment.\n */\n Unknown = 'Unknown',\n /**\n * Experimental cloud environment.\n */\n Exp = 'Exp',\n /**\n * Development cloud environment.\n */\n Dev = 'Dev',\n /**\n * Test cloud environment.\n */\n Test = 'Test',\n /**\n * Pre-production cloud environment.\n */\n Preprod = 'Preprod',\n /**\n * First release cloud environment.\n */\n FirstRelease = 'FirstRelease',\n /**\n * Production cloud environment.\n */\n Prod = 'Prod',\n /**\n * Government cloud environment.\n */\n Gov = 'Gov',\n /**\n * High security cloud environment.\n */\n High = 'High',\n /**\n * Department of Defense cloud environment.\n */\n DoD = 'DoD',\n /**\n * Mooncake cloud environment.\n */\n Mooncake = 'Mooncake',\n /**\n * Ex cloud environment.\n */\n Ex = 'Ex',\n /**\n * Rx cloud environment.\n */\n Rx = 'Rx',\n /**\n * Private cloud environment.\n */\n Prv = 'Prv',\n /**\n * Local cloud environment.\n */\n Local = 'Local',\n /**\n * French government cloud environment.\n */\n GovFR = 'GovFR',\n /**\n * Other cloud environment.\n */\n Other = 'Other',\n}\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AgentType } from './agentType'\nimport { CopilotStudioConnectionSettings } from './copilotStudioConnectionSettings'\nimport { PowerPlatformCloud } from './powerPlatformCloud'\n\n/**\n * Configuration options for establishing a connection to Copilot Studio.\n */\nabstract class ConnectionOptions implements Omit<CopilotStudioConnectionSettings, 'cloud' | 'copilotAgentType'> {\n /**\n * The client ID of the application.\n * @deprecated This property will not be supported in future versions. Handle the auth properties in the agent.\n **/\n public appClientId?: string\n /**\n * The tenant ID of the application.\n *@deprecated This property will not be supported in future versions. Handle the auth properties in the agent.\n **/\n public tenantId?: string\n /**\n * The login authority to use for the connection.\n * @deprecated This property will not be supported in future versions. Handle the auth properties in the agent.\n **/\n public authority?: string\n /** The environment ID of the application. */\n public environmentId?: string\n /** The identifier of the agent.\n * @deprecated This property will not be supported in future versions. Use schemaName instead.\n **/\n public agentIdentifier?: string\n /** The identifier of the agent. */\n public schemaName?: string\n /** The cloud environment of the application. */\n public cloud?: PowerPlatformCloud | keyof typeof PowerPlatformCloud\n /** The custom Power Platform cloud URL, if any. */\n public customPowerPlatformCloud?: string\n /** The type of the Copilot agent. */\n public copilotAgentType?: AgentType | keyof typeof AgentType\n /** The URL to connect directly to Copilot Studio endpoint */\n public directConnectUrl?: string\n /** Flag to use the experimental endpoint if available */\n public useExperimentalEndpoint?: boolean = false\n}\n\n/**\n * Represents the settings required to establish a connection to Copilot Studio.\n */\nexport class ConnectionSettings extends ConnectionOptions {\n /** The cloud environment of the application. */\n public cloud?: PowerPlatformCloud\n /** The type of the Copilot agent. */\n public copilotAgentType?: AgentType\n\n /**\n * Default constructor for the ConnectionSettings class.\n */\n constructor ()\n\n /**\n * Creates an instance of ConnectionSettings.\n * @param options Represents the settings required to establish a direct connection to the engine.\n */\n constructor (options: ConnectionOptions)\n\n /**\n * @private\n */\n constructor (options?: ConnectionOptions) {\n super()\n\n if (!options) {\n return\n }\n\n const cloud = options.cloud?.trim() || PowerPlatformCloud.Prod\n const copilotAgentType = options.copilotAgentType?.trim() || AgentType.Published\n const authority = options.authority?.trim() || 'https://login.microsoftonline.com'\n\n if (!Object.values(PowerPlatformCloud).includes(cloud as PowerPlatformCloud)) {\n throw new Error(`Invalid PowerPlatformCloud: '${cloud}'. Supported values: ${Object.values(PowerPlatformCloud).join(', ')}`)\n }\n\n if (!Object.values(AgentType).includes(copilotAgentType as AgentType)) {\n throw new Error(`Invalid AgentType: '${copilotAgentType}'. Supported values: ${Object.values(AgentType).join(', ')}`)\n }\n\n Object.assign(this, { ...options, cloud, copilotAgentType, authority })\n }\n}\n\n/**\n * Loads the connection settings for Copilot Studio from environment variables.\n * @returns The connection settings.\n */\nexport const loadCopilotStudioConnectionSettingsFromEnv: () => ConnectionSettings = () => {\n return new ConnectionSettings({\n appClientId: process.env.appClientId ?? '',\n tenantId: process.env.tenantId ?? '',\n authority: process.env.authorityEndpoint ?? 'https://login.microsoftonline.com',\n environmentId: process.env.environmentId ?? '',\n agentIdentifier: process.env.agentIdentifier ?? '',\n schemaName: process.env.schemaName ?? '',\n cloud: process.env.cloud as PowerPlatformCloud,\n customPowerPlatformCloud: process.env.customPowerPlatformCloud,\n copilotAgentType: process.env.copilotAgentType as AgentType,\n directConnectUrl: process.env.directConnectUrl,\n useExperimentalEndpoint: process.env.useExperimentalEndpoint?.toLowerCase() === 'true'\n })\n}\n", "/**\n * The type of error that occurred.\n * @public\n */\nexport type ErrorType = 'invalid-retry' | 'unknown-field'\n\n/**\n * Error thrown when encountering an issue during parsing.\n *\n * @public\n */\nexport class ParseError extends Error {\n /**\n * The type of error that occurred.\n */\n type: ErrorType\n\n /**\n * In the case of an unknown field encountered in the stream, this will be the field name.\n */\n field?: string | undefined\n\n /**\n * In the case of an unknown field encountered in the stream, this will be the value of the field.\n */\n value?: string | undefined\n\n /**\n * The line that caused the error, if available.\n */\n line?: string | undefined\n\n constructor(\n message: string,\n options: {type: ErrorType; field?: string; value?: string; line?: string},\n ) {\n super(message)\n this.name = 'ParseError'\n this.type = options.type\n this.field = options.field\n this.value = options.value\n this.line = options.line\n }\n}\n", "/**\n * EventSource/Server-Sent Events parser\n * @see https://html.spec.whatwg.org/multipage/server-sent-events.html\n */\nimport {ParseError} from './errors.ts'\nimport type {EventSourceParser, ParserCallbacks} from './types.ts'\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction noop(_arg: unknown) {\n // intentional noop\n}\n\n/**\n * Creates a new EventSource parser.\n *\n * @param callbacks - Callbacks to invoke on different parsing events:\n * - `onEvent` when a new event is parsed\n * - `onError` when an error occurs\n * - `onRetry` when a new reconnection interval has been sent from the server\n * - `onComment` when a comment is encountered in the stream\n *\n * @returns A new EventSource parser, with `parse` and `reset` methods.\n * @public\n */\nexport function createParser(callbacks: ParserCallbacks): EventSourceParser {\n if (typeof callbacks === 'function') {\n throw new TypeError(\n '`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?',\n )\n }\n\n const {onEvent = noop, onError = noop, onRetry = noop, onComment} = callbacks\n\n let incompleteLine = ''\n\n let isFirstChunk = true\n let id: string | undefined\n let data = ''\n let eventType = ''\n\n function feed(newChunk: string) {\n // Strip any UTF8 byte order mark (BOM) at the start of the stream\n const chunk = isFirstChunk ? newChunk.replace(/^\\xEF\\xBB\\xBF/, '') : newChunk\n\n // If there was a previous incomplete line, append it to the new chunk,\n // so we may process it together as a new (hopefully complete) chunk.\n const [complete, incomplete] = splitLines(`${incompleteLine}${chunk}`)\n\n for (const line of complete) {\n parseLine(line)\n }\n\n incompleteLine = incomplete\n isFirstChunk = false\n }\n\n function parseLine(line: string) {\n // If the line is empty (a blank line), dispatch the event\n if (line === '') {\n dispatchEvent()\n return\n }\n\n // If the line starts with a U+003A COLON character (:), ignore the line.\n if (line.startsWith(':')) {\n if (onComment) {\n onComment(line.slice(line.startsWith(': ') ? 2 : 1))\n }\n return\n }\n\n // If the line contains a U+003A COLON character (:)\n const fieldSeparatorIndex = line.indexOf(':')\n if (fieldSeparatorIndex !== -1) {\n // Collect the characters on the line before the first U+003A COLON character (:),\n // and let `field` be that string.\n const field = line.slice(0, fieldSeparatorIndex)\n\n // Collect the characters on the line after the first U+003A COLON character (:),\n // and let `value` be that string. If value starts with a U+0020 SPACE character,\n // remove it from value.\n const offset = line[fieldSeparatorIndex + 1] === ' ' ? 2 : 1\n const value = line.slice(fieldSeparatorIndex + offset)\n\n processField(field, value, line)\n return\n }\n\n // Otherwise, the string is not empty but does not contain a U+003A COLON character (:)\n // Process the field using the whole line as the field name, and an empty string as the field value.\n // 👆 This is according to spec. That means that a line that has the value `data` will result in\n // a newline being added to the current `data` buffer, for instance.\n processField(line, '', line)\n }\n\n function processField(field: string, value: string, line: string) {\n // Field names must be compared literally, with no case folding performed.\n switch (field) {\n case 'event':\n // Set the `event type` buffer to field value\n eventType = value\n break\n case 'data':\n // Append the field value to the `data` buffer, then append a single U+000A LINE FEED(LF)\n // character to the `data` buffer.\n data = `${data}${value}\\n`\n break\n case 'id':\n // If the field value does not contain U+0000 NULL, then set the `ID` buffer to\n // the field value. Otherwise, ignore the field.\n id = value.includes('\\0') ? undefined : value\n break\n case 'retry':\n // If the field value consists of only ASCII digits, then interpret the field value as an\n // integer in base ten, and set the event stream's reconnection time to that integer.\n // Otherwise, ignore the field.\n if (/^\\d+$/.test(value)) {\n onRetry(parseInt(value, 10))\n } else {\n onError(\n new ParseError(`Invalid \\`retry\\` value: \"${value}\"`, {\n type: 'invalid-retry',\n value,\n line,\n }),\n )\n }\n break\n default:\n // Otherwise, the field is ignored.\n onError(\n new ParseError(\n `Unknown field \"${field.length > 20 ? `${field.slice(0, 20)}…` : field}\"`,\n {type: 'unknown-field', field, value, line},\n ),\n )\n break\n }\n }\n\n function dispatchEvent() {\n const shouldDispatch = data.length > 0\n if (shouldDispatch) {\n onEvent({\n id,\n event: eventType || undefined,\n // If the data buffer's last character is a U+000A LINE FEED (LF) character,\n // then remove the last character from the data buffer.\n data: data.endsWith('\\n') ? data.slice(0, -1) : data,\n })\n }\n\n // Reset for the next event\n id = undefined\n data = ''\n eventType = ''\n }\n\n function reset(options: {consume?: boolean} = {}) {\n if (incompleteLine && options.consume) {\n parseLine(incompleteLine)\n }\n\n isFirstChunk = true\n id = undefined\n data = ''\n eventType = ''\n incompleteLine = ''\n }\n\n return {feed, reset}\n}\n\n/**\n * For the given `chunk`, split it into lines according to spec, and return any remaining incomplete line.\n *\n * @param chunk - The chunk to split into lines\n * @returns A tuple containing an array of complete lines, and any remaining incomplete line\n * @internal\n */\nfunction splitLines(chunk: string): [complete: Array<string>, incomplete: string] {\n /**\n * According to the spec, a line is terminated by either:\n * - U+000D CARRIAGE RETURN U+000A LINE FEED (CRLF) character pair\n * - a single U+000A LINE FEED(LF) character not preceded by a U+000D CARRIAGE RETURN(CR) character\n * - a single U+000D CARRIAGE RETURN(CR) character not followed by a U+000A LINE FEED(LF) character\n */\n const lines: Array<string> = []\n let incompleteLine = ''\n let searchIndex = 0\n\n while (searchIndex < chunk.length) {\n // Find next line terminator\n const crIndex = chunk.indexOf('\\r', searchIndex)\n const lfIndex = chunk.indexOf('\\n', searchIndex)\n\n // Determine line end\n let lineEnd = -1\n if (crIndex !== -1 && lfIndex !== -1) {\n // CRLF case\n lineEnd = Math.min(crIndex, lfIndex)\n } else if (crIndex !== -1) {\n // CR at the end of a chunk might be part of a CRLF sequence that spans chunks,\n // so we shouldn't treat it as a line terminator (yet)\n if (crIndex === chunk.length - 1) {\n lineEnd = -1\n } else {\n lineEnd = crIndex\n }\n } else if (lfIndex !== -1) {\n lineEnd = lfIndex\n }\n\n // Extract line if terminator found\n if (lineEnd === -1) {\n // No terminator found, rest is incomplete\n incompleteLine = chunk.slice(searchIndex)\n break\n } else {\n const line = chunk.slice(searchIndex, lineEnd)\n lines.push(line)\n\n // Move past line terminator\n searchIndex = lineEnd + 1\n if (chunk[searchIndex - 1] === '\\r' && chunk[searchIndex] === '\\n') {\n searchIndex++\n }\n }\n }\n\n return [lines, incompleteLine]\n}\n", "// ReadyStates, mirrors WhatWG spec, but uses strings instead of numbers.\n// Why make it harder to read than it needs to be?\n\n/**\n * ReadyState representing a connection that is connecting or has been scheduled to reconnect.\n * @public\n */\nexport const CONNECTING = 'connecting'\n\n/**\n * ReadyState representing a connection that is open, eg connected.\n * @public\n */\nexport const OPEN = 'open'\n\n/**\n * ReadyState representing a connection that has been closed (manually, or due to an error).\n * @public\n */\nexport const CLOSED = 'closed'\n", "import {createParser} from 'eventsource-parser'\n\nimport type {EnvAbstractions, EventSourceAsyncValueResolver} from './abstractions.js'\nimport {CLOSED, CONNECTING, OPEN} from './constants.js'\nimport type {\n EventSourceClient,\n EventSourceMessage,\n EventSourceOptions,\n FetchLike,\n FetchLikeInit,\n FetchLikeResponse,\n ReadyState,\n} from './types.js'\n\n/**\n * Intentional noop function for eased control flow\n */\nconst noop = () => {\n /* intentional noop */\n}\n\n/**\n * Creates a new EventSource client. Used internally by the environment-specific entry points,\n * and should not be used directly by consumers.\n *\n * @param optionsOrUrl - Options for the client, or an URL/URL string.\n * @param abstractions - Abstractions for the environments.\n * @returns A new EventSource client instance\n * @internal\n */\nexport function createEventSource(\n optionsOrUrl: EventSourceOptions | string | URL,\n {getStream}: EnvAbstractions,\n): EventSourceClient {\n const options =\n typeof optionsOrUrl === 'string' || optionsOrUrl instanceof URL\n ? {url: optionsOrUrl}\n : optionsOrUrl\n const {\n onMessage,\n onComment = noop,\n onConnect = noop,\n onDisconnect = noop,\n onScheduleReconnect = noop,\n } = options\n const {fetch, url, initialLastEventId} = validate(options)\n const requestHeaders = {...options.headers} // Prevent post-creation mutations to headers\n\n const onCloseSubscribers: (() => void)[] = []\n const subscribers: ((event: EventSourceMessage) => void)[] = onMessage ? [onMessage] : []\n const emit = (event: EventSourceMessage) => subscribers.forEach((fn) => fn(event))\n const parser = createParser({onEvent, onRetry, onComment})\n\n // Client state\n let request: Promise<unknown> | null\n let currentUrl = url.toString()\n let controller = new AbortController()\n let lastEventId = initialLastEventId\n let reconnectMs = 2000\n let reconnectTimer: ReturnType<typeof setTimeout> | undefined\n let readyState: ReadyState = CLOSED\n\n // Let's go!\n connect()\n\n return {\n close,\n connect,\n [Symbol.iterator]: () => {\n throw new Error(\n 'EventSource does not support synchronous iteration. Use `for await` instead.',\n )\n },\n [Symbol.asyncIterator]: getEventIterator,\n get lastEventId() {\n return lastEventId\n },\n get url() {\n return currentUrl\n },\n get readyState() {\n return readyState\n },\n }\n\n function connect() {\n if (request) {\n return\n }\n\n readyState = CONNECTING\n controller = new AbortController()\n request = fetch(url, getRequestOptions())\n .then(onFetchResponse)\n .catch((err: Error & {type: string}) => {\n request = null\n\n // We expect abort errors when the user manually calls `close()` - ignore those\n if (err.name === 'AbortError' || err.type === 'aborted' || controller.signal.aborted) {\n return\n }\n\n scheduleReconnect()\n })\n }\n\n function close() {\n readyState = CLOSED\n controller.abort()\n parser.reset()\n clearTimeout(reconnectTimer)\n onCloseSubscribers.forEach((fn) => fn())\n }\n\n function getEventIterator(): AsyncGenerator<EventSourceMessage, void> {\n const pullQueue: EventSourceAsyncValueResolver[] = []\n const pushQueue: EventSourceMessage[] = []\n\n function pullValue() {\n return new Promise<IteratorResult<EventSourceMessage, void>>((resolve) => {\n const value = pushQueue.shift()\n if (value) {\n resolve({value, done: false})\n } else {\n pullQueue.push(resolve)\n }\n })\n }\n\n const pushValue = function (value: EventSourceMessage) {\n const resolve = pullQueue.shift()\n if (resolve) {\n resolve({value, done: false})\n } else {\n pushQueue.push(value)\n }\n }\n\n function unsubscribe() {\n subscribers.splice(subscribers.indexOf(pushValue), 1)\n while (pullQueue.shift()) {}\n while (pushQueue.shift()) {}\n }\n\n function onClose() {\n const resolve = pullQueue.shift()\n if (!resolve) {\n return\n }\n\n resolve({done: true, value: undefined})\n unsubscribe()\n }\n\n onCloseSubscribers.push(onClose)\n subscribers.push(pushValue)\n\n return {\n next() {\n return readyState === CLOSED ? this.return() : pullValue()\n },\n return() {\n unsubscribe()\n return Promise.resolve({done: true, value: undefined})\n },\n throw(error) {\n unsubscribe()\n return Promise.reject(error)\n },\n [Symbol.asyncIterator]() {\n return this\n },\n }\n }\n\n function scheduleReconnect() {\n onScheduleReconnect({delay: reconnectMs})\n if (controller.signal.aborted) {\n return\n }\n readyState = CONNECTING\n reconnectTimer = setTimeout(connect, reconnectMs)\n }\n\n async function onFetchResponse(response: FetchLikeResponse) {\n onConnect()\n parser.reset()\n\n const {body, redirected, status} = response\n\n // HTTP 204 means \"close the connection, no more data will be sent\"\n if (status === 204) {\n onDisconnect()\n close()\n return\n }\n\n if (!body) {\n throw new Error('Missing response body')\n }\n\n if (redirected) {\n currentUrl = response.url\n }\n\n // Ensure that the response stream is a web stream\n // @todo Figure out a way to make this work without casting\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const stream = getStream(body as any)\n const decoder = new TextDecoder()\n\n const reader = stream.getReader()\n let open = true\n\n readyState = OPEN\n\n do {\n const {done, value} = await reader.read()\n if (value) {\n parser.feed(decoder.decode(value, {stream: !done}))\n }\n\n if (!done) {\n continue\n }\n\n open = false\n request = null\n parser.reset()\n\n // EventSources never close unless explicitly handled with `.close()`:\n // Implementors should send an `done`/`complete`/`disconnect` event and\n // explicitly handle it in client code, or send an HTTP 204.\n scheduleReconnect()\n\n // Calling scheduleReconnect() prior to onDisconnect() allows consumers to\n // explicitly call .close() before the reconnection is performed.\n onDisconnect()\n } while (open)\n }\n\n function onEvent(msg: EventSourceMessage) {\n if (typeof msg.id === 'string') {\n lastEventId = msg.id\n }\n\n emit(msg)\n }\n\n function onRetry(ms: number) {\n reconnectMs = ms\n }\n\n function getRequestOptions(): FetchLikeInit {\n // @todo allow interception of options, but don't allow overriding signal\n const {mode, credentials, body, method, redirect, referrer, referrerPolicy} = options\n const lastEvent = lastEventId ? {'Last-Event-ID': lastEventId} : undefined\n const headers = {Accept: 'text/event-stream', ...requestHeaders, ...lastEvent}\n return {\n mode,\n credentials,\n body,\n method,\n redirect,\n referrer,\n referrerPolicy,\n headers,\n cache: 'no-store',\n signal: controller.signal,\n }\n }\n}\n\nfunction validate(options: EventSourceOptions): {\n fetch: FetchLike\n url: string | URL\n initialLastEventId: string | undefined\n} {\n const fetch = options.fetch || globalThis.fetch\n if (!isFetchLike(fetch)) {\n throw new Error('No fetch implementation provided, and one was not found on the global object.')\n }\n\n if (typeof AbortController !== 'function') {\n throw new Error('Missing AbortController implementation')\n }\n\n const {url, initialLastEventId} = options\n\n if (typeof url !== 'string' && !(url instanceof URL)) {\n throw new Error('Invalid URL provided - must be string or URL instance')\n }\n\n if (typeof initialLastEventId !== 'string' && initialLastEventId !== undefined) {\n throw new Error('Invalid initialLastEventId provided - must be string or undefined')\n }\n\n return {fetch, url, initialLastEventId}\n}\n\n// This is obviously naive, but hard to probe for full compatibility\nfunction isFetchLike(fetch: FetchLike | typeof globalThis.fetch): fetch is FetchLike {\n return typeof fetch === 'function'\n}\n", "import type {EnvAbstractions} from './abstractions.js'\nimport {createEventSource as createSource} from './client.js'\nimport type {EventSourceClient, EventSourceOptions} from './types.js'\n\nexport * from './constants.js'\nexport * from './types.js'\n\n/**\n * Default \"abstractions\", eg when all the APIs are globally available\n */\nconst defaultAbstractions: EnvAbstractions = {\n getStream,\n}\n\n/**\n * Creates a new EventSource client.\n *\n * @param optionsOrUrl - Options for the client, or an URL/URL string.\n * @returns A new EventSource client instance\n * @public\n */\nexport function createEventSource(\n optionsOrUrl: EventSourceOptions | URL | string,\n): EventSourceClient {\n return createSource(optionsOrUrl, defaultAbstractions)\n}\n\n/**\n * Returns a ReadableStream (Web Stream) from either an existing ReadableStream.\n * Only defined because of environment abstractions - is actually a 1:1 (passthrough).\n *\n * @param body - The body to convert\n * @returns A ReadableStream\n * @private\n */\nfunction getStream(\n body: NodeJS.ReadableStream | ReadableStream<Uint8Array>,\n): ReadableStream<Uint8Array> {\n if (!(body instanceof ReadableStream)) {\n throw new Error('Invalid stream, expected a web ReadableStream')\n }\n\n return body\n}\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AgentType } from './agentType'\nimport { ConnectionSettings } from './connectionSettings'\nimport { debug } from '@microsoft/agents-activity/logger'\nimport { PowerPlatformCloud } from './powerPlatformCloud'\nimport { PrebuiltBotStrategy } from './strategies/prebuiltBotStrategy'\nimport { PublishedBotStrategy } from './strategies/publishedBotStrategy'\n\nconst logger = debug('copilot-studio:power-platform')\n\n/**\n * Generates the connection URL for Copilot Studio.\n * @param settings - The connection settings.\n * @param conversationId - Optional conversation ID.\n * @returns The connection URL.\n * @throws Will throw an error if required settings are missing or invalid.\n */\nexport function getCopilotStudioConnectionUrl (\n settings: ConnectionSettings,\n conversationId?: string\n): string {\n const schemaName = settings.schemaName?.trim() || settings.agentIdentifier?.trim()\n if (!settings.directConnectUrl?.trim() && (!settings.environmentId?.trim() || !schemaName?.trim())) {\n throw new Error('Either directConnectUrl OR both environmentId and schemaName/agentIdentifier must be provided')\n }\n\n if (settings.directConnectUrl?.trim()) {\n logger.debug(`Using direct connection: ${settings.directConnectUrl}`)\n if (!isValidUri(settings.directConnectUrl)) {\n throw new Error('directConnectUrl must be a valid URL')\n }\n\n // FIX for Missing Tenant ID\n if (settings.directConnectUrl.toLowerCase().includes('tenants/00000000-0000-0000-0000-000000000000')) {\n logger.warn(`Direct connection cannot be used, forcing default settings flow. Tenant ID is missing in the URL: ${settings.directConnectUrl}`)\n // Direct connection cannot be used, ejecting and forcing the normal settings flow:\n return getCopilotStudioConnectionUrl({ ...settings, directConnectUrl: '' }, conversationId)\n }\n\n return createURL(settings.directConnectUrl, conversationId).href\n }\n\n const cloudSetting = settings.cloud ?? PowerPlatformCloud.Prod\n const agentType = settings.copilotAgentType ?? AgentType.Published\n\n logger.debug(`Using cloud setting: ${cloudSetting}`)\n logger.debug(`Using agent type: ${agentType}`)\n\n if (cloudSetting === PowerPlatformCloud.Other) {\n if (!settings.customPowerPlatformCloud?.trim()) {\n throw new Error('customPowerPlatformCloud must be provided when PowerPlatformCloud is Other')\n } else if (isValidUri(settings.customPowerPlatformCloud)) {\n logger.debug(`Using custom Power Platform cloud: ${settings.customPowerPlatformCloud}`)\n } else {\n throw new Error(\n 'customPowerPlatformCloud must be a valid URL'\n )\n }\n }\n\n const host = getEnvironmentEndpoint(cloudSetting, settings.environmentId!, settings.customPowerPlatformCloud)\n\n const strategy = {\n [AgentType.Published]: () => new PublishedBotStrategy({\n host,\n schema: schemaName!,\n }),\n [AgentType.Prebuilt]: () => new PrebuiltBotStrategy({\n host,\n schema: schemaName!,\n }),\n }[agentType]()\n\n const url = strategy.getConversationUrl(conversationId)\n logger.debug(`Generated Copilot Studio connection URL: ${url}`)\n return url\n}\n\n/**\n * Returns the Power Platform API Audience.\n * @param settings - Configuration Settings to use.\n * @param cloud - Optional Power Platform Cloud Hosting Agent.\n * @param cloudBaseAddress - Optional Power Platform API endpoint to use if Cloud is configured as \"other\".\n * @param directConnectUrl - Optional DirectConnection URL to a given Copilot Studio agent, if provided all other settings are ignored.\n * @returns The Power Platform Audience.\n * @throws Will throw an error if required settings are missing or invalid.\n */\nexport function getTokenAudience (\n settings?: ConnectionSettings,\n cloud: PowerPlatformCloud = PowerPlatformCloud.Unknown,\n cloudBaseAddress: string = '',\n directConnectUrl: string = ''): string {\n if (!directConnectUrl && !settings?.directConnectUrl) {\n if (cloud === PowerPlatformCloud.Other && !cloudBaseAddress) {\n throw new Error('cloudBaseAddress must be provided when PowerPlatformCloudCategory is Other')\n }\n if (!settings && cloud === PowerPlatformCloud.Unknown) {\n throw new Error('Either settings or cloud must be provided')\n }\n if (settings && settings.cloud && settings.cloud !== PowerPlatformCloud.Unknown) {\n cloud = settings.cloud\n }\n if (cloud === PowerPlatformCloud.Other) {\n if (cloudBaseAddress && isValidUri(cloudBaseAddress)) {\n cloud = PowerPlatformCloud.Other\n } else if (settings?.customPowerPlatformCloud && isValidUri(settings!.customPowerPlatformCloud)) {\n cloud = PowerPlatformCloud.Other\n cloudBaseAddress = settings.customPowerPlatformCloud\n } else {\n throw new Error('Either CustomPowerPlatformCloud or cloudBaseAddress must be provided when PowerPlatformCloudCategory is Other')\n }\n }\n cloudBaseAddress ??= 'api.unknown.powerplatform.com'\n return `https://${getEndpointSuffix(cloud, cloudBaseAddress)}/.default`\n } else {\n if (!directConnectUrl) {\n directConnectUrl = settings?.directConnectUrl ?? ''\n }\n if (directConnectUrl && isValidUri(directConnectUrl)) {\n if (decodeCloudFromURI(new URL(directConnectUrl)) === PowerPlatformCloud.Unknown) {\n const cloudToTest: PowerPlatformCloud = settings?.cloud ?? cloud\n\n if (cloudToTest === PowerPlatformCloud.Other || cloudToTest === PowerPlatformCloud.Unknown) {\n throw new Error('Unable to resolve the PowerPlatform Cloud from DirectConnectUrl. The Token Audience resolver requires a specific PowerPlatformCloudCategory.')\n }\n if ((cloudToTest as PowerPlatformCloud) !== PowerPlatformCloud.Unknown) {\n return `https://${getEndpointSuffix(cloudToTest, '')}/.default`\n } else {\n throw new Error('Unable to resolve the PowerPlatform Cloud from DirectConnectUrl. The Token Audience resolver requires a specific PowerPlatformCloudCategory.')\n }\n }\n return `https://${getEndpointSuffix(decodeCloudFromURI(new URL(directConnectUrl)), '')}/.default`\n } else {\n throw new Error('DirectConnectUrl must be provided when DirectConnectUrl is set')\n }\n }\n}\nfunction isValidUri (uri: string): boolean {\n try {\n const absoluteUrl = uri.startsWith('http') ? uri : `https://${uri}`\n const newUri = new URL(absoluteUrl)\n return !!newUri\n } catch {\n return false\n }\n}\n\nfunction createURL (base: string, conversationId?: string): URL {\n const url = new URL(base)\n\n if (!url.searchParams.has('api-version')) {\n url.searchParams.append('api-version', '2022-03-01-preview')\n }\n\n if (url.pathname.endsWith('/')) {\n url.pathname = url.pathname.slice(0, -1)\n }\n\n if (url.pathname.includes('/conversations')) {\n url.pathname = url.pathname.substring(0, url.pathname.indexOf('/conversations'))\n }\n\n url.pathname = `${url.pathname}/conversations`\n if (conversationId) {\n url.pathname = `${url.pathname}/${conversationId}`\n }\n\n return url\n}\n\nfunction getEnvironmentEndpoint (\n cloud: PowerPlatformCloud,\n environmentId: string,\n cloudBaseAddress?: string\n): URL {\n if (cloud === PowerPlatformCloud.Other && (!cloudBaseAddress || !cloudBaseAddress.trim())) {\n throw new Error('cloudBaseAddress must be provided when PowerPlatformCloud is Other')\n }\n\n cloudBaseAddress = cloudBaseAddress ?? 'api.unknown.powerplatform.com'\n\n const normalizedResourceId = environmentId.toLowerCase().replaceAll('-', '')\n const idSuffixLength = getIdSuffixLength(cloud)\n const hexPrefix = normalizedResourceId.substring(0, normalizedResourceId.length - idSuffixLength)\n const hexSuffix = normalizedResourceId.substring(normalizedResourceId.length - idSuffixLength)\n\n return new URL(`https://${hexPrefix}.${hexSuffix}.environment.${getEndpointSuffix(cloud, cloudBaseAddress)}`)\n}\n\nfunction getEndpointSuffix (\n category: PowerPlatformCloud,\n cloudBaseAddress: string\n): string {\n switch (category) {\n case PowerPlatformCloud.Local:\n return 'api.powerplatform.localhost'\n case PowerPlatformCloud.Exp:\n return 'api.exp.powerplatform.com'\n case PowerPlatformCloud.Dev:\n return 'api.dev.powerplatform.com'\n case PowerPlatformCloud.Prv:\n return 'api.prv.powerplatform.com'\n case PowerPlatformCloud.Test:\n return 'api.test.powerplatform.com'\n case PowerPlatformCloud.Preprod:\n return 'api.preprod.powerplatform.com'\n case PowerPlatformCloud.FirstRelease:\n case PowerPlatformCloud.Prod:\n return 'api.powerplatform.com'\n case PowerPlatformCloud.GovFR:\n return 'api.gov.powerplatform.microsoft.us'\n case PowerPlatformCloud.Gov:\n return 'api.gov.powerplatform.microsoft.us'\n case PowerPlatformCloud.High:\n return 'api.high.powerplatform.microsoft.us'\n case PowerPlatformCloud.DoD:\n return 'api.appsplatform.us'\n case PowerPlatformCloud.Mooncake:\n return 'api.powerplatform.partner.microsoftonline.cn'\n case PowerPlatformCloud.Ex:\n return 'api.powerplatform.eaglex.ic.gov'\n case PowerPlatformCloud.Rx:\n return 'api.powerplatform.microsoft.scloud'\n case PowerPlatformCloud.Other:\n return cloudBaseAddress\n default:\n throw new Error(`Invalid cluster category value: ${category}`)\n }\n}\n\nfunction getIdSuffixLength (cloud: PowerPlatformCloud): number {\n switch (cloud) {\n case PowerPlatformCloud.FirstRelease:\n case PowerPlatformCloud.Prod:\n return 2\n default:\n return 1\n }\n}\n\nfunction decodeCloudFromURI (uri: URL): PowerPlatformCloud {\n const host = uri.host.toLowerCase()\n\n switch (host) {\n case 'api.powerplatform.localhost':\n return PowerPlatformCloud.Local\n case 'api.exp.powerplatform.com':\n return PowerPlatformCloud.Exp\n case 'api.dev.powerplatform.com':\n return PowerPlatformCloud.Dev\n case 'api.prv.powerplatform.com':\n return PowerPlatformCloud.Prv\n case 'api.test.powerplatform.com':\n return PowerPlatformCloud.Test\n case 'api.preprod.powerplatform.com':\n return PowerPlatformCloud.Preprod\n case 'api.powerplatform.com':\n return PowerPlatformCloud.Prod\n case 'api.gov.powerplatform.microsoft.us':\n return PowerPlatformCloud.GovFR\n case 'api.high.powerplatform.microsoft.us':\n return PowerPlatformCloud.High\n case 'api.appsplatform.us':\n return PowerPlatformCloud.DoD\n case 'api.powerplatform.partner.microsoftonline.cn':\n return PowerPlatformCloud.Mooncake\n default:\n return PowerPlatformCloud.Unknown\n }\n}\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { Strategy, StrategySettings } from './strategy'\n\n/** @deprecated This interface will not be supported in future versions. Use StrategySettings instead. */\nexport interface PrebuiltBotStrategySettings {\n readonly host: URL;\n readonly identifier: string;\n}\n\n/**\n * Strategy for constructing PowerPlatform API connection URLs for prebuilt agents.\n */\nexport class PrebuiltBotStrategy implements Strategy {\n private readonly API_VERSION = '2022-03-01-preview'\n private baseURL: URL\n\n /**\n * @deprecated This constructor will not be supported in future versions. Use constructor (settings: StrategySettings).\n */\n constructor (settings: PrebuiltBotStrategySettings)\n constructor (settings: StrategySettings)\n constructor (settings: PrebuiltBotStrategySettings | StrategySettings) {\n const schema = 'schema' in settings ? settings.schema : settings.identifier\n const host = settings.host\n\n this.baseURL = new URL(\n `/copilotstudio/prebuilt/authenticated/bots/${schema}`,\n host\n )\n this.baseURL.searchParams.append('api-version', this.API_VERSION)\n }\n\n public getConversationUrl (conversationId?: string): string {\n const conversationUrl = new URL(this.baseURL.href)\n conversationUrl.pathname = `${conversationUrl.pathname}/conversations`\n\n if (conversationId) {\n conversationUrl.pathname = `${conversationUrl.pathname}/${conversationId}`\n }\n\n return conversationUrl.href\n }\n}\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { Strategy, StrategySettings } from './strategy'\n\n/** @deprecated This interface will not be supported in future versions. Use StrategySettings instead. */\nexport interface PublishedBotStrategySettings {\n readonly host: URL;\n readonly schema: string;\n}\n\n/**\n * Strategy for constructing PowerPlatform API connection URLs for published agents.\n */\nexport class PublishedBotStrategy implements Strategy {\n private readonly API_VERSION = '2022-03-01-preview'\n private baseURL: URL\n\n constructor (settings: PublishedBotStrategySettings)\n constructor (settings: StrategySettings) {\n const { schema, host } = settings\n\n this.baseURL = new URL(\n `/copilotstudio/dataverse-backed/authenticated/bots/${schema}`,\n host\n )\n this.baseURL.searchParams.append('api-version', this.API_VERSION)\n }\n\n public getConversationUrl (conversationId?: string): string {\n const conversationUrl = new URL(this.baseURL.href)\n conversationUrl.pathname = `${conversationUrl.pathname}/conversations`\n\n if (conversationId) {\n conversationUrl.pathname = `${conversationUrl.pathname}/${conversationId}`\n }\n\n return conversationUrl.href\n }\n}\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { createEventSource, EventSourceClient } from 'eventsource-client'\nimport { ConnectionSettings } from './connectionSettings'\nimport { getCopilotStudioConnectionUrl, getTokenAudience } from './powerPlatformEnvironment'\nimport { Activity, ActivityTypes, ConversationAccount } from '@microsoft/agents-activity'\nimport { ExecuteTurnRequest } from './executeTurnRequest'\nimport { debug } from '@microsoft/agents-activity/logger'\nimport { version } from '../package.json'\nimport os from 'os'\n\nconst logger = debug('copilot-studio:client')\n\n/**\n * Client for interacting with Microsoft Copilot Studio services.\n * Provides functionality to start conversations and send messages to Copilot Studio bots.\n */\nexport class CopilotStudioClient {\n /** Header key for conversation ID. */\n private static readonly conversationIdHeaderKey: string = 'x-ms-conversationid'\n /** Island Header key */\n private static readonly islandExperimentalUrlHeaderKey: string = 'x-ms-d2e-experimental'\n\n /** The ID of the current conversation. */\n private conversationId: string = ''\n /** The connection settings for the client. */\n private readonly settings: ConnectionSettings\n /** The authenticaton token. */\n private readonly token: string\n\n /**\n * Returns the scope URL needed to connect to Copilot Studio from the connection settings.\n * This is used for authentication token audience configuration.\n * @param settings Copilot Studio connection settings.\n * @returns The scope URL for token audience.\n */\n static scopeFromSettings: (settings: ConnectionSettings) => string = getTokenAudience\n\n /**\n * Creates an instance of CopilotStudioClient.\n * @param settings The connection settings.\n * @param token The authentication token.\n */\n constructor (settings: ConnectionSettings, token: string) {\n this.settings = settings\n this.token = token\n }\n\n /**\n * Streams activities from the Copilot Studio service using eventsource-client.\n * @param url The connection URL for Copilot Studio.\n * @param body Optional. The request body (for POST).\n * @param method Optional. The HTTP method (default: POST).\n * @returns An async generator yielding the Agent's Activities.\n */\n private async * postRequestAsync (url: string, body?: any, method: string = 'POST'): AsyncGenerator<Activity> {\n logger.debug(`>>> SEND TO ${url}`)\n\n const streamMap = new Map<string, { text: string, sequence: number }[]>()\n\n const eventSource: EventSourceClient = createEventSource({\n url,\n headers: {\n Authorization: `Bearer ${this.token}`,\n 'User-Agent': CopilotStudioClient.getProductInfo(),\n 'Content-Type': 'application/json',\n Accept: 'text/event-stream'\n },\n body: body ? JSON.stringify(body) : undefined,\n method,\n fetch: async (url, init) => {\n const response = await fetch(url, init)\n this.processResponseHeaders(response.headers)\n return response\n }\n })\n\n try {\n for await (const { data, event } of eventSource) {\n if (data && event === 'activity') {\n try {\n const activity = Activity.fromJson(data)\n\n // check to see if this activity is part of the streamed response, in which case we need to accumulate the text\n const streamingEntity = activity.entities?.find(e => e.type === 'streaminfo' && e.streamType === 'streaming')\n switch (activity.type) {\n case ActivityTypes.Message:\n if (!this.conversationId.trim()) { // Did not get it from the header.\n this.conversationId = activity.conversation?.id ?? ''\n logger.debug(`Conversation ID: ${this.conversationId}`)\n }\n yield activity\n break\n case ActivityTypes.Typing:\n logger.debug(`Activity type: ${activity.type}`)\n // Accumulate the text as it comes in from the stream.\n // This also accounts for the \"old style\" of streaming where the stream info is in channelData.\n if (streamingEntity || activity.channelData?.streamType === 'streaming') {\n const text = activity.text ?? ''\n const id = (streamingEntity?.streamId ?? activity.channelData?.streamId)\n const sequence = (streamingEntity?.streamSequence ?? activity.channelData?.streamSequence)\n // Accumulate the text chunks based on stream ID and sequence number.\n if (id && sequence) {\n if (streamMap.has(id)) {\n const existing = streamMap.get(id)!\n existing.push({ text, sequence })\n streamMap.set(id, existing)\n } else {\n streamMap.set(id, [{ text, sequence }])\n }\n activity.text = streamMap.get(id)?.sort((a, b) => a.sequence - b.sequence).map(item => item.text).join('') || ''\n }\n }\n yield activity\n break\n default:\n logger.debug(`Activity type: ${activity.type}`)\n yield activity\n break\n }\n } catch (error) {\n logger.error('Failed to parse activity:', error)\n }\n } else if (event === 'end') {\n logger.debug('Stream complete')\n break\n }\n\n if (eventSource.readyState === 'closed') {\n logger.debug('Connection closed')\n break\n }\n }\n } finally {\n eventSource.close()\n }\n }\n\n /**\n * Appends this package.json version to the User-Agent header.\n * - For browser environments, it includes the user agent of the browser.\n * - For Node.js environments, it includes the Node.js version, platform, architecture, and release.\n * @returns A string containing the product information, including version and user agent.\n */\n private static getProductInfo (): string {\n const versionString = `CopilotStudioClient.agents-sdk-js/${version}`\n let userAgent: string\n\n if (typeof window !== 'undefined' && window.navigator) {\n userAgent = `${versionString} ${navigator.userAgent}`\n } else {\n userAgent = `${versionString} nodejs/${process.version} ${os.platform()}-${os.arch()}/${os.release()}`\n }\n\n logger.debug(`User-Agent: ${userAgent}`)\n return userAgent\n }\n\n private processResponseHeaders (responseHeaders: Headers): void {\n if (this.settings.useExperimentalEndpoint && !this.settings.directConnectUrl?.trim()) {\n const islandExperimentalUrl = responseHeaders?.get(CopilotStudioClient.islandExperimentalUrlHeaderKey)\n if (islandExperimentalUrl) {\n this.settings.directConnectUrl = islandExperimentalUrl\n logger.debug(`Island Experimental URL: ${islandExperimentalUrl}`)\n }\n }\n\n this.conversationId = responseHeaders?.get(CopilotStudioClient.conversationIdHeaderKey) ?? ''\n if (this.conversationId) {\n logger.debug(`Conversation ID: ${this.conversationId}`)\n }\n\n const sanitizedHeaders = new Headers()\n responseHeaders.forEach((value, key) => {\n if (key.toLowerCase() !== 'authorization' && key.toLowerCase() !== CopilotStudioClient.conversationIdHeaderKey.toLowerCase()) {\n sanitizedHeaders.set(key, value)\n }\n })\n logger.debug('Headers received:', sanitizedHeaders)\n }\n\n /**\n * Starts a new conversation with the Copilot Studio service.\n * @param emitStartConversationEvent Whether to emit a start conversation event. Defaults to true.\n * @returns An async generator yielding the Agent's Activities.\n */\n public async * startConversationStreaming (emitStartConversationEvent: boolean = true): AsyncGenerator<Activity> {\n const uriStart: string = getCopilotStudioConnectionUrl(this.settings)\n const body = { emitStartConversationEvent }\n\n logger.info('Starting conversation ...')\n\n yield * this.postRequestAsync(uriStart, body, 'POST')\n }\n\n /**\n * Sends an activity to the Copilot Studio service and retrieves the response activities.\n * @param activity The activity to send.\n * @param conversationId The ID of the conversation. Defaults to the current conversation ID.\n * @returns An async generator yielding the Agent's Activities.\n */\n public async * sendActivityStreaming (activity: Activity, conversationId: string = this.conversationId) : AsyncGenerator<Activity> {\n const localConversationId = activity.conversation?.id ?? conversationId\n const uriExecute = getCopilotStudioConnectionUrl(this.settings, localConversationId)\n const qbody: ExecuteTurnRequest = new ExecuteTurnRequest(activity)\n\n logger.info('Sending activity...', activity)\n yield * this.postRequestAsync(uriExecute, qbody, 'POST')\n }\n\n /**\n * Starts a new conversation with the Copilot Studio service.\n * @param emitStartConversationEvent Whether to emit a start conversation event. Defaults to true.\n * @returns A promise yielding an array of activities.\n * @deprecated Use startConversationStreaming instead.\n */\n public async startConversationAsync (emitStartConversationEvent: boolean = true): Promise<Activity[]> {\n const result: Activity[] = []\n for await (const value of this.startConversationStreaming(emitStartConversationEvent)) {\n result.push(value)\n }\n return result\n }\n\n /**\n * Sends a question to the Copilot Studio service and retrieves the response activities.\n * @param question The question to ask.\n * @param conversationId The ID of the conversation. Defaults to the current conversation ID.\n * @returns A promise yielding an array of activities.\n * @deprecated Use sendActivityStreaming instead.\n */\n public async askQuestionAsync (question: string, conversationId?: string) : Promise<Activity[]> {\n const localConversationId = conversationId?.trim() ? conversationId : this.conversationId\n const conversationAccount: ConversationAccount = {\n id: localConversationId\n }\n const activityObj = {\n type: 'message',\n text: question,\n conversation: conversationAccount\n }\n const activity = Activity.fromObject(activityObj)\n\n const result: Activity[] = []\n for await (const value of this.sendActivityStreaming(activity, conversationId)) {\n result.push(value)\n }\n return result\n }\n\n /**\n * Sends an activity to the Copilot Studio service and retrieves the response activities.\n * @param activity The activity to send.\n * @param conversationId The ID of the conversation. Defaults to the current conversation ID.\n * @returns A promise yielding an array of activities.\n * @deprecated Use sendActivityStreaming instead.\n */\n public async sendActivity (activity: Activity, conversationId: string = this.conversationId) : Promise<Activity[]> {\n const result: Activity[] = []\n for await (const value of this.sendActivityStreaming(activity, conversationId)) {\n result.push(value)\n }\n return result\n }\n}\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Activity } from '@microsoft/agents-activity'\n\n/**\n * Represents a request to execute a turn in a conversation.\n * This class encapsulates the activity to be executed during the turn.\n */\nexport class ExecuteTurnRequest {\n /** The activity to be executed. */\n activity?: Activity\n\n /**\n * Creates an instance of ExecuteTurnRequest.\n * @param activity The activity to be executed.\n */\n constructor (activity?: Activity) {\n this.activity = activity\n }\n}\n", "{\n \"name\": \"@microsoft/agents-copilotstudio-client\",\n \"version\": \"1.3.0-beta.13.g4c051861c4\",\n \"homepage\": \"https://github.com/microsoft/Agents-for-js\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/microsoft/Agents-for-js.git\"\n },\n \"author\": {\n \"name\": \"Microsoft\",\n \"email\": \"agentssdk@microsoft.com\",\n \"url\": \"https://aka.ms/Agents\"\n },\n \"description\": \"Microsoft Copilot Studio Client for JavaScript. Copilot Studio Client.\",\n \"keywords\": [\n \"Agents\",\n \"copilotstudio\",\n \"powerplatform\"\n ],\n \"main\": \"dist/src/index.js\",\n \"types\": \"dist/src/index.d.ts\",\n \"browser\": {\n \"os\": \"./src/browser/os.ts\",\n \"crypto\": \"./src/browser/crypto.ts\"\n },\n \"scripts\": {\n \"build:browser\": \"esbuild --platform=browser --target=es2019 --format=esm --bundle --sourcemap --minify --outfile=dist/src/browser.mjs src/index.ts\"\n },\n \"dependencies\": {\n \"@microsoft/agents-activity\": \"1.3.0-beta.13.g4c051861c4\",\n \"eventsource-client\": \"^1.2.0\",\n \"rxjs\": \"7.8.2\",\n \"uuid\": \"^11.1.0\"\n },\n \"license\": \"MIT\",\n \"files\": [\n \"README.md\",\n \"dist/src\",\n \"src\",\n \"package.json\"\n ],\n \"exports\": {\n \".\": {\n \"types\": \"./dist/src/index.d.ts\",\n \"import\": {\n \"browser\": \"./dist/src/browser.mjs\",\n \"default\": \"./dist/src/index.js\"\n },\n \"require\": {\n \"default\": \"./dist/src/index.js\"\n }\n },\n \"./package.json\": \"./package.json\"\n },\n \"engines\": {\n \"node\": \">=20.0.0\"\n }\n}", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type * as osTypes from 'os'\n\nexport default {} as typeof osTypes\n", "import validate from './validate.js';\nconst byteToHex = [];\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\nexport function unsafeStringify(arr, offset = 0) {\n return (byteToHex[arr[offset + 0]] +\n byteToHex[arr[offset + 1]] +\n byteToHex[arr[offset + 2]] +\n byteToHex[arr[offset + 3]] +\n '-' +\n byteToHex[arr[offset + 4]] +\n byteToHex[arr[offset + 5]] +\n '-' +\n byteToHex[arr[offset + 6]] +\n byteToHex[arr[offset + 7]] +\n '-' +\n byteToHex[arr[offset + 8]] +\n byteToHex[arr[offset + 9]] +\n '-' +\n byteToHex[arr[offset + 10]] +\n byteToHex[arr[offset + 11]] +\n byteToHex[arr[offset + 12]] +\n byteToHex[arr[offset + 13]] +\n byteToHex[arr[offset + 14]] +\n byteToHex[arr[offset + 15]]).toLowerCase();\n}\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset);\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n return uuid;\n}\nexport default stringify;\n", "let getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n if (!getRandomValues) {\n if (typeof crypto === 'undefined' || !crypto.getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n getRandomValues = crypto.getRandomValues.bind(crypto);\n }\n return getRandomValues(rnds8);\n}\n", "const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default { randomUUID };\n", "import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n options = options || {};\n const rnds = options.random ?? options.rng?.() ?? rng();\n if (rnds.length < 16) {\n throw new Error('Random bytes length must be >= 16');\n }\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n if (buf) {\n offset = offset || 0;\n if (offset < 0 || offset + 16 > buf.length) {\n throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);\n }\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n return buf;\n }\n return unsafeStringify(rnds);\n}\nexport default v4;\n", "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { v4 as uuid } from 'uuid'\n\nimport { Activity, Attachment, ConversationAccount } from '@microsoft/agents-activity'\nimport { Observable, BehaviorSubject, type Subscriber } from 'rxjs'\n\nimport { CopilotStudioClient } from './copilotStudioClient'\nimport { debug } from '@microsoft/agents-activity/logger'\n\nconst logger = debug('copilot-studio:webchat')\n\n/**\n * Configuration settings for the Copilot Studio WebChat connection.\n * These settings control the behavior and appearance of the WebChat interface\n * when connected to the Copilot Studio service.\n */\nexport interface CopilotStudioWebChatSettings {\n /**\n * Whether to show typing indicators in the WebChat when the agent is processing a response.\n * When enabled, users will see a typing indicator while waiting for the agent's reply,\n * providing visual feedback that their message is being processed.\n * @default false\n */\n showTyping?: boolean;\n}\n\n/**\n * Represents a connection interface for integrating Copilot Studio with WebChat.\n *\n * @remarks\n * This interface provides the necessary methods and observables to facilitate\n * bidirectional communication between a WebChat client and the Copilot Studio service.\n *\n * The connection follows the DirectLine protocol pattern, making it compatible with\n * Microsoft Bot Framework WebChat components.\n */\nexport interface CopilotStudioWebChatConnection {\n /**\n * An observable that emits the current connection status as numeric values.\n * This allows WebChat clients to monitor and react to connection state changes.\n *\n * Connection status values:\n * - 0: Disconnected - No active connection to the service\n * - 1: Connecting - Attempting to establish connection\n * - 2: Connected - Successfully connected and ready for communication\n */\n connectionStatus$: BehaviorSubject<number>;\n\n /**\n * An observable stream that emits incoming activities from the Copilot Studio service.\n * Each activity represents a message, card, or other interactive element sent by the agent.\n *\n * All emitted activities include:\n * - A timestamp indicating when the activity was received\n * - A 'webchat:sequence-id' in their channelData for proper message ordering\n * - Standard Bot Framework Activity properties (type, text, attachments, etc.)\n */\n activity$: Observable<Partial<Activity>>;\n\n /**\n * Posts a user activity to the Copilot Studio service and returns an observable\n * that emits the activity ID once the message is successfully sent.\n *\n * The method validates that the activity contains meaningful content and handles\n * the complete message flow including optional typing indicators.\n *\n * @param activity - The user activity to send.\n * @returns An observable that emits the unique activity ID upon successful posting.\n * @throws Error if the activity text is empty or if the connection is not properly initialized.\n */\n postActivity(activity: Activity): Observable<string>;\n\n /**\n * Gracefully terminates the connection to the Copilot Studio service.\n * This method ensures proper cleanup by completing all active observables\n * and releasing associated resources.\n *\n * After calling this method:\n * - The connectionStatus$ observable will be completed\n * - The activity$ observable will stop emitting new activities\n * - No further activities can be posted through this connection\n */\n end(): void;\n}\n\n/**\n * Creates a wrapper that invokes `fn` at most once.\n * On the first call the wrapper invokes `fn(value)` and returns whatever `fn` returns.\n * Subsequent calls do nothing and return `undefined`.\n *\n * @template T - Type of the single argument passed to the wrapped function.\n * @param fn Function to be invoked once.\n * @returns A wrapper function that calls `fn` at most once.\n */\nfunction once<T = void> (fn: (value: T) => Promise<void>): (value: T) => Promise<void> | void {\n let called = false\n\n return value => {\n if (!called) {\n called = true\n\n return fn(value)\n }\n }\n}\n\n/**\n * A utility class that provides WebChat integration capabilities for Copilot Studio services.\n *\n * @remarks\n * This class acts as a bridge between Microsoft Bot Framework WebChat and Copilot Studio,\n * enabling seamless communication through a DirectLine-compatible interface.\n *\n * ## Key Features:\n * - DirectLine protocol compatibility for easy WebChat integration\n * - Real-time bidirectional messaging with Copilot Studio agents\n * - Automatic conversation management and message sequencing\n * - Optional typing indicators for enhanced user experience\n * - Observable-based architecture for reactive programming patterns\n *\n * ## Usage Scenarios:\n * - Embedding Copilot Studio agents in web applications\n * - Creating custom chat interfaces with WebChat components\n * - Building conversational AI experiences with Microsoft's bot ecosystem\n *\n * @example Basic WebChat Integration\n * ```typescript\n * import { CopilotStudioClient } from '@microsoft/agents-copilotstudio-client';\n * import { CopilotStudioWebChat } from '@microsoft/agents-copilotstudio-client';\n *\n * // Initialize the Copilot Studio client\n * const client = new CopilotStudioClient({\n * botId: 'your-bot-id',\n * tenantId: 'your-tenant-id'\n * });\n *\n * // Create a WebChat-compatible connection\n * const directLine = CopilotStudioWebChat.createConnection(client, {\n * showTyping: true\n * });\n *\n * // Integrate with WebChat\n * window.WebChat.renderWebChat({\n * directLine: directLine,\n * // ... other WebChat options\n * }, document.getElementById('webchat'));\n * ```\n *\n * @example Advanced Usage with Connection Monitoring\n * ```typescript\n * const connection = CopilotStudioWebChat.createConnection(client);\n *\n * // Monitor connection status\n * connection.connectionStatus$.subscribe(status => {\n * switch (status) {\n * case 0: console.log('Disconnected'); break;\n * case 1: console.log('Connecting...'); break;\n * case 2: console.log('Connected and ready'); break;\n * }\n * });\n *\n * // Listen for incoming activities\n * connection.activity$.subscribe(activity => {\n * console.log('Received activity:', activity);\n * });\n * ```\n */\nexport class CopilotStudioWebChat {\n /**\n * Creates a DirectLine-compatible connection for integrating Copilot Studio with WebChat.\n *\n\n * @param client - A configured CopilotStudioClient instance that handles the underlying\n * communication with the Copilot Studio service. This client should be\n * properly authenticated and configured with the target bot details.\n *\n * @param settings - Optional configuration settings that control the behavior of the\n * WebChat connection. These settings allow customization of features\n * like typing indicators and other user experience enhancements.\n *\n * @returns A new CopilotStudioWebChatConnection instance that can be passed directly\n * to WebChat's renderWebChat function as the directLine parameter. The\n * connection is immediately ready for use and will automatically manage\n * the conversation lifecycle.\n *\n * @throws Error if the provided client is not properly configured or if there are\n * issues establishing the initial connection to the Copilot Studio service.\n *\n * @remarks\n * This method establishes a real-time communication channel between WebChat and the\n * Copilot Studio service. The returned connection object implements the DirectLine\n * protocol, making it fully compatible with Microsoft Bot Framework WebChat components.\n *\n * ## Connection Lifecycle:\n * 1. **Initialization**: Creates observables for connection status and activity streaming\n * 2. **Conversation Start**: Automatically initiates conversation when first activity is posted\n * 3. **Message Flow**: Handles bidirectional message exchange with proper sequencing\n * 4. **Cleanup**: Provides graceful connection termination\n *\n * ## Message Processing:\n * - User messages are validated and sent to Copilot Studio\n * - Agent responses are received and formatted for WebChat\n * - All activities include timestamps and sequence IDs for proper ordering\n * - Optional typing indicators provide visual feedback during processing\n *\n * @example\n * ```typescript\n * const connection = CopilotStudioWebChat.createConnection(client, {\n * showTyping: true\n * });\n *\n * // Use with WebChat\n * window.WebChat.renderWebChat({\n * directLine: connection\n * }, document.getElementById('webchat'));\n * ```\n */\n static createConnection (\n client: CopilotStudioClient,\n settings?: CopilotStudioWebChatSettings\n ): CopilotStudioWebChatConnection {\n logger.info('--> Creating connection between Copilot Studio and WebChat ...')\n let sequence = 0\n let activitySubscriber: Subscriber<Partial<Activity>> | undefined\n let conversation: ConversationAccount | undefined\n\n const connectionStatus$ = new BehaviorSubject(0)\n const activity$ = createObservable<Partial<Activity>>(async (subscriber) => {\n activitySubscriber = subscriber\n\n const handleAcknowledgementOnce = once(async (): Promise<void> => {\n connectionStatus$.next(2)\n await Promise.resolve() // Webchat requires an extra tick to process the connection status change\n })\n\n logger.debug('--> Connection established.')\n notifyTyping()\n\n if (connectionStatus$.value < 2) {\n for await (const activity of client.startConversationStreaming()) {\n delete activity.replyToId\n if (!conversation && activity.conversation) {\n conversation = activity.conversation\n await handleAcknowledgementOnce()\n }\n\n notifyActivity(activity)\n }\n // If no activities received from bot, we should still acknowledge.\n await handleAcknowledgementOnce()\n }\n })\n\n const notifyActivity = (activity: Partial<Activity>) => {\n const newActivity = {\n ...activity,\n timestamp: new Date().toISOString(),\n channelData: {\n ...activity.channelData,\n 'webchat:sequence-id': sequence,\n },\n }\n sequence++\n logger.debug(`Notify '${newActivity.type}' activity to WebChat:`, newActivity)\n activitySubscriber?.next(newActivity)\n }\n\n const notifyTyping = () => {\n if (!settings?.showTyping) {\n return\n }\n\n const from = conversation\n ? { id: conversation.id, name: conversation.name }\n : { id: 'agent', name: 'Agent' }\n notifyActivity({ type: 'typing', from })\n }\n\n return {\n connectionStatus$,\n activity$,\n postActivity (activity: Activity) {\n logger.info('--> Preparing to send activity to Copilot Studio ...')\n\n if (!activity) {\n throw new Error('Activity cannot be null.')\n }\n\n if (!activitySubscriber) {\n throw new Error('Activity subscriber is not initialized.')\n }\n\n return createObservable<string>(async (subscriber) => {\n try {\n logger.info('--> Sending activity to Copilot Studio ...')\n const newActivity = Activity.fromObject({\n ...activity,\n id: uuid(),\n attachments: await processAttachments(activity)\n })\n\n notifyActivity(newActivity)\n notifyTyping()\n\n // Notify WebChat immediately that the message was sent\n subscriber.next(newActivity.id!)\n\n // Stream the agent's response, but don't block the UI\n for await (const responseActivity of client.sendActivityStreaming(newActivity)) {\n notifyActivity(responseActivity)\n logger.info('<-- Activity received correctly from Copilot Studio.')\n }\n\n subscriber.complete()\n } catch (error) {\n logger.error('Error sending Activity to Copilot Studio:', error)\n subscriber.error(error)\n }\n })\n },\n\n end () {\n logger.info('--> Ending connection between Copilot Studio and WebChat ...')\n connectionStatus$.complete()\n if (activitySubscriber) {\n activitySubscriber.complete()\n activitySubscriber = undefined\n }\n },\n }\n }\n}\n\n/**\n * Processes activity attachments.\n * @param activity The activity to process for attachments.\n * @returns A promise that resolves to the activity with all attachments converted.\n */\nasync function processAttachments (activity: Activity): Promise<Attachment[]> {\n if (activity.type !== 'message' || !activity.attachments?.length) {\n return activity.attachments || []\n }\n\n const attachments: Attachment[] = []\n for (const attachment of activity.attachments) {\n const processed = await processBlobAttachment(attachment)\n attachments.push(processed)\n }\n\n return attachments\n}\n\n/**\n * Processes a blob attachment to convert its content URL to a data URL.\n * @param attachment The attachment to process.\n * @returns A promise that resolves to the processed attachment.\n */\nasync function processBlobAttachment (attachment: Attachment): Promise<Attachment> {\n let newContentUrl = attachment.contentUrl\n if (!newContentUrl?.startsWith('blob:')) {\n return attachment\n }\n\n try {\n const response = await fetch(newContentUrl)\n if (!response.ok) {\n throw new Error(`Failed to fetch blob URL: ${response.status} ${response.statusText}`)\n }\n\n const blob = await response.blob()\n const arrayBuffer = await blob.arrayBuffer()\n const base64 = arrayBufferToBase64(arrayBuffer)\n newContentUrl = `data:${blob.type};base64,${base64}`\n } catch (error) {\n newContentUrl = attachment.contentUrl\n logger.error('Error processing blob attachment:', newContentUrl, error)\n }\n\n return { ...attachment, contentUrl: newContentUrl }\n}\n\n/**\n * Converts an ArrayBuffer to a base64 string.\n * @param buffer The ArrayBuffer to convert.\n * @returns The base64 encoded string.\n */\nfunction arrayBufferToBase64 (buffer: ArrayBuffer): string {\n // Node.js environment\n const BufferClass = typeof globalThis.Buffer === 'function' ? globalThis.Buffer : undefined\n if (BufferClass && typeof BufferClass.from === 'function') {\n return BufferClass.from(buffer).toString('base64')\n }\n\n // Browser environment\n let binary = ''\n for (const byte of new Uint8Array(buffer)) {\n binary += String.fromCharCode(byte)\n }\n return btoa(binary)\n}\n\n/**\n * Creates an RxJS Observable that wraps an asynchronous function execution.\n *\n * @typeParam T - The type of value that the observable will emit\n * @param fn - An asynchronous function that receives a Subscriber and performs\n * the desired async operation. The function should call subscriber.next()\n * with results and subscriber.complete() when finished.\n * @returns A new Observable that executes the provided function and emits its results\n *\n * @remarks\n * This utility function provides a clean way to convert async/await patterns\n * into Observable streams, enabling integration with reactive programming patterns\n * used throughout the WebChat connection implementation.\n *\n * The created Observable handles promise resolution and rejection automatically,\n * converting them to appropriate next/error signals for subscribers.\n *\n * @example\n * ```typescript\n * const dataObservable = createObservable<string>(async (subscriber) => {\n * try {\n * const result = await fetchData();\n * subscriber.next(result);\n * subscriber.complete();\n * } catch (error) {\n * subscriber.error(error);\n * }\n * });\n * ```\n */\nfunction createObservable<T> (fn: (subscriber: Subscriber<T>) => void): Observable<T> {\n return new Observable<T>((subscriber: Subscriber<T>) => {\n Promise.resolve(fn(subscriber)).catch((error) => subscriber.error(error))\n })\n}\n", "/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nvar ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n __rewriteRelativeImportExtension,\n};\n", "/**\n * Returns true if the object is a function.\n * @param value The value to check\n */\nexport function isFunction(value: any): value is (...args: any[]) => any {\n return typeof value === 'function';\n}\n", "/**\n * Used to create Error subclasses until the community moves away from ES5.\n *\n * This is because compiling from TypeScript down to ES5 has issues with subclassing Errors\n * as well as other built-in types: https://github.com/Microsoft/TypeScript/issues/12123\n *\n * @param createImpl A factory function to create the actual constructor implementation. The returned\n * function should be a named function that calls `_super` internally.\n */\nexport function createErrorClass<T>(createImpl: (_super: any) => any): T {\n const _super = (instance: any) => {\n Error.call(instance);\n instance.stack = new Error().stack;\n };\n\n const ctorFunc = createImpl(_super);\n ctorFunc.prototype = Object.create(Error.prototype);\n ctorFunc.prototype.constructor = ctorFunc;\n return ctorFunc;\n}\n", "import { createErrorClass } from './createErrorClass';\n\nexport interface UnsubscriptionError extends Error {\n readonly errors: any[];\n}\n\nexport interface UnsubscriptionErrorCtor {\n /**\n * @deprecated Internal implementation detail. Do not construct error instances.\n * Cannot be tagged as internal: https://github.com/ReactiveX/rxjs/issues/6269\n */\n new (errors: any[]): UnsubscriptionError;\n}\n\n/**\n * An error thrown when one or more errors have occurred during the\n * `unsubscribe` of a {@link Subscription}.\n */\nexport const UnsubscriptionError: UnsubscriptionErrorCtor = createErrorClass(\n (_super) =>\n function UnsubscriptionErrorImpl(this: any, errors: (Error | string)[]) {\n _super(this);\n this.message = errors\n ? `${errors.length} errors occurred during unsubscription:\n${errors.map((err, i) => `${i + 1}) ${err.toString()}`).join('\\n ')}`\n : '';\n this.name = 'UnsubscriptionError';\n this.errors = errors;\n }\n);\n", "/**\n * Removes an item from an array, mutating it.\n * @param arr The array to remove the item from\n * @param item The item to remove\n */\nexport function arrRemove<T>(arr: T[] | undefined | null, item: T) {\n if (arr) {\n const index = arr.indexOf(item);\n 0 <= index && arr.splice(index, 1);\n }\n}\n", "import { isFunction } from './util/isFunction';\nimport { UnsubscriptionError } from './util/UnsubscriptionError';\nimport { SubscriptionLike, TeardownLogic, Unsubscribable } from './types';\nimport { arrRemove } from './util/arrRemove';\n\n/**\n * Represents a disposable resource, such as the execution of an Observable. A\n * Subscription has one important method, `unsubscribe`, that takes no argument\n * and just disposes the resource held by the subscription.\n *\n * Additionally, subscriptions may be grouped together through the `add()`\n * method, which will attach a child Subscription to the current Subscription.\n * When a Subscription is unsubscribed, all its children (and its grandchildren)\n * will be unsubscribed as well.\n */\nexport class Subscription implements SubscriptionLike {\n public static EMPTY = (() => {\n const empty = new Subscription();\n empty.closed = true;\n return empty;\n })();\n\n /**\n * A flag to indicate whether this Subscription has already been unsubscribed.\n */\n public closed = false;\n\n private _parentage: Subscription[] | Subscription | null = null;\n\n /**\n * The list of registered finalizers to execute upon unsubscription. Adding and removing from this\n * list occurs in the {@link #add} and {@link #remove} methods.\n */\n private _finalizers: Exclude<TeardownLogic, void>[] | null = null;\n\n /**\n * @param initialTeardown A function executed first as part of the finalization\n * process that is kicked off when {@link #unsubscribe} is called.\n */\n constructor(private initialTeardown?: () => void) {}\n\n /**\n * Disposes the resources held by the subscription. May, for instance, cancel\n * an ongoing Observable execution or cancel any other type of work that\n * started when the Subscription was created.\n */\n unsubscribe(): void {\n let errors: any[] | undefined;\n\n if (!this.closed) {\n this.closed = true;\n\n // Remove this from it's parents.\n const { _parentage } = this;\n if (_parentage) {\n this._parentage = null;\n if (Array.isArray(_parentage)) {\n for (const parent of _parentage) {\n parent.remove(this);\n }\n } else {\n _parentage.remove(this);\n }\n }\n\n const { initialTeardown: initialFinalizer } = this;\n if (isFunction(initialFinalizer)) {\n try {\n initialFinalizer();\n } catch (e) {\n errors = e instanceof UnsubscriptionError ? e.errors : [e];\n }\n }\n\n const { _finalizers } = this;\n if (_finalizers) {\n this._finalizers = null;\n for (const finalizer of _finalizers) {\n try {\n execFinalizer(finalizer);\n } catch (err) {\n errors = errors ?? [];\n if (err instanceof UnsubscriptionError) {\n errors = [...errors, ...err.errors];\n } else {\n errors.push(err);\n }\n }\n }\n }\n\n if (errors) {\n throw new UnsubscriptionError(errors);\n }\n }\n }\n\n /**\n * Adds a finalizer to this subscription, so that finalization will be unsubscribed/called\n * when this subscription is unsubscribed. If this subscription is already {@link #closed},\n * because it has already been unsubscribed, then whatever finalizer is passed to it\n * will automatically be executed (unless the finalizer itself is also a closed subscription).\n *\n * Closed Subscriptions cannot be added as finalizers to any subscription. Adding a closed\n * subscription to a any subscription will result in no operation. (A noop).\n *\n * Adding a subscription to itself, or adding `null` or `undefined` will not perform any\n * operation at all. (A noop).\n *\n * `Subscription` instances that are added to this instance will automatically remove themselves\n * if they are unsubscribed. Functions and {@link Unsubscribable} objects that you wish to remove\n * will need to be removed manually with {@link #remove}\n *\n * @param teardown The finalization logic to add to this subscription.\n */\n add(teardown: TeardownLogic): void {\n // Only add the finalizer if it's not undefined\n // and don't add a subscription to itself.\n if (teardown && teardown !== this) {\n if (this.closed) {\n // If this subscription is already closed,\n // execute whatever finalizer is handed to it automatically.\n execFinalizer(teardown);\n } else {\n if (teardown instanceof Subscription) {\n // We don't add closed subscriptions, and we don't add the same subscription\n // twice. Subscription unsubscribe is idempotent.\n if (teardown.closed || teardown._hasParent(this)) {\n return;\n }\n teardown._addParent(this);\n }\n (this._finalizers = this._finalizers ?? []).push(teardown);\n }\n }\n }\n\n /**\n * Checks to see if a this subscription already has a particular parent.\n * This will signal that this subscription has already been added to the parent in question.\n * @param parent the parent to check for\n */\n private _hasParent(parent: Subscription) {\n const { _parentage } = this;\n return _parentage === parent || (Array.isArray(_parentage) && _parentage.includes(parent));\n }\n\n /**\n * Adds a parent to this subscription so it can be removed from the parent if it\n * unsubscribes on it's own.\n *\n * NOTE: THIS ASSUMES THAT {@link _hasParent} HAS ALREADY BEEN CHECKED.\n * @param parent The parent subscription to add\n */\n private _addParent(parent: Subscription) {\n const { _parentage } = this;\n this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;\n }\n\n /**\n * Called on a child when it is removed via {@link #remove}.\n * @param parent The parent to remove\n */\n private _removeParent(parent: Subscription) {\n const { _parentage } = this;\n if (_parentage === parent) {\n this._parentage = null;\n } else if (Array.isArray(_parentage)) {\n arrRemove(_parentage, parent);\n }\n }\n\n /**\n * Removes a finalizer from this subscription that was previously added with the {@link #add} method.\n *\n * Note that `Subscription` instances, when unsubscribed, will automatically remove themselves\n * from every other `Subscription` they have been added to. This means that using the `remove` method\n * is not a common thing and should be used thoughtfully.\n *\n * If you add the same finalizer instance of a function or an unsubscribable object to a `Subscription` instance\n * more than once, you will need to call `remove` the same number of times to remove all instances.\n *\n * All finalizer instances are removed to free up memory upon unsubscription.\n *\n * @param teardown The finalizer to remove from this subscription\n */\n remove(teardown: Exclude<TeardownLogic, void>): void {\n const { _finalizers } = this;\n _finalizers && arrRemove(_finalizers, teardown);\n\n if (teardown instanceof Subscription) {\n teardown._removeParent(this);\n }\n }\n}\n\nexport const EMPTY_SUBSCRIPTION = Subscription.EMPTY;\n\nexport function isSubscription(value: any): value is Subscription {\n return (\n value instanceof Subscription ||\n (value && 'closed' in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe))\n );\n}\n\nfunction execFinalizer(finalizer: Unsubscribable | (() => void)) {\n if (isFunction(finalizer)) {\n finalizer();\n } else {\n finalizer.unsubscribe();\n }\n}\n", "import { Subscriber } from './Subscriber';\nimport { ObservableNotification } from './types';\n\n/**\n * The {@link GlobalConfig} object for RxJS. It is used to configure things\n * like how to react on unhandled errors.\n */\nexport const config: GlobalConfig = {\n onUnhandledError: null,\n onStoppedNotification: null,\n Promise: undefined,\n useDeprecatedSynchronousErrorHandling: false,\n useDeprecatedNextContext: false,\n};\n\n/**\n * The global configuration object for RxJS, used to configure things\n * like how to react on unhandled errors. Accessible via {@link config}\n * object.\n */\nexport interface GlobalConfig {\n /**\n * A registration point for unhandled errors from RxJS. These are errors that\n * cannot were not handled by consuming code in the usual subscription path. For\n * example, if you have this configured, and you subscribe to an observable without\n * providing an error handler, errors from that subscription will end up here. This\n * will _always_ be called asynchronously on another job in the runtime. This is because\n * we do not want errors thrown in this user-configured handler to interfere with the\n * behavior of the library.\n */\n onUnhandledError: ((err: any) => void) | null;\n\n /**\n * A registration point for notifications that cannot be sent to subscribers because they\n * have completed, errored or have been explicitly unsubscribed. By default, next, complete\n * and error notifications sent to stopped subscribers are noops. However, sometimes callers\n * might want a different behavior. For example, with sources that attempt to report errors\n * to stopped subscribers, a caller can configure RxJS to throw an unhandled error instead.\n * This will _always_ be called asynchronously on another job in the runtime. This is because\n * we do not want errors thrown in this user-configured handler to interfere with the\n * behavior of the library.\n */\n onStoppedNotification: ((notification: ObservableNotification<any>, subscriber: Subscriber<any>) => void) | null;\n\n /**\n * The promise constructor used by default for {@link Observable#toPromise toPromise} and {@link Observable#forEach forEach}\n * methods.\n *\n * @deprecated As of version 8, RxJS will no longer support this sort of injection of a\n * Promise constructor. If you need a Promise implementation other than native promises,\n * please polyfill/patch Promise as you see appropriate. Will be removed in v8.\n */\n Promise?: PromiseConstructorLike;\n\n /**\n * If true, turns on synchronous error rethrowing, which is a deprecated behavior\n * in v6 and higher. This behavior enables bad patterns like wrapping a subscribe\n * call in a try/catch block. It also enables producer interference, a nasty bug\n * where a multicast can be broken for all observers by a downstream consumer with\n * an unhandled error. DO NOT USE THIS FLAG UNLESS IT'S NEEDED TO BUY TIME\n * FOR MIGRATION REASONS.\n *\n * @deprecated As of version 8, RxJS will no longer support synchronous throwing\n * of unhandled errors. All errors will be thrown on a separate call stack to prevent bad\n * behaviors described above. Will be removed in v8.\n */\n useDeprecatedSynchronousErrorHandling: boolean;\n\n /**\n * If true, enables an as-of-yet undocumented feature from v5: The ability to access\n * `unsubscribe()` via `this` context in `next` functions created in observers passed\n * to `subscribe`.\n *\n * This is being removed because the performance was severely problematic, and it could also cause\n * issues when types other than POJOs are passed to subscribe as subscribers, as they will likely have\n * their `this` context overwritten.\n *\n * @deprecated As of version 8, RxJS will no longer support altering the\n * context of next functions provided as part of an observer to Subscribe. Instead,\n * you will have access to a subscription or a signal or token that will allow you to do things like\n * unsubscribe and test closed status. Will be removed in v8.\n */\n useDeprecatedNextContext: boolean;\n}\n", "import type { TimerHandle } from './timerHandle';\ntype SetTimeoutFunction = (handler: () => void, timeout?: number, ...args: any[]) => TimerHandle;\ntype ClearTimeoutFunction = (handle: TimerHandle) => void;\n\ninterface TimeoutProvider {\n setTimeout: SetTimeoutFunction;\n clearTimeout: ClearTimeoutFunction;\n delegate:\n | {\n setTimeout: SetTimeoutFunction;\n clearTimeout: ClearTimeoutFunction;\n }\n | undefined;\n}\n\nexport const timeoutProvider: TimeoutProvider = {\n // When accessing the delegate, use the variable rather than `this` so that\n // the functions can be called without being bound to the provider.\n setTimeout(handler: () => void, timeout?: number, ...args) {\n const { delegate } = timeoutProvider;\n if (delegate?.setTimeout) {\n return delegate.setTimeout(handler, timeout, ...args);\n }\n return setTimeout(handler, timeout, ...args);\n },\n clearTimeout(handle) {\n const { delegate } = timeoutProvider;\n return (delegate?.clearTimeout || clearTimeout)(handle as any);\n },\n delegate: undefined,\n};\n", "import { config } from '../config';\nimport { timeoutProvider } from '../scheduler/timeoutProvider';\n\n/**\n * Handles an error on another job either with the user-configured {@link onUnhandledError},\n * or by throwing it on that new job so it can be picked up by `window.onerror`, `process.on('error')`, etc.\n *\n * This should be called whenever there is an error that is out-of-band with the subscription\n * or when an error hits a terminal boundary of the subscription and no error handler was provided.\n *\n * @param err the error to report\n */\nexport function reportUnhandledError(err: any) {\n timeoutProvider.setTimeout(() => {\n const { onUnhandledError } = config;\n if (onUnhandledError) {\n // Execute the user-configured error handler.\n onUnhandledError(err);\n } else {\n // Throw so it is picked up by the runtime's uncaught error mechanism.\n throw err;\n }\n });\n}\n", "/* tslint:disable:no-empty */\nexport function noop() { }\n", "import { CompleteNotification, NextNotification, ErrorNotification } from './types';\n\n/**\n * A completion object optimized for memory use and created to be the\n * same \"shape\" as other notifications in v8.\n * @internal\n */\nexport const COMPLETE_NOTIFICATION = (() => createNotification('C', undefined, undefined) as CompleteNotification)();\n\n/**\n * Internal use only. Creates an optimized error notification that is the same \"shape\"\n * as other notifications.\n * @internal\n */\nexport function errorNotification(error: any): ErrorNotification {\n return createNotification('E', undefined, error) as any;\n}\n\n/**\n * Internal use only. Creates an optimized next notification that is the same \"shape\"\n * as other notifications.\n * @internal\n */\nexport function nextNotification<T>(value: T) {\n return createNotification('N', value, undefined) as NextNotification<T>;\n}\n\n/**\n * Ensures that all notifications created internally have the same \"shape\" in v8.\n *\n * TODO: This is only exported to support a crazy legacy test in `groupBy`.\n * @internal\n */\nexport function createNotification(kind: 'N' | 'E' | 'C', value: any, error: any) {\n return {\n kind,\n value,\n error,\n };\n}\n", "import { config } from '../config';\n\nlet context: { errorThrown: boolean; error: any } | null = null;\n\n/**\n * Handles dealing with errors for super-gross mode. Creates a context, in which\n * any synchronously thrown errors will be passed to {@link captureError}. Which\n * will record the error such that it will be rethrown after the call back is complete.\n * TODO: Remove in v8\n * @param cb An immediately executed function.\n */\nexport function errorContext(cb: () => void) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n const isRoot = !context;\n if (isRoot) {\n context = { errorThrown: false, error: null };\n }\n cb();\n if (isRoot) {\n const { errorThrown, error } = context!;\n context = null;\n if (errorThrown) {\n throw error;\n }\n }\n } else {\n // This is the general non-deprecated path for everyone that\n // isn't crazy enough to use super-gross mode (useDeprecatedSynchronousErrorHandling)\n cb();\n }\n}\n\n/**\n * Captures errors only in super-gross mode.\n * @param err the error to capture\n */\nexport function captureError(err: any) {\n if (config.useDeprecatedSynchronousErrorHandling && context) {\n context.errorThrown = true;\n context.error = err;\n }\n}\n", "import { isFunction } from './util/isFunction';\nimport { Observer, ObservableNotification } from './types';\nimport { isSubscription, Subscription } from './Subscription';\nimport { config } from './config';\nimport { reportUnhandledError } from './util/reportUnhandledError';\nimport { noop } from './util/noop';\nimport { nextNotification, errorNotification, COMPLETE_NOTIFICATION } from './NotificationFactories';\nimport { timeoutProvider } from './scheduler/timeoutProvider';\nimport { captureError } from './util/errorContext';\n\n/**\n * Implements the {@link Observer} interface and extends the\n * {@link Subscription} class. While the {@link Observer} is the public API for\n * consuming the values of an {@link Observable}, all Observers get converted to\n * a Subscriber, in order to provide Subscription-like capabilities such as\n * `unsubscribe`. Subscriber is a common type in RxJS, and crucial for\n * implementing operators, but it is rarely used as a public API.\n */\nexport class Subscriber<T> extends Subscription implements Observer<T> {\n /**\n * A static factory for a Subscriber, given a (potentially partial) definition\n * of an Observer.\n * @param next The `next` callback of an Observer.\n * @param error The `error` callback of an\n * Observer.\n * @param complete The `complete` callback of an\n * Observer.\n * @return A Subscriber wrapping the (partially defined)\n * Observer represented by the given arguments.\n * @deprecated Do not use. Will be removed in v8. There is no replacement for this\n * method, and there is no reason to be creating instances of `Subscriber` directly.\n * If you have a specific use case, please file an issue.\n */\n static create<T>(next?: (x?: T) => void, error?: (e?: any) => void, complete?: () => void): Subscriber<T> {\n return new SafeSubscriber(next, error, complete);\n }\n\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n protected isStopped: boolean = false;\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n protected destination: Subscriber<any> | Observer<any>; // this `any` is the escape hatch to erase extra type param (e.g. R)\n\n /**\n * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.\n * There is no reason to directly create an instance of Subscriber. This type is exported for typings reasons.\n */\n constructor(destination?: Subscriber<any> | Observer<any>) {\n super();\n if (destination) {\n this.destination = destination;\n // Automatically chain subscriptions together here.\n // if destination is a Subscription, then it is a Subscriber.\n if (isSubscription(destination)) {\n destination.add(this);\n }\n } else {\n this.destination = EMPTY_OBSERVER;\n }\n }\n\n /**\n * The {@link Observer} callback to receive notifications of type `next` from\n * the Observable, with a value. The Observable may call this method 0 or more\n * times.\n * @param value The `next` value.\n */\n next(value: T): void {\n if (this.isStopped) {\n handleStoppedNotification(nextNotification(value), this);\n } else {\n this._next(value!);\n }\n }\n\n /**\n * The {@link Observer} callback to receive notifications of type `error` from\n * the Observable, with an attached `Error`. Notifies the Observer that\n * the Observable has experienced an error condition.\n * @param err The `error` exception.\n */\n error(err?: any): void {\n if (this.isStopped) {\n handleStoppedNotification(errorNotification(err), this);\n } else {\n this.isStopped = true;\n this._error(err);\n }\n }\n\n /**\n * The {@link Observer} callback to receive a valueless notification of type\n * `complete` from the Observable. Notifies the Observer that the Observable\n * has finished sending push-based notifications.\n */\n complete(): void {\n if (this.isStopped) {\n handleStoppedNotification(COMPLETE_NOTIFICATION, this);\n } else {\n this.isStopped = true;\n this._complete();\n }\n }\n\n unsubscribe(): void {\n if (!this.closed) {\n this.isStopped = true;\n super.unsubscribe();\n this.destination = null!;\n }\n }\n\n protected _next(value: T): void {\n this.destination.next(value);\n }\n\n protected _error(err: any): void {\n try {\n this.destination.error(err);\n } finally {\n this.unsubscribe();\n }\n }\n\n protected _complete(): void {\n try {\n this.destination.complete();\n } finally {\n this.unsubscribe();\n }\n }\n}\n\n/**\n * This bind is captured here because we want to be able to have\n * compatibility with monoid libraries that tend to use a method named\n * `bind`. In particular, a library called Monio requires this.\n */\nconst _bind = Function.prototype.bind;\n\nfunction bind<Fn extends (...args: any[]) => any>(fn: Fn, thisArg: any): Fn {\n return _bind.call(fn, thisArg);\n}\n\n/**\n * Internal optimization only, DO NOT EXPOSE.\n * @internal\n */\nclass ConsumerObserver<T> implements Observer<T> {\n constructor(private partialObserver: Partial<Observer<T>>) {}\n\n next(value: T): void {\n const { partialObserver } = this;\n if (partialObserver.next) {\n try {\n partialObserver.next(value);\n } catch (error) {\n handleUnhandledError(error);\n }\n }\n }\n\n error(err: any): void {\n const { partialObserver } = this;\n if (partialObserver.error) {\n try {\n partialObserver.error(err);\n } catch (error) {\n handleUnhandledError(error);\n }\n } else {\n handleUnhandledError(err);\n }\n }\n\n complete(): void {\n const { partialObserver } = this;\n if (partialObserver.complete) {\n try {\n partialObserver.complete();\n } catch (error) {\n handleUnhandledError(error);\n }\n }\n }\n}\n\nexport class SafeSubscriber<T> extends Subscriber<T> {\n constructor(\n observerOrNext?: Partial<Observer<T>> | ((value: T) => void) | null,\n error?: ((e?: any) => void) | null,\n complete?: (() => void) | null\n ) {\n super();\n\n let partialObserver: Partial<Observer<T>>;\n if (isFunction(observerOrNext) || !observerOrNext) {\n // The first argument is a function, not an observer. The next\n // two arguments *could* be observers, or they could be empty.\n partialObserver = {\n next: (observerOrNext ?? undefined) as ((value: T) => void) | undefined,\n error: error ?? undefined,\n complete: complete ?? undefined,\n };\n } else {\n // The first argument is a partial observer.\n let context: any;\n if (this && config.useDeprecatedNextContext) {\n // This is a deprecated path that made `this.unsubscribe()` available in\n // next handler functions passed to subscribe. This only exists behind a flag\n // now, as it is *very* slow.\n context = Object.create(observerOrNext);\n context.unsubscribe = () => this.unsubscribe();\n partialObserver = {\n next: observerOrNext.next && bind(observerOrNext.next, context),\n error: observerOrNext.error && bind(observerOrNext.error, context),\n complete: observerOrNext.complete && bind(observerOrNext.complete, context),\n };\n } else {\n // The \"normal\" path. Just use the partial observer directly.\n partialObserver = observerOrNext;\n }\n }\n\n // Wrap the partial observer to ensure it's a full observer, and\n // make sure proper error handling is accounted for.\n this.destination = new ConsumerObserver(partialObserver);\n }\n}\n\nfunction handleUnhandledError(error: any) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n captureError(error);\n } else {\n // Ideal path, we report this as an unhandled error,\n // which is thrown on a new call stack.\n reportUnhandledError(error);\n }\n}\n\n/**\n * An error handler used when no error handler was supplied\n * to the SafeSubscriber -- meaning no error handler was supplied\n * do the `subscribe` call on our observable.\n * @param err The error to handle\n */\nfunction defaultErrorHandler(err: any) {\n throw err;\n}\n\n/**\n * A handler for notifications that cannot be sent to a stopped subscriber.\n * @param notification The notification being sent.\n * @param subscriber The stopped subscriber.\n */\nfunction handleStoppedNotification(notification: ObservableNotification<any>, subscriber: Subscriber<any>) {\n const { onStoppedNotification } = config;\n onStoppedNotification && timeoutProvider.setTimeout(() => onStoppedNotification(notification, subscriber));\n}\n\n/**\n * The observer used as a stub for subscriptions where the user did not\n * pass any arguments to `subscribe`. Comes with the default error handling\n * behavior.\n */\nexport const EMPTY_OBSERVER: Readonly<Observer<any>> & { closed: true } = {\n closed: true,\n next: noop,\n error: defaultErrorHandler,\n complete: noop,\n};\n", "/**\n * Symbol.observable or a string \"@@observable\". Used for interop\n *\n * @deprecated We will no longer be exporting this symbol in upcoming versions of RxJS.\n * Instead polyfill and use Symbol.observable directly *or* use https://www.npmjs.com/package/symbol-observable\n */\nexport const observable: string | symbol = (() => (typeof Symbol === 'function' && Symbol.observable) || '@@observable')();\n", "/**\n * This function takes one parameter and just returns it. Simply put,\n * this is like `<T>(x: T): T => x`.\n *\n * ## Examples\n *\n * This is useful in some cases when using things like `mergeMap`\n *\n * ```ts\n * import { interval, take, map, range, mergeMap, identity } from 'rxjs';\n *\n * const source$ = interval(1000).pipe(take(5));\n *\n * const result$ = source$.pipe(\n * map(i => range(i)),\n * mergeMap(identity) // same as mergeMap(x => x)\n * );\n *\n * result$.subscribe({\n * next: console.log\n * });\n * ```\n *\n * Or when you want to selectively apply an operator\n *\n * ```ts\n * import { interval, take, identity } from 'rxjs';\n *\n * const shouldLimit = () => Math.random() < 0.5;\n *\n * const source$ = interval(1000);\n *\n * const result$ = source$.pipe(shouldLimit() ? take(5) : identity);\n *\n * result$.subscribe({\n * next: console.log\n * });\n * ```\n *\n * @param x Any value that is returned by this function\n * @returns The value passed as the first parameter to this function\n */\nexport function identity<T>(x: T): T {\n return x;\n}\n", "import { identity } from './identity';\nimport { UnaryFunction } from '../types';\n\nexport function pipe(): typeof identity;\nexport function pipe<T, A>(fn1: UnaryFunction<T, A>): UnaryFunction<T, A>;\nexport function pipe<T, A, B>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>): UnaryFunction<T, B>;\nexport function pipe<T, A, B, C>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>, fn3: UnaryFunction<B, C>): UnaryFunction<T, C>;\nexport function pipe<T, A, B, C, D>(\n fn1: UnaryFunction<T, A>,\n fn2: UnaryFunction<A, B>,\n fn3: UnaryFunction<B, C>,\n fn4: UnaryFunction<C, D>\n): UnaryFunction<T, D>;\nexport function pipe<T, A, B, C, D, E>(\n fn1: UnaryFunction<T, A>,\n fn2: UnaryFunction<A, B>,\n fn3: UnaryFunction<B, C>,\n fn4: UnaryFunction<C, D>,\n fn5: UnaryFunction<D, E>\n): UnaryFunction<T, E>;\nexport function pipe<T, A, B, C, D, E, F>(\n fn1: UnaryFunction<T, A>,\n fn2: UnaryFunction<A, B>,\n fn3: UnaryFunction<B, C>,\n fn4: UnaryFunction<C, D>,\n fn5: UnaryFunction<D, E>,\n fn6: UnaryFunction<E, F>\n): UnaryFunction<T, F>;\nexport function pipe<T, A, B, C, D, E, F, G>(\n fn1: UnaryFunction<T, A>,\n fn2: UnaryFunction<A, B>,\n fn3: UnaryFunction<B, C>,\n fn4: UnaryFunction<C, D>,\n fn5: UnaryFunction<D, E>,\n fn6: UnaryFunction<E, F>,\n fn7: UnaryFunction<F, G>\n): UnaryFunction<T, G>;\nexport function pipe<T, A, B, C, D, E, F, G, H>(\n fn1: UnaryFunction<T, A>,\n fn2: UnaryFunction<A, B>,\n fn3: UnaryFunction<B, C>,\n fn4: UnaryFunction<C, D>,\n fn5: UnaryFunction<D, E>,\n fn6: UnaryFunction<E, F>,\n fn7: UnaryFunction<F, G>,\n fn8: UnaryFunction<G, H>\n): UnaryFunction<T, H>;\nexport function pipe<T, A, B, C, D, E, F, G, H, I>(\n fn1: UnaryFunction<T, A>,\n fn2: UnaryFunction<A, B>,\n fn3: UnaryFunction<B, C>,\n fn4: UnaryFunction<C, D>,\n fn5: UnaryFunction<D, E>,\n fn6: UnaryFunction<E, F>,\n fn7: UnaryFunction<F, G>,\n fn8: UnaryFunction<G, H>,\n fn9: UnaryFunction<H, I>\n): UnaryFunction<T, I>;\nexport function pipe<T, A, B, C, D, E, F, G, H, I>(\n fn1: UnaryFunction<T, A>,\n fn2: UnaryFunction<A, B>,\n fn3: UnaryFunction<B, C>,\n fn4: UnaryFunction<C, D>,\n fn5: UnaryFunction<D, E>,\n fn6: UnaryFunction<E, F>,\n fn7: UnaryFunction<F, G>,\n fn8: UnaryFunction<G, H>,\n fn9: UnaryFunction<H, I>,\n ...fns: UnaryFunction<any, any>[]\n): UnaryFunction<T, unknown>;\n\n/**\n * pipe() can be called on one or more functions, each of which can take one argument (\"UnaryFunction\")\n * and uses it to return a value.\n * It returns a function that takes one argument, passes it to the first UnaryFunction, and then\n * passes the result to the next one, passes that result to the next one, and so on. \n */\nexport function pipe(...fns: Array<UnaryFunction<any, any>>): UnaryFunction<any, any> {\n return pipeFromArray(fns);\n}\n\n/** @internal */\nexport function pipeFromArray<T, R>(fns: Array<UnaryFunction<T, R>>): UnaryFunction<T, R> {\n if (fns.length === 0) {\n return identity as UnaryFunction<any, any>;\n }\n\n if (fns.length === 1) {\n return fns[0];\n }\n\n return function piped(input: T): R {\n return fns.reduce((prev: any, fn: UnaryFunction<T, R>) => fn(prev), input as any);\n };\n}\n", "import { Operator } from './Operator';\nimport { SafeSubscriber, Subscriber } from './Subscriber';\nimport { isSubscription, Subscription } from './Subscription';\nimport { TeardownLogic, OperatorFunction, Subscribable, Observer } from './types';\nimport { observable as Symbol_observable } from './symbol/observable';\nimport { pipeFromArray } from './util/pipe';\nimport { config } from './config';\nimport { isFunction } from './util/isFunction';\nimport { errorContext } from './util/errorContext';\n\n/**\n * A representation of any set of values over any amount of time. This is the most basic building block\n * of RxJS.\n */\nexport class Observable<T> implements Subscribable<T> {\n /**\n * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.\n */\n source: Observable<any> | undefined;\n\n /**\n * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.\n */\n operator: Operator<any, T> | undefined;\n\n /**\n * @param subscribe The function that is called when the Observable is\n * initially subscribed to. This function is given a Subscriber, to which new values\n * can be `next`ed, or an `error` method can be called to raise an error, or\n * `complete` can be called to notify of a successful completion.\n */\n constructor(subscribe?: (this: Observable<T>, subscriber: Subscriber<T>) => TeardownLogic) {\n if (subscribe) {\n this._subscribe = subscribe;\n }\n }\n\n // HACK: Since TypeScript inherits static properties too, we have to\n // fight against TypeScript here so Subject can have a different static create signature\n /**\n * Creates a new Observable by calling the Observable constructor\n * @param subscribe the subscriber function to be passed to the Observable constructor\n * @return A new observable.\n * @deprecated Use `new Observable()` instead. Will be removed in v8.\n */\n static create: (...args: any[]) => any = <T>(subscribe?: (subscriber: Subscriber<T>) => TeardownLogic) => {\n return new Observable<T>(subscribe);\n };\n\n /**\n * Creates a new Observable, with this Observable instance as the source, and the passed\n * operator defined as the new observable's operator.\n * @param operator the operator defining the operation to take on the observable\n * @return A new observable with the Operator applied.\n * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.\n * If you have implemented an operator using `lift`, it is recommended that you create an\n * operator by simply returning `new Observable()` directly. See \"Creating new operators from\n * scratch\" section here: https://rxjs.dev/guide/operators\n */\n lift<R>(operator?: Operator<T, R>): Observable<R> {\n const observable = new Observable<R>();\n observable.source = this;\n observable.operator = operator;\n return observable;\n }\n\n subscribe(observerOrNext?: Partial<Observer<T>> | ((value: T) => void)): Subscription;\n /** @deprecated Instead of passing separate callback arguments, use an observer argument. Signatures taking separate callback arguments will be removed in v8. Details: https://rxjs.dev/deprecations/subscribe-arguments */\n subscribe(next?: ((value: T) => void) | null, error?: ((error: any) => void) | null, complete?: (() => void) | null): Subscription;\n /**\n * Invokes an execution of an Observable and registers Observer handlers for notifications it will emit.\n *\n * <span class=\"informal\">Use it when you have all these Observables, but still nothing is happening.</span>\n *\n * `subscribe` is not a regular operator, but a method that calls Observable's internal `subscribe` function. It\n * might be for example a function that you passed to Observable's constructor, but most of the time it is\n * a library implementation, which defines what will be emitted by an Observable, and when it be will emitted. This means\n * that calling `subscribe` is actually the moment when Observable starts its work, not when it is created, as it is often\n * the thought.\n *\n * Apart from starting the execution of an Observable, this method allows you to listen for values\n * that an Observable emits, as well as for when it completes or errors. You can achieve this in two\n * of the following ways.\n *\n * The first way is creating an object that implements {@link Observer} interface. It should have methods\n * defined by that interface, but note that it should be just a regular JavaScript object, which you can create\n * yourself in any way you want (ES6 class, classic function constructor, object literal etc.). In particular, do\n * not attempt to use any RxJS implementation details to create Observers - you don't need them. Remember also\n * that your object does not have to implement all methods. If you find yourself creating a method that doesn't\n * do anything, you can simply omit it. Note however, if the `error` method is not provided and an error happens,\n * it will be thrown asynchronously. Errors thrown asynchronously cannot be caught using `try`/`catch`. Instead,\n * use the {@link onUnhandledError} configuration option or use a runtime handler (like `window.onerror` or\n * `process.on('error)`) to be notified of unhandled errors. Because of this, it's recommended that you provide\n * an `error` method to avoid missing thrown errors.\n *\n * The second way is to give up on Observer object altogether and simply provide callback functions in place of its methods.\n * This means you can provide three functions as arguments to `subscribe`, where the first function is equivalent\n * of a `next` method, the second of an `error` method and the third of a `complete` method. Just as in case of an Observer,\n * if you do not need to listen for something, you can omit a function by passing `undefined` or `null`,\n * since `subscribe` recognizes these functions by where they were placed in function call. When it comes\n * to the `error` function, as with an Observer, if not provided, errors emitted by an Observable will be thrown asynchronously.\n *\n * You can, however, subscribe with no parameters at all. This may be the case where you're not interested in terminal events\n * and you also handled emissions internally by using operators (e.g. using `tap`).\n *\n * Whichever style of calling `subscribe` you use, in both cases it returns a Subscription object.\n * This object allows you to call `unsubscribe` on it, which in turn will stop the work that an Observable does and will clean\n * up all resources that an Observable used. Note that cancelling a subscription will not call `complete` callback\n * provided to `subscribe` function, which is reserved for a regular completion signal that comes from an Observable.\n *\n * Remember that callbacks provided to `subscribe` are not guaranteed to be called asynchronously.\n * It is an Observable itself that decides when these functions will be called. For example {@link of}\n * by default emits all its values synchronously. Always check documentation for how given Observable\n * will behave when subscribed and if its default behavior can be modified with a `scheduler`.\n *\n * #### Examples\n *\n * Subscribe with an {@link guide/observer Observer}\n *\n * ```ts\n * import { of } from 'rxjs';\n *\n * const sumObserver = {\n * sum: 0,\n * next(value) {\n * console.log('Adding: ' + value);\n * this.sum = this.sum + value;\n * },\n * error() {\n * // We actually could just remove this method,\n * // since we do not really care about errors right now.\n * },\n * complete() {\n * console.log('Sum equals: ' + this.sum);\n * }\n * };\n *\n * of(1, 2, 3) // Synchronously emits 1, 2, 3 and then completes.\n * .subscribe(sumObserver);\n *\n * // Logs:\n * // 'Adding: 1'\n * // 'Adding: 2'\n * // 'Adding: 3'\n * // 'Sum equals: 6'\n * ```\n *\n * Subscribe with functions ({@link deprecations/subscribe-arguments deprecated})\n *\n * ```ts\n * import { of } from 'rxjs'\n *\n * let sum = 0;\n *\n * of(1, 2, 3).subscribe(\n * value => {\n * console.log('Adding: ' + value);\n * sum = sum + value;\n * },\n * undefined,\n * () => console.log('Sum equals: ' + sum)\n * );\n *\n * // Logs:\n * // 'Adding: 1'\n * // 'Adding: 2'\n * // 'Adding: 3'\n * // 'Sum equals: 6'\n * ```\n *\n * Cancel a subscription\n *\n * ```ts\n * import { interval } from 'rxjs';\n *\n * const subscription = interval(1000).subscribe({\n * next(num) {\n * console.log(num)\n * },\n * complete() {\n * // Will not be called, even when cancelling subscription.\n * console.log('completed!');\n * }\n * });\n *\n * setTimeout(() => {\n * subscription.unsubscribe();\n * console.log('unsubscribed!');\n * }, 2500);\n *\n * // Logs:\n * // 0 after 1s\n * // 1 after 2s\n * // 'unsubscribed!' after 2.5s\n * ```\n *\n * @param observerOrNext Either an {@link Observer} with some or all callback methods,\n * or the `next` handler that is called for each value emitted from the subscribed Observable.\n * @param error A handler for a terminal event resulting from an error. If no error handler is provided,\n * the error will be thrown asynchronously as unhandled.\n * @param complete A handler for a terminal event resulting from successful completion.\n * @return A subscription reference to the registered handlers.\n */\n subscribe(\n observerOrNext?: Partial<Observer<T>> | ((value: T) => void) | null,\n error?: ((error: any) => void) | null,\n complete?: (() => void) | null\n ): Subscription {\n const subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error, complete);\n\n errorContext(() => {\n const { operator, source } = this;\n subscriber.add(\n operator\n ? // We're dealing with a subscription in the\n // operator chain to one of our lifted operators.\n operator.call(subscriber, source)\n : source\n ? // If `source` has a value, but `operator` does not, something that\n // had intimate knowledge of our API, like our `Subject`, must have\n // set it. We're going to just call `_subscribe` directly.\n this._subscribe(subscriber)\n : // In all other cases, we're likely wrapping a user-provided initializer\n // function, so we need to catch errors and handle them appropriately.\n this._trySubscribe(subscriber)\n );\n });\n\n return subscriber;\n }\n\n /** @internal */\n protected _trySubscribe(sink: Subscriber<T>): TeardownLogic {\n try {\n return this._subscribe(sink);\n } catch (err) {\n // We don't need to return anything in this case,\n // because it's just going to try to `add()` to a subscription\n // above.\n sink.error(err);\n }\n }\n\n /**\n * Used as a NON-CANCELLABLE means of subscribing to an observable, for use with\n * APIs that expect promises, like `async/await`. You cannot unsubscribe from this.\n *\n * **WARNING**: Only use this with observables you *know* will complete. If the source\n * observable does not complete, you will end up with a promise that is hung up, and\n * potentially all of the state of an async function hanging out in memory. To avoid\n * this situation, look into adding something like {@link timeout}, {@link take},\n * {@link takeWhile}, or {@link takeUntil} amongst others.\n *\n * #### Example\n *\n * ```ts\n * import { interval, take } from 'rxjs';\n *\n * const source$ = interval(1000).pipe(take(4));\n *\n * async function getTotal() {\n * let total = 0;\n *\n * await source$.forEach(value => {\n * total += value;\n * console.log('observable -> ' + value);\n * });\n *\n * return total;\n * }\n *\n * getTotal().then(\n * total => console.log('Total: ' + total)\n * );\n *\n * // Expected:\n * // 'observable -> 0'\n * // 'observable -> 1'\n * // 'observable -> 2'\n * // 'observable -> 3'\n * // 'Total: 6'\n * ```\n *\n * @param next A handler for each value emitted by the observable.\n * @return A promise that either resolves on observable completion or\n * rejects with the handled error.\n */\n forEach(next: (value: T) => void): Promise<void>;\n\n /**\n * @param next a handler for each value emitted by the observable\n * @param promiseCtor a constructor function used to instantiate the Promise\n * @return a promise that either resolves on observable completion or\n * rejects with the handled error\n * @deprecated Passing a Promise constructor will no longer be available\n * in upcoming versions of RxJS. This is because it adds weight to the library, for very\n * little benefit. If you need this functionality, it is recommended that you either\n * polyfill Promise, or you create an adapter to convert the returned native promise\n * to whatever promise implementation you wanted. Will be removed in v8.\n */\n forEach(next: (value: T) => void, promiseCtor: PromiseConstructorLike): Promise<void>;\n\n forEach(next: (value: T) => void, promiseCtor?: PromiseConstructorLike): Promise<void> {\n promiseCtor = getPromiseCtor(promiseCtor);\n\n return new promiseCtor<void>((resolve, reject) => {\n const subscriber = new SafeSubscriber<T>({\n next: (value) => {\n try {\n next(value);\n } catch (err) {\n reject(err);\n subscriber.unsubscribe();\n }\n },\n error: reject,\n complete: resolve,\n });\n this.subscribe(subscriber);\n }) as Promise<void>;\n }\n\n /** @internal */\n protected _subscribe(subscriber: Subscriber<any>): TeardownLogic {\n return this.source?.subscribe(subscriber);\n }\n\n /**\n * An interop point defined by the es7-observable spec https://github.com/zenparsing/es-observable\n * @return This instance of the observable.\n */\n [Symbol_observable]() {\n return this;\n }\n\n /* tslint:disable:max-line-length */\n pipe(): Observable<T>;\n pipe<A>(op1: OperatorFunction<T, A>): Observable<A>;\n pipe<A, B>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>): Observable<B>;\n pipe<A, B, C>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>): Observable<C>;\n pipe<A, B, C, D>(\n op1: OperatorFunction<T, A>,\n op2: OperatorFunction<A, B>,\n op3: OperatorFunction<B, C>,\n op4: OperatorFunction<C, D>\n ): Observable<D>;\n pipe<A, B, C, D, E>(\n op1: OperatorFunction<T, A>,\n op2: OperatorFunction<A, B>,\n op3: OperatorFunction<B, C>,\n op4: OperatorFunction<C, D>,\n op5: OperatorFunction<D, E>\n ): Observable<E>;\n pipe<A, B, C, D, E, F>(\n op1: OperatorFunction<T, A>,\n op2: OperatorFunction<A, B>,\n op3: OperatorFunction<B, C>,\n op4: OperatorFunction<C, D>,\n op5: OperatorFunction<D, E>,\n op6: OperatorFunction<E, F>\n ): Observable<F>;\n pipe<A, B, C, D, E, F, G>(\n op1: OperatorFunction<T, A>,\n op2: OperatorFunction<A, B>,\n op3: OperatorFunction<B, C>,\n op4: OperatorFunction<C, D>,\n op5: OperatorFunction<D, E>,\n op6: OperatorFunction<E, F>,\n op7: OperatorFunction<F, G>\n ): Observable<G>;\n pipe<A, B, C, D, E, F, G, H>(\n op1: OperatorFunction<T, A>,\n op2: OperatorFunction<A, B>,\n op3: OperatorFunction<B, C>,\n op4: OperatorFunction<C, D>,\n op5: OperatorFunction<D, E>,\n op6: OperatorFunction<E, F>,\n op7: OperatorFunction<F, G>,\n op8: OperatorFunction<G, H>\n ): Observable<H>;\n pipe<A, B, C, D, E, F, G, H, I>(\n op1: OperatorFunction<T, A>,\n op2: OperatorFunction<A, B>,\n op3: OperatorFunction<B, C>,\n op4: OperatorFunction<C, D>,\n op5: OperatorFunction<D, E>,\n op6: OperatorFunction<E, F>,\n op7: OperatorFunction<F, G>,\n op8: OperatorFunction<G, H>,\n op9: OperatorFunction<H, I>\n ): Observable<I>;\n pipe<A, B, C, D, E, F, G, H, I>(\n op1: OperatorFunction<T, A>,\n op2: OperatorFunction<A, B>,\n op3: OperatorFunction<B, C>,\n op4: OperatorFunction<C, D>,\n op5: OperatorFunction<D, E>,\n op6: OperatorFunction<E, F>,\n op7: OperatorFunction<F, G>,\n op8: OperatorFunction<G, H>,\n op9: OperatorFunction<H, I>,\n ...operations: OperatorFunction<any, any>[]\n ): Observable<unknown>;\n /* tslint:enable:max-line-length */\n\n /**\n * Used to stitch together functional operators into a chain.\n *\n * ## Example\n *\n * ```ts\n * import { interval, filter, map, scan } from 'rxjs';\n *\n * interval(1000)\n * .pipe(\n * filter(x => x % 2 === 0),\n * map(x => x + x),\n * scan((acc, x) => acc + x)\n * )\n * .subscribe(x => console.log(x));\n * ```\n *\n * @return The Observable result of all the operators having been called\n * in the order they were passed in.\n */\n pipe(...operations: OperatorFunction<any, any>[]): Observable<any> {\n return pipeFromArray(operations)(this);\n }\n\n /* tslint:disable:max-line-length */\n /** @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise */\n toPromise(): Promise<T | undefined>;\n /** @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise */\n toPromise(PromiseCtor: typeof Promise): Promise<T | undefined>;\n /** @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise */\n toPromise(PromiseCtor: PromiseConstructorLike): Promise<T | undefined>;\n /* tslint:enable:max-line-length */\n\n /**\n * Subscribe to this Observable and get a Promise resolving on\n * `complete` with the last emission (if any).\n *\n * **WARNING**: Only use this with observables you *know* will complete. If the source\n * observable does not complete, you will end up with a promise that is hung up, and\n * potentially all of the state of an async function hanging out in memory. To avoid\n * this situation, look into adding something like {@link timeout}, {@link take},\n * {@link takeWhile}, or {@link takeUntil} amongst others.\n *\n * @param [promiseCtor] a constructor function used to instantiate\n * the Promise\n * @return A Promise that resolves with the last value emit, or\n * rejects on an error. If there were no emissions, Promise\n * resolves with undefined.\n * @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise\n */\n toPromise(promiseCtor?: PromiseConstructorLike): Promise<T | undefined> {\n promiseCtor = getPromiseCtor(promiseCtor);\n\n return new promiseCtor((resolve, reject) => {\n let value: T | undefined;\n this.subscribe(\n (x: T) => (value = x),\n (err: any) => reject(err),\n () => resolve(value)\n );\n }) as Promise<T | undefined>;\n }\n}\n\n/**\n * Decides between a passed promise constructor from consuming code,\n * A default configured promise constructor, and the native promise\n * constructor and returns it. If nothing can be found, it will throw\n * an error.\n * @param promiseCtor The optional promise constructor to passed by consuming code\n */\nfunction getPromiseCtor(promiseCtor: PromiseConstructorLike | undefined) {\n return promiseCtor ?? config.Promise ?? Promise;\n}\n\nfunction isObserver<T>(value: any): value is Observer<T> {\n return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);\n}\n\nfunction isSubscriber<T>(value: any): value is Subscriber<T> {\n return (value && value instanceof Subscriber) || (isObserver(value) && isSubscription(value));\n}\n", "import { createErrorClass } from './createErrorClass';\n\nexport interface ObjectUnsubscribedError extends Error {}\n\nexport interface ObjectUnsubscribedErrorCtor {\n /**\n * @deprecated Internal implementation detail. Do not construct error instances.\n * Cannot be tagged as internal: https://github.com/ReactiveX/rxjs/issues/6269\n */\n new (): ObjectUnsubscribedError;\n}\n\n/**\n * An error thrown when an action is invalid because the object has been\n * unsubscribed.\n *\n * @see {@link Subject}\n * @see {@link BehaviorSubject}\n *\n * @class ObjectUnsubscribedError\n */\nexport const ObjectUnsubscribedError: ObjectUnsubscribedErrorCtor = createErrorClass(\n (_super) =>\n function ObjectUnsubscribedErrorImpl(this: any) {\n _super(this);\n this.name = 'ObjectUnsubscribedError';\n this.message = 'object unsubscribed';\n }\n);\n", "import { Operator } from './Operator';\nimport { Observable } from './Observable';\nimport { Subscriber } from './Subscriber';\nimport { Subscription, EMPTY_SUBSCRIPTION } from './Subscription';\nimport { Observer, SubscriptionLike, TeardownLogic } from './types';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\nimport { arrRemove } from './util/arrRemove';\nimport { errorContext } from './util/errorContext';\n\n/**\n * A Subject is a special type of Observable that allows values to be\n * multicasted to many Observers. Subjects are like EventEmitters.\n *\n * Every Subject is an Observable and an Observer. You can subscribe to a\n * Subject, and you can call next to feed values as well as error and complete.\n */\nexport class Subject<T> extends Observable<T> implements SubscriptionLike {\n closed = false;\n\n private currentObservers: Observer<T>[] | null = null;\n\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n observers: Observer<T>[] = [];\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n isStopped = false;\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n hasError = false;\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n thrownError: any = null;\n\n /**\n * Creates a \"subject\" by basically gluing an observer to an observable.\n *\n * @deprecated Recommended you do not use. Will be removed at some point in the future. Plans for replacement still under discussion.\n */\n static create: (...args: any[]) => any = <T>(destination: Observer<T>, source: Observable<T>): AnonymousSubject<T> => {\n return new AnonymousSubject<T>(destination, source);\n };\n\n constructor() {\n // NOTE: This must be here to obscure Observable's constructor.\n super();\n }\n\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n lift<R>(operator: Operator<T, R>): Observable<R> {\n const subject = new AnonymousSubject(this, this);\n subject.operator = operator as any;\n return subject as any;\n }\n\n /** @internal */\n protected _throwIfClosed() {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n }\n\n next(value: T) {\n errorContext(() => {\n this._throwIfClosed();\n if (!this.isStopped) {\n if (!this.currentObservers) {\n this.currentObservers = Array.from(this.observers);\n }\n for (const observer of this.currentObservers) {\n observer.next(value);\n }\n }\n });\n }\n\n error(err: any) {\n errorContext(() => {\n this._throwIfClosed();\n if (!this.isStopped) {\n this.hasError = this.isStopped = true;\n this.thrownError = err;\n const { observers } = this;\n while (observers.length) {\n observers.shift()!.error(err);\n }\n }\n });\n }\n\n complete() {\n errorContext(() => {\n this._throwIfClosed();\n if (!this.isStopped) {\n this.isStopped = true;\n const { observers } = this;\n while (observers.length) {\n observers.shift()!.complete();\n }\n }\n });\n }\n\n unsubscribe() {\n this.isStopped = this.closed = true;\n this.observers = this.currentObservers = null!;\n }\n\n get observed() {\n return this.observers?.length > 0;\n }\n\n /** @internal */\n protected _trySubscribe(subscriber: Subscriber<T>): TeardownLogic {\n this._throwIfClosed();\n return super._trySubscribe(subscriber);\n }\n\n /** @internal */\n protected _subscribe(subscriber: Subscriber<T>): Subscription {\n this._throwIfClosed();\n this._checkFinalizedStatuses(subscriber);\n return this._innerSubscribe(subscriber);\n }\n\n /** @internal */\n protected _innerSubscribe(subscriber: Subscriber<any>) {\n const { hasError, isStopped, observers } = this;\n if (hasError || isStopped) {\n return EMPTY_SUBSCRIPTION;\n }\n this.currentObservers = null;\n observers.push(subscriber);\n return new Subscription(() => {\n this.currentObservers = null;\n arrRemove(observers, subscriber);\n });\n }\n\n /** @internal */\n protected _checkFinalizedStatuses(subscriber: Subscriber<any>) {\n const { hasError, thrownError, isStopped } = this;\n if (hasError) {\n subscriber.error(thrownError);\n } else if (isStopped) {\n subscriber.complete();\n }\n }\n\n /**\n * Creates a new Observable with this Subject as the source. You can do this\n * to create custom Observer-side logic of the Subject and conceal it from\n * code that uses the Observable.\n * @return Observable that this Subject casts to.\n */\n asObservable(): Observable<T> {\n const observable: any = new Observable<T>();\n observable.source = this;\n return observable;\n }\n}\n\nexport class AnonymousSubject<T> extends Subject<T> {\n constructor(\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n public destination?: Observer<T>,\n source?: Observable<T>\n ) {\n super();\n this.source = source;\n }\n\n next(value: T) {\n this.destination?.next?.(value);\n }\n\n error(err: any) {\n this.destination?.error?.(err);\n }\n\n complete() {\n this.destination?.complete?.();\n }\n\n /** @internal */\n protected _subscribe(subscriber: Subscriber<T>): Subscription {\n return this.source?.subscribe(subscriber) ?? EMPTY_SUBSCRIPTION;\n }\n}\n", "import { Subject } from './Subject';\nimport { Subscriber } from './Subscriber';\nimport { Subscription } from './Subscription';\n\n/**\n * A variant of Subject that requires an initial value and emits its current\n * value whenever it is subscribed to.\n */\nexport class BehaviorSubject<T> extends Subject<T> {\n constructor(private _value: T) {\n super();\n }\n\n get value(): T {\n return this.getValue();\n }\n\n /** @internal */\n protected _subscribe(subscriber: Subscriber<T>): Subscription {\n const subscription = super._subscribe(subscriber);\n !subscription.closed && subscriber.next(this._value);\n return subscription;\n }\n\n getValue(): T {\n const { hasError, thrownError, _value } = this;\n if (hasError) {\n throw thrownError;\n }\n this._throwIfClosed();\n return _value;\n }\n\n next(value: T): void {\n super.next((this._value = value));\n }\n}\n"],
5
+ "mappings": "yhBAAA,IAAAA,GAAAC,EAAA,CAAAC,GAAAC,KAAA,CAIA,IAAIC,GAAI,IACJC,GAAID,GAAI,GACRE,GAAID,GAAI,GACRE,GAAID,GAAI,GACRE,GAAID,GAAI,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CAAqC+B,EAAeN,CAAK,CACxE,CAEA,MAAO,CAAE,GAAGG,EAAY,WAAYG,CAAc,CACpD,CAOA,SAASK,GAAqBC,EAA6B,CAEzD,IAAMC,EAAc,OAAO,WAAW,QAAW,WAAa,WAAW,OAAS,OAClF,GAAIA,GAAe,OAAOA,EAAY,MAAS,WAC7C,OAAOA,EAAY,KAAKD,CAAM,EAAE,SAAS,QAAQ,EAInD,IAAIE,EAAS,GACb,QAAWC,KAAQ,IAAI,WAAWH,CAAM,EACtCE,GAAU,OAAO,aAAaC,CAAI,EAEpC,OAAO,KAAKD,CAAM,CACpB,CAgCA,SAASzB,GAAqBZ,EAAwD,CACpF,OAAO,IAAIuC,GAAe1B,GAA8B,CACtD,QAAQ,QAAQb,EAAGa,CAAU,CAAC,EAAE,MAAOU,GAAUV,EAAW,MAAMU,CAAK,CAAC,CAC1E,CAAC,CACH",
6
+ "names": ["require_ms", "__commonJSMin", "exports", "module", "s", "m", "h", "d", "w", "y", "val", "options", "type", "parse", "fmtLong", "fmtShort", "str", "match", "n", "ms", "msAbs", "plural", "name", "isPlural", "require_common", "__commonJSMin", "exports", "module", "setup", "env", "createDebug", "coerce", "disable", "enable", "enabled", "destroy", "key", "selectColor", "namespace", "hash", "i", "prevTime", "enableOverride", "namespacesCache", "enabledCache", "debug", "args", "self", "curr", "ms", "index", "match", "format", "formatter", "val", "extend", "v", "delimiter", "newDebug", "namespaces", "split", "ns", "matchesTemplate", "search", "template", "searchIndex", "templateIndex", "starIndex", "matchIndex", "name", "skip", "require_browser", "__commonJSMin", "exports", "module", "formatArgs", "save", "load", "useColors", "localstorage", "warned", "m", "args", "c", "index", "lastC", "match", "namespaces", "r", "formatters", "v", "error", "exports", "debug", "debug_1", "__importDefault", "loggerLevels", "Logger", "namespace", "level", "logger", "message", "args", "require_util", "__commonJSMin", "exports", "util", "_", "assertIs", "_arg", "assertNever", "_x", "items", "obj", "item", "validKeys", "k", "filtered", "e", "object", "keys", "key", "arr", "checker", "val", "joinValues", "array", "separator", "value", "objectUtil", "first", "second", "getParsedType", "data", "require_ZodError", "__commonJSMin", "exports", "util_js_1", "quotelessJson", "obj", "ZodError", "_ZodError", "issues", "sub", "subs", "actualProto", "_mapper", "mapper", "issue", "fieldErrors", "processError", "error", "curr", "i", "el", "value", "formErrors", "firstEl", "require_en", "__commonJSMin", "exports", "ZodError_js_1", "util_js_1", "errorMap", "issue", "_ctx", "message", "require_errors", "__commonJSMin", "exports", "__importDefault", "mod", "setErrorMap", "getErrorMap", "en_js_1", "overrideErrorMap", "map", "require_parseUtil", "__commonJSMin", "exports", "__importDefault", "mod", "addIssueToContext", "errors_js_1", "en_js_1", "makeIssue", "params", "data", "path", "errorMaps", "issueData", "fullPath", "fullIssue", "errorMessage", "maps", "m", "map", "ctx", "overrideMap", "issue", "x", "ParseStatus", "_ParseStatus", "status", "results", "arrayValue", "s", "pairs", "syncPairs", "pair", "key", "value", "finalObject", "DIRTY", "OK", "isAborted", "isDirty", "isValid", "isAsync", "require_typeAliases", "__commonJSMin", "exports", "require_errorUtil", "__commonJSMin", "exports", "errorUtil", "message", "require_types", "__commonJSMin", "exports", "datetimeRegex", "custom", "ZodError_js_1", "errors_js_1", "errorUtil_js_1", "parseUtil_js_1", "util_js_1", "ParseInputLazyPath", "parent", "value", "path", "key", "handleResult", "ctx", "result", "error", "processCreateParams", "params", "errorMap", "invalid_type_error", "required_error", "description", "iss", "_a", "_b", "message", "ZodType", "input", "data", "err", "maybeAsyncResult", "check", "getIssueProperties", "val", "setError", "refinementData", "refinement", "ZodEffects", "ZodFirstPartyTypeKind", "def", "ZodOptional", "ZodNullable", "ZodArray", "ZodPromise", "option", "ZodUnion", "incoming", "ZodIntersection", "transform", "defaultValueFunc", "ZodDefault", "ZodBranded", "catchValueFunc", "ZodCatch", "This", "target", "ZodPipeline", "ZodReadonly", "cuidRegex", "cuid2Regex", "ulidRegex", "uuidRegex", "nanoidRegex", "jwtRegex", "durationRegex", "emailRegex", "_emojiRegex", "emojiRegex", "ipv4Regex", "ipv4CidrRegex", "ipv6Regex", "ipv6CidrRegex", "base64Regex", "base64urlRegex", "dateRegexSource", "dateRegex", "timeRegexSource", "args", "secondsRegexSource", "secondsQuantifier", "timeRegex", "regex", "opts", "isValidIP", "ip", "version", "isValidJWT", "jwt", "alg", "header", "base64", "decoded", "isValidCidr", "ZodString", "_ZodString", "status", "tooBig", "tooSmall", "validation", "options", "minLength", "maxLength", "len", "ch", "min", "max", "floatSafeRemainder", "step", "valDecCount", "stepDecCount", "decCount", "valInt", "stepInt", "ZodNumber", "_ZodNumber", "kind", "inclusive", "ZodBigInt", "_ZodBigInt", "ZodBoolean", "ZodDate", "_ZodDate", "minDate", "maxDate", "ZodSymbol", "ZodUndefined", "ZodNull", "ZodAny", "ZodUnknown", "ZodNever", "ZodVoid", "_ZodArray", "item", "i", "schema", "deepPartialify", "ZodObject", "newShape", "fieldSchema", "ZodTuple", "_ZodObject", "shape", "keys", "shapeKeys", "extraKeys", "pairs", "keyValidator", "unknownKeys", "catchall", "syncPairs", "pair", "issue", "_c", "_d", "defaultError", "augmentation", "merging", "index", "mask", "newField", "createZodEnum", "handleResults", "results", "unionErrors", "childCtx", "dirty", "issues", "types", "getDiscriminator", "type", "ZodLazy", "ZodLiteral", "ZodEnum", "ZodNativeEnum", "ZodDiscriminatedUnion", "_ZodDiscriminatedUnion", "discriminator", "discriminatorValue", "optionsMap", "discriminatorValues", "mergeValues", "a", "b", "aType", "bType", "bKeys", "sharedKeys", "newObj", "sharedValue", "newArray", "itemA", "itemB", "handleParsed", "parsedLeft", "parsedRight", "merged", "left", "right", "_ZodTuple", "items", "itemIndex", "x", "rest", "schemas", "ZodRecord", "_ZodRecord", "keyType", "valueType", "first", "second", "third", "ZodMap", "finalMap", "ZodSet", "_ZodSet", "finalizeSet", "elements", "parsedSet", "element", "minSize", "maxSize", "size", "ZodFunction", "_ZodFunction", "makeArgsIssue", "makeReturnsIssue", "returns", "fn", "me", "parsedArgs", "e", "parsedReturns", "returnType", "func", "getter", "values", "_ZodEnum", "expectedValues", "enumValues", "newDef", "opt", "nativeEnumValues", "promisified", "effect", "checkCtx", "arg", "processed", "executeRefinement", "acc", "inner", "base", "preprocess", "newCtx", "ZodNaN", "_ZodPipeline", "inResult", "freeze", "cleanParams", "p", "_params", "fatal", "r", "_fatal", "instanceOfType", "cls", "stringType", "numberType", "nanType", "bigIntType", "booleanType", "dateType", "symbolType", "undefinedType", "nullType", "anyType", "unknownType", "neverType", "voidType", "arrayType", "objectType", "strictObjectType", "unionType", "discriminatedUnionType", "intersectionType", "tupleType", "recordType", "mapType", "setType", "functionType", "lazyType", "literalType", "enumType", "nativeEnumType", "promiseType", "effectsType", "optionalType", "nullableType", "preprocessType", "pipelineType", "ostring", "onumber", "oboolean", "require_external", "__commonJSMin", "exports", "__createBinding", "o", "m", "k", "k2", "desc", "__exportStar", "p", "require_zod", "__commonJSMin", "exports", "__createBinding", "o", "m", "k", "k2", "desc", "__setModuleDefault", "v", "__importStar", "mod", "result", "__exportStar", "p", "z", "zod_1", "ActionTypes", "exports", "zod_1", "SemanticActionStateTypes", "exports", "zod_1", "AttachmentLayoutTypes", "exports", "Channels", "exports", "zod_1", "EndOfConversationCodes", "exports", "zod_1", "MembershipSourceTypes", "exports", "zod_1", "MembershipTypes", "exports", "zod_1", "RoleTypes", "exports", "addAIToActivity", "activity", "citations", "usageInfo", "aiEntity", "_a", "exports", "zod_1", "exports", "require_max", "__commonJSMin", "exports", "require_nil", "__commonJSMin", "exports", "require_regex", "__commonJSMin", "exports", "require_validate", "__commonJSMin", "exports", "regex_js_1", "validate", "uuid", "require_parse", "__commonJSMin", "exports", "validate_js_1", "parse", "uuid", "v", "require_stringify", "__commonJSMin", "exports", "validate_js_1", "byteToHex", "i", "unsafeStringify", "arr", "offset", "stringify", "uuid", "require_rng", "__commonJSMin", "exports", "getRandomValues", "rnds8", "rng", "require_v1", "__commonJSMin", "exports", "rng_js_1", "stringify_js_1", "_state", "v1", "options", "buf", "offset", "_a", "_b", "_c", "_d", "bytes", "isV6", "optionsKeys", "v1Bytes", "now", "rnds", "updateV1State", "state", "msecs", "nsecs", "clockseq", "node", "tl", "tmh", "n", "require_v1ToV6", "__commonJSMin", "exports", "parse_js_1", "stringify_js_1", "v1ToV6", "uuid", "v1Bytes", "v6Bytes", "_v1ToV6", "require_md5", "__commonJSMin", "exports", "md5", "bytes", "words", "uint8ToUint32", "md5Bytes", "wordsToMd5", "uint32ToUint8", "input", "i", "getOutputLength", "inputLength8", "x", "len", "xpad", "a", "b", "c", "d", "olda", "oldb", "oldc", "oldd", "md5ff", "md5gg", "md5hh", "md5ii", "safeAdd", "output", "y", "lsw", "bitRotateLeft", "num", "cnt", "md5cmn", "q", "s", "t", "require_v35", "__commonJSMin", "exports", "parse_js_1", "stringify_js_1", "stringToBytes", "str", "bytes", "i", "v35", "version", "hash", "value", "namespace", "buf", "offset", "valueBytes", "namespaceBytes", "require_v3", "__commonJSMin", "exports", "md5_js_1", "v35_js_1", "v35_js_2", "v3", "value", "namespace", "buf", "offset", "require_native", "__commonJSMin", "exports", "randomUUID", "require_v4", "__commonJSMin", "exports", "native_js_1", "rng_js_1", "stringify_js_1", "v4", "options", "buf", "offset", "_a", "_b", "_c", "rnds", "i", "require_sha1", "__commonJSMin", "exports", "f", "s", "x", "y", "z", "ROTL", "n", "sha1", "bytes", "K", "H", "newBytes", "l", "N", "M", "i", "arr", "j", "W", "t", "a", "b", "c", "d", "e", "T", "require_v5", "__commonJSMin", "exports", "sha1_js_1", "v35_js_1", "v35_js_2", "v5", "value", "namespace", "buf", "offset", "require_v6", "__commonJSMin", "exports", "stringify_js_1", "v1_js_1", "v1ToV6_js_1", "v6", "options", "buf", "offset", "bytes", "i", "require_v6ToV1", "__commonJSMin", "exports", "parse_js_1", "stringify_js_1", "v6ToV1", "uuid", "v6Bytes", "v1Bytes", "_v6ToV1", "require_v7", "__commonJSMin", "exports", "rng_js_1", "stringify_js_1", "_state", "v7", "options", "buf", "offset", "_a", "_b", "_c", "bytes", "v7Bytes", "now", "rnds", "updateV7State", "state", "msecs", "seq", "require_version", "__commonJSMin", "exports", "validate_js_1", "version", "uuid", "require_cjs_browser", "__commonJSMin", "exports", "max_js_1", "nil_js_1", "parse_js_1", "stringify_js_1", "v1_js_1", "v1ToV6_js_1", "v3_js_1", "v4_js_1", "v5_js_1", "v6_js_1", "v6ToV1_js_1", "v7_js_1", "validate_js_1", "version_js_1", "zod_1", "exports", "zod_1", "entity_1", "semanticActionStateTypes_1", "exports", "zod_1", "actionTypes_1", "exports", "zod_1", "cardAction_1", "exports", "zod_1", "ActivityEventNames", "exports", "zod_1", "ActivityImportance", "exports", "zod_1", "ActivityTypes", "exports", "zod_1", "exports", "clearProductInfoFromActivity", "activity", "exports", "addProductInfoToActivity", "id", "productInfo", "_a", "_b", "zod_1", "roleTypes_1", "exports", "zod_1", "roleTypes_1", "exports", "zod_1", "channelAccount_1", "conversationAccount_1", "exports", "zod_1", "DeliveryModes", "exports", "zod_1", "InputHints", "exports", "zod_1", "MessageReactionTypes", "exports", "zod_1", "messageReactionTypes_1", "exports", "zod_1", "TextFormatTypes", "exports", "zod_1", "exports", "ExceptionHelper", "_ExceptionHelper", "ErrorType", "errorDefinition", "innerException", "params", "description", "key", "helplink", "_a", "message", "exception", "exports", "exports", "uuid_1", "zod_1", "semanticAction_1", "suggestedActions_1", "activityEventNames_1", "activityImportance_1", "activityTypes_1", "attachment_1", "attachmentLayoutTypes_1", "productInfo_1", "channelAccount_1", "channels_1", "conversationAccount_1", "conversationReference_1", "endOfConversationCodes_1", "deliveryModes_1", "entity_1", "inputHints_1", "messageReaction_1", "textFormatTypes_1", "textHighlight_1", "roleTypes_1", "exceptionHelper_1", "errorHelper_1", "exports", "s", "Activity", "_Activity", "t", "json", "o", "parsedActivity", "activity", "_a", "value", "channel", "subChannel", "_b", "e", "reference", "continuationActivityObj", "isIncoming", "_c", "activityCopy", "key", "result", "i", "removeMention", "entity", "mentions", "mention", "text", "foundTag", "iAtStart", "iAtEnd", "iAtClose", "followingText", "tagContent", "prefixText", "id", "mentionsFiltered", "replyId", "replacer", "space", "copy", "zod_1", "ActivityTreatments", "exports", "actionTypes_1", "exports", "semanticActionStateTypes_1", "attachmentLayoutTypes_1", "channels_1", "endOfConversationCodes_1", "membershipSourceTypes_1", "membershipTypes_1", "roleTypes_1", "__exportStar", "activity_1", "activityEventNames_1", "activityImportance_1", "activityTypes_1", "deliveryModes_1", "inputHints_1", "messageReactionTypes_1", "textFormatTypes_1", "activityTreatments_1", "logger_1", "exceptionHelper_1", "errorHelper_1", "AgentType", "PowerPlatformCloud", "ConnectionOptions", "ConnectionSettings", "options", "_a", "_b", "_c", "cloud", "copilotAgentType", "authority", "PowerPlatformCloud", "AgentType", "loadCopilotStudioConnectionSettingsFromEnv", "_d", "_e", "_f", "_g", "ParseError", "message", "options", "noop", "_arg", "createParser", "callbacks", "onEvent", "onError", "onRetry", "onComment", "incompleteLine", "isFirstChunk", "id", "data", "eventType", "feed", "newChunk", "chunk", "complete", "incomplete", "splitLines", "line", "parseLine", "dispatchEvent", "fieldSeparatorIndex", "field", "offset", "value", "processField", "reset", "lines", "searchIndex", "crIndex", "lfIndex", "lineEnd", "CONNECTING", "OPEN", "CLOSED", "noop", "createEventSource", "optionsOrUrl", "getStream", "options", "onMessage", "onComment", "onConnect", "onDisconnect", "onScheduleReconnect", "fetch", "url", "initialLastEventId", "validate", "requestHeaders", "onCloseSubscribers", "subscribers", "emit", "event", "fn", "parser", "createParser", "onEvent", "onRetry", "request", "currentUrl", "controller", "lastEventId", "reconnectMs", "reconnectTimer", "readyState", "connect", "close", "getEventIterator", "getRequestOptions", "onFetchResponse", "err", "scheduleReconnect", "pullQueue", "pushQueue", "pullValue", "resolve", "value", "pushValue", "unsubscribe", "onClose", "error", "response", "body", "redirected", "status", "stream", "decoder", "reader", "open", "done", "msg", "ms", "mode", "credentials", "method", "redirect", "referrer", "referrerPolicy", "headers", "isFetchLike", "defaultAbstractions", "createSource", "import_logger", "PrebuiltBotStrategy", "settings", "schema", "host", "conversationId", "conversationUrl", "PublishedBotStrategy", "settings", "schema", "host", "conversationId", "conversationUrl", "logger", "getCopilotStudioConnectionUrl", "settings", "conversationId", "_a", "_b", "_c", "_d", "_e", "_f", "_g", "_h", "schemaName", "isValidUri", "createURL", "cloudSetting", "agentType", "host", "getEnvironmentEndpoint", "url", "PublishedBotStrategy", "PrebuiltBotStrategy", "getTokenAudience", "cloud", "cloudBaseAddress", "directConnectUrl", "getEndpointSuffix", "decodeCloudFromURI", "cloudToTest", "uri", "absoluteUrl", "base", "environmentId", "normalizedResourceId", "idSuffixLength", "getIdSuffixLength", "hexPrefix", "hexSuffix", "category", "import_agents_activity", "ExecuteTurnRequest", "activity", "import_logger", "version", "os_default", "logger", "_CopilotStudioClient", "settings", "token", "url", "body", "method", "_a", "_b", "_c", "_d", "_e", "_f", "_g", "_h", "_i", "_j", "streamMap", "eventSource", "createEventSource", "init", "response", "data", "event", "activity", "streamingEntity", "e", "text", "id", "sequence", "existing", "a", "b", "item", "error", "versionString", "version", "userAgent", "os_default", "responseHeaders", "islandExperimentalUrl", "sanitizedHeaders", "value", "key", "emitStartConversationEvent", "uriStart", "getCopilotStudioConnectionUrl", "conversationId", "localConversationId", "uriExecute", "qbody", "ExecuteTurnRequest", "result", "question", "conversationAccount", "activityObj", "getTokenAudience", "CopilotStudioClient", "byteToHex", "i", "unsafeStringify", "arr", "offset", "getRandomValues", "rnds8", "rng", "randomUUID", "native_default", "v4", "options", "buf", "offset", "_a", "_b", "_c", "native_default", "rnds", "rng", "i", "unsafeStringify", "v4_default", "import_agents_activity", "extendStatics", "d", "b", "p", "__extends", "__", "__values", "o", "s", "m", "i", "__read", "n", "r", "ar", "e", "error", "__spreadArray", "to", "from", "pack", "i", "l", "ar", "isFunction", "value", "createErrorClass", "createImpl", "_super", "instance", "ctorFunc", "UnsubscriptionError", "createErrorClass", "_super", "errors", "err", "i", "arrRemove", "arr", "item", "index", "Subscription", "initialTeardown", "errors", "_parentage", "_parentage_1", "__values", "_parentage_1_1", "parent_1", "initialFinalizer", "isFunction", "e", "UnsubscriptionError", "_finalizers", "_finalizers_1", "_finalizers_1_1", "finalizer", "execFinalizer", "err", "__spreadArray", "__read", "teardown", "_a", "parent", "arrRemove", "empty", "EMPTY_SUBSCRIPTION", "Subscription", "isSubscription", "value", "isFunction", "execFinalizer", "finalizer", "config", "timeoutProvider", "handler", "timeout", "args", "_i", "delegate", "__spreadArray", "__read", "handle", "reportUnhandledError", "err", "timeoutProvider", "onUnhandledError", "config", "noop", "COMPLETE_NOTIFICATION", "createNotification", "errorNotification", "error", "nextNotification", "value", "kind", "context", "errorContext", "cb", "config", "isRoot", "_a", "errorThrown", "error", "captureError", "err", "Subscriber", "_super", "__extends", "destination", "_this", "isSubscription", "EMPTY_OBSERVER", "next", "error", "complete", "SafeSubscriber", "value", "handleStoppedNotification", "nextNotification", "err", "errorNotification", "COMPLETE_NOTIFICATION", "Subscription", "_bind", "bind", "fn", "thisArg", "ConsumerObserver", "partialObserver", "value", "error", "handleUnhandledError", "err", "SafeSubscriber", "_super", "__extends", "observerOrNext", "complete", "_this", "isFunction", "context_1", "config", "Subscriber", "handleUnhandledError", "error", "config", "captureError", "reportUnhandledError", "defaultErrorHandler", "err", "handleStoppedNotification", "notification", "subscriber", "onStoppedNotification", "timeoutProvider", "EMPTY_OBSERVER", "noop", "observable", "identity", "x", "pipeFromArray", "fns", "identity", "input", "prev", "fn", "Observable", "subscribe", "operator", "observable", "observerOrNext", "error", "complete", "_this", "subscriber", "isSubscriber", "SafeSubscriber", "errorContext", "_a", "source", "sink", "err", "next", "promiseCtor", "getPromiseCtor", "resolve", "reject", "value", "operations", "_i", "pipeFromArray", "x", "getPromiseCtor", "promiseCtor", "_a", "config", "isObserver", "value", "isFunction", "isSubscriber", "Subscriber", "isSubscription", "ObjectUnsubscribedError", "createErrorClass", "_super", "Subject", "_super", "__extends", "_this", "operator", "subject", "AnonymousSubject", "ObjectUnsubscribedError", "value", "errorContext", "_b", "__values", "_c", "observer", "err", "observers", "_a", "subscriber", "hasError", "isStopped", "EMPTY_SUBSCRIPTION", "Subscription", "arrRemove", "thrownError", "observable", "Observable", "destination", "source", "AnonymousSubject", "_super", "__extends", "destination", "source", "_this", "value", "_b", "_a", "err", "subscriber", "EMPTY_SUBSCRIPTION", "Subject", "BehaviorSubject", "_super", "__extends", "_value", "_this", "subscriber", "subscription", "_a", "hasError", "thrownError", "value", "Subject", "import_logger", "logger", "once", "fn", "called", "value", "CopilotStudioWebChat", "client", "settings", "sequence", "activitySubscriber", "conversation", "connectionStatus$", "BehaviorSubject", "activity$", "createObservable", "subscriber", "handleAcknowledgementOnce", "notifyTyping", "activity", "notifyActivity", "newActivity", "from", "v4_default", "processAttachments", "responseActivity", "error", "_a", "attachments", "attachment", "processed", "processBlobAttachment", "newContentUrl", "response", "blob", "arrayBuffer", "base64", "arrayBufferToBase64", "buffer", "BufferClass", "binary", "byte", "Observable"]
7
7
  }