ember-source 4.3.0-alpha.4 → 4.3.0-beta.1

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 (31) hide show
  1. package/CHANGELOG.md +6 -2
  2. package/build-metadata.json +3 -3
  3. package/dist/dependencies/router_js.js +66 -31
  4. package/dist/ember-template-compiler.js +16 -13
  5. package/dist/ember-template-compiler.map +1 -1
  6. package/dist/ember-testing.js +1 -1
  7. package/dist/ember-testing.map +1 -1
  8. package/dist/ember.debug.js +669 -1204
  9. package/dist/ember.debug.map +1 -1
  10. package/dist/header/license.js +1 -1
  11. package/dist/packages/@ember/-internals/container/index.js +14 -10
  12. package/dist/packages/@ember/-internals/glimmer/index.js +60 -45
  13. package/dist/packages/@ember/-internals/meta/lib/meta.js +8 -9
  14. package/dist/packages/@ember/-internals/metal/index.js +44 -45
  15. package/dist/packages/@ember/-internals/routing/lib/ext/controller.js +10 -8
  16. package/dist/packages/@ember/-internals/routing/lib/services/router.js +153 -191
  17. package/dist/packages/@ember/-internals/routing/lib/system/route-info.js +2 -2
  18. package/dist/packages/@ember/-internals/routing/lib/system/route.js +95 -374
  19. package/dist/packages/@ember/-internals/routing/lib/system/router.js +60 -33
  20. package/dist/packages/@ember/-internals/routing/lib/utils.js +31 -20
  21. package/dist/packages/@ember/-internals/runtime/lib/mixins/action_handler.js +32 -32
  22. package/dist/packages/@ember/-internals/utils/index.js +2 -0
  23. package/dist/packages/@ember/-internals/views/lib/system/utils.js +1 -0
  24. package/dist/packages/@ember/canary-features/index.js +2 -2
  25. package/dist/packages/@ember/controller/index.js +3 -54
  26. package/dist/packages/@ember/instrumentation/index.js +9 -13
  27. package/dist/packages/@ember/routing/router-service.js +1 -0
  28. package/dist/packages/@ember/service/index.js +6 -73
  29. package/dist/packages/ember/version.js +1 -1
  30. package/docs/data.json +412 -344
  31. package/package.json +4 -4
@@ -6,7 +6,7 @@
6
6
  * Portions Copyright 2008-2011 Apple Inc. All rights reserved.
7
7
  * @license Licensed under MIT license
8
8
  * See https://raw.github.com/emberjs/ember.js/master/LICENSE
9
- * @version 4.3.0-alpha.4
9
+ * @version 4.3.0-beta.1
10
10
  */
11
11
  /* eslint-disable no-var */
12
12
 
