@player-devtools/basic-plugin 0.12.1--canary.8.548 → 0.13.0-next.0
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.
|
@@ -1441,7 +1441,7 @@ var BasicDevtoolsPlugin = function() {
|
|
|
1441
1441
|
playerConfig: {}
|
|
1442
1442
|
}
|
|
1443
1443
|
};
|
|
1444
|
-
var PLUGIN_VERSION = true ? "0.
|
|
1444
|
+
var PLUGIN_VERSION = true ? "0.13.0-next.0" : "unstamped";
|
|
1445
1445
|
var BasicPluginData = {
|
|
1446
1446
|
id: PLUGIN_ID,
|
|
1447
1447
|
name: "Standard Devtools",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/circleci/.cache/bazel/_bazel_circleci/8a7a049d85b1ea1286a017c8d271a188/sandbox/processwrapper-sandbox/2657/execroot/_main/bazel-out/k8-fastbuild/bin/devtools/plugins/basic/core/dist/index.global.js","../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/utils/core/src/index.ts","../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/immer@10.1.3/node_modules/immer/src/utils/errors.ts","../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/immer@10.1.3/node_modules/immer/src/utils/common.ts","../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/immer@10.1.3/node_modules/immer/src/utils/plugins.ts","../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/immer@10.1.3/node_modules/immer/src/core/scope.ts","../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/immer@10.1.3/node_modules/immer/src/core/finalize.ts","../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/immer@10.1.3/node_modules/immer/src/core/proxy.ts","../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/immer@10.1.3/node_modules/immer/src/core/immerClass.ts","../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/immer@10.1.3/node_modules/immer/src/core/current.ts","../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/dequal@2.0.3/node_modules/dequal/dist/index.mjs","../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/plugin/core/src/helpers/uuid.ts","../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/plugins/basic/core/src/index.ts","../../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/plugins/basic/content/src/constants.ts","../../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/plugins/basic/content/_generated/flow.json","../../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/plugins/basic/content/src/index.ts","../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/immer@10.1.3/node_modules/immer/src/utils/env.ts","../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/immer@10.1.3/node_modules/immer/src/immer.ts","../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/plugin/core/src/state.ts","../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/plugin/core/src/reducer.ts","../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/plugin/core/src/constants.ts","../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/plugin/core/src/helpers/genDataChangeTransaction.ts","../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/plugin/core/src/plugin.ts","../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/plugins/basic/core/src/plugin.ts"],"names":["BasicDevtoolsPlugin","dsetAssign","obj","keys","value","merge","key","length","Error","acc","target","slice","reduce","deepAssign","die","error","args","e","errors","msg","apply","isDraft","DRAFT_STATE","isDraftable","isPlainObject","Array","isArray","DRAFTABLE","constructor","isMap","isSet","proto","getPrototypeOf","Ctor","Object","hasOwnProperty","call","Function","toString","objectCtorString","each","iter","getArchtype","Reflect","ownKeys","forEach","entry","index","thing","state","type_","has","prop","prototype","set","propOrOldValue","t","add","is","x","y","Map","Set","latest","copy_","base_","shallowCopy","base","strict","isPlain","descriptors","getOwnPropertyDescriptors","i","desc","writable","configurable","get","enumerable","create","assign","dontMutateFrozenCollections","isFrozen","getPlugin","pluginKey","plugin","plugins","getCurrentScope","currentScope","createScope","parent_","immer_","drafts_","canAutoFreeze_","unfinalizedDrafts_","usePatchesInScope","scope","patchListener","patches_","inversePatches_","patchListener_","revokeScope","leaveScope","revokeDraft","enterScope","immer","draft","revoke_","revoked_","processResult","result","baseDraft","isReplaced","modified_","finalize","maybeFreeze","generateReplacementPatches_","NOTHING","rootScope","path","childValue","finalizeProperty","scope_","finalized_","resultEach","clear","generatePatches_","parentState","targetObject","rootPath","targetIsSet","assigned_","concat","res","autoFreeze_","propertyIsEnumerable","deep","freeze","createProxyProxy","parent","draft_","isManual_","traps","objectTraps","arrayTraps","Proxy","revocable","revoke","proxy","peek","source","readPropFromProto","getDescriptorFromProto","getOwnPropertyDescriptor","prepareCopy","useStrictShallowCopy_","createProxy","proxyMap_","proxySet_","push","current","currentImpl","find","tar","dequal","generateUUID","d","Date","getTime","d2","performance","now","replace","c","r","Math","random","floor","__defProp","defineProperty","__getOwnPropDesc","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","__export","all","name","__copyProps","to","from","except","__toCommonJS","mod","src_exports","PLUGIN_ID","INTERACTIONS","EVALUATE_EXPRESSION","OVERRIDE_FLOW","flow_default","id","views","type","header","asset","values","label","main","binding","filter","footer","exp","navigation","BEGIN","Plugin","startState","CONFIG","state_type","ref","transitions","Config","Flow","Logs","Console","Editor","FLOW","LOGS","CONSOLE","EDITOR","schema","ROOT","playerConfig","flow","expression","default","validation","format","code","history","logs","logsType","time","message","severity","outcome","metricType","historyType","data","PLUGIN_VERSION","BasicPluginData","description","version","pop","entries","item","record","Symbol","for","defineProperties","delete","currentState","markChanged","Number","isNaN","deleteProperty","owner","setPrototypeOf","fn","arguments","Immer","config","produce","recipe","defaultBase","self","curriedProduce","hasError","p","ip","produceWithPatches","patches","inversePatches","autoFreeze","setAutoFreeze","useStrictShallowCopy","setUseStrictShallowCopy","createDraft","finishDraft","applyPatches","patch","op","applyPatchesImpl","applyPatches_","copy","foo","bar","ctor","len","tmp","RegExp","size","ArrayBuffer","Uint8Array","DataView","byteLength","getInt8","isView","useStateReducer","reducer","initialState","subscribers","getState","subscribe","subscriber","dispatch","action","prevState","nextState","sub","containsInteraction","interactions","interaction","transaction","payload","messages","pluginID","console","playerID","PLAYER_SELECTED","PLUGIN_INACTIVE_WARNING","NOOP_ID","genDataChangeTransaction","sender","context","timestamp","_messenger_","INITIAL_STATE","currentPlayer","DevtoolsPlugin","options","loggedWarning","store","lastProcessedInteraction","processInteraction","bind","pluginData","registerMessenger","messenger","lastMessageIndex","start","newlyAdded","sendMessage","dispatchPlayerInit","dispatchDataUpdate","newData","checkIfDevtoolsIsActive","isActive","handler","log","player","logger","WeakRef","getVersion","getPlugins","map","hooks","dataController","tap","onUpdate","updates","newValue","asArray","onStart","f","JSON","parse","stringify","view","expressionEvaluator","evaluator","overrideFlow","evaluateExpression","deref","onError","intercept","evaluatorResult","evaluate","String","newFlow"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AA,EAAc;wBACvE,IAAIQ;wBAEJ,IAAI;4BACFA,UAAUd,KAAKC,KAAA,CAAMpD;wBACvB,EAAA,OAAShT,GAAG;gCACV,oBAAA;6BAAA,eAAA,IAAA,CAAKqV,MAAA,cAAL,oCAAA,qBAAA,aAAasB,KAAA,gBAAb,yCAAA,mBAAsB7W,KAAA,CAAM,IAAA,CAAK0K,IAAA,EAAM,0BAA0BxK;wBACnE;wBAEA,IAAIiX,SAAS;4BACX,IAAA,CAAKR,YAAA,CAAaQ;wBACpB;wBAEA;oBACF;gBACF;;;;MAxKuClD;IvB01DvC,OAAOlJ,aAAaE;AACtB","sourcesContent":["\"use strict\";\nvar BasicDevtoolsPlugin = (() => {\n var __defProp = Object.defineProperty;\n var __getOwnPropDesc = Object.getOwnPropertyDescriptor;\n var __getOwnPropNames = Object.getOwnPropertyNames;\n var __hasOwnProp = Object.prototype.hasOwnProperty;\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 __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n // ../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/plugins/basic/core/src/index.ts\n var src_exports = {};\n __export(src_exports, {\n BasicDevtoolsPlugin: () => BasicDevtoolsPlugin\n });\n\n // ../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/@player-devtools+basic-plugin-content@0.0.0/node_modules/@player-devtools/basic-plugin-content/dist/index.mjs\n var PLUGIN_ID = \"player-ui-basic-devtools-plugin\";\n var INTERACTIONS = {\n EVALUATE_EXPRESSION: \"evaluate-expression\",\n OVERRIDE_FLOW: \"override-flow\"\n };\n var flow_default = {\n id: \"player-ui-basic-devtools-plugin\",\n views: [\n {\n id: \"Config\",\n type: \"stacked-view\",\n header: {\n asset: {\n id: \"Config-header\",\n type: \"navigation\",\n values: [\n {\n asset: {\n id: \"Config-header-values-0\",\n type: \"action\",\n value: \"Config\",\n label: {\n asset: {\n id: \"Config-header-values-0-label\",\n type: \"text\",\n value: \"Config\"\n }\n }\n }\n },\n {\n asset: {\n id: \"Config-header-values-1\",\n type: \"action\",\n value: \"Flow\",\n label: {\n asset: {\n id: \"Config-header-values-1-label\",\n type: \"text\",\n value: \"Flow\"\n }\n }\n }\n },\n {\n asset: {\n id: \"Config-header-values-2\",\n type: \"action\",\n value: \"Logs\",\n label: {\n asset: {\n id: \"Config-header-values-2-label\",\n type: \"text\",\n value: \"Logs\"\n }\n }\n }\n },\n {\n asset: {\n id: \"Config-header-values-3\",\n type: \"action\",\n value: \"Console\",\n label: {\n asset: {\n id: \"Config-header-values-3-label\",\n type: \"text\",\n value: \"Console\"\n }\n }\n }\n },\n {\n asset: {\n id: \"Config-header-values-4\",\n type: \"action\",\n value: \"Editor\",\n label: {\n asset: {\n id: \"Config-header-values-4-label\",\n type: \"text\",\n value: \"Editor\"\n }\n }\n }\n }\n ]\n }\n },\n main: {\n asset: {\n id: \"Config-main\",\n type: \"object-inspector\",\n binding: \"playerConfig\",\n label: {\n asset: {\n id: \"Config-main-label\",\n type: \"text\",\n value: \"Config\"\n }\n }\n }\n }\n },\n {\n id: \"Flow\",\n type: \"stacked-view\",\n header: {\n asset: {\n id: \"Flow-header\",\n type: \"navigation\",\n values: [\n {\n asset: {\n id: \"Flow-header-values-0\",\n type: \"action\",\n value: \"Config\",\n label: {\n asset: {\n id: \"Flow-header-values-0-label\",\n type: \"text\",\n value: \"Config\"\n }\n }\n }\n },\n {\n asset: {\n id: \"Flow-header-values-1\",\n type: \"action\",\n value: \"Flow\",\n label: {\n asset: {\n id: \"Flow-header-values-1-label\",\n type: \"text\",\n value: \"Flow\"\n }\n }\n }\n },\n {\n asset: {\n id: \"Flow-header-values-2\",\n type: \"action\",\n value: \"Logs\",\n label: {\n asset: {\n id: \"Flow-header-values-2-label\",\n type: \"text\",\n value: \"Logs\"\n }\n }\n }\n },\n {\n asset: {\n id: \"Flow-header-values-3\",\n type: \"action\",\n value: \"Console\",\n label: {\n asset: {\n id: \"Flow-header-values-3-label\",\n type: \"text\",\n value: \"Console\"\n }\n }\n }\n },\n {\n asset: {\n id: \"Flow-header-values-4\",\n type: \"action\",\n value: \"Editor\",\n label: {\n asset: {\n id: \"Flow-header-values-4-label\",\n type: \"text\",\n value: \"Editor\"\n }\n }\n }\n }\n ]\n }\n },\n main: {\n asset: {\n id: \"Flow-main\",\n type: \"object-inspector\",\n filter: true,\n binding: \"flow\",\n label: {\n asset: {\n id: \"Flow-main-label\",\n type: \"text\",\n value: \"Flow\"\n }\n }\n }\n },\n footer: {\n asset: {\n id: \"Flow-footer\",\n type: \"copy-to-clipboard\",\n binding: \"flow\",\n label: {\n asset: {\n id: \"Flow-footer-label\",\n type: \"text\",\n value: \"Copy flow to the clipboard\"\n }\n }\n }\n }\n },\n {\n id: \"Logs\",\n type: \"stacked-view\",\n header: {\n asset: {\n id: \"Logs-header\",\n type: \"navigation\",\n values: [\n {\n asset: {\n id: \"Logs-header-values-0\",\n type: \"action\",\n value: \"Config\",\n label: {\n asset: {\n id: \"Logs-header-values-0-label\",\n type: \"text\",\n value: \"Config\"\n }\n }\n }\n },\n {\n asset: {\n id: \"Logs-header-values-1\",\n type: \"action\",\n value: \"Flow\",\n label: {\n asset: {\n id: \"Logs-header-values-1-label\",\n type: \"text\",\n value: \"Flow\"\n }\n }\n }\n },\n {\n asset: {\n id: \"Logs-header-values-2\",\n type: \"action\",\n value: \"Logs\",\n label: {\n asset: {\n id: \"Logs-header-values-2-label\",\n type: \"text\",\n value: \"Logs\"\n }\n }\n }\n },\n {\n asset: {\n id: \"Logs-header-values-3\",\n type: \"action\",\n value: \"Console\",\n label: {\n asset: {\n id: \"Logs-header-values-3-label\",\n type: \"text\",\n value: \"Console\"\n }\n }\n }\n },\n {\n asset: {\n id: \"Logs-header-values-4\",\n type: \"action\",\n value: \"Editor\",\n label: {\n asset: {\n id: \"Logs-header-values-4-label\",\n type: \"text\",\n value: \"Editor\"\n }\n }\n }\n }\n ]\n }\n },\n main: {\n asset: {\n id: \"Logs-main\",\n type: \"table\",\n binding: \"logs\"\n }\n }\n },\n {\n id: \"Console\",\n type: \"stacked-view\",\n header: {\n asset: {\n id: \"Console-header\",\n type: \"navigation\",\n values: [\n {\n asset: {\n id: \"Console-header-values-0\",\n type: \"action\",\n value: \"Config\",\n label: {\n asset: {\n id: \"Console-header-values-0-label\",\n type: \"text\",\n value: \"Config\"\n }\n }\n }\n },\n {\n asset: {\n id: \"Console-header-values-1\",\n type: \"action\",\n value: \"Flow\",\n label: {\n asset: {\n id: \"Console-header-values-1-label\",\n type: \"text\",\n value: \"Flow\"\n }\n }\n }\n },\n {\n asset: {\n id: \"Console-header-values-2\",\n type: \"action\",\n value: \"Logs\",\n label: {\n asset: {\n id: \"Console-header-values-2-label\",\n type: \"text\",\n value: \"Logs\"\n }\n }\n }\n },\n {\n asset: {\n id: \"Console-header-values-3\",\n type: \"action\",\n value: \"Console\",\n label: {\n asset: {\n id: \"Console-header-values-3-label\",\n type: \"text\",\n value: \"Console\"\n }\n }\n }\n },\n {\n asset: {\n id: \"Console-header-values-4\",\n type: \"action\",\n value: \"Editor\",\n label: {\n asset: {\n id: \"Console-header-values-4-label\",\n type: \"text\",\n value: \"Editor\"\n }\n }\n }\n }\n ]\n }\n },\n main: {\n asset: {\n id: \"Console-main\",\n type: \"console\",\n exp: \" publish('evaluate-expression', {{expression}}) \",\n binding: \"history\"\n }\n }\n },\n {\n id: \"Editor\",\n type: \"stacked-view\",\n header: {\n asset: {\n id: \"Editor-header\",\n type: \"navigation\",\n values: [\n {\n asset: {\n id: \"Editor-header-values-0\",\n type: \"action\",\n value: \"Config\",\n label: {\n asset: {\n id: \"Editor-header-values-0-label\",\n type: \"text\",\n value: \"Config\"\n }\n }\n }\n },\n {\n asset: {\n id: \"Editor-header-values-1\",\n type: \"action\",\n value: \"Flow\",\n label: {\n asset: {\n id: \"Editor-header-values-1-label\",\n type: \"text\",\n value: \"Flow\"\n }\n }\n }\n },\n {\n asset: {\n id: \"Editor-header-values-2\",\n type: \"action\",\n value: \"Logs\",\n label: {\n asset: {\n id: \"Editor-header-values-2-label\",\n type: \"text\",\n value: \"Logs\"\n }\n }\n }\n },\n {\n asset: {\n id: \"Editor-header-values-3\",\n type: \"action\",\n value: \"Console\",\n label: {\n asset: {\n id: \"Editor-header-values-3-label\",\n type: \"text\",\n value: \"Console\"\n }\n }\n }\n },\n {\n asset: {\n id: \"Editor-header-values-4\",\n type: \"action\",\n value: \"Editor\",\n label: {\n asset: {\n id: \"Editor-header-values-4-label\",\n type: \"text\",\n value: \"Editor\"\n }\n }\n }\n }\n ]\n }\n },\n main: {\n asset: {\n id: \"Editor-main\",\n type: \"code-editor\",\n binding: \"flow\",\n exp: \" publish('override-flow', {{code}}) \"\n }\n }\n }\n ],\n navigation: {\n BEGIN: \"Plugin\",\n Plugin: {\n startState: \"CONFIG\",\n CONFIG: {\n state_type: \"VIEW\",\n ref: \"Config\",\n transitions: {\n Config: \"CONFIG\",\n Flow: \"FLOW\",\n Logs: \"LOGS\",\n Console: \"CONSOLE\",\n Editor: \"EDITOR\"\n }\n },\n FLOW: {\n state_type: \"VIEW\",\n ref: \"Flow\",\n transitions: {\n Config: \"CONFIG\",\n Flow: \"FLOW\",\n Logs: \"LOGS\",\n Console: \"CONSOLE\",\n Editor: \"EDITOR\"\n }\n },\n LOGS: {\n state_type: \"VIEW\",\n ref: \"Logs\",\n transitions: {\n Config: \"CONFIG\",\n Flow: \"FLOW\",\n Logs: \"LOGS\",\n Console: \"CONSOLE\",\n Editor: \"EDITOR\"\n }\n },\n CONSOLE: {\n state_type: \"VIEW\",\n ref: \"Console\",\n transitions: {\n Config: \"CONFIG\",\n Flow: \"FLOW\",\n Logs: \"LOGS\",\n Console: \"CONSOLE\",\n Editor: \"EDITOR\"\n }\n },\n EDITOR: {\n state_type: \"VIEW\",\n ref: \"Editor\",\n transitions: {\n Config: \"CONFIG\",\n Flow: \"FLOW\",\n Logs: \"LOGS\",\n Console: \"CONSOLE\",\n Editor: \"EDITOR\"\n }\n }\n }\n },\n schema: {\n ROOT: {\n playerConfig: {\n type: \"RecordType\"\n },\n flow: {\n type: \"RecordType\"\n },\n expression: {\n type: \"StringType\",\n default: \"\",\n validation: [\n {\n type: \"string\"\n }\n ],\n format: {\n type: \"string\"\n }\n },\n code: {\n type: \"StringType\",\n default: \"\",\n validation: [\n {\n type: \"string\"\n }\n ],\n format: {\n type: \"string\"\n }\n },\n history: {\n type: \"historyType\",\n isArray: true\n },\n logs: {\n type: \"logsType\",\n isArray: true\n }\n },\n logsType: {\n id: {\n type: \"StringType\",\n default: \"\",\n validation: [\n {\n type: \"string\"\n }\n ],\n format: {\n type: \"string\"\n }\n },\n time: {\n type: \"StringType\",\n default: \"\",\n validation: [\n {\n type: \"string\"\n }\n ],\n format: {\n type: \"string\"\n }\n },\n type: {\n type: \"StringType\",\n default: \"\",\n validation: [\n {\n type: \"string\"\n }\n ],\n format: {\n type: \"string\"\n }\n },\n message: {\n type: \"StringType\",\n default: \"\",\n validation: [\n {\n type: \"string\"\n }\n ],\n format: {\n type: \"string\"\n }\n },\n severity: {\n type: \"StringType\",\n default: \"\",\n validation: [\n {\n type: \"string\"\n }\n ],\n format: {\n type: \"string\"\n }\n },\n binding: {\n type: \"StringType\",\n default: \"\",\n validation: [\n {\n type: \"string\"\n }\n ],\n format: {\n type: \"string\"\n }\n },\n from: {\n type: \"StringType\",\n default: \"\",\n validation: [\n {\n type: \"string\"\n }\n ],\n format: {\n type: \"string\"\n }\n },\n to: {\n type: \"StringType\",\n default: \"\",\n validation: [\n {\n type: \"string\"\n }\n ],\n format: {\n type: \"string\"\n }\n },\n state: {\n type: \"StringType\",\n default: \"\",\n validation: [\n {\n type: \"string\"\n }\n ],\n format: {\n type: \"string\"\n }\n },\n error: {\n type: \"StringType\",\n default: \"\",\n validation: [\n {\n type: \"string\"\n }\n ],\n format: {\n type: \"string\"\n }\n },\n outcome: {\n type: \"StringType\",\n default: \"\",\n validation: [\n {\n type: \"string\"\n }\n ],\n format: {\n type: \"string\"\n }\n },\n metricType: {\n type: \"StringType\",\n default: \"\",\n validation: [\n {\n type: \"string\"\n }\n ],\n format: {\n type: \"string\"\n }\n }\n },\n historyType: {\n id: {\n type: \"StringType\",\n default: \"\",\n validation: [\n {\n type: \"string\"\n }\n ],\n format: {\n type: \"string\"\n }\n },\n expression: {\n type: \"StringType\",\n default: \"\",\n validation: [\n {\n type: \"string\"\n }\n ],\n format: {\n type: \"string\"\n }\n },\n result: {\n type: \"StringType\",\n default: \"\",\n validation: [\n {\n type: \"string\"\n }\n ],\n format: {\n type: \"string\"\n }\n },\n severity: {\n type: \"StringType\",\n default: \"\",\n validation: [\n {\n type: \"string\"\n }\n ],\n format: {\n type: \"string\"\n }\n }\n }\n },\n data: {\n expression: \"\",\n flow: {},\n history: [],\n logs: [],\n playerConfig: {}\n }\n };\n var PLUGIN_VERSION = true ? \"0.12.1--canary.8.548\" : \"unstamped\";\n var BasicPluginData = {\n id: PLUGIN_ID,\n name: \"Standard Devtools\",\n description: \"Standard Player UI Devtools\",\n version: PLUGIN_VERSION,\n flow: flow_default\n };\n\n // ../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/@player-devtools+utils@0.0.0/node_modules/@player-devtools/utils/dist/index.mjs\n function deepAssign(target, source, merge = false) {\n if (Array.isArray(target) && Array.isArray(source)) {\n while (!merge && target.length > source.length) target.pop();\n for (const [index, item] of source.entries()) {\n target[index] = deepAssign(target[index], item, merge);\n }\n } else if (target && typeof target === \"object\" && source && typeof source === \"object\") {\n const record = target;\n if (!merge)\n for (const key of Object.keys(target)) {\n if (!(key in source)) delete record[key];\n }\n for (const [key, item] of Object.entries(source)) {\n record[key] = deepAssign(record[key], item, merge);\n }\n } else {\n return source;\n }\n return target;\n }\n function dsetAssign(obj, keys, value, merge = false) {\n const key = keys[keys.length - 1];\n if (!key) throw Error(\"Unable to assign at path containing undefined keys\");\n const target = keys.slice(0, -1).reduce(\n (acc, key2) => acc[key2] ?? (acc[key2] = {}),\n obj\n );\n target[key] = deepAssign(target[key], value, merge);\n }\n\n // ../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/immer@10.1.3/node_modules/immer/dist/immer.mjs\n var NOTHING = Symbol.for(\"immer-nothing\");\n var DRAFTABLE = Symbol.for(\"immer-draftable\");\n var DRAFT_STATE = Symbol.for(\"immer-state\");\n function die(error, ...args) {\n if (false) {\n const e = errors[error];\n const msg = typeof e === \"function\" ? e.apply(null, args) : e;\n throw new Error(`[Immer] ${msg}`);\n }\n throw new Error(\n `[Immer] minified error nr: ${error}. Full error at: https://bit.ly/3cXEKWf`\n );\n }\n var getPrototypeOf = Object.getPrototypeOf;\n function isDraft(value) {\n return !!value && !!value[DRAFT_STATE];\n }\n function isDraftable(value) {\n if (!value)\n return false;\n return isPlainObject(value) || Array.isArray(value) || !!value[DRAFTABLE] || !!value.constructor?.[DRAFTABLE] || isMap(value) || isSet(value);\n }\n var objectCtorString = Object.prototype.constructor.toString();\n function isPlainObject(value) {\n if (!value || typeof value !== \"object\")\n return false;\n const proto = getPrototypeOf(value);\n if (proto === null) {\n return true;\n }\n const Ctor = Object.hasOwnProperty.call(proto, \"constructor\") && proto.constructor;\n if (Ctor === Object)\n return true;\n return typeof Ctor == \"function\" && Function.toString.call(Ctor) === objectCtorString;\n }\n function each(obj, iter) {\n if (getArchtype(obj) === 0) {\n Reflect.ownKeys(obj).forEach((key) => {\n iter(key, obj[key], obj);\n });\n } else {\n obj.forEach((entry, index) => iter(index, entry, obj));\n }\n }\n function getArchtype(thing) {\n const state = thing[DRAFT_STATE];\n return state ? state.type_ : Array.isArray(thing) ? 1 : isMap(thing) ? 2 : isSet(thing) ? 3 : 0;\n }\n function has(thing, prop) {\n return getArchtype(thing) === 2 ? thing.has(prop) : Object.prototype.hasOwnProperty.call(thing, prop);\n }\n function set(thing, propOrOldValue, value) {\n const t = getArchtype(thing);\n if (t === 2)\n thing.set(propOrOldValue, value);\n else if (t === 3) {\n thing.add(value);\n } else\n thing[propOrOldValue] = value;\n }\n function is(x, y) {\n if (x === y) {\n return x !== 0 || 1 / x === 1 / y;\n } else {\n return x !== x && y !== y;\n }\n }\n function isMap(target) {\n return target instanceof Map;\n }\n function isSet(target) {\n return target instanceof Set;\n }\n function latest(state) {\n return state.copy_ || state.base_;\n }\n function shallowCopy(base, strict) {\n if (isMap(base)) {\n return new Map(base);\n }\n if (isSet(base)) {\n return new Set(base);\n }\n if (Array.isArray(base))\n return Array.prototype.slice.call(base);\n const isPlain = isPlainObject(base);\n if (strict === true || strict === \"class_only\" && !isPlain) {\n const descriptors = Object.getOwnPropertyDescriptors(base);\n delete descriptors[DRAFT_STATE];\n let keys = Reflect.ownKeys(descriptors);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const desc = descriptors[key];\n if (desc.writable === false) {\n desc.writable = true;\n desc.configurable = true;\n }\n if (desc.get || desc.set)\n descriptors[key] = {\n configurable: true,\n writable: true,\n // could live with !!desc.set as well here...\n enumerable: desc.enumerable,\n value: base[key]\n };\n }\n return Object.create(getPrototypeOf(base), descriptors);\n } else {\n const proto = getPrototypeOf(base);\n if (proto !== null && isPlain) {\n return { ...base };\n }\n const obj = Object.create(proto);\n return Object.assign(obj, base);\n }\n }\n function freeze(obj, deep = false) {\n if (isFrozen(obj) || isDraft(obj) || !isDraftable(obj))\n return obj;\n if (getArchtype(obj) > 1) {\n Object.defineProperties(obj, {\n set: { value: dontMutateFrozenCollections },\n add: { value: dontMutateFrozenCollections },\n clear: { value: dontMutateFrozenCollections },\n delete: { value: dontMutateFrozenCollections }\n });\n }\n Object.freeze(obj);\n if (deep)\n Object.values(obj).forEach((value) => freeze(value, true));\n return obj;\n }\n function dontMutateFrozenCollections() {\n die(2);\n }\n function isFrozen(obj) {\n return Object.isFrozen(obj);\n }\n var plugins = {};\n function getPlugin(pluginKey) {\n const plugin = plugins[pluginKey];\n if (!plugin) {\n die(0, pluginKey);\n }\n return plugin;\n }\n var currentScope;\n function getCurrentScope() {\n return currentScope;\n }\n function createScope(parent_, immer_) {\n return {\n drafts_: [],\n parent_,\n immer_,\n // Whenever the modified draft contains a draft from another scope, we\n // need to prevent auto-freezing so the unowned draft can be finalized.\n canAutoFreeze_: true,\n unfinalizedDrafts_: 0\n };\n }\n function usePatchesInScope(scope, patchListener) {\n if (patchListener) {\n getPlugin(\"Patches\");\n scope.patches_ = [];\n scope.inversePatches_ = [];\n scope.patchListener_ = patchListener;\n }\n }\n function revokeScope(scope) {\n leaveScope(scope);\n scope.drafts_.forEach(revokeDraft);\n scope.drafts_ = null;\n }\n function leaveScope(scope) {\n if (scope === currentScope) {\n currentScope = scope.parent_;\n }\n }\n function enterScope(immer2) {\n return currentScope = createScope(currentScope, immer2);\n }\n function revokeDraft(draft) {\n const state = draft[DRAFT_STATE];\n if (state.type_ === 0 || state.type_ === 1)\n state.revoke_();\n else\n state.revoked_ = true;\n }\n function processResult(result, scope) {\n scope.unfinalizedDrafts_ = scope.drafts_.length;\n const baseDraft = scope.drafts_[0];\n const isReplaced = result !== void 0 && result !== baseDraft;\n if (isReplaced) {\n if (baseDraft[DRAFT_STATE].modified_) {\n revokeScope(scope);\n die(4);\n }\n if (isDraftable(result)) {\n result = finalize(scope, result);\n if (!scope.parent_)\n maybeFreeze(scope, result);\n }\n if (scope.patches_) {\n getPlugin(\"Patches\").generateReplacementPatches_(\n baseDraft[DRAFT_STATE].base_,\n result,\n scope.patches_,\n scope.inversePatches_\n );\n }\n } else {\n result = finalize(scope, baseDraft, []);\n }\n revokeScope(scope);\n if (scope.patches_) {\n scope.patchListener_(scope.patches_, scope.inversePatches_);\n }\n return result !== NOTHING ? result : void 0;\n }\n function finalize(rootScope, value, path) {\n if (isFrozen(value))\n return value;\n const state = value[DRAFT_STATE];\n if (!state) {\n each(\n value,\n (key, childValue) => finalizeProperty(rootScope, state, value, key, childValue, path)\n );\n return value;\n }\n if (state.scope_ !== rootScope)\n return value;\n if (!state.modified_) {\n maybeFreeze(rootScope, state.base_, true);\n return state.base_;\n }\n if (!state.finalized_) {\n state.finalized_ = true;\n state.scope_.unfinalizedDrafts_--;\n const result = state.copy_;\n let resultEach = result;\n let isSet2 = false;\n if (state.type_ === 3) {\n resultEach = new Set(result);\n result.clear();\n isSet2 = true;\n }\n each(\n resultEach,\n (key, childValue) => finalizeProperty(rootScope, state, result, key, childValue, path, isSet2)\n );\n maybeFreeze(rootScope, result, false);\n if (path && rootScope.patches_) {\n getPlugin(\"Patches\").generatePatches_(\n state,\n path,\n rootScope.patches_,\n rootScope.inversePatches_\n );\n }\n }\n return state.copy_;\n }\n function finalizeProperty(rootScope, parentState, targetObject, prop, childValue, rootPath, targetIsSet) {\n if (false)\n die(5);\n if (isDraft(childValue)) {\n const path = rootPath && parentState && parentState.type_ !== 3 && // Set objects are atomic since they have no keys.\n !has(parentState.assigned_, prop) ? rootPath.concat(prop) : void 0;\n const res = finalize(rootScope, childValue, path);\n set(targetObject, prop, res);\n if (isDraft(res)) {\n rootScope.canAutoFreeze_ = false;\n } else\n return;\n } else if (targetIsSet) {\n targetObject.add(childValue);\n }\n if (isDraftable(childValue) && !isFrozen(childValue)) {\n if (!rootScope.immer_.autoFreeze_ && rootScope.unfinalizedDrafts_ < 1) {\n return;\n }\n finalize(rootScope, childValue);\n if ((!parentState || !parentState.scope_.parent_) && typeof prop !== \"symbol\" && (isMap(targetObject) ? targetObject.has(prop) : Object.prototype.propertyIsEnumerable.call(targetObject, prop)))\n maybeFreeze(rootScope, childValue);\n }\n }\n function maybeFreeze(scope, value, deep = false) {\n if (!scope.parent_ && scope.immer_.autoFreeze_ && scope.canAutoFreeze_) {\n freeze(value, deep);\n }\n }\n function createProxyProxy(base, parent) {\n const isArray = Array.isArray(base);\n const state = {\n type_: isArray ? 1 : 0,\n // Track which produce call this is associated with.\n scope_: parent ? parent.scope_ : getCurrentScope(),\n // True for both shallow and deep changes.\n modified_: false,\n // Used during finalization.\n finalized_: false,\n // Track which properties have been assigned (true) or deleted (false).\n assigned_: {},\n // The parent draft state.\n parent_: parent,\n // The base state.\n base_: base,\n // The base proxy.\n draft_: null,\n // set below\n // The base copy with any updated values.\n copy_: null,\n // Called by the `produce` function.\n revoke_: null,\n isManual_: false\n };\n let target = state;\n let traps = objectTraps;\n if (isArray) {\n target = [state];\n traps = arrayTraps;\n }\n const { revoke, proxy } = Proxy.revocable(target, traps);\n state.draft_ = proxy;\n state.revoke_ = revoke;\n return proxy;\n }\n var objectTraps = {\n get(state, prop) {\n if (prop === DRAFT_STATE)\n return state;\n const source = latest(state);\n if (!has(source, prop)) {\n return readPropFromProto(state, source, prop);\n }\n const value = source[prop];\n if (state.finalized_ || !isDraftable(value)) {\n return value;\n }\n if (value === peek(state.base_, prop)) {\n prepareCopy(state);\n return state.copy_[prop] = createProxy(value, state);\n }\n return value;\n },\n has(state, prop) {\n return prop in latest(state);\n },\n ownKeys(state) {\n return Reflect.ownKeys(latest(state));\n },\n set(state, prop, value) {\n const desc = getDescriptorFromProto(latest(state), prop);\n if (desc?.set) {\n desc.set.call(state.draft_, value);\n return true;\n }\n if (!state.modified_) {\n const current2 = peek(latest(state), prop);\n const currentState = current2?.[DRAFT_STATE];\n if (currentState && currentState.base_ === value) {\n state.copy_[prop] = value;\n state.assigned_[prop] = false;\n return true;\n }\n if (is(value, current2) && (value !== void 0 || has(state.base_, prop)))\n return true;\n prepareCopy(state);\n markChanged(state);\n }\n if (state.copy_[prop] === value && // special case: handle new props with value 'undefined'\n (value !== void 0 || prop in state.copy_) || // special case: NaN\n Number.isNaN(value) && Number.isNaN(state.copy_[prop]))\n return true;\n state.copy_[prop] = value;\n state.assigned_[prop] = true;\n return true;\n },\n deleteProperty(state, prop) {\n if (peek(state.base_, prop) !== void 0 || prop in state.base_) {\n state.assigned_[prop] = false;\n prepareCopy(state);\n markChanged(state);\n } else {\n delete state.assigned_[prop];\n }\n if (state.copy_) {\n delete state.copy_[prop];\n }\n return true;\n },\n // Note: We never coerce `desc.value` into an Immer draft, because we can't make\n // the same guarantee in ES5 mode.\n getOwnPropertyDescriptor(state, prop) {\n const owner = latest(state);\n const desc = Reflect.getOwnPropertyDescriptor(owner, prop);\n if (!desc)\n return desc;\n return {\n writable: true,\n configurable: state.type_ !== 1 || prop !== \"length\",\n enumerable: desc.enumerable,\n value: owner[prop]\n };\n },\n defineProperty() {\n die(11);\n },\n getPrototypeOf(state) {\n return getPrototypeOf(state.base_);\n },\n setPrototypeOf() {\n die(12);\n }\n };\n var arrayTraps = {};\n each(objectTraps, (key, fn) => {\n arrayTraps[key] = function() {\n arguments[0] = arguments[0][0];\n return fn.apply(this, arguments);\n };\n });\n arrayTraps.deleteProperty = function(state, prop) {\n if (false)\n die(13);\n return arrayTraps.set.call(this, state, prop, void 0);\n };\n arrayTraps.set = function(state, prop, value) {\n if (false)\n die(14);\n return objectTraps.set.call(this, state[0], prop, value, state[0]);\n };\n function peek(draft, prop) {\n const state = draft[DRAFT_STATE];\n const source = state ? latest(state) : draft;\n return source[prop];\n }\n function readPropFromProto(state, source, prop) {\n const desc = getDescriptorFromProto(source, prop);\n return desc ? `value` in desc ? desc.value : (\n // This is a very special case, if the prop is a getter defined by the\n // prototype, we should invoke it with the draft as context!\n desc.get?.call(state.draft_)\n ) : void 0;\n }\n function getDescriptorFromProto(source, prop) {\n if (!(prop in source))\n return void 0;\n let proto = getPrototypeOf(source);\n while (proto) {\n const desc = Object.getOwnPropertyDescriptor(proto, prop);\n if (desc)\n return desc;\n proto = getPrototypeOf(proto);\n }\n return void 0;\n }\n function markChanged(state) {\n if (!state.modified_) {\n state.modified_ = true;\n if (state.parent_) {\n markChanged(state.parent_);\n }\n }\n }\n function prepareCopy(state) {\n if (!state.copy_) {\n state.copy_ = shallowCopy(\n state.base_,\n state.scope_.immer_.useStrictShallowCopy_\n );\n }\n }\n var Immer2 = class {\n constructor(config) {\n this.autoFreeze_ = true;\n this.useStrictShallowCopy_ = false;\n this.produce = (base, recipe, patchListener) => {\n if (typeof base === \"function\" && typeof recipe !== \"function\") {\n const defaultBase = recipe;\n recipe = base;\n const self = this;\n return function curriedProduce(base2 = defaultBase, ...args) {\n return self.produce(base2, (draft) => recipe.call(this, draft, ...args));\n };\n }\n if (typeof recipe !== \"function\")\n die(6);\n if (patchListener !== void 0 && typeof patchListener !== \"function\")\n die(7);\n let result;\n if (isDraftable(base)) {\n const scope = enterScope(this);\n const proxy = createProxy(base, void 0);\n let hasError = true;\n try {\n result = recipe(proxy);\n hasError = false;\n } finally {\n if (hasError)\n revokeScope(scope);\n else\n leaveScope(scope);\n }\n usePatchesInScope(scope, patchListener);\n return processResult(result, scope);\n } else if (!base || typeof base !== \"object\") {\n result = recipe(base);\n if (result === void 0)\n result = base;\n if (result === NOTHING)\n result = void 0;\n if (this.autoFreeze_)\n freeze(result, true);\n if (patchListener) {\n const p = [];\n const ip = [];\n getPlugin(\"Patches\").generateReplacementPatches_(base, result, p, ip);\n patchListener(p, ip);\n }\n return result;\n } else\n die(1, base);\n };\n this.produceWithPatches = (base, recipe) => {\n if (typeof base === \"function\") {\n return (state, ...args) => this.produceWithPatches(state, (draft) => base(draft, ...args));\n }\n let patches, inversePatches;\n const result = this.produce(base, recipe, (p, ip) => {\n patches = p;\n inversePatches = ip;\n });\n return [result, patches, inversePatches];\n };\n if (typeof config?.autoFreeze === \"boolean\")\n this.setAutoFreeze(config.autoFreeze);\n if (typeof config?.useStrictShallowCopy === \"boolean\")\n this.setUseStrictShallowCopy(config.useStrictShallowCopy);\n }\n createDraft(base) {\n if (!isDraftable(base))\n die(8);\n if (isDraft(base))\n base = current(base);\n const scope = enterScope(this);\n const proxy = createProxy(base, void 0);\n proxy[DRAFT_STATE].isManual_ = true;\n leaveScope(scope);\n return proxy;\n }\n finishDraft(draft, patchListener) {\n const state = draft && draft[DRAFT_STATE];\n if (!state || !state.isManual_)\n die(9);\n const { scope_: scope } = state;\n usePatchesInScope(scope, patchListener);\n return processResult(void 0, scope);\n }\n /**\n * Pass true to automatically freeze all copies created by Immer.\n *\n * By default, auto-freezing is enabled.\n */\n setAutoFreeze(value) {\n this.autoFreeze_ = value;\n }\n /**\n * Pass true to enable strict shallow copy.\n *\n * By default, immer does not copy the object descriptors such as getter, setter and non-enumrable properties.\n */\n setUseStrictShallowCopy(value) {\n this.useStrictShallowCopy_ = value;\n }\n applyPatches(base, patches) {\n let i;\n for (i = patches.length - 1; i >= 0; i--) {\n const patch = patches[i];\n if (patch.path.length === 0 && patch.op === \"replace\") {\n base = patch.value;\n break;\n }\n }\n if (i > -1) {\n patches = patches.slice(i + 1);\n }\n const applyPatchesImpl = getPlugin(\"Patches\").applyPatches_;\n if (isDraft(base)) {\n return applyPatchesImpl(base, patches);\n }\n return this.produce(\n base,\n (draft) => applyPatchesImpl(draft, patches)\n );\n }\n };\n function createProxy(value, parent) {\n const draft = isMap(value) ? getPlugin(\"MapSet\").proxyMap_(value, parent) : isSet(value) ? getPlugin(\"MapSet\").proxySet_(value, parent) : createProxyProxy(value, parent);\n const scope = parent ? parent.scope_ : getCurrentScope();\n scope.drafts_.push(draft);\n return draft;\n }\n function current(value) {\n if (!isDraft(value))\n die(10, value);\n return currentImpl(value);\n }\n function currentImpl(value) {\n if (!isDraftable(value) || isFrozen(value))\n return value;\n const state = value[DRAFT_STATE];\n let copy;\n if (state) {\n if (!state.modified_)\n return state.base_;\n state.finalized_ = true;\n copy = shallowCopy(value, state.scope_.immer_.useStrictShallowCopy_);\n } else {\n copy = shallowCopy(value, true);\n }\n each(copy, (key, childValue) => {\n set(copy, key, currentImpl(childValue));\n });\n if (state) {\n state.finalized_ = false;\n }\n return copy;\n }\n var immer = new Immer2();\n var produce = immer.produce;\n\n // ../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/dequal@2.0.3/node_modules/dequal/dist/index.mjs\n var has2 = Object.prototype.hasOwnProperty;\n function find(iter, tar, key) {\n for (key of iter.keys()) {\n if (dequal(key, tar)) return key;\n }\n }\n function dequal(foo, bar) {\n var ctor, len, tmp;\n if (foo === bar) return true;\n if (foo && bar && (ctor = foo.constructor) === bar.constructor) {\n if (ctor === Date) return foo.getTime() === bar.getTime();\n if (ctor === RegExp) return foo.toString() === bar.toString();\n if (ctor === Array) {\n if ((len = foo.length) === bar.length) {\n while (len-- && dequal(foo[len], bar[len])) ;\n }\n return len === -1;\n }\n if (ctor === Set) {\n if (foo.size !== bar.size) {\n return false;\n }\n for (len of foo) {\n tmp = len;\n if (tmp && typeof tmp === \"object\") {\n tmp = find(bar, tmp);\n if (!tmp) return false;\n }\n if (!bar.has(tmp)) return false;\n }\n return true;\n }\n if (ctor === Map) {\n if (foo.size !== bar.size) {\n return false;\n }\n for (len of foo) {\n tmp = len[0];\n if (tmp && typeof tmp === \"object\") {\n tmp = find(bar, tmp);\n if (!tmp) return false;\n }\n if (!dequal(len[1], bar.get(tmp))) {\n return false;\n }\n }\n return true;\n }\n if (ctor === ArrayBuffer) {\n foo = new Uint8Array(foo);\n bar = new Uint8Array(bar);\n } else if (ctor === DataView) {\n if ((len = foo.byteLength) === bar.byteLength) {\n while (len-- && foo.getInt8(len) === bar.getInt8(len)) ;\n }\n return len === -1;\n }\n if (ArrayBuffer.isView(foo)) {\n if ((len = foo.byteLength) === bar.byteLength) {\n while (len-- && foo[len] === bar[len]) ;\n }\n return len === -1;\n }\n if (!ctor || typeof foo === \"object\") {\n len = 0;\n for (ctor in foo) {\n if (has2.call(foo, ctor) && ++len && !has2.call(bar, ctor)) return false;\n if (!(ctor in bar) || !dequal(foo[ctor], bar[ctor])) return false;\n }\n return Object.keys(bar).length === len;\n }\n }\n return foo !== foo && bar !== bar;\n }\n\n // ../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/@player-devtools+plugin@0.0.0/node_modules/@player-devtools/plugin/dist/index.mjs\n var useStateReducer = (reducer2, initialState) => {\n let state = initialState;\n const subscribers = /* @__PURE__ */ new Set();\n return {\n getState: () => state,\n /** Subscribe to state changes; returns an unsubscribe function. */\n subscribe(subscriber) {\n subscribers.add(subscriber);\n subscriber(state);\n return () => subscribers.delete(subscriber);\n },\n /** Dispatch an action through the reducer, then run side-effects. */\n dispatch(action) {\n const prevState = state;\n const nextState = reducer2(prevState, action);\n if (nextState !== prevState) {\n state = nextState;\n for (const sub of subscribers) sub(state);\n }\n }\n };\n };\n var containsInteraction = (interactions, interaction) => {\n return interactions.filter((i) => dequal(i, interaction)).length > 0;\n };\n var reducer = (state, transaction) => {\n switch (transaction.type) {\n case \"PLAYER_DEVTOOLS_PLAYER_INIT\":\n return produce(state, (draft) => {\n const { payload } = transaction;\n dsetAssign(draft, [\"plugins\"], payload.plugins);\n const message = {\n type: \"PLAYER_DEVTOOLS_PLAYER_INIT\",\n payload\n };\n draft.messages.push(message);\n });\n case \"PLAYER_DEVTOOLS_PLUGIN_DATA_CHANGE\":\n return produce(state, (draft) => {\n const { payload } = transaction;\n if (!payload.data) return state;\n try {\n dsetAssign(\n draft,\n [\"plugins\", transaction.payload.pluginID, \"flow\", \"data\"],\n transaction.payload.data\n );\n } catch {\n console.error(\"error setting data:\", transaction.payload.data);\n }\n const message = {\n type: \"PLAYER_DEVTOOLS_PLUGIN_DATA_CHANGE\",\n payload\n };\n draft.messages.push(message);\n });\n case \"PLAYER_DEVTOOLS_PLUGIN_INTERACTION\":\n return produce(state, (draft) => {\n if (containsInteraction(draft.interactions, transaction)) return state;\n dsetAssign(\n draft,\n [\"interactions\"],\n [...draft.interactions, transaction]\n );\n });\n case \"PLAYER_DEVTOOLS_SELECTED_PLAYER_CHANGE\": {\n const { playerID } = transaction.payload;\n if (!playerID) return state;\n return produce(state, (draft) => {\n dsetAssign(draft, [\"currentPlayer\"], playerID);\n });\n }\n default:\n return state;\n }\n };\n var INTERACTIONS2 = {\n PLAYER_SELECTED: \"player-selected\"\n };\n var PLUGIN_INACTIVE_WARNING = \"The plugin has been registered, but the Player development tools are not active. If you are working in a production environment, it is recommended to remove the plugin. To activate, enable through the browser extension popup for web or configure the FlipperClient for mobile.\";\n function generateUUID() {\n let d = (/* @__PURE__ */ new Date()).getTime();\n let d2 = typeof performance !== \"undefined\" && performance.now && performance.now() * 1e3 || 0;\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function(c) {\n let r = Math.random() * 16;\n if (d > 0) {\n r = (d + r) % 16 | 0;\n d = Math.floor(d / 16);\n } else {\n r = (d2 + r) % 16 | 0;\n d2 = Math.floor(d2 / 16);\n }\n return (c === \"x\" ? r : r & 3 | 8).toString(16);\n });\n }\n var NOOP_ID = -1;\n var genDataChangeTransaction = ({\n playerID,\n data,\n pluginID\n }) => {\n return {\n id: NOOP_ID,\n type: \"PLAYER_DEVTOOLS_PLUGIN_DATA_CHANGE\",\n payload: {\n pluginID,\n data\n },\n sender: playerID,\n context: \"player\",\n target: \"player\",\n timestamp: Date.now(),\n _messenger_: true\n };\n };\n var INITIAL_STATE = {\n messages: [],\n plugins: {},\n interactions: [],\n currentPlayer: \"\"\n };\n var DevtoolsPlugin = class {\n constructor(options) {\n this.options = options;\n this.name = \"DevtoolsPlugin\";\n this.loggedWarning = false;\n this.store = useStateReducer(reducer, INITIAL_STATE);\n this.lastProcessedInteraction = 0;\n this.store.subscribe(({ interactions }) => {\n if (this.lastProcessedInteraction < (interactions.length ?? 0)) {\n interactions.slice(this.lastProcessedInteraction).forEach(this.processInteraction.bind(this));\n }\n });\n }\n get pluginID() {\n return this.options.pluginData.id;\n }\n get playerID() {\n return this.options.playerID;\n }\n registerMessenger(messenger) {\n let lastMessageIndex = -1;\n return this.store.subscribe(({ messages }) => {\n const start = lastMessageIndex + 1;\n if (messages.length > start) {\n const newlyAdded = messages.slice(start);\n lastMessageIndex = messages.length - 1;\n for (const msg of newlyAdded) {\n messenger.sendMessage(msg);\n }\n }\n });\n }\n dispatchPlayerInit() {\n const transaction = {\n id: -1,\n type: \"PLAYER_DEVTOOLS_PLAYER_INIT\",\n payload: {\n plugins: {\n [this.pluginID]: this.options.pluginData\n }\n },\n sender: this.options.playerID,\n context: \"player\",\n target: \"player\",\n timestamp: Date.now(),\n _messenger_: true\n };\n this.store.dispatch(transaction);\n }\n // By default, we'll only write to the keys defined in data -- if undefined, data will be cleared\n dispatchDataUpdate(data) {\n const state = this.store.getState();\n const { plugins: plugins2 } = produce(this.store.getState(), (draft) => {\n if (!data)\n dsetAssign(draft, [\"plugins\", this.pluginID, \"flow\", \"data\"], data);\n else\n Object.entries(data).forEach(([key, value]) => {\n dsetAssign(\n draft,\n [\"plugins\", this.pluginID, \"flow\", \"data\", key],\n value\n );\n });\n });\n const newData = plugins2[this.pluginID].flow.data;\n if (dequal(state.plugins[this.pluginID]?.flow?.data, newData)) return;\n const transaction = genDataChangeTransaction({\n playerID: this.playerID,\n pluginID: this.pluginID,\n data: newData\n });\n this.store.dispatch(transaction);\n }\n checkIfDevtoolsIsActive() {\n const isActive = this.options.handler.checkIfDevtoolsIsActive();\n if (!isActive && !this.loggedWarning) {\n this.options.handler.log?.(PLUGIN_INACTIVE_WARNING);\n this.loggedWarning = true;\n }\n return isActive;\n }\n processInteraction(interaction) {\n this.options.handler.processInteraction(interaction);\n const {\n payload: { type, payload }\n } = interaction;\n if (type === INTERACTIONS2.PLAYER_SELECTED && payload) {\n this.store.dispatch({\n id: -1,\n type: \"PLAYER_DEVTOOLS_SELECTED_PLAYER_CHANGE\",\n payload: { playerID: payload },\n sender: this.playerID,\n context: \"player\",\n target: this.playerID,\n timestamp: Date.now(),\n _messenger_: true\n });\n }\n this.lastProcessedInteraction += 1;\n }\n apply(player) {\n if (!this.checkIfDevtoolsIsActive()) return;\n this.dispatchPlayerInit();\n }\n };\n\n // ../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/plugins/basic/core/src/plugin.ts\n var BasicDevtoolsPlugin = class extends DevtoolsPlugin {\n constructor(options) {\n super({\n ...options,\n pluginData: BasicPluginData\n });\n this.name = \"BasicDevtoolsPlugin\";\n this.data = {};\n this.playerConfig = {};\n this.logs = [];\n }\n apply(player) {\n this.logger = new WeakRef(player.logger);\n if (!this.checkIfDevtoolsIsActive()) return;\n this.options.pluginData.flow.data.playerConfig = {\n version: player.getVersion(),\n plugins: player.getPlugins().map((plugin) => plugin.name)\n };\n super.apply(player);\n this.playerConfig = {\n version: player.getVersion(),\n plugins: player.getPlugins().map((plugin) => plugin.name)\n };\n this.dispatchDataUpdate({ playerConfig: this.playerConfig });\n player.hooks.dataController.tap(this.name, (dataController) => {\n dataController.hooks.onUpdate.tap(this.name, (updates) => {\n this.data = produce(this.data, (draft) => {\n updates.forEach(({ binding, newValue }) => {\n dsetAssign(draft, [\"data\", ...binding.asArray()], newValue);\n });\n });\n this.dispatchDataUpdate({ data: this.data });\n });\n });\n player.logger.hooks.log.tap(this.name, (severity, message) => {\n this.logs = [...this.logs, { severity, message }];\n this.dispatchDataUpdate({ logs: this.logs });\n });\n player.hooks.onStart.tap(this.name, (f) => {\n this.flow = JSON.parse(JSON.stringify(f));\n this.dispatchDataUpdate({ flow: this.flow });\n });\n player.hooks.view.tap(this.name, (view) => {\n this.view = new WeakRef(view);\n });\n player.hooks.expressionEvaluator.tap(this.name, (evaluator) => {\n this.expressionEvaluator = new WeakRef(evaluator);\n });\n this.overrideFlow = player.start.bind(player);\n }\n evaluateExpression(expression) {\n const evaluator = this.expressionEvaluator?.deref();\n if (!evaluator) {\n return {\n id: generateUUID(),\n severity: \"error\",\n result: \"Expression evaluator not available\",\n expression\n };\n }\n try {\n evaluator.hooks.onError.intercept({\n call: (error) => {\n throw error;\n }\n });\n const evaluatorResult = evaluator.evaluate(expression);\n return {\n id: generateUUID(),\n result: evaluatorResult,\n expression\n };\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error ?? \"Something went wrong\");\n return {\n id: generateUUID(),\n severity: \"error\",\n result: message,\n expression\n };\n }\n }\n processInteraction(interaction) {\n super.processInteraction(interaction);\n const {\n payload: { type, payload }\n } = interaction;\n if (type === INTERACTIONS.EVALUATE_EXPRESSION && this.expressionEvaluator && payload) {\n const result = this.evaluateExpression(payload);\n const current2 = this.store.getState()?.plugins?.[this.pluginID]?.flow?.data?.history || [];\n this.dispatchDataUpdate({ history: [...current2, result] });\n return;\n }\n if (type === INTERACTIONS.OVERRIDE_FLOW && payload && this.overrideFlow) {\n let newFlow;\n try {\n newFlow = JSON.parse(payload);\n } catch (e) {\n this.logger?.deref()?.error(this.name, \"Error parsing new flow\", e);\n }\n if (newFlow) {\n this.overrideFlow(newFlow);\n }\n return;\n }\n }\n };\n return __toCommonJS(src_exports);\n})();\n","/**\n * Recursively assigns the contents of `source` into `target`, preserving\n * existing object and array references to maintain key insertion order.\n *\n * - **Objects**: keys present in `target` but absent in `source` are deleted\n * (unless `merge` is true), then each source entry is recursed into.\n * - **Arrays**: target is truncated or extended to match source length\n * (unless `merge` is true), then each element is recursed into.\n * - **Primitives / type mismatch**: source is returned directly; the caller\n * is responsible for assigning the return value.\n *\n * @param target - The existing value to assign into.\n * @param source - The new value to assign from.\n * @param merge - When true, stale keys and excess array elements are preserved\n * rather than deleted. Defaults to false.\n * @returns The mutated `target`, or `source` if types are incompatible.\n */\nfunction deepAssign<T, V>(target: T, source: V, merge: boolean = false) {\n if (Array.isArray(target) && Array.isArray(source)) {\n while (!merge && target.length > source.length) target.pop();\n // recurse and assign new values\n for (const [index, item] of source.entries()) {\n target[index] = deepAssign(target[index], item, merge);\n }\n } else if (\n target &&\n typeof target === \"object\" &&\n source &&\n typeof source === \"object\"\n ) {\n const record = target as Record<string, unknown>;\n\n // clear stale keys\n if (!merge)\n for (const key of Object.keys(target)) {\n if (!(key in source)) delete record[key];\n }\n // recurse and assign new values\n for (const [key, item] of Object.entries(source)) {\n record[key] = deepAssign(record[key], item, merge);\n }\n } else {\n // new data doesn't match the types, so there is no referential equality to retain\n return source;\n }\n\n return target;\n}\n\ntype Index = string | number;\n\n/**\n * Deep-sets a value at a key path on an object, preserving existing nested\n * object and array references to maintain key insertion order.\n *\n * Intermediate objects are auto-vivified as needed. The final assignment is\n * handled by {@link deepAssign}, which mutates the existing value in place\n * rather than replacing it wholesale.\n *\n * @param obj - The root object to assign into.\n * @param keys - Path of keys leading to the target location.\n * @param value - The value to assign at the path.\n * @param merge - When true, stale keys and excess array elements are preserved\n * rather than deleted. Defaults to false.\n * @throws If `keys` is empty or contains an undefined key.\n *\n * @see {@link https://github.com/lukeed/dset} for the original dset implementation that inspired this API\n */\nexport function dsetAssign<V>(\n obj: Record<Index, unknown>,\n keys: Array<Index>,\n value: V,\n merge: boolean = false,\n): void {\n const key = keys[keys.length - 1];\n if (!key) throw Error(\"Unable to assign at path containing undefined keys\");\n\n // Walk the path, auto-vivifying intermediate objects when necessary\n const target = keys\n .slice(0, -1)\n .reduce(\n (acc, key) => (acc[key] ??= {}) as Record<string | number, unknown>,\n obj,\n );\n\n // Deep assign the value into the target object for key\n target[key] = deepAssign(target[key], value, merge);\n}\n","export const errors =\n\tprocess.env.NODE_ENV !== \"production\"\n\t\t? [\n\t\t\t\t// All error codes, starting by 0:\n\t\t\t\tfunction(plugin: string) {\n\t\t\t\t\treturn `The plugin for '${plugin}' has not been loaded into Immer. To enable the plugin, import and call \\`enable${plugin}()\\` when initializing your application.`\n\t\t\t\t},\n\t\t\t\tfunction(thing: string) {\n\t\t\t\t\treturn `produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${thing}'`\n\t\t\t\t},\n\t\t\t\t\"This object has been frozen and should not be mutated\",\n\t\t\t\tfunction(data: any) {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t\"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? \" +\n\t\t\t\t\t\tdata\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t\t\"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.\",\n\t\t\t\t\"Immer forbids circular references\",\n\t\t\t\t\"The first or second argument to `produce` must be a function\",\n\t\t\t\t\"The third argument to `produce` must be a function or undefined\",\n\t\t\t\t\"First argument to `createDraft` must be a plain object, an array, or an immerable object\",\n\t\t\t\t\"First argument to `finishDraft` must be a draft returned by `createDraft`\",\n\t\t\t\tfunction(thing: string) {\n\t\t\t\t\treturn `'current' expects a draft, got: ${thing}`\n\t\t\t\t},\n\t\t\t\t\"Object.defineProperty() cannot be used on an Immer draft\",\n\t\t\t\t\"Object.setPrototypeOf() cannot be used on an Immer draft\",\n\t\t\t\t\"Immer only supports deleting array indices\",\n\t\t\t\t\"Immer only supports setting array indices and the 'length' property\",\n\t\t\t\tfunction(thing: string) {\n\t\t\t\t\treturn `'original' expects a draft, got: ${thing}`\n\t\t\t\t}\n\t\t\t\t// Note: if more errors are added, the errorOffset in Patches.ts should be increased\n\t\t\t\t// See Patches.ts for additional errors\n\t\t ]\n\t\t: []\n\nexport function die(error: number, ...args: any[]): never {\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\tconst e = errors[error]\n\t\tconst msg = typeof e === \"function\" ? e.apply(null, args as any) : e\n\t\tthrow new Error(`[Immer] ${msg}`)\n\t}\n\tthrow new Error(\n\t\t`[Immer] minified error nr: ${error}. Full error at: https://bit.ly/3cXEKWf`\n\t)\n}\n","import {\n\tDRAFT_STATE,\n\tDRAFTABLE,\n\tObjectish,\n\tDrafted,\n\tAnyObject,\n\tAnyMap,\n\tAnySet,\n\tImmerState,\n\tArchType,\n\tdie,\n\tStrictMode\n} from \"../internal\"\n\nexport const getPrototypeOf = Object.getPrototypeOf\n\n/** Returns true if the given value is an Immer draft */\n/*#__PURE__*/\nexport function isDraft(value: any): boolean {\n\treturn !!value && !!value[DRAFT_STATE]\n}\n\n/** Returns true if the given value can be drafted by Immer */\n/*#__PURE__*/\nexport function isDraftable(value: any): boolean {\n\tif (!value) return false\n\treturn (\n\t\tisPlainObject(value) ||\n\t\tArray.isArray(value) ||\n\t\t!!value[DRAFTABLE] ||\n\t\t!!value.constructor?.[DRAFTABLE] ||\n\t\tisMap(value) ||\n\t\tisSet(value)\n\t)\n}\n\nconst objectCtorString = Object.prototype.constructor.toString()\n/*#__PURE__*/\nexport function isPlainObject(value: any): boolean {\n\tif (!value || typeof value !== \"object\") return false\n\tconst proto = getPrototypeOf(value)\n\tif (proto === null) {\n\t\treturn true\n\t}\n\tconst Ctor =\n\t\tObject.hasOwnProperty.call(proto, \"constructor\") && proto.constructor\n\n\tif (Ctor === Object) return true\n\n\treturn (\n\t\ttypeof Ctor == \"function\" &&\n\t\tFunction.toString.call(Ctor) === objectCtorString\n\t)\n}\n\n/** Get the underlying object that is represented by the given draft */\n/*#__PURE__*/\nexport function original<T>(value: T): T | undefined\nexport function original(value: Drafted<any>): any {\n\tif (!isDraft(value)) die(15, value)\n\treturn value[DRAFT_STATE].base_\n}\n\n/**\n * Each iterates a map, set or array.\n * Or, if any other kind of object, all of its own properties.\n * Regardless whether they are enumerable or symbols\n */\nexport function each<T extends Objectish>(\n\tobj: T,\n\titer: (key: string | number, value: any, source: T) => void\n): void\nexport function each(obj: any, iter: any) {\n\tif (getArchtype(obj) === ArchType.Object) {\n\t\tReflect.ownKeys(obj).forEach(key => {\n\t\t\titer(key, obj[key], obj)\n\t\t})\n\t} else {\n\t\tobj.forEach((entry: any, index: any) => iter(index, entry, obj))\n\t}\n}\n\n/*#__PURE__*/\nexport function getArchtype(thing: any): ArchType {\n\tconst state: undefined | ImmerState = thing[DRAFT_STATE]\n\treturn state\n\t\t? state.type_\n\t\t: Array.isArray(thing)\n\t\t? ArchType.Array\n\t\t: isMap(thing)\n\t\t? ArchType.Map\n\t\t: isSet(thing)\n\t\t? ArchType.Set\n\t\t: ArchType.Object\n}\n\n/*#__PURE__*/\nexport function has(thing: any, prop: PropertyKey): boolean {\n\treturn getArchtype(thing) === ArchType.Map\n\t\t? thing.has(prop)\n\t\t: Object.prototype.hasOwnProperty.call(thing, prop)\n}\n\n/*#__PURE__*/\nexport function get(thing: AnyMap | AnyObject, prop: PropertyKey): any {\n\t// @ts-ignore\n\treturn getArchtype(thing) === ArchType.Map ? thing.get(prop) : thing[prop]\n}\n\n/*#__PURE__*/\nexport function set(thing: any, propOrOldValue: PropertyKey, value: any) {\n\tconst t = getArchtype(thing)\n\tif (t === ArchType.Map) thing.set(propOrOldValue, value)\n\telse if (t === ArchType.Set) {\n\t\tthing.add(value)\n\t} else thing[propOrOldValue] = value\n}\n\n/*#__PURE__*/\nexport function is(x: any, y: any): boolean {\n\t// From: https://github.com/facebook/fbjs/blob/c69904a511b900266935168223063dd8772dfc40/packages/fbjs/src/core/shallowEqual.js\n\tif (x === y) {\n\t\treturn x !== 0 || 1 / x === 1 / y\n\t} else {\n\t\treturn x !== x && y !== y\n\t}\n}\n\n/*#__PURE__*/\nexport function isMap(target: any): target is AnyMap {\n\treturn target instanceof Map\n}\n\n/*#__PURE__*/\nexport function isSet(target: any): target is AnySet {\n\treturn target instanceof Set\n}\n/*#__PURE__*/\nexport function latest(state: ImmerState): any {\n\treturn state.copy_ || state.base_\n}\n\n/*#__PURE__*/\nexport function shallowCopy(base: any, strict: StrictMode) {\n\tif (isMap(base)) {\n\t\treturn new Map(base)\n\t}\n\tif (isSet(base)) {\n\t\treturn new Set(base)\n\t}\n\tif (Array.isArray(base)) return Array.prototype.slice.call(base)\n\n\tconst isPlain = isPlainObject(base)\n\n\tif (strict === true || (strict === \"class_only\" && !isPlain)) {\n\t\t// Perform a strict copy\n\t\tconst descriptors = Object.getOwnPropertyDescriptors(base)\n\t\tdelete descriptors[DRAFT_STATE as any]\n\t\tlet keys = Reflect.ownKeys(descriptors)\n\t\tfor (let i = 0; i < keys.length; i++) {\n\t\t\tconst key: any = keys[i]\n\t\t\tconst desc = descriptors[key]\n\t\t\tif (desc.writable === false) {\n\t\t\t\tdesc.writable = true\n\t\t\t\tdesc.configurable = true\n\t\t\t}\n\t\t\t// like object.assign, we will read any _own_, get/set accessors. This helps in dealing\n\t\t\t// with libraries that trap values, like mobx or vue\n\t\t\t// unlike object.assign, non-enumerables will be copied as well\n\t\t\tif (desc.get || desc.set)\n\t\t\t\tdescriptors[key] = {\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t\twritable: true, // could live with !!desc.set as well here...\n\t\t\t\t\tenumerable: desc.enumerable,\n\t\t\t\t\tvalue: base[key]\n\t\t\t\t}\n\t\t}\n\t\treturn Object.create(getPrototypeOf(base), descriptors)\n\t} else {\n\t\t// perform a sloppy copy\n\t\tconst proto = getPrototypeOf(base)\n\t\tif (proto !== null && isPlain) {\n\t\t\treturn {...base} // assumption: better inner class optimization than the assign below\n\t\t}\n\t\tconst obj = Object.create(proto)\n\t\treturn Object.assign(obj, base)\n\t}\n}\n\n/**\n * Freezes draftable objects. Returns the original object.\n * By default freezes shallowly, but if the second argument is `true` it will freeze recursively.\n *\n * @param obj\n * @param deep\n */\nexport function freeze<T>(obj: T, deep?: boolean): T\nexport function freeze<T>(obj: any, deep: boolean = false): T {\n\tif (isFrozen(obj) || isDraft(obj) || !isDraftable(obj)) return obj\n\tif (getArchtype(obj) > 1 /* Map or Set */) {\n\t\t Object.defineProperties(obj, {\n set: {value: dontMutateFrozenCollections as any},\n add: {value: dontMutateFrozenCollections as any},\n clear: {value: dontMutateFrozenCollections as any},\n delete: {value: dontMutateFrozenCollections as any}\n })\n\t}\n\tObject.freeze(obj)\n\tif (deep)\n\t\t// See #590, don't recurse into non-enumerable / Symbol properties when freezing\n\t\t// So use Object.values (only string-like, enumerables) instead of each()\n\t\tObject.values(obj).forEach(value => freeze(value, true))\n\treturn obj\n}\n\nfunction dontMutateFrozenCollections() {\n\tdie(2)\n}\n\nexport function isFrozen(obj: any): boolean {\n\treturn Object.isFrozen(obj)\n}\n","import {\n\tImmerState,\n\tPatch,\n\tDrafted,\n\tImmerBaseState,\n\tAnyMap,\n\tAnySet,\n\tArchType,\n\tdie\n} from \"../internal\"\n\n/** Plugin utilities */\nconst plugins: {\n\tPatches?: {\n\t\tgeneratePatches_(\n\t\t\tstate: ImmerState,\n\t\t\tbasePath: PatchPath,\n\t\t\tpatches: Patch[],\n\t\t\tinversePatches: Patch[]\n\t\t): void\n\t\tgenerateReplacementPatches_(\n\t\t\tbase: any,\n\t\t\treplacement: any,\n\t\t\tpatches: Patch[],\n\t\t\tinversePatches: Patch[]\n\t\t): void\n\t\tapplyPatches_<T>(draft: T, patches: readonly Patch[]): T\n\t}\n\tMapSet?: {\n\t\tproxyMap_<T extends AnyMap>(target: T, parent?: ImmerState): T\n\t\tproxySet_<T extends AnySet>(target: T, parent?: ImmerState): T\n\t}\n} = {}\n\ntype Plugins = typeof plugins\n\nexport function getPlugin<K extends keyof Plugins>(\n\tpluginKey: K\n): Exclude<Plugins[K], undefined> {\n\tconst plugin = plugins[pluginKey]\n\tif (!plugin) {\n\t\tdie(0, pluginKey)\n\t}\n\t// @ts-ignore\n\treturn plugin\n}\n\nexport function loadPlugin<K extends keyof Plugins>(\n\tpluginKey: K,\n\timplementation: Plugins[K]\n): void {\n\tif (!plugins[pluginKey]) plugins[pluginKey] = implementation\n}\n/** Map / Set plugin */\n\nexport interface MapState extends ImmerBaseState {\n\ttype_: ArchType.Map\n\tcopy_: AnyMap | undefined\n\tassigned_: Map<any, boolean> | undefined\n\tbase_: AnyMap\n\trevoked_: boolean\n\tdraft_: Drafted<AnyMap, MapState>\n}\n\nexport interface SetState extends ImmerBaseState {\n\ttype_: ArchType.Set\n\tcopy_: AnySet | undefined\n\tbase_: AnySet\n\tdrafts_: Map<any, Drafted> // maps the original value to the draft value in the new set\n\trevoked_: boolean\n\tdraft_: Drafted<AnySet, SetState>\n}\n\n/** Patches plugin */\n\nexport type PatchPath = (string | number)[]\n","import {\n\tPatch,\n\tPatchListener,\n\tDrafted,\n\tImmer,\n\tDRAFT_STATE,\n\tImmerState,\n\tArchType,\n\tgetPlugin\n} from \"../internal\"\n\n/** Each scope represents a `produce` call. */\n\nexport interface ImmerScope {\n\tpatches_?: Patch[]\n\tinversePatches_?: Patch[]\n\tcanAutoFreeze_: boolean\n\tdrafts_: any[]\n\tparent_?: ImmerScope\n\tpatchListener_?: PatchListener\n\timmer_: Immer\n\tunfinalizedDrafts_: number\n}\n\nlet currentScope: ImmerScope | undefined\n\nexport function getCurrentScope() {\n\treturn currentScope!\n}\n\nfunction createScope(\n\tparent_: ImmerScope | undefined,\n\timmer_: Immer\n): ImmerScope {\n\treturn {\n\t\tdrafts_: [],\n\t\tparent_,\n\t\timmer_,\n\t\t// Whenever the modified draft contains a draft from another scope, we\n\t\t// need to prevent auto-freezing so the unowned draft can be finalized.\n\t\tcanAutoFreeze_: true,\n\t\tunfinalizedDrafts_: 0\n\t}\n}\n\nexport function usePatchesInScope(\n\tscope: ImmerScope,\n\tpatchListener?: PatchListener\n) {\n\tif (patchListener) {\n\t\tgetPlugin(\"Patches\") // assert we have the plugin\n\t\tscope.patches_ = []\n\t\tscope.inversePatches_ = []\n\t\tscope.patchListener_ = patchListener\n\t}\n}\n\nexport function revokeScope(scope: ImmerScope) {\n\tleaveScope(scope)\n\tscope.drafts_.forEach(revokeDraft)\n\t// @ts-ignore\n\tscope.drafts_ = null\n}\n\nexport function leaveScope(scope: ImmerScope) {\n\tif (scope === currentScope) {\n\t\tcurrentScope = scope.parent_\n\t}\n}\n\nexport function enterScope(immer: Immer) {\n\treturn (currentScope = createScope(currentScope, immer))\n}\n\nfunction revokeDraft(draft: Drafted) {\n\tconst state: ImmerState = draft[DRAFT_STATE]\n\tif (state.type_ === ArchType.Object || state.type_ === ArchType.Array)\n\t\tstate.revoke_()\n\telse state.revoked_ = true\n}\n","import {\n\tImmerScope,\n\tDRAFT_STATE,\n\tisDraftable,\n\tNOTHING,\n\tPatchPath,\n\teach,\n\thas,\n\tfreeze,\n\tImmerState,\n\tisDraft,\n\tSetState,\n\tset,\n\tArchType,\n\tgetPlugin,\n\tdie,\n\trevokeScope,\n\tisFrozen,\n\tisMap\n} from \"../internal\"\n\nexport function processResult(result: any, scope: ImmerScope) {\n\tscope.unfinalizedDrafts_ = scope.drafts_.length\n\tconst baseDraft = scope.drafts_![0]\n\tconst isReplaced = result !== undefined && result !== baseDraft\n\tif (isReplaced) {\n\t\tif (baseDraft[DRAFT_STATE].modified_) {\n\t\t\trevokeScope(scope)\n\t\t\tdie(4)\n\t\t}\n\t\tif (isDraftable(result)) {\n\t\t\t// Finalize the result in case it contains (or is) a subset of the draft.\n\t\t\tresult = finalize(scope, result)\n\t\t\tif (!scope.parent_) maybeFreeze(scope, result)\n\t\t}\n\t\tif (scope.patches_) {\n\t\t\tgetPlugin(\"Patches\").generateReplacementPatches_(\n\t\t\t\tbaseDraft[DRAFT_STATE].base_,\n\t\t\t\tresult,\n\t\t\t\tscope.patches_,\n\t\t\t\tscope.inversePatches_!\n\t\t\t)\n\t\t}\n\t} else {\n\t\t// Finalize the base draft.\n\t\tresult = finalize(scope, baseDraft, [])\n\t}\n\trevokeScope(scope)\n\tif (scope.patches_) {\n\t\tscope.patchListener_!(scope.patches_, scope.inversePatches_!)\n\t}\n\treturn result !== NOTHING ? result : undefined\n}\n\nfunction finalize(rootScope: ImmerScope, value: any, path?: PatchPath) {\n\t// Don't recurse in tho recursive data structures\n\tif (isFrozen(value)) return value\n\n\tconst state: ImmerState = value[DRAFT_STATE]\n\t// A plain object, might need freezing, might contain drafts\n\tif (!state) {\n\t\teach(value, (key, childValue) =>\n\t\t\tfinalizeProperty(rootScope, state, value, key, childValue, path)\n\t\t)\n\t\treturn value\n\t}\n\t// Never finalize drafts owned by another scope.\n\tif (state.scope_ !== rootScope) return value\n\t// Unmodified draft, return the (frozen) original\n\tif (!state.modified_) {\n\t\tmaybeFreeze(rootScope, state.base_, true)\n\t\treturn state.base_\n\t}\n\t// Not finalized yet, let's do that now\n\tif (!state.finalized_) {\n\t\tstate.finalized_ = true\n\t\tstate.scope_.unfinalizedDrafts_--\n\t\tconst result = state.copy_\n\t\t// Finalize all children of the copy\n\t\t// For sets we clone before iterating, otherwise we can get in endless loop due to modifying during iteration, see #628\n\t\t// To preserve insertion order in all cases we then clear the set\n\t\t// And we let finalizeProperty know it needs to re-add non-draft children back to the target\n\t\tlet resultEach = result\n\t\tlet isSet = false\n\t\tif (state.type_ === ArchType.Set) {\n\t\t\tresultEach = new Set(result)\n\t\t\tresult.clear()\n\t\t\tisSet = true\n\t\t}\n\t\teach(resultEach, (key, childValue) =>\n\t\t\tfinalizeProperty(rootScope, state, result, key, childValue, path, isSet)\n\t\t)\n\t\t// everything inside is frozen, we can freeze here\n\t\tmaybeFreeze(rootScope, result, false)\n\t\t// first time finalizing, let's create those patches\n\t\tif (path && rootScope.patches_) {\n\t\t\tgetPlugin(\"Patches\").generatePatches_(\n\t\t\t\tstate,\n\t\t\t\tpath,\n\t\t\t\trootScope.patches_,\n\t\t\t\trootScope.inversePatches_!\n\t\t\t)\n\t\t}\n\t}\n\treturn state.copy_\n}\n\nfunction finalizeProperty(\n\trootScope: ImmerScope,\n\tparentState: undefined | ImmerState,\n\ttargetObject: any,\n\tprop: string | number,\n\tchildValue: any,\n\trootPath?: PatchPath,\n\ttargetIsSet?: boolean\n) {\n\tif (process.env.NODE_ENV !== \"production\" && childValue === targetObject)\n\t\tdie(5)\n\tif (isDraft(childValue)) {\n\t\tconst path =\n\t\t\trootPath &&\n\t\t\tparentState &&\n\t\t\tparentState!.type_ !== ArchType.Set && // Set objects are atomic since they have no keys.\n\t\t\t!has((parentState as Exclude<ImmerState, SetState>).assigned_!, prop) // Skip deep patches for assigned keys.\n\t\t\t\t? rootPath!.concat(prop)\n\t\t\t\t: undefined\n\t\t// Drafts owned by `scope` are finalized here.\n\t\tconst res = finalize(rootScope, childValue, path)\n\t\tset(targetObject, prop, res)\n\t\t// Drafts from another scope must prevented to be frozen\n\t\t// if we got a draft back from finalize, we're in a nested produce and shouldn't freeze\n\t\tif (isDraft(res)) {\n\t\t\trootScope.canAutoFreeze_ = false\n\t\t} else return\n\t} else if (targetIsSet) {\n\t\ttargetObject.add(childValue)\n\t}\n\t// Search new objects for unfinalized drafts. Frozen objects should never contain drafts.\n\tif (isDraftable(childValue) && !isFrozen(childValue)) {\n\t\tif (!rootScope.immer_.autoFreeze_ && rootScope.unfinalizedDrafts_ < 1) {\n\t\t\t// optimization: if an object is not a draft, and we don't have to\n\t\t\t// deepfreeze everything, and we are sure that no drafts are left in the remaining object\n\t\t\t// cause we saw and finalized all drafts already; we can stop visiting the rest of the tree.\n\t\t\t// This benefits especially adding large data tree's without further processing.\n\t\t\t// See add-data.js perf test\n\t\t\treturn\n\t\t}\n\t\tfinalize(rootScope, childValue)\n\t\t// Immer deep freezes plain objects, so if there is no parent state, we freeze as well\n\t\t// Per #590, we never freeze symbolic properties. Just to make sure don't accidentally interfere\n\t\t// with other frameworks.\n\t\tif (\n\t\t\t(!parentState || !parentState.scope_.parent_) &&\n\t\t\ttypeof prop !== \"symbol\" &&\n\t\t\t(isMap(targetObject)\n\t\t\t\t? targetObject.has(prop)\n\t\t\t\t: Object.prototype.propertyIsEnumerable.call(targetObject, prop))\n\t\t)\n\t\t\tmaybeFreeze(rootScope, childValue)\n\t}\n}\n\nfunction maybeFreeze(scope: ImmerScope, value: any, deep = false) {\n\t// we never freeze for a non-root scope; as it would prevent pruning for drafts inside wrapping objects\n\tif (!scope.parent_ && scope.immer_.autoFreeze_ && scope.canAutoFreeze_) {\n\t\tfreeze(value, deep)\n\t}\n}\n","import {\n\teach,\n\thas,\n\tis,\n\tisDraftable,\n\tshallowCopy,\n\tlatest,\n\tImmerBaseState,\n\tImmerState,\n\tDrafted,\n\tAnyObject,\n\tAnyArray,\n\tObjectish,\n\tgetCurrentScope,\n\tgetPrototypeOf,\n\tDRAFT_STATE,\n\tdie,\n\tcreateProxy,\n\tArchType,\n\tImmerScope\n} from \"../internal\"\n\ninterface ProxyBaseState extends ImmerBaseState {\n\tassigned_: {\n\t\t[property: string]: boolean\n\t}\n\tparent_?: ImmerState\n\trevoke_(): void\n}\n\nexport interface ProxyObjectState extends ProxyBaseState {\n\ttype_: ArchType.Object\n\tbase_: any\n\tcopy_: any\n\tdraft_: Drafted<AnyObject, ProxyObjectState>\n}\n\nexport interface ProxyArrayState extends ProxyBaseState {\n\ttype_: ArchType.Array\n\tbase_: AnyArray\n\tcopy_: AnyArray | null\n\tdraft_: Drafted<AnyArray, ProxyArrayState>\n}\n\ntype ProxyState = ProxyObjectState | ProxyArrayState\n\n/**\n * Returns a new draft of the `base` object.\n *\n * The second argument is the parent draft-state (used internally).\n */\nexport function createProxyProxy<T extends Objectish>(\n\tbase: T,\n\tparent?: ImmerState\n): Drafted<T, ProxyState> {\n\tconst isArray = Array.isArray(base)\n\tconst state: ProxyState = {\n\t\ttype_: isArray ? ArchType.Array : (ArchType.Object as any),\n\t\t// Track which produce call this is associated with.\n\t\tscope_: parent ? parent.scope_ : getCurrentScope()!,\n\t\t// True for both shallow and deep changes.\n\t\tmodified_: false,\n\t\t// Used during finalization.\n\t\tfinalized_: false,\n\t\t// Track which properties have been assigned (true) or deleted (false).\n\t\tassigned_: {},\n\t\t// The parent draft state.\n\t\tparent_: parent,\n\t\t// The base state.\n\t\tbase_: base,\n\t\t// The base proxy.\n\t\tdraft_: null as any, // set below\n\t\t// The base copy with any updated values.\n\t\tcopy_: null,\n\t\t// Called by the `produce` function.\n\t\trevoke_: null as any,\n\t\tisManual_: false\n\t}\n\n\t// the traps must target something, a bit like the 'real' base.\n\t// but also, we need to be able to determine from the target what the relevant state is\n\t// (to avoid creating traps per instance to capture the state in closure,\n\t// and to avoid creating weird hidden properties as well)\n\t// So the trick is to use 'state' as the actual 'target'! (and make sure we intercept everything)\n\t// Note that in the case of an array, we put the state in an array to have better Reflect defaults ootb\n\tlet target: T = state as any\n\tlet traps: ProxyHandler<object | Array<any>> = objectTraps\n\tif (isArray) {\n\t\ttarget = [state] as any\n\t\ttraps = arrayTraps\n\t}\n\n\tconst {revoke, proxy} = Proxy.revocable(target, traps)\n\tstate.draft_ = proxy as any\n\tstate.revoke_ = revoke\n\treturn proxy as any\n}\n\n/**\n * Object drafts\n */\nexport const objectTraps: ProxyHandler<ProxyState> = {\n\tget(state, prop) {\n\t\tif (prop === DRAFT_STATE) return state\n\n\t\tconst source = latest(state)\n\t\tif (!has(source, prop)) {\n\t\t\t// non-existing or non-own property...\n\t\t\treturn readPropFromProto(state, source, prop)\n\t\t}\n\t\tconst value = source[prop]\n\t\tif (state.finalized_ || !isDraftable(value)) {\n\t\t\treturn value\n\t\t}\n\t\t// Check for existing draft in modified state.\n\t\t// Assigned values are never drafted. This catches any drafts we created, too.\n\t\tif (value === peek(state.base_, prop)) {\n\t\t\tprepareCopy(state)\n\t\t\treturn (state.copy_![prop as any] = createProxy(value, state))\n\t\t}\n\t\treturn value\n\t},\n\thas(state, prop) {\n\t\treturn prop in latest(state)\n\t},\n\townKeys(state) {\n\t\treturn Reflect.ownKeys(latest(state))\n\t},\n\tset(\n\t\tstate: ProxyObjectState,\n\t\tprop: string /* strictly not, but helps TS */,\n\t\tvalue\n\t) {\n\t\tconst desc = getDescriptorFromProto(latest(state), prop)\n\t\tif (desc?.set) {\n\t\t\t// special case: if this write is captured by a setter, we have\n\t\t\t// to trigger it with the correct context\n\t\t\tdesc.set.call(state.draft_, value)\n\t\t\treturn true\n\t\t}\n\t\tif (!state.modified_) {\n\t\t\t// the last check is because we need to be able to distinguish setting a non-existing to undefined (which is a change)\n\t\t\t// from setting an existing property with value undefined to undefined (which is not a change)\n\t\t\tconst current = peek(latest(state), prop)\n\t\t\t// special case, if we assigning the original value to a draft, we can ignore the assignment\n\t\t\tconst currentState: ProxyObjectState = current?.[DRAFT_STATE]\n\t\t\tif (currentState && currentState.base_ === value) {\n\t\t\t\tstate.copy_![prop] = value\n\t\t\t\tstate.assigned_[prop] = false\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tif (is(value, current) && (value !== undefined || has(state.base_, prop)))\n\t\t\t\treturn true\n\t\t\tprepareCopy(state)\n\t\t\tmarkChanged(state)\n\t\t}\n\n\t\tif (\n\t\t\t(state.copy_![prop] === value &&\n\t\t\t\t// special case: handle new props with value 'undefined'\n\t\t\t\t(value !== undefined || prop in state.copy_)) ||\n\t\t\t// special case: NaN\n\t\t\t(Number.isNaN(value) && Number.isNaN(state.copy_![prop]))\n\t\t)\n\t\t\treturn true\n\n\t\t// @ts-ignore\n\t\tstate.copy_![prop] = value\n\t\tstate.assigned_[prop] = true\n\t\treturn true\n\t},\n\tdeleteProperty(state, prop: string) {\n\t\t// The `undefined` check is a fast path for pre-existing keys.\n\t\tif (peek(state.base_, prop) !== undefined || prop in state.base_) {\n\t\t\tstate.assigned_[prop] = false\n\t\t\tprepareCopy(state)\n\t\t\tmarkChanged(state)\n\t\t} else {\n\t\t\t// if an originally not assigned property was deleted\n\t\t\tdelete state.assigned_[prop]\n\t\t}\n\t\tif (state.copy_) {\n\t\t\tdelete state.copy_[prop]\n\t\t}\n\t\treturn true\n\t},\n\t// Note: We never coerce `desc.value` into an Immer draft, because we can't make\n\t// the same guarantee in ES5 mode.\n\tgetOwnPropertyDescriptor(state, prop) {\n\t\tconst owner = latest(state)\n\t\tconst desc = Reflect.getOwnPropertyDescriptor(owner, prop)\n\t\tif (!desc) return desc\n\t\treturn {\n\t\t\twritable: true,\n\t\t\tconfigurable: state.type_ !== ArchType.Array || prop !== \"length\",\n\t\t\tenumerable: desc.enumerable,\n\t\t\tvalue: owner[prop]\n\t\t}\n\t},\n\tdefineProperty() {\n\t\tdie(11)\n\t},\n\tgetPrototypeOf(state) {\n\t\treturn getPrototypeOf(state.base_)\n\t},\n\tsetPrototypeOf() {\n\t\tdie(12)\n\t}\n}\n\n/**\n * Array drafts\n */\n\nconst arrayTraps: ProxyHandler<[ProxyArrayState]> = {}\neach(objectTraps, (key, fn) => {\n\t// @ts-ignore\n\tarrayTraps[key] = function() {\n\t\targuments[0] = arguments[0][0]\n\t\treturn fn.apply(this, arguments)\n\t}\n})\narrayTraps.deleteProperty = function(state, prop) {\n\tif (process.env.NODE_ENV !== \"production\" && isNaN(parseInt(prop as any)))\n\t\tdie(13)\n\t// @ts-ignore\n\treturn arrayTraps.set!.call(this, state, prop, undefined)\n}\narrayTraps.set = function(state, prop, value) {\n\tif (\n\t\tprocess.env.NODE_ENV !== \"production\" &&\n\t\tprop !== \"length\" &&\n\t\tisNaN(parseInt(prop as any))\n\t)\n\t\tdie(14)\n\treturn objectTraps.set!.call(this, state[0], prop, value, state[0])\n}\n\n// Access a property without creating an Immer draft.\nfunction peek(draft: Drafted, prop: PropertyKey) {\n\tconst state = draft[DRAFT_STATE]\n\tconst source = state ? latest(state) : draft\n\treturn source[prop]\n}\n\nfunction readPropFromProto(state: ImmerState, source: any, prop: PropertyKey) {\n\tconst desc = getDescriptorFromProto(source, prop)\n\treturn desc\n\t\t? `value` in desc\n\t\t\t? desc.value\n\t\t\t: // This is a very special case, if the prop is a getter defined by the\n\t\t\t // prototype, we should invoke it with the draft as context!\n\t\t\t desc.get?.call(state.draft_)\n\t\t: undefined\n}\n\nfunction getDescriptorFromProto(\n\tsource: any,\n\tprop: PropertyKey\n): PropertyDescriptor | undefined {\n\t// 'in' checks proto!\n\tif (!(prop in source)) return undefined\n\tlet proto = getPrototypeOf(source)\n\twhile (proto) {\n\t\tconst desc = Object.getOwnPropertyDescriptor(proto, prop)\n\t\tif (desc) return desc\n\t\tproto = getPrototypeOf(proto)\n\t}\n\treturn undefined\n}\n\nexport function markChanged(state: ImmerState) {\n\tif (!state.modified_) {\n\t\tstate.modified_ = true\n\t\tif (state.parent_) {\n\t\t\tmarkChanged(state.parent_)\n\t\t}\n\t}\n}\n\nexport function prepareCopy(state: {\n\tbase_: any\n\tcopy_: any\n\tscope_: ImmerScope\n}) {\n\tif (!state.copy_) {\n\t\tstate.copy_ = shallowCopy(\n\t\t\tstate.base_,\n\t\t\tstate.scope_.immer_.useStrictShallowCopy_\n\t\t)\n\t}\n}\n","import {\n\tIProduceWithPatches,\n\tIProduce,\n\tImmerState,\n\tDrafted,\n\tisDraftable,\n\tprocessResult,\n\tPatch,\n\tObjectish,\n\tDRAFT_STATE,\n\tDraft,\n\tPatchListener,\n\tisDraft,\n\tisMap,\n\tisSet,\n\tcreateProxyProxy,\n\tgetPlugin,\n\tdie,\n\tenterScope,\n\trevokeScope,\n\tleaveScope,\n\tusePatchesInScope,\n\tgetCurrentScope,\n\tNOTHING,\n\tfreeze,\n\tcurrent\n} from \"../internal\"\n\ninterface ProducersFns {\n\tproduce: IProduce\n\tproduceWithPatches: IProduceWithPatches\n}\n\nexport type StrictMode = boolean | \"class_only\";\n\nexport class Immer implements ProducersFns {\n\tautoFreeze_: boolean = true\n\tuseStrictShallowCopy_: StrictMode = false\n\n\tconstructor(config?: {\n\t\tautoFreeze?: boolean\n\t\tuseStrictShallowCopy?: StrictMode\n\t}) {\n\t\tif (typeof config?.autoFreeze === \"boolean\")\n\t\t\tthis.setAutoFreeze(config!.autoFreeze)\n\t\tif (typeof config?.useStrictShallowCopy === \"boolean\")\n\t\t\tthis.setUseStrictShallowCopy(config!.useStrictShallowCopy)\n\t}\n\n\t/**\n\t * The `produce` function takes a value and a \"recipe function\" (whose\n\t * return value often depends on the base state). The recipe function is\n\t * free to mutate its first argument however it wants. All mutations are\n\t * only ever applied to a __copy__ of the base state.\n\t *\n\t * Pass only a function to create a \"curried producer\" which relieves you\n\t * from passing the recipe function every time.\n\t *\n\t * Only plain objects and arrays are made mutable. All other objects are\n\t * considered uncopyable.\n\t *\n\t * Note: This function is __bound__ to its `Immer` instance.\n\t *\n\t * @param {any} base - the initial state\n\t * @param {Function} recipe - function that receives a proxy of the base state as first argument and which can be freely modified\n\t * @param {Function} patchListener - optional function that will be called with all the patches produced here\n\t * @returns {any} a new state, or the initial state if nothing was modified\n\t */\n\tproduce: IProduce = (base: any, recipe?: any, patchListener?: any) => {\n\t\t// curried invocation\n\t\tif (typeof base === \"function\" && typeof recipe !== \"function\") {\n\t\t\tconst defaultBase = recipe\n\t\t\trecipe = base\n\n\t\t\tconst self = this\n\t\t\treturn function curriedProduce(\n\t\t\t\tthis: any,\n\t\t\t\tbase = defaultBase,\n\t\t\t\t...args: any[]\n\t\t\t) {\n\t\t\t\treturn self.produce(base, (draft: Drafted) => recipe.call(this, draft, ...args)) // prettier-ignore\n\t\t\t}\n\t\t}\n\n\t\tif (typeof recipe !== \"function\") die(6)\n\t\tif (patchListener !== undefined && typeof patchListener !== \"function\")\n\t\t\tdie(7)\n\n\t\tlet result\n\n\t\t// Only plain objects, arrays, and \"immerable classes\" are drafted.\n\t\tif (isDraftable(base)) {\n\t\t\tconst scope = enterScope(this)\n\t\t\tconst proxy = createProxy(base, undefined)\n\t\t\tlet hasError = true\n\t\t\ttry {\n\t\t\t\tresult = recipe(proxy)\n\t\t\t\thasError = false\n\t\t\t} finally {\n\t\t\t\t// finally instead of catch + rethrow better preserves original stack\n\t\t\t\tif (hasError) revokeScope(scope)\n\t\t\t\telse leaveScope(scope)\n\t\t\t}\n\t\t\tusePatchesInScope(scope, patchListener)\n\t\t\treturn processResult(result, scope)\n\t\t} else if (!base || typeof base !== \"object\") {\n\t\t\tresult = recipe(base)\n\t\t\tif (result === undefined) result = base\n\t\t\tif (result === NOTHING) result = undefined\n\t\t\tif (this.autoFreeze_) freeze(result, true)\n\t\t\tif (patchListener) {\n\t\t\t\tconst p: Patch[] = []\n\t\t\t\tconst ip: Patch[] = []\n\t\t\t\tgetPlugin(\"Patches\").generateReplacementPatches_(base, result, p, ip)\n\t\t\t\tpatchListener(p, ip)\n\t\t\t}\n\t\t\treturn result\n\t\t} else die(1, base)\n\t}\n\n\tproduceWithPatches: IProduceWithPatches = (base: any, recipe?: any): any => {\n\t\t// curried invocation\n\t\tif (typeof base === \"function\") {\n\t\t\treturn (state: any, ...args: any[]) =>\n\t\t\t\tthis.produceWithPatches(state, (draft: any) => base(draft, ...args))\n\t\t}\n\n\t\tlet patches: Patch[], inversePatches: Patch[]\n\t\tconst result = this.produce(base, recipe, (p: Patch[], ip: Patch[]) => {\n\t\t\tpatches = p\n\t\t\tinversePatches = ip\n\t\t})\n\t\treturn [result, patches!, inversePatches!]\n\t}\n\n\tcreateDraft<T extends Objectish>(base: T): Draft<T> {\n\t\tif (!isDraftable(base)) die(8)\n\t\tif (isDraft(base)) base = current(base)\n\t\tconst scope = enterScope(this)\n\t\tconst proxy = createProxy(base, undefined)\n\t\tproxy[DRAFT_STATE].isManual_ = true\n\t\tleaveScope(scope)\n\t\treturn proxy as any\n\t}\n\n\tfinishDraft<D extends Draft<any>>(\n\t\tdraft: D,\n\t\tpatchListener?: PatchListener\n\t): D extends Draft<infer T> ? T : never {\n\t\tconst state: ImmerState = draft && (draft as any)[DRAFT_STATE]\n\t\tif (!state || !state.isManual_) die(9)\n\t\tconst {scope_: scope} = state\n\t\tusePatchesInScope(scope, patchListener)\n\t\treturn processResult(undefined, scope)\n\t}\n\n\t/**\n\t * Pass true to automatically freeze all copies created by Immer.\n\t *\n\t * By default, auto-freezing is enabled.\n\t */\n\tsetAutoFreeze(value: boolean) {\n\t\tthis.autoFreeze_ = value\n\t}\n\n\t/**\n\t * Pass true to enable strict shallow copy.\n\t *\n\t * By default, immer does not copy the object descriptors such as getter, setter and non-enumrable properties.\n\t */\n\tsetUseStrictShallowCopy(value: StrictMode) {\n\t\tthis.useStrictShallowCopy_ = value\n\t}\n\n\tapplyPatches<T extends Objectish>(base: T, patches: readonly Patch[]): T {\n\t\t// If a patch replaces the entire state, take that replacement as base\n\t\t// before applying patches\n\t\tlet i: number\n\t\tfor (i = patches.length - 1; i >= 0; i--) {\n\t\t\tconst patch = patches[i]\n\t\t\tif (patch.path.length === 0 && patch.op === \"replace\") {\n\t\t\t\tbase = patch.value\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\t// If there was a patch that replaced the entire state, start from the\n\t\t// patch after that.\n\t\tif (i > -1) {\n\t\t\tpatches = patches.slice(i + 1)\n\t\t}\n\n\t\tconst applyPatchesImpl = getPlugin(\"Patches\").applyPatches_\n\t\tif (isDraft(base)) {\n\t\t\t// N.B: never hits if some patch a replacement, patches are never drafts\n\t\t\treturn applyPatchesImpl(base, patches)\n\t\t}\n\t\t// Otherwise, produce a copy of the base state.\n\t\treturn this.produce(base, (draft: Drafted) =>\n\t\t\tapplyPatchesImpl(draft, patches)\n\t\t)\n\t}\n}\n\nexport function createProxy<T extends Objectish>(\n\tvalue: T,\n\tparent?: ImmerState\n): Drafted<T, ImmerState> {\n\t// precondition: createProxy should be guarded by isDraftable, so we know we can safely draft\n\tconst draft: Drafted = isMap(value)\n\t\t? getPlugin(\"MapSet\").proxyMap_(value, parent)\n\t\t: isSet(value)\n\t\t? getPlugin(\"MapSet\").proxySet_(value, parent)\n\t\t: createProxyProxy(value, parent)\n\n\tconst scope = parent ? parent.scope_ : getCurrentScope()\n\tscope.drafts_.push(draft)\n\treturn draft\n}\n","import {\n\tdie,\n\tisDraft,\n\tshallowCopy,\n\teach,\n\tDRAFT_STATE,\n\tset,\n\tImmerState,\n\tisDraftable,\n\tisFrozen\n} from \"../internal\"\n\n/** Takes a snapshot of the current state of a draft and finalizes it (but without freezing). This is a great utility to print the current state during debugging (no Proxies in the way). The output of current can also be safely leaked outside the producer. */\nexport function current<T>(value: T): T\nexport function current(value: any): any {\n\tif (!isDraft(value)) die(10, value)\n\treturn currentImpl(value)\n}\n\nfunction currentImpl(value: any): any {\n\tif (!isDraftable(value) || isFrozen(value)) return value\n\tconst state: ImmerState | undefined = value[DRAFT_STATE]\n\tlet copy: any\n\tif (state) {\n\t\tif (!state.modified_) return state.base_\n\t\t// Optimization: avoid generating new drafts during copying\n\t\tstate.finalized_ = true\n\t\tcopy = shallowCopy(value, state.scope_.immer_.useStrictShallowCopy_)\n\t} else {\n\t\tcopy = shallowCopy(value, true)\n\t}\n\t// recurse\n\teach(copy, (key, childValue) => {\n\t\tset(copy, key, currentImpl(childValue))\n\t})\n\tif (state) {\n\t\tstate.finalized_ = false\n\t}\n\treturn copy\n}\n","var has = Object.prototype.hasOwnProperty;\n\nfunction find(iter, tar, key) {\n\tfor (key of iter.keys()) {\n\t\tif (dequal(key, tar)) return key;\n\t}\n}\n\nexport function dequal(foo, bar) {\n\tvar ctor, len, tmp;\n\tif (foo === bar) return true;\n\n\tif (foo && bar && (ctor=foo.constructor) === bar.constructor) {\n\t\tif (ctor === Date) return foo.getTime() === bar.getTime();\n\t\tif (ctor === RegExp) return foo.toString() === bar.toString();\n\n\t\tif (ctor === Array) {\n\t\t\tif ((len=foo.length) === bar.length) {\n\t\t\t\twhile (len-- && dequal(foo[len], bar[len]));\n\t\t\t}\n\t\t\treturn len === -1;\n\t\t}\n\n\t\tif (ctor === Set) {\n\t\t\tif (foo.size !== bar.size) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tfor (len of foo) {\n\t\t\t\ttmp = len;\n\t\t\t\tif (tmp && typeof tmp === 'object') {\n\t\t\t\t\ttmp = find(bar, tmp);\n\t\t\t\t\tif (!tmp) return false;\n\t\t\t\t}\n\t\t\t\tif (!bar.has(tmp)) return false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tif (ctor === Map) {\n\t\t\tif (foo.size !== bar.size) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tfor (len of foo) {\n\t\t\t\ttmp = len[0];\n\t\t\t\tif (tmp && typeof tmp === 'object') {\n\t\t\t\t\ttmp = find(bar, tmp);\n\t\t\t\t\tif (!tmp) return false;\n\t\t\t\t}\n\t\t\t\tif (!dequal(len[1], bar.get(tmp))) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tif (ctor === ArrayBuffer) {\n\t\t\tfoo = new Uint8Array(foo);\n\t\t\tbar = new Uint8Array(bar);\n\t\t} else if (ctor === DataView) {\n\t\t\tif ((len=foo.byteLength) === bar.byteLength) {\n\t\t\t\twhile (len-- && foo.getInt8(len) === bar.getInt8(len));\n\t\t\t}\n\t\t\treturn len === -1;\n\t\t}\n\n\t\tif (ArrayBuffer.isView(foo)) {\n\t\t\tif ((len=foo.byteLength) === bar.byteLength) {\n\t\t\t\twhile (len-- && foo[len] === bar[len]);\n\t\t\t}\n\t\t\treturn len === -1;\n\t\t}\n\n\t\tif (!ctor || typeof foo === 'object') {\n\t\t\tlen = 0;\n\t\t\tfor (ctor in foo) {\n\t\t\t\tif (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;\n\t\t\t\tif (!(ctor in bar) || !dequal(foo[ctor], bar[ctor])) return false;\n\t\t\t}\n\t\t\treturn Object.keys(bar).length === len;\n\t\t}\n\t}\n\n\treturn foo !== foo && bar !== bar;\n}\n","export function generateUUID(): string {\n // Public Domain/MIT\n let d = new Date().getTime(); //Timestamp\n let d2 =\n (typeof performance !== \"undefined\" &&\n performance.now &&\n performance.now() * 1000) ||\n 0; //Time in microseconds since page-load or 0 if unsupported\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function (c) {\n let r = Math.random() * 16; //random number between 0 and 16\n if (d > 0) {\n //Use timestamp until depleted\n r = (d + r) % 16 | 0;\n d = Math.floor(d / 16);\n } else {\n //Use microseconds since page-load if supported\n r = (d2 + r) % 16 | 0;\n d2 = Math.floor(d2 / 16);\n }\n return (c === \"x\" ? r : (r & 0x3) | 0x8).toString(16);\n });\n}\n","export { BasicDevtoolsPlugin } from \"./plugin\";\n","export const PLUGIN_ID = \"player-ui-basic-devtools-plugin\";\n\nexport const VIEWS_IDS = {\n CONFIG: \"Config\",\n FLOW: \"Flow\",\n LOGS: \"Logs\",\n CONSOLE: \"Console\",\n EDITOR: \"Editor\",\n};\n\nexport const INTERACTIONS = {\n EVALUATE_EXPRESSION: \"evaluate-expression\",\n OVERRIDE_FLOW: \"override-flow\",\n};\n","{\n \"id\": \"player-ui-basic-devtools-plugin\",\n \"views\": [\n {\n \"id\": \"Config\",\n \"type\": \"stacked-view\",\n \"header\": {\n \"asset\": {\n \"id\": \"Config-header\",\n \"type\": \"navigation\",\n \"values\": [\n {\n \"asset\": {\n \"id\": \"Config-header-values-0\",\n \"type\": \"action\",\n \"value\": \"Config\",\n \"label\": {\n \"asset\": {\n \"id\": \"Config-header-values-0-label\",\n \"type\": \"text\",\n \"value\": \"Config\"\n }\n }\n }\n },\n {\n \"asset\": {\n \"id\": \"Config-header-values-1\",\n \"type\": \"action\",\n \"value\": \"Flow\",\n \"label\": {\n \"asset\": {\n \"id\": \"Config-header-values-1-label\",\n \"type\": \"text\",\n \"value\": \"Flow\"\n }\n }\n }\n },\n {\n \"asset\": {\n \"id\": \"Config-header-values-2\",\n \"type\": \"action\",\n \"value\": \"Logs\",\n \"label\": {\n \"asset\": {\n \"id\": \"Config-header-values-2-label\",\n \"type\": \"text\",\n \"value\": \"Logs\"\n }\n }\n }\n },\n {\n \"asset\": {\n \"id\": \"Config-header-values-3\",\n \"type\": \"action\",\n \"value\": \"Console\",\n \"label\": {\n \"asset\": {\n \"id\": \"Config-header-values-3-label\",\n \"type\": \"text\",\n \"value\": \"Console\"\n }\n }\n }\n },\n {\n \"asset\": {\n \"id\": \"Config-header-values-4\",\n \"type\": \"action\",\n \"value\": \"Editor\",\n \"label\": {\n \"asset\": {\n \"id\": \"Config-header-values-4-label\",\n \"type\": \"text\",\n \"value\": \"Editor\"\n }\n }\n }\n }\n ]\n }\n },\n \"main\": {\n \"asset\": {\n \"id\": \"Config-main\",\n \"type\": \"object-inspector\",\n \"binding\": \"playerConfig\",\n \"label\": {\n \"asset\": {\n \"id\": \"Config-main-label\",\n \"type\": \"text\",\n \"value\": \"Config\"\n }\n }\n }\n }\n },\n {\n \"id\": \"Flow\",\n \"type\": \"stacked-view\",\n \"header\": {\n \"asset\": {\n \"id\": \"Flow-header\",\n \"type\": \"navigation\",\n \"values\": [\n {\n \"asset\": {\n \"id\": \"Flow-header-values-0\",\n \"type\": \"action\",\n \"value\": \"Config\",\n \"label\": {\n \"asset\": {\n \"id\": \"Flow-header-values-0-label\",\n \"type\": \"text\",\n \"value\": \"Config\"\n }\n }\n }\n },\n {\n \"asset\": {\n \"id\": \"Flow-header-values-1\",\n \"type\": \"action\",\n \"value\": \"Flow\",\n \"label\": {\n \"asset\": {\n \"id\": \"Flow-header-values-1-label\",\n \"type\": \"text\",\n \"value\": \"Flow\"\n }\n }\n }\n },\n {\n \"asset\": {\n \"id\": \"Flow-header-values-2\",\n \"type\": \"action\",\n \"value\": \"Logs\",\n \"label\": {\n \"asset\": {\n \"id\": \"Flow-header-values-2-label\",\n \"type\": \"text\",\n \"value\": \"Logs\"\n }\n }\n }\n },\n {\n \"asset\": {\n \"id\": \"Flow-header-values-3\",\n \"type\": \"action\",\n \"value\": \"Console\",\n \"label\": {\n \"asset\": {\n \"id\": \"Flow-header-values-3-label\",\n \"type\": \"text\",\n \"value\": \"Console\"\n }\n }\n }\n },\n {\n \"asset\": {\n \"id\": \"Flow-header-values-4\",\n \"type\": \"action\",\n \"value\": \"Editor\",\n \"label\": {\n \"asset\": {\n \"id\": \"Flow-header-values-4-label\",\n \"type\": \"text\",\n \"value\": \"Editor\"\n }\n }\n }\n }\n ]\n }\n },\n \"main\": {\n \"asset\": {\n \"id\": \"Flow-main\",\n \"type\": \"object-inspector\",\n \"filter\": true,\n \"binding\": \"flow\",\n \"label\": {\n \"asset\": {\n \"id\": \"Flow-main-label\",\n \"type\": \"text\",\n \"value\": \"Flow\"\n }\n }\n }\n },\n \"footer\": {\n \"asset\": {\n \"id\": \"Flow-footer\",\n \"type\": \"copy-to-clipboard\",\n \"binding\": \"flow\",\n \"label\": {\n \"asset\": {\n \"id\": \"Flow-footer-label\",\n \"type\": \"text\",\n \"value\": \"Copy flow to the clipboard\"\n }\n }\n }\n }\n },\n {\n \"id\": \"Logs\",\n \"type\": \"stacked-view\",\n \"header\": {\n \"asset\": {\n \"id\": \"Logs-header\",\n \"type\": \"navigation\",\n \"values\": [\n {\n \"asset\": {\n \"id\": \"Logs-header-values-0\",\n \"type\": \"action\",\n \"value\": \"Config\",\n \"label\": {\n \"asset\": {\n \"id\": \"Logs-header-values-0-label\",\n \"type\": \"text\",\n \"value\": \"Config\"\n }\n }\n }\n },\n {\n \"asset\": {\n \"id\": \"Logs-header-values-1\",\n \"type\": \"action\",\n \"value\": \"Flow\",\n \"label\": {\n \"asset\": {\n \"id\": \"Logs-header-values-1-label\",\n \"type\": \"text\",\n \"value\": \"Flow\"\n }\n }\n }\n },\n {\n \"asset\": {\n \"id\": \"Logs-header-values-2\",\n \"type\": \"action\",\n \"value\": \"Logs\",\n \"label\": {\n \"asset\": {\n \"id\": \"Logs-header-values-2-label\",\n \"type\": \"text\",\n \"value\": \"Logs\"\n }\n }\n }\n },\n {\n \"asset\": {\n \"id\": \"Logs-header-values-3\",\n \"type\": \"action\",\n \"value\": \"Console\",\n \"label\": {\n \"asset\": {\n \"id\": \"Logs-header-values-3-label\",\n \"type\": \"text\",\n \"value\": \"Console\"\n }\n }\n }\n },\n {\n \"asset\": {\n \"id\": \"Logs-header-values-4\",\n \"type\": \"action\",\n \"value\": \"Editor\",\n \"label\": {\n \"asset\": {\n \"id\": \"Logs-header-values-4-label\",\n \"type\": \"text\",\n \"value\": \"Editor\"\n }\n }\n }\n }\n ]\n }\n },\n \"main\": {\n \"asset\": {\n \"id\": \"Logs-main\",\n \"type\": \"table\",\n \"binding\": \"logs\"\n }\n }\n },\n {\n \"id\": \"Console\",\n \"type\": \"stacked-view\",\n \"header\": {\n \"asset\": {\n \"id\": \"Console-header\",\n \"type\": \"navigation\",\n \"values\": [\n {\n \"asset\": {\n \"id\": \"Console-header-values-0\",\n \"type\": \"action\",\n \"value\": \"Config\",\n \"label\": {\n \"asset\": {\n \"id\": \"Console-header-values-0-label\",\n \"type\": \"text\",\n \"value\": \"Config\"\n }\n }\n }\n },\n {\n \"asset\": {\n \"id\": \"Console-header-values-1\",\n \"type\": \"action\",\n \"value\": \"Flow\",\n \"label\": {\n \"asset\": {\n \"id\": \"Console-header-values-1-label\",\n \"type\": \"text\",\n \"value\": \"Flow\"\n }\n }\n }\n },\n {\n \"asset\": {\n \"id\": \"Console-header-values-2\",\n \"type\": \"action\",\n \"value\": \"Logs\",\n \"label\": {\n \"asset\": {\n \"id\": \"Console-header-values-2-label\",\n \"type\": \"text\",\n \"value\": \"Logs\"\n }\n }\n }\n },\n {\n \"asset\": {\n \"id\": \"Console-header-values-3\",\n \"type\": \"action\",\n \"value\": \"Console\",\n \"label\": {\n \"asset\": {\n \"id\": \"Console-header-values-3-label\",\n \"type\": \"text\",\n \"value\": \"Console\"\n }\n }\n }\n },\n {\n \"asset\": {\n \"id\": \"Console-header-values-4\",\n \"type\": \"action\",\n \"value\": \"Editor\",\n \"label\": {\n \"asset\": {\n \"id\": \"Console-header-values-4-label\",\n \"type\": \"text\",\n \"value\": \"Editor\"\n }\n }\n }\n }\n ]\n }\n },\n \"main\": {\n \"asset\": {\n \"id\": \"Console-main\",\n \"type\": \"console\",\n \"exp\": \" publish('evaluate-expression', {{expression}}) \",\n \"binding\": \"history\"\n }\n }\n },\n {\n \"id\": \"Editor\",\n \"type\": \"stacked-view\",\n \"header\": {\n \"asset\": {\n \"id\": \"Editor-header\",\n \"type\": \"navigation\",\n \"values\": [\n {\n \"asset\": {\n \"id\": \"Editor-header-values-0\",\n \"type\": \"action\",\n \"value\": \"Config\",\n \"label\": {\n \"asset\": {\n \"id\": \"Editor-header-values-0-label\",\n \"type\": \"text\",\n \"value\": \"Config\"\n }\n }\n }\n },\n {\n \"asset\": {\n \"id\": \"Editor-header-values-1\",\n \"type\": \"action\",\n \"value\": \"Flow\",\n \"label\": {\n \"asset\": {\n \"id\": \"Editor-header-values-1-label\",\n \"type\": \"text\",\n \"value\": \"Flow\"\n }\n }\n }\n },\n {\n \"asset\": {\n \"id\": \"Editor-header-values-2\",\n \"type\": \"action\",\n \"value\": \"Logs\",\n \"label\": {\n \"asset\": {\n \"id\": \"Editor-header-values-2-label\",\n \"type\": \"text\",\n \"value\": \"Logs\"\n }\n }\n }\n },\n {\n \"asset\": {\n \"id\": \"Editor-header-values-3\",\n \"type\": \"action\",\n \"value\": \"Console\",\n \"label\": {\n \"asset\": {\n \"id\": \"Editor-header-values-3-label\",\n \"type\": \"text\",\n \"value\": \"Console\"\n }\n }\n }\n },\n {\n \"asset\": {\n \"id\": \"Editor-header-values-4\",\n \"type\": \"action\",\n \"value\": \"Editor\",\n \"label\": {\n \"asset\": {\n \"id\": \"Editor-header-values-4-label\",\n \"type\": \"text\",\n \"value\": \"Editor\"\n }\n }\n }\n }\n ]\n }\n },\n \"main\": {\n \"asset\": {\n \"id\": \"Editor-main\",\n \"type\": \"code-editor\",\n \"binding\": \"flow\",\n \"exp\": \" publish('override-flow', {{code}}) \"\n }\n }\n }\n ],\n \"navigation\": {\n \"BEGIN\": \"Plugin\",\n \"Plugin\": {\n \"startState\": \"CONFIG\",\n \"CONFIG\": {\n \"state_type\": \"VIEW\",\n \"ref\": \"Config\",\n \"transitions\": {\n \"Config\": \"CONFIG\",\n \"Flow\": \"FLOW\",\n \"Logs\": \"LOGS\",\n \"Console\": \"CONSOLE\",\n \"Editor\": \"EDITOR\"\n }\n },\n \"FLOW\": {\n \"state_type\": \"VIEW\",\n \"ref\": \"Flow\",\n \"transitions\": {\n \"Config\": \"CONFIG\",\n \"Flow\": \"FLOW\",\n \"Logs\": \"LOGS\",\n \"Console\": \"CONSOLE\",\n \"Editor\": \"EDITOR\"\n }\n },\n \"LOGS\": {\n \"state_type\": \"VIEW\",\n \"ref\": \"Logs\",\n \"transitions\": {\n \"Config\": \"CONFIG\",\n \"Flow\": \"FLOW\",\n \"Logs\": \"LOGS\",\n \"Console\": \"CONSOLE\",\n \"Editor\": \"EDITOR\"\n }\n },\n \"CONSOLE\": {\n \"state_type\": \"VIEW\",\n \"ref\": \"Console\",\n \"transitions\": {\n \"Config\": \"CONFIG\",\n \"Flow\": \"FLOW\",\n \"Logs\": \"LOGS\",\n \"Console\": \"CONSOLE\",\n \"Editor\": \"EDITOR\"\n }\n },\n \"EDITOR\": {\n \"state_type\": \"VIEW\",\n \"ref\": \"Editor\",\n \"transitions\": {\n \"Config\": \"CONFIG\",\n \"Flow\": \"FLOW\",\n \"Logs\": \"LOGS\",\n \"Console\": \"CONSOLE\",\n \"Editor\": \"EDITOR\"\n }\n }\n }\n },\n \"schema\": {\n \"ROOT\": {\n \"playerConfig\": {\n \"type\": \"RecordType\"\n },\n \"flow\": {\n \"type\": \"RecordType\"\n },\n \"expression\": {\n \"type\": \"StringType\",\n \"default\": \"\",\n \"validation\": [\n {\n \"type\": \"string\"\n }\n ],\n \"format\": {\n \"type\": \"string\"\n }\n },\n \"code\": {\n \"type\": \"StringType\",\n \"default\": \"\",\n \"validation\": [\n {\n \"type\": \"string\"\n }\n ],\n \"format\": {\n \"type\": \"string\"\n }\n },\n \"history\": {\n \"type\": \"historyType\",\n \"isArray\": true\n },\n \"logs\": {\n \"type\": \"logsType\",\n \"isArray\": true\n }\n },\n \"logsType\": {\n \"id\": {\n \"type\": \"StringType\",\n \"default\": \"\",\n \"validation\": [\n {\n \"type\": \"string\"\n }\n ],\n \"format\": {\n \"type\": \"string\"\n }\n },\n \"time\": {\n \"type\": \"StringType\",\n \"default\": \"\",\n \"validation\": [\n {\n \"type\": \"string\"\n }\n ],\n \"format\": {\n \"type\": \"string\"\n }\n },\n \"type\": {\n \"type\": \"StringType\",\n \"default\": \"\",\n \"validation\": [\n {\n \"type\": \"string\"\n }\n ],\n \"format\": {\n \"type\": \"string\"\n }\n },\n \"message\": {\n \"type\": \"StringType\",\n \"default\": \"\",\n \"validation\": [\n {\n \"type\": \"string\"\n }\n ],\n \"format\": {\n \"type\": \"string\"\n }\n },\n \"severity\": {\n \"type\": \"StringType\",\n \"default\": \"\",\n \"validation\": [\n {\n \"type\": \"string\"\n }\n ],\n \"format\": {\n \"type\": \"string\"\n }\n },\n \"binding\": {\n \"type\": \"StringType\",\n \"default\": \"\",\n \"validation\": [\n {\n \"type\": \"string\"\n }\n ],\n \"format\": {\n \"type\": \"string\"\n }\n },\n \"from\": {\n \"type\": \"StringType\",\n \"default\": \"\",\n \"validation\": [\n {\n \"type\": \"string\"\n }\n ],\n \"format\": {\n \"type\": \"string\"\n }\n },\n \"to\": {\n \"type\": \"StringType\",\n \"default\": \"\",\n \"validation\": [\n {\n \"type\": \"string\"\n }\n ],\n \"format\": {\n \"type\": \"string\"\n }\n },\n \"state\": {\n \"type\": \"StringType\",\n \"default\": \"\",\n \"validation\": [\n {\n \"type\": \"string\"\n }\n ],\n \"format\": {\n \"type\": \"string\"\n }\n },\n \"error\": {\n \"type\": \"StringType\",\n \"default\": \"\",\n \"validation\": [\n {\n \"type\": \"string\"\n }\n ],\n \"format\": {\n \"type\": \"string\"\n }\n },\n \"outcome\": {\n \"type\": \"StringType\",\n \"default\": \"\",\n \"validation\": [\n {\n \"type\": \"string\"\n }\n ],\n \"format\": {\n \"type\": \"string\"\n }\n },\n \"metricType\": {\n \"type\": \"StringType\",\n \"default\": \"\",\n \"validation\": [\n {\n \"type\": \"string\"\n }\n ],\n \"format\": {\n \"type\": \"string\"\n }\n }\n },\n \"historyType\": {\n \"id\": {\n \"type\": \"StringType\",\n \"default\": \"\",\n \"validation\": [\n {\n \"type\": \"string\"\n }\n ],\n \"format\": {\n \"type\": \"string\"\n }\n },\n \"expression\": {\n \"type\": \"StringType\",\n \"default\": \"\",\n \"validation\": [\n {\n \"type\": \"string\"\n }\n ],\n \"format\": {\n \"type\": \"string\"\n }\n },\n \"result\": {\n \"type\": \"StringType\",\n \"default\": \"\",\n \"validation\": [\n {\n \"type\": \"string\"\n }\n ],\n \"format\": {\n \"type\": \"string\"\n }\n },\n \"severity\": {\n \"type\": \"StringType\",\n \"default\": \"\",\n \"validation\": [\n {\n \"type\": \"string\"\n }\n ],\n \"format\": {\n \"type\": \"string\"\n }\n }\n }\n },\n \"data\": {\n \"expression\": \"\",\n \"flow\": {},\n \"history\": [],\n \"logs\": [],\n \"playerConfig\": {}\n }\n}","import type { PluginData } from \"@player-devtools/types\";\nimport { PLUGIN_ID } from \"./constants\";\n\n// Generated via dsl_compile target\nimport flow from \"../_generated/flow.json\";\n\ndeclare global {\n const __VERSION__: string;\n}\n\nconst PLUGIN_VERSION =\n typeof __VERSION__ !== \"undefined\" ? __VERSION__ : \"unstamped\";\n\nexport const BasicPluginData: PluginData = {\n id: PLUGIN_ID,\n name: \"Standard Devtools\",\n description: \"Standard Player UI Devtools\",\n version: PLUGIN_VERSION,\n flow,\n};\n\nexport * from \"./constants\";\n","// Should be no imports here!\n\n/**\n * The sentinel value returned by producers to replace the draft with undefined.\n */\nexport const NOTHING: unique symbol = Symbol.for(\"immer-nothing\")\n\n/**\n * To let Immer treat your class instances as plain immutable objects\n * (albeit with a custom prototype), you must define either an instance property\n * or a static property on each of your custom classes.\n *\n * Otherwise, your class instance will never be drafted, which means it won't be\n * safe to mutate in a produce callback.\n */\nexport const DRAFTABLE: unique symbol = Symbol.for(\"immer-draftable\")\n\nexport const DRAFT_STATE: unique symbol = Symbol.for(\"immer-state\")\n","import {\n\tIProduce,\n\tIProduceWithPatches,\n\tImmer,\n\tDraft,\n\tImmutable\n} from \"./internal\"\n\nexport {\n\tDraft,\n\tWritableDraft,\n\tImmutable,\n\tPatch,\n\tPatchListener,\n\tProducer,\n\toriginal,\n\tcurrent,\n\tisDraft,\n\tisDraftable,\n\tNOTHING as nothing,\n\tDRAFTABLE as immerable,\n\tfreeze,\n\tObjectish,\n\tStrictMode\n} from \"./internal\"\n\nconst immer = new Immer()\n\n/**\n * The `produce` function takes a value and a \"recipe function\" (whose\n * return value often depends on the base state). The recipe function is\n * free to mutate its first argument however it wants. All mutations are\n * only ever applied to a __copy__ of the base state.\n *\n * Pass only a function to create a \"curried producer\" which relieves you\n * from passing the recipe function every time.\n *\n * Only plain objects and arrays are made mutable. All other objects are\n * considered uncopyable.\n *\n * Note: This function is __bound__ to its `Immer` instance.\n *\n * @param {any} base - the initial state\n * @param {Function} producer - function that receives a proxy of the base state as first argument and which can be freely modified\n * @param {Function} patchListener - optional function that will be called with all the patches produced here\n * @returns {any} a new state, or the initial state if nothing was modified\n */\nexport const produce: IProduce = /* @__PURE__ */ immer.produce\n\n/**\n * Like `produce`, but `produceWithPatches` always returns a tuple\n * [nextState, patches, inversePatches] (instead of just the next state)\n */\nexport const produceWithPatches: IProduceWithPatches = /* @__PURE__ */ immer.produceWithPatches.bind(\n\timmer\n)\n\n/**\n * Pass true to automatically freeze all copies created by Immer.\n *\n * Always freeze by default, even in production mode\n */\nexport const setAutoFreeze = /* @__PURE__ */ immer.setAutoFreeze.bind(immer)\n\n/**\n * Pass true to enable strict shallow copy.\n *\n * By default, immer does not copy the object descriptors such as getter, setter and non-enumrable properties.\n */\nexport const setUseStrictShallowCopy = /* @__PURE__ */ immer.setUseStrictShallowCopy.bind(\n\timmer\n)\n\n/**\n * Apply an array of Immer patches to the first argument.\n *\n * This function is a producer, which means copy-on-write is in effect.\n */\nexport const applyPatches = /* @__PURE__ */ immer.applyPatches.bind(immer)\n\n/**\n * Create an Immer draft from the given base state, which may be a draft itself.\n * The draft can be modified until you finalize it with the `finishDraft` function.\n */\nexport const createDraft = /* @__PURE__ */ immer.createDraft.bind(immer)\n\n/**\n * Finalize an Immer draft from a `createDraft` call, returning the base state\n * (if no changes were made) or a modified copy. The draft must *not* be\n * mutated afterwards.\n *\n * Pass a function as the 2nd argument to generate Immer patches based on the\n * changes that were made.\n */\nexport const finishDraft = /* @__PURE__ */ immer.finishDraft.bind(immer)\n\n/**\n * This function is actually a no-op, but can be used to cast an immutable type\n * to an draft type and make TypeScript happy\n *\n * @param value\n */\nexport function castDraft<T>(value: T): Draft<T> {\n\treturn value as any\n}\n\n/**\n * This function is actually a no-op, but can be used to cast a mutable type\n * to an immutable type and make TypeScript happy\n * @param value\n */\nexport function castImmutable<T>(value: T): Immutable<T> {\n\treturn value as any\n}\n\nexport {Immer}\n\nexport {enablePatches} from \"./plugins/patches\"\nexport {enableMapSet} from \"./plugins/mapset\"\n","export type Reducer<T, A> = (state: T, action: A) => T;\nexport type Dispatch<A> = (action: A) => void;\nexport type Subscriber<T> = (state: T) => void;\nexport type Subscribe<T> = (subscriber: Subscriber<T>) => Unsubscribe;\nexport type Unsubscribe = () => void;\n\nexport interface Store<State, Action> {\n getState: () => State;\n subscribe: Subscribe<State>;\n dispatch: Dispatch<Action>;\n}\n\nexport const useStateReducer = <State, Action>(\n reducer: Reducer<State, Action>,\n initialState: State,\n): Store<State, Action> => {\n let state = initialState;\n const subscribers = new Set<Subscriber<State>>();\n return {\n getState: () => state,\n\n /** Subscribe to state changes; returns an unsubscribe function. */\n subscribe(subscriber: Subscriber<State>): Unsubscribe {\n subscribers.add(subscriber);\n subscriber(state);\n return () => subscribers.delete(subscriber);\n },\n\n /** Dispatch an action through the reducer, then run side-effects. */\n dispatch(action: Action): void {\n const prevState = state;\n const nextState = reducer(prevState, action);\n\n // Only proceed if state actually changed by reference\n if (nextState !== prevState) {\n state = nextState;\n\n // Notify subscribers\n for (const sub of subscribers) sub(state);\n }\n },\n };\n};\n","import { produce } from \"immer\";\nimport { dequal } from \"dequal\";\nimport type {\n DevtoolsDataChangeEvent,\n DevtoolsPluginsStore,\n ExtensionSupportedEvents,\n PlayerInitEvent,\n Transaction,\n} from \"@player-devtools/types\";\nimport { dsetAssign } from \"@player-devtools/utils\";\n\nconst containsInteraction = (\n interactions: DevtoolsPluginsStore[\"interactions\"],\n interaction: DevtoolsPluginsStore[\"interactions\"][number],\n) => {\n return interactions.filter((i) => dequal(i, interaction)).length > 0;\n};\n\n/** devtools plugin state reducer */\nexport const reducer = (\n state: DevtoolsPluginsStore,\n transaction: Transaction<ExtensionSupportedEvents>,\n): DevtoolsPluginsStore => {\n switch (transaction.type) {\n case \"PLAYER_DEVTOOLS_PLAYER_INIT\":\n return produce(state, (draft) => {\n const { payload } = transaction;\n dsetAssign(draft, [\"plugins\"], payload.plugins);\n\n const message: PlayerInitEvent = {\n type: \"PLAYER_DEVTOOLS_PLAYER_INIT\",\n payload,\n };\n\n draft.messages.push(message);\n });\n case \"PLAYER_DEVTOOLS_PLUGIN_DATA_CHANGE\":\n return produce(state, (draft) => {\n const { payload } = transaction;\n\n if (!payload.data) return state;\n\n try {\n dsetAssign(\n draft,\n [\"plugins\", transaction.payload.pluginID, \"flow\", \"data\"],\n transaction.payload.data,\n );\n } catch {\n console.error(\"error setting data:\", transaction.payload.data);\n }\n const message: DevtoolsDataChangeEvent = {\n type: \"PLAYER_DEVTOOLS_PLUGIN_DATA_CHANGE\",\n payload,\n };\n\n draft.messages.push(message);\n });\n case \"PLAYER_DEVTOOLS_PLUGIN_INTERACTION\":\n return produce(state, (draft) => {\n if (containsInteraction(draft.interactions, transaction)) return state;\n\n dsetAssign(\n draft,\n [\"interactions\"],\n [...draft.interactions, transaction],\n );\n });\n case \"PLAYER_DEVTOOLS_SELECTED_PLAYER_CHANGE\": {\n const { playerID } = transaction.payload;\n\n if (!playerID) return state;\n return produce(state, (draft) => {\n dsetAssign(draft, [\"currentPlayer\"], playerID);\n });\n }\n default:\n return state;\n }\n};\n","export const INTERACTIONS = {\n PLAYER_SELECTED: \"player-selected\",\n};\n\nexport const PLUGIN_INACTIVE_WARNING =\n \"The plugin has been registered, but the Player development tools are not active. If you are working in a production environment, it is recommended to remove the plugin. To activate, enable through the browser extension popup for web or configure the FlipperClient for mobile.\";\n","import type {\n DevtoolsDataChangeEvent,\n Transaction,\n} from \"@player-devtools/types\";\nimport type { Flow } from \"@player-ui/player\";\n\nconst NOOP_ID = -1;\n\n/**\n * Generates a data change transaction for the player devtools plugin.\n *\n * This function creates a transaction object that represents a change in data\n * within a player devtools plugin. The transaction includes details such as the\n * plugin ID, the changed data, and the player ID. It is used to communicate\n * changes between the plugin and devtools.\n */\nexport const genDataChangeTransaction = ({\n playerID,\n data,\n pluginID,\n}: {\n playerID: string;\n data: Flow[\"data\"];\n pluginID: string;\n}): Transaction<DevtoolsDataChangeEvent> => {\n return {\n id: NOOP_ID,\n type: \"PLAYER_DEVTOOLS_PLUGIN_DATA_CHANGE\",\n payload: {\n pluginID,\n data,\n },\n sender: playerID,\n context: \"player\",\n target: \"player\",\n timestamp: Date.now(),\n _messenger_: true,\n };\n};\n","import type { Messenger } from \"@player-devtools/messenger\";\nimport {\n PluginData,\n DevtoolsPluginsStore,\n PlayerInitEvent,\n ExtensionSupportedEvents,\n Transaction,\n DevtoolsPluginInteractionEvent,\n} from \"@player-devtools/types\";\nimport { dsetAssign } from \"@player-devtools/utils\";\nimport type { DataModel, Player, PlayerPlugin } from \"@player-ui/player\";\nimport { produce } from \"immer\";\nimport { useStateReducer, type Store, type Unsubscribe } from \"./state\";\nimport { reducer } from \"./reducer\";\nimport { PLUGIN_INACTIVE_WARNING, INTERACTIONS } from \"./constants\";\nimport { genDataChangeTransaction } from \"./helpers\";\nimport { dequal } from \"dequal\";\n\nexport interface DevtoolsHandler {\n // TODO: Could return bool to signifiy handled to avoid double processing?\n processInteraction(interaction: DevtoolsPluginInteractionEvent): void;\n checkIfDevtoolsIsActive(): boolean;\n log?(message: string): void;\n}\n\nexport interface DevtoolsPluginOptions {\n playerID: string;\n pluginData: PluginData;\n handler: DevtoolsHandler;\n}\n\nconst INITIAL_STATE: DevtoolsPluginsStore = {\n messages: [],\n plugins: {},\n interactions: [],\n currentPlayer: \"\",\n};\n\n// TODO: Rename to DevtoolsPluginStore? Need to rename DevtoolsPluginsStore to DevtoolsPluginState\nexport type PluginStore = Store<\n DevtoolsPluginsStore,\n Transaction<ExtensionSupportedEvents>\n>;\n\n/** Entrypoint for devtools plugins with platform-agnostic components */\nexport class DevtoolsPlugin implements PlayerPlugin, DevtoolsHandler {\n name: string = \"DevtoolsPlugin\";\n\n private loggedWarning = false;\n\n store: PluginStore = useStateReducer(reducer, INITIAL_STATE);\n protected lastProcessedInteraction = 0;\n\n get pluginID(): string {\n return this.options.pluginData.id;\n }\n\n get playerID(): string {\n return this.options.playerID;\n }\n\n constructor(protected options: DevtoolsPluginOptions) {\n this.store.subscribe(({ interactions }) => {\n if (this.lastProcessedInteraction < (interactions.length ?? 0)) {\n interactions\n .slice(this.lastProcessedInteraction)\n .forEach(this.processInteraction.bind(this));\n }\n });\n }\n\n registerMessenger(\n messenger: Messenger<ExtensionSupportedEvents>,\n ): Unsubscribe {\n // Propagate new messages from state to devtools via the messenger\n let lastMessageIndex = -1;\n return this.store.subscribe(({ messages }) => {\n const start = lastMessageIndex + 1;\n if (messages.length > start) {\n const newlyAdded = messages.slice(start);\n lastMessageIndex = messages.length - 1;\n for (const msg of newlyAdded) {\n messenger.sendMessage(msg);\n }\n }\n });\n }\n\n protected dispatchPlayerInit(): void {\n // Initial plugin content\n const transaction: Transaction<PlayerInitEvent> = {\n id: -1,\n type: \"PLAYER_DEVTOOLS_PLAYER_INIT\",\n payload: {\n plugins: {\n [this.pluginID]: this.options.pluginData,\n },\n },\n sender: this.options.playerID,\n context: \"player\",\n target: \"player\",\n timestamp: Date.now(),\n _messenger_: true,\n };\n\n this.store.dispatch(transaction);\n }\n\n // By default, we'll only write to the keys defined in data -- if undefined, data will be cleared\n protected dispatchDataUpdate(data?: DataModel): void {\n const state = this.store.getState();\n\n const { plugins } = produce(this.store.getState(), (draft) => {\n if (!data)\n dsetAssign(draft, [\"plugins\", this.pluginID, \"flow\", \"data\"], data);\n else\n Object.entries(data).forEach(([key, value]) => {\n dsetAssign(\n draft,\n [\"plugins\", this.pluginID, \"flow\", \"data\", key],\n value,\n );\n });\n });\n\n const newData = plugins[this.pluginID]!.flow.data;\n if (dequal(state.plugins[this.pluginID]?.flow?.data, newData)) return;\n\n const transaction = genDataChangeTransaction({\n playerID: this.playerID,\n pluginID: this.pluginID,\n data: newData,\n });\n\n this.store.dispatch(transaction);\n }\n\n checkIfDevtoolsIsActive(): boolean {\n const isActive = this.options.handler.checkIfDevtoolsIsActive();\n if (!isActive && !this.loggedWarning) {\n this.options.handler.log?.(PLUGIN_INACTIVE_WARNING);\n this.loggedWarning = true;\n }\n\n return isActive;\n }\n\n processInteraction(interaction: DevtoolsPluginInteractionEvent): void {\n this.options.handler.processInteraction(interaction);\n\n const {\n payload: { type, payload },\n } = interaction;\n\n if (type === INTERACTIONS.PLAYER_SELECTED && payload) {\n this.store.dispatch({\n id: -1,\n type: \"PLAYER_DEVTOOLS_SELECTED_PLAYER_CHANGE\",\n payload: { playerID: payload },\n sender: this.playerID,\n context: \"player\",\n target: this.playerID,\n timestamp: Date.now(),\n _messenger_: true,\n });\n }\n\n this.lastProcessedInteraction += 1;\n }\n\n apply(player: Player): void {\n if (!this.checkIfDevtoolsIsActive()) return;\n\n this.dispatchPlayerInit();\n }\n}\n","import {\n INTERACTIONS,\n BasicPluginData,\n} from \"@player-devtools/basic-plugin-content\";\nimport {\n DevtoolsPlugin,\n DevtoolsPluginOptions,\n generateUUID,\n} from \"@player-devtools/plugin\";\nimport type { DevtoolsPluginInteractionEvent } from \"@player-devtools/types\";\nimport { dsetAssign } from \"@player-devtools/utils\";\nimport type {\n DataController,\n ExpressionEvaluator,\n Flow,\n Player,\n ViewInstance,\n Logger,\n} from \"@player-ui/player\";\nimport { produce } from \"immer\";\n\nimport { Evaluation } from \"./types\";\n\n/** Taps into the Player and ReactPlayer hooks and leverage the WrapperComponent to define and process the content. */\nexport class BasicDevtoolsPlugin extends DevtoolsPlugin {\n constructor(options: Omit<DevtoolsPluginOptions, \"pluginData\">) {\n super({\n ...options,\n pluginData: BasicPluginData,\n });\n }\n\n name = \"BasicDevtoolsPlugin\";\n\n data: Record<string, unknown> = {};\n\n playerConfig: Record<string, unknown> = {};\n\n logs: {\n severity: string;\n message: unknown;\n }[] = [];\n\n flow?: Flow;\n\n logger?: WeakRef<Logger>;\n\n expressionEvaluator?: WeakRef<ExpressionEvaluator>;\n\n view?: WeakRef<ViewInstance>;\n\n dataController?: WeakRef<DataController>;\n\n overrideFlow?: Player[\"start\"];\n\n apply(player: Player): void {\n this.logger = new WeakRef(player.logger);\n\n if (!this.checkIfDevtoolsIsActive()) return;\n\n this.options.pluginData.flow.data!.playerConfig = {\n version: player.getVersion(),\n plugins: player.getPlugins().map((plugin) => plugin.name),\n };\n\n super.apply(player);\n\n // Config\n this.playerConfig = {\n version: player.getVersion(),\n plugins: player.getPlugins().map((plugin) => plugin.name),\n };\n\n this.dispatchDataUpdate({ playerConfig: this.playerConfig });\n\n // Data\n player.hooks.dataController.tap(this.name, (dataController) => {\n dataController.hooks.onUpdate.tap(this.name, (updates) => {\n this.data = produce(this.data, (draft) => {\n updates.forEach(({ binding, newValue }) => {\n dsetAssign(draft, [\"data\", ...binding.asArray()], newValue);\n });\n });\n\n this.dispatchDataUpdate({ data: this.data });\n });\n });\n\n player.logger.hooks.log.tap(this.name, (severity, message) => {\n this.logs = [...this.logs, { severity, message }];\n\n this.dispatchDataUpdate({ logs: this.logs });\n });\n\n // Flow\n player.hooks.onStart.tap(this.name, (f) => {\n this.flow = JSON.parse(JSON.stringify(f));\n\n this.dispatchDataUpdate({ flow: this.flow });\n });\n\n // View\n player.hooks.view.tap(this.name, (view) => {\n this.view = new WeakRef(view);\n });\n\n // Expression evaluator\n player.hooks.expressionEvaluator.tap(this.name, (evaluator) => {\n this.expressionEvaluator = new WeakRef(evaluator);\n });\n\n // Override flow\n this.overrideFlow = player.start.bind(player);\n }\n\n private evaluateExpression(expression: string): Evaluation {\n const evaluator = this.expressionEvaluator?.deref();\n\n if (!evaluator) {\n return {\n id: generateUUID(),\n severity: \"error\",\n result: \"Expression evaluator not available\",\n expression,\n };\n }\n\n try {\n evaluator.hooks.onError.intercept({\n call: (error: Error) => {\n throw error;\n },\n });\n\n const evaluatorResult = evaluator.evaluate(expression);\n\n return {\n id: generateUUID(),\n result: evaluatorResult,\n expression,\n };\n } catch (error) {\n const message =\n error instanceof Error\n ? error.message\n : String(error ?? \"Something went wrong\");\n return {\n id: generateUUID(),\n severity: \"error\",\n result: message,\n expression,\n };\n }\n }\n\n processInteraction(interaction: DevtoolsPluginInteractionEvent): void {\n // invokes mobile specific handlers\n super.processInteraction(interaction);\n\n const {\n payload: { type, payload },\n } = interaction;\n if (\n type === INTERACTIONS.EVALUATE_EXPRESSION &&\n this.expressionEvaluator &&\n payload\n ) {\n const result = this.evaluateExpression(payload);\n const current: Array<Evaluation> =\n (this.store.getState()?.plugins?.[this.pluginID]?.flow?.data\n ?.history as Array<Evaluation>) || [];\n\n this.dispatchDataUpdate({ history: [...current, result] });\n\n return;\n }\n\n if (type === INTERACTIONS.OVERRIDE_FLOW && payload && this.overrideFlow) {\n let newFlow: Flow | undefined;\n\n try {\n newFlow = JSON.parse(payload);\n } catch (e) {\n this.logger?.deref()?.error(this.name, \"Error parsing new flow\", e);\n }\n\n if (newFlow) {\n this.overrideFlow(newFlow);\n }\n\n return;\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["/home/circleci/.cache/bazel/_bazel_circleci/8a7a049d85b1ea1286a017c8d271a188/sandbox/processwrapper-sandbox/2657/execroot/_main/bazel-out/k8-fastbuild/bin/devtools/plugins/basic/core/dist/index.global.js","../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/utils/core/src/index.ts","../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/immer@10.1.3/node_modules/immer/src/utils/errors.ts","../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/immer@10.1.3/node_modules/immer/src/utils/common.ts","../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/immer@10.1.3/node_modules/immer/src/utils/plugins.ts","../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/immer@10.1.3/node_modules/immer/src/core/scope.ts","../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/immer@10.1.3/node_modules/immer/src/core/finalize.ts","../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/immer@10.1.3/node_modules/immer/src/core/proxy.ts","../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/immer@10.1.3/node_modules/immer/src/core/immerClass.ts","../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/immer@10.1.3/node_modules/immer/src/core/current.ts","../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/dequal@2.0.3/node_modules/dequal/dist/index.mjs","../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/plugin/core/src/helpers/uuid.ts","../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/plugins/basic/core/src/index.ts","../../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/plugins/basic/content/src/constants.ts","../../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/plugins/basic/content/_generated/flow.json","../../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/plugins/basic/content/src/index.ts","../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/immer@10.1.3/node_modules/immer/src/utils/env.ts","../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/immer@10.1.3/node_modules/immer/src/immer.ts","../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/plugin/core/src/state.ts","../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/plugin/core/src/reducer.ts","../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/plugin/core/src/constants.ts","../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/plugin/core/src/helpers/genDataChangeTransaction.ts","../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/plugin/core/src/plugin.ts","../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/plugins/basic/core/src/plugin.ts"],"names":["BasicDevtoolsPlugin","dsetAssign","obj","keys","value","merge","key","length","Error","acc","target","slice","reduce","deepAssign","die","error","args","e","errors","msg","apply","isDraft","DRAFT_STATE","isDraftable","isPlainObject","Array","isArray","DRAFTABLE","constructor","isMap","isSet","proto","getPrototypeOf","Ctor","Object","hasOwnProperty","call","Function","toString","objectCtorString","each","iter","getArchtype","Reflect","ownKeys","forEach","entry","index","thing","state","type_","has","prop","prototype","set","propOrOldValue","t","add","is","x","y","Map","Set","latest","copy_","base_","shallowCopy","base","strict","isPlain","descriptors","getOwnPropertyDescriptors","i","desc","writable","configurable","get","enumerable","create","assign","dontMutateFrozenCollections","isFrozen","getPlugin","pluginKey","plugin","plugins","getCurrentScope","currentScope","createScope","parent_","immer_","drafts_","canAutoFreeze_","unfinalizedDrafts_","usePatchesInScope","scope","patchListener","patches_","inversePatches_","patchListener_","revokeScope","leaveScope","revokeDraft","enterScope","immer","draft","revoke_","revoked_","processResult","result","baseDraft","isReplaced","modified_","finalize","maybeFreeze","generateReplacementPatches_","NOTHING","rootScope","path","childValue","finalizeProperty","scope_","finalized_","resultEach","clear","generatePatches_","parentState","targetObject","rootPath","targetIsSet","assigned_","concat","res","autoFreeze_","propertyIsEnumerable","deep","freeze","createProxyProxy","parent","draft_","isManual_","traps","objectTraps","arrayTraps","Proxy","revocable","revoke","proxy","peek","source","readPropFromProto","getDescriptorFromProto","getOwnPropertyDescriptor","prepareCopy","useStrictShallowCopy_","createProxy","proxyMap_","proxySet_","push","current","currentImpl","find","tar","dequal","generateUUID","d","Date","getTime","d2","performance","now","replace","c","r","Math","random","floor","__defProp","defineProperty","__getOwnPropDesc","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","__export","all","name","__copyProps","to","from","except","__toCommonJS","mod","src_exports","PLUGIN_ID","INTERACTIONS","EVALUATE_EXPRESSION","OVERRIDE_FLOW","flow_default","id","views","type","header","asset","values","label","main","binding","filter","footer","exp","navigation","BEGIN","Plugin","startState","CONFIG","state_type","ref","transitions","Config","Flow","Logs","Console","Editor","FLOW","LOGS","CONSOLE","EDITOR","schema","ROOT","playerConfig","flow","expression","default","validation","format","code","history","logs","logsType","time","message","severity","outcome","metricType","historyType","data","PLUGIN_VERSION","BasicPluginData","description","version","pop","entries","item","record","Symbol","for","defineProperties","delete","currentState","markChanged","Number","isNaN","deleteProperty","owner","setPrototypeOf","fn","arguments","Immer","config","produce","recipe","defaultBase","self","curriedProduce","hasError","p","ip","produceWithPatches","patches","inversePatches","autoFreeze","setAutoFreeze","useStrictShallowCopy","setUseStrictShallowCopy","createDraft","finishDraft","applyPatches","patch","op","applyPatchesImpl","applyPatches_","copy","foo","bar","ctor","len","tmp","RegExp","size","ArrayBuffer","Uint8Array","DataView","byteLength","getInt8","isView","useStateReducer","reducer","initialState","subscribers","getState","subscribe","subscriber","dispatch","action","prevState","nextState","sub","containsInteraction","interactions","interaction","transaction","payload","messages","pluginID","console","playerID","PLAYER_SELECTED","PLUGIN_INACTIVE_WARNING","NOOP_ID","genDataChangeTransaction","sender","context","timestamp","_messenger_","INITIAL_STATE","currentPlayer","DevtoolsPlugin","options","loggedWarning","store","lastProcessedInteraction","processInteraction","bind","pluginData","registerMessenger","messenger","lastMessageIndex","start","newlyAdded","sendMessage","dispatchPlayerInit","dispatchDataUpdate","newData","checkIfDevtoolsIsActive","isActive","handler","log","player","logger","WeakRef","getVersion","getPlugins","map","hooks","dataController","tap","onUpdate","updates","newValue","asArray","onStart","f","JSON","parse","stringify","view","expressionEvaluator","evaluator","overrideFlow","evaluateExpression","deref","onError","intercept","evaluatorResult","evaluate","String","newFlow"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AA,EAAc;wBACvE,IAAIQ;wBAEJ,IAAI;4BACFA,UAAUd,KAAKC,KAAA,CAAMpD;wBACvB,EAAA,OAAShT,GAAG;gCACV,oBAAA;6BAAA,eAAA,IAAA,CAAKqV,MAAA,cAAL,oCAAA,qBAAA,aAAasB,KAAA,gBAAb,yCAAA,mBAAsB7W,KAAA,CAAM,IAAA,CAAK0K,IAAA,EAAM,0BAA0BxK;wBACnE;wBAEA,IAAIiX,SAAS;4BACX,IAAA,CAAKR,YAAA,CAAaQ;wBACpB;wBAEA;oBACF;gBACF;;;;MAxKuClD;IvB01DvC,OAAOlJ,aAAaE;AACtB","sourcesContent":["\"use strict\";\nvar BasicDevtoolsPlugin = (() => {\n var __defProp = Object.defineProperty;\n var __getOwnPropDesc = Object.getOwnPropertyDescriptor;\n var __getOwnPropNames = Object.getOwnPropertyNames;\n var __hasOwnProp = Object.prototype.hasOwnProperty;\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 __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n // ../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/plugins/basic/core/src/index.ts\n var src_exports = {};\n __export(src_exports, {\n BasicDevtoolsPlugin: () => BasicDevtoolsPlugin\n });\n\n // ../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/@player-devtools+basic-plugin-content@0.0.0/node_modules/@player-devtools/basic-plugin-content/dist/index.mjs\n var PLUGIN_ID = \"player-ui-basic-devtools-plugin\";\n var INTERACTIONS = {\n EVALUATE_EXPRESSION: \"evaluate-expression\",\n OVERRIDE_FLOW: \"override-flow\"\n };\n var flow_default = {\n id: \"player-ui-basic-devtools-plugin\",\n views: [\n {\n id: \"Config\",\n type: \"stacked-view\",\n header: {\n asset: {\n id: \"Config-header\",\n type: \"navigation\",\n values: [\n {\n asset: {\n id: \"Config-header-values-0\",\n type: \"action\",\n value: \"Config\",\n label: {\n asset: {\n id: \"Config-header-values-0-label\",\n type: \"text\",\n value: \"Config\"\n }\n }\n }\n },\n {\n asset: {\n id: \"Config-header-values-1\",\n type: \"action\",\n value: \"Flow\",\n label: {\n asset: {\n id: \"Config-header-values-1-label\",\n type: \"text\",\n value: \"Flow\"\n }\n }\n }\n },\n {\n asset: {\n id: \"Config-header-values-2\",\n type: \"action\",\n value: \"Logs\",\n label: {\n asset: {\n id: \"Config-header-values-2-label\",\n type: \"text\",\n value: \"Logs\"\n }\n }\n }\n },\n {\n asset: {\n id: \"Config-header-values-3\",\n type: \"action\",\n value: \"Console\",\n label: {\n asset: {\n id: \"Config-header-values-3-label\",\n type: \"text\",\n value: \"Console\"\n }\n }\n }\n },\n {\n asset: {\n id: \"Config-header-values-4\",\n type: \"action\",\n value: \"Editor\",\n label: {\n asset: {\n id: \"Config-header-values-4-label\",\n type: \"text\",\n value: \"Editor\"\n }\n }\n }\n }\n ]\n }\n },\n main: {\n asset: {\n id: \"Config-main\",\n type: \"object-inspector\",\n binding: \"playerConfig\",\n label: {\n asset: {\n id: \"Config-main-label\",\n type: \"text\",\n value: \"Config\"\n }\n }\n }\n }\n },\n {\n id: \"Flow\",\n type: \"stacked-view\",\n header: {\n asset: {\n id: \"Flow-header\",\n type: \"navigation\",\n values: [\n {\n asset: {\n id: \"Flow-header-values-0\",\n type: \"action\",\n value: \"Config\",\n label: {\n asset: {\n id: \"Flow-header-values-0-label\",\n type: \"text\",\n value: \"Config\"\n }\n }\n }\n },\n {\n asset: {\n id: \"Flow-header-values-1\",\n type: \"action\",\n value: \"Flow\",\n label: {\n asset: {\n id: \"Flow-header-values-1-label\",\n type: \"text\",\n value: \"Flow\"\n }\n }\n }\n },\n {\n asset: {\n id: \"Flow-header-values-2\",\n type: \"action\",\n value: \"Logs\",\n label: {\n asset: {\n id: \"Flow-header-values-2-label\",\n type: \"text\",\n value: \"Logs\"\n }\n }\n }\n },\n {\n asset: {\n id: \"Flow-header-values-3\",\n type: \"action\",\n value: \"Console\",\n label: {\n asset: {\n id: \"Flow-header-values-3-label\",\n type: \"text\",\n value: \"Console\"\n }\n }\n }\n },\n {\n asset: {\n id: \"Flow-header-values-4\",\n type: \"action\",\n value: \"Editor\",\n label: {\n asset: {\n id: \"Flow-header-values-4-label\",\n type: \"text\",\n value: \"Editor\"\n }\n }\n }\n }\n ]\n }\n },\n main: {\n asset: {\n id: \"Flow-main\",\n type: \"object-inspector\",\n filter: true,\n binding: \"flow\",\n label: {\n asset: {\n id: \"Flow-main-label\",\n type: \"text\",\n value: \"Flow\"\n }\n }\n }\n },\n footer: {\n asset: {\n id: \"Flow-footer\",\n type: \"copy-to-clipboard\",\n binding: \"flow\",\n label: {\n asset: {\n id: \"Flow-footer-label\",\n type: \"text\",\n value: \"Copy flow to the clipboard\"\n }\n }\n }\n }\n },\n {\n id: \"Logs\",\n type: \"stacked-view\",\n header: {\n asset: {\n id: \"Logs-header\",\n type: \"navigation\",\n values: [\n {\n asset: {\n id: \"Logs-header-values-0\",\n type: \"action\",\n value: \"Config\",\n label: {\n asset: {\n id: \"Logs-header-values-0-label\",\n type: \"text\",\n value: \"Config\"\n }\n }\n }\n },\n {\n asset: {\n id: \"Logs-header-values-1\",\n type: \"action\",\n value: \"Flow\",\n label: {\n asset: {\n id: \"Logs-header-values-1-label\",\n type: \"text\",\n value: \"Flow\"\n }\n }\n }\n },\n {\n asset: {\n id: \"Logs-header-values-2\",\n type: \"action\",\n value: \"Logs\",\n label: {\n asset: {\n id: \"Logs-header-values-2-label\",\n type: \"text\",\n value: \"Logs\"\n }\n }\n }\n },\n {\n asset: {\n id: \"Logs-header-values-3\",\n type: \"action\",\n value: \"Console\",\n label: {\n asset: {\n id: \"Logs-header-values-3-label\",\n type: \"text\",\n value: \"Console\"\n }\n }\n }\n },\n {\n asset: {\n id: \"Logs-header-values-4\",\n type: \"action\",\n value: \"Editor\",\n label: {\n asset: {\n id: \"Logs-header-values-4-label\",\n type: \"text\",\n value: \"Editor\"\n }\n }\n }\n }\n ]\n }\n },\n main: {\n asset: {\n id: \"Logs-main\",\n type: \"table\",\n binding: \"logs\"\n }\n }\n },\n {\n id: \"Console\",\n type: \"stacked-view\",\n header: {\n asset: {\n id: \"Console-header\",\n type: \"navigation\",\n values: [\n {\n asset: {\n id: \"Console-header-values-0\",\n type: \"action\",\n value: \"Config\",\n label: {\n asset: {\n id: \"Console-header-values-0-label\",\n type: \"text\",\n value: \"Config\"\n }\n }\n }\n },\n {\n asset: {\n id: \"Console-header-values-1\",\n type: \"action\",\n value: \"Flow\",\n label: {\n asset: {\n id: \"Console-header-values-1-label\",\n type: \"text\",\n value: \"Flow\"\n }\n }\n }\n },\n {\n asset: {\n id: \"Console-header-values-2\",\n type: \"action\",\n value: \"Logs\",\n label: {\n asset: {\n id: \"Console-header-values-2-label\",\n type: \"text\",\n value: \"Logs\"\n }\n }\n }\n },\n {\n asset: {\n id: \"Console-header-values-3\",\n type: \"action\",\n value: \"Console\",\n label: {\n asset: {\n id: \"Console-header-values-3-label\",\n type: \"text\",\n value: \"Console\"\n }\n }\n }\n },\n {\n asset: {\n id: \"Console-header-values-4\",\n type: \"action\",\n value: \"Editor\",\n label: {\n asset: {\n id: \"Console-header-values-4-label\",\n type: \"text\",\n value: \"Editor\"\n }\n }\n }\n }\n ]\n }\n },\n main: {\n asset: {\n id: \"Console-main\",\n type: \"console\",\n exp: \" publish('evaluate-expression', {{expression}}) \",\n binding: \"history\"\n }\n }\n },\n {\n id: \"Editor\",\n type: \"stacked-view\",\n header: {\n asset: {\n id: \"Editor-header\",\n type: \"navigation\",\n values: [\n {\n asset: {\n id: \"Editor-header-values-0\",\n type: \"action\",\n value: \"Config\",\n label: {\n asset: {\n id: \"Editor-header-values-0-label\",\n type: \"text\",\n value: \"Config\"\n }\n }\n }\n },\n {\n asset: {\n id: \"Editor-header-values-1\",\n type: \"action\",\n value: \"Flow\",\n label: {\n asset: {\n id: \"Editor-header-values-1-label\",\n type: \"text\",\n value: \"Flow\"\n }\n }\n }\n },\n {\n asset: {\n id: \"Editor-header-values-2\",\n type: \"action\",\n value: \"Logs\",\n label: {\n asset: {\n id: \"Editor-header-values-2-label\",\n type: \"text\",\n value: \"Logs\"\n }\n }\n }\n },\n {\n asset: {\n id: \"Editor-header-values-3\",\n type: \"action\",\n value: \"Console\",\n label: {\n asset: {\n id: \"Editor-header-values-3-label\",\n type: \"text\",\n value: \"Console\"\n }\n }\n }\n },\n {\n asset: {\n id: \"Editor-header-values-4\",\n type: \"action\",\n value: \"Editor\",\n label: {\n asset: {\n id: \"Editor-header-values-4-label\",\n type: \"text\",\n value: \"Editor\"\n }\n }\n }\n }\n ]\n }\n },\n main: {\n asset: {\n id: \"Editor-main\",\n type: \"code-editor\",\n binding: \"flow\",\n exp: \" publish('override-flow', {{code}}) \"\n }\n }\n }\n ],\n navigation: {\n BEGIN: \"Plugin\",\n Plugin: {\n startState: \"CONFIG\",\n CONFIG: {\n state_type: \"VIEW\",\n ref: \"Config\",\n transitions: {\n Config: \"CONFIG\",\n Flow: \"FLOW\",\n Logs: \"LOGS\",\n Console: \"CONSOLE\",\n Editor: \"EDITOR\"\n }\n },\n FLOW: {\n state_type: \"VIEW\",\n ref: \"Flow\",\n transitions: {\n Config: \"CONFIG\",\n Flow: \"FLOW\",\n Logs: \"LOGS\",\n Console: \"CONSOLE\",\n Editor: \"EDITOR\"\n }\n },\n LOGS: {\n state_type: \"VIEW\",\n ref: \"Logs\",\n transitions: {\n Config: \"CONFIG\",\n Flow: \"FLOW\",\n Logs: \"LOGS\",\n Console: \"CONSOLE\",\n Editor: \"EDITOR\"\n }\n },\n CONSOLE: {\n state_type: \"VIEW\",\n ref: \"Console\",\n transitions: {\n Config: \"CONFIG\",\n Flow: \"FLOW\",\n Logs: \"LOGS\",\n Console: \"CONSOLE\",\n Editor: \"EDITOR\"\n }\n },\n EDITOR: {\n state_type: \"VIEW\",\n ref: \"Editor\",\n transitions: {\n Config: \"CONFIG\",\n Flow: \"FLOW\",\n Logs: \"LOGS\",\n Console: \"CONSOLE\",\n Editor: \"EDITOR\"\n }\n }\n }\n },\n schema: {\n ROOT: {\n playerConfig: {\n type: \"RecordType\"\n },\n flow: {\n type: \"RecordType\"\n },\n expression: {\n type: \"StringType\",\n default: \"\",\n validation: [\n {\n type: \"string\"\n }\n ],\n format: {\n type: \"string\"\n }\n },\n code: {\n type: \"StringType\",\n default: \"\",\n validation: [\n {\n type: \"string\"\n }\n ],\n format: {\n type: \"string\"\n }\n },\n history: {\n type: \"historyType\",\n isArray: true\n },\n logs: {\n type: \"logsType\",\n isArray: true\n }\n },\n logsType: {\n id: {\n type: \"StringType\",\n default: \"\",\n validation: [\n {\n type: \"string\"\n }\n ],\n format: {\n type: \"string\"\n }\n },\n time: {\n type: \"StringType\",\n default: \"\",\n validation: [\n {\n type: \"string\"\n }\n ],\n format: {\n type: \"string\"\n }\n },\n type: {\n type: \"StringType\",\n default: \"\",\n validation: [\n {\n type: \"string\"\n }\n ],\n format: {\n type: \"string\"\n }\n },\n message: {\n type: \"StringType\",\n default: \"\",\n validation: [\n {\n type: \"string\"\n }\n ],\n format: {\n type: \"string\"\n }\n },\n severity: {\n type: \"StringType\",\n default: \"\",\n validation: [\n {\n type: \"string\"\n }\n ],\n format: {\n type: \"string\"\n }\n },\n binding: {\n type: \"StringType\",\n default: \"\",\n validation: [\n {\n type: \"string\"\n }\n ],\n format: {\n type: \"string\"\n }\n },\n from: {\n type: \"StringType\",\n default: \"\",\n validation: [\n {\n type: \"string\"\n }\n ],\n format: {\n type: \"string\"\n }\n },\n to: {\n type: \"StringType\",\n default: \"\",\n validation: [\n {\n type: \"string\"\n }\n ],\n format: {\n type: \"string\"\n }\n },\n state: {\n type: \"StringType\",\n default: \"\",\n validation: [\n {\n type: \"string\"\n }\n ],\n format: {\n type: \"string\"\n }\n },\n error: {\n type: \"StringType\",\n default: \"\",\n validation: [\n {\n type: \"string\"\n }\n ],\n format: {\n type: \"string\"\n }\n },\n outcome: {\n type: \"StringType\",\n default: \"\",\n validation: [\n {\n type: \"string\"\n }\n ],\n format: {\n type: \"string\"\n }\n },\n metricType: {\n type: \"StringType\",\n default: \"\",\n validation: [\n {\n type: \"string\"\n }\n ],\n format: {\n type: \"string\"\n }\n }\n },\n historyType: {\n id: {\n type: \"StringType\",\n default: \"\",\n validation: [\n {\n type: \"string\"\n }\n ],\n format: {\n type: \"string\"\n }\n },\n expression: {\n type: \"StringType\",\n default: \"\",\n validation: [\n {\n type: \"string\"\n }\n ],\n format: {\n type: \"string\"\n }\n },\n result: {\n type: \"StringType\",\n default: \"\",\n validation: [\n {\n type: \"string\"\n }\n ],\n format: {\n type: \"string\"\n }\n },\n severity: {\n type: \"StringType\",\n default: \"\",\n validation: [\n {\n type: \"string\"\n }\n ],\n format: {\n type: \"string\"\n }\n }\n }\n },\n data: {\n expression: \"\",\n flow: {},\n history: [],\n logs: [],\n playerConfig: {}\n }\n };\n var PLUGIN_VERSION = true ? \"0.13.0-next.0\" : \"unstamped\";\n var BasicPluginData = {\n id: PLUGIN_ID,\n name: \"Standard Devtools\",\n description: \"Standard Player UI Devtools\",\n version: PLUGIN_VERSION,\n flow: flow_default\n };\n\n // ../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/@player-devtools+utils@0.0.0/node_modules/@player-devtools/utils/dist/index.mjs\n function deepAssign(target, source, merge = false) {\n if (Array.isArray(target) && Array.isArray(source)) {\n while (!merge && target.length > source.length) target.pop();\n for (const [index, item] of source.entries()) {\n target[index] = deepAssign(target[index], item, merge);\n }\n } else if (target && typeof target === \"object\" && source && typeof source === \"object\") {\n const record = target;\n if (!merge)\n for (const key of Object.keys(target)) {\n if (!(key in source)) delete record[key];\n }\n for (const [key, item] of Object.entries(source)) {\n record[key] = deepAssign(record[key], item, merge);\n }\n } else {\n return source;\n }\n return target;\n }\n function dsetAssign(obj, keys, value, merge = false) {\n const key = keys[keys.length - 1];\n if (!key) throw Error(\"Unable to assign at path containing undefined keys\");\n const target = keys.slice(0, -1).reduce(\n (acc, key2) => acc[key2] ?? (acc[key2] = {}),\n obj\n );\n target[key] = deepAssign(target[key], value, merge);\n }\n\n // ../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/immer@10.1.3/node_modules/immer/dist/immer.mjs\n var NOTHING = Symbol.for(\"immer-nothing\");\n var DRAFTABLE = Symbol.for(\"immer-draftable\");\n var DRAFT_STATE = Symbol.for(\"immer-state\");\n function die(error, ...args) {\n if (false) {\n const e = errors[error];\n const msg = typeof e === \"function\" ? e.apply(null, args) : e;\n throw new Error(`[Immer] ${msg}`);\n }\n throw new Error(\n `[Immer] minified error nr: ${error}. Full error at: https://bit.ly/3cXEKWf`\n );\n }\n var getPrototypeOf = Object.getPrototypeOf;\n function isDraft(value) {\n return !!value && !!value[DRAFT_STATE];\n }\n function isDraftable(value) {\n if (!value)\n return false;\n return isPlainObject(value) || Array.isArray(value) || !!value[DRAFTABLE] || !!value.constructor?.[DRAFTABLE] || isMap(value) || isSet(value);\n }\n var objectCtorString = Object.prototype.constructor.toString();\n function isPlainObject(value) {\n if (!value || typeof value !== \"object\")\n return false;\n const proto = getPrototypeOf(value);\n if (proto === null) {\n return true;\n }\n const Ctor = Object.hasOwnProperty.call(proto, \"constructor\") && proto.constructor;\n if (Ctor === Object)\n return true;\n return typeof Ctor == \"function\" && Function.toString.call(Ctor) === objectCtorString;\n }\n function each(obj, iter) {\n if (getArchtype(obj) === 0) {\n Reflect.ownKeys(obj).forEach((key) => {\n iter(key, obj[key], obj);\n });\n } else {\n obj.forEach((entry, index) => iter(index, entry, obj));\n }\n }\n function getArchtype(thing) {\n const state = thing[DRAFT_STATE];\n return state ? state.type_ : Array.isArray(thing) ? 1 : isMap(thing) ? 2 : isSet(thing) ? 3 : 0;\n }\n function has(thing, prop) {\n return getArchtype(thing) === 2 ? thing.has(prop) : Object.prototype.hasOwnProperty.call(thing, prop);\n }\n function set(thing, propOrOldValue, value) {\n const t = getArchtype(thing);\n if (t === 2)\n thing.set(propOrOldValue, value);\n else if (t === 3) {\n thing.add(value);\n } else\n thing[propOrOldValue] = value;\n }\n function is(x, y) {\n if (x === y) {\n return x !== 0 || 1 / x === 1 / y;\n } else {\n return x !== x && y !== y;\n }\n }\n function isMap(target) {\n return target instanceof Map;\n }\n function isSet(target) {\n return target instanceof Set;\n }\n function latest(state) {\n return state.copy_ || state.base_;\n }\n function shallowCopy(base, strict) {\n if (isMap(base)) {\n return new Map(base);\n }\n if (isSet(base)) {\n return new Set(base);\n }\n if (Array.isArray(base))\n return Array.prototype.slice.call(base);\n const isPlain = isPlainObject(base);\n if (strict === true || strict === \"class_only\" && !isPlain) {\n const descriptors = Object.getOwnPropertyDescriptors(base);\n delete descriptors[DRAFT_STATE];\n let keys = Reflect.ownKeys(descriptors);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const desc = descriptors[key];\n if (desc.writable === false) {\n desc.writable = true;\n desc.configurable = true;\n }\n if (desc.get || desc.set)\n descriptors[key] = {\n configurable: true,\n writable: true,\n // could live with !!desc.set as well here...\n enumerable: desc.enumerable,\n value: base[key]\n };\n }\n return Object.create(getPrototypeOf(base), descriptors);\n } else {\n const proto = getPrototypeOf(base);\n if (proto !== null && isPlain) {\n return { ...base };\n }\n const obj = Object.create(proto);\n return Object.assign(obj, base);\n }\n }\n function freeze(obj, deep = false) {\n if (isFrozen(obj) || isDraft(obj) || !isDraftable(obj))\n return obj;\n if (getArchtype(obj) > 1) {\n Object.defineProperties(obj, {\n set: { value: dontMutateFrozenCollections },\n add: { value: dontMutateFrozenCollections },\n clear: { value: dontMutateFrozenCollections },\n delete: { value: dontMutateFrozenCollections }\n });\n }\n Object.freeze(obj);\n if (deep)\n Object.values(obj).forEach((value) => freeze(value, true));\n return obj;\n }\n function dontMutateFrozenCollections() {\n die(2);\n }\n function isFrozen(obj) {\n return Object.isFrozen(obj);\n }\n var plugins = {};\n function getPlugin(pluginKey) {\n const plugin = plugins[pluginKey];\n if (!plugin) {\n die(0, pluginKey);\n }\n return plugin;\n }\n var currentScope;\n function getCurrentScope() {\n return currentScope;\n }\n function createScope(parent_, immer_) {\n return {\n drafts_: [],\n parent_,\n immer_,\n // Whenever the modified draft contains a draft from another scope, we\n // need to prevent auto-freezing so the unowned draft can be finalized.\n canAutoFreeze_: true,\n unfinalizedDrafts_: 0\n };\n }\n function usePatchesInScope(scope, patchListener) {\n if (patchListener) {\n getPlugin(\"Patches\");\n scope.patches_ = [];\n scope.inversePatches_ = [];\n scope.patchListener_ = patchListener;\n }\n }\n function revokeScope(scope) {\n leaveScope(scope);\n scope.drafts_.forEach(revokeDraft);\n scope.drafts_ = null;\n }\n function leaveScope(scope) {\n if (scope === currentScope) {\n currentScope = scope.parent_;\n }\n }\n function enterScope(immer2) {\n return currentScope = createScope(currentScope, immer2);\n }\n function revokeDraft(draft) {\n const state = draft[DRAFT_STATE];\n if (state.type_ === 0 || state.type_ === 1)\n state.revoke_();\n else\n state.revoked_ = true;\n }\n function processResult(result, scope) {\n scope.unfinalizedDrafts_ = scope.drafts_.length;\n const baseDraft = scope.drafts_[0];\n const isReplaced = result !== void 0 && result !== baseDraft;\n if (isReplaced) {\n if (baseDraft[DRAFT_STATE].modified_) {\n revokeScope(scope);\n die(4);\n }\n if (isDraftable(result)) {\n result = finalize(scope, result);\n if (!scope.parent_)\n maybeFreeze(scope, result);\n }\n if (scope.patches_) {\n getPlugin(\"Patches\").generateReplacementPatches_(\n baseDraft[DRAFT_STATE].base_,\n result,\n scope.patches_,\n scope.inversePatches_\n );\n }\n } else {\n result = finalize(scope, baseDraft, []);\n }\n revokeScope(scope);\n if (scope.patches_) {\n scope.patchListener_(scope.patches_, scope.inversePatches_);\n }\n return result !== NOTHING ? result : void 0;\n }\n function finalize(rootScope, value, path) {\n if (isFrozen(value))\n return value;\n const state = value[DRAFT_STATE];\n if (!state) {\n each(\n value,\n (key, childValue) => finalizeProperty(rootScope, state, value, key, childValue, path)\n );\n return value;\n }\n if (state.scope_ !== rootScope)\n return value;\n if (!state.modified_) {\n maybeFreeze(rootScope, state.base_, true);\n return state.base_;\n }\n if (!state.finalized_) {\n state.finalized_ = true;\n state.scope_.unfinalizedDrafts_--;\n const result = state.copy_;\n let resultEach = result;\n let isSet2 = false;\n if (state.type_ === 3) {\n resultEach = new Set(result);\n result.clear();\n isSet2 = true;\n }\n each(\n resultEach,\n (key, childValue) => finalizeProperty(rootScope, state, result, key, childValue, path, isSet2)\n );\n maybeFreeze(rootScope, result, false);\n if (path && rootScope.patches_) {\n getPlugin(\"Patches\").generatePatches_(\n state,\n path,\n rootScope.patches_,\n rootScope.inversePatches_\n );\n }\n }\n return state.copy_;\n }\n function finalizeProperty(rootScope, parentState, targetObject, prop, childValue, rootPath, targetIsSet) {\n if (false)\n die(5);\n if (isDraft(childValue)) {\n const path = rootPath && parentState && parentState.type_ !== 3 && // Set objects are atomic since they have no keys.\n !has(parentState.assigned_, prop) ? rootPath.concat(prop) : void 0;\n const res = finalize(rootScope, childValue, path);\n set(targetObject, prop, res);\n if (isDraft(res)) {\n rootScope.canAutoFreeze_ = false;\n } else\n return;\n } else if (targetIsSet) {\n targetObject.add(childValue);\n }\n if (isDraftable(childValue) && !isFrozen(childValue)) {\n if (!rootScope.immer_.autoFreeze_ && rootScope.unfinalizedDrafts_ < 1) {\n return;\n }\n finalize(rootScope, childValue);\n if ((!parentState || !parentState.scope_.parent_) && typeof prop !== \"symbol\" && (isMap(targetObject) ? targetObject.has(prop) : Object.prototype.propertyIsEnumerable.call(targetObject, prop)))\n maybeFreeze(rootScope, childValue);\n }\n }\n function maybeFreeze(scope, value, deep = false) {\n if (!scope.parent_ && scope.immer_.autoFreeze_ && scope.canAutoFreeze_) {\n freeze(value, deep);\n }\n }\n function createProxyProxy(base, parent) {\n const isArray = Array.isArray(base);\n const state = {\n type_: isArray ? 1 : 0,\n // Track which produce call this is associated with.\n scope_: parent ? parent.scope_ : getCurrentScope(),\n // True for both shallow and deep changes.\n modified_: false,\n // Used during finalization.\n finalized_: false,\n // Track which properties have been assigned (true) or deleted (false).\n assigned_: {},\n // The parent draft state.\n parent_: parent,\n // The base state.\n base_: base,\n // The base proxy.\n draft_: null,\n // set below\n // The base copy with any updated values.\n copy_: null,\n // Called by the `produce` function.\n revoke_: null,\n isManual_: false\n };\n let target = state;\n let traps = objectTraps;\n if (isArray) {\n target = [state];\n traps = arrayTraps;\n }\n const { revoke, proxy } = Proxy.revocable(target, traps);\n state.draft_ = proxy;\n state.revoke_ = revoke;\n return proxy;\n }\n var objectTraps = {\n get(state, prop) {\n if (prop === DRAFT_STATE)\n return state;\n const source = latest(state);\n if (!has(source, prop)) {\n return readPropFromProto(state, source, prop);\n }\n const value = source[prop];\n if (state.finalized_ || !isDraftable(value)) {\n return value;\n }\n if (value === peek(state.base_, prop)) {\n prepareCopy(state);\n return state.copy_[prop] = createProxy(value, state);\n }\n return value;\n },\n has(state, prop) {\n return prop in latest(state);\n },\n ownKeys(state) {\n return Reflect.ownKeys(latest(state));\n },\n set(state, prop, value) {\n const desc = getDescriptorFromProto(latest(state), prop);\n if (desc?.set) {\n desc.set.call(state.draft_, value);\n return true;\n }\n if (!state.modified_) {\n const current2 = peek(latest(state), prop);\n const currentState = current2?.[DRAFT_STATE];\n if (currentState && currentState.base_ === value) {\n state.copy_[prop] = value;\n state.assigned_[prop] = false;\n return true;\n }\n if (is(value, current2) && (value !== void 0 || has(state.base_, prop)))\n return true;\n prepareCopy(state);\n markChanged(state);\n }\n if (state.copy_[prop] === value && // special case: handle new props with value 'undefined'\n (value !== void 0 || prop in state.copy_) || // special case: NaN\n Number.isNaN(value) && Number.isNaN(state.copy_[prop]))\n return true;\n state.copy_[prop] = value;\n state.assigned_[prop] = true;\n return true;\n },\n deleteProperty(state, prop) {\n if (peek(state.base_, prop) !== void 0 || prop in state.base_) {\n state.assigned_[prop] = false;\n prepareCopy(state);\n markChanged(state);\n } else {\n delete state.assigned_[prop];\n }\n if (state.copy_) {\n delete state.copy_[prop];\n }\n return true;\n },\n // Note: We never coerce `desc.value` into an Immer draft, because we can't make\n // the same guarantee in ES5 mode.\n getOwnPropertyDescriptor(state, prop) {\n const owner = latest(state);\n const desc = Reflect.getOwnPropertyDescriptor(owner, prop);\n if (!desc)\n return desc;\n return {\n writable: true,\n configurable: state.type_ !== 1 || prop !== \"length\",\n enumerable: desc.enumerable,\n value: owner[prop]\n };\n },\n defineProperty() {\n die(11);\n },\n getPrototypeOf(state) {\n return getPrototypeOf(state.base_);\n },\n setPrototypeOf() {\n die(12);\n }\n };\n var arrayTraps = {};\n each(objectTraps, (key, fn) => {\n arrayTraps[key] = function() {\n arguments[0] = arguments[0][0];\n return fn.apply(this, arguments);\n };\n });\n arrayTraps.deleteProperty = function(state, prop) {\n if (false)\n die(13);\n return arrayTraps.set.call(this, state, prop, void 0);\n };\n arrayTraps.set = function(state, prop, value) {\n if (false)\n die(14);\n return objectTraps.set.call(this, state[0], prop, value, state[0]);\n };\n function peek(draft, prop) {\n const state = draft[DRAFT_STATE];\n const source = state ? latest(state) : draft;\n return source[prop];\n }\n function readPropFromProto(state, source, prop) {\n const desc = getDescriptorFromProto(source, prop);\n return desc ? `value` in desc ? desc.value : (\n // This is a very special case, if the prop is a getter defined by the\n // prototype, we should invoke it with the draft as context!\n desc.get?.call(state.draft_)\n ) : void 0;\n }\n function getDescriptorFromProto(source, prop) {\n if (!(prop in source))\n return void 0;\n let proto = getPrototypeOf(source);\n while (proto) {\n const desc = Object.getOwnPropertyDescriptor(proto, prop);\n if (desc)\n return desc;\n proto = getPrototypeOf(proto);\n }\n return void 0;\n }\n function markChanged(state) {\n if (!state.modified_) {\n state.modified_ = true;\n if (state.parent_) {\n markChanged(state.parent_);\n }\n }\n }\n function prepareCopy(state) {\n if (!state.copy_) {\n state.copy_ = shallowCopy(\n state.base_,\n state.scope_.immer_.useStrictShallowCopy_\n );\n }\n }\n var Immer2 = class {\n constructor(config) {\n this.autoFreeze_ = true;\n this.useStrictShallowCopy_ = false;\n this.produce = (base, recipe, patchListener) => {\n if (typeof base === \"function\" && typeof recipe !== \"function\") {\n const defaultBase = recipe;\n recipe = base;\n const self = this;\n return function curriedProduce(base2 = defaultBase, ...args) {\n return self.produce(base2, (draft) => recipe.call(this, draft, ...args));\n };\n }\n if (typeof recipe !== \"function\")\n die(6);\n if (patchListener !== void 0 && typeof patchListener !== \"function\")\n die(7);\n let result;\n if (isDraftable(base)) {\n const scope = enterScope(this);\n const proxy = createProxy(base, void 0);\n let hasError = true;\n try {\n result = recipe(proxy);\n hasError = false;\n } finally {\n if (hasError)\n revokeScope(scope);\n else\n leaveScope(scope);\n }\n usePatchesInScope(scope, patchListener);\n return processResult(result, scope);\n } else if (!base || typeof base !== \"object\") {\n result = recipe(base);\n if (result === void 0)\n result = base;\n if (result === NOTHING)\n result = void 0;\n if (this.autoFreeze_)\n freeze(result, true);\n if (patchListener) {\n const p = [];\n const ip = [];\n getPlugin(\"Patches\").generateReplacementPatches_(base, result, p, ip);\n patchListener(p, ip);\n }\n return result;\n } else\n die(1, base);\n };\n this.produceWithPatches = (base, recipe) => {\n if (typeof base === \"function\") {\n return (state, ...args) => this.produceWithPatches(state, (draft) => base(draft, ...args));\n }\n let patches, inversePatches;\n const result = this.produce(base, recipe, (p, ip) => {\n patches = p;\n inversePatches = ip;\n });\n return [result, patches, inversePatches];\n };\n if (typeof config?.autoFreeze === \"boolean\")\n this.setAutoFreeze(config.autoFreeze);\n if (typeof config?.useStrictShallowCopy === \"boolean\")\n this.setUseStrictShallowCopy(config.useStrictShallowCopy);\n }\n createDraft(base) {\n if (!isDraftable(base))\n die(8);\n if (isDraft(base))\n base = current(base);\n const scope = enterScope(this);\n const proxy = createProxy(base, void 0);\n proxy[DRAFT_STATE].isManual_ = true;\n leaveScope(scope);\n return proxy;\n }\n finishDraft(draft, patchListener) {\n const state = draft && draft[DRAFT_STATE];\n if (!state || !state.isManual_)\n die(9);\n const { scope_: scope } = state;\n usePatchesInScope(scope, patchListener);\n return processResult(void 0, scope);\n }\n /**\n * Pass true to automatically freeze all copies created by Immer.\n *\n * By default, auto-freezing is enabled.\n */\n setAutoFreeze(value) {\n this.autoFreeze_ = value;\n }\n /**\n * Pass true to enable strict shallow copy.\n *\n * By default, immer does not copy the object descriptors such as getter, setter and non-enumrable properties.\n */\n setUseStrictShallowCopy(value) {\n this.useStrictShallowCopy_ = value;\n }\n applyPatches(base, patches) {\n let i;\n for (i = patches.length - 1; i >= 0; i--) {\n const patch = patches[i];\n if (patch.path.length === 0 && patch.op === \"replace\") {\n base = patch.value;\n break;\n }\n }\n if (i > -1) {\n patches = patches.slice(i + 1);\n }\n const applyPatchesImpl = getPlugin(\"Patches\").applyPatches_;\n if (isDraft(base)) {\n return applyPatchesImpl(base, patches);\n }\n return this.produce(\n base,\n (draft) => applyPatchesImpl(draft, patches)\n );\n }\n };\n function createProxy(value, parent) {\n const draft = isMap(value) ? getPlugin(\"MapSet\").proxyMap_(value, parent) : isSet(value) ? getPlugin(\"MapSet\").proxySet_(value, parent) : createProxyProxy(value, parent);\n const scope = parent ? parent.scope_ : getCurrentScope();\n scope.drafts_.push(draft);\n return draft;\n }\n function current(value) {\n if (!isDraft(value))\n die(10, value);\n return currentImpl(value);\n }\n function currentImpl(value) {\n if (!isDraftable(value) || isFrozen(value))\n return value;\n const state = value[DRAFT_STATE];\n let copy;\n if (state) {\n if (!state.modified_)\n return state.base_;\n state.finalized_ = true;\n copy = shallowCopy(value, state.scope_.immer_.useStrictShallowCopy_);\n } else {\n copy = shallowCopy(value, true);\n }\n each(copy, (key, childValue) => {\n set(copy, key, currentImpl(childValue));\n });\n if (state) {\n state.finalized_ = false;\n }\n return copy;\n }\n var immer = new Immer2();\n var produce = immer.produce;\n\n // ../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/dequal@2.0.3/node_modules/dequal/dist/index.mjs\n var has2 = Object.prototype.hasOwnProperty;\n function find(iter, tar, key) {\n for (key of iter.keys()) {\n if (dequal(key, tar)) return key;\n }\n }\n function dequal(foo, bar) {\n var ctor, len, tmp;\n if (foo === bar) return true;\n if (foo && bar && (ctor = foo.constructor) === bar.constructor) {\n if (ctor === Date) return foo.getTime() === bar.getTime();\n if (ctor === RegExp) return foo.toString() === bar.toString();\n if (ctor === Array) {\n if ((len = foo.length) === bar.length) {\n while (len-- && dequal(foo[len], bar[len])) ;\n }\n return len === -1;\n }\n if (ctor === Set) {\n if (foo.size !== bar.size) {\n return false;\n }\n for (len of foo) {\n tmp = len;\n if (tmp && typeof tmp === \"object\") {\n tmp = find(bar, tmp);\n if (!tmp) return false;\n }\n if (!bar.has(tmp)) return false;\n }\n return true;\n }\n if (ctor === Map) {\n if (foo.size !== bar.size) {\n return false;\n }\n for (len of foo) {\n tmp = len[0];\n if (tmp && typeof tmp === \"object\") {\n tmp = find(bar, tmp);\n if (!tmp) return false;\n }\n if (!dequal(len[1], bar.get(tmp))) {\n return false;\n }\n }\n return true;\n }\n if (ctor === ArrayBuffer) {\n foo = new Uint8Array(foo);\n bar = new Uint8Array(bar);\n } else if (ctor === DataView) {\n if ((len = foo.byteLength) === bar.byteLength) {\n while (len-- && foo.getInt8(len) === bar.getInt8(len)) ;\n }\n return len === -1;\n }\n if (ArrayBuffer.isView(foo)) {\n if ((len = foo.byteLength) === bar.byteLength) {\n while (len-- && foo[len] === bar[len]) ;\n }\n return len === -1;\n }\n if (!ctor || typeof foo === \"object\") {\n len = 0;\n for (ctor in foo) {\n if (has2.call(foo, ctor) && ++len && !has2.call(bar, ctor)) return false;\n if (!(ctor in bar) || !dequal(foo[ctor], bar[ctor])) return false;\n }\n return Object.keys(bar).length === len;\n }\n }\n return foo !== foo && bar !== bar;\n }\n\n // ../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/@player-devtools+plugin@0.0.0/node_modules/@player-devtools/plugin/dist/index.mjs\n var useStateReducer = (reducer2, initialState) => {\n let state = initialState;\n const subscribers = /* @__PURE__ */ new Set();\n return {\n getState: () => state,\n /** Subscribe to state changes; returns an unsubscribe function. */\n subscribe(subscriber) {\n subscribers.add(subscriber);\n subscriber(state);\n return () => subscribers.delete(subscriber);\n },\n /** Dispatch an action through the reducer, then run side-effects. */\n dispatch(action) {\n const prevState = state;\n const nextState = reducer2(prevState, action);\n if (nextState !== prevState) {\n state = nextState;\n for (const sub of subscribers) sub(state);\n }\n }\n };\n };\n var containsInteraction = (interactions, interaction) => {\n return interactions.filter((i) => dequal(i, interaction)).length > 0;\n };\n var reducer = (state, transaction) => {\n switch (transaction.type) {\n case \"PLAYER_DEVTOOLS_PLAYER_INIT\":\n return produce(state, (draft) => {\n const { payload } = transaction;\n dsetAssign(draft, [\"plugins\"], payload.plugins);\n const message = {\n type: \"PLAYER_DEVTOOLS_PLAYER_INIT\",\n payload\n };\n draft.messages.push(message);\n });\n case \"PLAYER_DEVTOOLS_PLUGIN_DATA_CHANGE\":\n return produce(state, (draft) => {\n const { payload } = transaction;\n if (!payload.data) return state;\n try {\n dsetAssign(\n draft,\n [\"plugins\", transaction.payload.pluginID, \"flow\", \"data\"],\n transaction.payload.data\n );\n } catch {\n console.error(\"error setting data:\", transaction.payload.data);\n }\n const message = {\n type: \"PLAYER_DEVTOOLS_PLUGIN_DATA_CHANGE\",\n payload\n };\n draft.messages.push(message);\n });\n case \"PLAYER_DEVTOOLS_PLUGIN_INTERACTION\":\n return produce(state, (draft) => {\n if (containsInteraction(draft.interactions, transaction)) return state;\n dsetAssign(\n draft,\n [\"interactions\"],\n [...draft.interactions, transaction]\n );\n });\n case \"PLAYER_DEVTOOLS_SELECTED_PLAYER_CHANGE\": {\n const { playerID } = transaction.payload;\n if (!playerID) return state;\n return produce(state, (draft) => {\n dsetAssign(draft, [\"currentPlayer\"], playerID);\n });\n }\n default:\n return state;\n }\n };\n var INTERACTIONS2 = {\n PLAYER_SELECTED: \"player-selected\"\n };\n var PLUGIN_INACTIVE_WARNING = \"The plugin has been registered, but the Player development tools are not active. If you are working in a production environment, it is recommended to remove the plugin. To activate, enable through the browser extension popup for web or configure the FlipperClient for mobile.\";\n function generateUUID() {\n let d = (/* @__PURE__ */ new Date()).getTime();\n let d2 = typeof performance !== \"undefined\" && performance.now && performance.now() * 1e3 || 0;\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function(c) {\n let r = Math.random() * 16;\n if (d > 0) {\n r = (d + r) % 16 | 0;\n d = Math.floor(d / 16);\n } else {\n r = (d2 + r) % 16 | 0;\n d2 = Math.floor(d2 / 16);\n }\n return (c === \"x\" ? r : r & 3 | 8).toString(16);\n });\n }\n var NOOP_ID = -1;\n var genDataChangeTransaction = ({\n playerID,\n data,\n pluginID\n }) => {\n return {\n id: NOOP_ID,\n type: \"PLAYER_DEVTOOLS_PLUGIN_DATA_CHANGE\",\n payload: {\n pluginID,\n data\n },\n sender: playerID,\n context: \"player\",\n target: \"player\",\n timestamp: Date.now(),\n _messenger_: true\n };\n };\n var INITIAL_STATE = {\n messages: [],\n plugins: {},\n interactions: [],\n currentPlayer: \"\"\n };\n var DevtoolsPlugin = class {\n constructor(options) {\n this.options = options;\n this.name = \"DevtoolsPlugin\";\n this.loggedWarning = false;\n this.store = useStateReducer(reducer, INITIAL_STATE);\n this.lastProcessedInteraction = 0;\n this.store.subscribe(({ interactions }) => {\n if (this.lastProcessedInteraction < (interactions.length ?? 0)) {\n interactions.slice(this.lastProcessedInteraction).forEach(this.processInteraction.bind(this));\n }\n });\n }\n get pluginID() {\n return this.options.pluginData.id;\n }\n get playerID() {\n return this.options.playerID;\n }\n registerMessenger(messenger) {\n let lastMessageIndex = -1;\n return this.store.subscribe(({ messages }) => {\n const start = lastMessageIndex + 1;\n if (messages.length > start) {\n const newlyAdded = messages.slice(start);\n lastMessageIndex = messages.length - 1;\n for (const msg of newlyAdded) {\n messenger.sendMessage(msg);\n }\n }\n });\n }\n dispatchPlayerInit() {\n const transaction = {\n id: -1,\n type: \"PLAYER_DEVTOOLS_PLAYER_INIT\",\n payload: {\n plugins: {\n [this.pluginID]: this.options.pluginData\n }\n },\n sender: this.options.playerID,\n context: \"player\",\n target: \"player\",\n timestamp: Date.now(),\n _messenger_: true\n };\n this.store.dispatch(transaction);\n }\n // By default, we'll only write to the keys defined in data -- if undefined, data will be cleared\n dispatchDataUpdate(data) {\n const state = this.store.getState();\n const { plugins: plugins2 } = produce(this.store.getState(), (draft) => {\n if (!data)\n dsetAssign(draft, [\"plugins\", this.pluginID, \"flow\", \"data\"], data);\n else\n Object.entries(data).forEach(([key, value]) => {\n dsetAssign(\n draft,\n [\"plugins\", this.pluginID, \"flow\", \"data\", key],\n value\n );\n });\n });\n const newData = plugins2[this.pluginID].flow.data;\n if (dequal(state.plugins[this.pluginID]?.flow?.data, newData)) return;\n const transaction = genDataChangeTransaction({\n playerID: this.playerID,\n pluginID: this.pluginID,\n data: newData\n });\n this.store.dispatch(transaction);\n }\n checkIfDevtoolsIsActive() {\n const isActive = this.options.handler.checkIfDevtoolsIsActive();\n if (!isActive && !this.loggedWarning) {\n this.options.handler.log?.(PLUGIN_INACTIVE_WARNING);\n this.loggedWarning = true;\n }\n return isActive;\n }\n processInteraction(interaction) {\n this.options.handler.processInteraction(interaction);\n const {\n payload: { type, payload }\n } = interaction;\n if (type === INTERACTIONS2.PLAYER_SELECTED && payload) {\n this.store.dispatch({\n id: -1,\n type: \"PLAYER_DEVTOOLS_SELECTED_PLAYER_CHANGE\",\n payload: { playerID: payload },\n sender: this.playerID,\n context: \"player\",\n target: this.playerID,\n timestamp: Date.now(),\n _messenger_: true\n });\n }\n this.lastProcessedInteraction += 1;\n }\n apply(player) {\n if (!this.checkIfDevtoolsIsActive()) return;\n this.dispatchPlayerInit();\n }\n };\n\n // ../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/plugins/basic/core/src/plugin.ts\n var BasicDevtoolsPlugin = class extends DevtoolsPlugin {\n constructor(options) {\n super({\n ...options,\n pluginData: BasicPluginData\n });\n this.name = \"BasicDevtoolsPlugin\";\n this.data = {};\n this.playerConfig = {};\n this.logs = [];\n }\n apply(player) {\n this.logger = new WeakRef(player.logger);\n if (!this.checkIfDevtoolsIsActive()) return;\n this.options.pluginData.flow.data.playerConfig = {\n version: player.getVersion(),\n plugins: player.getPlugins().map((plugin) => plugin.name)\n };\n super.apply(player);\n this.playerConfig = {\n version: player.getVersion(),\n plugins: player.getPlugins().map((plugin) => plugin.name)\n };\n this.dispatchDataUpdate({ playerConfig: this.playerConfig });\n player.hooks.dataController.tap(this.name, (dataController) => {\n dataController.hooks.onUpdate.tap(this.name, (updates) => {\n this.data = produce(this.data, (draft) => {\n updates.forEach(({ binding, newValue }) => {\n dsetAssign(draft, [\"data\", ...binding.asArray()], newValue);\n });\n });\n this.dispatchDataUpdate({ data: this.data });\n });\n });\n player.logger.hooks.log.tap(this.name, (severity, message) => {\n this.logs = [...this.logs, { severity, message }];\n this.dispatchDataUpdate({ logs: this.logs });\n });\n player.hooks.onStart.tap(this.name, (f) => {\n this.flow = JSON.parse(JSON.stringify(f));\n this.dispatchDataUpdate({ flow: this.flow });\n });\n player.hooks.view.tap(this.name, (view) => {\n this.view = new WeakRef(view);\n });\n player.hooks.expressionEvaluator.tap(this.name, (evaluator) => {\n this.expressionEvaluator = new WeakRef(evaluator);\n });\n this.overrideFlow = player.start.bind(player);\n }\n evaluateExpression(expression) {\n const evaluator = this.expressionEvaluator?.deref();\n if (!evaluator) {\n return {\n id: generateUUID(),\n severity: \"error\",\n result: \"Expression evaluator not available\",\n expression\n };\n }\n try {\n evaluator.hooks.onError.intercept({\n call: (error) => {\n throw error;\n }\n });\n const evaluatorResult = evaluator.evaluate(expression);\n return {\n id: generateUUID(),\n result: evaluatorResult,\n expression\n };\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error ?? \"Something went wrong\");\n return {\n id: generateUUID(),\n severity: \"error\",\n result: message,\n expression\n };\n }\n }\n processInteraction(interaction) {\n super.processInteraction(interaction);\n const {\n payload: { type, payload }\n } = interaction;\n if (type === INTERACTIONS.EVALUATE_EXPRESSION && this.expressionEvaluator && payload) {\n const result = this.evaluateExpression(payload);\n const current2 = this.store.getState()?.plugins?.[this.pluginID]?.flow?.data?.history || [];\n this.dispatchDataUpdate({ history: [...current2, result] });\n return;\n }\n if (type === INTERACTIONS.OVERRIDE_FLOW && payload && this.overrideFlow) {\n let newFlow;\n try {\n newFlow = JSON.parse(payload);\n } catch (e) {\n this.logger?.deref()?.error(this.name, \"Error parsing new flow\", e);\n }\n if (newFlow) {\n this.overrideFlow(newFlow);\n }\n return;\n }\n }\n };\n return __toCommonJS(src_exports);\n})();\n","/**\n * Recursively assigns the contents of `source` into `target`, preserving\n * existing object and array references to maintain key insertion order.\n *\n * - **Objects**: keys present in `target` but absent in `source` are deleted\n * (unless `merge` is true), then each source entry is recursed into.\n * - **Arrays**: target is truncated or extended to match source length\n * (unless `merge` is true), then each element is recursed into.\n * - **Primitives / type mismatch**: source is returned directly; the caller\n * is responsible for assigning the return value.\n *\n * @param target - The existing value to assign into.\n * @param source - The new value to assign from.\n * @param merge - When true, stale keys and excess array elements are preserved\n * rather than deleted. Defaults to false.\n * @returns The mutated `target`, or `source` if types are incompatible.\n */\nfunction deepAssign<T, V>(target: T, source: V, merge: boolean = false) {\n if (Array.isArray(target) && Array.isArray(source)) {\n while (!merge && target.length > source.length) target.pop();\n // recurse and assign new values\n for (const [index, item] of source.entries()) {\n target[index] = deepAssign(target[index], item, merge);\n }\n } else if (\n target &&\n typeof target === \"object\" &&\n source &&\n typeof source === \"object\"\n ) {\n const record = target as Record<string, unknown>;\n\n // clear stale keys\n if (!merge)\n for (const key of Object.keys(target)) {\n if (!(key in source)) delete record[key];\n }\n // recurse and assign new values\n for (const [key, item] of Object.entries(source)) {\n record[key] = deepAssign(record[key], item, merge);\n }\n } else {\n // new data doesn't match the types, so there is no referential equality to retain\n return source;\n }\n\n return target;\n}\n\ntype Index = string | number;\n\n/**\n * Deep-sets a value at a key path on an object, preserving existing nested\n * object and array references to maintain key insertion order.\n *\n * Intermediate objects are auto-vivified as needed. The final assignment is\n * handled by {@link deepAssign}, which mutates the existing value in place\n * rather than replacing it wholesale.\n *\n * @param obj - The root object to assign into.\n * @param keys - Path of keys leading to the target location.\n * @param value - The value to assign at the path.\n * @param merge - When true, stale keys and excess array elements are preserved\n * rather than deleted. Defaults to false.\n * @throws If `keys` is empty or contains an undefined key.\n *\n * @see {@link https://github.com/lukeed/dset} for the original dset implementation that inspired this API\n */\nexport function dsetAssign<V>(\n obj: Record<Index, unknown>,\n keys: Array<Index>,\n value: V,\n merge: boolean = false,\n): void {\n const key = keys[keys.length - 1];\n if (!key) throw Error(\"Unable to assign at path containing undefined keys\");\n\n // Walk the path, auto-vivifying intermediate objects when necessary\n const target = keys\n .slice(0, -1)\n .reduce(\n (acc, key) => (acc[key] ??= {}) as Record<string | number, unknown>,\n obj,\n );\n\n // Deep assign the value into the target object for key\n target[key] = deepAssign(target[key], value, merge);\n}\n","export const errors =\n\tprocess.env.NODE_ENV !== \"production\"\n\t\t? [\n\t\t\t\t// All error codes, starting by 0:\n\t\t\t\tfunction(plugin: string) {\n\t\t\t\t\treturn `The plugin for '${plugin}' has not been loaded into Immer. To enable the plugin, import and call \\`enable${plugin}()\\` when initializing your application.`\n\t\t\t\t},\n\t\t\t\tfunction(thing: string) {\n\t\t\t\t\treturn `produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${thing}'`\n\t\t\t\t},\n\t\t\t\t\"This object has been frozen and should not be mutated\",\n\t\t\t\tfunction(data: any) {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t\"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? \" +\n\t\t\t\t\t\tdata\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t\t\"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.\",\n\t\t\t\t\"Immer forbids circular references\",\n\t\t\t\t\"The first or second argument to `produce` must be a function\",\n\t\t\t\t\"The third argument to `produce` must be a function or undefined\",\n\t\t\t\t\"First argument to `createDraft` must be a plain object, an array, or an immerable object\",\n\t\t\t\t\"First argument to `finishDraft` must be a draft returned by `createDraft`\",\n\t\t\t\tfunction(thing: string) {\n\t\t\t\t\treturn `'current' expects a draft, got: ${thing}`\n\t\t\t\t},\n\t\t\t\t\"Object.defineProperty() cannot be used on an Immer draft\",\n\t\t\t\t\"Object.setPrototypeOf() cannot be used on an Immer draft\",\n\t\t\t\t\"Immer only supports deleting array indices\",\n\t\t\t\t\"Immer only supports setting array indices and the 'length' property\",\n\t\t\t\tfunction(thing: string) {\n\t\t\t\t\treturn `'original' expects a draft, got: ${thing}`\n\t\t\t\t}\n\t\t\t\t// Note: if more errors are added, the errorOffset in Patches.ts should be increased\n\t\t\t\t// See Patches.ts for additional errors\n\t\t ]\n\t\t: []\n\nexport function die(error: number, ...args: any[]): never {\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\tconst e = errors[error]\n\t\tconst msg = typeof e === \"function\" ? e.apply(null, args as any) : e\n\t\tthrow new Error(`[Immer] ${msg}`)\n\t}\n\tthrow new Error(\n\t\t`[Immer] minified error nr: ${error}. Full error at: https://bit.ly/3cXEKWf`\n\t)\n}\n","import {\n\tDRAFT_STATE,\n\tDRAFTABLE,\n\tObjectish,\n\tDrafted,\n\tAnyObject,\n\tAnyMap,\n\tAnySet,\n\tImmerState,\n\tArchType,\n\tdie,\n\tStrictMode\n} from \"../internal\"\n\nexport const getPrototypeOf = Object.getPrototypeOf\n\n/** Returns true if the given value is an Immer draft */\n/*#__PURE__*/\nexport function isDraft(value: any): boolean {\n\treturn !!value && !!value[DRAFT_STATE]\n}\n\n/** Returns true if the given value can be drafted by Immer */\n/*#__PURE__*/\nexport function isDraftable(value: any): boolean {\n\tif (!value) return false\n\treturn (\n\t\tisPlainObject(value) ||\n\t\tArray.isArray(value) ||\n\t\t!!value[DRAFTABLE] ||\n\t\t!!value.constructor?.[DRAFTABLE] ||\n\t\tisMap(value) ||\n\t\tisSet(value)\n\t)\n}\n\nconst objectCtorString = Object.prototype.constructor.toString()\n/*#__PURE__*/\nexport function isPlainObject(value: any): boolean {\n\tif (!value || typeof value !== \"object\") return false\n\tconst proto = getPrototypeOf(value)\n\tif (proto === null) {\n\t\treturn true\n\t}\n\tconst Ctor =\n\t\tObject.hasOwnProperty.call(proto, \"constructor\") && proto.constructor\n\n\tif (Ctor === Object) return true\n\n\treturn (\n\t\ttypeof Ctor == \"function\" &&\n\t\tFunction.toString.call(Ctor) === objectCtorString\n\t)\n}\n\n/** Get the underlying object that is represented by the given draft */\n/*#__PURE__*/\nexport function original<T>(value: T): T | undefined\nexport function original(value: Drafted<any>): any {\n\tif (!isDraft(value)) die(15, value)\n\treturn value[DRAFT_STATE].base_\n}\n\n/**\n * Each iterates a map, set or array.\n * Or, if any other kind of object, all of its own properties.\n * Regardless whether they are enumerable or symbols\n */\nexport function each<T extends Objectish>(\n\tobj: T,\n\titer: (key: string | number, value: any, source: T) => void\n): void\nexport function each(obj: any, iter: any) {\n\tif (getArchtype(obj) === ArchType.Object) {\n\t\tReflect.ownKeys(obj).forEach(key => {\n\t\t\titer(key, obj[key], obj)\n\t\t})\n\t} else {\n\t\tobj.forEach((entry: any, index: any) => iter(index, entry, obj))\n\t}\n}\n\n/*#__PURE__*/\nexport function getArchtype(thing: any): ArchType {\n\tconst state: undefined | ImmerState = thing[DRAFT_STATE]\n\treturn state\n\t\t? state.type_\n\t\t: Array.isArray(thing)\n\t\t? ArchType.Array\n\t\t: isMap(thing)\n\t\t? ArchType.Map\n\t\t: isSet(thing)\n\t\t? ArchType.Set\n\t\t: ArchType.Object\n}\n\n/*#__PURE__*/\nexport function has(thing: any, prop: PropertyKey): boolean {\n\treturn getArchtype(thing) === ArchType.Map\n\t\t? thing.has(prop)\n\t\t: Object.prototype.hasOwnProperty.call(thing, prop)\n}\n\n/*#__PURE__*/\nexport function get(thing: AnyMap | AnyObject, prop: PropertyKey): any {\n\t// @ts-ignore\n\treturn getArchtype(thing) === ArchType.Map ? thing.get(prop) : thing[prop]\n}\n\n/*#__PURE__*/\nexport function set(thing: any, propOrOldValue: PropertyKey, value: any) {\n\tconst t = getArchtype(thing)\n\tif (t === ArchType.Map) thing.set(propOrOldValue, value)\n\telse if (t === ArchType.Set) {\n\t\tthing.add(value)\n\t} else thing[propOrOldValue] = value\n}\n\n/*#__PURE__*/\nexport function is(x: any, y: any): boolean {\n\t// From: https://github.com/facebook/fbjs/blob/c69904a511b900266935168223063dd8772dfc40/packages/fbjs/src/core/shallowEqual.js\n\tif (x === y) {\n\t\treturn x !== 0 || 1 / x === 1 / y\n\t} else {\n\t\treturn x !== x && y !== y\n\t}\n}\n\n/*#__PURE__*/\nexport function isMap(target: any): target is AnyMap {\n\treturn target instanceof Map\n}\n\n/*#__PURE__*/\nexport function isSet(target: any): target is AnySet {\n\treturn target instanceof Set\n}\n/*#__PURE__*/\nexport function latest(state: ImmerState): any {\n\treturn state.copy_ || state.base_\n}\n\n/*#__PURE__*/\nexport function shallowCopy(base: any, strict: StrictMode) {\n\tif (isMap(base)) {\n\t\treturn new Map(base)\n\t}\n\tif (isSet(base)) {\n\t\treturn new Set(base)\n\t}\n\tif (Array.isArray(base)) return Array.prototype.slice.call(base)\n\n\tconst isPlain = isPlainObject(base)\n\n\tif (strict === true || (strict === \"class_only\" && !isPlain)) {\n\t\t// Perform a strict copy\n\t\tconst descriptors = Object.getOwnPropertyDescriptors(base)\n\t\tdelete descriptors[DRAFT_STATE as any]\n\t\tlet keys = Reflect.ownKeys(descriptors)\n\t\tfor (let i = 0; i < keys.length; i++) {\n\t\t\tconst key: any = keys[i]\n\t\t\tconst desc = descriptors[key]\n\t\t\tif (desc.writable === false) {\n\t\t\t\tdesc.writable = true\n\t\t\t\tdesc.configurable = true\n\t\t\t}\n\t\t\t// like object.assign, we will read any _own_, get/set accessors. This helps in dealing\n\t\t\t// with libraries that trap values, like mobx or vue\n\t\t\t// unlike object.assign, non-enumerables will be copied as well\n\t\t\tif (desc.get || desc.set)\n\t\t\t\tdescriptors[key] = {\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t\twritable: true, // could live with !!desc.set as well here...\n\t\t\t\t\tenumerable: desc.enumerable,\n\t\t\t\t\tvalue: base[key]\n\t\t\t\t}\n\t\t}\n\t\treturn Object.create(getPrototypeOf(base), descriptors)\n\t} else {\n\t\t// perform a sloppy copy\n\t\tconst proto = getPrototypeOf(base)\n\t\tif (proto !== null && isPlain) {\n\t\t\treturn {...base} // assumption: better inner class optimization than the assign below\n\t\t}\n\t\tconst obj = Object.create(proto)\n\t\treturn Object.assign(obj, base)\n\t}\n}\n\n/**\n * Freezes draftable objects. Returns the original object.\n * By default freezes shallowly, but if the second argument is `true` it will freeze recursively.\n *\n * @param obj\n * @param deep\n */\nexport function freeze<T>(obj: T, deep?: boolean): T\nexport function freeze<T>(obj: any, deep: boolean = false): T {\n\tif (isFrozen(obj) || isDraft(obj) || !isDraftable(obj)) return obj\n\tif (getArchtype(obj) > 1 /* Map or Set */) {\n\t\t Object.defineProperties(obj, {\n set: {value: dontMutateFrozenCollections as any},\n add: {value: dontMutateFrozenCollections as any},\n clear: {value: dontMutateFrozenCollections as any},\n delete: {value: dontMutateFrozenCollections as any}\n })\n\t}\n\tObject.freeze(obj)\n\tif (deep)\n\t\t// See #590, don't recurse into non-enumerable / Symbol properties when freezing\n\t\t// So use Object.values (only string-like, enumerables) instead of each()\n\t\tObject.values(obj).forEach(value => freeze(value, true))\n\treturn obj\n}\n\nfunction dontMutateFrozenCollections() {\n\tdie(2)\n}\n\nexport function isFrozen(obj: any): boolean {\n\treturn Object.isFrozen(obj)\n}\n","import {\n\tImmerState,\n\tPatch,\n\tDrafted,\n\tImmerBaseState,\n\tAnyMap,\n\tAnySet,\n\tArchType,\n\tdie\n} from \"../internal\"\n\n/** Plugin utilities */\nconst plugins: {\n\tPatches?: {\n\t\tgeneratePatches_(\n\t\t\tstate: ImmerState,\n\t\t\tbasePath: PatchPath,\n\t\t\tpatches: Patch[],\n\t\t\tinversePatches: Patch[]\n\t\t): void\n\t\tgenerateReplacementPatches_(\n\t\t\tbase: any,\n\t\t\treplacement: any,\n\t\t\tpatches: Patch[],\n\t\t\tinversePatches: Patch[]\n\t\t): void\n\t\tapplyPatches_<T>(draft: T, patches: readonly Patch[]): T\n\t}\n\tMapSet?: {\n\t\tproxyMap_<T extends AnyMap>(target: T, parent?: ImmerState): T\n\t\tproxySet_<T extends AnySet>(target: T, parent?: ImmerState): T\n\t}\n} = {}\n\ntype Plugins = typeof plugins\n\nexport function getPlugin<K extends keyof Plugins>(\n\tpluginKey: K\n): Exclude<Plugins[K], undefined> {\n\tconst plugin = plugins[pluginKey]\n\tif (!plugin) {\n\t\tdie(0, pluginKey)\n\t}\n\t// @ts-ignore\n\treturn plugin\n}\n\nexport function loadPlugin<K extends keyof Plugins>(\n\tpluginKey: K,\n\timplementation: Plugins[K]\n): void {\n\tif (!plugins[pluginKey]) plugins[pluginKey] = implementation\n}\n/** Map / Set plugin */\n\nexport interface MapState extends ImmerBaseState {\n\ttype_: ArchType.Map\n\tcopy_: AnyMap | undefined\n\tassigned_: Map<any, boolean> | undefined\n\tbase_: AnyMap\n\trevoked_: boolean\n\tdraft_: Drafted<AnyMap, MapState>\n}\n\nexport interface SetState extends ImmerBaseState {\n\ttype_: ArchType.Set\n\tcopy_: AnySet | undefined\n\tbase_: AnySet\n\tdrafts_: Map<any, Drafted> // maps the original value to the draft value in the new set\n\trevoked_: boolean\n\tdraft_: Drafted<AnySet, SetState>\n}\n\n/** Patches plugin */\n\nexport type PatchPath = (string | number)[]\n","import {\n\tPatch,\n\tPatchListener,\n\tDrafted,\n\tImmer,\n\tDRAFT_STATE,\n\tImmerState,\n\tArchType,\n\tgetPlugin\n} from \"../internal\"\n\n/** Each scope represents a `produce` call. */\n\nexport interface ImmerScope {\n\tpatches_?: Patch[]\n\tinversePatches_?: Patch[]\n\tcanAutoFreeze_: boolean\n\tdrafts_: any[]\n\tparent_?: ImmerScope\n\tpatchListener_?: PatchListener\n\timmer_: Immer\n\tunfinalizedDrafts_: number\n}\n\nlet currentScope: ImmerScope | undefined\n\nexport function getCurrentScope() {\n\treturn currentScope!\n}\n\nfunction createScope(\n\tparent_: ImmerScope | undefined,\n\timmer_: Immer\n): ImmerScope {\n\treturn {\n\t\tdrafts_: [],\n\t\tparent_,\n\t\timmer_,\n\t\t// Whenever the modified draft contains a draft from another scope, we\n\t\t// need to prevent auto-freezing so the unowned draft can be finalized.\n\t\tcanAutoFreeze_: true,\n\t\tunfinalizedDrafts_: 0\n\t}\n}\n\nexport function usePatchesInScope(\n\tscope: ImmerScope,\n\tpatchListener?: PatchListener\n) {\n\tif (patchListener) {\n\t\tgetPlugin(\"Patches\") // assert we have the plugin\n\t\tscope.patches_ = []\n\t\tscope.inversePatches_ = []\n\t\tscope.patchListener_ = patchListener\n\t}\n}\n\nexport function revokeScope(scope: ImmerScope) {\n\tleaveScope(scope)\n\tscope.drafts_.forEach(revokeDraft)\n\t// @ts-ignore\n\tscope.drafts_ = null\n}\n\nexport function leaveScope(scope: ImmerScope) {\n\tif (scope === currentScope) {\n\t\tcurrentScope = scope.parent_\n\t}\n}\n\nexport function enterScope(immer: Immer) {\n\treturn (currentScope = createScope(currentScope, immer))\n}\n\nfunction revokeDraft(draft: Drafted) {\n\tconst state: ImmerState = draft[DRAFT_STATE]\n\tif (state.type_ === ArchType.Object || state.type_ === ArchType.Array)\n\t\tstate.revoke_()\n\telse state.revoked_ = true\n}\n","import {\n\tImmerScope,\n\tDRAFT_STATE,\n\tisDraftable,\n\tNOTHING,\n\tPatchPath,\n\teach,\n\thas,\n\tfreeze,\n\tImmerState,\n\tisDraft,\n\tSetState,\n\tset,\n\tArchType,\n\tgetPlugin,\n\tdie,\n\trevokeScope,\n\tisFrozen,\n\tisMap\n} from \"../internal\"\n\nexport function processResult(result: any, scope: ImmerScope) {\n\tscope.unfinalizedDrafts_ = scope.drafts_.length\n\tconst baseDraft = scope.drafts_![0]\n\tconst isReplaced = result !== undefined && result !== baseDraft\n\tif (isReplaced) {\n\t\tif (baseDraft[DRAFT_STATE].modified_) {\n\t\t\trevokeScope(scope)\n\t\t\tdie(4)\n\t\t}\n\t\tif (isDraftable(result)) {\n\t\t\t// Finalize the result in case it contains (or is) a subset of the draft.\n\t\t\tresult = finalize(scope, result)\n\t\t\tif (!scope.parent_) maybeFreeze(scope, result)\n\t\t}\n\t\tif (scope.patches_) {\n\t\t\tgetPlugin(\"Patches\").generateReplacementPatches_(\n\t\t\t\tbaseDraft[DRAFT_STATE].base_,\n\t\t\t\tresult,\n\t\t\t\tscope.patches_,\n\t\t\t\tscope.inversePatches_!\n\t\t\t)\n\t\t}\n\t} else {\n\t\t// Finalize the base draft.\n\t\tresult = finalize(scope, baseDraft, [])\n\t}\n\trevokeScope(scope)\n\tif (scope.patches_) {\n\t\tscope.patchListener_!(scope.patches_, scope.inversePatches_!)\n\t}\n\treturn result !== NOTHING ? result : undefined\n}\n\nfunction finalize(rootScope: ImmerScope, value: any, path?: PatchPath) {\n\t// Don't recurse in tho recursive data structures\n\tif (isFrozen(value)) return value\n\n\tconst state: ImmerState = value[DRAFT_STATE]\n\t// A plain object, might need freezing, might contain drafts\n\tif (!state) {\n\t\teach(value, (key, childValue) =>\n\t\t\tfinalizeProperty(rootScope, state, value, key, childValue, path)\n\t\t)\n\t\treturn value\n\t}\n\t// Never finalize drafts owned by another scope.\n\tif (state.scope_ !== rootScope) return value\n\t// Unmodified draft, return the (frozen) original\n\tif (!state.modified_) {\n\t\tmaybeFreeze(rootScope, state.base_, true)\n\t\treturn state.base_\n\t}\n\t// Not finalized yet, let's do that now\n\tif (!state.finalized_) {\n\t\tstate.finalized_ = true\n\t\tstate.scope_.unfinalizedDrafts_--\n\t\tconst result = state.copy_\n\t\t// Finalize all children of the copy\n\t\t// For sets we clone before iterating, otherwise we can get in endless loop due to modifying during iteration, see #628\n\t\t// To preserve insertion order in all cases we then clear the set\n\t\t// And we let finalizeProperty know it needs to re-add non-draft children back to the target\n\t\tlet resultEach = result\n\t\tlet isSet = false\n\t\tif (state.type_ === ArchType.Set) {\n\t\t\tresultEach = new Set(result)\n\t\t\tresult.clear()\n\t\t\tisSet = true\n\t\t}\n\t\teach(resultEach, (key, childValue) =>\n\t\t\tfinalizeProperty(rootScope, state, result, key, childValue, path, isSet)\n\t\t)\n\t\t// everything inside is frozen, we can freeze here\n\t\tmaybeFreeze(rootScope, result, false)\n\t\t// first time finalizing, let's create those patches\n\t\tif (path && rootScope.patches_) {\n\t\t\tgetPlugin(\"Patches\").generatePatches_(\n\t\t\t\tstate,\n\t\t\t\tpath,\n\t\t\t\trootScope.patches_,\n\t\t\t\trootScope.inversePatches_!\n\t\t\t)\n\t\t}\n\t}\n\treturn state.copy_\n}\n\nfunction finalizeProperty(\n\trootScope: ImmerScope,\n\tparentState: undefined | ImmerState,\n\ttargetObject: any,\n\tprop: string | number,\n\tchildValue: any,\n\trootPath?: PatchPath,\n\ttargetIsSet?: boolean\n) {\n\tif (process.env.NODE_ENV !== \"production\" && childValue === targetObject)\n\t\tdie(5)\n\tif (isDraft(childValue)) {\n\t\tconst path =\n\t\t\trootPath &&\n\t\t\tparentState &&\n\t\t\tparentState!.type_ !== ArchType.Set && // Set objects are atomic since they have no keys.\n\t\t\t!has((parentState as Exclude<ImmerState, SetState>).assigned_!, prop) // Skip deep patches for assigned keys.\n\t\t\t\t? rootPath!.concat(prop)\n\t\t\t\t: undefined\n\t\t// Drafts owned by `scope` are finalized here.\n\t\tconst res = finalize(rootScope, childValue, path)\n\t\tset(targetObject, prop, res)\n\t\t// Drafts from another scope must prevented to be frozen\n\t\t// if we got a draft back from finalize, we're in a nested produce and shouldn't freeze\n\t\tif (isDraft(res)) {\n\t\t\trootScope.canAutoFreeze_ = false\n\t\t} else return\n\t} else if (targetIsSet) {\n\t\ttargetObject.add(childValue)\n\t}\n\t// Search new objects for unfinalized drafts. Frozen objects should never contain drafts.\n\tif (isDraftable(childValue) && !isFrozen(childValue)) {\n\t\tif (!rootScope.immer_.autoFreeze_ && rootScope.unfinalizedDrafts_ < 1) {\n\t\t\t// optimization: if an object is not a draft, and we don't have to\n\t\t\t// deepfreeze everything, and we are sure that no drafts are left in the remaining object\n\t\t\t// cause we saw and finalized all drafts already; we can stop visiting the rest of the tree.\n\t\t\t// This benefits especially adding large data tree's without further processing.\n\t\t\t// See add-data.js perf test\n\t\t\treturn\n\t\t}\n\t\tfinalize(rootScope, childValue)\n\t\t// Immer deep freezes plain objects, so if there is no parent state, we freeze as well\n\t\t// Per #590, we never freeze symbolic properties. Just to make sure don't accidentally interfere\n\t\t// with other frameworks.\n\t\tif (\n\t\t\t(!parentState || !parentState.scope_.parent_) &&\n\t\t\ttypeof prop !== \"symbol\" &&\n\t\t\t(isMap(targetObject)\n\t\t\t\t? targetObject.has(prop)\n\t\t\t\t: Object.prototype.propertyIsEnumerable.call(targetObject, prop))\n\t\t)\n\t\t\tmaybeFreeze(rootScope, childValue)\n\t}\n}\n\nfunction maybeFreeze(scope: ImmerScope, value: any, deep = false) {\n\t// we never freeze for a non-root scope; as it would prevent pruning for drafts inside wrapping objects\n\tif (!scope.parent_ && scope.immer_.autoFreeze_ && scope.canAutoFreeze_) {\n\t\tfreeze(value, deep)\n\t}\n}\n","import {\n\teach,\n\thas,\n\tis,\n\tisDraftable,\n\tshallowCopy,\n\tlatest,\n\tImmerBaseState,\n\tImmerState,\n\tDrafted,\n\tAnyObject,\n\tAnyArray,\n\tObjectish,\n\tgetCurrentScope,\n\tgetPrototypeOf,\n\tDRAFT_STATE,\n\tdie,\n\tcreateProxy,\n\tArchType,\n\tImmerScope\n} from \"../internal\"\n\ninterface ProxyBaseState extends ImmerBaseState {\n\tassigned_: {\n\t\t[property: string]: boolean\n\t}\n\tparent_?: ImmerState\n\trevoke_(): void\n}\n\nexport interface ProxyObjectState extends ProxyBaseState {\n\ttype_: ArchType.Object\n\tbase_: any\n\tcopy_: any\n\tdraft_: Drafted<AnyObject, ProxyObjectState>\n}\n\nexport interface ProxyArrayState extends ProxyBaseState {\n\ttype_: ArchType.Array\n\tbase_: AnyArray\n\tcopy_: AnyArray | null\n\tdraft_: Drafted<AnyArray, ProxyArrayState>\n}\n\ntype ProxyState = ProxyObjectState | ProxyArrayState\n\n/**\n * Returns a new draft of the `base` object.\n *\n * The second argument is the parent draft-state (used internally).\n */\nexport function createProxyProxy<T extends Objectish>(\n\tbase: T,\n\tparent?: ImmerState\n): Drafted<T, ProxyState> {\n\tconst isArray = Array.isArray(base)\n\tconst state: ProxyState = {\n\t\ttype_: isArray ? ArchType.Array : (ArchType.Object as any),\n\t\t// Track which produce call this is associated with.\n\t\tscope_: parent ? parent.scope_ : getCurrentScope()!,\n\t\t// True for both shallow and deep changes.\n\t\tmodified_: false,\n\t\t// Used during finalization.\n\t\tfinalized_: false,\n\t\t// Track which properties have been assigned (true) or deleted (false).\n\t\tassigned_: {},\n\t\t// The parent draft state.\n\t\tparent_: parent,\n\t\t// The base state.\n\t\tbase_: base,\n\t\t// The base proxy.\n\t\tdraft_: null as any, // set below\n\t\t// The base copy with any updated values.\n\t\tcopy_: null,\n\t\t// Called by the `produce` function.\n\t\trevoke_: null as any,\n\t\tisManual_: false\n\t}\n\n\t// the traps must target something, a bit like the 'real' base.\n\t// but also, we need to be able to determine from the target what the relevant state is\n\t// (to avoid creating traps per instance to capture the state in closure,\n\t// and to avoid creating weird hidden properties as well)\n\t// So the trick is to use 'state' as the actual 'target'! (and make sure we intercept everything)\n\t// Note that in the case of an array, we put the state in an array to have better Reflect defaults ootb\n\tlet target: T = state as any\n\tlet traps: ProxyHandler<object | Array<any>> = objectTraps\n\tif (isArray) {\n\t\ttarget = [state] as any\n\t\ttraps = arrayTraps\n\t}\n\n\tconst {revoke, proxy} = Proxy.revocable(target, traps)\n\tstate.draft_ = proxy as any\n\tstate.revoke_ = revoke\n\treturn proxy as any\n}\n\n/**\n * Object drafts\n */\nexport const objectTraps: ProxyHandler<ProxyState> = {\n\tget(state, prop) {\n\t\tif (prop === DRAFT_STATE) return state\n\n\t\tconst source = latest(state)\n\t\tif (!has(source, prop)) {\n\t\t\t// non-existing or non-own property...\n\t\t\treturn readPropFromProto(state, source, prop)\n\t\t}\n\t\tconst value = source[prop]\n\t\tif (state.finalized_ || !isDraftable(value)) {\n\t\t\treturn value\n\t\t}\n\t\t// Check for existing draft in modified state.\n\t\t// Assigned values are never drafted. This catches any drafts we created, too.\n\t\tif (value === peek(state.base_, prop)) {\n\t\t\tprepareCopy(state)\n\t\t\treturn (state.copy_![prop as any] = createProxy(value, state))\n\t\t}\n\t\treturn value\n\t},\n\thas(state, prop) {\n\t\treturn prop in latest(state)\n\t},\n\townKeys(state) {\n\t\treturn Reflect.ownKeys(latest(state))\n\t},\n\tset(\n\t\tstate: ProxyObjectState,\n\t\tprop: string /* strictly not, but helps TS */,\n\t\tvalue\n\t) {\n\t\tconst desc = getDescriptorFromProto(latest(state), prop)\n\t\tif (desc?.set) {\n\t\t\t// special case: if this write is captured by a setter, we have\n\t\t\t// to trigger it with the correct context\n\t\t\tdesc.set.call(state.draft_, value)\n\t\t\treturn true\n\t\t}\n\t\tif (!state.modified_) {\n\t\t\t// the last check is because we need to be able to distinguish setting a non-existing to undefined (which is a change)\n\t\t\t// from setting an existing property with value undefined to undefined (which is not a change)\n\t\t\tconst current = peek(latest(state), prop)\n\t\t\t// special case, if we assigning the original value to a draft, we can ignore the assignment\n\t\t\tconst currentState: ProxyObjectState = current?.[DRAFT_STATE]\n\t\t\tif (currentState && currentState.base_ === value) {\n\t\t\t\tstate.copy_![prop] = value\n\t\t\t\tstate.assigned_[prop] = false\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tif (is(value, current) && (value !== undefined || has(state.base_, prop)))\n\t\t\t\treturn true\n\t\t\tprepareCopy(state)\n\t\t\tmarkChanged(state)\n\t\t}\n\n\t\tif (\n\t\t\t(state.copy_![prop] === value &&\n\t\t\t\t// special case: handle new props with value 'undefined'\n\t\t\t\t(value !== undefined || prop in state.copy_)) ||\n\t\t\t// special case: NaN\n\t\t\t(Number.isNaN(value) && Number.isNaN(state.copy_![prop]))\n\t\t)\n\t\t\treturn true\n\n\t\t// @ts-ignore\n\t\tstate.copy_![prop] = value\n\t\tstate.assigned_[prop] = true\n\t\treturn true\n\t},\n\tdeleteProperty(state, prop: string) {\n\t\t// The `undefined` check is a fast path for pre-existing keys.\n\t\tif (peek(state.base_, prop) !== undefined || prop in state.base_) {\n\t\t\tstate.assigned_[prop] = false\n\t\t\tprepareCopy(state)\n\t\t\tmarkChanged(state)\n\t\t} else {\n\t\t\t// if an originally not assigned property was deleted\n\t\t\tdelete state.assigned_[prop]\n\t\t}\n\t\tif (state.copy_) {\n\t\t\tdelete state.copy_[prop]\n\t\t}\n\t\treturn true\n\t},\n\t// Note: We never coerce `desc.value` into an Immer draft, because we can't make\n\t// the same guarantee in ES5 mode.\n\tgetOwnPropertyDescriptor(state, prop) {\n\t\tconst owner = latest(state)\n\t\tconst desc = Reflect.getOwnPropertyDescriptor(owner, prop)\n\t\tif (!desc) return desc\n\t\treturn {\n\t\t\twritable: true,\n\t\t\tconfigurable: state.type_ !== ArchType.Array || prop !== \"length\",\n\t\t\tenumerable: desc.enumerable,\n\t\t\tvalue: owner[prop]\n\t\t}\n\t},\n\tdefineProperty() {\n\t\tdie(11)\n\t},\n\tgetPrototypeOf(state) {\n\t\treturn getPrototypeOf(state.base_)\n\t},\n\tsetPrototypeOf() {\n\t\tdie(12)\n\t}\n}\n\n/**\n * Array drafts\n */\n\nconst arrayTraps: ProxyHandler<[ProxyArrayState]> = {}\neach(objectTraps, (key, fn) => {\n\t// @ts-ignore\n\tarrayTraps[key] = function() {\n\t\targuments[0] = arguments[0][0]\n\t\treturn fn.apply(this, arguments)\n\t}\n})\narrayTraps.deleteProperty = function(state, prop) {\n\tif (process.env.NODE_ENV !== \"production\" && isNaN(parseInt(prop as any)))\n\t\tdie(13)\n\t// @ts-ignore\n\treturn arrayTraps.set!.call(this, state, prop, undefined)\n}\narrayTraps.set = function(state, prop, value) {\n\tif (\n\t\tprocess.env.NODE_ENV !== \"production\" &&\n\t\tprop !== \"length\" &&\n\t\tisNaN(parseInt(prop as any))\n\t)\n\t\tdie(14)\n\treturn objectTraps.set!.call(this, state[0], prop, value, state[0])\n}\n\n// Access a property without creating an Immer draft.\nfunction peek(draft: Drafted, prop: PropertyKey) {\n\tconst state = draft[DRAFT_STATE]\n\tconst source = state ? latest(state) : draft\n\treturn source[prop]\n}\n\nfunction readPropFromProto(state: ImmerState, source: any, prop: PropertyKey) {\n\tconst desc = getDescriptorFromProto(source, prop)\n\treturn desc\n\t\t? `value` in desc\n\t\t\t? desc.value\n\t\t\t: // This is a very special case, if the prop is a getter defined by the\n\t\t\t // prototype, we should invoke it with the draft as context!\n\t\t\t desc.get?.call(state.draft_)\n\t\t: undefined\n}\n\nfunction getDescriptorFromProto(\n\tsource: any,\n\tprop: PropertyKey\n): PropertyDescriptor | undefined {\n\t// 'in' checks proto!\n\tif (!(prop in source)) return undefined\n\tlet proto = getPrototypeOf(source)\n\twhile (proto) {\n\t\tconst desc = Object.getOwnPropertyDescriptor(proto, prop)\n\t\tif (desc) return desc\n\t\tproto = getPrototypeOf(proto)\n\t}\n\treturn undefined\n}\n\nexport function markChanged(state: ImmerState) {\n\tif (!state.modified_) {\n\t\tstate.modified_ = true\n\t\tif (state.parent_) {\n\t\t\tmarkChanged(state.parent_)\n\t\t}\n\t}\n}\n\nexport function prepareCopy(state: {\n\tbase_: any\n\tcopy_: any\n\tscope_: ImmerScope\n}) {\n\tif (!state.copy_) {\n\t\tstate.copy_ = shallowCopy(\n\t\t\tstate.base_,\n\t\t\tstate.scope_.immer_.useStrictShallowCopy_\n\t\t)\n\t}\n}\n","import {\n\tIProduceWithPatches,\n\tIProduce,\n\tImmerState,\n\tDrafted,\n\tisDraftable,\n\tprocessResult,\n\tPatch,\n\tObjectish,\n\tDRAFT_STATE,\n\tDraft,\n\tPatchListener,\n\tisDraft,\n\tisMap,\n\tisSet,\n\tcreateProxyProxy,\n\tgetPlugin,\n\tdie,\n\tenterScope,\n\trevokeScope,\n\tleaveScope,\n\tusePatchesInScope,\n\tgetCurrentScope,\n\tNOTHING,\n\tfreeze,\n\tcurrent\n} from \"../internal\"\n\ninterface ProducersFns {\n\tproduce: IProduce\n\tproduceWithPatches: IProduceWithPatches\n}\n\nexport type StrictMode = boolean | \"class_only\";\n\nexport class Immer implements ProducersFns {\n\tautoFreeze_: boolean = true\n\tuseStrictShallowCopy_: StrictMode = false\n\n\tconstructor(config?: {\n\t\tautoFreeze?: boolean\n\t\tuseStrictShallowCopy?: StrictMode\n\t}) {\n\t\tif (typeof config?.autoFreeze === \"boolean\")\n\t\t\tthis.setAutoFreeze(config!.autoFreeze)\n\t\tif (typeof config?.useStrictShallowCopy === \"boolean\")\n\t\t\tthis.setUseStrictShallowCopy(config!.useStrictShallowCopy)\n\t}\n\n\t/**\n\t * The `produce` function takes a value and a \"recipe function\" (whose\n\t * return value often depends on the base state). The recipe function is\n\t * free to mutate its first argument however it wants. All mutations are\n\t * only ever applied to a __copy__ of the base state.\n\t *\n\t * Pass only a function to create a \"curried producer\" which relieves you\n\t * from passing the recipe function every time.\n\t *\n\t * Only plain objects and arrays are made mutable. All other objects are\n\t * considered uncopyable.\n\t *\n\t * Note: This function is __bound__ to its `Immer` instance.\n\t *\n\t * @param {any} base - the initial state\n\t * @param {Function} recipe - function that receives a proxy of the base state as first argument and which can be freely modified\n\t * @param {Function} patchListener - optional function that will be called with all the patches produced here\n\t * @returns {any} a new state, or the initial state if nothing was modified\n\t */\n\tproduce: IProduce = (base: any, recipe?: any, patchListener?: any) => {\n\t\t// curried invocation\n\t\tif (typeof base === \"function\" && typeof recipe !== \"function\") {\n\t\t\tconst defaultBase = recipe\n\t\t\trecipe = base\n\n\t\t\tconst self = this\n\t\t\treturn function curriedProduce(\n\t\t\t\tthis: any,\n\t\t\t\tbase = defaultBase,\n\t\t\t\t...args: any[]\n\t\t\t) {\n\t\t\t\treturn self.produce(base, (draft: Drafted) => recipe.call(this, draft, ...args)) // prettier-ignore\n\t\t\t}\n\t\t}\n\n\t\tif (typeof recipe !== \"function\") die(6)\n\t\tif (patchListener !== undefined && typeof patchListener !== \"function\")\n\t\t\tdie(7)\n\n\t\tlet result\n\n\t\t// Only plain objects, arrays, and \"immerable classes\" are drafted.\n\t\tif (isDraftable(base)) {\n\t\t\tconst scope = enterScope(this)\n\t\t\tconst proxy = createProxy(base, undefined)\n\t\t\tlet hasError = true\n\t\t\ttry {\n\t\t\t\tresult = recipe(proxy)\n\t\t\t\thasError = false\n\t\t\t} finally {\n\t\t\t\t// finally instead of catch + rethrow better preserves original stack\n\t\t\t\tif (hasError) revokeScope(scope)\n\t\t\t\telse leaveScope(scope)\n\t\t\t}\n\t\t\tusePatchesInScope(scope, patchListener)\n\t\t\treturn processResult(result, scope)\n\t\t} else if (!base || typeof base !== \"object\") {\n\t\t\tresult = recipe(base)\n\t\t\tif (result === undefined) result = base\n\t\t\tif (result === NOTHING) result = undefined\n\t\t\tif (this.autoFreeze_) freeze(result, true)\n\t\t\tif (patchListener) {\n\t\t\t\tconst p: Patch[] = []\n\t\t\t\tconst ip: Patch[] = []\n\t\t\t\tgetPlugin(\"Patches\").generateReplacementPatches_(base, result, p, ip)\n\t\t\t\tpatchListener(p, ip)\n\t\t\t}\n\t\t\treturn result\n\t\t} else die(1, base)\n\t}\n\n\tproduceWithPatches: IProduceWithPatches = (base: any, recipe?: any): any => {\n\t\t// curried invocation\n\t\tif (typeof base === \"function\") {\n\t\t\treturn (state: any, ...args: any[]) =>\n\t\t\t\tthis.produceWithPatches(state, (draft: any) => base(draft, ...args))\n\t\t}\n\n\t\tlet patches: Patch[], inversePatches: Patch[]\n\t\tconst result = this.produce(base, recipe, (p: Patch[], ip: Patch[]) => {\n\t\t\tpatches = p\n\t\t\tinversePatches = ip\n\t\t})\n\t\treturn [result, patches!, inversePatches!]\n\t}\n\n\tcreateDraft<T extends Objectish>(base: T): Draft<T> {\n\t\tif (!isDraftable(base)) die(8)\n\t\tif (isDraft(base)) base = current(base)\n\t\tconst scope = enterScope(this)\n\t\tconst proxy = createProxy(base, undefined)\n\t\tproxy[DRAFT_STATE].isManual_ = true\n\t\tleaveScope(scope)\n\t\treturn proxy as any\n\t}\n\n\tfinishDraft<D extends Draft<any>>(\n\t\tdraft: D,\n\t\tpatchListener?: PatchListener\n\t): D extends Draft<infer T> ? T : never {\n\t\tconst state: ImmerState = draft && (draft as any)[DRAFT_STATE]\n\t\tif (!state || !state.isManual_) die(9)\n\t\tconst {scope_: scope} = state\n\t\tusePatchesInScope(scope, patchListener)\n\t\treturn processResult(undefined, scope)\n\t}\n\n\t/**\n\t * Pass true to automatically freeze all copies created by Immer.\n\t *\n\t * By default, auto-freezing is enabled.\n\t */\n\tsetAutoFreeze(value: boolean) {\n\t\tthis.autoFreeze_ = value\n\t}\n\n\t/**\n\t * Pass true to enable strict shallow copy.\n\t *\n\t * By default, immer does not copy the object descriptors such as getter, setter and non-enumrable properties.\n\t */\n\tsetUseStrictShallowCopy(value: StrictMode) {\n\t\tthis.useStrictShallowCopy_ = value\n\t}\n\n\tapplyPatches<T extends Objectish>(base: T, patches: readonly Patch[]): T {\n\t\t// If a patch replaces the entire state, take that replacement as base\n\t\t// before applying patches\n\t\tlet i: number\n\t\tfor (i = patches.length - 1; i >= 0; i--) {\n\t\t\tconst patch = patches[i]\n\t\t\tif (patch.path.length === 0 && patch.op === \"replace\") {\n\t\t\t\tbase = patch.value\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\t// If there was a patch that replaced the entire state, start from the\n\t\t// patch after that.\n\t\tif (i > -1) {\n\t\t\tpatches = patches.slice(i + 1)\n\t\t}\n\n\t\tconst applyPatchesImpl = getPlugin(\"Patches\").applyPatches_\n\t\tif (isDraft(base)) {\n\t\t\t// N.B: never hits if some patch a replacement, patches are never drafts\n\t\t\treturn applyPatchesImpl(base, patches)\n\t\t}\n\t\t// Otherwise, produce a copy of the base state.\n\t\treturn this.produce(base, (draft: Drafted) =>\n\t\t\tapplyPatchesImpl(draft, patches)\n\t\t)\n\t}\n}\n\nexport function createProxy<T extends Objectish>(\n\tvalue: T,\n\tparent?: ImmerState\n): Drafted<T, ImmerState> {\n\t// precondition: createProxy should be guarded by isDraftable, so we know we can safely draft\n\tconst draft: Drafted = isMap(value)\n\t\t? getPlugin(\"MapSet\").proxyMap_(value, parent)\n\t\t: isSet(value)\n\t\t? getPlugin(\"MapSet\").proxySet_(value, parent)\n\t\t: createProxyProxy(value, parent)\n\n\tconst scope = parent ? parent.scope_ : getCurrentScope()\n\tscope.drafts_.push(draft)\n\treturn draft\n}\n","import {\n\tdie,\n\tisDraft,\n\tshallowCopy,\n\teach,\n\tDRAFT_STATE,\n\tset,\n\tImmerState,\n\tisDraftable,\n\tisFrozen\n} from \"../internal\"\n\n/** Takes a snapshot of the current state of a draft and finalizes it (but without freezing). This is a great utility to print the current state during debugging (no Proxies in the way). The output of current can also be safely leaked outside the producer. */\nexport function current<T>(value: T): T\nexport function current(value: any): any {\n\tif (!isDraft(value)) die(10, value)\n\treturn currentImpl(value)\n}\n\nfunction currentImpl(value: any): any {\n\tif (!isDraftable(value) || isFrozen(value)) return value\n\tconst state: ImmerState | undefined = value[DRAFT_STATE]\n\tlet copy: any\n\tif (state) {\n\t\tif (!state.modified_) return state.base_\n\t\t// Optimization: avoid generating new drafts during copying\n\t\tstate.finalized_ = true\n\t\tcopy = shallowCopy(value, state.scope_.immer_.useStrictShallowCopy_)\n\t} else {\n\t\tcopy = shallowCopy(value, true)\n\t}\n\t// recurse\n\teach(copy, (key, childValue) => {\n\t\tset(copy, key, currentImpl(childValue))\n\t})\n\tif (state) {\n\t\tstate.finalized_ = false\n\t}\n\treturn copy\n}\n","var has = Object.prototype.hasOwnProperty;\n\nfunction find(iter, tar, key) {\n\tfor (key of iter.keys()) {\n\t\tif (dequal(key, tar)) return key;\n\t}\n}\n\nexport function dequal(foo, bar) {\n\tvar ctor, len, tmp;\n\tif (foo === bar) return true;\n\n\tif (foo && bar && (ctor=foo.constructor) === bar.constructor) {\n\t\tif (ctor === Date) return foo.getTime() === bar.getTime();\n\t\tif (ctor === RegExp) return foo.toString() === bar.toString();\n\n\t\tif (ctor === Array) {\n\t\t\tif ((len=foo.length) === bar.length) {\n\t\t\t\twhile (len-- && dequal(foo[len], bar[len]));\n\t\t\t}\n\t\t\treturn len === -1;\n\t\t}\n\n\t\tif (ctor === Set) {\n\t\t\tif (foo.size !== bar.size) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tfor (len of foo) {\n\t\t\t\ttmp = len;\n\t\t\t\tif (tmp && typeof tmp === 'object') {\n\t\t\t\t\ttmp = find(bar, tmp);\n\t\t\t\t\tif (!tmp) return false;\n\t\t\t\t}\n\t\t\t\tif (!bar.has(tmp)) return false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tif (ctor === Map) {\n\t\t\tif (foo.size !== bar.size) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tfor (len of foo) {\n\t\t\t\ttmp = len[0];\n\t\t\t\tif (tmp && typeof tmp === 'object') {\n\t\t\t\t\ttmp = find(bar, tmp);\n\t\t\t\t\tif (!tmp) return false;\n\t\t\t\t}\n\t\t\t\tif (!dequal(len[1], bar.get(tmp))) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tif (ctor === ArrayBuffer) {\n\t\t\tfoo = new Uint8Array(foo);\n\t\t\tbar = new Uint8Array(bar);\n\t\t} else if (ctor === DataView) {\n\t\t\tif ((len=foo.byteLength) === bar.byteLength) {\n\t\t\t\twhile (len-- && foo.getInt8(len) === bar.getInt8(len));\n\t\t\t}\n\t\t\treturn len === -1;\n\t\t}\n\n\t\tif (ArrayBuffer.isView(foo)) {\n\t\t\tif ((len=foo.byteLength) === bar.byteLength) {\n\t\t\t\twhile (len-- && foo[len] === bar[len]);\n\t\t\t}\n\t\t\treturn len === -1;\n\t\t}\n\n\t\tif (!ctor || typeof foo === 'object') {\n\t\t\tlen = 0;\n\t\t\tfor (ctor in foo) {\n\t\t\t\tif (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;\n\t\t\t\tif (!(ctor in bar) || !dequal(foo[ctor], bar[ctor])) return false;\n\t\t\t}\n\t\t\treturn Object.keys(bar).length === len;\n\t\t}\n\t}\n\n\treturn foo !== foo && bar !== bar;\n}\n","export function generateUUID(): string {\n // Public Domain/MIT\n let d = new Date().getTime(); //Timestamp\n let d2 =\n (typeof performance !== \"undefined\" &&\n performance.now &&\n performance.now() * 1000) ||\n 0; //Time in microseconds since page-load or 0 if unsupported\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function (c) {\n let r = Math.random() * 16; //random number between 0 and 16\n if (d > 0) {\n //Use timestamp until depleted\n r = (d + r) % 16 | 0;\n d = Math.floor(d / 16);\n } else {\n //Use microseconds since page-load if supported\n r = (d2 + r) % 16 | 0;\n d2 = Math.floor(d2 / 16);\n }\n return (c === \"x\" ? r : (r & 0x3) | 0x8).toString(16);\n });\n}\n","export { BasicDevtoolsPlugin } from \"./plugin\";\n","export const PLUGIN_ID = \"player-ui-basic-devtools-plugin\";\n\nexport const VIEWS_IDS = {\n CONFIG: \"Config\",\n FLOW: \"Flow\",\n LOGS: \"Logs\",\n CONSOLE: \"Console\",\n EDITOR: \"Editor\",\n};\n\nexport const INTERACTIONS = {\n EVALUATE_EXPRESSION: \"evaluate-expression\",\n OVERRIDE_FLOW: \"override-flow\",\n};\n","{\n \"id\": \"player-ui-basic-devtools-plugin\",\n \"views\": [\n {\n \"id\": \"Config\",\n \"type\": \"stacked-view\",\n \"header\": {\n \"asset\": {\n \"id\": \"Config-header\",\n \"type\": \"navigation\",\n \"values\": [\n {\n \"asset\": {\n \"id\": \"Config-header-values-0\",\n \"type\": \"action\",\n \"value\": \"Config\",\n \"label\": {\n \"asset\": {\n \"id\": \"Config-header-values-0-label\",\n \"type\": \"text\",\n \"value\": \"Config\"\n }\n }\n }\n },\n {\n \"asset\": {\n \"id\": \"Config-header-values-1\",\n \"type\": \"action\",\n \"value\": \"Flow\",\n \"label\": {\n \"asset\": {\n \"id\": \"Config-header-values-1-label\",\n \"type\": \"text\",\n \"value\": \"Flow\"\n }\n }\n }\n },\n {\n \"asset\": {\n \"id\": \"Config-header-values-2\",\n \"type\": \"action\",\n \"value\": \"Logs\",\n \"label\": {\n \"asset\": {\n \"id\": \"Config-header-values-2-label\",\n \"type\": \"text\",\n \"value\": \"Logs\"\n }\n }\n }\n },\n {\n \"asset\": {\n \"id\": \"Config-header-values-3\",\n \"type\": \"action\",\n \"value\": \"Console\",\n \"label\": {\n \"asset\": {\n \"id\": \"Config-header-values-3-label\",\n \"type\": \"text\",\n \"value\": \"Console\"\n }\n }\n }\n },\n {\n \"asset\": {\n \"id\": \"Config-header-values-4\",\n \"type\": \"action\",\n \"value\": \"Editor\",\n \"label\": {\n \"asset\": {\n \"id\": \"Config-header-values-4-label\",\n \"type\": \"text\",\n \"value\": \"Editor\"\n }\n }\n }\n }\n ]\n }\n },\n \"main\": {\n \"asset\": {\n \"id\": \"Config-main\",\n \"type\": \"object-inspector\",\n \"binding\": \"playerConfig\",\n \"label\": {\n \"asset\": {\n \"id\": \"Config-main-label\",\n \"type\": \"text\",\n \"value\": \"Config\"\n }\n }\n }\n }\n },\n {\n \"id\": \"Flow\",\n \"type\": \"stacked-view\",\n \"header\": {\n \"asset\": {\n \"id\": \"Flow-header\",\n \"type\": \"navigation\",\n \"values\": [\n {\n \"asset\": {\n \"id\": \"Flow-header-values-0\",\n \"type\": \"action\",\n \"value\": \"Config\",\n \"label\": {\n \"asset\": {\n \"id\": \"Flow-header-values-0-label\",\n \"type\": \"text\",\n \"value\": \"Config\"\n }\n }\n }\n },\n {\n \"asset\": {\n \"id\": \"Flow-header-values-1\",\n \"type\": \"action\",\n \"value\": \"Flow\",\n \"label\": {\n \"asset\": {\n \"id\": \"Flow-header-values-1-label\",\n \"type\": \"text\",\n \"value\": \"Flow\"\n }\n }\n }\n },\n {\n \"asset\": {\n \"id\": \"Flow-header-values-2\",\n \"type\": \"action\",\n \"value\": \"Logs\",\n \"label\": {\n \"asset\": {\n \"id\": \"Flow-header-values-2-label\",\n \"type\": \"text\",\n \"value\": \"Logs\"\n }\n }\n }\n },\n {\n \"asset\": {\n \"id\": \"Flow-header-values-3\",\n \"type\": \"action\",\n \"value\": \"Console\",\n \"label\": {\n \"asset\": {\n \"id\": \"Flow-header-values-3-label\",\n \"type\": \"text\",\n \"value\": \"Console\"\n }\n }\n }\n },\n {\n \"asset\": {\n \"id\": \"Flow-header-values-4\",\n \"type\": \"action\",\n \"value\": \"Editor\",\n \"label\": {\n \"asset\": {\n \"id\": \"Flow-header-values-4-label\",\n \"type\": \"text\",\n \"value\": \"Editor\"\n }\n }\n }\n }\n ]\n }\n },\n \"main\": {\n \"asset\": {\n \"id\": \"Flow-main\",\n \"type\": \"object-inspector\",\n \"filter\": true,\n \"binding\": \"flow\",\n \"label\": {\n \"asset\": {\n \"id\": \"Flow-main-label\",\n \"type\": \"text\",\n \"value\": \"Flow\"\n }\n }\n }\n },\n \"footer\": {\n \"asset\": {\n \"id\": \"Flow-footer\",\n \"type\": \"copy-to-clipboard\",\n \"binding\": \"flow\",\n \"label\": {\n \"asset\": {\n \"id\": \"Flow-footer-label\",\n \"type\": \"text\",\n \"value\": \"Copy flow to the clipboard\"\n }\n }\n }\n }\n },\n {\n \"id\": \"Logs\",\n \"type\": \"stacked-view\",\n \"header\": {\n \"asset\": {\n \"id\": \"Logs-header\",\n \"type\": \"navigation\",\n \"values\": [\n {\n \"asset\": {\n \"id\": \"Logs-header-values-0\",\n \"type\": \"action\",\n \"value\": \"Config\",\n \"label\": {\n \"asset\": {\n \"id\": \"Logs-header-values-0-label\",\n \"type\": \"text\",\n \"value\": \"Config\"\n }\n }\n }\n },\n {\n \"asset\": {\n \"id\": \"Logs-header-values-1\",\n \"type\": \"action\",\n \"value\": \"Flow\",\n \"label\": {\n \"asset\": {\n \"id\": \"Logs-header-values-1-label\",\n \"type\": \"text\",\n \"value\": \"Flow\"\n }\n }\n }\n },\n {\n \"asset\": {\n \"id\": \"Logs-header-values-2\",\n \"type\": \"action\",\n \"value\": \"Logs\",\n \"label\": {\n \"asset\": {\n \"id\": \"Logs-header-values-2-label\",\n \"type\": \"text\",\n \"value\": \"Logs\"\n }\n }\n }\n },\n {\n \"asset\": {\n \"id\": \"Logs-header-values-3\",\n \"type\": \"action\",\n \"value\": \"Console\",\n \"label\": {\n \"asset\": {\n \"id\": \"Logs-header-values-3-label\",\n \"type\": \"text\",\n \"value\": \"Console\"\n }\n }\n }\n },\n {\n \"asset\": {\n \"id\": \"Logs-header-values-4\",\n \"type\": \"action\",\n \"value\": \"Editor\",\n \"label\": {\n \"asset\": {\n \"id\": \"Logs-header-values-4-label\",\n \"type\": \"text\",\n \"value\": \"Editor\"\n }\n }\n }\n }\n ]\n }\n },\n \"main\": {\n \"asset\": {\n \"id\": \"Logs-main\",\n \"type\": \"table\",\n \"binding\": \"logs\"\n }\n }\n },\n {\n \"id\": \"Console\",\n \"type\": \"stacked-view\",\n \"header\": {\n \"asset\": {\n \"id\": \"Console-header\",\n \"type\": \"navigation\",\n \"values\": [\n {\n \"asset\": {\n \"id\": \"Console-header-values-0\",\n \"type\": \"action\",\n \"value\": \"Config\",\n \"label\": {\n \"asset\": {\n \"id\": \"Console-header-values-0-label\",\n \"type\": \"text\",\n \"value\": \"Config\"\n }\n }\n }\n },\n {\n \"asset\": {\n \"id\": \"Console-header-values-1\",\n \"type\": \"action\",\n \"value\": \"Flow\",\n \"label\": {\n \"asset\": {\n \"id\": \"Console-header-values-1-label\",\n \"type\": \"text\",\n \"value\": \"Flow\"\n }\n }\n }\n },\n {\n \"asset\": {\n \"id\": \"Console-header-values-2\",\n \"type\": \"action\",\n \"value\": \"Logs\",\n \"label\": {\n \"asset\": {\n \"id\": \"Console-header-values-2-label\",\n \"type\": \"text\",\n \"value\": \"Logs\"\n }\n }\n }\n },\n {\n \"asset\": {\n \"id\": \"Console-header-values-3\",\n \"type\": \"action\",\n \"value\": \"Console\",\n \"label\": {\n \"asset\": {\n \"id\": \"Console-header-values-3-label\",\n \"type\": \"text\",\n \"value\": \"Console\"\n }\n }\n }\n },\n {\n \"asset\": {\n \"id\": \"Console-header-values-4\",\n \"type\": \"action\",\n \"value\": \"Editor\",\n \"label\": {\n \"asset\": {\n \"id\": \"Console-header-values-4-label\",\n \"type\": \"text\",\n \"value\": \"Editor\"\n }\n }\n }\n }\n ]\n }\n },\n \"main\": {\n \"asset\": {\n \"id\": \"Console-main\",\n \"type\": \"console\",\n \"exp\": \" publish('evaluate-expression', {{expression}}) \",\n \"binding\": \"history\"\n }\n }\n },\n {\n \"id\": \"Editor\",\n \"type\": \"stacked-view\",\n \"header\": {\n \"asset\": {\n \"id\": \"Editor-header\",\n \"type\": \"navigation\",\n \"values\": [\n {\n \"asset\": {\n \"id\": \"Editor-header-values-0\",\n \"type\": \"action\",\n \"value\": \"Config\",\n \"label\": {\n \"asset\": {\n \"id\": \"Editor-header-values-0-label\",\n \"type\": \"text\",\n \"value\": \"Config\"\n }\n }\n }\n },\n {\n \"asset\": {\n \"id\": \"Editor-header-values-1\",\n \"type\": \"action\",\n \"value\": \"Flow\",\n \"label\": {\n \"asset\": {\n \"id\": \"Editor-header-values-1-label\",\n \"type\": \"text\",\n \"value\": \"Flow\"\n }\n }\n }\n },\n {\n \"asset\": {\n \"id\": \"Editor-header-values-2\",\n \"type\": \"action\",\n \"value\": \"Logs\",\n \"label\": {\n \"asset\": {\n \"id\": \"Editor-header-values-2-label\",\n \"type\": \"text\",\n \"value\": \"Logs\"\n }\n }\n }\n },\n {\n \"asset\": {\n \"id\": \"Editor-header-values-3\",\n \"type\": \"action\",\n \"value\": \"Console\",\n \"label\": {\n \"asset\": {\n \"id\": \"Editor-header-values-3-label\",\n \"type\": \"text\",\n \"value\": \"Console\"\n }\n }\n }\n },\n {\n \"asset\": {\n \"id\": \"Editor-header-values-4\",\n \"type\": \"action\",\n \"value\": \"Editor\",\n \"label\": {\n \"asset\": {\n \"id\": \"Editor-header-values-4-label\",\n \"type\": \"text\",\n \"value\": \"Editor\"\n }\n }\n }\n }\n ]\n }\n },\n \"main\": {\n \"asset\": {\n \"id\": \"Editor-main\",\n \"type\": \"code-editor\",\n \"binding\": \"flow\",\n \"exp\": \" publish('override-flow', {{code}}) \"\n }\n }\n }\n ],\n \"navigation\": {\n \"BEGIN\": \"Plugin\",\n \"Plugin\": {\n \"startState\": \"CONFIG\",\n \"CONFIG\": {\n \"state_type\": \"VIEW\",\n \"ref\": \"Config\",\n \"transitions\": {\n \"Config\": \"CONFIG\",\n \"Flow\": \"FLOW\",\n \"Logs\": \"LOGS\",\n \"Console\": \"CONSOLE\",\n \"Editor\": \"EDITOR\"\n }\n },\n \"FLOW\": {\n \"state_type\": \"VIEW\",\n \"ref\": \"Flow\",\n \"transitions\": {\n \"Config\": \"CONFIG\",\n \"Flow\": \"FLOW\",\n \"Logs\": \"LOGS\",\n \"Console\": \"CONSOLE\",\n \"Editor\": \"EDITOR\"\n }\n },\n \"LOGS\": {\n \"state_type\": \"VIEW\",\n \"ref\": \"Logs\",\n \"transitions\": {\n \"Config\": \"CONFIG\",\n \"Flow\": \"FLOW\",\n \"Logs\": \"LOGS\",\n \"Console\": \"CONSOLE\",\n \"Editor\": \"EDITOR\"\n }\n },\n \"CONSOLE\": {\n \"state_type\": \"VIEW\",\n \"ref\": \"Console\",\n \"transitions\": {\n \"Config\": \"CONFIG\",\n \"Flow\": \"FLOW\",\n \"Logs\": \"LOGS\",\n \"Console\": \"CONSOLE\",\n \"Editor\": \"EDITOR\"\n }\n },\n \"EDITOR\": {\n \"state_type\": \"VIEW\",\n \"ref\": \"Editor\",\n \"transitions\": {\n \"Config\": \"CONFIG\",\n \"Flow\": \"FLOW\",\n \"Logs\": \"LOGS\",\n \"Console\": \"CONSOLE\",\n \"Editor\": \"EDITOR\"\n }\n }\n }\n },\n \"schema\": {\n \"ROOT\": {\n \"playerConfig\": {\n \"type\": \"RecordType\"\n },\n \"flow\": {\n \"type\": \"RecordType\"\n },\n \"expression\": {\n \"type\": \"StringType\",\n \"default\": \"\",\n \"validation\": [\n {\n \"type\": \"string\"\n }\n ],\n \"format\": {\n \"type\": \"string\"\n }\n },\n \"code\": {\n \"type\": \"StringType\",\n \"default\": \"\",\n \"validation\": [\n {\n \"type\": \"string\"\n }\n ],\n \"format\": {\n \"type\": \"string\"\n }\n },\n \"history\": {\n \"type\": \"historyType\",\n \"isArray\": true\n },\n \"logs\": {\n \"type\": \"logsType\",\n \"isArray\": true\n }\n },\n \"logsType\": {\n \"id\": {\n \"type\": \"StringType\",\n \"default\": \"\",\n \"validation\": [\n {\n \"type\": \"string\"\n }\n ],\n \"format\": {\n \"type\": \"string\"\n }\n },\n \"time\": {\n \"type\": \"StringType\",\n \"default\": \"\",\n \"validation\": [\n {\n \"type\": \"string\"\n }\n ],\n \"format\": {\n \"type\": \"string\"\n }\n },\n \"type\": {\n \"type\": \"StringType\",\n \"default\": \"\",\n \"validation\": [\n {\n \"type\": \"string\"\n }\n ],\n \"format\": {\n \"type\": \"string\"\n }\n },\n \"message\": {\n \"type\": \"StringType\",\n \"default\": \"\",\n \"validation\": [\n {\n \"type\": \"string\"\n }\n ],\n \"format\": {\n \"type\": \"string\"\n }\n },\n \"severity\": {\n \"type\": \"StringType\",\n \"default\": \"\",\n \"validation\": [\n {\n \"type\": \"string\"\n }\n ],\n \"format\": {\n \"type\": \"string\"\n }\n },\n \"binding\": {\n \"type\": \"StringType\",\n \"default\": \"\",\n \"validation\": [\n {\n \"type\": \"string\"\n }\n ],\n \"format\": {\n \"type\": \"string\"\n }\n },\n \"from\": {\n \"type\": \"StringType\",\n \"default\": \"\",\n \"validation\": [\n {\n \"type\": \"string\"\n }\n ],\n \"format\": {\n \"type\": \"string\"\n }\n },\n \"to\": {\n \"type\": \"StringType\",\n \"default\": \"\",\n \"validation\": [\n {\n \"type\": \"string\"\n }\n ],\n \"format\": {\n \"type\": \"string\"\n }\n },\n \"state\": {\n \"type\": \"StringType\",\n \"default\": \"\",\n \"validation\": [\n {\n \"type\": \"string\"\n }\n ],\n \"format\": {\n \"type\": \"string\"\n }\n },\n \"error\": {\n \"type\": \"StringType\",\n \"default\": \"\",\n \"validation\": [\n {\n \"type\": \"string\"\n }\n ],\n \"format\": {\n \"type\": \"string\"\n }\n },\n \"outcome\": {\n \"type\": \"StringType\",\n \"default\": \"\",\n \"validation\": [\n {\n \"type\": \"string\"\n }\n ],\n \"format\": {\n \"type\": \"string\"\n }\n },\n \"metricType\": {\n \"type\": \"StringType\",\n \"default\": \"\",\n \"validation\": [\n {\n \"type\": \"string\"\n }\n ],\n \"format\": {\n \"type\": \"string\"\n }\n }\n },\n \"historyType\": {\n \"id\": {\n \"type\": \"StringType\",\n \"default\": \"\",\n \"validation\": [\n {\n \"type\": \"string\"\n }\n ],\n \"format\": {\n \"type\": \"string\"\n }\n },\n \"expression\": {\n \"type\": \"StringType\",\n \"default\": \"\",\n \"validation\": [\n {\n \"type\": \"string\"\n }\n ],\n \"format\": {\n \"type\": \"string\"\n }\n },\n \"result\": {\n \"type\": \"StringType\",\n \"default\": \"\",\n \"validation\": [\n {\n \"type\": \"string\"\n }\n ],\n \"format\": {\n \"type\": \"string\"\n }\n },\n \"severity\": {\n \"type\": \"StringType\",\n \"default\": \"\",\n \"validation\": [\n {\n \"type\": \"string\"\n }\n ],\n \"format\": {\n \"type\": \"string\"\n }\n }\n }\n },\n \"data\": {\n \"expression\": \"\",\n \"flow\": {},\n \"history\": [],\n \"logs\": [],\n \"playerConfig\": {}\n }\n}","import type { PluginData } from \"@player-devtools/types\";\nimport { PLUGIN_ID } from \"./constants\";\n\n// Generated via dsl_compile target\nimport flow from \"../_generated/flow.json\";\n\ndeclare global {\n const __VERSION__: string;\n}\n\nconst PLUGIN_VERSION =\n typeof __VERSION__ !== \"undefined\" ? __VERSION__ : \"unstamped\";\n\nexport const BasicPluginData: PluginData = {\n id: PLUGIN_ID,\n name: \"Standard Devtools\",\n description: \"Standard Player UI Devtools\",\n version: PLUGIN_VERSION,\n flow,\n};\n\nexport * from \"./constants\";\n","// Should be no imports here!\n\n/**\n * The sentinel value returned by producers to replace the draft with undefined.\n */\nexport const NOTHING: unique symbol = Symbol.for(\"immer-nothing\")\n\n/**\n * To let Immer treat your class instances as plain immutable objects\n * (albeit with a custom prototype), you must define either an instance property\n * or a static property on each of your custom classes.\n *\n * Otherwise, your class instance will never be drafted, which means it won't be\n * safe to mutate in a produce callback.\n */\nexport const DRAFTABLE: unique symbol = Symbol.for(\"immer-draftable\")\n\nexport const DRAFT_STATE: unique symbol = Symbol.for(\"immer-state\")\n","import {\n\tIProduce,\n\tIProduceWithPatches,\n\tImmer,\n\tDraft,\n\tImmutable\n} from \"./internal\"\n\nexport {\n\tDraft,\n\tWritableDraft,\n\tImmutable,\n\tPatch,\n\tPatchListener,\n\tProducer,\n\toriginal,\n\tcurrent,\n\tisDraft,\n\tisDraftable,\n\tNOTHING as nothing,\n\tDRAFTABLE as immerable,\n\tfreeze,\n\tObjectish,\n\tStrictMode\n} from \"./internal\"\n\nconst immer = new Immer()\n\n/**\n * The `produce` function takes a value and a \"recipe function\" (whose\n * return value often depends on the base state). The recipe function is\n * free to mutate its first argument however it wants. All mutations are\n * only ever applied to a __copy__ of the base state.\n *\n * Pass only a function to create a \"curried producer\" which relieves you\n * from passing the recipe function every time.\n *\n * Only plain objects and arrays are made mutable. All other objects are\n * considered uncopyable.\n *\n * Note: This function is __bound__ to its `Immer` instance.\n *\n * @param {any} base - the initial state\n * @param {Function} producer - function that receives a proxy of the base state as first argument and which can be freely modified\n * @param {Function} patchListener - optional function that will be called with all the patches produced here\n * @returns {any} a new state, or the initial state if nothing was modified\n */\nexport const produce: IProduce = /* @__PURE__ */ immer.produce\n\n/**\n * Like `produce`, but `produceWithPatches` always returns a tuple\n * [nextState, patches, inversePatches] (instead of just the next state)\n */\nexport const produceWithPatches: IProduceWithPatches = /* @__PURE__ */ immer.produceWithPatches.bind(\n\timmer\n)\n\n/**\n * Pass true to automatically freeze all copies created by Immer.\n *\n * Always freeze by default, even in production mode\n */\nexport const setAutoFreeze = /* @__PURE__ */ immer.setAutoFreeze.bind(immer)\n\n/**\n * Pass true to enable strict shallow copy.\n *\n * By default, immer does not copy the object descriptors such as getter, setter and non-enumrable properties.\n */\nexport const setUseStrictShallowCopy = /* @__PURE__ */ immer.setUseStrictShallowCopy.bind(\n\timmer\n)\n\n/**\n * Apply an array of Immer patches to the first argument.\n *\n * This function is a producer, which means copy-on-write is in effect.\n */\nexport const applyPatches = /* @__PURE__ */ immer.applyPatches.bind(immer)\n\n/**\n * Create an Immer draft from the given base state, which may be a draft itself.\n * The draft can be modified until you finalize it with the `finishDraft` function.\n */\nexport const createDraft = /* @__PURE__ */ immer.createDraft.bind(immer)\n\n/**\n * Finalize an Immer draft from a `createDraft` call, returning the base state\n * (if no changes were made) or a modified copy. The draft must *not* be\n * mutated afterwards.\n *\n * Pass a function as the 2nd argument to generate Immer patches based on the\n * changes that were made.\n */\nexport const finishDraft = /* @__PURE__ */ immer.finishDraft.bind(immer)\n\n/**\n * This function is actually a no-op, but can be used to cast an immutable type\n * to an draft type and make TypeScript happy\n *\n * @param value\n */\nexport function castDraft<T>(value: T): Draft<T> {\n\treturn value as any\n}\n\n/**\n * This function is actually a no-op, but can be used to cast a mutable type\n * to an immutable type and make TypeScript happy\n * @param value\n */\nexport function castImmutable<T>(value: T): Immutable<T> {\n\treturn value as any\n}\n\nexport {Immer}\n\nexport {enablePatches} from \"./plugins/patches\"\nexport {enableMapSet} from \"./plugins/mapset\"\n","export type Reducer<T, A> = (state: T, action: A) => T;\nexport type Dispatch<A> = (action: A) => void;\nexport type Subscriber<T> = (state: T) => void;\nexport type Subscribe<T> = (subscriber: Subscriber<T>) => Unsubscribe;\nexport type Unsubscribe = () => void;\n\nexport interface Store<State, Action> {\n getState: () => State;\n subscribe: Subscribe<State>;\n dispatch: Dispatch<Action>;\n}\n\nexport const useStateReducer = <State, Action>(\n reducer: Reducer<State, Action>,\n initialState: State,\n): Store<State, Action> => {\n let state = initialState;\n const subscribers = new Set<Subscriber<State>>();\n return {\n getState: () => state,\n\n /** Subscribe to state changes; returns an unsubscribe function. */\n subscribe(subscriber: Subscriber<State>): Unsubscribe {\n subscribers.add(subscriber);\n subscriber(state);\n return () => subscribers.delete(subscriber);\n },\n\n /** Dispatch an action through the reducer, then run side-effects. */\n dispatch(action: Action): void {\n const prevState = state;\n const nextState = reducer(prevState, action);\n\n // Only proceed if state actually changed by reference\n if (nextState !== prevState) {\n state = nextState;\n\n // Notify subscribers\n for (const sub of subscribers) sub(state);\n }\n },\n };\n};\n","import { produce } from \"immer\";\nimport { dequal } from \"dequal\";\nimport type {\n DevtoolsDataChangeEvent,\n DevtoolsPluginsStore,\n ExtensionSupportedEvents,\n PlayerInitEvent,\n Transaction,\n} from \"@player-devtools/types\";\nimport { dsetAssign } from \"@player-devtools/utils\";\n\nconst containsInteraction = (\n interactions: DevtoolsPluginsStore[\"interactions\"],\n interaction: DevtoolsPluginsStore[\"interactions\"][number],\n) => {\n return interactions.filter((i) => dequal(i, interaction)).length > 0;\n};\n\n/** devtools plugin state reducer */\nexport const reducer = (\n state: DevtoolsPluginsStore,\n transaction: Transaction<ExtensionSupportedEvents>,\n): DevtoolsPluginsStore => {\n switch (transaction.type) {\n case \"PLAYER_DEVTOOLS_PLAYER_INIT\":\n return produce(state, (draft) => {\n const { payload } = transaction;\n dsetAssign(draft, [\"plugins\"], payload.plugins);\n\n const message: PlayerInitEvent = {\n type: \"PLAYER_DEVTOOLS_PLAYER_INIT\",\n payload,\n };\n\n draft.messages.push(message);\n });\n case \"PLAYER_DEVTOOLS_PLUGIN_DATA_CHANGE\":\n return produce(state, (draft) => {\n const { payload } = transaction;\n\n if (!payload.data) return state;\n\n try {\n dsetAssign(\n draft,\n [\"plugins\", transaction.payload.pluginID, \"flow\", \"data\"],\n transaction.payload.data,\n );\n } catch {\n console.error(\"error setting data:\", transaction.payload.data);\n }\n const message: DevtoolsDataChangeEvent = {\n type: \"PLAYER_DEVTOOLS_PLUGIN_DATA_CHANGE\",\n payload,\n };\n\n draft.messages.push(message);\n });\n case \"PLAYER_DEVTOOLS_PLUGIN_INTERACTION\":\n return produce(state, (draft) => {\n if (containsInteraction(draft.interactions, transaction)) return state;\n\n dsetAssign(\n draft,\n [\"interactions\"],\n [...draft.interactions, transaction],\n );\n });\n case \"PLAYER_DEVTOOLS_SELECTED_PLAYER_CHANGE\": {\n const { playerID } = transaction.payload;\n\n if (!playerID) return state;\n return produce(state, (draft) => {\n dsetAssign(draft, [\"currentPlayer\"], playerID);\n });\n }\n default:\n return state;\n }\n};\n","export const INTERACTIONS = {\n PLAYER_SELECTED: \"player-selected\",\n};\n\nexport const PLUGIN_INACTIVE_WARNING =\n \"The plugin has been registered, but the Player development tools are not active. If you are working in a production environment, it is recommended to remove the plugin. To activate, enable through the browser extension popup for web or configure the FlipperClient for mobile.\";\n","import type {\n DevtoolsDataChangeEvent,\n Transaction,\n} from \"@player-devtools/types\";\nimport type { Flow } from \"@player-ui/player\";\n\nconst NOOP_ID = -1;\n\n/**\n * Generates a data change transaction for the player devtools plugin.\n *\n * This function creates a transaction object that represents a change in data\n * within a player devtools plugin. The transaction includes details such as the\n * plugin ID, the changed data, and the player ID. It is used to communicate\n * changes between the plugin and devtools.\n */\nexport const genDataChangeTransaction = ({\n playerID,\n data,\n pluginID,\n}: {\n playerID: string;\n data: Flow[\"data\"];\n pluginID: string;\n}): Transaction<DevtoolsDataChangeEvent> => {\n return {\n id: NOOP_ID,\n type: \"PLAYER_DEVTOOLS_PLUGIN_DATA_CHANGE\",\n payload: {\n pluginID,\n data,\n },\n sender: playerID,\n context: \"player\",\n target: \"player\",\n timestamp: Date.now(),\n _messenger_: true,\n };\n};\n","import type { Messenger } from \"@player-devtools/messenger\";\nimport {\n PluginData,\n DevtoolsPluginsStore,\n PlayerInitEvent,\n ExtensionSupportedEvents,\n Transaction,\n DevtoolsPluginInteractionEvent,\n} from \"@player-devtools/types\";\nimport { dsetAssign } from \"@player-devtools/utils\";\nimport type { DataModel, Player, PlayerPlugin } from \"@player-ui/player\";\nimport { produce } from \"immer\";\nimport { useStateReducer, type Store, type Unsubscribe } from \"./state\";\nimport { reducer } from \"./reducer\";\nimport { PLUGIN_INACTIVE_WARNING, INTERACTIONS } from \"./constants\";\nimport { genDataChangeTransaction } from \"./helpers\";\nimport { dequal } from \"dequal\";\n\nexport interface DevtoolsHandler {\n // TODO: Could return bool to signifiy handled to avoid double processing?\n processInteraction(interaction: DevtoolsPluginInteractionEvent): void;\n checkIfDevtoolsIsActive(): boolean;\n log?(message: string): void;\n}\n\nexport interface DevtoolsPluginOptions {\n playerID: string;\n pluginData: PluginData;\n handler: DevtoolsHandler;\n}\n\nconst INITIAL_STATE: DevtoolsPluginsStore = {\n messages: [],\n plugins: {},\n interactions: [],\n currentPlayer: \"\",\n};\n\n// TODO: Rename to DevtoolsPluginStore? Need to rename DevtoolsPluginsStore to DevtoolsPluginState\nexport type PluginStore = Store<\n DevtoolsPluginsStore,\n Transaction<ExtensionSupportedEvents>\n>;\n\n/** Entrypoint for devtools plugins with platform-agnostic components */\nexport class DevtoolsPlugin implements PlayerPlugin, DevtoolsHandler {\n name: string = \"DevtoolsPlugin\";\n\n private loggedWarning = false;\n\n store: PluginStore = useStateReducer(reducer, INITIAL_STATE);\n protected lastProcessedInteraction = 0;\n\n get pluginID(): string {\n return this.options.pluginData.id;\n }\n\n get playerID(): string {\n return this.options.playerID;\n }\n\n constructor(protected options: DevtoolsPluginOptions) {\n this.store.subscribe(({ interactions }) => {\n if (this.lastProcessedInteraction < (interactions.length ?? 0)) {\n interactions\n .slice(this.lastProcessedInteraction)\n .forEach(this.processInteraction.bind(this));\n }\n });\n }\n\n registerMessenger(\n messenger: Messenger<ExtensionSupportedEvents>,\n ): Unsubscribe {\n // Propagate new messages from state to devtools via the messenger\n let lastMessageIndex = -1;\n return this.store.subscribe(({ messages }) => {\n const start = lastMessageIndex + 1;\n if (messages.length > start) {\n const newlyAdded = messages.slice(start);\n lastMessageIndex = messages.length - 1;\n for (const msg of newlyAdded) {\n messenger.sendMessage(msg);\n }\n }\n });\n }\n\n protected dispatchPlayerInit(): void {\n // Initial plugin content\n const transaction: Transaction<PlayerInitEvent> = {\n id: -1,\n type: \"PLAYER_DEVTOOLS_PLAYER_INIT\",\n payload: {\n plugins: {\n [this.pluginID]: this.options.pluginData,\n },\n },\n sender: this.options.playerID,\n context: \"player\",\n target: \"player\",\n timestamp: Date.now(),\n _messenger_: true,\n };\n\n this.store.dispatch(transaction);\n }\n\n // By default, we'll only write to the keys defined in data -- if undefined, data will be cleared\n protected dispatchDataUpdate(data?: DataModel): void {\n const state = this.store.getState();\n\n const { plugins } = produce(this.store.getState(), (draft) => {\n if (!data)\n dsetAssign(draft, [\"plugins\", this.pluginID, \"flow\", \"data\"], data);\n else\n Object.entries(data).forEach(([key, value]) => {\n dsetAssign(\n draft,\n [\"plugins\", this.pluginID, \"flow\", \"data\", key],\n value,\n );\n });\n });\n\n const newData = plugins[this.pluginID]!.flow.data;\n if (dequal(state.plugins[this.pluginID]?.flow?.data, newData)) return;\n\n const transaction = genDataChangeTransaction({\n playerID: this.playerID,\n pluginID: this.pluginID,\n data: newData,\n });\n\n this.store.dispatch(transaction);\n }\n\n checkIfDevtoolsIsActive(): boolean {\n const isActive = this.options.handler.checkIfDevtoolsIsActive();\n if (!isActive && !this.loggedWarning) {\n this.options.handler.log?.(PLUGIN_INACTIVE_WARNING);\n this.loggedWarning = true;\n }\n\n return isActive;\n }\n\n processInteraction(interaction: DevtoolsPluginInteractionEvent): void {\n this.options.handler.processInteraction(interaction);\n\n const {\n payload: { type, payload },\n } = interaction;\n\n if (type === INTERACTIONS.PLAYER_SELECTED && payload) {\n this.store.dispatch({\n id: -1,\n type: \"PLAYER_DEVTOOLS_SELECTED_PLAYER_CHANGE\",\n payload: { playerID: payload },\n sender: this.playerID,\n context: \"player\",\n target: this.playerID,\n timestamp: Date.now(),\n _messenger_: true,\n });\n }\n\n this.lastProcessedInteraction += 1;\n }\n\n apply(player: Player): void {\n if (!this.checkIfDevtoolsIsActive()) return;\n\n this.dispatchPlayerInit();\n }\n}\n","import {\n INTERACTIONS,\n BasicPluginData,\n} from \"@player-devtools/basic-plugin-content\";\nimport {\n DevtoolsPlugin,\n DevtoolsPluginOptions,\n generateUUID,\n} from \"@player-devtools/plugin\";\nimport type { DevtoolsPluginInteractionEvent } from \"@player-devtools/types\";\nimport { dsetAssign } from \"@player-devtools/utils\";\nimport type {\n DataController,\n ExpressionEvaluator,\n Flow,\n Player,\n ViewInstance,\n Logger,\n} from \"@player-ui/player\";\nimport { produce } from \"immer\";\n\nimport { Evaluation } from \"./types\";\n\n/** Taps into the Player and ReactPlayer hooks and leverage the WrapperComponent to define and process the content. */\nexport class BasicDevtoolsPlugin extends DevtoolsPlugin {\n constructor(options: Omit<DevtoolsPluginOptions, \"pluginData\">) {\n super({\n ...options,\n pluginData: BasicPluginData,\n });\n }\n\n name = \"BasicDevtoolsPlugin\";\n\n data: Record<string, unknown> = {};\n\n playerConfig: Record<string, unknown> = {};\n\n logs: {\n severity: string;\n message: unknown;\n }[] = [];\n\n flow?: Flow;\n\n logger?: WeakRef<Logger>;\n\n expressionEvaluator?: WeakRef<ExpressionEvaluator>;\n\n view?: WeakRef<ViewInstance>;\n\n dataController?: WeakRef<DataController>;\n\n overrideFlow?: Player[\"start\"];\n\n apply(player: Player): void {\n this.logger = new WeakRef(player.logger);\n\n if (!this.checkIfDevtoolsIsActive()) return;\n\n this.options.pluginData.flow.data!.playerConfig = {\n version: player.getVersion(),\n plugins: player.getPlugins().map((plugin) => plugin.name),\n };\n\n super.apply(player);\n\n // Config\n this.playerConfig = {\n version: player.getVersion(),\n plugins: player.getPlugins().map((plugin) => plugin.name),\n };\n\n this.dispatchDataUpdate({ playerConfig: this.playerConfig });\n\n // Data\n player.hooks.dataController.tap(this.name, (dataController) => {\n dataController.hooks.onUpdate.tap(this.name, (updates) => {\n this.data = produce(this.data, (draft) => {\n updates.forEach(({ binding, newValue }) => {\n dsetAssign(draft, [\"data\", ...binding.asArray()], newValue);\n });\n });\n\n this.dispatchDataUpdate({ data: this.data });\n });\n });\n\n player.logger.hooks.log.tap(this.name, (severity, message) => {\n this.logs = [...this.logs, { severity, message }];\n\n this.dispatchDataUpdate({ logs: this.logs });\n });\n\n // Flow\n player.hooks.onStart.tap(this.name, (f) => {\n this.flow = JSON.parse(JSON.stringify(f));\n\n this.dispatchDataUpdate({ flow: this.flow });\n });\n\n // View\n player.hooks.view.tap(this.name, (view) => {\n this.view = new WeakRef(view);\n });\n\n // Expression evaluator\n player.hooks.expressionEvaluator.tap(this.name, (evaluator) => {\n this.expressionEvaluator = new WeakRef(evaluator);\n });\n\n // Override flow\n this.overrideFlow = player.start.bind(player);\n }\n\n private evaluateExpression(expression: string): Evaluation {\n const evaluator = this.expressionEvaluator?.deref();\n\n if (!evaluator) {\n return {\n id: generateUUID(),\n severity: \"error\",\n result: \"Expression evaluator not available\",\n expression,\n };\n }\n\n try {\n evaluator.hooks.onError.intercept({\n call: (error: Error) => {\n throw error;\n },\n });\n\n const evaluatorResult = evaluator.evaluate(expression);\n\n return {\n id: generateUUID(),\n result: evaluatorResult,\n expression,\n };\n } catch (error) {\n const message =\n error instanceof Error\n ? error.message\n : String(error ?? \"Something went wrong\");\n return {\n id: generateUUID(),\n severity: \"error\",\n result: message,\n expression,\n };\n }\n }\n\n processInteraction(interaction: DevtoolsPluginInteractionEvent): void {\n // invokes mobile specific handlers\n super.processInteraction(interaction);\n\n const {\n payload: { type, payload },\n } = interaction;\n if (\n type === INTERACTIONS.EVALUATE_EXPRESSION &&\n this.expressionEvaluator &&\n payload\n ) {\n const result = this.evaluateExpression(payload);\n const current: Array<Evaluation> =\n (this.store.getState()?.plugins?.[this.pluginID]?.flow?.data\n ?.history as Array<Evaluation>) || [];\n\n this.dispatchDataUpdate({ history: [...current, result] });\n\n return;\n }\n\n if (type === INTERACTIONS.OVERRIDE_FLOW && payload && this.overrideFlow) {\n let newFlow: Flow | undefined;\n\n try {\n newFlow = JSON.parse(payload);\n } catch (e) {\n this.logger?.deref()?.error(this.name, \"Error parsing new flow\", e);\n }\n\n if (newFlow) {\n this.overrideFlow(newFlow);\n }\n\n return;\n }\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
"types"
|
|
7
7
|
],
|
|
8
8
|
"name": "@player-devtools/basic-plugin",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.13.0-next.0",
|
|
10
10
|
"main": "dist/cjs/index.cjs",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@player-devtools/basic-plugin-content": "0.
|
|
13
|
-
"@player-devtools/messenger": "0.
|
|
14
|
-
"@player-devtools/plugin": "0.
|
|
15
|
-
"@player-devtools/types": "0.
|
|
16
|
-
"@player-devtools/utils": "0.
|
|
12
|
+
"@player-devtools/basic-plugin-content": "0.13.0-next.0",
|
|
13
|
+
"@player-devtools/messenger": "0.13.0-next.0",
|
|
14
|
+
"@player-devtools/plugin": "0.13.0-next.0",
|
|
15
|
+
"@player-devtools/types": "0.13.0-next.0",
|
|
16
|
+
"@player-devtools/utils": "0.13.0-next.0",
|
|
17
17
|
"@devtools-ui/plugin": "0.4.0",
|
|
18
18
|
"@player-ui/player": "0.12.0-next.1",
|
|
19
19
|
"@types/react": "^18.2.51",
|