@visactor/vrender 1.1.0-alpha.24 → 1.1.0-alpha.25

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.
Files changed (66) hide show
  1. package/cjs/entries/bootstrap-browser-lite.d.ts +2 -0
  2. package/cjs/entries/bootstrap-browser-lite.js +27 -0
  3. package/cjs/entries/bootstrap-browser-lite.js.map +1 -0
  4. package/cjs/entries/bootstrap-browser.d.ts +2 -0
  5. package/cjs/entries/bootstrap-browser.js +19 -0
  6. package/cjs/entries/bootstrap-browser.js.map +1 -0
  7. package/cjs/entries/bootstrap-common.d.ts +3 -0
  8. package/cjs/entries/bootstrap-common.js +44 -0
  9. package/cjs/entries/bootstrap-common.js.map +1 -0
  10. package/cjs/entries/bootstrap-utils.d.ts +7 -0
  11. package/cjs/entries/bootstrap-utils.js +44 -0
  12. package/cjs/entries/bootstrap-utils.js.map +1 -0
  13. package/cjs/entries/bootstrap.js +11 -39
  14. package/cjs/entries/bootstrap.js.map +1 -1
  15. package/cjs/entries/browser.js +3 -26
  16. package/cjs/entries/browser.js.map +1 -1
  17. package/cjs/entries/shared-browser-lite.d.ts +12 -0
  18. package/cjs/entries/shared-browser-lite.js +31 -0
  19. package/cjs/entries/shared-browser-lite.js.map +1 -0
  20. package/cjs/entries/shared-browser.d.ts +12 -0
  21. package/cjs/entries/shared-browser.js +30 -0
  22. package/cjs/entries/shared-browser.js.map +1 -0
  23. package/cjs/entries/shared-registry.d.ts +16 -0
  24. package/cjs/entries/shared-registry.js +87 -0
  25. package/cjs/entries/shared-registry.js.map +1 -0
  26. package/cjs/entries/shared.d.ts +3 -7
  27. package/cjs/entries/shared.js +6 -69
  28. package/cjs/entries/shared.js.map +1 -1
  29. package/cjs/index.d.ts +1 -1
  30. package/cjs/index.js +1 -1
  31. package/cjs/index.js.map +1 -1
  32. package/dist/index.es.js +415 -1266
  33. package/dist/index.js +416 -1267
  34. package/dist/index.min.js +1 -1
  35. package/es/entries/bootstrap-browser-lite.d.ts +2 -0
  36. package/es/entries/bootstrap-browser-lite.js +51 -0
  37. package/es/entries/bootstrap-browser-lite.js.map +1 -0
  38. package/es/entries/bootstrap-browser.d.ts +2 -0
  39. package/es/entries/bootstrap-browser.js +15 -0
  40. package/es/entries/bootstrap-browser.js.map +1 -0
  41. package/es/entries/bootstrap-common.d.ts +3 -0
  42. package/es/entries/bootstrap-common.js +58 -0
  43. package/es/entries/bootstrap-common.js.map +1 -0
  44. package/es/entries/bootstrap-utils.d.ts +7 -0
  45. package/es/entries/bootstrap-utils.js +38 -0
  46. package/es/entries/bootstrap-utils.js.map +1 -0
  47. package/es/entries/bootstrap.js +4 -34
  48. package/es/entries/bootstrap.js.map +1 -1
  49. package/es/entries/browser.js +1 -3
  50. package/es/entries/browser.js.map +1 -1
  51. package/es/entries/shared-browser-lite.d.ts +12 -0
  52. package/es/entries/shared-browser-lite.js +28 -0
  53. package/es/entries/shared-browser-lite.js.map +1 -0
  54. package/es/entries/shared-browser.d.ts +12 -0
  55. package/es/entries/shared-browser.js +28 -0
  56. package/es/entries/shared-browser.js.map +1 -0
  57. package/es/entries/shared-registry.d.ts +16 -0
  58. package/es/entries/shared-registry.js +79 -0
  59. package/es/entries/shared-registry.js.map +1 -0
  60. package/es/entries/shared.d.ts +3 -7
  61. package/es/entries/shared.js +6 -69
  62. package/es/entries/shared.js.map +1 -1
  63. package/es/index.d.ts +1 -1
  64. package/es/index.js +1 -1
  65. package/es/index.js.map +1 -1
  66. package/package.json +21 -7
package/dist/index.js CHANGED
@@ -169,7 +169,7 @@
169
169
  }
170
170
  }
171
171
 
