1 | {"version":3,"sources":["webpack://mdc.[name]/webpack/universalModuleDefinition","webpack://mdc.[name]/webpack/bootstrap","webpack://mdc.[name]/./packages/mdc-base/component.ts","webpack://mdc.[name]/./packages/mdc-base/foundation.ts","webpack://mdc.[name]/./packages/mdc-dom/events.ts","webpack://mdc.[name]/./packages/mdc-dom/ponyfill.ts","webpack://mdc.[name]/./packages/mdc-ripple/component.ts","webpack://mdc.[name]/./packages/mdc-ripple/constants.ts","webpack://mdc.[name]/./packages/mdc-ripple/foundation.ts","webpack://mdc.[name]/./packages/mdc-ripple/util.ts","webpack://mdc.[name]/./packages/mdc-top-app-bar/adapter.ts","webpack://mdc.[name]/./packages/mdc-top-app-bar/component.ts","webpack://mdc.[name]/./packages/mdc-top-app-bar/constants.ts","webpack://mdc.[name]/./packages/mdc-top-app-bar/fixed/foundation.ts","webpack://mdc.[name]/./packages/mdc-top-app-bar/foundation.ts","webpack://mdc.[name]/./packages/mdc-top-app-bar/index.ts","webpack://mdc.[name]/./packages/mdc-top-app-bar/short/foundation.ts","webpack://mdc.[name]/./packages/mdc-top-app-bar/standard/foundation.ts"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AACh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;AACb,mBAAM,IAAQ,KAAgB,oBAAyB,sBAAE;AACpD,qBAAgB,kBAAwB;AAC5C,uBAAY;AACb;AACF;AAED,eACF;AAAC;AAIE;;;AACK,qCAAa,gBAArB;AACE,YAAQ,KAAiB,kBAAE;AACwE;AACJ;AAC7F,gBAAU,SAAO,KAAwB;AACzC,gBAAQ,KAAI,IAAQ,WAAQ,KAAgB,iBAAE;AACtC,yBAAG,CAAC,YAAO,QAAwB;AAC1C;AAEG,iBAAQ,QAAS,SAAM,OAAQ,SAAS;AAEhD;AAAC;AAKE;;;;AACK,qCAAsB,yBAA9B;AACE,YAAmB,gBAAO,KAAQ,QAAsB;AACxD,YAAQ,KAAgB,oBAAkB,eAAE;AACtC,iBAAU,YAAS;AAE4D;AACb;AACK;AACvE,iBAAuB,0BAAQ,KAAgB,kBAAiB;AAChE,iBAAgB,kBAAiB;AACtC;AACG,aACN;AAAC;AACH,WAAC;AAAA,EApK2C,aAoK3C;AApKY,iCAAsB;AAsK8E;AACjH,kBAAsC,uB","file":"mdc.topAppBar.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"@material/top-app-bar\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"top-app-bar\"] = factory();\n\telse\n\t\troot[\"mdc\"] = root[\"mdc\"] || {}, root[\"mdc\"][\"top-app-bar\"] = factory();\n})(this, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./packages/mdc-top-app-bar/index.ts\");\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from './foundation';\nimport {CustomEventListener, EventType, SpecificEventListener} from './types';\n\nexport class MDCComponent<FoundationType extends MDCFoundation> {\n static attachTo(root: Element): MDCComponent<MDCFoundation<{}>> {\n // Subclasses which extend MDCBase should provide an attachTo() method that takes a root element and\n // returns an instantiated component with its root set to that element. Also note that in the cases of\n // subclasses, an explicit foundation class will not have to be passed in; it will simply be initialized\n // from getDefaultFoundation().\n return new MDCComponent(root, new MDCFoundation({}));\n }\n\n protected foundation: FoundationType;\n\n constructor(\n public root: Element, foundation?: FoundationType, ...args: unknown[]) {\n this.initialize(...args);\n // Note that we initialize foundation here and not within the constructor's\n // default param so that this.root is defined and can be used within the\n // foundation class.\n this.foundation =\n foundation === undefined ? this.getDefaultFoundation() : foundation;\n this.foundation.init();\n this.initialSyncWithDOM();\n }\n\n /* istanbul ignore next: method param only exists for typing purposes; it does not need to be unit tested */\n initialize(..._args: Array<unknown>) {\n // Subclasses can override this to do any additional setup work that would be considered part of a\n // \"constructor\". Essentially, it is a hook into the parent constructor before the foundation is\n // initialized. Any additional arguments besides root and foundation will be passed in here.\n }\n\n getDefaultFoundation(): FoundationType {\n // Subclasses must override this method to return a properly configured foundation class for the\n // component.\n throw new Error('Subclasses must override getDefaultFoundation to return a properly configured ' +\n 'foundation class');\n }\n\n initialSyncWithDOM() {\n // Subclasses should override this method if they need to perform work to synchronize with a host DOM\n // object. An example of this would be a form control wrapper that needs to synchronize its internal state\n // to some property or attribute of the host DOM. Please note: this is *not* the place to perform DOM\n // reads/writes that would cause layout / paint, as this is called synchronously from within the constructor.\n }\n\n destroy() {\n // Subclasses may implement this method to release any resources / deregister any listeners they have\n // attached. An example of this might be deregistering a resize event from the window object.\n this.foundation.destroy();\n }\n\n /**\n * Wrapper method to add an event listener to the component's root element. This is most useful when\n * listening for custom events.\n */\n listen<K extends EventType>(\n evtType: K, handler: SpecificEventListener<K>, options?: AddEventListenerOptions | boolean): void;\n listen<E extends Event>(\n evtType: string, handler: CustomEventListener<E>, options?: AddEventListenerOptions | boolean): void;\n listen(evtType: string, handler: EventListener, options?: AddEventListenerOptions | boolean) {\n this.root.addEventListener(evtType, handler, options);\n }\n\n /**\n * Wrapper method to remove an event listener to the component's root element. This is most useful when\n * unlistening for custom events.\n */\n unlisten<K extends EventType>(\n evtType: K, handler: SpecificEventListener<K>, options?: AddEventListenerOptions | boolean): void;\n unlisten<E extends Event>(\n evtType: string, handler: CustomEventListener<E>, options?: AddEventListenerOptions | boolean): void;\n unlisten(evtType: string, handler: EventListener, options?: AddEventListenerOptions | boolean) {\n this.root.removeEventListener(evtType, handler, options);\n }\n\n /**\n * Fires a cross-browser-compatible custom event from the component root of the given type, with the given data.\n */\n emit<T extends object>(evtType: string, evtData: T, shouldBubble = false) {\n let evt: CustomEvent<T>;\n if (typeof CustomEvent === 'function') {\n evt = new CustomEvent<T>(evtType, {\n bubbles: shouldBubble,\n detail: evtData,\n });\n } else {\n evt = document.createEvent('CustomEvent');\n evt.initCustomEvent(evtType, shouldBubble, false, evtData);\n }\n\n this.root.dispatchEvent(evt);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCComponent;\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport class MDCFoundation<AdapterType extends {} = {}> {\n static get cssClasses(): { [key: string]: string } {\n // Classes extending MDCFoundation should implement this method to return an object which exports every\n // CSS class the foundation class needs as a property. e.g. {ACTIVE: 'mdc-component--active'}\n return {};\n }\n\n static get strings(): { [key: string]: string } {\n // Classes extending MDCFoundation should implement this method to return an object which exports all\n // semantic strings as constants. e.g. {ARIA_ROLE: 'tablist'}\n return {};\n }\n\n static get numbers(): { [key: string]: number } {\n // Classes extending MDCFoundation should implement this method to return an object which exports all\n // of its semantic numbers as constants. e.g. {ANIMATION_DELAY_MS: 350}\n return {};\n }\n\n static get defaultAdapter(): {} {\n // Classes extending MDCFoundation may choose to implement this getter in order to provide a convenient\n // way of viewing the necessary methods of an adapter. In the future, this could also be used for adapter\n // validation.\n return {};\n }\n\n constructor(protected adapter: AdapterType = {} as AdapterType) {}\n\n init() {\n // Subclasses should override this method to perform initialization routines (registering events, etc.)\n }\n\n destroy() {\n // Subclasses should override this method to perform de-initialization routines (de-registering events, etc.)\n }\n}\n\n/**\n * The constructor for MDCFoundation.\n */\nexport interface MDCFoundationConstructor<AdapterType extends object = any> {\n new(adapter: AdapterType): MDCFoundation<AdapterType>;\n readonly prototype: MDCFoundation<AdapterType>;\n}\n\n/**\n * The deprecated constructor for MDCFoundation.\n */\nexport interface MDCFoundationDeprecatedConstructor<AdapterType extends object = any> {\n readonly cssClasses: Record<string, string>;\n readonly strings: Record<string, string>;\n readonly numbers: Record<string, number>;\n readonly defaultAdapter: AdapterType;\n\n new(adapter?: Partial<AdapterType>): MDCFoundation<AdapterType>;\n readonly prototype: MDCFoundation<AdapterType>;\n}\n\n/**\n * Retrieves the AdapaterType from the provided MDCFoundation generic type.\n */\nexport type MDCFoundationAdapter<T> =\n T extends MDCFoundation<infer A>? A : never;\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * Determine whether the current browser supports passive event listeners, and\n * if so, use them.\n */\nexport function applyPassive(globalObj: Window = window):\n boolean | EventListenerOptions {\n return supportsPassiveOption(globalObj) ?\n {passive: true} as AddEventListenerOptions :\n false;\n}\n\nfunction supportsPassiveOption(globalObj: Window = window): boolean {\n // See\n // https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener\n let passiveSupported = false;\n\n try {\n const options = {\n // This function will be called when the browser\n // attempts to access the passive property.\n get passive() {\n passiveSupported = true;\n return false;\n }\n };\n\n const handler = () => {};\n globalObj.document.addEventListener('test', handler, options);\n globalObj.document.removeEventListener(\n 'test', handler, options as EventListenerOptions);\n } catch (err) {\n passiveSupported = false;\n }\n\n return passiveSupported;\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * @fileoverview A \"ponyfill\" is a polyfill that doesn't modify the global prototype chain.\n * This makes ponyfills safer than traditional polyfills, especially for libraries like MDC.\n */\n\nexport function closest(element: Element, selector: string): Element | null {\n if (element.closest) {\n return element.closest(selector);\n }\n\n let el: Element | null = element;\n while (el) {\n if (matches(el, selector)) {\n return el;\n }\n el = el.parentElement;\n }\n return null;\n}\n\nexport function matches(element: Element, selector: string): boolean {\n const nativeMatches = element.matches\n || element.webkitMatchesSelector\n || (element as any).msMatchesSelector;\n return nativeMatches.call(element, selector);\n}\n\n/**\n * Used to compute the estimated scroll width of elements. When an element is\n * hidden due to display: none; being applied to a parent element, the width is\n * returned as 0. However, the element will have a true width once no longer\n * inside a display: none context. This method computes an estimated width when\n * the element is hidden or returns the true width when the element is visble.\n * @param {Element} element the element whose width to estimate\n */\nexport function estimateScrollWidth(element: Element): number {\n // Check the offsetParent. If the element inherits display: none from any\n // parent, the offsetParent property will be null (see\n // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetParent).\n // This check ensures we only clone the node when necessary.\n const htmlEl = element as HTMLElement;\n if (htmlEl.offsetParent !== null) {\n return htmlEl.scrollWidth;\n }\n\n const clone = htmlEl.cloneNode(true) as HTMLElement;\n clone.style.setProperty('position', 'absolute');\n clone.style.setProperty('transform', 'translate(-9999px, -9999px)');\n document.documentElement.appendChild(clone);\n const scrollWidth = clone.scrollWidth;\n document.documentElement.removeChild(clone);\n return scrollWidth;\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {applyPassive} from '@material/dom/events';\nimport {matches} from '@material/dom/ponyfill';\nimport {MDCRippleAdapter} from './adapter';\nimport {MDCRippleFoundation} from './foundation';\nimport {MDCRippleAttachOpts, MDCRippleCapableSurface} from './types';\nimport * as util from './util';\n\nexport type MDCRippleFactory = (el: Element, foundation?: MDCRippleFoundation) => MDCRipple;\n\nexport class MDCRipple extends MDCComponent<MDCRippleFoundation> implements MDCRippleCapableSurface {\n static override attachTo(root: Element, opts: MDCRippleAttachOpts = {\n isUnbounded: undefined\n }): MDCRipple {\n const ripple = new MDCRipple(root);\n // Only override unbounded behavior if option is explicitly specified\n if (opts.isUnbounded !== undefined) {\n ripple.unbounded = opts.isUnbounded;\n }\n return ripple;\n }\n\n static createAdapter(instance: MDCRippleCapableSurface): MDCRippleAdapter {\n return {\n addClass: (className) => instance.root.classList.add(className),\n browserSupportsCssVars: () => util.supportsCssVariables(window),\n computeBoundingRect: () => instance.root.getBoundingClientRect(),\n containsEventTarget: (target) => instance.root.contains(target as Node),\n deregisterDocumentInteractionHandler: (evtType, handler) =>\n document.documentElement.removeEventListener(\n evtType, handler, applyPassive()),\n deregisterInteractionHandler: (evtType, handler) =>\n (instance.root as HTMLElement)\n .removeEventListener(evtType, handler, applyPassive()),\n deregisterResizeHandler: (handler) =>\n window.removeEventListener('resize', handler),\n getWindowPageOffset: () =>\n ({x: window.pageXOffset, y: window.pageYOffset}),\n isSurfaceActive: () => matches(instance.root, ':active'),\n isSurfaceDisabled: () => Boolean(instance.disabled),\n isUnbounded: () => Boolean(instance.unbounded),\n registerDocumentInteractionHandler: (evtType, handler) =>\n document.documentElement.addEventListener(\n evtType, handler, applyPassive()),\n registerInteractionHandler: (evtType, handler) =>\n (instance.root as HTMLElement)\n .addEventListener(evtType, handler, applyPassive()),\n registerResizeHandler: (handler) =>\n window.addEventListener('resize', handler),\n removeClass: (className) => instance.root.classList.remove(className),\n updateCssVariable: (varName, value) =>\n (instance.root as HTMLElement).style.setProperty(varName, value),\n };\n }\n\n disabled = false;\n\n private isUnbounded?: boolean;\n\n get unbounded(): boolean {\n return Boolean(this.isUnbounded);\n }\n\n set unbounded(unbounded: boolean) {\n this.isUnbounded = Boolean(unbounded);\n this.setUnbounded();\n }\n\n activate() {\n this.foundation.activate();\n }\n\n deactivate() {\n this.foundation.deactivate();\n }\n\n layout() {\n this.foundation.layout();\n }\n\n override getDefaultFoundation() {\n return new MDCRippleFoundation(MDCRipple.createAdapter(this));\n }\n\n override initialSyncWithDOM() {\n const root = this.root as HTMLElement;\n this.isUnbounded = 'mdcRippleIsUnbounded' in root.dataset;\n }\n\n /**\n * Closure Compiler throws an access control error when directly accessing a\n * protected or private property inside a getter/setter, like unbounded above.\n * By accessing the protected property inside a method, we solve that problem.\n * That's why this function exists.\n */\n private setUnbounded() {\n this.foundation.setUnbounded(Boolean(this.isUnbounded));\n }\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport const cssClasses = {\n // Ripple is a special case where the \"root\" component is really a \"mixin\" of sorts,\n // given that it's an 'upgrade' to an existing component. That being said it is the root\n // CSS class that all other CSS classes derive from.\n BG_FOCUSED: 'mdc-ripple-upgraded--background-focused',\n FG_ACTIVATION: 'mdc-ripple-upgraded--foreground-activation',\n FG_DEACTIVATION: 'mdc-ripple-upgraded--foreground-deactivation',\n ROOT: 'mdc-ripple-upgraded',\n UNBOUNDED: 'mdc-ripple-upgraded--unbounded',\n};\n\nexport const strings = {\n VAR_FG_SCALE: '--mdc-ripple-fg-scale',\n VAR_FG_SIZE: '--mdc-ripple-fg-size',\n VAR_FG_TRANSLATE_END: '--mdc-ripple-fg-translate-end',\n VAR_FG_TRANSLATE_START: '--mdc-ripple-fg-translate-start',\n VAR_LEFT: '--mdc-ripple-left',\n VAR_TOP: '--mdc-ripple-top',\n};\n\nexport const numbers = {\n DEACTIVATION_TIMEOUT_MS: 225, // Corresponds to $mdc-ripple-translate-duration (i.e. activation animation duration)\n FG_DEACTIVATION_MS: 150, // Corresponds to $mdc-ripple-fade-out-duration (i.e. deactivation animation duration)\n INITIAL_ORIGIN_SCALE: 0.6,\n PADDING: 10,\n TAP_DELAY_MS: 300, // Delay between touch and simulated mouse events on touch devices\n};\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCRippleAdapter} from './adapter';\nimport {cssClasses, numbers, strings} from './constants';\nimport {MDCRipplePoint} from './types';\nimport {getNormalizedEventCoords} from './util';\n\ninterface ActivationStateType {\n isActivated?: boolean;\n hasDeactivationUXRun?: boolean;\n wasActivatedByPointer?: boolean;\n wasElementMadeActive?: boolean;\n activationEvent?: Event;\n isProgrammatic?: boolean;\n}\n\ninterface FgTranslationCoordinates {\n startPoint: MDCRipplePoint;\n endPoint: MDCRipplePoint;\n}\n\ninterface Coordinates {\n left: number;\n top: number;\n}\n\ninterface EventHandlerNonNull {\n (event: Event): any;\n}\n\ntype ActivationEventType = 'touchstart' | 'pointerdown' | 'mousedown' | 'keydown';\ntype DeactivationEventType = 'touchend' | 'pointerup' | 'mouseup' | 'contextmenu';\n\n// Activation events registered on the root element of each instance for activation\nconst ACTIVATION_EVENT_TYPES: ActivationEventType[] = [\n 'touchstart', 'pointerdown', 'mousedown', 'keydown',\n];\n\n// Deactivation events registered on documentElement when a pointer-related down event occurs\nconst POINTER_DEACTIVATION_EVENT_TYPES: DeactivationEventType[] = [\n 'touchend', 'pointerup', 'mouseup', 'contextmenu',\n];\n\n// simultaneous nested activations\nlet activatedTargets: Array<EventTarget | null> = [];\n\nexport class MDCRippleFoundation extends MDCFoundation<MDCRippleAdapter> {\n static override get cssClasses() {\n return cssClasses;\n }\n\n static override get strings() {\n return strings;\n }\n\n static override get numbers() {\n return numbers;\n }\n\n static override get defaultAdapter(): MDCRippleAdapter {\n return {\n addClass: () => undefined,\n browserSupportsCssVars: () => true,\n computeBoundingRect: () =>\n ({top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0} as any),\n containsEventTarget: () => true,\n deregisterDocumentInteractionHandler: () => undefined,\n deregisterInteractionHandler: () => undefined,\n deregisterResizeHandler: () => undefined,\n getWindowPageOffset: () => ({x: 0, y: 0}),\n isSurfaceActive: () => true,\n isSurfaceDisabled: () => true,\n isUnbounded: () => true,\n registerDocumentInteractionHandler: () => undefined,\n registerInteractionHandler: () => undefined,\n registerResizeHandler: () => undefined,\n removeClass: () => undefined,\n updateCssVariable: () => undefined,\n };\n }\n\n private activationAnimationHasEnded = false;\n private activationState: ActivationStateType;\n private activationTimer = 0;\n private fgDeactivationRemovalTimer = 0;\n private fgScale = '0';\n private frame = {width: 0, height: 0};\n private initialSize = 0;\n private layoutFrame = 0;\n private maxRadius = 0;\n private unboundedCoords: Coordinates = {left: 0, top: 0};\n\n private readonly activationTimerCallback: () => void;\n private readonly activateHandler: EventHandlerNonNull;\n private readonly deactivateHandler: EventHandlerNonNull;\n private readonly focusHandler: EventHandlerNonNull;\n private readonly blurHandler: EventHandlerNonNull;\n private readonly resizeHandler: EventHandlerNonNull;\n\n private previousActivationEvent?: Event;\n\n constructor(adapter?: Partial<MDCRippleAdapter>) {\n super({...MDCRippleFoundation.defaultAdapter, ...adapter});\n\n this.activationState = this.defaultActivationState();\n\n this.activationTimerCallback = () => {\n this.activationAnimationHasEnded = true;\n this.runDeactivationUXLogicIfReady();\n };\n this.activateHandler = (e) => {\n this.activateImpl(e);\n };\n this.deactivateHandler = () => {\n this.deactivateImpl();\n };\n this.focusHandler = () => {\n this.handleFocus();\n };\n this.blurHandler = () => {\n this.handleBlur();\n };\n this.resizeHandler = () => {\n this.layout();\n };\n }\n\n override init() {\n const supportsPressRipple = this.supportsPressRipple();\n\n this.registerRootHandlers(supportsPressRipple);\n\n if (supportsPressRipple) {\n const {ROOT, UNBOUNDED} = MDCRippleFoundation.cssClasses;\n requestAnimationFrame(() => {\n this.adapter.addClass(ROOT);\n if (this.adapter.isUnbounded()) {\n this.adapter.addClass(UNBOUNDED);\n // Unbounded ripples need layout logic applied immediately to set coordinates for both shade and ripple\n this.layoutInternal();\n }\n });\n }\n }\n\n override destroy() {\n if (this.supportsPressRipple()) {\n if (this.activationTimer) {\n clearTimeout(this.activationTimer);\n this.activationTimer = 0;\n this.adapter.removeClass(MDCRippleFoundation.cssClasses.FG_ACTIVATION);\n }\n\n if (this.fgDeactivationRemovalTimer) {\n clearTimeout(this.fgDeactivationRemovalTimer);\n this.fgDeactivationRemovalTimer = 0;\n this.adapter.removeClass(\n MDCRippleFoundation.cssClasses.FG_DEACTIVATION);\n }\n\n const {ROOT, UNBOUNDED} = MDCRippleFoundation.cssClasses;\n requestAnimationFrame(() => {\n this.adapter.removeClass(ROOT);\n this.adapter.removeClass(UNBOUNDED);\n this.removeCssVars();\n });\n }\n\n this.deregisterRootHandlers();\n this.deregisterDeactivationHandlers();\n }\n\n /**\n * @param evt Optional event containing position information.\n */\n activate(evt?: Event): void {\n this.activateImpl(evt);\n }\n\n deactivate(): void {\n this.deactivateImpl();\n }\n\n layout(): void {\n if (this.layoutFrame) {\n cancelAnimationFrame(this.layoutFrame);\n }\n this.layoutFrame = requestAnimationFrame(() => {\n this.layoutInternal();\n this.layoutFrame = 0;\n });\n }\n\n setUnbounded(unbounded: boolean): void {\n const {UNBOUNDED} = MDCRippleFoundation.cssClasses;\n if (unbounded) {\n this.adapter.addClass(UNBOUNDED);\n } else {\n this.adapter.removeClass(UNBOUNDED);\n }\n }\n\n handleFocus(): void {\n requestAnimationFrame(\n () => this.adapter.addClass(MDCRippleFoundation.cssClasses.BG_FOCUSED));\n }\n\n handleBlur(): void {\n requestAnimationFrame(\n () => this.adapter.removeClass(\n MDCRippleFoundation.cssClasses.BG_FOCUSED));\n }\n\n /**\n * We compute this property so that we are not querying information about the client\n * until the point in time where the foundation requests it. This prevents scenarios where\n * client-side feature-detection may happen too early, such as when components are rendered on the server\n * and then initialized at mount time on the client.\n */\n private supportsPressRipple(): boolean {\n return this.adapter.browserSupportsCssVars();\n }\n\n private defaultActivationState(): ActivationStateType {\n return {\n activationEvent: undefined,\n hasDeactivationUXRun: false,\n isActivated: false,\n isProgrammatic: false,\n wasActivatedByPointer: false,\n wasElementMadeActive: false,\n };\n }\n\n /**\n * supportsPressRipple Passed from init to save a redundant function call\n */\n private registerRootHandlers(supportsPressRipple: boolean) {\n if (supportsPressRipple) {\n for (const evtType of ACTIVATION_EVENT_TYPES) {\n this.adapter.registerInteractionHandler(evtType, this.activateHandler);\n }\n if (this.adapter.isUnbounded()) {\n this.adapter.registerResizeHandler(this.resizeHandler);\n }\n }\n\n this.adapter.registerInteractionHandler('focus', this.focusHandler);\n this.adapter.registerInteractionHandler('blur', this.blurHandler);\n }\n\n private registerDeactivationHandlers(evt: Event) {\n if (evt.type === 'keydown') {\n this.adapter.registerInteractionHandler('keyup', this.deactivateHandler);\n } else {\n for (const evtType of POINTER_DEACTIVATION_EVENT_TYPES) {\n this.adapter.registerDocumentInteractionHandler(\n evtType, this.deactivateHandler);\n }\n }\n }\n\n private deregisterRootHandlers() {\n for (const evtType of ACTIVATION_EVENT_TYPES) {\n this.adapter.deregisterInteractionHandler(evtType, this.activateHandler);\n }\n this.adapter.deregisterInteractionHandler('focus', this.focusHandler);\n this.adapter.deregisterInteractionHandler('blur', this.blurHandler);\n\n if (this.adapter.isUnbounded()) {\n this.adapter.deregisterResizeHandler(this.resizeHandler);\n }\n }\n\n private deregisterDeactivationHandlers() {\n this.adapter.deregisterInteractionHandler('keyup', this.deactivateHandler);\n for (const evtType of POINTER_DEACTIVATION_EVENT_TYPES) {\n this.adapter.deregisterDocumentInteractionHandler(\n evtType, this.deactivateHandler);\n }\n }\n\n private removeCssVars() {\n const rippleStrings = MDCRippleFoundation.strings;\n const keys = Object.keys(rippleStrings) as Array<keyof typeof rippleStrings>;\n keys.forEach((key) => {\n if (key.indexOf('VAR_') === 0) {\n this.adapter.updateCssVariable(rippleStrings[key], null);\n }\n });\n }\n\n private activateImpl(evt?: Event) {\n if (this.adapter.isSurfaceDisabled()) {\n return;\n }\n\n const activationState = this.activationState;\n if (activationState.isActivated) {\n return;\n }\n\n // Avoid reacting to follow-on events fired by touch device after an already-processed user interaction\n const previousActivationEvent = this.previousActivationEvent;\n const isSameInteraction = previousActivationEvent && evt !== undefined && previousActivationEvent.type !== evt.type;\n if (isSameInteraction) {\n return;\n }\n\n activationState.isActivated = true;\n activationState.isProgrammatic = evt === undefined;\n activationState.activationEvent = evt;\n activationState.wasActivatedByPointer = activationState.isProgrammatic ? false : evt !== undefined && (\n evt.type === 'mousedown' || evt.type === 'touchstart' || evt.type === 'pointerdown'\n );\n\n const hasActivatedChild = evt !== undefined &&\n activatedTargets.length > 0 &&\n activatedTargets.some(\n (target) => this.adapter.containsEventTarget(target));\n if (hasActivatedChild) {\n // Immediately reset activation state, while preserving logic that prevents touch follow-on events\n this.resetActivationState();\n return;\n }\n\n if (evt !== undefined) {\n activatedTargets.push(evt.target);\n this.registerDeactivationHandlers(evt);\n }\n\n activationState.wasElementMadeActive = this.checkElementMadeActive(evt);\n if (activationState.wasElementMadeActive) {\n this.animateActivation();\n }\n\n requestAnimationFrame(() => {\n // Reset array on next frame after the current event has had a chance to bubble to prevent ancestor ripples\n activatedTargets = [];\n\n if (!activationState.wasElementMadeActive\n && evt !== undefined\n && ((evt as KeyboardEvent).key === ' ' || (evt as KeyboardEvent).keyCode === 32)) {\n // If space was pressed, try again within an rAF call to detect :active, because different UAs report\n // active states inconsistently when they're called within event handling code:\n // - https://bugs.chromium.org/p/chromium/issues/detail?id=635971\n // - https://bugzilla.mozilla.org/show_bug.cgi?id=1293741\n // We try first outside rAF to support Edge, which does not exhibit this problem, but will crash if a CSS\n // variable is set within a rAF callback for a submit button interaction (#2241).\n activationState.wasElementMadeActive = this.checkElementMadeActive(evt);\n if (activationState.wasElementMadeActive) {\n this.animateActivation();\n }\n }\n\n if (!activationState.wasElementMadeActive) {\n // Reset activation state immediately if element was not made active.\n this.activationState = this.defaultActivationState();\n }\n });\n }\n\n private checkElementMadeActive(evt?: Event) {\n return (evt !== undefined && evt.type === 'keydown') ?\n this.adapter.isSurfaceActive() :\n true;\n }\n\n private animateActivation() {\n const {VAR_FG_TRANSLATE_START, VAR_FG_TRANSLATE_END} = MDCRippleFoundation.strings;\n const {FG_DEACTIVATION, FG_ACTIVATION} = MDCRippleFoundation.cssClasses;\n const {DEACTIVATION_TIMEOUT_MS} = MDCRippleFoundation.numbers;\n\n this.layoutInternal();\n\n let translateStart = '';\n let translateEnd = '';\n\n if (!this.adapter.isUnbounded()) {\n const {startPoint, endPoint} = this.getFgTranslationCoordinates();\n translateStart = `${startPoint.x}px, ${startPoint.y}px`;\n translateEnd = `${endPoint.x}px, ${endPoint.y}px`;\n }\n\n this.adapter.updateCssVariable(VAR_FG_TRANSLATE_START, translateStart);\n this.adapter.updateCssVariable(VAR_FG_TRANSLATE_END, translateEnd);\n // Cancel any ongoing activation/deactivation animations\n clearTimeout(this.activationTimer);\n clearTimeout(this.fgDeactivationRemovalTimer);\n this.rmBoundedActivationClasses();\n this.adapter.removeClass(FG_DEACTIVATION);\n\n // Force layout in order to re-trigger the animation.\n this.adapter.computeBoundingRect();\n this.adapter.addClass(FG_ACTIVATION);\n this.activationTimer = setTimeout(() => {\n this.activationTimerCallback();\n }, DEACTIVATION_TIMEOUT_MS);\n }\n\n private getFgTranslationCoordinates(): FgTranslationCoordinates {\n const {activationEvent, wasActivatedByPointer} = this.activationState;\n\n let startPoint;\n if (wasActivatedByPointer) {\n startPoint = getNormalizedEventCoords(\n activationEvent,\n this.adapter.getWindowPageOffset(),\n this.adapter.computeBoundingRect(),\n );\n } else {\n startPoint = {\n x: this.frame.width / 2,\n y: this.frame.height / 2,\n };\n }\n // Center the element around the start point.\n startPoint = {\n x: startPoint.x - (this.initialSize / 2),\n y: startPoint.y - (this.initialSize / 2),\n };\n\n const endPoint = {\n x: (this.frame.width / 2) - (this.initialSize / 2),\n y: (this.frame.height / 2) - (this.initialSize / 2),\n };\n\n return {startPoint, endPoint};\n }\n\n private runDeactivationUXLogicIfReady() {\n // This method is called both when a pointing device is released, and when the activation animation ends.\n // The deactivation animation should only run after both of those occur.\n const {FG_DEACTIVATION} = MDCRippleFoundation.cssClasses;\n const {hasDeactivationUXRun, isActivated} = this.activationState;\n const activationHasEnded = hasDeactivationUXRun || !isActivated;\n\n if (activationHasEnded && this.activationAnimationHasEnded) {\n this.rmBoundedActivationClasses();\n this.adapter.addClass(FG_DEACTIVATION);\n this.fgDeactivationRemovalTimer = setTimeout(() => {\n this.adapter.removeClass(FG_DEACTIVATION);\n }, numbers.FG_DEACTIVATION_MS);\n }\n }\n\n private rmBoundedActivationClasses() {\n const {FG_ACTIVATION} = MDCRippleFoundation.cssClasses;\n this.adapter.removeClass(FG_ACTIVATION);\n this.activationAnimationHasEnded = false;\n this.adapter.computeBoundingRect();\n }\n\n private resetActivationState() {\n this.previousActivationEvent = this.activationState.activationEvent;\n this.activationState = this.defaultActivationState();\n // Touch devices may fire additional events for the same interaction within a short time.\n // Store the previous event until it's safe to assume that subsequent events are for new interactions.\n setTimeout(\n () => this.previousActivationEvent = undefined,\n MDCRippleFoundation.numbers.TAP_DELAY_MS);\n }\n\n private deactivateImpl(): void {\n const activationState = this.activationState;\n // This can happen in scenarios such as when you have a keyup event that blurs the element.\n if (!activationState.isActivated) {\n return;\n }\n\n const state: ActivationStateType = {...activationState};\n\n if (activationState.isProgrammatic) {\n requestAnimationFrame(() => {\n this.animateDeactivation(state);\n });\n this.resetActivationState();\n } else {\n this.deregisterDeactivationHandlers();\n requestAnimationFrame(() => {\n this.activationState.hasDeactivationUXRun = true;\n this.animateDeactivation(state);\n this.resetActivationState();\n });\n }\n }\n\n private animateDeactivation({wasActivatedByPointer, wasElementMadeActive}:\n ActivationStateType) {\n if (wasActivatedByPointer || wasElementMadeActive) {\n this.runDeactivationUXLogicIfReady();\n }\n }\n\n private layoutInternal() {\n this.frame = this.adapter.computeBoundingRect();\n const maxDim = Math.max(this.frame.height, this.frame.width);\n\n // Surface diameter is treated differently for unbounded vs. bounded ripples.\n // Unbounded ripple diameter is calculated smaller since the surface is expected to already be padded appropriately\n // to extend the hitbox, and the ripple is expected to meet the edges of the padded hitbox (which is typically\n // square). Bounded ripples, on the other hand, are fully expected to expand beyond the surface's longest diameter\n // (calculated based on the diagonal plus a constant padding), and are clipped at the surface's border via\n // `overflow: hidden`.\n const getBoundedRadius = () => {\n const hypotenuse = Math.sqrt(\n Math.pow(this.frame.width, 2) + Math.pow(this.frame.height, 2));\n return hypotenuse + MDCRippleFoundation.numbers.PADDING;\n };\n\n this.maxRadius = this.adapter.isUnbounded() ? maxDim : getBoundedRadius();\n\n // Ripple is sized as a fraction of the largest dimension of the surface, then scales up using a CSS scale transform\n const initialSize = Math.floor(maxDim * MDCRippleFoundation.numbers.INITIAL_ORIGIN_SCALE);\n // Unbounded ripple size should always be even number to equally center align.\n if (this.adapter.isUnbounded() && initialSize % 2 !== 0) {\n this.initialSize = initialSize - 1;\n } else {\n this.initialSize = initialSize;\n }\n this.fgScale = `${this.maxRadius / this.initialSize}`;\n\n this.updateLayoutCssVars();\n }\n\n private updateLayoutCssVars() {\n const {\n VAR_FG_SIZE, VAR_LEFT, VAR_TOP, VAR_FG_SCALE,\n } = MDCRippleFoundation.strings;\n\n this.adapter.updateCssVariable(VAR_FG_SIZE, `${this.initialSize}px`);\n this.adapter.updateCssVariable(VAR_FG_SCALE, this.fgScale);\n\n if (this.adapter.isUnbounded()) {\n this.unboundedCoords = {\n left: Math.round((this.frame.width / 2) - (this.initialSize / 2)),\n top: Math.round((this.frame.height / 2) - (this.initialSize / 2)),\n };\n\n this.adapter.updateCssVariable(\n VAR_LEFT, `${this.unboundedCoords.left}px`);\n this.adapter.updateCssVariable(VAR_TOP, `${this.unboundedCoords.top}px`);\n }\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCRippleFoundation;\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport {MDCRipplePoint} from './types';\n\n/**\n * Stores result from supportsCssVariables to avoid redundant processing to\n * detect CSS custom variable support.\n */\nlet supportsCssVariables_: boolean | undefined;\n\nexport function supportsCssVariables(windowObj: typeof globalThis, forceRefresh = false): boolean {\n const {CSS} = windowObj;\n let supportsCssVars = supportsCssVariables_;\n if (typeof supportsCssVariables_ === 'boolean' && !forceRefresh) {\n return supportsCssVariables_;\n }\n\n const supportsFunctionPresent = CSS && typeof CSS.supports === 'function';\n if (!supportsFunctionPresent) {\n return false;\n }\n\n const explicitlySupportsCssVars = CSS.supports('--css-vars', 'yes');\n // See: https://bugs.webkit.org/show_bug.cgi?id=154669\n // See: README section on Safari\n const weAreFeatureDetectingSafari10plus = (\n CSS.supports('(--css-vars: yes)') &&\n CSS.supports('color', '#00000000')\n );\n\n supportsCssVars =\n explicitlySupportsCssVars || weAreFeatureDetectingSafari10plus;\n\n if (!forceRefresh) {\n supportsCssVariables_ = supportsCssVars;\n }\n return supportsCssVars;\n}\n\nexport function getNormalizedEventCoords(evt: Event | undefined, pageOffset: MDCRipplePoint, clientRect: DOMRect):\n MDCRipplePoint {\n if (!evt) {\n return {x: 0, y: 0};\n }\n const {x, y} = pageOffset;\n const documentX = x + clientRect.left;\n const documentY = y + clientRect.top;\n\n let normalizedX;\n let normalizedY;\n // Determine touch point relative to the ripple container.\n if (evt.type === 'touchstart') {\n const touchEvent = evt as TouchEvent;\n normalizedX = touchEvent.changedTouches[0].pageX - documentX;\n normalizedY = touchEvent.changedTouches[0].pageY - documentY;\n } else {\n const mouseEvent = evt as MouseEvent;\n normalizedX = mouseEvent.pageX - documentX;\n normalizedY = mouseEvent.pageY - documentY;\n }\n\n return {x: normalizedX, y: normalizedY};\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * Defines the shape of the adapter expected by the foundation.\n * Implement this adapter for your framework of choice to delegate updates to\n * the component in your framework of choice. See architecture documentation\n * for more details.\n * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md\n */\nexport interface MDCTopAppBarAdapter {\n /**\n * Adds a class to the root Element.\n */\n addClass(className: string): void;\n\n /**\n * Removes a class from the root Element.\n */\n removeClass(className: string): void;\n\n /**\n * Returns true if the root Element contains the given class.\n */\n hasClass(className: string): boolean;\n\n /**\n * Sets the specified inline style property on the root Element to the given value.\n */\n setStyle(property: string, value: string): void;\n\n /**\n * Gets the height of the top app bar.\n */\n getTopAppBarHeight(): number;\n\n getViewportScrollY(): number;\n\n getTotalActionItems(): number;\n\n /**\n * Emits an event when the navigation icon is clicked.\n */\n notifyNavigationIconClicked(): void;\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {SpecificEventListener} from '@material/base/types';\nimport {MDCRipple, MDCRippleFactory} from '@material/ripple/component';\nimport {MDCTopAppBarAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\nimport {MDCFixedTopAppBarFoundation} from './fixed/foundation';\nimport {MDCTopAppBarBaseFoundation} from './foundation';\nimport {MDCShortTopAppBarFoundation} from './short/foundation';\nimport {MDCTopAppBarFoundation} from './standard/foundation';\n\nexport class MDCTopAppBar extends MDCComponent<MDCTopAppBarBaseFoundation> {\n static override attachTo(root: Element): MDCTopAppBar {\n return new MDCTopAppBar(root);\n }\n\n private handleNavigationClick!:\n SpecificEventListener<'click'>; // assigned in initialSyncWithDOM()\n private handleWindowResize!:\n SpecificEventListener<'resize'>; // assigned in initialSyncWithDOM()\n private handleTargetScroll!:\n SpecificEventListener<'scroll'>; // assigned in initialSyncWithDOM()\n private navIcon!: Element|null;\n private iconRipples!: MDCRipple[];\n private scrollTarget!: EventTarget;\n\n override initialize(\n rippleFactory: MDCRippleFactory = (el) => MDCRipple.attachTo(el)) {\n this.navIcon = this.root.querySelector(strings.NAVIGATION_ICON_SELECTOR);\n\n // Get all icons in the toolbar and instantiate the ripples\n const icons: Element[] =\n [].slice.call(this.root.querySelectorAll(strings.ACTION_ITEM_SELECTOR));\n if (this.navIcon) {\n icons.push(this.navIcon);\n }\n\n this.iconRipples = icons.map((icon) => {\n const ripple = rippleFactory(icon);\n ripple.unbounded = true;\n return ripple;\n });\n\n this.scrollTarget = window;\n }\n\n override initialSyncWithDOM() {\n this.handleNavigationClick =\n this.foundation.handleNavigationClick.bind(this.foundation);\n this.handleWindowResize =\n this.foundation.handleWindowResize.bind(this.foundation);\n this.handleTargetScroll =\n this.foundation.handleTargetScroll.bind(this.foundation);\n\n this.scrollTarget.addEventListener(\n 'scroll', this.handleTargetScroll as EventListener);\n\n if (this.navIcon) {\n this.navIcon.addEventListener(\n 'click', this.handleNavigationClick as EventListener);\n }\n\n const isFixed = this.root.classList.contains(cssClasses.FIXED_CLASS);\n const isShort = this.root.classList.contains(cssClasses.SHORT_CLASS);\n if (!isShort && !isFixed) {\n window.addEventListener(\n 'resize', this.handleWindowResize as EventListener);\n }\n }\n\n override destroy() {\n for (const iconRipple of this.iconRipples) {\n iconRipple.destroy();\n }\n this.scrollTarget.removeEventListener(\n 'scroll', this.handleTargetScroll as EventListener);\n if (this.navIcon) {\n this.navIcon.removeEventListener(\n 'click', this.handleNavigationClick as EventListener);\n }\n const isFixed = this.root.classList.contains(cssClasses.FIXED_CLASS);\n const isShort = this.root.classList.contains(cssClasses.SHORT_CLASS);\n if (!isShort && !isFixed) {\n window.removeEventListener(\n 'resize', this.handleWindowResize as EventListener);\n }\n super.destroy();\n }\n\n setScrollTarget(target: EventTarget) {\n // Remove scroll handler from the previous scroll target\n this.scrollTarget.removeEventListener(\n 'scroll', this.handleTargetScroll as EventListener);\n\n this.scrollTarget = target;\n\n // Initialize scroll handler on the new scroll target\n this.handleTargetScroll =\n this.foundation.handleTargetScroll.bind(this.foundation);\n this.scrollTarget.addEventListener(\n 'scroll', this.handleTargetScroll as EventListener);\n }\n\n override getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCTopAppBarAdapter = {\n hasClass: (className) => this.root.classList.contains(className),\n addClass: (className) => this.root.classList.add(className),\n removeClass: (className) => this.root.classList.remove(className),\n setStyle: (property, value) =>\n (this.root as HTMLElement).style.setProperty(property, value),\n getTopAppBarHeight: () => this.root.clientHeight,\n notifyNavigationIconClicked: () =>\n this.emit(strings.NAVIGATION_EVENT, {}),\n getViewportScrollY: () => {\n const win = this.scrollTarget as Window;\n const el = this.scrollTarget as Element;\n return win.pageYOffset !== undefined ? win.pageYOffset : el.scrollTop;\n },\n getTotalActionItems: () =>\n this.root.querySelectorAll(strings.ACTION_ITEM_SELECTOR).length,\n };\n // tslint:enable:object-literal-sort-keys\n\n let foundation: MDCTopAppBarBaseFoundation;\n if (this.root.classList.contains(cssClasses.SHORT_CLASS)) {\n foundation = new MDCShortTopAppBarFoundation(adapter);\n } else if (this.root.classList.contains(cssClasses.FIXED_CLASS)) {\n foundation = new MDCFixedTopAppBarFoundation(adapter);\n } else {\n foundation = new MDCTopAppBarFoundation(adapter);\n }\n\n return foundation;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst cssClasses = {\n FIXED_CLASS: 'mdc-top-app-bar--fixed',\n FIXED_SCROLLED_CLASS: 'mdc-top-app-bar--fixed-scrolled',\n SHORT_CLASS: 'mdc-top-app-bar--short',\n SHORT_COLLAPSED_CLASS: 'mdc-top-app-bar--short-collapsed',\n SHORT_HAS_ACTION_ITEM_CLASS: 'mdc-top-app-bar--short-has-action-item',\n};\n\nconst numbers = {\n DEBOUNCE_THROTTLE_RESIZE_TIME_MS: 100,\n MAX_TOP_APP_BAR_HEIGHT: 128,\n};\n\nconst strings = {\n ACTION_ITEM_SELECTOR: '.mdc-top-app-bar__action-item',\n NAVIGATION_EVENT: 'MDCTopAppBar:nav',\n NAVIGATION_ICON_SELECTOR: '.mdc-top-app-bar__navigation-icon',\n ROOT_SELECTOR: '.mdc-top-app-bar',\n TITLE_SELECTOR: '.mdc-top-app-bar__title',\n};\n\nexport {cssClasses, numbers, strings};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {cssClasses} from '../constants';\nimport {MDCTopAppBarFoundation} from '../standard/foundation';\n\nexport class MDCFixedTopAppBarFoundation extends MDCTopAppBarFoundation {\n /**\n * State variable for the previous scroll iteration top app bar state\n */\n private wasScrolled = false;\n\n /**\n * Scroll handler for applying/removing the modifier class on the fixed top app bar.\n */\n override handleTargetScroll() {\n const currentScroll = this.adapter.getViewportScrollY();\n\n if (currentScroll <= 0) {\n if (this.wasScrolled) {\n this.adapter.removeClass(cssClasses.FIXED_SCROLLED_CLASS);\n this.wasScrolled = false;\n }\n } else {\n if (!this.wasScrolled) {\n this.adapter.addClass(cssClasses.FIXED_SCROLLED_CLASS);\n this.wasScrolled = true;\n }\n }\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCFixedTopAppBarFoundation;\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCTopAppBarAdapter} from './adapter';\nimport {cssClasses, numbers, strings} from './constants';\n\nexport class MDCTopAppBarBaseFoundation extends MDCFoundation<MDCTopAppBarAdapter> {\n static override get strings() {\n return strings;\n }\n\n static override get cssClasses() {\n return cssClasses;\n }\n\n static override get numbers() {\n return numbers;\n }\n\n /**\n * See {@link MDCTopAppBarAdapter} for typing information on parameters and return types.\n */\n static override get defaultAdapter(): MDCTopAppBarAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: () => undefined,\n removeClass: () => undefined,\n hasClass: () => false,\n setStyle: () => undefined,\n getTopAppBarHeight: () => 0,\n notifyNavigationIconClicked: () => undefined,\n getViewportScrollY: () => 0,\n getTotalActionItems: () => 0,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n /* istanbul ignore next: optional argument is not a branch statement */\n constructor(adapter?: Partial<MDCTopAppBarAdapter>) {\n super({...MDCTopAppBarBaseFoundation.defaultAdapter, ...adapter});\n }\n\n /** Other variants of TopAppBar foundation overrides this method */\n handleTargetScroll() {} // tslint:disable-line:no-empty\n /** Other variants of TopAppBar foundation overrides this method */\n handleWindowResize() {} // tslint:disable-line:no-empty\n\n handleNavigationClick() {\n this.adapter.notifyNavigationIconClicked();\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTopAppBarBaseFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './fixed/foundation';\nexport * from './short/foundation';\nexport * from './standard/foundation';\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCTopAppBarAdapter} from '../adapter';\nimport {cssClasses} from '../constants';\nimport {MDCTopAppBarBaseFoundation} from '../foundation';\n\nexport class MDCShortTopAppBarFoundation extends MDCTopAppBarBaseFoundation {\n // Public visibility for backward compatibility.\n get isCollapsed(): boolean {\n return this.collapsed;\n }\n\n private collapsed = false;\n\n private isAlwaysCollapsed = false;\n\n /* istanbul ignore next: optional argument is not a branch statement */\n constructor(adapter?: Partial<MDCTopAppBarAdapter>) {\n super(adapter);\n }\n\n override init() {\n super.init();\n\n if (this.adapter.getTotalActionItems() > 0) {\n this.adapter.addClass(cssClasses.SHORT_HAS_ACTION_ITEM_CLASS);\n }\n\n // If initialized with SHORT_COLLAPSED_CLASS, the bar should always be collapsed\n this.setAlwaysCollapsed(\n this.adapter.hasClass(cssClasses.SHORT_COLLAPSED_CLASS));\n }\n\n /**\n * Set if the short top app bar should always be collapsed.\n *\n * @param value When `true`, bar will always be collapsed. When `false`, bar may collapse or expand based on scroll.\n */\n setAlwaysCollapsed(value: boolean) {\n this.isAlwaysCollapsed = !!value;\n if (this.isAlwaysCollapsed) {\n this.collapse();\n } else {\n // let maybeCollapseBar determine if the bar should be collapsed\n this.maybeCollapseBar();\n }\n }\n\n getAlwaysCollapsed() {\n return this.isAlwaysCollapsed;\n }\n\n /**\n * Scroll handler for applying/removing the collapsed modifier class on the short top app bar.\n */\n override handleTargetScroll() {\n this.maybeCollapseBar();\n }\n\n private maybeCollapseBar() {\n if (this.isAlwaysCollapsed) {\n return;\n }\n const currentScroll = this.adapter.getViewportScrollY();\n\n if (currentScroll <= 0) {\n if (this.collapsed) {\n this.uncollapse();\n }\n } else {\n if (!this.collapsed) {\n this.collapse();\n }\n }\n }\n\n private uncollapse() {\n this.adapter.removeClass(cssClasses.SHORT_COLLAPSED_CLASS);\n this.collapsed = false;\n }\n\n private collapse() {\n this.adapter.addClass(cssClasses.SHORT_COLLAPSED_CLASS);\n this.collapsed = true;\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCShortTopAppBarFoundation;\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCTopAppBarAdapter} from '../adapter';\nimport {numbers} from '../constants';\nimport {MDCTopAppBarBaseFoundation} from '../foundation';\n\nconst INITIAL_VALUE = 0;\n\nexport class MDCTopAppBarFoundation extends MDCTopAppBarBaseFoundation {\n /**\n * Indicates if the top app bar was docked in the previous scroll handler iteration.\n */\n private wasDocked = true;\n\n /**\n * Indicates if the top app bar is docked in the fully shown position.\n */\n private isDockedShowing = true;\n\n /**\n * Variable for current scroll position of the top app bar\n */\n private currentAppBarOffsetTop = 0;\n\n /**\n * Used to prevent the top app bar from being scrolled out of view during resize events\n */\n private isCurrentlyBeingResized = false;\n\n /**\n * The timeout that's used to throttle the resize events\n */\n private resizeThrottleId = INITIAL_VALUE;\n\n /**\n * Used for diffs of current scroll position vs previous scroll position\n */\n private lastScrollPosition: number;\n\n /**\n * Used to verify when the top app bar is completely showing or completely hidden\n */\n private topAppBarHeight: number;\n\n /**\n * The timeout that's used to debounce toggling the isCurrentlyBeingResized\n * variable after a resize\n */\n private resizeDebounceId = INITIAL_VALUE;\n\n /* istanbul ignore next: optional argument is not a branch statement */\n constructor(adapter?: Partial<MDCTopAppBarAdapter>) {\n super(adapter);\n\n this.lastScrollPosition = this.adapter.getViewportScrollY();\n this.topAppBarHeight = this.adapter.getTopAppBarHeight();\n }\n\n override destroy() {\n super.destroy();\n this.adapter.setStyle('top', '');\n }\n\n /**\n * Scroll handler for the default scroll behavior of the top app bar.\n */\n override handleTargetScroll() {\n const currentScrollPosition = Math.max(this.adapter.getViewportScrollY(), 0);\n const diff = currentScrollPosition - this.lastScrollPosition;\n this.lastScrollPosition = currentScrollPosition;\n\n // If the window is being resized the lastScrollPosition needs to be updated\n // but the current scroll of the top app bar should stay in the same\n // position.\n if (!this.isCurrentlyBeingResized) {\n this.currentAppBarOffsetTop -= diff;\n\n if (this.currentAppBarOffsetTop > 0) {\n this.currentAppBarOffsetTop = 0;\n } else if (Math.abs(this.currentAppBarOffsetTop) > this.topAppBarHeight) {\n this.currentAppBarOffsetTop = -this.topAppBarHeight;\n }\n\n this.moveTopAppBar();\n }\n }\n\n /**\n * Top app bar resize handler that throttle/debounce functions that execute updates.\n */\n override handleWindowResize() {\n // Throttle resize events 10 p/s\n if (!this.resizeThrottleId) {\n this.resizeThrottleId = setTimeout(() => {\n this.resizeThrottleId = INITIAL_VALUE;\n this.throttledResizeHandler();\n }, numbers.DEBOUNCE_THROTTLE_RESIZE_TIME_MS);\n }\n\n this.isCurrentlyBeingResized = true;\n\n if (this.resizeDebounceId) {\n clearTimeout(this.resizeDebounceId);\n }\n\n this.resizeDebounceId = setTimeout(() => {\n this.handleTargetScroll();\n this.isCurrentlyBeingResized = false;\n this.resizeDebounceId = INITIAL_VALUE;\n }, numbers.DEBOUNCE_THROTTLE_RESIZE_TIME_MS);\n }\n\n /**\n * Function to determine if the DOM needs to update.\n */\n private checkForUpdate(): boolean {\n const offscreenBoundaryTop = -this.topAppBarHeight;\n const hasAnyPixelsOffscreen = this.currentAppBarOffsetTop < 0;\n const hasAnyPixelsOnscreen =\n this.currentAppBarOffsetTop > offscreenBoundaryTop;\n const partiallyShowing = hasAnyPixelsOffscreen && hasAnyPixelsOnscreen;\n\n // If it's partially showing, it can't be docked.\n if (partiallyShowing) {\n this.wasDocked = false;\n } else {\n // Not previously docked and not partially showing, it's now docked.\n if (!this.wasDocked) {\n this.wasDocked = true;\n return true;\n } else if (this.isDockedShowing !== hasAnyPixelsOnscreen) {\n this.isDockedShowing = hasAnyPixelsOnscreen;\n return true;\n }\n }\n\n return partiallyShowing;\n }\n\n /**\n * Function to move the top app bar if needed.\n */\n private moveTopAppBar() {\n if (this.checkForUpdate()) {\n // Once the top app bar is fully hidden we use the max potential top app bar height as our offset\n // so the top app bar doesn't show if the window resizes and the new height > the old height.\n let offset = this.currentAppBarOffsetTop;\n if (Math.abs(offset) >= this.topAppBarHeight) {\n offset = -numbers.MAX_TOP_APP_BAR_HEIGHT;\n }\n\n this.adapter.setStyle('top', offset + 'px');\n }\n }\n\n /**\n * Throttled function that updates the top app bar scrolled values if the\n * top app bar height changes.\n */\n private throttledResizeHandler() {\n const currentHeight = this.adapter.getTopAppBarHeight();\n if (this.topAppBarHeight !== currentHeight) {\n this.wasDocked = false;\n\n // Since the top app bar has a different height depending on the screen width, this\n // will ensure that the top app bar remains in the correct location if\n // completely hidden and a resize makes the top app bar a different height.\n this.currentAppBarOffsetTop -= this.topAppBarHeight - currentHeight;\n this.topAppBarHeight = currentHeight;\n }\n this.handleTargetScroll();\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTopAppBarFoundation;\n"],"sourceRoot":""} |