{"version":3,"file":"pfelement.min.js","sources":["../_temp/reveal.js","../_temp/attrDefValidators.js","../_temp/polyfills--pfelement.js","../_temp/pfelement.js"],"sourcesContent":["let logger = () => null;\n\n/**\n * Reveal web components when loading is complete by removing the unresolved attribute\n * from the body tag; log the event.\n * @throws debugging log indicating the reveal event\n */\nexport function reveal() {\n logger(`[reveal] elements ready, revealing the body`);\n window.document.body.removeAttribute(\"unresolved\");\n}\n\n/**\n * Auto-reveal functionality prevents a flash of unstyled content before components\n * have finished loading.\n * @param {function} logFunction\n * @see https://github.com/github/webcomponentsjs#webcomponents-loaderjs\n */\nexport function autoReveal(logFunction) {\n logger = logFunction;\n // If Web Components are already ready, run the handler right away. If they\n // are not yet ready, wait.\n //\n // see https://github.com/github/webcomponentsjs#webcomponents-loaderjs for\n // info about web component readiness events\n const polyfillPresent = window.WebComponents;\n const polyfillReady = polyfillPresent && window.WebComponents.ready;\n\n if (!polyfillPresent || polyfillReady) {\n handleWebComponentsReady();\n } else {\n window.addEventListener(\"WebComponentsReady\", handleWebComponentsReady);\n }\n}\n\n/**\n * Reveal web components when loading is complete and log event.\n * @throws debugging log indicating the web components are ready\n */\nfunction handleWebComponentsReady() {\n logger(\"[reveal] web components ready\");\n reveal();\n}\n","/**\n * Verify that a property definition's `type` field contains one of the allowed\n * types. If the definition type resolves to falsy, assumes String type.\n * @param {constructor} definition\n * @default String\n * @return {Boolean} True if the definition type is one of String, Number, or Boolean\n */\nexport function isAllowedType(definition) {\n return [String, Number, Boolean].includes(definition.type || String);\n}\n\n/**\n * Verify that a property definition's `default` value is of the correct type.\n *\n * A `default` value is valid if it's of the same type as the `type`\n * definition. Or, if there is no `type` definition, then it must be a String\n * (the default value for `type`).\n * @param {type} definition\n * @return {Boolean} True if the default value matches the type of the definition object.\n */\nexport function isValidDefaultType(definition) {\n return definition.hasOwnProperty(\"default\") && definition.default.constructor === definition.type;\n}\n","// @POLYFILL Array.includes\n/** @see https://tc39.github.io/ecma262/#sec-array.prototype.includes */\nif (!Array.prototype.includes) {\n Object.defineProperty(Array.prototype, \"includes\", {\n value: function (valueToFind, fromIndex) {\n if (this == null) {\n throw new TypeError('\"this\" is null or not defined');\n }\n\n // 1. Let O be ? ToObject(this value).\n var o = Object(this);\n\n // 2. Let len be ? ToLength(? Get(O, \"length\")).\n var len = o.length >>> 0;\n\n // 3. If len is 0, return false.\n if (len === 0) {\n return false;\n }\n\n // 4. Let n be ? ToInteger(fromIndex).\n // (If fromIndex is undefined, this step produces the value 0.)\n var n = fromIndex | 0;\n\n // 5. If n ≥ 0, then\n // a. Let k be n.\n // 6. Else n < 0,\n // a. Let k be len + n.\n // b. If k < 0, let k be 0.\n var k = Math.max(n >= 0 ? n : len - Math.abs(n), 0);\n\n function sameValueZero(x, y) {\n return x === y || (typeof x === \"number\" && typeof y === \"number\" && isNaN(x) && isNaN(y));\n }\n\n // 7. Repeat, while k < len\n while (k < len) {\n // a. Let elementK be the result of ? Get(O, ! ToString(k)).\n // b. If SameValueZero(valueToFind, elementK) is true, return true.\n if (sameValueZero(o[k], valueToFind)) {\n return true;\n }\n // c. Increase k by 1.\n k++;\n }\n\n // 8. Return false\n return false;\n },\n });\n}\n\n// @POLYFILL Object.entries\n/** @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries */\nif (!Object.entries) {\n Object.entries = function (obj) {\n var ownProps = Object.keys(obj),\n i = ownProps.length,\n resArray = new Array(i); // preallocate the Array\n while (i--) resArray[i] = [ownProps[i], obj[ownProps[i]]];\n\n return resArray;\n };\n}\n\n// @POLYFILL String.startsWith\n/** @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith#polyfill */\nif (!String.prototype.startsWith) {\n Object.defineProperty(String.prototype, \"startsWith\", {\n value: function (search, rawPos) {\n var pos = rawPos > 0 ? rawPos | 0 : 0;\n return this.substring(pos, pos + search.length) === search;\n },\n });\n}\n\n// @POLYFILL Element.closest\n// https://developer.mozilla.org/en-US/docs/Web/API/Element/closest\nif (!Element.prototype.closest) {\n Element.prototype.closest = function (s) {\n var el = this;\n do {\n if (el.matches(s)) return el;\n el = el.parentElement || el.parentNode;\n } while (el !== null && el.nodeType === 1);\n return null;\n };\n}\n\n// @POLYFILL Element.matches\n// https://developer.mozilla.org/en-US/docs/Web/API/Element/matches\nif (!Element.prototype.matches) {\n Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\n}\n\n// @POLYFILL Array.prototype.find\n// https://tc39.github.io/ecma262/#sec-array.prototype.find\nif (!Array.prototype.find) {\n Object.defineProperty(Array.prototype, \"find\", {\n value: function (predicate) {\n // 1. Let O be ? ToObject(this value).\n if (this == null) {\n throw new TypeError('\"this\" is null or not defined');\n }\n\n var o = Object(this);\n\n // 2. Let len be ? ToLength(? Get(O, \"length\")).\n var len = o.length >>> 0;\n\n // 3. If IsCallable(predicate) is false, throw a TypeError exception.\n if (typeof predicate !== \"function\") {\n throw new TypeError(\"predicate must be a function\");\n }\n\n // 4. If thisArg was supplied, let T be thisArg; else let T be undefined.\n var thisArg = arguments[1];\n\n // 5. Let k be 0.\n var k = 0;\n\n // 6. Repeat, while k < len\n while (k < len) {\n // a. Let Pk be ! ToString(k).\n // b. Let kValue be ? Get(O, Pk).\n // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)).\n // d. If testResult is true, return kValue.\n var kValue = o[k];\n if (predicate.call(thisArg, kValue, k, o)) {\n return kValue;\n }\n // e. Increase k by 1.\n k++;\n }\n\n // 7. Return undefined.\n return undefined;\n },\n configurable: true,\n writable: true,\n });\n}\n","/*!\n * PatternFly Elements: PFElement 1.12.3\n * @license\n * Copyright 2021 Red Hat, 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 THE\n * SOFTWARE.\n * \n*/\n\nimport { autoReveal } from \"./reveal.js\";\nimport { isAllowedType, isValidDefaultType } from \"./attrDefValidators.js\";\n\n// Import polyfills: Array.includes, Object.entries, String.startsWith, Element.closest, Element.matches, Array.prototype.find\nimport \"./polyfills--pfelement.js\";\n\n// /**\n// * Global prefix used for all components in the project.\n// * @constant {String}\n// * */\nconst prefix = \"pfe\";\n\n/**\n * @class PFElement\n * @extends HTMLElement\n * @version 1.12.3\n * @classdesc Serves as the baseline for all PatternFly Element components.\n */\nclass PFElement extends HTMLElement {\n /**\n * A boolean value that indicates if the logging should be printed to the console; used for debugging.\n * For use in a JS file or script tag; can also be added in the constructor of a component during development.\n * @example PFElement.debugLog(true);\n * @tags debug\n */\n static debugLog(preference = null) {\n if (preference !== null) {\n // wrap localStorage references in a try/catch; merely referencing it can\n // throw errors in some locked down environments\n try {\n localStorage.pfeLog = !!preference;\n } catch (e) {\n // if localStorage fails, fall back to PFElement._debugLog\n PFElement._debugLog = !!preference;\n return PFElement._debugLog;\n }\n }\n // @TODO the reference to _debugLog is for backwards compatibiilty and will be removed in 2.0\n return localStorage.pfeLog === \"true\" || PFElement._debugLog;\n }\n\n /**\n * A boolean value that indicates if the performance should be tracked.\n * For use in a JS file or script tag; can also be added in the constructor of a component during development.\n * @example PFElement._trackPerformance = true;\n */\n static trackPerformance(preference = null) {\n if (preference !== null) {\n PFElement._trackPerformance = !!preference;\n }\n return PFElement._trackPerformance;\n }\n\n /**\n * A object that contains configuration set outside of pfe.\n *\n * @example const config = PFElement.config;\n */\n static get config() {\n // @TODO: Add config validation in the future.\n return window.PfeConfig || {};\n }\n\n /**\n * A logging wrapper which checks the debugLog boolean and prints to the console if true.\n *\n * @example PFElement.log(\"Hello\");\n */\n static log(...msgs) {\n if (PFElement.debugLog()) {\n console.log(...msgs);\n }\n }\n\n /**\n * Local logging that outputs the tag name as a prefix automatically\n *\n * @example this.log(\"Hello\");\n */\n log(...msgs) {\n PFElement.log(`[${this.tag}${this.id ? `#${this.id}` : \"\"}]`, ...msgs);\n }\n\n /**\n * A console warning wrapper which formats your output with useful debugging information.\n *\n * @example PFElement.warn(\"Hello\");\n */\n static warn(...msgs) {\n console.warn(...msgs);\n }\n\n /**\n * Local warning wrapper that outputs the tag name as a prefix automatically.\n * For use inside a component's function.\n * @example this.warn(\"Hello\");\n */\n warn(...msgs) {\n PFElement.warn(`[${this.tag}${this.id ? `#${this.id}` : ``}]`, ...msgs);\n }\n\n /**\n * A console error wrapper which formats your output with useful debugging information.\n * For use inside a component's function.\n * @example PFElement.error(\"Hello\");\n */\n static error(...msgs) {\n throw new Error([...msgs].join(\" \"));\n }\n\n /**\n * Local error wrapper that outputs the tag name as a prefix automatically.\n * For use inside a component's function.\n * @example this.error(\"Hello\");\n */\n error(...msgs) {\n PFElement.error(`[${this.tag}${this.id ? `#${this.id}` : ``}]`, ...msgs);\n }\n\n /**\n * A global definition of component types (a general way of defining the purpose of a\n * component and how it is put together).\n */\n static get PfeTypes() {\n return {\n Container: \"container\",\n Content: \"content\",\n Combo: \"combo\",\n };\n }\n\n /**\n * The current version of a component; set by the compiler using the package.json data.\n */\n static get version() {\n return \"1.12.3\";\n }\n\n /**\n * A local alias to the static version.\n * For use in the console to validate version being loaded.\n * @example PfeAccordion.version\n */\n get version() {\n return this._pfeClass.version;\n }\n\n /**\n * Global property definitions: properties managed by the base class that apply to all components.\n */\n static get properties() {\n return {\n pfelement: {\n title: \"Upgraded flag\",\n type: Boolean,\n default: true,\n observer: \"_upgradeObserver\",\n },\n on: {\n title: \"Context\",\n description: \"Describes the visual context (backgrounds).\",\n type: String,\n values: [\"light\", \"dark\", \"saturated\"],\n default: (el) => el.contextVariable,\n observer: \"_onObserver\",\n },\n context: {\n title: \"Context hook\",\n description: \"Lets you override the system-set context.\",\n type: String,\n values: [\"light\", \"dark\", \"saturated\"],\n observer: \"_contextObserver\",\n },\n // @TODO: Deprecated with 1.0\n oldTheme: {\n type: String,\n values: [\"light\", \"dark\", \"saturated\"],\n alias: \"context\",\n attr: \"pfe-theme\",\n },\n _style: {\n title: \"Custom styles\",\n type: String,\n attr: \"style\",\n observer: \"_inlineStyleObserver\",\n },\n type: {\n title: \"Component type\",\n type: String,\n values: [\"container\", \"content\", \"combo\"],\n },\n };\n }\n\n static get observedAttributes() {\n const properties = this.allProperties;\n if (properties) {\n const oa = Object.keys(properties)\n .filter((prop) => properties[prop].observer || properties[prop].cascade || properties[prop].alias)\n .map((p) => this._convertPropNameToAttrName(p));\n return [...oa];\n }\n }\n\n /**\n * A quick way to fetch a random ID value.\n * _Note:_ All values are prefixes with `pfe` automatically to ensure an ID-safe value is returned.\n *\n * @example this.id = this.randomID;\n */\n get randomId() {\n return `${prefix}-` + Math.random().toString(36).substr(2, 9);\n }\n\n /**\n * Set the --context variable with the provided value in this component.\n */\n set contextVariable(value) {\n this.cssVariable(\"context\", value);\n }\n\n /**\n * Get the current value of the --context variable in this component.\n * @return {string} [dark|light|saturated]\n */\n get contextVariable() {\n /* @DEPRECATED --theme in 1.0, to be removed in 2.0 */\n return this.cssVariable(\"context\") || this.cssVariable(\"theme\");\n }\n\n /**\n * Returns a boolean statement of whether or not this component contains any light DOM.\n * @returns {boolean}\n * @example if(this.hasLightDOM()) this._init();\n */\n hasLightDOM() {\n return this.children.length || this.textContent.trim().length;\n }\n\n /**\n * Returns a boolean statement of whether or not that slot exists in the light DOM.\n *\n * @param {String|Array} name The slot name.\n * @example this.hasSlot(\"header\");\n */\n hasSlot(name) {\n if (!name) {\n this.warn(`Please provide at least one slot name for which to search.`);\n return;\n }\n\n if (typeof name === \"string\") {\n return (\n [...this.children].filter((child) => child.hasAttribute(\"slot\") && child.getAttribute(\"slot\") === name).length >\n 0\n );\n } else if (Array.isArray(name)) {\n return name.reduce(\n (n) =>\n [...this.children].filter((child) => child.hasAttribute(\"slot\") && child.getAttribute(\"slot\") === n).length >\n 0\n );\n } else {\n this.warn(`Expected hasSlot argument to be a string or an array, but it was given: ${typeof name}.`);\n return;\n }\n }\n\n /**\n * Given a slot name, returns elements assigned to the slot as an arry.\n * If no value is provided (i.e., `this.getSlot()`), it returns all children not assigned to a slot (without a slot attribute).\n *\n * @example: `this.getSlot(\"header\")`\n */\n getSlot(name = \"unassigned\") {\n if (name !== \"unassigned\") {\n return [...this.children].filter((child) => child.hasAttribute(\"slot\") && child.getAttribute(\"slot\") === name);\n } else {\n return [...this.children].filter((child) => !child.hasAttribute(\"slot\"));\n }\n }\n\n cssVariable(name, value, element = this) {\n name = name.substr(0, 2) !== \"--\" ? \"--\" + name : name;\n if (value) {\n element.style.setProperty(name, value);\n return value;\n }\n return window.getComputedStyle(element).getPropertyValue(name).trim() || null;\n }\n\n /**\n * This alerts nested components to a change in the context\n */\n contextUpdate() {\n // Loop over light DOM elements, find direct descendants that are components\n const lightEls = [...this.querySelectorAll(\"*\")]\n .filter((item) => item.tagName.toLowerCase().slice(0, 4) === `${prefix}-`)\n // Closest will return itself or it's ancestor matching that selector\n .filter((item) => {\n // If there is no parent element, return null\n if (!item.parentElement) return;\n // Otherwise, find the closest component that's this one\n else return item.parentElement.closest(`[${this._pfeClass._getCache(\"prop2attr\").pfelement}]`) === this;\n });\n\n // Loop over shadow elements, find direct descendants that are components\n let shadowEls = [...this.shadowRoot.querySelectorAll(\"*\")]\n .filter((item) => item.tagName.toLowerCase().slice(0, 4) === `${prefix}-`)\n // Closest will return itself or it's ancestor matching that selector\n .filter((item) => {\n // If there is a parent element and we can find another web component in the ancestor tree\n if (item.parentElement && item.parentElement.closest(`[${this._pfeClass._getCache(\"prop2attr\").pfelement}]`)) {\n return item.parentElement.closest(`[${this._pfeClass._getCache(\"prop2attr\").pfelement}]`) === this;\n }\n // Otherwise, check if the host matches this context\n if (item.getRootNode().host === this) return true;\n\n // If neither state is true, return false\n return false;\n });\n\n const nestedEls = lightEls.concat(shadowEls);\n\n // If nested elements don't exist, return without processing\n if (nestedEls.length === 0) return;\n\n // Loop over the nested elements and reset their context\n nestedEls.map((child) => {\n if (child.resetContext) {\n this.log(`Update context of ${child.tagName.toLowerCase()}`);\n\n // Ask the component to recheck it's context in case it changed\n child.resetContext(this.on);\n }\n });\n }\n\n resetContext(fallback) {\n if (this.isIE11) return;\n\n // Priority order for context values to be pulled from:\n //--> 1. context (OLD: pfe-theme)\n //--> 2. --context (OLD: --theme)\n let value = this.context || this.contextVariable || fallback;\n\n // Validate that the current context (this.on) and the new context (value) are the same OR\n // no context is set and there isn't a new context being set\n if (this.on === value || (!this.on && !value)) return;\n\n this.log(`Resetting context from ${this.on} to ${value || \"null\"}`);\n this.on = value;\n }\n\n constructor(pfeClass, { type = null, delayRender = false } = {}) {\n super();\n\n this._pfeClass = pfeClass;\n this.tag = pfeClass.tag;\n this._parseObserver = this._parseObserver.bind(this);\n this.isIE11 = /MSIE|Trident|Edge\\//.test(window.navigator.userAgent);\n\n // Initialize the array of jump links pointers\n // Expects items in the array to be NodeItems\n if (!this._pfeClass.instances || !(this._pfeClass.instances.length >= 0)) this._pfeClass.instances = [];\n\n // Set up the mark ID based on existing ID on component if it exists\n if (!this.id) {\n this._markId = this.randomId.replace(\"pfe\", this.tag);\n } else if (this.id.startsWith(\"pfe-\") && !this.id.startsWith(this.tag)) {\n this._markId = this.id.replace(\"pfe\", this.tag);\n } else {\n this._markId = `${this.tag}-${this.id}`;\n }\n\n this._markCount = 0;\n\n // TODO: Deprecated for 1.0 release\n this.schemaProps = pfeClass.schemaProperties;\n\n // TODO: Migrate this out of schema for 1.0\n this.slots = pfeClass.slots;\n\n this.template = document.createElement(\"template\");\n\n // Set the default value to the passed in type\n if (type && this._pfeClass.allProperties.type) this._pfeClass.allProperties.type.default = type;\n\n // Initalize the properties and attributes from the property getter\n this._initializeProperties();\n\n this.attachShadow({ mode: \"open\" });\n\n // Tracks if the component has been initially rendered. Useful if for debouncing\n // template updates.\n this._rendered = false;\n\n if (!delayRender) this.render();\n }\n\n /**\n * Standard connected callback; fires when the component is added to the DOM.\n */\n connectedCallback() {\n this._initializeAttributeDefaults();\n\n if (window.ShadyCSS) window.ShadyCSS.styleElement(this);\n\n // Register this instance with the pointer for the scoped class and the global context\n this._pfeClass.instances.push(this);\n PFElement.allInstances.push(this);\n\n // If the slot definition exists, set up an observer\n if (typeof this.slots === \"object\") {\n this._slotsObserver = new MutationObserver(() => this._initializeSlots(this.tag, this.slots));\n this._initializeSlots(this.tag, this.slots);\n }\n }\n\n /**\n * Standard disconnected callback; fires when a componet is removed from the DOM.\n * Add your removeEventListeners here.\n */\n disconnectedCallback() {\n if (this._cascadeObserver) this._cascadeObserver.disconnect();\n if (this._slotsObserver) this._slotsObserver.disconnect();\n\n // Remove this instance from the pointer\n const classIdx = this._pfeClass.instances.find((item) => item !== this);\n delete this._pfeClass.instances[classIdx];\n\n const globalIdx = PFElement.allInstances.find((item) => item !== this);\n delete PFElement.allInstances[globalIdx];\n }\n\n /**\n * Attribute changed callback fires when attributes are updated.\n * This combines the global and the component-specific logic.\n */\n attributeChangedCallback(attr, oldVal, newVal) {\n if (!this._pfeClass.allProperties) return;\n\n let propName = this._pfeClass._attr2prop(attr);\n\n const propDef = this._pfeClass.allProperties[propName];\n\n // If the attribute that changed derives from a property definition\n if (propDef) {\n // If the property/attribute pair has an alias, copy the new value to the alias target\n if (propDef.alias) {\n const aliasedPropDef = this._pfeClass.allProperties[propDef.alias];\n const aliasedAttr = this._pfeClass._prop2attr(propDef.alias);\n const aliasedAttrVal = this.getAttribute(aliasedAttr);\n if (aliasedAttrVal !== newVal) {\n this[propDef.alias] = this._castPropertyValue(aliasedPropDef, newVal);\n }\n }\n\n // If the property/attribute pair has an observer, fire it\n // Observers receive the oldValue and the newValue from the attribute changed callback\n if (propDef.observer) {\n this[propDef.observer](this._castPropertyValue(propDef, oldVal), this._castPropertyValue(propDef, newVal));\n }\n\n // If the property/attribute pair has a cascade target, copy the attribute to the matching elements\n // Note: this handles the cascading of new/updated attributes\n if (propDef.cascade) {\n this._cascadeAttribute(attr, this._pfeClass._convertSelectorsToArray(propDef.cascade));\n }\n }\n }\n\n /**\n * Standard render function.\n */\n render() {\n this.shadowRoot.innerHTML = \"\";\n this.template.innerHTML = this.html;\n\n if (window.ShadyCSS) {\n window.ShadyCSS.prepareTemplate(this.template, this.tag);\n }\n\n this.shadowRoot.appendChild(this.template.content.cloneNode(true));\n\n this.log(`render`);\n\n // Cascade properties to the rendered template\n this.cascadeProperties();\n\n // Update the display context\n this.contextUpdate();\n\n if (PFElement.trackPerformance()) {\n try {\n performance.mark(`${this._markId}-rendered`);\n\n if (this._markCount < 1) {\n this._markCount = this._markCount + 1;\n\n // Navigation start, i.e., the browser first sees that the user has navigated to the page\n performance.measure(`${this._markId}-from-navigation-to-first-render`, undefined, `${this._markId}-rendered`);\n\n // Render is run before connection unless delayRender is used\n performance.measure(\n `${this._markId}-from-defined-to-first-render`,\n `${this._markId}-defined`,\n `${this._markId}-rendered`\n );\n }\n } catch (err) {\n this.log(`Performance marks are not supported by this browser.`);\n }\n }\n\n // If the slot definition exists, set up an observer\n if (typeof this.slots === \"object\" && this._slotsObserver) {\n this._slotsObserver.observe(this, { childList: true });\n }\n\n // If an observer was defined, set it to begin observing here\n if (this._cascadeObserver) {\n this._cascadeObserver.observe(this, {\n attributes: true,\n childList: true,\n subtree: true,\n });\n }\n\n this._rendered = true;\n }\n\n /**\n * A wrapper around an event dispatch to standardize formatting.\n */\n emitEvent(name, { bubbles = true, cancelable = false, composed = true, detail = {} } = {}) {\n if (detail) this.log(`Custom event: ${name}`, detail);\n else this.log(`Custom event: ${name}`);\n\n this.dispatchEvent(\n new CustomEvent(name, {\n bubbles,\n cancelable,\n composed,\n detail,\n })\n );\n }\n\n /**\n * Handles the cascading of properties to nested components when new elements are added\n * Attribute updates/additions are handled by the attribute callback\n */\n cascadeProperties(nodeList) {\n const cascade = this._pfeClass._getCache(\"cascadingProperties\");\n\n if (cascade) {\n if (this._cascadeObserver) this._cascadeObserver.disconnect();\n\n let selectors = Object.keys(cascade);\n // Find out if anything in the nodeList matches any of the observed selectors for cacading properties\n if (selectors) {\n if (nodeList) {\n [...nodeList].forEach((nodeItem) => {\n selectors.forEach((selector) => {\n // if this node has a match function (i.e., it's an HTMLElement, not\n // a text node), see if it matches the selector, otherwise drop it (like it's hot).\n if (nodeItem.matches && nodeItem.matches(selector)) {\n let attrNames = cascade[selector];\n // each selector can match multiple properties/attributes, so\n // copy each of them\n attrNames.forEach((attrName) => this._copyAttribute(attrName, nodeItem));\n }\n });\n });\n } else {\n // If a match was found, cascade each attribute to the element\n const components = selectors\n .filter((item) => item.slice(0, prefix.length + 1) === `${prefix}-`)\n .map((name) => customElements.whenDefined(name));\n\n if (components)\n Promise.all(components).then(() => {\n this._cascadeAttributes(selectors, cascade);\n });\n else this._cascadeAttributes(selectors, cascade);\n }\n }\n\n if (this._rendered && this._cascadeObserver)\n this._cascadeObserver.observe(this, {\n attributes: true,\n childList: true,\n subtree: true,\n });\n }\n }\n\n /* --- Observers for global properties --- */\n\n /**\n * This responds to changes in the pfelement attribute; indicates if the component upgraded\n * @TODO maybe we should use just the attribute instead of the class?\n * https://github.com/angular/angular/issues/15399#issuecomment-318785677\n */\n _upgradeObserver() {\n this.classList.add(\"PFElement\");\n }\n\n /**\n * This responds to changes in the context attribute; manual override tool\n */\n _contextObserver(oldValue, newValue) {\n if (newValue && ((oldValue && oldValue !== newValue) || !oldValue)) {\n this.log(`Running the context observer`);\n this.on = newValue;\n this.cssVariable(\"context\", newValue);\n }\n }\n\n /**\n * This responds to changes in the context; source of truth for components\n */\n _onObserver(oldValue, newValue) {\n if ((oldValue && oldValue !== newValue) || (newValue && !oldValue)) {\n this.log(`Context update`);\n // Fire an event for child components\n this.contextUpdate();\n }\n }\n\n /**\n * This responds to inline style changes and greps for context or theme updates.\n * @TODO: --theme will be deprecated in 2.0\n */\n _inlineStyleObserver(oldValue, newValue) {\n if (oldValue === newValue) return;\n // If there are no inline styles, a context might have been deleted, so call resetContext\n if (!newValue) this.resetContext();\n else {\n this.log(`Style observer activated on ${this.tag}`, `${newValue || \"null\"}`);\n // Grep for context/theme\n const regex = /--[\\w|-]*(?:context|theme):\\s*(?:\\\"*(light|dark|saturated)\\\"*)/gi;\n let match = regex.exec(newValue);\n\n // If no match is returned, exit the observer\n if (!match) return;\n\n const newContext = match[1];\n // If the new context value differs from the on value, update\n if (newContext !== this.on && !this.context) this.on = newContext;\n }\n }\n\n /**\n * This is connected with a mutation observer that watches for updates to the light DOM\n * and pushes down the cascading values\n */\n _parseObserver(mutationsList) {\n // Iterate over the mutation list, look for cascade updates\n for (let mutation of mutationsList) {\n // If a new node is added, attempt to cascade attributes to it\n if (mutation.type === \"childList\" && mutation.addedNodes.length) {\n const nonTextNodes = [...mutation.addedNodes].filter((n) => n.nodeType !== HTMLElement.TEXT_NODE);\n this.cascadeProperties(nonTextNodes);\n }\n }\n }\n /* --- End observers --- */\n\n /**\n * Validate that the property meets the requirements for type and naming.\n */\n static _validateProperties() {\n for (let propName in this.allProperties) {\n const propDef = this.allProperties[propName];\n\n // Verify that properties conform to the allowed data types\n if (!isAllowedType(propDef)) {\n this.error(`Property \"${propName}\" on ${this.name} must have type String, Number, or Boolean.`);\n }\n\n // Verify the property name conforms to our naming rules\n if (!/^[a-z_]/.test(propName)) {\n this.error(\n `Property ${this.name}.${propName} defined, but prop names must begin with a lower-case letter or an underscore`\n );\n }\n\n const isFunction = typeof propDef.default === \"function\";\n\n // If the default value is not the same type as defined by the property\n // and it's not a function (we can't validate the output of the function\n // on the class level), throw a warning\n if (propDef.default && !isValidDefaultType(propDef) && !isFunction)\n this.error(\n `[${this.name}] The default value \\`${propDef.default}\\` does not match the assigned type ${propDef.type.name} for the \\'${propName}\\' property`\n );\n }\n }\n\n /**\n * Convert provided property value to the correct type as defined in the properties method.\n */\n _castPropertyValue(propDef, attrValue) {\n switch (propDef.type) {\n case Number:\n // map various attribute string values to their respective\n // desired property values\n return {\n [attrValue]: Number(attrValue),\n null: null,\n NaN: NaN,\n undefined: undefined,\n }[attrValue];\n\n case Boolean:\n return attrValue !== null;\n\n case String:\n return {\n [attrValue]: attrValue,\n undefined: undefined,\n }[attrValue];\n\n default:\n return attrValue;\n }\n }\n\n /**\n * Map provided value to the attribute name on the component.\n */\n _assignValueToAttribute(obj, attr, value) {\n // If the default is false and the property is boolean, we don't need to do anything\n const isBooleanFalse = obj.type === Boolean && !value;\n const isNull = value === null;\n const isUndefined = typeof value === \"undefined\";\n\n // If the attribute is not defined, set the default value\n if (isBooleanFalse || isNull || isUndefined) {\n this.removeAttribute(attr);\n } else {\n // Boolean values get an empty string: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#boolean-attributes\n if (obj.type === Boolean && typeof value === \"boolean\") {\n this.setAttribute(attr, \"\");\n } else {\n // Validate against the provided values\n if (obj.values) {\n this._validateAttributeValue(obj, attr, value);\n }\n\n // Still accept the value provided even if it's not valid\n this.setAttribute(attr, value);\n }\n }\n }\n\n /**\n * Maps the defined slots into an object that is easier to query\n */\n _initializeSlots(tag, slots) {\n this.log(\"Validate slots...\");\n\n if (this._slotsObserver) this._slotsObserver.disconnect();\n\n // Loop over the properties provided by the schema\n Object.keys(slots).forEach((slot) => {\n let slotObj = slots[slot];\n\n // Only attach the information if the data provided is a schema object\n if (typeof slotObj === \"object\") {\n let slotExists = false;\n let result = [];\n // If it's a named slot, look for that slot definition\n if (slotObj.namedSlot) {\n // Check prefixed slots\n result = this.getSlot(`${tag}--${slot}`);\n if (result.length > 0) {\n slotObj.nodes = result;\n slotExists = true;\n }\n\n // Check for unprefixed slots\n result = this.getSlot(`${slot}`);\n if (result.length > 0) {\n slotObj.nodes = result;\n slotExists = true;\n }\n // If it's the default slot, look for direct children not assigned to a slot\n } else {\n result = [...this.children].filter((child) => !child.hasAttribute(\"slot\"));\n\n if (result.length > 0) {\n slotObj.nodes = result;\n slotExists = true;\n }\n }\n\n // If the slot exists, attach an attribute to the parent to indicate that\n if (slotExists) {\n this.setAttribute(`has_${slot}`, \"\");\n } else {\n this.removeAttribute(`has_${slot}`);\n }\n }\n });\n\n this.log(\"Slots validated.\");\n\n if (this._slotsObserver) this._slotsObserver.observe(this, { childList: true });\n }\n\n /**\n * Sets up the property definitions based on the properties method.\n */\n _initializeProperties() {\n const properties = this._pfeClass.allProperties;\n let hasCascade = false;\n\n if (Object.keys(properties).length > 0) this.log(`Initialize properties`);\n\n for (let propName in properties) {\n const propDef = properties[propName];\n\n // Check if the property exists, throw a warning if it does.\n // HTMLElements have a LOT of properties; it wouldn't be hard\n // to overwrite one accidentally.\n if (typeof this[propName] !== \"undefined\") {\n this.log(\n `Property \"${propName}\" on ${this.constructor.name} cannot be defined because the property name is reserved`\n );\n } else {\n const attrName = this._pfeClass._prop2attr(propName);\n if (propDef.cascade) hasCascade = true;\n\n Object.defineProperty(this, propName, {\n get: () => {\n const attrValue = this.getAttribute(attrName);\n\n return this._castPropertyValue(propDef, attrValue);\n },\n set: (rawNewVal) => {\n // Assign the value to the attribute\n this._assignValueToAttribute(propDef, attrName, rawNewVal);\n\n return rawNewVal;\n },\n writeable: true,\n enumerable: true,\n configurable: false,\n });\n }\n }\n\n // If any of the properties has cascade, attach a new mutation observer to the component\n if (hasCascade) {\n this._cascadeObserver = new MutationObserver(this._parseObserver);\n }\n }\n\n /**\n * Intialize the default value for an attribute.\n */\n _initializeAttributeDefaults() {\n const properties = this._pfeClass.allProperties;\n\n for (let propName in properties) {\n const propDef = properties[propName];\n\n const attrName = this._pfeClass._prop2attr(propName);\n\n if (propDef.hasOwnProperty(\"default\")) {\n let value = propDef.default;\n\n // Check if default is a function\n if (typeof propDef.default === \"function\") {\n value = propDef.default(this);\n }\n\n // If the attribute has not already been set, assign the default value\n if (!this.hasAttribute(attrName)) {\n // Assign the value to the attribute\n this._assignValueToAttribute(propDef, attrName, value);\n }\n }\n }\n }\n\n /**\n * Validate the value against provided values.\n */\n // @TODO add support for a validation function\n _validateAttributeValue(propDef, attr, value) {\n if (\n Array.isArray(propDef.values) &&\n propDef.values.length > 0 &&\n !propDef.values.includes(value) // ||\n // (typeof propDef.values === \"string\" && propDef.values !== value) ||\n // (typeof propDef.values === \"function\" && !propDef.values(value))\n ) {\n this.warn(\n `${value} is not a valid value for ${attr}. Please provide one of the following values: ${propDef.values.join(\n \", \"\n )}`\n );\n }\n\n return value;\n }\n\n /**\n * Look up an attribute name linked to a given property name.\n */\n static _prop2attr(propName) {\n return this._getCache(\"prop2attr\")[propName];\n }\n\n /**\n * Look up an property name linked to a given attribute name.\n */\n static _attr2prop(attrName) {\n return this._getCache(\"attr2prop\")[attrName];\n }\n\n /**\n * Convert a property name to an attribute name.\n */\n static _convertPropNameToAttrName(propName) {\n const propDef = this.allProperties[propName];\n\n if (propDef.attr) {\n return propDef.attr;\n }\n\n return propName\n .replace(/^_/, \"\")\n .replace(/^[A-Z]/, (l) => l.toLowerCase())\n .replace(/[A-Z]/g, (l) => `-${l.toLowerCase()}`);\n }\n\n /**\n * Convert an attribute name to a property name.\n */\n static _convertAttrNameToPropName(attrName) {\n for (let prop in this.allProperties) {\n if (this.allProperties[prop].attr === attrName) {\n return prop;\n }\n }\n\n // Convert the property name to kebab case\n const propName = attrName.replace(/-([A-Za-z])/g, (l) => l[1].toUpperCase());\n return propName;\n }\n\n _cascadeAttributes(selectors, set) {\n selectors.forEach((selector) => {\n set[selector].forEach((attr) => {\n this._cascadeAttribute(attr, selector);\n });\n });\n }\n\n /**\n * Trigger a cascade of the named attribute to any child elements that match\n * the `to` selector. The selector can match elements in the light DOM and\n * shadow DOM.\n * @param {String} name The name of the attribute to cascade (not necessarily the same as the property name).\n * @param {String} to A CSS selector that matches the elements that should received the cascaded attribute. The selector will be applied within `this` element's light and shadow DOM trees.\n */\n _cascadeAttribute(name, to) {\n const recipients = [...this.querySelectorAll(to), ...this.shadowRoot.querySelectorAll(to)];\n\n for (const node of recipients) {\n this._copyAttribute(name, node);\n }\n }\n\n /**\n * Copy the named attribute to a target element.\n */\n _copyAttribute(name, el) {\n this.log(`copying ${name} to ${el}`);\n const value = this.getAttribute(name);\n const fname = value == null ? \"removeAttribute\" : \"setAttribute\";\n el[fname](name, value);\n }\n\n static _convertSelectorsToArray(selectors) {\n if (selectors) {\n if (typeof selectors === \"string\") return selectors.split(\",\");\n else if (typeof selectors === \"object\") return selectors;\n else {\n this.warn(`selectors should be provided as a string, array, or object; received: ${typeof selectors}.`);\n }\n }\n\n return;\n }\n\n static _parsePropertiesForCascade(mergedProperties) {\n let cascadingProperties = {};\n // Parse the properties to pull out attributes that cascade\n for (const [propName, config] of Object.entries(mergedProperties)) {\n let cascadeTo = this._convertSelectorsToArray(config.cascade);\n\n // Iterate over each node in the cascade list for this property\n if (cascadeTo)\n cascadeTo.map((nodeItem) => {\n let attr = this._prop2attr(propName);\n // Create an object with the node as the key and an array of attributes\n // that are to be cascaded down to it\n if (!cascadingProperties[nodeItem]) cascadingProperties[nodeItem] = [attr];\n else cascadingProperties[nodeItem].push(attr);\n });\n }\n\n return cascadingProperties;\n }\n\n /**\n * Caching the attributes and properties data for efficiency\n */\n static create(pfe) {\n pfe._createCache();\n pfe._populateCache(pfe);\n pfe._validateProperties();\n\n try {\n window.customElements.define(pfe.tag, pfe);\n } catch (err) {\n // Capture the class currently using this tag in the registry\n const prevDefinition = window.customElements.get(pfe.tag);\n\n // Check if the previous definition's version matches this one\n if (prevDefinition && prevDefinition.version !== pfe.version) {\n this.warn(\n `${pfe.tag} was registered at version ${prevDefinition.version}; cannot register version ${pfe.version}.`\n );\n }\n\n // @TODO Should this error be reported to the console?\n if (err && err.message) this.log(err.message);\n }\n\n if (PFElement.trackPerformance()) {\n try {\n performance.mark(`${this._markId}-defined`);\n } catch (err) {\n this.log(`Performance marks are not supported by this browser.`);\n }\n }\n }\n\n static _createCache() {\n this._cache = {\n properties: {},\n globalProperties: {},\n componentProperties: {},\n cascadingProperties: {},\n attr2prop: {},\n prop2attr: {},\n };\n }\n\n /**\n * Cache an object in a given cache namespace. This overwrites anything\n * already in that namespace.\n */\n static _setCache(namespace, object) {\n this._cache[namespace] = object;\n }\n\n /**\n * Get a cached object by namespace, or get all cached objects.\n */\n static _getCache(namespace) {\n return namespace ? this._cache[namespace] : this._cache;\n }\n\n /**\n * Populate initial values for properties cache.\n */\n static _populateCache(pfe) {\n // @TODO add a warning when a component property conflicts with a global property.\n const mergedProperties = { ...pfe.properties, ...PFElement.properties };\n\n pfe._setCache(\"componentProperties\", pfe.properties);\n pfe._setCache(\"globalProperties\", PFElement.properties);\n pfe._setCache(\"properties\", mergedProperties);\n\n // create mapping objects to go from prop name to attrname and back\n const prop2attr = {};\n const attr2prop = {};\n for (let propName in mergedProperties) {\n const attrName = this._convertPropNameToAttrName(propName);\n prop2attr[propName] = attrName;\n attr2prop[attrName] = propName;\n }\n pfe._setCache(\"attr2prop\", attr2prop);\n pfe._setCache(\"prop2attr\", prop2attr);\n\n const cascadingProperties = this._parsePropertiesForCascade(mergedProperties);\n if (Object.keys(cascadingProperties)) pfe._setCache(\"cascadingProperties\", cascadingProperties);\n }\n\n /**\n * allProperties returns an object containing PFElement's global properties\n * and the descendents' (such as PfeCard, etc) component properties. The two\n * objects are merged together and in the case of a property name conflict,\n * PFElement's properties override the component's properties.\n */\n static get allProperties() {\n return this._getCache(\"properties\");\n }\n\n /**\n * cascadingProperties returns an object containing PFElement's global properties\n * and the descendents' (such as PfeCard, etc) component properties. The two\n * objects are merged together and in the case of a property name conflict,\n * PFElement's properties override the component's properties.\n */\n static get cascadingProperties() {\n return this._getCache(\"cascadingProperties\");\n }\n\n /**\n * Breakpoint object mapping human-readable size names to viewport sizes\n * To overwrite this at the component-level, include `static get breakpoint` in your component's class definition\n * @returns {Object} keys are t-shirt sizes and values map to screen-sizes (sourced from PF4)\n */\n static get breakpoint() {\n return {\n xs: \"0px\", // $pf-global--breakpoint--xs: 0 !default;\n sm: \"576px\", // $pf-global--breakpoint--sm: 576px !default;\n md: \"768px\", // $pf-global--breakpoint--md: 768px !default;\n lg: \"992px\", // $pf-global--breakpoint--lg: 992px !default;\n xl: \"1200px\", // $pf-global--breakpoint--xl: 1200px !default;\n \"2xl\": \"1450px\", // $pf-global--breakpoint--2xl: 1450px !default;\n };\n }\n}\n\n// Initialize the global instances\nPFElement.allInstances = [];\n\nautoReveal(PFElement.log);\n\n/** @module PFElement */\nexport default PFElement;\n"],"names":["logger","handleWebComponentsReady","window","document","body","removeAttribute","isValidDefaultType","definition","hasOwnProperty","default","constructor","type","Array","prototype","includes","Object","defineProperty","value","valueToFind","fromIndex","this","TypeError","o","len","length","x","y","n","k","Math","max","abs","isNaN","entries","obj","ownProps","keys","i","resArray","String","startsWith","search","rawPos","pos","substring","Element","closest","s","el","matches","parentElement","parentNode","nodeType","msMatchesSelector","webkitMatchesSelector","find","predicate","thisArg","arguments","kValue","call","configurable","writable","PFElement","HTMLElement","[object Object]","preference","localStorage","pfeLog","e","_debugLog","_trackPerformance","config","PfeConfig","msgs","debugLog","console","log","tag","id","warn","Error","join","error","PfeTypes","Container","Content","Combo","version","_pfeClass","properties","pfelement","title","Boolean","observer","on","description","values","contextVariable","context","oldTheme","alias","attr","_style","observedAttributes","allProperties","filter","prop","cascade","map","p","_convertPropNameToAttrName","randomId","random","toString","substr","cssVariable","children","textContent","trim","name","child","hasAttribute","getAttribute","isArray","reduce","element","style","setProperty","getComputedStyle","getPropertyValue","lightEls","querySelectorAll","item","tagName","toLowerCase","slice","_getCache","shadowEls","shadowRoot","getRootNode","host","nestedEls","concat","resetContext","fallback","isIE11","pfeClass","delayRender","super","_parseObserver","bind","test","navigator","userAgent","instances","_markId","replace","_markCount","schemaProps","schemaProperties","slots","template","createElement","_initializeProperties","attachShadow","mode","_rendered","render","_initializeAttributeDefaults","ShadyCSS","styleElement","push","allInstances","_slotsObserver","MutationObserver","_initializeSlots","_cascadeObserver","disconnect","classIdx","globalIdx","oldVal","newVal","propName","_attr2prop","propDef","aliasedPropDef","aliasedAttr","_prop2attr","_castPropertyValue","_cascadeAttribute","_convertSelectorsToArray","innerHTML","html","prepareTemplate","appendChild","content","cloneNode","cascadeProperties","contextUpdate","trackPerformance","performance","mark","measure","undefined","err","observe","childList","attributes","subtree","bubbles","cancelable","composed","detail","dispatchEvent","CustomEvent","nodeList","selectors","forEach","nodeItem","selector","attrName","_copyAttribute","components","customElements","whenDefined","Promise","all","then","_cascadeAttributes","classList","add","oldValue","newValue","match","exec","newContext","mutationsList","mutation","addedNodes","nonTextNodes","TEXT_NODE","Number","isFunction","attrValue","null","NaN","setAttribute","_validateAttributeValue","slot","slotObj","slotExists","result","namedSlot","getSlot","nodes","hasCascade","get","set","rawNewVal","_assignValueToAttribute","writeable","enumerable","l","toUpperCase","to","recipients","node","split","mergedProperties","cascadingProperties","cascadeTo","pfe","_createCache","_populateCache","_validateProperties","define","prevDefinition","message","_cache","globalProperties","componentProperties","attr2prop","prop2attr","namespace","object","_setCache","_parsePropertiesForCascade","breakpoint","xs","sm","md","lg","xl","2xl","logFunction","polyfillPresent","WebComponents","polyfillReady","ready","addEventListener","autoReveal"],"mappings":"AAAA,IAAIA,EAAS,IAAM,KAuCnB,SAASC,IACPD,EAAO,iCAhCPA,EAAO,+CACPE,OAAOC,SAASC,KAAKC,gBAAgB,cCWhC,SAASC,EAAmBC,GACjC,OAAOA,EAAWC,eAAe,YAAcD,EAAWE,QAAQC,cAAgBH,EAAWI,KCnB1FC,MAAMC,UAAUC,UACnBC,OAAOC,eAAeJ,MAAMC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