1- /* Version: 0.30.0 - June 4 , 2026 05:08:51 */
1+ /* Version: 0.30.0 - June 5 , 2026 02:15:08 */
22/**
33 * Canonical token names for the built-in injectables exposed by the core `ng`
44 * module.
@@ -4115,7 +4115,7 @@ const ASTType = {
41154115function isScopeEventStopped(event) {
41164116 return event.stopped;
41174117}
4118- const _SCOPE_PROXY_BIND = Symbol("ngScopeProxyBind ");
4118+ const SCOPE_PROXY_BIND = Symbol("ngProxyBind ");
41194119let uid = 0;
41204120/**
41214121 * Returns the next generated scope/listener id.
@@ -4740,7 +4740,7 @@ function getCachedScopeProxy(target, handler) {
47404740 if (!proxy) {
47414741 proxy = new Proxy(target, handler);
47424742 proxiesByHandler.set(handler, proxy);
4743- const bind = target[_SCOPE_PROXY_BIND ];
4743+ const bind = target[SCOPE_PROXY_BIND ];
47444744 if (isFunction(bind)) {
47454745 bind.call(target, handler, proxy);
47464746 }
@@ -11083,9 +11083,12 @@ function createMachine(scopeOrConfig, maybeConfig) {
1108311083 let transitionStarted = false;
1108411084 try {
1108511085 const activeMachine = getActiveMachine();
11086+ if (!canRunTransition(transition, payload, activeMachine)) {
11087+ return false;
11088+ }
1108611089 const from = machineTarget.current;
1108711090 transitionStarted = true;
11088- const nextMode = transition(activeMachine.data, payload, activeMachine);
11091+ const nextMode = transition._target (activeMachine.data, payload, activeMachine);
1108911092 const to = isNonEmptyString(nextMode) ? nextMode : from;
1109011093 const context = {
1109111094 type,
@@ -11118,11 +11121,13 @@ function createMachine(scopeOrConfig, maybeConfig) {
1111811121 }
1111911122 });
1112011123 },
11121- can(type) {
11124+ can(type, payload ) {
1112211125 if (!isString(type)) {
1112311126 return false;
1112411127 }
11125- return !!getTransition(machineTarget.current, config, type);
11128+ const transition = getTransition(machineTarget.current, config, type);
11129+ return (!!transition &&
11130+ canRunTransition(transition, payload, getActiveMachine()));
1112611131 },
1112711132 matches(mode) {
1112811133 return machineTarget.current === mode;
@@ -11144,7 +11149,7 @@ function createMachine(scopeOrConfig, maybeConfig) {
1114411149 });
1114511150 },
1114611151 };
11147- Object.defineProperty(machineTarget, _SCOPE_PROXY_BIND , {
11152+ Object.defineProperty(machineTarget, SCOPE_PROXY_BIND , {
1114811153 value(handler, proxy) {
1114911154 let binding = bindings.get(handler.$id);
1115011155 if (!binding) {
@@ -11298,9 +11303,30 @@ function getTransition(mode, config, type) {
1129811303 return undefined;
1129911304 }
1130011305 const transition = transitions[type];
11301- return isFunction(transition)
11302- ? transition
11303- : undefined;
11306+ return resolveMachineTransition(transition);
11307+ }
11308+ function resolveMachineTransition(transition) {
11309+ if (isFunction(transition)) {
11310+ return {
11311+ _target: transition,
11312+ };
11313+ }
11314+ if (!isPlainObject(transition) || !hasOwn(transition, "target")) {
11315+ return undefined;
11316+ }
11317+ const descriptor = transition;
11318+ if (!isFunction(descriptor.target)) {
11319+ return undefined;
11320+ }
11321+ return {
11322+ _guard: isFunction(descriptor.guard) ? descriptor.guard : undefined,
11323+ _target: descriptor.target,
11324+ };
11325+ }
11326+ function canRunTransition(transition, payload, machine) {
11327+ return transition._guard
11328+ ? transition._guard(machine.data, payload, machine)
11329+ : true;
1130411330}
1130511331function getModeHook(hooks, mode) {
1130611332 if (!hooks || !hasOwn(hooks, mode)) {
@@ -11594,7 +11620,7 @@ function createWorkflowFactory($machine) {
1159411620 scheduleWorkflowBindings();
1159511621 },
1159611622 };
11597- Object.defineProperty(workflowTarget, _SCOPE_PROXY_BIND , {
11623+ Object.defineProperty(workflowTarget, SCOPE_PROXY_BIND , {
1159811624 value(handler, proxy) {
1159911625 let binding = bindings.get(handler.$id);
1160011626 if (!binding) {
0 commit comments