@player-ui/reference-assets-plugin 0.15.3--canary.836.34713 → 0.15.3--canary.836.34893

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2767/execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/dist/index.global.js","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/dlv@1.1.3/node_modules/dlv/index.js","../../../../../../../../../../../../execroot/execroot/_main/bazel-out/k8-fastbuild/bin/core/partial-match-registry/src/deep-partial-matcher.ts","../../../../../../../../../../../../execroot/execroot/_main/bazel-out/k8-fastbuild/bin/core/partial-match-registry/src/index.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/asset-transform/core/src/utils.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/asset-transform/core/src/index.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/action/transform.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/tapable-ts@0.2.4/node_modules/tapable-ts/src/utils.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/tapable-ts@0.2.4/node_modules/tapable-ts/src/index.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/sorted-array@2.0.4/node_modules/sorted-array/sorted-array.js","external-global-plugin:@player-ui/player","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/queue-microtask@1.2.3/node_modules/queue-microtask/index.js","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/index.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/input/transform.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/info/transform.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/image/transform.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/choice/transform.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/async-node/core/src/index.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/async-node/core/src/transform.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/async-node/core/src/createAsyncTransform.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/async-node/core/src/utils/traverseAndReplace.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/async-node/core/src/utils/unwrapAsset.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/async-node/core/src/utils/requiresAssetWrapper.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/async-node/core/src/utils/extractNodeFromPath.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/chat-message/transform.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/meta-plugin/core/src/index.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/plugins/chat-ui-demo-plugin.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/expression/core/src/index.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/plugins/reference-assets-transform-plugin.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/plugin.ts"],"names":["ReferenceAssetsPlugin","dlv_es_default","obj","key","def","p","undef","split","length","createObjectMatcher","partialObj","pairs","traverseObj","matchFunction","searchObj","Array","from","entry","path","value","count","size","createBasicMatcher","seed","matcher","match","composeTransforms","args","reverse","fn","fns","asset","options","store","reduce","prevValue","current","composeBefore","beforeResolve","compose","beforeResolveFns","resolveFns","arg","push","resolve","maybeCompose","maybeFn","cleanupTransformRegistry","maybeRegistry","isArray","wrappedTransforms","map","Registry","registry","forEach","set","isBackAction","action","equalToOrIn","check","includes","callTap","tap","ctx","context","callback","__create","Object","create","__defProp","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__getProtoOf","getPrototypeOf","__hasOwnProp","prototype","hasOwnProperty","__commonJS","cb","mod","__require","exports","__export","target","all","name","get","enumerable","__copyProps","to","except","desc","call","__toESM","isNodeMode","__esModule","__toCommonJS","require_sorted_array","module","SortedArray","defclass","constructor","array","compare","compareDefault","index","insert","element","high","low","pos","ordering","search","remove","splice","comparing","property","a","b","define","amd","require_player","globalThis","Player","require_queue_microtask","promise","queueMicrotask","bind","window","global","Promise","then","catch","err","setTimeout","src_exports","actionTransform","chatMessageTransform","choiceTransform","expPropTransform","imageTransform","infoTransform","inputTransform","transform","format","val","binding","data","model","formatted","includeInvalid","validation","track","dataType","type","import_sorted_array","object","Map","keys","nestedPath","createSortedArray","c","initialSet","query","callbackfn","clear","isRegistryEmpty","AssetTransformPlugin","transforms","apply","player","hooks","viewController","vc","transformRegistry","run","exp","evaluate","skipValidation","metaData","transition","force","backIconTransform","role","skipArray","plugins","stringResolver","propertiesToSkip","indexOf","infoAsset","actions","segmentedActions","segmentedActionsArray","next","prev","getImageAlt","props","placeholder","accessibility","altText","newImage","items","rest","assetHasBinding","currentValue","resetValue","transformedChoiceItems","item","id","select","unselect","clearSelection","import_player","InterceptionManager","interceptions","interceptionKeySet","Set","isUsed","intercept","int","s","add","has","i","_a","_b","loop","error","Error","asError","result","r","done","Hook","taps","resolvedOptions","Symbol","before","insertionIndex","beforeSet","t","delete","untap","filter","SyncBailHook","tapIndex","rtn","AsyncSeriesBailHook","e","import_queue_microtask","getMatchValue","pathA","pathB","matchCount","extractNodeFromPath","node","children","matchResult","bestMatch","child","matchValue","slice","traverseAndReplace","replaceFn","import_player4","NodeType","MultiNode","values","unwrapAsset","Value","find","x","requiresAssetWrapper","Asset","Applicability","defaultGetNodeId","createAsyncTransform","transformAssetType","wrapperAssetType","getNestedAsset","getAsyncNodeId","flatten","asyncNodePosition","replaceNode","unwrapped","transformed","asyncTransform","replacer","Builder","replaceFunction","asyncNode","otherValues","assetWrapper","unshift","multiNode","wrapperAsset","addChild","AsyncNodePluginSymbol","for","_AsyncNodePlugin","asyncHandler","symbol","onAsyncNode","onAsyncNodeError","plugin","applyPlugin","getPlayerInstance","playerInstance","applyPlayer","view","AsyncNodePlugin","AsyncNodePluginPlugin","parseNodeAndUpdate","parsedNode","parseNode","onValueReceived","handleAsyncUpdate","newNode","nodeResolveCache","originalNodeCache","originalNode","updateViewAST","hasValidMapping","applyResolver","resolver","isAsync","resolveAsyncChildren","resolvedNode","inProgressNodes","runAsyncNode","finally","childNode","Async","mappedNode","nodeSet","v","parent","playerState","basePlugin","String","getState","status","fail","logger","isDeterminedAsync","applyParser","parser","nodeType","childOptions","async","parsedAsync","parseObject","parsedNodeId","getNodeID","asyncAST","createASTNode","asyncNodePlugin","MetaPlugin","registerPlugin","ExpressionPlugin","expressionMap","expressions","expressionEvaluator","expEvaluator","handler","addExpressionFunction","createContentFromMessage","message","ChatUiDemoPlugin","findPlugin","warn","deferredPromises","allPromiseKeys","counter","sendMessage","nodeId","content","resolveFunction","import_player7","View","startsWith","res","_","expressionPlugin","ReferenceAssetsTransformPlugin","metaPlugin"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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ceAssetsPlugin = (() => {\n var __create = Object.create;\n var __defProp = Object.defineProperty;\n var __getOwnPropDesc = Object.getOwnPropertyDescriptor;\n var __getOwnPropNames = Object.getOwnPropertyNames;\n var __getProtoOf = Object.getPrototypeOf;\n var __hasOwnProp = Object.prototype.hasOwnProperty;\n var __commonJS = (cb, mod) => function __require() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n };\n var __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n };\n var __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n };\n var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n ));\n var __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/sorted-array@2.0.4/node_modules/sorted-array/sorted-array.js\n var require_sorted_array = __commonJS({\n \"../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/sorted-array@2.0.4/node_modules/sorted-array/sorted-array.js\"(exports, module) {\n \"use strict\";\n var SortedArray2 = function() {\n var SortedArray3 = defclass({\n constructor: function(array, compare) {\n this.array = [];\n this.compare = compare || compareDefault;\n var length = array.length, index = 0;\n while (index < length)\n this.insert(array[index++]);\n },\n insert: function(element) {\n var array = this.array, compare = this.compare, high = array.length - 1, low = 0, pos = -1, index, ordering;\n while (high >= low) {\n index = (high + low) / 2 >>> 0;\n ordering = compare(array[index], element);\n if (ordering < 0)\n low = index + 1;\n else if (ordering > 0)\n high = index - 1;\n else {\n pos = index;\n break;\n }\n ;\n }\n if (pos === -1) {\n pos = high;\n }\n pos++;\n high = array.length - 1;\n while (pos < high && compare(element, array[pos]) === 0) {\n pos++;\n }\n index = array.length;\n array.push(element);\n while (index > pos) {\n array[index] = array[--index];\n }\n array[pos] = element;\n return this;\n },\n search: function(element) {\n var array = this.array, compare = this.compare, high = array.length - 1, low = 0, index, ordering;\n while (high >= low) {\n index = (high + low) / 2 >>> 0;\n ordering = compare(array[index], element);\n if (ordering < 0)\n low = index + 1;\n else if (ordering > 0)\n high = index - 1;\n else\n return index;\n }\n return -1;\n },\n remove: function(element) {\n var index = this.search(element);\n if (index >= 0)\n this.array.splice(index, 1);\n return this;\n }\n });\n SortedArray3.comparing = function(property, array) {\n return new SortedArray3(array, function(a, b) {\n return compareDefault(a[property], b[property]);\n });\n };\n return SortedArray3;\n function defclass(prototype) {\n var constructor = prototype.constructor;\n constructor.prototype = prototype;\n return constructor;\n }\n function compareDefault(a, b) {\n if (a < b)\n return -1;\n else if (a > b)\n return 1;\n else\n return 0;\n }\n }();\n if (typeof module === \"object\")\n module.exports = SortedArray2;\n if (typeof define === \"function\" && define.amd)\n define(function() {\n return SortedArray2;\n });\n }\n });\n\n // external-global-plugin:@player-ui/player\n var require_player = __commonJS({\n \"external-global-plugin:@player-ui/player\"(exports, module) {\n \"use strict\";\n module.exports = globalThis.Player;\n }\n });\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/queue-microtask@1.2.3/node_modules/queue-microtask/index.js\n var require_queue_microtask = __commonJS({\n \"../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/queue-microtask@1.2.3/node_modules/queue-microtask/index.js\"(exports, module) {\n \"use strict\";\n var promise;\n module.exports = typeof queueMicrotask === \"function\" ? queueMicrotask.bind(typeof window !== \"undefined\" ? window : global) : (cb) => (promise || (promise = Promise.resolve())).then(cb).catch((err) => setTimeout(() => {\n throw err;\n }, 0));\n }\n });\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/index.ts\n var src_exports = {};\n __export(src_exports, {\n ReferenceAssetsPlugin: () => ReferenceAssetsPlugin,\n actionTransform: () => actionTransform,\n chatMessageTransform: () => chatMessageTransform,\n choiceTransform: () => choiceTransform,\n expPropTransform: () => expPropTransform,\n imageTransform: () => imageTransform,\n infoTransform: () => infoTransform,\n inputTransform: () => inputTransform,\n isBackAction: () => isBackAction,\n transform: () => transform2\n });\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/input/transform.ts\n var inputTransform = (asset, options) => {\n return {\n ...asset,\n format(val) {\n if (asset.binding === void 0) {\n return val;\n }\n return options.data.format(asset.binding, val);\n },\n set(val) {\n if (asset.binding === void 0) {\n return;\n }\n return options.data.model.set([[asset.binding, val]], {\n formatted: true\n });\n },\n value: asset.binding === void 0 ? \"\" : options.data.model.get(asset.binding, {\n includeInvalid: true,\n formatted: true\n }),\n validation: asset.binding === void 0 ? void 0 : options.validation?.get(asset.binding, { track: true }),\n dataType: asset.binding === void 0 ? void 0 : options.validation?.type(asset.binding)\n };\n };\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/@player-ui+partial-match-registry@0.0.0/node_modules/@player-ui/partial-match-registry/dist/index.mjs\n var import_sorted_array = __toESM(require_sorted_array(), 1);\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/dlv@1.1.3/node_modules/dlv/dist/dlv.es.js\n function dlv_es_default(t, e, l, n, r) {\n for (e = e.split ? e.split(\".\") : e, n = 0; n < e.length; n++)\n t = t ? t[e[n]] : r;\n return t === r ? l : t;\n }\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/@player-ui+partial-match-registry@0.0.0/node_modules/@player-ui/partial-match-registry/dist/index.mjs\n function traverseObj(object, path = [], pairs = /* @__PURE__ */ new Map()) {\n for (const key of Object.keys(object)) {\n const val = object[key];\n const nestedPath = [...path, key];\n if (typeof val === \"object\") {\n traverseObj(val, nestedPath, pairs);\n } else {\n pairs.set(nestedPath, val);\n }\n }\n return pairs;\n }\n function createObjectMatcher(partialObj) {\n const pairs = traverseObj(partialObj);\n const matchFunction = (searchObj) => {\n for (const entry of Array.from(pairs)) {\n const [path, value] = entry;\n if (dlv_es_default(searchObj, path) !== value) {\n return false;\n }\n }\n return true;\n };\n matchFunction.count = pairs.size;\n return matchFunction;\n }\n function createBasicMatcher(seed) {\n const matcher = (match) => seed === match;\n matcher.count = 1;\n return matcher;\n }\n var createSortedArray = () => new import_sorted_array.default([], (c) => c.matcher.count);\n var Registry = class {\n constructor(initialSet) {\n this.store = createSortedArray();\n initialSet?.forEach(([match, value]) => {\n this.set(match, value);\n });\n }\n /** Add match -> value mapping to the registry */\n set(match, value) {\n const matcher = typeof match === \"object\" ? createObjectMatcher(match) : createBasicMatcher(match);\n this.store.insert({\n key: match,\n value,\n matcher\n });\n }\n /** Fetch the best match in the registry */\n get(query) {\n for (const entry of this.store.array) {\n if (entry.matcher(query)) {\n return entry.value;\n }\n }\n }\n /** Loop over all entries and run callback */\n forEach(callbackfn) {\n for (const entry of this.store.array) {\n callbackfn(entry);\n }\n }\n /** Reset the items in the registry */\n clear() {\n this.store = createSortedArray();\n }\n /** Check if the registry is empty*/\n isRegistryEmpty() {\n return this.store.array.length === 0;\n }\n };\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/@player-ui+asset-transform-plugin@0.0.0/node_modules/@player-ui/asset-transform-plugin/dist/index.mjs\n function composeTransforms(...args) {\n const [fn, ...fns] = args.reverse();\n return (asset, options, store) => {\n const value = fn(asset, options, store);\n if (!fns.length) {\n return value;\n }\n return fns.reduce((prevValue, current) => {\n return current(prevValue, options, store);\n }, value);\n };\n }\n function composeBefore(...args) {\n return {\n beforeResolve: composeTransforms(...args)\n };\n }\n function compose(...args) {\n const beforeResolveFns = [];\n const resolveFns = [];\n for (const arg of args) {\n if (typeof arg === \"function\") {\n resolveFns.push(arg);\n } else {\n if (arg?.resolve) {\n resolveFns.push(arg.resolve);\n }\n if (arg?.beforeResolve) {\n beforeResolveFns.push(arg.beforeResolve);\n }\n }\n }\n return {\n beforeResolve: beforeResolveFns.length ? composeTransforms(...beforeResolveFns) : void 0,\n resolve: resolveFns.length ? composeTransforms(...resolveFns) : void 0\n };\n }\n function maybeCompose(maybeFn) {\n if (typeof maybeFn === \"object\") {\n return maybeFn;\n }\n return compose(maybeFn);\n }\n function cleanupTransformRegistry(maybeRegistry) {\n if (Array.isArray(maybeRegistry)) {\n const wrappedTransforms = maybeRegistry.map(([key, value]) => {\n return [key, maybeCompose(value)];\n });\n return new Registry(wrappedTransforms);\n }\n const registry = new Registry();\n maybeRegistry.forEach(({ key, value }) => {\n registry.set(key, maybeCompose(value));\n });\n return registry;\n }\n var AssetTransformPlugin = class {\n constructor(transforms) {\n this.name = \"asset-transform\";\n this.registry = cleanupTransformRegistry(transforms);\n }\n apply(player) {\n player.hooks.viewController.tap(this.name, (vc) => {\n this.registry.forEach(\n ({ key, value }) => vc.transformRegistry.set(key, maybeCompose(value))\n );\n });\n }\n };\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/action/transform.ts\n function isBackAction(action) {\n return action.value === \"Prev\";\n }\n var transform = (action, options) => {\n return {\n ...action,\n run() {\n if (action.exp) {\n options.evaluate(action.exp);\n }\n if (action.value) {\n const skipValidation = action.metaData?.skipValidation;\n options.transition?.(action.value, { force: skipValidation });\n }\n }\n };\n };\n var backIconTransform = (action) => {\n if (isBackAction(action) && action?.metaData?.role === void 0) {\n return {\n ...action,\n metaData: {\n ...action?.metaData,\n role: \"back\"\n }\n };\n }\n return action;\n };\n var expPropTransform = (asset) => {\n const skipArray = asset.plugins?.stringResolver?.propertiesToSkip;\n if (skipArray && skipArray.indexOf(\"exp\") > 1) {\n return asset;\n }\n return {\n ...asset,\n plugins: {\n ...asset.plugins,\n stringResolver: {\n ...asset?.plugins?.stringResolver,\n propertiesToSkip: [\n ...asset.plugins?.stringResolver?.propertiesToSkip ?? [],\n \"exp\"\n ]\n }\n }\n };\n };\n var actionTransform = compose(\n transform,\n backIconTransform,\n composeBefore(expPropTransform)\n );\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/info/transform.ts\n var infoTransform = (infoAsset) => {\n const actions = infoAsset?.actions;\n const segmentedActions = actions?.reduce(\n (segmentedActionsArray, action) => {\n segmentedActionsArray[isBackAction(action.asset) ? \"prev\" : \"next\"].push(action);\n return segmentedActionsArray;\n },\n { next: [], prev: [] }\n );\n return {\n ...infoAsset,\n segmentedActions\n };\n };\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/image/transform.ts\n var getImageAlt = (props) => {\n const { metaData, placeholder } = props;\n if (metaData.accessibility)\n return metaData.accessibility;\n if (placeholder)\n return placeholder;\n return \"Image\";\n };\n var imageTransform = (props) => {\n const altText = getImageAlt(props);\n const newImage = {\n ...props,\n altText\n };\n return newImage;\n };\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/choice/transform.ts\n var choiceTransform = (asset, options) => {\n const { items, binding, ...rest } = asset;\n const assetHasBinding = binding !== void 0;\n const currentValue = assetHasBinding ? options.data.model.get(binding, {\n includeInvalid: true\n }) : void 0;\n const resetValue = () => {\n if (assetHasBinding) {\n return options.data.model.set([[binding, null]]);\n }\n };\n const transformedChoiceItems = (items || []).map(\n (item, index) => ({\n ...item,\n id: item.id ?? `${asset.id}-choice-${index}`,\n select() {\n if (assetHasBinding) {\n return options.data.model.set([[binding, item.value]]);\n }\n },\n unselect: resetValue\n })\n );\n return {\n ...rest,\n binding,\n clearSelection: resetValue,\n items: transformedChoiceItems,\n value: currentValue,\n validation: assetHasBinding ? options.validation?.get(binding, { track: true }) : void 0,\n dataType: assetHasBinding ? options.validation?.type(binding) : void 0\n };\n };\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/@player-ui+async-node-plugin@0.0.0/node_modules/@player-ui/async-node-plugin/dist/index.mjs\n var import_player = __toESM(require_player(), 1);\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/tapable-ts@0.2.4/node_modules/tapable-ts/dist/hooks.mjs\n function equalToOrIn(value, check) {\n if (Array.isArray(check)) {\n return check.includes(value);\n }\n return check === value;\n }\n function callTap(tap, args, ctx) {\n if (tap.context) {\n return tap.callback(ctx, ...args);\n }\n return tap.callback(...args);\n }\n var InterceptionManager = class {\n constructor() {\n this.interceptions = [];\n this.interceptionKeySet = /* @__PURE__ */ new Set();\n }\n isUsed() {\n return this.interceptions.length > 0;\n }\n intercept(int) {\n this.interceptions.push(int);\n Object.keys(int).forEach((s) => {\n this.interceptionKeySet.add(s);\n });\n }\n tap(tap) {\n if (this.interceptionKeySet.has(\"tap\")) {\n this.interceptions.forEach((i) => {\n var _a;\n (_a = i.tap) == null ? void 0 : _a.call(i, tap);\n });\n }\n }\n call(ctx, ...args) {\n if (this.interceptionKeySet.has(\"call\")) {\n this.interceptions.forEach((i) => {\n var _a, _b;\n if (i.context) {\n (_a = i.call) == null ? void 0 : _a.call(i, ctx, ...args);\n } else {\n (_b = i.call) == null ? void 0 : _b.call(i, ...args);\n }\n });\n }\n }\n loop(...args) {\n if (this.interceptionKeySet.has(\"loop\")) {\n this.interceptions.forEach((i) => {\n var _a;\n (_a = i.loop) == null ? void 0 : _a.call(i, ...args);\n });\n }\n }\n error(err) {\n if (this.interceptionKeySet.has(\"error\")) {\n if (err instanceof Error) {\n const asError = err;\n this.interceptions.forEach((i) => {\n var _a;\n (_a = i.error) == null ? void 0 : _a.call(i, asError);\n });\n }\n }\n }\n result(r) {\n if (this.interceptionKeySet.has(\"result\")) {\n this.interceptions.forEach((i) => {\n var _a;\n (_a = i.result) == null ? void 0 : _a.call(i, r);\n });\n }\n }\n done() {\n if (this.interceptionKeySet.has(\"done\")) {\n this.interceptions.forEach((i) => {\n var _a;\n (_a = i.done) == null ? void 0 : _a.call(i);\n });\n }\n }\n };\n var Hook = class {\n constructor() {\n this.taps = [];\n this.interceptions = new InterceptionManager();\n }\n tap(options, callback) {\n const resolvedOptions = typeof options === \"string\" ? {\n name: options,\n context: false\n } : {\n context: false,\n ...options\n };\n const key = Symbol(resolvedOptions.name);\n const tap = {\n key,\n ...resolvedOptions,\n callback\n };\n if (tap.before) {\n let insertionIndex = this.taps.length;\n const beforeSet = new Set(Array.isArray(tap.before) ? tap.before : [tap.before]);\n for (insertionIndex; insertionIndex > 0 && beforeSet.size > 0; insertionIndex--) {\n const t = this.taps[insertionIndex - 1];\n if (beforeSet.has(t.name)) {\n beforeSet.delete(t.name);\n }\n if (t.before && equalToOrIn(tap.name, t.before)) {\n break;\n }\n }\n this.taps.splice(insertionIndex, 0, tap);\n } else {\n this.taps.push(tap);\n }\n this.interceptions.tap(tap);\n return tap;\n }\n untap(tap) {\n this.taps = this.taps.filter((t) => t.key !== tap.key);\n }\n isUsed() {\n return this.taps.length > 0 || this.interceptions.isUsed();\n }\n intercept(int) {\n this.interceptions.intercept(int);\n }\n };\n var SyncBailHook = class extends Hook {\n call(...args) {\n if (!this.isUsed()) {\n return;\n }\n const ctx = {};\n this.interceptions.call(ctx, ...args);\n for (let tapIndex = 0; tapIndex < this.taps.length; tapIndex += 1) {\n const rtn = callTap(this.taps[tapIndex], args, ctx);\n if (rtn !== void 0) {\n this.interceptions.result(rtn);\n return rtn;\n }\n }\n this.interceptions.done();\n }\n };\n var AsyncSeriesBailHook = class extends Hook {\n async call(...args) {\n const ctx = {};\n this.interceptions.call(ctx, ...args);\n try {\n for (let tapIndex = 0; tapIndex < this.taps.length; tapIndex += 1) {\n const rtn = await callTap(this.taps[tapIndex], args, ctx);\n if (rtn !== void 0) {\n this.interceptions.result(rtn);\n return rtn;\n }\n }\n } catch (e) {\n this.interceptions.error(e);\n throw e;\n }\n this.interceptions.done();\n }\n };\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/@player-ui+async-node-plugin@0.0.0/node_modules/@player-ui/async-node-plugin/dist/index.mjs\n var import_queue_microtask = __toESM(require_queue_microtask(), 1);\n var import_player2 = __toESM(require_player(), 1);\n var import_player3 = __toESM(require_player(), 1);\n var import_player4 = __toESM(require_player(), 1);\n var import_player5 = __toESM(require_player(), 1);\n var import_player6 = __toESM(require_player(), 1);\n var getMatchValue = (pathA, pathB) => {\n if (pathA.length > pathB.length) {\n return 0;\n }\n let matchCount = 0;\n for (let i = 0; i < pathA.length; i++) {\n if (pathA[i] === pathB[i]) {\n matchCount++;\n } else {\n return 0;\n }\n }\n return matchCount;\n };\n var extractNodeFromPath = (node, path) => {\n if (path === void 0 || path.length === 0) {\n return node;\n }\n if (!(\"children\" in node && node.children)) {\n return void 0;\n }\n let matchResult = 0;\n let bestMatch;\n for (const child of node.children) {\n const matchValue = getMatchValue(child.path, path);\n if (matchValue > matchResult) {\n matchResult = matchValue;\n bestMatch = child;\n }\n }\n if (!bestMatch) {\n return void 0;\n }\n if (matchResult >= path.length) {\n return bestMatch.value;\n }\n return extractNodeFromPath(bestMatch.value, path.slice(matchResult));\n };\n var traverseAndReplace = (node, replaceFn) => {\n if (node.type === import_player4.NodeType.MultiNode) {\n let index = 0;\n while (index < node.values.length) {\n const child = node.values[index];\n if (!child) {\n index++;\n continue;\n }\n const result = replaceFn(child);\n if (result.type === import_player4.NodeType.MultiNode) {\n node.values = [\n ...node.values.slice(0, index),\n ...result.values,\n ...node.values.slice(index + 1)\n ];\n } else {\n node.values[index] = result;\n index++;\n }\n }\n return node;\n }\n return replaceFn(node);\n };\n var unwrapAsset = (node) => {\n if (node.type !== import_player5.NodeType.Value) {\n return node;\n }\n const child = node.children?.find(\n (x) => x.path.length === 1 && x.path[0] === \"asset\"\n );\n if (!child) {\n return node;\n }\n return child.value;\n };\n var requiresAssetWrapper = (node) => {\n if (node.type === import_player6.NodeType.Asset) {\n return true;\n }\n if (node.type !== import_player6.NodeType.Applicability) {\n return false;\n }\n return node.value.type === import_player6.NodeType.Asset;\n };\n var defaultGetNodeId = (node) => {\n return `async-${node.value.id}`;\n };\n var createAsyncTransform = (options) => {\n const {\n transformAssetType,\n wrapperAssetType,\n getNestedAsset,\n getAsyncNodeId = defaultGetNodeId,\n path = [\"values\"],\n flatten = true,\n asyncNodePosition = \"append\"\n } = options;\n const replaceNode = (node) => {\n const unwrapped = unwrapAsset(node);\n if (unwrapped.type !== import_player3.NodeType.Asset || unwrapped.value.type !== transformAssetType) {\n return node;\n }\n const transformed = asyncTransform2(unwrapped);\n return extractNodeFromPath(transformed, path) ?? node;\n };\n const replacer = (node) => traverseAndReplace(node, replaceNode);\n const asyncTransform2 = (node) => {\n const id = getAsyncNodeId(node);\n const asset = getNestedAsset?.(node);\n const replaceFunction = flatten ? replacer : void 0;\n const asyncNode = import_player3.Builder.asyncNode(id, flatten, replaceFunction);\n const values = [asyncNode];\n if (asset) {\n const otherValues = [];\n if (requiresAssetWrapper(asset)) {\n otherValues.push(import_player3.Builder.assetWrapper(asset));\n } else if (asset.type === import_player3.NodeType.MultiNode) {\n otherValues.push(...asset.values);\n } else {\n otherValues.push(asset);\n }\n if (asyncNodePosition === \"append\") {\n values.unshift(...otherValues);\n } else {\n values.push(...otherValues);\n }\n }\n const multiNode = import_player3.Builder.multiNode(...values);\n const wrapperAsset = import_player3.Builder.asset({\n id: wrapperAssetType + \"-\" + id,\n type: wrapperAssetType\n });\n import_player3.Builder.addChild(wrapperAsset, path, multiNode);\n return wrapperAsset;\n };\n return asyncTransform2;\n };\n var AsyncNodePluginSymbol = Symbol.for(\"AsyncNodePlugin\");\n var _AsyncNodePlugin = class _AsyncNodePlugin2 {\n constructor(options, asyncHandler) {\n this.symbol = _AsyncNodePlugin2.Symbol;\n this.hooks = {\n onAsyncNode: new AsyncSeriesBailHook(),\n onAsyncNodeError: new SyncBailHook()\n };\n this.name = \"AsyncNode\";\n if (options?.plugins) {\n this.plugins = options.plugins;\n options.plugins.forEach((plugin) => {\n plugin.applyPlugin(this);\n });\n }\n if (asyncHandler) {\n this.hooks.onAsyncNode.tap(\n \"async\",\n async (node, callback) => {\n return await asyncHandler(node, callback);\n }\n );\n }\n }\n getPlayerInstance() {\n return this.playerInstance;\n }\n apply(player) {\n this.playerInstance = player;\n this.plugins?.forEach((plugin) => {\n plugin.applyPlayer?.(player);\n });\n player.hooks.viewController.tap(this.name, (viewController) => {\n viewController.hooks.view.tap(this.name, (view) => {\n this.plugins?.forEach((plugin) => {\n plugin.apply(view);\n });\n });\n });\n }\n };\n _AsyncNodePlugin.Symbol = AsyncNodePluginSymbol;\n var AsyncNodePlugin = _AsyncNodePlugin;\n var AsyncNodePluginPlugin = class {\n constructor() {\n this.name = \"AsyncNode\";\n }\n /**\n * Parses the node from the result and triggers an asynchronous view update if necessary.\n * @param node The asynchronous node that might be updated.\n * @param result The result obtained from resolving the async node. This could be any data structure or value.\n * @param options Options provided for node resolution, including a potential parseNode function to process the result.\n * @param view The view instance where the node resides. This can be undefined if the view is not currently active.\n */\n parseNodeAndUpdate(node, context, result, options) {\n let parsedNode = options.parseNode && result ? options.parseNode(result) : void 0;\n if (parsedNode && node.onValueReceived) {\n parsedNode = node.onValueReceived(parsedNode);\n }\n this.handleAsyncUpdate(node, context, parsedNode);\n }\n /**\n * Updates the node asynchronously based on the result provided.\n * This method is responsible for handling the update logic of asynchronous nodes.\n * It checks if the node needs to be updated based on the new result and updates the mapping accordingly.\n * If an update is necessary, it triggers an asynchronous update on the view.\n * @param node The asynchronous node that might be updated.\n * @param newNode The new node to replace the async node.\n * @param view The view instance where the node resides. This can be undefined if the view is not currently active.\n */\n handleAsyncUpdate(node, context, newNode) {\n const { nodeResolveCache, viewController, originalNodeCache } = context;\n if (nodeResolveCache.get(node.id) !== newNode) {\n nodeResolveCache.set(node.id, newNode ? newNode : node);\n const originalNode = originalNodeCache.get(node.id) ?? /* @__PURE__ */ new Set([node]);\n viewController.updateViewAST(originalNode);\n }\n }\n hasValidMapping(node, context) {\n const { nodeResolveCache } = context;\n return nodeResolveCache.has(node.id) && nodeResolveCache.get(node.id) !== node;\n }\n /**\n * Handles the asynchronous API integration for resolving nodes.\n * This method sets up a hook on the resolver's `beforeResolve` event to process async nodes.\n * @param resolver The resolver instance to attach the hook to.\n * @param view\n */\n applyResolver(resolver, context) {\n resolver.hooks.beforeResolve.tap(this.name, (node, options) => {\n if (!this.isAsync(node)) {\n return node === null ? node : this.resolveAsyncChildren(node, context);\n }\n if (options.node) {\n context.originalNodeCache.set(node.id, /* @__PURE__ */ new Set([options.node]));\n }\n const resolvedNode = context.nodeResolveCache.get(node.id);\n if (resolvedNode !== void 0) {\n return this.resolveAsyncChildren(resolvedNode, context);\n }\n if (context.inProgressNodes.has(node.id)) {\n return node;\n }\n context.inProgressNodes.add(node.id);\n (0, import_queue_microtask.default)(() => {\n this.runAsyncNode(node, context, options).finally();\n });\n return node;\n });\n }\n /**\n * Replaces child async nodes with their resolved content and flattens when necessary. Resolving the children directly helps manage the `parent` reference without needing as much work within the resolver itself.\n * Handles async node chains as well to make sure all applicable nodes can get flattened.\n * @param node - The node whose children need to be resolved.\n * @param context - the async plugin context needed to reach into the cache\n * @returns The same node but with async node children mapped to their resolved AST.\n */\n resolveAsyncChildren(node, context) {\n if (node.type === import_player.NodeType.MultiNode) {\n let index = 0;\n while (index < node.values.length) {\n const childNode = node.values[index];\n if (childNode?.type !== import_player.NodeType.Async || !this.hasValidMapping(childNode, context)) {\n index++;\n continue;\n }\n const mappedNode = context.nodeResolveCache.get(childNode.id);\n const nodeSet = /* @__PURE__ */ new Set();\n if (mappedNode.type === import_player.NodeType.MultiNode && childNode.flatten) {\n mappedNode.values.forEach((v) => {\n v.parent = node;\n nodeSet.add(v);\n });\n node.values = [\n ...node.values.slice(0, index),\n ...mappedNode.values,\n ...node.values.slice(index + 1)\n ];\n } else {\n node.values[index] = mappedNode;\n mappedNode.parent = node;\n nodeSet.add(mappedNode);\n }\n context.originalNodeCache.set(childNode.id, nodeSet);\n }\n } else if (\"children\" in node) {\n node.children?.forEach((c) => {\n while (c.value.type === import_player.NodeType.Async && this.hasValidMapping(c.value, context)) {\n const mappedNode = context.nodeResolveCache.get(c.value.id);\n context.originalNodeCache.set(c.value.id, /* @__PURE__ */ new Set([mappedNode]));\n c.value = mappedNode;\n c.value.parent = node;\n }\n });\n }\n return node;\n }\n async runAsyncNode(node, context, options) {\n try {\n const result = await this.basePlugin?.hooks.onAsyncNode.call(\n node,\n (result2) => {\n this.parseNodeAndUpdate(node, context, result2, options);\n }\n );\n context.inProgressNodes.delete(node.id);\n this.parseNodeAndUpdate(node, context, result, options);\n } catch (e) {\n const error = e instanceof Error ? e : new Error(String(e));\n const result = this.basePlugin?.hooks.onAsyncNodeError.call(error, node);\n if (result === void 0) {\n const playerState = this.basePlugin?.getPlayerInstance()?.getState();\n if (playerState?.status === \"in-progress\") {\n playerState.fail(error);\n }\n return;\n }\n options.logger?.error(\n \"Async node handling failed and resolved with a fallback. Error:\",\n error\n );\n context.inProgressNodes.delete(node.id);\n this.parseNodeAndUpdate(node, context, result, options);\n }\n }\n isAsync(node) {\n return node?.type === import_player.NodeType.Async;\n }\n isDeterminedAsync(obj) {\n return typeof obj === \"object\" && obj !== null && Object.prototype.hasOwnProperty.call(obj, \"async\");\n }\n applyParser(parser) {\n parser.hooks.parseNode.tap(\n this.name,\n (obj, nodeType, options, childOptions) => {\n if (this.isDeterminedAsync(obj)) {\n const { async, flatten, ...rest } = obj;\n const parsedAsync = parser.parseObject(rest, nodeType, options);\n const parsedNodeId = (0, import_player.getNodeID)(parsedAsync);\n if (parsedAsync === null || !parsedNodeId) {\n return childOptions ? [] : null;\n }\n const asyncAST = parser.createASTNode(\n {\n id: parsedNodeId,\n type: import_player.NodeType.Async,\n value: parsedAsync,\n flatten\n },\n obj\n );\n if (childOptions) {\n return asyncAST ? [\n {\n path: [...childOptions.path, childOptions.key],\n value: asyncAST\n }\n ] : [];\n }\n return asyncAST;\n }\n }\n );\n }\n apply(view) {\n view.hooks.parser.tap(\"async\", this.applyParser.bind(this));\n }\n applyPlayer(player) {\n player.hooks.viewController.tap(\"async\", (viewController) => {\n viewController.hooks.view.tap(\"async\", (view) => {\n const context = {\n nodeResolveCache: /* @__PURE__ */ new Map(),\n inProgressNodes: /* @__PURE__ */ new Set(),\n view,\n viewController,\n originalNodeCache: /* @__PURE__ */ new Map()\n };\n view.hooks.resolver.tap(\"async\", (resolver) => {\n this.applyResolver(resolver, context);\n });\n });\n });\n }\n applyPlugin(asyncNodePlugin) {\n this.basePlugin = asyncNodePlugin;\n }\n };\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/chat-message/transform.ts\n var transform2 = createAsyncTransform({\n transformAssetType: \"chat-message\",\n wrapperAssetType: \"collection\",\n getNestedAsset: (node) => node.children?.[0]?.value\n });\n var chatMessageTransform = compose(\n composeBefore(transform2)\n );\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/@player-ui+meta-plugin@0.0.0/node_modules/@player-ui/meta-plugin/dist/index.mjs\n var MetaPlugin = class {\n constructor(plugins = []) {\n this.name = \"meta-plugin\";\n this.plugins = plugins;\n }\n apply(player) {\n this.plugins.forEach((plugin) => player.registerPlugin(plugin));\n }\n };\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/plugins/chat-ui-demo-plugin.ts\n var import_player7 = __toESM(require_player());\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/@player-ui+expression-plugin@0.0.0/node_modules/@player-ui/expression-plugin/dist/index.mjs\n var ExpressionPlugin = class {\n constructor(expressionMap) {\n this.name = \"ExpressionPlugin\";\n this.expressions = expressionMap;\n }\n apply(player) {\n player.hooks.expressionEvaluator.tap(this.name, (expEvaluator) => {\n this.expressions.forEach((handler, name) => {\n expEvaluator.addExpressionFunction(name, handler);\n });\n });\n }\n };\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/plugins/chat-ui-demo-plugin.ts\n var createContentFromMessage = (message, id) => ({\n asset: {\n type: \"chat-message\",\n id,\n value: {\n asset: {\n type: \"text\",\n id: `${id}-value`,\n value: message\n }\n }\n }\n });\n var ChatUiDemoPlugin = class {\n constructor() {\n this.name = \"chat-ui-demo-plugin\";\n }\n apply(player) {\n const asyncNodePlugin = player.findPlugin(\n AsyncNodePlugin.Symbol\n );\n if (!asyncNodePlugin) {\n player.logger.warn(\n `Failed to apply '${this.name}'. Reason: Could not find AsyncNodePlugin.`\n );\n return;\n }\n let deferredPromises = {};\n let allPromiseKeys = [];\n let counter = 0;\n const sendMessage = (context, message, nodeId) => {\n if (nodeId && !(nodeId in deferredPromises)) {\n context.logger?.warn(\n `'send' expression called with unrecognized id '${nodeId}'`\n );\n return;\n }\n if (!nodeId && allPromiseKeys.length === 0) {\n context.logger?.warn(`'send' called with no waiting async nodes`);\n return;\n }\n const keys = nodeId ? [nodeId] : allPromiseKeys;\n for (const id of keys) {\n const content = createContentFromMessage(\n message,\n `chat-demo-${counter++}`\n );\n const resolveFunction = deferredPromises[id];\n resolveFunction?.(content);\n delete deferredPromises[id];\n }\n if (nodeId) {\n const index = allPromiseKeys.indexOf(nodeId);\n allPromiseKeys.splice(index, 1);\n } else {\n allPromiseKeys = [];\n }\n };\n asyncNodePlugin.hooks.onAsyncNode.tap(this.name, (node) => {\n if (node.parent?.parent?.type !== import_player7.NodeType.Asset && node.parent?.parent?.type !== import_player7.NodeType.View || !node.parent.parent.value.id.startsWith(\"collection-async-chat-demo\")) {\n return Promise.resolve(void 0);\n }\n return new Promise((res) => {\n deferredPromises[node.id] = res;\n allPromiseKeys.push(node.id);\n });\n });\n player.hooks.view.tap(this.name, (_) => {\n deferredPromises = {};\n allPromiseKeys = [];\n counter = 0;\n });\n const expressionPlugin = new ExpressionPlugin(\n /* @__PURE__ */ new Map([[\"send\", sendMessage]])\n );\n player.registerPlugin(expressionPlugin);\n }\n };\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/plugins/reference-assets-transform-plugin.ts\n var ReferenceAssetsTransformPlugin = class {\n constructor() {\n this.name = \"reference-assets-transforms\";\n }\n apply(player) {\n player.registerPlugin(\n new AssetTransformPlugin([\n [{ type: \"action\" }, actionTransform],\n [{ type: \"input\" }, inputTransform],\n [{ type: \"image\" }, imageTransform],\n [{ type: \"info\" }, infoTransform],\n [{ type: \"choice\" }, choiceTransform],\n [{ type: \"chat-message\" }, chatMessageTransform]\n ])\n );\n }\n };\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/plugin.ts\n var ReferenceAssetsPlugin = class {\n constructor() {\n this.name = \"reference-assets-plugin\";\n this.metaPlugin = new MetaPlugin([\n new AsyncNodePlugin({\n plugins: [new AsyncNodePluginPlugin()]\n }),\n new ReferenceAssetsTransformPlugin(),\n new ChatUiDemoPlugin()\n ]);\n }\n apply(player) {\n player.registerPlugin(this.metaPlugin);\n }\n };\n return __toCommonJS(src_exports);\n})();\n/*! Bundled license information:\n\nqueue-microtask/index.js:\n (*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)\n*/\n","export default function dlv(obj, key, def, p, undef) {\n\tkey = key.split ? key.split('.') : key;\n\tfor (p = 0; p < key.length; p++) {\n\t\tobj = obj ? obj[key[p]] : undef;\n\t}\n\treturn obj === undef ? def : obj;\n}\n","import dlv from \"dlv\";\n\n/** A function that checks overlapping properties against a reference value */\nexport type Matcher = ((searchObj: object) => boolean) & {\n /** The count represents the specificity of this matcher */\n count: number;\n};\n\n/** Traverse an object and collect any key/value pairs including nested keys */\nfunction traverseObj(\n object: Record<any, any>,\n path: string[] = [],\n pairs: Map<string[], any> = new Map(),\n): Map<string[], any> {\n for (const key of Object.keys(object)) {\n const val: any = object[key];\n const nestedPath = [...path, key];\n\n if (typeof val === \"object\") {\n traverseObj(val, nestedPath, pairs);\n } else {\n pairs.set(nestedPath, val);\n }\n }\n\n return pairs;\n}\n\n/**\n * Given a partial object, create a matcher function that checks if another object matches the specified properties\n * @param partialObj The partial object to match against\n * @returns A matcher function that checks if an object matches the partial object\n */\nexport function createObjectMatcher(partialObj: object): Matcher {\n // Convert the partial object into a list of [key, value] pairs;\n const pairs = traverseObj(partialObj);\n\n /** Generate a function to match against all of the properties we care about */\n const matchFunction = (searchObj: object) => {\n for (const entry of Array.from(pairs)) {\n const [path, value] = entry;\n\n if (dlv(searchObj, path) !== value) {\n return false;\n }\n }\n\n return true;\n };\n\n // Keep track of the specificity of the comparator\n matchFunction.count = pairs.size;\n\n return matchFunction;\n}\n","import SortedArray from \"sorted-array\";\nimport type { Matcher } from \"./deep-partial-matcher\";\nimport { createObjectMatcher } from \"./deep-partial-matcher\";\n\nexport { createObjectMatcher } from \"./deep-partial-matcher\";\n\n/** create a matcher function that matches exactly */\nfunction createBasicMatcher(seed: any): Matcher {\n /** a simple matcher function that only matches itself */\n const matcher = (match: any) => seed === match;\n matcher.count = 1;\n\n return matcher;\n}\n\ninterface RegistryIndex<V> {\n /** The original object we wanted to match on */\n key: object;\n\n /** The value to return */\n value: V;\n\n /** The matcher function for this entry */\n matcher: Matcher;\n}\n\n/** create an empty sorted array using the matcher count */\nconst createSortedArray = <V>() =>\n new SortedArray<RegistryIndex<V>>([], (c) => c.matcher.count);\n\n/**\n * A partial match registry is a map that uses an object to \"match\" against keys.\n * More specific matches take precedence over less specific ones.\n */\nexport class Registry<V> {\n private store = createSortedArray<V>();\n\n constructor(initialSet?: Array<[any, V]>) {\n initialSet?.forEach(([match, value]) => {\n this.set(match, value);\n });\n }\n\n /** Add match -> value mapping to the registry */\n set(match: any, value: V) {\n const matcher =\n typeof match === \"object\"\n ? createObjectMatcher(match)\n : createBasicMatcher(match);\n\n this.store.insert({\n key: match,\n value,\n matcher,\n });\n }\n\n /** Fetch the best match in the registry */\n get(query: any): V | undefined {\n for (const entry of this.store.array) {\n if (entry.matcher(query)) {\n return entry.value;\n }\n }\n }\n\n /** Loop over all entries and run callback */\n forEach(callbackfn: (value: RegistryIndex<V>) => void): void {\n for (const entry of this.store.array) {\n callbackfn(entry);\n }\n }\n\n /** Reset the items in the registry */\n clear() {\n this.store = createSortedArray<V>();\n }\n\n /** Check if the registry is empty*/\n isRegistryEmpty() {\n return this.store.array.length === 0;\n }\n}\n","import type {\n Resolve,\n Store,\n BeforeTransformFunction,\n TransformFunction,\n TransformFunctions,\n} from \"@player-ui/player\";\n\nfunction composeTransforms(\n ...args: TransformFunction<any>[]\n): TransformFunction<any>;\n\nfunction composeTransforms(\n ...args: BeforeTransformFunction<any>[]\n): BeforeTransformFunction<any>;\n\n/**\n * More closely resembles the `compose` function you may have used. Performs\n * right-to-left function evaluation, but leveraging the common signature for\n * Transform Functions. The `options` and `store` is unchanging for each\n * transform since only `value` is returned, allowing them to safely be passed\n * into each transform.\n */\nfunction composeTransforms(\n ...args: TransformFunction<any>[] | BeforeTransformFunction<any>[]\n): TransformFunction<any> | BeforeTransformFunction<any> {\n const [fn, ...fns] = args.reverse();\n\n return (asset: any, options: Resolve.NodeResolveOptions, store: Store) => {\n const value = fn(asset, options, store);\n\n if (!fns.length) {\n return value;\n }\n\n return fns.reduce((prevValue, current) => {\n return current(prevValue, options, store);\n }, value);\n };\n}\n\n/**\n * Helper function to make it easier to create transforms that need to be ran in\n * the `beforeResolve` hook. Just like `compose`, functions are evaluated from\n * right-to-left.\n */\nexport function composeBefore(\n ...args: BeforeTransformFunction<any>[]\n): TransformFunctions {\n return {\n beforeResolve: composeTransforms(...args),\n };\n}\n\n/**\n * Performs right-to-left function evaluation of each transform function. Unlike\n * other compose functions, this does not require unary arguments for all but the\n * last function. The value returned from each function will be used as the value\n * for the next function.\n */\nexport function compose(\n ...args: Array<TransformFunction<any> | TransformFunctions>\n): TransformFunctions {\n const beforeResolveFns: BeforeTransformFunction<any>[] = [];\n const resolveFns: TransformFunction<any>[] = [];\n\n for (const arg of args) {\n if (typeof arg === \"function\") {\n resolveFns.push(arg);\n } else {\n if (arg?.resolve) {\n resolveFns.push(arg.resolve);\n }\n\n if (arg?.beforeResolve) {\n beforeResolveFns.push(arg.beforeResolve);\n }\n }\n }\n\n return {\n beforeResolve: beforeResolveFns.length\n ? composeTransforms(...beforeResolveFns)\n : undefined,\n resolve: resolveFns.length ? composeTransforms(...resolveFns) : undefined,\n };\n}\n","import type {\n Player,\n PlayerPlugin,\n TransformRegistry,\n TransformFunction,\n TransformFunctions,\n} from \"@player-ui/player\";\nimport { Registry } from \"@player-ui/partial-match-registry\";\nimport { compose } from \"./utils\";\n\nexport * from \"./utils\";\nexport * from \"./propertiesToSkip\";\n\nexport type TransformType = TransformFunction<any> | TransformFunctions;\nexport type TransformRegistryEntries = Array<[any, TransformType]>;\nexport type AssetTransformInit =\n | Registry<TransformType>\n | TransformRegistryEntries;\n\n/**\n * Normalize asset transform values so that they are all objects that contains\n * the resolve & beforeResolve functions.\n */\nfunction maybeCompose(maybeFn: any): TransformFunctions {\n if (typeof maybeFn === \"object\") {\n return maybeFn;\n }\n\n return compose(maybeFn);\n}\n\n/**\n * Standardize each variation of Asset Registry input into the same transform\n * registry shape.\n */\nfunction cleanupTransformRegistry(\n maybeRegistry: AssetTransformInit,\n): TransformRegistry {\n if (Array.isArray(maybeRegistry)) {\n const wrappedTransforms = maybeRegistry.map(([key, value]) => {\n return [key, maybeCompose(value)] as [any, TransformFunctions];\n });\n\n return new Registry(wrappedTransforms);\n }\n\n const registry = new Registry<TransformFunctions>();\n\n maybeRegistry.forEach(({ key, value }) => {\n registry.set(key, maybeCompose(value));\n });\n\n return registry;\n}\n\n/**\n * A plugin to register custom transforms on certain asset types\n * This allows users to embed stateful data into transforms.\n */\nexport class AssetTransformPlugin implements PlayerPlugin {\n name = \"asset-transform\";\n public readonly registry: TransformRegistry;\n\n constructor(transforms: AssetTransformInit) {\n this.registry = cleanupTransformRegistry(transforms);\n }\n\n apply(player: Player) {\n player.hooks.viewController.tap(this.name, (vc) => {\n this.registry.forEach(({ key, value }) =>\n vc.transformRegistry.set(key, maybeCompose(value)),\n );\n });\n }\n}\n","import type {\n Asset,\n TransformFunction,\n BeforeTransformFunction,\n} from \"@player-ui/player\";\nimport { compose, composeBefore } from \"@player-ui/asset-transform-plugin\";\nimport type { ActionAsset, TransformedAction } from \"./types\";\n\n/**\n * Function to find prev button\n */\nexport function isBackAction(action: ActionAsset): boolean {\n return action.value === \"Prev\";\n}\n\n/**\n * Attaches the methods to execute an action to an action\n */\nconst transform: TransformFunction<ActionAsset, TransformedAction> = (\n action,\n options,\n) => {\n return {\n ...action,\n run() {\n if (action.exp) {\n options.evaluate(action.exp);\n }\n\n if (action.value) {\n const skipValidation = action.metaData?.skipValidation;\n options.transition?.(action.value, { force: skipValidation });\n }\n },\n };\n};\n\n/**\n * De couples back button from the back icon\n */\nconst backIconTransform: TransformFunction<ActionAsset, ActionAsset> = (\n action,\n) => {\n /** For previous versions of player, the back button would already have the back icon.\n * This ensures that the old functionality does not break and back button is still visible when they update the player.\n */\n if (isBackAction(action) && action?.metaData?.role === undefined) {\n return {\n ...action,\n metaData: {\n ...action?.metaData,\n role: \"back\",\n },\n };\n }\n\n return action;\n};\n\n/**\n * Appends `exp` to the plugins.stringResolver.propertiesToSkip array or creates it if it doesn't exist\n *\n * @param asset - Asset to apply the transform to\n */\nexport const expPropTransform: BeforeTransformFunction<Asset> = (asset) => {\n const skipArray = asset.plugins?.stringResolver?.propertiesToSkip;\n\n if (skipArray && skipArray.indexOf(\"exp\") > 1) {\n return asset;\n }\n\n return {\n ...asset,\n plugins: {\n ...asset.plugins,\n stringResolver: {\n ...asset?.plugins?.stringResolver,\n propertiesToSkip: [\n ...(asset.plugins?.stringResolver?.propertiesToSkip ?? []),\n \"exp\",\n ],\n },\n },\n };\n};\n\nexport const actionTransform = compose(\n transform,\n backIconTransform,\n composeBefore(expPropTransform),\n);\n","/**\n * Checks if `value` is equal to `check` if `check` is a string or in `check` if check is an Array\n *\n * @param value - the value being searched for\n * @param check - the values to check against\n * @returns `boolean`\n */\nexport function equalToOrIn(value: string, check: string | Array<string>) {\n if (Array.isArray(check)) {\n return check.includes(value);\n }\n\n return check === value;\n}\n","import { equalToOrIn } from \"./utils\";\n\nexport type Interceptor<Args extends any[], ReturnType, ContextType> = {\n /** An optional name for the interceptor */\n name?: string;\n /** Callback for each loop when used by the hook */\n loop?: (...args: Args) => void;\n /** Callback when an error occurs during the hook's call */\n error?: (err: Error) => void;\n /** Callback when a result is found for a hook's invocation */\n result?: (\n r: ReturnType extends Promise<infer AwaitedValue>\n ? AwaitedValue\n : ReturnType\n ) => void;\n /** Callback when a hook's call is complete */\n done?: () => void;\n /** Callback when a hook is tapped */\n tap?: (tap: Tap<Args, ReturnType, ContextType>) => void;\n} & (\n | {\n /** If context should be omitted from the 'call'. This is the default */\n context?: false;\n /** Callback when the hook is tapped without context */\n call?: (...args: Args) => void;\n }\n | {\n /** If context should be included in the 'call' */\n context: true;\n /** Callback when the hook is tapped with context */\n call?: (context: ContextType, ...args: Args) => void;\n }\n);\n\nexport type Tap<Args extends any[], ReturnType, ContextType = unknown> = {\n key: symbol;\n name: string;\n before?: string | Array<string>;\n} & (\n | {\n context: false;\n callback: (...args: Args) => ReturnType;\n }\n | {\n context: true;\n callback: (context: ContextType, ...args: Args) => ReturnType;\n }\n);\n\ntype BasicTap<Args extends any[], ReturnType, ContextType> = (\n name: string,\n callback: (...args: Args) => ReturnType,\n before?: string | Array<string>\n) => Tap<Args, ReturnType, ContextType>;\n\ntype TapWithContext<Args extends any[], ReturnType, ContextType> =\n | ((\n options: {\n name: string;\n context?: false;\n before?: string | Array<string>;\n },\n callback: (...args: Args) => ReturnType\n ) => Tap<Args, ReturnType>)\n | ((\n options: {\n name: string;\n context: true;\n before?: string | Array<string>;\n },\n callback: (context: ContextType, ...args: Args) => ReturnType\n ) => Tap<Args, ReturnType>);\n\ninterface SyncBaseHookType<Args extends any[], ReturnType, ContextType> {\n tap:\n | BasicTap<Args, ReturnType, ContextType>\n | TapWithContext<Args, ReturnType, ContextType>;\n call(...args: Args): void;\n untap(key: Tap<Args, ReturnType>): void;\n isUsed(): boolean;\n intercept(int: Interceptor<Args, ReturnType, ContextType>): void;\n}\n\nfunction callTap<Args extends any[], ReturnType, ContextType>(\n tap: Tap<Args, ReturnType, ContextType>,\n args: Args,\n ctx: ContextType\n) {\n if (tap.context) {\n return tap.callback(ctx, ...args);\n }\n\n return tap.callback(...args);\n}\n\n/** A manager for all intercepts inside of a tap */\nclass InterceptionManager<\n Args extends any[],\n ReturnType,\n ContextType = Record<string, any>\n> {\n protected interceptions: Array<Interceptor<Args, ReturnType, ContextType>>;\n private interceptionKeySet: Set<\n keyof Interceptor<Args, ReturnType, ContextType>\n >;\n\n constructor() {\n this.interceptions = [];\n this.interceptionKeySet = new Set();\n }\n\n isUsed() {\n return this.interceptions.length > 0;\n }\n\n intercept(int: Interceptor<Args, ReturnType, ContextType>): void {\n this.interceptions.push(int);\n Object.keys(int).forEach((s) => {\n this.interceptionKeySet.add(s as any);\n });\n }\n\n tap(tap: Tap<Args, ReturnType, ContextType>): void {\n if (this.interceptionKeySet.has(\"tap\")) {\n this.interceptions.forEach((i) => {\n i.tap?.(tap);\n });\n }\n }\n\n call(ctx: ContextType, ...args: Args): void {\n if (this.interceptionKeySet.has(\"call\")) {\n this.interceptions.forEach((i) => {\n if (i.context) {\n i.call?.(ctx, ...args);\n } else {\n i.call?.(...args);\n }\n });\n }\n }\n\n loop(...args: Args): void {\n if (this.interceptionKeySet.has(\"loop\")) {\n this.interceptions.forEach((i) => {\n i.loop?.(...args);\n });\n }\n }\n\n error(err: unknown): void {\n if (this.interceptionKeySet.has(\"error\")) {\n if (err instanceof Error) {\n const asError: Error = err;\n this.interceptions.forEach((i) => {\n i.error?.(asError);\n });\n }\n }\n }\n\n result(\n r: ReturnType extends Promise<infer AwaitedValue>\n ? AwaitedValue\n : ReturnType\n ): void {\n if (this.interceptionKeySet.has(\"result\")) {\n this.interceptions.forEach((i) => {\n i.result?.(r);\n });\n }\n }\n\n done(): void {\n if (this.interceptionKeySet.has(\"done\")) {\n this.interceptions.forEach((i) => {\n i.done?.();\n });\n }\n }\n}\n\nabstract class Hook<\n Args extends any[],\n ReturnType,\n ContextType = Record<string, any>\n> implements SyncBaseHookType<Args, ReturnType, ContextType>\n{\n protected taps: Array<Tap<Args, ReturnType, ContextType>>;\n protected interceptions: InterceptionManager<Args, ReturnType, ContextType>;\n\n constructor() {\n this.taps = [];\n this.interceptions = new InterceptionManager<\n Args,\n ReturnType,\n ContextType\n >();\n }\n\n public tap(\n options: { name: string; context?: false; before?: string | Array<string> },\n callback: (...args: Args) => ReturnType\n ): Tap<Args, ReturnType, ContextType>;\n\n public tap(\n options: { name: string; context: true; before?: string | Array<string> },\n callback: (ctx: ContextType, ...args: Args) => ReturnType\n ): Tap<Args, ReturnType, ContextType>;\n\n public tap(\n name: string,\n callback: (...args: Args) => ReturnType\n ): Tap<Args, ReturnType, ContextType>;\n\n public tap(options: any, callback: any): Tap<Args, ReturnType, ContextType> {\n const resolvedOptions =\n typeof options === \"string\"\n ? {\n name: options,\n context: false,\n }\n : {\n context: false,\n ...options,\n };\n\n const key = Symbol(resolvedOptions.name);\n const tap: Tap<Args, ReturnType, ContextType> = {\n key,\n ...resolvedOptions,\n callback,\n };\n\n if (tap.before) {\n let insertionIndex = this.taps.length;\n const beforeSet = new Set(\n Array.isArray(tap.before) ? tap.before : [tap.before]\n );\n for (\n insertionIndex;\n insertionIndex > 0 && beforeSet.size > 0;\n insertionIndex--\n ) {\n const t = this.taps[insertionIndex - 1];\n if (beforeSet.has(t.name)) {\n beforeSet.delete(t.name);\n }\n\n if (t.before && equalToOrIn(tap.name, t.before)) {\n break;\n }\n }\n\n this.taps.splice(insertionIndex, 0, tap);\n } else {\n this.taps.push(tap);\n }\n\n this.interceptions.tap(tap);\n\n return tap;\n }\n\n abstract call(...args: Args): ReturnType;\n\n public untap(tap: Tap<Args, ReturnType, ContextType>) {\n this.taps = this.taps.filter((t) => t.key !== tap.key);\n }\n\n public isUsed() {\n return this.taps.length > 0 || this.interceptions.isUsed();\n }\n\n public intercept(int: Interceptor<Args, ReturnType, ContextType>): void {\n this.interceptions.intercept(int);\n }\n}\n\nexport class SyncHook<\n Args extends any[],\n ContextType = Record<string, any>\n> extends Hook<Args, void, ContextType> {\n public call(...args: Args) {\n if (!this.isUsed()) {\n return;\n }\n\n const ctx: ContextType = {} as any;\n\n this.interceptions.call(ctx, ...args);\n\n try {\n this.taps.forEach((t) => {\n callTap(t, args, ctx);\n });\n } catch (err: unknown) {\n this.interceptions.error(err);\n\n throw err;\n }\n\n this.interceptions.done();\n }\n}\n\nexport class SyncBailHook<\n Args extends any[],\n ReturnType,\n ContextType = Record<string, any>\n> extends Hook<Args, ReturnType | undefined | null, ContextType> {\n public call(...args: Args): ReturnType | undefined | null {\n if (!this.isUsed()) {\n return;\n }\n\n const ctx: ContextType = {} as any;\n\n this.interceptions.call(ctx, ...args);\n\n for (let tapIndex = 0; tapIndex < this.taps.length; tapIndex += 1) {\n const rtn = callTap(this.taps[tapIndex], args, ctx);\n if (rtn !== undefined) {\n this.interceptions.result(rtn as any);\n return rtn;\n }\n }\n\n this.interceptions.done();\n }\n}\n\nexport class SyncWaterfallHook<\n Args extends any[],\n ContextType = Record<string, any>\n> extends Hook<Args, Args[0], ContextType> {\n public call(...args: Args): Args[0] {\n const ctx: ContextType = {} as any;\n\n this.interceptions.call(ctx, ...args);\n\n // eslint-disable-next-line prefer-const\n let [rtn, ...rest] = args;\n\n for (let tapIndex = 0; tapIndex < this.taps.length; tapIndex += 1) {\n const tapValue = callTap(this.taps[tapIndex], [rtn, ...rest] as any, ctx);\n if (tapValue !== undefined) {\n rtn = tapValue;\n }\n }\n\n this.interceptions.result(rtn);\n\n return rtn;\n }\n}\n\nexport class SyncLoopHook<\n Args extends any[],\n ContextType = Record<string, any>\n> extends Hook<Args, void, ContextType> {\n public call(...args: Args) {\n let finished = false;\n const ctx: ContextType = {} as any;\n\n this.interceptions.call(ctx, ...args);\n\n try {\n while (finished !== true) {\n finished = true;\n this.interceptions.loop(...args);\n for (let tapIndex = 0; tapIndex < this.taps.length; tapIndex += 1) {\n const rtn = callTap(this.taps[tapIndex], args, ctx);\n\n if (rtn !== undefined) {\n finished = false;\n break;\n }\n }\n }\n } catch (e: unknown) {\n this.interceptions.error(e);\n throw e;\n }\n\n this.interceptions.done();\n }\n}\n\nexport class AsyncParallelHook<\n Args extends any[],\n ContextType = Record<string, any>\n> extends Hook<Args, Promise<void>, ContextType> {\n public async call(...args: Args): Promise<void> {\n const ctx: ContextType = {} as any;\n this.interceptions.call(ctx, ...args);\n\n await Promise.allSettled(this.taps.map((tap) => callTap(tap, args, ctx)));\n this.interceptions.done();\n }\n}\n\nexport class AsyncParallelBailHook<\n Args extends any[],\n ReturnType,\n ContextType = Record<string, any>\n> extends Hook<Args, Promise<ReturnType>, ContextType> {\n public async call(...args: Args): Promise<ReturnType> {\n const ctx: ContextType = {} as any;\n\n this.interceptions.call(ctx, ...args);\n\n try {\n const rtn = await Promise.race(\n this.taps.map((tap) => callTap(tap, args, ctx))\n );\n\n this.interceptions.result(rtn as any);\n return rtn;\n } catch (e: unknown) {\n this.interceptions.error(e);\n throw e;\n }\n }\n}\n\nexport class AsyncSeriesHook<\n Args extends any[],\n ContextType = Record<string, any>\n> extends Hook<Args, Promise<void>, ContextType> {\n public async call(...args: Args): Promise<void> {\n const ctx: ContextType = {} as any;\n\n this.interceptions.call(ctx, ...args);\n\n try {\n for (let tapIndex = 0; tapIndex < this.taps.length; tapIndex += 1) {\n await callTap(this.taps[tapIndex], args, ctx);\n }\n } catch (e: unknown) {\n this.interceptions.error(e);\n throw e;\n }\n\n this.interceptions.done();\n }\n}\n\nexport class AsyncSeriesBailHook<\n Args extends any[],\n ReturnType,\n ContextType = Record<string, any>\n> extends Hook<Args, Promise<ReturnType | undefined | null>, ContextType> {\n public async call(...args: Args): Promise<ReturnType | undefined | null> {\n const ctx: ContextType = {} as any;\n\n this.interceptions.call(ctx, ...args);\n\n try {\n for (let tapIndex = 0; tapIndex < this.taps.length; tapIndex += 1) {\n const rtn = await callTap(this.taps[tapIndex], args, ctx);\n if (rtn !== undefined) {\n this.interceptions.result(rtn);\n return rtn;\n }\n }\n } catch (e: unknown) {\n this.interceptions.error(e);\n throw e;\n }\n\n this.interceptions.done();\n }\n}\n\nexport class AsyncSeriesWaterfallHook<\n Args extends any[],\n ContextType = Record<string, any>\n> extends Hook<Args, Promise<Args[0]>, ContextType> {\n public async call(...args: Args): Promise<Args[0]> {\n // eslint-disable-next-line prefer-const\n let [rtn, ...rest] = args;\n const ctx: ContextType = {} as any;\n\n this.interceptions.call(ctx, ...args);\n\n try {\n for (let tapIndex = 0; tapIndex < this.taps.length; tapIndex += 1) {\n const tapValue = await callTap(\n this.taps[tapIndex],\n [rtn, ...rest] as any,\n ctx\n );\n if (tapValue !== undefined) {\n rtn = tapValue;\n }\n }\n } catch (e: unknown) {\n this.interceptions.error(e);\n throw e;\n }\n\n this.interceptions.result(rtn);\n\n return rtn;\n }\n}\n\nexport class AsyncSeriesLoopHook<\n Args extends any[],\n ContextType = Record<string, any>\n> extends Hook<Args, Promise<void>, ContextType> {\n public async call(...args: Args): Promise<void> {\n let finished = false;\n const ctx: ContextType = {} as any;\n\n this.interceptions.call(ctx, ...args);\n\n try {\n while (finished !== true) {\n finished = true;\n this.interceptions.loop(...args);\n for (let tapIndex = 0; tapIndex < this.taps.length; tapIndex += 1) {\n const rtn = await callTap(this.taps[tapIndex], args, ctx);\n\n if (rtn !== undefined) {\n finished = false;\n break;\n }\n }\n }\n } catch (e: unknown) {\n this.interceptions.error(e);\n throw e;\n }\n\n this.interceptions.done();\n }\n}\n","var SortedArray = (function () {\n var SortedArray = defclass({\n\n constructor: function (array, compare) {\n this.array = [];\n this.compare = compare || compareDefault;\n var length = array.length,\n index = 0;\n while (index < length) this.insert(array[index++]);\n },\n insert: function (element) {\n var array = this.array,\n compare = this.compare,\n high = array.length-1,\n low = 0,\n pos = -1,\n index,\n ordering;\n\n // The array is sorted. You must find the position of new element in O(log(n)), not O(n).\n while (high >= low) {\n index = (high + low) / 2 >>> 0;\n ordering = compare(array[index], element); \n if (ordering < 0) low = index + 1;\n else if (ordering > 0) high = index - 1;\n else {\n pos = index;\n break;\n };\n }\n\n if (pos === -1) {\n // if element was not found, high < low.\n pos = high;\n }\n // This assures that equal elements inserted after will be in a higher position in array.\n // They can be equal for comparison purposes, but different objects with different data.\n // Respecting the chronological order can be important for many applications.\n pos++;\n high = array.length-1;\n while ((pos < high) && (compare(element, array[pos]) === 0)){\n pos++;\n }\n index = array.length;\n // Just to increase array size.\n array.push(element); \n // Much faster. No need to elements swap.\n while (index > pos) {\n array[index] = array[--index];\n }\n // Set the new element on its correct position.\n array[pos] = element;\n\n return this;\n },\n search: function (element) {\n var array = this.array,\n compare = this.compare,\n high = array.length-1,\n low = 0,\n // In most languages, inner variable declaration makes the code slower.\n index,\n ordering;\n\n while (high >= low) {\n index = (high + low) / 2 >>> 0;\n ordering = compare(array[index], element);\n\n if (ordering < 0) low = index + 1;\n else if (ordering > 0) high = index - 1;\n else return index;\n }\n\n return -1;\n },\n remove: function (element) {\n var index = this.search(element);\n if (index >= 0) this.array.splice(index, 1);\n return this;\n }\n });\n\n SortedArray.comparing = function (property, array) {\n return new SortedArray(array, function (a, b) {\n // This should be faster than calling functions.\n // Besides, this way it is not needed to create useless function to return property value.\n return compareDefault(a[property], b[property]);\n });\n };\n\n return SortedArray;\n\n function defclass(prototype) {\n var constructor = prototype.constructor;\n constructor.prototype = prototype;\n return constructor;\n }\n\n function compareDefault(a, b) {\n // Equality has a very low chance to happen. It should be the last option.\n if (a < b)\n return -1;\n else if (a > b)\n return 1;\n else\n return 0;\n }\n}());\n\nif (typeof module === \"object\") module.exports = SortedArray;\nif (typeof define === \"function\" && define.amd)\n define(function () { return SortedArray; });\n","module.exports = globalThis.Player","/*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */\nlet promise\n\nmodule.exports = typeof queueMicrotask === 'function'\n ? queueMicrotask.bind(typeof window !== 'undefined' ? window : global)\n // reuse resolved promise, and allocate it lazily\n : cb => (promise || (promise = Promise.resolve()))\n .then(cb)\n .catch(err => setTimeout(() => { throw err }, 0))\n","export * from \"./assets\";\nexport * from \"./plugin\";\n","import type { TransformFunction } from \"@player-ui/player\";\nimport type { InputAsset, TransformedInput } from \"./types\";\n\n/**\n * Docs about the asset transform\n */\nexport const inputTransform: TransformFunction<InputAsset, TransformedInput> = (\n asset,\n options,\n) => {\n return {\n ...asset,\n format(val) {\n if (asset.binding === undefined) {\n return val;\n }\n\n return options.data.format(asset.binding, val);\n },\n set(val) {\n if (asset.binding === undefined) {\n return;\n }\n\n return options.data.model.set([[asset.binding, val]], {\n formatted: true,\n });\n },\n value:\n asset.binding === undefined\n ? \"\"\n : options.data.model.get(asset.binding, {\n includeInvalid: true,\n formatted: true,\n }),\n validation:\n asset.binding === undefined\n ? undefined\n : options.validation?.get(asset.binding, { track: true }),\n dataType:\n asset.binding === undefined\n ? undefined\n : options.validation?.type(asset.binding),\n };\n};\n","import type { TransformFunction } from \"@player-ui/player\";\nimport type { AssetWrapper } from \"@player-ui/player\";\nimport type { InfoAsset, InfoAssetTransform } from \"./types\";\nimport type { ActionAsset } from \"../action/types\";\nimport { isBackAction } from \"../action/transform\";\n\n/**\n * This transform should add segmentedActions to the info asset.\n * Segmented actions display side by side in larger viewports. Segmented Actions is an object of next and prev actions\n */\nexport const infoTransform: TransformFunction<InfoAsset, InfoAssetTransform> = (\n infoAsset,\n) => {\n const actions = infoAsset?.actions;\n const segmentedActions = actions?.reduce(\n (segmentedActionsArray, action) => {\n segmentedActionsArray[\n isBackAction(action.asset as ActionAsset) ? \"prev\" : \"next\"\n ].push(action as AssetWrapper<ActionAsset>);\n return segmentedActionsArray;\n },\n { next: [], prev: [] } as {\n /**\n * next is an array of next actions\n */\n next: Array<AssetWrapper<ActionAsset>>;\n /**\n * prev is an array of prev actions\n */\n prev: Array<AssetWrapper<ActionAsset>>;\n },\n );\n\n return {\n ...infoAsset,\n segmentedActions,\n };\n};\n","import type { TransformFunction } from \"@player-ui/player\";\nimport type { ImageAsset, TransformedImage } from \"./types\";\n\n/**\n * Function to retrieve the desired alt text based on passed in props.\n * @param props Image props\n * @returns The alt text for the image asset\n */\nconst getImageAlt = (props: ImageAsset): string => {\n const { metaData, placeholder } = props;\n if (metaData.accessibility) return metaData.accessibility;\n\n if (placeholder) return placeholder;\n\n return \"Image\";\n};\n\n/**\n * Sets the Image's placeholder and accessibilty\n */\nexport const imageTransform: TransformFunction<ImageAsset, TransformedImage> = (\n props,\n) => {\n const altText = getImageAlt(props);\n\n const newImage = {\n ...props,\n altText,\n };\n\n return newImage;\n};\n","import type { TransformFunction } from \"@player-ui/player\";\nimport type {\n ChoiceAsset,\n TransformedChoice,\n TransformedChoiceItem,\n} from \"./types\";\n\n/**\n * Docs about the asset transform\n */\nexport const choiceTransform: TransformFunction<\n ChoiceAsset,\n TransformedChoice\n> = (asset, options) => {\n const { items, binding, ...rest } = asset;\n\n const assetHasBinding = binding !== undefined;\n\n const currentValue = assetHasBinding\n ? options.data.model.get(binding, {\n includeInvalid: true,\n })\n : undefined;\n\n const resetValue = () => {\n if (assetHasBinding) {\n return options.data.model.set([[binding, null]]);\n }\n };\n\n const transformedChoiceItems: TransformedChoiceItem[] = (items || []).map(\n (item, index) => ({\n ...item,\n id: item.id ?? `${asset.id}-choice-${index}`,\n select() {\n if (assetHasBinding) {\n return options.data.model.set([[binding, item.value]]);\n }\n },\n unselect: resetValue,\n }),\n );\n\n return {\n ...rest,\n binding,\n clearSelection: resetValue,\n items: transformedChoiceItems,\n value: currentValue,\n validation: assetHasBinding\n ? options.validation?.get(binding, { track: true })\n : undefined,\n dataType: assetHasBinding ? options.validation?.type(binding) : undefined,\n };\n};\n","import { NodeType, getNodeID } from \"@player-ui/player\";\nimport type {\n Player,\n PlayerPlugin,\n Node,\n ParseObjectOptions,\n ParseObjectChildOptions,\n ViewInstance,\n Parser,\n ViewPlugin,\n Resolver,\n Resolve,\n ViewController,\n} from \"@player-ui/player\";\nimport { AsyncSeriesBailHook, SyncBailHook } from \"tapable-ts\";\nimport queueMicrotask from \"queue-microtask\";\n\nexport * from \"./types\";\nexport * from \"./transform\";\nexport * from \"./createAsyncTransform\";\n\n/** Object type for storing data related to a single `apply` of the `AsyncNodePluginPlugin`\n * This object should be setup once per ViewInstance to keep any cached info just for that view to avoid conflicts of shared async node ids across different view states.\n */\ntype AsyncPluginContext = {\n /** Map of async node id to resolved content */\n nodeResolveCache: Map<string, Node.Node>;\n /** The view instance this context is attached to. */\n view: ViewInstance;\n /** The view controller this context is attached to. */\n viewController: ViewController;\n /** Map of async node id to promises being used to resolve them */\n inProgressNodes: Set<string>;\n /** Map of async node ids to the original node they represent.\n * In some cases, async nodes are transformed into from other node types so the original reference is needed in order to trigger an update on the view when the async node changes.\n */\n originalNodeCache: Map<string, Set<Node.Node>>;\n};\n\nexport interface AsyncNodePluginOptions {\n /** A set of plugins to load */\n plugins?: AsyncNodeViewPlugin[];\n}\n\nexport interface AsyncNodeViewPlugin extends ViewPlugin {\n /** Use this to tap into the async node plugin hooks */\n applyPlugin: (asyncNodePlugin: AsyncNodePlugin) => void;\n\n applyPlayer?: (player: Player) => void;\n}\nexport type AsyncHandler = (\n node: Node.Async,\n callback?: (result: any) => void,\n) => Promise<any>;\n\nexport type AsyncContent = {\n async: true;\n flatten?: boolean;\n [key: string]: unknown;\n};\n\n/** Hook declaration for the AsyncNodePlugin */\nexport type AsyncNodeHooks = {\n /** Async hook to get content for an async node */\n onAsyncNode: AsyncSeriesBailHook<[Node.Async, (result: any) => void], any>;\n /** Sync hook to manage errors coming from the onAsyncNode hook. Return a fallback node or null to render a fallback. The first argument of passed in the call is the error thrown. */\n onAsyncNodeError: SyncBailHook<[Error, Node.Async], any>;\n};\n\nexport const AsyncNodePluginSymbol: symbol = Symbol.for(\"AsyncNodePlugin\");\n\n/**\n * Async node plugin used to resolve async nodes in the content\n * If an async node is present, allow users to provide a replacement node to be rendered when ready\n */\nexport class AsyncNodePlugin implements PlayerPlugin {\n private plugins: AsyncNodeViewPlugin[] | undefined;\n private playerInstance: Player | undefined;\n\n static Symbol: symbol = AsyncNodePluginSymbol;\n public readonly symbol: symbol = AsyncNodePlugin.Symbol;\n\n constructor(options: AsyncNodePluginOptions, asyncHandler?: AsyncHandler) {\n if (options?.plugins) {\n this.plugins = options.plugins;\n options.plugins.forEach((plugin) => {\n plugin.applyPlugin(this);\n });\n }\n\n if (asyncHandler) {\n this.hooks.onAsyncNode.tap(\n \"async\",\n async (node: Node.Async, callback) => {\n return await asyncHandler(node, callback);\n },\n );\n }\n }\n\n public readonly hooks: AsyncNodeHooks = {\n onAsyncNode: new AsyncSeriesBailHook(),\n onAsyncNodeError: new SyncBailHook(),\n };\n\n getPlayerInstance(): Player | undefined {\n return this.playerInstance;\n }\n\n name = \"AsyncNode\";\n\n apply(player: Player): void {\n this.playerInstance = player;\n\n this.plugins?.forEach((plugin) => {\n plugin.applyPlayer?.(player);\n });\n\n player.hooks.viewController.tap(this.name, (viewController) => {\n viewController.hooks.view.tap(this.name, (view) => {\n this.plugins?.forEach((plugin) => {\n plugin.apply(view);\n });\n });\n });\n }\n}\n\nexport class AsyncNodePluginPlugin implements AsyncNodeViewPlugin {\n private basePlugin: AsyncNodePlugin | undefined;\n\n name = \"AsyncNode\";\n\n /**\n * Parses the node from the result and triggers an asynchronous view update if necessary.\n * @param node The asynchronous node that might be updated.\n * @param result The result obtained from resolving the async node. This could be any data structure or value.\n * @param options Options provided for node resolution, including a potential parseNode function to process the result.\n * @param view The view instance where the node resides. This can be undefined if the view is not currently active.\n */\n private parseNodeAndUpdate(\n node: Node.Async,\n context: AsyncPluginContext,\n result: any,\n options: Resolve.NodeResolveOptions,\n ) {\n let parsedNode =\n options.parseNode && result ? options.parseNode(result) : undefined;\n\n if (parsedNode && node.onValueReceived) {\n parsedNode = node.onValueReceived(parsedNode);\n }\n\n this.handleAsyncUpdate(node, context, parsedNode);\n }\n\n /**\n * Updates the node asynchronously based on the result provided.\n * This method is responsible for handling the update logic of asynchronous nodes.\n * It checks if the node needs to be updated based on the new result and updates the mapping accordingly.\n * If an update is necessary, it triggers an asynchronous update on the view.\n * @param node The asynchronous node that might be updated.\n * @param newNode The new node to replace the async node.\n * @param view The view instance where the node resides. This can be undefined if the view is not currently active.\n */\n private handleAsyncUpdate(\n node: Node.Async,\n context: AsyncPluginContext,\n newNode?: Node.Node | null,\n ) {\n const { nodeResolveCache, viewController, originalNodeCache } = context;\n if (nodeResolveCache.get(node.id) !== newNode) {\n nodeResolveCache.set(node.id, newNode ? newNode : node);\n const originalNode = originalNodeCache.get(node.id) ?? new Set([node]);\n viewController.updateViewAST(originalNode);\n }\n }\n\n private hasValidMapping(\n node: Node.Async,\n context: AsyncPluginContext,\n ): boolean {\n const { nodeResolveCache } = context;\n return (\n nodeResolveCache.has(node.id) && nodeResolveCache.get(node.id) !== node\n );\n }\n\n /**\n * Handles the asynchronous API integration for resolving nodes.\n * This method sets up a hook on the resolver's `beforeResolve` event to process async nodes.\n * @param resolver The resolver instance to attach the hook to.\n * @param view\n */\n applyResolver(resolver: Resolver, context: AsyncPluginContext): void {\n resolver.hooks.beforeResolve.tap(this.name, (node, options) => {\n if (!this.isAsync(node)) {\n return node === null ? node : this.resolveAsyncChildren(node, context);\n }\n if (options.node) {\n context.originalNodeCache.set(node.id, new Set([options.node]));\n }\n\n const resolvedNode = context.nodeResolveCache.get(node.id);\n if (resolvedNode !== undefined) {\n return this.resolveAsyncChildren(resolvedNode, context);\n }\n\n if (context.inProgressNodes.has(node.id)) {\n return node;\n }\n\n // Track that the node is in progress.\n context.inProgressNodes.add(node.id);\n queueMicrotask(() => {\n this.runAsyncNode(node, context, options).finally();\n });\n\n return node;\n });\n }\n\n /**\n * Replaces child async nodes with their resolved content and flattens when necessary. Resolving the children directly helps manage the `parent` reference without needing as much work within the resolver itself.\n * Handles async node chains as well to make sure all applicable nodes can get flattened.\n * @param node - The node whose children need to be resolved.\n * @param context - the async plugin context needed to reach into the cache\n * @returns The same node but with async node children mapped to their resolved AST.\n */\n private resolveAsyncChildren(\n node: Node.Node,\n context: AsyncPluginContext,\n ): Node.Node {\n if (node.type === NodeType.MultiNode) {\n // Using a while loop lets us catch when async nodes produce more async nodes that need to be flattened further\n let index = 0;\n while (index < node.values.length) {\n const childNode = node.values[index];\n if (\n childNode?.type !== NodeType.Async ||\n !this.hasValidMapping(childNode, context)\n ) {\n index++;\n continue;\n }\n\n const mappedNode = context.nodeResolveCache.get(childNode.id)!;\n const nodeSet = new Set<Node.Node>();\n if (mappedNode.type === NodeType.MultiNode && childNode.flatten) {\n mappedNode.values.forEach((v: Node.Node) => {\n v.parent = node;\n nodeSet.add(v);\n });\n node.values = [\n ...node.values.slice(0, index),\n ...mappedNode.values,\n ...node.values.slice(index + 1),\n ];\n } else {\n node.values[index] = mappedNode;\n mappedNode.parent = node;\n nodeSet.add(mappedNode);\n }\n context.originalNodeCache.set(childNode.id, nodeSet);\n }\n } else if (\"children\" in node) {\n node.children?.forEach((c) => {\n // Similar to above, using a while loop lets us handle when async nodes produce more async nodes.\n while (\n c.value.type === NodeType.Async &&\n this.hasValidMapping(c.value, context)\n ) {\n const mappedNode = context.nodeResolveCache.get(c.value.id)!;\n context.originalNodeCache.set(c.value.id, new Set([mappedNode]));\n c.value = mappedNode;\n c.value.parent = node;\n }\n });\n }\n\n return node;\n }\n\n private async runAsyncNode(\n node: Node.Async,\n context: AsyncPluginContext,\n options: Resolve.NodeResolveOptions,\n ) {\n try {\n const result = await this.basePlugin?.hooks.onAsyncNode.call(\n node,\n (result) => {\n this.parseNodeAndUpdate(node, context, result, options);\n },\n );\n\n // Stop tracking before the next update is triggered\n context.inProgressNodes.delete(node.id);\n this.parseNodeAndUpdate(node, context, result, options);\n } catch (e: unknown) {\n const error = e instanceof Error ? e : new Error(String(e));\n const result = this.basePlugin?.hooks.onAsyncNodeError.call(error, node);\n\n if (result === undefined) {\n const playerState = this.basePlugin?.getPlayerInstance()?.getState();\n\n if (playerState?.status === \"in-progress\") {\n playerState.fail(error);\n }\n\n return;\n }\n\n options.logger?.error(\n \"Async node handling failed and resolved with a fallback. Error:\",\n error,\n );\n\n // Stop tracking before the next update is triggered\n context.inProgressNodes.delete(node.id);\n this.parseNodeAndUpdate(node, context, result, options);\n }\n }\n\n private isAsync(node: Node.Node | null): node is Node.Async {\n return node?.type === NodeType.Async;\n }\n\n private isDeterminedAsync(obj: unknown): obj is AsyncContent {\n return (\n typeof obj === \"object\" &&\n obj !== null &&\n Object.prototype.hasOwnProperty.call(obj, \"async\")\n );\n }\n\n applyParser(parser: Parser): void {\n parser.hooks.parseNode.tap(\n this.name,\n (\n obj: any,\n nodeType: Node.ChildrenTypes,\n options: ParseObjectOptions,\n childOptions?: ParseObjectChildOptions,\n ) => {\n if (this.isDeterminedAsync(obj)) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { async, flatten, ...rest } = obj;\n const parsedAsync = parser.parseObject(rest, nodeType, options);\n const parsedNodeId = getNodeID(parsedAsync);\n\n if (parsedAsync === null || !parsedNodeId) {\n return childOptions ? [] : null;\n }\n\n const asyncAST = parser.createASTNode(\n {\n id: parsedNodeId,\n type: NodeType.Async,\n value: parsedAsync,\n flatten,\n },\n obj,\n );\n\n if (childOptions) {\n return asyncAST\n ? [\n {\n path: [...childOptions.path, childOptions.key],\n value: asyncAST,\n },\n ]\n : [];\n }\n\n return asyncAST;\n }\n },\n );\n }\n\n apply(view: ViewInstance): void {\n view.hooks.parser.tap(\"async\", this.applyParser.bind(this));\n }\n\n applyPlayer(player: Player): void {\n player.hooks.viewController.tap(\"async\", (viewController) => {\n viewController.hooks.view.tap(\"async\", (view) => {\n const context: AsyncPluginContext = {\n nodeResolveCache: new Map(),\n inProgressNodes: new Set(),\n view,\n viewController,\n originalNodeCache: new Map(),\n };\n\n view.hooks.resolver.tap(\"async\", (resolver) => {\n this.applyResolver(resolver, context);\n });\n });\n });\n }\n\n applyPlugin(asyncNodePlugin: AsyncNodePlugin): void {\n this.basePlugin = asyncNodePlugin;\n }\n}\n","import { Builder } from \"@player-ui/player\";\nimport type { AsyncTransformFunc } from \"./types\";\n\n/**\n * @deprecated Use {@link createAsyncTransform} to create your before transform function.\n * Util function to generate transform function for async asset\n * @param asset - async asset to apply beforeResolve transform\n * @param wrapperAssetType: container asset type\n * @param flatten: flatten the streamed in content\n * @param path: property path to add the multinode containing the next async node to\n * @returns - wrapper asset with children of transformed asset and async node\n */\n\nexport const asyncTransform: AsyncTransformFunc = (\n assetId,\n wrapperAssetType,\n asset,\n flatten,\n path = [\"values\"],\n) => {\n const id = \"async-\" + assetId;\n\n const asyncNode = Builder.asyncNode(id, flatten);\n\n let multiNode;\n let assetNode;\n\n if (asset) {\n assetNode = Builder.assetWrapper(asset);\n multiNode = Builder.multiNode(assetNode, asyncNode);\n } else {\n multiNode = Builder.multiNode(asyncNode);\n }\n\n const wrapperAsset = Builder.asset({\n id: wrapperAssetType + \"-\" + id,\n type: wrapperAssetType,\n });\n\n Builder.addChild(wrapperAsset, path, multiNode);\n\n return wrapperAsset;\n};\n","import {\n BeforeTransformFunction,\n Builder,\n Node,\n NodeType,\n} from \"@player-ui/player\";\nimport {\n extractNodeFromPath,\n requiresAssetWrapper,\n traverseAndReplace,\n unwrapAsset,\n} from \"./utils\";\n\nexport type AsyncTransformOptions = {\n /** Whether or not to flatten the results into its container. Defaults to true */\n flatten?: boolean;\n /** The path to the array within the `wrapperAssetType` that will contain the async content. Defaults to [\"values\"] */\n path?: string[];\n /** The asset type that the transform is matching against. */\n transformAssetType: string;\n /** The asset type that will contain the async content. */\n wrapperAssetType: string;\n /** Function to get any nested asset that will need to be extracted and kept when creating the wrapper asset. */\n getNestedAsset?: (node: Node.ViewOrAsset) => Node.Node | undefined;\n /** Function to get the id for the async node being generated. Defaults to creating an id with the format of async-<ASSET.ID> */\n getAsyncNodeId?: (node: Node.ViewOrAsset) => string;\n /** Where to place the async node relative to the asset from `getNestedAsset`. Defaults to \"append\" */\n asyncNodePosition?: \"append\" | \"prepend\";\n};\n\nconst defaultGetNodeId = (node: Node.ViewOrAsset): string => {\n return `async-${node.value.id}`;\n};\n\n/** Creates a BeforeTransformFunction that turns the given asset into a wrapper asset with an async node in it.\n * By setting {@link AsyncTransformOptions.flatten} to true, you can chain multiple of the same asset type to create a flow of async content that\n * exists within a single collection.\n *\n * @param options - Options for managing the transform\n * @returns The {@link BeforeTransformFunction} that can be used for your asset.\n */\nexport const createAsyncTransform = (\n options: AsyncTransformOptions,\n): BeforeTransformFunction => {\n const {\n transformAssetType,\n wrapperAssetType,\n getNestedAsset,\n getAsyncNodeId = defaultGetNodeId,\n path = [\"values\"],\n flatten = true,\n asyncNodePosition = \"append\",\n } = options;\n\n const replaceNode = (node: Node.Node): Node.Node => {\n const unwrapped = unwrapAsset(node);\n\n if (\n unwrapped.type !== NodeType.Asset ||\n unwrapped.value.type !== transformAssetType\n ) {\n return node;\n }\n\n const transformed = asyncTransform(unwrapped);\n return extractNodeFromPath(transformed, path) ?? node;\n };\n\n const replacer = (node: Node.Node) => traverseAndReplace(node, replaceNode);\n\n const asyncTransform = (node: Node.ViewOrAsset) => {\n const id = getAsyncNodeId(node);\n const asset = getNestedAsset?.(node);\n\n // If flattening is disabled, don't need to extract the multi-node when async node is resolved.\n const replaceFunction = flatten ? replacer : undefined;\n const asyncNode = Builder.asyncNode(id, flatten, replaceFunction);\n\n const values: Node.Node[] = [asyncNode];\n if (asset) {\n const otherValues = [];\n if (requiresAssetWrapper(asset)) {\n otherValues.push(Builder.assetWrapper(asset));\n } else if (asset.type === NodeType.MultiNode) {\n otherValues.push(...asset.values);\n } else {\n otherValues.push(asset);\n }\n\n if (asyncNodePosition === \"append\") {\n values.unshift(...otherValues);\n } else {\n values.push(...otherValues);\n }\n }\n\n const multiNode = Builder.multiNode(...(values as any[]));\n\n const wrapperAsset: Node.ViewOrAsset = Builder.asset({\n id: wrapperAssetType + \"-\" + id,\n type: wrapperAssetType,\n });\n\n Builder.addChild(wrapperAsset, path, multiNode);\n\n return wrapperAsset;\n };\n\n return asyncTransform;\n};\n","import { NodeType, Node } from \"@player-ui/player\";\n\n/** Replaces a node using the given replace function. If the node is a multi-node it does this transformation to all of its values. */\nexport const traverseAndReplace = (\n node: Node.Node,\n replaceFn: (node: Node.Node) => Node.Node,\n): Node.Node => {\n if (node.type === NodeType.MultiNode) {\n let index = 0;\n while (index < node.values.length) {\n const child = node.values[index];\n if (!child) {\n index++;\n continue;\n }\n\n const result = replaceFn(child);\n if (result.type === NodeType.MultiNode) {\n node.values = [\n ...node.values.slice(0, index),\n ...result.values,\n ...node.values.slice(index + 1),\n ];\n } else {\n node.values[index] = result;\n index++;\n }\n }\n\n return node;\n }\n\n return replaceFn(node);\n};\n","import { NodeType, Node } from \"@player-ui/player\";\n\nexport const unwrapAsset = (node: Node.Node): Node.Node => {\n if (node.type !== NodeType.Value) {\n return node;\n }\n const child = node.children?.find(\n (x) => x.path.length === 1 && x.path[0] === \"asset\",\n );\n\n if (!child) {\n return node;\n }\n\n return child.value;\n};\n","import { NodeType } from \"@player-ui/player\";\nimport type { Node } from \"@player-ui/player\";\n\nexport const requiresAssetWrapper = (node: Node.Node): boolean => {\n if (node.type === NodeType.Asset) {\n return true;\n }\n\n if (node.type !== NodeType.Applicability) {\n return false;\n }\n\n return node.value.type === NodeType.Asset;\n};\n","import type { Node } from \"@player-ui/player\";\n\n/** Matches 2 segments where pathA matches or is a subset of pathB. Returns the number of matching segments */\nconst getMatchValue = (\n pathA: Node.PathSegment[],\n pathB: Node.PathSegment[],\n): number => {\n if (pathA.length > pathB.length) {\n return 0;\n }\n\n let matchCount = 0;\n for (let i = 0; i < pathA.length; i++) {\n if (pathA[i] === pathB[i]) {\n matchCount++;\n } else {\n return 0;\n }\n }\n\n return matchCount;\n};\n\n/** Follows the given path and returns the node. If there is no match, returns undefined */\nexport const extractNodeFromPath = (\n node: Node.Node,\n path?: string[],\n): Node.Node | undefined => {\n if (path === undefined || path.length === 0) {\n return node;\n }\n\n if (!(\"children\" in node && node.children)) {\n return undefined;\n }\n\n let matchResult = 0;\n let bestMatch: Node.Child | undefined;\n for (const child of node.children) {\n const matchValue = getMatchValue(child.path, path);\n if (matchValue > matchResult) {\n matchResult = matchValue;\n bestMatch = child;\n }\n }\n\n if (!bestMatch) {\n return undefined;\n }\n\n if (matchResult >= path.length) {\n return bestMatch.value;\n }\n\n return extractNodeFromPath(bestMatch.value, path.slice(matchResult));\n};\n","import type {\n BeforeTransformFunction,\n TransformFunctions,\n} from \"@player-ui/player\";\nimport { composeBefore, compose } from \"@player-ui/asset-transform-plugin\";\nimport { createAsyncTransform } from \"@player-ui/async-node-plugin\";\nimport { ChatMessageAsset } from \"./types\";\n/**\n * In beforeTransform function, pass in flatten marker and call beforeResolve function.\n * Flatten default value is true.\n * input: ChatMessageAsset\n * @param asset - Asset to apply the transform to\n * @returns - transformed asset with async node and asset node\n */\nexport const transform: BeforeTransformFunction<ChatMessageAsset> =\n createAsyncTransform({\n transformAssetType: \"chat-message\",\n wrapperAssetType: \"collection\",\n getNestedAsset: (node) => node.children?.[0]?.value,\n });\n\nexport const chatMessageTransform: TransformFunctions = compose(\n composeBefore(transform),\n);\n","import type { Player, PlayerPlugin } from \"@player-ui/player\";\n\n/**\n * A plugin that can wrap a set of other plugins.\n */\nexport class MetaPlugin implements PlayerPlugin {\n name = \"meta-plugin\";\n\n public readonly plugins: Array<PlayerPlugin>;\n\n constructor(plugins: Array<PlayerPlugin> = []) {\n this.plugins = plugins;\n }\n\n apply(player: Player) {\n this.plugins.forEach((plugin) => player.registerPlugin(plugin));\n }\n}\n","import { AsyncNodePlugin } from \"@player-ui/async-node-plugin\";\nimport {\n ExpressionContext,\n ExtendedPlayerPlugin,\n NodeType,\n Player,\n} from \"@player-ui/player\";\nimport { ExpressionPlugin } from \"@player-ui/expression-plugin\";\nimport { send } from \"./send\";\n\nconst createContentFromMessage = (message: string, id: string): any => ({\n asset: {\n type: \"chat-message\",\n id,\n value: {\n asset: {\n type: \"text\",\n id: `${id}-value`,\n value: message,\n },\n },\n },\n});\n\nexport class ChatUiDemoPlugin implements ExtendedPlayerPlugin<[], [], [send]> {\n public readonly name = \"chat-ui-demo-plugin\";\n\n public apply(player: Player): void {\n const asyncNodePlugin = player.findPlugin<AsyncNodePlugin>(\n AsyncNodePlugin.Symbol,\n );\n\n if (!asyncNodePlugin) {\n player.logger.warn(\n `Failed to apply '${this.name}'. Reason: Could not find AsyncNodePlugin.`,\n );\n return;\n }\n\n let deferredPromises: Record<string, (val: string) => void> = {};\n let allPromiseKeys: string[] = [];\n let counter = 0;\n\n const sendMessage: send = (\n context: ExpressionContext,\n message: string,\n nodeId?: string,\n ): void => {\n if (nodeId && !(nodeId in deferredPromises)) {\n context.logger?.warn(\n `'send' expression called with unrecognized id '${nodeId}'`,\n );\n return;\n }\n\n if (!nodeId && allPromiseKeys.length === 0) {\n context.logger?.warn(`'send' called with no waiting async nodes`);\n return;\n }\n\n // Either resolve the node by the id or resolve all of them if no id provided\n const keys = nodeId ? [nodeId] : allPromiseKeys;\n\n for (const id of keys) {\n const content = createContentFromMessage(\n message,\n `chat-demo-${counter++}`,\n );\n const resolveFunction = deferredPromises[id];\n resolveFunction?.(content);\n delete deferredPromises[id];\n }\n\n if (nodeId) {\n const index = allPromiseKeys.indexOf(nodeId);\n allPromiseKeys.splice(index, 1);\n } else {\n allPromiseKeys = [];\n }\n };\n\n asyncNodePlugin.hooks.onAsyncNode.tap(this.name, (node) => {\n // Ensure this is only used on the chat-ui.tsx mock to prevent the promise from setting up during tests.\n if (\n (node.parent?.parent?.type !== NodeType.Asset &&\n node.parent?.parent?.type !== NodeType.View) ||\n !node.parent.parent.value.id.startsWith(\"collection-async-chat-demo\")\n ) {\n return Promise.resolve(undefined);\n }\n\n return new Promise((res) => {\n deferredPromises[node.id] = res;\n allPromiseKeys.push(node.id);\n });\n });\n\n // Reset at the start of a new view.\n player.hooks.view.tap(this.name, (_) => {\n deferredPromises = {};\n allPromiseKeys = [];\n counter = 0;\n });\n\n // Register 'send' expression\n const expressionPlugin = new ExpressionPlugin(\n new Map([[\"send\", sendMessage]]),\n );\n player.registerPlugin(expressionPlugin);\n }\n}\n","import type {\n Player,\n PlayerPlugin,\n ExpressionHandler,\n} from \"@player-ui/player\";\n\nexport type ExpressionMap = Map<string, ExpressionHandler<any[], any>>;\n\n/**\n * The ExpressionPlugin is an easy way to inject custom expression handlers into the running player instance.\n * Simply supply a map of function name to handler, and the expressions will be available inside of the Content.\n *\n * Any subsequent expressions registered with the same name will override previous handlers.\n */\nexport class ExpressionPlugin implements PlayerPlugin {\n name = \"ExpressionPlugin\";\n private expressions: ExpressionMap;\n\n constructor(expressionMap: ExpressionMap) {\n this.expressions = expressionMap;\n }\n\n apply(player: Player) {\n player.hooks.expressionEvaluator.tap(this.name, (expEvaluator) => {\n this.expressions.forEach((handler, name) => {\n expEvaluator.addExpressionFunction(name, handler);\n });\n });\n }\n}\n","import type { ExtendedPlayerPlugin, Player } from \"@player-ui/player\";\nimport { AssetTransformPlugin } from \"@player-ui/asset-transform-plugin\";\nimport {\n actionTransform,\n chatMessageTransform,\n choiceTransform,\n imageTransform,\n infoTransform,\n inputTransform,\n} from \"../assets\";\nimport type {\n ActionAsset,\n ChatMessageAsset,\n ChoiceAsset,\n CollectionAsset,\n ImageAsset,\n InfoAsset,\n InputAsset,\n TextAsset,\n} from \"../assets\";\n\nexport class ReferenceAssetsTransformPlugin\n implements\n ExtendedPlayerPlugin<\n [\n ActionAsset,\n InputAsset,\n ImageAsset,\n TextAsset,\n CollectionAsset,\n ChoiceAsset,\n ChatMessageAsset,\n ],\n [InfoAsset]\n >\n{\n name = \"reference-assets-transforms\";\n\n apply(player: Player): void {\n player.registerPlugin(\n new AssetTransformPlugin([\n [{ type: \"action\" }, actionTransform],\n [{ type: \"input\" }, inputTransform],\n [{ type: \"image\" }, imageTransform],\n [{ type: \"info\" }, infoTransform],\n [{ type: \"choice\" }, choiceTransform],\n [{ type: \"chat-message\" }, chatMessageTransform],\n ]),\n );\n }\n}\n","import type { Player, PlayerPlugin } from \"@player-ui/player\";\nimport { MetaPlugin } from \"@player-ui/meta-plugin\";\nimport { ChatUiDemoPlugin, ReferenceAssetsTransformPlugin } from \"./plugins\";\nimport {\n AsyncNodePlugin,\n AsyncNodePluginPlugin,\n} from \"@player-ui/async-node-plugin\";\n\n/**\n * A plugin to add transforms for the reference assets\n */\nexport class ReferenceAssetsPlugin implements PlayerPlugin {\n name = \"reference-assets-plugin\";\n\n private readonly metaPlugin = new MetaPlugin([\n new AsyncNodePlugin({\n plugins: [new AsyncNodePluginPlugin()],\n }),\n new ReferenceAssetsTransformPlugin(),\n new ChatUiDemoPlugin(),\n ]);\n\n apply(player: Player): void {\n player.registerPlugin(this.metaPlugin);\n }\n}\n"]}
1
+ {"version":3,"sources":["/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2790/execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/dist/index.global.js","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/dlv@1.1.3/node_modules/dlv/index.js","../../../../../../../../../../../../execroot/execroot/_main/bazel-out/k8-fastbuild/bin/core/partial-match-registry/src/deep-partial-matcher.ts","../../../../../../../../../../../../execroot/execroot/_main/bazel-out/k8-fastbuild/bin/core/partial-match-registry/src/index.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/asset-transform/core/src/utils.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/asset-transform/core/src/index.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/action/transform.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/tapable-ts@0.2.4/node_modules/tapable-ts/src/utils.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/tapable-ts@0.2.4/node_modules/tapable-ts/src/index.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/sorted-array@2.0.4/node_modules/sorted-array/sorted-array.js","external-global-plugin:@player-ui/player","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/queue-microtask@1.2.3/node_modules/queue-microtask/index.js","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/index.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/input/transform.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/info/transform.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/image/transform.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/choice/transform.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/async-node/core/src/index.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/async-node/core/src/transform.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/async-node/core/src/createAsyncTransform.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/async-node/core/src/utils/traverseAndReplace.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/async-node/core/src/utils/unwrapAsset.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/async-node/core/src/utils/requiresAssetWrapper.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/async-node/core/src/utils/extractNodeFromPath.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/chat-message/transform.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/meta-plugin/core/src/index.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/plugins/chat-ui-demo-plugin.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/expression/core/src/index.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/plugins/reference-assets-transform-plugin.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/plugin.ts"],"names":["ReferenceAssetsPlugin","dlv_es_default","obj","key","def","p","undef","split","length","createObjectMatcher","partialObj","pairs","traverseObj","matchFunction","searchObj","Array","from","entry","path","value","count","size","createBasicMatcher","seed","matcher","match","composeTransforms","args","reverse","fn","fns","asset","options","store","reduce","prevValue","current","composeBefore","beforeResolve","compose","beforeResolveFns","resolveFns","arg","push","resolve","maybeCompose","maybeFn","cleanupTransformRegistry","maybeRegistry","isArray","wrappedTransforms","map","Registry","registry","forEach","set","isBackAction","action","equalToOrIn","check","includes","callTap","tap","ctx","context","callback","__create","Object","create","__defProp","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__getProtoOf","getPrototypeOf","__hasOwnProp","prototype","hasOwnProperty","__commonJS","cb","mod","__require","exports","__export","target","all","name","get","enumerable","__copyProps","to","except","desc","call","__toESM","isNodeMode","__esModule","__toCommonJS","require_sorted_array","module","SortedArray","defclass","constructor","array","compare","compareDefault","index","insert","element","high","low","pos","ordering","search","remove","splice","comparing","property","a","b","define","amd","require_player","globalThis","Player","require_queue_microtask","promise","queueMicrotask","bind","window","global","Promise","then","catch","err","setTimeout","src_exports","actionTransform","chatMessageTransform","choiceTransform","expPropTransform","imageTransform","infoTransform","inputTransform","transform","format","val","binding","data","model","formatted","includeInvalid","validation","track","dataType","type","import_sorted_array","object","Map","keys","nestedPath","createSortedArray","c","initialSet","query","callbackfn","clear","isRegistryEmpty","AssetTransformPlugin","transforms","apply","player","hooks","viewController","vc","transformRegistry","run","exp","evaluate","skipValidation","metaData","transition","force","backIconTransform","role","skipArray","plugins","stringResolver","propertiesToSkip","indexOf","infoAsset","actions","segmentedActions","segmentedActionsArray","next","prev","getImageAlt","props","placeholder","accessibility","altText","newImage","items","rest","assetHasBinding","currentValue","resetValue","transformedChoiceItems","item","id","select","unselect","clearSelection","import_player","InterceptionManager","interceptions","interceptionKeySet","Set","isUsed","intercept","int","s","add","has","i","_a","_b","loop","error","Error","asError","result","r","done","Hook","taps","resolvedOptions","Symbol","before","insertionIndex","beforeSet","t","delete","untap","filter","SyncBailHook","tapIndex","rtn","AsyncSeriesBailHook","e","import_queue_microtask","getMatchValue","pathA","pathB","matchCount","extractNodeFromPath","node","children","matchResult","bestMatch","child","matchValue","slice","traverseAndReplace","replaceFn","import_player4","NodeType","MultiNode","values","unwrapAsset","Value","find","x","requiresAssetWrapper","Asset","Applicability","defaultGetNodeId","createAsyncTransform","transformAssetType","wrapperAssetType","getNestedAsset","getAsyncNodeId","flatten","asyncNodePosition","replaceNode","unwrapped","transformed","asyncTransform","replacer","Builder","replaceFunction","asyncNode","otherValues","assetWrapper","unshift","multiNode","wrapperAsset","addChild","AsyncNodePluginSymbol","for","_AsyncNodePlugin","asyncHandler","symbol","onAsyncNode","onAsyncNodeError","plugin","applyPlugin","getPlayerInstance","playerInstance","applyPlayer","view","AsyncNodePlugin","AsyncNodePluginPlugin","parseNodeAndUpdate","parsedNode","parseNode","onValueReceived","handleAsyncUpdate","newNode","nodeResolveCache","originalNodeCache","originalNode","updateViewAST","hasValidMapping","applyResolver","resolver","isAsync","resolveAsyncChildren","resolvedNode","inProgressNodes","runAsyncNode","finally","childNode","Async","mappedNode","nodeSet","v","parent","playerState","basePlugin","String","getState","status","fail","logger","isDeterminedAsync","applyParser","parser","nodeType","childOptions","async","parsedAsync","parseObject","parsedNodeId","getNodeID","asyncAST","createASTNode","asyncNodePlugin","MetaPlugin","registerPlugin","ExpressionPlugin","expressionMap","expressions","expressionEvaluator","expEvaluator","handler","addExpressionFunction","createContentFromMessage","message","ChatUiDemoPlugin","findPlugin","warn","deferredPromises","allPromiseKeys","counter","sendMessage","nodeId","content","resolveFunction","import_player7","View","startsWith","res","_","expressionPlugin","ReferenceAssetsTransformPlugin","metaPlugin"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAIA,wBAAwB,AAAC;QCDdC,iBD+Lb,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AA;uBAAAA,SAAAA,MAAMC,MAAA;oBACJA,OAAO4L,cAAA,CACL,IAAI/L,qBAAqB;wBACvB;4BAAC;gCAAEb,MAAM;4BAAS;4BAAGlB;yBAAe;wBACpC;4BAAC;gCAAEkB,MAAM;4BAAQ;4BAAGZ;yBAAc;wBAClC;4BAAC;gCAAEY,MAAM;4BAAQ;4BAAGd;yBAAc;wBAClC;4BAAC;gCAAEc,MAAM;4BAAO;4BAAGb;yBAAa;wBAChC;4BAAC;gCAAEa,MAAM;4BAAS;4BAAGhB;yBAAe;wBACpC;4BAAC;gCAAEgB,MAAM;4BAAe;4BAAGjB;yBAAoB;qBAChD;gBAEL;;;;;I5B8lCA,yHAAyH;I6BpoCpH,IAAM5I,sCAAN;iBAAMA;;YACX,IAAA,CAAAwF,IAAA,GAAO;YAEP,IAAA,CAAiB4S,UAAA,GAAa,IAAI5B,WAAW;gBAC3C,IAAI/C,gBAAgB;oBAClB7H,SAAS;wBAAC,IAAI8H;qBAAuB;gBACvC;gBACA,IAAIyE;gBACJ,IAAIhB;aACL;;;;gBAEDvM,KAAAA;uBAAAA,SAAAA,MAAMC,MAAA;oBACJA,OAAO4L,cAAA,CAAe,IAAA,CAAK2B,UAAU;gBACvC;;;;;I7BuoCA,OAAOjS,aAAauC;AACtB,KACA;;;;AAIA","sourcesContent":["\"use strict\";\nvar ReferenceAssetsPlugin = (() => {\n var __create = Object.create;\n var __defProp = Object.defineProperty;\n var __getOwnPropDesc = Object.getOwnPropertyDescriptor;\n var __getOwnPropNames = Object.getOwnPropertyNames;\n var __getProtoOf = Object.getPrototypeOf;\n var __hasOwnProp = Object.prototype.hasOwnProperty;\n var __commonJS = (cb, mod) => function __require() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n };\n var __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n };\n var __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n };\n var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n ));\n var __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/sorted-array@2.0.4/node_modules/sorted-array/sorted-array.js\n var require_sorted_array = __commonJS({\n \"../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/sorted-array@2.0.4/node_modules/sorted-array/sorted-array.js\"(exports, module) {\n \"use strict\";\n var SortedArray2 = function() {\n var SortedArray3 = defclass({\n constructor: function(array, compare) {\n this.array = [];\n this.compare = compare || compareDefault;\n var length = array.length, index = 0;\n while (index < length)\n this.insert(array[index++]);\n },\n insert: function(element) {\n var array = this.array, compare = this.compare, high = array.length - 1, low = 0, pos = -1, index, ordering;\n while (high >= low) {\n index = (high + low) / 2 >>> 0;\n ordering = compare(array[index], element);\n if (ordering < 0)\n low = index + 1;\n else if (ordering > 0)\n high = index - 1;\n else {\n pos = index;\n break;\n }\n ;\n }\n if (pos === -1) {\n pos = high;\n }\n pos++;\n high = array.length - 1;\n while (pos < high && compare(element, array[pos]) === 0) {\n pos++;\n }\n index = array.length;\n array.push(element);\n while (index > pos) {\n array[index] = array[--index];\n }\n array[pos] = element;\n return this;\n },\n search: function(element) {\n var array = this.array, compare = this.compare, high = array.length - 1, low = 0, index, ordering;\n while (high >= low) {\n index = (high + low) / 2 >>> 0;\n ordering = compare(array[index], element);\n if (ordering < 0)\n low = index + 1;\n else if (ordering > 0)\n high = index - 1;\n else\n return index;\n }\n return -1;\n },\n remove: function(element) {\n var index = this.search(element);\n if (index >= 0)\n this.array.splice(index, 1);\n return this;\n }\n });\n SortedArray3.comparing = function(property, array) {\n return new SortedArray3(array, function(a, b) {\n return compareDefault(a[property], b[property]);\n });\n };\n return SortedArray3;\n function defclass(prototype) {\n var constructor = prototype.constructor;\n constructor.prototype = prototype;\n return constructor;\n }\n function compareDefault(a, b) {\n if (a < b)\n return -1;\n else if (a > b)\n return 1;\n else\n return 0;\n }\n }();\n if (typeof module === \"object\")\n module.exports = SortedArray2;\n if (typeof define === \"function\" && define.amd)\n define(function() {\n return SortedArray2;\n });\n }\n });\n\n // external-global-plugin:@player-ui/player\n var require_player = __commonJS({\n \"external-global-plugin:@player-ui/player\"(exports, module) {\n \"use strict\";\n module.exports = globalThis.Player;\n }\n });\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/queue-microtask@1.2.3/node_modules/queue-microtask/index.js\n var require_queue_microtask = __commonJS({\n \"../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/queue-microtask@1.2.3/node_modules/queue-microtask/index.js\"(exports, module) {\n \"use strict\";\n var promise;\n module.exports = typeof queueMicrotask === \"function\" ? queueMicrotask.bind(typeof window !== \"undefined\" ? window : global) : (cb) => (promise || (promise = Promise.resolve())).then(cb).catch((err) => setTimeout(() => {\n throw err;\n }, 0));\n }\n });\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/index.ts\n var src_exports = {};\n __export(src_exports, {\n ReferenceAssetsPlugin: () => ReferenceAssetsPlugin,\n actionTransform: () => actionTransform,\n chatMessageTransform: () => chatMessageTransform,\n choiceTransform: () => choiceTransform,\n expPropTransform: () => expPropTransform,\n imageTransform: () => imageTransform,\n infoTransform: () => infoTransform,\n inputTransform: () => inputTransform,\n isBackAction: () => isBackAction,\n transform: () => transform2\n });\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/input/transform.ts\n var inputTransform = (asset, options) => {\n return {\n ...asset,\n format(val) {\n if (asset.binding === void 0) {\n return val;\n }\n return options.data.format(asset.binding, val);\n },\n set(val) {\n if (asset.binding === void 0) {\n return;\n }\n return options.data.model.set([[asset.binding, val]], {\n formatted: true\n });\n },\n value: asset.binding === void 0 ? \"\" : options.data.model.get(asset.binding, {\n includeInvalid: true,\n formatted: true\n }),\n validation: asset.binding === void 0 ? void 0 : options.validation?.get(asset.binding, { track: true }),\n dataType: asset.binding === void 0 ? void 0 : options.validation?.type(asset.binding)\n };\n };\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/@player-ui+partial-match-registry@0.0.0/node_modules/@player-ui/partial-match-registry/dist/index.mjs\n var import_sorted_array = __toESM(require_sorted_array(), 1);\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/dlv@1.1.3/node_modules/dlv/dist/dlv.es.js\n function dlv_es_default(t, e, l, n, r) {\n for (e = e.split ? e.split(\".\") : e, n = 0; n < e.length; n++)\n t = t ? t[e[n]] : r;\n return t === r ? l : t;\n }\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/@player-ui+partial-match-registry@0.0.0/node_modules/@player-ui/partial-match-registry/dist/index.mjs\n function traverseObj(object, path = [], pairs = /* @__PURE__ */ new Map()) {\n for (const key of Object.keys(object)) {\n const val = object[key];\n const nestedPath = [...path, key];\n if (typeof val === \"object\") {\n traverseObj(val, nestedPath, pairs);\n } else {\n pairs.set(nestedPath, val);\n }\n }\n return pairs;\n }\n function createObjectMatcher(partialObj) {\n const pairs = traverseObj(partialObj);\n const matchFunction = (searchObj) => {\n for (const entry of Array.from(pairs)) {\n const [path, value] = entry;\n if (dlv_es_default(searchObj, path) !== value) {\n return false;\n }\n }\n return true;\n };\n matchFunction.count = pairs.size;\n return matchFunction;\n }\n function createBasicMatcher(seed) {\n const matcher = (match) => seed === match;\n matcher.count = 1;\n return matcher;\n }\n var createSortedArray = () => new import_sorted_array.default([], (c) => c.matcher.count);\n var Registry = class {\n constructor(initialSet) {\n this.store = createSortedArray();\n initialSet?.forEach(([match, value]) => {\n this.set(match, value);\n });\n }\n /** Add match -> value mapping to the registry */\n set(match, value) {\n const matcher = typeof match === \"object\" ? createObjectMatcher(match) : createBasicMatcher(match);\n this.store.insert({\n key: match,\n value,\n matcher\n });\n }\n /** Fetch the best match in the registry */\n get(query) {\n for (const entry of this.store.array) {\n if (entry.matcher(query)) {\n return entry.value;\n }\n }\n }\n /** Loop over all entries and run callback */\n forEach(callbackfn) {\n for (const entry of this.store.array) {\n callbackfn(entry);\n }\n }\n /** Reset the items in the registry */\n clear() {\n this.store = createSortedArray();\n }\n /** Check if the registry is empty*/\n isRegistryEmpty() {\n return this.store.array.length === 0;\n }\n };\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/@player-ui+asset-transform-plugin@0.0.0/node_modules/@player-ui/asset-transform-plugin/dist/index.mjs\n function composeTransforms(...args) {\n const [fn, ...fns] = args.reverse();\n return (asset, options, store) => {\n const value = fn(asset, options, store);\n if (!fns.length) {\n return value;\n }\n return fns.reduce((prevValue, current) => {\n return current(prevValue, options, store);\n }, value);\n };\n }\n function composeBefore(...args) {\n return {\n beforeResolve: composeTransforms(...args)\n };\n }\n function compose(...args) {\n const beforeResolveFns = [];\n const resolveFns = [];\n for (const arg of args) {\n if (typeof arg === \"function\") {\n resolveFns.push(arg);\n } else {\n if (arg?.resolve) {\n resolveFns.push(arg.resolve);\n }\n if (arg?.beforeResolve) {\n beforeResolveFns.push(arg.beforeResolve);\n }\n }\n }\n return {\n beforeResolve: beforeResolveFns.length ? composeTransforms(...beforeResolveFns) : void 0,\n resolve: resolveFns.length ? composeTransforms(...resolveFns) : void 0\n };\n }\n function maybeCompose(maybeFn) {\n if (typeof maybeFn === \"object\") {\n return maybeFn;\n }\n return compose(maybeFn);\n }\n function cleanupTransformRegistry(maybeRegistry) {\n if (Array.isArray(maybeRegistry)) {\n const wrappedTransforms = maybeRegistry.map(([key, value]) => {\n return [key, maybeCompose(value)];\n });\n return new Registry(wrappedTransforms);\n }\n const registry = new Registry();\n maybeRegistry.forEach(({ key, value }) => {\n registry.set(key, maybeCompose(value));\n });\n return registry;\n }\n var AssetTransformPlugin = class {\n constructor(transforms) {\n this.name = \"asset-transform\";\n this.registry = cleanupTransformRegistry(transforms);\n }\n apply(player) {\n player.hooks.viewController.tap(this.name, (vc) => {\n this.registry.forEach(\n ({ key, value }) => vc.transformRegistry.set(key, maybeCompose(value))\n );\n });\n }\n };\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/action/transform.ts\n function isBackAction(action) {\n return action.value === \"Prev\";\n }\n var transform = (action, options) => {\n return {\n ...action,\n run() {\n if (action.exp) {\n options.evaluate(action.exp);\n }\n if (action.value) {\n const skipValidation = action.metaData?.skipValidation;\n options.transition?.(action.value, { force: skipValidation });\n }\n }\n };\n };\n var backIconTransform = (action) => {\n if (isBackAction(action) && action?.metaData?.role === void 0) {\n return {\n ...action,\n metaData: {\n ...action?.metaData,\n role: \"back\"\n }\n };\n }\n return action;\n };\n var expPropTransform = (asset) => {\n const skipArray = asset.plugins?.stringResolver?.propertiesToSkip;\n if (skipArray && skipArray.indexOf(\"exp\") > 1) {\n return asset;\n }\n return {\n ...asset,\n plugins: {\n ...asset.plugins,\n stringResolver: {\n ...asset?.plugins?.stringResolver,\n propertiesToSkip: [\n ...asset.plugins?.stringResolver?.propertiesToSkip ?? [],\n \"exp\"\n ]\n }\n }\n };\n };\n var actionTransform = compose(\n transform,\n backIconTransform,\n composeBefore(expPropTransform)\n );\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/info/transform.ts\n var infoTransform = (infoAsset) => {\n const actions = infoAsset?.actions;\n const segmentedActions = actions?.reduce(\n (segmentedActionsArray, action) => {\n segmentedActionsArray[isBackAction(action.asset) ? \"prev\" : \"next\"].push(action);\n return segmentedActionsArray;\n },\n { next: [], prev: [] }\n );\n return {\n ...infoAsset,\n segmentedActions\n };\n };\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/image/transform.ts\n var getImageAlt = (props) => {\n const { metaData, placeholder } = props;\n if (metaData.accessibility)\n return metaData.accessibility;\n if (placeholder)\n return placeholder;\n return \"Image\";\n };\n var imageTransform = (props) => {\n const altText = getImageAlt(props);\n const newImage = {\n ...props,\n altText\n };\n return newImage;\n };\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/choice/transform.ts\n var choiceTransform = (asset, options) => {\n const { items, binding, ...rest } = asset;\n const assetHasBinding = binding !== void 0;\n const currentValue = assetHasBinding ? options.data.model.get(binding, {\n includeInvalid: true\n }) : void 0;\n const resetValue = () => {\n if (assetHasBinding) {\n return options.data.model.set([[binding, null]]);\n }\n };\n const transformedChoiceItems = (items || []).map(\n (item, index) => ({\n ...item,\n id: item.id ?? `${asset.id}-choice-${index}`,\n select() {\n if (assetHasBinding) {\n return options.data.model.set([[binding, item.value]]);\n }\n },\n unselect: resetValue\n })\n );\n return {\n ...rest,\n binding,\n clearSelection: resetValue,\n items: transformedChoiceItems,\n value: currentValue,\n validation: assetHasBinding ? options.validation?.get(binding, { track: true }) : void 0,\n dataType: assetHasBinding ? options.validation?.type(binding) : void 0\n };\n };\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/@player-ui+async-node-plugin@0.0.0/node_modules/@player-ui/async-node-plugin/dist/index.mjs\n var import_player = __toESM(require_player(), 1);\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/tapable-ts@0.2.4/node_modules/tapable-ts/dist/hooks.mjs\n function equalToOrIn(value, check) {\n if (Array.isArray(check)) {\n return check.includes(value);\n }\n return check === value;\n }\n function callTap(tap, args, ctx) {\n if (tap.context) {\n return tap.callback(ctx, ...args);\n }\n return tap.callback(...args);\n }\n var InterceptionManager = class {\n constructor() {\n this.interceptions = [];\n this.interceptionKeySet = /* @__PURE__ */ new Set();\n }\n isUsed() {\n return this.interceptions.length > 0;\n }\n intercept(int) {\n this.interceptions.push(int);\n Object.keys(int).forEach((s) => {\n this.interceptionKeySet.add(s);\n });\n }\n tap(tap) {\n if (this.interceptionKeySet.has(\"tap\")) {\n this.interceptions.forEach((i) => {\n var _a;\n (_a = i.tap) == null ? void 0 : _a.call(i, tap);\n });\n }\n }\n call(ctx, ...args) {\n if (this.interceptionKeySet.has(\"call\")) {\n this.interceptions.forEach((i) => {\n var _a, _b;\n if (i.context) {\n (_a = i.call) == null ? void 0 : _a.call(i, ctx, ...args);\n } else {\n (_b = i.call) == null ? void 0 : _b.call(i, ...args);\n }\n });\n }\n }\n loop(...args) {\n if (this.interceptionKeySet.has(\"loop\")) {\n this.interceptions.forEach((i) => {\n var _a;\n (_a = i.loop) == null ? void 0 : _a.call(i, ...args);\n });\n }\n }\n error(err) {\n if (this.interceptionKeySet.has(\"error\")) {\n if (err instanceof Error) {\n const asError = err;\n this.interceptions.forEach((i) => {\n var _a;\n (_a = i.error) == null ? void 0 : _a.call(i, asError);\n });\n }\n }\n }\n result(r) {\n if (this.interceptionKeySet.has(\"result\")) {\n this.interceptions.forEach((i) => {\n var _a;\n (_a = i.result) == null ? void 0 : _a.call(i, r);\n });\n }\n }\n done() {\n if (this.interceptionKeySet.has(\"done\")) {\n this.interceptions.forEach((i) => {\n var _a;\n (_a = i.done) == null ? void 0 : _a.call(i);\n });\n }\n }\n };\n var Hook = class {\n constructor() {\n this.taps = [];\n this.interceptions = new InterceptionManager();\n }\n tap(options, callback) {\n const resolvedOptions = typeof options === \"string\" ? {\n name: options,\n context: false\n } : {\n context: false,\n ...options\n };\n const key = Symbol(resolvedOptions.name);\n const tap = {\n key,\n ...resolvedOptions,\n callback\n };\n if (tap.before) {\n let insertionIndex = this.taps.length;\n const beforeSet = new Set(Array.isArray(tap.before) ? tap.before : [tap.before]);\n for (insertionIndex; insertionIndex > 0 && beforeSet.size > 0; insertionIndex--) {\n const t = this.taps[insertionIndex - 1];\n if (beforeSet.has(t.name)) {\n beforeSet.delete(t.name);\n }\n if (t.before && equalToOrIn(tap.name, t.before)) {\n break;\n }\n }\n this.taps.splice(insertionIndex, 0, tap);\n } else {\n this.taps.push(tap);\n }\n this.interceptions.tap(tap);\n return tap;\n }\n untap(tap) {\n this.taps = this.taps.filter((t) => t.key !== tap.key);\n }\n isUsed() {\n return this.taps.length > 0 || this.interceptions.isUsed();\n }\n intercept(int) {\n this.interceptions.intercept(int);\n }\n };\n var SyncBailHook = class extends Hook {\n call(...args) {\n if (!this.isUsed()) {\n return;\n }\n const ctx = {};\n this.interceptions.call(ctx, ...args);\n for (let tapIndex = 0; tapIndex < this.taps.length; tapIndex += 1) {\n const rtn = callTap(this.taps[tapIndex], args, ctx);\n if (rtn !== void 0) {\n this.interceptions.result(rtn);\n return rtn;\n }\n }\n this.interceptions.done();\n }\n };\n var AsyncSeriesBailHook = class extends Hook {\n async call(...args) {\n const ctx = {};\n this.interceptions.call(ctx, ...args);\n try {\n for (let tapIndex = 0; tapIndex < this.taps.length; tapIndex += 1) {\n const rtn = await callTap(this.taps[tapIndex], args, ctx);\n if (rtn !== void 0) {\n this.interceptions.result(rtn);\n return rtn;\n }\n }\n } catch (e) {\n this.interceptions.error(e);\n throw e;\n }\n this.interceptions.done();\n }\n };\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/@player-ui+async-node-plugin@0.0.0/node_modules/@player-ui/async-node-plugin/dist/index.mjs\n var import_queue_microtask = __toESM(require_queue_microtask(), 1);\n var import_player2 = __toESM(require_player(), 1);\n var import_player3 = __toESM(require_player(), 1);\n var import_player4 = __toESM(require_player(), 1);\n var import_player5 = __toESM(require_player(), 1);\n var import_player6 = __toESM(require_player(), 1);\n var getMatchValue = (pathA, pathB) => {\n if (pathA.length > pathB.length) {\n return 0;\n }\n let matchCount = 0;\n for (let i = 0; i < pathA.length; i++) {\n if (pathA[i] === pathB[i]) {\n matchCount++;\n } else {\n return 0;\n }\n }\n return matchCount;\n };\n var extractNodeFromPath = (node, path) => {\n if (path === void 0 || path.length === 0) {\n return node;\n }\n if (!(\"children\" in node && node.children)) {\n return void 0;\n }\n let matchResult = 0;\n let bestMatch;\n for (const child of node.children) {\n const matchValue = getMatchValue(child.path, path);\n if (matchValue > matchResult) {\n matchResult = matchValue;\n bestMatch = child;\n }\n }\n if (!bestMatch) {\n return void 0;\n }\n if (matchResult >= path.length) {\n return bestMatch.value;\n }\n return extractNodeFromPath(bestMatch.value, path.slice(matchResult));\n };\n var traverseAndReplace = (node, replaceFn) => {\n if (node.type === import_player4.NodeType.MultiNode) {\n let index = 0;\n while (index < node.values.length) {\n const child = node.values[index];\n if (!child) {\n index++;\n continue;\n }\n const result = replaceFn(child);\n if (result.type === import_player4.NodeType.MultiNode) {\n node.values = [\n ...node.values.slice(0, index),\n ...result.values,\n ...node.values.slice(index + 1)\n ];\n } else {\n node.values[index] = result;\n index++;\n }\n }\n return node;\n }\n return replaceFn(node);\n };\n var unwrapAsset = (node) => {\n if (node.type !== import_player5.NodeType.Value) {\n return node;\n }\n const child = node.children?.find(\n (x) => x.path.length === 1 && x.path[0] === \"asset\"\n );\n if (!child) {\n return node;\n }\n return child.value;\n };\n var requiresAssetWrapper = (node) => {\n if (node.type === import_player6.NodeType.Asset) {\n return true;\n }\n if (node.type !== import_player6.NodeType.Applicability) {\n return false;\n }\n return node.value.type === import_player6.NodeType.Asset;\n };\n var defaultGetNodeId = (node) => {\n return `async-${node.value.id}`;\n };\n var createAsyncTransform = (options) => {\n const {\n transformAssetType,\n wrapperAssetType,\n getNestedAsset,\n getAsyncNodeId = defaultGetNodeId,\n path = [\"values\"],\n flatten = true,\n asyncNodePosition = \"append\"\n } = options;\n const replaceNode = (node) => {\n const unwrapped = unwrapAsset(node);\n if (unwrapped.type !== import_player3.NodeType.Asset || unwrapped.value.type !== transformAssetType) {\n return node;\n }\n const transformed = asyncTransform2(unwrapped);\n return extractNodeFromPath(transformed, path) ?? node;\n };\n const replacer = (node) => traverseAndReplace(node, replaceNode);\n const asyncTransform2 = (node) => {\n const id = getAsyncNodeId(node);\n const asset = getNestedAsset?.(node);\n const replaceFunction = flatten ? replacer : void 0;\n const asyncNode = import_player3.Builder.asyncNode(id, flatten, replaceFunction);\n const values = [asyncNode];\n if (asset) {\n const otherValues = [];\n if (requiresAssetWrapper(asset)) {\n otherValues.push(import_player3.Builder.assetWrapper(asset));\n } else if (asset.type === import_player3.NodeType.MultiNode) {\n otherValues.push(...asset.values);\n } else {\n otherValues.push(asset);\n }\n if (asyncNodePosition === \"append\") {\n values.unshift(...otherValues);\n } else {\n values.push(...otherValues);\n }\n }\n const multiNode = import_player3.Builder.multiNode(...values);\n const wrapperAsset = import_player3.Builder.asset({\n id: wrapperAssetType + \"-\" + id,\n type: wrapperAssetType\n });\n import_player3.Builder.addChild(wrapperAsset, path, multiNode);\n return wrapperAsset;\n };\n return asyncTransform2;\n };\n var AsyncNodePluginSymbol = Symbol.for(\"AsyncNodePlugin\");\n var _AsyncNodePlugin = class _AsyncNodePlugin2 {\n constructor(options, asyncHandler) {\n this.symbol = _AsyncNodePlugin2.Symbol;\n this.hooks = {\n onAsyncNode: new AsyncSeriesBailHook(),\n onAsyncNodeError: new SyncBailHook()\n };\n this.name = \"AsyncNode\";\n if (options?.plugins) {\n this.plugins = options.plugins;\n options.plugins.forEach((plugin) => {\n plugin.applyPlugin(this);\n });\n }\n if (asyncHandler) {\n this.hooks.onAsyncNode.tap(\n \"async\",\n async (node, callback) => {\n return await asyncHandler(node, callback);\n }\n );\n }\n }\n getPlayerInstance() {\n return this.playerInstance;\n }\n apply(player) {\n this.playerInstance = player;\n this.plugins?.forEach((plugin) => {\n plugin.applyPlayer?.(player);\n });\n player.hooks.viewController.tap(this.name, (viewController) => {\n viewController.hooks.view.tap(this.name, (view) => {\n this.plugins?.forEach((plugin) => {\n plugin.apply(view);\n });\n });\n });\n }\n };\n _AsyncNodePlugin.Symbol = AsyncNodePluginSymbol;\n var AsyncNodePlugin = _AsyncNodePlugin;\n var AsyncNodePluginPlugin = class {\n constructor() {\n this.name = \"AsyncNode\";\n }\n /**\n * Parses the node from the result and triggers an asynchronous view update if necessary.\n * @param node The asynchronous node that might be updated.\n * @param result The result obtained from resolving the async node. This could be any data structure or value.\n * @param options Options provided for node resolution, including a potential parseNode function to process the result.\n * @param view The view instance where the node resides. This can be undefined if the view is not currently active.\n */\n parseNodeAndUpdate(node, context, result, options) {\n let parsedNode = options.parseNode && result ? options.parseNode(result) : void 0;\n if (parsedNode && node.onValueReceived) {\n parsedNode = node.onValueReceived(parsedNode);\n }\n this.handleAsyncUpdate(node, context, parsedNode);\n }\n /**\n * Updates the node asynchronously based on the result provided.\n * This method is responsible for handling the update logic of asynchronous nodes.\n * It checks if the node needs to be updated based on the new result and updates the mapping accordingly.\n * If an update is necessary, it triggers an asynchronous update on the view.\n * @param node The asynchronous node that might be updated.\n * @param newNode The new node to replace the async node.\n * @param view The view instance where the node resides. This can be undefined if the view is not currently active.\n */\n handleAsyncUpdate(node, context, newNode) {\n const { nodeResolveCache, viewController, originalNodeCache } = context;\n if (nodeResolveCache.get(node.id) !== newNode) {\n nodeResolveCache.set(node.id, newNode ? newNode : node);\n const originalNode = originalNodeCache.get(node.id) ?? /* @__PURE__ */ new Set([node]);\n viewController.updateViewAST(originalNode);\n }\n }\n hasValidMapping(node, context) {\n const { nodeResolveCache } = context;\n return nodeResolveCache.has(node.id) && nodeResolveCache.get(node.id) !== node;\n }\n /**\n * Handles the asynchronous API integration for resolving nodes.\n * This method sets up a hook on the resolver's `beforeResolve` event to process async nodes.\n * @param resolver The resolver instance to attach the hook to.\n * @param view\n */\n applyResolver(resolver, context) {\n resolver.hooks.beforeResolve.tap(this.name, (node, options) => {\n if (!this.isAsync(node)) {\n return node === null ? node : this.resolveAsyncChildren(node, context);\n }\n if (options.node) {\n context.originalNodeCache.set(node.id, /* @__PURE__ */ new Set([options.node]));\n }\n const resolvedNode = context.nodeResolveCache.get(node.id);\n if (resolvedNode !== void 0) {\n return this.resolveAsyncChildren(resolvedNode, context);\n }\n if (context.inProgressNodes.has(node.id)) {\n return node;\n }\n context.inProgressNodes.add(node.id);\n (0, import_queue_microtask.default)(() => {\n this.runAsyncNode(node, context, options).finally();\n });\n return node;\n });\n }\n /**\n * Replaces child async nodes with their resolved content and flattens when necessary. Resolving the children directly helps manage the `parent` reference without needing as much work within the resolver itself.\n * Handles async node chains as well to make sure all applicable nodes can get flattened.\n * @param node - The node whose children need to be resolved.\n * @param context - the async plugin context needed to reach into the cache\n * @returns The same node but with async node children mapped to their resolved AST.\n */\n resolveAsyncChildren(node, context) {\n if (node.type === import_player.NodeType.MultiNode) {\n let index = 0;\n while (index < node.values.length) {\n const childNode = node.values[index];\n if (childNode?.type !== import_player.NodeType.Async || !this.hasValidMapping(childNode, context)) {\n index++;\n continue;\n }\n const mappedNode = context.nodeResolveCache.get(childNode.id);\n const nodeSet = /* @__PURE__ */ new Set();\n if (mappedNode.type === import_player.NodeType.MultiNode && childNode.flatten) {\n mappedNode.values.forEach((v) => {\n v.parent = node;\n nodeSet.add(v);\n });\n node.values = [\n ...node.values.slice(0, index),\n ...mappedNode.values,\n ...node.values.slice(index + 1)\n ];\n } else {\n node.values[index] = mappedNode;\n mappedNode.parent = node;\n nodeSet.add(mappedNode);\n }\n context.originalNodeCache.set(childNode.id, nodeSet);\n }\n } else if (\"children\" in node) {\n node.children?.forEach((c) => {\n while (c.value.type === import_player.NodeType.Async && this.hasValidMapping(c.value, context)) {\n const mappedNode = context.nodeResolveCache.get(c.value.id);\n context.originalNodeCache.set(c.value.id, /* @__PURE__ */ new Set([mappedNode]));\n c.value = mappedNode;\n c.value.parent = node;\n }\n });\n }\n return node;\n }\n async runAsyncNode(node, context, options) {\n try {\n const result = await this.basePlugin?.hooks.onAsyncNode.call(\n node,\n (result2) => {\n this.parseNodeAndUpdate(node, context, result2, options);\n }\n );\n context.inProgressNodes.delete(node.id);\n this.parseNodeAndUpdate(node, context, result, options);\n } catch (e) {\n const error = e instanceof Error ? e : new Error(String(e));\n const result = this.basePlugin?.hooks.onAsyncNodeError.call(error, node);\n if (result === void 0) {\n const playerState = this.basePlugin?.getPlayerInstance()?.getState();\n if (playerState?.status === \"in-progress\") {\n playerState.fail(error);\n }\n return;\n }\n options.logger?.error(\n \"Async node handling failed and resolved with a fallback. Error:\",\n error\n );\n context.inProgressNodes.delete(node.id);\n this.parseNodeAndUpdate(node, context, result, options);\n }\n }\n isAsync(node) {\n return node?.type === import_player.NodeType.Async;\n }\n isDeterminedAsync(obj) {\n return typeof obj === \"object\" && obj !== null && Object.prototype.hasOwnProperty.call(obj, \"async\");\n }\n applyParser(parser) {\n parser.hooks.parseNode.tap(\n this.name,\n (obj, nodeType, options, childOptions) => {\n if (this.isDeterminedAsync(obj)) {\n const { async, flatten, ...rest } = obj;\n const parsedAsync = parser.parseObject(rest, nodeType, options);\n const parsedNodeId = (0, import_player.getNodeID)(parsedAsync);\n if (parsedAsync === null || !parsedNodeId) {\n return childOptions ? [] : null;\n }\n const asyncAST = parser.createASTNode(\n {\n id: parsedNodeId,\n type: import_player.NodeType.Async,\n value: parsedAsync,\n flatten\n },\n obj\n );\n if (childOptions) {\n return asyncAST ? [\n {\n path: [...childOptions.path, childOptions.key],\n value: asyncAST\n }\n ] : [];\n }\n return asyncAST;\n }\n }\n );\n }\n apply(view) {\n view.hooks.parser.tap(\"async\", this.applyParser.bind(this));\n }\n applyPlayer(player) {\n player.hooks.viewController.tap(\"async\", (viewController) => {\n viewController.hooks.view.tap(\"async\", (view) => {\n const context = {\n nodeResolveCache: /* @__PURE__ */ new Map(),\n inProgressNodes: /* @__PURE__ */ new Set(),\n view,\n viewController,\n originalNodeCache: /* @__PURE__ */ new Map()\n };\n view.hooks.resolver.tap(\"async\", (resolver) => {\n this.applyResolver(resolver, context);\n });\n });\n });\n }\n applyPlugin(asyncNodePlugin) {\n this.basePlugin = asyncNodePlugin;\n }\n };\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/chat-message/transform.ts\n var transform2 = createAsyncTransform({\n transformAssetType: \"chat-message\",\n wrapperAssetType: \"collection\",\n getNestedAsset: (node) => node.children?.[0]?.value\n });\n var chatMessageTransform = compose(\n composeBefore(transform2)\n );\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/@player-ui+meta-plugin@0.0.0/node_modules/@player-ui/meta-plugin/dist/index.mjs\n var MetaPlugin = class {\n constructor(plugins = []) {\n this.name = \"meta-plugin\";\n this.plugins = plugins;\n }\n apply(player) {\n this.plugins.forEach((plugin) => player.registerPlugin(plugin));\n }\n };\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/plugins/chat-ui-demo-plugin.ts\n var import_player7 = __toESM(require_player());\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/@player-ui+expression-plugin@0.0.0/node_modules/@player-ui/expression-plugin/dist/index.mjs\n var ExpressionPlugin = class {\n constructor(expressionMap) {\n this.name = \"ExpressionPlugin\";\n this.expressions = expressionMap;\n }\n apply(player) {\n player.hooks.expressionEvaluator.tap(this.name, (expEvaluator) => {\n this.expressions.forEach((handler, name) => {\n expEvaluator.addExpressionFunction(name, handler);\n });\n });\n }\n };\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/plugins/chat-ui-demo-plugin.ts\n var createContentFromMessage = (message, id) => ({\n asset: {\n type: \"chat-message\",\n id,\n value: {\n asset: {\n type: \"text\",\n id: `${id}-value`,\n value: message\n }\n }\n }\n });\n var ChatUiDemoPlugin = class {\n constructor() {\n this.name = \"chat-ui-demo-plugin\";\n }\n apply(player) {\n const asyncNodePlugin = player.findPlugin(\n AsyncNodePlugin.Symbol\n );\n if (!asyncNodePlugin) {\n player.logger.warn(\n `Failed to apply '${this.name}'. Reason: Could not find AsyncNodePlugin.`\n );\n return;\n }\n let deferredPromises = {};\n let allPromiseKeys = [];\n let counter = 0;\n const sendMessage = (context, message, nodeId) => {\n if (nodeId && !(nodeId in deferredPromises)) {\n context.logger?.warn(\n `'send' expression called with unrecognized id '${nodeId}'`\n );\n return;\n }\n if (!nodeId && allPromiseKeys.length === 0) {\n context.logger?.warn(`'send' called with no waiting async nodes`);\n return;\n }\n const keys = nodeId ? [nodeId] : allPromiseKeys;\n for (const id of keys) {\n const content = createContentFromMessage(\n message,\n `chat-demo-${counter++}`\n );\n const resolveFunction = deferredPromises[id];\n resolveFunction?.(content);\n delete deferredPromises[id];\n }\n if (nodeId) {\n const index = allPromiseKeys.indexOf(nodeId);\n allPromiseKeys.splice(index, 1);\n } else {\n allPromiseKeys = [];\n }\n };\n asyncNodePlugin.hooks.onAsyncNode.tap(this.name, (node) => {\n if (node.parent?.parent?.type !== import_player7.NodeType.Asset && node.parent?.parent?.type !== import_player7.NodeType.View || !node.parent.parent.value.id.startsWith(\"collection-async-chat-demo\")) {\n return Promise.resolve(void 0);\n }\n return new Promise((res) => {\n deferredPromises[node.id] = res;\n allPromiseKeys.push(node.id);\n });\n });\n player.hooks.view.tap(this.name, (_) => {\n deferredPromises = {};\n allPromiseKeys = [];\n counter = 0;\n });\n const expressionPlugin = new ExpressionPlugin(\n /* @__PURE__ */ new Map([[\"send\", sendMessage]])\n );\n player.registerPlugin(expressionPlugin);\n }\n };\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/plugins/reference-assets-transform-plugin.ts\n var ReferenceAssetsTransformPlugin = class {\n constructor() {\n this.name = \"reference-assets-transforms\";\n }\n apply(player) {\n player.registerPlugin(\n new AssetTransformPlugin([\n [{ type: \"action\" }, actionTransform],\n [{ type: \"input\" }, inputTransform],\n [{ type: \"image\" }, imageTransform],\n [{ type: \"info\" }, infoTransform],\n [{ type: \"choice\" }, choiceTransform],\n [{ type: \"chat-message\" }, chatMessageTransform]\n ])\n );\n }\n };\n\n // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/plugin.ts\n var ReferenceAssetsPlugin = class {\n constructor() {\n this.name = \"reference-assets-plugin\";\n this.metaPlugin = new MetaPlugin([\n new AsyncNodePlugin({\n plugins: [new AsyncNodePluginPlugin()]\n }),\n new ReferenceAssetsTransformPlugin(),\n new ChatUiDemoPlugin()\n ]);\n }\n apply(player) {\n player.registerPlugin(this.metaPlugin);\n }\n };\n return __toCommonJS(src_exports);\n})();\n/*! Bundled license information:\n\nqueue-microtask/index.js:\n (*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)\n*/\n","export default function dlv(obj, key, def, p, undef) {\n\tkey = key.split ? key.split('.') : key;\n\tfor (p = 0; p < key.length; p++) {\n\t\tobj = obj ? obj[key[p]] : undef;\n\t}\n\treturn obj === undef ? def : obj;\n}\n","import dlv from \"dlv\";\n\n/** A function that checks overlapping properties against a reference value */\nexport type Matcher = ((searchObj: object) => boolean) & {\n /** The count represents the specificity of this matcher */\n count: number;\n};\n\n/** Traverse an object and collect any key/value pairs including nested keys */\nfunction traverseObj(\n object: Record<any, any>,\n path: string[] = [],\n pairs: Map<string[], any> = new Map(),\n): Map<string[], any> {\n for (const key of Object.keys(object)) {\n const val: any = object[key];\n const nestedPath = [...path, key];\n\n if (typeof val === \"object\") {\n traverseObj(val, nestedPath, pairs);\n } else {\n pairs.set(nestedPath, val);\n }\n }\n\n return pairs;\n}\n\n/**\n * Given a partial object, create a matcher function that checks if another object matches the specified properties\n * @param partialObj The partial object to match against\n * @returns A matcher function that checks if an object matches the partial object\n */\nexport function createObjectMatcher(partialObj: object): Matcher {\n // Convert the partial object into a list of [key, value] pairs;\n const pairs = traverseObj(partialObj);\n\n /** Generate a function to match against all of the properties we care about */\n const matchFunction = (searchObj: object) => {\n for (const entry of Array.from(pairs)) {\n const [path, value] = entry;\n\n if (dlv(searchObj, path) !== value) {\n return false;\n }\n }\n\n return true;\n };\n\n // Keep track of the specificity of the comparator\n matchFunction.count = pairs.size;\n\n return matchFunction;\n}\n","import SortedArray from \"sorted-array\";\nimport type { Matcher } from \"./deep-partial-matcher\";\nimport { createObjectMatcher } from \"./deep-partial-matcher\";\n\nexport { createObjectMatcher } from \"./deep-partial-matcher\";\n\n/** create a matcher function that matches exactly */\nfunction createBasicMatcher(seed: any): Matcher {\n /** a simple matcher function that only matches itself */\n const matcher = (match: any) => seed === match;\n matcher.count = 1;\n\n return matcher;\n}\n\ninterface RegistryIndex<V> {\n /** The original object we wanted to match on */\n key: object;\n\n /** The value to return */\n value: V;\n\n /** The matcher function for this entry */\n matcher: Matcher;\n}\n\n/** create an empty sorted array using the matcher count */\nconst createSortedArray = <V>() =>\n new SortedArray<RegistryIndex<V>>([], (c) => c.matcher.count);\n\n/**\n * A partial match registry is a map that uses an object to \"match\" against keys.\n * More specific matches take precedence over less specific ones.\n */\nexport class Registry<V> {\n private store = createSortedArray<V>();\n\n constructor(initialSet?: Array<[any, V]>) {\n initialSet?.forEach(([match, value]) => {\n this.set(match, value);\n });\n }\n\n /** Add match -> value mapping to the registry */\n set(match: any, value: V) {\n const matcher =\n typeof match === \"object\"\n ? createObjectMatcher(match)\n : createBasicMatcher(match);\n\n this.store.insert({\n key: match,\n value,\n matcher,\n });\n }\n\n /** Fetch the best match in the registry */\n get(query: any): V | undefined {\n for (const entry of this.store.array) {\n if (entry.matcher(query)) {\n return entry.value;\n }\n }\n }\n\n /** Loop over all entries and run callback */\n forEach(callbackfn: (value: RegistryIndex<V>) => void): void {\n for (const entry of this.store.array) {\n callbackfn(entry);\n }\n }\n\n /** Reset the items in the registry */\n clear() {\n this.store = createSortedArray<V>();\n }\n\n /** Check if the registry is empty*/\n isRegistryEmpty() {\n return this.store.array.length === 0;\n }\n}\n","import type {\n Resolve,\n Store,\n BeforeTransformFunction,\n TransformFunction,\n TransformFunctions,\n} from \"@player-ui/player\";\n\nfunction composeTransforms(\n ...args: TransformFunction<any>[]\n): TransformFunction<any>;\n\nfunction composeTransforms(\n ...args: BeforeTransformFunction<any>[]\n): BeforeTransformFunction<any>;\n\n/**\n * More closely resembles the `compose` function you may have used. Performs\n * right-to-left function evaluation, but leveraging the common signature for\n * Transform Functions. The `options` and `store` is unchanging for each\n * transform since only `value` is returned, allowing them to safely be passed\n * into each transform.\n */\nfunction composeTransforms(\n ...args: TransformFunction<any>[] | BeforeTransformFunction<any>[]\n): TransformFunction<any> | BeforeTransformFunction<any> {\n const [fn, ...fns] = args.reverse();\n\n return (asset: any, options: Resolve.NodeResolveOptions, store: Store) => {\n const value = fn(asset, options, store);\n\n if (!fns.length) {\n return value;\n }\n\n return fns.reduce((prevValue, current) => {\n return current(prevValue, options, store);\n }, value);\n };\n}\n\n/**\n * Helper function to make it easier to create transforms that need to be ran in\n * the `beforeResolve` hook. Just like `compose`, functions are evaluated from\n * right-to-left.\n */\nexport function composeBefore(\n ...args: BeforeTransformFunction<any>[]\n): TransformFunctions {\n return {\n beforeResolve: composeTransforms(...args),\n };\n}\n\n/**\n * Performs right-to-left function evaluation of each transform function. Unlike\n * other compose functions, this does not require unary arguments for all but the\n * last function. The value returned from each function will be used as the value\n * for the next function.\n */\nexport function compose(\n ...args: Array<TransformFunction<any> | TransformFunctions>\n): TransformFunctions {\n const beforeResolveFns: BeforeTransformFunction<any>[] = [];\n const resolveFns: TransformFunction<any>[] = [];\n\n for (const arg of args) {\n if (typeof arg === \"function\") {\n resolveFns.push(arg);\n } else {\n if (arg?.resolve) {\n resolveFns.push(arg.resolve);\n }\n\n if (arg?.beforeResolve) {\n beforeResolveFns.push(arg.beforeResolve);\n }\n }\n }\n\n return {\n beforeResolve: beforeResolveFns.length\n ? composeTransforms(...beforeResolveFns)\n : undefined,\n resolve: resolveFns.length ? composeTransforms(...resolveFns) : undefined,\n };\n}\n","import type {\n Player,\n PlayerPlugin,\n TransformRegistry,\n TransformFunction,\n TransformFunctions,\n} from \"@player-ui/player\";\nimport { Registry } from \"@player-ui/partial-match-registry\";\nimport { compose } from \"./utils\";\n\nexport * from \"./utils\";\nexport * from \"./propertiesToSkip\";\n\nexport type TransformType = TransformFunction<any> | TransformFunctions;\nexport type TransformRegistryEntries = Array<[any, TransformType]>;\nexport type AssetTransformInit =\n | Registry<TransformType>\n | TransformRegistryEntries;\n\n/**\n * Normalize asset transform values so that they are all objects that contains\n * the resolve & beforeResolve functions.\n */\nfunction maybeCompose(maybeFn: any): TransformFunctions {\n if (typeof maybeFn === \"object\") {\n return maybeFn;\n }\n\n return compose(maybeFn);\n}\n\n/**\n * Standardize each variation of Asset Registry input into the same transform\n * registry shape.\n */\nfunction cleanupTransformRegistry(\n maybeRegistry: AssetTransformInit,\n): TransformRegistry {\n if (Array.isArray(maybeRegistry)) {\n const wrappedTransforms = maybeRegistry.map(([key, value]) => {\n return [key, maybeCompose(value)] as [any, TransformFunctions];\n });\n\n return new Registry(wrappedTransforms);\n }\n\n const registry = new Registry<TransformFunctions>();\n\n maybeRegistry.forEach(({ key, value }) => {\n registry.set(key, maybeCompose(value));\n });\n\n return registry;\n}\n\n/**\n * A plugin to register custom transforms on certain asset types\n * This allows users to embed stateful data into transforms.\n */\nexport class AssetTransformPlugin implements PlayerPlugin {\n name = \"asset-transform\";\n public readonly registry: TransformRegistry;\n\n constructor(transforms: AssetTransformInit) {\n this.registry = cleanupTransformRegistry(transforms);\n }\n\n apply(player: Player) {\n player.hooks.viewController.tap(this.name, (vc) => {\n this.registry.forEach(({ key, value }) =>\n vc.transformRegistry.set(key, maybeCompose(value)),\n );\n });\n }\n}\n","import type {\n Asset,\n TransformFunction,\n BeforeTransformFunction,\n} from \"@player-ui/player\";\nimport { compose, composeBefore } from \"@player-ui/asset-transform-plugin\";\nimport type { ActionAsset, TransformedAction } from \"./types\";\n\n/**\n * Function to find prev button\n */\nexport function isBackAction(action: ActionAsset): boolean {\n return action.value === \"Prev\";\n}\n\n/**\n * Attaches the methods to execute an action to an action\n */\nconst transform: TransformFunction<ActionAsset, TransformedAction> = (\n action,\n options,\n) => {\n return {\n ...action,\n run() {\n if (action.exp) {\n options.evaluate(action.exp);\n }\n\n if (action.value) {\n const skipValidation = action.metaData?.skipValidation;\n options.transition?.(action.value, { force: skipValidation });\n }\n },\n };\n};\n\n/**\n * De couples back button from the back icon\n */\nconst backIconTransform: TransformFunction<ActionAsset, ActionAsset> = (\n action,\n) => {\n /** For previous versions of player, the back button would already have the back icon.\n * This ensures that the old functionality does not break and back button is still visible when they update the player.\n */\n if (isBackAction(action) && action?.metaData?.role === undefined) {\n return {\n ...action,\n metaData: {\n ...action?.metaData,\n role: \"back\",\n },\n };\n }\n\n return action;\n};\n\n/**\n * Appends `exp` to the plugins.stringResolver.propertiesToSkip array or creates it if it doesn't exist\n *\n * @param asset - Asset to apply the transform to\n */\nexport const expPropTransform: BeforeTransformFunction<Asset> = (asset) => {\n const skipArray = asset.plugins?.stringResolver?.propertiesToSkip;\n\n if (skipArray && skipArray.indexOf(\"exp\") > 1) {\n return asset;\n }\n\n return {\n ...asset,\n plugins: {\n ...asset.plugins,\n stringResolver: {\n ...asset?.plugins?.stringResolver,\n propertiesToSkip: [\n ...(asset.plugins?.stringResolver?.propertiesToSkip ?? []),\n \"exp\",\n ],\n },\n },\n };\n};\n\nexport const actionTransform = compose(\n transform,\n backIconTransform,\n composeBefore(expPropTransform),\n);\n","/**\n * Checks if `value` is equal to `check` if `check` is a string or in `check` if check is an Array\n *\n * @param value - the value being searched for\n * @param check - the values to check against\n * @returns `boolean`\n */\nexport function equalToOrIn(value: string, check: string | Array<string>) {\n if (Array.isArray(check)) {\n return check.includes(value);\n }\n\n return check === value;\n}\n","import { equalToOrIn } from \"./utils\";\n\nexport type Interceptor<Args extends any[], ReturnType, ContextType> = {\n /** An optional name for the interceptor */\n name?: string;\n /** Callback for each loop when used by the hook */\n loop?: (...args: Args) => void;\n /** Callback when an error occurs during the hook's call */\n error?: (err: Error) => void;\n /** Callback when a result is found for a hook's invocation */\n result?: (\n r: ReturnType extends Promise<infer AwaitedValue>\n ? AwaitedValue\n : ReturnType\n ) => void;\n /** Callback when a hook's call is complete */\n done?: () => void;\n /** Callback when a hook is tapped */\n tap?: (tap: Tap<Args, ReturnType, ContextType>) => void;\n} & (\n | {\n /** If context should be omitted from the 'call'. This is the default */\n context?: false;\n /** Callback when the hook is tapped without context */\n call?: (...args: Args) => void;\n }\n | {\n /** If context should be included in the 'call' */\n context: true;\n /** Callback when the hook is tapped with context */\n call?: (context: ContextType, ...args: Args) => void;\n }\n);\n\nexport type Tap<Args extends any[], ReturnType, ContextType = unknown> = {\n key: symbol;\n name: string;\n before?: string | Array<string>;\n} & (\n | {\n context: false;\n callback: (...args: Args) => ReturnType;\n }\n | {\n context: true;\n callback: (context: ContextType, ...args: Args) => ReturnType;\n }\n);\n\ntype BasicTap<Args extends any[], ReturnType, ContextType> = (\n name: string,\n callback: (...args: Args) => ReturnType,\n before?: string | Array<string>\n) => Tap<Args, ReturnType, ContextType>;\n\ntype TapWithContext<Args extends any[], ReturnType, ContextType> =\n | ((\n options: {\n name: string;\n context?: false;\n before?: string | Array<string>;\n },\n callback: (...args: Args) => ReturnType\n ) => Tap<Args, ReturnType>)\n | ((\n options: {\n name: string;\n context: true;\n before?: string | Array<string>;\n },\n callback: (context: ContextType, ...args: Args) => ReturnType\n ) => Tap<Args, ReturnType>);\n\ninterface SyncBaseHookType<Args extends any[], ReturnType, ContextType> {\n tap:\n | BasicTap<Args, ReturnType, ContextType>\n | TapWithContext<Args, ReturnType, ContextType>;\n call(...args: Args): void;\n untap(key: Tap<Args, ReturnType>): void;\n isUsed(): boolean;\n intercept(int: Interceptor<Args, ReturnType, ContextType>): void;\n}\n\nfunction callTap<Args extends any[], ReturnType, ContextType>(\n tap: Tap<Args, ReturnType, ContextType>,\n args: Args,\n ctx: ContextType\n) {\n if (tap.context) {\n return tap.callback(ctx, ...args);\n }\n\n return tap.callback(...args);\n}\n\n/** A manager for all intercepts inside of a tap */\nclass InterceptionManager<\n Args extends any[],\n ReturnType,\n ContextType = Record<string, any>\n> {\n protected interceptions: Array<Interceptor<Args, ReturnType, ContextType>>;\n private interceptionKeySet: Set<\n keyof Interceptor<Args, ReturnType, ContextType>\n >;\n\n constructor() {\n this.interceptions = [];\n this.interceptionKeySet = new Set();\n }\n\n isUsed() {\n return this.interceptions.length > 0;\n }\n\n intercept(int: Interceptor<Args, ReturnType, ContextType>): void {\n this.interceptions.push(int);\n Object.keys(int).forEach((s) => {\n this.interceptionKeySet.add(s as any);\n });\n }\n\n tap(tap: Tap<Args, ReturnType, ContextType>): void {\n if (this.interceptionKeySet.has(\"tap\")) {\n this.interceptions.forEach((i) => {\n i.tap?.(tap);\n });\n }\n }\n\n call(ctx: ContextType, ...args: Args): void {\n if (this.interceptionKeySet.has(\"call\")) {\n this.interceptions.forEach((i) => {\n if (i.context) {\n i.call?.(ctx, ...args);\n } else {\n i.call?.(...args);\n }\n });\n }\n }\n\n loop(...args: Args): void {\n if (this.interceptionKeySet.has(\"loop\")) {\n this.interceptions.forEach((i) => {\n i.loop?.(...args);\n });\n }\n }\n\n error(err: unknown): void {\n if (this.interceptionKeySet.has(\"error\")) {\n if (err instanceof Error) {\n const asError: Error = err;\n this.interceptions.forEach((i) => {\n i.error?.(asError);\n });\n }\n }\n }\n\n result(\n r: ReturnType extends Promise<infer AwaitedValue>\n ? AwaitedValue\n : ReturnType\n ): void {\n if (this.interceptionKeySet.has(\"result\")) {\n this.interceptions.forEach((i) => {\n i.result?.(r);\n });\n }\n }\n\n done(): void {\n if (this.interceptionKeySet.has(\"done\")) {\n this.interceptions.forEach((i) => {\n i.done?.();\n });\n }\n }\n}\n\nabstract class Hook<\n Args extends any[],\n ReturnType,\n ContextType = Record<string, any>\n> implements SyncBaseHookType<Args, ReturnType, ContextType>\n{\n protected taps: Array<Tap<Args, ReturnType, ContextType>>;\n protected interceptions: InterceptionManager<Args, ReturnType, ContextType>;\n\n constructor() {\n this.taps = [];\n this.interceptions = new InterceptionManager<\n Args,\n ReturnType,\n ContextType\n >();\n }\n\n public tap(\n options: { name: string; context?: false; before?: string | Array<string> },\n callback: (...args: Args) => ReturnType\n ): Tap<Args, ReturnType, ContextType>;\n\n public tap(\n options: { name: string; context: true; before?: string | Array<string> },\n callback: (ctx: ContextType, ...args: Args) => ReturnType\n ): Tap<Args, ReturnType, ContextType>;\n\n public tap(\n name: string,\n callback: (...args: Args) => ReturnType\n ): Tap<Args, ReturnType, ContextType>;\n\n public tap(options: any, callback: any): Tap<Args, ReturnType, ContextType> {\n const resolvedOptions =\n typeof options === \"string\"\n ? {\n name: options,\n context: false,\n }\n : {\n context: false,\n ...options,\n };\n\n const key = Symbol(resolvedOptions.name);\n const tap: Tap<Args, ReturnType, ContextType> = {\n key,\n ...resolvedOptions,\n callback,\n };\n\n if (tap.before) {\n let insertionIndex = this.taps.length;\n const beforeSet = new Set(\n Array.isArray(tap.before) ? tap.before : [tap.before]\n );\n for (\n insertionIndex;\n insertionIndex > 0 && beforeSet.size > 0;\n insertionIndex--\n ) {\n const t = this.taps[insertionIndex - 1];\n if (beforeSet.has(t.name)) {\n beforeSet.delete(t.name);\n }\n\n if (t.before && equalToOrIn(tap.name, t.before)) {\n break;\n }\n }\n\n this.taps.splice(insertionIndex, 0, tap);\n } else {\n this.taps.push(tap);\n }\n\n this.interceptions.tap(tap);\n\n return tap;\n }\n\n abstract call(...args: Args): ReturnType;\n\n public untap(tap: Tap<Args, ReturnType, ContextType>) {\n this.taps = this.taps.filter((t) => t.key !== tap.key);\n }\n\n public isUsed() {\n return this.taps.length > 0 || this.interceptions.isUsed();\n }\n\n public intercept(int: Interceptor<Args, ReturnType, ContextType>): void {\n this.interceptions.intercept(int);\n }\n}\n\nexport class SyncHook<\n Args extends any[],\n ContextType = Record<string, any>\n> extends Hook<Args, void, ContextType> {\n public call(...args: Args) {\n if (!this.isUsed()) {\n return;\n }\n\n const ctx: ContextType = {} as any;\n\n this.interceptions.call(ctx, ...args);\n\n try {\n this.taps.forEach((t) => {\n callTap(t, args, ctx);\n });\n } catch (err: unknown) {\n this.interceptions.error(err);\n\n throw err;\n }\n\n this.interceptions.done();\n }\n}\n\nexport class SyncBailHook<\n Args extends any[],\n ReturnType,\n ContextType = Record<string, any>\n> extends Hook<Args, ReturnType | undefined | null, ContextType> {\n public call(...args: Args): ReturnType | undefined | null {\n if (!this.isUsed()) {\n return;\n }\n\n const ctx: ContextType = {} as any;\n\n this.interceptions.call(ctx, ...args);\n\n for (let tapIndex = 0; tapIndex < this.taps.length; tapIndex += 1) {\n const rtn = callTap(this.taps[tapIndex], args, ctx);\n if (rtn !== undefined) {\n this.interceptions.result(rtn as any);\n return rtn;\n }\n }\n\n this.interceptions.done();\n }\n}\n\nexport class SyncWaterfallHook<\n Args extends any[],\n ContextType = Record<string, any>\n> extends Hook<Args, Args[0], ContextType> {\n public call(...args: Args): Args[0] {\n const ctx: ContextType = {} as any;\n\n this.interceptions.call(ctx, ...args);\n\n // eslint-disable-next-line prefer-const\n let [rtn, ...rest] = args;\n\n for (let tapIndex = 0; tapIndex < this.taps.length; tapIndex += 1) {\n const tapValue = callTap(this.taps[tapIndex], [rtn, ...rest] as any, ctx);\n if (tapValue !== undefined) {\n rtn = tapValue;\n }\n }\n\n this.interceptions.result(rtn);\n\n return rtn;\n }\n}\n\nexport class SyncLoopHook<\n Args extends any[],\n ContextType = Record<string, any>\n> extends Hook<Args, void, ContextType> {\n public call(...args: Args) {\n let finished = false;\n const ctx: ContextType = {} as any;\n\n this.interceptions.call(ctx, ...args);\n\n try {\n while (finished !== true) {\n finished = true;\n this.interceptions.loop(...args);\n for (let tapIndex = 0; tapIndex < this.taps.length; tapIndex += 1) {\n const rtn = callTap(this.taps[tapIndex], args, ctx);\n\n if (rtn !== undefined) {\n finished = false;\n break;\n }\n }\n }\n } catch (e: unknown) {\n this.interceptions.error(e);\n throw e;\n }\n\n this.interceptions.done();\n }\n}\n\nexport class AsyncParallelHook<\n Args extends any[],\n ContextType = Record<string, any>\n> extends Hook<Args, Promise<void>, ContextType> {\n public async call(...args: Args): Promise<void> {\n const ctx: ContextType = {} as any;\n this.interceptions.call(ctx, ...args);\n\n await Promise.allSettled(this.taps.map((tap) => callTap(tap, args, ctx)));\n this.interceptions.done();\n }\n}\n\nexport class AsyncParallelBailHook<\n Args extends any[],\n ReturnType,\n ContextType = Record<string, any>\n> extends Hook<Args, Promise<ReturnType>, ContextType> {\n public async call(...args: Args): Promise<ReturnType> {\n const ctx: ContextType = {} as any;\n\n this.interceptions.call(ctx, ...args);\n\n try {\n const rtn = await Promise.race(\n this.taps.map((tap) => callTap(tap, args, ctx))\n );\n\n this.interceptions.result(rtn as any);\n return rtn;\n } catch (e: unknown) {\n this.interceptions.error(e);\n throw e;\n }\n }\n}\n\nexport class AsyncSeriesHook<\n Args extends any[],\n ContextType = Record<string, any>\n> extends Hook<Args, Promise<void>, ContextType> {\n public async call(...args: Args): Promise<void> {\n const ctx: ContextType = {} as any;\n\n this.interceptions.call(ctx, ...args);\n\n try {\n for (let tapIndex = 0; tapIndex < this.taps.length; tapIndex += 1) {\n await callTap(this.taps[tapIndex], args, ctx);\n }\n } catch (e: unknown) {\n this.interceptions.error(e);\n throw e;\n }\n\n this.interceptions.done();\n }\n}\n\nexport class AsyncSeriesBailHook<\n Args extends any[],\n ReturnType,\n ContextType = Record<string, any>\n> extends Hook<Args, Promise<ReturnType | undefined | null>, ContextType> {\n public async call(...args: Args): Promise<ReturnType | undefined | null> {\n const ctx: ContextType = {} as any;\n\n this.interceptions.call(ctx, ...args);\n\n try {\n for (let tapIndex = 0; tapIndex < this.taps.length; tapIndex += 1) {\n const rtn = await callTap(this.taps[tapIndex], args, ctx);\n if (rtn !== undefined) {\n this.interceptions.result(rtn);\n return rtn;\n }\n }\n } catch (e: unknown) {\n this.interceptions.error(e);\n throw e;\n }\n\n this.interceptions.done();\n }\n}\n\nexport class AsyncSeriesWaterfallHook<\n Args extends any[],\n ContextType = Record<string, any>\n> extends Hook<Args, Promise<Args[0]>, ContextType> {\n public async call(...args: Args): Promise<Args[0]> {\n // eslint-disable-next-line prefer-const\n let [rtn, ...rest] = args;\n const ctx: ContextType = {} as any;\n\n this.interceptions.call(ctx, ...args);\n\n try {\n for (let tapIndex = 0; tapIndex < this.taps.length; tapIndex += 1) {\n const tapValue = await callTap(\n this.taps[tapIndex],\n [rtn, ...rest] as any,\n ctx\n );\n if (tapValue !== undefined) {\n rtn = tapValue;\n }\n }\n } catch (e: unknown) {\n this.interceptions.error(e);\n throw e;\n }\n\n this.interceptions.result(rtn);\n\n return rtn;\n }\n}\n\nexport class AsyncSeriesLoopHook<\n Args extends any[],\n ContextType = Record<string, any>\n> extends Hook<Args, Promise<void>, ContextType> {\n public async call(...args: Args): Promise<void> {\n let finished = false;\n const ctx: ContextType = {} as any;\n\n this.interceptions.call(ctx, ...args);\n\n try {\n while (finished !== true) {\n finished = true;\n this.interceptions.loop(...args);\n for (let tapIndex = 0; tapIndex < this.taps.length; tapIndex += 1) {\n const rtn = await callTap(this.taps[tapIndex], args, ctx);\n\n if (rtn !== undefined) {\n finished = false;\n break;\n }\n }\n }\n } catch (e: unknown) {\n this.interceptions.error(e);\n throw e;\n }\n\n this.interceptions.done();\n }\n}\n","var SortedArray = (function () {\n var SortedArray = defclass({\n\n constructor: function (array, compare) {\n this.array = [];\n this.compare = compare || compareDefault;\n var length = array.length,\n index = 0;\n while (index < length) this.insert(array[index++]);\n },\n insert: function (element) {\n var array = this.array,\n compare = this.compare,\n high = array.length-1,\n low = 0,\n pos = -1,\n index,\n ordering;\n\n // The array is sorted. You must find the position of new element in O(log(n)), not O(n).\n while (high >= low) {\n index = (high + low) / 2 >>> 0;\n ordering = compare(array[index], element); \n if (ordering < 0) low = index + 1;\n else if (ordering > 0) high = index - 1;\n else {\n pos = index;\n break;\n };\n }\n\n if (pos === -1) {\n // if element was not found, high < low.\n pos = high;\n }\n // This assures that equal elements inserted after will be in a higher position in array.\n // They can be equal for comparison purposes, but different objects with different data.\n // Respecting the chronological order can be important for many applications.\n pos++;\n high = array.length-1;\n while ((pos < high) && (compare(element, array[pos]) === 0)){\n pos++;\n }\n index = array.length;\n // Just to increase array size.\n array.push(element); \n // Much faster. No need to elements swap.\n while (index > pos) {\n array[index] = array[--index];\n }\n // Set the new element on its correct position.\n array[pos] = element;\n\n return this;\n },\n search: function (element) {\n var array = this.array,\n compare = this.compare,\n high = array.length-1,\n low = 0,\n // In most languages, inner variable declaration makes the code slower.\n index,\n ordering;\n\n while (high >= low) {\n index = (high + low) / 2 >>> 0;\n ordering = compare(array[index], element);\n\n if (ordering < 0) low = index + 1;\n else if (ordering > 0) high = index - 1;\n else return index;\n }\n\n return -1;\n },\n remove: function (element) {\n var index = this.search(element);\n if (index >= 0) this.array.splice(index, 1);\n return this;\n }\n });\n\n SortedArray.comparing = function (property, array) {\n return new SortedArray(array, function (a, b) {\n // This should be faster than calling functions.\n // Besides, this way it is not needed to create useless function to return property value.\n return compareDefault(a[property], b[property]);\n });\n };\n\n return SortedArray;\n\n function defclass(prototype) {\n var constructor = prototype.constructor;\n constructor.prototype = prototype;\n return constructor;\n }\n\n function compareDefault(a, b) {\n // Equality has a very low chance to happen. It should be the last option.\n if (a < b)\n return -1;\n else if (a > b)\n return 1;\n else\n return 0;\n }\n}());\n\nif (typeof module === \"object\") module.exports = SortedArray;\nif (typeof define === \"function\" && define.amd)\n define(function () { return SortedArray; });\n","module.exports = globalThis.Player","/*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */\nlet promise\n\nmodule.exports = typeof queueMicrotask === 'function'\n ? queueMicrotask.bind(typeof window !== 'undefined' ? window : global)\n // reuse resolved promise, and allocate it lazily\n : cb => (promise || (promise = Promise.resolve()))\n .then(cb)\n .catch(err => setTimeout(() => { throw err }, 0))\n","export * from \"./assets\";\nexport * from \"./plugin\";\n","import type { TransformFunction } from \"@player-ui/player\";\nimport type { InputAsset, TransformedInput } from \"./types\";\n\n/**\n * Docs about the asset transform\n */\nexport const inputTransform: TransformFunction<InputAsset, TransformedInput> = (\n asset,\n options,\n) => {\n return {\n ...asset,\n format(val) {\n if (asset.binding === undefined) {\n return val;\n }\n\n return options.data.format(asset.binding, val);\n },\n set(val) {\n if (asset.binding === undefined) {\n return;\n }\n\n return options.data.model.set([[asset.binding, val]], {\n formatted: true,\n });\n },\n value:\n asset.binding === undefined\n ? \"\"\n : options.data.model.get(asset.binding, {\n includeInvalid: true,\n formatted: true,\n }),\n validation:\n asset.binding === undefined\n ? undefined\n : options.validation?.get(asset.binding, { track: true }),\n dataType:\n asset.binding === undefined\n ? undefined\n : options.validation?.type(asset.binding),\n };\n};\n","import type { TransformFunction } from \"@player-ui/player\";\nimport type { AssetWrapper } from \"@player-ui/player\";\nimport type { InfoAsset, InfoAssetTransform } from \"./types\";\nimport type { ActionAsset } from \"../action/types\";\nimport { isBackAction } from \"../action/transform\";\n\n/**\n * This transform should add segmentedActions to the info asset.\n * Segmented actions display side by side in larger viewports. Segmented Actions is an object of next and prev actions\n */\nexport const infoTransform: TransformFunction<InfoAsset, InfoAssetTransform> = (\n infoAsset,\n) => {\n const actions = infoAsset?.actions;\n const segmentedActions = actions?.reduce(\n (segmentedActionsArray, action) => {\n segmentedActionsArray[\n isBackAction(action.asset as ActionAsset) ? \"prev\" : \"next\"\n ].push(action as AssetWrapper<ActionAsset>);\n return segmentedActionsArray;\n },\n { next: [], prev: [] } as {\n /**\n * next is an array of next actions\n */\n next: Array<AssetWrapper<ActionAsset>>;\n /**\n * prev is an array of prev actions\n */\n prev: Array<AssetWrapper<ActionAsset>>;\n },\n );\n\n return {\n ...infoAsset,\n segmentedActions,\n };\n};\n","import type { TransformFunction } from \"@player-ui/player\";\nimport type { ImageAsset, TransformedImage } from \"./types\";\n\n/**\n * Function to retrieve the desired alt text based on passed in props.\n * @param props Image props\n * @returns The alt text for the image asset\n */\nconst getImageAlt = (props: ImageAsset): string => {\n const { metaData, placeholder } = props;\n if (metaData.accessibility) return metaData.accessibility;\n\n if (placeholder) return placeholder;\n\n return \"Image\";\n};\n\n/**\n * Sets the Image's placeholder and accessibilty\n */\nexport const imageTransform: TransformFunction<ImageAsset, TransformedImage> = (\n props,\n) => {\n const altText = getImageAlt(props);\n\n const newImage = {\n ...props,\n altText,\n };\n\n return newImage;\n};\n","import type { TransformFunction } from \"@player-ui/player\";\nimport type {\n ChoiceAsset,\n TransformedChoice,\n TransformedChoiceItem,\n} from \"./types\";\n\n/**\n * Docs about the asset transform\n */\nexport const choiceTransform: TransformFunction<\n ChoiceAsset,\n TransformedChoice\n> = (asset, options) => {\n const { items, binding, ...rest } = asset;\n\n const assetHasBinding = binding !== undefined;\n\n const currentValue = assetHasBinding\n ? options.data.model.get(binding, {\n includeInvalid: true,\n })\n : undefined;\n\n const resetValue = () => {\n if (assetHasBinding) {\n return options.data.model.set([[binding, null]]);\n }\n };\n\n const transformedChoiceItems: TransformedChoiceItem[] = (items || []).map(\n (item, index) => ({\n ...item,\n id: item.id ?? `${asset.id}-choice-${index}`,\n select() {\n if (assetHasBinding) {\n return options.data.model.set([[binding, item.value]]);\n }\n },\n unselect: resetValue,\n }),\n );\n\n return {\n ...rest,\n binding,\n clearSelection: resetValue,\n items: transformedChoiceItems,\n value: currentValue,\n validation: assetHasBinding\n ? options.validation?.get(binding, { track: true })\n : undefined,\n dataType: assetHasBinding ? options.validation?.type(binding) : undefined,\n };\n};\n","import { NodeType, getNodeID } from \"@player-ui/player\";\nimport type {\n Player,\n PlayerPlugin,\n Node,\n ParseObjectOptions,\n ParseObjectChildOptions,\n ViewInstance,\n Parser,\n ViewPlugin,\n Resolver,\n Resolve,\n ViewController,\n} from \"@player-ui/player\";\nimport { AsyncSeriesBailHook, SyncBailHook } from \"tapable-ts\";\nimport queueMicrotask from \"queue-microtask\";\n\nexport * from \"./types\";\nexport * from \"./transform\";\nexport * from \"./createAsyncTransform\";\n\n/** Object type for storing data related to a single `apply` of the `AsyncNodePluginPlugin`\n * This object should be setup once per ViewInstance to keep any cached info just for that view to avoid conflicts of shared async node ids across different view states.\n */\ntype AsyncPluginContext = {\n /** Map of async node id to resolved content */\n nodeResolveCache: Map<string, Node.Node>;\n /** The view instance this context is attached to. */\n view: ViewInstance;\n /** The view controller this context is attached to. */\n viewController: ViewController;\n /** Map of async node id to promises being used to resolve them */\n inProgressNodes: Set<string>;\n /** Map of async node ids to the original node they represent.\n * In some cases, async nodes are transformed into from other node types so the original reference is needed in order to trigger an update on the view when the async node changes.\n */\n originalNodeCache: Map<string, Set<Node.Node>>;\n};\n\nexport interface AsyncNodePluginOptions {\n /** A set of plugins to load */\n plugins?: AsyncNodeViewPlugin[];\n}\n\nexport interface AsyncNodeViewPlugin extends ViewPlugin {\n /** Use this to tap into the async node plugin hooks */\n applyPlugin: (asyncNodePlugin: AsyncNodePlugin) => void;\n\n applyPlayer?: (player: Player) => void;\n}\nexport type AsyncHandler = (\n node: Node.Async,\n callback?: (result: any) => void,\n) => Promise<any>;\n\nexport type AsyncContent = {\n async: true;\n flatten?: boolean;\n [key: string]: unknown;\n};\n\n/** Hook declaration for the AsyncNodePlugin */\nexport type AsyncNodeHooks = {\n /** Async hook to get content for an async node */\n onAsyncNode: AsyncSeriesBailHook<[Node.Async, (result: any) => void], any>;\n /** Sync hook to manage errors coming from the onAsyncNode hook. Return a fallback node or null to render a fallback. The first argument of passed in the call is the error thrown. */\n onAsyncNodeError: SyncBailHook<[Error, Node.Async], any>;\n};\n\nexport const AsyncNodePluginSymbol: symbol = Symbol.for(\"AsyncNodePlugin\");\n\n/**\n * Async node plugin used to resolve async nodes in the content\n * If an async node is present, allow users to provide a replacement node to be rendered when ready\n */\nexport class AsyncNodePlugin implements PlayerPlugin {\n private plugins: AsyncNodeViewPlugin[] | undefined;\n private playerInstance: Player | undefined;\n\n static Symbol: symbol = AsyncNodePluginSymbol;\n public readonly symbol: symbol = AsyncNodePlugin.Symbol;\n\n constructor(options: AsyncNodePluginOptions, asyncHandler?: AsyncHandler) {\n if (options?.plugins) {\n this.plugins = options.plugins;\n options.plugins.forEach((plugin) => {\n plugin.applyPlugin(this);\n });\n }\n\n if (asyncHandler) {\n this.hooks.onAsyncNode.tap(\n \"async\",\n async (node: Node.Async, callback) => {\n return await asyncHandler(node, callback);\n },\n );\n }\n }\n\n public readonly hooks: AsyncNodeHooks = {\n onAsyncNode: new AsyncSeriesBailHook(),\n onAsyncNodeError: new SyncBailHook(),\n };\n\n getPlayerInstance(): Player | undefined {\n return this.playerInstance;\n }\n\n name = \"AsyncNode\";\n\n apply(player: Player): void {\n this.playerInstance = player;\n\n this.plugins?.forEach((plugin) => {\n plugin.applyPlayer?.(player);\n });\n\n player.hooks.viewController.tap(this.name, (viewController) => {\n viewController.hooks.view.tap(this.name, (view) => {\n this.plugins?.forEach((plugin) => {\n plugin.apply(view);\n });\n });\n });\n }\n}\n\nexport class AsyncNodePluginPlugin implements AsyncNodeViewPlugin {\n private basePlugin: AsyncNodePlugin | undefined;\n\n name = \"AsyncNode\";\n\n /**\n * Parses the node from the result and triggers an asynchronous view update if necessary.\n * @param node The asynchronous node that might be updated.\n * @param result The result obtained from resolving the async node. This could be any data structure or value.\n * @param options Options provided for node resolution, including a potential parseNode function to process the result.\n * @param view The view instance where the node resides. This can be undefined if the view is not currently active.\n */\n private parseNodeAndUpdate(\n node: Node.Async,\n context: AsyncPluginContext,\n result: any,\n options: Resolve.NodeResolveOptions,\n ) {\n let parsedNode =\n options.parseNode && result ? options.parseNode(result) : undefined;\n\n if (parsedNode && node.onValueReceived) {\n parsedNode = node.onValueReceived(parsedNode);\n }\n\n this.handleAsyncUpdate(node, context, parsedNode);\n }\n\n /**\n * Updates the node asynchronously based on the result provided.\n * This method is responsible for handling the update logic of asynchronous nodes.\n * It checks if the node needs to be updated based on the new result and updates the mapping accordingly.\n * If an update is necessary, it triggers an asynchronous update on the view.\n * @param node The asynchronous node that might be updated.\n * @param newNode The new node to replace the async node.\n * @param view The view instance where the node resides. This can be undefined if the view is not currently active.\n */\n private handleAsyncUpdate(\n node: Node.Async,\n context: AsyncPluginContext,\n newNode?: Node.Node | null,\n ) {\n const { nodeResolveCache, viewController, originalNodeCache } = context;\n if (nodeResolveCache.get(node.id) !== newNode) {\n nodeResolveCache.set(node.id, newNode ? newNode : node);\n const originalNode = originalNodeCache.get(node.id) ?? new Set([node]);\n viewController.updateViewAST(originalNode);\n }\n }\n\n private hasValidMapping(\n node: Node.Async,\n context: AsyncPluginContext,\n ): boolean {\n const { nodeResolveCache } = context;\n return (\n nodeResolveCache.has(node.id) && nodeResolveCache.get(node.id) !== node\n );\n }\n\n /**\n * Handles the asynchronous API integration for resolving nodes.\n * This method sets up a hook on the resolver's `beforeResolve` event to process async nodes.\n * @param resolver The resolver instance to attach the hook to.\n * @param view\n */\n applyResolver(resolver: Resolver, context: AsyncPluginContext): void {\n resolver.hooks.beforeResolve.tap(this.name, (node, options) => {\n if (!this.isAsync(node)) {\n return node === null ? node : this.resolveAsyncChildren(node, context);\n }\n if (options.node) {\n context.originalNodeCache.set(node.id, new Set([options.node]));\n }\n\n const resolvedNode = context.nodeResolveCache.get(node.id);\n if (resolvedNode !== undefined) {\n return this.resolveAsyncChildren(resolvedNode, context);\n }\n\n if (context.inProgressNodes.has(node.id)) {\n return node;\n }\n\n // Track that the node is in progress.\n context.inProgressNodes.add(node.id);\n queueMicrotask(() => {\n this.runAsyncNode(node, context, options).finally();\n });\n\n return node;\n });\n }\n\n /**\n * Replaces child async nodes with their resolved content and flattens when necessary. Resolving the children directly helps manage the `parent` reference without needing as much work within the resolver itself.\n * Handles async node chains as well to make sure all applicable nodes can get flattened.\n * @param node - The node whose children need to be resolved.\n * @param context - the async plugin context needed to reach into the cache\n * @returns The same node but with async node children mapped to their resolved AST.\n */\n private resolveAsyncChildren(\n node: Node.Node,\n context: AsyncPluginContext,\n ): Node.Node {\n if (node.type === NodeType.MultiNode) {\n // Using a while loop lets us catch when async nodes produce more async nodes that need to be flattened further\n let index = 0;\n while (index < node.values.length) {\n const childNode = node.values[index];\n if (\n childNode?.type !== NodeType.Async ||\n !this.hasValidMapping(childNode, context)\n ) {\n index++;\n continue;\n }\n\n const mappedNode = context.nodeResolveCache.get(childNode.id)!;\n const nodeSet = new Set<Node.Node>();\n if (mappedNode.type === NodeType.MultiNode && childNode.flatten) {\n mappedNode.values.forEach((v: Node.Node) => {\n v.parent = node;\n nodeSet.add(v);\n });\n node.values = [\n ...node.values.slice(0, index),\n ...mappedNode.values,\n ...node.values.slice(index + 1),\n ];\n } else {\n node.values[index] = mappedNode;\n mappedNode.parent = node;\n nodeSet.add(mappedNode);\n }\n context.originalNodeCache.set(childNode.id, nodeSet);\n }\n } else if (\"children\" in node) {\n node.children?.forEach((c) => {\n // Similar to above, using a while loop lets us handle when async nodes produce more async nodes.\n while (\n c.value.type === NodeType.Async &&\n this.hasValidMapping(c.value, context)\n ) {\n const mappedNode = context.nodeResolveCache.get(c.value.id)!;\n context.originalNodeCache.set(c.value.id, new Set([mappedNode]));\n c.value = mappedNode;\n c.value.parent = node;\n }\n });\n }\n\n return node;\n }\n\n private async runAsyncNode(\n node: Node.Async,\n context: AsyncPluginContext,\n options: Resolve.NodeResolveOptions,\n ) {\n try {\n const result = await this.basePlugin?.hooks.onAsyncNode.call(\n node,\n (result) => {\n this.parseNodeAndUpdate(node, context, result, options);\n },\n );\n\n // Stop tracking before the next update is triggered\n context.inProgressNodes.delete(node.id);\n this.parseNodeAndUpdate(node, context, result, options);\n } catch (e: unknown) {\n const error = e instanceof Error ? e : new Error(String(e));\n const result = this.basePlugin?.hooks.onAsyncNodeError.call(error, node);\n\n if (result === undefined) {\n const playerState = this.basePlugin?.getPlayerInstance()?.getState();\n\n if (playerState?.status === \"in-progress\") {\n playerState.fail(error);\n }\n\n return;\n }\n\n options.logger?.error(\n \"Async node handling failed and resolved with a fallback. Error:\",\n error,\n );\n\n // Stop tracking before the next update is triggered\n context.inProgressNodes.delete(node.id);\n this.parseNodeAndUpdate(node, context, result, options);\n }\n }\n\n private isAsync(node: Node.Node | null): node is Node.Async {\n return node?.type === NodeType.Async;\n }\n\n private isDeterminedAsync(obj: unknown): obj is AsyncContent {\n return (\n typeof obj === \"object\" &&\n obj !== null &&\n Object.prototype.hasOwnProperty.call(obj, \"async\")\n );\n }\n\n applyParser(parser: Parser): void {\n parser.hooks.parseNode.tap(\n this.name,\n (\n obj: any,\n nodeType: Node.ChildrenTypes,\n options: ParseObjectOptions,\n childOptions?: ParseObjectChildOptions,\n ) => {\n if (this.isDeterminedAsync(obj)) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { async, flatten, ...rest } = obj;\n const parsedAsync = parser.parseObject(rest, nodeType, options);\n const parsedNodeId = getNodeID(parsedAsync);\n\n if (parsedAsync === null || !parsedNodeId) {\n return childOptions ? [] : null;\n }\n\n const asyncAST = parser.createASTNode(\n {\n id: parsedNodeId,\n type: NodeType.Async,\n value: parsedAsync,\n flatten,\n },\n obj,\n );\n\n if (childOptions) {\n return asyncAST\n ? [\n {\n path: [...childOptions.path, childOptions.key],\n value: asyncAST,\n },\n ]\n : [];\n }\n\n return asyncAST;\n }\n },\n );\n }\n\n apply(view: ViewInstance): void {\n view.hooks.parser.tap(\"async\", this.applyParser.bind(this));\n }\n\n applyPlayer(player: Player): void {\n player.hooks.viewController.tap(\"async\", (viewController) => {\n viewController.hooks.view.tap(\"async\", (view) => {\n const context: AsyncPluginContext = {\n nodeResolveCache: new Map(),\n inProgressNodes: new Set(),\n view,\n viewController,\n originalNodeCache: new Map(),\n };\n\n view.hooks.resolver.tap(\"async\", (resolver) => {\n this.applyResolver(resolver, context);\n });\n });\n });\n }\n\n applyPlugin(asyncNodePlugin: AsyncNodePlugin): void {\n this.basePlugin = asyncNodePlugin;\n }\n}\n","import { Builder } from \"@player-ui/player\";\nimport type { AsyncTransformFunc } from \"./types\";\n\n/**\n * @deprecated Use {@link createAsyncTransform} to create your before transform function.\n * Util function to generate transform function for async asset\n * @param asset - async asset to apply beforeResolve transform\n * @param wrapperAssetType: container asset type\n * @param flatten: flatten the streamed in content\n * @param path: property path to add the multinode containing the next async node to\n * @returns - wrapper asset with children of transformed asset and async node\n */\n\nexport const asyncTransform: AsyncTransformFunc = (\n assetId,\n wrapperAssetType,\n asset,\n flatten,\n path = [\"values\"],\n) => {\n const id = \"async-\" + assetId;\n\n const asyncNode = Builder.asyncNode(id, flatten);\n\n let multiNode;\n let assetNode;\n\n if (asset) {\n assetNode = Builder.assetWrapper(asset);\n multiNode = Builder.multiNode(assetNode, asyncNode);\n } else {\n multiNode = Builder.multiNode(asyncNode);\n }\n\n const wrapperAsset = Builder.asset({\n id: wrapperAssetType + \"-\" + id,\n type: wrapperAssetType,\n });\n\n Builder.addChild(wrapperAsset, path, multiNode);\n\n return wrapperAsset;\n};\n","import {\n BeforeTransformFunction,\n Builder,\n Node,\n NodeType,\n} from \"@player-ui/player\";\nimport {\n extractNodeFromPath,\n requiresAssetWrapper,\n traverseAndReplace,\n unwrapAsset,\n} from \"./utils\";\n\nexport type AsyncTransformOptions = {\n /** Whether or not to flatten the results into its container. Defaults to true */\n flatten?: boolean;\n /** The path to the array within the `wrapperAssetType` that will contain the async content. Defaults to [\"values\"] */\n path?: string[];\n /** The asset type that the transform is matching against. */\n transformAssetType: string;\n /** The asset type that will contain the async content. */\n wrapperAssetType: string;\n /** Function to get any nested asset that will need to be extracted and kept when creating the wrapper asset. */\n getNestedAsset?: (node: Node.ViewOrAsset) => Node.Node | undefined;\n /** Function to get the id for the async node being generated. Defaults to creating an id with the format of async-<ASSET.ID> */\n getAsyncNodeId?: (node: Node.ViewOrAsset) => string;\n /** Where to place the async node relative to the asset from `getNestedAsset`. Defaults to \"append\" */\n asyncNodePosition?: \"append\" | \"prepend\";\n};\n\nconst defaultGetNodeId = (node: Node.ViewOrAsset): string => {\n return `async-${node.value.id}`;\n};\n\n/** Creates a BeforeTransformFunction that turns the given asset into a wrapper asset with an async node in it.\n * By setting {@link AsyncTransformOptions.flatten} to true, you can chain multiple of the same asset type to create a flow of async content that\n * exists within a single collection.\n *\n * @param options - Options for managing the transform\n * @returns The {@link BeforeTransformFunction} that can be used for your asset.\n */\nexport const createAsyncTransform = (\n options: AsyncTransformOptions,\n): BeforeTransformFunction => {\n const {\n transformAssetType,\n wrapperAssetType,\n getNestedAsset,\n getAsyncNodeId = defaultGetNodeId,\n path = [\"values\"],\n flatten = true,\n asyncNodePosition = \"append\",\n } = options;\n\n const replaceNode = (node: Node.Node): Node.Node => {\n const unwrapped = unwrapAsset(node);\n\n if (\n unwrapped.type !== NodeType.Asset ||\n unwrapped.value.type !== transformAssetType\n ) {\n return node;\n }\n\n const transformed = asyncTransform(unwrapped);\n return extractNodeFromPath(transformed, path) ?? node;\n };\n\n const replacer = (node: Node.Node) => traverseAndReplace(node, replaceNode);\n\n const asyncTransform = (node: Node.ViewOrAsset) => {\n const id = getAsyncNodeId(node);\n const asset = getNestedAsset?.(node);\n\n // If flattening is disabled, don't need to extract the multi-node when async node is resolved.\n const replaceFunction = flatten ? replacer : undefined;\n const asyncNode = Builder.asyncNode(id, flatten, replaceFunction);\n\n const values: Node.Node[] = [asyncNode];\n if (asset) {\n const otherValues = [];\n if (requiresAssetWrapper(asset)) {\n otherValues.push(Builder.assetWrapper(asset));\n } else if (asset.type === NodeType.MultiNode) {\n otherValues.push(...asset.values);\n } else {\n otherValues.push(asset);\n }\n\n if (asyncNodePosition === \"append\") {\n values.unshift(...otherValues);\n } else {\n values.push(...otherValues);\n }\n }\n\n const multiNode = Builder.multiNode(...(values as any[]));\n\n const wrapperAsset: Node.ViewOrAsset = Builder.asset({\n id: wrapperAssetType + \"-\" + id,\n type: wrapperAssetType,\n });\n\n Builder.addChild(wrapperAsset, path, multiNode);\n\n return wrapperAsset;\n };\n\n return asyncTransform;\n};\n","import { NodeType, Node } from \"@player-ui/player\";\n\n/** Replaces a node using the given replace function. If the node is a multi-node it does this transformation to all of its values. */\nexport const traverseAndReplace = (\n node: Node.Node,\n replaceFn: (node: Node.Node) => Node.Node,\n): Node.Node => {\n if (node.type === NodeType.MultiNode) {\n let index = 0;\n while (index < node.values.length) {\n const child = node.values[index];\n if (!child) {\n index++;\n continue;\n }\n\n const result = replaceFn(child);\n if (result.type === NodeType.MultiNode) {\n node.values = [\n ...node.values.slice(0, index),\n ...result.values,\n ...node.values.slice(index + 1),\n ];\n } else {\n node.values[index] = result;\n index++;\n }\n }\n\n return node;\n }\n\n return replaceFn(node);\n};\n","import { NodeType, Node } from \"@player-ui/player\";\n\nexport const unwrapAsset = (node: Node.Node): Node.Node => {\n if (node.type !== NodeType.Value) {\n return node;\n }\n const child = node.children?.find(\n (x) => x.path.length === 1 && x.path[0] === \"asset\",\n );\n\n if (!child) {\n return node;\n }\n\n return child.value;\n};\n","import { NodeType } from \"@player-ui/player\";\nimport type { Node } from \"@player-ui/player\";\n\nexport const requiresAssetWrapper = (node: Node.Node): boolean => {\n if (node.type === NodeType.Asset) {\n return true;\n }\n\n if (node.type !== NodeType.Applicability) {\n return false;\n }\n\n return node.value.type === NodeType.Asset;\n};\n","import type { Node } from \"@player-ui/player\";\n\n/** Matches 2 segments where pathA matches or is a subset of pathB. Returns the number of matching segments */\nconst getMatchValue = (\n pathA: Node.PathSegment[],\n pathB: Node.PathSegment[],\n): number => {\n if (pathA.length > pathB.length) {\n return 0;\n }\n\n let matchCount = 0;\n for (let i = 0; i < pathA.length; i++) {\n if (pathA[i] === pathB[i]) {\n matchCount++;\n } else {\n return 0;\n }\n }\n\n return matchCount;\n};\n\n/** Follows the given path and returns the node. If there is no match, returns undefined */\nexport const extractNodeFromPath = (\n node: Node.Node,\n path?: string[],\n): Node.Node | undefined => {\n if (path === undefined || path.length === 0) {\n return node;\n }\n\n if (!(\"children\" in node && node.children)) {\n return undefined;\n }\n\n let matchResult = 0;\n let bestMatch: Node.Child | undefined;\n for (const child of node.children) {\n const matchValue = getMatchValue(child.path, path);\n if (matchValue > matchResult) {\n matchResult = matchValue;\n bestMatch = child;\n }\n }\n\n if (!bestMatch) {\n return undefined;\n }\n\n if (matchResult >= path.length) {\n return bestMatch.value;\n }\n\n return extractNodeFromPath(bestMatch.value, path.slice(matchResult));\n};\n","import type {\n BeforeTransformFunction,\n TransformFunctions,\n} from \"@player-ui/player\";\nimport { composeBefore, compose } from \"@player-ui/asset-transform-plugin\";\nimport { createAsyncTransform } from \"@player-ui/async-node-plugin\";\nimport { ChatMessageAsset } from \"./types\";\n/**\n * In beforeTransform function, pass in flatten marker and call beforeResolve function.\n * Flatten default value is true.\n * input: ChatMessageAsset\n * @param asset - Asset to apply the transform to\n * @returns - transformed asset with async node and asset node\n */\nexport const transform: BeforeTransformFunction<ChatMessageAsset> =\n createAsyncTransform({\n transformAssetType: \"chat-message\",\n wrapperAssetType: \"collection\",\n getNestedAsset: (node) => node.children?.[0]?.value,\n });\n\nexport const chatMessageTransform: TransformFunctions = compose(\n composeBefore(transform),\n);\n","import type { Player, PlayerPlugin } from \"@player-ui/player\";\n\n/**\n * A plugin that can wrap a set of other plugins.\n */\nexport class MetaPlugin implements PlayerPlugin {\n name = \"meta-plugin\";\n\n public readonly plugins: Array<PlayerPlugin>;\n\n constructor(plugins: Array<PlayerPlugin> = []) {\n this.plugins = plugins;\n }\n\n apply(player: Player) {\n this.plugins.forEach((plugin) => player.registerPlugin(plugin));\n }\n}\n","import { AsyncNodePlugin } from \"@player-ui/async-node-plugin\";\nimport {\n ExpressionContext,\n ExtendedPlayerPlugin,\n NodeType,\n Player,\n} from \"@player-ui/player\";\nimport { ExpressionPlugin } from \"@player-ui/expression-plugin\";\nimport { send } from \"./send\";\n\nconst createContentFromMessage = (message: string, id: string): any => ({\n asset: {\n type: \"chat-message\",\n id,\n value: {\n asset: {\n type: \"text\",\n id: `${id}-value`,\n value: message,\n },\n },\n },\n});\n\nexport class ChatUiDemoPlugin implements ExtendedPlayerPlugin<[], [], [send]> {\n public readonly name = \"chat-ui-demo-plugin\";\n\n public apply(player: Player): void {\n const asyncNodePlugin = player.findPlugin<AsyncNodePlugin>(\n AsyncNodePlugin.Symbol,\n );\n\n if (!asyncNodePlugin) {\n player.logger.warn(\n `Failed to apply '${this.name}'. Reason: Could not find AsyncNodePlugin.`,\n );\n return;\n }\n\n let deferredPromises: Record<string, (val: string) => void> = {};\n let allPromiseKeys: string[] = [];\n let counter = 0;\n\n const sendMessage: send = (\n context: ExpressionContext,\n message: string,\n nodeId?: string,\n ): void => {\n if (nodeId && !(nodeId in deferredPromises)) {\n context.logger?.warn(\n `'send' expression called with unrecognized id '${nodeId}'`,\n );\n return;\n }\n\n if (!nodeId && allPromiseKeys.length === 0) {\n context.logger?.warn(`'send' called with no waiting async nodes`);\n return;\n }\n\n // Either resolve the node by the id or resolve all of them if no id provided\n const keys = nodeId ? [nodeId] : allPromiseKeys;\n\n for (const id of keys) {\n const content = createContentFromMessage(\n message,\n `chat-demo-${counter++}`,\n );\n const resolveFunction = deferredPromises[id];\n resolveFunction?.(content);\n delete deferredPromises[id];\n }\n\n if (nodeId) {\n const index = allPromiseKeys.indexOf(nodeId);\n allPromiseKeys.splice(index, 1);\n } else {\n allPromiseKeys = [];\n }\n };\n\n asyncNodePlugin.hooks.onAsyncNode.tap(this.name, (node) => {\n // Ensure this is only used on the chat-ui.tsx mock to prevent the promise from setting up during tests.\n if (\n (node.parent?.parent?.type !== NodeType.Asset &&\n node.parent?.parent?.type !== NodeType.View) ||\n !node.parent.parent.value.id.startsWith(\"collection-async-chat-demo\")\n ) {\n return Promise.resolve(undefined);\n }\n\n return new Promise((res) => {\n deferredPromises[node.id] = res;\n allPromiseKeys.push(node.id);\n });\n });\n\n // Reset at the start of a new view.\n player.hooks.view.tap(this.name, (_) => {\n deferredPromises = {};\n allPromiseKeys = [];\n counter = 0;\n });\n\n // Register 'send' expression\n const expressionPlugin = new ExpressionPlugin(\n new Map([[\"send\", sendMessage]]),\n );\n player.registerPlugin(expressionPlugin);\n }\n}\n","import type {\n Player,\n PlayerPlugin,\n ExpressionHandler,\n} from \"@player-ui/player\";\n\nexport type ExpressionMap = Map<string, ExpressionHandler<any[], any>>;\n\n/**\n * The ExpressionPlugin is an easy way to inject custom expression handlers into the running player instance.\n * Simply supply a map of function name to handler, and the expressions will be available inside of the Content.\n *\n * Any subsequent expressions registered with the same name will override previous handlers.\n */\nexport class ExpressionPlugin implements PlayerPlugin {\n name = \"ExpressionPlugin\";\n private expressions: ExpressionMap;\n\n constructor(expressionMap: ExpressionMap) {\n this.expressions = expressionMap;\n }\n\n apply(player: Player) {\n player.hooks.expressionEvaluator.tap(this.name, (expEvaluator) => {\n this.expressions.forEach((handler, name) => {\n expEvaluator.addExpressionFunction(name, handler);\n });\n });\n }\n}\n","import type { ExtendedPlayerPlugin, Player } from \"@player-ui/player\";\nimport { AssetTransformPlugin } from \"@player-ui/asset-transform-plugin\";\nimport {\n actionTransform,\n chatMessageTransform,\n choiceTransform,\n imageTransform,\n infoTransform,\n inputTransform,\n} from \"../assets\";\nimport type {\n ActionAsset,\n ChatMessageAsset,\n ChoiceAsset,\n CollectionAsset,\n ImageAsset,\n InfoAsset,\n InputAsset,\n TextAsset,\n} from \"../assets\";\n\nexport class ReferenceAssetsTransformPlugin\n implements\n ExtendedPlayerPlugin<\n [\n ActionAsset,\n InputAsset,\n ImageAsset,\n TextAsset,\n CollectionAsset,\n ChoiceAsset,\n ChatMessageAsset,\n ],\n [InfoAsset]\n >\n{\n name = \"reference-assets-transforms\";\n\n apply(player: Player): void {\n player.registerPlugin(\n new AssetTransformPlugin([\n [{ type: \"action\" }, actionTransform],\n [{ type: \"input\" }, inputTransform],\n [{ type: \"image\" }, imageTransform],\n [{ type: \"info\" }, infoTransform],\n [{ type: \"choice\" }, choiceTransform],\n [{ type: \"chat-message\" }, chatMessageTransform],\n ]),\n );\n }\n}\n","import type { Player, PlayerPlugin } from \"@player-ui/player\";\nimport { MetaPlugin } from \"@player-ui/meta-plugin\";\nimport { ChatUiDemoPlugin, ReferenceAssetsTransformPlugin } from \"./plugins\";\nimport {\n AsyncNodePlugin,\n AsyncNodePluginPlugin,\n} from \"@player-ui/async-node-plugin\";\n\n/**\n * A plugin to add transforms for the reference assets\n */\nexport class ReferenceAssetsPlugin implements PlayerPlugin {\n name = \"reference-assets-plugin\";\n\n private readonly metaPlugin = new MetaPlugin([\n new AsyncNodePlugin({\n plugins: [new AsyncNodePluginPlugin()],\n }),\n new ReferenceAssetsTransformPlugin(),\n new ChatUiDemoPlugin(),\n ]);\n\n apply(player: Player): void {\n player.registerPlugin(this.metaPlugin);\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  {
2
- "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2755/execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/action/types.ts",
2
+ "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2785/execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/action/types.ts",
3
3
  "name": "ActionAsset",
4
4
  "type": "object",
5
5
  "properties": {
@@ -51,7 +51,7 @@
51
51
  "beacon": {
52
52
  "required": false,
53
53
  "node": {
54
- "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2755/execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/@player-ui+beacon-plugin@0.0.0/node_modules/@player-ui/beacon-plugin/types/beacon.d.ts",
54
+ "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2785/execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/@player-ui+beacon-plugin@0.0.0/node_modules/@player-ui/beacon-plugin/types/beacon.d.ts",
55
55
  "name": "BeaconDataType",
56
56
  "type": "or",
57
57
  "or": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2755/execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/chat-message/types.ts",
2
+ "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2785/execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/chat-message/types.ts",
3
3
  "name": "ChatMessageAsset",
4
4
  "type": "object",
5
5
  "properties": {
@@ -1,5 +1,5 @@
1
1
  {
2
- "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2755/execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/choice/types.ts",
2
+ "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2785/execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/choice/types.ts",
3
3
  "name": "ChoiceAsset",
4
4
  "type": "object",
5
5
  "properties": {
@@ -47,7 +47,7 @@
47
47
  "node": {
48
48
  "type": "array",
49
49
  "elementType": {
50
- "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2755/execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/choice/types.ts",
50
+ "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2785/execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/choice/types.ts",
51
51
  "name": "ChoiceItem",
52
52
  "type": "object",
53
53
  "properties": {
@@ -77,7 +77,7 @@
77
77
  "value": {
78
78
  "required": false,
79
79
  "node": {
80
- "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2755/execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/choice/types.ts",
80
+ "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2785/execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/choice/types.ts",
81
81
  "name": "ValueType",
82
82
  "type": "or",
83
83
  "or": [
@@ -125,14 +125,14 @@
125
125
  "metaData": {
126
126
  "required": false,
127
127
  "node": {
128
- "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2755/execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/@player-ui+beacon-plugin@0.0.0/node_modules/@player-ui/beacon-plugin/types/beacon.d.ts",
128
+ "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2785/execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/@player-ui+beacon-plugin@0.0.0/node_modules/@player-ui/beacon-plugin/types/beacon.d.ts",
129
129
  "name": "BeaconMetaData",
130
130
  "type": "object",
131
131
  "properties": {
132
132
  "beacon": {
133
133
  "required": false,
134
134
  "node": {
135
- "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2755/execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/@player-ui+beacon-plugin@0.0.0/node_modules/@player-ui/beacon-plugin/types/beacon.d.ts",
135
+ "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2785/execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/@player-ui+beacon-plugin@0.0.0/node_modules/@player-ui/beacon-plugin/types/beacon.d.ts",
136
136
  "name": "BeaconDataType",
137
137
  "type": "or",
138
138
  "or": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2755/execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/collection/types.ts",
2
+ "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2785/execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/collection/types.ts",
3
3
  "name": "CollectionAsset",
4
4
  "type": "object",
5
5
  "properties": {
@@ -1,12 +1,12 @@
1
1
  {
2
- "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2755/execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/image/types.ts",
2
+ "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2785/execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/image/types.ts",
3
3
  "name": "ImageAsset",
4
4
  "type": "object",
5
5
  "properties": {
6
6
  "metaData": {
7
7
  "required": true,
8
8
  "node": {
9
- "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2755/execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/image/types.ts",
9
+ "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2785/execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/image/types.ts",
10
10
  "name": "ImageMetaData",
11
11
  "type": "object",
12
12
  "properties": {
@@ -1,5 +1,5 @@
1
1
  {
2
- "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2755/execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/input/types.ts",
2
+ "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2785/execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/input/types.ts",
3
3
  "name": "InputAsset",
4
4
  "type": "object",
5
5
  "properties": {
@@ -50,7 +50,7 @@
50
50
  "beacon": {
51
51
  "required": false,
52
52
  "node": {
53
- "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2755/execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/@player-ui+beacon-plugin@0.0.0/node_modules/@player-ui/beacon-plugin/types/beacon.d.ts",
53
+ "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2785/execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/@player-ui+beacon-plugin@0.0.0/node_modules/@player-ui/beacon-plugin/types/beacon.d.ts",
54
54
  "name": "BeaconDataType",
55
55
  "type": "or",
56
56
  "or": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2755/execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/text/types.ts",
2
+ "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2785/execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/text/types.ts",
3
3
  "name": "TextAsset",
4
4
  "type": "object",
5
5
  "properties": {
@@ -16,12 +16,12 @@
16
16
  "node": {
17
17
  "type": "array",
18
18
  "elementType": {
19
- "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2755/execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/text/types.ts",
19
+ "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2785/execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/text/types.ts",
20
20
  "name": "TextModifier",
21
21
  "type": "or",
22
22
  "or": [
23
23
  {
24
- "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2755/execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/text/types.ts",
24
+ "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2785/execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/text/types.ts",
25
25
  "name": "BasicTextModifier",
26
26
  "type": "object",
27
27
  "properties": {
@@ -48,7 +48,7 @@
48
48
  "title": "BasicTextModifier"
49
49
  },
50
50
  {
51
- "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2755/execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/text/types.ts",
51
+ "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2785/execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/text/types.ts",
52
52
  "name": "LinkModifier",
53
53
  "type": "object",
54
54
  "properties": {
@@ -1,5 +1,5 @@
1
1
  {
2
- "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2755/execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/plugins/send.ts",
2
+ "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2785/execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/plugins/send.ts",
3
3
  "name": "send",
4
4
  "type": "ref",
5
5
  "ref": "ExpressionHandler<[string, string | undefined]>",
@@ -1,5 +1,5 @@
1
1
  {
2
- "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2755/execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/info/types.ts",
2
+ "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2785/execroot/_main/bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/src/assets/info/types.ts",
3
3
  "name": "InfoAsset",
4
4
  "type": "object",
5
5
  "properties": {
package/package.json CHANGED
@@ -6,14 +6,14 @@
6
6
  "types"
7
7
  ],
8
8
  "name": "@player-ui/reference-assets-plugin",
9
- "version": "0.15.3--canary.836.34713",
9
+ "version": "0.15.3--canary.836.34893",
10
10
  "main": "dist/cjs/index.cjs",
11
11
  "dependencies": {
12
- "@player-ui/asset-transform-plugin": "0.15.3--canary.836.34713",
13
- "@player-ui/beacon-plugin": "0.15.3--canary.836.34713",
14
- "@player-ui/async-node-plugin": "0.15.3--canary.836.34713",
15
- "@player-ui/expression-plugin": "0.15.3--canary.836.34713",
16
- "@player-ui/meta-plugin": "0.15.3--canary.836.34713",
12
+ "@player-ui/asset-transform-plugin": "0.15.3--canary.836.34893",
13
+ "@player-ui/beacon-plugin": "0.15.3--canary.836.34893",
14
+ "@player-ui/async-node-plugin": "0.15.3--canary.836.34893",
15
+ "@player-ui/expression-plugin": "0.15.3--canary.836.34893",
16
+ "@player-ui/meta-plugin": "0.15.3--canary.836.34893",
17
17
  "tslib": "^2.6.2"
18
18
  },
19
19
  "devDependencies": {
@@ -21,7 +21,7 @@
21
21
  "@player-ui/common-types-plugin": "workspace:^"
22
22
  },
23
23
  "peerDependencies": {
24
- "@player-ui/player": "0.15.3--canary.836.34713"
24
+ "@player-ui/player": "0.15.3--canary.836.34893"
25
25
  },
26
26
  "module": "dist/index.legacy-esm.js",
27
27
  "types": "types/index.d.ts",