172
- var __awaiter$8 = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
172
+ var __awaiter$7 = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
173
173
  return new (P || (P = Promise))(function (resolve, reject) {
174
174
  function fulfilled(value) {
175
175
  try {
@@ -338,7 +338,7 @@
338
338
  return this._env || this.setEnv("browser"), this.envContribution.loadBlob(url);
339
339
  }
340
340
  loadFont(name, source, descriptors) {
341
- return __awaiter$8(this, void 0, void 0, function* () {
341
+ return __awaiter$7(this, void 0, void 0, function* () {
342
342
  return this._env || this.setEnv("browser"), this.envContribution.loadFont(name, source, descriptors);
343
343
  });
344
344
  }
@@ -724,14 +724,14 @@
724
724
  const isObjectLike = value => "object" == typeof value && null !== value;
725
725
  var isObjectLike$1 = isObjectLike;
726
726
 
727
- const isPlainObject$3 = function (value) {
727
+ const isPlainObject$2 = function (value) {
728
728
  if (!isObjectLike$1(value) || !isType$1(value, "Object")) return !1;
729
729
  if (null === Object.getPrototypeOf(value)) return !0;
730
730
  let proto = value;
731
731
  for (; null !== Object.getPrototypeOf(proto);) proto = Object.getPrototypeOf(proto);
732
732
  return Object.getPrototypeOf(value) === proto;
733
733
  };
734
- var isPlainObject$4 = isPlainObject$3;
734
+ var isPlainObject$3 = isPlainObject$2;
735
735
 
736
736
  const isUndefined = value => void 0 === value;
737
737
  var isUndefined$1 = isUndefined;
@@ -846,7 +846,7 @@
846
846
  const length = objValue.length;
847
847
  for (; ++index < length;) newValue[index] = objValue[index];
848
848
  }
849
- } else isPlainObject$4(srcValue) ? (newValue = null != objValue ? objValue : {}, "function" != typeof objValue && "object" == typeof objValue || (newValue = {})) : isCommon = !1;
849
+ } else isPlainObject$3(srcValue) ? (newValue = null != objValue ? objValue : {}, "function" != typeof objValue && "object" == typeof objValue || (newValue = {})) : isCommon = !1;
850
850
  isCommon && baseMerge(newValue, srcValue, shallowArray, skipTargetArray), assignMergeValue(target, key, newValue);
851
851
  }
852
852
  function assignMergeValue(target, key, value) {
@@ -883,7 +883,7 @@
883
883
  for (let i = a.length - 1; i >= 0; i--) if (!isEqual(a[i], b[i], options)) return !1;
884
884
  return !0;
885
885
  }
886
- if (!isPlainObject$4(a)) return !1;
886
+ if (!isPlainObject$3(a)) return !1;
887
887
  const ka = objectKeys(a),
888
888
  kb = objectKeys(b);
889
889
  if (ka.length !== kb.length) return !1;
@@ -2668,7 +2668,7 @@
2668
2668
  };
2669
2669
  const lowerCamelCaseToMiddle = str => str.replace(/([A-Z])/g, "-$1").toLowerCase();
2670
2670
 
2671
- var __awaiter$7 = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
2671
+ var __awaiter$6 = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
2672
2672
  return new (P || (P = Promise))(function (resolve, reject) {
2673
2673
  function fulfilled(value) {
2674
2674
  try {
@@ -2718,6 +2718,7 @@
2718
2718
  constructor() {
2719
2719
  super(), this._uid = Generator.GenAutoIncrementId(), this._firstChild = null, this._lastChild = null, this.parent = null, this._count = 1;
2720
2720
  }
2721
+ onParentSharedStateTreeChanged(_stage, _layer) {}
2721
2722
  forEachChildren(cb, reverse = !1) {
2722
2723
  if (reverse) {
2723
2724
  let child = this._lastChild,
@@ -2736,7 +2737,7 @@
2736
2737
  }
2737
2738
  }
2738
2739
  forEachChildrenAsync(cb, reverse = !1) {
2739
- return __awaiter$7(this, void 0, void 0, function* () {
2740
+ return __awaiter$6(this, void 0, void 0, function* () {
2740
2741
  if (reverse) {
2741
2742
  let child = this._lastChild,
2742
2743
  i = 0;
@@ -6293,7 +6294,7 @@
6293
6294
  return str.startsWith("<");
6294
6295
  }
6295
6296
 
6296
- var __awaiter$6 = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
6297
+ var __awaiter$5 = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
6297
6298
  return new (P || (P = Promise))(function (resolve, reject) {
6298
6299
  function fulfilled(value) {
6299
6300
  try {
@@ -6322,7 +6323,7 @@
6322
6323
  group.incrementalAppendChild(graphic);
6323
6324
  }
6324
6325
  function waitForAllSubLayers(stage) {
6325
- return __awaiter$6(this, void 0, void 0, function* () {
6326
+ return __awaiter$5(this, void 0, void 0, function* () {
6326
6327
  const promiseList = [],
6327
6328
  layers = stage.getChildren();
6328
6329
  yield new Promise(resolve => {
@@ -7904,8 +7905,8 @@
7904
7905
  return conicalCanvas.width = imageData.width, conicalCanvas.height = imageData.height, conicalCtx.putImageData(imageData, 0, 0), pattern = context.createPattern(conicalCanvas, "no-repeat"), pattern && ConicalPatternStore.Set(stops, x, y, startAngle, endAngle, pattern, width, height), pattern;
7905
7906
  }
7906
7907
 
7907
- const FULL_DEFINITION_KEYS$1 = new Set(["name", "patch", "priority", "exclude", "suppress", "resolver", "declaredAffectedKeys"]);
7908
- function isPlainObject$2(value) {
7908
+ const FULL_DEFINITION_KEYS = new Set(["name", "patch", "priority", "exclude", "suppress", "resolver", "declaredAffectedKeys"]);
7909
+ function isPlainObject$1(value) {
7909
7910
  return null != value && "object" == typeof value && !Array.isArray(value);
7910
7911
  }
7911
7912
  function normalizePatch(value) {
@@ -7951,12 +7952,11 @@
7951
7952
  priority: 0,
7952
7953
  patch: void 0
7953
7954
  };
7954
- if ((isPlainObject$2(value) ? Object.keys(value) : []).some(key => FULL_DEFINITION_KEYS$1.has(key))) {
7955
+ if ((isPlainObject$1(value) ? Object.keys(value) : []).some(key => FULL_DEFINITION_KEYS.has(key))) {
7955
7956
  const definition = value;
7956
7957
  return {
7957
7958
  name: null !== (_a = definition.name) && void 0 !== _a ? _a : name,
7958
7959
  priority: null !== (_b = definition.priority) && void 0 !== _b ? _b : 0,
7959
- rank: definition.rank,
7960
7960
  patch: normalizePatch(definition.patch),
7961
7961
  resolver: definition.resolver,
7962
7962
  declaredAffectedKeys: definition.declaredAffectedKeys,
@@ -7976,281 +7976,40 @@
7976
7976
  rawRelationMap.set(name, new Set(definition[relation]));
7977
7977
  }), compiled.forEach((definition, origin) => {
7978
7978
  const closure = new Set(),
7979
- walk = (stateName, stack) => {
7979
+ walk = (stateName, visiting) => {
7980
7980
  const nextStates = rawRelationMap.get(stateName);
7981
7981
  nextStates && nextStates.size && nextStates.forEach(nextState => {
7982
- nextState !== origin ? stack.includes(nextState) ? console.warn(`[StateDefinitionCompiler] circular ${relation} relation detected: ${stack.join(" -> ")} -> ${nextState}`) : closure.has(nextState) || (closure.add(nextState), walk(nextState, stack.concat(nextState))) : console.warn(`[StateDefinitionCompiler] circular ${relation} relation detected: ${stack.join(" -> ")} -> ${origin}`);
7982
+ nextState === origin || visiting.has(nextState) || closure.has(nextState) || (closure.add(nextState), visiting.add(nextState), walk(nextState, visiting), visiting.delete(nextState));
7983
7983
  });
7984
7984
  };
7985
- walk(origin, [origin]), definition[relation] = closure;
7985
+ walk(origin, new Set([origin])), definition[relation] = closure;
7986
7986
  });
7987
7987
  }
7988
7988
  }
7989
7989
 
7990
- var UpdateCategory;
7991
- !function (UpdateCategory) {
7992
- UpdateCategory[UpdateCategory.NONE = 0] = "NONE", UpdateCategory[UpdateCategory.PAINT = 1] = "PAINT", UpdateCategory[UpdateCategory.SHAPE = 2] = "SHAPE", UpdateCategory[UpdateCategory.BOUNDS = 4] = "BOUNDS", UpdateCategory[UpdateCategory.TRANSFORM = 8] = "TRANSFORM", UpdateCategory[UpdateCategory.LAYOUT = 16] = "LAYOUT", UpdateCategory[UpdateCategory.PICK = 32] = "PICK";
7993
- }(UpdateCategory || (UpdateCategory = {}));
7994
- const ATTRIBUTE_CATEGORY = {
7995
- fill: UpdateCategory.PAINT,
7996
- opacity: UpdateCategory.PAINT,
7997
- fillOpacity: UpdateCategory.PAINT,
7998
- strokeOpacity: UpdateCategory.PAINT,
7999
- lineDash: UpdateCategory.PAINT,
8000
- lineDashOffset: UpdateCategory.PAINT,
8001
- lineCap: UpdateCategory.PAINT,
8002
- lineJoin: UpdateCategory.PAINT,
8003
- miterLimit: UpdateCategory.PAINT,
8004
- shadowColor: UpdateCategory.PAINT,
8005
- x: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
8006
- y: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
8007
- scaleX: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
8008
- scaleY: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
8009
- angle: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
8010
- anchor: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
8011
- anchor3d: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
8012
- postMatrix: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
8013
- layout: UpdateCategory.LAYOUT,
8014
- zIndex: UpdateCategory.PAINT,
8015
- visible: UpdateCategory.PAINT | UpdateCategory.PICK,
8016
- lineWidth: UpdateCategory.SHAPE | UpdateCategory.BOUNDS | UpdateCategory.PICK,
8017
- width: UpdateCategory.SHAPE | UpdateCategory.BOUNDS,
8018
- height: UpdateCategory.SHAPE | UpdateCategory.BOUNDS
8019
- };
8020
- const ATTRIBUTE_DELTA_CLASSIFIER = {
8021
- stroke: (prev, next) => (null != prev && !1 !== prev) !== (null != next && !1 !== next) ? UpdateCategory.PAINT | UpdateCategory.BOUNDS | UpdateCategory.PICK : UpdateCategory.PAINT,
8022
- shadowBlur: (prev, next) => {
8023
- const prevBlur = Number(null != prev ? prev : 0),
8024
- nextBlur = Number(null != next ? next : 0);
8025
- return prevBlur !== nextBlur && (prevBlur > 0 || nextBlur > 0) ? UpdateCategory.PAINT | UpdateCategory.BOUNDS : UpdateCategory.PAINT;
8026
- }
8027
- };
8028
- function classifyAttributeDelta(key, prev, next) {
8029
- var _a;
8030
- const dynamicClassifier = ATTRIBUTE_DELTA_CLASSIFIER[key];
8031
- return dynamicClassifier ? dynamicClassifier(prev, next) : null !== (_a = ATTRIBUTE_CATEGORY[key]) && void 0 !== _a ? _a : UpdateCategory.PAINT;
8032
- }
8033
- function classifyAffectedKeyConservatively(key) {
8034
- var _a;
8035
- return "stroke" === key ? UpdateCategory.PAINT | UpdateCategory.BOUNDS | UpdateCategory.PICK : "shadowBlur" === key ? UpdateCategory.PAINT | UpdateCategory.BOUNDS : null !== (_a = ATTRIBUTE_CATEGORY[key]) && void 0 !== _a ? _a : UpdateCategory.PAINT;
8036
- }
8037
- function classifyAffectedKeys(keys) {
8038
- let category = UpdateCategory.NONE;
8039
- for (const key of keys) category |= classifyAffectedKeyConservatively(key);
8040
- return category;
8041
- }
8042
-
8043
- const STAGE_PERF_MONITOR = Symbol("vrender.statePerfMonitor");
8044
- function createReasonBreakdown() {
8045
- return {
8046
- config_disabled: 0,
8047
- context_disabled: 0,
8048
- non_batch_operation: 0,
8049
- mixed_update_category: 0,
8050
- resolver_unstable_keys: 0,
8051
- graphic_unavailable: 0
8052
- };
8053
- }
8054
- function createEmptyStatePerfSnapshot() {
8055
- return {
8056
- counters: {
8057
- stateCommits: 0,
8058
- sharedRefreshCommits: 0,
8059
- deferredJobsCreated: 0,
8060
- deferredJobsCompleted: 0,
8061
- deferredJobsCancelled: 0,
8062
- deferredJobsCoalesced: 0,
8063
- deferredGraphicsCommitted: 0,
8064
- deferredBudgetYields: 0,
8065
- deferredIneligibleGraphics: 0
8066
- },
8067
- deferredIneligibleByReason: createReasonBreakdown(),
8068
- categoryBreakdown: {
8069
- paint: 0,
8070
- transform: 0,
8071
- shape: 0,
8072
- bounds: 0,
8073
- layout: 0,
8074
- pick: 0
8075
- },
8076
- refresh: {
8077
- queuedGraphics: 0,
8078
- flushedGraphics: 0,
8079
- ensureFreshCalls: 0,
8080
- renderScheduled: 0
8081
- },
8082
- resolver: {
8083
- cacheHits: 0,
8084
- cacheMisses: 0,
8085
- invalidations: 0
8086
- },
8087
- cost: {
8088
- resolverTotalMs: 0,
8089
- resolverMaxMs: 0,
8090
- patchTotalMs: 0,
8091
- patchMaxMs: 0,
8092
- sharedRefreshTotalMs: 0,
8093
- sharedRefreshMaxMs: 0,
8094
- batchSliceTotalMs: 0,
8095
- batchSliceMaxMs: 0
8096
- },
8097
- allocationHints: {
8098
- patchObjectsCreated: 0,
8099
- batchEntriesCreated: 0,
8100
- refreshQueuePushes: 0
8101
- },
8102
- batch: {
8103
- pendingJobs: 0,
8104
- maxPendingJobs: 0,
8105
- maxGraphicsInJob: 0,
8106
- maxFrameSliceCost: 0
8107
- },
8108
- events: []
8109
- };
8110
- }
8111
- function cloneSnapshot(snapshot) {
8112
- return {
8113
- counters: Object.assign({}, snapshot.counters),
8114
- deferredIneligibleByReason: Object.assign({}, snapshot.deferredIneligibleByReason),
8115
- categoryBreakdown: Object.assign({}, snapshot.categoryBreakdown),
8116
- refresh: Object.assign({}, snapshot.refresh),
8117
- resolver: Object.assign({}, snapshot.resolver),
8118
- cost: Object.assign({}, snapshot.cost),
8119
- allocationHints: Object.assign({}, snapshot.allocationHints),
8120
- batch: Object.assign({}, snapshot.batch),
8121
- events: snapshot.events ? snapshot.events.slice() : []
8122
- };
8123
- }
8124
- function isDeferredStateContextConfig(value) {
8125
- return !!value && (Object.prototype.hasOwnProperty.call(value, "deferred") || Object.prototype.hasOwnProperty.call(value, "localEnabled"));
8126
- }
8127
- function normalizeDeferredStateOwnerConfig(value) {
8128
- if (value) return isDeferredStateContextConfig(value) ? value : {
8129
- deferred: value
8130
- };
8131
- }
8132
- function normalizeDeferredStateConfig(config) {
8133
- var _a, _b, _c;
8134
- return {
8135
- enabled: null !== (_a = null == config ? void 0 : config.enabled) && void 0 !== _a && _a,
8136
- frameBudget: null !== (_b = null == config ? void 0 : config.frameBudget) && void 0 !== _b ? _b : 8,
8137
- maxGraphicsPerFrame: null !== (_c = null == config ? void 0 : config.maxGraphicsPerFrame) && void 0 !== _c ? _c : 100
8138
- };
8139
- }
8140
- function fingerprintDeferredStateConfig(config) {
8141
- return `${config.enabled ? 1 : 0}:${config.frameBudget}:${config.maxGraphicsPerFrame}`;
8142
- }
8143
- class StatePerfMonitor {
8144
- constructor(configSource) {
8145
- this.configSource = configSource, this.snapshot = createEmptyStatePerfSnapshot();
8146
- }
8147
- setConfig(config) {
8148
- this.configSource = config;
8149
- }
8150
- getSnapshot() {
8151
- return cloneSnapshot(this.snapshot);
8152
- }
8153
- reset() {
8154
- const next = createEmptyStatePerfSnapshot();
8155
- Object.assign(this.snapshot.counters, next.counters), Object.assign(this.snapshot.deferredIneligibleByReason, next.deferredIneligibleByReason), Object.assign(this.snapshot.categoryBreakdown, next.categoryBreakdown), Object.assign(this.snapshot.refresh, next.refresh), Object.assign(this.snapshot.resolver, next.resolver), Object.assign(this.snapshot.cost, next.cost), Object.assign(this.snapshot.allocationHints, next.allocationHints), Object.assign(this.snapshot.batch, next.batch), this.snapshot.events = [];
8156
- }
8157
- incrementCounter(key, delta = 1) {
8158
- this.isEnabled() && (this.snapshot.counters[key] += delta);
8159
- }
8160
- recordDeferredIneligible(reason, delta = 1) {
8161
- this.isEnabled() && (this.snapshot.deferredIneligibleByReason[reason] += delta, this.snapshot.counters.deferredIneligibleGraphics += delta, this.recordEvent("deferred-ineligible", {
8162
- reason: reason,
8163
- count: delta
8164
- }));
8165
- }
8166
- recordCategory(category) {
8167
- this.isEnabled() && (category & UpdateCategory.PAINT && (this.snapshot.categoryBreakdown.paint += 1), category & UpdateCategory.TRANSFORM && (this.snapshot.categoryBreakdown.transform += 1), category & UpdateCategory.SHAPE && (this.snapshot.categoryBreakdown.shape += 1), category & UpdateCategory.BOUNDS && (this.snapshot.categoryBreakdown.bounds += 1), category & UpdateCategory.LAYOUT && (this.snapshot.categoryBreakdown.layout += 1), category & UpdateCategory.PICK && (this.snapshot.categoryBreakdown.pick += 1));
8168
- }
8169
- recordRefresh(key, delta = 1) {
8170
- this.isEnabled() && (this.snapshot.refresh[key] += delta);
8171
- }
8172
- recordResolver(key, delta = 1) {
8173
- this.isEnabled() && (this.snapshot.resolver[key] += delta);
8174
- }
8175
- recordCost(kind, durationMs) {
8176
- if (this.isEnabled()) {
8177
- if ("resolver" === kind) return this.snapshot.cost.resolverTotalMs += durationMs, void (this.snapshot.cost.resolverMaxMs = Math.max(this.snapshot.cost.resolverMaxMs, durationMs));
8178
- if ("patch" === kind) return this.snapshot.cost.patchTotalMs += durationMs, void (this.snapshot.cost.patchMaxMs = Math.max(this.snapshot.cost.patchMaxMs, durationMs));
8179
- if ("sharedRefresh" === kind) return this.snapshot.cost.sharedRefreshTotalMs += durationMs, void (this.snapshot.cost.sharedRefreshMaxMs = Math.max(this.snapshot.cost.sharedRefreshMaxMs, durationMs));
8180
- this.snapshot.cost.batchSliceTotalMs += durationMs, this.snapshot.cost.batchSliceMaxMs = Math.max(this.snapshot.cost.batchSliceMaxMs, durationMs), this.snapshot.batch.maxFrameSliceCost = Math.max(this.snapshot.batch.maxFrameSliceCost, durationMs);
8181
- }
8182
- }
8183
- recordAllocation(key, delta = 1) {
8184
- this.isEnabled() && (this.snapshot.allocationHints[key] += delta);
8185
- }
8186
- updateBatchPending(pendingJobs) {
8187
- this.isEnabled() && (this.snapshot.batch.pendingJobs = pendingJobs, this.snapshot.batch.maxPendingJobs = Math.max(this.snapshot.batch.maxPendingJobs, pendingJobs));
8188
- }
8189
- updateMaxGraphicsInJob(count) {
8190
- this.isEnabled() && (this.snapshot.batch.maxGraphicsInJob = Math.max(this.snapshot.batch.maxGraphicsInJob, count));
8191
- }
8192
- recordEvent(type, detail) {
8193
- var _a, _b, _c;
8194
- if (!this.shouldRecordEvents()) return;
8195
- const events = null !== (_a = this.snapshot.events) && void 0 !== _a ? _a : this.snapshot.events = [];
8196
- events.push({
8197
- type: type,
8198
- at: Date.now(),
8199
- detail: detail
8200
- });
8201
- const max = null !== (_c = null === (_b = this.getConfig()) || void 0 === _b ? void 0 : _b.maxEventRecords) && void 0 !== _c ? _c : 100;
8202
- events.length > max && events.splice(0, events.length - max);
8203
- }
8204
- isEnabled() {
8205
- var _a;
8206
- return !0 === (null === (_a = this.getConfig()) || void 0 === _a ? void 0 : _a.enabled);
8207
- }
8208
- shouldRecordEvents() {
8209
- const config = this.getConfig();
8210
- return !!(null == config ? void 0 : config.enabled) && !!config.recordEvents;
8211
- }
8212
- getConfig() {
8213
- return "function" == typeof this.configSource ? this.configSource() : this.configSource;
8214
- }
8215
- }
8216
- function ensureStageStatePerfMonitor(stage) {
8217
- const stageAny = stage;
8218
- return stageAny[STAGE_PERF_MONITOR] || (stageAny[STAGE_PERF_MONITOR] = new StatePerfMonitor(() => stage.statePerfConfig)), stageAny[STAGE_PERF_MONITOR];
8219
- }
8220
- function getStageStatePerfMonitor(stage) {
8221
- if (stage) return stage[STAGE_PERF_MONITOR];
8222
- }
8223
- function getActiveStageStatePerfMonitor(stage) {
8224
- var _a;
8225
- if (!stage) return;
8226
- const current = getStageStatePerfMonitor(stage);
8227
- return current || (!0 === (null === (_a = stage.statePerfConfig) || void 0 === _a ? void 0 : _a.enabled) ? ensureStageStatePerfMonitor(stage) : void 0);
8228
- }
8229
-
8230
- function isPlainObject$1(value) {
7990
+ function isPlainObject(value) {
8231
7991
  return null != value && "object" == typeof value && !Array.isArray(value);
8232
7992
  }
8233
- function cloneValue$1(value) {
8234
- if (!isPlainObject$1(value)) return value;
7993
+ function cloneValue(value) {
7994
+ if (!isPlainObject(value)) return value;
8235
7995
  const clone = {};
8236
7996
  return Object.keys(value).forEach(key => {
8237
- clone[key] = cloneValue$1(value[key]);
7997
+ clone[key] = cloneValue(value[key]);
8238
7998
  }), clone;
8239
7999
  }
8240
- function deepMerge$1(base, value) {
8000
+ function deepMerge(base, value) {
8241
8001
  var _a;
8242
- const result = null !== (_a = cloneValue$1(base)) && void 0 !== _a ? _a : {};
8002
+ const result = null !== (_a = cloneValue(base)) && void 0 !== _a ? _a : {};
8243
8003
  return Object.keys(value).forEach(key => {
8244
8004
  const nextValue = value[key],
8245
8005
  previousValue = result[key];
8246
- isPlainObject$1(previousValue) && isPlainObject$1(nextValue) ? result[key] = deepMerge$1(previousValue, nextValue) : result[key] = cloneValue$1(nextValue);
8006
+ isPlainObject(previousValue) && isPlainObject(nextValue) ? result[key] = deepMerge(previousValue, nextValue) : result[key] = cloneValue(nextValue);
8247
8007
  }), result;
8248
8008
  }
8249
- const FULL_DEFINITION_KEYS = new Set(["name", "patch", "priority", "exclude", "suppress", "resolver", "declaredAffectedKeys"]);
8250
8009
  class StateEngine {
8251
8010
  constructor(options) {
8252
8011
  var _a;
8253
- this._activeStates = [], this._effectiveStates = [], this._suppressed = [], this._resolvedPatch = {}, this.resolverPatchCache = new Map(), this.resolverCacheKey = "", this.resolverCacheValid = !1, this.baseAttributes = {}, this.compiledDefinitions = options.compiledDefinitions, this.stateSort = options.stateSort, this.stateProxy = options.stateProxy, this.stateProxyEligibility = options.stateProxyEligibility, this.states = options.states, this.mergeMode = null !== (_a = options.mergeMode) && void 0 !== _a ? _a : "shallow";
8012
+ this._activeStates = [], this._effectiveStates = [], this._suppressed = [], this._resolvedPatch = {}, this.resolverPatchCache = new Map(), this.resolverCacheKey = "", this.resolverCacheValid = !1, this.baseAttributes = {}, this.compiledDefinitions = options.compiledDefinitions, this.stateSort = options.stateSort, this.mergeMode = null !== (_a = options.mergeMode) && void 0 !== _a ? _a : "shallow";
8254
8013
  }
8255
8014
  get activeStates() {
8256
8015
  return this._activeStates;
@@ -8320,23 +8079,11 @@
8320
8079
  };
8321
8080
  }
8322
8081
  invalidateResolverCache() {
8323
- var _a, _b;
8324
- this.resolverPatchCache.clear(), this.resolverCacheKey = "", this.resolverCacheValid = !1, null === (_b = getActiveStageStatePerfMonitor(null === (_a = this.graphic) || void 0 === _a ? void 0 : _a.stage)) || void 0 === _b || _b.recordResolver("invalidations");
8082
+ this.resolverPatchCache.clear(), this.resolverCacheKey = "", this.resolverCacheValid = !1;
8325
8083
  }
8326
8084
  hasState(stateName) {
8327
8085
  return !!this._activeStates.length && (null == stateName || this._activeStates.includes(stateName));
8328
8086
  }
8329
- getCompatPatch(stateName) {
8330
- var _a, _b, _c;
8331
- const targetStates = this._activeStates.length ? this._activeStates : this._effectiveStates,
8332
- canUseStateProxy = this.canUseStateProxy(stateName),
8333
- proxyPatch = canUseStateProxy ? null === (_a = this.stateProxy) || void 0 === _a ? void 0 : _a.call(this, stateName, targetStates) : void 0;
8334
- if (this.stateProxy && canUseStateProxy) return null != proxyPatch ? proxyPatch : void 0;
8335
- const value = null === (_b = this.states) || void 0 === _b ? void 0 : _b[stateName];
8336
- if (null == value) return;
8337
- if (!isPlainObject$1(value)) return value;
8338
- return Object.keys(value).some(key => FULL_DEFINITION_KEYS.has(key)) ? cloneValue$1(null !== (_c = value.patch) && void 0 !== _c ? _c : void 0) : value;
8339
- }
8340
8087
  sortStates(states) {
8341
8088
  const withDefinition = [],
8342
8089
  withoutDefinition = [];
@@ -8367,68 +8114,33 @@
8367
8114
  };
8368
8115
  }
8369
8116
  recomputePatch(effectiveStates) {
8370
- var _a;
8371
- const perfMonitor = getActiveStageStatePerfMonitor(null === (_a = this.graphic) || void 0 === _a ? void 0 : _a.stage),
8372
- patchStart = perfMonitor ? performance.now() : 0;
8373
- let resolverCost = 0;
8374
8117
  const cacheKey = effectiveStates.join(","),
8375
- nextPatch = {};
8376
- if (null == perfMonitor || perfMonitor.recordAllocation("patchObjectsCreated"), this.resolverCacheValid && this.resolverCacheKey === cacheKey ? effectiveStates.forEach(stateName => {
8118
+ nextPatch = {},
8119
+ useResolverCache = this.resolverCacheValid && this.resolverCacheKey === cacheKey;
8120
+ useResolverCache || (this.resolverPatchCache.clear(), this.resolverCacheKey = cacheKey), effectiveStates.forEach(stateName => {
8377
8121
  var _a;
8378
- const canUseStateProxy = this.canUseStateProxy(stateName),
8379
- proxyPatch = canUseStateProxy ? null === (_a = this.stateProxy) || void 0 === _a ? void 0 : _a.call(this, stateName, effectiveStates) : void 0;
8380
- if (this.stateProxy && canUseStateProxy) return void (null != proxyPatch && this.mergeInto(nextPatch, proxyPatch));
8381
8122
  const definition = this.compiledDefinitions.get(stateName);
8382
- if (definition) {
8383
- if (definition.patch && this.mergeInto(nextPatch, definition.patch), definition.hasResolver) {
8384
- const cachedPatch = this.resolverPatchCache.get(stateName);
8385
- cachedPatch && (null == perfMonitor || perfMonitor.recordResolver("cacheHits"), this.mergeInto(nextPatch, cachedPatch));
8386
- }
8387
- } else {
8388
- const compatPatch = this.getCompatPatch(stateName);
8389
- compatPatch && this.mergeInto(nextPatch, compatPatch);
8390
- }
8391
- }) : (this.resolverPatchCache.clear(), this.resolverCacheKey = cacheKey, effectiveStates.forEach(stateName => {
8392
- var _a;
8393
- const canUseStateProxy = this.canUseStateProxy(stateName),
8394
- proxyPatch = canUseStateProxy ? null === (_a = this.stateProxy) || void 0 === _a ? void 0 : _a.call(this, stateName, effectiveStates) : void 0;
8395
- if (this.stateProxy && canUseStateProxy) return void (null != proxyPatch && this.mergeInto(nextPatch, proxyPatch));
8396
- const definition = this.compiledDefinitions.get(stateName);
8397
- if (definition) {
8398
- if (definition.patch && this.mergeInto(nextPatch, definition.patch), definition.hasResolver && definition.resolver) {
8399
- null == perfMonitor || perfMonitor.recordResolver("cacheMisses");
8400
- const resolverStart = perfMonitor ? performance.now() : 0,
8401
- resolverPatch = definition.resolver({
8402
- graphic: this.graphic,
8403
- activeStates: this._activeStates,
8404
- effectiveStates: this._effectiveStates,
8405
- baseAttributes: this.baseAttributes,
8406
- resolvedPatch: nextPatch
8407
- });
8408
- if (perfMonitor) {
8409
- const duration = performance.now() - resolverStart;
8410
- resolverCost += duration, perfMonitor.recordCost("resolver", duration);
8411
- }
8412
- resolverPatch && (this.resolverPatchCache.set(stateName, resolverPatch), this.mergeInto(nextPatch, resolverPatch));
8413
- }
8414
- } else {
8415
- const compatPatch = this.getCompatPatch(stateName);
8416
- compatPatch && this.mergeInto(nextPatch, compatPatch);
8123
+ if (definition && (definition.patch && this.mergeInto(nextPatch, definition.patch), definition.hasResolver)) {
8124
+ const resolverPatch = useResolverCache ? this.resolverPatchCache.get(stateName) : null === (_a = definition.resolver) || void 0 === _a ? void 0 : _a.call(definition, {
8125
+ graphic: this.graphic,
8126
+ activeStates: this._activeStates,
8127
+ effectiveStates: this._effectiveStates,
8128
+ baseAttributes: this.baseAttributes,
8129
+ resolvedPatch: nextPatch
8130
+ });
8131
+ resolverPatch && (useResolverCache || this.resolverPatchCache.set(stateName, resolverPatch), this.mergeInto(nextPatch, resolverPatch));
8417
8132
  }
8418
- }), this.resolverCacheValid = !0), this._resolvedPatch = nextPatch, perfMonitor) {
8419
- const totalCost = performance.now() - patchStart;
8420
- perfMonitor.recordCost("patch", Math.max(0, totalCost - resolverCost));
8421
- }
8133
+ }), useResolverCache || (this.resolverCacheValid = !0), this._resolvedPatch = nextPatch;
8422
8134
  }
8423
8135
  mergeInto(target, patch) {
8424
8136
  "deep" !== this.mergeMode ? Object.keys(patch).forEach(key => {
8425
- target[key] = cloneValue$1(patch[key]);
8137
+ target[key] = cloneValue(patch[key]);
8426
8138
  }) : Object.keys(patch).forEach(key => {
8427
8139
  var _a;
8428
8140
  const nextValue = patch[key],
8429
8141
  previousValue = target[key],
8430
8142
  baseValue = null === (_a = this.baseAttributes) || void 0 === _a ? void 0 : _a[key];
8431
- isPlainObject$1(previousValue) && isPlainObject$1(nextValue) ? target[key] = deepMerge$1(previousValue, nextValue) : !isPlainObject$1(previousValue) && isPlainObject$1(baseValue) && isPlainObject$1(nextValue) ? target[key] = deepMerge$1(baseValue, nextValue) : target[key] = cloneValue$1(nextValue);
8143
+ isPlainObject(previousValue) && isPlainObject(nextValue) ? target[key] = deepMerge(previousValue, nextValue) : !isPlainObject(previousValue) && isPlainObject(baseValue) && isPlainObject(nextValue) ? target[key] = deepMerge(baseValue, nextValue) : target[key] = cloneValue(nextValue);
8432
8144
  });
8433
8145
  }
8434
8146
  sameArray(left, right) {
@@ -8436,186 +8148,50 @@
8436
8148
  for (let index = 0; index < left.length; index++) if (left[index] !== right[index]) return !1;
8437
8149
  return !0;
8438
8150
  }
8439
- canUseStateProxy(stateName) {
8440
- return !!this.stateProxy && (!this.stateProxyEligibility || this.stateProxyEligibility(stateName));
8441
- }
8442
- }
8443
-
8444
- class StateModel {
8445
- constructor(options = {}) {
8446
- var _a;
8447
- this.exclusiveGroupMap = new Map(), this.exclusiveGroups = new Map(), this.states = options.states, this.currentStates = options.currentStates ? [...options.currentStates] : void 0, this.stateSort = options.stateSort, this.stateProxy = options.stateProxy, this.stateEngine = options.stateEngine, this.stateEngine && options.currentStates && !this.sameStates(this.stateEngine.activeStates, options.currentStates) && this.stateEngine.applyStates(options.currentStates);
8448
- const exclusiveGroups = null !== (_a = options.exclusiveGroups) && void 0 !== _a ? _a : {};
8449
- for (const groupName in exclusiveGroups) Object.prototype.hasOwnProperty.call(exclusiveGroups, groupName) && this.registerExclusiveGroup(groupName, exclusiveGroups[groupName]);
8450
- }
8451
- getCurrentStates() {
8452
- return this.currentStates ? [...this.currentStates] : [];
8453
- }
8454
- hasState(stateName) {
8455
- return this.stateEngine ? this.stateEngine.hasState(stateName) : !(!this.currentStates || !this.currentStates.length) && (null == stateName || this.currentStates.includes(stateName));
8456
- }
8457
- getState(stateName) {
8458
- var _a;
8459
- return null === (_a = this.states) || void 0 === _a ? void 0 : _a[stateName];
8460
- }
8461
- useStates(states) {
8462
- var _a;
8463
- if (this.stateEngine) {
8464
- const result = this.stateEngine.applyStates(states);
8465
- return this.currentStates = [...result.activeStates], {
8466
- changed: result.changed,
8467
- states: [...result.activeStates],
8468
- effectiveStates: [...result.effectiveStates]
8469
- };
8470
- }
8471
- if (!states.length) return this.clearStates();
8472
- const previousStates = null !== (_a = this.currentStates) && void 0 !== _a ? _a : [],
8473
- changed = previousStates.length !== states.length || states.some((stateName, index) => previousStates[index] !== stateName),
8474
- nextStates = this.sortStates(states);
8475
- return changed && (this.currentStates = nextStates), {
8476
- changed: changed,
8477
- states: changed ? [...nextStates] : [...previousStates]
8478
- };
8479
- }
8480
- clearStates() {
8481
- if (this.stateEngine) {
8482
- const result = this.stateEngine.clearStates();
8483
- return this.currentStates = [], {
8484
- changed: result.changed,
8485
- states: [],
8486
- effectiveStates: []
8487
- };
8488
- }
8489
- const changed = this.hasState();
8490
- return this.currentStates = [], {
8491
- changed: changed,
8492
- states: []
8493
- };
8494
- }
8495
- addState(stateName, keepCurrentStates) {
8496
- var _a;
8497
- if (this.stateEngine) {
8498
- const result = this.stateEngine.addState(stateName, keepCurrentStates);
8499
- return this.currentStates = [...result.activeStates], {
8500
- changed: result.changed,
8501
- states: [...result.activeStates],
8502
- effectiveStates: [...result.effectiveStates]
8503
- };
8504
- }
8505
- if (this.currentStates && this.currentStates.includes(stateName) && (keepCurrentStates || 1 === this.currentStates.length)) return {
8506
- changed: !1,
8507
- states: this.getCurrentStates()
8508
- };
8509
- const nextStates = keepCurrentStates && (null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) ? this.currentStates.concat([stateName]) : [stateName];
8510
- return this.useStates(nextStates);
8511
- }
8512
- removeState(stateName) {
8513
- if (this.stateEngine) {
8514
- const result = this.stateEngine.removeState(stateName);
8515
- return this.currentStates = [...result.activeStates], {
8516
- changed: result.changed,
8517
- states: [...result.activeStates],
8518
- effectiveStates: [...result.effectiveStates]
8519
- };
8520
- }
8521
- if (!this.currentStates) return {
8522
- changed: !1,
8523
- states: []
8524
- };
8525
- const filter = Array.isArray(stateName) ? s => !stateName.includes(s) : s => s !== stateName,
8526
- nextStates = this.currentStates.filter(filter);
8527
- return nextStates.length === this.currentStates.length ? {
8528
- changed: !1,
8529
- states: this.getCurrentStates()
8530
- } : this.useStates(nextStates);
8531
- }
8532
- toggleState(stateName) {
8533
- if (this.stateEngine) {
8534
- const result = this.stateEngine.toggleState(stateName);
8535
- return this.currentStates = [...result.activeStates], {
8536
- changed: result.changed,
8537
- states: [...result.activeStates],
8538
- effectiveStates: [...result.effectiveStates]
8539
- };
8540
- }
8541
- if (this.hasState(stateName)) return this.removeState(stateName);
8542
- const nextStates = this.currentStates ? this.currentStates.slice() : [];
8543
- return nextStates.includes(stateName) || nextStates.push(stateName), this.useStates(nextStates);
8544
- }
8545
- sortStates(states) {
8546
- return this.stateEngine ? [...this.stateEngine.activeStates] : this.stateSort ? [...states].sort(this.stateSort) : [...states];
8547
- }
8548
- registerExclusiveGroup(groupName, states) {
8549
- const uniqueStates = Array.from(new Set(states));
8550
- this.exclusiveGroups.set(groupName, uniqueStates), uniqueStates.forEach(stateName => this.exclusiveGroupMap.set(stateName, groupName));
8551
- }
8552
- getExclusiveGroup(stateName) {
8553
- return this.exclusiveGroupMap.get(stateName);
8554
- }
8555
- getMutuallyExclusiveStates(stateName) {
8556
- var _a;
8557
- const groupName = this.getExclusiveGroup(stateName);
8558
- return groupName ? (null !== (_a = this.exclusiveGroups.get(groupName)) && void 0 !== _a ? _a : []).filter(name => name !== stateName) : [];
8559
- }
8560
- isMutuallyExclusive(stateA, stateB) {
8561
- const groupName = this.getExclusiveGroup(stateA);
8562
- return !!groupName && groupName === this.getExclusiveGroup(stateB) && stateA !== stateB;
8563
- }
8564
- get effectiveStates() {
8565
- var _a, _b, _c;
8566
- return null !== (_c = null !== (_b = null === (_a = this.stateEngine) || void 0 === _a ? void 0 : _a.effectiveStates) && void 0 !== _b ? _b : this.currentStates) && void 0 !== _c ? _c : [];
8567
- }
8568
- get resolvedPatch() {
8569
- var _a;
8570
- return null === (_a = this.stateEngine) || void 0 === _a ? void 0 : _a.resolvedPatch;
8571
- }
8572
- sameStates(left, right) {
8573
- if (left.length !== right.length) return !1;
8574
- for (let index = 0; index < left.length; index++) if (left[index] !== right[index]) return !1;
8575
- return !0;
8576
- }
8577
8151
  }
8578
8152
 
8579
- function isPlainObject(value) {
8580
- return null != value && "object" == typeof value && !Array.isArray(value);
8581
- }
8582
- function cloneValue(value) {
8583
- if (!isPlainObject(value)) return value;
8584
- const clone = {};
8585
- for (const key in value) Object.prototype.hasOwnProperty.call(value, key) && (clone[key] = cloneValue(value[key]));
8586
- return clone;
8587
- }
8588
- function deepMerge(base, value) {
8589
- const result = cloneValue(base) || {};
8590
- for (const key in value) {
8591
- if (!Object.prototype.hasOwnProperty.call(value, key)) continue;
8592
- const nextValue = value[key],
8593
- previousValue = result[key];
8594
- isPlainObject(previousValue) && isPlainObject(nextValue) ? result[key] = deepMerge(previousValue, nextValue) : result[key] = cloneValue(nextValue);
8595
- }
8596
- return result;
8597
- }
8598
- class StateStyleResolver {
8599
- constructor(options = {}) {
8600
- this.options = options;
8601
- }
8602
- resolve(normalAttrs, states, stateProxy, currentStates, stateSort) {
8603
- var _a;
8604
- const mergeMode = null !== (_a = this.options.mergeMode) && void 0 !== _a ? _a : "shallow",
8605
- sortedStates = stateSort ? currentStates.slice().sort(stateSort) : currentStates.slice(),
8606
- resolvedAttrs = {};
8607
- return sortedStates.forEach(stateName => {
8608
- const attrs = stateProxy ? stateProxy(stateName, sortedStates) : null == states ? void 0 : states[stateName];
8609
- if (null != attrs) for (const key in attrs) {
8610
- if (!Object.prototype.hasOwnProperty.call(attrs, key)) continue;
8611
- const nextValue = attrs[key];
8612
- if ("deep" === mergeMode && isPlainObject(nextValue) && (isPlainObject(resolvedAttrs[key]) || isPlainObject(normalAttrs[key]))) {
8613
- const baseValue = isPlainObject(resolvedAttrs[key]) ? resolvedAttrs[key] : isPlainObject(normalAttrs[key]) ? normalAttrs[key] : {};
8614
- resolvedAttrs[key] = deepMerge(baseValue, nextValue);
8615
- } else resolvedAttrs[key] = cloneValue(nextValue);
8616
- }
8617
- }), resolvedAttrs;
8153
+ var UpdateCategory;
8154
+ !function (UpdateCategory) {
8155
+ UpdateCategory[UpdateCategory.NONE = 0] = "NONE", UpdateCategory[UpdateCategory.PAINT = 1] = "PAINT", UpdateCategory[UpdateCategory.SHAPE = 2] = "SHAPE", UpdateCategory[UpdateCategory.BOUNDS = 4] = "BOUNDS", UpdateCategory[UpdateCategory.TRANSFORM = 8] = "TRANSFORM", UpdateCategory[UpdateCategory.LAYOUT = 16] = "LAYOUT", UpdateCategory[UpdateCategory.PICK = 32] = "PICK";
8156
+ }(UpdateCategory || (UpdateCategory = {}));
8157
+ const ATTRIBUTE_CATEGORY = {
8158
+ fill: UpdateCategory.PAINT,
8159
+ opacity: UpdateCategory.PAINT,
8160
+ fillOpacity: UpdateCategory.PAINT,
8161
+ strokeOpacity: UpdateCategory.PAINT,
8162
+ lineDash: UpdateCategory.PAINT,
8163
+ lineDashOffset: UpdateCategory.PAINT,
8164
+ lineCap: UpdateCategory.PAINT,
8165
+ lineJoin: UpdateCategory.PAINT,
8166
+ miterLimit: UpdateCategory.PAINT,
8167
+ shadowColor: UpdateCategory.PAINT,
8168
+ x: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
8169
+ y: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
8170
+ scaleX: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
8171
+ scaleY: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
8172
+ angle: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
8173
+ anchor: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
8174
+ anchor3d: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
8175
+ postMatrix: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
8176
+ layout: UpdateCategory.LAYOUT,
8177
+ zIndex: UpdateCategory.PAINT,
8178
+ visible: UpdateCategory.PAINT | UpdateCategory.PICK,
8179
+ lineWidth: UpdateCategory.SHAPE | UpdateCategory.BOUNDS | UpdateCategory.PICK,
8180
+ width: UpdateCategory.SHAPE | UpdateCategory.BOUNDS,
8181
+ height: UpdateCategory.SHAPE | UpdateCategory.BOUNDS
8182
+ };
8183
+ const ATTRIBUTE_DELTA_CLASSIFIER = {
8184
+ stroke: (prev, next) => (null != prev && !1 !== prev) !== (null != next && !1 !== next) ? UpdateCategory.PAINT | UpdateCategory.BOUNDS | UpdateCategory.PICK : UpdateCategory.PAINT,
8185
+ shadowBlur: (prev, next) => {
8186
+ const prevBlur = Number(null != prev ? prev : 0),
8187
+ nextBlur = Number(null != next ? next : 0);
8188
+ return prevBlur !== nextBlur && (prevBlur > 0 || nextBlur > 0) ? UpdateCategory.PAINT | UpdateCategory.BOUNDS : UpdateCategory.PAINT;
8618
8189
  }
8190
+ };
8191
+ function classifyAttributeDelta(key, prev, next) {
8192
+ var _a;
8193
+ const dynamicClassifier = ATTRIBUTE_DELTA_CLASSIFIER[key];
8194
+ return dynamicClassifier ? dynamicClassifier(prev, next) : null !== (_a = ATTRIBUTE_CATEGORY[key]) && void 0 !== _a ? _a : UpdateCategory.PAINT;
8619
8195
  }
8620
8196
 
8621
8197
  function hasOwnKeys(value) {
@@ -8625,25 +8201,22 @@
8625
8201
  return config ? Array.isArray(config) ? config.reduce((acc, key) => (acc[key] = 1, acc), {}) : Object.keys(config).reduce((acc, key) => (config[key] && (acc[key] = 1), acc), {}) : {};
8626
8202
  }
8627
8203
  class StateTransitionOrchestrator {
8628
- analyzeTransition(_currentAttrs, targetAttrs, stateNames, hasAnimation, options = {}) {
8204
+ analyzeTransition(targetAttrs, hasAnimation, options = {}) {
8629
8205
  var _a, _b;
8630
8206
  const plan = {
8631
- stateNames: stateNames,
8632
8207
  targetAttrs: Object.assign({}, targetAttrs),
8633
8208
  animateAttrs: {},
8634
- jumpAttrs: {},
8635
8209
  noAnimateAttrs: {}
8636
8210
  };
8637
8211
  if (!hasAnimation) return plan;
8638
8212
  const noWorkAnimateAttr = Object.assign(Object.assign({}, null !== (_a = options.noWorkAnimateAttr) && void 0 !== _a ? _a : {}), normalizeNoAnimateAttrConfig(null === (_b = options.animateConfig) || void 0 === _b ? void 0 : _b.noAnimateAttrs)),
8639
8213
  isClear = !0 === options.isClear,
8640
- getDefaultAttribute = options.getDefaultAttribute,
8214
+ readDefaultAttribute = options.getDefaultAttribute,
8641
8215
  shouldSkipDefaultAttribute = options.shouldSkipDefaultAttribute,
8642
8216
  assignTransitionAttr = (key, value) => {
8643
- if (noWorkAnimateAttr[key]) return plan.jumpAttrs[key] = value, void (plan.noAnimateAttrs[key] = value);
8644
- if (isClear && void 0 === value) {
8217
+ if (noWorkAnimateAttr[key]) plan.noAnimateAttrs[key] = value;else if (isClear && void 0 === value) {
8645
8218
  if (null == shouldSkipDefaultAttribute ? void 0 : shouldSkipDefaultAttribute(key, targetAttrs)) return;
8646
- plan.animateAttrs[key] = getDefaultAttribute ? getDefaultAttribute(key) : value;
8219
+ plan.animateAttrs[key] = readDefaultAttribute(key);
8647
8220
  } else plan.animateAttrs[key] = value;
8648
8221
  };
8649
8222
  for (const key in targetAttrs) {
@@ -8679,13 +8252,13 @@
8679
8252
  type: exports.AttributeUpdateType.STATE
8680
8253
  }), plan;
8681
8254
  }
8682
- applyClearTransition(graphic, targetAttrs, hasAnimation, stateNames, options = {}) {
8683
- var _a, _b, _c, _d;
8684
- const plan = this.analyzeTransition({}, targetAttrs, stateNames, hasAnimation, {
8685
- noWorkAnimateAttr: null === (_a = graphic.getNoWorkAnimateAttr) || void 0 === _a ? void 0 : _a.call(graphic),
8255
+ applyClearTransition(graphic, targetAttrs, hasAnimation, options = {}) {
8256
+ var _a;
8257
+ const plan = this.analyzeTransition(targetAttrs, hasAnimation, {
8258
+ noWorkAnimateAttr: graphic.getNoWorkAnimateAttr(),
8686
8259
  isClear: !0,
8687
- getDefaultAttribute: null === (_b = graphic.getDefaultAttribute) || void 0 === _b ? void 0 : _b.bind(graphic),
8688
- shouldSkipDefaultAttribute: null !== (_c = options.shouldSkipDefaultAttribute) && void 0 !== _c ? _c : null === (_d = graphic.shouldSkipStateTransitionDefaultAttribute) || void 0 === _d ? void 0 : _d.bind(graphic),
8260
+ getDefaultAttribute: graphic.getDefaultAttribute.bind(graphic),
8261
+ shouldSkipDefaultAttribute: null !== (_a = options.shouldSkipDefaultAttribute) && void 0 !== _a ? _a : graphic.shouldSkipStateTransitionDefaultAttribute.bind(graphic),
8689
8262
  animateConfig: options.animateConfig,
8690
8263
  extraAnimateAttrs: options.extraAnimateAttrs
8691
8264
  });
@@ -8694,23 +8267,11 @@
8694
8267
  }
8695
8268
 
8696
8269
  const compiler = new StateDefinitionCompiler();
8697
- function copyDefinitions(definitions) {
8698
- return definitions ? Object.assign({}, definitions) : {};
8699
- }
8700
8270
  function buildEffectiveSourceDefinitions(parentScope, localStateDefinitions, themeStateDefinitions) {
8701
- const merged = copyDefinitions(parentScope ? parentScope.effectiveSourceDefinitions : themeStateDefinitions);
8702
- return localStateDefinitions && Object.keys(localStateDefinitions).forEach(stateName => {
8703
- merged[stateName] = localStateDefinitions[stateName];
8704
- }), merged;
8705
- }
8706
- function initializeScope(scope, revision = 0) {
8707
- var _a;
8708
- const effectiveSourceDefinitions = buildEffectiveSourceDefinitions(scope.parentScope, scope.localStateDefinitions, scope.themeStateDefinitions);
8709
- return scope.effectiveSourceDefinitions = effectiveSourceDefinitions, scope.effectiveCompiledDefinitions = compiler.compile(effectiveSourceDefinitions), scope.parentRevisionAtBuild = null === (_a = scope.parentScope) || void 0 === _a ? void 0 : _a.revision, scope.revision = revision, scope.dirty = !1, scope;
8271
+ return Object.assign({}, parentScope ? parentScope.effectiveSourceDefinitions : themeStateDefinitions, localStateDefinitions);
8710
8272
  }
8711
8273
  function createRootSharedStateScope(stage, themeStateDefinitions) {
8712
- return initializeScope({
8713
- ownerKind: "root",
8274
+ return rebuildSharedStateScope({
8714
8275
  ownerStage: stage,
8715
8276
  themeStateDefinitions: themeStateDefinitions,
8716
8277
  effectiveSourceDefinitions: {},
@@ -8721,9 +8282,7 @@
8721
8282
  }, 0);
8722
8283
  }
8723
8284
  function createGroupSharedStateScope(group, parentScope, localStateDefinitions) {
8724
- return initializeScope({
8725
- ownerKind: "group",
8726
- ownerGroup: group,
8285
+ return rebuildSharedStateScope({
8727
8286
  ownerStage: group.stage,
8728
8287
  parentScope: parentScope,
8729
8288
  localStateDefinitions: localStateDefinitions,
@@ -8743,14 +8302,13 @@
8743
8302
  function setRootSharedStateScopeThemeDefinitions(scope, themeStateDefinitions) {
8744
8303
  return scope.themeStateDefinitions !== themeStateDefinitions && (scope.themeStateDefinitions = themeStateDefinitions, rebuildSharedStateScope(scope), !0);
8745
8304
  }
8746
- function rebuildSharedStateScope(scope) {
8305
+ function rebuildSharedStateScope(scope, revision = scope.revision + 1) {
8747
8306
  var _a;
8748
8307
  const effectiveSourceDefinitions = buildEffectiveSourceDefinitions(scope.parentScope, scope.localStateDefinitions, scope.themeStateDefinitions);
8749
- return scope.effectiveSourceDefinitions = effectiveSourceDefinitions, scope.effectiveCompiledDefinitions = compiler.compile(effectiveSourceDefinitions), scope.parentRevisionAtBuild = null === (_a = scope.parentScope) || void 0 === _a ? void 0 : _a.revision, scope.revision += 1, scope.dirty = !1, scope;
8308
+ return scope.effectiveSourceDefinitions = effectiveSourceDefinitions, scope.effectiveCompiledDefinitions = compiler.compile(effectiveSourceDefinitions), scope.parentRevisionAtBuild = null === (_a = scope.parentScope) || void 0 === _a ? void 0 : _a.revision, scope.revision = revision, scope.dirty = !1, scope;
8750
8309
  }
8751
8310
  function ensureSharedStateScopeFresh(scope) {
8752
- var _a;
8753
- if (scope) return null === (_a = getActiveStageStatePerfMonitor(scope.ownerStage)) || void 0 === _a || _a.recordRefresh("ensureFreshCalls"), scope.parentScope && ensureSharedStateScopeFresh(scope.parentScope), (scope.dirty || scope.parentScope && scope.parentRevisionAtBuild !== scope.parentScope.revision) && rebuildSharedStateScope(scope), scope;
8311
+ if (scope) return scope.parentScope && ensureSharedStateScopeFresh(scope.parentScope), (scope.dirty || scope.parentScope && scope.parentRevisionAtBuild !== scope.parentScope.revision) && rebuildSharedStateScope(scope), scope;
8754
8312
  }
8755
8313
  function collectSharedStateScopeChain(scope) {
8756
8314
  const chain = [];
@@ -8760,43 +8318,27 @@
8760
8318
  }
8761
8319
 
8762
8320
  function scheduleStageSharedStateRefresh(stage) {
8763
- var _a;
8764
- stage && "released" !== stage.releaseStatus && (null === (_a = getActiveStageStatePerfMonitor(stage)) || void 0 === _a || _a.recordRefresh("renderScheduled"), stage.renderNextFrame());
8321
+ stage && "released" !== stage.releaseStatus && stage.renderNextFrame();
8765
8322
  }
8766
8323
  function enqueueGraphicSharedStateRefresh(stage, graphic) {
8767
8324
  var _a;
8768
8325
  if (!stage) return;
8769
- const pending = null !== (_a = stage._pendingSharedStateRefreshGraphics) && void 0 !== _a ? _a : stage._pendingSharedStateRefreshGraphics = new Set();
8770
- if (!pending.has(graphic)) {
8771
- pending.add(graphic);
8772
- const perfMonitor = getActiveStageStatePerfMonitor(stage);
8773
- null == perfMonitor || perfMonitor.recordRefresh("queuedGraphics"), null == perfMonitor || perfMonitor.recordAllocation("refreshQueuePushes");
8774
- }
8326
+ (null !== (_a = stage._pendingSharedStateRefreshGraphics) && void 0 !== _a ? _a : stage._pendingSharedStateRefreshGraphics = new Set()).add(graphic);
8775
8327
  }
8776
8328
  function markScopeActiveDescendantsDirty(scope, stage) {
8777
- let marked = !1;
8778
- scope.subtreeActiveDescendants.forEach(graphic => {
8329
+ scope.subtreeActiveDescendants.size && (scope.subtreeActiveDescendants.forEach(graphic => {
8779
8330
  var _a;
8780
8331
  graphic.sharedStateDirty = !0;
8781
- enqueueGraphicSharedStateRefresh(null !== (_a = null != stage ? stage : graphic.stage) && void 0 !== _a ? _a : scope.ownerStage, graphic), marked = !0;
8782
- }), marked && scheduleStageSharedStateRefresh(null != stage ? stage : scope.ownerStage);
8332
+ enqueueGraphicSharedStateRefresh(null !== (_a = null != stage ? stage : graphic.stage) && void 0 !== _a ? _a : scope.ownerStage, graphic);
8333
+ }), scheduleStageSharedStateRefresh(null != stage ? stage : scope.ownerStage));
8783
8334
  }
8784
8335
  function flushStageSharedStateRefresh(stage) {
8785
8336
  const pending = stage._pendingSharedStateRefreshGraphics;
8786
8337
  if (!pending || !pending.size) return;
8787
- const perfMonitor = getActiveStageStatePerfMonitor(stage),
8788
- start = perfMonitor ? performance.now() : 0,
8789
- graphics = Array.from(pending.values());
8790
- pending.clear(), null == perfMonitor || perfMonitor.recordRefresh("flushedGraphics", graphics.length), graphics.forEach(graphic => {
8791
- if ("released" === graphic.releaseStatus) return;
8792
- if (graphic.stage !== stage) return;
8793
- if (!graphic.sharedStateDirty) return;
8794
- const refresh = graphic.refreshSharedStateBeforeRender;
8795
- "function" == typeof refresh && (refresh.call(graphic), null == perfMonitor || perfMonitor.incrementCounter("sharedRefreshCommits"));
8796
- }), perfMonitor && (perfMonitor.recordCost("sharedRefresh", performance.now() - start), perfMonitor.recordEvent("shared-refresh-flush", {
8797
- stageId: stage._uid,
8798
- flushedGraphics: graphics.length
8799
- }));
8338
+ const graphics = Array.from(pending.values());
8339
+ pending.clear(), graphics.forEach(graphic => {
8340
+ "released" !== graphic.releaseStatus && graphic.stage === stage && graphic.sharedStateDirty && graphic.refreshSharedStateBeforeRender();
8341
+ });
8800
8342
  }
8801
8343
 
8802
8344
  const _tempBounds$1 = new AABBBounds(),
@@ -8807,10 +8349,8 @@
8807
8349
  tempConstantScaleXYKey = ["scaleX", "scaleY"],
8808
8350
  tempConstantAngleKey = ["angle"],
8809
8351
  builtinTextureTypes = new Set(["circle", "diamond", "rect", "vertical-line", "horizontal-line", "bias-lr", "bias-rl", "grid", "wave"]),
8810
- FULL_STATE_DEFINITION_KEYS = new Set(["name", "patch", "priority", "exclude", "suppress", "resolver", "declaredAffectedKeys"]),
8811
8352
  point = new Point(),
8812
8353
  EMPTY_STATE_NAMES = [],
8813
- deprecatedLocalStateFallbackWarningStateNames = new Set(),
8814
8354
  BROAD_UPDATE_CATEGORY = UpdateCategory.PAINT | UpdateCategory.SHAPE | UpdateCategory.BOUNDS | UpdateCategory.TRANSFORM | UpdateCategory.LAYOUT;
8815
8355
  function isPlainObjectValue(value) {
8816
8356
  return "object" == typeof value && null != value && !Array.isArray(value);
@@ -8924,11 +8464,6 @@
8924
8464
  getAttributes() {
8925
8465
  return this.attribute;
8926
8466
  }
8927
- getStateStyleResolver(mergeMode) {
8928
- return "deep" === mergeMode ? (this.deepStateStyleResolver || (this.deepStateStyleResolver = new StateStyleResolver({
8929
- mergeMode: "deep"
8930
- })), this.deepStateStyleResolver) : (this.stateStyleResolver || (this.stateStyleResolver = new StateStyleResolver()), this.stateStyleResolver);
8931
- }
8932
8467
  getStateTransitionOrchestrator() {
8933
8468
  return this.stateTransitionOrchestrator || (this.stateTransitionOrchestrator = new StateTransitionOrchestrator()), this.stateTransitionOrchestrator;
8934
8469
  }
@@ -8944,7 +8479,7 @@
8944
8479
  syncSharedStateScopeBindingFromTree(markDirty = !0) {
8945
8480
  var _a;
8946
8481
  const nextScope = this.resolveBoundSharedStateScope();
8947
- return this.boundSharedStateScope === nextScope ? (this.syncSharedStateActiveRegistrations(), !1) : (this.boundSharedStateScope = nextScope, this.boundSharedStateRevision = void 0, this.localFallbackCompiledDefinitions = void 0, this.compiledStateDefinitions = void 0, this.compiledStateDefinitionsCacheKey = void 0, this.stateEngine = void 0, this.stateEngineCompiledDefinitions = void 0, this.stateEngineStateProxyModeKey = void 0, this.syncSharedStateActiveRegistrations(), markDirty && (null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) && this.markSharedStateDirty(), !0);
8482
+ return this.boundSharedStateScope === nextScope ? (this.syncSharedStateActiveRegistrations(), !1) : (this.boundSharedStateScope = nextScope, this.boundSharedStateRevision = void 0, this.compiledStateDefinitions = void 0, this.compiledStateDefinitionsCacheKey = void 0, this.stateEngine = void 0, this.stateEngineCompiledDefinitions = void 0, this.syncSharedStateActiveRegistrations(), markDirty && (null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) && this.markSharedStateDirty(), !0);
8948
8483
  }
8949
8484
  syncSharedStateScopeBindingOnTreeChange(markDirty = !0) {
8950
8485
  var _a, _b;
@@ -8983,13 +8518,7 @@
8983
8518
  }
8984
8519
  getLocalStatesVersion() {
8985
8520
  var _a, _b;
8986
- return this.localStateDefinitionsSource !== this.states && (this.localStateDefinitionsSource = this.states, this.localFallbackVersion = (null !== (_a = this.localFallbackVersion) && void 0 !== _a ? _a : 0) + 1), null !== (_b = this.localFallbackVersion) && void 0 !== _b ? _b : 0;
8987
- }
8988
- warnDeprecatedLocalStatesFallback(stateNames) {
8989
- for (let index = 0; index < stateNames.length; index++) {
8990
- const stateName = stateNames[index];
8991
- deprecatedLocalStateFallbackWarningStateNames.has(stateName) || (deprecatedLocalStateFallbackWarningStateNames.add(stateName), console.warn(`[VRender] graphic.states fallback for missing shared state definition "${stateName}" is deprecated. Move the state definition to sharedStateDefinitions or use stateProxy for dynamic per-graphic styles.`));
8992
- }
8521
+ return this.localStateDefinitionsSource !== this.states && (this.localStateDefinitionsSource = this.states, this.localStateDefinitionsVersion = (null !== (_a = this.localStateDefinitionsVersion) && void 0 !== _a ? _a : 0) + 1), null !== (_b = this.localStateDefinitionsVersion) && void 0 !== _b ? _b : 0;
8993
8522
  }
8994
8523
  resolveEffectiveCompiledDefinitions() {
8995
8524
  this.syncSharedStateScopeBindingFromTree(!1);
@@ -8998,50 +8527,24 @@
8998
8527
  const hasStates = !!this.states && Object.keys(this.states).length > 0;
8999
8528
  if (!boundScope) {
9000
8529
  if (!hasStates) return {
9001
- compiledDefinitions: void 0,
9002
- stateProxyModeKey: "none"
8530
+ compiledDefinitions: void 0
9003
8531
  };
9004
8532
  const cacheKey = `local:${this.getLocalStatesVersion()}`;
9005
8533
  return this.compiledStateDefinitions && this.compiledStateDefinitionsCacheKey === cacheKey || (this.compiledStateDefinitions = new StateDefinitionCompiler().compile(this.states), this.compiledStateDefinitionsCacheKey = cacheKey), {
9006
- compiledDefinitions: this.compiledStateDefinitions,
9007
- stateProxyModeKey: this.stateProxy ? "legacy-all" : "none"
8534
+ compiledDefinitions: this.compiledStateDefinitions
9008
8535
  };
9009
8536
  }
9010
- const sharedCompiledDefinitions = boundScope.effectiveCompiledDefinitions,
9011
- sharedStateProxyModeKey = this.stateProxy ? "shared-missing-only" : "none",
9012
- sharedStateProxyEligibility = this.stateProxy ? stateName => !sharedCompiledDefinitions.has(stateName) : void 0;
9013
- if (!hasStates) return this.localFallbackCompiledDefinitions = void 0, {
9014
- compiledDefinitions: sharedCompiledDefinitions,
9015
- stateProxyModeKey: sharedStateProxyModeKey,
9016
- stateProxyEligibility: sharedStateProxyEligibility
9017
- };
9018
- const localStates = this.states,
9019
- missingLocalStateDefinitions = {},
9020
- missingStateNames = [];
9021
- if (Object.keys(localStates).forEach(stateName => {
9022
- sharedCompiledDefinitions.has(stateName) || (missingLocalStateDefinitions[stateName] = localStates[stateName], missingStateNames.push(stateName));
9023
- }), !missingStateNames.length) return this.localFallbackCompiledDefinitions = void 0, {
9024
- compiledDefinitions: sharedCompiledDefinitions,
9025
- stateProxyModeKey: sharedStateProxyModeKey,
9026
- stateProxyEligibility: sharedStateProxyEligibility
9027
- };
9028
- this.warnDeprecatedLocalStatesFallback(missingStateNames);
9029
- const localStatesVersion = this.getLocalStatesVersion(),
9030
- stateProxyModeKey = this.stateProxy ? `missing:${missingStateNames.sort().join("|")}` : "none",
9031
- cacheKey = `shared:${boundScope.revision}:fallback:${localStatesVersion}:${stateProxyModeKey}`;
9032
- return this.localFallbackCompiledDefinitions && this.compiledStateDefinitionsCacheKey === cacheKey || (this.localFallbackCompiledDefinitions = new StateDefinitionCompiler().compile(Object.assign(Object.assign({}, boundScope.effectiveSourceDefinitions), missingLocalStateDefinitions)), this.compiledStateDefinitionsCacheKey = cacheKey), {
9033
- compiledDefinitions: this.localFallbackCompiledDefinitions,
9034
- stateProxyModeKey: stateProxyModeKey,
9035
- stateProxyEligibility: sharedStateProxyEligibility
8537
+ return {
8538
+ compiledDefinitions: boundScope.effectiveCompiledDefinitions
9036
8539
  };
9037
8540
  }
9038
8541
  recomputeCurrentStatePatch() {
9039
8542
  var _a, _b;
9040
8543
  if (!(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length)) return this.effectiveStates = [], this.resolvedStatePatch = void 0, void this.syncSharedStateActiveRegistrations();
9041
8544
  const stateResolveBaseAttrs = this.getStateResolveBaseAttrs(),
9042
- transition = this.createStateModel(stateResolveBaseAttrs).useStates(this.currentStates),
8545
+ transition = this.resolveUseStatesTransition(this.currentStates, stateResolveBaseAttrs),
9043
8546
  effectiveStates = null !== (_b = transition.effectiveStates) && void 0 !== _b ? _b : transition.states,
9044
- resolvedStateAttrs = this.stateEngine && this.compiledStateDefinitions ? Object.assign({}, this.stateEngine.resolvedPatch) : this.getStateStyleResolver(this.stateMergeMode).resolve(stateResolveBaseAttrs, this.states, this.stateProxy, transition.states, this.stateSort);
8547
+ resolvedStateAttrs = this.stateEngine && this.compiledStateDefinitions ? Object.assign({}, this.stateEngine.resolvedPatch) : {};
9045
8548
  this.currentStates = transition.states, this.effectiveStates = [...effectiveStates], this.resolvedStatePatch = resolvedStateAttrs, this.syncSharedStateActiveRegistrations();
9046
8549
  }
9047
8550
  buildStaticAttributeSnapshot() {
@@ -9105,12 +8608,7 @@
9105
8608
  return nextCategory & UpdateCategory.PICK && (nextCategory |= UpdateCategory.BOUNDS), nextCategory === UpdateCategory.PAINT && this.needUpdateTag(key) && (nextCategory = UpdateCategory.SHAPE | UpdateCategory.BOUNDS), category | nextCategory;
9106
8609
  }
9107
8610
  submitUpdateByCategory(category, forceUpdateTag = !1) {
9108
- var _a;
9109
8611
  if (forceUpdateTag) return this.addUpdateShapeAndBoundsTag(), this.addUpdatePositionTag(), void this.addUpdateLayoutTag();
9110
- if (category !== UpdateCategory.NONE) {
9111
- const stage = this.stage;
9112
- stage && (null === (_a = getActiveStageStatePerfMonitor(stage)) || void 0 === _a || _a.recordCategory(category));
9113
- }
9114
8612
  (category & BROAD_UPDATE_CATEGORY) !== BROAD_UPDATE_CATEGORY ? (category & UpdateCategory.SHAPE ? this.addUpdateShapeAndBoundsTag() : category & UpdateCategory.BOUNDS && this.addUpdateBoundTag(), category & UpdateCategory.PAINT && this.addUpdatePaintTag(), category & UpdateCategory.TRANSFORM && this.addUpdatePositionTag(), category & UpdateCategory.LAYOUT && this.addUpdateLayoutTag()) : this.addBroadUpdateTag();
9115
8613
  }
9116
8614
  submitUpdateByDelta(delta, forceUpdateTag = !1) {
@@ -9649,103 +9147,94 @@
9649
9147
  var _a;
9650
9148
  return null === (_a = this.stateEngine) || void 0 === _a || _a.setResolveContext(this, stateResolveBaseAttrs), stateResolveBaseAttrs;
9651
9149
  }
9652
- createStateModel(stateResolveBaseAttrs = this.getStateResolveBaseAttrs()) {
9150
+ ensureStateEngine(stateResolveBaseAttrs = this.getStateResolveBaseAttrs()) {
9653
9151
  const {
9654
- compiledDefinitions: compiledDefinitions,
9655
- stateProxyEligibility: stateProxyEligibility,
9656
- stateProxyModeKey: stateProxyModeKey
9152
+ compiledDefinitions: compiledDefinitions
9657
9153
  } = this.resolveEffectiveCompiledDefinitions();
9658
- return this.compiledStateDefinitions = compiledDefinitions, compiledDefinitions ? this.stateEngine && this.stateEngineCompiledDefinitions === compiledDefinitions && this.stateEngineStateProxy === this.stateProxy && this.stateEngineStateSort === this.stateSort && this.stateEngineMergeMode === this.stateMergeMode && this.stateEngineStateProxyModeKey === stateProxyModeKey || (this.stateEngine = new StateEngine({
9154
+ return this.compiledStateDefinitions = compiledDefinitions, compiledDefinitions ? this.stateEngine && this.stateEngineCompiledDefinitions === compiledDefinitions && this.stateEngineStateSort === this.stateSort && this.stateEngineMergeMode === this.stateMergeMode || (this.stateEngine = new StateEngine({
9659
9155
  compiledDefinitions: compiledDefinitions,
9660
9156
  stateSort: this.stateSort,
9661
- stateProxy: this.stateProxy,
9662
- stateProxyEligibility: stateProxyEligibility,
9663
- states: this.states,
9664
9157
  mergeMode: this.stateMergeMode
9665
- }), this.stateEngineCompiledDefinitions = compiledDefinitions, this.stateEngineStateProxy = this.stateProxy, this.stateEngineStateSort = this.stateSort, this.stateEngineMergeMode = this.stateMergeMode, this.stateEngineStateProxyModeKey = stateProxyModeKey) : (this.stateEngine = void 0, this.stateEngineCompiledDefinitions = void 0, this.stateEngineStateProxyModeKey = void 0), this.syncStateResolveContext(stateResolveBaseAttrs), new StateModel({
9666
- states: this.states,
9667
- currentStates: this.currentStates,
9668
- stateSort: this.stateSort,
9669
- stateProxy: this.stateProxy,
9670
- stateEngine: this.stateEngine
9671
- });
9158
+ }), this.stateEngineCompiledDefinitions = compiledDefinitions, this.stateEngineStateSort = this.stateSort, this.stateEngineMergeMode = this.stateMergeMode) : (this.stateEngine = void 0, this.stateEngineCompiledDefinitions = void 0), this.syncStateResolveContext(stateResolveBaseAttrs), this.stateEngine && this.currentStates && !this.sameStateNames(this.stateEngine.activeStates, this.currentStates) && this.stateEngine.applyStates(this.currentStates), this.stateEngine;
9159
+ }
9160
+ toGraphicStateTransition(result) {
9161
+ return {
9162
+ changed: result.changed,
9163
+ states: [...result.activeStates],
9164
+ effectiveStates: [...result.effectiveStates]
9165
+ };
9672
9166
  }
9673
- resolveSimpleLocalStateTransition(states, previousStates) {
9167
+ sortLocalStates(states) {
9168
+ return this.stateSort ? [...states].sort(this.stateSort) : [...states];
9169
+ }
9170
+ resolveLocalUseStatesTransition(states) {
9674
9171
  var _a;
9675
- if (!this.states || this.stateProxy || this.stateSort || "deep" === this.stateMergeMode || this.parent || (null === (_a = this.stage) || void 0 === _a ? void 0 : _a.rootSharedStateScope) || this.boundSharedStateScope) return null;
9676
- if (1 === states.length) {
9677
- const stateName = states[0],
9678
- hasDefinition = Object.prototype.hasOwnProperty.call(this.states, stateName),
9679
- nextStates = [stateName],
9680
- changed = !this.sameStateNames(previousStates, nextStates),
9681
- resolvedStateAttrs = {};
9682
- if (hasDefinition) {
9683
- const attrs = this.states[stateName];
9684
- if (null != attrs) {
9685
- if (!isPlainObjectValue(attrs)) return null;
9686
- const keys = Object.keys(attrs);
9687
- for (let keyIndex = 0; keyIndex < keys.length; keyIndex++) {
9688
- const key = keys[keyIndex];
9689
- if (FULL_STATE_DEFINITION_KEYS.has(key)) return null;
9690
- const attrValue = attrs[key];
9691
- resolvedStateAttrs[key] = isPlainObjectValue(attrValue) ? cloneAttributeValue(attrValue) : attrValue;
9692
- }
9693
- }
9694
- }
9695
- return {
9696
- changed: changed,
9697
- states: nextStates,
9698
- effectiveStates: nextStates,
9699
- resolvedStateAttrs: resolvedStateAttrs
9700
- };
9701
- }
9702
- const uniqueStates = Array.from(new Set(states)),
9703
- withDefinition = [],
9704
- withoutDefinition = [];
9705
- for (let i = 0; i < uniqueStates.length; i++) {
9706
- const stateName = uniqueStates[i];
9707
- Object.prototype.hasOwnProperty.call(this.states, stateName) ? withDefinition.push(stateName) : withoutDefinition.push(stateName);
9708
- }
9709
- withDefinition.sort((left, right) => left.localeCompare(right));
9710
- const nextStates = withDefinition.concat(withoutDefinition),
9711
- changed = !this.sameStateNames(previousStates, nextStates),
9712
- resolvedStateAttrs = {};
9713
- for (let i = 0; i < nextStates.length; i++) {
9714
- const stateName = nextStates[i];
9715
- if (!Object.prototype.hasOwnProperty.call(this.states, stateName)) continue;
9716
- const attrs = this.states[stateName];
9717
- if (null == attrs) continue;
9718
- if (!isPlainObjectValue(attrs)) return null;
9719
- const keys = Object.keys(attrs);
9720
- for (let keyIndex = 0; keyIndex < keys.length; keyIndex++) {
9721
- const key = keys[keyIndex];
9722
- if (FULL_STATE_DEFINITION_KEYS.has(key)) return null;
9723
- const attrValue = attrs[key];
9724
- resolvedStateAttrs[key] = isPlainObjectValue(attrValue) ? cloneAttributeValue(attrValue) : attrValue;
9725
- }
9726
- }
9172
+ if (!states.length) return this.resolveLocalClearStatesTransition();
9173
+ const previousStates = null !== (_a = this.currentStates) && void 0 !== _a ? _a : EMPTY_STATE_NAMES,
9174
+ changed = previousStates.length !== states.length || states.some((stateName, index) => previousStates[index] !== stateName),
9175
+ nextStates = this.sortLocalStates(states);
9727
9176
  return {
9728
9177
  changed: changed,
9729
- states: nextStates,
9730
- effectiveStates: nextStates,
9731
- resolvedStateAttrs: resolvedStateAttrs
9178
+ states: changed ? nextStates : [...previousStates]
9732
9179
  };
9733
9180
  }
9734
- resolveGraphicStateTransition(states, previousStates, forceResolverRefresh = !1) {
9735
- var _a, _b;
9736
- let transition = this.resolveSimpleLocalStateTransition(states, previousStates);
9737
- const isSimpleLocalTransition = !!transition;
9738
- let resolvedStateAttrs;
9739
- if (transition) resolvedStateAttrs = transition.resolvedStateAttrs;else {
9740
- const stateResolveBaseAttrs = this.getStateResolveBaseAttrs(),
9741
- stateModel = this.createStateModel(stateResolveBaseAttrs);
9742
- forceResolverRefresh && (null === (_a = this.stateEngine) || void 0 === _a || _a.invalidateResolverCache()), transition = stateModel.useStates(states), resolvedStateAttrs = this.stateEngine && this.compiledStateDefinitions ? Object.assign({}, this.stateEngine.resolvedPatch) : this.getStateStyleResolver(this.stateMergeMode).resolve(stateResolveBaseAttrs, this.states, this.stateProxy, transition.states, this.stateSort);
9743
- }
9181
+ resolveLocalClearStatesTransition() {
9182
+ return {
9183
+ changed: this.hasState(),
9184
+ states: []
9185
+ };
9186
+ }
9187
+ resolveUseStatesTransition(states, stateResolveBaseAttrs = this.getStateResolveBaseAttrs()) {
9188
+ const stateEngine = this.ensureStateEngine(stateResolveBaseAttrs);
9189
+ return stateEngine ? this.toGraphicStateTransition(stateEngine.applyStates(states)) : this.resolveLocalUseStatesTransition(states);
9190
+ }
9191
+ resolveClearStatesTransition() {
9192
+ const stateEngine = this.ensureStateEngine();
9193
+ return stateEngine ? this.toGraphicStateTransition(stateEngine.clearStates()) : this.resolveLocalClearStatesTransition();
9194
+ }
9195
+ resolveAddStateTransition(stateName, keepCurrentStates) {
9196
+ var _a;
9197
+ const stateEngine = this.ensureStateEngine();
9198
+ if (stateEngine) return this.toGraphicStateTransition(stateEngine.addState(stateName, keepCurrentStates));
9199
+ if (this.currentStates && this.currentStates.includes(stateName) && (keepCurrentStates || 1 === this.currentStates.length)) return {
9200
+ changed: !1,
9201
+ states: [...this.currentStates]
9202
+ };
9203
+ const nextStates = keepCurrentStates && (null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) ? this.currentStates.concat([stateName]) : [stateName];
9204
+ return this.resolveLocalUseStatesTransition(nextStates);
9205
+ }
9206
+ resolveRemoveStateTransition(stateName) {
9207
+ const stateEngine = this.ensureStateEngine();
9208
+ if (stateEngine) return this.toGraphicStateTransition(stateEngine.removeState(stateName));
9209
+ if (!this.currentStates) return {
9210
+ changed: !1,
9211
+ states: []
9212
+ };
9213
+ const filter = Array.isArray(stateName) ? s => !stateName.includes(s) : s => s !== stateName,
9214
+ nextStates = this.currentStates.filter(filter);
9215
+ return nextStates.length === this.currentStates.length ? {
9216
+ changed: !1,
9217
+ states: [...this.currentStates]
9218
+ } : this.resolveLocalUseStatesTransition(nextStates);
9219
+ }
9220
+ resolveToggleStateTransition(stateName) {
9221
+ const stateEngine = this.ensureStateEngine();
9222
+ if (stateEngine) return this.toGraphicStateTransition(stateEngine.toggleState(stateName));
9223
+ if (this.hasState(stateName)) return this.resolveRemoveStateTransition(stateName);
9224
+ const nextStates = this.currentStates ? this.currentStates.slice() : [];
9225
+ return nextStates.push(stateName), this.resolveLocalUseStatesTransition(nextStates);
9226
+ }
9227
+ resolveGraphicStateTransition(states, forceResolverRefresh = !1) {
9228
+ var _a;
9229
+ const stateResolveBaseAttrs = this.getStateResolveBaseAttrs(),
9230
+ stateEngine = this.ensureStateEngine(stateResolveBaseAttrs);
9231
+ forceResolverRefresh && (null == stateEngine || stateEngine.invalidateResolverCache());
9232
+ const transition = stateEngine ? this.toGraphicStateTransition(stateEngine.applyStates(states)) : this.resolveLocalUseStatesTransition(states),
9233
+ resolvedStateAttrs = this.stateEngine && this.compiledStateDefinitions ? Object.assign({}, this.stateEngine.resolvedPatch) : {};
9744
9234
  return {
9745
9235
  transition: transition,
9746
- effectiveStates: null !== (_b = transition.effectiveStates) && void 0 !== _b ? _b : transition.states,
9747
- resolvedStateAttrs: resolvedStateAttrs,
9748
- isSimpleLocalTransition: isSimpleLocalTransition
9236
+ effectiveStates: null !== (_a = transition.effectiveStates) && void 0 !== _a ? _a : transition.states,
9237
+ resolvedStateAttrs: resolvedStateAttrs
9749
9238
  };
9750
9239
  }
9751
9240
  normalizeSetStatesOptions(options) {
@@ -9776,24 +9265,14 @@
9776
9265
  {
9777
9266
  transition: transition,
9778
9267
  effectiveStates: effectiveStates,
9779
- resolvedStateAttrs: resolvedStateAttrs,
9780
- isSimpleLocalTransition: isSimpleLocalTransition
9781
- } = this.resolveGraphicStateTransition(states, previousStates, !0),
9268
+ resolvedStateAttrs: resolvedStateAttrs
9269
+ } = this.resolveGraphicStateTransition(states, !0),
9782
9270
  patchChanged = !this.sameStatePatches(previousResolvedStatePatch, resolvedStateAttrs);
9783
- if ((!patchChanged || this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !1)) && (this.currentStates = transition.states, this.effectiveStates = isSimpleLocalTransition ? effectiveStates : [...effectiveStates], this.resolvedStatePatch = resolvedStateAttrs, this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(), patchChanged)) {
9784
- if (this.stage) {
9785
- const perfMonitor = getActiveStageStatePerfMonitor(this.stage);
9786
- null == perfMonitor || perfMonitor.incrementCounter("stateCommits"), null == perfMonitor || perfMonitor.recordEvent("state-commit", {
9787
- graphicId: this._uid,
9788
- targetStates: [...transition.states]
9789
- });
9790
- }
9791
- hasAnimation && animateSameStatePatchChange ? (this._syncFinalAttributeFromStaticTruth(), this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !1, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(), this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
9792
- type: exports.AttributeUpdateType.STATE
9793
- }) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, this.resolvedStatePatch, {
9794
- type: exports.AttributeUpdateType.STATE
9795
- }), this.emitStateUpdateEvent());
9796
- }
9271
+ patchChanged && !this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !1) || (this.currentStates = transition.states, this.effectiveStates = [...effectiveStates], this.resolvedStatePatch = resolvedStateAttrs, this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(), patchChanged && (hasAnimation && animateSameStatePatchChange ? (this._syncFinalAttributeFromStaticTruth(), this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !1, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(), this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
9272
+ type: exports.AttributeUpdateType.STATE
9273
+ }) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, this.resolvedStatePatch, {
9274
+ type: exports.AttributeUpdateType.STATE
9275
+ }), this.emitStateUpdateEvent())));
9797
9276
  }
9798
9277
  resolveStateAnimateConfig(animateConfig) {
9799
9278
  var _a, _b, _c;
@@ -9806,8 +9285,8 @@
9806
9285
  extraAnimateAttrs: extraAnimateAttrs,
9807
9286
  shouldSkipDefaultAttribute: this.shouldSkipStateTransitionDefaultAttribute.bind(this)
9808
9287
  } : void 0;
9809
- if (isClear) return void this.getStateTransitionOrchestrator().applyClearTransition(this, attrs, hasAnimation, stateNames, transitionOptions);
9810
- const plan = this.getStateTransitionOrchestrator().analyzeTransition({}, attrs, stateNames, hasAnimation, {
9288
+ if (isClear) return void this.getStateTransitionOrchestrator().applyClearTransition(this, attrs, hasAnimation, transitionOptions);
9289
+ const plan = this.getStateTransitionOrchestrator().analyzeTransition(attrs, hasAnimation, {
9811
9290
  noWorkAnimateAttr: this.getNoWorkAnimateAttr(),
9812
9291
  animateConfig: resolvedAnimateConfig,
9813
9292
  extraAnimateAttrs: extraAnimateAttrs,
@@ -9831,43 +9310,29 @@
9831
9310
  animate.stateNames && stateAnimates.push(animate);
9832
9311
  }), stateAnimates.forEach(animate => animate.stop(type));
9833
9312
  }
9834
- getNormalAttribute(key) {
9835
- var _a, _b;
9836
- const value = this.attribute[key];
9837
- return this.hasAnyTrackedAnimate() ? null === (_a = this.finalAttribute) || void 0 === _a ? void 0 : _a[key] : null != value ? value : null === (_b = this.finalAttribute) || void 0 === _b ? void 0 : _b[key];
9838
- }
9839
9313
  clearStates(hasAnimation) {
9840
9314
  var _a, _b, _c;
9841
9315
  const previousStates = null !== (_a = this.currentStates) && void 0 !== _a ? _a : EMPTY_STATE_NAMES,
9842
9316
  previousResolvedStatePatch = this.resolvedStatePatch,
9843
- transition = this.createStateModel().clearStates();
9317
+ transition = this.resolveClearStatesTransition();
9844
9318
  if (!transition.changed && 0 === previousStates.length) return this.currentStates = [], this.effectiveStates = [], this.resolvedStatePatch = void 0, this.sharedStateDirty = !1, void this.clearSharedStateActiveRegistrations();
9845
9319
  const resolvedStateAttrs = hasAnimation || this.hasCustomEvent("beforeStateUpdate") ? cloneAttributeValue(null !== (_b = this.baseAttributes) && void 0 !== _b ? _b : {}) : null !== (_c = this.baseAttributes) && void 0 !== _c ? _c : {};
9846
- if (!transition.changed || this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !0)) {
9847
- if (this.currentStates = transition.states, this.effectiveStates = [], this.resolvedStatePatch = void 0, this.sharedStateDirty = !1, this.clearSharedStateActiveRegistrations(), this.stage) {
9848
- const perfMonitor = getActiveStageStatePerfMonitor(this.stage);
9849
- null == perfMonitor || perfMonitor.incrementCounter("stateCommits"), null == perfMonitor || perfMonitor.recordEvent("state-commit", {
9850
- graphicId: this._uid,
9851
- targetStates: []
9852
- });
9853
- }
9854
- hasAnimation ? (this._syncFinalAttributeFromStaticTruth(), this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !0, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(), this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
9855
- type: exports.AttributeUpdateType.STATE
9856
- }) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, void 0, {
9857
- type: exports.AttributeUpdateType.STATE
9858
- }), this.emitStateUpdateEvent());
9859
- }
9320
+ transition.changed && !this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !0) || (this.currentStates = transition.states, this.effectiveStates = [], this.resolvedStatePatch = void 0, this.sharedStateDirty = !1, this.clearSharedStateActiveRegistrations(), hasAnimation ? (this._syncFinalAttributeFromStaticTruth(), this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !0, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(), this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
9321
+ type: exports.AttributeUpdateType.STATE
9322
+ }) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, void 0, {
9323
+ type: exports.AttributeUpdateType.STATE
9324
+ }), this.emitStateUpdateEvent()));
9860
9325
  }
9861
9326
  removeState(stateName, hasAnimation) {
9862
- const transition = this.createStateModel().removeState(stateName);
9327
+ const transition = this.resolveRemoveStateTransition(stateName);
9863
9328
  transition.changed && this.useStates(transition.states, hasAnimation);
9864
9329
  }
9865
9330
  toggleState(stateName, hasAnimation) {
9866
- const transition = this.createStateModel().toggleState(stateName);
9331
+ const transition = this.resolveToggleStateTransition(stateName);
9867
9332
  transition.changed && this.useStates(transition.states, hasAnimation);
9868
9333
  }
9869
9334
  addState(stateName, keepCurrentStates, hasAnimation) {
9870
- const transition = this.createStateModel().addState(stateName, keepCurrentStates);
9335
+ const transition = this.resolveAddStateTransition(stateName, keepCurrentStates);
9871
9336
  transition.changed && this.useStates(transition.states, hasAnimation);
9872
9337
  }
9873
9338
  setStates(states, options) {
@@ -9895,23 +9360,13 @@
9895
9360
  {
9896
9361
  transition: transition,
9897
9362
  effectiveStates: effectiveStates,
9898
- resolvedStateAttrs: resolvedStateAttrs,
9899
- isSimpleLocalTransition: isSimpleLocalTransition
9900
- } = this.resolveGraphicStateTransition(states, previousStates);
9901
- if ((transition.changed || !this.sameStateNames(previousStates, transition.states)) && this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !1)) {
9902
- if (this.currentStates = transition.states, this.effectiveStates = isSimpleLocalTransition ? effectiveStates : [...effectiveStates], this.resolvedStatePatch = resolvedStateAttrs, this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(), this.stage) {
9903
- const perfMonitor = getActiveStageStatePerfMonitor(this.stage);
9904
- null == perfMonitor || perfMonitor.incrementCounter("stateCommits"), null == perfMonitor || perfMonitor.recordEvent("state-commit", {
9905
- graphicId: this._uid,
9906
- targetStates: [...transition.states]
9907
- });
9908
- }
9909
- hasAnimation ? (this._syncFinalAttributeFromStaticTruth(), this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !1, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(), this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
9910
- type: exports.AttributeUpdateType.STATE
9911
- }) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, this.resolvedStatePatch, {
9912
- type: exports.AttributeUpdateType.STATE
9913
- }), this.emitStateUpdateEvent());
9914
- }
9363
+ resolvedStateAttrs: resolvedStateAttrs
9364
+ } = this.resolveGraphicStateTransition(states);
9365
+ !transition.changed && this.sameStateNames(previousStates, transition.states) || this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !1) && (this.currentStates = transition.states, this.effectiveStates = [...effectiveStates], this.resolvedStatePatch = resolvedStateAttrs, this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(), hasAnimation ? (this._syncFinalAttributeFromStaticTruth(), this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !1, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(), this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
9366
+ type: exports.AttributeUpdateType.STATE
9367
+ }) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, this.resolvedStatePatch, {
9368
+ type: exports.AttributeUpdateType.STATE
9369
+ }), this.emitStateUpdateEvent()));
9915
9370
  }
9916
9371
  invalidateResolver() {
9917
9372
  var _a, _b;
@@ -10057,7 +9512,7 @@
10057
9512
  }
10058
9513
  detachStageForRelease() {
10059
9514
  var _a, _b, _c;
10060
- (null === (_a = this.registeredActiveScopes) || void 0 === _a ? void 0 : _a.size) && this.clearSharedStateActiveRegistrations(), (this.mayHaveTrackedAnimates() || this.shadowRoot) && this.stopAnimates(), this.boundSharedStateScope = void 0, this.boundSharedStateRevision = void 0, this.localFallbackCompiledDefinitions = void 0, this.compiledStateDefinitions = void 0, this.compiledStateDefinitionsCacheKey = void 0, this.stateEngine = void 0, this.stateEngineCompiledDefinitions = void 0, this.stateEngineStateProxyModeKey = void 0, this.sharedStateDirty = !1, this.stage = null, this.layer = null, this.shadowRoot && (null === (_c = (_b = this.shadowRoot).detachStageForRelease) || void 0 === _c || _c.call(_b));
9515
+ (null === (_a = this.registeredActiveScopes) || void 0 === _a ? void 0 : _a.size) && this.clearSharedStateActiveRegistrations(), (this.mayHaveTrackedAnimates() || this.shadowRoot) && this.stopAnimates(), this.boundSharedStateScope = void 0, this.boundSharedStateRevision = void 0, this.compiledStateDefinitions = void 0, this.compiledStateDefinitionsCacheKey = void 0, this.stateEngine = void 0, this.stateEngineCompiledDefinitions = void 0, this.sharedStateDirty = !1, this.stage = null, this.layer = null, this.shadowRoot && (null === (_c = (_b = this.shadowRoot).detachStageForRelease) || void 0 === _c || _c.call(_b));
10061
9516
  }
10062
9517
  setStageToShadowRoot(stage, layer) {
10063
9518
  this.shadowRoot && this.shadowRoot.setStage(stage, layer);
@@ -11570,15 +11025,11 @@
11570
11025
  const previousStates = this.currentStates ? this.currentStates.slice() : [];
11571
11026
  if (!((null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) !== states.length || states.some((stateName, index) => this.currentStates[index] !== stateName))) return;
11572
11027
  this.stopStateAnimates(), this.stateSort && (states = states.sort(this.stateSort));
11573
- const stateAttrs = {},
11574
- subAttrs = this.subGraphic.map(() => ({}));
11028
+ const stateAttrs = {};
11575
11029
  states.forEach(stateName => {
11576
- var _a;
11577
11030
  const attrs = this.glyphStateProxy ? this.glyphStateProxy(stateName, states) : this.glyphStates[stateName];
11578
- attrs && (Object.assign(stateAttrs, attrs.attributes), (null === (_a = attrs.subAttributes) || void 0 === _a ? void 0 : _a.length) && subAttrs.forEach((subAttrs, index) => {
11579
- Object.assign(subAttrs, attrs.subAttributes[index]);
11580
- }));
11581
- }), this.beforeStateUpdate(stateAttrs, previousStates, states, hasAnimation, !1) && (this.updateNormalAttrs(stateAttrs), this.currentStates = states, this.applyStateAttrs(stateAttrs, states, hasAnimation));
11031
+ attrs && Object.assign(stateAttrs, attrs.attributes);
11032
+ }), this.beforeStateUpdate(stateAttrs, previousStates, states, hasAnimation, !1) && (this.currentStates = states, this.applyStateAttrs(stateAttrs, states, hasAnimation));
11582
11033
  }
11583
11034
  clearStates(hasAnimation) {
11584
11035
  this.stopStateAnimates();
@@ -11587,7 +11038,6 @@
11587
11038
  if (!this.beforeStateUpdate(this.normalAttrs, previousStates, [], hasAnimation, !0)) return;
11588
11039
  this.currentStates = [], this.applyStateAttrs(this.normalAttrs, this.currentStates, hasAnimation, !0);
11589
11040
  } else this.currentStates = [];
11590
- this.normalAttrs = null;
11591
11041
  }
11592
11042
  clone() {
11593
11043
  const glyph = new Glyph(Object.assign({}, this.attribute));
@@ -13178,7 +12628,7 @@
13178
12628
  }(exports.GroupUpdateAABBBoundsMode || (exports.GroupUpdateAABBBoundsMode = {}));
13179
12629
  class Group extends Graphic {
13180
12630
  constructor(params) {
13181
- super(params), this.type = "group", this.parent = null, this.isContainer = !0, this._hasSharedStateDefinitions = !1, this.numberType = GROUP_NUMBER_TYPE, this._childUpdateTag = exports.UpdateTag.UPDATE_BOUNDS;
12631
+ super(params), this.type = "group", this.parent = null, this.isContainer = !0, this.numberType = GROUP_NUMBER_TYPE, this._childUpdateTag = exports.UpdateTag.UPDATE_BOUNDS;
13182
12632
  }
13183
12633
  get sharedStateDefinitions() {
13184
12634
  return this._sharedStateDefinitions;
@@ -13186,7 +12636,7 @@
13186
12636
  set sharedStateDefinitions(value) {
13187
12637
  if (this._sharedStateDefinitions === value) return;
13188
12638
  const previousScope = this.sharedStateScope;
13189
- this._sharedStateDefinitions = value, this._hasSharedStateDefinitions = !!value && Object.keys(value).length > 0, this.ensureSharedStateScopeBound(), this.sharedStateScope && (setSharedStateScopeLocalDefinitions(this.sharedStateScope, value), markScopeActiveDescendantsDirty(this.sharedStateScope, this.stage)), previousScope !== this.sharedStateScope && this.notifyChildrenSharedStateTreeChanged();
12639
+ this._sharedStateDefinitions = value, this.ensureSharedStateScopeBound(), this.sharedStateScope && (setSharedStateScopeLocalDefinitions(this.sharedStateScope, value), markScopeActiveDescendantsDirty(this.sharedStateScope, this.stage)), previousScope !== this.sharedStateScope && this.notifyChildrenSharedStateTreeChanged();
13190
12640
  }
13191
12641
  setMode(mode) {
13192
12642
  "3d" === mode ? this.set3dMode() : this.set2dMode();
@@ -13290,17 +12740,17 @@
13290
12740
  }
13291
12741
  incrementalAppendChild(node) {
13292
12742
  const data = super.appendChild(node);
13293
- return data && (!this.stage || data.stage === this.stage && data.layer === this.layer ? data.onParentSharedStateTreeChanged && data.onParentSharedStateTreeChanged(this.stage, this.layer) : data.setStage(this.stage, this.layer)), this.addUpdateBoundTag(), this.getGraphicService().onAddIncremental(node, this, this.stage), data;
12743
+ return data && this.syncChildSharedStateTreeBinding(data), this.addUpdateBoundTag(), this.getGraphicService().onAddIncremental(node, this, this.stage), data;
13294
12744
  }
13295
12745
  incrementalClearChild() {
13296
12746
  super.removeAllChild(), this.addUpdateBoundTag(), this.getGraphicService().onClearIncremental(this, this.stage);
13297
12747
  }
13298
12748
  _updateChildToStage(child) {
13299
- return child && (!this.stage || child.stage === this.stage && child.layer === this.layer ? child.onParentSharedStateTreeChanged && child.onParentSharedStateTreeChanged(this.stage, this.layer) : child.setStage(this.stage, this.layer)), this.addUpdateBoundTag(), child;
12749
+ return child && this.syncChildSharedStateTreeBinding(child), this.addUpdateBoundTag(), child;
13300
12750
  }
13301
12751
  appendChild(node, addStage = !0) {
13302
12752
  const data = super.appendChild(node);
13303
- return data && (addStage && this.stage && (data.stage !== this.stage || data.layer !== this.layer) ? data.setStage(this.stage, this.layer) : data.onParentSharedStateTreeChanged && data.onParentSharedStateTreeChanged(this.stage, this.layer)), this.addUpdateBoundTag(), data;
12753
+ return data && addStage && this.syncChildSharedStateTreeBinding(data), this.addUpdateBoundTag(), data;
13304
12754
  }
13305
12755
  insertBefore(newNode, referenceNode) {
13306
12756
  return this._updateChildToStage(super.insertBefore(newNode, referenceNode));
@@ -13312,9 +12762,8 @@
13312
12762
  return this._updateChildToStage(super.insertInto(newNode, idx));
13313
12763
  }
13314
12764
  removeChild(child, highPerformance = !1) {
13315
- var _a;
13316
12765
  const data = super.removeChild(child);
13317
- return data ? highPerformance ? (null === (_a = child.detachStageForRelease) || void 0 === _a || _a.call(child), data) : (this.getGraphicService().onRemove(child), child.setStage(null, null), this.addUpdateBoundTag(), data) : data;
12766
+ return data ? highPerformance ? (child.detachStageForRelease(), data) : (this.getGraphicService().onRemove(child), child.setStage(null, null), this.addUpdateBoundTag(), data) : data;
13318
12767
  }
13319
12768
  removeAllChild(deep = !1) {
13320
12769
  const children = this.children.slice();
@@ -13327,14 +12776,10 @@
13327
12776
  setStage(stage, layer) {
13328
12777
  var _a, _b, _c, _d, _e, _f;
13329
12778
  const graphicService = null !== (_c = null !== (_a = null == stage ? void 0 : stage.graphicService) && void 0 !== _a ? _a : null === (_b = this.stage) || void 0 === _b ? void 0 : _b.graphicService) && void 0 !== _c ? _c : application.graphicService,
13330
- needsSharedStateTreeSync = this._hasSharedStateDefinitions || this.sharedStateScope || (null === (_d = this.currentStates) || void 0 === _d ? void 0 : _d.length) || this.boundSharedStateScope || (null === (_e = this.registeredActiveScopes) || void 0 === _e ? void 0 : _e.size) || this.sharedStateDirty;
13331
- if (this.stage !== stage) return this.stage = stage, this.layer = layer, needsSharedStateTreeSync && (this.ensureSharedStateScopeBound(), this.syncSharedStateScopeBindingOnTreeChange(!0)), this.setStageToShadowRoot(stage, layer), this._onSetStage && this._onSetStage(this, stage, layer), null === (_f = null == graphicService ? void 0 : graphicService.onSetStage) || void 0 === _f || _f.call(graphicService, this, stage), void this.forEachChildren(item => {
13332
- item.setStage(stage, this.layer);
13333
- });
12779
+ needsSharedStateTreeSync = this.hasSharedStateDefinitions() || this.sharedStateScope || (null === (_d = this.currentStates) || void 0 === _d ? void 0 : _d.length) || this.boundSharedStateScope || (null === (_e = this.registeredActiveScopes) || void 0 === _e ? void 0 : _e.size) || this.sharedStateDirty;
12780
+ if (this.stage !== stage) return this.stage = stage, this.layer = layer, needsSharedStateTreeSync && (this.ensureSharedStateScopeBound(), this.syncSharedStateScopeBindingOnTreeChange(!0)), this.setStageToShadowRoot(stage, layer), this._onSetStage && this._onSetStage(this, stage, layer), null === (_f = null == graphicService ? void 0 : graphicService.onSetStage) || void 0 === _f || _f.call(graphicService, this, stage), void this.notifyChildrenSharedStateTreeChanged();
13334
12781
  const layerChanged = this.layer !== layer;
13335
- layerChanged && (this.layer = layer), needsSharedStateTreeSync ? (this.ensureSharedStateScopeBound(), this.syncSharedStateScopeBindingOnTreeChange(!0), this.notifyChildrenSharedStateTreeChanged()) : layerChanged && this.forEachChildren(item => {
13336
- item.onParentSharedStateTreeChanged && item.onParentSharedStateTreeChanged(stage, this.layer);
13337
- });
12782
+ layerChanged && (this.layer = layer), needsSharedStateTreeSync ? (this.ensureSharedStateScopeBound(), this.syncSharedStateScopeBindingOnTreeChange(!0), this.notifyChildrenSharedStateTreeChanged()) : layerChanged && this.notifyChildrenSharedStateTreeChanged();
13338
12783
  }
13339
12784
  addUpdatePositionTag() {
13340
12785
  super.addUpdatePositionTag(), this.forEachChildren(g => {
@@ -13381,24 +12826,26 @@
13381
12826
  }
13382
12827
  detachStageForRelease() {
13383
12828
  super.detachStageForRelease(), this.sharedStateScope = void 0, this.forEachChildren(item => {
13384
- var _a;
13385
- null === (_a = item.detachStageForRelease) || void 0 === _a || _a.call(item);
12829
+ item.detachStageForRelease();
13386
12830
  });
13387
12831
  }
13388
12832
  ensureSharedStateScopeBound() {
13389
12833
  var _a, _b, _c;
13390
12834
  if (!this.hasSharedStateDefinitions()) return void (this.sharedStateScope = void 0);
13391
12835
  const parentScope = null !== (_b = null === (_a = this.parent) || void 0 === _a ? void 0 : _a.sharedStateScope) && void 0 !== _b ? _b : null === (_c = this.stage) || void 0 === _c ? void 0 : _c.rootSharedStateScope;
13392
- this.sharedStateScope ? (this.sharedStateScope.ownerGroup = this, this.sharedStateScope.ownerStage = this.stage, setSharedStateScopeParent(this.sharedStateScope, parentScope), this.sharedStateScope.localStateDefinitions !== this._sharedStateDefinitions && setSharedStateScopeLocalDefinitions(this.sharedStateScope, this._sharedStateDefinitions)) : this.sharedStateScope = createGroupSharedStateScope(this, parentScope, this._sharedStateDefinitions);
12836
+ this.sharedStateScope ? (this.sharedStateScope.ownerStage = this.stage, setSharedStateScopeParent(this.sharedStateScope, parentScope), this.sharedStateScope.localStateDefinitions !== this._sharedStateDefinitions && setSharedStateScopeLocalDefinitions(this.sharedStateScope, this._sharedStateDefinitions)) : this.sharedStateScope = createGroupSharedStateScope(this, parentScope, this._sharedStateDefinitions);
13393
12837
  }
13394
12838
  hasSharedStateDefinitions() {
13395
- return this._hasSharedStateDefinitions;
12839
+ return !!this._sharedStateDefinitions && Object.keys(this._sharedStateDefinitions).length > 0;
13396
12840
  }
13397
12841
  notifyChildrenSharedStateTreeChanged() {
13398
12842
  this.forEachChildren(item => {
13399
- item.onParentSharedStateTreeChanged && item.onParentSharedStateTreeChanged(this.stage, this.layer);
12843
+ this.syncChildSharedStateTreeBinding(item);
13400
12844
  });
13401
12845
  }
12846
+ syncChildSharedStateTreeBinding(child) {
12847
+ child.onParentSharedStateTreeChanged(this.stage, this.layer);
12848
+ }
13402
12849
  onParentSharedStateTreeChanged(stage, layer) {
13403
12850
  var _a;
13404
12851
  this.stage === stage && this.layer === layer ? (this.ensureSharedStateScopeBound(), this.syncSharedStateScopeBindingOnTreeChange(!!(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length)), this.notifyChildrenSharedStateTreeChanged()) : this.setStage(stage, layer);
@@ -14313,7 +13760,7 @@
14313
13760
  }
14314
13761
  }
14315
13762
 
14316
- var __awaiter$5 = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
13763
+ var __awaiter$4 = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
14317
13764
  return new (P || (P = Promise))(function (resolve, reject) {
14318
13765
  function fulfilled(value) {
14319
13766
  try {
@@ -14383,7 +13830,7 @@
14383
13830
  } else graphic.forEachChildren(cb, reverse);
14384
13831
  }
14385
13832
  function foreachAsync(graphic, defaultZIndex, cb, reverse = !1) {
14386
- return __awaiter$5(this, void 0, void 0, function* () {
13833
+ return __awaiter$4(this, void 0, void 0, function* () {
14387
13834
  yield graphic.forEachChildrenAsync(cb, reverse);
14388
13835
  });
14389
13836
  }
@@ -14956,9 +14403,6 @@
14956
14403
  register(key, renderer) {
14957
14404
  this.entries.set(key, renderer), this.cache.delete(key);
14958
14405
  }
14959
- registerMany(entries) {
14960
- for (const [key, renderer] of entries) this.register(key, renderer);
14961
- }
14962
14406
  get(key) {
14963
14407
  if (this.cache.has(key)) return this.cache.get(key);
14964
14408
  const entry = this.entries.get(key);
@@ -14981,9 +14425,6 @@
14981
14425
  register(key, picker) {
14982
14426
  this.entries.set(key, picker);
14983
14427
  }
14984
- registerMany(entries) {
14985
- for (const [key, picker] of entries) this.register(key, picker);
14986
- }
14987
14428
  get(key) {
14988
14429
  return this.entries.get(key);
14989
14430
  }
@@ -15025,9 +14466,6 @@
15025
14466
  const current = null !== (_a = this.entries.get(key)) && void 0 !== _a ? _a : [];
15026
14467
  current.push(contribution), this.entries.set(key, current);
15027
14468
  }
15028
- registerMany(entries) {
15029
- for (const [key, contribution] of entries) this.register(key, contribution);
15030
- }
15031
14469
  get(key) {
15032
14470
  var _a;
15033
14471
  return [...(null !== (_a = this.entries.get(key)) && void 0 !== _a ? _a : [])];
@@ -15045,8 +14483,8 @@
15045
14483
  };
15046
14484
  class DefaultPluginService {
15047
14485
  constructor(autoEnablePlugins = EMPTY_AUTO_ENABLE_PROVIDER, deps = {}) {
15048
- var _a, _b, _c;
15049
- this.autoEnablePlugins = autoEnablePlugins, this.onStartupFinishedPlugin = [], this.onRegisterPlugin = [], this.actived = !1, this.pluginRegistry = null !== (_a = deps.pluginRegistry) && void 0 !== _a ? _a : new PluginRegistry(), this.autoEnablePlugins = null !== (_c = null !== (_b = deps.autoEnablePlugins) && void 0 !== _b ? _b : this.autoEnablePlugins) && void 0 !== _c ? _c : EMPTY_AUTO_ENABLE_PROVIDER;
14486
+ var _a;
14487
+ this.autoEnablePlugins = autoEnablePlugins, this.onStartupFinishedPlugin = [], this.onRegisterPlugin = [], this.actived = !1, this.pluginRegistry = null !== (_a = deps.pluginRegistry) && void 0 !== _a ? _a : new PluginRegistry();
15050
14488
  }
15051
14489
  active(stage, params) {
15052
14490
  this.stage = stage, this.actived = !0;
@@ -15195,29 +14633,28 @@
15195
14633
  class DirtyBoundsPlugin {
15196
14634
  constructor() {
15197
14635
  this.name = "DirtyBoundsPlugin", this.activeEvent = "onRegister", this._uid = Generator.GenAutoIncrementId(), this.key = this.name + this._uid, this.dirtyBoundsHooksRegistered = !1, this.handlePaintOnlyUpdate = graphic => {
15198
- var _a, _b, _c, _d;
14636
+ var _a;
15199
14637
  const stage = this.pluginService.stage;
15200
14638
  if (!stage || stage !== graphic.stage || !stage.renderCount) return;
15201
14639
  const owner = null !== (_a = graphic.glyphHost) && void 0 !== _a ? _a : graphic;
15202
14640
  if (!(owner._updateTag & exports.UpdateTag.UPDATE_PAINT) || owner._updateTag & exports.UpdateTag.UPDATE_BOUNDS) return;
15203
14641
  const ownerBounds = this.ensurePaintDirtyBoundsCache(owner);
15204
- ownerBounds && !ownerBounds.empty() && stage.dirty(ownerBounds), null === (_b = owner.clearUpdatePaintTag) || void 0 === _b || _b.call(owner);
14642
+ ownerBounds && !ownerBounds.empty() && stage.dirty(ownerBounds), owner.clearUpdatePaintTag();
15205
14643
  const shadowRoot = owner.shadowRoot;
15206
14644
  if (!shadowRoot) return;
15207
14645
  const shadowBounds = this.ensurePaintDirtyBoundsCache(shadowRoot);
15208
- shadowBounds && !shadowBounds.empty() && stage.dirty(shadowBounds), null === (_d = (_c = shadowRoot).clearUpdatePaintTag) || void 0 === _d || _d.call(_c);
14646
+ shadowBounds && !shadowBounds.empty() && stage.dirty(shadowBounds), shadowRoot.clearUpdatePaintTag();
15209
14647
  };
15210
14648
  }
15211
14649
  ensurePaintDirtyBoundsCache(graphic) {
15212
- var _a, _b;
14650
+ var _a;
15213
14651
  const owner = graphic;
15214
- owner._AABBBounds && "function" == typeof owner._AABBBounds.empty && !owner._AABBBounds.empty() || "function" != typeof owner.doUpdateAABBBounds || owner.doUpdateAABBBounds("imprecise" === (null === (_a = owner.attribute) || void 0 === _a ? void 0 : _a.boundsMode));
15215
- return owner._globalAABBBounds && "function" == typeof owner._globalAABBBounds.empty && !owner._globalAABBBounds.empty() || "function" != typeof owner.tryUpdateGlobalAABBBounds || owner.tryUpdateGlobalAABBBounds(), null !== (_b = owner._globalAABBBounds) && void 0 !== _b ? _b : owner.globalAABBBounds;
14652
+ return owner._AABBBounds.empty() && owner.doUpdateAABBBounds("imprecise" === (null === (_a = owner.attribute) || void 0 === _a ? void 0 : _a.boundsMode)), owner._globalAABBBounds && !owner._globalAABBBounds.empty() || owner.tryUpdateGlobalAABBBounds(), owner._globalAABBBounds;
15216
14653
  }
15217
14654
  getRemoveDirtyBounds(graphic) {
15218
14655
  var _a;
15219
14656
  const cachedBounds = (null !== (_a = graphic.glyphHost) && void 0 !== _a ? _a : graphic)._globalAABBBounds;
15220
- if (cachedBounds && "function" == typeof cachedBounds.empty && !cachedBounds.empty()) return cachedBounds;
14657
+ if (cachedBounds && !cachedBounds.empty()) return cachedBounds;
15221
14658
  }
15222
14659
  registerDirtyBoundsHooks(stage) {
15223
14660
  this.dirtyBoundsHooksRegistered || (stage.graphicService.hooks.onAttributeUpdate.tap(this.key, this.handlePaintOnlyUpdate), stage.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key, (graphic, stage, willUpdate, bounds) => {
@@ -15270,256 +14707,6 @@
15270
14707
  return isBrowserEnv() ? "browser" : "node";
15271
14708
  }
15272
14709
 
15273
- var __awaiter$4 = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
15274
- return new (P || (P = Promise))(function (resolve, reject) {
15275
- function fulfilled(value) {
15276
- try {
15277
- step(generator.next(value));
15278
- } catch (e) {
15279
- reject(e);
15280
- }
15281
- }
15282
- function rejected(value) {
15283
- try {
15284
- step(generator.throw(value));
15285
- } catch (e) {
15286
- reject(e);
15287
- }
15288
- }
15289
- function step(result) {
15290
- var value;
15291
- result.done ? resolve(result.value) : (value = result.value, value instanceof P ? value : new P(function (resolve) {
15292
- resolve(value);
15293
- })).then(fulfilled, rejected);
15294
- }
15295
- step((generator = generator.apply(thisArg, _arguments || [])).next());
15296
- });
15297
- };
15298
- function isRenderableGraphic(graphic) {
15299
- return !!graphic.stage && "released" !== graphic.releaseStatus;
15300
- }
15301
- function createTargetStatesKey(targetStates) {
15302
- return targetStates.length ? targetStates.join("|") : "__clear__";
15303
- }
15304
- function createIntentKey(contextOwnerId, configFingerprint, targetStatesKey) {
15305
- return `${contextOwnerId}:${configFingerprint}:${targetStatesKey}`;
15306
- }
15307
- function hasMeaningfulDeferredConfig(config) {
15308
- const normalized = normalizeDeferredStateOwnerConfig(config);
15309
- return !!normalized && (null != normalized.localEnabled || null != normalized.deferred);
15310
- }
15311
- function getGraphicCompiledDefinitions(graphic) {
15312
- const graphicAny = graphic;
15313
- if ("function" == typeof graphicAny.resolveEffectiveCompiledDefinitions) {
15314
- const result = graphicAny.resolveEffectiveCompiledDefinitions();
15315
- return {
15316
- compiledDefinitions: result.compiledDefinitions,
15317
- stateProxyEligibility: result.stateProxyEligibility
15318
- };
15319
- }
15320
- return {};
15321
- }
15322
- function getCurrentStateNames(graphic) {
15323
- var _a, _b;
15324
- return null !== (_b = null === (_a = graphic.currentStates) || void 0 === _a ? void 0 : _a.slice()) && void 0 !== _b ? _b : [];
15325
- }
15326
- class StateBatchScheduler {
15327
- constructor(stage, perfMonitor) {
15328
- this.stage = stage, this.perfMonitor = perfMonitor, this.jobsByIntentKey = new Map(), this.pendingIntentByGraphic = new Map(), this.nextJobId = 1, this.runningJobs = new Map();
15329
- }
15330
- schedule(graphics, targetStates) {
15331
- const batchOperation = graphics.length > 1;
15332
- graphics.forEach(graphic => {
15333
- const eligibility = this.resolveEligibility(graphic, targetStates, batchOperation, !0);
15334
- if ("reason" in eligibility) return this.removeGraphicFromPending(graphic), void ("graphic_unavailable" !== eligibility.reason && this.commitSynchronously(graphic, targetStates));
15335
- this.enqueueDeferredIntent(graphic, targetStates, eligibility.context, eligibility.targetStatesKey);
15336
- });
15337
- }
15338
- release() {
15339
- var _a;
15340
- this.jobsByIntentKey.forEach(job => {
15341
- job.status = "cancelled";
15342
- }), this.jobsByIntentKey.clear(), this.pendingIntentByGraphic.clear(), this.runningJobs.clear(), null === (_a = this.perfMonitor) || void 0 === _a || _a.updateBatchPending(0);
15343
- }
15344
- resolveEligibility(graphic, targetStates, batchOperation, recordObservability) {
15345
- var _a, _b, _c, _d, _e, _f;
15346
- if (!isRenderableGraphic(graphic)) return recordObservability && (null === (_a = this.perfMonitor) || void 0 === _a || _a.recordDeferredIneligible("graphic_unavailable")), {
15347
- eligible: !1,
15348
- reason: "graphic_unavailable"
15349
- };
15350
- if (!batchOperation) return recordObservability && (null === (_b = this.perfMonitor) || void 0 === _b || _b.recordDeferredIneligible("non_batch_operation")), {
15351
- eligible: !1,
15352
- reason: "non_batch_operation"
15353
- };
15354
- const context = this.resolveDeferredContext(graphic);
15355
- if (!context) return recordObservability && (null === (_c = this.perfMonitor) || void 0 === _c || _c.recordDeferredIneligible("graphic_unavailable")), {
15356
- eligible: !1,
15357
- reason: "graphic_unavailable"
15358
- };
15359
- if (!context.config.enabled) {
15360
- const normalizedOwnerConfig = normalizeDeferredStateOwnerConfig(context.contextOwner.deferredStateConfig),
15361
- reason = !1 === (null == normalizedOwnerConfig ? void 0 : normalizedOwnerConfig.localEnabled) ? "context_disabled" : "config_disabled";
15362
- return recordObservability && (null === (_d = this.perfMonitor) || void 0 === _d || _d.recordDeferredIneligible(reason)), {
15363
- eligible: !1,
15364
- reason: reason
15365
- };
15366
- }
15367
- const classification = this.classifyGraphicTargetStates(graphic, targetStates);
15368
- return classification.reason ? (recordObservability && (null === (_e = this.perfMonitor) || void 0 === _e || _e.recordDeferredIneligible(classification.reason)), {
15369
- eligible: !1,
15370
- reason: classification.reason
15371
- }) : classification.category !== UpdateCategory.PAINT ? (recordObservability && (null === (_f = this.perfMonitor) || void 0 === _f || _f.recordDeferredIneligible("mixed_update_category")), {
15372
- eligible: !1,
15373
- reason: "mixed_update_category"
15374
- }) : {
15375
- eligible: !0,
15376
- context: context,
15377
- targetStatesKey: createTargetStatesKey(targetStates)
15378
- };
15379
- }
15380
- resolveDeferredContext(graphic) {
15381
- var _a;
15382
- const stage = graphic.stage;
15383
- if (!stage) return;
15384
- let owner = stage,
15385
- config = normalizeDeferredStateConfig(void 0);
15386
- const ownerConfigs = [stage],
15387
- parents = [];
15388
- let parent = graphic.parent;
15389
- for (; parent && parent !== stage;) parents.push(parent), parent = parent.parent;
15390
- parents.reverse().forEach(current => ownerConfigs.push(current)), ownerConfigs.forEach(current => {
15391
- const deferredStateConfig = normalizeDeferredStateOwnerConfig(current.deferredStateConfig);
15392
- deferredStateConfig && (deferredStateConfig.deferred && (config = Object.assign(Object.assign({}, config), deferredStateConfig.deferred)), null != deferredStateConfig.localEnabled && (config.enabled = deferredStateConfig.localEnabled), hasMeaningfulDeferredConfig(current.deferredStateConfig) && (owner = current));
15393
- });
15394
- const normalized = normalizeDeferredStateConfig(config);
15395
- return {
15396
- contextOwner: owner,
15397
- contextOwnerId: null !== (_a = owner._uid) && void 0 !== _a ? _a : 0,
15398
- config: normalized,
15399
- configFingerprint: fingerprintDeferredStateConfig(normalized)
15400
- };
15401
- }
15402
- classifyGraphicTargetStates(graphic, targetStates) {
15403
- const {
15404
- compiledDefinitions: compiledDefinitions,
15405
- stateProxyEligibility: stateProxyEligibility
15406
- } = getGraphicCompiledDefinitions(graphic),
15407
- candidateStates = Array.from(new Set([...getCurrentStateNames(graphic), ...targetStates]));
15408
- let category = UpdateCategory.NONE;
15409
- return candidateStates.forEach(stateName => {
15410
- if (null == stateProxyEligibility ? void 0 : stateProxyEligibility(stateName)) return void (category = UpdateCategory.NONE);
15411
- const definition = null == compiledDefinitions ? void 0 : compiledDefinitions.get(stateName);
15412
- definition && (definition.hasResolver && 0 === definition.affectedKeys.size ? category = UpdateCategory.NONE : category |= classifyAffectedKeys(definition.affectedKeys));
15413
- }), candidateStates.some(stateName => null == stateProxyEligibility ? void 0 : stateProxyEligibility(stateName)) || candidateStates.some(stateName => {
15414
- const definition = null == compiledDefinitions ? void 0 : compiledDefinitions.get(stateName);
15415
- return !!(null == definition ? void 0 : definition.hasResolver) && 0 === definition.affectedKeys.size;
15416
- }) ? {
15417
- category: UpdateCategory.NONE,
15418
- reason: "resolver_unstable_keys"
15419
- } : {
15420
- category: category === UpdateCategory.NONE ? UpdateCategory.PAINT : category
15421
- };
15422
- }
15423
- enqueueDeferredIntent(graphic, targetStates, context, targetStatesKey) {
15424
- var _a, _b, _c, _d, _e, _f;
15425
- const nextIntentKey = createIntentKey(context.contextOwnerId, context.configFingerprint, targetStatesKey),
15426
- prevIntentKey = this.pendingIntentByGraphic.get(graphic);
15427
- if (prevIntentKey === nextIntentKey) return void (null === (_a = this.perfMonitor) || void 0 === _a || _a.incrementCounter("deferredJobsCoalesced"));
15428
- prevIntentKey && this.removeGraphicFromIntentJob(graphic, prevIntentKey);
15429
- let job = this.jobsByIntentKey.get(nextIntentKey);
15430
- job ? null === (_d = this.perfMonitor) || void 0 === _d || _d.incrementCounter("deferredJobsCoalesced") : (job = {
15431
- id: this.nextJobId++,
15432
- kind: "apply_states",
15433
- intentKey: nextIntentKey,
15434
- status: "pending",
15435
- targetStates: [...targetStates],
15436
- targetStatesKey: targetStatesKey,
15437
- pendingGraphics: new Set(),
15438
- orderedGraphics: [],
15439
- config: context.config,
15440
- contextOwner: context.contextOwner,
15441
- contextOwnerId: context.contextOwnerId,
15442
- configFingerprint: context.configFingerprint,
15443
- createdAt: Date.now(),
15444
- processedCount: 0
15445
- }, this.jobsByIntentKey.set(nextIntentKey, job), null === (_b = this.perfMonitor) || void 0 === _b || _b.incrementCounter("deferredJobsCreated"), null === (_c = this.perfMonitor) || void 0 === _c || _c.updateBatchPending(this.jobsByIntentKey.size)), job.pendingGraphics.has(graphic) || (job.pendingGraphics.add(graphic), job.orderedGraphics.push(graphic), this.pendingIntentByGraphic.set(graphic, nextIntentKey), null === (_e = this.perfMonitor) || void 0 === _e || _e.recordAllocation("batchEntriesCreated"), null === (_f = this.perfMonitor) || void 0 === _f || _f.updateMaxGraphicsInJob(job.pendingGraphics.size)), this.ensureJobRunning(job);
15446
- }
15447
- removeGraphicFromPending(graphic) {
15448
- const prevIntentKey = this.pendingIntentByGraphic.get(graphic);
15449
- prevIntentKey && this.removeGraphicFromIntentJob(graphic, prevIntentKey);
15450
- }
15451
- removeGraphicFromIntentJob(graphic, intentKey) {
15452
- var _a, _b, _c;
15453
- const job = this.jobsByIntentKey.get(intentKey);
15454
- job ? (job.pendingGraphics.delete(graphic), this.pendingIntentByGraphic.get(graphic) === intentKey && this.pendingIntentByGraphic.delete(graphic), 0 === job.pendingGraphics.size && "completed" !== job.status && (job.status = "cancelled", this.jobsByIntentKey.delete(intentKey), null === (_a = this.perfMonitor) || void 0 === _a || _a.incrementCounter("deferredJobsCancelled"), null === (_b = this.perfMonitor) || void 0 === _b || _b.recordEvent("deferred-job-cancel", {
15455
- intentKey: intentKey,
15456
- jobId: job.id
15457
- }), null === (_c = this.perfMonitor) || void 0 === _c || _c.updateBatchPending(this.jobsByIntentKey.size))) : this.pendingIntentByGraphic.delete(graphic);
15458
- }
15459
- ensureJobRunning(job) {
15460
- if (this.runningJobs.has(job.intentKey)) return;
15461
- const runner = this.runJob(job).then(() => {
15462
- this.runningJobs.delete(job.intentKey);
15463
- }, () => {
15464
- this.runningJobs.delete(job.intentKey);
15465
- });
15466
- this.runningJobs.set(job.intentKey, runner);
15467
- }
15468
- runJob(job) {
15469
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
15470
- return __awaiter$4(this, void 0, void 0, function* () {
15471
- if ("cancelled" === job.status) return;
15472
- if (yield this.waitForNextFrame(), "cancelled" === job.status) return;
15473
- job.status = "running", null === (_a = this.perfMonitor) || void 0 === _a || _a.recordEvent("deferred-job-start", {
15474
- intentKey: job.intentKey,
15475
- jobId: job.id
15476
- });
15477
- let index = 0,
15478
- frameStart = performance.now(),
15479
- processedInFrame = 0,
15480
- committedInSlice = 0;
15481
- for (; index < job.orderedGraphics.length;) {
15482
- if ("cancelled" === job.status) return;
15483
- processedInFrame > 0 && (processedInFrame >= job.config.maxGraphicsPerFrame || performance.now() - frameStart >= job.config.frameBudget) && (null === (_b = this.perfMonitor) || void 0 === _b || _b.incrementCounter("deferredBudgetYields"), null === (_c = this.perfMonitor) || void 0 === _c || _c.recordCost("batchSlice", performance.now() - frameStart), null === (_d = this.perfMonitor) || void 0 === _d || _d.recordEvent("deferred-job-yield", {
15484
- intentKey: job.intentKey,
15485
- jobId: job.id,
15486
- processedInFrame: processedInFrame
15487
- }), committedInSlice > 0 && this.stage.renderNextFrame(), yield this.waitForNextFrame(), frameStart = performance.now(), processedInFrame = 0, committedInSlice = 0);
15488
- const graphic = job.orderedGraphics[index++];
15489
- if (!job.pendingGraphics.has(graphic)) continue;
15490
- if (!isRenderableGraphic(graphic)) {
15491
- job.pendingGraphics.delete(graphic), this.pendingIntentByGraphic.get(graphic) === job.intentKey && this.pendingIntentByGraphic.delete(graphic);
15492
- continue;
15493
- }
15494
- if (this.pendingIntentByGraphic.get(graphic) !== job.intentKey) {
15495
- job.pendingGraphics.delete(graphic);
15496
- continue;
15497
- }
15498
- const nextEligibility = this.resolveEligibility(graphic, job.targetStates, !0, !1);
15499
- if (!nextEligibility.eligible) {
15500
- job.pendingGraphics.delete(graphic), this.pendingIntentByGraphic.delete(graphic), this.commitSynchronously(graphic, job.targetStates);
15501
- continue;
15502
- }
15503
- createIntentKey(nextEligibility.context.contextOwnerId, nextEligibility.context.configFingerprint, nextEligibility.targetStatesKey) === job.intentKey ? (this.commitSynchronously(graphic, job.targetStates), job.pendingGraphics.delete(graphic), this.pendingIntentByGraphic.delete(graphic), job.processedCount += 1, processedInFrame += 1, committedInSlice += 1, null === (_e = this.perfMonitor) || void 0 === _e || _e.incrementCounter("deferredGraphicsCommitted")) : (job.pendingGraphics.delete(graphic), this.pendingIntentByGraphic.delete(graphic), this.enqueueDeferredIntent(graphic, job.targetStates, nextEligibility.context, nextEligibility.targetStatesKey));
15504
- }
15505
- processedInFrame > 0 && (null === (_f = this.perfMonitor) || void 0 === _f || _f.recordCost("batchSlice", performance.now() - frameStart), this.stage.renderNextFrame()), 0 === job.pendingGraphics.size && this.jobsByIntentKey.get(job.intentKey) === job && (job.status = "completed", this.jobsByIntentKey.delete(job.intentKey), null === (_g = this.perfMonitor) || void 0 === _g || _g.incrementCounter("deferredJobsCompleted"), null === (_h = this.perfMonitor) || void 0 === _h || _h.recordEvent("deferred-job-complete", {
15506
- intentKey: job.intentKey,
15507
- jobId: job.id,
15508
- processedCount: job.processedCount
15509
- }), null === (_j = this.perfMonitor) || void 0 === _j || _j.updateBatchPending(this.jobsByIntentKey.size));
15510
- });
15511
- }
15512
- waitForNextFrame() {
15513
- const stageGlobal = this.stage.global;
15514
- return (null == stageGlobal ? void 0 : stageGlobal.getSpecifiedPerformanceRAF) ? stageGlobal.getSpecifiedPerformanceRAF(this.stage.rafId).wait() : new Promise(resolve => {
15515
- null == stageGlobal || stageGlobal.getSpecifiedRequestAnimationFrame(this.stage.rafId)(() => resolve());
15516
- });
15517
- }
15518
- commitSynchronously(graphic, targetStates) {
15519
- isRenderableGraphic(graphic) && (targetStates.length ? graphic.useStates(targetStates, !1) : graphic.clearStates(!1));
15520
- }
15521
- }
15522
-
15523
14710
  const DefaultConfig = {
15524
14711
  WIDTH: 500,
15525
14712
  HEIGHT: 500,
@@ -15636,10 +14823,9 @@
15636
14823
  main: !0
15637
14824
  })), this.nextFrameRenderLayerSet = new Set(), this.willNextFrameRender = !1, this.theme.onStateDefinitionsChange = () => {
15638
14825
  var _a;
15639
- const definitions = null === (_a = this.theme) || void 0 === _a ? void 0 : _a.stateDefinitions;
15640
- if (!definitions || !Object.keys(definitions).length) return void (this.rootSharedStateScope && (setRootSharedStateScopeThemeDefinitions(this.rootSharedStateScope, definitions), markScopeActiveDescendantsDirty(this.rootSharedStateScope, this)));
15641
- const rootScope = this.ensureRootSharedStateScope(definitions);
15642
- setRootSharedStateScopeThemeDefinitions(rootScope, definitions), markScopeActiveDescendantsDirty(rootScope, this);
14826
+ const definitions = null === (_a = this.theme) || void 0 === _a ? void 0 : _a.stateDefinitions,
14827
+ rootScope = definitions && Object.keys(definitions).length ? this.ensureRootSharedStateScope(definitions) : this.rootSharedStateScope;
14828
+ rootScope && (setRootSharedStateScopeThemeDefinitions(rootScope, definitions), markScopeActiveDescendantsDirty(rootScope, this));
15643
14829
  }, this.renderStyle = params.renderStyle, params.autoRender && this.enableAutoRender(), params.autoRefresh && this.enableAutoRefresh(), !1 === params.disableDirtyBounds && this.enableDirtyBounds(), params.enableHtmlAttribute && this.enableHtmlAttribute(params.enableHtmlAttribute), params.ReactDOM && this.enableReactAttribute(params.ReactDOM), params.enableLayout && this.enableLayout(), this.hooks.beforeRender.tap("constructor", this.beforeRender), this.hooks.afterRender.tap("constructor", this.afterRender), params.beforeRender && this._beforeRenderList.push(params.beforeRender), params.afterRender && this._afterRenderList.push(params.afterRender), this.hooks.afterClearScreen.tap("constructor", this.afterClearScreen), this.hooks.afterClearRect.tap("constructor", this.afterClearRect), this._afterClearScreen = params.afterClearScreen, this._afterClearRect = params.afterClearRect, this.supportInteractiveLayer = !1 !== params.interactiveLayer, params.optimize || (params.optimize = {
15644
14830
  tickRenderMode: "effect"
15645
14831
  }), this.optmize(params.optimize), params.background && isString$1(this._background) && this._background.includes("/") && this.setAttributes({
@@ -15907,18 +15093,6 @@
15907
15093
  ensureRootSharedStateScope(themeStateDefinitions) {
15908
15094
  return this.rootSharedStateScope ? (this.rootSharedStateScope.ownerStage = this, this.rootSharedStateScope) : (this.rootSharedStateScope = createRootSharedStateScope(this, themeStateDefinitions), this.rootSharedStateScope);
15909
15095
  }
15910
- getStateBatchScheduler() {
15911
- return this._stateBatchScheduler || (this._stateBatchScheduler = new StateBatchScheduler(this, ensureStageStatePerfMonitor(this))), this._stateBatchScheduler;
15912
- }
15913
- scheduleStateBatch(graphics, targetStates) {
15914
- this.getStateBatchScheduler().schedule(graphics, targetStates);
15915
- }
15916
- getStatePerfSnapshot() {
15917
- return ensureStageStatePerfMonitor(this).getSnapshot();
15918
- }
15919
- resetStatePerfSnapshot() {
15920
- ensureStageStatePerfMonitor(this).reset();
15921
- }
15922
15096
  _doRenderInThisFrame() {
15923
15097
  if ("released" === this.releaseStatus) return;
15924
15098
  this.startAnimate();
@@ -15994,12 +15168,12 @@
15994
15168
  throw new Error("暂不支持");
15995
15169
  }
15996
15170
  release() {
15997
- var _a, _b, _d, _e;
15998
- null === (_a = this._stateBatchScheduler) || void 0 === _a || _a.release(), super.release(), this.hooks.beforeRender.unTap("constructor", this.beforeRender), this.hooks.afterRender.unTap("constructor", this.afterRender), this.eventSystem && this.eventSystem.release(), this.layerService.releaseStage(this), this.pluginService.release(), this.forEach(layer => {
15171
+ var _a, _b, _d;
15172
+ super.release(), this.hooks.beforeRender.unTap("constructor", this.beforeRender), this.hooks.afterRender.unTap("constructor", this.afterRender), this.eventSystem && this.eventSystem.release(), this.layerService.releaseStage(this), this.pluginService.release(), this.forEach(layer => {
15999
15173
  layer.release();
16000
15174
  }), this.interactiveLayer && (this.interactiveLayer.forEachChildren(item => {
16001
15175
  item.setStage && item.setStage(null, null), this.interactiveLayer.removeChild(item);
16002
- }), this.interactiveLayer.release()), this.window.release(), null === (_b = this._ticker) || void 0 === _b || _b.remTimeline(null == this ? void 0 : this.timeline), null === (_d = this._ticker) || void 0 === _d || _d.removeListener("tick", this.afterTickCb), this.params.ticker || null === (_e = this._ticker) || void 0 === _e || _e.release(), this.renderService.renderTreeRoots = [];
15176
+ }), this.interactiveLayer.release()), this.window.release(), null === (_a = this._ticker) || void 0 === _a || _a.remTimeline(null == this ? void 0 : this.timeline), null === (_b = this._ticker) || void 0 === _b || _b.removeListener("tick", this.afterTickCb), this.params.ticker || null === (_d = this._ticker) || void 0 === _d || _d.release(), this.renderService.renderTreeRoots = [];
16003
15177
  }
16004
15178
  setStage(stage) {}
16005
15179
  dirty(b, matrix) {
@@ -20395,24 +19569,16 @@
20395
19569
  this.context.release();
20396
19570
  }
20397
19571
  }
20398
- function createBrowserApp$1(options = {}) {
19572
+ function createBrowserApp(options = {}) {
20399
19573
  return new BrowserEntry(options);
20400
19574
  }
20401
19575
 
20402
- class NodeEntry extends BrowserEntry {
20403
- constructor(options = {}) {
20404
- super(options);
20405
- }
20406
- }
19576
+ class NodeEntry extends BrowserEntry {}
20407
19577
  function createNodeApp$1(options = {}) {
20408
19578
  return new NodeEntry(options);
20409
19579
  }
20410
19580
 
20411
- class MiniappEntry extends BrowserEntry {
20412
- constructor(options = {}) {
20413
- super(options);
20414
- }
20415
- }
19581
+ class MiniappEntry extends BrowserEntry {}
20416
19582
  function createMiniappApp$1(options = {}) {
20417
19583
  return new MiniappEntry(options);
20418
19584
  }
@@ -23814,11 +22980,11 @@
23814
22980
  configureRuntimeApplicationForApp: configureRuntimeApplicationForApp,
23815
22981
  container: container,
23816
22982
  cornerTangents: cornerTangents,
23817
- createApp: createBrowserApp$1,
22983
+ createApp: createBrowserApp,
23818
22984
  createArc: createArc,
23819
22985
  createArc3d: createArc3d,
23820
22986
  createArea: createArea,
23821
- createBrowserApp: createBrowserApp$1,
22987
+ createBrowserApp: createBrowserApp,
23822
22988
  createCanvasEventTransformer: createCanvasEventTransformer,
23823
22989
  createCircle: createCircle,
23824
22990
  createColor: createColor,
@@ -31577,21 +30743,20 @@
31577
30743
  function jsx(type, config, ...children) {
31578
30744
  const _a = config || {},
31579
30745
  {
31580
- key: key,
31581
30746
  name: name,
31582
30747
  id: id,
31583
30748
  attribute: attribute,
31584
- stateProxy: stateProxy,
30749
+ states: states,
31585
30750
  animation: animation,
31586
30751
  timeline: timeline
31587
30752
  } = _a,
31588
- props = __rest$e(_a, ["key", "name", "id", "attribute", "stateProxy", "animation", "timeline"]);
30753
+ props = __rest$e(_a, ["name", "id", "attribute", "states", "animation", "timeline"]);
31589
30754
  let c = type;
31590
30755
  isString$1(type) && (c = graphicCreator$1[type]);
31591
30756
  const childrenList = [];
31592
30757
  children.length && flatten(1 === children.length ? children[0] : children, childrenList);
31593
30758
  const g = "Group" === c.name ? new c(attribute) : c(config);
31594
- if (parseToGraphic$1(g, childrenList, props), stateProxy && (g.stateProxy = stateProxy), name && (g.name = name), isArray$1(animation)) {
30759
+ if (parseToGraphic$1(g, childrenList, props), name && (g.name = name), id && (g.id = id), states && (g.states = states), isArray$1(animation)) {
31595
30760
  const animate = g.animate();
31596
30761
  timeline && animate.setTimeline(timeline), animation.forEach(item => {
31597
30762
  animate[item[0]](...item.slice(1));
@@ -31627,7 +30792,7 @@
31627
30792
  {
31628
30793
  attribute: attribute,
31629
30794
  children: children,
31630
- stateProxy: stateProxy,
30795
+ states: states,
31631
30796
  id: id,
31632
30797
  name: name
31633
30798
  } = dom.props,
@@ -31635,7 +30800,7 @@
31635
30800
  attribute: attribute
31636
30801
  }),
31637
30802
  out = parseToGraphic(g, dom.props, children);
31638
- return out || (stateProxy && (g.stateProxy = stateProxy), g.id = id, g.name = name, parseChildren(children, g), g);
30803
+ return out || (g.id = id, g.name = name, states && (g.states = states), parseChildren(children, g), g);
31639
30804
  }
31640
30805
  function parseChildren(children, g) {
31641
30806
  isArray$1(children) ? children.forEach(item => {
@@ -33270,11 +32435,10 @@
33270
32435
  }
33271
32436
  function prepareAnimationFrameAttribute(target) {
33272
32437
  const transientTarget = target;
33273
- return transientTarget.attribute || (transientTarget.attribute = {}), transientTarget.attribute === transientTarget.baseAttributes && "function" == typeof transientTarget.detachAttributeFromBaseAttributes && transientTarget.detachAttributeFromBaseAttributes(), transientTarget.attributeMayContainTransientAttrs = !0, transientTarget.attribute;
32438
+ return transientTarget.attribute || (transientTarget.attribute = {}), transientTarget.attribute === transientTarget.baseAttributes && transientTarget.detachAttributeFromBaseAttributes(), transientTarget.attributeMayContainTransientAttrs = !0, transientTarget.attribute;
33274
32439
  }
33275
32440
  function commitAnimationFrameAttribute(target) {
33276
- var _a, _b;
33277
- null === (_b = (_a = target).onAttributeUpdate) || void 0 === _b || _b.call(_a, animateUpdateContext);
32441
+ target.onAttributeUpdate(animateUpdateContext);
33278
32442
  }
33279
32443
  function applyAnimationFrameAttributes(target, attributes) {
33280
32444
  if (!attributes) return;
@@ -33291,11 +32455,9 @@
33291
32455
  commitAnimationFrameAttribute(target);
33292
32456
  }
33293
32457
  function applyAnimationTransientAttributes(target, attributes, type = exports.AttributeUpdateType.ANIMATE_UPDATE) {
33294
- var _a;
33295
32458
  if (!attributes) return;
33296
- const context = getAnimationContext(type),
33297
- transientTarget = target;
33298
- "function" != typeof transientTarget.applyAnimationTransientAttributes ? "function" != typeof transientTarget.applyTransientAttributes ? "function" != typeof transientTarget.setAttributesAndPreventAnimate ? (transientTarget.attribute || (transientTarget.attribute = {}), Object.assign(transientTarget.attribute, attributes), null === (_a = transientTarget.onAttributeUpdate) || void 0 === _a || _a.call(transientTarget, context)) : transientTarget.setAttributesAndPreventAnimate(attributes, !1, context) : transientTarget.applyTransientAttributes(attributes, !1, context) : transientTarget.applyAnimationTransientAttributes(attributes, !1, context);
32459
+ const context = getAnimationContext(type);
32460
+ target.applyAnimationTransientAttributes(attributes, !1, context);
33299
32461
  }
33300
32462
  function applyAppearStartAttributes(target, attributes) {
33301
32463
  applyAnimationTransientAttributes(target, attributes, exports.AttributeUpdateType.ANIMATE_BIND);
@@ -33310,8 +32472,7 @@
33310
32472
  constructor(type, props, duration, easing) {
33311
32473
  var _a;
33312
32474
  this._startTime = 0, this._hasFirstRun = !1, this._syncAttributeUpdate = () => {
33313
- var _a, _b, _c, _d, _e, _f;
33314
- null === (_b = (_a = this.target).addUpdateShapeAndBoundsTag) || void 0 === _b || _b.call(_a), null === (_d = (_c = this.target).addUpdatePositionTag) || void 0 === _d || _d.call(_c), null === (_f = (_e = this.target).onAttributeUpdate) || void 0 === _f || _f.call(_e, {
32475
+ this.target.addUpdateShapeAndBoundsTag(), this.target.addUpdatePositionTag(), this.target.onAttributeUpdate({
33315
32476
  type: exports.AttributeUpdateType.ANIMATE_UPDATE
33316
32477
  });
33317
32478
  }, this.type = type, this.props = props, this.duration = duration, this.easing = easing ? "function" == typeof easing ? easing : null !== (_a = Easing[easing]) && void 0 !== _a ? _a : Easing.linear : Easing.linear, "wait" === type && (this.onUpdate = noop), this.id = Generator.GenAutoIncrementId(), this.syncAttributeUpdate = noop;
@@ -33384,15 +32545,10 @@
33384
32545
  }
33385
32546
  }
33386
32547
  tryPreventConflict() {
33387
- var _a, _b;
33388
32548
  const animate = this.animate,
33389
32549
  target = this.target,
33390
- forEachTrackedAnimate = null !== (_b = null === (_a = target.forEachTrackedAnimate) || void 0 === _a ? void 0 : _a.bind(target)) && void 0 !== _b ? _b : cb => {
33391
- var _a;
33392
- null === (_a = target.animates) || void 0 === _a || _a.forEach(cb);
33393
- },
33394
32550
  propKeys = this.propKeys;
33395
- forEachTrackedAnimate(a => {
32551
+ target.forEachTrackedAnimate(a => {
33396
32552
  if (a === animate || a.priority > animate.priority || a.priority === 1 / 0) return;
33397
32553
  const fromProps = a.getStartProps();
33398
32554
  let conflictKeys = null;
@@ -33619,19 +32775,13 @@
33619
32775
  super(from, to, duration, easing, params), this.from = null != from ? from : {};
33620
32776
  }
33621
32777
  applyTransientFromAttributes() {
33622
- var _a, _b;
33623
- const target = this.target;
33624
- "function" != typeof target.applyTransientAttributes ? (Object.assign(null !== (_a = target.attribute) && void 0 !== _a ? _a : {}, this.from), null === (_b = target.onAttributeUpdate) || void 0 === _b || _b.call(target, {
33625
- type: exports.AttributeUpdateType.ANIMATE_START
33626
- })) : target.applyTransientAttributes(this.from, !1, {
33627
- type: exports.AttributeUpdateType.ANIMATE_START
33628
- });
32778
+ applyAnimationTransientAttributes(this.target, this.from, exports.AttributeUpdateType.ANIMATE_START);
33629
32779
  }
33630
32780
  onBind() {
33631
- var _a, _b, _c, _d, _e;
32781
+ var _a, _b, _c;
33632
32782
  super.onBind(), Object.keys(this.from).forEach(key => {
33633
32783
  null == this.props[key] && (this.props[key] = this.target.getGraphicAttribute(key));
33634
- }), "appear" === (null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.animationState) && (null === (_c = (_b = this.target).applyFinalAttributeToAttribute) || void 0 === _c || _c.call(_b)), !1 !== (null === (_e = null === (_d = this.params) || void 0 === _d ? void 0 : _d.controlOptions) || void 0 === _e ? void 0 : _e.immediatelyApply) && this.applyTransientFromAttributes();
32784
+ }), "appear" === (null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.animationState) && this.target.applyFinalAttributeToAttribute(), !1 !== (null === (_c = null === (_b = this.params) || void 0 === _b ? void 0 : _b.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && this.applyTransientFromAttributes();
33635
32785
  }
33636
32786
  onFirstRun() {
33637
32787
  this.from = Object.assign(Object.assign({}, this.getLastProps()), this.from);
@@ -33692,8 +32842,8 @@
33692
32842
  bind(target) {
33693
32843
  this.target = target;
33694
32844
  const trackerTarget = this.target;
33695
- return "function" == typeof trackerTarget.detachAttributeFromBaseAttributes && trackerTarget.detachAttributeFromBaseAttributes(), "function" == typeof trackerTarget.trackAnimate ? trackerTarget.trackAnimate(this) : (this.target.animates || (this.target.animates = new Map()), this.target.animates.set(this.id, this)), this.onRemove(() => {
33696
- this.stop(), this.__skipRestoreStaticAttributeOnRemove || "function" != typeof trackerTarget.restoreStaticAttribute || trackerTarget.restoreStaticAttribute(), "function" == typeof trackerTarget.untrackAnimate ? trackerTarget.untrackAnimate(this.id) : this.target.animates.delete(this.id);
32845
+ return trackerTarget.detachAttributeFromBaseAttributes(), trackerTarget.trackAnimate(this), this.onRemove(() => {
32846
+ this.stop(), this.__skipRestoreStaticAttributeOnRemove || trackerTarget.restoreStaticAttribute(), trackerTarget.untrackAnimate(this.id);
33697
32847
  }), this.target.onAnimateBind && !this.slience && this.target.onAnimateBind(this), this.target.animationAttribute || (this.target.animationAttribute = {}), this;
33698
32848
  }
33699
32849
  to(props, duration = 300, easing = "linear") {
@@ -33830,8 +32980,7 @@
33830
32980
  if (nextTime < this._startTime) return void (this.currentTime = nextTime);
33831
32981
  if (nextTime >= this._startTime + this._totalDuration) {
33832
32982
  null === (_a = this._lastStep) || void 0 === _a || _a.onUpdate(!0, 1, {}), null === (_b = this._lastStep) || void 0 === _b || _b.onEnd(), this.onEnd(), this.status = exports.AnimateStatus.END;
33833
- const trackerTarget = this.target;
33834
- return "function" == typeof (null == trackerTarget ? void 0 : trackerTarget.restoreStaticAttribute) && trackerTarget.restoreStaticAttribute(), void (this.__skipRestoreStaticAttributeOnRemove = !0);
32983
+ return this.target.restoreStaticAttribute(), void (this.__skipRestoreStaticAttributeOnRemove = !0);
33835
32984
  }
33836
32985
  this.status = exports.AnimateStatus.RUNNING, this.currentTime <= this._startTime && this.onStart(), this.currentTime = nextTime;
33837
32986
  let cycleTime = nextTime - this._startTime,
@@ -34523,9 +33672,8 @@
34523
33672
  }
34524
33673
  syncFinalAttrsFromContext(graphic) {
34525
33674
  var _a;
34526
- const finalAttrs = null === (_a = graphic.context) || void 0 === _a ? void 0 : _a.finalAttrs,
34527
- setFinalAttributes = graphic.setFinalAttributes;
34528
- finalAttrs && "function" == typeof setFinalAttributes && setFinalAttributes.call(graphic, finalAttrs);
33675
+ const finalAttrs = null === (_a = graphic.context) || void 0 === _a ? void 0 : _a.finalAttrs;
33676
+ finalAttrs && graphic.setFinalAttributes(finalAttrs);
34529
33677
  }
34530
33678
  executeItem(params, graphic, index = 0, count = 1) {
34531
33679
  if (Array.isArray(params)) {
@@ -34778,8 +33926,7 @@
34778
33926
 
34779
33927
  class AnimateExtension {
34780
33928
  visitTrackedAnimates(cb) {
34781
- const target = this;
34782
- "function" != typeof target.forEachTrackedAnimate ? target.animates && target.animates.forEach(cb) : target.forEachTrackedAnimate(cb);
33929
+ this.forEachTrackedAnimate(cb);
34783
33930
  }
34784
33931
  getAttributes(final = !1) {
34785
33932
  return final && this.finalAttribute ? this.finalAttribute : this.attribute;
@@ -34815,15 +33962,12 @@
34815
33962
  applyFinalAttributeToAttribute() {
34816
33963
  const finalAttribute = this.getFinalAttribute();
34817
33964
  if (!finalAttribute) return;
34818
- const target = this;
34819
- "function" != typeof target.setAttributesAndPreventAnimate ? console.warn("[AnimateExtension] applyFinalAttributeToAttribute requires target.setAttributesAndPreventAnimate() to avoid committing finalAttribute into base attributes.") : target.setAttributesAndPreventAnimate(finalAttribute, !1, {
33965
+ this.setAttributesAndPreventAnimate(finalAttribute, !1, {
34820
33966
  type: exports.AttributeUpdateType.ANIMATE_BIND
34821
33967
  });
34822
33968
  }
34823
33969
  restoreStaticAttribute() {
34824
- const target = this;
34825
- if ("function" != typeof target._restoreAttributeFromStaticTruth) return "function" == typeof target.onStop ? (console.warn("[AnimateExtension] restoreStaticAttribute is using deprecated target.onStop(); implement _restoreAttributeFromStaticTruth() for explicit transient restore semantics."), void target.onStop()) : void console.warn("[AnimateExtension] restoreStaticAttribute requires target._restoreAttributeFromStaticTruth() or an equivalent transient restore path.");
34826
- target._restoreAttributeFromStaticTruth({
33970
+ this._restoreAttributeFromStaticTruth({
34827
33971
  type: exports.AttributeUpdateType.ANIMATE_END
34828
33972
  });
34829
33973
  }
@@ -35496,7 +34640,7 @@
35496
34640
  var _a;
35497
34641
  const commitTarget = target,
35498
34642
  contextFinalAttrs = null === (_a = commitTarget.context) || void 0 === _a ? void 0 : _a.finalAttrs,
35499
- finalAttribute = "function" == typeof commitTarget.getFinalAttribute ? commitTarget.getFinalAttribute() : commitTarget.finalAttribute;
34643
+ finalAttribute = commitTarget.getFinalAttribute();
35500
34644
  let commitAttrs = null;
35501
34645
  for (let i = 0; i < keys.length; i++) {
35502
34646
  const key = keys[i];
@@ -35505,9 +34649,8 @@
35505
34649
  return commitAttrs;
35506
34650
  }
35507
34651
  function commitAnimationStaticAttrs(target, keys, animate, fallbackAttrs) {
35508
- var _a, _b;
35509
34652
  const commitAttrs = buildAnimationStaticCommitAttrs(target, keys, animate, fallbackAttrs);
35510
- return !!commitAttrs && (null === (_b = (_a = target).setFinalAttributes) || void 0 === _b || _b.call(_a, commitAttrs), target.setAttributes(commitAttrs, !1, {
34653
+ return !!commitAttrs && (target.setFinalAttributes(commitAttrs), target.setAttributes(commitAttrs, !1, {
35511
34654
  type: exports.AttributeUpdateType.ANIMATE_END
35512
34655
  }), !0);
35513
34656
  }
@@ -35618,7 +34761,7 @@
35618
34761
  super(from, to, duration, easing, params);
35619
34762
  }
35620
34763
  onBind() {
35621
- var _a, _b, _c, _d, _e;
34764
+ var _a, _b, _c;
35622
34765
  super.onBind();
35623
34766
  const attrs = this.target.getFinalAttribute(),
35624
34767
  fromAttrs = null !== (_a = this.target.attribute) && void 0 !== _a ? _a : {},
@@ -35627,7 +34770,7 @@
35627
34770
  this.keys.forEach(key => {
35628
34771
  var _a, _b, _c;
35629
34772
  to[key] = null !== (_a = null == attrs ? void 0 : attrs[key]) && void 0 !== _a ? _a : 1, from[key] = null !== (_c = null !== (_b = from[key]) && void 0 !== _b ? _b : fromAttrs[key]) && void 0 !== _c ? _c : 0;
35630
- }), null === (_d = (_c = this.target).applyFinalAttributeToAttribute) || void 0 === _d || _d.call(_c), this.props = to, this.propKeys = this.keys, this.from = from, this.to = to, !1 !== (null === (_e = this.params.controlOptions) || void 0 === _e ? void 0 : _e.immediatelyApply) && applyAppearStartAttributes(this.target, from);
34773
+ }), this.target.applyFinalAttributeToAttribute(), this.props = to, this.propKeys = this.keys, this.from = from, this.to = to, !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && applyAppearStartAttributes(this.target, from);
35631
34774
  }
35632
34775
  onUpdate(end, ratio, out) {
35633
34776
  const attrs = {};
@@ -35679,8 +34822,7 @@
35679
34822
  super.onBind(), this.propKeys = ["x", "y", "z", "alpha", "zIndex"];
35680
34823
  }
35681
34824
  onFirstRun() {
35682
- var _a, _b;
35683
- super.onFirstRun(), null === (_b = (_a = this.target).applyFinalAttributeToAttribute) || void 0 === _b || _b.call(_a);
34825
+ super.onFirstRun(), this.target.applyFinalAttributeToAttribute();
35684
34826
  }
35685
34827
  onStart() {
35686
34828
  var _a, _b;
@@ -35689,7 +34831,7 @@
35689
34831
  center: center,
35690
34832
  r: r
35691
34833
  } = "function" == typeof this.params ? this.params() : this.params,
35692
- source = null !== (_a = this.target.finalAttribute) && void 0 !== _a ? _a : this.target.attribute,
34834
+ source = null !== (_a = this.target.getFinalAttribute()) && void 0 !== _a ? _a : this.target.attribute,
35693
34835
  startX = source.x,
35694
34836
  startY = source.y,
35695
34837
  startZ = null !== (_b = source.z) && void 0 !== _b ? _b : 0,
@@ -35888,14 +35030,14 @@
35888
35030
  }
35889
35031
  class GrowAngleIn extends GrowAngleBase {
35890
35032
  onBind() {
35891
- var _a, _b, _c, _d, _e;
35033
+ var _a, _b, _c;
35892
35034
  super.onBind();
35893
35035
  const {
35894
35036
  from: from,
35895
35037
  to: to
35896
35038
  } = growAngleIn(this.target, this.params.options, this.params),
35897
35039
  fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
35898
- this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to, null === (_d = (_c = this.target).applyFinalAttributeToAttribute) || void 0 === _d || _d.call(_c), !1 !== (null === (_e = this.params.controlOptions) || void 0 === _e ? void 0 : _e.immediatelyApply) && applyAppearStartAttributes(this.target, fromAttrs), this.determineUpdateFunction();
35040
+ this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to, this.target.applyFinalAttributeToAttribute(), !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && applyAppearStartAttributes(this.target, fromAttrs), this.determineUpdateFunction();
35899
35041
  }
35900
35042
  }
35901
35043
  class GrowAngleOut extends GrowAngleBase {
@@ -36038,14 +35180,14 @@
36038
35180
  super(from, to, duration, easing, params);
36039
35181
  }
36040
35182
  onBind() {
36041
- var _a, _b, _c, _d, _e;
35183
+ var _a, _b, _c;
36042
35184
  super.onBind();
36043
35185
  const {
36044
35186
  from: from,
36045
35187
  to: to
36046
35188
  } = growCenterIn(this.target, this.params.options, this.params),
36047
35189
  fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
36048
- this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to, null === (_d = (_c = this.target).applyFinalAttributeToAttribute) || void 0 === _d || _d.call(_c), !1 !== (null === (_e = this.params.controlOptions) || void 0 === _e ? void 0 : _e.immediatelyApply) && applyAppearStartAttributes(this.target, fromAttrs);
35190
+ this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to, this.target.applyFinalAttributeToAttribute(), !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && applyAppearStartAttributes(this.target, fromAttrs);
36049
35191
  }
36050
35192
  onEnd(cb) {
36051
35193
  super.onEnd(cb);
@@ -36143,14 +35285,14 @@
36143
35285
  super(from, to, duration, easing, params);
36144
35286
  }
36145
35287
  onBind() {
36146
- var _a, _b, _c, _d, _e;
35288
+ var _a, _b, _c;
36147
35289
  super.onBind();
36148
35290
  const {
36149
35291
  from: from,
36150
35292
  to: to
36151
35293
  } = growHeightIn(this.target, this.params.options, this.params),
36152
35294
  fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
36153
- this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to, null === (_d = (_c = this.target).applyFinalAttributeToAttribute) || void 0 === _d || _d.call(_c), !1 !== (null === (_e = this.params.controlOptions) || void 0 === _e ? void 0 : _e.immediatelyApply) && applyAppearStartAttributes(this.target, fromAttrs);
35295
+ this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to, this.target.applyFinalAttributeToAttribute(), !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && applyAppearStartAttributes(this.target, fromAttrs);
36154
35296
  }
36155
35297
  onEnd(cb) {
36156
35298
  super.onEnd(cb);
@@ -36254,13 +35396,13 @@
36254
35396
  }
36255
35397
  class GrowPointsIn extends GworPointsBase {
36256
35398
  onBind() {
36257
- var _a, _b, _c;
35399
+ var _a;
36258
35400
  if (super.onBind(), ["area", "line", "polygon"].includes(this.target.type)) {
36259
35401
  const {
36260
35402
  from: from,
36261
35403
  to: to
36262
35404
  } = growPointsIn(this.target, this.params.options, this.params);
36263
- this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = from, this.to = to, null === (_b = (_a = this.target).applyFinalAttributeToAttribute) || void 0 === _b || _b.call(_a), !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && applyAppearStartAttributes(this.target, from);
35405
+ this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = from, this.to = to, this.target.applyFinalAttributeToAttribute(), !1 !== (null === (_a = this.params.controlOptions) || void 0 === _a ? void 0 : _a.immediatelyApply) && applyAppearStartAttributes(this.target, from);
36264
35406
  } else this.valid = !1;
36265
35407
  }
36266
35408
  }
@@ -36316,13 +35458,13 @@
36316
35458
  };
36317
35459
  class GrowPointsXIn extends GworPointsBase {
36318
35460
  onBind() {
36319
- var _a, _b, _c;
35461
+ var _a;
36320
35462
  if (super.onBind(), ["area", "line", "polygon"].includes(this.target.type)) {
36321
35463
  const {
36322
35464
  from: from,
36323
35465
  to: to
36324
35466
  } = growPointsXIn(this.target, this.params.options, this.params);
36325
- this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = from, this.to = to, null === (_b = (_a = this.target).applyFinalAttributeToAttribute) || void 0 === _b || _b.call(_a), !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && applyAppearStartAttributes(this.target, from);
35467
+ this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = from, this.to = to, this.target.applyFinalAttributeToAttribute(), !1 !== (null === (_a = this.params.controlOptions) || void 0 === _a ? void 0 : _a.immediatelyApply) && applyAppearStartAttributes(this.target, from);
36326
35468
  } else this.valid = !1;
36327
35469
  }
36328
35470
  }
@@ -36378,13 +35520,13 @@
36378
35520
  };
36379
35521
  class GrowPointsYIn extends GworPointsBase {
36380
35522
  onBind() {
36381
- var _a, _b, _c;
35523
+ var _a;
36382
35524
  if (super.onBind(), ["area", "line", "polygon"].includes(this.target.type)) {
36383
35525
  const {
36384
35526
  from: from,
36385
35527
  to: to
36386
35528
  } = growPointsYIn(this.target, this.params.options, this.params);
36387
- this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = from, this.to = to, null === (_b = (_a = this.target).applyFinalAttributeToAttribute) || void 0 === _b || _b.call(_a), !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && applyAppearStartAttributes(this.target, from);
35529
+ this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = from, this.to = to, this.target.applyFinalAttributeToAttribute(), !1 !== (null === (_a = this.params.controlOptions) || void 0 === _a ? void 0 : _a.immediatelyApply) && applyAppearStartAttributes(this.target, from);
36388
35530
  } else this.valid = !1;
36389
35531
  }
36390
35532
  }
@@ -36489,14 +35631,14 @@
36489
35631
  }
36490
35632
  class GrowRadiusIn extends GrowPointsBase {
36491
35633
  onBind() {
36492
- var _a, _b, _c, _d, _e;
35634
+ var _a, _b, _c;
36493
35635
  super.onBind();
36494
35636
  const {
36495
35637
  from: from,
36496
35638
  to: to
36497
35639
  } = growRadiusIn(this.target, this.params.options, this.params),
36498
35640
  fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
36499
- this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to, null === (_d = (_c = this.target).applyFinalAttributeToAttribute) || void 0 === _d || _d.call(_c), !1 !== (null === (_e = this.params.controlOptions) || void 0 === _e ? void 0 : _e.immediatelyApply) && applyAppearStartAttributes(this.target, fromAttrs);
35641
+ this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to, this.target.applyFinalAttributeToAttribute(), !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && applyAppearStartAttributes(this.target, fromAttrs);
36500
35642
  }
36501
35643
  }
36502
35644
  class GrowRadiusOut extends GrowPointsBase {
@@ -36611,14 +35753,14 @@
36611
35753
  super(from, to, duration, easing, params);
36612
35754
  }
36613
35755
  onBind() {
36614
- var _a, _b, _c, _d, _e;
35756
+ var _a, _b, _c;
36615
35757
  super.onBind();
36616
35758
  const {
36617
35759
  from: from,
36618
35760
  to: to
36619
35761
  } = growWidthIn(this.target, this.params.options, this.params),
36620
35762
  fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
36621
- this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to, null === (_d = (_c = this.target).applyFinalAttributeToAttribute) || void 0 === _d || _d.call(_c), !1 !== (null === (_e = this.params.controlOptions) || void 0 === _e ? void 0 : _e.immediatelyApply) && applyAppearStartAttributes(this.target, fromAttrs);
35763
+ this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to, this.target.applyFinalAttributeToAttribute(), !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && applyAppearStartAttributes(this.target, fromAttrs);
36622
35764
  }
36623
35765
  onEnd(cb) {
36624
35766
  super.onEnd(cb);
@@ -37382,7 +36524,7 @@
37382
36524
  super(from, to, duration, easing, params);
37383
36525
  }
37384
36526
  onBind() {
37385
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
36527
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
37386
36528
  let from, to;
37387
36529
  super.onBind();
37388
36530
  const attrs = this.target.getFinalAttribute(),
@@ -37415,7 +36557,7 @@
37415
36557
  scaleY: null !== (_x = null == attrs ? void 0 : attrs.scaleY) && void 0 !== _x ? _x : 1
37416
36558
  }, this._updateFunction = this.updateXY;
37417
36559
  }
37418
- null === (_z = (_y = this.target).applyFinalAttributeToAttribute) || void 0 === _z || _z.call(_y), this.props = to, this.from = from, this.to = to, !1 !== (null === (_0 = this.params.controlOptions) || void 0 === _0 ? void 0 : _0.immediatelyApply) && applyAppearStartAttributes(this.target, from);
36560
+ this.target.applyFinalAttributeToAttribute(), this.props = to, this.from = from, this.to = to, !1 !== (null === (_y = this.params.controlOptions) || void 0 === _y ? void 0 : _y.immediatelyApply) && applyAppearStartAttributes(this.target, from);
37419
36561
  }
37420
36562
  onEnd(cb) {
37421
36563
  super.onEnd(cb);
@@ -37982,9 +37124,7 @@
37982
37124
  const {
37983
37125
  options: options
37984
37126
  } = this.params;
37985
- diffAttrs = filterExcludedChannels(diffAttrs, null == options ? void 0 : options.excludeChannels), this.props = diffAttrs;
37986
- const consumeTransientFromAttrs = this.target.consumeTransientFromAttrsBeforePreventAnimate;
37987
- this.updateFromAttrs = "function" == typeof consumeTransientFromAttrs ? consumeTransientFromAttrs.call(this.target, diffAttrs) : null, this.clipPathSyncKeys = Object.keys(diffAttrs).filter(key => clipPathGeometryAttrs[key]), this.clipPathSyncDisabled = !this.clipPathSyncKeys.length, this.syncParentClipPathToTarget();
37127
+ diffAttrs = filterExcludedChannels(diffAttrs, null == options ? void 0 : options.excludeChannels), this.props = diffAttrs, this.updateFromAttrs = this.target.consumeTransientFromAttrsBeforePreventAnimate(diffAttrs), this.clipPathSyncKeys = Object.keys(diffAttrs).filter(key => clipPathGeometryAttrs[key]), this.clipPathSyncDisabled = !this.clipPathSyncKeys.length, this.syncParentClipPathToTarget();
37988
37128
  }
37989
37129
  trySyncStartProps() {
37990
37130
  const updateFromAttrs = this.updateFromAttrs;
@@ -38002,7 +37142,7 @@
38002
37142
  this.runInterpolateUpdate(this.fromProps, this.props, easedRatio), this.syncParentClipPathToTarget(), this.onUpdate(end, easedRatio, out);
38003
37143
  }
38004
37144
  syncParentClipPathToTarget() {
38005
- var _a, _b, _c, _d;
37145
+ var _a, _b;
38006
37146
  if (this.clipPathSyncDisabled) return;
38007
37147
  const target = this.target,
38008
37148
  parent = target.parent,
@@ -38013,20 +37153,19 @@
38013
37153
  const clipGraphic = path[childIndex];
38014
37154
  if (!(null == clipGraphic ? void 0 : clipGraphic.attribute) || clipGraphic.type !== target.type || !this.isClipPathStaticTarget(clipGraphic)) return;
38015
37155
  const syncAttrs = this.buildClipPathTransientAttrs(clipGraphic);
38016
- syncAttrs && (applyAnimationFrameAttributes(clipGraphic, syncAttrs), null === (_c = clipGraphic.addUpdatePositionTag) || void 0 === _c || _c.call(clipGraphic), null === (_d = clipGraphic.addUpdateShapeAndBoundsTag) || void 0 === _d || _d.call(clipGraphic));
37156
+ syncAttrs && (applyAnimationFrameAttributes(clipGraphic, syncAttrs), clipGraphic.addUpdatePositionTag(), clipGraphic.addUpdateShapeAndBoundsTag());
38017
37157
  }
38018
37158
  getClipPathSyncChildIndex(parent) {
38019
- var _a;
38020
37159
  if (this.clipPathSyncParent === parent && this.clipPathSyncChildIndex >= 0) return this.clipPathSyncChildIndex;
38021
37160
  const target = this.target;
38022
37161
  let childIndex = -1;
38023
- return null === (_a = parent.forEachChildren) || void 0 === _a || _a.call(parent, (child, index) => child === target && (childIndex = index, !0)), this.clipPathSyncParent = parent, this.clipPathSyncChildIndex = childIndex, childIndex;
37162
+ return parent.forEachChildren((child, index) => child === target && (childIndex = index, !0)), this.clipPathSyncParent = parent, this.clipPathSyncChildIndex = childIndex, childIndex;
38024
37163
  }
38025
37164
  isClipPathStaticTarget(clipGraphic) {
38026
37165
  var _a, _b;
38027
37166
  const target = this.target,
38028
37167
  targetFinalAttrs = this.getTargetFinalAttrs(),
38029
- clipGraphicFinalAttrs = "function" == typeof clipGraphic.getFinalAttribute ? clipGraphic.getFinalAttribute() : clipGraphic.finalAttribute,
37168
+ clipGraphicFinalAttrs = clipGraphic.getFinalAttribute(),
38030
37169
  clipFinalAttrs = null !== (_a = null != clipGraphicFinalAttrs ? clipGraphicFinalAttrs : clipGraphic.baseAttributes) && void 0 !== _a ? _a : clipGraphic.attribute,
38031
37170
  keys = null !== (_b = this.clipPathSyncKeys) && void 0 !== _b ? _b : [];
38032
37171
  return !!(keys.length && targetFinalAttrs && clipFinalAttrs) && keys.every(key => {
@@ -38037,7 +37176,7 @@
38037
37176
  getTargetFinalAttrs() {
38038
37177
  var _a, _b, _c;
38039
37178
  const target = this.target;
38040
- return null !== (_c = null !== (_b = null === (_a = target.context) || void 0 === _a ? void 0 : _a.finalAttrs) && void 0 !== _b ? _b : "function" == typeof target.getFinalAttribute ? target.getFinalAttribute() : target.finalAttribute) && void 0 !== _c ? _c : null;
37179
+ return null !== (_c = null !== (_b = null === (_a = target.context) || void 0 === _a ? void 0 : _a.finalAttrs) && void 0 !== _b ? _b : target.getFinalAttribute()) && void 0 !== _c ? _c : null;
38041
37180
  }
38042
37181
  isSameClipPathValue(a, b) {
38043
37182
  return "number" == typeof a && "number" == typeof b ? Math.abs(a - b) < 1e-8 : a === b;
@@ -38165,13 +37304,13 @@
38165
37304
  }
38166
37305
  class MoveIn extends MoveBase {
38167
37306
  onBind() {
38168
- var _a, _b, _c;
37307
+ var _a;
38169
37308
  super.onBind();
38170
37309
  const {
38171
37310
  from: from,
38172
37311
  to: to
38173
37312
  } = moveIn(this.target, this.params.options, this.params);
38174
- this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = from, this.to = to, null === (_b = (_a = this.target).applyFinalAttributeToAttribute) || void 0 === _b || _b.call(_a), !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && applyAppearStartAttributes(this.target, from);
37313
+ this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = from, this.to = to, this.target.applyFinalAttributeToAttribute(), !1 !== (null === (_a = this.params.controlOptions) || void 0 === _a ? void 0 : _a.immediatelyApply) && applyAppearStartAttributes(this.target, from);
38175
37314
  }
38176
37315
  }
38177
37316
  class MoveOut extends MoveBase {
@@ -38224,13 +37363,13 @@
38224
37363
  }
38225
37364
  class RotateIn extends RotateBase {
38226
37365
  onBind() {
38227
- var _a, _b, _c;
37366
+ var _a;
38228
37367
  super.onBind();
38229
37368
  const {
38230
37369
  from: from,
38231
37370
  to: to
38232
37371
  } = rotateIn(this.target, this.params.options);
38233
- this.props = to, this.propKeys = ["angle"], this.from = from, this.to = to, null === (_b = (_a = this.target).applyFinalAttributeToAttribute) || void 0 === _b || _b.call(_a), !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && applyAppearStartAttributes(this.target, from);
37372
+ this.props = to, this.propKeys = ["angle"], this.from = from, this.to = to, this.target.applyFinalAttributeToAttribute(), !1 !== (null === (_a = this.params.controlOptions) || void 0 === _a ? void 0 : _a.immediatelyApply) && applyAppearStartAttributes(this.target, from);
38234
37373
  }
38235
37374
  }
38236
37375
  class RotateOut extends RotateBase {
@@ -39737,7 +38876,7 @@
39737
38876
  [key]: value
39738
38877
  }, this.attribute, key, context);
39739
38878
  if (params) return this._setAttributes(params, forceUpdateTag);
39740
- isPlainObject$4(this.attribute[key]) && isPlainObject$4(value) && !isFunction$1(this.attribute[key]) && !isFunction$1(value) ? merge(this.attribute[key], value) : this.attribute[key] = value, this._skipRenderAttributes.includes(key) || this.render(), this.valid = this.isValid(), this.updateShapeAndBoundsTagSetted() || !forceUpdateTag && !this.needUpdateTag(key) ? this.addUpdateBoundTag() : this.addUpdateShapeAndBoundsTag(), this.addUpdatePositionTag(), this.onAttributeUpdate();
38879
+ isPlainObject$3(this.attribute[key]) && isPlainObject$3(value) && !isFunction$1(this.attribute[key]) && !isFunction$1(value) ? merge(this.attribute[key], value) : this.attribute[key] = value, this._skipRenderAttributes.includes(key) || this.render(), this.valid = this.isValid(), this.updateShapeAndBoundsTagSetted() || !forceUpdateTag && !this.needUpdateTag(key) ? this.addUpdateBoundTag() : this.addUpdateShapeAndBoundsTag(), this.addUpdatePositionTag(), this.onAttributeUpdate();
39741
38880
  }
39742
38881
  setAttributes(params, forceUpdateTag, context) {
39743
38882
  return params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params, this._setAttributes(params, forceUpdateTag);
@@ -39750,7 +38889,7 @@
39750
38889
  isNil$1(keys) && (keys = Object.keys(params));
39751
38890
  for (let i = 0; i < keys.length; i++) {
39752
38891
  const key = keys[i];
39753
- !isPlainObject$4(this.attribute[key]) || isFunction$1(this.attribute[key]) || isFunction$1(params[key]) ? this.attribute[key] = params[key] : merge(this.attribute[key], params[key]);
38892
+ !isPlainObject$3(this.attribute[key]) || isFunction$1(this.attribute[key]) || isFunction$1(params[key]) ? this.attribute[key] = params[key] : merge(this.attribute[key], params[key]);
39754
38893
  }
39755
38894
  }
39756
38895
  bindEvents() {}
@@ -43810,7 +42949,7 @@
43810
42949
  for (let i = 0; i < domain.length; i++) {
43811
42950
  const v = domain[i],
43812
42951
  str = labelFormatter ? labelFormatter(v) : `${v}`;
43813
- if (isPlainObject$4(str)) {
42952
+ if (isPlainObject$3(str)) {
43814
42953
  labelBoundsList = void 0;
43815
42954
  break;
43816
42955
  }
@@ -55715,47 +54854,6 @@
55715
54854
  };
55716
54855
 
55717
54856
  const BOOTSTRAP_STATE = Symbol.for('vrender.bootstrap.state');
55718
- const installBrowserEnvToAppWithParams = installBrowserEnvToApp;
55719
- const installNodeEnvToAppWithParams = installNodeEnvToApp;
55720
- const miniEnvBootstraps = {
55721
- taro: { installEnv: installTaroEnvToApp, loadEnv: loadTaroEnv },
55722
- feishu: { installEnv: installFeishuEnvToApp, loadEnv: loadFeishuEnv },
55723
- tt: { installEnv: installTTEnvToApp, loadEnv: loadTTEnv },
55724
- wx: { installEnv: installWxEnvToApp, loadEnv: loadWxEnv },
55725
- lynx: { installEnv: installLynxEnvToApp, loadEnv: loadLynxEnv },
55726
- harmony: { installEnv: installHarmonyEnvToApp, loadEnv: loadHarmonyEnv }
55727
- };
55728
- const pluginRegistrations = [
55729
- registerFlexLayoutPlugin,
55730
- registerViewTransform3dPlugin,
55731
- registerHtmlAttributePlugin,
55732
- registerReactAttributePlugin,
55733
- registerDirectionalLight,
55734
- registerOrthoCamera
55735
- ];
55736
- const animationRegistrations = [registerCustomAnimate, registerAnimate];
55737
- const legacyGraphicRegistrations = [
55738
- registerArc,
55739
- registerArc3d,
55740
- registerArea,
55741
- registerCircle,
55742
- registerGlyph,
55743
- registerGifImage,
55744
- registerGroup,
55745
- registerImage,
55746
- registerLine,
55747
- registerPath,
55748
- registerPolygon,
55749
- registerPyramid3d,
55750
- registerRect,
55751
- registerRect3d,
55752
- registerRichtext,
55753
- registerShadowRoot,
55754
- registerSymbol,
55755
- registerText,
55756
- registerWrapText,
55757
- registerStar
55758
- ];
55759
54857
  function ensureBootstrap(target, key) {
55760
54858
  var _a;
55761
54859
  const state = (_a = target[BOOTSTRAP_STATE]) !== null && _a !== void 0 ? _a : new Set();
@@ -55766,10 +54864,6 @@
55766
54864
  state.add(key);
55767
54865
  return true;
55768
54866
  }
55769
- function registerDefaultPipeline() {
55770
- pluginRegistrations.forEach(register => register());
55771
- animationRegistrations.forEach(register => register());
55772
- }
55773
54867
  function createBootstrapEntryKey(entry, prefix) {
55774
54868
  var _a, _b, _c, _d;
55775
54869
  const type = (_a = entry === null || entry === void 0 ? void 0 : entry.type) !== null && _a !== void 0 ? _a : 'unknown';
@@ -55813,6 +54907,52 @@
55813
54907
  app.registry.picker.register(key, picker);
55814
54908
  });
55815
54909
  }
54910
+
54911
+ const installBrowserEnvToAppWithParams = installBrowserEnvToApp;
54912
+ const installNodeEnvToAppWithParams = installNodeEnvToApp;
54913
+ const miniEnvBootstraps = {
54914
+ taro: { installEnv: installTaroEnvToApp, loadEnv: loadTaroEnv },
54915
+ feishu: { installEnv: installFeishuEnvToApp, loadEnv: loadFeishuEnv },
54916
+ tt: { installEnv: installTTEnvToApp, loadEnv: loadTTEnv },
54917
+ wx: { installEnv: installWxEnvToApp, loadEnv: loadWxEnv },
54918
+ lynx: { installEnv: installLynxEnvToApp, loadEnv: loadLynxEnv },
54919
+ harmony: { installEnv: installHarmonyEnvToApp, loadEnv: loadHarmonyEnv }
54920
+ };
54921
+ const pluginRegistrations = [
54922
+ registerFlexLayoutPlugin,
54923
+ registerViewTransform3dPlugin,
54924
+ registerHtmlAttributePlugin,
54925
+ registerReactAttributePlugin,
54926
+ registerDirectionalLight,
54927
+ registerOrthoCamera
54928
+ ];
54929
+ const animationRegistrations = [registerCustomAnimate, registerAnimate];
54930
+ const legacyGraphicRegistrations = [
54931
+ registerArc,
54932
+ registerArc3d,
54933
+ registerArea,
54934
+ registerCircle,
54935
+ registerGlyph,
54936
+ registerGifImage,
54937
+ registerGroup,
54938
+ registerImage,
54939
+ registerLine,
54940
+ registerPath,
54941
+ registerPolygon,
54942
+ registerPyramid3d,
54943
+ registerRect,
54944
+ registerRect3d,
54945
+ registerRichtext,
54946
+ registerShadowRoot,
54947
+ registerSymbol,
54948
+ registerText,
54949
+ registerWrapText,
54950
+ registerStar
54951
+ ];
54952
+ function registerDefaultPipeline() {
54953
+ pluginRegistrations.forEach(register => register());
54954
+ animationRegistrations.forEach(register => register());
54955
+ }
55816
54956
  function bootstrapVRenderBrowserApp(app, envParams) {
55817
54957
  const target = app;
55818
54958
  if (!ensureBootstrap(target, 'browser')) {
@@ -55914,7 +55054,6 @@
55914
55054
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
55915
55055
  };
55916
55056
 
55917
- const { createBrowserApp } = VRenderCore;
55918
55057
  function createBrowserVRenderApp(options = {}) {
55919
55058
  const { envParams } = options, entryOptions = __rest(options, ["envParams"]);
55920
55059
  return bootstrapVRenderBrowserApp(createBrowserApp(entryOptions), envParams);
@@ -55950,8 +55089,8 @@
55950
55089
  return bootstrapVRenderNodeApp(createNodeApp(entryOptions), envParams);
55951
55090
  }
55952
55091
 
55953
- const SHARED_APP_REGISTRY_KEY = Symbol.for('visactor.vrender.sharedAppRegistry');
55954
55092
  const DEFAULT_SHARED_APP_KEY = 'default';
55093
+ const SHARED_APP_REGISTRY_KEY = Symbol.for('visactor.vrender.sharedAppRegistry');
55955
55094
  function getSharedAppRegistry() {
55956
55095
  var _a;
55957
55096
  const target = globalThis;
@@ -55991,36 +55130,8 @@
55991
55130
  removeSharedAppRecord(env, key, record);
55992
55131
  record.releaseApp();
55993
55132
  }
55994
- function createAppForSharedEnv(options) {
55995
- const { env } = options;
55996
- const entryOptions = Object.assign({}, options);
55997
- delete entryOptions.env;
55998
- delete entryOptions.key;
55999
- if (env === 'browser') {
56000
- return createBrowserVRenderApp(entryOptions);
56001
- }
56002
- if (env === 'node') {
56003
- return createNodeVRenderApp(entryOptions);
56004
- }
56005
- if (env === 'taro') {
56006
- return createTaroVRenderApp(entryOptions);
56007
- }
56008
- if (env === 'feishu') {
56009
- return createFeishuVRenderApp(entryOptions);
56010
- }
56011
- if (env === 'tt') {
56012
- return createTTVRenderApp(entryOptions);
56013
- }
56014
- if (env === 'wx') {
56015
- return createWxVRenderApp(entryOptions);
56016
- }
56017
- if (env === 'lynx') {
56018
- return createLynxVRenderApp(entryOptions);
56019
- }
56020
- return createHarmonyVRenderApp(entryOptions);
56021
- }
56022
- function createSharedAppRecord(env, key, options) {
56023
- const app = createAppForSharedEnv(options);
55133
+ function createSharedAppRecord(env, key, options, createApp) {
55134
+ const app = createApp(options);
56024
55135
  const originalRelease = app.release.bind(app);
56025
55136
  const record = {
56026
55137
  app,
@@ -56031,45 +55142,45 @@
56031
55142
  app.release = () => releaseSharedAppRecord(env, key, record);
56032
55143
  return record;
56033
55144
  }
56034
- function createSharedAppHandle(env, key, record) {
55145
+ function createSharedAppHandle(registryEnv, handleEnv, key, record) {
56035
55146
  let released = false;
56036
55147
  return {
56037
55148
  app: record.app,
56038
- env,
55149
+ env: handleEnv,
56039
55150
  key,
56040
55151
  release() {
56041
55152
  if (released) {
56042
55153
  return;
56043
55154
  }
56044
55155
  released = true;
56045
- const envRegistry = getSharedAppEnvRegistry(env, false);
55156
+ const envRegistry = getSharedAppEnvRegistry(registryEnv, false);
56046
55157
  if ((envRegistry === null || envRegistry === void 0 ? void 0 : envRegistry.get(key)) !== record || record.released) {
56047
55158
  return;
56048
55159
  }
56049
55160
  record.refCount -= 1;
56050
55161
  if (record.refCount <= 0) {
56051
- releaseSharedAppRecord(env, key, record);
55162
+ releaseSharedAppRecord(registryEnv, key, record);
56052
55163
  }
56053
55164
  }
56054
55165
  };
56055
55166
  }
56056
- function acquireSharedVRenderApp(options) {
55167
+ function acquireSharedApp(registryEnv, options, createApp, handleEnv = registryEnv) {
56057
55168
  var _a;
56058
55169
  const key = (_a = options.key) !== null && _a !== void 0 ? _a : DEFAULT_SHARED_APP_KEY;
56059
- const envRegistry = getOrCreateSharedAppEnvRegistry(options.env);
55170
+ const envRegistry = getOrCreateSharedAppEnvRegistry(registryEnv);
56060
55171
  let record = envRegistry.get(key);
56061
55172
  if (record === null || record === void 0 ? void 0 : record.app.released) {
56062
- releaseSharedAppRecord(options.env, key, record);
55173
+ releaseSharedAppRecord(registryEnv, key, record);
56063
55174
  record = undefined;
56064
55175
  }
56065
55176
  if (!record) {
56066
- record = createSharedAppRecord(options.env, key, options);
55177
+ record = createSharedAppRecord(registryEnv, key, options, createApp);
56067
55178
  envRegistry.set(key, record);
56068
55179
  }
56069
55180
  record.refCount += 1;
56070
- return createSharedAppHandle(options.env, key, record);
55181
+ return createSharedAppHandle(registryEnv, handleEnv, key, record);
56071
55182
  }
56072
- function getSharedVRenderApp(env, key = DEFAULT_SHARED_APP_KEY) {
55183
+ function getSharedApp(env, key = DEFAULT_SHARED_APP_KEY) {
56073
55184
  var _a;
56074
55185
  const record = (_a = getSharedAppEnvRegistry(env, false)) === null || _a === void 0 ? void 0 : _a.get(key);
56075
55186
  if (!record || record.released || record.app.released) {
@@ -56077,7 +55188,7 @@
56077
55188
  }
56078
55189
  return record.app;
56079
55190
  }
56080
- function releaseSharedVRenderApp(env, key = DEFAULT_SHARED_APP_KEY) {
55191
+ function releaseSharedApp(env, key = DEFAULT_SHARED_APP_KEY) {
56081
55192
  var _a;
56082
55193
  const record = (_a = getSharedAppEnvRegistry(env, false)) === null || _a === void 0 ? void 0 : _a.get(key);
56083
55194
  if (record) {
@@ -56085,6 +55196,44 @@
56085
55196
  }
56086
55197
  }
56087
55198
 
55199
+ function createAppForSharedEnv(options) {
55200
+ const { env } = options;
55201
+ const entryOptions = Object.assign({}, options);
55202
+ delete entryOptions.env;
55203
+ delete entryOptions.key;
55204
+ if (env === 'browser') {
55205
+ return createBrowserVRenderApp(entryOptions);
55206
+ }
55207
+ if (env === 'node') {
55208
+ return createNodeVRenderApp(entryOptions);
55209
+ }
55210
+ if (env === 'taro') {
55211
+ return createTaroVRenderApp(entryOptions);
55212
+ }
55213
+ if (env === 'feishu') {
55214
+ return createFeishuVRenderApp(entryOptions);
55215
+ }
55216
+ if (env === 'tt') {
55217
+ return createTTVRenderApp(entryOptions);
55218
+ }
55219
+ if (env === 'wx') {
55220
+ return createWxVRenderApp(entryOptions);
55221
+ }
55222
+ if (env === 'lynx') {
55223
+ return createLynxVRenderApp(entryOptions);
55224
+ }
55225
+ return createHarmonyVRenderApp(entryOptions);
55226
+ }
55227
+ function acquireSharedVRenderApp(options) {
55228
+ return acquireSharedApp(options.env, options, createAppForSharedEnv, options.env);
55229
+ }
55230
+ function getSharedVRenderApp(env, key = DEFAULT_SHARED_APP_KEY) {
55231
+ return getSharedApp(env, key);
55232
+ }
55233
+ function releaseSharedVRenderApp(env, key = DEFAULT_SHARED_APP_KEY) {
55234
+ releaseSharedApp(env, key);
55235
+ }
55236
+
56088
55237
  let browserApp;
56089
55238
  let nodeApp;
56090
55239
  function resolveLegacyApp() {
@@ -56099,7 +55248,7 @@
56099
55248
  return resolveLegacyApp().createStage(params);
56100
55249
  }
56101
55250
 
56102
- const version = "1.1.0-alpha.24";
55251
+ const version = "1.1.0-alpha.25";
56103
55252
 
56104
55253
  exports.AComponentAnimate = AComponentAnimate;
56105
55254
  exports.ACustomAnimate = ACustomAnimate;
@@ -56680,11 +55829,11 @@
56680
55829
  exports.convertDomainToTickData = convertDomainToTickData;
56681
55830
  exports.cornerTangents = cornerTangents;
56682
55831
  exports.cornerToCenter = cornerToCenter;
56683
- exports.createApp = createBrowserApp$1;
55832
+ exports.createApp = createBrowserApp;
56684
55833
  exports.createArc = createArc;
56685
55834
  exports.createArc3d = createArc3d;
56686
55835
  exports.createArea = createArea;
56687
- exports.createBrowserApp = createBrowserApp$1;
55836
+ exports.createBrowserApp = createBrowserApp;
56688
55837
  exports.createBrowserVRenderApp = createBrowserVRenderApp;
56689
55838
  exports.createCanvasEventTransformer = createCanvasEventTransformer;
56690
55839
  exports.createCircle = createCircle;