/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import { DOCUMENT } from '@angular/common'; import { inject, InjectionToken } from '@angular/core'; /** * Injection token used to inject the document into Directionality. * This is used so that the value can be faked in tests. * * We can't use the real document in tests because changing the real `dir` causes geometry-based * tests in Safari to fail. * * We also can't re-provide the DOCUMENT token from platform-browser because the unit tests * themselves use things like `querySelector` in test code. * * This token is defined in a separate file from Directionality as a workaround for * https://github.com/angular/angular/issues/22559 * * @docs-private */ export const DIR_DOCUMENT = new InjectionToken('cdk-dir-doc', { providedIn: 'root', factory: DIR_DOCUMENT_FACTORY, }); /** @docs-private */ export function DIR_DOCUMENT_FACTORY() { return inject(DOCUMENT); } //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGlyLWRvY3VtZW50LXRva2VuLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL2Nkay9iaWRpL2Rpci1kb2N1bWVudC10b2tlbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7O0dBTUc7QUFFSCxPQUFPLEVBQUMsUUFBUSxFQUFDLE1BQU0saUJBQWlCLENBQUM7QUFDekMsT0FBTyxFQUFDLE1BQU0sRUFBRSxjQUFjLEVBQUMsTUFBTSxlQUFlLENBQUM7QUFFckQ7Ozs7Ozs7Ozs7Ozs7O0dBY0c7QUFDSCxNQUFNLENBQUMsTUFBTSxZQUFZLEdBQUcsSUFBSSxjQUFjLENBQVcsYUFBYSxFQUFFO0lBQ3RFLFVBQVUsRUFBRSxNQUFNO0lBQ2xCLE9BQU8sRUFBRSxvQkFBb0I7Q0FDOUIsQ0FBQyxDQUFDO0FBRUgsb0JBQW9CO0FBQ3BCLE1BQU0sVUFBVSxvQkFBb0I7SUFDbEMsT0FBTyxNQUFNLENBQUMsUUFBUSxDQUFDLENBQUM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