material-components-web.js.map 1.1 MB

1
  1. {"version":3,"sources":["webpack://mdc/webpack/universalModuleDefinition","webpack://mdc/webpack/bootstrap","webpack://mdc/./packages/material-components-web/index.ts","webpack://mdc/./packages/mdc-animation/animationframe.ts","webpack://mdc/./packages/mdc-animation/util.ts","webpack://mdc/./packages/mdc-auto-init/constants.ts","webpack://mdc/./packages/mdc-auto-init/index.ts","webpack://mdc/./packages/mdc-banner/component.ts","webpack://mdc/./packages/mdc-banner/constants.ts","webpack://mdc/./packages/mdc-banner/foundation.ts","webpack://mdc/./packages/mdc-banner/index.ts","webpack://mdc/./packages/mdc-base/component.ts","webpack://mdc/./packages/mdc-base/foundation.ts","webpack://mdc/./packages/mdc-base/index.ts","webpack://mdc/./packages/mdc-checkbox/component.ts","webpack://mdc/./packages/mdc-checkbox/constants.ts","webpack://mdc/./packages/mdc-checkbox/foundation.ts","webpack://mdc/./packages/mdc-checkbox/index.ts","webpack://mdc/./packages/mdc-chips/chip-set/component.ts","webpack://mdc/./packages/mdc-chips/chip-set/constants.ts","webpack://mdc/./packages/mdc-chips/chip-set/foundation.ts","webpack://mdc/./packages/mdc-chips/chip-set/index.ts","webpack://mdc/./packages/mdc-chips/chip/component.ts","webpack://mdc/./packages/mdc-chips/chip/constants.ts","webpack://mdc/./packages/mdc-chips/chip/foundation.ts","webpack://mdc/./packages/mdc-chips/chip/index.ts","webpack://mdc/./packages/mdc-chips/index.ts","webpack://mdc/./packages/mdc-chips/trailingaction/component.ts","webpack://mdc/./packages/mdc-chips/trailingaction/constants.ts","webpack://mdc/./packages/mdc-chips/trailingaction/foundation.ts","webpack://mdc/./packages/mdc-chips/trailingaction/index.ts","webpack://mdc/./packages/mdc-circular-progress/component.ts","webpack://mdc/./packages/mdc-circular-progress/constants.ts","webpack://mdc/./packages/mdc-circular-progress/foundation.ts","webpack://mdc/./packages/mdc-circular-progress/index.ts","webpack://mdc/./packages/mdc-data-table/component.ts","webpack://mdc/./packages/mdc-data-table/constants.ts","webpack://mdc/./packages/mdc-data-table/foundation.ts","webpack://mdc/./packages/mdc-data-table/index.ts","webpack://mdc/./packages/mdc-dialog/component.ts","webpack://mdc/./packages/mdc-dialog/constants.ts","webpack://mdc/./packages/mdc-dialog/foundation.ts","webpack://mdc/./packages/mdc-dialog/index.ts","webpack://mdc/./packages/mdc-dialog/util.ts","webpack://mdc/./packages/mdc-dom/announce.ts","webpack://mdc/./packages/mdc-dom/events.ts","webpack://mdc/./packages/mdc-dom/focus-trap.ts","webpack://mdc/./packages/mdc-dom/index.ts","webpack://mdc/./packages/mdc-dom/keyboard.ts","webpack://mdc/./packages/mdc-dom/ponyfill.ts","webpack://mdc/./packages/mdc-drawer/component.ts","webpack://mdc/./packages/mdc-drawer/constants.ts","webpack://mdc/./packages/mdc-drawer/dismissible/foundation.ts","webpack://mdc/./packages/mdc-drawer/index.ts","webpack://mdc/./packages/mdc-drawer/modal/foundation.ts","webpack://mdc/./packages/mdc-drawer/util.ts","webpack://mdc/./packages/mdc-floating-label/component.ts","webpack://mdc/./packages/mdc-floating-label/constants.ts","webpack://mdc/./packages/mdc-floating-label/foundation.ts","webpack://mdc/./packages/mdc-floating-label/index.ts","webpack://mdc/./packages/mdc-form-field/component.ts","webpack://mdc/./packages/mdc-form-field/constants.ts","webpack://mdc/./packages/mdc-form-field/foundation.ts","webpack://mdc/./packages/mdc-form-field/index.ts","webpack://mdc/./packages/mdc-icon-button/component.ts","webpack://mdc/./packages/mdc-icon-button/constants.ts","webpack://mdc/./packages/mdc-icon-button/foundation.ts","webpack://mdc/./packages/mdc-icon-button/index.ts","webpack://mdc/./packages/mdc-line-ripple/component.ts","webpack://mdc/./packages/mdc-line-ripple/constants.ts","webpack://mdc/./packages/mdc-line-ripple/foundation.ts","webpack://mdc/./packages/mdc-line-ripple/index.ts","webpack://mdc/./packages/mdc-linear-progress/component.ts","webpack://mdc/./packages/mdc-linear-progress/constants.ts","webpack://mdc/./packages/mdc-linear-progress/foundation.ts","webpack://mdc/./packages/mdc-linear-progress/index.ts","webpack://mdc/./packages/mdc-list/component.ts","webpack://mdc/./packages/mdc-list/constants.ts","webpack://mdc/./packages/mdc-list/events.ts","webpack://mdc/./packages/mdc-list/foundation.ts","webpack://mdc/./packages/mdc-list/index.ts","webpack://mdc/./packages/mdc-list/typeahead.ts","webpack://mdc/./packages/mdc-menu-surface/component.ts","webpack://mdc/./packages/mdc-menu-surface/constants.ts","webpack://mdc/./packages/mdc-menu-surface/foundation.ts","webpack://mdc/./packages/mdc-menu-surface/index.ts","webpack://mdc/./packages/mdc-menu/component.ts","webpack://mdc/./packages/mdc-menu/constants.ts","webpack://mdc/./packages/mdc-menu/foundation.ts","webpack://mdc/./packages/mdc-menu/index.ts","webpack://mdc/./packages/mdc-notched-outline/component.ts","webpack://mdc/./packages/mdc-notched-outline/constants.ts","webpack://mdc/./packages/mdc-notched-outline/foundation.ts","webpack://mdc/./packages/mdc-notched-outline/index.ts","webpack://mdc/./packages/mdc-radio/component.ts","webpack://mdc/./packages/mdc-radio/constants.ts","webpack://mdc/./packages/mdc-radio/foundation.ts","webpack://mdc/./packages/mdc-radio/index.ts","webpack://mdc/./packages/mdc-ripple/component.ts","webpack://mdc/./packages/mdc-ripple/constants.ts","webpack://mdc/./packages/mdc-ripple/foundation.ts","webpack://mdc/./packages/mdc-ripple/index.ts","webpack://mdc/./packages/mdc-ripple/util.ts","webpack://mdc/./packages/mdc-segmented-button/index.ts","webpack://mdc/./packages/mdc-segmented-button/segment/component.ts","webpack://mdc/./packages/mdc-segmented-button/segment/constants.ts","webpack://mdc/./packages/mdc-segmented-button/segment/foundation.ts","webpack://mdc/./packages/mdc-segmented-button/segment/index.ts","webpack://mdc/./packages/mdc-segmented-button/segmented-button/component.ts","webpack://mdc/./packages/mdc-segmented-button/segmented-button/constants.ts","webpack://mdc/./packages/mdc-segmented-button/segmented-button/foundation.ts","webpack://mdc/./packages/mdc-segmented-button/segmented-button/index.ts","webpack://mdc/./packages/mdc-select/component.ts","webpack://mdc/./packages/mdc-select/constants.ts","webpack://mdc/./packages/mdc-select/foundation.ts","webpack://mdc/./packages/mdc-select/helper-text/component.ts","webpack://mdc/./packages/mdc-select/helper-text/constants.ts","webpack://mdc/./packages/mdc-select/helper-text/foundation.ts","webpack://mdc/./packages/mdc-select/helper-text/index.ts","webpack://mdc/./packages/mdc-select/icon/component.ts","webpack://mdc/./packages/mdc-select/icon/constants.ts","webpack://mdc/./packages/mdc-select/icon/foundation.ts","webpack://mdc/./packages/mdc-select/icon/index.ts","webpack://mdc/./packages/mdc-select/index.ts","webpack://mdc/./packages/mdc-slider/component.ts","webpack://mdc/./packages/mdc-slider/constants.ts","webpack://mdc/./packages/mdc-slider/foundation.ts","webpack://mdc/./packages/mdc-slider/index.ts","webpack://mdc/./packages/mdc-slider/types.ts","webpack://mdc/./packages/mdc-snackbar/component.ts","webpack://mdc/./packages/mdc-snackbar/constants.ts","webpack://mdc/./packages/mdc-snackbar/foundation.ts","webpack://mdc/./packages/mdc-snackbar/index.ts","webpack://mdc/./packages/mdc-snackbar/util.ts","webpack://mdc/./packages/mdc-switch/component.ts","webpack://mdc/./packages/mdc-switch/constants.ts","webpack://mdc/./packages/mdc-switch/foundation.ts","webpack://mdc/./packages/mdc-switch/index.ts","webpack://mdc/./packages/mdc-tab-bar/component.ts","webpack://mdc/./packages/mdc-tab-bar/constants.ts","webpack://mdc/./packages/mdc-tab-bar/foundation.ts","webpack://mdc/./packages/mdc-tab-bar/index.ts","webpack://mdc/./packages/mdc-tab-indicator/component.ts","webpack://mdc/./packages/mdc-tab-indicator/constants.ts","webpack://mdc/./packages/mdc-tab-indicator/fading-foundation.ts","webpack://mdc/./packages/mdc-tab-indicator/foundation.ts","webpack://mdc/./packages/mdc-tab-indicator/index.ts","webpack://mdc/./packages/mdc-tab-indicator/sliding-foundation.ts","webpack://mdc/./packages/mdc-tab-scroller/component.ts","webpack://mdc/./packages/mdc-tab-scroller/constants.ts","webpack://mdc/./packages/mdc-tab-scroller/foundation.ts","webpack://mdc/./packages/mdc-tab-scroller/index.ts","webpack://mdc/./packages/mdc-tab-scroller/rtl-default-scroller.ts","webpack://mdc/./packages/mdc-tab-scroller/rtl-negative-scroller.ts","webpack://mdc/./packages/mdc-tab-scroller/rtl-reverse-scroller.ts","webpack://mdc/./packages/mdc-tab-scroller/rtl-scroller.ts","webpack://mdc/./packages/mdc-tab-scroller/util.ts","webpack://mdc/./packages/mdc-tab/component.ts","webpack://mdc/./packages/mdc-tab/constants.ts","webpack://mdc/./packages/mdc-tab/foundation.ts","webpack://mdc/./packages/mdc-tab/index.ts","webpack://mdc/./packages/mdc-textfield/character-counter/component.ts","webpack://mdc/./packages/mdc-textfield/character-counter/constants.ts","webpack://mdc/./packages/mdc-textfield/character-counter/foundation.ts","webpack://mdc/./packages/mdc-textfield/character-counter/index.ts","webpack://mdc/./packages/mdc-textfield/component.ts","webpack://mdc/./packages/mdc-textfield/constants.ts","webpack://mdc/./packages/mdc-textfield/foundation.ts","webpack://mdc/./packages/mdc-textfield/helper-text/component.ts","webpack://mdc/./packages/mdc-textfield/helper-text/constants.ts","webpack://mdc/./packages/mdc-textfield/helper-text/foundation.ts","webpack://mdc/./packages/mdc-textfield/helper-text/index.ts","webpack://mdc/./packages/mdc-textfield/icon/component.ts","webpack://mdc/./packages/mdc-textfield/icon/constants.ts","webpack://mdc/./packages/mdc-textfield/icon/foundation.ts","webpack://mdc/./packages/mdc-textfield/icon/index.ts","webpack://mdc/./packages/mdc-textfield/index.ts","webpack://mdc/./packages/mdc-tooltip/component.ts","webpack://mdc/./packages/mdc-tooltip/constants.ts","webpack://mdc/./packages/mdc-tooltip/foundation.ts","webpack://mdc/./packages/mdc-tooltip/index.ts","webpack://mdc/./packages/mdc-top-app-bar/component.ts","webpack://mdc/./packages/mdc-top-app-bar/constants.ts","webpack://mdc/./packages/mdc-top-app-bar/fixed/foundation.ts","webpack://mdc/./packages/mdc-top-app-bar/foundation.ts","webpack://mdc/./packages/mdc-top-app-bar/index.ts","webpack://mdc/./packages/mdc-top-app-bar/short/foundation.ts","webpack://mdc/./packages/mdc-top-app-bar/standard/foundation.ts"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;;;;;;;;AC7DG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,kDAAiD;AAkE/C,mBAlEK,QAkEG;AAjEV,8CAAiD;AAkE/C,iBAAM;AAjER,4CAA6C;AAkE3C,eAAI;AAjEN,gDAAqD;AAkEnD,mBAAQ;AAjEV,6CAA+C;AAkE7C,gBAAK;AAjEP,wDAAsE;AAkEpE,2BAAgB;AAjElB,iDAAwD;AAkEtD,oBAAS;AAjEX,8CAAiD;AAkE/C,iBAAM;AAjER,2CAA2C;AAkEzC,cAAG;AAjEL,8CAAiD;AAkE/C,iBAAM;AAjER,qDAAgE;AAkE9D,wBAAa;AAjEf,iDAAwD;AAkEtD,oBAAS;AAjEX,kDAA0D;AAkExD,qBAAU;AAjEZ,kDAA0D;AAkExD,qBAAU;AAjEZ,sDAAkE;AAkEhE,yBAAc;AAjEhB,4CAA6C;AAkE3C,eAAI;AAjEN,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AJkC,EAIhC,YAAO,QACZ;AAAC;AAIE;;;AACK,qCAAe,kBAAvB;AACE,YAA0B,uBAAG,CAAK,KAAkB;AACpD,YAA2B,wBAAO,KAAwB,0BAAK;AAC/D,YAA0B,uBAAO,KAAwB,0BAAwB;AACjF,YAAsB,mBAAwB,yBAAyB;AAEtB;AACjD,YAAoB,kBAAE;AAChB,iBAAW,aAAS;AACzB,eAAM;AAC+D;AACpE,gBAAI,CAAK,KAAW,YAAE;AAChB,qBAAW,aAAQ;AACvB,uBAAY;AACb,mBAAM,IAAQ,KAAiB,qBAAyB,sBAAE;AACrD,qBAAiB,mBAAwB;AAC7C,uBAAY;AACb;AACF;AAED,eACF;AAAC;AAIE;;;AACK,qCAAc,iBAAtB;AACE,YAAQ,KAAkB,mBAAE;AACuE;AACJ;AAC7F,gBAAU,SAAO,KAAyB;AAC1C,gBAAQ,KAAI,IAAQ,WAAQ,KAAiB,kBAAE;AACvC,yBAAG,CAAC,YAAO,QAAwB;AAC1C;AAEG,iBAAQ,QAAS,SAAM,OAAQ,SAAS;AAEhD;AAAC;AAKE;;;;AACK,qCAAuB,0BAA/B;AACE,YAAmB,gBAAO,KAAQ,QAAsB;AACxD,YAAQ,KAAiB,qBAAkB,eAAE;AACvC,iBAAW,aAAS;AAE2D;AACb;AACK;AACvE,iBAAwB,2BAAQ,KAAiB,mBAAiB;AAClE,iBAAiB,mBAAiB;AACvC;AACG,aACN;AAAC;AACH,WAAC;AAAA,EAnK2C,aAmK3C;AAnKY,iCAAsB;AAqK8E;AACjH,kBAAsC,uB","file":"material-components-web.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"mdc\"] = factory();\n\telse\n\t\troot[\"mdc\"] = factory();\n})(this, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./packages/material-components-web/index.ts\");\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport autoInit from '@material/auto-init/index';\nimport * as banner from '@material/banner/index';\nimport * as base from '@material/base/index';\nimport * as checkbox from '@material/checkbox/index';\nimport * as chips from '@material/chips/index';\nimport * as circularProgress from '@material/circular-progress/index';\nimport * as dataTable from '@material/data-table/index';\nimport * as dialog from '@material/dialog/index';\nimport * as dom from '@material/dom/index';\nimport * as drawer from '@material/drawer/index';\nimport * as floatingLabel from '@material/floating-label/index';\nimport * as formField from '@material/form-field/index';\nimport * as iconButton from '@material/icon-button/index';\nimport * as lineRipple from '@material/line-ripple/index';\nimport * as linearProgress from '@material/linear-progress/index';\nimport * as list from '@material/list/index';\nimport * as menuSurface from '@material/menu-surface/index';\nimport * as menu from '@material/menu/index';\nimport * as notchedOutline from '@material/notched-outline/index';\nimport * as radio from '@material/radio/index';\nimport * as ripple from '@material/ripple/index';\nimport * as segmentedButton from '@material/segmented-button/index';\nimport * as select from '@material/select/index';\nimport * as slider from '@material/slider/index';\nimport * as snackbar from '@material/snackbar/index';\nimport * as switchControl from '@material/switch/index';\nimport * as tabBar from '@material/tab-bar/index';\nimport * as tabIndicator from '@material/tab-indicator/index';\nimport * as tabScroller from '@material/tab-scroller/index';\nimport * as tab from '@material/tab/index';\nimport * as textField from '@material/textfield/index';\nimport * as tooltip from '@material/tooltip/index';\nimport * as topAppBar from '@material/top-app-bar/index';\n\n// Register all components\nautoInit.register('MDCBanner', banner.MDCBanner);\nautoInit.register('MDCCheckbox', checkbox.MDCCheckbox);\nautoInit.register('MDCChip', chips.MDCChip);\nautoInit.register('MDCChipSet', chips.MDCChipSet);\nautoInit.register('MDCCircularProgress', circularProgress.MDCCircularProgress);\nautoInit.register('MDCDataTable', dataTable.MDCDataTable);\nautoInit.register('MDCDialog', dialog.MDCDialog);\nautoInit.register('MDCDrawer', drawer.MDCDrawer);\nautoInit.register('MDCFloatingLabel', floatingLabel.MDCFloatingLabel);\nautoInit.register('MDCFormField', formField.MDCFormField);\nautoInit.register('MDCIconButtonToggle', iconButton.MDCIconButtonToggle);\nautoInit.register('MDCLineRipple', lineRipple.MDCLineRipple);\nautoInit.register('MDCLinearProgress', linearProgress.MDCLinearProgress);\nautoInit.register('MDCList', list.MDCList);\nautoInit.register('MDCMenu', menu.MDCMenu);\nautoInit.register('MDCMenuSurface', menuSurface.MDCMenuSurface);\nautoInit.register('MDCNotchedOutline', notchedOutline.MDCNotchedOutline);\nautoInit.register('MDCRadio', radio.MDCRadio);\nautoInit.register('MDCRipple', ripple.MDCRipple);\nautoInit.register('MDCSegmentedButton', segmentedButton.MDCSegmentedButton);\nautoInit.register('MDCSelect', select.MDCSelect);\nautoInit.register('MDCSlider', slider.MDCSlider);\nautoInit.register('MDCSnackbar', snackbar.MDCSnackbar);\nautoInit.register('MDCSwitch', switchControl.MDCSwitch);\nautoInit.register('MDCTabBar', tabBar.MDCTabBar);\nautoInit.register('MDCTextField', textField.MDCTextField);\nautoInit.register('MDCTooltip', tooltip.MDCTooltip);\nautoInit.register('MDCTopAppBar', topAppBar.MDCTopAppBar);\n\n// Export all components.\nexport {\n autoInit,\n banner,\n base,\n checkbox,\n chips,\n circularProgress,\n dataTable,\n dialog,\n dom,\n drawer,\n floatingLabel,\n formField,\n iconButton,\n lineRipple,\n linearProgress,\n list,\n menu,\n menuSurface,\n notchedOutline,\n radio,\n ripple,\n segmentedButton,\n select,\n slider,\n snackbar,\n switchControl,\n tab,\n tabBar,\n tabIndicator,\n tabScroller,\n textField,\n tooltip,\n topAppBar,\n};\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * AnimationFrame provides a user-friendly abstraction around requesting\n * and canceling animation frames.\n */\nexport class AnimationFrame {\n private readonly rafIDs = new Map<string, number>();\n\n /**\n * Requests an animation frame. Cancels any existing frame with the same key.\n * @param {string} key The key for this callback.\n * @param {FrameRequestCallback} callback The callback to be executed.\n */\n request(key: string, callback: FrameRequestCallback) {\n this.cancel(key);\n const frameID = requestAnimationFrame((frame) => {\n this.rafIDs.delete(key);\n // Callback must come *after* the key is deleted so that nested calls to\n // request with the same key are not deleted.\n callback(frame);\n });\n this.rafIDs.set(key, frameID);\n }\n\n /**\n * Cancels a queued callback with the given key.\n * @param {string} key The key for this callback.\n */\n cancel(key: string) {\n const rafID = this.rafIDs.get(key);\n if (rafID) {\n cancelAnimationFrame(rafID);\n this.rafIDs.delete(key);\n }\n }\n\n /**\n * Cancels all queued callback.\n */\n cancelAll() {\n // Need to use forEach because it's the only iteration method supported\n // by IE11. Suppress the underscore because we don't need it.\n // tslint:disable-next-line:enforce-name-casing\n this.rafIDs.forEach((_, key) => {\n this.cancel(key);\n });\n }\n\n /**\n * Returns the queue of unexecuted callback keys.\n */\n getQueue(): string[] {\n const queue: string[] = [];\n // Need to use forEach because it's the only iteration method supported\n // by IE11. Suppress the underscore because we don't need it.\n // tslint:disable-next-line:enforce-name-casing\n this.rafIDs.forEach((_, key) => {\n queue.push(key);\n });\n return queue;\n }\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {\n CssVendorPropertyMap, JsVendorPropertyMap,\n PrefixedCssPropertyName, PrefixedJsEventType,\n StandardCssPropertyName, StandardJsEventType,\n} from './types';\n\nconst cssPropertyNameMap: CssVendorPropertyMap = {\n animation: {\n prefixed: '-webkit-animation',\n standard: 'animation',\n },\n transform: {\n prefixed: '-webkit-transform',\n standard: 'transform',\n },\n transition: {\n prefixed: '-webkit-transition',\n standard: 'transition',\n },\n};\n\nconst jsEventTypeMap: JsVendorPropertyMap = {\n animationend: {\n cssProperty: 'animation',\n prefixed: 'webkitAnimationEnd',\n standard: 'animationend',\n },\n animationiteration: {\n cssProperty: 'animation',\n prefixed: 'webkitAnimationIteration',\n standard: 'animationiteration',\n },\n animationstart: {\n cssProperty: 'animation',\n prefixed: 'webkitAnimationStart',\n standard: 'animationstart',\n },\n transitionend: {\n cssProperty: 'transition',\n prefixed: 'webkitTransitionEnd',\n standard: 'transitionend',\n },\n};\n\nfunction isWindow(windowObj: Window): boolean {\n return Boolean(windowObj.document) && typeof windowObj.document.createElement === 'function';\n}\n\nexport function getCorrectPropertyName(windowObj: Window, cssProperty: StandardCssPropertyName):\n StandardCssPropertyName | PrefixedCssPropertyName {\n if (isWindow(windowObj) && cssProperty in cssPropertyNameMap) {\n const el = windowObj.document.createElement('div');\n const {standard, prefixed} = cssPropertyNameMap[cssProperty];\n const isStandard = standard in el.style;\n return isStandard ? standard : prefixed;\n }\n return cssProperty;\n}\n\nexport function getCorrectEventName(windowObj: Window, eventType: StandardJsEventType):\n StandardJsEventType | PrefixedJsEventType {\n if (isWindow(windowObj) && eventType in jsEventTypeMap) {\n const el = windowObj.document.createElement('div');\n const {standard, prefixed, cssProperty} = jsEventTypeMap[eventType];\n const isStandard = cssProperty in el.style;\n return isStandard ? standard : prefixed;\n }\n return eventType;\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport const strings = {\n AUTO_INIT_ATTR: 'data-mdc-auto-init',\n AUTO_INIT_STATE_ATTR: 'data-mdc-auto-init-state',\n INITIALIZED_STATE: 'initialized',\n};\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n// tslint:disable:only-arrow-functions\n\nimport {MDCComponent} from '@material/base/component';\nimport {MDCFoundation} from '@material/base/foundation';\n\nimport {strings} from './constants';\n\nconst {AUTO_INIT_ATTR, AUTO_INIT_STATE_ATTR, INITIALIZED_STATE} = strings;\n\nexport interface MDCAttachable {\n new<F extends MDCFoundation>(root: Element, foundation?: F, ...args: Array<unknown>): MDCComponent<F>;\n\n // Static method.\n attachTo<F extends MDCFoundation>(root: Element): MDCComponent<F>;\n}\n\ninterface InternalComponentRegistry {\n [key: string]: MDCAttachable;\n}\n\nconst registry: InternalComponentRegistry = {};\n\nconst CONSOLE_WARN = console.warn.bind(console); // tslint:disable-line:no-console\n\nfunction emit<T extends object>(evtType: string, evtData: T, shouldBubble = false) {\n let evt;\n if (typeof CustomEvent === 'function') {\n evt = new CustomEvent<T>(evtType, {\n bubbles: shouldBubble,\n detail: evtData,\n });\n } else {\n evt = document.createEvent('CustomEvent');\n evt.initCustomEvent(evtType, shouldBubble, false, evtData);\n }\n\n document.dispatchEvent(evt);\n}\n\n/* istanbul ignore next: optional argument is not a branch statement */\n/**\n * Auto-initializes all MDC components on a page.\n */\nfunction mdcAutoInit(root = document) {\n const components = [];\n let nodes: Element[] = [].slice.call(root.querySelectorAll(`[${AUTO_INIT_ATTR}]`));\n nodes = nodes.filter((node) => node.getAttribute(AUTO_INIT_STATE_ATTR) !== INITIALIZED_STATE);\n\n for (const node of nodes) {\n const ctorName = node.getAttribute(AUTO_INIT_ATTR);\n if (!ctorName) {\n throw new Error('(mdc-auto-init) Constructor name must be given.');\n }\n\n const Constructor = registry[ctorName]; // tslint:disable-line:variable-name\n if (typeof Constructor !== 'function') {\n throw new Error(\n `(mdc-auto-init) Could not find constructor in registry for ${ctorName}`);\n }\n\n // TODO: Should we make an eslint rule for an attachTo() static method?\n // See https://github.com/Microsoft/TypeScript/issues/14600 for discussion of static interface support in TS\n const component = Constructor.attachTo(node);\n Object.defineProperty(node, ctorName, {\n configurable: true,\n enumerable: false,\n value: component,\n writable: false,\n });\n components.push(component);\n node.setAttribute(AUTO_INIT_STATE_ATTR, INITIALIZED_STATE);\n }\n\n emit('MDCAutoInit:End', {});\n return components;\n}\n\n// Constructor is PascalCased because it is a direct reference to a class, rather than an instance of a class.\n// tslint:disable-next-line:variable-name\nmdcAutoInit.register = function(componentName: string, Constructor: MDCAttachable, warn = CONSOLE_WARN) {\n if (typeof Constructor !== 'function') {\n throw new Error(`(mdc-auto-init) Invalid Constructor value: ${Constructor}. Expected function.`);\n }\n const registryValue = registry[componentName];\n if (registryValue) {\n warn(`(mdc-auto-init) Overriding registration for ${componentName} with ${Constructor}. Was: ${registryValue}`);\n }\n registry[componentName] = Constructor;\n};\n\nmdcAutoInit.deregister = function(componentName: string) {\n delete registry[componentName];\n};\n\n/** @nocollapse */\nmdcAutoInit.deregisterAll = function() {\n const keys = Object.keys(registry) as string[];\n keys.forEach(this.deregister, this);\n};\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default mdcAutoInit;\nexport {mdcAutoInit};\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {SpecificEventListener} from '@material/base/types';\nimport {closest} from '@material/dom/ponyfill';\n\nimport {MDCBannerAdapter} from './adapter';\nimport {CloseReason, events, MDCBannerCloseEventDetail, selectors} from './constants';\nimport {MDCBannerFoundation} from './foundation';\n\n/** Vanilla JS implementation of banner component. */\nexport class MDCBanner extends MDCComponent<MDCBannerFoundation> {\n static attachTo(root: Element) {\n return new MDCBanner(root);\n }\n\n root!: HTMLElement; // Assigned in MDCComponent constructor.\n private handleContentClick!:\n SpecificEventListener<'click'>; // Assigned in #initialize.\n private primaryActionEl!: HTMLElement; // Assigned in #initialize.\n private secondaryActionEl!: HTMLElement|null; // Assigned in #initialize.\n private textEl!: HTMLElement; // Assigned in #initialize.\n private contentEl!: HTMLElement; // Assigned in #initialize.\n\n initialize() {\n this.contentEl = this.root.querySelector(selectors.CONTENT) as HTMLElement;\n this.textEl = this.root.querySelector(selectors.TEXT) as HTMLElement;\n this.primaryActionEl =\n this.root.querySelector(selectors.PRIMARY_ACTION) as HTMLElement;\n this.secondaryActionEl =\n this.root.querySelector(selectors.SECONDARY_ACTION) as HTMLElement;\n\n this.handleContentClick = (evt) => {\n const target = evt.target as Element;\n if (closest(target, selectors.PRIMARY_ACTION)) {\n this.foundation.handlePrimaryActionClick();\n } else if (closest(target, selectors.SECONDARY_ACTION)) {\n this.foundation.handleSecondaryActionClick();\n }\n };\n }\n\n initialSyncWithDOM() {\n this.registerContentClickHandler(this.handleContentClick);\n }\n\n destroy() {\n super.destroy();\n this.deregisterContentClickHandler(this.handleContentClick);\n }\n\n layout() {\n this.foundation.layout();\n }\n\n /**\n * Opens the banner and fires events.OPENING to indicate the beginning of its\n * opening animation and then events.OPENED once the animation finishes.\n */\n open() {\n this.foundation.open();\n }\n\n /**\n * Closes the banner and fires events.CLOSING to indicate the beginning of its\n * closing animation and then events.CLOSED once the animation finishes.\n * @param reason Why the banner was closed. Value will be passed to\n * events.CLOSING and events.CLOSED via the `event.detail.reason`\n * property. Standard values are CloseReason.PRIMARY and\n * CloseReason.SECONDARY, but CloseReason.UNSPECIFIED is provided for\n * custom handling of programmatic closing of the banner.\n */\n close(reason: CloseReason) {\n this.foundation.close(reason);\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take\n // a Partial<MDCFooAdapter>. To ensure we don't accidentally omit any\n // methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCBannerAdapter = {\n addClass: (className) => {\n this.root.classList.add(className);\n },\n getContentHeight: () => {\n return this.contentEl.offsetHeight;\n },\n notifyClosed: (reason) => {\n this.emit<MDCBannerCloseEventDetail>(events.CLOSED, {reason});\n },\n notifyClosing: (reason) => {\n this.emit<MDCBannerCloseEventDetail>(events.CLOSING, {reason});\n },\n notifyOpened: () => {\n this.emit(events.OPENED, {});\n },\n notifyOpening: () => {\n this.emit(events.OPENING, {});\n },\n removeClass: (className) => {\n this.root.classList.remove(className);\n },\n setStyleProperty: (propertyName, value) => {\n this.root.style.setProperty(propertyName, value);\n },\n };\n return new MDCBannerFoundation(adapter);\n }\n\n get isOpen(): boolean {\n return this.foundation.isOpen();\n }\n\n getText(): string {\n return this.textEl.textContent || '';\n }\n\n setText(text: string) {\n this.textEl.textContent = text;\n }\n\n getPrimaryActionText(): string {\n return this.primaryActionEl.textContent || '';\n }\n\n setPrimaryActionText(actionButtonText: string) {\n this.primaryActionEl.textContent = actionButtonText;\n }\n\n /** Returns null if the banner has no secondary action. */\n getSecondaryActionText(): string|null {\n return this.secondaryActionEl ? this.secondaryActionEl.textContent || '' :\n null;\n }\n\n setSecondaryActionText(actionButtonText: string) {\n if (this.secondaryActionEl) {\n this.secondaryActionEl.textContent = actionButtonText;\n }\n }\n\n private registerContentClickHandler(handler: SpecificEventListener<'click'>) {\n this.contentEl.addEventListener('click', handler as EventListener);\n }\n\n private deregisterContentClickHandler(handler:\n SpecificEventListener<'click'>) {\n this.contentEl.removeEventListener('click', handler as EventListener);\n }\n}\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/** Banner element classes. */\nexport const cssClasses = {\n CLOSING: 'mdc-banner--closing',\n OPEN: 'mdc-banner--open',\n OPENING: 'mdc-banner--opening',\n};\n\n/** Banner numbers. */\nexport const numbers = {\n BANNER_ANIMATION_CLOSE_TIME_MS: 250,\n BANNER_ANIMATION_OPEN_TIME_MS: 300,\n};\n\n/** Banner events. */\nexport const events = {\n CLOSED: 'MDCBanner:closed',\n CLOSING: 'MDCBanner:closing',\n OPENED: 'MDCBanner:opened',\n OPENING: 'MDCBanner:opening',\n};\n\n/** Banner selectors. */\nexport const selectors = {\n CONTENT: '.mdc-banner__content',\n PRIMARY_ACTION: '.mdc-banner__primary-action',\n SECONDARY_ACTION: '.mdc-banner__secondary-action',\n TEXT: '.mdc-banner__text',\n};\n\n/** Reason as to why the banner was closed. */\nexport enum CloseReason {\n // Indicates the banner was closed via primary action button.\n PRIMARY,\n // Indicates the banner was closed via secondary action button.\n SECONDARY,\n // Will never be used by the component. Provided for custom handling of\n // programmatic closing of the banner.\n UNSPECIFIED,\n}\n\n/** Interface for the detail of the closing and closed events emitted. */\nexport interface MDCBannerCloseEventDetail {\n reason: CloseReason;\n}\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\n\nimport {MDCBannerAdapter} from './adapter';\nimport {CloseReason, cssClasses, numbers} from './constants';\n\nconst {OPENING, OPEN, CLOSING} = cssClasses;\n\n/**\n * Foundation class for banner. Responsibilities include opening and closing the\n * banner.\n */\nexport class MDCBannerFoundation extends MDCFoundation<MDCBannerAdapter> {\n static get defaultAdapter(): MDCBannerAdapter {\n return {\n addClass: () => undefined,\n getContentHeight: () => 0,\n notifyClosed: () => undefined,\n notifyClosing: () => undefined,\n notifyOpened: () => undefined,\n notifyOpening: () => undefined,\n removeClass: () => undefined,\n setStyleProperty: () => undefined,\n };\n }\n\n private isOpened = false;\n // Request id for open animation, used to cancel the refresh callback\n // request on close() and destroy().\n private animationFrame = 0;\n // Timer id for close and open animation, used to cancel the timer on\n // close() and destroy().\n private animationTimer = 0;\n\n constructor(adapter?: Partial<MDCBannerAdapter>) {\n super({...MDCBannerFoundation.defaultAdapter, ...adapter});\n }\n\n destroy() {\n cancelAnimationFrame(this.animationFrame);\n this.animationFrame = 0;\n clearTimeout(this.animationTimer);\n this.animationTimer = 0;\n }\n\n open() {\n this.isOpened = true;\n this.adapter.notifyOpening();\n this.adapter.removeClass(CLOSING);\n this.adapter.addClass(OPENING);\n\n const contentHeight = this.adapter.getContentHeight();\n this.animationFrame = requestAnimationFrame(() => {\n this.adapter.addClass(OPEN);\n this.adapter.setStyleProperty('height', `${contentHeight}px`);\n\n this.animationTimer = setTimeout(() => {\n this.handleAnimationTimerEnd();\n this.adapter.notifyOpened();\n }, numbers.BANNER_ANIMATION_OPEN_TIME_MS);\n });\n }\n\n /**\n * @param reason Why the banner was closed. Value will be passed to\n * events.CLOSING and events.CLOSED via the `event.detail.reason`\n * property. Standard values are CloseReason.PRIMARY and\n * CloseReason.SECONDARY, but CloseReason.UNSPECIFIED is provided for\n * custom handling of programmatic closing of the banner.\n */\n close(reason: CloseReason) {\n if (!this.isOpened) {\n // Avoid redundant close calls (and events), e.g. repeated interactions as\n // the banner is animating closed\n return;\n }\n\n cancelAnimationFrame(this.animationFrame);\n this.animationFrame = 0;\n\n this.isOpened = false;\n this.adapter.notifyClosing(reason);\n this.adapter.addClass(CLOSING);\n this.adapter.setStyleProperty('height', '0');\n this.adapter.removeClass(OPEN);\n this.adapter.removeClass(OPENING);\n\n clearTimeout(this.animationTimer);\n this.animationTimer = setTimeout(() => {\n this.handleAnimationTimerEnd();\n this.adapter.notifyClosed(reason);\n }, numbers.BANNER_ANIMATION_CLOSE_TIME_MS);\n }\n\n isOpen(): boolean {\n return this.isOpened;\n }\n\n handlePrimaryActionClick() {\n this.close(CloseReason.PRIMARY);\n }\n\n handleSecondaryActionClick() {\n this.close(CloseReason.SECONDARY);\n }\n\n layout() {\n const contentHeight = this.adapter.getContentHeight();\n this.adapter.setStyleProperty('height', `${contentHeight}px`);\n }\n\n private handleAnimationTimerEnd() {\n this.animationTimer = 0;\n this.adapter.removeClass(OPENING);\n this.adapter.removeClass(CLOSING);\n }\n}\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from './foundation';\nimport {CustomEventListener, EventType, SpecificEventListener} from './types';\n\nexport class MDCComponent<FoundationType extends MDCFoundation> {\n static attachTo(root: Element): MDCComponent<MDCFoundation<{}>> {\n // Subclasses which extend MDCBase should provide an attachTo() method that takes a root element and\n // returns an instantiated component with its root set to that element. Also note that in the cases of\n // subclasses, an explicit foundation class will not have to be passed in; it will simply be initialized\n // from getDefaultFoundation().\n return new MDCComponent(root, new MDCFoundation({}));\n }\n\n protected foundation: FoundationType;\n\n constructor(\n public root: Element, foundation?: FoundationType, ...args: unknown[]) {\n this.initialize(...args);\n // Note that we initialize foundation here and not within the constructor's default param so that\n // this.root_ is defined and can be used within the foundation class.\n this.foundation =\n foundation === undefined ? this.getDefaultFoundation() : foundation;\n this.foundation.init();\n this.initialSyncWithDOM();\n }\n\n /* istanbul ignore next: method param only exists for typing purposes; it does not need to be unit tested */\n initialize(..._args: Array<unknown>) {\n // Subclasses can override this to do any additional setup work that would be considered part of a\n // \"constructor\". Essentially, it is a hook into the parent constructor before the foundation is\n // initialized. Any additional arguments besides root and foundation will be passed in here.\n }\n\n getDefaultFoundation(): FoundationType {\n // Subclasses must override this method to return a properly configured foundation class for the\n // component.\n throw new Error('Subclasses must override getDefaultFoundation to return a properly configured ' +\n 'foundation class');\n }\n\n initialSyncWithDOM() {\n // Subclasses should override this method if they need to perform work to synchronize with a host DOM\n // object. An example of this would be a form control wrapper that needs to synchronize its internal state\n // to some property or attribute of the host DOM. Please note: this is *not* the place to perform DOM\n // reads/writes that would cause layout / paint, as this is called synchronously from within the constructor.\n }\n\n destroy() {\n // Subclasses may implement this method to release any resources / deregister any listeners they have\n // attached. An example of this might be deregistering a resize event from the window object.\n this.foundation.destroy();\n }\n\n /**\n * Wrapper method to add an event listener to the component's root element. This is most useful when\n * listening for custom events.\n */\n listen<K extends EventType>(\n evtType: K, handler: SpecificEventListener<K>, options?: AddEventListenerOptions | boolean): void;\n listen<E extends Event>(\n evtType: string, handler: CustomEventListener<E>, options?: AddEventListenerOptions | boolean): void;\n listen(evtType: string, handler: EventListener, options?: AddEventListenerOptions | boolean) {\n this.root.addEventListener(evtType, handler, options);\n }\n\n /**\n * Wrapper method to remove an event listener to the component's root element. This is most useful when\n * unlistening for custom events.\n */\n unlisten<K extends EventType>(\n evtType: K, handler: SpecificEventListener<K>, options?: AddEventListenerOptions | boolean): void;\n unlisten<E extends Event>(\n evtType: string, handler: CustomEventListener<E>, options?: AddEventListenerOptions | boolean): void;\n unlisten(evtType: string, handler: EventListener, options?: AddEventListenerOptions | boolean) {\n this.root.removeEventListener(evtType, handler, options);\n }\n\n /**\n * Fires a cross-browser-compatible custom event from the component root of the given type, with the given data.\n */\n emit<T extends object>(evtType: string, evtData: T, shouldBubble = false) {\n let evt: CustomEvent<T>;\n if (typeof CustomEvent === 'function') {\n evt = new CustomEvent<T>(evtType, {\n bubbles: shouldBubble,\n detail: evtData,\n });\n } else {\n evt = document.createEvent('CustomEvent');\n evt.initCustomEvent(evtType, shouldBubble, false, evtData);\n }\n\n this.root.dispatchEvent(evt);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCComponent;\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport class MDCFoundation<AdapterType extends {} = {}> {\n static get cssClasses(): { [key: string]: string } {\n // Classes extending MDCFoundation should implement this method to return an object which exports every\n // CSS class the foundation class needs as a property. e.g. {ACTIVE: 'mdc-component--active'}\n return {};\n }\n\n static get strings(): { [key: string]: string } {\n // Classes extending MDCFoundation should implement this method to return an object which exports all\n // semantic strings as constants. e.g. {ARIA_ROLE: 'tablist'}\n return {};\n }\n\n static get numbers(): { [key: string]: number } {\n // Classes extending MDCFoundation should implement this method to return an object which exports all\n // of its semantic numbers as constants. e.g. {ANIMATION_DELAY_MS: 350}\n return {};\n }\n\n static get defaultAdapter(): {} {\n // Classes extending MDCFoundation may choose to implement this getter in order to provide a convenient\n // way of viewing the necessary methods of an adapter. In the future, this could also be used for adapter\n // validation.\n return {};\n }\n\n constructor(protected adapter: AdapterType = {} as AdapterType) {}\n\n init() {\n // Subclasses should override this method to perform initialization routines (registering events, etc.)\n }\n\n destroy() {\n // Subclasses should override this method to perform de-initialization routines (de-registering events, etc.)\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './component';\nexport * from './foundation';\nexport * from './types';\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {getCorrectEventName} from '@material/animation/util';\nimport {MDCComponent} from '@material/base/component';\nimport {applyPassive} from '@material/dom/events';\nimport {matches} from '@material/dom/ponyfill';\nimport {MDCRippleAdapter} from '@material/ripple/adapter';\nimport {MDCRipple} from '@material/ripple/component';\nimport {MDCRippleFoundation} from '@material/ripple/foundation';\nimport {MDCRippleCapableSurface} from '@material/ripple/types';\n\nimport {MDCCheckboxAdapter} from './adapter';\nimport {strings} from './constants';\nimport {MDCCheckboxFoundation} from './foundation';\n\n/**\n * This type is needed for compatibility with Closure Compiler.\n */\ntype PropertyDescriptorGetter = (() => unknown) | undefined;\n\nconst CB_PROTO_PROPS = ['checked', 'indeterminate'];\n\nexport type MDCCheckboxFactory = (el: Element, foundation?: MDCCheckboxFoundation) => MDCCheckbox;\n\nexport class MDCCheckbox extends MDCComponent<MDCCheckboxFoundation> implements MDCRippleCapableSurface {\n static attachTo(root: Element) {\n return new MDCCheckbox(root);\n }\n\n get ripple(): MDCRipple {\n return this.ripple_;\n }\n\n get checked(): boolean {\n return this.nativeControl_.checked;\n }\n\n set checked(checked: boolean) {\n this.nativeControl_.checked = checked;\n }\n\n get indeterminate(): boolean {\n return this.nativeControl_.indeterminate;\n }\n\n set indeterminate(indeterminate: boolean) {\n this.nativeControl_.indeterminate = indeterminate;\n }\n\n get disabled(): boolean {\n return this.nativeControl_.disabled;\n }\n\n set disabled(disabled: boolean) {\n this.foundation.setDisabled(disabled);\n }\n\n get value(): string {\n return this.nativeControl_.value;\n }\n\n set value(value: string) {\n this.nativeControl_.value = value;\n }\n\n private readonly ripple_: MDCRipple = this.createRipple_();\n private handleChange_!: EventListener; // assigned in initialSyncWithDOM()\n private handleAnimationEnd_!: EventListener; // assigned in initialSyncWithDOM()\n\n initialize() {\n const {DATA_INDETERMINATE_ATTR} = strings;\n this.nativeControl_.indeterminate =\n this.nativeControl_.getAttribute(DATA_INDETERMINATE_ATTR) === 'true';\n this.nativeControl_.removeAttribute(DATA_INDETERMINATE_ATTR);\n }\n\n initialSyncWithDOM() {\n this.handleChange_ = () => this.foundation.handleChange();\n this.handleAnimationEnd_ = () => this.foundation.handleAnimationEnd();\n this.nativeControl_.addEventListener('change', this.handleChange_);\n this.listen(getCorrectEventName(window, 'animationend'), this.handleAnimationEnd_);\n this.installPropertyChangeHooks_();\n }\n\n destroy() {\n this.ripple_.destroy();\n this.nativeControl_.removeEventListener('change', this.handleChange_);\n this.unlisten(getCorrectEventName(window, 'animationend'), this.handleAnimationEnd_);\n this.uninstallPropertyChangeHooks_();\n super.destroy();\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCCheckboxAdapter = {\n addClass: (className) => this.root.classList.add(className),\n forceLayout: () => (this.root as HTMLElement).offsetWidth,\n hasNativeControl: () => !!this.nativeControl_,\n isAttachedToDOM: () => Boolean(this.root.parentNode),\n isChecked: () => this.checked,\n isIndeterminate: () => this.indeterminate,\n removeClass: (className) => {\n this.root.classList.remove(className);\n },\n removeNativeControlAttr: (attr) => {\n this.nativeControl_.removeAttribute(attr);\n },\n setNativeControlAttr: (attr, value) => {\n this.nativeControl_.setAttribute(attr, value);\n },\n setNativeControlDisabled: (disabled) => {\n this.nativeControl_.disabled = disabled;\n },\n };\n return new MDCCheckboxFoundation(adapter);\n }\n\n private createRipple_(): MDCRipple {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCRippleAdapter = {\n ...MDCRipple.createAdapter(this),\n deregisterInteractionHandler: (evtType, handler) => this.nativeControl_.removeEventListener(\n evtType, handler, applyPassive()),\n isSurfaceActive: () => matches(this.nativeControl_, ':active'),\n isUnbounded: () => true,\n registerInteractionHandler: (evtType, handler) => this.nativeControl_.addEventListener(\n evtType, handler, applyPassive()),\n };\n return new MDCRipple(this.root, new MDCRippleFoundation(adapter));\n }\n\n private installPropertyChangeHooks_() {\n const nativeCb = this.nativeControl_;\n const cbProto = Object.getPrototypeOf(nativeCb);\n\n CB_PROTO_PROPS.forEach((controlState) => {\n const desc = Object.getOwnPropertyDescriptor(cbProto, controlState);\n // We have to check for this descriptor, since some browsers (Safari) don't support its return.\n // See: https://bugs.webkit.org/show_bug.cgi?id=49739\n if (!validDescriptor(desc)) {\n return;\n }\n\n // Type cast is needed for compatibility with Closure Compiler.\n const nativeGetter = (desc as {get: PropertyDescriptorGetter}).get;\n\n const nativeCbDesc = {\n configurable: desc.configurable,\n enumerable: desc.enumerable,\n get: nativeGetter,\n set: (state: boolean) => {\n desc.set!.call(nativeCb, state);\n this.foundation.handleChange();\n },\n };\n Object.defineProperty(nativeCb, controlState, nativeCbDesc);\n });\n }\n\n private uninstallPropertyChangeHooks_() {\n const nativeCb = this.nativeControl_;\n const cbProto = Object.getPrototypeOf(nativeCb);\n\n CB_PROTO_PROPS.forEach((controlState) => {\n const desc = Object.getOwnPropertyDescriptor(cbProto, controlState);\n if (!validDescriptor(desc)) {\n return;\n }\n Object.defineProperty(nativeCb, controlState, desc);\n });\n }\n\n private get nativeControl_(): HTMLInputElement {\n const {NATIVE_CONTROL_SELECTOR} = strings;\n const el =\n this.root.querySelector<HTMLInputElement>(NATIVE_CONTROL_SELECTOR);\n if (!el) {\n throw new Error(`Checkbox component requires a ${NATIVE_CONTROL_SELECTOR} element`);\n }\n return el;\n }\n}\n\nfunction validDescriptor(inputPropDesc: PropertyDescriptor | undefined): inputPropDesc is PropertyDescriptor {\n return !!inputPropDesc && typeof inputPropDesc.set === 'function';\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport const cssClasses = {\n ANIM_CHECKED_INDETERMINATE: 'mdc-checkbox--anim-checked-indeterminate',\n ANIM_CHECKED_UNCHECKED: 'mdc-checkbox--anim-checked-unchecked',\n ANIM_INDETERMINATE_CHECKED: 'mdc-checkbox--anim-indeterminate-checked',\n ANIM_INDETERMINATE_UNCHECKED: 'mdc-checkbox--anim-indeterminate-unchecked',\n ANIM_UNCHECKED_CHECKED: 'mdc-checkbox--anim-unchecked-checked',\n ANIM_UNCHECKED_INDETERMINATE: 'mdc-checkbox--anim-unchecked-indeterminate',\n BACKGROUND: 'mdc-checkbox__background',\n CHECKED: 'mdc-checkbox--checked',\n CHECKMARK: 'mdc-checkbox__checkmark',\n CHECKMARK_PATH: 'mdc-checkbox__checkmark-path',\n DISABLED: 'mdc-checkbox--disabled',\n INDETERMINATE: 'mdc-checkbox--indeterminate',\n MIXEDMARK: 'mdc-checkbox__mixedmark',\n NATIVE_CONTROL: 'mdc-checkbox__native-control',\n ROOT: 'mdc-checkbox',\n SELECTED: 'mdc-checkbox--selected',\n UPGRADED: 'mdc-checkbox--upgraded',\n};\n\nexport const strings = {\n ARIA_CHECKED_ATTR: 'aria-checked',\n ARIA_CHECKED_INDETERMINATE_VALUE: 'mixed',\n DATA_INDETERMINATE_ATTR: 'data-indeterminate',\n NATIVE_CONTROL_SELECTOR: '.mdc-checkbox__native-control',\n TRANSITION_STATE_CHECKED: 'checked',\n TRANSITION_STATE_INDETERMINATE: 'indeterminate',\n TRANSITION_STATE_INIT: 'init',\n TRANSITION_STATE_UNCHECKED: 'unchecked',\n};\n\nexport const numbers = {\n ANIM_END_LATCH_MS: 250,\n};\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCCheckboxAdapter} from './adapter';\nimport {cssClasses, numbers, strings} from './constants';\n\nexport class MDCCheckboxFoundation extends MDCFoundation<MDCCheckboxAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get numbers() {\n return numbers;\n }\n\n static get defaultAdapter(): MDCCheckboxAdapter {\n return {\n addClass: () => undefined,\n forceLayout: () => undefined,\n hasNativeControl: () => false,\n isAttachedToDOM: () => false,\n isChecked: () => false,\n isIndeterminate: () => false,\n removeClass: () => undefined,\n removeNativeControlAttr: () => undefined,\n setNativeControlAttr: () => undefined,\n setNativeControlDisabled: () => undefined,\n };\n }\n\n private currentCheckState_ = strings.TRANSITION_STATE_INIT;\n private currentAnimationClass_ = '';\n private animEndLatchTimer_ = 0;\n private enableAnimationEndHandler_ = false;\n\n constructor(adapter?: Partial<MDCCheckboxAdapter>) {\n super({...MDCCheckboxFoundation.defaultAdapter, ...adapter});\n }\n\n init() {\n this.currentCheckState_ = this.determineCheckState_();\n this.updateAriaChecked_();\n this.adapter.addClass(cssClasses.UPGRADED);\n }\n\n destroy() {\n clearTimeout(this.animEndLatchTimer_);\n }\n\n setDisabled(disabled: boolean) {\n this.adapter.setNativeControlDisabled(disabled);\n if (disabled) {\n this.adapter.addClass(cssClasses.DISABLED);\n } else {\n this.adapter.removeClass(cssClasses.DISABLED);\n }\n }\n\n /**\n * Handles the animationend event for the checkbox\n */\n handleAnimationEnd() {\n if (!this.enableAnimationEndHandler_) {\n return;\n }\n\n clearTimeout(this.animEndLatchTimer_);\n\n this.animEndLatchTimer_ = setTimeout(() => {\n this.adapter.removeClass(this.currentAnimationClass_);\n this.enableAnimationEndHandler_ = false;\n }, numbers.ANIM_END_LATCH_MS);\n }\n\n /**\n * Handles the change event for the checkbox\n */\n handleChange() {\n this.transitionCheckState_();\n }\n\n private transitionCheckState_() {\n if (!this.adapter.hasNativeControl()) {\n return;\n }\n const oldState = this.currentCheckState_;\n const newState = this.determineCheckState_();\n\n if (oldState === newState) {\n return;\n }\n\n this.updateAriaChecked_();\n\n const {TRANSITION_STATE_UNCHECKED} = strings;\n const {SELECTED} = cssClasses;\n if (newState === TRANSITION_STATE_UNCHECKED) {\n this.adapter.removeClass(SELECTED);\n } else {\n this.adapter.addClass(SELECTED);\n }\n\n // Check to ensure that there isn't a previously existing animation class, in case for example\n // the user interacted with the checkbox before the animation was finished.\n if (this.currentAnimationClass_.length > 0) {\n clearTimeout(this.animEndLatchTimer_);\n this.adapter.forceLayout();\n this.adapter.removeClass(this.currentAnimationClass_);\n }\n\n this.currentAnimationClass_ = this.getTransitionAnimationClass_(oldState, newState);\n this.currentCheckState_ = newState;\n\n // Check for parentNode so that animations are only run when the element is attached\n // to the DOM.\n if (this.adapter.isAttachedToDOM() &&\n this.currentAnimationClass_.length > 0) {\n this.adapter.addClass(this.currentAnimationClass_);\n this.enableAnimationEndHandler_ = true;\n }\n }\n\n private determineCheckState_(): string {\n const {\n TRANSITION_STATE_INDETERMINATE,\n TRANSITION_STATE_CHECKED,\n TRANSITION_STATE_UNCHECKED,\n } = strings;\n\n if (this.adapter.isIndeterminate()) {\n return TRANSITION_STATE_INDETERMINATE;\n }\n return this.adapter.isChecked() ? TRANSITION_STATE_CHECKED :\n TRANSITION_STATE_UNCHECKED;\n }\n\n private getTransitionAnimationClass_(oldState: string, newState: string): string {\n const {\n TRANSITION_STATE_INIT,\n TRANSITION_STATE_CHECKED,\n TRANSITION_STATE_UNCHECKED,\n } = strings;\n\n const {\n ANIM_UNCHECKED_CHECKED,\n ANIM_UNCHECKED_INDETERMINATE,\n ANIM_CHECKED_UNCHECKED,\n ANIM_CHECKED_INDETERMINATE,\n ANIM_INDETERMINATE_CHECKED,\n ANIM_INDETERMINATE_UNCHECKED,\n } = MDCCheckboxFoundation.cssClasses;\n\n switch (oldState) {\n case TRANSITION_STATE_INIT:\n if (newState === TRANSITION_STATE_UNCHECKED) {\n return '';\n }\n return newState === TRANSITION_STATE_CHECKED ? ANIM_INDETERMINATE_CHECKED : ANIM_INDETERMINATE_UNCHECKED;\n case TRANSITION_STATE_UNCHECKED:\n return newState === TRANSITION_STATE_CHECKED ? ANIM_UNCHECKED_CHECKED : ANIM_UNCHECKED_INDETERMINATE;\n case TRANSITION_STATE_CHECKED:\n return newState === TRANSITION_STATE_UNCHECKED ? ANIM_CHECKED_UNCHECKED : ANIM_CHECKED_INDETERMINATE;\n default: // TRANSITION_STATE_INDETERMINATE\n return newState === TRANSITION_STATE_CHECKED ? ANIM_INDETERMINATE_CHECKED : ANIM_INDETERMINATE_UNCHECKED;\n }\n }\n\n private updateAriaChecked_() {\n // Ensure aria-checked is set to mixed if checkbox is in indeterminate state.\n if (this.adapter.isIndeterminate()) {\n this.adapter.setNativeControlAttr(\n strings.ARIA_CHECKED_ATTR, strings.ARIA_CHECKED_INDETERMINATE_VALUE);\n } else {\n // The on/off state does not need to keep track of aria-checked, since\n // the screenreader uses the checked property on the checkbox element.\n this.adapter.removeNativeControlAttr(strings.ARIA_CHECKED_ATTR);\n }\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCCheckboxFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {announce} from '@material/dom/announce';\nimport {MDCChip, MDCChipFactory} from '../chip/component';\nimport {MDCChipFoundation} from '../chip/foundation';\nimport {MDCChipInteractionEvent, MDCChipNavigationEvent, MDCChipRemovalEvent,\n MDCChipSelectionEvent} from '../chip/types';\nimport {MDCChipSetAdapter} from './adapter';\nimport {MDCChipSetFoundation} from './foundation';\n\nconst {INTERACTION_EVENT, SELECTION_EVENT, REMOVAL_EVENT, NAVIGATION_EVENT} = MDCChipFoundation.strings;\nconst {CHIP_SELECTOR} = MDCChipSetFoundation.strings;\n\nlet idCounter = 0;\n\nexport class MDCChipSet extends MDCComponent<MDCChipSetFoundation> {\n static attachTo(root: Element) {\n return new MDCChipSet(root);\n }\n\n get chips(): ReadonlyArray<MDCChip> {\n return this.chips_.slice();\n }\n\n /**\n * @return An array of the IDs of all selected chips.\n */\n get selectedChipIds(): ReadonlyArray<string> {\n return this.foundation.getSelectedChipIds();\n }\n\n private chips_!: MDCChip[]; // assigned in initialize()\n private chipFactory_!: (el: Element) => MDCChip; // assigned in initialize()\n private handleChipInteraction_!: (evt: MDCChipInteractionEvent) => void; // assigned in initialSyncWithDOM()\n private handleChipSelection_!: (evt: MDCChipSelectionEvent) => void; // assigned in initialSyncWithDOM()\n private handleChipRemoval_!: (evt: MDCChipRemovalEvent) => void; // assigned in initialSyncWithDOM()\n private handleChipNavigation_!: (evt: MDCChipNavigationEvent) => void; // assigned in initialSyncWithDOM()\n\n /**\n * @param chipFactory A function which creates a new MDCChip.\n */\n initialize(chipFactory: MDCChipFactory = (el) => new MDCChip(el)) {\n this.chipFactory_ = chipFactory;\n this.chips_ = this.instantiateChips_(this.chipFactory_);\n }\n\n initialSyncWithDOM() {\n this.chips_.forEach((chip) => {\n if (chip.id && chip.selected) {\n this.foundation.select(chip.id);\n }\n });\n\n this.handleChipInteraction_ = (evt) =>\n this.foundation.handleChipInteraction(evt.detail);\n this.handleChipSelection_ = (evt) =>\n this.foundation.handleChipSelection(evt.detail);\n this.handleChipRemoval_ = (evt) =>\n this.foundation.handleChipRemoval(evt.detail);\n this.handleChipNavigation_ = (evt) =>\n this.foundation.handleChipNavigation(evt.detail);\n this.listen(INTERACTION_EVENT, this.handleChipInteraction_);\n this.listen(SELECTION_EVENT, this.handleChipSelection_);\n this.listen(REMOVAL_EVENT, this.handleChipRemoval_);\n this.listen(NAVIGATION_EVENT, this.handleChipNavigation_);\n }\n\n destroy() {\n this.chips_.forEach((chip) => {\n chip.destroy();\n });\n\n this.unlisten(INTERACTION_EVENT, this.handleChipInteraction_);\n this.unlisten(SELECTION_EVENT, this.handleChipSelection_);\n this.unlisten(REMOVAL_EVENT, this.handleChipRemoval_);\n this.unlisten(NAVIGATION_EVENT, this.handleChipNavigation_);\n\n super.destroy();\n }\n\n /**\n * Adds a new chip object to the chip set from the given chip element.\n */\n addChip(chipEl: Element) {\n chipEl.id = chipEl.id || `mdc-chip-${++idCounter}`;\n this.chips_.push(this.chipFactory_(chipEl));\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCChipSetAdapter = {\n announceMessage: (message) => {\n announce(message);\n },\n focusChipPrimaryActionAtIndex: (index) => {\n this.chips_[index].focusPrimaryAction();\n },\n focusChipTrailingActionAtIndex: (index) => {\n this.chips_[index].focusTrailingAction();\n },\n getChipListCount: () => this.chips_.length,\n getIndexOfChipById: (chipId) => {\n return this.findChipIndex_(chipId);\n },\n hasClass: (className) => this.root.classList.contains(className),\n isRTL: () => window.getComputedStyle(this.root).getPropertyValue(\n 'direction') === 'rtl',\n removeChipAtIndex: (index) => {\n if (index >= 0 && index < this.chips_.length) {\n this.chips_[index].destroy();\n this.chips_[index].remove();\n this.chips_.splice(index, 1);\n }\n },\n removeFocusFromChipAtIndex: (index) => {\n this.chips_[index].removeFocus();\n },\n selectChipAtIndex: (index, selected, shouldNotifyClients) => {\n if (index >= 0 && index < this.chips_.length) {\n this.chips_[index].setSelectedFromChipSet(selected, shouldNotifyClients);\n }\n },\n };\n return new MDCChipSetFoundation(adapter);\n }\n\n /**\n * Instantiates chip components on all of the chip set's child chip elements.\n */\n private instantiateChips_(chipFactory: MDCChipFactory): MDCChip[] {\n const chipElements: Element[] =\n [].slice.call(this.root.querySelectorAll(CHIP_SELECTOR));\n return chipElements.map((el) => {\n el.id = el.id || `mdc-chip-${++idCounter}`;\n return chipFactory(el);\n });\n }\n\n /**\n * Returns the index of the chip with the given id, or -1 if the chip does not exist.\n */\n private findChipIndex_(chipId: string): number {\n for (let i = 0; i < this.chips_.length; i++) {\n if (this.chips_[i].id === chipId) {\n return i;\n }\n }\n return -1;\n }\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport const strings = {\n CHIP_SELECTOR: '.mdc-chip',\n};\n\nexport const cssClasses = {\n CHOICE: 'mdc-chip-set--choice',\n FILTER: 'mdc-chip-set--filter',\n};\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\n\nimport {Direction, EventSource, jumpChipKeys, navigationKeys, strings as chipStrings} from '../chip/constants';\nimport {MDCChipInteractionEventDetail, MDCChipNavigationEventDetail, MDCChipRemovalEventDetail, MDCChipSelectionEventDetail} from '../chip/types';\n\nimport {MDCChipSetAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\n\nexport class MDCChipSetFoundation extends MDCFoundation<MDCChipSetAdapter> {\n static get strings() {\n return strings;\n }\n\n static get cssClasses() {\n return cssClasses;\n }\n\n static get defaultAdapter(): MDCChipSetAdapter {\n return {\n announceMessage: () => undefined,\n focusChipPrimaryActionAtIndex: () => undefined,\n focusChipTrailingActionAtIndex: () => undefined,\n getChipListCount: () => -1,\n getIndexOfChipById: () => -1,\n hasClass: () => false,\n isRTL: () => false,\n removeChipAtIndex: () => undefined,\n removeFocusFromChipAtIndex: () => undefined,\n selectChipAtIndex: () => undefined,\n };\n }\n\n /**\n * The ids of the selected chips in the set. Only used for choice chip set or filter chip set.\n */\n private selectedChipIds_: string[] = [];\n\n constructor(adapter?: Partial<MDCChipSetAdapter>) {\n super({...MDCChipSetFoundation.defaultAdapter, ...adapter});\n }\n\n /**\n * Returns an array of the IDs of all selected chips.\n */\n getSelectedChipIds(): ReadonlyArray<string> {\n return this.selectedChipIds_.slice();\n }\n\n /**\n * Selects the chip with the given id. Deselects all other chips if the chip set is of the choice variant.\n * Does not notify clients of the updated selection state.\n */\n select(chipId: string) {\n this.select_(chipId, false);\n }\n\n /**\n * Handles a chip interaction event\n */\n handleChipInteraction({chipId}: MDCChipInteractionEventDetail) {\n const index = this.adapter.getIndexOfChipById(chipId);\n this.removeFocusFromChipsExcept_(index);\n if (this.adapter.hasClass(cssClasses.CHOICE) ||\n this.adapter.hasClass(cssClasses.FILTER)) {\n this.toggleSelect_(chipId);\n }\n }\n\n /**\n * Handles a chip selection event, used to handle discrepancy when selection state is set directly on the Chip.\n */\n handleChipSelection({chipId, selected, shouldIgnore}:\n MDCChipSelectionEventDetail) {\n // Early exit if we should ignore the event\n if (shouldIgnore) {\n return;\n }\n\n const chipIsSelected = this.selectedChipIds_.indexOf(chipId) >= 0;\n if (selected && !chipIsSelected) {\n this.select(chipId);\n } else if (!selected && chipIsSelected) {\n this.deselect_(chipId);\n }\n }\n\n /**\n * Handles the event when a chip is removed.\n */\n handleChipRemoval({chipId, removedAnnouncement}: MDCChipRemovalEventDetail) {\n if (removedAnnouncement) {\n this.adapter.announceMessage(removedAnnouncement);\n }\n\n const index = this.adapter.getIndexOfChipById(chipId);\n this.deselectAndNotifyClients_(chipId);\n this.adapter.removeChipAtIndex(index);\n const maxIndex = this.adapter.getChipListCount() - 1;\n if (maxIndex < 0) {\n return;\n }\n const nextIndex = Math.min(index, maxIndex);\n this.removeFocusFromChipsExcept_(nextIndex);\n // After removing a chip, we should focus the trailing action for the next chip.\n this.adapter.focusChipTrailingActionAtIndex(nextIndex);\n }\n\n /**\n * Handles a chip navigation event.\n */\n handleChipNavigation({chipId, key, source}: MDCChipNavigationEventDetail) {\n const maxIndex = this.adapter.getChipListCount() - 1;\n let index = this.adapter.getIndexOfChipById(chipId);\n // Early exit if the index is out of range or the key is unusable\n if (index === -1 || !navigationKeys.has(key)) {\n return;\n }\n\n const isRTL = this.adapter.isRTL();\n const isLeftKey = key === chipStrings.ARROW_LEFT_KEY ||\n key === chipStrings.IE_ARROW_LEFT_KEY;\n const isRightKey = key === chipStrings.ARROW_RIGHT_KEY ||\n key === chipStrings.IE_ARROW_RIGHT_KEY;\n const isDownKey = key === chipStrings.ARROW_DOWN_KEY ||\n key === chipStrings.IE_ARROW_DOWN_KEY;\n const shouldIncrement =\n !isRTL && isRightKey || isRTL && isLeftKey || isDownKey;\n const isHome = key === chipStrings.HOME_KEY;\n const isEnd = key === chipStrings.END_KEY;\n if (shouldIncrement) {\n index++;\n } else if (isHome) {\n index = 0;\n } else if (isEnd) {\n index = maxIndex;\n } else {\n index--;\n }\n\n // Early exit if the index is out of bounds\n if (index < 0 || index > maxIndex) {\n return;\n }\n\n this.removeFocusFromChipsExcept_(index);\n this.focusChipAction_(index, key, source);\n }\n\n private focusChipAction_(index: number, key: string, source: EventSource) {\n const shouldJumpChips = jumpChipKeys.has(key);\n if (shouldJumpChips && source === EventSource.PRIMARY) {\n return this.adapter.focusChipPrimaryActionAtIndex(index);\n }\n\n if (shouldJumpChips && source === EventSource.TRAILING) {\n return this.adapter.focusChipTrailingActionAtIndex(index);\n }\n\n const dir = this.getDirection_(key);\n if (dir === Direction.LEFT) {\n return this.adapter.focusChipTrailingActionAtIndex(index);\n }\n\n if (dir === Direction.RIGHT) {\n return this.adapter.focusChipPrimaryActionAtIndex(index);\n }\n }\n\n private getDirection_(key: string): Direction {\n const isRTL = this.adapter.isRTL();\n const isLeftKey = key === chipStrings.ARROW_LEFT_KEY ||\n key === chipStrings.IE_ARROW_LEFT_KEY;\n const isRightKey = key === chipStrings.ARROW_RIGHT_KEY ||\n key === chipStrings.IE_ARROW_RIGHT_KEY;\n if (!isRTL && isLeftKey || isRTL && isRightKey) {\n return Direction.LEFT;\n }\n\n return Direction.RIGHT;\n }\n\n /**\n * Deselects the chip with the given id and optionally notifies clients.\n */\n private deselect_(chipId: string, shouldNotifyClients = false) {\n const index = this.selectedChipIds_.indexOf(chipId);\n if (index >= 0) {\n this.selectedChipIds_.splice(index, 1);\n const chipIndex = this.adapter.getIndexOfChipById(chipId);\n this.adapter.selectChipAtIndex(\n chipIndex, /** isSelected */ false, shouldNotifyClients);\n }\n }\n\n /**\n * Deselects the chip with the given id and notifies clients.\n */\n private deselectAndNotifyClients_(chipId: string) {\n this.deselect_(chipId, true);\n }\n\n /**\n * Toggles selection of the chip with the given id.\n */\n private toggleSelect_(chipId: string) {\n if (this.selectedChipIds_.indexOf(chipId) >= 0) {\n this.deselectAndNotifyClients_(chipId);\n } else {\n this.selectAndNotifyClients_(chipId);\n }\n }\n\n private removeFocusFromChipsExcept_(index: number) {\n const chipCount = this.adapter.getChipListCount();\n for (let i = 0; i < chipCount; i++) {\n if (i !== index) {\n this.adapter.removeFocusFromChipAtIndex(i);\n }\n }\n }\n\n private selectAndNotifyClients_(chipId: string) {\n this.select_(chipId, true);\n }\n\n private select_(chipId: string, shouldNotifyClients: boolean) {\n if (this.selectedChipIds_.indexOf(chipId) >= 0) {\n return;\n }\n\n if (this.adapter.hasClass(cssClasses.CHOICE) &&\n this.selectedChipIds_.length > 0) {\n const previouslySelectedChip = this.selectedChipIds_[0];\n const previouslySelectedIndex =\n this.adapter.getIndexOfChipById(previouslySelectedChip);\n this.selectedChipIds_ = [];\n this.adapter.selectChipAtIndex(\n previouslySelectedIndex, /** isSelected */ false,\n shouldNotifyClients);\n }\n this.selectedChipIds_.push(chipId);\n const index = this.adapter.getIndexOfChipById(chipId);\n this.adapter.selectChipAtIndex(\n index, /** isSelected */ true, shouldNotifyClients);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCChipSetFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './foundation';\nexport {cssClasses as chipSetCssClasses, strings as chipSetStrings} from './constants';\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {CustomEventListener, SpecificEventListener} from '@material/base/types';\nimport {MDCRippleAdapter} from '@material/ripple/adapter';\nimport {MDCRipple, MDCRippleFactory} from '@material/ripple/component';\nimport {MDCRippleFoundation} from '@material/ripple/foundation';\nimport {MDCRippleCapableSurface} from '@material/ripple/types';\n\nimport {MDCChipTrailingAction, MDCChipTrailingActionFactory} from '../trailingaction/component';\nimport {strings as trailingActionStrings} from '../trailingaction/constants';\nimport {MDCChipTrailingActionInteractionEvent, MDCChipTrailingActionNavigationEvent} from '../trailingaction/types';\n\nimport {MDCChipAdapter} from './adapter';\nimport {strings} from './constants';\nimport {MDCChipFoundation} from './foundation';\nimport {MDCChipInteractionEventDetail, MDCChipNavigationEventDetail, MDCChipRemovalEventDetail, MDCChipSelectionEventDetail} from './types';\n\nexport type MDCChipFactory = (el: Element, foundation?: MDCChipFoundation) => MDCChip;\n\nexport class MDCChip extends MDCComponent<MDCChipFoundation> implements MDCRippleCapableSurface {\n /**\n * @return Whether the chip is selected.\n */\n get selected(): boolean {\n return this.foundation.isSelected();\n }\n\n /**\n * Sets selected state on the chip.\n */\n set selected(selected: boolean) {\n this.foundation.setSelected(selected);\n }\n\n /**\n * @return Whether a trailing icon click should trigger exit/removal of the chip.\n */\n get shouldRemoveOnTrailingIconClick(): boolean {\n return this.foundation.getShouldRemoveOnTrailingIconClick();\n }\n\n /**\n * Sets whether a trailing icon click should trigger exit/removal of the chip.\n */\n set shouldRemoveOnTrailingIconClick(shouldRemove: boolean) {\n this.foundation.setShouldRemoveOnTrailingIconClick(shouldRemove);\n }\n\n /**\n * Sets whether a clicking on the chip should focus the primary action.\n */\n set setShouldFocusPrimaryActionOnClick(shouldFocus: boolean) {\n this.foundation.setShouldFocusPrimaryActionOnClick(shouldFocus);\n }\n\n get ripple(): MDCRipple {\n return this.ripple_;\n }\n\n get id(): string {\n return this.root.id;\n }\n\n static attachTo(root: Element) {\n return new MDCChip(root);\n }\n\n private leadingIcon_!: Element | null; // assigned in initialize()\n private checkmark_!: Element | null; // assigned in initialize()\n private primaryAction_!: Element|null; // assigned in initialize()\n private trailingAction_!: MDCChipTrailingAction|\n null; // assigned in initialize()\n private ripple_!: MDCRipple; // assigned in initialize()\n\n private handleTrailingActionInteraction_!: CustomEventListener<\n MDCChipTrailingActionInteractionEvent>; // assigned in\n // initialSyncWithDOM()\n private handleTrailingActionNavigation_!: CustomEventListener<\n MDCChipTrailingActionNavigationEvent>; // assigned in\n // initialSyncWithDOM()\n private handleTransitionEnd_!: SpecificEventListener<'transitionend'>; // assigned in initialSyncWithDOM()\n private handleClick_!:\n SpecificEventListener<'click'>; // assigned in initialSyncWithDOM()\n private handleKeydown_!: SpecificEventListener<'keydown'>; // assigned in initialSyncWithDOM()\n private handleFocusIn_!:\n SpecificEventListener<'focusin'>; // assigned in initialSyncWIthDOM()\n private handleFocusOut_!:\n SpecificEventListener<'focusout'>; // assigned in initialSyncWIthDOM()\n\n initialize(\n rippleFactory:\n MDCRippleFactory = (el, foundation) => new MDCRipple(el, foundation),\n trailingActionFactory:\n MDCChipTrailingActionFactory = (el) => new MDCChipTrailingAction(el),\n ) {\n this.leadingIcon_ = this.root.querySelector(strings.LEADING_ICON_SELECTOR);\n this.checkmark_ = this.root.querySelector(strings.CHECKMARK_SELECTOR);\n this.primaryAction_ =\n this.root.querySelector(strings.PRIMARY_ACTION_SELECTOR);\n\n const trailingActionEl =\n this.root.querySelector(strings.TRAILING_ACTION_SELECTOR);\n\n if (trailingActionEl) {\n this.trailingAction_ = trailingActionFactory(trailingActionEl);\n }\n\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const rippleAdapter: MDCRippleAdapter = {\n ...MDCRipple.createAdapter(this),\n computeBoundingRect: () => this.foundation.getDimensions(),\n };\n this.ripple_ =\n rippleFactory(this.root, new MDCRippleFoundation(rippleAdapter));\n }\n\n initialSyncWithDOM() {\n // Custom events\n this.handleTrailingActionInteraction_ = () => {\n this.foundation.handleTrailingActionInteraction();\n };\n this.handleTrailingActionNavigation_ =\n (evt: MDCChipTrailingActionNavigationEvent) => {\n this.foundation.handleTrailingActionNavigation(evt);\n };\n // Native events\n this.handleClick_ = () => {\n this.foundation.handleClick();\n };\n this.handleKeydown_ = (evt: KeyboardEvent) => {\n this.foundation.handleKeydown(evt);\n };\n this.handleTransitionEnd_ = (evt: TransitionEvent) => {\n this.foundation.handleTransitionEnd(evt);\n };\n this.handleFocusIn_ = (evt: FocusEvent) => {\n this.foundation.handleFocusIn(evt);\n };\n this.handleFocusOut_ = (evt: FocusEvent) => {\n this.foundation.handleFocusOut(evt);\n };\n\n\n this.listen('transitionend', this.handleTransitionEnd_);\n this.listen('click', this.handleClick_);\n this.listen('keydown', this.handleKeydown_);\n this.listen('focusin', this.handleFocusIn_);\n this.listen('focusout', this.handleFocusOut_);\n\n if (this.trailingAction_) {\n this.listen(\n trailingActionStrings.INTERACTION_EVENT,\n this.handleTrailingActionInteraction_);\n this.listen(\n trailingActionStrings.NAVIGATION_EVENT,\n this.handleTrailingActionNavigation_);\n }\n }\n\n destroy() {\n this.ripple_.destroy();\n\n this.unlisten('transitionend', this.handleTransitionEnd_);\n this.unlisten('keydown', this.handleKeydown_);\n this.unlisten('click', this.handleClick_);\n this.unlisten('focusin', this.handleFocusIn_);\n this.unlisten('focusout', this.handleFocusOut_);\n\n if (this.trailingAction_) {\n this.unlisten(\n trailingActionStrings.INTERACTION_EVENT,\n this.handleTrailingActionInteraction_);\n this.unlisten(\n trailingActionStrings.NAVIGATION_EVENT,\n this.handleTrailingActionNavigation_);\n }\n\n super.destroy();\n }\n\n /**\n * Begins the exit animation which leads to removal of the chip.\n */\n beginExit() {\n this.foundation.beginExit();\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCChipAdapter = {\n addClass: (className) => this.root.classList.add(className),\n addClassToLeadingIcon: (className) => {\n if (this.leadingIcon_) {\n this.leadingIcon_.classList.add(className);\n }\n },\n eventTargetHasClass: (target, className) =>\n target ? (target as Element).classList.contains(className) : false,\n focusPrimaryAction: () => {\n if (this.primaryAction_) {\n (this.primaryAction_ as HTMLElement).focus();\n }\n },\n focusTrailingAction: () => {\n if (this.trailingAction_) {\n this.trailingAction_.focus();\n }\n },\n getAttribute: (attr) => this.root.getAttribute(attr),\n getCheckmarkBoundingClientRect: () =>\n this.checkmark_ ? this.checkmark_.getBoundingClientRect() : null,\n getComputedStyleValue: (propertyName) =>\n window.getComputedStyle(this.root).getPropertyValue(propertyName),\n getRootBoundingClientRect: () => this.root.getBoundingClientRect(),\n hasClass: (className) => this.root.classList.contains(className),\n hasLeadingIcon: () => !!this.leadingIcon_,\n isRTL: () => window.getComputedStyle(this.root).getPropertyValue(\n 'direction') === 'rtl',\n isTrailingActionNavigable: () => {\n if (this.trailingAction_) {\n return this.trailingAction_.isNavigable();\n }\n return false;\n },\n notifyInteraction: () => this.emit<MDCChipInteractionEventDetail>(\n strings.INTERACTION_EVENT, {chipId: this.id},\n true /* shouldBubble */),\n notifyNavigation: (key, source) =>\n this.emit<MDCChipNavigationEventDetail>(\n strings.NAVIGATION_EVENT, {chipId: this.id, key, source},\n true /* shouldBubble */),\n notifyRemoval: (removedAnnouncement) => {\n this.emit<MDCChipRemovalEventDetail>(\n strings.REMOVAL_EVENT, {chipId: this.id, removedAnnouncement},\n true /* shouldBubble */);\n },\n notifySelection: (selected, shouldIgnore) =>\n this.emit<MDCChipSelectionEventDetail>(\n strings.SELECTION_EVENT,\n {chipId: this.id, selected, shouldIgnore},\n true /* shouldBubble */),\n notifyTrailingIconInteraction: () =>\n this.emit<MDCChipInteractionEventDetail>(\n strings.TRAILING_ICON_INTERACTION_EVENT, {chipId: this.id},\n true /* shouldBubble */),\n notifyEditStart: () => { /* Not Implemented. */ },\n notifyEditFinish: () => { /* Not Implemented. */ },\n removeClass: (className) => this.root.classList.remove(className),\n removeClassFromLeadingIcon: (className) => {\n if (this.leadingIcon_) {\n this.leadingIcon_.classList.remove(className);\n }\n },\n removeTrailingActionFocus: () => {\n if (this.trailingAction_) {\n this.trailingAction_.removeFocus();\n }\n },\n setPrimaryActionAttr: (attr, value) => {\n if (this.primaryAction_) {\n this.primaryAction_.setAttribute(attr, value);\n }\n },\n setStyleProperty: (propertyName, value) =>\n (this.root as HTMLElement).style.setProperty(propertyName, value),\n };\n return new MDCChipFoundation(adapter);\n }\n\n setSelectedFromChipSet(selected: boolean, shouldNotifyClients: boolean) {\n this.foundation.setSelectedFromChipSet(selected, shouldNotifyClients);\n }\n\n focusPrimaryAction() {\n this.foundation.focusPrimaryAction();\n }\n\n focusTrailingAction() {\n this.foundation.focusTrailingAction();\n }\n\n removeFocus() {\n this.foundation.removeFocus();\n }\n\n remove() {\n const parent = this.root.parentNode;\n if (parent !== null) {\n parent.removeChild(this.root);\n }\n }\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport enum Direction {\n LEFT = 'left',\n RIGHT = 'right',\n}\n\nexport enum EventSource {\n PRIMARY = 'primary',\n TRAILING = 'trailing',\n NONE = 'none',\n}\n\nexport const strings = {\n ADDED_ANNOUNCEMENT_ATTRIBUTE: 'data-mdc-chip-added-announcement',\n ARIA_CHECKED: 'aria-checked',\n ARROW_DOWN_KEY: 'ArrowDown',\n ARROW_LEFT_KEY: 'ArrowLeft',\n ARROW_RIGHT_KEY: 'ArrowRight',\n ARROW_UP_KEY: 'ArrowUp',\n BACKSPACE_KEY: 'Backspace',\n CHECKMARK_SELECTOR: '.mdc-chip__checkmark',\n DELETE_KEY: 'Delete',\n END_KEY: 'End',\n ENTER_KEY: 'Enter',\n ENTRY_ANIMATION_NAME: 'mdc-chip-entry',\n HOME_KEY: 'Home',\n IE_ARROW_DOWN_KEY: 'Down',\n IE_ARROW_LEFT_KEY: 'Left',\n IE_ARROW_RIGHT_KEY: 'Right',\n IE_ARROW_UP_KEY: 'Up',\n IE_DELETE_KEY: 'Del',\n INTERACTION_EVENT: 'MDCChip:interaction',\n LEADING_ICON_SELECTOR: '.mdc-chip__icon--leading',\n NAVIGATION_EVENT: 'MDCChip:navigation',\n PRIMARY_ACTION_SELECTOR: '.mdc-chip__primary-action',\n REMOVED_ANNOUNCEMENT_ATTRIBUTE: 'data-mdc-chip-removed-announcement',\n REMOVAL_EVENT: 'MDCChip:removal',\n SELECTION_EVENT: 'MDCChip:selection',\n SPACEBAR_KEY: ' ',\n TAB_INDEX: 'tabindex',\n TRAILING_ACTION_SELECTOR: '.mdc-chip-trailing-action',\n TRAILING_ICON_INTERACTION_EVENT: 'MDCChip:trailingIconInteraction',\n TRAILING_ICON_SELECTOR: '.mdc-chip__icon--trailing',\n};\n\nexport const cssClasses = {\n CHECKMARK: 'mdc-chip__checkmark',\n CHIP_EXIT: 'mdc-chip--exit',\n DELETABLE: 'mdc-chip--deletable',\n EDITABLE: 'mdc-chip--editable',\n EDITING: 'mdc-chip--editing',\n HIDDEN_LEADING_ICON: 'mdc-chip__icon--leading-hidden',\n LEADING_ICON: 'mdc-chip__icon--leading',\n PRIMARY_ACTION: 'mdc-chip__primary-action',\n PRIMARY_ACTION_FOCUSED: 'mdc-chip--primary-action-focused',\n SELECTED: 'mdc-chip--selected',\n TEXT: 'mdc-chip__text',\n TRAILING_ACTION: 'mdc-chip__trailing-action',\n TRAILING_ICON: 'mdc-chip__icon--trailing',\n};\n\nexport const navigationKeys = new Set<string>();\n// IE11 has no support for new Set with iterable so we need to initialize this by hand\nnavigationKeys.add(strings.ARROW_LEFT_KEY);\nnavigationKeys.add(strings.ARROW_RIGHT_KEY);\nnavigationKeys.add(strings.ARROW_DOWN_KEY);\nnavigationKeys.add(strings.ARROW_UP_KEY);\nnavigationKeys.add(strings.END_KEY);\nnavigationKeys.add(strings.HOME_KEY);\nnavigationKeys.add(strings.IE_ARROW_LEFT_KEY);\nnavigationKeys.add(strings.IE_ARROW_RIGHT_KEY);\nnavigationKeys.add(strings.IE_ARROW_DOWN_KEY);\nnavigationKeys.add(strings.IE_ARROW_UP_KEY);\n\nexport const jumpChipKeys = new Set<string>();\n// IE11 has no support for new Set with iterable so we need to initialize this by hand\njumpChipKeys.add(strings.ARROW_UP_KEY);\njumpChipKeys.add(strings.ARROW_DOWN_KEY);\njumpChipKeys.add(strings.HOME_KEY);\njumpChipKeys.add(strings.END_KEY);\njumpChipKeys.add(strings.IE_ARROW_UP_KEY);\njumpChipKeys.add(strings.IE_ARROW_DOWN_KEY);\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\n\nimport {MDCChipTrailingActionNavigationEvent} from '../trailingaction/types';\n\nimport {MDCChipAdapter} from './adapter';\nimport {cssClasses, Direction, EventSource, jumpChipKeys, navigationKeys, strings} from './constants';\n\nconst emptyClientRect = {\n bottom: 0,\n height: 0,\n left: 0,\n right: 0,\n top: 0,\n width: 0,\n};\n\nenum FocusBehavior {\n SHOULD_FOCUS,\n SHOULD_NOT_FOCUS,\n}\n\nexport class MDCChipFoundation extends MDCFoundation<MDCChipAdapter> {\n static get strings() {\n return strings;\n }\n\n static get cssClasses() {\n return cssClasses;\n }\n\n static get defaultAdapter(): MDCChipAdapter {\n return {\n addClass: () => undefined,\n addClassToLeadingIcon: () => undefined,\n eventTargetHasClass: () => false,\n focusPrimaryAction: () => undefined,\n focusTrailingAction: () => undefined,\n getAttribute: () => null,\n getCheckmarkBoundingClientRect: () => emptyClientRect,\n getComputedStyleValue: () => '',\n getRootBoundingClientRect: () => emptyClientRect,\n hasClass: () => false,\n hasLeadingIcon: () => false,\n isRTL: () => false,\n isTrailingActionNavigable: () => false,\n notifyEditFinish: () => undefined,\n notifyEditStart: () => undefined,\n notifyInteraction: () => undefined,\n notifyNavigation: () => undefined,\n notifyRemoval: () => undefined,\n notifySelection: () => undefined,\n notifyTrailingIconInteraction: () => undefined,\n removeClass: () => undefined,\n removeClassFromLeadingIcon: () => undefined,\n removeTrailingActionFocus: () => undefined,\n setPrimaryActionAttr: () => undefined,\n setStyleProperty: () => undefined,\n };\n }\n\n /** Whether a trailing icon click should immediately trigger exit/removal of the chip. */\n private shouldRemoveOnTrailingIconClick_ = true;\n\n /**\n * Whether the primary action should receive focus on click. Should only be\n * set to true for clients who programmatically give focus to a different\n * element on the page when a chip is clicked (like a menu).\n */\n private shouldFocusPrimaryActionOnClick_ = true;\n\n constructor(adapter?: Partial<MDCChipAdapter>) {\n super({...MDCChipFoundation.defaultAdapter, ...adapter});\n }\n\n isSelected() {\n return this.adapter.hasClass(cssClasses.SELECTED);\n }\n\n isEditable() {\n return this.adapter.hasClass(cssClasses.EDITABLE);\n }\n\n isEditing() {\n return this.adapter.hasClass(cssClasses.EDITING);\n }\n\n setSelected(selected: boolean) {\n this.setSelected_(selected);\n this.notifySelection_(selected);\n }\n\n setSelectedFromChipSet(selected: boolean, shouldNotifyClients: boolean) {\n this.setSelected_(selected);\n if (shouldNotifyClients) {\n this.notifyIgnoredSelection_(selected);\n }\n }\n\n getShouldRemoveOnTrailingIconClick() {\n return this.shouldRemoveOnTrailingIconClick_;\n }\n\n setShouldRemoveOnTrailingIconClick(shouldRemove: boolean) {\n this.shouldRemoveOnTrailingIconClick_ = shouldRemove;\n }\n\n setShouldFocusPrimaryActionOnClick(shouldFocus: boolean) {\n this.shouldFocusPrimaryActionOnClick_ = shouldFocus;\n }\n\n getDimensions(): ClientRect {\n const getRootRect = () => this.adapter.getRootBoundingClientRect();\n const getCheckmarkRect = () =>\n this.adapter.getCheckmarkBoundingClientRect();\n\n // When a chip has a checkmark and not a leading icon, the bounding rect changes in size depending on the current\n // size of the checkmark.\n if (!this.adapter.hasLeadingIcon()) {\n const checkmarkRect = getCheckmarkRect();\n if (checkmarkRect) {\n const rootRect = getRootRect();\n // Checkmark is a square, meaning the client rect's width and height are identical once the animation completes.\n // However, the checkbox is initially hidden by setting the width to 0.\n // To account for an initial width of 0, we use the checkbox's height instead (which equals the end-state width)\n // when adding it to the root client rect's width.\n return {\n bottom: rootRect.bottom,\n height: rootRect.height,\n left: rootRect.left,\n right: rootRect.right,\n top: rootRect.top,\n width: rootRect.width + checkmarkRect.height,\n };\n }\n }\n\n return getRootRect();\n }\n\n /**\n * Begins the exit animation which leads to removal of the chip.\n */\n beginExit() {\n this.adapter.addClass(cssClasses.CHIP_EXIT);\n }\n\n handleClick() {\n this.adapter.notifyInteraction();\n this.setPrimaryActionFocusable_(this.getFocusBehavior_());\n }\n\n handleDoubleClick() {\n if (this.isEditable()) {\n this.startEditing();\n }\n }\n\n /**\n * Handles a transition end event on the root element.\n */\n handleTransitionEnd(evt: TransitionEvent) {\n // Handle transition end event on the chip when it is about to be removed.\n const shouldHandle =\n this.adapter.eventTargetHasClass(evt.target, cssClasses.CHIP_EXIT);\n const widthIsAnimating = evt.propertyName === 'width';\n const opacityIsAnimating = evt.propertyName === 'opacity';\n\n if (shouldHandle && opacityIsAnimating) {\n // See: https://css-tricks.com/using-css-transitions-auto-dimensions/#article-header-id-5\n const chipWidth = this.adapter.getComputedStyleValue('width');\n\n // On the next frame (once we get the computed width), explicitly set the chip's width\n // to its current pixel width, so we aren't transitioning out of 'auto'.\n requestAnimationFrame(() => {\n this.adapter.setStyleProperty('width', chipWidth);\n\n // To mitigate jitter, start transitioning padding and margin before width.\n this.adapter.setStyleProperty('padding', '0');\n this.adapter.setStyleProperty('margin', '0');\n\n // On the next frame (once width is explicitly set), transition width to 0.\n requestAnimationFrame(() => {\n this.adapter.setStyleProperty('width', '0');\n });\n });\n return;\n }\n\n if (shouldHandle && widthIsAnimating) {\n this.removeFocus();\n const removedAnnouncement =\n this.adapter.getAttribute(strings.REMOVED_ANNOUNCEMENT_ATTRIBUTE);\n\n this.adapter.notifyRemoval(removedAnnouncement);\n }\n\n // Handle a transition end event on the leading icon or checkmark, since the transition end event bubbles.\n if (!opacityIsAnimating) {\n return;\n }\n\n const shouldHideLeadingIcon =\n this.adapter.eventTargetHasClass(evt.target, cssClasses.LEADING_ICON) &&\n this.adapter.hasClass(cssClasses.SELECTED);\n const shouldShowLeadingIcon =\n this.adapter.eventTargetHasClass(evt.target, cssClasses.CHECKMARK) &&\n !this.adapter.hasClass(cssClasses.SELECTED);\n\n if (shouldHideLeadingIcon) {\n this.adapter.addClassToLeadingIcon(cssClasses.HIDDEN_LEADING_ICON);\n return;\n }\n\n if (shouldShowLeadingIcon) {\n this.adapter.removeClassFromLeadingIcon(cssClasses.HIDDEN_LEADING_ICON);\n return;\n }\n }\n\n handleFocusIn(evt: FocusEvent) {\n // Early exit if the event doesn't come from the primary action\n if (!this.eventFromPrimaryAction_(evt)) {\n return;\n }\n\n this.adapter.addClass(cssClasses.PRIMARY_ACTION_FOCUSED);\n }\n\n handleFocusOut(evt: FocusEvent) {\n // Early exit if the event doesn't come from the primary action\n if (!this.eventFromPrimaryAction_(evt)) {\n return;\n }\n\n if (this.isEditing()) {\n this.finishEditing();\n }\n\n this.adapter.removeClass(cssClasses.PRIMARY_ACTION_FOCUSED);\n }\n\n /**\n * Handles an interaction event on the trailing icon element. This is used to\n * prevent the ripple from activating on interaction with the trailing icon.\n */\n handleTrailingActionInteraction() {\n this.adapter.notifyTrailingIconInteraction();\n this.removeChip_();\n }\n\n /**\n * Handles a keydown event from the root element.\n */\n handleKeydown(evt: KeyboardEvent) {\n if (this.isEditing()) {\n if (this.shouldFinishEditing(evt)) {\n evt.preventDefault();\n this.finishEditing();\n }\n // When editing, the foundation should only handle key events that finish\n // the editing process.\n return;\n }\n\n if (this.isEditable()) {\n if (this.shouldStartEditing(evt)) {\n evt.preventDefault();\n this.startEditing();\n }\n }\n\n if (this.shouldNotifyInteraction_(evt)) {\n this.adapter.notifyInteraction();\n this.setPrimaryActionFocusable_(this.getFocusBehavior_());\n return;\n }\n\n if (this.isDeleteAction_(evt)) {\n evt.preventDefault();\n this.removeChip_();\n return;\n }\n\n // Early exit if the key is not usable\n if (!navigationKeys.has(evt.key)) {\n return;\n }\n\n // Prevent default behavior for movement keys which could include scrolling\n evt.preventDefault();\n this.focusNextAction_(evt.key, EventSource.PRIMARY);\n }\n\n handleTrailingActionNavigation(evt: MDCChipTrailingActionNavigationEvent) {\n return this.focusNextAction_(evt.detail.key, EventSource.TRAILING);\n }\n\n /**\n * Called by the chip set to remove focus from the chip actions.\n */\n removeFocus() {\n this.adapter.setPrimaryActionAttr(strings.TAB_INDEX, '-1');\n this.adapter.removeTrailingActionFocus();\n }\n\n /**\n * Called by the chip set to focus the primary action.\n *\n */\n focusPrimaryAction() {\n this.setPrimaryActionFocusable_(FocusBehavior.SHOULD_FOCUS);\n }\n\n /**\n * Called by the chip set to focus the trailing action (if present), otherwise\n * gives focus to the trailing action.\n */\n focusTrailingAction() {\n const trailingActionIsNavigable = this.adapter.isTrailingActionNavigable();\n if (trailingActionIsNavigable) {\n this.adapter.setPrimaryActionAttr(strings.TAB_INDEX, '-1');\n this.adapter.focusTrailingAction();\n return;\n }\n\n this.focusPrimaryAction();\n }\n\n private setPrimaryActionFocusable_(focusBehavior: FocusBehavior) {\n this.adapter.setPrimaryActionAttr(strings.TAB_INDEX, '0');\n if (focusBehavior === FocusBehavior.SHOULD_FOCUS) {\n this.adapter.focusPrimaryAction();\n }\n this.adapter.removeTrailingActionFocus();\n }\n\n private getFocusBehavior_(): FocusBehavior {\n if (this.shouldFocusPrimaryActionOnClick_) {\n return FocusBehavior.SHOULD_FOCUS;\n }\n return FocusBehavior.SHOULD_NOT_FOCUS;\n }\n\n private focusNextAction_(key: string, source: EventSource) {\n const isTrailingActionNavigable = this.adapter.isTrailingActionNavigable();\n const dir = this.getDirection_(key);\n\n // Early exit if the key should jump chips\n if (jumpChipKeys.has(key) || !isTrailingActionNavigable) {\n return this.adapter.notifyNavigation(key, source);\n }\n\n if (source === EventSource.PRIMARY && dir === Direction.RIGHT) {\n return this.focusTrailingAction();\n }\n\n if (source === EventSource.TRAILING && dir === Direction.LEFT) {\n return this.focusPrimaryAction();\n }\n\n this.adapter.notifyNavigation(key, EventSource.NONE);\n }\n\n private getDirection_(key: string): Direction {\n const isRTL = this.adapter.isRTL();\n const isLeftKey =\n key === strings.ARROW_LEFT_KEY || key === strings.IE_ARROW_LEFT_KEY;\n const isRightKey =\n key === strings.ARROW_RIGHT_KEY || key === strings.IE_ARROW_RIGHT_KEY;\n if (!isRTL && isLeftKey || isRTL && isRightKey) {\n return Direction.LEFT;\n }\n\n return Direction.RIGHT;\n }\n\n private removeChip_() {\n if (this.shouldRemoveOnTrailingIconClick_) {\n this.beginExit();\n }\n }\n\n private shouldStartEditing(evt: KeyboardEvent): boolean {\n return this.eventFromPrimaryAction_(evt) && evt.key === strings.ENTER_KEY;\n }\n\n private shouldFinishEditing(evt: KeyboardEvent): boolean {\n return evt.key === strings.ENTER_KEY;\n }\n\n private shouldNotifyInteraction_(evt: KeyboardEvent): boolean {\n return evt.key === strings.ENTER_KEY || evt.key === strings.SPACEBAR_KEY;\n }\n\n private isDeleteAction_(evt: KeyboardEvent): boolean {\n const isDeletable = this.adapter.hasClass(cssClasses.DELETABLE);\n return isDeletable &&\n (evt.key === strings.BACKSPACE_KEY || evt.key === strings.DELETE_KEY ||\n evt.key === strings.IE_DELETE_KEY);\n }\n\n private setSelected_(selected: boolean) {\n if (selected) {\n this.adapter.addClass(cssClasses.SELECTED);\n this.adapter.setPrimaryActionAttr(strings.ARIA_CHECKED, 'true');\n } else {\n this.adapter.removeClass(cssClasses.SELECTED);\n this.adapter.setPrimaryActionAttr(strings.ARIA_CHECKED, 'false');\n }\n }\n\n private notifySelection_(selected: boolean) {\n this.adapter.notifySelection(selected, false);\n }\n\n private notifyIgnoredSelection_(selected: boolean) {\n this.adapter.notifySelection(selected, true);\n }\n\n private eventFromPrimaryAction_(evt: Event) {\n return this.adapter.eventTargetHasClass(\n evt.target, cssClasses.PRIMARY_ACTION);\n }\n\n private startEditing() {\n this.adapter.addClass(cssClasses.EDITING);\n this.adapter.notifyEditStart();\n }\n\n private finishEditing() {\n this.adapter.removeClass(cssClasses.EDITING);\n this.adapter.notifyEditFinish();\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCChipFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './foundation';\nexport * from './types';\nexport {cssClasses as chipCssClasses, strings as chipStrings} from './constants';\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './trailingaction/index';\nexport * from './chip/index';\nexport * from './chip-set/index';\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {SpecificEventListener} from '@material/base/types';\nimport {MDCRippleAdapter} from '@material/ripple/adapter';\nimport {MDCRipple, MDCRippleFactory} from '@material/ripple/component';\nimport {MDCRippleFoundation} from '@material/ripple/foundation';\nimport {MDCRippleCapableSurface} from '@material/ripple/types';\nimport {MDCChipTrailingActionAdapter} from './adapter';\nimport {strings} from './constants';\nimport {MDCChipTrailingActionFoundation} from './foundation';\nimport {MDCChipTrailingActionInteractionEventDetail, MDCChipTrailingActionNavigationEventDetail} from './types';\n\n/**\n * Creates a trailing action component on the given element.\n */\nexport type MDCChipTrailingActionFactory =\n (el: Element, foundation?: MDCChipTrailingActionFoundation) =>\n MDCChipTrailingAction;\n\nexport class MDCChipTrailingAction extends\n MDCComponent<MDCChipTrailingActionFoundation> implements\n MDCRippleCapableSurface {\n get ripple(): MDCRipple {\n return this.ripple_;\n }\n\n static attachTo(root: Element) {\n return new MDCChipTrailingAction(root);\n }\n\n private ripple_!: MDCRipple; // assigned in initialize()\n private handleClick_!:\n SpecificEventListener<'click'>; // assigned in initialSyncWithDOM()\n private handleKeydown_!:\n SpecificEventListener<'keydown'>; // assigned in initialSyncWithDOM()\n\n initialize(\n rippleFactory: MDCRippleFactory = (el, foundation) =>\n new MDCRipple(el, foundation)) {\n // DO NOT INLINE this variable. For backward compatibility, foundations take\n // a Partial<MDCFooAdapter>. To ensure we don't accidentally omit any\n // methods, we need a separate, strongly typed adapter variable.\n const rippleAdapter: MDCRippleAdapter = MDCRipple.createAdapter(this);\n this.ripple_ =\n rippleFactory(this.root, new MDCRippleFoundation(rippleAdapter));\n }\n\n initialSyncWithDOM() {\n this.handleClick_ = (evt: MouseEvent) => {\n this.foundation.handleClick(evt);\n };\n this.handleKeydown_ = (evt: KeyboardEvent) => {\n this.foundation.handleKeydown(evt);\n };\n\n this.listen('click', this.handleClick_);\n this.listen('keydown', this.handleKeydown_);\n }\n\n destroy() {\n this.ripple_.destroy();\n this.unlisten('click', this.handleClick_);\n this.unlisten('keydown', this.handleKeydown_);\n super.destroy();\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take\n // a Partial<MDCFooAdapter>. To ensure we don't accidentally omit any\n // methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCChipTrailingActionAdapter = {\n focus: () => {\n // TODO(b/157231863): Migate MDCComponent#root to HTMLElement\n (this.root as HTMLElement).focus();\n },\n getAttribute: (attr) => this.root.getAttribute(attr),\n notifyInteraction: (trigger) =>\n this.emit<MDCChipTrailingActionInteractionEventDetail>(\n strings.INTERACTION_EVENT, {trigger}, true /* shouldBubble */),\n notifyNavigation: (key) => {\n this.emit<MDCChipTrailingActionNavigationEventDetail>(\n strings.NAVIGATION_EVENT, {key}, true /* shouldBubble */);\n },\n setAttribute: (attr, value) => {\n this.root.setAttribute(attr, value);\n },\n };\n return new MDCChipTrailingActionFoundation(adapter);\n }\n\n isNavigable() {\n return this.foundation.isNavigable();\n }\n\n focus() {\n this.foundation.focus();\n }\n\n removeFocus() {\n this.foundation.removeFocus();\n }\n}\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport enum InteractionTrigger {\n UNSPECIFIED, // Default type\n CLICK,\n BACKSPACE_KEY,\n DELETE_KEY,\n SPACEBAR_KEY,\n ENTER_KEY,\n}\n\nexport const strings = {\n ARIA_HIDDEN: 'aria-hidden',\n INTERACTION_EVENT: 'MDCChipTrailingAction:interaction',\n NAVIGATION_EVENT: 'MDCChipTrailingAction:navigation',\n TAB_INDEX: 'tabindex',\n};\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {isNavigationEvent, KEY, normalizeKey} from '@material/dom/keyboard';\n\nimport {MDCChipTrailingActionAdapter} from './adapter';\nimport {InteractionTrigger, strings} from './constants';\n\nexport class MDCChipTrailingActionFoundation extends\n MDCFoundation<MDCChipTrailingActionAdapter> {\n static get strings() {\n return strings;\n }\n\n static get defaultAdapter(): MDCChipTrailingActionAdapter {\n return {\n focus: () => undefined,\n getAttribute: () => null,\n setAttribute: () => undefined,\n notifyInteraction: () => undefined,\n notifyNavigation: () => undefined,\n };\n }\n\n constructor(adapter?: Partial<MDCChipTrailingActionAdapter>) {\n super({...MDCChipTrailingActionFoundation.defaultAdapter, ...adapter});\n }\n\n handleClick(evt: MouseEvent) {\n evt.stopPropagation();\n this.adapter.notifyInteraction(InteractionTrigger.CLICK);\n }\n\n handleKeydown(evt: KeyboardEvent) {\n evt.stopPropagation();\n const key = normalizeKey(evt);\n if (this.shouldNotifyInteractionFromKey_(key)) {\n const trigger = this.getTriggerFromKey_(key);\n this.adapter.notifyInteraction(trigger);\n return;\n }\n\n if (isNavigationEvent(evt)) {\n this.adapter.notifyNavigation(key);\n return;\n }\n }\n\n removeFocus() {\n this.adapter.setAttribute(strings.TAB_INDEX, '-1');\n }\n\n focus() {\n this.adapter.setAttribute(strings.TAB_INDEX, '0');\n this.adapter.focus();\n }\n\n isNavigable() {\n return this.adapter.getAttribute(strings.ARIA_HIDDEN) !== 'true';\n }\n\n private shouldNotifyInteractionFromKey_(key: string): boolean {\n const isFromActionKey = key === KEY.ENTER || key === KEY.SPACEBAR;\n const isFromDeleteKey = key === KEY.BACKSPACE || key === KEY.DELETE;\n\n return isFromActionKey || isFromDeleteKey;\n }\n\n private getTriggerFromKey_(key: string): InteractionTrigger {\n if (key === KEY.SPACEBAR) {\n return InteractionTrigger.SPACEBAR_KEY;\n }\n\n if (key === KEY.ENTER) {\n return InteractionTrigger.ENTER_KEY;\n }\n\n if (key === KEY.DELETE) {\n return InteractionTrigger.DELETE_KEY;\n }\n\n if (key === KEY.BACKSPACE) {\n return InteractionTrigger.BACKSPACE_KEY;\n }\n\n // Default case, should never be returned\n return InteractionTrigger.UNSPECIFIED;\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCChipTrailingActionFoundation;\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './foundation';\nexport * from './types';\nexport {strings as trailingActionStrings} from './constants';\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {MDCProgressIndicator} from '@material/progress-indicator/component';\nimport {MDCCircularProgressAdapter} from './adapter';\nimport {MDCCircularProgressFoundation} from './foundation';\n\nexport class MDCCircularProgress extends\n MDCComponent<MDCCircularProgressFoundation> implements\n MDCProgressIndicator {\n private determinateCircle_!: HTMLElement;\n\n initialize() {\n this.determinateCircle_ = this.root.querySelector<HTMLElement>(\n MDCCircularProgressFoundation.strings.DETERMINATE_CIRCLE_SELECTOR)!;\n }\n\n static attachTo(root: Element) {\n return new MDCCircularProgress(root);\n }\n\n /**\n * Sets whether the progress indicator is in determinate mode.\n * @param isDeterminate Whether the indicator should be determinate.\n */\n set determinate(value: boolean) {\n this.foundation.setDeterminate(value);\n }\n\n /**\n * Sets the current progress value. In indeterminate mode, this has no\n * visual effect but will be reflected if the indicator is switched to\n * determinate mode.\n * @param value The current progress value, which must be between 0 and 1.\n */\n set progress(value: number) {\n this.foundation.setProgress(value);\n }\n\n /**\n * Whether the progress indicator is hidden.\n */\n get isClosed() {\n return this.foundation.isClosed();\n }\n\n /**\n * Shows the progress indicator.\n */\n open() {\n this.foundation.open();\n }\n\n /**\n * Hides the progress indicator.\n */\n close() {\n this.foundation.close();\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take\n // a Partial<MDCFooAdapter>. To ensure we don't accidentally omit any\n // methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCCircularProgressAdapter = {\n addClass: (className: string) => this.root.classList.add(className),\n getDeterminateCircleAttribute: (attributeName: string) =>\n this.determinateCircle_.getAttribute(attributeName),\n hasClass: (className: string) => this.root.classList.contains(className),\n removeClass: (className: string) => this.root.classList.remove(className),\n removeAttribute: (attributeName: string) =>\n this.root.removeAttribute(attributeName),\n setAttribute: (attributeName: string, value: string) =>\n this.root.setAttribute(attributeName, value),\n setDeterminateCircleAttribute: (attributeName: string, value: string) =>\n this.determinateCircle_.setAttribute(attributeName, value),\n };\n return new MDCCircularProgressFoundation(adapter);\n }\n}\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * CSS class names used in component.\n */\nexport const cssClasses = {\n INDETERMINATE_CLASS: 'mdc-circular-progress--indeterminate',\n CLOSED_CLASS: 'mdc-circular-progress--closed',\n};\n\n/**\n * Attributes and selectors used in component.\n */\nexport const strings = {\n DETERMINATE_CIRCLE_SELECTOR: '.mdc-circular-progress__determinate-circle',\n ARIA_VALUENOW: 'aria-valuenow',\n RADIUS: 'r',\n STROKE_DASHOFFSET: 'stroke-dashoffset',\n};\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCProgressIndicatorFoundation} from '@material/progress-indicator/foundation';\nimport {MDCCircularProgressAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\n\nexport class MDCCircularProgressFoundation extends\n MDCFoundation<MDCCircularProgressAdapter> implements\n MDCProgressIndicatorFoundation {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get defaultAdapter(): MDCCircularProgressAdapter {\n return {\n addClass: () => undefined,\n getDeterminateCircleAttribute: () => null,\n hasClass: () => false,\n removeClass: () => undefined,\n removeAttribute: () => undefined,\n setAttribute: () => undefined,\n setDeterminateCircleAttribute: () => undefined,\n };\n }\n\n private isClosed_!: boolean;\n private isDeterminate_!: boolean;\n private progress_!: number;\n private radius_!: number;\n\n constructor(adapter?: Partial<MDCCircularProgressAdapter>) {\n super({...MDCCircularProgressFoundation.defaultAdapter, ...adapter});\n }\n\n init() {\n this.isClosed_ = this.adapter.hasClass(cssClasses.CLOSED_CLASS);\n this.isDeterminate_ =\n !this.adapter.hasClass(cssClasses.INDETERMINATE_CLASS);\n this.progress_ = 0;\n\n if (this.isDeterminate_) {\n this.adapter.setAttribute(\n strings.ARIA_VALUENOW, this.progress_.toString());\n }\n\n this.radius_ =\n Number(this.adapter.getDeterminateCircleAttribute(strings.RADIUS));\n }\n\n isDeterminate() {\n return this.isDeterminate_;\n }\n\n getProgress() {\n return this.progress_;\n }\n\n /**\n * @return Returns whether the progress indicator is hidden.\n */\n isClosed() {\n return this.isClosed_;\n }\n\n /**\n * Sets whether the progress indicator is in determinate mode.\n * @param isDeterminate Whether the indicator should be determinate.\n */\n setDeterminate(isDeterminate: boolean) {\n this.isDeterminate_ = isDeterminate;\n\n if (this.isDeterminate_) {\n this.adapter.removeClass(cssClasses.INDETERMINATE_CLASS);\n this.setProgress(this.progress_);\n } else {\n this.adapter.addClass(cssClasses.INDETERMINATE_CLASS);\n this.adapter.removeAttribute(strings.ARIA_VALUENOW);\n }\n }\n\n /**\n * Sets the current progress value. In indeterminate mode, this has no\n * visual effect but will be reflected if the indicator is switched to\n * determinate mode.\n * @param value The current progress value, which must be between 0 and 1.\n */\n setProgress(value: number) {\n this.progress_ = value;\n if (this.isDeterminate_) {\n const unfilledArcLength =\n (1 - this.progress_) * (2 * Math.PI * this.radius_);\n\n this.adapter.setDeterminateCircleAttribute(\n strings.STROKE_DASHOFFSET, `${unfilledArcLength}`);\n this.adapter.setAttribute(\n strings.ARIA_VALUENOW, this.progress_.toString());\n }\n }\n\n /**\n * Shows the progress indicator.\n */\n open() {\n this.isClosed_ = false;\n this.adapter.removeClass(cssClasses.CLOSED_CLASS);\n }\n\n /**\n * Hides the progress indicator\n */\n close() {\n this.isClosed_ = true;\n this.adapter.addClass(cssClasses.CLOSED_CLASS);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCCircularProgressFoundation;\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {SpecificEventListener} from '@material/base/types';\nimport {MDCCheckbox, MDCCheckboxFactory} from '@material/checkbox/component';\nimport {closest} from '@material/dom/ponyfill';\nimport {MDCLinearProgress} from '@material/linear-progress/component';\n\nimport {MDCDataTableAdapter} from './adapter';\nimport {cssClasses, dataAttributes, events, messages, selectors, SortValue} from './constants';\nimport {MDCDataTableFoundation} from './foundation';\nimport {MDCDataTableRowSelectionChangedEventDetail} from './types';\n\n/**\n * Implementation of `MDCDataTableFoundation`\n */\nexport class MDCDataTable extends MDCComponent<MDCDataTableFoundation> {\n static attachTo(root: Element): MDCDataTable {\n return new MDCDataTable(root);\n }\n\n private headerRowCheckbox!: MDCCheckbox;\n private rowCheckboxList!: MDCCheckbox[];\n private checkboxFactory!: MDCCheckboxFactory;\n private linearProgress!: MDCLinearProgress;\n private headerRow!: HTMLElement;\n private content!: HTMLElement;\n private handleHeaderRowCheckboxChange!: SpecificEventListener<'change'>;\n private handleRowCheckboxChange!: SpecificEventListener<'change'>;\n private headerRowClickListener!:\n SpecificEventListener<'click'>; // Assigned in `initialSyncWithDOM()`\n\n initialize(checkboxFactory: MDCCheckboxFactory = (el: Element) => new MDCCheckbox(el)) {\n this.checkboxFactory = checkboxFactory;\n }\n\n initialSyncWithDOM() {\n this.headerRow =\n this.root.querySelector(`.${cssClasses.HEADER_ROW}`) as HTMLElement;\n this.handleHeaderRowCheckboxChange = () => {\n this.foundation.handleHeaderRowCheckboxChange();\n };\n this.headerRow.addEventListener(\n 'change', this.handleHeaderRowCheckboxChange);\n\n this.headerRowClickListener = (event) => {\n this.handleHeaderRowClick(event);\n };\n this.headerRow.addEventListener('click', this.headerRowClickListener);\n\n\n this.content =\n this.root.querySelector(`.${cssClasses.CONTENT}`) as HTMLElement;\n this.handleRowCheckboxChange = (event) => {\n this.foundation.handleRowCheckboxChange(event);\n };\n this.content.addEventListener('change', this.handleRowCheckboxChange);\n\n this.layout();\n }\n\n /**\n * Re-initializes header row checkbox and row checkboxes when selectable rows are added or removed from table.\n */\n layout() {\n this.foundation.layout();\n }\n\n /**\n * @return Returns array of header row cell elements.\n */\n getHeaderCells(): Element[] {\n return [].slice.call(this.root.querySelectorAll(selectors.HEADER_CELL));\n }\n\n /**\n * @return Returns array of row elements.\n */\n getRows(): Element[] {\n return this.foundation.getRows();\n }\n\n /**\n * @return Returns array of selected row ids.\n */\n getSelectedRowIds(): Array<string|null> {\n return this.foundation.getSelectedRowIds();\n }\n\n /**\n * Sets selected row ids. Overwrites previously selected rows.\n * @param rowIds Array of row ids that needs to be selected.\n */\n setSelectedRowIds(rowIds: string[]) {\n this.foundation.setSelectedRowIds(rowIds);\n }\n\n /**\n * Shows progress indicator when data table is in loading state.\n */\n showProgress() {\n this.getLinearProgress().open();\n this.foundation.showProgress();\n }\n\n /**\n * Hides progress indicator after data table is finished loading.\n */\n hideProgress() {\n this.foundation.hideProgress();\n this.getLinearProgress().close();\n }\n\n destroy() {\n if (this.handleHeaderRowCheckboxChange) {\n this.headerRow.removeEventListener(\n 'change', this.handleHeaderRowCheckboxChange);\n }\n if (this.headerRowClickListener) {\n this.headerRow.removeEventListener('click', this.headerRowClickListener);\n }\n if (this.handleRowCheckboxChange) {\n this.content.removeEventListener('change', this.handleRowCheckboxChange);\n }\n\n if (this.headerRowCheckbox) {\n this.headerRowCheckbox.destroy();\n }\n if (this.rowCheckboxList) {\n for (const checkbox of this.rowCheckboxList) {\n checkbox.destroy();\n }\n }\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCDataTableAdapter = {\n addClass: (className) => {\n this.root.classList.add(className);\n },\n removeClass: (className) => {\n this.root.classList.remove(className);\n },\n getHeaderCellElements: () => this.getHeaderCells(),\n getHeaderCellCount: () => this.getHeaderCells().length,\n getAttributeByHeaderCellIndex: (index, attribute) => {\n return this.getHeaderCells()[index].getAttribute(attribute);\n },\n setAttributeByHeaderCellIndex: (index, attribute, value) => {\n this.getHeaderCells()[index].setAttribute(attribute, value);\n },\n setClassNameByHeaderCellIndex: (index, className) => {\n this.getHeaderCells()[index].classList.add(className);\n },\n removeClassNameByHeaderCellIndex: (index, className) => {\n this.getHeaderCells()[index].classList.remove(className);\n },\n notifySortAction: (data) => {\n this.emit(events.SORTED, data, /** shouldBubble */ true);\n },\n getTableContainerHeight: () => {\n const tableContainer = this.root.querySelector<HTMLElement>(\n `.${cssClasses.TABLE_CONTAINER}`);\n\n if (!tableContainer) {\n throw new Error('MDCDataTable: Table container element not found.');\n }\n\n return tableContainer.getBoundingClientRect().height;\n },\n getTableHeaderHeight: () => {\n const tableHeader =\n this.root.querySelector<HTMLElement>(selectors.HEADER_ROW);\n\n if (!tableHeader) {\n throw new Error('MDCDataTable: Table header element not found.');\n }\n\n return tableHeader.getBoundingClientRect().height;\n },\n setProgressIndicatorStyles: (styles) => {\n const progressIndicator =\n this.root.querySelector<HTMLElement>(selectors.PROGRESS_INDICATOR);\n\n if (!progressIndicator) {\n throw new Error(\n 'MDCDataTable: Progress indicator element not found.');\n }\n\n progressIndicator.style.setProperty('height', styles.height);\n progressIndicator.style.setProperty('top', styles.top);\n },\n addClassAtRowIndex: (rowIndex: number, className: string) => {\n this.getRows()[rowIndex].classList.add(className);\n },\n getRowCount: () => this.getRows().length,\n getRowElements:\n () => [].slice.call(this.root.querySelectorAll(selectors.ROW)),\n getRowIdAtIndex: (rowIndex: number) =>\n this.getRows()[rowIndex].getAttribute(dataAttributes.ROW_ID),\n getRowIndexByChildElement: (el: Element) => {\n return this.getRows().indexOf(\n (closest(el, selectors.ROW) as HTMLElement));\n },\n getSelectedRowCount: () =>\n this.root.querySelectorAll(selectors.ROW_SELECTED).length,\n isCheckboxAtRowIndexChecked: (rowIndex: number) =>\n this.rowCheckboxList[rowIndex].checked,\n isHeaderRowCheckboxChecked: () => this.headerRowCheckbox.checked,\n isRowsSelectable: () =>\n !!this.root.querySelector(selectors.ROW_CHECKBOX) ||\n !!this.root.querySelector(selectors.HEADER_ROW_CHECKBOX),\n notifyRowSelectionChanged:\n (data: MDCDataTableRowSelectionChangedEventDetail) => {\n this.emit(\n events.ROW_SELECTION_CHANGED, {\n row: this.getRowByIndex(data.rowIndex),\n rowId: this.getRowIdByIndex(data.rowIndex),\n rowIndex: data.rowIndex,\n selected: data.selected,\n },\n /** shouldBubble */ true);\n },\n notifySelectedAll: () => {\n this.emit(events.SELECTED_ALL, {}, /** shouldBubble */ true);\n },\n notifyUnselectedAll: () => {\n this.emit(events.UNSELECTED_ALL, {}, /** shouldBubble */ true);\n },\n registerHeaderRowCheckbox: () => {\n if (this.headerRowCheckbox) {\n this.headerRowCheckbox.destroy();\n }\n\n const checkboxEl =\n (this.root.querySelector(selectors.HEADER_ROW_CHECKBOX) as\n HTMLElement);\n this.headerRowCheckbox = this.checkboxFactory(checkboxEl);\n },\n registerRowCheckboxes: () => {\n if (this.rowCheckboxList) {\n this.rowCheckboxList.forEach((checkbox) => {\n checkbox.destroy();\n });\n }\n\n this.rowCheckboxList = [];\n this.getRows().forEach((rowEl) => {\n const checkbox = this.checkboxFactory(\n (rowEl.querySelector(selectors.ROW_CHECKBOX) as HTMLElement));\n this.rowCheckboxList.push(checkbox);\n });\n },\n removeClassAtRowIndex: (rowIndex: number, className: string) => {\n this.getRows()[rowIndex].classList.remove(className);\n },\n setAttributeAtRowIndex:\n (rowIndex: number, attr: string, value: string) => {\n this.getRows()[rowIndex].setAttribute(attr, value);\n },\n setHeaderRowCheckboxChecked: (checked: boolean) => {\n this.headerRowCheckbox.checked = checked;\n },\n setHeaderRowCheckboxIndeterminate: (indeterminate: boolean) => {\n this.headerRowCheckbox.indeterminate = indeterminate;\n },\n setRowCheckboxCheckedAtIndex: (rowIndex: number, checked: boolean) => {\n this.rowCheckboxList[rowIndex].checked = checked;\n },\n setSortStatusLabelByHeaderCellIndex: (\n columnIndex: number, sortValue: SortValue) => {\n const headerCell = this.getHeaderCells()[columnIndex];\n const sortStatusLabel =\n headerCell.querySelector<HTMLElement>(selectors.SORT_STATUS_LABEL);\n\n if (!sortStatusLabel) return;\n\n sortStatusLabel.textContent =\n this.getSortStatusMessageBySortValue(sortValue);\n },\n };\n return new MDCDataTableFoundation(adapter);\n }\n\n private getRowByIndex(index: number): Element {\n return this.getRows()[index];\n }\n\n private getRowIdByIndex(index: number): string|null {\n return this.getRowByIndex(index).getAttribute(dataAttributes.ROW_ID);\n }\n\n private handleHeaderRowClick(event: Event): void {\n const headerCell =\n closest(event.target as Element, selectors.HEADER_CELL_WITH_SORT) as\n HTMLElement;\n\n if (!headerCell) {\n return;\n }\n\n const columnId = headerCell.getAttribute(dataAttributes.COLUMN_ID);\n const columnIndex = this.getHeaderCells().indexOf(headerCell);\n if (columnIndex === -1) {\n return;\n }\n\n this.foundation.handleSortAction({columnId, columnIndex, headerCell});\n }\n\n private getSortStatusMessageBySortValue(sortValue: SortValue): string {\n switch (sortValue) {\n case SortValue.ASCENDING:\n return messages.SORTED_IN_ASCENDING;\n case SortValue.DESCENDING:\n return messages.SORTED_IN_DESCENDING;\n default:\n return '';\n }\n }\n\n private getLinearProgressElement(): HTMLElement {\n const el =\n this.root.querySelector<HTMLElement>(`.${cssClasses.LINEAR_PROGRESS}`);\n if (!el) {\n throw new Error('MDCDataTable: linear progress element is not found.');\n }\n\n return el;\n }\n\n private getLinearProgress(): MDCLinearProgress {\n if (!this.linearProgress) {\n const el = this.getLinearProgressElement();\n this.linearProgress = new MDCLinearProgress(el);\n }\n\n return this.linearProgress;\n }\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * CSS class names used in component.\n */\nexport const cssClasses = {\n CELL: 'mdc-data-table__cell',\n CELL_NUMERIC: 'mdc-data-table__cell--numeric',\n CONTENT: 'mdc-data-table__content',\n HEADER_CELL: 'mdc-data-table__header-cell',\n HEADER_CELL_LABEL: 'mdc-data-table__header-cell-label',\n HEADER_CELL_SORTED: 'mdc-data-table__header-cell--sorted',\n HEADER_CELL_SORTED_DESCENDING:\n 'mdc-data-table__header-cell--sorted-descending',\n HEADER_CELL_WITH_SORT: 'mdc-data-table__header-cell--with-sort',\n HEADER_CELL_WRAPPER: 'mdc-data-table__header-cell-wrapper',\n HEADER_ROW: 'mdc-data-table__header-row',\n HEADER_ROW_CHECKBOX: 'mdc-data-table__header-row-checkbox',\n IN_PROGRESS: 'mdc-data-table--in-progress',\n LINEAR_PROGRESS: 'mdc-data-table__linear-progress',\n PAGINATION_ROWS_PER_PAGE_LABEL:\n 'mdc-data-table__pagination-rows-per-page-label',\n PAGINATION_ROWS_PER_PAGE_SELECT:\n 'mdc-data-table__pagination-rows-per-page-select',\n PROGRESS_INDICATOR: 'mdc-data-table__progress-indicator',\n ROOT: 'mdc-data-table',\n ROW: 'mdc-data-table__row',\n ROW_CHECKBOX: 'mdc-data-table__row-checkbox',\n ROW_SELECTED: 'mdc-data-table__row--selected',\n SORT_ICON_BUTTON: 'mdc-data-table__sort-icon-button',\n SORT_STATUS_LABEL: 'mdc-data-table__sort-status-label',\n TABLE_CONTAINER: 'mdc-data-table__table-container',\n};\n\n/**\n * DOM attributes used in component.\n */\nexport const attributes = {\n ARIA_SELECTED: 'aria-selected',\n ARIA_SORT: 'aria-sort',\n};\n\n/**\n * List of data attributes used in component.\n */\nexport const dataAttributes = {\n COLUMN_ID: 'data-column-id',\n ROW_ID: 'data-row-id',\n};\n\n/**\n * CSS selectors used in component.\n */\nexport const selectors = {\n CONTENT: `.${cssClasses.CONTENT}`,\n HEADER_CELL: `.${cssClasses.HEADER_CELL}`,\n HEADER_CELL_WITH_SORT: `.${cssClasses.HEADER_CELL_WITH_SORT}`,\n HEADER_ROW: `.${cssClasses.HEADER_ROW}`,\n HEADER_ROW_CHECKBOX: `.${cssClasses.HEADER_ROW_CHECKBOX}`,\n PROGRESS_INDICATOR: `.${cssClasses.PROGRESS_INDICATOR}`,\n ROW: `.${cssClasses.ROW}`,\n ROW_CHECKBOX: `.${cssClasses.ROW_CHECKBOX}`,\n ROW_SELECTED: `.${cssClasses.ROW_SELECTED}`,\n SORT_ICON_BUTTON: `.${cssClasses.SORT_ICON_BUTTON}`,\n SORT_STATUS_LABEL: `.${cssClasses.SORT_STATUS_LABEL}`,\n};\n\n/**\n * Messages used in component.\n */\nexport const messages = {\n SORTED_IN_DESCENDING: 'Sorted in descending order',\n SORTED_IN_ASCENDING: 'Sorted in ascending order',\n};\n\n/**\n * Attributes and selectors used in component.\n * @deprecated Use `attributes`, `dataAttributes` and `selectors` instead.\n */\nexport const strings = {\n ARIA_SELECTED: attributes.ARIA_SELECTED,\n ARIA_SORT: attributes.ARIA_SORT,\n DATA_ROW_ID_ATTR: dataAttributes.ROW_ID,\n HEADER_ROW_CHECKBOX_SELECTOR: selectors.HEADER_ROW_CHECKBOX,\n ROW_CHECKBOX_SELECTOR: selectors.ROW_CHECKBOX,\n ROW_SELECTED_SELECTOR: selectors.ROW_SELECTED,\n ROW_SELECTOR: selectors.ROW,\n};\n\n/**\n * Sort values defined by ARIA.\n * See https://www.w3.org/WAI/PF/aria/states_and_properties#aria-sort\n */\nexport enum SortValue {\n // Items are sorted in ascending order by this column.\n ASCENDING = 'ascending',\n\n // Items are sorted in descending order by this column.\n DESCENDING = 'descending',\n\n // There is no defined sort applied to the column.\n NONE = 'none',\n\n // A sort algorithm other than ascending or descending has been applied.\n OTHER = 'other',\n}\n\n/**\n * Event names used in component.\n */\nexport const events = {\n ROW_SELECTION_CHANGED: 'MDCDataTable:rowSelectionChanged',\n SELECTED_ALL: 'MDCDataTable:selectedAll',\n UNSELECTED_ALL: 'MDCDataTable:unselectedAll',\n SORTED: 'MDCDataTable:sorted',\n};\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\n\nimport {MDCDataTableAdapter} from './adapter';\nimport {cssClasses, SortValue, strings} from './constants';\nimport {SortActionEventData} from './types';\n\n/**\n * The Foundation of data table component containing pure business logic, any\n * logic requiring DOM manipulation are delegated to adapter methods.\n */\nexport class MDCDataTableFoundation extends MDCFoundation<MDCDataTableAdapter> {\n static get defaultAdapter(): MDCDataTableAdapter {\n return {\n addClass: () => undefined,\n addClassAtRowIndex: () => undefined,\n getAttributeByHeaderCellIndex: () => '',\n getHeaderCellCount: () => 0,\n getHeaderCellElements: () => [],\n getRowCount: () => 0,\n getRowElements: () => [],\n getRowIdAtIndex: () => '',\n getRowIndexByChildElement: () => 0,\n getSelectedRowCount: () => 0,\n getTableContainerHeight: () => 0,\n getTableHeaderHeight: () => 0,\n isCheckboxAtRowIndexChecked: () => false,\n isHeaderRowCheckboxChecked: () => false,\n isRowsSelectable: () => false,\n notifyRowSelectionChanged: () => undefined,\n notifySelectedAll: () => undefined,\n notifySortAction: () => undefined,\n notifyUnselectedAll: () => undefined,\n registerHeaderRowCheckbox: () => undefined,\n registerRowCheckboxes: () => undefined,\n removeClass: () => undefined,\n removeClassAtRowIndex: () => undefined,\n removeClassNameByHeaderCellIndex: () => undefined,\n setAttributeAtRowIndex: () => undefined,\n setAttributeByHeaderCellIndex: () => undefined,\n setClassNameByHeaderCellIndex: () => undefined,\n setHeaderRowCheckboxChecked: () => undefined,\n setHeaderRowCheckboxIndeterminate: () => undefined,\n setProgressIndicatorStyles: () => undefined,\n setRowCheckboxCheckedAtIndex: () => undefined,\n setSortStatusLabelByHeaderCellIndex: () => undefined,\n };\n }\n\n constructor(adapter?: Partial<MDCDataTableAdapter>) {\n super({...MDCDataTableFoundation.defaultAdapter, ...adapter});\n }\n\n /**\n * Re-initializes header row checkbox and row checkboxes when selectable rows are added or removed from table.\n * Use this if registering checkbox is synchronous.\n */\n layout() {\n if (this.adapter.isRowsSelectable()) {\n this.adapter.registerHeaderRowCheckbox();\n this.adapter.registerRowCheckboxes();\n\n this.setHeaderRowCheckboxState();\n }\n }\n\n /**\n * Re-initializes header row checkbox and row checkboxes when selectable rows are added or removed from table.\n * Use this if registering checkbox is asynchronous.\n */\n async layoutAsync(): Promise<void> {\n if (this.adapter.isRowsSelectable()) {\n await this.adapter.registerHeaderRowCheckbox();\n await this.adapter.registerRowCheckboxes();\n\n this.setHeaderRowCheckboxState();\n }\n }\n\n /**\n * @return Returns array of row elements.\n */\n getRows(): Element[] {\n return this.adapter.getRowElements();\n }\n\n /**\n * @return Array of header cell elements.\n */\n getHeaderCells(): Element[] {\n return this.adapter.getHeaderCellElements();\n }\n\n /**\n * Sets selected row ids. Overwrites previously selected rows.\n * @param rowIds Array of row ids that needs to be selected.\n */\n setSelectedRowIds(rowIds: string[]) {\n for (let rowIndex = 0; rowIndex < this.adapter.getRowCount(); rowIndex++) {\n const rowId = this.adapter.getRowIdAtIndex(rowIndex);\n\n let isSelected = false;\n if (rowId && rowIds.indexOf(rowId) >= 0) {\n isSelected = true;\n }\n\n this.adapter.setRowCheckboxCheckedAtIndex(rowIndex, isSelected);\n this.selectRowAtIndex(rowIndex, isSelected);\n }\n\n this.setHeaderRowCheckboxState();\n }\n\n /**\n * @return Returns array of all row ids.\n */\n getRowIds(): Array<string|null> {\n const rowIds = [];\n for (let rowIndex = 0; rowIndex < this.adapter.getRowCount(); rowIndex++) {\n rowIds.push(this.adapter.getRowIdAtIndex(rowIndex));\n }\n\n return rowIds;\n }\n\n /**\n * @return Returns array of selected row ids.\n */\n getSelectedRowIds(): Array<string|null> {\n const selectedRowIds: Array<string|null> = [];\n for (let rowIndex = 0; rowIndex < this.adapter.getRowCount(); rowIndex++) {\n if (this.adapter.isCheckboxAtRowIndexChecked(rowIndex)) {\n selectedRowIds.push(this.adapter.getRowIdAtIndex(rowIndex));\n }\n }\n\n return selectedRowIds;\n }\n\n /**\n * Handles header row checkbox change event.\n */\n handleHeaderRowCheckboxChange() {\n const isHeaderChecked = this.adapter.isHeaderRowCheckboxChecked();\n\n for (let rowIndex = 0; rowIndex < this.adapter.getRowCount(); rowIndex++) {\n this.adapter.setRowCheckboxCheckedAtIndex(rowIndex, isHeaderChecked);\n this.selectRowAtIndex(rowIndex, isHeaderChecked);\n }\n\n if (isHeaderChecked) {\n this.adapter.notifySelectedAll();\n } else {\n this.adapter.notifyUnselectedAll();\n }\n }\n\n /**\n * Handles change event originated from row checkboxes.\n */\n handleRowCheckboxChange(event: Event) {\n const rowIndex = this.adapter.getRowIndexByChildElement(\n event.target as HTMLInputElement);\n\n if (rowIndex === -1) {\n return;\n }\n\n const selected = this.adapter.isCheckboxAtRowIndexChecked(rowIndex);\n\n this.selectRowAtIndex(rowIndex, selected);\n this.setHeaderRowCheckboxState();\n\n const rowId = this.adapter.getRowIdAtIndex(rowIndex);\n this.adapter.notifyRowSelectionChanged({rowId, rowIndex, selected});\n }\n\n /**\n * Handles sort action on sortable header cell.\n */\n handleSortAction(eventData: SortActionEventData) {\n const {columnId, columnIndex, headerCell} = eventData;\n\n // Reset sort attributes / classes on other header cells.\n for (let index = 0; index < this.adapter.getHeaderCellCount(); index++) {\n if (index === columnIndex) {\n continue;\n }\n\n this.adapter.removeClassNameByHeaderCellIndex(\n index, cssClasses.HEADER_CELL_SORTED);\n this.adapter.removeClassNameByHeaderCellIndex(\n index, cssClasses.HEADER_CELL_SORTED_DESCENDING);\n this.adapter.setAttributeByHeaderCellIndex(\n index, strings.ARIA_SORT, SortValue.NONE);\n this.adapter.setSortStatusLabelByHeaderCellIndex(index, SortValue.NONE);\n }\n\n // Set appropriate sort attributes / classes on target header cell.\n this.adapter.setClassNameByHeaderCellIndex(\n columnIndex, cssClasses.HEADER_CELL_SORTED);\n\n const currentSortValue = this.adapter.getAttributeByHeaderCellIndex(\n columnIndex, strings.ARIA_SORT);\n let sortValue = SortValue.NONE;\n\n // Set to descending if sorted on ascending order.\n if (currentSortValue === SortValue.ASCENDING) {\n this.adapter.setClassNameByHeaderCellIndex(\n columnIndex, cssClasses.HEADER_CELL_SORTED_DESCENDING);\n this.adapter.setAttributeByHeaderCellIndex(\n columnIndex, strings.ARIA_SORT, SortValue.DESCENDING);\n sortValue = SortValue.DESCENDING;\n // Set to ascending if sorted on descending order.\n } else if (currentSortValue === SortValue.DESCENDING) {\n this.adapter.removeClassNameByHeaderCellIndex(\n columnIndex, cssClasses.HEADER_CELL_SORTED_DESCENDING);\n this.adapter.setAttributeByHeaderCellIndex(\n columnIndex, strings.ARIA_SORT, SortValue.ASCENDING);\n sortValue = SortValue.ASCENDING;\n } else {\n // Set to ascending by default when not sorted.\n this.adapter.setAttributeByHeaderCellIndex(\n columnIndex, strings.ARIA_SORT, SortValue.ASCENDING);\n sortValue = SortValue.ASCENDING;\n }\n\n this.adapter.setSortStatusLabelByHeaderCellIndex(columnIndex, sortValue);\n\n this.adapter.notifySortAction({\n columnId,\n columnIndex,\n headerCell,\n sortValue,\n });\n }\n\n /**\n * Shows progress indicator blocking only the table body content when in\n * loading state.\n */\n showProgress() {\n const tableHeaderHeight = this.adapter.getTableHeaderHeight();\n // Calculate the height of table content (Not scroll content) excluding\n // header row height.\n const height = this.adapter.getTableContainerHeight() - tableHeaderHeight;\n const top = tableHeaderHeight;\n\n this.adapter.setProgressIndicatorStyles({\n height: `${height}px`,\n top: `${top}px`,\n });\n this.adapter.addClass(cssClasses.IN_PROGRESS);\n }\n\n /**\n * Hides progress indicator when data table is finished loading.\n */\n hideProgress() {\n this.adapter.removeClass(cssClasses.IN_PROGRESS);\n }\n\n /**\n * Updates header row checkbox state based on number of rows selected.\n */\n private setHeaderRowCheckboxState() {\n if (this.adapter.getSelectedRowCount() === 0) {\n this.adapter.setHeaderRowCheckboxChecked(false);\n this.adapter.setHeaderRowCheckboxIndeterminate(false);\n } else if (\n this.adapter.getSelectedRowCount() === this.adapter.getRowCount()) {\n this.adapter.setHeaderRowCheckboxChecked(true);\n this.adapter.setHeaderRowCheckboxIndeterminate(false);\n } else {\n this.adapter.setHeaderRowCheckboxIndeterminate(true);\n this.adapter.setHeaderRowCheckboxChecked(false);\n }\n }\n\n /**\n * Sets the attributes of row element based on selection state.\n */\n private selectRowAtIndex(rowIndex: number, selected: boolean) {\n if (selected) {\n this.adapter.addClassAtRowIndex(rowIndex, cssClasses.ROW_SELECTED);\n this.adapter.setAttributeAtRowIndex(\n rowIndex, strings.ARIA_SELECTED, 'true');\n } else {\n this.adapter.removeClassAtRowIndex(rowIndex, cssClasses.ROW_SELECTED);\n this.adapter.setAttributeAtRowIndex(\n rowIndex, strings.ARIA_SELECTED, 'false');\n }\n }\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './foundation';\nexport * from './constants';\nexport * from './types';\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {SpecificEventListener} from '@material/base/types';\nimport {FocusTrap} from '@material/dom/focus-trap';\nimport {closest, matches} from '@material/dom/ponyfill';\nimport {MDCRipple} from '@material/ripple/component';\nimport {MDCDialogAdapter} from './adapter';\nimport {MDCDialogFoundation} from './foundation';\nimport {MDCDialogCloseEventDetail} from './types';\nimport * as util from './util';\nimport {MDCDialogFocusTrapFactory} from './util';\n\nconst {strings} = MDCDialogFoundation;\n\nexport class MDCDialog extends MDCComponent<MDCDialogFoundation> {\n get isOpen() {\n return this.foundation.isOpen();\n }\n\n get escapeKeyAction() {\n return this.foundation.getEscapeKeyAction();\n }\n\n set escapeKeyAction(action) {\n this.foundation.setEscapeKeyAction(action);\n }\n\n get scrimClickAction() {\n return this.foundation.getScrimClickAction();\n }\n\n set scrimClickAction(action) {\n this.foundation.setScrimClickAction(action);\n }\n\n get autoStackButtons() {\n return this.foundation.getAutoStackButtons();\n }\n\n set autoStackButtons(autoStack) {\n this.foundation.setAutoStackButtons(autoStack);\n }\n\n static attachTo(root: Element) {\n return new MDCDialog(root);\n }\n\n private buttonRipples!: MDCRipple[]; // assigned in initialize()\n private buttons!: HTMLElement[]; // assigned in initialize()\n private container!: HTMLElement; // assigned in initialize()\n private content!: HTMLElement|null; // assigned in initialize()\n private defaultButton!: HTMLElement|null; // assigned in initialize()\n\n private focusTrap!: FocusTrap; // assigned in initialSyncWithDOM()\n private focusTrapFactory!:\n MDCDialogFocusTrapFactory; // assigned in initialize()\n\n private handleClick!:\n SpecificEventListener<'click'>; // assigned in initialSyncWithDOM()\n private handleKeydown!:\n SpecificEventListener<'keydown'>; // assigned in initialSyncWithDOM()\n private handleDocumentKeydown!:\n SpecificEventListener<'keydown'>; // assigned in initialSyncWithDOM()\n private handleLayout!: EventListener; // assigned in initialSyncWithDOM()\n private handleOpening!: EventListener; // assigned in initialSyncWithDOM()\n private handleClosing!: () => void; // assigned in initialSyncWithDOM()\n\n initialize(\n focusTrapFactory: MDCDialogFocusTrapFactory = (el, focusOptions) => new FocusTrap(el, focusOptions),\n ) {\n const container =\n this.root.querySelector<HTMLElement>(strings.CONTAINER_SELECTOR);\n if (!container) {\n throw new Error(`Dialog component requires a ${strings.CONTAINER_SELECTOR} container element`);\n }\n this.container = container;\n this.content =\n this.root.querySelector<HTMLElement>(strings.CONTENT_SELECTOR);\n this.buttons = [].slice.call(\n this.root.querySelectorAll<HTMLElement>(strings.BUTTON_SELECTOR));\n this.defaultButton = this.root.querySelector<HTMLElement>(\n `[${strings.BUTTON_DEFAULT_ATTRIBUTE}]`);\n this.focusTrapFactory = focusTrapFactory;\n this.buttonRipples = [];\n\n for (const buttonEl of this.buttons) {\n this.buttonRipples.push(new MDCRipple(buttonEl));\n }\n }\n\n initialSyncWithDOM() {\n this.focusTrap = util.createFocusTrapInstance(\n this.container, this.focusTrapFactory,\n this.getInitialFocusEl() || undefined);\n\n this.handleClick = this.foundation.handleClick.bind(this.foundation);\n this.handleKeydown = this.foundation.handleKeydown.bind(this.foundation);\n this.handleDocumentKeydown =\n this.foundation.handleDocumentKeydown.bind(this.foundation);\n this.handleLayout = this.layout.bind(this);\n\n const LAYOUT_EVENTS = ['resize', 'orientationchange'];\n this.handleOpening = () => {\n LAYOUT_EVENTS.forEach((evtType) => {\n window.addEventListener(evtType, this.handleLayout);\n });\n document.addEventListener('keydown', this.handleDocumentKeydown);\n };\n this.handleClosing = () => {\n LAYOUT_EVENTS.forEach((evtType) => {\n window.removeEventListener(evtType, this.handleLayout);\n });\n document.removeEventListener('keydown', this.handleDocumentKeydown);\n };\n\n this.listen('click', this.handleClick);\n this.listen('keydown', this.handleKeydown);\n this.listen(strings.OPENING_EVENT, this.handleOpening);\n this.listen(strings.CLOSING_EVENT, this.handleClosing);\n }\n\n destroy() {\n this.unlisten('click', this.handleClick);\n this.unlisten('keydown', this.handleKeydown);\n this.unlisten(strings.OPENING_EVENT, this.handleOpening);\n this.unlisten(strings.CLOSING_EVENT, this.handleClosing);\n this.handleClosing();\n\n this.buttonRipples.forEach((ripple) => {\n ripple.destroy();\n });\n super.destroy();\n }\n\n layout() {\n this.foundation.layout();\n }\n\n open() {\n this.foundation.open();\n }\n\n close(action = '') {\n this.foundation.close(action);\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCDialogAdapter = {\n addBodyClass: (className) => document.body.classList.add(className),\n addClass: (className) => this.root.classList.add(className),\n areButtonsStacked: () => util.areTopsMisaligned(this.buttons),\n clickDefaultButton: () => {\n if (this.defaultButton) {\n this.defaultButton.click();\n }\n },\n eventTargetMatches: (target, selector) =>\n target ? matches(target as Element, selector) : false,\n getActionFromEvent: (evt: Event) => {\n if (!evt.target) {\n return '';\n }\n const element = closest(evt.target as Element, `[${strings.ACTION_ATTRIBUTE}]`);\n return element && element.getAttribute(strings.ACTION_ATTRIBUTE);\n },\n getInitialFocusEl: () => this.getInitialFocusEl(),\n hasClass: (className) => this.root.classList.contains(className),\n isContentScrollable: () => util.isScrollable(this.content),\n notifyClosed: (action) => this.emit<MDCDialogCloseEventDetail>(\n strings.CLOSED_EVENT, action ? {action} : {}),\n notifyClosing: (action) => this.emit<MDCDialogCloseEventDetail>(\n strings.CLOSING_EVENT, action ? {action} : {}),\n notifyOpened: () => this.emit(strings.OPENED_EVENT, {}),\n notifyOpening: () => this.emit(strings.OPENING_EVENT, {}),\n releaseFocus: () => {\n this.focusTrap.releaseFocus();\n },\n removeBodyClass: (className) => document.body.classList.remove(className),\n removeClass: (className) => this.root.classList.remove(className),\n reverseButtons: () => {\n this.buttons.reverse();\n this.buttons.forEach((button) => {\n button.parentElement!.appendChild(button);\n });\n },\n trapFocus: () => {\n this.focusTrap.trapFocus();\n },\n registerContentEventHandler: (evt, handler) => {\n if (this.content instanceof HTMLElement) {\n this.content.addEventListener(evt, handler);\n }\n },\n deregisterContentEventHandler: (evt, handler) => {\n if (this.content instanceof HTMLElement) {\n this.content.removeEventListener(evt, handler);\n }\n },\n isScrollableContentAtTop: () => {\n return util.isScrollAtTop(this.content);\n },\n isScrollableContentAtBottom: () => {\n return util.isScrollAtBottom(this.content);\n },\n };\n return new MDCDialogFoundation(adapter);\n }\n\n private getInitialFocusEl(): HTMLElement|null {\n return this.root.querySelector(`[${strings.INITIAL_FOCUS_ATTRIBUTE}]`);\n }\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport const cssClasses = {\n CLOSING: 'mdc-dialog--closing',\n OPEN: 'mdc-dialog--open',\n OPENING: 'mdc-dialog--opening',\n SCROLLABLE: 'mdc-dialog--scrollable',\n SCROLL_LOCK: 'mdc-dialog-scroll-lock',\n STACKED: 'mdc-dialog--stacked',\n FULLSCREEN: 'mdc-dialog--fullscreen',\n // Class for showing a scroll divider on full-screen dialog header element.\n // Should only be displayed on scrollable content, when the dialog content is\n // scrolled \"underneath\" the header.\n SCROLL_DIVIDER_HEADER: 'mdc-dialog-scroll-divider-header',\n // Class for showing a scroll divider on a full-screen dialog footer element.\n // Should only be displayed on scrolalble content, when the dialog content is\n // obscured \"underneath\" the footer.\n SCROLL_DIVIDER_FOOTER: 'mdc-dialog-scroll-divider-footer',\n};\n\nexport const strings = {\n ACTION_ATTRIBUTE: 'data-mdc-dialog-action',\n BUTTON_DEFAULT_ATTRIBUTE: 'data-mdc-dialog-button-default',\n BUTTON_SELECTOR: '.mdc-dialog__button',\n CLOSED_EVENT: 'MDCDialog:closed',\n CLOSE_ACTION: 'close',\n CLOSING_EVENT: 'MDCDialog:closing',\n CONTAINER_SELECTOR: '.mdc-dialog__container',\n CONTENT_SELECTOR: '.mdc-dialog__content',\n DESTROY_ACTION: 'destroy',\n INITIAL_FOCUS_ATTRIBUTE: 'data-mdc-dialog-initial-focus',\n OPENED_EVENT: 'MDCDialog:opened',\n OPENING_EVENT: 'MDCDialog:opening',\n SCRIM_SELECTOR: '.mdc-dialog__scrim',\n SUPPRESS_DEFAULT_PRESS_SELECTOR: [\n 'textarea',\n '.mdc-menu .mdc-list-item',\n ].join(', '),\n SURFACE_SELECTOR: '.mdc-dialog__surface',\n};\n\nexport const numbers = {\n DIALOG_ANIMATION_CLOSE_TIME_MS: 75,\n DIALOG_ANIMATION_OPEN_TIME_MS: 150,\n};\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {AnimationFrame} from '@material/animation/animationframe';\nimport {MDCFoundation} from '@material/base/foundation';\nimport {SpecificEventListener} from '@material/base/types';\n\nimport {MDCDialogAdapter} from './adapter';\nimport {cssClasses, numbers, strings} from './constants';\n\nenum AnimationKeys {\n POLL_SCROLL_POS = 'poll_scroll_position'\n}\n\nexport class MDCDialogFoundation extends MDCFoundation<MDCDialogAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get numbers() {\n return numbers;\n }\n\n static get defaultAdapter(): MDCDialogAdapter {\n return {\n addBodyClass: () => undefined,\n addClass: () => undefined,\n areButtonsStacked: () => false,\n clickDefaultButton: () => undefined,\n eventTargetMatches: () => false,\n getActionFromEvent: () => '',\n getInitialFocusEl: () => null,\n hasClass: () => false,\n isContentScrollable: () => false,\n notifyClosed: () => undefined,\n notifyClosing: () => undefined,\n notifyOpened: () => undefined,\n notifyOpening: () => undefined,\n releaseFocus: () => undefined,\n removeBodyClass: () => undefined,\n removeClass: () => undefined,\n reverseButtons: () => undefined,\n trapFocus: () => undefined,\n registerContentEventHandler: () => undefined,\n deregisterContentEventHandler: () => undefined,\n isScrollableContentAtTop: () => false,\n isScrollableContentAtBottom: () => false,\n };\n }\n\n private dialogOpen = false;\n private isFullscreen = false;\n private animationFrame = 0;\n private animationTimer = 0;\n private layoutFrame = 0;\n private escapeKeyAction = strings.CLOSE_ACTION;\n private scrimClickAction = strings.CLOSE_ACTION;\n private autoStackButtons = true;\n private areButtonsStacked = false;\n private suppressDefaultPressSelector =\n strings.SUPPRESS_DEFAULT_PRESS_SELECTOR;\n private readonly contentScrollHandler: SpecificEventListener<'scroll'>;\n private readonly animFrame: AnimationFrame;\n\n constructor(adapter?: Partial<MDCDialogAdapter>) {\n super({...MDCDialogFoundation.defaultAdapter, ...adapter});\n\n this.animFrame = new AnimationFrame();\n this.contentScrollHandler = () => {\n this.handleScrollEvent();\n };\n }\n\n init() {\n if (this.adapter.hasClass(cssClasses.STACKED)) {\n this.setAutoStackButtons(false);\n }\n this.isFullscreen = this.adapter.hasClass(cssClasses.FULLSCREEN);\n }\n\n destroy() {\n if (this.dialogOpen) {\n this.close(strings.DESTROY_ACTION);\n }\n\n if (this.animationTimer) {\n clearTimeout(this.animationTimer);\n this.handleAnimationTimerEnd();\n }\n\n if (this.layoutFrame) {\n cancelAnimationFrame(this.layoutFrame);\n this.layoutFrame = 0;\n }\n\n if (this.isFullscreen && this.adapter.isContentScrollable()) {\n this.adapter.deregisterContentEventHandler(\n 'scroll', this.contentScrollHandler);\n }\n }\n\n open() {\n this.dialogOpen = true;\n this.adapter.notifyOpening();\n this.adapter.addClass(cssClasses.OPENING);\n if (this.isFullscreen && this.adapter.isContentScrollable()) {\n this.adapter.registerContentEventHandler(\n 'scroll', this.contentScrollHandler);\n }\n\n // Wait a frame once display is no longer \"none\", to establish basis for\n // animation\n this.runNextAnimationFrame(() => {\n this.adapter.addClass(cssClasses.OPEN);\n this.adapter.addBodyClass(cssClasses.SCROLL_LOCK);\n\n this.layout();\n\n this.animationTimer = setTimeout(() => {\n this.handleAnimationTimerEnd();\n this.adapter.trapFocus(this.adapter.getInitialFocusEl());\n this.adapter.notifyOpened();\n }, numbers.DIALOG_ANIMATION_OPEN_TIME_MS);\n });\n }\n\n close(action = '') {\n if (!this.dialogOpen) {\n // Avoid redundant close calls (and events), e.g. from keydown on elements\n // that inherently emit click\n return;\n }\n\n this.dialogOpen = false;\n this.adapter.notifyClosing(action);\n this.adapter.addClass(cssClasses.CLOSING);\n this.adapter.removeClass(cssClasses.OPEN);\n this.adapter.removeBodyClass(cssClasses.SCROLL_LOCK);\n if (this.isFullscreen && this.adapter.isContentScrollable()) {\n this.adapter.deregisterContentEventHandler(\n 'scroll', this.contentScrollHandler);\n }\n\n cancelAnimationFrame(this.animationFrame);\n this.animationFrame = 0;\n\n clearTimeout(this.animationTimer);\n this.animationTimer = setTimeout(() => {\n this.adapter.releaseFocus();\n this.handleAnimationTimerEnd();\n this.adapter.notifyClosed(action);\n }, numbers.DIALOG_ANIMATION_CLOSE_TIME_MS);\n }\n\n isOpen() {\n return this.dialogOpen;\n }\n\n getEscapeKeyAction(): string {\n return this.escapeKeyAction;\n }\n\n setEscapeKeyAction(action: string) {\n this.escapeKeyAction = action;\n }\n\n getScrimClickAction(): string {\n return this.scrimClickAction;\n }\n\n setScrimClickAction(action: string) {\n this.scrimClickAction = action;\n }\n\n getAutoStackButtons(): boolean {\n return this.autoStackButtons;\n }\n\n setAutoStackButtons(autoStack: boolean) {\n this.autoStackButtons = autoStack;\n }\n\n getSuppressDefaultPressSelector(): string {\n return this.suppressDefaultPressSelector;\n }\n\n setSuppressDefaultPressSelector(selector: string) {\n this.suppressDefaultPressSelector = selector;\n }\n\n layout() {\n if (this.layoutFrame) {\n cancelAnimationFrame(this.layoutFrame);\n }\n this.layoutFrame = requestAnimationFrame(() => {\n this.layoutInternal();\n this.layoutFrame = 0;\n });\n }\n\n /** Handles click on the dialog root element. */\n handleClick(evt: MouseEvent) {\n const isScrim =\n this.adapter.eventTargetMatches(evt.target, strings.SCRIM_SELECTOR);\n // Check for scrim click first since it doesn't require querying ancestors.\n if (isScrim && this.scrimClickAction !== '') {\n this.close(this.scrimClickAction);\n } else {\n const action = this.adapter.getActionFromEvent(evt);\n if (action) {\n this.close(action);\n }\n }\n }\n\n /** Handles keydown on the dialog root element. */\n handleKeydown(evt: KeyboardEvent) {\n const isEnter = evt.key === 'Enter' || evt.keyCode === 13;\n if (!isEnter) {\n return;\n }\n const action = this.adapter.getActionFromEvent(evt);\n if (action) {\n // Action button callback is handled in `handleClick`,\n // since space/enter keydowns on buttons trigger click events.\n return;\n }\n\n // `composedPath` is used here, when available, to account for use cases\n // where a target meant to suppress the default press behaviour\n // may exist in a shadow root.\n // For example, a textarea inside a web component:\n // <mwc-dialog>\n // <horizontal-layout>\n // #shadow-root (open)\n // <mwc-textarea>\n // #shadow-root (open)\n // <textarea></textarea>\n // </mwc-textarea>\n // </horizontal-layout>\n // </mwc-dialog>\n const target = evt.composedPath ? evt.composedPath()[0] : evt.target;\n const isDefault = this.suppressDefaultPressSelector ?\n !this.adapter.eventTargetMatches(\n target, this.suppressDefaultPressSelector) :\n true;\n if (isEnter && isDefault) {\n this.adapter.clickDefaultButton();\n }\n }\n\n /** Handles keydown on the document. */\n handleDocumentKeydown(evt: KeyboardEvent) {\n const isEscape = evt.key === 'Escape' || evt.keyCode === 27;\n if (isEscape && this.escapeKeyAction !== '') {\n this.close(this.escapeKeyAction);\n }\n }\n\n /**\n * Handles scroll event on the dialog's content element -- showing a scroll\n * divider on the header or footer based on the scroll position. This handler\n * should only be registered on full-screen dialogs with scrollable content.\n */\n private handleScrollEvent() {\n // Since scroll events can fire at a high rate, we throttle these events by\n // using requestAnimationFrame.\n this.animFrame.request(AnimationKeys.POLL_SCROLL_POS, () => {\n this.toggleScrollDividerHeader();\n this.toggleScrollDividerFooter();\n });\n }\n\n private layoutInternal() {\n if (this.autoStackButtons) {\n this.detectStackedButtons();\n }\n this.toggleScrollableClasses();\n }\n\n private handleAnimationTimerEnd() {\n this.animationTimer = 0;\n this.adapter.removeClass(cssClasses.OPENING);\n this.adapter.removeClass(cssClasses.CLOSING);\n }\n\n /**\n * Runs the given logic on the next animation frame, using setTimeout to\n * factor in Firefox reflow behavior.\n */\n private runNextAnimationFrame(callback: () => void) {\n cancelAnimationFrame(this.animationFrame);\n this.animationFrame = requestAnimationFrame(() => {\n this.animationFrame = 0;\n clearTimeout(this.animationTimer);\n this.animationTimer = setTimeout(callback, 0);\n });\n }\n\n private detectStackedButtons() {\n // Remove the class first to let us measure the buttons' natural positions.\n this.adapter.removeClass(cssClasses.STACKED);\n\n const areButtonsStacked = this.adapter.areButtonsStacked();\n\n if (areButtonsStacked) {\n this.adapter.addClass(cssClasses.STACKED);\n }\n\n if (areButtonsStacked !== this.areButtonsStacked) {\n this.adapter.reverseButtons();\n this.areButtonsStacked = areButtonsStacked;\n }\n }\n\n private toggleScrollableClasses() {\n // Remove the class first to let us measure the natural height of the\n // content.\n this.adapter.removeClass(cssClasses.SCROLLABLE);\n if (this.adapter.isContentScrollable()) {\n this.adapter.addClass(cssClasses.SCROLLABLE);\n\n if (this.isFullscreen) {\n // If dialog is full-screen and scrollable, check if a scroll divider\n // should be shown.\n this.toggleScrollDividerHeader();\n this.toggleScrollDividerFooter();\n }\n }\n }\n\n private toggleScrollDividerHeader() {\n if (!this.adapter.isScrollableContentAtTop()) {\n this.adapter.addClass(cssClasses.SCROLL_DIVIDER_HEADER);\n } else if (this.adapter.hasClass(cssClasses.SCROLL_DIVIDER_HEADER)) {\n this.adapter.removeClass(cssClasses.SCROLL_DIVIDER_HEADER);\n }\n }\n\n private toggleScrollDividerFooter() {\n if (!this.adapter.isScrollableContentAtBottom()) {\n this.adapter.addClass(cssClasses.SCROLL_DIVIDER_FOOTER);\n } else if (this.adapter.hasClass(cssClasses.SCROLL_DIVIDER_FOOTER)) {\n this.adapter.removeClass(cssClasses.SCROLL_DIVIDER_FOOTER);\n }\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCDialogFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport * as util from './util';\n\nexport {util};\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './types';\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {FocusOptions, FocusTrap} from '@material/dom/focus-trap';\n\nexport type MDCDialogFocusTrapFactory = (\n element: HTMLElement,\n options: FocusOptions,\n) => FocusTrap;\n\nexport function createFocusTrapInstance(\n surfaceEl: HTMLElement,\n focusTrapFactory: MDCDialogFocusTrapFactory,\n initialFocusEl?: HTMLElement,\n): FocusTrap {\n return focusTrapFactory(surfaceEl, {initialFocusEl});\n}\n\nexport function isScrollable(el: HTMLElement | null): boolean {\n return el ? el.scrollHeight > el.offsetHeight : false;\n}\n\n/**\n * For scrollable content, returns true if the content has not been scrolled\n * (that is, the scroll content is as the \"top\"). This is used in full-screen\n * dialogs, where the scroll divider is expected only to appear once the\n * content has been scrolled \"underneath\" the header bar.\n */\nexport function isScrollAtTop(el: HTMLElement|null) {\n return el ? el.scrollTop === 0 : false;\n}\n\n/**\n * For scrollable content, returns true if the content has been scrolled all the\n * way to the bottom. This is used in full-screen dialogs, where the footer\n * scroll divider is expected only to appear when the content is \"cut-off\" by\n * the footer bar.\n */\nexport function isScrollAtBottom(el: HTMLElement|null) {\n return el ? Math.ceil(el.scrollHeight - el.scrollTop) === el.clientHeight :\n false;\n}\n\nexport function areTopsMisaligned(els: HTMLElement[]): boolean {\n const tops = new Set();\n [].forEach.call(els, (el: HTMLElement) => tops.add(el.offsetTop));\n return tops.size > 1;\n}\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * Priorities for the announce function\n */\nexport enum AnnouncerPriority {\n POLITE = 'polite',\n ASSERTIVE = 'assertive',\n}\n\n/**\n * Data attribute added to live region element.\n */\nexport const DATA_MDC_DOM_ANNOUNCE = 'data-mdc-dom-announce';\n\n/**\n * Announces the given message with optional priority, defaulting to \"polite\"\n */\nexport function announce(message: string, priority?: AnnouncerPriority) {\n Announcer.getInstance().say(message, priority);\n}\n\nclass Announcer {\n private static instance: Announcer;\n private readonly liveRegions: Map<AnnouncerPriority, Element>;\n\n static getInstance(): Announcer {\n if (!Announcer.instance) {\n Announcer.instance = new Announcer();\n }\n\n return Announcer.instance;\n }\n\n // Constructor made private to ensure only the singleton is used\n private constructor() {\n this.liveRegions = new Map();\n }\n\n say(message: string, priority: AnnouncerPriority = AnnouncerPriority.POLITE) {\n const liveRegion = this.getLiveRegion(priority);\n // Reset the region to pick up the message, even if the message is the\n // exact same as before.\n liveRegion.textContent = '';\n // Timeout is necessary for screen readers like NVDA and VoiceOver.\n setTimeout(() => {\n liveRegion.textContent = message;\n document.addEventListener('click', clearLiveRegion);\n }, 1);\n\n function clearLiveRegion() {\n liveRegion.textContent = '';\n document.removeEventListener('click', clearLiveRegion);\n }\n }\n\n private getLiveRegion(priority: AnnouncerPriority): Element {\n const existingLiveRegion = this.liveRegions.get(priority);\n if (existingLiveRegion &&\n document.body.contains(existingLiveRegion as Node)) {\n return existingLiveRegion;\n }\n\n const liveRegion = this.createLiveRegion(priority);\n this.liveRegions.set(priority, liveRegion);\n return liveRegion;\n }\n\n private createLiveRegion(priority: AnnouncerPriority): Element {\n const el = document.createElement('div');\n el.style.position = 'absolute';\n el.style.top = '-9999px';\n el.style.left = '-9999px';\n el.style.height = '1px';\n el.style.overflow = 'hidden';\n el.setAttribute('aria-atomic', 'true');\n el.setAttribute('aria-live', priority);\n el.setAttribute(DATA_MDC_DOM_ANNOUNCE, 'true');\n document.body.appendChild(el);\n return el;\n }\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * Determine whether the current browser supports passive event listeners, and\n * if so, use them.\n */\nexport function applyPassive(globalObj: Window = window):\n boolean | EventListenerOptions {\n return supportsPassiveOption(globalObj) ?\n {passive: true} as AddEventListenerOptions :\n false;\n}\n\nfunction supportsPassiveOption(globalObj: Window = window): boolean {\n // See\n // https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener\n let passiveSupported = false;\n\n try {\n const options = {\n // This function will be called when the browser\n // attempts to access the passive property.\n get passive() {\n passiveSupported = true;\n return false;\n }\n };\n\n const handler = () => {};\n globalObj.document.addEventListener('test', handler, options);\n globalObj.document.removeEventListener(\n 'test', handler, options as EventListenerOptions);\n } catch (err) {\n passiveSupported = false;\n }\n\n return passiveSupported;\n}\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst FOCUS_SENTINEL_CLASS = 'mdc-dom-focus-sentinel';\n\n/**\n * Utility to trap focus in a given root element, e.g. for modal components such\n * as dialogs. The root should have at least one focusable child element,\n * for setting initial focus when trapping focus.\n * Also tracks the previously focused element, and restores focus to that\n * element when releasing focus.\n */\nexport class FocusTrap {\n // Previously focused element before trapping focus.\n private elFocusedBeforeTrapFocus: HTMLElement|null = null;\n\n constructor(\n private readonly root: HTMLElement,\n private readonly options: FocusOptions = {}) {}\n\n /**\n * Traps focus in `root`. Also focuses on either `initialFocusEl` if set;\n * otherwises sets initial focus to the first focusable child element.\n */\n trapFocus() {\n const focusableEls = this.getFocusableElements(this.root);\n if (focusableEls.length === 0) {\n throw new Error(\n 'FocusTrap: Element must have at least one focusable child.');\n }\n\n this.elFocusedBeforeTrapFocus =\n document.activeElement instanceof HTMLElement ? document.activeElement :\n null;\n this.wrapTabFocus(this.root, focusableEls);\n\n if (!this.options.skipInitialFocus) {\n this.focusInitialElement(focusableEls, this.options.initialFocusEl);\n }\n }\n\n /**\n * Releases focus from `root`. Also restores focus to the previously focused\n * element.\n */\n releaseFocus() {\n [].slice.call(this.root.querySelectorAll(`.${FOCUS_SENTINEL_CLASS}`))\n .forEach((sentinelEl: HTMLElement) => {\n sentinelEl.parentElement!.removeChild(sentinelEl);\n });\n\n if (this.elFocusedBeforeTrapFocus) {\n this.elFocusedBeforeTrapFocus.focus();\n }\n }\n\n /**\n * Wraps tab focus within `el` by adding two hidden sentinel divs which are\n * used to mark the beginning and the end of the tabbable region. When\n * focused, these sentinel elements redirect focus to the first/last\n * children elements of the tabbable region, ensuring that focus is trapped\n * within that region.\n */\n private wrapTabFocus(el: HTMLElement, focusableEls: HTMLElement[]) {\n const sentinelStart = this.createSentinel();\n const sentinelEnd = this.createSentinel();\n\n sentinelStart.addEventListener('focus', () => {\n if (focusableEls.length > 0) {\n focusableEls[focusableEls.length - 1].focus();\n }\n });\n sentinelEnd.addEventListener('focus', () => {\n if (focusableEls.length > 0) {\n focusableEls[0].focus();\n }\n });\n\n el.insertBefore(sentinelStart, el.children[0]);\n el.appendChild(sentinelEnd);\n }\n\n /**\n * Focuses on `initialFocusEl` if defined and a child of the root element.\n * Otherwise, focuses on the first focusable child element of the root.\n */\n private focusInitialElement(\n focusableEls: HTMLElement[], initialFocusEl?: HTMLElement) {\n let focusIndex = 0;\n if (initialFocusEl) {\n focusIndex = Math.max(focusableEls.indexOf(initialFocusEl), 0);\n }\n focusableEls[focusIndex].focus();\n }\n\n private getFocusableElements(root: HTMLElement): HTMLElement[] {\n const focusableEls =\n [].slice.call(root.querySelectorAll(\n '[autofocus], [tabindex], a, input, textarea, select, button')) as\n HTMLElement[];\n return focusableEls.filter((el) => {\n const isDisabledOrHidden = el.getAttribute('aria-disabled') === 'true' ||\n el.getAttribute('disabled') != null ||\n el.getAttribute('hidden') != null ||\n el.getAttribute('aria-hidden') === 'true';\n const isTabbableAndVisible = el.tabIndex >= 0 &&\n el.getBoundingClientRect().width > 0 &&\n !el.classList.contains(FOCUS_SENTINEL_CLASS) && !isDisabledOrHidden;\n\n let isProgrammaticallyHidden = false;\n if (isTabbableAndVisible) {\n const style = getComputedStyle(el);\n isProgrammaticallyHidden =\n style.display === 'none' || style.visibility === 'hidden';\n }\n return isTabbableAndVisible && !isProgrammaticallyHidden;\n });\n }\n\n private createSentinel() {\n const sentinel = document.createElement('div');\n sentinel.setAttribute('tabindex', '0');\n // Don't announce in screen readers.\n sentinel.setAttribute('aria-hidden', 'true');\n sentinel.classList.add(FOCUS_SENTINEL_CLASS);\n return sentinel;\n }\n}\n\n/** Customization options. */\nexport interface FocusOptions {\n // The element to focus initially when trapping focus.\n // Must be a child of the root element.\n initialFocusEl?: HTMLElement;\n\n // Whether to skip initially focusing on any element when trapping focus.\n // By default, focus is set on the first focusable child element of the root.\n // This is useful if the caller wants to handle setting initial focus.\n skipInitialFocus?: boolean;\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport * as events from './events';\nimport * as focusTrap from './focus-trap';\nimport * as keyboard from './keyboard';\nimport * as ponyfill from './ponyfill';\n\nexport {events, focusTrap, keyboard, ponyfill};\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * KEY provides normalized string values for keys.\n */\nexport const KEY = {\n UNKNOWN: 'Unknown',\n BACKSPACE: 'Backspace',\n ENTER: 'Enter',\n SPACEBAR: 'Spacebar',\n PAGE_UP: 'PageUp',\n PAGE_DOWN: 'PageDown',\n END: 'End',\n HOME: 'Home',\n ARROW_LEFT: 'ArrowLeft',\n ARROW_UP: 'ArrowUp',\n ARROW_RIGHT: 'ArrowRight',\n ARROW_DOWN: 'ArrowDown',\n DELETE: 'Delete',\n ESCAPE: 'Escape',\n};\n\nconst normalizedKeys = new Set<string>();\n// IE11 has no support for new Map with iterable so we need to initialize this\n// by hand.\nnormalizedKeys.add(KEY.BACKSPACE);\nnormalizedKeys.add(KEY.ENTER);\nnormalizedKeys.add(KEY.SPACEBAR);\nnormalizedKeys.add(KEY.PAGE_UP);\nnormalizedKeys.add(KEY.PAGE_DOWN);\nnormalizedKeys.add(KEY.END);\nnormalizedKeys.add(KEY.HOME);\nnormalizedKeys.add(KEY.ARROW_LEFT);\nnormalizedKeys.add(KEY.ARROW_UP);\nnormalizedKeys.add(KEY.ARROW_RIGHT);\nnormalizedKeys.add(KEY.ARROW_DOWN);\nnormalizedKeys.add(KEY.DELETE);\nnormalizedKeys.add(KEY.ESCAPE);\n\nconst KEY_CODE = {\n BACKSPACE: 8,\n ENTER: 13,\n SPACEBAR: 32,\n PAGE_UP: 33,\n PAGE_DOWN: 34,\n END: 35,\n HOME: 36,\n ARROW_LEFT: 37,\n ARROW_UP: 38,\n ARROW_RIGHT: 39,\n ARROW_DOWN: 40,\n DELETE: 46,\n ESCAPE: 27,\n};\n\nconst mappedKeyCodes = new Map<number, string>();\n// IE11 has no support for new Map with iterable so we need to initialize this\n// by hand.\nmappedKeyCodes.set(KEY_CODE.BACKSPACE, KEY.BACKSPACE);\nmappedKeyCodes.set(KEY_CODE.ENTER, KEY.ENTER);\nmappedKeyCodes.set(KEY_CODE.SPACEBAR, KEY.SPACEBAR);\nmappedKeyCodes.set(KEY_CODE.PAGE_UP, KEY.PAGE_UP);\nmappedKeyCodes.set(KEY_CODE.PAGE_DOWN, KEY.PAGE_DOWN);\nmappedKeyCodes.set(KEY_CODE.END, KEY.END);\nmappedKeyCodes.set(KEY_CODE.HOME, KEY.HOME);\nmappedKeyCodes.set(KEY_CODE.ARROW_LEFT, KEY.ARROW_LEFT);\nmappedKeyCodes.set(KEY_CODE.ARROW_UP, KEY.ARROW_UP);\nmappedKeyCodes.set(KEY_CODE.ARROW_RIGHT, KEY.ARROW_RIGHT);\nmappedKeyCodes.set(KEY_CODE.ARROW_DOWN, KEY.ARROW_DOWN);\nmappedKeyCodes.set(KEY_CODE.DELETE, KEY.DELETE);\nmappedKeyCodes.set(KEY_CODE.ESCAPE, KEY.ESCAPE);\n\nconst navigationKeys = new Set<string>();\n// IE11 has no support for new Set with iterable so we need to initialize this\n// by hand.\nnavigationKeys.add(KEY.PAGE_UP);\nnavigationKeys.add(KEY.PAGE_DOWN);\nnavigationKeys.add(KEY.END);\nnavigationKeys.add(KEY.HOME);\nnavigationKeys.add(KEY.ARROW_LEFT);\nnavigationKeys.add(KEY.ARROW_UP);\nnavigationKeys.add(KEY.ARROW_RIGHT);\nnavigationKeys.add(KEY.ARROW_DOWN);\n\n/**\n * normalizeKey returns the normalized string for a navigational action.\n */\nexport function normalizeKey(evt: KeyboardEvent): string {\n const {key} = evt;\n // If the event already has a normalized key, return it\n if (normalizedKeys.has(key)) {\n return key;\n }\n\n // tslint:disable-next-line:deprecation\n const mappedKey = mappedKeyCodes.get(evt.keyCode);\n if (mappedKey) {\n return mappedKey;\n }\n return KEY.UNKNOWN;\n}\n\n/**\n * isNavigationEvent returns whether the event is a navigation event\n */\nexport function isNavigationEvent(evt: KeyboardEvent): boolean {\n return navigationKeys.has(normalizeKey(evt));\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * @fileoverview A \"ponyfill\" is a polyfill that doesn't modify the global prototype chain.\n * This makes ponyfills safer than traditional polyfills, especially for libraries like MDC.\n */\n\nexport function closest(element: Element, selector: string): Element | null {\n if (element.closest) {\n return element.closest(selector);\n }\n\n let el: Element | null = element;\n while (el) {\n if (matches(el, selector)) {\n return el;\n }\n el = el.parentElement;\n }\n return null;\n}\n\nexport function matches(element: Element, selector: string): boolean {\n const nativeMatches = element.matches\n || element.webkitMatchesSelector\n || (element as any).msMatchesSelector;\n return nativeMatches.call(element, selector);\n}\n\n/**\n * Used to compute the estimated scroll width of elements. When an element is\n * hidden due to display: none; being applied to a parent element, the width is\n * returned as 0. However, the element will have a true width once no longer\n * inside a display: none context. This method computes an estimated width when\n * the element is hidden or returns the true width when the element is visble.\n * @param {Element} element the element whose width to estimate\n */\nexport function estimateScrollWidth(element: Element): number {\n // Check the offsetParent. If the element inherits display: none from any\n // parent, the offsetParent property will be null (see\n // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetParent).\n // This check ensures we only clone the node when necessary.\n const htmlEl = element as HTMLElement;\n if (htmlEl.offsetParent !== null) {\n return htmlEl.scrollWidth;\n }\n\n const clone = htmlEl.cloneNode(true) as HTMLElement;\n clone.style.setProperty('position', 'absolute');\n clone.style.setProperty('transform', 'translate(-9999px, -9999px)');\n document.documentElement.appendChild(clone);\n const scrollWidth = clone.scrollWidth;\n document.documentElement.removeChild(clone);\n return scrollWidth;\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {SpecificEventListener} from '@material/base/types';\nimport {FocusTrap} from '@material/dom/focus-trap';\nimport {MDCList, MDCListFactory} from '@material/list/component';\nimport {MDCListFoundation} from '@material/list/foundation';\nimport {MDCDrawerAdapter} from './adapter';\nimport {MDCDismissibleDrawerFoundation} from './dismissible/foundation';\nimport {MDCModalDrawerFoundation} from './modal/foundation';\nimport * as util from './util';\nimport {MDCDrawerFocusTrapFactory} from './util';\n\nconst {cssClasses, strings} = MDCDismissibleDrawerFoundation;\n\n/**\n * @events `MDCDrawer:closed {}` Emits when the navigation drawer has closed.\n * @events `MDCDrawer:opened {}` Emits when the navigation drawer has opened.\n */\nexport class MDCDrawer extends MDCComponent<MDCDismissibleDrawerFoundation> {\n static attachTo(root: Element): MDCDrawer {\n return new MDCDrawer(root);\n }\n\n /**\n * @return boolean Proxies to the foundation's `open`/`close` methods.\n * Also returns true if drawer is in the open position.\n */\n get open(): boolean {\n return this.foundation.isOpen();\n }\n\n /**\n * Toggles the drawer open and closed.\n */\n set open(isOpen: boolean) {\n if (isOpen) {\n this.foundation.open();\n } else {\n this.foundation.close();\n }\n }\n\n private previousFocus_?: Element | null;\n private scrim_!: HTMLElement | null; // assigned in initialSyncWithDOM()\n private list_?: MDCList; // assigned in initialize()\n\n private focusTrap_?: FocusTrap; // assigned in initialSyncWithDOM()\n private focusTrapFactory_!: MDCDrawerFocusTrapFactory; // assigned in initialize()\n\n private handleScrimClick_?: SpecificEventListener<'click'>; // initialized in initialSyncWithDOM()\n private handleKeydown_!: SpecificEventListener<'keydown'>; // initialized in initialSyncWithDOM()\n private handleTransitionEnd_!: SpecificEventListener<'transitionend'>; // initialized in initialSyncWithDOM()\n\n get list(): MDCList | undefined {\n return this.list_;\n }\n\n initialize(\n focusTrapFactory: MDCDrawerFocusTrapFactory = (el) => new FocusTrap(el),\n listFactory: MDCListFactory = (el) => new MDCList(el),\n ) {\n const listEl =\n this.root.querySelector(`.${MDCListFoundation.cssClasses.ROOT}`);\n if (listEl) {\n this.list_ = listFactory(listEl);\n this.list_.wrapFocus = true;\n }\n this.focusTrapFactory_ = focusTrapFactory;\n }\n\n initialSyncWithDOM() {\n const {MODAL} = cssClasses;\n const {SCRIM_SELECTOR} = strings;\n\n this.scrim_ = (this.root.parentNode as Element)\n .querySelector<HTMLElement>(SCRIM_SELECTOR);\n\n if (this.scrim_ && this.root.classList.contains(MODAL)) {\n this.handleScrimClick_ = () =>\n (this.foundation as MDCModalDrawerFoundation).handleScrimClick();\n this.scrim_.addEventListener('click', this.handleScrimClick_);\n this.focusTrap_ = util.createFocusTrapInstance(\n this.root as HTMLElement, this.focusTrapFactory_);\n }\n\n this.handleKeydown_ = (evt) => this.foundation.handleKeydown(evt);\n this.handleTransitionEnd_ = (evt) =>\n this.foundation.handleTransitionEnd(evt);\n\n this.listen('keydown', this.handleKeydown_);\n this.listen('transitionend', this.handleTransitionEnd_);\n }\n\n destroy() {\n this.unlisten('keydown', this.handleKeydown_);\n this.unlisten('transitionend', this.handleTransitionEnd_);\n\n if (this.list_) {\n this.list_.destroy();\n }\n\n const {MODAL} = cssClasses;\n if (this.scrim_ && this.handleScrimClick_ &&\n this.root.classList.contains(MODAL)) {\n this.scrim_.removeEventListener('click', this.handleScrimClick_);\n // Ensure drawer is closed to hide scrim and release focus\n this.open = false;\n }\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCDrawerAdapter = {\n addClass: (className) => this.root.classList.add(className),\n removeClass: (className) => this.root.classList.remove(className),\n hasClass: (className) => this.root.classList.contains(className),\n elementHasClass: (element, className) =>\n element.classList.contains(className),\n saveFocus: () => this.previousFocus_ = document.activeElement,\n restoreFocus: () => {\n const previousFocus = this.previousFocus_ as HTMLOrSVGElement | null;\n if (previousFocus && previousFocus.focus &&\n this.root.contains(document.activeElement)) {\n previousFocus.focus();\n }\n },\n focusActiveNavigationItem: () => {\n const activeNavItemEl = this.root.querySelector<HTMLElement>(\n `.${MDCListFoundation.cssClasses.LIST_ITEM_ACTIVATED_CLASS}`);\n if (activeNavItemEl) {\n activeNavItemEl.focus();\n }\n },\n notifyClose: () =>\n this.emit(strings.CLOSE_EVENT, {}, true /* shouldBubble */),\n notifyOpen: () =>\n this.emit(strings.OPEN_EVENT, {}, true /* shouldBubble */),\n trapFocus: () => this.focusTrap_!.trapFocus(),\n releaseFocus: () => this.focusTrap_!.releaseFocus(),\n };\n // tslint:enable:object-literal-sort-keys\n\n const {DISMISSIBLE, MODAL} = cssClasses;\n if (this.root.classList.contains(DISMISSIBLE)) {\n return new MDCDismissibleDrawerFoundation(adapter);\n } else if (this.root.classList.contains(MODAL)) {\n return new MDCModalDrawerFoundation(adapter);\n } else {\n throw new Error(\n `MDCDrawer: Failed to instantiate component. Supported variants are ${DISMISSIBLE} and ${MODAL}.`);\n }\n }\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst cssClasses = {\n ANIMATE: 'mdc-drawer--animate',\n CLOSING: 'mdc-drawer--closing',\n DISMISSIBLE: 'mdc-drawer--dismissible',\n MODAL: 'mdc-drawer--modal',\n OPEN: 'mdc-drawer--open',\n OPENING: 'mdc-drawer--opening',\n ROOT: 'mdc-drawer',\n};\n\nconst strings = {\n APP_CONTENT_SELECTOR: '.mdc-drawer-app-content',\n CLOSE_EVENT: 'MDCDrawer:closed',\n OPEN_EVENT: 'MDCDrawer:opened',\n SCRIM_SELECTOR: '.mdc-drawer-scrim',\n};\n\nexport {cssClasses, strings};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCDrawerAdapter} from '../adapter';\nimport {cssClasses, strings} from '../constants';\n\nexport class MDCDismissibleDrawerFoundation extends MDCFoundation<MDCDrawerAdapter> {\n static get strings() {\n return strings;\n }\n\n static get cssClasses() {\n return cssClasses;\n }\n\n static get defaultAdapter(): MDCDrawerAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: () => undefined,\n removeClass: () => undefined,\n hasClass: () => false,\n elementHasClass: () => false,\n notifyClose: () => undefined,\n notifyOpen: () => undefined,\n saveFocus: () => undefined,\n restoreFocus: () => undefined,\n focusActiveNavigationItem: () => undefined,\n trapFocus: () => undefined,\n releaseFocus: () => undefined,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private animationFrame_ = 0;\n private animationTimer_ = 0;\n\n constructor(adapter?: Partial<MDCDrawerAdapter>) {\n super({...MDCDismissibleDrawerFoundation.defaultAdapter, ...adapter});\n }\n\n destroy() {\n if (this.animationFrame_) {\n cancelAnimationFrame(this.animationFrame_);\n }\n if (this.animationTimer_) {\n clearTimeout(this.animationTimer_);\n }\n }\n\n /**\n * Opens the drawer from the closed state.\n */\n open() {\n if (this.isOpen() || this.isOpening() || this.isClosing()) {\n return;\n }\n\n this.adapter.addClass(cssClasses.OPEN);\n this.adapter.addClass(cssClasses.ANIMATE);\n\n // Wait a frame once display is no longer \"none\", to establish basis for animation\n this.runNextAnimationFrame_(() => {\n this.adapter.addClass(cssClasses.OPENING);\n });\n\n this.adapter.saveFocus();\n }\n\n /**\n * Closes the drawer from the open state.\n */\n close() {\n if (!this.isOpen() || this.isOpening() || this.isClosing()) {\n return;\n }\n\n this.adapter.addClass(cssClasses.CLOSING);\n }\n\n /**\n * Returns true if the drawer is in the open position.\n * @return true if drawer is in open state.\n */\n isOpen(): boolean {\n return this.adapter.hasClass(cssClasses.OPEN);\n }\n\n /**\n * Returns true if the drawer is animating open.\n * @return true if drawer is animating open.\n */\n isOpening(): boolean {\n return this.adapter.hasClass(cssClasses.OPENING) ||\n this.adapter.hasClass(cssClasses.ANIMATE);\n }\n\n /**\n * Returns true if the drawer is animating closed.\n * @return true if drawer is animating closed.\n */\n isClosing(): boolean {\n return this.adapter.hasClass(cssClasses.CLOSING);\n }\n\n /**\n * Keydown handler to close drawer when key is escape.\n */\n handleKeydown(evt: KeyboardEvent) {\n const {keyCode, key} = evt;\n const isEscape = key === 'Escape' || keyCode === 27;\n if (isEscape) {\n this.close();\n }\n }\n\n /**\n * Handles the `transitionend` event when the drawer finishes opening/closing.\n */\n handleTransitionEnd(evt: TransitionEvent) {\n const {OPENING, CLOSING, OPEN, ANIMATE, ROOT} = cssClasses;\n\n // In Edge, transitionend on ripple pseudo-elements yields a target without classList, so check for Element first.\n const isRootElement = this.isElement_(evt.target) &&\n this.adapter.elementHasClass(evt.target, ROOT);\n if (!isRootElement) {\n return;\n }\n\n if (this.isClosing()) {\n this.adapter.removeClass(OPEN);\n this.closed_();\n this.adapter.restoreFocus();\n this.adapter.notifyClose();\n } else {\n this.adapter.focusActiveNavigationItem();\n this.opened_();\n this.adapter.notifyOpen();\n }\n\n this.adapter.removeClass(ANIMATE);\n this.adapter.removeClass(OPENING);\n this.adapter.removeClass(CLOSING);\n }\n\n /**\n * Extension point for when drawer finishes open animation.\n */\n protected opened_() {} // tslint:disable-line:no-empty\n\n /**\n * Extension point for when drawer finishes close animation.\n */\n protected closed_() {} // tslint:disable-line:no-empty\n\n /**\n * Runs the given logic on the next animation frame, using setTimeout to factor in Firefox reflow behavior.\n */\n private runNextAnimationFrame_(callback: () => void) {\n cancelAnimationFrame(this.animationFrame_);\n this.animationFrame_ = requestAnimationFrame(() => {\n this.animationFrame_ = 0;\n clearTimeout(this.animationTimer_);\n this.animationTimer_ = setTimeout(callback, 0);\n });\n }\n\n private isElement_(element: unknown): element is Element {\n // In Edge, transitionend on ripple pseudo-elements yields a target without classList.\n return Boolean((element as Element).classList);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCDismissibleDrawerFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport * as util from './util';\n\nexport {util};\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './dismissible/foundation';\nexport * from './modal/foundation';\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCDismissibleDrawerFoundation} from '../dismissible/foundation';\n\n/* istanbul ignore next: subclass is not a branch statement */\nexport class MDCModalDrawerFoundation extends MDCDismissibleDrawerFoundation {\n /**\n * Handles click event on scrim.\n */\n handleScrimClick() {\n this.close();\n }\n\n /**\n * Called when drawer finishes open animation.\n */\n protected opened_() {\n this.adapter.trapFocus();\n }\n\n /**\n * Called when drawer finishes close animation.\n */\n protected closed_() {\n this.adapter.releaseFocus();\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCModalDrawerFoundation;\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {FocusOptions, FocusTrap} from '@material/dom/focus-trap';\n\nexport type MDCDrawerFocusTrapFactory = (\n element: HTMLElement,\n options: FocusOptions,\n) => FocusTrap;\n\nexport function createFocusTrapInstance(\n surfaceEl: HTMLElement,\n focusTrapFactory: MDCDrawerFocusTrapFactory,\n): FocusTrap {\n return focusTrapFactory(surfaceEl, {\n // Component handles focusing on active nav item.\n skipInitialFocus: true, \n });\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {estimateScrollWidth} from '@material/dom/ponyfill';\nimport {MDCFloatingLabelAdapter} from './adapter';\nimport {MDCFloatingLabelFoundation} from './foundation';\n\nexport type MDCFloatingLabelFactory = (el: Element, foundation?: MDCFloatingLabelFoundation) => MDCFloatingLabel;\n\nexport class MDCFloatingLabel extends MDCComponent<MDCFloatingLabelFoundation> {\n static attachTo(root: Element): MDCFloatingLabel {\n return new MDCFloatingLabel(root);\n }\n\n /**\n * Styles the label to produce the label shake for errors.\n * @param shouldShake If true, shakes the label by adding a CSS class; otherwise, stops shaking by removing the class.\n */\n shake(shouldShake: boolean) {\n this.foundation.shake(shouldShake);\n }\n\n /**\n * Styles the label to float/dock.\n * @param shouldFloat If true, floats the label by adding a CSS class; otherwise, docks it by removing the class.\n */\n float(shouldFloat: boolean) {\n this.foundation.float(shouldFloat);\n }\n\n /**\n * Styles the label as required.\n * @param isRequired If true, adds an asterisk to the label, indicating that it is required.\n */\n setRequired(isRequired: boolean) {\n this.foundation.setRequired(isRequired);\n }\n\n getWidth(): number {\n return this.foundation.getWidth();\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCFloatingLabelAdapter = {\n addClass: (className) => this.root.classList.add(className),\n removeClass: (className) => this.root.classList.remove(className),\n getWidth: () => estimateScrollWidth(this.root),\n registerInteractionHandler: (evtType, handler) =>\n this.listen(evtType, handler),\n deregisterInteractionHandler: (evtType, handler) =>\n this.unlisten(evtType, handler),\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCFloatingLabelFoundation(adapter);\n }\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport const cssClasses = {\n LABEL_FLOAT_ABOVE: 'mdc-floating-label--float-above',\n LABEL_REQUIRED: 'mdc-floating-label--required',\n LABEL_SHAKE: 'mdc-floating-label--shake',\n ROOT: 'mdc-floating-label',\n};\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {SpecificEventListener} from '@material/base/types';\nimport {MDCFloatingLabelAdapter} from './adapter';\nimport {cssClasses} from './constants';\n\nexport class MDCFloatingLabelFoundation extends MDCFoundation<MDCFloatingLabelAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n /**\n * See {@link MDCFloatingLabelAdapter} for typing information on parameters and return types.\n */\n static get defaultAdapter(): MDCFloatingLabelAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: () => undefined,\n removeClass: () => undefined,\n getWidth: () => 0,\n registerInteractionHandler: () => undefined,\n deregisterInteractionHandler: () => undefined,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private readonly shakeAnimationEndHandler_: SpecificEventListener<'animationend'>;\n\n constructor(adapter?: Partial<MDCFloatingLabelAdapter>) {\n super({...MDCFloatingLabelFoundation.defaultAdapter, ...adapter});\n\n this.shakeAnimationEndHandler_ = () => this.handleShakeAnimationEnd_();\n }\n\n init() {\n this.adapter.registerInteractionHandler('animationend', this.shakeAnimationEndHandler_);\n }\n\n destroy() {\n this.adapter.deregisterInteractionHandler('animationend', this.shakeAnimationEndHandler_);\n }\n\n /**\n * Returns the width of the label element.\n */\n getWidth(): number {\n return this.adapter.getWidth();\n }\n\n /**\n * Styles the label to produce a shake animation to indicate an error.\n * @param shouldShake If true, adds the shake CSS class; otherwise, removes shake class.\n */\n shake(shouldShake: boolean) {\n const {LABEL_SHAKE} = MDCFloatingLabelFoundation.cssClasses;\n if (shouldShake) {\n this.adapter.addClass(LABEL_SHAKE);\n } else {\n this.adapter.removeClass(LABEL_SHAKE);\n }\n }\n\n /**\n * Styles the label to float or dock.\n * @param shouldFloat If true, adds the float CSS class; otherwise, removes float and shake classes to dock the label.\n */\n float(shouldFloat: boolean) {\n const {LABEL_FLOAT_ABOVE, LABEL_SHAKE} = MDCFloatingLabelFoundation.cssClasses;\n if (shouldFloat) {\n this.adapter.addClass(LABEL_FLOAT_ABOVE);\n } else {\n this.adapter.removeClass(LABEL_FLOAT_ABOVE);\n this.adapter.removeClass(LABEL_SHAKE);\n }\n }\n\n /**\n * Styles the label as required.\n * @param isRequired If true, adds an asterisk to the label, indicating that it is required.\n */\n setRequired(isRequired: boolean) {\n const {LABEL_REQUIRED} = MDCFloatingLabelFoundation.cssClasses;\n if (isRequired) {\n this.adapter.addClass(LABEL_REQUIRED);\n } else {\n this.adapter.removeClass(LABEL_REQUIRED);\n }\n }\n\n private handleShakeAnimationEnd_() {\n const {LABEL_SHAKE} = MDCFloatingLabelFoundation.cssClasses;\n this.adapter.removeClass(LABEL_SHAKE);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCFloatingLabelFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {MDCRipple} from '@material/ripple/component';\nimport {MDCFormFieldAdapter} from './adapter';\nimport {MDCFormFieldFoundation} from './foundation';\n\nexport interface MDCFormFieldInput {\n readonly ripple: MDCRipple | undefined;\n}\n\nexport class MDCFormField extends MDCComponent<MDCFormFieldFoundation> {\n static attachTo(root: HTMLElement) {\n return new MDCFormField(root);\n }\n\n input?: MDCFormFieldInput;\n\n private labelEl(): Element|null {\n const {LABEL_SELECTOR} = MDCFormFieldFoundation.strings;\n return this.root.querySelector(LABEL_SELECTOR);\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCFormFieldAdapter = {\n activateInputRipple: () => {\n if (this.input && this.input.ripple) {\n this.input.ripple.activate();\n }\n },\n deactivateInputRipple: () => {\n if (this.input && this.input.ripple) {\n this.input.ripple.deactivate();\n }\n },\n deregisterInteractionHandler: (evtType, handler) => {\n const labelEl = this.labelEl();\n if (labelEl) {\n (labelEl as HTMLElement).removeEventListener(evtType, handler);\n }\n },\n registerInteractionHandler: (evtType, handler) => {\n const labelEl = this.labelEl();\n if (labelEl) {\n (labelEl as HTMLElement).addEventListener(evtType, handler);\n }\n },\n };\n return new MDCFormFieldFoundation(adapter);\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport const cssClasses = {\n ROOT: 'mdc-form-field',\n};\n\nexport const strings = {\n LABEL_SELECTOR: '.mdc-form-field > label',\n};\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCFormFieldAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\n\nexport class MDCFormFieldFoundation extends MDCFoundation<MDCFormFieldAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get defaultAdapter(): MDCFormFieldAdapter {\n return {\n activateInputRipple: () => undefined,\n deactivateInputRipple: () => undefined,\n deregisterInteractionHandler: () => undefined,\n registerInteractionHandler: () => undefined,\n };\n }\n\n private readonly click: () => void;\n\n constructor(adapter?: Partial<MDCFormFieldAdapter>) {\n super({...MDCFormFieldFoundation.defaultAdapter, ...adapter});\n\n this.click = () => {\n this.handleClick();\n };\n }\n\n init() {\n this.adapter.registerInteractionHandler('click', this.click);\n }\n\n destroy() {\n this.adapter.deregisterInteractionHandler('click', this.click);\n }\n\n private handleClick() {\n this.adapter.activateInputRipple();\n requestAnimationFrame(() => {\n this.adapter.deactivateInputRipple();\n });\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCFormFieldFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {SpecificEventListener} from '@material/base/types';\nimport {MDCRipple} from '@material/ripple/component';\nimport {MDCIconButtonToggleAdapter} from './adapter';\nimport {MDCIconButtonToggleFoundation} from './foundation';\nimport {MDCIconButtonToggleEventDetail} from './types';\n\nconst {strings} = MDCIconButtonToggleFoundation;\n\nexport class MDCIconButtonToggle extends MDCComponent<MDCIconButtonToggleFoundation> {\n static attachTo(root: HTMLElement) {\n return new MDCIconButtonToggle(root);\n }\n\n private readonly rippleComponent: MDCRipple = this.createRipple();\n private handleClick!:\n SpecificEventListener<'click'>; // assigned in initialSyncWithDOM()\n\n initialSyncWithDOM() {\n this.handleClick = () => {\n this.foundation.handleClick();\n };\n this.listen('click', this.handleClick);\n }\n\n destroy() {\n this.unlisten('click', this.handleClick);\n this.ripple.destroy();\n super.destroy();\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCIconButtonToggleAdapter = {\n addClass: (className) => this.root.classList.add(className),\n hasClass: (className) => this.root.classList.contains(className),\n notifyChange: (evtData) => {\n this.emit<MDCIconButtonToggleEventDetail>(\n strings.CHANGE_EVENT, evtData);\n },\n removeClass: (className) => this.root.classList.remove(className),\n getAttr: (attrName) => this.root.getAttribute(attrName),\n setAttr: (attrName, attrValue) =>\n this.root.setAttribute(attrName, attrValue),\n };\n return new MDCIconButtonToggleFoundation(adapter);\n }\n\n get ripple(): MDCRipple {\n return this.rippleComponent;\n }\n\n get on(): boolean {\n return this.foundation.isOn();\n }\n\n set on(isOn: boolean) {\n this.foundation.toggle(isOn);\n }\n\n private createRipple(): MDCRipple {\n const ripple = new MDCRipple(this.root);\n ripple.unbounded = true;\n return ripple;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport const cssClasses = {\n ICON_BUTTON_ON: 'mdc-icon-button--on',\n ROOT: 'mdc-icon-button',\n};\n\nexport const strings = {\n ARIA_LABEL: 'aria-label',\n ARIA_PRESSED: 'aria-pressed',\n DATA_ARIA_LABEL_OFF: 'data-aria-label-off',\n DATA_ARIA_LABEL_ON: 'data-aria-label-on',\n CHANGE_EVENT: 'MDCIconButtonToggle:change',\n};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCIconButtonToggleAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\n\nexport class MDCIconButtonToggleFoundation extends MDCFoundation<MDCIconButtonToggleAdapter> {\n /**\n * Whether the icon button has an aria label that changes depending on\n * toggled state.\n */\n private hasToggledAriaLabel: boolean = false;\n\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get defaultAdapter(): MDCIconButtonToggleAdapter {\n return {\n addClass: () => undefined,\n hasClass: () => false,\n notifyChange: () => undefined,\n removeClass: () => undefined,\n getAttr: () => null,\n setAttr: () => undefined,\n };\n }\n\n constructor(adapter?: Partial<MDCIconButtonToggleAdapter>) {\n super({...MDCIconButtonToggleFoundation.defaultAdapter, ...adapter});\n }\n\n init() {\n const ariaLabelOn = this.adapter.getAttr(strings.DATA_ARIA_LABEL_ON);\n const ariaLabelOff = this.adapter.getAttr(strings.DATA_ARIA_LABEL_OFF);\n if (ariaLabelOn && ariaLabelOff) {\n if (this.adapter.getAttr(strings.ARIA_PRESSED) !== null) {\n throw new Error(\n 'MDCIconButtonToggleFoundation: Button should not set ' +\n '`aria-pressed` if it has a toggled aria label.');\n }\n\n this.hasToggledAriaLabel = true;\n } else {\n this.adapter.setAttr(strings.ARIA_PRESSED, String(this.isOn()));\n }\n }\n\n handleClick() {\n this.toggle();\n this.adapter.notifyChange({isOn: this.isOn()});\n }\n\n isOn(): boolean {\n return this.adapter.hasClass(cssClasses.ICON_BUTTON_ON);\n }\n\n toggle(isOn: boolean = !this.isOn()) {\n // Toggle UI based on state.\n if (isOn) {\n this.adapter.addClass(cssClasses.ICON_BUTTON_ON);\n } else {\n this.adapter.removeClass(cssClasses.ICON_BUTTON_ON);\n }\n\n // Toggle aria attributes based on state.\n if (this.hasToggledAriaLabel) {\n const ariaLabel = isOn ?\n this.adapter.getAttr(strings.DATA_ARIA_LABEL_ON) :\n this.adapter.getAttr(strings.DATA_ARIA_LABEL_OFF);\n this.adapter.setAttr(strings.ARIA_LABEL, ariaLabel || '');\n } else {\n this.adapter.setAttr(strings.ARIA_PRESSED, `${isOn}`);\n }\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCIconButtonToggleFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './types';\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {MDCLineRippleAdapter} from './adapter';\nimport {MDCLineRippleFoundation} from './foundation';\n\nexport type MDCLineRippleFactory = (el: Element, foundation?: MDCLineRippleFoundation) => MDCLineRipple;\n\nexport class MDCLineRipple extends MDCComponent<MDCLineRippleFoundation> {\n static attachTo(root: Element): MDCLineRipple {\n return new MDCLineRipple(root);\n }\n\n /**\n * Activates the line ripple\n */\n activate() {\n this.foundation.activate();\n }\n\n /**\n * Deactivates the line ripple\n */\n deactivate() {\n this.foundation.deactivate();\n }\n\n /**\n * Sets the transform origin given a user's click location.\n * The `rippleCenter` is the x-coordinate of the middle of the ripple.\n */\n setRippleCenter(xCoordinate: number) {\n this.foundation.setRippleCenter(xCoordinate);\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCLineRippleAdapter = {\n addClass: (className) => this.root.classList.add(className),\n removeClass: (className) => this.root.classList.remove(className),\n hasClass: (className) => this.root.classList.contains(className),\n setStyle: (propertyName, value) => (this.root as HTMLElement).style.setProperty(propertyName, value),\n registerEventHandler: (evtType, handler) => this.listen(evtType, handler),\n deregisterEventHandler: (evtType, handler) => this.unlisten(evtType, handler),\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCLineRippleFoundation(adapter);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst cssClasses = {\n LINE_RIPPLE_ACTIVE: 'mdc-line-ripple--active',\n LINE_RIPPLE_DEACTIVATING: 'mdc-line-ripple--deactivating',\n};\n\nexport {cssClasses};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {SpecificEventListener} from '@material/base/types';\nimport {MDCLineRippleAdapter} from './adapter';\nimport {cssClasses} from './constants';\n\nexport class MDCLineRippleFoundation extends MDCFoundation<MDCLineRippleAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n /**\n * See {@link MDCLineRippleAdapter} for typing information on parameters and return types.\n */\n static get defaultAdapter(): MDCLineRippleAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: () => undefined,\n removeClass: () => undefined,\n hasClass: () => false,\n setStyle: () => undefined,\n registerEventHandler: () => undefined,\n deregisterEventHandler: () => undefined,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private readonly transitionEndHandler_: SpecificEventListener<'transitionend'>;\n\n constructor(adapter?: Partial<MDCLineRippleAdapter>) {\n super({...MDCLineRippleFoundation.defaultAdapter, ...adapter});\n\n this.transitionEndHandler_ = (evt) => this.handleTransitionEnd(evt);\n }\n\n init() {\n this.adapter.registerEventHandler(\n 'transitionend', this.transitionEndHandler_);\n }\n\n destroy() {\n this.adapter.deregisterEventHandler(\n 'transitionend', this.transitionEndHandler_);\n }\n\n activate() {\n this.adapter.removeClass(cssClasses.LINE_RIPPLE_DEACTIVATING);\n this.adapter.addClass(cssClasses.LINE_RIPPLE_ACTIVE);\n }\n\n setRippleCenter(xCoordinate: number) {\n this.adapter.setStyle('transform-origin', `${xCoordinate}px center`);\n }\n\n deactivate() {\n this.adapter.addClass(cssClasses.LINE_RIPPLE_DEACTIVATING);\n }\n\n handleTransitionEnd(evt: TransitionEvent) {\n // Wait for the line ripple to be either transparent or opaque\n // before emitting the animation end event\n const isDeactivating =\n this.adapter.hasClass(cssClasses.LINE_RIPPLE_DEACTIVATING);\n\n if (evt.propertyName === 'opacity') {\n if (isDeactivating) {\n this.adapter.removeClass(cssClasses.LINE_RIPPLE_ACTIVE);\n this.adapter.removeClass(cssClasses.LINE_RIPPLE_DEACTIVATING);\n }\n }\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCLineRippleFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {MDCProgressIndicator} from '@material/progress-indicator/component';\nimport {MDCLinearProgressAdapter} from './adapter';\nimport {MDCLinearProgressFoundation} from './foundation';\nimport {WithMDCResizeObserver} from './types';\n\nexport class MDCLinearProgress extends\n MDCComponent<MDCLinearProgressFoundation> implements MDCProgressIndicator {\n static attachTo(root: Element) {\n return new MDCLinearProgress(root);\n }\n\n set determinate(value: boolean) {\n this.foundation.setDeterminate(value);\n }\n\n set progress(value: number) {\n this.foundation.setProgress(value);\n }\n\n set buffer(value: number) {\n this.foundation.setBuffer(value);\n }\n\n open() {\n this.foundation.open();\n }\n\n close() {\n this.foundation.close();\n }\n\n initialSyncWithDOM() {\n this.root.addEventListener('transitionend', () => {\n this.foundation.handleTransitionEnd();\n });\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take\n // a Partial<MDCFooAdapter>. To ensure we don't accidentally omit any\n // methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCLinearProgressAdapter = {\n addClass: (className: string) => {\n this.root.classList.add(className);\n },\n forceLayout: () => {\n this.root.getBoundingClientRect();\n },\n setBufferBarStyle: (styleProperty: string, value: string) => {\n const bufferBar = this.root.querySelector<HTMLElement>(\n MDCLinearProgressFoundation.strings.BUFFER_BAR_SELECTOR);\n if (bufferBar) {\n bufferBar.style.setProperty(styleProperty, value);\n }\n },\n setPrimaryBarStyle: (styleProperty: string, value: string) => {\n const primaryBar = this.root.querySelector<HTMLElement>(\n MDCLinearProgressFoundation.strings.PRIMARY_BAR_SELECTOR);\n if (primaryBar) {\n primaryBar.style.setProperty(styleProperty, value);\n }\n },\n hasClass: (className: string) => this.root.classList.contains(className),\n removeAttribute: (attributeName: string) => {\n this.root.removeAttribute(attributeName);\n },\n removeClass: (className: string) => {\n this.root.classList.remove(className);\n },\n setAttribute: (attributeName: string, value: string) => {\n this.root.setAttribute(attributeName, value);\n },\n setStyle: (name: string, value: string) => {\n (this.root as HTMLElement).style.setProperty(name, value);\n },\n attachResizeObserver: (callback) => {\n const RO = (window as unknown as WithMDCResizeObserver).ResizeObserver;\n if (RO) {\n const ro = new RO(callback);\n ro.observe(this.root);\n return ro;\n }\n\n return null;\n },\n getWidth: () => (this.root as HTMLElement).offsetWidth,\n };\n return new MDCLinearProgressFoundation(adapter);\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport const cssClasses = {\n CLOSED_CLASS: 'mdc-linear-progress--closed',\n CLOSED_ANIMATION_OFF_CLASS: 'mdc-linear-progress--closed-animation-off',\n INDETERMINATE_CLASS: 'mdc-linear-progress--indeterminate',\n REVERSED_CLASS: 'mdc-linear-progress--reversed',\n ANIMATION_READY_CLASS: 'mdc-linear-progress--animation-ready',\n};\n\nexport const strings = {\n ARIA_VALUEMAX: 'aria-valuemax',\n ARIA_VALUEMIN: 'aria-valuemin',\n ARIA_VALUENOW: 'aria-valuenow',\n BUFFER_BAR_SELECTOR: '.mdc-linear-progress__buffer-bar',\n FLEX_BASIS: 'flex-basis',\n PRIMARY_BAR_SELECTOR: '.mdc-linear-progress__primary-bar',\n};\n\n// these are percentages pulled from keyframes.scss\nexport const animationDimensionPercentages = {\n PRIMARY_HALF: .8367142,\n PRIMARY_FULL: 2.00611057,\n SECONDARY_QUARTER: .37651913,\n SECONDARY_HALF: .84386165,\n SECONDARY_FULL: 1.60277782,\n};\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {getCorrectPropertyName} from '@material/animation/util';\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCProgressIndicatorFoundation} from '@material/progress-indicator/foundation';\n\nimport {MDCLinearProgressAdapter} from './adapter';\nimport {animationDimensionPercentages as percents, cssClasses, strings} from './constants';\nimport {MDCResizeObserver} from './types';\n\nexport class MDCLinearProgressFoundation extends\n MDCFoundation<MDCLinearProgressAdapter> implements\n MDCProgressIndicatorFoundation {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get defaultAdapter(): MDCLinearProgressAdapter {\n return {\n addClass: () => undefined,\n attachResizeObserver: () => null,\n forceLayout: () => undefined,\n getWidth: () => 0,\n hasClass: () => false,\n setBufferBarStyle: () => null,\n setPrimaryBarStyle: () => null,\n setStyle: () => undefined,\n removeAttribute: () => undefined,\n removeClass: () => undefined,\n setAttribute: () => undefined,\n };\n }\n\n private isDeterminate!: boolean;\n private progress!: number;\n private buffer!: number;\n private observer: MDCResizeObserver|null = null;\n\n constructor(adapter?: Partial<MDCLinearProgressAdapter>) {\n super({...MDCLinearProgressFoundation.defaultAdapter, ...adapter});\n }\n\n init() {\n this.isDeterminate = !this.adapter.hasClass(cssClasses.INDETERMINATE_CLASS);\n this.adapter.addClass(cssClasses.ANIMATION_READY_CLASS);\n this.progress = 0;\n this.buffer = 1;\n\n this.observer = this.adapter.attachResizeObserver((entries) => {\n if (this.isDeterminate) {\n return;\n }\n\n for (const entry of entries) {\n if (entry.contentRect) {\n this.calculateAndSetDimensions(entry.contentRect.width);\n }\n }\n });\n\n if (!this.isDeterminate && this.observer) {\n this.calculateAndSetDimensions(this.adapter.getWidth());\n }\n }\n\n setDeterminate(isDeterminate: boolean) {\n this.isDeterminate = isDeterminate;\n\n if (this.isDeterminate) {\n this.adapter.removeClass(cssClasses.INDETERMINATE_CLASS);\n this.adapter.setAttribute(\n strings.ARIA_VALUENOW, this.progress.toString());\n this.adapter.setAttribute(strings.ARIA_VALUEMAX, '1');\n this.adapter.setAttribute(strings.ARIA_VALUEMIN, '0');\n this.setPrimaryBarProgress(this.progress);\n this.setBufferBarProgress(this.buffer);\n\n return;\n }\n\n if (this.observer) {\n this.calculateAndSetDimensions(this.adapter.getWidth());\n }\n\n this.adapter.addClass(cssClasses.INDETERMINATE_CLASS);\n this.adapter.removeAttribute(strings.ARIA_VALUENOW);\n this.adapter.removeAttribute(strings.ARIA_VALUEMAX);\n this.adapter.removeAttribute(strings.ARIA_VALUEMIN);\n this.setPrimaryBarProgress(1);\n this.setBufferBarProgress(1);\n }\n\n getDeterminate() {\n return this.isDeterminate;\n }\n\n setProgress(value: number) {\n this.progress = value;\n if (this.isDeterminate) {\n this.setPrimaryBarProgress(value);\n this.adapter.setAttribute(strings.ARIA_VALUENOW, value.toString());\n }\n }\n\n getProgress() {\n return this.progress;\n }\n\n setBuffer(value: number) {\n this.buffer = value;\n if (this.isDeterminate) {\n this.setBufferBarProgress(value);\n }\n }\n\n open() {\n this.adapter.removeClass(cssClasses.CLOSED_CLASS);\n this.adapter.removeClass(cssClasses.CLOSED_ANIMATION_OFF_CLASS);\n }\n\n close() {\n this.adapter.addClass(cssClasses.CLOSED_CLASS);\n }\n\n /**\n * Handles the transitionend event emitted after `close()` is called and the\n * opacity fades out. This is so that animations are removed only after the\n * progress indicator is completely hidden.\n */\n handleTransitionEnd() {\n if (this.adapter.hasClass(cssClasses.CLOSED_CLASS)) {\n this.adapter.addClass(cssClasses.CLOSED_ANIMATION_OFF_CLASS);\n }\n }\n\n destroy() {\n super.destroy();\n\n if (this.observer) {\n this.observer.disconnect();\n }\n }\n\n restartAnimation() {\n this.adapter.removeClass(cssClasses.ANIMATION_READY_CLASS);\n this.adapter.forceLayout();\n this.adapter.addClass(cssClasses.ANIMATION_READY_CLASS);\n }\n\n private setPrimaryBarProgress(progressValue: number) {\n const value = `scaleX(${progressValue})`;\n\n // Accessing `window` without a `typeof` check will throw on Node\n // environments.\n const transformProp = typeof window !== 'undefined' ?\n getCorrectPropertyName(window, 'transform') :\n 'transform';\n this.adapter.setPrimaryBarStyle(transformProp, value);\n }\n\n private setBufferBarProgress(progressValue: number) {\n const value = `${progressValue * 100}%`;\n this.adapter.setBufferBarStyle(strings.FLEX_BASIS, value);\n }\n\n private calculateAndSetDimensions(width: number) {\n const primaryHalf = width * percents.PRIMARY_HALF;\n const primaryFull = width * percents.PRIMARY_FULL;\n const secondaryQuarter = width * percents.SECONDARY_QUARTER;\n const secondaryHalf = width * percents.SECONDARY_HALF;\n const secondaryFull = width * percents.SECONDARY_FULL;\n\n this.adapter.setStyle(\n '--mdc-linear-progress-primary-half', `${primaryHalf}px`);\n this.adapter.setStyle(\n '--mdc-linear-progress-primary-half-neg', `${- primaryHalf}px`);\n this.adapter.setStyle(\n '--mdc-linear-progress-primary-full', `${primaryFull}px`);\n this.adapter.setStyle(\n '--mdc-linear-progress-primary-full-neg', `${- primaryFull}px`);\n this.adapter.setStyle(\n '--mdc-linear-progress-secondary-quarter', `${secondaryQuarter}px`);\n this.adapter.setStyle(\n '--mdc-linear-progress-secondary-quarter-neg',\n `${- secondaryQuarter}px`);\n this.adapter.setStyle(\n '--mdc-linear-progress-secondary-half', `${secondaryHalf}px`);\n this.adapter.setStyle(\n '--mdc-linear-progress-secondary-half-neg', `${- secondaryHalf}px`);\n this.adapter.setStyle(\n '--mdc-linear-progress-secondary-full', `${secondaryFull}px`);\n this.adapter.setStyle(\n '--mdc-linear-progress-secondary-full-neg', `${- secondaryFull}px`);\n\n // need to restart animation for custom props to apply to keyframes\n this.restartAnimation();\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCLinearProgressFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './types';\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {SpecificEventListener} from '@material/base/types';\nimport {closest, matches} from '@material/dom/ponyfill';\nimport {MDCListAdapter} from './adapter';\nimport {cssClasses, evolutionAttribute, evolutionClassNameMap, numbers, strings} from './constants';\nimport {MDCListFoundation} from './foundation';\nimport {MDCListActionEventDetail, MDCListIndex} from './types';\n\nexport type MDCListFactory = (el: Element, foundation?: MDCListFoundation) =>\n MDCList;\n\nexport class MDCList extends MDCComponent<MDCListFoundation> {\n set vertical(value: boolean) {\n this.foundation.setVerticalOrientation(value);\n }\n\n get listElements(): Element[] {\n return Array.from(this.root.querySelectorAll(\n `.${this.classNameMap[cssClasses.LIST_ITEM_CLASS]}`));\n }\n\n set wrapFocus(value: boolean) {\n this.foundation.setWrapFocus(value);\n }\n\n /**\n * @return Whether typeahead is currently matching a user-specified prefix.\n */\n get typeaheadInProgress(): boolean {\n return this.foundation.isTypeaheadInProgress();\n }\n\n /**\n * Sets whether typeahead functionality is enabled on the list.\n * @param hasTypeahead Whether typeahead is enabled.\n */\n set hasTypeahead(hasTypeahead: boolean) {\n this.foundation.setHasTypeahead(hasTypeahead);\n }\n\n set singleSelection(isSingleSelectionList: boolean) {\n this.foundation.setSingleSelection(isSingleSelectionList);\n }\n\n get selectedIndex(): MDCListIndex {\n return this.foundation.getSelectedIndex();\n }\n\n set selectedIndex(index: MDCListIndex) {\n this.foundation.setSelectedIndex(index);\n }\n\n static attachTo(root: Element) {\n return new MDCList(root);\n }\n\n // The follow are assigned in initialSyncWithDOM().\n private handleKeydown!: SpecificEventListener<'keydown'>;\n private handleClick!: SpecificEventListener<'click'>;\n private focusInEventListener!: SpecificEventListener<'focus'>;\n private focusOutEventListener!: SpecificEventListener<'focus'>;\n\n // This mapping provides a layer of indirection from legacy classes to\n // evolution classes, since there are some inconsistencies between the\n // two.\n // TODO(b/176814973): remove this map when evolution is launched.\n private classNameMap!: {[className: string]: string};\n private isEvolutionEnabled!: boolean;\n private isInteractive!: boolean;\n\n initialSyncWithDOM() {\n this.isEvolutionEnabled =\n evolutionAttribute in (this.root as HTMLElement).dataset;\n this.classNameMap = this.isEvolutionEnabled ?\n evolutionClassNameMap :\n Object.values(cssClasses)\n .reduce((obj: {[className: string]: string}, className) => {\n obj[className] = className;\n return obj;\n }, {});\n\n this.handleClick = this.handleClickEvent.bind(this);\n this.handleKeydown = this.handleKeydownEvent.bind(this);\n this.focusInEventListener = this.handleFocusInEvent.bind(this);\n this.focusOutEventListener = this.handleFocusOutEvent.bind(this);\n this.listen('keydown', this.handleKeydown);\n this.listen('click', this.handleClick);\n this.listen('focusin', this.focusInEventListener);\n this.listen('focusout', this.focusOutEventListener);\n this.layout();\n this.initializeListType();\n this.ensureFocusable();\n }\n\n destroy() {\n this.unlisten('keydown', this.handleKeydown);\n this.unlisten('click', this.handleClick);\n this.unlisten('focusin', this.focusInEventListener);\n this.unlisten('focusout', this.focusOutEventListener);\n }\n\n layout() {\n const direction = this.root.getAttribute(strings.ARIA_ORIENTATION);\n this.vertical = direction !== strings.ARIA_ORIENTATION_HORIZONTAL;\n\n const itemSelector =\n `.${this.classNameMap[cssClasses.LIST_ITEM_CLASS]}:not([tabindex])`;\n const childSelector = `.${this.classNameMap[cssClasses.LIST_ITEM_CLASS]} ${\n strings.FOCUSABLE_CHILD_ELEMENTS}`;\n\n // List items need to have at least tabindex=-1 to be focusable.\n Array.prototype.forEach.call(\n this.root.querySelectorAll(itemSelector), (el: Element) => {\n el.setAttribute('tabindex', '-1');\n });\n\n // Child button/a elements are not tabbable until the list item is focused.\n Array.prototype.forEach.call(\n this.root.querySelectorAll(childSelector), (el: Element) => {\n el.setAttribute('tabindex', '-1');\n });\n\n if (this.isEvolutionEnabled) {\n this.foundation.setUseSelectedAttribute(true);\n }\n this.foundation.layout();\n }\n\n /**\n * Extracts the primary text from a list item.\n * @param item The list item element.\n * @return The primary text in the element.\n */\n getPrimaryText(item: Element): string {\n const primaryText = item.querySelector(\n `.${this.classNameMap[cssClasses.LIST_ITEM_PRIMARY_TEXT_CLASS]}`);\n if (this.isEvolutionEnabled || primaryText) {\n return primaryText?.textContent ?? '';\n }\n\n const singleLineText = item.querySelector(\n `.${this.classNameMap[cssClasses.LIST_ITEM_TEXT_CLASS]}`);\n return (singleLineText && singleLineText.textContent) || '';\n }\n\n /**\n * Initialize selectedIndex value based on pre-selected list items.\n */\n initializeListType() {\n this.isInteractive =\n matches(this.root, strings.ARIA_INTERACTIVE_ROLES_SELECTOR);\n\n if (this.isEvolutionEnabled && this.isInteractive) {\n const selection = Array.from(\n this.root.querySelectorAll(strings.SELECTED_ITEM_SELECTOR),\n (listItem: Element) => this.listElements.indexOf(listItem));\n\n if (matches(this.root, strings.ARIA_MULTI_SELECTABLE_SELECTOR)) {\n this.selectedIndex = selection;\n } else if (selection.length > 0) {\n this.selectedIndex = selection[0];\n }\n return;\n }\n\n const checkboxListItems =\n this.root.querySelectorAll(strings.ARIA_ROLE_CHECKBOX_SELECTOR);\n const radioSelectedListItem =\n this.root.querySelector(strings.ARIA_CHECKED_RADIO_SELECTOR);\n\n if (checkboxListItems.length) {\n const preselectedItems =\n this.root.querySelectorAll(strings.ARIA_CHECKED_CHECKBOX_SELECTOR);\n this.selectedIndex = Array.from(\n preselectedItems,\n (listItem: Element) => this.listElements.indexOf(listItem));\n } else if (radioSelectedListItem) {\n this.selectedIndex = this.listElements.indexOf(radioSelectedListItem);\n }\n }\n\n /**\n * Updates the list item at itemIndex to the desired isEnabled state.\n * @param itemIndex Index of the list item\n * @param isEnabled Sets the list item to enabled or disabled.\n */\n setEnabled(itemIndex: number, isEnabled: boolean) {\n this.foundation.setEnabled(itemIndex, isEnabled);\n }\n\n /**\n * Given the next desired character from the user, adds it to the typeahead\n * buffer. Then, attempts to find the next option matching the buffer. Wraps\n * around if at the end of options.\n *\n * @param nextChar The next character to add to the prefix buffer.\n * @param startingIndex The index from which to start matching. Defaults to\n * the currently focused index.\n * @return The index of the matched item.\n */\n typeaheadMatchItem(nextChar: string, startingIndex?: number): number {\n return this.foundation.typeaheadMatchItem(\n nextChar, startingIndex, /** skipFocus */ true);\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take\n // a Partial<MDCFooAdapter>. To ensure we don't accidentally omit any\n // methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCListAdapter = {\n addClassForElementIndex: (index, className) => {\n const element = this.listElements[index];\n if (element) {\n element.classList.add(this.classNameMap[className]);\n }\n },\n focusItemAtIndex: (index) => {\n const element = this.listElements[index] as HTMLElement | undefined;\n if (element) {\n element.focus();\n }\n },\n getAttributeForElementIndex: (index, attr) =>\n this.listElements[index].getAttribute(attr),\n getFocusedElementIndex: () =>\n this.listElements.indexOf(document.activeElement!),\n getListItemCount: () => this.listElements.length,\n getPrimaryTextAtIndex: (index) =>\n this.getPrimaryText(this.listElements[index]),\n hasCheckboxAtIndex: (index) => {\n const listItem = this.listElements[index];\n return !!listItem.querySelector(strings.CHECKBOX_SELECTOR);\n },\n hasRadioAtIndex: (index) => {\n const listItem = this.listElements[index];\n return !!listItem.querySelector(strings.RADIO_SELECTOR);\n },\n isCheckboxCheckedAtIndex: (index) => {\n const listItem = this.listElements[index];\n const toggleEl =\n listItem.querySelector<HTMLInputElement>(strings.CHECKBOX_SELECTOR);\n return toggleEl!.checked;\n },\n isFocusInsideList: () => {\n return this.root !== document.activeElement &&\n this.root.contains(document.activeElement);\n },\n isRootFocused: () => document.activeElement === this.root,\n listItemAtIndexHasClass: (index, className) =>\n this.listElements[index].classList.contains(\n this.classNameMap[className]),\n notifyAction: (index) => {\n this.emit<MDCListActionEventDetail>(\n strings.ACTION_EVENT, {index}, /** shouldBubble */ true);\n },\n removeClassForElementIndex: (index, className) => {\n const element = this.listElements[index];\n if (element) {\n element.classList.remove(this.classNameMap[className]);\n }\n },\n setAttributeForElementIndex: (index, attr, value) => {\n const element = this.listElements[index];\n if (element) {\n element.setAttribute(attr, value);\n }\n },\n setCheckedCheckboxOrRadioAtIndex: (index, isChecked) => {\n const listItem = this.listElements[index];\n const toggleEl = listItem.querySelector<HTMLInputElement>(\n strings.CHECKBOX_RADIO_SELECTOR);\n toggleEl!.checked = isChecked;\n\n const event = document.createEvent('Event');\n event.initEvent('change', true, true);\n toggleEl!.dispatchEvent(event);\n },\n setTabIndexForListItemChildren: (listItemIndex, tabIndexValue) => {\n const element = this.listElements[listItemIndex];\n const selector = `.${this.classNameMap[cssClasses.LIST_ITEM_CLASS]} ${\n strings.CHILD_ELEMENTS_TO_TOGGLE_TABINDEX}`;\n Array.prototype.forEach.call(\n element.querySelectorAll(selector), (el: Element) => {\n el.setAttribute('tabindex', tabIndexValue);\n });\n },\n };\n return new MDCListFoundation(adapter);\n }\n\n /**\n * Ensures that at least one item is focusable if the list is interactive and\n * doesn't specify a suitable tabindex.\n */\n private ensureFocusable() {\n if (this.isEvolutionEnabled && this.isInteractive) {\n if (!this.root.querySelector(`.${\n this.classNameMap[cssClasses.LIST_ITEM_CLASS]}[tabindex=\"0\"]`)) {\n const index = this.initialFocusIndex();\n if (index !== -1) {\n (this.listElements[index] as HTMLElement).tabIndex = 0;\n }\n }\n }\n }\n\n private initialFocusIndex(): number {\n if (this.selectedIndex instanceof Array && this.selectedIndex.length > 0) {\n return this.selectedIndex[0];\n }\n if (typeof this.selectedIndex === 'number' &&\n this.selectedIndex !== numbers.UNSET_INDEX) {\n return this.selectedIndex;\n }\n const el = this.root.querySelector(\n `.${this.classNameMap[cssClasses.LIST_ITEM_CLASS]}:not(.${\n this.classNameMap[cssClasses.LIST_ITEM_DISABLED_CLASS]})`);\n if (el === null) {\n return -1;\n }\n return this.getListItemIndex(el);\n }\n\n /**\n * Used to figure out which list item this event is targetting. Or returns -1\n * if there is no list item\n */\n private getListItemIndex(el: Element) {\n const nearestParent = closest(\n el,\n `.${this.classNameMap[cssClasses.LIST_ITEM_CLASS]}, .${\n this.classNameMap[cssClasses.ROOT]}`);\n\n // Get the index of the element if it is a list item.\n if (nearestParent &&\n matches(\n nearestParent,\n `.${this.classNameMap[cssClasses.LIST_ITEM_CLASS]}`)) {\n return this.listElements.indexOf(nearestParent);\n }\n\n return -1;\n }\n\n /**\n * Used to figure out which element was clicked before sending the event to\n * the foundation.\n */\n private handleFocusInEvent(evt: FocusEvent) {\n const index = this.getListItemIndex(evt.target as Element);\n this.foundation.handleFocusIn(evt, index);\n }\n\n /**\n * Used to figure out which element was clicked before sending the event to\n * the foundation.\n */\n private handleFocusOutEvent(evt: FocusEvent) {\n const index = this.getListItemIndex(evt.target as Element);\n this.foundation.handleFocusOut(evt, index);\n }\n\n /**\n * Used to figure out which element was focused when keydown event occurred\n * before sending the event to the foundation.\n */\n private handleKeydownEvent(evt: KeyboardEvent) {\n const index = this.getListItemIndex(evt.target as Element);\n const target = evt.target as Element;\n this.foundation.handleKeydown(\n evt,\n target.classList.contains(\n this.classNameMap[cssClasses.LIST_ITEM_CLASS]),\n index);\n }\n\n /**\n * Used to figure out which element was clicked before sending the event to\n * the foundation.\n */\n private handleClickEvent(evt: MouseEvent) {\n const index = this.getListItemIndex(evt.target as Element);\n const target = evt.target as Element;\n // Toggle the checkbox only if it's not the target of the event, or the\n // checkbox will have 2 change events.\n const toggleCheckbox = !matches(target, strings.CHECKBOX_RADIO_SELECTOR);\n this.foundation.handleClick(index, toggleCheckbox);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst cssClasses = {\n LIST_ITEM_ACTIVATED_CLASS: 'mdc-list-item--activated',\n LIST_ITEM_CLASS: 'mdc-list-item',\n LIST_ITEM_DISABLED_CLASS: 'mdc-list-item--disabled',\n LIST_ITEM_SELECTED_CLASS: 'mdc-list-item--selected',\n LIST_ITEM_TEXT_CLASS: 'mdc-list-item__text',\n LIST_ITEM_PRIMARY_TEXT_CLASS: 'mdc-list-item__primary-text',\n ROOT: 'mdc-list',\n};\n\nconst strings = {\n ACTION_EVENT: 'MDCList:action',\n ARIA_CHECKED: 'aria-checked',\n ARIA_CHECKED_CHECKBOX_SELECTOR: '[role=\"checkbox\"][aria-checked=\"true\"]',\n ARIA_CHECKED_RADIO_SELECTOR: '[role=\"radio\"][aria-checked=\"true\"]',\n ARIA_CURRENT: 'aria-current',\n ARIA_DISABLED: 'aria-disabled',\n ARIA_ORIENTATION: 'aria-orientation',\n ARIA_ORIENTATION_HORIZONTAL: 'horizontal',\n ARIA_ROLE_CHECKBOX_SELECTOR: '[role=\"checkbox\"]',\n ARIA_SELECTED: 'aria-selected',\n ARIA_INTERACTIVE_ROLES_SELECTOR: '[role=\"listbox\"], [role=\"menu\"]',\n ARIA_MULTI_SELECTABLE_SELECTOR: '[aria-multiselectable=\"true\"]',\n CHECKBOX_RADIO_SELECTOR: 'input[type=\"checkbox\"], input[type=\"radio\"]',\n CHECKBOX_SELECTOR: 'input[type=\"checkbox\"]',\n CHILD_ELEMENTS_TO_TOGGLE_TABINDEX: 'button:not(:disabled), a',\n FOCUSABLE_CHILD_ELEMENTS:\n 'button:not(:disabled), a, input[type=\"radio\"]:not(:disabled), input[type=\"checkbox\"]:not(:disabled)',\n RADIO_SELECTOR: 'input[type=\"radio\"]',\n SELECTED_ITEM_SELECTOR: '[aria-selected=\"true\"], [aria-current=\"true\"]',\n};\n\nconst numbers = {\n UNSET_INDEX: -1,\n TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS: 300\n};\n\nconst evolutionClassNameMap = {\n [`${cssClasses.LIST_ITEM_ACTIVATED_CLASS}`]:\n 'mdc-evolution-list-item--activated',\n [`${cssClasses.LIST_ITEM_CLASS}`]: 'mdc-evolution-list-item',\n [`${cssClasses.LIST_ITEM_DISABLED_CLASS}`]:\n 'mdc-evolution-list-item--disabled',\n [`${cssClasses.LIST_ITEM_SELECTED_CLASS}`]:\n 'mdc-evolution-list-item--selected',\n [`${cssClasses.LIST_ITEM_PRIMARY_TEXT_CLASS}`]:\n 'mdc-evolution-list-item__primary-text',\n [`${cssClasses.ROOT}`]: 'mdc-evolution-list',\n};\n\nconst evolutionAttribute = 'evolution';\n\nexport {\n strings,\n cssClasses,\n numbers,\n evolutionAttribute,\n evolutionClassNameMap\n};\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst ELEMENTS_KEY_ALLOWED_IN = ['input', 'button', 'textarea', 'select'];\n\n/**\n * Ensures that preventDefault is only called if the containing element\n * doesn't consume the event, and it will cause an unintended scroll.\n *\n * @param evt keyboard event to be prevented.\n */\nexport const preventDefaultEvent = (evt: KeyboardEvent) => {\n const target = evt.target as Element;\n if (!target) {\n return;\n }\n const tagName = `${target.tagName}`.toLowerCase();\n if (ELEMENTS_KEY_ALLOWED_IN.indexOf(tagName) === -1) {\n evt.preventDefault();\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n// TODO(b/152410470): Remove trailing underscores from private properties\n// tslint:disable:strip-private-property-underscore\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {normalizeKey} from '@material/dom/keyboard';\n\nimport {MDCListAdapter} from './adapter';\nimport {cssClasses, numbers, strings} from './constants';\nimport {preventDefaultEvent} from './events';\nimport * as typeahead from './typeahead';\nimport {MDCListIndex, MDCListTextAndIndex} from './types';\n\nfunction isNumberArray(selectedIndex: MDCListIndex): selectedIndex is number[] {\n return selectedIndex instanceof Array;\n}\n\nexport class MDCListFoundation extends MDCFoundation<MDCListAdapter> {\n static get strings() {\n return strings;\n }\n\n static get cssClasses() {\n return cssClasses;\n }\n\n static get numbers() {\n return numbers;\n }\n\n static get defaultAdapter(): MDCListAdapter {\n return {\n addClassForElementIndex: () => undefined,\n focusItemAtIndex: () => undefined,\n getAttributeForElementIndex: () => null,\n getFocusedElementIndex: () => 0,\n getListItemCount: () => 0,\n hasCheckboxAtIndex: () => false,\n hasRadioAtIndex: () => false,\n isCheckboxCheckedAtIndex: () => false,\n isFocusInsideList: () => false,\n isRootFocused: () => false,\n listItemAtIndexHasClass: () => false,\n notifyAction: () => undefined,\n removeClassForElementIndex: () => undefined,\n setAttributeForElementIndex: () => undefined,\n setCheckedCheckboxOrRadioAtIndex: () => undefined,\n setTabIndexForListItemChildren: () => undefined,\n getPrimaryTextAtIndex: () => '',\n };\n }\n\n private wrapFocus_ = false;\n private isVertical_ = true;\n private isSingleSelectionList_ = false;\n private selectedIndex_: MDCListIndex = numbers.UNSET_INDEX;\n private focusedItemIndex = numbers.UNSET_INDEX;\n private useActivatedClass_ = false;\n private useSelectedAttr_ = false;\n private ariaCurrentAttrValue_: string|null = null;\n private isCheckboxList_ = false;\n private isRadioList_ = false;\n\n private hasTypeahead = false;\n // Transiently holds current typeahead prefix from user.\n private readonly typeaheadState = typeahead.initState();\n private sortedIndexByFirstChar = new Map<string, MDCListTextAndIndex[]>();\n\n constructor(adapter?: Partial<MDCListAdapter>) {\n super({...MDCListFoundation.defaultAdapter, ...adapter});\n }\n\n layout() {\n if (this.adapter.getListItemCount() === 0) {\n return;\n }\n\n // TODO(b/172274142): consider all items when determining the list's type.\n if (this.adapter.hasCheckboxAtIndex(0)) {\n this.isCheckboxList_ = true;\n } else if (this.adapter.hasRadioAtIndex(0)) {\n this.isRadioList_ = true;\n } else {\n this.maybeInitializeSingleSelection();\n }\n\n if (this.hasTypeahead) {\n this.sortedIndexByFirstChar = this.typeaheadInitSortedIndex();\n }\n }\n\n /**\n * Sets the private wrapFocus_ variable.\n */\n setWrapFocus(value: boolean) {\n this.wrapFocus_ = value;\n }\n\n /**\n * Sets the isVertical_ private variable.\n */\n setVerticalOrientation(value: boolean) {\n this.isVertical_ = value;\n }\n\n /**\n * Sets the isSingleSelectionList_ private variable.\n */\n setSingleSelection(value: boolean) {\n this.isSingleSelectionList_ = value;\n if (value) {\n this.maybeInitializeSingleSelection();\n }\n }\n\n /**\n * Automatically determines whether the list is single selection list. If so,\n * initializes the internal state to match the selected item.\n */\n private maybeInitializeSingleSelection() {\n const listItemsCount = this.adapter.getListItemCount();\n for (let i = 0; i < listItemsCount; i++) {\n const hasSelectedClass = this.adapter.listItemAtIndexHasClass(\n i, cssClasses.LIST_ITEM_SELECTED_CLASS);\n const hasActivatedClass = this.adapter.listItemAtIndexHasClass(\n i, cssClasses.LIST_ITEM_ACTIVATED_CLASS);\n if (!(hasSelectedClass || hasActivatedClass)) {\n continue;\n }\n\n if (hasActivatedClass) {\n this.setUseActivatedClass(true);\n }\n\n this.isSingleSelectionList_ = true;\n this.selectedIndex_ = i;\n return;\n }\n }\n\n /**\n * Sets whether typeahead is enabled on the list.\n * @param hasTypeahead Whether typeahead is enabled.\n */\n setHasTypeahead(hasTypeahead: boolean) {\n this.hasTypeahead = hasTypeahead;\n if (hasTypeahead) {\n this.sortedIndexByFirstChar = this.typeaheadInitSortedIndex();\n }\n }\n\n /**\n * @return Whether typeahead is currently matching a user-specified prefix.\n */\n isTypeaheadInProgress(): boolean {\n return this.hasTypeahead &&\n typeahead.isTypingInProgress(this.typeaheadState);\n }\n\n /**\n * Sets the useActivatedClass_ private variable.\n */\n setUseActivatedClass(useActivated: boolean) {\n this.useActivatedClass_ = useActivated;\n }\n\n /**\n * Sets the useSelectedAttr_ private variable.\n */\n setUseSelectedAttribute(useSelected: boolean) {\n this.useSelectedAttr_ = useSelected;\n }\n\n getSelectedIndex(): MDCListIndex {\n return this.selectedIndex_;\n }\n\n setSelectedIndex(index: MDCListIndex) {\n if (!this.isIndexValid_(index)) {\n return;\n }\n\n if (this.isCheckboxList_) {\n this.setCheckboxAtIndex_(index as number[]);\n } else if (this.isRadioList_) {\n this.setRadioAtIndex_(index as number);\n } else {\n this.setSingleSelectionAtIndex_(index as number);\n }\n }\n\n /**\n * Focus in handler for the list items.\n */\n handleFocusIn(_: FocusEvent, listItemIndex: number) {\n if (listItemIndex >= 0) {\n this.focusedItemIndex = listItemIndex;\n this.adapter.setAttributeForElementIndex(listItemIndex, 'tabindex', '0');\n this.adapter.setTabIndexForListItemChildren(listItemIndex, '0');\n }\n }\n\n /**\n * Focus out handler for the list items.\n */\n handleFocusOut(_: FocusEvent, listItemIndex: number) {\n if (listItemIndex >= 0) {\n this.adapter.setAttributeForElementIndex(listItemIndex, 'tabindex', '-1');\n this.adapter.setTabIndexForListItemChildren(listItemIndex, '-1');\n }\n\n /**\n * Between Focusout & Focusin some browsers do not have focus on any\n * element. Setting a delay to wait till the focus is moved to next element.\n */\n setTimeout(() => {\n if (!this.adapter.isFocusInsideList()) {\n this.setTabindexToFirstSelectedOrFocusedItem();\n }\n }, 0);\n }\n\n /**\n * Key handler for the list.\n */\n handleKeydown(\n event: KeyboardEvent, isRootListItem: boolean, listItemIndex: number) {\n const isArrowLeft = normalizeKey(event) === 'ArrowLeft';\n const isArrowUp = normalizeKey(event) === 'ArrowUp';\n const isArrowRight = normalizeKey(event) === 'ArrowRight';\n const isArrowDown = normalizeKey(event) === 'ArrowDown';\n const isHome = normalizeKey(event) === 'Home';\n const isEnd = normalizeKey(event) === 'End';\n const isEnter = normalizeKey(event) === 'Enter';\n const isSpace = normalizeKey(event) === 'Spacebar';\n\n // Have to check both upper and lower case, because having caps lock on affects the value.\n const isLetterA = event.key === 'A' || event.key === 'a';\n\n if (this.adapter.isRootFocused()) {\n if (isArrowUp || isEnd) {\n event.preventDefault();\n this.focusLastElement();\n } else if (isArrowDown || isHome) {\n event.preventDefault();\n this.focusFirstElement();\n }\n\n if (this.hasTypeahead) {\n const handleKeydownOpts: typeahead.HandleKeydownOpts = {\n event,\n focusItemAtIndex: (index) => {\n this.focusItemAtIndex(index);\n },\n focusedItemIndex: -1,\n isTargetListItem: isRootListItem,\n sortedIndexByFirstChar: this.sortedIndexByFirstChar,\n isItemAtIndexDisabled: (index) =>\n this.adapter.listItemAtIndexHasClass(\n index, cssClasses.LIST_ITEM_DISABLED_CLASS),\n };\n\n typeahead.handleKeydown(handleKeydownOpts, this.typeaheadState);\n }\n\n return;\n }\n\n let currentIndex = this.adapter.getFocusedElementIndex();\n if (currentIndex === -1) {\n currentIndex = listItemIndex;\n if (currentIndex < 0) {\n // If this event doesn't have a mdc-list-item ancestor from the\n // current list (not from a sublist), return early.\n return;\n }\n }\n\n if ((this.isVertical_ && isArrowDown) ||\n (!this.isVertical_ && isArrowRight)) {\n preventDefaultEvent(event);\n this.focusNextElement(currentIndex);\n } else if (\n (this.isVertical_ && isArrowUp) || (!this.isVertical_ && isArrowLeft)) {\n preventDefaultEvent(event);\n this.focusPrevElement(currentIndex);\n } else if (isHome) {\n preventDefaultEvent(event);\n this.focusFirstElement();\n } else if (isEnd) {\n preventDefaultEvent(event);\n this.focusLastElement();\n } else if (isLetterA && event.ctrlKey && this.isCheckboxList_) {\n event.preventDefault();\n this.toggleAll(this.selectedIndex_ === numbers.UNSET_INDEX ? [] : this.selectedIndex_ as number[]);\n } else if (isEnter || isSpace) {\n if (isRootListItem) {\n // Return early if enter key is pressed on anchor element which triggers\n // synthetic MouseEvent event.\n const target = event.target as Element | null;\n if (target && target.tagName === 'A' && isEnter) {\n return;\n }\n preventDefaultEvent(event);\n\n if (this.adapter.listItemAtIndexHasClass(\n currentIndex, cssClasses.LIST_ITEM_DISABLED_CLASS)) {\n return;\n }\n\n if (!this.isTypeaheadInProgress()) {\n if (this.isSelectableList_()) {\n this.setSelectedIndexOnAction_(currentIndex);\n }\n this.adapter.notifyAction(currentIndex);\n }\n }\n }\n\n if (this.hasTypeahead) {\n const handleKeydownOpts: typeahead.HandleKeydownOpts = {\n event,\n focusItemAtIndex: (index) => {\n this.focusItemAtIndex(index)\n },\n focusedItemIndex: this.focusedItemIndex,\n isTargetListItem: isRootListItem,\n sortedIndexByFirstChar: this.sortedIndexByFirstChar,\n isItemAtIndexDisabled: (index) => this.adapter.listItemAtIndexHasClass(\n index, cssClasses.LIST_ITEM_DISABLED_CLASS),\n };\n\n typeahead.handleKeydown(handleKeydownOpts, this.typeaheadState);\n }\n }\n\n /**\n * Click handler for the list.\n */\n handleClick(index: number, toggleCheckbox: boolean) {\n if (index === numbers.UNSET_INDEX) {\n return;\n }\n\n if (this.adapter.listItemAtIndexHasClass(\n index, cssClasses.LIST_ITEM_DISABLED_CLASS)) {\n return;\n }\n if (this.isSelectableList_()) {\n this.setSelectedIndexOnAction_(index, toggleCheckbox);\n }\n\n this.adapter.notifyAction(index);\n }\n\n /**\n * Focuses the next element on the list.\n */\n focusNextElement(index: number) {\n const count = this.adapter.getListItemCount();\n let nextIndex = index + 1;\n if (nextIndex >= count) {\n if (this.wrapFocus_) {\n nextIndex = 0;\n } else {\n // Return early because last item is already focused.\n return index;\n }\n }\n this.focusItemAtIndex(nextIndex);\n\n return nextIndex;\n }\n\n /**\n * Focuses the previous element on the list.\n */\n focusPrevElement(index: number) {\n let prevIndex = index - 1;\n if (prevIndex < 0) {\n if (this.wrapFocus_) {\n prevIndex = this.adapter.getListItemCount() - 1;\n } else {\n // Return early because first item is already focused.\n return index;\n }\n }\n this.focusItemAtIndex(prevIndex);\n return prevIndex;\n }\n\n focusFirstElement() {\n this.focusItemAtIndex(0);\n return 0;\n }\n\n focusLastElement() {\n const lastIndex = this.adapter.getListItemCount() - 1;\n this.focusItemAtIndex(lastIndex);\n return lastIndex;\n }\n\n focusInitialElement() {\n const initialIndex = this.getFirstSelectedOrFocusedItemIndex();\n this.focusItemAtIndex(initialIndex);\n return initialIndex;\n }\n\n /**\n * @param itemIndex Index of the list item\n * @param isEnabled Sets the list item to enabled or disabled.\n */\n setEnabled(itemIndex: number, isEnabled: boolean): void {\n if (!this.isIndexValid_(itemIndex)) {\n return;\n }\n\n if (isEnabled) {\n this.adapter.removeClassForElementIndex(\n itemIndex, cssClasses.LIST_ITEM_DISABLED_CLASS);\n this.adapter.setAttributeForElementIndex(\n itemIndex, strings.ARIA_DISABLED, 'false');\n } else {\n this.adapter.addClassForElementIndex(\n itemIndex, cssClasses.LIST_ITEM_DISABLED_CLASS);\n this.adapter.setAttributeForElementIndex(\n itemIndex, strings.ARIA_DISABLED, 'true');\n }\n }\n\n\n private setSingleSelectionAtIndex_(index: number) {\n if (this.selectedIndex_ === index) {\n return;\n }\n\n let selectedClassName = cssClasses.LIST_ITEM_SELECTED_CLASS;\n if (this.useActivatedClass_) {\n selectedClassName = cssClasses.LIST_ITEM_ACTIVATED_CLASS;\n }\n\n if (this.selectedIndex_ !== numbers.UNSET_INDEX) {\n this.adapter.removeClassForElementIndex(\n this.selectedIndex_ as number, selectedClassName);\n }\n\n this.setAriaForSingleSelectionAtIndex_(index);\n this.setTabindexAtIndex(index);\n if (index !== numbers.UNSET_INDEX) {\n this.adapter.addClassForElementIndex(index, selectedClassName);\n }\n\n this.selectedIndex_ = index;\n }\n\n /**\n * Sets aria attribute for single selection at given index.\n */\n private setAriaForSingleSelectionAtIndex_(index: number) {\n // Detect the presence of aria-current and get the value only during list\n // initialization when it is in unset state.\n if (this.selectedIndex_ === numbers.UNSET_INDEX) {\n this.ariaCurrentAttrValue_ =\n this.adapter.getAttributeForElementIndex(index, strings.ARIA_CURRENT);\n }\n\n const isAriaCurrent = this.ariaCurrentAttrValue_ !== null;\n const ariaAttribute =\n isAriaCurrent ? strings.ARIA_CURRENT : strings.ARIA_SELECTED;\n\n if (this.selectedIndex_ !== numbers.UNSET_INDEX) {\n this.adapter.setAttributeForElementIndex(\n this.selectedIndex_ as number, ariaAttribute, 'false');\n }\n\n if (index !== numbers.UNSET_INDEX) {\n const ariaAttributeValue =\n isAriaCurrent ? this.ariaCurrentAttrValue_ : 'true';\n this.adapter.setAttributeForElementIndex(\n index, ariaAttribute, ariaAttributeValue as string);\n }\n }\n\n /**\n * Returns the attribute to use for indicating selection status.\n */\n private getSelectionAttribute(): string {\n return this.useSelectedAttr_ ? strings.ARIA_SELECTED : strings.ARIA_CHECKED;\n }\n\n /**\n * Toggles radio at give index. Radio doesn't change the checked state if it\n * is already checked.\n */\n private setRadioAtIndex_(index: number) {\n const selectionAttribute = this.getSelectionAttribute();\n this.adapter.setCheckedCheckboxOrRadioAtIndex(index, true);\n\n if (this.selectedIndex_ !== numbers.UNSET_INDEX) {\n this.adapter.setAttributeForElementIndex(\n this.selectedIndex_ as number, selectionAttribute, 'false');\n }\n\n this.adapter.setAttributeForElementIndex(index, selectionAttribute, 'true');\n\n this.selectedIndex_ = index;\n }\n\n private setCheckboxAtIndex_(index: number[]) {\n const selectionAttribute = this.getSelectionAttribute();\n for (let i = 0; i < this.adapter.getListItemCount(); i++) {\n let isChecked = false;\n if (index.indexOf(i) >= 0) {\n isChecked = true;\n }\n\n this.adapter.setCheckedCheckboxOrRadioAtIndex(i, isChecked);\n this.adapter.setAttributeForElementIndex(\n i, selectionAttribute, isChecked ? 'true' : 'false');\n }\n\n this.selectedIndex_ = index;\n }\n\n private setTabindexAtIndex(index: number) {\n if (this.focusedItemIndex === numbers.UNSET_INDEX && index !== 0) {\n // If some list item was selected set first list item's tabindex to -1.\n // Generally, tabindex is set to 0 on first list item of list that has no\n // preselected items.\n this.adapter.setAttributeForElementIndex(0, 'tabindex', '-1');\n } else if (this.focusedItemIndex >= 0 && this.focusedItemIndex !== index) {\n this.adapter.setAttributeForElementIndex(\n this.focusedItemIndex, 'tabindex', '-1');\n }\n\n // Set the previous selection's tabindex to -1. We need this because\n // in selection menus that are not visible, programmatically setting an\n // option will not change focus but will change where tabindex should be 0.\n if (!(this.selectedIndex_ instanceof Array) &&\n this.selectedIndex_ !== index) {\n this.adapter.setAttributeForElementIndex(\n this.selectedIndex_, 'tabindex', '-1');\n }\n\n if (index !== numbers.UNSET_INDEX) {\n this.adapter.setAttributeForElementIndex(index, 'tabindex', '0');\n }\n }\n\n /**\n * @return Return true if it is single selectin list, checkbox list or radio\n * list.\n */\n private isSelectableList_() {\n return this.isSingleSelectionList_ || this.isCheckboxList_ ||\n this.isRadioList_;\n }\n\n private setTabindexToFirstSelectedOrFocusedItem() {\n const targetIndex = this.getFirstSelectedOrFocusedItemIndex();\n this.setTabindexAtIndex(targetIndex);\n }\n\n private getFirstSelectedOrFocusedItemIndex(): number {\n let targetIndex = this.focusedItemIndex >= 0 ? this.focusedItemIndex : 0;\n if (this.isSelectableList_()) {\n if (typeof this.selectedIndex_ === 'number' &&\n this.selectedIndex_ !== numbers.UNSET_INDEX) {\n targetIndex = this.selectedIndex_;\n } else if (\n isNumberArray(this.selectedIndex_) &&\n this.selectedIndex_.length > 0) {\n targetIndex = this.selectedIndex_.reduce(\n (currentIndex, minIndex) => Math.min(currentIndex, minIndex));\n }\n }\n return targetIndex;\n }\n\n private isIndexValid_(index: MDCListIndex) {\n if (index instanceof Array) {\n if (!this.isCheckboxList_) {\n throw new Error(\n 'MDCListFoundation: Array of index is only supported for checkbox based list');\n }\n\n if (index.length === 0) {\n return true;\n } else {\n return index.some((i) => this.isIndexInRange_(i));\n }\n } else if (typeof index === 'number') {\n if (this.isCheckboxList_) {\n throw new Error(\n `MDCListFoundation: Expected array of index for checkbox based list but got number: ${\n index}`);\n }\n return this.isIndexInRange_(index) ||\n this.isSingleSelectionList_ && index === numbers.UNSET_INDEX;\n } else {\n return false;\n }\n }\n\n private isIndexInRange_(index: number) {\n const listSize = this.adapter.getListItemCount();\n return index >= 0 && index < listSize;\n }\n\n /**\n * Sets selected index on user action, toggles checkbox / radio based on\n * toggleCheckbox value. User interaction should not toggle list item(s) when\n * disabled.\n */\n private setSelectedIndexOnAction_(index: number, toggleCheckbox = true) {\n if (this.isCheckboxList_) {\n this.toggleCheckboxAtIndex_(index, toggleCheckbox);\n } else {\n this.setSelectedIndex(index);\n }\n }\n\n private toggleCheckboxAtIndex_(index: number, toggleCheckbox: boolean) {\n const selectionAttribute = this.getSelectionAttribute();\n let isChecked = this.adapter.isCheckboxCheckedAtIndex(index);\n\n if (toggleCheckbox) {\n isChecked = !isChecked;\n this.adapter.setCheckedCheckboxOrRadioAtIndex(index, isChecked);\n }\n\n this.adapter.setAttributeForElementIndex(\n index, selectionAttribute, isChecked ? 'true' : 'false');\n\n // If none of the checkbox items are selected and selectedIndex is not\n // initialized then provide a default value.\n let selectedIndexes = this.selectedIndex_ === numbers.UNSET_INDEX ?\n [] :\n (this.selectedIndex_ as number[]).slice();\n\n if (isChecked) {\n selectedIndexes.push(index);\n } else {\n selectedIndexes = selectedIndexes.filter((i) => i !== index);\n }\n\n this.selectedIndex_ = selectedIndexes;\n }\n\n private focusItemAtIndex(index: number) {\n this.adapter.focusItemAtIndex(index);\n this.focusedItemIndex = index;\n }\n\n private toggleAll(currentlySelectedIndexes: number[]) {\n const count = this.adapter.getListItemCount();\n\n // If all items are selected, deselect everything.\n if (currentlySelectedIndexes.length === count) {\n this.setCheckboxAtIndex_([]);\n } else {\n // Otherwise select all enabled options.\n const allIndexes: number[] = [];\n for (let i = 0; i < count; i++) {\n if (!this.adapter.listItemAtIndexHasClass(i, cssClasses.LIST_ITEM_DISABLED_CLASS) ||\n currentlySelectedIndexes.indexOf(i) > -1) {\n allIndexes.push(i);\n }\n }\n this.setCheckboxAtIndex_(allIndexes);\n }\n }\n\n /**\n * Given the next desired character from the user, adds it to the typeahead\n * buffer. Then, attempts to find the next option matching the buffer. Wraps\n * around if at the end of options.\n *\n * @param nextChar The next character to add to the prefix buffer.\n * @param startingIndex The index from which to start matching. Only relevant\n * when starting a new match sequence. To start a new match sequence,\n * clear the buffer using `clearTypeaheadBuffer`, or wait for the buffer\n * to clear after a set interval defined in list foundation. Defaults to\n * the currently focused index.\n * @return The index of the matched item, or -1 if no match.\n */\n typeaheadMatchItem(\n nextChar: string, startingIndex?: number, skipFocus = false) {\n const opts: typeahead.TypeaheadMatchItemOpts = {\n focusItemAtIndex: (index) => {\n this.focusItemAtIndex(index);\n },\n focusedItemIndex: startingIndex ? startingIndex : this.focusedItemIndex,\n nextChar,\n sortedIndexByFirstChar: this.sortedIndexByFirstChar,\n skipFocus,\n isItemAtIndexDisabled: (index) => this.adapter.listItemAtIndexHasClass(\n index, cssClasses.LIST_ITEM_DISABLED_CLASS)\n };\n return typeahead.matchItem(opts, this.typeaheadState);\n }\n\n /**\n * Initializes the MDCListTextAndIndex data structure by indexing the current\n * list items by primary text.\n *\n * @return The primary texts of all the list items sorted by first character.\n */\n private typeaheadInitSortedIndex() {\n return typeahead.initSortedIndex(\n this.adapter.getListItemCount(), this.adapter.getPrimaryTextAtIndex);\n }\n\n /**\n * Clears the typeahead buffer.\n */\n clearTypeaheadBuffer() {\n typeahead.clearBuffer(this.typeaheadState);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCListFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './types';\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {normalizeKey} from '@material/dom/keyboard';\n\nimport {numbers} from './constants';\nimport {preventDefaultEvent} from './events';\nimport {MDCListTextAndIndex} from './types';\n\n/**\n * State of a typeahead instance.\n */\nexport interface TypeaheadState {\n typeaheadBuffer: string;\n currentFirstChar: string;\n sortedIndexCursor: number;\n bufferClearTimeout: number;\n}\n\n/**\n * Initializes a state object for typeahead. Use the same reference for calls to\n * typeahead functions.\n *\n * @return The current state of the typeahead process. Each state reference\n * represents a typeahead instance as the reference is typically mutated\n * in-place.\n */\nexport function initState(): TypeaheadState {\n const state: TypeaheadState = {\n bufferClearTimeout: 0,\n currentFirstChar: '',\n sortedIndexCursor: 0,\n typeaheadBuffer: '',\n };\n return state;\n}\n\n/**\n * Initializes typeahead state by indexing the current list items by primary\n * text into the sortedIndexByFirstChar data structure.\n *\n * @param listItemCount numer of items in the list\n * @param getPrimaryTextByItemIndex function that returns the primary text at a\n * given index\n *\n * @return Map that maps the first character of the primary text to the full\n * list text and it's index\n */\nexport function initSortedIndex(\n listItemCount: number,\n getPrimaryTextByItemIndex: (index: number) =>\n string): Map<string, MDCListTextAndIndex[]> {\n const sortedIndexByFirstChar = new Map<string, MDCListTextAndIndex[]>();\n\n // Aggregate item text to index mapping\n for (let i = 0; i < listItemCount; i++) {\n const primaryText = getPrimaryTextByItemIndex(i).trim();\n if (!primaryText) {\n continue;\n }\n\n const firstChar = primaryText[0].toLowerCase();\n if (!sortedIndexByFirstChar.has(firstChar)) {\n sortedIndexByFirstChar.set(firstChar, []);\n }\n sortedIndexByFirstChar.get(firstChar)!.push(\n {text: primaryText.toLowerCase(), index: i});\n }\n\n // Sort the mapping\n // TODO(b/157162694): Investigate replacing forEach with Map.values()\n sortedIndexByFirstChar.forEach((values) => {\n values.sort((first: MDCListTextAndIndex, second: MDCListTextAndIndex) => {\n return first.index - second.index;\n });\n });\n\n return sortedIndexByFirstChar;\n}\n\n/**\n * Arguments for matchItem\n */\nexport interface TypeaheadMatchItemOpts {\n focusItemAtIndex: (index: number) => void;\n nextChar: string;\n focusedItemIndex: number;\n sortedIndexByFirstChar: Map<string, MDCListTextAndIndex[]>;\n skipFocus: boolean;\n isItemAtIndexDisabled: (index: number) => boolean;\n}\n\n/**\n * Given the next desired character from the user, it attempts to find the next\n * list option matching the buffer. Wraps around if at the end of options.\n *\n * @param opts Options and accessors\n * - nextChar - the next character to match against items\n * - sortedIndexByFirstChar - output of `initSortedIndex(...)`\n * - focusedItemIndex - the index of the currently focused item\n * - focusItemAtIndex - function that focuses a list item at given index\n * - skipFocus - whether or not to focus the matched item\n * - isItemAtIndexDisabled - function that determines whether an item at a\n * given index is disabled\n * @param state The typeahead state instance. See `initState`.\n *\n * @return The index of the matched item, or -1 if no match.\n */\nexport function matchItem(\n opts: TypeaheadMatchItemOpts, state: TypeaheadState): number {\n const {\n nextChar,\n focusItemAtIndex,\n sortedIndexByFirstChar,\n focusedItemIndex,\n skipFocus,\n isItemAtIndexDisabled,\n } = opts;\n\n clearTimeout(state.bufferClearTimeout);\n\n state.bufferClearTimeout = setTimeout(() => {\n clearBuffer(state);\n }, numbers.TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS);\n\n state.typeaheadBuffer = state.typeaheadBuffer + nextChar;\n\n let index: number;\n if (state.typeaheadBuffer.length === 1) {\n index = matchFirstChar(\n sortedIndexByFirstChar, focusedItemIndex, isItemAtIndexDisabled, state);\n } else {\n index = matchAllChars(sortedIndexByFirstChar, isItemAtIndexDisabled, state);\n }\n\n if (index !== -1 && !skipFocus) {\n focusItemAtIndex(index);\n }\n return index;\n}\n\n/**\n * Matches the user's single input character in the buffer to the\n * next option that begins with such character. Wraps around if at\n * end of options. Returns -1 if no match is found.\n */\nfunction matchFirstChar(\n sortedIndexByFirstChar: Map<string, MDCListTextAndIndex[]>,\n focusedItemIndex: number, isItemAtIndexDisabled: (index: number) => boolean,\n state: TypeaheadState): number {\n const firstChar = state.typeaheadBuffer[0];\n const itemsMatchingFirstChar = sortedIndexByFirstChar.get(firstChar);\n if (!itemsMatchingFirstChar) {\n return -1;\n }\n\n // Has the same firstChar been recently matched?\n // Also, did starting index remain the same between key presses?\n // If both hold true, simply increment index.\n if (firstChar === state.currentFirstChar &&\n itemsMatchingFirstChar[state.sortedIndexCursor].index ===\n focusedItemIndex) {\n state.sortedIndexCursor =\n (state.sortedIndexCursor + 1) % itemsMatchingFirstChar.length;\n\n const newIndex = itemsMatchingFirstChar[state.sortedIndexCursor].index;\n if (!isItemAtIndexDisabled(newIndex)) {\n return newIndex;\n }\n }\n\n // If we're here, it means one of the following happened:\n // - either firstChar or startingIndex has changed, invalidating the\n // cursor.\n // - The next item of typeahead is disabled, so we have to look further.\n state.currentFirstChar = firstChar;\n\n let newCursorPosition = -1;\n let cursorPosition;\n // Find the first non-disabled item as a fallback.\n for (cursorPosition = 0; cursorPosition < itemsMatchingFirstChar.length;\n cursorPosition++) {\n if (!isItemAtIndexDisabled(itemsMatchingFirstChar[cursorPosition].index)) {\n newCursorPosition = cursorPosition;\n break;\n }\n }\n\n // Advance cursor to first item matching the firstChar that is positioned\n // after starting item. Cursor is unchanged from fallback if there's no\n // such item.\n for (; cursorPosition < itemsMatchingFirstChar.length; cursorPosition++) {\n if (itemsMatchingFirstChar[cursorPosition].index > focusedItemIndex &&\n !isItemAtIndexDisabled(itemsMatchingFirstChar[cursorPosition].index)) {\n newCursorPosition = cursorPosition;\n break;\n }\n }\n\n if (newCursorPosition !== -1) {\n state.sortedIndexCursor = newCursorPosition;\n return itemsMatchingFirstChar[state.sortedIndexCursor].index;\n }\n\n return -1;\n}\n\n/**\n * Attempts to find the next item that matches all of the typeahead buffer.\n * Wraps around if at end of options. Returns -1 if no match is found.\n */\nfunction matchAllChars(\n sortedIndexByFirstChar: Map<string, MDCListTextAndIndex[]>,\n isItemAtIndexDisabled: (index: number) => boolean,\n state: TypeaheadState): number {\n const firstChar = state.typeaheadBuffer[0];\n const itemsMatchingFirstChar = sortedIndexByFirstChar.get(firstChar);\n if (!itemsMatchingFirstChar) {\n return -1;\n }\n\n // Do nothing if text already matches\n const startingItem = itemsMatchingFirstChar[state.sortedIndexCursor];\n if (startingItem.text.lastIndexOf(state.typeaheadBuffer, 0) === 0 &&\n !isItemAtIndexDisabled(startingItem.index)) {\n return startingItem.index;\n }\n\n // Find next item that matches completely; if no match, we'll eventually\n // loop around to same position\n let cursorPosition =\n (state.sortedIndexCursor + 1) % itemsMatchingFirstChar.length;\n let nextCursorPosition = -1;\n while (cursorPosition !== state.sortedIndexCursor) {\n const currentItem = itemsMatchingFirstChar[cursorPosition];\n\n const matches =\n currentItem.text.lastIndexOf(state.typeaheadBuffer, 0) === 0;\n const isEnabled = !isItemAtIndexDisabled(currentItem.index);\n if (matches && isEnabled) {\n nextCursorPosition = cursorPosition;\n break;\n }\n\n cursorPosition = (cursorPosition + 1) % itemsMatchingFirstChar.length;\n }\n\n if (nextCursorPosition !== -1) {\n state.sortedIndexCursor = nextCursorPosition;\n return itemsMatchingFirstChar[state.sortedIndexCursor].index;\n }\n\n return -1;\n}\n\n/**\n * Whether or not the given typeahead instaance state is currently typing.\n *\n * @param state The typeahead state instance. See `initState`.\n */\nexport function isTypingInProgress(state: TypeaheadState) {\n return state.typeaheadBuffer.length > 0;\n}\n\n/**\n * Options for handleKeydown.\n */\nexport interface HandleKeydownOpts {\n event: KeyboardEvent;\n isTargetListItem: boolean;\n focusItemAtIndex: (index: number) => void;\n focusedItemIndex: number;\n sortedIndexByFirstChar: Map<string, MDCListTextAndIndex[]>;\n isItemAtIndexDisabled: (index: number) => boolean;\n}\n\n/**\n * Clears the typeahaed buffer so that it resets item matching to the first\n * character.\n *\n * @param state The typeahead state instance. See `initState`.\n */\nexport function clearBuffer(state: TypeaheadState) {\n state.typeaheadBuffer = '';\n}\n\n/**\n * Given a keydown event, it calculates whether or not to automatically focus a\n * list item depending on what was typed mimicing the typeahead functionality of\n * a standard <select> element that is open.\n *\n * @param opts Options and accessors\n * - event - the KeyboardEvent to handle and parse\n * - sortedIndexByFirstChar - output of `initSortedIndex(...)`\n * - focusedItemIndex - the index of the currently focused item\n * - focusItemAtIndex - function that focuses a list item at given index\n * - isItemAtFocusedIndexDisabled - whether or not the currently focused item\n * is disabled\n * - isTargetListItem - whether or not the event target is a list item\n * @param state The typeahead state instance. See `initState`.\n *\n * @returns index of the item matched by the keydown. -1 if not matched.\n */\nexport function handleKeydown(opts: HandleKeydownOpts, state: TypeaheadState) {\n const {\n event,\n isTargetListItem,\n focusedItemIndex,\n focusItemAtIndex,\n sortedIndexByFirstChar,\n isItemAtIndexDisabled,\n } = opts;\n\n const isArrowLeft = normalizeKey(event) === 'ArrowLeft';\n const isArrowUp = normalizeKey(event) === 'ArrowUp';\n const isArrowRight = normalizeKey(event) === 'ArrowRight';\n const isArrowDown = normalizeKey(event) === 'ArrowDown';\n const isHome = normalizeKey(event) === 'Home';\n const isEnd = normalizeKey(event) === 'End';\n const isEnter = normalizeKey(event) === 'Enter';\n const isSpace = normalizeKey(event) === 'Spacebar';\n\n if (isArrowLeft || isArrowUp || isArrowRight || isArrowDown || isHome ||\n isEnd || isEnter) {\n return -1;\n }\n\n const isCharacterKey = !isSpace && event.key.length === 1;\n\n if (isCharacterKey) {\n preventDefaultEvent(event);\n const matchItemOpts: TypeaheadMatchItemOpts = {\n focusItemAtIndex,\n focusedItemIndex,\n nextChar: event.key.toLowerCase(),\n sortedIndexByFirstChar,\n skipFocus: false,\n isItemAtIndexDisabled,\n };\n return matchItem(matchItemOpts, state);\n }\n\n if (!isSpace) {\n return -1;\n }\n\n if (isTargetListItem) {\n preventDefaultEvent(event);\n }\n\n const typeaheadOnListItem = isTargetListItem && isTypingInProgress(state);\n\n if (typeaheadOnListItem) {\n const matchItemOpts: TypeaheadMatchItemOpts = {\n focusItemAtIndex,\n focusedItemIndex,\n nextChar: ' ',\n sortedIndexByFirstChar,\n skipFocus: false,\n isItemAtIndexDisabled,\n };\n // space participates in typeahead matching if in rapid typing mode\n return matchItem(matchItemOpts, state);\n }\n\n return -1;\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {SpecificEventListener} from '@material/base/types';\nimport {MDCMenuSurfaceAdapter} from './adapter';\nimport {Corner, cssClasses, strings} from './constants';\nimport {MDCMenuSurfaceFoundation} from './foundation';\nimport {MDCMenuDistance} from './types';\nimport {getCorrectPropertyName} from '@material/animation/util';\n\ntype RegisterFunction = () => void;\n\nexport type MDCMenuSurfaceFactory = (el: Element, foundation?: MDCMenuSurfaceFoundation) => MDCMenuSurface;\n\nexport class MDCMenuSurface extends MDCComponent<MDCMenuSurfaceFoundation> {\n static attachTo(root: Element): MDCMenuSurface {\n return new MDCMenuSurface(root);\n }\n\n anchorElement!: Element | null; // assigned in initialSyncWithDOM()\n\n private previousFocus?: HTMLElement|SVGElement|null;\n\n private handleKeydown!:\n SpecificEventListener<'keydown'>; // assigned in initialSyncWithDOM()\n private handleBodyClick!:\n SpecificEventListener<'click'>; // assigned in initialSyncWithDOM()\n\n private registerBodyClickListener!:\n RegisterFunction; // assigned in initialSyncWithDOM()\n private deregisterBodyClickListener!:\n RegisterFunction; // assigned in initialSyncWithDOM()\n\n initialSyncWithDOM() {\n const parentEl = this.root.parentElement;\n this.anchorElement = parentEl && parentEl.classList.contains(cssClasses.ANCHOR) ? parentEl : null;\n\n if (this.root.classList.contains(cssClasses.FIXED)) {\n this.setFixedPosition(true);\n }\n\n this.handleKeydown = (event) => {\n this.foundation.handleKeydown(event);\n };\n this.handleBodyClick = (event) => {\n this.foundation.handleBodyClick(event);\n };\n\n // capture so that no race between handleBodyClick and quickOpen when\n // menusurface opened on button click which registers this listener\n this.registerBodyClickListener = () => {\n document.body.addEventListener(\n 'click', this.handleBodyClick, {capture: true});\n };\n this.deregisterBodyClickListener = () => {\n document.body.removeEventListener(\n 'click', this.handleBodyClick, {capture: true});\n };\n\n this.listen('keydown', this.handleKeydown);\n this.listen(strings.OPENED_EVENT, this.registerBodyClickListener);\n this.listen(strings.CLOSED_EVENT, this.deregisterBodyClickListener);\n }\n\n destroy() {\n this.unlisten('keydown', this.handleKeydown);\n this.unlisten(strings.OPENED_EVENT, this.registerBodyClickListener);\n this.unlisten(strings.CLOSED_EVENT, this.deregisterBodyClickListener);\n super.destroy();\n }\n\n isOpen(): boolean {\n return this.foundation.isOpen();\n }\n\n open() {\n this.foundation.open();\n }\n\n close(skipRestoreFocus = false) {\n this.foundation.close(skipRestoreFocus);\n }\n\n set quickOpen(quickOpen: boolean) {\n this.foundation.setQuickOpen(quickOpen);\n }\n\n /** Sets the foundation to use page offsets for an positioning when the menu is hoisted to the body. */\n setIsHoisted(isHoisted: boolean) {\n this.foundation.setIsHoisted(isHoisted);\n }\n\n /** Sets the element that the menu-surface is anchored to. */\n setMenuSurfaceAnchorElement(element: Element) {\n this.anchorElement = element;\n }\n\n /** Sets the menu-surface to position: fixed. */\n setFixedPosition(isFixed: boolean) {\n if (isFixed) {\n this.root.classList.add(cssClasses.FIXED);\n } else {\n this.root.classList.remove(cssClasses.FIXED);\n }\n\n this.foundation.setFixedPosition(isFixed);\n }\n\n /** Sets the absolute x/y position to position based on. Requires the menu to be hoisted. */\n setAbsolutePosition(x: number, y: number) {\n this.foundation.setAbsolutePosition(x, y);\n this.setIsHoisted(true);\n }\n\n /**\n * @param corner Default anchor corner alignment of top-left surface corner.\n */\n setAnchorCorner(corner: Corner) {\n this.foundation.setAnchorCorner(corner);\n }\n\n setAnchorMargin(margin: Partial<MDCMenuDistance>) {\n this.foundation.setAnchorMargin(margin);\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCMenuSurfaceAdapter = {\n addClass: (className) => this.root.classList.add(className),\n removeClass: (className) => this.root.classList.remove(className),\n hasClass: (className) => this.root.classList.contains(className),\n hasAnchor: () => !!this.anchorElement,\n notifyClose: () =>\n this.emit(MDCMenuSurfaceFoundation.strings.CLOSED_EVENT, {}),\n notifyClosing: () => {\n this.emit(MDCMenuSurfaceFoundation.strings.CLOSING_EVENT, {});\n },\n notifyOpen: () =>\n this.emit(MDCMenuSurfaceFoundation.strings.OPENED_EVENT, {}),\n isElementInContainer: (el) => this.root.contains(el),\n isRtl: () =>\n getComputedStyle(this.root).getPropertyValue('direction') === 'rtl',\n setTransformOrigin: (origin) => {\n const propertyName =\n `${getCorrectPropertyName(window, 'transform')}-origin`;\n (this.root as HTMLElement).style.setProperty(propertyName, origin);\n },\n\n isFocused: () => document.activeElement === this.root,\n saveFocus: () => {\n this.previousFocus =\n document.activeElement as HTMLElement | SVGElement | null;\n },\n restoreFocus: () => {\n if (this.root.contains(document.activeElement)) {\n if (this.previousFocus && this.previousFocus.focus) {\n this.previousFocus.focus();\n }\n }\n },\n\n getInnerDimensions: () => {\n return {\n width: (this.root as HTMLElement).offsetWidth,\n height: (this.root as HTMLElement).offsetHeight\n };\n },\n getAnchorDimensions: () => this.anchorElement ?\n this.anchorElement.getBoundingClientRect() :\n null,\n getWindowDimensions: () => {\n return {width: window.innerWidth, height: window.innerHeight};\n },\n getBodyDimensions: () => {\n return {width: document.body.clientWidth, height: document.body.clientHeight};\n },\n getWindowScroll: () => {\n return {x: window.pageXOffset, y: window.pageYOffset};\n },\n setPosition: (position) => {\n const rootHTML = this.root as HTMLElement;\n rootHTML.style.left = 'left' in position ? `${position.left}px` : '';\n rootHTML.style.right = 'right' in position ? `${position.right}px` : '';\n rootHTML.style.top = 'top' in position ? `${position.top}px` : '';\n rootHTML.style.bottom =\n 'bottom' in position ? `${position.bottom}px` : '';\n },\n setMaxHeight: (height) => {\n (this.root as HTMLElement).style.maxHeight = height;\n },\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCMenuSurfaceFoundation(adapter);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst cssClasses = {\n ANCHOR: 'mdc-menu-surface--anchor',\n ANIMATING_CLOSED: 'mdc-menu-surface--animating-closed',\n ANIMATING_OPEN: 'mdc-menu-surface--animating-open',\n FIXED: 'mdc-menu-surface--fixed',\n IS_OPEN_BELOW: 'mdc-menu-surface--is-open-below',\n OPEN: 'mdc-menu-surface--open',\n ROOT: 'mdc-menu-surface',\n};\n\n// tslint:disable:object-literal-sort-keys\nconst strings = {\n CLOSED_EVENT: 'MDCMenuSurface:closed',\n CLOSING_EVENT: 'MDCMenuSurface:closing',\n OPENED_EVENT: 'MDCMenuSurface:opened',\n FOCUSABLE_ELEMENTS: [\n 'button:not(:disabled)',\n '[href]:not([aria-disabled=\"true\"])',\n 'input:not(:disabled)',\n 'select:not(:disabled)',\n 'textarea:not(:disabled)',\n '[tabindex]:not([tabindex=\"-1\"]):not([aria-disabled=\"true\"])',\n ].join(', '),\n};\n// tslint:enable:object-literal-sort-keys\n\nconst numbers = {\n /** Total duration of menu-surface open animation. */\n TRANSITION_OPEN_DURATION: 120,\n\n /** Total duration of menu-surface close animation. */\n TRANSITION_CLOSE_DURATION: 75,\n\n /** Margin left to the edge of the viewport when menu-surface is at maximum possible height. Also used as a viewport margin. */\n MARGIN_TO_EDGE: 32,\n\n /** Ratio of anchor width to menu-surface width for switching from corner positioning to center positioning. */\n ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO: 0.67,\n};\n\n/**\n * Enum for bits in the {@see Corner) bitmap.\n */\nenum CornerBit {\n BOTTOM = 1,\n CENTER = 2,\n RIGHT = 4,\n FLIP_RTL = 8,\n}\n\n/**\n * Enum for representing an element corner for positioning the menu-surface.\n *\n * The START constants map to LEFT if element directionality is left\n * to right and RIGHT if the directionality is right to left.\n * Likewise END maps to RIGHT or LEFT depending on the directionality.\n */\nenum Corner {\n TOP_LEFT = 0,\n TOP_RIGHT = CornerBit.RIGHT,\n BOTTOM_LEFT = CornerBit.BOTTOM,\n BOTTOM_RIGHT = CornerBit.BOTTOM | CornerBit.RIGHT, // tslint:disable-line:no-bitwise\n TOP_START = CornerBit.FLIP_RTL,\n TOP_END = CornerBit.FLIP_RTL | CornerBit.RIGHT, // tslint:disable-line:no-bitwise\n BOTTOM_START = CornerBit.BOTTOM | CornerBit.FLIP_RTL, // tslint:disable-line:no-bitwise\n BOTTOM_END = CornerBit.BOTTOM | CornerBit.RIGHT | CornerBit.FLIP_RTL, // tslint:disable-line:no-bitwise\n}\n\nexport {cssClasses, strings, numbers, CornerBit, Corner};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCMenuSurfaceAdapter} from './adapter';\nimport {Corner, CornerBit, cssClasses, numbers, strings} from './constants';\nimport {MDCMenuDimensions, MDCMenuDistance, MDCMenuPoint} from './types';\n\ninterface AutoLayoutMeasurements {\n anchorSize: MDCMenuDimensions;\n bodySize: MDCMenuDimensions;\n surfaceSize: MDCMenuDimensions;\n viewportDistance: MDCMenuDistance;\n viewportSize: MDCMenuDimensions;\n windowScroll: MDCMenuPoint;\n}\n\nexport class MDCMenuSurfaceFoundation extends MDCFoundation<MDCMenuSurfaceAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get numbers() {\n return numbers;\n }\n\n static get Corner() {\n return Corner;\n }\n\n /**\n * @see {@link MDCMenuSurfaceAdapter} for typing information on parameters and return types.\n */\n static get defaultAdapter(): MDCMenuSurfaceAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: () => undefined,\n removeClass: () => undefined,\n hasClass: () => false,\n hasAnchor: () => false,\n\n isElementInContainer: () => false,\n isFocused: () => false,\n isRtl: () => false,\n\n getInnerDimensions: () => ({height: 0, width: 0}),\n getAnchorDimensions: () => null,\n getWindowDimensions: () => ({height: 0, width: 0}),\n getBodyDimensions: () => ({height: 0, width: 0}),\n getWindowScroll: () => ({x: 0, y: 0}),\n setPosition: () => undefined,\n setMaxHeight: () => undefined,\n setTransformOrigin: () => undefined,\n\n saveFocus: () => undefined,\n restoreFocus: () => undefined,\n\n notifyClose: () => undefined,\n notifyOpen: () => undefined,\n notifyClosing: () => undefined,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private isSurfaceOpen = false;\n private isQuickOpen = false;\n private isHoistedElement = false;\n private isFixedPosition = false;\n\n private openAnimationEndTimerId = 0;\n private closeAnimationEndTimerId = 0;\n private animationRequestId = 0;\n\n private anchorCorner: Corner = Corner.TOP_START;\n\n /**\n * Corner of the menu surface to which menu surface is attached to anchor.\n *\n * Anchor corner --->+----------+\n * | ANCHOR |\n * +----------+\n * Origin corner --->+--------------+\n * | |\n * | |\n * | MENU SURFACE |\n * | |\n * | |\n * +--------------+\n */\n private originCorner: Corner = Corner.TOP_START;\n private readonly anchorMargin:\n MDCMenuDistance = {top: 0, right: 0, bottom: 0, left: 0};\n private readonly position: MDCMenuPoint = {x: 0, y: 0};\n\n private dimensions!: MDCMenuDimensions; // assigned in open()\n private measurements!: AutoLayoutMeasurements; // assigned in open()\n\n constructor(adapter?: Partial<MDCMenuSurfaceAdapter>) {\n super({...MDCMenuSurfaceFoundation.defaultAdapter, ...adapter});\n }\n\n init() {\n const {ROOT, OPEN} = MDCMenuSurfaceFoundation.cssClasses;\n\n if (!this.adapter.hasClass(ROOT)) {\n throw new Error(`${ROOT} class required in root element.`);\n }\n\n if (this.adapter.hasClass(OPEN)) {\n this.isSurfaceOpen = true;\n }\n }\n\n destroy() {\n clearTimeout(this.openAnimationEndTimerId);\n clearTimeout(this.closeAnimationEndTimerId);\n // Cancel any currently running animations.\n cancelAnimationFrame(this.animationRequestId);\n }\n\n /**\n * @param corner Default anchor corner alignment of top-left menu surface corner.\n */\n setAnchorCorner(corner: Corner) {\n this.anchorCorner = corner;\n }\n\n /**\n * Flip menu corner horizontally.\n */\n flipCornerHorizontally() {\n this.originCorner = this.originCorner ^ CornerBit.RIGHT;\n }\n\n /**\n * @param margin Set of margin values from anchor.\n */\n setAnchorMargin(margin: Partial<MDCMenuDistance>) {\n this.anchorMargin.top = margin.top || 0;\n this.anchorMargin.right = margin.right || 0;\n this.anchorMargin.bottom = margin.bottom || 0;\n this.anchorMargin.left = margin.left || 0;\n }\n\n /** Used to indicate if the menu-surface is hoisted to the body. */\n setIsHoisted(isHoisted: boolean) {\n this.isHoistedElement = isHoisted;\n }\n\n /** Used to set the menu-surface calculations based on a fixed position menu. */\n setFixedPosition(isFixedPosition: boolean) {\n this.isFixedPosition = isFixedPosition;\n }\n\n /** Sets the menu-surface position on the page. */\n setAbsolutePosition(x: number, y: number) {\n this.position.x = this.isFinite(x) ? x : 0;\n this.position.y = this.isFinite(y) ? y : 0;\n }\n\n setQuickOpen(quickOpen: boolean) {\n this.isQuickOpen = quickOpen;\n }\n\n isOpen() {\n return this.isSurfaceOpen;\n }\n\n /**\n * Open the menu surface.\n */\n open() {\n if (this.isSurfaceOpen) {\n return;\n }\n\n this.adapter.saveFocus();\n\n if (this.isQuickOpen) {\n this.isSurfaceOpen = true;\n this.adapter.addClass(MDCMenuSurfaceFoundation.cssClasses.OPEN);\n this.dimensions = this.adapter.getInnerDimensions();\n this.autoposition();\n this.adapter.notifyOpen();\n } else {\n this.adapter.addClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_OPEN);\n this.animationRequestId = requestAnimationFrame(() => {\n this.adapter.addClass(MDCMenuSurfaceFoundation.cssClasses.OPEN);\n this.dimensions = this.adapter.getInnerDimensions();\n this.autoposition();\n this.openAnimationEndTimerId = setTimeout(() => {\n this.openAnimationEndTimerId = 0;\n this.adapter.removeClass(\n MDCMenuSurfaceFoundation.cssClasses.ANIMATING_OPEN);\n this.adapter.notifyOpen();\n }, numbers.TRANSITION_OPEN_DURATION);\n });\n\n this.isSurfaceOpen = true;\n }\n }\n\n /**\n * Closes the menu surface.\n */\n close(skipRestoreFocus = false) {\n if (!this.isSurfaceOpen) {\n return;\n }\n\n this.adapter.notifyClosing();\n\n if (this.isQuickOpen) {\n this.isSurfaceOpen = false;\n if (!skipRestoreFocus) {\n this.maybeRestoreFocus();\n }\n\n this.adapter.removeClass(MDCMenuSurfaceFoundation.cssClasses.OPEN);\n this.adapter.removeClass(\n MDCMenuSurfaceFoundation.cssClasses.IS_OPEN_BELOW);\n this.adapter.notifyClose();\n\n return;\n }\n\n this.adapter.addClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_CLOSED);\n requestAnimationFrame(() => {\n this.adapter.removeClass(MDCMenuSurfaceFoundation.cssClasses.OPEN);\n this.adapter.removeClass(\n MDCMenuSurfaceFoundation.cssClasses.IS_OPEN_BELOW);\n this.closeAnimationEndTimerId = setTimeout(() => {\n this.closeAnimationEndTimerId = 0;\n this.adapter.removeClass(\n MDCMenuSurfaceFoundation.cssClasses.ANIMATING_CLOSED);\n this.adapter.notifyClose();\n }, numbers.TRANSITION_CLOSE_DURATION);\n });\n\n this.isSurfaceOpen = false;\n if (!skipRestoreFocus) {\n this.maybeRestoreFocus();\n }\n }\n\n /** Handle clicks and close if not within menu-surface element. */\n handleBodyClick(evt: MouseEvent) {\n const el = evt.target as Element;\n if (this.adapter.isElementInContainer(el)) {\n return;\n }\n this.close();\n }\n\n /** Handle keys that close the surface. */\n handleKeydown(evt: KeyboardEvent) {\n const {keyCode, key} = evt;\n\n const isEscape = key === 'Escape' || keyCode === 27;\n if (isEscape) {\n this.close();\n }\n }\n\n private autoposition() {\n // Compute measurements for autoposition methods reuse.\n this.measurements = this.getAutoLayoutmeasurements();\n\n const corner = this.getoriginCorner();\n const maxMenuSurfaceHeight = this.getMenuSurfaceMaxHeight(corner);\n const verticalAlignment =\n this.hasBit(corner, CornerBit.BOTTOM) ? 'bottom' : 'top';\n let horizontalAlignment =\n this.hasBit(corner, CornerBit.RIGHT) ? 'right' : 'left';\n const horizontalOffset = this.getHorizontalOriginOffset(corner);\n const verticalOffset = this.getVerticalOriginOffset(corner);\n const {anchorSize, surfaceSize} = this.measurements;\n\n const position: Partial<MDCMenuDistance> = {\n [horizontalAlignment]: horizontalOffset,\n [verticalAlignment]: verticalOffset,\n };\n\n // Center align when anchor width is comparable or greater than menu surface, otherwise keep corner.\n if (anchorSize.width / surfaceSize.width > numbers.ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO) {\n horizontalAlignment = 'center';\n }\n\n // If the menu-surface has been hoisted to the body, it's no longer relative to the anchor element\n if (this.isHoistedElement || this.isFixedPosition) {\n this.adjustPositionForHoistedElement(position);\n }\n\n this.adapter.setTransformOrigin(\n `${horizontalAlignment} ${verticalAlignment}`);\n this.adapter.setPosition(position);\n this.adapter.setMaxHeight(\n maxMenuSurfaceHeight ? maxMenuSurfaceHeight + 'px' : '');\n\n // If it is opened from the top then add is-open-below class\n if (!this.hasBit(corner, CornerBit.BOTTOM)) {\n this.adapter.addClass(MDCMenuSurfaceFoundation.cssClasses.IS_OPEN_BELOW);\n }\n }\n\n /**\n * @return Measurements used to position menu surface popup.\n */\n private getAutoLayoutmeasurements(): AutoLayoutMeasurements {\n let anchorRect = this.adapter.getAnchorDimensions();\n const bodySize = this.adapter.getBodyDimensions();\n const viewportSize = this.adapter.getWindowDimensions();\n const windowScroll = this.adapter.getWindowScroll();\n\n if (!anchorRect) {\n // tslint:disable:object-literal-sort-keys Positional properties are more readable when they're grouped together\n anchorRect = {\n top: this.position.y,\n right: this.position.x,\n bottom: this.position.y,\n left: this.position.x,\n width: 0,\n height: 0,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n return {\n anchorSize: anchorRect,\n bodySize,\n surfaceSize: this.dimensions,\n viewportDistance: {\n // tslint:disable:object-literal-sort-keys Positional properties are more readable when they're grouped together\n top: anchorRect.top,\n right: viewportSize.width - anchorRect.right,\n bottom: viewportSize.height - anchorRect.bottom,\n left: anchorRect.left,\n // tslint:enable:object-literal-sort-keys\n },\n viewportSize,\n windowScroll,\n };\n }\n\n /**\n * Computes the corner of the anchor from which to animate and position the\n * menu surface.\n *\n * Only LEFT or RIGHT bit is used to position the menu surface ignoring RTL\n * context. E.g., menu surface will be positioned from right side on TOP_END.\n */\n private getoriginCorner(): Corner {\n let corner = this.originCorner;\n\n const {viewportDistance, anchorSize, surfaceSize} = this.measurements;\n const {MARGIN_TO_EDGE} = MDCMenuSurfaceFoundation.numbers;\n\n const isAnchoredToBottom = this.hasBit(this.anchorCorner, CornerBit.BOTTOM);\n\n let availableTop;\n let availableBottom;\n if (isAnchoredToBottom) {\n availableTop =\n viewportDistance.top - MARGIN_TO_EDGE + this.anchorMargin.bottom;\n availableBottom =\n viewportDistance.bottom - MARGIN_TO_EDGE - this.anchorMargin.bottom;\n } else {\n availableTop =\n viewportDistance.top - MARGIN_TO_EDGE + this.anchorMargin.top;\n availableBottom = viewportDistance.bottom - MARGIN_TO_EDGE +\n anchorSize.height - this.anchorMargin.top;\n }\n\n const isAvailableBottom = availableBottom - surfaceSize.height > 0;\n if (!isAvailableBottom && availableTop > availableBottom) {\n // Attach bottom side of surface to the anchor.\n corner = this.setBit(corner, CornerBit.BOTTOM);\n }\n\n const isRtl = this.adapter.isRtl();\n const isFlipRtl = this.hasBit(this.anchorCorner, CornerBit.FLIP_RTL);\n const hasRightBit = this.hasBit(this.anchorCorner, CornerBit.RIGHT) ||\n this.hasBit(corner, CornerBit.RIGHT);\n\n // Whether surface attached to right side of anchor element.\n let isAnchoredToRight = false;\n\n // Anchored to start\n if (isRtl && isFlipRtl) {\n isAnchoredToRight = !hasRightBit;\n } else {\n // Anchored to right\n isAnchoredToRight = hasRightBit;\n }\n\n let availableLeft;\n let availableRight;\n if (isAnchoredToRight) {\n availableLeft =\n viewportDistance.left + anchorSize.width + this.anchorMargin.right;\n availableRight = viewportDistance.right - this.anchorMargin.right;\n } else {\n availableLeft = viewportDistance.left + this.anchorMargin.left;\n availableRight =\n viewportDistance.right + anchorSize.width - this.anchorMargin.left;\n }\n\n const isAvailableLeft = availableLeft - surfaceSize.width > 0;\n const isAvailableRight = availableRight - surfaceSize.width > 0;\n const isOriginCornerAlignedToEnd =\n this.hasBit(corner, CornerBit.FLIP_RTL) &&\n this.hasBit(corner, CornerBit.RIGHT);\n\n if (isAvailableRight && isOriginCornerAlignedToEnd && isRtl ||\n !isAvailableLeft && isOriginCornerAlignedToEnd) {\n // Attach left side of surface to the anchor.\n corner = this.unsetBit(corner, CornerBit.RIGHT);\n } else if (\n isAvailableLeft && isAnchoredToRight && isRtl ||\n (isAvailableLeft && !isAnchoredToRight && hasRightBit) ||\n (!isAvailableRight && availableLeft >= availableRight)) {\n // Attach right side of surface to the anchor.\n corner = this.setBit(corner, CornerBit.RIGHT);\n }\n\n return corner;\n }\n\n /**\n * @param corner Origin corner of the menu surface.\n * @return Maximum height of the menu surface, based on available space. 0 indicates should not be set.\n */\n private getMenuSurfaceMaxHeight(corner: Corner): number {\n const {viewportDistance} = this.measurements;\n\n let maxHeight = 0;\n const isBottomAligned = this.hasBit(corner, CornerBit.BOTTOM);\n const isBottomAnchored = this.hasBit(this.anchorCorner, CornerBit.BOTTOM);\n const {MARGIN_TO_EDGE} = MDCMenuSurfaceFoundation.numbers;\n\n // When maximum height is not specified, it is handled from CSS.\n if (isBottomAligned) {\n maxHeight = viewportDistance.top + this.anchorMargin.top - MARGIN_TO_EDGE;\n if (!isBottomAnchored) {\n maxHeight += this.measurements.anchorSize.height;\n }\n } else {\n maxHeight = viewportDistance.bottom - this.anchorMargin.bottom +\n this.measurements.anchorSize.height - MARGIN_TO_EDGE;\n if (isBottomAnchored) {\n maxHeight -= this.measurements.anchorSize.height;\n }\n }\n\n return maxHeight;\n }\n\n /**\n * @param corner Origin corner of the menu surface.\n * @return Horizontal offset of menu surface origin corner from corresponding anchor corner.\n */\n private getHorizontalOriginOffset(corner: Corner): number {\n const {anchorSize} = this.measurements;\n\n // isRightAligned corresponds to using the 'right' property on the surface.\n const isRightAligned = this.hasBit(corner, CornerBit.RIGHT);\n const avoidHorizontalOverlap =\n this.hasBit(this.anchorCorner, CornerBit.RIGHT);\n\n if (isRightAligned) {\n const rightOffset = avoidHorizontalOverlap ?\n anchorSize.width - this.anchorMargin.left :\n this.anchorMargin.right;\n\n // For hoisted or fixed elements, adjust the offset by the difference\n // between viewport width and body width so when we calculate the right\n // value (`adjustPositionForHoistedElement`) based on the element\n // position, the right property is correct.\n if (this.isHoistedElement || this.isFixedPosition) {\n return rightOffset -\n (this.measurements.viewportSize.width -\n this.measurements.bodySize.width);\n }\n\n return rightOffset;\n }\n\n return avoidHorizontalOverlap ? anchorSize.width - this.anchorMargin.right :\n this.anchorMargin.left;\n }\n\n /**\n * @param corner Origin corner of the menu surface.\n * @return Vertical offset of menu surface origin corner from corresponding anchor corner.\n */\n private getVerticalOriginOffset(corner: Corner): number {\n const {anchorSize} = this.measurements;\n const isBottomAligned = this.hasBit(corner, CornerBit.BOTTOM);\n const avoidVerticalOverlap =\n this.hasBit(this.anchorCorner, CornerBit.BOTTOM);\n\n let y = 0;\n if (isBottomAligned) {\n y = avoidVerticalOverlap ? anchorSize.height - this.anchorMargin.top :\n -this.anchorMargin.bottom;\n } else {\n y = avoidVerticalOverlap ?\n (anchorSize.height + this.anchorMargin.bottom) :\n this.anchorMargin.top;\n }\n return y;\n }\n\n /** Calculates the offsets for positioning the menu-surface when the menu-surface has been hoisted to the body. */\n private adjustPositionForHoistedElement(position: Partial<MDCMenuDistance>) {\n const {windowScroll, viewportDistance} = this.measurements;\n\n const props = Object.keys(position) as Array<keyof Partial<MDCMenuDistance>>;\n\n for (const prop of props) {\n let value = position[prop] || 0;\n\n // Hoisted surfaces need to have the anchor elements location on the page added to the\n // position properties for proper alignment on the body.\n value += viewportDistance[prop];\n\n // Surfaces that are absolutely positioned need to have additional calculations for scroll\n // and bottom positioning.\n if (!this.isFixedPosition) {\n if (prop === 'top') {\n value += windowScroll.y;\n } else if (prop === 'bottom') {\n value -= windowScroll.y;\n } else if (prop === 'left') {\n value += windowScroll.x;\n } else { // prop === 'right'\n value -= windowScroll.x;\n }\n }\n\n position[prop] = value;\n }\n }\n\n /**\n * The last focused element when the menu surface was opened should regain focus, if the user is\n * focused on or within the menu surface when it is closed.\n */\n private maybeRestoreFocus() {\n const isRootFocused = this.adapter.isFocused();\n const childHasFocus = document.activeElement &&\n this.adapter.isElementInContainer(document.activeElement);\n if (isRootFocused || childHasFocus) {\n this.adapter.restoreFocus();\n }\n }\n\n private hasBit(corner: Corner, bit: CornerBit): boolean {\n return Boolean(corner & bit); // tslint:disable-line:no-bitwise\n }\n\n private setBit(corner: Corner, bit: CornerBit): Corner {\n return corner | bit; // tslint:disable-line:no-bitwise\n }\n\n private unsetBit(corner: Corner, bit: CornerBit): Corner {\n return corner ^ bit;\n }\n\n /**\n * isFinite that doesn't force conversion to number type.\n * Equivalent to Number.isFinite in ES2015, which is not supported in IE.\n */\n private isFinite(num: number): boolean {\n return typeof num === 'number' && isFinite(num);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCMenuSurfaceFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './types';\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n// TODO(b/152410470): Remove trailing underscores from private properties\n// tslint:disable:strip-private-property-underscore\n\nimport {MDCComponent} from '@material/base/component';\nimport {CustomEventListener, SpecificEventListener} from '@material/base/types';\nimport {closest} from '@material/dom/ponyfill';\nimport {MDCList, MDCListFactory} from '@material/list/component';\nimport {numbers as listConstants} from '@material/list/constants';\nimport {MDCListFoundation} from '@material/list/foundation';\nimport {MDCListActionEvent, MDCListIndex} from '@material/list/types';\nimport {MDCMenuSurface, MDCMenuSurfaceFactory} from '@material/menu-surface/component';\nimport {Corner} from '@material/menu-surface/constants';\nimport {MDCMenuSurfaceFoundation} from '@material/menu-surface/foundation';\nimport {MDCMenuDistance} from '@material/menu-surface/types';\nimport {MDCMenuAdapter} from './adapter';\nimport {cssClasses, DefaultFocusState, strings} from './constants';\nimport {MDCMenuFoundation} from './foundation';\nimport {MDCMenuItemComponentEventDetail} from './types';\n\nexport type MDCMenuFactory = (el: Element, foundation?: MDCMenuFoundation) => MDCMenu;\n\nexport class MDCMenu extends MDCComponent<MDCMenuFoundation> {\n static attachTo(root: Element) {\n return new MDCMenu(root);\n }\n\n private menuSurfaceFactory_!: MDCMenuSurfaceFactory; // assigned in initialize()\n private listFactory_!: MDCListFactory; // assigned in initialize()\n\n private menuSurface_!: MDCMenuSurface; // assigned in initialSyncWithDOM()\n private list_!: MDCList | null; // assigned in initialSyncWithDOM()\n\n private handleKeydown_!: SpecificEventListener<'keydown'>; // assigned in initialSyncWithDOM()\n private handleItemAction_!: CustomEventListener<MDCListActionEvent>; // assigned in initialSyncWithDOM()\n private handleMenuSurfaceOpened_!: EventListener; // assigned in initialSyncWithDOM()\n\n initialize(\n menuSurfaceFactory: MDCMenuSurfaceFactory = (el) => new MDCMenuSurface(el),\n listFactory: MDCListFactory = (el) => new MDCList(el)) {\n this.menuSurfaceFactory_ = menuSurfaceFactory;\n this.listFactory_ = listFactory;\n }\n\n initialSyncWithDOM() {\n this.menuSurface_ = this.menuSurfaceFactory_(this.root);\n\n const list = this.root.querySelector(strings.LIST_SELECTOR);\n if (list) {\n this.list_ = this.listFactory_(list);\n this.list_.wrapFocus = true;\n } else {\n this.list_ = null;\n }\n\n this.handleKeydown_ = (evt) => this.foundation.handleKeydown(evt);\n this.handleItemAction_ = (evt) =>\n this.foundation.handleItemAction(this.items[evt.detail.index]);\n this.handleMenuSurfaceOpened_ = () =>\n this.foundation.handleMenuSurfaceOpened();\n\n this.menuSurface_.listen(MDCMenuSurfaceFoundation.strings.OPENED_EVENT, this.handleMenuSurfaceOpened_);\n this.listen('keydown', this.handleKeydown_);\n this.listen(MDCListFoundation.strings.ACTION_EVENT, this.handleItemAction_);\n }\n\n destroy() {\n if (this.list_) {\n this.list_.destroy();\n }\n\n this.menuSurface_.destroy();\n this.menuSurface_.unlisten(MDCMenuSurfaceFoundation.strings.OPENED_EVENT, this.handleMenuSurfaceOpened_);\n this.unlisten('keydown', this.handleKeydown_);\n this.unlisten(MDCListFoundation.strings.ACTION_EVENT, this.handleItemAction_);\n super.destroy();\n }\n\n get open(): boolean {\n return this.menuSurface_.isOpen();\n }\n\n set open(value: boolean) {\n if (value) {\n this.menuSurface_.open();\n } else {\n this.menuSurface_.close();\n }\n }\n\n get wrapFocus(): boolean {\n return this.list_ ? this.list_.wrapFocus : false;\n }\n\n set wrapFocus(value: boolean) {\n if (this.list_) {\n this.list_.wrapFocus = value;\n }\n }\n\n /**\n * Sets whether the menu has typeahead functionality.\n * @param value Whether typeahead is enabled.\n */\n set hasTypeahead(value: boolean) {\n if (this.list_) {\n this.list_.hasTypeahead = value;\n }\n }\n\n /**\n * @return Whether typeahead logic is currently matching some user prefix.\n */\n get typeaheadInProgress() {\n return this.list_ ? this.list_.typeaheadInProgress : false;\n }\n\n /**\n * Given the next desired character from the user, adds it to the typeahead\n * buffer. Then, attempts to find the next option matching the buffer. Wraps\n * around if at the end of options.\n *\n * @param nextChar The next character to add to the prefix buffer.\n * @param startingIndex The index from which to start matching. Only relevant\n * when starting a new match sequence. To start a new match sequence,\n * clear the buffer using `clearTypeaheadBuffer`, or wait for the buffer\n * to clear after a set interval defined in list foundation. Defaults to\n * the currently focused index.\n * @return The index of the matched item, or -1 if no match.\n */\n typeaheadMatchItem(nextChar: string, startingIndex?: number): number {\n if (this.list_) {\n return this.list_.typeaheadMatchItem(nextChar, startingIndex);\n }\n return -1;\n }\n\n /**\n * Layout the underlying list element in the case of any dynamic updates\n * to its structure.\n */\n layout() {\n if (this.list_) {\n this.list_.layout();\n }\n }\n\n /**\n * Return the items within the menu. Note that this only contains the set of elements within\n * the items container that are proper list items, and not supplemental / presentational DOM\n * elements.\n */\n get items(): Element[] {\n return this.list_ ? this.list_.listElements : [];\n }\n\n /**\n * Turns on/off the underlying list's single selection mode. Used mainly\n * by select menu.\n *\n * @param singleSelection Whether to enable single selection mode.\n */\n set singleSelection(singleSelection: boolean) {\n if (this.list_) {\n this.list_.singleSelection = singleSelection;\n }\n }\n\n /**\n * Retrieves the selected index. Only applicable to select menus.\n * @return The selected index, which is a number for single selection and\n * radio lists, and an array of numbers for checkbox lists.\n */\n get selectedIndex(): MDCListIndex {\n return this.list_ ? this.list_.selectedIndex : listConstants.UNSET_INDEX;\n }\n\n /**\n * Sets the selected index of the list. Only applicable to select menus.\n * @param index The selected index, which is a number for single selection and\n * radio lists, and an array of numbers for checkbox lists.\n */\n set selectedIndex(index: MDCListIndex) {\n if (this.list_) {\n this.list_.selectedIndex = index;\n }\n }\n\n set quickOpen(quickOpen: boolean) {\n this.menuSurface_.quickOpen = quickOpen;\n }\n\n /**\n * Sets default focus state where the menu should focus every time when menu\n * is opened. Focuses the list root (`DefaultFocusState.LIST_ROOT`) element by\n * default.\n * @param focusState Default focus state.\n */\n setDefaultFocusState(focusState: DefaultFocusState) {\n this.foundation.setDefaultFocusState(focusState);\n }\n\n /**\n * @param corner Default anchor corner alignment of top-left menu corner.\n */\n setAnchorCorner(corner: Corner) {\n this.menuSurface_.setAnchorCorner(corner);\n }\n\n setAnchorMargin(margin: Partial<MDCMenuDistance>) {\n this.menuSurface_.setAnchorMargin(margin);\n }\n\n /**\n * Sets the list item as the selected row at the specified index.\n * @param index Index of list item within menu.\n */\n setSelectedIndex(index: number) {\n this.foundation.setSelectedIndex(index);\n }\n\n /**\n * Sets the enabled state to isEnabled for the menu item at the given index.\n * @param index Index of the menu item\n * @param isEnabled The desired enabled state of the menu item.\n */\n setEnabled(index: number, isEnabled: boolean): void {\n this.foundation.setEnabled(index, isEnabled);\n }\n\n /**\n * @return The item within the menu at the index specified.\n */\n getOptionByIndex(index: number): Element | null {\n const items = this.items;\n\n if (index < items.length) {\n return this.items[index];\n } else {\n return null;\n }\n }\n\n /**\n * @param index A menu item's index.\n * @return The primary text within the menu at the index specified.\n */\n getPrimaryTextAtIndex(index: number): string {\n const item = this.getOptionByIndex(index);\n if (item && this.list_) {\n return this.list_.getPrimaryText(item) || '';\n }\n return '';\n }\n\n setFixedPosition(isFixed: boolean) {\n this.menuSurface_.setFixedPosition(isFixed);\n }\n\n setIsHoisted(isHoisted: boolean) {\n this.menuSurface_.setIsHoisted(isHoisted);\n }\n\n setAbsolutePosition(x: number, y: number) {\n this.menuSurface_.setAbsolutePosition(x, y);\n }\n\n /**\n * Sets the element that the menu-surface is anchored to.\n */\n setAnchorElement(element: Element) {\n this.menuSurface_.anchorElement = element;\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCMenuAdapter = {\n addClassToElementAtIndex: (index, className) => {\n const list = this.items;\n list[index].classList.add(className);\n },\n removeClassFromElementAtIndex: (index, className) => {\n const list = this.items;\n list[index].classList.remove(className);\n },\n addAttributeToElementAtIndex: (index, attr, value) => {\n const list = this.items;\n list[index].setAttribute(attr, value);\n },\n removeAttributeFromElementAtIndex: (index, attr) => {\n const list = this.items;\n list[index].removeAttribute(attr);\n },\n elementContainsClass: (element, className) =>\n element.classList.contains(className),\n closeSurface: (skipRestoreFocus: boolean) =>\n this.menuSurface_.close(skipRestoreFocus),\n getElementIndex: (element) => this.items.indexOf(element),\n notifySelected: (evtData) =>\n this.emit<MDCMenuItemComponentEventDetail>(strings.SELECTED_EVENT, {\n index: evtData.index,\n item: this.items[evtData.index],\n }),\n getMenuItemCount: () => this.items.length,\n focusItemAtIndex: (index) => (this.items[index] as HTMLElement).focus(),\n focusListRoot: () =>\n (this.root.querySelector(strings.LIST_SELECTOR) as HTMLElement)\n .focus(),\n isSelectableItemAtIndex: (index) =>\n !!closest(this.items[index], `.${cssClasses.MENU_SELECTION_GROUP}`),\n getSelectedSiblingOfItemAtIndex: (index) => {\n const selectionGroupEl = closest(this.items[index], `.${cssClasses.MENU_SELECTION_GROUP}`) as HTMLElement;\n const selectedItemEl = selectionGroupEl.querySelector(`.${cssClasses.MENU_SELECTED_LIST_ITEM}`);\n return selectedItemEl ? this.items.indexOf(selectedItemEl) : -1;\n },\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCMenuFoundation(adapter);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst cssClasses = {\n MENU_SELECTED_LIST_ITEM: 'mdc-menu-item--selected',\n MENU_SELECTION_GROUP: 'mdc-menu__selection-group',\n ROOT: 'mdc-menu',\n};\n\nconst strings = {\n ARIA_CHECKED_ATTR: 'aria-checked',\n ARIA_DISABLED_ATTR: 'aria-disabled',\n CHECKBOX_SELECTOR: 'input[type=\"checkbox\"]',\n LIST_SELECTOR: '.mdc-list',\n SELECTED_EVENT: 'MDCMenu:selected',\n};\n\nconst numbers = {\n FOCUS_ROOT_INDEX: -1,\n};\n\nenum DefaultFocusState {\n NONE = 0,\n LIST_ROOT = 1,\n FIRST_ITEM = 2,\n LAST_ITEM = 3,\n}\n\nexport {cssClasses, strings, numbers, DefaultFocusState};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {cssClasses as listCssClasses} from '@material/list/constants';\nimport {MDCMenuSurfaceFoundation} from '@material/menu-surface/foundation';\nimport {MDCMenuAdapter} from './adapter';\nimport {cssClasses, DefaultFocusState, numbers, strings} from './constants';\n\nexport class MDCMenuFoundation extends MDCFoundation<MDCMenuAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get numbers() {\n return numbers;\n }\n\n private closeAnimationEndTimerId_ = 0;\n private defaultFocusState_ = DefaultFocusState.LIST_ROOT;\n\n /**\n * @see {@link MDCMenuAdapter} for typing information on parameters and return types.\n */\n static get defaultAdapter(): MDCMenuAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClassToElementAtIndex: () => undefined,\n removeClassFromElementAtIndex: () => undefined,\n addAttributeToElementAtIndex: () => undefined,\n removeAttributeFromElementAtIndex: () => undefined,\n elementContainsClass: () => false,\n closeSurface: () => undefined,\n getElementIndex: () => -1,\n notifySelected: () => undefined,\n getMenuItemCount: () => 0,\n focusItemAtIndex: () => undefined,\n focusListRoot: () => undefined,\n getSelectedSiblingOfItemAtIndex: () => -1,\n isSelectableItemAtIndex: () => false,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n constructor(adapter?: Partial<MDCMenuAdapter>) {\n super({...MDCMenuFoundation.defaultAdapter, ...adapter});\n }\n\n destroy() {\n if (this.closeAnimationEndTimerId_) {\n clearTimeout(this.closeAnimationEndTimerId_);\n }\n\n this.adapter.closeSurface();\n }\n\n handleKeydown(evt: KeyboardEvent) {\n const {key, keyCode} = evt;\n const isTab = key === 'Tab' || keyCode === 9;\n\n if (isTab) {\n this.adapter.closeSurface(/** skipRestoreFocus */ true);\n }\n }\n\n handleItemAction(listItem: Element) {\n const index = this.adapter.getElementIndex(listItem);\n if (index < 0) {\n return;\n }\n\n this.adapter.notifySelected({index});\n this.adapter.closeSurface();\n\n // Wait for the menu to close before adding/removing classes that affect styles.\n this.closeAnimationEndTimerId_ = setTimeout(() => {\n // Recompute the index in case the menu contents have changed.\n const recomputedIndex = this.adapter.getElementIndex(listItem);\n if (recomputedIndex >= 0 &&\n this.adapter.isSelectableItemAtIndex(recomputedIndex)) {\n this.setSelectedIndex(recomputedIndex);\n }\n }, MDCMenuSurfaceFoundation.numbers.TRANSITION_CLOSE_DURATION);\n }\n\n handleMenuSurfaceOpened() {\n switch (this.defaultFocusState_) {\n case DefaultFocusState.FIRST_ITEM:\n this.adapter.focusItemAtIndex(0);\n break;\n case DefaultFocusState.LAST_ITEM:\n this.adapter.focusItemAtIndex(this.adapter.getMenuItemCount() - 1);\n break;\n case DefaultFocusState.NONE:\n // Do nothing.\n break;\n default:\n this.adapter.focusListRoot();\n break;\n }\n }\n\n /**\n * Sets default focus state where the menu should focus every time when menu\n * is opened. Focuses the list root (`DefaultFocusState.LIST_ROOT`) element by\n * default.\n */\n setDefaultFocusState(focusState: DefaultFocusState) {\n this.defaultFocusState_ = focusState;\n }\n\n /**\n * Selects the list item at `index` within the menu.\n * @param index Index of list item within the menu.\n */\n setSelectedIndex(index: number) {\n this.validatedIndex_(index);\n\n if (!this.adapter.isSelectableItemAtIndex(index)) {\n throw new Error('MDCMenuFoundation: No selection group at specified index.');\n }\n\n const prevSelectedIndex =\n this.adapter.getSelectedSiblingOfItemAtIndex(index);\n if (prevSelectedIndex >= 0) {\n this.adapter.removeAttributeFromElementAtIndex(\n prevSelectedIndex, strings.ARIA_CHECKED_ATTR);\n this.adapter.removeClassFromElementAtIndex(\n prevSelectedIndex, cssClasses.MENU_SELECTED_LIST_ITEM);\n }\n\n this.adapter.addClassToElementAtIndex(\n index, cssClasses.MENU_SELECTED_LIST_ITEM);\n this.adapter.addAttributeToElementAtIndex(\n index, strings.ARIA_CHECKED_ATTR, 'true');\n }\n\n /**\n * Sets the enabled state to isEnabled for the menu item at the given index.\n * @param index Index of the menu item\n * @param isEnabled The desired enabled state of the menu item.\n */\n setEnabled(index: number, isEnabled: boolean): void {\n this.validatedIndex_(index);\n\n if (isEnabled) {\n this.adapter.removeClassFromElementAtIndex(\n index, listCssClasses.LIST_ITEM_DISABLED_CLASS);\n this.adapter.addAttributeToElementAtIndex(\n index, strings.ARIA_DISABLED_ATTR, 'false');\n } else {\n this.adapter.addClassToElementAtIndex(\n index, listCssClasses.LIST_ITEM_DISABLED_CLASS);\n this.adapter.addAttributeToElementAtIndex(\n index, strings.ARIA_DISABLED_ATTR, 'true');\n }\n }\n\n private validatedIndex_(index: number): void {\n const menuSize = this.adapter.getMenuItemCount();\n const isIndexInRange = index >= 0 && index < menuSize;\n\n if (!isIndexInRange) {\n throw new Error('MDCMenuFoundation: No list item at specified index.');\n }\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCMenuFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport {Corner} from '@material/menu-surface/constants'; // for backward compatibility\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './types';\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {MDCFloatingLabelFoundation} from '@material/floating-label/foundation';\nimport {MDCNotchedOutlineAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\nimport {MDCNotchedOutlineFoundation} from './foundation';\n\nexport type MDCNotchedOutlineFactory = (el: Element, foundation?: MDCNotchedOutlineFoundation) => MDCNotchedOutline;\n\nexport class MDCNotchedOutline extends MDCComponent<MDCNotchedOutlineFoundation> {\n static attachTo(root: Element): MDCNotchedOutline {\n return new MDCNotchedOutline(root);\n }\n\n private notchElement_!: HTMLElement; // assigned in initialSyncWithDOM()\n\n initialSyncWithDOM() {\n this.notchElement_ =\n this.root.querySelector<HTMLElement>(strings.NOTCH_ELEMENT_SELECTOR)!;\n\n const label = this.root.querySelector<HTMLElement>(\n '.' + MDCFloatingLabelFoundation.cssClasses.ROOT);\n if (label) {\n label.style.transitionDuration = '0s';\n this.root.classList.add(cssClasses.OUTLINE_UPGRADED);\n requestAnimationFrame(() => {\n label.style.transitionDuration = '';\n });\n } else {\n this.root.classList.add(cssClasses.NO_LABEL);\n }\n }\n\n /**\n * Updates classes and styles to open the notch to the specified width.\n * @param notchWidth The notch width in the outline.\n */\n notch(notchWidth: number) {\n this.foundation.notch(notchWidth);\n }\n\n /**\n * Updates classes and styles to close the notch.\n */\n closeNotch() {\n this.foundation.closeNotch();\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCNotchedOutlineAdapter = {\n addClass: (className) => this.root.classList.add(className),\n removeClass: (className) => this.root.classList.remove(className),\n setNotchWidthProperty: (width) =>\n this.notchElement_.style.setProperty('width', width + 'px'),\n removeNotchWidthProperty: () =>\n this.notchElement_.style.removeProperty('width'),\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCNotchedOutlineFoundation(adapter);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst strings = {\n NOTCH_ELEMENT_SELECTOR: '.mdc-notched-outline__notch',\n};\n\nconst numbers = {\n // This should stay in sync with $mdc-notched-outline-padding * 2.\n NOTCH_ELEMENT_PADDING: 8,\n};\n\nconst cssClasses = {\n NO_LABEL: 'mdc-notched-outline--no-label',\n OUTLINE_NOTCHED: 'mdc-notched-outline--notched',\n OUTLINE_UPGRADED: 'mdc-notched-outline--upgraded',\n};\n\nexport {cssClasses, numbers, strings};\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCNotchedOutlineAdapter} from './adapter';\nimport {cssClasses, numbers, strings} from './constants';\n\nexport class MDCNotchedOutlineFoundation extends MDCFoundation<MDCNotchedOutlineAdapter> {\n static get strings() {\n return strings;\n }\n\n static get cssClasses() {\n return cssClasses;\n }\n\n static get numbers() {\n return numbers;\n }\n\n /**\n * See {@link MDCNotchedOutlineAdapter} for typing information on parameters and return types.\n */\n static get defaultAdapter(): MDCNotchedOutlineAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: () => undefined,\n removeClass: () => undefined,\n setNotchWidthProperty: () => undefined,\n removeNotchWidthProperty: () => undefined,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n constructor(adapter?: Partial<MDCNotchedOutlineAdapter>) {\n super({...MDCNotchedOutlineFoundation.defaultAdapter, ...adapter});\n }\n\n /**\n * Adds the outline notched selector and updates the notch width calculated based off of notchWidth.\n */\n notch(notchWidth: number) {\n const {OUTLINE_NOTCHED} = MDCNotchedOutlineFoundation.cssClasses;\n\n if (notchWidth > 0) {\n notchWidth += numbers.NOTCH_ELEMENT_PADDING; // Add padding from left/right.\n }\n\n this.adapter.setNotchWidthProperty(notchWidth);\n this.adapter.addClass(OUTLINE_NOTCHED);\n }\n\n /**\n * Removes notched outline selector to close the notch in the outline.\n */\n closeNotch() {\n const {OUTLINE_NOTCHED} = MDCNotchedOutlineFoundation.cssClasses;\n this.adapter.removeClass(OUTLINE_NOTCHED);\n this.adapter.removeNotchWidthProperty();\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCNotchedOutlineFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {applyPassive} from '@material/dom/events';\nimport {MDCRippleAdapter} from '@material/ripple/adapter';\nimport {MDCRipple} from '@material/ripple/component';\nimport {MDCRippleFoundation} from '@material/ripple/foundation';\nimport {MDCRippleCapableSurface} from '@material/ripple/types';\nimport {MDCRadioAdapter} from './adapter';\nimport {MDCRadioFoundation} from './foundation';\n\nexport class MDCRadio extends MDCComponent<MDCRadioFoundation> implements MDCRippleCapableSurface {\n static attachTo(root: Element) {\n return new MDCRadio(root);\n }\n\n get checked(): boolean {\n return this.nativeControl_.checked;\n }\n\n set checked(checked: boolean) {\n this.nativeControl_.checked = checked;\n }\n\n get disabled() {\n return this.nativeControl_.disabled;\n }\n\n set disabled(disabled: boolean) {\n this.foundation.setDisabled(disabled);\n }\n\n get value() {\n return this.nativeControl_.value;\n }\n\n set value(value: string) {\n this.nativeControl_.value = value;\n }\n\n get ripple(): MDCRipple {\n return this.ripple_;\n }\n\n private readonly ripple_: MDCRipple = this.createRipple_();\n\n destroy() {\n this.ripple_.destroy();\n super.destroy();\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCRadioAdapter = {\n addClass: (className) => this.root.classList.add(className),\n removeClass: (className) => this.root.classList.remove(className),\n setNativeControlDisabled: (disabled) => this.nativeControl_.disabled =\n disabled,\n };\n return new MDCRadioFoundation(adapter);\n }\n\n private createRipple_(): MDCRipple {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCRippleAdapter = {\n ...MDCRipple.createAdapter(this),\n registerInteractionHandler: (evtType, handler) => this.nativeControl_.addEventListener(\n evtType, handler, applyPassive()),\n deregisterInteractionHandler: (evtType, handler) => this.nativeControl_.removeEventListener(\n evtType, handler, applyPassive()),\n // Radio buttons technically go \"active\" whenever there is *any* keyboard interaction.\n // This is not the UI we desire.\n isSurfaceActive: () => false,\n isUnbounded: () => true,\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCRipple(this.root, new MDCRippleFoundation(adapter));\n }\n\n private get nativeControl_(): HTMLInputElement {\n const {NATIVE_CONTROL_SELECTOR} = MDCRadioFoundation.strings;\n const el =\n this.root.querySelector<HTMLInputElement>(NATIVE_CONTROL_SELECTOR);\n if (!el) {\n throw new Error(`Radio component requires a ${NATIVE_CONTROL_SELECTOR} element`);\n }\n return el;\n }\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst strings = {\n NATIVE_CONTROL_SELECTOR: '.mdc-radio__native-control',\n};\n\nconst cssClasses = {\n DISABLED: 'mdc-radio--disabled',\n ROOT: 'mdc-radio',\n};\n\nexport {strings, cssClasses};\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCRadioAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\n\nexport class MDCRadioFoundation extends MDCFoundation<MDCRadioAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get defaultAdapter(): MDCRadioAdapter {\n return {\n addClass: () => undefined,\n removeClass: () => undefined,\n setNativeControlDisabled: () => undefined,\n };\n }\n\n constructor(adapter?: Partial<MDCRadioAdapter>) {\n super({...MDCRadioFoundation.defaultAdapter, ...adapter});\n }\n\n setDisabled(disabled: boolean) {\n const {DISABLED} = MDCRadioFoundation.cssClasses;\n this.adapter.setNativeControlDisabled(disabled);\n if (disabled) {\n this.adapter.addClass(DISABLED);\n } else {\n this.adapter.removeClass(DISABLED);\n }\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCRadioFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {applyPassive} from '@material/dom/events';\nimport {matches} from '@material/dom/ponyfill';\nimport {MDCRippleAdapter} from './adapter';\nimport {MDCRippleFoundation} from './foundation';\nimport {MDCRippleAttachOpts, MDCRippleCapableSurface} from './types';\nimport * as util from './util';\n\nexport type MDCRippleFactory = (el: Element, foundation?: MDCRippleFoundation) => MDCRipple;\n\nexport class MDCRipple extends MDCComponent<MDCRippleFoundation> implements MDCRippleCapableSurface {\n static attachTo(root: Element, opts: MDCRippleAttachOpts = {isUnbounded: undefined}): MDCRipple {\n const ripple = new MDCRipple(root);\n // Only override unbounded behavior if option is explicitly specified\n if (opts.isUnbounded !== undefined) {\n ripple.unbounded = opts.isUnbounded;\n }\n return ripple;\n }\n\n static createAdapter(instance: MDCRippleCapableSurface): MDCRippleAdapter {\n return {\n addClass: (className) => instance.root.classList.add(className),\n browserSupportsCssVars: () => util.supportsCssVariables(window),\n computeBoundingRect: () => instance.root.getBoundingClientRect(),\n containsEventTarget: (target) => instance.root.contains(target as Node),\n deregisterDocumentInteractionHandler: (evtType, handler) =>\n document.documentElement.removeEventListener(\n evtType, handler, applyPassive()),\n deregisterInteractionHandler: (evtType, handler) =>\n (instance.root as HTMLElement)\n .removeEventListener(evtType, handler, applyPassive()),\n deregisterResizeHandler: (handler) =>\n window.removeEventListener('resize', handler),\n getWindowPageOffset: () =>\n ({x: window.pageXOffset, y: window.pageYOffset}),\n isSurfaceActive: () => matches(instance.root, ':active'),\n isSurfaceDisabled: () => Boolean(instance.disabled),\n isUnbounded: () => Boolean(instance.unbounded),\n registerDocumentInteractionHandler: (evtType, handler) =>\n document.documentElement.addEventListener(\n evtType, handler, applyPassive()),\n registerInteractionHandler: (evtType, handler) =>\n (instance.root as HTMLElement)\n .addEventListener(evtType, handler, applyPassive()),\n registerResizeHandler: (handler) =>\n window.addEventListener('resize', handler),\n removeClass: (className) => instance.root.classList.remove(className),\n updateCssVariable: (varName, value) =>\n (instance.root as HTMLElement).style.setProperty(varName, value),\n };\n }\n\n disabled = false;\n\n private unbounded_?: boolean;\n\n get unbounded(): boolean {\n return Boolean(this.unbounded_);\n }\n\n set unbounded(unbounded: boolean) {\n this.unbounded_ = Boolean(unbounded);\n this.setUnbounded_();\n }\n\n activate() {\n this.foundation.activate();\n }\n\n deactivate() {\n this.foundation.deactivate();\n }\n\n layout() {\n this.foundation.layout();\n }\n\n getDefaultFoundation() {\n return new MDCRippleFoundation(MDCRipple.createAdapter(this));\n }\n\n initialSyncWithDOM() {\n const root = this.root as HTMLElement;\n this.unbounded = 'mdcRippleIsUnbounded' in root.dataset;\n }\n\n /**\n * Closure Compiler throws an access control error when directly accessing a\n * protected or private property inside a getter/setter, like unbounded above.\n * By accessing the protected property inside a method, we solve that problem.\n * That's why this function exists.\n */\n private setUnbounded_() {\n this.foundation.setUnbounded(Boolean(this.unbounded_));\n }\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport const cssClasses = {\n // Ripple is a special case where the \"root\" component is really a \"mixin\" of sorts,\n // given that it's an 'upgrade' to an existing component. That being said it is the root\n // CSS class that all other CSS classes derive from.\n BG_FOCUSED: 'mdc-ripple-upgraded--background-focused',\n FG_ACTIVATION: 'mdc-ripple-upgraded--foreground-activation',\n FG_DEACTIVATION: 'mdc-ripple-upgraded--foreground-deactivation',\n ROOT: 'mdc-ripple-upgraded',\n UNBOUNDED: 'mdc-ripple-upgraded--unbounded',\n};\n\nexport const strings = {\n VAR_FG_SCALE: '--mdc-ripple-fg-scale',\n VAR_FG_SIZE: '--mdc-ripple-fg-size',\n VAR_FG_TRANSLATE_END: '--mdc-ripple-fg-translate-end',\n VAR_FG_TRANSLATE_START: '--mdc-ripple-fg-translate-start',\n VAR_LEFT: '--mdc-ripple-left',\n VAR_TOP: '--mdc-ripple-top',\n};\n\nexport const numbers = {\n DEACTIVATION_TIMEOUT_MS: 225, // Corresponds to $mdc-ripple-translate-duration (i.e. activation animation duration)\n FG_DEACTIVATION_MS: 150, // Corresponds to $mdc-ripple-fade-out-duration (i.e. deactivation animation duration)\n INITIAL_ORIGIN_SCALE: 0.6,\n PADDING: 10,\n TAP_DELAY_MS: 300, // Delay between touch and simulated mouse events on touch devices\n};\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCRippleAdapter} from './adapter';\nimport {cssClasses, numbers, strings} from './constants';\nimport {MDCRipplePoint} from './types';\nimport {getNormalizedEventCoords} from './util';\n\ninterface ActivationStateType {\n isActivated?: boolean;\n hasDeactivationUXRun?: boolean;\n wasActivatedByPointer?: boolean;\n wasElementMadeActive?: boolean;\n activationEvent?: Event;\n isProgrammatic?: boolean;\n}\n\ninterface FgTranslationCoordinates {\n startPoint: MDCRipplePoint;\n endPoint: MDCRipplePoint;\n}\n\ninterface Coordinates {\n left: number;\n top: number;\n}\n\ntype ActivationEventType = 'touchstart' | 'pointerdown' | 'mousedown' | 'keydown';\ntype DeactivationEventType = 'touchend' | 'pointerup' | 'mouseup' | 'contextmenu';\n\n// Activation events registered on the root element of each instance for activation\nconst ACTIVATION_EVENT_TYPES: ActivationEventType[] = [\n 'touchstart', 'pointerdown', 'mousedown', 'keydown',\n];\n\n// Deactivation events registered on documentElement when a pointer-related down event occurs\nconst POINTER_DEACTIVATION_EVENT_TYPES: DeactivationEventType[] = [\n 'touchend', 'pointerup', 'mouseup', 'contextmenu',\n];\n\n// simultaneous nested activations\nlet activatedTargets: Array<EventTarget | null> = [];\n\nexport class MDCRippleFoundation extends MDCFoundation<MDCRippleAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get numbers() {\n return numbers;\n }\n\n static get defaultAdapter(): MDCRippleAdapter {\n return {\n addClass: () => undefined,\n browserSupportsCssVars: () => true,\n computeBoundingRect: () => ({top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0}),\n containsEventTarget: () => true,\n deregisterDocumentInteractionHandler: () => undefined,\n deregisterInteractionHandler: () => undefined,\n deregisterResizeHandler: () => undefined,\n getWindowPageOffset: () => ({x: 0, y: 0}),\n isSurfaceActive: () => true,\n isSurfaceDisabled: () => true,\n isUnbounded: () => true,\n registerDocumentInteractionHandler: () => undefined,\n registerInteractionHandler: () => undefined,\n registerResizeHandler: () => undefined,\n removeClass: () => undefined,\n updateCssVariable: () => undefined,\n };\n }\n\n private activationAnimationHasEnded_ = false;\n private activationState_: ActivationStateType;\n private activationTimer_ = 0;\n private fgDeactivationRemovalTimer_ = 0;\n private fgScale_ = '0';\n private frame_ = {width: 0, height: 0};\n private initialSize_ = 0;\n private layoutFrame_ = 0;\n private maxRadius_ = 0;\n private unboundedCoords_: Coordinates = {left: 0, top: 0};\n\n private readonly activationTimerCallback_: () => void;\n private readonly activateHandler_: EventHandlerNonNull;\n private readonly deactivateHandler_: EventHandlerNonNull;\n private readonly focusHandler_: EventHandlerNonNull;\n private readonly blurHandler_: EventHandlerNonNull;\n private readonly resizeHandler_: EventHandlerNonNull;\n\n private previousActivationEvent_?: Event;\n\n constructor(adapter?: Partial<MDCRippleAdapter>) {\n super({...MDCRippleFoundation.defaultAdapter, ...adapter});\n\n this.activationState_ = this.defaultActivationState_();\n\n this.activationTimerCallback_ = () => {\n this.activationAnimationHasEnded_ = true;\n this.runDeactivationUXLogicIfReady_();\n };\n this.activateHandler_ = (e) => this.activate_(e);\n this.deactivateHandler_ = () => this.deactivate_();\n this.focusHandler_ = () => this.handleFocus();\n this.blurHandler_ = () => this.handleBlur();\n this.resizeHandler_ = () => this.layout();\n }\n\n init() {\n const supportsPressRipple = this.supportsPressRipple_();\n\n this.registerRootHandlers_(supportsPressRipple);\n\n if (supportsPressRipple) {\n const {ROOT, UNBOUNDED} = MDCRippleFoundation.cssClasses;\n requestAnimationFrame(() => {\n this.adapter.addClass(ROOT);\n if (this.adapter.isUnbounded()) {\n this.adapter.addClass(UNBOUNDED);\n // Unbounded ripples need layout logic applied immediately to set coordinates for both shade and ripple\n this.layoutInternal_();\n }\n });\n }\n }\n\n destroy() {\n if (this.supportsPressRipple_()) {\n if (this.activationTimer_) {\n clearTimeout(this.activationTimer_);\n this.activationTimer_ = 0;\n this.adapter.removeClass(MDCRippleFoundation.cssClasses.FG_ACTIVATION);\n }\n\n if (this.fgDeactivationRemovalTimer_) {\n clearTimeout(this.fgDeactivationRemovalTimer_);\n this.fgDeactivationRemovalTimer_ = 0;\n this.adapter.removeClass(\n MDCRippleFoundation.cssClasses.FG_DEACTIVATION);\n }\n\n const {ROOT, UNBOUNDED} = MDCRippleFoundation.cssClasses;\n requestAnimationFrame(() => {\n this.adapter.removeClass(ROOT);\n this.adapter.removeClass(UNBOUNDED);\n this.removeCssVars_();\n });\n }\n\n this.deregisterRootHandlers_();\n this.deregisterDeactivationHandlers_();\n }\n\n /**\n * @param evt Optional event containing position information.\n */\n activate(evt?: Event): void {\n this.activate_(evt);\n }\n\n deactivate(): void {\n this.deactivate_();\n }\n\n layout(): void {\n if (this.layoutFrame_) {\n cancelAnimationFrame(this.layoutFrame_);\n }\n this.layoutFrame_ = requestAnimationFrame(() => {\n this.layoutInternal_();\n this.layoutFrame_ = 0;\n });\n }\n\n setUnbounded(unbounded: boolean): void {\n const {UNBOUNDED} = MDCRippleFoundation.cssClasses;\n if (unbounded) {\n this.adapter.addClass(UNBOUNDED);\n } else {\n this.adapter.removeClass(UNBOUNDED);\n }\n }\n\n handleFocus(): void {\n requestAnimationFrame(\n () => this.adapter.addClass(MDCRippleFoundation.cssClasses.BG_FOCUSED));\n }\n\n handleBlur(): void {\n requestAnimationFrame(\n () => this.adapter.removeClass(\n MDCRippleFoundation.cssClasses.BG_FOCUSED));\n }\n\n /**\n * We compute this property so that we are not querying information about the client\n * until the point in time where the foundation requests it. This prevents scenarios where\n * client-side feature-detection may happen too early, such as when components are rendered on the server\n * and then initialized at mount time on the client.\n */\n private supportsPressRipple_(): boolean {\n return this.adapter.browserSupportsCssVars();\n }\n\n private defaultActivationState_(): ActivationStateType {\n return {\n activationEvent: undefined,\n hasDeactivationUXRun: false,\n isActivated: false,\n isProgrammatic: false,\n wasActivatedByPointer: false,\n wasElementMadeActive: false,\n };\n }\n\n /**\n * supportsPressRipple Passed from init to save a redundant function call\n */\n private registerRootHandlers_(supportsPressRipple: boolean) {\n if (supportsPressRipple) {\n ACTIVATION_EVENT_TYPES.forEach((evtType) => {\n this.adapter.registerInteractionHandler(evtType, this.activateHandler_);\n });\n if (this.adapter.isUnbounded()) {\n this.adapter.registerResizeHandler(this.resizeHandler_);\n }\n }\n\n this.adapter.registerInteractionHandler('focus', this.focusHandler_);\n this.adapter.registerInteractionHandler('blur', this.blurHandler_);\n }\n\n private registerDeactivationHandlers_(evt: Event) {\n if (evt.type === 'keydown') {\n this.adapter.registerInteractionHandler('keyup', this.deactivateHandler_);\n } else {\n POINTER_DEACTIVATION_EVENT_TYPES.forEach((evtType) => {\n this.adapter.registerDocumentInteractionHandler(\n evtType, this.deactivateHandler_);\n });\n }\n }\n\n private deregisterRootHandlers_() {\n ACTIVATION_EVENT_TYPES.forEach((evtType) => {\n this.adapter.deregisterInteractionHandler(evtType, this.activateHandler_);\n });\n this.adapter.deregisterInteractionHandler('focus', this.focusHandler_);\n this.adapter.deregisterInteractionHandler('blur', this.blurHandler_);\n\n if (this.adapter.isUnbounded()) {\n this.adapter.deregisterResizeHandler(this.resizeHandler_);\n }\n }\n\n private deregisterDeactivationHandlers_() {\n this.adapter.deregisterInteractionHandler('keyup', this.deactivateHandler_);\n POINTER_DEACTIVATION_EVENT_TYPES.forEach((evtType) => {\n this.adapter.deregisterDocumentInteractionHandler(\n evtType, this.deactivateHandler_);\n });\n }\n\n private removeCssVars_() {\n const rippleStrings = MDCRippleFoundation.strings;\n const keys = Object.keys(rippleStrings) as Array<keyof typeof rippleStrings>;\n keys.forEach((key) => {\n if (key.indexOf('VAR_') === 0) {\n this.adapter.updateCssVariable(rippleStrings[key], null);\n }\n });\n }\n\n private activate_(evt?: Event) {\n if (this.adapter.isSurfaceDisabled()) {\n return;\n }\n\n const activationState = this.activationState_;\n if (activationState.isActivated) {\n return;\n }\n\n // Avoid reacting to follow-on events fired by touch device after an already-processed user interaction\n const previousActivationEvent = this.previousActivationEvent_;\n const isSameInteraction = previousActivationEvent && evt !== undefined && previousActivationEvent.type !== evt.type;\n if (isSameInteraction) {\n return;\n }\n\n activationState.isActivated = true;\n activationState.isProgrammatic = evt === undefined;\n activationState.activationEvent = evt;\n activationState.wasActivatedByPointer = activationState.isProgrammatic ? false : evt !== undefined && (\n evt.type === 'mousedown' || evt.type === 'touchstart' || evt.type === 'pointerdown'\n );\n\n const hasActivatedChild = evt !== undefined &&\n activatedTargets.length > 0 &&\n activatedTargets.some(\n (target) => this.adapter.containsEventTarget(target));\n if (hasActivatedChild) {\n // Immediately reset activation state, while preserving logic that prevents touch follow-on events\n this.resetActivationState_();\n return;\n }\n\n if (evt !== undefined) {\n activatedTargets.push(evt.target);\n this.registerDeactivationHandlers_(evt);\n }\n\n activationState.wasElementMadeActive = this.checkElementMadeActive_(evt);\n if (activationState.wasElementMadeActive) {\n this.animateActivation_();\n }\n\n requestAnimationFrame(() => {\n // Reset array on next frame after the current event has had a chance to bubble to prevent ancestor ripples\n activatedTargets = [];\n\n if (!activationState.wasElementMadeActive\n && evt !== undefined\n && ((evt as KeyboardEvent).key === ' ' || (evt as KeyboardEvent).keyCode === 32)) {\n // If space was pressed, try again within an rAF call to detect :active, because different UAs report\n // active states inconsistently when they're called within event handling code:\n // - https://bugs.chromium.org/p/chromium/issues/detail?id=635971\n // - https://bugzilla.mozilla.org/show_bug.cgi?id=1293741\n // We try first outside rAF to support Edge, which does not exhibit this problem, but will crash if a CSS\n // variable is set within a rAF callback for a submit button interaction (#2241).\n activationState.wasElementMadeActive = this.checkElementMadeActive_(evt);\n if (activationState.wasElementMadeActive) {\n this.animateActivation_();\n }\n }\n\n if (!activationState.wasElementMadeActive) {\n // Reset activation state immediately if element was not made active.\n this.activationState_ = this.defaultActivationState_();\n }\n });\n }\n\n private checkElementMadeActive_(evt?: Event) {\n return (evt !== undefined && evt.type === 'keydown') ?\n this.adapter.isSurfaceActive() :\n true;\n }\n\n private animateActivation_() {\n const {VAR_FG_TRANSLATE_START, VAR_FG_TRANSLATE_END} = MDCRippleFoundation.strings;\n const {FG_DEACTIVATION, FG_ACTIVATION} = MDCRippleFoundation.cssClasses;\n const {DEACTIVATION_TIMEOUT_MS} = MDCRippleFoundation.numbers;\n\n this.layoutInternal_();\n\n let translateStart = '';\n let translateEnd = '';\n\n if (!this.adapter.isUnbounded()) {\n const {startPoint, endPoint} = this.getFgTranslationCoordinates_();\n translateStart = `${startPoint.x}px, ${startPoint.y}px`;\n translateEnd = `${endPoint.x}px, ${endPoint.y}px`;\n }\n\n this.adapter.updateCssVariable(VAR_FG_TRANSLATE_START, translateStart);\n this.adapter.updateCssVariable(VAR_FG_TRANSLATE_END, translateEnd);\n // Cancel any ongoing activation/deactivation animations\n clearTimeout(this.activationTimer_);\n clearTimeout(this.fgDeactivationRemovalTimer_);\n this.rmBoundedActivationClasses_();\n this.adapter.removeClass(FG_DEACTIVATION);\n\n // Force layout in order to re-trigger the animation.\n this.adapter.computeBoundingRect();\n this.adapter.addClass(FG_ACTIVATION);\n this.activationTimer_ = setTimeout(() => this.activationTimerCallback_(), DEACTIVATION_TIMEOUT_MS);\n }\n\n private getFgTranslationCoordinates_(): FgTranslationCoordinates {\n const {activationEvent, wasActivatedByPointer} = this.activationState_;\n\n let startPoint;\n if (wasActivatedByPointer) {\n startPoint = getNormalizedEventCoords(\n activationEvent,\n this.adapter.getWindowPageOffset(),\n this.adapter.computeBoundingRect(),\n );\n } else {\n startPoint = {\n x: this.frame_.width / 2,\n y: this.frame_.height / 2,\n };\n }\n // Center the element around the start point.\n startPoint = {\n x: startPoint.x - (this.initialSize_ / 2),\n y: startPoint.y - (this.initialSize_ / 2),\n };\n\n const endPoint = {\n x: (this.frame_.width / 2) - (this.initialSize_ / 2),\n y: (this.frame_.height / 2) - (this.initialSize_ / 2),\n };\n\n return {startPoint, endPoint};\n }\n\n private runDeactivationUXLogicIfReady_() {\n // This method is called both when a pointing device is released, and when the activation animation ends.\n // The deactivation animation should only run after both of those occur.\n const {FG_DEACTIVATION} = MDCRippleFoundation.cssClasses;\n const {hasDeactivationUXRun, isActivated} = this.activationState_;\n const activationHasEnded = hasDeactivationUXRun || !isActivated;\n\n if (activationHasEnded && this.activationAnimationHasEnded_) {\n this.rmBoundedActivationClasses_();\n this.adapter.addClass(FG_DEACTIVATION);\n this.fgDeactivationRemovalTimer_ = setTimeout(() => {\n this.adapter.removeClass(FG_DEACTIVATION);\n }, numbers.FG_DEACTIVATION_MS);\n }\n }\n\n private rmBoundedActivationClasses_() {\n const {FG_ACTIVATION} = MDCRippleFoundation.cssClasses;\n this.adapter.removeClass(FG_ACTIVATION);\n this.activationAnimationHasEnded_ = false;\n this.adapter.computeBoundingRect();\n }\n\n private resetActivationState_() {\n this.previousActivationEvent_ = this.activationState_.activationEvent;\n this.activationState_ = this.defaultActivationState_();\n // Touch devices may fire additional events for the same interaction within a short time.\n // Store the previous event until it's safe to assume that subsequent events are for new interactions.\n setTimeout(() => this.previousActivationEvent_ = undefined, MDCRippleFoundation.numbers.TAP_DELAY_MS);\n }\n\n private deactivate_(): void {\n const activationState = this.activationState_;\n // This can happen in scenarios such as when you have a keyup event that blurs the element.\n if (!activationState.isActivated) {\n return;\n }\n\n const state: ActivationStateType = {...activationState};\n\n if (activationState.isProgrammatic) {\n requestAnimationFrame(() => this.animateDeactivation_(state));\n this.resetActivationState_();\n } else {\n this.deregisterDeactivationHandlers_();\n requestAnimationFrame(() => {\n this.activationState_.hasDeactivationUXRun = true;\n this.animateDeactivation_(state);\n this.resetActivationState_();\n });\n }\n }\n\n private animateDeactivation_({wasActivatedByPointer, wasElementMadeActive}: ActivationStateType) {\n if (wasActivatedByPointer || wasElementMadeActive) {\n this.runDeactivationUXLogicIfReady_();\n }\n }\n\n private layoutInternal_() {\n this.frame_ = this.adapter.computeBoundingRect();\n const maxDim = Math.max(this.frame_.height, this.frame_.width);\n\n // Surface diameter is treated differently for unbounded vs. bounded ripples.\n // Unbounded ripple diameter is calculated smaller since the surface is expected to already be padded appropriately\n // to extend the hitbox, and the ripple is expected to meet the edges of the padded hitbox (which is typically\n // square). Bounded ripples, on the other hand, are fully expected to expand beyond the surface's longest diameter\n // (calculated based on the diagonal plus a constant padding), and are clipped at the surface's border via\n // `overflow: hidden`.\n const getBoundedRadius = () => {\n const hypotenuse = Math.sqrt(Math.pow(this.frame_.width, 2) + Math.pow(this.frame_.height, 2));\n return hypotenuse + MDCRippleFoundation.numbers.PADDING;\n };\n\n this.maxRadius_ = this.adapter.isUnbounded() ? maxDim : getBoundedRadius();\n\n // Ripple is sized as a fraction of the largest dimension of the surface, then scales up using a CSS scale transform\n const initialSize = Math.floor(maxDim * MDCRippleFoundation.numbers.INITIAL_ORIGIN_SCALE);\n // Unbounded ripple size should always be even number to equally center align.\n if (this.adapter.isUnbounded() && initialSize % 2 !== 0) {\n this.initialSize_ = initialSize - 1;\n } else {\n this.initialSize_ = initialSize;\n }\n this.fgScale_ = `${this.maxRadius_ / this.initialSize_}`;\n\n this.updateLayoutCssVars_();\n }\n\n private updateLayoutCssVars_() {\n const {\n VAR_FG_SIZE, VAR_LEFT, VAR_TOP, VAR_FG_SCALE,\n } = MDCRippleFoundation.strings;\n\n this.adapter.updateCssVariable(VAR_FG_SIZE, `${this.initialSize_}px`);\n this.adapter.updateCssVariable(VAR_FG_SCALE, this.fgScale_);\n\n if (this.adapter.isUnbounded()) {\n this.unboundedCoords_ = {\n left: Math.round((this.frame_.width / 2) - (this.initialSize_ / 2)),\n top: Math.round((this.frame_.height / 2) - (this.initialSize_ / 2)),\n };\n\n this.adapter.updateCssVariable(\n VAR_LEFT, `${this.unboundedCoords_.left}px`);\n this.adapter.updateCssVariable(VAR_TOP, `${this.unboundedCoords_.top}px`);\n }\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCRippleFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport * as util from './util';\n\nexport {util};\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './types';\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport {MDCRipplePoint} from './types';\n\n/**\n * Stores result from supportsCssVariables to avoid redundant processing to\n * detect CSS custom variable support.\n */\nlet supportsCssVariables_: boolean | undefined;\n\nexport function supportsCssVariables(windowObj: typeof globalThis, forceRefresh = false): boolean {\n const {CSS} = windowObj;\n let supportsCssVars = supportsCssVariables_;\n if (typeof supportsCssVariables_ === 'boolean' && !forceRefresh) {\n return supportsCssVariables_;\n }\n\n const supportsFunctionPresent = CSS && typeof CSS.supports === 'function';\n if (!supportsFunctionPresent) {\n return false;\n }\n\n const explicitlySupportsCssVars = CSS.supports('--css-vars', 'yes');\n // See: https://bugs.webkit.org/show_bug.cgi?id=154669\n // See: README section on Safari\n const weAreFeatureDetectingSafari10plus = (\n CSS.supports('(--css-vars: yes)') &&\n CSS.supports('color', '#00000000')\n );\n\n supportsCssVars =\n explicitlySupportsCssVars || weAreFeatureDetectingSafari10plus;\n\n if (!forceRefresh) {\n supportsCssVariables_ = supportsCssVars;\n }\n return supportsCssVars;\n}\n\nexport function getNormalizedEventCoords(evt: Event | undefined, pageOffset: MDCRipplePoint, clientRect: ClientRect):\n MDCRipplePoint {\n if (!evt) {\n return {x: 0, y: 0};\n }\n const {x, y} = pageOffset;\n const documentX = x + clientRect.left;\n const documentY = y + clientRect.top;\n\n let normalizedX;\n let normalizedY;\n // Determine touch point relative to the ripple container.\n if (evt.type === 'touchstart') {\n const touchEvent = evt as TouchEvent;\n normalizedX = touchEvent.changedTouches[0].pageX - documentX;\n normalizedY = touchEvent.changedTouches[0].pageY - documentY;\n } else {\n const mouseEvent = evt as MouseEvent;\n normalizedX = mouseEvent.pageX - documentX;\n normalizedY = mouseEvent.pageY - documentY;\n }\n\n return {x: normalizedX, y: normalizedY};\n}\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './segmented-button/index';\nexport * from './segment/index';\nexport * from './types';\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {SpecificEventListener} from '@material/base/types';\nimport {MDCRippleAdapter} from '@material/ripple/adapter';\nimport {MDCRipple, MDCRippleFactory} from '@material/ripple/component';\nimport {MDCRippleFoundation} from '@material/ripple/foundation';\nimport {MDCRippleCapableSurface} from '@material/ripple/types';\n\nimport {SegmentDetail} from '../types';\n\nimport {MDCSegmentedButtonSegmentAdapter} from './adapter';\nimport {events} from './constants';\nimport {MDCSegmentedButtonSegmentFoundation} from './foundation';\n\n/**\n * MDCSegmentedButtonSegment factory type.\n */\nexport type MDCSegmentedButtonSegmentFactory =\n (el: Element, foundation?: MDCSegmentedButtonSegmentFoundation) =>\n MDCSegmentedButtonSegment;\n\n/**\n * Implementation of MDCSegmentedButtonSegmentFoundation\n */\nexport class MDCSegmentedButtonSegment extends\n MDCComponent<MDCSegmentedButtonSegmentFoundation> implements\n MDCRippleCapableSurface {\n get ripple(): MDCRipple {\n return this.rippleComponent;\n }\n\n static attachTo(root: Element) {\n return new MDCSegmentedButtonSegment(root);\n }\n\n private index!: number; // assigned in setIndex by parent\n private isSingleSelect!: boolean; // assigned in setIsSingleSelect by parent\n private rippleComponent!: MDCRipple; // assigned in initialize\n private handleClick!:\n SpecificEventListener<'click'>; // assigned in initialSyncWithDOM\n\n initialize(\n rippleFactory: MDCRippleFactory = (el, foundation) =>\n new MDCRipple(el, foundation)) {\n const rippleAdapter: MDCRippleAdapter = {\n ...MDCRipple.createAdapter(this),\n computeBoundingRect: () => this.foundation.getDimensions()\n };\n this.rippleComponent =\n rippleFactory(this.root, new MDCRippleFoundation(rippleAdapter));\n }\n\n initialSyncWithDOM() {\n this.handleClick = () => {\n this.foundation.handleClick();\n };\n\n this.listen(events.CLICK, this.handleClick);\n }\n\n destroy() {\n this.ripple.destroy();\n\n this.unlisten(events.CLICK, this.handleClick);\n\n super.destroy();\n }\n\n getDefaultFoundation(): MDCSegmentedButtonSegmentFoundation {\n // DO NOT INLINE this variable. For backward compatibility, foundations take\n // a Partial<MDCFooAdapter>. To ensure we don't accidentally omit any\n // methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCSegmentedButtonSegmentAdapter = {\n isSingleSelect: () => {\n return this.isSingleSelect;\n },\n getAttr: (attrName) => {\n return this.root.getAttribute(attrName);\n },\n setAttr: (attrName, value) => {\n this.root.setAttribute(attrName, value);\n },\n addClass: (className) => {\n this.root.classList.add(className);\n },\n removeClass: (className) => {\n this.root.classList.remove(className);\n },\n hasClass: (className) => {\n return this.root.classList.contains(className);\n },\n notifySelectedChange: (selected) => {\n this.emit<SegmentDetail>(\n events.SELECTED, {\n index: this.index,\n selected,\n segmentId: this.getSegmentId()\n },\n true /* shouldBubble */\n );\n },\n getRootBoundingClientRect: () => {\n return this.root.getBoundingClientRect();\n }\n };\n return new MDCSegmentedButtonSegmentFoundation(adapter);\n }\n\n /**\n * Sets segment's index value\n *\n * @param index Segment's index within wrapping segmented button\n */\n setIndex(index: number) {\n this.index = index;\n }\n\n /**\n * Sets segment's isSingleSelect value\n *\n * @param isSingleSelect True if wrapping segmented button is single select\n */\n setIsSingleSelect(isSingleSelect: boolean) {\n this.isSingleSelect = isSingleSelect;\n }\n\n /**\n * @return Returns true if segment is currently selected, otherwise returns\n * false\n */\n isSelected(): boolean {\n return this.foundation.isSelected();\n }\n\n /**\n * Sets segment to be selected\n */\n setSelected() {\n this.foundation.setSelected();\n }\n\n /**\n * Sets segment to be not selected\n */\n setUnselected() {\n this.foundation.setUnselected();\n }\n\n /**\n * @return Returns segment's segmentId if it was set by client\n */\n getSegmentId(): string|undefined {\n return this.foundation.getSegmentId();\n }\n}\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * Boolean strings for segment\n */\nexport const booleans = {\n TRUE: 'true',\n FALSE: 'false'\n};\n\n/**\n * Attributes referenced by segment\n */\nexport const attributes = {\n ARIA_CHECKED: 'aria-checked',\n ARIA_PRESSED: 'aria-pressed',\n DATA_SEGMENT_ID: 'data-segment-id'\n};\n\n/**\n * Events received or emitted by segment\n */\nexport const events = {\n CLICK: 'click',\n SELECTED: 'selected'\n};\n\n/**\n * Style classes for segment\n */\nexport const cssClasses = {\n SELECTED: 'mdc-segmented-button__segment--selected'\n};\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\n\nimport {MDCSegmentedButtonSegmentAdapter} from './adapter';\nimport {attributes, booleans, cssClasses} from './constants';\n\nconst emptyClientRect = {\n bottom: 0,\n height: 0,\n left: 0,\n right: 0,\n top: 0,\n width: 0,\n};\n\nexport class MDCSegmentedButtonSegmentFoundation extends\n MDCFoundation<MDCSegmentedButtonSegmentAdapter> {\n static get defaultAdapter(): MDCSegmentedButtonSegmentAdapter {\n return {\n isSingleSelect: () => false, getAttr: () => '', setAttr: () => undefined,\n addClass: () => undefined, removeClass: () => undefined,\n hasClass: () => false,\n notifySelectedChange: () => undefined,\n getRootBoundingClientRect: () => emptyClientRect,\n }\n }\n\n constructor(adapter?: Partial<MDCSegmentedButtonSegmentAdapter>) {\n super({...MDCSegmentedButtonSegmentFoundation.defaultAdapter, ...adapter});\n }\n\n /**\n * @return Returns true if segment is currently selected, otherwise returns\n * false\n */\n isSelected(): boolean {\n return this.adapter.hasClass(cssClasses.SELECTED);\n }\n\n /**\n * Sets segment to be selected\n */\n setSelected() {\n this.adapter.addClass(cssClasses.SELECTED);\n this.setAriaAttr(booleans.TRUE);\n }\n\n /**\n * Sets segment to be not selected\n */\n setUnselected() {\n this.adapter.removeClass(cssClasses.SELECTED);\n this.setAriaAttr(booleans.FALSE);\n }\n\n /**\n * @return Returns segment's segmentId if it was set by client\n */\n getSegmentId(): string|undefined {\n return this.adapter.getAttr(attributes.DATA_SEGMENT_ID) ?? undefined;\n }\n\n /**\n * Called when segment is clicked. If the wrapping segmented button is single\n * select, doesn't allow segment to be set to not selected. Otherwise, toggles\n * segment's selected status. Finally, emits event to wrapping segmented\n * button.\n *\n * @event selected With detail - SegmentDetail\n */\n handleClick(): void {\n if (this.adapter.isSingleSelect()) {\n this.setSelected();\n } else {\n this.toggleSelection();\n }\n this.adapter.notifySelectedChange(this.isSelected());\n }\n\n /**\n * @return Returns bounding rectangle for ripple effect\n */\n getDimensions(): ClientRect {\n return this.adapter.getRootBoundingClientRect();\n }\n\n /**\n * Sets segment from not selected to selected, or selected to not selected\n */\n private toggleSelection() {\n if (this.isSelected()) {\n this.setUnselected();\n } else {\n this.setSelected();\n }\n }\n\n /**\n * Sets appropriate aria attribute, based on wrapping segmented button's\n * single selected value, to new value\n *\n * @param value Value that represents selected status\n */\n private setAriaAttr(value: string) {\n if (this.adapter.isSingleSelect()) {\n this.adapter.setAttr(attributes.ARIA_CHECKED, value);\n } else {\n this.adapter.setAttr(attributes.ARIA_PRESSED, value);\n }\n }\n}\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './foundation';\nexport * from './component';\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {CustomEventListener} from '@material/base/types';\n\nimport {MDCSegmentedButtonSegment, MDCSegmentedButtonSegmentFactory} from '../segment/component';\nimport {MDCSegmentedButtonEvent, SegmentDetail} from '../types';\n\nimport {MDCSegmentedButtonAdapter} from './adapter';\nimport {events, selectors} from './constants';\nimport {MDCSegmentedButtonFoundation} from './foundation';\n\n// TODO(b/152410470): Remove trailing underscores from private properties\n// tslint:disable:strip-private-property-underscore\n\nexport class MDCSegmentedButton extends\n MDCComponent<MDCSegmentedButtonFoundation> {\n static attachTo(root: Element): MDCSegmentedButton {\n return new MDCSegmentedButton(root);\n }\n\n get segments(): ReadonlyArray<MDCSegmentedButtonSegment> {\n return this.segments_.slice();\n }\n\n private segments_!: MDCSegmentedButtonSegment[]; // assigned in initialize\n private segmentFactory!:\n (el: Element) => MDCSegmentedButtonSegment; // assigned in initialize\n private handleSelected!:\n CustomEventListener<MDCSegmentedButtonEvent>; // assigned in\n // initialSyncWithDOM\n\n initialize(\n segmentFactory: MDCSegmentedButtonSegmentFactory = (el) =>\n new MDCSegmentedButtonSegment(el)) {\n this.segmentFactory = segmentFactory;\n this.segments_ = this.instantiateSegments(this.segmentFactory);\n }\n\n /**\n * @param segmentFactory Factory to create new child segments\n * @return Returns list of child segments found in DOM\n */\n private instantiateSegments(segmentFactory: MDCSegmentedButtonSegmentFactory):\n MDCSegmentedButtonSegment[] {\n const segmentElements: Element[] =\n [].slice.call(this.root.querySelectorAll(selectors.SEGMENT));\n return segmentElements.map((el: Element) => segmentFactory(el));\n }\n\n initialSyncWithDOM() {\n this.handleSelected = (event) => {\n this.foundation.handleSelected(event.detail);\n };\n this.listen(events.SELECTED, this.handleSelected);\n\n const isSingleSelect = this.foundation.isSingleSelect();\n this.segments_.forEach((segment, index: number) => {\n segment.setIndex(index);\n segment.setIsSingleSelect(isSingleSelect);\n });\n\n const selectedSegments =\n this.segments_.filter((segment) => segment.isSelected());\n if (isSingleSelect && selectedSegments.length == 0 &&\n this.segments_.length > 0) {\n throw new Error(\n 'No segment selected in singleSelect mdc-segmented-button');\n } else if (isSingleSelect && selectedSegments.length > 1) {\n throw new Error(\n 'Multiple segments selected in singleSelect mdc-segmented-button');\n }\n }\n\n destroy() {\n this.segments_.forEach((segment) => {\n segment.destroy();\n });\n\n this.unlisten(events.SELECTED, this.handleSelected);\n\n super.destroy();\n }\n\n getDefaultFoundation(): MDCSegmentedButtonFoundation {\n const adapter: MDCSegmentedButtonAdapter = {\n hasClass: (className) => {\n return this.root.classList.contains(className);\n },\n getSegments: () => {\n return this.mappedSegments();\n },\n selectSegment: (indexOrSegmentId) => {\n const segmentDetail = this.mappedSegments().find(\n (_segmentDetail) => _segmentDetail.index === indexOrSegmentId ||\n _segmentDetail.segmentId === indexOrSegmentId);\n if (segmentDetail) {\n this.segments_[segmentDetail.index].setSelected();\n }\n },\n unselectSegment: (indexOrSegmentId) => {\n const segmentDetail = this.mappedSegments().find(\n (_segmentDetail) => _segmentDetail.index === indexOrSegmentId ||\n _segmentDetail.segmentId === indexOrSegmentId);\n if (segmentDetail) {\n this.segments_[segmentDetail.index].setUnselected();\n }\n },\n notifySelectedChange: (detail) => {\n this.emit<SegmentDetail>(\n events.CHANGE, detail, true /* shouldBubble */\n );\n }\n };\n return new MDCSegmentedButtonFoundation(adapter);\n }\n\n /**\n * @return Returns readonly list of selected child segments as SegmentDetails\n */\n getSelectedSegments(): readonly SegmentDetail[] {\n return this.foundation.getSelectedSegments();\n }\n\n /**\n * Sets identified segment to be selected\n *\n * @param indexOrSegmentId Number index or string segmentId that identifies\n * child segment\n */\n selectSegment(indexOrSegmentId: number|string) {\n this.foundation.selectSegment(indexOrSegmentId);\n }\n\n /**\n * Sets identified segment to be not selected\n *\n * @param indexOrSegmentId Number index or string segmentId that identifies\n * child segment\n */\n unselectSegment(indexOrSegmentId: number|string) {\n this.foundation.unselectSegment(indexOrSegmentId);\n }\n\n /**\n * @param indexOrSegmentId Number index or string segmentId that identifies\n * child segment\n * @return Returns true if identified child segment is currently selected,\n * otherwise returns false\n */\n isSegmentSelected(indexOrSegmentId: number|string): boolean {\n return this.foundation.isSegmentSelected(indexOrSegmentId);\n }\n\n /**\n * @return Returns child segments mapped to readonly SegmentDetail list\n */\n private mappedSegments(): readonly SegmentDetail[] {\n return this.segments_.map(\n (segment: MDCSegmentedButtonSegment, index: number) => {\n return {\n index,\n selected: segment.isSelected(),\n segmentId: segment.getSegmentId()\n };\n });\n }\n}\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * Selectors used by segmented-button\n */\nexport const selectors = {\n SEGMENT: '.mdc-segmented-button__segment'\n};\n\n/**\n * Events received or emitted by segmented-button\n */\nexport const events = {\n SELECTED: 'selected',\n CHANGE: 'change'\n};\n\n/**\n * Style classes for segmented-button\n */\nexport const cssClasses = {\n SINGLE_SELECT: 'mdc-segmented-button--single-select'\n};\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\n\nimport {SegmentDetail} from '../types';\n\nimport {MDCSegmentedButtonAdapter} from './adapter';\nimport {cssClasses} from './constants';\n\nexport class MDCSegmentedButtonFoundation extends\n MDCFoundation<MDCSegmentedButtonAdapter> {\n static get defaultAdapter(): MDCSegmentedButtonAdapter {\n return {\n hasClass: () => false, getSegments: () => [],\n selectSegment: () => undefined,\n unselectSegment: () => undefined,\n notifySelectedChange: () => undefined\n }\n }\n\n constructor(adapter?: Partial<MDCSegmentedButtonAdapter>) {\n super({...MDCSegmentedButtonFoundation.defaultAdapter, ...adapter});\n }\n\n /**\n * Sets identified child segment to be selected\n *\n * @param indexOrSegmentId Number index or string segmentId that identifies\n * child segment\n */\n selectSegment(indexOrSegmentId: number|string) {\n this.adapter.selectSegment(indexOrSegmentId);\n }\n\n /**\n * Sets identified child segment to be not selected\n *\n * @param indexOrSegmentId Number index or string segmentId that identifies\n * child segment\n */\n unselectSegment(indexOrSegmentId: number|string) {\n this.adapter.unselectSegment(indexOrSegmentId);\n }\n\n /**\n * @return Returns currently selected child segments as readonly list of\n * SegmentDetails\n */\n getSelectedSegments(): readonly SegmentDetail[] {\n return this.adapter.getSegments().filter(\n segmentDetail => segmentDetail.selected);\n }\n\n /**\n * @param indexOrSegmentId Number index or string segmentId that identifies\n * child segment\n * @return Returns true if identified child segment is currently selected,\n * otherwise returns false\n */\n isSegmentSelected(indexOrSegmentId: number|string): boolean {\n return this.adapter.getSegments().some(\n segmentDetail => (segmentDetail.index === indexOrSegmentId ||\n segmentDetail.segmentId === indexOrSegmentId) &&\n segmentDetail.selected);\n }\n\n /**\n * @return Returns true if segmented button is single select, otherwise\n * returns false\n */\n isSingleSelect(): boolean {\n return this.adapter.hasClass(cssClasses.SINGLE_SELECT);\n }\n\n /**\n * Called when child segment's selected status may have changed. If segmented\n * button is single select, unselects all child segments other than identified\n * child segment. Finally, emits event to client.\n *\n * @param detail Child segment affected represented as SegmentDetail\n * @event change With detail - SegmentDetail\n */\n handleSelected(detail: SegmentDetail) {\n if (this.isSingleSelect()) {\n this.unselectPrevSelected(detail.index);\n }\n this.adapter.notifySelectedChange(detail);\n }\n\n /**\n * Sets all child segments to be not selected except for child segment\n * identified by index\n *\n * @param index Index of child segment to not unselect\n */\n private unselectPrevSelected(index: number) {\n for (let selectedSegment of this.getSelectedSegments()) {\n if (selectedSegment.index !== index) {\n this.unselectSegment(selectedSegment.index);\n }\n }\n }\n}\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './foundation';\nexport * from './component';\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {CustomEventListener, SpecificEventListener} from '@material/base/types';\nimport {MDCFloatingLabel, MDCFloatingLabelFactory} from '@material/floating-label/component';\nimport {MDCLineRipple, MDCLineRippleFactory} from '@material/line-ripple/component';\nimport * as menuSurfaceConstants from '@material/menu-surface/constants';\nimport {MDCMenu, MDCMenuFactory} from '@material/menu/component';\nimport * as menuConstants from '@material/menu/constants';\nimport {MDCMenuItemEvent} from '@material/menu/types';\nimport {MDCNotchedOutline, MDCNotchedOutlineFactory} from '@material/notched-outline/component';\nimport {MDCRippleAdapter} from '@material/ripple/adapter';\nimport {MDCRipple} from '@material/ripple/component';\nimport {MDCRippleFoundation} from '@material/ripple/foundation';\nimport {MDCSelectAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\nimport {MDCSelectFoundation} from './foundation';\nimport {MDCSelectHelperText, MDCSelectHelperTextFactory} from './helper-text/component';\nimport {MDCSelectIcon, MDCSelectIconFactory} from './icon/component';\nimport {MDCSelectEventDetail, MDCSelectFoundationMap} from './types';\n\nexport class MDCSelect extends MDCComponent<MDCSelectFoundation> {\n static attachTo(root: Element): MDCSelect {\n return new MDCSelect(root);\n }\n\n private ripple!: MDCRipple|null;\n\n private menu!: MDCMenu; // assigned in menuSetup()\n\n private selectAnchor!: HTMLElement; // assigned in initialize()\n private selectedText!: HTMLElement; // assigned in initialize()\n private hiddenInput!: HTMLInputElement|null; // assigned in initialize()\n\n private menuElement!: Element; // assigned in menuSetup()\n private menuItemValues!: string[]; // assigned in menuSetup()\n private leadingIcon?: MDCSelectIcon; // assigned in initialize()\n private helperText!: MDCSelectHelperText|null; // assigned in initialize()\n private lineRipple!: MDCLineRipple|null; // assigned in initialize()\n private label!: MDCFloatingLabel|null; // assigned in initialize()\n private outline!: MDCNotchedOutline|null; // assigned in initialize()\n\n // Event handlers\n private handleFocus!: SpecificEventListener<'focus'>;\n private handleBlur!: SpecificEventListener<'blur'>;\n private handleClick!: SpecificEventListener<'click'>;\n private handleKeydown!: SpecificEventListener<'keydown'>;\n private handleMenuOpened!: EventListener;\n private handleMenuClosed!: EventListener;\n private handleMenuClosing!: EventListener;\n private handleMenuItemAction!: CustomEventListener<MDCMenuItemEvent>;\n\n initialize(\n labelFactory: MDCFloatingLabelFactory = (el) => new MDCFloatingLabel(el),\n lineRippleFactory: MDCLineRippleFactory = (el) => new MDCLineRipple(el),\n outlineFactory: MDCNotchedOutlineFactory = (el) => new MDCNotchedOutline(el),\n menuFactory: MDCMenuFactory = (el) => new MDCMenu(el),\n iconFactory: MDCSelectIconFactory = (el) => new MDCSelectIcon(el),\n helperTextFactory: MDCSelectHelperTextFactory = (el) => new MDCSelectHelperText(el),\n ) {\n this.selectAnchor =\n this.root.querySelector(strings.SELECT_ANCHOR_SELECTOR) as HTMLElement;\n this.selectedText =\n this.root.querySelector(strings.SELECTED_TEXT_SELECTOR) as HTMLElement;\n this.hiddenInput = this.root.querySelector(strings.HIDDEN_INPUT_SELECTOR) as\n HTMLInputElement;\n\n if (!this.selectedText) {\n throw new Error(\n 'MDCSelect: Missing required element: The following selector must be present: ' +\n `'${strings.SELECTED_TEXT_SELECTOR}'`,\n );\n }\n\n if (this.selectAnchor.hasAttribute(strings.ARIA_CONTROLS)) {\n const helperTextElement = document.getElementById(\n this.selectAnchor.getAttribute(strings.ARIA_CONTROLS)!);\n if (helperTextElement) {\n this.helperText = helperTextFactory(helperTextElement);\n }\n }\n\n this.menuSetup(menuFactory);\n\n const labelElement = this.root.querySelector(strings.LABEL_SELECTOR);\n this.label = labelElement ? labelFactory(labelElement) : null;\n\n const lineRippleElement =\n this.root.querySelector(strings.LINE_RIPPLE_SELECTOR);\n this.lineRipple =\n lineRippleElement ? lineRippleFactory(lineRippleElement) : null;\n\n const outlineElement = this.root.querySelector(strings.OUTLINE_SELECTOR);\n this.outline = outlineElement ? outlineFactory(outlineElement) : null;\n\n const leadingIcon = this.root.querySelector(strings.LEADING_ICON_SELECTOR);\n if (leadingIcon) {\n this.leadingIcon = iconFactory(leadingIcon);\n }\n\n if (!this.root.classList.contains(cssClasses.OUTLINED)) {\n this.ripple = this.createRipple();\n }\n }\n\n /**\n * Initializes the select's event listeners and internal state based\n * on the environment's state.\n */\n initialSyncWithDOM() {\n this.handleFocus = () => {\n this.foundation.handleFocus();\n };\n this.handleBlur = () => {\n this.foundation.handleBlur();\n };\n this.handleClick = (evt) => {\n this.selectAnchor.focus();\n this.foundation.handleClick(this.getNormalizedXCoordinate(evt));\n };\n this.handleKeydown = (evt) => {\n this.foundation.handleKeydown(evt);\n };\n this.handleMenuItemAction = (evt) => {\n this.foundation.handleMenuItemAction(evt.detail.index);\n };\n this.handleMenuOpened = () => {\n this.foundation.handleMenuOpened();\n };\n this.handleMenuClosed = () => {\n this.foundation.handleMenuClosed();\n };\n this.handleMenuClosing = () => {\n this.foundation.handleMenuClosing();\n };\n\n this.selectAnchor.addEventListener('focus', this.handleFocus);\n this.selectAnchor.addEventListener('blur', this.handleBlur);\n\n this.selectAnchor.addEventListener(\n 'click', this.handleClick as EventListener);\n\n this.selectAnchor.addEventListener('keydown', this.handleKeydown);\n this.menu.listen(\n menuSurfaceConstants.strings.CLOSED_EVENT, this.handleMenuClosed);\n this.menu.listen(\n menuSurfaceConstants.strings.CLOSING_EVENT, this.handleMenuClosing);\n this.menu.listen(\n menuSurfaceConstants.strings.OPENED_EVENT, this.handleMenuOpened);\n this.menu.listen(\n menuConstants.strings.SELECTED_EVENT, this.handleMenuItemAction);\n\n if (this.hiddenInput) {\n if (this.hiddenInput.value) {\n // If the hidden input already has a value, use it to restore the\n // select's value. This can happen e.g. if the user goes back or (in\n // some browsers) refreshes the page.\n this.foundation.setValue(\n this.hiddenInput.value, /** skipNotify */ true);\n this.foundation.layout();\n return;\n }\n\n this.hiddenInput.value = this.value;\n }\n }\n\n destroy() {\n this.selectAnchor.removeEventListener('focus', this.handleFocus);\n this.selectAnchor.removeEventListener('blur', this.handleBlur);\n this.selectAnchor.removeEventListener('keydown', this.handleKeydown);\n this.selectAnchor.removeEventListener(\n 'click', this.handleClick as EventListener);\n\n this.menu.unlisten(\n menuSurfaceConstants.strings.CLOSED_EVENT, this.handleMenuClosed);\n this.menu.unlisten(\n menuSurfaceConstants.strings.OPENED_EVENT, this.handleMenuOpened);\n this.menu.unlisten(\n menuConstants.strings.SELECTED_EVENT, this.handleMenuItemAction);\n this.menu.destroy();\n\n if (this.ripple) {\n this.ripple.destroy();\n }\n if (this.outline) {\n this.outline.destroy();\n }\n if (this.leadingIcon) {\n this.leadingIcon.destroy();\n }\n if (this.helperText) {\n this.helperText.destroy();\n }\n\n super.destroy();\n }\n\n get value(): string {\n return this.foundation.getValue();\n }\n\n set value(value: string) {\n this.foundation.setValue(value);\n }\n\n get selectedIndex(): number {\n return this.foundation.getSelectedIndex();\n }\n\n set selectedIndex(selectedIndex: number) {\n this.foundation.setSelectedIndex(selectedIndex, /** closeMenu */ true);\n }\n\n get disabled(): boolean {\n return this.foundation.getDisabled();\n }\n\n set disabled(disabled: boolean) {\n this.foundation.setDisabled(disabled);\n if (this.hiddenInput) {\n this.hiddenInput.disabled = disabled;\n }\n }\n\n set leadingIconAriaLabel(label: string) {\n this.foundation.setLeadingIconAriaLabel(label);\n }\n\n /**\n * Sets the text content of the leading icon.\n */\n set leadingIconContent(content: string) {\n this.foundation.setLeadingIconContent(content);\n }\n\n /**\n * Sets the text content of the helper text.\n */\n set helperTextContent(content: string) {\n this.foundation.setHelperTextContent(content);\n }\n\n /**\n * Enables or disables the default validation scheme where a required select\n * must be non-empty. Set to false for custom validation.\n * @param useDefaultValidation Set this to false to ignore default\n * validation scheme.\n */\n set useDefaultValidation(useDefaultValidation: boolean) {\n this.foundation.setUseDefaultValidation(useDefaultValidation);\n }\n\n /**\n * Sets the current invalid state of the select.\n */\n set valid(isValid: boolean) {\n this.foundation.setValid(isValid);\n }\n\n /**\n * Checks if the select is in a valid state.\n */\n get valid(): boolean {\n return this.foundation.isValid();\n }\n\n /**\n * Sets the control to the required state.\n */\n set required(isRequired: boolean) {\n this.foundation.setRequired(isRequired);\n }\n\n /**\n * Returns whether the select is required.\n */\n get required(): boolean {\n return this.foundation.getRequired();\n }\n\n /**\n * Re-calculates if the notched outline should be notched and if the label\n * should float.\n */\n layout() {\n this.foundation.layout();\n }\n\n /**\n * Synchronizes the list of options with the state of the foundation. Call\n * this whenever menu options are dynamically updated.\n */\n layoutOptions() {\n this.foundation.layoutOptions();\n this.menu.layout();\n // Update cached menuItemValues for adapter.\n this.menuItemValues =\n this.menu.items.map((el) => el.getAttribute(strings.VALUE_ATTR) || '');\n\n if (this.hiddenInput) {\n this.hiddenInput.value = this.value;\n }\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCSelectAdapter = {\n ...this.getSelectAdapterMethods(),\n ...this.getCommonAdapterMethods(),\n ...this.getOutlineAdapterMethods(),\n ...this.getLabelAdapterMethods(),\n };\n return new MDCSelectFoundation(adapter, this.getFoundationMap());\n }\n\n /**\n * Handles setup for the menu.\n */\n private menuSetup(menuFactory: MDCMenuFactory) {\n this.menuElement = this.root.querySelector(strings.MENU_SELECTOR)!;\n this.menu = menuFactory(this.menuElement);\n this.menu.hasTypeahead = true;\n this.menu.singleSelection = true;\n this.menuItemValues =\n this.menu.items.map((el) => el.getAttribute(strings.VALUE_ATTR) || '');\n }\n\n private createRipple(): MDCRipple {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCRippleAdapter = {\n ...MDCRipple.createAdapter({root: this.selectAnchor}),\n registerInteractionHandler: (evtType, handler) => {\n this.selectAnchor.addEventListener(evtType, handler);\n },\n deregisterInteractionHandler: (evtType, handler) => {\n this.selectAnchor.removeEventListener(evtType, handler);\n },\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCRipple(this.selectAnchor, new MDCRippleFoundation(adapter));\n }\n\n private getSelectAdapterMethods() {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n getMenuItemAttr: (menuItem: Element, attr: string) =>\n menuItem.getAttribute(attr),\n setSelectedText: (text: string) => {\n this.selectedText.textContent = text;\n },\n isSelectAnchorFocused: () => document.activeElement === this.selectAnchor,\n getSelectAnchorAttr: (attr: string) =>\n this.selectAnchor.getAttribute(attr),\n setSelectAnchorAttr: (attr: string, value: string) => {\n this.selectAnchor.setAttribute(attr, value);\n },\n removeSelectAnchorAttr: (attr: string) => {\n this.selectAnchor.removeAttribute(attr);\n },\n addMenuClass: (className: string) => {\n this.menuElement.classList.add(className);\n },\n removeMenuClass: (className: string) => {\n this.menuElement.classList.remove(className);\n },\n openMenu: () => {\n this.menu.open = true;\n },\n closeMenu: () => {\n this.menu.open = false;\n },\n getAnchorElement: () =>\n this.root.querySelector(strings.SELECT_ANCHOR_SELECTOR)!,\n setMenuAnchorElement: (anchorEl: HTMLElement) => {\n this.menu.setAnchorElement(anchorEl);\n },\n setMenuAnchorCorner: (anchorCorner: menuSurfaceConstants.Corner) => {\n this.menu.setAnchorCorner(anchorCorner);\n },\n setMenuWrapFocus: (wrapFocus: boolean) => {\n this.menu.wrapFocus = wrapFocus;\n },\n getSelectedIndex: () => {\n const index = this.menu.selectedIndex;\n return index instanceof Array ? index[0] : index;\n },\n setSelectedIndex: (index: number) => {\n this.menu.selectedIndex = index;\n },\n focusMenuItemAtIndex: (index: number) => {\n (this.menu.items[index] as HTMLElement).focus();\n },\n getMenuItemCount: () => this.menu.items.length,\n // Cache menu item values. layoutOptions() updates this cache.\n getMenuItemValues: () => this.menuItemValues,\n getMenuItemTextAtIndex: (index: number) =>\n this.menu.getPrimaryTextAtIndex(index),\n isTypeaheadInProgress: () => this.menu.typeaheadInProgress,\n typeaheadMatchItem: (nextChar: string, startingIndex: number) =>\n this.menu.typeaheadMatchItem(nextChar, startingIndex),\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private getCommonAdapterMethods() {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: (className: string) => {\n this.root.classList.add(className);\n },\n removeClass: (className: string) => {\n this.root.classList.remove(className);\n },\n hasClass: (className: string) => this.root.classList.contains(className),\n setRippleCenter: (normalizedX: number) => {\n this.lineRipple && this.lineRipple.setRippleCenter(normalizedX)\n },\n activateBottomLine: () => {\n this.lineRipple && this.lineRipple.activate();\n },\n deactivateBottomLine: () => {\n this.lineRipple && this.lineRipple.deactivate();\n },\n notifyChange: (value: string) => {\n const index = this.selectedIndex;\n this.emit<MDCSelectEventDetail>(strings.CHANGE_EVENT, {value, index}, true /* shouldBubble */);\n\n if (this.hiddenInput) {\n this.hiddenInput.value = value;\n }\n },\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private getOutlineAdapterMethods() {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n hasOutline: () => Boolean(this.outline),\n notchOutline: (labelWidth: number) => {\n this.outline && this.outline.notch(labelWidth);\n },\n closeOutline: () => {\n this.outline && this.outline.closeNotch();\n },\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private getLabelAdapterMethods() {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n hasLabel: () => !!this.label,\n floatLabel: (shouldFloat: boolean) => {\n this.label && this.label.float(shouldFloat);\n },\n getLabelWidth: () => this.label ? this.label.getWidth() : 0,\n setLabelRequired: (isRequired: boolean) => {\n this.label && this.label.setRequired(isRequired);\n },\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n /**\n * Calculates where the line ripple should start based on the x coordinate within the component.\n */\n private getNormalizedXCoordinate(evt: MouseEvent|TouchEvent): number {\n const targetClientRect = (evt.target as Element).getBoundingClientRect();\n const xCoordinate =\n this.isTouchEvent(evt) ? evt.touches[0].clientX : evt.clientX;\n return xCoordinate - targetClientRect.left;\n }\n\n private isTouchEvent(evt: MouseEvent|TouchEvent): evt is TouchEvent {\n return Boolean((evt as TouchEvent).touches);\n }\n\n /**\n * Returns a map of all subcomponents to subfoundations.\n */\n private getFoundationMap(): Partial<MDCSelectFoundationMap> {\n return {\n helperText: this.helperText ? this.helperText.foundationForSelect :\n undefined,\n leadingIcon: this.leadingIcon ? this.leadingIcon.foundationForSelect :\n undefined,\n };\n }\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst cssClasses = {\n ACTIVATED: 'mdc-select--activated',\n DISABLED: 'mdc-select--disabled',\n FOCUSED: 'mdc-select--focused',\n INVALID: 'mdc-select--invalid',\n MENU_INVALID: 'mdc-select__menu--invalid',\n OUTLINED: 'mdc-select--outlined',\n REQUIRED: 'mdc-select--required',\n ROOT: 'mdc-select',\n WITH_LEADING_ICON: 'mdc-select--with-leading-icon',\n};\n\nconst strings = {\n ARIA_CONTROLS: 'aria-controls',\n ARIA_DESCRIBEDBY: 'aria-describedby',\n ARIA_SELECTED_ATTR: 'aria-selected',\n CHANGE_EVENT: 'MDCSelect:change',\n HIDDEN_INPUT_SELECTOR: 'input[type=\"hidden\"]',\n LABEL_SELECTOR: '.mdc-floating-label',\n LEADING_ICON_SELECTOR: '.mdc-select__icon',\n LINE_RIPPLE_SELECTOR: '.mdc-line-ripple',\n MENU_SELECTOR: '.mdc-select__menu',\n OUTLINE_SELECTOR: '.mdc-notched-outline',\n SELECTED_TEXT_SELECTOR: '.mdc-select__selected-text',\n SELECT_ANCHOR_SELECTOR: '.mdc-select__anchor',\n VALUE_ATTR: 'data-value',\n};\n\nconst numbers = {\n LABEL_SCALE: 0.75,\n UNSET_INDEX: -1,\n CLICK_DEBOUNCE_TIMEOUT_MS: 330,\n};\n\nexport {cssClasses, strings, numbers};\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {KEY, normalizeKey} from '@material/dom/keyboard';\nimport {Corner} from '@material/menu-surface/constants';\n\nimport {MDCSelectAdapter} from './adapter';\nimport {cssClasses, numbers, strings} from './constants';\nimport {MDCSelectHelperTextFoundation} from './helper-text/foundation';\nimport {MDCSelectIconFoundation} from './icon/foundation';\nimport {MDCSelectFoundationMap} from './types';\n\nexport class MDCSelectFoundation extends MDCFoundation<MDCSelectAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get numbers() {\n return numbers;\n }\n\n static get strings() {\n return strings;\n }\n\n /**\n * See {@link MDCSelectAdapter} for typing information on parameters and return types.\n */\n static get defaultAdapter(): MDCSelectAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: () => undefined,\n removeClass: () => undefined,\n hasClass: () => false,\n activateBottomLine: () => undefined,\n deactivateBottomLine: () => undefined,\n getSelectedIndex: () => -1,\n setSelectedIndex: () => undefined,\n hasLabel: () => false,\n floatLabel: () => undefined,\n getLabelWidth: () => 0,\n setLabelRequired: () => undefined,\n hasOutline: () => false,\n notchOutline: () => undefined,\n closeOutline: () => undefined,\n setRippleCenter: () => undefined,\n notifyChange: () => undefined,\n setSelectedText: () => undefined,\n isSelectAnchorFocused: () => false,\n getSelectAnchorAttr: () => '',\n setSelectAnchorAttr: () => undefined,\n removeSelectAnchorAttr: () => undefined,\n addMenuClass: () => undefined,\n removeMenuClass: () => undefined,\n openMenu: () => undefined,\n closeMenu: () => undefined,\n getAnchorElement: () => null,\n setMenuAnchorElement: () => undefined,\n setMenuAnchorCorner: () => undefined,\n setMenuWrapFocus: () => undefined,\n focusMenuItemAtIndex: () => undefined,\n getMenuItemCount: () => 0,\n getMenuItemValues: () => [],\n getMenuItemTextAtIndex: () => '',\n isTypeaheadInProgress: () => false,\n typeaheadMatchItem: () => -1,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private readonly leadingIcon: MDCSelectIconFoundation|undefined;\n private readonly helperText: MDCSelectHelperTextFoundation|undefined;\n\n // Disabled state\n private disabled = false;\n // isMenuOpen is used to track the state of the menu by listening to the\n // MDCMenuSurface:closed event For reference, menu.open will return false if\n // the menu is still closing, but isMenuOpen returns false only after the menu\n // has closed\n private isMenuOpen = false;\n // By default, select is invalid if it is required but no value is selected.\n private useDefaultValidation = true;\n private customValidity = true;\n private lastSelectedIndex = numbers.UNSET_INDEX;\n\n private clickDebounceTimeout = 0;\n private recentlyClicked = false;\n\n /* istanbul ignore next: optional argument is not a branch statement */\n /**\n * @param adapter\n * @param foundationMap Map from subcomponent names to their subfoundations.\n */\n constructor(adapter?: Partial<MDCSelectAdapter>, foundationMap: Partial<MDCSelectFoundationMap> = {}) {\n super({...MDCSelectFoundation.defaultAdapter, ...adapter});\n\n this.leadingIcon = foundationMap.leadingIcon;\n this.helperText = foundationMap.helperText;\n }\n\n /** Returns the index of the currently selected menu item, or -1 if none. */\n getSelectedIndex(): number {\n return this.adapter.getSelectedIndex();\n }\n\n setSelectedIndex(index: number, closeMenu = false, skipNotify = false) {\n if (index >= this.adapter.getMenuItemCount()) {\n return;\n }\n\n if (index === numbers.UNSET_INDEX) {\n this.adapter.setSelectedText('');\n } else {\n this.adapter.setSelectedText(\n this.adapter.getMenuItemTextAtIndex(index).trim());\n }\n\n this.adapter.setSelectedIndex(index);\n\n if (closeMenu) {\n this.adapter.closeMenu();\n }\n\n if (!skipNotify && this.lastSelectedIndex !== index) {\n this.handleChange();\n }\n this.lastSelectedIndex = index;\n }\n\n setValue(value: string, skipNotify = false) {\n const index = this.adapter.getMenuItemValues().indexOf(value);\n this.setSelectedIndex(index, /** closeMenu */ false, skipNotify);\n }\n\n getValue() {\n const index = this.adapter.getSelectedIndex();\n const menuItemValues = this.adapter.getMenuItemValues();\n return index !== numbers.UNSET_INDEX ? menuItemValues[index] : '';\n }\n\n getDisabled() {\n return this.disabled;\n }\n\n setDisabled(isDisabled: boolean) {\n this.disabled = isDisabled;\n if (this.disabled) {\n this.adapter.addClass(cssClasses.DISABLED);\n this.adapter.closeMenu();\n } else {\n this.adapter.removeClass(cssClasses.DISABLED);\n }\n\n if (this.leadingIcon) {\n this.leadingIcon.setDisabled(this.disabled);\n }\n\n if (this.disabled) {\n // Prevent click events from focusing select. Simply pointer-events: none\n // is not enough since screenreader clicks may bypass this.\n this.adapter.removeSelectAnchorAttr('tabindex');\n } else {\n this.adapter.setSelectAnchorAttr('tabindex', '0');\n }\n\n this.adapter.setSelectAnchorAttr('aria-disabled', this.disabled.toString());\n }\n\n /** Opens the menu. */\n openMenu() {\n this.adapter.addClass(cssClasses.ACTIVATED);\n this.adapter.openMenu();\n this.isMenuOpen = true;\n this.adapter.setSelectAnchorAttr('aria-expanded', 'true');\n }\n\n /**\n * @param content Sets the content of the helper text.\n */\n setHelperTextContent(content: string) {\n if (this.helperText) {\n this.helperText.setContent(content);\n }\n }\n\n /**\n * Re-calculates if the notched outline should be notched and if the label\n * should float.\n */\n layout() {\n if (this.adapter.hasLabel()) {\n const optionHasValue = this.getValue().length > 0;\n const isFocused = this.adapter.hasClass(cssClasses.FOCUSED);\n const shouldFloatAndNotch = optionHasValue || isFocused;\n const isRequired = this.adapter.hasClass(cssClasses.REQUIRED);\n\n this.notchOutline(shouldFloatAndNotch);\n this.adapter.floatLabel(shouldFloatAndNotch);\n this.adapter.setLabelRequired(isRequired);\n }\n }\n\n /**\n * Synchronizes the list of options with the state of the foundation. Call\n * this whenever menu options are dynamically updated.\n */\n layoutOptions() {\n const menuItemValues = this.adapter.getMenuItemValues();\n const selectedIndex = menuItemValues.indexOf(this.getValue());\n this.setSelectedIndex(\n selectedIndex, /** closeMenu */ false, /** skipNotify */ true);\n }\n\n handleMenuOpened() {\n if (this.adapter.getMenuItemValues().length === 0) {\n return;\n }\n\n // Menu should open to the last selected element, should open to first menu item otherwise.\n const selectedIndex = this.getSelectedIndex();\n const focusItemIndex = selectedIndex >= 0 ? selectedIndex : 0;\n this.adapter.focusMenuItemAtIndex(focusItemIndex);\n }\n\n handleMenuClosing() {\n this.adapter.setSelectAnchorAttr('aria-expanded', 'false');\n }\n\n handleMenuClosed() {\n this.adapter.removeClass(cssClasses.ACTIVATED);\n this.isMenuOpen = false;\n\n // Unfocus the select if menu is closed without a selection\n if (!this.adapter.isSelectAnchorFocused()) {\n this.blur();\n }\n }\n\n /**\n * Handles value changes, via change event or programmatic updates.\n */\n handleChange() {\n this.layout();\n this.adapter.notifyChange(this.getValue());\n\n const isRequired = this.adapter.hasClass(cssClasses.REQUIRED);\n if (isRequired && this.useDefaultValidation) {\n this.setValid(this.isValid());\n }\n }\n\n handleMenuItemAction(index: number) {\n this.setSelectedIndex(index, /** closeMenu */ true);\n }\n\n /**\n * Handles focus events from select element.\n */\n handleFocus() {\n this.adapter.addClass(cssClasses.FOCUSED);\n this.layout();\n\n this.adapter.activateBottomLine();\n }\n\n /**\n * Handles blur events from select element.\n */\n handleBlur() {\n if (this.isMenuOpen) {\n return;\n }\n this.blur();\n }\n\n handleClick(normalizedX: number) {\n if (this.disabled || this.recentlyClicked) {\n return;\n }\n\n this.setClickDebounceTimeout();\n\n if (this.isMenuOpen) {\n this.adapter.closeMenu();\n return;\n }\n\n this.adapter.setRippleCenter(normalizedX);\n\n this.openMenu();\n }\n\n /**\n * Handles keydown events on select element. Depending on the type of\n * character typed, does typeahead matching or opens menu.\n */\n handleKeydown(event: KeyboardEvent) {\n if (this.isMenuOpen || !this.adapter.hasClass(cssClasses.FOCUSED)) {\n return;\n }\n\n const isEnter = normalizeKey(event) === KEY.ENTER;\n const isSpace = normalizeKey(event) === KEY.SPACEBAR;\n const arrowUp = normalizeKey(event) === KEY.ARROW_UP;\n const arrowDown = normalizeKey(event) === KEY.ARROW_DOWN;\n\n // Typeahead\n if (!isSpace && event.key && event.key.length === 1 ||\n isSpace && this.adapter.isTypeaheadInProgress()) {\n const key = isSpace ? ' ' : event.key;\n const typeaheadNextIndex =\n this.adapter.typeaheadMatchItem(key, this.getSelectedIndex());\n if (typeaheadNextIndex >= 0) {\n this.setSelectedIndex(typeaheadNextIndex);\n }\n event.preventDefault();\n return;\n }\n\n if (!isEnter && !isSpace && !arrowUp && !arrowDown) {\n return;\n }\n\n // Increment/decrement index as necessary and open menu.\n if (arrowUp && this.getSelectedIndex() > 0) {\n this.setSelectedIndex(this.getSelectedIndex() - 1);\n } else if (\n arrowDown &&\n this.getSelectedIndex() < this.adapter.getMenuItemCount() - 1) {\n this.setSelectedIndex(this.getSelectedIndex() + 1);\n }\n\n this.openMenu();\n event.preventDefault();\n }\n\n /**\n * Opens/closes the notched outline.\n */\n notchOutline(openNotch: boolean) {\n if (!this.adapter.hasOutline()) {\n return;\n }\n const isFocused = this.adapter.hasClass(cssClasses.FOCUSED);\n\n if (openNotch) {\n const labelScale = numbers.LABEL_SCALE;\n const labelWidth = this.adapter.getLabelWidth() * labelScale;\n this.adapter.notchOutline(labelWidth);\n } else if (!isFocused) {\n this.adapter.closeOutline();\n }\n }\n\n /**\n * Sets the aria label of the leading icon.\n */\n setLeadingIconAriaLabel(label: string) {\n if (this.leadingIcon) {\n this.leadingIcon.setAriaLabel(label);\n }\n }\n\n /**\n * Sets the text content of the leading icon.\n */\n setLeadingIconContent(content: string) {\n if (this.leadingIcon) {\n this.leadingIcon.setContent(content);\n }\n }\n\n setUseDefaultValidation(useDefaultValidation: boolean) {\n this.useDefaultValidation = useDefaultValidation;\n }\n\n setValid(isValid: boolean) {\n if (!this.useDefaultValidation) {\n this.customValidity = isValid;\n }\n\n this.adapter.setSelectAnchorAttr('aria-invalid', (!isValid).toString());\n if (isValid) {\n this.adapter.removeClass(cssClasses.INVALID);\n this.adapter.removeMenuClass(cssClasses.MENU_INVALID);\n } else {\n this.adapter.addClass(cssClasses.INVALID);\n this.adapter.addMenuClass(cssClasses.MENU_INVALID);\n }\n\n this.syncHelperTextValidity(isValid);\n }\n\n isValid() {\n if (this.useDefaultValidation &&\n this.adapter.hasClass(cssClasses.REQUIRED) &&\n !this.adapter.hasClass(cssClasses.DISABLED)) {\n // See notes for required attribute under https://www.w3.org/TR/html52/sec-forms.html#the-select-element\n // TL;DR: Invalid if no index is selected, or if the first index is selected and has an empty value.\n return this.getSelectedIndex() !== numbers.UNSET_INDEX &&\n (this.getSelectedIndex() !== 0 || Boolean(this.getValue()));\n }\n return this.customValidity;\n }\n\n setRequired(isRequired: boolean) {\n if (isRequired) {\n this.adapter.addClass(cssClasses.REQUIRED);\n } else {\n this.adapter.removeClass(cssClasses.REQUIRED);\n }\n this.adapter.setSelectAnchorAttr('aria-required', isRequired.toString());\n this.adapter.setLabelRequired(isRequired);\n }\n\n getRequired() {\n return this.adapter.getSelectAnchorAttr('aria-required') === 'true';\n }\n\n init() {\n const anchorEl = this.adapter.getAnchorElement();\n if (anchorEl) {\n this.adapter.setMenuAnchorElement(anchorEl);\n this.adapter.setMenuAnchorCorner(Corner.BOTTOM_START);\n }\n this.adapter.setMenuWrapFocus(false);\n\n this.setDisabled(this.adapter.hasClass(cssClasses.DISABLED));\n this.syncHelperTextValidity(!this.adapter.hasClass(cssClasses.INVALID));\n this.layout();\n this.layoutOptions();\n }\n\n /**\n * Unfocuses the select component.\n */\n private blur() {\n this.adapter.removeClass(cssClasses.FOCUSED);\n this.layout();\n this.adapter.deactivateBottomLine();\n\n const isRequired = this.adapter.hasClass(cssClasses.REQUIRED);\n if (isRequired && this.useDefaultValidation) {\n this.setValid(this.isValid());\n }\n }\n\n private syncHelperTextValidity(isValid: boolean) {\n if (!this.helperText) {\n return;\n }\n\n this.helperText.setValidity(isValid);\n\n const helperTextVisible = this.helperText.isVisible();\n const helperTextId = this.helperText.getId();\n\n if (helperTextVisible && helperTextId) {\n this.adapter.setSelectAnchorAttr(strings.ARIA_DESCRIBEDBY, helperTextId);\n } else {\n // Needed because screenreaders will read labels pointed to by\n // `aria-describedby` even if they are `aria-hidden`.\n this.adapter.removeSelectAnchorAttr(strings.ARIA_DESCRIBEDBY);\n }\n }\n\n private setClickDebounceTimeout() {\n clearTimeout(this.clickDebounceTimeout);\n this.clickDebounceTimeout = setTimeout(() => {\n this.recentlyClicked = false;\n }, numbers.CLICK_DEBOUNCE_TIMEOUT_MS);\n this.recentlyClicked = true;\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCSelectFoundation;\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {MDCSelectHelperTextAdapter} from './adapter';\nimport {MDCSelectHelperTextFoundation} from './foundation';\n\nexport type MDCSelectHelperTextFactory =\n (el: Element, foundation?: MDCSelectHelperTextFoundation) => MDCSelectHelperText;\n\nexport class MDCSelectHelperText extends MDCComponent<MDCSelectHelperTextFoundation> {\n static attachTo(root: Element): MDCSelectHelperText {\n return new MDCSelectHelperText(root);\n }\n\n // Provided for access by MDCSelect component\n get foundationForSelect(): MDCSelectHelperTextFoundation {\n return this.foundation;\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCSelectHelperTextAdapter = {\n addClass: (className) => this.root.classList.add(className),\n removeClass: (className) => this.root.classList.remove(className),\n hasClass: (className) => this.root.classList.contains(className),\n getAttr: (attr) => this.root.getAttribute(attr),\n setAttr: (attr, value) => this.root.setAttribute(attr, value),\n removeAttr: (attr) => this.root.removeAttribute(attr),\n setContent: (content) => {\n this.root.textContent = content;\n },\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCSelectHelperTextFoundation(adapter);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst strings = {\n ARIA_HIDDEN: 'aria-hidden',\n ROLE: 'role',\n};\n\nconst cssClasses = {\n HELPER_TEXT_VALIDATION_MSG: 'mdc-select-helper-text--validation-msg',\n HELPER_TEXT_VALIDATION_MSG_PERSISTENT:\n 'mdc-select-helper-text--validation-msg-persistent',\n};\n\nexport {strings, cssClasses};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCSelectHelperTextAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\n\nexport class MDCSelectHelperTextFoundation extends MDCFoundation<MDCSelectHelperTextAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n /**\n * See {@link MDCSelectHelperTextAdapter} for typing information on parameters and return types.\n */\n static get defaultAdapter(): MDCSelectHelperTextAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: () => undefined,\n removeClass: () => undefined,\n hasClass: () => false,\n setAttr: () => undefined,\n getAttr: () => null,\n removeAttr: () => undefined,\n setContent: () => undefined,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n constructor(adapter?: Partial<MDCSelectHelperTextAdapter>) {\n super({...MDCSelectHelperTextFoundation.defaultAdapter, ...adapter});\n }\n\n /**\n * @return The ID of the helper text, or null if none is set.\n */\n getId(): string|null {\n return this.adapter.getAttr('id');\n }\n\n /**\n * @return Whether the helper text is currently visible.\n */\n isVisible(): boolean {\n return this.adapter.getAttr(strings.ARIA_HIDDEN) !== 'true';\n }\n\n /**\n * Sets the content of the helper text field.\n */\n setContent(content: string) {\n this.adapter.setContent(content);\n }\n\n /**\n * Sets the helper text to act as a validation message.\n * By default, validation messages are hidden when the select is valid and\n * visible when the select is invalid.\n *\n * @param isValidation True to make the helper text act as an error validation\n * message.\n */\n setValidation(isValidation: boolean) {\n if (isValidation) {\n this.adapter.addClass(cssClasses.HELPER_TEXT_VALIDATION_MSG);\n } else {\n this.adapter.removeClass(cssClasses.HELPER_TEXT_VALIDATION_MSG);\n }\n }\n\n /**\n * Sets the persistency of the validation helper text.\n * This keeps the validation message visible even if the select is valid,\n * though it will be displayed in the normal (grey) color.\n */\n setValidationMsgPersistent(isPersistent: boolean) {\n if (isPersistent) {\n this.adapter.addClass(cssClasses.HELPER_TEXT_VALIDATION_MSG_PERSISTENT);\n } else {\n this.adapter.removeClass(\n cssClasses.HELPER_TEXT_VALIDATION_MSG_PERSISTENT);\n }\n }\n\n /**\n * When acting as a validation message, shows/hides the helper text and\n * triggers alerts as necessary based on the select's validity.\n */\n setValidity(selectIsValid: boolean) {\n const isValidationMsg =\n this.adapter.hasClass(cssClasses.HELPER_TEXT_VALIDATION_MSG);\n\n if (!isValidationMsg) {\n // Non-validating helper-text is always displayed and does not participate\n // in validation logic.\n return;\n }\n\n const isPersistentValidationMsg =\n this.adapter.hasClass(cssClasses.HELPER_TEXT_VALIDATION_MSG_PERSISTENT);\n\n // Validating helper text is displayed if select is invalid, unless it is\n // set as persistent, in which case it always displays.\n const msgShouldDisplay = !selectIsValid || isPersistentValidationMsg;\n if (msgShouldDisplay) {\n this.showToScreenReader();\n\n // In addition to displaying, also trigger an alert if the select\n // has become invalid.\n if (!selectIsValid) {\n this.adapter.setAttr(strings.ROLE, 'alert');\n } else {\n this.adapter.removeAttr(strings.ROLE);\n }\n return;\n }\n\n // Hide everything.\n this.adapter.removeAttr(strings.ROLE);\n this.hide();\n }\n\n /**\n * Makes the helper text visible to screen readers.\n */\n private showToScreenReader() {\n this.adapter.removeAttr(strings.ARIA_HIDDEN);\n }\n\n /**\n * Hides the help text from screen readers.\n */\n private hide() {\n this.adapter.setAttr(strings.ARIA_HIDDEN, 'true');\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCSelectHelperTextFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './foundation';\nexport {cssClasses as helperTextCssClasses, strings as helperTextStrings} from './constants';\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {MDCSelectIconAdapter} from './adapter';\nimport {MDCSelectIconFoundation} from './foundation';\n\nexport type MDCSelectIconFactory = (el: Element, foundation?: MDCSelectIconFoundation) => MDCSelectIcon;\n\nexport class MDCSelectIcon extends MDCComponent<MDCSelectIconFoundation> {\n static attachTo(root: Element): MDCSelectIcon {\n return new MDCSelectIcon(root);\n }\n\n // Provided for access by MDCSelect component\n get foundationForSelect(): MDCSelectIconFoundation {\n return this.foundation;\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCSelectIconAdapter = {\n getAttr: (attr) => this.root.getAttribute(attr),\n setAttr: (attr, value) => this.root.setAttribute(attr, value),\n removeAttr: (attr) => this.root.removeAttribute(attr),\n setContent: (content) => {\n this.root.textContent = content;\n },\n registerInteractionHandler: (evtType, handler) =>\n this.listen(evtType, handler),\n deregisterInteractionHandler: (evtType, handler) =>\n this.unlisten(evtType, handler),\n notifyIconAction: () => this.emit(\n MDCSelectIconFoundation.strings.ICON_EVENT, {} /* evtData */,\n true /* shouldBubble */),\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCSelectIconFoundation(adapter);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst strings = {\n ICON_EVENT: 'MDCSelect:icon',\n ICON_ROLE: 'button',\n};\n\nexport {strings};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {SpecificEventListener} from '@material/base/types';\nimport {MDCSelectIconAdapter} from './adapter';\nimport {strings} from './constants';\n\ntype InteractionEventType = 'click' | 'keydown';\n\nconst INTERACTION_EVENTS: InteractionEventType[] = ['click', 'keydown'];\n\nexport class MDCSelectIconFoundation extends MDCFoundation<MDCSelectIconAdapter> {\n static get strings() {\n return strings;\n }\n\n /**\n * See {@link MDCSelectIconAdapter} for typing information on parameters and return types.\n */\n static get defaultAdapter(): MDCSelectIconAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n getAttr: () => null,\n setAttr: () => undefined,\n removeAttr: () => undefined,\n setContent: () => undefined,\n registerInteractionHandler: () => undefined,\n deregisterInteractionHandler: () => undefined,\n notifyIconAction: () => undefined,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private savedTabIndex_: string | null = null;\n\n // assigned in initialSyncWithDOM()\n private readonly interactionHandler_!: SpecificEventListener<InteractionEventType>;\n\n constructor(adapter?: Partial<MDCSelectIconAdapter>) {\n super({...MDCSelectIconFoundation.defaultAdapter, ...adapter});\n\n this.interactionHandler_ = (evt) => this.handleInteraction(evt);\n }\n\n init() {\n this.savedTabIndex_ = this.adapter.getAttr('tabindex');\n\n INTERACTION_EVENTS.forEach((evtType) => {\n this.adapter.registerInteractionHandler(\n evtType, this.interactionHandler_);\n });\n }\n\n destroy() {\n INTERACTION_EVENTS.forEach((evtType) => {\n this.adapter.deregisterInteractionHandler(\n evtType, this.interactionHandler_);\n });\n }\n\n setDisabled(disabled: boolean) {\n if (!this.savedTabIndex_) {\n return;\n }\n\n if (disabled) {\n this.adapter.setAttr('tabindex', '-1');\n this.adapter.removeAttr('role');\n } else {\n this.adapter.setAttr('tabindex', this.savedTabIndex_);\n this.adapter.setAttr('role', strings.ICON_ROLE);\n }\n }\n\n setAriaLabel(label: string) {\n this.adapter.setAttr('aria-label', label);\n }\n\n setContent(content: string) {\n this.adapter.setContent(content);\n }\n\n handleInteraction(evt: MouseEvent | KeyboardEvent) {\n const isEnterKey = (evt as KeyboardEvent).key === 'Enter' || (evt as KeyboardEvent).keyCode === 13;\n if (evt.type === 'click' || isEnterKey) {\n this.adapter.notifyIconAction();\n }\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCSelectIconFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './foundation';\nexport {strings as iconStrings} from './constants';\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './types';\nexport * from './helper-text/index';\nexport * from './icon/index';\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {EventType, SpecificEventListener} from '@material/base/types';\nimport {applyPassive} from '@material/dom/events';\nimport {matches} from '@material/dom/ponyfill';\nimport {MDCRippleAdapter} from '@material/ripple/adapter';\nimport {MDCRipple} from '@material/ripple/component';\nimport {MDCRippleFoundation} from '@material/ripple/foundation';\n\nimport {MDCSliderAdapter} from './adapter';\nimport {cssClasses, events} from './constants';\nimport {MDCSliderFoundation} from './foundation';\nimport {MDCSliderChangeEventDetail, Thumb, TickMark} from './types';\n\n/** Vanilla JS implementation of slider component. */\nexport class MDCSlider extends MDCComponent<MDCSliderFoundation> {\n static attachTo(root: Element, options: {skipInitialUIUpdate?:\n boolean} = {}) {\n return new MDCSlider(root, undefined, options);\n }\n\n root!: HTMLElement; // Assigned in MDCComponent constructor.\n private inputs!: HTMLInputElement[]; // Assigned in #initialize.\n private thumbs!: HTMLElement[]; // Assigned in #initialize.\n private trackActive!: HTMLElement; // Assigned in #initialize.\n private ripples!: MDCRipple[]; // Assigned in #initialize.\n\n private skipInitialUIUpdate = false;\n // Function that maps a slider value to the value of the `aria-valuetext`\n // attribute on the thumb element.\n private valueToAriaValueTextFn: ((value: number) => string)|null = null;\n\n getDefaultFoundation() {\n // tslint:disable:object-literal-sort-keys Methods should be in the same\n // order as the adapter interface.\n const adapter: MDCSliderAdapter = {\n hasClass: (className) => this.root.classList.contains(className),\n addClass: (className) => {\n this.root.classList.add(className);\n },\n removeClass: (className) => {\n this.root.classList.remove(className);\n },\n addThumbClass: (className, thumb: Thumb) => {\n this.getThumbEl(thumb).classList.add(className);\n },\n removeThumbClass: (className, thumb: Thumb) => {\n this.getThumbEl(thumb).classList.remove(className);\n },\n getAttribute: (attribute) => this.root.getAttribute(attribute),\n getInputValue: (thumb: Thumb) => this.getInput(thumb).value,\n setInputValue: (value: string, thumb: Thumb) => {\n this.getInput(thumb).value = value;\n },\n getInputAttribute: (attribute, thumb: Thumb) =>\n this.getInput(thumb).getAttribute(attribute),\n setInputAttribute: (attribute, value, thumb: Thumb) => {\n this.getInput(thumb).setAttribute(attribute, value);\n },\n removeInputAttribute: (attribute, thumb: Thumb) => {\n this.getInput(thumb).removeAttribute(attribute);\n },\n focusInput: (thumb: Thumb) => {\n this.getInput(thumb).focus();\n },\n isInputFocused: (thumb: Thumb) =>\n this.getInput(thumb) === document.activeElement,\n getThumbKnobWidth: (thumb: Thumb) => {\n return this.getThumbEl(thumb)\n .querySelector<HTMLElement>(`.${cssClasses.THUMB_KNOB}`)!\n .getBoundingClientRect()\n .width;\n },\n getThumbBoundingClientRect: (thumb: Thumb) =>\n this.getThumbEl(thumb).getBoundingClientRect(),\n getBoundingClientRect: () => this.root.getBoundingClientRect(),\n isRTL: () => getComputedStyle(this.root).direction === 'rtl',\n setThumbStyleProperty: (propertyName, value, thumb: Thumb) => {\n this.getThumbEl(thumb).style.setProperty(propertyName, value);\n },\n removeThumbStyleProperty: (propertyName, thumb: Thumb) => {\n this.getThumbEl(thumb).style.removeProperty(propertyName);\n },\n setTrackActiveStyleProperty: (propertyName, value) => {\n this.trackActive.style.setProperty(propertyName, value);\n },\n removeTrackActiveStyleProperty: (propertyName) => {\n this.trackActive.style.removeProperty(propertyName);\n },\n setValueIndicatorText: (value: number, thumb: Thumb) => {\n const valueIndicatorEl =\n this.getThumbEl(thumb).querySelector<HTMLElement>(\n `.${cssClasses.VALUE_INDICATOR_TEXT}`);\n valueIndicatorEl!.textContent = String(value);\n },\n getValueToAriaValueTextFn: () => this.valueToAriaValueTextFn,\n updateTickMarks: (tickMarks: TickMark[]) => {\n let tickMarksContainer = this.root.querySelector<HTMLElement>(\n `.${cssClasses.TICK_MARKS_CONTAINER}`);\n if (!tickMarksContainer) {\n tickMarksContainer = document.createElement('div');\n tickMarksContainer.classList.add(cssClasses.TICK_MARKS_CONTAINER);\n const track =\n this.root.querySelector<HTMLElement>(`.${cssClasses.TRACK}`);\n track!.appendChild(tickMarksContainer);\n }\n\n if (tickMarks.length !== tickMarksContainer.children.length) {\n tickMarksContainer.innerHTML = '';\n this.addTickMarks(tickMarksContainer, tickMarks);\n } else {\n this.updateTickMarks(tickMarksContainer, tickMarks);\n }\n },\n setPointerCapture: (pointerId) => {\n this.root.setPointerCapture(pointerId);\n },\n emitChangeEvent: (value, thumb: Thumb) => {\n this.emit<MDCSliderChangeEventDetail>(events.CHANGE, {value, thumb});\n },\n emitInputEvent: (value, thumb: Thumb) => {\n this.emit<MDCSliderChangeEventDetail>(events.INPUT, {value, thumb});\n },\n emitDragStartEvent: (_, thumb: Thumb) => {\n // Emitting event is not yet implemented. See issue:\n // https://github.com/material-components/material-components-web/issues/6448\n\n this.getRipple(thumb).activate();\n },\n emitDragEndEvent: (_, thumb: Thumb) => {\n // Emitting event is not yet implemented. See issue:\n // https://github.com/material-components/material-components-web/issues/6448\n\n this.getRipple(thumb).deactivate();\n },\n registerEventHandler: (evtType, handler) => {\n this.listen(evtType, handler);\n },\n deregisterEventHandler: (evtType, handler) => {\n this.unlisten(evtType, handler);\n },\n registerThumbEventHandler: (thumb, evtType, handler) => {\n this.getThumbEl(thumb).addEventListener(evtType, handler);\n },\n deregisterThumbEventHandler: (thumb, evtType, handler) => {\n this.getThumbEl(thumb).removeEventListener(evtType, handler);\n },\n registerInputEventHandler: (thumb, evtType, handler) => {\n this.getInput(thumb).addEventListener(evtType, handler);\n },\n deregisterInputEventHandler: (thumb, evtType, handler) => {\n this.getInput(thumb).removeEventListener(evtType, handler);\n },\n registerBodyEventHandler: (evtType, handler) => {\n document.body.addEventListener(evtType, handler);\n },\n deregisterBodyEventHandler: (evtType, handler) => {\n document.body.removeEventListener(evtType, handler);\n },\n registerWindowEventHandler: (evtType, handler) => {\n window.addEventListener(evtType, handler);\n },\n deregisterWindowEventHandler: (evtType, handler) => {\n window.removeEventListener(evtType, handler);\n },\n // tslint:enable:object-literal-sort-keys\n };\n return new MDCSliderFoundation(adapter);\n }\n\n /**\n * Initializes component, with the following options:\n * - `skipInitialUIUpdate`: Whether to skip updating the UI when initially\n * syncing with the DOM. This should be enabled when the slider position\n * is set before component initialization.\n */\n initialize({skipInitialUIUpdate}: {skipInitialUIUpdate?: boolean} = {}) {\n this.inputs =\n [].slice.call(this.root.querySelectorAll(`.${cssClasses.INPUT}`)) as\n HTMLInputElement[];\n this.thumbs =\n [].slice.call(this.root.querySelectorAll(`.${cssClasses.THUMB}`)) as\n HTMLElement[];\n this.trackActive =\n this.root.querySelector(`.${cssClasses.TRACK_ACTIVE}`) as HTMLElement;\n this.ripples = this.createRipples();\n\n if (skipInitialUIUpdate) {\n this.skipInitialUIUpdate = true;\n }\n }\n\n initialSyncWithDOM() {\n this.foundation.layout({skipUpdateUI: this.skipInitialUIUpdate});\n }\n\n /** Redraws UI based on DOM (e.g. element dimensions, RTL). */\n layout() {\n this.foundation.layout();\n }\n\n getValueStart(): number {\n return this.foundation.getValueStart();\n }\n\n setValueStart(valueStart: number) {\n this.foundation.setValueStart(valueStart);\n }\n\n getValue(): number {\n return this.foundation.getValue();\n }\n\n setValue(value: number) {\n this.foundation.setValue(value);\n }\n\n /** @return Slider disabled state. */\n getDisabled(): boolean {\n return this.foundation.getDisabled();\n }\n\n /** Sets slider disabled state. */\n setDisabled(disabled: boolean) {\n this.foundation.setDisabled(disabled);\n }\n\n /**\n * Sets a function that maps the slider value to the value of the\n * `aria-valuetext` attribute on the thumb element.\n */\n setValueToAriaValueTextFn(mapFn: ((value: number) => string)|null) {\n this.valueToAriaValueTextFn = mapFn;\n }\n\n private getThumbEl(thumb: Thumb) {\n return thumb === Thumb.END ? this.thumbs[this.thumbs.length - 1] :\n this.thumbs[0];\n }\n\n private getInput(thumb: Thumb) {\n return thumb === Thumb.END ? this.inputs[this.inputs.length - 1] :\n this.inputs[0];\n }\n\n private getRipple(thumb: Thumb) {\n return thumb === Thumb.END ? this.ripples[this.ripples.length - 1] :\n this.ripples[0];\n }\n\n /** Adds tick mark elements to the given container. */\n private addTickMarks(tickMarkContainer: HTMLElement, tickMarks: TickMark[]) {\n const fragment = document.createDocumentFragment();\n for (let i = 0; i < tickMarks.length; i++) {\n const div = document.createElement('div');\n const tickMarkClass = tickMarks[i] === TickMark.ACTIVE ?\n cssClasses.TICK_MARK_ACTIVE :\n cssClasses.TICK_MARK_INACTIVE;\n div.classList.add(tickMarkClass);\n fragment.appendChild(div);\n }\n tickMarkContainer.appendChild(fragment);\n }\n\n /** Updates tick mark elements' classes in the given container. */\n private updateTickMarks(\n tickMarkContainer: HTMLElement, tickMarks: TickMark[]) {\n const tickMarkEls = Array.from(tickMarkContainer.children);\n for (let i = 0; i < tickMarkEls.length; i++) {\n if (tickMarks[i] === TickMark.ACTIVE) {\n tickMarkEls[i].classList.add(cssClasses.TICK_MARK_ACTIVE);\n tickMarkEls[i].classList.remove(cssClasses.TICK_MARK_INACTIVE);\n } else {\n tickMarkEls[i].classList.add(cssClasses.TICK_MARK_INACTIVE);\n tickMarkEls[i].classList.remove(cssClasses.TICK_MARK_ACTIVE);\n }\n }\n }\n\n /** Initializes thumb ripples. */\n private createRipples(): MDCRipple[] {\n const ripples = [];\n const rippleSurfaces = [].slice.call(\n this.root.querySelectorAll<HTMLElement>(`.${cssClasses.THUMB}`));\n for (let i = 0; i < rippleSurfaces.length; i++) {\n const rippleSurface = rippleSurfaces[i] as HTMLElement;\n // Use the corresponding input as the focus source for the ripple (i.e.\n // when the input is focused, the ripple is in the focused state).\n const input = this.inputs[i];\n\n const adapter: MDCRippleAdapter = {\n ...MDCRipple.createAdapter(this),\n addClass: (className: string) => {\n rippleSurface.classList.add(className);\n },\n computeBoundingRect: () => rippleSurface.getBoundingClientRect(),\n deregisterInteractionHandler: <K extends EventType>(\n evtType: K, handler: SpecificEventListener<K>) => {\n input.removeEventListener(evtType, handler);\n },\n isSurfaceActive: () => matches(input, ':active'),\n isUnbounded: () => true,\n registerInteractionHandler: <K extends EventType>(\n evtType: K, handler: SpecificEventListener<K>) => {\n input.addEventListener(evtType, handler, applyPassive());\n },\n removeClass: (className: string) => {\n rippleSurface.classList.remove(className);\n },\n updateCssVariable: (varName: string, value: string) => {\n rippleSurface.style.setProperty(varName, value);\n },\n };\n\n const ripple =\n new MDCRipple(rippleSurface, new MDCRippleFoundation(adapter));\n ripple.unbounded = true;\n ripples.push(ripple);\n }\n\n return ripples;\n }\n}\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/** Slider element classes. */\nexport const cssClasses = {\n DISABLED: 'mdc-slider--disabled',\n DISCRETE: 'mdc-slider--discrete',\n INPUT: 'mdc-slider__input',\n RANGE: 'mdc-slider--range',\n THUMB: 'mdc-slider__thumb',\n THUMB_KNOB: 'mdc-slider__thumb-knob',\n // Class added to the top thumb (for overlapping thumbs in range slider).\n THUMB_TOP: 'mdc-slider__thumb--top',\n THUMB_WITH_INDICATOR: 'mdc-slider__thumb--with-indicator',\n TICK_MARKS: 'mdc-slider--tick-marks',\n TICK_MARKS_CONTAINER: 'mdc-slider__tick-marks',\n TICK_MARK_ACTIVE: 'mdc-slider__tick-mark--active',\n TICK_MARK_INACTIVE: 'mdc-slider__tick-mark--inactive',\n TRACK: 'mdc-slider__track',\n // The active track fill element that will be scaled as the value changes.\n TRACK_ACTIVE: 'mdc-slider__track--active_fill',\n VALUE_INDICATOR_TEXT: 'mdc-slider__value-indicator-text',\n};\n\n/** Slider numbers. */\nexport const numbers = {\n // Default step size.\n STEP_SIZE: 1,\n // Minimum absolute difference between clientX of move event / down event\n // for which to update thumb, in the case of overlapping thumbs.\n // This is needed to reduce chances of choosing the thumb based on\n // pointer jitter.\n THUMB_UPDATE_MIN_PX: 5,\n};\n\n/** Slider attributes. */\nexport const attributes = {\n ARIA_DISABLED: 'aria-disabled',\n ARIA_VALUEMAX: 'aria-valuemax',\n ARIA_VALUEMIN: 'aria-valuemin',\n ARIA_VALUENOW: 'aria-valuenow',\n ARIA_VALUETEXT: 'aria-valuetext',\n INPUT_DISABLED: 'disabled',\n INPUT_MIN: 'min',\n INPUT_MAX: 'max',\n INPUT_VALUE: 'value',\n INPUT_STEP: 'step',\n};\n\n/** Slider events. */\nexport const events = {\n CHANGE: 'MDCSlider:change',\n INPUT: 'MDCSlider:input',\n};\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {getCorrectPropertyName} from '@material/animation/util';\nimport {MDCFoundation} from '@material/base/foundation';\nimport {SpecificEventListener} from '@material/base/types';\n\nimport {MDCSliderAdapter} from './adapter';\nimport {attributes, cssClasses, numbers} from './constants';\nimport {Thumb, TickMark} from './types';\n\n// Accessing `window` without a `typeof` check will throw on Node environments.\nconst HAS_WINDOW = typeof window !== 'undefined';\n\n/**\n * Foundation class for slider. Responsibilities include:\n * - Updating slider values (internal state and DOM updates) based on client\n * 'x' position.\n * - Updating DOM after slider property updates (e.g. min, max).\n */\nexport class MDCSliderFoundation extends MDCFoundation<MDCSliderAdapter> {\n static SUPPORTS_POINTER_EVENTS = HAS_WINDOW && Boolean(window.PointerEvent) &&\n // #setPointerCapture is buggy on iOS, so we can't use pointer events\n // until the following bug is fixed:\n // https://bugs.webkit.org/show_bug.cgi?id=220196\n !isIOS();\n\n // Whether the initial styles (to position the thumb, before component\n // initialization) have been removed.\n private initialStylesRemoved = false;\n\n private min!: number; // Assigned in init()\n private max!: number; // Assigned in init()\n // If `isRange`, this is the value of Thumb.START. Otherwise, defaults to min.\n private valueStart!: number; // Assigned in init()\n // If `isRange`, this it the value of Thumb.END. Otherwise, it is the\n // value of the single thumb.\n private value!: number; // Assigned in init()\n private rect!: ClientRect; // Assigned in layout() via init()\n\n private isDisabled = false;\n\n private isDiscrete = false;\n private step = numbers.STEP_SIZE;\n private hasTickMarks = false;\n\n // The following properties are only set for range sliders.\n private isRange = false;\n // Tracks the thumb being moved across a slider pointer interaction (down,\n // move event).\n private thumb: Thumb|null = null;\n // `clientX` from the most recent down event. Used in subsequent move\n // events to determine which thumb to move (in the case of\n // overlapping thumbs).\n private downEventClientX: number|null = null;\n // `valueStart` before the most recent down event. Used in subsequent up\n // events to determine whether to fire the `change` event.\n private valueStartBeforeDownEvent!: number; // Assigned in init()\n // `value` before the most recent down event. Used in subsequent up\n // events to determine whether to fire the `change` event.\n private valueBeforeDownEvent!: number; // Assigned in init()\n // Width of the start thumb knob.\n private startThumbKnobWidth = 0;\n // Width of the end thumb knob.\n private endThumbKnobWidth = 0;\n\n // Assigned in #initialize.\n private mousedownOrTouchstartListener!:\n SpecificEventListener<'mousedown'|'touchstart'>;\n // Assigned in #initialize.\n private moveListener!:\n SpecificEventListener<'pointermove'|'mousemove'|'touchmove'>;\n private pointerdownListener!:\n SpecificEventListener<'pointerdown'>; // Assigned in #initialize.\n private pointerupListener!:\n SpecificEventListener<'pointerup'>; // Assigned in #initialize.\n private thumbMouseenterListener!:\n SpecificEventListener<'mouseenter'>; // Assigned in #initialize.\n private thumbMouseleaveListener!:\n SpecificEventListener<'mouseleave'>; // Assigned in #initialize.\n private inputStartChangeListener!:\n SpecificEventListener<'change'>; // Assigned in #initialize.\n private inputEndChangeListener!:\n SpecificEventListener<'change'>; // Assigned in #initialize.\n private inputStartFocusListener!:\n SpecificEventListener<'focus'>; // Assigned in #initialize.\n private inputEndFocusListener!:\n SpecificEventListener<'focus'>; // Assigned in #initialize.\n private inputStartBlurListener!:\n SpecificEventListener<'blur'>; // Assigned in #initialize.\n private inputEndBlurListener!:\n SpecificEventListener<'blur'>; // Assigned in #initialize.\n private resizeListener!:\n SpecificEventListener<'resize'>; // Assigned in #initialize.\n\n constructor(adapter?: Partial<MDCSliderAdapter>) {\n super({...MDCSliderFoundation.defaultAdapter, ...adapter});\n }\n\n static get defaultAdapter(): MDCSliderAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same\n // order as the adapter interface.\n return {\n hasClass: () => false,\n addClass: () => undefined,\n removeClass: () => undefined,\n addThumbClass: () => undefined,\n removeThumbClass: () => undefined,\n getAttribute: () => null,\n getInputValue: () => '',\n setInputValue: () => undefined,\n getInputAttribute: () => null,\n setInputAttribute: () => null,\n removeInputAttribute: () => null,\n focusInput: () => undefined,\n isInputFocused: () => false,\n getThumbKnobWidth: () => 0,\n getThumbBoundingClientRect: () =>\n ({top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0}),\n getBoundingClientRect: () =>\n ({top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0}),\n isRTL: () => false,\n setThumbStyleProperty: () => undefined,\n removeThumbStyleProperty: () => undefined,\n setTrackActiveStyleProperty: () => undefined,\n removeTrackActiveStyleProperty: () => undefined,\n setValueIndicatorText: () => undefined,\n getValueToAriaValueTextFn: () => null,\n updateTickMarks: () => undefined,\n setPointerCapture: () => undefined,\n emitChangeEvent: () => undefined,\n emitInputEvent: () => undefined,\n emitDragStartEvent: () => undefined,\n emitDragEndEvent: () => undefined,\n registerEventHandler: () => undefined,\n deregisterEventHandler: () => undefined,\n registerThumbEventHandler: () => undefined,\n deregisterThumbEventHandler: () => undefined,\n registerInputEventHandler: () => undefined,\n deregisterInputEventHandler: () => undefined,\n registerBodyEventHandler: () => undefined,\n deregisterBodyEventHandler: () => undefined,\n registerWindowEventHandler: () => undefined,\n deregisterWindowEventHandler: () => undefined,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n init() {\n this.isDisabled = this.adapter.hasClass(cssClasses.DISABLED);\n this.isDiscrete = this.adapter.hasClass(cssClasses.DISCRETE);\n this.hasTickMarks = this.adapter.hasClass(cssClasses.TICK_MARKS);\n this.isRange = this.adapter.hasClass(cssClasses.RANGE);\n\n const min = this.convertAttributeValueToNumber(\n this.adapter.getInputAttribute(\n attributes.INPUT_MIN, this.isRange ? Thumb.START : Thumb.END),\n attributes.INPUT_MIN);\n const max = this.convertAttributeValueToNumber(\n this.adapter.getInputAttribute(attributes.INPUT_MAX, Thumb.END),\n attributes.INPUT_MAX);\n const value = this.convertAttributeValueToNumber(\n this.adapter.getInputAttribute(attributes.INPUT_VALUE, Thumb.END),\n attributes.INPUT_VALUE);\n const valueStart = this.isRange ?\n this.convertAttributeValueToNumber(\n this.adapter.getInputAttribute(attributes.INPUT_VALUE, Thumb.START),\n attributes.INPUT_VALUE) :\n min;\n\n this.validateProperties({min, max, value, valueStart});\n\n this.min = min;\n this.max = max;\n this.value = value;\n this.valueStart = valueStart;\n\n this.valueBeforeDownEvent = value;\n this.valueStartBeforeDownEvent = valueStart;\n\n const stepAttr =\n this.adapter.getInputAttribute(attributes.INPUT_STEP, Thumb.END);\n if (stepAttr) {\n this.step =\n this.convertAttributeValueToNumber(stepAttr, attributes.INPUT_STEP);\n }\n if (this.step <= 0) {\n throw new Error(\n `MDCSliderFoundation: step must be a positive number. ` +\n `Current step: ${this.step}`);\n }\n\n this.mousedownOrTouchstartListener =\n this.handleMousedownOrTouchstart.bind(this);\n this.moveListener = this.handleMove.bind(this);\n this.pointerdownListener = this.handlePointerdown.bind(this);\n this.pointerupListener = this.handlePointerup.bind(this);\n this.thumbMouseenterListener = this.handleThumbMouseenter.bind(this);\n this.thumbMouseleaveListener = this.handleThumbMouseleave.bind(this);\n this.inputStartChangeListener = () => {\n this.handleInputChange(Thumb.START);\n };\n this.inputEndChangeListener = () => {\n this.handleInputChange(Thumb.END);\n };\n this.inputStartFocusListener = () => {\n this.handleInputFocus(Thumb.START);\n };\n this.inputEndFocusListener = () => {\n this.handleInputFocus(Thumb.END);\n };\n this.inputStartBlurListener = () => {\n this.handleInputBlur(Thumb.START);\n };\n this.inputEndBlurListener = () => {\n this.handleInputBlur(Thumb.END);\n };\n this.resizeListener = this.handleResize.bind(this);\n this.registerEventHandlers();\n }\n\n destroy() {\n this.deregisterEventHandlers();\n }\n\n getMin() {\n return this.min;\n }\n\n getMax() {\n return this.max;\n }\n\n /**\n * - For single point sliders, returns the thumb value.\n * - For range (two-thumb) sliders, returns the end thumb's value.\n */\n getValue() {\n return this.value;\n }\n\n /**\n * - For single point sliders, sets the thumb value.\n * - For range (two-thumb) sliders, sets the end thumb's value.\n */\n setValue(value: number) {\n if (this.isRange && value < this.valueStart) {\n throw new Error(\n `end thumb value (${value}) must be >= start thumb ` +\n `value (${this.valueStart})`);\n }\n\n this.updateValue(value, Thumb.END);\n }\n\n /**\n * Only applicable for range sliders.\n * @return The start thumb's value.\n */\n getValueStart() {\n if (!this.isRange) {\n throw new Error('`valueStart` is only applicable for range sliders.');\n }\n\n return this.valueStart;\n }\n\n /**\n * Only applicable for range sliders. Sets the start thumb's value.\n */\n setValueStart(valueStart: number) {\n if (!this.isRange) {\n throw new Error('`valueStart` is only applicable for range sliders.');\n }\n if (this.isRange && valueStart > this.value) {\n throw new Error(\n `start thumb value (${valueStart}) must be <= end thumb ` +\n `value (${this.value})`);\n }\n\n this.updateValue(valueStart, Thumb.START);\n }\n\n getStep() {\n return this.step;\n }\n\n getDisabled() {\n return this.isDisabled;\n }\n\n /**\n * Sets disabled state, including updating styles and thumb tabindex.\n */\n setDisabled(disabled: boolean) {\n this.isDisabled = disabled;\n\n if (disabled) {\n this.adapter.addClass(cssClasses.DISABLED);\n\n if (this.isRange) {\n this.adapter.setInputAttribute(\n attributes.INPUT_DISABLED, '', Thumb.START);\n }\n this.adapter.setInputAttribute(attributes.INPUT_DISABLED, '', Thumb.END);\n } else {\n this.adapter.removeClass(cssClasses.DISABLED);\n\n if (this.isRange) {\n this.adapter.removeInputAttribute(\n attributes.INPUT_DISABLED, Thumb.START);\n }\n this.adapter.removeInputAttribute(attributes.INPUT_DISABLED, Thumb.END);\n }\n }\n\n /** @return Whether the slider is a range slider. */\n getIsRange() {\n return this.isRange;\n }\n\n /**\n * - Syncs slider boundingClientRect with the current DOM.\n * - Updates UI based on internal state.\n */\n layout({skipUpdateUI}: {skipUpdateUI?: boolean} = {}) {\n this.rect = this.adapter.getBoundingClientRect();\n if (this.isRange) {\n this.startThumbKnobWidth = this.adapter.getThumbKnobWidth(Thumb.START);\n this.endThumbKnobWidth = this.adapter.getThumbKnobWidth(Thumb.END);\n }\n\n if (!skipUpdateUI) {\n this.updateUI();\n }\n }\n\n /** Handles resize events on the window. */\n handleResize() {\n this.layout();\n }\n\n /**\n * Handles pointer down events on the slider root element.\n */\n handleDown(event: PointerEvent|MouseEvent|TouchEvent) {\n if (this.isDisabled) return;\n\n this.valueStartBeforeDownEvent = this.valueStart;\n this.valueBeforeDownEvent = this.value;\n\n const clientX = (event as MouseEvent).clientX != null ?\n (event as MouseEvent).clientX :\n (event as TouchEvent).targetTouches[0].clientX;\n this.downEventClientX = clientX;\n const value = this.mapClientXOnSliderScale(clientX);\n this.thumb = this.getThumbFromDownEvent(clientX, value);\n if (this.thumb === null) return;\n\n this.handleDragStart(event, value, this.thumb);\n\n // Presses within the range do not invoke slider updates.\n const newValueInCurrentRange =\n this.isRange && value >= this.valueStart && value <= this.value;\n if (newValueInCurrentRange) return;\n\n this.updateValue(value, this.thumb, {emitInputEvent: true});\n }\n\n /**\n * Handles pointer move events on the slider root element.\n */\n handleMove(event: PointerEvent|MouseEvent|TouchEvent) {\n if (this.isDisabled) return;\n\n // Prevent scrolling.\n event.preventDefault();\n\n const clientX = (event as MouseEvent).clientX != null ?\n (event as MouseEvent).clientX :\n (event as TouchEvent).targetTouches[0].clientX;\n const dragAlreadyStarted = this.thumb != null;\n this.thumb = this.getThumbFromMoveEvent(clientX);\n if (this.thumb === null) return;\n\n const value = this.mapClientXOnSliderScale(clientX);\n if (!dragAlreadyStarted) {\n this.handleDragStart(event, value, this.thumb);\n this.adapter.emitDragStartEvent(value, this.thumb);\n }\n this.updateValue(value, this.thumb, {emitInputEvent: true});\n }\n\n /**\n * Handles pointer up events on the slider root element.\n */\n handleUp() {\n if (this.isDisabled || this.thumb === null) return;\n\n const oldValue = this.thumb === Thumb.START ?\n this.valueStartBeforeDownEvent :\n this.valueBeforeDownEvent;\n const newValue = this.thumb === Thumb.START ? this.valueStart : this.value;\n if (oldValue !== newValue) {\n this.adapter.emitChangeEvent(newValue, this.thumb);\n }\n\n this.adapter.emitDragEndEvent(newValue, this.thumb);\n this.thumb = null;\n }\n\n /**\n * For range, discrete slider, shows the value indicator on both thumbs.\n */\n handleThumbMouseenter() {\n if (!this.isDiscrete || !this.isRange) return;\n\n this.adapter.addThumbClass(cssClasses.THUMB_WITH_INDICATOR, Thumb.START);\n this.adapter.addThumbClass(cssClasses.THUMB_WITH_INDICATOR, Thumb.END);\n }\n\n /**\n * For range, discrete slider, hides the value indicator on both thumbs.\n */\n handleThumbMouseleave() {\n if (!this.isDiscrete || !this.isRange) return;\n if (this.adapter.isInputFocused(Thumb.START) ||\n this.adapter.isInputFocused(Thumb.END)) {\n // Leave value indicator shown if either input is focused.\n return;\n }\n\n this.adapter.removeThumbClass(cssClasses.THUMB_WITH_INDICATOR, Thumb.START);\n this.adapter.removeThumbClass(cssClasses.THUMB_WITH_INDICATOR, Thumb.END);\n }\n\n handleMousedownOrTouchstart(event: MouseEvent|TouchEvent) {\n const moveEventType =\n event.type === 'mousedown' ? 'mousemove' : 'touchmove';\n // After a down event on the slider root, listen for move events on\n // body (so the slider value is updated for events outside of the\n // slider root).\n this.adapter.registerBodyEventHandler(moveEventType, this.moveListener);\n\n const upHandler = () => {\n this.handleUp();\n\n // Once the drag is finished (up event on body), remove the move\n // handler.\n this.adapter.deregisterBodyEventHandler(moveEventType, this.moveListener);\n\n // Also stop listening for subsequent up events.\n this.adapter.deregisterEventHandler('mouseup', upHandler);\n this.adapter.deregisterEventHandler('touchend', upHandler);\n };\n\n this.adapter.registerBodyEventHandler('mouseup', upHandler);\n this.adapter.registerBodyEventHandler('touchend', upHandler);\n\n this.handleDown(event);\n }\n\n handlePointerdown(event: PointerEvent) {\n this.adapter.setPointerCapture(event.pointerId);\n this.adapter.registerEventHandler('pointermove', this.moveListener);\n\n this.handleDown(event);\n }\n\n /**\n * Handles input `change` event by setting internal slider value to match\n * input's new value.\n */\n handleInputChange(thumb: Thumb) {\n const value = Number(this.adapter.getInputValue(thumb));\n if (thumb === Thumb.START) {\n this.setValueStart(value);\n } else {\n this.setValue(value);\n }\n\n this.adapter.emitChangeEvent(\n thumb === Thumb.START ? this.valueStart : this.value, thumb);\n }\n\n /** Shows value indicator on thumb(s). */\n handleInputFocus(thumb: Thumb) {\n if (!this.isDiscrete) return;\n\n this.adapter.addThumbClass(cssClasses.THUMB_WITH_INDICATOR, thumb);\n if (this.isRange) {\n const otherThumb = thumb === Thumb.START ? Thumb.END : Thumb.START;\n this.adapter.addThumbClass(cssClasses.THUMB_WITH_INDICATOR, otherThumb);\n }\n }\n\n /** Removes value indicator from thumb(s). */\n handleInputBlur(thumb: Thumb) {\n if (!this.isDiscrete) return;\n\n this.adapter.removeThumbClass(cssClasses.THUMB_WITH_INDICATOR, thumb);\n if (this.isRange) {\n const otherThumb = thumb === Thumb.START ? Thumb.END : Thumb.START;\n this.adapter.removeThumbClass(\n cssClasses.THUMB_WITH_INDICATOR, otherThumb);\n }\n }\n\n /**\n * Emits custom dragStart event, along with focusing the underlying input.\n */\n private handleDragStart(\n event: PointerEvent|MouseEvent|TouchEvent, value: number, thumb: Thumb) {\n this.adapter.focusInput(thumb);\n // Prevent the input (that we just focused) from losing focus.\n event.preventDefault();\n\n this.adapter.emitDragStartEvent(value, thumb);\n }\n\n /**\n * @return The thumb to be moved based on initial down event.\n */\n private getThumbFromDownEvent(clientX: number, value: number): Thumb|null {\n // For single point slider, thumb to be moved is always the END (only)\n // thumb.\n if (!this.isRange) return Thumb.END;\n\n // Check if event press point is in the bounds of any thumb.\n const thumbStartRect = this.adapter.getThumbBoundingClientRect(Thumb.START);\n const thumbEndRect = this.adapter.getThumbBoundingClientRect(Thumb.END);\n const inThumbStartBounds =\n clientX >= thumbStartRect.left && clientX <= thumbStartRect.right;\n const inThumbEndBounds =\n clientX >= thumbEndRect.left && clientX <= thumbEndRect.right;\n\n if (inThumbStartBounds && inThumbEndBounds) {\n // Thumbs overlapping. Thumb to be moved cannot be determined yet.\n return null;\n }\n\n // If press is in bounds for either thumb on down event, that's the thumb\n // to be moved.\n if (inThumbStartBounds) {\n return Thumb.START;\n }\n if (inThumbEndBounds) {\n return Thumb.END;\n }\n\n // Otherwise, if press occurred outside of the range, return either start\n // or end thumb based on which the press is closer to.\n if (value < this.valueStart) {\n return Thumb.START;\n }\n if (value > this.value) {\n return Thumb.END;\n }\n\n return null;\n }\n\n /**\n * @return The thumb to be moved based on move event (based on drag\n * direction from original down event). Only applicable if thumbs\n * were overlapping in the down event.\n */\n private getThumbFromMoveEvent(clientX: number): Thumb|null {\n // Thumb has already been chosen.\n if (this.thumb !== null) return this.thumb;\n\n if (this.downEventClientX === null) {\n throw new Error('`downEventClientX` is null after move event.');\n }\n\n const moveDistanceUnderThreshold =\n Math.abs(this.downEventClientX - clientX) < numbers.THUMB_UPDATE_MIN_PX;\n if (moveDistanceUnderThreshold) return this.thumb;\n\n const draggedThumbToLeft = clientX < this.downEventClientX;\n if (draggedThumbToLeft) {\n return this.adapter.isRTL() ? Thumb.END : Thumb.START;\n } else {\n return this.adapter.isRTL() ? Thumb.START : Thumb.END;\n }\n }\n\n /**\n * Updates UI based on internal state.\n * @param thumb Thumb whose value is being updated. If undefined, UI is\n * updated for both thumbs based on current internal state.\n */\n private updateUI(thumb?: Thumb) {\n this.updateThumbAndInputAttributes(thumb);\n this.updateThumbAndTrackUI(thumb);\n this.updateValueIndicatorUI(thumb);\n this.updateTickMarksUI();\n }\n\n /**\n * Updates thumb and input attributes based on current value.\n * @param thumb Thumb whose aria attributes to update.\n */\n private updateThumbAndInputAttributes(thumb?: Thumb) {\n if (!thumb) return;\n\n const value =\n this.isRange && thumb === Thumb.START ? this.valueStart : this.value;\n const valueStr = String(value);\n this.adapter.setInputAttribute(attributes.INPUT_VALUE, valueStr, thumb);\n if (this.isRange && thumb === Thumb.START) {\n this.adapter.setInputAttribute(attributes.INPUT_MIN, valueStr, Thumb.END);\n } else if (this.isRange && thumb === Thumb.END) {\n this.adapter.setInputAttribute(\n attributes.INPUT_MAX, valueStr, Thumb.START);\n }\n\n // Sync attribute with property.\n if (this.adapter.getInputValue(thumb) !== valueStr) {\n this.adapter.setInputValue(valueStr, thumb);\n }\n\n const valueToAriaValueTextFn = this.adapter.getValueToAriaValueTextFn();\n if (valueToAriaValueTextFn) {\n this.adapter.setInputAttribute(\n attributes.ARIA_VALUETEXT, valueToAriaValueTextFn(value), thumb);\n }\n }\n\n /**\n * Updates value indicator UI based on current value.\n * @param thumb Thumb whose value indicator to update. If undefined, all\n * thumbs' value indicators are updated.\n */\n private updateValueIndicatorUI(thumb?: Thumb) {\n if (!this.isDiscrete) return;\n\n const value =\n this.isRange && thumb === Thumb.START ? this.valueStart : this.value;\n this.adapter.setValueIndicatorText(\n value, thumb === Thumb.START ? Thumb.START : Thumb.END);\n\n if (!thumb && this.isRange) {\n this.adapter.setValueIndicatorText(this.valueStart, Thumb.START);\n }\n }\n\n /**\n * Updates tick marks UI within slider, based on current min, max, and step.\n */\n private updateTickMarksUI() {\n if (!this.isDiscrete || !this.hasTickMarks) return;\n\n const numTickMarksInactiveStart = (this.valueStart - this.min) / this.step;\n const numTickMarksActive = (this.value - this.valueStart) / this.step + 1;\n const numTickMarksInactiveEnd = (this.max - this.value) / this.step;\n const tickMarksInactiveStart =\n Array.from<TickMark>({length: numTickMarksInactiveStart})\n .fill(TickMark.INACTIVE);\n const tickMarksActive = Array.from<TickMark>({length: numTickMarksActive})\n .fill(TickMark.ACTIVE);\n const tickMarksInactiveEnd =\n Array.from<TickMark>({length: numTickMarksInactiveEnd})\n .fill(TickMark.INACTIVE);\n\n this.adapter.updateTickMarks(tickMarksInactiveStart.concat(tickMarksActive)\n .concat(tickMarksInactiveEnd));\n }\n\n /** Maps clientX to a value on the slider scale. */\n private mapClientXOnSliderScale(clientX: number) {\n const xPos = clientX - this.rect.left;\n let pctComplete = xPos / this.rect.width;\n if (this.adapter.isRTL()) {\n pctComplete = 1 - pctComplete;\n }\n\n // Fit the percentage complete between the range [min,max]\n // by remapping from [0, 1] to [min, min+(max-min)].\n const value = this.min + pctComplete * (this.max - this.min);\n if (value === this.max || value === this.min) {\n return value;\n }\n return this.quantize(value);\n }\n\n /**\n * Updates slider value (internal state and UI) based on the given value.\n */\n private updateValue(value: number, thumb: Thumb, {\n emitInputEvent,\n emitChangeEvent\n }: {emitInputEvent?: boolean, emitChangeEvent?: boolean} = {}) {\n value = this.clampValue(value, thumb);\n\n if (this.isRange && thumb === Thumb.START) {\n // Exit early if current value is the same as the new value.\n if (this.valueStart === value) return;\n\n this.valueStart = value;\n } else {\n // Exit early if current value is the same as the new value.\n if (this.value === value) return;\n\n this.value = value;\n }\n\n this.updateUI(thumb);\n\n if (emitInputEvent) {\n this.adapter.emitInputEvent(\n thumb === Thumb.START ? this.valueStart : this.value, thumb);\n }\n if (emitChangeEvent) {\n this.adapter.emitChangeEvent(\n thumb === Thumb.START ? this.valueStart : this.value, thumb);\n }\n }\n\n /** Calculates the quantized value based on step value. */\n private quantize(value: number): number {\n const numSteps = Math.round(value / this.step);\n return numSteps * this.step;\n }\n\n /**\n * Clamps the given value for the given thumb based on slider properties:\n * - Restricts value within [min, max].\n * - If range slider, clamp start value <= end value, and\n * end value >= start value.\n */\n private clampValue(value: number, thumb: Thumb): number {\n // Clamp value to [min, max] range.\n value = Math.min(Math.max(value, this.min), this.max);\n\n const thumbStartMovedPastThumbEnd =\n this.isRange && thumb === Thumb.START && value > this.value;\n if (thumbStartMovedPastThumbEnd) {\n return this.value;\n }\n const thumbEndMovedPastThumbStart =\n this.isRange && thumb === Thumb.END && value < this.valueStart;\n if (thumbEndMovedPastThumbStart) {\n return this.valueStart;\n }\n\n return value;\n }\n\n /**\n * Updates the active track and thumb style properties to reflect current\n * value.\n */\n private updateThumbAndTrackUI(thumb?: Thumb) {\n const {max, min} = this;\n const pctComplete = (this.value - this.valueStart) / (max - min);\n const rangePx = pctComplete * this.rect.width;\n const isRtl = this.adapter.isRTL();\n\n const transformProp =\n HAS_WINDOW ? getCorrectPropertyName(window, 'transform') : 'transform';\n if (this.isRange) {\n const thumbLeftPos = this.adapter.isRTL() ?\n (max - this.value) / (max - min) * this.rect.width :\n (this.valueStart - min) / (max - min) * this.rect.width;\n const thumbRightPos = thumbLeftPos + rangePx;\n\n requestAnimationFrame(() => {\n // Set active track styles, accounting for animation direction by\n // setting `transform-origin`.\n const trackAnimatesFromRight = (!isRtl && thumb === Thumb.START) ||\n (isRtl && thumb !== Thumb.START);\n if (trackAnimatesFromRight) {\n this.adapter.setTrackActiveStyleProperty('transform-origin', 'right');\n this.adapter.setTrackActiveStyleProperty('left', 'unset');\n this.adapter.setTrackActiveStyleProperty(\n 'right', `${this.rect.width - thumbRightPos}px`);\n } else {\n this.adapter.setTrackActiveStyleProperty('transform-origin', 'left');\n this.adapter.setTrackActiveStyleProperty('right', 'unset');\n this.adapter.setTrackActiveStyleProperty('left', `${thumbLeftPos}px`);\n }\n this.adapter.setTrackActiveStyleProperty(\n transformProp, `scaleX(${pctComplete})`);\n\n // Set thumb styles.\n const thumbStartPos = isRtl ? thumbRightPos : thumbLeftPos;\n const thumbEndPos = this.adapter.isRTL() ? thumbLeftPos : thumbRightPos;\n if (thumb === Thumb.START || !thumb || !this.initialStylesRemoved) {\n this.adapter.setThumbStyleProperty(\n transformProp, `translateX(${thumbStartPos}px)`, Thumb.START);\n }\n if (thumb === Thumb.END || !thumb || !this.initialStylesRemoved) {\n this.adapter.setThumbStyleProperty(\n transformProp, `translateX(${thumbEndPos}px)`, Thumb.END);\n }\n\n this.removeInitialStyles(isRtl);\n this.updateOverlappingThumbsUI(thumbStartPos, thumbEndPos, thumb);\n });\n } else {\n requestAnimationFrame(() => {\n const thumbStartPos = isRtl ? this.rect.width - rangePx : rangePx;\n this.adapter.setThumbStyleProperty(\n transformProp, `translateX(${thumbStartPos}px)`, Thumb.END);\n this.adapter.setTrackActiveStyleProperty(\n transformProp, `scaleX(${pctComplete})`);\n\n this.removeInitialStyles(isRtl);\n });\n }\n }\n\n /**\n * Removes initial inline styles if not already removed. `left:<...>%`\n * inline styles can be added to position the thumb correctly before JS\n * initialization. However, they need to be removed before the JS starts\n * positioning the thumb. This is because the JS uses\n * `transform:translateX(<...>)px` (for performance reasons) to position\n * the thumb (which is not possible for initial styles since we need the\n * bounding rect measurements).\n */\n private removeInitialStyles(isRtl: boolean) {\n if (this.initialStylesRemoved) return;\n\n // Remove thumb position properties that were added for initial render.\n const position = isRtl ? 'right' : 'left';\n this.adapter.removeThumbStyleProperty(position, Thumb.END);\n if (this.isRange) {\n this.adapter.removeThumbStyleProperty(position, Thumb.START);\n }\n\n this.initialStylesRemoved = true;\n\n this.resetTrackAndThumbAnimation();\n }\n\n /**\n * Resets track/thumb animation to prevent animation when adding\n * `transform` styles to thumb initially.\n */\n private resetTrackAndThumbAnimation() {\n if (!this.isDiscrete) return;\n\n // Set transition properties to default (no animation), so that the\n // newly added `transform` styles do not animate thumb/track from\n // their default positions.\n const transitionProp = HAS_WINDOW ?\n getCorrectPropertyName(window, 'transition') :\n 'transition';\n const transitionDefault = 'all 0s ease 0s';\n this.adapter.setThumbStyleProperty(\n transitionProp, transitionDefault, Thumb.END);\n if (this.isRange) {\n this.adapter.setThumbStyleProperty(\n transitionProp, transitionDefault, Thumb.START);\n }\n this.adapter.setTrackActiveStyleProperty(transitionProp, transitionDefault);\n\n // In the next frame, remove the transition inline styles we just\n // added, such that any animations added in the CSS can now take effect.\n requestAnimationFrame(() => {\n this.adapter.removeThumbStyleProperty(transitionProp, Thumb.END);\n this.adapter.removeTrackActiveStyleProperty(transitionProp);\n if (this.isRange) {\n this.adapter.removeThumbStyleProperty(transitionProp, Thumb.START);\n }\n });\n }\n\n /**\n * Adds THUMB_TOP class to active thumb if thumb knobs overlap; otherwise\n * removes THUMB_TOP class from both thumbs.\n * @param thumb Thumb that is active (being moved).\n */\n private updateOverlappingThumbsUI(\n thumbStartPos: number, thumbEndPos: number, thumb?: Thumb) {\n let thumbsOverlap = false;\n if (this.adapter.isRTL()) {\n const startThumbLeftEdge = thumbStartPos - this.startThumbKnobWidth / 2;\n const endThumbRightEdge = thumbEndPos + this.endThumbKnobWidth / 2;\n thumbsOverlap = endThumbRightEdge >= startThumbLeftEdge;\n } else {\n const startThumbRightEdge = thumbStartPos + this.startThumbKnobWidth / 2;\n const endThumbLeftEdge = thumbEndPos - this.endThumbKnobWidth / 2;\n thumbsOverlap = startThumbRightEdge >= endThumbLeftEdge;\n }\n\n if (thumbsOverlap) {\n this.adapter.addThumbClass(\n cssClasses.THUMB_TOP,\n // If no thumb was dragged (in the case of initial layout), end\n // thumb is on top by default.\n thumb || Thumb.END);\n this.adapter.removeThumbClass(\n cssClasses.THUMB_TOP,\n thumb === Thumb.START ? Thumb.END : Thumb.START);\n } else {\n this.adapter.removeThumbClass(cssClasses.THUMB_TOP, Thumb.START);\n this.adapter.removeThumbClass(cssClasses.THUMB_TOP, Thumb.END);\n }\n }\n\n /**\n * Converts attribute value to a number, e.g. '100' => 100. Throws errors\n * for invalid values.\n * @param attributeValue Attribute value, e.g. 100.\n * @param attributeName Attribute name, e.g. `aria-valuemax`.\n */\n private convertAttributeValueToNumber(\n attributeValue: string|null, attributeName: string) {\n if (attributeValue === null) {\n throw new Error(\n `MDCSliderFoundation: \\`${attributeName}\\` must be non-null.`);\n }\n\n const value = Number(attributeValue);\n if (isNaN(value)) {\n throw new Error(\n `MDCSliderFoundation: \\`${attributeName}\\` value is ` +\n `\\`${attributeValue}\\`, but must be a number.`);\n }\n\n return value;\n }\n\n /** Checks that the given properties are valid slider values. */\n private validateProperties(\n {min, max, value, valueStart}:\n {min: number, max: number, value: number, valueStart: number}) {\n if (min >= max) {\n throw new Error(\n `MDCSliderFoundation: min must be strictly less than max. ` +\n `Current: [min: ${min}, max: ${max}]`);\n }\n\n if (this.isRange) {\n if (value < min || value > max || valueStart < min || valueStart > max) {\n throw new Error(\n `MDCSliderFoundation: values must be in [min, max] range. ` +\n `Current values: [start value: ${valueStart}, end value: ${\n value}]`);\n }\n\n if (valueStart > value) {\n throw new Error(\n `MDCSliderFoundation: start value must be <= end value. ` +\n `Current values: [start value: ${valueStart}, end value: ${\n value}]`);\n }\n } else { // Single point slider.\n if (value < min || value > max) {\n throw new Error(\n `MDCSliderFoundation: value must be in [min, max] range. ` +\n `Current value: ${value}`);\n }\n }\n }\n\n private registerEventHandlers() {\n this.adapter.registerWindowEventHandler('resize', this.resizeListener);\n\n if (MDCSliderFoundation.SUPPORTS_POINTER_EVENTS) {\n // If supported, use pointer events API with #setPointerCapture.\n this.adapter.registerEventHandler(\n 'pointerdown', this.pointerdownListener);\n this.adapter.registerEventHandler('pointerup', this.pointerupListener);\n } else {\n // Otherwise, fall back to mousedown/touchstart events.\n this.adapter.registerEventHandler(\n 'mousedown', this.mousedownOrTouchstartListener);\n this.adapter.registerEventHandler(\n 'touchstart', this.mousedownOrTouchstartListener);\n }\n\n if (this.isRange) {\n this.adapter.registerThumbEventHandler(\n Thumb.START, 'mouseenter', this.thumbMouseenterListener);\n this.adapter.registerThumbEventHandler(\n Thumb.START, 'mouseleave', this.thumbMouseleaveListener);\n\n this.adapter.registerInputEventHandler(\n Thumb.START, 'change', this.inputStartChangeListener);\n this.adapter.registerInputEventHandler(\n Thumb.START, 'focus', this.inputStartFocusListener);\n this.adapter.registerInputEventHandler(\n Thumb.START, 'blur', this.inputStartBlurListener);\n }\n\n this.adapter.registerThumbEventHandler(\n Thumb.END, 'mouseenter', this.thumbMouseenterListener);\n this.adapter.registerThumbEventHandler(\n Thumb.END, 'mouseleave', this.thumbMouseleaveListener);\n\n this.adapter.registerInputEventHandler(\n Thumb.END, 'change', this.inputEndChangeListener);\n this.adapter.registerInputEventHandler(\n Thumb.END, 'focus', this.inputEndFocusListener);\n this.adapter.registerInputEventHandler(\n Thumb.END, 'blur', this.inputEndBlurListener);\n }\n\n private deregisterEventHandlers() {\n this.adapter.deregisterWindowEventHandler('resize', this.resizeListener);\n\n if (MDCSliderFoundation.SUPPORTS_POINTER_EVENTS) {\n this.adapter.deregisterEventHandler(\n 'pointerdown', this.pointerdownListener);\n this.adapter.deregisterEventHandler('pointerup', this.pointerupListener);\n } else {\n this.adapter.deregisterEventHandler(\n 'mousedown', this.mousedownOrTouchstartListener);\n this.adapter.deregisterEventHandler(\n 'touchstart', this.mousedownOrTouchstartListener);\n }\n\n if (this.isRange) {\n this.adapter.deregisterThumbEventHandler(\n Thumb.START, 'mouseenter', this.thumbMouseenterListener);\n this.adapter.deregisterThumbEventHandler(\n Thumb.START, 'mouseleave', this.thumbMouseleaveListener);\n\n this.adapter.deregisterInputEventHandler(\n Thumb.START, 'change', this.inputStartChangeListener);\n this.adapter.deregisterInputEventHandler(\n Thumb.START, 'focus', this.inputStartFocusListener);\n this.adapter.deregisterInputEventHandler(\n Thumb.START, 'blur', this.inputStartBlurListener);\n }\n\n this.adapter.deregisterThumbEventHandler(\n Thumb.END, 'mouseenter', this.thumbMouseenterListener);\n this.adapter.deregisterThumbEventHandler(\n Thumb.END, 'mouseleave', this.thumbMouseleaveListener);\n\n this.adapter.deregisterInputEventHandler(\n Thumb.END, 'change', this.inputEndChangeListener);\n this.adapter.deregisterInputEventHandler(\n Thumb.END, 'focus', this.inputEndFocusListener);\n this.adapter.deregisterInputEventHandler(\n Thumb.END, 'blur', this.inputEndBlurListener);\n }\n\n private handlePointerup() {\n this.handleUp();\n\n this.adapter.deregisterEventHandler('pointermove', this.moveListener);\n }\n}\n\nfunction isIOS() {\n // Source:\n // https://stackoverflow.com/questions/9038625/detect-if-device-is-ios\n return [\n 'iPad Simulator', 'iPhone Simulator', 'iPod Simulator', 'iPad', 'iPhone',\n 'iPod'\n ].includes(navigator.platform)\n // iPad on iOS 13 detection\n || (navigator.userAgent.includes('Mac') && 'ontouchend' in document);\n}\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './types';\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/** Tick mark enum, for discrete sliders. */\nexport enum TickMark {\n ACTIVE,\n INACTIVE,\n}\n\n/**\n * Thumb types: range slider has two thumbs (START, END) whereas single point\n * slider only has one thumb (END).\n */\nexport enum Thumb {\n // Thumb at start of slider (e.g. in LTR mode, left thumb on range slider).\n START = 1,\n // Thumb at end of slider (e.g. in LTR mode, right thumb on range slider,\n // or only thumb on single point slider).\n END,\n}\n\n/** Interface for `detail` of slider custom change and input events. */\nexport interface MDCSliderChangeEventDetail {\n // The new value after change.\n value: number;\n\n // The thumb for which the value has changed:\n // - For single point slider, this will always be Thumb.END.\n // - For range slider, either Thumb.START or Thumb.END.\n thumb: Thumb;\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {SpecificEventListener} from '@material/base/types';\nimport {closest} from '@material/dom/ponyfill';\nimport {MDCSnackbarAdapter} from './adapter';\nimport {strings} from './constants';\nimport {MDCSnackbarFoundation} from './foundation';\nimport {MDCSnackbarAnnouncer, MDCSnackbarAnnouncerFactory, MDCSnackbarCloseEventDetail} from './types';\nimport * as util from './util';\n\nconst {\n SURFACE_SELECTOR, LABEL_SELECTOR, ACTION_SELECTOR, DISMISS_SELECTOR,\n OPENING_EVENT, OPENED_EVENT, CLOSING_EVENT, CLOSED_EVENT,\n} = strings;\n\nexport class MDCSnackbar extends MDCComponent<MDCSnackbarFoundation> {\n static attachTo(root: Element) {\n return new MDCSnackbar(root);\n }\n\n private announce_!: MDCSnackbarAnnouncer; // assigned in initialize()\n\n private actionEl_!: Element; // assigned in initialSyncWithDOM()\n private labelEl_!: Element; // assigned in initialSyncWithDOM()\n private surfaceEl_!: Element; // assigned in initialSyncWithDOM()\n\n private handleKeyDown_!: SpecificEventListener<'keydown'>; // assigned in initialSyncWithDOM()\n private handleSurfaceClick_!: SpecificEventListener<'click'>; // assigned in initialSyncWithDOM()\n\n initialize(announcerFactory: MDCSnackbarAnnouncerFactory = () => util.announce) {\n this.announce_ = announcerFactory();\n }\n\n initialSyncWithDOM() {\n this.surfaceEl_ = this.root.querySelector(SURFACE_SELECTOR)!;\n this.labelEl_ = this.root.querySelector(LABEL_SELECTOR)!;\n this.actionEl_ = this.root.querySelector(ACTION_SELECTOR)!;\n\n this.handleKeyDown_ = (evt) => this.foundation.handleKeyDown(evt);\n this.handleSurfaceClick_ = (evt) => {\n const target = evt.target as Element;\n if (this.isActionButton_(target)) {\n this.foundation.handleActionButtonClick(evt);\n } else if (this.isActionIcon_(target)) {\n this.foundation.handleActionIconClick(evt);\n }\n };\n\n this.registerKeyDownHandler_(this.handleKeyDown_);\n this.registerSurfaceClickHandler_(this.handleSurfaceClick_);\n }\n\n destroy() {\n super.destroy();\n this.deregisterKeyDownHandler_(this.handleKeyDown_);\n this.deregisterSurfaceClickHandler_(this.handleSurfaceClick_);\n }\n\n open() {\n this.foundation.open();\n }\n\n /**\n * @param reason Why the snackbar was closed. Value will be passed to CLOSING_EVENT and CLOSED_EVENT via the\n * `event.detail.reason` property. Standard values are REASON_ACTION and REASON_DISMISS, but custom\n * client-specific values may also be used if desired.\n */\n close(reason = '') {\n this.foundation.close(reason);\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCSnackbarAdapter = {\n addClass: (className) => this.root.classList.add(className),\n announce: () => this.announce_(this.labelEl_),\n notifyClosed: (reason) => this.emit<MDCSnackbarCloseEventDetail>(\n CLOSED_EVENT, reason ? {reason} : {}),\n notifyClosing: (reason) => this.emit<MDCSnackbarCloseEventDetail>(\n CLOSING_EVENT, reason ? {reason} : {}),\n notifyOpened: () => this.emit(OPENED_EVENT, {}),\n notifyOpening: () => this.emit(OPENING_EVENT, {}),\n removeClass: (className) => this.root.classList.remove(className),\n };\n return new MDCSnackbarFoundation(adapter);\n }\n\n get timeoutMs(): number {\n return this.foundation.getTimeoutMs();\n }\n\n set timeoutMs(timeoutMs: number) {\n this.foundation.setTimeoutMs(timeoutMs);\n }\n\n get closeOnEscape(): boolean {\n return this.foundation.getCloseOnEscape();\n }\n\n set closeOnEscape(closeOnEscape: boolean) {\n this.foundation.setCloseOnEscape(closeOnEscape);\n }\n\n get isOpen(): boolean {\n return this.foundation.isOpen();\n }\n\n get labelText(): string {\n // This property only returns null if the node is a document, DOCTYPE, or notation.\n // On Element nodes, it always returns a string.\n return this.labelEl_.textContent!;\n }\n\n set labelText(labelText: string) {\n this.labelEl_.textContent = labelText;\n }\n\n get actionButtonText(): string {\n return this.actionEl_.textContent!;\n }\n\n set actionButtonText(actionButtonText: string) {\n this.actionEl_.textContent = actionButtonText;\n }\n\n private registerKeyDownHandler_(handler: SpecificEventListener<'keydown'>) {\n this.listen('keydown', handler);\n }\n\n private deregisterKeyDownHandler_(handler: SpecificEventListener<'keydown'>) {\n this.unlisten('keydown', handler);\n }\n\n private registerSurfaceClickHandler_(handler: SpecificEventListener<'click'>) {\n this.surfaceEl_.addEventListener('click', handler as EventListener);\n }\n\n private deregisterSurfaceClickHandler_(handler: SpecificEventListener<'click'>) {\n this.surfaceEl_.removeEventListener('click', handler as EventListener);\n }\n\n private isActionButton_(target: Element): boolean {\n return Boolean(closest(target, ACTION_SELECTOR));\n }\n\n private isActionIcon_(target: Element): boolean {\n return Boolean(closest(target, DISMISS_SELECTOR));\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst cssClasses = {\n CLOSING: 'mdc-snackbar--closing',\n OPEN: 'mdc-snackbar--open',\n OPENING: 'mdc-snackbar--opening',\n};\n\nconst strings = {\n ACTION_SELECTOR: '.mdc-snackbar__action',\n ARIA_LIVE_LABEL_TEXT_ATTR: 'data-mdc-snackbar-label-text',\n CLOSED_EVENT: 'MDCSnackbar:closed',\n CLOSING_EVENT: 'MDCSnackbar:closing',\n DISMISS_SELECTOR: '.mdc-snackbar__dismiss',\n LABEL_SELECTOR: '.mdc-snackbar__label',\n OPENED_EVENT: 'MDCSnackbar:opened',\n OPENING_EVENT: 'MDCSnackbar:opening',\n REASON_ACTION: 'action',\n REASON_DISMISS: 'dismiss',\n SURFACE_SELECTOR: '.mdc-snackbar__surface',\n};\n\nconst numbers = {\n DEFAULT_AUTO_DISMISS_TIMEOUT_MS: 5000,\n INDETERMINATE: -1,\n MAX_AUTO_DISMISS_TIMEOUT_MS: 10000,\n MIN_AUTO_DISMISS_TIMEOUT_MS: 4000,\n\n // These variables need to be kept in sync with the values in _variables.scss.\n SNACKBAR_ANIMATION_CLOSE_TIME_MS: 75,\n SNACKBAR_ANIMATION_OPEN_TIME_MS: 150,\n\n /**\n * Number of milliseconds to wait between temporarily clearing the label text\n * in the DOM and subsequently restoring it. This is necessary to force IE 11\n * to pick up the `aria-live` content change and announce it to the user.\n */\n ARIA_LIVE_DELAY_MS: 1000,\n};\n\nexport {cssClasses, strings, numbers};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCSnackbarAdapter} from './adapter';\nimport {cssClasses, numbers, strings} from './constants';\n\nconst {OPENING, OPEN, CLOSING} = cssClasses;\nconst {REASON_ACTION, REASON_DISMISS} = strings;\n\nexport class MDCSnackbarFoundation extends MDCFoundation<MDCSnackbarAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get numbers() {\n return numbers;\n }\n\n static get defaultAdapter(): MDCSnackbarAdapter {\n return {\n addClass: () => undefined,\n announce: () => undefined,\n notifyClosed: () => undefined,\n notifyClosing: () => undefined,\n notifyOpened: () => undefined,\n notifyOpening: () => undefined,\n removeClass: () => undefined,\n };\n }\n\n private isOpen_ = false;\n private animationFrame_ = 0;\n private animationTimer_ = 0;\n private autoDismissTimer_ = 0;\n private autoDismissTimeoutMs_ = numbers.DEFAULT_AUTO_DISMISS_TIMEOUT_MS;\n private closeOnEscape_ = true;\n\n constructor(adapter?: Partial<MDCSnackbarAdapter>) {\n super({...MDCSnackbarFoundation.defaultAdapter, ...adapter});\n }\n\n destroy() {\n this.clearAutoDismissTimer_();\n cancelAnimationFrame(this.animationFrame_);\n this.animationFrame_ = 0;\n clearTimeout(this.animationTimer_);\n this.animationTimer_ = 0;\n this.adapter.removeClass(OPENING);\n this.adapter.removeClass(OPEN);\n this.adapter.removeClass(CLOSING);\n }\n\n open() {\n this.clearAutoDismissTimer_();\n this.isOpen_ = true;\n this.adapter.notifyOpening();\n this.adapter.removeClass(CLOSING);\n this.adapter.addClass(OPENING);\n this.adapter.announce();\n\n // Wait a frame once display is no longer \"none\", to establish basis for animation\n this.runNextAnimationFrame_(() => {\n this.adapter.addClass(OPEN);\n\n this.animationTimer_ = setTimeout(() => {\n const timeoutMs = this.getTimeoutMs();\n this.handleAnimationTimerEnd_();\n this.adapter.notifyOpened();\n if (timeoutMs !== numbers.INDETERMINATE) {\n this.autoDismissTimer_ = setTimeout(() => {\n this.close(REASON_DISMISS);\n }, timeoutMs);\n }\n }, numbers.SNACKBAR_ANIMATION_OPEN_TIME_MS);\n });\n }\n\n /**\n * @param reason Why the snackbar was closed. Value will be passed to CLOSING_EVENT and CLOSED_EVENT via the\n * `event.detail.reason` property. Standard values are REASON_ACTION and REASON_DISMISS, but custom\n * client-specific values may also be used if desired.\n */\n close(reason = '') {\n if (!this.isOpen_) {\n // Avoid redundant close calls (and events), e.g. repeated interactions as the snackbar is animating closed\n return;\n }\n\n cancelAnimationFrame(this.animationFrame_);\n this.animationFrame_ = 0;\n this.clearAutoDismissTimer_();\n\n this.isOpen_ = false;\n this.adapter.notifyClosing(reason);\n this.adapter.addClass(cssClasses.CLOSING);\n this.adapter.removeClass(cssClasses.OPEN);\n this.adapter.removeClass(cssClasses.OPENING);\n\n clearTimeout(this.animationTimer_);\n this.animationTimer_ = setTimeout(() => {\n this.handleAnimationTimerEnd_();\n this.adapter.notifyClosed(reason);\n }, numbers.SNACKBAR_ANIMATION_CLOSE_TIME_MS);\n }\n\n isOpen(): boolean {\n return this.isOpen_;\n }\n\n getTimeoutMs(): number {\n return this.autoDismissTimeoutMs_;\n }\n\n setTimeoutMs(timeoutMs: number) {\n // Use shorter variable names to make the code more readable\n const minValue = numbers.MIN_AUTO_DISMISS_TIMEOUT_MS;\n const maxValue = numbers.MAX_AUTO_DISMISS_TIMEOUT_MS;\n const indeterminateValue = numbers.INDETERMINATE;\n\n if (timeoutMs === numbers.INDETERMINATE || (timeoutMs <= maxValue && timeoutMs >= minValue)) {\n this.autoDismissTimeoutMs_ = timeoutMs;\n } else {\n throw new Error(`\n timeoutMs must be an integer in the range ${minValue}–${maxValue}\n (or ${indeterminateValue} to disable), but got '${timeoutMs}'`);\n }\n }\n\n getCloseOnEscape(): boolean {\n return this.closeOnEscape_;\n }\n\n setCloseOnEscape(closeOnEscape: boolean) {\n this.closeOnEscape_ = closeOnEscape;\n }\n\n handleKeyDown(evt: KeyboardEvent) {\n const isEscapeKey = evt.key === 'Escape' || evt.keyCode === 27;\n if (isEscapeKey && this.getCloseOnEscape()) {\n this.close(REASON_DISMISS);\n }\n }\n\n handleActionButtonClick(_evt: MouseEvent) {\n this.close(REASON_ACTION);\n }\n\n handleActionIconClick(_evt: MouseEvent) {\n this.close(REASON_DISMISS);\n }\n\n private clearAutoDismissTimer_() {\n clearTimeout(this.autoDismissTimer_);\n this.autoDismissTimer_ = 0;\n }\n\n private handleAnimationTimerEnd_() {\n this.animationTimer_ = 0;\n this.adapter.removeClass(cssClasses.OPENING);\n this.adapter.removeClass(cssClasses.CLOSING);\n }\n\n /**\n * Runs the given logic on the next animation frame, using setTimeout to factor in Firefox reflow behavior.\n */\n private runNextAnimationFrame_(callback: () => void) {\n cancelAnimationFrame(this.animationFrame_);\n this.animationFrame_ = requestAnimationFrame(() => {\n this.animationFrame_ = 0;\n clearTimeout(this.animationTimer_);\n this.animationTimer_ = setTimeout(callback, 0);\n });\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCSnackbarFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport * as util from './util';\n\nexport {util};\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './types';\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {numbers, strings} from './constants';\n\nconst {ARIA_LIVE_DELAY_MS} = numbers;\nconst {ARIA_LIVE_LABEL_TEXT_ATTR} = strings;\n\nfunction announce(ariaEl: Element, labelEl: Element = ariaEl) {\n const priority = ariaEl.getAttribute('aria-live');\n\n // Trim text to ignore `&nbsp;` (see below).\n // textContent is only null if the node is a document, DOCTYPE, or notation.\n const labelText = labelEl.textContent!.trim();\n if (!labelText || !priority) {\n return;\n }\n\n // Temporarily disable `aria-live` to prevent JAWS+Firefox from announcing the message twice.\n ariaEl.setAttribute('aria-live', 'off');\n\n // Temporarily clear `textContent` to force a DOM mutation event that will be detected by screen readers.\n // `aria-live` elements are only announced when the element's `textContent` *changes*, so snackbars\n // sent to the browser in the initial HTML response won't be read unless we clear the element's `textContent` first.\n // Similarly, displaying the same snackbar message twice in a row doesn't trigger a DOM mutation event,\n // so screen readers won't announce the second message unless we first clear `textContent`.\n //\n // We have to clear the label text two different ways to make it work in all browsers and screen readers:\n //\n // 1. `textContent = ''` is required for IE11 + JAWS\n // 2. `innerHTML = '&nbsp;'` is required for Chrome + JAWS and NVDA\n //\n // All other browser/screen reader combinations support both methods.\n //\n // The wrapper `<span>` visually hides the space character so that it doesn't cause jank when added/removed.\n // N.B.: Setting `position: absolute`, `opacity: 0`, or `height: 0` prevents Chrome from detecting the DOM change.\n //\n // This technique has been tested in:\n //\n // * JAWS 2019:\n // - Chrome 70\n // - Firefox 60 (ESR)\n // - IE 11\n // * NVDA 2018:\n // - Chrome 70\n // - Firefox 60 (ESR)\n // - IE 11\n // * ChromeVox 53\n labelEl.textContent = '';\n labelEl.innerHTML = '<span style=\"display: inline-block; width: 0; height: 1px;\">&nbsp;</span>';\n\n // Prevent visual jank by temporarily displaying the label text in the ::before pseudo-element.\n // CSS generated content is normally announced by screen readers\n // (except in IE 11; see https://tink.uk/accessibility-support-for-css-generated-content/);\n // however, `aria-live` is turned off, so this DOM update will be ignored by screen readers.\n labelEl.setAttribute(ARIA_LIVE_LABEL_TEXT_ATTR, labelText);\n\n setTimeout(() => {\n // Allow screen readers to announce changes to the DOM again.\n ariaEl.setAttribute('aria-live', priority);\n\n // Remove the message from the ::before pseudo-element.\n labelEl.removeAttribute(ARIA_LIVE_LABEL_TEXT_ATTR);\n\n // Restore the original label text, which will be announced by screen readers.\n labelEl.textContent = labelText;\n }, ARIA_LIVE_DELAY_MS);\n}\n\nexport {announce};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {EventType, SpecificEventListener} from '@material/base/types';\nimport {applyPassive} from '@material/dom/events';\nimport {matches} from '@material/dom/ponyfill';\nimport {MDCRippleAdapter} from '@material/ripple/adapter';\nimport {MDCRipple} from '@material/ripple/component';\nimport {MDCRippleFoundation} from '@material/ripple/foundation';\nimport {MDCRippleCapableSurface} from '@material/ripple/types';\nimport {MDCSwitchAdapter} from './adapter';\nimport {MDCSwitchFoundation} from './foundation';\n\nexport class MDCSwitch extends MDCComponent<MDCSwitchFoundation> implements MDCRippleCapableSurface {\n static attachTo(root: HTMLElement) {\n return new MDCSwitch(root);\n }\n\n private readonly ripple_ = this.createRipple_();\n\n // Initialized in `initialSyncWithDOM`.\n private changeHandler_!: EventListener;\n\n destroy() {\n super.destroy();\n this.ripple_.destroy();\n this.nativeControl_.removeEventListener('change', this.changeHandler_);\n }\n\n initialSyncWithDOM() {\n this.changeHandler_ = (...args) => this.foundation.handleChange(...args);\n this.nativeControl_.addEventListener('change', this.changeHandler_);\n\n // Sometimes the checked state of the input element is saved in the history.\n // The switch styling should match the checked state of the input element.\n // Do an initial sync between the native control and the foundation.\n this.checked = this.checked;\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCSwitchAdapter = {\n addClass: (className) => this.root.classList.add(className),\n removeClass: (className) => this.root.classList.remove(className),\n setNativeControlChecked: (checked) => this.nativeControl_.checked =\n checked,\n setNativeControlDisabled: (disabled) => this.nativeControl_.disabled =\n disabled,\n setNativeControlAttr: (attr, value) =>\n this.nativeControl_.setAttribute(attr, value),\n };\n return new MDCSwitchFoundation(adapter);\n }\n\n get ripple() {\n return this.ripple_;\n }\n\n get checked() {\n return this.nativeControl_.checked;\n }\n\n set checked(checked) {\n this.foundation.setChecked(checked);\n }\n\n get disabled() {\n return this.nativeControl_.disabled;\n }\n\n set disabled(disabled) {\n this.foundation.setDisabled(disabled);\n }\n\n private createRipple_(): MDCRipple {\n const {RIPPLE_SURFACE_SELECTOR} = MDCSwitchFoundation.strings;\n const rippleSurface =\n this.root.querySelector(RIPPLE_SURFACE_SELECTOR) as HTMLElement;\n\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCRippleAdapter = {\n ...MDCRipple.createAdapter(this),\n addClass: (className: string) => rippleSurface.classList.add(className),\n computeBoundingRect: () => rippleSurface.getBoundingClientRect(),\n deregisterInteractionHandler: <K extends EventType>(\n evtType: K, handler: SpecificEventListener<K>) => {\n this.nativeControl_.removeEventListener(evtType, handler, applyPassive());\n },\n isSurfaceActive: () => matches(this.nativeControl_, ':active'),\n isUnbounded: () => true,\n registerInteractionHandler: <K extends EventType>(\n evtType: K, handler: SpecificEventListener<K>) => {\n this.nativeControl_.addEventListener(evtType, handler, applyPassive());\n },\n removeClass: (className: string) => {\n rippleSurface.classList.remove(className);\n },\n updateCssVariable: (varName: string, value: string) => {\n rippleSurface.style.setProperty(varName, value);\n },\n };\n return new MDCRipple(this.root, new MDCRippleFoundation(adapter));\n }\n\n private get nativeControl_() {\n const {NATIVE_CONTROL_SELECTOR} = MDCSwitchFoundation.strings;\n return this.root.querySelector(NATIVE_CONTROL_SELECTOR) as HTMLInputElement;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/** CSS classes used by the switch. */\nconst cssClasses = {\n /** Class used for a switch that is in the \"checked\" (on) position. */\n CHECKED: 'mdc-switch--checked',\n /** Class used for a switch that is disabled. */\n DISABLED: 'mdc-switch--disabled',\n};\n\n/** String constants used by the switch. */\nconst strings = {\n /** Aria attribute for checked or unchecked state of switch */\n ARIA_CHECKED_ATTR: 'aria-checked',\n /** A CSS selector used to locate the native HTML control for the switch. */\n NATIVE_CONTROL_SELECTOR: '.mdc-switch__native-control',\n /** A CSS selector used to locate the ripple surface element for the switch. */\n RIPPLE_SURFACE_SELECTOR: '.mdc-switch__thumb-underlay',\n};\n\nexport {cssClasses, strings};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCSwitchAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\n\nexport class MDCSwitchFoundation extends MDCFoundation<MDCSwitchAdapter> {\n /** The string constants used by the switch. */\n static get strings() {\n return strings;\n }\n\n /** The CSS classes used by the switch. */\n static get cssClasses() {\n return cssClasses;\n }\n\n /** The default Adapter for the switch. */\n static get defaultAdapter(): MDCSwitchAdapter {\n return {\n addClass: () => undefined,\n removeClass: () => undefined,\n setNativeControlChecked: () => undefined,\n setNativeControlDisabled: () => undefined,\n setNativeControlAttr: () => undefined,\n };\n }\n\n constructor(adapter?: Partial<MDCSwitchAdapter>) {\n super({...MDCSwitchFoundation.defaultAdapter, ...adapter});\n }\n\n /** Sets the checked state of the switch. */\n setChecked(checked: boolean) {\n this.adapter.setNativeControlChecked(checked);\n this.updateAriaChecked_(checked);\n this.updateCheckedStyling_(checked);\n }\n\n /** Sets the disabled state of the switch. */\n setDisabled(disabled: boolean) {\n this.adapter.setNativeControlDisabled(disabled);\n if (disabled) {\n this.adapter.addClass(cssClasses.DISABLED);\n } else {\n this.adapter.removeClass(cssClasses.DISABLED);\n }\n }\n\n /** Handles the change event for the switch native control. */\n handleChange(evt: Event) {\n const nativeControl = evt.target as HTMLInputElement;\n this.updateAriaChecked_(nativeControl.checked);\n this.updateCheckedStyling_(nativeControl.checked);\n }\n\n /** Updates the styling of the switch based on its checked state. */\n private updateCheckedStyling_(checked: boolean) {\n if (checked) {\n this.adapter.addClass(cssClasses.CHECKED);\n } else {\n this.adapter.removeClass(cssClasses.CHECKED);\n }\n }\n\n private updateAriaChecked_(checked: boolean) {\n this.adapter.setNativeControlAttr(\n strings.ARIA_CHECKED_ATTR, `${!!checked}`);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCSwitchFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {CustomEventListener, SpecificEventListener} from '@material/base/types';\nimport {MDCTabScroller, MDCTabScrollerFactory} from '@material/tab-scroller/component';\nimport {MDCTab, MDCTabFactory} from '@material/tab/component';\nimport {MDCTabFoundation} from '@material/tab/foundation';\nimport {MDCTabInteractionEvent} from '@material/tab/types';\nimport {MDCTabBarAdapter} from './adapter';\nimport {MDCTabBarFoundation} from './foundation';\nimport {MDCTabBarActivatedEventDetail} from './types';\n\nconst {strings} = MDCTabBarFoundation;\n\nlet tabIdCounter = 0;\n\nexport class MDCTabBar extends MDCComponent<MDCTabBarFoundation> {\n static attachTo(root: Element): MDCTabBar {\n return new MDCTabBar(root);\n }\n\n private tabList_!: MDCTab[]; // assigned in initialize()\n private tabScroller_!: MDCTabScroller | null; // assigned in initialize()\n private handleTabInteraction_!: CustomEventListener<MDCTabInteractionEvent>; // assigned in initialSyncWithDOM()\n private handleKeyDown_!: SpecificEventListener<'keydown'>; // assigned in initialSyncWithDOM()\n\n set focusOnActivate(focusOnActivate: boolean) {\n this.tabList_.forEach((tab) => tab.focusOnActivate = focusOnActivate);\n }\n\n set useAutomaticActivation(useAutomaticActivation: boolean) {\n this.foundation.setUseAutomaticActivation(useAutomaticActivation);\n }\n\n initialize(\n tabFactory: MDCTabFactory = (el) => new MDCTab(el),\n tabScrollerFactory: MDCTabScrollerFactory = (el) => new MDCTabScroller(el),\n ) {\n this.tabList_ = this.instantiateTabs_(tabFactory);\n this.tabScroller_ = this.instantiateTabScroller_(tabScrollerFactory);\n }\n\n initialSyncWithDOM() {\n this.handleTabInteraction_ = (evt) =>\n this.foundation.handleTabInteraction(evt);\n this.handleKeyDown_ = (evt) => this.foundation.handleKeyDown(evt);\n\n this.listen(MDCTabFoundation.strings.INTERACTED_EVENT, this.handleTabInteraction_);\n this.listen('keydown', this.handleKeyDown_);\n\n for (let i = 0; i < this.tabList_.length; i++) {\n if (this.tabList_[i].active) {\n this.scrollIntoView(i);\n break;\n }\n }\n }\n\n destroy() {\n super.destroy();\n this.unlisten(MDCTabFoundation.strings.INTERACTED_EVENT, this.handleTabInteraction_);\n this.unlisten('keydown', this.handleKeyDown_);\n this.tabList_.forEach((tab) => tab.destroy());\n\n if (this.tabScroller_) {\n this.tabScroller_.destroy();\n }\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCTabBarAdapter = {\n scrollTo: (scrollX) => this.tabScroller_!.scrollTo(scrollX),\n incrementScroll: (scrollXIncrement) =>\n this.tabScroller_!.incrementScroll(scrollXIncrement),\n getScrollPosition: () => this.tabScroller_!.getScrollPosition(),\n getScrollContentWidth: () => this.tabScroller_!.getScrollContentWidth(),\n getOffsetWidth: () => (this.root as HTMLElement).offsetWidth,\n isRTL: () => window.getComputedStyle(this.root).getPropertyValue(\n 'direction') === 'rtl',\n setActiveTab: (index) => this.foundation.activateTab(index),\n activateTabAtIndex: (index, clientRect) =>\n this.tabList_[index].activate(clientRect),\n deactivateTabAtIndex: (index) => this.tabList_[index].deactivate(),\n focusTabAtIndex: (index) => this.tabList_[index].focus(),\n getTabIndicatorClientRectAtIndex: (index) =>\n this.tabList_[index].computeIndicatorClientRect(),\n getTabDimensionsAtIndex: (index) =>\n this.tabList_[index].computeDimensions(),\n getPreviousActiveTabIndex: () => {\n for (let i = 0; i < this.tabList_.length; i++) {\n if (this.tabList_[i].active) {\n return i;\n }\n }\n return -1;\n },\n getFocusedTabIndex: () => {\n const tabElements = this.getTabElements_();\n const activeElement = document.activeElement!;\n return tabElements.indexOf(activeElement);\n },\n getIndexOfTabById: (id) => {\n for (let i = 0; i < this.tabList_.length; i++) {\n if (this.tabList_[i].id === id) {\n return i;\n }\n }\n return -1;\n },\n getTabListLength: () => this.tabList_.length,\n notifyTabActivated: (index) => this.emit<MDCTabBarActivatedEventDetail>(\n strings.TAB_ACTIVATED_EVENT, {index}, true),\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCTabBarFoundation(adapter);\n }\n\n /**\n * Activates the tab at the given index\n * @param index The index of the tab\n */\n activateTab(index: number) {\n this.foundation.activateTab(index);\n }\n\n /**\n * Scrolls the tab at the given index into view\n * @param index THe index of the tab\n */\n scrollIntoView(index: number) {\n this.foundation.scrollIntoView(index);\n }\n\n /**\n * Returns all the tab elements in a nice clean array\n */\n private getTabElements_(): Element[] {\n return [].slice.call(this.root.querySelectorAll(strings.TAB_SELECTOR));\n }\n\n /**\n * Instantiates tab components on all child tab elements\n */\n private instantiateTabs_(tabFactory: MDCTabFactory) {\n return this.getTabElements_().map((el) => {\n el.id = el.id || `mdc-tab-${++tabIdCounter}`;\n return tabFactory(el);\n });\n }\n\n /**\n * Instantiates tab scroller component on the child tab scroller element\n */\n private instantiateTabScroller_(tabScrollerFactory: MDCTabScrollerFactory): MDCTabScroller | null {\n const tabScrollerElement =\n this.root.querySelector(strings.TAB_SCROLLER_SELECTOR);\n if (tabScrollerElement) {\n return tabScrollerFactory(tabScrollerElement);\n }\n return null;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst strings = {\n ARROW_LEFT_KEY: 'ArrowLeft',\n ARROW_RIGHT_KEY: 'ArrowRight',\n END_KEY: 'End',\n ENTER_KEY: 'Enter',\n HOME_KEY: 'Home',\n SPACE_KEY: 'Space',\n TAB_ACTIVATED_EVENT: 'MDCTabBar:activated',\n TAB_SCROLLER_SELECTOR: '.mdc-tab-scroller',\n TAB_SELECTOR: '.mdc-tab',\n};\n\nconst numbers = {\n ARROW_LEFT_KEYCODE: 37,\n ARROW_RIGHT_KEYCODE: 39,\n END_KEYCODE: 35,\n ENTER_KEYCODE: 13,\n EXTRA_SCROLL_AMOUNT: 20,\n HOME_KEYCODE: 36,\n SPACE_KEYCODE: 32,\n};\n\nexport {numbers, strings};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCTabDimensions, MDCTabInteractionEvent} from '@material/tab/types';\nimport {MDCTabBarAdapter} from './adapter';\nimport {numbers, strings} from './constants';\n\nconst ACCEPTABLE_KEYS = new Set<string>();\n// IE11 has no support for new Set with iterable so we need to initialize this by hand\nACCEPTABLE_KEYS.add(strings.ARROW_LEFT_KEY);\nACCEPTABLE_KEYS.add(strings.ARROW_RIGHT_KEY);\nACCEPTABLE_KEYS.add(strings.END_KEY);\nACCEPTABLE_KEYS.add(strings.HOME_KEY);\nACCEPTABLE_KEYS.add(strings.ENTER_KEY);\nACCEPTABLE_KEYS.add(strings.SPACE_KEY);\n\nconst KEYCODE_MAP = new Map<number, string>();\n// IE11 has no support for new Map with iterable so we need to initialize this by hand\nKEYCODE_MAP.set(numbers.ARROW_LEFT_KEYCODE, strings.ARROW_LEFT_KEY);\nKEYCODE_MAP.set(numbers.ARROW_RIGHT_KEYCODE, strings.ARROW_RIGHT_KEY);\nKEYCODE_MAP.set(numbers.END_KEYCODE, strings.END_KEY);\nKEYCODE_MAP.set(numbers.HOME_KEYCODE, strings.HOME_KEY);\nKEYCODE_MAP.set(numbers.ENTER_KEYCODE, strings.ENTER_KEY);\nKEYCODE_MAP.set(numbers.SPACE_KEYCODE, strings.SPACE_KEY);\n\nexport class MDCTabBarFoundation extends MDCFoundation<MDCTabBarAdapter> {\n static get strings() {\n return strings;\n }\n\n static get numbers() {\n return numbers;\n }\n\n static get defaultAdapter(): MDCTabBarAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n scrollTo: () => undefined,\n incrementScroll: () => undefined,\n getScrollPosition: () => 0,\n getScrollContentWidth: () => 0,\n getOffsetWidth: () => 0,\n isRTL: () => false,\n setActiveTab: () => undefined,\n activateTabAtIndex: () => undefined,\n deactivateTabAtIndex: () => undefined,\n focusTabAtIndex: () => undefined,\n getTabIndicatorClientRectAtIndex: () => ({top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0}),\n getTabDimensionsAtIndex: () => ({rootLeft: 0, rootRight: 0, contentLeft: 0, contentRight: 0}),\n getPreviousActiveTabIndex: () => -1,\n getFocusedTabIndex: () => -1,\n getIndexOfTabById: () => -1,\n getTabListLength: () => 0,\n notifyTabActivated: () => undefined,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private useAutomaticActivation_ = false;\n\n constructor(adapter?: Partial<MDCTabBarAdapter>) {\n super({...MDCTabBarFoundation.defaultAdapter, ...adapter});\n }\n\n /**\n * Switches between automatic and manual activation modes.\n * See https://www.w3.org/TR/wai-aria-practices/#tabpanel for examples.\n */\n setUseAutomaticActivation(useAutomaticActivation: boolean) {\n this.useAutomaticActivation_ = useAutomaticActivation;\n }\n\n activateTab(index: number) {\n const previousActiveIndex = this.adapter.getPreviousActiveTabIndex();\n if (!this.indexIsInRange_(index) || index === previousActiveIndex) {\n return;\n }\n\n let previousClientRect;\n if (previousActiveIndex !== -1) {\n this.adapter.deactivateTabAtIndex(previousActiveIndex);\n previousClientRect =\n this.adapter.getTabIndicatorClientRectAtIndex(previousActiveIndex);\n }\n\n this.adapter.activateTabAtIndex(index, previousClientRect);\n this.scrollIntoView(index);\n\n this.adapter.notifyTabActivated(index);\n }\n\n handleKeyDown(evt: KeyboardEvent) {\n // Get the key from the event\n const key = this.getKeyFromEvent_(evt);\n\n // Early exit if the event key isn't one of the keyboard navigation keys\n if (key === undefined) {\n return;\n }\n\n // Prevent default behavior for movement keys, but not for activation keys, since :active is used to apply ripple\n if (!this.isActivationKey_(key)) {\n evt.preventDefault();\n }\n\n if (this.useAutomaticActivation_) {\n if (this.isActivationKey_(key)) {\n return;\n }\n\n const index = this.determineTargetFromKey_(\n this.adapter.getPreviousActiveTabIndex(), key);\n this.adapter.setActiveTab(index);\n this.scrollIntoView(index);\n } else {\n const focusedTabIndex = this.adapter.getFocusedTabIndex();\n if (this.isActivationKey_(key)) {\n this.adapter.setActiveTab(focusedTabIndex);\n } else {\n const index = this.determineTargetFromKey_(focusedTabIndex, key);\n this.adapter.focusTabAtIndex(index);\n this.scrollIntoView(index);\n }\n }\n }\n\n /**\n * Handles the MDCTab:interacted event\n */\n handleTabInteraction(evt: MDCTabInteractionEvent) {\n this.adapter.setActiveTab(this.adapter.getIndexOfTabById(evt.detail.tabId));\n }\n\n /**\n * Scrolls the tab at the given index into view\n * @param index The tab index to make visible\n */\n scrollIntoView(index: number) {\n // Early exit if the index is out of range\n if (!this.indexIsInRange_(index)) {\n return;\n }\n\n // Always scroll to 0 if scrolling to the 0th index\n if (index === 0) {\n return this.adapter.scrollTo(0);\n }\n\n // Always scroll to the max value if scrolling to the Nth index\n // MDCTabScroller.scrollTo() will never scroll past the max possible value\n if (index === this.adapter.getTabListLength() - 1) {\n return this.adapter.scrollTo(this.adapter.getScrollContentWidth());\n }\n\n if (this.isRTL_()) {\n return this.scrollIntoViewRTL_(index);\n }\n\n this.scrollIntoView_(index);\n }\n\n /**\n * Private method for determining the index of the destination tab based on what key was pressed\n * @param origin The original index from which to determine the destination\n * @param key The name of the key\n */\n private determineTargetFromKey_(origin: number, key: string): number {\n const isRTL = this.isRTL_();\n const maxIndex = this.adapter.getTabListLength() - 1;\n const shouldGoToEnd = key === strings.END_KEY;\n const shouldDecrement = key === strings.ARROW_LEFT_KEY && !isRTL || key === strings.ARROW_RIGHT_KEY && isRTL;\n const shouldIncrement = key === strings.ARROW_RIGHT_KEY && !isRTL || key === strings.ARROW_LEFT_KEY && isRTL;\n let index = origin;\n\n if (shouldGoToEnd) {\n index = maxIndex;\n } else if (shouldDecrement) {\n index -= 1;\n } else if (shouldIncrement) {\n index += 1;\n } else {\n index = 0;\n }\n\n if (index < 0) {\n index = maxIndex;\n } else if (index > maxIndex) {\n index = 0;\n }\n\n return index;\n }\n\n /**\n * Calculates the scroll increment that will make the tab at the given index visible\n * @param index The index of the tab\n * @param nextIndex The index of the next tab\n * @param scrollPosition The current scroll position\n * @param barWidth The width of the Tab Bar\n */\n private calculateScrollIncrement_(\n index: number,\n nextIndex: number,\n scrollPosition: number,\n barWidth: number,\n ): number {\n const nextTabDimensions = this.adapter.getTabDimensionsAtIndex(nextIndex);\n const relativeContentLeft = nextTabDimensions.contentLeft - scrollPosition - barWidth;\n const relativeContentRight = nextTabDimensions.contentRight - scrollPosition;\n const leftIncrement = relativeContentRight - numbers.EXTRA_SCROLL_AMOUNT;\n const rightIncrement = relativeContentLeft + numbers.EXTRA_SCROLL_AMOUNT;\n\n if (nextIndex < index) {\n return Math.min(leftIncrement, 0);\n }\n\n return Math.max(rightIncrement, 0);\n }\n\n /**\n * Calculates the scroll increment that will make the tab at the given index visible in RTL\n * @param index The index of the tab\n * @param nextIndex The index of the next tab\n * @param scrollPosition The current scroll position\n * @param barWidth The width of the Tab Bar\n * @param scrollContentWidth The width of the scroll content\n */\n private calculateScrollIncrementRTL_(\n index: number,\n nextIndex: number,\n scrollPosition: number,\n barWidth: number,\n scrollContentWidth: number,\n ): number {\n const nextTabDimensions = this.adapter.getTabDimensionsAtIndex(nextIndex);\n const relativeContentLeft = scrollContentWidth - nextTabDimensions.contentLeft - scrollPosition;\n const relativeContentRight = scrollContentWidth - nextTabDimensions.contentRight - scrollPosition - barWidth;\n const leftIncrement = relativeContentRight + numbers.EXTRA_SCROLL_AMOUNT;\n const rightIncrement = relativeContentLeft - numbers.EXTRA_SCROLL_AMOUNT;\n\n if (nextIndex > index) {\n return Math.max(leftIncrement, 0);\n }\n\n return Math.min(rightIncrement, 0);\n }\n\n /**\n * Determines the index of the adjacent tab closest to either edge of the Tab Bar\n * @param index The index of the tab\n * @param tabDimensions The dimensions of the tab\n * @param scrollPosition The current scroll position\n * @param barWidth The width of the tab bar\n */\n private findAdjacentTabIndexClosestToEdge_(\n index: number,\n tabDimensions: MDCTabDimensions,\n scrollPosition: number,\n barWidth: number,\n ): number {\n /**\n * Tabs are laid out in the Tab Scroller like this:\n *\n * Scroll Position\n * +---+\n * | | Bar Width\n * | +-----------------------------------+\n * | | |\n * | V V\n * | +-----------------------------------+\n * V | Tab Scroller |\n * +------------+--------------+-------------------+\n * | Tab | Tab | Tab |\n * +------------+--------------+-------------------+\n * | |\n * +-----------------------------------+\n *\n * To determine the next adjacent index, we look at the Tab root left and\n * Tab root right, both relative to the scroll position. If the Tab root\n * left is less than 0, then we know it's out of view to the left. If the\n * Tab root right minus the bar width is greater than 0, we know the Tab is\n * out of view to the right. From there, we either increment or decrement\n * the index.\n */\n const relativeRootLeft = tabDimensions.rootLeft - scrollPosition;\n const relativeRootRight = tabDimensions.rootRight - scrollPosition - barWidth;\n const relativeRootDelta = relativeRootLeft + relativeRootRight;\n const leftEdgeIsCloser = relativeRootLeft < 0 || relativeRootDelta < 0;\n const rightEdgeIsCloser = relativeRootRight > 0 || relativeRootDelta > 0;\n\n if (leftEdgeIsCloser) {\n return index - 1;\n }\n\n if (rightEdgeIsCloser) {\n return index + 1;\n }\n\n return -1;\n }\n\n /**\n * Determines the index of the adjacent tab closest to either edge of the Tab Bar in RTL\n * @param index The index of the tab\n * @param tabDimensions The dimensions of the tab\n * @param scrollPosition The current scroll position\n * @param barWidth The width of the tab bar\n * @param scrollContentWidth The width of the scroller content\n */\n private findAdjacentTabIndexClosestToEdgeRTL_(\n index: number,\n tabDimensions: MDCTabDimensions,\n scrollPosition: number,\n barWidth: number,\n scrollContentWidth: number,\n ): number {\n const rootLeft = scrollContentWidth - tabDimensions.rootLeft - barWidth - scrollPosition;\n const rootRight = scrollContentWidth - tabDimensions.rootRight - scrollPosition;\n const rootDelta = rootLeft + rootRight;\n const leftEdgeIsCloser = rootLeft > 0 || rootDelta > 0;\n const rightEdgeIsCloser = rootRight < 0 || rootDelta < 0;\n\n if (leftEdgeIsCloser) {\n return index + 1;\n }\n\n if (rightEdgeIsCloser) {\n return index - 1;\n }\n\n return -1;\n }\n\n /**\n * Returns the key associated with a keydown event\n * @param evt The keydown event\n */\n private getKeyFromEvent_(evt: KeyboardEvent): string {\n if (ACCEPTABLE_KEYS.has(evt.key)) {\n return evt.key;\n }\n return KEYCODE_MAP.get(evt.keyCode)!;\n }\n\n private isActivationKey_(key: string) {\n return key === strings.SPACE_KEY || key === strings.ENTER_KEY;\n }\n\n /**\n * Returns whether a given index is inclusively between the ends\n * @param index The index to test\n */\n private indexIsInRange_(index: number) {\n return index >= 0 && index < this.adapter.getTabListLength();\n }\n\n /**\n * Returns the view's RTL property\n */\n private isRTL_(): boolean {\n return this.adapter.isRTL();\n }\n\n /**\n * Scrolls the tab at the given index into view for left-to-right user agents.\n * @param index The index of the tab to scroll into view\n */\n private scrollIntoView_(index: number) {\n const scrollPosition = this.adapter.getScrollPosition();\n const barWidth = this.adapter.getOffsetWidth();\n const tabDimensions = this.adapter.getTabDimensionsAtIndex(index);\n const nextIndex = this.findAdjacentTabIndexClosestToEdge_(index, tabDimensions, scrollPosition, barWidth);\n\n if (!this.indexIsInRange_(nextIndex)) {\n return;\n }\n\n const scrollIncrement = this.calculateScrollIncrement_(index, nextIndex, scrollPosition, barWidth);\n this.adapter.incrementScroll(scrollIncrement);\n }\n\n /**\n * Scrolls the tab at the given index into view in RTL\n * @param index The tab index to make visible\n */\n private scrollIntoViewRTL_(index: number) {\n const scrollPosition = this.adapter.getScrollPosition();\n const barWidth = this.adapter.getOffsetWidth();\n const tabDimensions = this.adapter.getTabDimensionsAtIndex(index);\n const scrollWidth = this.adapter.getScrollContentWidth();\n const nextIndex = this.findAdjacentTabIndexClosestToEdgeRTL_(\n index, tabDimensions, scrollPosition, barWidth, scrollWidth);\n\n if (!this.indexIsInRange_(nextIndex)) {\n return;\n }\n\n const scrollIncrement = this.calculateScrollIncrementRTL_(index, nextIndex, scrollPosition, barWidth, scrollWidth);\n this.adapter.incrementScroll(scrollIncrement);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTabBarFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './types';\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\n\nimport {MDCTabIndicatorAdapter} from './adapter';\nimport {MDCFadingTabIndicatorFoundation} from './fading-foundation';\nimport {MDCTabIndicatorFoundation} from './foundation';\nimport {MDCSlidingTabIndicatorFoundation} from './sliding-foundation';\n\nexport type MDCTabIndicatorFactory = (el: Element, foundation?: MDCTabIndicatorFoundation) => MDCTabIndicator;\n\nexport class MDCTabIndicator extends MDCComponent<MDCTabIndicatorFoundation> {\n static attachTo(root: Element): MDCTabIndicator {\n return new MDCTabIndicator(root);\n }\n\n private content_!: HTMLElement; // assigned in initialize()\n\n initialize() {\n this.content_ = this.root.querySelector<HTMLElement>(\n MDCTabIndicatorFoundation.strings.CONTENT_SELECTOR)!;\n }\n\n computeContentClientRect(): ClientRect {\n return this.foundation.computeContentClientRect();\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCTabIndicatorAdapter = {\n addClass: (className) => this.root.classList.add(className),\n removeClass: (className) => this.root.classList.remove(className),\n computeContentClientRect: () => this.content_.getBoundingClientRect(),\n setContentStyleProperty: (prop, value) =>\n this.content_.style.setProperty(prop, value),\n };\n // tslint:enable:object-literal-sort-keys\n\n if (this.root.classList.contains(\n MDCTabIndicatorFoundation.cssClasses.FADE)) {\n return new MDCFadingTabIndicatorFoundation(adapter);\n }\n\n // Default to the sliding indicator\n return new MDCSlidingTabIndicatorFoundation(adapter);\n }\n\n activate(previousIndicatorClientRect?: ClientRect) {\n this.foundation.activate(previousIndicatorClientRect);\n }\n\n deactivate() {\n this.foundation.deactivate();\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst cssClasses = {\n ACTIVE: 'mdc-tab-indicator--active',\n FADE: 'mdc-tab-indicator--fade',\n NO_TRANSITION: 'mdc-tab-indicator--no-transition',\n};\n\nconst strings = {\n CONTENT_SELECTOR: '.mdc-tab-indicator__content',\n};\n\nexport {\n cssClasses,\n strings,\n};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCTabIndicatorFoundation} from './foundation';\n\n/* istanbul ignore next: subclass is not a branch statement */\nexport class MDCFadingTabIndicatorFoundation extends MDCTabIndicatorFoundation {\n activate() {\n this.adapter.addClass(MDCTabIndicatorFoundation.cssClasses.ACTIVE);\n }\n\n deactivate() {\n this.adapter.removeClass(MDCTabIndicatorFoundation.cssClasses.ACTIVE);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCFadingTabIndicatorFoundation;\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCTabIndicatorAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\n\nexport abstract class MDCTabIndicatorFoundation extends MDCFoundation<MDCTabIndicatorAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get defaultAdapter(): MDCTabIndicatorAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: () => undefined,\n removeClass: () => undefined,\n computeContentClientRect: () => ({top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0}),\n setContentStyleProperty: () => undefined,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n constructor(adapter?: Partial<MDCTabIndicatorAdapter>) {\n super({...MDCTabIndicatorFoundation.defaultAdapter, ...adapter});\n }\n\n computeContentClientRect(): ClientRect {\n return this.adapter.computeContentClientRect();\n }\n\n abstract activate(previousIndicatorClientRect?: ClientRect): void;\n abstract deactivate(): void;\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTabIndicatorFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './fading-foundation';\nexport * from './sliding-foundation';\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCTabIndicatorFoundation} from './foundation';\n\n/* istanbul ignore next: subclass is not a branch statement */\nexport class MDCSlidingTabIndicatorFoundation extends MDCTabIndicatorFoundation {\n activate(previousIndicatorClientRect?: ClientRect) {\n // Early exit if no indicator is present to handle cases where an indicator\n // may be activated without a prior indicator state\n if (!previousIndicatorClientRect) {\n this.adapter.addClass(MDCTabIndicatorFoundation.cssClasses.ACTIVE);\n return;\n }\n\n // This animation uses the FLIP approach. You can read more about it at the link below:\n // https://aerotwist.com/blog/flip-your-animations/\n\n // Calculate the dimensions based on the dimensions of the previous indicator\n const currentClientRect = this.computeContentClientRect();\n const widthDelta = previousIndicatorClientRect.width / currentClientRect.width;\n const xPosition = previousIndicatorClientRect.left - currentClientRect.left;\n this.adapter.addClass(MDCTabIndicatorFoundation.cssClasses.NO_TRANSITION);\n this.adapter.setContentStyleProperty(\n 'transform', `translateX(${xPosition}px) scaleX(${widthDelta})`);\n\n // Force repaint before updating classes and transform to ensure the transform properly takes effect\n this.computeContentClientRect();\n\n this.adapter.removeClass(\n MDCTabIndicatorFoundation.cssClasses.NO_TRANSITION);\n this.adapter.addClass(MDCTabIndicatorFoundation.cssClasses.ACTIVE);\n this.adapter.setContentStyleProperty('transform', '');\n }\n\n deactivate() {\n this.adapter.removeClass(MDCTabIndicatorFoundation.cssClasses.ACTIVE);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCSlidingTabIndicatorFoundation;\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {SpecificEventListener} from '@material/base/types';\nimport {applyPassive} from '@material/dom/events';\nimport {matches} from '@material/dom/ponyfill';\nimport {MDCTabScrollerAdapter} from './adapter';\nimport {MDCTabScrollerFoundation} from './foundation';\nimport * as util from './util';\n\ntype InteractionEventType = 'wheel' | 'touchstart' | 'pointerdown' | 'mousedown' | 'keydown';\n\nexport type MDCTabScrollerFactory = (el: Element, foundation?: MDCTabScrollerFoundation) => MDCTabScroller;\n\nexport class MDCTabScroller extends MDCComponent<MDCTabScrollerFoundation> {\n static attachTo(root: Element): MDCTabScroller {\n return new MDCTabScroller(root);\n }\n\n private content_!: HTMLElement; // assigned in initialize()\n private area_!: HTMLElement; // assigned in initialize()\n private handleInteraction_!: SpecificEventListener<InteractionEventType>; // assigned in initialSyncWithDOM()\n private handleTransitionEnd_!: SpecificEventListener<'transitionend'>; // assigned in initialSyncWithDOM()\n\n initialize() {\n this.area_ = this.root.querySelector<HTMLElement>(\n MDCTabScrollerFoundation.strings.AREA_SELECTOR)!;\n this.content_ = this.root.querySelector<HTMLElement>(\n MDCTabScrollerFoundation.strings.CONTENT_SELECTOR)!;\n }\n\n initialSyncWithDOM() {\n this.handleInteraction_ = () => this.foundation.handleInteraction();\n this.handleTransitionEnd_ = (evt) => this.foundation.handleTransitionEnd(evt);\n\n this.area_.addEventListener('wheel', this.handleInteraction_, applyPassive());\n this.area_.addEventListener('touchstart', this.handleInteraction_, applyPassive());\n this.area_.addEventListener('pointerdown', this.handleInteraction_, applyPassive());\n this.area_.addEventListener('mousedown', this.handleInteraction_, applyPassive());\n this.area_.addEventListener('keydown', this.handleInteraction_, applyPassive());\n this.content_.addEventListener('transitionend', this.handleTransitionEnd_);\n }\n\n destroy() {\n super.destroy();\n\n this.area_.removeEventListener('wheel', this.handleInteraction_, applyPassive());\n this.area_.removeEventListener('touchstart', this.handleInteraction_, applyPassive());\n this.area_.removeEventListener('pointerdown', this.handleInteraction_, applyPassive());\n this.area_.removeEventListener('mousedown', this.handleInteraction_, applyPassive());\n this.area_.removeEventListener('keydown', this.handleInteraction_, applyPassive());\n this.content_.removeEventListener('transitionend', this.handleTransitionEnd_);\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCTabScrollerAdapter = {\n eventTargetMatchesSelector: (evtTarget, selector) =>\n matches(evtTarget as Element, selector),\n addClass: (className) => this.root.classList.add(className),\n removeClass: (className) => this.root.classList.remove(className),\n addScrollAreaClass: (className) => this.area_.classList.add(className),\n setScrollAreaStyleProperty: (prop, value) =>\n this.area_.style.setProperty(prop, value),\n setScrollContentStyleProperty: (prop, value) =>\n this.content_.style.setProperty(prop, value),\n getScrollContentStyleValue: (propName) =>\n window.getComputedStyle(this.content_).getPropertyValue(propName),\n setScrollAreaScrollLeft: (scrollX) => this.area_.scrollLeft = scrollX,\n getScrollAreaScrollLeft: () => this.area_.scrollLeft,\n getScrollContentOffsetWidth: () => this.content_.offsetWidth,\n getScrollAreaOffsetWidth: () => this.area_.offsetWidth,\n computeScrollAreaClientRect: () => this.area_.getBoundingClientRect(),\n computeScrollContentClientRect: () =>\n this.content_.getBoundingClientRect(),\n computeHorizontalScrollbarHeight: () =>\n util.computeHorizontalScrollbarHeight(document),\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCTabScrollerFoundation(adapter);\n }\n\n /**\n * Returns the current visual scroll position\n */\n getScrollPosition(): number {\n return this.foundation.getScrollPosition();\n }\n\n /**\n * Returns the width of the scroll content\n */\n getScrollContentWidth(): number {\n return this.content_.offsetWidth;\n }\n\n /**\n * Increments the scroll value by the given amount\n * @param scrollXIncrement The pixel value by which to increment the scroll value\n */\n incrementScroll(scrollXIncrement: number) {\n this.foundation.incrementScroll(scrollXIncrement);\n }\n\n /**\n * Scrolls to the given pixel position\n * @param scrollX The pixel value to scroll to\n */\n scrollTo(scrollX: number) {\n this.foundation.scrollTo(scrollX);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst cssClasses = {\n ANIMATING: 'mdc-tab-scroller--animating',\n SCROLL_AREA_SCROLL: 'mdc-tab-scroller__scroll-area--scroll',\n SCROLL_TEST: 'mdc-tab-scroller__test',\n};\n\nconst strings = {\n AREA_SELECTOR: '.mdc-tab-scroller__scroll-area',\n CONTENT_SELECTOR: '.mdc-tab-scroller__scroll-content',\n};\n\nexport {\n cssClasses,\n strings,\n};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCTabScrollerAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\nimport {MDCTabScrollerRTLDefault} from './rtl-default-scroller';\nimport {MDCTabScrollerRTLNegative} from './rtl-negative-scroller';\nimport {MDCTabScrollerRTLReverse} from './rtl-reverse-scroller';\nimport {MDCTabScrollerRTL} from './rtl-scroller';\nimport {MDCTabScrollerAnimation, MDCTabScrollerHorizontalEdges} from './types';\n\nexport class MDCTabScrollerFoundation extends MDCFoundation<MDCTabScrollerAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get defaultAdapter(): MDCTabScrollerAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n eventTargetMatchesSelector: () => false,\n addClass: () => undefined,\n removeClass: () => undefined,\n addScrollAreaClass: () => undefined,\n setScrollAreaStyleProperty: () => undefined,\n setScrollContentStyleProperty: () => undefined,\n getScrollContentStyleValue: () => '',\n setScrollAreaScrollLeft: () => undefined,\n getScrollAreaScrollLeft: () => 0,\n getScrollContentOffsetWidth: () => 0,\n getScrollAreaOffsetWidth: () => 0,\n computeScrollAreaClientRect: () => ({top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0}),\n computeScrollContentClientRect: () => ({top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0}),\n computeHorizontalScrollbarHeight: () => 0,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n /**\n * Controls whether we should handle the transitionend and interaction events during the animation.\n */\n private isAnimating_ = false;\n\n /**\n * The MDCTabScrollerRTL instance varies per browser and allows us to encapsulate the peculiar browser behavior\n * of RTL scrolling in it's own class.\n */\n private rtlScrollerInstance_?: MDCTabScrollerRTL;\n\n constructor(adapter?: Partial<MDCTabScrollerAdapter>) {\n super({...MDCTabScrollerFoundation.defaultAdapter, ...adapter});\n }\n\n init() {\n // Compute horizontal scrollbar height on scroller with overflow initially hidden, then update overflow to scroll\n // and immediately adjust bottom margin to avoid the scrollbar initially appearing before JS runs.\n const horizontalScrollbarHeight =\n this.adapter.computeHorizontalScrollbarHeight();\n this.adapter.setScrollAreaStyleProperty(\n 'margin-bottom', -horizontalScrollbarHeight + 'px');\n this.adapter.addScrollAreaClass(\n MDCTabScrollerFoundation.cssClasses.SCROLL_AREA_SCROLL);\n }\n\n /**\n * Computes the current visual scroll position\n */\n getScrollPosition(): number {\n if (this.isRTL_()) {\n return this.computeCurrentScrollPositionRTL_();\n }\n\n const currentTranslateX = this.calculateCurrentTranslateX_();\n const scrollLeft = this.adapter.getScrollAreaScrollLeft();\n return scrollLeft - currentTranslateX;\n }\n\n /**\n * Handles interaction events that occur during transition\n */\n handleInteraction() {\n // Early exit if we aren't animating\n if (!this.isAnimating_) {\n return;\n }\n\n // Prevent other event listeners from handling this event\n this.stopScrollAnimation_();\n }\n\n /**\n * Handles the transitionend event\n */\n handleTransitionEnd(evt: Event) {\n // Early exit if we aren't animating or the event was triggered by a different element.\n const evtTarget = evt.target as Element;\n if (!this.isAnimating_ ||\n !this.adapter.eventTargetMatchesSelector(\n evtTarget, MDCTabScrollerFoundation.strings.CONTENT_SELECTOR)) {\n return;\n }\n\n this.isAnimating_ = false;\n this.adapter.removeClass(MDCTabScrollerFoundation.cssClasses.ANIMATING);\n }\n\n /**\n * Increment the scroll value by the scrollXIncrement using animation.\n * @param scrollXIncrement The value by which to increment the scroll position\n */\n incrementScroll(scrollXIncrement: number) {\n // Early exit for non-operational increment values\n if (scrollXIncrement === 0) {\n return;\n }\n\n this.animate_(this.getIncrementScrollOperation_(scrollXIncrement));\n }\n\n /**\n * Increment the scroll value by the scrollXIncrement without animation.\n * @param scrollXIncrement The value by which to increment the scroll position\n */\n incrementScrollImmediate(scrollXIncrement: number) {\n // Early exit for non-operational increment values\n if (scrollXIncrement === 0) {\n return;\n }\n\n const operation = this.getIncrementScrollOperation_(scrollXIncrement);\n if (operation.scrollDelta === 0) {\n return;\n }\n\n this.stopScrollAnimation_();\n this.adapter.setScrollAreaScrollLeft(operation.finalScrollPosition);\n }\n\n /**\n * Scrolls to the given scrollX value\n */\n scrollTo(scrollX: number) {\n if (this.isRTL_()) {\n return this.scrollToRTL_(scrollX);\n }\n\n this.scrollTo_(scrollX);\n }\n\n /**\n * @return Browser-specific {@link MDCTabScrollerRTL} instance.\n */\n getRTLScroller(): MDCTabScrollerRTL {\n if (!this.rtlScrollerInstance_) {\n this.rtlScrollerInstance_ = this.rtlScrollerFactory_();\n }\n\n return this.rtlScrollerInstance_;\n }\n\n /**\n * @return translateX value from a CSS matrix transform function string.\n */\n private calculateCurrentTranslateX_(): number {\n const transformValue = this.adapter.getScrollContentStyleValue('transform');\n // Early exit if no transform is present\n if (transformValue === 'none') {\n return 0;\n }\n\n // The transform value comes back as a matrix transformation in the form\n // of `matrix(a, b, c, d, tx, ty)`. We only care about tx (translateX) so\n // we're going to grab all the parenthesized values, strip out tx, and\n // parse it.\n const match = /\\((.+?)\\)/.exec(transformValue);\n if (!match) {\n return 0;\n }\n\n const matrixParams = match[1];\n\n // tslint:disable-next-line:ban-ts-ignore \"Unused vars\" should be a linter warning, not a compiler error.\n // @ts-ignore These unused variables should retain their semantic names for clarity.\n const [a, b, c, d, tx, ty] = matrixParams.split(',');\n\n return parseFloat(tx); // tslint:disable-line:ban\n }\n\n /**\n * Calculates a safe scroll value that is > 0 and < the max scroll value\n * @param scrollX The distance to scroll\n */\n private clampScrollValue_(scrollX: number): number {\n const edges = this.calculateScrollEdges_();\n return Math.min(Math.max(edges.left, scrollX), edges.right);\n }\n\n private computeCurrentScrollPositionRTL_(): number {\n const translateX = this.calculateCurrentTranslateX_();\n return this.getRTLScroller().getScrollPositionRTL(translateX);\n }\n\n private calculateScrollEdges_(): MDCTabScrollerHorizontalEdges {\n const contentWidth = this.adapter.getScrollContentOffsetWidth();\n const rootWidth = this.adapter.getScrollAreaOffsetWidth();\n return {\n left: 0,\n right: contentWidth - rootWidth,\n };\n }\n\n /**\n * Internal scroll method\n * @param scrollX The new scroll position\n */\n private scrollTo_(scrollX: number) {\n const currentScrollX = this.getScrollPosition();\n const safeScrollX = this.clampScrollValue_(scrollX);\n const scrollDelta = safeScrollX - currentScrollX;\n this.animate_({\n finalScrollPosition: safeScrollX,\n scrollDelta,\n });\n }\n\n /**\n * Internal RTL scroll method\n * @param scrollX The new scroll position\n */\n private scrollToRTL_(scrollX: number) {\n const animation = this.getRTLScroller().scrollToRTL(scrollX);\n this.animate_(animation);\n }\n\n /**\n * Internal method to compute the increment scroll operation values.\n * @param scrollX The desired scroll position increment\n * @return MDCTabScrollerAnimation with the sanitized values for performing the scroll operation.\n */\n private getIncrementScrollOperation_(scrollX: number): MDCTabScrollerAnimation {\n if (this.isRTL_()) {\n return this.getRTLScroller().incrementScrollRTL(scrollX);\n }\n\n const currentScrollX = this.getScrollPosition();\n const targetScrollX = scrollX + currentScrollX;\n const safeScrollX = this.clampScrollValue_(targetScrollX);\n const scrollDelta = safeScrollX - currentScrollX;\n return {\n finalScrollPosition: safeScrollX,\n scrollDelta,\n };\n }\n\n /**\n * Animates the tab scrolling\n * @param animation The animation to apply\n */\n private animate_(animation: MDCTabScrollerAnimation) {\n // Early exit if translateX is 0, which means there's no animation to perform\n if (animation.scrollDelta === 0) {\n return;\n }\n\n this.stopScrollAnimation_();\n // This animation uses the FLIP approach.\n // Read more here: https://aerotwist.com/blog/flip-your-animations/\n this.adapter.setScrollAreaScrollLeft(animation.finalScrollPosition);\n this.adapter.setScrollContentStyleProperty(\n 'transform', `translateX(${animation.scrollDelta}px)`);\n // Force repaint\n this.adapter.computeScrollAreaClientRect();\n\n requestAnimationFrame(() => {\n this.adapter.addClass(MDCTabScrollerFoundation.cssClasses.ANIMATING);\n this.adapter.setScrollContentStyleProperty('transform', 'none');\n });\n\n this.isAnimating_ = true;\n }\n\n /**\n * Stops scroll animation\n */\n private stopScrollAnimation_() {\n this.isAnimating_ = false;\n const currentScrollPosition = this.getAnimatingScrollPosition_();\n this.adapter.removeClass(MDCTabScrollerFoundation.cssClasses.ANIMATING);\n this.adapter.setScrollContentStyleProperty('transform', 'translateX(0px)');\n this.adapter.setScrollAreaScrollLeft(currentScrollPosition);\n }\n\n /**\n * Gets the current scroll position during animation\n */\n private getAnimatingScrollPosition_(): number {\n const currentTranslateX = this.calculateCurrentTranslateX_();\n const scrollLeft = this.adapter.getScrollAreaScrollLeft();\n if (this.isRTL_()) {\n return this.getRTLScroller().getAnimatingScrollPosition(scrollLeft, currentTranslateX);\n }\n\n return scrollLeft - currentTranslateX;\n }\n\n /**\n * Determines the RTL Scroller to use\n */\n private rtlScrollerFactory_(): MDCTabScrollerRTL {\n // Browsers have three different implementations of scrollLeft in RTL mode,\n // dependent on the browser. The behavior is based off the max LTR\n // scrollLeft value and 0.\n //\n // * Default scrolling in RTL *\n // - Left-most value: 0\n // - Right-most value: Max LTR scrollLeft value\n //\n // * Negative scrolling in RTL *\n // - Left-most value: Negated max LTR scrollLeft value\n // - Right-most value: 0\n //\n // * Reverse scrolling in RTL *\n // - Left-most value: Max LTR scrollLeft value\n // - Right-most value: 0\n //\n // We use those principles below to determine which RTL scrollLeft\n // behavior is implemented in the current browser.\n const initialScrollLeft = this.adapter.getScrollAreaScrollLeft();\n this.adapter.setScrollAreaScrollLeft(initialScrollLeft - 1);\n const newScrollLeft = this.adapter.getScrollAreaScrollLeft();\n\n // If the newScrollLeft value is negative,then we know that the browser has\n // implemented negative RTL scrolling, since all other implementations have\n // only positive values.\n if (newScrollLeft < 0) {\n // Undo the scrollLeft test check\n this.adapter.setScrollAreaScrollLeft(initialScrollLeft);\n return new MDCTabScrollerRTLNegative(this.adapter);\n }\n\n const rootClientRect = this.adapter.computeScrollAreaClientRect();\n const contentClientRect = this.adapter.computeScrollContentClientRect();\n const rightEdgeDelta = Math.round(contentClientRect.right - rootClientRect.right);\n // Undo the scrollLeft test check\n this.adapter.setScrollAreaScrollLeft(initialScrollLeft);\n\n // By calculating the clientRect of the root element and the clientRect of\n // the content element, we can determine how much the scroll value changed\n // when we performed the scrollLeft subtraction above.\n if (rightEdgeDelta === newScrollLeft) {\n return new MDCTabScrollerRTLReverse(this.adapter);\n }\n\n return new MDCTabScrollerRTLDefault(this.adapter);\n }\n\n private isRTL_(): boolean {\n return this.adapter.getScrollContentStyleValue('direction') === 'rtl';\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTabScrollerFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport * as util from './util';\n\nexport {util};\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './types';\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCTabScrollerRTL} from './rtl-scroller';\nimport {MDCTabScrollerAnimation, MDCTabScrollerHorizontalEdges} from './types';\n\nexport class MDCTabScrollerRTLDefault extends MDCTabScrollerRTL {\n getScrollPositionRTL(): number {\n const currentScrollLeft = this.adapter.getScrollAreaScrollLeft();\n const {right} = this.calculateScrollEdges_();\n // Scroll values on most browsers are ints instead of floats so we round\n return Math.round(right - currentScrollLeft);\n }\n\n scrollToRTL(scrollX: number): MDCTabScrollerAnimation {\n const edges = this.calculateScrollEdges_();\n const currentScrollLeft = this.adapter.getScrollAreaScrollLeft();\n const clampedScrollLeft = this.clampScrollValue_(edges.right - scrollX);\n return {\n finalScrollPosition: clampedScrollLeft,\n scrollDelta: clampedScrollLeft - currentScrollLeft,\n };\n }\n\n incrementScrollRTL(scrollX: number): MDCTabScrollerAnimation {\n const currentScrollLeft = this.adapter.getScrollAreaScrollLeft();\n const clampedScrollLeft = this.clampScrollValue_(currentScrollLeft - scrollX);\n return {\n finalScrollPosition: clampedScrollLeft,\n scrollDelta: clampedScrollLeft - currentScrollLeft,\n };\n }\n\n getAnimatingScrollPosition(scrollX: number): number {\n return scrollX;\n }\n\n private calculateScrollEdges_(): MDCTabScrollerHorizontalEdges {\n const contentWidth = this.adapter.getScrollContentOffsetWidth();\n const rootWidth = this.adapter.getScrollAreaOffsetWidth();\n return {\n left: 0,\n right: contentWidth - rootWidth,\n };\n }\n\n private clampScrollValue_(scrollX: number): number {\n const edges = this.calculateScrollEdges_();\n return Math.min(Math.max(edges.left, scrollX), edges.right);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTabScrollerRTLDefault;\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCTabScrollerRTL} from './rtl-scroller';\nimport {MDCTabScrollerAnimation, MDCTabScrollerHorizontalEdges} from './types';\n\nexport class MDCTabScrollerRTLNegative extends MDCTabScrollerRTL {\n getScrollPositionRTL(translateX: number): number {\n const currentScrollLeft = this.adapter.getScrollAreaScrollLeft();\n return Math.round(translateX - currentScrollLeft);\n }\n\n scrollToRTL(scrollX: number): MDCTabScrollerAnimation {\n const currentScrollLeft = this.adapter.getScrollAreaScrollLeft();\n const clampedScrollLeft = this.clampScrollValue_(-scrollX);\n return {\n finalScrollPosition: clampedScrollLeft,\n scrollDelta: clampedScrollLeft - currentScrollLeft,\n };\n }\n\n incrementScrollRTL(scrollX: number): MDCTabScrollerAnimation {\n const currentScrollLeft = this.adapter.getScrollAreaScrollLeft();\n const clampedScrollLeft = this.clampScrollValue_(currentScrollLeft - scrollX);\n return {\n finalScrollPosition: clampedScrollLeft,\n scrollDelta: clampedScrollLeft - currentScrollLeft,\n };\n }\n\n getAnimatingScrollPosition(scrollX: number, translateX: number): number {\n return scrollX - translateX;\n }\n\n private calculateScrollEdges_(): MDCTabScrollerHorizontalEdges {\n const contentWidth = this.adapter.getScrollContentOffsetWidth();\n const rootWidth = this.adapter.getScrollAreaOffsetWidth();\n return {\n left: rootWidth - contentWidth,\n right: 0,\n };\n }\n\n private clampScrollValue_(scrollX: number): number {\n const edges = this.calculateScrollEdges_();\n return Math.max(Math.min(edges.right, scrollX), edges.left);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTabScrollerRTLNegative;\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCTabScrollerRTL} from './rtl-scroller';\nimport {MDCTabScrollerAnimation, MDCTabScrollerHorizontalEdges} from './types';\n\nexport class MDCTabScrollerRTLReverse extends MDCTabScrollerRTL {\n getScrollPositionRTL(translateX: number): number {\n const currentScrollLeft = this.adapter.getScrollAreaScrollLeft();\n // Scroll values on most browsers are ints instead of floats so we round\n return Math.round(currentScrollLeft - translateX);\n }\n\n scrollToRTL(scrollX: number): MDCTabScrollerAnimation {\n const currentScrollLeft = this.adapter.getScrollAreaScrollLeft();\n const clampedScrollLeft = this.clampScrollValue_(scrollX);\n return {\n finalScrollPosition: clampedScrollLeft,\n scrollDelta: currentScrollLeft - clampedScrollLeft,\n };\n }\n\n incrementScrollRTL(scrollX: number): MDCTabScrollerAnimation {\n const currentScrollLeft = this.adapter.getScrollAreaScrollLeft();\n const clampedScrollLeft = this.clampScrollValue_(currentScrollLeft + scrollX);\n return {\n finalScrollPosition: clampedScrollLeft,\n scrollDelta: currentScrollLeft - clampedScrollLeft,\n };\n }\n\n getAnimatingScrollPosition(scrollX: number, translateX: number): number {\n return scrollX + translateX;\n }\n\n private calculateScrollEdges_(): MDCTabScrollerHorizontalEdges {\n const contentWidth = this.adapter.getScrollContentOffsetWidth();\n const rootWidth = this.adapter.getScrollAreaOffsetWidth();\n return {\n left: contentWidth - rootWidth,\n right: 0,\n };\n }\n\n private clampScrollValue_(scrollX: number): number {\n const edges = this.calculateScrollEdges_();\n return Math.min(Math.max(edges.right, scrollX), edges.left);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTabScrollerRTLReverse;\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCTabScrollerAdapter} from './adapter';\nimport {MDCTabScrollerAnimation} from './types';\n\nexport abstract class MDCTabScrollerRTL {\n constructor(protected readonly adapter: MDCTabScrollerAdapter) {}\n\n abstract getScrollPositionRTL(translateX: number): number;\n\n abstract scrollToRTL(scrollX: number): MDCTabScrollerAnimation;\n\n abstract incrementScrollRTL(scrollX: number): MDCTabScrollerAnimation;\n\n /**\n * @param scrollX The current scrollX position\n * @param translateX The current translateX position\n */\n abstract getAnimatingScrollPosition(scrollX: number, translateX: number): number;\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTabScrollerRTL;\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {cssClasses} from './constants';\n\n/**\n * Stores result from computeHorizontalScrollbarHeight to avoid redundant processing.\n */\nlet horizontalScrollbarHeight_: number | undefined;\n\n/**\n * Computes the height of browser-rendered horizontal scrollbars using a self-created test element.\n * May return 0 (e.g. on OS X browsers under default configuration).\n */\nexport function computeHorizontalScrollbarHeight(documentObj: Document, shouldCacheResult = true): number {\n if (shouldCacheResult && typeof horizontalScrollbarHeight_ !== 'undefined') {\n return horizontalScrollbarHeight_;\n }\n\n const el = documentObj.createElement('div');\n el.classList.add(cssClasses.SCROLL_TEST);\n documentObj.body.appendChild(el);\n\n const horizontalScrollbarHeight = el.offsetHeight - el.clientHeight;\n documentObj.body.removeChild(el);\n\n if (shouldCacheResult) {\n horizontalScrollbarHeight_ = horizontalScrollbarHeight;\n }\n return horizontalScrollbarHeight;\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {SpecificEventListener} from '@material/base/types';\nimport {MDCRipple, MDCRippleFactory} from '@material/ripple/component';\nimport {MDCRippleFoundation} from '@material/ripple/foundation';\nimport {MDCRippleCapableSurface} from '@material/ripple/types';\nimport {MDCTabIndicator, MDCTabIndicatorFactory} from '@material/tab-indicator/component';\nimport {MDCTabAdapter} from './adapter';\nimport {MDCTabFoundation} from './foundation';\nimport {MDCTabDimensions, MDCTabInteractionEventDetail} from './types';\n\nexport type MDCTabFactory = (el: Element, foundation?: MDCTabFoundation) => MDCTab;\n\nexport class MDCTab extends MDCComponent<MDCTabFoundation> implements MDCRippleCapableSurface {\n static attachTo(root: Element): MDCTab {\n return new MDCTab(root);\n }\n\n id!: string; // assigned in initialize();\n\n private ripple_!: MDCRipple; // assigned in initialize();\n private tabIndicator_!: MDCTabIndicator; // assigned in initialize();\n private content_!: HTMLElement; // assigned in initialize();\n private handleClick_!: SpecificEventListener<'click'>; // assigned in initialize();\n\n initialize(\n rippleFactory: MDCRippleFactory = (el, foundation) => new MDCRipple(el, foundation),\n tabIndicatorFactory: MDCTabIndicatorFactory = (el) => new MDCTabIndicator(el),\n ) {\n this.id = this.root.id;\n const rippleSurface = this.root.querySelector<HTMLElement>(\n MDCTabFoundation.strings.RIPPLE_SELECTOR)!;\n const rippleAdapter = {\n ...MDCRipple.createAdapter(this),\n addClass: (className: string) => rippleSurface.classList.add(className),\n removeClass: (className: string) => rippleSurface.classList.remove(className),\n updateCssVariable: (varName: string, value: string) => rippleSurface.style.setProperty(varName, value),\n };\n const rippleFoundation = new MDCRippleFoundation(rippleAdapter);\n this.ripple_ = rippleFactory(this.root, rippleFoundation);\n\n const tabIndicatorElement = this.root.querySelector(\n MDCTabFoundation.strings.TAB_INDICATOR_SELECTOR)!;\n this.tabIndicator_ = tabIndicatorFactory(tabIndicatorElement);\n this.content_ = this.root.querySelector<HTMLElement>(\n MDCTabFoundation.strings.CONTENT_SELECTOR)!;\n }\n\n initialSyncWithDOM() {\n this.handleClick_ = () => this.foundation.handleClick();\n this.listen('click', this.handleClick_);\n }\n\n destroy() {\n this.unlisten('click', this.handleClick_);\n this.ripple_.destroy();\n super.destroy();\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCTabAdapter = {\n setAttr: (attr, value) => this.root.setAttribute(attr, value),\n addClass: (className) => this.root.classList.add(className),\n removeClass: (className) => this.root.classList.remove(className),\n hasClass: (className) => this.root.classList.contains(className),\n activateIndicator: (previousIndicatorClientRect) =>\n this.tabIndicator_.activate(previousIndicatorClientRect),\n deactivateIndicator: () => this.tabIndicator_.deactivate(),\n notifyInteracted: () => this.emit<MDCTabInteractionEventDetail>(\n MDCTabFoundation.strings.INTERACTED_EVENT, {tabId: this.id},\n true /* bubble */),\n getOffsetLeft: () => (this.root as HTMLElement).offsetLeft,\n getOffsetWidth: () => (this.root as HTMLElement).offsetWidth,\n getContentOffsetLeft: () => this.content_.offsetLeft,\n getContentOffsetWidth: () => this.content_.offsetWidth,\n focus: () => (this.root as HTMLElement).focus(),\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCTabFoundation(adapter);\n }\n\n /**\n * Getter for the active state of the tab\n */\n get active(): boolean {\n return this.foundation.isActive();\n }\n\n set focusOnActivate(focusOnActivate: boolean) {\n this.foundation.setFocusOnActivate(focusOnActivate);\n }\n\n /**\n * Activates the tab\n */\n activate(computeIndicatorClientRect?: ClientRect) {\n this.foundation.activate(computeIndicatorClientRect);\n }\n\n /**\n * Deactivates the tab\n */\n deactivate() {\n this.foundation.deactivate();\n }\n\n /**\n * Returns the indicator's client rect\n */\n computeIndicatorClientRect(): ClientRect {\n return this.tabIndicator_.computeContentClientRect();\n }\n\n computeDimensions(): MDCTabDimensions {\n return this.foundation.computeDimensions();\n }\n\n /**\n * Focuses the tab\n */\n focus() {\n (this.root as HTMLElement).focus();\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst cssClasses = {\n ACTIVE: 'mdc-tab--active',\n};\n\nconst strings = {\n ARIA_SELECTED: 'aria-selected',\n CONTENT_SELECTOR: '.mdc-tab__content',\n INTERACTED_EVENT: 'MDCTab:interacted',\n RIPPLE_SELECTOR: '.mdc-tab__ripple',\n TABINDEX: 'tabIndex',\n TAB_INDICATOR_SELECTOR: '.mdc-tab-indicator',\n};\n\nexport {\n cssClasses,\n strings,\n};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCTabAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\nimport {MDCTabDimensions} from './types';\n\nexport class MDCTabFoundation extends MDCFoundation<MDCTabAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get defaultAdapter(): MDCTabAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: () => undefined,\n removeClass: () => undefined,\n hasClass: () => false,\n setAttr: () => undefined,\n activateIndicator: () => undefined,\n deactivateIndicator: () => undefined,\n notifyInteracted: () => undefined,\n getOffsetLeft: () => 0,\n getOffsetWidth: () => 0,\n getContentOffsetLeft: () => 0,\n getContentOffsetWidth: () => 0,\n focus: () => undefined,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private focusOnActivate_ = true;\n\n constructor(adapter?: Partial<MDCTabAdapter>) {\n super({...MDCTabFoundation.defaultAdapter, ...adapter});\n }\n\n handleClick() {\n // It's up to the parent component to keep track of the active Tab and\n // ensure we don't activate a Tab that's already active.\n this.adapter.notifyInteracted();\n }\n\n isActive(): boolean {\n return this.adapter.hasClass(cssClasses.ACTIVE);\n }\n\n /**\n * Sets whether the tab should focus itself when activated\n */\n setFocusOnActivate(focusOnActivate: boolean) {\n this.focusOnActivate_ = focusOnActivate;\n }\n\n /**\n * Activates the Tab\n */\n activate(previousIndicatorClientRect?: ClientRect) {\n this.adapter.addClass(cssClasses.ACTIVE);\n this.adapter.setAttr(strings.ARIA_SELECTED, 'true');\n this.adapter.setAttr(strings.TABINDEX, '0');\n this.adapter.activateIndicator(previousIndicatorClientRect);\n if (this.focusOnActivate_) {\n this.adapter.focus();\n }\n }\n\n /**\n * Deactivates the Tab\n */\n deactivate() {\n // Early exit\n if (!this.isActive()) {\n return;\n }\n\n this.adapter.removeClass(cssClasses.ACTIVE);\n this.adapter.setAttr(strings.ARIA_SELECTED, 'false');\n this.adapter.setAttr(strings.TABINDEX, '-1');\n this.adapter.deactivateIndicator();\n }\n\n /**\n * Returns the dimensions of the Tab\n */\n computeDimensions(): MDCTabDimensions {\n const rootWidth = this.adapter.getOffsetWidth();\n const rootLeft = this.adapter.getOffsetLeft();\n const contentWidth = this.adapter.getContentOffsetWidth();\n const contentLeft = this.adapter.getContentOffsetLeft();\n\n return {\n contentLeft: rootLeft + contentLeft,\n contentRight: rootLeft + contentLeft + contentWidth,\n rootLeft,\n rootRight: rootLeft + rootWidth,\n };\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTabFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './types';\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {MDCTextFieldCharacterCounterAdapter} from './adapter';\nimport {MDCTextFieldCharacterCounterFoundation} from './foundation';\n\nexport type MDCTextFieldCharacterCounterFactory =\n (el: Element, foundation?: MDCTextFieldCharacterCounterFoundation) => MDCTextFieldCharacterCounter;\n\nexport class MDCTextFieldCharacterCounter extends MDCComponent<MDCTextFieldCharacterCounterFoundation> {\n static attachTo(root: Element): MDCTextFieldCharacterCounter {\n return new MDCTextFieldCharacterCounter(root);\n }\n\n // Provided for access by MDCTextField component\n get foundationForTextField(): MDCTextFieldCharacterCounterFoundation {\n return this.foundation;\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCTextFieldCharacterCounterAdapter = {\n setContent: (content) => {\n this.root.textContent = content;\n },\n };\n return new MDCTextFieldCharacterCounterFoundation(adapter);\n }\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst cssClasses = {\n ROOT: 'mdc-text-field-character-counter',\n};\n\nconst strings = {\n ROOT_SELECTOR: `.${cssClasses.ROOT}`,\n};\n\nexport {strings, cssClasses};\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCTextFieldCharacterCounterAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\n\nexport class MDCTextFieldCharacterCounterFoundation extends MDCFoundation<MDCTextFieldCharacterCounterAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n /**\n * See {@link MDCTextFieldCharacterCounterAdapter} for typing information on parameters and return types.\n */\n static get defaultAdapter(): MDCTextFieldCharacterCounterAdapter {\n return {\n setContent: () => undefined,\n };\n }\n\n constructor(adapter?: Partial<MDCTextFieldCharacterCounterAdapter>) {\n super({...MDCTextFieldCharacterCounterFoundation.defaultAdapter, ...adapter});\n }\n\n setCounterValue(currentLength: number, maxLength: number) {\n currentLength = Math.min(currentLength, maxLength);\n this.adapter.setContent(`${currentLength} / ${maxLength}`);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTextFieldCharacterCounterFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './foundation';\nexport {cssClasses as characterCountCssClasses, strings as characterCountStrings} from './constants';\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {applyPassive} from '@material/dom/events';\nimport * as ponyfill from '@material/dom/ponyfill';\nimport {MDCFloatingLabel, MDCFloatingLabelFactory} from '@material/floating-label/component';\nimport {MDCLineRipple, MDCLineRippleFactory} from '@material/line-ripple/component';\nimport {MDCNotchedOutline, MDCNotchedOutlineFactory} from '@material/notched-outline/component';\nimport {MDCRippleAdapter} from '@material/ripple/adapter';\nimport {MDCRipple, MDCRippleFactory} from '@material/ripple/component';\nimport {MDCRippleFoundation} from '@material/ripple/foundation';\nimport {MDCRippleCapableSurface} from '@material/ripple/types';\n\nimport {MDCTextFieldAdapter, MDCTextFieldInputAdapter, MDCTextFieldLabelAdapter, MDCTextFieldLineRippleAdapter, MDCTextFieldOutlineAdapter, MDCTextFieldRootAdapter,} from './adapter';\nimport {MDCTextFieldCharacterCounter, MDCTextFieldCharacterCounterFactory,} from './character-counter/component';\nimport {MDCTextFieldCharacterCounterFoundation} from './character-counter/foundation';\nimport {cssClasses, strings} from './constants';\nimport {MDCTextFieldFoundation} from './foundation';\nimport {MDCTextFieldHelperText, MDCTextFieldHelperTextFactory,} from './helper-text/component';\nimport {MDCTextFieldHelperTextFoundation} from './helper-text/foundation';\nimport {MDCTextFieldIcon, MDCTextFieldIconFactory} from './icon/component';\nimport {MDCTextFieldFoundationMap} from './types';\n\nexport class MDCTextField extends MDCComponent<MDCTextFieldFoundation> implements MDCRippleCapableSurface {\n static attachTo(root: Element): MDCTextField {\n return new MDCTextField(root);\n }\n\n ripple!: MDCRipple | null; // assigned in initialize()\n\n // The only required sub-element.\n private input_!: HTMLInputElement; // assigned in initialize()\n\n // Optional sub-elements.\n private characterCounter_!: MDCTextFieldCharacterCounter | null; // assigned in initialize()\n private helperText_!: MDCTextFieldHelperText | null; // assigned in initialize()\n private label_!: MDCFloatingLabel | null; // assigned in initialize()\n private leadingIcon_!: MDCTextFieldIcon | null; // assigned in initialize()\n private lineRipple_!: MDCLineRipple | null; // assigned in initialize()\n private outline_!: MDCNotchedOutline | null; // assigned in initialize()\n private trailingIcon_!: MDCTextFieldIcon | null; // assigned in initialize()\n private prefix_!: Element|null; // assigned in initialize()\n private suffix_!: Element|null; // assigned in initialize()\n\n initialize(\n rippleFactory: MDCRippleFactory = (el, foundation) => new MDCRipple(el, foundation),\n lineRippleFactory: MDCLineRippleFactory = (el) => new MDCLineRipple(el),\n helperTextFactory: MDCTextFieldHelperTextFactory = (el) => new MDCTextFieldHelperText(el),\n characterCounterFactory: MDCTextFieldCharacterCounterFactory = (el) => new MDCTextFieldCharacterCounter(el),\n iconFactory: MDCTextFieldIconFactory = (el) => new MDCTextFieldIcon(el),\n labelFactory: MDCFloatingLabelFactory = (el) => new MDCFloatingLabel(el),\n outlineFactory: MDCNotchedOutlineFactory = (el) => new MDCNotchedOutline(el),\n ) {\n this.input_ = this.root.querySelector<HTMLInputElement>(strings.INPUT_SELECTOR)!;\n\n const labelElement = this.root.querySelector(strings.LABEL_SELECTOR);\n this.label_ = labelElement ? labelFactory(labelElement) : null;\n\n const lineRippleElement = this.root.querySelector(strings.LINE_RIPPLE_SELECTOR);\n this.lineRipple_ = lineRippleElement ? lineRippleFactory(lineRippleElement) : null;\n\n const outlineElement = this.root.querySelector(strings.OUTLINE_SELECTOR);\n this.outline_ = outlineElement ? outlineFactory(outlineElement) : null;\n\n // Helper text\n const helperTextStrings = MDCTextFieldHelperTextFoundation.strings;\n const nextElementSibling = this.root.nextElementSibling;\n const hasHelperLine = (nextElementSibling && nextElementSibling.classList.contains(cssClasses.HELPER_LINE));\n const helperTextEl =\n hasHelperLine && nextElementSibling && nextElementSibling.querySelector(helperTextStrings.ROOT_SELECTOR);\n this.helperText_ = helperTextEl ? helperTextFactory(helperTextEl) : null;\n\n // Character counter\n const characterCounterStrings = MDCTextFieldCharacterCounterFoundation.strings;\n let characterCounterEl = this.root.querySelector(characterCounterStrings.ROOT_SELECTOR);\n // If character counter is not found in root element search in sibling element.\n if (!characterCounterEl && hasHelperLine && nextElementSibling) {\n characterCounterEl = nextElementSibling.querySelector(characterCounterStrings.ROOT_SELECTOR);\n }\n this.characterCounter_ = characterCounterEl ? characterCounterFactory(characterCounterEl) : null;\n\n // Leading icon\n const leadingIconEl =\n this.root.querySelector(strings.LEADING_ICON_SELECTOR);\n this.leadingIcon_ = leadingIconEl ? iconFactory(leadingIconEl) : null;\n\n // Trailing icon\n const trailingIconEl =\n this.root.querySelector(strings.TRAILING_ICON_SELECTOR);\n this.trailingIcon_ = trailingIconEl ? iconFactory(trailingIconEl) : null;\n\n // Prefix and Suffix\n this.prefix_ = this.root.querySelector(strings.PREFIX_SELECTOR);\n this.suffix_ = this.root.querySelector(strings.SUFFIX_SELECTOR);\n\n this.ripple = this.createRipple_(rippleFactory);\n }\n\n destroy() {\n if (this.ripple) {\n this.ripple.destroy();\n }\n if (this.lineRipple_) {\n this.lineRipple_.destroy();\n }\n if (this.helperText_) {\n this.helperText_.destroy();\n }\n if (this.characterCounter_) {\n this.characterCounter_.destroy();\n }\n if (this.leadingIcon_) {\n this.leadingIcon_.destroy();\n }\n if (this.trailingIcon_) {\n this.trailingIcon_.destroy();\n }\n if (this.label_) {\n this.label_.destroy();\n }\n if (this.outline_) {\n this.outline_.destroy();\n }\n super.destroy();\n }\n\n /**\n * Initializes the Text Field's internal state based on the environment's\n * state.\n */\n initialSyncWithDOM() {\n this.disabled = this.input_.disabled;\n }\n\n get value(): string {\n return this.foundation.getValue();\n }\n\n /**\n * @param value The value to set on the input.\n */\n set value(value: string) {\n this.foundation.setValue(value);\n }\n\n get disabled(): boolean {\n return this.foundation.isDisabled();\n }\n\n /**\n * @param disabled Sets the Text Field disabled or enabled.\n */\n set disabled(disabled: boolean) {\n this.foundation.setDisabled(disabled);\n }\n\n get valid(): boolean {\n return this.foundation.isValid();\n }\n\n /**\n * @param valid Sets the Text Field valid or invalid.\n */\n set valid(valid: boolean) {\n this.foundation.setValid(valid);\n }\n\n get required(): boolean {\n return this.input_.required;\n }\n\n /**\n * @param required Sets the Text Field to required.\n */\n set required(required: boolean) {\n this.input_.required = required;\n }\n\n get pattern(): string {\n return this.input_.pattern;\n }\n\n /**\n * @param pattern Sets the input element's validation pattern.\n */\n set pattern(pattern: string) {\n this.input_.pattern = pattern;\n }\n\n get minLength(): number {\n return this.input_.minLength;\n }\n\n /**\n * @param minLength Sets the input element's minLength.\n */\n set minLength(minLength: number) {\n this.input_.minLength = minLength;\n }\n\n get maxLength(): number {\n return this.input_.maxLength;\n }\n\n /**\n * @param maxLength Sets the input element's maxLength.\n */\n set maxLength(maxLength: number) {\n // Chrome throws exception if maxLength is set to a value less than zero\n if (maxLength < 0) {\n this.input_.removeAttribute('maxLength');\n } else {\n this.input_.maxLength = maxLength;\n }\n }\n\n get min(): string {\n return this.input_.min;\n }\n\n /**\n * @param min Sets the input element's min.\n */\n set min(min: string) {\n this.input_.min = min;\n }\n\n get max(): string {\n return this.input_.max;\n }\n\n /**\n * @param max Sets the input element's max.\n */\n set max(max: string) {\n this.input_.max = max;\n }\n\n get step(): string {\n return this.input_.step;\n }\n\n /**\n * @param step Sets the input element's step.\n */\n set step(step: string) {\n this.input_.step = step;\n }\n\n /**\n * Sets the helper text element content.\n */\n set helperTextContent(content: string) {\n this.foundation.setHelperTextContent(content);\n }\n\n /**\n * Sets the aria label of the leading icon.\n */\n set leadingIconAriaLabel(label: string) {\n this.foundation.setLeadingIconAriaLabel(label);\n }\n\n /**\n * Sets the text content of the leading icon.\n */\n set leadingIconContent(content: string) {\n this.foundation.setLeadingIconContent(content);\n }\n\n /**\n * Sets the aria label of the trailing icon.\n */\n set trailingIconAriaLabel(label: string) {\n this.foundation.setTrailingIconAriaLabel(label);\n }\n\n /**\n * Sets the text content of the trailing icon.\n */\n set trailingIconContent(content: string) {\n this.foundation.setTrailingIconContent(content);\n }\n\n /**\n * Enables or disables the use of native validation. Use this for custom validation.\n * @param useNativeValidation Set this to false to ignore native input validation.\n */\n set useNativeValidation(useNativeValidation: boolean) {\n this.foundation.setUseNativeValidation(useNativeValidation);\n }\n\n /**\n * Gets the text content of the prefix, or null if it does not exist.\n */\n get prefixText(): string|null {\n return this.prefix_ ? this.prefix_.textContent : null;\n }\n\n /**\n * Sets the text content of the prefix, if it exists.\n */\n set prefixText(prefixText: string|null) {\n if (this.prefix_) {\n this.prefix_.textContent = prefixText;\n }\n }\n\n /**\n * Gets the text content of the suffix, or null if it does not exist.\n */\n get suffixText(): string|null {\n return this.suffix_ ? this.suffix_.textContent : null;\n }\n\n /**\n * Sets the text content of the suffix, if it exists.\n */\n set suffixText(suffixText: string|null) {\n if (this.suffix_) {\n this.suffix_.textContent = suffixText;\n }\n }\n\n /**\n * Focuses the input element.\n */\n focus() {\n this.input_.focus();\n }\n\n /**\n * Recomputes the outline SVG path for the outline element.\n */\n layout() {\n const openNotch = this.foundation.shouldFloat;\n this.foundation.notchOutline(openNotch);\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCTextFieldAdapter = {\n ...this.getRootAdapterMethods_(),\n ...this.getInputAdapterMethods_(),\n ...this.getLabelAdapterMethods_(),\n ...this.getLineRippleAdapterMethods_(),\n ...this.getOutlineAdapterMethods_(),\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCTextFieldFoundation(adapter, this.getFoundationMap_());\n }\n\n private getRootAdapterMethods_(): MDCTextFieldRootAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: (className) => this.root.classList.add(className),\n removeClass: (className) => this.root.classList.remove(className),\n hasClass: (className) => this.root.classList.contains(className),\n registerTextFieldInteractionHandler: (evtType, handler) => {\n this.listen(evtType, handler);\n },\n deregisterTextFieldInteractionHandler: (evtType, handler) => {\n this.unlisten(evtType, handler);\n },\n registerValidationAttributeChangeHandler: (handler) => {\n const getAttributesList = (mutationsList: MutationRecord[]): string[] => {\n return mutationsList\n .map((mutation) => mutation.attributeName)\n .filter((attributeName) => attributeName) as string[];\n };\n const observer = new MutationObserver((mutationsList) => handler(getAttributesList(mutationsList)));\n const config = {attributes: true};\n observer.observe(this.input_, config);\n return observer;\n },\n deregisterValidationAttributeChangeHandler: (observer) => {\n observer.disconnect();\n },\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private getInputAdapterMethods_(): MDCTextFieldInputAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n getNativeInput: () => this.input_,\n setInputAttr: (attr, value) => {\n this.input_.setAttribute(attr, value);\n },\n removeInputAttr: (attr) => {\n this.input_.removeAttribute(attr);\n },\n isFocused: () => document.activeElement === this.input_,\n registerInputInteractionHandler: (evtType, handler) => {\n this.input_.addEventListener(evtType, handler, applyPassive());\n },\n deregisterInputInteractionHandler: (evtType, handler) => {\n this.input_.removeEventListener(evtType, handler, applyPassive());\n },\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private getLabelAdapterMethods_(): MDCTextFieldLabelAdapter {\n return {\n floatLabel: (shouldFloat) => this.label_ && this.label_.float(shouldFloat),\n getLabelWidth: () => this.label_ ? this.label_.getWidth() : 0,\n hasLabel: () => Boolean(this.label_),\n shakeLabel: (shouldShake) => this.label_ && this.label_.shake(shouldShake),\n setLabelRequired: (isRequired) => this.label_ && this.label_.setRequired(isRequired),\n };\n }\n\n private getLineRippleAdapterMethods_(): MDCTextFieldLineRippleAdapter {\n return {\n activateLineRipple: () => {\n if (this.lineRipple_) {\n this.lineRipple_.activate();\n }\n },\n deactivateLineRipple: () => {\n if (this.lineRipple_) {\n this.lineRipple_.deactivate();\n }\n },\n setLineRippleTransformOrigin: (normalizedX) => {\n if (this.lineRipple_) {\n this.lineRipple_.setRippleCenter(normalizedX);\n }\n },\n };\n }\n\n private getOutlineAdapterMethods_(): MDCTextFieldOutlineAdapter {\n return {\n closeOutline: () => this.outline_ && this.outline_.closeNotch(),\n hasOutline: () => Boolean(this.outline_),\n notchOutline: (labelWidth) => this.outline_ && this.outline_.notch(labelWidth),\n };\n }\n\n /**\n * @return A map of all subcomponents to subfoundations.\n */\n private getFoundationMap_(): Partial<MDCTextFieldFoundationMap> {\n return {\n characterCounter: this.characterCounter_ ?\n this.characterCounter_.foundationForTextField :\n undefined,\n helperText: this.helperText_ ? this.helperText_.foundationForTextField :\n undefined,\n leadingIcon: this.leadingIcon_ ?\n this.leadingIcon_.foundationForTextField :\n undefined,\n trailingIcon: this.trailingIcon_ ?\n this.trailingIcon_.foundationForTextField :\n undefined,\n };\n }\n\n private createRipple_(rippleFactory: MDCRippleFactory): MDCRipple | null {\n const isTextArea = this.root.classList.contains(cssClasses.TEXTAREA);\n const isOutlined = this.root.classList.contains(cssClasses.OUTLINED);\n\n if (isTextArea || isOutlined) {\n return null;\n }\n\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCRippleAdapter = {\n ...MDCRipple.createAdapter(this),\n isSurfaceActive: () => ponyfill.matches(this.input_, ':active'),\n registerInteractionHandler: (evtType, handler) => this.input_.addEventListener(evtType, handler, applyPassive()),\n deregisterInteractionHandler: (evtType, handler) =>\n this.input_.removeEventListener(evtType, handler, applyPassive()),\n };\n // tslint:enable:object-literal-sort-keys\n return rippleFactory(this.root, new MDCRippleFoundation(adapter));\n }\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst strings = {\n ARIA_CONTROLS: 'aria-controls',\n ARIA_DESCRIBEDBY: 'aria-describedby',\n INPUT_SELECTOR: '.mdc-text-field__input',\n LABEL_SELECTOR: '.mdc-floating-label',\n LEADING_ICON_SELECTOR: '.mdc-text-field__icon--leading',\n LINE_RIPPLE_SELECTOR: '.mdc-line-ripple',\n OUTLINE_SELECTOR: '.mdc-notched-outline',\n PREFIX_SELECTOR: '.mdc-text-field__affix--prefix',\n SUFFIX_SELECTOR: '.mdc-text-field__affix--suffix',\n TRAILING_ICON_SELECTOR: '.mdc-text-field__icon--trailing'\n};\n\nconst cssClasses = {\n DISABLED: 'mdc-text-field--disabled',\n FOCUSED: 'mdc-text-field--focused',\n HELPER_LINE: 'mdc-text-field-helper-line',\n INVALID: 'mdc-text-field--invalid',\n LABEL_FLOATING: 'mdc-text-field--label-floating',\n NO_LABEL: 'mdc-text-field--no-label',\n OUTLINED: 'mdc-text-field--outlined',\n ROOT: 'mdc-text-field',\n TEXTAREA: 'mdc-text-field--textarea',\n WITH_LEADING_ICON: 'mdc-text-field--with-leading-icon',\n WITH_TRAILING_ICON: 'mdc-text-field--with-trailing-icon',\n};\n\nconst numbers = {\n LABEL_SCALE: 0.75,\n};\n\n/**\n * Whitelist based off of https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation\n * under the \"Validation-related attributes\" section.\n */\nconst VALIDATION_ATTR_WHITELIST = [\n 'pattern', 'min', 'max', 'required', 'step', 'minlength', 'maxlength',\n];\n\n/**\n * Label should always float for these types as they show some UI even if value is empty.\n */\nconst ALWAYS_FLOAT_TYPES = [\n 'color', 'date', 'datetime-local', 'month', 'range', 'time', 'week',\n];\n\nexport {cssClasses, strings, numbers, VALIDATION_ATTR_WHITELIST, ALWAYS_FLOAT_TYPES};\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {SpecificEventListener} from '@material/base/types';\nimport {MDCTextFieldAdapter} from './adapter';\nimport {MDCTextFieldCharacterCounterFoundation} from './character-counter/foundation';\nimport {ALWAYS_FLOAT_TYPES, cssClasses, numbers, strings, VALIDATION_ATTR_WHITELIST} from './constants';\nimport {MDCTextFieldHelperTextFoundation} from './helper-text/foundation';\nimport {MDCTextFieldIconFoundation} from './icon/foundation';\nimport {MDCTextFieldFoundationMap, MDCTextFieldNativeInputElement} from './types';\n\ntype PointerDownEventType = 'mousedown'|'touchstart';\ntype InteractionEventType = 'click'|'keydown';\n\nconst POINTERDOWN_EVENTS: PointerDownEventType[] = ['mousedown', 'touchstart'];\nconst INTERACTION_EVENTS: InteractionEventType[] = ['click', 'keydown'];\n\nexport class MDCTextFieldFoundation extends MDCFoundation<MDCTextFieldAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get numbers() {\n return numbers;\n }\n\n private get shouldAlwaysFloat_(): boolean {\n const type = this.getNativeInput_().type;\n return ALWAYS_FLOAT_TYPES.indexOf(type) >= 0;\n }\n\n get shouldFloat(): boolean {\n return this.shouldAlwaysFloat_ || this.isFocused_ || !!this.getValue() ||\n this.isBadInput_();\n }\n\n get shouldShake(): boolean {\n return !this.isFocused_ && !this.isValid() && !!this.getValue();\n }\n\n /**\n * See {@link MDCTextFieldAdapter} for typing information on parameters and\n * return types.\n */\n static get defaultAdapter(): MDCTextFieldAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: () => undefined,\n removeClass: () => undefined,\n hasClass: () => true,\n setInputAttr: () => undefined,\n removeInputAttr: () => undefined,\n registerTextFieldInteractionHandler: () => undefined,\n deregisterTextFieldInteractionHandler: () => undefined,\n registerInputInteractionHandler: () => undefined,\n deregisterInputInteractionHandler: () => undefined,\n registerValidationAttributeChangeHandler: () =>\n new MutationObserver(() => undefined),\n deregisterValidationAttributeChangeHandler: () => undefined,\n getNativeInput: () => null,\n isFocused: () => false,\n activateLineRipple: () => undefined,\n deactivateLineRipple: () => undefined,\n setLineRippleTransformOrigin: () => undefined,\n shakeLabel: () => undefined,\n floatLabel: () => undefined,\n setLabelRequired: () => undefined,\n hasLabel: () => false,\n getLabelWidth: () => 0,\n hasOutline: () => false,\n notchOutline: () => undefined,\n closeOutline: () => undefined,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private isFocused_ = false;\n private receivedUserInput_ = false;\n private isValid_ = true;\n private useNativeValidation_ = true;\n private validateOnValueChange_ = true;\n\n private readonly inputFocusHandler_: () => void;\n private readonly inputBlurHandler_: SpecificEventListener<'blur'>;\n private readonly inputInputHandler_: SpecificEventListener<'input'>;\n private readonly setPointerXOffset_:\n SpecificEventListener<PointerDownEventType>;\n private readonly textFieldInteractionHandler_:\n SpecificEventListener<InteractionEventType>;\n private readonly validationAttributeChangeHandler_:\n (attributesList: string[]) => void;\n private validationObserver_!: MutationObserver; // assigned in init()\n\n private readonly helperText_?: MDCTextFieldHelperTextFoundation;\n private readonly characterCounter_?: MDCTextFieldCharacterCounterFoundation;\n private readonly leadingIcon_?: MDCTextFieldIconFoundation;\n private readonly trailingIcon_?: MDCTextFieldIconFoundation;\n\n /**\n * @param adapter\n * @param foundationMap Map from subcomponent names to their subfoundations.\n */\n constructor(\n adapter?: Partial<MDCTextFieldAdapter>,\n foundationMap: Partial<MDCTextFieldFoundationMap> = {}) {\n super({...MDCTextFieldFoundation.defaultAdapter, ...adapter});\n\n this.helperText_ = foundationMap.helperText;\n this.characterCounter_ = foundationMap.characterCounter;\n this.leadingIcon_ = foundationMap.leadingIcon;\n this.trailingIcon_ = foundationMap.trailingIcon;\n\n this.inputFocusHandler_ = () => this.activateFocus();\n this.inputBlurHandler_ = () => this.deactivateFocus();\n this.inputInputHandler_ = () => this.handleInput();\n this.setPointerXOffset_ = (evt) => this.setTransformOrigin(evt);\n this.textFieldInteractionHandler_ = () => this.handleTextFieldInteraction();\n this.validationAttributeChangeHandler_ = (attributesList) =>\n this.handleValidationAttributeChange(attributesList);\n }\n\n init() {\n if (this.adapter.hasLabel() && this.getNativeInput_().required) {\n this.adapter.setLabelRequired(true);\n }\n\n if (this.adapter.isFocused()) {\n this.inputFocusHandler_();\n } else if (this.adapter.hasLabel() && this.shouldFloat) {\n this.notchOutline(true);\n this.adapter.floatLabel(true);\n this.styleFloating_(true);\n }\n\n this.adapter.registerInputInteractionHandler(\n 'focus', this.inputFocusHandler_);\n this.adapter.registerInputInteractionHandler(\n 'blur', this.inputBlurHandler_);\n this.adapter.registerInputInteractionHandler(\n 'input', this.inputInputHandler_);\n POINTERDOWN_EVENTS.forEach((evtType) => {\n this.adapter.registerInputInteractionHandler(\n evtType, this.setPointerXOffset_);\n });\n INTERACTION_EVENTS.forEach((evtType) => {\n this.adapter.registerTextFieldInteractionHandler(\n evtType, this.textFieldInteractionHandler_);\n });\n this.validationObserver_ =\n this.adapter.registerValidationAttributeChangeHandler(\n this.validationAttributeChangeHandler_);\n this.setCharacterCounter_(this.getValue().length);\n }\n\n destroy() {\n this.adapter.deregisterInputInteractionHandler(\n 'focus', this.inputFocusHandler_);\n this.adapter.deregisterInputInteractionHandler(\n 'blur', this.inputBlurHandler_);\n this.adapter.deregisterInputInteractionHandler(\n 'input', this.inputInputHandler_);\n POINTERDOWN_EVENTS.forEach((evtType) => {\n this.adapter.deregisterInputInteractionHandler(\n evtType, this.setPointerXOffset_);\n });\n INTERACTION_EVENTS.forEach((evtType) => {\n this.adapter.deregisterTextFieldInteractionHandler(\n evtType, this.textFieldInteractionHandler_);\n });\n this.adapter.deregisterValidationAttributeChangeHandler(\n this.validationObserver_);\n }\n\n /**\n * Handles user interactions with the Text Field.\n */\n handleTextFieldInteraction() {\n const nativeInput = this.adapter.getNativeInput();\n if (nativeInput && nativeInput.disabled) {\n return;\n }\n this.receivedUserInput_ = true;\n }\n\n /**\n * Handles validation attribute changes\n */\n handleValidationAttributeChange(attributesList: string[]): void {\n attributesList.some((attributeName) => {\n if (VALIDATION_ATTR_WHITELIST.indexOf(attributeName) > -1) {\n this.styleValidity_(true);\n this.adapter.setLabelRequired(this.getNativeInput_().required);\n return true;\n }\n return false;\n });\n\n if (attributesList.indexOf('maxlength') > -1) {\n this.setCharacterCounter_(this.getValue().length);\n }\n }\n\n /**\n * Opens/closes the notched outline.\n */\n notchOutline(openNotch: boolean) {\n if (!this.adapter.hasOutline() || !this.adapter.hasLabel()) {\n return;\n }\n\n if (openNotch) {\n const labelWidth = this.adapter.getLabelWidth() * numbers.LABEL_SCALE;\n this.adapter.notchOutline(labelWidth);\n } else {\n this.adapter.closeOutline();\n }\n }\n\n /**\n * Activates the text field focus state.\n */\n activateFocus() {\n this.isFocused_ = true;\n this.styleFocused_(this.isFocused_);\n this.adapter.activateLineRipple();\n if (this.adapter.hasLabel()) {\n this.notchOutline(this.shouldFloat);\n this.adapter.floatLabel(this.shouldFloat);\n this.styleFloating_(this.shouldFloat);\n this.adapter.shakeLabel(this.shouldShake);\n }\n if (this.helperText_ &&\n (this.helperText_.isPersistent() || !this.helperText_.isValidation() ||\n !this.isValid_)) {\n this.helperText_.showToScreenReader();\n }\n }\n\n /**\n * Sets the line ripple's transform origin, so that the line ripple activate\n * animation will animate out from the user's click location.\n */\n setTransformOrigin(evt: TouchEvent|MouseEvent): void {\n if (this.isDisabled() || this.adapter.hasOutline()) {\n return;\n }\n\n const touches = (evt as TouchEvent).touches;\n const targetEvent = touches ? touches[0] : evt;\n const targetClientRect =\n (targetEvent.target as Element).getBoundingClientRect();\n const normalizedX =\n (targetEvent as MouseEvent).clientX - targetClientRect.left;\n this.adapter.setLineRippleTransformOrigin(normalizedX);\n }\n\n /**\n * Handles input change of text input and text area.\n */\n handleInput() {\n this.autoCompleteFocus();\n this.setCharacterCounter_(this.getValue().length);\n }\n\n /**\n * Activates the Text Field's focus state in cases when the input value\n * changes without user input (e.g. programmatically).\n */\n autoCompleteFocus() {\n if (!this.receivedUserInput_) {\n this.activateFocus();\n }\n }\n\n /**\n * Deactivates the Text Field's focus state.\n */\n deactivateFocus() {\n this.isFocused_ = false;\n this.adapter.deactivateLineRipple();\n const isValid = this.isValid();\n this.styleValidity_(isValid);\n this.styleFocused_(this.isFocused_);\n if (this.adapter.hasLabel()) {\n this.notchOutline(this.shouldFloat);\n this.adapter.floatLabel(this.shouldFloat);\n this.styleFloating_(this.shouldFloat);\n this.adapter.shakeLabel(this.shouldShake);\n }\n if (!this.shouldFloat) {\n this.receivedUserInput_ = false;\n }\n }\n\n getValue(): string {\n return this.getNativeInput_().value;\n }\n\n /**\n * @param value The value to set on the input Element.\n */\n setValue(value: string): void {\n // Prevent Safari from moving the caret to the end of the input when the\n // value has not changed.\n if (this.getValue() !== value) {\n this.getNativeInput_().value = value;\n }\n this.setCharacterCounter_(value.length);\n if (this.validateOnValueChange_) {\n const isValid = this.isValid();\n this.styleValidity_(isValid);\n }\n if (this.adapter.hasLabel()) {\n this.notchOutline(this.shouldFloat);\n this.adapter.floatLabel(this.shouldFloat);\n this.styleFloating_(this.shouldFloat);\n if (this.validateOnValueChange_) {\n this.adapter.shakeLabel(this.shouldShake);\n }\n }\n }\n\n /**\n * @return The custom validity state, if set; otherwise, the result of a\n * native validity check.\n */\n isValid(): boolean {\n return this.useNativeValidation_ ? this.isNativeInputValid_() :\n this.isValid_;\n }\n\n /**\n * @param isValid Sets the custom validity state of the Text Field.\n */\n setValid(isValid: boolean): void {\n this.isValid_ = isValid;\n this.styleValidity_(isValid);\n\n const shouldShake = !isValid && !this.isFocused_ && !!this.getValue();\n if (this.adapter.hasLabel()) {\n this.adapter.shakeLabel(shouldShake);\n }\n }\n\n /**\n * @param shouldValidate Whether or not validity should be updated on\n * value change.\n */\n setValidateOnValueChange(shouldValidate: boolean): void {\n this.validateOnValueChange_ = shouldValidate;\n }\n\n /**\n * @return Whether or not validity should be updated on value change. `true`\n * by default.\n */\n getValidateOnValueChange(): boolean {\n return this.validateOnValueChange_;\n }\n\n /**\n * Enables or disables the use of native validation. Use this for custom\n * validation.\n * @param useNativeValidation Set this to false to ignore native input\n * validation.\n */\n setUseNativeValidation(useNativeValidation: boolean): void {\n this.useNativeValidation_ = useNativeValidation;\n }\n\n isDisabled(): boolean {\n return this.getNativeInput_().disabled;\n }\n\n /**\n * @param disabled Sets the text-field disabled or enabled.\n */\n setDisabled(disabled: boolean): void {\n this.getNativeInput_().disabled = disabled;\n this.styleDisabled_(disabled);\n }\n\n /**\n * @param content Sets the content of the helper text.\n */\n setHelperTextContent(content: string): void {\n if (this.helperText_) {\n this.helperText_.setContent(content);\n }\n }\n\n /**\n * Sets the aria label of the leading icon.\n */\n setLeadingIconAriaLabel(label: string): void {\n if (this.leadingIcon_) {\n this.leadingIcon_.setAriaLabel(label);\n }\n }\n\n /**\n * Sets the text content of the leading icon.\n */\n setLeadingIconContent(content: string): void {\n if (this.leadingIcon_) {\n this.leadingIcon_.setContent(content);\n }\n }\n\n /**\n * Sets the aria label of the trailing icon.\n */\n setTrailingIconAriaLabel(label: string): void {\n if (this.trailingIcon_) {\n this.trailingIcon_.setAriaLabel(label);\n }\n }\n\n /**\n * Sets the text content of the trailing icon.\n */\n setTrailingIconContent(content: string): void {\n if (this.trailingIcon_) {\n this.trailingIcon_.setContent(content);\n }\n }\n\n /**\n * Sets character counter values that shows characters used and the total\n * character limit.\n */\n private setCharacterCounter_(currentLength: number): void {\n if (!this.characterCounter_) {\n return;\n }\n\n const maxLength = this.getNativeInput_().maxLength;\n if (maxLength === -1) {\n throw new Error(\n 'MDCTextFieldFoundation: Expected maxlength html property on text input or textarea.');\n }\n\n this.characterCounter_.setCounterValue(currentLength, maxLength);\n }\n\n /**\n * @return True if the Text Field input fails in converting the user-supplied\n * value.\n */\n private isBadInput_(): boolean {\n // The badInput property is not supported in IE 11 💩.\n return this.getNativeInput_().validity.badInput || false;\n }\n\n /**\n * @return The result of native validity checking (ValidityState.valid).\n */\n private isNativeInputValid_(): boolean {\n return this.getNativeInput_().validity.valid;\n }\n\n /**\n * Styles the component based on the validity state.\n */\n private styleValidity_(isValid: boolean): void {\n const {INVALID} = MDCTextFieldFoundation.cssClasses;\n if (isValid) {\n this.adapter.removeClass(INVALID);\n } else {\n this.adapter.addClass(INVALID);\n }\n if (this.helperText_) {\n this.helperText_.setValidity(isValid);\n\n // We dynamically set or unset aria-describedby for validation helper text\n // only, based on whether the field is valid\n const helperTextValidation = this.helperText_.isValidation();\n if (!helperTextValidation) {\n return;\n }\n\n const helperTextVisible = this.helperText_.isVisible();\n const helperTextId = this.helperText_.getId();\n\n if (helperTextVisible && helperTextId) {\n this.adapter.setInputAttr(strings.ARIA_DESCRIBEDBY, helperTextId);\n } else {\n this.adapter.removeInputAttr(strings.ARIA_DESCRIBEDBY);\n }\n }\n }\n\n /**\n * Styles the component based on the focused state.\n */\n private styleFocused_(isFocused: boolean): void {\n const {FOCUSED} = MDCTextFieldFoundation.cssClasses;\n if (isFocused) {\n this.adapter.addClass(FOCUSED);\n } else {\n this.adapter.removeClass(FOCUSED);\n }\n }\n\n /**\n * Styles the component based on the disabled state.\n */\n private styleDisabled_(isDisabled: boolean): void {\n const {DISABLED, INVALID} = MDCTextFieldFoundation.cssClasses;\n if (isDisabled) {\n this.adapter.addClass(DISABLED);\n this.adapter.removeClass(INVALID);\n } else {\n this.adapter.removeClass(DISABLED);\n }\n\n if (this.leadingIcon_) {\n this.leadingIcon_.setDisabled(isDisabled);\n }\n\n if (this.trailingIcon_) {\n this.trailingIcon_.setDisabled(isDisabled);\n }\n }\n\n /**\n * Styles the component based on the label floating state.\n */\n private styleFloating_(isFloating: boolean): void {\n const {LABEL_FLOATING} = MDCTextFieldFoundation.cssClasses;\n if (isFloating) {\n this.adapter.addClass(LABEL_FLOATING);\n } else {\n this.adapter.removeClass(LABEL_FLOATING);\n }\n }\n\n /**\n * @return The native text input element from the host environment, or an\n * object with the same shape for unit tests.\n */\n private getNativeInput_(): MDCTextFieldNativeInputElement {\n // this.adapter may be undefined in foundation unit tests. This happens when\n // testdouble is creating a mock object and invokes the\n // shouldShake/shouldFloat getters (which in turn call getValue(), which\n // calls this method) before init() has been called from the MDCTextField\n // constructor. To work around that issue, we return a dummy object.\n const nativeInput = this.adapter ? this.adapter.getNativeInput() : null;\n return nativeInput || {\n disabled: false,\n maxLength: -1,\n required: false,\n type: 'input',\n validity: {\n badInput: false,\n valid: true,\n },\n value: '',\n };\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTextFieldFoundation;\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {MDCTextFieldHelperTextAdapter} from './adapter';\nimport {MDCTextFieldHelperTextFoundation} from './foundation';\n\nexport type MDCTextFieldHelperTextFactory =\n (el: Element, foundation?: MDCTextFieldHelperTextFoundation) => MDCTextFieldHelperText;\n\nexport class MDCTextFieldHelperText extends MDCComponent<MDCTextFieldHelperTextFoundation> {\n static attachTo(root: Element): MDCTextFieldHelperText {\n return new MDCTextFieldHelperText(root);\n }\n\n // Provided for access by MDCTextField component\n get foundationForTextField(): MDCTextFieldHelperTextFoundation {\n return this.foundation;\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCTextFieldHelperTextAdapter = {\n addClass: (className) => this.root.classList.add(className),\n removeClass: (className) => this.root.classList.remove(className),\n hasClass: (className) => this.root.classList.contains(className),\n getAttr: (attr) => this.root.getAttribute(attr),\n setAttr: (attr, value) => this.root.setAttribute(attr, value),\n removeAttr: (attr) => this.root.removeAttribute(attr),\n setContent: (content) => {\n this.root.textContent = content;\n },\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCTextFieldHelperTextFoundation(adapter);\n }\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst cssClasses = {\n HELPER_TEXT_PERSISTENT: 'mdc-text-field-helper-text--persistent',\n HELPER_TEXT_VALIDATION_MSG: 'mdc-text-field-helper-text--validation-msg',\n ROOT: 'mdc-text-field-helper-text',\n};\n\nconst strings = {\n ARIA_HIDDEN: 'aria-hidden',\n ROLE: 'role',\n ROOT_SELECTOR: `.${cssClasses.ROOT}`,\n};\n\nexport {strings, cssClasses};\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCTextFieldHelperTextAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\n\nexport class MDCTextFieldHelperTextFoundation extends MDCFoundation<MDCTextFieldHelperTextAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n /**\n * See {@link MDCTextFieldHelperTextAdapter} for typing information on parameters and return types.\n */\n static get defaultAdapter(): MDCTextFieldHelperTextAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: () => undefined,\n removeClass: () => undefined,\n hasClass: () => false,\n getAttr: () => null,\n setAttr: () => undefined,\n removeAttr: () => undefined,\n setContent: () => undefined,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n constructor(adapter?: Partial<MDCTextFieldHelperTextAdapter>) {\n super({...MDCTextFieldHelperTextFoundation.defaultAdapter, ...adapter});\n }\n\n\n getId(): string|null {\n return this.adapter.getAttr('id');\n }\n\n isVisible(): boolean {\n return this.adapter.getAttr(strings.ARIA_HIDDEN) !== 'true';\n }\n\n /**\n * Sets the content of the helper text field.\n */\n setContent(content: string) {\n this.adapter.setContent(content);\n }\n\n isPersistent(): boolean {\n return this.adapter.hasClass(cssClasses.HELPER_TEXT_PERSISTENT);\n }\n\n /**\n * @param isPersistent Sets the persistency of the helper text.\n */\n setPersistent(isPersistent: boolean) {\n if (isPersistent) {\n this.adapter.addClass(cssClasses.HELPER_TEXT_PERSISTENT);\n } else {\n this.adapter.removeClass(cssClasses.HELPER_TEXT_PERSISTENT);\n }\n }\n\n /**\n * @return whether the helper text acts as an error validation message.\n */\n isValidation(): boolean {\n return this.adapter.hasClass(cssClasses.HELPER_TEXT_VALIDATION_MSG);\n }\n\n /**\n * @param isValidation True to make the helper text act as an error validation message.\n */\n setValidation(isValidation: boolean) {\n if (isValidation) {\n this.adapter.addClass(cssClasses.HELPER_TEXT_VALIDATION_MSG);\n } else {\n this.adapter.removeClass(cssClasses.HELPER_TEXT_VALIDATION_MSG);\n }\n }\n\n /**\n * Makes the helper text visible to the screen reader.\n */\n showToScreenReader() {\n this.adapter.removeAttr(strings.ARIA_HIDDEN);\n }\n\n /**\n * Sets the validity of the helper text based on the input validity.\n */\n setValidity(inputIsValid: boolean) {\n const helperTextIsPersistent = this.adapter.hasClass(cssClasses.HELPER_TEXT_PERSISTENT);\n const helperTextIsValidationMsg = this.adapter.hasClass(cssClasses.HELPER_TEXT_VALIDATION_MSG);\n const validationMsgNeedsDisplay = helperTextIsValidationMsg && !inputIsValid;\n\n if (validationMsgNeedsDisplay) {\n this.showToScreenReader();\n this.adapter.setAttr(strings.ROLE, 'alert');\n } else {\n this.adapter.removeAttr(strings.ROLE);\n }\n\n if (!helperTextIsPersistent && !validationMsgNeedsDisplay) {\n this.hide_();\n }\n }\n\n /**\n * Hides the help text from screen readers.\n */\n private hide_() {\n this.adapter.setAttr(strings.ARIA_HIDDEN, 'true');\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTextFieldHelperTextFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './foundation';\nexport {cssClasses as helperTextCssClasses, strings as helperTextStrings} from './constants';\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {MDCTextFieldIconAdapter} from './adapter';\nimport {MDCTextFieldIconFoundation} from './foundation';\n\nexport type MDCTextFieldIconFactory = (el: Element, foundation?: MDCTextFieldIconFoundation) => MDCTextFieldIcon;\n\nexport class MDCTextFieldIcon extends MDCComponent<MDCTextFieldIconFoundation> {\n static attachTo(root: Element): MDCTextFieldIcon {\n return new MDCTextFieldIcon(root);\n }\n\n // Provided for access by MDCTextField component\n get foundationForTextField(): MDCTextFieldIconFoundation {\n return this.foundation;\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCTextFieldIconAdapter = {\n getAttr: (attr) => this.root.getAttribute(attr),\n setAttr: (attr, value) => this.root.setAttribute(attr, value),\n removeAttr: (attr) => this.root.removeAttribute(attr),\n setContent: (content) => {\n this.root.textContent = content;\n },\n registerInteractionHandler: (evtType, handler) => this.listen(evtType, handler),\n deregisterInteractionHandler: (evtType, handler) => this.unlisten(evtType, handler),\n notifyIconAction: () => this.emit(\n MDCTextFieldIconFoundation.strings.ICON_EVENT, {} /* evtData */, true /* shouldBubble */),\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCTextFieldIconFoundation(adapter);\n }\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst strings = {\n ICON_EVENT: 'MDCTextField:icon',\n ICON_ROLE: 'button',\n};\n\nconst cssClasses = {\n ROOT: 'mdc-text-field__icon',\n};\n\nexport {strings, cssClasses};\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {SpecificEventListener} from '@material/base/types';\nimport {MDCTextFieldIconAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\n\ntype InteractionEventType = 'click' | 'keydown';\n\nconst INTERACTION_EVENTS: InteractionEventType[] = ['click', 'keydown'];\n\nexport class MDCTextFieldIconFoundation extends MDCFoundation<MDCTextFieldIconAdapter> {\n static get strings() {\n return strings;\n }\n\n static get cssClasses() {\n return cssClasses;\n }\n\n /**\n * See {@link MDCTextFieldIconAdapter} for typing information on parameters and return types.\n */\n static get defaultAdapter(): MDCTextFieldIconAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n getAttr: () => null,\n setAttr: () => undefined,\n removeAttr: () => undefined,\n setContent: () => undefined,\n registerInteractionHandler: () => undefined,\n deregisterInteractionHandler: () => undefined,\n notifyIconAction: () => undefined,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private savedTabIndex_: string | null = null;\n private readonly interactionHandler_: SpecificEventListener<InteractionEventType>;\n\n constructor(adapter?: Partial<MDCTextFieldIconAdapter>) {\n super({...MDCTextFieldIconFoundation.defaultAdapter, ...adapter});\n\n this.interactionHandler_ = (evt) => this.handleInteraction(evt);\n }\n\n init() {\n this.savedTabIndex_ = this.adapter.getAttr('tabindex');\n\n INTERACTION_EVENTS.forEach((evtType) => {\n this.adapter.registerInteractionHandler(evtType, this.interactionHandler_);\n });\n }\n\n destroy() {\n INTERACTION_EVENTS.forEach((evtType) => {\n this.adapter.deregisterInteractionHandler(evtType, this.interactionHandler_);\n });\n }\n\n setDisabled(disabled: boolean) {\n if (!this.savedTabIndex_) {\n return;\n }\n\n if (disabled) {\n this.adapter.setAttr('tabindex', '-1');\n this.adapter.removeAttr('role');\n } else {\n this.adapter.setAttr('tabindex', this.savedTabIndex_);\n this.adapter.setAttr('role', strings.ICON_ROLE);\n }\n }\n\n setAriaLabel(label: string) {\n this.adapter.setAttr('aria-label', label);\n }\n\n setContent(content: string) {\n this.adapter.setContent(content);\n }\n\n handleInteraction(evt: MouseEvent | KeyboardEvent) {\n const isEnterKey = (evt as KeyboardEvent).key === 'Enter' || (evt as KeyboardEvent).keyCode === 13;\n if (evt.type === 'click' || isEnterKey) {\n evt.preventDefault(); // stop click from causing host label to focus\n // input\n this.adapter.notifyIconAction();\n }\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTextFieldIconFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './foundation';\nexport {cssClasses as iconCssClasses, strings as iconStrings} from './constants';\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './types';\nexport * from './character-counter/index';\nexport * from './helper-text/index';\nexport * from './icon/index';\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {SpecificEventListener} from '@material/base/types';\n\nimport {MDCTooltipAdapter} from './adapter';\nimport {AnchorBoundaryType, CssClasses, events, XPosition, YPosition} from './constants';\nimport {MDCTooltipFoundation} from './foundation';\n\nexport class MDCTooltip extends MDCComponent<MDCTooltipFoundation> {\n static attachTo(root: Element) {\n return new MDCTooltip(root);\n }\n\n private anchorElem!: HTMLElement; // assigned in initialize\n private isTooltipRich!: boolean; // assigned in initialSyncWithDOM\n private isTooltipPersistent!: boolean; // assigned in initialSyncWithDOM\n\n private handleMouseEnter!: SpecificEventListener<'mouseenter'>;\n private handleFocus!: SpecificEventListener<'focus'>;\n private handleMouseLeave!: SpecificEventListener<'mouseleave'>;\n private handleBlur!: SpecificEventListener<'blur'>;\n private handleTransitionEnd!: SpecificEventListener<'transitionend'>;\n private handleClick!: SpecificEventListener<'click'>;\n\n initialize() {\n const tooltipId = this.root.getAttribute('id');\n if (!tooltipId) {\n throw new Error('MDCTooltip: Tooltip component must have an id.');\n }\n\n const anchorElem = document.querySelector<HTMLElement>(\n `[aria-describedby=\"${tooltipId}\"]`) ||\n document.querySelector<HTMLElement>(`[data-tooltip-id=\"${tooltipId}\"]`);\n if (!anchorElem) {\n throw new Error(\n 'MDCTooltip: Tooltip component requires an anchor element annotated with [aria-describedby] or [data-tooltip-id] anchor element.');\n }\n this.anchorElem = anchorElem;\n }\n\n initialSyncWithDOM() {\n this.isTooltipRich = this.foundation.isRich();\n this.isTooltipPersistent = this.foundation.isPersistent();\n\n this.handleMouseEnter = () => {\n this.foundation.handleAnchorMouseEnter();\n };\n\n this.handleFocus = (evt) => {\n this.foundation.handleAnchorFocus(evt);\n };\n\n this.handleMouseLeave = () => {\n this.foundation.handleAnchorMouseLeave();\n };\n\n this.handleBlur = (evt) => {\n this.foundation.handleAnchorBlur(evt);\n };\n\n this.handleTransitionEnd = () => {\n this.foundation.handleTransitionEnd();\n };\n\n this.handleClick = () => {\n this.foundation.handleAnchorClick();\n };\n\n this.anchorElem.addEventListener('blur', this.handleBlur);\n if (this.isTooltipRich && this.isTooltipPersistent) {\n this.anchorElem.addEventListener('click', this.handleClick);\n } else {\n this.anchorElem.addEventListener('mouseenter', this.handleMouseEnter);\n // TODO(b/157075286): Listening for a 'focus' event is too broad.\n this.anchorElem.addEventListener('focus', this.handleFocus);\n this.anchorElem.addEventListener('mouseleave', this.handleMouseLeave);\n }\n\n this.listen('transitionend', this.handleTransitionEnd);\n }\n\n destroy() {\n if (this.anchorElem) {\n this.anchorElem.removeEventListener('blur', this.handleBlur);\n if (this.isTooltipRich && this.isTooltipPersistent) {\n this.anchorElem.removeEventListener('click', this.handleClick);\n } else {\n this.anchorElem.removeEventListener(\n 'mouseenter', this.handleMouseEnter);\n this.anchorElem.removeEventListener('focus', this.handleFocus);\n this.anchorElem.removeEventListener(\n 'mouseleave', this.handleMouseLeave);\n }\n }\n\n this.unlisten('transitionend', this.handleTransitionEnd);\n super.destroy();\n }\n\n setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) {\n this.foundation.setTooltipPosition(position);\n }\n\n setAnchorBoundaryType(type: AnchorBoundaryType) {\n this.foundation.setAnchorBoundaryType(type);\n }\n\n hide() {\n this.foundation.hide();\n }\n\n isShown() {\n this.foundation.isShown();\n }\n\n getDefaultFoundation() {\n const adapter: MDCTooltipAdapter = {\n getAttribute: (attr) => this.root.getAttribute(attr),\n setAttribute: (attr, value) => {\n this.root.setAttribute(attr, value);\n },\n addClass: (className) => {\n this.root.classList.add(className);\n },\n hasClass: (className) => this.root.classList.contains(className),\n removeClass: (className) => {\n this.root.classList.remove(className);\n },\n getComputedStyleProperty: (propertyName) => {\n return window.getComputedStyle(this.root).getPropertyValue(\n propertyName);\n },\n setStyleProperty: (propertyName, value) => {\n (this.root as HTMLElement).style.setProperty(propertyName, value);\n },\n setSurfaceStyleProperty: (propertyName, value) => {\n const surface =\n this.root.querySelector<HTMLElement>(`.${CssClasses.SURFACE}`);\n surface?.style.setProperty(propertyName, value);\n },\n getViewportWidth: () => window.innerWidth,\n getViewportHeight: () => window.innerHeight,\n getTooltipSize: () => {\n return {\n width: (this.root as HTMLElement).offsetWidth,\n height: (this.root as HTMLElement).offsetHeight\n };\n },\n getAnchorBoundingRect: () => {\n return this.anchorElem ? this.anchorElem.getBoundingClientRect() : null;\n },\n getParentBoundingRect: () => {\n return this.root.parentElement?.getBoundingClientRect() ?? null;\n },\n getAnchorAttribute: (attr) => {\n return this.anchorElem ? this.anchorElem.getAttribute(attr) : null;\n },\n setAnchorAttribute: (attr, value) => {\n this.anchorElem?.setAttribute(attr, value);\n },\n isRTL: () => getComputedStyle(this.root).direction === 'rtl',\n anchorContainsElement: (element) => {\n return !!this.anchorElem?.contains(element);\n },\n tooltipContainsElement: (element) => {\n return this.root.contains(element);\n },\n focusAnchorElement: () => {\n this.anchorElem?.focus();\n },\n registerEventHandler: (evt, handler) => {\n if (this.root instanceof HTMLElement) {\n this.root.addEventListener(evt, handler);\n }\n },\n deregisterEventHandler: (evt, handler) => {\n if (this.root instanceof HTMLElement) {\n this.root.removeEventListener(evt, handler);\n }\n },\n registerDocumentEventHandler: (evt, handler) => {\n document.body.addEventListener(evt, handler);\n },\n deregisterDocumentEventHandler: (evt, handler) => {\n document.body.removeEventListener(evt, handler);\n },\n registerWindowEventHandler: (evt, handler) => {\n window.addEventListener(evt, handler);\n },\n deregisterWindowEventHandler: (evt, handler) => {\n window.removeEventListener(evt, handler);\n },\n notifyHidden: () => {\n this.emit(events.HIDDEN, {});\n },\n };\n\n //tslint:enable:object-literal-sort-keys\n return new MDCTooltipFoundation(adapter);\n }\n}\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nenum CssClasses {\n RICH = 'mdc-tooltip--rich',\n SHOWN = 'mdc-tooltip--shown',\n SHOWING = 'mdc-tooltip--showing',\n SHOWING_TRANSITION = 'mdc-tooltip--showing-transition',\n HIDE = 'mdc-tooltip--hide',\n HIDE_TRANSITION = 'mdc-tooltip--hide-transition',\n MULTILINE_TOOLTIP = 'mdc-tooltip--multiline',\n SURFACE = 'mdc-tooltip__surface',\n}\n\nconst numbers = {\n BOUNDED_ANCHOR_GAP: 4,\n UNBOUNDED_ANCHOR_GAP: 8,\n MIN_VIEWPORT_TOOLTIP_THRESHOLD: 8,\n HIDE_DELAY_MS: 600,\n SHOW_DELAY_MS: 500,\n // LINT.IfChange(tooltip-dimensions)\n MIN_HEIGHT: 24,\n MAX_WIDTH: 200,\n // LINT.ThenChange(_tooltip.scss:tooltip-dimensions)\n};\n\nconst attributes = {\n ARIA_EXPANDED: 'aria-expanded',\n ARIA_HASPOPUP: 'aria-haspopup',\n PERSISTENT: 'data-mdc-tooltip-persistent',\n};\n\nconst events = {\n HIDDEN: 'MDCTooltip:hidden',\n};\n\n/** Enum for possible tooltip positioning relative to its anchor element. */\nenum XPosition {\n DETECTED = 0,\n START = 1,\n // Note: CENTER is not valid for rich tooltips.\n CENTER = 2,\n END = 3,\n}\n\nenum YPosition {\n DETECTED = 0,\n ABOVE = 1,\n BELOW = 2,\n}\n\n/**\n * Enum for possible anchor boundary types. This determines the gap between the\n * bottom of the anchor and the tooltip element.\n * Bounded anchors have an identifiable boundary (e.g. buttons).\n * Unbounded anchors don't have a visually declared boundary (e.g. plain text).\n */\nenum AnchorBoundaryType {\n BOUNDED = 0,\n UNBOUNDED = 1,\n}\n\nconst strings = {\n LEFT: 'left',\n RIGHT: 'right',\n CENTER: 'center',\n TOP: 'top',\n BOTTOM: 'bottom'\n};\n\nexport {\n CssClasses,\n numbers,\n attributes,\n events,\n XPosition,\n AnchorBoundaryType,\n YPosition,\n strings\n};\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {AnimationFrame} from '@material/animation/animationframe';\nimport {getCorrectPropertyName} from '@material/animation/util';\nimport {MDCFoundation} from '@material/base/foundation';\nimport {SpecificEventListener} from '@material/base/types';\nimport {KEY, normalizeKey} from '@material/dom/keyboard';\n\nimport {MDCTooltipAdapter} from './adapter';\nimport {AnchorBoundaryType, attributes, CssClasses, numbers, strings, XPosition, YPosition} from './constants';\nimport {ShowTooltipOptions} from './types';\n\nconst {\n RICH,\n SHOWN,\n SHOWING,\n SHOWING_TRANSITION,\n HIDE,\n HIDE_TRANSITION,\n MULTILINE_TOOLTIP\n} = CssClasses;\n\nenum AnimationKeys {\n POLL_ANCHOR = 'poll_anchor'\n}\n\n// Accessing `window` without a `typeof` check will throw on Node environments.\nconst HAS_WINDOW = typeof window !== 'undefined';\n\nexport class MDCTooltipFoundation extends MDCFoundation<MDCTooltipAdapter> {\n static get defaultAdapter(): MDCTooltipAdapter {\n return {\n getAttribute: () => null,\n setAttribute: () => undefined,\n addClass: () => undefined,\n hasClass: () => false,\n removeClass: () => undefined,\n getComputedStyleProperty: () => '',\n setStyleProperty: () => undefined,\n setSurfaceStyleProperty: () => undefined,\n getViewportWidth: () => 0,\n getViewportHeight: () => 0,\n getTooltipSize: () => ({width: 0, height: 0}),\n getAnchorBoundingRect: () =>\n ({top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0}),\n getParentBoundingRect: () =>\n ({top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0}),\n getAnchorAttribute: () => null,\n setAnchorAttribute: () => null,\n isRTL: () => false,\n anchorContainsElement: () => false,\n tooltipContainsElement: () => false,\n focusAnchorElement: () => undefined,\n registerEventHandler: () => undefined,\n deregisterEventHandler: () => undefined,\n registerDocumentEventHandler: () => undefined,\n deregisterDocumentEventHandler: () => undefined,\n registerWindowEventHandler: () => undefined,\n deregisterWindowEventHandler: () => undefined,\n notifyHidden: () => undefined,\n };\n }\n\n private interactiveTooltip!: boolean; // assigned in init()\n private richTooltip!: boolean; // assigned in init()\n private persistentTooltip!: boolean; // assigned in init()\n private tooltipShown = false;\n private anchorGap = numbers.BOUNDED_ANCHOR_GAP;\n private xTooltipPos = XPosition.DETECTED;\n private yTooltipPos = YPosition.DETECTED;\n // Minimum threshold distance needed between the tooltip and the viewport.\n private readonly minViewportTooltipThreshold =\n numbers.MIN_VIEWPORT_TOOLTIP_THRESHOLD;\n private readonly hideDelayMs = numbers.HIDE_DELAY_MS;\n private readonly showDelayMs = numbers.SHOW_DELAY_MS;\n\n private anchorRect: ClientRect|null = null;\n private parentRect: ClientRect|null = null;\n private frameId: number|null = null;\n private hideTimeout: number|null = null;\n private showTimeout: number|null = null;\n private readonly animFrame: AnimationFrame;\n private readonly documentClickHandler: SpecificEventListener<'click'>;\n private readonly documentKeydownHandler: SpecificEventListener<'keydown'>;\n private readonly richTooltipMouseEnterHandler:\n SpecificEventListener<'mouseenter'>;\n private readonly richTooltipMouseLeaveHandler:\n SpecificEventListener<'mouseleave'>;\n private readonly richTooltipFocusOutHandler:\n SpecificEventListener<'focusout'>;\n private readonly windowScrollHandler: SpecificEventListener<'scroll'>;\n private readonly windowResizeHandler: SpecificEventListener<'resize'>;\n\n constructor(adapter?: Partial<MDCTooltipAdapter>) {\n super({...MDCTooltipFoundation.defaultAdapter, ...adapter});\n this.animFrame = new AnimationFrame();\n\n this.documentClickHandler = (evt) => {\n this.handleDocumentClick(evt);\n };\n\n this.documentKeydownHandler = (evt) => {\n this.handleKeydown(evt);\n };\n\n this.richTooltipMouseEnterHandler = () => {\n this.handleRichTooltipMouseEnter();\n };\n\n this.richTooltipMouseLeaveHandler = () => {\n this.handleRichTooltipMouseLeave();\n };\n\n this.richTooltipFocusOutHandler = (evt) => {\n this.handleRichTooltipFocusOut(evt);\n };\n\n this.windowScrollHandler = () => {\n this.handleWindowChangeEvent();\n };\n\n this.windowResizeHandler = () => {\n this.handleWindowChangeEvent();\n };\n }\n\n init() {\n this.richTooltip = this.adapter.hasClass(RICH);\n this.persistentTooltip =\n this.adapter.getAttribute(attributes.PERSISTENT) === 'true';\n this.interactiveTooltip =\n !!this.adapter.getAnchorAttribute(attributes.ARIA_EXPANDED) &&\n this.adapter.getAnchorAttribute(attributes.ARIA_HASPOPUP) === 'dialog';\n }\n\n isShown() {\n return this.tooltipShown;\n }\n\n isRich() {\n return this.richTooltip;\n }\n\n isPersistent() {\n return this.persistentTooltip;\n }\n\n handleAnchorMouseEnter() {\n if (this.tooltipShown) {\n // Covers the instance where a user hovers over the anchor to reveal the\n // tooltip, and then quickly navigates away and then back to the anchor.\n // The tooltip should stay visible without animating out and then back in\n // again.\n this.show();\n } else {\n // clearHideTimeout here since handleAnchorMouseLeave sets a hideTimeout\n // and that can execute before the showTimeout executes, resulting in hide\n // being called and the showTimeout set below to be cleared.\n this.clearHideTimeout();\n this.showTimeout = setTimeout(() => {\n this.show();\n }, this.showDelayMs);\n }\n }\n\n handleAnchorFocus(evt: FocusEvent) {\n // TODO(b/157075286): Need to add some way to distinguish keyboard\n // navigation focus events from other focus events, and only show the\n // tooltip on the former of these events.\n const {relatedTarget} = evt;\n const tooltipContainsRelatedTarget = relatedTarget instanceof HTMLElement &&\n this.adapter.tooltipContainsElement(relatedTarget);\n // Do not show tooltip if the previous focus was on a tooltip element. This\n // occurs when a rich tooltip is closed and focus is restored to the anchor\n // or when user tab-navigates back into the anchor from the rich tooltip.\n if (tooltipContainsRelatedTarget) {\n return;\n }\n this.showTimeout = setTimeout(() => {\n this.show();\n }, this.showDelayMs);\n }\n\n handleAnchorMouseLeave() {\n this.clearShowTimeout();\n this.hideTimeout = setTimeout(() => {\n this.hide();\n }, this.hideDelayMs);\n }\n\n handleAnchorBlur(evt: FocusEvent) {\n if (this.richTooltip) {\n const tooltipContainsRelatedTargetElement =\n evt.relatedTarget instanceof HTMLElement &&\n this.adapter.tooltipContainsElement(evt.relatedTarget);\n // If focus changed to the tooltip element, don't hide the tooltip.\n if (tooltipContainsRelatedTargetElement) {\n return;\n }\n }\n // Hide tooltip immediately on focus change.\n this.hide();\n }\n\n handleAnchorClick() {\n if (this.tooltipShown) {\n this.hide();\n } else {\n this.show();\n }\n }\n\n handleDocumentClick(evt: MouseEvent) {\n const anchorOrTooltipContainsTargetElement =\n evt.target instanceof HTMLElement &&\n (this.adapter.anchorContainsElement(evt.target) ||\n this.adapter.tooltipContainsElement(evt.target));\n // For persistent rich tooltips, we will not hide if:\n // - The click target is within the anchor element. Otherwise, both\n // the anchor element's click handler and this handler will handle the\n // click (due to event propagation), resulting in a shown tooltip\n // being immediately hidden if the tooltip was initially hidden.\n // - The click target is within the tooltip element, since clicks\n // on the tooltip do not close the tooltip.\n if (this.richTooltip && this.persistentTooltip &&\n anchorOrTooltipContainsTargetElement) {\n return;\n }\n // Hide the tooltip immediately on click.\n this.hide();\n }\n\n handleKeydown(evt: KeyboardEvent) {\n // Hide the tooltip immediately on ESC key.\n const key = normalizeKey(evt);\n if (key === KEY.ESCAPE) {\n const tooltipContainsActiveElement =\n document.activeElement instanceof HTMLElement &&\n this.adapter.tooltipContainsElement(document.activeElement);\n if (tooltipContainsActiveElement) {\n this.adapter.focusAnchorElement();\n }\n this.hide();\n }\n }\n\n private handleRichTooltipMouseEnter() {\n this.show();\n }\n\n private handleRichTooltipMouseLeave() {\n this.clearShowTimeout();\n this.hideTimeout = setTimeout(() => {\n this.hide();\n }, this.hideDelayMs);\n }\n\n private handleRichTooltipFocusOut(evt: FocusEvent) {\n const anchorOrTooltipContainsRelatedTargetElement =\n evt.relatedTarget instanceof HTMLElement &&\n (this.adapter.anchorContainsElement(evt.relatedTarget) ||\n this.adapter.tooltipContainsElement(evt.relatedTarget));\n // If the focus is still within the anchor or the tooltip, do not hide the\n // tooltip.\n if (anchorOrTooltipContainsRelatedTargetElement) {\n return;\n }\n this.hide();\n }\n\n /**\n * On window resize or scroll, check the anchor position and size and\n * repostion tooltip if necessary.\n */\n private handleWindowChangeEvent() {\n // Since scroll and resize events can fire at a high rate, we throttle\n // the potential re-positioning of tooltip component using\n // requestAnimationFrame.\n this.animFrame.request(AnimationKeys.POLL_ANCHOR, () => {\n this.repositionTooltipOnAnchorMove();\n });\n }\n\n show() {\n this.clearHideTimeout();\n this.clearShowTimeout();\n\n if (this.tooltipShown) {\n return;\n }\n\n this.tooltipShown = true;\n const showTooltipOptions = this.parseShowTooltipOptions();\n if (!showTooltipOptions.hideFromScreenreader) {\n this.adapter.setAttribute('aria-hidden', 'false');\n }\n if (this.richTooltip) {\n if (this.interactiveTooltip) {\n this.adapter.setAnchorAttribute('aria-expanded', 'true');\n }\n this.adapter.registerEventHandler(\n 'focusout', this.richTooltipFocusOutHandler);\n if (!this.persistentTooltip) {\n this.adapter.registerEventHandler(\n 'mouseenter', this.richTooltipMouseEnterHandler);\n this.adapter.registerEventHandler(\n 'mouseleave', this.richTooltipMouseLeaveHandler);\n }\n }\n this.adapter.removeClass(HIDE);\n this.adapter.addClass(SHOWING);\n if (this.isTooltipMultiline() && !this.richTooltip) {\n this.adapter.addClass(MULTILINE_TOOLTIP);\n }\n this.anchorRect = this.adapter.getAnchorBoundingRect();\n this.parentRect = this.adapter.getParentBoundingRect();\n this.richTooltip ? this.positionRichTooltip() : this.positionPlainTooltip();\n\n this.adapter.registerDocumentEventHandler(\n 'click', this.documentClickHandler);\n this.adapter.registerDocumentEventHandler(\n 'keydown', this.documentKeydownHandler);\n\n this.adapter.registerWindowEventHandler('scroll', this.windowScrollHandler);\n this.adapter.registerWindowEventHandler('resize', this.windowResizeHandler);\n\n this.frameId = requestAnimationFrame(() => {\n this.clearAllAnimationClasses();\n this.adapter.addClass(SHOWN);\n this.adapter.addClass(SHOWING_TRANSITION);\n });\n }\n\n hide() {\n this.clearHideTimeout();\n this.clearShowTimeout();\n\n if (!this.tooltipShown) {\n return;\n }\n\n if (this.frameId) {\n cancelAnimationFrame(this.frameId);\n }\n\n this.tooltipShown = false;\n this.adapter.setAttribute('aria-hidden', 'true');\n this.adapter.deregisterEventHandler(\n 'focusout', this.richTooltipFocusOutHandler);\n if (this.richTooltip) {\n if (this.interactiveTooltip) {\n this.adapter.setAnchorAttribute('aria-expanded', 'false');\n }\n if (!this.persistentTooltip) {\n this.adapter.deregisterEventHandler(\n 'mouseenter', this.richTooltipMouseEnterHandler);\n this.adapter.deregisterEventHandler(\n 'mouseleave', this.richTooltipMouseLeaveHandler);\n }\n }\n this.clearAllAnimationClasses();\n this.adapter.addClass(HIDE);\n this.adapter.addClass(HIDE_TRANSITION);\n this.adapter.removeClass(SHOWN);\n\n this.adapter.deregisterDocumentEventHandler(\n 'click', this.documentClickHandler);\n this.adapter.deregisterDocumentEventHandler(\n 'keydown', this.documentKeydownHandler);\n this.adapter.deregisterWindowEventHandler(\n 'scroll', this.windowScrollHandler);\n this.adapter.deregisterWindowEventHandler(\n 'resize', this.windowResizeHandler);\n }\n\n handleTransitionEnd() {\n const isHidingTooltip = this.adapter.hasClass(HIDE);\n\n this.adapter.removeClass(SHOWING);\n this.adapter.removeClass(SHOWING_TRANSITION);\n this.adapter.removeClass(HIDE);\n this.adapter.removeClass(HIDE_TRANSITION);\n\n // If handleTransitionEnd is called after hiding the tooltip, the tooltip\n // will have the HIDE class (before calling the adapter removeClass method).\n // If tooltip is now hidden, send a notification that the animation has\n // completed and the tooltip is no longer visible.\n if (isHidingTooltip) {\n this.adapter.notifyHidden();\n }\n }\n\n private clearAllAnimationClasses() {\n this.adapter.removeClass(SHOWING_TRANSITION);\n this.adapter.removeClass(HIDE_TRANSITION);\n }\n\n setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) {\n const {xPos, yPos} = position;\n if (xPos) {\n this.xTooltipPos = xPos;\n }\n\n if (yPos) {\n this.yTooltipPos = yPos;\n }\n }\n\n setAnchorBoundaryType(type: AnchorBoundaryType) {\n if (type === AnchorBoundaryType.UNBOUNDED) {\n this.anchorGap = numbers.UNBOUNDED_ANCHOR_GAP;\n } else {\n this.anchorGap = numbers.BOUNDED_ANCHOR_GAP;\n }\n }\n\n private parseShowTooltipOptions(): ShowTooltipOptions {\n const hideFromScreenreader =\n Boolean(this.adapter.getAnchorAttribute('data-tooltip-id'));\n return {hideFromScreenreader};\n }\n\n private isTooltipMultiline() {\n const tooltipSize = this.adapter.getTooltipSize();\n return tooltipSize.height > numbers.MIN_HEIGHT &&\n tooltipSize.width >= numbers.MAX_WIDTH;\n }\n\n private positionPlainTooltip() {\n // A plain tooltip has `fixed` positioning and is placed as an immediate\n // child of the document body. Its positioning is calculated with respect to\n // the viewport.\n const {top, yTransformOrigin, left, xTransformOrigin} =\n this.calculateTooltipStyles(this.anchorRect);\n\n const transformProperty =\n HAS_WINDOW ? getCorrectPropertyName(window, 'transform') : 'transform';\n this.adapter.setSurfaceStyleProperty(\n `${transformProperty}-origin`,\n `${yTransformOrigin} ${xTransformOrigin}`);\n this.adapter.setStyleProperty('top', `${top}px`);\n this.adapter.setStyleProperty('left', `${left}px`);\n }\n\n private positionRichTooltip() {\n // TODO(b/177686782): Remove width setting when max-content is used to style\n // the rich tooltip.\n\n // getComputedStyleProperty is used instead of getTooltipSize since\n // getTooltipSize returns the offSetWidth, which includes the border and\n // padding. What we need is the width of the tooltip without border and\n // padding.\n const width = this.adapter.getComputedStyleProperty('width');\n // When rich tooltips are positioned within their parent containers, the\n // tooltip width might be shrunk if it collides with the edge of the parent\n // container. We set the width of the tooltip to prevent this.\n this.adapter.setStyleProperty('width', width);\n\n const {top, yTransformOrigin, left, xTransformOrigin} =\n this.calculateTooltipStyles(this.anchorRect);\n\n const transformProperty =\n HAS_WINDOW ? getCorrectPropertyName(window, 'transform') : 'transform';\n this.adapter.setSurfaceStyleProperty(\n `${transformProperty}-origin`,\n `${yTransformOrigin} ${xTransformOrigin}`);\n // A rich tooltip has `absolute` positioning and is placed as a sibling to\n // the anchor element. Its positioning is calculated with respect to the\n // parent element, and so the values need to be adjusted against the parent\n // element.\n const leftAdjustment = left - (this.parentRect?.left ?? 0);\n const topAdjustment = top - (this.parentRect?.top ?? 0);\n this.adapter.setStyleProperty('top', `${topAdjustment}px`);\n this.adapter.setStyleProperty('left', `${leftAdjustment}px`);\n }\n\n /**\n * Calculates the position of the tooltip. A tooltip will be placed beneath\n * the anchor element and aligned either with the 'start'/'end' edge of the\n * anchor element or the 'center'.\n *\n * Tooltip alignment is selected such that the tooltip maintains a threshold\n * distance away from the viewport (defaulting to 'center' alignment). If the\n * placement of the anchor prevents this threshold distance from being\n * maintained, the tooltip is positioned so that it does not collide with the\n * viewport.\n *\n * Users can specify an alignment, however, if this alignment results in the\n * tooltip colliding with the viewport, this specification is overwritten.\n */\n private calculateTooltipStyles(anchorRect: ClientRect|null) {\n if (!anchorRect) {\n return {top: 0, left: 0};\n }\n\n const tooltipSize = this.adapter.getTooltipSize();\n const top = this.calculateYTooltipDistance(anchorRect, tooltipSize.height);\n const left = this.calculateXTooltipDistance(anchorRect, tooltipSize.width);\n\n return {\n top: top.distance,\n yTransformOrigin: top.yTransformOrigin,\n left: left.distance,\n xTransformOrigin: left.xTransformOrigin\n };\n }\n\n /**\n * Calculates the `left` distance for the tooltip.\n * Returns the distance value and a string indicating the x-axis transform-\n * origin that should be used when animating the tooltip.\n */\n private calculateXTooltipDistance(\n anchorRect: ClientRect,\n tooltipWidth: number): ({distance: number, xTransformOrigin: string}) {\n const isLTR = !this.adapter.isRTL();\n let startPos, endPos, centerPos: number|undefined;\n let startTransformOrigin, endTransformOrigin: string;\n if (this.richTooltip) {\n startPos = isLTR ? anchorRect.left - tooltipWidth : anchorRect.right;\n endPos = isLTR ? anchorRect.right : anchorRect.left - tooltipWidth;\n\n startTransformOrigin = isLTR ? strings.RIGHT : strings.LEFT;\n endTransformOrigin = isLTR ? strings.LEFT : strings.RIGHT;\n } else {\n startPos = isLTR ? anchorRect.left : anchorRect.right - tooltipWidth;\n endPos = isLTR ? anchorRect.right - tooltipWidth : anchorRect.left;\n centerPos = anchorRect.left + (anchorRect.width - tooltipWidth) / 2;\n\n startTransformOrigin = isLTR ? strings.LEFT : strings.RIGHT;\n endTransformOrigin = isLTR ? strings.RIGHT : strings.LEFT;\n }\n\n const positionOptions = this.richTooltip ?\n this.determineValidPositionOptions(startPos, endPos) :\n // For plain tooltips, centerPos is defined\n this.determineValidPositionOptions(centerPos!, startPos, endPos);\n\n if (this.xTooltipPos === XPosition.START && positionOptions.has(startPos)) {\n return {distance: startPos, xTransformOrigin: startTransformOrigin};\n }\n if (this.xTooltipPos === XPosition.END && positionOptions.has(endPos)) {\n return {distance: endPos, xTransformOrigin: endTransformOrigin};\n }\n if (this.xTooltipPos === XPosition.CENTER &&\n positionOptions.has(centerPos)) {\n // This code path is only executed if calculating the distance for plain\n // tooltips. In this instance, centerPos will always be defined, so we can\n // safely assert that the returned value is non-null/undefined.\n return {distance: centerPos!, xTransformOrigin: strings.CENTER};\n }\n\n // If no user position is supplied, rich tooltips default to end pos, then\n // start position. Plain tooltips default to center, start, then end.\n const possiblePositions = this.richTooltip ?\n [\n {distance: endPos, xTransformOrigin: endTransformOrigin},\n {distance: startPos, xTransformOrigin: startTransformOrigin}\n ] :\n [\n {distance: centerPos!, xTransformOrigin: strings.CENTER},\n {distance: startPos, xTransformOrigin: startTransformOrigin},\n {distance: endPos, xTransformOrigin: endTransformOrigin}\n ];\n\n const validPosition =\n possiblePositions.find(({distance}) => positionOptions.has(distance));\n if (validPosition) {\n return validPosition;\n }\n\n // Indicates that all potential positions would result in the tooltip\n // colliding with the viewport. This would only occur when the anchor\n // element itself collides with the viewport, or the viewport is very\n // narrow. In this case, we allow the tooltip to be mis-aligned from the\n // anchor element.\n if (anchorRect.left < 0) {\n return {\n distance: this.minViewportTooltipThreshold,\n xTransformOrigin: strings.LEFT\n };\n } else {\n const viewportWidth = this.adapter.getViewportWidth();\n const distance =\n viewportWidth - (tooltipWidth + this.minViewportTooltipThreshold);\n return {distance, xTransformOrigin: strings.RIGHT};\n }\n }\n\n /**\n * Given the values for the horizontal alignments of the tooltip, calculates\n * which of these options would result in the tooltip maintaining the required\n * threshold distance vs which would result in the tooltip staying within the\n * viewport.\n *\n * A Set of values is returned holding the distances that would honor the\n * above requirements. Following the logic for determining the tooltip\n * position, if all alignments violate the threshold, then the returned Set\n * contains values that keep the tooltip within the viewport.\n */\n private determineValidPositionOptions(...positions: number[]) {\n const posWithinThreshold = new Set();\n const posWithinViewport = new Set();\n\n for (const position of positions) {\n if (this.positionHonorsViewportThreshold(position)) {\n posWithinThreshold.add(position);\n } else if (this.positionDoesntCollideWithViewport(position)) {\n posWithinViewport.add(position);\n }\n }\n\n return posWithinThreshold.size ? posWithinThreshold : posWithinViewport;\n }\n\n private positionHonorsViewportThreshold(leftPos: number) {\n const viewportWidth = this.adapter.getViewportWidth();\n const tooltipWidth = this.adapter.getTooltipSize().width;\n\n return leftPos + tooltipWidth <=\n viewportWidth - this.minViewportTooltipThreshold &&\n leftPos >= this.minViewportTooltipThreshold;\n }\n\n private positionDoesntCollideWithViewport(leftPos: number) {\n const viewportWidth = this.adapter.getViewportWidth();\n const tooltipWidth = this.adapter.getTooltipSize().width;\n\n return leftPos + tooltipWidth <= viewportWidth && leftPos >= 0;\n }\n\n /**\n * Calculates the `top` distance for the tooltip.\n * Returns the distance value and a string indicating the y-axis transform-\n * origin that should be used when animating the tooltip.\n */\n private calculateYTooltipDistance(\n anchorRect: ClientRect, tooltipHeight: number) {\n const belowYPos = anchorRect.bottom + this.anchorGap;\n const aboveYPos = anchorRect.top - (this.anchorGap + tooltipHeight);\n const yPositionOptions =\n this.determineValidYPositionOptions(aboveYPos, belowYPos);\n\n if (this.yTooltipPos === YPosition.ABOVE &&\n yPositionOptions.has(aboveYPos)) {\n return {distance: aboveYPos, yTransformOrigin: strings.BOTTOM};\n } else if (\n this.yTooltipPos === YPosition.BELOW &&\n yPositionOptions.has(belowYPos)) {\n return {distance: belowYPos, yTransformOrigin: strings.TOP};\n }\n\n if (yPositionOptions.has(belowYPos)) {\n return {distance: belowYPos, yTransformOrigin: strings.TOP};\n }\n\n if (yPositionOptions.has(aboveYPos)) {\n return {distance: aboveYPos, yTransformOrigin: strings.BOTTOM};\n }\n\n // Indicates that all potential positions would result in the tooltip\n // colliding with the viewport. This would only occur when the viewport is\n // very short.\n return {distance: belowYPos, yTransformOrigin: strings.TOP};\n }\n\n /**\n * Given the values for above/below alignment of the tooltip, calculates\n * which of these options would result in the tooltip maintaining the required\n * threshold distance vs which would result in the tooltip staying within the\n * viewport.\n *\n * A Set of values is returned holding the distances that would honor the\n * above requirements. Following the logic for determining the tooltip\n * position, if all possible alignments violate the threshold, then the\n * returned Set contains values that keep the tooltip within the viewport.\n */\n private determineValidYPositionOptions(\n aboveAnchorPos: number, belowAnchorPos: number) {\n const posWithinThreshold = new Set();\n const posWithinViewport = new Set();\n\n if (this.yPositionHonorsViewportThreshold(aboveAnchorPos)) {\n posWithinThreshold.add(aboveAnchorPos);\n } else if (this.yPositionDoesntCollideWithViewport(aboveAnchorPos)) {\n posWithinViewport.add(aboveAnchorPos);\n }\n\n if (this.yPositionHonorsViewportThreshold(belowAnchorPos)) {\n posWithinThreshold.add(belowAnchorPos);\n } else if (this.yPositionDoesntCollideWithViewport(belowAnchorPos)) {\n posWithinViewport.add(belowAnchorPos);\n }\n\n return posWithinThreshold.size ? posWithinThreshold : posWithinViewport;\n }\n\n private yPositionHonorsViewportThreshold(yPos: number) {\n const viewportHeight = this.adapter.getViewportHeight();\n const tooltipHeight = this.adapter.getTooltipSize().height;\n\n return yPos + tooltipHeight + this.minViewportTooltipThreshold <=\n viewportHeight &&\n yPos >= this.minViewportTooltipThreshold;\n }\n\n private yPositionDoesntCollideWithViewport(yPos: number) {\n const viewportHeight = this.adapter.getViewportHeight();\n const tooltipHeight = this.adapter.getTooltipSize().height;\n\n return yPos + tooltipHeight <= viewportHeight && yPos >= 0;\n }\n\n private repositionTooltipOnAnchorMove() {\n const newAnchorRect = this.adapter.getAnchorBoundingRect();\n if (!newAnchorRect || !this.anchorRect) return;\n\n if (newAnchorRect.top !== this.anchorRect.top ||\n newAnchorRect.left !== this.anchorRect.left ||\n newAnchorRect.height !== this.anchorRect.height ||\n newAnchorRect.width !== this.anchorRect.width) {\n this.anchorRect = newAnchorRect;\n this.parentRect = this.adapter.getParentBoundingRect();\n this.richTooltip ? this.positionRichTooltip() :\n this.positionPlainTooltip();\n }\n }\n\n private clearShowTimeout() {\n if (this.showTimeout) {\n clearTimeout(this.showTimeout);\n this.showTimeout = null;\n }\n }\n\n private clearHideTimeout() {\n if (this.hideTimeout) {\n clearTimeout(this.hideTimeout);\n this.hideTimeout = null;\n }\n }\n\n destroy() {\n if (this.frameId) {\n cancelAnimationFrame(this.frameId);\n this.frameId = null;\n }\n\n this.clearHideTimeout();\n this.clearShowTimeout();\n\n this.adapter.removeClass(SHOWN);\n this.adapter.removeClass(SHOWING_TRANSITION);\n this.adapter.removeClass(SHOWING);\n this.adapter.removeClass(HIDE);\n this.adapter.removeClass(HIDE_TRANSITION);\n\n if (this.richTooltip) {\n this.adapter.deregisterEventHandler(\n 'focusout', this.richTooltipFocusOutHandler);\n if (!this.persistentTooltip) {\n this.adapter.deregisterEventHandler(\n 'mouseenter', this.richTooltipMouseEnterHandler);\n this.adapter.deregisterEventHandler(\n 'mouseleave', this.richTooltipMouseLeaveHandler);\n }\n }\n\n this.adapter.deregisterDocumentEventHandler(\n 'click', this.documentClickHandler);\n this.adapter.deregisterDocumentEventHandler(\n 'keydown', this.documentKeydownHandler);\n\n this.adapter.deregisterWindowEventHandler(\n 'scroll', this.windowScrollHandler);\n this.adapter.deregisterWindowEventHandler(\n 'resize', this.windowResizeHandler);\n\n this.animFrame.cancelAll();\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTooltipFoundation;\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './foundation';\nexport * from './constants';\nexport * from './types';\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {SpecificEventListener} from '@material/base/types';\nimport {MDCRipple, MDCRippleFactory} from '@material/ripple/component';\nimport {MDCTopAppBarAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\nimport {MDCFixedTopAppBarFoundation} from './fixed/foundation';\nimport {MDCTopAppBarBaseFoundation} from './foundation';\nimport {MDCShortTopAppBarFoundation} from './short/foundation';\nimport {MDCTopAppBarFoundation} from './standard/foundation';\n\nexport class MDCTopAppBar extends MDCComponent<MDCTopAppBarBaseFoundation> {\n static attachTo(root: Element): MDCTopAppBar {\n return new MDCTopAppBar(root);\n }\n\n private handleNavigationClick_!: SpecificEventListener<'click'>; // assigned in initialSyncWithDOM()\n private handleWindowResize_!: SpecificEventListener<'resize'>; // assigned in initialSyncWithDOM()\n private handleTargetScroll_!: SpecificEventListener<'scroll'>; // assigned in initialSyncWithDOM()\n private navIcon_!: Element | null;\n private iconRipples_!: MDCRipple[];\n private scrollTarget_!: EventTarget;\n\n initialize(rippleFactory: MDCRippleFactory = (el) => MDCRipple.attachTo(el)) {\n this.navIcon_ = this.root.querySelector(strings.NAVIGATION_ICON_SELECTOR);\n\n // Get all icons in the toolbar and instantiate the ripples\n const icons: Element[] =\n [].slice.call(this.root.querySelectorAll(strings.ACTION_ITEM_SELECTOR));\n if (this.navIcon_) {\n icons.push(this.navIcon_);\n }\n\n this.iconRipples_ = icons.map((icon) => {\n const ripple = rippleFactory(icon);\n ripple.unbounded = true;\n return ripple;\n });\n\n this.scrollTarget_ = window;\n }\n\n initialSyncWithDOM() {\n this.handleNavigationClick_ =\n this.foundation.handleNavigationClick.bind(this.foundation);\n this.handleWindowResize_ =\n this.foundation.handleWindowResize.bind(this.foundation);\n this.handleTargetScroll_ =\n this.foundation.handleTargetScroll.bind(this.foundation);\n\n this.scrollTarget_.addEventListener('scroll', this.handleTargetScroll_ as EventListener);\n\n if (this.navIcon_) {\n this.navIcon_.addEventListener('click', this.handleNavigationClick_ as EventListener);\n }\n\n const isFixed = this.root.classList.contains(cssClasses.FIXED_CLASS);\n const isShort = this.root.classList.contains(cssClasses.SHORT_CLASS);\n if (!isShort && !isFixed) {\n window.addEventListener('resize', this.handleWindowResize_ as EventListener);\n }\n }\n\n destroy() {\n this.iconRipples_.forEach((iconRipple) => iconRipple.destroy());\n this.scrollTarget_.removeEventListener('scroll', this.handleTargetScroll_ as EventListener);\n if (this.navIcon_) {\n this.navIcon_.removeEventListener('click', this.handleNavigationClick_ as EventListener);\n }\n const isFixed = this.root.classList.contains(cssClasses.FIXED_CLASS);\n const isShort = this.root.classList.contains(cssClasses.SHORT_CLASS);\n if (!isShort && !isFixed) {\n window.removeEventListener('resize', this.handleWindowResize_ as EventListener);\n }\n super.destroy();\n }\n\n setScrollTarget(target: EventTarget) {\n // Remove scroll handler from the previous scroll target\n this.scrollTarget_.removeEventListener('scroll', this.handleTargetScroll_ as EventListener);\n\n this.scrollTarget_ = target;\n\n // Initialize scroll handler on the new scroll target\n this.handleTargetScroll_ =\n this.foundation.handleTargetScroll.bind(this.foundation);\n this.scrollTarget_.addEventListener('scroll', this.handleTargetScroll_ as EventListener);\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCTopAppBarAdapter = {\n hasClass: (className) => this.root.classList.contains(className),\n addClass: (className) => this.root.classList.add(className),\n removeClass: (className) => this.root.classList.remove(className),\n setStyle: (property, value) =>\n (this.root as HTMLElement).style.setProperty(property, value),\n getTopAppBarHeight: () => this.root.clientHeight,\n notifyNavigationIconClicked: () =>\n this.emit(strings.NAVIGATION_EVENT, {}),\n getViewportScrollY: () => {\n const win = this.scrollTarget_ as Window;\n const el = this.scrollTarget_ as Element;\n return win.pageYOffset !== undefined ? win.pageYOffset : el.scrollTop;\n },\n getTotalActionItems: () =>\n this.root.querySelectorAll(strings.ACTION_ITEM_SELECTOR).length,\n };\n // tslint:enable:object-literal-sort-keys\n\n let foundation: MDCTopAppBarBaseFoundation;\n if (this.root.classList.contains(cssClasses.SHORT_CLASS)) {\n foundation = new MDCShortTopAppBarFoundation(adapter);\n } else if (this.root.classList.contains(cssClasses.FIXED_CLASS)) {\n foundation = new MDCFixedTopAppBarFoundation(adapter);\n } else {\n foundation = new MDCTopAppBarFoundation(adapter);\n }\n\n return foundation;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst cssClasses = {\n FIXED_CLASS: 'mdc-top-app-bar--fixed',\n FIXED_SCROLLED_CLASS: 'mdc-top-app-bar--fixed-scrolled',\n SHORT_CLASS: 'mdc-top-app-bar--short',\n SHORT_COLLAPSED_CLASS: 'mdc-top-app-bar--short-collapsed',\n SHORT_HAS_ACTION_ITEM_CLASS: 'mdc-top-app-bar--short-has-action-item',\n};\n\nconst numbers = {\n DEBOUNCE_THROTTLE_RESIZE_TIME_MS: 100,\n MAX_TOP_APP_BAR_HEIGHT: 128,\n};\n\nconst strings = {\n ACTION_ITEM_SELECTOR: '.mdc-top-app-bar__action-item',\n NAVIGATION_EVENT: 'MDCTopAppBar:nav',\n NAVIGATION_ICON_SELECTOR: '.mdc-top-app-bar__navigation-icon',\n ROOT_SELECTOR: '.mdc-top-app-bar',\n TITLE_SELECTOR: '.mdc-top-app-bar__title',\n};\n\nexport {cssClasses, numbers, strings};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {cssClasses} from '../constants';\nimport {MDCTopAppBarFoundation} from '../standard/foundation';\n\nexport class MDCFixedTopAppBarFoundation extends MDCTopAppBarFoundation {\n /**\n * State variable for the previous scroll iteration top app bar state\n */\n private wasScrolled_ = false;\n\n /**\n * Scroll handler for applying/removing the modifier class on the fixed top app bar.\n * @override\n */\n handleTargetScroll() {\n const currentScroll = this.adapter.getViewportScrollY();\n\n if (currentScroll <= 0) {\n if (this.wasScrolled_) {\n this.adapter.removeClass(cssClasses.FIXED_SCROLLED_CLASS);\n this.wasScrolled_ = false;\n }\n } else {\n if (!this.wasScrolled_) {\n this.adapter.addClass(cssClasses.FIXED_SCROLLED_CLASS);\n this.wasScrolled_ = true;\n }\n }\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCFixedTopAppBarFoundation;\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCTopAppBarAdapter} from './adapter';\nimport {cssClasses, numbers, strings} from './constants';\n\nexport class MDCTopAppBarBaseFoundation extends MDCFoundation<MDCTopAppBarAdapter> {\n static get strings() {\n return strings;\n }\n\n static get cssClasses() {\n return cssClasses;\n }\n\n static get numbers() {\n return numbers;\n }\n\n /**\n * See {@link MDCTopAppBarAdapter} for typing information on parameters and return types.\n */\n static get defaultAdapter(): MDCTopAppBarAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: () => undefined,\n removeClass: () => undefined,\n hasClass: () => false,\n setStyle: () => undefined,\n getTopAppBarHeight: () => 0,\n notifyNavigationIconClicked: () => undefined,\n getViewportScrollY: () => 0,\n getTotalActionItems: () => 0,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n /* istanbul ignore next: optional argument is not a branch statement */\n constructor(adapter?: Partial<MDCTopAppBarAdapter>) {\n super({...MDCTopAppBarBaseFoundation.defaultAdapter, ...adapter});\n }\n\n /** Other variants of TopAppBar foundation overrides this method */\n handleTargetScroll() {} // tslint:disable-line:no-empty\n /** Other variants of TopAppBar foundation overrides this method */\n handleWindowResize() {} // tslint:disable-line:no-empty\n\n handleNavigationClick() {\n this.adapter.notifyNavigationIconClicked();\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTopAppBarBaseFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './fixed/foundation';\nexport * from './short/foundation';\nexport * from './standard/foundation';\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCTopAppBarAdapter} from '../adapter';\nimport {cssClasses} from '../constants';\nimport {MDCTopAppBarBaseFoundation} from '../foundation';\n\nexport class MDCShortTopAppBarFoundation extends MDCTopAppBarBaseFoundation {\n // Public visibility for backward compatibility.\n get isCollapsed(): boolean {\n return this.isCollapsed_;\n }\n\n private isCollapsed_ = false;\n\n private isAlwaysCollapsed_ = false;\n\n /* istanbul ignore next: optional argument is not a branch statement */\n constructor(adapter?: Partial<MDCTopAppBarAdapter>) {\n super(adapter);\n }\n\n init() {\n super.init();\n\n if (this.adapter.getTotalActionItems() > 0) {\n this.adapter.addClass(cssClasses.SHORT_HAS_ACTION_ITEM_CLASS);\n }\n\n // If initialized with SHORT_COLLAPSED_CLASS, the bar should always be collapsed\n this.setAlwaysCollapsed(\n this.adapter.hasClass(cssClasses.SHORT_COLLAPSED_CLASS));\n }\n\n /**\n * Set if the short top app bar should always be collapsed.\n *\n * @param value When `true`, bar will always be collapsed. When `false`, bar may collapse or expand based on scroll.\n */\n setAlwaysCollapsed(value: boolean) {\n this.isAlwaysCollapsed_ = !!value;\n if (this.isAlwaysCollapsed_) {\n this.collapse_();\n } else {\n // let maybeCollapseBar_ determine if the bar should be collapsed\n this.maybeCollapseBar_();\n }\n }\n\n getAlwaysCollapsed() {\n return this.isAlwaysCollapsed_;\n }\n\n /**\n * Scroll handler for applying/removing the collapsed modifier class on the short top app bar.\n * @override\n */\n handleTargetScroll() {\n this.maybeCollapseBar_();\n }\n\n private maybeCollapseBar_() {\n if (this.isAlwaysCollapsed_) {\n return;\n }\n const currentScroll = this.adapter.getViewportScrollY();\n\n if (currentScroll <= 0) {\n if (this.isCollapsed_) {\n this.uncollapse_();\n }\n } else {\n if (!this.isCollapsed_) {\n this.collapse_();\n }\n }\n }\n\n private uncollapse_() {\n this.adapter.removeClass(cssClasses.SHORT_COLLAPSED_CLASS);\n this.isCollapsed_ = false;\n }\n\n private collapse_() {\n this.adapter.addClass(cssClasses.SHORT_COLLAPSED_CLASS);\n this.isCollapsed_ = true;\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCShortTopAppBarFoundation;\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCTopAppBarAdapter} from '../adapter';\nimport {numbers} from '../constants';\nimport {MDCTopAppBarBaseFoundation} from '../foundation';\n\nconst INITIAL_VALUE = 0;\n\nexport class MDCTopAppBarFoundation extends MDCTopAppBarBaseFoundation {\n /**\n * Indicates if the top app bar was docked in the previous scroll handler iteration.\n */\n private wasDocked_ = true;\n\n /**\n * Indicates if the top app bar is docked in the fully shown position.\n */\n private isDockedShowing_ = true;\n\n /**\n * Variable for current scroll position of the top app bar\n */\n private currentAppBarOffsetTop_ = 0;\n\n /**\n * Used to prevent the top app bar from being scrolled out of view during resize events\n */\n private isCurrentlyBeingResized_ = false;\n\n /**\n * The timeout that's used to throttle the resize events\n */\n private resizeThrottleId_ = INITIAL_VALUE;\n\n /**\n * Used for diffs of current scroll position vs previous scroll position\n */\n private lastScrollPosition_: number;\n\n /**\n * Used to verify when the top app bar is completely showing or completely hidden\n */\n private topAppBarHeight_: number;\n\n /**\n * The timeout that's used to debounce toggling the isCurrentlyBeingResized_ variable after a resize\n */\n private resizeDebounceId_ = INITIAL_VALUE;\n\n /* istanbul ignore next: optional argument is not a branch statement */\n constructor(adapter?: Partial<MDCTopAppBarAdapter>) {\n super(adapter);\n\n this.lastScrollPosition_ = this.adapter.getViewportScrollY();\n this.topAppBarHeight_ = this.adapter.getTopAppBarHeight();\n }\n\n destroy() {\n super.destroy();\n this.adapter.setStyle('top', '');\n }\n\n /**\n * Scroll handler for the default scroll behavior of the top app bar.\n * @override\n */\n handleTargetScroll() {\n const currentScrollPosition = Math.max(this.adapter.getViewportScrollY(), 0);\n const diff = currentScrollPosition - this.lastScrollPosition_;\n this.lastScrollPosition_ = currentScrollPosition;\n\n // If the window is being resized the lastScrollPosition_ needs to be updated but the\n // current scroll of the top app bar should stay in the same position.\n if (!this.isCurrentlyBeingResized_) {\n this.currentAppBarOffsetTop_ -= diff;\n\n if (this.currentAppBarOffsetTop_ > 0) {\n this.currentAppBarOffsetTop_ = 0;\n } else if (Math.abs(this.currentAppBarOffsetTop_) > this.topAppBarHeight_) {\n this.currentAppBarOffsetTop_ = -this.topAppBarHeight_;\n }\n\n this.moveTopAppBar_();\n }\n }\n\n /**\n * Top app bar resize handler that throttle/debounce functions that execute updates.\n * @override\n */\n handleWindowResize() {\n // Throttle resize events 10 p/s\n if (!this.resizeThrottleId_) {\n this.resizeThrottleId_ = setTimeout(() => {\n this.resizeThrottleId_ = INITIAL_VALUE;\n this.throttledResizeHandler_();\n }, numbers.DEBOUNCE_THROTTLE_RESIZE_TIME_MS);\n }\n\n this.isCurrentlyBeingResized_ = true;\n\n if (this.resizeDebounceId_) {\n clearTimeout(this.resizeDebounceId_);\n }\n\n this.resizeDebounceId_ = setTimeout(() => {\n this.handleTargetScroll();\n this.isCurrentlyBeingResized_ = false;\n this.resizeDebounceId_ = INITIAL_VALUE;\n }, numbers.DEBOUNCE_THROTTLE_RESIZE_TIME_MS);\n }\n\n /**\n * Function to determine if the DOM needs to update.\n */\n private checkForUpdate_(): boolean {\n const offscreenBoundaryTop = -this.topAppBarHeight_;\n const hasAnyPixelsOffscreen = this.currentAppBarOffsetTop_ < 0;\n const hasAnyPixelsOnscreen = this.currentAppBarOffsetTop_ > offscreenBoundaryTop;\n const partiallyShowing = hasAnyPixelsOffscreen && hasAnyPixelsOnscreen;\n\n // If it's partially showing, it can't be docked.\n if (partiallyShowing) {\n this.wasDocked_ = false;\n } else {\n // Not previously docked and not partially showing, it's now docked.\n if (!this.wasDocked_) {\n this.wasDocked_ = true;\n return true;\n } else if (this.isDockedShowing_ !== hasAnyPixelsOnscreen) {\n this.isDockedShowing_ = hasAnyPixelsOnscreen;\n return true;\n }\n }\n\n return partiallyShowing;\n }\n\n /**\n * Function to move the top app bar if needed.\n */\n private moveTopAppBar_() {\n if (this.checkForUpdate_()) {\n // Once the top app bar is fully hidden we use the max potential top app bar height as our offset\n // so the top app bar doesn't show if the window resizes and the new height > the old height.\n let offset = this.currentAppBarOffsetTop_;\n if (Math.abs(offset) >= this.topAppBarHeight_) {\n offset = -numbers.MAX_TOP_APP_BAR_HEIGHT;\n }\n\n this.adapter.setStyle('top', offset + 'px');\n }\n }\n\n /**\n * Throttled function that updates the top app bar scrolled values if the\n * top app bar height changes.\n */\n private throttledResizeHandler_() {\n const currentHeight = this.adapter.getTopAppBarHeight();\n if (this.topAppBarHeight_ !== currentHeight) {\n this.wasDocked_ = false;\n\n // Since the top app bar has a different height depending on the screen width, this\n // will ensure that the top app bar remains in the correct location if\n // completely hidden and a resize makes the top app bar a different height.\n this.currentAppBarOffsetTop_ -= this.topAppBarHeight_ - currentHeight;\n this.topAppBarHeight_ = currentHeight;\n }\n this.handleTargetScroll();\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTopAppBarFoundation;\n"],"sourceRoot":""}