/** * @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://github.com/material-components/material-components-web/blob/master/LICENSE */ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define("@material/banner", [], factory); else if(typeof exports === 'object') exports["banner"] = factory(); else root["mdc"] = root["mdc"] || {}, root["mdc"]["banner"] = factory(); })(this, function() { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = "./packages/mdc-banner/index.ts"); /******/ }) /************************************************************************/ /******/ ({ /***/ "./node_modules/process/browser.js": /*!*****************************************!*\ !*** ./node_modules/process/browser.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports) { // shim for using process in browser var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it // don't break things. But we need to wrap it in a try catch in case it is // wrapped in strict mode code which doesn't define any globals. It's inside a // function because try/catches deoptimize in certain engines. var cachedSetTimeout; var cachedClearTimeout; function defaultSetTimout() { throw new Error('setTimeout has not been defined'); } function defaultClearTimeout () { throw new Error('clearTimeout has not been defined'); } (function () { try { if (typeof setTimeout === 'function') { cachedSetTimeout = setTimeout; } else { cachedSetTimeout = defaultSetTimout; } } catch (e) { cachedSetTimeout = defaultSetTimout; } try { if (typeof clearTimeout === 'function') { cachedClearTimeout = clearTimeout; } else { cachedClearTimeout = defaultClearTimeout; } } catch (e) { cachedClearTimeout = defaultClearTimeout; } } ()) function runTimeout(fun) { if (cachedSetTimeout === setTimeout) { //normal enviroments in sane situations return setTimeout(fun, 0); } // if setTimeout wasn't available but was latter defined if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { cachedSetTimeout = setTimeout; return setTimeout(fun, 0); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedSetTimeout(fun, 0); } catch(e){ try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedSetTimeout.call(null, fun, 0); } catch(e){ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error return cachedSetTimeout.call(this, fun, 0); } } } function runClearTimeout(marker) { if (cachedClearTimeout === clearTimeout) { //normal enviroments in sane situations return clearTimeout(marker); } // if clearTimeout wasn't available but was latter defined if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { cachedClearTimeout = clearTimeout; return clearTimeout(marker); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedClearTimeout(marker); } catch (e){ try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedClearTimeout.call(null, marker); } catch (e){ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. // Some versions of I.E. have different rules for clearTimeout vs setTimeout return cachedClearTimeout.call(this, marker); } } } var queue = []; var draining = false; var currentQueue; var queueIndex = -1; function cleanUpNextTick() { if (!draining || !currentQueue) { return; } draining = false; if (currentQueue.length) { queue = currentQueue.concat(queue); } else { queueIndex = -1; } if (queue.length) { drainQueue(); } } function drainQueue() { if (draining) { return; } var timeout = runTimeout(cleanUpNextTick); draining = true; var len = queue.length; while(len) { currentQueue = queue; queue = []; while (++queueIndex < len) { if (currentQueue) { currentQueue[queueIndex].run(); } } queueIndex = -1; len = queue.length; } currentQueue = null; draining = false; runClearTimeout(timeout); } process.nextTick = function (fun) { var args = new Array(arguments.length - 1); if (arguments.length > 1) { for (var i = 1; i < arguments.length; i++) { args[i - 1] = arguments[i]; } } queue.push(new Item(fun, args)); if (queue.length === 1 && !draining) { runTimeout(drainQueue); } }; // v8 likes predictible objects function Item(fun, array) { this.fun = fun; this.array = array; } Item.prototype.run = function () { this.fun.apply(null, this.array); }; process.title = 'browser'; process.browser = true; process.env = {}; process.argv = []; process.version = ''; // empty string to avoid regexp issues process.versions = {}; function noop() {} process.on = noop; process.addListener = noop; process.once = noop; process.off = noop; process.removeListener = noop; process.removeAllListeners = noop; process.emit = noop; process.prependListener = noop; process.prependOnceListener = noop; process.listeners = function (name) { return [] } process.binding = function (name) { throw new Error('process.binding is not supported'); }; process.cwd = function () { return '/' }; process.chdir = function (dir) { throw new Error('process.chdir is not supported'); }; process.umask = function() { return 0; }; /***/ }), /***/ "./node_modules/safevalues/builders/attribute_builders.js": /*!****************************************************************!*\ !*** ./node_modules/safevalues/builders/attribute_builders.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * SPDX-License-Identifier: Apache-2.0 */ Object.defineProperty(exports, "__esModule", { value: true }); exports.safeAttrPrefix = void 0; __webpack_require__(/*! ../environment/dev */ "./node_modules/safevalues/environment/dev.js"); var attribute_impl_1 = __webpack_require__(/*! ../internals/attribute_impl */ "./node_modules/safevalues/internals/attribute_impl.js"); var string_literal_1 = __webpack_require__(/*! ../internals/string_literal */ "./node_modules/safevalues/internals/string_literal.js"); var sensitive_attributes_1 = __webpack_require__(/*! ./sensitive_attributes */ "./node_modules/safevalues/builders/sensitive_attributes.js"); /** * Creates a SafeAttributePrefix object from a template literal with no * interpolations for attributes that share a common prefix guaranteed to be not * security sensitive. * * The template literal is a prefix that makes it obvious this attribute is not * security sensitive. If it doesn't, this function will throw. */ function safeAttrPrefix(templ) { if (true) { (0, string_literal_1.assertIsTemplateObject)(templ, true, 'safeAttr is a template literal tag function ' + 'and should be called using the tagged template syntax. ' + 'For example, safeAttr`foo`;'); } var attrPrefix = templ[0].toLowerCase(); if (true) { if (attrPrefix.indexOf('on') === 0 || 'on'.indexOf(attrPrefix) === 0) { throw new Error("Prefix '".concat(templ[0], "' does not guarantee the attribute ") + "to be safe as it is also a prefix for event handler attributes" + "Please use 'addEventListener' to set event handlers."); } sensitive_attributes_1.SECURITY_SENSITIVE_ATTRIBUTES.forEach(function (sensitiveAttr) { if (sensitiveAttr.indexOf(attrPrefix) === 0) { throw new Error("Prefix '".concat(templ[0], "' does not guarantee the attribute ") + "to be safe as it is also a prefix for " + "the security sensitive attribute '".concat(sensitiveAttr, "'. ") + "Please use native or safe DOM APIs to set the attribute."); } }); } return (0, attribute_impl_1.createAttributePrefix)(attrPrefix); } exports.safeAttrPrefix = safeAttrPrefix; /***/ }), /***/ "./node_modules/safevalues/builders/html_builders.js": /*!***********************************************************!*\ !*** ./node_modules/safevalues/builders/html_builders.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * SPDX-License-Identifier: Apache-2.0 */ Object.defineProperty(exports, "__esModule", { value: true }); exports.concatHtmls = exports.createScriptSrc = exports.createScript = exports.htmlEscape = void 0; var html_impl_1 = __webpack_require__(/*! ../internals/html_impl */ "./node_modules/safevalues/internals/html_impl.js"); var resource_url_impl_1 = __webpack_require__(/*! ../internals/resource_url_impl */ "./node_modules/safevalues/internals/resource_url_impl.js"); var script_impl_1 = __webpack_require__(/*! ../internals/script_impl */ "./node_modules/safevalues/internals/script_impl.js"); /** * Returns HTML-escaped text as a `SafeHtml` object. * * Available options: * - `preserveSpaces` turns every second consecutive space character into its * HTML entity representation (` `). * - `preserveNewlines` turns newline characters into breaks (`
`). * - `preserveTabs` wraps tab characters in a span with style=white-space:pre. */ function htmlEscape(text, options) { if (options === void 0) { options = {}; } var htmlEscapedString = htmlEscapeToString(text); if (options.preserveSpaces) { // Do this first to ensure we preserve spaces after newlines and tabs. htmlEscapedString = htmlEscapedString.replace(/(^|[\r\n\t ]) /g, '$1 '); } if (options.preserveNewlines) { htmlEscapedString = htmlEscapedString.replace(/(\r\n|\n|\r)/g, '
'); } if (options.preserveTabs) { htmlEscapedString = htmlEscapedString.replace(/(\t+)/g, '$1'); } return (0, html_impl_1.createHtml)(htmlEscapedString); } exports.htmlEscape = htmlEscape; /** * Creates a `SafeHtml` representing a script tag with inline script content. */ function createScript(script, options) { if (options === void 0) { options = {}; } var unwrappedScript = (0, script_impl_1.unwrapScript)(script).toString(); var stringTag = ""); return (0, html_impl_1.createHtml)(stringTag); } exports.createScript = createScript; /** * Creates a `SafeHtml` representing a script tag with the src attribute. * This also supports CSP nonces and async loading. */ function createScriptSrc(src, async, nonce) { var unwrappedSrc = (0, resource_url_impl_1.unwrapResourceUrl)(src).toString(); var stringTag = "" doesn't break out of the context. * @param value The value to serialize. */ function scriptFromJson(value) { return (0, script_impl_1.createScript)(JSON.stringify(value).replace(/ * characters in it. This is so that SafeStyle's contract is preserved, * allowing the SafeStyle to correctly be interpreted as a sequence of CSS * declarations and without affecting the syntactic structure of any * surrounding CSS and HTML. * * This function is a template literal tag function. It should be called with * a template literal that does not contain any expressions. For example, * safeStyle`foo`; * This function first checks if it is called with a literal template, and * then performs basic sanity checks on the format of ` style` * but does not constrain the format of ` name} and {@code value`, except * for disallowing tag characters. * * @param templateObj This contains the literal part of the template literal. */ function safeStyle(templateObj) { if (true) { (0, string_literal_1.assertIsTemplateObject)(templateObj, false, 'safeStyle is a template literal tag function ' + 'that only accepts template literals without expressions. ' + 'For example, safeStyle`foo`;'); } var style = templateObj[0]; if (true) { if (/[<>]/.test(style)) { throw new Error('Forbidden characters in style string: ' + style); } if (!/;$/.test(style)) { throw new Error('Style string does not end with ";": ' + style); } if (!/:/.test(style)) { throw new Error('Style string should contain one or more ":": ' + style); } } return (0, style_impl_1.createStyle)(style); } exports.safeStyle = safeStyle; /** Creates a `SafeStyle` value by concatenating multiple `SafeStyle`s. */ function concatStyles(styles) { return (0, style_impl_1.createStyle)(styles.map(style_impl_1.unwrapStyle).join('')); } exports.concatStyles = concatStyles; /***/ }), /***/ "./node_modules/safevalues/builders/style_sheet_builders.js": /*!******************************************************************!*\ !*** ./node_modules/safevalues/builders/style_sheet_builders.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * SPDX-License-Identifier: Apache-2.0 */ Object.defineProperty(exports, "__esModule", { value: true }); exports.concatStyleSheets = exports.safeStyleSheet = void 0; __webpack_require__(/*! ../environment/dev */ "./node_modules/safevalues/environment/dev.js"); var string_literal_1 = __webpack_require__(/*! ../internals/string_literal */ "./node_modules/safevalues/internals/string_literal.js"); var style_sheet_impl_1 = __webpack_require__(/*! ../internals/style_sheet_impl */ "./node_modules/safevalues/internals/style_sheet_impl.js"); /** * Creates a SafeStyleSheet object from a template literal (without any * embedded expressions). * * This function is a template literal tag function. It should be called with * a template literal that does not contain any expressions. For example, * safeStyleSheet`foo`; * The argument must not have any < or > characters in it. This is so that * SafeStyleSheet's contract is preserved, allowing the SafeStyleSheet to * correctly be interpreted as a sequence of CSS declarations and without * affecting the syntactic structure of any surrounding CSS and HTML. * * @param templateObj This contains the literal part of the template literal. */ function safeStyleSheet(templateObj) { if (true) { (0, string_literal_1.assertIsTemplateObject)(templateObj, false, 'safeStyleSheet is a template literal tag ' + 'function that only accepts template literals without ' + 'expressions. For example, safeStyleSheet`foo`;'); } var styleSheet = templateObj[0]; if (true) { if (/[<>]/.test(styleSheet)) { throw new Error('Forbidden characters in styleSheet string: ' + styleSheet); } } return (0, style_sheet_impl_1.createStyleSheet)(styleSheet); } exports.safeStyleSheet = safeStyleSheet; /** * Creates a `SafeStyleSheet` value by concatenating multiple `SafeStyleSheet`s. */ function concatStyleSheets(sheets) { return (0, style_sheet_impl_1.createStyleSheet)(sheets.map(style_sheet_impl_1.unwrapStyleSheet).join('')); } exports.concatStyleSheets = concatStyleSheets; /***/ }), /***/ "./node_modules/safevalues/builders/url_sanitizer.js": /*!***********************************************************!*\ !*** ./node_modules/safevalues/builders/url_sanitizer.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * SPDX-License-Identifier: Apache-2.0 */ Object.defineProperty(exports, "__esModule", { value: true }); exports.restrictivelySanitizeUrl = exports.unwrapUrlOrSanitize = exports.sanitizeJavascriptUrl = void 0; /** * @fileoverview Provides functions to enforce the SafeUrl contract at the sink * level. */ __webpack_require__(/*! ../environment/dev */ "./node_modules/safevalues/environment/dev.js"); function extractScheme(url) { var parsedUrl; try { parsedUrl = new URL(url); } catch (e) { // According to https://url.spec.whatwg.org/#constructors, the URL // constructor with one parameter throws if `url` is not absolute. In this // case, we are sure that no explicit scheme (javascript: ) is set. // This can also be a URL parsing error, but in this case the URL won't be // run anyway. return 'https:'; } return parsedUrl.protocol; } // We can't use an ES6 Set here because gws somehow depends on this code and // doesn't want to pay the cost of a polyfill. var ALLOWED_SCHEMES = ['data:', 'http:', 'https:', 'mailto:', 'ftp:']; /** * Checks that the URL scheme is not javascript. * The URL parsing relies on the URL API in browsers that support it. * @param url The URL to sanitize for a SafeUrl sink. * @return undefined if url has a javascript: scheme, the original URL * otherwise. */ function sanitizeJavascriptUrl(url) { var parsedScheme = extractScheme(url); if (parsedScheme === 'javascript:') { if (true) { console.error("A URL with content '".concat(url, "' was sanitized away.")); } return undefined; } return url; } exports.sanitizeJavascriptUrl = sanitizeJavascriptUrl; /** * Adapter to sanitize string URLs in DOM sink wrappers. * @return undefined if the URL was sanitized. */ function unwrapUrlOrSanitize(url) { return sanitizeJavascriptUrl(url); } exports.unwrapUrlOrSanitize = unwrapUrlOrSanitize; /** * Sanitizes a URL restrictively. * This sanitizer protects against XSS and potentially other uncommon and * undesirable schemes that an attacker could use for e.g. phishing (tel:, * callto: ssh: etc schemes). This sanitizer is primarily meant to be used by * the HTML sanitizer. */ function restrictivelySanitizeUrl(url) { var parsedScheme = extractScheme(url); if (parsedScheme !== undefined && ALLOWED_SCHEMES.indexOf(parsedScheme.toLowerCase()) !== -1) { return url; } return 'about:invalid#zClosurez'; } exports.restrictivelySanitizeUrl = restrictivelySanitizeUrl; /***/ }), /***/ "./node_modules/safevalues/dom/elements/anchor.js": /*!********************************************************!*\ !*** ./node_modules/safevalues/dom/elements/anchor.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * SPDX-License-Identifier: Apache-2.0 */ Object.defineProperty(exports, "__esModule", { value: true }); exports.setHref = void 0; var url_sanitizer_1 = __webpack_require__(/*! ../../builders/url_sanitizer */ "./node_modules/safevalues/builders/url_sanitizer.js"); /** * Sets the Href attribute from the given Url. */ function setHref(anchor, url) { var sanitizedUrl = (0, url_sanitizer_1.unwrapUrlOrSanitize)(url); if (sanitizedUrl !== undefined) { anchor.href = sanitizedUrl; } } exports.setHref = setHref; /***/ }), /***/ "./node_modules/safevalues/dom/elements/area.js": /*!******************************************************!*\ !*** ./node_modules/safevalues/dom/elements/area.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * SPDX-License-Identifier: Apache-2.0 */ Object.defineProperty(exports, "__esModule", { value: true }); exports.setHref = void 0; var url_sanitizer_1 = __webpack_require__(/*! ../../builders/url_sanitizer */ "./node_modules/safevalues/builders/url_sanitizer.js"); /** * Sets the Href attribute from the given Url. */ function setHref(area, url) { var sanitizedUrl = (0, url_sanitizer_1.unwrapUrlOrSanitize)(url); if (sanitizedUrl !== undefined) { area.href = sanitizedUrl; } } exports.setHref = setHref; /***/ }), /***/ "./node_modules/safevalues/dom/elements/button.js": /*!********************************************************!*\ !*** ./node_modules/safevalues/dom/elements/button.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * SPDX-License-Identifier: Apache-2.0 */ Object.defineProperty(exports, "__esModule", { value: true }); exports.setFormaction = void 0; var url_sanitizer_1 = __webpack_require__(/*! ../../builders/url_sanitizer */ "./node_modules/safevalues/builders/url_sanitizer.js"); /** * Sets the Formaction attribute from the given Url. */ function setFormaction(button, url) { var sanitizedUrl = (0, url_sanitizer_1.unwrapUrlOrSanitize)(url); if (sanitizedUrl !== undefined) { button.formAction = sanitizedUrl; } } exports.setFormaction = setFormaction; /***/ }), /***/ "./node_modules/safevalues/dom/elements/element.js": /*!*********************************************************!*\ !*** ./node_modules/safevalues/dom/elements/element.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * SPDX-License-Identifier: Apache-2.0 */ var __read = (this && this.__read) || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { if (ar || !(i in from)) { if (!ar) ar = Array.prototype.slice.call(from, 0, i); ar[i] = from[i]; } } return to.concat(ar || Array.prototype.slice.call(from)); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.setPrefixedAttribute = exports.buildPrefixedAttributeSetter = exports.insertAdjacentHtml = exports.setCssText = exports.setOuterHtml = exports.setInnerHtml = void 0; /** * @fileoverview This contains safe wrappers for properties that aren't specific * to one kind of HTMLElement (like innerHTML), plus other setters and functions * that are not tied to elements (like location.href or Worker constructor). */ var attribute_impl_1 = __webpack_require__(/*! ../../internals/attribute_impl */ "./node_modules/safevalues/internals/attribute_impl.js"); var html_impl_1 = __webpack_require__(/*! ../../internals/html_impl */ "./node_modules/safevalues/internals/html_impl.js"); var style_impl_1 = __webpack_require__(/*! ../../internals/style_impl */ "./node_modules/safevalues/internals/style_impl.js"); /** * Safely set {@link Element.innerHTML} on a given ShadowRoot or Element which * may not be a `