{"version":3,"file":"platform.js","sources":["../../packages/cdk/platform/platform.js","../../packages/cdk/platform/features.js","../../packages/cdk/platform/platform-module.js","../../packages/cdk/platform/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 { Injectable } from '@angular/core';\n// Whether the current platform supports the V8 Break Iterator. The V8 check\n// is necessary to detect all Blink based browsers.\nconst /** @type {?} */ hasV8BreakIterator = (typeof (Intl) !== 'undefined' && ((Intl)).v8BreakIterator);\n/**\n * Service to detect the current platform by comparing the userAgent strings and\n * checking browser-specific global properties.\n * \\@docs-private\n */\nexport class Platform {\n constructor() {\n this.isBrowser = typeof document === 'object' && !!document;\n /**\n * Layout Engines\n */\n this.EDGE = this.isBrowser && /(edge)/i.test(navigator.userAgent);\n this.TRIDENT = this.isBrowser && /(msie|trident)/i.test(navigator.userAgent);\n // EdgeHTML and Trident mock Blink specific things and need to be excluded from this check.\n this.BLINK = this.isBrowser &&\n (!!(((window)).chrome || hasV8BreakIterator) && !!CSS && !this.EDGE && !this.TRIDENT);\n // Webkit is part of the userAgent in EdgeHTML, Blink and Trident. Therefore we need to\n // ensure that Webkit runs standalone and is not used as another engine's base.\n this.WEBKIT = this.isBrowser &&\n /AppleWebKit/i.test(navigator.userAgent) && !this.BLINK && !this.EDGE && !this.TRIDENT;\n /**\n * Browsers and Platform Types\n */\n this.IOS = this.isBrowser && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;\n // It's difficult to detect the plain Gecko engine, because most of the browsers identify\n // them self as Gecko-like browsers and modify the userAgent's according to that.\n // Since we only cover one explicit Firefox case, we can simply check for Firefox\n // instead of having an unstable check for Gecko.\n this.FIREFOX = this.isBrowser && /(firefox|minefield)/i.test(navigator.userAgent);\n // Trident on mobile adds the android platform to the userAgent to trick detections.\n this.ANDROID = this.isBrowser && /android/i.test(navigator.userAgent) && !this.TRIDENT;\n // Safari browsers will include the Safari keyword in their userAgent. Some browsers may fake\n // this and just place the Safari keyword in the userAgent. To be more safe about Safari every\n // Safari browser should also use Webkit as its layout engine.\n this.SAFARI = this.isBrowser && /safari/i.test(navigator.userAgent) && this.WEBKIT;\n }\n}\nPlatform.decorators = [\n { type: Injectable },\n];\n/**\n * @nocollapse\n */\nPlatform.ctorParameters = () => [];\nfunction Platform_tsickle_Closure_declarations() {\n /** @type {?} */\n Platform.decorators;\n /**\n * @nocollapse\n * @type {?}\n */\n Platform.ctorParameters;\n /** @type {?} */\n Platform.prototype.isBrowser;\n /**\n * Layout Engines\n * @type {?}\n */\n Platform.prototype.EDGE;\n /** @type {?} */\n Platform.prototype.TRIDENT;\n /** @type {?} */\n Platform.prototype.BLINK;\n /** @type {?} */\n Platform.prototype.WEBKIT;\n /**\n * Browsers and Platform Types\n * @type {?}\n */\n Platform.prototype.IOS;\n /** @type {?} */\n Platform.prototype.FIREFOX;\n /** @type {?} */\n Platform.prototype.ANDROID;\n /** @type {?} */\n Platform.prototype.SAFARI;\n}\n//# sourceMappingURL=platform.js.map","/**\n * Cached result Set of input types support by the current browser.\n */\nlet supportedInputTypes;\n/**\n * Types of that *might* be supported.\n */\nconst candidateInputTypes = [\n // `color` must come first. Chrome 56 shows a warning if we change the type to `color` after\n // first changing it to something else:\n // The specified value \"\" does not conform to the required format.\n // The format is \"#rrggbb\" where rr, gg, bb are two-digit hexadecimal numbers.\n 'color',\n 'button',\n 'checkbox',\n 'date',\n 'datetime-local',\n 'email',\n 'file',\n 'hidden',\n 'image',\n 'month',\n 'number',\n 'password',\n 'radio',\n 'range',\n 'reset',\n 'search',\n 'submit',\n 'tel',\n 'text',\n 'time',\n 'url',\n 'week',\n];\n/**\n * @return {?} The input types supported by this browser.\n */\nexport function getSupportedInputTypes() {\n // Result is cached.\n if (supportedInputTypes) {\n return supportedInputTypes;\n }\n // We can't check if an input type is not supported until we're on the browser, so say that\n // everything is supported when not on the browser. We don't use `Platform` here since it's\n // just a helper function and can't inject it.\n if (typeof document !== 'object' || !document) {\n supportedInputTypes = new Set(candidateInputTypes);\n return supportedInputTypes;\n }\n let /** @type {?} */ featureTestInput = document.createElement('input');\n supportedInputTypes = new Set(candidateInputTypes.filter(value => {\n featureTestInput.setAttribute('type', value);\n return featureTestInput.type === value;\n }));\n return supportedInputTypes;\n}\n//# sourceMappingURL=features.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 { Platform } from './platform';\nexport class PlatformModule {\n}\nPlatformModule.decorators = [\n { type: NgModule, args: [{\n providers: [Platform]\n },] },\n];\n/**\n * @nocollapse\n */\nPlatformModule.ctorParameters = () => [];\nfunction PlatformModule_tsickle_Closure_declarations() {\n /** @type {?} */\n PlatformModule.decorators;\n /**\n * @nocollapse\n * @type {?}\n */\n PlatformModule.ctorParameters;\n}\n//# sourceMappingURL=platform-module.js.map","/**\n * Generated bundle index. Do not edit.\n */\nexport { Platform, getSupportedInputTypes, PlatformModule } from './public-api';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;;;;;AAQA;;AAEA,MAAuB,kBAAkB,IAAI,QAAQ,IAAI,CAAC,KAAK,WAAW,IAAI,EAAE,IAAI,GAAG,eAAe,CAAC,CAAC;;;;;;AAMxG,AAAO,MAAM,QAAQ,CAAC;IAClB,WAAW,GAAG;QACV,IAAI,CAAC,SAAS,GAAG,OAAO,QAAQ,KAAK,QAAQ,IAAI,CAAC,CAAC,QAAQ,CAAC;;;;QAI5D,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;QAClE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,SAAS,IAAI,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;;QAE7E,IAAI,CAAC,KAAK,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