{"version":3,"file":"meCore.js","sources":["../../../../../node_modules/tslib/tslib.es6.js","../../../../../node_modules/preact/src/vnode.js","../../../../../node_modules/preact/src/options.js","../../../../../node_modules/preact/src/h.js","../../../../../node_modules/preact/src/util.js","../../../../../node_modules/preact/src/constants.js","../../../../../node_modules/preact/src/render-queue.js","../../../../../node_modules/preact/src/vdom/index.js","../../../../../node_modules/preact/src/dom/index.js","../../../../../node_modules/preact/src/vdom/diff.js","../../../../../node_modules/preact/src/vdom/component-recycler.js","../../../../../node_modules/preact/src/vdom/component.js","../../../../../node_modules/preact/src/component.js","../../../../../node_modules/classcat/src/index.js","../../lib/src/src/utilities/dom.ts","../../lib/src/src/utilities/elementAnchoring.ts","../../lib/src/src/components/Menu.tsx","../../lib/src/src/components/CustomCommands.tsx","../../lib/src/src/components/Presence.tsx","../../lib/src/src/components/PresenceDropdown.tsx","../../lib/src/src/components/FullDisplayName.tsx","../../lib/src/src/components/ViewAccountLink.tsx","../../lib/src/src/components/Company.tsx","../../lib/src/src/components/CurrentAccount.tsx","../../lib/src/components/src/components/account-list/AccountInfo.tsx","../../lib/src/components/src/components/account-list/AccountActions.tsx","../../lib/src/components/src/components/account-list/AccountItem.tsx","../../lib/src/components/src/components/account-list/SignInItem.tsx","../../lib/src/components/src/components/account-list/ScrollShadow.tsx","../../lib/src/components/src/components/account-list/AccountList.tsx","../../lib/src/components/src/components/account-list/SignedOutAccountListHeader.tsx","../../lib/src/src/components/Body.tsx","../../lib/src/src/components/DropdownBase.tsx","../../lib/src/src/components/Dropdown.tsx","../../lib/src/src/components/PresenceHeader.tsx","../../lib/src/telemetry/src/telemetry/creators/contentUpdate.ts","../../lib/src/telemetry/src/telemetry/creators/pageAction.ts","../../lib/src/telemetry/src/telemetry/creators/partnerApiCall.ts","../../lib/src/src/telemetry/index.ts","../../lib/src/index.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","/**\n * Virtual DOM Node\n * @typedef VNode\n * @property {string | function} nodeName The string of the DOM node to create or Component constructor to render\n * @property {Array} children The children of node\n * @property {string | number | undefined} key The key used to identify this VNode in a list\n * @property {object} attributes The properties of this VNode\n */\nexport const VNode = function VNode() {};\n","/**\n * @typedef {import('./component').Component} Component\n * @typedef {import('./vnode').VNode} VNode\n */\n\n/**\n * Global options\n * @public\n * @typedef Options\n * @property {boolean} [syncComponentUpdates] If `true`, `prop` changes trigger synchronous component updates. Defaults to true.\n * @property {(vnode: VNode) => void} [vnode] Processes all created VNodes.\n * @property {(component: Component) => void} [afterMount] Hook invoked after a component is mounted.\n * @property {(component: Component) => void} [afterUpdate] Hook invoked after the DOM is updated with a component's latest render.\n * @property {(component: Component) => void} [beforeUnmount] Hook invoked immediately before a component is unmounted.\n * @property {(rerender: function) => void} [debounceRendering] Hook invoked whenever a rerender is requested. Can be used to debounce rerenders.\n * @property {(event: Event) => Event | void} [event] Hook invoked before any Preact event listeners. The return value (if any) replaces the native browser event given to event listeners\n */\n\n/** @type {Options} */\nconst options = {};\n\nexport default options;\n","import { VNode } from './vnode';\nimport options from './options';\n\n\nconst stack = [];\n\nconst EMPTY_CHILDREN = [];\n\n/**\n * JSX/hyperscript reviver.\n * @see http://jasonformat.com/wtf-is-jsx\n * Benchmarks: https://esbench.com/bench/57ee8f8e330ab09900a1a1a0\n *\n * Note: this is exported as both `h()` and `createElement()` for compatibility\n * reasons.\n *\n * Creates a VNode (virtual DOM element). A tree of VNodes can be used as a\n * lightweight representation of the structure of a DOM tree. This structure can\n * be realized by recursively comparing it against the current _actual_ DOM\n * structure, and applying only the differences.\n *\n * `h()`/`createElement()` accepts an element name, a list of attributes/props,\n * and optionally children to append to the element.\n *\n * @example The following DOM tree\n *\n * `
Hello!
`\n *\n * can be constructed using this function as:\n *\n * `h('div', { id: 'foo', name : 'bar' }, 'Hello!');`\n *\n * @param {string | function} nodeName An element name. Ex: `div`, `a`, `span`, etc.\n * @param {object | null} attributes Any attributes/props to set on the created element.\n * @param {VNode[]} [rest] Additional arguments are taken to be children to\n * append. Can be infinitely nested Arrays.\n *\n * @public\n */\nexport function h(nodeName, attributes) {\n\tlet children=EMPTY_CHILDREN, lastSimple, child, simple, i;\n\tfor (i=arguments.length; i-- > 2; ) {\n\t\tstack.push(arguments[i]);\n\t}\n\tif (attributes && attributes.children!=null) {\n\t\tif (!stack.length) stack.push(attributes.children);\n\t\tdelete attributes.children;\n\t}\n\twhile (stack.length) {\n\t\tif ((child = stack.pop()) && child.pop!==undefined) {\n\t\t\tfor (i=child.length; i--; ) stack.push(child[i]);\n\t\t}\n\t\telse {\n\t\t\tif (typeof child==='boolean') child = null;\n\n\t\t\tif ((simple = typeof nodeName!=='function')) {\n\t\t\t\tif (child==null) child = '';\n\t\t\t\telse if (typeof child==='number') child = String(child);\n\t\t\t\telse if (typeof child!=='string') simple = false;\n\t\t\t}\n\n\t\t\tif (simple && lastSimple) {\n\t\t\t\tchildren[children.length-1] += child;\n\t\t\t}\n\t\t\telse if (children===EMPTY_CHILDREN) {\n\t\t\t\tchildren = [child];\n\t\t\t}\n\t\t\telse {\n\t\t\t\tchildren.push(child);\n\t\t\t}\n\n\t\t\tlastSimple = simple;\n\t\t}\n\t}\n\n\tlet p = new VNode();\n\tp.nodeName = nodeName;\n\tp.children = children;\n\tp.attributes = attributes==null ? undefined : attributes;\n\tp.key = attributes==null ? undefined : attributes.key;\n\n\t// if a \"vnode hook\" is defined, pass every created VNode to it\n\tif (options.vnode!==undefined) options.vnode(p);\n\n\treturn p;\n}\n","/**\n * Copy all properties from `props` onto `obj`.\n * @param {object} obj Object onto which properties should be copied.\n * @param {object} props Object from which to copy properties.\n * @returns {object}\n * @private\n */\nexport function extend(obj, props) {\n\tfor (let i in props) obj[i] = props[i];\n\treturn obj;\n}\n\n/** Invoke or update a ref, depending on whether it is a function or object ref.\n * @param {object|function} [ref=null]\n * @param {any} [value]\n */\nexport function applyRef(ref, value) {\n\tif (ref) {\n\t\tif (typeof ref=='function') ref(value);\n\t\telse ref.current = value;\n\t}\n}\n\n/**\n * Call a function asynchronously, as soon as possible. Makes\n * use of HTML Promise to schedule the callback if available,\n * otherwise falling back to `setTimeout` (mainly for IE<11).\n * @type {(callback: function) => void}\n */\nexport const defer = typeof Promise=='function' ? Promise.resolve().then.bind(Promise.resolve()) : setTimeout;\n","// render modes\n\n/** Do not re-render a component */\nexport const NO_RENDER = 0;\n/** Synchronously re-render a component and its children */\nexport const SYNC_RENDER = 1;\n/** Synchronously re-render a component, even if its lifecycle methods attempt to prevent it. */\nexport const FORCE_RENDER = 2;\n/** Queue asynchronous re-render of a component and it's children */\nexport const ASYNC_RENDER = 3;\n\n\nexport const ATTR_KEY = '__preactattr_';\n\n/** DOM properties that should NOT have \"px\" added when numeric */\nexport const IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i;\n\n","import options from './options';\nimport { defer } from './util';\nimport { renderComponent } from './vdom/component';\n\n/**\n * Managed queue of dirty components to be re-rendered\n * @type {Array}\n */\nlet items = [];\n\n/**\n * Enqueue a rerender of a component\n * @param {import('./component').Component} component The component to rerender\n */\nexport function enqueueRender(component) {\n\tif (!component._dirty && (component._dirty = true) && items.push(component)==1) {\n\t\t(options.debounceRendering || defer)(rerender);\n\t}\n}\n\n/** Rerender all enqueued dirty components */\nexport function rerender() {\n\tlet p;\n\twhile ( (p = items.pop()) ) {\n\t\tif (p._dirty) renderComponent(p);\n\t}\n}\n","import { extend } from '../util';\n\n\n/**\n * Check if two nodes are equivalent.\n * @param {import('../dom').PreactElement} node DOM Node to compare\n * @param {import('../vnode').VNode} vnode Virtual DOM node to compare\n * @param {boolean} [hydrating=false] If true, ignores component constructors\n * when comparing.\n * @private\n */\nexport function isSameNodeType(node, vnode, hydrating) {\n\tif (typeof vnode==='string' || typeof vnode==='number') {\n\t\treturn node.splitText!==undefined;\n\t}\n\tif (typeof vnode.nodeName==='string') {\n\t\treturn !node._componentConstructor && isNamedNode(node, vnode.nodeName);\n\t}\n\treturn hydrating || node._componentConstructor===vnode.nodeName;\n}\n\n\n/**\n * Check if an Element has a given nodeName, case-insensitively.\n * @param {import('../dom').PreactElement} node A DOM Element to inspect the name of.\n * @param {string} nodeName Unnormalized name to compare against.\n */\nexport function isNamedNode(node, nodeName) {\n\treturn node.normalizedNodeName===nodeName || node.nodeName.toLowerCase()===nodeName.toLowerCase();\n}\n\n\n/**\n * Reconstruct Component-style `props` from a VNode.\n * Ensures default/fallback values from `defaultProps`:\n * Own-properties of `defaultProps` not present in `vnode.attributes` are added.\n * @param {import('../vnode').VNode} vnode The VNode to get props for\n * @returns {object} The props to use for this VNode\n */\nexport function getNodeProps(vnode) {\n\tlet props = extend({}, vnode.attributes);\n\tprops.children = vnode.children;\n\n\tlet defaultProps = vnode.nodeName.defaultProps;\n\tif (defaultProps!==undefined) {\n\t\tfor (let i in defaultProps) {\n\t\t\tif (props[i]===undefined) {\n\t\t\t\tprops[i] = defaultProps[i];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn props;\n}\n","import { IS_NON_DIMENSIONAL } from '../constants';\nimport { applyRef } from '../util';\nimport options from '../options';\n\n/**\n * A DOM event listener\n * @typedef {(e: Event) => void} EventListner\n */\n\n/**\n * A mapping of event types to event listeners\n * @typedef {Object.} EventListenerMap\n */\n\n/**\n * Properties Preact adds to elements it creates\n * @typedef PreactElementExtensions\n * @property {string} [normalizedNodeName] A normalized node name to use in diffing\n * @property {EventListenerMap} [_listeners] A map of event listeners added by components to this DOM node\n * @property {import('../component').Component} [_component] The component that rendered this DOM node\n * @property {function} [_componentConstructor] The constructor of the component that rendered this DOM node\n */\n\n/**\n * A DOM element that has been extended with Preact properties\n * @typedef {Element & ElementCSSInlineStyle & PreactElementExtensions} PreactElement\n */\n\n/**\n * Create an element with the given nodeName.\n * @param {string} nodeName The DOM node to create\n * @param {boolean} [isSvg=false] If `true`, creates an element within the SVG\n * namespace.\n * @returns {PreactElement} The created DOM node\n */\nexport function createNode(nodeName, isSvg) {\n\t/** @type {PreactElement} */\n\tlet node = isSvg ? document.createElementNS('http://www.w3.org/2000/svg', nodeName) : document.createElement(nodeName);\n\tnode.normalizedNodeName = nodeName;\n\treturn node;\n}\n\n\n/**\n * Remove a child node from its parent if attached.\n * @param {Node} node The node to remove\n */\nexport function removeNode(node) {\n\tlet parentNode = node.parentNode;\n\tif (parentNode) parentNode.removeChild(node);\n}\n\n\n/**\n * Set a named attribute on the given Node, with special behavior for some names\n * and event handlers. If `value` is `null`, the attribute/handler will be\n * removed.\n * @param {PreactElement} node An element to mutate\n * @param {string} name The name/key to set, such as an event or attribute name\n * @param {*} old The last value that was set for this name/node pair\n * @param {*} value An attribute value, such as a function to be used as an\n * event handler\n * @param {boolean} isSvg Are we currently diffing inside an svg?\n * @private\n */\nexport function setAccessor(node, name, old, value, isSvg) {\n\tif (name==='className') name = 'class';\n\n\n\tif (name==='key') {\n\t\t// ignore\n\t}\n\telse if (name==='ref') {\n\t\tapplyRef(old, null);\n\t\tapplyRef(value, node);\n\t}\n\telse if (name==='class' && !isSvg) {\n\t\tnode.className = value || '';\n\t}\n\telse if (name==='style') {\n\t\tif (!value || typeof value==='string' || typeof old==='string') {\n\t\t\tnode.style.cssText = value || '';\n\t\t}\n\t\tif (value && typeof value==='object') {\n\t\t\tif (typeof old!=='string') {\n\t\t\t\tfor (let i in old) if (!(i in value)) node.style[i] = '';\n\t\t\t}\n\t\t\tfor (let i in value) {\n\t\t\t\tnode.style[i] = typeof value[i]==='number' && IS_NON_DIMENSIONAL.test(i)===false ? (value[i]+'px') : value[i];\n\t\t\t}\n\t\t}\n\t}\n\telse if (name==='dangerouslySetInnerHTML') {\n\t\tif (value) node.innerHTML = value.__html || '';\n\t}\n\telse if (name[0]=='o' && name[1]=='n') {\n\t\tlet useCapture = name !== (name=name.replace(/Capture$/, ''));\n\t\tname = name.toLowerCase().substring(2);\n\t\tif (value) {\n\t\t\tif (!old) node.addEventListener(name, eventProxy, useCapture);\n\t\t}\n\t\telse {\n\t\t\tnode.removeEventListener(name, eventProxy, useCapture);\n\t\t}\n\t\t(node._listeners || (node._listeners = {}))[name] = value;\n\t}\n\telse if (name!=='list' && name!=='type' && !isSvg && name in node) {\n\t\t// Attempt to set a DOM property to the given value.\n\t\t// IE & FF throw for certain property-value combinations.\n\t\ttry {\n\t\t\tnode[name] = value==null ? '' : value;\n\t\t} catch (e) { }\n\t\tif ((value==null || value===false) && name!='spellcheck') node.removeAttribute(name);\n\t}\n\telse {\n\t\tlet ns = isSvg && (name !== (name = name.replace(/^xlink:?/, '')));\n\t\t// spellcheck is treated differently than all other boolean values and\n\t\t// should not be removed when the value is `false`. See:\n\t\t// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-spellcheck\n\t\tif (value==null || value===false) {\n\t\t\tif (ns) node.removeAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase());\n\t\t\telse node.removeAttribute(name);\n\t\t}\n\t\telse if (typeof value!=='function') {\n\t\t\tif (ns) node.setAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase(), value);\n\t\t\telse node.setAttribute(name, value);\n\t\t}\n\t}\n}\n\n\n/**\n * Proxy an event to hooked event handlers\n * @param {Event} e The event object from the browser\n * @private\n */\nfunction eventProxy(e) {\n\treturn this._listeners[e.type](options.event && options.event(e) || e);\n}\n","import { ATTR_KEY } from '../constants';\nimport { isSameNodeType, isNamedNode } from './index';\nimport { buildComponentFromVNode } from './component';\nimport { createNode, setAccessor } from '../dom/index';\nimport { unmountComponent } from './component';\nimport options from '../options';\nimport { applyRef } from '../util';\nimport { removeNode } from '../dom/index';\n\n/**\n * Queue of components that have been mounted and are awaiting componentDidMount\n * @type {Array}\n */\nexport const mounts = [];\n\n/** Diff recursion count, used to track the end of the diff cycle. */\nexport let diffLevel = 0;\n\n/** Global flag indicating if the diff is currently within an SVG */\nlet isSvgMode = false;\n\n/** Global flag indicating if the diff is performing hydration */\nlet hydrating = false;\n\n/** Invoke queued componentDidMount lifecycle methods */\nexport function flushMounts() {\n\tlet c;\n\twhile ((c = mounts.shift())) {\n\t\tif (options.afterMount) options.afterMount(c);\n\t\tif (c.componentDidMount) c.componentDidMount();\n\t}\n}\n\n\n/**\n * Apply differences in a given vnode (and it's deep children) to a real DOM Node.\n * @param {import('../dom').PreactElement} dom A DOM node to mutate into the shape of a `vnode`\n * @param {import('../vnode').VNode} vnode A VNode (with descendants forming a tree) representing\n * the desired DOM structure\n * @param {object} context The current context\n * @param {boolean} mountAll Whether or not to immediately mount all components\n * @param {Element} parent ?\n * @param {boolean} componentRoot ?\n * @returns {import('../dom').PreactElement} The created/mutated element\n * @private\n */\nexport function diff(dom, vnode, context, mountAll, parent, componentRoot) {\n\t// diffLevel having been 0 here indicates initial entry into the diff (not a subdiff)\n\tif (!diffLevel++) {\n\t\t// when first starting the diff, check if we're diffing an SVG or within an SVG\n\t\tisSvgMode = parent!=null && parent.ownerSVGElement!==undefined;\n\n\t\t// hydration is indicated by the existing element to be diffed not having a prop cache\n\t\thydrating = dom!=null && !(ATTR_KEY in dom);\n\t}\n\n\tlet ret = idiff(dom, vnode, context, mountAll, componentRoot);\n\n\t// append the element if its a new parent\n\tif (parent && ret.parentNode!==parent) parent.appendChild(ret);\n\n\t// diffLevel being reduced to 0 means we're exiting the diff\n\tif (!--diffLevel) {\n\t\thydrating = false;\n\t\t// invoke queued componentDidMount lifecycle methods\n\t\tif (!componentRoot) flushMounts();\n\t}\n\n\treturn ret;\n}\n\n\n/**\n * Internals of `diff()`, separated to allow bypassing diffLevel / mount flushing.\n * @param {import('../dom').PreactElement} dom A DOM node to mutate into the shape of a `vnode`\n * @param {import('../vnode').VNode} vnode A VNode (with descendants forming a tree) representing the desired DOM structure\n * @param {object} context The current context\n * @param {boolean} mountAll Whether or not to immediately mount all components\n * @param {boolean} [componentRoot] ?\n * @private\n */\nfunction idiff(dom, vnode, context, mountAll, componentRoot) {\n\tlet out = dom,\n\t\tprevSvgMode = isSvgMode;\n\n\t// empty values (null, undefined, booleans) render as empty Text nodes\n\tif (vnode==null || typeof vnode==='boolean') vnode = '';\n\n\n\t// Fast case: Strings & Numbers create/update Text nodes.\n\tif (typeof vnode==='string' || typeof vnode==='number') {\n\n\t\t// update if it's already a Text node:\n\t\tif (dom && dom.splitText!==undefined && dom.parentNode && (!dom._component || componentRoot)) {\n\t\t\t/* istanbul ignore if */ /* Browser quirk that can't be covered: https://github.com/developit/preact/commit/fd4f21f5c45dfd75151bd27b4c217d8003aa5eb9 */\n\t\t\tif (dom.nodeValue!=vnode) {\n\t\t\t\tdom.nodeValue = vnode;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t// it wasn't a Text node: replace it with one and recycle the old Element\n\t\t\tout = document.createTextNode(vnode);\n\t\t\tif (dom) {\n\t\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n\t\t\t\trecollectNodeTree(dom, true);\n\t\t\t}\n\t\t}\n\n\t\tout[ATTR_KEY] = true;\n\n\t\treturn out;\n\t}\n\n\n\t// If the VNode represents a Component, perform a component diff:\n\tlet vnodeName = vnode.nodeName;\n\tif (typeof vnodeName==='function') {\n\t\treturn buildComponentFromVNode(dom, vnode, context, mountAll);\n\t}\n\n\n\t// Tracks entering and exiting SVG namespace when descending through the tree.\n\tisSvgMode = vnodeName==='svg' ? true : vnodeName==='foreignObject' ? false : isSvgMode;\n\n\n\t// If there's no existing element or it's the wrong type, create a new one:\n\tvnodeName = String(vnodeName);\n\tif (!dom || !isNamedNode(dom, vnodeName)) {\n\t\tout = createNode(vnodeName, isSvgMode);\n\n\t\tif (dom) {\n\t\t\t// move children into the replacement node\n\t\t\twhile (dom.firstChild) out.appendChild(dom.firstChild);\n\n\t\t\t// if the previous Element was mounted into the DOM, replace it inline\n\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n\n\t\t\t// recycle the old element (skips non-Element node types)\n\t\t\trecollectNodeTree(dom, true);\n\t\t}\n\t}\n\n\n\tlet fc = out.firstChild,\n\t\tprops = out[ATTR_KEY],\n\t\tvchildren = vnode.children;\n\n\tif (props==null) {\n\t\tprops = out[ATTR_KEY] = {};\n\t\tfor (let a=out.attributes, i=a.length; i--; ) props[a[i].name] = a[i].value;\n\t}\n\n\t// Optimization: fast-path for elements containing a single TextNode:\n\tif (!hydrating && vchildren && vchildren.length===1 && typeof vchildren[0]==='string' && fc!=null && fc.splitText!==undefined && fc.nextSibling==null) {\n\t\tif (fc.nodeValue!=vchildren[0]) {\n\t\t\tfc.nodeValue = vchildren[0];\n\t\t}\n\t}\n\t// otherwise, if there are existing or new children, diff them:\n\telse if (vchildren && vchildren.length || fc!=null) {\n\t\tinnerDiffNode(out, vchildren, context, mountAll, hydrating || props.dangerouslySetInnerHTML!=null);\n\t}\n\n\n\t// Apply attributes/props from VNode to the DOM Element:\n\tdiffAttributes(out, vnode.attributes, props);\n\n\n\t// restore previous SVG mode: (in case we're exiting an SVG namespace)\n\tisSvgMode = prevSvgMode;\n\n\treturn out;\n}\n\n\n/**\n * Apply child and attribute changes between a VNode and a DOM Node to the DOM.\n * @param {import('../dom').PreactElement} dom Element whose children should be compared & mutated\n * @param {Array} vchildren Array of VNodes to compare to `dom.childNodes`\n * @param {object} context Implicitly descendant context object (from most\n * recent `getChildContext()`)\n * @param {boolean} mountAll Whether or not to immediately mount all components\n * @param {boolean} isHydrating if `true`, consumes externally created elements\n * similar to hydration\n */\nfunction innerDiffNode(dom, vchildren, context, mountAll, isHydrating) {\n\tlet originalChildren = dom.childNodes,\n\t\tchildren = [],\n\t\tkeyed = {},\n\t\tkeyedLen = 0,\n\t\tmin = 0,\n\t\tlen = originalChildren.length,\n\t\tchildrenLen = 0,\n\t\tvlen = vchildren ? vchildren.length : 0,\n\t\tj, c, f, vchild, child;\n\n\t// Build up a map of keyed children and an Array of unkeyed children:\n\tif (len!==0) {\n\t\tfor (let i=0; i;\n * }\n * }\n */\nexport function Component(props, context) {\n\tthis._dirty = true;\n\n\t/**\n\t * @public\n\t * @type {object}\n\t */\n\tthis.context = context;\n\n\t/**\n\t * @public\n\t * @type {object}\n\t */\n\tthis.props = props;\n\n\t/**\n\t * @public\n\t * @type {object}\n\t */\n\tthis.state = this.state || {};\n\n\tthis._renderCallbacks = [];\n}\n\n\nextend(Component.prototype, {\n\n\t/**\n\t * Update component state and schedule a re-render.\n\t * @param {object} state A dict of state properties to be shallowly merged\n\t * \tinto the current state, or a function that will produce such a dict. The\n\t * \tfunction is called with the current state and props.\n\t * @param {() => void} callback A function to be called once component state is\n\t * \tupdated\n\t */\n\tsetState(state, callback) {\n\t\tif (!this.prevState) this.prevState = this.state;\n\t\tthis.state = extend(\n\t\t\textend({}, this.state),\n\t\t\ttypeof state === 'function' ? state(this.state, this.props) : state\n\t\t);\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\tenqueueRender(this);\n\t},\n\n\n\t/**\n\t * Immediately perform a synchronous re-render of the component.\n\t * @param {() => void} callback A function to be called after component is\n\t * \tre-rendered.\n\t * @private\n\t */\n\tforceUpdate(callback) {\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\trenderComponent(this, FORCE_RENDER);\n\t},\n\n\n\t/**\n\t * Accepts `props` and `state`, and returns a new Virtual DOM tree to build.\n\t * Virtual DOM is generally constructed via [JSX](http://jasonformat.com/wtf-is-jsx).\n\t * @param {object} props Props (eg: JSX attributes) received from parent\n\t * \telement/component\n\t * @param {object} state The component's current state\n\t * @param {object} context Context object, as returned by the nearest\n\t * ancestor's `getChildContext()`\n\t * @returns {import('./vnode').VNode | void}\n\t */\n\trender() {}\n\n});\n","var isArray = Array.isArray\n\nexport default function cc(names) {\n var i,\n len,\n tmp,\n out = \"\",\n type = typeof names\n\n if (type === \"string\" || type === \"number\") return names || \"\"\n\n if (isArray(names) && names.length > 0) {\n for (i = 0, len = names.length; i < len; i++) {\n if ((tmp = cc(names[i])) !== \"\") out += (out && \" \") + tmp\n }\n } else {\n for (i in names) {\n if (names.hasOwnProperty(i) && names[i]) out += (out && \" \") + i\n }\n }\n\n return out\n}\n","import { ME } from '@mecontrol/web-inline';\r\n\r\n/**\r\n * Check if a given element is visible.\r\n * Works similar to jQuery visible():\r\n * https://github.com/jquery/jquery/blob/899c56f6ada26821e8af12d9f35fa039100e838e/src/css/hiddenVisibleSelectors.js\r\n * @param element Element to check\r\n */\r\nexport function isVisible(element: HTMLElement): boolean {\r\n const rects = element.getClientRects();\r\n const style = getComputedStyle(element);\r\n return (\r\n element.offsetWidth > 0 ||\r\n element.offsetHeight > 0 ||\r\n rects.length > 0\r\n ) &&\r\n style.visibility !== 'hidden' &&\r\n style.display !== 'none' &&\r\n // Only consider opacity if it is defined, else we assume default value of 1\r\n (style.opacity ? parseFloat(style.opacity) : 1) > 0;\r\n}\r\n\r\n/**\r\n * Find focusable elements that are children of the passed in container element.\r\n * A more thorough and complete algorithm for this can be found in jquery-ui:\r\n * https://github.com/jquery/jquery-ui/blob/master/ui/focusable.js\r\n * Additional documentation here:\r\n * https://api.jqueryui.com/focusable-selector/\r\n * @param container Element inside of which the search will be performed\r\n * @param includeCodeFocus Include elements that can only be focused programatically\r\n * (i.e. tabindex=\"-1\")\r\n */\r\nexport function getFocusableElements(container: HTMLElement, includeCodeFocus?: boolean): HTMLElement[] {\r\n // Tag selectors for elements that MAY be focusable\r\n // AREA is not currently handled\r\n let focusableTags = [\r\n 'input',\r\n 'select',\r\n 'textarea',\r\n 'button',\r\n 'object',\r\n 'a[href]', // Anchor tags need an href to be focusable\r\n '[tabindex=\"0\"]' // Anything with tab-index = 0\r\n ];\r\n\r\n if (includeCodeFocus) {\r\n focusableTags.push('[tabindex=\"-1\"]');\r\n }\r\n\r\n // Selector for non-disabled elements\r\n const enabled = ':not([disabled])';\r\n\r\n // Get all possibly focusable tags from the container\r\n // Before doing so, we must also ensure they are not disabled\r\n let possibleFocusTags = container.querySelectorAll(\r\n focusableTags.map(tag => tag + enabled).join(',')\r\n );\r\n\r\n // Convert NodeList to Array and ensure it only contains visible elements\r\n let focusableElements: HTMLElement[] = [];\r\n for (let i = 0; i < possibleFocusTags.length; i++) {\r\n let focusableEl = possibleFocusTags[i] as HTMLElement;\r\n if (isVisible(focusableEl)) {\r\n focusableElements.push(focusableEl);\r\n }\r\n }\r\n\r\n return focusableElements;\r\n}\r\n\r\n/**\r\n * Verify whether a given element should close a dropdown when interacted with\r\n * @param element DOM Element we are checking\r\n */\r\nexport function shouldCloseDropdown(element: Element): boolean {\r\n return element.hasAttribute &&\r\n !element.hasAttribute('data-noClose') &&\r\n !element.hasAttribute('disabled') &&\r\n (element.nodeName === 'BUTTON' || element.nodeName === 'A');\r\n}\r\n\r\n/** Determine whether the page is in Right To Left mode or not */\r\nexport function isRtl(): boolean {\r\n return ME.Loc.rtl || document.dir === 'rtl';\r\n}\r\n\r\n/**\r\n * Function that runs an unspecified process with the supplied Element.\r\n * @param element DOM Element on which to run the process\r\n * @returns Either a boolean value or undefined. If a boolean is returned, and that\r\n * value is true, then this means the process does not need to keep running for\r\n * more Elements\r\n */\r\nexport type ProcessElement = (element: Element) => boolean | undefined;\r\n\r\n/**\r\n * Traverse the DOM tree upwards calling a function in each node.\r\n * @param node Element from which to start DOM tree traversal.\r\n * @param processNode Function that is called at every node of the tree with the element at that node.\r\n * If the function returns true, the traversal stops.\r\n * @returns The node for which the process returned true or null if none did.\r\n */\r\nexport function traverseDomTree(node: Element | undefined, processNode: ProcessElement): Element | undefined {\r\n // Return the node if it is null or if calling the function on it returned true\r\n if (!node || processNode(node) === true) {\r\n return node;\r\n }\r\n\r\n return traverseDomTree(node.parentNode as Element || undefined, processNode);\r\n}\r\n","import { AnchorAlignment, AnchorPosition } from '@mecontrol/common';\r\nimport { Promise } from '@mecontrol/web-inline';\r\nimport {\r\n delayUntilAnimationFrame,\r\n getClientRect, getVisibleWindowRect, getDocumentRect, isElement\r\n} from '@mecontrol/web-boot';\r\nimport { isRtl, traverseDomTree } from './dom';\r\n\r\n/** Defines a width and height that an HTML element occupies */\r\ninterface ClientArea {\r\n width: number;\r\n height: number;\r\n}\r\n\r\n/** The default anchor buffer (in pixels) to apply to the outer most size of the drop down. Negative shrinks, positive expands. */\r\nconst anchoringBuffer: number = -10;\r\n\r\n/**\r\n * Predefined cycle of positions that defines the order in which different ones\r\n * are tried when anchoring elements optimally\r\n */\r\nconst positionOrder = [\r\n AnchorPosition.Left,\r\n AnchorPosition.Top,\r\n AnchorPosition.Right,\r\n AnchorPosition.Bottom\r\n];\r\n\r\n/**\r\n * Place a given Element such that it is anchored to a second one, following the provided\r\n * position and alignment and ensuring, as much as possible, that it does not overflow its\r\n * container (which, when not provided, defaults to the visible window). See algorithm\r\n * description for more details.\r\n * @param target Element being positioned\r\n * @param anchor Element around which the target shall be positioned\r\n * @param position Initial position to try placing the target to\r\n * @param alignment Alignment of the target with relation to the anchor we will try\r\n * @param container Optional element against which the positioning will be checked for overflows\r\n * @param allowOverlap Optional value that will allow positioning of the target to overlap the\r\n * anchor (in the case where there is not enough space for an optimal position)\r\n */\r\nexport function anchorElementTo(\r\n target: HTMLElement,\r\n anchor: HTMLElement,\r\n position: AnchorPosition,\r\n alignment: AnchorAlignment,\r\n container?: HTMLElement,\r\n allowOverlap: boolean = false\r\n): Promise {\r\n\r\n return new Promise(resolve => {\r\n\r\n // Wait before performing all of this given that we will triger a a style recalculation\r\n delayUntilAnimationFrame(() => {\r\n\r\n // Determine what should be used as our bounding box:\r\n // - The passed in container\r\n // - The visible window (for fixed elements)\r\n // - The full page (for all other cases)\r\n // Further down, we will indiscriminately refer to this bounding box as the 'container'\r\n let boundingBox: ClientRect;\r\n if (container) {\r\n boundingBox = getClientRect(container, anchoringBuffer);\r\n }\r\n else if (isFixedElement(target)) {\r\n boundingBox = getVisibleWindowRect();\r\n }\r\n else {\r\n boundingBox = getDocumentRect();\r\n }\r\n\r\n // Now get the rects for the target and anchor\r\n let targetRect = getFullClientRect(target);\r\n let anchorRect = getClientRect(anchor);\r\n\r\n if (targetRect.height !== 0 && targetRect.width !== 0) {\r\n\r\n // Handle RTL by mirroring Position Left <-> Right\r\n // or for Position Top/Bottom, Alignment Start <-> End\r\n if (isRtl()) {\r\n switch (position) {\r\n case AnchorPosition.Left:\r\n position = AnchorPosition.Right;\r\n break;\r\n case AnchorPosition.Right:\r\n position = AnchorPosition.Left;\r\n break;\r\n default:\r\n alignment = alignment === AnchorAlignment.Start ?\r\n AnchorAlignment.End :\r\n AnchorAlignment.Start;\r\n }\r\n }\r\n\r\n // Find and apply optimal position for target\r\n // Height will only be adjusted if necessary\r\n let optimalPosition = findOptimalPosition(\r\n targetRect,\r\n anchorRect,\r\n boundingBox, // henceforth known as 'container'\r\n position,\r\n alignment,\r\n allowOverlap\r\n );\r\n applyOptimalPosition(\r\n target,\r\n optimalPosition,\r\n targetRect.height != optimalPosition.height\r\n );\r\n }\r\n\r\n resolve();\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * Given a target and anchor around which to position it, find the best possible location for\r\n * the target such that is visible in the passed-in container. This method will assign a higher\r\n * value to making the target visible over respecting the preferred position and alignment values\r\n * provided.\r\n * @param target Element being positioned\r\n * @param anchor Element around which the target shall be positioned\r\n * @param container Area within which the target must be constrained\r\n * @param preferredPosition Position that will be given priority when placing the target\r\n * @param preferredAlignment Alignment that will be given prioritu when placing the target\r\n * @param allowOverlap Whether to allow the target to wind up covering the anchor -partially or\r\n * totally- in the case where there is no optimal position that fits the whole target\r\n */\r\nfunction findOptimalPosition(\r\n target: ClientRect,\r\n anchor: ClientRect,\r\n container: ClientRect,\r\n preferredPosition: AnchorPosition,\r\n preferredAlignment: AnchorAlignment,\r\n allowOverlap: boolean\r\n): ClientRect {\r\n\r\n // Set up initial values to loop through all possible positions\r\n let currentPosition = preferredPosition;\r\n let positionIndex = positionOrder.indexOf(preferredPosition);\r\n\r\n // These values will help keep track of the best candidate in\r\n // case there is no position that perfectly fits the target\r\n let bestVerticalFit = -Infinity;\r\n let bestPosition: AnchorPosition | undefined;\r\n\r\n // Now we actually test each of the positions\r\n do {\r\n // For each one, we compute whether the target would fit in the available\r\n // space in the container\r\n let verticalFit = computeVerticalFit(target, anchor, container, currentPosition);\r\n\r\n // A positive value means the target will fit without issues, so we can\r\n // just return that position\r\n if (verticalFit >= 0) {\r\n bestPosition = currentPosition;\r\n break;\r\n }\r\n\r\n // If we hit these lines, we have not yet found a full fit for the target,\r\n // so we will keep track of the best candidate position: the one with the\r\n // highets possible fit value\r\n if (verticalFit > bestVerticalFit) {\r\n bestVerticalFit = verticalFit;\r\n bestPosition = currentPosition;\r\n }\r\n\r\n positionIndex = (positionIndex + 1) % positionOrder.length;\r\n currentPosition = positionOrder[positionIndex];\r\n }\r\n while (currentPosition !== preferredPosition);\r\n\r\n // When we reach this point, we have a few possibilities:\r\n // - We found a good fit, and 'bestPosition' has the value for that\r\n // - We found no perfect fits, but we have good candidate that maximizes\r\n // visible area in 'bestPosition'\r\n // - We found nothing at all, and will default to our 'preferredPosition'\r\n // since nothing really works\r\n // Considering this, we will simply compute the placement of the target\r\n // using this knowledge and return that\r\n return computePlacement(\r\n target,\r\n anchor,\r\n container,\r\n bestPosition || preferredPosition,\r\n preferredAlignment,\r\n allowOverlap\r\n );\r\n}\r\n\r\n/**\r\n * Compute the ClientRect representing the final global coordinates for a given target, so that\r\n * it is positioned around an anchor in the passed-in position and alignment values. The final\r\n * location may tweak height of the target or, based on overflows, not exactly match the position\r\n * and alignment that were passed in.\r\n * @param target Element being positioned\r\n * @param anchor Element around which the target shall be positioned\r\n * @param container Area within which the target must be constrained\r\n * @param position Position to place the target in with relation to the anchor\r\n * @param alignment Alignment of the target with relation to the anchor we will try\r\n * @param allowOverlap Whether to allow the target to wind up covering the anchor -partially or\r\n * totally- in the case where there is no optimal position that fits the whole target\r\n */\r\nfunction computePlacement(\r\n target: ClientRect,\r\n anchor: ClientRect,\r\n container: ClientRect,\r\n position: AnchorPosition,\r\n alignment: AnchorAlignment,\r\n allowOverlap: boolean\r\n): ClientRect {\r\n\r\n let targetLeft: number = 0;\r\n let targetTop: number = 0;\r\n let targetBottom: number = 0;\r\n\r\n // Compute where the top and left of the positioned target should\r\n // be according to the Position and Alignment values\r\n switch (position) {\r\n case AnchorPosition.Left:\r\n targetLeft = anchor.left - target.width;\r\n targetTop = alignment === AnchorAlignment.Start ?\r\n anchor.top :\r\n anchor.bottom - target.height;\r\n break;\r\n\r\n case AnchorPosition.Top:\r\n targetLeft = alignment === AnchorAlignment.Start ?\r\n anchor.left :\r\n anchor.right - target.width;\r\n targetTop = anchor.top - target.height;\r\n break;\r\n\r\n case AnchorPosition.Right:\r\n targetLeft = anchor.right;\r\n targetTop = alignment === AnchorAlignment.Start ?\r\n anchor.top :\r\n anchor.bottom - target.height;\r\n break;\r\n\r\n case AnchorPosition.Bottom:\r\n targetLeft = alignment === AnchorAlignment.Start ?\r\n anchor.left :\r\n anchor.right - target.width;\r\n targetTop = anchor.bottom;\r\n break;\r\n }\r\n\r\n // Now, we must ensure there are no overflows\r\n // For width, we simply adjust the new left (we will not shrink width)\r\n if (targetLeft < container.left) {\r\n targetLeft = container.left;\r\n }\r\n else if ((targetLeft + target.width) > container.right) {\r\n targetLeft = container.right - target.width;\r\n }\r\n\r\n // Adjust height as appropriate, taking into consideration\r\n // whether we allow overlaps or not\r\n if (targetTop < container.top) {\r\n targetTop = container.top;\r\n targetBottom = targetTop + target.height;\r\n\r\n // Determine what to use to limit the bottom of the target\r\n // and adjust it if needed\r\n let bottomLimit = position === AnchorPosition.Top && !allowOverlap ?\r\n anchor.top : container.bottom;\r\n if (targetBottom > bottomLimit) {\r\n targetBottom = bottomLimit;\r\n }\r\n }\r\n else if ((targetTop + target.height) > container.bottom) {\r\n targetBottom = container.bottom;\r\n targetTop = targetBottom - target.height;\r\n\r\n // Now limit the top of the target if needed\r\n let topLimit = position === AnchorPosition.Bottom && !allowOverlap ?\r\n anchor.bottom : container.top;\r\n if (targetTop < topLimit) {\r\n targetTop = topLimit;\r\n }\r\n }\r\n else {\r\n targetBottom = targetTop + target.height;\r\n }\r\n\r\n // Create client rect for positioned/adjusted target\r\n return {\r\n left: targetLeft,\r\n right: targetLeft + target.width,\r\n width: target.width,\r\n top: targetTop,\r\n bottom: targetBottom,\r\n height: targetBottom - targetTop\r\n };\r\n}\r\n\r\n/**\r\n * Given a target and anchor for positioning within a container, determine if the passed in\r\n * position would allow placement of the target completely. Will return the amount of free\r\n * vertical space left after placement\r\n * @param target Element to be placed\r\n * @param anchor Element around which the target will be placed\r\n * @param container Area inside of which the positioned target must be\r\n * @param position Position around the anchor to compute\r\n */\r\nfunction computeVerticalFit(target: ClientRect, anchor: ClientRect, container: ClientRect, position: AnchorPosition): number {\r\n let availableArea = getAvailableArea(anchor, container, position);\r\n\r\n // Width must always fit\r\n // Height can be variable, so we return the overflow of the target's height, which\r\n // can be used to choose the best possible candidate\r\n if (target.width <= availableArea.width) {\r\n return availableArea.height - target.height;\r\n }\r\n\r\n // When width does not fit, we just mark the overflow as infinite to ensure this\r\n // position is never a best candidate\r\n return -Infinity;\r\n}\r\n\r\n/**\r\n * Given a container rectangle, compute the width and height of available space for placement\r\n * of an element around another rectangle: the anchor\r\n * @param anchor The element around which placement will be done\r\n * @param container Total available area where placement will happen. Should contain the anchor\r\n * @param position Where placemente will happen with relation to the anchor\r\n */\r\nfunction getAvailableArea(anchor: ClientRect, container: ClientRect, position: AnchorPosition): ClientArea {\r\n switch (position) {\r\n case AnchorPosition.Top:\r\n return {\r\n width: container.width,\r\n height: anchor.top - container.top\r\n };\r\n\r\n case AnchorPosition.Right:\r\n return {\r\n width: container.right - anchor.right,\r\n height: container.height\r\n };\r\n\r\n case AnchorPosition.Bottom:\r\n return {\r\n width: container.width,\r\n height: container.bottom - anchor.bottom\r\n };\r\n\r\n case AnchorPosition.Left:\r\n return {\r\n width: anchor.left - container.left,\r\n height: container.height\r\n };\r\n }\r\n}\r\n\r\n/**\r\n * Given the optimal ClientRect in global coordiantes for a target, actually place said\r\n * target in that position by setting its top and left values accordingly.\r\n * @param target The Element being positioned\r\n * @param finalRect ClientRect containing information on the final position of the target\r\n * such that it is optimal. Given in global coordinates.\r\n * @param setHeight Flag that indicates whether to also set the target's size based on the\r\n * finalRect's values (HEIGHT only)\r\n */\r\nfunction applyOptimalPosition(target: HTMLElement, finalRect: ClientRect, setHeight?: boolean): void {\r\n if (target) {\r\n // Determine which element acts as the positioning parent for the target.\r\n // If the target has 'position: fixed', it will be the window. Otherwise,\r\n // it will be the first ancestor of the target with 'postion: !static'\r\n let positioningParent: Element | undefined;\r\n let targetStyle = getComputedStyle(target);\r\n if (targetStyle.position !== 'fixed') {\r\n positioningParent = traverseDomTree(\r\n target,\r\n el => el !== target && (el as any) !== document && getComputedStyle(el).position !== 'static'\r\n ) || document.documentElement || undefined;\r\n }\r\n\r\n // Set top and left of the body to our computed values, using the parent's rect.\r\n // If we did not set the parent above, the ClientRect will be all zeroes, which\r\n // works fine with 'position: fixed' since that is already in terms of the window\r\n let parentRect = getClientRect(positioningParent);\r\n target.style.left = `${finalRect.left - parentRect.left}px`;\r\n target.style.top = `${finalRect.top - parentRect.top}px`;\r\n target.style.right = 'auto';\r\n target.style.bottom = 'auto';\r\n\r\n // If we are also adusting the height of the container, we need to set overflow\r\n // to scrolling too.\r\n if (setHeight) {\r\n target.style.height = `${finalRect.height}px`;\r\n target.style.overflow = 'auto';\r\n }\r\n else {\r\n target.style.height = target.style.overflow = \"\";\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Obtain the ClientRect for a given element and include any hidden width or height (scrollable)\r\n * @param element The element to compute the ClientRect for\r\n */\r\nfunction getFullClientRect(element: HTMLElement | undefined): ClientRect {\r\n let clientRect = getClientRect(element);\r\n\r\n // Add scrollWidth and scrollHeight to the rect\r\n if (element) {\r\n clientRect = {\r\n left: clientRect.left,\r\n right: clientRect.left + element.scrollWidth,\r\n top: clientRect.top,\r\n bottom: clientRect.top + element.scrollHeight,\r\n width: element.scrollWidth,\r\n height: element.scrollHeight\r\n };\r\n }\r\n\r\n return clientRect;\r\n}\r\n\r\n/**\r\n * Determine if the passed in element is 'position: fixed' or withing\r\n * a fixed position DOM tree\r\n * @param element Element to evaluate\r\n */\r\nfunction isFixedElement(element: HTMLElement): boolean {\r\n let result = false;\r\n traverseDomTree(element, el => {\r\n // Stop processing if we get to a non-element object\r\n if (!isElement(el)) {\r\n return true;\r\n }\r\n\r\n let style = getComputedStyle(el);\r\n if (style.position === 'fixed') {\r\n result = true;\r\n return true;\r\n }\r\n return el === document.documentElement;\r\n });\r\n\r\n return result;\r\n}\r\n","import { h, Component } from 'preact';\r\nimport cc from 'classcat';\r\nimport { AnchorAlignment, AnchorPosition, ContentSource } from '@mecontrol/common';\r\nimport { createId, logTelemetryEvent } from '@mecontrol/web-inline';\r\nimport { ILinkButtonProps, DebounceEventHandler, Tooltip, LinkButton, debounce } from '@mecontrol/web-boot';\r\nimport { anchorElementTo, getFocusableElements } from '../utilities';\r\n\r\n// Get the main div that contains all of the Body component via selector\r\nconst getMeControlBody = () => {\r\n let body = document.querySelector('.mectrl_body');\r\n return body ? body as HTMLElement : undefined;\r\n};\r\n\r\nexport type IMenuItemProps = ILinkButtonProps & { key: string };\r\nexport interface IMenuTriggerProps {\r\n children: JSX.Element | JSX.Element[];\r\n cssClass?: string;\r\n ariaLabel?: string;\r\n tooltip?: boolean;\r\n}\r\n\r\nexport interface IMenuProps {\r\n id: string;\r\n contentId?: string;\r\n contentSlot?: number;\r\n trigger: IMenuTriggerProps;\r\n items: IMenuItemProps[];\r\n cssClass?: string;\r\n position?: AnchorPosition;\r\n alignment?: AnchorAlignment;\r\n}\r\n\r\nexport interface IMenuState {\r\n expanded: boolean;\r\n}\r\n\r\ndeclare const enum FocusChange {\r\n Forward,\r\n Backward,\r\n Start,\r\n End\r\n}\r\n\r\n/** Class used to tell the Menu to use fixed-positioning */\r\nexport const fixedMenuClass = 'fixed-menu';\r\n\r\n/**\r\n * Menu component with keyboard interaction.\r\n *\r\n * For more details on expected behavior and examples, go to the WAI ARIA practices site here:\r\n * https://www.w3.org/TR/wai-aria-practices/#menubutton\r\n *\r\n * Example implementation:\r\n * https://www.w3.org/TR/wai-aria-practices/examples/menu-button/menu-button-links.html\r\n */\r\nexport class Menu extends Component {\r\n\r\n private menuRoot: HTMLElement | undefined;\r\n private trigger: HTMLElement | undefined;\r\n private menu: HTMLElement | undefined;\r\n\r\n private readonly scrollHandler: DebounceEventHandler;\r\n\r\n private focusIndex: number = -1;\r\n private focusAtStart: boolean = true;\r\n\r\n constructor(props: IMenuProps) {\r\n super(props);\r\n\r\n this.expandedClickHandler = this.expandedClickHandler.bind(this);\r\n this.expandedResizeHandler = this.expandedResizeHandler.bind(this);\r\n this.menuButtonKeyboardHandler = this.menuButtonKeyboardHandler.bind(this);\r\n this.menuItemKeyboardHandler = this.menuItemKeyboardHandler.bind(this);\r\n this.scrollHandler = debounce(this.expandedScrollHandler.bind(this));\r\n\r\n this.state = { expanded: false };\r\n }\r\n\r\n /**\r\n * Toggle menu to open/closed configurations and update associated\r\n * event handlers\r\n * @param expanded New state for the menu\r\n */\r\n private toggleMenu(expanded: boolean = !this.state.expanded): void {\r\n if (expanded) {\r\n\r\n // Position the body around the trigger based on configuration\r\n if (this.menu && this.trigger) {\r\n anchorElementTo(\r\n this.menu,\r\n this.trigger,\r\n this.props.position || AnchorPosition.Bottom,\r\n this.props.alignment || AnchorAlignment.Start,\r\n getMeControlBody(),\r\n true\r\n ).then(() => {\r\n // Set up event listeners\r\n document.addEventListener('click', this.expandedClickHandler, true);\r\n document.addEventListener('scroll', this.scrollHandler, true);\r\n window.addEventListener('resize', this.expandedResizeHandler);\r\n\r\n // Update state and re-render\r\n // Do this after anchoring to avoid weird jumps in position\r\n this.setState({ expanded: true });\r\n });\r\n }\r\n\r\n // Fire telemetry for opening the menu\r\n logTelemetryEvent({\r\n eventType: 'PageAction',\r\n isCritical: false,\r\n content: {\r\n id: this.props.contentId || this.props.id,\r\n slot: this.props.contentSlot,\r\n source: ContentSource.Action\r\n }\r\n });\r\n }\r\n else {\r\n // Remove listeners\r\n document.removeEventListener('click', this.expandedClickHandler, true);\r\n document.removeEventListener('scroll', this.scrollHandler, true);\r\n window.removeEventListener('resize', this.expandedResizeHandler);\r\n\r\n // Update state and re-render\r\n this.setState({ expanded: false });\r\n }\r\n }\r\n\r\n /**\r\n * Move focus to the menu's children based on the passed in parameter\r\n * @param change Parameter that helps determine where to move focus to\r\n */\r\n private moveFocus(change: FocusChange): void {\r\n if (this.state.expanded && this.menu) {\r\n const menuItems = getFocusableElements(this.menu, true);\r\n const totalItems = menuItems.length;\r\n\r\n if (totalItems > 0) {\r\n\r\n switch (change) {\r\n case FocusChange.Forward:\r\n this.focusIndex = (this.focusIndex + 1) % totalItems;\r\n break;\r\n case FocusChange.Backward:\r\n this.focusIndex = (this.focusIndex - 1 + totalItems) % totalItems;\r\n break;\r\n case FocusChange.Start:\r\n this.focusIndex = 0;\r\n break;\r\n case FocusChange.End:\r\n this.focusIndex = totalItems - 1;\r\n break;\r\n }\r\n\r\n menuItems[this.focusIndex].focus();\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Click handler to detect click interactions with the menu.\r\n * Primarily focused on closing the menu when either clicking outside\r\n * of it or when clickin a link inside of it.\r\n * @param ev Click event object\r\n */\r\n private expandedClickHandler(ev: MouseEvent): void {\r\n // If the click was outside the menu, we close it\r\n if (!this.menuRoot || !this.menuRoot.contains(ev.target as Element)) {\r\n this.toggleMenu(false);\r\n\r\n // Now we check if the click was inside the body, in which case\r\n // we stop the event from propagating\r\n // Clicking outside the MeControl will not stop propagation\r\n const meControlBody = getMeControlBody();\r\n if (meControlBody && meControlBody.contains(ev.target as Element)) {\r\n ev.preventDefault();\r\n ev.stopPropagation();\r\n }\r\n }\r\n // Otherwise, we verify if any of the children were clicked, which\r\n // equates to an interactive click, which should close the menu too\r\n else if (this.menu) {\r\n const menuItems = getFocusableElements(this.menu, true);\r\n if (menuItems.some(item => item.contains(ev.target as HTMLElement))) {\r\n this.toggleMenu(false);\r\n }\r\n }\r\n }\r\n\r\n /** Handler for debounced scroll events. DO NOT USE DIRECTLY */\r\n private expandedScrollHandler(event: Event): void {\r\n // Only use this logic if there is a root and event target\r\n // to use. Otherwise, just collapse the menu\r\n if (this.menuRoot && event.target) {\r\n // If the scroll event happened inside the menu, we won't\r\n // close the menu\r\n if (!this.menuRoot.contains(event.target as any)) {\r\n this.toggleMenu(false);\r\n }\r\n }\r\n else {\r\n this.toggleMenu(false);\r\n }\r\n }\r\n\r\n /** Handler to close the menu on any resize event */\r\n private expandedResizeHandler(): void {\r\n this.toggleMenu(false);\r\n }\r\n\r\n /**\r\n * Handle keyboard interactions when focus is on the menu trigger\r\n * @param ev Keyboard event\r\n */\r\n private menuButtonKeyboardHandler(ev: KeyboardEvent): void {\r\n this.focusAtStart = true;\r\n let allowPropagation = false;\r\n switch (ev.key) {\r\n case 'Up': // IE and older Firefox\r\n case 'ArrowUp':\r\n this.focusAtStart = false;\r\n this.toggleMenu(true);\r\n break;\r\n\r\n case 'Down': // IE and older Firefox\r\n case 'ArrowDown':\r\n this.toggleMenu(true);\r\n break;\r\n\r\n // Allow other keys to pass through\r\n default:\r\n allowPropagation = true;\r\n break;\r\n }\r\n\r\n if (!allowPropagation) {\r\n ev.preventDefault();\r\n ev.stopPropagation();\r\n }\r\n }\r\n\r\n /**\r\n * Handle keyboard interactions when focus is on the menu itself\r\n * @param ev Keyboard event\r\n */\r\n private menuItemKeyboardHandler(ev: KeyboardEvent): void {\r\n let allowPropagation = false;\r\n switch (ev.key) {\r\n case 'Esc': // Old IE and Firefox versions\r\n case 'Escape':\r\n this.toggleMenu(false);\r\n break;\r\n\r\n case 'Up': // IE and older Firefox\r\n case 'ArrowUp':\r\n this.moveFocus(FocusChange.Backward);\r\n break;\r\n\r\n case 'Down': // IE and older Firefox\r\n case 'ArrowDown':\r\n this.moveFocus(FocusChange.Forward);\r\n break;\r\n\r\n case 'Home':\r\n this.moveFocus(FocusChange.Start);\r\n break;\r\n\r\n case 'End':\r\n this.moveFocus(FocusChange.End);\r\n break;\r\n\r\n case 'Tab':\r\n this.toggleMenu(false);\r\n\r\n // Allow other keys to pass through\r\n default:\r\n allowPropagation = true;\r\n break;\r\n }\r\n\r\n if (!allowPropagation) {\r\n ev.preventDefault();\r\n ev.stopPropagation();\r\n }\r\n }\r\n\r\n /** Update method that runs after render() for the menu */\r\n public componentDidUpdate(oldProps: IMenuProps, oldState: IMenuState): void {\r\n const { expanded } = this.state;\r\n\r\n // Ensure this only happens the first time we update after a state change\r\n if (oldState.expanded !== expanded) {\r\n if (expanded) {\r\n this.moveFocus(this.focusAtStart ? FocusChange.Start : FocusChange.End);\r\n }\r\n else {\r\n this.trigger && this.trigger.focus();\r\n }\r\n }\r\n }\r\n\r\n /** Render method for the menu */\r\n public render(): JSX.Element {\r\n const {\r\n id,\r\n trigger,\r\n items,\r\n cssClass,\r\n } = this.props;\r\n const { expanded } = this.state;\r\n\r\n const triggerId = createId(id, 'trigger');\r\n const menuId = createId(id, 'menu');\r\n\r\n let triggerBtn =\r\n this.toggleMenu()}\r\n // A11y\r\n aria-label={trigger.ariaLabel}\r\n aria-haspopup='true'\r\n aria-controls={menuId}\r\n aria-expanded={expanded.toString()}\r\n data-noClose='true'\r\n // Menu control\r\n tabIndex={expanded ? -1 : 0}\r\n ref={btn => this.trigger = btn as HTMLElement}\r\n onKeyDown={this.menuButtonKeyboardHandler}\r\n >\r\n {trigger.children}\r\n ;\r\n\r\n if (trigger.ariaLabel && trigger.tooltip) {\r\n triggerBtn = {triggerBtn};\r\n }\r\n\r\n return (\r\n this.menuRoot = div as HTMLElement}\r\n >\r\n {triggerBtn}\r\n this.menu = mul as HTMLElement}\r\n onKeyDown={this.menuItemKeyboardHandler}\r\n >\r\n {items.map((itemProps, index) => (\r\n
  • \r\n \r\n
  • \r\n ))}\r\n \r\n \r\n );\r\n }\r\n}\r\n","import { h, FunctionalComponent } from 'preact';\r\nimport { IAccount, ICommand } from '@mecontrol/public-api';\r\nimport { PageAction, IValidatedMeControlConfiguration, AnchorPosition } from '@mecontrol/common';\r\nimport { getString, SyntheticEvent, createId, getOptions } from '@mecontrol/web-inline';\r\nimport { LinkButton } from '@mecontrol/web-boot';\r\nimport { Menu } from './Menu';\r\n\r\n\r\nexport interface ICustomCommandsProps {\r\n currentAccount: IAccount;\r\n commands?: ICommand[];\r\n}\r\n\r\nfunction dispatchOnClickEventHandling(event: MouseEvent, command: ICommand, currentAccount: IAccount): void {\r\n const commandClickEvent = new SyntheticEvent(\"commandclick\", {\r\n commandId: command.id,\r\n currentAccount\r\n });\r\n\r\n let _meControlConfig: IValidatedMeControlConfiguration | undefined = getOptions();\r\n if (_meControlConfig) {\r\n if (!_meControlConfig.syntheticEventTarget.dispatchEvent(commandClickEvent)) {\r\n event.preventDefault();\r\n }\r\n }\r\n\r\n if (command.onClick) {\r\n command.onClick(commandClickEvent);\r\n if (commandClickEvent.defaultPrevented) {\r\n event.preventDefault(); // Here `event` should be the true browser event\r\n }\r\n }\r\n}\r\n\r\n// TODO: colejone connect component to store to clean up prop passing\r\nexport const CustomCommands: FunctionalComponent = props => {\r\n if (!props.commands || props.commands.length === 0) {\r\n return
    ;\r\n }\r\n\r\n function getUrlFactory(command: ICommand): () => string | undefined {\r\n return () => typeof command.url === \"function\"\r\n ? command.url({ currentAccount: props.currentAccount, commandId: command.id })\r\n : command.url;\r\n }\r\n\r\n const firstCommand = props.commands[0];\r\n const restCommands = props.commands.slice(1);\r\n\r\n const restCommandProps = restCommands.map((command, index) => ({\r\n id: createId(command.id),\r\n contentId: PageAction.customCommand,\r\n contentSlot: index + 1,\r\n key: command.id,\r\n getUrl: getUrlFactory(command),\r\n onClick: (event: MouseEvent) => dispatchOnClickEventHandling(event, command, props.currentAccount),\r\n ariaLabel: command.ariaLabel,\r\n children: [command.text],\r\n openInNewTab: command.openInNewTab\r\n }));\r\n const moreComms = getString('morecustomlinks');\r\n\r\n return (\r\n
    \r\n dispatchOnClickEventHandling(event, firstCommand, props.currentAccount)}\r\n cssClass='mectrl_link'\r\n ariaLabel={firstCommand.ariaLabel}\r\n openInNewTab={firstCommand.openInNewTab}\r\n >\r\n {firstCommand.text}\r\n \r\n {restCommands.length > 0 ?\r\n ],\r\n cssClass: 'mectrl_trigger',\r\n ariaLabel: moreComms,\r\n tooltip: true\r\n }}\r\n items={restCommandProps}\r\n cssClass='moreCommands'\r\n position={AnchorPosition.Left}\r\n /> :\r\n null\r\n }\r\n
    \r\n );\r\n};\r\n","import { h, FunctionalComponent, ComponentFactory } from 'preact';\r\nimport { IPresenceState } from '@mecontrol/public-api';\r\nimport { IAccountState, IMeControlAppState } from '@mecontrol/common';\r\nimport { isFunctionallyMsaOrWithEditPicUrl, ProfilePictureOverlay, ProfilePicture, MapStateToProps, connect } from '@mecontrol/web-boot';\r\n\r\nexport interface IPresenceOwnProps {\r\n mainIdPart?: string;\r\n currentAccount: IAccountState;\r\n pictureId?: string;\r\n}\r\n\r\nexport interface IPresenceStateProps {\r\n currentPresence?: IPresenceState;\r\n}\r\n\r\nexport type IPresenceProps = IPresenceOwnProps & IPresenceStateProps;\r\n\r\nconst PresenceImpl: FunctionalComponent = props => {\r\n let { currentAccount, currentPresence } = props;\r\n let imgCss: { [backgroundImage: string]: string } = {};\r\n\r\n let presenceElement = isFunctionallyMsaOrWithEditPicUrl(currentAccount) && props.pictureId ?\r\n :\r\n
    \r\n \r\n
    ;\r\n\r\n if (props.mainIdPart && currentPresence) {\r\n imgCss.backgroundImage = 'url(' + currentPresence.imageUrl + ')';\r\n presenceElement =
    \r\n
    \r\n {presenceElement}\r\n
    ;\r\n }\r\n\r\n return (presenceElement);\r\n};\r\n\r\nconst mapStateToProps: MapStateToProps = state => ({\r\n currentPresence: state.presenceConfig.currentPresence\r\n});\r\n\r\nexport const Presence: ComponentFactory = connect(mapStateToProps, () => { return; })(PresenceImpl);\r\n","import { h, FunctionalComponent, ComponentFactory } from 'preact';\r\nimport { IPresenceState, IPresenceConfig } from '@mecontrol/public-api';\r\nimport { AnchorPosition, PageAction, DispatchWithPresenceState, IMeControlAppState } from '@mecontrol/common';\r\nimport { createId } from '@mecontrol/web-inline';\r\nimport { MapStateToProps, MapDispatchToProps, connect, setPresenceToPartner } from '@mecontrol/web-boot';\r\nimport { Menu } from './Menu';\r\n\r\nexport interface IPresenceDropdownOwnProps {\r\n id: string;\r\n}\r\n\r\ninterface IPresenceDropdownDispatchProps {\r\n setPresenceToPartner?: DispatchWithPresenceState;\r\n}\r\n\r\ninterface IPresenceDropdownStateProps {\r\n presenceConfig?: IPresenceConfig;\r\n}\r\n\r\nexport type IPresenceDropdownProps = IPresenceDropdownOwnProps & IPresenceDropdownDispatchProps & IPresenceDropdownStateProps;\r\n\r\nconst PresenceDropdownImpl: FunctionalComponent = props => {\r\n let presenceDropdown = null;\r\n let { id, presenceConfig } = props;\r\n\r\n if (presenceConfig && presenceConfig.currentPresence && presenceConfig.presenceList) {\r\n const presenceListStates = presenceConfig.presenceList.map((presenceState: IPresenceState, index: number) => ({\r\n id: createId(presenceState.presenceString),\r\n contentId: PageAction.presenceStateChange,\r\n contentSlot: index,\r\n key: presenceState.presenceString,\r\n getUrl: undefined,\r\n onClick: () => {\r\n if (props.setPresenceToPartner) {\r\n props.setPresenceToPartner(presenceState);\r\n }\r\n },\r\n ariaLabel: presenceState.presenceString,\r\n children: [\r\n
    \r\n
    \r\n
    ,\r\n
    {presenceState.presenceString}
    \r\n ],\r\n openInNewTab: false,\r\n ['data-noClose']: 'true'\r\n }));\r\n\r\n const currentPresence = presenceConfig.currentPresence.presenceString;\r\n presenceDropdown =\r\n {currentPresence}
    ,\r\n
    \r\n ],\r\n cssClass: 'mectrl_trigger',\r\n ariaLabel: currentPresence\r\n }}\r\n items={presenceListStates}\r\n cssClass='presenceDropdown'\r\n position={AnchorPosition.Bottom}\r\n />;\r\n }\r\n\r\n return (presenceDropdown);\r\n};\r\n\r\nconst mapStateToProps: MapStateToProps = state => ({\r\n presenceConfig: state.presenceConfig\r\n});\r\n\r\nexport const mapDispatchToProps: MapDispatchToProps = dispatch => {\r\n return {\r\n setPresenceToPartner(presenceState: IPresenceState): void {\r\n dispatch(setPresenceToPartner(presenceState));\r\n }\r\n };\r\n};\r\n\r\nexport const PresenceDropdown: ComponentFactory = connect(mapStateToProps, mapDispatchToProps)(PresenceDropdownImpl);\r\n","import { h, FunctionalComponent } from 'preact';\r\nimport { AccountType } from '@mecontrol/public-api';\r\nimport { IAccountState, PageAction } from '@mecontrol/common';\r\nimport { getString, createId } from '@mecontrol/web-inline';\r\nimport { LinkButton, getFullDisplayName, TruncateText, raiseSyntheticEvent } from '@mecontrol/web-boot';\r\n\r\nexport interface IFullDisplayNameProps {\r\n id: string;\r\n account: IAccountState;\r\n}\r\n\r\n/**\r\n * Shows the full display name of the user, or if the user has no name, a link to add a name.\r\n * @param props The Body Props containing a current account\r\n */\r\nexport const FullDisplayName: FunctionalComponent = props => {\r\n const fullDisplayName = getFullDisplayName(props.account);\r\n if (fullDisplayName !== '') {\r\n return (\r\n \r\n );\r\n }\r\n\r\n if (props.account.type == AccountType.AAD) {\r\n return null;\r\n }\r\n else {\r\n // If full name didn't return or if there was no current account, show an add name link\r\n // Note: This should never happen for AAD accounts\r\n let uri = \"https://account.microsoft.com/profile/edit-name?ref=MeControl\";\r\n return (\r\n uri}\r\n onClick={mouseEvent => raiseSyntheticEvent('uriClickEvent', { uri }, mouseEvent)}\r\n cssClass='mectrl_link'\r\n ariaLabel={getString('addyournamelabel')}\r\n openInNewTab={true}\r\n >\r\n {getString('addyourname')}\r\n \r\n );\r\n }\r\n};\r\n","import { h, FunctionalComponent } from 'preact';\r\nimport { AccountType } from '@mecontrol/public-api';\r\nimport { IAccountState, PageAction } from '@mecontrol/common';\r\nimport { getString, createId, ME } from '@mecontrol/web-inline';\r\nimport { LinkButton, raiseSyntheticEvent, setQueryParams } from '@mecontrol/web-boot';\r\n\r\nexport interface IViewAccountLinkProps {\r\n account: IAccountState;\r\n}\r\n\r\n/**\r\n * Shows a link to account management. MSA's go to AMC, AAD/MSA_FED goes to azure.\r\n * @param props The body props with a current account\r\n */\r\nexport const ViewAccountLink: FunctionalComponent = props => {\r\n const account = props.account;\r\n const id = createId('viewAccount'), descriptionId = createId(id, 'desc');\r\n let uri: string, linkText = '', description = '';\r\n\r\n switch (account.type) {\r\n case AccountType.MSA:\r\n case AccountType.MSA_FED:\r\n uri = setQueryParams(ME.Config.msaUrl, {\r\n ref: 'MeControl',\r\n username: account.memberName\r\n });\r\n linkText = getString('viewaccount');\r\n description = getString('msaaccountlinka11y');\r\n break;\r\n case AccountType.AAD:\r\n const params: Record = { ref: 'MeControl', login_hint: account.memberName };\r\n if (account.tenantId) {\r\n params.tid = account.tenantId;\r\n }\r\n\r\n uri = setQueryParams(ME.Config.aadUrl, params);\r\n linkText = getString('viewaccountaad');\r\n description = getString('aadaccountlinka11y');\r\n break;\r\n }\r\n\r\n return (\r\n
    \r\n uri}\r\n onClick={mouseEvent => raiseSyntheticEvent('uriClickEvent', { uri }, mouseEvent)}\r\n cssClass='mectrl_link'\r\n aria-describedby={descriptionId}\r\n openInNewTab={true}\r\n >\r\n {linkText}\r\n \r\n \r\n
    \r\n );\r\n};\r\n","import { FunctionalComponent, h } from 'preact';\r\nimport { IAccountState } from '@mecontrol/common';\r\nimport { getString, createId } from '@mecontrol/web-inline';\r\nimport { TruncateText, isFunctionallyMsaLike } from '@mecontrol/web-boot';\r\n\r\nexport interface ICompanyProps {\r\n account: IAccountState;\r\n}\r\n\r\n/**\r\n * Used to display company information in the flyout header. When the passed in account\r\n * is MSA-like, then the Microsoft logo and name are displayed. For AAD accounts, the name\r\n * of the organization is used (when available)\r\n * @param account Account for which the companny information will be generated\r\n */\r\nexport const Company: FunctionalComponent = ({ account }) => {\r\n const id = createId('signedInTitle');\r\n const companyClass = 'mectrl_company';\r\n\r\n // MSA-like shows Microsoft branding\r\n if (isFunctionallyMsaLike(account)) {\r\n return (\r\n
    \r\n
    \r\n
    \r\n {getString('microsoft')}\r\n
    \r\n
    \r\n
    \r\n );\r\n }\r\n else {\r\n // TODO: Ignore orgLogoUrl for now and put AAD briefcase here instead \\\r\n // {props.orgLogoUrl ? : }\r\n return account.orgName ? : null;\r\n }\r\n};\r\n","import { h, FunctionalComponent } from 'preact';\r\nimport { ICommand } from '@mecontrol/public-api';\r\nimport { IAccountState, PageAction, IAuthProvider, IAuthActions } from '@mecontrol/common';\r\nimport { createId, getString } from '@mecontrol/web-inline';\r\nimport { TruncateText, LinkButton, AuthAppUpsell } from '@mecontrol/web-boot';\r\nimport { CustomCommands } from './CustomCommands';\r\nimport { Presence } from './Presence';\r\nimport { PresenceDropdown } from './PresenceDropdown';\r\nimport { FullDisplayName } from './FullDisplayName';\r\nimport { ViewAccountLink } from './ViewAccountLink';\r\nimport { Company } from './Company';\r\n\r\nexport interface ICurrentAccountProps {\r\n currentAccount: IAccountState;\r\n authProvider: IAuthProvider;\r\n signOutFromApp: IAuthActions[\"signOutFromApp\"];\r\n commands?: ICommand[];\r\n}\r\n\r\nconst mainIdPart = 'currentAccount';\r\n\r\n/**\r\n * Displays information about a current account such as the user's name, member name, picture, and custom commands\r\n * @param props The Body Props containing a current account\r\n */\r\nexport const CurrentAccount: FunctionalComponent = props => {\r\n const { currentAccount, authProvider, signOutFromApp, commands } = props;\r\n const pictureId = createId(mainIdPart, 'picture');\r\n const getSignOutFromAppUrl = () => {\r\n if (authProvider.navProvider) {\r\n return authProvider.navProvider.getSignOutFromAppUrl({ currentAccount });\r\n }\r\n };\r\n\r\n return (\r\n
    \r\n \r\n
    \r\n \r\n
    \r\n \r\n
    \r\n \r\n \r\n \r\n \r\n \r\n
    \r\n
    \r\n signOutFromApp({ currentAccount }, event)}\r\n >\r\n {getString('signout')}\r\n \r\n
    \r\n );\r\n};\r\n","import { h, FunctionalComponent } from 'preact';\r\nimport cc from 'classcat';\r\nimport { createId } from '@mecontrol/web-inline';\r\nimport { TruncateText } from '@mecontrol/web-boot';\r\n\r\nexport interface IAccountInfoProps {\r\n id: string;\r\n friendlyName: string;\r\n details?: string;\r\n isHighlighted?: boolean;\r\n}\r\n\r\nexport const AccountInfo: FunctionalComponent = props => {\r\n const { id, friendlyName, details, isHighlighted = false } = props;\r\n\r\n // Format account info to display correctly\r\n return (\r\n
    \r\n \r\n {\r\n // Check to see if we even need to render details\r\n details && friendlyName != details ?\r\n :\r\n null\r\n }\r\n
    \r\n );\r\n};\r\n","import { h, FunctionalComponent } from 'preact';\r\nimport { AnchorPosition, PageAction } from '@mecontrol/common';\r\nimport { IMenuItemProps, Menu } from '../Menu';\r\n\r\nexport interface IAccountActionsProps {\r\n id: string;\r\n index: number;\r\n items: IMenuItemProps[];\r\n triggerAriaLabel: string;\r\n}\r\n\r\nexport const AccountActions: FunctionalComponent = props => (\r\n ],\r\n cssClass: 'mectrl_trigger',\r\n ariaLabel: props.triggerAriaLabel,\r\n tooltip: true\r\n }}\r\n items={props.items}\r\n cssClass='mectrl_accountActions'\r\n position={AnchorPosition.Left}\r\n />\r\n);\r\n","import { h, FunctionalComponent } from 'preact';\r\nimport cc from 'classcat';\r\nimport { AuthenticatedState } from '@mecontrol/public-api';\r\nimport {\r\n IAccountState,\r\n IAuthProvider,\r\n IAuthActions,\r\n PageAction,\r\n AccountItemStatus,\r\n} from '@mecontrol/common';\r\nimport { getString, createId } from '@mecontrol/web-inline';\r\nimport {\r\n ProfilePicture,\r\n LinkButton,\r\n getAccountListDisplayName,\r\n isSignedIn,\r\n format,\r\n getVerbalFriendlyName,\r\n isAadLike\r\n} from '@mecontrol/web-boot';\r\nimport { AccountInfo } from './AccountInfo';\r\nimport { AccountActions } from './AccountActions';\r\nimport { IMenuItemProps } from '../Menu';\r\n\r\nexport interface IAccountItemProps {\r\n index: number;\r\n account: IAccountState;\r\n authProvider: IAuthProvider;\r\n hasActiveAccount: boolean;\r\n onItemClick: (account: IAccountState, event: Event) => void;\r\n getItemUrl: (account: IAccountState) => string | undefined;\r\n signOutFromApp: IAuthActions[\"signOutFromApp\"];\r\n signOutFromIdp: IAuthActions[\"signOutFromIdp\"];\r\n signOutAndForgetFromIdp: IAuthActions[\"signOutAndForgetFromIdp\"];\r\n}\r\n\r\nexport interface IAccountItemState { }\r\n\r\n// Types used to generate account actions\r\ntype SignOutOperation = 'signOutFromApp' | 'signOutFromIdp' | 'signOutAndForgetFromIdp';\r\ntype SignOutUrlGetter = 'getSignOutFromAppUrl' | 'getSignOutFromIdpUrl' | 'getSignOutAndForgetFromIdpUrl';\r\ntype OperationValue = Record>>;\r\ntype OperationUrlGetter = Record;\r\n\r\nconst stringKeys: OperationValue = {\r\n signedIn: { signOutFromApp: 'signout' },\r\n signedInIDPOnly: { signOutFromIdp: 'signout', signOutAndForgetFromIdp: 'signoutandforget' },\r\n notSignedIn: { signOutAndForgetFromIdp: 'forget' }\r\n};\r\n\r\nconst ariaStringKeys: OperationValue = {\r\n signedIn: { signOutFromApp: 'signoutaccounta11yformat1' },\r\n signedInIDPOnly: { signOutFromIdp: 'signoutaccounta11yformat1', signOutAndForgetFromIdp: 'signoutandforgetaccounta11yformat1' },\r\n notSignedIn: { signOutAndForgetFromIdp: 'forgetaccounta11yformat1' }\r\n};\r\n\r\nconst pageAction: OperationValue = {\r\n signedIn: { signOutFromApp: PageAction.signOut },\r\n signedInIDPOnly: { signOutFromIdp: PageAction.accountSignOut, signOutAndForgetFromIdp: PageAction.accountSignOutAndForget },\r\n notSignedIn: { signOutAndForgetFromIdp: PageAction.accountForget }\r\n};\r\n\r\nconst urlGetterName: OperationUrlGetter = {\r\n signOutFromApp: 'getSignOutFromAppUrl',\r\n signOutFromIdp: 'getSignOutFromIdpUrl',\r\n signOutAndForgetFromIdp: 'getSignOutAndForgetFromIdpUrl',\r\n};\r\n\r\n// Used to create IDs\r\nconst mainIdPart = 'rememberedAccount';\r\n\r\nexport const AccountItem: FunctionalComponent = props => {\r\n const { index, account, authProvider, hasActiveAccount, onItemClick, getItemUrl } = props;\r\n\r\n const itemState = account.accountItemStatus;\r\n const isLoading = itemState === AccountItemStatus.Loading;\r\n\r\n const friendlyNameA11y = getVerbalFriendlyName(account);\r\n\r\n /**\r\n * Handler that tries to sign out the item's account\r\n * @param action Whether the handler is signing out or signing out and forgetting\r\n * @param event Mouse event\r\n */\r\n function onSignOutActionClick(operation: SignOutOperation, event: MouseEvent): void {\r\n // Only try signing out if we are not already trying it\r\n if (account.accountItemStatus !== AccountItemStatus.Loading) {\r\n // Use Auth API to sign out the account\r\n if (operation === 'signOutFromApp') {\r\n props[operation]({ currentAccount: account }, event);\r\n } else {\r\n props[operation]({ account }, event);\r\n }\r\n }\r\n else {\r\n event.preventDefault();\r\n }\r\n }\r\n\r\n /**\r\n * Generate the properties for an account action\r\n * @param operation Which account action to generate properties for\r\n */\r\n function getAccountAction(operation: SignOutOperation): IMenuItemProps | undefined {\r\n const navProvider = authProvider.navProvider;\r\n\r\n if (authProvider.isOperationSupported(operation, account.type)) {\r\n const getUrl = () => {\r\n let methodName = urlGetterName[operation];\r\n if (methodName === 'getSignOutFromAppUrl') {\r\n return navProvider && navProvider[methodName] && navProvider[methodName]({ currentAccount: account });\r\n } else {\r\n return navProvider && navProvider[methodName] && navProvider[methodName]({ account });\r\n }\r\n };\r\n\r\n return {\r\n id: createId(mainIdPart, index, operation),\r\n contentId: pageAction[account.authenticatedState][operation],\r\n contentSlot: index,\r\n key: operation,\r\n isDisabled: isLoading,\r\n getUrl,\r\n onClick: onSignOutActionClick.bind(null, operation),\r\n children: [getString(stringKeys[account.authenticatedState][operation]!)],\r\n ariaLabel: format(getString(ariaStringKeys[account.authenticatedState][operation]!), getVerbalFriendlyName(account))\r\n };\r\n }\r\n }\r\n\r\n /**\r\n * Generate an array of IAccountActionProps for actions supported by this account item\r\n * @param allowSignOut Whether the Sign Out action is allowed (i.e. the account is signed in)\r\n */\r\n function getAccountActionProps(): IMenuItemProps[] {\r\n let accountActionProps: (IMenuItemProps | undefined)[];\r\n if (isAadLike(account) && account.isWindowsSso) {\r\n return [];\r\n }\r\n else if (account.authenticatedState === AuthenticatedState.SignedIn) {\r\n accountActionProps = [\r\n getAccountAction('signOutFromApp')\r\n ];\r\n } else if (account.authenticatedState === AuthenticatedState.SignedInIDPOnly) {\r\n accountActionProps = [\r\n getAccountAction('signOutFromIdp'),\r\n getAccountAction('signOutAndForgetFromIdp')\r\n ];\r\n } else {\r\n accountActionProps = [\r\n getAccountAction('signOutAndForgetFromIdp')\r\n ];\r\n }\r\n\r\n return accountActionProps.filter(Boolean) as IMenuItemProps[];\r\n }\r\n\r\n const accountActionItems = isLoading ? [] : getAccountActionProps();\r\n\r\n return (\r\n
    \r\n getItemUrl(account)}\r\n onClick={ev => onItemClick(account, ev)}\r\n cssClass={cc(['primaryAction', hasActiveAccount ? 'switchTo' : 'signInTo'])}\r\n ariaLabel={getAccountSwitchAriaLabel(account)}\r\n >\r\n \r\n \r\n \r\n {accountActionItems.length > 0 ?\r\n :\r\n null\r\n }\r\n
    \r\n );\r\n};\r\n\r\nfunction getAccountInfoDetails(account: IAccountState): string {\r\n switch (account.accountItemStatus) {\r\n case AccountItemStatus.Normal:\r\n return account.memberName;\r\n case AccountItemStatus.Loading:\r\n return getString('signoutloading');\r\n case AccountItemStatus.Error:\r\n return getString('signouterror');\r\n }\r\n}\r\n\r\nfunction getAccountSwitchAriaLabel(account: IAccountState): string {\r\n const friendlyName = getVerbalFriendlyName(account);\r\n let switchMsg = format(getString('switchaccounta11yformat1'), friendlyName);\r\n\r\n switch (account.accountItemStatus) {\r\n case AccountItemStatus.Normal:\r\n return switchMsg;\r\n\r\n case AccountItemStatus.Loading:\r\n case AccountItemStatus.Error:\r\n const lastChar = switchMsg[switchMsg.length - 1];\r\n switchMsg += lastChar === '.' ? '' : '.';\r\n let statusMsg = format(getString('accountstatusa11yformat1'), getAccountInfoDetails(account));\r\n\r\n return `${switchMsg} ${statusMsg}`;\r\n }\r\n}\r\n","import { h, FunctionalComponent } from 'preact';\r\nimport cc from 'classcat';\r\nimport { SignInExperienceType } from '@mecontrol/public-api';\r\nimport { AnchorPosition, AnchorAlignment, PageAction, IAuthProvider } from '@mecontrol/common';\r\nimport { getString, createId } from '@mecontrol/web-inline';\r\nimport { ProfilePicture, LinkButton, TruncateText } from '@mecontrol/web-boot';\r\nimport { IMenuItemProps, Menu, fixedMenuClass } from '../Menu';\r\n\r\n/**\r\n * The props required for the SignInItem to render appropriately.\r\n */\r\nexport interface ISignInItemProps {\r\n /**\r\n * The IAuthProvider set by the partner.\r\n */\r\n authProvider: IAuthProvider;\r\n\r\n /**\r\n * Callback method that is triggered when the user clicks this sign-in control. This must be provided\r\n * in order for the parent componenet to determine the current signed in state of the MeControl in\r\n * order to know if sign in vs. switch should be used.\r\n */\r\n signInClick: (signInType: SignInExperienceType, event: Event) => void;\r\n\r\n /**\r\n * Callback method that is executed upon rendering of this component to get the sign in or switch\r\n * url from the auth provider. This must be provided in order for the parent componenet to determine\r\n * the current signed in state of the MeControl in order to know if sign in vs. switch should be used.\r\n */\r\n getSignInUrl: (signInType: SignInExperienceType) => string | undefined;\r\n}\r\n\r\nconst mainIdPart = 'signInItem';\r\nconst cssClassForLinkButton = 'primaryAction signIn';\r\n\r\n/**\r\n * Component that appears following the remembered account list which allows the user to sign in (or switch) to\r\n * another account. This componenet will determine the appropriate supported provider types and either display\r\n * an inline button for a seamless experience or a drop down allowing the user to select the desired account\r\n * type to sign in or switch to.\r\n * @param props The appropriate ISignInItemProps used to render the proper component.\r\n */\r\nexport const SignInItem: FunctionalComponent = props => {\r\n const { authProvider } = props;\r\n\r\n if (authProvider.supportedSignInAccountTypes === (SignInExperienceType.Msa | SignInExperienceType.Aad)) {\r\n return ;\r\n }\r\n else {\r\n return ;\r\n }\r\n};\r\n\r\ninterface SignInMenuItemGeneratorProps {\r\n index: number;\r\n key: string;\r\n text: string;\r\n signInType: SignInExperienceType;\r\n}\r\ntype SignInMenuItemGenerator = (props: SignInMenuItemGeneratorProps) => IMenuItemProps;\r\n\r\n/**\r\n * Menu whose trigger mimics the HTML structure and classes of the AccountItem component\r\n * in order to share styling\r\n */\r\nconst MenuSignInItem: FunctionalComponent = props => {\r\n const { signInClick, getSignInUrl } = props;\r\n\r\n const getItemProps: SignInMenuItemGenerator = itemProps => ({\r\n id: createId(mainIdPart, itemProps.index),\r\n key: itemProps.key,\r\n contentId: PageAction.accountSignIn,\r\n contentSlot: itemProps.index,\r\n getUrl: () => getSignInUrl(itemProps.signInType),\r\n onClick: event => signInClick(itemProps.signInType, event),\r\n children: [itemProps.text]\r\n });\r\n\r\n return (\r\n \r\n );\r\n};\r\n\r\n/**\r\n * Sign In Item that is a simple LinkButton emulating the same HTML structure and classes\r\n * as an AccountItem (in order to share styling)\r\n */\r\nconst SimpleSignInItem: FunctionalComponent = props => {\r\n const { authProvider, signInClick, getSignInUrl } = props;\r\n\r\n return (\r\n
    \r\n getSignInUrl(authProvider.supportedSignInAccountTypes)}\r\n onClick={event => signInClick(authProvider.supportedSignInAccountTypes, event)}\r\n cssClass={cssClassForLinkButton}\r\n ariaLabel={getString('signinwithdifferentaccount')}\r\n >\r\n {getSignInItemContents()}\r\n \r\n
    \r\n );\r\n};\r\n\r\n/** Generate shared contents for the SignInItem LinkButton */\r\nfunction getSignInItemContents(): JSX.Element[] {\r\n return [\r\n ,\r\n
    \r\n \r\n
    \r\n ];\r\n}\r\n","import { h, RenderableProps } from \"preact\";\r\nimport { toChildArray } from \"@mecontrol/web-boot\";\r\n\r\ninterface ScrollShadowProps {\r\n cssClass: string;\r\n}\r\n\r\n/**\r\n * Add a shadow to the the top of an element that is scrolled. The usage of this\r\n * component must provide a CSS class through which it controls the scrolling behavior\r\n * of the div element (e.g. using overflow: auto, max-height, etc.).\r\n */\r\nexport function ScrollShadow(props: RenderableProps): JSX.Element {\r\n return (\r\n
    \r\n {toChildArray(props.children)[0]}\r\n
    \r\n );\r\n}\r\n","import { h, FunctionalComponent } from 'preact';\r\nimport cc from 'classcat';\r\nimport { AuthenticatedState, SignInExperienceType, AccountType } from '@mecontrol/public-api';\r\nimport { IMeControlAccounts, IAccountState, IAuthProvider, IAuthActions, ISwitchArgs, IAuthOperations } from '@mecontrol/common';\r\nimport { getOtherAccounts, getAccountId, getCurrentAccount } from '@mecontrol/web-boot';\r\nimport { AccountItem } from './AccountItem';\r\nimport { SignInItem } from './SignInItem';\r\nimport { ScrollShadow } from './ScrollShadow';\r\nimport { getString } from '@mecontrol/web-inline';\r\n\r\nexport interface IAccountListProps {\r\n accounts: IMeControlAccounts;\r\n authProvider: IAuthProvider;\r\n switchTo: IAuthActions[\"switchTo\"];\r\n switch: IAuthActions[\"switch\"];\r\n signInTo: IAuthActions[\"signInTo\"];\r\n signIn: IAuthActions[\"signIn\"];\r\n signOutFromApp: IAuthActions[\"signOutFromApp\"];\r\n signOutFromIdp: IAuthActions[\"signOutFromIdp\"];\r\n signOutAndForgetFromIdp: IAuthActions[\"signOutAndForgetFromIdp\"];\r\n}\r\n\r\n// TODO: Pato - move all account list related components into sub-folder to match CSS folder stucture.\r\nexport const AccountList: FunctionalComponent = props => {\r\n const {\r\n accounts,\r\n authProvider,\r\n switchTo,\r\n signInTo,\r\n signIn,\r\n signOutFromApp,\r\n signOutFromIdp,\r\n signOutAndForgetFromIdp,\r\n } = props;\r\n\r\n const accountsToDisplay = getOtherAccounts(accounts);\r\n const currentAccount = getCurrentAccount(accounts);\r\n const hasActiveAccount = currentAccount !== undefined;\r\n\r\n /**\r\n * Callback method used to fire the switch or signIn callback that may be defined by\r\n * the onboarded client/partner page or app.\r\n * @param signInType The SignInExperienceType that is being switched or signed in.\r\n * @param event The event that fired the action (example: MouseClickEvent).\r\n */\r\n const switchOrSignInClick = (signInType: SignInExperienceType, event: Event) => {\r\n if (hasActiveAccount) {\r\n props.switch({ currentAccount, signInType } as ISwitchArgs, event);\r\n }\r\n else {\r\n signIn({ signInType }, event);\r\n }\r\n };\r\n\r\n /**\r\n * Callback method used to get the switch or signIn url from the auth provider.\r\n * @param signInType The SignInExperienceType that is being requested.\r\n */\r\n const getSwitchOrSignInUrl = (signInType: SignInExperienceType) => {\r\n if (authProvider.navProvider) {\r\n if (hasActiveAccount) {\r\n return authProvider.navProvider.getSwitchUrl({ currentAccount, signInType } as ISwitchArgs);\r\n }\r\n else {\r\n return authProvider.navProvider.getSignInUrl({ signInType });\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Callback method used to fire the switchTo or SignInTo callback that may be defined by\r\n * the onboarded client/partner page or app.\r\n * @param account The IAccountState that is being switched to or signed in to.\r\n * @param event The event that fired the action (example: MouseClickEvent).\r\n */\r\n const switchToOrSignInTo = (account: IAccountState, event: Event) => {\r\n if (currentAccount) {\r\n switchTo({\r\n currentAccount,\r\n nextAccount: account\r\n }, event);\r\n }\r\n else {\r\n signInTo({ nextAccount: account }, event);\r\n }\r\n };\r\n\r\n /**\r\n * Callback method used to get the signInTo or switchTo url from the auth provider.\r\n * @param account The IAccountState that is going to be signed in to or switched to.\r\n */\r\n const getSignInToOrSwitchToUrl = (account: IAccountState) => {\r\n if (authProvider.navProvider) {\r\n if (currentAccount) {\r\n return authProvider.navProvider.getSwitchToUrl({\r\n currentAccount,\r\n nextAccount: account,\r\n });\r\n }\r\n else {\r\n return authProvider.navProvider.getSignInToUrl({ nextAccount: account });\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Callback method used to filter items that will be displayed in the remembered accounts list.\r\n * This method basically evaluates the isOperationSupported before displaying the item.\r\n * @param account The remembered account to be displayed.\r\n */\r\n const shouldDisplay = (account: IAccountState) => {\r\n return (hasActiveAccount && authProvider.isOperationSupported('switchTo', account.type))\r\n || (!hasActiveAccount && authProvider.isOperationSupported('signInTo', account.type));\r\n };\r\n\r\n // Gets the initial remembered account list to display (if supported).\r\n let accountItems = accountsToDisplay\r\n .filter(shouldDisplay)\r\n .sort(accountComparer)\r\n .map((account, index) =>\r\n
  • \r\n \r\n
  • \r\n );\r\n\r\n // TODO: trevori/andwi: This is supported op will need to change some day when we can pass in SignInExperienceType.\r\n // Append the \"sign-in\" item to the account list\r\n if (!hasActiveAccount || isSupportedForAny(authProvider, 'switch')) {\r\n accountItems.push(\r\n
  • \r\n \r\n
  • \r\n );\r\n }\r\n\r\n return (\r\n \r\n
      \r\n {accountItems}\r\n
    \r\n
    \r\n );\r\n};\r\n\r\n/**\r\n * Calls the auth provider isOperationSupport for the given operation type against all AccountType options to\r\n * ensure the operations can works for any of the account types. A single success returns TRUE.\r\n * @param authProvider The current auth provider.\r\n * @param operation The auth operation type to check.\r\n */\r\nfunction isSupportedForAny(authProvider: IAuthProvider, operation: keyof IAuthOperations): boolean {\r\n return authProvider.isOperationSupported(operation, AccountType.MSA)\r\n || authProvider.isOperationSupported(operation, AccountType.AAD)\r\n || authProvider.isOperationSupported(operation, AccountType.MSA_FED);\r\n}\r\n\r\n/**\r\n * Comparer function for sorting accounts. Sort order is based on authenticated\r\n * state as follows:\r\n * - SignedIn\r\n * - SignedInIDPOnly\r\n * - NotSignedIn\r\n * Within the same auth state, sort order is determined by member name alphabetically\r\n * @param A First account to compare\r\n * @param B Second account to compare\r\n * @returns A number with the folowwing meaning:\r\n * - -1 means A comes first\r\n * - 0 means they are the same\r\n * - 1 means B comes first\r\n */\r\nfunction accountComparer(A: IAccountState, B: IAccountState): number {\r\n if (A.authenticatedState === B.authenticatedState) {\r\n let aMN = A.memberName.toLowerCase();\r\n let bMN = B.memberName.toLowerCase();\r\n if (aMN < bMN) {\r\n return -1;\r\n }\r\n else if (aMN > bMN) {\r\n return 1;\r\n }\r\n else {\r\n return 0;\r\n }\r\n }\r\n else {\r\n if (A.authenticatedState === AuthenticatedState.SignedIn) {\r\n return -1;\r\n }\r\n else if (A.authenticatedState === AuthenticatedState.NotSignedIn) {\r\n return 1;\r\n }\r\n else {\r\n if (B.authenticatedState === AuthenticatedState.SignedIn) {\r\n return 1;\r\n }\r\n else {\r\n return -1;\r\n }\r\n }\r\n }\r\n}\r\n","import { h, FunctionalComponent } from 'preact';\r\nimport { getString, createId } from '@mecontrol/web-inline';\r\n\r\n/**\r\n * Simple JSX component that redners a subtle text header for the account list when\r\n * the user is not actively signed in.\r\n */\r\nexport const SignedOutAccountListHeader: FunctionalComponent = () => {\r\n return (\r\n

    \r\n {getString('chooseanaccount')}\r\n

    \r\n );\r\n};\r\n","import { h, FunctionalComponent } from \"preact\";\r\nimport { IMeControlAccounts, IAuthProvider, IAuthActions } from '@mecontrol/common';\r\nimport { getCurrentAccount } from '@mecontrol/web-boot';\r\nimport { CurrentAccount } from './CurrentAccount';\r\nimport { AccountList } from './account-list/AccountList';\r\nimport { ICommand, ITheme } from '@mecontrol/public-api';\r\nimport { SignedOutAccountListHeader } from './account-list/SignedOutAccountListHeader';\r\n\r\nexport interface IBodyOwnProps {\r\n authProvider: IAuthProvider;\r\n}\r\n\r\nexport interface IBodyStateProps {\r\n accounts: IMeControlAccounts;\r\n commands?: ICommand[];\r\n theme?: ITheme;\r\n}\r\n\r\nexport interface IBodyDispatchProps extends IAuthActions {\r\n}\r\n\r\nexport type IBodyProps = IBodyStateProps & IBodyDispatchProps & IBodyOwnProps;\r\n\r\nexport const Body: FunctionalComponent = props => {\r\n const {\r\n accounts,\r\n commands,\r\n authProvider,\r\n signOutFromApp,\r\n } = props;\r\n\r\n const currentAccount = getCurrentAccount(accounts);\r\n const children: JSX.Element[] = [];\r\n\r\n if (currentAccount) {\r\n // Signed in w/ Active Account\r\n children.push(\r\n ,\r\n \r\n );\r\n }\r\n else {\r\n // Else signed out, push the header and remembered accounts.\r\n children.push(\r\n ,\r\n \r\n );\r\n }\r\n\r\n return
    {children}
    ;\r\n};\r\n","import { Component } from \"preact\";\r\nimport { AnchorPosition, AnchorAlignment, ToggleAction, AnyFunction } from '@mecontrol/common';\r\nimport { traverseDomTree, shouldCloseDropdown, anchorElementTo, getFocusableElements } from '../utilities';\r\n\r\nexport interface IDropdownBaseProps {\r\n onToggle?(expanded: boolean, action?: ToggleAction): void;\r\n position?: AnchorPosition;\r\n alignment?: AnchorAlignment;\r\n defaultExpanded?: boolean;\r\n}\r\n\r\nexport interface IDropdownBaseState {\r\n expanded: boolean;\r\n}\r\n\r\nexport abstract class DropdownBase extends Component {\r\n\r\n protected body: HTMLElement | undefined;\r\n protected trigger: HTMLElement | undefined;\r\n\r\n private removeFocusTraps: AnyFunction | undefined;\r\n\r\n constructor(props: T) {\r\n super(props);\r\n\r\n this.state = { expanded: false };\r\n\r\n // Bind to make unique instances of methods\r\n this.onExpandedClick = this.onExpandedClick.bind(this);\r\n this.onInteractiveClick = this.onInteractiveClick.bind(this);\r\n this.onExpandedKeyDown = this.onExpandedKeyDown.bind(this);\r\n this.onExpandedResize = this.onExpandedResize.bind(this);\r\n }\r\n\r\n /**\r\n * Attach the appropriate event handlers on the first and last elements of the dropdown.\r\n * Each element will have a differently bound version of 'focusTrap' to behave\r\n * differently and focus on the right element.\r\n * A function to remove these traps will also be created and stored.\r\n */\r\n private setUpFocusTraps(): void {\r\n if (this.body && this.trigger) {\r\n // First find the first and last focusable elements\r\n // inside the dropdown\r\n let focusable = getFocusableElements(this.body);\r\n if (focusable.length > 0) {\r\n let first = this.trigger;\r\n let last = focusable[focusable.length - 1];\r\n\r\n // Create the focus trap functions via binding\r\n const topTrap = this.focusTrap.bind(null, true, last);\r\n const bottomTrap = this.focusTrap.bind(null, false, first);\r\n\r\n // Add traps\r\n first.addEventListener('keydown', topTrap);\r\n last.addEventListener('keydown', bottomTrap);\r\n\r\n // Create function to remove traps\r\n this.removeFocusTraps = () => {\r\n first.removeEventListener('keydown', topTrap);\r\n last.removeEventListener('keydown', bottomTrap);\r\n this.removeFocusTraps = undefined;\r\n };\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Handles keyboard events on the first and last elements of the dropdown, with the\r\n * intent being to detect when focus is being taken outside of the dropdown and\r\n * trapping it by focusing on something else.\r\n * NOTE: This method is intended to be bound to the right values before being passed\r\n * as an event handler\r\n * @param shiftPressed Whether the trap should activate when the SHIFT key is pressed\r\n * @param focusOn What element to focus on if the trap is activated\r\n * @param ev The actual keyboard event\r\n */\r\n private focusTrap(shiftPressed: boolean, focusOn: HTMLElement, ev: KeyboardEvent): void {\r\n if (ev.key === 'Tab' && ev.shiftKey === shiftPressed) {\r\n ev.preventDefault();\r\n ev.stopPropagation();\r\n focusOn.focus();\r\n }\r\n }\r\n\r\n /**\r\n * Click handler to detect clicking outside of the dropdown, which causes the\r\n * dropdown to collapse. Used in click capturing phase\r\n * @param ev Click event object\r\n */\r\n private onExpandedClick(ev: MouseEvent): void {\r\n // If the click was outside the dropdown, we close the dropdown\r\n // The click will then still propagate\r\n const clickInTrigger = this.trigger && this.trigger.contains(ev.target as Element);\r\n const clickInBody = this.body && this.body.contains(ev.target as Element);\r\n if (!clickInBody && !clickInTrigger) {\r\n this.toggleDropdown(false, ToggleAction.Dismiss);\r\n }\r\n }\r\n\r\n /**\r\n * Click handler to close the dropdown as a result of an interactive element\r\n * click. Used in click capturing phase\r\n * @param ev Click event object\r\n */\r\n private onInteractiveClick(ev: MouseEvent): void {\r\n // Check to see if the click's target is inside of an interactive element\r\n let shouldClose = false;\r\n traverseDomTree(ev.target as Element, el => {\r\n if (shouldCloseDropdown(el)) {\r\n shouldClose = true;\r\n }\r\n\r\n // Stop traversal once we hit the root of the body, since this\r\n // event is only handled by the body\r\n return this.body && el === this.body;\r\n });\r\n\r\n if (shouldClose) {\r\n this.toggleDropdown(false, ToggleAction.Interaction);\r\n }\r\n }\r\n\r\n /**\r\n * Keyboard handler to detect keypresse while the dropdown is open\r\n * @param ev Keyboard event object\r\n */\r\n private onExpandedKeyDown(ev: KeyboardEvent): void {\r\n switch (ev.key) {\r\n // When pressing ESC, close the dropdown and stop\r\n // Focus is taken to the dropdown trigger\r\n case 'Escape':\r\n case 'Esc':\r\n ev.preventDefault();\r\n ev.stopPropagation();\r\n this.toggleDropdown(false, ToggleAction.Dismiss);\r\n if (this.trigger) {\r\n this.trigger.focus();\r\n }\r\n break;\r\n }\r\n }\r\n\r\n /** Handler to close the dropdown on a window resize event */\r\n private onExpandedResize(): void {\r\n this.toggleDropdown(false, ToggleAction.Dismiss);\r\n }\r\n\r\n /**\r\n * Opens or closes the dropdown and handles setting / removing handlers for\r\n * associated interactions\r\n * @param expanded The new expanded value for the dropdown we are requesting.\r\n * Defaults to the opposite of the current state if not passed\r\n * @param action Optional value indicating what triggered the toggling of the dropdown\r\n */\r\n protected toggleDropdown(expanded: boolean = !this.state.expanded, action: ToggleAction = ToggleAction.Trigger): void {\r\n if (expanded) {\r\n // Position the body around the trigger based on configuration first\r\n if (this.body && this.trigger) {\r\n anchorElementTo(\r\n this.body,\r\n this.trigger,\r\n this.props.position as AnchorPosition || AnchorPosition.Bottom,\r\n this.props.alignment as AnchorAlignment || AnchorAlignment.Start\r\n ).then(() => {\r\n // Add handlers to detect interactions outside of the control\r\n document.addEventListener('click', this.onExpandedClick, true);\r\n window.addEventListener('resize', this.onExpandedResize);\r\n\r\n // Add handlers for interactions that close the control\r\n if (this.body) {\r\n this.body.addEventListener('click', this.onInteractiveClick);\r\n this.body.addEventListener('keydown', this.onExpandedKeyDown);\r\n }\r\n if (this.trigger) {\r\n this.trigger.addEventListener('keydown', this.onExpandedKeyDown);\r\n }\r\n\r\n // Update state and re-render\r\n // We do this after positioning to avoid weird jumps\r\n this.setState({ expanded: true });\r\n });\r\n }\r\n }\r\n else {\r\n // Remove unneeded handlers now that the dropdown is closed\r\n document.removeEventListener('click', this.onExpandedClick, true);\r\n window.removeEventListener('resize', this.onExpandedResize);\r\n if (this.body) {\r\n this.body.removeEventListener('click', this.onInteractiveClick);\r\n this.body.removeEventListener('keydown', this.onExpandedKeyDown);\r\n }\r\n if (this.trigger) {\r\n this.trigger.removeEventListener('keydown', this.onExpandedKeyDown);\r\n }\r\n\r\n // Update state and re-render\r\n this.setState({ expanded: false });\r\n }\r\n\r\n this.props.onToggle && this.props.onToggle(expanded, action);\r\n }\r\n\r\n public componentDidMount(): void {\r\n if (this.props.defaultExpanded === true) {\r\n this.toggleDropdown(true);\r\n }\r\n }\r\n\r\n /** Update method that runs after render() for the dropdown */\r\n public componentDidUpdate(oldProps: IDropdownBaseProps, oldState: IDropdownBaseState): void {\r\n const { expanded } = this.state;\r\n\r\n // Every time we update the component we need to update focus traps\r\n // in case the update changed the elements inside of it\r\n // To this effect, we always clear focus traps and then set them up\r\n // again if the dropdown is open\r\n this.removeFocusTraps && this.removeFocusTraps();\r\n if (expanded) {\r\n this.setUpFocusTraps();\r\n \r\n // Focus the first object within body when dropdown opens\r\n const justOpened = !oldState.expanded;\r\n if (this.body && justOpened) {\r\n let focusable = getFocusableElements(this.body);\r\n focusable[0]?.focus();\r\n }\r\n }\r\n\r\n // Now handle focusing on the trigger button\r\n // We only need to do this if we just closed the dropdown and\r\n // nothing else is focused\r\n const justClosed = !expanded && oldState.expanded;\r\n const focused = document.activeElement;\r\n const nothingFocused = focused === null || focused === undefined || focused === document.body;\r\n if (justClosed && nothingFocused && this.trigger) {\r\n this.trigger.focus();\r\n }\r\n }\r\n}\r\n","import { h } from \"preact\";\r\nimport cc from 'classcat';\r\nimport { createId } from '@mecontrol/web-inline';\r\nimport { Tooltip } from '@mecontrol/web-boot';\r\nimport { IDropdownBaseProps, DropdownBase } from './DropdownBase';\r\n\r\nexport interface IDropdownProps extends IDropdownBaseProps {\r\n id: string;\r\n renderBody(): JSX.Element;\r\n renderTrigger(expanded: boolean): JSX.Element;\r\n cssClass?: string;\r\n ariaLabel?: string;\r\n tooltip?: boolean;\r\n}\r\n\r\nexport class Dropdown extends DropdownBase {\r\n\r\n constructor(props: IDropdownProps) {\r\n super(props);\r\n }\r\n\r\n /** Render method for the dropdown */\r\n public render(): JSX.Element {\r\n const {\r\n id,\r\n renderBody,\r\n renderTrigger,\r\n cssClass,\r\n ariaLabel,\r\n tooltip\r\n } = this.props;\r\n const { expanded } = this.state;\r\n\r\n const triggerId = createId(id, 'trigger');\r\n const bodyId = createId(id, 'body');\r\n\r\n let trigger =\r\n this.toggleDropdown()}\r\n // A11y\r\n aria-label={ariaLabel}\r\n aria-expanded={expanded.toString()}\r\n aria-controls={bodyId}\r\n // Control\r\n data-noClose='true'\r\n ref={btn => this.trigger = btn as HTMLElement}\r\n >\r\n {renderTrigger(expanded)}\r\n ;\r\n\r\n if (tooltip && ariaLabel) {\r\n trigger = {trigger};\r\n }\r\n\r\n return (\r\n \r\n {trigger}\r\n this.body = div as HTMLElement}\r\n >\r\n {renderBody()}\r\n
    \r\n \r\n );\r\n }\r\n}\r\n","import { FunctionalComponent, h, ComponentFactory } from 'preact';\r\nimport { IPresenceState } from '@mecontrol/public-api';\r\nimport { IMeControlAppState } from '@mecontrol/common';\r\nimport { MapStateToProps, connect } from '@mecontrol/web-boot';\r\n\r\nexport interface IPresenceHeaderStateProps {\r\n currentPresence?: IPresenceState;\r\n}\r\n\r\nexport type IPresenceHeaderProps = IPresenceHeaderStateProps;\r\n\r\nconst PresenceHeaderImpl: FunctionalComponent = props => {\r\n let { currentPresence } = props;\r\n let imgCss: { [backgroundImage: string]: string } = {};\r\n let presenceHeader = null;\r\n if (currentPresence) {\r\n imgCss.backgroundImage = 'url(' + currentPresence.imageUrl + ')';\r\n presenceHeader =
    ;\r\n }\r\n\r\n return (presenceHeader);\r\n};\r\n\r\nconst mapStateToProps: MapStateToProps = state => ({\r\n currentPresence: state.presenceConfig.currentPresence\r\n});\r\n\r\nexport const PresenceHeader: ComponentFactory<{}> = connect(mapStateToProps, () => { return; })(PresenceHeaderImpl);\r\n","import {\r\n IContentUpdateEvent, IContentUpdateParams,\r\n IContentUpdatePartB, IContentUpdatePartC\r\n} from '@mecontrol/common';\r\nimport { ME, EventMoment, createPartA, getPageTags, getContentJson } from '@mecontrol/web-inline';\r\n\r\nconst eventName = 'Ms.Webi.ContentUpdate';\r\nconst eventBaseType = 'Ms.Content.ContentUpdate';\r\n\r\n/**\r\n * Creates a ContentUpdate telemetry event, capturing the time it took for some part of\r\n * the MeControl to update\r\n * @param updateParams Content update parameters\r\n * @param updateParams.content Information on the content that was updated\r\n * @param moment Object with information on when the event took place\r\n * @returns The created ContentUpdate event\r\n */\r\nexport function createContentUpdate(updateParams: IContentUpdateParams, moment: EventMoment): IContentUpdateEvent {\r\n let partA = createPartA(eventName, moment.date, moment.cv);\r\n\r\n let contentBlob = getContentJson(updateParams.content);\r\n\r\n let partB: IContentUpdatePartB = {\r\n ver: '1.0',\r\n impressionGuid: moment.impressionGuid,\r\n market: ME.Config.mkt,\r\n pageTags: JSON.stringify(getPageTags(moment.accounts.counts, moment.accounts.current)),\r\n contentVer: '2.0',\r\n content: '[' + contentBlob + ']'\r\n };\r\n\r\n let partC: IContentUpdatePartC = {\r\n baseType: eventBaseType,\r\n pageLoadTime: Math.round(updateParams.loadTime),\r\n timings: JSON.stringify(updateParams.timings),\r\n cookieEnabled: navigator.cookieEnabled === true,\r\n isJs: true,\r\n isLoggedIn: !!moment.accounts.current,\r\n isManual: true\r\n };\r\n\r\n return {\r\n partA,\r\n partB,\r\n partC\r\n };\r\n}\r\n\r\n","import { IPageActionEvent, IPageActionParams, IPageActionPartB, IPageActionPartC } from '@mecontrol/common';\r\nimport { ME, EventMoment, createPartA, getPageTags, getTimeSince, scrubUrl, getContentJson } from '@mecontrol/web-inline';\r\n\r\nconst eventName = 'Ms.Webi.PageAction';\r\nconst eventBaseType = 'Ms.Content.PageAction';\r\n\r\n/**\r\n * Creates a PageAction event to capture clicks\r\n * @param eventParams An object with all the information needed to create a PageActionEvent\r\n * @param eventParams.content Information on the content that was clicked\r\n * @param eventParams.targetUrl Optional target that a link takes the user to (for clicked links)\r\n * @param eventParams.behavior Optional description of what the page action will do, as defined in IBehaviors\r\n * @param eventParams.action Optional description of the page action itself, as defined in IActions\r\n * @returns The created PageAction event\r\n */\r\nexport function createPageAction(actionParams: IPageActionParams, moment: EventMoment): IPageActionEvent {\r\n let partA = createPartA(eventName, moment.date, moment.cv);\r\n\r\n let contentBlob = getContentJson(actionParams.content);\r\n let targetUrl = actionParams.targetUrl && scrubUrl(actionParams.targetUrl);\r\n\r\n let partB: IPageActionPartB = {\r\n ver: '1.1',\r\n pageName: moment.pageName,\r\n impressionGuid: moment.impressionGuid,\r\n destUri: targetUrl,\r\n market: ME.Config.mkt,\r\n pageTags: JSON.stringify(getPageTags(moment.accounts.counts, moment.accounts.current)),\r\n contentVer: '2.0',\r\n content: '[' + contentBlob + ']'\r\n };\r\n\r\n let partC: IPageActionPartC = {\r\n baseType: eventBaseType,\r\n timeToAction: getTimeSince(moment.timestamp),\r\n cookieEnabled: navigator.cookieEnabled === true,\r\n isJs: true,\r\n isLoggedIn: !!moment.accounts.current,\r\n isManual: true\r\n };\r\n\r\n return {\r\n partA,\r\n partB,\r\n partC\r\n };\r\n}\r\n","import { IPartnerApiCallEvent, IPartnerApiCallParams, IPartnerApiCallPartC, AnyObject } from '@mecontrol/common';\r\nimport { ME, EventMoment, createPartA, scrubUrl } from '@mecontrol/web-inline';\r\nimport { filterObject } from '@mecontrol/web-boot';\r\n\r\nconst eventName = 'Ms.Webi.MeControl.PartnerApiCall';\r\n// Filter practically everything\r\nconst FILTER_FIELDS = ['*', '!idp', '!authenticatedState', '!type', '!apiGeneration'];\r\nconst URL_PATTERN = /https?:\\/\\/.*/i;\r\n\r\n/**\r\n * Creates a PartnerApiCall event to log information on public Me Control API usage from partners.\r\n * Filters out user data before logging the information.\r\n * @param apiParams The object containig details of the API call a partner made\r\n * @returns The PartnerApiCall event that was created\r\n */\r\nexport function createPartnerApiCall(apiParams: IPartnerApiCallParams, moment: EventMoment): IPartnerApiCallEvent {\r\n let partA = createPartA(eventName, moment.date, moment.cv);\r\n\r\n let filteredParams = filterObject(apiParams.params, FILTER_FIELDS);\r\n filterUrlsInObject(filteredParams);\r\n\r\n let partC: IPartnerApiCallPartC = {\r\n baseType: undefined,\r\n partner: ME.Config.ptn,\r\n controlVersion: ME.Config.ver,\r\n methodName: apiParams.method,\r\n parameters: JSON.stringify(filteredParams)\r\n };\r\n\r\n return {\r\n partA,\r\n partB: undefined,\r\n partC\r\n };\r\n}\r\n\r\n/**\r\n * Modifies the provided object by combing through all its properties in search of strings that\r\n * match the URL pattern regex. These strings are then scrubbed of all their query parameters.\r\n * Also walks through any nested objects the original object may have.\r\n * @param targetObj The object to scrub\r\n */\r\nfunction filterUrlsInObject(targetObj: AnyObject): void {\r\n // tslint:disable-next-line:forin\r\n for (let propName in targetObj) {\r\n let propValue = targetObj[propName];\r\n switch (typeof propValue) {\r\n case 'object':\r\n if (propValue != null) {\r\n filterUrlsInObject(propValue);\r\n }\r\n break;\r\n case 'string':\r\n if (URL_PATTERN.test(propValue)) {\r\n targetObj[propName] = scrubUrl(propValue);\r\n }\r\n break;\r\n }\r\n }\r\n}\r\n","import {\r\n setEventCreator\r\n} from '@mecontrol/web-inline';\r\n\r\n\r\nimport { createContentUpdate } from './creators/contentUpdate';\r\nimport { createPageAction } from './creators/pageAction';\r\nimport { createPartnerApiCall } from './creators/partnerApiCall';\r\n\r\n/**\r\n * Set up additional event creators and writers\r\n */\r\nexport function enhanceTelemetry(): void {\r\n\r\n setEventCreator('ContentUpdate', createContentUpdate);\r\n setEventCreator('PageAction', createPageAction);\r\n setEventCreator('PartnerApiCall', createPartnerApiCall);\r\n}\r\n","import { ME, loadCss } from '@mecontrol/web-inline';\r\n\r\nexport * from './components/Body';\r\nexport * from './components/Dropdown';\r\nexport * from './components/Menu';\r\nexport * from './components/Presence';\r\nexport * from './components/PresenceDropdown';\r\nexport * from './components/PresenceHeader';\r\n\r\nexport { enhanceTelemetry } from './telemetry';\r\n\r\nloadCss(ME.CssmeCore);\r\n"],"names":["VNode","options","stack","EMPTY_CHILDREN","h","nodeName","attributes","children","lastSimple","child","simple","i","arguments","length","push","pop","undefined","String","p","key","extend","obj","props","applyRef","ref","value","current","defer","Promise","resolve","then","bind","setTimeout","NO_RENDER","SYNC_RENDER","isSameNodeType","hydrating","vnode","node","isNamedNode","normalizedNodeName","document","removeChild","old","name","style","toLowerCase","parent","idiff","flushMounts","vnodeName","dom","vchildren","dangerouslySetInnerHTML","originalChildren","keyed","min","childrenLen","vlen","recollectNodeTree","_component","removeChildren","next","attrs","Ctor","prototype","context","nextBase","constructor","component","state","previousProps","previousState","isUpdate","base","snapshot","_dirty","render","childComponent","inst","cbase","mountAll","isChild","c","oldDom","originalComponent","beforeUnmount","_disable","ME","delayUntilAnimationFrame","getClientRect","getVisibleWindowRect","getDocumentRect","isElement","debounce","logTelemetryEvent","createId","Tooltip","LinkButton","SyntheticEvent","getOptions","getString","isFunctionallyMsaOrWithEditPicUrl","ProfilePictureOverlay","ProfilePicture","connect","mapStateToProps","setPresenceToPartner","getFullDisplayName","TruncateText","raiseSyntheticEvent","setQueryParams","isFunctionallyMsaLike","AuthAppUpsell","mainIdPart","getVerbalFriendlyName","format","isAadLike","getAccountListDisplayName","isSignedIn","toChildArray","getOtherAccounts","getCurrentAccount","getAccountId","createPartA","getContentJson","getPageTags","eventName","eventBaseType","scrubUrl","getTimeSince","filterObject","setEventCreator","loadCss"],"mappings":";;IAAA;IACA;IACA;IACA;IACA;;IAEA;IACA;IACA;IACA;;IAEA;IACA;IACA;IACA;;IAEA,IAAI,aAAa,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE;IACnC,IAAI,aAAa,GAAG,MAAM,CAAC,cAAc;IACzC,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;IACpF,QAAQ,UAAU,CAAC,EAAE,CAA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