[
  {
    "path": ".gitignore",
    "content": ".DS_Store\nnode_modules\nbuild/\n\n# vim\n*.swo\n*.swp\n"
  },
  {
    "path": "LICENSE.md",
    "content": "# Do whatever you want!"
  },
  {
    "path": "README.md",
    "content": "# Sequelizer\n\n### A desktop application to export [sequelize](https://sequelize.org/) models automatically and visually.\n\n\n```bash\n# Clone this repository\ngit clone https://github.com/andyforever/sequelizer.git\n# Go into the repository\ncd sequelizer\n# Install dependencies\nnpm install\n# Run the app\nnpm start\n```\n\nOr do the same by executing one line\n```bash\ngit clone https://github.com/andyforever/sequelizer.git && cd sequelizer && npm install && npm start\n```\n\n![screenshot](https://img.alicdn.com/tfs/TB1dxPomxGYBuNjy0FnXXX5lpXa-845-649.png)\n\nSpecially Thanks the great projects.\n\n[sequelize](https://github.com/sequelize/sequelize)\n\n[squelize-auto](https://github.com/sequelize/sequelize-auto)\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"sequelizer\",\n  \"version\": \"2.0.0\",\n  \"description\": \"A minimal Electron application\",\n  \"main\": \"./src/main.js\",\n  \"scripts\": {\n    \"start\": \"electron .\"\n  },\n  \"repository\": \"https://github.com/andyforever/sequelizer.git\",\n  \"keywords\": [\n    \"sequelize\",\n    \"sequelize-auto\",\n    \"desktop\",\n    \"gui\",\n    \"app\"\n  ],\n  \"author\": \"云数\",\n  \"license\": \"MIT\",\n  \"devDependencies\": {\n    \"electron\": \"^31.4.0\",\n    \"tedious\": \"^2.3.1\"\n  },\n  \"dependencies\": {\n    \"electron\": \"latest\",\n    \"mysql\": \"^2.18.1\",\n    \"mysql2\": \"^2.3.3\",\n    \"pg\": \"^6.1.2\",\n    \"sequelize\": \"^6.21.4\",\n    \"sequelize-auto\": \"latest\"\n  }\n}\n"
  },
  {
    "path": "src/index.html",
    "content": "<!DOCTYPE html>\n<html>\n  <head>\n    <meta charset=\"UTF-8\">\n    <title>Sequelizer</title>\n    <link rel=\"stylesheet\" href=\"./mdl/material.min.css\">\n    <script src=\"./mdl/material.min.js\"></script>\n  </head>\n  <body>\n    <div id=\"progressBar\" class=\"mdl-progress mdl-js-progress mdl-progress__indeterminate\" style=\"width: 100%; display: none\"></div>\n    <div id=\"main\">\n      <form onsubmit=\"handleSubmit(this); return false;\">\n        <div class=\"mdl-grid\">\n          <div class=\"mdl-cell mdl-cell--6-col\">\n            <div class=\"mdl-textfield mdl-js-textfield mdl-textfield--floating-label\">\n              <input class=\"mdl-textfield__input\" type=\"text\" id=\"host\" name=\"host\" value=\"localhost\" required>\n              <label class=\"mdl-textfield__label\" for=\"host\">Host</label>\n              <span class=\"mdl-textfield__error\">Host cannot be number empty!</span>\n            </div>\n          </div>\n          <div class=\"mdl-cell mdl-cell--6-col\">\n            <div class=\"mdl-textfield mdl-js-textfield mdl-textfield--floating-label\">\n              <input class=\"mdl-textfield__input\" type=\"text\" id=\"port\" pattern=\"-?[0-9]*(\\.[0-9]+)?\" name=\"port\" value=\"3306\" required>\n              <label class=\"mdl-textfield__label\" for=\"port\">Port</label>\n              <span class=\"mdl-textfield__error\">Port must be number type and cannot be empty!</span>\n            </div>\n          </div>\n        </div>\n        <div class=\"mdl-grid\">\n          <div class=\"mdl-cell mdl-cell--6-col\">\n            <div class=\"mdl-textfield mdl-js-textfield mdl-textfield--floating-label\">\n              <input class=\"mdl-textfield__input\" type=\"text\" id=\"database\" name=\"database\">\n              <label class=\"mdl-textfield__label\" for=\"database\">Database</label>\n            </div>\n          </div>\n          <div class=\"mdl-cell mdl-cell--6-col\">\n            <label class=\"mdl-radio mdl-js-radio mdl-js-ripple-effect\" for=\"dialect-mysql\">\n              <input type=\"radio\" id=\"dialect-mysql\" class=\"mdl-radio__button\" onchange='onDialectChange(\"mysql\")' name=\"dialect\" value=\"mysql\" checked>\n              <span class=\"mdl-radio__label\">MySQL</span>\n            </label>\n            <label class=\"mdl-radio mdl-js-radio mdl-js-ripple-effect\" for=\"dialect-mariadb\">\n              <input type=\"radio\" id=\"dialect-mariadb\" class=\"mdl-radio__button\" onchange='onDialectChange(\"mariadb\")' name=\"dialect\" value=\"mariadb\">\n              <span class=\"mdl-radio__label\">MariaDB</span>\n            </label>\n             <label class=\"mdl-radio mdl-js-radio mdl-js-ripple-effect\" for=\"dialect-sqlite\">\n              <input type=\"radio\" id=\"dialect-sqlite\" class=\"mdl-radio__button\" onchange='onDialectChange(\"sqlite\")' name=\"dialect\" value=\"sqlite\">\n              <span class=\"mdl-radio__label\">SQLite</span>\n            </label>\n             <label class=\"mdl-radio mdl-js-radio mdl-js-ripple-effect\" for=\"dialect-postgres\">\n              <input type=\"radio\" id=\"dialect-postgres\" class=\"mdl-radio__button\" onchange='onDialectChange(\"postgres\")' name=\"dialect\" value=\"postgres\">\n              <span class=\"mdl-radio__label\">Postgres</span>\n            </label>\n             <label class=\"mdl-radio mdl-js-radio mdl-js-ripple-effect\" for=\"dialect-mssql\">\n              <input type=\"radio\" id=\"dialect-mssql\" class=\"mdl-radio__button\" onchange='onDialectChange(\"mssql\")' name=\"dialect\" value=\"mssql\">\n              <span class=\"mdl-radio__label\">MsSQL</span>\n            </label>\n          </div>\n        </div>\n        <div class=\"mdl-grid\">\n          <div class=\"mdl-cell mdl-cell--6-col\">\n            <div class=\"mdl-textfield mdl-js-textfield mdl-textfield--floating-label\">\n              <input class=\"mdl-textfield__input\" type=\"text\" id=\"schema\" name=\"schema\">\n              <label class=\"mdl-textfield__label\" for=\"schema\">Schema</label>\n            </div>\n          </div>\n        </div>\n        <div class=\"mdl-grid\">\n          <div class=\"mdl-cell mdl-cell--6-col\">\n            <div class=\"mdl-textfield mdl-js-textfield mdl-textfield--floating-label\">\n              <input class=\"mdl-textfield__input\" type=\"text\" id=\"username\" name=\"username\">\n              <label class=\"mdl-textfield__label\" for=\"username\">Username</label>\n            </div>\n          </div>\n          <div class=\"mdl-cell mdl-cell--6-col\">\n            <div class=\"mdl-textfield mdl-js-textfield mdl-textfield--floating-label\">\n              <input class=\"mdl-textfield__input\" type=\"password\" id=\"password\" name=\"password\">\n              <label class=\"mdl-textfield__label\" for=\"password\">Password</label>\n            </div>\n          </div>\n        </div>\n        <div class=\"mdl-grid\">\n          <div class=\"mdl-cell mdl-cell--6-col\">\n            <div class=\"mdl-textfield mdl-js-textfield mdl-textfield--floating-label\">\n              <input class=\"mdl-textfield__input\" type=\"text\" id=\"tables\" name=\"tables\">\n              <label class=\"mdl-textfield__label\" for=\"tables\">Tables(Comma-separated without spaces)</label>\n            </div>\n          </div>\n          <div class=\"mdl-cell mdl-cell--6-col\">\n            <div class=\"mdl-textfield mdl-js-textfield mdl-textfield--floating-label\">\n              <input class=\"mdl-textfield__input\" type=\"upload\" id=\"directory\" name=\"directory\" onclick=\"openFileDialog()\">\n              <label class=\"mdl-textfield__label\" for=\"directory\">Output</label>\n            </div>\n          </div>\n        </div>\n        <div class=\"mdl-grid\">\n          <div class=\"mdl-cell mdl-cell--6-col\">\n            <label class=\"mdl-switch mdl-js-switch mdl-js-ripple-effect\" for=\"camelCase\">\n              <input type=\"checkbox\" id=\"camelCase\" class=\"mdl-switch__input\" name=\"camelCase\" value=\"c\">\n              <span class=\"mdl-switch__label\" style=\"color: #999\">Camelize</span>\n            </label>\n          </div>\n          <div class=\"mdl-cell mdl-cell--6-col\">\n            <label class=\"mdl-switch mdl-js-switch mdl-js-ripple-effect\" for=\"typescript\">\n              <input type=\"checkbox\" id=\"typescript\" class=\"mdl-switch__input\" name=\"lang\" value=\"ts\">\n              <span class=\"mdl-switch__label\" style=\"color: #999\">TypeScript</span>\n            </label>\n          </div>\n        </div>\n        <div class=\"mdl-grid\">\n          <div class=\"mdl-cell mdl-cell--12-col\" style=\"text-align: center;\">\n            <button id=\"exportBtn\" class=\"mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--accent\" type=\"submit\">\n               Export\n            </button>\n          </div>\n        </div>\n      </form>\n    </div>\n  </body>\n  <script src=\"./renderer.js\"></script>\n</html>\n"
  },
  {
    "path": "src/main.js",
    "content": "const { app, Menu, BrowserWindow, dialog, ipcMain } = require('electron/main')\nconst path = require('node:path')\n\nconst isMac = process.platform === 'darwin'\n\nconst template = [...(isMac ? [{\n  label: app.name,\n  submenu: [{\n    label: `About ${app.name}`,\n    role: 'about'\n  }]\n}, {\n  label: 'File',\n  submenu: [\n    { role: 'close' }\n  ]\n}, {\n  label: \"Edit\",\n  submenu: [\n    { role: 'undo' },\n    { role: 'redo' },\n    { type: 'separator' },\n    { role: 'cut' },\n    { role: 'copy' },\n    { role: 'paste' },\n    { role: 'pasteAndMatchStyle' },\n    { role: 'delete' },\n    { role: 'selectAll' },\n    { type: 'separator' },\n    {\n      label: 'Speech',\n      submenu: [\n        { role: 'startSpeaking' },\n        { role: 'stopSpeaking' }\n      ]\n    }\n  ]\n}] : [\n  {\n    label: 'File',\n    submenu: [\n      { role: 'quit' }\n    ]\n  }\n])];\n\nconst menu = Menu.buildFromTemplate(template)\nMenu.setApplicationMenu(menu)\n\nfunction createWindow() {\n  const win = new BrowserWindow({\n    width: 860,\n    height: 650,\n    webPreferences: {\n      nodeIntegration: true,\n      preload: path.join(__dirname, 'preload.js')\n    },\n    icon: path.join(__dirname, 'images/icon.png')\n  })\n  win.loadFile(path.join(__dirname, 'index.html'));\n  // win.webContents.openDevTools();\n}\n\napp.whenReady().then(() => {\n  ipcMain.handle('dialog:open', async (event, args) => {\n    const result = await dialog.showOpenDialog({ properties: ['openDirectory', 'createDirectory'] });\n    return result.filePaths;\n  })\n\n  createWindow();\n\n  app.on('activate', () => {\n    if (BrowserWindow.getAllWindows().length === 0) {\n      createWindow()\n    }\n  })\n})\n\n\n\napp.on('window-all-closed', () => {\n  if (process.platform !== 'darwin') {\n    app.quit()\n  }\n})\n"
  },
  {
    "path": "src/mdl/LICENSE",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright 2015 Google Inc\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n\n   All code in any directories or sub-directories that end with *.html or\n   *.css is licensed under the Creative Commons Attribution International\n   4.0 License, which full text can be found here:\n   https://creativecommons.org/licenses/by/4.0/legalcode.\n\n   As an exception to this license, all html or css that is generated by\n   the software at the direction of the user is copyright the user. The\n   user has full ownership and control over such content, including\n   whether and how they wish to license it.\n"
  },
  {
    "path": "src/mdl/bower.json",
    "content": "{\n  \"name\": \"material-design-lite\",\n  \"version\": \"1.3.0\",\n  \"homepage\": \"https://github.com/google/material-design-lite\",\n  \"authors\": [\n    \"Material Design Lite team\"\n  ],\n  \"description\": \"Material Design Components in CSS, JS and HTML\",\n  \"main\": [\n    \"material.min.css\",\n    \"material.min.js\"\n  ],\n  \"keywords\": [\n    \"material\",\n    \"design\",\n    \"styleguide\",\n    \"style\",\n    \"guide\"\n  ],\n  \"license\": \"Apache-2\",\n  \"ignore\": [\n    \"**/.*\",\n    \"node_modules\",\n    \"bower_components\",\n    \"./lib/.bower_components\",\n    \"test\",\n    \"tests\"\n  ]\n}\n"
  },
  {
    "path": "src/mdl/material.js",
    "content": ";(function() {\n\"use strict\";\n\n/**\n * @license\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * A component handler interface using the revealing module design pattern.\n * More details on this design pattern here:\n * https://github.com/jasonmayes/mdl-component-design-pattern\n *\n * @author Jason Mayes.\n */\n/* exported componentHandler */\n\n// Pre-defining the componentHandler interface, for closure documentation and\n// static verification.\nvar componentHandler = {\n  /**\n   * Searches existing DOM for elements of our component type and upgrades them\n   * if they have not already been upgraded.\n   *\n   * @param {string=} optJsClass the programatic name of the element class we\n   * need to create a new instance of.\n   * @param {string=} optCssClass the name of the CSS class elements of this\n   * type will have.\n   */\n  upgradeDom: function(optJsClass, optCssClass) {},\n  /**\n   * Upgrades a specific element rather than all in the DOM.\n   *\n   * @param {!Element} element The element we wish to upgrade.\n   * @param {string=} optJsClass Optional name of the class we want to upgrade\n   * the element to.\n   */\n  upgradeElement: function(element, optJsClass) {},\n  /**\n   * Upgrades a specific list of elements rather than all in the DOM.\n   *\n   * @param {!Element|!Array<!Element>|!NodeList|!HTMLCollection} elements\n   * The elements we wish to upgrade.\n   */\n  upgradeElements: function(elements) {},\n  /**\n   * Upgrades all registered components found in the current DOM. This is\n   * automatically called on window load.\n   */\n  upgradeAllRegistered: function() {},\n  /**\n   * Allows user to be alerted to any upgrades that are performed for a given\n   * component type\n   *\n   * @param {string} jsClass The class name of the MDL component we wish\n   * to hook into for any upgrades performed.\n   * @param {function(!HTMLElement)} callback The function to call upon an\n   * upgrade. This function should expect 1 parameter - the HTMLElement which\n   * got upgraded.\n   */\n  registerUpgradedCallback: function(jsClass, callback) {},\n  /**\n   * Registers a class for future use and attempts to upgrade existing DOM.\n   *\n   * @param {componentHandler.ComponentConfigPublic} config the registration configuration\n   */\n  register: function(config) {},\n  /**\n   * Downgrade either a given node, an array of nodes, or a NodeList.\n   *\n   * @param {!Node|!Array<!Node>|!NodeList} nodes\n   */\n  downgradeElements: function(nodes) {}\n};\n\ncomponentHandler = (function() {\n  'use strict';\n\n  /** @type {!Array<componentHandler.ComponentConfig>} */\n  var registeredComponents_ = [];\n\n  /** @type {!Array<componentHandler.Component>} */\n  var createdComponents_ = [];\n\n  var componentConfigProperty_ = 'mdlComponentConfigInternal_';\n\n  /**\n   * Searches registered components for a class we are interested in using.\n   * Optionally replaces a match with passed object if specified.\n   *\n   * @param {string} name The name of a class we want to use.\n   * @param {componentHandler.ComponentConfig=} optReplace Optional object to replace match with.\n   * @return {!Object|boolean}\n   * @private\n   */\n  function findRegisteredClass_(name, optReplace) {\n    for (var i = 0; i < registeredComponents_.length; i++) {\n      if (registeredComponents_[i].className === name) {\n        if (typeof optReplace !== 'undefined') {\n          registeredComponents_[i] = optReplace;\n        }\n        return registeredComponents_[i];\n      }\n    }\n    return false;\n  }\n\n  /**\n   * Returns an array of the classNames of the upgraded classes on the element.\n   *\n   * @param {!Element} element The element to fetch data from.\n   * @return {!Array<string>}\n   * @private\n   */\n  function getUpgradedListOfElement_(element) {\n    var dataUpgraded = element.getAttribute('data-upgraded');\n    // Use `['']` as default value to conform the `,name,name...` style.\n    return dataUpgraded === null ? [''] : dataUpgraded.split(',');\n  }\n\n  /**\n   * Returns true if the given element has already been upgraded for the given\n   * class.\n   *\n   * @param {!Element} element The element we want to check.\n   * @param {string} jsClass The class to check for.\n   * @returns {boolean}\n   * @private\n   */\n  function isElementUpgraded_(element, jsClass) {\n    var upgradedList = getUpgradedListOfElement_(element);\n    return upgradedList.indexOf(jsClass) !== -1;\n  }\n\n  /**\n   * Create an event object.\n   *\n   * @param {string} eventType The type name of the event.\n   * @param {boolean} bubbles Whether the event should bubble up the DOM.\n   * @param {boolean} cancelable Whether the event can be canceled.\n   * @returns {!Event}\n   */\n  function createEvent_(eventType, bubbles, cancelable) {\n    if ('CustomEvent' in window && typeof window.CustomEvent === 'function') {\n      return new CustomEvent(eventType, {\n        bubbles: bubbles,\n        cancelable: cancelable\n      });\n    } else {\n      var ev = document.createEvent('Events');\n      ev.initEvent(eventType, bubbles, cancelable);\n      return ev;\n    }\n  }\n\n  /**\n   * Searches existing DOM for elements of our component type and upgrades them\n   * if they have not already been upgraded.\n   *\n   * @param {string=} optJsClass the programatic name of the element class we\n   * need to create a new instance of.\n   * @param {string=} optCssClass the name of the CSS class elements of this\n   * type will have.\n   */\n  function upgradeDomInternal(optJsClass, optCssClass) {\n    if (typeof optJsClass === 'undefined' &&\n        typeof optCssClass === 'undefined') {\n      for (var i = 0; i < registeredComponents_.length; i++) {\n        upgradeDomInternal(registeredComponents_[i].className,\n            registeredComponents_[i].cssClass);\n      }\n    } else {\n      var jsClass = /** @type {string} */ (optJsClass);\n      if (typeof optCssClass === 'undefined') {\n        var registeredClass = findRegisteredClass_(jsClass);\n        if (registeredClass) {\n          optCssClass = registeredClass.cssClass;\n        }\n      }\n\n      var elements = document.querySelectorAll('.' + optCssClass);\n      for (var n = 0; n < elements.length; n++) {\n        upgradeElementInternal(elements[n], jsClass);\n      }\n    }\n  }\n\n  /**\n   * Upgrades a specific element rather than all in the DOM.\n   *\n   * @param {!Element} element The element we wish to upgrade.\n   * @param {string=} optJsClass Optional name of the class we want to upgrade\n   * the element to.\n   */\n  function upgradeElementInternal(element, optJsClass) {\n    // Verify argument type.\n    if (!(typeof element === 'object' && element instanceof Element)) {\n      throw new Error('Invalid argument provided to upgrade MDL element.');\n    }\n    // Allow upgrade to be canceled by canceling emitted event.\n    var upgradingEv = createEvent_('mdl-componentupgrading', true, true);\n    element.dispatchEvent(upgradingEv);\n    if (upgradingEv.defaultPrevented) {\n      return;\n    }\n\n    var upgradedList = getUpgradedListOfElement_(element);\n    var classesToUpgrade = [];\n    // If jsClass is not provided scan the registered components to find the\n    // ones matching the element's CSS classList.\n    if (!optJsClass) {\n      var classList = element.classList;\n      registeredComponents_.forEach(function(component) {\n        // Match CSS & Not to be upgraded & Not upgraded.\n        if (classList.contains(component.cssClass) &&\n            classesToUpgrade.indexOf(component) === -1 &&\n            !isElementUpgraded_(element, component.className)) {\n          classesToUpgrade.push(component);\n        }\n      });\n    } else if (!isElementUpgraded_(element, optJsClass)) {\n      classesToUpgrade.push(findRegisteredClass_(optJsClass));\n    }\n\n    // Upgrade the element for each classes.\n    for (var i = 0, n = classesToUpgrade.length, registeredClass; i < n; i++) {\n      registeredClass = classesToUpgrade[i];\n      if (registeredClass) {\n        // Mark element as upgraded.\n        upgradedList.push(registeredClass.className);\n        element.setAttribute('data-upgraded', upgradedList.join(','));\n        var instance = new registeredClass.classConstructor(element);\n        instance[componentConfigProperty_] = registeredClass;\n        createdComponents_.push(instance);\n        // Call any callbacks the user has registered with this component type.\n        for (var j = 0, m = registeredClass.callbacks.length; j < m; j++) {\n          registeredClass.callbacks[j](element);\n        }\n\n        if (registeredClass.widget) {\n          // Assign per element instance for control over API\n          element[registeredClass.className] = instance;\n        }\n      } else {\n        throw new Error(\n          'Unable to find a registered component for the given class.');\n      }\n\n      var upgradedEv = createEvent_('mdl-componentupgraded', true, false);\n      element.dispatchEvent(upgradedEv);\n    }\n  }\n\n  /**\n   * Upgrades a specific list of elements rather than all in the DOM.\n   *\n   * @param {!Element|!Array<!Element>|!NodeList|!HTMLCollection} elements\n   * The elements we wish to upgrade.\n   */\n  function upgradeElementsInternal(elements) {\n    if (!Array.isArray(elements)) {\n      if (elements instanceof Element) {\n        elements = [elements];\n      } else {\n        elements = Array.prototype.slice.call(elements);\n      }\n    }\n    for (var i = 0, n = elements.length, element; i < n; i++) {\n      element = elements[i];\n      if (element instanceof HTMLElement) {\n        upgradeElementInternal(element);\n        if (element.children.length > 0) {\n          upgradeElementsInternal(element.children);\n        }\n      }\n    }\n  }\n\n  /**\n   * Registers a class for future use and attempts to upgrade existing DOM.\n   *\n   * @param {componentHandler.ComponentConfigPublic} config\n   */\n  function registerInternal(config) {\n    // In order to support both Closure-compiled and uncompiled code accessing\n    // this method, we need to allow for both the dot and array syntax for\n    // property access. You'll therefore see the `foo.bar || foo['bar']`\n    // pattern repeated across this method.\n    var widgetMissing = (typeof config.widget === 'undefined' &&\n        typeof config['widget'] === 'undefined');\n    var widget = true;\n\n    if (!widgetMissing) {\n      widget = config.widget || config['widget'];\n    }\n\n    var newConfig = /** @type {componentHandler.ComponentConfig} */ ({\n      classConstructor: config.constructor || config['constructor'],\n      className: config.classAsString || config['classAsString'],\n      cssClass: config.cssClass || config['cssClass'],\n      widget: widget,\n      callbacks: []\n    });\n\n    registeredComponents_.forEach(function(item) {\n      if (item.cssClass === newConfig.cssClass) {\n        throw new Error('The provided cssClass has already been registered: ' + item.cssClass);\n      }\n      if (item.className === newConfig.className) {\n        throw new Error('The provided className has already been registered');\n      }\n    });\n\n    if (config.constructor.prototype\n        .hasOwnProperty(componentConfigProperty_)) {\n      throw new Error(\n          'MDL component classes must not have ' + componentConfigProperty_ +\n          ' defined as a property.');\n    }\n\n    var found = findRegisteredClass_(config.classAsString, newConfig);\n\n    if (!found) {\n      registeredComponents_.push(newConfig);\n    }\n  }\n\n  /**\n   * Allows user to be alerted to any upgrades that are performed for a given\n   * component type\n   *\n   * @param {string} jsClass The class name of the MDL component we wish\n   * to hook into for any upgrades performed.\n   * @param {function(!HTMLElement)} callback The function to call upon an\n   * upgrade. This function should expect 1 parameter - the HTMLElement which\n   * got upgraded.\n   */\n  function registerUpgradedCallbackInternal(jsClass, callback) {\n    var regClass = findRegisteredClass_(jsClass);\n    if (regClass) {\n      regClass.callbacks.push(callback);\n    }\n  }\n\n  /**\n   * Upgrades all registered components found in the current DOM. This is\n   * automatically called on window load.\n   */\n  function upgradeAllRegisteredInternal() {\n    for (var n = 0; n < registeredComponents_.length; n++) {\n      upgradeDomInternal(registeredComponents_[n].className);\n    }\n  }\n\n  /**\n   * Check the component for the downgrade method.\n   * Execute if found.\n   * Remove component from createdComponents list.\n   *\n   * @param {?componentHandler.Component} component\n   */\n  function deconstructComponentInternal(component) {\n    if (component) {\n      var componentIndex = createdComponents_.indexOf(component);\n      createdComponents_.splice(componentIndex, 1);\n\n      var upgrades = component.element_.getAttribute('data-upgraded').split(',');\n      var componentPlace = upgrades.indexOf(component[componentConfigProperty_].classAsString);\n      upgrades.splice(componentPlace, 1);\n      component.element_.setAttribute('data-upgraded', upgrades.join(','));\n\n      var ev = createEvent_('mdl-componentdowngraded', true, false);\n      component.element_.dispatchEvent(ev);\n    }\n  }\n\n  /**\n   * Downgrade either a given node, an array of nodes, or a NodeList.\n   *\n   * @param {!Node|!Array<!Node>|!NodeList} nodes\n   */\n  function downgradeNodesInternal(nodes) {\n    /**\n     * Auxiliary function to downgrade a single node.\n     * @param  {!Node} node the node to be downgraded\n     */\n    var downgradeNode = function(node) {\n      createdComponents_.filter(function(item) {\n        return item.element_ === node;\n      }).forEach(deconstructComponentInternal);\n    };\n    if (nodes instanceof Array || nodes instanceof NodeList) {\n      for (var n = 0; n < nodes.length; n++) {\n        downgradeNode(nodes[n]);\n      }\n    } else if (nodes instanceof Node) {\n      downgradeNode(nodes);\n    } else {\n      throw new Error('Invalid argument provided to downgrade MDL nodes.');\n    }\n  }\n\n  // Now return the functions that should be made public with their publicly\n  // facing names...\n  return {\n    upgradeDom: upgradeDomInternal,\n    upgradeElement: upgradeElementInternal,\n    upgradeElements: upgradeElementsInternal,\n    upgradeAllRegistered: upgradeAllRegisteredInternal,\n    registerUpgradedCallback: registerUpgradedCallbackInternal,\n    register: registerInternal,\n    downgradeElements: downgradeNodesInternal\n  };\n})();\n\n/**\n * Describes the type of a registered component type managed by\n * componentHandler. Provided for benefit of the Closure compiler.\n *\n * @typedef {{\n *   constructor: Function,\n *   classAsString: string,\n *   cssClass: string,\n *   widget: (string|boolean|undefined)\n * }}\n */\ncomponentHandler.ComponentConfigPublic;  // jshint ignore:line\n\n/**\n * Describes the type of a registered component type managed by\n * componentHandler. Provided for benefit of the Closure compiler.\n *\n * @typedef {{\n *   constructor: !Function,\n *   className: string,\n *   cssClass: string,\n *   widget: (string|boolean),\n *   callbacks: !Array<function(!HTMLElement)>\n * }}\n */\ncomponentHandler.ComponentConfig;  // jshint ignore:line\n\n/**\n * Created component (i.e., upgraded element) type as managed by\n * componentHandler. Provided for benefit of the Closure compiler.\n *\n * @typedef {{\n *   element_: !HTMLElement,\n *   className: string,\n *   classAsString: string,\n *   cssClass: string,\n *   widget: string\n * }}\n */\ncomponentHandler.Component;  // jshint ignore:line\n\n// Export all symbols, for the benefit of Closure compiler.\n// No effect on uncompiled code.\ncomponentHandler['upgradeDom'] = componentHandler.upgradeDom;\ncomponentHandler['upgradeElement'] = componentHandler.upgradeElement;\ncomponentHandler['upgradeElements'] = componentHandler.upgradeElements;\ncomponentHandler['upgradeAllRegistered'] =\n    componentHandler.upgradeAllRegistered;\ncomponentHandler['registerUpgradedCallback'] =\n    componentHandler.registerUpgradedCallback;\ncomponentHandler['register'] = componentHandler.register;\ncomponentHandler['downgradeElements'] = componentHandler.downgradeElements;\nwindow.componentHandler = componentHandler;\nwindow['componentHandler'] = componentHandler;\n\nwindow.addEventListener('load', function() {\n  'use strict';\n\n  /**\n   * Performs a \"Cutting the mustard\" test. If the browser supports the features\n   * tested, adds a mdl-js class to the <html> element. It then upgrades all MDL\n   * components requiring JavaScript.\n   */\n  if ('classList' in document.createElement('div') &&\n      'querySelector' in document &&\n      'addEventListener' in window && Array.prototype.forEach) {\n    document.documentElement.classList.add('mdl-js');\n    componentHandler.upgradeAllRegistered();\n  } else {\n    /**\n     * Dummy function to avoid JS errors.\n     */\n    componentHandler.upgradeElement = function() {};\n    /**\n     * Dummy function to avoid JS errors.\n     */\n    componentHandler.register = function() {};\n  }\n});\n\n// Source: https://github.com/darius/requestAnimationFrame/blob/master/requestAnimationFrame.js\n// Adapted from https://gist.github.com/paulirish/1579671 which derived from\n// http://paulirish.com/2011/requestanimationframe-for-smart-animating/\n// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating\n// requestAnimationFrame polyfill by Erik Möller.\n// Fixes from Paul Irish, Tino Zijdel, Andrew Mao, Klemen Slavič, Darius Bacon\n// MIT license\nif (!Date.now) {\n    /**\n     * Date.now polyfill.\n     * @return {number} the current Date\n     */\n    Date.now = function () {\n        return new Date().getTime();\n    };\n    Date['now'] = Date.now;\n}\nvar vendors = [\n    'webkit',\n    'moz'\n];\nfor (var i = 0; i < vendors.length && !window.requestAnimationFrame; ++i) {\n    var vp = vendors[i];\n    window.requestAnimationFrame = window[vp + 'RequestAnimationFrame'];\n    window.cancelAnimationFrame = window[vp + 'CancelAnimationFrame'] || window[vp + 'CancelRequestAnimationFrame'];\n    window['requestAnimationFrame'] = window.requestAnimationFrame;\n    window['cancelAnimationFrame'] = window.cancelAnimationFrame;\n}\nif (/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent) || !window.requestAnimationFrame || !window.cancelAnimationFrame) {\n    var lastTime = 0;\n    /**\n     * requestAnimationFrame polyfill.\n     * @param  {!Function} callback the callback function.\n     */\n    window.requestAnimationFrame = function (callback) {\n        var now = Date.now();\n        var nextTime = Math.max(lastTime + 16, now);\n        return setTimeout(function () {\n            callback(lastTime = nextTime);\n        }, nextTime - now);\n    };\n    window.cancelAnimationFrame = clearTimeout;\n    window['requestAnimationFrame'] = window.requestAnimationFrame;\n    window['cancelAnimationFrame'] = window.cancelAnimationFrame;\n}\n/**\n * @license\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n   * Class constructor for Button MDL component.\n   * Implements MDL component design pattern defined at:\n   * https://github.com/jasonmayes/mdl-component-design-pattern\n   *\n   * @param {HTMLElement} element The element that will be upgraded.\n   */\nvar MaterialButton = function MaterialButton(element) {\n    this.element_ = element;\n    // Initialize instance.\n    this.init();\n};\nwindow['MaterialButton'] = MaterialButton;\n/**\n   * Store constants in one place so they can be updated easily.\n   *\n   * @enum {string | number}\n   * @private\n   */\nMaterialButton.prototype.Constant_ = {};\n/**\n   * Store strings for class names defined by this component that are used in\n   * JavaScript. This allows us to simply change it in one place should we\n   * decide to modify at a later date.\n   *\n   * @enum {string}\n   * @private\n   */\nMaterialButton.prototype.CssClasses_ = {\n    RIPPLE_EFFECT: 'mdl-js-ripple-effect',\n    RIPPLE_CONTAINER: 'mdl-button__ripple-container',\n    RIPPLE: 'mdl-ripple'\n};\n/**\n   * Handle blur of element.\n   *\n   * @param {Event} event The event that fired.\n   * @private\n   */\nMaterialButton.prototype.blurHandler_ = function (event) {\n    if (event) {\n        this.element_.blur();\n    }\n};\n// Public methods.\n/**\n   * Disable button.\n   *\n   * @public\n   */\nMaterialButton.prototype.disable = function () {\n    this.element_.disabled = true;\n};\nMaterialButton.prototype['disable'] = MaterialButton.prototype.disable;\n/**\n   * Enable button.\n   *\n   * @public\n   */\nMaterialButton.prototype.enable = function () {\n    this.element_.disabled = false;\n};\nMaterialButton.prototype['enable'] = MaterialButton.prototype.enable;\n/**\n   * Initialize element.\n   */\nMaterialButton.prototype.init = function () {\n    if (this.element_) {\n        if (this.element_.classList.contains(this.CssClasses_.RIPPLE_EFFECT)) {\n            var rippleContainer = document.createElement('span');\n            rippleContainer.classList.add(this.CssClasses_.RIPPLE_CONTAINER);\n            this.rippleElement_ = document.createElement('span');\n            this.rippleElement_.classList.add(this.CssClasses_.RIPPLE);\n            rippleContainer.appendChild(this.rippleElement_);\n            this.boundRippleBlurHandler = this.blurHandler_.bind(this);\n            this.rippleElement_.addEventListener('mouseup', this.boundRippleBlurHandler);\n            this.element_.appendChild(rippleContainer);\n        }\n        this.boundButtonBlurHandler = this.blurHandler_.bind(this);\n        this.element_.addEventListener('mouseup', this.boundButtonBlurHandler);\n        this.element_.addEventListener('mouseleave', this.boundButtonBlurHandler);\n    }\n};\n// The component registers itself. It can assume componentHandler is available\n// in the global scope.\ncomponentHandler.register({\n    constructor: MaterialButton,\n    classAsString: 'MaterialButton',\n    cssClass: 'mdl-js-button',\n    widget: true\n});\n/**\n * @license\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n   * Class constructor for Checkbox MDL component.\n   * Implements MDL component design pattern defined at:\n   * https://github.com/jasonmayes/mdl-component-design-pattern\n   *\n   * @constructor\n   * @param {HTMLElement} element The element that will be upgraded.\n   */\nvar MaterialCheckbox = function MaterialCheckbox(element) {\n    this.element_ = element;\n    // Initialize instance.\n    this.init();\n};\nwindow['MaterialCheckbox'] = MaterialCheckbox;\n/**\n   * Store constants in one place so they can be updated easily.\n   *\n   * @enum {string | number}\n   * @private\n   */\nMaterialCheckbox.prototype.Constant_ = { TINY_TIMEOUT: 0.001 };\n/**\n   * Store strings for class names defined by this component that are used in\n   * JavaScript. This allows us to simply change it in one place should we\n   * decide to modify at a later date.\n   *\n   * @enum {string}\n   * @private\n   */\nMaterialCheckbox.prototype.CssClasses_ = {\n    INPUT: 'mdl-checkbox__input',\n    BOX_OUTLINE: 'mdl-checkbox__box-outline',\n    FOCUS_HELPER: 'mdl-checkbox__focus-helper',\n    TICK_OUTLINE: 'mdl-checkbox__tick-outline',\n    RIPPLE_EFFECT: 'mdl-js-ripple-effect',\n    RIPPLE_IGNORE_EVENTS: 'mdl-js-ripple-effect--ignore-events',\n    RIPPLE_CONTAINER: 'mdl-checkbox__ripple-container',\n    RIPPLE_CENTER: 'mdl-ripple--center',\n    RIPPLE: 'mdl-ripple',\n    IS_FOCUSED: 'is-focused',\n    IS_DISABLED: 'is-disabled',\n    IS_CHECKED: 'is-checked',\n    IS_UPGRADED: 'is-upgraded'\n};\n/**\n   * Handle change of state.\n   *\n   * @param {Event} event The event that fired.\n   * @private\n   */\nMaterialCheckbox.prototype.onChange_ = function (event) {\n    this.updateClasses_();\n};\n/**\n   * Handle focus of element.\n   *\n   * @param {Event} event The event that fired.\n   * @private\n   */\nMaterialCheckbox.prototype.onFocus_ = function (event) {\n    this.element_.classList.add(this.CssClasses_.IS_FOCUSED);\n};\n/**\n   * Handle lost focus of element.\n   *\n   * @param {Event} event The event that fired.\n   * @private\n   */\nMaterialCheckbox.prototype.onBlur_ = function (event) {\n    this.element_.classList.remove(this.CssClasses_.IS_FOCUSED);\n};\n/**\n   * Handle mouseup.\n   *\n   * @param {Event} event The event that fired.\n   * @private\n   */\nMaterialCheckbox.prototype.onMouseUp_ = function (event) {\n    this.blur_();\n};\n/**\n   * Handle class updates.\n   *\n   * @private\n   */\nMaterialCheckbox.prototype.updateClasses_ = function () {\n    this.checkDisabled();\n    this.checkToggleState();\n};\n/**\n   * Add blur.\n   *\n   * @private\n   */\nMaterialCheckbox.prototype.blur_ = function () {\n    // TODO: figure out why there's a focus event being fired after our blur,\n    // so that we can avoid this hack.\n    window.setTimeout(function () {\n        this.inputElement_.blur();\n    }.bind(this), this.Constant_.TINY_TIMEOUT);\n};\n// Public methods.\n/**\n   * Check the inputs toggle state and update display.\n   *\n   * @public\n   */\nMaterialCheckbox.prototype.checkToggleState = function () {\n    if (this.inputElement_.checked) {\n        this.element_.classList.add(this.CssClasses_.IS_CHECKED);\n    } else {\n        this.element_.classList.remove(this.CssClasses_.IS_CHECKED);\n    }\n};\nMaterialCheckbox.prototype['checkToggleState'] = MaterialCheckbox.prototype.checkToggleState;\n/**\n   * Check the inputs disabled state and update display.\n   *\n   * @public\n   */\nMaterialCheckbox.prototype.checkDisabled = function () {\n    if (this.inputElement_.disabled) {\n        this.element_.classList.add(this.CssClasses_.IS_DISABLED);\n    } else {\n        this.element_.classList.remove(this.CssClasses_.IS_DISABLED);\n    }\n};\nMaterialCheckbox.prototype['checkDisabled'] = MaterialCheckbox.prototype.checkDisabled;\n/**\n   * Disable checkbox.\n   *\n   * @public\n   */\nMaterialCheckbox.prototype.disable = function () {\n    this.inputElement_.disabled = true;\n    this.updateClasses_();\n};\nMaterialCheckbox.prototype['disable'] = MaterialCheckbox.prototype.disable;\n/**\n   * Enable checkbox.\n   *\n   * @public\n   */\nMaterialCheckbox.prototype.enable = function () {\n    this.inputElement_.disabled = false;\n    this.updateClasses_();\n};\nMaterialCheckbox.prototype['enable'] = MaterialCheckbox.prototype.enable;\n/**\n   * Check checkbox.\n   *\n   * @public\n   */\nMaterialCheckbox.prototype.check = function () {\n    this.inputElement_.checked = true;\n    this.updateClasses_();\n};\nMaterialCheckbox.prototype['check'] = MaterialCheckbox.prototype.check;\n/**\n   * Uncheck checkbox.\n   *\n   * @public\n   */\nMaterialCheckbox.prototype.uncheck = function () {\n    this.inputElement_.checked = false;\n    this.updateClasses_();\n};\nMaterialCheckbox.prototype['uncheck'] = MaterialCheckbox.prototype.uncheck;\n/**\n   * Initialize element.\n   */\nMaterialCheckbox.prototype.init = function () {\n    if (this.element_) {\n        this.inputElement_ = this.element_.querySelector('.' + this.CssClasses_.INPUT);\n        var boxOutline = document.createElement('span');\n        boxOutline.classList.add(this.CssClasses_.BOX_OUTLINE);\n        var tickContainer = document.createElement('span');\n        tickContainer.classList.add(this.CssClasses_.FOCUS_HELPER);\n        var tickOutline = document.createElement('span');\n        tickOutline.classList.add(this.CssClasses_.TICK_OUTLINE);\n        boxOutline.appendChild(tickOutline);\n        this.element_.appendChild(tickContainer);\n        this.element_.appendChild(boxOutline);\n        if (this.element_.classList.contains(this.CssClasses_.RIPPLE_EFFECT)) {\n            this.element_.classList.add(this.CssClasses_.RIPPLE_IGNORE_EVENTS);\n            this.rippleContainerElement_ = document.createElement('span');\n            this.rippleContainerElement_.classList.add(this.CssClasses_.RIPPLE_CONTAINER);\n            this.rippleContainerElement_.classList.add(this.CssClasses_.RIPPLE_EFFECT);\n            this.rippleContainerElement_.classList.add(this.CssClasses_.RIPPLE_CENTER);\n            this.boundRippleMouseUp = this.onMouseUp_.bind(this);\n            this.rippleContainerElement_.addEventListener('mouseup', this.boundRippleMouseUp);\n            var ripple = document.createElement('span');\n            ripple.classList.add(this.CssClasses_.RIPPLE);\n            this.rippleContainerElement_.appendChild(ripple);\n            this.element_.appendChild(this.rippleContainerElement_);\n        }\n        this.boundInputOnChange = this.onChange_.bind(this);\n        this.boundInputOnFocus = this.onFocus_.bind(this);\n        this.boundInputOnBlur = this.onBlur_.bind(this);\n        this.boundElementMouseUp = this.onMouseUp_.bind(this);\n        this.inputElement_.addEventListener('change', this.boundInputOnChange);\n        this.inputElement_.addEventListener('focus', this.boundInputOnFocus);\n        this.inputElement_.addEventListener('blur', this.boundInputOnBlur);\n        this.element_.addEventListener('mouseup', this.boundElementMouseUp);\n        this.updateClasses_();\n        this.element_.classList.add(this.CssClasses_.IS_UPGRADED);\n    }\n};\n// The component registers itself. It can assume componentHandler is available\n// in the global scope.\ncomponentHandler.register({\n    constructor: MaterialCheckbox,\n    classAsString: 'MaterialCheckbox',\n    cssClass: 'mdl-js-checkbox',\n    widget: true\n});\n/**\n * @license\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n   * Class constructor for icon toggle MDL component.\n   * Implements MDL component design pattern defined at:\n   * https://github.com/jasonmayes/mdl-component-design-pattern\n   *\n   * @constructor\n   * @param {HTMLElement} element The element that will be upgraded.\n   */\nvar MaterialIconToggle = function MaterialIconToggle(element) {\n    this.element_ = element;\n    // Initialize instance.\n    this.init();\n};\nwindow['MaterialIconToggle'] = MaterialIconToggle;\n/**\n   * Store constants in one place so they can be updated easily.\n   *\n   * @enum {string | number}\n   * @private\n   */\nMaterialIconToggle.prototype.Constant_ = { TINY_TIMEOUT: 0.001 };\n/**\n   * Store strings for class names defined by this component that are used in\n   * JavaScript. This allows us to simply change it in one place should we\n   * decide to modify at a later date.\n   *\n   * @enum {string}\n   * @private\n   */\nMaterialIconToggle.prototype.CssClasses_ = {\n    INPUT: 'mdl-icon-toggle__input',\n    JS_RIPPLE_EFFECT: 'mdl-js-ripple-effect',\n    RIPPLE_IGNORE_EVENTS: 'mdl-js-ripple-effect--ignore-events',\n    RIPPLE_CONTAINER: 'mdl-icon-toggle__ripple-container',\n    RIPPLE_CENTER: 'mdl-ripple--center',\n    RIPPLE: 'mdl-ripple',\n    IS_FOCUSED: 'is-focused',\n    IS_DISABLED: 'is-disabled',\n    IS_CHECKED: 'is-checked'\n};\n/**\n   * Handle change of state.\n   *\n   * @param {Event} event The event that fired.\n   * @private\n   */\nMaterialIconToggle.prototype.onChange_ = function (event) {\n    this.updateClasses_();\n};\n/**\n   * Handle focus of element.\n   *\n   * @param {Event} event The event that fired.\n   * @private\n   */\nMaterialIconToggle.prototype.onFocus_ = function (event) {\n    this.element_.classList.add(this.CssClasses_.IS_FOCUSED);\n};\n/**\n   * Handle lost focus of element.\n   *\n   * @param {Event} event The event that fired.\n   * @private\n   */\nMaterialIconToggle.prototype.onBlur_ = function (event) {\n    this.element_.classList.remove(this.CssClasses_.IS_FOCUSED);\n};\n/**\n   * Handle mouseup.\n   *\n   * @param {Event} event The event that fired.\n   * @private\n   */\nMaterialIconToggle.prototype.onMouseUp_ = function (event) {\n    this.blur_();\n};\n/**\n   * Handle class updates.\n   *\n   * @private\n   */\nMaterialIconToggle.prototype.updateClasses_ = function () {\n    this.checkDisabled();\n    this.checkToggleState();\n};\n/**\n   * Add blur.\n   *\n   * @private\n   */\nMaterialIconToggle.prototype.blur_ = function () {\n    // TODO: figure out why there's a focus event being fired after our blur,\n    // so that we can avoid this hack.\n    window.setTimeout(function () {\n        this.inputElement_.blur();\n    }.bind(this), this.Constant_.TINY_TIMEOUT);\n};\n// Public methods.\n/**\n   * Check the inputs toggle state and update display.\n   *\n   * @public\n   */\nMaterialIconToggle.prototype.checkToggleState = function () {\n    if (this.inputElement_.checked) {\n        this.element_.classList.add(this.CssClasses_.IS_CHECKED);\n    } else {\n        this.element_.classList.remove(this.CssClasses_.IS_CHECKED);\n    }\n};\nMaterialIconToggle.prototype['checkToggleState'] = MaterialIconToggle.prototype.checkToggleState;\n/**\n   * Check the inputs disabled state and update display.\n   *\n   * @public\n   */\nMaterialIconToggle.prototype.checkDisabled = function () {\n    if (this.inputElement_.disabled) {\n        this.element_.classList.add(this.CssClasses_.IS_DISABLED);\n    } else {\n        this.element_.classList.remove(this.CssClasses_.IS_DISABLED);\n    }\n};\nMaterialIconToggle.prototype['checkDisabled'] = MaterialIconToggle.prototype.checkDisabled;\n/**\n   * Disable icon toggle.\n   *\n   * @public\n   */\nMaterialIconToggle.prototype.disable = function () {\n    this.inputElement_.disabled = true;\n    this.updateClasses_();\n};\nMaterialIconToggle.prototype['disable'] = MaterialIconToggle.prototype.disable;\n/**\n   * Enable icon toggle.\n   *\n   * @public\n   */\nMaterialIconToggle.prototype.enable = function () {\n    this.inputElement_.disabled = false;\n    this.updateClasses_();\n};\nMaterialIconToggle.prototype['enable'] = MaterialIconToggle.prototype.enable;\n/**\n   * Check icon toggle.\n   *\n   * @public\n   */\nMaterialIconToggle.prototype.check = function () {\n    this.inputElement_.checked = true;\n    this.updateClasses_();\n};\nMaterialIconToggle.prototype['check'] = MaterialIconToggle.prototype.check;\n/**\n   * Uncheck icon toggle.\n   *\n   * @public\n   */\nMaterialIconToggle.prototype.uncheck = function () {\n    this.inputElement_.checked = false;\n    this.updateClasses_();\n};\nMaterialIconToggle.prototype['uncheck'] = MaterialIconToggle.prototype.uncheck;\n/**\n   * Initialize element.\n   */\nMaterialIconToggle.prototype.init = function () {\n    if (this.element_) {\n        this.inputElement_ = this.element_.querySelector('.' + this.CssClasses_.INPUT);\n        if (this.element_.classList.contains(this.CssClasses_.JS_RIPPLE_EFFECT)) {\n            this.element_.classList.add(this.CssClasses_.RIPPLE_IGNORE_EVENTS);\n            this.rippleContainerElement_ = document.createElement('span');\n            this.rippleContainerElement_.classList.add(this.CssClasses_.RIPPLE_CONTAINER);\n            this.rippleContainerElement_.classList.add(this.CssClasses_.JS_RIPPLE_EFFECT);\n            this.rippleContainerElement_.classList.add(this.CssClasses_.RIPPLE_CENTER);\n            this.boundRippleMouseUp = this.onMouseUp_.bind(this);\n            this.rippleContainerElement_.addEventListener('mouseup', this.boundRippleMouseUp);\n            var ripple = document.createElement('span');\n            ripple.classList.add(this.CssClasses_.RIPPLE);\n            this.rippleContainerElement_.appendChild(ripple);\n            this.element_.appendChild(this.rippleContainerElement_);\n        }\n        this.boundInputOnChange = this.onChange_.bind(this);\n        this.boundInputOnFocus = this.onFocus_.bind(this);\n        this.boundInputOnBlur = this.onBlur_.bind(this);\n        this.boundElementOnMouseUp = this.onMouseUp_.bind(this);\n        this.inputElement_.addEventListener('change', this.boundInputOnChange);\n        this.inputElement_.addEventListener('focus', this.boundInputOnFocus);\n        this.inputElement_.addEventListener('blur', this.boundInputOnBlur);\n        this.element_.addEventListener('mouseup', this.boundElementOnMouseUp);\n        this.updateClasses_();\n        this.element_.classList.add('is-upgraded');\n    }\n};\n// The component registers itself. It can assume componentHandler is available\n// in the global scope.\ncomponentHandler.register({\n    constructor: MaterialIconToggle,\n    classAsString: 'MaterialIconToggle',\n    cssClass: 'mdl-js-icon-toggle',\n    widget: true\n});\n/**\n * @license\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n   * Class constructor for dropdown MDL component.\n   * Implements MDL component design pattern defined at:\n   * https://github.com/jasonmayes/mdl-component-design-pattern\n   *\n   * @constructor\n   * @param {HTMLElement} element The element that will be upgraded.\n   */\nvar MaterialMenu = function MaterialMenu(element) {\n    this.element_ = element;\n    // Initialize instance.\n    this.init();\n};\nwindow['MaterialMenu'] = MaterialMenu;\n/**\n   * Store constants in one place so they can be updated easily.\n   *\n   * @enum {string | number}\n   * @private\n   */\nMaterialMenu.prototype.Constant_ = {\n    // Total duration of the menu animation.\n    TRANSITION_DURATION_SECONDS: 0.3,\n    // The fraction of the total duration we want to use for menu item animations.\n    TRANSITION_DURATION_FRACTION: 0.8,\n    // How long the menu stays open after choosing an option (so the user can see\n    // the ripple).\n    CLOSE_TIMEOUT: 150\n};\n/**\n   * Keycodes, for code readability.\n   *\n   * @enum {number}\n   * @private\n   */\nMaterialMenu.prototype.Keycodes_ = {\n    ENTER: 13,\n    ESCAPE: 27,\n    SPACE: 32,\n    UP_ARROW: 38,\n    DOWN_ARROW: 40\n};\n/**\n   * Store strings for class names defined by this component that are used in\n   * JavaScript. This allows us to simply change it in one place should we\n   * decide to modify at a later date.\n   *\n   * @enum {string}\n   * @private\n   */\nMaterialMenu.prototype.CssClasses_ = {\n    CONTAINER: 'mdl-menu__container',\n    OUTLINE: 'mdl-menu__outline',\n    ITEM: 'mdl-menu__item',\n    ITEM_RIPPLE_CONTAINER: 'mdl-menu__item-ripple-container',\n    RIPPLE_EFFECT: 'mdl-js-ripple-effect',\n    RIPPLE_IGNORE_EVENTS: 'mdl-js-ripple-effect--ignore-events',\n    RIPPLE: 'mdl-ripple',\n    // Statuses\n    IS_UPGRADED: 'is-upgraded',\n    IS_VISIBLE: 'is-visible',\n    IS_ANIMATING: 'is-animating',\n    // Alignment options\n    BOTTOM_LEFT: 'mdl-menu--bottom-left',\n    // This is the default.\n    BOTTOM_RIGHT: 'mdl-menu--bottom-right',\n    TOP_LEFT: 'mdl-menu--top-left',\n    TOP_RIGHT: 'mdl-menu--top-right',\n    UNALIGNED: 'mdl-menu--unaligned'\n};\n/**\n   * Initialize element.\n   */\nMaterialMenu.prototype.init = function () {\n    if (this.element_) {\n        // Create container for the menu.\n        var container = document.createElement('div');\n        container.classList.add(this.CssClasses_.CONTAINER);\n        this.element_.parentElement.insertBefore(container, this.element_);\n        this.element_.parentElement.removeChild(this.element_);\n        container.appendChild(this.element_);\n        this.container_ = container;\n        // Create outline for the menu (shadow and background).\n        var outline = document.createElement('div');\n        outline.classList.add(this.CssClasses_.OUTLINE);\n        this.outline_ = outline;\n        container.insertBefore(outline, this.element_);\n        // Find the \"for\" element and bind events to it.\n        var forElId = this.element_.getAttribute('for') || this.element_.getAttribute('data-mdl-for');\n        var forEl = null;\n        if (forElId) {\n            forEl = document.getElementById(forElId);\n            if (forEl) {\n                this.forElement_ = forEl;\n                forEl.addEventListener('click', this.handleForClick_.bind(this));\n                forEl.addEventListener('keydown', this.handleForKeyboardEvent_.bind(this));\n            }\n        }\n        var items = this.element_.querySelectorAll('.' + this.CssClasses_.ITEM);\n        this.boundItemKeydown_ = this.handleItemKeyboardEvent_.bind(this);\n        this.boundItemClick_ = this.handleItemClick_.bind(this);\n        for (var i = 0; i < items.length; i++) {\n            // Add a listener to each menu item.\n            items[i].addEventListener('click', this.boundItemClick_);\n            // Add a tab index to each menu item.\n            items[i].tabIndex = '-1';\n            // Add a keyboard listener to each menu item.\n            items[i].addEventListener('keydown', this.boundItemKeydown_);\n        }\n        // Add ripple classes to each item, if the user has enabled ripples.\n        if (this.element_.classList.contains(this.CssClasses_.RIPPLE_EFFECT)) {\n            this.element_.classList.add(this.CssClasses_.RIPPLE_IGNORE_EVENTS);\n            for (i = 0; i < items.length; i++) {\n                var item = items[i];\n                var rippleContainer = document.createElement('span');\n                rippleContainer.classList.add(this.CssClasses_.ITEM_RIPPLE_CONTAINER);\n                var ripple = document.createElement('span');\n                ripple.classList.add(this.CssClasses_.RIPPLE);\n                rippleContainer.appendChild(ripple);\n                item.appendChild(rippleContainer);\n                item.classList.add(this.CssClasses_.RIPPLE_EFFECT);\n            }\n        }\n        // Copy alignment classes to the container, so the outline can use them.\n        if (this.element_.classList.contains(this.CssClasses_.BOTTOM_LEFT)) {\n            this.outline_.classList.add(this.CssClasses_.BOTTOM_LEFT);\n        }\n        if (this.element_.classList.contains(this.CssClasses_.BOTTOM_RIGHT)) {\n            this.outline_.classList.add(this.CssClasses_.BOTTOM_RIGHT);\n        }\n        if (this.element_.classList.contains(this.CssClasses_.TOP_LEFT)) {\n            this.outline_.classList.add(this.CssClasses_.TOP_LEFT);\n        }\n        if (this.element_.classList.contains(this.CssClasses_.TOP_RIGHT)) {\n            this.outline_.classList.add(this.CssClasses_.TOP_RIGHT);\n        }\n        if (this.element_.classList.contains(this.CssClasses_.UNALIGNED)) {\n            this.outline_.classList.add(this.CssClasses_.UNALIGNED);\n        }\n        container.classList.add(this.CssClasses_.IS_UPGRADED);\n    }\n};\n/**\n   * Handles a click on the \"for\" element, by positioning the menu and then\n   * toggling it.\n   *\n   * @param {Event} evt The event that fired.\n   * @private\n   */\nMaterialMenu.prototype.handleForClick_ = function (evt) {\n    if (this.element_ && this.forElement_) {\n        var rect = this.forElement_.getBoundingClientRect();\n        var forRect = this.forElement_.parentElement.getBoundingClientRect();\n        if (this.element_.classList.contains(this.CssClasses_.UNALIGNED)) {\n        } else if (this.element_.classList.contains(this.CssClasses_.BOTTOM_RIGHT)) {\n            // Position below the \"for\" element, aligned to its right.\n            this.container_.style.right = forRect.right - rect.right + 'px';\n            this.container_.style.top = this.forElement_.offsetTop + this.forElement_.offsetHeight + 'px';\n        } else if (this.element_.classList.contains(this.CssClasses_.TOP_LEFT)) {\n            // Position above the \"for\" element, aligned to its left.\n            this.container_.style.left = this.forElement_.offsetLeft + 'px';\n            this.container_.style.bottom = forRect.bottom - rect.top + 'px';\n        } else if (this.element_.classList.contains(this.CssClasses_.TOP_RIGHT)) {\n            // Position above the \"for\" element, aligned to its right.\n            this.container_.style.right = forRect.right - rect.right + 'px';\n            this.container_.style.bottom = forRect.bottom - rect.top + 'px';\n        } else {\n            // Default: position below the \"for\" element, aligned to its left.\n            this.container_.style.left = this.forElement_.offsetLeft + 'px';\n            this.container_.style.top = this.forElement_.offsetTop + this.forElement_.offsetHeight + 'px';\n        }\n    }\n    this.toggle(evt);\n};\n/**\n   * Handles a keyboard event on the \"for\" element.\n   *\n   * @param {Event} evt The event that fired.\n   * @private\n   */\nMaterialMenu.prototype.handleForKeyboardEvent_ = function (evt) {\n    if (this.element_ && this.container_ && this.forElement_) {\n        var items = this.element_.querySelectorAll('.' + this.CssClasses_.ITEM + ':not([disabled])');\n        if (items && items.length > 0 && this.container_.classList.contains(this.CssClasses_.IS_VISIBLE)) {\n            if (evt.keyCode === this.Keycodes_.UP_ARROW) {\n                evt.preventDefault();\n                items[items.length - 1].focus();\n            } else if (evt.keyCode === this.Keycodes_.DOWN_ARROW) {\n                evt.preventDefault();\n                items[0].focus();\n            }\n        }\n    }\n};\n/**\n   * Handles a keyboard event on an item.\n   *\n   * @param {Event} evt The event that fired.\n   * @private\n   */\nMaterialMenu.prototype.handleItemKeyboardEvent_ = function (evt) {\n    if (this.element_ && this.container_) {\n        var items = this.element_.querySelectorAll('.' + this.CssClasses_.ITEM + ':not([disabled])');\n        if (items && items.length > 0 && this.container_.classList.contains(this.CssClasses_.IS_VISIBLE)) {\n            var currentIndex = Array.prototype.slice.call(items).indexOf(evt.target);\n            if (evt.keyCode === this.Keycodes_.UP_ARROW) {\n                evt.preventDefault();\n                if (currentIndex > 0) {\n                    items[currentIndex - 1].focus();\n                } else {\n                    items[items.length - 1].focus();\n                }\n            } else if (evt.keyCode === this.Keycodes_.DOWN_ARROW) {\n                evt.preventDefault();\n                if (items.length > currentIndex + 1) {\n                    items[currentIndex + 1].focus();\n                } else {\n                    items[0].focus();\n                }\n            } else if (evt.keyCode === this.Keycodes_.SPACE || evt.keyCode === this.Keycodes_.ENTER) {\n                evt.preventDefault();\n                // Send mousedown and mouseup to trigger ripple.\n                var e = new MouseEvent('mousedown');\n                evt.target.dispatchEvent(e);\n                e = new MouseEvent('mouseup');\n                evt.target.dispatchEvent(e);\n                // Send click.\n                evt.target.click();\n            } else if (evt.keyCode === this.Keycodes_.ESCAPE) {\n                evt.preventDefault();\n                this.hide();\n            }\n        }\n    }\n};\n/**\n   * Handles a click event on an item.\n   *\n   * @param {Event} evt The event that fired.\n   * @private\n   */\nMaterialMenu.prototype.handleItemClick_ = function (evt) {\n    if (evt.target.hasAttribute('disabled')) {\n        evt.stopPropagation();\n    } else {\n        // Wait some time before closing menu, so the user can see the ripple.\n        this.closing_ = true;\n        window.setTimeout(function (evt) {\n            this.hide();\n            this.closing_ = false;\n        }.bind(this), this.Constant_.CLOSE_TIMEOUT);\n    }\n};\n/**\n   * Calculates the initial clip (for opening the menu) or final clip (for closing\n   * it), and applies it. This allows us to animate from or to the correct point,\n   * that is, the point it's aligned to in the \"for\" element.\n   *\n   * @param {number} height Height of the clip rectangle\n   * @param {number} width Width of the clip rectangle\n   * @private\n   */\nMaterialMenu.prototype.applyClip_ = function (height, width) {\n    if (this.element_.classList.contains(this.CssClasses_.UNALIGNED)) {\n        // Do not clip.\n        this.element_.style.clip = '';\n    } else if (this.element_.classList.contains(this.CssClasses_.BOTTOM_RIGHT)) {\n        // Clip to the top right corner of the menu.\n        this.element_.style.clip = 'rect(0 ' + width + 'px ' + '0 ' + width + 'px)';\n    } else if (this.element_.classList.contains(this.CssClasses_.TOP_LEFT)) {\n        // Clip to the bottom left corner of the menu.\n        this.element_.style.clip = 'rect(' + height + 'px 0 ' + height + 'px 0)';\n    } else if (this.element_.classList.contains(this.CssClasses_.TOP_RIGHT)) {\n        // Clip to the bottom right corner of the menu.\n        this.element_.style.clip = 'rect(' + height + 'px ' + width + 'px ' + height + 'px ' + width + 'px)';\n    } else {\n        // Default: do not clip (same as clipping to the top left corner).\n        this.element_.style.clip = '';\n    }\n};\n/**\n   * Cleanup function to remove animation listeners.\n   *\n   * @param {Event} evt\n   * @private\n   */\nMaterialMenu.prototype.removeAnimationEndListener_ = function (evt) {\n    evt.target.classList.remove(MaterialMenu.prototype.CssClasses_.IS_ANIMATING);\n};\n/**\n   * Adds an event listener to clean up after the animation ends.\n   *\n   * @private\n   */\nMaterialMenu.prototype.addAnimationEndListener_ = function () {\n    this.element_.addEventListener('transitionend', this.removeAnimationEndListener_);\n    this.element_.addEventListener('webkitTransitionEnd', this.removeAnimationEndListener_);\n};\n/**\n   * Displays the menu.\n   *\n   * @public\n   */\nMaterialMenu.prototype.show = function (evt) {\n    if (this.element_ && this.container_ && this.outline_) {\n        // Measure the inner element.\n        var height = this.element_.getBoundingClientRect().height;\n        var width = this.element_.getBoundingClientRect().width;\n        // Apply the inner element's size to the container and outline.\n        this.container_.style.width = width + 'px';\n        this.container_.style.height = height + 'px';\n        this.outline_.style.width = width + 'px';\n        this.outline_.style.height = height + 'px';\n        var transitionDuration = this.Constant_.TRANSITION_DURATION_SECONDS * this.Constant_.TRANSITION_DURATION_FRACTION;\n        // Calculate transition delays for individual menu items, so that they fade\n        // in one at a time.\n        var items = this.element_.querySelectorAll('.' + this.CssClasses_.ITEM);\n        for (var i = 0; i < items.length; i++) {\n            var itemDelay = null;\n            if (this.element_.classList.contains(this.CssClasses_.TOP_LEFT) || this.element_.classList.contains(this.CssClasses_.TOP_RIGHT)) {\n                itemDelay = (height - items[i].offsetTop - items[i].offsetHeight) / height * transitionDuration + 's';\n            } else {\n                itemDelay = items[i].offsetTop / height * transitionDuration + 's';\n            }\n            items[i].style.transitionDelay = itemDelay;\n        }\n        // Apply the initial clip to the text before we start animating.\n        this.applyClip_(height, width);\n        // Wait for the next frame, turn on animation, and apply the final clip.\n        // Also make it visible. This triggers the transitions.\n        window.requestAnimationFrame(function () {\n            this.element_.classList.add(this.CssClasses_.IS_ANIMATING);\n            this.element_.style.clip = 'rect(0 ' + width + 'px ' + height + 'px 0)';\n            this.container_.classList.add(this.CssClasses_.IS_VISIBLE);\n        }.bind(this));\n        // Clean up after the animation is complete.\n        this.addAnimationEndListener_();\n        // Add a click listener to the document, to close the menu.\n        var callback = function (e) {\n            // Check to see if the document is processing the same event that\n            // displayed the menu in the first place. If so, do nothing.\n            // Also check to see if the menu is in the process of closing itself, and\n            // do nothing in that case.\n            // Also check if the clicked element is a menu item\n            // if so, do nothing.\n            if (e !== evt && !this.closing_ && e.target.parentNode !== this.element_) {\n                document.removeEventListener('click', callback);\n                this.hide();\n            }\n        }.bind(this);\n        document.addEventListener('click', callback);\n    }\n};\nMaterialMenu.prototype['show'] = MaterialMenu.prototype.show;\n/**\n   * Hides the menu.\n   *\n   * @public\n   */\nMaterialMenu.prototype.hide = function () {\n    if (this.element_ && this.container_ && this.outline_) {\n        var items = this.element_.querySelectorAll('.' + this.CssClasses_.ITEM);\n        // Remove all transition delays; menu items fade out concurrently.\n        for (var i = 0; i < items.length; i++) {\n            items[i].style.removeProperty('transition-delay');\n        }\n        // Measure the inner element.\n        var rect = this.element_.getBoundingClientRect();\n        var height = rect.height;\n        var width = rect.width;\n        // Turn on animation, and apply the final clip. Also make invisible.\n        // This triggers the transitions.\n        this.element_.classList.add(this.CssClasses_.IS_ANIMATING);\n        this.applyClip_(height, width);\n        this.container_.classList.remove(this.CssClasses_.IS_VISIBLE);\n        // Clean up after the animation is complete.\n        this.addAnimationEndListener_();\n    }\n};\nMaterialMenu.prototype['hide'] = MaterialMenu.prototype.hide;\n/**\n   * Displays or hides the menu, depending on current state.\n   *\n   * @public\n   */\nMaterialMenu.prototype.toggle = function (evt) {\n    if (this.container_.classList.contains(this.CssClasses_.IS_VISIBLE)) {\n        this.hide();\n    } else {\n        this.show(evt);\n    }\n};\nMaterialMenu.prototype['toggle'] = MaterialMenu.prototype.toggle;\n// The component registers itself. It can assume componentHandler is available\n// in the global scope.\ncomponentHandler.register({\n    constructor: MaterialMenu,\n    classAsString: 'MaterialMenu',\n    cssClass: 'mdl-js-menu',\n    widget: true\n});\n/**\n * @license\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n   * Class constructor for Progress MDL component.\n   * Implements MDL component design pattern defined at:\n   * https://github.com/jasonmayes/mdl-component-design-pattern\n   *\n   * @constructor\n   * @param {HTMLElement} element The element that will be upgraded.\n   */\nvar MaterialProgress = function MaterialProgress(element) {\n    this.element_ = element;\n    // Initialize instance.\n    this.init();\n};\nwindow['MaterialProgress'] = MaterialProgress;\n/**\n   * Store constants in one place so they can be updated easily.\n   *\n   * @enum {string | number}\n   * @private\n   */\nMaterialProgress.prototype.Constant_ = {};\n/**\n   * Store strings for class names defined by this component that are used in\n   * JavaScript. This allows us to simply change it in one place should we\n   * decide to modify at a later date.\n   *\n   * @enum {string}\n   * @private\n   */\nMaterialProgress.prototype.CssClasses_ = { INDETERMINATE_CLASS: 'mdl-progress__indeterminate' };\n/**\n   * Set the current progress of the progressbar.\n   *\n   * @param {number} p Percentage of the progress (0-100)\n   * @public\n   */\nMaterialProgress.prototype.setProgress = function (p) {\n    if (this.element_.classList.contains(this.CssClasses_.INDETERMINATE_CLASS)) {\n        return;\n    }\n    this.progressbar_.style.width = p + '%';\n};\nMaterialProgress.prototype['setProgress'] = MaterialProgress.prototype.setProgress;\n/**\n   * Set the current progress of the buffer.\n   *\n   * @param {number} p Percentage of the buffer (0-100)\n   * @public\n   */\nMaterialProgress.prototype.setBuffer = function (p) {\n    this.bufferbar_.style.width = p + '%';\n    this.auxbar_.style.width = 100 - p + '%';\n};\nMaterialProgress.prototype['setBuffer'] = MaterialProgress.prototype.setBuffer;\n/**\n   * Initialize element.\n   */\nMaterialProgress.prototype.init = function () {\n    if (this.element_) {\n        var el = document.createElement('div');\n        el.className = 'progressbar bar bar1';\n        this.element_.appendChild(el);\n        this.progressbar_ = el;\n        el = document.createElement('div');\n        el.className = 'bufferbar bar bar2';\n        this.element_.appendChild(el);\n        this.bufferbar_ = el;\n        el = document.createElement('div');\n        el.className = 'auxbar bar bar3';\n        this.element_.appendChild(el);\n        this.auxbar_ = el;\n        this.progressbar_.style.width = '0%';\n        this.bufferbar_.style.width = '100%';\n        this.auxbar_.style.width = '0%';\n        this.element_.classList.add('is-upgraded');\n    }\n};\n// The component registers itself. It can assume componentHandler is available\n// in the global scope.\ncomponentHandler.register({\n    constructor: MaterialProgress,\n    classAsString: 'MaterialProgress',\n    cssClass: 'mdl-js-progress',\n    widget: true\n});\n/**\n * @license\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n   * Class constructor for Radio MDL component.\n   * Implements MDL component design pattern defined at:\n   * https://github.com/jasonmayes/mdl-component-design-pattern\n   *\n   * @constructor\n   * @param {HTMLElement} element The element that will be upgraded.\n   */\nvar MaterialRadio = function MaterialRadio(element) {\n    this.element_ = element;\n    // Initialize instance.\n    this.init();\n};\nwindow['MaterialRadio'] = MaterialRadio;\n/**\n   * Store constants in one place so they can be updated easily.\n   *\n   * @enum {string | number}\n   * @private\n   */\nMaterialRadio.prototype.Constant_ = { TINY_TIMEOUT: 0.001 };\n/**\n   * Store strings for class names defined by this component that are used in\n   * JavaScript. This allows us to simply change it in one place should we\n   * decide to modify at a later date.\n   *\n   * @enum {string}\n   * @private\n   */\nMaterialRadio.prototype.CssClasses_ = {\n    IS_FOCUSED: 'is-focused',\n    IS_DISABLED: 'is-disabled',\n    IS_CHECKED: 'is-checked',\n    IS_UPGRADED: 'is-upgraded',\n    JS_RADIO: 'mdl-js-radio',\n    RADIO_BTN: 'mdl-radio__button',\n    RADIO_OUTER_CIRCLE: 'mdl-radio__outer-circle',\n    RADIO_INNER_CIRCLE: 'mdl-radio__inner-circle',\n    RIPPLE_EFFECT: 'mdl-js-ripple-effect',\n    RIPPLE_IGNORE_EVENTS: 'mdl-js-ripple-effect--ignore-events',\n    RIPPLE_CONTAINER: 'mdl-radio__ripple-container',\n    RIPPLE_CENTER: 'mdl-ripple--center',\n    RIPPLE: 'mdl-ripple'\n};\n/**\n   * Handle change of state.\n   *\n   * @param {Event} event The event that fired.\n   * @private\n   */\nMaterialRadio.prototype.onChange_ = function (event) {\n    // Since other radio buttons don't get change events, we need to look for\n    // them to update their classes.\n    var radios = document.getElementsByClassName(this.CssClasses_.JS_RADIO);\n    for (var i = 0; i < radios.length; i++) {\n        var button = radios[i].querySelector('.' + this.CssClasses_.RADIO_BTN);\n        // Different name == different group, so no point updating those.\n        if (button.getAttribute('name') === this.btnElement_.getAttribute('name')) {\n            if (typeof radios[i]['MaterialRadio'] !== 'undefined') {\n                radios[i]['MaterialRadio'].updateClasses_();\n            }\n        }\n    }\n};\n/**\n   * Handle focus.\n   *\n   * @param {Event} event The event that fired.\n   * @private\n   */\nMaterialRadio.prototype.onFocus_ = function (event) {\n    this.element_.classList.add(this.CssClasses_.IS_FOCUSED);\n};\n/**\n   * Handle lost focus.\n   *\n   * @param {Event} event The event that fired.\n   * @private\n   */\nMaterialRadio.prototype.onBlur_ = function (event) {\n    this.element_.classList.remove(this.CssClasses_.IS_FOCUSED);\n};\n/**\n   * Handle mouseup.\n   *\n   * @param {Event} event The event that fired.\n   * @private\n   */\nMaterialRadio.prototype.onMouseup_ = function (event) {\n    this.blur_();\n};\n/**\n   * Update classes.\n   *\n   * @private\n   */\nMaterialRadio.prototype.updateClasses_ = function () {\n    this.checkDisabled();\n    this.checkToggleState();\n};\n/**\n   * Add blur.\n   *\n   * @private\n   */\nMaterialRadio.prototype.blur_ = function () {\n    // TODO: figure out why there's a focus event being fired after our blur,\n    // so that we can avoid this hack.\n    window.setTimeout(function () {\n        this.btnElement_.blur();\n    }.bind(this), this.Constant_.TINY_TIMEOUT);\n};\n// Public methods.\n/**\n   * Check the components disabled state.\n   *\n   * @public\n   */\nMaterialRadio.prototype.checkDisabled = function () {\n    if (this.btnElement_.disabled) {\n        this.element_.classList.add(this.CssClasses_.IS_DISABLED);\n    } else {\n        this.element_.classList.remove(this.CssClasses_.IS_DISABLED);\n    }\n};\nMaterialRadio.prototype['checkDisabled'] = MaterialRadio.prototype.checkDisabled;\n/**\n   * Check the components toggled state.\n   *\n   * @public\n   */\nMaterialRadio.prototype.checkToggleState = function () {\n    if (this.btnElement_.checked) {\n        this.element_.classList.add(this.CssClasses_.IS_CHECKED);\n    } else {\n        this.element_.classList.remove(this.CssClasses_.IS_CHECKED);\n    }\n};\nMaterialRadio.prototype['checkToggleState'] = MaterialRadio.prototype.checkToggleState;\n/**\n   * Disable radio.\n   *\n   * @public\n   */\nMaterialRadio.prototype.disable = function () {\n    this.btnElement_.disabled = true;\n    this.updateClasses_();\n};\nMaterialRadio.prototype['disable'] = MaterialRadio.prototype.disable;\n/**\n   * Enable radio.\n   *\n   * @public\n   */\nMaterialRadio.prototype.enable = function () {\n    this.btnElement_.disabled = false;\n    this.updateClasses_();\n};\nMaterialRadio.prototype['enable'] = MaterialRadio.prototype.enable;\n/**\n   * Check radio.\n   *\n   * @public\n   */\nMaterialRadio.prototype.check = function () {\n    this.btnElement_.checked = true;\n    this.onChange_(null);\n};\nMaterialRadio.prototype['check'] = MaterialRadio.prototype.check;\n/**\n   * Uncheck radio.\n   *\n   * @public\n   */\nMaterialRadio.prototype.uncheck = function () {\n    this.btnElement_.checked = false;\n    this.onChange_(null);\n};\nMaterialRadio.prototype['uncheck'] = MaterialRadio.prototype.uncheck;\n/**\n   * Initialize element.\n   */\nMaterialRadio.prototype.init = function () {\n    if (this.element_) {\n        this.btnElement_ = this.element_.querySelector('.' + this.CssClasses_.RADIO_BTN);\n        this.boundChangeHandler_ = this.onChange_.bind(this);\n        this.boundFocusHandler_ = this.onChange_.bind(this);\n        this.boundBlurHandler_ = this.onBlur_.bind(this);\n        this.boundMouseUpHandler_ = this.onMouseup_.bind(this);\n        var outerCircle = document.createElement('span');\n        outerCircle.classList.add(this.CssClasses_.RADIO_OUTER_CIRCLE);\n        var innerCircle = document.createElement('span');\n        innerCircle.classList.add(this.CssClasses_.RADIO_INNER_CIRCLE);\n        this.element_.appendChild(outerCircle);\n        this.element_.appendChild(innerCircle);\n        var rippleContainer;\n        if (this.element_.classList.contains(this.CssClasses_.RIPPLE_EFFECT)) {\n            this.element_.classList.add(this.CssClasses_.RIPPLE_IGNORE_EVENTS);\n            rippleContainer = document.createElement('span');\n            rippleContainer.classList.add(this.CssClasses_.RIPPLE_CONTAINER);\n            rippleContainer.classList.add(this.CssClasses_.RIPPLE_EFFECT);\n            rippleContainer.classList.add(this.CssClasses_.RIPPLE_CENTER);\n            rippleContainer.addEventListener('mouseup', this.boundMouseUpHandler_);\n            var ripple = document.createElement('span');\n            ripple.classList.add(this.CssClasses_.RIPPLE);\n            rippleContainer.appendChild(ripple);\n            this.element_.appendChild(rippleContainer);\n        }\n        this.btnElement_.addEventListener('change', this.boundChangeHandler_);\n        this.btnElement_.addEventListener('focus', this.boundFocusHandler_);\n        this.btnElement_.addEventListener('blur', this.boundBlurHandler_);\n        this.element_.addEventListener('mouseup', this.boundMouseUpHandler_);\n        this.updateClasses_();\n        this.element_.classList.add(this.CssClasses_.IS_UPGRADED);\n    }\n};\n// The component registers itself. It can assume componentHandler is available\n// in the global scope.\ncomponentHandler.register({\n    constructor: MaterialRadio,\n    classAsString: 'MaterialRadio',\n    cssClass: 'mdl-js-radio',\n    widget: true\n});\n/**\n * @license\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n   * Class constructor for Slider MDL component.\n   * Implements MDL component design pattern defined at:\n   * https://github.com/jasonmayes/mdl-component-design-pattern\n   *\n   * @constructor\n   * @param {HTMLElement} element The element that will be upgraded.\n   */\nvar MaterialSlider = function MaterialSlider(element) {\n    this.element_ = element;\n    // Browser feature detection.\n    this.isIE_ = window.navigator.msPointerEnabled;\n    // Initialize instance.\n    this.init();\n};\nwindow['MaterialSlider'] = MaterialSlider;\n/**\n   * Store constants in one place so they can be updated easily.\n   *\n   * @enum {string | number}\n   * @private\n   */\nMaterialSlider.prototype.Constant_ = {};\n/**\n   * Store strings for class names defined by this component that are used in\n   * JavaScript. This allows us to simply change it in one place should we\n   * decide to modify at a later date.\n   *\n   * @enum {string}\n   * @private\n   */\nMaterialSlider.prototype.CssClasses_ = {\n    IE_CONTAINER: 'mdl-slider__ie-container',\n    SLIDER_CONTAINER: 'mdl-slider__container',\n    BACKGROUND_FLEX: 'mdl-slider__background-flex',\n    BACKGROUND_LOWER: 'mdl-slider__background-lower',\n    BACKGROUND_UPPER: 'mdl-slider__background-upper',\n    IS_LOWEST_VALUE: 'is-lowest-value',\n    IS_UPGRADED: 'is-upgraded'\n};\n/**\n   * Handle input on element.\n   *\n   * @param {Event} event The event that fired.\n   * @private\n   */\nMaterialSlider.prototype.onInput_ = function (event) {\n    this.updateValueStyles_();\n};\n/**\n   * Handle change on element.\n   *\n   * @param {Event} event The event that fired.\n   * @private\n   */\nMaterialSlider.prototype.onChange_ = function (event) {\n    this.updateValueStyles_();\n};\n/**\n   * Handle mouseup on element.\n   *\n   * @param {Event} event The event that fired.\n   * @private\n   */\nMaterialSlider.prototype.onMouseUp_ = function (event) {\n    event.target.blur();\n};\n/**\n   * Handle mousedown on container element.\n   * This handler is purpose is to not require the use to click\n   * exactly on the 2px slider element, as FireFox seems to be very\n   * strict about this.\n   *\n   * @param {Event} event The event that fired.\n   * @private\n   * @suppress {missingProperties}\n   */\nMaterialSlider.prototype.onContainerMouseDown_ = function (event) {\n    // If this click is not on the parent element (but rather some child)\n    // ignore. It may still bubble up.\n    if (event.target !== this.element_.parentElement) {\n        return;\n    }\n    // Discard the original event and create a new event that\n    // is on the slider element.\n    event.preventDefault();\n    var newEvent = new MouseEvent('mousedown', {\n        target: event.target,\n        buttons: event.buttons,\n        clientX: event.clientX,\n        clientY: this.element_.getBoundingClientRect().y\n    });\n    this.element_.dispatchEvent(newEvent);\n};\n/**\n   * Handle updating of values.\n   *\n   * @private\n   */\nMaterialSlider.prototype.updateValueStyles_ = function () {\n    // Calculate and apply percentages to div structure behind slider.\n    var fraction = (this.element_.value - this.element_.min) / (this.element_.max - this.element_.min);\n    if (fraction === 0) {\n        this.element_.classList.add(this.CssClasses_.IS_LOWEST_VALUE);\n    } else {\n        this.element_.classList.remove(this.CssClasses_.IS_LOWEST_VALUE);\n    }\n    if (!this.isIE_) {\n        this.backgroundLower_.style.flex = fraction;\n        this.backgroundLower_.style.webkitFlex = fraction;\n        this.backgroundUpper_.style.flex = 1 - fraction;\n        this.backgroundUpper_.style.webkitFlex = 1 - fraction;\n    }\n};\n// Public methods.\n/**\n   * Disable slider.\n   *\n   * @public\n   */\nMaterialSlider.prototype.disable = function () {\n    this.element_.disabled = true;\n};\nMaterialSlider.prototype['disable'] = MaterialSlider.prototype.disable;\n/**\n   * Enable slider.\n   *\n   * @public\n   */\nMaterialSlider.prototype.enable = function () {\n    this.element_.disabled = false;\n};\nMaterialSlider.prototype['enable'] = MaterialSlider.prototype.enable;\n/**\n   * Update slider value.\n   *\n   * @param {number} value The value to which to set the control (optional).\n   * @public\n   */\nMaterialSlider.prototype.change = function (value) {\n    if (typeof value !== 'undefined') {\n        this.element_.value = value;\n    }\n    this.updateValueStyles_();\n};\nMaterialSlider.prototype['change'] = MaterialSlider.prototype.change;\n/**\n   * Initialize element.\n   */\nMaterialSlider.prototype.init = function () {\n    if (this.element_) {\n        if (this.isIE_) {\n            // Since we need to specify a very large height in IE due to\n            // implementation limitations, we add a parent here that trims it down to\n            // a reasonable size.\n            var containerIE = document.createElement('div');\n            containerIE.classList.add(this.CssClasses_.IE_CONTAINER);\n            this.element_.parentElement.insertBefore(containerIE, this.element_);\n            this.element_.parentElement.removeChild(this.element_);\n            containerIE.appendChild(this.element_);\n        } else {\n            // For non-IE browsers, we need a div structure that sits behind the\n            // slider and allows us to style the left and right sides of it with\n            // different colors.\n            var container = document.createElement('div');\n            container.classList.add(this.CssClasses_.SLIDER_CONTAINER);\n            this.element_.parentElement.insertBefore(container, this.element_);\n            this.element_.parentElement.removeChild(this.element_);\n            container.appendChild(this.element_);\n            var backgroundFlex = document.createElement('div');\n            backgroundFlex.classList.add(this.CssClasses_.BACKGROUND_FLEX);\n            container.appendChild(backgroundFlex);\n            this.backgroundLower_ = document.createElement('div');\n            this.backgroundLower_.classList.add(this.CssClasses_.BACKGROUND_LOWER);\n            backgroundFlex.appendChild(this.backgroundLower_);\n            this.backgroundUpper_ = document.createElement('div');\n            this.backgroundUpper_.classList.add(this.CssClasses_.BACKGROUND_UPPER);\n            backgroundFlex.appendChild(this.backgroundUpper_);\n        }\n        this.boundInputHandler = this.onInput_.bind(this);\n        this.boundChangeHandler = this.onChange_.bind(this);\n        this.boundMouseUpHandler = this.onMouseUp_.bind(this);\n        this.boundContainerMouseDownHandler = this.onContainerMouseDown_.bind(this);\n        this.element_.addEventListener('input', this.boundInputHandler);\n        this.element_.addEventListener('change', this.boundChangeHandler);\n        this.element_.addEventListener('mouseup', this.boundMouseUpHandler);\n        this.element_.parentElement.addEventListener('mousedown', this.boundContainerMouseDownHandler);\n        this.updateValueStyles_();\n        this.element_.classList.add(this.CssClasses_.IS_UPGRADED);\n    }\n};\n// The component registers itself. It can assume componentHandler is available\n// in the global scope.\ncomponentHandler.register({\n    constructor: MaterialSlider,\n    classAsString: 'MaterialSlider',\n    cssClass: 'mdl-js-slider',\n    widget: true\n});\n/**\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n   * Class constructor for Snackbar MDL component.\n   * Implements MDL component design pattern defined at:\n   * https://github.com/jasonmayes/mdl-component-design-pattern\n   *\n   * @constructor\n   * @param {HTMLElement} element The element that will be upgraded.\n   */\nvar MaterialSnackbar = function MaterialSnackbar(element) {\n    this.element_ = element;\n    this.textElement_ = this.element_.querySelector('.' + this.cssClasses_.MESSAGE);\n    this.actionElement_ = this.element_.querySelector('.' + this.cssClasses_.ACTION);\n    if (!this.textElement_) {\n        throw new Error('There must be a message element for a snackbar.');\n    }\n    if (!this.actionElement_) {\n        throw new Error('There must be an action element for a snackbar.');\n    }\n    this.active = false;\n    this.actionHandler_ = undefined;\n    this.message_ = undefined;\n    this.actionText_ = undefined;\n    this.queuedNotifications_ = [];\n    this.setActionHidden_(true);\n};\nwindow['MaterialSnackbar'] = MaterialSnackbar;\n/**\n   * Store constants in one place so they can be updated easily.\n   *\n   * @enum {string | number}\n   * @private\n   */\nMaterialSnackbar.prototype.Constant_ = {\n    // The duration of the snackbar show/hide animation, in ms.\n    ANIMATION_LENGTH: 250\n};\n/**\n   * Store strings for class names defined by this component that are used in\n   * JavaScript. This allows us to simply change it in one place should we\n   * decide to modify at a later date.\n   *\n   * @enum {string}\n   * @private\n   */\nMaterialSnackbar.prototype.cssClasses_ = {\n    SNACKBAR: 'mdl-snackbar',\n    MESSAGE: 'mdl-snackbar__text',\n    ACTION: 'mdl-snackbar__action',\n    ACTIVE: 'mdl-snackbar--active'\n};\n/**\n   * Display the snackbar.\n   *\n   * @private\n   */\nMaterialSnackbar.prototype.displaySnackbar_ = function () {\n    this.element_.setAttribute('aria-hidden', 'true');\n    if (this.actionHandler_) {\n        this.actionElement_.textContent = this.actionText_;\n        this.actionElement_.addEventListener('click', this.actionHandler_);\n        this.setActionHidden_(false);\n    }\n    this.textElement_.textContent = this.message_;\n    this.element_.classList.add(this.cssClasses_.ACTIVE);\n    this.element_.setAttribute('aria-hidden', 'false');\n    setTimeout(this.cleanup_.bind(this), this.timeout_);\n};\n/**\n   * Show the snackbar.\n   *\n   * @param {Object} data The data for the notification.\n   * @public\n   */\nMaterialSnackbar.prototype.showSnackbar = function (data) {\n    if (data === undefined) {\n        throw new Error('Please provide a data object with at least a message to display.');\n    }\n    if (data['message'] === undefined) {\n        throw new Error('Please provide a message to be displayed.');\n    }\n    if (data['actionHandler'] && !data['actionText']) {\n        throw new Error('Please provide action text with the handler.');\n    }\n    if (this.active) {\n        this.queuedNotifications_.push(data);\n    } else {\n        this.active = true;\n        this.message_ = data['message'];\n        if (data['timeout']) {\n            this.timeout_ = data['timeout'];\n        } else {\n            this.timeout_ = 2750;\n        }\n        if (data['actionHandler']) {\n            this.actionHandler_ = data['actionHandler'];\n        }\n        if (data['actionText']) {\n            this.actionText_ = data['actionText'];\n        }\n        this.displaySnackbar_();\n    }\n};\nMaterialSnackbar.prototype['showSnackbar'] = MaterialSnackbar.prototype.showSnackbar;\n/**\n   * Check if the queue has items within it.\n   * If it does, display the next entry.\n   *\n   * @private\n   */\nMaterialSnackbar.prototype.checkQueue_ = function () {\n    if (this.queuedNotifications_.length > 0) {\n        this.showSnackbar(this.queuedNotifications_.shift());\n    }\n};\n/**\n   * Cleanup the snackbar event listeners and accessiblity attributes.\n   *\n   * @private\n   */\nMaterialSnackbar.prototype.cleanup_ = function () {\n    this.element_.classList.remove(this.cssClasses_.ACTIVE);\n    setTimeout(function () {\n        this.element_.setAttribute('aria-hidden', 'true');\n        this.textElement_.textContent = '';\n        if (!Boolean(this.actionElement_.getAttribute('aria-hidden'))) {\n            this.setActionHidden_(true);\n            this.actionElement_.textContent = '';\n            this.actionElement_.removeEventListener('click', this.actionHandler_);\n        }\n        this.actionHandler_ = undefined;\n        this.message_ = undefined;\n        this.actionText_ = undefined;\n        this.active = false;\n        this.checkQueue_();\n    }.bind(this), this.Constant_.ANIMATION_LENGTH);\n};\n/**\n   * Set the action handler hidden state.\n   *\n   * @param {boolean} value\n   * @private\n   */\nMaterialSnackbar.prototype.setActionHidden_ = function (value) {\n    if (value) {\n        this.actionElement_.setAttribute('aria-hidden', 'true');\n    } else {\n        this.actionElement_.removeAttribute('aria-hidden');\n    }\n};\n// The component registers itself. It can assume componentHandler is available\n// in the global scope.\ncomponentHandler.register({\n    constructor: MaterialSnackbar,\n    classAsString: 'MaterialSnackbar',\n    cssClass: 'mdl-js-snackbar',\n    widget: true\n});\n/**\n * @license\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n   * Class constructor for Spinner MDL component.\n   * Implements MDL component design pattern defined at:\n   * https://github.com/jasonmayes/mdl-component-design-pattern\n   *\n   * @param {HTMLElement} element The element that will be upgraded.\n   * @constructor\n   */\nvar MaterialSpinner = function MaterialSpinner(element) {\n    this.element_ = element;\n    // Initialize instance.\n    this.init();\n};\nwindow['MaterialSpinner'] = MaterialSpinner;\n/**\n   * Store constants in one place so they can be updated easily.\n   *\n   * @enum {string | number}\n   * @private\n   */\nMaterialSpinner.prototype.Constant_ = { MDL_SPINNER_LAYER_COUNT: 4 };\n/**\n   * Store strings for class names defined by this component that are used in\n   * JavaScript. This allows us to simply change it in one place should we\n   * decide to modify at a later date.\n   *\n   * @enum {string}\n   * @private\n   */\nMaterialSpinner.prototype.CssClasses_ = {\n    MDL_SPINNER_LAYER: 'mdl-spinner__layer',\n    MDL_SPINNER_CIRCLE_CLIPPER: 'mdl-spinner__circle-clipper',\n    MDL_SPINNER_CIRCLE: 'mdl-spinner__circle',\n    MDL_SPINNER_GAP_PATCH: 'mdl-spinner__gap-patch',\n    MDL_SPINNER_LEFT: 'mdl-spinner__left',\n    MDL_SPINNER_RIGHT: 'mdl-spinner__right'\n};\n/**\n   * Auxiliary method to create a spinner layer.\n   *\n   * @param {number} index Index of the layer to be created.\n   * @public\n   */\nMaterialSpinner.prototype.createLayer = function (index) {\n    var layer = document.createElement('div');\n    layer.classList.add(this.CssClasses_.MDL_SPINNER_LAYER);\n    layer.classList.add(this.CssClasses_.MDL_SPINNER_LAYER + '-' + index);\n    var leftClipper = document.createElement('div');\n    leftClipper.classList.add(this.CssClasses_.MDL_SPINNER_CIRCLE_CLIPPER);\n    leftClipper.classList.add(this.CssClasses_.MDL_SPINNER_LEFT);\n    var gapPatch = document.createElement('div');\n    gapPatch.classList.add(this.CssClasses_.MDL_SPINNER_GAP_PATCH);\n    var rightClipper = document.createElement('div');\n    rightClipper.classList.add(this.CssClasses_.MDL_SPINNER_CIRCLE_CLIPPER);\n    rightClipper.classList.add(this.CssClasses_.MDL_SPINNER_RIGHT);\n    var circleOwners = [\n        leftClipper,\n        gapPatch,\n        rightClipper\n    ];\n    for (var i = 0; i < circleOwners.length; i++) {\n        var circle = document.createElement('div');\n        circle.classList.add(this.CssClasses_.MDL_SPINNER_CIRCLE);\n        circleOwners[i].appendChild(circle);\n    }\n    layer.appendChild(leftClipper);\n    layer.appendChild(gapPatch);\n    layer.appendChild(rightClipper);\n    this.element_.appendChild(layer);\n};\nMaterialSpinner.prototype['createLayer'] = MaterialSpinner.prototype.createLayer;\n/**\n   * Stops the spinner animation.\n   * Public method for users who need to stop the spinner for any reason.\n   *\n   * @public\n   */\nMaterialSpinner.prototype.stop = function () {\n    this.element_.classList.remove('is-active');\n};\nMaterialSpinner.prototype['stop'] = MaterialSpinner.prototype.stop;\n/**\n   * Starts the spinner animation.\n   * Public method for users who need to manually start the spinner for any reason\n   * (instead of just adding the 'is-active' class to their markup).\n   *\n   * @public\n   */\nMaterialSpinner.prototype.start = function () {\n    this.element_.classList.add('is-active');\n};\nMaterialSpinner.prototype['start'] = MaterialSpinner.prototype.start;\n/**\n   * Initialize element.\n   */\nMaterialSpinner.prototype.init = function () {\n    if (this.element_) {\n        for (var i = 1; i <= this.Constant_.MDL_SPINNER_LAYER_COUNT; i++) {\n            this.createLayer(i);\n        }\n        this.element_.classList.add('is-upgraded');\n    }\n};\n// The component registers itself. It can assume componentHandler is available\n// in the global scope.\ncomponentHandler.register({\n    constructor: MaterialSpinner,\n    classAsString: 'MaterialSpinner',\n    cssClass: 'mdl-js-spinner',\n    widget: true\n});\n/**\n * @license\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n   * Class constructor for Checkbox MDL component.\n   * Implements MDL component design pattern defined at:\n   * https://github.com/jasonmayes/mdl-component-design-pattern\n   *\n   * @constructor\n   * @param {HTMLElement} element The element that will be upgraded.\n   */\nvar MaterialSwitch = function MaterialSwitch(element) {\n    this.element_ = element;\n    // Initialize instance.\n    this.init();\n};\nwindow['MaterialSwitch'] = MaterialSwitch;\n/**\n   * Store constants in one place so they can be updated easily.\n   *\n   * @enum {string | number}\n   * @private\n   */\nMaterialSwitch.prototype.Constant_ = { TINY_TIMEOUT: 0.001 };\n/**\n   * Store strings for class names defined by this component that are used in\n   * JavaScript. This allows us to simply change it in one place should we\n   * decide to modify at a later date.\n   *\n   * @enum {string}\n   * @private\n   */\nMaterialSwitch.prototype.CssClasses_ = {\n    INPUT: 'mdl-switch__input',\n    TRACK: 'mdl-switch__track',\n    THUMB: 'mdl-switch__thumb',\n    FOCUS_HELPER: 'mdl-switch__focus-helper',\n    RIPPLE_EFFECT: 'mdl-js-ripple-effect',\n    RIPPLE_IGNORE_EVENTS: 'mdl-js-ripple-effect--ignore-events',\n    RIPPLE_CONTAINER: 'mdl-switch__ripple-container',\n    RIPPLE_CENTER: 'mdl-ripple--center',\n    RIPPLE: 'mdl-ripple',\n    IS_FOCUSED: 'is-focused',\n    IS_DISABLED: 'is-disabled',\n    IS_CHECKED: 'is-checked'\n};\n/**\n   * Handle change of state.\n   *\n   * @param {Event} event The event that fired.\n   * @private\n   */\nMaterialSwitch.prototype.onChange_ = function (event) {\n    this.updateClasses_();\n};\n/**\n   * Handle focus of element.\n   *\n   * @param {Event} event The event that fired.\n   * @private\n   */\nMaterialSwitch.prototype.onFocus_ = function (event) {\n    this.element_.classList.add(this.CssClasses_.IS_FOCUSED);\n};\n/**\n   * Handle lost focus of element.\n   *\n   * @param {Event} event The event that fired.\n   * @private\n   */\nMaterialSwitch.prototype.onBlur_ = function (event) {\n    this.element_.classList.remove(this.CssClasses_.IS_FOCUSED);\n};\n/**\n   * Handle mouseup.\n   *\n   * @param {Event} event The event that fired.\n   * @private\n   */\nMaterialSwitch.prototype.onMouseUp_ = function (event) {\n    this.blur_();\n};\n/**\n   * Handle class updates.\n   *\n   * @private\n   */\nMaterialSwitch.prototype.updateClasses_ = function () {\n    this.checkDisabled();\n    this.checkToggleState();\n};\n/**\n   * Add blur.\n   *\n   * @private\n   */\nMaterialSwitch.prototype.blur_ = function () {\n    // TODO: figure out why there's a focus event being fired after our blur,\n    // so that we can avoid this hack.\n    window.setTimeout(function () {\n        this.inputElement_.blur();\n    }.bind(this), this.Constant_.TINY_TIMEOUT);\n};\n// Public methods.\n/**\n   * Check the components disabled state.\n   *\n   * @public\n   */\nMaterialSwitch.prototype.checkDisabled = function () {\n    if (this.inputElement_.disabled) {\n        this.element_.classList.add(this.CssClasses_.IS_DISABLED);\n    } else {\n        this.element_.classList.remove(this.CssClasses_.IS_DISABLED);\n    }\n};\nMaterialSwitch.prototype['checkDisabled'] = MaterialSwitch.prototype.checkDisabled;\n/**\n   * Check the components toggled state.\n   *\n   * @public\n   */\nMaterialSwitch.prototype.checkToggleState = function () {\n    if (this.inputElement_.checked) {\n        this.element_.classList.add(this.CssClasses_.IS_CHECKED);\n    } else {\n        this.element_.classList.remove(this.CssClasses_.IS_CHECKED);\n    }\n};\nMaterialSwitch.prototype['checkToggleState'] = MaterialSwitch.prototype.checkToggleState;\n/**\n   * Disable switch.\n   *\n   * @public\n   */\nMaterialSwitch.prototype.disable = function () {\n    this.inputElement_.disabled = true;\n    this.updateClasses_();\n};\nMaterialSwitch.prototype['disable'] = MaterialSwitch.prototype.disable;\n/**\n   * Enable switch.\n   *\n   * @public\n   */\nMaterialSwitch.prototype.enable = function () {\n    this.inputElement_.disabled = false;\n    this.updateClasses_();\n};\nMaterialSwitch.prototype['enable'] = MaterialSwitch.prototype.enable;\n/**\n   * Activate switch.\n   *\n   * @public\n   */\nMaterialSwitch.prototype.on = function () {\n    this.inputElement_.checked = true;\n    this.updateClasses_();\n};\nMaterialSwitch.prototype['on'] = MaterialSwitch.prototype.on;\n/**\n   * Deactivate switch.\n   *\n   * @public\n   */\nMaterialSwitch.prototype.off = function () {\n    this.inputElement_.checked = false;\n    this.updateClasses_();\n};\nMaterialSwitch.prototype['off'] = MaterialSwitch.prototype.off;\n/**\n   * Initialize element.\n   */\nMaterialSwitch.prototype.init = function () {\n    if (this.element_) {\n        this.inputElement_ = this.element_.querySelector('.' + this.CssClasses_.INPUT);\n        var track = document.createElement('div');\n        track.classList.add(this.CssClasses_.TRACK);\n        var thumb = document.createElement('div');\n        thumb.classList.add(this.CssClasses_.THUMB);\n        var focusHelper = document.createElement('span');\n        focusHelper.classList.add(this.CssClasses_.FOCUS_HELPER);\n        thumb.appendChild(focusHelper);\n        this.element_.appendChild(track);\n        this.element_.appendChild(thumb);\n        this.boundMouseUpHandler = this.onMouseUp_.bind(this);\n        if (this.element_.classList.contains(this.CssClasses_.RIPPLE_EFFECT)) {\n            this.element_.classList.add(this.CssClasses_.RIPPLE_IGNORE_EVENTS);\n            this.rippleContainerElement_ = document.createElement('span');\n            this.rippleContainerElement_.classList.add(this.CssClasses_.RIPPLE_CONTAINER);\n            this.rippleContainerElement_.classList.add(this.CssClasses_.RIPPLE_EFFECT);\n            this.rippleContainerElement_.classList.add(this.CssClasses_.RIPPLE_CENTER);\n            this.rippleContainerElement_.addEventListener('mouseup', this.boundMouseUpHandler);\n            var ripple = document.createElement('span');\n            ripple.classList.add(this.CssClasses_.RIPPLE);\n            this.rippleContainerElement_.appendChild(ripple);\n            this.element_.appendChild(this.rippleContainerElement_);\n        }\n        this.boundChangeHandler = this.onChange_.bind(this);\n        this.boundFocusHandler = this.onFocus_.bind(this);\n        this.boundBlurHandler = this.onBlur_.bind(this);\n        this.inputElement_.addEventListener('change', this.boundChangeHandler);\n        this.inputElement_.addEventListener('focus', this.boundFocusHandler);\n        this.inputElement_.addEventListener('blur', this.boundBlurHandler);\n        this.element_.addEventListener('mouseup', this.boundMouseUpHandler);\n        this.updateClasses_();\n        this.element_.classList.add('is-upgraded');\n    }\n};\n// The component registers itself. It can assume componentHandler is available\n// in the global scope.\ncomponentHandler.register({\n    constructor: MaterialSwitch,\n    classAsString: 'MaterialSwitch',\n    cssClass: 'mdl-js-switch',\n    widget: true\n});\n/**\n * @license\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n   * Class constructor for Tabs MDL component.\n   * Implements MDL component design pattern defined at:\n   * https://github.com/jasonmayes/mdl-component-design-pattern\n   *\n   * @constructor\n   * @param {Element} element The element that will be upgraded.\n   */\nvar MaterialTabs = function MaterialTabs(element) {\n    // Stores the HTML element.\n    this.element_ = element;\n    // Initialize instance.\n    this.init();\n};\nwindow['MaterialTabs'] = MaterialTabs;\n/**\n   * Store constants in one place so they can be updated easily.\n   *\n   * @enum {string}\n   * @private\n   */\nMaterialTabs.prototype.Constant_ = {};\n/**\n   * Store strings for class names defined by this component that are used in\n   * JavaScript. This allows us to simply change it in one place should we\n   * decide to modify at a later date.\n   *\n   * @enum {string}\n   * @private\n   */\nMaterialTabs.prototype.CssClasses_ = {\n    TAB_CLASS: 'mdl-tabs__tab',\n    PANEL_CLASS: 'mdl-tabs__panel',\n    ACTIVE_CLASS: 'is-active',\n    UPGRADED_CLASS: 'is-upgraded',\n    MDL_JS_RIPPLE_EFFECT: 'mdl-js-ripple-effect',\n    MDL_RIPPLE_CONTAINER: 'mdl-tabs__ripple-container',\n    MDL_RIPPLE: 'mdl-ripple',\n    MDL_JS_RIPPLE_EFFECT_IGNORE_EVENTS: 'mdl-js-ripple-effect--ignore-events'\n};\n/**\n   * Handle clicks to a tabs component\n   *\n   * @private\n   */\nMaterialTabs.prototype.initTabs_ = function () {\n    if (this.element_.classList.contains(this.CssClasses_.MDL_JS_RIPPLE_EFFECT)) {\n        this.element_.classList.add(this.CssClasses_.MDL_JS_RIPPLE_EFFECT_IGNORE_EVENTS);\n    }\n    // Select element tabs, document panels\n    this.tabs_ = this.element_.querySelectorAll('.' + this.CssClasses_.TAB_CLASS);\n    this.panels_ = this.element_.querySelectorAll('.' + this.CssClasses_.PANEL_CLASS);\n    // Create new tabs for each tab element\n    for (var i = 0; i < this.tabs_.length; i++) {\n        new MaterialTab(this.tabs_[i], this);\n    }\n    this.element_.classList.add(this.CssClasses_.UPGRADED_CLASS);\n};\n/**\n   * Reset tab state, dropping active classes\n   *\n   * @private\n   */\nMaterialTabs.prototype.resetTabState_ = function () {\n    for (var k = 0; k < this.tabs_.length; k++) {\n        this.tabs_[k].classList.remove(this.CssClasses_.ACTIVE_CLASS);\n    }\n};\n/**\n   * Reset panel state, droping active classes\n   *\n   * @private\n   */\nMaterialTabs.prototype.resetPanelState_ = function () {\n    for (var j = 0; j < this.panels_.length; j++) {\n        this.panels_[j].classList.remove(this.CssClasses_.ACTIVE_CLASS);\n    }\n};\n/**\n   * Initialize element.\n   */\nMaterialTabs.prototype.init = function () {\n    if (this.element_) {\n        this.initTabs_();\n    }\n};\n/**\n   * Constructor for an individual tab.\n   *\n   * @constructor\n   * @param {Element} tab The HTML element for the tab.\n   * @param {MaterialTabs} ctx The MaterialTabs object that owns the tab.\n   */\nfunction MaterialTab(tab, ctx) {\n    if (tab) {\n        if (ctx.element_.classList.contains(ctx.CssClasses_.MDL_JS_RIPPLE_EFFECT)) {\n            var rippleContainer = document.createElement('span');\n            rippleContainer.classList.add(ctx.CssClasses_.MDL_RIPPLE_CONTAINER);\n            rippleContainer.classList.add(ctx.CssClasses_.MDL_JS_RIPPLE_EFFECT);\n            var ripple = document.createElement('span');\n            ripple.classList.add(ctx.CssClasses_.MDL_RIPPLE);\n            rippleContainer.appendChild(ripple);\n            tab.appendChild(rippleContainer);\n        }\n        tab.addEventListener('click', function (e) {\n            if (tab.getAttribute('href').charAt(0) === '#') {\n                e.preventDefault();\n                var href = tab.href.split('#')[1];\n                var panel = ctx.element_.querySelector('#' + href);\n                ctx.resetTabState_();\n                ctx.resetPanelState_();\n                tab.classList.add(ctx.CssClasses_.ACTIVE_CLASS);\n                panel.classList.add(ctx.CssClasses_.ACTIVE_CLASS);\n            }\n        });\n    }\n}\n// The component registers itself. It can assume componentHandler is available\n// in the global scope.\ncomponentHandler.register({\n    constructor: MaterialTabs,\n    classAsString: 'MaterialTabs',\n    cssClass: 'mdl-js-tabs'\n});\n/**\n * @license\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n   * Class constructor for Textfield MDL component.\n   * Implements MDL component design pattern defined at:\n   * https://github.com/jasonmayes/mdl-component-design-pattern\n   *\n   * @constructor\n   * @param {HTMLElement} element The element that will be upgraded.\n   */\nvar MaterialTextfield = function MaterialTextfield(element) {\n    this.element_ = element;\n    this.maxRows = this.Constant_.NO_MAX_ROWS;\n    // Initialize instance.\n    this.init();\n};\nwindow['MaterialTextfield'] = MaterialTextfield;\n/**\n   * Store constants in one place so they can be updated easily.\n   *\n   * @enum {string | number}\n   * @private\n   */\nMaterialTextfield.prototype.Constant_ = {\n    NO_MAX_ROWS: -1,\n    MAX_ROWS_ATTRIBUTE: 'maxrows'\n};\n/**\n   * Store strings for class names defined by this component that are used in\n   * JavaScript. This allows us to simply change it in one place should we\n   * decide to modify at a later date.\n   *\n   * @enum {string}\n   * @private\n   */\nMaterialTextfield.prototype.CssClasses_ = {\n    LABEL: 'mdl-textfield__label',\n    INPUT: 'mdl-textfield__input',\n    IS_DIRTY: 'is-dirty',\n    IS_FOCUSED: 'is-focused',\n    IS_DISABLED: 'is-disabled',\n    IS_INVALID: 'is-invalid',\n    IS_UPGRADED: 'is-upgraded',\n    HAS_PLACEHOLDER: 'has-placeholder'\n};\n/**\n   * Handle input being entered.\n   *\n   * @param {Event} event The event that fired.\n   * @private\n   */\nMaterialTextfield.prototype.onKeyDown_ = function (event) {\n    var currentRowCount = event.target.value.split('\\n').length;\n    if (event.keyCode === 13) {\n        if (currentRowCount >= this.maxRows) {\n            event.preventDefault();\n        }\n    }\n};\n/**\n   * Handle focus.\n   *\n   * @param {Event} event The event that fired.\n   * @private\n   */\nMaterialTextfield.prototype.onFocus_ = function (event) {\n    this.element_.classList.add(this.CssClasses_.IS_FOCUSED);\n};\n/**\n   * Handle lost focus.\n   *\n   * @param {Event} event The event that fired.\n   * @private\n   */\nMaterialTextfield.prototype.onBlur_ = function (event) {\n    this.element_.classList.remove(this.CssClasses_.IS_FOCUSED);\n};\n/**\n   * Handle reset event from out side.\n   *\n   * @param {Event} event The event that fired.\n   * @private\n   */\nMaterialTextfield.prototype.onReset_ = function (event) {\n    this.updateClasses_();\n};\n/**\n   * Handle class updates.\n   *\n   * @private\n   */\nMaterialTextfield.prototype.updateClasses_ = function () {\n    this.checkDisabled();\n    this.checkValidity();\n    this.checkDirty();\n    this.checkFocus();\n};\n// Public methods.\n/**\n   * Check the disabled state and update field accordingly.\n   *\n   * @public\n   */\nMaterialTextfield.prototype.checkDisabled = function () {\n    if (this.input_.disabled) {\n        this.element_.classList.add(this.CssClasses_.IS_DISABLED);\n    } else {\n        this.element_.classList.remove(this.CssClasses_.IS_DISABLED);\n    }\n};\nMaterialTextfield.prototype['checkDisabled'] = MaterialTextfield.prototype.checkDisabled;\n/**\n  * Check the focus state and update field accordingly.\n  *\n  * @public\n  */\nMaterialTextfield.prototype.checkFocus = function () {\n    if (Boolean(this.element_.querySelector(':focus'))) {\n        this.element_.classList.add(this.CssClasses_.IS_FOCUSED);\n    } else {\n        this.element_.classList.remove(this.CssClasses_.IS_FOCUSED);\n    }\n};\nMaterialTextfield.prototype['checkFocus'] = MaterialTextfield.prototype.checkFocus;\n/**\n   * Check the validity state and update field accordingly.\n   *\n   * @public\n   */\nMaterialTextfield.prototype.checkValidity = function () {\n    if (this.input_.validity) {\n        if (this.input_.validity.valid) {\n            this.element_.classList.remove(this.CssClasses_.IS_INVALID);\n        } else {\n            this.element_.classList.add(this.CssClasses_.IS_INVALID);\n        }\n    }\n};\nMaterialTextfield.prototype['checkValidity'] = MaterialTextfield.prototype.checkValidity;\n/**\n   * Check the dirty state and update field accordingly.\n   *\n   * @public\n   */\nMaterialTextfield.prototype.checkDirty = function () {\n    if (this.input_.value && this.input_.value.length > 0) {\n        this.element_.classList.add(this.CssClasses_.IS_DIRTY);\n    } else {\n        this.element_.classList.remove(this.CssClasses_.IS_DIRTY);\n    }\n};\nMaterialTextfield.prototype['checkDirty'] = MaterialTextfield.prototype.checkDirty;\n/**\n   * Disable text field.\n   *\n   * @public\n   */\nMaterialTextfield.prototype.disable = function () {\n    this.input_.disabled = true;\n    this.updateClasses_();\n};\nMaterialTextfield.prototype['disable'] = MaterialTextfield.prototype.disable;\n/**\n   * Enable text field.\n   *\n   * @public\n   */\nMaterialTextfield.prototype.enable = function () {\n    this.input_.disabled = false;\n    this.updateClasses_();\n};\nMaterialTextfield.prototype['enable'] = MaterialTextfield.prototype.enable;\n/**\n   * Update text field value.\n   *\n   * @param {string} value The value to which to set the control (optional).\n   * @public\n   */\nMaterialTextfield.prototype.change = function (value) {\n    this.input_.value = value || '';\n    this.updateClasses_();\n};\nMaterialTextfield.prototype['change'] = MaterialTextfield.prototype.change;\n/**\n   * Initialize element.\n   */\nMaterialTextfield.prototype.init = function () {\n    if (this.element_) {\n        this.label_ = this.element_.querySelector('.' + this.CssClasses_.LABEL);\n        this.input_ = this.element_.querySelector('.' + this.CssClasses_.INPUT);\n        if (this.input_) {\n            if (this.input_.hasAttribute(this.Constant_.MAX_ROWS_ATTRIBUTE)) {\n                this.maxRows = parseInt(this.input_.getAttribute(this.Constant_.MAX_ROWS_ATTRIBUTE), 10);\n                if (isNaN(this.maxRows)) {\n                    this.maxRows = this.Constant_.NO_MAX_ROWS;\n                }\n            }\n            if (this.input_.hasAttribute('placeholder')) {\n                this.element_.classList.add(this.CssClasses_.HAS_PLACEHOLDER);\n            }\n            this.boundUpdateClassesHandler = this.updateClasses_.bind(this);\n            this.boundFocusHandler = this.onFocus_.bind(this);\n            this.boundBlurHandler = this.onBlur_.bind(this);\n            this.boundResetHandler = this.onReset_.bind(this);\n            this.input_.addEventListener('input', this.boundUpdateClassesHandler);\n            this.input_.addEventListener('focus', this.boundFocusHandler);\n            this.input_.addEventListener('blur', this.boundBlurHandler);\n            this.input_.addEventListener('reset', this.boundResetHandler);\n            if (this.maxRows !== this.Constant_.NO_MAX_ROWS) {\n                // TODO: This should handle pasting multi line text.\n                // Currently doesn't.\n                this.boundKeyDownHandler = this.onKeyDown_.bind(this);\n                this.input_.addEventListener('keydown', this.boundKeyDownHandler);\n            }\n            var invalid = this.element_.classList.contains(this.CssClasses_.IS_INVALID);\n            this.updateClasses_();\n            this.element_.classList.add(this.CssClasses_.IS_UPGRADED);\n            if (invalid) {\n                this.element_.classList.add(this.CssClasses_.IS_INVALID);\n            }\n            if (this.input_.hasAttribute('autofocus')) {\n                this.element_.focus();\n                this.checkFocus();\n            }\n        }\n    }\n};\n// The component registers itself. It can assume componentHandler is available\n// in the global scope.\ncomponentHandler.register({\n    constructor: MaterialTextfield,\n    classAsString: 'MaterialTextfield',\n    cssClass: 'mdl-js-textfield',\n    widget: true\n});\n/**\n * @license\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n   * Class constructor for Tooltip MDL component.\n   * Implements MDL component design pattern defined at:\n   * https://github.com/jasonmayes/mdl-component-design-pattern\n   *\n   * @constructor\n   * @param {HTMLElement} element The element that will be upgraded.\n   */\nvar MaterialTooltip = function MaterialTooltip(element) {\n    this.element_ = element;\n    // Initialize instance.\n    this.init();\n};\nwindow['MaterialTooltip'] = MaterialTooltip;\n/**\n   * Store constants in one place so they can be updated easily.\n   *\n   * @enum {string | number}\n   * @private\n   */\nMaterialTooltip.prototype.Constant_ = {};\n/**\n   * Store strings for class names defined by this component that are used in\n   * JavaScript. This allows us to simply change it in one place should we\n   * decide to modify at a later date.\n   *\n   * @enum {string}\n   * @private\n   */\nMaterialTooltip.prototype.CssClasses_ = {\n    IS_ACTIVE: 'is-active',\n    BOTTOM: 'mdl-tooltip--bottom',\n    LEFT: 'mdl-tooltip--left',\n    RIGHT: 'mdl-tooltip--right',\n    TOP: 'mdl-tooltip--top'\n};\n/**\n   * Handle mouseenter for tooltip.\n   *\n   * @param {Event} event The event that fired.\n   * @private\n   */\nMaterialTooltip.prototype.handleMouseEnter_ = function (event) {\n    var props = event.target.getBoundingClientRect();\n    var left = props.left + props.width / 2;\n    var top = props.top + props.height / 2;\n    var marginLeft = -1 * (this.element_.offsetWidth / 2);\n    var marginTop = -1 * (this.element_.offsetHeight / 2);\n    if (this.element_.classList.contains(this.CssClasses_.LEFT) || this.element_.classList.contains(this.CssClasses_.RIGHT)) {\n        left = props.width / 2;\n        if (top + marginTop < 0) {\n            this.element_.style.top = '0';\n            this.element_.style.marginTop = '0';\n        } else {\n            this.element_.style.top = top + 'px';\n            this.element_.style.marginTop = marginTop + 'px';\n        }\n    } else {\n        if (left + marginLeft < 0) {\n            this.element_.style.left = '0';\n            this.element_.style.marginLeft = '0';\n        } else {\n            this.element_.style.left = left + 'px';\n            this.element_.style.marginLeft = marginLeft + 'px';\n        }\n    }\n    if (this.element_.classList.contains(this.CssClasses_.TOP)) {\n        this.element_.style.top = props.top - this.element_.offsetHeight - 10 + 'px';\n    } else if (this.element_.classList.contains(this.CssClasses_.RIGHT)) {\n        this.element_.style.left = props.left + props.width + 10 + 'px';\n    } else if (this.element_.classList.contains(this.CssClasses_.LEFT)) {\n        this.element_.style.left = props.left - this.element_.offsetWidth - 10 + 'px';\n    } else {\n        this.element_.style.top = props.top + props.height + 10 + 'px';\n    }\n    this.element_.classList.add(this.CssClasses_.IS_ACTIVE);\n};\n/**\n   * Hide tooltip on mouseleave or scroll\n   *\n   * @private\n   */\nMaterialTooltip.prototype.hideTooltip_ = function () {\n    this.element_.classList.remove(this.CssClasses_.IS_ACTIVE);\n};\n/**\n   * Initialize element.\n   */\nMaterialTooltip.prototype.init = function () {\n    if (this.element_) {\n        var forElId = this.element_.getAttribute('for') || this.element_.getAttribute('data-mdl-for');\n        if (forElId) {\n            this.forElement_ = document.getElementById(forElId);\n        }\n        if (this.forElement_) {\n            // It's left here because it prevents accidental text selection on Android\n            if (!this.forElement_.hasAttribute('tabindex')) {\n                this.forElement_.setAttribute('tabindex', '0');\n            }\n            this.boundMouseEnterHandler = this.handleMouseEnter_.bind(this);\n            this.boundMouseLeaveAndScrollHandler = this.hideTooltip_.bind(this);\n            this.forElement_.addEventListener('mouseenter', this.boundMouseEnterHandler, false);\n            this.forElement_.addEventListener('touchend', this.boundMouseEnterHandler, false);\n            this.forElement_.addEventListener('mouseleave', this.boundMouseLeaveAndScrollHandler, false);\n            window.addEventListener('scroll', this.boundMouseLeaveAndScrollHandler, true);\n            window.addEventListener('touchstart', this.boundMouseLeaveAndScrollHandler);\n        }\n    }\n};\n// The component registers itself. It can assume componentHandler is available\n// in the global scope.\ncomponentHandler.register({\n    constructor: MaterialTooltip,\n    classAsString: 'MaterialTooltip',\n    cssClass: 'mdl-tooltip'\n});\n/**\n * @license\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n   * Class constructor for Layout MDL component.\n   * Implements MDL component design pattern defined at:\n   * https://github.com/jasonmayes/mdl-component-design-pattern\n   *\n   * @constructor\n   * @param {HTMLElement} element The element that will be upgraded.\n   */\nvar MaterialLayout = function MaterialLayout(element) {\n    this.element_ = element;\n    // Initialize instance.\n    this.init();\n};\nwindow['MaterialLayout'] = MaterialLayout;\n/**\n   * Store constants in one place so they can be updated easily.\n   *\n   * @enum {string | number}\n   * @private\n   */\nMaterialLayout.prototype.Constant_ = {\n    MAX_WIDTH: '(max-width: 1024px)',\n    TAB_SCROLL_PIXELS: 100,\n    RESIZE_TIMEOUT: 100,\n    MENU_ICON: '&#xE5D2;',\n    CHEVRON_LEFT: 'chevron_left',\n    CHEVRON_RIGHT: 'chevron_right'\n};\n/**\n   * Keycodes, for code readability.\n   *\n   * @enum {number}\n   * @private\n   */\nMaterialLayout.prototype.Keycodes_ = {\n    ENTER: 13,\n    ESCAPE: 27,\n    SPACE: 32\n};\n/**\n   * Modes.\n   *\n   * @enum {number}\n   * @private\n   */\nMaterialLayout.prototype.Mode_ = {\n    STANDARD: 0,\n    SEAMED: 1,\n    WATERFALL: 2,\n    SCROLL: 3\n};\n/**\n   * Store strings for class names defined by this component that are used in\n   * JavaScript. This allows us to simply change it in one place should we\n   * decide to modify at a later date.\n   *\n   * @enum {string}\n   * @private\n   */\nMaterialLayout.prototype.CssClasses_ = {\n    CONTAINER: 'mdl-layout__container',\n    HEADER: 'mdl-layout__header',\n    DRAWER: 'mdl-layout__drawer',\n    CONTENT: 'mdl-layout__content',\n    DRAWER_BTN: 'mdl-layout__drawer-button',\n    ICON: 'material-icons',\n    JS_RIPPLE_EFFECT: 'mdl-js-ripple-effect',\n    RIPPLE_CONTAINER: 'mdl-layout__tab-ripple-container',\n    RIPPLE: 'mdl-ripple',\n    RIPPLE_IGNORE_EVENTS: 'mdl-js-ripple-effect--ignore-events',\n    HEADER_SEAMED: 'mdl-layout__header--seamed',\n    HEADER_WATERFALL: 'mdl-layout__header--waterfall',\n    HEADER_SCROLL: 'mdl-layout__header--scroll',\n    FIXED_HEADER: 'mdl-layout--fixed-header',\n    OBFUSCATOR: 'mdl-layout__obfuscator',\n    TAB_BAR: 'mdl-layout__tab-bar',\n    TAB_CONTAINER: 'mdl-layout__tab-bar-container',\n    TAB: 'mdl-layout__tab',\n    TAB_BAR_BUTTON: 'mdl-layout__tab-bar-button',\n    TAB_BAR_LEFT_BUTTON: 'mdl-layout__tab-bar-left-button',\n    TAB_BAR_RIGHT_BUTTON: 'mdl-layout__tab-bar-right-button',\n    TAB_MANUAL_SWITCH: 'mdl-layout__tab-manual-switch',\n    PANEL: 'mdl-layout__tab-panel',\n    HAS_DRAWER: 'has-drawer',\n    HAS_TABS: 'has-tabs',\n    HAS_SCROLLING_HEADER: 'has-scrolling-header',\n    CASTING_SHADOW: 'is-casting-shadow',\n    IS_COMPACT: 'is-compact',\n    IS_SMALL_SCREEN: 'is-small-screen',\n    IS_DRAWER_OPEN: 'is-visible',\n    IS_ACTIVE: 'is-active',\n    IS_UPGRADED: 'is-upgraded',\n    IS_ANIMATING: 'is-animating',\n    ON_LARGE_SCREEN: 'mdl-layout--large-screen-only',\n    ON_SMALL_SCREEN: 'mdl-layout--small-screen-only'\n};\n/**\n   * Handles scrolling on the content.\n   *\n   * @private\n   */\nMaterialLayout.prototype.contentScrollHandler_ = function () {\n    if (this.header_.classList.contains(this.CssClasses_.IS_ANIMATING)) {\n        return;\n    }\n    var headerVisible = !this.element_.classList.contains(this.CssClasses_.IS_SMALL_SCREEN) || this.element_.classList.contains(this.CssClasses_.FIXED_HEADER);\n    if (this.content_.scrollTop > 0 && !this.header_.classList.contains(this.CssClasses_.IS_COMPACT)) {\n        this.header_.classList.add(this.CssClasses_.CASTING_SHADOW);\n        this.header_.classList.add(this.CssClasses_.IS_COMPACT);\n        if (headerVisible) {\n            this.header_.classList.add(this.CssClasses_.IS_ANIMATING);\n        }\n    } else if (this.content_.scrollTop <= 0 && this.header_.classList.contains(this.CssClasses_.IS_COMPACT)) {\n        this.header_.classList.remove(this.CssClasses_.CASTING_SHADOW);\n        this.header_.classList.remove(this.CssClasses_.IS_COMPACT);\n        if (headerVisible) {\n            this.header_.classList.add(this.CssClasses_.IS_ANIMATING);\n        }\n    }\n};\n/**\n   * Handles a keyboard event on the drawer.\n   *\n   * @param {Event} evt The event that fired.\n   * @private\n   */\nMaterialLayout.prototype.keyboardEventHandler_ = function (evt) {\n    // Only react when the drawer is open.\n    if (evt.keyCode === this.Keycodes_.ESCAPE && this.drawer_.classList.contains(this.CssClasses_.IS_DRAWER_OPEN)) {\n        this.toggleDrawer();\n    }\n};\n/**\n   * Handles changes in screen size.\n   *\n   * @private\n   */\nMaterialLayout.prototype.screenSizeHandler_ = function () {\n    if (this.screenSizeMediaQuery_.matches) {\n        this.element_.classList.add(this.CssClasses_.IS_SMALL_SCREEN);\n    } else {\n        this.element_.classList.remove(this.CssClasses_.IS_SMALL_SCREEN);\n        // Collapse drawer (if any) when moving to a large screen size.\n        if (this.drawer_) {\n            this.drawer_.classList.remove(this.CssClasses_.IS_DRAWER_OPEN);\n            this.obfuscator_.classList.remove(this.CssClasses_.IS_DRAWER_OPEN);\n        }\n    }\n};\n/**\n   * Handles events of drawer button.\n   *\n   * @param {Event} evt The event that fired.\n   * @private\n   */\nMaterialLayout.prototype.drawerToggleHandler_ = function (evt) {\n    if (evt && evt.type === 'keydown') {\n        if (evt.keyCode === this.Keycodes_.SPACE || evt.keyCode === this.Keycodes_.ENTER) {\n            // prevent scrolling in drawer nav\n            evt.preventDefault();\n        } else {\n            // prevent other keys\n            return;\n        }\n    }\n    this.toggleDrawer();\n};\n/**\n   * Handles (un)setting the `is-animating` class\n   *\n   * @private\n   */\nMaterialLayout.prototype.headerTransitionEndHandler_ = function () {\n    this.header_.classList.remove(this.CssClasses_.IS_ANIMATING);\n};\n/**\n   * Handles expanding the header on click\n   *\n   * @private\n   */\nMaterialLayout.prototype.headerClickHandler_ = function () {\n    if (this.header_.classList.contains(this.CssClasses_.IS_COMPACT)) {\n        this.header_.classList.remove(this.CssClasses_.IS_COMPACT);\n        this.header_.classList.add(this.CssClasses_.IS_ANIMATING);\n    }\n};\n/**\n   * Reset tab state, dropping active classes\n   *\n   * @private\n   */\nMaterialLayout.prototype.resetTabState_ = function (tabBar) {\n    for (var k = 0; k < tabBar.length; k++) {\n        tabBar[k].classList.remove(this.CssClasses_.IS_ACTIVE);\n    }\n};\n/**\n   * Reset panel state, droping active classes\n   *\n   * @private\n   */\nMaterialLayout.prototype.resetPanelState_ = function (panels) {\n    for (var j = 0; j < panels.length; j++) {\n        panels[j].classList.remove(this.CssClasses_.IS_ACTIVE);\n    }\n};\n/**\n  * Toggle drawer state\n  *\n  * @public\n  */\nMaterialLayout.prototype.toggleDrawer = function () {\n    var drawerButton = this.element_.querySelector('.' + this.CssClasses_.DRAWER_BTN);\n    this.drawer_.classList.toggle(this.CssClasses_.IS_DRAWER_OPEN);\n    this.obfuscator_.classList.toggle(this.CssClasses_.IS_DRAWER_OPEN);\n    // Set accessibility properties.\n    if (this.drawer_.classList.contains(this.CssClasses_.IS_DRAWER_OPEN)) {\n        this.drawer_.setAttribute('aria-hidden', 'false');\n        drawerButton.setAttribute('aria-expanded', 'true');\n    } else {\n        this.drawer_.setAttribute('aria-hidden', 'true');\n        drawerButton.setAttribute('aria-expanded', 'false');\n    }\n};\nMaterialLayout.prototype['toggleDrawer'] = MaterialLayout.prototype.toggleDrawer;\n/**\n   * Initialize element.\n   */\nMaterialLayout.prototype.init = function () {\n    if (this.element_) {\n        var container = document.createElement('div');\n        container.classList.add(this.CssClasses_.CONTAINER);\n        var focusedElement = this.element_.querySelector(':focus');\n        this.element_.parentElement.insertBefore(container, this.element_);\n        this.element_.parentElement.removeChild(this.element_);\n        container.appendChild(this.element_);\n        if (focusedElement) {\n            focusedElement.focus();\n        }\n        var directChildren = this.element_.childNodes;\n        var numChildren = directChildren.length;\n        for (var c = 0; c < numChildren; c++) {\n            var child = directChildren[c];\n            if (child.classList && child.classList.contains(this.CssClasses_.HEADER)) {\n                this.header_ = child;\n            }\n            if (child.classList && child.classList.contains(this.CssClasses_.DRAWER)) {\n                this.drawer_ = child;\n            }\n            if (child.classList && child.classList.contains(this.CssClasses_.CONTENT)) {\n                this.content_ = child;\n            }\n        }\n        window.addEventListener('pageshow', function (e) {\n            if (e.persisted) {\n                // when page is loaded from back/forward cache\n                // trigger repaint to let layout scroll in safari\n                this.element_.style.overflowY = 'hidden';\n                requestAnimationFrame(function () {\n                    this.element_.style.overflowY = '';\n                }.bind(this));\n            }\n        }.bind(this), false);\n        if (this.header_) {\n            this.tabBar_ = this.header_.querySelector('.' + this.CssClasses_.TAB_BAR);\n        }\n        var mode = this.Mode_.STANDARD;\n        if (this.header_) {\n            if (this.header_.classList.contains(this.CssClasses_.HEADER_SEAMED)) {\n                mode = this.Mode_.SEAMED;\n            } else if (this.header_.classList.contains(this.CssClasses_.HEADER_WATERFALL)) {\n                mode = this.Mode_.WATERFALL;\n                this.header_.addEventListener('transitionend', this.headerTransitionEndHandler_.bind(this));\n                this.header_.addEventListener('click', this.headerClickHandler_.bind(this));\n            } else if (this.header_.classList.contains(this.CssClasses_.HEADER_SCROLL)) {\n                mode = this.Mode_.SCROLL;\n                container.classList.add(this.CssClasses_.HAS_SCROLLING_HEADER);\n            }\n            if (mode === this.Mode_.STANDARD) {\n                this.header_.classList.add(this.CssClasses_.CASTING_SHADOW);\n                if (this.tabBar_) {\n                    this.tabBar_.classList.add(this.CssClasses_.CASTING_SHADOW);\n                }\n            } else if (mode === this.Mode_.SEAMED || mode === this.Mode_.SCROLL) {\n                this.header_.classList.remove(this.CssClasses_.CASTING_SHADOW);\n                if (this.tabBar_) {\n                    this.tabBar_.classList.remove(this.CssClasses_.CASTING_SHADOW);\n                }\n            } else if (mode === this.Mode_.WATERFALL) {\n                // Add and remove shadows depending on scroll position.\n                // Also add/remove auxiliary class for styling of the compact version of\n                // the header.\n                this.content_.addEventListener('scroll', this.contentScrollHandler_.bind(this));\n                this.contentScrollHandler_();\n            }\n        }\n        // Add drawer toggling button to our layout, if we have an openable drawer.\n        if (this.drawer_) {\n            var drawerButton = this.element_.querySelector('.' + this.CssClasses_.DRAWER_BTN);\n            if (!drawerButton) {\n                drawerButton = document.createElement('div');\n                drawerButton.setAttribute('aria-expanded', 'false');\n                drawerButton.setAttribute('role', 'button');\n                drawerButton.setAttribute('tabindex', '0');\n                drawerButton.classList.add(this.CssClasses_.DRAWER_BTN);\n                var drawerButtonIcon = document.createElement('i');\n                drawerButtonIcon.classList.add(this.CssClasses_.ICON);\n                drawerButtonIcon.innerHTML = this.Constant_.MENU_ICON;\n                drawerButton.appendChild(drawerButtonIcon);\n            }\n            if (this.drawer_.classList.contains(this.CssClasses_.ON_LARGE_SCREEN)) {\n                //If drawer has ON_LARGE_SCREEN class then add it to the drawer toggle button as well.\n                drawerButton.classList.add(this.CssClasses_.ON_LARGE_SCREEN);\n            } else if (this.drawer_.classList.contains(this.CssClasses_.ON_SMALL_SCREEN)) {\n                //If drawer has ON_SMALL_SCREEN class then add it to the drawer toggle button as well.\n                drawerButton.classList.add(this.CssClasses_.ON_SMALL_SCREEN);\n            }\n            drawerButton.addEventListener('click', this.drawerToggleHandler_.bind(this));\n            drawerButton.addEventListener('keydown', this.drawerToggleHandler_.bind(this));\n            // Add a class if the layout has a drawer, for altering the left padding.\n            // Adds the HAS_DRAWER to the elements since this.header_ may or may\n            // not be present.\n            this.element_.classList.add(this.CssClasses_.HAS_DRAWER);\n            // If we have a fixed header, add the button to the header rather than\n            // the layout.\n            if (this.element_.classList.contains(this.CssClasses_.FIXED_HEADER)) {\n                this.header_.insertBefore(drawerButton, this.header_.firstChild);\n            } else {\n                this.element_.insertBefore(drawerButton, this.content_);\n            }\n            var obfuscator = document.createElement('div');\n            obfuscator.classList.add(this.CssClasses_.OBFUSCATOR);\n            this.element_.appendChild(obfuscator);\n            obfuscator.addEventListener('click', this.drawerToggleHandler_.bind(this));\n            this.obfuscator_ = obfuscator;\n            this.drawer_.addEventListener('keydown', this.keyboardEventHandler_.bind(this));\n            this.drawer_.setAttribute('aria-hidden', 'true');\n        }\n        // Keep an eye on screen size, and add/remove auxiliary class for styling\n        // of small screens.\n        this.screenSizeMediaQuery_ = window.matchMedia(this.Constant_.MAX_WIDTH);\n        this.screenSizeMediaQuery_.addListener(this.screenSizeHandler_.bind(this));\n        this.screenSizeHandler_();\n        // Initialize tabs, if any.\n        if (this.header_ && this.tabBar_) {\n            this.element_.classList.add(this.CssClasses_.HAS_TABS);\n            var tabContainer = document.createElement('div');\n            tabContainer.classList.add(this.CssClasses_.TAB_CONTAINER);\n            this.header_.insertBefore(tabContainer, this.tabBar_);\n            this.header_.removeChild(this.tabBar_);\n            var leftButton = document.createElement('div');\n            leftButton.classList.add(this.CssClasses_.TAB_BAR_BUTTON);\n            leftButton.classList.add(this.CssClasses_.TAB_BAR_LEFT_BUTTON);\n            var leftButtonIcon = document.createElement('i');\n            leftButtonIcon.classList.add(this.CssClasses_.ICON);\n            leftButtonIcon.textContent = this.Constant_.CHEVRON_LEFT;\n            leftButton.appendChild(leftButtonIcon);\n            leftButton.addEventListener('click', function () {\n                this.tabBar_.scrollLeft -= this.Constant_.TAB_SCROLL_PIXELS;\n            }.bind(this));\n            var rightButton = document.createElement('div');\n            rightButton.classList.add(this.CssClasses_.TAB_BAR_BUTTON);\n            rightButton.classList.add(this.CssClasses_.TAB_BAR_RIGHT_BUTTON);\n            var rightButtonIcon = document.createElement('i');\n            rightButtonIcon.classList.add(this.CssClasses_.ICON);\n            rightButtonIcon.textContent = this.Constant_.CHEVRON_RIGHT;\n            rightButton.appendChild(rightButtonIcon);\n            rightButton.addEventListener('click', function () {\n                this.tabBar_.scrollLeft += this.Constant_.TAB_SCROLL_PIXELS;\n            }.bind(this));\n            tabContainer.appendChild(leftButton);\n            tabContainer.appendChild(this.tabBar_);\n            tabContainer.appendChild(rightButton);\n            // Add and remove tab buttons depending on scroll position and total\n            // window size.\n            var tabUpdateHandler = function () {\n                if (this.tabBar_.scrollLeft > 0) {\n                    leftButton.classList.add(this.CssClasses_.IS_ACTIVE);\n                } else {\n                    leftButton.classList.remove(this.CssClasses_.IS_ACTIVE);\n                }\n                if (this.tabBar_.scrollLeft < this.tabBar_.scrollWidth - this.tabBar_.offsetWidth) {\n                    rightButton.classList.add(this.CssClasses_.IS_ACTIVE);\n                } else {\n                    rightButton.classList.remove(this.CssClasses_.IS_ACTIVE);\n                }\n            }.bind(this);\n            this.tabBar_.addEventListener('scroll', tabUpdateHandler);\n            tabUpdateHandler();\n            // Update tabs when the window resizes.\n            var windowResizeHandler = function () {\n                // Use timeouts to make sure it doesn't happen too often.\n                if (this.resizeTimeoutId_) {\n                    clearTimeout(this.resizeTimeoutId_);\n                }\n                this.resizeTimeoutId_ = setTimeout(function () {\n                    tabUpdateHandler();\n                    this.resizeTimeoutId_ = null;\n                }.bind(this), this.Constant_.RESIZE_TIMEOUT);\n            }.bind(this);\n            window.addEventListener('resize', windowResizeHandler);\n            if (this.tabBar_.classList.contains(this.CssClasses_.JS_RIPPLE_EFFECT)) {\n                this.tabBar_.classList.add(this.CssClasses_.RIPPLE_IGNORE_EVENTS);\n            }\n            // Select element tabs, document panels\n            var tabs = this.tabBar_.querySelectorAll('.' + this.CssClasses_.TAB);\n            var panels = this.content_.querySelectorAll('.' + this.CssClasses_.PANEL);\n            // Create new tabs for each tab element\n            for (var i = 0; i < tabs.length; i++) {\n                new MaterialLayoutTab(tabs[i], tabs, panels, this);\n            }\n        }\n        this.element_.classList.add(this.CssClasses_.IS_UPGRADED);\n    }\n};\n/**\n   * Constructor for an individual tab.\n   *\n   * @constructor\n   * @param {HTMLElement} tab The HTML element for the tab.\n   * @param {!Array<HTMLElement>} tabs Array with HTML elements for all tabs.\n   * @param {!Array<HTMLElement>} panels Array with HTML elements for all panels.\n   * @param {MaterialLayout} layout The MaterialLayout object that owns the tab.\n   */\nfunction MaterialLayoutTab(tab, tabs, panels, layout) {\n    /**\n     * Auxiliary method to programmatically select a tab in the UI.\n     */\n    function selectTab() {\n        var href = tab.href.split('#')[1];\n        var panel = layout.content_.querySelector('#' + href);\n        layout.resetTabState_(tabs);\n        layout.resetPanelState_(panels);\n        tab.classList.add(layout.CssClasses_.IS_ACTIVE);\n        panel.classList.add(layout.CssClasses_.IS_ACTIVE);\n    }\n    if (layout.tabBar_.classList.contains(layout.CssClasses_.JS_RIPPLE_EFFECT)) {\n        var rippleContainer = document.createElement('span');\n        rippleContainer.classList.add(layout.CssClasses_.RIPPLE_CONTAINER);\n        rippleContainer.classList.add(layout.CssClasses_.JS_RIPPLE_EFFECT);\n        var ripple = document.createElement('span');\n        ripple.classList.add(layout.CssClasses_.RIPPLE);\n        rippleContainer.appendChild(ripple);\n        tab.appendChild(rippleContainer);\n    }\n    if (!layout.tabBar_.classList.contains(layout.CssClasses_.TAB_MANUAL_SWITCH)) {\n        tab.addEventListener('click', function (e) {\n            if (tab.getAttribute('href').charAt(0) === '#') {\n                e.preventDefault();\n                selectTab();\n            }\n        });\n    }\n    tab.show = selectTab;\n}\nwindow['MaterialLayoutTab'] = MaterialLayoutTab;\n// The component registers itself. It can assume componentHandler is available\n// in the global scope.\ncomponentHandler.register({\n    constructor: MaterialLayout,\n    classAsString: 'MaterialLayout',\n    cssClass: 'mdl-js-layout'\n});\n/**\n * @license\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n   * Class constructor for Data Table Card MDL component.\n   * Implements MDL component design pattern defined at:\n   * https://github.com/jasonmayes/mdl-component-design-pattern\n   *\n   * @constructor\n   * @param {Element} element The element that will be upgraded.\n   */\nvar MaterialDataTable = function MaterialDataTable(element) {\n    this.element_ = element;\n    // Initialize instance.\n    this.init();\n};\nwindow['MaterialDataTable'] = MaterialDataTable;\n/**\n   * Store constants in one place so they can be updated easily.\n   *\n   * @enum {string | number}\n   * @private\n   */\nMaterialDataTable.prototype.Constant_ = {};\n/**\n   * Store strings for class names defined by this component that are used in\n   * JavaScript. This allows us to simply change it in one place should we\n   * decide to modify at a later date.\n   *\n   * @enum {string}\n   * @private\n   */\nMaterialDataTable.prototype.CssClasses_ = {\n    DATA_TABLE: 'mdl-data-table',\n    SELECTABLE: 'mdl-data-table--selectable',\n    SELECT_ELEMENT: 'mdl-data-table__select',\n    IS_SELECTED: 'is-selected',\n    IS_UPGRADED: 'is-upgraded'\n};\n/**\n   * Generates and returns a function that toggles the selection state of a\n   * single row (or multiple rows).\n   *\n   * @param {Element} checkbox Checkbox that toggles the selection state.\n   * @param {Element} row Row to toggle when checkbox changes.\n   * @param {(Array<Object>|NodeList)=} opt_rows Rows to toggle when checkbox changes.\n   * @private\n   */\nMaterialDataTable.prototype.selectRow_ = function (checkbox, row, opt_rows) {\n    if (row) {\n        return function () {\n            if (checkbox.checked) {\n                row.classList.add(this.CssClasses_.IS_SELECTED);\n            } else {\n                row.classList.remove(this.CssClasses_.IS_SELECTED);\n            }\n        }.bind(this);\n    }\n    if (opt_rows) {\n        return function () {\n            var i;\n            var el;\n            if (checkbox.checked) {\n                for (i = 0; i < opt_rows.length; i++) {\n                    el = opt_rows[i].querySelector('td').querySelector('.mdl-checkbox');\n                    el['MaterialCheckbox'].check();\n                    opt_rows[i].classList.add(this.CssClasses_.IS_SELECTED);\n                }\n            } else {\n                for (i = 0; i < opt_rows.length; i++) {\n                    el = opt_rows[i].querySelector('td').querySelector('.mdl-checkbox');\n                    el['MaterialCheckbox'].uncheck();\n                    opt_rows[i].classList.remove(this.CssClasses_.IS_SELECTED);\n                }\n            }\n        }.bind(this);\n    }\n};\n/**\n   * Creates a checkbox for a single or or multiple rows and hooks up the\n   * event handling.\n   *\n   * @param {Element} row Row to toggle when checkbox changes.\n   * @param {(Array<Object>|NodeList)=} opt_rows Rows to toggle when checkbox changes.\n   * @private\n   */\nMaterialDataTable.prototype.createCheckbox_ = function (row, opt_rows) {\n    var label = document.createElement('label');\n    var labelClasses = [\n        'mdl-checkbox',\n        'mdl-js-checkbox',\n        'mdl-js-ripple-effect',\n        this.CssClasses_.SELECT_ELEMENT\n    ];\n    label.className = labelClasses.join(' ');\n    var checkbox = document.createElement('input');\n    checkbox.type = 'checkbox';\n    checkbox.classList.add('mdl-checkbox__input');\n    if (row) {\n        checkbox.checked = row.classList.contains(this.CssClasses_.IS_SELECTED);\n        checkbox.addEventListener('change', this.selectRow_(checkbox, row));\n    } else if (opt_rows) {\n        checkbox.addEventListener('change', this.selectRow_(checkbox, null, opt_rows));\n    }\n    label.appendChild(checkbox);\n    componentHandler.upgradeElement(label, 'MaterialCheckbox');\n    return label;\n};\n/**\n   * Initialize element.\n   */\nMaterialDataTable.prototype.init = function () {\n    if (this.element_) {\n        var firstHeader = this.element_.querySelector('th');\n        var bodyRows = Array.prototype.slice.call(this.element_.querySelectorAll('tbody tr'));\n        var footRows = Array.prototype.slice.call(this.element_.querySelectorAll('tfoot tr'));\n        var rows = bodyRows.concat(footRows);\n        if (this.element_.classList.contains(this.CssClasses_.SELECTABLE)) {\n            var th = document.createElement('th');\n            var headerCheckbox = this.createCheckbox_(null, rows);\n            th.appendChild(headerCheckbox);\n            firstHeader.parentElement.insertBefore(th, firstHeader);\n            for (var i = 0; i < rows.length; i++) {\n                var firstCell = rows[i].querySelector('td');\n                if (firstCell) {\n                    var td = document.createElement('td');\n                    if (rows[i].parentNode.nodeName.toUpperCase() === 'TBODY') {\n                        var rowCheckbox = this.createCheckbox_(rows[i]);\n                        td.appendChild(rowCheckbox);\n                    }\n                    rows[i].insertBefore(td, firstCell);\n                }\n            }\n            this.element_.classList.add(this.CssClasses_.IS_UPGRADED);\n        }\n    }\n};\n// The component registers itself. It can assume componentHandler is available\n// in the global scope.\ncomponentHandler.register({\n    constructor: MaterialDataTable,\n    classAsString: 'MaterialDataTable',\n    cssClass: 'mdl-js-data-table'\n});\n/**\n * @license\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n   * Class constructor for Ripple MDL component.\n   * Implements MDL component design pattern defined at:\n   * https://github.com/jasonmayes/mdl-component-design-pattern\n   *\n   * @constructor\n   * @param {HTMLElement} element The element that will be upgraded.\n   */\nvar MaterialRipple = function MaterialRipple(element) {\n    this.element_ = element;\n    // Initialize instance.\n    this.init();\n};\nwindow['MaterialRipple'] = MaterialRipple;\n/**\n   * Store constants in one place so they can be updated easily.\n   *\n   * @enum {string | number}\n   * @private\n   */\nMaterialRipple.prototype.Constant_ = {\n    INITIAL_SCALE: 'scale(0.0001, 0.0001)',\n    INITIAL_SIZE: '1px',\n    INITIAL_OPACITY: '0.4',\n    FINAL_OPACITY: '0',\n    FINAL_SCALE: ''\n};\n/**\n   * Store strings for class names defined by this component that are used in\n   * JavaScript. This allows us to simply change it in one place should we\n   * decide to modify at a later date.\n   *\n   * @enum {string}\n   * @private\n   */\nMaterialRipple.prototype.CssClasses_ = {\n    RIPPLE_CENTER: 'mdl-ripple--center',\n    RIPPLE_EFFECT_IGNORE_EVENTS: 'mdl-js-ripple-effect--ignore-events',\n    RIPPLE: 'mdl-ripple',\n    IS_ANIMATING: 'is-animating',\n    IS_VISIBLE: 'is-visible'\n};\n/**\n   * Handle mouse / finger down on element.\n   *\n   * @param {Event} event The event that fired.\n   * @private\n   */\nMaterialRipple.prototype.downHandler_ = function (event) {\n    if (!this.rippleElement_.style.width && !this.rippleElement_.style.height) {\n        var rect = this.element_.getBoundingClientRect();\n        this.boundHeight = rect.height;\n        this.boundWidth = rect.width;\n        this.rippleSize_ = Math.sqrt(rect.width * rect.width + rect.height * rect.height) * 2 + 2;\n        this.rippleElement_.style.width = this.rippleSize_ + 'px';\n        this.rippleElement_.style.height = this.rippleSize_ + 'px';\n    }\n    this.rippleElement_.classList.add(this.CssClasses_.IS_VISIBLE);\n    if (event.type === 'mousedown' && this.ignoringMouseDown_) {\n        this.ignoringMouseDown_ = false;\n    } else {\n        if (event.type === 'touchstart') {\n            this.ignoringMouseDown_ = true;\n        }\n        var frameCount = this.getFrameCount();\n        if (frameCount > 0) {\n            return;\n        }\n        this.setFrameCount(1);\n        var bound = event.currentTarget.getBoundingClientRect();\n        var x;\n        var y;\n        // Check if we are handling a keyboard click.\n        if (event.clientX === 0 && event.clientY === 0) {\n            x = Math.round(bound.width / 2);\n            y = Math.round(bound.height / 2);\n        } else {\n            var clientX = event.clientX !== undefined ? event.clientX : event.touches[0].clientX;\n            var clientY = event.clientY !== undefined ? event.clientY : event.touches[0].clientY;\n            x = Math.round(clientX - bound.left);\n            y = Math.round(clientY - bound.top);\n        }\n        this.setRippleXY(x, y);\n        this.setRippleStyles(true);\n        window.requestAnimationFrame(this.animFrameHandler.bind(this));\n    }\n};\n/**\n   * Handle mouse / finger up on element.\n   *\n   * @param {Event} event The event that fired.\n   * @private\n   */\nMaterialRipple.prototype.upHandler_ = function (event) {\n    // Don't fire for the artificial \"mouseup\" generated by a double-click.\n    if (event && event.detail !== 2) {\n        // Allow a repaint to occur before removing this class, so the animation\n        // shows for tap events, which seem to trigger a mouseup too soon after\n        // mousedown.\n        window.setTimeout(function () {\n            this.rippleElement_.classList.remove(this.CssClasses_.IS_VISIBLE);\n        }.bind(this), 0);\n    }\n};\n/**\n   * Initialize element.\n   */\nMaterialRipple.prototype.init = function () {\n    if (this.element_) {\n        var recentering = this.element_.classList.contains(this.CssClasses_.RIPPLE_CENTER);\n        if (!this.element_.classList.contains(this.CssClasses_.RIPPLE_EFFECT_IGNORE_EVENTS)) {\n            this.rippleElement_ = this.element_.querySelector('.' + this.CssClasses_.RIPPLE);\n            this.frameCount_ = 0;\n            this.rippleSize_ = 0;\n            this.x_ = 0;\n            this.y_ = 0;\n            // Touch start produces a compat mouse down event, which would cause a\n            // second ripples. To avoid that, we use this property to ignore the first\n            // mouse down after a touch start.\n            this.ignoringMouseDown_ = false;\n            this.boundDownHandler = this.downHandler_.bind(this);\n            this.element_.addEventListener('mousedown', this.boundDownHandler);\n            this.element_.addEventListener('touchstart', this.boundDownHandler);\n            this.boundUpHandler = this.upHandler_.bind(this);\n            this.element_.addEventListener('mouseup', this.boundUpHandler);\n            this.element_.addEventListener('mouseleave', this.boundUpHandler);\n            this.element_.addEventListener('touchend', this.boundUpHandler);\n            this.element_.addEventListener('blur', this.boundUpHandler);\n            /**\n         * Getter for frameCount_.\n         * @return {number} the frame count.\n         */\n            this.getFrameCount = function () {\n                return this.frameCount_;\n            };\n            /**\n         * Setter for frameCount_.\n         * @param {number} fC the frame count.\n         */\n            this.setFrameCount = function (fC) {\n                this.frameCount_ = fC;\n            };\n            /**\n         * Getter for rippleElement_.\n         * @return {Element} the ripple element.\n         */\n            this.getRippleElement = function () {\n                return this.rippleElement_;\n            };\n            /**\n         * Sets the ripple X and Y coordinates.\n         * @param  {number} newX the new X coordinate\n         * @param  {number} newY the new Y coordinate\n         */\n            this.setRippleXY = function (newX, newY) {\n                this.x_ = newX;\n                this.y_ = newY;\n            };\n            /**\n         * Sets the ripple styles.\n         * @param  {boolean} start whether or not this is the start frame.\n         */\n            this.setRippleStyles = function (start) {\n                if (this.rippleElement_ !== null) {\n                    var transformString;\n                    var scale;\n                    var size;\n                    var offset = 'translate(' + this.x_ + 'px, ' + this.y_ + 'px)';\n                    if (start) {\n                        scale = this.Constant_.INITIAL_SCALE;\n                        size = this.Constant_.INITIAL_SIZE;\n                    } else {\n                        scale = this.Constant_.FINAL_SCALE;\n                        size = this.rippleSize_ + 'px';\n                        if (recentering) {\n                            offset = 'translate(' + this.boundWidth / 2 + 'px, ' + this.boundHeight / 2 + 'px)';\n                        }\n                    }\n                    transformString = 'translate(-50%, -50%) ' + offset + scale;\n                    this.rippleElement_.style.webkitTransform = transformString;\n                    this.rippleElement_.style.msTransform = transformString;\n                    this.rippleElement_.style.transform = transformString;\n                    if (start) {\n                        this.rippleElement_.classList.remove(this.CssClasses_.IS_ANIMATING);\n                    } else {\n                        this.rippleElement_.classList.add(this.CssClasses_.IS_ANIMATING);\n                    }\n                }\n            };\n            /**\n         * Handles an animation frame.\n         */\n            this.animFrameHandler = function () {\n                if (this.frameCount_-- > 0) {\n                    window.requestAnimationFrame(this.animFrameHandler.bind(this));\n                } else {\n                    this.setRippleStyles(false);\n                }\n            };\n        }\n    }\n};\n// The component registers itself. It can assume componentHandler is available\n// in the global scope.\ncomponentHandler.register({\n    constructor: MaterialRipple,\n    classAsString: 'MaterialRipple',\n    cssClass: 'mdl-js-ripple-effect',\n    widget: false\n});\n}());\n"
  },
  {
    "path": "src/mdl/package.json",
    "content": "{\n  \"name\": \"material-design-lite\",\n  \"version\": \"1.3.0\",\n  \"description\": \"Material Design Components in CSS, JS and HTML\",\n  \"private\": true,\n  \"license\": \"Apache-2.0\",\n  \"author\": \"Google\",\n  \"repository\": \"google/material-design-lite\",\n  \"main\": \"dist/material.min.js\",\n  \"devDependencies\": {\n    \"acorn\": \"^4.0.3\",\n    \"babel-core\": \"^6.20.0\",\n    \"babel-preset-es2015\": \"^6.18.0\",\n    \"browser-sync\": \"^2.2.3\",\n    \"chai\": \"^3.3.0\",\n    \"chai-jquery\": \"^2.0.0\",\n    \"del\": \"^2.0.2\",\n    \"drool\": \"^0.4.0\",\n    \"escodegen\": \"^1.6.1\",\n    \"google-closure-compiler\": \"\",\n    \"gulp\": \"^3.9.0\",\n    \"gulp-autoprefixer\": \"^3.0.2\",\n    \"gulp-cache\": \"^0.4.5\",\n    \"gulp-closure-compiler\": \"^0.4.0\",\n    \"gulp-concat\": \"^2.4.1\",\n    \"gulp-connect\": \"^5.0.0\",\n    \"gulp-css-inline-images\": \"^0.1.1\",\n    \"gulp-csso\": \"1.0.0\",\n    \"gulp-file\": \"^0.3.0\",\n    \"gulp-flatten\": \"^0.3.1\",\n    \"gulp-front-matter\": \"^1.2.2\",\n    \"gulp-header\": \"^1.2.2\",\n    \"gulp-if\": \"^2.0.0\",\n    \"gulp-iife\": \"^0.3.0\",\n    \"gulp-imagemin\": \"^3.1.0\",\n    \"gulp-jscs\": \"^4.0.0\",\n    \"gulp-jshint\": \"^2.0.4\",\n    \"gulp-load-plugins\": \"^1.3.0\",\n    \"gulp-marked\": \"^1.0.0\",\n    \"gulp-mocha-phantomjs\": \"^0.12.0\",\n    \"gulp-open\": \"^2.0.0\",\n    \"gulp-rename\": \"^1.2.0\",\n    \"gulp-replace\": \"^0.5.3\",\n    \"gulp-sass\": \"3.0.0\",\n    \"gulp-shell\": \"^0.5.2\",\n    \"gulp-size\": \"^2.0.0\",\n    \"gulp-sourcemaps\": \"^2.0.1\",\n    \"gulp-subtree\": \"^0.1.0\",\n    \"gulp-tap\": \"^0.1.3\",\n    \"gulp-uglify\": \"^2.0.0\",\n    \"gulp-util\": \"^3.0.4\",\n    \"gulp-zip\": \"^3.0.2\",\n    \"humanize\": \"0.0.9\",\n    \"jquery\": \"^3.1.1\",\n    \"jshint\": \"^2.9.4\",\n    \"jshint-stylish\": \"^2.2.1\",\n    \"merge-stream\": \"^1.0.0\",\n    \"mocha\": \"^3.0.2\",\n    \"prismjs\": \"0.0.1\",\n    \"run-sequence\": \"^1.0.2\",\n    \"swig\": \"^1.4.2\",\n    \"through2\": \"^2.0.0\",\n    \"vinyl-paths\": \"^2.0.0\"\n  },\n  \"engines\": {\n    \"node\": \">=0.12.0\"\n  },\n  \"scripts\": {\n    \"test\": \"gulp && git status | grep 'working directory clean' >/dev/null || (echo 'Please commit all changes generated by building'; exit 1)\"\n  },\n  \"babel\": {\n    \"only\": \"gulpfile.babel.js\",\n    \"presets\": [\n      \"es2015\"\n    ]\n  }\n}\n"
  },
  {
    "path": "src/preload.js",
    "content": "\nconst SequelizeAuto = require('sequelize-auto');\nconst { contextBridge, ipcRenderer } = require('electron/renderer')\n\ncontextBridge.exposeInMainWorld('electron', {\n  generate: (config, callback) => {\n    const {database, username, password, ...options} = config;\n    const auto = new SequelizeAuto(database, username, password, options);\n    auto.run().then(data => {\n      callback(data);\n    })\n  },\n  openDialog: () => ipcRenderer.invoke('dialog:open')\n});\n\n"
  },
  {
    "path": "src/renderer.js",
    "content": "const DB_CONFIG = 'DB_CONFIG'\nconst $progressBar = document.getElementById('progressBar');\nconst $exportBtn = document.getElementById('exportBtn');\nconst $directoryInput = document.getElementById('directory');\nconst $portInput = document.getElementById('port');\n\nconst DIALECT_PORTS = [\n  { dialect: 'mssql', port: 1433 },\n  { dialect: 'mysql', port: 3306 },\n  { dialect: 'mariadb', port: 3306 },\n  { dialect: 'postgres', port: 5432 },\n  { dialect: 'sqlite', port: null }\n]\n\ninit();\n\n/**\n * form input initial value process\n * @return\n */\nfunction init() {\n  let cacheConfig = localStorage.getItem(DB_CONFIG);\n  if (cacheConfig) {\n    try {\n      cacheConfig = JSON.parse(cacheConfig);\n      setFormData(cacheConfig);\n    } catch (e) {\n      console.log(e)\n    }\n  }\n}\n\nfunction handleSubmit(form) {\n  const config = getFormData(form);\n  console.log(config, 'config')\n  config.tables = config.tables ? config.tables.split(',') : '';\n  config.directory = config.directory || __dirname + '/models'\n\n  const genConfig = {\n    ...config,\n    caseFile: config.camelCase,\n    caseModel: config.camelCase,\n    caseProp: config.camelCase,\n    schema: config.schema ? config.schema : undefined,\n  }\n\n  if (config.dialect === 'postgres') {\n    genConfig.additional = {\n      schema: config.schema ? config.schema : 'public'\n    };\n  }\n  console.log(genConfig, 'genConfig')\n  $progressBar.style.display = \"block\";\n  $exportBtn.disabled = true;\n  window.electron.generate(genConfig, function () {\n    //set the configration to the localStorage when success\n    localStorage.setItem(DB_CONFIG, JSON.stringify(config));\n    $progressBar.style.display = \"none\";\n    $exportBtn.disabled = false;\n  })\n}\n\nasync function openFileDialog() {\n  $directoryInput.value = await window.electron.openDialog();\n}\n\nfunction getFormData(form) {\n  const data = {};\n  const inputs = form.getElementsByTagName('input')\n\n  for (let i = 0; i < inputs.length; i++) {\n    if (inputs[i].type == 'text' || inputs[i].type == 'password') {\n      data[inputs[i].name] = String(inputs[i].value)\n    } else if (inputs[i].type == 'radio' || inputs[i].type == 'checkbox') {\n      if (inputs[i].checked) {\n        data[inputs[i].name] = inputs[i].value;\n      }\n    }\n  }\n\n  return data;\n}\n\nfunction setFormData(data) {\n  const form = document.getElementsByTagName('form')[0];\n  const inputs = form.getElementsByTagName('input');\n  for (let i = 0; i < inputs.length; i++) {\n    if (inputs[i].type == 'text' || inputs[i].type == 'password') {\n      inputs[i].value = data[inputs[i].name] ? data[inputs[i].name] : ''\n    } else if (inputs[i].type == 'radio' || inputs[i].type == 'checkbox') {\n      if (data[inputs[i].name] == inputs[i].value) {\n        inputs[i].checked = true;\n      }\n    }\n  }\n}\n\nfunction onDialectChange(dialect) {\n  $portInput.value = DIALECT_PORTS.find(x => x.dialect === dialect).port\n}"
  }
]