@@ -272,7 +272,7 @@ define("@ember/-internals/container/index", ["exports", "@ember/-internals/owner
272
272
 
273
273
  lookup(fullName, options) {
274
274
  if (this.isDestroyed) {
275
- throw new Error(`Can not call \`.lookup\` after the owner has been destroyed`);
275
+ throw new Error(`Cannot call \`.lookup\` after the owner has been destroyed`);
276
276
  }
277
277
 
278
278
  (true && !(this.registry.isValidFullName(fullName)) && (0, _debug.assert)('fullName must be a proper full name', this.registry.isValidFullName(fullName)));
@@ -343,7 +343,7 @@ define("@ember/-internals/container/index", ["exports", "@ember/-internals/owner
343
343
 
344
344
  factoryFor(fullName) {
345
345
  if (this.isDestroyed) {
346
- throw new Error(`Can not call \`.factoryFor\` after the owner has been destroyed`);
346
+ throw new Error(`Cannot call \`.factoryFor\` after the owner has been destroyed`);
347
347
  }
348
348
 
349
349
  var normalizedName = this.registry.normalize(fullName);
@@ -516,9 +516,9 @@ define("@ember/-internals/container/index", ["exports", "@ember/-internals/owner
516
516
  var cache = container.cache;
517
517
  var keys = Object.keys(cache);
518
518
 
519
- for (var i = 0; i < keys.length; i++) {
520
- var key = keys[i];
519
+ for (var key of keys) {
521
520
  var value = cache[key];
521
+ (true && !(value) && (0, _debug.assert)('has cached value', value));
522
522
 
523
523
  if (value.destroy) {
524
524
  value.destroy();
@@ -585,7 +585,7 @@ define("@ember/-internals/container/index", ["exports", "@ember/-internals/owner
585
585
  } = this;
586
586
 
587
587
  if (container.isDestroyed) {
588
- throw new Error(`Can not create new instances after the owner has been destroyed (you attempted to create ${this.fullName})`);
588
+ throw new Error(`Cannot create new instances after the owner has been destroyed (you attempted to create ${this.fullName})`);
589
589
  }
590
590
 
591
591
  var props = {};
@@ -959,6 +959,8 @@ define("@ember/-internals/container/index", ["exports", "@ember/-internals/owner
959
959
  }
960
960
 
961
961
  var type = fullName.split(':')[0];
962
+ (true && !(type) && (0, _debug.assert)('has type', type)); // split always will have at least one value
963
+
962
964
  options = this._typeOptions[type];
963
965
 
964
966
  if (options && options[optionName] !== undefined) {
@@ -1005,8 +1007,7 @@ define("@ember/-internals/container/index", ["exports", "@ember/-internals/owner
1005
1007
  var localKnown = (0, _utils.dictionary)(null);
1006
1008
  var registeredNames = Object.keys(this.registrations);
1007
1009
 
1008
- for (var index = 0; index < registeredNames.length; index++) {
1009
- var fullName = registeredNames[index];
1010
+ for (var fullName of registeredNames) {
1010
1011
  var itemType = fullName.split(':')[0];
1011
1012
 
1012
1013
  if (itemType === type) {
@@ -1045,9 +1046,11 @@ define("@ember/-internals/container/index", ["exports", "@ember/-internals/owner
1045
1046
 
1046
1047
  for (var key in hash) {
1047
1048
  if (Object.prototype.hasOwnProperty.call(hash, key)) {
1049
+ var value = hash[key];
1050
+ (true && !(value) && (0, _debug.assert)('has value', value));
1048
1051
  var {
1049
1052
  specifier
1050
- } = hash[key];
1053
+ } = value;
1051
1054
  (true && !(this.isValidFullName(specifier)) && (0, _debug.assert)(`Expected a proper full name, given '${specifier}'`, this.isValidFullName(specifier)));
1052
1055
  injections.push({
1053
1056
  property: key,
@@ -1064,10 +1067,10 @@ define("@ember/-internals/container/index", ["exports", "@ember/-internals/owner
1064
1067
  return;
1065
1068
  }
1066
1069
 
1067
- for (var i = 0; i < injections.length; i++) {
1070
+ for (var injection of injections) {
1068
1071
  var {
1069
1072
  specifier
1070
- } = injections[i];
1073
+ } = injection;
1071
1074
  (true && !(this.has(specifier)) && (0, _debug.assert)(`Attempting to inject an unknown injection: '${specifier}'`, this.has(specifier)));
1072
1075
  }
1073
1076
  };
@@ -1113,6 +1116,7 @@ define("@ember/-internals/container/index", ["exports", "@ember/-internals/owner
1113
1116
 
1114
1117
  function privatize(_ref5) {
1115
1118
  var [fullName] = _ref5;
1119
+ (true && !(arguments.length === 1 && fullName) && (0, _debug.assert)('has a single string argument', arguments.length === 1 && fullName));
1116
1120
  var name = privateNames[fullName];
1117
1121
 
1118
1122
  if (name) {
@@ -3692,19 +3696,25 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
3692
3696
  }
3693
3697
 
3694
3698
  function createClassNameBindingRef(rootRef, microsyntax, operations) {
3695
- var [prop, truthy, falsy] = microsyntax.split(':');
3699
+ var parts = microsyntax.split(':');
3700
+ var [prop, truthy, falsy] = parts; // NOTE: This could be an empty string
3701
+
3702
+ (true && !(prop !== undefined) && (0, _debug.assert)('has prop', prop !== undefined)); // Will always have at least one part
3703
+
3696
3704
  var isStatic = prop === '';
3697
3705
 
3698
3706
  if (isStatic) {
3699
3707
  operations.setAttribute('class', (0, _reference.createPrimitiveRef)(truthy), true, null);
3700
3708
  } else {
3701
3709
  var isPath = prop.indexOf('.') > -1;
3702
- var parts = isPath ? prop.split('.') : [];
3703
- var value = isPath ? referenceForParts(rootRef, parts) : (0, _reference.childRefFor)(rootRef, prop);
3710
+
3711
+ var _parts = isPath ? prop.split('.') : [];
3712
+
3713
+ var value = isPath ? referenceForParts(rootRef, _parts) : (0, _reference.childRefFor)(rootRef, prop);
3704
3714
  var ref;
3705
3715
 
3706
3716
  if (truthy === undefined) {
3707
- ref = createSimpleClassNameBindingRef(value, isPath ? parts[parts.length - 1] : prop);
3717
+ ref = createSimpleClassNameBindingRef(value, isPath ? _parts[_parts.length - 1] : prop);
3708
3718
  } else {
3709
3719
  ref = createColonClassNameBindingRef(value, truthy, falsy);
3710
3720
  }
@@ -4079,9 +4089,10 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
4079
4089
  // Anything else is an action argument.
4080
4090
 
4081
4091
  var [context, action$$1, ...restArgs] = positional;
4092
+ (true && !(context && action$$1) && (0, _debug.assert)('hash position arguments', context && action$$1));
4082
4093
  var debugKey = action$$1.debugLabel;
4083
- var target = 'target' in named ? named.target : context;
4084
- var processArgs = makeArgsProcessor('value' in named && named.value, restArgs);
4094
+ var target = 'target' in named && named.target ? named.target : context;
4095
+ var processArgs = makeArgsProcessor('value' in named && named.value || false, restArgs);
4085
4096
  var fn$$1;
4086
4097
 
4087
4098
  if ((0, _reference.isInvokableRef)(action$$1)) {
@@ -4196,6 +4207,7 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
4196
4207
 
4197
4208
  for (var name in namedArgs) {
4198
4209
  var ref = namedArgs[name];
4210
+ (true && !(ref) && (0, _debug.assert)('expected ref', ref));
4199
4211
  var value = (0, _reference.valueForRef)(ref);
4200
4212
  var isAction = typeof value === 'function' && ACTIONS.has(value);
4201
4213
 
@@ -4263,6 +4275,7 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
4263
4275
 
4264
4276
  while (i !== -1) {
4265
4277
  var binding = attributeBindings[i];
4278
+ (true && !(binding) && (0, _debug.assert)('has binding', binding));
4266
4279
  var parsed = parseAttributeBinding(binding);
4267
4280
  var attribute = parsed[1];
4268
4281
 
@@ -4343,8 +4356,9 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
4343
4356
  {
4344
4357
  __ARGS__
4345
4358
  } = _b,
4346
- rest = __rest(_b, ["__ARGS__"]); // does this need to be untracked?
4359
+ rest = __rest(_b, ["__ARGS__"]);
4347
4360
 
4361
+ (true && !(__ARGS__) && (0, _debug.assert)('[BUG] unexpectedly missing __ARGS__ after check', __ARGS__)); // does this need to be untracked?
4348
4362
 
4349
4363
  var __args__ = (0, _reference.valueForRef)(__ARGS__);
4350
4364
 
@@ -4378,14 +4392,8 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
4378
4392
  Object.assign(named, args.named.capture());
4379
4393
 
4380
4394
  for (var i = 0; i < count; i++) {
4381
- // As of TS 3.7, tsc is giving us the following error on this line without the type annotation
4382
- //
4383
- // TS7022: 'name' implicitly has type 'any' because it does not have a type annotation and is
4384
- // referenced directly or indirectly in its own initializer.
4385
- //
4386
- // This is almost certainly a TypeScript bug, feel free to try and remove the annotation after
4387
- // upgrading if it is not needed anymore.
4388
4395
  var name = positionalParams[i];
4396
+ (true && !(name) && (0, _debug.assert)('Expected at least one positional param', name));
4389
4397
  (true && !(!args.named.has(name)) && (0, _debug.assert)(`You cannot specify both a positional param (at position ${i}) and the hash argument \`${name}\`.`, !args.named.has(name)));
4390
4398
  named[name] = args.positional.at(i);
4391
4399
  }
@@ -4667,9 +4675,7 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
4667
4675
  classNameBindings
4668
4676
  } = component;
4669
4677
 
4670
- for (var i = 0; i < classNameBindings.length; i++) {
4671
- var binding = classNameBindings[i];
4672
-
4678
+ for (var binding of classNameBindings) {
4673
4679
  if (binding.split(' ').length > 1) {
4674
4680
  return false;
4675
4681
  }
@@ -4681,9 +4687,7 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
4681
4687
  classNameBindings
4682
4688
  } = component;
4683
4689
 
4684
- for (var i = 0; i < classNameBindings.length; i++) {
4685
- var binding = classNameBindings[i];
4686
-
4690
+ for (var binding of classNameBindings) {
4687
4691
  if (binding.split(' ').length > 1) {
4688
4692
  return false;
4689
4693
  }
@@ -6416,6 +6420,7 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
6416
6420
  positional
6417
6421
  } = _ref11;
6418
6422
  var inner = positional[0];
6423
+ (true && !(inner) && (0, _debug.assert)('expected at least one positional arg', inner));
6419
6424
  return (0, _reference.createComputeRef)(() => {
6420
6425
  var iterable = (0, _reference.valueForRef)(inner);
6421
6426
  (0, _validator.consumeTag)((0, _metal.tagForObject)(iterable));
@@ -6554,18 +6559,14 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
6554
6559
 
6555
6560
  static fromIndexable(obj) {
6556
6561
  var keys = Object.keys(obj);
6557
- var {
6558
- length
6559
- } = keys;
6560
6562
 
6561
- if (length === 0) {
6563
+ if (keys.length === 0) {
6562
6564
  return null;
6563
6565
  } else {
6564
6566
  var values = [];
6565
6567
 
6566
- for (var i = 0; i < length; i++) {
6568
+ for (var key of keys) {
6567
6569
  var value = void 0;
6568
- var key = keys[i];
6569
6570
  value = obj[key]; // Add the tag of the returned value if it is an array, since arrays
6570
6571
  // should always cause updates if they are consumed and then changed
6571
6572
 
@@ -6832,14 +6833,14 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
6832
6833
  positional,
6833
6834
  named
6834
6835
  } = _ref12;
6835
- (true && !(positional.length === 1) && (0, _debug.assert)(`[BUG] wrong number of positional arguments, expecting 1, got ${positional.length}`, positional.length === 1));
6836
6836
  var nameOrValueRef = positional[0];
6837
- (true && !('type' in named) && (0, _debug.assert)(`[BUG] expecting \`type\` named argument`, 'type' in named));
6838
- (true && !('loc' in named) && (0, _debug.assert)(`[BUG] expecting \`loc\` named argument`, 'loc' in named));
6839
- (true && !('original' in named) && (0, _debug.assert)(`[BUG] expecting \`original\` named argument`, 'original' in named));
6837
+ (true && !(positional.length === 1 && nameOrValueRef) && (0, _debug.assert)(`[BUG] wrong number of positional arguments, expecting 1, got ${positional.length}`, positional.length === 1 && nameOrValueRef));
6840
6838
  var typeRef = named.type;
6841
6839
  var locRef = named.loc;
6842
- var originalRef = named.original; // Bug: why do these fail?
6840
+ var originalRef = named.original;
6841
+ (true && !(typeRef) && (0, _debug.assert)(`[BUG] expecting \`type\` named argument`, typeRef));
6842
+ (true && !(locRef) && (0, _debug.assert)(`[BUG] expecting \`loc\` named argument`, locRef));
6843
+ (true && !(originalRef) && (0, _debug.assert)(`[BUG] expecting \`original\` named argument`, originalRef)); // Bug: why do these fail?
6843
6844
  // assert('[BUG] expecting a string literal for the `type` argument', isConstRef(typeRef));
6844
6845
  // assert('[BUG] expecting a string literal for the `loc` argument', isConstRef(locRef));
6845
6846
  // assert('[BUG] expecting a string literal for the `original` argument', isConstRef(originalRef));
@@ -6863,6 +6864,7 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
6863
6864
  ) {
6864
6865
  helper$1 = args => {
6865
6866
  var inner = args.positional[0];
6867
+ (true && !(inner) && (0, _debug.assert)('expected at least one positional arg', inner));
6866
6868
  return (0, _reference.createComputeRef)(() => {
6867
6869
  var value = (0, _reference.valueForRef)(inner);
6868
6870
  (true && !(value !== null && value !== undefined) && (0, _debug.assert)('You cannot pass a null or undefined destination element to in-element', value !== null && value !== undefined));
@@ -6870,7 +6872,11 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
6870
6872
  });
6871
6873
  };
6872
6874
  } else {
6873
- helper$1 = args => args.positional[0];
6875
+ helper$1 = args => {
6876
+ var arg = args.positional[0];
6877
+ (true && !(arg) && (0, _debug.assert)('expected at least one positional arg', arg));
6878
+ return arg;
6879
+ };
6874
6880
  }
6875
6881
 
6876
6882
  var inElementNullCheckHelper = internalHelper(helper$1);
@@ -6879,9 +6885,14 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
6879
6885
  positional
6880
6886
  } = _ref13;
6881
6887
  return (0, _reference.createComputeRef)(() => {
6882
- var classNameParts = (0, _reference.valueForRef)(positional[0]).split('.');
6888
+ var classNameArg = positional[0];
6889
+ var valueArg = positional[1];
6890
+ (true && !(classNameArg && valueArg) && (0, _debug.assert)('expected at least two positional args', classNameArg && valueArg));
6891
+ var classNameParts = (0, _reference.valueForRef)(classNameArg).split('.');
6883
6892
  var className = classNameParts[classNameParts.length - 1];
6884
- var value = (0, _reference.valueForRef)(positional[1]);
6893
+ (true && !(className) && (0, _debug.assert)('has className', className)); // Always at least one split result
6894
+
6895
+ var value = (0, _reference.valueForRef)(valueArg);
6885
6896
 
6886
6897
  if (value === true) {
6887
6898
  return (0, _string.dasherize)(className);
@@ -6903,7 +6914,7 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
6903
6914
  (true && !(owner) && (0, _debug.assert)('[BUG] missing owner', owner));
6904
6915
  (true && !(positional.length === 1) && (0, _debug.assert)(`[BUG] wrong number of positional arguments, expecting 1, got ${positional.length}`, positional.length === 1));
6905
6916
  var fullNameRef = positional[0];
6906
- (true && !((0, _reference.isConstRef)(fullNameRef)) && (0, _debug.assert)('[BUG] expecting a string literal as argument', (0, _reference.isConstRef)(fullNameRef)));
6917
+ (true && !(fullNameRef && (0, _reference.isConstRef)(fullNameRef)) && (0, _debug.assert)('[BUG] expecting a string literal as argument', fullNameRef && (0, _reference.isConstRef)(fullNameRef)));
6907
6918
  var fullName = (0, _reference.valueForRef)(fullNameRef);
6908
6919
  (true && !(typeof fullName === 'string') && (0, _debug.assert)('[BUG] expecting a string literal as argument', typeof fullName === 'string'));
6909
6920
  (true && !(fullName.split(':').length === 2) && (0, _debug.assert)('[BUG] expecting a valid full name', fullName.split(':').length === 2));
@@ -6932,6 +6943,7 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
6932
6943
  positional
6933
6944
  } = _ref15;
6934
6945
  var inner = positional[0];
6946
+ (true && !(inner) && (0, _debug.assert)('expected at least one positional arg', inner));
6935
6947
  return (0, _reference.createComputeRef)(() => {
6936
6948
  var iterable = (0, _reference.valueForRef)(inner);
6937
6949
 
@@ -7024,7 +7036,8 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
7024
7036
  var {
7025
7037
  positional
7026
7038
  } = _ref16;
7027
- var ref = positional[0]; // TODO: Improve this error message. This covers at least two distinct
7039
+ var ref = positional[0];
7040
+ (true && !(ref) && (0, _debug.assert)('expected at least one positional arg', ref)); // TODO: Improve this error message. This covers at least two distinct
7028
7041
  // cases:
7029
7042
  //
7030
7043
  // 1. (mut "not a path") – passing a literal, result from a helper
@@ -7160,7 +7173,9 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
7160
7173
  var {
7161
7174
  positional
7162
7175
  } = _ref17;
7163
- return (0, _reference.createReadOnlyRef)(positional[0]);
7176
+ var firstArg = positional[0];
7177
+ (true && !(firstArg) && (0, _debug.assert)('has first arg', firstArg));
7178
+ return (0, _reference.createReadOnlyRef)(firstArg);
7164
7179
  });
7165
7180
  /**
7166
7181
  @module ember
@@ -7200,7 +7215,7 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
7200
7215
  named
7201
7216
  } = _ref18;
7202
7217
  (true && !(positional.length === 1 && Object.keys(named).length === 0) && (0, _debug.assert)('unbound helper cannot be called with multiple params or hash params', positional.length === 1 && Object.keys(named).length === 0));
7203
- return (0, _reference.createUnboundRef)((0, _reference.valueForRef)(positional[0]), '(resurt of an `unbound` helper)');
7218
+ return (0, _reference.createUnboundRef)((0, _reference.valueForRef)(positional[0]), '(result of an `unbound` helper)');
7204
7219
  });
7205
7220
  var MODIFIERS = ['alt', 'shift', 'meta', 'ctrl'];
7206
7221
  var POINTER_EVENT_TYPE_REGEX = /^click|mouse|touch/;
@@ -7422,6 +7437,7 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
7422
7437
  positional
7423
7438
  } = actionState;
7424
7439
  var actionNameRef = positional[1];
7440
+ (true && !(actionNameRef) && (0, _debug.assert)('Expected at least one positional arg', actionNameRef));
7425
7441
 
7426
7442
  if (!(0, _reference.isInvokableRef)(actionNameRef)) {
7427
7443
  actionState.actionName = (0, _reference.valueForRef)(actionNameRef);
@@ -7719,7 +7735,9 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
7719
7735
  if (args.positional.length === 0) {
7720
7736
  nameRef = (0, _reference.createPrimitiveRef)('main');
7721
7737
  } else {
7722
- nameRef = args.positional[0];
7738
+ var maybeNameRef = args.positional[0];
7739
+ (true && !(maybeNameRef) && (0, _debug.assert)('Expected at least one positional arg', maybeNameRef));
7740
+ nameRef = maybeNameRef;
7723
7741
  }
7724
7742
 
7725
7743
  var outletRef = (0, _reference.createComputeRef)(() => {
@@ -8172,8 +8190,8 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
8172
8190
  }
8173
8191
 
8174
8192
  function loopBegin() {
8175
- for (var i = 0; i < renderers.length; i++) {
8176
- renderers[i]._scheduleRevalidate();
8193
+ for (var renderer of renderers) {
8194
+ renderer._scheduleRevalidate();
8177
8195
  }
8178
8196
  }
8179
8197
 
@@ -8218,12 +8236,12 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
8218
8236
  var loops = 0;
8219
8237
 
8220
8238
  function loopEnd() {
8221
- for (var i = 0; i < renderers.length; i++) {
8222
- if (!renderers[i]._isValid()) {
8239
+ for (var renderer of renderers) {
8240
+ if (!renderer._isValid()) {
8223
8241
  if (loops > _environment2.ENV._RERENDER_LOOP_LIMIT) {
8224
8242
  loops = 0; // TODO: do something better
8225
8243
 
8226
- renderers[i].destroy();
8244
+ renderer.destroy();
8227
8245
  throw new Error('infinite rendering invalidation detected');
8228
8246
  }
8229
8247
 
@@ -8350,6 +8368,7 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
8350
8368
 
8351
8369
  while (i--) {
8352
8370
  var root = roots[i];
8371
+ (true && !(root) && (0, _debug.assert)('has root', root));
8353
8372
 
8354
8373
  if (root.isFor(view)) {
8355
8374
  root.destroy();
@@ -8421,6 +8440,7 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
8421
8440
  // each root is processed
8422
8441
  for (var i = 0; i < roots.length; i++) {
8423
8442
  var root = roots[i];
8443
+ (true && !(root) && (0, _debug.assert)('has root', root));
8424
8444
 
8425
8445
  if (root.destroyed) {
8426
8446
  // add to the list of roots to be removed
@@ -8483,8 +8503,7 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
8483
8503
  _clearAllRoots() {
8484
8504
  var roots = this._roots;
8485
8505
 
8486
- for (var i = 0; i < roots.length; i++) {
8487
- var root = roots[i];
8506
+ for (var root of roots) {
8488
8507
  root.destroy();
8489
8508
  }
8490
8509
 
@@ -9205,7 +9224,8 @@ define("@ember/-internals/meta/lib/meta", ["exports", "@ember/-internals/utils",
9205
9224
  sync
9206
9225
  });
9207
9226
  } else {
9208
- var listener = listeners[i]; // If the listener is our own listener and we are trying to remove it, we
9227
+ var listener = listeners[i];
9228
+ (true && !(listener) && (0, _debug.assert)('has listener', listener)); // If the listener is our own listener and we are trying to remove it, we
9209
9229
  // want to splice it out entirely so we don't hold onto a reference.
9210
9230
 
9211
9231
  if (kind === 2
@@ -9304,8 +9324,7 @@ define("@ember/-internals/meta/lib/meta", ["exports", "@ember/-internals/utils",
9304
9324
  this._inheritedEnd = 0;
9305
9325
  }
9306
9326
 
9307
- for (var i = 0; i < parentListeners.length; i++) {
9308
- var listener = parentListeners[i];
9327
+ for (var listener of parentListeners) {
9309
9328
  var index = indexOfListener(listeners, listener.event, listener.target, listener.method);
9310
9329
 
9311
9330
  if (index === -1) {
@@ -9342,10 +9361,9 @@ define("@ember/-internals/meta/lib/meta", ["exports", "@ember/-internals/utils",
9342
9361
  }
9343
9362
 
9344
9363
  if (listeners !== undefined) {
9345
- for (var index = 0; index < listeners.length; index++) {
9346
- var listener = listeners[index]; // REMOVE listeners are placeholders that tell us not to
9364
+ for (var listener of listeners) {
9365
+ // REMOVE listeners are placeholders that tell us not to
9347
9366
  // inherit, so they never match. Only ADD and ONCE can match.
9348
-
9349
9367
  if (listener.event === eventName && (listener.kind === 0
9350
9368
  /* ADD */
9351
9369
  || listener.kind === 1
@@ -9380,10 +9398,9 @@ define("@ember/-internals/meta/lib/meta", ["exports", "@ember/-internals/utils",
9380
9398
  }
9381
9399
 
9382
9400
  if (listeners !== undefined) {
9383
- for (var index = 0; index < listeners.length; index++) {
9384
- var listener = listeners[index]; // REMOVE listeners are placeholders that tell us not to
9401
+ for (var listener of listeners) {
9402
+ // REMOVE listeners are placeholders that tell us not to
9385
9403
  // inherit, so they never match. Only ADD and ONCE can match.
9386
-
9387
9404
  if ((listener.kind === 0
9388
9405
  /* ADD */
9389
9406
  || listener.kind === 1
@@ -9520,6 +9537,7 @@ define("@ember/-internals/meta/lib/meta", ["exports", "@ember/-internals/utils",
9520
9537
  function indexOfListener(listeners, event, target, method) {
9521
9538
  for (var i = listeners.length - 1; i >= 0; i--) {
9522
9539
  var listener = listeners[i];
9540
+ (true && !(listener) && (0, _debug.assert)('has listener', listener));
9523
9541
 
9524
9542
  if (listener.event === event && listener.target === target && listener.method === method) {
9525
9543
  return i;
@@ -10366,8 +10384,7 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
10366
10384
  }
10367
10385
 
10368
10386
  if ((0, _utils.isObject)(value)) {
10369
- for (var i = 0; i < lazyTags.length; i++) {
10370
- var [tag, deps] = lazyTags[i];
10387
+ for (var [tag, deps] of lazyTags) {
10371
10388
  (0, _validator.updateTag)(tag, getChainTagsForKey(value, deps, (0, _validator.tagMetaFor)(value), (0, _meta2.peekMeta)(value)));
10372
10389
  }
10373
10390
  }
@@ -10378,8 +10395,8 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
10378
10395
  function getChainTagsForKeys(obj, keys, tagMeta, meta$$1) {
10379
10396
  var tags = [];
10380
10397
 
10381
- for (var i = 0; i < keys.length; i++) {
10382
- getChainTags(tags, obj, keys[i], tagMeta, meta$$1);
10398
+ for (var key of keys) {
10399
+ getChainTags(tags, obj, key, tagMeta, meta$$1);
10383
10400
  }
10384
10401
 
10385
10402
  return (0, _validator.combine)(tags);
@@ -11012,8 +11029,12 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
11012
11029
  args.push(property);
11013
11030
  }
11014
11031
 
11015
- for (var i = 0; i < arguments.length; i++) {
11016
- expandProperties(i < 0 || arguments.length <= i ? undefined : arguments[i], addArg);
11032
+ for (var _len2 = arguments.length, passedArgs = new Array(_len2), _key3 = 0; _key3 < _len2; _key3++) {
11033
+ passedArgs[_key3] = arguments[_key3];
11034
+ }
11035
+
11036
+ for (var arg of passedArgs) {
11037
+ expandProperties(arg, addArg);
11017
11038
  }
11018
11039
 
11019
11040
  this._dependentKeys = args;
@@ -11305,25 +11326,28 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
11305
11326
  }
11306
11327
 
11307
11328
  function computed() {
11308
- for (var _len2 = arguments.length, args = new Array(_len2), _key3 = 0; _key3 < _len2; _key3++) {
11309
- args[_key3] = arguments[_key3];
11329
+ for (var _len3 = arguments.length, args = new Array(_len3), _key4 = 0; _key4 < _len3; _key4++) {
11330
+ args[_key4] = arguments[_key4];
11310
11331
  }
11311
11332
 
11312
11333
  (true && !(!(isElementDescriptor(args.slice(0, 3)) && args.length === 5 && args[4] === true)) && (0, _debug.assert)(`@computed can only be used directly as a native decorator. If you're using tracked in classic classes, add parenthesis to call it like a function: computed()`, !(isElementDescriptor(args.slice(0, 3)) && args.length === 5 && args[4] === true)));
11313
11334
 
11314
11335
  if (isElementDescriptor(args)) {
11336
+ // SAFETY: We passed in the impl for this class
11315
11337
  var decorator = makeComputedDecorator(new ComputedProperty([]), ComputedDecoratorImpl);
11316
11338
  return decorator(args[0], args[1], args[2]);
11317
- }
11339
+ } // SAFETY: We passed in the impl for this class
11340
+
11318
11341
 
11319
11342
  return makeComputedDecorator(new ComputedProperty(args), ComputedDecoratorImpl);
11320
11343
  }
11321
11344
 
11322
11345
  function autoComputed() {
11323
- for (var _len3 = arguments.length, config = new Array(_len3), _key4 = 0; _key4 < _len3; _key4++) {
11324
- config[_key4] = arguments[_key4];
11346
+ for (var _len4 = arguments.length, config = new Array(_len4), _key5 = 0; _key5 < _len4; _key5++) {
11347
+ config[_key5] = arguments[_key5];
11325
11348
  }
11326
11349
 
11350
+ // SAFETY: We passed in the impl for this class
11327
11351
  return makeComputedDecorator(new AutoComputedProperty(config), ComputedDecoratorImpl);
11328
11352
  }
11329
11353
  /**
@@ -11551,12 +11575,12 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
11551
11575
  var obj = root;
11552
11576
  var parts = typeof path === 'string' ? path.split('.') : path;
11553
11577
 
11554
- for (var i = 0; i < parts.length; i++) {
11578
+ for (var part of parts) {
11555
11579
  if (obj === undefined || obj === null || obj.isDestroyed) {
11556
11580
  return undefined;
11557
11581
  }
11558
11582
 
11559
- obj = _getProp(obj, parts[i]);
11583
+ obj = _getProp(obj, part);
11560
11584
  }
11561
11585
 
11562
11586
  return obj;
@@ -11713,7 +11737,8 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
11713
11737
  }
11714
11738
 
11715
11739
  function alias(altKey) {
11716
- (true && !(!isElementDescriptor(Array.prototype.slice.call(arguments))) && (0, _debug.assert)('You attempted to use @alias as a decorator directly, but it requires a `altKey` parameter', !isElementDescriptor(Array.prototype.slice.call(arguments))));
11740
+ (true && !(!isElementDescriptor(Array.prototype.slice.call(arguments))) && (0, _debug.assert)('You attempted to use @alias as a decorator directly, but it requires a `altKey` parameter', !isElementDescriptor(Array.prototype.slice.call(arguments)))); // SAFETY: We passed in the impl for this class
11741
+
11717
11742
  return makeComputedDecorator(new AliasedProperty(altKey), AliasDecoratorImpl);
11718
11743
  } // TODO: This class can be svelted once `meta` has been deprecated
11719
11744
 
@@ -12057,11 +12082,10 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
12057
12082
 
12058
12083
  _getLibraryByName(name) {
12059
12084
  var libs = this._registry;
12060
- var count = libs.length;
12061
12085
 
12062
- for (var i = 0; i < count; i++) {
12063
- if (libs[i].name === name) {
12064
- return libs[i];
12086
+ for (var lib of libs) {
12087
+ if (lib.name === name) {
12088
+ return lib;
12065
12089
  }
12066
12090
  }
12067
12091
 
@@ -12117,8 +12141,7 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
12117
12141
  var maxNameLength = Math.max.apply(null, nameLengths);
12118
12142
  (0, _debug.debug)('-------------------------------');
12119
12143
 
12120
- for (var i = 0; i < libs.length; i++) {
12121
- var lib = libs[i];
12144
+ for (var lib of libs) {
12122
12145
  var spaces = new Array(maxNameLength - lib.name.length + 1).join(' ');
12123
12146
  (0, _debug.debug)([lib.name, spaces, ' : ', lib.version].join(''));
12124
12147
  }
@@ -12184,10 +12207,8 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
12184
12207
 
12185
12208
  changeProperties(() => {
12186
12209
  var props = Object.keys(properties);
12187
- var propertyName;
12188
12210
 
12189
- for (var i = 0; i < props.length; i++) {
12190
- propertyName = props[i];
12211
+ for (var propertyName of props) {
12191
12212
  set(obj, propertyName, properties[propertyName]);
12192
12213
  }
12193
12214
  });
@@ -12239,9 +12260,8 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
12239
12260
  var lookup = _environment.context.lookup;
12240
12261
  var keys = Object.keys(lookup);
12241
12262
 
12242
- for (var i = 0; i < keys.length; i++) {
12243
- var key = keys[i]; // Only process entities that start with uppercase A-Z
12244
-
12263
+ for (var key of keys) {
12264
+ // Only process entities that start with uppercase A-Z
12245
12265
  if (!isUppercase(key.charCodeAt(0))) {
12246
12266
  continue;
12247
12267
  }
@@ -12277,8 +12297,8 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
12277
12297
  if (unprocessedNamespaces || unprocessedMixins) {
12278
12298
  var namespaces = NAMESPACES;
12279
12299
 
12280
- for (var i = 0; i < namespaces.length; i++) {
12281
- processNamespace(namespaces[i]);
12300
+ for (var namespace of namespaces) {
12301
+ processNamespace(namespace);
12282
12302
  }
12283
12303
 
12284
12304
  unprocessedMixins = false;
@@ -12358,10 +12378,7 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
12358
12378
 
12359
12379
  function extractAccessors(properties) {
12360
12380
  if (properties !== undefined) {
12361
- var keys = Object.keys(properties);
12362
-
12363
- for (var i = 0; i < keys.length; i++) {
12364
- var key = keys[i];
12381
+ for (var key of Object.keys(properties)) {
12365
12382
  var desc = Object.getOwnPropertyDescriptor(properties, key);
12366
12383
 
12367
12384
  if (desc.get !== undefined || desc.set !== undefined) {
@@ -12443,7 +12460,8 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
12443
12460
  }]);
12444
12461
  newProperty._readOnly = property._readOnly;
12445
12462
  newProperty._meta = property._meta;
12446
- newProperty.enumerable = property.enumerable;
12463
+ newProperty.enumerable = property.enumerable; // SAFETY: We passed in the impl for this class
12464
+
12447
12465
  return makeComputedDecorator(newProperty, ComputedProperty);
12448
12466
  }
12449
12467
 
@@ -12496,8 +12514,7 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
12496
12514
  var hasFunction = false;
12497
12515
  var props = Object.keys(value);
12498
12516
 
12499
- for (var i = 0; i < props.length; i++) {
12500
- var prop = props[i];
12517
+ for (var prop of props) {
12501
12518
  var propValue = value[prop];
12502
12519
 
12503
12520
  if (typeof propValue === 'function') {
@@ -12560,8 +12577,7 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
12560
12577
  var mergings = concatenatedMixinProperties('mergedProperties', props, values, base);
12561
12578
  var propKeys = Object.keys(props);
12562
12579
 
12563
- for (var i = 0; i < propKeys.length; i++) {
12564
- var key = propKeys[i];
12580
+ for (var key of propKeys) {
12565
12581
  var value = props[key];
12566
12582
  if (value === undefined) continue;
12567
12583
 
@@ -12624,16 +12640,16 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
12624
12640
  if (observers !== undefined) {
12625
12641
  var updateObserver = add ? addObserver : removeObserver;
12626
12642
 
12627
- for (var i = 0; i < observers.paths.length; i++) {
12628
- updateObserver(obj, observers.paths[i], null, key, observers.sync);
12643
+ for (var path of observers.paths) {
12644
+ updateObserver(obj, path, null, key, observers.sync);
12629
12645
  }
12630
12646
  }
12631
12647
 
12632
12648
  if (listeners !== undefined) {
12633
12649
  var updateListener = add ? addListener : removeListener;
12634
12650
 
12635
- for (var _i = 0; _i < listeners.length; _i++) {
12636
- updateListener(obj, listeners[_i], null, key);
12651
+ for (var listener of listeners) {
12652
+ updateListener(obj, listener, null, key);
12637
12653
  }
12638
12654
  }
12639
12655
  }
@@ -12658,8 +12674,7 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
12658
12674
 
12659
12675
  mergeMixins(mixins, meta$$1, descs, values, obj, keys, keysWithSuper);
12660
12676
 
12661
- for (var i = 0; i < keys.length; i++) {
12662
- var key = keys[i];
12677
+ for (var key of keys) {
12663
12678
  var value = values[key];
12664
12679
  var desc = descs[key];
12665
12680
 
@@ -12690,8 +12705,8 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
12690
12705
 
12691
12706
 
12692
12707
  function mixin(obj) {
12693
- for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key5 = 1; _key5 < _len4; _key5++) {
12694
- args[_key5 - 1] = arguments[_key5];
12708
+ for (var _len5 = arguments.length, args = new Array(_len5 > 1 ? _len5 - 1 : 0), _key6 = 1; _key6 < _len5; _key6++) {
12709
+ args[_key6 - 1] = arguments[_key6];
12695
12710
  }
12696
12711
 
12697
12712
  applyMixin(obj, args);
@@ -12823,8 +12838,8 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
12823
12838
  setUnprocessedMixins();
12824
12839
  var M = this;
12825
12840
 
12826
- for (var _len5 = arguments.length, args = new Array(_len5), _key6 = 0; _key6 < _len5; _key6++) {
12827
- args[_key6] = arguments[_key6];
12841
+ for (var _len6 = arguments.length, args = new Array(_len6), _key7 = 0; _key7 < _len6; _key7++) {
12842
+ args[_key7] = arguments[_key7];
12828
12843
  }
12829
12844
 
12830
12845
  return new M(args, undefined);
@@ -12859,8 +12874,8 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
12859
12874
 
12860
12875
 
12861
12876
  reopen() {
12862
- for (var _len6 = arguments.length, args = new Array(_len6), _key7 = 0; _key7 < _len6; _key7++) {
12863
- args[_key7] = arguments[_key7];
12877
+ for (var _len7 = arguments.length, args = new Array(_len7), _key8 = 0; _key8 < _len7; _key8++) {
12878
+ args[_key8] = arguments[_key8];
12864
12879
  }
12865
12880
 
12866
12881
  if (args.length === 0) {
@@ -12937,8 +12952,8 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
12937
12952
  without() {
12938
12953
  var ret = new Mixin([this]);
12939
12954
 
12940
- for (var _len7 = arguments.length, args = new Array(_len7), _key8 = 0; _key8 < _len7; _key8++) {
12941
- args[_key8] = arguments[_key8];
12955
+ for (var _len8 = arguments.length, args = new Array(_len8), _key9 = 0; _key9 < _len8; _key9++) {
12956
+ args[_key9] = arguments[_key9];
12942
12957
  }
12943
12958
 
12944
12959
  ret._without = args;
@@ -13079,8 +13094,8 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
13079
13094
 
13080
13095
 
13081
13096
  function observer() {
13082
- for (var _len8 = arguments.length, args = new Array(_len8), _key9 = 0; _key9 < _len8; _key9++) {
13083
- args[_key9] = arguments[_key9];
13097
+ for (var _len9 = arguments.length, args = new Array(_len9), _key10 = 0; _key10 < _len9; _key10++) {
13098
+ args[_key10] = arguments[_key10];
13084
13099
  }
13085
13100
 
13086
13101
  var funcOrDef = args.pop();
@@ -13104,8 +13119,8 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
13104
13119
  (true && !(typeof sync === 'boolean') && (0, _debug.assert)('observer called without sync', typeof sync === 'boolean'));
13105
13120
  var paths = [];
13106
13121
 
13107
- for (var i = 0; i < dependentKeys.length; ++i) {
13108
- expandProperties(dependentKeys[i], path => paths.push(path));
13122
+ for (var dependentKey of dependentKeys) {
13123
+ expandProperties(dependentKey, path => paths.push(path));
13109
13124
  }
13110
13125
 
13111
13126
  (0, _utils.setObservers)(func, {
@@ -13126,13 +13141,18 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
13126
13141
 
13127
13142
  function inject(type) {
13128
13143
  (true && !(typeof type === 'string') && (0, _debug.assert)('a string type must be provided to inject', typeof type === 'string'));
13144
+ var elementDescriptor;
13145
+ var name;
13129
13146
 
13130
- for (var _len9 = arguments.length, args = new Array(_len9 > 1 ? _len9 - 1 : 0), _key10 = 1; _key10 < _len9; _key10++) {
13131
- args[_key10 - 1] = arguments[_key10];
13147
+ for (var _len10 = arguments.length, args = new Array(_len10 > 1 ? _len10 - 1 : 0), _key11 = 1; _key11 < _len10; _key11++) {
13148
+ args[_key11 - 1] = arguments[_key11];
13132
13149
  }
13133
13150
 
13134
- var calledAsDecorator = isElementDescriptor(args);
13135
- var name = calledAsDecorator ? undefined : args[0];
13151
+ if (isElementDescriptor(args)) {
13152
+ elementDescriptor = args;
13153
+ } else if (typeof args[0] === 'string') {
13154
+ name = args[0];
13155
+ }
13136
13156
 
13137
13157
  var getInjection = function (propertyName) {
13138
13158
  var owner = (0, _owner.getOwner)(this) || this.container; // fallback to `container` for backwards compat
@@ -13159,16 +13179,16 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
13159
13179
 
13160
13180
  });
13161
13181
 
13162
- if (calledAsDecorator) {
13163
- return decorator(args[0], args[1], args[2]);
13182
+ if (elementDescriptor) {
13183
+ return decorator(elementDescriptor[0], elementDescriptor[1], elementDescriptor[2]);
13164
13184
  } else {
13165
13185
  return decorator;
13166
13186
  }
13167
13187
  }
13168
13188
 
13169
13189
  function tracked() {
13170
- for (var _len10 = arguments.length, args = new Array(_len10), _key11 = 0; _key11 < _len10; _key11++) {
13171
- args[_key11] = arguments[_key11];
13190
+ for (var _len11 = arguments.length, args = new Array(_len11), _key12 = 0; _key12 < _len11; _key12++) {
13191
+ args[_key12] = arguments[_key12];
13172
13192
  }
13173
13193
 
13174
13194
  (true && !(!(isElementDescriptor(args.slice(0, 3)) && args.length === 5 && args[4] === true)) && (0, _debug.assert)(`@tracked can only be used directly as a native decorator. If you're using tracked in classic classes, add parenthesis to call it like a function: tracked()`, !(isElementDescriptor(args.slice(0, 3)) && args.length === 5 && args[4] === true)));
@@ -13269,8 +13289,8 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
13269
13289
 
13270
13290
  var cached = function () {
13271
13291
  {
13272
- for (var _len11 = arguments.length, args = new Array(_len11), _key12 = 0; _key12 < _len11; _key12++) {
13273
- args[_key12] = arguments[_key12];
13292
+ for (var _len12 = arguments.length, args = new Array(_len12), _key13 = 0; _key13 < _len12; _key13++) {
13293
+ args[_key13] = arguments[_key13];
13274
13294
  }
13275
13295
 
13276
13296
  var [target, key, descriptor] = args; // Error on `@cached()`, `@cached(...args)`, and `@cached propName = value;`
@@ -13767,16 +13787,16 @@ define("@ember/-internals/routing/lib/ext/controller", ["exports", "@ember/-inte
13767
13787
  aController.transitionToRoute({ queryParams: { sort: 'date' } });
13768
13788
  ```
13769
13789
  See also [replaceRoute](/ember/release/classes/Ember.ControllerMixin/methods/replaceRoute?anchor=replaceRoute).
13770
- @param {String} name the name of the route or a URL
13790
+ @for Ember.ControllerMixin
13791
+ @method transitionToRoute
13792
+ @deprecated Use transitionTo from the Router service instead.
13793
+ @param {String} [name] the name of the route or a URL
13771
13794
  @param {...Object} models the model(s) or identifier(s) to be used
13772
13795
  while transitioning to the route.
13773
13796
  @param {Object} [options] optional hash with a queryParams property
13774
13797
  containing a mapping of query parameters
13775
- @for Ember.ControllerMixin
13776
- @method transitionToRoute
13777
13798
  @return {Transition} the transition object associated with this
13778
13799
  attempted transition
13779
- @deprecated Use transitionTo from the Router service instead.
13780
13800
  @public
13781
13801
  */
13782
13802
  transitionToRoute() {
@@ -13836,14 +13856,16 @@ define("@ember/-internals/routing/lib/ext/controller", ["exports", "@ember/-inte
13836
13856
  aController.replaceRoute('/');
13837
13857
  aController.replaceRoute('/blog/post/1/comment/13');
13838
13858
  ```
13839
- @param {String} name the name of the route or a URL
13859
+ @for Ember.ControllerMixin
13860
+ @method replaceRoute
13861
+ @deprecated Use replaceWith from the Router service instead.
13862
+ @param {String} [name] the name of the route or a URL
13840
13863
  @param {...Object} models the model(s) or identifier(s) to be used
13841
13864
  while transitioning to the route.
13842
- @for Ember.ControllerMixin
13843
- @method replaceRoute
13865
+ @param {Object} [options] optional hash with a queryParams property
13866
+ containing a mapping of query parameters
13844
13867
  @return {Transition} the transition object associated with this
13845
13868
  attempted transition
13846
- @deprecated Use replaceWith from the Router service instead.
13847
13869
  @public
13848
13870
  */
13849
13871
  replaceRoute() {
@@ -14970,6 +14992,17 @@ define("@ember/-internals/routing/lib/services/router", ["exports", "@ember/-int
14970
14992
  value: true
14971
14993
  });
14972
14994
  _exports.default = void 0;
14995
+
14996
+ var __decorate = void 0 && (void 0).__decorate || function (decorators, target, key, desc) {
14997
+ var c = arguments.length,
14998
+ r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
14999
+ d;
15000
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) {
15001
+ if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
15002
+ }
15003
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
15004
+ };
15005
+
14973
15006
  var ROUTER = (0, _utils.symbol)('ROUTER');
14974
15007
 
14975
15008
  function cleanURL(url, rootURL) {
@@ -14979,40 +15012,106 @@ define("@ember/-internals/routing/lib/services/router", ["exports", "@ember/-int
14979
15012
 
14980
15013
  return url.substr(rootURL.length, url.length);
14981
15014
  }
14982
- /**
14983
- The Router service is the public API that provides access to the router.
14984
-
14985
- The immediate benefit of the Router service is that you can inject it into components,
14986
- giving them a friendly way to initiate transitions and ask questions about the current
14987
- global router state.
14988
-
14989
- In this example, the Router service is injected into a component to initiate a transition
14990
- to a dedicated route:
14991
-
14992
- ```app/components/example.js
14993
- import Component from '@glimmer/component';
14994
- import { action } from '@ember/object';
14995
- import { service } from '@ember/service';
14996
-
14997
- export default class ExampleComponent extends Component {
14998
- @service router;
14999
-
15000
- @action
15001
- next() {
15002
- this.router.transitionTo('other.route');
15003
- }
15004
- }
15005
- ```
15006
-
15007
- Like any service, it can also be injected into helpers, routes, etc.
15008
-
15009
- @public
15010
- @extends Service
15011
- @class RouterService
15012
- */
15013
15015
 
15016
+ class RouterService extends _service.default.extend(_runtime.Evented) {
15017
+ constructor() {
15018
+ super(...arguments);
15019
+ /**
15020
+ The `routeWillChange` event is fired at the beginning of any
15021
+ attempted transition with a `Transition` object as the sole
15022
+ argument. This action can be used for aborting, redirecting,
15023
+ or decorating the transition from the currently active routes.
15024
+ A good example is preventing navigation when a form is
15025
+ half-filled out:
15026
+ ```app/routes/contact-form.js
15027
+ import Route from '@ember/routing';
15028
+ import { service } from '@ember/service';
15029
+ export default class extends Route {
15030
+ @service router;
15031
+ constructor() {
15032
+ super(...arguments);
15033
+ this.router.on('routeWillChange', (transition) => {
15034
+ if (!transition.to.find(route => route.name === this.routeName)) {
15035
+ alert("Please save or cancel your changes.");
15036
+ transition.abort();
15037
+ }
15038
+ })
15039
+ }
15040
+ }
15041
+ ```
15042
+ The `routeWillChange` event fires whenever a new route is chosen as the desired target of a transition. This includes `transitionTo`, `replaceWith`, all redirection for any reason including error handling, and abort. Aborting implies changing the desired target back to where you already were. Once a transition has completed, `routeDidChange` fires.
15043
+ @event routeWillChange
15044
+ @param {Transition} transition
15045
+ @public
15046
+ */
15047
+
15048
+ /**
15049
+ The `routeDidChange` event only fires once a transition has settled.
15050
+ This includes aborts and error substates. Like the `routeWillChange` event
15051
+ it receives a Transition as the sole argument.
15052
+ A good example is sending some analytics when the route has transitioned:
15053
+ ```app/routes/contact-form.js
15054
+ import Route from '@ember/routing';
15055
+ import { service } from '@ember/service';
15056
+ export default class extends Route {
15057
+ @service router;
15058
+ constructor() {
15059
+ super(...arguments);
15060
+ this.router.on('routeDidChange', (transition) => {
15061
+ ga.send('pageView', {
15062
+ current: transition.to.name,
15063
+ from: transition.from.name
15064
+ });
15065
+ })
15066
+ }
15067
+ }
15068
+ ```
15069
+ `routeDidChange` will be called after any `Route`'s
15070
+ [didTransition](/ember/release/classes/Route/events/didTransition?anchor=didTransition)
15071
+ action has been fired.
15072
+ The updates of properties
15073
+ [currentURL](/ember/release/classes/RouterService/properties/currentURL?anchor=currentURL),
15074
+ [currentRouteName](/ember/release/classes/RouterService/properties/currentURL?anchor=currentRouteName)
15075
+ and
15076
+ [currentRoute](/ember/release/classes/RouterService/properties/currentURL?anchor=currentRoute)
15077
+ are completed at the time `routeDidChange` is called.
15078
+ @event routeDidChange
15079
+ @param {Transition} transition
15080
+ @public
15081
+ */
15082
+ // Canary features
15083
+
15084
+ /**
15085
+ * Refreshes all currently active routes, doing a full transition.
15086
+ * If a route name is provided and refers to a currently active route,
15087
+ * it will refresh only that route and its descendents.
15088
+ * Returns a promise that will be resolved once the refresh is complete.
15089
+ * All resetController, beforeModel, model, afterModel, redirect, and setupController
15090
+ * hooks will be called again. You will get new data from the model hook.
15091
+ *
15092
+ * @method refresh
15093
+ * @param {String} [routeName] the route to refresh (along with all child routes)
15094
+ * @return Transition
15095
+ * @category EMBER_ROUTING_ROUTER_SERVICE_REFRESH
15096
+ * @public
15097
+ */
15098
+
15099
+ this.refresh = true
15100
+ /* EMBER_ROUTING_ROUTER_SERVICE_REFRESH */
15101
+ ? function (pivotRouteName) {
15102
+ if (!pivotRouteName) {
15103
+ return this._router._routerMicrolib.refresh();
15104
+ }
15105
+
15106
+ (true && !(this._router.hasRoute(pivotRouteName)) && (0, _debug.assert)(`The route "${pivotRouteName}" was not found`, this._router.hasRoute(pivotRouteName)));
15107
+ (true && !(this.isActive(pivotRouteName)) && (0, _debug.assert)(`The route "${pivotRouteName}" is currently not active`, this.isActive(pivotRouteName)));
15108
+ var owner = (0, _owner.getOwner)(this);
15109
+ (true && !(owner) && (0, _debug.assert)('RouterService is unexpectedly missing an owner', owner));
15110
+ var pivotRoute = owner.lookup(`route:${pivotRouteName}`);
15111
+ return this._router._routerMicrolib.refresh(pivotRoute);
15112
+ } : undefined;
15113
+ }
15014
15114
 
15015
- class RouterService extends _service.default {
15016
15115
  get _router() {
15017
15116
  var router = this[ROUTER];
15018
15117
 
@@ -15027,9 +15126,48 @@ define("@ember/-internals/routing/lib/services/router", ["exports", "@ember/-int
15027
15126
  }
15028
15127
 
15029
15128
  willDestroy() {
15030
- super.willDestroy(...arguments);
15129
+ super.willDestroy();
15031
15130
  this[ROUTER] = null;
15032
15131
  }
15132
+ /**
15133
+ Transition the application into another route. The route may
15134
+ be either a single route or route path:
15135
+ Calling `transitionTo` from the Router service will cause default query parameter values to be included in the URL.
15136
+ This behavior is different from calling `transitionTo` on a route or `transitionToRoute` on a controller.
15137
+ See the [Router Service RFC](https://github.com/emberjs/rfcs/blob/master/text/0095-router-service.md#query-parameter-semantics) for more info.
15138
+ In the following example we use the Router service to navigate to a route with a
15139
+ specific model from a Component in the first action, and in the second we trigger
15140
+ a query-params only transition.
15141
+ ```app/components/example.js
15142
+ import Component from '@glimmer/component';
15143
+ import { action } from '@ember/object';
15144
+ import { service } from '@ember/service';
15145
+ export default class extends Component {
15146
+ @service router;
15147
+ @action
15148
+ goToComments(post) {
15149
+ this.router.transitionTo('comments', post);
15150
+ }
15151
+ @action
15152
+ fetchMoreComments(latestComment) {
15153
+ this.router.transitionTo({
15154
+ queryParams: { commentsAfter: latestComment }
15155
+ });
15156
+ }
15157
+ }
15158
+ ```
15159
+ @method transitionTo
15160
+ @param {String} [routeNameOrUrl] the name of the route or a URL
15161
+ @param {...Object} [models] the model(s) or identifier(s) to be used while
15162
+ transitioning to the route.
15163
+ @param {Object} [options] optional hash with a queryParams property
15164
+ containing a mapping of query parameters. May be supplied as the only
15165
+ parameter to trigger a query-parameter-only transition.
15166
+ @return {Transition} the transition object associated with this
15167
+ attempted transition
15168
+ @public
15169
+ */
15170
+
15033
15171
 
15034
15172
  transitionTo() {
15035
15173
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
@@ -15059,7 +15197,6 @@ define("@ember/-internals/routing/lib/services/router", ["exports", "@ember/-int
15059
15197
  When the user clicks the "back" button in the browser, there will be fewer steps.
15060
15198
  This is most commonly used to manage redirects in a way that does not cause confusing additions
15061
15199
  to the user's browsing history.
15062
- See [replaceWith](/ember/release/classes/Route/methods/replaceWith?anchor=replaceWith) for more info.
15063
15200
  Calling `replaceWith` from the Router service will cause default query parameter values to be included in the URL.
15064
15201
  This behavior is different from calling `replaceWith` on a route.
15065
15202
  See the [Router Service RFC](https://github.com/emberjs/rfcs/blob/master/text/0095-router-service.md#query-parameter-semantics) for more info.
@@ -15140,8 +15277,7 @@ define("@ember/-internals/routing/lib/services/router", ["exports", "@ember/-int
15140
15277
  ```
15141
15278
  @method urlFor
15142
15279
  @param {String} routeName the name of the route
15143
- @param {...Object} models the model(s) or identifier(s) to be used while
15144
- transitioning to the route.
15280
+ @param {...Object} models the model(s) for the route.
15145
15281
  @param {Object} [options] optional hash with a queryParams property
15146
15282
  containing a mapping of query parameters
15147
15283
  @return {String} the string representing the generated URL
@@ -15270,6 +15406,7 @@ define("@ember/-internals/routing/lib/services/router", ["exports", "@ember/-int
15270
15406
  ```
15271
15407
  @method recognize
15272
15408
  @param {String} url
15409
+ @return {RouteInfo | null}
15273
15410
  @public
15274
15411
  */
15275
15412
 
@@ -15290,6 +15427,7 @@ define("@ember/-internals/routing/lib/services/router", ["exports", "@ember/-int
15290
15427
  the browser including the app's `rootURL`.
15291
15428
  @method recognizeAndLoad
15292
15429
  @param {String} url
15430
+ @return {RouteInfo}
15293
15431
  @public
15294
15432
  */
15295
15433
 
@@ -15307,168 +15445,15 @@ define("@ember/-internals/routing/lib/services/router", ["exports", "@ember/-int
15307
15445
 
15308
15446
  _exports.default = RouterService;
15309
15447
 
15310
- if (true
15311
- /* EMBER_ROUTING_ROUTER_SERVICE_REFRESH */
15312
- ) {
15313
- RouterService.reopen({
15314
- /**
15315
- * Refreshes all currently active routes, doing a full transition.
15316
- * If a route name is provided and refers to a currently active route,
15317
- * it will refresh only that route and its descendents.
15318
- * Returns a promise that will be resolved once the refresh is complete.
15319
- * All resetController, beforeModel, model, afterModel, redirect, and setupController
15320
- * hooks will be called again. You will get new data from the model hook.
15321
- *
15322
- * @method refresh
15323
- * @param {String} [routeName] the route to refresh (along with all child routes)
15324
- * @return Transition
15325
- * @category EMBER_ROUTING_ROUTER_SERVICE_REFRESH
15326
- * @public
15327
- */
15328
- refresh(pivotRouteName) {
15329
- if (!pivotRouteName) {
15330
- return this._router._routerMicrolib.refresh();
15331
- }
15448
+ __decorate([(0, _computed.readOnly)('_router.currentRouteName')], RouterService.prototype, "currentRouteName", void 0);
15332
15449
 
15333
- (true && !(this._router.hasRoute(pivotRouteName)) && (0, _debug.assert)(`The route "${pivotRouteName}" was not found`, this._router.hasRoute(pivotRouteName)));
15334
- (true && !(this.isActive(pivotRouteName)) && (0, _debug.assert)(`The route "${pivotRouteName}" is currently not active`, this.isActive(pivotRouteName)));
15335
- var owner = (0, _owner.getOwner)(this);
15336
- (true && !(owner) && (0, _debug.assert)('RouterService is unexpectedly missing an owner', owner));
15337
- var pivotRoute = owner.lookup(`route:${pivotRouteName}`);
15338
- return this._router._routerMicrolib.refresh(pivotRoute);
15339
- }
15450
+ __decorate([(0, _computed.readOnly)('_router.currentURL')], RouterService.prototype, "currentURL", void 0);
15340
15451
 
15341
- });
15342
- }
15452
+ __decorate([(0, _computed.readOnly)('_router.location')], RouterService.prototype, "location", void 0);
15343
15453
 
15344
- RouterService.reopen(_runtime.Evented, {
15345
- /**
15346
- Name of the current route.
15347
- This property represents the logical name of the route,
15348
- which is comma separated.
15349
- For the following router:
15350
- ```app/router.js
15351
- Router.map(function() {
15352
- this.route('about');
15353
- this.route('blog', function () {
15354
- this.route('post', { path: ':post_id' });
15355
- });
15356
- });
15357
- ```
15358
- It will return:
15359
- * `index` when you visit `/`
15360
- * `about` when you visit `/about`
15361
- * `blog.index` when you visit `/blog`
15362
- * `blog.post` when you visit `/blog/some-post-id`
15363
- @property currentRouteName
15364
- @type String
15365
- @public
15366
- */
15367
- currentRouteName: (0, _computed.readOnly)('_router.currentRouteName'),
15368
-
15369
- /**
15370
- Current URL for the application.
15371
- This property represents the URL path for this route.
15372
- For the following router:
15373
- ```app/router.js
15374
- Router.map(function() {
15375
- this.route('about');
15376
- this.route('blog', function () {
15377
- this.route('post', { path: ':post_id' });
15378
- });
15379
- });
15380
- ```
15381
- It will return:
15382
- * `/` when you visit `/`
15383
- * `/about` when you visit `/about`
15384
- * `/blog` when you visit `/blog`
15385
- * `/blog/some-post-id` when you visit `/blog/some-post-id`
15386
- @property currentURL
15387
- @type String
15388
- @public
15389
- */
15390
- currentURL: (0, _computed.readOnly)('_router.currentURL'),
15391
-
15392
- /**
15393
- The `location` property returns what implementation of the `location` API
15394
- your application is using, which determines what type of URL is being used.
15395
- See [Location](/ember/release/classes/Location) for more information.
15396
- To force a particular `location` API implementation to be used in your
15397
- application you can set a location type on your `config/environment`.
15398
- For example, to set the `history` type:
15399
- ```config/environment.js
15400
- 'use strict';
15401
- module.exports = function(environment) {
15402
- let ENV = {
15403
- modulePrefix: 'router-service',
15404
- environment,
15405
- rootURL: '/',
15406
- locationType: 'history',
15407
- ...
15408
- }
15409
- }
15410
- ```
15411
- The following location types are available by default:
15412
- `auto`, `hash`, `history`, `none`.
15413
- See [HashLocation](/ember/release/classes/HashLocation).
15414
- See [HistoryLocation](/ember/release/classes/HistoryLocation).
15415
- See [NoneLocation](/ember/release/classes/NoneLocation).
15416
- See [AutoLocation](/ember/release/classes/AutoLocation).
15417
- @property location
15418
- @default 'hash'
15419
- @see {Location}
15420
- @public
15421
- */
15422
- location: (0, _computed.readOnly)('_router.location'),
15423
-
15424
- /**
15425
- The `rootURL` property represents the URL of the root of
15426
- the application, '/' by default.
15427
- This prefix is assumed on all routes defined on this app.
15428
- If you change the `rootURL` in your environment configuration
15429
- like so:
15430
- ```config/environment.js
15431
- 'use strict';
15432
- module.exports = function(environment) {
15433
- let ENV = {
15434
- modulePrefix: 'router-service',
15435
- environment,
15436
- rootURL: '/my-root',
15437
-
15438
- }
15439
- ]
15440
- ```
15441
- This property will return `/my-root`.
15442
- @property rootURL
15443
- @default '/'
15444
- @public
15445
- */
15446
- rootURL: (0, _computed.readOnly)('_router.rootURL'),
15454
+ __decorate([(0, _computed.readOnly)('_router.rootURL')], RouterService.prototype, "rootURL", void 0);
15447
15455
 
15448
- /**
15449
- The `currentRoute` property contains metadata about the current leaf route.
15450
- It returns a `RouteInfo` object that has information like the route name,
15451
- params, query params and more.
15452
- See [RouteInfo](/ember/release/classes/RouteInfo) for more info.
15453
- This property is guaranteed to change whenever a route transition
15454
- happens (even when that transition only changes parameters
15455
- and doesn't change the active route).
15456
- Usage example:
15457
- ```app/components/header.js
15458
- import Component from '@glimmer/component';
15459
- import { service } from '@ember/service';
15460
- import { notEmpty } from '@ember/object/computed';
15461
- export default class extends Component {
15462
- @service router;
15463
- @notEmpty('router.currentRoute.child') isChildRoute;
15464
- });
15465
- ```
15466
- @property currentRoute
15467
- @type RouteInfo
15468
- @public
15469
- */
15470
- currentRoute: (0, _computed.readOnly)('_router.currentRoute')
15471
- });
15456
+ __decorate([(0, _computed.readOnly)('_router.currentRoute')], RouterService.prototype, "currentRoute", void 0);
15472
15457
  });
15473
15458
  define("@ember/-internals/routing/lib/services/routing", ["exports", "@ember/-internals/owner", "@ember/-internals/utils", "@ember/debug", "@ember/object/computed", "@ember/service"], function (_exports, _owner, _utils, _debug, _computed, _service) {
15474
15459
  "use strict";
@@ -16010,232 +15995,12 @@ define("@ember/-internals/routing/lib/system/query_params", ["exports"], functio
16010
15995
 
16011
15996
  _exports.default = QueryParams;
16012
15997
  });
16013
- define("@ember/-internals/routing/lib/system/route-info", [], function () {
15998
+ define("@ember/-internals/routing/lib/system/route-info", ["exports"], function (_exports) {
16014
15999
  "use strict";
16015
- /**
16016
- A `RouteInfoWithAttributes` is an object that contains
16017
- metadata, including the resolved value from the routes
16018
- `model` hook. Like `RouteInfo`, a `RouteInfoWithAttributes`
16019
- represents a specific route within a Transition.
16020
- It is read-only and internally immutable. It is also not
16021
- observable, because a Transition instance is never
16022
- changed after creation.
16023
-
16024
- @class RouteInfoWithAttributes
16025
- @public
16026
- */
16027
-
16028
- /**
16029
- The dot-separated, fully-qualified name of the
16030
- route, like "people.index".
16031
- @property {String} name
16032
- @public
16033
- */
16034
-
16035
- /**
16036
- The final segment of the fully-qualified name of
16037
- the route, like "index"
16038
- @property {String} localName
16039
- @public
16040
- */
16041
16000
 
16042
- /**
16043
- The values of the route's parameters. These are the
16044
- same params that are received as arguments to the
16045
- route's model hook. Contains only the parameters
16046
- valid for this route, if any (params for parent or
16047
- child routes are not merged).
16048
- @property {Object} params
16049
- @public
16050
- */
16051
-
16052
- /**
16053
- The ordered list of the names of the params
16054
- required for this route. It will contain the same
16055
- strings as `Object.keys(params)`, but here the order
16056
- is significant. This allows users to correctly pass
16057
- params into routes programmatically.
16058
- @property {Array} paramNames
16059
- @public
16060
- */
16061
-
16062
- /**
16063
- The values of any queryParams on this route.
16064
- @property {Object} queryParams
16065
- @public
16066
- */
16067
-
16068
- /**
16069
- This is the resolved return value from the
16070
- route's model hook.
16071
- @property {Object|Array|String} attributes
16072
- @public
16073
- */
16074
-
16075
- /**
16076
- Will contain the result `Route#buildRouteInfoMetadata`
16077
- for the corresponding Route.
16078
- @property {Any} metadata
16079
- @public
16080
- */
16081
-
16082
- /**
16083
- A reference to the parent route's RouteInfo.
16084
- This can be used to traverse upward to the topmost
16085
- `RouteInfo`.
16086
- @property {RouteInfo|null} parent
16087
- @public
16088
- */
16089
-
16090
- /**
16091
- A reference to the child route's RouteInfo.
16092
- This can be used to traverse downward to the
16093
- leafmost `RouteInfo`.
16094
- @property {RouteInfo|null} child
16095
- @public
16096
- */
16097
-
16098
- /**
16099
- Allows you to traverse through the linked list
16100
- of `RouteInfo`s from the topmost to leafmost.
16101
- Returns the first `RouteInfo` in the linked list
16102
- for which the callback returns true.
16103
-
16104
- This method is similar to the `find()` method
16105
- defined in ECMAScript 2015.
16106
-
16107
- The callback method you provide should have the
16108
- following signature (all parameters are optional):
16109
-
16110
- ```javascript
16111
- function(item, index, array);
16112
- ```
16113
-
16114
- - `item` is the current item in the iteration.
16115
- - `index` is the current index in the iteration.
16116
- - `array` is the array itself.
16117
-
16118
- It should return the `true` to include the item in
16119
- the results, `false` otherwise.
16120
-
16121
- Note that in addition to a callback, you can also
16122
- pass an optional target object that will be set as
16123
- `this` on the context.
16124
-
16125
- @method find
16126
- @param {Function} callback the callback to execute
16127
- @param {Object} [target*] optional target to use
16128
- @returns {Object} Found item or undefined
16129
- @public
16130
- */
16131
-
16132
- /**
16133
- A RouteInfo is an object that contains metadata
16134
- about a specific route within a Transition. It is
16135
- read-only and internally immutable. It is also not
16136
- observable, because a Transition instance is never
16137
- changed after creation.
16138
-
16139
- @class RouteInfo
16140
- @public
16141
- */
16142
-
16143
- /**
16144
- The dot-separated, fully-qualified name of the
16145
- route, like "people.index".
16146
- @property {String} name
16147
- @public
16148
- */
16149
-
16150
- /**
16151
- The final segment of the fully-qualified name of
16152
- the route, like "index"
16153
- @property {String} localName
16154
- @public
16155
- */
16156
-
16157
- /**
16158
- The values of the route's parameters. These are the
16159
- same params that are received as arguments to the
16160
- route's `model` hook. Contains only the parameters
16161
- valid for this route, if any (params for parent or
16162
- child routes are not merged).
16163
- @property {Object} params
16164
- @public
16165
- */
16166
-
16167
- /**
16168
- The ordered list of the names of the params
16169
- required for this route. It will contain the same
16170
- strings as Object.keys(params), but here the order
16171
- is significant. This allows users to correctly pass
16172
- params into routes programmatically.
16173
- @property {Array} paramNames
16174
- @public
16175
- */
16176
-
16177
- /**
16178
- The values of any queryParams on this route.
16179
- @property {Object} queryParams
16180
- @public
16181
- */
16182
-
16183
- /**
16184
- Will contain the result `Route#buildRouteInfoMetadata`
16185
- for the corresponding Route.
16186
- @property {Any} metadata
16187
- @public
16188
- */
16189
-
16190
- /**
16191
- A reference to the parent route's `RouteInfo`.
16192
- This can be used to traverse upward to the topmost
16193
- `RouteInfo`.
16194
- @property {RouteInfo|null} parent
16195
- @public
16196
- */
16197
-
16198
- /**
16199
- A reference to the child route's `RouteInfo`.
16200
- This can be used to traverse downward to the
16201
- leafmost `RouteInfo`.
16202
- @property {RouteInfo|null} child
16203
- @public
16204
- */
16205
-
16206
- /**
16207
- Allows you to traverse through the linked list
16208
- of `RouteInfo`s from the topmost to leafmost.
16209
- Returns the first `RouteInfo` in the linked list
16210
- for which the callback returns true.
16211
-
16212
- This method is similar to the `find()` method
16213
- defined in ECMAScript 2015.
16214
-
16215
- The callback method you provide should have the
16216
- following signature (all parameters are optional):
16217
-
16218
- ```javascript
16219
- function(item, index, array);
16220
- ```
16221
-
16222
- - `item` is the current item in the iteration.
16223
- - `index` is the current index in the iteration.
16224
- - `array` is the array itself.
16225
-
16226
- It should return the `true` to include the item in
16227
- the results, `false` otherwise.
16228
-
16229
- Note that in addition to a callback, you can also
16230
- pass an optional target object that will be set as
16231
- `this` on the context.
16232
-
16233
- @method find
16234
- @param {Function} callback the callback to execute
16235
- @param {Object} [target*] optional target to use
16236
- @returns {Object} Found item or undefined
16237
- @public
16238
- */
16001
+ Object.defineProperty(_exports, "__esModule", {
16002
+ value: true
16003
+ });
16239
16004
  });
16240
16005
  define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-internals/container", "@ember/-internals/metal", "@ember/-internals/owner", "@ember/-internals/runtime", "@ember/-internals/utils", "@ember/debug", "@ember/object/compat", "@ember/runloop", "router_js", "@ember/-internals/routing/lib/utils", "@ember/-internals/routing/lib/system/generate_controller"], function (_exports, _container, _metal, _owner, _runtime, _utils, _debug, _compat, _runloop, _router_js, _utils2, _generate_controller) {
16241
16006
  "use strict";
@@ -16243,8 +16008,7 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
16243
16008
  Object.defineProperty(_exports, "__esModule", {
16244
16009
  value: true
16245
16010
  });
16246
- _exports.default = _exports.ROUTE_CONNECTIONS = void 0;
16247
- _exports.defaultSerialize = defaultSerialize;
16011
+ _exports.defaultSerialize = _exports.default = _exports.ROUTE_CONNECTIONS = void 0;
16248
16012
  _exports.getFullQueryParams = getFullQueryParams;
16249
16013
  _exports.hasDefaultSerialize = hasDefaultSerialize;
16250
16014
 
@@ -16262,50 +16026,6 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
16262
16026
  _exports.ROUTE_CONNECTIONS = ROUTE_CONNECTIONS;
16263
16027
  var RENDER = (0, _utils.symbol)('render');
16264
16028
 
16265
- function defaultSerialize(model, params) {
16266
- if (params.length < 1 || !model) {
16267
- return;
16268
- }
16269
-
16270
- var object = {};
16271
-
16272
- if (params.length === 1) {
16273
- var [name] = params;
16274
-
16275
- if (name in model) {
16276
- object[name] = (0, _metal.get)(model, name);
16277
- } else if (/_id$/.test(name)) {
16278
- object[name] = (0, _metal.get)(model, 'id');
16279
- } else if ((0, _utils.isProxy)(model)) {
16280
- object[name] = (0, _metal.get)(model, name);
16281
- }
16282
- } else {
16283
- object = (0, _metal.getProperties)(model, params);
16284
- }
16285
-
16286
- return object;
16287
- }
16288
-
16289
- function hasDefaultSerialize(route) {
16290
- return route.serialize === defaultSerialize;
16291
- }
16292
- /**
16293
- @module @ember/routing
16294
- */
16295
-
16296
- /**
16297
- The `Route` class is used to define individual routes. Refer to
16298
- the [routing guide](https://guides.emberjs.com/release/routing/) for documentation.
16299
-
16300
- @class Route
16301
- @extends EmberObject
16302
- @uses ActionHandler
16303
- @uses Evented
16304
- @since 1.0.0
16305
- @public
16306
- */
16307
-
16308
-
16309
16029
  class Route extends _runtime.Object.extend(_runtime.ActionHandler, _runtime.Evented) {
16310
16030
  constructor(owner) {
16311
16031
  super(...arguments);
@@ -16321,6 +16041,68 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
16321
16041
  this._environment = owner.lookup('-environment:main');
16322
16042
  }
16323
16043
  }
16044
+ /**
16045
+ A hook you can implement to convert the route's model into parameters
16046
+ for the URL.
16047
+ ```app/router.js
16048
+ // ...
16049
+ Router.map(function() {
16050
+ this.route('post', { path: '/posts/:post_id' });
16051
+ });
16052
+ ```
16053
+ ```app/routes/post.js
16054
+ import Route from '@ember/routing/route';
16055
+ export default class PostRoute extends Route {
16056
+ model({ post_id }) {
16057
+ // the server returns `{ id: 12 }`
16058
+ return fetch(`/posts/${post_id}`;
16059
+ }
16060
+ serialize(model) {
16061
+ // this will make the URL `/posts/12`
16062
+ return { post_id: model.id };
16063
+ }
16064
+ }
16065
+ ```
16066
+ The default `serialize` method will insert the model's `id` into the
16067
+ route's dynamic segment (in this case, `:post_id`) if the segment contains '_id'.
16068
+ If the route has multiple dynamic segments or does not contain '_id', `serialize`
16069
+ will return `getProperties(model, params)`
16070
+ This method is called when `transitionTo` is called with a context
16071
+ in order to populate the URL.
16072
+ @method serialize
16073
+ @param {Object} model the routes model
16074
+ @param {Array} params an Array of parameter names for the current
16075
+ route (in the example, `['post_id']`.
16076
+ @return {Object} the serialized parameters
16077
+ @since 1.0.0
16078
+ @public
16079
+ */
16080
+
16081
+
16082
+ serialize(model, params) {
16083
+ if (params.length < 1 || !model) {
16084
+ return;
16085
+ }
16086
+
16087
+ var object = {};
16088
+
16089
+ if (params.length === 1) {
16090
+ var [name] = params;
16091
+ (true && !(name) && (0, _debug.assert)('has name', name));
16092
+
16093
+ if (name in model) {
16094
+ object[name] = (0, _metal.get)(model, name);
16095
+ } else if (/_id$/.test(name)) {
16096
+ object[name] = (0, _metal.get)(model, 'id');
16097
+ } else if ((0, _utils.isProxy)(model)) {
16098
+ object[name] = (0, _metal.get)(model, name);
16099
+ }
16100
+ } else {
16101
+ object = (0, _metal.getProperties)(model, params);
16102
+ }
16103
+
16104
+ return object;
16105
+ }
16324
16106
  /**
16325
16107
  Sets the name for this route, including a fully resolved name for routes
16326
16108
  inside engines.
@@ -16362,9 +16144,7 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
16362
16144
  namePaths[a] = `${routeInfo.name}.${names[a]}`;
16363
16145
  }
16364
16146
 
16365
- for (var i = 0; i < qps.length; ++i) {
16366
- var qp = qps[i];
16367
-
16147
+ for (var qp of qps) {
16368
16148
  if (qp.scope === 'model') {
16369
16149
  qp.parts = namePaths;
16370
16150
  }
@@ -16447,9 +16227,10 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
16447
16227
  var fullName = route.fullRouteName;
16448
16228
  var params = Object.assign({}, state.params[fullName]);
16449
16229
  var queryParams = getQueryParamsFor(route, state);
16450
- return Object.keys(queryParams).reduce((params, key) => {
16230
+ return Object.entries(queryParams).reduce((params, _ref) => {
16231
+ var [key, value] = _ref;
16451
16232
  (true && !(!params[key]) && (0, _debug.assert)(`The route '${this.routeName}' has both a dynamic segment and query param with name '${key}'. Please rename one to avoid collisions.`, !params[key]));
16452
- params[key] = queryParams[key];
16233
+ params[key] = value;
16453
16234
  return params;
16454
16235
  }, params);
16455
16236
  }
@@ -16566,148 +16347,6 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
16566
16347
  this.activate(transition);
16567
16348
  this.trigger('activate', transition);
16568
16349
  }
16569
- /**
16570
- The `willTransition` action is fired at the beginning of any
16571
- attempted transition with a `Transition` object as the sole
16572
- argument. This action can be used for aborting, redirecting,
16573
- or decorating the transition from the currently active routes.
16574
- A good example is preventing navigation when a form is
16575
- half-filled out:
16576
- ```app/routes/contact-form.js
16577
- import Route from '@ember/routing/route';
16578
- import { action } from '@ember/object';
16579
- export default class ContactFormRoute extends Route {
16580
- @action
16581
- willTransition(transition) {
16582
- if (this.controller.get('userHasEnteredData')) {
16583
- this.controller.displayNavigationConfirm();
16584
- transition.abort();
16585
- }
16586
- }
16587
- }
16588
- ```
16589
- You can also redirect elsewhere by calling
16590
- `this.transitionTo('elsewhere')` from within `willTransition`.
16591
- Note that `willTransition` will not be fired for the
16592
- redirecting `transitionTo`, since `willTransition` doesn't
16593
- fire when there is already a transition underway. If you want
16594
- subsequent `willTransition` actions to fire for the redirecting
16595
- transition, you must first explicitly call
16596
- `transition.abort()`.
16597
- To allow the `willTransition` event to continue bubbling to the parent
16598
- route, use `return true;`. When the `willTransition` method has a
16599
- return value of `true` then the parent route's `willTransition` method
16600
- will be fired, enabling "bubbling" behavior for the event.
16601
- @event willTransition
16602
- @param {Transition} transition
16603
- @since 1.0.0
16604
- @public
16605
- */
16606
-
16607
- /**
16608
- The `didTransition` action is fired after a transition has
16609
- successfully been completed. This occurs after the normal model
16610
- hooks (`beforeModel`, `model`, `afterModel`, `setupController`)
16611
- have resolved. The `didTransition` action has no arguments,
16612
- however, it can be useful for tracking page views or resetting
16613
- state on the controller.
16614
- ```app/routes/login.js
16615
- import Route from '@ember/routing/route';
16616
- import { action } from '@ember/object';
16617
- export default class LoginRoute extends Route {
16618
- @action
16619
- didTransition() {
16620
- this.controller.get('errors.base').clear();
16621
- return true; // Bubble the didTransition event
16622
- }
16623
- }
16624
- ```
16625
- @event didTransition
16626
- @since 1.2.0
16627
- @public
16628
- */
16629
-
16630
- /**
16631
- The `loading` action is fired on the route when a route's `model`
16632
- hook returns a promise that is not already resolved. The current
16633
- `Transition` object is the first parameter and the route that
16634
- triggered the loading event is the second parameter.
16635
- ```app/routes/application.js
16636
- import Route from '@ember/routing/route';
16637
- import { action } from '@ember/object';
16638
- export default class ApplicationRoute extends Route {
16639
- @action
16640
- loading(transition, route) {
16641
- let controller = this.controllerFor('foo');
16642
- // The controller may not be instantiated when initially loading
16643
- if (controller) {
16644
- controller.currentlyLoading = true;
16645
- transition.finally(function() {
16646
- controller.currentlyLoading = false;
16647
- });
16648
- }
16649
- }
16650
- }
16651
- ```
16652
- @event loading
16653
- @param {Transition} transition
16654
- @param {Route} route The route that triggered the loading event
16655
- @since 1.2.0
16656
- @public
16657
- */
16658
-
16659
- /**
16660
- When attempting to transition into a route, any of the hooks
16661
- may return a promise that rejects, at which point an `error`
16662
- action will be fired on the partially-entered routes, allowing
16663
- for per-route error handling logic, or shared error handling
16664
- logic defined on a parent route.
16665
- Here is an example of an error handler that will be invoked
16666
- for rejected promises from the various hooks on the route,
16667
- as well as any unhandled errors from child routes:
16668
- ```app/routes/admin.js
16669
- import { reject } from 'rsvp';
16670
- import Route from '@ember/routing/route';
16671
- import { action } from '@ember/object';
16672
- export default class AdminRoute extends Route {
16673
- beforeModel() {
16674
- return reject('bad things!');
16675
- }
16676
- @action
16677
- error(error, transition) {
16678
- // Assuming we got here due to the error in `beforeModel`,
16679
- // we can expect that error === "bad things!",
16680
- // but a promise model rejecting would also
16681
- // call this hook, as would any errors encountered
16682
- // in `afterModel`.
16683
- // The `error` hook is also provided the failed
16684
- // `transition`, which can be stored and later
16685
- // `.retry()`d if desired.
16686
- this.transitionTo('login');
16687
- }
16688
- }
16689
- ```
16690
- `error` actions that bubble up all the way to `ApplicationRoute`
16691
- will fire a default error handler that logs the error. You can
16692
- specify your own global default error handler by overriding the
16693
- `error` handler on `ApplicationRoute`:
16694
- ```app/routes/application.js
16695
- import Route from '@ember/routing/route';
16696
- import { action } from '@ember/object';
16697
- export default class ApplicationRoute extends Route {
16698
- @action
16699
- error(error, transition) {
16700
- this.controllerFor('banner').displayError(error.message);
16701
- }
16702
- }
16703
- ```
16704
- @event error
16705
- @param {Error} error
16706
- @param {Transition} transition
16707
- @since 1.0.0
16708
- @public
16709
- */
16710
-
16711
16350
  /**
16712
16351
  This event is triggered when the router enters the route. It is
16713
16352
  not executed when the model for the route changes.
@@ -17032,14 +16671,7 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
17032
16671
  setup(context, transition) {
17033
16672
  var controllerName = this.controllerName || this.routeName;
17034
16673
  var definedController = this.controllerFor(controllerName, true);
17035
- var controller;
17036
-
17037
- if (definedController) {
17038
- controller = definedController;
17039
- } else {
17040
- controller = this.generateController(controllerName);
17041
- } // SAFETY: Since `_qp` is protected we can't infer the type
17042
-
16674
+ var controller = definedController !== null && definedController !== void 0 ? definedController : this.generateController(controllerName); // SAFETY: Since `_qp` is protected we can't infer the type
17043
16675
 
17044
16676
  var queryParams = (0, _metal.get)(this, '_qp'); // Assign the route's controller so that it can more easily be
17045
16677
  // referenced in action handlers. Side effects. Side effects everywhere.
@@ -17061,6 +16693,7 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
17061
16693
  var allParams = queryParams.propertyNames;
17062
16694
  allParams.forEach(prop => {
17063
16695
  var aQp = queryParams.map[prop];
16696
+ (true && !(aQp) && (0, _debug.assert)('expected aQp', aQp));
17064
16697
  aQp.values = params;
17065
16698
  var cacheKey = (0, _utils2.calculateCacheKey)(aQp.route.fullRouteName, aQp.parts, aQp.values);
17066
16699
  var value = cache.lookup(cacheKey, prop, aQp.undecoratedDefaultValue);
@@ -17097,71 +16730,10 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
17097
16730
  var cacheKey = (0, _utils2.calculateCacheKey)(qp.route.fullRouteName, qp.parts, qp.values);
17098
16731
  cache.stash(cacheKey, prop, value);
17099
16732
  }
17100
- /**
17101
- This hook is the first of the route entry validation hooks
17102
- called when an attempt is made to transition into a route
17103
- or one of its children. It is called before `model` and
17104
- `afterModel`, and is appropriate for cases when:
17105
- 1) A decision can be made to redirect elsewhere without
17106
- needing to resolve the model first.
17107
- 2) Any async operations need to occur first before the
17108
- model is attempted to be resolved.
17109
- This hook is provided the current `transition` attempt
17110
- as a parameter, which can be used to `.abort()` the transition,
17111
- save it for a later `.retry()`, or retrieve values set
17112
- on it from a previous hook. You can also just call
17113
- `this.transitionTo` to another route to implicitly
17114
- abort the `transition`.
17115
- You can return a promise from this hook to pause the
17116
- transition until the promise resolves (or rejects). This could
17117
- be useful, for instance, for retrieving async code from
17118
- the server that is required to enter a route.
17119
- @method beforeModel
17120
- @param {Transition} transition
17121
- @return {any | Promise<any>} if the value returned from this hook is
17122
- a promise, the transition will pause until the transition
17123
- resolves. Otherwise, non-promise return values are not
17124
- utilized in any way.
17125
- @since 1.0.0
17126
- @public
17127
- */
17128
16733
 
16734
+ beforeModel(_transition) {}
17129
16735
 
17130
- beforeModel() {}
17131
- /**
17132
- This hook is called after this route's model has resolved.
17133
- It follows identical async/promise semantics to `beforeModel`
17134
- but is provided the route's resolved model in addition to
17135
- the `transition`, and is therefore suited to performing
17136
- logic that can only take place after the model has already
17137
- resolved.
17138
- ```app/routes/posts.js
17139
- import Route from '@ember/routing/route';
17140
- export default class PostsRoute extends Route {
17141
- afterModel(posts, transition) {
17142
- if (posts.get('length') === 1) {
17143
- this.transitionTo('post.show', posts.get('firstObject'));
17144
- }
17145
- }
17146
- }
17147
- ```
17148
- Refer to documentation for `beforeModel` for a description
17149
- of transition-pausing semantics when a promise is returned
17150
- from this hook.
17151
- @method afterModel
17152
- @param {Object} resolvedModel the value returned from `model`,
17153
- or its resolved value if it was a promise
17154
- @param {Transition} transition
17155
- @return {any | Promise<any>} if the value returned from this hook is
17156
- a promise, the transition will pause until the transition
17157
- resolves. Otherwise, non-promise return values are not
17158
- utilized in any way.
17159
- @since 1.0.0
17160
- @public
17161
- */
17162
-
17163
-
17164
- afterModel() {}
16736
+ afterModel(_resolvedModel, _transition) {}
17165
16737
  /**
17166
16738
  A hook you can implement to optionally redirect to another route.
17167
16739
  Calling `this.transitionTo` from inside of the `redirect` hook will
@@ -17184,7 +16756,7 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
17184
16756
  */
17185
16757
 
17186
16758
 
17187
- redirect() {}
16759
+ redirect(_model, _transition) {}
17188
16760
  /**
17189
16761
  Called when the context is changed by router.js.
17190
16762
  @private
@@ -17279,11 +16851,14 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
17279
16851
 
17280
16852
  if (!name) {
17281
16853
  if (sawParams) {
16854
+ // SAFETY: This should be equivalent
17282
16855
  return Object.assign({}, params);
17283
16856
  } else {
17284
16857
  if (transition.resolveIndex < 1) {
17285
16858
  return;
17286
- }
16859
+ } // SAFETY: These return types should be equivalent but router.js doesn't have enough
16860
+ // generics to infer it.
16861
+
17287
16862
 
17288
16863
  return transition[_router_js.STATE_SYMBOL].routeInfos[transition.resolveIndex - 1].context;
17289
16864
  }
@@ -17374,29 +16949,12 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
17374
16949
  (0, _metal.set)(controller, 'model', context);
17375
16950
  }
17376
16951
  }
17377
- /**
17378
- Returns the controller of the current route, or a parent (or any ancestor)
17379
- route in a route hierarchy.
17380
- The controller instance must already have been created, either through entering the
17381
- associated route or using `generateController`.
17382
- ```app/routes/post.js
17383
- import Route from '@ember/routing/route';
17384
- export default class PostRoute extends Route {
17385
- setupController(controller, post) {
17386
- super.setupController(controller, post);
17387
- this.controllerFor('posts').set('currentPost', post);
17388
- }
17389
- }
17390
- ```
17391
- @method controllerFor
17392
- @param {String} name the name of the route or controller
17393
- @return {Controller}
17394
- @since 1.0.0
17395
- @public
17396
- */
17397
-
17398
16952
 
17399
16953
  controllerFor(name, _skipAssert) {
16954
+ if (_skipAssert === void 0) {
16955
+ _skipAssert = false;
16956
+ }
16957
+
17400
16958
  var owner = (0, _owner.getOwner)(this);
17401
16959
  (true && !(owner) && (0, _debug.assert)('Route is unexpectedly missing an owner', owner));
17402
16960
  var route = owner.lookup(`route:${name}`);
@@ -17495,7 +17053,7 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
17495
17053
  }
17496
17054
  }
17497
17055
 
17498
- return route && route.currentModel;
17056
+ return route === null || route === void 0 ? void 0 : route.currentModel;
17499
17057
  }
17500
17058
  /**
17501
17059
  `this[RENDER]` is used to render a template into a region of another template
@@ -17538,39 +17096,6 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
17538
17096
  (0, _runloop.once)(this._router, '_setOutlets');
17539
17097
  }
17540
17098
  }
17541
- /**
17542
- Allows you to produce custom metadata for the route.
17543
- The return value of this method will be attached to
17544
- its corresponding RouteInfoWithAttributes object.
17545
- Example
17546
- ```app/routes/posts/index.js
17547
- import Route from '@ember/routing/route';
17548
- export default class PostsIndexRoute extends Route {
17549
- buildRouteInfoMetadata() {
17550
- return { title: 'Posts Page' }
17551
- }
17552
- }
17553
- ```
17554
- ```app/routes/application.js
17555
- import Route from '@ember/routing/route';
17556
- import { service } from '@ember/service';
17557
- export default class ApplicationRoute extends Route {
17558
- @service router
17559
- constructor() {
17560
- super(...arguments);
17561
- this.router.on('routeDidChange', transition => {
17562
- document.title = transition.to.metadata.title;
17563
- // would update document's title to "Posts Page"
17564
- });
17565
- }
17566
- }
17567
- ```
17568
- @method buildRouteInfoMetadata
17569
- @return any
17570
- @since 3.10.0
17571
- @public
17572
- */
17573
-
17574
17099
 
17575
17100
  buildRouteInfoMetadata() {}
17576
17101
 
@@ -17639,7 +17164,7 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
17639
17164
  // this route find its query params and normalize their object shape them
17640
17165
  // merge in the query params for the route. As a mergedProperty,
17641
17166
  // Route#queryParams is always at least `{}`
17642
- var controllerDefinedQueryParameterConfiguration = (0, _metal.get)(controller, 'queryParams') || {};
17167
+ var controllerDefinedQueryParameterConfiguration = (0, _metal.get)(controller, 'queryParams') || [];
17643
17168
  var normalizedControllerQueryParameterConfiguration = (0, _utils2.normalizeControllerQueryParams)(controllerDefinedQueryParameterConfiguration);
17644
17169
  combinedQueryParameterConfiguration = mergeEachQueryParams(normalizedControllerQueryParameterConfiguration, queryParameterConfiguraton);
17645
17170
  } else if (hasRouterDefinedQueryParams) {
@@ -17711,6 +17236,7 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
17711
17236
  */
17712
17237
  inactive: (prop, value) => {
17713
17238
  var qp = map[prop];
17239
+ (true && !(qp) && (0, _debug.assert)('expected inactive callback to only be called for registered qps', qp));
17714
17240
 
17715
17241
  this._qpChanged(prop, value, qp);
17716
17242
  },
@@ -17722,6 +17248,7 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
17722
17248
  */
17723
17249
  active: (prop, value) => {
17724
17250
  var qp = map[prop];
17251
+ (true && !(qp) && (0, _debug.assert)('expected active callback to only be called for registered qps', qp));
17725
17252
 
17726
17253
  this._qpChanged(prop, value, qp);
17727
17254
 
@@ -17734,6 +17261,7 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
17734
17261
  */
17735
17262
  allowOverrides: (prop, value) => {
17736
17263
  var qp = map[prop];
17264
+ (true && !(qp) && (0, _debug.assert)('expected allowOverrides callback to only be called for registered qps', qp));
17737
17265
 
17738
17266
  this._qpChanged(prop, value, qp);
17739
17267
 
@@ -17768,7 +17296,9 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
17768
17296
  var current;
17769
17297
 
17770
17298
  for (var i = 0; i < routeInfos.length; i++) {
17771
- current = routeInfos[i].route;
17299
+ var routeInfo = routeInfos[i];
17300
+ (true && !(routeInfo) && (0, _debug.assert)('has current routeInfo', routeInfo));
17301
+ current = routeInfo.route;
17772
17302
 
17773
17303
  if (current === route) {
17774
17304
  return routeInfos[i + offset];
@@ -17892,9 +17422,10 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
17892
17422
  function getQueryParamsFor(route, state) {
17893
17423
  state.queryParamsFor = state.queryParamsFor || {};
17894
17424
  var name = route.fullRouteName;
17425
+ var existing = state.queryParamsFor[name];
17895
17426
 
17896
- if (state.queryParamsFor[name]) {
17897
- return state.queryParamsFor[name];
17427
+ if (existing) {
17428
+ return existing;
17898
17429
  }
17899
17430
 
17900
17431
  var fullQueryParams = getFullQueryParams(route._router, state);
@@ -17903,9 +17434,8 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
17903
17434
 
17904
17435
  var qps = (0, _metal.get)(route, '_qp').qps;
17905
17436
 
17906
- for (var i = 0; i < qps.length; ++i) {
17437
+ for (var qp of qps) {
17907
17438
  // Put deserialized qp on params hash.
17908
- var qp = qps[i];
17909
17439
  var qpValueWasPassedIn = (qp.prop in fullQueryParams);
17910
17440
  params[qp.prop] = qpValueWasPassedIn ? fullQueryParams[qp.prop] : copyDefaultValue(qp.defaultValue);
17911
17441
  }
@@ -17996,54 +17526,14 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
17996
17526
 
17997
17527
  return routeName;
17998
17528
  }
17999
- /**
18000
- A hook you can implement to convert the route's model into parameters
18001
- for the URL.
18002
-
18003
- ```app/router.js
18004
- // ...
18005
-
18006
- Router.map(function() {
18007
- this.route('post', { path: '/posts/:post_id' });
18008
- });
18009
-
18010
- ```
18011
-
18012
- ```app/routes/post.js
18013
- import Route from '@ember/routing/route';
18014
-
18015
- export default class PostRoute extends Route {
18016
- model({ post_id }) {
18017
- // the server returns `{ id: 12 }`
18018
- return fetch(`/posts/${post_id}`;
18019
- }
18020
-
18021
- serialize(model) {
18022
- // this will make the URL `/posts/12`
18023
- return { post_id: model.id };
18024
- }
18025
- }
18026
- ```
18027
-
18028
- The default `serialize` method will insert the model's `id` into the
18029
- route's dynamic segment (in this case, `:post_id`) if the segment contains '_id'.
18030
- If the route has multiple dynamic segments or does not contain '_id', `serialize`
18031
- will return `getProperties(model, params)`
18032
-
18033
- This method is called when `transitionTo` is called with a context
18034
- in order to populate the URL.
18035
-
18036
- @method serialize
18037
- @param {Object} model the routes model
18038
- @param {Array} params an Array of parameter names for the current
18039
- route (in the example, `['post_id']`.
18040
- @return {Object} the serialized parameters
18041
- @since 1.0.0
18042
- @public
18043
- */
18044
17529
 
17530
+ var defaultSerialize = Route.prototype.serialize;
17531
+ _exports.defaultSerialize = defaultSerialize;
17532
+
17533
+ function hasDefaultSerialize(route) {
17534
+ return route.serialize === defaultSerialize;
17535
+ } // Set these here so they can be overridden with extend
18045
17536
 
18046
- Route.prototype.serialize = defaultSerialize; // Set these here so they can be overridden with extend
18047
17537
 
18048
17538
  Route.reopen({
18049
17539
  mergedProperties: ['queryParams'],
@@ -18110,8 +17600,8 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
18110
17600
  var qpMap = (0, _metal.get)(this, '_qp').map;
18111
17601
  var totalChanged = Object.keys(changed).concat(Object.keys(removed));
18112
17602
 
18113
- for (var i = 0; i < totalChanged.length; ++i) {
18114
- var qp = qpMap[totalChanged[i]];
17603
+ for (var change of totalChanged) {
17604
+ var qp = qpMap[change];
18115
17605
 
18116
17606
  if (qp) {
18117
17607
  var options = this._optionsForQueryParam(qp);
@@ -18148,8 +17638,7 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
18148
17638
  var replaceUrl;
18149
17639
  (0, _utils2.stashParamNames)(router, routeInfos);
18150
17640
 
18151
- for (var i = 0; i < qpMeta.qps.length; ++i) {
18152
- var qp = qpMeta.qps[i];
17641
+ for (var qp of qpMeta.qps) {
18153
17642
  var route = qp.route;
18154
17643
  var controller = route.controller;
18155
17644
  var presentKey = qp.urlKey in params && qp.urlKey; // Do a reverse lookup to see if the changed query
@@ -18248,6 +17737,9 @@ define("@ember/-internals/routing/lib/system/router", ["exports", "@ember/-inter
18248
17737
  _exports.default = void 0;
18249
17738
  _exports.triggerEvent = triggerEvent;
18250
17739
 
17740
+ /**
17741
+ @module @ember/routing
17742
+ */
18251
17743
  function defaultDidTransition(infos) {
18252
17744
  updatePaths(this);
18253
17745
 
@@ -18407,7 +17899,9 @@ define("@ember/-internals/routing/lib/system/router", ["exports", "@ember/-inter
18407
17899
  var name, nameParts, oldNameParts;
18408
17900
 
18409
17901
  for (var i = 1; i < routeInfos.length; i++) {
18410
- name = routeInfos[i].name;
17902
+ var routeInfo = routeInfos[i];
17903
+ (true && !(routeInfo) && (0, _debug.assert)('has routeInfo', routeInfo));
17904
+ name = routeInfo.name;
18411
17905
  nameParts = name.split('.');
18412
17906
  oldNameParts = slice.call(path);
18413
17907
 
@@ -18721,8 +18215,8 @@ define("@ember/-internals/routing/lib/system/router", ["exports", "@ember/-inter
18721
18215
  var defaultParentState;
18722
18216
  var liveRoutes = null;
18723
18217
 
18724
- for (var i = 0; i < routeInfos.length; i++) {
18725
- var route = routeInfos[i].route;
18218
+ for (var routeInfo of routeInfos) {
18219
+ var route = routeInfo.route;
18726
18220
 
18727
18221
  var connections = _route.ROUTE_CONNECTIONS.get(route);
18728
18222
 
@@ -18800,9 +18294,8 @@ define("@ember/-internals/routing/lib/system/router", ["exports", "@ember/-inter
18800
18294
  /**
18801
18295
  Transition the application into another route. The route may
18802
18296
  be either a single route or route path:
18803
- See [transitionTo](/ember/release/classes/Route/methods/transitionTo?anchor=transitionTo) for more info.
18804
18297
  @method transitionTo
18805
- @param {String} name the name of the route or a URL
18298
+ @param {String} [name] the name of the route or a URL
18806
18299
  @param {...Object} models the model(s) or identifier(s) to be used while
18807
18300
  transitioning to the route.
18808
18301
  @param {Object} [options] optional hash with a queryParams property
@@ -18853,6 +18346,23 @@ define("@ember/-internals/routing/lib/system/router", ["exports", "@ember/-inter
18853
18346
  }
18854
18347
  }
18855
18348
  }
18349
+ /**
18350
+ Similar to `transitionTo`, but instead of adding the destination to the browser's URL history,
18351
+ it replaces the entry for the current route.
18352
+ When the user clicks the "back" button in the browser, there will be fewer steps.
18353
+ This is most commonly used to manage redirects in a way that does not cause confusing additions
18354
+ to the user's browsing history.
18355
+ @method replaceWith
18356
+ @param {String} [name] the name of the route or a URL
18357
+ @param {...Object} models the model(s) or identifier(s) to be used while
18358
+ transitioning to the route.
18359
+ @param {Object} [options] optional hash with a queryParams property
18360
+ containing a mapping of query parameters
18361
+ @return {Transition} the transition object associated with this
18362
+ attempted transition
18363
+ @public
18364
+ */
18365
+
18856
18366
 
18857
18367
  replaceWith() {
18858
18368
  return this.transitionTo(...arguments).method('replace');
@@ -18946,8 +18456,11 @@ define("@ember/-internals/routing/lib/system/router", ["exports", "@ember/-inter
18946
18456
  var instances = this._engineInstances;
18947
18457
 
18948
18458
  for (var name in instances) {
18949
- for (var id in instances[name]) {
18950
- (0, _runloop.run)(instances[name][id], 'destroy');
18459
+ var instance = instances[name];
18460
+ (true && !(instance) && (0, _debug.assert)('has instance', instance));
18461
+
18462
+ for (var id in instance) {
18463
+ (0, _runloop.run)(instance[id], 'destroy');
18951
18464
  }
18952
18465
  }
18953
18466
  }
@@ -19271,12 +18784,11 @@ define("@ember/-internals/routing/lib/system/router", ["exports", "@ember/-inter
19271
18784
  /* DEBUG */
19272
18785
  ? {} : null;
19273
18786
  var qpMeta;
19274
- var qp;
19275
18787
  var urlKey;
19276
18788
  var qpOther;
19277
18789
 
19278
- for (var i = 0; i < routeInfoLength; ++i) {
19279
- qpMeta = this._getQPMeta(routeInfos[i]);
18790
+ for (var routeInfo of routeInfos) {
18791
+ qpMeta = this._getQPMeta(routeInfo);
19280
18792
 
19281
18793
  if (!qpMeta) {
19282
18794
  shouldCache = false;
@@ -19284,9 +18796,7 @@ define("@ember/-internals/routing/lib/system/router", ["exports", "@ember/-inter
19284
18796
  } // Loop over each QP to make sure we don't have any collisions by urlKey
19285
18797
 
19286
18798
 
19287
- for (var _i = 0; _i < qpMeta.qps.length; _i++) {
19288
- qp = qpMeta.qps[_i];
19289
-
18799
+ for (var qp of qpMeta.qps) {
19290
18800
  if (true
19291
18801
  /* DEBUG */
19292
18802
  ) {
@@ -19334,19 +18844,15 @@ define("@ember/-internals/routing/lib/system/router", ["exports", "@ember/-inter
19334
18844
  var routeInfos = state.routeInfos;
19335
18845
  var qpMeta;
19336
18846
 
19337
- for (var i = 0, len = routeInfos.length; i < len; ++i) {
19338
- qpMeta = this._getQPMeta(routeInfos[i]);
18847
+ for (var routeInfo of routeInfos) {
18848
+ qpMeta = this._getQPMeta(routeInfo);
19339
18849
 
19340
18850
  if (!qpMeta) {
19341
18851
  continue;
19342
18852
  }
19343
18853
 
19344
- var qp = void 0;
19345
- var presentProp = void 0;
19346
-
19347
- for (var j = 0, qpLen = qpMeta.qps.length; j < qpLen; ++j) {
19348
- qp = qpMeta.qps[j];
19349
- presentProp = qp.prop in queryParams && qp.prop || qp.scopedPropertyName in queryParams && qp.scopedPropertyName || qp.urlKey in queryParams && qp.urlKey;
18854
+ for (var qp of qpMeta.qps) {
18855
+ var presentProp = qp.prop in queryParams && qp.prop || qp.scopedPropertyName in queryParams && qp.scopedPropertyName || qp.urlKey in queryParams && qp.urlKey;
19350
18856
 
19351
18857
  if (presentProp) {
19352
18858
  if (presentProp !== qp.scopedPropertyName) {
@@ -19376,15 +18882,17 @@ define("@ember/-internals/routing/lib/system/router", ["exports", "@ember/-inter
19376
18882
  var qp;
19377
18883
  var presentProp;
19378
18884
 
19379
- for (var i = 0; i < routeInfos.length; ++i) {
19380
- qpMeta = this._getQPMeta(routeInfos[i]);
18885
+ for (var routeInfo of routeInfos) {
18886
+ qpMeta = this._getQPMeta(routeInfo);
19381
18887
 
19382
18888
  if (!qpMeta) {
19383
18889
  continue;
19384
- }
18890
+ } // Needs to stay for index loop to avoid throwIfClosureRequired
18891
+
19385
18892
 
19386
18893
  for (var j = 0, qpLen = qpMeta.qps.length; j < qpLen; ++j) {
19387
18894
  qp = qpMeta.qps[j];
18895
+ (true && !(qp) && (0, _debug.assert)('expected qp', qp));
19388
18896
  presentProp = qp.prop in queryParams && qp.prop || qp.scopedPropertyName in queryParams && qp.scopedPropertyName || qp.urlKey in queryParams && qp.urlKey;
19389
18897
  (true && !(function () {
19390
18898
  if (qp.urlKey === presentProp || qp.scopedPropertyName === presentProp) {
@@ -19472,12 +18980,16 @@ define("@ember/-internals/routing/lib/system/router", ["exports", "@ember/-inter
19472
18980
  mountPoint
19473
18981
  } = _ref;
19474
18982
  var engineInstances = this._engineInstances;
18983
+ var namedInstances = engineInstances[name];
18984
+
18985
+ if (!namedInstances) {
18986
+ namedInstances = Object.create(null);
18987
+ engineInstances[name] = namedInstances;
18988
+ } // We just set these!
19475
18989
 
19476
- if (!engineInstances[name]) {
19477
- engineInstances[name] = Object.create(null);
19478
- }
19479
18990
 
19480
- var engineInstance = engineInstances[name][instanceId];
18991
+ (true && !(namedInstances) && (0, _debug.assert)('has namedInstances', namedInstances));
18992
+ var engineInstance = namedInstances[instanceId];
19481
18993
 
19482
18994
  if (!engineInstance) {
19483
18995
  var owner = (0, _owner.getOwner)(this);
@@ -19488,7 +19000,7 @@ define("@ember/-internals/routing/lib/system/router", ["exports", "@ember/-inter
19488
19000
  mountPoint
19489
19001
  });
19490
19002
  engineInstance.boot();
19491
- engineInstances[name][instanceId] = engineInstance;
19003
+ namedInstances[instanceId] = engineInstance;
19492
19004
  }
19493
19005
 
19494
19006
  return engineInstance;
@@ -19515,6 +19027,7 @@ define("@ember/-internals/routing/lib/system/router", ["exports", "@ember/-inter
19515
19027
  function forEachRouteAbove(routeInfos, callback) {
19516
19028
  for (var i = routeInfos.length - 1; i >= 0; --i) {
19517
19029
  var routeInfo = routeInfos[i];
19030
+ (true && !(routeInfo) && (0, _debug.assert)('has routeInfo', routeInfo));
19518
19031
  var route = routeInfo.route; // routeInfo.handler being `undefined` generally means either:
19519
19032
  //
19520
19033
  // 1. an error occurred during creation of the route in question
@@ -19717,6 +19230,7 @@ define("@ember/-internals/routing/lib/system/router", ["exports", "@ember/-inter
19717
19230
 
19718
19231
  for (var i = routeInfos.length - 1; i >= 0; i--) {
19719
19232
  routeInfo = routeInfos[i];
19233
+ (true && !(routeInfo) && (0, _debug.assert)('has routeInfo', routeInfo));
19720
19234
  handler = routeInfo.route;
19721
19235
  actionHandler = handler && handler.actions && handler.actions[name];
19722
19236
 
@@ -19754,9 +19268,8 @@ define("@ember/-internals/routing/lib/system/router", ["exports", "@ember/-inter
19754
19268
  params
19755
19269
  } = state;
19756
19270
 
19757
- for (var i = 0; i < routeInfos.length; ++i) {
19758
- var routeInfo = routeInfos[i]; // If the routeInfo is not resolved, we serialize the context into params
19759
-
19271
+ for (var routeInfo of routeInfos) {
19272
+ // If the routeInfo is not resolved, we serialize the context into params
19760
19273
  if (!routeInfo.isResolved) {
19761
19274
  params[routeInfo.name] = routeInfo.serialize(routeInfo.context);
19762
19275
  } else {
@@ -19776,7 +19289,9 @@ define("@ember/-internals/routing/lib/system/router", ["exports", "@ember/-inter
19776
19289
 
19777
19290
  var path = EmberRouter._routePath(infos);
19778
19291
 
19779
- var currentRouteName = infos[infos.length - 1].name;
19292
+ var info = infos[infos.length - 1];
19293
+ (true && !(info) && (0, _debug.assert)('expected info', info));
19294
+ var currentRouteName = info.name;
19780
19295
  var location = router.location;
19781
19296
  (true && !(typeof location !== 'string') && (0, _debug.assert)('expected location to not be a string', typeof location !== 'string'));
19782
19297
  var currentURL = location.getURL();
@@ -20174,22 +19689,28 @@ define("@ember/-internals/routing/lib/utils", ["exports", "@ember/-internals/met
20174
19689
  var ALL_PERIODS_REGEX = /\./g;
20175
19690
 
20176
19691
  function extractRouteArgs(args) {
19692
+ // SAFETY: This should just be the same thing
20177
19693
  args = args.slice();
20178
- var possibleQueryParams = args.pop();
19694
+ var possibleOptions = args[args.length - 1];
20179
19695
  var queryParams;
20180
19696
 
20181
- if (hasQueryParams(possibleQueryParams)) {
20182
- queryParams = possibleQueryParams.queryParams;
19697
+ if (isRouteOptions(possibleOptions)) {
19698
+ args.pop(); // Remove options
19699
+
19700
+ queryParams = possibleOptions.queryParams;
20183
19701
  } else {
20184
- // Not query params so return to the array
20185
- args.push(possibleQueryParams);
20186
19702
  queryParams = {};
20187
- } // UNSAFE: these are simply assumed as the existing behavior of the system.
20188
- // However, this could break if upstream refactors change it, and the types
20189
- // here would not be able to tell us; we would lie to everything downstream.
19703
+ }
19704
+
19705
+ var routeName;
19706
+
19707
+ if (typeof args[0] === 'string') {
19708
+ routeName = args.shift(); // We just checked this!
19709
+
19710
+ (true && !(typeof routeName === 'string') && (0, _debug.assert)('routeName is a string', typeof routeName === 'string'));
19711
+ } // SAFTEY: We removed the name and options if they existed, only models left.
20190
19712
 
20191
19713
 
20192
- var routeName = args.shift();
20193
19714
  var models = args;
20194
19715
  return {
20195
19716
  routeName,
@@ -20200,7 +19721,9 @@ define("@ember/-internals/routing/lib/utils", ["exports", "@ember/-internals/met
20200
19721
 
20201
19722
  function getActiveTargetName(router) {
20202
19723
  var routeInfos = router.activeTransition ? router.activeTransition[_router_js.STATE_SYMBOL].routeInfos : router.state.routeInfos;
20203
- return routeInfos[routeInfos.length - 1].name;
19724
+ var lastRouteInfo = routeInfos[routeInfos.length - 1];
19725
+ (true && !(lastRouteInfo) && (0, _debug.assert)('has last route info', lastRouteInfo));
19726
+ return lastRouteInfo.name;
20204
19727
  }
20205
19728
 
20206
19729
  function stashParamNames(router, routeInfos) {
@@ -20212,24 +19735,27 @@ define("@ember/-internals/routing/lib/utils", ["exports", "@ember/-internals/met
20212
19735
  // Hopefully we can remove this in the future.
20213
19736
 
20214
19737
 
20215
- var targetRouteName = routeInfos[routeInfos.length - 1].name;
19738
+ var routeInfo = routeInfos[routeInfos.length - 1];
19739
+ (true && !(routeInfo) && (0, _debug.assert)('has route info', routeInfo));
19740
+ var targetRouteName = routeInfo.name;
20216
19741
 
20217
19742
  var recogHandlers = router._routerMicrolib.recognizer.handlersFor(targetRouteName);
20218
19743
 
20219
19744
  var dynamicParent;
20220
19745
 
20221
19746
  for (var i = 0; i < routeInfos.length; ++i) {
20222
- var routeInfo = routeInfos[i];
19747
+ var _routeInfo = routeInfos[i];
19748
+ (true && !(_routeInfo) && (0, _debug.assert)('has route info', _routeInfo));
20223
19749
  var names = recogHandlers[i].names;
20224
19750
 
20225
19751
  if (names.length) {
20226
- dynamicParent = routeInfo;
19752
+ dynamicParent = _routeInfo;
20227
19753
  }
20228
19754
 
20229
- routeInfo['_names'] = names;
20230
- var route = routeInfo.route;
19755
+ _routeInfo['_names'] = names;
19756
+ var route = _routeInfo.route; // SAFETY: This cast should be idential. I don't understand why it is needed.
20231
19757
 
20232
- route._stashNames(routeInfo, dynamicParent);
19758
+ route._stashNames(_routeInfo, dynamicParent);
20233
19759
  }
20234
19760
 
20235
19761
  routeInfos['_namesStashed'] = true;
@@ -20269,9 +19795,7 @@ define("@ember/-internals/routing/lib/utils", ["exports", "@ember/-internals/met
20269
19795
 
20270
19796
  var suffixes = '';
20271
19797
 
20272
- for (var i = 0; i < parts.length; ++i) {
20273
- var part = parts[i];
20274
-
19798
+ for (var part of parts) {
20275
19799
  var cacheValuePrefix = _calculateCacheValuePrefix(prefix, part);
20276
19800
 
20277
19801
  var value = void 0;
@@ -20327,8 +19851,8 @@ define("@ember/-internals/routing/lib/utils", ["exports", "@ember/-internals/met
20327
19851
  function normalizeControllerQueryParams(queryParams) {
20328
19852
  var qpMap = {};
20329
19853
 
20330
- for (var i = 0; i < queryParams.length; ++i) {
20331
- accumulateQueryParamDescriptors(queryParams[i], qpMap);
19854
+ for (var queryParam of queryParams) {
19855
+ accumulateQueryParamDescriptors(queryParam, qpMap);
20332
19856
  }
20333
19857
 
20334
19858
  return qpMap;
@@ -20385,12 +19909,14 @@ define("@ember/-internals/routing/lib/utils", ["exports", "@ember/-internals/met
20385
19909
 
20386
19910
 
20387
19911
  function prefixRouteNameArg(route, args) {
20388
- var routeName = args[0];
19912
+ var routeName;
20389
19913
  var owner = (0, _owner.getOwner)(route);
20390
19914
  (true && !(owner) && (0, _debug.assert)('Route is unexpectedly missing an owner', owner));
20391
19915
  var prefix = owner.mountPoint; // only alter the routeName if it's actually referencing a route.
20392
19916
 
20393
- if (owner.routable && typeof routeName === 'string') {
19917
+ if (owner.routable && typeof args[0] === 'string') {
19918
+ routeName = args[0];
19919
+
20394
19920
  if (resemblesURL(routeName)) {
20395
19921
  throw new _error.default('Programmatic transitions by URL cannot be used within an Engine. Please use the route name instead.');
20396
19922
  } else {
@@ -20439,7 +19965,7 @@ define("@ember/-internals/routing/lib/utils", ["exports", "@ember/-internals/met
20439
19965
  }));
20440
19966
  }
20441
19967
 
20442
- function hasQueryParams(value) {
19968
+ function isRouteOptions(value) {
20443
19969
  if (value && typeof value === 'object') {
20444
19970
  var qps = value.queryParams;
20445
19971
 
@@ -21074,16 +20600,16 @@ define("@ember/-internals/runtime/lib/mixins/action_handler", ["exports", "@embe
21074
20600
  /**
21075
20601
  The collection of functions, keyed by name, available on this
21076
20602
  `ActionHandler` as action targets.
21077
- These functions will be invoked when a matching `{{action}}` is triggered
20603
+ These functions will be invoked when a matching `{{action}}` is triggered
21078
20604
  from within a template and the application's current route is this route.
21079
- Actions can also be invoked from other parts of your application
20605
+ Actions can also be invoked from other parts of your application
21080
20606
  via `ActionHandler#send`.
21081
- The `actions` hash will inherit action handlers from
20607
+ The `actions` hash will inherit action handlers from
21082
20608
  the `actions` hash defined on extended parent classes
21083
20609
  or mixins rather than just replace the entire hash, e.g.:
21084
- ```app/mixins/can-display-banner.js
20610
+ ```app/mixins/can-display-banner.js
21085
20611
  import Mixin from '@ember/mixin';
21086
- export default Mixin.create({
20612
+ export default Mixin.create({
21087
20613
  actions: {
21088
20614
  displayBanner(msg) {
21089
20615
  // ...
@@ -21091,28 +20617,28 @@ define("@ember/-internals/runtime/lib/mixins/action_handler", ["exports", "@embe
21091
20617
  }
21092
20618
  });
21093
20619
  ```
21094
- ```app/routes/welcome.js
20620
+ ```app/routes/welcome.js
21095
20621
  import Route from '@ember/routing/route';
21096
20622
  import CanDisplayBanner from '../mixins/can-display-banner';
21097
- export default Route.extend(CanDisplayBanner, {
20623
+ export default Route.extend(CanDisplayBanner, {
21098
20624
  actions: {
21099
20625
  playMusic() {
21100
20626
  // ...
21101
20627
  }
21102
20628
  }
21103
20629
  });
21104
- // `WelcomeRoute`, when active, will be able to respond
20630
+ // `WelcomeRoute`, when active, will be able to respond
21105
20631
  // to both actions, since the actions hash is merged rather
21106
20632
  // then replaced when extending mixins / parent classes.
21107
20633
  this.send('displayBanner');
21108
20634
  this.send('playMusic');
21109
20635
  ```
21110
- Within a Controller, Route or Component's action handler,
20636
+ Within a Controller, Route or Component's action handler,
21111
20637
  the value of the `this` context is the Controller, Route or
21112
20638
  Component object:
21113
- ```app/routes/song.js
20639
+ ```app/routes/song.js
21114
20640
  import Route from '@ember/routing/route';
21115
- export default Route.extend({
20641
+ export default Route.extend({
21116
20642
  actions: {
21117
20643
  myAction() {
21118
20644
  this.controllerFor("song");
@@ -21122,13 +20648,13 @@ define("@ember/-internals/runtime/lib/mixins/action_handler", ["exports", "@embe
21122
20648
  }
21123
20649
  });
21124
20650
  ```
21125
- It is also possible to call `this._super(...arguments)` from within an
20651
+ It is also possible to call `this._super(...arguments)` from within an
21126
20652
  action handler if it overrides a handler defined on a parent
21127
20653
  class or mixin:
21128
- Take for example the following routes:
21129
- ```app/mixins/debug-route.js
20654
+ Take for example the following routes:
20655
+ ```app/mixins/debug-route.js
21130
20656
  import Mixin from '@ember/mixin';
21131
- export default Mixin.create({
20657
+ export default Mixin.create({
21132
20658
  actions: {
21133
20659
  debugRouteInformation() {
21134
20660
  console.debug("It's a-me, console.debug!");
@@ -21136,54 +20662,54 @@ define("@ember/-internals/runtime/lib/mixins/action_handler", ["exports", "@embe
21136
20662
  }
21137
20663
  });
21138
20664
  ```
21139
- ```app/routes/annoying-debug.js
20665
+ ```app/routes/annoying-debug.js
21140
20666
  import Route from '@ember/routing/route';
21141
20667
  import DebugRoute from '../mixins/debug-route';
21142
- export default Route.extend(DebugRoute, {
20668
+ export default Route.extend(DebugRoute, {
21143
20669
  actions: {
21144
20670
  debugRouteInformation() {
21145
20671
  // also call the debugRouteInformation of mixed in DebugRoute
21146
20672
  this._super(...arguments);
21147
- // show additional annoyance
20673
+ // show additional annoyance
21148
20674
  window.alert(...);
21149
20675
  }
21150
20676
  }
21151
20677
  });
21152
20678
  ```
21153
- ## Bubbling
21154
- By default, an action will stop bubbling once a handler defined
20679
+ ## Bubbling
20680
+ By default, an action will stop bubbling once a handler defined
21155
20681
  on the `actions` hash handles it. To continue bubbling the action,
21156
20682
  you must return `true` from the handler:
21157
- ```app/router.js
20683
+ ```app/router.js
21158
20684
  Router.map(function() {
21159
20685
  this.route("album", function() {
21160
20686
  this.route("song");
21161
20687
  });
21162
20688
  });
21163
20689
  ```
21164
- ```app/routes/album.js
20690
+ ```app/routes/album.js
21165
20691
  import Route from '@ember/routing/route';
21166
- export default Route.extend({
20692
+ export default Route.extend({
21167
20693
  actions: {
21168
20694
  startPlaying: function() {
21169
20695
  }
21170
20696
  }
21171
20697
  });
21172
20698
  ```
21173
- ```app/routes/album-song.js
20699
+ ```app/routes/album-song.js
21174
20700
  import Route from '@ember/routing/route';
21175
- export default Route.extend({
20701
+ export default Route.extend({
21176
20702
  actions: {
21177
20703
  startPlaying() {
21178
20704
  // ...
21179
- if (actionShouldAlsoBeTriggeredOnParentRoute) {
20705
+ if (actionShouldAlsoBeTriggeredOnParentRoute) {
21180
20706
  return true;
21181
20707
  }
21182
20708
  }
21183
20709
  }
21184
20710
  });
21185
20711
  ```
21186
- @property actions
20712
+ @property actions
21187
20713
  @type Object
21188
20714
  @default null
21189
20715
  @public
@@ -21193,14 +20719,14 @@ define("@ember/-internals/runtime/lib/mixins/action_handler", ["exports", "@embe
21193
20719
  Triggers a named action on the `ActionHandler`. Any parameters
21194
20720
  supplied after the `actionName` string will be passed as arguments
21195
20721
  to the action target function.
21196
- If the `ActionHandler` has its `target` property set, actions may
20722
+ If the `ActionHandler` has its `target` property set, actions may
21197
20723
  bubble to the `target`. Bubbling happens when an `actionName` can
21198
20724
  not be found in the `ActionHandler`'s `actions` hash or if the
21199
20725
  action target function returns `true`.
21200
- Example
21201
- ```app/routes/welcome.js
20726
+ Example
20727
+ ```app/routes/welcome.js
21202
20728
  import Route from '@ember/routing/route';
21203
- export default Route.extend({
20729
+ export default Route.extend({
21204
20730
  actions: {
21205
20731
  playTheme() {
21206
20732
  this.send('playMusic', 'theme.mp3');
@@ -21211,7 +20737,7 @@ define("@ember/-internals/runtime/lib/mixins/action_handler", ["exports", "@embe
21211
20737
  }
21212
20738
  });
21213
20739
  ```
21214
- @method send
20740
+ @method send
21215
20741
  @param {String} actionName The action to trigger
21216
20742
  @param {*} context a context to send with the action
21217
20743
  @public
@@ -26486,6 +26012,8 @@ define("@ember/-internals/utils/index", ["exports", "@glimmer/util", "@ember/deb
26486
26012
  }
26487
26013
 
26488
26014
  var key = keys[i];
26015
+ (true && !(key) && (0, _debug.assert)('has key', key)); // Looping over array
26016
+
26489
26017
  s += `${inspectKey(key)}: ${inspectValue(obj[key], depth, seen)}`;
26490
26018
  }
26491
26019
 
@@ -28020,6 +27548,7 @@ define("@ember/-internals/views/lib/system/utils", ["exports", "@ember/-internal
28020
27548
  var rootViews = [];
28021
27549
  Object.keys(registry).forEach(id => {
28022
27550
  var view = registry[id];
27551
+ (true && !(view) && (0, _debug.assert)('expected view', view));
28023
27552
 
28024
27553
  if (view.parentView === null) {
28025
27554
  rootViews.push(view);
@@ -30132,8 +29661,8 @@ define("@ember/canary-features/index", ["exports", "@ember/-internals/environmen
30132
29661
  @public
30133
29662
  */
30134
29663
  var DEFAULT_FEATURES = {
30135
- EMBER_LIBRARIES_ISREGISTERED: null,
30136
- EMBER_IMPROVED_INSTRUMENTATION: null,
29664
+ EMBER_LIBRARIES_ISREGISTERED: false,
29665
+ EMBER_IMPROVED_INSTRUMENTATION: false,
30137
29666
  EMBER_NAMED_BLOCKS: true,
30138
29667
  EMBER_GLIMMER_HELPER_MANAGER: true,
30139
29668
  EMBER_GLIMMER_INVOKE_HELPER: true,
@@ -30301,62 +29830,14 @@ define("@ember/controller/index", ["exports", "@ember/-internals/runtime", "@emb
30301
29830
  _exports.default = void 0;
30302
29831
  _exports.inject = inject;
30303
29832
 
30304
- /**
30305
- @module @ember/controller
30306
- */
29833
+ class Controller extends _runtime.FrameworkObject.extend(_controller_mixin.default) {}
30307
29834
 
30308
- /**
30309
- @class Controller
30310
- @extends EmberObject
30311
- @uses Ember.ControllerMixin
30312
- @public
30313
- */
30314
- var Controller = _runtime.FrameworkObject.extend(_controller_mixin.default);
30315
- /**
30316
- Creates a property that lazily looks up another controller in the container.
30317
- Can only be used when defining another controller.
30318
-
30319
- Example:
30320
-
30321
- ```app/controllers/post.js
30322
- import Controller, {
30323
- inject as controller
30324
- } from '@ember/controller';
30325
-
30326
- export default class PostController extends Controller {
30327
- @controller posts;
29835
+ function inject() {
29836
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
29837
+ args[_key] = arguments[_key];
30328
29838
  }
30329
- ```
30330
-
30331
- Classic Class Example:
30332
-
30333
- ```app/controllers/post.js
30334
- import Controller, {
30335
- inject as controller
30336
- } from '@ember/controller';
30337
-
30338
- export default Controller.extend({
30339
- posts: controller()
30340
- });
30341
- ```
30342
-
30343
- This example will create a `posts` property on the `post` controller that
30344
- looks up the `posts` controller in the container, making it easy to reference
30345
- other controllers.
30346
-
30347
- @method inject
30348
- @static
30349
- @for @ember/controller
30350
- @since 1.10.0
30351
- @param {String} name (optional) name of the controller to inject, defaults to
30352
- the property's name
30353
- @return {ComputedDecorator} injection decorator instance
30354
- @public
30355
- */
30356
-
30357
29839
 
30358
- function inject() {
30359
- return (0, _metal.inject)('controller', ...arguments);
29840
+ return (0, _metal.inject)('controller', ...args);
30360
29841
  }
30361
29842
 
30362
29843
  var _default = Controller;
@@ -32245,7 +31726,7 @@ define("@ember/helper/index", ["exports", "@glimmer/manager", "@glimmer/runtime"
32245
31726
  }
32246
31727
  });
32247
31728
  });
32248
- define("@ember/instrumentation/index", ["exports", "@ember/-internals/environment"], function (_exports, _environment) {
31729
+ define("@ember/instrumentation/index", ["exports", "@ember/-internals/environment", "@ember/debug"], function (_exports, _environment, _debug) {
32249
31730
  "use strict";
32250
31731
 
32251
31732
  Object.defineProperty(_exports, "__esModule", {
@@ -32324,11 +31805,8 @@ define("@ember/instrumentation/index", ["exports", "@ember/-internals/environmen
32324
31805
 
32325
31806
  function populateListeners(name) {
32326
31807
  var listeners = [];
32327
- var subscriber;
32328
-
32329
- for (var i = 0; i < subscribers.length; i++) {
32330
- subscriber = subscribers[i];
32331
31808
 
31809
+ for (var subscriber of subscribers) {
32332
31810
  if (subscriber.regex.test(name)) {
32333
31811
  listeners.push(subscriber.object);
32334
31812
  }
@@ -32433,19 +31911,20 @@ define("@ember/instrumentation/index", ["exports", "@ember/-internals/environmen
32433
31911
  var beforeValues = [];
32434
31912
  var timestamp = time();
32435
31913
 
32436
- for (var i = 0; i < listeners.length; i++) {
32437
- var listener = listeners[i];
31914
+ for (var listener of listeners) {
32438
31915
  beforeValues.push(listener.before(name, timestamp, payload));
32439
31916
  }
32440
31917
 
31918
+ var constListeners = listeners;
32441
31919
  return function _instrumentEnd() {
32442
31920
  var timestamp = time();
32443
31921
 
32444
- for (var _i = 0; _i < listeners.length; _i++) {
32445
- var _listener = listeners[_i];
31922
+ for (var i = 0; i < constListeners.length; i++) {
31923
+ var _listener = constListeners[i];
31924
+ (true && !(_listener) && (0, _debug.assert)('has listener', _listener)); // Iterating over values
32446
31925
 
32447
31926
  if (typeof _listener.after === 'function') {
32448
- _listener.after(name, timestamp, payload, beforeValues[_i]);
31927
+ _listener.after(name, timestamp, payload, beforeValues[i]);
32449
31928
  }
32450
31929
  }
32451
31930
 
@@ -32471,12 +31950,9 @@ define("@ember/instrumentation/index", ["exports", "@ember/-internals/environmen
32471
31950
 
32472
31951
  function subscribe(pattern, object) {
32473
31952
  var paths = pattern.split('.');
32474
- var path;
32475
31953
  var regexes = [];
32476
31954
 
32477
- for (var i = 0; i < paths.length; i++) {
32478
- path = paths[i];
32479
-
31955
+ for (var path of paths) {
32480
31956
  if (path === '*') {
32481
31957
  regexes.push('[^\\.]*');
32482
31958
  } else {
@@ -35305,6 +34781,19 @@ define("@ember/routing/route", ["exports", "@ember/-internals/routing"], functio
35305
34781
  }
35306
34782
  });
35307
34783
  });
34784
+ define("@ember/routing/router-service", ["exports", "@ember/-internals/routing"], function (_exports, _routing) {
34785
+ "use strict";
34786
+
34787
+ Object.defineProperty(_exports, "__esModule", {
34788
+ value: true
34789
+ });
34790
+ Object.defineProperty(_exports, "default", {
34791
+ enumerable: true,
34792
+ get: function () {
34793
+ return _routing.RouterService;
34794
+ }
34795
+ });
34796
+ });
35308
34797
  define("@ember/routing/router", ["exports", "@ember/-internals/routing"], function (_exports, _routing) {
35309
34798
  "use strict";
35310
34799
 
@@ -36130,75 +35619,20 @@ define("@ember/service/index", ["exports", "@ember/-internals/runtime", "@ember/
36130
35619
  _exports.inject = inject;
36131
35620
  _exports.service = service;
36132
35621
 
36133
- /**
36134
- @module @ember/service
36135
- @public
36136
- */
36137
-
36138
- /**
36139
- @method inject
36140
- @static
36141
- @since 1.10.0
36142
- @for @ember/service
36143
- @param {String} name (optional) name of the service to inject, defaults to
36144
- the property's name
36145
- @return {ComputedDecorator} injection decorator instance
36146
- @public
36147
- */
36148
35622
  function inject() {
36149
- return (0, _metal.inject)('service', ...arguments);
36150
- }
36151
- /**
36152
- Creates a property that lazily looks up a service in the container. There are
36153
- no restrictions as to what objects a service can be injected into.
36154
-
36155
- Example:
36156
-
36157
- ```app/routes/application.js
36158
- import Route from '@ember/routing/route';
36159
- import { service } from '@ember/service';
36160
-
36161
- export default class ApplicationRoute extends Route {
36162
- @service('auth') authManager;
36163
-
36164
- model() {
36165
- return this.authManager.findCurrentUser();
36166
- }
35623
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
35624
+ args[_key] = arguments[_key];
36167
35625
  }
36168
- ```
36169
-
36170
- Classic Class Example:
36171
-
36172
- ```app/routes/application.js
36173
- import Route from '@ember/routing/route';
36174
- import { service } from '@ember/service';
36175
-
36176
- export default Route.extend({
36177
- authManager: service('auth'),
36178
-
36179
- model() {
36180
- return this.get('authManager').findCurrentUser();
36181
- }
36182
- });
36183
- ```
36184
-
36185
- This example will create an `authManager` property on the application route
36186
- that looks up the `auth` service in the container, making it easily accessible
36187
- in the `model` hook.
36188
-
36189
- @method service
36190
- @static
36191
- @since 4.1.0
36192
- @for @ember/service
36193
- @param {String} name (optional) name of the service to inject, defaults to
36194
- the property's name
36195
- @return {ComputedDecorator} injection decorator instance
36196
- @public
36197
- */
36198
35626
 
35627
+ return (0, _metal.inject)('service', ...args);
35628
+ }
36199
35629
 
36200
35630
  function service() {
36201
- return (0, _metal.inject)('service', ...arguments);
35631
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
35632
+ args[_key2] = arguments[_key2];
35633
+ }
35634
+
35635
+ return (0, _metal.inject)('service', ...args);
36202
35636
  }
36203
35637
  /**
36204
35638
  @class Service
@@ -36208,13 +35642,10 @@ define("@ember/service/index", ["exports", "@ember/-internals/runtime", "@ember/
36208
35642
  */
36209
35643
 
36210
35644
 
36211
- var Service = _runtime.FrameworkObject.extend();
35645
+ class Service extends _runtime.FrameworkObject {}
36212
35646
 
36213
- Service.reopenClass({
36214
- isServiceFactory: true
36215
- });
36216
- var _default = Service;
36217
- _exports.default = _default;
35647
+ _exports.default = Service;
35648
+ Service.isServiceFactory = true;
36218
35649
  });
36219
35650
  define("@ember/string/index", ["exports", "@ember/string/lib/string_registry", "@ember/-internals/utils", "@ember/debug", "@ember/-internals/glimmer"], function (_exports, _string_registry, _utils, _debug, _glimmer) {
36220
35651
  "use strict";
@@ -56220,7 +55651,7 @@ define("ember/version", ["exports"], function (_exports) {
56220
55651
  value: true
56221
55652
  });
56222
55653
  _exports.default = void 0;
56223
- var _default = "4.3.0-alpha.4";
55654
+ var _default = "4.3.0-beta.1";
56224
55655
  _exports.default = _default;
56225
55656
  });
56226
55657
  define("route-recognizer", ["exports"], function (_exports) {
@@ -57187,18 +56618,25 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
57187
56618
  if (len && len > 0) {
57188
56619
  var obj = array[len - 1];
57189
56620
 
57190
- if (isQueryParams(obj)) {
56621
+ if (isQueryParamsContainer(obj)) {
57191
56622
  queryParams = obj.queryParams;
57192
56623
  head = slice.call(array, 0, len - 1);
57193
56624
  return [head, queryParams];
57194
56625
  }
57195
- }
56626
+ } // SAFETY: We confirmed that the last item isn't a QP container
56627
+
57196
56628
 
57197
56629
  return [array, null];
57198
- }
56630
+ } // TODO: Actually check that Dict is QueryParams
56631
+
57199
56632
 
57200
- function isQueryParams(obj) {
57201
- return obj && hasOwnProperty.call(obj, 'queryParams');
56633
+ function isQueryParamsContainer(obj) {
56634
+ if (obj && typeof obj === 'object') {
56635
+ var cast = obj;
56636
+ return 'queryParams' in cast && Object.keys(cast.queryParams).every(k => typeof k === 'string');
56637
+ }
56638
+
56639
+ return false;
57202
56640
  }
57203
56641
  /**
57204
56642
  @private
@@ -57717,14 +57155,16 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
57717
57155
  paramNames,
57718
57156
  context,
57719
57157
  route
57720
- } = info;
57158
+ } = info; // SAFETY: This should be safe since it is just for use as a key
57159
+
57160
+ var key = info;
57721
57161
 
57722
- if (ROUTE_INFOS.has(info) && includeAttributes) {
57723
- var _routeInfo = ROUTE_INFOS.get(info);
57162
+ if (ROUTE_INFOS.has(key) && includeAttributes) {
57163
+ var _routeInfo = ROUTE_INFOS.get(key);
57724
57164
 
57725
57165
  _routeInfo = attachMetadata(route, _routeInfo);
57726
57166
  var routeInfoWithAttribute = createRouteInfoWithAttributes(_routeInfo, context);
57727
- ROUTE_INFOS.set(info, routeInfoWithAttribute);
57167
+ ROUTE_INFOS.set(key, routeInfoWithAttribute);
57728
57168
  return routeInfoWithAttribute;
57729
57169
  }
57730
57170
 
@@ -57734,10 +57174,12 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
57734
57174
  var arr = [];
57735
57175
 
57736
57176
  if (predicate.length === 3) {
57737
- arr = routeInfos.map(info => ROUTE_INFOS.get(info));
57177
+ arr = routeInfos.map( // SAFETY: This should be safe since it is just for use as a key
57178
+ info => ROUTE_INFOS.get(info));
57738
57179
  }
57739
57180
 
57740
57181
  for (var _i = 0; routeInfos.length > _i; _i++) {
57182
+ // SAFETY: This should be safe since it is just for use as a key
57741
57183
  publicInfo = ROUTE_INFOS.get(routeInfos[_i]);
57742
57184
 
57743
57185
  if (predicate.call(thisArg, publicInfo, _i, arr)) {
@@ -57765,7 +57207,8 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
57765
57207
 
57766
57208
  if (parent === undefined) {
57767
57209
  return null;
57768
- }
57210
+ } // SAFETY: This should be safe since it is just for use as a key
57211
+
57769
57212
 
57770
57213
  return ROUTE_INFOS.get(parent);
57771
57214
  },
@@ -57775,7 +57218,8 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
57775
57218
 
57776
57219
  if (child === undefined) {
57777
57220
  return null;
57778
- }
57221
+ } // SAFETY: This should be safe since it is just for use as a key
57222
+
57779
57223
 
57780
57224
  return ROUTE_INFOS.get(child);
57781
57225
  },
@@ -57797,7 +57241,8 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
57797
57241
 
57798
57242
  if (includeAttributes) {
57799
57243
  routeInfo = createRouteInfoWithAttributes(routeInfo, context);
57800
- }
57244
+ } // SAFETY: This should be safe since it is just for use as a key
57245
+
57801
57246
 
57802
57247
  ROUTE_INFOS.set(info, routeInfo);
57803
57248
  return routeInfo;
@@ -57889,13 +57334,15 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
57889
57334
 
57890
57335
  if ('context' in this || !contextsMatch) {
57891
57336
  context = resolvedContext;
57892
- }
57337
+ } // SAFETY: Since this is just for lookup, it should be safe
57338
+
57893
57339
 
57894
57340
  var cached = ROUTE_INFOS.get(this);
57895
57341
  var resolved = new ResolvedRouteInfo(this.router, this.name, this.paramNames, params, this.route, context);
57896
57342
 
57897
57343
  if (cached !== undefined) {
57898
- ROUTE_INFOS.set(resolved, cached);
57344
+ // SAFETY: This is potentially a bit risker, but for what we're doing, it should be ok.
57345
+ ROUTE_INFOS.set(this, cached);
57899
57346
  }
57900
57347
 
57901
57348
  return resolved;
@@ -57993,12 +57440,14 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
57993
57440
  // Ignore the fulfilled value returned from afterModel.
57994
57441
  // Return the value stashed in resolvedModels, which
57995
57442
  // might have been swapped out in afterModel.
57443
+ // SAFTEY: We expect this to be of type T, though typing it as such is challenging.
57996
57444
  return transition.resolvedModels[name];
57997
57445
  });
57998
57446
  }
57999
57447
 
58000
57448
  stashResolvedModel(transition, resolvedModel) {
58001
- transition.resolvedModels = transition.resolvedModels || {};
57449
+ transition.resolvedModels = transition.resolvedModels || {}; // SAFETY: It's unfortunate that we have to do this cast. It should be safe though.
57450
+
58002
57451
  transition.resolvedModels[this.name] = resolvedModel;
58003
57452
  }
58004
57453
 
@@ -58052,7 +57501,10 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
58052
57501
  constructor(router, name, paramNames, params, route) {
58053
57502
  super(router, name, paramNames, route);
58054
57503
  this.params = {};
58055
- this.params = params;
57504
+
57505
+ if (params) {
57506
+ this.params = params;
57507
+ }
58056
57508
  }
58057
57509
 
58058
57510
  getModel(transition) {
@@ -58065,7 +57517,7 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
58065
57517
  }
58066
57518
 
58067
57519
  var route = this.route;
58068
- var result;
57520
+ var result; // FIXME: Review these casts
58069
57521
 
58070
57522
  if (route.deserialize) {
58071
57523
  result = route.deserialize(fullParams, transition);
@@ -58112,6 +57564,8 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
58112
57564
  } = this;
58113
57565
 
58114
57566
  if (!model) {
57567
+ // SAFETY: By the time we serialize, we expect to be resolved.
57568
+ // This may not be an entirely safe assumption though no tests fail.
58115
57569
  model = context;
58116
57570
  }
58117
57571
 
@@ -58139,6 +57593,7 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
58139
57593
  var name = paramNames[0];
58140
57594
 
58141
57595
  if (/_id$/.test(name)) {
57596
+ // SAFETY: Model is supposed to extend IModel already
58142
57597
  object[name] = model.id;
58143
57598
  } else {
58144
57599
  object[name] = model;
@@ -58150,14 +57605,14 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
58150
57605
  }
58151
57606
 
58152
57607
  function paramsMatch(a, b) {
58153
- if (!a !== !b) {
58154
- // Only one is null.
58155
- return false;
57608
+ if (a === b) {
57609
+ // Both are identical, may both be undefined
57610
+ return true;
58156
57611
  }
58157
57612
 
58158
- if (!a) {
58159
- // Both must be null.
58160
- return true;
57613
+ if (!a || !b) {
57614
+ // Only one is undefined, already checked they aren't identical
57615
+ return false;
58161
57616
  } // Note: this assumes that both params have the same
58162
57617
  // number of keys, but since we're comparing the
58163
57618
  // same routes, they should.
@@ -58201,7 +57656,8 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
58201
57656
  }
58202
57657
 
58203
57658
  var routeInfo = currentState.routeInfos[transition.resolveIndex];
58204
- return routeInfo.resolve(transition).then(proceed.bind(null, currentState, transition), null, currentState.promiseLabel('Proceed'));
57659
+ var callback = proceed.bind(null, currentState, transition);
57660
+ return routeInfo.resolve(transition).then(callback, null, currentState.promiseLabel('Proceed'));
58205
57661
  }
58206
57662
 
58207
57663
  function proceed(currentState, transition, resolvedRouteInfo) {
@@ -58260,9 +57716,11 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
58260
57716
  params[routeInfo.name] = routeInfo.params || {};
58261
57717
  return true;
58262
57718
  });
58263
- transition.resolveIndex = 0; // The prelude RSVP.resolve() async moves us into the promise land.
57719
+ transition.resolveIndex = 0;
57720
+ var callback = resolveOneRouteInfo.bind(null, this, transition);
57721
+ var errorHandler = handleError.bind(null, this, transition); // The prelude RSVP.resolve() async moves us into the promise land.
58264
57722
 
58265
- return _rsvp.Promise.resolve(null, this.promiseLabel('Start transition')).then(resolveOneRouteInfo.bind(null, this, transition), null, this.promiseLabel('Resolve route')).catch(handleError.bind(null, this, transition), this.promiseLabel('Handle error')).then(() => this);
57723
+ return _rsvp.Promise.resolve(null, this.promiseLabel('Start transition')).then(callback, null, this.promiseLabel('Resolve route')).catch(errorHandler, this.promiseLabel('Handle error')).then(() => this);
58266
57724
  }
58267
57725
 
58268
57726
  }
@@ -58300,10 +57758,7 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
58300
57758
  }
58301
57759
 
58302
57760
  applyToState(oldState, isIntermediate) {
58303
- // TODO: WTF fix me
58304
- var partitionedArgs = extractQueryParams([this.name].concat(this.contexts)),
58305
- pureArgs = partitionedArgs[0],
58306
- handlers = this.router.recognizer.handlersFor(pureArgs[0]);
57761
+ var handlers = this.router.recognizer.handlersFor(this.name);
58307
57762
  var targetRouteName = handlers[handlers.length - 1].handler;
58308
57763
  return this.applyToHandlers(oldState, handlers, targetRouteName, isIntermediate, false);
58309
57764
  }
@@ -58347,7 +57802,8 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
58347
57802
  // If we're performing an isActive check, we want to
58348
57803
  // serialize URL params with the provided context, but
58349
57804
  // ignore mismatches between old and new context.
58350
- newHandlerInfo = newHandlerInfo.becomeResolved(null, newHandlerInfo.context);
57805
+ newHandlerInfo = newHandlerInfo.becomeResolved(null, // SAFETY: This seems to imply that it would be resolved, but it's unclear if that's actually the case.
57806
+ newHandlerInfo.context);
58351
57807
  var oldContext = oldHandlerInfo && oldHandlerInfo.context;
58352
57808
 
58353
57809
  if (result.names.length > 0 && oldHandlerInfo.context !== undefined && newHandlerInfo.context === oldContext) {
@@ -58368,7 +57824,8 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
58368
57824
  }
58369
57825
 
58370
57826
  if (isIntermediate && !checkingIfActive) {
58371
- handlerToUse = handlerToUse.becomeResolved(null, handlerToUse.context);
57827
+ handlerToUse = handlerToUse.becomeResolved(null, // SAFETY: This seems to imply that it would be resolved, but it's unclear if that's actually the case.
57828
+ handlerToUse.context);
58372
57829
  }
58373
57830
 
58374
57831
  newState.routeInfos.unshift(handlerToUse);
@@ -58425,7 +57882,7 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
58425
57882
  } else {
58426
57883
  if (this.preTransitionState) {
58427
57884
  var preTransitionHandlerInfo = this.preTransitionState.routeInfos[i];
58428
- objectToUse = preTransitionHandlerInfo && preTransitionHandlerInfo.context;
57885
+ objectToUse = preTransitionHandlerInfo === null || preTransitionHandlerInfo === void 0 ? void 0 : preTransitionHandlerInfo.context;
58429
57886
  } else {
58430
57887
  // Ideally we should throw this error to provide maximal
58431
57888
  // information to the user that not enough context objects
@@ -58690,7 +58147,8 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
58690
58147
  if (queryParamChangelist) {
58691
58148
  var _newTransition = this.queryParamsTransition(queryParamChangelist, wasTransitioning, oldState, newState);
58692
58149
 
58693
- _newTransition.queryParamsOnly = true;
58150
+ _newTransition.queryParamsOnly = true; // SAFETY: The returned OpaqueTransition should actually be this.
58151
+
58694
58152
  return _newTransition;
58695
58153
  } // No-op. No need to create a new transition.
58696
58154
 
@@ -58760,6 +58218,8 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
58760
58218
  var queryParams = {};
58761
58219
 
58762
58220
  if (lastArg !== undefined && lastArg.hasOwnProperty('queryParams')) {
58221
+ // We just checked this.
58222
+ // TODO: Use an assertion?
58763
58223
  queryParams = modelsArray.pop().queryParams;
58764
58224
  }
58765
58225
 
@@ -58778,7 +58238,8 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
58778
58238
  intent = new URLTransitionIntent(this, name);
58779
58239
  } else {
58780
58240
  log(this, 'Attempting transition to ' + name);
58781
- intent = new NamedTransitionIntent(this, name, undefined, modelsArray, queryParams);
58241
+ intent = new NamedTransitionIntent(this, name, undefined, // SAFETY: We know this to be the case since we removed the last item if it was QPs
58242
+ modelsArray, queryParams);
58782
58243
  }
58783
58244
 
58784
58245
  return this.transitionByIntent(intent, isIntermediate);
@@ -59400,8 +58861,8 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
59400
58861
  args[_key6 - 1] = arguments[_key6];
59401
58862
  }
59402
58863
 
59403
- var partitionedArgs = extractQueryParams(args);
59404
- return this.isActiveIntent(routeName, partitionedArgs[0], partitionedArgs[1]);
58864
+ var [contexts, queryParams] = extractQueryParams(args);
58865
+ return this.isActiveIntent(routeName, contexts, queryParams);
59405
58866
  }
59406
58867
 
59407
58868
  trigger(name) {
@@ -59420,6 +58881,7 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
59420
58881
  }
59421
58882
 
59422
58883
  for (var i = 0, len = routeInfos.length; i < len; ++i) {
58884
+ // SAFETY: Just casting for comparison
59423
58885
  if (routeInfos[i] !== otherRouteInfos[i]) {
59424
58886
  return false;
59425
58887
  }
@@ -59447,10 +58909,13 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
59447
58909
  }
59448
58910
 
59449
58911
  function paramsEqual(params, otherParams) {
59450
- if (!params && !otherParams) {
58912
+ if (params === otherParams) {
58913
+ // Both identical or both undefined
59451
58914
  return true;
59452
- } else if (!params && !!otherParams || !!params && !otherParams) {
59453
- // one is falsy but other is not;
58915
+ }
58916
+
58917
+ if (!params || !otherParams) {
58918
+ // One is falsy but other is not
59454
58919
  return false;
59455
58920
  }
59456
58921