@getuserfeedback/sdk 0.19.4 → 0.19.12

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.
@@ -13,13 +13,13 @@
13
13
  "import * as checks from \"./checks.js\";\nimport * as registries from \"./registries.js\";\nimport * as schemas from \"./schemas.js\";\nimport * as util from \"./util.js\";\n// @__NO_SIDE_EFFECTS__\nexport function _string(Class, params) {\n return new Class({\n type: \"string\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedString(Class, params) {\n return new Class({\n type: \"string\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _email(Class, params) {\n return new Class({\n type: \"string\",\n format: \"email\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _guid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"guid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uuid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uuidv4(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n version: \"v4\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uuidv6(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n version: \"v6\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uuidv7(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n version: \"v7\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _url(Class, params) {\n return new Class({\n type: \"string\",\n format: \"url\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _emoji(Class, params) {\n return new Class({\n type: \"string\",\n format: \"emoji\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _nanoid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"nanoid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n/**\n * @deprecated CUID v1 is deprecated by its authors due to information leakage\n * (timestamps embedded in the id). Use {@link _cuid2} instead.\n * See https://github.com/paralleldrive/cuid.\n */\n// @__NO_SIDE_EFFECTS__\nexport function _cuid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cuid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _cuid2(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cuid2\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _ulid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ulid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _xid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"xid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _ksuid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ksuid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _ipv4(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ipv4\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _ipv6(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ipv6\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _mac(Class, params) {\n return new Class({\n type: \"string\",\n format: \"mac\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _cidrv4(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cidrv4\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _cidrv6(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cidrv6\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _base64(Class, params) {\n return new Class({\n type: \"string\",\n format: \"base64\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _base64url(Class, params) {\n return new Class({\n type: \"string\",\n format: \"base64url\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _e164(Class, params) {\n return new Class({\n type: \"string\",\n format: \"e164\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _jwt(Class, params) {\n return new Class({\n type: \"string\",\n format: \"jwt\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport const TimePrecision = {\n Any: null,\n Minute: -1,\n Second: 0,\n Millisecond: 3,\n Microsecond: 6,\n};\n// @__NO_SIDE_EFFECTS__\nexport function _isoDateTime(Class, params) {\n return new Class({\n type: \"string\",\n format: \"datetime\",\n check: \"string_format\",\n offset: false,\n local: false,\n precision: null,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _isoDate(Class, params) {\n return new Class({\n type: \"string\",\n format: \"date\",\n check: \"string_format\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _isoTime(Class, params) {\n return new Class({\n type: \"string\",\n format: \"time\",\n check: \"string_format\",\n precision: null,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _isoDuration(Class, params) {\n return new Class({\n type: \"string\",\n format: \"duration\",\n check: \"string_format\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _number(Class, params) {\n return new Class({\n type: \"number\",\n checks: [],\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedNumber(Class, params) {\n return new Class({\n type: \"number\",\n coerce: true,\n checks: [],\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _int(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"safeint\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _float32(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"float32\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _float64(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"float64\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _int32(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"int32\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uint32(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"uint32\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _boolean(Class, params) {\n return new Class({\n type: \"boolean\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedBoolean(Class, params) {\n return new Class({\n type: \"boolean\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _bigint(Class, params) {\n return new Class({\n type: \"bigint\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedBigint(Class, params) {\n return new Class({\n type: \"bigint\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _int64(Class, params) {\n return new Class({\n type: \"bigint\",\n check: \"bigint_format\",\n abort: false,\n format: \"int64\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uint64(Class, params) {\n return new Class({\n type: \"bigint\",\n check: \"bigint_format\",\n abort: false,\n format: \"uint64\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _symbol(Class, params) {\n return new Class({\n type: \"symbol\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _undefined(Class, params) {\n return new Class({\n type: \"undefined\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _null(Class, params) {\n return new Class({\n type: \"null\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _any(Class) {\n return new Class({\n type: \"any\",\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _unknown(Class) {\n return new Class({\n type: \"unknown\",\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _never(Class, params) {\n return new Class({\n type: \"never\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _void(Class, params) {\n return new Class({\n type: \"void\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _date(Class, params) {\n return new Class({\n type: \"date\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedDate(Class, params) {\n return new Class({\n type: \"date\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _nan(Class, params) {\n return new Class({\n type: \"nan\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _lt(value, params) {\n return new checks.$ZodCheckLessThan({\n check: \"less_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: false,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _lte(value, params) {\n return new checks.$ZodCheckLessThan({\n check: \"less_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: true,\n });\n}\nexport { \n/** @deprecated Use `z.lte()` instead. */\n_lte as _max, };\n// @__NO_SIDE_EFFECTS__\nexport function _gt(value, params) {\n return new checks.$ZodCheckGreaterThan({\n check: \"greater_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: false,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _gte(value, params) {\n return new checks.$ZodCheckGreaterThan({\n check: \"greater_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: true,\n });\n}\nexport { \n/** @deprecated Use `z.gte()` instead. */\n_gte as _min, };\n// @__NO_SIDE_EFFECTS__\nexport function _positive(params) {\n return _gt(0, params);\n}\n// negative\n// @__NO_SIDE_EFFECTS__\nexport function _negative(params) {\n return _lt(0, params);\n}\n// nonpositive\n// @__NO_SIDE_EFFECTS__\nexport function _nonpositive(params) {\n return _lte(0, params);\n}\n// nonnegative\n// @__NO_SIDE_EFFECTS__\nexport function _nonnegative(params) {\n return _gte(0, params);\n}\n// @__NO_SIDE_EFFECTS__\nexport function _multipleOf(value, params) {\n return new checks.$ZodCheckMultipleOf({\n check: \"multiple_of\",\n ...util.normalizeParams(params),\n value,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _maxSize(maximum, params) {\n return new checks.$ZodCheckMaxSize({\n check: \"max_size\",\n ...util.normalizeParams(params),\n maximum,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _minSize(minimum, params) {\n return new checks.$ZodCheckMinSize({\n check: \"min_size\",\n ...util.normalizeParams(params),\n minimum,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _size(size, params) {\n return new checks.$ZodCheckSizeEquals({\n check: \"size_equals\",\n ...util.normalizeParams(params),\n size,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _maxLength(maximum, params) {\n const ch = new checks.$ZodCheckMaxLength({\n check: \"max_length\",\n ...util.normalizeParams(params),\n maximum,\n });\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _minLength(minimum, params) {\n return new checks.$ZodCheckMinLength({\n check: \"min_length\",\n ...util.normalizeParams(params),\n minimum,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _length(length, params) {\n return new checks.$ZodCheckLengthEquals({\n check: \"length_equals\",\n ...util.normalizeParams(params),\n length,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _regex(pattern, params) {\n return new checks.$ZodCheckRegex({\n check: \"string_format\",\n format: \"regex\",\n ...util.normalizeParams(params),\n pattern,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _lowercase(params) {\n return new checks.$ZodCheckLowerCase({\n check: \"string_format\",\n format: \"lowercase\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uppercase(params) {\n return new checks.$ZodCheckUpperCase({\n check: \"string_format\",\n format: \"uppercase\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _includes(includes, params) {\n return new checks.$ZodCheckIncludes({\n check: \"string_format\",\n format: \"includes\",\n ...util.normalizeParams(params),\n includes,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _startsWith(prefix, params) {\n return new checks.$ZodCheckStartsWith({\n check: \"string_format\",\n format: \"starts_with\",\n ...util.normalizeParams(params),\n prefix,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _endsWith(suffix, params) {\n return new checks.$ZodCheckEndsWith({\n check: \"string_format\",\n format: \"ends_with\",\n ...util.normalizeParams(params),\n suffix,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _property(property, schema, params) {\n return new checks.$ZodCheckProperty({\n check: \"property\",\n property,\n schema,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _mime(types, params) {\n return new checks.$ZodCheckMimeType({\n check: \"mime_type\",\n mime: types,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _overwrite(tx) {\n return new checks.$ZodCheckOverwrite({\n check: \"overwrite\",\n tx,\n });\n}\n// normalize\n// @__NO_SIDE_EFFECTS__\nexport function _normalize(form) {\n return _overwrite((input) => input.normalize(form));\n}\n// trim\n// @__NO_SIDE_EFFECTS__\nexport function _trim() {\n return _overwrite((input) => input.trim());\n}\n// toLowerCase\n// @__NO_SIDE_EFFECTS__\nexport function _toLowerCase() {\n return _overwrite((input) => input.toLowerCase());\n}\n// toUpperCase\n// @__NO_SIDE_EFFECTS__\nexport function _toUpperCase() {\n return _overwrite((input) => input.toUpperCase());\n}\n// slugify\n// @__NO_SIDE_EFFECTS__\nexport function _slugify() {\n return _overwrite((input) => util.slugify(input));\n}\n// @__NO_SIDE_EFFECTS__\nexport function _array(Class, element, params) {\n return new Class({\n type: \"array\",\n element,\n // get element() {\n // return element;\n // },\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _union(Class, options, params) {\n return new Class({\n type: \"union\",\n options,\n ...util.normalizeParams(params),\n });\n}\nexport function _xor(Class, options, params) {\n return new Class({\n type: \"union\",\n options,\n inclusive: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _discriminatedUnion(Class, discriminator, options, params) {\n return new Class({\n type: \"union\",\n options,\n discriminator,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _intersection(Class, left, right) {\n return new Class({\n type: \"intersection\",\n left,\n right,\n });\n}\n// export function _tuple(\n// Class: util.SchemaClass<schemas.$ZodTuple>,\n// items: [],\n// params?: string | $ZodTupleParams\n// ): schemas.$ZodTuple<[], null>;\n// @__NO_SIDE_EFFECTS__\nexport function _tuple(Class, items, _paramsOrRest, _params) {\n const hasRest = _paramsOrRest instanceof schemas.$ZodType;\n const params = hasRest ? _params : _paramsOrRest;\n const rest = hasRest ? _paramsOrRest : null;\n return new Class({\n type: \"tuple\",\n items,\n rest,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _record(Class, keyType, valueType, params) {\n return new Class({\n type: \"record\",\n keyType,\n valueType,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _map(Class, keyType, valueType, params) {\n return new Class({\n type: \"map\",\n keyType,\n valueType,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _set(Class, valueType, params) {\n return new Class({\n type: \"set\",\n valueType,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _enum(Class, values, params) {\n const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;\n // if (Array.isArray(values)) {\n // for (const value of values) {\n // entries[value] = value;\n // }\n // } else {\n // Object.assign(entries, values);\n // }\n // const entries: util.EnumLike = {};\n // for (const val of values) {\n // entries[val] = val;\n // }\n return new Class({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\n/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.\n *\n * ```ts\n * enum Colors { red, green, blue }\n * z.enum(Colors);\n * ```\n */\nexport function _nativeEnum(Class, entries, params) {\n return new Class({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _literal(Class, value, params) {\n return new Class({\n type: \"literal\",\n values: Array.isArray(value) ? value : [value],\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _file(Class, params) {\n return new Class({\n type: \"file\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _transform(Class, fn) {\n return new Class({\n type: \"transform\",\n transform: fn,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _optional(Class, innerType) {\n return new Class({\n type: \"optional\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _nullable(Class, innerType) {\n return new Class({\n type: \"nullable\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _default(Class, innerType, defaultValue) {\n return new Class({\n type: \"default\",\n innerType,\n get defaultValue() {\n return typeof defaultValue === \"function\" ? defaultValue() : util.shallowClone(defaultValue);\n },\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _nonoptional(Class, innerType, params) {\n return new Class({\n type: \"nonoptional\",\n innerType,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _success(Class, innerType) {\n return new Class({\n type: \"success\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _catch(Class, innerType, catchValue) {\n return new Class({\n type: \"catch\",\n innerType,\n catchValue: (typeof catchValue === \"function\" ? catchValue : () => catchValue),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _pipe(Class, in_, out) {\n return new Class({\n type: \"pipe\",\n in: in_,\n out,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _readonly(Class, innerType) {\n return new Class({\n type: \"readonly\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _templateLiteral(Class, parts, params) {\n return new Class({\n type: \"template_literal\",\n parts,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _lazy(Class, getter) {\n return new Class({\n type: \"lazy\",\n getter,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _promise(Class, innerType) {\n return new Class({\n type: \"promise\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _custom(Class, fn, _params) {\n const norm = util.normalizeParams(_params);\n norm.abort ?? (norm.abort = true); // default to abort:false\n const schema = new Class({\n type: \"custom\",\n check: \"custom\",\n fn: fn,\n ...norm,\n });\n return schema;\n}\n// same as _custom but defaults to abort:false\n// @__NO_SIDE_EFFECTS__\nexport function _refine(Class, fn, _params) {\n const schema = new Class({\n type: \"custom\",\n check: \"custom\",\n fn: fn,\n ...util.normalizeParams(_params),\n });\n return schema;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _superRefine(fn, params) {\n const ch = _check((payload) => {\n payload.addIssue = (issue) => {\n if (typeof issue === \"string\") {\n payload.issues.push(util.issue(issue, payload.value, ch._zod.def));\n }\n else {\n // for Zod 3 backwards compatibility\n const _issue = issue;\n if (_issue.fatal)\n _issue.continue = false;\n _issue.code ?? (_issue.code = \"custom\");\n _issue.input ?? (_issue.input = payload.value);\n _issue.inst ?? (_issue.inst = ch);\n _issue.continue ?? (_issue.continue = !ch._zod.def.abort); // abort is always undefined, so this is always true...\n payload.issues.push(util.issue(_issue));\n }\n };\n return fn(payload.value, payload);\n }, params);\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _check(fn, params) {\n const ch = new checks.$ZodCheck({\n check: \"custom\",\n ...util.normalizeParams(params),\n });\n ch._zod.check = fn;\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function describe(description) {\n const ch = new checks.$ZodCheck({ check: \"describe\" });\n ch._zod.onattach = [\n (inst) => {\n const existing = registries.globalRegistry.get(inst) ?? {};\n registries.globalRegistry.add(inst, { ...existing, description });\n },\n ];\n ch._zod.check = () => { }; // no-op check\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function meta(metadata) {\n const ch = new checks.$ZodCheck({ check: \"meta\" });\n ch._zod.onattach = [\n (inst) => {\n const existing = registries.globalRegistry.get(inst) ?? {};\n registries.globalRegistry.add(inst, { ...existing, ...metadata });\n },\n ];\n ch._zod.check = () => { }; // no-op check\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _stringbool(Classes, _params) {\n const params = util.normalizeParams(_params);\n let truthyArray = params.truthy ?? [\"true\", \"1\", \"yes\", \"on\", \"y\", \"enabled\"];\n let falsyArray = params.falsy ?? [\"false\", \"0\", \"no\", \"off\", \"n\", \"disabled\"];\n if (params.case !== \"sensitive\") {\n truthyArray = truthyArray.map((v) => (typeof v === \"string\" ? v.toLowerCase() : v));\n falsyArray = falsyArray.map((v) => (typeof v === \"string\" ? v.toLowerCase() : v));\n }\n const truthySet = new Set(truthyArray);\n const falsySet = new Set(falsyArray);\n const _Codec = Classes.Codec ?? schemas.$ZodCodec;\n const _Boolean = Classes.Boolean ?? schemas.$ZodBoolean;\n const _String = Classes.String ?? schemas.$ZodString;\n const stringSchema = new _String({ type: \"string\", error: params.error });\n const booleanSchema = new _Boolean({ type: \"boolean\", error: params.error });\n const codec = new _Codec({\n type: \"pipe\",\n in: stringSchema,\n out: booleanSchema,\n transform: ((input, payload) => {\n let data = input;\n if (params.case !== \"sensitive\")\n data = data.toLowerCase();\n if (truthySet.has(data)) {\n return true;\n }\n else if (falsySet.has(data)) {\n return false;\n }\n else {\n payload.issues.push({\n code: \"invalid_value\",\n expected: \"stringbool\",\n values: [...truthySet, ...falsySet],\n input: payload.value,\n inst: codec,\n continue: false,\n });\n return {};\n }\n }),\n reverseTransform: ((input, _payload) => {\n if (input === true) {\n return truthyArray[0] || \"true\";\n }\n else {\n return falsyArray[0] || \"false\";\n }\n }),\n error: params.error,\n });\n return codec;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _stringFormat(Class, format, fnOrRegex, _params = {}) {\n const params = util.normalizeParams(_params);\n const def = {\n ...util.normalizeParams(_params),\n check: \"string_format\",\n type: \"string\",\n format,\n fn: typeof fnOrRegex === \"function\" ? fnOrRegex : (val) => fnOrRegex.test(val),\n ...params,\n };\n if (fnOrRegex instanceof RegExp) {\n def.pattern = fnOrRegex;\n }\n const inst = new Class(def);\n return inst;\n}\n",
14
14
  "import * as core from \"../core/index.js\";\nimport * as util from \"../core/util.js\";\nimport * as parse from \"./parse.js\";\nexport const ZodMiniType = /*@__PURE__*/ core.$constructor(\"ZodMiniType\", (inst, def) => {\n if (!inst._zod)\n throw new Error(\"Uninitialized schema in ZodMiniType.\");\n core.$ZodType.init(inst, def);\n inst.def = def;\n inst.type = def.type;\n inst.parse = (data, params) => parse.parse(inst, data, params, { callee: inst.parse });\n inst.safeParse = (data, params) => parse.safeParse(inst, data, params);\n inst.parseAsync = async (data, params) => parse.parseAsync(inst, data, params, { callee: inst.parseAsync });\n inst.safeParseAsync = async (data, params) => parse.safeParseAsync(inst, data, params);\n inst.check = (...checks) => {\n return inst.clone({\n ...def,\n checks: [\n ...(def.checks ?? []),\n ...checks.map((ch) => typeof ch === \"function\"\n ? {\n _zod: { check: ch, def: { check: \"custom\" }, onattach: [] },\n }\n : ch),\n ],\n }, { parent: true });\n };\n inst.with = inst.check;\n inst.clone = (_def, params) => core.clone(inst, _def, params);\n inst.brand = () => inst;\n inst.register = ((reg, meta) => {\n reg.add(inst, meta);\n return inst;\n });\n inst.apply = (fn) => fn(inst);\n});\nexport const ZodMiniString = /*@__PURE__*/ core.$constructor(\"ZodMiniString\", (inst, def) => {\n core.$ZodString.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function string(params) {\n return core._string(ZodMiniString, params);\n}\nexport const ZodMiniStringFormat = /*@__PURE__*/ core.$constructor(\"ZodMiniStringFormat\", (inst, def) => {\n core.$ZodStringFormat.init(inst, def);\n ZodMiniString.init(inst, def);\n});\nexport const ZodMiniEmail = /*@__PURE__*/ core.$constructor(\"ZodMiniEmail\", (inst, def) => {\n core.$ZodEmail.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function email(params) {\n return core._email(ZodMiniEmail, params);\n}\nexport const ZodMiniGUID = /*@__PURE__*/ core.$constructor(\"ZodMiniGUID\", (inst, def) => {\n core.$ZodGUID.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function guid(params) {\n return core._guid(ZodMiniGUID, params);\n}\nexport const ZodMiniUUID = /*@__PURE__*/ core.$constructor(\"ZodMiniUUID\", (inst, def) => {\n core.$ZodUUID.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function uuid(params) {\n return core._uuid(ZodMiniUUID, params);\n}\n// @__NO_SIDE_EFFECTS__\nexport function uuidv4(params) {\n return core._uuidv4(ZodMiniUUID, params);\n}\n// ZodMiniUUIDv6\n// @__NO_SIDE_EFFECTS__\nexport function uuidv6(params) {\n return core._uuidv6(ZodMiniUUID, params);\n}\n// ZodMiniUUIDv7\n// @__NO_SIDE_EFFECTS__\nexport function uuidv7(params) {\n return core._uuidv7(ZodMiniUUID, params);\n}\nexport const ZodMiniURL = /*@__PURE__*/ core.$constructor(\"ZodMiniURL\", (inst, def) => {\n core.$ZodURL.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function url(params) {\n return core._url(ZodMiniURL, params);\n}\n// @__NO_SIDE_EFFECTS__\nexport function httpUrl(params) {\n return core._url(ZodMiniURL, {\n protocol: core.regexes.httpProtocol,\n hostname: core.regexes.domain,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniEmoji = /*@__PURE__*/ core.$constructor(\"ZodMiniEmoji\", (inst, def) => {\n core.$ZodEmoji.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function emoji(params) {\n return core._emoji(ZodMiniEmoji, params);\n}\nexport const ZodMiniNanoID = /*@__PURE__*/ core.$constructor(\"ZodMiniNanoID\", (inst, def) => {\n core.$ZodNanoID.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function nanoid(params) {\n return core._nanoid(ZodMiniNanoID, params);\n}\n/**\n * @deprecated CUID v1 is deprecated by its authors due to information leakage\n * (timestamps embedded in the id). Use {@link ZodMiniCUID2} instead.\n * See https://github.com/paralleldrive/cuid.\n */\nexport const ZodMiniCUID = /*@__PURE__*/ core.$constructor(\"ZodMiniCUID\", (inst, def) => {\n core.$ZodCUID.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n/**\n * Validates a CUID v1 string.\n *\n * @deprecated CUID v1 is deprecated by its authors due to information leakage\n * (timestamps embedded in the id). Use {@link cuid2 | `z.cuid2()`} instead.\n * See https://github.com/paralleldrive/cuid.\n */\n// @__NO_SIDE_EFFECTS__\nexport function cuid(params) {\n return core._cuid(ZodMiniCUID, params);\n}\nexport const ZodMiniCUID2 = /*@__PURE__*/ core.$constructor(\"ZodMiniCUID2\", (inst, def) => {\n core.$ZodCUID2.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function cuid2(params) {\n return core._cuid2(ZodMiniCUID2, params);\n}\nexport const ZodMiniULID = /*@__PURE__*/ core.$constructor(\"ZodMiniULID\", (inst, def) => {\n core.$ZodULID.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function ulid(params) {\n return core._ulid(ZodMiniULID, params);\n}\nexport const ZodMiniXID = /*@__PURE__*/ core.$constructor(\"ZodMiniXID\", (inst, def) => {\n core.$ZodXID.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function xid(params) {\n return core._xid(ZodMiniXID, params);\n}\nexport const ZodMiniKSUID = /*@__PURE__*/ core.$constructor(\"ZodMiniKSUID\", (inst, def) => {\n core.$ZodKSUID.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function ksuid(params) {\n return core._ksuid(ZodMiniKSUID, params);\n}\nexport const ZodMiniIPv4 = /*@__PURE__*/ core.$constructor(\"ZodMiniIPv4\", (inst, def) => {\n core.$ZodIPv4.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function ipv4(params) {\n return core._ipv4(ZodMiniIPv4, params);\n}\nexport const ZodMiniIPv6 = /*@__PURE__*/ core.$constructor(\"ZodMiniIPv6\", (inst, def) => {\n core.$ZodIPv6.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function ipv6(params) {\n return core._ipv6(ZodMiniIPv6, params);\n}\nexport const ZodMiniCIDRv4 = /*@__PURE__*/ core.$constructor(\"ZodMiniCIDRv4\", (inst, def) => {\n core.$ZodCIDRv4.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function cidrv4(params) {\n return core._cidrv4(ZodMiniCIDRv4, params);\n}\nexport const ZodMiniCIDRv6 = /*@__PURE__*/ core.$constructor(\"ZodMiniCIDRv6\", (inst, def) => {\n core.$ZodCIDRv6.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function cidrv6(params) {\n return core._cidrv6(ZodMiniCIDRv6, params);\n}\nexport const ZodMiniMAC = /*@__PURE__*/ core.$constructor(\"ZodMiniMAC\", (inst, def) => {\n core.$ZodMAC.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function mac(params) {\n return core._mac(ZodMiniMAC, params);\n}\nexport const ZodMiniBase64 = /*@__PURE__*/ core.$constructor(\"ZodMiniBase64\", (inst, def) => {\n core.$ZodBase64.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function base64(params) {\n return core._base64(ZodMiniBase64, params);\n}\nexport const ZodMiniBase64URL = /*@__PURE__*/ core.$constructor(\"ZodMiniBase64URL\", (inst, def) => {\n core.$ZodBase64URL.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function base64url(params) {\n return core._base64url(ZodMiniBase64URL, params);\n}\nexport const ZodMiniE164 = /*@__PURE__*/ core.$constructor(\"ZodMiniE164\", (inst, def) => {\n core.$ZodE164.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function e164(params) {\n return core._e164(ZodMiniE164, params);\n}\nexport const ZodMiniJWT = /*@__PURE__*/ core.$constructor(\"ZodMiniJWT\", (inst, def) => {\n core.$ZodJWT.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function jwt(params) {\n return core._jwt(ZodMiniJWT, params);\n}\nexport const ZodMiniCustomStringFormat = /*@__PURE__*/ core.$constructor(\"ZodMiniCustomStringFormat\", (inst, def) => {\n core.$ZodCustomStringFormat.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function stringFormat(format, fnOrRegex, _params = {}) {\n return core._stringFormat(ZodMiniCustomStringFormat, format, fnOrRegex, _params);\n}\n// @__NO_SIDE_EFFECTS__\nexport function hostname(_params) {\n return core._stringFormat(ZodMiniCustomStringFormat, \"hostname\", core.regexes.hostname, _params);\n}\n// @__NO_SIDE_EFFECTS__\nexport function hex(_params) {\n return core._stringFormat(ZodMiniCustomStringFormat, \"hex\", core.regexes.hex, _params);\n}\n// @__NO_SIDE_EFFECTS__\nexport function hash(alg, params) {\n const enc = params?.enc ?? \"hex\";\n const format = `${alg}_${enc}`;\n const regex = core.regexes[format];\n // check for unrecognized format\n if (!regex)\n throw new Error(`Unrecognized hash format: ${format}`);\n return core._stringFormat(ZodMiniCustomStringFormat, format, regex, params);\n}\nexport const ZodMiniNumber = /*@__PURE__*/ core.$constructor(\"ZodMiniNumber\", (inst, def) => {\n core.$ZodNumber.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function number(params) {\n return core._number(ZodMiniNumber, params);\n}\nexport const ZodMiniNumberFormat = /*@__PURE__*/ core.$constructor(\"ZodMiniNumberFormat\", (inst, def) => {\n core.$ZodNumberFormat.init(inst, def);\n ZodMiniNumber.init(inst, def);\n});\n// int\n// @__NO_SIDE_EFFECTS__\nexport function int(params) {\n return core._int(ZodMiniNumberFormat, params);\n}\n// float32\n// @__NO_SIDE_EFFECTS__\nexport function float32(params) {\n return core._float32(ZodMiniNumberFormat, params);\n}\n// float64\n// @__NO_SIDE_EFFECTS__\nexport function float64(params) {\n return core._float64(ZodMiniNumberFormat, params);\n}\n// int32\n// @__NO_SIDE_EFFECTS__\nexport function int32(params) {\n return core._int32(ZodMiniNumberFormat, params);\n}\n// uint32\n// @__NO_SIDE_EFFECTS__\nexport function uint32(params) {\n return core._uint32(ZodMiniNumberFormat, params);\n}\nexport const ZodMiniBoolean = /*@__PURE__*/ core.$constructor(\"ZodMiniBoolean\", (inst, def) => {\n core.$ZodBoolean.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function boolean(params) {\n return core._boolean(ZodMiniBoolean, params);\n}\nexport const ZodMiniBigInt = /*@__PURE__*/ core.$constructor(\"ZodMiniBigInt\", (inst, def) => {\n core.$ZodBigInt.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function bigint(params) {\n return core._bigint(ZodMiniBigInt, params);\n}\nexport const ZodMiniBigIntFormat = /*@__PURE__*/ core.$constructor(\"ZodMiniBigIntFormat\", (inst, def) => {\n core.$ZodBigIntFormat.init(inst, def);\n ZodMiniBigInt.init(inst, def);\n});\n// int64\n// @__NO_SIDE_EFFECTS__\nexport function int64(params) {\n return core._int64(ZodMiniBigIntFormat, params);\n}\n// uint64\n// @__NO_SIDE_EFFECTS__\nexport function uint64(params) {\n return core._uint64(ZodMiniBigIntFormat, params);\n}\nexport const ZodMiniSymbol = /*@__PURE__*/ core.$constructor(\"ZodMiniSymbol\", (inst, def) => {\n core.$ZodSymbol.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function symbol(params) {\n return core._symbol(ZodMiniSymbol, params);\n}\nexport const ZodMiniUndefined = /*@__PURE__*/ core.$constructor(\"ZodMiniUndefined\", (inst, def) => {\n core.$ZodUndefined.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nfunction _undefined(params) {\n return core._undefined(ZodMiniUndefined, params);\n}\nexport { _undefined as undefined };\nexport const ZodMiniNull = /*@__PURE__*/ core.$constructor(\"ZodMiniNull\", (inst, def) => {\n core.$ZodNull.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nfunction _null(params) {\n return core._null(ZodMiniNull, params);\n}\nexport { _null as null };\nexport const ZodMiniAny = /*@__PURE__*/ core.$constructor(\"ZodMiniAny\", (inst, def) => {\n core.$ZodAny.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function any() {\n return core._any(ZodMiniAny);\n}\nexport const ZodMiniUnknown = /*@__PURE__*/ core.$constructor(\"ZodMiniUnknown\", (inst, def) => {\n core.$ZodUnknown.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function unknown() {\n return core._unknown(ZodMiniUnknown);\n}\nexport const ZodMiniNever = /*@__PURE__*/ core.$constructor(\"ZodMiniNever\", (inst, def) => {\n core.$ZodNever.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function never(params) {\n return core._never(ZodMiniNever, params);\n}\nexport const ZodMiniVoid = /*@__PURE__*/ core.$constructor(\"ZodMiniVoid\", (inst, def) => {\n core.$ZodVoid.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nfunction _void(params) {\n return core._void(ZodMiniVoid, params);\n}\nexport { _void as void };\nexport const ZodMiniDate = /*@__PURE__*/ core.$constructor(\"ZodMiniDate\", (inst, def) => {\n core.$ZodDate.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function date(params) {\n return core._date(ZodMiniDate, params);\n}\nexport const ZodMiniArray = /*@__PURE__*/ core.$constructor(\"ZodMiniArray\", (inst, def) => {\n core.$ZodArray.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function array(element, params) {\n return new ZodMiniArray({\n type: \"array\",\n element: element,\n ...util.normalizeParams(params),\n });\n}\n// .keyof\n// @__NO_SIDE_EFFECTS__\nexport function keyof(schema) {\n const shape = schema._zod.def.shape;\n return _enum(Object.keys(shape));\n}\nexport const ZodMiniObject = /*@__PURE__*/ core.$constructor(\"ZodMiniObject\", (inst, def) => {\n core.$ZodObject.init(inst, def);\n ZodMiniType.init(inst, def);\n util.defineLazy(inst, \"shape\", () => def.shape);\n});\n// @__NO_SIDE_EFFECTS__\nexport function object(shape, params) {\n const def = {\n type: \"object\",\n shape: shape ?? {},\n ...util.normalizeParams(params),\n };\n return new ZodMiniObject(def);\n}\n// strictObject\n// @__NO_SIDE_EFFECTS__\nexport function strictObject(shape, params) {\n return new ZodMiniObject({\n type: \"object\",\n shape,\n catchall: never(),\n ...util.normalizeParams(params),\n });\n}\n// looseObject\n// @__NO_SIDE_EFFECTS__\nexport function looseObject(shape, params) {\n return new ZodMiniObject({\n type: \"object\",\n shape,\n catchall: unknown(),\n ...util.normalizeParams(params),\n });\n}\n// object methods\n// @__NO_SIDE_EFFECTS__\nexport function extend(schema, shape) {\n return util.extend(schema, shape);\n}\n// @__NO_SIDE_EFFECTS__\nexport function safeExtend(schema, shape) {\n return util.safeExtend(schema, shape);\n}\n// @__NO_SIDE_EFFECTS__\nexport function merge(schema, shape) {\n return util.extend(schema, shape);\n}\n// @__NO_SIDE_EFFECTS__\nexport function pick(schema, mask) {\n return util.pick(schema, mask);\n}\n// .omit\n// @__NO_SIDE_EFFECTS__\nexport function omit(schema, mask) {\n return util.omit(schema, mask);\n}\n// @__NO_SIDE_EFFECTS__\nexport function partial(schema, mask) {\n return util.partial(ZodMiniOptional, schema, mask);\n}\n// @__NO_SIDE_EFFECTS__\nexport function required(schema, mask) {\n return util.required(ZodMiniNonOptional, schema, mask);\n}\n// @__NO_SIDE_EFFECTS__\nexport function catchall(inst, catchall) {\n return inst.clone({ ...inst._zod.def, catchall: catchall });\n}\nexport const ZodMiniUnion = /*@__PURE__*/ core.$constructor(\"ZodMiniUnion\", (inst, def) => {\n core.$ZodUnion.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function union(options, params) {\n return new ZodMiniUnion({\n type: \"union\",\n options: options,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniXor = /*@__PURE__*/ core.$constructor(\"ZodMiniXor\", (inst, def) => {\n ZodMiniUnion.init(inst, def);\n core.$ZodXor.init(inst, def);\n});\n/** Creates an exclusive union (XOR) where exactly one option must match.\n * Unlike regular unions that succeed when any option matches, xor fails if\n * zero or more than one option matches the input. */\nexport function xor(options, params) {\n return new ZodMiniXor({\n type: \"union\",\n options: options,\n inclusive: false,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniDiscriminatedUnion = /*@__PURE__*/ core.$constructor(\"ZodMiniDiscriminatedUnion\", (inst, def) => {\n core.$ZodDiscriminatedUnion.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function discriminatedUnion(discriminator, options, params) {\n return new ZodMiniDiscriminatedUnion({\n type: \"union\",\n options,\n discriminator,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniIntersection = /*@__PURE__*/ core.$constructor(\"ZodMiniIntersection\", (inst, def) => {\n core.$ZodIntersection.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function intersection(left, right) {\n return new ZodMiniIntersection({\n type: \"intersection\",\n left: left,\n right: right,\n });\n}\nexport const ZodMiniTuple = /*@__PURE__*/ core.$constructor(\"ZodMiniTuple\", (inst, def) => {\n core.$ZodTuple.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function tuple(items, _paramsOrRest, _params) {\n const hasRest = _paramsOrRest instanceof core.$ZodType;\n const params = hasRest ? _params : _paramsOrRest;\n const rest = hasRest ? _paramsOrRest : null;\n return new ZodMiniTuple({\n type: \"tuple\",\n items: items,\n rest,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniRecord = /*@__PURE__*/ core.$constructor(\"ZodMiniRecord\", (inst, def) => {\n core.$ZodRecord.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function record(keyType, valueType, params) {\n // v3-compat: z.record(valueType, params?) — defaults keyType to z.string()\n if (!valueType || !valueType._zod) {\n return new ZodMiniRecord({\n type: \"record\",\n keyType: string(),\n valueType: keyType,\n ...util.normalizeParams(valueType),\n });\n }\n return new ZodMiniRecord({\n type: \"record\",\n keyType,\n valueType: valueType,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function partialRecord(keyType, valueType, params) {\n const k = core.clone(keyType);\n k._zod.values = undefined;\n return new ZodMiniRecord({\n type: \"record\",\n keyType: k,\n valueType: valueType,\n ...util.normalizeParams(params),\n });\n}\nexport function looseRecord(keyType, valueType, params) {\n return new ZodMiniRecord({\n type: \"record\",\n keyType,\n valueType: valueType,\n mode: \"loose\",\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniMap = /*@__PURE__*/ core.$constructor(\"ZodMiniMap\", (inst, def) => {\n core.$ZodMap.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function map(keyType, valueType, params) {\n return new ZodMiniMap({\n type: \"map\",\n keyType: keyType,\n valueType: valueType,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniSet = /*@__PURE__*/ core.$constructor(\"ZodMiniSet\", (inst, def) => {\n core.$ZodSet.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function set(valueType, params) {\n return new ZodMiniSet({\n type: \"set\",\n valueType: valueType,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniEnum = /*@__PURE__*/ core.$constructor(\"ZodMiniEnum\", (inst, def) => {\n core.$ZodEnum.init(inst, def);\n ZodMiniType.init(inst, def);\n inst.options = Object.values(def.entries);\n});\n// @__NO_SIDE_EFFECTS__\nfunction _enum(values, params) {\n const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;\n return new ZodMiniEnum({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\nexport { _enum as enum };\n// @__NO_SIDE_EFFECTS__\n/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.\n *\n * ```ts\n * enum Colors { red, green, blue }\n * z.enum(Colors);\n * ```\n */\nexport function nativeEnum(entries, params) {\n return new ZodMiniEnum({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniLiteral = /*@__PURE__*/ core.$constructor(\"ZodMiniLiteral\", (inst, def) => {\n core.$ZodLiteral.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function literal(value, params) {\n return new ZodMiniLiteral({\n type: \"literal\",\n values: Array.isArray(value) ? value : [value],\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniFile = /*@__PURE__*/ core.$constructor(\"ZodMiniFile\", (inst, def) => {\n core.$ZodFile.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function file(params) {\n return core._file(ZodMiniFile, params);\n}\nexport const ZodMiniTransform = /*@__PURE__*/ core.$constructor(\"ZodMiniTransform\", (inst, def) => {\n core.$ZodTransform.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function transform(fn) {\n return new ZodMiniTransform({\n type: \"transform\",\n transform: fn,\n });\n}\nexport const ZodMiniOptional = /*@__PURE__*/ core.$constructor(\"ZodMiniOptional\", (inst, def) => {\n core.$ZodOptional.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function optional(innerType) {\n return new ZodMiniOptional({\n type: \"optional\",\n innerType: innerType,\n });\n}\nexport const ZodMiniExactOptional = /*@__PURE__*/ core.$constructor(\"ZodMiniExactOptional\", (inst, def) => {\n core.$ZodExactOptional.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function exactOptional(innerType) {\n return new ZodMiniExactOptional({\n type: \"optional\",\n innerType: innerType,\n });\n}\nexport const ZodMiniNullable = /*@__PURE__*/ core.$constructor(\"ZodMiniNullable\", (inst, def) => {\n core.$ZodNullable.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function nullable(innerType) {\n return new ZodMiniNullable({\n type: \"nullable\",\n innerType: innerType,\n });\n}\n// nullish\n// @__NO_SIDE_EFFECTS__\nexport function nullish(innerType) {\n return optional(nullable(innerType));\n}\nexport const ZodMiniDefault = /*@__PURE__*/ core.$constructor(\"ZodMiniDefault\", (inst, def) => {\n core.$ZodDefault.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function _default(innerType, defaultValue) {\n return new ZodMiniDefault({\n type: \"default\",\n innerType: innerType,\n get defaultValue() {\n return typeof defaultValue === \"function\" ? defaultValue() : util.shallowClone(defaultValue);\n },\n });\n}\nexport const ZodMiniPrefault = /*@__PURE__*/ core.$constructor(\"ZodMiniPrefault\", (inst, def) => {\n core.$ZodPrefault.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function prefault(innerType, defaultValue) {\n return new ZodMiniPrefault({\n type: \"prefault\",\n innerType: innerType,\n get defaultValue() {\n return typeof defaultValue === \"function\" ? defaultValue() : util.shallowClone(defaultValue);\n },\n });\n}\nexport const ZodMiniNonOptional = /*@__PURE__*/ core.$constructor(\"ZodMiniNonOptional\", (inst, def) => {\n core.$ZodNonOptional.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function nonoptional(innerType, params) {\n return new ZodMiniNonOptional({\n type: \"nonoptional\",\n innerType: innerType,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniSuccess = /*@__PURE__*/ core.$constructor(\"ZodMiniSuccess\", (inst, def) => {\n core.$ZodSuccess.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function success(innerType) {\n return new ZodMiniSuccess({\n type: \"success\",\n innerType: innerType,\n });\n}\nexport const ZodMiniCatch = /*@__PURE__*/ core.$constructor(\"ZodMiniCatch\", (inst, def) => {\n core.$ZodCatch.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nfunction _catch(innerType, catchValue) {\n return new ZodMiniCatch({\n type: \"catch\",\n innerType: innerType,\n catchValue: (typeof catchValue === \"function\" ? catchValue : () => catchValue),\n });\n}\nexport { _catch as catch };\nexport const ZodMiniNaN = /*@__PURE__*/ core.$constructor(\"ZodMiniNaN\", (inst, def) => {\n core.$ZodNaN.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function nan(params) {\n return core._nan(ZodMiniNaN, params);\n}\nexport const ZodMiniPipe = /*@__PURE__*/ core.$constructor(\"ZodMiniPipe\", (inst, def) => {\n core.$ZodPipe.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function pipe(in_, out) {\n return new ZodMiniPipe({\n type: \"pipe\",\n in: in_,\n out: out,\n });\n}\nexport const ZodMiniCodec = /*@__PURE__*/ core.$constructor(\"ZodMiniCodec\", (inst, def) => {\n ZodMiniPipe.init(inst, def);\n core.$ZodCodec.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function codec(in_, out, params) {\n return new ZodMiniCodec({\n type: \"pipe\",\n in: in_,\n out: out,\n transform: params.decode,\n reverseTransform: params.encode,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function invertCodec(codec) {\n const def = codec._zod.def;\n return new ZodMiniCodec({\n type: \"pipe\",\n in: def.out,\n out: def.in,\n transform: def.reverseTransform,\n reverseTransform: def.transform,\n });\n}\nexport const ZodMiniReadonly = /*@__PURE__*/ core.$constructor(\"ZodMiniReadonly\", (inst, def) => {\n core.$ZodReadonly.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function readonly(innerType) {\n return new ZodMiniReadonly({\n type: \"readonly\",\n innerType: innerType,\n });\n}\nexport const ZodMiniTemplateLiteral = /*@__PURE__*/ core.$constructor(\"ZodMiniTemplateLiteral\", (inst, def) => {\n core.$ZodTemplateLiteral.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function templateLiteral(parts, params) {\n return new ZodMiniTemplateLiteral({\n type: \"template_literal\",\n parts,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniLazy = /*@__PURE__*/ core.$constructor(\"ZodMiniLazy\", (inst, def) => {\n core.$ZodLazy.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// export function lazy<T extends object>(getter: () => T): T {\n// return util.createTransparentProxy<T>(getter);\n// }\n// @__NO_SIDE_EFFECTS__\nfunction _lazy(getter) {\n return new ZodMiniLazy({\n type: \"lazy\",\n getter: getter,\n });\n}\nexport { _lazy as lazy };\nexport const ZodMiniPromise = /*@__PURE__*/ core.$constructor(\"ZodMiniPromise\", (inst, def) => {\n core.$ZodPromise.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function promise(innerType) {\n return new ZodMiniPromise({\n type: \"promise\",\n innerType: innerType,\n });\n}\nexport const ZodMiniCustom = /*@__PURE__*/ core.$constructor(\"ZodMiniCustom\", (inst, def) => {\n core.$ZodCustom.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// custom checks\n// @__NO_SIDE_EFFECTS__\nexport function check(fn, params) {\n const ch = new core.$ZodCheck({\n check: \"custom\",\n ...util.normalizeParams(params),\n });\n ch._zod.check = fn;\n return ch;\n}\n// ZodCustom\n// custom schema\n// @__NO_SIDE_EFFECTS__\nexport function custom(fn, _params) {\n return core._custom(ZodMiniCustom, fn ?? (() => true), _params);\n}\n// refine\n// @__NO_SIDE_EFFECTS__\nexport function refine(fn, _params = {}) {\n return core._refine(ZodMiniCustom, fn, _params);\n}\n// superRefine\n// @__NO_SIDE_EFFECTS__\nexport function superRefine(fn, params) {\n return core._superRefine(fn, params);\n}\n// Re-export describe and meta from core\nexport const describe = core.describe;\nexport const meta = core.meta;\n// instanceof\nclass Class {\n constructor(..._args) { }\n}\n// @__NO_SIDE_EFFECTS__\nfunction _instanceof(cls, params = {}) {\n const inst = custom((data) => data instanceof cls, params);\n inst._zod.bag.Class = cls;\n // Override check to emit invalid_type instead of custom\n inst._zod.check = (payload) => {\n if (!(payload.value instanceof cls)) {\n payload.issues.push({\n code: \"invalid_type\",\n expected: cls.name,\n input: payload.value,\n inst,\n path: [...(inst._zod.def.path ?? [])],\n });\n }\n };\n return inst;\n}\nexport { _instanceof as instanceof };\n// stringbool\nexport const stringbool = (...args) => core._stringbool({\n Codec: ZodMiniCodec,\n Boolean: ZodMiniBoolean,\n String: ZodMiniString,\n}, ...args);\n// @__NO_SIDE_EFFECTS__\nexport function json() {\n const jsonSchema = _lazy(() => {\n return union([string(), number(), boolean(), _null(), array(jsonSchema), record(string(), jsonSchema)]);\n });\n return jsonSchema;\n}\nexport const ZodMiniFunction = /*@__PURE__*/ core.$constructor(\"ZodMiniFunction\", (inst, def) => {\n core.$ZodFunction.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function _function(params) {\n return new ZodMiniFunction({\n type: \"function\",\n input: Array.isArray(params?.input) ? tuple(params?.input) : (params?.input ?? array(unknown())),\n output: params?.output ?? unknown(),\n });\n}\nexport { _function as function };\n",
15
15
  "import * as z from \"zod/mini\";\n/** Persisted identity cannot be claimed by a client-supplied definition. */\nexport const INLINE_FLOW_PERSISTED_IDENTITY_FIELDS = [\n \"id\",\n \"organizationId\",\n \"versionId\",\n \"versionNumber\",\n];\n/** @internal */\nexport const inlineFlowThemeSchema = z.strictObject({\n css: z.optional(z.string()),\n themeRuntimeArtifactId: z.optional(z.string().check(z.trim(), z.minLength(1))),\n themeVersionId: z.optional(z.string().check(z.trim(), z.minLength(1))),\n});\n/** @internal */\nexport const inlineFlowSchema = z.strictObject({\n definition: z.unknown().check(z.check((ctx) => {\n if (ctx.value !== undefined) {\n return;\n }\n ctx.issues.push({\n code: \"custom\",\n input: ctx.value,\n message: \"Inline flow definition is required.\",\n continue: false,\n });\n })),\n theme: z.optional(inlineFlowThemeSchema),\n});\n",
16
- "import type { InlineFlow } from \"@getuserfeedback/protocol/internal/inline-flow\";\nimport type { InlineFlowRun } from \"./inline-flow\";\n\n/** @internal Versioned package bridge shared by the SDK root and internal entry. */\nexport type InlineFlowClientBridge = {\n\tcreateInlineFlowRun: (flow: InlineFlow) => InlineFlowRun;\n};\n\n// This bridge is package compatibility, not caller authorization. Same-window\n// host code already owns the realm in which the SDK and Loader execute.\nconst INLINE_FLOW_CLIENT_BRIDGE_SYMBOL = Symbol.for(\n\t\"@getuserfeedback/sdk/internal/inline-flow-client-bridge/1\",\n);\n\nexport const attachInlineFlowClientBridge = (\n\tclient: object,\n\tbridge: InlineFlowClientBridge,\n): void => {\n\tObject.defineProperty(client, INLINE_FLOW_CLIENT_BRIDGE_SYMBOL, {\n\t\tconfigurable: false,\n\t\tenumerable: false,\n\t\tvalue: bridge,\n\t\twritable: false,\n\t});\n};\n\nexport const getInlineFlowClientBridge = (\n\tclient: object,\n): InlineFlowClientBridge => {\n\tconst bridge = Reflect.get(client, INLINE_FLOW_CLIENT_BRIDGE_SYMBOL);\n\tif (\n\t\ttypeof bridge !== \"object\" ||\n\t\tbridge === null ||\n\t\t!(\"createInlineFlowRun\" in bridge) ||\n\t\ttypeof Reflect.get(bridge, \"createInlineFlowRun\") !== \"function\"\n\t) {\n\t\tthrow new Error(\n\t\t\t\"Inline flows require a compatible client created by @getuserfeedback/sdk.\",\n\t\t);\n\t}\n\treturn bridge as InlineFlowClientBridge;\n};\n",
16
+ "import type { InlineFlow } from \"@getuserfeedback/protocol/internal/inline-flow\";\nimport type { Client } from \"../client\";\nimport type { InlineFlowRun } from \"./inline-flow\";\n\n/** @internal Versioned package bridge shared by the SDK root and internal entry. */\nexport type InlineFlowClientBridge = {\n\tcreateInlineFlowRun: (flow: InlineFlow) => InlineFlowRun;\n};\n\n// This bridge is package compatibility, not caller authorization. Same-window\n// host code already owns the realm in which the SDK and Loader execute.\nconst INLINE_FLOW_CLIENT_BRIDGE_SYMBOL = Symbol.for(\n\t\"@getuserfeedback/sdk/internal/inline-flow-client-bridge/1\",\n);\n\nconst isInlineFlowClientBridge = (\n\tvalue: unknown,\n): value is InlineFlowClientBridge =>\n\ttypeof value === \"object\" &&\n\tvalue !== null &&\n\t\"createInlineFlowRun\" in value &&\n\ttypeof value.createInlineFlowRun === \"function\";\n\nexport const attachInlineFlowClientBridge = (\n\tclient: Client,\n\tbridge: InlineFlowClientBridge,\n): void => {\n\tObject.defineProperty(client, INLINE_FLOW_CLIENT_BRIDGE_SYMBOL, {\n\t\tconfigurable: false,\n\t\tenumerable: false,\n\t\tvalue: bridge,\n\t\twritable: false,\n\t});\n};\n\nexport const getInlineFlowClientBridge = (\n\tclient: Client,\n): InlineFlowClientBridge => {\n\tconst bridge =\n\t\tINLINE_FLOW_CLIENT_BRIDGE_SYMBOL in client\n\t\t\t? client[INLINE_FLOW_CLIENT_BRIDGE_SYMBOL]\n\t\t\t: undefined;\n\tif (!isInlineFlowClientBridge(bridge)) {\n\t\tthrow new Error(\n\t\t\t\"Inline flows require a compatible client created by @getuserfeedback/sdk.\",\n\t\t);\n\t}\n\treturn bridge;\n};\n",
17
17
  "type TransportAdmissionResult<TResult> =\n\t| { status: \"superseded\" }\n\t| { status: \"settled\"; result: TResult };\n\ntype TransportHandoff<TResult> = {\n\tsettlement: Promise<TResult>;\n};\n\ntype TransportOperationScope = {\n\tattemptHandoff<TResult>(options: {\n\t\tprepare: () => void | Promise<void>;\n\t\thandOff: () => TransportHandoff<TResult>;\n\t}): Promise<TResult>;\n};\n\ntype BarrierGate = {\n\tstate: \"pending\" | \"resolved\" | \"rejected\";\n\tfallback: BarrierGate | null;\n\tpromise: Promise<void>;\n\tresolve: () => void;\n\treject: (error: unknown) => void;\n};\n\ntype OrderGate = {\n\tstate: \"pending\" | \"resolved\";\n\tpromise: Promise<void>;\n\tresolve: () => void;\n};\n\ntype OperationState =\n\t| \"registered\"\n\t| \"preparing\"\n\t| \"handing-off\"\n\t| \"handed-off\"\n\t| \"settlement-failed\"\n\t| \"handoff-failed\"\n\t| \"attempt-settled\"\n\t| \"settled\";\n\ntype PendingOperation = {\n\tgeneration: number;\n\tbarrierGate: BarrierGate;\n\tstate: OperationState;\n\tactiveAttempt: boolean;\n\tattemptCount: number;\n\teverHandedOff: boolean;\n\thasLastSettlementError: boolean;\n\tlastSettlementError?: unknown;\n\tsuperseded: boolean;\n\touterSettled: boolean;\n\tsettleAfterBarrier: () => void;\n};\n\nconst OPERATION_SUPERSEDED = Symbol(\"operation-superseded\");\n\nconst createBarrierGate = (fallback: BarrierGate): BarrierGate => {\n\tlet resolvePromise: (() => void) | undefined;\n\tlet rejectPromise: ((error: unknown) => void) | undefined;\n\tconst promise = new Promise<void>((resolve, reject) => {\n\t\tresolvePromise = resolve;\n\t\trejectPromise = reject;\n\t});\n\tlet settled = false;\n\tconst gate: BarrierGate = {\n\t\tstate: \"pending\",\n\t\tfallback,\n\t\tpromise,\n\t\tresolve: () => {\n\t\t\tif (settled) return;\n\t\t\tsettled = true;\n\t\t\tgate.state = \"resolved\";\n\t\t\tresolvePromise?.();\n\t\t},\n\t\treject: (error) => {\n\t\t\tif (settled) return;\n\t\t\tsettled = true;\n\t\t\tgate.state = \"rejected\";\n\t\t\trejectPromise?.(error);\n\t\t},\n\t};\n\treturn gate;\n};\n\nconst RESOLVED_BARRIER_GATE: BarrierGate = {\n\tstate: \"resolved\",\n\tfallback: null,\n\tpromise: Promise.resolve(),\n\tresolve: () => {},\n\treject: () => {},\n};\n\nconst createOrderGate = (resolved = false): OrderGate => {\n\tlet resolvePromise: (() => void) | undefined;\n\tconst promise = new Promise<void>((resolve) => {\n\t\tresolvePromise = resolve;\n\t});\n\tconst gate: OrderGate = {\n\t\tstate: resolved ? \"resolved\" : \"pending\",\n\t\tpromise: resolved ? Promise.resolve() : promise,\n\t\tresolve: () => {\n\t\t\tif (gate.state === \"resolved\") return;\n\t\t\tgate.state = \"resolved\";\n\t\t\tresolvePromise?.();\n\t\t},\n\t};\n\treturn gate;\n};\n\nconst isPromiseLike = (value: unknown): value is PromiseLike<void> =>\n\ttypeof value === \"object\" &&\n\tvalue !== null &&\n\t\"then\" in value &&\n\ttypeof value.then === \"function\";\n\n/**\n * Owns caller-generation admission before the SDK hands a command to its host.\n * Handle FIFO, stale classification, and settlement publication remain with the\n * Flow command controller.\n *\n * @see docs/specs/2026-08-02-flow-interaction-model.md\n */\nexport const createClientTransportAdmission = () => {\n\tlet generation = 0;\n\tlet latestBarrierGate = RESOLVED_BARRIER_GATE;\n\tlet barrierOrderTail = createOrderGate(true);\n\tconst pendingOperations = new Set<PendingOperation>();\n\n\tconst runOperation = <TResult>(\n\t\texecute: (scope: TransportOperationScope) => Promise<TResult>,\n\t): Promise<TransportAdmissionResult<TResult>> => {\n\t\tlet resolveBarrierOutcome:\n\t\t\t| ((result: TransportAdmissionResult<TResult>) => void)\n\t\t\t| undefined;\n\t\tlet rejectBarrierOutcome: ((error: unknown) => void) | undefined;\n\t\tconst barrierOutcome = new Promise<TransportAdmissionResult<TResult>>(\n\t\t\t(resolve, reject) => {\n\t\t\t\tresolveBarrierOutcome = resolve;\n\t\t\t\trejectBarrierOutcome = reject;\n\t\t\t},\n\t\t);\n\t\tconst operation: PendingOperation = {\n\t\t\tgeneration,\n\t\t\tbarrierGate: latestBarrierGate,\n\t\t\tstate: \"registered\",\n\t\t\tactiveAttempt: false,\n\t\t\tattemptCount: 0,\n\t\t\teverHandedOff: false,\n\t\t\thasLastSettlementError: false,\n\t\t\tsuperseded: false,\n\t\t\touterSettled: false,\n\t\t\tsettleAfterBarrier: () => {\n\t\t\t\tif (operation.everHandedOff && operation.hasLastSettlementError) {\n\t\t\t\t\trejectBarrierOutcome?.(operation.lastSettlementError);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tresolveBarrierOutcome?.({ status: \"superseded\" });\n\t\t\t},\n\t\t};\n\t\tpendingOperations.add(operation);\n\n\t\tconst throwSuperseded = (): never => {\n\t\t\tif (operation.everHandedOff && operation.hasLastSettlementError) {\n\t\t\t\tthrow operation.lastSettlementError;\n\t\t\t}\n\t\t\tthrow OPERATION_SUPERSEDED;\n\t\t};\n\t\tconst assertCurrent = (): void => {\n\t\t\tif (operation.outerSettled) {\n\t\t\t\tthrow new Error(\"Transport operation has already settled\");\n\t\t\t}\n\t\t\tif (operation.superseded || operation.generation !== generation) {\n\t\t\t\tthrowSuperseded();\n\t\t\t}\n\t\t};\n\n\t\tconst attemptHandoff: TransportOperationScope[\"attemptHandoff\"] = async <\n\t\t\tTHandoffResult,\n\t\t>({\n\t\t\tprepare,\n\t\t\thandOff,\n\t\t}: {\n\t\t\tprepare: () => void | Promise<void>;\n\t\t\thandOff: () => TransportHandoff<THandoffResult>;\n\t\t}): Promise<THandoffResult> => {\n\t\t\tassertCurrent();\n\t\t\tif (operation.activeAttempt) {\n\t\t\t\tthrow new Error(\"A transport handoff attempt is already active\");\n\t\t\t}\n\t\t\tif (\n\t\t\t\toperation.attemptCount > 0 &&\n\t\t\t\toperation.state !== \"settlement-failed\"\n\t\t\t) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"A transport handoff may retry only after a failed settlement\",\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (operation.attemptCount >= 2) {\n\t\t\t\tthrow new Error(\"A transport operation may retry at most once\");\n\t\t\t}\n\n\t\t\toperation.activeAttempt = true;\n\t\t\toperation.attemptCount += 1;\n\t\t\toperation.state = \"preparing\";\n\t\t\ttry {\n\t\t\t\tif (operation.barrierGate.state !== \"resolved\") {\n\t\t\t\t\tawait operation.barrierGate.promise;\n\t\t\t\t}\n\t\t\t\tassertCurrent();\n\t\t\t\tconst preparation = prepare();\n\t\t\t\tif (isPromiseLike(preparation)) {\n\t\t\t\t\tawait preparation;\n\t\t\t\t}\n\t\t\t\tassertCurrent();\n\t\t\t\toperation.state = \"handing-off\";\n\t\t\t\tlet settlement: Promise<THandoffResult>;\n\t\t\t\ttry {\n\t\t\t\t\tsettlement = handOff().settlement;\n\t\t\t\t} catch (error) {\n\t\t\t\t\toperation.activeAttempt = false;\n\t\t\t\t\toperation.state = \"handoff-failed\";\n\t\t\t\t\tif (operation.superseded || operation.generation !== generation) {\n\t\t\t\t\t\toperation.settleAfterBarrier();\n\t\t\t\t\t}\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\n\t\t\t\toperation.everHandedOff = true;\n\t\t\t\toperation.state = \"handed-off\";\n\t\t\t\ttry {\n\t\t\t\t\tconst result = await settlement;\n\t\t\t\t\toperation.activeAttempt = false;\n\t\t\t\t\toperation.hasLastSettlementError = false;\n\t\t\t\t\toperation.lastSettlementError = undefined;\n\t\t\t\t\toperation.state = \"attempt-settled\";\n\t\t\t\t\treturn result;\n\t\t\t\t} catch (error) {\n\t\t\t\t\toperation.activeAttempt = false;\n\t\t\t\t\toperation.hasLastSettlementError = true;\n\t\t\t\t\toperation.lastSettlementError = error;\n\t\t\t\t\toperation.state = \"settlement-failed\";\n\t\t\t\t\tif (operation.superseded || operation.generation !== generation) {\n\t\t\t\t\t\toperation.settleAfterBarrier();\n\t\t\t\t\t}\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tif (operation.activeAttempt) {\n\t\t\t\t\toperation.activeAttempt = false;\n\t\t\t\t\toperation.state = \"handoff-failed\";\n\t\t\t\t}\n\t\t\t\tif (operation.superseded || operation.generation !== generation) {\n\t\t\t\t\toperation.settleAfterBarrier();\n\t\t\t\t\tthrowSuperseded();\n\t\t\t\t}\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t};\n\n\t\tlet internalRun: Promise<TResult>;\n\t\ttry {\n\t\t\tinternalRun = Promise.resolve(execute({ attemptHandoff }));\n\t\t} catch (error) {\n\t\t\tinternalRun = Promise.reject(error);\n\t\t}\n\t\tconst observedRun: Promise<TransportAdmissionResult<TResult>> =\n\t\t\tinternalRun.then(\n\t\t\t\t(result) => {\n\t\t\t\t\toperation.outerSettled = true;\n\t\t\t\t\toperation.state = \"settled\";\n\t\t\t\t\tpendingOperations.delete(operation);\n\t\t\t\t\treturn { status: \"settled\" as const, result };\n\t\t\t\t},\n\t\t\t\t(error) => {\n\t\t\t\t\toperation.outerSettled = true;\n\t\t\t\t\toperation.state = \"settled\";\n\t\t\t\t\tpendingOperations.delete(operation);\n\t\t\t\t\tif (error === OPERATION_SUPERSEDED && !operation.everHandedOff) {\n\t\t\t\t\t\treturn { status: \"superseded\" as const };\n\t\t\t\t\t}\n\t\t\t\t\tthrow error;\n\t\t\t\t},\n\t\t\t);\n\n\t\treturn Promise.race([observedRun, barrierOutcome]);\n\t};\n\n\tconst runBarrier = <TResult>({\n\t\tonGenerationAdvanced,\n\t\tprepare,\n\t\thandOff,\n\t}: {\n\t\tonGenerationAdvanced: () => void;\n\t\tprepare: () => void | Promise<void>;\n\t\thandOff: () => TransportHandoff<TResult>;\n\t}): Promise<TResult> => {\n\t\tgeneration += 1;\n\t\tconst previousOrderTail = barrierOrderTail;\n\t\tconst previousAdmissionGate = latestBarrierGate;\n\t\tconst currentOrderTail = createOrderGate();\n\t\tbarrierOrderTail = currentOrderTail;\n\t\tconst currentGate = createBarrierGate(previousAdmissionGate);\n\t\tlatestBarrierGate = currentGate;\n\t\tvoid currentGate.promise.catch(() => {});\n\n\t\tfor (const operation of pendingOperations) {\n\t\t\tif (operation.generation >= generation) continue;\n\t\t\toperation.superseded = true;\n\t\t\tif (\n\t\t\t\toperation.state !== \"handing-off\" &&\n\t\t\t\toperation.state !== \"handed-off\" &&\n\t\t\t\toperation.state !== \"attempt-settled\"\n\t\t\t) {\n\t\t\t\toperation.settleAfterBarrier();\n\t\t\t}\n\t\t}\n\n\t\tconst rejectAdmissionGate = (error: unknown): void => {\n\t\t\tcurrentGate.reject(error);\n\t\t\tif (latestBarrierGate === currentGate) {\n\t\t\t\tlet fallback = previousAdmissionGate;\n\t\t\t\twhile (fallback.state === \"rejected\" && fallback.fallback) {\n\t\t\t\t\tfallback = fallback.fallback;\n\t\t\t\t}\n\t\t\t\tlatestBarrierGate = fallback;\n\t\t\t}\n\t\t};\n\n\t\ttry {\n\t\t\tonGenerationAdvanced();\n\t\t} catch (error) {\n\t\t\trejectAdmissionGate(error);\n\t\t\tif (previousOrderTail.state === \"resolved\") {\n\t\t\t\tcurrentOrderTail.resolve();\n\t\t\t} else {\n\t\t\t\tvoid previousOrderTail.promise.then(currentOrderTail.resolve);\n\t\t\t}\n\t\t\treturn Promise.reject(error);\n\t\t}\n\n\t\tconst performHandoff = (): Promise<TResult> => {\n\t\t\tlet settlement: Promise<TResult>;\n\t\t\ttry {\n\t\t\t\tsettlement = handOff().settlement;\n\t\t\t} catch (error) {\n\t\t\t\trejectAdmissionGate(error);\n\t\t\t\tcurrentOrderTail.resolve();\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t\tcurrentGate.fallback = null;\n\t\t\tcurrentGate.resolve();\n\t\t\tcurrentOrderTail.resolve();\n\t\t\treturn settlement;\n\t\t};\n\t\tconst prepareAndHandOff = (): Promise<TResult> => {\n\t\t\ttry {\n\t\t\t\tconst preparation = prepare();\n\t\t\t\tif (isPromiseLike(preparation)) {\n\t\t\t\t\treturn Promise.resolve(preparation).then(performHandoff, (error) => {\n\t\t\t\t\t\trejectAdmissionGate(error);\n\t\t\t\t\t\tcurrentOrderTail.resolve();\n\t\t\t\t\t\tthrow error;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn performHandoff();\n\t\t\t} catch (error) {\n\t\t\t\trejectAdmissionGate(error);\n\t\t\t\tcurrentOrderTail.resolve();\n\t\t\t\treturn Promise.reject(error);\n\t\t\t}\n\t\t};\n\n\t\treturn previousOrderTail.state === \"resolved\"\n\t\t\t? prepareAndHandOff()\n\t\t\t: previousOrderTail.promise.then(prepareAndHandOff);\n\t};\n\n\treturn { runOperation, runBarrier };\n};\n",
18
18
  "declare const __GX_SDK_VERSION__: string | undefined;\n\nconst sdkVersion =\n\ttypeof __GX_SDK_VERSION__ === \"string\" ? __GX_SDK_VERSION__.trim() : \"\";\n\n// Build scripts inject __GX_SDK_VERSION__ for published artifacts.\n// Source-linked workspace usage may not inject defines, so keep a safe fallback.\nexport const SDK_VERSION = sdkVersion.length > 0 ? sdkVersion : \"0.0.0-local\";\n",
19
- "import type {\n\tCaptureInstanceFeedbackRequest,\n\tCaptureInstanceFeedbackResponse,\n\tListInstanceFeedbackMineRequest,\n\tListInstanceFeedbackMineResponse,\n} from \"@getuserfeedback/protocol\";\nimport {\n\ttype AppEventCapability,\n\ttype AppEventFlag,\n\tassertNoSegmentExternalIdsInValueArgument,\n\ttype CapabilitiesInput,\n\ttype ClientMeta,\n\ttype ClientOptions,\n\ttype Command,\n\ttype CommandEnvelope,\n\tCommandSettlementError,\n\tCommandSettlementTimeoutError,\n\ttype ConfigureOptions,\n\ttype ContainerPolicy,\n\tcreateCommandEnvelope,\n\tcreateCommandRequestId,\n\tcreateCommandSettlementDispatch,\n\tcreateFlowCommandHandleController,\n\ttype FlagsInput,\n\tgetFeedbackReadFromSettlementDetail,\n\tgetFeedbackSubmissionFromSettlementDetail,\n\tgetFlowHandleFromSettlementDetail,\n\ttype FlowRenderState as HostFlowRenderState,\n\ttype IdentifyOptions,\n\ttype InitOptions,\n\ttype LinkRouter,\n\tLOADER_RUNTIME_GLOBAL_KEY,\n\tLOADER_RUNTIME_PROTOCOL_VERSION,\n\tOPEN_URL_ACTION_CAPABILITY,\n\tOPEN_URL_ACTION_V1_CAPABILITY,\n\tOPEN_URL_ACTION_VERSION,\n\ttype ResponseMetadataInput,\n\tSDK_PROTOCOL_CAPABILITIES,\n\ttype WidgetLayoutTransitionPolicy,\n\twaitForCommandSettlement,\n} from \"@getuserfeedback/protocol/host\";\nimport { UNIFIED_FLOW_RUNTIME_V1_CAPABILITY } from \"@getuserfeedback/protocol/internal/core-host-command-settlement\";\nimport { suppliedOnlyLocalInitOptionsSchema } from \"@getuserfeedback/protocol/internal/core-init-options\";\nimport type { InternalHostCommandEnvelope } from \"@getuserfeedback/protocol/internal/host-command-envelope\";\nimport type {\n\tInternalHostInlineFlowCommandPayload,\n\tInternalHostSuppliedOnlyLocalInitCommandPayload,\n} from \"@getuserfeedback/protocol/internal/host-command-payload\";\nimport type { InlineFlow } from \"@getuserfeedback/protocol/internal/inline-flow\";\nimport { parseCustomerOccurrenceName } from \"@getuserfeedback/protocol/internal/sdk-event-options\";\nimport { createClientTransportAdmission } from \"./internal/client-transport-admission\";\nimport {\n\tbuildCustomerOccurrenceCommand,\n\ttype EventOptions,\n\ttype EventProperties,\n} from \"./internal/customer-occurrence-command\";\nimport { createFlowOpenRequestController } from \"./internal/flow-open-request-controller\";\nimport type { InlineFlowRun } from \"./internal/inline-flow\";\nimport { attachInlineFlowClientBridge } from \"./internal/inline-flow-client-bridge\";\nimport { invokeLinkRouter, resolveLinkRouter } from \"./internal/link-router\";\nimport { SDK_VERSION } from \"./version\";\n\nexport type {\n\tEventOptions,\n\tEventProperties,\n} from \"./internal/customer-occurrence-command\";\nexport type { ClientOptions };\n\n/** Feedback captured as an evaluation of the current app or a specific target. */\nexport type FeedbackInput = CaptureInstanceFeedbackRequest;\n\n/** Receipt returned after feedback has been accepted. */\nexport type SubmitFeedbackResult = CaptureInstanceFeedbackResponse;\n\n/** Selectors used to read the current authenticated user's feedback. */\nexport type FetchFeedbackInput = ListInstanceFeedbackMineRequest;\n\n/** Feedback matching each requested selector, in selector order. */\nexport type FetchFeedbackResult = ListInstanceFeedbackMineResponse;\n\n/** Operations for submitting and reading feedback through the current SDK client. */\nexport type FeedbackOperations = {\n\t/**\n\t * Read feedback matching each selector for the JWT-authenticated user.\n\t * Requires `auth.jwt` configuration; `identify()` alone does not authorize readback.\n\t */\n\tfetch: (input: FetchFeedbackInput) => Promise<FetchFeedbackResult>;\n\tsubmit: (input: FeedbackInput) => Promise<SubmitFeedbackResult>;\n};\n\n/** One endpoint in a directed relationship observation. */\nexport type GraphRelationshipRef = {\n\tcollection: string;\n\tid: string;\n};\n\n/** A directed relationship observation recorded through the analytics pipeline. */\nexport type GraphRelationship = {\n\tfrom: GraphRelationshipRef;\n\tto: GraphRelationshipRef;\n};\n\n/** Operations for recording relationship observations as product events. */\nexport type GraphOperations = {\n\tconnect: (relationship: GraphRelationship) => Promise<void>;\n\tdisconnect: (relationship: GraphRelationship) => Promise<void>;\n};\n\nimport { type ActionRegistry, createActionRegistry } from \"./action-registry\";\nimport { createClientHostEventHub } from \"./client-host-event-hub\";\nimport { createOpenRequestBridge } from \"./open-request-bridge\";\nimport type { OpenRequestedEvent as OpenRequestDispatcherEvent } from \"./open-request-dispatcher\";\nimport { resolveStartupRuntimeUrls } from \"./runtime-url-defaults\";\n\n/** @internal */\ndeclare global {\n\tinterface Window {\n\t\t__getuserfeedback_queue?: Array<\n\t\t\tCommandEnvelope | InternalHostCommandEnvelope\n\t\t>;\n\t\t[LOADER_RUNTIME_GLOBAL_KEY]?: {\n\t\t\talive?: boolean;\n\t\t\tprotocolVersion?: string;\n\t\t\tfeatures?: readonly string[];\n\t\t};\n\t}\n}\n\ntype FlowHandleId = string;\n\ntype FlowRunTarget = { flowId: string } | { flow: InlineFlow };\n\n/** Durable state of a flow run (open/loading + dimensions when known). */\nexport interface FlowState extends HostFlowRenderState {\n\t/**\n\t * @deprecated Stop reading this field. SDK state snapshots and subscriptions\n\t * never populate it, and there is no replacement SDK state field.\n\t */\n\ttransitionPolicy?: WidgetLayoutTransitionPolicy;\n}\n\n/** Callback invoked when flow state changes. */\nexport type FlowStateCallback = (state: FlowState) => void;\ntype IdentifyTraits = Record<string, unknown>;\nexport type OpenRequestedEvent = OpenRequestDispatcherEvent;\nexport type OpenRequestedCallback = (event: OpenRequestedEvent) => void;\ntype StableJsonObject = { [key: string]: StableJsonValue };\ntype StableJsonValue =\n\t| string\n\t| number\n\t| boolean\n\t| null\n\t| StableJsonValue[]\n\t| StableJsonObject;\n\n/** Options for opening a flow run. */\nexport type OpenFlowOptions = {\n\t/** Host container used for this open request. Omit to use default floating mounting; pass null to wait for a custom container. */\n\tcontainer?: HTMLElement | null;\n\t/**\n\t * Optional response metadata to preserve with the eventual submission.\n\t * These tags are attached when the flow is opened and do not affect prerendering.\n\t */\n\tmetadata?: ResponseMetadataInput;\n\t/**\n\t * When `true`, the flow view does not show a close button.\n\t * Useful for mobile or embedded contexts where the host handles dismissal (e.g. via a drawer or back gesture).\n\t */\n\thideCloseButton?: boolean;\n};\n\n/** Options for prerendering a flow run. */\nexport type PrerenderFlowOptions = {\n\t/**\n\t * When `true`, the prerendered view does not show a close button.\n\t */\n\thideCloseButton?: boolean;\n};\n\n/** Options for subscribing to flow state updates. */\nexport type SubscribeFlowStateOptions = {\n\t/** Emit the current snapshot immediately. Default `true`. */\n\temitInitial?: boolean;\n\t/** Auto-unsubscribe when the signal is aborted. */\n\tsignal?: AbortSignal;\n};\n\nconst DEFAULT_FLOW_STATE: FlowState = {\n\tisOpen: false,\n\tisLoading: false,\n\twidth: undefined,\n\theight: undefined,\n};\nconst STALE_HANDLE_ERROR_CODE = \"STALE_HANDLE\" as const;\n\nconst isStaleHandleError = (error: unknown): boolean => {\n\tif (error instanceof CommandSettlementError) {\n\t\treturn error.code === STALE_HANDLE_ERROR_CODE;\n\t}\n\tif (!(error instanceof Error)) {\n\t\treturn false;\n\t}\n\treturn error.message.includes(\"flowHandleId is stale\");\n};\n\n/** Instance for a specific flow: open, prefetch, prerender, close, and subscribe to flow state. */\nexport type FlowRun = {\n\t/** The flow/survey ID this instance refers to. */\n\tflowId: string;\n\t/** Open the flow (show the survey). */\n\topen: (options?: OpenFlowOptions) => Promise<void>;\n\t/** Prefetch the flow so it opens faster when you call `open()`. */\n\tprefetch: () => Promise<void>;\n\t/** Prerender the flow into a container (e.g. for a custom dialog). */\n\tprerender: (options?: PrerenderFlowOptions) => Promise<void>;\n\t/** Attach or detach this flow to a specific host container. */\n\tsetContainer: (element: HTMLElement | null) => void;\n\t/** Close this flow. */\n\tclose: () => Promise<void>;\n\t/** Return the latest known flow state snapshot. */\n\tgetFlowState: () => FlowState;\n\t/** Subscribe to open/loading/dimensions; returns an unsubscribe function. */\n\tsubscribeFlowState: (\n\t\tcallback: FlowStateCallback,\n\t\toptions?: SubscribeFlowStateOptions,\n\t) => () => void;\n};\n\n/**\n * getuserfeedback client for loading the widget, opening flows, configuring\n * consent/auth, identifying users, and tracking events.\n *\n * @see https://getuserfeedback.com/docs/reference/javascript-sdk-reference\n */\nexport type Client = {\n\t/** Load the widget script. Call when you created the client with `disableAutoLoad: true`. */\n\tload: () => void;\n\t/** Set how this instance should choose default containers for flows. */\n\tsetDefaultContainerPolicy: (policy: ContainerPolicy) => void;\n\t/** Return the latest known instance-level flow state snapshot. */\n\tgetFlowState: () => FlowState;\n\t/** Subscribe to instance-level flow state updates (eg targeting-triggered opens). */\n\tsubscribeFlowState: (\n\t\tcallback: FlowStateCallback,\n\t\toptions?: SubscribeFlowStateOptions,\n\t) => () => void;\n\t/** Return a flow instance; call .open(), .prefetch(), .prerender(), .close() on it. */\n\tflow: (flowId: string) => FlowRun;\n\t/** Close all open flows. */\n\tclose: () => Promise<void>;\n\t/** Close all open flows, clear JWT authentication, and reset user identity. */\n\treset: () => Promise<void>;\n\t/**\n\t * Update color scheme, consent, or auth. Pass a fresh JWT here after login\n\t * and whenever your auth provider refreshes the session token. Await the\n\t * returned promise or handle its rejection when applying runtime updates.\n\t *\n\t * When using `disableAutoLoad`, call `load()` first. Calls made before `load()`\n\t * resolve without applying the update. Provide the initial color scheme,\n\t * default consent, and capabilities to `createClient()`; configure auth after\n\t * `load()`.\n\t *\n\t * @see https://getuserfeedback.com/docs/security-and-privacy/jwt-auth\n\t */\n\tconfigure: (updates: ConfigureOptions) => Promise<void>;\n\t/**\n\t * Associate the current user with a user ID, traits, and optional external IDs.\n\t *\n\t * Use `options.externalIds` for Segment-compatible identifiers from another\n\t * system. Without a user ID, pass options as `client.identify(traits, options)`,\n\t * or use `client.identify(traits, undefined, options)` when your call site needs\n\t * the explicit three-argument form. Do not put Segment-shaped `externalIds` in\n\t * traits. Some invalid arguments throw synchronously; other validation or\n\t * command-processing failures reject the returned promise.\n\t *\n\t * @see https://getuserfeedback.com/docs/guides/identity-resolution\n\t */\n\tidentify: {\n\t\t(\n\t\t\tuserId: string,\n\t\t\ttraits?: IdentifyTraits,\n\t\t\toptions?: IdentifyOptions,\n\t\t): Promise<void>;\n\t\t(\n\t\t\ttraits: IdentifyTraits,\n\t\t\tplaceholder: undefined,\n\t\t\toptions?: IdentifyOptions,\n\t\t): Promise<void>;\n\t\t(traits: IdentifyTraits, options?: IdentifyOptions): Promise<void>;\n\t};\n\t/**\n\t * Track a product event from the browser.\n\t *\n\t * Use `options.externalIds` when the event carries a Segment-compatible\n\t * identifier from another system. Do not put Segment-shaped `externalIds` in\n\t * properties. Some invalid arguments throw synchronously; other validation or\n\t * command-processing failures reject the returned promise.\n\t *\n\t * @see https://getuserfeedback.com/docs/reference/events\n\t */\n\ttrack: (\n\t\teventName: string,\n\t\tproperties?: EventProperties,\n\t\toptions?: EventOptions,\n\t) => Promise<void>;\n\t/**\n\t * Record the current browser page or a named page location. Some invalid\n\t * arguments throw synchronously; other validation or command-processing\n\t * failures reject the returned promise.\n\t */\n\tpage: (\n\t\tname?: string,\n\t\tproperties?: EventProperties,\n\t\toptions?: EventOptions,\n\t) => Promise<void>;\n\t/** Record directed relationship observations through the analytics pipeline. */\n\tgraph: GraphOperations;\n\t/** Submit feedback or read the authenticated user's matching feedback. */\n\tfeedback: FeedbackOperations;\n\t/** Subscribe to explicit SDK and client-side targeting open requests, or suppress them — for example if you know the user should not be interrupted.\n\t * For example, when the user is filling out a form, or is in the middle of a multi-step flow.\n\t * Prevention applies only to that presentation attempt; it does not create a\n\t * public retry schedule.\n\t *\n\t * @example — suppress open flow requests if the user is busy\n\t * ```ts\n\t * client.onOpenRequested((event) => {\n\t * if (userIsBusy()) {\n\t * event.preventDefault();\n\t * }\n\t * });\n\t * ```\n\t */\n\tonOpenRequested: (callback: OpenRequestedCallback) => () => void;\n};\n\ntype ClientRegistryEntry = {\n\tclient: Client;\n\tupdateOptions: (\n\t\toptions: ClientOptions,\n\t\tactionRegistry: ActionRegistry,\n\t\tlinkRouter: LinkRouter | undefined,\n\t) => void;\n};\n\nconst openRequestBridgeByClient = new WeakMap<\n\tClient,\n\tReturnType<typeof createOpenRequestBridge>\n>();\n\nconst clientRegistry = new Map<object, Map<string, ClientRegistryEntry>>();\n\nexport const getOpenRequestBridge = (\n\tclient: Client,\n): ReturnType<typeof createOpenRequestBridge> => {\n\tconst bridge = openRequestBridgeByClient.get(client);\n\tif (!bridge) {\n\t\tthrow new Error(\"Open request bridge not found for client instance.\");\n\t}\n\treturn bridge;\n};\n\nconst createClientInstanceId = (): string => {\n\tif (\n\t\ttypeof globalThis.crypto !== \"undefined\" &&\n\t\ttypeof globalThis.crypto.randomUUID === \"function\"\n\t) {\n\t\treturn globalThis.crypto.randomUUID();\n\t}\n\treturn `sdk-${Date.now()}-${Math.random().toString(16).slice(2)}`;\n};\n\nconst toIdentifyCommandPayload = (\n\tidentifyInput: string | IdentifyTraits,\n\ttraitsOrOptions?: IdentifyTraits | IdentifyOptions,\n\toptions?: IdentifyOptions,\n): Extract<Command, { kind: \"identify\" }> => {\n\tif (typeof identifyInput === \"string\") {\n\t\tassertNoSegmentExternalIdsInValueArgument({\n\t\t\targument: traitsOrOptions,\n\t\t\tcommandName: \"identify\",\n\t\t\tvalueArgumentName: \"traits\",\n\t\t\tcallShape: \"identify(userId, traits, { externalIds })\",\n\t\t});\n\t\treturn {\n\t\t\tkind: \"identify\",\n\t\t\tuserId: identifyInput,\n\t\t\ttraits: traitsOrOptions,\n\t\t\toptions,\n\t\t};\n\t}\n\tassertNoSegmentExternalIdsInValueArgument({\n\t\targument: identifyInput,\n\t\tcommandName: \"identify\",\n\t\tvalueArgumentName: \"traits\",\n\t\tcallShape: \"identify(traits, { externalIds })\",\n\t});\n\treturn {\n\t\tkind: \"identify\",\n\t\ttraits: identifyInput,\n\t\toptions: options ?? traitsOrOptions,\n\t};\n};\n\nconst toFlags = (input: FlagsInput | undefined): AppEventFlag[] | undefined => {\n\tif (input === undefined) {\n\t\treturn;\n\t}\n\tif (Array.isArray(input)) {\n\t\treturn input.map((flag) => ({ ...flag }));\n\t}\n\treturn Object.entries(input)\n\t\t.sort(([leftKey], [rightKey]) => leftKey.localeCompare(rightKey))\n\t\t.map(([key, value]) => ({ key, value }));\n};\n\nconst toCapabilities = (\n\tinput: CapabilitiesInput | undefined,\n): AppEventCapability[] | undefined => {\n\tif (input === undefined) {\n\t\treturn;\n\t}\n\treturn input.map((capability) =>\n\t\ttypeof capability === \"string\" ? { key: capability } : { ...capability },\n\t);\n};\n\nconst CIRCULAR_TARGETING_CONTEXT_ERROR =\n\t\"Targeting context cannot contain circular values\";\n\nconst toStableJsonValue = (\n\tvalue: unknown,\n\tancestors: WeakSet<object> = new WeakSet(),\n): StableJsonValue => {\n\tif (\n\t\tvalue === null ||\n\t\ttypeof value === \"string\" ||\n\t\ttypeof value === \"number\" ||\n\t\ttypeof value === \"boolean\"\n\t) {\n\t\treturn value;\n\t}\n\tif (Array.isArray(value)) {\n\t\tif (ancestors.has(value)) {\n\t\t\tthrow new Error(CIRCULAR_TARGETING_CONTEXT_ERROR);\n\t\t}\n\t\tancestors.add(value);\n\t\ttry {\n\t\t\treturn value.map((entryValue) =>\n\t\t\t\ttoStableJsonValue(entryValue, ancestors),\n\t\t\t);\n\t\t} finally {\n\t\t\tancestors.delete(value);\n\t\t}\n\t}\n\tif (typeof value === \"object\") {\n\t\tif (ancestors.has(value)) {\n\t\t\tthrow new Error(CIRCULAR_TARGETING_CONTEXT_ERROR);\n\t\t}\n\t\tancestors.add(value);\n\t\tconst objectValue: StableJsonObject = {};\n\t\ttry {\n\t\t\tfor (const [key, entryValue] of Object.entries(value).sort(\n\t\t\t\t([leftKey], [rightKey]) => leftKey.localeCompare(rightKey),\n\t\t\t)) {\n\t\t\t\tif (entryValue !== undefined) {\n\t\t\t\t\tobjectValue[key] = toStableJsonValue(entryValue, ancestors);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn objectValue;\n\t\t} finally {\n\t\t\tancestors.delete(value);\n\t\t}\n\t}\n\treturn null;\n};\n\nconst toCanonicalTargetingValues = (\n\tvalues: unknown[] | undefined,\n): StableJsonValue[] | null => {\n\tif (values === undefined || values.length === 0) {\n\t\treturn null;\n\t}\n\treturn values\n\t\t.map((value) => {\n\t\t\tconst stableValue = toStableJsonValue(value);\n\t\t\treturn { key: JSON.stringify(stableValue), value: stableValue };\n\t\t})\n\t\t.sort(({ key: leftKey }, { key: rightKey }) =>\n\t\t\tleftKey.localeCompare(rightKey),\n\t\t)\n\t\t.map(({ value }) => value);\n};\n\nconst resolveTargetingContextRegistryKey = (options: ClientOptions): string =>\n\tJSON.stringify({\n\t\tflags: toCanonicalTargetingValues(toFlags(options.flags)),\n\t\tcapabilities: toCanonicalTargetingValues(\n\t\t\ttoCapabilities(options.capabilities),\n\t\t),\n\t});\n\nconst LOADER_RUNTIME_PROBE_TIMEOUT_MS = 120;\n// Once Loader registration has been enqueued, it is ordinary command settlement\n// rather than a short ownership probe. Keep supplied-flow handoff behind that\n// settlement so Core capability negotiation can complete before admission.\nconst LOADER_RUNTIME_POST_LOAD_TIMEOUT_MS = 30_000;\nconst INVALID_COMMAND_ERROR_CODE = \"INVALID_COMMAND\";\nconst SUPPLIED_ONLY_LOCAL_CLIENT_OPTIONS_SYMBOL = Symbol.for(\n\t\"@getuserfeedback/sdk/internal/supplied-only-local-client-options/1\",\n);\nconst BUNDLED_DOCS_LOCAL_API_KEY = \"@getuserfeedback/internal/bundled-docs\";\n\ntype MarkedSuppliedOnlyLocalClientOptions = ClientOptions & {\n\t[SUPPLIED_ONLY_LOCAL_CLIENT_OPTIONS_SYMBOL]: true;\n};\ntype MaybeMarkedSuppliedOnlyLocalClientOptions = ClientOptions & {\n\t[SUPPLIED_ONLY_LOCAL_CLIENT_OPTIONS_SYMBOL]?: true;\n};\n\n/** Private runtime inputs for the deployment-owned bundled-docs client. */\nexport type BundledDocsClientOptions = {\n\tloaderUrl: string;\n\tcoreUrl: string;\n\tcolorScheme?: ClientOptions[\"colorScheme\"];\n\tdisableAutoLoad?: boolean;\n};\n\n/**\n * Build options that the public React provider can pass through to the SDK root\n * without exposing local registration in the public options type.\n * Pass the returned object intact; cloning or serializing it deliberately fails\n * closed instead of falling back to persisted registration.\n * See docs/specs/2026-08-02-flow-interaction-model.md.\n */\nexport const createBundledDocsClientOptions = (\n\toptions: BundledDocsClientOptions,\n): ClientOptions => {\n\tconst clientOptions: ClientOptions = {\n\t\tapiKey: BUNDLED_DOCS_LOCAL_API_KEY,\n\t\t_loaderUrl: options.loaderUrl,\n\t\t_coreUrl: options.coreUrl,\n\t\t...(options.colorScheme === undefined\n\t\t\t? {}\n\t\t\t: { colorScheme: options.colorScheme }),\n\t\t...(options.disableAutoLoad === undefined\n\t\t\t? {}\n\t\t\t: { disableAutoLoad: options.disableAutoLoad }),\n\t};\n\tObject.defineProperty(\n\t\tclientOptions,\n\t\tSUPPLIED_ONLY_LOCAL_CLIENT_OPTIONS_SYMBOL,\n\t\t{\n\t\t\tconfigurable: false,\n\t\t\tenumerable: false,\n\t\t\tvalue: true,\n\t\t\twritable: false,\n\t\t},\n\t);\n\treturn clientOptions;\n};\n\nconst isSuppliedOnlyLocalClientOptions = (\n\toptions: MaybeMarkedSuppliedOnlyLocalClientOptions,\n): options is MarkedSuppliedOnlyLocalClientOptions =>\n\toptions[SUPPLIED_ONLY_LOCAL_CLIENT_OPTIONS_SYMBOL] === true;\n\nconst resolveRegistryKey = (\n\toptions: ClientOptions,\n\tregistrationKind: \"persisted\" | \"supplied-only-local\",\n): string =>\n\t`${registrationKind}:${options.apiKey}:${resolveTargetingContextRegistryKey(options)}`;\n\nconst haveSameActionDefinitions = (left: string[], right: string[]): boolean =>\n\tJSON.stringify(left) === JSON.stringify(right);\n\nconst rejectAmbiguousLinkOwnership = (\n\tlinkRouter: LinkRouter | undefined,\n\tactionRegistry: ActionRegistry,\n): void => {\n\tif (linkRouter !== undefined && actionRegistry.getOpenUrlHandler()) {\n\t\tthrow new TypeError(\n\t\t\t\"links.router cannot be configured with actions open-url; choose one link owner\",\n\t\t);\n\t}\n};\n\nconst resolveRegistryScope = (): object =>\n\ttypeof window === \"undefined\" ? globalThis : window;\n\nconst getRegistryForScope = (): Map<string, ClientRegistryEntry> => {\n\tconst scope = resolveRegistryScope();\n\tconst existing = clientRegistry.get(scope);\n\tif (existing) {\n\t\treturn existing;\n\t}\n\tconst created = new Map<string, ClientRegistryEntry>();\n\tclientRegistry.set(scope, created);\n\treturn created;\n};\n\n/**\n * Create a getuserfeedback client. Reuses an existing logical client for the\n * same `apiKey` and targeting context. Host-action definitions may change\n * before loading starts; afterward, changing their canonical identities throws\n * while equivalent definitions refresh their handlers.\n */\nexport const createClient = (options: ClientOptions): Client => {\n\tconst suppliedOnlyLocal = isSuppliedOnlyLocalClientOptions(options);\n\tif (!suppliedOnlyLocal && options.apiKey === BUNDLED_DOCS_LOCAL_API_KEY) {\n\t\tthrow new Error(\n\t\t\t\"Bundled docs client options must be passed intact without cloning or serialization.\",\n\t\t);\n\t}\n\tconst {\n\t\tapiKey,\n\t\t_loaderUrl,\n\t\t_coreUrl,\n\t\t_apiUrl,\n\t\t_realtimeUrl,\n\t\tdisableAutoLoad = false,\n\t\tcolorScheme,\n\t\tdisableTelemetry = false,\n\t\tenableDebug = false,\n\t\tdefaultConsent,\n\t\tflags,\n\t\tcapabilities,\n\t\tactions,\n\t\tlinks,\n\t} = options;\n\tconst initialActionRegistry = createActionRegistry(actions);\n\tconst initialLinkRouter = resolveLinkRouter(links);\n\trejectAmbiguousLinkOwnership(initialLinkRouter, initialActionRegistry);\n\tconst registryKey = resolveRegistryKey(\n\t\t{\n\t\t\tapiKey,\n\t\t\t_loaderUrl,\n\t\t\t_coreUrl,\n\t\t\t_apiUrl,\n\t\t\t_realtimeUrl,\n\t\t\tdisableAutoLoad,\n\t\t\tcolorScheme,\n\t\t\tdisableTelemetry,\n\t\t\tenableDebug,\n\t\t\tdefaultConsent,\n\t\t\tflags,\n\t\t\tcapabilities,\n\t\t\tactions,\n\t\t},\n\t\tsuppliedOnlyLocal ? \"supplied-only-local\" : \"persisted\",\n\t);\n\tconst registry = getRegistryForScope();\n\tconst existing = registry.get(registryKey);\n\tif (existing) {\n\t\texisting.updateOptions(\n\t\t\t{\n\t\t\t\tapiKey,\n\t\t\t\t_loaderUrl,\n\t\t\t\t_coreUrl,\n\t\t\t\t_apiUrl,\n\t\t\t\t_realtimeUrl,\n\t\t\t\tdisableAutoLoad,\n\t\t\t\tcolorScheme,\n\t\t\t\tdisableTelemetry,\n\t\t\t\tenableDebug,\n\t\t\t\tdefaultConsent,\n\t\t\t\tflags,\n\t\t\t\tcapabilities,\n\t\t\t\tactions,\n\t\t\t},\n\t\t\tinitialActionRegistry,\n\t\t\tinitialLinkRouter,\n\t\t);\n\t\tif (!disableAutoLoad) {\n\t\t\texisting.client.load();\n\t\t}\n\t\treturn existing.client;\n\t}\n\n\tlet loaderUrlConfig = _loaderUrl;\n\tlet coreUrlConfig = _coreUrl;\n\tlet apiUrlConfig = _apiUrl;\n\tlet realtimeUrlConfig = _realtimeUrl;\n\n\tconst notifyError = (_error: unknown): void => {\n\t\t// No-op: track/use hooks removed from public API.\n\t};\n\tconst hostWindow =\n\t\ttypeof window !== \"undefined\" &&\n\t\ttypeof window.addEventListener === \"function\" &&\n\t\ttypeof window.removeEventListener === \"function\"\n\t\t\t? window\n\t\t\t: null;\n\tconst hostDocument =\n\t\ttypeof document !== \"undefined\" &&\n\t\ttypeof document.createElement === \"function\" &&\n\t\tdocument.head !== null\n\t\t\t? document\n\t\t\t: null;\n\n\tconst sdkVersion = SDK_VERSION;\n\tconst clientInstanceId = createClientInstanceId();\n\tconst openRequestBridge = createOpenRequestBridge();\n\tconst clientMeta: ClientMeta = {\n\t\tloader: \"sdk\",\n\t\tclientName: \"@getuserfeedback/sdk\",\n\t\tclientVersion: sdkVersion,\n\t\ttransport: \"snippet\",\n\t};\n\n\tlet defaultConsentConfig = defaultConsent;\n\tlet colorSchemeConfig = colorScheme;\n\tlet flagsConfig = toFlags(flags);\n\tlet capabilitiesConfig = toCapabilities(capabilities);\n\tlet actionRegistry = initialActionRegistry;\n\tlet linkRouterConfig = initialLinkRouter;\n\n\tconst buildRuntimeEndpoints = (): InitOptions[\"runtimeEndpoints\"] => {\n\t\tif (!(coreUrlConfig || apiUrlConfig || realtimeUrlConfig)) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn {\n\t\t\t...(coreUrlConfig !== undefined ? { coreUrl: coreUrlConfig } : {}),\n\t\t\t...(apiUrlConfig !== undefined ? { apiUrl: apiUrlConfig } : {}),\n\t\t\t...(realtimeUrlConfig !== undefined\n\t\t\t\t? { realtimeUrl: realtimeUrlConfig }\n\t\t\t\t: {}),\n\t\t};\n\t};\n\n\tconst buildInitOpts = (includeHostActions = true): InitOptions => {\n\t\tconst runtimeEndpoints = buildRuntimeEndpoints();\n\t\tconst hostActionDefinitions = includeHostActions\n\t\t\t? actionRegistry.listDefinitions()\n\t\t\t: [];\n\t\tconst protocolCapabilities = [\n\t\t\t...SDK_PROTOCOL_CAPABILITIES,\n\t\t\t...(linkRouterConfig !== undefined || actionRegistry.getOpenUrlHandler()\n\t\t\t\t? [OPEN_URL_ACTION_CAPABILITY, OPEN_URL_ACTION_V1_CAPABILITY]\n\t\t\t\t: []),\n\t\t];\n\t\treturn {\n\t\t\tapiKey,\n\t\t\tclientMeta,\n\t\t\tcapabilities: [...protocolCapabilities],\n\t\t\t...(flagsConfig !== undefined && {\n\t\t\t\tflags: flagsConfig.map((flag) => ({ ...flag })),\n\t\t\t}),\n\t\t\t...(capabilitiesConfig !== undefined && {\n\t\t\t\thostCapabilities: capabilitiesConfig.map((capability) => ({\n\t\t\t\t\t...capability,\n\t\t\t\t})),\n\t\t\t}),\n\t\t\t...(hostActionDefinitions.length > 0 && {\n\t\t\t\thostActions: hostActionDefinitions,\n\t\t\t}),\n\t\t\t...(runtimeEndpoints !== undefined ? { runtimeEndpoints } : {}),\n\t\t\t...(colorSchemeConfig !== undefined && {\n\t\t\t\tcolorScheme: colorSchemeConfig,\n\t\t\t}),\n\t\t\t...(disableTelemetry !== undefined && { disableTelemetry }),\n\t\t\t...(enableDebug !== undefined && { enableDebug }),\n\t\t\t...(defaultConsentConfig !== undefined && {\n\t\t\t\tdefaultConsent: defaultConsentConfig,\n\t\t\t}),\n\t\t};\n\t};\n\n\tlet loaderRequested = false;\n\tlet pendingLoad: Promise<void> | null = null;\n\tlet pendingRegistrationProbe: Promise<void> | null = null;\n\tlet disableAutoLoadConfig = disableAutoLoad;\n\tconst flowStateByHandle = new Map<FlowHandleId, FlowState>();\n\tconst claimedFlowStateHandles = new Set<FlowHandleId>();\n\tconst pendingFlowStateHandles = new Set<FlowHandleId>();\n\tlet isFlowHandleAllocationActive = false;\n\tlet isFlowHandleAllocationLocked = false;\n\tconst flowHandleAllocationWaiters: Array<(release: () => void) => void> = [];\n\tlet instanceFlowState: FlowState = DEFAULT_FLOW_STATE;\n\tconst hostEventHub = createClientHostEventHub({\n\t\tinstanceId: clientInstanceId,\n\t\tonNavigationRequested: (detail) => {\n\t\t\tconst target =\n\t\t\t\tdetail.version === 1 && detail.target === \"_blank\"\n\t\t\t\t\t? undefined\n\t\t\t\t\t: detail.version === OPEN_URL_ACTION_VERSION &&\n\t\t\t\t\t\t\t(detail.target === undefined ||\n\t\t\t\t\t\t\t\tdetail.target === \"self\" ||\n\t\t\t\t\t\t\t\tdetail.target === \"blank\")\n\t\t\t\t\t\t? detail.target\n\t\t\t\t\t\t: null;\n\t\t\tif (target === null) {\n\t\t\t\treturn \"unhandled\";\n\t\t\t}\n\t\t\tif (linkRouterConfig !== undefined) {\n\t\t\t\tinvokeLinkRouter(linkRouterConfig, {\n\t\t\t\t\turl: detail.url,\n\t\t\t\t\t...(target === undefined ? {} : { target }),\n\t\t\t\t});\n\t\t\t\treturn \"succeeded\";\n\t\t\t}\n\t\t\tconst handler = actionRegistry.getOpenUrlHandler();\n\t\t\tif (!handler) {\n\t\t\t\treturn \"unhandled\";\n\t\t\t}\n\t\t\tconst outcome = handler({\n\t\t\t\turl: detail.url,\n\t\t\t\t...(target === undefined ? {} : { target }),\n\t\t\t});\n\t\t\tif (outcome === \"handled\") {\n\t\t\t\treturn \"succeeded\";\n\t\t\t}\n\t\t\tif (outcome === \"unhandled\") {\n\t\t\t\treturn \"unhandled\";\n\t\t\t}\n\t\t\tthrow new TypeError(\n\t\t\t\t'Registered open-url action must return \"handled\" or \"unhandled\" synchronously.',\n\t\t\t);\n\t\t},\n\t\twindowRef: hostWindow,\n\t});\n\n\tconst resolveRequiredRuntimeUrls = (): {\n\t\tloaderUrl: string;\n\t\tcoreUrl: string;\n\t\tapiUrl: string;\n\t\trealtimeUrl?: string;\n\t} => {\n\t\tconst runtimeUrls = resolveStartupRuntimeUrls({\n\t\t\tapiKey,\n\t\t\t_loaderUrl: loaderUrlConfig,\n\t\t\t_coreUrl: coreUrlConfig,\n\t\t\t_apiUrl: apiUrlConfig,\n\t\t\t_realtimeUrl: realtimeUrlConfig,\n\t\t});\n\t\tloaderUrlConfig = runtimeUrls.loaderUrl;\n\t\tcoreUrlConfig = runtimeUrls.coreUrl;\n\t\tapiUrlConfig = runtimeUrls.apiUrl;\n\t\trealtimeUrlConfig = runtimeUrls.realtimeUrl;\n\t\treturn runtimeUrls;\n\t};\n\n\tconst cloneFlowState = (state: FlowState): FlowState => ({\n\t\tisOpen: state.isOpen,\n\t\tisLoading: state.isLoading,\n\t\twidth: state.width,\n\t\theight: state.height,\n\t});\n\n\tconst getFlowStateForHandle = (flowHandleId: FlowHandleId): FlowState => {\n\t\tconst existing = flowStateByHandle.get(flowHandleId);\n\t\tif (!existing) {\n\t\t\treturn cloneFlowState(DEFAULT_FLOW_STATE);\n\t\t}\n\t\treturn cloneFlowState(existing);\n\t};\n\n\tconst setFlowStateForHandle = (\n\t\tflowHandleId: FlowHandleId,\n\t\tstate: FlowState,\n\t): void => {\n\t\tflowStateByHandle.set(flowHandleId, cloneFlowState(state));\n\t};\n\n\t// Core can publish state for a newly allocated supplied Flow before the\n\t// command settlement tells its FlowRun which handle was allocated. Keep the\n\t// client-owned snapshot current so binding that handle can replay the state\n\t// instead of losing the first open transition.\n\thostEventHub.subscribeFlowState((detail): void => {\n\t\tconst isClaimedHandle = claimedFlowStateHandles.has(detail.flowHandleId);\n\t\tif (!isClaimedHandle && !isFlowHandleAllocationActive) {\n\t\t\treturn;\n\t\t}\n\t\tsetFlowStateForHandle(detail.flowHandleId, {\n\t\t\tisOpen: detail.isOpen,\n\t\t\tisLoading: detail.isLoading,\n\t\t\twidth: detail.width,\n\t\t\theight: detail.height,\n\t\t});\n\t\tif (!isClaimedHandle) {\n\t\t\tpendingFlowStateHandles.add(detail.flowHandleId);\n\t\t}\n\t});\n\tconst beginFlowHandleAllocation = (): void => {\n\t\tisFlowHandleAllocationActive = true;\n\t};\n\tconst clearPendingFlowHandleState = (): void => {\n\t\tfor (const flowHandleId of pendingFlowStateHandles) {\n\t\t\tflowStateByHandle.delete(flowHandleId);\n\t\t}\n\t\tpendingFlowStateHandles.clear();\n\t};\n\tconst endFlowHandleAllocation = (): void => {\n\t\tisFlowHandleAllocationActive = false;\n\t\tclearPendingFlowHandleState();\n\t};\n\t/**\n\t * Flow-state events do not carry the allocating command requestId. Serialize\n\t * only handle-free handoffs so a pre-settlement snapshot has one possible\n\t * owner. Other commands remain concurrent. If allocation concurrency becomes\n\t * a product requirement, add explicit event correlation instead of a ledger.\n\t */\n\tconst createFlowHandleAllocationRelease = (): (() => void) => {\n\t\tlet released = false;\n\t\treturn () => {\n\t\t\tif (released) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treleased = true;\n\t\t\tconst next = flowHandleAllocationWaiters.shift();\n\t\t\tif (next) {\n\t\t\t\tnext(createFlowHandleAllocationRelease());\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tisFlowHandleAllocationLocked = false;\n\t\t};\n\t};\n\tconst acquireFlowHandleAllocation = ():\n\t\t| (() => void)\n\t\t| Promise<() => void> => {\n\t\tif (!isFlowHandleAllocationLocked) {\n\t\t\tisFlowHandleAllocationLocked = true;\n\t\t\treturn createFlowHandleAllocationRelease();\n\t\t}\n\t\treturn new Promise<() => void>((resolve) => {\n\t\t\tflowHandleAllocationWaiters.push(resolve);\n\t\t});\n\t};\n\n\tconst getInstanceFlowState = (): FlowState =>\n\t\tcloneFlowState(instanceFlowState);\n\n\tconst setInstanceFlowState = (state: FlowState): void => {\n\t\tinstanceFlowState = cloneFlowState(state);\n\t};\n\n\thostEventHub.subscribeInstanceFlowState((detail): void => {\n\t\tsetInstanceFlowState({\n\t\t\tisOpen: detail.isOpen,\n\t\t\tisLoading: detail.isLoading,\n\t\t\twidth: detail.width,\n\t\t\theight: detail.height,\n\t\t});\n\t});\n\n\tconst ensureFlowStateForHandle = (flowHandleId: FlowHandleId): void => {\n\t\tif (!flowStateByHandle.has(flowHandleId)) {\n\t\t\tsetFlowStateForHandle(flowHandleId, DEFAULT_FLOW_STATE);\n\t\t}\n\t};\n\n\tconst subscribeFlowHandleInvalidation = (\n\t\tsubscriber: (flowHandleId: FlowHandleId) => void,\n\t): (() => void) => hostEventHub.subscribeFlowHandleInvalidation(subscriber);\n\n\tconst subscribeFlowStateCacheForHandle = (\n\t\tflowHandleId: FlowHandleId,\n\t): (() => void) =>\n\t\thostEventHub.subscribeFlowStateForHandle(flowHandleId, (detail): void => {\n\t\t\tconst nextState: FlowState = {\n\t\t\t\tisOpen: detail.isOpen,\n\t\t\t\tisLoading: detail.isLoading,\n\t\t\t\twidth: detail.width,\n\t\t\t\theight: detail.height,\n\t\t\t};\n\t\t\tsetFlowStateForHandle(flowHandleId, nextState);\n\t\t});\n\n\tconst isLoaderRequested = (): boolean => loaderRequested;\n\n\tconst enqueue = (\n\t\tenvelope: CommandEnvelope | InternalHostCommandEnvelope,\n\t): void => {\n\t\tif (!hostWindow) {\n\t\t\treturn;\n\t\t}\n\t\tif (!hostWindow.__getuserfeedback_queue) {\n\t\t\thostWindow.__getuserfeedback_queue = [];\n\t\t}\n\t\t// Stamp instanceId and clientMeta so the loader can route commands.\n\t\tconst stamped: CommandEnvelope | InternalHostCommandEnvelope = {\n\t\t\t...envelope,\n\t\t\tinstanceId: envelope.instanceId ?? clientInstanceId,\n\t\t\tclientMeta: envelope.clientMeta ?? clientMeta,\n\t\t};\n\t\thostWindow.__getuserfeedback_queue.push(stamped);\n\t};\n\n\tconst enqueueInstanceRegistration = (\n\t\trequestId?: string,\n\t\tincludeHostActions = true,\n\t): string => {\n\t\tif (suppliedOnlyLocal) {\n\t\t\tif (!coreUrlConfig) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"_coreUrl is not resolved for bundled docs registration\",\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst localRequestId = requestId ?? createCommandRequestId();\n\t\t\tconst command: InternalHostSuppliedOnlyLocalInitCommandPayload = {\n\t\t\t\tkind: \"init\",\n\t\t\t\topts: suppliedOnlyLocalInitOptionsSchema.parse({\n\t\t\t\t\tregistration: {\n\t\t\t\t\t\tkind: \"supplied-only-local\",\n\t\t\t\t\t\tprofile: \"bundled-docs\",\n\t\t\t\t\t},\n\t\t\t\t\t...(colorSchemeConfig === undefined\n\t\t\t\t\t\t? {}\n\t\t\t\t\t\t: { colorScheme: colorSchemeConfig }),\n\t\t\t\t}),\n\t\t\t\truntimeEndpoints: { coreUrl: coreUrlConfig },\n\t\t\t};\n\t\t\tenqueue({\n\t\t\t\tversion: \"1\",\n\t\t\t\trequestId: localRequestId,\n\t\t\t\tidempotencyKey: localRequestId,\n\t\t\t\tcommand,\n\t\t\t});\n\t\t\treturn localRequestId;\n\t\t}\n\t\tconst envelope = createCommandEnvelope({\n\t\t\tinstanceId: clientInstanceId,\n\t\t\trequestId,\n\t\t\tcommand: { kind: \"init\", opts: buildInitOpts(includeHostActions) },\n\t\t});\n\t\tenqueue(envelope);\n\t\treturn envelope.requestId;\n\t};\n\n\tconst runAfterRegistrationProbe = (run: () => void): void => {\n\t\tconst registrationProbe = pendingRegistrationProbe;\n\t\tif (!registrationProbe) {\n\t\t\trun();\n\t\t\treturn;\n\t\t}\n\t\tvoid registrationProbe.then(run);\n\t};\n\n\tconst enqueueSetDefaultContainerPolicy = (policy: ContainerPolicy): void => {\n\t\trunAfterRegistrationProbe(() => {\n\t\t\tenqueue(\n\t\t\t\tcreateCommandEnvelope({\n\t\t\t\t\tcommand: { kind: \"setDefaultContainerPolicy\", policy },\n\t\t\t\t}),\n\t\t\t);\n\t\t});\n\t};\n\n\tconst enqueueSetContainer = (\n\t\tflowHandleId: FlowHandleId,\n\t\telement: HTMLElement | null,\n\t): void => {\n\t\tenqueue(\n\t\t\tcreateCommandEnvelope({\n\t\t\t\tcommand: { kind: \"setContainer\", flowHandleId, container: element },\n\t\t\t}),\n\t\t);\n\t};\n\n\tconst reportAsyncError = <T>(promise: Promise<T>): Promise<T> => {\n\t\treturn promise.catch((error) => {\n\t\t\tnotifyError(error);\n\t\t\tthrow error;\n\t\t});\n\t};\n\n\tconst ensureCommandsCanRun = (): void => {\n\t\tif (!hostWindow) {\n\t\t\treturn;\n\t\t}\n\t\tif (!isLoaderRequested()) {\n\t\t\tif (disableAutoLoadConfig) {\n\t\t\t\tthrow new Error(\"Widget not loaded. Call client.load() first.\");\n\t\t\t}\n\t\t\tload();\n\t\t}\n\t};\n\n\tconst assertInlineFlowRuntimeSupport = (): void => {\n\t\tconst runtimeMarker = hostWindow?.[LOADER_RUNTIME_GLOBAL_KEY];\n\t\tif (!runtimeMarker?.alive) {\n\t\t\tthrow new Error(\n\t\t\t\t\"Inline flows require an active compatible Loader runtime.\",\n\t\t\t);\n\t\t}\n\t\tif (runtimeMarker.protocolVersion !== LOADER_RUNTIME_PROTOCOL_VERSION) {\n\t\t\tthrow new Error(\n\t\t\t\t`Incompatible loader runtime protocol: expected ${LOADER_RUNTIME_PROTOCOL_VERSION}, received ${runtimeMarker.protocolVersion ?? \"unknown\"}`,\n\t\t\t);\n\t\t}\n\t\tif (!runtimeMarker.features?.includes(UNIFIED_FLOW_RUNTIME_V1_CAPABILITY)) {\n\t\t\tthrow new Error(\n\t\t\t\t`Inline flows require Loader feature ${UNIFIED_FLOW_RUNTIME_V1_CAPABILITY}.`,\n\t\t\t);\n\t\t}\n\t};\n\n\t/** Enqueue a command and await its settlement.\n\t * The loader resolves instanceId from the instance registry. */\n\tconst rawSettlementDispatch = createCommandSettlementDispatch((cmd) =>\n\t\tenqueue(cmd),\n\t);\n\t// createCommandSettlementDispatch inserts the envelope synchronously before\n\t// returning its settlement promise, which makes invocation the handoff edge.\n\tconst handOffCommand = (input: Command) => rawSettlementDispatch(input);\n\tconst handOffInlineFlowCommand = (\n\t\tinput: InternalHostInlineFlowCommandPayload,\n\t) => {\n\t\tconst requestId = createCommandRequestId();\n\t\tenqueue({\n\t\t\tversion: \"1\",\n\t\t\trequestId,\n\t\t\tidempotencyKey: requestId,\n\t\t\tcommand: input,\n\t\t});\n\t\treturn waitForCommandSettlement({\n\t\t\trequestId,\n\t\t\twindowRef: hostWindow ?? undefined,\n\t\t});\n\t};\n\tconst transportAdmission = createClientTransportAdmission();\n\tconst prepareCommandHandoff = (): void | Promise<void> => {\n\t\tensureCommandsCanRun();\n\t\tconst registrationProbe = pendingRegistrationProbe;\n\t\tif (registrationProbe) {\n\t\t\treturn registrationProbe;\n\t\t}\n\t};\n\tconst prepareInlineFlowCommandHandoff = (): void | Promise<void> => {\n\t\tensureCommandsCanRun();\n\t\tconst startup = pendingLoad ?? pendingRegistrationProbe;\n\t\tif (startup) {\n\t\t\treturn startup.then(assertInlineFlowRuntimeSupport);\n\t\t}\n\t\tassertInlineFlowRuntimeSupport();\n\t};\n\tconst dispatch = async (input: Command): Promise<void> => {\n\t\tconst preparation = prepareCommandHandoff();\n\t\tif (preparation) {\n\t\t\tawait preparation;\n\t\t}\n\t\tawait rawSettlementDispatch(input);\n\t};\n\n\tconst enqueueConfigUpdate = (opts: ConfigureOptions): void => {\n\t\tif (!isLoaderRequested()) {\n\t\t\treturn;\n\t\t}\n\t\trunAfterRegistrationProbe(() => {\n\t\t\tenqueue(\n\t\t\t\tcreateCommandEnvelope({\n\t\t\t\t\tcommand: { kind: \"configure\", opts },\n\t\t\t\t}),\n\t\t\t);\n\t\t});\n\t};\n\n\tconst toConfigureCommandOptions = (\n\t\tupdates: ConfigureOptions,\n\t): ConfigureOptions => {\n\t\tconst nextCapabilities = toCapabilities(updates.capabilities);\n\t\treturn {\n\t\t\t...(updates.colorScheme !== undefined && {\n\t\t\t\tcolorScheme: updates.colorScheme,\n\t\t\t}),\n\t\t\t...(updates.consent !== undefined && { consent: updates.consent }),\n\t\t\t...(updates.auth !== undefined && { auth: updates.auth }),\n\t\t\t...(nextCapabilities !== undefined && {\n\t\t\t\tcapabilities: nextCapabilities,\n\t\t\t}),\n\t\t};\n\t};\n\n\tconst updateOptions = (\n\t\tnext: ClientOptions,\n\t\tnextActionRegistry: ActionRegistry,\n\t\tnextLinkRouter: LinkRouter | undefined,\n\t): void => {\n\t\tconst linkRouterOwnershipChanged =\n\t\t\t(linkRouterConfig === undefined) !== (nextLinkRouter === undefined);\n\t\tif (\n\t\t\tlinkRouterOwnershipChanged &&\n\t\t\t(isLoaderRequested() || pendingLoad !== null)\n\t\t) {\n\t\t\tthrow new Error(\n\t\t\t\t\"links.router cannot be added or removed after widget init; keeping original router\",\n\t\t\t);\n\t\t}\n\t\tconst definitionsChanged = !haveSameActionDefinitions(\n\t\t\tactionRegistry.listRegistrationIdentities(),\n\t\t\tnextActionRegistry.listRegistrationIdentities(),\n\t\t);\n\t\tif (definitionsChanged && (isLoaderRequested() || pendingLoad !== null)) {\n\t\t\tconst error = new Error(\n\t\t\t\t\"actions definitions cannot be changed after widget init; keeping original registrations\",\n\t\t\t);\n\t\t\tnotifyError(error);\n\t\t\tthrow error;\n\t\t}\n\t\tactionRegistry = nextActionRegistry;\n\t\tlinkRouterConfig = nextLinkRouter;\n\t\tdisableAutoLoadConfig = next.disableAutoLoad ?? disableAutoLoadConfig;\n\t\tdefaultConsentConfig = next.defaultConsent ?? defaultConsentConfig;\n\t\tif (!isLoaderRequested() && pendingLoad === null) {\n\t\t\tif (next.colorScheme !== undefined) {\n\t\t\t\tcolorSchemeConfig = next.colorScheme;\n\t\t\t}\n\t\t\tif (next.flags !== undefined) {\n\t\t\t\tflagsConfig = toFlags(next.flags);\n\t\t\t}\n\t\t\tif (next.capabilities !== undefined) {\n\t\t\t\tcapabilitiesConfig = toCapabilities(next.capabilities);\n\t\t\t}\n\t\t}\n\n\t\tif (next._loaderUrl !== undefined && next._loaderUrl !== loaderUrlConfig) {\n\t\t\tif (isLoaderRequested() || pendingLoad !== null) {\n\t\t\t\tconst error = new Error(\n\t\t\t\t\t\"_loaderUrl cannot be changed after widget init; keeping original\",\n\t\t\t\t);\n\t\t\t\tnotifyError(error);\n\t\t\t} else {\n\t\t\t\tloaderUrlConfig = next._loaderUrl;\n\t\t\t}\n\t\t}\n\n\t\tif (next._coreUrl !== undefined && next._coreUrl !== coreUrlConfig) {\n\t\t\tif (isLoaderRequested() || pendingLoad !== null) {\n\t\t\t\tconst error = new Error(\n\t\t\t\t\t\"_coreUrl cannot be changed after widget init; keeping original\",\n\t\t\t\t);\n\t\t\t\tnotifyError(error);\n\t\t\t} else {\n\t\t\t\tcoreUrlConfig = next._coreUrl;\n\t\t\t}\n\t\t}\n\n\t\tif (next._apiUrl !== undefined && next._apiUrl !== apiUrlConfig) {\n\t\t\tif (isLoaderRequested() || pendingLoad !== null) {\n\t\t\t\tconst error = new Error(\n\t\t\t\t\t\"_apiUrl cannot be changed after widget init; keeping original\",\n\t\t\t\t);\n\t\t\t\tnotifyError(error);\n\t\t\t} else {\n\t\t\t\tapiUrlConfig = next._apiUrl;\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\tnext._realtimeUrl !== undefined &&\n\t\t\tnext._realtimeUrl !== realtimeUrlConfig\n\t\t) {\n\t\t\tif (isLoaderRequested() || pendingLoad !== null) {\n\t\t\t\tconst error = new Error(\n\t\t\t\t\t\"_realtimeUrl cannot be changed after widget init; keeping original\",\n\t\t\t\t);\n\t\t\t\tnotifyError(error);\n\t\t\t} else {\n\t\t\t\trealtimeUrlConfig = next._realtimeUrl;\n\t\t\t}\n\t\t}\n\n\t\tapplyStartupConfig(next);\n\n\t\tif (!disableAutoLoadConfig && !isLoaderRequested()) {\n\t\t\tload();\n\t\t}\n\t};\n\n\tconst applyStartupConfig = (next: ClientOptions): void => {\n\t\t// Send configure payload from next (colorScheme only from ClientOptions).\n\t\tif (!isLoaderRequested()) return;\n\t\tconst opts: ConfigureOptions = {};\n\t\tif (next.colorScheme !== undefined) opts.colorScheme = next.colorScheme;\n\t\tif (next.capabilities !== undefined) {\n\t\t\tcapabilitiesConfig = toCapabilities(next.capabilities);\n\t\t\topts.capabilities = capabilitiesConfig;\n\t\t}\n\t\tenqueueConfigUpdate(opts);\n\t};\n\n\tconst load = (): void => {\n\t\tif (!hostWindow || !hostDocument) {\n\t\t\treturn;\n\t\t}\n\t\tif (isLoaderRequested() || pendingLoad) {\n\t\t\treturn;\n\t\t}\n\t\tconst runtimeUrls = resolveRequiredRuntimeUrls();\n\n\t\tconst appendLoaderScript = (): void => {\n\t\t\tconst scriptUrl = runtimeUrls.loaderUrl;\n\t\t\tif (\n\t\t\t\t!hostDocument.querySelector(`link[href=\"${scriptUrl}\"][rel=\"preload\"]`)\n\t\t\t) {\n\t\t\t\tconst preload = hostDocument.createElement(\"link\");\n\t\t\t\tpreload.rel = \"preload\";\n\t\t\t\tpreload.as = \"script\";\n\t\t\t\tpreload.href = scriptUrl;\n\t\t\t\thostDocument.head.appendChild(preload);\n\t\t\t}\n\n\t\t\tconst script = hostDocument.createElement(\"script\");\n\t\t\tscript.src = scriptUrl;\n\t\t\tscript.async = true;\n\t\t\tif (script.dataset) {\n\t\t\t\tscript.dataset.disableAutoRegister = \"true\";\n\t\t\t} else if (typeof script.setAttribute === \"function\") {\n\t\t\t\tscript.setAttribute(\"data-disable-auto-register\", \"true\");\n\t\t\t}\n\t\t\thostDocument.head.appendChild(script);\n\t\t};\n\n\t\tconst runtimeMarker = hostWindow[LOADER_RUNTIME_GLOBAL_KEY];\n\t\tif (runtimeMarker?.alive) {\n\t\t\tconst protocolVersion = runtimeMarker.protocolVersion;\n\t\t\tif (protocolVersion !== LOADER_RUNTIME_PROTOCOL_VERSION) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Incompatible loader runtime protocol: expected ${LOADER_RUNTIME_PROTOCOL_VERSION}, received ${protocolVersion ?? \"unknown\"}`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst requestId = enqueueInstanceRegistration();\n\t\t\tloaderRequested = true;\n\t\t\tif (\n\t\t\t\t!runtimeMarker.features?.includes(UNIFIED_FLOW_RUNTIME_V1_CAPABILITY)\n\t\t\t) {\n\t\t\t\tlet trackedPending: Promise<void>;\n\t\t\t\tconst pending = waitForCommandSettlement({\n\t\t\t\t\trequestId,\n\t\t\t\t\twindowRef: hostWindow,\n\t\t\t\t\ttimeoutMs: LOADER_RUNTIME_POST_LOAD_TIMEOUT_MS,\n\t\t\t\t})\n\t\t\t\t\t.then(() => {})\n\t\t\t\t\t.catch((error) => {\n\t\t\t\t\t\tnotifyError(error);\n\t\t\t\t\t});\n\t\t\t\ttrackedPending = pending.finally(() => {\n\t\t\t\t\tif (pendingRegistrationProbe === trackedPending) {\n\t\t\t\t\t\tpendingRegistrationProbe = null;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tpendingRegistrationProbe = trackedPending;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst hasCommandQueue = Array.isArray(hostWindow.__getuserfeedback_queue);\n\t\tif (!hasCommandQueue) {\n\t\t\tconst requestId = enqueueInstanceRegistration();\n\t\t\tappendLoaderScript();\n\t\t\tloaderRequested = true;\n\t\t\tlet trackedPending: Promise<void>;\n\t\t\tconst pending = waitForCommandSettlement({\n\t\t\t\trequestId,\n\t\t\t\twindowRef: hostWindow,\n\t\t\t\ttimeoutMs: LOADER_RUNTIME_POST_LOAD_TIMEOUT_MS,\n\t\t\t})\n\t\t\t\t.then(() => {})\n\t\t\t\t.catch((error) => {\n\t\t\t\t\tnotifyError(error);\n\t\t\t\t});\n\t\t\ttrackedPending = pending.finally(() => {\n\t\t\t\tif (pendingLoad === trackedPending) {\n\t\t\t\t\tpendingLoad = null;\n\t\t\t\t}\n\t\t\t});\n\t\t\tpendingLoad = trackedPending;\n\t\t\treturn;\n\t\t}\n\n\t\tloaderRequested = true;\n\n\t\tlet trackedPending: Promise<void>;\n\t\tconst pending = (async () => {\n\t\t\tconst requestId = createCommandRequestId();\n\t\t\tenqueueInstanceRegistration(requestId);\n\t\t\ttry {\n\t\t\t\tawait waitForCommandSettlement({\n\t\t\t\t\trequestId,\n\t\t\t\t\twindowRef: hostWindow,\n\t\t\t\t\ttimeoutMs: LOADER_RUNTIME_PROBE_TIMEOUT_MS,\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t} catch (error) {\n\t\t\t\tif (error instanceof CommandSettlementTimeoutError) {\n\t\t\t\t\tappendLoaderScript();\n\t\t\t\t\tawait waitForCommandSettlement({\n\t\t\t\t\t\trequestId,\n\t\t\t\t\t\twindowRef: hostWindow,\n\t\t\t\t\t\ttimeoutMs: LOADER_RUNTIME_POST_LOAD_TIMEOUT_MS,\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (\n\t\t\t\t\terror instanceof CommandSettlementError &&\n\t\t\t\t\terror.code === INVALID_COMMAND_ERROR_CODE &&\n\t\t\t\t\tactionRegistry.listDefinitions().length > 0\n\t\t\t\t) {\n\t\t\t\t\tconst fallbackRequestId = createCommandRequestId();\n\t\t\t\t\tenqueueInstanceRegistration(fallbackRequestId, false);\n\t\t\t\t\tawait waitForCommandSettlement({\n\t\t\t\t\t\trequestId: fallbackRequestId,\n\t\t\t\t\t\twindowRef: hostWindow,\n\t\t\t\t\t\ttimeoutMs: LOADER_RUNTIME_POST_LOAD_TIMEOUT_MS,\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t})().catch((error) => {\n\t\t\tnotifyError(error);\n\t\t});\n\t\ttrackedPending = pending.finally(() => {\n\t\t\tif (pendingLoad === trackedPending) {\n\t\t\t\tpendingLoad = null;\n\t\t\t}\n\t\t\tif (pendingRegistrationProbe === trackedPending) {\n\t\t\t\tpendingRegistrationProbe = null;\n\t\t\t}\n\t\t});\n\t\tpendingLoad = trackedPending;\n\t\tif (actionRegistry.listDefinitions().length > 0) {\n\t\t\tpendingRegistrationProbe = trackedPending;\n\t\t}\n\t};\n\n\tconst subscribeFlowStateForHandle = (\n\t\tflowHandleId: FlowHandleId,\n\t\tcallback: FlowStateCallback,\n\t\toptions?: SubscribeFlowStateOptions,\n\t): (() => void) => {\n\t\tif (options?.emitInitial ?? true) {\n\t\t\tcallback(getFlowStateForHandle(flowHandleId));\n\t\t}\n\t\treturn hostEventHub.subscribeFlowStateForHandle(\n\t\t\tflowHandleId,\n\t\t\t(detail): void => {\n\t\t\t\tconst nextState: FlowState = {\n\t\t\t\t\tisOpen: detail.isOpen,\n\t\t\t\t\tisLoading: detail.isLoading,\n\t\t\t\t\twidth: detail.width,\n\t\t\t\t\theight: detail.height,\n\t\t\t\t};\n\t\t\t\tsetFlowStateForHandle(flowHandleId, nextState);\n\t\t\t\tcallback(cloneFlowState(nextState));\n\t\t\t},\n\t\t\t{ signal: options?.signal },\n\t\t);\n\t};\n\n\tconst subscribeFlowStateForInstance = (\n\t\tcallback: FlowStateCallback,\n\t\toptions?: SubscribeFlowStateOptions,\n\t): (() => void) => {\n\t\tif (options?.emitInitial ?? true) {\n\t\t\tcallback(getInstanceFlowState());\n\t\t}\n\t\treturn hostEventHub.subscribeInstanceFlowState(\n\t\t\t(detail): void => {\n\t\t\t\tconst nextState: FlowState = {\n\t\t\t\t\tisOpen: detail.isOpen,\n\t\t\t\t\tisLoading: detail.isLoading,\n\t\t\t\t\twidth: detail.width,\n\t\t\t\t\theight: detail.height,\n\t\t\t\t};\n\t\t\t\tcallback(cloneFlowState(nextState));\n\t\t\t},\n\t\t\t{ signal: options?.signal },\n\t\t);\n\t};\n\n\tconst resetFlowRunsForClientBarrier = new Set<() => void>();\n\tlet deferredFlowRunNotifications: Array<() => void> | null = null;\n\n\tfunction createFlowRun(target: { flowId: string }): FlowRun;\n\tfunction createFlowRun(target: { flow: InlineFlow }): InlineFlowRun;\n\tfunction createFlowRun(target: FlowRunTarget): FlowRun | InlineFlowRun {\n\t\tconst openRequestController = createFlowOpenRequestController();\n\t\tlet latestContainer: HTMLElement | null | undefined;\n\t\tlet unsubscribeFlowStateCache: (() => void) | null = null;\n\t\ttype SubscriberEntry = {\n\t\t\tcallback: FlowStateCallback;\n\t\t\toptions?: SubscribeFlowStateOptions;\n\t\t\tunsubscribe: (() => void) | null;\n\t\t};\n\t\tconst activeSubscribers = new Set<SubscriberEntry>();\n\t\tconst handleClient = createFlowCommandHandleController<\n\t\t\tFlowHandleId,\n\t\t\t{\n\t\t\t\tok: boolean;\n\t\t\t\tkind: string;\n\t\t\t\tresult?: unknown;\n\t\t\t}\n\t\t>({\n\t\t\tgetHandleIdFromSettlement: (settlement) => {\n\t\t\t\tconst handle = getFlowHandleFromSettlementDetail(settlement);\n\t\t\t\treturn handle?.flowHandleId;\n\t\t\t},\n\t\t\tisStaleHandleError,\n\t\t\tonClearResolvedHandle: (previousFlowHandleId) => {\n\t\t\t\tclaimedFlowStateHandles.delete(previousFlowHandleId);\n\t\t\t\tpendingFlowStateHandles.delete(previousFlowHandleId);\n\t\t\t\tif (unsubscribeFlowStateCache) {\n\t\t\t\t\tunsubscribeFlowStateCache();\n\t\t\t\t\tunsubscribeFlowStateCache = null;\n\t\t\t\t}\n\t\t\t\tsetFlowStateForHandle(previousFlowHandleId, DEFAULT_FLOW_STATE);\n\t\t\t\trebindSubscribersToCurrentHandle();\n\t\t\t\tconst subscribersAtReset = [...activeSubscribers];\n\t\t\t\tconst notify = (): void =>\n\t\t\t\t\tnotifySubscribersWithDefaultState(subscribersAtReset);\n\t\t\t\tif (deferredFlowRunNotifications) {\n\t\t\t\t\tdeferredFlowRunNotifications.push(notify);\n\t\t\t\t} else {\n\t\t\t\t\tnotify();\n\t\t\t\t}\n\t\t\t},\n\t\t});\n\n\t\tconst bindSubscriberToCurrentHandle = (\n\t\t\tsubscriber: SubscriberEntry,\n\t\t\temitCurrent = false,\n\t\t): void => {\n\t\t\tif (subscriber.unsubscribe) {\n\t\t\t\tsubscriber.unsubscribe();\n\t\t\t\tsubscriber.unsubscribe = null;\n\t\t\t}\n\t\t\tif (subscriber.options?.signal?.aborted) {\n\t\t\t\tactiveSubscribers.delete(subscriber);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst flowHandleId = handleClient.getHandleId();\n\t\t\tif (!flowHandleId) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst notifySubscriber = (state: FlowState): void => {\n\t\t\t\ttry {\n\t\t\t\t\tsubscriber.callback(state);\n\t\t\t\t} catch {\n\t\t\t\t\t// Public observers cannot interrupt handle publication or prevent\n\t\t\t\t\t// the remaining lifecycle projections from binding.\n\t\t\t\t}\n\t\t\t};\n\t\t\tconst unsubscribe = subscribeFlowStateForHandle(\n\t\t\t\tflowHandleId,\n\t\t\t\tnotifySubscriber,\n\t\t\t\temitCurrent\n\t\t\t\t\t? { ...subscriber.options, emitInitial: true }\n\t\t\t\t\t: subscriber.options,\n\t\t\t);\n\t\t\tif (subscriber.options?.signal?.aborted) {\n\t\t\t\tunsubscribe();\n\t\t\t\tactiveSubscribers.delete(subscriber);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (\n\t\t\t\thandleClient.getHandleId() !== flowHandleId ||\n\t\t\t\t!activeSubscribers.has(subscriber)\n\t\t\t) {\n\t\t\t\tunsubscribe();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsubscriber.unsubscribe = unsubscribe;\n\t\t};\n\n\t\tconst rebindSubscribersToCurrentHandle = (emitCurrent = false): void => {\n\t\t\tfor (const subscriber of activeSubscribers) {\n\t\t\t\tbindSubscriberToCurrentHandle(subscriber, emitCurrent);\n\t\t\t}\n\t\t};\n\n\t\tconst notifySubscribersWithDefaultState = (\n\t\t\tsubscribersAtReset: readonly SubscriberEntry[],\n\t\t): void => {\n\t\t\tfor (const subscriber of subscribersAtReset) {\n\t\t\t\tif (!activeSubscribers.has(subscriber)) continue;\n\t\t\t\ttry {\n\t\t\t\t\tsubscriber.callback(cloneFlowState(DEFAULT_FLOW_STATE));\n\t\t\t\t} catch {\n\t\t\t\t\t// A subscriber cannot prevent later reset observers from seeing the\n\t\t\t\t\t// already-completed client-wide transition.\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tconst rebindFlowStateCache = (): void => {\n\t\t\tif (unsubscribeFlowStateCache) {\n\t\t\t\tunsubscribeFlowStateCache();\n\t\t\t\tunsubscribeFlowStateCache = null;\n\t\t\t}\n\t\t\tconst flowHandleId = handleClient.getHandleId();\n\t\t\tif (!flowHandleId) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tunsubscribeFlowStateCache =\n\t\t\t\tsubscribeFlowStateCacheForHandle(flowHandleId);\n\t\t};\n\n\t\tconst clearOpenIntent = (): void => {\n\t\t\topenRequestController.clear();\n\t\t};\n\n\t\tconst flushPendingForResolvedHandle = (): void => {\n\t\t\tconst flowHandleId = handleClient.getHandleId();\n\t\t\tif (!flowHandleId) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst shouldReplayPendingState =\n\t\t\t\tpendingFlowStateHandles.delete(flowHandleId);\n\t\t\tclaimedFlowStateHandles.add(flowHandleId);\n\t\t\tensureFlowStateForHandle(flowHandleId);\n\t\t\tif (latestContainer !== undefined) {\n\t\t\t\tenqueueSetContainer(flowHandleId, latestContainer);\n\t\t\t}\n\t\t\trebindSubscribersToCurrentHandle(shouldReplayPendingState);\n\t\t\trebindFlowStateCache();\n\t\t};\n\n\t\thandleClient.subscribeHandle(() => {\n\t\t\tflushPendingForResolvedHandle();\n\t\t});\n\t\tsubscribeFlowHandleInvalidation((flowHandleId) => {\n\t\t\thandleClient.invalidateResolvedHandle(flowHandleId);\n\t\t});\n\t\ttype HandleCommandPayload =\n\t\t\t| Extract<\n\t\t\t\t\tCommand,\n\t\t\t\t\t{ kind: \"open\" } | { kind: \"prefetch\" } | { kind: \"prerender\" }\n\t\t\t >\n\t\t\t| InternalHostInlineFlowCommandPayload;\n\n\t\tconst handOffHandleCommand = (payload: HandleCommandPayload) =>\n\t\t\t\"flow\" in payload\n\t\t\t\t? handOffInlineFlowCommand(payload)\n\t\t\t\t: handOffCommand(payload);\n\n\t\tconst enqueueAndWaitForSettlement = async (\n\t\t\tbuildPayload: (\n\t\t\t\tflowHandleId: FlowHandleId | undefined,\n\t\t\t) => HandleCommandPayload,\n\t\t): Promise<\"settled\" | \"superseded\"> => {\n\t\t\tconst result = await transportAdmission.runOperation(\n\t\t\t\t({ attemptHandoff }) => {\n\t\t\t\t\tlet releaseFlowHandleAllocation: (() => void) | null = null;\n\t\t\t\t\treturn handleClient\n\t\t\t\t\t\t.runCommand(buildPayload, (payload) => {\n\t\t\t\t\t\t\tconst isHandleFree =\n\t\t\t\t\t\t\t\t!(\"flowHandleId\" in payload) ||\n\t\t\t\t\t\t\t\tpayload.flowHandleId === undefined;\n\t\t\t\t\t\t\tconst requiresSerializedAllocation =\n\t\t\t\t\t\t\t\t\"flow\" in target && isHandleFree;\n\t\t\t\t\t\t\tconst handOff = (): Promise<{\n\t\t\t\t\t\t\t\tok: boolean;\n\t\t\t\t\t\t\t\tkind: string;\n\t\t\t\t\t\t\t\tresult?: unknown;\n\t\t\t\t\t\t\t}> =>\n\t\t\t\t\t\t\t\tattemptHandoff({\n\t\t\t\t\t\t\t\t\tprepare:\n\t\t\t\t\t\t\t\t\t\t\"flow\" in target\n\t\t\t\t\t\t\t\t\t\t\t? prepareInlineFlowCommandHandoff\n\t\t\t\t\t\t\t\t\t\t\t: prepareCommandHandoff,\n\t\t\t\t\t\t\t\t\thandOff: () => ({\n\t\t\t\t\t\t\t\t\t\tsettlement: handOffHandleCommand(payload),\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tif (!requiresSerializedAllocation) {\n\t\t\t\t\t\t\t\treturn handOff();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst handOffAllocation = () =>\n\t\t\t\t\t\t\t\thandOff().catch((error) => {\n\t\t\t\t\t\t\t\t\tclearPendingFlowHandleState();\n\t\t\t\t\t\t\t\t\tthrow error;\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tif (releaseFlowHandleAllocation) {\n\t\t\t\t\t\t\t\treturn handOffAllocation();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst acquisition = acquireFlowHandleAllocation();\n\t\t\t\t\t\t\tif (typeof acquisition === \"function\") {\n\t\t\t\t\t\t\t\treleaseFlowHandleAllocation = acquisition;\n\t\t\t\t\t\t\t\tbeginFlowHandleAllocation();\n\t\t\t\t\t\t\t\treturn handOffAllocation();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn acquisition.then((release) => {\n\t\t\t\t\t\t\t\treleaseFlowHandleAllocation = release;\n\t\t\t\t\t\t\t\tbeginFlowHandleAllocation();\n\t\t\t\t\t\t\t\treturn handOffAllocation();\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.finally(() => {\n\t\t\t\t\t\t\tif (releaseFlowHandleAllocation) {\n\t\t\t\t\t\t\t\tendFlowHandleAllocation();\n\t\t\t\t\t\t\t\treleaseFlowHandleAllocation();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t);\n\t\t\treturn result.status;\n\t\t};\n\n\t\tconst openFlow = (options?: OpenFlowOptions): Promise<void> => {\n\t\t\treturn openRequestController.run(() =>\n\t\t\t\treportAsyncError(\n\t\t\t\t\tenqueueAndWaitForSettlement((flowHandleId) =>\n\t\t\t\t\t\t\"flow\" in target\n\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\tkind: \"open\",\n\t\t\t\t\t\t\t\t\tflow: target.flow,\n\t\t\t\t\t\t\t\t\t...(flowHandleId === undefined ? {} : { flowHandleId }),\n\t\t\t\t\t\t\t\t\t...(flowHandleId === undefined &&\n\t\t\t\t\t\t\t\t\tlatestContainer !== undefined\n\t\t\t\t\t\t\t\t\t\t? { container: null }\n\t\t\t\t\t\t\t\t\t\t: {}),\n\t\t\t\t\t\t\t\t\tmetadata: options?.metadata,\n\t\t\t\t\t\t\t\t\thideCloseButton: options?.hideCloseButton,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\t\tkind: \"open\",\n\t\t\t\t\t\t\t\t\tflowId: target.flowId,\n\t\t\t\t\t\t\t\t\tflowHandleId,\n\t\t\t\t\t\t\t\t\tcontainer: options?.container,\n\t\t\t\t\t\t\t\t\tmetadata: options?.metadata,\n\t\t\t\t\t\t\t\t\thideCloseButton: options?.hideCloseButton,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t).then(() => {}),\n\t\t\t\t),\n\t\t\t);\n\t\t};\n\n\t\tconst resetForClientBarrier = (): void => {\n\t\t\tclearOpenIntent();\n\t\t\thandleClient.reset();\n\t\t};\n\t\tresetFlowRunsForClientBarrier.add(resetForClientBarrier);\n\n\t\tconst run: InlineFlowRun = {\n\t\t\topen: openFlow,\n\t\t\tprefetch: () => {\n\t\t\t\treturn reportAsyncError(\n\t\t\t\t\tenqueueAndWaitForSettlement((flowHandleId) =>\n\t\t\t\t\t\t\"flow\" in target\n\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\tkind: \"prefetch\",\n\t\t\t\t\t\t\t\t\tflow: target.flow,\n\t\t\t\t\t\t\t\t\t...(flowHandleId === undefined ? {} : { flowHandleId }),\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\t\tkind: \"prefetch\",\n\t\t\t\t\t\t\t\t\tflowId: target.flowId,\n\t\t\t\t\t\t\t\t\tflowHandleId,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t).then(() => {}),\n\t\t\t\t);\n\t\t\t},\n\t\t\tprerender: (options?: PrerenderFlowOptions) => {\n\t\t\t\treturn reportAsyncError(\n\t\t\t\t\tenqueueAndWaitForSettlement((flowHandleId) =>\n\t\t\t\t\t\t\"flow\" in target\n\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\tkind: \"prerender\",\n\t\t\t\t\t\t\t\t\tflow: target.flow,\n\t\t\t\t\t\t\t\t\t...(flowHandleId === undefined ? {} : { flowHandleId }),\n\t\t\t\t\t\t\t\t\thideCloseButton: options?.hideCloseButton,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\t\tkind: \"prerender\",\n\t\t\t\t\t\t\t\t\tflowId: target.flowId,\n\t\t\t\t\t\t\t\t\tflowHandleId,\n\t\t\t\t\t\t\t\t\thideCloseButton: options?.hideCloseButton,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t).then(() => {}),\n\t\t\t\t);\n\t\t\t},\n\t\t\tclose: () => {\n\t\t\t\tclearOpenIntent();\n\t\t\t\treturn reportAsyncError(\n\t\t\t\t\ttransportAdmission\n\t\t\t\t\t\t.runOperation(({ attemptHandoff }) => {\n\t\t\t\t\t\t\treturn handleClient.runResolvedHandleCommand(\n\t\t\t\t\t\t\t\t(flowHandleId) => ({\n\t\t\t\t\t\t\t\t\tkind: \"close\" as const,\n\t\t\t\t\t\t\t\t\tflowHandleId,\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t(payload) =>\n\t\t\t\t\t\t\t\t\tattemptHandoff({\n\t\t\t\t\t\t\t\t\t\tprepare:\n\t\t\t\t\t\t\t\t\t\t\t\"flow\" in target\n\t\t\t\t\t\t\t\t\t\t\t\t? prepareInlineFlowCommandHandoff\n\t\t\t\t\t\t\t\t\t\t\t\t: prepareCommandHandoff,\n\t\t\t\t\t\t\t\t\t\thandOff: () => ({\n\t\t\t\t\t\t\t\t\t\t\tsettlement: handOffCommand(payload).then(() => {}),\n\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.then(() => {}),\n\t\t\t\t);\n\t\t\t},\n\t\t\tsetContainer: (element: HTMLElement | null) => {\n\t\t\t\tlatestContainer = element;\n\t\t\t\tconst flowHandleId = handleClient.getHandleId();\n\t\t\t\tif (!flowHandleId) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tenqueueSetContainer(flowHandleId, element);\n\t\t\t},\n\t\t\tgetFlowState: () => {\n\t\t\t\tconst flowHandleId = handleClient.getHandleId();\n\t\t\t\treturn flowHandleId\n\t\t\t\t\t? getFlowStateForHandle(flowHandleId)\n\t\t\t\t\t: cloneFlowState(DEFAULT_FLOW_STATE);\n\t\t\t},\n\t\t\tsubscribeFlowState: (\n\t\t\t\tcallback: FlowStateCallback,\n\t\t\t\toptions?: SubscribeFlowStateOptions,\n\t\t\t) => {\n\t\t\t\tif (options?.signal?.aborted) {\n\t\t\t\t\treturn () => {};\n\t\t\t\t}\n\t\t\t\tconst subscriber: SubscriberEntry = {\n\t\t\t\t\tcallback,\n\t\t\t\t\toptions,\n\t\t\t\t\tunsubscribe: null,\n\t\t\t\t};\n\t\t\t\tactiveSubscribers.add(subscriber);\n\t\t\t\tconst unsubscribeSubscriber = (): void => {\n\t\t\t\t\tif (subscriber.unsubscribe) {\n\t\t\t\t\t\tsubscriber.unsubscribe();\n\t\t\t\t\t\tsubscriber.unsubscribe = null;\n\t\t\t\t\t}\n\t\t\t\t\tactiveSubscribers.delete(subscriber);\n\t\t\t\t};\n\t\t\t\tconst flowHandleId = handleClient.getHandleId();\n\t\t\t\tif (!flowHandleId) {\n\t\t\t\t\tconst signal = options?.signal;\n\t\t\t\t\tif (signal) {\n\t\t\t\t\t\tconst onAbort = (): void => {\n\t\t\t\t\t\t\tsubscriber.unsubscribe = null;\n\t\t\t\t\t\t\tactiveSubscribers.delete(subscriber);\n\t\t\t\t\t\t};\n\t\t\t\t\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t\t\t\t\t\tsubscriber.unsubscribe = () => {\n\t\t\t\t\t\t\tsignal.removeEventListener(\"abort\", onAbort);\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\tif (options?.emitInitial !== false) {\n\t\t\t\t\t\tcallback(cloneFlowState(DEFAULT_FLOW_STATE));\n\t\t\t\t\t}\n\t\t\t\t\treturn unsubscribeSubscriber;\n\t\t\t\t}\n\t\t\t\tbindSubscriberToCurrentHandle(subscriber);\n\t\t\t\treturn unsubscribeSubscriber;\n\t\t\t},\n\t\t};\n\n\t\treturn \"flow\" in target ? run : { flowId: target.flowId, ...run };\n\t}\n\n\tconst flowRunByFlowId = new Map<string, FlowRun>();\n\tconst flow = (flowIdInput: string): FlowRun => {\n\t\tconst flowId = flowIdInput.trim();\n\t\tif (!flowId) {\n\t\t\tthrow new Error(\"flowId must be a non-empty string\");\n\t\t}\n\t\tconst existing = flowRunByFlowId.get(flowId);\n\t\tif (existing) return existing;\n\t\tconst run = createFlowRun({ flowId });\n\t\tflowRunByFlowId.set(flowId, run);\n\t\treturn run;\n\t};\n\n\tconst runClientBarrier = (kind: \"close\" | \"reset\"): Promise<void> => {\n\t\tconst flowRunResets = [...resetFlowRunsForClientBarrier];\n\t\treturn reportAsyncError(\n\t\t\ttransportAdmission.runBarrier({\n\t\t\t\tonGenerationAdvanced: () => {\n\t\t\t\t\tconst notifications: Array<() => void> = [];\n\t\t\t\t\tdeferredFlowRunNotifications = notifications;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tfor (const resetFlowRun of flowRunResets) {\n\t\t\t\t\t\t\tresetFlowRun();\n\t\t\t\t\t\t}\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tdeferredFlowRunNotifications = null;\n\t\t\t\t\t}\n\t\t\t\t\tfor (const notify of notifications) {\n\t\t\t\t\t\tnotify();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tprepare: hostWindow ? prepareCommandHandoff : () => {},\n\t\t\t\thandOff: hostWindow\n\t\t\t\t\t? () => ({ settlement: handOffCommand({ kind }).then(() => {}) })\n\t\t\t\t\t: () => ({ settlement: Promise.resolve() }),\n\t\t\t}),\n\t\t);\n\t};\n\n\tconst close = (): Promise<void> => runClientBarrier(\"close\");\n\n\tconst reset = (): Promise<void> => runClientBarrier(\"reset\");\n\n\tfunction identify(\n\t\tuserId: string,\n\t\ttraits?: IdentifyTraits,\n\t\toptions?: IdentifyOptions,\n\t): Promise<void>;\n\tfunction identify(\n\t\ttraits: IdentifyTraits,\n\t\toptions?: IdentifyOptions,\n\t): Promise<void>;\n\tfunction identify(\n\t\tidentifyInput: string | IdentifyTraits,\n\t\ttraitsOrOptions?: IdentifyTraits | IdentifyOptions,\n\t\toptions?: IdentifyOptions,\n\t): Promise<void> {\n\t\tif (!hostWindow) {\n\t\t\treturn Promise.resolve();\n\t\t}\n\t\treturn reportAsyncError(\n\t\t\tdispatch(\n\t\t\t\ttoIdentifyCommandPayload(identifyInput, traitsOrOptions, options),\n\t\t\t),\n\t\t);\n\t}\n\n\tconst track = (\n\t\teventName: string,\n\t\tproperties?: EventProperties,\n\t\toptions?: EventOptions,\n\t): Promise<void> => {\n\t\tif (!hostWindow) {\n\t\t\tparseCustomerOccurrenceName(eventName, \"eventName\");\n\t\t\treturn Promise.resolve();\n\t\t}\n\t\treturn reportAsyncError(\n\t\t\tdispatch(\n\t\t\t\tbuildCustomerOccurrenceCommand({\n\t\t\t\t\ttype: \"track\",\n\t\t\t\t\tevent: eventName,\n\t\t\t\t\tproperties,\n\t\t\t\t\toptions,\n\t\t\t\t}),\n\t\t\t),\n\t\t);\n\t};\n\n\tconst page = (\n\t\tname?: string,\n\t\tproperties?: EventProperties,\n\t\toptions?: EventOptions,\n\t): Promise<void> => {\n\t\tif (!hostWindow) {\n\t\t\tif (name !== undefined) {\n\t\t\t\tparseCustomerOccurrenceName(name, \"pageName\");\n\t\t\t}\n\t\t\treturn Promise.resolve();\n\t\t}\n\t\treturn reportAsyncError(\n\t\t\tdispatch(\n\t\t\t\tbuildCustomerOccurrenceCommand({\n\t\t\t\t\ttype: \"page\",\n\t\t\t\t\tevent:\n\t\t\t\t\t\tname === undefined ? hostWindow.location.pathname || \"/\" : name,\n\t\t\t\t\tproperties,\n\t\t\t\t\toptions,\n\t\t\t\t}),\n\t\t\t),\n\t\t);\n\t};\n\n\tconst submitFeedback = async (\n\t\tinput: FeedbackInput,\n\t): Promise<SubmitFeedbackResult> => {\n\t\tif (!hostWindow) {\n\t\t\tthrow new Error(\"Feedback submission requires a browser environment.\");\n\t\t}\n\t\tensureCommandsCanRun();\n\t\tconst registrationProbe = pendingRegistrationProbe;\n\t\tif (registrationProbe) {\n\t\t\tawait registrationProbe;\n\t\t}\n\t\tconst settlement = await reportAsyncError(\n\t\t\trawSettlementDispatch({\n\t\t\t\tkind: \"instanceFeedback.capture\",\n\t\t\t\tpayload: input,\n\t\t\t}),\n\t\t);\n\t\tif (!settlement.ok) {\n\t\t\tthrow new Error(\"Feedback submission failed.\");\n\t\t}\n\t\tconst result = getFeedbackSubmissionFromSettlementDetail(settlement);\n\t\tif (!result) {\n\t\t\tthrow new Error(\"Invalid feedback submission result.\");\n\t\t}\n\t\treturn result;\n\t};\n\n\tconst fetchFeedback = async (\n\t\tinput: FetchFeedbackInput,\n\t): Promise<FetchFeedbackResult> => {\n\t\tif (!hostWindow) {\n\t\t\tthrow new Error(\"Feedback reads require a browser environment.\");\n\t\t}\n\t\tensureCommandsCanRun();\n\t\tconst registrationProbe = pendingRegistrationProbe;\n\t\tif (registrationProbe) {\n\t\t\tawait registrationProbe;\n\t\t}\n\t\tconst settlement = await reportAsyncError(\n\t\t\trawSettlementDispatch({\n\t\t\t\tkind: \"instanceFeedback.listMine\",\n\t\t\t\tpayload: input,\n\t\t\t}),\n\t\t);\n\t\tif (!settlement.ok) {\n\t\t\tthrow new Error(\"Feedback read failed.\");\n\t\t}\n\t\tconst result = getFeedbackReadFromSettlementDetail(settlement);\n\t\tif (!result) {\n\t\t\tthrow new Error(\"Invalid feedback read result.\");\n\t\t}\n\t\treturn result;\n\t};\n\n\tconst configure = (updates: ConfigureOptions): Promise<void> => {\n\t\tif (!hostWindow) {\n\t\t\treturn Promise.resolve();\n\t\t}\n\t\tif (!isLoaderRequested()) {\n\t\t\treturn Promise.resolve();\n\t\t}\n\t\t// Send updates as-is; loader merges and forwards deltas to core.\n\t\treturn reportAsyncError(\n\t\t\tdispatch({ kind: \"configure\", opts: toConfigureCommandOptions(updates) }),\n\t\t);\n\t};\n\n\thostEventHub.subscribeOpenRequested((detail, hostEvent) => {\n\t\topenRequestBridge.observeFromLoader(detail, {\n\t\t\tpreventHostDefault: () => {\n\t\t\t\thostEvent.preventDefault();\n\t\t\t},\n\t\t});\n\t});\n\thostEventHub.subscribeHostActionRequested((detail, hostEvent) => {\n\t\tconst handler = actionRegistry.getHandler(detail.definition);\n\t\tif (!handler) {\n\t\t\tdetail.settle(\"unavailable\");\n\t\t\treturn;\n\t\t}\n\t\t// This adapter event stays inside the trusted host realm. Sandboxed Views\n\t\t// can request an action only through Core's empty, authorized RPC.\n\t\thostEvent.preventDefault();\n\t\tvoid Promise.resolve()\n\t\t\t.then(() => handler())\n\t\t\t.then(\n\t\t\t\t() => detail.settle(\"success\"),\n\t\t\t\t() => detail.settle(\"failure\"),\n\t\t\t);\n\t});\n\n\tconst client: Client = {\n\t\tload,\n\t\tsetDefaultContainerPolicy: (policy: ContainerPolicy) => {\n\t\t\tenqueueSetDefaultContainerPolicy(policy);\n\t\t},\n\t\tgetFlowState: () => getInstanceFlowState(),\n\t\tsubscribeFlowState: (\n\t\t\tcallback: FlowStateCallback,\n\t\t\toptions?: SubscribeFlowStateOptions,\n\t\t) => subscribeFlowStateForInstance(callback, options),\n\t\tflow,\n\t\tclose,\n\t\treset,\n\t\tconfigure,\n\t\tidentify,\n\t\ttrack,\n\t\tpage,\n\t\tgraph: {\n\t\t\tconnect: (relationship) =>\n\t\t\t\ttrack(\"gx.graph.relationship.connected\", relationship),\n\t\t\tdisconnect: (relationship) =>\n\t\t\t\ttrack(\"gx.graph.relationship.disconnected\", relationship),\n\t\t},\n\t\tfeedback: { fetch: fetchFeedback, submit: submitFeedback },\n\t\tonOpenRequested: (callback) => openRequestBridge.subscribe(callback),\n\t};\n\tattachInlineFlowClientBridge(client, {\n\t\tcreateInlineFlowRun: (inlineFlow) => createFlowRun({ flow: inlineFlow }),\n\t});\n\n\topenRequestBridgeByClient.set(client, openRequestBridge);\n\n\tregistry.set(registryKey, {\n\t\tclient,\n\t\tupdateOptions,\n\t});\n\n\tif (!disableAutoLoadConfig) {\n\t\tclient.load();\n\t}\n\n\treturn client;\n};\n",
20
- "import {\n\tINLINE_FLOW_PERSISTED_IDENTITY_FIELDS,\n\ttype InlineFlow,\n\tinlineFlowSchema,\n} from \"@getuserfeedback/protocol/internal/inline-flow\";\nimport type { Client, FlowRun, OpenFlowOptions } from \"../client\";\nimport { getInlineFlowClientBridge } from \"./inline-flow-client-bridge\";\n\nexport type { BundledDocsClientOptions } from \"../client\";\nexport { createBundledDocsClientOptions } from \"../client\";\n\n/** Internal supplied-flow run using the normal Flow lifecycle. */\nexport type InlineFlowRun = Omit<FlowRun, \"flowId\" | \"open\"> & {\n\topen: (options?: Omit<OpenFlowOptions, \"container\">) => Promise<void>;\n};\n\nconst ARRAY_INDEX_KEY_PATTERN = /^(0|[1-9]\\d*)$/;\n\nconst invalidJsonSnapshot = (): never => {\n\tthrow new Error(\"Inline flow must contain only JSON values.\");\n};\n\nconst toJsonSnapshot = (\n\tvalue: unknown,\n\tancestors = new Set<object>(),\n): unknown => {\n\tif (\n\t\tvalue === null ||\n\t\ttypeof value === \"string\" ||\n\t\ttypeof value === \"boolean\"\n\t) {\n\t\treturn value;\n\t}\n\tif (typeof value === \"number\") {\n\t\treturn Number.isFinite(value) ? value : invalidJsonSnapshot();\n\t}\n\tif (typeof value !== \"object\" || ancestors.has(value)) {\n\t\treturn invalidJsonSnapshot();\n\t}\n\n\tancestors.add(value);\n\ttry {\n\t\tif (Array.isArray(value)) {\n\t\t\tif (Object.getPrototypeOf(value) !== Array.prototype) {\n\t\t\t\treturn invalidJsonSnapshot();\n\t\t\t}\n\t\t\tconst ownKeys = Reflect.ownKeys(value);\n\t\t\tif (\n\t\t\t\townKeys.length !== value.length + 1 ||\n\t\t\t\townKeys.some(\n\t\t\t\t\t(key) =>\n\t\t\t\t\t\tkey !== \"length\" &&\n\t\t\t\t\t\t(typeof key !== \"string\" ||\n\t\t\t\t\t\t\t!ARRAY_INDEX_KEY_PATTERN.test(key) ||\n\t\t\t\t\t\t\tNumber(key) >= value.length),\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn invalidJsonSnapshot();\n\t\t\t}\n\t\t\tconst snapshot: unknown[] = [];\n\t\t\tfor (let index = 0; index < value.length; index += 1) {\n\t\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(\n\t\t\t\t\tvalue,\n\t\t\t\t\tString(index),\n\t\t\t\t);\n\t\t\t\tif (!descriptor?.enumerable || !(\"value\" in descriptor)) {\n\t\t\t\t\treturn invalidJsonSnapshot();\n\t\t\t\t}\n\t\t\t\tsnapshot.push(toJsonSnapshot(descriptor.value, ancestors));\n\t\t\t}\n\t\t\treturn snapshot;\n\t\t}\n\n\t\tconst prototype = Object.getPrototypeOf(value);\n\t\tif (prototype !== Object.prototype && prototype !== null) {\n\t\t\treturn invalidJsonSnapshot();\n\t\t}\n\t\tconst snapshot: Record<string, unknown> = {};\n\t\tfor (const key of Reflect.ownKeys(value)) {\n\t\t\tif (typeof key !== \"string\" || key === \"__proto__\") {\n\t\t\t\treturn invalidJsonSnapshot();\n\t\t\t}\n\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(value, key);\n\t\t\tif (!descriptor?.enumerable || !(\"value\" in descriptor)) {\n\t\t\t\treturn invalidJsonSnapshot();\n\t\t\t}\n\t\t\tif (descriptor.value === undefined) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tObject.defineProperty(snapshot, key, {\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: true,\n\t\t\t\tvalue: toJsonSnapshot(descriptor.value, ancestors),\n\t\t\t\twritable: true,\n\t\t\t});\n\t\t}\n\t\treturn snapshot;\n\t} finally {\n\t\tancestors.delete(value);\n\t}\n};\n\nconst snapshotInlineFlowInput = (flow: unknown): Record<string, unknown> => {\n\tif (\n\t\ttypeof flow !== \"object\" ||\n\t\tflow === null ||\n\t\tArray.isArray(flow) ||\n\t\t(Object.getPrototypeOf(flow) !== Object.prototype &&\n\t\t\tObject.getPrototypeOf(flow) !== null)\n\t) {\n\t\treturn invalidJsonSnapshot();\n\t}\n\treturn toJsonSnapshot(flow) as Record<string, unknown>;\n};\n\nconst freezeJsonSnapshot = <Value>(value: Value): Value => {\n\tif (typeof value !== \"object\" || value === null) {\n\t\treturn value;\n\t}\n\tfor (const child of Object.values(value)) {\n\t\tfreezeJsonSnapshot(child);\n\t}\n\treturn Object.freeze(value);\n};\n\nconst snapshotInlineFlow = (flow: InlineFlow): InlineFlow => {\n\tconst snapshot = inlineFlowSchema.parse(snapshotInlineFlowInput(flow));\n\tconst definition = snapshot.definition;\n\tif (\n\t\ttypeof definition === \"object\" &&\n\t\tdefinition !== null &&\n\t\t!Array.isArray(definition)\n\t) {\n\t\tconst field = INLINE_FLOW_PERSISTED_IDENTITY_FIELDS.find(\n\t\t\t(candidate) => candidate in definition,\n\t\t);\n\t\tif (field) {\n\t\t\tthrow new Error(\n\t\t\t\t`Inline flow definitions cannot include persisted field \"${field}\".`,\n\t\t\t);\n\t\t}\n\t}\n\treturn freezeJsonSnapshot(snapshot);\n};\n\n/** First-party supplied-flow entrypoint; intentionally absent from the public SDK root. */\nexport const createInlineFlow = (\n\tclient: Client,\n\tflow: InlineFlow,\n): InlineFlowRun =>\n\tgetInlineFlowClientBridge(client).createInlineFlowRun(\n\t\tsnapshotInlineFlow(flow),\n\t);\n\nexport type { InlineFlow };\n"
19
+ "import type {\n\tCaptureInstanceFeedbackRequest,\n\tCaptureInstanceFeedbackResponse,\n\tListInstanceFeedbackMineRequest,\n\tListInstanceFeedbackMineResponse,\n} from \"@getuserfeedback/protocol\";\nimport {\n\ttype AppEventCapability,\n\ttype AppEventFlag,\n\ttype AppEventIdentity,\n\tassertNoSegmentExternalIdsInValueArgument,\n\ttype CapabilitiesInput,\n\ttype ClientMeta,\n\ttype ClientOptions,\n\ttype Command,\n\ttype CommandEnvelope,\n\tCommandSettlementError,\n\tCommandSettlementTimeoutError,\n\ttype ConfigureOptions,\n\ttype ContainerPolicy,\n\tcreateCommandEnvelope,\n\tcreateCommandRequestId,\n\tcreateCommandSettlementDispatch,\n\tcreateFlowCommandHandleController,\n\ttype FlagsInput,\n\tgetFeedbackReadFromSettlementDetail,\n\tgetFeedbackSubmissionFromSettlementDetail,\n\tgetFlowHandleFromSettlementDetail,\n\ttype FlowRenderState as HostFlowRenderState,\n\ttype IdentifyOptions,\n\ttype InitOptions,\n\ttype LinkRouter,\n\tLOADER_RUNTIME_GLOBAL_KEY,\n\tLOADER_RUNTIME_PROTOCOL_VERSION,\n\tOPEN_URL_ACTION_CAPABILITY,\n\tOPEN_URL_ACTION_V1_CAPABILITY,\n\tOPEN_URL_ACTION_VERSION,\n\ttype ResponseMetadataInput,\n\tSDK_PROTOCOL_CAPABILITIES,\n\ttype WidgetLayoutTransitionPolicy,\n\twaitForCommandSettlement,\n} from \"@getuserfeedback/protocol/host\";\nimport { UNIFIED_FLOW_RUNTIME_V1_CAPABILITY } from \"@getuserfeedback/protocol/internal/core-host-command-settlement\";\nimport { suppliedOnlyLocalInitOptionsSchema } from \"@getuserfeedback/protocol/internal/core-init-options\";\nimport type { InternalHostCommandEnvelope } from \"@getuserfeedback/protocol/internal/host-command-envelope\";\nimport type {\n\tInternalHostInlineFlowCommandPayload,\n\tInternalHostSuppliedOnlyLocalInitCommandPayload,\n} from \"@getuserfeedback/protocol/internal/host-command-payload\";\nimport type { InlineFlow } from \"@getuserfeedback/protocol/internal/inline-flow\";\nimport { parseCustomerOccurrenceName } from \"@getuserfeedback/protocol/internal/sdk-event-options\";\nimport { createClientTransportAdmission } from \"./internal/client-transport-admission\";\nimport {\n\tbuildCustomerOccurrenceCommand,\n\ttype EventOptions,\n\ttype EventProperties,\n} from \"./internal/customer-occurrence-command\";\nimport { createFlowOpenRequestController } from \"./internal/flow-open-request-controller\";\nimport { toGraphRelationshipProperties } from \"./internal/graph-relationship-properties\";\nimport type { InlineFlowRun } from \"./internal/inline-flow\";\nimport { attachInlineFlowClientBridge } from \"./internal/inline-flow-client-bridge\";\nimport { invokeLinkRouter, resolveLinkRouter } from \"./internal/link-router\";\nimport { SDK_VERSION } from \"./version\";\n\nexport type {\n\tEventOptions,\n\tEventProperties,\n} from \"./internal/customer-occurrence-command\";\nexport type { ClientOptions };\n\n/** Feedback captured as an evaluation of the current app or a specific target. */\nexport type FeedbackInput = CaptureInstanceFeedbackRequest;\n\n/** Receipt returned after feedback has been accepted. */\nexport type SubmitFeedbackResult = CaptureInstanceFeedbackResponse;\n\n/** Selectors used to read the current authenticated user's feedback. */\nexport type FetchFeedbackInput = ListInstanceFeedbackMineRequest;\n\n/** Feedback matching each requested selector, in selector order. */\nexport type FetchFeedbackResult = ListInstanceFeedbackMineResponse;\n\n/** Operations for submitting and reading feedback through the current SDK client. */\nexport type FeedbackOperations = {\n\t/**\n\t * Read feedback matching each selector for the JWT-authenticated user.\n\t * Requires `auth.jwt` configuration; `identify()` alone does not authorize readback.\n\t */\n\tfetch: (input: FetchFeedbackInput) => Promise<FetchFeedbackResult>;\n\tsubmit: (input: FeedbackInput) => Promise<SubmitFeedbackResult>;\n};\n\n/** One endpoint in a directed relationship observation. Use `identities` for a user without a stable user ID. */\nexport type GraphEndpointIdentity =\n\t| AppEventIdentity\n\t| { type: `externalId.users.none.${string}`; value: string };\n\nexport type GraphRelationshipRef =\n\t| { collection: string; id: string; identities?: never }\n\t| { collection: \"user\"; identities: GraphEndpointIdentity[]; id?: never };\n\n/** A directed relationship observation recorded through the analytics pipeline. */\nexport type GraphRelationship = {\n\tfrom: GraphRelationshipRef;\n\tto: GraphRelationshipRef;\n};\n\n/** Operations for recording relationship observations as product events. */\nexport type GraphOperations = {\n\tconnect: (relationship: GraphRelationship) => Promise<void>;\n\tdisconnect: (relationship: GraphRelationship) => Promise<void>;\n};\n\nimport { type ActionRegistry, createActionRegistry } from \"./action-registry\";\nimport { createClientHostEventHub } from \"./client-host-event-hub\";\nimport { createOpenRequestBridge } from \"./open-request-bridge\";\nimport type { OpenRequestedEvent as OpenRequestDispatcherEvent } from \"./open-request-dispatcher\";\nimport { resolveStartupRuntimeUrls } from \"./runtime-url-defaults\";\n\n/** @internal */\ndeclare global {\n\tinterface Window {\n\t\t__getuserfeedback_queue?: Array<\n\t\t\tCommandEnvelope | InternalHostCommandEnvelope\n\t\t>;\n\t\t[LOADER_RUNTIME_GLOBAL_KEY]?: {\n\t\t\talive?: boolean;\n\t\t\tprotocolVersion?: string;\n\t\t\tfeatures?: readonly string[];\n\t\t};\n\t}\n}\n\ntype FlowHandleId = string;\n\ntype FlowRunTarget = { flowId: string } | { flow: InlineFlow };\n\n/** Durable state of a flow run (open/loading + dimensions when known). */\nexport interface FlowState extends HostFlowRenderState {\n\t/**\n\t * @deprecated Stop reading this field. SDK state snapshots and subscriptions\n\t * never populate it, and there is no replacement SDK state field.\n\t */\n\ttransitionPolicy?: WidgetLayoutTransitionPolicy;\n}\n\n/** Callback invoked when flow state changes. */\nexport type FlowStateCallback = (state: FlowState) => void;\ntype IdentifyTraits = Record<string, unknown>;\nexport type OpenRequestedEvent = OpenRequestDispatcherEvent;\nexport type OpenRequestedCallback = (event: OpenRequestedEvent) => void;\ntype StableJsonObject = { [key: string]: StableJsonValue };\ntype StableJsonValue =\n\t| string\n\t| number\n\t| boolean\n\t| null\n\t| StableJsonValue[]\n\t| StableJsonObject;\n\n/** Options for opening a flow run. */\nexport type OpenFlowOptions = {\n\t/** Host container used for this open request. Omit to use default floating mounting; pass null to wait for a custom container. */\n\tcontainer?: HTMLElement | null;\n\t/**\n\t * Optional response metadata to preserve with the eventual submission.\n\t * These tags are attached when the flow is opened and do not affect prerendering.\n\t */\n\tmetadata?: ResponseMetadataInput;\n\t/**\n\t * When `true`, the flow view does not show a close button.\n\t * Useful for mobile or embedded contexts where the host handles dismissal (e.g. via a drawer or back gesture).\n\t */\n\thideCloseButton?: boolean;\n};\n\n/** Options for prerendering a flow run. */\nexport type PrerenderFlowOptions = {\n\t/**\n\t * When `true`, the prerendered view does not show a close button.\n\t */\n\thideCloseButton?: boolean;\n};\n\n/** Options for subscribing to flow state updates. */\nexport type SubscribeFlowStateOptions = {\n\t/** Emit the current snapshot immediately. Default `true`. */\n\temitInitial?: boolean;\n\t/** Auto-unsubscribe when the signal is aborted. */\n\tsignal?: AbortSignal;\n};\n\nconst DEFAULT_FLOW_STATE: FlowState = {\n\tisOpen: false,\n\tisLoading: false,\n\twidth: undefined,\n\theight: undefined,\n};\nconst STALE_HANDLE_ERROR_CODE = \"STALE_HANDLE\" as const;\n\nconst isStaleHandleError = (error: unknown): boolean => {\n\tif (error instanceof CommandSettlementError) {\n\t\treturn error.code === STALE_HANDLE_ERROR_CODE;\n\t}\n\tif (!(error instanceof Error)) {\n\t\treturn false;\n\t}\n\treturn error.message.includes(\"flowHandleId is stale\");\n};\n\n/** Instance for a specific flow: open, prefetch, prerender, close, and subscribe to flow state. */\nexport type FlowRun = {\n\t/** The flow/survey ID this instance refers to. */\n\tflowId: string;\n\t/** Open the flow (show the survey). */\n\topen: (options?: OpenFlowOptions) => Promise<void>;\n\t/** Prefetch the flow so it opens faster when you call `open()`. */\n\tprefetch: () => Promise<void>;\n\t/** Prerender the flow into a container (e.g. for a custom dialog). */\n\tprerender: (options?: PrerenderFlowOptions) => Promise<void>;\n\t/** Attach or detach this flow to a specific host container. */\n\tsetContainer: (element: HTMLElement | null) => void;\n\t/** Close this flow. */\n\tclose: () => Promise<void>;\n\t/** Return the latest known flow state snapshot. */\n\tgetFlowState: () => FlowState;\n\t/** Subscribe to open/loading/dimensions; returns an unsubscribe function. */\n\tsubscribeFlowState: (\n\t\tcallback: FlowStateCallback,\n\t\toptions?: SubscribeFlowStateOptions,\n\t) => () => void;\n};\n\n/**\n * getuserfeedback client for loading the widget, opening flows, configuring\n * consent/auth, identifying users, and tracking events.\n *\n * @see https://getuserfeedback.com/docs/reference/javascript-sdk-reference\n */\nexport type Client = {\n\t/** Load the widget script. Call when you created the client with `disableAutoLoad: true`. */\n\tload: () => void;\n\t/** Set how this instance should choose default containers for flows. */\n\tsetDefaultContainerPolicy: (policy: ContainerPolicy) => void;\n\t/** Return the latest known instance-level flow state snapshot. */\n\tgetFlowState: () => FlowState;\n\t/** Subscribe to instance-level flow state updates (eg targeting-triggered opens). */\n\tsubscribeFlowState: (\n\t\tcallback: FlowStateCallback,\n\t\toptions?: SubscribeFlowStateOptions,\n\t) => () => void;\n\t/** Return a flow instance; call .open(), .prefetch(), .prerender(), .close() on it. */\n\tflow: (flowId: string) => FlowRun;\n\t/** Close all open flows. */\n\tclose: () => Promise<void>;\n\t/** Close all open flows, clear JWT authentication, and reset user identity. */\n\treset: () => Promise<void>;\n\t/**\n\t * Update color scheme, consent, or auth. Pass a fresh JWT here after login\n\t * and whenever your auth provider refreshes the session token. Await the\n\t * returned promise or handle its rejection when applying runtime updates.\n\t *\n\t * When using `disableAutoLoad`, call `load()` first. Calls made before `load()`\n\t * resolve without applying the update. Provide the initial color scheme,\n\t * default consent, and capabilities to `createClient()`; configure auth after\n\t * `load()`.\n\t *\n\t * @see https://getuserfeedback.com/docs/security-and-privacy/jwt-auth\n\t */\n\tconfigure: (updates: ConfigureOptions) => Promise<void>;\n\t/**\n\t * Associate the current user with a user ID, traits, and optional external IDs.\n\t *\n\t * Use `options.externalIds` for Segment-compatible identifiers from another\n\t * system. Without a user ID, pass options as `client.identify(traits, options)`,\n\t * or use `client.identify(traits, undefined, options)` when your call site needs\n\t * the explicit three-argument form. Do not put Segment-shaped `externalIds` in\n\t * traits. Some invalid arguments throw synchronously; other validation or\n\t * command-processing failures reject the returned promise.\n\t *\n\t * @see https://getuserfeedback.com/docs/guides/identity-resolution\n\t */\n\tidentify: {\n\t\t(\n\t\t\tuserId: string,\n\t\t\ttraits?: IdentifyTraits,\n\t\t\toptions?: IdentifyOptions,\n\t\t): Promise<void>;\n\t\t(\n\t\t\ttraits: IdentifyTraits,\n\t\t\tplaceholder: undefined,\n\t\t\toptions?: IdentifyOptions,\n\t\t): Promise<void>;\n\t\t(traits: IdentifyTraits, options?: IdentifyOptions): Promise<void>;\n\t};\n\t/**\n\t * Track a product event from the browser.\n\t *\n\t * Use `options.externalIds` when the event carries a Segment-compatible\n\t * identifier from another system. Do not put Segment-shaped `externalIds` in\n\t * properties. Some invalid arguments throw synchronously; other validation or\n\t * command-processing failures reject the returned promise.\n\t *\n\t * @see https://getuserfeedback.com/docs/reference/events\n\t */\n\ttrack: (\n\t\teventName: string,\n\t\tproperties?: EventProperties,\n\t\toptions?: EventOptions,\n\t) => Promise<void>;\n\t/**\n\t * Record the current browser page or a named page location. Some invalid\n\t * arguments throw synchronously; other validation or command-processing\n\t * failures reject the returned promise.\n\t */\n\tpage: (\n\t\tname?: string,\n\t\tproperties?: EventProperties,\n\t\toptions?: EventOptions,\n\t) => Promise<void>;\n\t/** Record directed relationship observations through the analytics pipeline. */\n\tgraph: GraphOperations;\n\t/** Submit feedback or read the authenticated user's matching feedback. */\n\tfeedback: FeedbackOperations;\n\t/** Subscribe to explicit SDK and client-side targeting open requests, or suppress them — for example if you know the user should not be interrupted.\n\t * For example, when the user is filling out a form, or is in the middle of a multi-step flow.\n\t * Prevention applies only to that presentation attempt; it does not create a\n\t * public retry schedule.\n\t *\n\t * @example — suppress open flow requests if the user is busy\n\t * ```ts\n\t * client.onOpenRequested((event) => {\n\t * if (userIsBusy()) {\n\t * event.preventDefault();\n\t * }\n\t * });\n\t * ```\n\t */\n\tonOpenRequested: (callback: OpenRequestedCallback) => () => void;\n};\n\ntype ClientRegistryEntry = {\n\tclient: Client;\n\tupdateOptions: (\n\t\toptions: ClientOptions,\n\t\tactionRegistry: ActionRegistry,\n\t\tlinkRouter: LinkRouter | undefined,\n\t) => void;\n};\n\nconst openRequestBridgeByClient = new WeakMap<\n\tClient,\n\tReturnType<typeof createOpenRequestBridge>\n>();\n\nconst clientRegistry = new Map<object, Map<string, ClientRegistryEntry>>();\n\nexport const getOpenRequestBridge = (\n\tclient: Client,\n): ReturnType<typeof createOpenRequestBridge> => {\n\tconst bridge = openRequestBridgeByClient.get(client);\n\tif (!bridge) {\n\t\tthrow new Error(\"Open request bridge not found for client instance.\");\n\t}\n\treturn bridge;\n};\n\nconst createClientInstanceId = (): string => {\n\tif (\n\t\ttypeof globalThis.crypto !== \"undefined\" &&\n\t\ttypeof globalThis.crypto.randomUUID === \"function\"\n\t) {\n\t\treturn globalThis.crypto.randomUUID();\n\t}\n\treturn `sdk-${Date.now()}-${Math.random().toString(16).slice(2)}`;\n};\n\nconst toIdentifyCommandPayload = (\n\tidentifyInput: string | IdentifyTraits,\n\ttraitsOrOptions?: IdentifyTraits | IdentifyOptions,\n\toptions?: IdentifyOptions,\n): Extract<Command, { kind: \"identify\" }> => {\n\tif (typeof identifyInput === \"string\") {\n\t\tassertNoSegmentExternalIdsInValueArgument({\n\t\t\targument: traitsOrOptions,\n\t\t\tcommandName: \"identify\",\n\t\t\tvalueArgumentName: \"traits\",\n\t\t\tcallShape: \"identify(userId, traits, { externalIds })\",\n\t\t});\n\t\treturn {\n\t\t\tkind: \"identify\",\n\t\t\tuserId: identifyInput,\n\t\t\ttraits: traitsOrOptions,\n\t\t\toptions,\n\t\t};\n\t}\n\tassertNoSegmentExternalIdsInValueArgument({\n\t\targument: identifyInput,\n\t\tcommandName: \"identify\",\n\t\tvalueArgumentName: \"traits\",\n\t\tcallShape: \"identify(traits, { externalIds })\",\n\t});\n\treturn {\n\t\tkind: \"identify\",\n\t\ttraits: identifyInput,\n\t\toptions: options ?? traitsOrOptions,\n\t};\n};\n\nconst toFlags = (input: FlagsInput | undefined): AppEventFlag[] | undefined => {\n\tif (input === undefined) {\n\t\treturn;\n\t}\n\tif (Array.isArray(input)) {\n\t\treturn input.map((flag) => ({ ...flag }));\n\t}\n\treturn Object.entries(input)\n\t\t.sort(([leftKey], [rightKey]) => leftKey.localeCompare(rightKey))\n\t\t.map(([key, value]) => ({ key, value }));\n};\n\nconst toCapabilities = (\n\tinput: CapabilitiesInput | undefined,\n): AppEventCapability[] | undefined => {\n\tif (input === undefined) {\n\t\treturn;\n\t}\n\treturn input.map((capability) =>\n\t\ttypeof capability === \"string\" ? { key: capability } : { ...capability },\n\t);\n};\n\nconst CIRCULAR_TARGETING_CONTEXT_ERROR =\n\t\"Targeting context cannot contain circular values\";\n\nconst toStableJsonValue = (\n\tvalue: unknown,\n\tancestors: WeakSet<object> = new WeakSet(),\n): StableJsonValue => {\n\tif (\n\t\tvalue === null ||\n\t\ttypeof value === \"string\" ||\n\t\ttypeof value === \"number\" ||\n\t\ttypeof value === \"boolean\"\n\t) {\n\t\treturn value;\n\t}\n\tif (Array.isArray(value)) {\n\t\tif (ancestors.has(value)) {\n\t\t\tthrow new Error(CIRCULAR_TARGETING_CONTEXT_ERROR);\n\t\t}\n\t\tancestors.add(value);\n\t\ttry {\n\t\t\treturn value.map((entryValue) =>\n\t\t\t\ttoStableJsonValue(entryValue, ancestors),\n\t\t\t);\n\t\t} finally {\n\t\t\tancestors.delete(value);\n\t\t}\n\t}\n\tif (typeof value === \"object\") {\n\t\tif (ancestors.has(value)) {\n\t\t\tthrow new Error(CIRCULAR_TARGETING_CONTEXT_ERROR);\n\t\t}\n\t\tancestors.add(value);\n\t\tconst objectValue: StableJsonObject = {};\n\t\ttry {\n\t\t\tfor (const [key, entryValue] of Object.entries(value).sort(\n\t\t\t\t([leftKey], [rightKey]) => leftKey.localeCompare(rightKey),\n\t\t\t)) {\n\t\t\t\tif (entryValue !== undefined) {\n\t\t\t\t\tobjectValue[key] = toStableJsonValue(entryValue, ancestors);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn objectValue;\n\t\t} finally {\n\t\t\tancestors.delete(value);\n\t\t}\n\t}\n\treturn null;\n};\n\nconst toCanonicalTargetingValues = (\n\tvalues: unknown[] | undefined,\n): StableJsonValue[] | null => {\n\tif (values === undefined || values.length === 0) {\n\t\treturn null;\n\t}\n\treturn values\n\t\t.map((value) => {\n\t\t\tconst stableValue = toStableJsonValue(value);\n\t\t\treturn { key: JSON.stringify(stableValue), value: stableValue };\n\t\t})\n\t\t.sort(({ key: leftKey }, { key: rightKey }) =>\n\t\t\tleftKey.localeCompare(rightKey),\n\t\t)\n\t\t.map(({ value }) => value);\n};\n\nconst resolveTargetingContextRegistryKey = (options: ClientOptions): string =>\n\tJSON.stringify({\n\t\tflags: toCanonicalTargetingValues(toFlags(options.flags)),\n\t\tcapabilities: toCanonicalTargetingValues(\n\t\t\ttoCapabilities(options.capabilities),\n\t\t),\n\t});\n\nconst LOADER_RUNTIME_PROBE_TIMEOUT_MS = 120;\n// Once Loader registration has been enqueued, it is ordinary command settlement\n// rather than a short ownership probe. Keep supplied-flow handoff behind that\n// settlement so Core capability negotiation can complete before admission.\nconst LOADER_RUNTIME_POST_LOAD_TIMEOUT_MS = 30_000;\nconst INVALID_COMMAND_ERROR_CODE = \"INVALID_COMMAND\";\nconst SUPPLIED_ONLY_LOCAL_CLIENT_OPTIONS_SYMBOL = Symbol.for(\n\t\"@getuserfeedback/sdk/internal/supplied-only-local-client-options/1\",\n);\nconst BUNDLED_DOCS_LOCAL_API_KEY = \"@getuserfeedback/internal/bundled-docs\";\n\ntype MarkedSuppliedOnlyLocalClientOptions = ClientOptions & {\n\t[SUPPLIED_ONLY_LOCAL_CLIENT_OPTIONS_SYMBOL]: true;\n};\ntype MaybeMarkedSuppliedOnlyLocalClientOptions = ClientOptions & {\n\t[SUPPLIED_ONLY_LOCAL_CLIENT_OPTIONS_SYMBOL]?: true;\n};\n\n/** Private runtime inputs for the deployment-owned bundled-docs client. */\nexport type BundledDocsClientOptions = {\n\tloaderUrl: string;\n\tcoreUrl: string;\n\tcolorScheme?: ClientOptions[\"colorScheme\"];\n\tdisableAutoLoad?: boolean;\n};\n\n/**\n * Build options that the public React provider can pass through to the SDK root\n * without exposing local registration in the public options type.\n * Pass the returned object intact; cloning or serializing it deliberately fails\n * closed instead of falling back to persisted registration.\n * See docs/specs/2026-08-02-flow-interaction-model.md.\n */\nexport const createBundledDocsClientOptions = (\n\toptions: BundledDocsClientOptions,\n): ClientOptions => {\n\tconst clientOptions: ClientOptions = {\n\t\tapiKey: BUNDLED_DOCS_LOCAL_API_KEY,\n\t\t_loaderUrl: options.loaderUrl,\n\t\t_coreUrl: options.coreUrl,\n\t\t...(options.colorScheme === undefined\n\t\t\t? {}\n\t\t\t: { colorScheme: options.colorScheme }),\n\t\t...(options.disableAutoLoad === undefined\n\t\t\t? {}\n\t\t\t: { disableAutoLoad: options.disableAutoLoad }),\n\t};\n\tObject.defineProperty(\n\t\tclientOptions,\n\t\tSUPPLIED_ONLY_LOCAL_CLIENT_OPTIONS_SYMBOL,\n\t\t{\n\t\t\tconfigurable: false,\n\t\t\tenumerable: false,\n\t\t\tvalue: true,\n\t\t\twritable: false,\n\t\t},\n\t);\n\treturn clientOptions;\n};\n\nconst isSuppliedOnlyLocalClientOptions = (\n\toptions: MaybeMarkedSuppliedOnlyLocalClientOptions,\n): options is MarkedSuppliedOnlyLocalClientOptions =>\n\toptions[SUPPLIED_ONLY_LOCAL_CLIENT_OPTIONS_SYMBOL] === true;\n\nconst resolveRegistryKey = (\n\toptions: ClientOptions,\n\tregistrationKind: \"persisted\" | \"supplied-only-local\",\n): string =>\n\t`${registrationKind}:${options.apiKey}:${resolveTargetingContextRegistryKey(options)}`;\n\nconst haveSameActionDefinitions = (left: string[], right: string[]): boolean =>\n\tJSON.stringify(left) === JSON.stringify(right);\n\nconst rejectAmbiguousLinkOwnership = (\n\tlinkRouter: LinkRouter | undefined,\n\tactionRegistry: ActionRegistry,\n): void => {\n\tif (linkRouter !== undefined && actionRegistry.getOpenUrlHandler()) {\n\t\tthrow new TypeError(\n\t\t\t\"links.router cannot be configured with actions open-url; choose one link owner\",\n\t\t);\n\t}\n};\n\nconst resolveRegistryScope = (): object =>\n\ttypeof window === \"undefined\" ? globalThis : window;\n\nconst getRegistryForScope = (): Map<string, ClientRegistryEntry> => {\n\tconst scope = resolveRegistryScope();\n\tconst existing = clientRegistry.get(scope);\n\tif (existing) {\n\t\treturn existing;\n\t}\n\tconst created = new Map<string, ClientRegistryEntry>();\n\tclientRegistry.set(scope, created);\n\treturn created;\n};\n\n/**\n * Create a getuserfeedback client. Reuses an existing logical client for the\n * same `apiKey` and targeting context. Host-action definitions may change\n * before loading starts; afterward, changing their canonical identities throws\n * while equivalent definitions refresh their handlers.\n */\nexport const createClient = (options: ClientOptions): Client => {\n\tconst suppliedOnlyLocal = isSuppliedOnlyLocalClientOptions(options);\n\tif (!suppliedOnlyLocal && options.apiKey === BUNDLED_DOCS_LOCAL_API_KEY) {\n\t\tthrow new Error(\n\t\t\t\"Bundled docs client options must be passed intact without cloning or serialization.\",\n\t\t);\n\t}\n\tconst {\n\t\tapiKey,\n\t\t_loaderUrl,\n\t\t_coreUrl,\n\t\t_apiUrl,\n\t\t_realtimeUrl,\n\t\tdisableAutoLoad = false,\n\t\tcolorScheme,\n\t\tdisableTelemetry = false,\n\t\tenableDebug = false,\n\t\tdefaultConsent,\n\t\tflags,\n\t\tcapabilities,\n\t\tactions,\n\t\tlinks,\n\t} = options;\n\tconst initialActionRegistry = createActionRegistry(actions);\n\tconst initialLinkRouter = resolveLinkRouter(links);\n\trejectAmbiguousLinkOwnership(initialLinkRouter, initialActionRegistry);\n\tconst registryKey = resolveRegistryKey(\n\t\t{\n\t\t\tapiKey,\n\t\t\t_loaderUrl,\n\t\t\t_coreUrl,\n\t\t\t_apiUrl,\n\t\t\t_realtimeUrl,\n\t\t\tdisableAutoLoad,\n\t\t\tcolorScheme,\n\t\t\tdisableTelemetry,\n\t\t\tenableDebug,\n\t\t\tdefaultConsent,\n\t\t\tflags,\n\t\t\tcapabilities,\n\t\t\tactions,\n\t\t},\n\t\tsuppliedOnlyLocal ? \"supplied-only-local\" : \"persisted\",\n\t);\n\tconst registry = getRegistryForScope();\n\tconst existing = registry.get(registryKey);\n\tif (existing) {\n\t\texisting.updateOptions(\n\t\t\t{\n\t\t\t\tapiKey,\n\t\t\t\t_loaderUrl,\n\t\t\t\t_coreUrl,\n\t\t\t\t_apiUrl,\n\t\t\t\t_realtimeUrl,\n\t\t\t\tdisableAutoLoad,\n\t\t\t\tcolorScheme,\n\t\t\t\tdisableTelemetry,\n\t\t\t\tenableDebug,\n\t\t\t\tdefaultConsent,\n\t\t\t\tflags,\n\t\t\t\tcapabilities,\n\t\t\t\tactions,\n\t\t\t},\n\t\t\tinitialActionRegistry,\n\t\t\tinitialLinkRouter,\n\t\t);\n\t\tif (!disableAutoLoad) {\n\t\t\texisting.client.load();\n\t\t}\n\t\treturn existing.client;\n\t}\n\n\tlet loaderUrlConfig = _loaderUrl;\n\tlet coreUrlConfig = _coreUrl;\n\tlet apiUrlConfig = _apiUrl;\n\tlet realtimeUrlConfig = _realtimeUrl;\n\n\tconst notifyError = (_error: unknown): void => {\n\t\t// No-op: track/use hooks removed from public API.\n\t};\n\tconst hostWindow =\n\t\ttypeof window !== \"undefined\" &&\n\t\ttypeof window.addEventListener === \"function\" &&\n\t\ttypeof window.removeEventListener === \"function\"\n\t\t\t? window\n\t\t\t: null;\n\tconst hostDocument =\n\t\ttypeof document !== \"undefined\" &&\n\t\ttypeof document.createElement === \"function\" &&\n\t\tdocument.head !== null\n\t\t\t? document\n\t\t\t: null;\n\n\tconst sdkVersion = SDK_VERSION;\n\tconst clientInstanceId = createClientInstanceId();\n\tconst openRequestBridge = createOpenRequestBridge();\n\tconst clientMeta: ClientMeta = {\n\t\tloader: \"sdk\",\n\t\tclientName: \"@getuserfeedback/sdk\",\n\t\tclientVersion: sdkVersion,\n\t\ttransport: \"snippet\",\n\t};\n\n\tlet defaultConsentConfig = defaultConsent;\n\tlet colorSchemeConfig = colorScheme;\n\tlet flagsConfig = toFlags(flags);\n\tlet capabilitiesConfig = toCapabilities(capabilities);\n\tlet actionRegistry = initialActionRegistry;\n\tlet linkRouterConfig = initialLinkRouter;\n\n\tconst buildRuntimeEndpoints = (): InitOptions[\"runtimeEndpoints\"] => {\n\t\tif (!(coreUrlConfig || apiUrlConfig || realtimeUrlConfig)) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn {\n\t\t\t...(coreUrlConfig !== undefined ? { coreUrl: coreUrlConfig } : {}),\n\t\t\t...(apiUrlConfig !== undefined ? { apiUrl: apiUrlConfig } : {}),\n\t\t\t...(realtimeUrlConfig !== undefined\n\t\t\t\t? { realtimeUrl: realtimeUrlConfig }\n\t\t\t\t: {}),\n\t\t};\n\t};\n\n\tconst buildInitOpts = (includeHostActions = true): InitOptions => {\n\t\tconst runtimeEndpoints = buildRuntimeEndpoints();\n\t\tconst hostActionDefinitions = includeHostActions\n\t\t\t? actionRegistry.listDefinitions()\n\t\t\t: [];\n\t\tconst protocolCapabilities = [\n\t\t\t...SDK_PROTOCOL_CAPABILITIES,\n\t\t\t...(linkRouterConfig !== undefined || actionRegistry.getOpenUrlHandler()\n\t\t\t\t? [OPEN_URL_ACTION_CAPABILITY, OPEN_URL_ACTION_V1_CAPABILITY]\n\t\t\t\t: []),\n\t\t];\n\t\treturn {\n\t\t\tapiKey,\n\t\t\tclientMeta,\n\t\t\tcapabilities: [...protocolCapabilities],\n\t\t\t...(flagsConfig !== undefined && {\n\t\t\t\tflags: flagsConfig.map((flag) => ({ ...flag })),\n\t\t\t}),\n\t\t\t...(capabilitiesConfig !== undefined && {\n\t\t\t\thostCapabilities: capabilitiesConfig.map((capability) => ({\n\t\t\t\t\t...capability,\n\t\t\t\t})),\n\t\t\t}),\n\t\t\t...(hostActionDefinitions.length > 0 && {\n\t\t\t\thostActions: hostActionDefinitions,\n\t\t\t}),\n\t\t\t...(runtimeEndpoints !== undefined ? { runtimeEndpoints } : {}),\n\t\t\t...(colorSchemeConfig !== undefined && {\n\t\t\t\tcolorScheme: colorSchemeConfig,\n\t\t\t}),\n\t\t\t...(disableTelemetry !== undefined && { disableTelemetry }),\n\t\t\t...(enableDebug !== undefined && { enableDebug }),\n\t\t\t...(defaultConsentConfig !== undefined && {\n\t\t\t\tdefaultConsent: defaultConsentConfig,\n\t\t\t}),\n\t\t};\n\t};\n\n\tlet loaderRequested = false;\n\tlet pendingLoad: Promise<void> | null = null;\n\tlet pendingRegistrationProbe: Promise<void> | null = null;\n\tlet disableAutoLoadConfig = disableAutoLoad;\n\tconst flowStateByHandle = new Map<FlowHandleId, FlowState>();\n\tconst claimedFlowStateHandles = new Set<FlowHandleId>();\n\tconst pendingFlowStateHandles = new Set<FlowHandleId>();\n\tlet isFlowHandleAllocationActive = false;\n\tlet isFlowHandleAllocationLocked = false;\n\tconst flowHandleAllocationWaiters: Array<(release: () => void) => void> = [];\n\tlet instanceFlowState: FlowState = DEFAULT_FLOW_STATE;\n\tconst hostEventHub = createClientHostEventHub({\n\t\tinstanceId: clientInstanceId,\n\t\tonNavigationRequested: (detail) => {\n\t\t\tconst target =\n\t\t\t\tdetail.version === 1 && detail.target === \"_blank\"\n\t\t\t\t\t? undefined\n\t\t\t\t\t: detail.version === OPEN_URL_ACTION_VERSION &&\n\t\t\t\t\t\t\t(detail.target === undefined ||\n\t\t\t\t\t\t\t\tdetail.target === \"self\" ||\n\t\t\t\t\t\t\t\tdetail.target === \"blank\")\n\t\t\t\t\t\t? detail.target\n\t\t\t\t\t\t: null;\n\t\t\tif (target === null) {\n\t\t\t\treturn \"unhandled\";\n\t\t\t}\n\t\t\tif (linkRouterConfig !== undefined) {\n\t\t\t\tinvokeLinkRouter(linkRouterConfig, {\n\t\t\t\t\turl: detail.url,\n\t\t\t\t\t...(target === undefined ? {} : { target }),\n\t\t\t\t});\n\t\t\t\treturn \"succeeded\";\n\t\t\t}\n\t\t\tconst handler = actionRegistry.getOpenUrlHandler();\n\t\t\tif (!handler) {\n\t\t\t\treturn \"unhandled\";\n\t\t\t}\n\t\t\tconst outcome = handler({\n\t\t\t\turl: detail.url,\n\t\t\t\t...(target === undefined ? {} : { target }),\n\t\t\t});\n\t\t\tif (outcome === \"handled\") {\n\t\t\t\treturn \"succeeded\";\n\t\t\t}\n\t\t\tif (outcome === \"unhandled\") {\n\t\t\t\treturn \"unhandled\";\n\t\t\t}\n\t\t\tthrow new TypeError(\n\t\t\t\t'Registered open-url action must return \"handled\" or \"unhandled\" synchronously.',\n\t\t\t);\n\t\t},\n\t\twindowRef: hostWindow,\n\t});\n\n\tconst resolveRequiredRuntimeUrls = (): {\n\t\tloaderUrl: string;\n\t\tcoreUrl: string;\n\t\tapiUrl: string;\n\t\trealtimeUrl?: string;\n\t} => {\n\t\tconst runtimeUrls = resolveStartupRuntimeUrls({\n\t\t\tapiKey,\n\t\t\t_loaderUrl: loaderUrlConfig,\n\t\t\t_coreUrl: coreUrlConfig,\n\t\t\t_apiUrl: apiUrlConfig,\n\t\t\t_realtimeUrl: realtimeUrlConfig,\n\t\t});\n\t\tloaderUrlConfig = runtimeUrls.loaderUrl;\n\t\tcoreUrlConfig = runtimeUrls.coreUrl;\n\t\tapiUrlConfig = runtimeUrls.apiUrl;\n\t\trealtimeUrlConfig = runtimeUrls.realtimeUrl;\n\t\treturn runtimeUrls;\n\t};\n\n\tconst cloneFlowState = (state: FlowState): FlowState => ({\n\t\tisOpen: state.isOpen,\n\t\tisLoading: state.isLoading,\n\t\twidth: state.width,\n\t\theight: state.height,\n\t});\n\n\tconst getFlowStateForHandle = (flowHandleId: FlowHandleId): FlowState => {\n\t\tconst existing = flowStateByHandle.get(flowHandleId);\n\t\tif (!existing) {\n\t\t\treturn cloneFlowState(DEFAULT_FLOW_STATE);\n\t\t}\n\t\treturn cloneFlowState(existing);\n\t};\n\n\tconst setFlowStateForHandle = (\n\t\tflowHandleId: FlowHandleId,\n\t\tstate: FlowState,\n\t): void => {\n\t\tflowStateByHandle.set(flowHandleId, cloneFlowState(state));\n\t};\n\n\t// Core can publish state for a newly allocated supplied Flow before the\n\t// command settlement tells its FlowRun which handle was allocated. Keep the\n\t// client-owned snapshot current so binding that handle can replay the state\n\t// instead of losing the first open transition.\n\thostEventHub.subscribeFlowState((detail): void => {\n\t\tconst isClaimedHandle = claimedFlowStateHandles.has(detail.flowHandleId);\n\t\tif (!isClaimedHandle && !isFlowHandleAllocationActive) {\n\t\t\treturn;\n\t\t}\n\t\tsetFlowStateForHandle(detail.flowHandleId, {\n\t\t\tisOpen: detail.isOpen,\n\t\t\tisLoading: detail.isLoading,\n\t\t\twidth: detail.width,\n\t\t\theight: detail.height,\n\t\t});\n\t\tif (!isClaimedHandle) {\n\t\t\tpendingFlowStateHandles.add(detail.flowHandleId);\n\t\t}\n\t});\n\tconst beginFlowHandleAllocation = (): void => {\n\t\tisFlowHandleAllocationActive = true;\n\t};\n\tconst clearPendingFlowHandleState = (): void => {\n\t\tfor (const flowHandleId of pendingFlowStateHandles) {\n\t\t\tflowStateByHandle.delete(flowHandleId);\n\t\t}\n\t\tpendingFlowStateHandles.clear();\n\t};\n\tconst endFlowHandleAllocation = (): void => {\n\t\tisFlowHandleAllocationActive = false;\n\t\tclearPendingFlowHandleState();\n\t};\n\t/**\n\t * Flow-state events do not carry the allocating command requestId. Serialize\n\t * only handle-free handoffs so a pre-settlement snapshot has one possible\n\t * owner. Other commands remain concurrent. If allocation concurrency becomes\n\t * a product requirement, add explicit event correlation instead of a ledger.\n\t */\n\tconst createFlowHandleAllocationRelease = (): (() => void) => {\n\t\tlet released = false;\n\t\treturn () => {\n\t\t\tif (released) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treleased = true;\n\t\t\tconst next = flowHandleAllocationWaiters.shift();\n\t\t\tif (next) {\n\t\t\t\tnext(createFlowHandleAllocationRelease());\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tisFlowHandleAllocationLocked = false;\n\t\t};\n\t};\n\tconst acquireFlowHandleAllocation = ():\n\t\t| (() => void)\n\t\t| Promise<() => void> => {\n\t\tif (!isFlowHandleAllocationLocked) {\n\t\t\tisFlowHandleAllocationLocked = true;\n\t\t\treturn createFlowHandleAllocationRelease();\n\t\t}\n\t\treturn new Promise<() => void>((resolve) => {\n\t\t\tflowHandleAllocationWaiters.push(resolve);\n\t\t});\n\t};\n\n\tconst getInstanceFlowState = (): FlowState =>\n\t\tcloneFlowState(instanceFlowState);\n\n\tconst setInstanceFlowState = (state: FlowState): void => {\n\t\tinstanceFlowState = cloneFlowState(state);\n\t};\n\n\thostEventHub.subscribeInstanceFlowState((detail): void => {\n\t\tsetInstanceFlowState({\n\t\t\tisOpen: detail.isOpen,\n\t\t\tisLoading: detail.isLoading,\n\t\t\twidth: detail.width,\n\t\t\theight: detail.height,\n\t\t});\n\t});\n\n\tconst ensureFlowStateForHandle = (flowHandleId: FlowHandleId): void => {\n\t\tif (!flowStateByHandle.has(flowHandleId)) {\n\t\t\tsetFlowStateForHandle(flowHandleId, DEFAULT_FLOW_STATE);\n\t\t}\n\t};\n\n\tconst subscribeFlowHandleInvalidation = (\n\t\tsubscriber: (flowHandleId: FlowHandleId) => void,\n\t): (() => void) => hostEventHub.subscribeFlowHandleInvalidation(subscriber);\n\n\tconst subscribeFlowStateCacheForHandle = (\n\t\tflowHandleId: FlowHandleId,\n\t): (() => void) =>\n\t\thostEventHub.subscribeFlowStateForHandle(flowHandleId, (detail): void => {\n\t\t\tconst nextState: FlowState = {\n\t\t\t\tisOpen: detail.isOpen,\n\t\t\t\tisLoading: detail.isLoading,\n\t\t\t\twidth: detail.width,\n\t\t\t\theight: detail.height,\n\t\t\t};\n\t\t\tsetFlowStateForHandle(flowHandleId, nextState);\n\t\t});\n\n\tconst isLoaderRequested = (): boolean => loaderRequested;\n\n\tconst enqueue = (\n\t\tenvelope: CommandEnvelope | InternalHostCommandEnvelope,\n\t): void => {\n\t\tif (!hostWindow) {\n\t\t\treturn;\n\t\t}\n\t\tif (!hostWindow.__getuserfeedback_queue) {\n\t\t\thostWindow.__getuserfeedback_queue = [];\n\t\t}\n\t\t// Stamp instanceId and clientMeta so the loader can route commands.\n\t\tconst stamped: CommandEnvelope | InternalHostCommandEnvelope = {\n\t\t\t...envelope,\n\t\t\tinstanceId: envelope.instanceId ?? clientInstanceId,\n\t\t\tclientMeta: envelope.clientMeta ?? clientMeta,\n\t\t};\n\t\thostWindow.__getuserfeedback_queue.push(stamped);\n\t};\n\n\tconst enqueueInstanceRegistration = (\n\t\trequestId?: string,\n\t\tincludeHostActions = true,\n\t): string => {\n\t\tif (suppliedOnlyLocal) {\n\t\t\tif (!coreUrlConfig) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"_coreUrl is not resolved for bundled docs registration\",\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst localRequestId = requestId ?? createCommandRequestId();\n\t\t\tconst command: InternalHostSuppliedOnlyLocalInitCommandPayload = {\n\t\t\t\tkind: \"init\",\n\t\t\t\topts: suppliedOnlyLocalInitOptionsSchema.parse({\n\t\t\t\t\tregistration: {\n\t\t\t\t\t\tkind: \"supplied-only-local\",\n\t\t\t\t\t\tprofile: \"bundled-docs\",\n\t\t\t\t\t},\n\t\t\t\t\t...(colorSchemeConfig === undefined\n\t\t\t\t\t\t? {}\n\t\t\t\t\t\t: { colorScheme: colorSchemeConfig }),\n\t\t\t\t}),\n\t\t\t\truntimeEndpoints: { coreUrl: coreUrlConfig },\n\t\t\t};\n\t\t\tenqueue({\n\t\t\t\tversion: \"1\",\n\t\t\t\trequestId: localRequestId,\n\t\t\t\tidempotencyKey: localRequestId,\n\t\t\t\tcommand,\n\t\t\t});\n\t\t\treturn localRequestId;\n\t\t}\n\t\tconst envelope = createCommandEnvelope({\n\t\t\tinstanceId: clientInstanceId,\n\t\t\trequestId,\n\t\t\tcommand: { kind: \"init\", opts: buildInitOpts(includeHostActions) },\n\t\t});\n\t\tenqueue(envelope);\n\t\treturn envelope.requestId;\n\t};\n\n\tconst runAfterRegistrationProbe = (run: () => void): void => {\n\t\tconst registrationProbe = pendingRegistrationProbe;\n\t\tif (!registrationProbe) {\n\t\t\trun();\n\t\t\treturn;\n\t\t}\n\t\tvoid registrationProbe.then(run);\n\t};\n\n\tconst enqueueSetDefaultContainerPolicy = (policy: ContainerPolicy): void => {\n\t\trunAfterRegistrationProbe(() => {\n\t\t\tenqueue(\n\t\t\t\tcreateCommandEnvelope({\n\t\t\t\t\tcommand: { kind: \"setDefaultContainerPolicy\", policy },\n\t\t\t\t}),\n\t\t\t);\n\t\t});\n\t};\n\n\tconst enqueueSetContainer = (\n\t\tflowHandleId: FlowHandleId,\n\t\telement: HTMLElement | null,\n\t): void => {\n\t\tenqueue(\n\t\t\tcreateCommandEnvelope({\n\t\t\t\tcommand: { kind: \"setContainer\", flowHandleId, container: element },\n\t\t\t}),\n\t\t);\n\t};\n\n\tconst reportAsyncError = <T>(promise: Promise<T>): Promise<T> => {\n\t\treturn promise.catch((error) => {\n\t\t\tnotifyError(error);\n\t\t\tthrow error;\n\t\t});\n\t};\n\n\tconst ensureCommandsCanRun = (): void => {\n\t\tif (!hostWindow) {\n\t\t\treturn;\n\t\t}\n\t\tif (!isLoaderRequested()) {\n\t\t\tif (disableAutoLoadConfig) {\n\t\t\t\tthrow new Error(\"Widget not loaded. Call client.load() first.\");\n\t\t\t}\n\t\t\tload();\n\t\t}\n\t};\n\n\tconst assertInlineFlowRuntimeSupport = (): void => {\n\t\tconst runtimeMarker = hostWindow?.[LOADER_RUNTIME_GLOBAL_KEY];\n\t\tif (!runtimeMarker?.alive) {\n\t\t\tthrow new Error(\n\t\t\t\t\"Inline flows require an active compatible Loader runtime.\",\n\t\t\t);\n\t\t}\n\t\tif (runtimeMarker.protocolVersion !== LOADER_RUNTIME_PROTOCOL_VERSION) {\n\t\t\tthrow new Error(\n\t\t\t\t`Incompatible loader runtime protocol: expected ${LOADER_RUNTIME_PROTOCOL_VERSION}, received ${runtimeMarker.protocolVersion ?? \"unknown\"}`,\n\t\t\t);\n\t\t}\n\t\tif (!runtimeMarker.features?.includes(UNIFIED_FLOW_RUNTIME_V1_CAPABILITY)) {\n\t\t\tthrow new Error(\n\t\t\t\t`Inline flows require Loader feature ${UNIFIED_FLOW_RUNTIME_V1_CAPABILITY}.`,\n\t\t\t);\n\t\t}\n\t};\n\n\t/** Enqueue a command and await its settlement.\n\t * The loader resolves instanceId from the instance registry. */\n\tconst rawSettlementDispatch = createCommandSettlementDispatch((cmd) =>\n\t\tenqueue(cmd),\n\t);\n\t// createCommandSettlementDispatch inserts the envelope synchronously before\n\t// returning its settlement promise, which makes invocation the handoff edge.\n\tconst handOffCommand = (input: Command) => rawSettlementDispatch(input);\n\tconst handOffInlineFlowCommand = (\n\t\tinput: InternalHostInlineFlowCommandPayload,\n\t) => {\n\t\tconst requestId = createCommandRequestId();\n\t\tenqueue({\n\t\t\tversion: \"1\",\n\t\t\trequestId,\n\t\t\tidempotencyKey: requestId,\n\t\t\tcommand: input,\n\t\t});\n\t\treturn waitForCommandSettlement({\n\t\t\trequestId,\n\t\t\twindowRef: hostWindow ?? undefined,\n\t\t});\n\t};\n\tconst transportAdmission = createClientTransportAdmission();\n\tconst prepareCommandHandoff = (): void | Promise<void> => {\n\t\tensureCommandsCanRun();\n\t\tconst registrationProbe = pendingRegistrationProbe;\n\t\tif (registrationProbe) {\n\t\t\treturn registrationProbe;\n\t\t}\n\t};\n\tconst prepareInlineFlowCommandHandoff = (): void | Promise<void> => {\n\t\tensureCommandsCanRun();\n\t\tconst startup = pendingLoad ?? pendingRegistrationProbe;\n\t\tif (startup) {\n\t\t\treturn startup.then(assertInlineFlowRuntimeSupport);\n\t\t}\n\t\tassertInlineFlowRuntimeSupport();\n\t};\n\tconst dispatch = async (input: Command): Promise<void> => {\n\t\tconst preparation = prepareCommandHandoff();\n\t\tif (preparation) {\n\t\t\tawait preparation;\n\t\t}\n\t\tawait rawSettlementDispatch(input);\n\t};\n\n\tconst enqueueConfigUpdate = (opts: ConfigureOptions): void => {\n\t\tif (!isLoaderRequested()) {\n\t\t\treturn;\n\t\t}\n\t\trunAfterRegistrationProbe(() => {\n\t\t\tenqueue(\n\t\t\t\tcreateCommandEnvelope({\n\t\t\t\t\tcommand: { kind: \"configure\", opts },\n\t\t\t\t}),\n\t\t\t);\n\t\t});\n\t};\n\n\tconst toConfigureCommandOptions = (\n\t\tupdates: ConfigureOptions,\n\t): ConfigureOptions => {\n\t\tconst nextCapabilities = toCapabilities(updates.capabilities);\n\t\treturn {\n\t\t\t...(updates.colorScheme !== undefined && {\n\t\t\t\tcolorScheme: updates.colorScheme,\n\t\t\t}),\n\t\t\t...(updates.consent !== undefined && { consent: updates.consent }),\n\t\t\t...(updates.auth !== undefined && { auth: updates.auth }),\n\t\t\t...(nextCapabilities !== undefined && {\n\t\t\t\tcapabilities: nextCapabilities,\n\t\t\t}),\n\t\t};\n\t};\n\n\tconst updateOptions = (\n\t\tnext: ClientOptions,\n\t\tnextActionRegistry: ActionRegistry,\n\t\tnextLinkRouter: LinkRouter | undefined,\n\t): void => {\n\t\tconst linkRouterOwnershipChanged =\n\t\t\t(linkRouterConfig === undefined) !== (nextLinkRouter === undefined);\n\t\tif (\n\t\t\tlinkRouterOwnershipChanged &&\n\t\t\t(isLoaderRequested() || pendingLoad !== null)\n\t\t) {\n\t\t\tthrow new Error(\n\t\t\t\t\"links.router cannot be added or removed after widget init; keeping original router\",\n\t\t\t);\n\t\t}\n\t\tconst definitionsChanged = !haveSameActionDefinitions(\n\t\t\tactionRegistry.listRegistrationIdentities(),\n\t\t\tnextActionRegistry.listRegistrationIdentities(),\n\t\t);\n\t\tif (definitionsChanged && (isLoaderRequested() || pendingLoad !== null)) {\n\t\t\tconst error = new Error(\n\t\t\t\t\"actions definitions cannot be changed after widget init; keeping original registrations\",\n\t\t\t);\n\t\t\tnotifyError(error);\n\t\t\tthrow error;\n\t\t}\n\t\tactionRegistry = nextActionRegistry;\n\t\tlinkRouterConfig = nextLinkRouter;\n\t\tdisableAutoLoadConfig = next.disableAutoLoad ?? disableAutoLoadConfig;\n\t\tdefaultConsentConfig = next.defaultConsent ?? defaultConsentConfig;\n\t\tif (!isLoaderRequested() && pendingLoad === null) {\n\t\t\tif (next.colorScheme !== undefined) {\n\t\t\t\tcolorSchemeConfig = next.colorScheme;\n\t\t\t}\n\t\t\tif (next.flags !== undefined) {\n\t\t\t\tflagsConfig = toFlags(next.flags);\n\t\t\t}\n\t\t\tif (next.capabilities !== undefined) {\n\t\t\t\tcapabilitiesConfig = toCapabilities(next.capabilities);\n\t\t\t}\n\t\t}\n\n\t\tif (next._loaderUrl !== undefined && next._loaderUrl !== loaderUrlConfig) {\n\t\t\tif (isLoaderRequested() || pendingLoad !== null) {\n\t\t\t\tconst error = new Error(\n\t\t\t\t\t\"_loaderUrl cannot be changed after widget init; keeping original\",\n\t\t\t\t);\n\t\t\t\tnotifyError(error);\n\t\t\t} else {\n\t\t\t\tloaderUrlConfig = next._loaderUrl;\n\t\t\t}\n\t\t}\n\n\t\tif (next._coreUrl !== undefined && next._coreUrl !== coreUrlConfig) {\n\t\t\tif (isLoaderRequested() || pendingLoad !== null) {\n\t\t\t\tconst error = new Error(\n\t\t\t\t\t\"_coreUrl cannot be changed after widget init; keeping original\",\n\t\t\t\t);\n\t\t\t\tnotifyError(error);\n\t\t\t} else {\n\t\t\t\tcoreUrlConfig = next._coreUrl;\n\t\t\t}\n\t\t}\n\n\t\tif (next._apiUrl !== undefined && next._apiUrl !== apiUrlConfig) {\n\t\t\tif (isLoaderRequested() || pendingLoad !== null) {\n\t\t\t\tconst error = new Error(\n\t\t\t\t\t\"_apiUrl cannot be changed after widget init; keeping original\",\n\t\t\t\t);\n\t\t\t\tnotifyError(error);\n\t\t\t} else {\n\t\t\t\tapiUrlConfig = next._apiUrl;\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\tnext._realtimeUrl !== undefined &&\n\t\t\tnext._realtimeUrl !== realtimeUrlConfig\n\t\t) {\n\t\t\tif (isLoaderRequested() || pendingLoad !== null) {\n\t\t\t\tconst error = new Error(\n\t\t\t\t\t\"_realtimeUrl cannot be changed after widget init; keeping original\",\n\t\t\t\t);\n\t\t\t\tnotifyError(error);\n\t\t\t} else {\n\t\t\t\trealtimeUrlConfig = next._realtimeUrl;\n\t\t\t}\n\t\t}\n\n\t\tapplyStartupConfig(next);\n\n\t\tif (!disableAutoLoadConfig && !isLoaderRequested()) {\n\t\t\tload();\n\t\t}\n\t};\n\n\tconst applyStartupConfig = (next: ClientOptions): void => {\n\t\t// Send configure payload from next (colorScheme only from ClientOptions).\n\t\tif (!isLoaderRequested()) return;\n\t\tconst opts: ConfigureOptions = {};\n\t\tif (next.colorScheme !== undefined) opts.colorScheme = next.colorScheme;\n\t\tif (next.capabilities !== undefined) {\n\t\t\tcapabilitiesConfig = toCapabilities(next.capabilities);\n\t\t\topts.capabilities = capabilitiesConfig;\n\t\t}\n\t\tenqueueConfigUpdate(opts);\n\t};\n\n\tconst load = (): void => {\n\t\tif (!hostWindow || !hostDocument) {\n\t\t\treturn;\n\t\t}\n\t\tif (isLoaderRequested() || pendingLoad) {\n\t\t\treturn;\n\t\t}\n\t\tconst runtimeUrls = resolveRequiredRuntimeUrls();\n\n\t\tconst appendLoaderScript = (): void => {\n\t\t\tconst scriptUrl = runtimeUrls.loaderUrl;\n\t\t\tif (\n\t\t\t\t!hostDocument.querySelector(`link[href=\"${scriptUrl}\"][rel=\"preload\"]`)\n\t\t\t) {\n\t\t\t\tconst preload = hostDocument.createElement(\"link\");\n\t\t\t\tpreload.rel = \"preload\";\n\t\t\t\tpreload.as = \"script\";\n\t\t\t\tpreload.href = scriptUrl;\n\t\t\t\thostDocument.head.appendChild(preload);\n\t\t\t}\n\n\t\t\tconst script = hostDocument.createElement(\"script\");\n\t\t\tscript.src = scriptUrl;\n\t\t\tscript.async = true;\n\t\t\tif (script.dataset) {\n\t\t\t\tscript.dataset.disableAutoRegister = \"true\";\n\t\t\t} else if (typeof script.setAttribute === \"function\") {\n\t\t\t\tscript.setAttribute(\"data-disable-auto-register\", \"true\");\n\t\t\t}\n\t\t\thostDocument.head.appendChild(script);\n\t\t};\n\n\t\tconst runtimeMarker = hostWindow[LOADER_RUNTIME_GLOBAL_KEY];\n\t\tif (runtimeMarker?.alive) {\n\t\t\tconst protocolVersion = runtimeMarker.protocolVersion;\n\t\t\tif (protocolVersion !== LOADER_RUNTIME_PROTOCOL_VERSION) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Incompatible loader runtime protocol: expected ${LOADER_RUNTIME_PROTOCOL_VERSION}, received ${protocolVersion ?? \"unknown\"}`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst requestId = enqueueInstanceRegistration();\n\t\t\tloaderRequested = true;\n\t\t\tif (\n\t\t\t\t!runtimeMarker.features?.includes(UNIFIED_FLOW_RUNTIME_V1_CAPABILITY)\n\t\t\t) {\n\t\t\t\tlet trackedPending: Promise<void>;\n\t\t\t\tconst pending = waitForCommandSettlement({\n\t\t\t\t\trequestId,\n\t\t\t\t\twindowRef: hostWindow,\n\t\t\t\t\ttimeoutMs: LOADER_RUNTIME_POST_LOAD_TIMEOUT_MS,\n\t\t\t\t})\n\t\t\t\t\t.then(() => {})\n\t\t\t\t\t.catch((error) => {\n\t\t\t\t\t\tnotifyError(error);\n\t\t\t\t\t});\n\t\t\t\ttrackedPending = pending.finally(() => {\n\t\t\t\t\tif (pendingRegistrationProbe === trackedPending) {\n\t\t\t\t\t\tpendingRegistrationProbe = null;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tpendingRegistrationProbe = trackedPending;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst hasCommandQueue = Array.isArray(hostWindow.__getuserfeedback_queue);\n\t\tif (!hasCommandQueue) {\n\t\t\tconst requestId = enqueueInstanceRegistration();\n\t\t\tappendLoaderScript();\n\t\t\tloaderRequested = true;\n\t\t\tlet trackedPending: Promise<void>;\n\t\t\tconst pending = waitForCommandSettlement({\n\t\t\t\trequestId,\n\t\t\t\twindowRef: hostWindow,\n\t\t\t\ttimeoutMs: LOADER_RUNTIME_POST_LOAD_TIMEOUT_MS,\n\t\t\t})\n\t\t\t\t.then(() => {})\n\t\t\t\t.catch((error) => {\n\t\t\t\t\tnotifyError(error);\n\t\t\t\t});\n\t\t\ttrackedPending = pending.finally(() => {\n\t\t\t\tif (pendingLoad === trackedPending) {\n\t\t\t\t\tpendingLoad = null;\n\t\t\t\t}\n\t\t\t});\n\t\t\tpendingLoad = trackedPending;\n\t\t\treturn;\n\t\t}\n\n\t\tloaderRequested = true;\n\n\t\tlet trackedPending: Promise<void>;\n\t\tconst pending = (async () => {\n\t\t\tconst requestId = createCommandRequestId();\n\t\t\tenqueueInstanceRegistration(requestId);\n\t\t\ttry {\n\t\t\t\tawait waitForCommandSettlement({\n\t\t\t\t\trequestId,\n\t\t\t\t\twindowRef: hostWindow,\n\t\t\t\t\ttimeoutMs: LOADER_RUNTIME_PROBE_TIMEOUT_MS,\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t} catch (error) {\n\t\t\t\tif (error instanceof CommandSettlementTimeoutError) {\n\t\t\t\t\tappendLoaderScript();\n\t\t\t\t\tawait waitForCommandSettlement({\n\t\t\t\t\t\trequestId,\n\t\t\t\t\t\twindowRef: hostWindow,\n\t\t\t\t\t\ttimeoutMs: LOADER_RUNTIME_POST_LOAD_TIMEOUT_MS,\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (\n\t\t\t\t\terror instanceof CommandSettlementError &&\n\t\t\t\t\terror.code === INVALID_COMMAND_ERROR_CODE &&\n\t\t\t\t\tactionRegistry.listDefinitions().length > 0\n\t\t\t\t) {\n\t\t\t\t\tconst fallbackRequestId = createCommandRequestId();\n\t\t\t\t\tenqueueInstanceRegistration(fallbackRequestId, false);\n\t\t\t\t\tawait waitForCommandSettlement({\n\t\t\t\t\t\trequestId: fallbackRequestId,\n\t\t\t\t\t\twindowRef: hostWindow,\n\t\t\t\t\t\ttimeoutMs: LOADER_RUNTIME_POST_LOAD_TIMEOUT_MS,\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t})().catch((error) => {\n\t\t\tnotifyError(error);\n\t\t});\n\t\ttrackedPending = pending.finally(() => {\n\t\t\tif (pendingLoad === trackedPending) {\n\t\t\t\tpendingLoad = null;\n\t\t\t}\n\t\t\tif (pendingRegistrationProbe === trackedPending) {\n\t\t\t\tpendingRegistrationProbe = null;\n\t\t\t}\n\t\t});\n\t\tpendingLoad = trackedPending;\n\t\tif (actionRegistry.listDefinitions().length > 0) {\n\t\t\tpendingRegistrationProbe = trackedPending;\n\t\t}\n\t};\n\n\tconst subscribeFlowStateForHandle = (\n\t\tflowHandleId: FlowHandleId,\n\t\tcallback: FlowStateCallback,\n\t\toptions?: SubscribeFlowStateOptions,\n\t): (() => void) => {\n\t\tif (options?.emitInitial ?? true) {\n\t\t\tcallback(getFlowStateForHandle(flowHandleId));\n\t\t}\n\t\treturn hostEventHub.subscribeFlowStateForHandle(\n\t\t\tflowHandleId,\n\t\t\t(detail): void => {\n\t\t\t\tconst nextState: FlowState = {\n\t\t\t\t\tisOpen: detail.isOpen,\n\t\t\t\t\tisLoading: detail.isLoading,\n\t\t\t\t\twidth: detail.width,\n\t\t\t\t\theight: detail.height,\n\t\t\t\t};\n\t\t\t\tsetFlowStateForHandle(flowHandleId, nextState);\n\t\t\t\tcallback(cloneFlowState(nextState));\n\t\t\t},\n\t\t\t{ signal: options?.signal },\n\t\t);\n\t};\n\n\tconst subscribeFlowStateForInstance = (\n\t\tcallback: FlowStateCallback,\n\t\toptions?: SubscribeFlowStateOptions,\n\t): (() => void) => {\n\t\tif (options?.emitInitial ?? true) {\n\t\t\tcallback(getInstanceFlowState());\n\t\t}\n\t\treturn hostEventHub.subscribeInstanceFlowState(\n\t\t\t(detail): void => {\n\t\t\t\tconst nextState: FlowState = {\n\t\t\t\t\tisOpen: detail.isOpen,\n\t\t\t\t\tisLoading: detail.isLoading,\n\t\t\t\t\twidth: detail.width,\n\t\t\t\t\theight: detail.height,\n\t\t\t\t};\n\t\t\t\tcallback(cloneFlowState(nextState));\n\t\t\t},\n\t\t\t{ signal: options?.signal },\n\t\t);\n\t};\n\n\tconst resetFlowRunsForClientBarrier = new Set<() => void>();\n\tlet deferredFlowRunNotifications: Array<() => void> | null = null;\n\n\tfunction createFlowRun(target: { flowId: string }): FlowRun;\n\tfunction createFlowRun(target: { flow: InlineFlow }): InlineFlowRun;\n\tfunction createFlowRun(target: FlowRunTarget): FlowRun | InlineFlowRun {\n\t\tconst openRequestController = createFlowOpenRequestController();\n\t\tlet latestContainer: HTMLElement | null | undefined;\n\t\tlet unsubscribeFlowStateCache: (() => void) | null = null;\n\t\ttype SubscriberEntry = {\n\t\t\tcallback: FlowStateCallback;\n\t\t\toptions?: SubscribeFlowStateOptions;\n\t\t\tunsubscribe: (() => void) | null;\n\t\t};\n\t\tconst activeSubscribers = new Set<SubscriberEntry>();\n\t\tconst handleClient = createFlowCommandHandleController<\n\t\t\tFlowHandleId,\n\t\t\t{\n\t\t\t\tok: boolean;\n\t\t\t\tkind: string;\n\t\t\t\tresult?: unknown;\n\t\t\t}\n\t\t>({\n\t\t\tgetHandleIdFromSettlement: (settlement) => {\n\t\t\t\tconst handle = getFlowHandleFromSettlementDetail(settlement);\n\t\t\t\treturn handle?.flowHandleId;\n\t\t\t},\n\t\t\tisStaleHandleError,\n\t\t\tonClearResolvedHandle: (previousFlowHandleId) => {\n\t\t\t\tclaimedFlowStateHandles.delete(previousFlowHandleId);\n\t\t\t\tpendingFlowStateHandles.delete(previousFlowHandleId);\n\t\t\t\tif (unsubscribeFlowStateCache) {\n\t\t\t\t\tunsubscribeFlowStateCache();\n\t\t\t\t\tunsubscribeFlowStateCache = null;\n\t\t\t\t}\n\t\t\t\tsetFlowStateForHandle(previousFlowHandleId, DEFAULT_FLOW_STATE);\n\t\t\t\trebindSubscribersToCurrentHandle();\n\t\t\t\tconst subscribersAtReset = [...activeSubscribers];\n\t\t\t\tconst notify = (): void =>\n\t\t\t\t\tnotifySubscribersWithDefaultState(subscribersAtReset);\n\t\t\t\tif (deferredFlowRunNotifications) {\n\t\t\t\t\tdeferredFlowRunNotifications.push(notify);\n\t\t\t\t} else {\n\t\t\t\t\tnotify();\n\t\t\t\t}\n\t\t\t},\n\t\t});\n\n\t\tconst bindSubscriberToCurrentHandle = (\n\t\t\tsubscriber: SubscriberEntry,\n\t\t\temitCurrent = false,\n\t\t): void => {\n\t\t\tif (subscriber.unsubscribe) {\n\t\t\t\tsubscriber.unsubscribe();\n\t\t\t\tsubscriber.unsubscribe = null;\n\t\t\t}\n\t\t\tif (subscriber.options?.signal?.aborted) {\n\t\t\t\tactiveSubscribers.delete(subscriber);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst flowHandleId = handleClient.getHandleId();\n\t\t\tif (!flowHandleId) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst notifySubscriber = (state: FlowState): void => {\n\t\t\t\ttry {\n\t\t\t\t\tsubscriber.callback(state);\n\t\t\t\t} catch {\n\t\t\t\t\t// Public observers cannot interrupt handle publication or prevent\n\t\t\t\t\t// the remaining lifecycle projections from binding.\n\t\t\t\t}\n\t\t\t};\n\t\t\tconst unsubscribe = subscribeFlowStateForHandle(\n\t\t\t\tflowHandleId,\n\t\t\t\tnotifySubscriber,\n\t\t\t\temitCurrent\n\t\t\t\t\t? { ...subscriber.options, emitInitial: true }\n\t\t\t\t\t: subscriber.options,\n\t\t\t);\n\t\t\tif (subscriber.options?.signal?.aborted) {\n\t\t\t\tunsubscribe();\n\t\t\t\tactiveSubscribers.delete(subscriber);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (\n\t\t\t\thandleClient.getHandleId() !== flowHandleId ||\n\t\t\t\t!activeSubscribers.has(subscriber)\n\t\t\t) {\n\t\t\t\tunsubscribe();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsubscriber.unsubscribe = unsubscribe;\n\t\t};\n\n\t\tconst rebindSubscribersToCurrentHandle = (emitCurrent = false): void => {\n\t\t\tfor (const subscriber of activeSubscribers) {\n\t\t\t\tbindSubscriberToCurrentHandle(subscriber, emitCurrent);\n\t\t\t}\n\t\t};\n\n\t\tconst notifySubscribersWithDefaultState = (\n\t\t\tsubscribersAtReset: readonly SubscriberEntry[],\n\t\t): void => {\n\t\t\tfor (const subscriber of subscribersAtReset) {\n\t\t\t\tif (!activeSubscribers.has(subscriber)) continue;\n\t\t\t\ttry {\n\t\t\t\t\tsubscriber.callback(cloneFlowState(DEFAULT_FLOW_STATE));\n\t\t\t\t} catch {\n\t\t\t\t\t// A subscriber cannot prevent later reset observers from seeing the\n\t\t\t\t\t// already-completed client-wide transition.\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tconst rebindFlowStateCache = (): void => {\n\t\t\tif (unsubscribeFlowStateCache) {\n\t\t\t\tunsubscribeFlowStateCache();\n\t\t\t\tunsubscribeFlowStateCache = null;\n\t\t\t}\n\t\t\tconst flowHandleId = handleClient.getHandleId();\n\t\t\tif (!flowHandleId) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tunsubscribeFlowStateCache =\n\t\t\t\tsubscribeFlowStateCacheForHandle(flowHandleId);\n\t\t};\n\n\t\tconst clearOpenIntent = (): void => {\n\t\t\topenRequestController.clear();\n\t\t};\n\n\t\tconst flushPendingForResolvedHandle = (): void => {\n\t\t\tconst flowHandleId = handleClient.getHandleId();\n\t\t\tif (!flowHandleId) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst shouldReplayPendingState =\n\t\t\t\tpendingFlowStateHandles.delete(flowHandleId);\n\t\t\tclaimedFlowStateHandles.add(flowHandleId);\n\t\t\tensureFlowStateForHandle(flowHandleId);\n\t\t\tif (latestContainer !== undefined) {\n\t\t\t\tenqueueSetContainer(flowHandleId, latestContainer);\n\t\t\t}\n\t\t\trebindSubscribersToCurrentHandle(shouldReplayPendingState);\n\t\t\trebindFlowStateCache();\n\t\t};\n\n\t\thandleClient.subscribeHandle(() => {\n\t\t\tflushPendingForResolvedHandle();\n\t\t});\n\t\tsubscribeFlowHandleInvalidation((flowHandleId) => {\n\t\t\thandleClient.invalidateResolvedHandle(flowHandleId);\n\t\t});\n\t\ttype HandleCommandPayload =\n\t\t\t| Extract<\n\t\t\t\t\tCommand,\n\t\t\t\t\t{ kind: \"open\" } | { kind: \"prefetch\" } | { kind: \"prerender\" }\n\t\t\t >\n\t\t\t| InternalHostInlineFlowCommandPayload;\n\n\t\tconst handOffHandleCommand = (payload: HandleCommandPayload) =>\n\t\t\t\"flow\" in payload\n\t\t\t\t? handOffInlineFlowCommand(payload)\n\t\t\t\t: handOffCommand(payload);\n\n\t\tconst enqueueAndWaitForSettlement = async (\n\t\t\tbuildPayload: (\n\t\t\t\tflowHandleId: FlowHandleId | undefined,\n\t\t\t) => HandleCommandPayload,\n\t\t): Promise<\"settled\" | \"superseded\"> => {\n\t\t\tconst result = await transportAdmission.runOperation(\n\t\t\t\t({ attemptHandoff }) => {\n\t\t\t\t\tlet releaseFlowHandleAllocation: (() => void) | null = null;\n\t\t\t\t\treturn handleClient\n\t\t\t\t\t\t.runCommand(buildPayload, (payload) => {\n\t\t\t\t\t\t\tconst isHandleFree =\n\t\t\t\t\t\t\t\t!(\"flowHandleId\" in payload) ||\n\t\t\t\t\t\t\t\tpayload.flowHandleId === undefined;\n\t\t\t\t\t\t\tconst requiresSerializedAllocation =\n\t\t\t\t\t\t\t\t\"flow\" in target && isHandleFree;\n\t\t\t\t\t\t\tconst handOff = (): Promise<{\n\t\t\t\t\t\t\t\tok: boolean;\n\t\t\t\t\t\t\t\tkind: string;\n\t\t\t\t\t\t\t\tresult?: unknown;\n\t\t\t\t\t\t\t}> =>\n\t\t\t\t\t\t\t\tattemptHandoff({\n\t\t\t\t\t\t\t\t\tprepare:\n\t\t\t\t\t\t\t\t\t\t\"flow\" in target\n\t\t\t\t\t\t\t\t\t\t\t? prepareInlineFlowCommandHandoff\n\t\t\t\t\t\t\t\t\t\t\t: prepareCommandHandoff,\n\t\t\t\t\t\t\t\t\thandOff: () => ({\n\t\t\t\t\t\t\t\t\t\tsettlement: handOffHandleCommand(payload),\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tif (!requiresSerializedAllocation) {\n\t\t\t\t\t\t\t\treturn handOff();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst handOffAllocation = () =>\n\t\t\t\t\t\t\t\thandOff().catch((error) => {\n\t\t\t\t\t\t\t\t\tclearPendingFlowHandleState();\n\t\t\t\t\t\t\t\t\tthrow error;\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tif (releaseFlowHandleAllocation) {\n\t\t\t\t\t\t\t\treturn handOffAllocation();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst acquisition = acquireFlowHandleAllocation();\n\t\t\t\t\t\t\tif (typeof acquisition === \"function\") {\n\t\t\t\t\t\t\t\treleaseFlowHandleAllocation = acquisition;\n\t\t\t\t\t\t\t\tbeginFlowHandleAllocation();\n\t\t\t\t\t\t\t\treturn handOffAllocation();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn acquisition.then((release) => {\n\t\t\t\t\t\t\t\treleaseFlowHandleAllocation = release;\n\t\t\t\t\t\t\t\tbeginFlowHandleAllocation();\n\t\t\t\t\t\t\t\treturn handOffAllocation();\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.finally(() => {\n\t\t\t\t\t\t\tif (releaseFlowHandleAllocation) {\n\t\t\t\t\t\t\t\tendFlowHandleAllocation();\n\t\t\t\t\t\t\t\treleaseFlowHandleAllocation();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t);\n\t\t\treturn result.status;\n\t\t};\n\n\t\tconst openFlow = (options?: OpenFlowOptions): Promise<void> => {\n\t\t\treturn openRequestController.run(() =>\n\t\t\t\treportAsyncError(\n\t\t\t\t\tenqueueAndWaitForSettlement((flowHandleId) =>\n\t\t\t\t\t\t\"flow\" in target\n\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\tkind: \"open\",\n\t\t\t\t\t\t\t\t\tflow: target.flow,\n\t\t\t\t\t\t\t\t\t...(flowHandleId === undefined ? {} : { flowHandleId }),\n\t\t\t\t\t\t\t\t\t...(flowHandleId === undefined &&\n\t\t\t\t\t\t\t\t\tlatestContainer !== undefined\n\t\t\t\t\t\t\t\t\t\t? { container: null }\n\t\t\t\t\t\t\t\t\t\t: {}),\n\t\t\t\t\t\t\t\t\tmetadata: options?.metadata,\n\t\t\t\t\t\t\t\t\thideCloseButton: options?.hideCloseButton,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\t\tkind: \"open\",\n\t\t\t\t\t\t\t\t\tflowId: target.flowId,\n\t\t\t\t\t\t\t\t\tflowHandleId,\n\t\t\t\t\t\t\t\t\tcontainer: options?.container,\n\t\t\t\t\t\t\t\t\tmetadata: options?.metadata,\n\t\t\t\t\t\t\t\t\thideCloseButton: options?.hideCloseButton,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t).then(() => {}),\n\t\t\t\t),\n\t\t\t);\n\t\t};\n\n\t\tconst resetForClientBarrier = (): void => {\n\t\t\tclearOpenIntent();\n\t\t\thandleClient.reset();\n\t\t};\n\t\tresetFlowRunsForClientBarrier.add(resetForClientBarrier);\n\n\t\tconst run: InlineFlowRun = {\n\t\t\topen: openFlow,\n\t\t\tprefetch: () => {\n\t\t\t\treturn reportAsyncError(\n\t\t\t\t\tenqueueAndWaitForSettlement((flowHandleId) =>\n\t\t\t\t\t\t\"flow\" in target\n\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\tkind: \"prefetch\",\n\t\t\t\t\t\t\t\t\tflow: target.flow,\n\t\t\t\t\t\t\t\t\t...(flowHandleId === undefined ? {} : { flowHandleId }),\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\t\tkind: \"prefetch\",\n\t\t\t\t\t\t\t\t\tflowId: target.flowId,\n\t\t\t\t\t\t\t\t\tflowHandleId,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t).then(() => {}),\n\t\t\t\t);\n\t\t\t},\n\t\t\tprerender: (options?: PrerenderFlowOptions) => {\n\t\t\t\treturn reportAsyncError(\n\t\t\t\t\tenqueueAndWaitForSettlement((flowHandleId) =>\n\t\t\t\t\t\t\"flow\" in target\n\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\tkind: \"prerender\",\n\t\t\t\t\t\t\t\t\tflow: target.flow,\n\t\t\t\t\t\t\t\t\t...(flowHandleId === undefined ? {} : { flowHandleId }),\n\t\t\t\t\t\t\t\t\thideCloseButton: options?.hideCloseButton,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\t\tkind: \"prerender\",\n\t\t\t\t\t\t\t\t\tflowId: target.flowId,\n\t\t\t\t\t\t\t\t\tflowHandleId,\n\t\t\t\t\t\t\t\t\thideCloseButton: options?.hideCloseButton,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t).then(() => {}),\n\t\t\t\t);\n\t\t\t},\n\t\t\tclose: () => {\n\t\t\t\tclearOpenIntent();\n\t\t\t\treturn reportAsyncError(\n\t\t\t\t\ttransportAdmission\n\t\t\t\t\t\t.runOperation(({ attemptHandoff }) => {\n\t\t\t\t\t\t\treturn handleClient.runResolvedHandleCommand(\n\t\t\t\t\t\t\t\t(flowHandleId) => ({\n\t\t\t\t\t\t\t\t\tkind: \"close\" as const,\n\t\t\t\t\t\t\t\t\tflowHandleId,\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t(payload) =>\n\t\t\t\t\t\t\t\t\tattemptHandoff({\n\t\t\t\t\t\t\t\t\t\tprepare:\n\t\t\t\t\t\t\t\t\t\t\t\"flow\" in target\n\t\t\t\t\t\t\t\t\t\t\t\t? prepareInlineFlowCommandHandoff\n\t\t\t\t\t\t\t\t\t\t\t\t: prepareCommandHandoff,\n\t\t\t\t\t\t\t\t\t\thandOff: () => ({\n\t\t\t\t\t\t\t\t\t\t\tsettlement: handOffCommand(payload).then(() => {}),\n\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.then(() => {}),\n\t\t\t\t);\n\t\t\t},\n\t\t\tsetContainer: (element: HTMLElement | null) => {\n\t\t\t\tlatestContainer = element;\n\t\t\t\tconst flowHandleId = handleClient.getHandleId();\n\t\t\t\tif (!flowHandleId) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tenqueueSetContainer(flowHandleId, element);\n\t\t\t},\n\t\t\tgetFlowState: () => {\n\t\t\t\tconst flowHandleId = handleClient.getHandleId();\n\t\t\t\treturn flowHandleId\n\t\t\t\t\t? getFlowStateForHandle(flowHandleId)\n\t\t\t\t\t: cloneFlowState(DEFAULT_FLOW_STATE);\n\t\t\t},\n\t\t\tsubscribeFlowState: (\n\t\t\t\tcallback: FlowStateCallback,\n\t\t\t\toptions?: SubscribeFlowStateOptions,\n\t\t\t) => {\n\t\t\t\tif (options?.signal?.aborted) {\n\t\t\t\t\treturn () => {};\n\t\t\t\t}\n\t\t\t\tconst subscriber: SubscriberEntry = {\n\t\t\t\t\tcallback,\n\t\t\t\t\toptions,\n\t\t\t\t\tunsubscribe: null,\n\t\t\t\t};\n\t\t\t\tactiveSubscribers.add(subscriber);\n\t\t\t\tconst unsubscribeSubscriber = (): void => {\n\t\t\t\t\tif (subscriber.unsubscribe) {\n\t\t\t\t\t\tsubscriber.unsubscribe();\n\t\t\t\t\t\tsubscriber.unsubscribe = null;\n\t\t\t\t\t}\n\t\t\t\t\tactiveSubscribers.delete(subscriber);\n\t\t\t\t};\n\t\t\t\tconst flowHandleId = handleClient.getHandleId();\n\t\t\t\tif (!flowHandleId) {\n\t\t\t\t\tconst signal = options?.signal;\n\t\t\t\t\tif (signal) {\n\t\t\t\t\t\tconst onAbort = (): void => {\n\t\t\t\t\t\t\tsubscriber.unsubscribe = null;\n\t\t\t\t\t\t\tactiveSubscribers.delete(subscriber);\n\t\t\t\t\t\t};\n\t\t\t\t\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t\t\t\t\t\tsubscriber.unsubscribe = () => {\n\t\t\t\t\t\t\tsignal.removeEventListener(\"abort\", onAbort);\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\tif (options?.emitInitial !== false) {\n\t\t\t\t\t\tcallback(cloneFlowState(DEFAULT_FLOW_STATE));\n\t\t\t\t\t}\n\t\t\t\t\treturn unsubscribeSubscriber;\n\t\t\t\t}\n\t\t\t\tbindSubscriberToCurrentHandle(subscriber);\n\t\t\t\treturn unsubscribeSubscriber;\n\t\t\t},\n\t\t};\n\n\t\treturn \"flow\" in target ? run : { flowId: target.flowId, ...run };\n\t}\n\n\tconst flowRunByFlowId = new Map<string, FlowRun>();\n\tconst flow = (flowIdInput: string): FlowRun => {\n\t\tconst flowId = flowIdInput.trim();\n\t\tif (!flowId) {\n\t\t\tthrow new Error(\"flowId must be a non-empty string\");\n\t\t}\n\t\tconst existing = flowRunByFlowId.get(flowId);\n\t\tif (existing) return existing;\n\t\tconst run = createFlowRun({ flowId });\n\t\tflowRunByFlowId.set(flowId, run);\n\t\treturn run;\n\t};\n\n\tconst runClientBarrier = (kind: \"close\" | \"reset\"): Promise<void> => {\n\t\tconst flowRunResets = [...resetFlowRunsForClientBarrier];\n\t\treturn reportAsyncError(\n\t\t\ttransportAdmission.runBarrier({\n\t\t\t\tonGenerationAdvanced: () => {\n\t\t\t\t\tconst notifications: Array<() => void> = [];\n\t\t\t\t\tdeferredFlowRunNotifications = notifications;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tfor (const resetFlowRun of flowRunResets) {\n\t\t\t\t\t\t\tresetFlowRun();\n\t\t\t\t\t\t}\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tdeferredFlowRunNotifications = null;\n\t\t\t\t\t}\n\t\t\t\t\tfor (const notify of notifications) {\n\t\t\t\t\t\tnotify();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tprepare: hostWindow ? prepareCommandHandoff : () => {},\n\t\t\t\thandOff: hostWindow\n\t\t\t\t\t? () => ({ settlement: handOffCommand({ kind }).then(() => {}) })\n\t\t\t\t\t: () => ({ settlement: Promise.resolve() }),\n\t\t\t}),\n\t\t);\n\t};\n\n\tconst close = (): Promise<void> => runClientBarrier(\"close\");\n\n\tconst reset = (): Promise<void> => runClientBarrier(\"reset\");\n\n\tfunction identify(\n\t\tuserId: string,\n\t\ttraits?: IdentifyTraits,\n\t\toptions?: IdentifyOptions,\n\t): Promise<void>;\n\tfunction identify(\n\t\ttraits: IdentifyTraits,\n\t\toptions?: IdentifyOptions,\n\t): Promise<void>;\n\tfunction identify(\n\t\tidentifyInput: string | IdentifyTraits,\n\t\ttraitsOrOptions?: IdentifyTraits | IdentifyOptions,\n\t\toptions?: IdentifyOptions,\n\t): Promise<void> {\n\t\tif (!hostWindow) {\n\t\t\treturn Promise.resolve();\n\t\t}\n\t\treturn reportAsyncError(\n\t\t\tdispatch(\n\t\t\t\ttoIdentifyCommandPayload(identifyInput, traitsOrOptions, options),\n\t\t\t),\n\t\t);\n\t}\n\n\tconst track = (\n\t\teventName: string,\n\t\tproperties?: EventProperties,\n\t\toptions?: EventOptions,\n\t): Promise<void> => {\n\t\tif (!hostWindow) {\n\t\t\tparseCustomerOccurrenceName(eventName, \"eventName\");\n\t\t\treturn Promise.resolve();\n\t\t}\n\t\treturn reportAsyncError(\n\t\t\tdispatch(\n\t\t\t\tbuildCustomerOccurrenceCommand({\n\t\t\t\t\ttype: \"track\",\n\t\t\t\t\tevent: eventName,\n\t\t\t\t\tproperties,\n\t\t\t\t\toptions,\n\t\t\t\t}),\n\t\t\t),\n\t\t);\n\t};\n\n\tconst page = (\n\t\tname?: string,\n\t\tproperties?: EventProperties,\n\t\toptions?: EventOptions,\n\t): Promise<void> => {\n\t\tif (!hostWindow) {\n\t\t\tif (name !== undefined) {\n\t\t\t\tparseCustomerOccurrenceName(name, \"pageName\");\n\t\t\t}\n\t\t\treturn Promise.resolve();\n\t\t}\n\t\treturn reportAsyncError(\n\t\t\tdispatch(\n\t\t\t\tbuildCustomerOccurrenceCommand({\n\t\t\t\t\ttype: \"page\",\n\t\t\t\t\tevent:\n\t\t\t\t\t\tname === undefined ? hostWindow.location.pathname || \"/\" : name,\n\t\t\t\t\tproperties,\n\t\t\t\t\toptions,\n\t\t\t\t}),\n\t\t\t),\n\t\t);\n\t};\n\n\tconst submitFeedback = async (\n\t\tinput: FeedbackInput,\n\t): Promise<SubmitFeedbackResult> => {\n\t\tif (!hostWindow) {\n\t\t\tthrow new Error(\"Feedback submission requires a browser environment.\");\n\t\t}\n\t\tensureCommandsCanRun();\n\t\tconst registrationProbe = pendingRegistrationProbe;\n\t\tif (registrationProbe) {\n\t\t\tawait registrationProbe;\n\t\t}\n\t\tconst settlement = await reportAsyncError(\n\t\t\trawSettlementDispatch({\n\t\t\t\tkind: \"instanceFeedback.capture\",\n\t\t\t\tpayload: input,\n\t\t\t}),\n\t\t);\n\t\tif (!settlement.ok) {\n\t\t\tthrow new Error(\"Feedback submission failed.\");\n\t\t}\n\t\tconst result = getFeedbackSubmissionFromSettlementDetail(settlement);\n\t\tif (!result) {\n\t\t\tthrow new Error(\"Invalid feedback submission result.\");\n\t\t}\n\t\treturn result;\n\t};\n\n\tconst fetchFeedback = async (\n\t\tinput: FetchFeedbackInput,\n\t): Promise<FetchFeedbackResult> => {\n\t\tif (!hostWindow) {\n\t\t\tthrow new Error(\"Feedback reads require a browser environment.\");\n\t\t}\n\t\tensureCommandsCanRun();\n\t\tconst registrationProbe = pendingRegistrationProbe;\n\t\tif (registrationProbe) {\n\t\t\tawait registrationProbe;\n\t\t}\n\t\tconst settlement = await reportAsyncError(\n\t\t\trawSettlementDispatch({\n\t\t\t\tkind: \"instanceFeedback.listMine\",\n\t\t\t\tpayload: input,\n\t\t\t}),\n\t\t);\n\t\tif (!settlement.ok) {\n\t\t\tthrow new Error(\"Feedback read failed.\");\n\t\t}\n\t\tconst result = getFeedbackReadFromSettlementDetail(settlement);\n\t\tif (!result) {\n\t\t\tthrow new Error(\"Invalid feedback read result.\");\n\t\t}\n\t\treturn result;\n\t};\n\n\tconst configure = (updates: ConfigureOptions): Promise<void> => {\n\t\tif (!hostWindow) {\n\t\t\treturn Promise.resolve();\n\t\t}\n\t\tif (!isLoaderRequested()) {\n\t\t\treturn Promise.resolve();\n\t\t}\n\t\t// Send updates as-is; loader merges and forwards deltas to core.\n\t\treturn reportAsyncError(\n\t\t\tdispatch({ kind: \"configure\", opts: toConfigureCommandOptions(updates) }),\n\t\t);\n\t};\n\n\thostEventHub.subscribeOpenRequested((detail, hostEvent) => {\n\t\topenRequestBridge.observeFromLoader(detail, {\n\t\t\tpreventHostDefault: () => {\n\t\t\t\thostEvent.preventDefault();\n\t\t\t},\n\t\t});\n\t});\n\thostEventHub.subscribeHostActionRequested((detail, hostEvent) => {\n\t\tconst handler = actionRegistry.getHandler(detail.definition);\n\t\tif (!handler) {\n\t\t\tdetail.settle(\"unavailable\");\n\t\t\treturn;\n\t\t}\n\t\t// This adapter event stays inside the trusted host realm. Sandboxed Views\n\t\t// can request an action only through Core's empty, authorized RPC.\n\t\thostEvent.preventDefault();\n\t\tvoid Promise.resolve()\n\t\t\t.then(() => handler())\n\t\t\t.then(\n\t\t\t\t() => detail.settle(\"success\"),\n\t\t\t\t() => detail.settle(\"failure\"),\n\t\t\t);\n\t});\n\n\tconst client: Client = {\n\t\tload,\n\t\tsetDefaultContainerPolicy: (policy: ContainerPolicy) => {\n\t\t\tenqueueSetDefaultContainerPolicy(policy);\n\t\t},\n\t\tgetFlowState: () => getInstanceFlowState(),\n\t\tsubscribeFlowState: (\n\t\t\tcallback: FlowStateCallback,\n\t\t\toptions?: SubscribeFlowStateOptions,\n\t\t) => subscribeFlowStateForInstance(callback, options),\n\t\tflow,\n\t\tclose,\n\t\treset,\n\t\tconfigure,\n\t\tidentify,\n\t\ttrack,\n\t\tpage,\n\t\tgraph: {\n\t\t\tconnect: (relationship) =>\n\t\t\t\ttrack(\n\t\t\t\t\t\"gx.graph.relationship.connected\",\n\t\t\t\t\ttoGraphRelationshipProperties(relationship),\n\t\t\t\t),\n\t\t\tdisconnect: (relationship) =>\n\t\t\t\ttrack(\n\t\t\t\t\t\"gx.graph.relationship.disconnected\",\n\t\t\t\t\ttoGraphRelationshipProperties(relationship),\n\t\t\t\t),\n\t\t},\n\t\tfeedback: { fetch: fetchFeedback, submit: submitFeedback },\n\t\tonOpenRequested: (callback) => openRequestBridge.subscribe(callback),\n\t};\n\tattachInlineFlowClientBridge(client, {\n\t\tcreateInlineFlowRun: (inlineFlow) => createFlowRun({ flow: inlineFlow }),\n\t});\n\n\topenRequestBridgeByClient.set(client, openRequestBridge);\n\n\tregistry.set(registryKey, {\n\t\tclient,\n\t\tupdateOptions,\n\t});\n\n\tif (!disableAutoLoadConfig) {\n\t\tclient.load();\n\t}\n\n\treturn client;\n};\n",
20
+ "import {\n\tINLINE_FLOW_PERSISTED_IDENTITY_FIELDS,\n\ttype InlineFlow,\n\tinlineFlowSchema,\n} from \"@getuserfeedback/protocol/internal/inline-flow\";\nimport type { Client, FlowRun, OpenFlowOptions } from \"../client\";\nimport { getInlineFlowClientBridge } from \"./inline-flow-client-bridge\";\n\nexport type { BundledDocsClientOptions } from \"../client\";\nexport { createBundledDocsClientOptions } from \"../client\";\n\n/** Internal supplied-flow run using the normal Flow lifecycle. */\nexport type InlineFlowRun = Omit<FlowRun, \"flowId\" | \"open\"> & {\n\topen: (options?: Omit<OpenFlowOptions, \"container\">) => Promise<void>;\n};\n\nconst ARRAY_INDEX_KEY_PATTERN = /^(0|[1-9]\\d*)$/;\n\ninterface JsonSnapshotObject {\n\t[key: string]: JsonSnapshotValue;\n}\n\ntype JsonSnapshotValue =\n\t| string\n\t| number\n\t| boolean\n\t| null\n\t| JsonSnapshotValue[]\n\t| JsonSnapshotObject;\n\nconst invalidJsonSnapshot = (): never => {\n\tthrow new Error(\"Inline flow must contain only JSON values.\");\n};\n\nconst toJsonSnapshot = (\n\tvalue: unknown,\n\tancestors = new Set<object>(),\n): JsonSnapshotValue => {\n\tif (\n\t\tvalue === null ||\n\t\ttypeof value === \"string\" ||\n\t\ttypeof value === \"boolean\"\n\t) {\n\t\treturn value;\n\t}\n\tif (typeof value === \"number\") {\n\t\treturn Number.isFinite(value) ? value : invalidJsonSnapshot();\n\t}\n\tif (typeof value !== \"object\" || ancestors.has(value)) {\n\t\treturn invalidJsonSnapshot();\n\t}\n\n\tancestors.add(value);\n\ttry {\n\t\tif (Array.isArray(value)) {\n\t\t\tif (Object.getPrototypeOf(value) !== Array.prototype) {\n\t\t\t\treturn invalidJsonSnapshot();\n\t\t\t}\n\t\t\tconst ownKeys = Reflect.ownKeys(value);\n\t\t\tif (\n\t\t\t\townKeys.length !== value.length + 1 ||\n\t\t\t\townKeys.some(\n\t\t\t\t\t(key) =>\n\t\t\t\t\t\tkey !== \"length\" &&\n\t\t\t\t\t\t(typeof key !== \"string\" ||\n\t\t\t\t\t\t\t!ARRAY_INDEX_KEY_PATTERN.test(key) ||\n\t\t\t\t\t\t\tNumber(key) >= value.length),\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn invalidJsonSnapshot();\n\t\t\t}\n\t\t\tconst snapshot: JsonSnapshotValue[] = [];\n\t\t\tfor (let index = 0; index < value.length; index += 1) {\n\t\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(\n\t\t\t\t\tvalue,\n\t\t\t\t\tString(index),\n\t\t\t\t);\n\t\t\t\tif (!descriptor?.enumerable || !(\"value\" in descriptor)) {\n\t\t\t\t\treturn invalidJsonSnapshot();\n\t\t\t\t}\n\t\t\t\tsnapshot.push(toJsonSnapshot(descriptor.value, ancestors));\n\t\t\t}\n\t\t\treturn snapshot;\n\t\t}\n\n\t\tconst prototype = Object.getPrototypeOf(value);\n\t\tif (prototype !== Object.prototype && prototype !== null) {\n\t\t\treturn invalidJsonSnapshot();\n\t\t}\n\t\tconst snapshot: JsonSnapshotObject = {};\n\t\tfor (const key of Reflect.ownKeys(value)) {\n\t\t\tif (typeof key !== \"string\" || key === \"__proto__\") {\n\t\t\t\treturn invalidJsonSnapshot();\n\t\t\t}\n\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(value, key);\n\t\t\tif (!descriptor?.enumerable || !(\"value\" in descriptor)) {\n\t\t\t\treturn invalidJsonSnapshot();\n\t\t\t}\n\t\t\tif (descriptor.value === undefined) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tObject.defineProperty(snapshot, key, {\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: true,\n\t\t\t\tvalue: toJsonSnapshot(descriptor.value, ancestors),\n\t\t\t\twritable: true,\n\t\t\t});\n\t\t}\n\t\treturn snapshot;\n\t} finally {\n\t\tancestors.delete(value);\n\t}\n};\n\nconst snapshotInlineFlowInput = (flow: unknown): JsonSnapshotObject => {\n\tif (\n\t\ttypeof flow !== \"object\" ||\n\t\tflow === null ||\n\t\tArray.isArray(flow) ||\n\t\t(Object.getPrototypeOf(flow) !== Object.prototype &&\n\t\t\tObject.getPrototypeOf(flow) !== null)\n\t) {\n\t\treturn invalidJsonSnapshot();\n\t}\n\tconst snapshot = toJsonSnapshot(flow);\n\tif (\n\t\tsnapshot === null ||\n\t\tArray.isArray(snapshot) ||\n\t\ttypeof snapshot !== \"object\"\n\t) {\n\t\treturn invalidJsonSnapshot();\n\t}\n\treturn snapshot;\n};\n\nconst freezeJsonSnapshot = <Value>(value: Value): Value => {\n\tif (typeof value !== \"object\" || value === null) {\n\t\treturn value;\n\t}\n\tfor (const child of Object.values(value)) {\n\t\tfreezeJsonSnapshot(child);\n\t}\n\treturn Object.freeze(value);\n};\n\nconst snapshotInlineFlow = (flow: InlineFlow): InlineFlow => {\n\tconst snapshot = inlineFlowSchema.parse(snapshotInlineFlowInput(flow));\n\tconst definition = snapshot.definition;\n\tif (\n\t\ttypeof definition === \"object\" &&\n\t\tdefinition !== null &&\n\t\t!Array.isArray(definition)\n\t) {\n\t\tconst field = INLINE_FLOW_PERSISTED_IDENTITY_FIELDS.find(\n\t\t\t(candidate) => candidate in definition,\n\t\t);\n\t\tif (field) {\n\t\t\tthrow new Error(\n\t\t\t\t`Inline flow definitions cannot include persisted field \"${field}\".`,\n\t\t\t);\n\t\t}\n\t}\n\treturn freezeJsonSnapshot(snapshot);\n};\n\n/** First-party supplied-flow entrypoint; intentionally absent from the public SDK root. */\nexport const createInlineFlow = (\n\tclient: Client,\n\tflow: InlineFlow,\n): InlineFlowRun =>\n\tgetInlineFlowClientBridge(client).createInlineFlowRun(\n\t\tsnapshotInlineFlow(flow),\n\t);\n\nexport type { InlineFlow };\n"
21
21
  ],
