@angular/cdk
Version:
Angular Material Component Development Kit
45 lines • 30.4 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/common"),require("@angular/core"),require("tslib"),require("rxjs"),require("@angular/cdk/keycodes"),require("rxjs/operators"),require("@angular/cdk/coercion"),require("@angular/cdk/platform"),require("@angular/cdk/observers")):"function"==typeof define&&define.amd?define("@angular/cdk/a11y",["exports","@angular/common","@angular/core","tslib","rxjs","@angular/cdk/keycodes","rxjs/operators","@angular/cdk/coercion","@angular/cdk/platform","@angular/cdk/observers"],t):t(((e=e||self).ng=e.ng||{},e.ng.cdk=e.ng.cdk||{},e.ng.cdk.a11Y={}),e.ng.common,e.ng.core,e.tslib,e.rxjs,e.ng.cdk.keycodes,e.rxjs.operators,e.ng.cdk.coercion,e.ng.cdk.platform,e.ng.cdk.observers)}(this,(function(e,t,n,r,i,o,s,c,a,u){"use strict";
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/function d(e,t){return(e.getAttribute(t)||"").match(/\S+/g)||[]}
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/var h=0,l=new Map,p=null,f=function(){function e(e){this._document=e}return e.prototype.describe=function(e,t){this._canBeDescribed(e,t)&&("string"!=typeof t?(this._setMessageId(t),l.set(t,{messageElement:t,referenceCount:0})):l.has(t)||this._createMessageElement(t),this._isElementDescribedByMessage(e,t)||this._addMessageReference(e,t))},e.prototype.removeDescription=function(e,t){if(this._isElementNode(e)){if(this._isElementDescribedByMessage(e,t)&&this._removeMessageReference(e,t),"string"==typeof t){var n=l.get(t);n&&0===n.referenceCount&&this._deleteMessageElement(t)}p&&0===p.childNodes.length&&this._deleteMessagesContainer()}},e.prototype.ngOnDestroy=function(){for(var e=this._document.querySelectorAll("[cdk-describedby-host]"),t=0;t<e.length;t++)this._removeCdkDescribedByReferenceIds(e[t]),e[t].removeAttribute("cdk-describedby-host");p&&this._deleteMessagesContainer(),l.clear()},e.prototype._createMessageElement=function(e){var t=this._document.createElement("div");this._setMessageId(t),t.textContent=e,this._createMessagesContainer(),p.appendChild(t),l.set(e,{messageElement:t,referenceCount:0})},e.prototype._setMessageId=function(e){e.id||(e.id="cdk-describedby-message-"+h++)},e.prototype._deleteMessageElement=function(e){var t=l.get(e),n=t&&t.messageElement;p&&n&&p.removeChild(n),l.delete(e)},e.prototype._createMessagesContainer=function(){if(!p){var e=this._document.getElementById("cdk-describedby-message-container");e&&e.parentNode.removeChild(e),(p=this._document.createElement("div")).id="cdk-describedby-message-container",p.setAttribute("aria-hidden","true"),p.style.display="none",this._document.body.appendChild(p)}},e.prototype._deleteMessagesContainer=function(){p&&p.parentNode&&(p.parentNode.removeChild(p),p=null)},e.prototype._removeCdkDescribedByReferenceIds=function(e){var t=d(e,"aria-describedby").filter((function(e){return 0!=e.indexOf("cdk-describedby-message")}));e.setAttribute("aria-describedby",t.join(" "))},e.prototype._addMessageReference=function(e,t){var n=l.get(t);!function r(e,t,n){var r=d(e,t);r.some((function(e){return e.trim()==n.trim()}))||(r.push(n.trim()),e.setAttribute(t,r.join(" ")))}(e,"aria-describedby",n.messageElement.id),e.setAttribute("cdk-describedby-host",""),n.referenceCount++},e.prototype._removeMessageReference=function(e,t){var n=l.get(t);n.referenceCount--,function r(e,t,n){var r=d(e,t).filter((function(e){return e!=n.trim()}));r.length?e.setAttribute(t,r.join(" ")):e.removeAttribute(t)}(e,"aria-describedby",n.messageElement.id),e.removeAttribute("cdk-describedby-host")},e.prototype._isElementDescribedByMessage=function(e,t){var n=d(e,"aria-describedby"),r=l.get(t),i=r&&r.messageElement.id;return!!i&&-1!=n.indexOf(i)},e.prototype._canBeDescribed=function(e,t){if(!this._isElementNode(e))return!1;if(t&&"object"==typeof t)return!0;var n=null==t?"":(""+t).trim(),r=e.getAttribute("aria-label");return!(!n||r&&r.trim()===n)},e.prototype._isElementNode=function(e){return e.nodeType===this._document.ELEMENT_NODE},e.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:void 0,decorators:[{type:n.Inject,args:[t.DOCUMENT]}]}]},e.ɵprov=n.ɵɵdefineInjectable({factory:function r(){return new e(n.ɵɵinject(t.DOCUMENT))},token:e,providedIn:"root"}),e}(),m=function(){function e(e){var t=this;this._items=e,this._activeItemIndex=-1,this._activeItem=null,this._wrap=!1,this._letterKeyStream=new i.Subject,this._typeaheadSubscription=i.Subscription.EMPTY,this._vertical=!0,this._allowedModifierKeys=[],this._skipPredicateFn=function(e){return e.disabled},this._pressedLetters=[],this.tabOut=new i.Subject,this.change=new i.Subject,e instanceof n.QueryList&&e.changes.subscribe((function(e){if(t._activeItem){var n=e.toArray().indexOf(t._activeItem);n>-1&&n!==t._activeItemIndex&&(t._activeItemIndex=n)}}))}return e.prototype.skipPredicate=function(e){return this._skipPredicateFn=e,this},e.prototype.withWrap=function(e){return void 0===e&&(e=!0),this._wrap=e,this},e.prototype.withVerticalOrientation=function(e){return void 0===e&&(e=!0),this._vertical=e,this},e.prototype.withHorizontalOrientation=function(e){return this._horizontal=e,this},e.prototype.withAllowedModifierKeys=function(e){return this._allowedModifierKeys=e,this},e.prototype.withTypeAhead=function(e){var t=this;if(void 0===e&&(e=200),this._items.length&&this._items.some((function(e){return"function"!=typeof e.getLabel})))throw Error("ListKeyManager items in typeahead mode must implement the `getLabel` method.");return this._typeaheadSubscription.unsubscribe(),this._typeaheadSubscription=this._letterKeyStream.pipe(s.tap((function(e){return t._pressedLetters.push(e)})),s.debounceTime(e),s.filter((function(){return t._pressedLetters.length>0})),s.map((function(){return t._pressedLetters.join("")}))).subscribe((function(e){for(var n=t._getItemsArray(),r=1;r<n.length+1;r++){var i=(t._activeItemIndex+r)%n.length,o=n[i];if(!t._skipPredicateFn(o)&&0===o.getLabel().toUpperCase().trim().indexOf(e)){t.setActiveItem(i);break}}t._pressedLetters=[]})),this},e.prototype.setActiveItem=function(e){var t=this._activeItemIndex;this.updateActiveItem(e),this._activeItemIndex!==t&&this.change.next(this._activeItemIndex)},e.prototype.onKeydown=function(e){var t=this,n=e.keyCode,r=["altKey","ctrlKey","metaKey","shiftKey"].every((function(n){return!e[n]||t._allowedModifierKeys.indexOf(n)>-1}));switch(n){case o.TAB:return void this.tabOut.next();case o.DOWN_ARROW:if(this._vertical&&r){this.setNextItemActive();break}return;case o.UP_ARROW:if(this._vertical&&r){this.setPreviousItemActive();break}return;case o.RIGHT_ARROW:if(this._horizontal&&r){"rtl"===this._horizontal?this.setPreviousItemActive():this.setNextItemActive();break}return;case o.LEFT_ARROW:if(this._horizontal&&r){"rtl"===this._horizontal?this.setNextItemActive():this.setPreviousItemActive();break}return;default:return void((r||o.hasModifierKey(e,"shiftKey"))&&(e.key&&1===e.key.length?this._letterKeyStream.next(e.key.toLocaleUpperCase()):(n>=o.A&&n<=o.Z||n>=o.ZERO&&n<=o.NINE)&&this._letterKeyStream.next(String.fromCharCode(n))))}this._pressedLetters=[],e.preventDefault()},Object.defineProperty(e.prototype,"activeItemIndex",{get:function(){return this._activeItemIndex},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeItem",{get:function(){return this._activeItem},enumerable:!0,configurable:!0}),e.prototype.isTyping=function(){return this._pressedLetters.length>0},e.prototype.setFirstItemActive=function(){this._setActiveItemByIndex(0,1)},e.prototype.setLastItemActive=function(){this._setActiveItemByIndex(this._items.length-1,-1)},e.prototype.setNextItemActive=function(){this._activeItemIndex<0?this.setFirstItemActive():this._setActiveItemByDelta(1)},e.prototype.setPreviousItemActive=function(){this._activeItemIndex<0&&this._wrap?this.setLastItemActive():this._setActiveItemByDelta(-1)},e.prototype.updateActiveItem=function(e){var t=this._getItemsArray(),n="number"==typeof e?e:t.indexOf(e),r=t[n];this._activeItem=null==r?null:r,this._activeItemIndex=n},e.prototype._setActiveItemByDelta=function(e){this._wrap?this._setActiveInWrapMode(e):this._setActiveInDefaultMode(e)},e.prototype._setActiveInWrapMode=function(e){for(var t=this._getItemsArray(),n=1;n<=t.length;n++){var r=(this._activeItemIndex+e*n+t.length)%t.length;if(!this._skipPredicateFn(t[r]))return void this.setActiveItem(r)}},e.prototype._setActiveInDefaultMode=function(e){this._setActiveItemByIndex(this._activeItemIndex+e,e)},e.prototype._setActiveItemByIndex=function(e,t){var n=this._getItemsArray();if(n[e]){for(;this._skipPredicateFn(n[e]);)if(!n[e+=t])return;this.setActiveItem(e)}},e.prototype._getItemsArray=function(){return this._items instanceof n.QueryList?this._items.toArray():this._items},e}(),_=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.setActiveItem=function(t){this.activeItem&&this.activeItem.setInactiveStyles(),e.prototype.setActiveItem.call(this,t),this.activeItem&&this.activeItem.setActiveStyles()},t}(m),b=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._origin="program",t}return r.__extends(t,e),t.prototype.setFocusOrigin=function(e){return this._origin=e,this},t.prototype.setActiveItem=function(t){e.prototype.setActiveItem.call(this,t),this.activeItem&&this.activeItem.focus(this._origin)},t}(m),v=function(){function e(e){this._platform=e}return e.prototype.isDisabled=function(e){return e.hasAttribute("disabled")},e.prototype.isVisible=function(e){return function t(e){return!!(e.offsetWidth||e.offsetHeight||"function"==typeof e.getClientRects&&e.getClientRects().length)}(e)&&"visible"===getComputedStyle(e).visibility},e.prototype.isTabbable=function(e){if(!this._platform.isBrowser)return!1;var t=function r(e){try{return e.frameElement}catch(e){return null}}(function n(e){return e.ownerDocument&&e.ownerDocument.defaultView||window}
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/(e));if(t){var i=t&&t.nodeName.toLowerCase();if(-1===g(t))return!1;if((this._platform.BLINK||this._platform.WEBKIT)&&"object"===i)return!1;if((this._platform.BLINK||this._platform.WEBKIT)&&!this.isVisible(t))return!1}var o=e.nodeName.toLowerCase(),s=g(e);if(e.hasAttribute("contenteditable"))return-1!==s;if("iframe"===o)return!1;if("audio"===o){if(!e.hasAttribute("controls"))return!1;if(this._platform.BLINK)return!0}if("video"===o){if(!e.hasAttribute("controls")&&this._platform.TRIDENT)return!1;if(this._platform.BLINK||this._platform.FIREFOX)return!0}return("object"!==o||!this._platform.BLINK&&!this._platform.WEBKIT)&&!(this._platform.WEBKIT&&this._platform.IOS&&!function c(e){var t=e.nodeName.toLowerCase(),n="input"===t&&e.type;return"text"===n||"password"===n||"select"===t||"textarea"===t}(e))&&e.tabIndex>=0},e.prototype.isFocusable=function(e){return function t(e){return!function t(e){return function t(e){return"input"==e.nodeName.toLowerCase()}(e)&&"hidden"==e.type}(e)&&(function n(e){var t=e.nodeName.toLowerCase();return"input"===t||"select"===t||"button"===t||"textarea"===t}(e)||function r(e){return function t(e){return"a"==e.nodeName.toLowerCase()}(e)&&e.hasAttribute("href")}(e)||e.hasAttribute("contenteditable")||y(e))}(e)&&!this.isDisabled(e)&&this.isVisible(e)},e.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:a.Platform}]},e.ɵprov=n.ɵɵdefineInjectable({factory:function t(){return new e(n.ɵɵinject(a.Platform))},token:e,providedIn:"root"}),e}();function y(e){if(!e.hasAttribute("tabindex")||void 0===e.tabIndex)return!1;var t=e.getAttribute("tabindex");return"-32768"!=t&&!(!t||isNaN(parseInt(t,10)))}function g(e){if(!y(e))return null;var t=parseInt(e.getAttribute("tabindex")||"",10);return isNaN(t)?-1:t}var I=function(){function e(e,t,n,r,i){var o=this;void 0===i&&(i=!1),this._element=e,this._checker=t,this._ngZone=n,this._document=r,this._hasAttached=!1,this.startAnchorListener=function(){return o.focusLastTabbableElement()},this.endAnchorListener=function(){return o.focusFirstTabbableElement()},this._enabled=!0,i||this.attachAnchors()}return Object.defineProperty(e.prototype,"enabled",{get:function(){return this._enabled},set:function(e){this._enabled=e,this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){var e=this._startAnchor,t=this._endAnchor;e&&(e.removeEventListener("focus",this.startAnchorListener),e.parentNode&&e.parentNode.removeChild(e)),t&&(t.removeEventListener("focus",this.endAnchorListener),t.parentNode&&t.parentNode.removeChild(t)),this._startAnchor=this._endAnchor=null},e.prototype.attachAnchors=function(){var e=this;return!!this._hasAttached||(this._ngZone.runOutsideAngular((function(){e._startAnchor||(e._startAnchor=e._createAnchor(),e._startAnchor.addEventListener("focus",e.startAnchorListener)),e._endAnchor||(e._endAnchor=e._createAnchor(),e._endAnchor.addEventListener("focus",e.endAnchorListener))})),this._element.parentNode&&(this._element.parentNode.insertBefore(this._startAnchor,this._element),this._element.parentNode.insertBefore(this._endAnchor,this._element.nextSibling),this._hasAttached=!0),this._hasAttached)},e.prototype.focusInitialElementWhenReady=function(){var e=this;return new Promise((function(t){e._executeOnStable((function(){return t(e.focusInitialElement())}))}))},e.prototype.focusFirstTabbableElementWhenReady=function(){var e=this;return new Promise((function(t){e._executeOnStable((function(){return t(e.focusFirstTabbableElement())}))}))},e.prototype.focusLastTabbableElementWhenReady=function(){var e=this;return new Promise((function(t){e._executeOnStable((function(){return t(e.focusLastTabbableElement())}))}))},e.prototype._getRegionBoundary=function(e){for(var t=this._element.querySelectorAll("[cdk-focus-region-"+e+"], [cdkFocusRegion"+e+"], [cdk-focus-"+e+"]"),n=0;n<t.length;n++)t[n].hasAttribute("cdk-focus-"+e)?console.warn("Found use of deprecated attribute 'cdk-focus-"+e+"', use 'cdkFocusRegion"+e+"' instead. The deprecated attribute will be removed in 8.0.0.",t[n]):t[n].hasAttribute("cdk-focus-region-"+e)&&console.warn("Found use of deprecated attribute 'cdk-focus-region-"+e+"', use 'cdkFocusRegion"+e+"' instead. The deprecated attribute will be removed in 8.0.0.",t[n]);return"start"==e?t.length?t[0]:this._getFirstTabbableElement(this._element):t.length?t[t.length-1]:this._getLastTabbableElement(this._element)},e.prototype.focusInitialElement=function(){var e=this._element.querySelector("[cdk-focus-initial], [cdkFocusInitial]");return e?(e.hasAttribute("cdk-focus-initial")&&console.warn("Found use of deprecated attribute 'cdk-focus-initial', use 'cdkFocusInitial' instead. The deprecated attribute will be removed in 8.0.0",e),n.isDevMode()&&!this._checker.isFocusable(e)&&console.warn("Element matching '[cdkFocusInitial]' is not focusable.",e),e.focus(),!0):this.focusFirstTabbableElement()},e.prototype.focusFirstTabbableElement=function(){var e=this._getRegionBoundary("start");return e&&e.focus(),!!e},e.prototype.focusLastTabbableElement=function(){var e=this._getRegionBoundary("end");return e&&e.focus(),!!e},e.prototype.hasAttached=function(){return this._hasAttached},e.prototype._getFirstTabbableElement=function(e){if(this._checker.isFocusable(e)&&this._checker.isTabbable(e))return e;for(var t=e.children||e.childNodes,n=0;n<t.length;n++){var r=t[n].nodeType===this._document.ELEMENT_NODE?this._getFirstTabbableElement(t[n]):null;if(r)return r}return null},e.prototype._getLastTabbableElement=function(e){if(this._checker.isFocusable(e)&&this._checker.isTabbable(e))return e;for(var t=e.children||e.childNodes,n=t.length-1;n>=0;n--){var r=t[n].nodeType===this._document.ELEMENT_NODE?this._getLastTabbableElement(t[n]):null;if(r)return r}return null},e.prototype._createAnchor=function(){var e=this._document.createElement("div");return this._toggleAnchorTabIndex(this._enabled,e),e.classList.add("cdk-visually-hidden"),e.classList.add("cdk-focus-trap-anchor"),e.setAttribute("aria-hidden","true"),e},e.prototype._toggleAnchorTabIndex=function(e,t){e?t.setAttribute("tabindex","0"):t.removeAttribute("tabindex")},e.prototype._executeOnStable=function(e){this._ngZone.isStable?e():this._ngZone.onStable.asObservable().pipe(s.take(1)).subscribe(e)},e}(),E=function(){function e(e,t,n){this._checker=e,this._ngZone=t,this._document=n}return e.prototype.create=function(e,t){return void 0===t&&(t=!1),new I(e,this._checker,this._ngZone,this._document,t)},e.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:v},{type:n.NgZone},{type:void 0,decorators:[{type:n.Inject,args:[t.DOCUMENT]}]}]},e.ɵprov=n.ɵɵdefineInjectable({factory:function r(){return new e(n.ɵɵinject(v),n.ɵɵinject(n.NgZone),n.ɵɵinject(t.DOCUMENT))},token:e,providedIn:"root"}),e}(),A=function(){function e(e,t,n){this._elementRef=e,this._focusTrapFactory=t,this._previouslyFocusedElement=null,this._document=n,this.focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement,!0)}return Object.defineProperty(e.prototype,"enabled",{get:function(){return this.focusTrap.enabled},set:function(e){this.focusTrap.enabled=c.coerceBooleanProperty(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"autoCapture",{get:function(){return this._autoCapture},set:function(e){this._autoCapture=c.coerceBooleanProperty(e)},enumerable:!0,configurable:!0}),e.prototype.ngOnDestroy=function(){this.focusTrap.destroy(),this._previouslyFocusedElement&&(this._previouslyFocusedElement.focus(),this._previouslyFocusedElement=null)},e.prototype.ngAfterContentInit=function(){this.focusTrap.attachAnchors(),this.autoCapture&&(this._previouslyFocusedElement=this._document.activeElement,this.focusTrap.focusInitialElementWhenReady())},e.prototype.ngDoCheck=function(){this.focusTrap.hasAttached()||this.focusTrap.attachAnchors()},e.decorators=[{type:n.Directive,args:[{selector:"[cdkTrapFocus]",exportAs:"cdkTrapFocus"}]}],e.ctorParameters=function(){return[{type:n.ElementRef},{type:E},{type:void 0,decorators:[{type:n.Inject,args:[t.DOCUMENT]}]}]},e.propDecorators={enabled:[{type:n.Input,args:["cdkTrapFocus"]}],autoCapture:[{type:n.Input,args:["cdkTrapFocusAutoCapture"]}]},e}(),T=new n.InjectionToken("liveAnnouncerElement",{providedIn:"root",factory:k});function k(){return null}var C=new n.InjectionToken("LIVE_ANNOUNCER_DEFAULT_OPTIONS"),w=function(){function e(e,t,n,r){this._ngZone=t,this._defaultOptions=r,this._document=n,this._liveElement=e||this._createLiveElement()}return e.prototype.announce=function(e){for(var t,n=this,i=[],o=1;o<arguments.length;o++)i[o-1]=arguments[o];var s,c,a=this._defaultOptions;return 1===i.length&&"number"==typeof i[0]?c=i[0]:(s=(t=r.__read(i,2))[0],c=t[1]),this.clear(),clearTimeout(this._previousTimeout),s||(s=a&&a.politeness?a.politeness:"polite"),null==c&&a&&(c=a.duration),this._liveElement.setAttribute("aria-live",s),this._ngZone.runOutsideAngular((function(){return new Promise((function(t){clearTimeout(n._previousTimeout),n._previousTimeout=setTimeout((function(){n._liveElement.textContent=e,t(),"number"==typeof c&&(n._previousTimeout=setTimeout((function(){return n.clear()}),c))}),100)}))}))},e.prototype.clear=function(){this._liveElement&&(this._liveElement.textContent="")},e.prototype.ngOnDestroy=function(){clearTimeout(this._previousTimeout),this._liveElement&&this._liveElement.parentNode&&(this._liveElement.parentNode.removeChild(this._liveElement),this._liveElement=null)},e.prototype._createLiveElement=function(){for(var e=this._document.getElementsByClassName("cdk-live-announcer-element"),t=this._document.createElement("div"),n=0;n<e.length;n++)e[n].parentNode.removeChild(e[n]);return t.classList.add("cdk-live-announcer-element"),t.classList.add("cdk-visually-hidden"),t.setAttribute("aria-atomic","true"),t.setAttribute("aria-live","polite"),this._document.body.appendChild(t),t},e.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:void 0,decorators:[{type:n.Optional},{type:n.Inject,args:[T]}]},{type:n.NgZone},{type:void 0,decorators:[{type:n.Inject,args:[t.DOCUMENT]}]},{type:void 0,decorators:[{type:n.Optional},{type:n.Inject,args:[C]}]}]},e.ɵprov=n.ɵɵdefineInjectable({factory:function r(){return new e(n.ɵɵinject(T,8),n.ɵɵinject(n.NgZone),n.ɵɵinject(t.DOCUMENT),n.ɵɵinject(C,8))},token:e,providedIn:"root"}),e}(),L=function(){function e(e,t,n,r){this._elementRef=e,this._liveAnnouncer=t,this._contentObserver=n,this._ngZone=r,this._politeness="off"}return Object.defineProperty(e.prototype,"politeness",{get:function(){return this._politeness},set:function(e){var t=this;this._politeness="polite"===e||"assertive"===e?e:"off","off"===this._politeness?this._subscription&&(this._subscription.unsubscribe(),this._subscription=null):this._subscription||(this._subscription=this._ngZone.runOutsideAngular((function(){return t._contentObserver.observe(t._elementRef).subscribe((function(){var e=t._elementRef.nativeElement.textContent;e!==t._previousAnnouncedText&&(t._liveAnnouncer.announce(e,t._politeness),t._previousAnnouncedText=e)}))})))},enumerable:!0,configurable:!0}),e.prototype.ngOnDestroy=function(){this._subscription&&this._subscription.unsubscribe()},e.decorators=[{type:n.Directive,args:[{selector:"[cdkAriaLive]",exportAs:"cdkAriaLive"}]}],e.ctorParameters=function(){return[{type:n.ElementRef},{type:w},{type:u.ContentObserver},{type:n.NgZone}]},e.propDecorators={politeness:[{type:n.Input,args:["cdkAriaLive"]}]},e}(),O=650,N=a.normalizePassiveListenerOptions({passive:!0,capture:!0}),F=function(){function e(e,t){var n=this;this._ngZone=e,this._platform=t,this._origin=null,this._windowFocused=!1,this._elementInfo=new Map,this._monitoredElementCount=0,this._documentKeydownListener=function(){n._lastTouchTarget=null,n._setOriginForCurrentEventQueue("keyboard")},this._documentMousedownListener=function(){n._lastTouchTarget||n._setOriginForCurrentEventQueue("mouse")},this._documentTouchstartListener=function(e){null!=n._touchTimeoutId&&clearTimeout(n._touchTimeoutId),n._lastTouchTarget=e.composedPath?e.composedPath()[0]:e.target,n._touchTimeoutId=setTimeout((function(){return n._lastTouchTarget=null}),O)},this._windowFocusListener=function(){n._windowFocused=!0,n._windowFocusTimeoutId=setTimeout((function(){return n._windowFocused=!1}))}}return e.prototype.monitor=function(e,t){var n=this;if(void 0===t&&(t=!1),!this._platform.isBrowser)return i.of(null);var r=c.coerceElement(e);if(this._elementInfo.has(r)){var o=this._elementInfo.get(r);return o.checkChildren=t,o.subject.asObservable()}var s={unlisten:function(){},checkChildren:t,subject:new i.Subject};this._elementInfo.set(r,s),this._incrementMonitoredElementCount();var a=function(e){return n._onFocus(e,r)},u=function(e){return n._onBlur(e,r)};return this._ngZone.runOutsideAngular((function(){r.addEventListener("focus",a,!0),r.addEventListener("blur",u,!0)})),s.unlisten=function(){r.removeEventListener("focus",a,!0),r.removeEventListener("blur",u,!0)},s.subject.asObservable()},e.prototype.stopMonitoring=function(e){var t=c.coerceElement(e),n=this._elementInfo.get(t);n&&(n.unlisten(),n.subject.complete(),this._setClasses(t),this._elementInfo.delete(t),this._decrementMonitoredElementCount())},e.prototype.focusVia=function(e,t,n){var r=c.coerceElement(e);this._setOriginForCurrentEventQueue(t),"function"==typeof r.focus&&r.focus(n)},e.prototype.ngOnDestroy=function(){var e=this;this._elementInfo.forEach((function(t,n){return e.stopMonitoring(n)}))},e.prototype._toggleClass=function(e,t,n){n?e.classList.add(t):e.classList.remove(t)},e.prototype._setClasses=function(e,t){this._elementInfo.get(e)&&(this._toggleClass(e,"cdk-focused",!!t),this._toggleClass(e,"cdk-touch-focused","touch"===t),this._toggleClass(e,"cdk-keyboard-focused","keyboard"===t),this._toggleClass(e,"cdk-mouse-focused","mouse"===t),this._toggleClass(e,"cdk-program-focused","program"===t))},e.prototype._setOriginForCurrentEventQueue=function(e){var t=this;this._ngZone.runOutsideAngular((function(){t._origin=e,t._originTimeoutId=setTimeout((function(){return t._origin=null}),1)}))},e.prototype._wasCausedByTouch=function(e){var t=e.target;return this._lastTouchTarget instanceof Node&&t instanceof Node&&(t===this._lastTouchTarget||t.contains(this._lastTouchTarget))},e.prototype._onFocus=function(e,t){var n=this._elementInfo.get(t);if(n&&(n.checkChildren||t===e.target)){var r=this._origin;r||(r=this._windowFocused&&this._lastFocusOrigin?this._lastFocusOrigin:this._wasCausedByTouch(e)?"touch":"program"),this._setClasses(t,r),this._emitOrigin(n.subject,r),this._lastFocusOrigin=r}},e.prototype._onBlur=function(e,t){var n=this._elementInfo.get(t);!n||n.checkChildren&&e.relatedTarget instanceof Node&&t.contains(e.relatedTarget)||(this._setClasses(t),this._emitOrigin(n.subject,null))},e.prototype._emitOrigin=function(e,t){this._ngZone.run((function(){return e.next(t)}))},e.prototype._incrementMonitoredElementCount=function(){var e=this;1==++this._monitoredElementCount&&this._platform.isBrowser&&this._ngZone.runOutsideAngular((function(){document.addEventListener("keydown",e._documentKeydownListener,N),document.addEventListener("mousedown",e._documentMousedownListener,N),document.addEventListener("touchstart",e._documentTouchstartListener,N),window.addEventListener("focus",e._windowFocusListener)}))},e.prototype._decrementMonitoredElementCount=function(){--this._monitoredElementCount||(document.removeEventListener("keydown",this._documentKeydownListener,N),document.removeEventListener("mousedown",this._documentMousedownListener,N),document.removeEventListener("touchstart",this._documentTouchstartListener,N),window.removeEventListener("focus",this._windowFocusListener),clearTimeout(this._windowFocusTimeoutId),clearTimeout(this._touchTimeoutId),clearTimeout(this._originTimeoutId))},e.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:n.NgZone},{type:a.Platform}]},e.ɵprov=n.ɵɵdefineInjectable({factory:function t(){return new e(n.ɵɵinject(n.NgZone),n.ɵɵinject(a.Platform))},token:e,providedIn:"root"}),e}(),M=function(){function e(e,t){var r=this;this._elementRef=e,this._focusMonitor=t,this.cdkFocusChange=new n.EventEmitter,this._monitorSubscription=this._focusMonitor.monitor(this._elementRef,this._elementRef.nativeElement.hasAttribute("cdkMonitorSubtreeFocus")).subscribe((function(e){return r.cdkFocusChange.emit(e)}))}return e.prototype.ngOnDestroy=function(){this._focusMonitor.stopMonitoring(this._elementRef),this._monitorSubscription.unsubscribe()},e.decorators=[{type:n.Directive,args:[{selector:"[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]"}]}],e.ctorParameters=function(){return[{type:n.ElementRef},{type:F}]},e.propDecorators={cdkFocusChange:[{type:n.Output}]},e}(),x=function(){function e(e,t){this._platform=e,this._document=t}return e.prototype.getHighContrastMode=function(){if(!this._platform.isBrowser)return 0;var e=this._document.createElement("div");e.style.backgroundColor="rgb(1,2,3)",e.style.position="absolute",this._document.body.appendChild(e);var t=(this._document.defaultView.getComputedStyle(e).backgroundColor||"").replace(/ /g,"");switch(this._document.body.removeChild(e),t){case"rgb(0,0,0)":return 2;case"rgb(255,255,255)":return 1}return 0},e.prototype._applyBodyHighContrastModeCssClasses=function(){if(this._platform.isBrowser&&this._document.body){var e=this._document.body.classList;e.remove("cdk-high-contrast-active"),e.remove("cdk-high-contrast-black-on-white"),e.remove("cdk-high-contrast-white-on-black");var t=this.getHighContrastMode();1===t?(e.add("cdk-high-contrast-active"),e.add("cdk-high-contrast-black-on-white")):2===t&&(e.add("cdk-high-contrast-active"),e.add("cdk-high-contrast-white-on-black"))}},e.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:a.Platform},{type:void 0,decorators:[{type:n.Inject,args:[t.DOCUMENT]}]}]},e.ɵprov=n.ɵɵdefineInjectable({factory:function r(){return new e(n.ɵɵinject(a.Platform),n.ɵɵinject(t.DOCUMENT))},token:e,providedIn:"root"}),e}(),j=function(){function e(e){e._applyBodyHighContrastModeCssClasses()}return e.decorators=[{type:n.NgModule,args:[{imports:[t.CommonModule,a.PlatformModule,u.ObserversModule],declarations:[L,A,M],exports:[L,A,M]}]}],e.ctorParameters=function(){return[{type:x}]},e}();
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
e.A11yModule=j,e.ActiveDescendantKeyManager=_,e.AriaDescriber=f,e.CDK_DESCRIBEDBY_HOST_ATTRIBUTE="cdk-describedby-host",e.CDK_DESCRIBEDBY_ID_PREFIX="cdk-describedby-message",e.CdkAriaLive=L,e.CdkMonitorFocus=M,e.CdkTrapFocus=A,e.FocusKeyManager=b,e.FocusMonitor=F,e.FocusTrap=I,e.FocusTrapFactory=E,e.HighContrastModeDetector=x,e.InteractivityChecker=v,e.LIVE_ANNOUNCER_DEFAULT_OPTIONS=C,e.LIVE_ANNOUNCER_ELEMENT_TOKEN=T,e.LIVE_ANNOUNCER_ELEMENT_TOKEN_FACTORY=k,e.ListKeyManager=m,e.LiveAnnouncer=w,e.MESSAGES_CONTAINER_ID="cdk-describedby-message-container",e.TOUCH_BUFFER_MS=O,e.isFakeMousedownFromScreenReader=
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
function D(e){return 0===e.buttons}
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/,Object.defineProperty(e,"__esModule",{value:!0})}));