<commit_before>import { Evented } from '@ember/-internals/runtime';
import { assert } from '@ember/debug';
import { readOnly } from '@ember/object/computed';
import Service from '@ember/service';
import { DEBUG } from '@glimmer/env';
import { Transition } from 'router_js';
import EmberRouter from '../system/router';
import { extractRouteArgs, resemblesURL, shallowEqual } from '../utils';

let freezeRouteInfo: Function;
if (DEBUG) {
  freezeRouteInfo = (transition: Transition) => {
    if (transition.from !== null && !Object.isFrozen(transition.from)) {
      Object.freeze(transition.from);
    }

    if (transition.to !== null && !Object.isFrozen(transition.to)) {
      Object.freeze(transition.to);
    }
  };
}

function cleanURL(url: string, rootURL: string) {
  if (rootURL === '/') {
    return url;
  }

  return url.substr(rootURL.length, url.length);
}

/**
   The Router service is the public API that provides access to the router.

   The immediate benefit of the Router service is that you can inject it into components,
   giving them a friendly way to initiate transitions and ask questions about the current
   global router state.

   In this example, the Router service is injected into a component to initiate a transition
   to a dedicated route:
   ```javascript
   import Component from '@ember/component';
   import { inject as service } from '@ember/service';

   export default Component.extend({
     router: service(),

     actions: {
       next() {
         this.get('router').transitionTo('other.route');
       }
     }
   });
   ```
<commit_msg>Bring release branch change to master (#18027)<commit_after>import { Evented } from '@ember/-internals/runtime';
import { assert } from '@ember/debug';
import { readOnly } from '@ember/object/computed';
import Service from '@ember/service';
import { DEBUG } from '@glimmer/env';
import { Transition } from 'router_js';
import EmberRouter from '../system/router';
import { extractRouteArgs, resemblesURL, shallowEqual } from '../utils';

let freezeRouteInfo: Function;
if (DEBUG) {
  freezeRouteInfo = (transition: Transition) => {
    if (transition.from !== null && !Object.isFrozen(transition.from)) {
      Object.freeze(transition.from);
    }

    if (transition.to !== null && !Object.isFrozen(transition.to)) {
      Object.freeze(transition.to);
    }
  };
}

function cleanURL(url: string, rootURL: string) {
  if (rootURL === '/') {
    return url;
  }

  return url.substr(rootURL.length, url.length);
}

/**
   The Router service is the public API that provides access to the router.

   The immediate benefit of the Router service is that you can inject it into components,
   giving them a friendly way to initiate transitions and ask questions about the current
   global router state.

   In this example, the Router service is injected into a component to initiate a transition
   to a dedicated route:
   ```javascript
   import Component from '@ember/component';
   import { inject as service } from '@ember/service';

   export default Component.extend({
     router: service(),

     actions: {
       next() {
         this.router.transitionTo('other.route');
       }
     }
   });
   ```

{'fraction_non_alphanumeric': 0.12226391494684177, 'fraction_numerical': 0.0015634771732332708, 'mean_word_length': 3.5119887165021155, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4438547', 'n_tokens_mistral': 909, 'n_tokens_neox': 878, 'n_words': 300}