22
- "mappings": "AAAA,IAAI,EAK4B,SAAS,CAAY,CAAC,EAAM,EAAa,EAAQ,CAC7E,SAAS,CAAI,CAAC,EAAM,EAAK,CACrB,GAAI,CAAC,EAAK,KACN,OAAO,eAAe,EAAM,OAAQ,CAChC,MAAO,CACH,MACA,OAAQ,EACR,OAAQ,IAAI,GAChB,EACA,WAAY,EAChB,CAAC,EAEL,GAAI,EAAK,KAAK,OAAO,IAAI,CAAI,EACzB,OAEJ,EAAK,KAAK,OAAO,IAAI,CAAI,EACzB,EAAY,EAAM,CAAG,EAErB,IAAM,EAAQ,EAAE,UACV,EAAO,OAAO,KAAK,CAAK,EAC9B,QAAS,EAAI,EAAG,EAAI,EAAK,OAAQ,IAAK,CAClC,IAAM,EAAI,EAAK,GACf,GAAI,EAAE,KAAK,GACP,EAAK,GAAK,EAAM,GAAG,KAAK,CAAI,GAKxC,IAAM,EAAS,GAAQ,QAAU,OACjC,MAAM,UAAmB,CAAO,CAChC,CACA,OAAO,eAAe,EAAY,OAAQ,CAAE,MAAO,CAAK,CAAC,EACzD,SAAS,CAAC,CAAC,EAAK,CACZ,IAAI,EACJ,IAAM,EAAO,GAAQ,OAAS,IAAI,EAAe,KACjD,EAAK,EAAM,CAAG,GACb,EAAK,EAAK,MAAM,WAAa,EAAG,SAAW,CAAC,GAC7C,QAAW,KAAM,EAAK,KAAK,SACvB,EAAG,EAEP,OAAO,EAWX,OATA,OAAO,eAAe,EAAG,OAAQ,CAAE,MAAO,CAAK,CAAC,EAChD,OAAO,eAAe,EAAG,OAAO,YAAa,CACzC,MAAO,CAAC,IAAS,CACb,GAAI,GAAQ,QAAU,aAAgB,EAAO,OACzC,MAAO,GACX,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