{"version":3,"file":"bidi.es5.js","sources":["../../packages/cdk/esm5/bidi/directionality.js","../../packages/cdk/esm5/bidi/dir.js","../../packages/cdk/esm5/bidi/bidi-module.js","../../packages/cdk/esm5/bidi/index.js"],"sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { EventEmitter, Injectable, Optional, SkipSelf, Inject, InjectionToken, } from '@angular/core';\nimport { DOCUMENT } from '@angular/platform-browser';\n/**\n * Injection token used to inject the document into Directionality.\n * This is used so that the value can be faked in tests.\n *\n * We can't use the real document in tests because changing the real `dir` causes geometry-based\n * tests in Safari to fail.\n *\n * We also can't re-provide the DOCUMENT token from platform-brower because the unit tests\n * themselves use things like `querySelector` in test code.\n */\nexport var DIR_DOCUMENT = new InjectionToken('mat-dir-doc');\n/**\n * The directionality (LTR / RTL) context for the application (or a subtree of it).\n * Exposes the current direction and a stream of direction changes.\n */\nvar Directionality = (function () {\n /**\n * @param {?=} _document\n */\n function Directionality(_document) {\n this.value = 'ltr';\n this.change = new EventEmitter();\n if (_document) {\n // TODO: handle 'auto' value -\n // We still need to account for dir=\"auto\".\n // It looks like HTMLElemenet.dir is also \"auto\" when that's set to the attribute,\n // but getComputedStyle return either \"ltr\" or \"rtl\". avoiding getComputedStyle for now\n var bodyDir = _document.body ? _document.body.dir : null;\n var htmlDir = _document.documentElement ? _document.documentElement.dir : null;\n this.value = (bodyDir || htmlDir || 'ltr');\n }\n }\n Directionality.decorators = [\n { type: Injectable },\n ];\n /**\n * @nocollapse\n */\n Directionality.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [DIR_DOCUMENT,] },] },\n ]; };\n return Directionality;\n}());\nexport { Directionality };\nfunction Directionality_tsickle_Closure_declarations() {\n /** @type {?} */\n Directionality.decorators;\n /**\n * @nocollapse\n * @type {?}\n */\n Directionality.ctorParameters;\n /** @type {?} */\n Directionality.prototype.value;\n /** @type {?} */\n Directionality.prototype.change;\n}\n/**\n * \\@docs-private\n * @param {?} parentDirectionality\n * @param {?} _document\n * @return {?}\n */\nexport function DIRECTIONALITY_PROVIDER_FACTORY(parentDirectionality, _document) {\n return parentDirectionality || new Directionality(_document);\n}\n/**\n * \\@docs-private\n */\nexport var DIRECTIONALITY_PROVIDER = {\n // If there is already a Directionality available, use that. Otherwise, provide a new one.\n provide: Directionality,\n deps: [[new Optional(), new SkipSelf(), Directionality], [new Optional(), DOCUMENT]],\n useFactory: DIRECTIONALITY_PROVIDER_FACTORY\n};\n//# sourceMappingURL=directionality.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { Directive, Output, Input, EventEmitter } from '@angular/core';\nimport { Directionality } from './directionality';\n/**\n * Directive to listen for changes of direction of part of the DOM.\n *\n * Would provide itself in case a component looks for the Directionality service\n */\nvar Dir = (function () {\n function Dir() {\n /**\n * Layout direction of the element.\n */\n this._dir = 'ltr';\n /**\n * Whether the `value` has been set to its initial value.\n */\n this._isInitialized = false;\n /**\n * Event emitted when the direction changes.\n */\n this.change = new EventEmitter();\n }\n Object.defineProperty(Dir.prototype, \"dir\", {\n /**\n * \\@docs-private\n * @return {?}\n */\n get: function () {\n return this._dir;\n },\n /**\n * @param {?} v\n * @return {?}\n */\n set: function (v) {\n var /** @type {?} */ old = this._dir;\n this._dir = v;\n if (old !== this._dir && this._isInitialized) {\n this.change.emit();\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Dir.prototype, \"value\", {\n /**\n * Current layout direction of the element.\n * @return {?}\n */\n get: function () { return this.dir; },\n enumerable: true,\n configurable: true\n });\n /**\n * Initialize once default value has been set.\n * @return {?}\n */\n Dir.prototype.ngAfterContentInit = function () {\n this._isInitialized = true;\n };\n Dir.decorators = [\n { type: Directive, args: [{\n selector: '[dir]',\n providers: [{ provide: Directionality, useExisting: Dir }],\n host: { '[dir]': 'dir' },\n exportAs: 'dir',\n },] },\n ];\n /**\n * @nocollapse\n */\n Dir.ctorParameters = function () { return []; };\n Dir.propDecorators = {\n 'change': [{ type: Output, args: ['dirChange',] },],\n 'dir': [{ type: Input, args: ['dir',] },],\n };\n return Dir;\n}());\nexport { Dir };\nfunction Dir_tsickle_Closure_declarations() {\n /** @type {?} */\n Dir.decorators;\n /**\n * @nocollapse\n * @type {?}\n */\n Dir.ctorParameters;\n /** @type {?} */\n Dir.propDecorators;\n /**\n * Layout direction of the element.\n * @type {?}\n */\n Dir.prototype._dir;\n /**\n * Whether the `value` has been set to its initial value.\n * @type {?}\n */\n Dir.prototype._isInitialized;\n /**\n * Event emitted when the direction changes.\n * @type {?}\n */\n Dir.prototype.change;\n}\n//# sourceMappingURL=dir.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { NgModule } from '@angular/core';\nimport { DOCUMENT } from '@angular/platform-browser';\nimport { Dir } from './dir';\nimport { DIR_DOCUMENT, Directionality } from './directionality';\nvar BidiModule = (function () {\n function BidiModule() {\n }\n BidiModule.decorators = [\n { type: NgModule, args: [{\n exports: [Dir],\n declarations: [Dir],\n providers: [\n { provide: DIR_DOCUMENT, useExisting: DOCUMENT },\n Directionality,\n ]\n },] },\n ];\n /**\n * @nocollapse\n */\n BidiModule.ctorParameters = function () { return []; };\n return BidiModule;\n}());\nexport { BidiModule };\nfunction BidiModule_tsickle_Closure_declarations() {\n /** @type {?} */\n BidiModule.decorators;\n /**\n * @nocollapse\n * @type {?}\n */\n BidiModule.ctorParameters;\n}\n//# sourceMappingURL=bidi-module.js.map","/**\n * Generated bundle index. Do not edit.\n */\nexport { Directionality, DIRECTIONALITY_PROVIDER_FACTORY, DIRECTIONALITY_PROVIDER, DIR_DOCUMENT, Dir, BidiModule } from './public-api';\n//# sourceMappingURL=index.js.map"],"names":[],"mapp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