{"version":3,"file":"cdk-bidi.umd.js","sources":["cdk/bidi.es5.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 { Directive, EventEmitter, Inject, Injectable, InjectionToken, Input, NgModule, Optional, Output, SkipSelf } from '@angular/core';\nimport { DOCUMENT } from '@angular/platform-browser';\n\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 */\nvar 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}());\n/**\n * \\@docs-private\n * @param {?} parentDirectionality\n * @param {?} _document\n * @return {?}\n */\nfunction DIRECTIONALITY_PROVIDER_FACTORY(parentDirectionality, _document) {\n return parentDirectionality || new Directionality(_document);\n}\n/**\n * \\@docs-private\n */\nvar 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\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}());\n\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}());\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { Directionality, DIRECTIONALITY_PROVIDER_FACTORY, DIRECTIONALITY_PROVIDER, DIR_DOCUMENT, Dir, BidiModule };\n//# sourceMappingURL=bidi.es5.js.map\n"],"names":["InjectionToken","EventEmitter","Injectable","Optional","Inject","SkipSelf","DOCUMENT","Directive","Output","Input","NgModule"],"mappings":";;;;;;;;;;;;;AAUA;;;;;;;;;;AAUA,IAAI,YAAY,GAAG,IAAIA,4BAAc,CAAC,aAAa,CAAC,CAAC;;;;;AAKrD,IAAI,cAAc,IAAI,YAAY;;;;IAI9B,SAAS,cAAc,CAAC,SAAS,EAAE;QAC/B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,IAAIC,0BAAY,EAAE,CAAC;QACjC,IAAI,SAAS,EAAE;;;;;YAKX,IAAI,OAAO,GAAG,SAAS,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;YACzD,IAAI,OAAO,GAAG,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,eAAe,CAAC,GAAG,GAAG,IAAI,CAAC;YAC/E,IAAI,CAAC,KAAK,IAAI,OAAO,IAAI,OAAO,IAAI,KAAK,CAAC,CAAC;SAC9C;KACJ;IACD,cAAc,CAAC,UAAU,GAAG;QACxB,EAAE,IAAI,EAAEC,wBAAU,EAAE;KACvB,CAAC;;;;IAIF,cAAc,CAAC,cAAc,GAAG,YAAY,EAAE,OAAO;QACjD,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC,EAAE,IAAI,EAAEC,sBAAQ,EAAE,EAAE,EAAE,IAAI,EAAEC,oBAAM,EAAE,IAAI,EAAE,CAAC,YAAY,EAAE,EAAE,EAAE,EAAE;KAClG,CAAC,EAAE,CAAC;IACL,OAAO,cAAc,CAAC;CACzB,EAAE,CAAC,CAAC;;;;;;;AAOL,SAAS,+BAA+B,CAAC,oBAAoB,E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