@everymatrix/player-bonus-history 1.0.16 → 1.0.69

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +0,0 @@
1
- {"version":3,"file":"player-bonus-history.js","sources":["../../../node_modules/svelte/internal/index.mjs","../../../node_modules/whatwg-fetch/fetch.js","../../../node_modules/isomorphic-fetch/fetch-npm-browserify.js","../../../node_modules/rvhelper/node_modules/rxjs/node_modules/tslib/tslib.es6.js","../../../node_modules/rvhelper/node_modules/rxjs/dist/esm5/internal/util/isFunction.js","../../../node_modules/rvhelper/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js","../../../node_modules/rvhelper/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js","../../../node_modules/rvhelper/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js","../../../node_modules/rvhelper/node_modules/rxjs/dist/esm5/internal/Subscription.js","../../../node_modules/rvhelper/node_modules/rxjs/dist/esm5/internal/config.js","../../../node_modules/rvhelper/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js","../../../node_modules/rvhelper/node_modules/rxjs/dist/esm5/internal/util/noop.js","../../../node_modules/rvhelper/node_modules/rxjs/dist/esm5/internal/util/errorContext.js","../../../node_modules/rvhelper/node_modules/rxjs/dist/esm5/internal/Subscriber.js","../../../node_modules/rvhelper/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js","../../../node_modules/rvhelper/node_modules/rxjs/dist/esm5/internal/symbol/observable.js","../../../node_modules/rvhelper/node_modules/rxjs/dist/esm5/internal/util/identity.js","../../../node_modules/rvhelper/node_modules/rxjs/dist/esm5/internal/Observable.js","../../../node_modules/rvhelper/node_modules/rxjs/dist/esm5/internal/util/pipe.js","../../../node_modules/rvhelper/node_modules/rxjs/dist/esm5/internal/util/ObjectUnsubscribedError.js","../../../node_modules/rvhelper/node_modules/rxjs/dist/esm5/internal/ReplaySubject.js","../../../node_modules/rvhelper/node_modules/rxjs/dist/esm5/internal/Subject.js","../../../node_modules/rvhelper/node_modules/rxjs/dist/esm5/internal/scheduler/dateTimestampProvider.js","../../../node_modules/rvhelper/communication.js","../../../node_modules/svelte/store/index.mjs","../../../node_modules/deepmerge/dist/cjs.js","../../../node_modules/tslib/tslib.es6.js","../../../node_modules/@formatjs/icu-messageformat-parser/lib/error.js","../../../node_modules/@formatjs/icu-messageformat-parser/lib/types.js","../../../node_modules/@formatjs/icu-messageformat-parser/lib/regex.generated.js","../../../node_modules/@formatjs/icu-skeleton-parser/lib/date-time.js","../../../node_modules/@formatjs/icu-skeleton-parser/lib/regex.generated.js","../../../node_modules/@formatjs/icu-skeleton-parser/lib/number.js","../../../node_modules/@formatjs/icu-messageformat-parser/lib/parser.js","../../../node_modules/@formatjs/icu-messageformat-parser/lib/time-data.generated.js","../../../node_modules/@formatjs/icu-messageformat-parser/lib/date-time-pattern-generator.js","../../../node_modules/@formatjs/icu-messageformat-parser/lib/index.js","../../../node_modules/@formatjs/fast-memoize/lib/index.js","../../../node_modules/intl-messageformat/lib/src/error.js","../../../node_modules/intl-messageformat/lib/src/formatters.js","../../../node_modules/intl-messageformat/lib/src/core.js","../../../node_modules/intl-messageformat/lib/index.js","../../../node_modules/svelte-i18n/dist/runtime.esm.js","../../../node_modules/rvhelper/index.js","../../../node_modules/moment/moment.js","../../player-bonus-card/src/i18n.js","../../player-bonus-card/src/translations.js","../../player-bonus-card/src/PlayerBonusCard.svelte","../../player-bonus-card/src/index.ts","../../../node_modules/@vaadin/vaadin-lumo-styles/version.js","../../../node_modules/@webcomponents/shadycss/src/document-wait.js","../../../node_modules/@webcomponents/shadycss/src/custom-style-interface.js","../../../node_modules/@webcomponents/shadycss/src/common-regex.js","../../../node_modules/@webcomponents/shadycss/src/common-utils.js","../../../node_modules/@webcomponents/shadycss/src/style-settings.js","../../../node_modules/@webcomponents/shadycss/entrypoints/custom-style-interface.js","../../../node_modules/@polymer/polymer/lib/utils/boot.js","../../../node_modules/@polymer/polymer/lib/utils/resolve-url.js","../../../node_modules/@polymer/polymer/lib/utils/settings.js","../../../node_modules/@polymer/polymer/lib/elements/dom-module.js","../../../node_modules/@polymer/polymer/lib/utils/style-gather.js","../../../node_modules/@polymer/polymer/lib/elements/custom-style.js","../../../node_modules/@vaadin/vaadin-lumo-styles/sizing.js","../../../node_modules/@vaadin/vaadin-lumo-styles/spacing.js","../../../node_modules/@vaadin/vaadin-lumo-styles/style.js","../../../node_modules/@vaadin/vaadin-lumo-styles/color.js","../../../node_modules/@vaadin/vaadin-lumo-styles/typography.js","../../../node_modules/@vaadin/vaadin-lumo-styles/mixins/overlay.js","../../../node_modules/@vaadin/vaadin-lumo-styles/mixins/menu-overlay.js","../../../node_modules/@polymer/polymer/lib/utils/html-tag.js","../../../node_modules/@vaadin/vaadin-date-picker/theme/lumo/vaadin-date-picker-overlay-styles.js","../../../node_modules/@vaadin/vaadin-button/theme/lumo/vaadin-button-styles.js","../../../node_modules/@polymer/polymer/lib/utils/mixin.js","../../../node_modules/@polymer/polymer/lib/utils/wrap.js","../../../node_modules/@polymer/polymer/lib/utils/path.js","../../../node_modules/@polymer/polymer/lib/utils/case-map.js","../../../node_modules/@polymer/polymer/lib/utils/async.js","../../../node_modules/@polymer/polymer/lib/mixins/properties-changed.js","../../../node_modules/@polymer/polymer/lib/mixins/property-accessors.js","../../../node_modules/@polymer/polymer/lib/mixins/template-stamp.js","../../../node_modules/@polymer/polymer/lib/mixins/property-effects.js","../../../node_modules/@polymer/polymer/lib/mixins/properties-mixin.js","../../../node_modules/@polymer/polymer/lib/mixins/element-mixin.js","../../../node_modules/@polymer/polymer/polymer-element.js","../../../node_modules/@polymer/polymer/lib/utils/debounce.js","../../../node_modules/@polymer/polymer/lib/utils/gestures.js","../../../node_modules/@polymer/polymer/lib/mixins/gesture-event-listeners.js","../../../node_modules/@vaadin/vaadin-themable-mixin/vaadin-theme-property-mixin.js","../../../node_modules/@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js","../../../node_modules/@vaadin/vaadin-control-state-mixin/vaadin-control-state-mixin.js","../../../node_modules/@polymer/polymer/lib/utils/flush.js","../../../node_modules/@vaadin/vaadin-element-mixin/vaadin-dir-helper.js","../../../node_modules/@vaadin/vaadin-element-mixin/vaadin-dir-mixin.js","../../../node_modules/@vaadin/vaadin-development-mode-detector/vaadin-development-mode-detector.js","../../../node_modules/@vaadin/vaadin-usage-statistics/vaadin-usage-statistics-collect.js","../../../node_modules/@vaadin/vaadin-element-mixin/vaadin-element-mixin.js","../../../node_modules/@vaadin/vaadin-button/src/vaadin-button.js","../../../node_modules/@vaadin/vaadin-date-picker/theme/lumo/vaadin-date-picker-overlay-content-styles.js","../../../node_modules/@vaadin/vaadin-date-picker/theme/lumo/vaadin-month-calendar-styles.js","../../../node_modules/@vaadin/vaadin-lumo-styles/font-icons.js","../../../node_modules/@vaadin/vaadin-lumo-styles/mixins/field-button.js","../../../node_modules/@vaadin/vaadin-lumo-styles/mixins/required-field.js","../../../node_modules/@vaadin/vaadin-text-field/theme/lumo/vaadin-text-field-styles.js","../../../node_modules/@vaadin/vaadin-text-field/src/vaadin-text-field-mixin.js","../../../node_modules/@vaadin/vaadin-text-field/src/vaadin-text-field.js","../../../node_modules/@vaadin/vaadin-date-picker/theme/lumo/vaadin-date-picker-styles.js","../../../node_modules/@webcomponents/shadycss/src/css-parse.js","../../../node_modules/@webcomponents/shadycss/src/unscoped-style-handler.js","../../../node_modules/@webcomponents/shadycss/src/style-util.js","../../../node_modules/@webcomponents/shadycss/src/apply-shim.js","../../../node_modules/@webcomponents/shadycss/src/template-map.js","../../../node_modules/@webcomponents/shadycss/src/apply-shim-utils.js","../../../node_modules/@webcomponents/shadycss/entrypoints/apply-shim.js","../../../node_modules/@polymer/polymer/lib/mixins/dir-mixin.js","../../../node_modules/@polymer/polymer/lib/utils/render-status.js","../../../node_modules/@polymer/polymer/lib/utils/unresolved.js","../../../node_modules/@polymer/polymer/lib/utils/array-splice.js","../../../node_modules/@polymer/polymer/lib/utils/flattened-nodes-observer.js","../../../node_modules/@polymer/polymer/lib/legacy/polymer.dom.js","../../../node_modules/@polymer/polymer/lib/utils/scope-subtree.js","../../../node_modules/@polymer/polymer/lib/mixins/disable-upgrade-mixin.js","../../../node_modules/@polymer/polymer/lib/legacy/legacy-element-mixin.js","../../../node_modules/@polymer/polymer/lib/legacy/class.js","../../../node_modules/@polymer/polymer/lib/legacy/polymer-fn.js","../../../node_modules/@polymer/polymer/lib/mixins/mutable-data.js","../../../node_modules/@polymer/polymer/lib/utils/templatize.js","../../../node_modules/@polymer/polymer/lib/utils/hide-template-controls.js","../../../node_modules/@polymer/polymer/lib/elements/dom-bind.js","../../../node_modules/@polymer/polymer/lib/elements/dom-repeat.js","../../../node_modules/@polymer/polymer/lib/elements/dom-if.js","../../../node_modules/@polymer/polymer/lib/elements/array-selector.js","../../../node_modules/@polymer/polymer/polymer-legacy.js","../../../node_modules/@polymer/iron-media-query/iron-media-query.js","../../../node_modules/@vaadin/vaadin-overlay/src/vaadin-focusables-helper.js","../../../node_modules/@vaadin/vaadin-overlay/src/vaadin-overlay.js","../../../node_modules/@vaadin/vaadin-date-picker/src/vaadin-date-picker-overlay.js","../../../node_modules/@polymer/iron-a11y-keys-behavior/iron-a11y-keys-behavior.js","../../../node_modules/@polymer/iron-a11y-announcer/iron-a11y-announcer.js","../../../node_modules/@vaadin/vaadin-date-picker/src/vaadin-date-picker-helper.js","../../../node_modules/@vaadin/vaadin-date-picker/src/vaadin-month-calendar.js","../../../node_modules/@vaadin/vaadin-date-picker/src/vaadin-infinite-scroller.js","../../../node_modules/@vaadin/vaadin-date-picker/src/vaadin-date-picker-styles.js","../../../node_modules/@vaadin/vaadin-date-picker/src/vaadin-date-picker-overlay-content.js","../../../node_modules/@polymer/iron-resizable-behavior/iron-resizable-behavior.js","../../../node_modules/@vaadin/vaadin-date-picker/src/vaadin-date-picker.js","../../../node_modules/@vaadin/vaadin-date-picker/src/vaadin-date-picker-mixin.js","../src/i18n.js","../src/translations.js","../src/PlayerBonusHistory.svelte","../src/index.ts"],"sourcesContent":["function noop() { }\nconst identity = x => x;\nfunction assign(tar, src) {\n // @ts-ignore\n for (const k in src)\n tar[k] = src[k];\n return tar;\n}\nfunction is_promise(value) {\n return value && typeof value === 'object' && typeof value.then === 'function';\n}\nfunction add_location(element, file, line, column, char) {\n element.__svelte_meta = {\n loc: { file, line, column, char }\n };\n}\nfunction run(fn) {\n return fn();\n}\nfunction blank_object() {\n return Object.create(null);\n}\nfunction run_all(fns) {\n fns.forEach(run);\n}\nfunction is_function(thing) {\n return typeof thing === 'function';\n}\nfunction safe_not_equal(a, b) {\n return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');\n}\nlet src_url_equal_anchor;\nfunction src_url_equal(element_src, url) {\n if (!src_url_equal_anchor) {\n src_url_equal_anchor = document.createElement('a');\n }\n src_url_equal_anchor.href = url;\n return element_src === src_url_equal_anchor.href;\n}\nfunction not_equal(a, b) {\n return a != a ? b == b : a !== b;\n}\nfunction is_empty(obj) {\n return Object.keys(obj).length === 0;\n}\nfunction validate_store(store, name) {\n if (store != null && typeof store.subscribe !== 'function') {\n throw new Error(`'${name}' is not a store with a 'subscribe' method`);\n }\n}\nfunction subscribe(store, ...callbacks) {\n if (store == null) {\n return noop;\n }\n const unsub = store.subscribe(...callbacks);\n return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;\n}\nfunction get_store_value(store) {\n let value;\n subscribe(store, _ => value = _)();\n return value;\n}\nfunction component_subscribe(component, store, callback) {\n component.$$.on_destroy.push(subscribe(store, callback));\n}\nfunction create_slot(definition, ctx, $$scope, fn) {\n if (definition) {\n const slot_ctx = get_slot_context(definition, ctx, $$scope, fn);\n return definition[0](slot_ctx);\n }\n}\nfunction get_slot_context(definition, ctx, $$scope, fn) {\n return definition[1] && fn\n ? assign($$scope.ctx.slice(), definition[1](fn(ctx)))\n : $$scope.ctx;\n}\nfunction get_slot_changes(definition, $$scope, dirty, fn) {\n if (definition[2] && fn) {\n const lets = definition[2](fn(dirty));\n if ($$scope.dirty === undefined) {\n return lets;\n }\n if (typeof lets === 'object') {\n const merged = [];\n const len = Math.max($$scope.dirty.length, lets.length);\n for (let i = 0; i < len; i += 1) {\n merged[i] = $$scope.dirty[i] | lets[i];\n }\n return merged;\n }\n return $$scope.dirty | lets;\n }\n return $$scope.dirty;\n}\nfunction update_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn) {\n if (slot_changes) {\n const slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn);\n slot.p(slot_context, slot_changes);\n }\n}\nfunction update_slot(slot, slot_definition, ctx, $$scope, dirty, get_slot_changes_fn, get_slot_context_fn) {\n const slot_changes = get_slot_changes(slot_definition, $$scope, dirty, get_slot_changes_fn);\n update_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn);\n}\nfunction get_all_dirty_from_scope($$scope) {\n if ($$scope.ctx.length > 32) {\n const dirty = [];\n const length = $$scope.ctx.length / 32;\n for (let i = 0; i < length; i++) {\n dirty[i] = -1;\n }\n return dirty;\n }\n return -1;\n}\nfunction exclude_internal_props(props) {\n const result = {};\n for (const k in props)\n if (k[0] !== '$')\n result[k] = props[k];\n return result;\n}\nfunction compute_rest_props(props, keys) {\n const rest = {};\n keys = new Set(keys);\n for (const k in props)\n if (!keys.has(k) && k[0] !== '$')\n rest[k] = props[k];\n return rest;\n}\nfunction compute_slots(slots) {\n const result = {};\n for (const key in slots) {\n result[key] = true;\n }\n return result;\n}\nfunction once(fn) {\n let ran = false;\n return function (...args) {\n if (ran)\n return;\n ran = true;\n fn.call(this, ...args);\n };\n}\nfunction null_to_empty(value) {\n return value == null ? '' : value;\n}\nfunction set_store_value(store, ret, value) {\n store.set(value);\n return ret;\n}\nconst has_prop = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);\nfunction action_destroyer(action_result) {\n return action_result && is_function(action_result.destroy) ? action_result.destroy : noop;\n}\n\nconst is_client = typeof window !== 'undefined';\nlet now = is_client\n ? () => window.performance.now()\n : () => Date.now();\nlet raf = is_client ? cb => requestAnimationFrame(cb) : noop;\n// used internally for testing\nfunction set_now(fn) {\n now = fn;\n}\nfunction set_raf(fn) {\n raf = fn;\n}\n\nconst tasks = new Set();\nfunction run_tasks(now) {\n tasks.forEach(task => {\n if (!task.c(now)) {\n tasks.delete(task);\n task.f();\n }\n });\n if (tasks.size !== 0)\n raf(run_tasks);\n}\n/**\n * For testing purposes only!\n */\nfunction clear_loops() {\n tasks.clear();\n}\n/**\n * Creates a new task that runs on each raf frame\n * until it returns a falsy value or is aborted\n */\nfunction loop(callback) {\n let task;\n if (tasks.size === 0)\n raf(run_tasks);\n return {\n promise: new Promise(fulfill => {\n tasks.add(task = { c: callback, f: fulfill });\n }),\n abort() {\n tasks.delete(task);\n }\n };\n}\n\n// Track which nodes are claimed during hydration. Unclaimed nodes can then be removed from the DOM\n// at the end of hydration without touching the remaining nodes.\nlet is_hydrating = false;\nfunction start_hydrating() {\n is_hydrating = true;\n}\nfunction end_hydrating() {\n is_hydrating = false;\n}\nfunction upper_bound(low, high, key, value) {\n // Return first index of value larger than input value in the range [low, high)\n while (low < high) {\n const mid = low + ((high - low) >> 1);\n if (key(mid) <= value) {\n low = mid + 1;\n }\n else {\n high = mid;\n }\n }\n return low;\n}\nfunction init_hydrate(target) {\n if (target.hydrate_init)\n return;\n target.hydrate_init = true;\n // We know that all children have claim_order values since the unclaimed have been detached if target is not <head>\n let children = target.childNodes;\n // If target is <head>, there may be children without claim_order\n if (target.nodeName === 'HEAD') {\n const myChildren = [];\n for (let i = 0; i < children.length; i++) {\n const node = children[i];\n if (node.claim_order !== undefined) {\n myChildren.push(node);\n }\n }\n children = myChildren;\n }\n /*\n * Reorder claimed children optimally.\n * We can reorder claimed children optimally by finding the longest subsequence of\n * nodes that are already claimed in order and only moving the rest. The longest\n * subsequence subsequence of nodes that are claimed in order can be found by\n * computing the longest increasing subsequence of .claim_order values.\n *\n * This algorithm is optimal in generating the least amount of reorder operations\n * possible.\n *\n * Proof:\n * We know that, given a set of reordering operations, the nodes that do not move\n * always form an increasing subsequence, since they do not move among each other\n * meaning that they must be already ordered among each other. Thus, the maximal\n * set of nodes that do not move form a longest increasing subsequence.\n */\n // Compute longest increasing subsequence\n // m: subsequence length j => index k of smallest value that ends an increasing subsequence of length j\n const m = new Int32Array(children.length + 1);\n // Predecessor indices + 1\n const p = new Int32Array(children.length);\n m[0] = -1;\n let longest = 0;\n for (let i = 0; i < children.length; i++) {\n const current = children[i].claim_order;\n // Find the largest subsequence length such that it ends in a value less than our current value\n // upper_bound returns first greater value, so we subtract one\n // with fast path for when we are on the current longest subsequence\n const seqLen = ((longest > 0 && children[m[longest]].claim_order <= current) ? longest + 1 : upper_bound(1, longest, idx => children[m[idx]].claim_order, current)) - 1;\n p[i] = m[seqLen] + 1;\n const newLen = seqLen + 1;\n // We can guarantee that current is the smallest value. Otherwise, we would have generated a longer sequence.\n m[newLen] = i;\n longest = Math.max(newLen, longest);\n }\n // The longest increasing subsequence of nodes (initially reversed)\n const lis = [];\n // The rest of the nodes, nodes that will be moved\n const toMove = [];\n let last = children.length - 1;\n for (let cur = m[longest] + 1; cur != 0; cur = p[cur - 1]) {\n lis.push(children[cur - 1]);\n for (; last >= cur; last--) {\n toMove.push(children[last]);\n }\n last--;\n }\n for (; last >= 0; last--) {\n toMove.push(children[last]);\n }\n lis.reverse();\n // We sort the nodes being moved to guarantee that their insertion order matches the claim order\n toMove.sort((a, b) => a.claim_order - b.claim_order);\n // Finally, we move the nodes\n for (let i = 0, j = 0; i < toMove.length; i++) {\n while (j < lis.length && toMove[i].claim_order >= lis[j].claim_order) {\n j++;\n }\n const anchor = j < lis.length ? lis[j] : null;\n target.insertBefore(toMove[i], anchor);\n }\n}\nfunction append(target, node) {\n target.appendChild(node);\n}\nfunction append_styles(target, style_sheet_id, styles) {\n const append_styles_to = get_root_for_style(target);\n if (!append_styles_to.getElementById(style_sheet_id)) {\n const style = element('style');\n style.id = style_sheet_id;\n style.textContent = styles;\n append_stylesheet(append_styles_to, style);\n }\n}\nfunction get_root_for_style(node) {\n if (!node)\n return document;\n const root = node.getRootNode ? node.getRootNode() : node.ownerDocument;\n if (root && root.host) {\n return root;\n }\n return node.ownerDocument;\n}\nfunction append_empty_stylesheet(node) {\n const style_element = element('style');\n append_stylesheet(get_root_for_style(node), style_element);\n return style_element.sheet;\n}\nfunction append_stylesheet(node, style) {\n append(node.head || node, style);\n}\nfunction append_hydration(target, node) {\n if (is_hydrating) {\n init_hydrate(target);\n if ((target.actual_end_child === undefined) || ((target.actual_end_child !== null) && (target.actual_end_child.parentElement !== target))) {\n target.actual_end_child = target.firstChild;\n }\n // Skip nodes of undefined ordering\n while ((target.actual_end_child !== null) && (target.actual_end_child.claim_order === undefined)) {\n target.actual_end_child = target.actual_end_child.nextSibling;\n }\n if (node !== target.actual_end_child) {\n // We only insert if the ordering of this node should be modified or the parent node is not target\n if (node.claim_order !== undefined || node.parentNode !== target) {\n target.insertBefore(node, target.actual_end_child);\n }\n }\n else {\n target.actual_end_child = node.nextSibling;\n }\n }\n else if (node.parentNode !== target || node.nextSibling !== null) {\n target.appendChild(node);\n }\n}\nfunction insert(target, node, anchor) {\n target.insertBefore(node, anchor || null);\n}\nfunction insert_hydration(target, node, anchor) {\n if (is_hydrating && !anchor) {\n append_hydration(target, node);\n }\n else if (node.parentNode !== target || node.nextSibling != anchor) {\n target.insertBefore(node, anchor || null);\n }\n}\nfunction detach(node) {\n node.parentNode.removeChild(node);\n}\nfunction destroy_each(iterations, detaching) {\n for (let i = 0; i < iterations.length; i += 1) {\n if (iterations[i])\n iterations[i].d(detaching);\n }\n}\nfunction element(name) {\n return document.createElement(name);\n}\nfunction element_is(name, is) {\n return document.createElement(name, { is });\n}\nfunction object_without_properties(obj, exclude) {\n const target = {};\n for (const k in obj) {\n if (has_prop(obj, k)\n // @ts-ignore\n && exclude.indexOf(k) === -1) {\n // @ts-ignore\n target[k] = obj[k];\n }\n }\n return target;\n}\nfunction svg_element(name) {\n return document.createElementNS('http://www.w3.org/2000/svg', name);\n}\nfunction text(data) {\n return document.createTextNode(data);\n}\nfunction space() {\n return text(' ');\n}\nfunction empty() {\n return text('');\n}\nfunction listen(node, event, handler, options) {\n node.addEventListener(event, handler, options);\n return () => node.removeEventListener(event, handler, options);\n}\nfunction prevent_default(fn) {\n return function (event) {\n event.preventDefault();\n // @ts-ignore\n return fn.call(this, event);\n };\n}\nfunction stop_propagation(fn) {\n return function (event) {\n event.stopPropagation();\n // @ts-ignore\n return fn.call(this, event);\n };\n}\nfunction self(fn) {\n return function (event) {\n // @ts-ignore\n if (event.target === this)\n fn.call(this, event);\n };\n}\nfunction trusted(fn) {\n return function (event) {\n // @ts-ignore\n if (event.isTrusted)\n fn.call(this, event);\n };\n}\nfunction attr(node, attribute, value) {\n if (value == null)\n node.removeAttribute(attribute);\n else if (node.getAttribute(attribute) !== value)\n node.setAttribute(attribute, value);\n}\nfunction set_attributes(node, attributes) {\n // @ts-ignore\n const descriptors = Object.getOwnPropertyDescriptors(node.__proto__);\n for (const key in attributes) {\n if (attributes[key] == null) {\n node.removeAttribute(key);\n }\n else if (key === 'style') {\n node.style.cssText = attributes[key];\n }\n else if (key === '__value') {\n node.value = node[key] = attributes[key];\n }\n else if (descriptors[key] && descriptors[key].set) {\n node[key] = attributes[key];\n }\n else {\n attr(node, key, attributes[key]);\n }\n }\n}\nfunction set_svg_attributes(node, attributes) {\n for (const key in attributes) {\n attr(node, key, attributes[key]);\n }\n}\nfunction set_custom_element_data(node, prop, value) {\n if (prop in node) {\n node[prop] = typeof node[prop] === 'boolean' && value === '' ? true : value;\n }\n else {\n attr(node, prop, value);\n }\n}\nfunction xlink_attr(node, attribute, value) {\n node.setAttributeNS('http://www.w3.org/1999/xlink', attribute, value);\n}\nfunction get_binding_group_value(group, __value, checked) {\n const value = new Set();\n for (let i = 0; i < group.length; i += 1) {\n if (group[i].checked)\n value.add(group[i].__value);\n }\n if (!checked) {\n value.delete(__value);\n }\n return Array.from(value);\n}\nfunction to_number(value) {\n return value === '' ? null : +value;\n}\nfunction time_ranges_to_array(ranges) {\n const array = [];\n for (let i = 0; i < ranges.length; i += 1) {\n array.push({ start: ranges.start(i), end: ranges.end(i) });\n }\n return array;\n}\nfunction children(element) {\n return Array.from(element.childNodes);\n}\nfunction init_claim_info(nodes) {\n if (nodes.claim_info === undefined) {\n nodes.claim_info = { last_index: 0, total_claimed: 0 };\n }\n}\nfunction claim_node(nodes, predicate, processNode, createNode, dontUpdateLastIndex = false) {\n // Try to find nodes in an order such that we lengthen the longest increasing subsequence\n init_claim_info(nodes);\n const resultNode = (() => {\n // We first try to find an element after the previous one\n for (let i = nodes.claim_info.last_index; i < nodes.length; i++) {\n const node = nodes[i];\n if (predicate(node)) {\n const replacement = processNode(node);\n if (replacement === undefined) {\n nodes.splice(i, 1);\n }\n else {\n nodes[i] = replacement;\n }\n if (!dontUpdateLastIndex) {\n nodes.claim_info.last_index = i;\n }\n return node;\n }\n }\n // Otherwise, we try to find one before\n // We iterate in reverse so that we don't go too far back\n for (let i = nodes.claim_info.last_index - 1; i >= 0; i--) {\n const node = nodes[i];\n if (predicate(node)) {\n const replacement = processNode(node);\n if (replacement === undefined) {\n nodes.splice(i, 1);\n }\n else {\n nodes[i] = replacement;\n }\n if (!dontUpdateLastIndex) {\n nodes.claim_info.last_index = i;\n }\n else if (replacement === undefined) {\n // Since we spliced before the last_index, we decrease it\n nodes.claim_info.last_index--;\n }\n return node;\n }\n }\n // If we can't find any matching node, we create a new one\n return createNode();\n })();\n resultNode.claim_order = nodes.claim_info.total_claimed;\n nodes.claim_info.total_claimed += 1;\n return resultNode;\n}\nfunction claim_element_base(nodes, name, attributes, create_element) {\n return claim_node(nodes, (node) => node.nodeName === name, (node) => {\n const remove = [];\n for (let j = 0; j < node.attributes.length; j++) {\n const attribute = node.attributes[j];\n if (!attributes[attribute.name]) {\n remove.push(attribute.name);\n }\n }\n remove.forEach(v => node.removeAttribute(v));\n return undefined;\n }, () => create_element(name));\n}\nfunction claim_element(nodes, name, attributes) {\n return claim_element_base(nodes, name, attributes, element);\n}\nfunction claim_svg_element(nodes, name, attributes) {\n return claim_element_base(nodes, name, attributes, svg_element);\n}\nfunction claim_text(nodes, data) {\n return claim_node(nodes, (node) => node.nodeType === 3, (node) => {\n const dataStr = '' + data;\n if (node.data.startsWith(dataStr)) {\n if (node.data.length !== dataStr.length) {\n return node.splitText(dataStr.length);\n }\n }\n else {\n node.data = dataStr;\n }\n }, () => text(data), true // Text nodes should not update last index since it is likely not worth it to eliminate an increasing subsequence of actual elements\n );\n}\nfunction claim_space(nodes) {\n return claim_text(nodes, ' ');\n}\nfunction find_comment(nodes, text, start) {\n for (let i = start; i < nodes.length; i += 1) {\n const node = nodes[i];\n if (node.nodeType === 8 /* comment node */ && node.textContent.trim() === text) {\n return i;\n }\n }\n return nodes.length;\n}\nfunction claim_html_tag(nodes, is_svg) {\n // find html opening tag\n const start_index = find_comment(nodes, 'HTML_TAG_START', 0);\n const end_index = find_comment(nodes, 'HTML_TAG_END', start_index);\n if (start_index === end_index) {\n return new HtmlTagHydration(undefined, is_svg);\n }\n init_claim_info(nodes);\n const html_tag_nodes = nodes.splice(start_index, end_index - start_index + 1);\n detach(html_tag_nodes[0]);\n detach(html_tag_nodes[html_tag_nodes.length - 1]);\n const claimed_nodes = html_tag_nodes.slice(1, html_tag_nodes.length - 1);\n for (const n of claimed_nodes) {\n n.claim_order = nodes.claim_info.total_claimed;\n nodes.claim_info.total_claimed += 1;\n }\n return new HtmlTagHydration(claimed_nodes, is_svg);\n}\nfunction set_data(text, data) {\n data = '' + data;\n if (text.wholeText !== data)\n text.data = data;\n}\nfunction set_input_value(input, value) {\n input.value = value == null ? '' : value;\n}\nfunction set_input_type(input, type) {\n try {\n input.type = type;\n }\n catch (e) {\n // do nothing\n }\n}\nfunction set_style(node, key, value, important) {\n if (value === null) {\n node.style.removeProperty(key);\n }\n else {\n node.style.setProperty(key, value, important ? 'important' : '');\n }\n}\nfunction select_option(select, value) {\n for (let i = 0; i < select.options.length; i += 1) {\n const option = select.options[i];\n if (option.__value === value) {\n option.selected = true;\n return;\n }\n }\n select.selectedIndex = -1; // no option should be selected\n}\nfunction select_options(select, value) {\n for (let i = 0; i < select.options.length; i += 1) {\n const option = select.options[i];\n option.selected = ~value.indexOf(option.__value);\n }\n}\nfunction select_value(select) {\n const selected_option = select.querySelector(':checked') || select.options[0];\n return selected_option && selected_option.__value;\n}\nfunction select_multiple_value(select) {\n return [].map.call(select.querySelectorAll(':checked'), option => option.__value);\n}\n// unfortunately this can't be a constant as that wouldn't be tree-shakeable\n// so we cache the result instead\nlet crossorigin;\nfunction is_crossorigin() {\n if (crossorigin === undefined) {\n crossorigin = false;\n try {\n if (typeof window !== 'undefined' && window.parent) {\n void window.parent.document;\n }\n }\n catch (error) {\n crossorigin = true;\n }\n }\n return crossorigin;\n}\nfunction add_resize_listener(node, fn) {\n const computed_style = getComputedStyle(node);\n if (computed_style.position === 'static') {\n node.style.position = 'relative';\n }\n const iframe = element('iframe');\n iframe.setAttribute('style', 'display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; ' +\n 'overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;');\n iframe.setAttribute('aria-hidden', 'true');\n iframe.tabIndex = -1;\n const crossorigin = is_crossorigin();\n let unsubscribe;\n if (crossorigin) {\n iframe.src = \"data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}</script>\";\n unsubscribe = listen(window, 'message', (event) => {\n if (event.source === iframe.contentWindow)\n fn();\n });\n }\n else {\n iframe.src = 'about:blank';\n iframe.onload = () => {\n unsubscribe = listen(iframe.contentWindow, 'resize', fn);\n };\n }\n append(node, iframe);\n return () => {\n if (crossorigin) {\n unsubscribe();\n }\n else if (unsubscribe && iframe.contentWindow) {\n unsubscribe();\n }\n detach(iframe);\n };\n}\nfunction toggle_class(element, name, toggle) {\n element.classList[toggle ? 'add' : 'remove'](name);\n}\nfunction custom_event(type, detail, { bubbles = false, cancelable = false } = {}) {\n const e = document.createEvent('CustomEvent');\n e.initCustomEvent(type, bubbles, cancelable, detail);\n return e;\n}\nfunction query_selector_all(selector, parent = document.body) {\n return Array.from(parent.querySelectorAll(selector));\n}\nclass HtmlTag {\n constructor(is_svg = false) {\n this.is_svg = false;\n this.is_svg = is_svg;\n this.e = this.n = null;\n }\n c(html) {\n this.h(html);\n }\n m(html, target, anchor = null) {\n if (!this.e) {\n if (this.is_svg)\n this.e = svg_element(target.nodeName);\n else\n this.e = element(target.nodeName);\n this.t = target;\n this.c(html);\n }\n this.i(anchor);\n }\n h(html) {\n this.e.innerHTML = html;\n this.n = Array.from(this.e.childNodes);\n }\n i(anchor) {\n for (let i = 0; i < this.n.length; i += 1) {\n insert(this.t, this.n[i], anchor);\n }\n }\n p(html) {\n this.d();\n this.h(html);\n this.i(this.a);\n }\n d() {\n this.n.forEach(detach);\n }\n}\nclass HtmlTagHydration extends HtmlTag {\n constructor(claimed_nodes, is_svg = false) {\n super(is_svg);\n this.e = this.n = null;\n this.l = claimed_nodes;\n }\n c(html) {\n if (this.l) {\n this.n = this.l;\n }\n else {\n super.c(html);\n }\n }\n i(anchor) {\n for (let i = 0; i < this.n.length; i += 1) {\n insert_hydration(this.t, this.n[i], anchor);\n }\n }\n}\nfunction attribute_to_object(attributes) {\n const result = {};\n for (const attribute of attributes) {\n result[attribute.name] = attribute.value;\n }\n return result;\n}\nfunction get_custom_elements_slots(element) {\n const result = {};\n element.childNodes.forEach((node) => {\n result[node.slot || 'default'] = true;\n });\n return result;\n}\n\n// we need to store the information for multiple documents because a Svelte application could also contain iframes\n// https://github.com/sveltejs/svelte/issues/3624\nconst managed_styles = new Map();\nlet active = 0;\n// https://github.com/darkskyapp/string-hash/blob/master/index.js\nfunction hash(str) {\n let hash = 5381;\n let i = str.length;\n while (i--)\n hash = ((hash << 5) - hash) ^ str.charCodeAt(i);\n return hash >>> 0;\n}\nfunction create_style_information(doc, node) {\n const info = { stylesheet: append_empty_stylesheet(node), rules: {} };\n managed_styles.set(doc, info);\n return info;\n}\nfunction create_rule(node, a, b, duration, delay, ease, fn, uid = 0) {\n const step = 16.666 / duration;\n let keyframes = '{\\n';\n for (let p = 0; p <= 1; p += step) {\n const t = a + (b - a) * ease(p);\n keyframes += p * 100 + `%{${fn(t, 1 - t)}}\\n`;\n }\n const rule = keyframes + `100% {${fn(b, 1 - b)}}\\n}`;\n const name = `__svelte_${hash(rule)}_${uid}`;\n const doc = get_root_for_style(node);\n const { stylesheet, rules } = managed_styles.get(doc) || create_style_information(doc, node);\n if (!rules[name]) {\n rules[name] = true;\n stylesheet.insertRule(`@keyframes ${name} ${rule}`, stylesheet.cssRules.length);\n }\n const animation = node.style.animation || '';\n node.style.animation = `${animation ? `${animation}, ` : ''}${name} ${duration}ms linear ${delay}ms 1 both`;\n active += 1;\n return name;\n}\nfunction delete_rule(node, name) {\n const previous = (node.style.animation || '').split(', ');\n const next = previous.filter(name\n ? anim => anim.indexOf(name) < 0 // remove specific animation\n : anim => anim.indexOf('__svelte') === -1 // remove all Svelte animations\n );\n const deleted = previous.length - next.length;\n if (deleted) {\n node.style.animation = next.join(', ');\n active -= deleted;\n if (!active)\n clear_rules();\n }\n}\nfunction clear_rules() {\n raf(() => {\n if (active)\n return;\n managed_styles.forEach(info => {\n const { stylesheet } = info;\n let i = stylesheet.cssRules.length;\n while (i--)\n stylesheet.deleteRule(i);\n info.rules = {};\n });\n managed_styles.clear();\n });\n}\n\nfunction create_animation(node, from, fn, params) {\n if (!from)\n return noop;\n const to = node.getBoundingClientRect();\n if (from.left === to.left && from.right === to.right && from.top === to.top && from.bottom === to.bottom)\n return noop;\n const { delay = 0, duration = 300, easing = identity, \n // @ts-ignore todo: should this be separated from destructuring? Or start/end added to public api and documentation?\n start: start_time = now() + delay, \n // @ts-ignore todo:\n end = start_time + duration, tick = noop, css } = fn(node, { from, to }, params);\n let running = true;\n let started = false;\n let name;\n function start() {\n if (css) {\n name = create_rule(node, 0, 1, duration, delay, easing, css);\n }\n if (!delay) {\n started = true;\n }\n }\n function stop() {\n if (css)\n delete_rule(node, name);\n running = false;\n }\n loop(now => {\n if (!started && now >= start_time) {\n started = true;\n }\n if (started && now >= end) {\n tick(1, 0);\n stop();\n }\n if (!running) {\n return false;\n }\n if (started) {\n const p = now - start_time;\n const t = 0 + 1 * easing(p / duration);\n tick(t, 1 - t);\n }\n return true;\n });\n start();\n tick(0, 1);\n return stop;\n}\nfunction fix_position(node) {\n const style = getComputedStyle(node);\n if (style.position !== 'absolute' && style.position !== 'fixed') {\n const { width, height } = style;\n const a = node.getBoundingClientRect();\n node.style.position = 'absolute';\n node.style.width = width;\n node.style.height = height;\n add_transform(node, a);\n }\n}\nfunction add_transform(node, a) {\n const b = node.getBoundingClientRect();\n if (a.left !== b.left || a.top !== b.top) {\n const style = getComputedStyle(node);\n const transform = style.transform === 'none' ? '' : style.transform;\n node.style.transform = `${transform} translate(${a.left - b.left}px, ${a.top - b.top}px)`;\n }\n}\n\nlet current_component;\nfunction set_current_component(component) {\n current_component = component;\n}\nfunction get_current_component() {\n if (!current_component)\n throw new Error('Function called outside component initialization');\n return current_component;\n}\nfunction beforeUpdate(fn) {\n get_current_component().$$.before_update.push(fn);\n}\nfunction onMount(fn) {\n get_current_component().$$.on_mount.push(fn);\n}\nfunction afterUpdate(fn) {\n get_current_component().$$.after_update.push(fn);\n}\nfunction onDestroy(fn) {\n get_current_component().$$.on_destroy.push(fn);\n}\nfunction createEventDispatcher() {\n const component = get_current_component();\n return (type, detail, { cancelable = false } = {}) => {\n const callbacks = component.$$.callbacks[type];\n if (callbacks) {\n // TODO are there situations where events could be dispatched\n // in a server (non-DOM) environment?\n const event = custom_event(type, detail, { cancelable });\n callbacks.slice().forEach(fn => {\n fn.call(component, event);\n });\n return !event.defaultPrevented;\n }\n return true;\n };\n}\nfunction setContext(key, context) {\n get_current_component().$$.context.set(key, context);\n return context;\n}\nfunction getContext(key) {\n return get_current_component().$$.context.get(key);\n}\nfunction getAllContexts() {\n return get_current_component().$$.context;\n}\nfunction hasContext(key) {\n return get_current_component().$$.context.has(key);\n}\n// TODO figure out if we still want to support\n// shorthand events, or if we want to implement\n// a real bubbling mechanism\nfunction bubble(component, event) {\n const callbacks = component.$$.callbacks[event.type];\n if (callbacks) {\n // @ts-ignore\n callbacks.slice().forEach(fn => fn.call(this, event));\n }\n}\n\nconst dirty_components = [];\nconst intros = { enabled: false };\nconst binding_callbacks = [];\nconst render_callbacks = [];\nconst flush_callbacks = [];\nconst resolved_promise = Promise.resolve();\nlet update_scheduled = false;\nfunction schedule_update() {\n if (!update_scheduled) {\n update_scheduled = true;\n resolved_promise.then(flush);\n }\n}\nfunction tick() {\n schedule_update();\n return resolved_promise;\n}\nfunction add_render_callback(fn) {\n render_callbacks.push(fn);\n}\nfunction add_flush_callback(fn) {\n flush_callbacks.push(fn);\n}\n// flush() calls callbacks in this order:\n// 1. All beforeUpdate callbacks, in order: parents before children\n// 2. All bind:this callbacks, in reverse order: children before parents.\n// 3. All afterUpdate callbacks, in order: parents before children. EXCEPT\n// for afterUpdates called during the initial onMount, which are called in\n// reverse order: children before parents.\n// Since callbacks might update component values, which could trigger another\n// call to flush(), the following steps guard against this:\n// 1. During beforeUpdate, any updated components will be added to the\n// dirty_components array and will cause a reentrant call to flush(). Because\n// the flush index is kept outside the function, the reentrant call will pick\n// up where the earlier call left off and go through all dirty components. The\n// current_component value is saved and restored so that the reentrant call will\n// not interfere with the \"parent\" flush() call.\n// 2. bind:this callbacks cannot trigger new flush() calls.\n// 3. During afterUpdate, any updated components will NOT have their afterUpdate\n// callback called a second time; the seen_callbacks set, outside the flush()\n// function, guarantees this behavior.\nconst seen_callbacks = new Set();\nlet flushidx = 0; // Do *not* move this inside the flush() function\nfunction flush() {\n const saved_component = current_component;\n do {\n // first, call beforeUpdate functions\n // and update components\n while (flushidx < dirty_components.length) {\n const component = dirty_components[flushidx];\n flushidx++;\n set_current_component(component);\n update(component.$$);\n }\n set_current_component(null);\n dirty_components.length = 0;\n flushidx = 0;\n while (binding_callbacks.length)\n binding_callbacks.pop()();\n // then, once components are updated, call\n // afterUpdate functions. This may cause\n // subsequent updates...\n for (let i = 0; i < render_callbacks.length; i += 1) {\n const callback = render_callbacks[i];\n if (!seen_callbacks.has(callback)) {\n // ...so guard against infinite loops\n seen_callbacks.add(callback);\n callback();\n }\n }\n render_callbacks.length = 0;\n } while (dirty_components.length);\n while (flush_callbacks.length) {\n flush_callbacks.pop()();\n }\n update_scheduled = false;\n seen_callbacks.clear();\n set_current_component(saved_component);\n}\nfunction update($$) {\n if ($$.fragment !== null) {\n $$.update();\n run_all($$.before_update);\n const dirty = $$.dirty;\n $$.dirty = [-1];\n $$.fragment && $$.fragment.p($$.ctx, dirty);\n $$.after_update.forEach(add_render_callback);\n }\n}\n\nlet promise;\nfunction wait() {\n if (!promise) {\n promise = Promise.resolve();\n promise.then(() => {\n promise = null;\n });\n }\n return promise;\n}\nfunction dispatch(node, direction, kind) {\n node.dispatchEvent(custom_event(`${direction ? 'intro' : 'outro'}${kind}`));\n}\nconst outroing = new Set();\nlet outros;\nfunction group_outros() {\n outros = {\n r: 0,\n c: [],\n p: outros // parent group\n };\n}\nfunction check_outros() {\n if (!outros.r) {\n run_all(outros.c);\n }\n outros = outros.p;\n}\nfunction transition_in(block, local) {\n if (block && block.i) {\n outroing.delete(block);\n block.i(local);\n }\n}\nfunction transition_out(block, local, detach, callback) {\n if (block && block.o) {\n if (outroing.has(block))\n return;\n outroing.add(block);\n outros.c.push(() => {\n outroing.delete(block);\n if (callback) {\n if (detach)\n block.d(1);\n callback();\n }\n });\n block.o(local);\n }\n}\nconst null_transition = { duration: 0 };\nfunction create_in_transition(node, fn, params) {\n let config = fn(node, params);\n let running = false;\n let animation_name;\n let task;\n let uid = 0;\n function cleanup() {\n if (animation_name)\n delete_rule(node, animation_name);\n }\n function go() {\n const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;\n if (css)\n animation_name = create_rule(node, 0, 1, duration, delay, easing, css, uid++);\n tick(0, 1);\n const start_time = now() + delay;\n const end_time = start_time + duration;\n if (task)\n task.abort();\n running = true;\n add_render_callback(() => dispatch(node, true, 'start'));\n task = loop(now => {\n if (running) {\n if (now >= end_time) {\n tick(1, 0);\n dispatch(node, true, 'end');\n cleanup();\n return running = false;\n }\n if (now >= start_time) {\n const t = easing((now - start_time) / duration);\n tick(t, 1 - t);\n }\n }\n return running;\n });\n }\n let started = false;\n return {\n start() {\n if (started)\n return;\n started = true;\n delete_rule(node);\n if (is_function(config)) {\n config = config();\n wait().then(go);\n }\n else {\n go();\n }\n },\n invalidate() {\n started = false;\n },\n end() {\n if (running) {\n cleanup();\n running = false;\n }\n }\n };\n}\nfunction create_out_transition(node, fn, params) {\n let config = fn(node, params);\n let running = true;\n let animation_name;\n const group = outros;\n group.r += 1;\n function go() {\n const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;\n if (css)\n animation_name = create_rule(node, 1, 0, duration, delay, easing, css);\n const start_time = now() + delay;\n const end_time = start_time + duration;\n add_render_callback(() => dispatch(node, false, 'start'));\n loop(now => {\n if (running) {\n if (now >= end_time) {\n tick(0, 1);\n dispatch(node, false, 'end');\n if (!--group.r) {\n // this will result in `end()` being called,\n // so we don't need to clean up here\n run_all(group.c);\n }\n return false;\n }\n if (now >= start_time) {\n const t = easing((now - start_time) / duration);\n tick(1 - t, t);\n }\n }\n return running;\n });\n }\n if (is_function(config)) {\n wait().then(() => {\n // @ts-ignore\n config = config();\n go();\n });\n }\n else {\n go();\n }\n return {\n end(reset) {\n if (reset && config.tick) {\n config.tick(1, 0);\n }\n if (running) {\n if (animation_name)\n delete_rule(node, animation_name);\n running = false;\n }\n }\n };\n}\nfunction create_bidirectional_transition(node, fn, params, intro) {\n let config = fn(node, params);\n let t = intro ? 0 : 1;\n let running_program = null;\n let pending_program = null;\n let animation_name = null;\n function clear_animation() {\n if (animation_name)\n delete_rule(node, animation_name);\n }\n function init(program, duration) {\n const d = (program.b - t);\n duration *= Math.abs(d);\n return {\n a: t,\n b: program.b,\n d,\n duration,\n start: program.start,\n end: program.start + duration,\n group: program.group\n };\n }\n function go(b) {\n const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;\n const program = {\n start: now() + delay,\n b\n };\n if (!b) {\n // @ts-ignore todo: improve typings\n program.group = outros;\n outros.r += 1;\n }\n if (running_program || pending_program) {\n pending_program = program;\n }\n else {\n // if this is an intro, and there's a delay, we need to do\n // an initial tick and/or apply CSS animation immediately\n if (css) {\n clear_animation();\n animation_name = create_rule(node, t, b, duration, delay, easing, css);\n }\n if (b)\n tick(0, 1);\n running_program = init(program, duration);\n add_render_callback(() => dispatch(node, b, 'start'));\n loop(now => {\n if (pending_program && now > pending_program.start) {\n running_program = init(pending_program, duration);\n pending_program = null;\n dispatch(node, running_program.b, 'start');\n if (css) {\n clear_animation();\n animation_name = create_rule(node, t, running_program.b, running_program.duration, 0, easing, config.css);\n }\n }\n if (running_program) {\n if (now >= running_program.end) {\n tick(t = running_program.b, 1 - t);\n dispatch(node, running_program.b, 'end');\n if (!pending_program) {\n // we're done\n if (running_program.b) {\n // intro — we can tidy up immediately\n clear_animation();\n }\n else {\n // outro — needs to be coordinated\n if (!--running_program.group.r)\n run_all(running_program.group.c);\n }\n }\n running_program = null;\n }\n else if (now >= running_program.start) {\n const p = now - running_program.start;\n t = running_program.a + running_program.d * easing(p / running_program.duration);\n tick(t, 1 - t);\n }\n }\n return !!(running_program || pending_program);\n });\n }\n }\n return {\n run(b) {\n if (is_function(config)) {\n wait().then(() => {\n // @ts-ignore\n config = config();\n go(b);\n });\n }\n else {\n go(b);\n }\n },\n end() {\n clear_animation();\n running_program = pending_program = null;\n }\n };\n}\n\nfunction handle_promise(promise, info) {\n const token = info.token = {};\n function update(type, index, key, value) {\n if (info.token !== token)\n return;\n info.resolved = value;\n let child_ctx = info.ctx;\n if (key !== undefined) {\n child_ctx = child_ctx.slice();\n child_ctx[key] = value;\n }\n const block = type && (info.current = type)(child_ctx);\n let needs_flush = false;\n if (info.block) {\n if (info.blocks) {\n info.blocks.forEach((block, i) => {\n if (i !== index && block) {\n group_outros();\n transition_out(block, 1, 1, () => {\n if (info.blocks[i] === block) {\n info.blocks[i] = null;\n }\n });\n check_outros();\n }\n });\n }\n else {\n info.block.d(1);\n }\n block.c();\n transition_in(block, 1);\n block.m(info.mount(), info.anchor);\n needs_flush = true;\n }\n info.block = block;\n if (info.blocks)\n info.blocks[index] = block;\n if (needs_flush) {\n flush();\n }\n }\n if (is_promise(promise)) {\n const current_component = get_current_component();\n promise.then(value => {\n set_current_component(current_component);\n update(info.then, 1, info.value, value);\n set_current_component(null);\n }, error => {\n set_current_component(current_component);\n update(info.catch, 2, info.error, error);\n set_current_component(null);\n if (!info.hasCatch) {\n throw error;\n }\n });\n // if we previously had a then/catch block, destroy it\n if (info.current !== info.pending) {\n update(info.pending, 0);\n return true;\n }\n }\n else {\n if (info.current !== info.then) {\n update(info.then, 1, info.value, promise);\n return true;\n }\n info.resolved = promise;\n }\n}\nfunction update_await_block_branch(info, ctx, dirty) {\n const child_ctx = ctx.slice();\n const { resolved } = info;\n if (info.current === info.then) {\n child_ctx[info.value] = resolved;\n }\n if (info.current === info.catch) {\n child_ctx[info.error] = resolved;\n }\n info.block.p(child_ctx, dirty);\n}\n\nconst globals = (typeof window !== 'undefined'\n ? window\n : typeof globalThis !== 'undefined'\n ? globalThis\n : global);\n\nfunction destroy_block(block, lookup) {\n block.d(1);\n lookup.delete(block.key);\n}\nfunction outro_and_destroy_block(block, lookup) {\n transition_out(block, 1, 1, () => {\n lookup.delete(block.key);\n });\n}\nfunction fix_and_destroy_block(block, lookup) {\n block.f();\n destroy_block(block, lookup);\n}\nfunction fix_and_outro_and_destroy_block(block, lookup) {\n block.f();\n outro_and_destroy_block(block, lookup);\n}\nfunction update_keyed_each(old_blocks, dirty, get_key, dynamic, ctx, list, lookup, node, destroy, create_each_block, next, get_context) {\n let o = old_blocks.length;\n let n = list.length;\n let i = o;\n const old_indexes = {};\n while (i--)\n old_indexes[old_blocks[i].key] = i;\n const new_blocks = [];\n const new_lookup = new Map();\n const deltas = new Map();\n i = n;\n while (i--) {\n const child_ctx = get_context(ctx, list, i);\n const key = get_key(child_ctx);\n let block = lookup.get(key);\n if (!block) {\n block = create_each_block(key, child_ctx);\n block.c();\n }\n else if (dynamic) {\n block.p(child_ctx, dirty);\n }\n new_lookup.set(key, new_blocks[i] = block);\n if (key in old_indexes)\n deltas.set(key, Math.abs(i - old_indexes[key]));\n }\n const will_move = new Set();\n const did_move = new Set();\n function insert(block) {\n transition_in(block, 1);\n block.m(node, next);\n lookup.set(block.key, block);\n next = block.first;\n n--;\n }\n while (o && n) {\n const new_block = new_blocks[n - 1];\n const old_block = old_blocks[o - 1];\n const new_key = new_block.key;\n const old_key = old_block.key;\n if (new_block === old_block) {\n // do nothing\n next = new_block.first;\n o--;\n n--;\n }\n else if (!new_lookup.has(old_key)) {\n // remove old block\n destroy(old_block, lookup);\n o--;\n }\n else if (!lookup.has(new_key) || will_move.has(new_key)) {\n insert(new_block);\n }\n else if (did_move.has(old_key)) {\n o--;\n }\n else if (deltas.get(new_key) > deltas.get(old_key)) {\n did_move.add(new_key);\n insert(new_block);\n }\n else {\n will_move.add(old_key);\n o--;\n }\n }\n while (o--) {\n const old_block = old_blocks[o];\n if (!new_lookup.has(old_block.key))\n destroy(old_block, lookup);\n }\n while (n)\n insert(new_blocks[n - 1]);\n return new_blocks;\n}\nfunction validate_each_keys(ctx, list, get_context, get_key) {\n const keys = new Set();\n for (let i = 0; i < list.length; i++) {\n const key = get_key(get_context(ctx, list, i));\n if (keys.has(key)) {\n throw new Error('Cannot have duplicate keys in a keyed each');\n }\n keys.add(key);\n }\n}\n\nfunction get_spread_update(levels, updates) {\n const update = {};\n const to_null_out = {};\n const accounted_for = { $$scope: 1 };\n let i = levels.length;\n while (i--) {\n const o = levels[i];\n const n = updates[i];\n if (n) {\n for (const key in o) {\n if (!(key in n))\n to_null_out[key] = 1;\n }\n for (const key in n) {\n if (!accounted_for[key]) {\n update[key] = n[key];\n accounted_for[key] = 1;\n }\n }\n levels[i] = n;\n }\n else {\n for (const key in o) {\n accounted_for[key] = 1;\n }\n }\n }\n for (const key in to_null_out) {\n if (!(key in update))\n update[key] = undefined;\n }\n return update;\n}\nfunction get_spread_object(spread_props) {\n return typeof spread_props === 'object' && spread_props !== null ? spread_props : {};\n}\n\n// source: https://html.spec.whatwg.org/multipage/indices.html\nconst boolean_attributes = new Set([\n 'allowfullscreen',\n 'allowpaymentrequest',\n 'async',\n 'autofocus',\n 'autoplay',\n 'checked',\n 'controls',\n 'default',\n 'defer',\n 'disabled',\n 'formnovalidate',\n 'hidden',\n 'ismap',\n 'loop',\n 'multiple',\n 'muted',\n 'nomodule',\n 'novalidate',\n 'open',\n 'playsinline',\n 'readonly',\n 'required',\n 'reversed',\n 'selected'\n]);\n\nconst void_element_names = /^(?:area|base|br|col|command|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)$/;\nfunction is_void(name) {\n return void_element_names.test(name) || name.toLowerCase() === '!doctype';\n}\n\nconst invalid_attribute_name_character = /[\\s'\">/=\\u{FDD0}-\\u{FDEF}\\u{FFFE}\\u{FFFF}\\u{1FFFE}\\u{1FFFF}\\u{2FFFE}\\u{2FFFF}\\u{3FFFE}\\u{3FFFF}\\u{4FFFE}\\u{4FFFF}\\u{5FFFE}\\u{5FFFF}\\u{6FFFE}\\u{6FFFF}\\u{7FFFE}\\u{7FFFF}\\u{8FFFE}\\u{8FFFF}\\u{9FFFE}\\u{9FFFF}\\u{AFFFE}\\u{AFFFF}\\u{BFFFE}\\u{BFFFF}\\u{CFFFE}\\u{CFFFF}\\u{DFFFE}\\u{DFFFF}\\u{EFFFE}\\u{EFFFF}\\u{FFFFE}\\u{FFFFF}\\u{10FFFE}\\u{10FFFF}]/u;\n// https://html.spec.whatwg.org/multipage/syntax.html#attributes-2\n// https://infra.spec.whatwg.org/#noncharacter\nfunction spread(args, attrs_to_add) {\n const attributes = Object.assign({}, ...args);\n if (attrs_to_add) {\n const classes_to_add = attrs_to_add.classes;\n const styles_to_add = attrs_to_add.styles;\n if (classes_to_add) {\n if (attributes.class == null) {\n attributes.class = classes_to_add;\n }\n else {\n attributes.class += ' ' + classes_to_add;\n }\n }\n if (styles_to_add) {\n if (attributes.style == null) {\n attributes.style = style_object_to_string(styles_to_add);\n }\n else {\n attributes.style = style_object_to_string(merge_ssr_styles(attributes.style, styles_to_add));\n }\n }\n }\n let str = '';\n Object.keys(attributes).forEach(name => {\n if (invalid_attribute_name_character.test(name))\n return;\n const value = attributes[name];\n if (value === true)\n str += ' ' + name;\n else if (boolean_attributes.has(name.toLowerCase())) {\n if (value)\n str += ' ' + name;\n }\n else if (value != null) {\n str += ` ${name}=\"${value}\"`;\n }\n });\n return str;\n}\nfunction merge_ssr_styles(style_attribute, style_directive) {\n const style_object = {};\n for (const individual_style of style_attribute.split(';')) {\n const colon_index = individual_style.indexOf(':');\n const name = individual_style.slice(0, colon_index).trim();\n const value = individual_style.slice(colon_index + 1).trim();\n if (!name)\n continue;\n style_object[name] = value;\n }\n for (const name in style_directive) {\n const value = style_directive[name];\n if (value) {\n style_object[name] = value;\n }\n else {\n delete style_object[name];\n }\n }\n return style_object;\n}\nconst escaped = {\n '\"': '&quot;',\n \"'\": '&#39;',\n '&': '&amp;',\n '<': '&lt;',\n '>': '&gt;'\n};\nfunction escape(html) {\n return String(html).replace(/[\"'&<>]/g, match => escaped[match]);\n}\nfunction escape_attribute_value(value) {\n return typeof value === 'string' ? escape(value) : value;\n}\nfunction escape_object(obj) {\n const result = {};\n for (const key in obj) {\n result[key] = escape_attribute_value(obj[key]);\n }\n return result;\n}\nfunction each(items, fn) {\n let str = '';\n for (let i = 0; i < items.length; i += 1) {\n str += fn(items[i], i);\n }\n return str;\n}\nconst missing_component = {\n $$render: () => ''\n};\nfunction validate_component(component, name) {\n if (!component || !component.$$render) {\n if (name === 'svelte:component')\n name += ' this={...}';\n throw new Error(`<${name}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules`);\n }\n return component;\n}\nfunction debug(file, line, column, values) {\n console.log(`{@debug} ${file ? file + ' ' : ''}(${line}:${column})`); // eslint-disable-line no-console\n console.log(values); // eslint-disable-line no-console\n return '';\n}\nlet on_destroy;\nfunction create_ssr_component(fn) {\n function $$render(result, props, bindings, slots, context) {\n const parent_component = current_component;\n const $$ = {\n on_destroy,\n context: new Map(context || (parent_component ? parent_component.$$.context : [])),\n // these will be immediately discarded\n on_mount: [],\n before_update: [],\n after_update: [],\n callbacks: blank_object()\n };\n set_current_component({ $$ });\n const html = fn(result, props, bindings, slots);\n set_current_component(parent_component);\n return html;\n }\n return {\n render: (props = {}, { $$slots = {}, context = new Map() } = {}) => {\n on_destroy = [];\n const result = { title: '', head: '', css: new Set() };\n const html = $$render(result, props, {}, $$slots, context);\n run_all(on_destroy);\n return {\n html,\n css: {\n code: Array.from(result.css).map(css => css.code).join('\\n'),\n map: null // TODO\n },\n head: result.title + result.head\n };\n },\n $$render\n };\n}\nfunction add_attribute(name, value, boolean) {\n if (value == null || (boolean && !value))\n return '';\n const assignment = (boolean && value === true) ? '' : `=\"${escape_attribute_value(value.toString())}\"`;\n return ` ${name}${assignment}`;\n}\nfunction add_classes(classes) {\n return classes ? ` class=\"${classes}\"` : '';\n}\nfunction style_object_to_string(style_object) {\n return Object.keys(style_object)\n .filter(key => style_object[key])\n .map(key => `${key}: ${style_object[key]};`)\n .join(' ');\n}\nfunction add_styles(style_object) {\n const styles = style_object_to_string(style_object);\n return styles ? ` style=\"${styles}\"` : '';\n}\n\nfunction bind(component, name, callback) {\n const index = component.$$.props[name];\n if (index !== undefined) {\n component.$$.bound[index] = callback;\n callback(component.$$.ctx[index]);\n }\n}\nfunction create_component(block) {\n block && block.c();\n}\nfunction claim_component(block, parent_nodes) {\n block && block.l(parent_nodes);\n}\nfunction mount_component(component, target, anchor, customElement) {\n const { fragment, on_mount, on_destroy, after_update } = component.$$;\n fragment && fragment.m(target, anchor);\n if (!customElement) {\n // onMount happens before the initial afterUpdate\n add_render_callback(() => {\n const new_on_destroy = on_mount.map(run).filter(is_function);\n if (on_destroy) {\n on_destroy.push(...new_on_destroy);\n }\n else {\n // Edge case - component was destroyed immediately,\n // most likely as a result of a binding initialising\n run_all(new_on_destroy);\n }\n component.$$.on_mount = [];\n });\n }\n after_update.forEach(add_render_callback);\n}\nfunction destroy_component(component, detaching) {\n const $$ = component.$$;\n if ($$.fragment !== null) {\n run_all($$.on_destroy);\n $$.fragment && $$.fragment.d(detaching);\n // TODO null out other refs, including component.$$ (but need to\n // preserve final state?)\n $$.on_destroy = $$.fragment = null;\n $$.ctx = [];\n }\n}\nfunction make_dirty(component, i) {\n if (component.$$.dirty[0] === -1) {\n dirty_components.push(component);\n schedule_update();\n component.$$.dirty.fill(0);\n }\n component.$$.dirty[(i / 31) | 0] |= (1 << (i % 31));\n}\nfunction init(component, options, instance, create_fragment, not_equal, props, append_styles, dirty = [-1]) {\n const parent_component = current_component;\n set_current_component(component);\n const $$ = component.$$ = {\n fragment: null,\n ctx: null,\n // state\n props,\n update: noop,\n not_equal,\n bound: blank_object(),\n // lifecycle\n on_mount: [],\n on_destroy: [],\n on_disconnect: [],\n before_update: [],\n after_update: [],\n context: new Map(options.context || (parent_component ? parent_component.$$.context : [])),\n // everything else\n callbacks: blank_object(),\n dirty,\n skip_bound: false,\n root: options.target || parent_component.$$.root\n };\n append_styles && append_styles($$.root);\n let ready = false;\n $$.ctx = instance\n ? instance(component, options.props || {}, (i, ret, ...rest) => {\n const value = rest.length ? rest[0] : ret;\n if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {\n if (!$$.skip_bound && $$.bound[i])\n $$.bound[i](value);\n if (ready)\n make_dirty(component, i);\n }\n return ret;\n })\n : [];\n $$.update();\n ready = true;\n run_all($$.before_update);\n // `false` as a special case of no DOM component\n $$.fragment = create_fragment ? create_fragment($$.ctx) : false;\n if (options.target) {\n if (options.hydrate) {\n start_hydrating();\n const nodes = children(options.target);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n $$.fragment && $$.fragment.l(nodes);\n nodes.forEach(detach);\n }\n else {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n $$.fragment && $$.fragment.c();\n }\n if (options.intro)\n transition_in(component.$$.fragment);\n mount_component(component, options.target, options.anchor, options.customElement);\n end_hydrating();\n flush();\n }\n set_current_component(parent_component);\n}\nlet SvelteElement;\nif (typeof HTMLElement === 'function') {\n SvelteElement = class extends HTMLElement {\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n }\n connectedCallback() {\n const { on_mount } = this.$$;\n this.$$.on_disconnect = on_mount.map(run).filter(is_function);\n // @ts-ignore todo: improve typings\n for (const key in this.$$.slotted) {\n // @ts-ignore todo: improve typings\n this.appendChild(this.$$.slotted[key]);\n }\n }\n attributeChangedCallback(attr, _oldValue, newValue) {\n this[attr] = newValue;\n }\n disconnectedCallback() {\n run_all(this.$$.on_disconnect);\n }\n $destroy() {\n destroy_component(this, 1);\n this.$destroy = noop;\n }\n $on(type, callback) {\n // TODO should this delegate to addEventListener?\n const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));\n callbacks.push(callback);\n return () => {\n const index = callbacks.indexOf(callback);\n if (index !== -1)\n callbacks.splice(index, 1);\n };\n }\n $set($$props) {\n if (this.$$set && !is_empty($$props)) {\n this.$$.skip_bound = true;\n this.$$set($$props);\n this.$$.skip_bound = false;\n }\n }\n };\n}\n/**\n * Base class for Svelte components. Used when dev=false.\n */\nclass SvelteComponent {\n $destroy() {\n destroy_component(this, 1);\n this.$destroy = noop;\n }\n $on(type, callback) {\n const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));\n callbacks.push(callback);\n return () => {\n const index = callbacks.indexOf(callback);\n if (index !== -1)\n callbacks.splice(index, 1);\n };\n }\n $set($$props) {\n if (this.$$set && !is_empty($$props)) {\n this.$$.skip_bound = true;\n this.$$set($$props);\n this.$$.skip_bound = false;\n }\n }\n}\n\nfunction dispatch_dev(type, detail) {\n document.dispatchEvent(custom_event(type, Object.assign({ version: '3.48.0' }, detail), { bubbles: true }));\n}\nfunction append_dev(target, node) {\n dispatch_dev('SvelteDOMInsert', { target, node });\n append(target, node);\n}\nfunction append_hydration_dev(target, node) {\n dispatch_dev('SvelteDOMInsert', { target, node });\n append_hydration(target, node);\n}\nfunction insert_dev(target, node, anchor) {\n dispatch_dev('SvelteDOMInsert', { target, node, anchor });\n insert(target, node, anchor);\n}\nfunction insert_hydration_dev(target, node, anchor) {\n dispatch_dev('SvelteDOMInsert', { target, node, anchor });\n insert_hydration(target, node, anchor);\n}\nfunction detach_dev(node) {\n dispatch_dev('SvelteDOMRemove', { node });\n detach(node);\n}\nfunction detach_between_dev(before, after) {\n while (before.nextSibling && before.nextSibling !== after) {\n detach_dev(before.nextSibling);\n }\n}\nfunction detach_before_dev(after) {\n while (after.previousSibling) {\n detach_dev(after.previousSibling);\n }\n}\nfunction detach_after_dev(before) {\n while (before.nextSibling) {\n detach_dev(before.nextSibling);\n }\n}\nfunction listen_dev(node, event, handler, options, has_prevent_default, has_stop_propagation) {\n const modifiers = options === true ? ['capture'] : options ? Array.from(Object.keys(options)) : [];\n if (has_prevent_default)\n modifiers.push('preventDefault');\n if (has_stop_propagation)\n modifiers.push('stopPropagation');\n dispatch_dev('SvelteDOMAddEventListener', { node, event, handler, modifiers });\n const dispose = listen(node, event, handler, options);\n return () => {\n dispatch_dev('SvelteDOMRemoveEventListener', { node, event, handler, modifiers });\n dispose();\n };\n}\nfunction attr_dev(node, attribute, value) {\n attr(node, attribute, value);\n if (value == null)\n dispatch_dev('SvelteDOMRemoveAttribute', { node, attribute });\n else\n dispatch_dev('SvelteDOMSetAttribute', { node, attribute, value });\n}\nfunction prop_dev(node, property, value) {\n node[property] = value;\n dispatch_dev('SvelteDOMSetProperty', { node, property, value });\n}\nfunction dataset_dev(node, property, value) {\n node.dataset[property] = value;\n dispatch_dev('SvelteDOMSetDataset', { node, property, value });\n}\nfunction set_data_dev(text, data) {\n data = '' + data;\n if (text.wholeText === data)\n return;\n dispatch_dev('SvelteDOMSetData', { node: text, data });\n text.data = data;\n}\nfunction validate_each_argument(arg) {\n if (typeof arg !== 'string' && !(arg && typeof arg === 'object' && 'length' in arg)) {\n let msg = '{#each} only iterates over array-like objects.';\n if (typeof Symbol === 'function' && arg && Symbol.iterator in arg) {\n msg += ' You can use a spread to convert this iterable into an array.';\n }\n throw new Error(msg);\n }\n}\nfunction validate_slots(name, slot, keys) {\n for (const slot_key of Object.keys(slot)) {\n if (!~keys.indexOf(slot_key)) {\n console.warn(`<${name}> received an unexpected slot \"${slot_key}\".`);\n }\n }\n}\nfunction validate_dynamic_element(tag) {\n const is_string = typeof tag === 'string';\n if (tag && !is_string) {\n throw new Error('<svelte:element> expects \"this\" attribute to be a string.');\n }\n}\nfunction validate_void_dynamic_element(tag) {\n if (tag && is_void(tag)) {\n throw new Error(`<svelte:element this=\"${tag}\"> is self-closing and cannot have content.`);\n }\n}\n/**\n * Base class for Svelte components with some minor dev-enhancements. Used when dev=true.\n */\nclass SvelteComponentDev extends SvelteComponent {\n constructor(options) {\n if (!options || (!options.target && !options.$$inline)) {\n throw new Error(\"'target' is a required option\");\n }\n super();\n }\n $destroy() {\n super.$destroy();\n this.$destroy = () => {\n console.warn('Component was already destroyed'); // eslint-disable-line no-console\n };\n }\n $capture_state() { }\n $inject_state() { }\n}\n/**\n * Base class to create strongly typed Svelte components.\n * This only exists for typing purposes and should be used in `.d.ts` files.\n *\n * ### Example:\n *\n * You have component library on npm called `component-library`, from which\n * you export a component called `MyComponent`. For Svelte+TypeScript users,\n * you want to provide typings. Therefore you create a `index.d.ts`:\n * ```ts\n * import { SvelteComponentTyped } from \"svelte\";\n * export class MyComponent extends SvelteComponentTyped<{foo: string}> {}\n * ```\n * Typing this makes it possible for IDEs like VS Code with the Svelte extension\n * to provide intellisense and to use the component like this in a Svelte file\n * with TypeScript:\n * ```svelte\n * <script lang=\"ts\">\n * \timport { MyComponent } from \"component-library\";\n * </script>\n * <MyComponent foo={'bar'} />\n * ```\n *\n * #### Why not make this part of `SvelteComponent(Dev)`?\n * Because\n * ```ts\n * class ASubclassOfSvelteComponent extends SvelteComponent<{foo: string}> {}\n * const component: typeof SvelteComponent = ASubclassOfSvelteComponent;\n * ```\n * will throw a type error, so we need to separate the more strictly typed class.\n */\nclass SvelteComponentTyped extends SvelteComponentDev {\n constructor(options) {\n super(options);\n }\n}\nfunction loop_guard(timeout) {\n const start = Date.now();\n return () => {\n if (Date.now() - start > timeout) {\n throw new Error('Infinite loop detected');\n }\n };\n}\n\nexport { HtmlTag, HtmlTagHydration, SvelteComponent, SvelteComponentDev, SvelteComponentTyped, SvelteElement, action_destroyer, add_attribute, add_classes, add_flush_callback, add_location, add_render_callback, add_resize_listener, add_styles, add_transform, afterUpdate, append, append_dev, append_empty_stylesheet, append_hydration, append_hydration_dev, append_styles, assign, attr, attr_dev, attribute_to_object, beforeUpdate, bind, binding_callbacks, blank_object, bubble, check_outros, children, claim_component, claim_element, claim_html_tag, claim_space, claim_svg_element, claim_text, clear_loops, component_subscribe, compute_rest_props, compute_slots, createEventDispatcher, create_animation, create_bidirectional_transition, create_component, create_in_transition, create_out_transition, create_slot, create_ssr_component, current_component, custom_event, dataset_dev, debug, destroy_block, destroy_component, destroy_each, detach, detach_after_dev, detach_before_dev, detach_between_dev, detach_dev, dirty_components, dispatch_dev, each, element, element_is, empty, end_hydrating, escape, escape_attribute_value, escape_object, escaped, exclude_internal_props, fix_and_destroy_block, fix_and_outro_and_destroy_block, fix_position, flush, getAllContexts, getContext, get_all_dirty_from_scope, get_binding_group_value, get_current_component, get_custom_elements_slots, get_root_for_style, get_slot_changes, get_spread_object, get_spread_update, get_store_value, globals, group_outros, handle_promise, hasContext, has_prop, identity, init, insert, insert_dev, insert_hydration, insert_hydration_dev, intros, invalid_attribute_name_character, is_client, is_crossorigin, is_empty, is_function, is_promise, is_void, listen, listen_dev, loop, loop_guard, merge_ssr_styles, missing_component, mount_component, noop, not_equal, now, null_to_empty, object_without_properties, onDestroy, onMount, once, outro_and_destroy_block, prevent_default, prop_dev, query_selector_all, raf, run, run_all, safe_not_equal, schedule_update, select_multiple_value, select_option, select_options, select_value, self, setContext, set_attributes, set_current_component, set_custom_element_data, set_data, set_data_dev, set_input_type, set_input_value, set_now, set_raf, set_store_value, set_style, set_svg_attributes, space, spread, src_url_equal, start_hydrating, stop_propagation, subscribe, svg_element, text, tick, time_ranges_to_array, to_number, toggle_class, transition_in, transition_out, trusted, update_await_block_branch, update_keyed_each, update_slot, update_slot_base, validate_component, validate_dynamic_element, validate_each_argument, validate_each_keys, validate_slots, validate_store, validate_void_dynamic_element, xlink_attr };\n","var global =\n (typeof globalThis !== 'undefined' && globalThis) ||\n (typeof self !== 'undefined' && self) ||\n (typeof global !== 'undefined' && global)\n\nvar support = {\n searchParams: 'URLSearchParams' in global,\n iterable: 'Symbol' in global && 'iterator' in Symbol,\n blob:\n 'FileReader' in global &&\n 'Blob' in global &&\n (function() {\n try {\n new Blob()\n return true\n } catch (e) {\n return false\n }\n })(),\n formData: 'FormData' in global,\n arrayBuffer: 'ArrayBuffer' in global\n}\n\nfunction isDataView(obj) {\n return obj && DataView.prototype.isPrototypeOf(obj)\n}\n\nif (support.arrayBuffer) {\n var viewClasses = [\n '[object Int8Array]',\n '[object Uint8Array]',\n '[object Uint8ClampedArray]',\n '[object Int16Array]',\n '[object Uint16Array]',\n '[object Int32Array]',\n '[object Uint32Array]',\n '[object Float32Array]',\n '[object Float64Array]'\n ]\n\n var isArrayBufferView =\n ArrayBuffer.isView ||\n function(obj) {\n return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1\n }\n}\n\nfunction normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.^_`|~!]/i.test(name) || name === '') {\n throw new TypeError('Invalid character in header field name: \"' + name + '\"')\n }\n return name.toLowerCase()\n}\n\nfunction normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n}\n\n// Build a destructive iterator for the value list\nfunction iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n}\n\nexport function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n } else if (Array.isArray(headers)) {\n headers.forEach(function(header) {\n this.append(header[0], header[1])\n }, this)\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n}\n\nHeaders.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var oldValue = this.map[name]\n this.map[name] = oldValue ? oldValue + ', ' + value : value\n}\n\nHeaders.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n}\n\nHeaders.prototype.get = function(name) {\n name = normalizeName(name)\n return this.has(name) ? this.map[name] : null\n}\n\nHeaders.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n}\n\nHeaders.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = normalizeValue(value)\n}\n\nHeaders.prototype.forEach = function(callback, thisArg) {\n for (var name in this.map) {\n if (this.map.hasOwnProperty(name)) {\n callback.call(thisArg, this.map[name], name, this)\n }\n }\n}\n\nHeaders.prototype.keys = function() {\n var items = []\n this.forEach(function(value, name) {\n items.push(name)\n })\n return iteratorFor(items)\n}\n\nHeaders.prototype.values = function() {\n var items = []\n this.forEach(function(value) {\n items.push(value)\n })\n return iteratorFor(items)\n}\n\nHeaders.prototype.entries = function() {\n var items = []\n this.forEach(function(value, name) {\n items.push([name, value])\n })\n return iteratorFor(items)\n}\n\nif (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries\n}\n\nfunction consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n}\n\nfunction fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n}\n\nfunction readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n var promise = fileReaderReady(reader)\n reader.readAsArrayBuffer(blob)\n return promise\n}\n\nfunction readBlobAsText(blob) {\n var reader = new FileReader()\n var promise = fileReaderReady(reader)\n reader.readAsText(blob)\n return promise\n}\n\nfunction readArrayBufferAsText(buf) {\n var view = new Uint8Array(buf)\n var chars = new Array(view.length)\n\n for (var i = 0; i < view.length; i++) {\n chars[i] = String.fromCharCode(view[i])\n }\n return chars.join('')\n}\n\nfunction bufferClone(buf) {\n if (buf.slice) {\n return buf.slice(0)\n } else {\n var view = new Uint8Array(buf.byteLength)\n view.set(new Uint8Array(buf))\n return view.buffer\n }\n}\n\nfunction Body() {\n this.bodyUsed = false\n\n this._initBody = function(body) {\n /*\n fetch-mock wraps the Response object in an ES6 Proxy to\n provide useful test harness features such as flush. However, on\n ES5 browsers without fetch or Proxy support pollyfills must be used;\n the proxy-pollyfill is unable to proxy an attribute unless it exists\n on the object before the Proxy is created. This change ensures\n Response.bodyUsed exists on the instance, while maintaining the\n semantic of setting Request.bodyUsed in the constructor before\n _initBody is called.\n */\n this.bodyUsed = this.bodyUsed\n this._bodyInit = body\n if (!body) {\n this._bodyText = ''\n } else if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString()\n } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n this._bodyArrayBuffer = bufferClone(body.buffer)\n // IE 10-11 can't handle a DataView body.\n this._bodyInit = new Blob([this._bodyArrayBuffer])\n } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n this._bodyArrayBuffer = bufferClone(body)\n } else {\n this._bodyText = body = Object.prototype.toString.call(body)\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(new Blob([this._bodyArrayBuffer]))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n if (this._bodyArrayBuffer) {\n var isConsumed = consumed(this)\n if (isConsumed) {\n return isConsumed\n }\n if (ArrayBuffer.isView(this._bodyArrayBuffer)) {\n return Promise.resolve(\n this._bodyArrayBuffer.buffer.slice(\n this._bodyArrayBuffer.byteOffset,\n this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength\n )\n )\n } else {\n return Promise.resolve(this._bodyArrayBuffer)\n }\n } else {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n }\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n}\n\n// HTTP methods whose capitalization should be normalized\nvar methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\nfunction normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return methods.indexOf(upcased) > -1 ? upcased : method\n}\n\nexport function Request(input, options) {\n if (!(this instanceof Request)) {\n throw new TypeError('Please use the \"new\" operator, this DOM object constructor cannot be called as a function.')\n }\n\n options = options || {}\n var body = options.body\n\n if (input instanceof Request) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n this.signal = input.signal\n if (!body && input._bodyInit != null) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = String(input)\n }\n\n this.credentials = options.credentials || this.credentials || 'same-origin'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.signal = options.signal || this.signal\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n\n if (this.method === 'GET' || this.method === 'HEAD') {\n if (options.cache === 'no-store' || options.cache === 'no-cache') {\n // Search for a '_' parameter in the query string\n var reParamSearch = /([?&])_=[^&]*/\n if (reParamSearch.test(this.url)) {\n // If it already exists then set the value with the current time\n this.url = this.url.replace(reParamSearch, '$1_=' + new Date().getTime())\n } else {\n // Otherwise add a new '_' parameter to the end with the current time\n var reQueryString = /\\?/\n this.url += (reQueryString.test(this.url) ? '&' : '?') + '_=' + new Date().getTime()\n }\n }\n }\n}\n\nRequest.prototype.clone = function() {\n return new Request(this, {body: this._bodyInit})\n}\n\nfunction decode(body) {\n var form = new FormData()\n body\n .trim()\n .split('&')\n .forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n}\n\nfunction parseHeaders(rawHeaders) {\n var headers = new Headers()\n // Replace instances of \\r\\n and \\n followed by at least one space or horizontal tab with a space\n // https://tools.ietf.org/html/rfc7230#section-3.2\n var preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, ' ')\n // Avoiding split via regex to work around a common IE11 bug with the core-js 3.6.0 regex polyfill\n // https://github.com/github/fetch/issues/748\n // https://github.com/zloirock/core-js/issues/751\n preProcessedHeaders\n .split('\\r')\n .map(function(header) {\n return header.indexOf('\\n') === 0 ? header.substr(1, header.length) : header\n })\n .forEach(function(line) {\n var parts = line.split(':')\n var key = parts.shift().trim()\n if (key) {\n var value = parts.join(':').trim()\n headers.append(key, value)\n }\n })\n return headers\n}\n\nBody.call(Request.prototype)\n\nexport function Response(bodyInit, options) {\n if (!(this instanceof Response)) {\n throw new TypeError('Please use the \"new\" operator, this DOM object constructor cannot be called as a function.')\n }\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status === undefined ? 200 : options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = options.statusText === undefined ? '' : '' + options.statusText\n this.headers = new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n}\n\nBody.call(Response.prototype)\n\nResponse.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n}\n\nResponse.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n}\n\nvar redirectStatuses = [301, 302, 303, 307, 308]\n\nResponse.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n}\n\nexport var DOMException = global.DOMException\ntry {\n new DOMException()\n} catch (err) {\n DOMException = function(message, name) {\n this.message = message\n this.name = name\n var error = Error(message)\n this.stack = error.stack\n }\n DOMException.prototype = Object.create(Error.prototype)\n DOMException.prototype.constructor = DOMException\n}\n\nexport function fetch(input, init) {\n return new Promise(function(resolve, reject) {\n var request = new Request(input, init)\n\n if (request.signal && request.signal.aborted) {\n return reject(new DOMException('Aborted', 'AbortError'))\n }\n\n var xhr = new XMLHttpRequest()\n\n function abortXhr() {\n xhr.abort()\n }\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders() || '')\n }\n options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL')\n var body = 'response' in xhr ? xhr.response : xhr.responseText\n setTimeout(function() {\n resolve(new Response(body, options))\n }, 0)\n }\n\n xhr.onerror = function() {\n setTimeout(function() {\n reject(new TypeError('Network request failed'))\n }, 0)\n }\n\n xhr.ontimeout = function() {\n setTimeout(function() {\n reject(new TypeError('Network request failed'))\n }, 0)\n }\n\n xhr.onabort = function() {\n setTimeout(function() {\n reject(new DOMException('Aborted', 'AbortError'))\n }, 0)\n }\n\n function fixUrl(url) {\n try {\n return url === '' && global.location.href ? global.location.href : url\n } catch (e) {\n return url\n }\n }\n\n xhr.open(request.method, fixUrl(request.url), true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n } else if (request.credentials === 'omit') {\n xhr.withCredentials = false\n }\n\n if ('responseType' in xhr) {\n if (support.blob) {\n xhr.responseType = 'blob'\n } else if (\n support.arrayBuffer &&\n request.headers.get('Content-Type') &&\n request.headers.get('Content-Type').indexOf('application/octet-stream') !== -1\n ) {\n xhr.responseType = 'arraybuffer'\n }\n }\n\n if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers)) {\n Object.getOwnPropertyNames(init.headers).forEach(function(name) {\n xhr.setRequestHeader(name, normalizeValue(init.headers[name]))\n })\n } else {\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n }\n\n if (request.signal) {\n request.signal.addEventListener('abort', abortXhr)\n\n xhr.onreadystatechange = function() {\n // DONE (success or failure)\n if (xhr.readyState === 4) {\n request.signal.removeEventListener('abort', abortXhr)\n }\n }\n }\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n}\n\nfetch.polyfill = true\n\nif (!global.fetch) {\n global.fetch = fetch\n global.Headers = Headers\n global.Request = Request\n global.Response = Response\n}\n","// the whatwg-fetch polyfill installs the fetch() function\n// on the global object (window or self)\n//\n// Return that as the export for use in Webpack, Browserify etc.\nrequire('whatwg-fetch');\nmodule.exports = self.fetch.bind(self);\n","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\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 function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\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) : adopt(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 var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") 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 throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\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\n/** @deprecated */\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\n/** @deprecated */\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 __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\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\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\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 (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, 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\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n","export function isFunction(value) {\n return typeof value === 'function';\n}\n//# sourceMappingURL=isFunction.js.map","export function createErrorClass(createImpl) {\n var _super = function (instance) {\n Error.call(instance);\n instance.stack = new Error().stack;\n };\n var ctorFunc = createImpl(_super);\n ctorFunc.prototype = Object.create(Error.prototype);\n ctorFunc.prototype.constructor = ctorFunc;\n return ctorFunc;\n}\n//# sourceMappingURL=createErrorClass.js.map","import { createErrorClass } from './createErrorClass';\nexport var UnsubscriptionError = createErrorClass(function (_super) {\n return function UnsubscriptionErrorImpl(errors) {\n _super(this);\n this.message = errors\n ? errors.length + \" errors occurred during unsubscription:\\n\" + errors.map(function (err, i) { return i + 1 + \") \" + err.toString(); }).join('\\n ')\n : '';\n this.name = 'UnsubscriptionError';\n this.errors = errors;\n };\n});\n//# sourceMappingURL=UnsubscriptionError.js.map","export function arrRemove(arr, item) {\n if (arr) {\n var index = arr.indexOf(item);\n 0 <= index && arr.splice(index, 1);\n }\n}\n//# sourceMappingURL=arrRemove.js.map","import { __read, __spreadArray, __values } from \"tslib\";\nimport { isFunction } from './util/isFunction';\nimport { UnsubscriptionError } from './util/UnsubscriptionError';\nimport { arrRemove } from './util/arrRemove';\nvar Subscription = (function () {\n function Subscription(initialTeardown) {\n this.initialTeardown = initialTeardown;\n this.closed = false;\n this._parentage = null;\n this._finalizers = null;\n }\n Subscription.prototype.unsubscribe = function () {\n var e_1, _a, e_2, _b;\n var errors;\n if (!this.closed) {\n this.closed = true;\n var _parentage = this._parentage;\n if (_parentage) {\n this._parentage = null;\n if (Array.isArray(_parentage)) {\n try {\n for (var _parentage_1 = __values(_parentage), _parentage_1_1 = _parentage_1.next(); !_parentage_1_1.done; _parentage_1_1 = _parentage_1.next()) {\n var parent_1 = _parentage_1_1.value;\n parent_1.remove(this);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_parentage_1_1 && !_parentage_1_1.done && (_a = _parentage_1.return)) _a.call(_parentage_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n }\n else {\n _parentage.remove(this);\n }\n }\n var initialFinalizer = this.initialTeardown;\n if (isFunction(initialFinalizer)) {\n try {\n initialFinalizer();\n }\n catch (e) {\n errors = e instanceof UnsubscriptionError ? e.errors : [e];\n }\n }\n var _finalizers = this._finalizers;\n if (_finalizers) {\n this._finalizers = null;\n try {\n for (var _finalizers_1 = __values(_finalizers), _finalizers_1_1 = _finalizers_1.next(); !_finalizers_1_1.done; _finalizers_1_1 = _finalizers_1.next()) {\n var finalizer = _finalizers_1_1.value;\n try {\n execFinalizer(finalizer);\n }\n catch (err) {\n errors = errors !== null && errors !== void 0 ? errors : [];\n if (err instanceof UnsubscriptionError) {\n errors = __spreadArray(__spreadArray([], __read(errors)), __read(err.errors));\n }\n else {\n errors.push(err);\n }\n }\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_finalizers_1_1 && !_finalizers_1_1.done && (_b = _finalizers_1.return)) _b.call(_finalizers_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n }\n if (errors) {\n throw new UnsubscriptionError(errors);\n }\n }\n };\n Subscription.prototype.add = function (teardown) {\n var _a;\n if (teardown && teardown !== this) {\n if (this.closed) {\n execFinalizer(teardown);\n }\n else {\n if (teardown instanceof Subscription) {\n if (teardown.closed || teardown._hasParent(this)) {\n return;\n }\n teardown._addParent(this);\n }\n (this._finalizers = (_a = this._finalizers) !== null && _a !== void 0 ? _a : []).push(teardown);\n }\n }\n };\n Subscription.prototype._hasParent = function (parent) {\n var _parentage = this._parentage;\n return _parentage === parent || (Array.isArray(_parentage) && _parentage.includes(parent));\n };\n Subscription.prototype._addParent = function (parent) {\n var _parentage = this._parentage;\n this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;\n };\n Subscription.prototype._removeParent = function (parent) {\n var _parentage = this._parentage;\n if (_parentage === parent) {\n this._parentage = null;\n }\n else if (Array.isArray(_parentage)) {\n arrRemove(_parentage, parent);\n }\n };\n Subscription.prototype.remove = function (teardown) {\n var _finalizers = this._finalizers;\n _finalizers && arrRemove(_finalizers, teardown);\n if (teardown instanceof Subscription) {\n teardown._removeParent(this);\n }\n };\n Subscription.EMPTY = (function () {\n var empty = new Subscription();\n empty.closed = true;\n return empty;\n })();\n return Subscription;\n}());\nexport { Subscription };\nexport var EMPTY_SUBSCRIPTION = Subscription.EMPTY;\nexport function isSubscription(value) {\n return (value instanceof Subscription ||\n (value && 'closed' in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe)));\n}\nfunction execFinalizer(finalizer) {\n if (isFunction(finalizer)) {\n finalizer();\n }\n else {\n finalizer.unsubscribe();\n }\n}\n//# sourceMappingURL=Subscription.js.map","export var config = {\n onUnhandledError: null,\n onStoppedNotification: null,\n Promise: undefined,\n useDeprecatedSynchronousErrorHandling: false,\n useDeprecatedNextContext: false,\n};\n//# sourceMappingURL=config.js.map","import { __read, __spreadArray } from \"tslib\";\nexport var timeoutProvider = {\n setTimeout: function (handler, timeout) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n var delegate = timeoutProvider.delegate;\n if (delegate === null || delegate === void 0 ? void 0 : delegate.setTimeout) {\n return delegate.setTimeout.apply(delegate, __spreadArray([handler, timeout], __read(args)));\n }\n return setTimeout.apply(void 0, __spreadArray([handler, timeout], __read(args)));\n },\n clearTimeout: function (handle) {\n var delegate = timeoutProvider.delegate;\n return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearTimeout) || clearTimeout)(handle);\n },\n delegate: undefined,\n};\n//# sourceMappingURL=timeoutProvider.js.map","export function noop() { }\n//# sourceMappingURL=noop.js.map","import { config } from '../config';\nvar context = null;\nexport function errorContext(cb) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n var isRoot = !context;\n if (isRoot) {\n context = { errorThrown: false, error: null };\n }\n cb();\n if (isRoot) {\n var _a = context, errorThrown = _a.errorThrown, error = _a.error;\n context = null;\n if (errorThrown) {\n throw error;\n }\n }\n }\n else {\n cb();\n }\n}\nexport function captureError(err) {\n if (config.useDeprecatedSynchronousErrorHandling && context) {\n context.errorThrown = true;\n context.error = err;\n }\n}\n//# sourceMappingURL=errorContext.js.map","import { __extends } from \"tslib\";\nimport { isFunction } from './util/isFunction';\nimport { isSubscription, Subscription } from './Subscription';\nimport { config } from './config';\nimport { reportUnhandledError } from './util/reportUnhandledError';\nimport { noop } from './util/noop';\nimport { nextNotification, errorNotification, COMPLETE_NOTIFICATION } from './NotificationFactories';\nimport { timeoutProvider } from './scheduler/timeoutProvider';\nimport { captureError } from './util/errorContext';\nvar Subscriber = (function (_super) {\n __extends(Subscriber, _super);\n function Subscriber(destination) {\n var _this = _super.call(this) || this;\n _this.isStopped = false;\n if (destination) {\n _this.destination = destination;\n if (isSubscription(destination)) {\n destination.add(_this);\n }\n }\n else {\n _this.destination = EMPTY_OBSERVER;\n }\n return _this;\n }\n Subscriber.create = function (next, error, complete) {\n return new SafeSubscriber(next, error, complete);\n };\n Subscriber.prototype.next = function (value) {\n if (this.isStopped) {\n handleStoppedNotification(nextNotification(value), this);\n }\n else {\n this._next(value);\n }\n };\n Subscriber.prototype.error = function (err) {\n if (this.isStopped) {\n handleStoppedNotification(errorNotification(err), this);\n }\n else {\n this.isStopped = true;\n this._error(err);\n }\n };\n Subscriber.prototype.complete = function () {\n if (this.isStopped) {\n handleStoppedNotification(COMPLETE_NOTIFICATION, this);\n }\n else {\n this.isStopped = true;\n this._complete();\n }\n };\n Subscriber.prototype.unsubscribe = function () {\n if (!this.closed) {\n this.isStopped = true;\n _super.prototype.unsubscribe.call(this);\n this.destination = null;\n }\n };\n Subscriber.prototype._next = function (value) {\n this.destination.next(value);\n };\n Subscriber.prototype._error = function (err) {\n try {\n this.destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n };\n Subscriber.prototype._complete = function () {\n try {\n this.destination.complete();\n }\n finally {\n this.unsubscribe();\n }\n };\n return Subscriber;\n}(Subscription));\nexport { Subscriber };\nvar _bind = Function.prototype.bind;\nfunction bind(fn, thisArg) {\n return _bind.call(fn, thisArg);\n}\nvar ConsumerObserver = (function () {\n function ConsumerObserver(partialObserver) {\n this.partialObserver = partialObserver;\n }\n ConsumerObserver.prototype.next = function (value) {\n var partialObserver = this.partialObserver;\n if (partialObserver.next) {\n try {\n partialObserver.next(value);\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n };\n ConsumerObserver.prototype.error = function (err) {\n var partialObserver = this.partialObserver;\n if (partialObserver.error) {\n try {\n partialObserver.error(err);\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n else {\n handleUnhandledError(err);\n }\n };\n ConsumerObserver.prototype.complete = function () {\n var partialObserver = this.partialObserver;\n if (partialObserver.complete) {\n try {\n partialObserver.complete();\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n };\n return ConsumerObserver;\n}());\nvar SafeSubscriber = (function (_super) {\n __extends(SafeSubscriber, _super);\n function SafeSubscriber(observerOrNext, error, complete) {\n var _this = _super.call(this) || this;\n var partialObserver;\n if (isFunction(observerOrNext) || !observerOrNext) {\n partialObserver = {\n next: observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : undefined,\n error: error !== null && error !== void 0 ? error : undefined,\n complete: complete !== null && complete !== void 0 ? complete : undefined,\n };\n }\n else {\n var context_1;\n if (_this && config.useDeprecatedNextContext) {\n context_1 = Object.create(observerOrNext);\n context_1.unsubscribe = function () { return _this.unsubscribe(); };\n partialObserver = {\n next: observerOrNext.next && bind(observerOrNext.next, context_1),\n error: observerOrNext.error && bind(observerOrNext.error, context_1),\n complete: observerOrNext.complete && bind(observerOrNext.complete, context_1),\n };\n }\n else {\n partialObserver = observerOrNext;\n }\n }\n _this.destination = new ConsumerObserver(partialObserver);\n return _this;\n }\n return SafeSubscriber;\n}(Subscriber));\nexport { SafeSubscriber };\nfunction handleUnhandledError(error) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n captureError(error);\n }\n else {\n reportUnhandledError(error);\n }\n}\nfunction defaultErrorHandler(err) {\n throw err;\n}\nfunction handleStoppedNotification(notification, subscriber) {\n var onStoppedNotification = config.onStoppedNotification;\n onStoppedNotification && timeoutProvider.setTimeout(function () { return onStoppedNotification(notification, subscriber); });\n}\nexport var EMPTY_OBSERVER = {\n closed: true,\n next: noop,\n error: defaultErrorHandler,\n complete: noop,\n};\n//# sourceMappingURL=Subscriber.js.map","import { config } from '../config';\nimport { timeoutProvider } from '../scheduler/timeoutProvider';\nexport function reportUnhandledError(err) {\n timeoutProvider.setTimeout(function () {\n var onUnhandledError = config.onUnhandledError;\n if (onUnhandledError) {\n onUnhandledError(err);\n }\n else {\n throw err;\n }\n });\n}\n//# sourceMappingURL=reportUnhandledError.js.map","export var observable = (function () { return (typeof Symbol === 'function' && Symbol.observable) || '@@observable'; })();\n//# sourceMappingURL=observable.js.map","export function identity(x) {\n return x;\n}\n//# sourceMappingURL=identity.js.map","import { SafeSubscriber, Subscriber } from './Subscriber';\nimport { isSubscription } from './Subscription';\nimport { observable as Symbol_observable } from './symbol/observable';\nimport { pipeFromArray } from './util/pipe';\nimport { config } from './config';\nimport { isFunction } from './util/isFunction';\nimport { errorContext } from './util/errorContext';\nvar Observable = (function () {\n function Observable(subscribe) {\n if (subscribe) {\n this._subscribe = subscribe;\n }\n }\n Observable.prototype.lift = function (operator) {\n var observable = new Observable();\n observable.source = this;\n observable.operator = operator;\n return observable;\n };\n Observable.prototype.subscribe = function (observerOrNext, error, complete) {\n var _this = this;\n var subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error, complete);\n errorContext(function () {\n var _a = _this, operator = _a.operator, source = _a.source;\n subscriber.add(operator\n ?\n operator.call(subscriber, source)\n : source\n ?\n _this._subscribe(subscriber)\n :\n _this._trySubscribe(subscriber));\n });\n return subscriber;\n };\n Observable.prototype._trySubscribe = function (sink) {\n try {\n return this._subscribe(sink);\n }\n catch (err) {\n sink.error(err);\n }\n };\n Observable.prototype.forEach = function (next, promiseCtor) {\n var _this = this;\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor(function (resolve, reject) {\n var subscriber = new SafeSubscriber({\n next: function (value) {\n try {\n next(value);\n }\n catch (err) {\n reject(err);\n subscriber.unsubscribe();\n }\n },\n error: reject,\n complete: resolve,\n });\n _this.subscribe(subscriber);\n });\n };\n Observable.prototype._subscribe = function (subscriber) {\n var _a;\n return (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber);\n };\n Observable.prototype[Symbol_observable] = function () {\n return this;\n };\n Observable.prototype.pipe = function () {\n var operations = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n operations[_i] = arguments[_i];\n }\n return pipeFromArray(operations)(this);\n };\n Observable.prototype.toPromise = function (promiseCtor) {\n var _this = this;\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor(function (resolve, reject) {\n var value;\n _this.subscribe(function (x) { return (value = x); }, function (err) { return reject(err); }, function () { return resolve(value); });\n });\n };\n Observable.create = function (subscribe) {\n return new Observable(subscribe);\n };\n return Observable;\n}());\nexport { Observable };\nfunction getPromiseCtor(promiseCtor) {\n var _a;\n return (_a = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : config.Promise) !== null && _a !== void 0 ? _a : Promise;\n}\nfunction isObserver(value) {\n return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);\n}\nfunction isSubscriber(value) {\n return (value && value instanceof Subscriber) || (isObserver(value) && isSubscription(value));\n}\n//# sourceMappingURL=Observable.js.map","import { identity } from './identity';\nexport function pipe() {\n var fns = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n fns[_i] = arguments[_i];\n }\n return pipeFromArray(fns);\n}\nexport function pipeFromArray(fns) {\n if (fns.length === 0) {\n return identity;\n }\n if (fns.length === 1) {\n return fns[0];\n }\n return function piped(input) {\n return fns.reduce(function (prev, fn) { return fn(prev); }, input);\n };\n}\n//# sourceMappingURL=pipe.js.map","import { createErrorClass } from './createErrorClass';\nexport var ObjectUnsubscribedError = createErrorClass(function (_super) {\n return function ObjectUnsubscribedErrorImpl() {\n _super(this);\n this.name = 'ObjectUnsubscribedError';\n this.message = 'object unsubscribed';\n };\n});\n//# sourceMappingURL=ObjectUnsubscribedError.js.map","import { __extends } from \"tslib\";\nimport { Subject } from './Subject';\nimport { dateTimestampProvider } from './scheduler/dateTimestampProvider';\nvar ReplaySubject = (function (_super) {\n __extends(ReplaySubject, _super);\n function ReplaySubject(_bufferSize, _windowTime, _timestampProvider) {\n if (_bufferSize === void 0) { _bufferSize = Infinity; }\n if (_windowTime === void 0) { _windowTime = Infinity; }\n if (_timestampProvider === void 0) { _timestampProvider = dateTimestampProvider; }\n var _this = _super.call(this) || this;\n _this._bufferSize = _bufferSize;\n _this._windowTime = _windowTime;\n _this._timestampProvider = _timestampProvider;\n _this._buffer = [];\n _this._infiniteTimeWindow = true;\n _this._infiniteTimeWindow = _windowTime === Infinity;\n _this._bufferSize = Math.max(1, _bufferSize);\n _this._windowTime = Math.max(1, _windowTime);\n return _this;\n }\n ReplaySubject.prototype.next = function (value) {\n var _a = this, isStopped = _a.isStopped, _buffer = _a._buffer, _infiniteTimeWindow = _a._infiniteTimeWindow, _timestampProvider = _a._timestampProvider, _windowTime = _a._windowTime;\n if (!isStopped) {\n _buffer.push(value);\n !_infiniteTimeWindow && _buffer.push(_timestampProvider.now() + _windowTime);\n }\n this._trimBuffer();\n _super.prototype.next.call(this, value);\n };\n ReplaySubject.prototype._subscribe = function (subscriber) {\n this._throwIfClosed();\n this._trimBuffer();\n var subscription = this._innerSubscribe(subscriber);\n var _a = this, _infiniteTimeWindow = _a._infiniteTimeWindow, _buffer = _a._buffer;\n var copy = _buffer.slice();\n for (var i = 0; i < copy.length && !subscriber.closed; i += _infiniteTimeWindow ? 1 : 2) {\n subscriber.next(copy[i]);\n }\n this._checkFinalizedStatuses(subscriber);\n return subscription;\n };\n ReplaySubject.prototype._trimBuffer = function () {\n var _a = this, _bufferSize = _a._bufferSize, _timestampProvider = _a._timestampProvider, _buffer = _a._buffer, _infiniteTimeWindow = _a._infiniteTimeWindow;\n var adjustedBufferSize = (_infiniteTimeWindow ? 1 : 2) * _bufferSize;\n _bufferSize < Infinity && adjustedBufferSize < _buffer.length && _buffer.splice(0, _buffer.length - adjustedBufferSize);\n if (!_infiniteTimeWindow) {\n var now = _timestampProvider.now();\n var last = 0;\n for (var i = 1; i < _buffer.length && _buffer[i] <= now; i += 2) {\n last = i;\n }\n last && _buffer.splice(0, last + 1);\n }\n };\n return ReplaySubject;\n}(Subject));\nexport { ReplaySubject };\n//# sourceMappingURL=ReplaySubject.js.map","import { __extends, __values } from \"tslib\";\nimport { Observable } from './Observable';\nimport { Subscription, EMPTY_SUBSCRIPTION } from './Subscription';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\nimport { arrRemove } from './util/arrRemove';\nimport { errorContext } from './util/errorContext';\nvar Subject = (function (_super) {\n __extends(Subject, _super);\n function Subject() {\n var _this = _super.call(this) || this;\n _this.closed = false;\n _this.currentObservers = null;\n _this.observers = [];\n _this.isStopped = false;\n _this.hasError = false;\n _this.thrownError = null;\n return _this;\n }\n Subject.prototype.lift = function (operator) {\n var subject = new AnonymousSubject(this, this);\n subject.operator = operator;\n return subject;\n };\n Subject.prototype._throwIfClosed = function () {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n };\n Subject.prototype.next = function (value) {\n var _this = this;\n errorContext(function () {\n var e_1, _a;\n _this._throwIfClosed();\n if (!_this.isStopped) {\n if (!_this.currentObservers) {\n _this.currentObservers = Array.from(_this.observers);\n }\n try {\n for (var _b = __values(_this.currentObservers), _c = _b.next(); !_c.done; _c = _b.next()) {\n var observer = _c.value;\n observer.next(value);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n }\n });\n };\n Subject.prototype.error = function (err) {\n var _this = this;\n errorContext(function () {\n _this._throwIfClosed();\n if (!_this.isStopped) {\n _this.hasError = _this.isStopped = true;\n _this.thrownError = err;\n var observers = _this.observers;\n while (observers.length) {\n observers.shift().error(err);\n }\n }\n });\n };\n Subject.prototype.complete = function () {\n var _this = this;\n errorContext(function () {\n _this._throwIfClosed();\n if (!_this.isStopped) {\n _this.isStopped = true;\n var observers = _this.observers;\n while (observers.length) {\n observers.shift().complete();\n }\n }\n });\n };\n Subject.prototype.unsubscribe = function () {\n this.isStopped = this.closed = true;\n this.observers = this.currentObservers = null;\n };\n Object.defineProperty(Subject.prototype, \"observed\", {\n get: function () {\n var _a;\n return ((_a = this.observers) === null || _a === void 0 ? void 0 : _a.length) > 0;\n },\n enumerable: false,\n configurable: true\n });\n Subject.prototype._trySubscribe = function (subscriber) {\n this._throwIfClosed();\n return _super.prototype._trySubscribe.call(this, subscriber);\n };\n Subject.prototype._subscribe = function (subscriber) {\n this._throwIfClosed();\n this._checkFinalizedStatuses(subscriber);\n return this._innerSubscribe(subscriber);\n };\n Subject.prototype._innerSubscribe = function (subscriber) {\n var _this = this;\n var _a = this, hasError = _a.hasError, isStopped = _a.isStopped, observers = _a.observers;\n if (hasError || isStopped) {\n return EMPTY_SUBSCRIPTION;\n }\n this.currentObservers = null;\n observers.push(subscriber);\n return new Subscription(function () {\n _this.currentObservers = null;\n arrRemove(observers, subscriber);\n });\n };\n Subject.prototype._checkFinalizedStatuses = function (subscriber) {\n var _a = this, hasError = _a.hasError, thrownError = _a.thrownError, isStopped = _a.isStopped;\n if (hasError) {\n subscriber.error(thrownError);\n }\n else if (isStopped) {\n subscriber.complete();\n }\n };\n Subject.prototype.asObservable = function () {\n var observable = new Observable();\n observable.source = this;\n return observable;\n };\n Subject.create = function (destination, source) {\n return new AnonymousSubject(destination, source);\n };\n return Subject;\n}(Observable));\nexport { Subject };\nvar AnonymousSubject = (function (_super) {\n __extends(AnonymousSubject, _super);\n function AnonymousSubject(destination, source) {\n var _this = _super.call(this) || this;\n _this.destination = destination;\n _this.source = source;\n return _this;\n }\n AnonymousSubject.prototype.next = function (value) {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.next) === null || _b === void 0 ? void 0 : _b.call(_a, value);\n };\n AnonymousSubject.prototype.error = function (err) {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.call(_a, err);\n };\n AnonymousSubject.prototype.complete = function () {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.complete) === null || _b === void 0 ? void 0 : _b.call(_a);\n };\n AnonymousSubject.prototype._subscribe = function (subscriber) {\n var _a, _b;\n return (_b = (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber)) !== null && _b !== void 0 ? _b : EMPTY_SUBSCRIPTION;\n };\n return AnonymousSubject;\n}(Subject));\nexport { AnonymousSubject };\n//# sourceMappingURL=Subject.js.map","export var dateTimestampProvider = {\n now: function () {\n return (dateTimestampProvider.delegate || Date).now();\n },\n delegate: undefined,\n};\n//# sourceMappingURL=dateTimestampProvider.js.map","import { ReplaySubject } from 'rxjs';\n\nlet topics = [];\nlet subjects = {};\n\n/**\n * @name topic\n * @description A small wrapper over the rxjs to offer the topic method on top of it\n * @param event [String] Event name\n * @param step [String] How many values to be buffed for new subscribers - default 0\n * @returns ReplaySubject\n */\n\nconst topic = (event, step = 0) => {\n if (topics.indexOf(event) == -1) {\n let replaySubject = new ReplaySubject(step);\n\n subjects[event] = replaySubject;\n\n topics.push(event);\n }\n\n return subjects[event];\n}\n\nconst usePostMessageForTopics = (events = [], target) => {\n for (let index in events) {\n subjects[events[index]].subscribe((data) => {\n window.postMessage({ type: events[index], data });\n });\n }\n}\n\nexport { topic }\n","import { noop, safe_not_equal, subscribe, run_all, is_function } from '../internal/index.mjs';\nexport { get_store_value as get } from '../internal/index.mjs';\n\nconst subscriber_queue = [];\n/**\n * Creates a `Readable` store that allows reading by subscription.\n * @param value initial value\n * @param {StartStopNotifier}start start and stop notifications for subscriptions\n */\nfunction readable(value, start) {\n return {\n subscribe: writable(value, start).subscribe\n };\n}\n/**\n * Create a `Writable` store that allows both updating and reading by subscription.\n * @param {*=}value initial value\n * @param {StartStopNotifier=}start start and stop notifications for subscriptions\n */\nfunction writable(value, start = noop) {\n let stop;\n const subscribers = new Set();\n function set(new_value) {\n if (safe_not_equal(value, new_value)) {\n value = new_value;\n if (stop) { // store is ready\n const run_queue = !subscriber_queue.length;\n for (const subscriber of subscribers) {\n subscriber[1]();\n subscriber_queue.push(subscriber, value);\n }\n if (run_queue) {\n for (let i = 0; i < subscriber_queue.length; i += 2) {\n subscriber_queue[i][0](subscriber_queue[i + 1]);\n }\n subscriber_queue.length = 0;\n }\n }\n }\n }\n function update(fn) {\n set(fn(value));\n }\n function subscribe(run, invalidate = noop) {\n const subscriber = [run, invalidate];\n subscribers.add(subscriber);\n if (subscribers.size === 1) {\n stop = start(set) || noop;\n }\n run(value);\n return () => {\n subscribers.delete(subscriber);\n if (subscribers.size === 0) {\n stop();\n stop = null;\n }\n };\n }\n return { set, update, subscribe };\n}\nfunction derived(stores, fn, initial_value) {\n const single = !Array.isArray(stores);\n const stores_array = single\n ? [stores]\n : stores;\n const auto = fn.length < 2;\n return readable(initial_value, (set) => {\n let inited = false;\n const values = [];\n let pending = 0;\n let cleanup = noop;\n const sync = () => {\n if (pending) {\n return;\n }\n cleanup();\n const result = fn(single ? values[0] : values, set);\n if (auto) {\n set(result);\n }\n else {\n cleanup = is_function(result) ? result : noop;\n }\n };\n const unsubscribers = stores_array.map((store, i) => subscribe(store, (value) => {\n values[i] = value;\n pending &= ~(1 << i);\n if (inited) {\n sync();\n }\n }, () => {\n pending |= (1 << i);\n }));\n inited = true;\n sync();\n return function stop() {\n run_all(unsubscribers);\n cleanup();\n };\n });\n}\n\nexport { derived, readable, writable };\n","'use strict';\n\nvar isMergeableObject = function isMergeableObject(value) {\n\treturn isNonNullObject(value)\n\t\t&& !isSpecial(value)\n};\n\nfunction isNonNullObject(value) {\n\treturn !!value && typeof value === 'object'\n}\n\nfunction isSpecial(value) {\n\tvar stringValue = Object.prototype.toString.call(value);\n\n\treturn stringValue === '[object RegExp]'\n\t\t|| stringValue === '[object Date]'\n\t\t|| isReactElement(value)\n}\n\n// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25\nvar canUseSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;\n\nfunction isReactElement(value) {\n\treturn value.$$typeof === REACT_ELEMENT_TYPE\n}\n\nfunction emptyTarget(val) {\n\treturn Array.isArray(val) ? [] : {}\n}\n\nfunction cloneUnlessOtherwiseSpecified(value, options) {\n\treturn (options.clone !== false && options.isMergeableObject(value))\n\t\t? deepmerge(emptyTarget(value), value, options)\n\t\t: value\n}\n\nfunction defaultArrayMerge(target, source, options) {\n\treturn target.concat(source).map(function(element) {\n\t\treturn cloneUnlessOtherwiseSpecified(element, options)\n\t})\n}\n\nfunction getMergeFunction(key, options) {\n\tif (!options.customMerge) {\n\t\treturn deepmerge\n\t}\n\tvar customMerge = options.customMerge(key);\n\treturn typeof customMerge === 'function' ? customMerge : deepmerge\n}\n\nfunction getEnumerableOwnPropertySymbols(target) {\n\treturn Object.getOwnPropertySymbols\n\t\t? Object.getOwnPropertySymbols(target).filter(function(symbol) {\n\t\t\treturn target.propertyIsEnumerable(symbol)\n\t\t})\n\t\t: []\n}\n\nfunction getKeys(target) {\n\treturn Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))\n}\n\nfunction propertyIsOnObject(object, property) {\n\ttry {\n\t\treturn property in object\n\t} catch(_) {\n\t\treturn false\n\t}\n}\n\n// Protects from prototype poisoning and unexpected merging up the prototype chain.\nfunction propertyIsUnsafe(target, key) {\n\treturn propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,\n\t\t&& !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,\n\t\t\t&& Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.\n}\n\nfunction mergeObject(target, source, options) {\n\tvar destination = {};\n\tif (options.isMergeableObject(target)) {\n\t\tgetKeys(target).forEach(function(key) {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(target[key], options);\n\t\t});\n\t}\n\tgetKeys(source).forEach(function(key) {\n\t\tif (propertyIsUnsafe(target, key)) {\n\t\t\treturn\n\t\t}\n\n\t\tif (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {\n\t\t\tdestination[key] = getMergeFunction(key, options)(target[key], source[key], options);\n\t\t} else {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(source[key], options);\n\t\t}\n\t});\n\treturn destination\n}\n\nfunction deepmerge(target, source, options) {\n\toptions = options || {};\n\toptions.arrayMerge = options.arrayMerge || defaultArrayMerge;\n\toptions.isMergeableObject = options.isMergeableObject || isMergeableObject;\n\t// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()\n\t// implementations can use it. The caller may not replace it.\n\toptions.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;\n\n\tvar sourceIsArray = Array.isArray(source);\n\tvar targetIsArray = Array.isArray(target);\n\tvar sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;\n\n\tif (!sourceAndTargetTypesMatch) {\n\t\treturn cloneUnlessOtherwiseSpecified(source, options)\n\t} else if (sourceIsArray) {\n\t\treturn options.arrayMerge(target, source, options)\n\t} else {\n\t\treturn mergeObject(target, source, options)\n\t}\n}\n\ndeepmerge.all = function deepmergeAll(array, options) {\n\tif (!Array.isArray(array)) {\n\t\tthrow new Error('first argument should be an array')\n\t}\n\n\treturn array.reduce(function(prev, next) {\n\t\treturn deepmerge(prev, next, options)\n\t}, {})\n};\n\nvar deepmerge_1 = deepmerge;\n\nmodule.exports = deepmerge_1;\n","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\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 function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\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) : adopt(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 var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") 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 throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\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\n/** @deprecated */\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\n/** @deprecated */\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 __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\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\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\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 (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, 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\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n","export var ErrorKind;\n(function (ErrorKind) {\n /** Argument is unclosed (e.g. `{0`) */\n ErrorKind[ErrorKind[\"EXPECT_ARGUMENT_CLOSING_BRACE\"] = 1] = \"EXPECT_ARGUMENT_CLOSING_BRACE\";\n /** Argument is empty (e.g. `{}`). */\n ErrorKind[ErrorKind[\"EMPTY_ARGUMENT\"] = 2] = \"EMPTY_ARGUMENT\";\n /** Argument is malformed (e.g. `{foo!}``) */\n ErrorKind[ErrorKind[\"MALFORMED_ARGUMENT\"] = 3] = \"MALFORMED_ARGUMENT\";\n /** Expect an argument type (e.g. `{foo,}`) */\n ErrorKind[ErrorKind[\"EXPECT_ARGUMENT_TYPE\"] = 4] = \"EXPECT_ARGUMENT_TYPE\";\n /** Unsupported argument type (e.g. `{foo,foo}`) */\n ErrorKind[ErrorKind[\"INVALID_ARGUMENT_TYPE\"] = 5] = \"INVALID_ARGUMENT_TYPE\";\n /** Expect an argument style (e.g. `{foo, number, }`) */\n ErrorKind[ErrorKind[\"EXPECT_ARGUMENT_STYLE\"] = 6] = \"EXPECT_ARGUMENT_STYLE\";\n /** The number skeleton is invalid. */\n ErrorKind[ErrorKind[\"INVALID_NUMBER_SKELETON\"] = 7] = \"INVALID_NUMBER_SKELETON\";\n /** The date time skeleton is invalid. */\n ErrorKind[ErrorKind[\"INVALID_DATE_TIME_SKELETON\"] = 8] = \"INVALID_DATE_TIME_SKELETON\";\n /** Exepct a number skeleton following the `::` (e.g. `{foo, number, ::}`) */\n ErrorKind[ErrorKind[\"EXPECT_NUMBER_SKELETON\"] = 9] = \"EXPECT_NUMBER_SKELETON\";\n /** Exepct a date time skeleton following the `::` (e.g. `{foo, date, ::}`) */\n ErrorKind[ErrorKind[\"EXPECT_DATE_TIME_SKELETON\"] = 10] = \"EXPECT_DATE_TIME_SKELETON\";\n /** Unmatched apostrophes in the argument style (e.g. `{foo, number, 'test`) */\n ErrorKind[ErrorKind[\"UNCLOSED_QUOTE_IN_ARGUMENT_STYLE\"] = 11] = \"UNCLOSED_QUOTE_IN_ARGUMENT_STYLE\";\n /** Missing select argument options (e.g. `{foo, select}`) */\n ErrorKind[ErrorKind[\"EXPECT_SELECT_ARGUMENT_OPTIONS\"] = 12] = \"EXPECT_SELECT_ARGUMENT_OPTIONS\";\n /** Expecting an offset value in `plural` or `selectordinal` argument (e.g `{foo, plural, offset}`) */\n ErrorKind[ErrorKind[\"EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE\"] = 13] = \"EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE\";\n /** Offset value in `plural` or `selectordinal` is invalid (e.g. `{foo, plural, offset: x}`) */\n ErrorKind[ErrorKind[\"INVALID_PLURAL_ARGUMENT_OFFSET_VALUE\"] = 14] = \"INVALID_PLURAL_ARGUMENT_OFFSET_VALUE\";\n /** Expecting a selector in `select` argument (e.g `{foo, select}`) */\n ErrorKind[ErrorKind[\"EXPECT_SELECT_ARGUMENT_SELECTOR\"] = 15] = \"EXPECT_SELECT_ARGUMENT_SELECTOR\";\n /** Expecting a selector in `plural` or `selectordinal` argument (e.g `{foo, plural}`) */\n ErrorKind[ErrorKind[\"EXPECT_PLURAL_ARGUMENT_SELECTOR\"] = 16] = \"EXPECT_PLURAL_ARGUMENT_SELECTOR\";\n /** Expecting a message fragment after the `select` selector (e.g. `{foo, select, apple}`) */\n ErrorKind[ErrorKind[\"EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\"] = 17] = \"EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\";\n /**\n * Expecting a message fragment after the `plural` or `selectordinal` selector\n * (e.g. `{foo, plural, one}`)\n */\n ErrorKind[ErrorKind[\"EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT\"] = 18] = \"EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT\";\n /** Selector in `plural` or `selectordinal` is malformed (e.g. `{foo, plural, =x {#}}`) */\n ErrorKind[ErrorKind[\"INVALID_PLURAL_ARGUMENT_SELECTOR\"] = 19] = \"INVALID_PLURAL_ARGUMENT_SELECTOR\";\n /**\n * Duplicate selectors in `plural` or `selectordinal` argument.\n * (e.g. {foo, plural, one {#} one {#}})\n */\n ErrorKind[ErrorKind[\"DUPLICATE_PLURAL_ARGUMENT_SELECTOR\"] = 20] = \"DUPLICATE_PLURAL_ARGUMENT_SELECTOR\";\n /** Duplicate selectors in `select` argument.\n * (e.g. {foo, select, apple {apple} apple {apple}})\n */\n ErrorKind[ErrorKind[\"DUPLICATE_SELECT_ARGUMENT_SELECTOR\"] = 21] = \"DUPLICATE_SELECT_ARGUMENT_SELECTOR\";\n /** Plural or select argument option must have `other` clause. */\n ErrorKind[ErrorKind[\"MISSING_OTHER_CLAUSE\"] = 22] = \"MISSING_OTHER_CLAUSE\";\n /** The tag is malformed. (e.g. `<bold!>foo</bold!>) */\n ErrorKind[ErrorKind[\"INVALID_TAG\"] = 23] = \"INVALID_TAG\";\n /** The tag name is invalid. (e.g. `<123>foo</123>`) */\n ErrorKind[ErrorKind[\"INVALID_TAG_NAME\"] = 25] = \"INVALID_TAG_NAME\";\n /** The closing tag does not match the opening tag. (e.g. `<bold>foo</italic>`) */\n ErrorKind[ErrorKind[\"UNMATCHED_CLOSING_TAG\"] = 26] = \"UNMATCHED_CLOSING_TAG\";\n /** The opening tag has unmatched closing tag. (e.g. `<bold>foo`) */\n ErrorKind[ErrorKind[\"UNCLOSED_TAG\"] = 27] = \"UNCLOSED_TAG\";\n})(ErrorKind || (ErrorKind = {}));\n","export var TYPE;\n(function (TYPE) {\n /**\n * Raw text\n */\n TYPE[TYPE[\"literal\"] = 0] = \"literal\";\n /**\n * Variable w/o any format, e.g `var` in `this is a {var}`\n */\n TYPE[TYPE[\"argument\"] = 1] = \"argument\";\n /**\n * Variable w/ number format\n */\n TYPE[TYPE[\"number\"] = 2] = \"number\";\n /**\n * Variable w/ date format\n */\n TYPE[TYPE[\"date\"] = 3] = \"date\";\n /**\n * Variable w/ time format\n */\n TYPE[TYPE[\"time\"] = 4] = \"time\";\n /**\n * Variable w/ select format\n */\n TYPE[TYPE[\"select\"] = 5] = \"select\";\n /**\n * Variable w/ plural format\n */\n TYPE[TYPE[\"plural\"] = 6] = \"plural\";\n /**\n * Only possible within plural argument.\n * This is the `#` symbol that will be substituted with the count.\n */\n TYPE[TYPE[\"pound\"] = 7] = \"pound\";\n /**\n * XML-like tag\n */\n TYPE[TYPE[\"tag\"] = 8] = \"tag\";\n})(TYPE || (TYPE = {}));\nexport var SKELETON_TYPE;\n(function (SKELETON_TYPE) {\n SKELETON_TYPE[SKELETON_TYPE[\"number\"] = 0] = \"number\";\n SKELETON_TYPE[SKELETON_TYPE[\"dateTime\"] = 1] = \"dateTime\";\n})(SKELETON_TYPE || (SKELETON_TYPE = {}));\n/**\n * Type Guards\n */\nexport function isLiteralElement(el) {\n return el.type === TYPE.literal;\n}\nexport function isArgumentElement(el) {\n return el.type === TYPE.argument;\n}\nexport function isNumberElement(el) {\n return el.type === TYPE.number;\n}\nexport function isDateElement(el) {\n return el.type === TYPE.date;\n}\nexport function isTimeElement(el) {\n return el.type === TYPE.time;\n}\nexport function isSelectElement(el) {\n return el.type === TYPE.select;\n}\nexport function isPluralElement(el) {\n return el.type === TYPE.plural;\n}\nexport function isPoundElement(el) {\n return el.type === TYPE.pound;\n}\nexport function isTagElement(el) {\n return el.type === TYPE.tag;\n}\nexport function isNumberSkeleton(el) {\n return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.number);\n}\nexport function isDateTimeSkeleton(el) {\n return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.dateTime);\n}\nexport function createLiteralElement(value) {\n return {\n type: TYPE.literal,\n value: value,\n };\n}\nexport function createNumberElement(value, style) {\n return {\n type: TYPE.number,\n value: value,\n style: style,\n };\n}\n","// @generated from regex-gen.ts\nexport var SPACE_SEPARATOR_REGEX = /[ \\xA0\\u1680\\u2000-\\u200A\\u202F\\u205F\\u3000]/;\nexport var WHITE_SPACE_REGEX = /[\\t-\\r \\x85\\u200E\\u200F\\u2028\\u2029]/;\n","/**\n * https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * Credit: https://github.com/caridy/intl-datetimeformat-pattern/blob/master/index.js\n * with some tweaks\n */\nvar DATE_TIME_REGEX = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;\n/**\n * Parse Date time skeleton into Intl.DateTimeFormatOptions\n * Ref: https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * @public\n * @param skeleton skeleton string\n */\nexport function parseDateTimeSkeleton(skeleton) {\n var result = {};\n skeleton.replace(DATE_TIME_REGEX, function (match) {\n var len = match.length;\n switch (match[0]) {\n // Era\n case 'G':\n result.era = len === 4 ? 'long' : len === 5 ? 'narrow' : 'short';\n break;\n // Year\n case 'y':\n result.year = len === 2 ? '2-digit' : 'numeric';\n break;\n case 'Y':\n case 'u':\n case 'U':\n case 'r':\n throw new RangeError('`Y/u/U/r` (year) patterns are not supported, use `y` instead');\n // Quarter\n case 'q':\n case 'Q':\n throw new RangeError('`q/Q` (quarter) patterns are not supported');\n // Month\n case 'M':\n case 'L':\n result.month = ['numeric', '2-digit', 'short', 'long', 'narrow'][len - 1];\n break;\n // Week\n case 'w':\n case 'W':\n throw new RangeError('`w/W` (week) patterns are not supported');\n case 'd':\n result.day = ['numeric', '2-digit'][len - 1];\n break;\n case 'D':\n case 'F':\n case 'g':\n throw new RangeError('`D/F/g` (day) patterns are not supported, use `d` instead');\n // Weekday\n case 'E':\n result.weekday = len === 4 ? 'short' : len === 5 ? 'narrow' : 'short';\n break;\n case 'e':\n if (len < 4) {\n throw new RangeError('`e..eee` (weekday) patterns are not supported');\n }\n result.weekday = ['short', 'long', 'narrow', 'short'][len - 4];\n break;\n case 'c':\n if (len < 4) {\n throw new RangeError('`c..ccc` (weekday) patterns are not supported');\n }\n result.weekday = ['short', 'long', 'narrow', 'short'][len - 4];\n break;\n // Period\n case 'a': // AM, PM\n result.hour12 = true;\n break;\n case 'b': // am, pm, noon, midnight\n case 'B': // flexible day periods\n throw new RangeError('`b/B` (period) patterns are not supported, use `a` instead');\n // Hour\n case 'h':\n result.hourCycle = 'h12';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'H':\n result.hourCycle = 'h23';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'K':\n result.hourCycle = 'h11';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'k':\n result.hourCycle = 'h24';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'j':\n case 'J':\n case 'C':\n throw new RangeError('`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead');\n // Minute\n case 'm':\n result.minute = ['numeric', '2-digit'][len - 1];\n break;\n // Second\n case 's':\n result.second = ['numeric', '2-digit'][len - 1];\n break;\n case 'S':\n case 'A':\n throw new RangeError('`S/A` (second) patterns are not supported, use `s` instead');\n // Zone\n case 'z': // 1..3, 4: specific non-location format\n result.timeZoneName = len < 4 ? 'short' : 'long';\n break;\n case 'Z': // 1..3, 4, 5: The ISO8601 varios formats\n case 'O': // 1, 4: miliseconds in day short, long\n case 'v': // 1, 4: generic non-location format\n case 'V': // 1, 2, 3, 4: time zone ID or city\n case 'X': // 1, 2, 3, 4: The ISO8601 varios formats\n case 'x': // 1, 2, 3, 4: The ISO8601 varios formats\n throw new RangeError('`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead');\n }\n return '';\n });\n return result;\n}\n","// @generated from regex-gen.ts\nexport var WHITE_SPACE_REGEX = /[\\t-\\r \\x85\\u200E\\u200F\\u2028\\u2029]/i;\n","import { __assign } from \"tslib\";\nimport { WHITE_SPACE_REGEX } from './regex.generated';\nexport function parseNumberSkeletonFromString(skeleton) {\n if (skeleton.length === 0) {\n throw new Error('Number skeleton cannot be empty');\n }\n // Parse the skeleton\n var stringTokens = skeleton\n .split(WHITE_SPACE_REGEX)\n .filter(function (x) { return x.length > 0; });\n var tokens = [];\n for (var _i = 0, stringTokens_1 = stringTokens; _i < stringTokens_1.length; _i++) {\n var stringToken = stringTokens_1[_i];\n var stemAndOptions = stringToken.split('/');\n if (stemAndOptions.length === 0) {\n throw new Error('Invalid number skeleton');\n }\n var stem = stemAndOptions[0], options = stemAndOptions.slice(1);\n for (var _a = 0, options_1 = options; _a < options_1.length; _a++) {\n var option = options_1[_a];\n if (option.length === 0) {\n throw new Error('Invalid number skeleton');\n }\n }\n tokens.push({ stem: stem, options: options });\n }\n return tokens;\n}\nfunction icuUnitToEcma(unit) {\n return unit.replace(/^(.*?)-/, '');\n}\nvar FRACTION_PRECISION_REGEX = /^\\.(?:(0+)(\\*)?|(#+)|(0+)(#+))$/g;\nvar SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\\+|#+)?[rs]?$/g;\nvar INTEGER_WIDTH_REGEX = /(\\*)(0+)|(#+)(0+)|(0+)/g;\nvar CONCISE_INTEGER_WIDTH_REGEX = /^(0+)$/;\nfunction parseSignificantPrecision(str) {\n var result = {};\n if (str[str.length - 1] === 'r') {\n result.roundingPriority = 'morePrecision';\n }\n else if (str[str.length - 1] === 's') {\n result.roundingPriority = 'lessPrecision';\n }\n str.replace(SIGNIFICANT_PRECISION_REGEX, function (_, g1, g2) {\n // @@@ case\n if (typeof g2 !== 'string') {\n result.minimumSignificantDigits = g1.length;\n result.maximumSignificantDigits = g1.length;\n }\n // @@@+ case\n else if (g2 === '+') {\n result.minimumSignificantDigits = g1.length;\n }\n // .### case\n else if (g1[0] === '#') {\n result.maximumSignificantDigits = g1.length;\n }\n // .@@## or .@@@ case\n else {\n result.minimumSignificantDigits = g1.length;\n result.maximumSignificantDigits =\n g1.length + (typeof g2 === 'string' ? g2.length : 0);\n }\n return '';\n });\n return result;\n}\nfunction parseSign(str) {\n switch (str) {\n case 'sign-auto':\n return {\n signDisplay: 'auto',\n };\n case 'sign-accounting':\n case '()':\n return {\n currencySign: 'accounting',\n };\n case 'sign-always':\n case '+!':\n return {\n signDisplay: 'always',\n };\n case 'sign-accounting-always':\n case '()!':\n return {\n signDisplay: 'always',\n currencySign: 'accounting',\n };\n case 'sign-except-zero':\n case '+?':\n return {\n signDisplay: 'exceptZero',\n };\n case 'sign-accounting-except-zero':\n case '()?':\n return {\n signDisplay: 'exceptZero',\n currencySign: 'accounting',\n };\n case 'sign-never':\n case '+_':\n return {\n signDisplay: 'never',\n };\n }\n}\nfunction parseConciseScientificAndEngineeringStem(stem) {\n // Engineering\n var result;\n if (stem[0] === 'E' && stem[1] === 'E') {\n result = {\n notation: 'engineering',\n };\n stem = stem.slice(2);\n }\n else if (stem[0] === 'E') {\n result = {\n notation: 'scientific',\n };\n stem = stem.slice(1);\n }\n if (result) {\n var signDisplay = stem.slice(0, 2);\n if (signDisplay === '+!') {\n result.signDisplay = 'always';\n stem = stem.slice(2);\n }\n else if (signDisplay === '+?') {\n result.signDisplay = 'exceptZero';\n stem = stem.slice(2);\n }\n if (!CONCISE_INTEGER_WIDTH_REGEX.test(stem)) {\n throw new Error('Malformed concise eng/scientific notation');\n }\n result.minimumIntegerDigits = stem.length;\n }\n return result;\n}\nfunction parseNotationOptions(opt) {\n var result = {};\n var signOpts = parseSign(opt);\n if (signOpts) {\n return signOpts;\n }\n return result;\n}\n/**\n * https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md#skeleton-stems-and-options\n */\nexport function parseNumberSkeleton(tokens) {\n var result = {};\n for (var _i = 0, tokens_1 = tokens; _i < tokens_1.length; _i++) {\n var token = tokens_1[_i];\n switch (token.stem) {\n case 'percent':\n case '%':\n result.style = 'percent';\n continue;\n case '%x100':\n result.style = 'percent';\n result.scale = 100;\n continue;\n case 'currency':\n result.style = 'currency';\n result.currency = token.options[0];\n continue;\n case 'group-off':\n case ',_':\n result.useGrouping = false;\n continue;\n case 'precision-integer':\n case '.':\n result.maximumFractionDigits = 0;\n continue;\n case 'measure-unit':\n case 'unit':\n result.style = 'unit';\n result.unit = icuUnitToEcma(token.options[0]);\n continue;\n case 'compact-short':\n case 'K':\n result.notation = 'compact';\n result.compactDisplay = 'short';\n continue;\n case 'compact-long':\n case 'KK':\n result.notation = 'compact';\n result.compactDisplay = 'long';\n continue;\n case 'scientific':\n result = __assign(__assign(__assign({}, result), { notation: 'scientific' }), token.options.reduce(function (all, opt) { return (__assign(__assign({}, all), parseNotationOptions(opt))); }, {}));\n continue;\n case 'engineering':\n result = __assign(__assign(__assign({}, result), { notation: 'engineering' }), token.options.reduce(function (all, opt) { return (__assign(__assign({}, all), parseNotationOptions(opt))); }, {}));\n continue;\n case 'notation-simple':\n result.notation = 'standard';\n continue;\n // https://github.com/unicode-org/icu/blob/master/icu4c/source/i18n/unicode/unumberformatter.h\n case 'unit-width-narrow':\n result.currencyDisplay = 'narrowSymbol';\n result.unitDisplay = 'narrow';\n continue;\n case 'unit-width-short':\n result.currencyDisplay = 'code';\n result.unitDisplay = 'short';\n continue;\n case 'unit-width-full-name':\n result.currencyDisplay = 'name';\n result.unitDisplay = 'long';\n continue;\n case 'unit-width-iso-code':\n result.currencyDisplay = 'symbol';\n continue;\n case 'scale':\n result.scale = parseFloat(token.options[0]);\n continue;\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width\n case 'integer-width':\n if (token.options.length > 1) {\n throw new RangeError('integer-width stems only accept a single optional option');\n }\n token.options[0].replace(INTEGER_WIDTH_REGEX, function (_, g1, g2, g3, g4, g5) {\n if (g1) {\n result.minimumIntegerDigits = g2.length;\n }\n else if (g3 && g4) {\n throw new Error('We currently do not support maximum integer digits');\n }\n else if (g5) {\n throw new Error('We currently do not support exact integer digits');\n }\n return '';\n });\n continue;\n }\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width\n if (CONCISE_INTEGER_WIDTH_REGEX.test(token.stem)) {\n result.minimumIntegerDigits = token.stem.length;\n continue;\n }\n if (FRACTION_PRECISION_REGEX.test(token.stem)) {\n // Precision\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#fraction-precision\n // precision-integer case\n if (token.options.length > 1) {\n throw new RangeError('Fraction-precision stems only accept a single optional option');\n }\n token.stem.replace(FRACTION_PRECISION_REGEX, function (_, g1, g2, g3, g4, g5) {\n // .000* case (before ICU67 it was .000+)\n if (g2 === '*') {\n result.minimumFractionDigits = g1.length;\n }\n // .### case\n else if (g3 && g3[0] === '#') {\n result.maximumFractionDigits = g3.length;\n }\n // .00## case\n else if (g4 && g5) {\n result.minimumFractionDigits = g4.length;\n result.maximumFractionDigits = g4.length + g5.length;\n }\n else {\n result.minimumFractionDigits = g1.length;\n result.maximumFractionDigits = g1.length;\n }\n return '';\n });\n var opt = token.options[0];\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#trailing-zero-display\n if (opt === 'w') {\n result = __assign(__assign({}, result), { trailingZeroDisplay: 'stripIfInteger' });\n }\n else if (opt) {\n result = __assign(__assign({}, result), parseSignificantPrecision(opt));\n }\n continue;\n }\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#significant-digits-precision\n if (SIGNIFICANT_PRECISION_REGEX.test(token.stem)) {\n result = __assign(__assign({}, result), parseSignificantPrecision(token.stem));\n continue;\n }\n var signOpts = parseSign(token.stem);\n if (signOpts) {\n result = __assign(__assign({}, result), signOpts);\n }\n var conciseScientificAndEngineeringOpts = parseConciseScientificAndEngineeringStem(token.stem);\n if (conciseScientificAndEngineeringOpts) {\n result = __assign(__assign({}, result), conciseScientificAndEngineeringOpts);\n }\n }\n return result;\n}\n","var _a;\nimport { __assign } from \"tslib\";\nimport { ErrorKind } from './error';\nimport { SKELETON_TYPE, TYPE, } from './types';\nimport { SPACE_SEPARATOR_REGEX } from './regex.generated';\nimport { parseNumberSkeleton, parseNumberSkeletonFromString, parseDateTimeSkeleton, } from '@formatjs/icu-skeleton-parser';\nimport { getBestPattern } from './date-time-pattern-generator';\nvar SPACE_SEPARATOR_START_REGEX = new RegExp(\"^\".concat(SPACE_SEPARATOR_REGEX.source, \"*\"));\nvar SPACE_SEPARATOR_END_REGEX = new RegExp(\"\".concat(SPACE_SEPARATOR_REGEX.source, \"*$\"));\nfunction createLocation(start, end) {\n return { start: start, end: end };\n}\n// #region Ponyfills\n// Consolidate these variables up top for easier toggling during debugging\nvar hasNativeStartsWith = !!String.prototype.startsWith;\nvar hasNativeFromCodePoint = !!String.fromCodePoint;\nvar hasNativeFromEntries = !!Object.fromEntries;\nvar hasNativeCodePointAt = !!String.prototype.codePointAt;\nvar hasTrimStart = !!String.prototype.trimStart;\nvar hasTrimEnd = !!String.prototype.trimEnd;\nvar hasNativeIsSafeInteger = !!Number.isSafeInteger;\nvar isSafeInteger = hasNativeIsSafeInteger\n ? Number.isSafeInteger\n : function (n) {\n return (typeof n === 'number' &&\n isFinite(n) &&\n Math.floor(n) === n &&\n Math.abs(n) <= 0x1fffffffffffff);\n };\n// IE11 does not support y and u.\nvar REGEX_SUPPORTS_U_AND_Y = true;\ntry {\n var re = RE('([^\\\\p{White_Space}\\\\p{Pattern_Syntax}]*)', 'yu');\n /**\n * legacy Edge or Xbox One browser\n * Unicode flag support: supported\n * Pattern_Syntax support: not supported\n * See https://github.com/formatjs/formatjs/issues/2822\n */\n REGEX_SUPPORTS_U_AND_Y = ((_a = re.exec('a')) === null || _a === void 0 ? void 0 : _a[0]) === 'a';\n}\ncatch (_) {\n REGEX_SUPPORTS_U_AND_Y = false;\n}\nvar startsWith = hasNativeStartsWith\n ? // Native\n function startsWith(s, search, position) {\n return s.startsWith(search, position);\n }\n : // For IE11\n function startsWith(s, search, position) {\n return s.slice(position, position + search.length) === search;\n };\nvar fromCodePoint = hasNativeFromCodePoint\n ? String.fromCodePoint\n : // IE11\n function fromCodePoint() {\n var codePoints = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n codePoints[_i] = arguments[_i];\n }\n var elements = '';\n var length = codePoints.length;\n var i = 0;\n var code;\n while (length > i) {\n code = codePoints[i++];\n if (code > 0x10ffff)\n throw RangeError(code + ' is not a valid code point');\n elements +=\n code < 0x10000\n ? String.fromCharCode(code)\n : String.fromCharCode(((code -= 0x10000) >> 10) + 0xd800, (code % 0x400) + 0xdc00);\n }\n return elements;\n };\nvar fromEntries = \n// native\nhasNativeFromEntries\n ? Object.fromEntries\n : // Ponyfill\n function fromEntries(entries) {\n var obj = {};\n for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {\n var _a = entries_1[_i], k = _a[0], v = _a[1];\n obj[k] = v;\n }\n return obj;\n };\nvar codePointAt = hasNativeCodePointAt\n ? // Native\n function codePointAt(s, index) {\n return s.codePointAt(index);\n }\n : // IE 11\n function codePointAt(s, index) {\n var size = s.length;\n if (index < 0 || index >= size) {\n return undefined;\n }\n var first = s.charCodeAt(index);\n var second;\n return first < 0xd800 ||\n first > 0xdbff ||\n index + 1 === size ||\n (second = s.charCodeAt(index + 1)) < 0xdc00 ||\n second > 0xdfff\n ? first\n : ((first - 0xd800) << 10) + (second - 0xdc00) + 0x10000;\n };\nvar trimStart = hasTrimStart\n ? // Native\n function trimStart(s) {\n return s.trimStart();\n }\n : // Ponyfill\n function trimStart(s) {\n return s.replace(SPACE_SEPARATOR_START_REGEX, '');\n };\nvar trimEnd = hasTrimEnd\n ? // Native\n function trimEnd(s) {\n return s.trimEnd();\n }\n : // Ponyfill\n function trimEnd(s) {\n return s.replace(SPACE_SEPARATOR_END_REGEX, '');\n };\n// Prevent minifier to translate new RegExp to literal form that might cause syntax error on IE11.\nfunction RE(s, flag) {\n return new RegExp(s, flag);\n}\n// #endregion\nvar matchIdentifierAtIndex;\nif (REGEX_SUPPORTS_U_AND_Y) {\n // Native\n var IDENTIFIER_PREFIX_RE_1 = RE('([^\\\\p{White_Space}\\\\p{Pattern_Syntax}]*)', 'yu');\n matchIdentifierAtIndex = function matchIdentifierAtIndex(s, index) {\n var _a;\n IDENTIFIER_PREFIX_RE_1.lastIndex = index;\n var match = IDENTIFIER_PREFIX_RE_1.exec(s);\n return (_a = match[1]) !== null && _a !== void 0 ? _a : '';\n };\n}\nelse {\n // IE11\n matchIdentifierAtIndex = function matchIdentifierAtIndex(s, index) {\n var match = [];\n while (true) {\n var c = codePointAt(s, index);\n if (c === undefined || _isWhiteSpace(c) || _isPatternSyntax(c)) {\n break;\n }\n match.push(c);\n index += c >= 0x10000 ? 2 : 1;\n }\n return fromCodePoint.apply(void 0, match);\n };\n}\nvar Parser = /** @class */ (function () {\n function Parser(message, options) {\n if (options === void 0) { options = {}; }\n this.message = message;\n this.position = { offset: 0, line: 1, column: 1 };\n this.ignoreTag = !!options.ignoreTag;\n this.locale = options.locale;\n this.requiresOtherClause = !!options.requiresOtherClause;\n this.shouldParseSkeletons = !!options.shouldParseSkeletons;\n }\n Parser.prototype.parse = function () {\n if (this.offset() !== 0) {\n throw Error('parser can only be used once');\n }\n return this.parseMessage(0, '', false);\n };\n Parser.prototype.parseMessage = function (nestingLevel, parentArgType, expectingCloseTag) {\n var elements = [];\n while (!this.isEOF()) {\n var char = this.char();\n if (char === 123 /* `{` */) {\n var result = this.parseArgument(nestingLevel, expectingCloseTag);\n if (result.err) {\n return result;\n }\n elements.push(result.val);\n }\n else if (char === 125 /* `}` */ && nestingLevel > 0) {\n break;\n }\n else if (char === 35 /* `#` */ &&\n (parentArgType === 'plural' || parentArgType === 'selectordinal')) {\n var position = this.clonePosition();\n this.bump();\n elements.push({\n type: TYPE.pound,\n location: createLocation(position, this.clonePosition()),\n });\n }\n else if (char === 60 /* `<` */ &&\n !this.ignoreTag &&\n this.peek() === 47 // char code for '/'\n ) {\n if (expectingCloseTag) {\n break;\n }\n else {\n return this.error(ErrorKind.UNMATCHED_CLOSING_TAG, createLocation(this.clonePosition(), this.clonePosition()));\n }\n }\n else if (char === 60 /* `<` */ &&\n !this.ignoreTag &&\n _isAlpha(this.peek() || 0)) {\n var result = this.parseTag(nestingLevel, parentArgType);\n if (result.err) {\n return result;\n }\n elements.push(result.val);\n }\n else {\n var result = this.parseLiteral(nestingLevel, parentArgType);\n if (result.err) {\n return result;\n }\n elements.push(result.val);\n }\n }\n return { val: elements, err: null };\n };\n /**\n * A tag name must start with an ASCII lower/upper case letter. The grammar is based on the\n * [custom element name][] except that a dash is NOT always mandatory and uppercase letters\n * are accepted:\n *\n * ```\n * tag ::= \"<\" tagName (whitespace)* \"/>\" | \"<\" tagName (whitespace)* \">\" message \"</\" tagName (whitespace)* \">\"\n * tagName ::= [a-z] (PENChar)*\n * PENChar ::=\n * \"-\" | \".\" | [0-9] | \"_\" | [a-z] | [A-Z] | #xB7 | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x37D] |\n * [#x37F-#x1FFF] | [#x200C-#x200D] | [#x203F-#x2040] | [#x2070-#x218F] | [#x2C00-#x2FEF] |\n * [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]\n * ```\n *\n * [custom element name]: https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name\n * NOTE: We're a bit more lax here since HTML technically does not allow uppercase HTML element but we do\n * since other tag-based engines like React allow it\n */\n Parser.prototype.parseTag = function (nestingLevel, parentArgType) {\n var startPosition = this.clonePosition();\n this.bump(); // `<`\n var tagName = this.parseTagName();\n this.bumpSpace();\n if (this.bumpIf('/>')) {\n // Self closing tag\n return {\n val: {\n type: TYPE.literal,\n value: \"<\".concat(tagName, \"/>\"),\n location: createLocation(startPosition, this.clonePosition()),\n },\n err: null,\n };\n }\n else if (this.bumpIf('>')) {\n var childrenResult = this.parseMessage(nestingLevel + 1, parentArgType, true);\n if (childrenResult.err) {\n return childrenResult;\n }\n var children = childrenResult.val;\n // Expecting a close tag\n var endTagStartPosition = this.clonePosition();\n if (this.bumpIf('</')) {\n if (this.isEOF() || !_isAlpha(this.char())) {\n return this.error(ErrorKind.INVALID_TAG, createLocation(endTagStartPosition, this.clonePosition()));\n }\n var closingTagNameStartPosition = this.clonePosition();\n var closingTagName = this.parseTagName();\n if (tagName !== closingTagName) {\n return this.error(ErrorKind.UNMATCHED_CLOSING_TAG, createLocation(closingTagNameStartPosition, this.clonePosition()));\n }\n this.bumpSpace();\n if (!this.bumpIf('>')) {\n return this.error(ErrorKind.INVALID_TAG, createLocation(endTagStartPosition, this.clonePosition()));\n }\n return {\n val: {\n type: TYPE.tag,\n value: tagName,\n children: children,\n location: createLocation(startPosition, this.clonePosition()),\n },\n err: null,\n };\n }\n else {\n return this.error(ErrorKind.UNCLOSED_TAG, createLocation(startPosition, this.clonePosition()));\n }\n }\n else {\n return this.error(ErrorKind.INVALID_TAG, createLocation(startPosition, this.clonePosition()));\n }\n };\n /**\n * This method assumes that the caller has peeked ahead for the first tag character.\n */\n Parser.prototype.parseTagName = function () {\n var startOffset = this.offset();\n this.bump(); // the first tag name character\n while (!this.isEOF() && _isPotentialElementNameChar(this.char())) {\n this.bump();\n }\n return this.message.slice(startOffset, this.offset());\n };\n Parser.prototype.parseLiteral = function (nestingLevel, parentArgType) {\n var start = this.clonePosition();\n var value = '';\n while (true) {\n var parseQuoteResult = this.tryParseQuote(parentArgType);\n if (parseQuoteResult) {\n value += parseQuoteResult;\n continue;\n }\n var parseUnquotedResult = this.tryParseUnquoted(nestingLevel, parentArgType);\n if (parseUnquotedResult) {\n value += parseUnquotedResult;\n continue;\n }\n var parseLeftAngleResult = this.tryParseLeftAngleBracket();\n if (parseLeftAngleResult) {\n value += parseLeftAngleResult;\n continue;\n }\n break;\n }\n var location = createLocation(start, this.clonePosition());\n return {\n val: { type: TYPE.literal, value: value, location: location },\n err: null,\n };\n };\n Parser.prototype.tryParseLeftAngleBracket = function () {\n if (!this.isEOF() &&\n this.char() === 60 /* `<` */ &&\n (this.ignoreTag ||\n // If at the opening tag or closing tag position, bail.\n !_isAlphaOrSlash(this.peek() || 0))) {\n this.bump(); // `<`\n return '<';\n }\n return null;\n };\n /**\n * Starting with ICU 4.8, an ASCII apostrophe only starts quoted text if it immediately precedes\n * a character that requires quoting (that is, \"only where needed\"), and works the same in\n * nested messages as on the top level of the pattern. The new behavior is otherwise compatible.\n */\n Parser.prototype.tryParseQuote = function (parentArgType) {\n if (this.isEOF() || this.char() !== 39 /* `'` */) {\n return null;\n }\n // Parse escaped char following the apostrophe, or early return if there is no escaped char.\n // Check if is valid escaped character\n switch (this.peek()) {\n case 39 /* `'` */:\n // double quote, should return as a single quote.\n this.bump();\n this.bump();\n return \"'\";\n // '{', '<', '>', '}'\n case 123:\n case 60:\n case 62:\n case 125:\n break;\n case 35: // '#'\n if (parentArgType === 'plural' || parentArgType === 'selectordinal') {\n break;\n }\n return null;\n default:\n return null;\n }\n this.bump(); // apostrophe\n var codePoints = [this.char()]; // escaped char\n this.bump();\n // read chars until the optional closing apostrophe is found\n while (!this.isEOF()) {\n var ch = this.char();\n if (ch === 39 /* `'` */) {\n if (this.peek() === 39 /* `'` */) {\n codePoints.push(39);\n // Bump one more time because we need to skip 2 characters.\n this.bump();\n }\n else {\n // Optional closing apostrophe.\n this.bump();\n break;\n }\n }\n else {\n codePoints.push(ch);\n }\n this.bump();\n }\n return fromCodePoint.apply(void 0, codePoints);\n };\n Parser.prototype.tryParseUnquoted = function (nestingLevel, parentArgType) {\n if (this.isEOF()) {\n return null;\n }\n var ch = this.char();\n if (ch === 60 /* `<` */ ||\n ch === 123 /* `{` */ ||\n (ch === 35 /* `#` */ &&\n (parentArgType === 'plural' || parentArgType === 'selectordinal')) ||\n (ch === 125 /* `}` */ && nestingLevel > 0)) {\n return null;\n }\n else {\n this.bump();\n return fromCodePoint(ch);\n }\n };\n Parser.prototype.parseArgument = function (nestingLevel, expectingCloseTag) {\n var openingBracePosition = this.clonePosition();\n this.bump(); // `{`\n this.bumpSpace();\n if (this.isEOF()) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n if (this.char() === 125 /* `}` */) {\n this.bump();\n return this.error(ErrorKind.EMPTY_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));\n }\n // argument name\n var value = this.parseIdentifierIfPossible().value;\n if (!value) {\n return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));\n }\n this.bumpSpace();\n if (this.isEOF()) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n switch (this.char()) {\n // Simple argument: `{name}`\n case 125 /* `}` */: {\n this.bump(); // `}`\n return {\n val: {\n type: TYPE.argument,\n // value does not include the opening and closing braces.\n value: value,\n location: createLocation(openingBracePosition, this.clonePosition()),\n },\n err: null,\n };\n }\n // Argument with options: `{name, format, ...}`\n case 44 /* `,` */: {\n this.bump(); // `,`\n this.bumpSpace();\n if (this.isEOF()) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n return this.parseArgumentOptions(nestingLevel, expectingCloseTag, value, openingBracePosition);\n }\n default:\n return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));\n }\n };\n /**\n * Advance the parser until the end of the identifier, if it is currently on\n * an identifier character. Return an empty string otherwise.\n */\n Parser.prototype.parseIdentifierIfPossible = function () {\n var startingPosition = this.clonePosition();\n var startOffset = this.offset();\n var value = matchIdentifierAtIndex(this.message, startOffset);\n var endOffset = startOffset + value.length;\n this.bumpTo(endOffset);\n var endPosition = this.clonePosition();\n var location = createLocation(startingPosition, endPosition);\n return { value: value, location: location };\n };\n Parser.prototype.parseArgumentOptions = function (nestingLevel, expectingCloseTag, value, openingBracePosition) {\n var _a;\n // Parse this range:\n // {name, type, style}\n // ^---^\n var typeStartPosition = this.clonePosition();\n var argType = this.parseIdentifierIfPossible().value;\n var typeEndPosition = this.clonePosition();\n switch (argType) {\n case '':\n // Expecting a style string number, date, time, plural, selectordinal, or select.\n return this.error(ErrorKind.EXPECT_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition));\n case 'number':\n case 'date':\n case 'time': {\n // Parse this range:\n // {name, number, style}\n // ^-------^\n this.bumpSpace();\n var styleAndLocation = null;\n if (this.bumpIf(',')) {\n this.bumpSpace();\n var styleStartPosition = this.clonePosition();\n var result = this.parseSimpleArgStyleIfPossible();\n if (result.err) {\n return result;\n }\n var style = trimEnd(result.val);\n if (style.length === 0) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_STYLE, createLocation(this.clonePosition(), this.clonePosition()));\n }\n var styleLocation = createLocation(styleStartPosition, this.clonePosition());\n styleAndLocation = { style: style, styleLocation: styleLocation };\n }\n var argCloseResult = this.tryParseArgumentClose(openingBracePosition);\n if (argCloseResult.err) {\n return argCloseResult;\n }\n var location_1 = createLocation(openingBracePosition, this.clonePosition());\n // Extract style or skeleton\n if (styleAndLocation && startsWith(styleAndLocation === null || styleAndLocation === void 0 ? void 0 : styleAndLocation.style, '::', 0)) {\n // Skeleton starts with `::`.\n var skeleton = trimStart(styleAndLocation.style.slice(2));\n if (argType === 'number') {\n var result = this.parseNumberSkeletonFromString(skeleton, styleAndLocation.styleLocation);\n if (result.err) {\n return result;\n }\n return {\n val: { type: TYPE.number, value: value, location: location_1, style: result.val },\n err: null,\n };\n }\n else {\n if (skeleton.length === 0) {\n return this.error(ErrorKind.EXPECT_DATE_TIME_SKELETON, location_1);\n }\n var dateTimePattern = skeleton;\n // Get \"best match\" pattern only if locale is passed, if not, let it\n // pass as-is where `parseDateTimeSkeleton()` will throw an error\n // for unsupported patterns.\n if (this.locale) {\n dateTimePattern = getBestPattern(skeleton, this.locale);\n }\n var style = {\n type: SKELETON_TYPE.dateTime,\n pattern: dateTimePattern,\n location: styleAndLocation.styleLocation,\n parsedOptions: this.shouldParseSkeletons\n ? parseDateTimeSkeleton(dateTimePattern)\n : {},\n };\n var type = argType === 'date' ? TYPE.date : TYPE.time;\n return {\n val: { type: type, value: value, location: location_1, style: style },\n err: null,\n };\n }\n }\n // Regular style or no style.\n return {\n val: {\n type: argType === 'number'\n ? TYPE.number\n : argType === 'date'\n ? TYPE.date\n : TYPE.time,\n value: value,\n location: location_1,\n style: (_a = styleAndLocation === null || styleAndLocation === void 0 ? void 0 : styleAndLocation.style) !== null && _a !== void 0 ? _a : null,\n },\n err: null,\n };\n }\n case 'plural':\n case 'selectordinal':\n case 'select': {\n // Parse this range:\n // {name, plural, options}\n // ^---------^\n var typeEndPosition_1 = this.clonePosition();\n this.bumpSpace();\n if (!this.bumpIf(',')) {\n return this.error(ErrorKind.EXPECT_SELECT_ARGUMENT_OPTIONS, createLocation(typeEndPosition_1, __assign({}, typeEndPosition_1)));\n }\n this.bumpSpace();\n // Parse offset:\n // {name, plural, offset:1, options}\n // ^-----^\n //\n // or the first option:\n //\n // {name, plural, one {...} other {...}}\n // ^--^\n var identifierAndLocation = this.parseIdentifierIfPossible();\n var pluralOffset = 0;\n if (argType !== 'select' && identifierAndLocation.value === 'offset') {\n if (!this.bumpIf(':')) {\n return this.error(ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, createLocation(this.clonePosition(), this.clonePosition()));\n }\n this.bumpSpace();\n var result = this.tryParseDecimalInteger(ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, ErrorKind.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);\n if (result.err) {\n return result;\n }\n // Parse another identifier for option parsing\n this.bumpSpace();\n identifierAndLocation = this.parseIdentifierIfPossible();\n pluralOffset = result.val;\n }\n var optionsResult = this.tryParsePluralOrSelectOptions(nestingLevel, argType, expectingCloseTag, identifierAndLocation);\n if (optionsResult.err) {\n return optionsResult;\n }\n var argCloseResult = this.tryParseArgumentClose(openingBracePosition);\n if (argCloseResult.err) {\n return argCloseResult;\n }\n var location_2 = createLocation(openingBracePosition, this.clonePosition());\n if (argType === 'select') {\n return {\n val: {\n type: TYPE.select,\n value: value,\n options: fromEntries(optionsResult.val),\n location: location_2,\n },\n err: null,\n };\n }\n else {\n return {\n val: {\n type: TYPE.plural,\n value: value,\n options: fromEntries(optionsResult.val),\n offset: pluralOffset,\n pluralType: argType === 'plural' ? 'cardinal' : 'ordinal',\n location: location_2,\n },\n err: null,\n };\n }\n }\n default:\n return this.error(ErrorKind.INVALID_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition));\n }\n };\n Parser.prototype.tryParseArgumentClose = function (openingBracePosition) {\n // Parse: {value, number, ::currency/GBP }\n //\n if (this.isEOF() || this.char() !== 125 /* `}` */) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n this.bump(); // `}`\n return { val: true, err: null };\n };\n /**\n * See: https://github.com/unicode-org/icu/blob/af7ed1f6d2298013dc303628438ec4abe1f16479/icu4c/source/common/messagepattern.cpp#L659\n */\n Parser.prototype.parseSimpleArgStyleIfPossible = function () {\n var nestedBraces = 0;\n var startPosition = this.clonePosition();\n while (!this.isEOF()) {\n var ch = this.char();\n switch (ch) {\n case 39 /* `'` */: {\n // Treat apostrophe as quoting but include it in the style part.\n // Find the end of the quoted literal text.\n this.bump();\n var apostrophePosition = this.clonePosition();\n if (!this.bumpUntil(\"'\")) {\n return this.error(ErrorKind.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE, createLocation(apostrophePosition, this.clonePosition()));\n }\n this.bump();\n break;\n }\n case 123 /* `{` */: {\n nestedBraces += 1;\n this.bump();\n break;\n }\n case 125 /* `}` */: {\n if (nestedBraces > 0) {\n nestedBraces -= 1;\n }\n else {\n return {\n val: this.message.slice(startPosition.offset, this.offset()),\n err: null,\n };\n }\n break;\n }\n default:\n this.bump();\n break;\n }\n }\n return {\n val: this.message.slice(startPosition.offset, this.offset()),\n err: null,\n };\n };\n Parser.prototype.parseNumberSkeletonFromString = function (skeleton, location) {\n var tokens = [];\n try {\n tokens = parseNumberSkeletonFromString(skeleton);\n }\n catch (e) {\n return this.error(ErrorKind.INVALID_NUMBER_SKELETON, location);\n }\n return {\n val: {\n type: SKELETON_TYPE.number,\n tokens: tokens,\n location: location,\n parsedOptions: this.shouldParseSkeletons\n ? parseNumberSkeleton(tokens)\n : {},\n },\n err: null,\n };\n };\n /**\n * @param nesting_level The current nesting level of messages.\n * This can be positive when parsing message fragment in select or plural argument options.\n * @param parent_arg_type The parent argument's type.\n * @param parsed_first_identifier If provided, this is the first identifier-like selector of\n * the argument. It is a by-product of a previous parsing attempt.\n * @param expecting_close_tag If true, this message is directly or indirectly nested inside\n * between a pair of opening and closing tags. The nested message will not parse beyond\n * the closing tag boundary.\n */\n Parser.prototype.tryParsePluralOrSelectOptions = function (nestingLevel, parentArgType, expectCloseTag, parsedFirstIdentifier) {\n var _a;\n var hasOtherClause = false;\n var options = [];\n var parsedSelectors = new Set();\n var selector = parsedFirstIdentifier.value, selectorLocation = parsedFirstIdentifier.location;\n // Parse:\n // one {one apple}\n // ^--^\n while (true) {\n if (selector.length === 0) {\n var startPosition = this.clonePosition();\n if (parentArgType !== 'select' && this.bumpIf('=')) {\n // Try parse `={number}` selector\n var result = this.tryParseDecimalInteger(ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, ErrorKind.INVALID_PLURAL_ARGUMENT_SELECTOR);\n if (result.err) {\n return result;\n }\n selectorLocation = createLocation(startPosition, this.clonePosition());\n selector = this.message.slice(startPosition.offset, this.offset());\n }\n else {\n break;\n }\n }\n // Duplicate selector clauses\n if (parsedSelectors.has(selector)) {\n return this.error(parentArgType === 'select'\n ? ErrorKind.DUPLICATE_SELECT_ARGUMENT_SELECTOR\n : ErrorKind.DUPLICATE_PLURAL_ARGUMENT_SELECTOR, selectorLocation);\n }\n if (selector === 'other') {\n hasOtherClause = true;\n }\n // Parse:\n // one {one apple}\n // ^----------^\n this.bumpSpace();\n var openingBracePosition = this.clonePosition();\n if (!this.bumpIf('{')) {\n return this.error(parentArgType === 'select'\n ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\n : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT, createLocation(this.clonePosition(), this.clonePosition()));\n }\n var fragmentResult = this.parseMessage(nestingLevel + 1, parentArgType, expectCloseTag);\n if (fragmentResult.err) {\n return fragmentResult;\n }\n var argCloseResult = this.tryParseArgumentClose(openingBracePosition);\n if (argCloseResult.err) {\n return argCloseResult;\n }\n options.push([\n selector,\n {\n value: fragmentResult.val,\n location: createLocation(openingBracePosition, this.clonePosition()),\n },\n ]);\n // Keep track of the existing selectors\n parsedSelectors.add(selector);\n // Prep next selector clause.\n this.bumpSpace();\n (_a = this.parseIdentifierIfPossible(), selector = _a.value, selectorLocation = _a.location);\n }\n if (options.length === 0) {\n return this.error(parentArgType === 'select'\n ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR\n : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, createLocation(this.clonePosition(), this.clonePosition()));\n }\n if (this.requiresOtherClause && !hasOtherClause) {\n return this.error(ErrorKind.MISSING_OTHER_CLAUSE, createLocation(this.clonePosition(), this.clonePosition()));\n }\n return { val: options, err: null };\n };\n Parser.prototype.tryParseDecimalInteger = function (expectNumberError, invalidNumberError) {\n var sign = 1;\n var startingPosition = this.clonePosition();\n if (this.bumpIf('+')) {\n }\n else if (this.bumpIf('-')) {\n sign = -1;\n }\n var hasDigits = false;\n var decimal = 0;\n while (!this.isEOF()) {\n var ch = this.char();\n if (ch >= 48 /* `0` */ && ch <= 57 /* `9` */) {\n hasDigits = true;\n decimal = decimal * 10 + (ch - 48);\n this.bump();\n }\n else {\n break;\n }\n }\n var location = createLocation(startingPosition, this.clonePosition());\n if (!hasDigits) {\n return this.error(expectNumberError, location);\n }\n decimal *= sign;\n if (!isSafeInteger(decimal)) {\n return this.error(invalidNumberError, location);\n }\n return { val: decimal, err: null };\n };\n Parser.prototype.offset = function () {\n return this.position.offset;\n };\n Parser.prototype.isEOF = function () {\n return this.offset() === this.message.length;\n };\n Parser.prototype.clonePosition = function () {\n // This is much faster than `Object.assign` or spread.\n return {\n offset: this.position.offset,\n line: this.position.line,\n column: this.position.column,\n };\n };\n /**\n * Return the code point at the current position of the parser.\n * Throws if the index is out of bound.\n */\n Parser.prototype.char = function () {\n var offset = this.position.offset;\n if (offset >= this.message.length) {\n throw Error('out of bound');\n }\n var code = codePointAt(this.message, offset);\n if (code === undefined) {\n throw Error(\"Offset \".concat(offset, \" is at invalid UTF-16 code unit boundary\"));\n }\n return code;\n };\n Parser.prototype.error = function (kind, location) {\n return {\n val: null,\n err: {\n kind: kind,\n message: this.message,\n location: location,\n },\n };\n };\n /** Bump the parser to the next UTF-16 code unit. */\n Parser.prototype.bump = function () {\n if (this.isEOF()) {\n return;\n }\n var code = this.char();\n if (code === 10 /* '\\n' */) {\n this.position.line += 1;\n this.position.column = 1;\n this.position.offset += 1;\n }\n else {\n this.position.column += 1;\n // 0 ~ 0x10000 -> unicode BMP, otherwise skip the surrogate pair.\n this.position.offset += code < 0x10000 ? 1 : 2;\n }\n };\n /**\n * If the substring starting at the current position of the parser has\n * the given prefix, then bump the parser to the character immediately\n * following the prefix and return true. Otherwise, don't bump the parser\n * and return false.\n */\n Parser.prototype.bumpIf = function (prefix) {\n if (startsWith(this.message, prefix, this.offset())) {\n for (var i = 0; i < prefix.length; i++) {\n this.bump();\n }\n return true;\n }\n return false;\n };\n /**\n * Bump the parser until the pattern character is found and return `true`.\n * Otherwise bump to the end of the file and return `false`.\n */\n Parser.prototype.bumpUntil = function (pattern) {\n var currentOffset = this.offset();\n var index = this.message.indexOf(pattern, currentOffset);\n if (index >= 0) {\n this.bumpTo(index);\n return true;\n }\n else {\n this.bumpTo(this.message.length);\n return false;\n }\n };\n /**\n * Bump the parser to the target offset.\n * If target offset is beyond the end of the input, bump the parser to the end of the input.\n */\n Parser.prototype.bumpTo = function (targetOffset) {\n if (this.offset() > targetOffset) {\n throw Error(\"targetOffset \".concat(targetOffset, \" must be greater than or equal to the current offset \").concat(this.offset()));\n }\n targetOffset = Math.min(targetOffset, this.message.length);\n while (true) {\n var offset = this.offset();\n if (offset === targetOffset) {\n break;\n }\n if (offset > targetOffset) {\n throw Error(\"targetOffset \".concat(targetOffset, \" is at invalid UTF-16 code unit boundary\"));\n }\n this.bump();\n if (this.isEOF()) {\n break;\n }\n }\n };\n /** advance the parser through all whitespace to the next non-whitespace code unit. */\n Parser.prototype.bumpSpace = function () {\n while (!this.isEOF() && _isWhiteSpace(this.char())) {\n this.bump();\n }\n };\n /**\n * Peek at the *next* Unicode codepoint in the input without advancing the parser.\n * If the input has been exhausted, then this returns null.\n */\n Parser.prototype.peek = function () {\n if (this.isEOF()) {\n return null;\n }\n var code = this.char();\n var offset = this.offset();\n var nextCode = this.message.charCodeAt(offset + (code >= 0x10000 ? 2 : 1));\n return nextCode !== null && nextCode !== void 0 ? nextCode : null;\n };\n return Parser;\n}());\nexport { Parser };\n/**\n * This check if codepoint is alphabet (lower & uppercase)\n * @param codepoint\n * @returns\n */\nfunction _isAlpha(codepoint) {\n return ((codepoint >= 97 && codepoint <= 122) ||\n (codepoint >= 65 && codepoint <= 90));\n}\nfunction _isAlphaOrSlash(codepoint) {\n return _isAlpha(codepoint) || codepoint === 47; /* '/' */\n}\n/** See `parseTag` function docs. */\nfunction _isPotentialElementNameChar(c) {\n return (c === 45 /* '-' */ ||\n c === 46 /* '.' */ ||\n (c >= 48 && c <= 57) /* 0..9 */ ||\n c === 95 /* '_' */ ||\n (c >= 97 && c <= 122) /** a..z */ ||\n (c >= 65 && c <= 90) /* A..Z */ ||\n c == 0xb7 ||\n (c >= 0xc0 && c <= 0xd6) ||\n (c >= 0xd8 && c <= 0xf6) ||\n (c >= 0xf8 && c <= 0x37d) ||\n (c >= 0x37f && c <= 0x1fff) ||\n (c >= 0x200c && c <= 0x200d) ||\n (c >= 0x203f && c <= 0x2040) ||\n (c >= 0x2070 && c <= 0x218f) ||\n (c >= 0x2c00 && c <= 0x2fef) ||\n (c >= 0x3001 && c <= 0xd7ff) ||\n (c >= 0xf900 && c <= 0xfdcf) ||\n (c >= 0xfdf0 && c <= 0xfffd) ||\n (c >= 0x10000 && c <= 0xeffff));\n}\n/**\n * Code point equivalent of regex `\\p{White_Space}`.\n * From: https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt\n */\nfunction _isWhiteSpace(c) {\n return ((c >= 0x0009 && c <= 0x000d) ||\n c === 0x0020 ||\n c === 0x0085 ||\n (c >= 0x200e && c <= 0x200f) ||\n c === 0x2028 ||\n c === 0x2029);\n}\n/**\n * Code point equivalent of regex `\\p{Pattern_Syntax}`.\n * See https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt\n */\nfunction _isPatternSyntax(c) {\n return ((c >= 0x0021 && c <= 0x0023) ||\n c === 0x0024 ||\n (c >= 0x0025 && c <= 0x0027) ||\n c === 0x0028 ||\n c === 0x0029 ||\n c === 0x002a ||\n c === 0x002b ||\n c === 0x002c ||\n c === 0x002d ||\n (c >= 0x002e && c <= 0x002f) ||\n (c >= 0x003a && c <= 0x003b) ||\n (c >= 0x003c && c <= 0x003e) ||\n (c >= 0x003f && c <= 0x0040) ||\n c === 0x005b ||\n c === 0x005c ||\n c === 0x005d ||\n c === 0x005e ||\n c === 0x0060 ||\n c === 0x007b ||\n c === 0x007c ||\n c === 0x007d ||\n c === 0x007e ||\n c === 0x00a1 ||\n (c >= 0x00a2 && c <= 0x00a5) ||\n c === 0x00a6 ||\n c === 0x00a7 ||\n c === 0x00a9 ||\n c === 0x00ab ||\n c === 0x00ac ||\n c === 0x00ae ||\n c === 0x00b0 ||\n c === 0x00b1 ||\n c === 0x00b6 ||\n c === 0x00bb ||\n c === 0x00bf ||\n c === 0x00d7 ||\n c === 0x00f7 ||\n (c >= 0x2010 && c <= 0x2015) ||\n (c >= 0x2016 && c <= 0x2017) ||\n c === 0x2018 ||\n c === 0x2019 ||\n c === 0x201a ||\n (c >= 0x201b && c <= 0x201c) ||\n c === 0x201d ||\n c === 0x201e ||\n c === 0x201f ||\n (c >= 0x2020 && c <= 0x2027) ||\n (c >= 0x2030 && c <= 0x2038) ||\n c === 0x2039 ||\n c === 0x203a ||\n (c >= 0x203b && c <= 0x203e) ||\n (c >= 0x2041 && c <= 0x2043) ||\n c === 0x2044 ||\n c === 0x2045 ||\n c === 0x2046 ||\n (c >= 0x2047 && c <= 0x2051) ||\n c === 0x2052 ||\n c === 0x2053 ||\n (c >= 0x2055 && c <= 0x205e) ||\n (c >= 0x2190 && c <= 0x2194) ||\n (c >= 0x2195 && c <= 0x2199) ||\n (c >= 0x219a && c <= 0x219b) ||\n (c >= 0x219c && c <= 0x219f) ||\n c === 0x21a0 ||\n (c >= 0x21a1 && c <= 0x21a2) ||\n c === 0x21a3 ||\n (c >= 0x21a4 && c <= 0x21a5) ||\n c === 0x21a6 ||\n (c >= 0x21a7 && c <= 0x21ad) ||\n c === 0x21ae ||\n (c >= 0x21af && c <= 0x21cd) ||\n (c >= 0x21ce && c <= 0x21cf) ||\n (c >= 0x21d0 && c <= 0x21d1) ||\n c === 0x21d2 ||\n c === 0x21d3 ||\n c === 0x21d4 ||\n (c >= 0x21d5 && c <= 0x21f3) ||\n (c >= 0x21f4 && c <= 0x22ff) ||\n (c >= 0x2300 && c <= 0x2307) ||\n c === 0x2308 ||\n c === 0x2309 ||\n c === 0x230a ||\n c === 0x230b ||\n (c >= 0x230c && c <= 0x231f) ||\n (c >= 0x2320 && c <= 0x2321) ||\n (c >= 0x2322 && c <= 0x2328) ||\n c === 0x2329 ||\n c === 0x232a ||\n (c >= 0x232b && c <= 0x237b) ||\n c === 0x237c ||\n (c >= 0x237d && c <= 0x239a) ||\n (c >= 0x239b && c <= 0x23b3) ||\n (c >= 0x23b4 && c <= 0x23db) ||\n (c >= 0x23dc && c <= 0x23e1) ||\n (c >= 0x23e2 && c <= 0x2426) ||\n (c >= 0x2427 && c <= 0x243f) ||\n (c >= 0x2440 && c <= 0x244a) ||\n (c >= 0x244b && c <= 0x245f) ||\n (c >= 0x2500 && c <= 0x25b6) ||\n c === 0x25b7 ||\n (c >= 0x25b8 && c <= 0x25c0) ||\n c === 0x25c1 ||\n (c >= 0x25c2 && c <= 0x25f7) ||\n (c >= 0x25f8 && c <= 0x25ff) ||\n (c >= 0x2600 && c <= 0x266e) ||\n c === 0x266f ||\n (c >= 0x2670 && c <= 0x2767) ||\n c === 0x2768 ||\n c === 0x2769 ||\n c === 0x276a ||\n c === 0x276b ||\n c === 0x276c ||\n c === 0x276d ||\n c === 0x276e ||\n c === 0x276f ||\n c === 0x2770 ||\n c === 0x2771 ||\n c === 0x2772 ||\n c === 0x2773 ||\n c === 0x2774 ||\n c === 0x2775 ||\n (c >= 0x2794 && c <= 0x27bf) ||\n (c >= 0x27c0 && c <= 0x27c4) ||\n c === 0x27c5 ||\n c === 0x27c6 ||\n (c >= 0x27c7 && c <= 0x27e5) ||\n c === 0x27e6 ||\n c === 0x27e7 ||\n c === 0x27e8 ||\n c === 0x27e9 ||\n c === 0x27ea ||\n c === 0x27eb ||\n c === 0x27ec ||\n c === 0x27ed ||\n c === 0x27ee ||\n c === 0x27ef ||\n (c >= 0x27f0 && c <= 0x27ff) ||\n (c >= 0x2800 && c <= 0x28ff) ||\n (c >= 0x2900 && c <= 0x2982) ||\n c === 0x2983 ||\n c === 0x2984 ||\n c === 0x2985 ||\n c === 0x2986 ||\n c === 0x2987 ||\n c === 0x2988 ||\n c === 0x2989 ||\n c === 0x298a ||\n c === 0x298b ||\n c === 0x298c ||\n c === 0x298d ||\n c === 0x298e ||\n c === 0x298f ||\n c === 0x2990 ||\n c === 0x2991 ||\n c === 0x2992 ||\n c === 0x2993 ||\n c === 0x2994 ||\n c === 0x2995 ||\n c === 0x2996 ||\n c === 0x2997 ||\n c === 0x2998 ||\n (c >= 0x2999 && c <= 0x29d7) ||\n c === 0x29d8 ||\n c === 0x29d9 ||\n c === 0x29da ||\n c === 0x29db ||\n (c >= 0x29dc && c <= 0x29fb) ||\n c === 0x29fc ||\n c === 0x29fd ||\n (c >= 0x29fe && c <= 0x2aff) ||\n (c >= 0x2b00 && c <= 0x2b2f) ||\n (c >= 0x2b30 && c <= 0x2b44) ||\n (c >= 0x2b45 && c <= 0x2b46) ||\n (c >= 0x2b47 && c <= 0x2b4c) ||\n (c >= 0x2b4d && c <= 0x2b73) ||\n (c >= 0x2b74 && c <= 0x2b75) ||\n (c >= 0x2b76 && c <= 0x2b95) ||\n c === 0x2b96 ||\n (c >= 0x2b97 && c <= 0x2bff) ||\n (c >= 0x2e00 && c <= 0x2e01) ||\n c === 0x2e02 ||\n c === 0x2e03 ||\n c === 0x2e04 ||\n c === 0x2e05 ||\n (c >= 0x2e06 && c <= 0x2e08) ||\n c === 0x2e09 ||\n c === 0x2e0a ||\n c === 0x2e0b ||\n c === 0x2e0c ||\n c === 0x2e0d ||\n (c >= 0x2e0e && c <= 0x2e16) ||\n c === 0x2e17 ||\n (c >= 0x2e18 && c <= 0x2e19) ||\n c === 0x2e1a ||\n c === 0x2e1b ||\n c === 0x2e1c ||\n c === 0x2e1d ||\n (c >= 0x2e1e && c <= 0x2e1f) ||\n c === 0x2e20 ||\n c === 0x2e21 ||\n c === 0x2e22 ||\n c === 0x2e23 ||\n c === 0x2e24 ||\n c === 0x2e25 ||\n c === 0x2e26 ||\n c === 0x2e27 ||\n c === 0x2e28 ||\n c === 0x2e29 ||\n (c >= 0x2e2a && c <= 0x2e2e) ||\n c === 0x2e2f ||\n (c >= 0x2e30 && c <= 0x2e39) ||\n (c >= 0x2e3a && c <= 0x2e3b) ||\n (c >= 0x2e3c && c <= 0x2e3f) ||\n c === 0x2e40 ||\n c === 0x2e41 ||\n c === 0x2e42 ||\n (c >= 0x2e43 && c <= 0x2e4f) ||\n (c >= 0x2e50 && c <= 0x2e51) ||\n c === 0x2e52 ||\n (c >= 0x2e53 && c <= 0x2e7f) ||\n (c >= 0x3001 && c <= 0x3003) ||\n c === 0x3008 ||\n c === 0x3009 ||\n c === 0x300a ||\n c === 0x300b ||\n c === 0x300c ||\n c === 0x300d ||\n c === 0x300e ||\n c === 0x300f ||\n c === 0x3010 ||\n c === 0x3011 ||\n (c >= 0x3012 && c <= 0x3013) ||\n c === 0x3014 ||\n c === 0x3015 ||\n c === 0x3016 ||\n c === 0x3017 ||\n c === 0x3018 ||\n c === 0x3019 ||\n c === 0x301a ||\n c === 0x301b ||\n c === 0x301c ||\n c === 0x301d ||\n (c >= 0x301e && c <= 0x301f) ||\n c === 0x3020 ||\n c === 0x3030 ||\n c === 0xfd3e ||\n c === 0xfd3f ||\n (c >= 0xfe45 && c <= 0xfe46));\n}\n","// @generated from time-data-gen.ts\n// prettier-ignore \nexport var timeData = {\n \"AX\": [\n \"H\"\n ],\n \"BQ\": [\n \"H\"\n ],\n \"CP\": [\n \"H\"\n ],\n \"CZ\": [\n \"H\"\n ],\n \"DK\": [\n \"H\"\n ],\n \"FI\": [\n \"H\"\n ],\n \"ID\": [\n \"H\"\n ],\n \"IS\": [\n \"H\"\n ],\n \"ML\": [\n \"H\"\n ],\n \"NE\": [\n \"H\"\n ],\n \"RU\": [\n \"H\"\n ],\n \"SE\": [\n \"H\"\n ],\n \"SJ\": [\n \"H\"\n ],\n \"SK\": [\n \"H\"\n ],\n \"AS\": [\n \"h\",\n \"H\"\n ],\n \"BT\": [\n \"h\",\n \"H\"\n ],\n \"DJ\": [\n \"h\",\n \"H\"\n ],\n \"ER\": [\n \"h\",\n \"H\"\n ],\n \"GH\": [\n \"h\",\n \"H\"\n ],\n \"IN\": [\n \"h\",\n \"H\"\n ],\n \"LS\": [\n \"h\",\n \"H\"\n ],\n \"PG\": [\n \"h\",\n \"H\"\n ],\n \"PW\": [\n \"h\",\n \"H\"\n ],\n \"SO\": [\n \"h\",\n \"H\"\n ],\n \"TO\": [\n \"h\",\n \"H\"\n ],\n \"VU\": [\n \"h\",\n \"H\"\n ],\n \"WS\": [\n \"h\",\n \"H\"\n ],\n \"001\": [\n \"H\",\n \"h\"\n ],\n \"AL\": [\n \"h\",\n \"H\",\n \"hB\"\n ],\n \"TD\": [\n \"h\",\n \"H\",\n \"hB\"\n ],\n \"ca-ES\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"CF\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"CM\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"fr-CA\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"gl-ES\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"it-CH\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"it-IT\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"LU\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"NP\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"PF\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"SC\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"SM\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"SN\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"TF\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"VA\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"CY\": [\n \"h\",\n \"H\",\n \"hb\",\n \"hB\"\n ],\n \"GR\": [\n \"h\",\n \"H\",\n \"hb\",\n \"hB\"\n ],\n \"CO\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"DO\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"KP\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"KR\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"NA\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"PA\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"PR\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"VE\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"AC\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"AI\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"BW\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"BZ\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CC\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CK\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CX\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"DG\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"FK\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"GB\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"GG\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"GI\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"IE\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"IM\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"IO\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"JE\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"LT\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"MK\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"MN\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"MS\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NF\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NG\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NR\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NU\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"PN\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"SH\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"SX\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"TA\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"ZA\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"af-ZA\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"AR\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"CL\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"CR\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"CU\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"EA\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-BO\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-BR\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-EC\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-ES\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-GQ\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-PE\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"GT\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"HN\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"IC\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"KG\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"KM\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"LK\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"MA\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"MX\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"NI\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"PY\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"SV\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"UY\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"JP\": [\n \"H\",\n \"h\",\n \"K\"\n ],\n \"AD\": [\n \"H\",\n \"hB\"\n ],\n \"AM\": [\n \"H\",\n \"hB\"\n ],\n \"AO\": [\n \"H\",\n \"hB\"\n ],\n \"AT\": [\n \"H\",\n \"hB\"\n ],\n \"AW\": [\n \"H\",\n \"hB\"\n ],\n \"BE\": [\n \"H\",\n \"hB\"\n ],\n \"BF\": [\n \"H\",\n \"hB\"\n ],\n \"BJ\": [\n \"H\",\n \"hB\"\n ],\n \"BL\": [\n \"H\",\n \"hB\"\n ],\n \"BR\": [\n \"H\",\n \"hB\"\n ],\n \"CG\": [\n \"H\",\n \"hB\"\n ],\n \"CI\": [\n \"H\",\n \"hB\"\n ],\n \"CV\": [\n \"H\",\n \"hB\"\n ],\n \"DE\": [\n \"H\",\n \"hB\"\n ],\n \"EE\": [\n \"H\",\n \"hB\"\n ],\n \"FR\": [\n \"H\",\n \"hB\"\n ],\n \"GA\": [\n \"H\",\n \"hB\"\n ],\n \"GF\": [\n \"H\",\n \"hB\"\n ],\n \"GN\": [\n \"H\",\n \"hB\"\n ],\n \"GP\": [\n \"H\",\n \"hB\"\n ],\n \"GW\": [\n \"H\",\n \"hB\"\n ],\n \"HR\": [\n \"H\",\n \"hB\"\n ],\n \"IL\": [\n \"H\",\n \"hB\"\n ],\n \"IT\": [\n \"H\",\n \"hB\"\n ],\n \"KZ\": [\n \"H\",\n \"hB\"\n ],\n \"MC\": [\n \"H\",\n \"hB\"\n ],\n \"MD\": [\n \"H\",\n \"hB\"\n ],\n \"MF\": [\n \"H\",\n \"hB\"\n ],\n \"MQ\": [\n \"H\",\n \"hB\"\n ],\n \"MZ\": [\n \"H\",\n \"hB\"\n ],\n \"NC\": [\n \"H\",\n \"hB\"\n ],\n \"NL\": [\n \"H\",\n \"hB\"\n ],\n \"PM\": [\n \"H\",\n \"hB\"\n ],\n \"PT\": [\n \"H\",\n \"hB\"\n ],\n \"RE\": [\n \"H\",\n \"hB\"\n ],\n \"RO\": [\n \"H\",\n \"hB\"\n ],\n \"SI\": [\n \"H\",\n \"hB\"\n ],\n \"SR\": [\n \"H\",\n \"hB\"\n ],\n \"ST\": [\n \"H\",\n \"hB\"\n ],\n \"TG\": [\n \"H\",\n \"hB\"\n ],\n \"TR\": [\n \"H\",\n \"hB\"\n ],\n \"WF\": [\n \"H\",\n \"hB\"\n ],\n \"YT\": [\n \"H\",\n \"hB\"\n ],\n \"BD\": [\n \"h\",\n \"hB\",\n \"H\"\n ],\n \"PK\": [\n \"h\",\n \"hB\",\n \"H\"\n ],\n \"AZ\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"BA\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"BG\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"CH\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"GE\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"LI\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"ME\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"RS\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"UA\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"UZ\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"XK\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"AG\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"AU\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BB\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BS\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"CA\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"DM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"en-001\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"FJ\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"FM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GD\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GU\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GY\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"JM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"KI\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"KN\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"KY\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"LC\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"LR\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"MH\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"MP\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"MW\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"NZ\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SB\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SG\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SL\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SS\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SZ\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"TC\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"TT\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"UM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"US\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"VC\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"VG\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"VI\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"ZM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BO\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"EC\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"ES\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"GQ\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"PE\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"AE\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"ar-001\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"BH\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"DZ\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"EG\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"EH\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"HK\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"IQ\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"JO\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"KW\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"LB\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"LY\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"MO\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"MR\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"OM\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"PH\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"PS\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"QA\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"SA\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"SD\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"SY\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"TN\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"YE\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"AF\": [\n \"H\",\n \"hb\",\n \"hB\",\n \"h\"\n ],\n \"LA\": [\n \"H\",\n \"hb\",\n \"hB\",\n \"h\"\n ],\n \"CN\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"LV\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"TL\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"zu-ZA\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"CD\": [\n \"hB\",\n \"H\"\n ],\n \"IR\": [\n \"hB\",\n \"H\"\n ],\n \"hi-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"kn-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"ml-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"te-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"KH\": [\n \"hB\",\n \"h\",\n \"H\",\n \"hb\"\n ],\n \"ta-IN\": [\n \"hB\",\n \"h\",\n \"hb\",\n \"H\"\n ],\n \"BN\": [\n \"hb\",\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"MY\": [\n \"hb\",\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"ET\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"gu-IN\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"mr-IN\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"pa-IN\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"TW\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"KE\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"MM\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"TZ\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"UG\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ]\n};\n","import { timeData } from './time-data.generated';\n/**\n * Returns the best matching date time pattern if a date time skeleton\n * pattern is provided with a locale. Follows the Unicode specification:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#table-mapping-requested-time-skeletons-to-patterns\n * @param skeleton date time skeleton pattern that possibly includes j, J or C\n * @param locale\n */\nexport function getBestPattern(skeleton, locale) {\n var skeletonCopy = '';\n for (var patternPos = 0; patternPos < skeleton.length; patternPos++) {\n var patternChar = skeleton.charAt(patternPos);\n if (patternChar === 'j') {\n var extraLength = 0;\n while (patternPos + 1 < skeleton.length &&\n skeleton.charAt(patternPos + 1) === patternChar) {\n extraLength++;\n patternPos++;\n }\n var hourLen = 1 + (extraLength & 1);\n var dayPeriodLen = extraLength < 2 ? 1 : 3 + (extraLength >> 1);\n var dayPeriodChar = 'a';\n var hourChar = getDefaultHourSymbolFromLocale(locale);\n if (hourChar == 'H' || hourChar == 'k') {\n dayPeriodLen = 0;\n }\n while (dayPeriodLen-- > 0) {\n skeletonCopy += dayPeriodChar;\n }\n while (hourLen-- > 0) {\n skeletonCopy = hourChar + skeletonCopy;\n }\n }\n else if (patternChar === 'J') {\n skeletonCopy += 'H';\n }\n else {\n skeletonCopy += patternChar;\n }\n }\n return skeletonCopy;\n}\n/**\n * Maps the [hour cycle type](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/hourCycle)\n * of the given `locale` to the corresponding time pattern.\n * @param locale\n */\nfunction getDefaultHourSymbolFromLocale(locale) {\n var hourCycle = locale.hourCycle;\n if (hourCycle === undefined &&\n // @ts-ignore hourCycle(s) is not identified yet\n locale.hourCycles &&\n // @ts-ignore\n locale.hourCycles.length) {\n // @ts-ignore\n hourCycle = locale.hourCycles[0];\n }\n if (hourCycle) {\n switch (hourCycle) {\n case 'h24':\n return 'k';\n case 'h23':\n return 'H';\n case 'h12':\n return 'h';\n case 'h11':\n return 'K';\n default:\n throw new Error('Invalid hourCycle');\n }\n }\n // TODO: Once hourCycle is fully supported remove the following with data generation\n var languageTag = locale.language;\n var regionTag;\n if (languageTag !== 'root') {\n regionTag = locale.maximize().region;\n }\n var hourCycles = timeData[regionTag || ''] ||\n timeData[languageTag || ''] ||\n timeData[\"\".concat(languageTag, \"-001\")] ||\n timeData['001'];\n return hourCycles[0];\n}\n","import { __assign } from \"tslib\";\nimport { ErrorKind } from './error';\nimport { Parser } from './parser';\nimport { isDateElement, isDateTimeSkeleton, isNumberElement, isNumberSkeleton, isPluralElement, isSelectElement, isTagElement, isTimeElement, } from './types';\nfunction pruneLocation(els) {\n els.forEach(function (el) {\n delete el.location;\n if (isSelectElement(el) || isPluralElement(el)) {\n for (var k in el.options) {\n delete el.options[k].location;\n pruneLocation(el.options[k].value);\n }\n }\n else if (isNumberElement(el) && isNumberSkeleton(el.style)) {\n delete el.style.location;\n }\n else if ((isDateElement(el) || isTimeElement(el)) &&\n isDateTimeSkeleton(el.style)) {\n delete el.style.location;\n }\n else if (isTagElement(el)) {\n pruneLocation(el.children);\n }\n });\n}\nexport function parse(message, opts) {\n if (opts === void 0) { opts = {}; }\n opts = __assign({ shouldParseSkeletons: true, requiresOtherClause: true }, opts);\n var result = new Parser(message, opts).parse();\n if (result.err) {\n var error = SyntaxError(ErrorKind[result.err.kind]);\n // @ts-expect-error Assign to error object\n error.location = result.err.location;\n // @ts-expect-error Assign to error object\n error.originalMessage = result.err.message;\n throw error;\n }\n if (!(opts === null || opts === void 0 ? void 0 : opts.captureLocation)) {\n pruneLocation(result.val);\n }\n return result.val;\n}\nexport * from './types';\n","//\n// Main\n//\nexport default function memoize(fn, options) {\n var cache = options && options.cache ? options.cache : cacheDefault;\n var serializer = options && options.serializer ? options.serializer : serializerDefault;\n var strategy = options && options.strategy ? options.strategy : strategyDefault;\n return strategy(fn, {\n cache: cache,\n serializer: serializer,\n });\n}\n//\n// Strategy\n//\nfunction isPrimitive(value) {\n return (value == null || typeof value === 'number' || typeof value === 'boolean'); // || typeof value === \"string\" 'unsafe' primitive for our needs\n}\nfunction monadic(fn, cache, serializer, arg) {\n var cacheKey = isPrimitive(arg) ? arg : serializer(arg);\n var computedValue = cache.get(cacheKey);\n if (typeof computedValue === 'undefined') {\n computedValue = fn.call(this, arg);\n cache.set(cacheKey, computedValue);\n }\n return computedValue;\n}\nfunction variadic(fn, cache, serializer) {\n var args = Array.prototype.slice.call(arguments, 3);\n var cacheKey = serializer(args);\n var computedValue = cache.get(cacheKey);\n if (typeof computedValue === 'undefined') {\n computedValue = fn.apply(this, args);\n cache.set(cacheKey, computedValue);\n }\n return computedValue;\n}\nfunction assemble(fn, context, strategy, cache, serialize) {\n return strategy.bind(context, fn, cache, serialize);\n}\nfunction strategyDefault(fn, options) {\n var strategy = fn.length === 1 ? monadic : variadic;\n return assemble(fn, this, strategy, options.cache.create(), options.serializer);\n}\nfunction strategyVariadic(fn, options) {\n return assemble(fn, this, variadic, options.cache.create(), options.serializer);\n}\nfunction strategyMonadic(fn, options) {\n return assemble(fn, this, monadic, options.cache.create(), options.serializer);\n}\n//\n// Serializer\n//\nvar serializerDefault = function () {\n return JSON.stringify(arguments);\n};\n//\n// Cache\n//\nfunction ObjectWithoutPrototypeCache() {\n this.cache = Object.create(null);\n}\nObjectWithoutPrototypeCache.prototype.get = function (key) {\n return this.cache[key];\n};\nObjectWithoutPrototypeCache.prototype.set = function (key, value) {\n this.cache[key] = value;\n};\nvar cacheDefault = {\n create: function create() {\n // @ts-ignore\n return new ObjectWithoutPrototypeCache();\n },\n};\nexport var strategies = {\n variadic: strategyVariadic,\n monadic: strategyMonadic,\n};\n","import { __extends } from \"tslib\";\nexport var ErrorCode;\n(function (ErrorCode) {\n // When we have a placeholder but no value to format\n ErrorCode[\"MISSING_VALUE\"] = \"MISSING_VALUE\";\n // When value supplied is invalid\n ErrorCode[\"INVALID_VALUE\"] = \"INVALID_VALUE\";\n // When we need specific Intl API but it's not available\n ErrorCode[\"MISSING_INTL_API\"] = \"MISSING_INTL_API\";\n})(ErrorCode || (ErrorCode = {}));\nvar FormatError = /** @class */ (function (_super) {\n __extends(FormatError, _super);\n function FormatError(msg, code, originalMessage) {\n var _this = _super.call(this, msg) || this;\n _this.code = code;\n _this.originalMessage = originalMessage;\n return _this;\n }\n FormatError.prototype.toString = function () {\n return \"[formatjs Error: \".concat(this.code, \"] \").concat(this.message);\n };\n return FormatError;\n}(Error));\nexport { FormatError };\nvar InvalidValueError = /** @class */ (function (_super) {\n __extends(InvalidValueError, _super);\n function InvalidValueError(variableId, value, options, originalMessage) {\n return _super.call(this, \"Invalid values for \\\"\".concat(variableId, \"\\\": \\\"\").concat(value, \"\\\". Options are \\\"\").concat(Object.keys(options).join('\", \"'), \"\\\"\"), ErrorCode.INVALID_VALUE, originalMessage) || this;\n }\n return InvalidValueError;\n}(FormatError));\nexport { InvalidValueError };\nvar InvalidValueTypeError = /** @class */ (function (_super) {\n __extends(InvalidValueTypeError, _super);\n function InvalidValueTypeError(value, type, originalMessage) {\n return _super.call(this, \"Value for \\\"\".concat(value, \"\\\" must be of type \").concat(type), ErrorCode.INVALID_VALUE, originalMessage) || this;\n }\n return InvalidValueTypeError;\n}(FormatError));\nexport { InvalidValueTypeError };\nvar MissingValueError = /** @class */ (function (_super) {\n __extends(MissingValueError, _super);\n function MissingValueError(variableId, originalMessage) {\n return _super.call(this, \"The intl string context variable \\\"\".concat(variableId, \"\\\" was not provided to the string \\\"\").concat(originalMessage, \"\\\"\"), ErrorCode.MISSING_VALUE, originalMessage) || this;\n }\n return MissingValueError;\n}(FormatError));\nexport { MissingValueError };\n","import { isArgumentElement, isDateElement, isDateTimeSkeleton, isLiteralElement, isNumberElement, isNumberSkeleton, isPluralElement, isPoundElement, isSelectElement, isTimeElement, isTagElement, } from '@formatjs/icu-messageformat-parser';\nimport { MissingValueError, InvalidValueError, ErrorCode, FormatError, InvalidValueTypeError, } from './error';\nexport var PART_TYPE;\n(function (PART_TYPE) {\n PART_TYPE[PART_TYPE[\"literal\"] = 0] = \"literal\";\n PART_TYPE[PART_TYPE[\"object\"] = 1] = \"object\";\n})(PART_TYPE || (PART_TYPE = {}));\nfunction mergeLiteral(parts) {\n if (parts.length < 2) {\n return parts;\n }\n return parts.reduce(function (all, part) {\n var lastPart = all[all.length - 1];\n if (!lastPart ||\n lastPart.type !== PART_TYPE.literal ||\n part.type !== PART_TYPE.literal) {\n all.push(part);\n }\n else {\n lastPart.value += part.value;\n }\n return all;\n }, []);\n}\nexport function isFormatXMLElementFn(el) {\n return typeof el === 'function';\n}\n// TODO(skeleton): add skeleton support\nexport function formatToParts(els, locales, formatters, formats, values, currentPluralValue, \n// For debugging\noriginalMessage) {\n // Hot path for straight simple msg translations\n if (els.length === 1 && isLiteralElement(els[0])) {\n return [\n {\n type: PART_TYPE.literal,\n value: els[0].value,\n },\n ];\n }\n var result = [];\n for (var _i = 0, els_1 = els; _i < els_1.length; _i++) {\n var el = els_1[_i];\n // Exit early for string parts.\n if (isLiteralElement(el)) {\n result.push({\n type: PART_TYPE.literal,\n value: el.value,\n });\n continue;\n }\n // TODO: should this part be literal type?\n // Replace `#` in plural rules with the actual numeric value.\n if (isPoundElement(el)) {\n if (typeof currentPluralValue === 'number') {\n result.push({\n type: PART_TYPE.literal,\n value: formatters.getNumberFormat(locales).format(currentPluralValue),\n });\n }\n continue;\n }\n var varName = el.value;\n // Enforce that all required values are provided by the caller.\n if (!(values && varName in values)) {\n throw new MissingValueError(varName, originalMessage);\n }\n var value = values[varName];\n if (isArgumentElement(el)) {\n if (!value || typeof value === 'string' || typeof value === 'number') {\n value =\n typeof value === 'string' || typeof value === 'number'\n ? String(value)\n : '';\n }\n result.push({\n type: typeof value === 'string' ? PART_TYPE.literal : PART_TYPE.object,\n value: value,\n });\n continue;\n }\n // Recursively format plural and select parts' option — which can be a\n // nested pattern structure. The choosing of the option to use is\n // abstracted-by and delegated-to the part helper object.\n if (isDateElement(el)) {\n var style = typeof el.style === 'string'\n ? formats.date[el.style]\n : isDateTimeSkeleton(el.style)\n ? el.style.parsedOptions\n : undefined;\n result.push({\n type: PART_TYPE.literal,\n value: formatters\n .getDateTimeFormat(locales, style)\n .format(value),\n });\n continue;\n }\n if (isTimeElement(el)) {\n var style = typeof el.style === 'string'\n ? formats.time[el.style]\n : isDateTimeSkeleton(el.style)\n ? el.style.parsedOptions\n : formats.time.medium;\n result.push({\n type: PART_TYPE.literal,\n value: formatters\n .getDateTimeFormat(locales, style)\n .format(value),\n });\n continue;\n }\n if (isNumberElement(el)) {\n var style = typeof el.style === 'string'\n ? formats.number[el.style]\n : isNumberSkeleton(el.style)\n ? el.style.parsedOptions\n : undefined;\n if (style && style.scale) {\n value =\n value *\n (style.scale || 1);\n }\n result.push({\n type: PART_TYPE.literal,\n value: formatters\n .getNumberFormat(locales, style)\n .format(value),\n });\n continue;\n }\n if (isTagElement(el)) {\n var children = el.children, value_1 = el.value;\n var formatFn = values[value_1];\n if (!isFormatXMLElementFn(formatFn)) {\n throw new InvalidValueTypeError(value_1, 'function', originalMessage);\n }\n var parts = formatToParts(children, locales, formatters, formats, values, currentPluralValue);\n var chunks = formatFn(parts.map(function (p) { return p.value; }));\n if (!Array.isArray(chunks)) {\n chunks = [chunks];\n }\n result.push.apply(result, chunks.map(function (c) {\n return {\n type: typeof c === 'string' ? PART_TYPE.literal : PART_TYPE.object,\n value: c,\n };\n }));\n }\n if (isSelectElement(el)) {\n var opt = el.options[value] || el.options.other;\n if (!opt) {\n throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage);\n }\n result.push.apply(result, formatToParts(opt.value, locales, formatters, formats, values));\n continue;\n }\n if (isPluralElement(el)) {\n var opt = el.options[\"=\".concat(value)];\n if (!opt) {\n if (!Intl.PluralRules) {\n throw new FormatError(\"Intl.PluralRules is not available in this environment.\\nTry polyfilling it using \\\"@formatjs/intl-pluralrules\\\"\\n\", ErrorCode.MISSING_INTL_API, originalMessage);\n }\n var rule = formatters\n .getPluralRules(locales, { type: el.pluralType })\n .select(value - (el.offset || 0));\n opt = el.options[rule] || el.options.other;\n }\n if (!opt) {\n throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage);\n }\n result.push.apply(result, formatToParts(opt.value, locales, formatters, formats, values, value - (el.offset || 0)));\n continue;\n }\n }\n return mergeLiteral(result);\n}\n","/*\nCopyright (c) 2014, Yahoo! Inc. All rights reserved.\nCopyrights licensed under the New BSD License.\nSee the accompanying LICENSE file for terms.\n*/\nimport { __assign, __spreadArray } from \"tslib\";\nimport { parse } from '@formatjs/icu-messageformat-parser';\nimport memoize, { strategies } from '@formatjs/fast-memoize';\nimport { formatToParts, PART_TYPE, } from './formatters';\n// -- MessageFormat --------------------------------------------------------\nfunction mergeConfig(c1, c2) {\n if (!c2) {\n return c1;\n }\n return __assign(__assign(__assign({}, (c1 || {})), (c2 || {})), Object.keys(c1).reduce(function (all, k) {\n all[k] = __assign(__assign({}, c1[k]), (c2[k] || {}));\n return all;\n }, {}));\n}\nfunction mergeConfigs(defaultConfig, configs) {\n if (!configs) {\n return defaultConfig;\n }\n return Object.keys(defaultConfig).reduce(function (all, k) {\n all[k] = mergeConfig(defaultConfig[k], configs[k]);\n return all;\n }, __assign({}, defaultConfig));\n}\nfunction createFastMemoizeCache(store) {\n return {\n create: function () {\n return {\n get: function (key) {\n return store[key];\n },\n set: function (key, value) {\n store[key] = value;\n },\n };\n },\n };\n}\nfunction createDefaultFormatters(cache) {\n if (cache === void 0) { cache = {\n number: {},\n dateTime: {},\n pluralRules: {},\n }; }\n return {\n getNumberFormat: memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.number),\n strategy: strategies.variadic,\n }),\n getDateTimeFormat: memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.dateTime),\n strategy: strategies.variadic,\n }),\n getPluralRules: memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.pluralRules),\n strategy: strategies.variadic,\n }),\n };\n}\nvar IntlMessageFormat = /** @class */ (function () {\n function IntlMessageFormat(message, locales, overrideFormats, opts) {\n var _this = this;\n if (locales === void 0) { locales = IntlMessageFormat.defaultLocale; }\n this.formatterCache = {\n number: {},\n dateTime: {},\n pluralRules: {},\n };\n this.format = function (values) {\n var parts = _this.formatToParts(values);\n // Hot path for straight simple msg translations\n if (parts.length === 1) {\n return parts[0].value;\n }\n var result = parts.reduce(function (all, part) {\n if (!all.length ||\n part.type !== PART_TYPE.literal ||\n typeof all[all.length - 1] !== 'string') {\n all.push(part.value);\n }\n else {\n all[all.length - 1] += part.value;\n }\n return all;\n }, []);\n if (result.length <= 1) {\n return result[0] || '';\n }\n return result;\n };\n this.formatToParts = function (values) {\n return formatToParts(_this.ast, _this.locales, _this.formatters, _this.formats, values, undefined, _this.message);\n };\n this.resolvedOptions = function () { return ({\n locale: _this.resolvedLocale.toString(),\n }); };\n this.getAst = function () { return _this.ast; };\n // Defined first because it's used to build the format pattern.\n this.locales = locales;\n this.resolvedLocale = IntlMessageFormat.resolveLocale(locales);\n if (typeof message === 'string') {\n this.message = message;\n if (!IntlMessageFormat.__parse) {\n throw new TypeError('IntlMessageFormat.__parse must be set to process `message` of type `string`');\n }\n // Parse string messages into an AST.\n this.ast = IntlMessageFormat.__parse(message, {\n ignoreTag: opts === null || opts === void 0 ? void 0 : opts.ignoreTag,\n locale: this.resolvedLocale,\n });\n }\n else {\n this.ast = message;\n }\n if (!Array.isArray(this.ast)) {\n throw new TypeError('A message must be provided as a String or AST.');\n }\n // Creates a new object with the specified `formats` merged with the default\n // formats.\n this.formats = mergeConfigs(IntlMessageFormat.formats, overrideFormats);\n this.formatters =\n (opts && opts.formatters) || createDefaultFormatters(this.formatterCache);\n }\n Object.defineProperty(IntlMessageFormat, \"defaultLocale\", {\n get: function () {\n if (!IntlMessageFormat.memoizedDefaultLocale) {\n IntlMessageFormat.memoizedDefaultLocale =\n new Intl.NumberFormat().resolvedOptions().locale;\n }\n return IntlMessageFormat.memoizedDefaultLocale;\n },\n enumerable: false,\n configurable: true\n });\n IntlMessageFormat.memoizedDefaultLocale = null;\n IntlMessageFormat.resolveLocale = function (locales) {\n var supportedLocales = Intl.NumberFormat.supportedLocalesOf(locales);\n if (supportedLocales.length > 0) {\n return new Intl.Locale(supportedLocales[0]);\n }\n return new Intl.Locale(typeof locales === 'string' ? locales : locales[0]);\n };\n IntlMessageFormat.__parse = parse;\n // Default format options used as the prototype of the `formats` provided to the\n // constructor. These are used when constructing the internal Intl.NumberFormat\n // and Intl.DateTimeFormat instances.\n IntlMessageFormat.formats = {\n number: {\n integer: {\n maximumFractionDigits: 0,\n },\n currency: {\n style: 'currency',\n },\n percent: {\n style: 'percent',\n },\n },\n date: {\n short: {\n month: 'numeric',\n day: 'numeric',\n year: '2-digit',\n },\n medium: {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n },\n long: {\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n },\n full: {\n weekday: 'long',\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n },\n },\n time: {\n short: {\n hour: 'numeric',\n minute: 'numeric',\n },\n medium: {\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n },\n long: {\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n timeZoneName: 'short',\n },\n full: {\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n timeZoneName: 'short',\n },\n },\n };\n return IntlMessageFormat;\n}());\nexport { IntlMessageFormat };\n","/*\nCopyright (c) 2014, Yahoo! Inc. All rights reserved.\nCopyrights licensed under the New BSD License.\nSee the accompanying LICENSE file for terms.\n*/\nimport { IntlMessageFormat } from './src/core';\nexport * from './src/formatters';\nexport * from './src/core';\nexport * from './src/error';\nexport default IntlMessageFormat;\n","import{writable as e,derived as n}from\"svelte/store\";import t from\"deepmerge\";import o from\"intl-messageformat\";const r={},i=(e,n,t)=>t?(n in r||(r[n]={}),e in r[n]||(r[n][e]=t),t):t,l=(e,n)=>{if(null==n)return;if(n in r&&e in r[n])return r[n][e];const t=E(n);for(let o=0;o<t.length;o++){const r=c(t[o],e);if(r)return i(e,n,r)}};let a;const s=e({});function u(e){return e in a}function c(e,n){if(!u(e))return null;const t=function(e){return a[e]||null}(e);return function(e,n){if(null==n)return;if(n in e)return e[n];const t=n.split(\".\");let o=e;for(let e=0;e<t.length;e++)if(\"object\"==typeof o){if(e>0){const n=t.slice(e,t.length).join(\".\");if(n in o){o=o[n];break}}o=o[t[e]]}else o=void 0;return o}(t,n)}function m(e,...n){delete r[e],s.update((o=>(o[e]=t.all([o[e]||{},...n]),o)))}const f=n([s],(([e])=>Object.keys(e)));s.subscribe((e=>a=e));const d={};function g(e){return d[e]}function h(e){return null!=e&&E(e).some((e=>{var n;return null===(n=g(e))||void 0===n?void 0:n.size}))}function w(e,n){const t=Promise.all(n.map((n=>(function(e,n){d[e].delete(n),0===d[e].size&&delete d[e]}(e,n),n().then((e=>e.default||e))))));return t.then((n=>m(e,...n)))}const p={};function b(e){if(!h(e))return e in p?p[e]:Promise.resolve();const n=function(e){return E(e).map((e=>{const n=g(e);return[e,n?[...n]:[]]})).filter((([,e])=>e.length>0))}(e);return p[e]=Promise.all(n.map((([e,n])=>w(e,n)))).then((()=>{if(h(e))return b(e);delete p[e]})),p[e]}function y(e,n){g(e)||function(e){d[e]=new Set}(e);const t=g(e);g(e).has(n)||(u(e)||s.update((n=>(n[e]={},n))),t.add(n))}\n/*! *****************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */function v(e,n){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&\"function\"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)n.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(t[o[r]]=e[o[r]])}return t}function O({locale:e,id:n}){console.warn(`[svelte-i18n] The message \"${n}\" was not found in \"${E(e).join('\", \"')}\".${h(P())?\"\\n\\nNote: there are at least one loader still registered to this locale that wasn't executed.\":\"\"}`)}const j={fallbackLocale:null,loadingDelay:200,formats:{number:{scientific:{notation:\"scientific\"},engineering:{notation:\"engineering\"},compactLong:{notation:\"compact\",compactDisplay:\"long\"},compactShort:{notation:\"compact\",compactDisplay:\"short\"}},date:{short:{month:\"numeric\",day:\"numeric\",year:\"2-digit\"},medium:{month:\"short\",day:\"numeric\",year:\"numeric\"},long:{month:\"long\",day:\"numeric\",year:\"numeric\"},full:{weekday:\"long\",month:\"long\",day:\"numeric\",year:\"numeric\"}},time:{short:{hour:\"numeric\",minute:\"numeric\"},medium:{hour:\"numeric\",minute:\"numeric\",second:\"numeric\"},long:{hour:\"numeric\",minute:\"numeric\",second:\"numeric\",timeZoneName:\"short\"},full:{hour:\"numeric\",minute:\"numeric\",second:\"numeric\",timeZoneName:\"short\"}}},warnOnMissingMessages:!0,handleMissingMessage:void 0,ignoreTag:!0};function M(){return j}function $(e){const{formats:n}=e,t=v(e,[\"formats\"]),o=e.initialLocale||e.fallbackLocale;return t.warnOnMissingMessages&&(delete t.warnOnMissingMessages,null==t.handleMissingMessage?t.handleMissingMessage=O:console.warn('[svelte-i18n] The \"warnOnMissingMessages\" option is deprecated. Please use the \"handleMissingMessage\" option instead.')),Object.assign(j,t,{initialLocale:o}),n&&(\"number\"in n&&Object.assign(j.formats.number,n.number),\"date\"in n&&Object.assign(j.formats.date,n.date),\"time\"in n&&Object.assign(j.formats.time,n.time)),D.set(o)}const k=e(!1);let T;const L=e(null);function x(e){return e.split(\"-\").map(((e,n,t)=>t.slice(0,n+1).join(\"-\"))).reverse()}function E(e,n=M().fallbackLocale){const t=x(e);return n?[...new Set([...t,...x(n)])]:t}function P(){return null!=T?T:void 0}L.subscribe((e=>{T=null!=e?e:void 0,\"undefined\"!=typeof window&&null!=e&&document.documentElement.setAttribute(\"lang\",e)}));const D=Object.assign(Object.assign({},L),{set:e=>{if(e&&function(e){if(null==e)return;const n=E(e);for(let e=0;e<n.length;e++){const t=n[e];if(u(t))return t}}(e)&&h(e)){const{loadingDelay:n}=M();let t;return\"undefined\"!=typeof window&&null!=P()&&n?t=window.setTimeout((()=>k.set(!0)),n):k.set(!0),b(e).then((()=>{L.set(e)})).finally((()=>{clearTimeout(t),k.set(!1)}))}return L.set(e)}}),S=(e,n)=>{const t=e.split(\"&\").find((e=>0===e.indexOf(`${n}=`)));return t?t.split(\"=\").pop():null},N=(e,n)=>{const t=n.exec(e);return t&&t[1]||null},A=e=>\"undefined\"==typeof window?null:N(window.location.hostname,e),I=e=>\"undefined\"==typeof window?null:N(window.location.pathname,e),F=()=>\"undefined\"==typeof window?null:window.navigator.language||window.navigator.languages[0],z=e=>\"undefined\"==typeof window?null:S(window.location.search.substr(1),e),Z=e=>\"undefined\"==typeof window?null:S(window.location.hash.substr(1),e),C=e=>{const n=Object.create(null);return t=>{const o=JSON.stringify(t);return o in n?n[o]:n[o]=e(t)}},G=(e,n)=>{const{formats:t}=M();if(e in t&&n in t[e])return t[e][n];throw new Error(`[svelte-i18n] Unknown \"${n}\" ${e} format.`)},J=C((e=>{var{locale:n,format:t}=e,o=v(e,[\"locale\",\"format\"]);if(null==n)throw new Error('[svelte-i18n] A \"locale\" must be set to format numbers');return t&&(o=G(\"number\",t)),new Intl.NumberFormat(n,o)})),U=C((e=>{var{locale:n,format:t}=e,o=v(e,[\"locale\",\"format\"]);if(null==n)throw new Error('[svelte-i18n] A \"locale\" must be set to format dates');return t?o=G(\"date\",t):0===Object.keys(o).length&&(o=G(\"date\",\"short\")),new Intl.DateTimeFormat(n,o)})),V=C((e=>{var{locale:n,format:t}=e,o=v(e,[\"locale\",\"format\"]);if(null==n)throw new Error('[svelte-i18n] A \"locale\" must be set to format time values');return t?o=G(\"time\",t):0===Object.keys(o).length&&(o=G(\"time\",\"short\")),new Intl.DateTimeFormat(n,o)})),_=(e={})=>{var{locale:n=P()}=e,t=v(e,[\"locale\"]);return J(Object.assign({locale:n},t))},q=(e={})=>{var{locale:n=P()}=e,t=v(e,[\"locale\"]);return U(Object.assign({locale:n},t))},B=(e={})=>{var{locale:n=P()}=e,t=v(e,[\"locale\"]);return V(Object.assign({locale:n},t))},H=C(((e,n=P())=>new o(e,n,M().formats,{ignoreTag:M().ignoreTag}))),K=(e,n={})=>{var t,o,r,i;let a=n;\"object\"==typeof e&&(a=e,e=a.id);const{values:s,locale:u=P(),default:c}=a;if(null==u)throw new Error(\"[svelte-i18n] Cannot format a message without first setting the initial locale.\");let m=l(e,u);if(m){if(\"string\"!=typeof m)return console.warn(`[svelte-i18n] Message with id \"${e}\" must be of type \"string\", found: \"${typeof m}\". Gettin its value through the \"$format\" method is deprecated; use the \"json\" method instead.`),m}else m=null!==(i=null!==(r=null===(o=(t=M()).handleMissingMessage)||void 0===o?void 0:o.call(t,{locale:u,id:e,defaultValue:c}))&&void 0!==r?r:c)&&void 0!==i?i:e;if(!s)return m;let f=m;try{f=H(m,u).format(s)}catch(n){console.warn(`[svelte-i18n] Message \"${e}\" has syntax error:`,n.message)}return f},Q=(e,n)=>B(n).format(e),R=(e,n)=>q(n).format(e),W=(e,n)=>_(n).format(e),X=(e,n=P())=>l(e,n),Y=n([D,s],(()=>K)),ee=n([D],(()=>Q)),ne=n([D],(()=>R)),te=n([D],(()=>W)),oe=n([D,s],(()=>X));function re(e){return e}function ie(e){return b(e||P()||M().initialLocale)}export{Y as _,m as addMessages,ne as date,re as defineMessages,s as dictionary,Y as format,q as getDateFormatter,Z as getLocaleFromHash,A as getLocaleFromHostname,F as getLocaleFromNavigator,I as getLocaleFromPathname,z as getLocaleFromQueryString,H as getMessageFormatter,_ as getNumberFormatter,B as getTimeFormatter,$ as init,k as isLoading,oe as json,D as locale,f as locales,te as number,y as register,Y as t,ee as time,ie as waitLocale};\n","'use strict';\n\nimport fetch from 'isomorphic-fetch';\nimport { topic } from './communication';\nexport { _, setupI18n } from './i18n';\n\nconst REQUEST_STATUS_SUCCESS = 'success';\nconst REQUEST_STATUS_ERROR = 'error';\n\nconst outgoingRequests = {};\nconst cacheStore = {};\nconst outgoingRequestsParsedBody = {};\n\nwindow.emWidgets = { topic };\n\nconst resType = 'json';\n\nconst getResponseFromCache = (cacheKey) => {\n return new Promise((resolve, reject) => {\n if (cacheStore[cacheKey] && cacheStore[cacheKey].response) {\n return resolve(cacheStore[cacheKey].response);\n }\n\n return reject(new Error(`Unable to access cache for: ${cacheStore[cacheKey]}`));\n });\n}\n\nconst checkStatus = (response) => {\n if (response.status < 200 || response.status >= 400) {\n // TODO we need a global error handler here\n throw new Error(`Error on request \"${response.url}\" (${response.status}: ${response.statusText})`);\n }\n\n return response;\n}\n\nconst storeResponseInCache = (res, cacheKey) => {\n delete outgoingRequestsParsedBody[cacheKey];\n\n cacheStore[cacheKey] = {\n response: res\n };\n\n return cacheStore[cacheKey].response;\n}\n\n// Internal use only\nconst validateFields = (config, required_fields, optional_fields, null_valid, zero_valid, empty_valid) => {\n let invalid_fields = [];\n let isOptional = false;\n\n required_fields.forEach((field) => {\n if (optional_fields.includes(field)) {\n isOptional = true;\n }\n\n if (field in config) {\n switch (config[field]) {\n case undefined:\n if (isOptional) {\n console.warn(field + ' exists but is undefined!');\n } else {\n console.error(field + ' exists but is undefined!');\n\n invalid_fields.push(field);\n }\n\n break;\n\n case '':\n if (isOptional) {\n console.warn(field + ' exists but is empty!');\n } else {\n console.error(field + ' exists but is empty!');\n\n if (empty_valid) {\n invalid_fields.push(field);\n }\n }\n\n break;\n\n case null:\n if (isOptional) {\n console.warn(field + ' exists but is null');\n } else {\n console.error(field + ' exists but is null');\n\n if (null_valid) {\n invalid_fields.push(field);\n }\n }\n\n break;\n\n case 0:\n if (isOptional) {\n console.warn(field + ' exists and the value is 0');\n } else {\n console.error(field + ' exists and the value is 0');\n\n if (zero_valid) {\n invalid_fields.push(field);\n }\n }\n\n break;\n\n default:\n // Nothing to do here :)\n break;\n }\n } else {\n console.error(field + \" doesn't exist in ConfigObject\");\n\n invalid_fields.push(field);\n }\n });\n\n return invalid_fields;\n}\n\n// start update section - recursively update customOperator object with data provided by client\nconst updateCustomOperatorObj = (targetObj, updateObj) => {\n for (let [key,value] of Object.entries(updateObj)) {\n // if targetObj has the relevant key and the type in targetObj and updateObj is the same\n if (targetObj.hasOwnProperty(key) && typeof(value) === typeof(targetObj[key])) {\n // update value if string,number or boolean\n if (['string','number','boolean'].includes(typeof value) || Array.isArray(value)) {\n targetObj[key] = value;\n } else {\n // if type is object then go one level deeper\n if (typeof value === 'object') {\n updateCustomOperatorObj(targetObj[key], value);\n }\n }\n }\n }\n}\n\n/**\n * @name xhrFetch\n * @description An overlay over fetch method to allow caching\n * @param url String - The URL you want to query\n * @param options Object -\n method(String): GET/POST/PUT/DELETE\n headers(Object): Request header params\n body(Object): Request body params\n @param cache Boolean - Variable to tell XHRFetch to cache or not the request\n*/\nexport const xhrFetch = (url, options = {}, cache = true) => {\n const cacheKey = `${url}`;\n const {\n method = 'GET',\n headers = {},\n body = {}\n } = options;\n const reqHeaders = new Headers();\n\n Object.keys(headers).forEach((item) => {\n reqHeaders.append(item, headers[item]);\n });\n\n reqHeaders.append('accept', 'application/json');\n reqHeaders.append('Content-Type', 'application/json');\n\n const reqOpts = {\n method,\n headers: reqHeaders\n };\n\n if (method === 'POST' || method === 'PUT') {\n reqOpts.body = JSON.stringify(body);\n }\n\n const request = new Request(url, reqOpts);\n\n let fetchPromise;\n\n if (cache === true && cacheStore[cacheKey]) {\n return getResponseFromCache(cacheKey);\n }\n\n if (outgoingRequests[cacheKey]) {\n fetchPromise = outgoingRequests[cacheKey];\n } else {\n fetchPromise = fetch(request);\n\n outgoingRequests[cacheKey] = fetchPromise;\n }\n\n return fetchPromise\n .then(checkStatus)\n .catch((err) => {\n return Promise.reject(err);\n })\n .then((res) => {\n delete outgoingRequests[cacheKey];\n\n if (!res.bodyUsed) {\n outgoingRequestsParsedBody[cacheKey] = res[resType]();\n }\n\n return outgoingRequestsParsedBody[cacheKey];\n })\n .then((res) => {\n return storeResponseInCache(res, cacheKey);\n });\n}\n\n/**\n * @name isMobile\n * @description A method that returns if the browser used to access the app is from a mobile device or not\n * @param {String} userAgent window.navigator.userAgent\n * @returns {Boolean} true or false\n */\nexport const isMobile = (userAgent) => {\n return !!(\n userAgent.toLowerCase().match(/android/i) ||\n userAgent.toLowerCase().match(/blackberry|bb/i) ||\n userAgent.toLowerCase().match(/iphone|ipad|ipod/i) ||\n userAgent.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i)\n );\n}\n\n/**\n * @name getDevice\n * @description A method that returns the type of the device\n * @param {String} userAgent window.navigator.userAgent\n * @returns {String} Android/iPhone/iPad/PC\n */\nexport const getDevice = (userAgent) => {\n if (userAgent.toLowerCase().match(/android/i)) {\n return 'Android';\n }\n\n if (userAgent.toLowerCase().match(/iphone/i)) {\n return 'iPhone';\n }\n\n if (userAgent.toLowerCase().match(/ipad|ipod/i)) {\n return 'iPad';\n }\n\n return 'PC';\n}\n\n/**\n * @name checkConfig\n * @description\n * @param\n * @returns {Boolean} true or false\n */\nexport const checkConfig = (config) => {\n // fields to validate\n let fields = ['endpointURL', 'dataSource'];\n let optional = ['dataSource'];\n let invalid = validateFields(config, fields, optional, true, true, true);\n\n if (invalid.length > 0) {\n return false;\n }\n\n return true;\n}\n\n/**\n * @name getCustomOperatorData\n * @description This should be deprecated\n * @param\n * @returns {Object}\n */\nexport const getCustomOperatorData = () => {\n updateCustomOperatorObj(customOperator, window.widgetConfig);\n\n return customOperator;\n}\n\n// separate favorites array into mobile and desktop favorites\nexport function platformFavorite(initialArray, updatedArray) {\n let userAgent = window.navigator.userAgent;\n // make sure to display favored games specific to the platform used\n if (isMobile(userAgent)) {\n updatedArray = initialArray.filter(favItem => {\n if (favItem.gameModel) {\n if (favItem.gameModel.platform.includes(\"iPad\") || favItem.gameModel.platform.includes(\"iPhone\") || favItem.gameModel.platform.includes(\"Android\")) {\n return favItem;\n }\n }\n });\n } else {\n updatedArray = initialArray.filter(favItem => {\n if (favItem.gameModel) {\n if (favItem.gameModel.platform.includes(\"PC\")) {\n return favItem;\n }\n }\n });\n }\n return updatedArray;\n}\n\nexport function checkSession(endpoint, session) {\n return new Promise((resolve, reject) => {\n let reqHeaders = new Headers();\n\n reqHeaders.append('X-SessionID', session);\n\n let options = {\n method: 'GET',\n headers: reqHeaders\n };\n\n fetch(`${endpoint}/player/session/player`, options)\n .then((res) => res.json())\n .then((data) => resolve(data))\n .catch((err) => reject(err));\n });\n}\n","//! moment.js\n//! version : 2.29.3\n//! authors : Tim Wood, Iskren Chernev, Moment.js contributors\n//! license : MIT\n//! momentjs.com\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n global.moment = factory()\n}(this, (function () { 'use strict';\n\n var hookCallback;\n\n function hooks() {\n return hookCallback.apply(null, arguments);\n }\n\n // This is done to register the method called with moment()\n // without creating circular dependencies.\n function setHookCallback(callback) {\n hookCallback = callback;\n }\n\n function isArray(input) {\n return (\n input instanceof Array ||\n Object.prototype.toString.call(input) === '[object Array]'\n );\n }\n\n function isObject(input) {\n // IE8 will treat undefined and null as object if it wasn't for\n // input != null\n return (\n input != null &&\n Object.prototype.toString.call(input) === '[object Object]'\n );\n }\n\n function hasOwnProp(a, b) {\n return Object.prototype.hasOwnProperty.call(a, b);\n }\n\n function isObjectEmpty(obj) {\n if (Object.getOwnPropertyNames) {\n return Object.getOwnPropertyNames(obj).length === 0;\n } else {\n var k;\n for (k in obj) {\n if (hasOwnProp(obj, k)) {\n return false;\n }\n }\n return true;\n }\n }\n\n function isUndefined(input) {\n return input === void 0;\n }\n\n function isNumber(input) {\n return (\n typeof input === 'number' ||\n Object.prototype.toString.call(input) === '[object Number]'\n );\n }\n\n function isDate(input) {\n return (\n input instanceof Date ||\n Object.prototype.toString.call(input) === '[object Date]'\n );\n }\n\n function map(arr, fn) {\n var res = [],\n i,\n arrLen = arr.length;\n for (i = 0; i < arrLen; ++i) {\n res.push(fn(arr[i], i));\n }\n return res;\n }\n\n function extend(a, b) {\n for (var i in b) {\n if (hasOwnProp(b, i)) {\n a[i] = b[i];\n }\n }\n\n if (hasOwnProp(b, 'toString')) {\n a.toString = b.toString;\n }\n\n if (hasOwnProp(b, 'valueOf')) {\n a.valueOf = b.valueOf;\n }\n\n return a;\n }\n\n function createUTC(input, format, locale, strict) {\n return createLocalOrUTC(input, format, locale, strict, true).utc();\n }\n\n function defaultParsingFlags() {\n // We need to deep clone this object.\n return {\n empty: false,\n unusedTokens: [],\n unusedInput: [],\n overflow: -2,\n charsLeftOver: 0,\n nullInput: false,\n invalidEra: null,\n invalidMonth: null,\n invalidFormat: false,\n userInvalidated: false,\n iso: false,\n parsedDateParts: [],\n era: null,\n meridiem: null,\n rfc2822: false,\n weekdayMismatch: false,\n };\n }\n\n function getParsingFlags(m) {\n if (m._pf == null) {\n m._pf = defaultParsingFlags();\n }\n return m._pf;\n }\n\n var some;\n if (Array.prototype.some) {\n some = Array.prototype.some;\n } else {\n some = function (fun) {\n var t = Object(this),\n len = t.length >>> 0,\n i;\n\n for (i = 0; i < len; i++) {\n if (i in t && fun.call(this, t[i], i, t)) {\n return true;\n }\n }\n\n return false;\n };\n }\n\n function isValid(m) {\n if (m._isValid == null) {\n var flags = getParsingFlags(m),\n parsedParts = some.call(flags.parsedDateParts, function (i) {\n return i != null;\n }),\n isNowValid =\n !isNaN(m._d.getTime()) &&\n flags.overflow < 0 &&\n !flags.empty &&\n !flags.invalidEra &&\n !flags.invalidMonth &&\n !flags.invalidWeekday &&\n !flags.weekdayMismatch &&\n !flags.nullInput &&\n !flags.invalidFormat &&\n !flags.userInvalidated &&\n (!flags.meridiem || (flags.meridiem && parsedParts));\n\n if (m._strict) {\n isNowValid =\n isNowValid &&\n flags.charsLeftOver === 0 &&\n flags.unusedTokens.length === 0 &&\n flags.bigHour === undefined;\n }\n\n if (Object.isFrozen == null || !Object.isFrozen(m)) {\n m._isValid = isNowValid;\n } else {\n return isNowValid;\n }\n }\n return m._isValid;\n }\n\n function createInvalid(flags) {\n var m = createUTC(NaN);\n if (flags != null) {\n extend(getParsingFlags(m), flags);\n } else {\n getParsingFlags(m).userInvalidated = true;\n }\n\n return m;\n }\n\n // Plugins that add properties should also add the key here (null value),\n // so we can properly clone ourselves.\n var momentProperties = (hooks.momentProperties = []),\n updateInProgress = false;\n\n function copyConfig(to, from) {\n var i,\n prop,\n val,\n momentPropertiesLen = momentProperties.length;\n\n if (!isUndefined(from._isAMomentObject)) {\n to._isAMomentObject = from._isAMomentObject;\n }\n if (!isUndefined(from._i)) {\n to._i = from._i;\n }\n if (!isUndefined(from._f)) {\n to._f = from._f;\n }\n if (!isUndefined(from._l)) {\n to._l = from._l;\n }\n if (!isUndefined(from._strict)) {\n to._strict = from._strict;\n }\n if (!isUndefined(from._tzm)) {\n to._tzm = from._tzm;\n }\n if (!isUndefined(from._isUTC)) {\n to._isUTC = from._isUTC;\n }\n if (!isUndefined(from._offset)) {\n to._offset = from._offset;\n }\n if (!isUndefined(from._pf)) {\n to._pf = getParsingFlags(from);\n }\n if (!isUndefined(from._locale)) {\n to._locale = from._locale;\n }\n\n if (momentPropertiesLen > 0) {\n for (i = 0; i < momentPropertiesLen; i++) {\n prop = momentProperties[i];\n val = from[prop];\n if (!isUndefined(val)) {\n to[prop] = val;\n }\n }\n }\n\n return to;\n }\n\n // Moment prototype object\n function Moment(config) {\n copyConfig(this, config);\n this._d = new Date(config._d != null ? config._d.getTime() : NaN);\n if (!this.isValid()) {\n this._d = new Date(NaN);\n }\n // Prevent infinite loop in case updateOffset creates new moment\n // objects.\n if (updateInProgress === false) {\n updateInProgress = true;\n hooks.updateOffset(this);\n updateInProgress = false;\n }\n }\n\n function isMoment(obj) {\n return (\n obj instanceof Moment || (obj != null && obj._isAMomentObject != null)\n );\n }\n\n function warn(msg) {\n if (\n hooks.suppressDeprecationWarnings === false &&\n typeof console !== 'undefined' &&\n console.warn\n ) {\n console.warn('Deprecation warning: ' + msg);\n }\n }\n\n function deprecate(msg, fn) {\n var firstTime = true;\n\n return extend(function () {\n if (hooks.deprecationHandler != null) {\n hooks.deprecationHandler(null, msg);\n }\n if (firstTime) {\n var args = [],\n arg,\n i,\n key,\n argLen = arguments.length;\n for (i = 0; i < argLen; i++) {\n arg = '';\n if (typeof arguments[i] === 'object') {\n arg += '\\n[' + i + '] ';\n for (key in arguments[0]) {\n if (hasOwnProp(arguments[0], key)) {\n arg += key + ': ' + arguments[0][key] + ', ';\n }\n }\n arg = arg.slice(0, -2); // Remove trailing comma and space\n } else {\n arg = arguments[i];\n }\n args.push(arg);\n }\n warn(\n msg +\n '\\nArguments: ' +\n Array.prototype.slice.call(args).join('') +\n '\\n' +\n new Error().stack\n );\n firstTime = false;\n }\n return fn.apply(this, arguments);\n }, fn);\n }\n\n var deprecations = {};\n\n function deprecateSimple(name, msg) {\n if (hooks.deprecationHandler != null) {\n hooks.deprecationHandler(name, msg);\n }\n if (!deprecations[name]) {\n warn(msg);\n deprecations[name] = true;\n }\n }\n\n hooks.suppressDeprecationWarnings = false;\n hooks.deprecationHandler = null;\n\n function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }\n\n function set(config) {\n var prop, i;\n for (i in config) {\n if (hasOwnProp(config, i)) {\n prop = config[i];\n if (isFunction(prop)) {\n this[i] = prop;\n } else {\n this['_' + i] = prop;\n }\n }\n }\n this._config = config;\n // Lenient ordinal parsing accepts just a number in addition to\n // number + (possibly) stuff coming from _dayOfMonthOrdinalParse.\n // TODO: Remove \"ordinalParse\" fallback in next major release.\n this._dayOfMonthOrdinalParseLenient = new RegExp(\n (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) +\n '|' +\n /\\d{1,2}/.source\n );\n }\n\n function mergeConfigs(parentConfig, childConfig) {\n var res = extend({}, parentConfig),\n prop;\n for (prop in childConfig) {\n if (hasOwnProp(childConfig, prop)) {\n if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {\n res[prop] = {};\n extend(res[prop], parentConfig[prop]);\n extend(res[prop], childConfig[prop]);\n } else if (childConfig[prop] != null) {\n res[prop] = childConfig[prop];\n } else {\n delete res[prop];\n }\n }\n }\n for (prop in parentConfig) {\n if (\n hasOwnProp(parentConfig, prop) &&\n !hasOwnProp(childConfig, prop) &&\n isObject(parentConfig[prop])\n ) {\n // make sure changes to properties don't modify parent config\n res[prop] = extend({}, res[prop]);\n }\n }\n return res;\n }\n\n function Locale(config) {\n if (config != null) {\n this.set(config);\n }\n }\n\n var keys;\n\n if (Object.keys) {\n keys = Object.keys;\n } else {\n keys = function (obj) {\n var i,\n res = [];\n for (i in obj) {\n if (hasOwnProp(obj, i)) {\n res.push(i);\n }\n }\n return res;\n };\n }\n\n var defaultCalendar = {\n sameDay: '[Today at] LT',\n nextDay: '[Tomorrow at] LT',\n nextWeek: 'dddd [at] LT',\n lastDay: '[Yesterday at] LT',\n lastWeek: '[Last] dddd [at] LT',\n sameElse: 'L',\n };\n\n function calendar(key, mom, now) {\n var output = this._calendar[key] || this._calendar['sameElse'];\n return isFunction(output) ? output.call(mom, now) : output;\n }\n\n function zeroFill(number, targetLength, forceSign) {\n var absNumber = '' + Math.abs(number),\n zerosToFill = targetLength - absNumber.length,\n sign = number >= 0;\n return (\n (sign ? (forceSign ? '+' : '') : '-') +\n Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) +\n absNumber\n );\n }\n\n var formattingTokens =\n /(\\[[^\\[]*\\])|(\\\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,\n localFormattingTokens = /(\\[[^\\[]*\\])|(\\\\)?(LTS|LT|LL?L?L?|l{1,4})/g,\n formatFunctions = {},\n formatTokenFunctions = {};\n\n // token: 'M'\n // padded: ['MM', 2]\n // ordinal: 'Mo'\n // callback: function () { this.month() + 1 }\n function addFormatToken(token, padded, ordinal, callback) {\n var func = callback;\n if (typeof callback === 'string') {\n func = function () {\n return this[callback]();\n };\n }\n if (token) {\n formatTokenFunctions[token] = func;\n }\n if (padded) {\n formatTokenFunctions[padded[0]] = function () {\n return zeroFill(func.apply(this, arguments), padded[1], padded[2]);\n };\n }\n if (ordinal) {\n formatTokenFunctions[ordinal] = function () {\n return this.localeData().ordinal(\n func.apply(this, arguments),\n token\n );\n };\n }\n }\n\n function removeFormattingTokens(input) {\n if (input.match(/\\[[\\s\\S]/)) {\n return input.replace(/^\\[|\\]$/g, '');\n }\n return input.replace(/\\\\/g, '');\n }\n\n function makeFormatFunction(format) {\n var array = format.match(formattingTokens),\n i,\n length;\n\n for (i = 0, length = array.length; i < length; i++) {\n if (formatTokenFunctions[array[i]]) {\n array[i] = formatTokenFunctions[array[i]];\n } else {\n array[i] = removeFormattingTokens(array[i]);\n }\n }\n\n return function (mom) {\n var output = '',\n i;\n for (i = 0; i < length; i++) {\n output += isFunction(array[i])\n ? array[i].call(mom, format)\n : array[i];\n }\n return output;\n };\n }\n\n // format date using native date object\n function formatMoment(m, format) {\n if (!m.isValid()) {\n return m.localeData().invalidDate();\n }\n\n format = expandFormat(format, m.localeData());\n formatFunctions[format] =\n formatFunctions[format] || makeFormatFunction(format);\n\n return formatFunctions[format](m);\n }\n\n function expandFormat(format, locale) {\n var i = 5;\n\n function replaceLongDateFormatTokens(input) {\n return locale.longDateFormat(input) || input;\n }\n\n localFormattingTokens.lastIndex = 0;\n while (i >= 0 && localFormattingTokens.test(format)) {\n format = format.replace(\n localFormattingTokens,\n replaceLongDateFormatTokens\n );\n localFormattingTokens.lastIndex = 0;\n i -= 1;\n }\n\n return format;\n }\n\n var defaultLongDateFormat = {\n LTS: 'h:mm:ss A',\n LT: 'h:mm A',\n L: 'MM/DD/YYYY',\n LL: 'MMMM D, YYYY',\n LLL: 'MMMM D, YYYY h:mm A',\n LLLL: 'dddd, MMMM D, YYYY h:mm A',\n };\n\n function longDateFormat(key) {\n var format = this._longDateFormat[key],\n formatUpper = this._longDateFormat[key.toUpperCase()];\n\n if (format || !formatUpper) {\n return format;\n }\n\n this._longDateFormat[key] = formatUpper\n .match(formattingTokens)\n .map(function (tok) {\n if (\n tok === 'MMMM' ||\n tok === 'MM' ||\n tok === 'DD' ||\n tok === 'dddd'\n ) {\n return tok.slice(1);\n }\n return tok;\n })\n .join('');\n\n return this._longDateFormat[key];\n }\n\n var defaultInvalidDate = 'Invalid date';\n\n function invalidDate() {\n return this._invalidDate;\n }\n\n var defaultOrdinal = '%d',\n defaultDayOfMonthOrdinalParse = /\\d{1,2}/;\n\n function ordinal(number) {\n return this._ordinal.replace('%d', number);\n }\n\n var defaultRelativeTime = {\n future: 'in %s',\n past: '%s ago',\n s: 'a few seconds',\n ss: '%d seconds',\n m: 'a minute',\n mm: '%d minutes',\n h: 'an hour',\n hh: '%d hours',\n d: 'a day',\n dd: '%d days',\n w: 'a week',\n ww: '%d weeks',\n M: 'a month',\n MM: '%d months',\n y: 'a year',\n yy: '%d years',\n };\n\n function relativeTime(number, withoutSuffix, string, isFuture) {\n var output = this._relativeTime[string];\n return isFunction(output)\n ? output(number, withoutSuffix, string, isFuture)\n : output.replace(/%d/i, number);\n }\n\n function pastFuture(diff, output) {\n var format = this._relativeTime[diff > 0 ? 'future' : 'past'];\n return isFunction(format) ? format(output) : format.replace(/%s/i, output);\n }\n\n var aliases = {};\n\n function addUnitAlias(unit, shorthand) {\n var lowerCase = unit.toLowerCase();\n aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;\n }\n\n function normalizeUnits(units) {\n return typeof units === 'string'\n ? aliases[units] || aliases[units.toLowerCase()]\n : undefined;\n }\n\n function normalizeObjectUnits(inputObject) {\n var normalizedInput = {},\n normalizedProp,\n prop;\n\n for (prop in inputObject) {\n if (hasOwnProp(inputObject, prop)) {\n normalizedProp = normalizeUnits(prop);\n if (normalizedProp) {\n normalizedInput[normalizedProp] = inputObject[prop];\n }\n }\n }\n\n return normalizedInput;\n }\n\n var priorities = {};\n\n function addUnitPriority(unit, priority) {\n priorities[unit] = priority;\n }\n\n function getPrioritizedUnits(unitsObj) {\n var units = [],\n u;\n for (u in unitsObj) {\n if (hasOwnProp(unitsObj, u)) {\n units.push({ unit: u, priority: priorities[u] });\n }\n }\n units.sort(function (a, b) {\n return a.priority - b.priority;\n });\n return units;\n }\n\n function isLeapYear(year) {\n return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;\n }\n\n function absFloor(number) {\n if (number < 0) {\n // -0 -> 0\n return Math.ceil(number) || 0;\n } else {\n return Math.floor(number);\n }\n }\n\n function toInt(argumentForCoercion) {\n var coercedNumber = +argumentForCoercion,\n value = 0;\n\n if (coercedNumber !== 0 && isFinite(coercedNumber)) {\n value = absFloor(coercedNumber);\n }\n\n return value;\n }\n\n function makeGetSet(unit, keepTime) {\n return function (value) {\n if (value != null) {\n set$1(this, unit, value);\n hooks.updateOffset(this, keepTime);\n return this;\n } else {\n return get(this, unit);\n }\n };\n }\n\n function get(mom, unit) {\n return mom.isValid()\n ? mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]()\n : NaN;\n }\n\n function set$1(mom, unit, value) {\n if (mom.isValid() && !isNaN(value)) {\n if (\n unit === 'FullYear' &&\n isLeapYear(mom.year()) &&\n mom.month() === 1 &&\n mom.date() === 29\n ) {\n value = toInt(value);\n mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](\n value,\n mom.month(),\n daysInMonth(value, mom.month())\n );\n } else {\n mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);\n }\n }\n }\n\n // MOMENTS\n\n function stringGet(units) {\n units = normalizeUnits(units);\n if (isFunction(this[units])) {\n return this[units]();\n }\n return this;\n }\n\n function stringSet(units, value) {\n if (typeof units === 'object') {\n units = normalizeObjectUnits(units);\n var prioritized = getPrioritizedUnits(units),\n i,\n prioritizedLen = prioritized.length;\n for (i = 0; i < prioritizedLen; i++) {\n this[prioritized[i].unit](units[prioritized[i].unit]);\n }\n } else {\n units = normalizeUnits(units);\n if (isFunction(this[units])) {\n return this[units](value);\n }\n }\n return this;\n }\n\n var match1 = /\\d/, // 0 - 9\n match2 = /\\d\\d/, // 00 - 99\n match3 = /\\d{3}/, // 000 - 999\n match4 = /\\d{4}/, // 0000 - 9999\n match6 = /[+-]?\\d{6}/, // -999999 - 999999\n match1to2 = /\\d\\d?/, // 0 - 99\n match3to4 = /\\d\\d\\d\\d?/, // 999 - 9999\n match5to6 = /\\d\\d\\d\\d\\d\\d?/, // 99999 - 999999\n match1to3 = /\\d{1,3}/, // 0 - 999\n match1to4 = /\\d{1,4}/, // 0 - 9999\n match1to6 = /[+-]?\\d{1,6}/, // -999999 - 999999\n matchUnsigned = /\\d+/, // 0 - inf\n matchSigned = /[+-]?\\d+/, // -inf - inf\n matchOffset = /Z|[+-]\\d\\d:?\\d\\d/gi, // +00:00 -00:00 +0000 -0000 or Z\n matchShortOffset = /Z|[+-]\\d\\d(?::?\\d\\d)?/gi, // +00 -00 +00:00 -00:00 +0000 -0000 or Z\n matchTimestamp = /[+-]?\\d+(\\.\\d{1,3})?/, // 123456789 123456789.123\n // any word (or two) characters or numbers including two/three word month in arabic.\n // includes scottish gaelic two word and hyphenated months\n matchWord =\n /[0-9]{0,256}['a-z\\u00A0-\\u05FF\\u0700-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFF07\\uFF10-\\uFFEF]{1,256}|[\\u0600-\\u06FF\\/]{1,256}(\\s*?[\\u0600-\\u06FF]{1,256}){1,2}/i,\n regexes;\n\n regexes = {};\n\n function addRegexToken(token, regex, strictRegex) {\n regexes[token] = isFunction(regex)\n ? regex\n : function (isStrict, localeData) {\n return isStrict && strictRegex ? strictRegex : regex;\n };\n }\n\n function getParseRegexForToken(token, config) {\n if (!hasOwnProp(regexes, token)) {\n return new RegExp(unescapeFormat(token));\n }\n\n return regexes[token](config._strict, config._locale);\n }\n\n // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript\n function unescapeFormat(s) {\n return regexEscape(\n s\n .replace('\\\\', '')\n .replace(\n /\\\\(\\[)|\\\\(\\])|\\[([^\\]\\[]*)\\]|\\\\(.)/g,\n function (matched, p1, p2, p3, p4) {\n return p1 || p2 || p3 || p4;\n }\n )\n );\n }\n\n function regexEscape(s) {\n return s.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n }\n\n var tokens = {};\n\n function addParseToken(token, callback) {\n var i,\n func = callback,\n tokenLen;\n if (typeof token === 'string') {\n token = [token];\n }\n if (isNumber(callback)) {\n func = function (input, array) {\n array[callback] = toInt(input);\n };\n }\n tokenLen = token.length;\n for (i = 0; i < tokenLen; i++) {\n tokens[token[i]] = func;\n }\n }\n\n function addWeekParseToken(token, callback) {\n addParseToken(token, function (input, array, config, token) {\n config._w = config._w || {};\n callback(input, config._w, config, token);\n });\n }\n\n function addTimeToArrayFromToken(token, input, config) {\n if (input != null && hasOwnProp(tokens, token)) {\n tokens[token](input, config._a, config, token);\n }\n }\n\n var YEAR = 0,\n MONTH = 1,\n DATE = 2,\n HOUR = 3,\n MINUTE = 4,\n SECOND = 5,\n MILLISECOND = 6,\n WEEK = 7,\n WEEKDAY = 8;\n\n function mod(n, x) {\n return ((n % x) + x) % x;\n }\n\n var indexOf;\n\n if (Array.prototype.indexOf) {\n indexOf = Array.prototype.indexOf;\n } else {\n indexOf = function (o) {\n // I know\n var i;\n for (i = 0; i < this.length; ++i) {\n if (this[i] === o) {\n return i;\n }\n }\n return -1;\n };\n }\n\n function daysInMonth(year, month) {\n if (isNaN(year) || isNaN(month)) {\n return NaN;\n }\n var modMonth = mod(month, 12);\n year += (month - modMonth) / 12;\n return modMonth === 1\n ? isLeapYear(year)\n ? 29\n : 28\n : 31 - ((modMonth % 7) % 2);\n }\n\n // FORMATTING\n\n addFormatToken('M', ['MM', 2], 'Mo', function () {\n return this.month() + 1;\n });\n\n addFormatToken('MMM', 0, 0, function (format) {\n return this.localeData().monthsShort(this, format);\n });\n\n addFormatToken('MMMM', 0, 0, function (format) {\n return this.localeData().months(this, format);\n });\n\n // ALIASES\n\n addUnitAlias('month', 'M');\n\n // PRIORITY\n\n addUnitPriority('month', 8);\n\n // PARSING\n\n addRegexToken('M', match1to2);\n addRegexToken('MM', match1to2, match2);\n addRegexToken('MMM', function (isStrict, locale) {\n return locale.monthsShortRegex(isStrict);\n });\n addRegexToken('MMMM', function (isStrict, locale) {\n return locale.monthsRegex(isStrict);\n });\n\n addParseToken(['M', 'MM'], function (input, array) {\n array[MONTH] = toInt(input) - 1;\n });\n\n addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {\n var month = config._locale.monthsParse(input, token, config._strict);\n // if we didn't find a month name, mark the date as invalid.\n if (month != null) {\n array[MONTH] = month;\n } else {\n getParsingFlags(config).invalidMonth = input;\n }\n });\n\n // LOCALES\n\n var defaultLocaleMonths =\n 'January_February_March_April_May_June_July_August_September_October_November_December'.split(\n '_'\n ),\n defaultLocaleMonthsShort =\n 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n MONTHS_IN_FORMAT = /D[oD]?(\\[[^\\[\\]]*\\]|\\s)+MMMM?/,\n defaultMonthsShortRegex = matchWord,\n defaultMonthsRegex = matchWord;\n\n function localeMonths(m, format) {\n if (!m) {\n return isArray(this._months)\n ? this._months\n : this._months['standalone'];\n }\n return isArray(this._months)\n ? this._months[m.month()]\n : this._months[\n (this._months.isFormat || MONTHS_IN_FORMAT).test(format)\n ? 'format'\n : 'standalone'\n ][m.month()];\n }\n\n function localeMonthsShort(m, format) {\n if (!m) {\n return isArray(this._monthsShort)\n ? this._monthsShort\n : this._monthsShort['standalone'];\n }\n return isArray(this._monthsShort)\n ? this._monthsShort[m.month()]\n : this._monthsShort[\n MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'\n ][m.month()];\n }\n\n function handleStrictParse(monthName, format, strict) {\n var i,\n ii,\n mom,\n llc = monthName.toLocaleLowerCase();\n if (!this._monthsParse) {\n // this is not used\n this._monthsParse = [];\n this._longMonthsParse = [];\n this._shortMonthsParse = [];\n for (i = 0; i < 12; ++i) {\n mom = createUTC([2000, i]);\n this._shortMonthsParse[i] = this.monthsShort(\n mom,\n ''\n ).toLocaleLowerCase();\n this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();\n }\n }\n\n if (strict) {\n if (format === 'MMM') {\n ii = indexOf.call(this._shortMonthsParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._longMonthsParse, llc);\n return ii !== -1 ? ii : null;\n }\n } else {\n if (format === 'MMM') {\n ii = indexOf.call(this._shortMonthsParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._longMonthsParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._longMonthsParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._shortMonthsParse, llc);\n return ii !== -1 ? ii : null;\n }\n }\n }\n\n function localeMonthsParse(monthName, format, strict) {\n var i, mom, regex;\n\n if (this._monthsParseExact) {\n return handleStrictParse.call(this, monthName, format, strict);\n }\n\n if (!this._monthsParse) {\n this._monthsParse = [];\n this._longMonthsParse = [];\n this._shortMonthsParse = [];\n }\n\n // TODO: add sorting\n // Sorting makes sure if one month (or abbr) is a prefix of another\n // see sorting in computeMonthsParse\n for (i = 0; i < 12; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, i]);\n if (strict && !this._longMonthsParse[i]) {\n this._longMonthsParse[i] = new RegExp(\n '^' + this.months(mom, '').replace('.', '') + '$',\n 'i'\n );\n this._shortMonthsParse[i] = new RegExp(\n '^' + this.monthsShort(mom, '').replace('.', '') + '$',\n 'i'\n );\n }\n if (!strict && !this._monthsParse[i]) {\n regex =\n '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');\n this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');\n }\n // test the regex\n if (\n strict &&\n format === 'MMMM' &&\n this._longMonthsParse[i].test(monthName)\n ) {\n return i;\n } else if (\n strict &&\n format === 'MMM' &&\n this._shortMonthsParse[i].test(monthName)\n ) {\n return i;\n } else if (!strict && this._monthsParse[i].test(monthName)) {\n return i;\n }\n }\n }\n\n // MOMENTS\n\n function setMonth(mom, value) {\n var dayOfMonth;\n\n if (!mom.isValid()) {\n // No op\n return mom;\n }\n\n if (typeof value === 'string') {\n if (/^\\d+$/.test(value)) {\n value = toInt(value);\n } else {\n value = mom.localeData().monthsParse(value);\n // TODO: Another silent failure?\n if (!isNumber(value)) {\n return mom;\n }\n }\n }\n\n dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));\n mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);\n return mom;\n }\n\n function getSetMonth(value) {\n if (value != null) {\n setMonth(this, value);\n hooks.updateOffset(this, true);\n return this;\n } else {\n return get(this, 'Month');\n }\n }\n\n function getDaysInMonth() {\n return daysInMonth(this.year(), this.month());\n }\n\n function monthsShortRegex(isStrict) {\n if (this._monthsParseExact) {\n if (!hasOwnProp(this, '_monthsRegex')) {\n computeMonthsParse.call(this);\n }\n if (isStrict) {\n return this._monthsShortStrictRegex;\n } else {\n return this._monthsShortRegex;\n }\n } else {\n if (!hasOwnProp(this, '_monthsShortRegex')) {\n this._monthsShortRegex = defaultMonthsShortRegex;\n }\n return this._monthsShortStrictRegex && isStrict\n ? this._monthsShortStrictRegex\n : this._monthsShortRegex;\n }\n }\n\n function monthsRegex(isStrict) {\n if (this._monthsParseExact) {\n if (!hasOwnProp(this, '_monthsRegex')) {\n computeMonthsParse.call(this);\n }\n if (isStrict) {\n return this._monthsStrictRegex;\n } else {\n return this._monthsRegex;\n }\n } else {\n if (!hasOwnProp(this, '_monthsRegex')) {\n this._monthsRegex = defaultMonthsRegex;\n }\n return this._monthsStrictRegex && isStrict\n ? this._monthsStrictRegex\n : this._monthsRegex;\n }\n }\n\n function computeMonthsParse() {\n function cmpLenRev(a, b) {\n return b.length - a.length;\n }\n\n var shortPieces = [],\n longPieces = [],\n mixedPieces = [],\n i,\n mom;\n for (i = 0; i < 12; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, i]);\n shortPieces.push(this.monthsShort(mom, ''));\n longPieces.push(this.months(mom, ''));\n mixedPieces.push(this.months(mom, ''));\n mixedPieces.push(this.monthsShort(mom, ''));\n }\n // Sorting makes sure if one month (or abbr) is a prefix of another it\n // will match the longer piece.\n shortPieces.sort(cmpLenRev);\n longPieces.sort(cmpLenRev);\n mixedPieces.sort(cmpLenRev);\n for (i = 0; i < 12; i++) {\n shortPieces[i] = regexEscape(shortPieces[i]);\n longPieces[i] = regexEscape(longPieces[i]);\n }\n for (i = 0; i < 24; i++) {\n mixedPieces[i] = regexEscape(mixedPieces[i]);\n }\n\n this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');\n this._monthsShortRegex = this._monthsRegex;\n this._monthsStrictRegex = new RegExp(\n '^(' + longPieces.join('|') + ')',\n 'i'\n );\n this._monthsShortStrictRegex = new RegExp(\n '^(' + shortPieces.join('|') + ')',\n 'i'\n );\n }\n\n // FORMATTING\n\n addFormatToken('Y', 0, 0, function () {\n var y = this.year();\n return y <= 9999 ? zeroFill(y, 4) : '+' + y;\n });\n\n addFormatToken(0, ['YY', 2], 0, function () {\n return this.year() % 100;\n });\n\n addFormatToken(0, ['YYYY', 4], 0, 'year');\n addFormatToken(0, ['YYYYY', 5], 0, 'year');\n addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');\n\n // ALIASES\n\n addUnitAlias('year', 'y');\n\n // PRIORITIES\n\n addUnitPriority('year', 1);\n\n // PARSING\n\n addRegexToken('Y', matchSigned);\n addRegexToken('YY', match1to2, match2);\n addRegexToken('YYYY', match1to4, match4);\n addRegexToken('YYYYY', match1to6, match6);\n addRegexToken('YYYYYY', match1to6, match6);\n\n addParseToken(['YYYYY', 'YYYYYY'], YEAR);\n addParseToken('YYYY', function (input, array) {\n array[YEAR] =\n input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);\n });\n addParseToken('YY', function (input, array) {\n array[YEAR] = hooks.parseTwoDigitYear(input);\n });\n addParseToken('Y', function (input, array) {\n array[YEAR] = parseInt(input, 10);\n });\n\n // HELPERS\n\n function daysInYear(year) {\n return isLeapYear(year) ? 366 : 365;\n }\n\n // HOOKS\n\n hooks.parseTwoDigitYear = function (input) {\n return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);\n };\n\n // MOMENTS\n\n var getSetYear = makeGetSet('FullYear', true);\n\n function getIsLeapYear() {\n return isLeapYear(this.year());\n }\n\n function createDate(y, m, d, h, M, s, ms) {\n // can't just apply() to create a date:\n // https://stackoverflow.com/q/181348\n var date;\n // the date constructor remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0) {\n // preserve leap years using a full 400 year cycle, then reset\n date = new Date(y + 400, m, d, h, M, s, ms);\n if (isFinite(date.getFullYear())) {\n date.setFullYear(y);\n }\n } else {\n date = new Date(y, m, d, h, M, s, ms);\n }\n\n return date;\n }\n\n function createUTCDate(y) {\n var date, args;\n // the Date.UTC function remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0) {\n args = Array.prototype.slice.call(arguments);\n // preserve leap years using a full 400 year cycle, then reset\n args[0] = y + 400;\n date = new Date(Date.UTC.apply(null, args));\n if (isFinite(date.getUTCFullYear())) {\n date.setUTCFullYear(y);\n }\n } else {\n date = new Date(Date.UTC.apply(null, arguments));\n }\n\n return date;\n }\n\n // start-of-first-week - start-of-year\n function firstWeekOffset(year, dow, doy) {\n var // first-week day -- which january is always in the first week (4 for iso, 1 for other)\n fwd = 7 + dow - doy,\n // first-week day local weekday -- which local weekday is fwd\n fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;\n\n return -fwdlw + fwd - 1;\n }\n\n // https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday\n function dayOfYearFromWeeks(year, week, weekday, dow, doy) {\n var localWeekday = (7 + weekday - dow) % 7,\n weekOffset = firstWeekOffset(year, dow, doy),\n dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,\n resYear,\n resDayOfYear;\n\n if (dayOfYear <= 0) {\n resYear = year - 1;\n resDayOfYear = daysInYear(resYear) + dayOfYear;\n } else if (dayOfYear > daysInYear(year)) {\n resYear = year + 1;\n resDayOfYear = dayOfYear - daysInYear(year);\n } else {\n resYear = year;\n resDayOfYear = dayOfYear;\n }\n\n return {\n year: resYear,\n dayOfYear: resDayOfYear,\n };\n }\n\n function weekOfYear(mom, dow, doy) {\n var weekOffset = firstWeekOffset(mom.year(), dow, doy),\n week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,\n resWeek,\n resYear;\n\n if (week < 1) {\n resYear = mom.year() - 1;\n resWeek = week + weeksInYear(resYear, dow, doy);\n } else if (week > weeksInYear(mom.year(), dow, doy)) {\n resWeek = week - weeksInYear(mom.year(), dow, doy);\n resYear = mom.year() + 1;\n } else {\n resYear = mom.year();\n resWeek = week;\n }\n\n return {\n week: resWeek,\n year: resYear,\n };\n }\n\n function weeksInYear(year, dow, doy) {\n var weekOffset = firstWeekOffset(year, dow, doy),\n weekOffsetNext = firstWeekOffset(year + 1, dow, doy);\n return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;\n }\n\n // FORMATTING\n\n addFormatToken('w', ['ww', 2], 'wo', 'week');\n addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');\n\n // ALIASES\n\n addUnitAlias('week', 'w');\n addUnitAlias('isoWeek', 'W');\n\n // PRIORITIES\n\n addUnitPriority('week', 5);\n addUnitPriority('isoWeek', 5);\n\n // PARSING\n\n addRegexToken('w', match1to2);\n addRegexToken('ww', match1to2, match2);\n addRegexToken('W', match1to2);\n addRegexToken('WW', match1to2, match2);\n\n addWeekParseToken(\n ['w', 'ww', 'W', 'WW'],\n function (input, week, config, token) {\n week[token.substr(0, 1)] = toInt(input);\n }\n );\n\n // HELPERS\n\n // LOCALES\n\n function localeWeek(mom) {\n return weekOfYear(mom, this._week.dow, this._week.doy).week;\n }\n\n var defaultLocaleWeek = {\n dow: 0, // Sunday is the first day of the week.\n doy: 6, // The week that contains Jan 6th is the first week of the year.\n };\n\n function localeFirstDayOfWeek() {\n return this._week.dow;\n }\n\n function localeFirstDayOfYear() {\n return this._week.doy;\n }\n\n // MOMENTS\n\n function getSetWeek(input) {\n var week = this.localeData().week(this);\n return input == null ? week : this.add((input - week) * 7, 'd');\n }\n\n function getSetISOWeek(input) {\n var week = weekOfYear(this, 1, 4).week;\n return input == null ? week : this.add((input - week) * 7, 'd');\n }\n\n // FORMATTING\n\n addFormatToken('d', 0, 'do', 'day');\n\n addFormatToken('dd', 0, 0, function (format) {\n return this.localeData().weekdaysMin(this, format);\n });\n\n addFormatToken('ddd', 0, 0, function (format) {\n return this.localeData().weekdaysShort(this, format);\n });\n\n addFormatToken('dddd', 0, 0, function (format) {\n return this.localeData().weekdays(this, format);\n });\n\n addFormatToken('e', 0, 0, 'weekday');\n addFormatToken('E', 0, 0, 'isoWeekday');\n\n // ALIASES\n\n addUnitAlias('day', 'd');\n addUnitAlias('weekday', 'e');\n addUnitAlias('isoWeekday', 'E');\n\n // PRIORITY\n addUnitPriority('day', 11);\n addUnitPriority('weekday', 11);\n addUnitPriority('isoWeekday', 11);\n\n // PARSING\n\n addRegexToken('d', match1to2);\n addRegexToken('e', match1to2);\n addRegexToken('E', match1to2);\n addRegexToken('dd', function (isStrict, locale) {\n return locale.weekdaysMinRegex(isStrict);\n });\n addRegexToken('ddd', function (isStrict, locale) {\n return locale.weekdaysShortRegex(isStrict);\n });\n addRegexToken('dddd', function (isStrict, locale) {\n return locale.weekdaysRegex(isStrict);\n });\n\n addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {\n var weekday = config._locale.weekdaysParse(input, token, config._strict);\n // if we didn't get a weekday name, mark the date as invalid\n if (weekday != null) {\n week.d = weekday;\n } else {\n getParsingFlags(config).invalidWeekday = input;\n }\n });\n\n addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {\n week[token] = toInt(input);\n });\n\n // HELPERS\n\n function parseWeekday(input, locale) {\n if (typeof input !== 'string') {\n return input;\n }\n\n if (!isNaN(input)) {\n return parseInt(input, 10);\n }\n\n input = locale.weekdaysParse(input);\n if (typeof input === 'number') {\n return input;\n }\n\n return null;\n }\n\n function parseIsoWeekday(input, locale) {\n if (typeof input === 'string') {\n return locale.weekdaysParse(input) % 7 || 7;\n }\n return isNaN(input) ? null : input;\n }\n\n // LOCALES\n function shiftWeekdays(ws, n) {\n return ws.slice(n, 7).concat(ws.slice(0, n));\n }\n\n var defaultLocaleWeekdays =\n 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),\n defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n defaultWeekdaysRegex = matchWord,\n defaultWeekdaysShortRegex = matchWord,\n defaultWeekdaysMinRegex = matchWord;\n\n function localeWeekdays(m, format) {\n var weekdays = isArray(this._weekdays)\n ? this._weekdays\n : this._weekdays[\n m && m !== true && this._weekdays.isFormat.test(format)\n ? 'format'\n : 'standalone'\n ];\n return m === true\n ? shiftWeekdays(weekdays, this._week.dow)\n : m\n ? weekdays[m.day()]\n : weekdays;\n }\n\n function localeWeekdaysShort(m) {\n return m === true\n ? shiftWeekdays(this._weekdaysShort, this._week.dow)\n : m\n ? this._weekdaysShort[m.day()]\n : this._weekdaysShort;\n }\n\n function localeWeekdaysMin(m) {\n return m === true\n ? shiftWeekdays(this._weekdaysMin, this._week.dow)\n : m\n ? this._weekdaysMin[m.day()]\n : this._weekdaysMin;\n }\n\n function handleStrictParse$1(weekdayName, format, strict) {\n var i,\n ii,\n mom,\n llc = weekdayName.toLocaleLowerCase();\n if (!this._weekdaysParse) {\n this._weekdaysParse = [];\n this._shortWeekdaysParse = [];\n this._minWeekdaysParse = [];\n\n for (i = 0; i < 7; ++i) {\n mom = createUTC([2000, 1]).day(i);\n this._minWeekdaysParse[i] = this.weekdaysMin(\n mom,\n ''\n ).toLocaleLowerCase();\n this._shortWeekdaysParse[i] = this.weekdaysShort(\n mom,\n ''\n ).toLocaleLowerCase();\n this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();\n }\n }\n\n if (strict) {\n if (format === 'dddd') {\n ii = indexOf.call(this._weekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else if (format === 'ddd') {\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n }\n } else {\n if (format === 'dddd') {\n ii = indexOf.call(this._weekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else if (format === 'ddd') {\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._weekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._minWeekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._weekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n }\n }\n }\n\n function localeWeekdaysParse(weekdayName, format, strict) {\n var i, mom, regex;\n\n if (this._weekdaysParseExact) {\n return handleStrictParse$1.call(this, weekdayName, format, strict);\n }\n\n if (!this._weekdaysParse) {\n this._weekdaysParse = [];\n this._minWeekdaysParse = [];\n this._shortWeekdaysParse = [];\n this._fullWeekdaysParse = [];\n }\n\n for (i = 0; i < 7; i++) {\n // make the regex if we don't have it already\n\n mom = createUTC([2000, 1]).day(i);\n if (strict && !this._fullWeekdaysParse[i]) {\n this._fullWeekdaysParse[i] = new RegExp(\n '^' + this.weekdays(mom, '').replace('.', '\\\\.?') + '$',\n 'i'\n );\n this._shortWeekdaysParse[i] = new RegExp(\n '^' + this.weekdaysShort(mom, '').replace('.', '\\\\.?') + '$',\n 'i'\n );\n this._minWeekdaysParse[i] = new RegExp(\n '^' + this.weekdaysMin(mom, '').replace('.', '\\\\.?') + '$',\n 'i'\n );\n }\n if (!this._weekdaysParse[i]) {\n regex =\n '^' +\n this.weekdays(mom, '') +\n '|^' +\n this.weekdaysShort(mom, '') +\n '|^' +\n this.weekdaysMin(mom, '');\n this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');\n }\n // test the regex\n if (\n strict &&\n format === 'dddd' &&\n this._fullWeekdaysParse[i].test(weekdayName)\n ) {\n return i;\n } else if (\n strict &&\n format === 'ddd' &&\n this._shortWeekdaysParse[i].test(weekdayName)\n ) {\n return i;\n } else if (\n strict &&\n format === 'dd' &&\n this._minWeekdaysParse[i].test(weekdayName)\n ) {\n return i;\n } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {\n return i;\n }\n }\n }\n\n // MOMENTS\n\n function getSetDayOfWeek(input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();\n if (input != null) {\n input = parseWeekday(input, this.localeData());\n return this.add(input - day, 'd');\n } else {\n return day;\n }\n }\n\n function getSetLocaleDayOfWeek(input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;\n return input == null ? weekday : this.add(input - weekday, 'd');\n }\n\n function getSetISODayOfWeek(input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n\n // behaves the same as moment#day except\n // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)\n // as a setter, sunday should belong to the previous week.\n\n if (input != null) {\n var weekday = parseIsoWeekday(input, this.localeData());\n return this.day(this.day() % 7 ? weekday : weekday - 7);\n } else {\n return this.day() || 7;\n }\n }\n\n function weekdaysRegex(isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n if (isStrict) {\n return this._weekdaysStrictRegex;\n } else {\n return this._weekdaysRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n this._weekdaysRegex = defaultWeekdaysRegex;\n }\n return this._weekdaysStrictRegex && isStrict\n ? this._weekdaysStrictRegex\n : this._weekdaysRegex;\n }\n }\n\n function weekdaysShortRegex(isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n if (isStrict) {\n return this._weekdaysShortStrictRegex;\n } else {\n return this._weekdaysShortRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysShortRegex')) {\n this._weekdaysShortRegex = defaultWeekdaysShortRegex;\n }\n return this._weekdaysShortStrictRegex && isStrict\n ? this._weekdaysShortStrictRegex\n : this._weekdaysShortRegex;\n }\n }\n\n function weekdaysMinRegex(isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n if (isStrict) {\n return this._weekdaysMinStrictRegex;\n } else {\n return this._weekdaysMinRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysMinRegex')) {\n this._weekdaysMinRegex = defaultWeekdaysMinRegex;\n }\n return this._weekdaysMinStrictRegex && isStrict\n ? this._weekdaysMinStrictRegex\n : this._weekdaysMinRegex;\n }\n }\n\n function computeWeekdaysParse() {\n function cmpLenRev(a, b) {\n return b.length - a.length;\n }\n\n var minPieces = [],\n shortPieces = [],\n longPieces = [],\n mixedPieces = [],\n i,\n mom,\n minp,\n shortp,\n longp;\n for (i = 0; i < 7; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, 1]).day(i);\n minp = regexEscape(this.weekdaysMin(mom, ''));\n shortp = regexEscape(this.weekdaysShort(mom, ''));\n longp = regexEscape(this.weekdays(mom, ''));\n minPieces.push(minp);\n shortPieces.push(shortp);\n longPieces.push(longp);\n mixedPieces.push(minp);\n mixedPieces.push(shortp);\n mixedPieces.push(longp);\n }\n // Sorting makes sure if one weekday (or abbr) is a prefix of another it\n // will match the longer piece.\n minPieces.sort(cmpLenRev);\n shortPieces.sort(cmpLenRev);\n longPieces.sort(cmpLenRev);\n mixedPieces.sort(cmpLenRev);\n\n this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');\n this._weekdaysShortRegex = this._weekdaysRegex;\n this._weekdaysMinRegex = this._weekdaysRegex;\n\n this._weekdaysStrictRegex = new RegExp(\n '^(' + longPieces.join('|') + ')',\n 'i'\n );\n this._weekdaysShortStrictRegex = new RegExp(\n '^(' + shortPieces.join('|') + ')',\n 'i'\n );\n this._weekdaysMinStrictRegex = new RegExp(\n '^(' + minPieces.join('|') + ')',\n 'i'\n );\n }\n\n // FORMATTING\n\n function hFormat() {\n return this.hours() % 12 || 12;\n }\n\n function kFormat() {\n return this.hours() || 24;\n }\n\n addFormatToken('H', ['HH', 2], 0, 'hour');\n addFormatToken('h', ['hh', 2], 0, hFormat);\n addFormatToken('k', ['kk', 2], 0, kFormat);\n\n addFormatToken('hmm', 0, 0, function () {\n return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);\n });\n\n addFormatToken('hmmss', 0, 0, function () {\n return (\n '' +\n hFormat.apply(this) +\n zeroFill(this.minutes(), 2) +\n zeroFill(this.seconds(), 2)\n );\n });\n\n addFormatToken('Hmm', 0, 0, function () {\n return '' + this.hours() + zeroFill(this.minutes(), 2);\n });\n\n addFormatToken('Hmmss', 0, 0, function () {\n return (\n '' +\n this.hours() +\n zeroFill(this.minutes(), 2) +\n zeroFill(this.seconds(), 2)\n );\n });\n\n function meridiem(token, lowercase) {\n addFormatToken(token, 0, 0, function () {\n return this.localeData().meridiem(\n this.hours(),\n this.minutes(),\n lowercase\n );\n });\n }\n\n meridiem('a', true);\n meridiem('A', false);\n\n // ALIASES\n\n addUnitAlias('hour', 'h');\n\n // PRIORITY\n addUnitPriority('hour', 13);\n\n // PARSING\n\n function matchMeridiem(isStrict, locale) {\n return locale._meridiemParse;\n }\n\n addRegexToken('a', matchMeridiem);\n addRegexToken('A', matchMeridiem);\n addRegexToken('H', match1to2);\n addRegexToken('h', match1to2);\n addRegexToken('k', match1to2);\n addRegexToken('HH', match1to2, match2);\n addRegexToken('hh', match1to2, match2);\n addRegexToken('kk', match1to2, match2);\n\n addRegexToken('hmm', match3to4);\n addRegexToken('hmmss', match5to6);\n addRegexToken('Hmm', match3to4);\n addRegexToken('Hmmss', match5to6);\n\n addParseToken(['H', 'HH'], HOUR);\n addParseToken(['k', 'kk'], function (input, array, config) {\n var kInput = toInt(input);\n array[HOUR] = kInput === 24 ? 0 : kInput;\n });\n addParseToken(['a', 'A'], function (input, array, config) {\n config._isPm = config._locale.isPM(input);\n config._meridiem = input;\n });\n addParseToken(['h', 'hh'], function (input, array, config) {\n array[HOUR] = toInt(input);\n getParsingFlags(config).bigHour = true;\n });\n addParseToken('hmm', function (input, array, config) {\n var pos = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos));\n array[MINUTE] = toInt(input.substr(pos));\n getParsingFlags(config).bigHour = true;\n });\n addParseToken('hmmss', function (input, array, config) {\n var pos1 = input.length - 4,\n pos2 = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos1));\n array[MINUTE] = toInt(input.substr(pos1, 2));\n array[SECOND] = toInt(input.substr(pos2));\n getParsingFlags(config).bigHour = true;\n });\n addParseToken('Hmm', function (input, array, config) {\n var pos = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos));\n array[MINUTE] = toInt(input.substr(pos));\n });\n addParseToken('Hmmss', function (input, array, config) {\n var pos1 = input.length - 4,\n pos2 = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos1));\n array[MINUTE] = toInt(input.substr(pos1, 2));\n array[SECOND] = toInt(input.substr(pos2));\n });\n\n // LOCALES\n\n function localeIsPM(input) {\n // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays\n // Using charAt should be more compatible.\n return (input + '').toLowerCase().charAt(0) === 'p';\n }\n\n var defaultLocaleMeridiemParse = /[ap]\\.?m?\\.?/i,\n // Setting the hour should keep the time, because the user explicitly\n // specified which hour they want. So trying to maintain the same hour (in\n // a new timezone) makes sense. Adding/subtracting hours does not follow\n // this rule.\n getSetHour = makeGetSet('Hours', true);\n\n function localeMeridiem(hours, minutes, isLower) {\n if (hours > 11) {\n return isLower ? 'pm' : 'PM';\n } else {\n return isLower ? 'am' : 'AM';\n }\n }\n\n var baseConfig = {\n calendar: defaultCalendar,\n longDateFormat: defaultLongDateFormat,\n invalidDate: defaultInvalidDate,\n ordinal: defaultOrdinal,\n dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,\n relativeTime: defaultRelativeTime,\n\n months: defaultLocaleMonths,\n monthsShort: defaultLocaleMonthsShort,\n\n week: defaultLocaleWeek,\n\n weekdays: defaultLocaleWeekdays,\n weekdaysMin: defaultLocaleWeekdaysMin,\n weekdaysShort: defaultLocaleWeekdaysShort,\n\n meridiemParse: defaultLocaleMeridiemParse,\n };\n\n // internal storage for locale config files\n var locales = {},\n localeFamilies = {},\n globalLocale;\n\n function commonPrefix(arr1, arr2) {\n var i,\n minl = Math.min(arr1.length, arr2.length);\n for (i = 0; i < minl; i += 1) {\n if (arr1[i] !== arr2[i]) {\n return i;\n }\n }\n return minl;\n }\n\n function normalizeLocale(key) {\n return key ? key.toLowerCase().replace('_', '-') : key;\n }\n\n // pick the locale from the array\n // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\n function chooseLocale(names) {\n var i = 0,\n j,\n next,\n locale,\n split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (\n next &&\n next.length >= j &&\n commonPrefix(split, next) >= j - 1\n ) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }\n\n function isLocaleNameSane(name) {\n // Prevent names that look like filesystem paths, i.e contain '/' or '\\'\n return name.match('^[^/\\\\\\\\]*$') != null;\n }\n\n function loadLocale(name) {\n var oldLocale = null,\n aliasedRequire;\n // TODO: Find a better way to register and load all the locales in Node\n if (\n locales[name] === undefined &&\n typeof module !== 'undefined' &&\n module &&\n module.exports &&\n isLocaleNameSane(name)\n ) {\n try {\n oldLocale = globalLocale._abbr;\n aliasedRequire = require;\n aliasedRequire('./locale/' + name);\n getSetGlobalLocale(oldLocale);\n } catch (e) {\n // mark as not found to avoid repeating expensive file require call causing high CPU\n // when trying to find en-US, en_US, en-us for every format call\n locales[name] = null; // null means not found\n }\n }\n return locales[name];\n }\n\n // This function will load locale and then set the global locale. If\n // no arguments are passed in, it will simply return the current global\n // locale key.\n function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn(\n 'Locale ' + key + ' not found. Did you forget to load it?'\n );\n }\n }\n }\n\n return globalLocale._abbr;\n }\n\n function defineLocale(name, config) {\n if (config !== null) {\n var locale,\n parentConfig = baseConfig;\n config.abbr = name;\n if (locales[name] != null) {\n deprecateSimple(\n 'defineLocaleOverride',\n 'use moment.updateLocale(localeName, config) to change ' +\n 'an existing locale. moment.defineLocale(localeName, ' +\n 'config) should only be used for creating a new locale ' +\n 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.'\n );\n parentConfig = locales[name]._config;\n } else if (config.parentLocale != null) {\n if (locales[config.parentLocale] != null) {\n parentConfig = locales[config.parentLocale]._config;\n } else {\n locale = loadLocale(config.parentLocale);\n if (locale != null) {\n parentConfig = locale._config;\n } else {\n if (!localeFamilies[config.parentLocale]) {\n localeFamilies[config.parentLocale] = [];\n }\n localeFamilies[config.parentLocale].push({\n name: name,\n config: config,\n });\n return null;\n }\n }\n }\n locales[name] = new Locale(mergeConfigs(parentConfig, config));\n\n if (localeFamilies[name]) {\n localeFamilies[name].forEach(function (x) {\n defineLocale(x.name, x.config);\n });\n }\n\n // backwards compat for now: also set the locale\n // make sure we set the locale AFTER all child locales have been\n // created, so we won't end up with the child locale set.\n getSetGlobalLocale(name);\n\n return locales[name];\n } else {\n // useful for testing\n delete locales[name];\n return null;\n }\n }\n\n function updateLocale(name, config) {\n if (config != null) {\n var locale,\n tmpLocale,\n parentConfig = baseConfig;\n\n if (locales[name] != null && locales[name].parentLocale != null) {\n // Update existing child locale in-place to avoid memory-leaks\n locales[name].set(mergeConfigs(locales[name]._config, config));\n } else {\n // MERGE\n tmpLocale = loadLocale(name);\n if (tmpLocale != null) {\n parentConfig = tmpLocale._config;\n }\n config = mergeConfigs(parentConfig, config);\n if (tmpLocale == null) {\n // updateLocale is called for creating a new locale\n // Set abbr so it will have a name (getters return\n // undefined otherwise).\n config.abbr = name;\n }\n locale = new Locale(config);\n locale.parentLocale = locales[name];\n locales[name] = locale;\n }\n\n // backwards compat for now: also set the locale\n getSetGlobalLocale(name);\n } else {\n // pass null for config to unupdate, useful for tests\n if (locales[name] != null) {\n if (locales[name].parentLocale != null) {\n locales[name] = locales[name].parentLocale;\n if (name === getSetGlobalLocale()) {\n getSetGlobalLocale(name);\n }\n } else if (locales[name] != null) {\n delete locales[name];\n }\n }\n }\n return locales[name];\n }\n\n // returns locale data\n function getLocale(key) {\n var locale;\n\n if (key && key._locale && key._locale._abbr) {\n key = key._locale._abbr;\n }\n\n if (!key) {\n return globalLocale;\n }\n\n if (!isArray(key)) {\n //short-circuit everything else\n locale = loadLocale(key);\n if (locale) {\n return locale;\n }\n key = [key];\n }\n\n return chooseLocale(key);\n }\n\n function listLocales() {\n return keys(locales);\n }\n\n function checkOverflow(m) {\n var overflow,\n a = m._a;\n\n if (a && getParsingFlags(m).overflow === -2) {\n overflow =\n a[MONTH] < 0 || a[MONTH] > 11\n ? MONTH\n : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH])\n ? DATE\n : a[HOUR] < 0 ||\n a[HOUR] > 24 ||\n (a[HOUR] === 24 &&\n (a[MINUTE] !== 0 ||\n a[SECOND] !== 0 ||\n a[MILLISECOND] !== 0))\n ? HOUR\n : a[MINUTE] < 0 || a[MINUTE] > 59\n ? MINUTE\n : a[SECOND] < 0 || a[SECOND] > 59\n ? SECOND\n : a[MILLISECOND] < 0 || a[MILLISECOND] > 999\n ? MILLISECOND\n : -1;\n\n if (\n getParsingFlags(m)._overflowDayOfYear &&\n (overflow < YEAR || overflow > DATE)\n ) {\n overflow = DATE;\n }\n if (getParsingFlags(m)._overflowWeeks && overflow === -1) {\n overflow = WEEK;\n }\n if (getParsingFlags(m)._overflowWeekday && overflow === -1) {\n overflow = WEEKDAY;\n }\n\n getParsingFlags(m).overflow = overflow;\n }\n\n return m;\n }\n\n // iso 8601 regex\n // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)\n var extendedIsoRegex =\n /^\\s*((?:[+-]\\d{6}|\\d{4})-(?:\\d\\d-\\d\\d|W\\d\\d-\\d|W\\d\\d|\\d\\d\\d|\\d\\d))(?:(T| )(\\d\\d(?::\\d\\d(?::\\d\\d(?:[.,]\\d+)?)?)?)([+-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/,\n basicIsoRegex =\n /^\\s*((?:[+-]\\d{6}|\\d{4})(?:\\d\\d\\d\\d|W\\d\\d\\d|W\\d\\d|\\d\\d\\d|\\d\\d|))(?:(T| )(\\d\\d(?:\\d\\d(?:\\d\\d(?:[.,]\\d+)?)?)?)([+-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/,\n tzRegex = /Z|[+-]\\d\\d(?::?\\d\\d)?/,\n isoDates = [\n ['YYYYYY-MM-DD', /[+-]\\d{6}-\\d\\d-\\d\\d/],\n ['YYYY-MM-DD', /\\d{4}-\\d\\d-\\d\\d/],\n ['GGGG-[W]WW-E', /\\d{4}-W\\d\\d-\\d/],\n ['GGGG-[W]WW', /\\d{4}-W\\d\\d/, false],\n ['YYYY-DDD', /\\d{4}-\\d{3}/],\n ['YYYY-MM', /\\d{4}-\\d\\d/, false],\n ['YYYYYYMMDD', /[+-]\\d{10}/],\n ['YYYYMMDD', /\\d{8}/],\n ['GGGG[W]WWE', /\\d{4}W\\d{3}/],\n ['GGGG[W]WW', /\\d{4}W\\d{2}/, false],\n ['YYYYDDD', /\\d{7}/],\n ['YYYYMM', /\\d{6}/, false],\n ['YYYY', /\\d{4}/, false],\n ],\n // iso time formats and regexes\n isoTimes = [\n ['HH:mm:ss.SSSS', /\\d\\d:\\d\\d:\\d\\d\\.\\d+/],\n ['HH:mm:ss,SSSS', /\\d\\d:\\d\\d:\\d\\d,\\d+/],\n ['HH:mm:ss', /\\d\\d:\\d\\d:\\d\\d/],\n ['HH:mm', /\\d\\d:\\d\\d/],\n ['HHmmss.SSSS', /\\d\\d\\d\\d\\d\\d\\.\\d+/],\n ['HHmmss,SSSS', /\\d\\d\\d\\d\\d\\d,\\d+/],\n ['HHmmss', /\\d\\d\\d\\d\\d\\d/],\n ['HHmm', /\\d\\d\\d\\d/],\n ['HH', /\\d\\d/],\n ],\n aspNetJsonRegex = /^\\/?Date\\((-?\\d+)/i,\n // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3\n rfc2822 =\n /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\\d{4}))$/,\n obsOffsets = {\n UT: 0,\n GMT: 0,\n EDT: -4 * 60,\n EST: -5 * 60,\n CDT: -5 * 60,\n CST: -6 * 60,\n MDT: -6 * 60,\n MST: -7 * 60,\n PDT: -7 * 60,\n PST: -8 * 60,\n };\n\n // date from iso format\n function configFromISO(config) {\n var i,\n l,\n string = config._i,\n match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),\n allowTime,\n dateFormat,\n timeFormat,\n tzFormat,\n isoDatesLen = isoDates.length,\n isoTimesLen = isoTimes.length;\n\n if (match) {\n getParsingFlags(config).iso = true;\n for (i = 0, l = isoDatesLen; i < l; i++) {\n if (isoDates[i][1].exec(match[1])) {\n dateFormat = isoDates[i][0];\n allowTime = isoDates[i][2] !== false;\n break;\n }\n }\n if (dateFormat == null) {\n config._isValid = false;\n return;\n }\n if (match[3]) {\n for (i = 0, l = isoTimesLen; i < l; i++) {\n if (isoTimes[i][1].exec(match[3])) {\n // match[2] should be 'T' or space\n timeFormat = (match[2] || ' ') + isoTimes[i][0];\n break;\n }\n }\n if (timeFormat == null) {\n config._isValid = false;\n return;\n }\n }\n if (!allowTime && timeFormat != null) {\n config._isValid = false;\n return;\n }\n if (match[4]) {\n if (tzRegex.exec(match[4])) {\n tzFormat = 'Z';\n } else {\n config._isValid = false;\n return;\n }\n }\n config._f = dateFormat + (timeFormat || '') + (tzFormat || '');\n configFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }\n\n function extractFromRFC2822Strings(\n yearStr,\n monthStr,\n dayStr,\n hourStr,\n minuteStr,\n secondStr\n ) {\n var result = [\n untruncateYear(yearStr),\n defaultLocaleMonthsShort.indexOf(monthStr),\n parseInt(dayStr, 10),\n parseInt(hourStr, 10),\n parseInt(minuteStr, 10),\n ];\n\n if (secondStr) {\n result.push(parseInt(secondStr, 10));\n }\n\n return result;\n }\n\n function untruncateYear(yearStr) {\n var year = parseInt(yearStr, 10);\n if (year <= 49) {\n return 2000 + year;\n } else if (year <= 999) {\n return 1900 + year;\n }\n return year;\n }\n\n function preprocessRFC2822(s) {\n // Remove comments and folding whitespace and replace multiple-spaces with a single space\n return s\n .replace(/\\([^)]*\\)|[\\n\\t]/g, ' ')\n .replace(/(\\s\\s+)/g, ' ')\n .replace(/^\\s\\s*/, '')\n .replace(/\\s\\s*$/, '');\n }\n\n function checkWeekday(weekdayStr, parsedInput, config) {\n if (weekdayStr) {\n // TODO: Replace the vanilla JS Date object with an independent day-of-week check.\n var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr),\n weekdayActual = new Date(\n parsedInput[0],\n parsedInput[1],\n parsedInput[2]\n ).getDay();\n if (weekdayProvided !== weekdayActual) {\n getParsingFlags(config).weekdayMismatch = true;\n config._isValid = false;\n return false;\n }\n }\n return true;\n }\n\n function calculateOffset(obsOffset, militaryOffset, numOffset) {\n if (obsOffset) {\n return obsOffsets[obsOffset];\n } else if (militaryOffset) {\n // the only allowed military tz is Z\n return 0;\n } else {\n var hm = parseInt(numOffset, 10),\n m = hm % 100,\n h = (hm - m) / 100;\n return h * 60 + m;\n }\n }\n\n // date and time from ref 2822 format\n function configFromRFC2822(config) {\n var match = rfc2822.exec(preprocessRFC2822(config._i)),\n parsedArray;\n if (match) {\n parsedArray = extractFromRFC2822Strings(\n match[4],\n match[3],\n match[2],\n match[5],\n match[6],\n match[7]\n );\n if (!checkWeekday(match[1], parsedArray, config)) {\n return;\n }\n\n config._a = parsedArray;\n config._tzm = calculateOffset(match[8], match[9], match[10]);\n\n config._d = createUTCDate.apply(null, config._a);\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n\n getParsingFlags(config).rfc2822 = true;\n } else {\n config._isValid = false;\n }\n }\n\n // date from 1) ASP.NET, 2) ISO, 3) RFC 2822 formats, or 4) optional fallback if parsing isn't strict\n function configFromString(config) {\n var matched = aspNetJsonRegex.exec(config._i);\n if (matched !== null) {\n config._d = new Date(+matched[1]);\n return;\n }\n\n configFromISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n } else {\n return;\n }\n\n configFromRFC2822(config);\n if (config._isValid === false) {\n delete config._isValid;\n } else {\n return;\n }\n\n if (config._strict) {\n config._isValid = false;\n } else {\n // Final attempt, use Input Fallback\n hooks.createFromInputFallback(config);\n }\n }\n\n hooks.createFromInputFallback = deprecate(\n 'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' +\n 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' +\n 'discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.',\n function (config) {\n config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));\n }\n );\n\n // Pick the first defined of two or three arguments.\n function defaults(a, b, c) {\n if (a != null) {\n return a;\n }\n if (b != null) {\n return b;\n }\n return c;\n }\n\n function currentDateArray(config) {\n // hooks is actually the exported moment object\n var nowValue = new Date(hooks.now());\n if (config._useUTC) {\n return [\n nowValue.getUTCFullYear(),\n nowValue.getUTCMonth(),\n nowValue.getUTCDate(),\n ];\n }\n return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];\n }\n\n // convert an array to a date.\n // the array should mirror the parameters below\n // note: all values past the year are optional and will default to the lowest possible value.\n // [year, month, day , hour, minute, second, millisecond]\n function configFromArray(config) {\n var i,\n date,\n input = [],\n currentDate,\n expectedWeekday,\n yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (\n config._dayOfYear > daysInYear(yearToUse) ||\n config._dayOfYear === 0\n ) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] =\n config._a[i] == null ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (\n config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0\n ) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(\n null,\n input\n );\n expectedWeekday = config._useUTC\n ? config._d.getUTCDay()\n : config._d.getDay();\n\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n\n // check for mismatching day of week\n if (\n config._w &&\n typeof config._w.d !== 'undefined' &&\n config._w.d !== expectedWeekday\n ) {\n getParsingFlags(config).weekdayMismatch = true;\n }\n }\n\n function dayOfYearFromWeekInfo(config) {\n var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow, curWeek;\n\n w = config._w;\n if (w.GG != null || w.W != null || w.E != null) {\n dow = 1;\n doy = 4;\n\n // TODO: We need to take the current isoWeekYear, but that depends on\n // how we interpret now (local, utc, fixed offset). So create\n // a now version of current config (take local/utc/offset flags, and\n // create now).\n weekYear = defaults(\n w.GG,\n config._a[YEAR],\n weekOfYear(createLocal(), 1, 4).year\n );\n week = defaults(w.W, 1);\n weekday = defaults(w.E, 1);\n if (weekday < 1 || weekday > 7) {\n weekdayOverflow = true;\n }\n } else {\n dow = config._locale._week.dow;\n doy = config._locale._week.doy;\n\n curWeek = weekOfYear(createLocal(), dow, doy);\n\n weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);\n\n // Default to current week.\n week = defaults(w.w, curWeek.week);\n\n if (w.d != null) {\n // weekday -- low day numbers are considered next week\n weekday = w.d;\n if (weekday < 0 || weekday > 6) {\n weekdayOverflow = true;\n }\n } else if (w.e != null) {\n // local weekday -- counting starts from beginning of week\n weekday = w.e + dow;\n if (w.e < 0 || w.e > 6) {\n weekdayOverflow = true;\n }\n } else {\n // default to beginning of week\n weekday = dow;\n }\n }\n if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {\n getParsingFlags(config)._overflowWeeks = true;\n } else if (weekdayOverflow != null) {\n getParsingFlags(config)._overflowWeekday = true;\n } else {\n temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);\n config._a[YEAR] = temp.year;\n config._dayOfYear = temp.dayOfYear;\n }\n }\n\n // constant that refers to the ISO standard\n hooks.ISO_8601 = function () {};\n\n // constant that refers to the RFC 2822 form\n hooks.RFC_2822 = function () {};\n\n // date from string and format string\n function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i,\n parsedInput,\n tokens,\n token,\n skipped,\n stringLength = string.length,\n totalParsedInputLength = 0,\n era,\n tokenLen;\n\n tokens =\n expandFormat(config._f, config._locale).match(formattingTokens) || [];\n tokenLen = tokens.length;\n for (i = 0; i < tokenLen; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) ||\n [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(\n string.indexOf(parsedInput) + parsedInput.length\n );\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n } else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n } else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver =\n stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (\n config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0\n ) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(\n config._locale,\n config._a[HOUR],\n config._meridiem\n );\n\n // handle era\n era = getParsingFlags(config).era;\n if (era !== null) {\n config._a[YEAR] = config._locale.erasConvertYear(era, config._a[YEAR]);\n }\n\n configFromArray(config);\n checkOverflow(config);\n }\n\n function meridiemFixWrap(locale, hour, meridiem) {\n var isPm;\n\n if (meridiem == null) {\n // nothing to do\n return hour;\n }\n if (locale.meridiemHour != null) {\n return locale.meridiemHour(hour, meridiem);\n } else if (locale.isPM != null) {\n // Fallback\n isPm = locale.isPM(meridiem);\n if (isPm && hour < 12) {\n hour += 12;\n }\n if (!isPm && hour === 12) {\n hour = 0;\n }\n return hour;\n } else {\n // this is not supposed to happen\n return hour;\n }\n }\n\n // date from string and array of format strings\n function configFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n scoreToBeat,\n i,\n currentScore,\n validFormatFound,\n bestFormatIsValid = false,\n configfLen = config._f.length;\n\n if (configfLen === 0) {\n getParsingFlags(config).invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < configfLen; i++) {\n currentScore = 0;\n validFormatFound = false;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._f = config._f[i];\n configFromStringAndFormat(tempConfig);\n\n if (isValid(tempConfig)) {\n validFormatFound = true;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += getParsingFlags(tempConfig).charsLeftOver;\n\n //or tokens\n currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;\n\n getParsingFlags(tempConfig).score = currentScore;\n\n if (!bestFormatIsValid) {\n if (\n scoreToBeat == null ||\n currentScore < scoreToBeat ||\n validFormatFound\n ) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n if (validFormatFound) {\n bestFormatIsValid = true;\n }\n }\n } else {\n if (currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }\n\n function configFromObject(config) {\n if (config._d) {\n return;\n }\n\n var i = normalizeObjectUnits(config._i),\n dayOrDate = i.day === undefined ? i.date : i.day;\n config._a = map(\n [i.year, i.month, dayOrDate, i.hour, i.minute, i.second, i.millisecond],\n function (obj) {\n return obj && parseInt(obj, 10);\n }\n );\n\n configFromArray(config);\n }\n\n function createFromConfig(config) {\n var res = new Moment(checkOverflow(prepareConfig(config)));\n if (res._nextDay) {\n // Adding is smart enough around DST\n res.add(1, 'd');\n res._nextDay = undefined;\n }\n\n return res;\n }\n\n function prepareConfig(config) {\n var input = config._i,\n format = config._f;\n\n config._locale = config._locale || getLocale(config._l);\n\n if (input === null || (format === undefined && input === '')) {\n return createInvalid({ nullInput: true });\n }\n\n if (typeof input === 'string') {\n config._i = input = config._locale.preparse(input);\n }\n\n if (isMoment(input)) {\n return new Moment(checkOverflow(input));\n } else if (isDate(input)) {\n config._d = input;\n } else if (isArray(format)) {\n configFromStringAndArray(config);\n } else if (format) {\n configFromStringAndFormat(config);\n } else {\n configFromInput(config);\n }\n\n if (!isValid(config)) {\n config._d = null;\n }\n\n return config;\n }\n\n function configFromInput(config) {\n var input = config._i;\n if (isUndefined(input)) {\n config._d = new Date(hooks.now());\n } else if (isDate(input)) {\n config._d = new Date(input.valueOf());\n } else if (typeof input === 'string') {\n configFromString(config);\n } else if (isArray(input)) {\n config._a = map(input.slice(0), function (obj) {\n return parseInt(obj, 10);\n });\n configFromArray(config);\n } else if (isObject(input)) {\n configFromObject(config);\n } else if (isNumber(input)) {\n // from milliseconds\n config._d = new Date(input);\n } else {\n hooks.createFromInputFallback(config);\n }\n }\n\n function createLocalOrUTC(input, format, locale, strict, isUTC) {\n var c = {};\n\n if (format === true || format === false) {\n strict = format;\n format = undefined;\n }\n\n if (locale === true || locale === false) {\n strict = locale;\n locale = undefined;\n }\n\n if (\n (isObject(input) && isObjectEmpty(input)) ||\n (isArray(input) && input.length === 0)\n ) {\n input = undefined;\n }\n // object construction must be done this way.\n // https://github.com/moment/moment/issues/1423\n c._isAMomentObject = true;\n c._useUTC = c._isUTC = isUTC;\n c._l = locale;\n c._i = input;\n c._f = format;\n c._strict = strict;\n\n return createFromConfig(c);\n }\n\n function createLocal(input, format, locale, strict) {\n return createLocalOrUTC(input, format, locale, strict, false);\n }\n\n var prototypeMin = deprecate(\n 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',\n function () {\n var other = createLocal.apply(null, arguments);\n if (this.isValid() && other.isValid()) {\n return other < this ? this : other;\n } else {\n return createInvalid();\n }\n }\n ),\n prototypeMax = deprecate(\n 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',\n function () {\n var other = createLocal.apply(null, arguments);\n if (this.isValid() && other.isValid()) {\n return other > this ? this : other;\n } else {\n return createInvalid();\n }\n }\n );\n\n // Pick a moment m from moments so that m[fn](other) is true for all\n // other. This relies on the function fn to be transitive.\n //\n // moments should either be an array of moment objects or an array, whose\n // first element is an array of moment objects.\n function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }\n\n // TODO: Use [].sort instead?\n function min() {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n }\n\n function max() {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isAfter', args);\n }\n\n var now = function () {\n return Date.now ? Date.now() : +new Date();\n };\n\n var ordering = [\n 'year',\n 'quarter',\n 'month',\n 'week',\n 'day',\n 'hour',\n 'minute',\n 'second',\n 'millisecond',\n ];\n\n function isDurationValid(m) {\n var key,\n unitHasDecimal = false,\n i,\n orderLen = ordering.length;\n for (key in m) {\n if (\n hasOwnProp(m, key) &&\n !(\n indexOf.call(ordering, key) !== -1 &&\n (m[key] == null || !isNaN(m[key]))\n )\n ) {\n return false;\n }\n }\n\n for (i = 0; i < orderLen; ++i) {\n if (m[ordering[i]]) {\n if (unitHasDecimal) {\n return false; // only allow non-integers for smallest unit\n }\n if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {\n unitHasDecimal = true;\n }\n }\n }\n\n return true;\n }\n\n function isValid$1() {\n return this._isValid;\n }\n\n function createInvalid$1() {\n return createDuration(NaN);\n }\n\n function Duration(duration) {\n var normalizedInput = normalizeObjectUnits(duration),\n years = normalizedInput.year || 0,\n quarters = normalizedInput.quarter || 0,\n months = normalizedInput.month || 0,\n weeks = normalizedInput.week || normalizedInput.isoWeek || 0,\n days = normalizedInput.day || 0,\n hours = normalizedInput.hour || 0,\n minutes = normalizedInput.minute || 0,\n seconds = normalizedInput.second || 0,\n milliseconds = normalizedInput.millisecond || 0;\n\n this._isValid = isDurationValid(normalizedInput);\n\n // representation for dateAddRemove\n this._milliseconds =\n +milliseconds +\n seconds * 1e3 + // 1000\n minutes * 6e4 + // 1000 * 60\n hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978\n // Because of dateAddRemove treats 24 hours as different from a\n // day when working around DST, we need to store them separately\n this._days = +days + weeks * 7;\n // It is impossible to translate months into days without knowing\n // which months you are are talking about, so we have to store\n // it separately.\n this._months = +months + quarters * 3 + years * 12;\n\n this._data = {};\n\n this._locale = getLocale();\n\n this._bubble();\n }\n\n function isDuration(obj) {\n return obj instanceof Duration;\n }\n\n function absRound(number) {\n if (number < 0) {\n return Math.round(-1 * number) * -1;\n } else {\n return Math.round(number);\n }\n }\n\n // compare two arrays, return the number of differences\n function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if (\n (dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))\n ) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }\n\n // FORMATTING\n\n function offset(token, separator) {\n addFormatToken(token, 0, 0, function () {\n var offset = this.utcOffset(),\n sign = '+';\n if (offset < 0) {\n offset = -offset;\n sign = '-';\n }\n return (\n sign +\n zeroFill(~~(offset / 60), 2) +\n separator +\n zeroFill(~~offset % 60, 2)\n );\n });\n }\n\n offset('Z', ':');\n offset('ZZ', '');\n\n // PARSING\n\n addRegexToken('Z', matchShortOffset);\n addRegexToken('ZZ', matchShortOffset);\n addParseToken(['Z', 'ZZ'], function (input, array, config) {\n config._useUTC = true;\n config._tzm = offsetFromString(matchShortOffset, input);\n });\n\n // HELPERS\n\n // timezone chunker\n // '+10:00' > ['10', '00']\n // '-1530' > ['-15', '30']\n var chunkOffset = /([\\+\\-]|\\d\\d)/gi;\n\n function offsetFromString(matcher, string) {\n var matches = (string || '').match(matcher),\n chunk,\n parts,\n minutes;\n\n if (matches === null) {\n return null;\n }\n\n chunk = matches[matches.length - 1] || [];\n parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];\n minutes = +(parts[1] * 60) + toInt(parts[2]);\n\n return minutes === 0 ? 0 : parts[0] === '+' ? minutes : -minutes;\n }\n\n // Return a moment from input, that is local/utc/zone equivalent to model.\n function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff =\n (isMoment(input) || isDate(input)\n ? input.valueOf()\n : createLocal(input).valueOf()) - res.valueOf();\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(res._d.valueOf() + diff);\n hooks.updateOffset(res, false);\n return res;\n } else {\n return createLocal(input).local();\n }\n }\n\n function getDateOffset(m) {\n // On Firefox.24 Date#getTimezoneOffset returns a floating point.\n // https://github.com/moment/moment/pull/1871\n return -Math.round(m._d.getTimezoneOffset());\n }\n\n // HOOKS\n\n // This function will be called whenever a moment is mutated.\n // It is intended to keep the offset in sync with the timezone.\n hooks.updateOffset = function () {};\n\n // MOMENTS\n\n // keepLocalTime = true means only change the timezone, without\n // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->\n // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset\n // +0200, so we adjust the time as needed, to be valid.\n //\n // Keeping the time actually adds/subtracts (one hour)\n // from the actual represented time. That is why we call updateOffset\n // a second time. In case it wants us to change the offset again\n // _changeInProgress == true case, then we have to adjust, because\n // there is no such time in the given timezone.\n function getSetOffset(input, keepLocalTime, keepMinutes) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n if (input === null) {\n return this;\n }\n } else if (Math.abs(input) < 16 && !keepMinutes) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n addSubtract(\n this,\n createDuration(input - offset, 'm'),\n 1,\n false\n );\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }\n\n function getSetZone(input, keepLocalTime) {\n if (input != null) {\n if (typeof input !== 'string') {\n input = -input;\n }\n\n this.utcOffset(input, keepLocalTime);\n\n return this;\n } else {\n return -this.utcOffset();\n }\n }\n\n function setOffsetToUTC(keepLocalTime) {\n return this.utcOffset(0, keepLocalTime);\n }\n\n function setOffsetToLocal(keepLocalTime) {\n if (this._isUTC) {\n this.utcOffset(0, keepLocalTime);\n this._isUTC = false;\n\n if (keepLocalTime) {\n this.subtract(getDateOffset(this), 'm');\n }\n }\n return this;\n }\n\n function setOffsetToParsedOffset() {\n if (this._tzm != null) {\n this.utcOffset(this._tzm, false, true);\n } else if (typeof this._i === 'string') {\n var tZone = offsetFromString(matchOffset, this._i);\n if (tZone != null) {\n this.utcOffset(tZone);\n } else {\n this.utcOffset(0, true);\n }\n }\n return this;\n }\n\n function hasAlignedHourOffset(input) {\n if (!this.isValid()) {\n return false;\n }\n input = input ? createLocal(input).utcOffset() : 0;\n\n return (this.utcOffset() - input) % 60 === 0;\n }\n\n function isDaylightSavingTime() {\n return (\n this.utcOffset() > this.clone().month(0).utcOffset() ||\n this.utcOffset() > this.clone().month(5).utcOffset()\n );\n }\n\n function isDaylightSavingTimeShifted() {\n if (!isUndefined(this._isDSTShifted)) {\n return this._isDSTShifted;\n }\n\n var c = {},\n other;\n\n copyConfig(c, this);\n c = prepareConfig(c);\n\n if (c._a) {\n other = c._isUTC ? createUTC(c._a) : createLocal(c._a);\n this._isDSTShifted =\n this.isValid() && compareArrays(c._a, other.toArray()) > 0;\n } else {\n this._isDSTShifted = false;\n }\n\n return this._isDSTShifted;\n }\n\n function isLocal() {\n return this.isValid() ? !this._isUTC : false;\n }\n\n function isUtcOffset() {\n return this.isValid() ? this._isUTC : false;\n }\n\n function isUtc() {\n return this.isValid() ? this._isUTC && this._offset === 0 : false;\n }\n\n // ASP.NET json date format regex\n var aspNetRegex = /^(-|\\+)?(?:(\\d*)[. ])?(\\d+):(\\d+)(?::(\\d+)(\\.\\d*)?)?$/,\n // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html\n // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere\n // and further modified to allow for strings containing both week and day\n isoRegex =\n /^(-|\\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;\n\n function createDuration(input, key) {\n var duration = input,\n // matching against regexp is expensive, do it on demand\n match = null,\n sign,\n ret,\n diffRes;\n\n if (isDuration(input)) {\n duration = {\n ms: input._milliseconds,\n d: input._days,\n M: input._months,\n };\n } else if (isNumber(input) || !isNaN(+input)) {\n duration = {};\n if (key) {\n duration[key] = +input;\n } else {\n duration.milliseconds = +input;\n }\n } else if ((match = aspNetRegex.exec(input))) {\n sign = match[1] === '-' ? -1 : 1;\n duration = {\n y: 0,\n d: toInt(match[DATE]) * sign,\n h: toInt(match[HOUR]) * sign,\n m: toInt(match[MINUTE]) * sign,\n s: toInt(match[SECOND]) * sign,\n ms: toInt(absRound(match[MILLISECOND] * 1000)) * sign, // the millisecond decimal point is included in the match\n };\n } else if ((match = isoRegex.exec(input))) {\n sign = match[1] === '-' ? -1 : 1;\n duration = {\n y: parseIso(match[2], sign),\n M: parseIso(match[3], sign),\n w: parseIso(match[4], sign),\n d: parseIso(match[5], sign),\n h: parseIso(match[6], sign),\n m: parseIso(match[7], sign),\n s: parseIso(match[8], sign),\n };\n } else if (duration == null) {\n // checks for null or undefined\n duration = {};\n } else if (\n typeof duration === 'object' &&\n ('from' in duration || 'to' in duration)\n ) {\n diffRes = momentsDifference(\n createLocal(duration.from),\n createLocal(duration.to)\n );\n\n duration = {};\n duration.ms = diffRes.milliseconds;\n duration.M = diffRes.months;\n }\n\n ret = new Duration(duration);\n\n if (isDuration(input) && hasOwnProp(input, '_locale')) {\n ret._locale = input._locale;\n }\n\n if (isDuration(input) && hasOwnProp(input, '_isValid')) {\n ret._isValid = input._isValid;\n }\n\n return ret;\n }\n\n createDuration.fn = Duration.prototype;\n createDuration.invalid = createInvalid$1;\n\n function parseIso(inp, sign) {\n // We'd normally use ~~inp for this, but unfortunately it also\n // converts floats to ints.\n // inp may be undefined, so careful calling replace on it.\n var res = inp && parseFloat(inp.replace(',', '.'));\n // apply sign while we're at it\n return (isNaN(res) ? 0 : res) * sign;\n }\n\n function positiveMomentsDifference(base, other) {\n var res = {};\n\n res.months =\n other.month() - base.month() + (other.year() - base.year()) * 12;\n if (base.clone().add(res.months, 'M').isAfter(other)) {\n --res.months;\n }\n\n res.milliseconds = +other - +base.clone().add(res.months, 'M');\n\n return res;\n }\n\n function momentsDifference(base, other) {\n var res;\n if (!(base.isValid() && other.isValid())) {\n return { milliseconds: 0, months: 0 };\n }\n\n other = cloneWithOffset(other, base);\n if (base.isBefore(other)) {\n res = positiveMomentsDifference(base, other);\n } else {\n res = positiveMomentsDifference(other, base);\n res.milliseconds = -res.milliseconds;\n res.months = -res.months;\n }\n\n return res;\n }\n\n // TODO: remove 'name' arg after deprecation is removed\n function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(\n name,\n 'moment().' +\n name +\n '(period, number) is deprecated. Please use moment().' +\n name +\n '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'\n );\n tmp = val;\n val = period;\n period = tmp;\n }\n\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }\n\n function addSubtract(mom, duration, isAdding, updateOffset) {\n var milliseconds = duration._milliseconds,\n days = absRound(duration._days),\n months = absRound(duration._months);\n\n if (!mom.isValid()) {\n // No op\n return;\n }\n\n updateOffset = updateOffset == null ? true : updateOffset;\n\n if (months) {\n setMonth(mom, get(mom, 'Month') + months * isAdding);\n }\n if (days) {\n set$1(mom, 'Date', get(mom, 'Date') + days * isAdding);\n }\n if (milliseconds) {\n mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);\n }\n if (updateOffset) {\n hooks.updateOffset(mom, days || months);\n }\n }\n\n var add = createAdder(1, 'add'),\n subtract = createAdder(-1, 'subtract');\n\n function isString(input) {\n return typeof input === 'string' || input instanceof String;\n }\n\n // type MomentInput = Moment | Date | string | number | (number | string)[] | MomentInputObject | void; // null | undefined\n function isMomentInput(input) {\n return (\n isMoment(input) ||\n isDate(input) ||\n isString(input) ||\n isNumber(input) ||\n isNumberOrStringArray(input) ||\n isMomentInputObject(input) ||\n input === null ||\n input === undefined\n );\n }\n\n function isMomentInputObject(input) {\n var objectTest = isObject(input) && !isObjectEmpty(input),\n propertyTest = false,\n properties = [\n 'years',\n 'year',\n 'y',\n 'months',\n 'month',\n 'M',\n 'days',\n 'day',\n 'd',\n 'dates',\n 'date',\n 'D',\n 'hours',\n 'hour',\n 'h',\n 'minutes',\n 'minute',\n 'm',\n 'seconds',\n 'second',\n 's',\n 'milliseconds',\n 'millisecond',\n 'ms',\n ],\n i,\n property,\n propertyLen = properties.length;\n\n for (i = 0; i < propertyLen; i += 1) {\n property = properties[i];\n propertyTest = propertyTest || hasOwnProp(input, property);\n }\n\n return objectTest && propertyTest;\n }\n\n function isNumberOrStringArray(input) {\n var arrayTest = isArray(input),\n dataTypeTest = false;\n if (arrayTest) {\n dataTypeTest =\n input.filter(function (item) {\n return !isNumber(item) && isString(input);\n }).length === 0;\n }\n return arrayTest && dataTypeTest;\n }\n\n function isCalendarSpec(input) {\n var objectTest = isObject(input) && !isObjectEmpty(input),\n propertyTest = false,\n properties = [\n 'sameDay',\n 'nextDay',\n 'lastDay',\n 'nextWeek',\n 'lastWeek',\n 'sameElse',\n ],\n i,\n property;\n\n for (i = 0; i < properties.length; i += 1) {\n property = properties[i];\n propertyTest = propertyTest || hasOwnProp(input, property);\n }\n\n return objectTest && propertyTest;\n }\n\n function getCalendarFormat(myMoment, now) {\n var diff = myMoment.diff(now, 'days', true);\n return diff < -6\n ? 'sameElse'\n : diff < -1\n ? 'lastWeek'\n : diff < 0\n ? 'lastDay'\n : diff < 1\n ? 'sameDay'\n : diff < 2\n ? 'nextDay'\n : diff < 7\n ? 'nextWeek'\n : 'sameElse';\n }\n\n function calendar$1(time, formats) {\n // Support for single parameter, formats only overload to the calendar function\n if (arguments.length === 1) {\n if (!arguments[0]) {\n time = undefined;\n formats = undefined;\n } else if (isMomentInput(arguments[0])) {\n time = arguments[0];\n formats = undefined;\n } else if (isCalendarSpec(arguments[0])) {\n formats = arguments[0];\n time = undefined;\n }\n }\n // We want to compare the start of today, vs this.\n // Getting start-of-today depends on whether we're local/utc/offset or not.\n var now = time || createLocal(),\n sod = cloneWithOffset(now, this).startOf('day'),\n format = hooks.calendarFormat(this, sod) || 'sameElse',\n output =\n formats &&\n (isFunction(formats[format])\n ? formats[format].call(this, now)\n : formats[format]);\n\n return this.format(\n output || this.localeData().calendar(format, this, createLocal(now))\n );\n }\n\n function clone() {\n return new Moment(this);\n }\n\n function isAfter(input, units) {\n var localInput = isMoment(input) ? input : createLocal(input);\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n units = normalizeUnits(units) || 'millisecond';\n if (units === 'millisecond') {\n return this.valueOf() > localInput.valueOf();\n } else {\n return localInput.valueOf() < this.clone().startOf(units).valueOf();\n }\n }\n\n function isBefore(input, units) {\n var localInput = isMoment(input) ? input : createLocal(input);\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n units = normalizeUnits(units) || 'millisecond';\n if (units === 'millisecond') {\n return this.valueOf() < localInput.valueOf();\n } else {\n return this.clone().endOf(units).valueOf() < localInput.valueOf();\n }\n }\n\n function isBetween(from, to, units, inclusivity) {\n var localFrom = isMoment(from) ? from : createLocal(from),\n localTo = isMoment(to) ? to : createLocal(to);\n if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) {\n return false;\n }\n inclusivity = inclusivity || '()';\n return (\n (inclusivity[0] === '('\n ? this.isAfter(localFrom, units)\n : !this.isBefore(localFrom, units)) &&\n (inclusivity[1] === ')'\n ? this.isBefore(localTo, units)\n : !this.isAfter(localTo, units))\n );\n }\n\n function isSame(input, units) {\n var localInput = isMoment(input) ? input : createLocal(input),\n inputMs;\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n units = normalizeUnits(units) || 'millisecond';\n if (units === 'millisecond') {\n return this.valueOf() === localInput.valueOf();\n } else {\n inputMs = localInput.valueOf();\n return (\n this.clone().startOf(units).valueOf() <= inputMs &&\n inputMs <= this.clone().endOf(units).valueOf()\n );\n }\n }\n\n function isSameOrAfter(input, units) {\n return this.isSame(input, units) || this.isAfter(input, units);\n }\n\n function isSameOrBefore(input, units) {\n return this.isSame(input, units) || this.isBefore(input, units);\n }\n\n function diff(input, units, asFloat) {\n var that, zoneDelta, output;\n\n if (!this.isValid()) {\n return NaN;\n }\n\n that = cloneWithOffset(input, this);\n\n if (!that.isValid()) {\n return NaN;\n }\n\n zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;\n\n units = normalizeUnits(units);\n\n switch (units) {\n case 'year':\n output = monthDiff(this, that) / 12;\n break;\n case 'month':\n output = monthDiff(this, that);\n break;\n case 'quarter':\n output = monthDiff(this, that) / 3;\n break;\n case 'second':\n output = (this - that) / 1e3;\n break; // 1000\n case 'minute':\n output = (this - that) / 6e4;\n break; // 1000 * 60\n case 'hour':\n output = (this - that) / 36e5;\n break; // 1000 * 60 * 60\n case 'day':\n output = (this - that - zoneDelta) / 864e5;\n break; // 1000 * 60 * 60 * 24, negate dst\n case 'week':\n output = (this - that - zoneDelta) / 6048e5;\n break; // 1000 * 60 * 60 * 24 * 7, negate dst\n default:\n output = this - that;\n }\n\n return asFloat ? output : absFloor(output);\n }\n\n function monthDiff(a, b) {\n if (a.date() < b.date()) {\n // end-of-month calculations work correct when the start month has more\n // days than the end month.\n return -monthDiff(b, a);\n }\n // difference in months\n var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()),\n // b is in (anchor - 1 month, anchor + 1 month)\n anchor = a.clone().add(wholeMonthDiff, 'months'),\n anchor2,\n adjust;\n\n if (b - anchor < 0) {\n anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');\n // linear across the month\n adjust = (b - anchor) / (anchor - anchor2);\n } else {\n anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');\n // linear across the month\n adjust = (b - anchor) / (anchor2 - anchor);\n }\n\n //check for negative zero, return zero if negative zero\n return -(wholeMonthDiff + adjust) || 0;\n }\n\n hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';\n hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';\n\n function toString() {\n return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');\n }\n\n function toISOString(keepOffset) {\n if (!this.isValid()) {\n return null;\n }\n var utc = keepOffset !== true,\n m = utc ? this.clone().utc() : this;\n if (m.year() < 0 || m.year() > 9999) {\n return formatMoment(\n m,\n utc\n ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]'\n : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ'\n );\n }\n if (isFunction(Date.prototype.toISOString)) {\n // native implementation is ~50x faster, use it when we can\n if (utc) {\n return this.toDate().toISOString();\n } else {\n return new Date(this.valueOf() + this.utcOffset() * 60 * 1000)\n .toISOString()\n .replace('Z', formatMoment(m, 'Z'));\n }\n }\n return formatMoment(\n m,\n utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ'\n );\n }\n\n /**\n * Return a human readable representation of a moment that can\n * also be evaluated to get a new moment which is the same\n *\n * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects\n */\n function inspect() {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment',\n zone = '',\n prefix,\n year,\n datetime,\n suffix;\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n prefix = '[' + func + '(\"]';\n year = 0 <= this.year() && this.year() <= 9999 ? 'YYYY' : 'YYYYYY';\n datetime = '-MM-DD[T]HH:mm:ss.SSS';\n suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n }\n\n function format(inputString) {\n if (!inputString) {\n inputString = this.isUtc()\n ? hooks.defaultFormatUtc\n : hooks.defaultFormat;\n }\n var output = formatMoment(this, inputString);\n return this.localeData().postformat(output);\n }\n\n function from(time, withoutSuffix) {\n if (\n this.isValid() &&\n ((isMoment(time) && time.isValid()) || createLocal(time).isValid())\n ) {\n return createDuration({ to: this, from: time })\n .locale(this.locale())\n .humanize(!withoutSuffix);\n } else {\n return this.localeData().invalidDate();\n }\n }\n\n function fromNow(withoutSuffix) {\n return this.from(createLocal(), withoutSuffix);\n }\n\n function to(time, withoutSuffix) {\n if (\n this.isValid() &&\n ((isMoment(time) && time.isValid()) || createLocal(time).isValid())\n ) {\n return createDuration({ from: this, to: time })\n .locale(this.locale())\n .humanize(!withoutSuffix);\n } else {\n return this.localeData().invalidDate();\n }\n }\n\n function toNow(withoutSuffix) {\n return this.to(createLocal(), withoutSuffix);\n }\n\n // If passed a locale key, it will set the locale for this\n // instance. Otherwise, it will return the locale configuration\n // variables for this instance.\n function locale(key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n }\n\n var lang = deprecate(\n 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',\n function (key) {\n if (key === undefined) {\n return this.localeData();\n } else {\n return this.locale(key);\n }\n }\n );\n\n function localeData() {\n return this._locale;\n }\n\n var MS_PER_SECOND = 1000,\n MS_PER_MINUTE = 60 * MS_PER_SECOND,\n MS_PER_HOUR = 60 * MS_PER_MINUTE,\n MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR;\n\n // actual modulo - handles negative numbers (for dates before 1970):\n function mod$1(dividend, divisor) {\n return ((dividend % divisor) + divisor) % divisor;\n }\n\n function localStartOfDate(y, m, d) {\n // the date constructor remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0) {\n // preserve leap years using a full 400 year cycle, then reset\n return new Date(y + 400, m, d) - MS_PER_400_YEARS;\n } else {\n return new Date(y, m, d).valueOf();\n }\n }\n\n function utcStartOfDate(y, m, d) {\n // Date.UTC remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0) {\n // preserve leap years using a full 400 year cycle, then reset\n return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS;\n } else {\n return Date.UTC(y, m, d);\n }\n }\n\n function startOf(units) {\n var time, startOfDate;\n units = normalizeUnits(units);\n if (units === undefined || units === 'millisecond' || !this.isValid()) {\n return this;\n }\n\n startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;\n\n switch (units) {\n case 'year':\n time = startOfDate(this.year(), 0, 1);\n break;\n case 'quarter':\n time = startOfDate(\n this.year(),\n this.month() - (this.month() % 3),\n 1\n );\n break;\n case 'month':\n time = startOfDate(this.year(), this.month(), 1);\n break;\n case 'week':\n time = startOfDate(\n this.year(),\n this.month(),\n this.date() - this.weekday()\n );\n break;\n case 'isoWeek':\n time = startOfDate(\n this.year(),\n this.month(),\n this.date() - (this.isoWeekday() - 1)\n );\n break;\n case 'day':\n case 'date':\n time = startOfDate(this.year(), this.month(), this.date());\n break;\n case 'hour':\n time = this._d.valueOf();\n time -= mod$1(\n time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),\n MS_PER_HOUR\n );\n break;\n case 'minute':\n time = this._d.valueOf();\n time -= mod$1(time, MS_PER_MINUTE);\n break;\n case 'second':\n time = this._d.valueOf();\n time -= mod$1(time, MS_PER_SECOND);\n break;\n }\n\n this._d.setTime(time);\n hooks.updateOffset(this, true);\n return this;\n }\n\n function endOf(units) {\n var time, startOfDate;\n units = normalizeUnits(units);\n if (units === undefined || units === 'millisecond' || !this.isValid()) {\n return this;\n }\n\n startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;\n\n switch (units) {\n case 'year':\n time = startOfDate(this.year() + 1, 0, 1) - 1;\n break;\n case 'quarter':\n time =\n startOfDate(\n this.year(),\n this.month() - (this.month() % 3) + 3,\n 1\n ) - 1;\n break;\n case 'month':\n time = startOfDate(this.year(), this.month() + 1, 1) - 1;\n break;\n case 'week':\n time =\n startOfDate(\n this.year(),\n this.month(),\n this.date() - this.weekday() + 7\n ) - 1;\n break;\n case 'isoWeek':\n time =\n startOfDate(\n this.year(),\n this.month(),\n this.date() - (this.isoWeekday() - 1) + 7\n ) - 1;\n break;\n case 'day':\n case 'date':\n time = startOfDate(this.year(), this.month(), this.date() + 1) - 1;\n break;\n case 'hour':\n time = this._d.valueOf();\n time +=\n MS_PER_HOUR -\n mod$1(\n time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),\n MS_PER_HOUR\n ) -\n 1;\n break;\n case 'minute':\n time = this._d.valueOf();\n time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1;\n break;\n case 'second':\n time = this._d.valueOf();\n time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1;\n break;\n }\n\n this._d.setTime(time);\n hooks.updateOffset(this, true);\n return this;\n }\n\n function valueOf() {\n return this._d.valueOf() - (this._offset || 0) * 60000;\n }\n\n function unix() {\n return Math.floor(this.valueOf() / 1000);\n }\n\n function toDate() {\n return new Date(this.valueOf());\n }\n\n function toArray() {\n var m = this;\n return [\n m.year(),\n m.month(),\n m.date(),\n m.hour(),\n m.minute(),\n m.second(),\n m.millisecond(),\n ];\n }\n\n function toObject() {\n var m = this;\n return {\n years: m.year(),\n months: m.month(),\n date: m.date(),\n hours: m.hours(),\n minutes: m.minutes(),\n seconds: m.seconds(),\n milliseconds: m.milliseconds(),\n };\n }\n\n function toJSON() {\n // new Date(NaN).toJSON() === null\n return this.isValid() ? this.toISOString() : null;\n }\n\n function isValid$2() {\n return isValid(this);\n }\n\n function parsingFlags() {\n return extend({}, getParsingFlags(this));\n }\n\n function invalidAt() {\n return getParsingFlags(this).overflow;\n }\n\n function creationData() {\n return {\n input: this._i,\n format: this._f,\n locale: this._locale,\n isUTC: this._isUTC,\n strict: this._strict,\n };\n }\n\n addFormatToken('N', 0, 0, 'eraAbbr');\n addFormatToken('NN', 0, 0, 'eraAbbr');\n addFormatToken('NNN', 0, 0, 'eraAbbr');\n addFormatToken('NNNN', 0, 0, 'eraName');\n addFormatToken('NNNNN', 0, 0, 'eraNarrow');\n\n addFormatToken('y', ['y', 1], 'yo', 'eraYear');\n addFormatToken('y', ['yy', 2], 0, 'eraYear');\n addFormatToken('y', ['yyy', 3], 0, 'eraYear');\n addFormatToken('y', ['yyyy', 4], 0, 'eraYear');\n\n addRegexToken('N', matchEraAbbr);\n addRegexToken('NN', matchEraAbbr);\n addRegexToken('NNN', matchEraAbbr);\n addRegexToken('NNNN', matchEraName);\n addRegexToken('NNNNN', matchEraNarrow);\n\n addParseToken(\n ['N', 'NN', 'NNN', 'NNNN', 'NNNNN'],\n function (input, array, config, token) {\n var era = config._locale.erasParse(input, token, config._strict);\n if (era) {\n getParsingFlags(config).era = era;\n } else {\n getParsingFlags(config).invalidEra = input;\n }\n }\n );\n\n addRegexToken('y', matchUnsigned);\n addRegexToken('yy', matchUnsigned);\n addRegexToken('yyy', matchUnsigned);\n addRegexToken('yyyy', matchUnsigned);\n addRegexToken('yo', matchEraYearOrdinal);\n\n addParseToken(['y', 'yy', 'yyy', 'yyyy'], YEAR);\n addParseToken(['yo'], function (input, array, config, token) {\n var match;\n if (config._locale._eraYearOrdinalRegex) {\n match = input.match(config._locale._eraYearOrdinalRegex);\n }\n\n if (config._locale.eraYearOrdinalParse) {\n array[YEAR] = config._locale.eraYearOrdinalParse(input, match);\n } else {\n array[YEAR] = parseInt(input, 10);\n }\n });\n\n function localeEras(m, format) {\n var i,\n l,\n date,\n eras = this._eras || getLocale('en')._eras;\n for (i = 0, l = eras.length; i < l; ++i) {\n switch (typeof eras[i].since) {\n case 'string':\n // truncate time\n date = hooks(eras[i].since).startOf('day');\n eras[i].since = date.valueOf();\n break;\n }\n\n switch (typeof eras[i].until) {\n case 'undefined':\n eras[i].until = +Infinity;\n break;\n case 'string':\n // truncate time\n date = hooks(eras[i].until).startOf('day').valueOf();\n eras[i].until = date.valueOf();\n break;\n }\n }\n return eras;\n }\n\n function localeErasParse(eraName, format, strict) {\n var i,\n l,\n eras = this.eras(),\n name,\n abbr,\n narrow;\n eraName = eraName.toUpperCase();\n\n for (i = 0, l = eras.length; i < l; ++i) {\n name = eras[i].name.toUpperCase();\n abbr = eras[i].abbr.toUpperCase();\n narrow = eras[i].narrow.toUpperCase();\n\n if (strict) {\n switch (format) {\n case 'N':\n case 'NN':\n case 'NNN':\n if (abbr === eraName) {\n return eras[i];\n }\n break;\n\n case 'NNNN':\n if (name === eraName) {\n return eras[i];\n }\n break;\n\n case 'NNNNN':\n if (narrow === eraName) {\n return eras[i];\n }\n break;\n }\n } else if ([name, abbr, narrow].indexOf(eraName) >= 0) {\n return eras[i];\n }\n }\n }\n\n function localeErasConvertYear(era, year) {\n var dir = era.since <= era.until ? +1 : -1;\n if (year === undefined) {\n return hooks(era.since).year();\n } else {\n return hooks(era.since).year() + (year - era.offset) * dir;\n }\n }\n\n function getEraName() {\n var i,\n l,\n val,\n eras = this.localeData().eras();\n for (i = 0, l = eras.length; i < l; ++i) {\n // truncate time\n val = this.clone().startOf('day').valueOf();\n\n if (eras[i].since <= val && val <= eras[i].until) {\n return eras[i].name;\n }\n if (eras[i].until <= val && val <= eras[i].since) {\n return eras[i].name;\n }\n }\n\n return '';\n }\n\n function getEraNarrow() {\n var i,\n l,\n val,\n eras = this.localeData().eras();\n for (i = 0, l = eras.length; i < l; ++i) {\n // truncate time\n val = this.clone().startOf('day').valueOf();\n\n if (eras[i].since <= val && val <= eras[i].until) {\n return eras[i].narrow;\n }\n if (eras[i].until <= val && val <= eras[i].since) {\n return eras[i].narrow;\n }\n }\n\n return '';\n }\n\n function getEraAbbr() {\n var i,\n l,\n val,\n eras = this.localeData().eras();\n for (i = 0, l = eras.length; i < l; ++i) {\n // truncate time\n val = this.clone().startOf('day').valueOf();\n\n if (eras[i].since <= val && val <= eras[i].until) {\n return eras[i].abbr;\n }\n if (eras[i].until <= val && val <= eras[i].since) {\n return eras[i].abbr;\n }\n }\n\n return '';\n }\n\n function getEraYear() {\n var i,\n l,\n dir,\n val,\n eras = this.localeData().eras();\n for (i = 0, l = eras.length; i < l; ++i) {\n dir = eras[i].since <= eras[i].until ? +1 : -1;\n\n // truncate time\n val = this.clone().startOf('day').valueOf();\n\n if (\n (eras[i].since <= val && val <= eras[i].until) ||\n (eras[i].until <= val && val <= eras[i].since)\n ) {\n return (\n (this.year() - hooks(eras[i].since).year()) * dir +\n eras[i].offset\n );\n }\n }\n\n return this.year();\n }\n\n function erasNameRegex(isStrict) {\n if (!hasOwnProp(this, '_erasNameRegex')) {\n computeErasParse.call(this);\n }\n return isStrict ? this._erasNameRegex : this._erasRegex;\n }\n\n function erasAbbrRegex(isStrict) {\n if (!hasOwnProp(this, '_erasAbbrRegex')) {\n computeErasParse.call(this);\n }\n return isStrict ? this._erasAbbrRegex : this._erasRegex;\n }\n\n function erasNarrowRegex(isStrict) {\n if (!hasOwnProp(this, '_erasNarrowRegex')) {\n computeErasParse.call(this);\n }\n return isStrict ? this._erasNarrowRegex : this._erasRegex;\n }\n\n function matchEraAbbr(isStrict, locale) {\n return locale.erasAbbrRegex(isStrict);\n }\n\n function matchEraName(isStrict, locale) {\n return locale.erasNameRegex(isStrict);\n }\n\n function matchEraNarrow(isStrict, locale) {\n return locale.erasNarrowRegex(isStrict);\n }\n\n function matchEraYearOrdinal(isStrict, locale) {\n return locale._eraYearOrdinalRegex || matchUnsigned;\n }\n\n function computeErasParse() {\n var abbrPieces = [],\n namePieces = [],\n narrowPieces = [],\n mixedPieces = [],\n i,\n l,\n eras = this.eras();\n\n for (i = 0, l = eras.length; i < l; ++i) {\n namePieces.push(regexEscape(eras[i].name));\n abbrPieces.push(regexEscape(eras[i].abbr));\n narrowPieces.push(regexEscape(eras[i].narrow));\n\n mixedPieces.push(regexEscape(eras[i].name));\n mixedPieces.push(regexEscape(eras[i].abbr));\n mixedPieces.push(regexEscape(eras[i].narrow));\n }\n\n this._erasRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');\n this._erasNameRegex = new RegExp('^(' + namePieces.join('|') + ')', 'i');\n this._erasAbbrRegex = new RegExp('^(' + abbrPieces.join('|') + ')', 'i');\n this._erasNarrowRegex = new RegExp(\n '^(' + narrowPieces.join('|') + ')',\n 'i'\n );\n }\n\n // FORMATTING\n\n addFormatToken(0, ['gg', 2], 0, function () {\n return this.weekYear() % 100;\n });\n\n addFormatToken(0, ['GG', 2], 0, function () {\n return this.isoWeekYear() % 100;\n });\n\n function addWeekYearFormatToken(token, getter) {\n addFormatToken(0, [token, token.length], 0, getter);\n }\n\n addWeekYearFormatToken('gggg', 'weekYear');\n addWeekYearFormatToken('ggggg', 'weekYear');\n addWeekYearFormatToken('GGGG', 'isoWeekYear');\n addWeekYearFormatToken('GGGGG', 'isoWeekYear');\n\n // ALIASES\n\n addUnitAlias('weekYear', 'gg');\n addUnitAlias('isoWeekYear', 'GG');\n\n // PRIORITY\n\n addUnitPriority('weekYear', 1);\n addUnitPriority('isoWeekYear', 1);\n\n // PARSING\n\n addRegexToken('G', matchSigned);\n addRegexToken('g', matchSigned);\n addRegexToken('GG', match1to2, match2);\n addRegexToken('gg', match1to2, match2);\n addRegexToken('GGGG', match1to4, match4);\n addRegexToken('gggg', match1to4, match4);\n addRegexToken('GGGGG', match1to6, match6);\n addRegexToken('ggggg', match1to6, match6);\n\n addWeekParseToken(\n ['gggg', 'ggggg', 'GGGG', 'GGGGG'],\n function (input, week, config, token) {\n week[token.substr(0, 2)] = toInt(input);\n }\n );\n\n addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {\n week[token] = hooks.parseTwoDigitYear(input);\n });\n\n // MOMENTS\n\n function getSetWeekYear(input) {\n return getSetWeekYearHelper.call(\n this,\n input,\n this.week(),\n this.weekday(),\n this.localeData()._week.dow,\n this.localeData()._week.doy\n );\n }\n\n function getSetISOWeekYear(input) {\n return getSetWeekYearHelper.call(\n this,\n input,\n this.isoWeek(),\n this.isoWeekday(),\n 1,\n 4\n );\n }\n\n function getISOWeeksInYear() {\n return weeksInYear(this.year(), 1, 4);\n }\n\n function getISOWeeksInISOWeekYear() {\n return weeksInYear(this.isoWeekYear(), 1, 4);\n }\n\n function getWeeksInYear() {\n var weekInfo = this.localeData()._week;\n return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);\n }\n\n function getWeeksInWeekYear() {\n var weekInfo = this.localeData()._week;\n return weeksInYear(this.weekYear(), weekInfo.dow, weekInfo.doy);\n }\n\n function getSetWeekYearHelper(input, week, weekday, dow, doy) {\n var weeksTarget;\n if (input == null) {\n return weekOfYear(this, dow, doy).year;\n } else {\n weeksTarget = weeksInYear(input, dow, doy);\n if (week > weeksTarget) {\n week = weeksTarget;\n }\n return setWeekAll.call(this, input, week, weekday, dow, doy);\n }\n }\n\n function setWeekAll(weekYear, week, weekday, dow, doy) {\n var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),\n date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);\n\n this.year(date.getUTCFullYear());\n this.month(date.getUTCMonth());\n this.date(date.getUTCDate());\n return this;\n }\n\n // FORMATTING\n\n addFormatToken('Q', 0, 'Qo', 'quarter');\n\n // ALIASES\n\n addUnitAlias('quarter', 'Q');\n\n // PRIORITY\n\n addUnitPriority('quarter', 7);\n\n // PARSING\n\n addRegexToken('Q', match1);\n addParseToken('Q', function (input, array) {\n array[MONTH] = (toInt(input) - 1) * 3;\n });\n\n // MOMENTS\n\n function getSetQuarter(input) {\n return input == null\n ? Math.ceil((this.month() + 1) / 3)\n : this.month((input - 1) * 3 + (this.month() % 3));\n }\n\n // FORMATTING\n\n addFormatToken('D', ['DD', 2], 'Do', 'date');\n\n // ALIASES\n\n addUnitAlias('date', 'D');\n\n // PRIORITY\n addUnitPriority('date', 9);\n\n // PARSING\n\n addRegexToken('D', match1to2);\n addRegexToken('DD', match1to2, match2);\n addRegexToken('Do', function (isStrict, locale) {\n // TODO: Remove \"ordinalParse\" fallback in next major release.\n return isStrict\n ? locale._dayOfMonthOrdinalParse || locale._ordinalParse\n : locale._dayOfMonthOrdinalParseLenient;\n });\n\n addParseToken(['D', 'DD'], DATE);\n addParseToken('Do', function (input, array) {\n array[DATE] = toInt(input.match(match1to2)[0]);\n });\n\n // MOMENTS\n\n var getSetDayOfMonth = makeGetSet('Date', true);\n\n // FORMATTING\n\n addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');\n\n // ALIASES\n\n addUnitAlias('dayOfYear', 'DDD');\n\n // PRIORITY\n addUnitPriority('dayOfYear', 4);\n\n // PARSING\n\n addRegexToken('DDD', match1to3);\n addRegexToken('DDDD', match3);\n addParseToken(['DDD', 'DDDD'], function (input, array, config) {\n config._dayOfYear = toInt(input);\n });\n\n // HELPERS\n\n // MOMENTS\n\n function getSetDayOfYear(input) {\n var dayOfYear =\n Math.round(\n (this.clone().startOf('day') - this.clone().startOf('year')) / 864e5\n ) + 1;\n return input == null ? dayOfYear : this.add(input - dayOfYear, 'd');\n }\n\n // FORMATTING\n\n addFormatToken('m', ['mm', 2], 0, 'minute');\n\n // ALIASES\n\n addUnitAlias('minute', 'm');\n\n // PRIORITY\n\n addUnitPriority('minute', 14);\n\n // PARSING\n\n addRegexToken('m', match1to2);\n addRegexToken('mm', match1to2, match2);\n addParseToken(['m', 'mm'], MINUTE);\n\n // MOMENTS\n\n var getSetMinute = makeGetSet('Minutes', false);\n\n // FORMATTING\n\n addFormatToken('s', ['ss', 2], 0, 'second');\n\n // ALIASES\n\n addUnitAlias('second', 's');\n\n // PRIORITY\n\n addUnitPriority('second', 15);\n\n // PARSING\n\n addRegexToken('s', match1to2);\n addRegexToken('ss', match1to2, match2);\n addParseToken(['s', 'ss'], SECOND);\n\n // MOMENTS\n\n var getSetSecond = makeGetSet('Seconds', false);\n\n // FORMATTING\n\n addFormatToken('S', 0, 0, function () {\n return ~~(this.millisecond() / 100);\n });\n\n addFormatToken(0, ['SS', 2], 0, function () {\n return ~~(this.millisecond() / 10);\n });\n\n addFormatToken(0, ['SSS', 3], 0, 'millisecond');\n addFormatToken(0, ['SSSS', 4], 0, function () {\n return this.millisecond() * 10;\n });\n addFormatToken(0, ['SSSSS', 5], 0, function () {\n return this.millisecond() * 100;\n });\n addFormatToken(0, ['SSSSSS', 6], 0, function () {\n return this.millisecond() * 1000;\n });\n addFormatToken(0, ['SSSSSSS', 7], 0, function () {\n return this.millisecond() * 10000;\n });\n addFormatToken(0, ['SSSSSSSS', 8], 0, function () {\n return this.millisecond() * 100000;\n });\n addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {\n return this.millisecond() * 1000000;\n });\n\n // ALIASES\n\n addUnitAlias('millisecond', 'ms');\n\n // PRIORITY\n\n addUnitPriority('millisecond', 16);\n\n // PARSING\n\n addRegexToken('S', match1to3, match1);\n addRegexToken('SS', match1to3, match2);\n addRegexToken('SSS', match1to3, match3);\n\n var token, getSetMillisecond;\n for (token = 'SSSS'; token.length <= 9; token += 'S') {\n addRegexToken(token, matchUnsigned);\n }\n\n function parseMs(input, array) {\n array[MILLISECOND] = toInt(('0.' + input) * 1000);\n }\n\n for (token = 'S'; token.length <= 9; token += 'S') {\n addParseToken(token, parseMs);\n }\n\n getSetMillisecond = makeGetSet('Milliseconds', false);\n\n // FORMATTING\n\n addFormatToken('z', 0, 0, 'zoneAbbr');\n addFormatToken('zz', 0, 0, 'zoneName');\n\n // MOMENTS\n\n function getZoneAbbr() {\n return this._isUTC ? 'UTC' : '';\n }\n\n function getZoneName() {\n return this._isUTC ? 'Coordinated Universal Time' : '';\n }\n\n var proto = Moment.prototype;\n\n proto.add = add;\n proto.calendar = calendar$1;\n proto.clone = clone;\n proto.diff = diff;\n proto.endOf = endOf;\n proto.format = format;\n proto.from = from;\n proto.fromNow = fromNow;\n proto.to = to;\n proto.toNow = toNow;\n proto.get = stringGet;\n proto.invalidAt = invalidAt;\n proto.isAfter = isAfter;\n proto.isBefore = isBefore;\n proto.isBetween = isBetween;\n proto.isSame = isSame;\n proto.isSameOrAfter = isSameOrAfter;\n proto.isSameOrBefore = isSameOrBefore;\n proto.isValid = isValid$2;\n proto.lang = lang;\n proto.locale = locale;\n proto.localeData = localeData;\n proto.max = prototypeMax;\n proto.min = prototypeMin;\n proto.parsingFlags = parsingFlags;\n proto.set = stringSet;\n proto.startOf = startOf;\n proto.subtract = subtract;\n proto.toArray = toArray;\n proto.toObject = toObject;\n proto.toDate = toDate;\n proto.toISOString = toISOString;\n proto.inspect = inspect;\n if (typeof Symbol !== 'undefined' && Symbol.for != null) {\n proto[Symbol.for('nodejs.util.inspect.custom')] = function () {\n return 'Moment<' + this.format() + '>';\n };\n }\n proto.toJSON = toJSON;\n proto.toString = toString;\n proto.unix = unix;\n proto.valueOf = valueOf;\n proto.creationData = creationData;\n proto.eraName = getEraName;\n proto.eraNarrow = getEraNarrow;\n proto.eraAbbr = getEraAbbr;\n proto.eraYear = getEraYear;\n proto.year = getSetYear;\n proto.isLeapYear = getIsLeapYear;\n proto.weekYear = getSetWeekYear;\n proto.isoWeekYear = getSetISOWeekYear;\n proto.quarter = proto.quarters = getSetQuarter;\n proto.month = getSetMonth;\n proto.daysInMonth = getDaysInMonth;\n proto.week = proto.weeks = getSetWeek;\n proto.isoWeek = proto.isoWeeks = getSetISOWeek;\n proto.weeksInYear = getWeeksInYear;\n proto.weeksInWeekYear = getWeeksInWeekYear;\n proto.isoWeeksInYear = getISOWeeksInYear;\n proto.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear;\n proto.date = getSetDayOfMonth;\n proto.day = proto.days = getSetDayOfWeek;\n proto.weekday = getSetLocaleDayOfWeek;\n proto.isoWeekday = getSetISODayOfWeek;\n proto.dayOfYear = getSetDayOfYear;\n proto.hour = proto.hours = getSetHour;\n proto.minute = proto.minutes = getSetMinute;\n proto.second = proto.seconds = getSetSecond;\n proto.millisecond = proto.milliseconds = getSetMillisecond;\n proto.utcOffset = getSetOffset;\n proto.utc = setOffsetToUTC;\n proto.local = setOffsetToLocal;\n proto.parseZone = setOffsetToParsedOffset;\n proto.hasAlignedHourOffset = hasAlignedHourOffset;\n proto.isDST = isDaylightSavingTime;\n proto.isLocal = isLocal;\n proto.isUtcOffset = isUtcOffset;\n proto.isUtc = isUtc;\n proto.isUTC = isUtc;\n proto.zoneAbbr = getZoneAbbr;\n proto.zoneName = getZoneName;\n proto.dates = deprecate(\n 'dates accessor is deprecated. Use date instead.',\n getSetDayOfMonth\n );\n proto.months = deprecate(\n 'months accessor is deprecated. Use month instead',\n getSetMonth\n );\n proto.years = deprecate(\n 'years accessor is deprecated. Use year instead',\n getSetYear\n );\n proto.zone = deprecate(\n 'moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/',\n getSetZone\n );\n proto.isDSTShifted = deprecate(\n 'isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information',\n isDaylightSavingTimeShifted\n );\n\n function createUnix(input) {\n return createLocal(input * 1000);\n }\n\n function createInZone() {\n return createLocal.apply(null, arguments).parseZone();\n }\n\n function preParsePostFormat(string) {\n return string;\n }\n\n var proto$1 = Locale.prototype;\n\n proto$1.calendar = calendar;\n proto$1.longDateFormat = longDateFormat;\n proto$1.invalidDate = invalidDate;\n proto$1.ordinal = ordinal;\n proto$1.preparse = preParsePostFormat;\n proto$1.postformat = preParsePostFormat;\n proto$1.relativeTime = relativeTime;\n proto$1.pastFuture = pastFuture;\n proto$1.set = set;\n proto$1.eras = localeEras;\n proto$1.erasParse = localeErasParse;\n proto$1.erasConvertYear = localeErasConvertYear;\n proto$1.erasAbbrRegex = erasAbbrRegex;\n proto$1.erasNameRegex = erasNameRegex;\n proto$1.erasNarrowRegex = erasNarrowRegex;\n\n proto$1.months = localeMonths;\n proto$1.monthsShort = localeMonthsShort;\n proto$1.monthsParse = localeMonthsParse;\n proto$1.monthsRegex = monthsRegex;\n proto$1.monthsShortRegex = monthsShortRegex;\n proto$1.week = localeWeek;\n proto$1.firstDayOfYear = localeFirstDayOfYear;\n proto$1.firstDayOfWeek = localeFirstDayOfWeek;\n\n proto$1.weekdays = localeWeekdays;\n proto$1.weekdaysMin = localeWeekdaysMin;\n proto$1.weekdaysShort = localeWeekdaysShort;\n proto$1.weekdaysParse = localeWeekdaysParse;\n\n proto$1.weekdaysRegex = weekdaysRegex;\n proto$1.weekdaysShortRegex = weekdaysShortRegex;\n proto$1.weekdaysMinRegex = weekdaysMinRegex;\n\n proto$1.isPM = localeIsPM;\n proto$1.meridiem = localeMeridiem;\n\n function get$1(format, index, field, setter) {\n var locale = getLocale(),\n utc = createUTC().set(setter, index);\n return locale[field](utc, format);\n }\n\n function listMonthsImpl(format, index, field) {\n if (isNumber(format)) {\n index = format;\n format = undefined;\n }\n\n format = format || '';\n\n if (index != null) {\n return get$1(format, index, field, 'month');\n }\n\n var i,\n out = [];\n for (i = 0; i < 12; i++) {\n out[i] = get$1(format, i, field, 'month');\n }\n return out;\n }\n\n // ()\n // (5)\n // (fmt, 5)\n // (fmt)\n // (true)\n // (true, 5)\n // (true, fmt, 5)\n // (true, fmt)\n function listWeekdaysImpl(localeSorted, format, index, field) {\n if (typeof localeSorted === 'boolean') {\n if (isNumber(format)) {\n index = format;\n format = undefined;\n }\n\n format = format || '';\n } else {\n format = localeSorted;\n index = format;\n localeSorted = false;\n\n if (isNumber(format)) {\n index = format;\n format = undefined;\n }\n\n format = format || '';\n }\n\n var locale = getLocale(),\n shift = localeSorted ? locale._week.dow : 0,\n i,\n out = [];\n\n if (index != null) {\n return get$1(format, (index + shift) % 7, field, 'day');\n }\n\n for (i = 0; i < 7; i++) {\n out[i] = get$1(format, (i + shift) % 7, field, 'day');\n }\n return out;\n }\n\n function listMonths(format, index) {\n return listMonthsImpl(format, index, 'months');\n }\n\n function listMonthsShort(format, index) {\n return listMonthsImpl(format, index, 'monthsShort');\n }\n\n function listWeekdays(localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdays');\n }\n\n function listWeekdaysShort(localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');\n }\n\n function listWeekdaysMin(localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');\n }\n\n getSetGlobalLocale('en', {\n eras: [\n {\n since: '0001-01-01',\n until: +Infinity,\n offset: 1,\n name: 'Anno Domini',\n narrow: 'AD',\n abbr: 'AD',\n },\n {\n since: '0000-12-31',\n until: -Infinity,\n offset: 1,\n name: 'Before Christ',\n narrow: 'BC',\n abbr: 'BC',\n },\n ],\n dayOfMonthOrdinalParse: /\\d{1,2}(th|st|nd|rd)/,\n ordinal: function (number) {\n var b = number % 10,\n output =\n toInt((number % 100) / 10) === 1\n ? 'th'\n : b === 1\n ? 'st'\n : b === 2\n ? 'nd'\n : b === 3\n ? 'rd'\n : 'th';\n return number + output;\n },\n });\n\n // Side effect imports\n\n hooks.lang = deprecate(\n 'moment.lang is deprecated. Use moment.locale instead.',\n getSetGlobalLocale\n );\n hooks.langData = deprecate(\n 'moment.langData is deprecated. Use moment.localeData instead.',\n getLocale\n );\n\n var mathAbs = Math.abs;\n\n function abs() {\n var data = this._data;\n\n this._milliseconds = mathAbs(this._milliseconds);\n this._days = mathAbs(this._days);\n this._months = mathAbs(this._months);\n\n data.milliseconds = mathAbs(data.milliseconds);\n data.seconds = mathAbs(data.seconds);\n data.minutes = mathAbs(data.minutes);\n data.hours = mathAbs(data.hours);\n data.months = mathAbs(data.months);\n data.years = mathAbs(data.years);\n\n return this;\n }\n\n function addSubtract$1(duration, input, value, direction) {\n var other = createDuration(input, value);\n\n duration._milliseconds += direction * other._milliseconds;\n duration._days += direction * other._days;\n duration._months += direction * other._months;\n\n return duration._bubble();\n }\n\n // supports only 2.0-style add(1, 's') or add(duration)\n function add$1(input, value) {\n return addSubtract$1(this, input, value, 1);\n }\n\n // supports only 2.0-style subtract(1, 's') or subtract(duration)\n function subtract$1(input, value) {\n return addSubtract$1(this, input, value, -1);\n }\n\n function absCeil(number) {\n if (number < 0) {\n return Math.floor(number);\n } else {\n return Math.ceil(number);\n }\n }\n\n function bubble() {\n var milliseconds = this._milliseconds,\n days = this._days,\n months = this._months,\n data = this._data,\n seconds,\n minutes,\n hours,\n years,\n monthsFromDays;\n\n // if we have a mix of positive and negative values, bubble down first\n // check: https://github.com/moment/moment/issues/2166\n if (\n !(\n (milliseconds >= 0 && days >= 0 && months >= 0) ||\n (milliseconds <= 0 && days <= 0 && months <= 0)\n )\n ) {\n milliseconds += absCeil(monthsToDays(months) + days) * 864e5;\n days = 0;\n months = 0;\n }\n\n // The following code bubbles up values, see the tests for\n // examples of what that means.\n data.milliseconds = milliseconds % 1000;\n\n seconds = absFloor(milliseconds / 1000);\n data.seconds = seconds % 60;\n\n minutes = absFloor(seconds / 60);\n data.minutes = minutes % 60;\n\n hours = absFloor(minutes / 60);\n data.hours = hours % 24;\n\n days += absFloor(hours / 24);\n\n // convert days to months\n monthsFromDays = absFloor(daysToMonths(days));\n months += monthsFromDays;\n days -= absCeil(monthsToDays(monthsFromDays));\n\n // 12 months -> 1 year\n years = absFloor(months / 12);\n months %= 12;\n\n data.days = days;\n data.months = months;\n data.years = years;\n\n return this;\n }\n\n function daysToMonths(days) {\n // 400 years have 146097 days (taking into account leap year rules)\n // 400 years have 12 months === 4800\n return (days * 4800) / 146097;\n }\n\n function monthsToDays(months) {\n // the reverse of daysToMonths\n return (months * 146097) / 4800;\n }\n\n function as(units) {\n if (!this.isValid()) {\n return NaN;\n }\n var days,\n months,\n milliseconds = this._milliseconds;\n\n units = normalizeUnits(units);\n\n if (units === 'month' || units === 'quarter' || units === 'year') {\n days = this._days + milliseconds / 864e5;\n months = this._months + daysToMonths(days);\n switch (units) {\n case 'month':\n return months;\n case 'quarter':\n return months / 3;\n case 'year':\n return months / 12;\n }\n } else {\n // handle milliseconds separately because of floating point math errors (issue #1867)\n days = this._days + Math.round(monthsToDays(this._months));\n switch (units) {\n case 'week':\n return days / 7 + milliseconds / 6048e5;\n case 'day':\n return days + milliseconds / 864e5;\n case 'hour':\n return days * 24 + milliseconds / 36e5;\n case 'minute':\n return days * 1440 + milliseconds / 6e4;\n case 'second':\n return days * 86400 + milliseconds / 1000;\n // Math.floor prevents floating point math errors here\n case 'millisecond':\n return Math.floor(days * 864e5) + milliseconds;\n default:\n throw new Error('Unknown unit ' + units);\n }\n }\n }\n\n // TODO: Use this.as('ms')?\n function valueOf$1() {\n if (!this.isValid()) {\n return NaN;\n }\n return (\n this._milliseconds +\n this._days * 864e5 +\n (this._months % 12) * 2592e6 +\n toInt(this._months / 12) * 31536e6\n );\n }\n\n function makeAs(alias) {\n return function () {\n return this.as(alias);\n };\n }\n\n var asMilliseconds = makeAs('ms'),\n asSeconds = makeAs('s'),\n asMinutes = makeAs('m'),\n asHours = makeAs('h'),\n asDays = makeAs('d'),\n asWeeks = makeAs('w'),\n asMonths = makeAs('M'),\n asQuarters = makeAs('Q'),\n asYears = makeAs('y');\n\n function clone$1() {\n return createDuration(this);\n }\n\n function get$2(units) {\n units = normalizeUnits(units);\n return this.isValid() ? this[units + 's']() : NaN;\n }\n\n function makeGetter(name) {\n return function () {\n return this.isValid() ? this._data[name] : NaN;\n };\n }\n\n var milliseconds = makeGetter('milliseconds'),\n seconds = makeGetter('seconds'),\n minutes = makeGetter('minutes'),\n hours = makeGetter('hours'),\n days = makeGetter('days'),\n months = makeGetter('months'),\n years = makeGetter('years');\n\n function weeks() {\n return absFloor(this.days() / 7);\n }\n\n var round = Math.round,\n thresholds = {\n ss: 44, // a few seconds to seconds\n s: 45, // seconds to minute\n m: 45, // minutes to hour\n h: 22, // hours to day\n d: 26, // days to month/week\n w: null, // weeks to month\n M: 11, // months to year\n };\n\n // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize\n function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {\n return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);\n }\n\n function relativeTime$1(posNegDuration, withoutSuffix, thresholds, locale) {\n var duration = createDuration(posNegDuration).abs(),\n seconds = round(duration.as('s')),\n minutes = round(duration.as('m')),\n hours = round(duration.as('h')),\n days = round(duration.as('d')),\n months = round(duration.as('M')),\n weeks = round(duration.as('w')),\n years = round(duration.as('y')),\n a =\n (seconds <= thresholds.ss && ['s', seconds]) ||\n (seconds < thresholds.s && ['ss', seconds]) ||\n (minutes <= 1 && ['m']) ||\n (minutes < thresholds.m && ['mm', minutes]) ||\n (hours <= 1 && ['h']) ||\n (hours < thresholds.h && ['hh', hours]) ||\n (days <= 1 && ['d']) ||\n (days < thresholds.d && ['dd', days]);\n\n if (thresholds.w != null) {\n a =\n a ||\n (weeks <= 1 && ['w']) ||\n (weeks < thresholds.w && ['ww', weeks]);\n }\n a = a ||\n (months <= 1 && ['M']) ||\n (months < thresholds.M && ['MM', months]) ||\n (years <= 1 && ['y']) || ['yy', years];\n\n a[2] = withoutSuffix;\n a[3] = +posNegDuration > 0;\n a[4] = locale;\n return substituteTimeAgo.apply(null, a);\n }\n\n // This function allows you to set the rounding function for relative time strings\n function getSetRelativeTimeRounding(roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof roundingFunction === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }\n\n // This function allows you to set a threshold for relative time strings\n function getSetRelativeTimeThreshold(threshold, limit) {\n if (thresholds[threshold] === undefined) {\n return false;\n }\n if (limit === undefined) {\n return thresholds[threshold];\n }\n thresholds[threshold] = limit;\n if (threshold === 's') {\n thresholds.ss = limit - 1;\n }\n return true;\n }\n\n function humanize(argWithSuffix, argThresholds) {\n if (!this.isValid()) {\n return this.localeData().invalidDate();\n }\n\n var withSuffix = false,\n th = thresholds,\n locale,\n output;\n\n if (typeof argWithSuffix === 'object') {\n argThresholds = argWithSuffix;\n argWithSuffix = false;\n }\n if (typeof argWithSuffix === 'boolean') {\n withSuffix = argWithSuffix;\n }\n if (typeof argThresholds === 'object') {\n th = Object.assign({}, thresholds, argThresholds);\n if (argThresholds.s != null && argThresholds.ss == null) {\n th.ss = argThresholds.s - 1;\n }\n }\n\n locale = this.localeData();\n output = relativeTime$1(this, !withSuffix, th, locale);\n\n if (withSuffix) {\n output = locale.pastFuture(+this, output);\n }\n\n return locale.postformat(output);\n }\n\n var abs$1 = Math.abs;\n\n function sign(x) {\n return (x > 0) - (x < 0) || +x;\n }\n\n function toISOString$1() {\n // for ISO strings we do not use the normal bubbling rules:\n // * milliseconds bubble up until they become hours\n // * days do not bubble at all\n // * months bubble up until they become years\n // This is because there is no context-free conversion between hours and days\n // (think of clock changes)\n // and also not between days and months (28-31 days per month)\n if (!this.isValid()) {\n return this.localeData().invalidDate();\n }\n\n var seconds = abs$1(this._milliseconds) / 1000,\n days = abs$1(this._days),\n months = abs$1(this._months),\n minutes,\n hours,\n years,\n s,\n total = this.asSeconds(),\n totalSign,\n ymSign,\n daysSign,\n hmsSign;\n\n if (!total) {\n // this is the same as C#'s (Noda) and python (isodate)...\n // but not other JS (goog.date)\n return 'P0D';\n }\n\n // 3600 seconds -> 60 minutes -> 1 hour\n minutes = absFloor(seconds / 60);\n hours = absFloor(minutes / 60);\n seconds %= 60;\n minutes %= 60;\n\n // 12 months -> 1 year\n years = absFloor(months / 12);\n months %= 12;\n\n // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js\n s = seconds ? seconds.toFixed(3).replace(/\\.?0+$/, '') : '';\n\n totalSign = total < 0 ? '-' : '';\n ymSign = sign(this._months) !== sign(total) ? '-' : '';\n daysSign = sign(this._days) !== sign(total) ? '-' : '';\n hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : '';\n\n return (\n totalSign +\n 'P' +\n (years ? ymSign + years + 'Y' : '') +\n (months ? ymSign + months + 'M' : '') +\n (days ? daysSign + days + 'D' : '') +\n (hours || minutes || seconds ? 'T' : '') +\n (hours ? hmsSign + hours + 'H' : '') +\n (minutes ? hmsSign + minutes + 'M' : '') +\n (seconds ? hmsSign + s + 'S' : '')\n );\n }\n\n var proto$2 = Duration.prototype;\n\n proto$2.isValid = isValid$1;\n proto$2.abs = abs;\n proto$2.add = add$1;\n proto$2.subtract = subtract$1;\n proto$2.as = as;\n proto$2.asMilliseconds = asMilliseconds;\n proto$2.asSeconds = asSeconds;\n proto$2.asMinutes = asMinutes;\n proto$2.asHours = asHours;\n proto$2.asDays = asDays;\n proto$2.asWeeks = asWeeks;\n proto$2.asMonths = asMonths;\n proto$2.asQuarters = asQuarters;\n proto$2.asYears = asYears;\n proto$2.valueOf = valueOf$1;\n proto$2._bubble = bubble;\n proto$2.clone = clone$1;\n proto$2.get = get$2;\n proto$2.milliseconds = milliseconds;\n proto$2.seconds = seconds;\n proto$2.minutes = minutes;\n proto$2.hours = hours;\n proto$2.days = days;\n proto$2.weeks = weeks;\n proto$2.months = months;\n proto$2.years = years;\n proto$2.humanize = humanize;\n proto$2.toISOString = toISOString$1;\n proto$2.toString = toISOString$1;\n proto$2.toJSON = toISOString$1;\n proto$2.locale = locale;\n proto$2.localeData = localeData;\n\n proto$2.toIsoString = deprecate(\n 'toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)',\n toISOString$1\n );\n proto$2.lang = lang;\n\n // FORMATTING\n\n addFormatToken('X', 0, 0, 'unix');\n addFormatToken('x', 0, 0, 'valueOf');\n\n // PARSING\n\n addRegexToken('x', matchSigned);\n addRegexToken('X', matchTimestamp);\n addParseToken('X', function (input, array, config) {\n config._d = new Date(parseFloat(input) * 1000);\n });\n addParseToken('x', function (input, array, config) {\n config._d = new Date(toInt(input));\n });\n\n //! moment.js\n\n hooks.version = '2.29.3';\n\n setHookCallback(createLocal);\n\n hooks.fn = proto;\n hooks.min = min;\n hooks.max = max;\n hooks.now = now;\n hooks.utc = createUTC;\n hooks.unix = createUnix;\n hooks.months = listMonths;\n hooks.isDate = isDate;\n hooks.locale = getSetGlobalLocale;\n hooks.invalid = createInvalid;\n hooks.duration = createDuration;\n hooks.isMoment = isMoment;\n hooks.weekdays = listWeekdays;\n hooks.parseZone = createInZone;\n hooks.localeData = getLocale;\n hooks.isDuration = isDuration;\n hooks.monthsShort = listMonthsShort;\n hooks.weekdaysMin = listWeekdaysMin;\n hooks.defineLocale = defineLocale;\n hooks.updateLocale = updateLocale;\n hooks.locales = listLocales;\n hooks.weekdaysShort = listWeekdaysShort;\n hooks.normalizeUnits = normalizeUnits;\n hooks.relativeTimeRounding = getSetRelativeTimeRounding;\n hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;\n hooks.calendarFormat = getCalendarFormat;\n hooks.prototype = proto;\n\n // currently HTML5 input type only supports 24-hour formats\n hooks.HTML5_FMT = {\n DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', // <input type=\"datetime-local\" />\n DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', // <input type=\"datetime-local\" step=\"1\" />\n DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', // <input type=\"datetime-local\" step=\"0.001\" />\n DATE: 'YYYY-MM-DD', // <input type=\"date\" />\n TIME: 'HH:mm', // <input type=\"time\" />\n TIME_SECONDS: 'HH:mm:ss', // <input type=\"time\" step=\"1\" />\n TIME_MS: 'HH:mm:ss.SSS', // <input type=\"time\" step=\"0.001\" />\n WEEK: 'GGGG-[W]WW', // <input type=\"week\" />\n MONTH: 'YYYY-MM', // <input type=\"month\" />\n };\n\n return hooks;\n\n})));\n","import {\n dictionary,\n locale,\n addMessages,\n _\n} from 'svelte-i18n';\n\nfunction setupI18n({ withLocale: _locale, translations }) {\n locale.subscribe((data) => {\n if (data == null) {\n dictionary.set(translations);\n locale.set(_locale);\n }\n }); // maybe we will need this to make sure that the i18n is set up only once\n /*dictionary.set(translations);\n locale.set(_locale);*/\n}\n\nfunction addNewMessages(lang, dict) {\n addMessages(lang, dict);\n}\n\nfunction setLocale(_locale) {\n locale.set(_locale);\n}\n\nexport { _, setupI18n, addNewMessages, setLocale };\n","export const PlayerBonusCardTranslations = {\n en: {\n bonusCard: {\n date: `Granted date:`,\n bonusName: `Bonus Name`,\n bonusType: `Bonus Type`,\n bonusAmount: `Bonus Amount`,\n wageringAmount: `Wagering Amount`,\n remainingBonus: `Remaining Bonus Amount`,\n forfeitBonus: `Forfeit Bonus`\n }\n },\n zh: {\n bonusCard: {\n date: `授予日期:`,\n bonusName: `獎金名稱`,\n bonusType: `獎金類型`,\n bonusAmount: `獎金金額`,\n wageringAmount: `投注金額`,\n remainingBonus: `剩餘紅利金額`,\n forfeitBonus: `沒收獎金`\n }\n },\n fr: {\n bonusCard: {\n date: `Date d'attribution:`,\n bonusName: `Nom du bonus`,\n bonusType: `Type de bonus`,\n bonusAmount: `Montant du bonus`,\n wageringAmount: `Montant de la mise`,\n remainingBonus: `Montant du bonus restant`,\n forfeitBonus: `Supprimer le bonus`\n }\n },\n ro: {\n bonusCard: {\n date: `Dată Alocare:`,\n bonusName: `Nume bonus`,\n bonusType: `Tip de bonus`,\n bonusAmount: `Sumă`,\n wageringAmount: `Sumă de pariat`,\n remainingBonus: `Bonus rămas`,\n forfeitBonus: `Anulează bonusul`\n }\n },\n es: {\n bonusCard: {\n date: `Fecha de entrega del bono:`,\n bonusName: `Nombre del bono`,\n bonusType: `Tipo de bono`,\n bonusAmount: `Cantidad del bono`,\n wageringAmount: `Cantidad de apuesta`,\n remainingBonus: `Cantidad de bonificación restante`,\n forfeitBonus: `Bono de pérdida`\n }\n },\n pt: {\n bonusCard: {\n date: `Data de atribuição do bônus:`,\n bonusName: `Nome do bônus`,\n bonusType: `Tipo de bônus`,\n bonusAmount: `Valor do bônus`,\n wageringAmount: `Valor da aposta`,\n remainingBonus: `Valor do bônus restante`,\n forfeitBonus: `Bônus de Perda`\n }\n },\n};\n","<svelte:options tag={null} />\n<script lang=\"ts\">\n import { getDevice } from 'rvhelper';\n import { _, addNewMessages, setLocale } from './i18n';\n import { PlayerBonusCardTranslations } from './translations';\n\n import moment from 'moment';\n\n export let bonuswalletid:string = '';\n export let bonusdate:string = '';\n export let bonusstatus:string = '';\n export let bonusname:string = '';\n export let bonustype:string = '';\n export let bonusamount:string = '';\n export let bonuswageringamount:string = '';\n export let bonusremainingamount:string = '';\n export let bonuscurrency:string = '';\n export let lang:string = 'en';\n export let translationUrl:string = '';\n\n let userAgent:string = window.navigator.userAgent;\n let isMobile:boolean = (getDevice(userAgent) === 'PC') ? false : true;\n\n let bonusTypeText:string = '';\n\n const setTranslationUrl = ():void => {\n let url:string = translationUrl;\n\n fetch(url).then((res:any) => res.json())\n .then((res) => {\n Object.keys(res).forEach((item:any):void => {\n addNewMessages(item, res[item]);\n });\n }).catch((err:any) => {\n console.log(err);\n });\n }\n\n\n Object.keys(PlayerBonusCardTranslations).forEach((item:any) => {\n addNewMessages(item, PlayerBonusCardTranslations[item]);\n });\n\n const bonusTypeRewrite = () => {\n bonusTypeText = bonustype;\n\n if (bonusTypeText === 'freeRound') {\n bonusTypeText = 'Free Spins';\n } else if (bonusTypeText === 'freeBet') {\n bonusTypeText = 'Free Bet';\n }\n }\n\n const deleteBonus = () => {\n window.postMessage({ type: 'DisableScroll'}, window.location.href);\n window.postMessage({ type: 'DeleteActiveBonus', bonuswalletid }, window.location.href);\n }\n\n const initialLoad = () => {\n setLocale(lang);\n }\n\n $: lang && initialLoad();\n $: bonustype && bonusTypeRewrite();\n $: translationUrl && setTranslationUrl();\n</script>\n\n<div class=\"BonusCard\" part=\"BonusCard\">\n <div class=\"BonusCardInfo\" part=\"BonusCardInfo\">\n <div class=\"BonusCardRow\" part=\"BonusCardRow\">\n <p class=\"BonusCardRowTitle\" part=\"BonusCardRowTitle\">{$_('bonusCard.date')} <span>{moment(bonusdate).format('DD/MM/YYYY h:mm A')}</span></p>\n <p class=\"BonusCardRowText BonusCardStatus TextCapitalize {bonusstatus === 'active' || bonusstatus === 'released' ? 'StatusActive' : ''} {bonusstatus === 'expired' ? 'StatusExpired' : ''} {bonusstatus === 'forfeited' ? 'StatusForfeited' : ''}\"\n part=\"BonusCardRowText BonusCardStatus TextCapitalize {bonusstatus === 'active' || bonusstatus === 'released' ? 'StatusActive' : ''} {bonusstatus === 'expired' ? 'StatusExpired' : ''} {bonusstatus === 'forfeited' ? 'StatusForfeited' : ''}\">{bonusstatus}</p>\n </div>\n <div class=\"BonusCardRow\" part=\"BonusCardRow\">\n <p class=\"BonusCardRowTitle\" part=\"BonusCardRowTitle\">{$_('bonusCard.bonusName')}</p>\n <p class=\"BonusCardRowText\" part=\"BonusCardRowText\">{bonusname}</p>\n </div>\n <div class=\"BonusCardRow\" part=\"BonusCardRow\">\n <p class=\"BonusCardRowTitle\" part=\"BonusCardRowTitle\">{$_('bonusCard.bonusType')}</p>\n <p class=\"BonusCardRowText TextCapitalize\" part=\"BonusCardRowText TextCapitalize\">{bonusTypeText}</p>\n </div>\n {#if bonusamount}\n <div class=\"BonusCardRow\" part=\"BonusCardRow\">\n <p class=\"BonusCardRowTitle\" part=\"BonusCardRowTitle\">{$_('bonusCard.bonusAmount')}</p>\n <p class=\"BonusCardRowText\" part=\"BonusCardRowText\">{bonusamount} {bonuscurrency}</p>\n </div>\n {/if}\n {#if bonuswageringamount}\n <div class=\"BonusCardRow\" part=\"BonusCardRow\">\n <p class=\"BonusCardRowTitle\" part=\"BonusCardRowTitle\">{$_('bonusCard.wageringAmount')}</p>\n <p class=\"BonusCardRowText\" part=\"BonusCardRowText\">{bonuswageringamount} {bonuscurrency}</p>\n </div>\n {/if}\n {#if bonusremainingamount}\n <div class=\"BonusCardRow\" part=\"BonusCardRow\">\n <p class=\"BonusCardRowTitle\" part=\"BonusCardRowTitle\">{$_('bonusCard.remainingBonus')}</p>\n <p class=\"BonusCardRowText\" part=\"BonusCardRowText\">{bonusremainingamount} {bonuscurrency}</p>\n </div>\n {/if}\n </div>\n {#if bonusstatus === 'active'}\n <button class=\"DeleteBonus {isMobile ? 'DeleteBonusMobile' : ''}\" part=\"DeleteBonus {isMobile ? 'DeleteBonusMobile' : ''}\" on:click={deleteBonus}>{$_('bonusCard.forfeitBonus')}</button>\n {/if}\n</div>\n\n<style lang=\"scss\">\n\n :host {\n font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';\n }\n\n .BonusCard {\n background-color: var(--emfe-w-color-white, #FFFFFF);\n padding: 10px 20px 20px;\n border-radius: 5px;\n box-shadow: 0px 3px 12px var(--emfe-w-color-gray-100, #E6E6E6);\n }\n\n .BonusCardRow {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 2px 10px;\n font-size: 14px;\n .BonusCardRowTitle {\n color: var(--emfe-w-color-black, #000000);\n font-weight: 700;\n span {\n font-weight: 400;\n color: var(--emfe-w-color-gray-300, #58586B);\n }\n }\n .BonusCardRowText {\n color: var(--emfe-w-color-gray-300, #58586B);\n &.BonusCardStatus {\n font-weight: 700;\n color: var(--emfe-w-color-black, #000000);\n }\n &.StatusActive {\n color: #0AA543;\n }\n &.StatusExpired {\n color: #FD2839;\n }\n &.StatusForfeited {\n color: #fd8c2d;\n }\n &.TextCapitalize {\n text-transform: capitalize;\n }\n }\n &:nth-child(even) {\n background-color: var(--emfe-w-color-gray-50, #F9F8F8);\n border-radius: 5px;\n }\n }\n\n .DeleteBonus {\n background: var(--emfe-w-color-primary, #D0046C);\n border: 1px solid var(--emfe-w-color-primary, #D0046C);\n color: var(--emfe-w-color-white, #FFFFFF);\n cursor: pointer;\n border-radius: 5px;\n width: 50%;\n height: 44px;\n font-size: 15px;\n text-transform: uppercase;\n text-align: center;\n transition-duration: 0.3s;\n box-sizing: border-box;\n padding: 10px;\n margin-top: 10px;\n &.DeleteBonusMobile {\n width: 100%;\n }\n &:active {\n background: var(--emfe-w-color-primary-600, #99034F);\n }\n }\n</style>\n","import PlayerBonusCard from './PlayerBonusCard.svelte';\n\n!customElements.get('player-bonus-card') && customElements.define('player-bonus-card', PlayerBonusCard);\nexport default PlayerBonusCard;\n","class Lumo extends HTMLElement {\n static get version() {\n return '1.6.1';\n }\n}\n\ncustomElements.define('vaadin-lumo-styles', Lumo);\n\nexport { Lumo };\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\n/** @type {Promise<void>} */\nlet readyPromise = null;\n\n/** @type {?function(?function())} */\nlet whenReady =\n (window['HTMLImports'] && window['HTMLImports']['whenReady']) || null;\n\n/** @type {function()} */\nlet resolveFn;\n\n/**\n * @param {?function()} callback\n */\nexport default function documentWait(callback) {\n requestAnimationFrame(function () {\n if (whenReady) {\n whenReady(callback);\n } else {\n if (!readyPromise) {\n readyPromise = new Promise((resolve) => {\n resolveFn = resolve;\n });\n if (document.readyState === 'complete') {\n resolveFn();\n } else {\n document.addEventListener('readystatechange', () => {\n if (document.readyState === 'complete') {\n resolveFn();\n }\n });\n }\n }\n readyPromise.then(function () {\n callback && callback();\n });\n }\n });\n}\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport documentWait from './document-wait.js';\n\n/**\n * @typedef {HTMLStyleElement | {getStyle: function():HTMLStyleElement}}\n */\nexport let CustomStyleProvider;\n\nconst SEEN_MARKER = '__seenByShadyCSS';\nconst CACHED_STYLE = '__shadyCSSCachedStyle';\n\n/** @type {?function(!HTMLStyleElement)} */\nlet transformFn = null;\n\n/** @type {?function()} */\nlet validateFn = null;\n\n/**\nThis interface is provided to add document-level <style> elements to ShadyCSS for processing.\nThese styles must be processed by ShadyCSS to simulate ShadowRoot upper-bound encapsulation from outside styles\nIn addition, these styles may also need to be processed for @apply rules and CSS Custom Properties\n\nTo add document-level styles to ShadyCSS, one can call `ShadyCSS.addDocumentStyle(styleElement)` or `ShadyCSS.addDocumentStyle({getStyle: () => styleElement})`\n\nIn addition, if the process used to discover document-level styles can be synchronously flushed, one should set `ShadyCSS.documentStyleFlush`.\nThis function will be called when calculating styles.\n\nAn example usage of the document-level styling api can be found in `examples/document-style-lib.js`\n\n@unrestricted\n*/\nexport default class CustomStyleInterface {\n constructor() {\n /** @type {!Array<!CustomStyleProvider>} */\n this['customStyles'] = [];\n this['enqueued'] = false;\n // NOTE(dfreedm): use quotes here to prevent closure inlining to `function(){}`;\n documentWait(() => {\n if (window['ShadyCSS']['flushCustomStyles']) {\n window['ShadyCSS']['flushCustomStyles']();\n }\n });\n }\n /**\n * Queue a validation for new custom styles to batch style recalculations\n */\n enqueueDocumentValidation() {\n if (this['enqueued'] || !validateFn) {\n return;\n }\n this['enqueued'] = true;\n documentWait(validateFn);\n }\n /**\n * @param {!HTMLStyleElement} style\n */\n addCustomStyle(style) {\n if (!style[SEEN_MARKER]) {\n style[SEEN_MARKER] = true;\n this['customStyles'].push(style);\n this.enqueueDocumentValidation();\n }\n }\n /**\n * @param {!CustomStyleProvider} customStyle\n * @return {HTMLStyleElement}\n */\n getStyleForCustomStyle(customStyle) {\n if (customStyle[CACHED_STYLE]) {\n return customStyle[CACHED_STYLE];\n }\n let style;\n if (customStyle['getStyle']) {\n style = customStyle['getStyle']();\n } else {\n style = customStyle;\n }\n return style;\n }\n /**\n * @return {!Array<!CustomStyleProvider>}\n */\n processStyles() {\n const cs = this['customStyles'];\n for (let i = 0; i < cs.length; i++) {\n const customStyle = cs[i];\n if (customStyle[CACHED_STYLE]) {\n continue;\n }\n const style = this.getStyleForCustomStyle(customStyle);\n if (style) {\n // HTMLImports polyfill may have cloned the style into the main document,\n // which is referenced with __appliedElement.\n const styleToTransform = /** @type {!HTMLStyleElement} */ (style[\n '__appliedElement'\n ] || style);\n if (transformFn) {\n transformFn(styleToTransform);\n }\n customStyle[CACHED_STYLE] = styleToTransform;\n }\n }\n return cs;\n }\n}\n\n/* eslint-disable no-self-assign */\nCustomStyleInterface.prototype['addCustomStyle'] =\n CustomStyleInterface.prototype.addCustomStyle;\nCustomStyleInterface.prototype['getStyleForCustomStyle'] =\n CustomStyleInterface.prototype.getStyleForCustomStyle;\nCustomStyleInterface.prototype['processStyles'] =\n CustomStyleInterface.prototype.processStyles;\n/* eslint-enable no-self-assign */\n\nObject.defineProperties(CustomStyleInterface.prototype, {\n 'transformCallback': {\n /** @return {?function(!HTMLStyleElement)} */\n get() {\n return transformFn;\n },\n /** @param {?function(!HTMLStyleElement)} fn */\n set(fn) {\n transformFn = fn;\n },\n },\n 'validateCallback': {\n /** @return {?function()} */\n get() {\n return validateFn;\n },\n /**\n * @param {?function()} fn\n * @this {CustomStyleInterface}\n */\n set(fn) {\n let needsEnqueue = false;\n if (!validateFn) {\n needsEnqueue = true;\n }\n validateFn = fn;\n if (needsEnqueue) {\n this.enqueueDocumentValidation();\n }\n },\n },\n});\n\n/** @typedef {{\n * customStyles: !Array<!CustomStyleProvider>,\n * addCustomStyle: function(!CustomStyleProvider),\n * getStyleForCustomStyle: function(!CustomStyleProvider): HTMLStyleElement,\n * findStyles: function(),\n * transformCallback: ?function(!HTMLStyleElement),\n * validateCallback: ?function()\n * }}\n */\nexport const CustomStyleInterfaceInterface = {};\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nexport const VAR_ASSIGN = /(?:^|[;\\s{]\\s*)(--[\\w-]*?)\\s*:\\s*(?:((?:'(?:\\\\'|.)*?'|\"(?:\\\\\"|.)*?\"|\\([^)]*?\\)|[^};{])+)|\\{([^}]*)\\}(?:(?=[;\\s}])|$))/gi;\nexport const MIXIN_MATCH = /(?:^|\\W+)@apply\\s*\\(?([^);\\n]*)\\)?/gi;\nexport const VAR_CONSUMED = /(--[\\w-]+)\\s*([:,;)]|$)/gi;\nexport const ANIMATION_MATCH = /(animation\\s*:)|(animation-name\\s*:)/;\nexport const MEDIA_MATCH = /@media\\s(.*)/;\nexport const IS_VAR = /^--/;\nexport const BRACKETED = /\\{[^}]*\\}/g;\nexport const HOST_PREFIX = '(?:^|[^.#[:])';\nexport const HOST_SUFFIX = '($|[.:[\\\\s>+~])';\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport {MIXIN_MATCH, VAR_ASSIGN} from './common-regex.js';\n\n/**\n * @param {Element} element\n * @param {Object=} properties\n */\nexport function updateNativeProperties(element, properties) {\n // remove previous properties\n for (let p in properties) {\n // NOTE: for bc with shim, don't apply null values.\n if (p === null) {\n element.style.removeProperty(p);\n } else {\n element.style.setProperty(p, properties[p]);\n }\n }\n}\n\n/**\n * @param {Element} element\n * @param {string} property\n * @return {string}\n */\nexport function getComputedStyleValue(element, property) {\n /**\n * @const {string}\n */\n const value = window.getComputedStyle(element).getPropertyValue(property);\n if (!value) {\n return '';\n } else {\n return value.trim();\n }\n}\n\n/**\n * return true if `cssText` contains a mixin definition or consumption\n * @param {string} cssText\n * @return {boolean}\n */\nexport function detectMixin(cssText) {\n const has = MIXIN_MATCH.test(cssText) || VAR_ASSIGN.test(cssText);\n // reset state of the regexes\n MIXIN_MATCH.lastIndex = 0;\n VAR_ASSIGN.lastIndex = 0;\n return has;\n}\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nexport const nativeShadow = !(\n window['ShadyDOM'] && window['ShadyDOM']['inUse']\n);\nlet nativeCssVariables_;\n\n/**\n * @param {(ShadyCSSOptions | ShadyCSSInterface)=} settings\n */\nfunction calcCssVariables(settings) {\n if (settings && settings['shimcssproperties']) {\n nativeCssVariables_ = false;\n } else {\n // chrome 49 has semi-working css vars, check if box-shadow works\n // safari 9.1 has a recalc bug: https://bugs.webkit.org/show_bug.cgi?id=155782\n // However, shim css custom properties are only supported with ShadyDOM enabled,\n // so fall back on native if we do not detect ShadyDOM\n // Edge 15: custom properties used in ::before and ::after will also be used in the parent element\n // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/12414257/\n nativeCssVariables_ =\n nativeShadow ||\n Boolean(\n !navigator.userAgent.match(/AppleWebKit\\/601|Edge\\/15/) &&\n window.CSS &&\n CSS.supports &&\n CSS.supports('box-shadow', '0 0 0 var(--foo)')\n );\n }\n}\n\n/** @type {string | undefined} */\nexport let cssBuild;\nif (window.ShadyCSS && window.ShadyCSS.cssBuild !== undefined) {\n cssBuild = window.ShadyCSS.cssBuild;\n}\n\n/** @type {boolean} */\nexport const disableRuntime = Boolean(\n window.ShadyCSS && window.ShadyCSS.disableRuntime\n);\n\nif (window.ShadyCSS && window.ShadyCSS.nativeCss !== undefined) {\n nativeCssVariables_ = window.ShadyCSS.nativeCss;\n} else if (window.ShadyCSS) {\n calcCssVariables(window.ShadyCSS);\n // reset window variable to let ShadyCSS API take its place\n window.ShadyCSS = undefined;\n} else {\n calcCssVariables(window['WebComponents'] && window['WebComponents']['flags']);\n}\n\n// Hack for type error under new type inference which doesn't like that\n// nativeCssVariables is updated in a function and assigns the type\n// `function(): ?` instead of `boolean`.\nexport const nativeCssVariables = /** @type {boolean} */ (nativeCssVariables_);\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport CustomStyleInterface from '../src/custom-style-interface.js';\n// prettier-ignore\nimport {getComputedStyleValue, updateNativeProperties} from '../src/common-utils.js';\n// prettier-ignore\nimport {nativeCssVariables, nativeShadow, cssBuild, disableRuntime} from '../src/style-settings.js';\n\nconst customStyleInterface = new CustomStyleInterface();\n\nif (!window.ShadyCSS) {\n window.ShadyCSS = {\n /**\n * @param {!HTMLTemplateElement} template\n * @param {string} elementName\n * @param {string=} elementExtends\n */\n prepareTemplate(template, elementName, elementExtends) {}, // eslint-disable-line @typescript-eslint/no-unused-vars\n\n /**\n * @param {!HTMLTemplateElement} template\n * @param {string} elementName\n */\n prepareTemplateDom(template, elementName) {}, // eslint-disable-line @typescript-eslint/no-unused-vars\n\n /**\n * @param {!HTMLTemplateElement} template\n * @param {string} elementName\n * @param {string=} elementExtends\n */\n prepareTemplateStyles(template, elementName, elementExtends) {}, // eslint-disable-line @typescript-eslint/no-unused-vars\n\n /**\n * @param {Element} element\n * @param {Object=} properties\n */\n styleSubtree(element, properties) {\n customStyleInterface.processStyles();\n updateNativeProperties(element, properties);\n },\n\n /**\n * @param {Element} element\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n styleElement(element) {\n customStyleInterface.processStyles();\n },\n\n /**\n * @param {Object=} properties\n */\n styleDocument(properties) {\n customStyleInterface.processStyles();\n updateNativeProperties(document.body, properties);\n },\n\n /**\n * @param {Element} element\n * @param {string} property\n * @return {string}\n */\n getComputedStyleValue(element, property) {\n return getComputedStyleValue(element, property);\n },\n\n flushCustomStyles() {},\n nativeCss: nativeCssVariables,\n nativeShadow: nativeShadow,\n cssBuild: cssBuild,\n disableRuntime: disableRuntime,\n };\n}\n\nwindow.ShadyCSS.CustomStyleInterface = customStyleInterface;\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n/* eslint-disable no-unused-vars */\n/**\n * When using Closure Compiler, JSCompiler_renameProperty(property, object) is replaced by the munged name for object[property]\n * We cannot alias this function, so we have to use a small shim that has the same behavior when not compiling.\n *\n * @param {?} prop Property name\n * @param {*} obj Reference object\n * @return {string} Potentially renamed property name\n */\nwindow.JSCompiler_renameProperty = function(prop, obj) {\n return prop;\n};\n/* eslint-enable */\n\nexport {};\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\nimport './boot.js';\n\nlet CSS_URL_RX = /(url\\()([^)]*)(\\))/g;\nlet ABS_URL = /(^\\/[^\\/])|(^#)|(^[\\w-\\d]*:)/;\nlet workingURL;\nlet resolveDoc;\n/**\n * Resolves the given URL against the provided `baseUri'.\n *\n * Note that this function performs no resolution for URLs that start\n * with `/` (absolute URLs) or `#` (hash identifiers). For general purpose\n * URL resolution, use `window.URL`.\n *\n * @param {string} url Input URL to resolve\n * @param {?string=} baseURI Base URI to resolve the URL against\n * @return {string} resolved URL\n */\nexport function resolveUrl(url, baseURI) {\n if (url && ABS_URL.test(url)) {\n return url;\n }\n if (url === '//') {\n return url;\n }\n // Lazy feature detection.\n if (workingURL === undefined) {\n workingURL = false;\n try {\n const u = new URL('b', 'http://a');\n u.pathname = 'c%20d';\n workingURL = (u.href === 'http://a/c%20d');\n } catch (e) {\n // silently fail\n }\n }\n if (!baseURI) {\n baseURI = document.baseURI || window.location.href;\n }\n if (workingURL) {\n try {\n return (new URL(url, baseURI)).href;\n } catch (e) {\n // Bad url or baseURI structure. Do not attempt to resolve.\n return url;\n }\n }\n // Fallback to creating an anchor into a disconnected document.\n if (!resolveDoc) {\n resolveDoc = document.implementation.createHTMLDocument('temp');\n resolveDoc.base = resolveDoc.createElement('base');\n resolveDoc.head.appendChild(resolveDoc.base);\n resolveDoc.anchor = resolveDoc.createElement('a');\n resolveDoc.body.appendChild(resolveDoc.anchor);\n }\n resolveDoc.base.href = baseURI;\n resolveDoc.anchor.href = url;\n return resolveDoc.anchor.href || url;\n\n}\n\n/**\n * Resolves any relative URL's in the given CSS text against the provided\n * `ownerDocument`'s `baseURI`.\n *\n * @param {string} cssText CSS text to process\n * @param {string} baseURI Base URI to resolve the URL against\n * @return {string} Processed CSS text with resolved URL's\n */\nexport function resolveCss(cssText, baseURI) {\n return cssText.replace(CSS_URL_RX, function(m, pre, url, post) {\n return pre + '\\'' +\n resolveUrl(url.replace(/[\"']/g, ''), baseURI) +\n '\\'' + post;\n });\n}\n\n/**\n * Returns a path from a given `url`. The path includes the trailing\n * `/` from the url.\n *\n * @param {string} url Input URL to transform\n * @return {string} resolved path\n */\nexport function pathFromUrl(url) {\n return url.substring(0, url.lastIndexOf('/') + 1);\n}\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\nimport './boot.js';\nimport { pathFromUrl } from './resolve-url.js';\nexport const useShadow = !(window.ShadyDOM) || !(window.ShadyDOM.inUse);\nexport const useNativeCSSProperties = Boolean(!window.ShadyCSS || window.ShadyCSS.nativeCss);\nexport const useNativeCustomElements = !(window.customElements.polyfillWrapFlushCallback);\nexport const supportsAdoptingStyleSheets = useShadow &&\n ('adoptedStyleSheets' in Document.prototype) &&\n ('replaceSync' in CSSStyleSheet.prototype) &&\n // Since spec may change, feature detect exact API we need\n (() => {\n try {\n const sheet = new CSSStyleSheet();\n sheet.replaceSync('');\n const host = document.createElement('div');\n host.attachShadow({mode: 'open'});\n host.shadowRoot.adoptedStyleSheets = [sheet];\n return (host.shadowRoot.adoptedStyleSheets[0] === sheet);\n } catch(e) {\n return false;\n }\n })();\n\n/**\n * Globally settable property that is automatically assigned to\n * `ElementMixin` instances, useful for binding in templates to\n * make URL's relative to an application's root. Defaults to the main\n * document URL, but can be overridden by users. It may be useful to set\n * `rootPath` to provide a stable application mount path when\n * using client side routing.\n */\nexport let rootPath = window.Polymer && window.Polymer.rootPath ||\n pathFromUrl(document.baseURI || window.location.href);\n\n/**\n * Sets the global rootPath property used by `ElementMixin` and\n * available via `rootPath`.\n *\n * @param {string} path The new root path\n * @return {void}\n */\nexport const setRootPath = function(path) {\n rootPath = path;\n};\n\n/**\n * A global callback used to sanitize any value before inserting it into the DOM.\n * The callback signature is:\n *\n * function sanitizeDOMValue(value, name, type, node) { ... }\n *\n * Where:\n *\n * `value` is the value to sanitize.\n * `name` is the name of an attribute or property (for example, href).\n * `type` indicates where the value is being inserted: one of property, attribute, or text.\n * `node` is the node where the value is being inserted.\n *\n * @type {(function(*,string,string,?Node):*)|undefined}\n */\nexport let sanitizeDOMValue =\n window.Polymer && window.Polymer.sanitizeDOMValue || undefined;\n\n/**\n * Sets the global sanitizeDOMValue available via this module's exported\n * `sanitizeDOMValue` variable.\n *\n * @param {(function(*,string,string,?Node):*)|undefined} newSanitizeDOMValue the global sanitizeDOMValue callback\n * @return {void}\n */\nexport const setSanitizeDOMValue = function(newSanitizeDOMValue) {\n sanitizeDOMValue = newSanitizeDOMValue;\n};\n\n/**\n * Gets sanitizeDOMValue, for environments that don't well support `export let`.\n *\n * @return {(function(*,string,string,?Node):*)|undefined} sanitizeDOMValue\n */\nexport const getSanitizeDOMValue = function() {\n return sanitizeDOMValue;\n};\n\n/**\n * Globally settable property to make Polymer Gestures use passive TouchEvent listeners when recognizing gestures.\n * When set to `true`, gestures made from touch will not be able to prevent scrolling, allowing for smoother\n * scrolling performance.\n * Defaults to `false` for backwards compatibility.\n */\nexport let passiveTouchGestures =\n window.Polymer && window.Polymer.setPassiveTouchGestures || false;\n\n/**\n * Sets `passiveTouchGestures` globally for all elements using Polymer Gestures.\n *\n * @param {boolean} usePassive enable or disable passive touch gestures globally\n * @return {void}\n */\nexport const setPassiveTouchGestures = function(usePassive) {\n passiveTouchGestures = usePassive;\n};\n\n/**\n * Setting to ensure Polymer template evaluation only occurs based on tempates\n * defined in trusted script. When true, `<dom-module>` re-registration is\n * disallowed, `<dom-bind>` is disabled, and `<dom-if>`/`<dom-repeat>`\n * templates will only evaluate in the context of a trusted element template.\n */\nexport let strictTemplatePolicy =\n window.Polymer && window.Polymer.strictTemplatePolicy || false;\n\n/**\n * Sets `strictTemplatePolicy` globally for all elements\n *\n * @param {boolean} useStrictPolicy enable or disable strict template policy\n * globally\n * @return {void}\n */\nexport const setStrictTemplatePolicy = function(useStrictPolicy) {\n strictTemplatePolicy = useStrictPolicy;\n};\n\n/**\n * Setting to enable dom-module lookup from Polymer.Element. By default,\n * templates must be defined in script using the `static get template()`\n * getter and the `html` tag function. To enable legacy loading of templates\n * via dom-module, set this flag to true.\n */\nexport let allowTemplateFromDomModule =\n window.Polymer && window.Polymer.allowTemplateFromDomModule || false;\n\n/**\n * Sets `lookupTemplateFromDomModule` globally for all elements\n *\n * @param {boolean} allowDomModule enable or disable template lookup\n * globally\n * @return {void}\n */\nexport const setAllowTemplateFromDomModule = function(allowDomModule) {\n allowTemplateFromDomModule = allowDomModule;\n};\n\n/**\n * Setting to skip processing style includes and re-writing urls in css styles.\n * Normally \"included\" styles are pulled into the element and all urls in styles\n * are re-written to be relative to the containing script url.\n * If no includes or relative urls are used in styles, these steps can be\n * skipped as an optimization.\n */\nexport let legacyOptimizations =\n window.Polymer && window.Polymer.legacyOptimizations || false;\n\n/**\n * Sets `legacyOptimizations` globally for all elements to enable optimizations\n * when only legacy based elements are used.\n *\n * @param {boolean} useLegacyOptimizations enable or disable legacy optimizations\n * includes and url rewriting\n * @return {void}\n */\nexport const setLegacyOptimizations = function(useLegacyOptimizations) {\n legacyOptimizations = useLegacyOptimizations;\n};\n\n/**\n * Setting to add warnings useful when migrating from Polymer 1.x to 2.x.\n */\nexport let legacyWarnings =\n window.Polymer && window.Polymer.legacyWarnings || false;\n\n/**\n * Sets `legacyWarnings` globally for all elements to migration warnings.\n *\n * @param {boolean} useLegacyWarnings enable or disable warnings\n * @return {void}\n */\nexport const setLegacyWarnings = function(useLegacyWarnings) {\n legacyWarnings = useLegacyWarnings;\n};\n\n/**\n * Setting to perform initial rendering synchronously when running under ShadyDOM.\n * This matches the behavior of Polymer 1.\n */\nexport let syncInitialRender =\n window.Polymer && window.Polymer.syncInitialRender || false;\n\n/**\n * Sets `syncInitialRender` globally for all elements to enable synchronous\n * initial rendering.\n *\n * @param {boolean} useSyncInitialRender enable or disable synchronous initial\n * rendering globally.\n * @return {void}\n */\nexport const setSyncInitialRender = function(useSyncInitialRender) {\n syncInitialRender = useSyncInitialRender;\n};\n\n/**\n * Setting to retain the legacy Polymer 1 behavior for multi-property\n * observers around undefined values. Observers and computed property methods\n * are not called until no argument is undefined.\n */\nexport let legacyUndefined =\n window.Polymer && window.Polymer.legacyUndefined || false;\n\n/**\n * Sets `legacyUndefined` globally for all elements to enable legacy\n * multi-property behavior for undefined values.\n *\n * @param {boolean} useLegacyUndefined enable or disable legacy\n * multi-property behavior for undefined.\n * @return {void}\n */\nexport const setLegacyUndefined = function(useLegacyUndefined) {\n legacyUndefined = useLegacyUndefined;\n};\n\n/**\n * Setting to ensure computed properties are computed in order to ensure\n * re-computation never occurs in a given turn.\n */\nexport let orderedComputed =\n window.Polymer && window.Polymer.orderedComputed || false;\n\n/**\n * Sets `orderedComputed` globally for all elements to enable ordered computed\n * property computation.\n *\n * @param {boolean} useOrderedComputed enable or disable ordered computed effects\n * @return {void}\n */\nexport const setOrderedComputed = function(useOrderedComputed) {\n orderedComputed = useOrderedComputed;\n};\n\n/**\n * Setting to cancel synthetic click events fired by older mobile browsers. Modern browsers\n * no longer fire synthetic click events, and the cancellation behavior can interfere\n * when programmatically clicking on elements.\n */\nexport let cancelSyntheticClickEvents = true;\n\n/**\n * Sets `setCancelSyntheticEvents` globally for all elements to cancel synthetic click events.\n *\n * @param {boolean} useCancelSyntheticClickEvents enable or disable cancelling synthetic\n * events\n * @return {void}\n */\nexport const setCancelSyntheticClickEvents = function(useCancelSyntheticClickEvents) {\n cancelSyntheticClickEvents = useCancelSyntheticClickEvents;\n};\n\n/**\n * Setting to remove nested templates inside `dom-if` and `dom-repeat` as\n * part of element template parsing. This is a performance optimization that\n * eliminates most of the tax of needing two elements due to the loss of\n * type-extended templates as a result of the V1 specification changes.\n */\nexport let removeNestedTemplates =\n window.Polymer && window.Polymer.removeNestedTemplates || false;\n\n/**\n * Sets `removeNestedTemplates` globally, to eliminate nested templates\n * inside `dom-if` and `dom-repeat` as part of template parsing.\n *\n * @param {boolean} useRemoveNestedTemplates enable or disable removing nested\n * templates during parsing\n * @return {void}\n */\nexport const setRemoveNestedTemplates = function(useRemoveNestedTemplates) {\n removeNestedTemplates = useRemoveNestedTemplates;\n};\n\n/**\n * Setting to place `dom-if` elements in a performance-optimized mode that takes\n * advantage of lighter-weight host runtime template stamping to eliminate the\n * need for an intermediate Templatizer `TemplateInstance` to mange the nodes\n * stamped by `dom-if`. Under this setting, any Templatizer-provided API's\n * such as `modelForElement` will not be available for nodes stamped by\n * `dom-if`.\n */\nexport let fastDomIf = window.Polymer && window.Polymer.fastDomIf || false;\n\n/**\n * Sets `fastDomIf` globally, to put `dom-if` in a performance-optimized mode.\n *\n * @param {boolean} useFastDomIf enable or disable `dom-if` fast-mode\n * @return {void}\n */\nexport const setFastDomIf = function(useFastDomIf) {\n fastDomIf = useFastDomIf;\n};\n\n/**\n * Setting to disable `dom-change` and `rendered-item-count` events from\n * `dom-if` and `dom-repeat`. Users can opt back into `dom-change` events by\n * setting the `notify-dom-change` attribute (`notifyDomChange: true` property)\n * to `dom-if`/`don-repeat` instances.\n */\nexport let suppressTemplateNotifications =\n window.Polymer && window.Polymer.suppressTemplateNotifications || false;\n\n/**\n * Sets `suppressTemplateNotifications` globally, to disable `dom-change` and\n * `rendered-item-count` events from `dom-if` and `dom-repeat`.\n *\n * @param {boolean} suppress enable or disable `suppressTemplateNotifications`\n * @return {void}\n */\nexport const setSuppressTemplateNotifications = function(suppress) {\n suppressTemplateNotifications = suppress;\n};\n\n/**\n * Setting to disable use of dynamic attributes. This is an optimization\n * to avoid setting `observedAttributes`. Instead attributes are read\n * once at create time and set/removeAttribute are patched.\n */\nexport let legacyNoObservedAttributes =\n window.Polymer && window.Polymer.legacyNoObservedAttributes || false;\n\n/**\n * Sets `legacyNoObservedAttributes` globally, to disable `observedAttributes`.\n *\n * @param {boolean} noObservedAttributes enable or disable `legacyNoObservedAttributes`\n * @return {void}\n */\nexport const setLegacyNoObservedAttributes = function(noObservedAttributes) {\n legacyNoObservedAttributes = noObservedAttributes;\n};\n\n/**\n * Setting to enable use of `adoptedStyleSheets` for sharing style sheets\n * between component instances' shadow roots, if the app uses built Shady CSS\n * styles.\n */\nexport let useAdoptedStyleSheetsWithBuiltCSS =\n window.Polymer && window.Polymer.useAdoptedStyleSheetsWithBuiltCSS || false;\n\n/**\n * Sets `useAdoptedStyleSheetsWithBuiltCSS` globally.\n *\n * @param {boolean} value enable or disable `useAdoptedStyleSheetsWithBuiltCSS`\n * @return {void}\n */\nexport const setUseAdoptedStyleSheetsWithBuiltCSS = function(value) {\n useAdoptedStyleSheetsWithBuiltCSS = value;\n};\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\nimport '../utils/boot.js';\n\nimport { resolveUrl, pathFromUrl } from '../utils/resolve-url.js';\nimport { strictTemplatePolicy } from '../utils/settings.js';\n\nlet modules = {};\nlet lcModules = {};\n/**\n * Sets a dom-module into the global registry by id.\n *\n * @param {string} id dom-module id\n * @param {DomModule} module dom-module instance\n * @return {void}\n */\nfunction setModule(id, module) {\n // store id separate from lowercased id so that\n // in all cases mixedCase id will stored distinctly\n // and lowercase version is a fallback\n modules[id] = lcModules[id.toLowerCase()] = module;\n}\n/**\n * Retrieves a dom-module from the global registry by id.\n *\n * @param {string} id dom-module id\n * @return {DomModule!} dom-module instance\n */\nfunction findModule(id) {\n return modules[id] || lcModules[id.toLowerCase()];\n}\n\nfunction styleOutsideTemplateCheck(inst) {\n if (inst.querySelector('style')) {\n console.warn('dom-module %s has style outside template', inst.id);\n }\n}\n\n/**\n * The `dom-module` element registers the dom it contains to the name given\n * by the module's id attribute. It provides a unified database of dom\n * accessible via its static `import` API.\n *\n * A key use case of `dom-module` is for providing custom element `<template>`s\n * via HTML imports that are parsed by the native HTML parser, that can be\n * relocated during a bundling pass and still looked up by `id`.\n *\n * Example:\n *\n * <dom-module id=\"foo\">\n * <img src=\"stuff.png\">\n * </dom-module>\n *\n * Then in code in some other location that cannot access the dom-module above\n *\n * let img = customElements.get('dom-module').import('foo', 'img');\n *\n * @customElement\n * @extends HTMLElement\n * @summary Custom element that provides a registry of relocatable DOM content\n * by `id` that is agnostic to bundling.\n * @unrestricted\n */\nexport class DomModule extends HTMLElement {\n\n /** @override */\n static get observedAttributes() { return ['id']; }\n\n /**\n * Retrieves the element specified by the css `selector` in the module\n * registered by `id`. For example, this.import('foo', 'img');\n * @param {string} id The id of the dom-module in which to search.\n * @param {string=} selector The css selector by which to find the element.\n * @return {Element} Returns the element which matches `selector` in the\n * module registered at the specified `id`.\n *\n * @export\n * @nocollapse Referred to indirectly in style-gather.js\n */\n static import(id, selector) {\n if (id) {\n let m = findModule(id);\n if (m && selector) {\n return m.querySelector(selector);\n }\n return m;\n }\n return null;\n }\n\n /* eslint-disable no-unused-vars */\n /**\n * @param {string} name Name of attribute.\n * @param {?string} old Old value of attribute.\n * @param {?string} value Current value of attribute.\n * @param {?string} namespace Attribute namespace.\n * @return {void}\n * @override\n */\n attributeChangedCallback(name, old, value, namespace) {\n if (old !== value) {\n this.register();\n }\n }\n /* eslint-enable no-unused-args */\n\n /**\n * The absolute URL of the original location of this `dom-module`.\n *\n * This value will differ from this element's `ownerDocument` in the\n * following ways:\n * - Takes into account any `assetpath` attribute added during bundling\n * to indicate the original location relative to the bundled location\n * - Uses the HTMLImports polyfill's `importForElement` API to ensure\n * the path is relative to the import document's location since\n * `ownerDocument` is not currently polyfilled\n */\n get assetpath() {\n // Don't override existing assetpath.\n if (!this.__assetpath) {\n // note: assetpath set via an attribute must be relative to this\n // element's location; accommodate polyfilled HTMLImports\n const owner = window.HTMLImports && HTMLImports.importForElement ?\n HTMLImports.importForElement(this) || document : this.ownerDocument;\n const url = resolveUrl(\n this.getAttribute('assetpath') || '', owner.baseURI);\n this.__assetpath = pathFromUrl(url);\n }\n return this.__assetpath;\n }\n\n /**\n * Registers the dom-module at a given id. This method should only be called\n * when a dom-module is imperatively created. For\n * example, `document.createElement('dom-module').register('foo')`.\n * @param {string=} id The id at which to register the dom-module.\n * @return {void}\n */\n register(id) {\n id = id || this.id;\n if (id) {\n // Under strictTemplatePolicy, reject and null out any re-registered\n // dom-module since it is ambiguous whether first-in or last-in is trusted\n if (strictTemplatePolicy && findModule(id) !== undefined) {\n setModule(id, null);\n throw new Error(`strictTemplatePolicy: dom-module ${id} re-registered`);\n }\n this.id = id;\n setModule(id, this);\n styleOutsideTemplateCheck(this);\n }\n }\n}\n\nDomModule.prototype['modules'] = modules;\n\ncustomElements.define('dom-module', DomModule);\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n/**\n * Module with utilities for collection CSS text from `<templates>`, external\n * stylesheets, and `dom-module`s.\n *\n * @summary Module with utilities for collection CSS text from various sources.\n */\n\nimport { DomModule } from '../elements/dom-module.js';\nimport { resolveCss } from './resolve-url.js';\n\nconst MODULE_STYLE_LINK_SELECTOR = 'link[rel=import][type~=css]';\nconst INCLUDE_ATTR = 'include';\nconst SHADY_UNSCOPED_ATTR = 'shady-unscoped';\n\n/**\n * @param {string} moduleId .\n * @return {?DomModule} .\n */\nfunction importModule(moduleId) {\n return /** @type {?DomModule} */(DomModule.import(moduleId));\n}\n\nfunction styleForImport(importDoc) {\n // NOTE: polyfill affordance.\n // under the HTMLImports polyfill, there will be no 'body',\n // but the import pseudo-doc can be used directly.\n let container = importDoc.body ? importDoc.body : importDoc;\n const importCss = resolveCss(container.textContent,\n importDoc.baseURI);\n const style = document.createElement('style');\n style.textContent = importCss;\n return style;\n}\n\n/** @typedef {{assetpath: string}} */\nlet templateWithAssetPath; // eslint-disable-line no-unused-vars\n\n\n/**\n * Returns a list of <style> elements in a space-separated list of `dom-module`s.\n *\n * @function\n * @param {string} moduleIds List of dom-module id's within which to\n * search for css.\n * @return {!Array<!HTMLStyleElement>} Array of contained <style> elements\n */\nexport function stylesFromModules(moduleIds) {\n const modules = moduleIds.trim().split(/\\s+/);\n const styles = [];\n for (let i=0; i < modules.length; i++) {\n styles.push(...stylesFromModule(modules[i]));\n }\n return styles;\n}\n\n/**\n * Returns a list of <style> elements in a given `dom-module`.\n * Styles in a `dom-module` can come either from `<style>`s within the\n * first `<template>`, or else from one or more\n * `<link rel=\"import\" type=\"css\">` links outside the template.\n *\n * @param {string} moduleId dom-module id to gather styles from\n * @return {!Array<!HTMLStyleElement>} Array of contained styles.\n */\nexport function stylesFromModule(moduleId) {\n const m = importModule(moduleId);\n\n if (!m) {\n console.warn('Could not find style data in module named', moduleId);\n return [];\n }\n\n if (m._styles === undefined) {\n const styles = [];\n // module imports: <link rel=\"import\" type=\"css\">\n styles.push(..._stylesFromModuleImports(m));\n // include css from the first template in the module\n const template = /** @type {?HTMLTemplateElement} */(\n m.querySelector('template'));\n if (template) {\n styles.push(...stylesFromTemplate(template,\n /** @type {templateWithAssetPath} */(m).assetpath));\n }\n\n m._styles = styles;\n }\n\n return m._styles;\n}\n\n/**\n * Returns the `<style>` elements within a given template.\n *\n * @param {!HTMLTemplateElement} template Template to gather styles from\n * @param {string=} baseURI baseURI for style content\n * @return {!Array<!HTMLStyleElement>} Array of styles\n */\nexport function stylesFromTemplate(template, baseURI) {\n if (!template._styles) {\n const styles = [];\n // if element is a template, get content from its .content\n const e$ = template.content.querySelectorAll('style');\n for (let i=0; i < e$.length; i++) {\n let e = e$[i];\n // support style sharing by allowing styles to \"include\"\n // other dom-modules that contain styling\n let include = e.getAttribute(INCLUDE_ATTR);\n if (include) {\n styles.push(...stylesFromModules(include).filter(function(item, index, self) {\n return self.indexOf(item) === index;\n }));\n }\n if (baseURI) {\n e.textContent =\n resolveCss(e.textContent, /** @type {string} */ (baseURI));\n }\n styles.push(e);\n }\n template._styles = styles;\n }\n return template._styles;\n}\n\n/**\n * Returns a list of <style> elements from stylesheets loaded via `<link rel=\"import\" type=\"css\">` links within the specified `dom-module`.\n *\n * @param {string} moduleId Id of `dom-module` to gather CSS from\n * @return {!Array<!HTMLStyleElement>} Array of contained styles.\n */\nexport function stylesFromModuleImports(moduleId) {\n let m = importModule(moduleId);\n return m ? _stylesFromModuleImports(m) : [];\n}\n\n/**\n * @param {!HTMLElement} module dom-module element that could contain `<link rel=\"import\" type=\"css\">` styles\n * @return {!Array<!HTMLStyleElement>} Array of contained styles\n */\nfunction _stylesFromModuleImports(module) {\n const styles = [];\n const p$ = module.querySelectorAll(MODULE_STYLE_LINK_SELECTOR);\n for (let i=0; i < p$.length; i++) {\n let p = p$[i];\n if (p.import) {\n const importDoc = p.import;\n const unscoped = p.hasAttribute(SHADY_UNSCOPED_ATTR);\n if (unscoped && !importDoc._unscopedStyle) {\n const style = styleForImport(importDoc);\n style.setAttribute(SHADY_UNSCOPED_ATTR, '');\n importDoc._unscopedStyle = style;\n } else if (!importDoc._style) {\n importDoc._style = styleForImport(importDoc);\n }\n styles.push(unscoped ? importDoc._unscopedStyle : importDoc._style);\n }\n }\n return styles;\n}\n\n/**\n *\n * Returns CSS text of styles in a space-separated list of `dom-module`s.\n * Note: This method is deprecated, use `stylesFromModules` instead.\n *\n * @deprecated\n * @param {string} moduleIds List of dom-module id's within which to\n * search for css.\n * @return {string} Concatenated CSS content from specified `dom-module`s\n */\nexport function cssFromModules(moduleIds) {\n let modules = moduleIds.trim().split(/\\s+/);\n let cssText = '';\n for (let i=0; i < modules.length; i++) {\n cssText += cssFromModule(modules[i]);\n }\n return cssText;\n}\n\n/**\n * Returns CSS text of styles in a given `dom-module`. CSS in a `dom-module`\n * can come either from `<style>`s within the first `<template>`, or else\n * from one or more `<link rel=\"import\" type=\"css\">` links outside the\n * template.\n *\n * Any `<styles>` processed are removed from their original location.\n * Note: This method is deprecated, use `styleFromModule` instead.\n *\n * @deprecated\n * @param {string} moduleId dom-module id to gather styles from\n * @return {string} Concatenated CSS content from specified `dom-module`\n */\nexport function cssFromModule(moduleId) {\n let m = importModule(moduleId);\n if (m && m._cssText === undefined) {\n // module imports: <link rel=\"import\" type=\"css\">\n let cssText = _cssFromModuleImports(m);\n // include css from the first template in the module\n let t = /** @type {?HTMLTemplateElement} */(m.querySelector('template'));\n if (t) {\n cssText += cssFromTemplate(t,\n /** @type {templateWithAssetPath} */(m).assetpath);\n }\n m._cssText = cssText || null;\n }\n if (!m) {\n console.warn('Could not find style data in module named', moduleId);\n }\n return m && m._cssText || '';\n}\n\n/**\n * Returns CSS text of `<styles>` within a given template.\n *\n * Any `<styles>` processed are removed from their original location.\n * Note: This method is deprecated, use `styleFromTemplate` instead.\n *\n * @deprecated\n * @param {!HTMLTemplateElement} template Template to gather styles from\n * @param {string} baseURI Base URI to resolve the URL against\n * @return {string} Concatenated CSS content from specified template\n */\nexport function cssFromTemplate(template, baseURI) {\n let cssText = '';\n const e$ = stylesFromTemplate(template, baseURI);\n // if element is a template, get content from its .content\n for (let i=0; i < e$.length; i++) {\n let e = e$[i];\n if (e.parentNode) {\n e.parentNode.removeChild(e);\n }\n cssText += e.textContent;\n }\n return cssText;\n}\n\n/**\n * Returns CSS text from stylesheets loaded via `<link rel=\"import\" type=\"css\">`\n * links within the specified `dom-module`.\n *\n * Note: This method is deprecated, use `stylesFromModuleImports` instead.\n *\n * @deprecated\n *\n * @param {string} moduleId Id of `dom-module` to gather CSS from\n * @return {string} Concatenated CSS content from links in specified `dom-module`\n */\nexport function cssFromModuleImports(moduleId) {\n let m = importModule(moduleId);\n return m ? _cssFromModuleImports(m) : '';\n}\n\n/**\n * @deprecated\n * @param {!HTMLElement} module dom-module element that could contain `<link rel=\"import\" type=\"css\">` styles\n * @return {string} Concatenated CSS content from links in the dom-module\n */\nfunction _cssFromModuleImports(module) {\n let cssText = '';\n let styles = _stylesFromModuleImports(module);\n for (let i=0; i < styles.length; i++) {\n cssText += styles[i].textContent;\n }\n return cssText;\n}\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\nimport '@webcomponents/shadycss/entrypoints/custom-style-interface.js';\n\nimport { cssFromModules } from '../utils/style-gather.js';\n\nconst attr = 'include';\n\nconst CustomStyleInterface = window.ShadyCSS.CustomStyleInterface;\n\n/**\n * Custom element for defining styles in the main document that can take\n * advantage of [shady DOM](https://github.com/webcomponents/shadycss) shims\n * for style encapsulation, custom properties, and custom mixins.\n *\n * - Document styles defined in a `<custom-style>` are shimmed to ensure they\n * do not leak into local DOM when running on browsers without native\n * Shadow DOM.\n * - Custom properties can be defined in a `<custom-style>`. Use the `html` selector\n * to define custom properties that apply to all custom elements.\n * - Custom mixins can be defined in a `<custom-style>`, if you import the optional\n * [apply shim](https://github.com/webcomponents/shadycss#about-applyshim)\n * (`shadycss/apply-shim.html`).\n *\n * To use:\n *\n * - Import `custom-style.html`.\n * - Place a `<custom-style>` element in the main document, wrapping an inline `<style>` tag that\n * contains the CSS rules you want to shim.\n *\n * For example:\n *\n * ```html\n * <!-- import apply shim--only required if using mixins -->\n * <link rel=\"import\" href=\"bower_components/shadycss/apply-shim.html\">\n * <!-- import custom-style element -->\n * <link rel=\"import\" href=\"bower_components/polymer/lib/elements/custom-style.html\">\n *\n * <custom-style>\n * <style>\n * html {\n * --custom-color: blue;\n * --custom-mixin: {\n * font-weight: bold;\n * color: red;\n * };\n * }\n * </style>\n * </custom-style>\n * ```\n *\n * @customElement\n * @extends HTMLElement\n * @summary Custom element for defining styles in the main document that can\n * take advantage of Polymer's style scoping and custom properties shims.\n */\nexport class CustomStyle extends HTMLElement {\n constructor() {\n super();\n this._style = null;\n CustomStyleInterface.addCustomStyle(this);\n }\n /**\n * Returns the light-DOM `<style>` child this element wraps. Upon first\n * call any style modules referenced via the `include` attribute will be\n * concatenated to this element's `<style>`.\n *\n * @export\n * @return {HTMLStyleElement} This element's light-DOM `<style>`\n */\n getStyle() {\n if (this._style) {\n return this._style;\n }\n const style = /** @type {HTMLStyleElement} */(this.querySelector('style'));\n if (!style) {\n return null;\n }\n this._style = style;\n const include = style.getAttribute(attr);\n if (include) {\n style.removeAttribute(attr);\n /** @suppress {deprecated} */\n style.textContent = cssFromModules(include) + style.textContent;\n }\n /*\n HTML Imports styling the main document are deprecated in Chrome\n https://crbug.com/523952\n\n If this element is not in the main document, then it must be in an HTML Import document.\n In that case, move the custom style to the main document.\n\n The ordering of `<custom-style>` should stay the same as when loaded by HTML Imports, but there may be odd\n cases of ordering w.r.t the main document styles.\n */\n if (this.ownerDocument !== window.document) {\n window.document.head.appendChild(this);\n }\n return this._style;\n }\n}\n\nwindow.customElements.define('custom-style', CustomStyle);\n","import './version.js';\nimport '@polymer/polymer/lib/elements/custom-style.js';\nconst $_documentContainer = document.createElement('template');\n\n$_documentContainer.innerHTML = `<custom-style>\n <style>\n html {\n --lumo-size-xs: 1.625rem;\n --lumo-size-s: 1.875rem;\n --lumo-size-m: 2.25rem;\n --lumo-size-l: 2.75rem;\n --lumo-size-xl: 3.5rem;\n\n /* Icons */\n --lumo-icon-size-s: 1.25em;\n --lumo-icon-size-m: 1.5em;\n --lumo-icon-size-l: 2.25em;\n /* For backwards compatibility */\n --lumo-icon-size: var(--lumo-icon-size-m);\n }\n </style>\n</custom-style>`;\n\ndocument.head.appendChild($_documentContainer.content);\n","import './version.js';\nimport '@polymer/polymer/lib/elements/custom-style.js';\nconst $_documentContainer = document.createElement('template');\n\n$_documentContainer.innerHTML = `<custom-style>\n <style>\n html {\n /* Square */\n --lumo-space-xs: 0.25rem;\n --lumo-space-s: 0.5rem;\n --lumo-space-m: 1rem;\n --lumo-space-l: 1.5rem;\n --lumo-space-xl: 2.5rem;\n\n /* Wide */\n --lumo-space-wide-xs: calc(var(--lumo-space-xs) / 2) var(--lumo-space-xs);\n --lumo-space-wide-s: calc(var(--lumo-space-s) / 2) var(--lumo-space-s);\n --lumo-space-wide-m: calc(var(--lumo-space-m) / 2) var(--lumo-space-m);\n --lumo-space-wide-l: calc(var(--lumo-space-l) / 2) var(--lumo-space-l);\n --lumo-space-wide-xl: calc(var(--lumo-space-xl) / 2) var(--lumo-space-xl);\n\n /* Tall */\n --lumo-space-tall-xs: var(--lumo-space-xs) calc(var(--lumo-space-xs) / 2);\n --lumo-space-tall-s: var(--lumo-space-s) calc(var(--lumo-space-s) / 2);\n --lumo-space-tall-m: var(--lumo-space-m) calc(var(--lumo-space-m) / 2);\n --lumo-space-tall-l: var(--lumo-space-l) calc(var(--lumo-space-l) / 2);\n --lumo-space-tall-xl: var(--lumo-space-xl) calc(var(--lumo-space-xl) / 2);\n }\n </style>\n</custom-style>`;\n\ndocument.head.appendChild($_documentContainer.content);\n","import './version.js';\nimport '@polymer/polymer/lib/elements/custom-style.js';\nconst $_documentContainer = document.createElement('template');\n\n$_documentContainer.innerHTML = `<custom-style>\n <style>\n html {\n /* Border radius */\n --lumo-border-radius-s: 0.25em; /* Checkbox, badge, date-picker year indicator, etc */\n --lumo-border-radius-m: var(--lumo-border-radius, 0.25em); /* Button, text field, menu overlay, etc */\n --lumo-border-radius-l: 0.5em; /* Dialog, notification, etc */\n --lumo-border-radius: 0.25em; /* Deprecated */\n\n /* Shadow */\n --lumo-box-shadow-xs: 0 1px 4px -1px var(--lumo-shade-50pct);\n --lumo-box-shadow-s: 0 2px 4px -1px var(--lumo-shade-20pct), 0 3px 12px -1px var(--lumo-shade-30pct);\n --lumo-box-shadow-m: 0 2px 6px -1px var(--lumo-shade-20pct), 0 8px 24px -4px var(--lumo-shade-40pct);\n --lumo-box-shadow-l: 0 3px 18px -2px var(--lumo-shade-20pct), 0 12px 48px -6px var(--lumo-shade-40pct);\n --lumo-box-shadow-xl: 0 4px 24px -3px var(--lumo-shade-20pct), 0 18px 64px -8px var(--lumo-shade-40pct);\n\n /* Clickable element cursor */\n --lumo-clickable-cursor: default;\n }\n </style>\n</custom-style>`;\n\ndocument.head.appendChild($_documentContainer.content);\n","import './version.js';\nimport '@polymer/polymer/lib/elements/custom-style.js';\nimport '@polymer/polymer/lib/elements/dom-module.js';\nconst $_documentContainer = document.createElement('template');\n\n$_documentContainer.innerHTML = `<custom-style>\n <style>\n html {\n /* Base (background) */\n --lumo-base-color: #FFF;\n\n /* Tint */\n --lumo-tint-5pct: hsla(0, 0%, 100%, 0.3);\n --lumo-tint-10pct: hsla(0, 0%, 100%, 0.37);\n --lumo-tint-20pct: hsla(0, 0%, 100%, 0.44);\n --lumo-tint-30pct: hsla(0, 0%, 100%, 0.5);\n --lumo-tint-40pct: hsla(0, 0%, 100%, 0.57);\n --lumo-tint-50pct: hsla(0, 0%, 100%, 0.64);\n --lumo-tint-60pct: hsla(0, 0%, 100%, 0.7);\n --lumo-tint-70pct: hsla(0, 0%, 100%, 0.77);\n --lumo-tint-80pct: hsla(0, 0%, 100%, 0.84);\n --lumo-tint-90pct: hsla(0, 0%, 100%, 0.9);\n --lumo-tint: #FFF;\n\n /* Shade */\n --lumo-shade-5pct: hsla(214, 61%, 25%, 0.05);\n --lumo-shade-10pct: hsla(214, 57%, 24%, 0.1);\n --lumo-shade-20pct: hsla(214, 53%, 23%, 0.16);\n --lumo-shade-30pct: hsla(214, 50%, 22%, 0.26);\n --lumo-shade-40pct: hsla(214, 47%, 21%, 0.38);\n --lumo-shade-50pct: hsla(214, 45%, 20%, 0.5);\n --lumo-shade-60pct: hsla(214, 43%, 19%, 0.61);\n --lumo-shade-70pct: hsla(214, 42%, 18%, 0.72);\n --lumo-shade-80pct: hsla(214, 41%, 17%, 0.83);\n --lumo-shade-90pct: hsla(214, 40%, 16%, 0.94);\n --lumo-shade: hsl(214, 35%, 15%);\n\n /* Contrast */\n --lumo-contrast-5pct: var(--lumo-shade-5pct);\n --lumo-contrast-10pct: var(--lumo-shade-10pct);\n --lumo-contrast-20pct: var(--lumo-shade-20pct);\n --lumo-contrast-30pct: var(--lumo-shade-30pct);\n --lumo-contrast-40pct: var(--lumo-shade-40pct);\n --lumo-contrast-50pct: var(--lumo-shade-50pct);\n --lumo-contrast-60pct: var(--lumo-shade-60pct);\n --lumo-contrast-70pct: var(--lumo-shade-70pct);\n --lumo-contrast-80pct: var(--lumo-shade-80pct);\n --lumo-contrast-90pct: var(--lumo-shade-90pct);\n --lumo-contrast: var(--lumo-shade);\n\n /* Text */\n --lumo-header-text-color: var(--lumo-contrast);\n --lumo-body-text-color: var(--lumo-contrast-90pct);\n --lumo-secondary-text-color: var(--lumo-contrast-70pct);\n --lumo-tertiary-text-color: var(--lumo-contrast-50pct);\n --lumo-disabled-text-color: var(--lumo-contrast-30pct);\n\n /* Primary */\n --lumo-primary-color: hsl(214, 90%, 52%);\n --lumo-primary-color-50pct: hsla(214, 90%, 52%, 0.5);\n --lumo-primary-color-10pct: hsla(214, 90%, 52%, 0.1);\n --lumo-primary-text-color: var(--lumo-primary-color);\n --lumo-primary-contrast-color: #FFF;\n\n /* Error */\n --lumo-error-color: hsl(3, 100%, 61%);\n --lumo-error-color-50pct: hsla(3, 100%, 60%, 0.5);\n --lumo-error-color-10pct: hsla(3, 100%, 60%, 0.1);\n --lumo-error-text-color: hsl(3, 92%, 53%);\n --lumo-error-contrast-color: #FFF;\n\n /* Success */\n --lumo-success-color: hsl(145, 80%, 42%); /* hsl(144,82%,37%); */\n --lumo-success-color-50pct: hsla(145, 76%, 44%, 0.55);\n --lumo-success-color-10pct: hsla(145, 76%, 44%, 0.12);\n --lumo-success-text-color: hsl(145, 100%, 32%);\n --lumo-success-contrast-color: #FFF;\n }\n </style>\n</custom-style><dom-module id=\"lumo-color\">\n <template>\n <style>\n [theme~=\"dark\"] {\n /* Base (background) */\n --lumo-base-color: hsl(214, 35%, 21%);\n\n /* Tint */\n --lumo-tint-5pct: hsla(214, 65%, 85%, 0.06);\n --lumo-tint-10pct: hsla(214, 60%, 80%, 0.14);\n --lumo-tint-20pct: hsla(214, 64%, 82%, 0.23);\n --lumo-tint-30pct: hsla(214, 69%, 84%, 0.32);\n --lumo-tint-40pct: hsla(214, 73%, 86%, 0.41);\n --lumo-tint-50pct: hsla(214, 78%, 88%, 0.5);\n --lumo-tint-60pct: hsla(214, 82%, 90%, 0.6);\n --lumo-tint-70pct: hsla(214, 87%, 92%, 0.7);\n --lumo-tint-80pct: hsla(214, 91%, 94%, 0.8);\n --lumo-tint-90pct: hsla(214, 96%, 96%, 0.9);\n --lumo-tint: hsl(214, 100%, 98%);\n\n /* Shade */\n --lumo-shade-5pct: hsla(214, 0%, 0%, 0.07);\n --lumo-shade-10pct: hsla(214, 4%, 2%, 0.15);\n --lumo-shade-20pct: hsla(214, 8%, 4%, 0.23);\n --lumo-shade-30pct: hsla(214, 12%, 6%, 0.32);\n --lumo-shade-40pct: hsla(214, 16%, 8%, 0.41);\n --lumo-shade-50pct: hsla(214, 20%, 10%, 0.5);\n --lumo-shade-60pct: hsla(214, 24%, 12%, 0.6);\n --lumo-shade-70pct: hsla(214, 28%, 13%, 0.7);\n --lumo-shade-80pct: hsla(214, 32%, 13%, 0.8);\n --lumo-shade-90pct: hsla(214, 33%, 13%, 0.9);\n --lumo-shade: hsl(214, 33%, 13%);\n\n /* Contrast */\n --lumo-contrast-5pct: var(--lumo-tint-5pct);\n --lumo-contrast-10pct: var(--lumo-tint-10pct);\n --lumo-contrast-20pct: var(--lumo-tint-20pct);\n --lumo-contrast-30pct: var(--lumo-tint-30pct);\n --lumo-contrast-40pct: var(--lumo-tint-40pct);\n --lumo-contrast-50pct: var(--lumo-tint-50pct);\n --lumo-contrast-60pct: var(--lumo-tint-60pct);\n --lumo-contrast-70pct: var(--lumo-tint-70pct);\n --lumo-contrast-80pct: var(--lumo-tint-80pct);\n --lumo-contrast-90pct: var(--lumo-tint-90pct);\n --lumo-contrast: var(--lumo-tint);\n\n /* Text */\n --lumo-header-text-color: var(--lumo-contrast);\n --lumo-body-text-color: var(--lumo-contrast-90pct);\n --lumo-secondary-text-color: var(--lumo-contrast-70pct);\n --lumo-tertiary-text-color: var(--lumo-contrast-50pct);\n --lumo-disabled-text-color: var(--lumo-contrast-30pct);\n\n /* Primary */\n --lumo-primary-color: hsl(214, 86%, 55%);\n --lumo-primary-color-50pct: hsla(214, 86%, 55%, 0.5);\n --lumo-primary-color-10pct: hsla(214, 90%, 63%, 0.1);\n --lumo-primary-text-color: hsl(214, 100%, 70%);\n --lumo-primary-contrast-color: #FFF;\n\n /* Error */\n --lumo-error-color: hsl(3, 90%, 63%);\n --lumo-error-color-50pct: hsla(3, 90%, 63%, 0.5);\n --lumo-error-color-10pct: hsla(3, 90%, 63%, 0.1);\n --lumo-error-text-color: hsl(3, 100%, 67%);\n\n /* Success */\n --lumo-success-color: hsl(145, 65%, 42%);\n --lumo-success-color-50pct: hsla(145, 65%, 42%, 0.5);\n --lumo-success-color-10pct: hsla(145, 65%, 42%, 0.1);\n --lumo-success-text-color: hsl(145, 85%, 47%);\n }\n\n html {\n color: var(--lumo-body-text-color);\n background-color: var(--lumo-base-color);\n }\n\n [theme~=\"dark\"] {\n color: var(--lumo-body-text-color);\n background-color: var(--lumo-base-color);\n }\n\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n color: var(--lumo-header-text-color);\n }\n\n a {\n color: var(--lumo-primary-text-color);\n }\n\n blockquote {\n color: var(--lumo-secondary-text-color);\n }\n\n code,\n pre {\n background-color: var(--lumo-contrast-10pct);\n border-radius: var(--lumo-border-radius-m);\n }\n </style>\n </template>\n</dom-module><dom-module id=\"lumo-color-legacy\">\n <template>\n <style include=\"lumo-color\">\n :host {\n color: var(--lumo-body-text-color) !important;\n background-color: var(--lumo-base-color) !important;\n }\n </style>\n </template>\n</dom-module>`;\n\ndocument.head.appendChild($_documentContainer.content);\n\n/* Only needed for IE11 when you want to use the dark palette inside the light palette */\n/*\n FIXME(polymer-modulizer): the above comments were extracted\n from HTML and may be out of place here. Review them and\n then delete this comment!\n*/\n;\n","import './version.js';\nimport '@polymer/polymer/lib/elements/custom-style.js';\nimport '@polymer/polymer/lib/elements/dom-module.js';\nconst $_documentContainer = document.createElement('template');\n\n$_documentContainer.innerHTML = `<custom-style>\n <style>\n html {\n /* Font families */\n --lumo-font-family: -apple-system, BlinkMacSystemFont, \"Roboto\", \"Segoe UI\", Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";\n\n /* Font sizes */\n --lumo-font-size-xxs: .75rem;\n --lumo-font-size-xs: .8125rem;\n --lumo-font-size-s: .875rem;\n --lumo-font-size-m: 1rem;\n --lumo-font-size-l: 1.125rem;\n --lumo-font-size-xl: 1.375rem;\n --lumo-font-size-xxl: 1.75rem;\n --lumo-font-size-xxxl: 2.5rem;\n\n /* Line heights */\n --lumo-line-height-xs: 1.25;\n --lumo-line-height-s: 1.375;\n --lumo-line-height-m: 1.625;\n }\n\n </style>\n</custom-style><dom-module id=\"lumo-typography\">\n <template>\n <style>\n html {\n font-family: var(--lumo-font-family);\n font-size: var(--lumo-font-size, var(--lumo-font-size-m));\n line-height: var(--lumo-line-height-m);\n -webkit-text-size-adjust: 100%;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n\n /* Can’t combine with the above selector because that doesn’t work in browsers without native shadow dom */\n :host {\n font-family: var(--lumo-font-family);\n font-size: var(--lumo-font-size, var(--lumo-font-size-m));\n line-height: var(--lumo-line-height-m);\n -webkit-text-size-adjust: 100%;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n\n small,\n [theme~=\"font-size-s\"] {\n font-size: var(--lumo-font-size-s);\n line-height: var(--lumo-line-height-s);\n }\n\n [theme~=\"font-size-xs\"] {\n font-size: var(--lumo-font-size-xs);\n line-height: var(--lumo-line-height-xs);\n }\n\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n font-weight: 600;\n line-height: var(--lumo-line-height-xs);\n margin-top: 1.25em;\n }\n\n h1 {\n font-size: var(--lumo-font-size-xxxl);\n margin-bottom: 0.75em;\n }\n\n h2 {\n font-size: var(--lumo-font-size-xxl);\n margin-bottom: 0.5em;\n }\n\n h3 {\n font-size: var(--lumo-font-size-xl);\n margin-bottom: 0.5em;\n }\n\n h4 {\n font-size: var(--lumo-font-size-l);\n margin-bottom: 0.5em;\n }\n\n h5 {\n font-size: var(--lumo-font-size-m);\n margin-bottom: 0.25em;\n }\n\n h6 {\n font-size: var(--lumo-font-size-xs);\n margin-bottom: 0;\n text-transform: uppercase;\n letter-spacing: 0.03em;\n }\n\n p,\n blockquote {\n margin-top: 0.5em;\n margin-bottom: 0.75em;\n }\n\n a {\n text-decoration: none;\n }\n\n a:hover {\n text-decoration: underline;\n }\n\n hr {\n display: block;\n align-self: stretch;\n height: 1px;\n border: 0;\n padding: 0;\n margin: var(--lumo-space-s) calc(var(--lumo-border-radius-m) / 2);\n background-color: var(--lumo-contrast-10pct);\n }\n\n blockquote {\n border-left: 2px solid var(--lumo-contrast-30pct);\n }\n\n b,\n strong {\n font-weight: 600;\n }\n\n /* RTL specific styles */\n\n blockquote[dir=\"rtl\"] {\n border-left: none;\n border-right: 2px solid var(--lumo-contrast-30pct);\n }\n\n </style>\n </template>\n</dom-module>`;\n\ndocument.head.appendChild($_documentContainer.content);\n","import '../color.js';\nimport '../spacing.js';\nimport '../style.js';\nimport '../typography.js';\nconst $_documentContainer = document.createElement('template');\n\n$_documentContainer.innerHTML = `<dom-module id=\"lumo-overlay\">\n <template>\n <style>\n :host {\n top: var(--lumo-space-m);\n right: var(--lumo-space-m);\n bottom: var(--lumo-space-m);\n left: var(--lumo-space-m);\n /* Workaround for Edge issue (only on Surface), where an overflowing vaadin-list-box inside vaadin-select-overlay makes the overlay transparent */\n /* stylelint-disable-next-line */\n outline: 0px solid transparent;\n }\n\n [part=\"overlay\"] {\n background-color: var(--lumo-base-color);\n background-image: linear-gradient(var(--lumo-tint-5pct), var(--lumo-tint-5pct));\n border-radius: var(--lumo-border-radius-m);\n box-shadow: 0 0 0 1px var(--lumo-shade-5pct), var(--lumo-box-shadow-m);\n color: var(--lumo-body-text-color);\n font-family: var(--lumo-font-family);\n font-size: var(--lumo-font-size-m);\n font-weight: 400;\n line-height: var(--lumo-line-height-m);\n letter-spacing: 0;\n text-transform: none;\n -webkit-text-size-adjust: 100%;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n\n [part=\"content\"] {\n padding: var(--lumo-space-xs);\n }\n\n [part=\"backdrop\"] {\n background-color: var(--lumo-shade-20pct);\n animation: 0.2s lumo-overlay-backdrop-enter both;\n will-change: opacity;\n }\n\n @keyframes lumo-overlay-backdrop-enter {\n 0% {\n opacity: 0;\n }\n }\n\n :host([closing]) [part=\"backdrop\"] {\n animation: 0.2s lumo-overlay-backdrop-exit both;\n }\n\n @keyframes lumo-overlay-backdrop-exit {\n 100% {\n opacity: 0;\n }\n }\n\n @keyframes lumo-overlay-dummy-animation {\n 0% { opacity: 1; }\n 100% { opacity: 1; }\n }\n </style>\n </template>\n</dom-module>`;\n\ndocument.head.appendChild($_documentContainer.content);\n","import '../spacing.js';\nimport '../style.js';\nimport './overlay.js';\nconst $_documentContainer = document.createElement('template');\n\n$_documentContainer.innerHTML = `<dom-module id=\"lumo-menu-overlay-core\">\n <template>\n <style>\n :host([opening]),\n :host([closing]) {\n animation: 0.14s lumo-overlay-dummy-animation;\n }\n\n [part=\"overlay\"] {\n will-change: opacity, transform;\n }\n\n :host([opening]) [part=\"overlay\"] {\n animation: 0.1s lumo-menu-overlay-enter ease-out both;\n }\n\n @keyframes lumo-menu-overlay-enter {\n 0% {\n opacity: 0;\n transform: translateY(-4px);\n }\n }\n\n :host([closing]) [part=\"overlay\"] {\n animation: 0.1s lumo-menu-overlay-exit both;\n }\n\n @keyframes lumo-menu-overlay-exit {\n 100% {\n opacity: 0;\n }\n }\n </style>\n </template>\n</dom-module><dom-module id=\"lumo-menu-overlay\">\n <template>\n <style include=\"lumo-overlay lumo-menu-overlay-core\">\n /* Small viewport (bottom sheet) styles */\n /* Use direct media queries instead of the state attributes (\\`[phone]\\` and \\`[fullscreen]\\`) provided by the elements */\n @media (max-width: 420px), (max-height: 420px) {\n :host {\n top: 0 !important;\n right: 0 !important;\n bottom: var(--vaadin-overlay-viewport-bottom, 0) !important;\n left: 0 !important;\n align-items: stretch !important;\n justify-content: flex-end !important;\n }\n\n [part=\"overlay\"] {\n max-height: 50vh;\n width: 100vw;\n border-radius: 0;\n box-shadow: var(--lumo-box-shadow-xl);\n }\n\n /* The content part scrolls instead of the overlay part, because of the gradient fade-out */\n [part=\"content\"] {\n padding: 30px var(--lumo-space-m);\n max-height: inherit;\n box-sizing: border-box;\n -webkit-overflow-scrolling: touch;\n overflow: auto;\n -webkit-mask-image: linear-gradient(transparent, #000 40px, #000 calc(100% - 40px), transparent);\n mask-image: linear-gradient(transparent, #000 40px, #000 calc(100% - 40px), transparent);\n }\n\n [part=\"backdrop\"] {\n display: block;\n }\n\n /* Animations */\n\n :host([opening]) [part=\"overlay\"] {\n animation: 0.2s lumo-mobile-menu-overlay-enter cubic-bezier(.215, .61, .355, 1) both;\n }\n\n :host([closing]),\n :host([closing]) [part=\"backdrop\"] {\n animation-delay: 0.14s;\n }\n\n :host([closing]) [part=\"overlay\"] {\n animation: 0.14s 0.14s lumo-mobile-menu-overlay-exit cubic-bezier(.55, .055, .675, .19) both;\n }\n }\n\n @keyframes lumo-mobile-menu-overlay-enter {\n 0% {\n transform: translateY(150%);\n }\n }\n\n @keyframes lumo-mobile-menu-overlay-exit {\n 100% {\n transform: translateY(150%);\n }\n }\n </style>\n </template>\n</dom-module>`;\n\ndocument.head.appendChild($_documentContainer.content);\n\n/* Split as a separate module because combo box can only use the \"fullscreen\" styles */\n/*\n FIXME(polymer-modulizer): the above comments were extracted\n from HTML and may be out of place here. Review them and\n then delete this comment!\n*/\n;\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\nimport './boot.js';\n\n/**\n * Our TrustedTypePolicy for HTML which is declared using the Polymer html\n * template tag function.\n *\n * That HTML is a developer-authored constant, and is parsed with innerHTML\n * before any untrusted expressions have been mixed in. Therefor it is\n * considered safe by construction.\n *\n * @type {!TrustedTypePolicy|undefined}\n */\nconst policy = window.trustedTypes &&\n trustedTypes.createPolicy('polymer-html-literal', {createHTML: (s) => s});\n\n/**\n * Class representing a static string value which can be used to filter\n * strings by asseting that they have been created via this class. The\n * `value` property returns the string passed to the constructor.\n */\nclass LiteralString {\n /**\n * @param {!ITemplateArray} strings Constant parts of tagged template literal\n * @param {!Array<*>} values Variable parts of tagged template literal\n */\n constructor(strings, values) {\n assertValidTemplateStringParameters(strings, values);\n const string = values.reduce(\n (acc, v, idx) => acc + literalValue(v) + strings[idx + 1], strings[0]);\n /** @type {string} */\n this.value = string.toString();\n }\n /**\n * @return {string} LiteralString string value\n * @override\n */\n toString() {\n return this.value;\n }\n}\n\n/**\n * @param {*} value Object to stringify into HTML\n * @return {string} HTML stringified form of `obj`\n */\nfunction literalValue(value) {\n if (value instanceof LiteralString) {\n return /** @type {!LiteralString} */(value).value;\n } else {\n throw new Error(\n `non-literal value passed to Polymer's htmlLiteral function: ${value}`\n );\n }\n}\n\n/**\n * @param {*} value Object to stringify into HTML\n * @return {string} HTML stringified form of `obj`\n */\nfunction htmlValue(value) {\n if (value instanceof HTMLTemplateElement) {\n // This might be an mXSS risk – mainly in the case where this template\n // contains untrusted content that was believed to be sanitized.\n // However we can't just use the XMLSerializer here because it misencodes\n // `>` characters inside style tags.\n // For an example of an actual case that hit this encoding issue,\n // see b/198592167\n return /** @type {!HTMLTemplateElement } */(value).innerHTML;\n } else if (value instanceof LiteralString) {\n return literalValue(value);\n } else {\n throw new Error(\n `non-template value passed to Polymer's html function: ${value}`);\n }\n}\n\n/**\n * A template literal tag that creates an HTML <template> element from the\n * contents of the string.\n *\n * This allows you to write a Polymer Template in JavaScript.\n *\n * Templates can be composed by interpolating `HTMLTemplateElement`s in\n * expressions in the JavaScript template literal. The nested template's\n * `innerHTML` is included in the containing template. The only other\n * values allowed in expressions are those returned from `htmlLiteral`\n * which ensures only literal values from JS source ever reach the HTML, to\n * guard against XSS risks.\n *\n * All other values are disallowed in expressions to help prevent XSS\n * attacks; however, `htmlLiteral` can be used to compose static\n * string values into templates. This is useful to compose strings into\n * places that do not accept html, like the css text of a `style`\n * element.\n *\n * Example:\n *\n * static get template() {\n * return html`\n * <style>:host{ content:\"...\" }</style>\n * <div class=\"shadowed\">${this.partialTemplate}</div>\n * ${super.template}\n * `;\n * }\n * static get partialTemplate() { return html`<span>Partial!</span>`; }\n *\n * @param {!ITemplateArray} strings Constant parts of tagged template literal\n * @param {...*} values Variable parts of tagged template literal\n * @return {!HTMLTemplateElement} Constructed HTMLTemplateElement\n */\nexport const html = function html(strings, ...values) {\n assertValidTemplateStringParameters(strings, values);\n const template =\n /** @type {!HTMLTemplateElement} */ (document.createElement('template'));\n let value = values.reduce(\n (acc, v, idx) => acc + htmlValue(v) + strings[idx + 1], strings[0]);\n if (policy) {\n value = policy.createHTML(value);\n }\n template.innerHTML = value;\n return template;\n};\n\n/**\n * @param {!ITemplateArray} strings Constant parts of tagged template literal\n * @param {!Array<*>} values Array of values from quasis\n */\nconst assertValidTemplateStringParameters = (strings, values) => {\n // Note: if/when https://github.com/tc39/proposal-array-is-template-object\n // is standardized, use that instead when available, as it can perform an\n // unforgable check (though of course, the function itself can be forged).\n if (!Array.isArray(strings) || !Array.isArray(strings.raw) ||\n (values.length !== strings.length - 1)) {\n // This is either caused by a browser bug, a compiler bug, or someone\n // calling the html template tag function as a regular function.\n //\n throw new TypeError('Invalid call to the html template tag');\n }\n};\n\n/**\n * An html literal tag that can be used with `html` to compose.\n * a literal string.\n *\n * Example:\n *\n * static get template() {\n * return html`\n * <style>\n * :host { display: block; }\n * ${this.styleTemplate()}\n * </style>\n * <div class=\"shadowed\">${staticValue}</div>\n * ${super.template}\n * `;\n * }\n * static get styleTemplate() {\n * return htmlLiteral`.shadowed { background: gray; }`;\n * }\n *\n * @param {!ITemplateArray} strings Constant parts of tagged template literal\n * @param {...*} values Variable parts of tagged template literal\n * @return {!LiteralString} Constructed literal string\n */\nexport const htmlLiteral = function(strings, ...values) {\n return new LiteralString(strings, values);\n};\n","import '@vaadin/vaadin-lumo-styles/sizing.js';\nimport '@vaadin/vaadin-lumo-styles/spacing.js';\nimport '@vaadin/vaadin-lumo-styles/mixins/menu-overlay.js';\nimport { html } from '@polymer/polymer/lib/utils/html-tag.js';\n\nconst $_documentContainer = html`<dom-module id=\"lumo-date-picker-overlay\" theme-for=\"vaadin-date-picker-overlay\">\n <template>\n <style include=\"lumo-menu-overlay\">\n [part=\"overlay\"] {\n /*\n Width:\n date cell widths\n + month calendar side padding\n + year scroller width\n */\n width:\n calc(\n var(--lumo-size-m) * 7\n + var(--lumo-space-xs) * 2\n + 57px\n );\n height: 100%;\n max-height: calc(var(--lumo-size-m) * 14);\n overflow: hidden;\n -webkit-tap-highlight-color: transparent;\n }\n\n [part=\"content\"] {\n padding: 0;\n height: 100%;\n overflow: hidden;\n -webkit-mask-image: none;\n mask-image: none;\n }\n\n @media (max-width: 420px), (max-height: 420px) {\n [part=\"overlay\"] {\n width: 100vw;\n height: 70vh;\n max-height: 70vh;\n }\n }\n </style>\n </template>\n</dom-module>`;\n\ndocument.head.appendChild($_documentContainer.content);\n","import '@vaadin/vaadin-lumo-styles/color.js';\nimport '@vaadin/vaadin-lumo-styles/sizing.js';\nimport '@vaadin/vaadin-lumo-styles/spacing.js';\nimport '@vaadin/vaadin-lumo-styles/style.js';\nimport '@vaadin/vaadin-lumo-styles/typography.js';\nimport { html } from '@polymer/polymer/lib/utils/html-tag.js';\n\nconst $_documentContainer = html`<dom-module id=\"lumo-button\" theme-for=\"vaadin-button\">\n <template>\n <style>\n :host {\n /* Sizing */\n --lumo-button-size: var(--lumo-size-m);\n min-width: calc(var(--lumo-button-size) * 2);\n height: var(--lumo-button-size);\n padding: 0 calc(var(--lumo-button-size) / 3 + var(--lumo-border-radius) / 2);\n margin: var(--lumo-space-xs) 0;\n box-sizing: border-box;\n /* Style */\n font-family: var(--lumo-font-family);\n font-size: var(--lumo-font-size-m);\n font-weight: 500;\n color: var(--_lumo-button-color, var(--lumo-primary-text-color));\n background-color: var(--_lumo-button-background-color, var(--lumo-contrast-5pct));\n border-radius: var(--lumo-border-radius);\n cursor: default;\n -webkit-tap-highlight-color: transparent;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n\n /* Set only for the internal parts so we don’t affect the host vertical alignment */\n [part=\"label\"],\n [part=\"prefix\"],\n [part=\"suffix\"] {\n line-height: var(--lumo-line-height-xs);\n }\n\n [part=\"label\"] {\n padding: calc(var(--lumo-button-size) / 6) 0;\n }\n\n :host([theme~=\"small\"]) {\n font-size: var(--lumo-font-size-s);\n --lumo-button-size: var(--lumo-size-s);\n }\n\n :host([theme~=\"large\"]) {\n font-size: var(--lumo-font-size-l);\n --lumo-button-size: var(--lumo-size-l);\n }\n\n /* This needs to be the last selector for it to take priority */\n :host([disabled][disabled]) {\n pointer-events: none;\n color: var(--lumo-disabled-text-color);\n background-color: var(--lumo-contrast-5pct);\n }\n\n /* For interaction states */\n :host::before,\n :host::after {\n content: \"\";\n /* We rely on the host always being relative */\n position: absolute;\n z-index: 1;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n background-color: currentColor;\n border-radius: inherit;\n opacity: 0;\n transition: opacity 0.2s;\n pointer-events: none;\n }\n\n /* Hover */\n\n :host(:hover)::before {\n opacity: 0.05;\n }\n\n /* Disable hover for touch devices */\n @media (pointer: coarse) {\n :host(:not([active]):hover)::before {\n opacity: 0;\n }\n }\n\n /* Active */\n\n :host::after {\n transition: opacity 1.4s, transform 0.1s;\n filter: blur(8px);\n }\n\n :host([active])::before {\n opacity: 0.1;\n transition-duration: 0s;\n }\n\n :host([active])::after {\n opacity: 0.1;\n transition-duration: 0s, 0s;\n transform: scale(0);\n }\n\n /* Keyboard focus */\n\n :host([focus-ring]) {\n box-shadow: 0 0 0 2px var(--lumo-primary-color-50pct);\n }\n\n /* Types (primary, tertiary, tertiary-inline */\n\n :host([theme~=\"tertiary\"]),\n :host([theme~=\"tertiary-inline\"]) {\n background-color: transparent !important;\n transition: opacity 0.2s;\n min-width: 0;\n }\n\n :host([theme~=\"tertiary\"])::before,\n :host([theme~=\"tertiary-inline\"])::before {\n display: none;\n }\n\n :host([theme~=\"tertiary\"]) {\n padding: 0 calc(var(--lumo-button-size) / 6);\n }\n\n @media (hover: hover) {\n :host([theme*=\"tertiary\"]:not([active]):hover) {\n opacity: 0.8;\n }\n }\n\n :host([theme~=\"tertiary\"][active]),\n :host([theme~=\"tertiary-inline\"][active]) {\n opacity: 0.5;\n transition-duration: 0s;\n }\n\n :host([theme~=\"tertiary-inline\"]) {\n margin: 0;\n height: auto;\n padding: 0;\n line-height: inherit;\n font-size: inherit;\n }\n\n :host([theme~=\"tertiary-inline\"]) [part=\"label\"] {\n padding: 0;\n overflow: visible;\n line-height: inherit;\n }\n\n :host([theme~=\"primary\"]) {\n background-color: var(--_lumo-button-primary-background-color, var(--lumo-primary-color));\n color: var(--_lumo-button-primary-color, var(--lumo-primary-contrast-color));\n font-weight: 600;\n min-width: calc(var(--lumo-button-size) * 2.5);\n }\n\n :host([theme~=\"primary\"][disabled]) {\n background-color: var(--lumo-primary-color-50pct);\n color: var(--lumo-primary-contrast-color);\n }\n\n :host([theme~=\"primary\"]:hover)::before {\n opacity: 0.1;\n }\n\n :host([theme~=\"primary\"][active])::before {\n background-color: var(--lumo-shade-20pct);\n }\n\n @media (pointer: coarse) {\n :host([theme~=\"primary\"][active])::before {\n background-color: var(--lumo-shade-60pct);\n }\n\n :host([theme~=\"primary\"]:not([active]):hover)::before {\n opacity: 0;\n }\n }\n\n :host([theme~=\"primary\"][active])::after {\n opacity: 0.2;\n }\n\n /* Colors (success, error, contrast) */\n\n :host([theme~=\"success\"]) {\n color: var(--lumo-success-text-color);\n }\n\n :host([theme~=\"success\"][theme~=\"primary\"]) {\n background-color: var(--lumo-success-color);\n color: var(--lumo-success-contrast-color);\n }\n\n :host([theme~=\"success\"][theme~=\"primary\"][disabled]) {\n background-color: var(--lumo-success-color-50pct);\n }\n\n :host([theme~=\"error\"]) {\n color: var(--lumo-error-text-color);\n }\n\n :host([theme~=\"error\"][theme~=\"primary\"]) {\n background-color: var(--lumo-error-color);\n color: var(--lumo-error-contrast-color);\n }\n\n :host([theme~=\"error\"][theme~=\"primary\"][disabled]) {\n background-color: var(--lumo-error-color-50pct);\n }\n\n :host([theme~=\"contrast\"]) {\n color: var(--lumo-contrast);\n }\n\n :host([theme~=\"contrast\"][theme~=\"primary\"]) {\n background-color: var(--lumo-contrast);\n color: var(--lumo-base-color);\n }\n\n :host([theme~=\"contrast\"][theme~=\"primary\"][disabled]) {\n background-color: var(--lumo-contrast-50pct);\n }\n\n /* Icons */\n\n [part] ::slotted(iron-icon) {\n display: inline-block;\n width: var(--lumo-icon-size-m);\n height: var(--lumo-icon-size-m);\n }\n\n /* Vaadin icons are based on a 16x16 grid (unlike Lumo and Material icons with 24x24), so they look too big by default */\n [part] ::slotted(iron-icon[icon^=\"vaadin:\"]) {\n padding: 0.25em;\n box-sizing: border-box !important;\n }\n\n [part=\"prefix\"] {\n margin-left: -0.25em;\n margin-right: 0.25em;\n }\n\n [part=\"suffix\"] {\n margin-left: 0.25em;\n margin-right: -0.25em;\n }\n\n /* Icon-only */\n\n :host([theme~=\"icon\"]:not([theme~=\"tertiary-inline\"])) {\n min-width: var(--lumo-button-size);\n padding-left: calc(var(--lumo-button-size) / 4);\n padding-right: calc(var(--lumo-button-size) / 4);\n }\n\n :host([theme~=\"icon\"]) [part=\"prefix\"],\n :host([theme~=\"icon\"]) [part=\"suffix\"] {\n margin-left: 0;\n margin-right: 0;\n }\n\n /* RTL specific styles */\n\n :host([dir=\"rtl\"]) [part=\"prefix\"] {\n margin-left: 0.25em;\n margin-right: -0.25em;\n }\n\n :host([dir=\"rtl\"]) [part=\"suffix\"] {\n margin-left: -0.25em;\n margin-right: 0.25em;\n }\n\n :host([dir=\"rtl\"][theme~=\"icon\"]) [part=\"prefix\"],\n :host([dir=\"rtl\"][theme~=\"icon\"]) [part=\"suffix\"] {\n margin-left: 0;\n margin-right: 0;\n }\n </style>\n </template>\n</dom-module>`;\n\ndocument.head.appendChild($_documentContainer.content);\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\nimport './boot.js';\n\n// unique global id for deduping mixins.\nlet dedupeId = 0;\n\n/**\n * @constructor\n * @extends {Function}\n * @private\n */\nfunction MixinFunction(){}\n/** @type {(WeakMap | undefined)} */\nMixinFunction.prototype.__mixinApplications;\n/** @type {(Object | undefined)} */\nMixinFunction.prototype.__mixinSet;\n\n/* eslint-disable valid-jsdoc */\n/**\n * Wraps an ES6 class expression mixin such that the mixin is only applied\n * if it has not already been applied its base argument. Also memoizes mixin\n * applications.\n *\n * @template T\n * @param {T} mixin ES6 class expression mixin to wrap\n * @return {T}\n * @suppress {invalidCasts}\n */\nexport const dedupingMixin = function(mixin) {\n let mixinApplications = /** @type {!MixinFunction} */(mixin).__mixinApplications;\n if (!mixinApplications) {\n mixinApplications = new WeakMap();\n /** @type {!MixinFunction} */(mixin).__mixinApplications = mixinApplications;\n }\n // maintain a unique id for each mixin\n let mixinDedupeId = dedupeId++;\n function dedupingMixin(base) {\n let baseSet = /** @type {!MixinFunction} */(base).__mixinSet;\n if (baseSet && baseSet[mixinDedupeId]) {\n return base;\n }\n let map = mixinApplications;\n let extended = map.get(base);\n if (!extended) {\n extended = /** @type {!Function} */(mixin)(base);\n map.set(base, extended);\n // copy inherited mixin set from the extended class, or the base class\n // NOTE: we avoid use of Set here because some browser (IE11)\n // cannot extend a base Set via the constructor.\n let mixinSet = Object.create(/** @type {!MixinFunction} */(extended).__mixinSet || baseSet || null);\n mixinSet[mixinDedupeId] = true;\n /** @type {!MixinFunction} */(extended).__mixinSet = mixinSet;\n }\n return extended;\n }\n\n return dedupingMixin;\n};\n/* eslint-enable valid-jsdoc */\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n/* eslint-disable valid-jsdoc */\n/**\n * Node wrapper to ensure ShadowDOM safe operation regardless of polyfill\n * presence or mode. Note that with the introduction of `ShadyDOM.noPatch`,\n * a node wrapper must be used to access ShadowDOM API.\n * This is similar to using `Polymer.dom` but relies exclusively\n * on the presence of the ShadyDOM polyfill rather than requiring the loading\n * of legacy (Polymer.dom) API.\n * @type {function(Node):Node}\n */\nexport const wrap = (window['ShadyDOM'] && window['ShadyDOM']['noPatch'] && window['ShadyDOM']['wrap']) ?\n window['ShadyDOM']['wrap'] :\n (window['ShadyDOM'] ? (n) => ShadyDOM['patch'](n) : (n) => n);\n\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\nimport './boot.js';\n\n/**\n * Module with utilities for manipulating structured data path strings.\n *\n * @summary Module with utilities for manipulating structured data path strings.\n */\n\n/**\n * Returns true if the given string is a structured data path (has dots).\n *\n * Example:\n *\n * ```\n * isPath('foo.bar.baz') // true\n * isPath('foo') // false\n * ```\n *\n * @param {string} path Path string\n * @return {boolean} True if the string contained one or more dots\n */\nexport function isPath(path) {\n return path.indexOf('.') >= 0;\n}\n\n/**\n * Returns the root property name for the given path.\n *\n * Example:\n *\n * ```\n * root('foo.bar.baz') // 'foo'\n * root('foo') // 'foo'\n * ```\n *\n * @param {string} path Path string\n * @return {string} Root property name\n */\nexport function root(path) {\n let dotIndex = path.indexOf('.');\n if (dotIndex === -1) {\n return path;\n }\n return path.slice(0, dotIndex);\n}\n\n/**\n * Given `base` is `foo.bar`, `foo` is an ancestor, `foo.bar` is not\n * Returns true if the given path is an ancestor of the base path.\n *\n * Example:\n *\n * ```\n * isAncestor('foo.bar', 'foo') // true\n * isAncestor('foo.bar', 'foo.bar') // false\n * isAncestor('foo.bar', 'foo.bar.baz') // false\n * ```\n *\n * @param {string} base Path string to test against.\n * @param {string} path Path string to test.\n * @return {boolean} True if `path` is an ancestor of `base`.\n */\nexport function isAncestor(base, path) {\n // base.startsWith(path + '.');\n return base.indexOf(path + '.') === 0;\n}\n\n/**\n * Given `base` is `foo.bar`, `foo.bar.baz` is an descendant\n *\n * Example:\n *\n * ```\n * isDescendant('foo.bar', 'foo.bar.baz') // true\n * isDescendant('foo.bar', 'foo.bar') // false\n * isDescendant('foo.bar', 'foo') // false\n * ```\n *\n * @param {string} base Path string to test against.\n * @param {string} path Path string to test.\n * @return {boolean} True if `path` is a descendant of `base`.\n */\nexport function isDescendant(base, path) {\n // path.startsWith(base + '.');\n return path.indexOf(base + '.') === 0;\n}\n\n/**\n * Replaces a previous base path with a new base path, preserving the\n * remainder of the path.\n *\n * User must ensure `path` has a prefix of `base`.\n *\n * Example:\n *\n * ```\n * translate('foo.bar', 'zot', 'foo.bar.baz') // 'zot.baz'\n * ```\n *\n * @param {string} base Current base string to remove\n * @param {string} newBase New base string to replace with\n * @param {string} path Path to translate\n * @return {string} Translated string\n */\nexport function translate(base, newBase, path) {\n return newBase + path.slice(base.length);\n}\n\n/**\n * @param {string} base Path string to test against\n * @param {string} path Path string to test\n * @return {boolean} True if `path` is equal to `base`\n */\nexport function matches(base, path) {\n return (base === path) ||\n isAncestor(base, path) ||\n isDescendant(base, path);\n}\n\n/**\n * Converts array-based paths to flattened path. String-based paths\n * are returned as-is.\n *\n * Example:\n *\n * ```\n * normalize(['foo.bar', 0, 'baz']) // 'foo.bar.0.baz'\n * normalize('foo.bar.0.baz') // 'foo.bar.0.baz'\n * ```\n *\n * @param {string | !Array<string|number>} path Input path\n * @return {string} Flattened path\n */\nexport function normalize(path) {\n if (Array.isArray(path)) {\n let parts = [];\n for (let i=0; i<path.length; i++) {\n let args = path[i].toString().split('.');\n for (let j=0; j<args.length; j++) {\n parts.push(args[j]);\n }\n }\n return parts.join('.');\n } else {\n return path;\n }\n}\n\n/**\n * Splits a path into an array of property names. Accepts either arrays\n * of path parts or strings.\n *\n * Example:\n *\n * ```\n * split(['foo.bar', 0, 'baz']) // ['foo', 'bar', '0', 'baz']\n * split('foo.bar.0.baz') // ['foo', 'bar', '0', 'baz']\n * ```\n *\n * @param {string | !Array<string|number>} path Input path\n * @return {!Array<string>} Array of path parts\n * @suppress {checkTypes}\n */\nexport function split(path) {\n if (Array.isArray(path)) {\n return normalize(path).split('.');\n }\n return path.toString().split('.');\n}\n\n/**\n * Reads a value from a path. If any sub-property in the path is `undefined`,\n * this method returns `undefined` (will never throw.\n *\n * @param {Object} root Object from which to dereference path from\n * @param {string | !Array<string|number>} path Path to read\n * @param {Object=} info If an object is provided to `info`, the normalized\n * (flattened) path will be set to `info.path`.\n * @return {*} Value at path, or `undefined` if the path could not be\n * fully dereferenced.\n */\nexport function get(root, path, info) {\n let prop = root;\n let parts = split(path);\n // Loop over path parts[0..n-1] and dereference\n for (let i=0; i<parts.length; i++) {\n if (!prop) {\n return;\n }\n let part = parts[i];\n prop = prop[part];\n }\n if (info) {\n info.path = parts.join('.');\n }\n return prop;\n}\n\n/**\n * Sets a value to a path. If any sub-property in the path is `undefined`,\n * this method will no-op.\n *\n * @param {Object} root Object from which to dereference path from\n * @param {string | !Array<string|number>} path Path to set\n * @param {*} value Value to set to path\n * @return {string | undefined} The normalized version of the input path\n */\nexport function set(root, path, value) {\n let prop = root;\n let parts = split(path);\n let last = parts[parts.length-1];\n if (parts.length > 1) {\n // Loop over path parts[0..n-2] and dereference\n for (let i=0; i<parts.length-1; i++) {\n let part = parts[i];\n prop = prop[part];\n if (!prop) {\n return;\n }\n }\n // Set value to object at end of path\n prop[last] = value;\n } else {\n // Simple property set\n prop[path] = value;\n }\n return parts.join('.');\n}\n\n/**\n * Returns true if the given string is a structured data path (has dots).\n *\n * This function is deprecated. Use `isPath` instead.\n *\n * Example:\n *\n * ```\n * isDeep('foo.bar.baz') // true\n * isDeep('foo') // false\n * ```\n *\n * @deprecated\n * @param {string} path Path string\n * @return {boolean} True if the string contained one or more dots\n */\nexport const isDeep = isPath;\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\nimport './boot.js';\n\nconst caseMap = {};\nconst DASH_TO_CAMEL = /-[a-z]/g;\nconst CAMEL_TO_DASH = /([A-Z])/g;\n\n/**\n * @fileoverview Module with utilities for converting between \"dash-case\" and\n * \"camelCase\" identifiers.\n */\n\n/**\n * Converts \"dash-case\" identifier (e.g. `foo-bar-baz`) to \"camelCase\"\n * (e.g. `fooBarBaz`).\n *\n * @param {string} dash Dash-case identifier\n * @return {string} Camel-case representation of the identifier\n */\nexport function dashToCamelCase(dash) {\n return caseMap[dash] || (\n caseMap[dash] = dash.indexOf('-') < 0 ? dash : dash.replace(DASH_TO_CAMEL,\n (m) => m[1].toUpperCase()\n )\n );\n}\n\n/**\n * Converts \"camelCase\" identifier (e.g. `fooBarBaz`) to \"dash-case\"\n * (e.g. `foo-bar-baz`).\n *\n * @param {string} camel Camel-case identifier\n * @return {string} Dash-case representation of the identifier\n */\nexport function camelToDashCase(camel) {\n return caseMap[camel] || (\n caseMap[camel] = camel.replace(CAMEL_TO_DASH, '-$1').toLowerCase()\n );\n}\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n/**\n * @fileoverview\n *\n * This module provides a number of strategies for enqueuing asynchronous\n * tasks. Each sub-module provides a standard `run(fn)` interface that returns a\n * handle, and a `cancel(handle)` interface for canceling async tasks before\n * they run.\n *\n * @summary Module that provides a number of strategies for enqueuing\n * asynchronous tasks.\n */\n\nimport './boot.js';\n\n// Microtask implemented using Mutation Observer\nlet microtaskCurrHandle = 0;\nlet microtaskLastHandle = 0;\nlet microtaskCallbacks = [];\nlet microtaskNodeContent = 0;\nlet microtaskScheduled = false;\nlet microtaskNode = document.createTextNode('');\nnew window.MutationObserver(microtaskFlush).observe(microtaskNode, {characterData: true});\n\nfunction microtaskFlush() {\n microtaskScheduled = false;\n const len = microtaskCallbacks.length;\n for (let i = 0; i < len; i++) {\n let cb = microtaskCallbacks[i];\n if (cb) {\n try {\n cb();\n } catch (e) {\n setTimeout(() => { throw e; });\n }\n }\n }\n microtaskCallbacks.splice(0, len);\n microtaskLastHandle += len;\n}\n\n/**\n * Async interface wrapper around `setTimeout`.\n *\n * @namespace\n * @summary Async interface wrapper around `setTimeout`.\n */\nconst timeOut = {\n /**\n * Returns a sub-module with the async interface providing the provided\n * delay.\n *\n * @memberof timeOut\n * @param {number=} delay Time to wait before calling callbacks in ms\n * @return {!AsyncInterface} An async timeout interface\n */\n after(delay) {\n return {\n run(fn) { return window.setTimeout(fn, delay); },\n cancel(handle) {\n window.clearTimeout(handle);\n }\n };\n },\n /**\n * Enqueues a function called in the next task.\n *\n * @memberof timeOut\n * @param {!Function} fn Callback to run\n * @param {number=} delay Delay in milliseconds\n * @return {number} Handle used for canceling task\n */\n run(fn, delay) {\n return window.setTimeout(fn, delay);\n },\n /**\n * Cancels a previously enqueued `timeOut` callback.\n *\n * @memberof timeOut\n * @param {number} handle Handle returned from `run` of callback to cancel\n * @return {void}\n */\n cancel(handle) {\n window.clearTimeout(handle);\n }\n};\nexport {timeOut};\n\n/**\n * Async interface wrapper around `requestAnimationFrame`.\n *\n * @namespace\n * @summary Async interface wrapper around `requestAnimationFrame`.\n */\nconst animationFrame = {\n /**\n * Enqueues a function called at `requestAnimationFrame` timing.\n *\n * @memberof animationFrame\n * @param {function(number):void} fn Callback to run\n * @return {number} Handle used for canceling task\n */\n run(fn) {\n return window.requestAnimationFrame(fn);\n },\n /**\n * Cancels a previously enqueued `animationFrame` callback.\n *\n * @memberof animationFrame\n * @param {number} handle Handle returned from `run` of callback to cancel\n * @return {void}\n */\n cancel(handle) {\n window.cancelAnimationFrame(handle);\n }\n};\nexport {animationFrame};\n\n/**\n * Async interface wrapper around `requestIdleCallback`. Falls back to\n * `setTimeout` on browsers that do not support `requestIdleCallback`.\n *\n * @namespace\n * @summary Async interface wrapper around `requestIdleCallback`.\n */\nconst idlePeriod = {\n /**\n * Enqueues a function called at `requestIdleCallback` timing.\n *\n * @memberof idlePeriod\n * @param {function(!IdleDeadline):void} fn Callback to run\n * @return {number} Handle used for canceling task\n */\n run(fn) {\n return window.requestIdleCallback ?\n window.requestIdleCallback(fn) :\n window.setTimeout(fn, 16);\n },\n /**\n * Cancels a previously enqueued `idlePeriod` callback.\n *\n * @memberof idlePeriod\n * @param {number} handle Handle returned from `run` of callback to cancel\n * @return {void}\n */\n cancel(handle) {\n window.cancelIdleCallback ?\n window.cancelIdleCallback(handle) :\n window.clearTimeout(handle);\n }\n};\nexport {idlePeriod};\n\n/**\n * Async interface for enqueuing callbacks that run at microtask timing.\n *\n * Note that microtask timing is achieved via a single `MutationObserver`,\n * and thus callbacks enqueued with this API will all run in a single\n * batch, and not interleaved with other microtasks such as promises.\n * Promises are avoided as an implementation choice for the time being\n * due to Safari bugs that cause Promises to lack microtask guarantees.\n *\n * @namespace\n * @summary Async interface for enqueuing callbacks that run at microtask\n * timing.\n */\nconst microTask = {\n\n /**\n * Enqueues a function called at microtask timing.\n *\n * @memberof microTask\n * @param {!Function=} callback Callback to run\n * @return {number} Handle used for canceling task\n */\n run(callback) {\n if (!microtaskScheduled) {\n microtaskScheduled = true;\n microtaskNode.textContent = microtaskNodeContent++;\n }\n microtaskCallbacks.push(callback);\n return microtaskCurrHandle++;\n },\n\n /**\n * Cancels a previously enqueued `microTask` callback.\n *\n * @memberof microTask\n * @param {number} handle Handle returned from `run` of callback to cancel\n * @return {void}\n */\n cancel(handle) {\n const idx = handle - microtaskLastHandle;\n if (idx >= 0) {\n if (!microtaskCallbacks[idx]) {\n throw new Error('invalid async handle: ' + handle);\n }\n microtaskCallbacks[idx] = null;\n }\n }\n\n};\nexport {microTask};\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\nimport '../utils/boot.js';\n\nimport { dedupingMixin } from '../utils/mixin.js';\nimport { microTask } from '../utils/async.js';\nimport { wrap } from '../utils/wrap.js';\n\n/** @const {!AsyncInterface} */\nconst microtask = microTask;\n\n/**\n * Element class mixin that provides basic meta-programming for creating one\n * or more property accessors (getter/setter pair) that enqueue an async\n * (batched) `_propertiesChanged` callback.\n *\n * For basic usage of this mixin, call `MyClass.createProperties(props)`\n * once at class definition time to create property accessors for properties\n * named in props, implement `_propertiesChanged` to react as desired to\n * property changes, and implement `static get observedAttributes()` and\n * include lowercase versions of any property names that should be set from\n * attributes. Last, call `this._enableProperties()` in the element's\n * `connectedCallback` to enable the accessors.\n *\n * @mixinFunction\n * @polymer\n * @summary Element class mixin for reacting to property changes from\n * generated property accessors.\n * @template T\n * @param {function(new:T)} superClass Class to apply mixin to.\n * @return {function(new:T)} superClass with mixin applied.\n */\nexport const PropertiesChanged = dedupingMixin(\n /**\n * @template T\n * @param {function(new:T)} superClass Class to apply mixin to.\n * @return {function(new:T)} superClass with mixin applied.\n */\n (superClass) => {\n\n /**\n * @polymer\n * @mixinClass\n * @implements {Polymer_PropertiesChanged}\n * @unrestricted\n */\n class PropertiesChanged extends superClass {\n\n /**\n * Creates property accessors for the given property names.\n * @param {!Object} props Object whose keys are names of accessors.\n * @return {void}\n * @protected\n * @nocollapse\n */\n static createProperties(props) {\n const proto = this.prototype;\n for (let prop in props) {\n // don't stomp an existing accessor\n if (!(prop in proto)) {\n proto._createPropertyAccessor(prop);\n }\n }\n }\n\n /**\n * Returns an attribute name that corresponds to the given property.\n * The attribute name is the lowercased property name. Override to\n * customize this mapping.\n * @param {string} property Property to convert\n * @return {string} Attribute name corresponding to the given property.\n *\n * @protected\n * @nocollapse\n */\n static attributeNameForProperty(property) {\n return property.toLowerCase();\n }\n\n /**\n * Override point to provide a type to which to deserialize a value to\n * a given property.\n * @param {string} name Name of property\n *\n * @protected\n * @nocollapse\n */\n static typeForProperty(name) { } //eslint-disable-line no-unused-vars\n\n /**\n * Creates a setter/getter pair for the named property with its own\n * local storage. The getter returns the value in the local storage,\n * and the setter calls `_setProperty`, which updates the local storage\n * for the property and enqueues a `_propertiesChanged` callback.\n *\n * This method may be called on a prototype or an instance. Calling\n * this method may overwrite a property value that already exists on\n * the prototype/instance by creating the accessor.\n *\n * @param {string} property Name of the property\n * @param {boolean=} readOnly When true, no setter is created; the\n * protected `_setProperty` function must be used to set the property\n * @return {void}\n * @protected\n * @override\n */\n _createPropertyAccessor(property, readOnly) {\n this._addPropertyToAttributeMap(property);\n if (!this.hasOwnProperty(JSCompiler_renameProperty('__dataHasAccessor', this))) {\n this.__dataHasAccessor = Object.assign({}, this.__dataHasAccessor);\n }\n if (!this.__dataHasAccessor[property]) {\n this.__dataHasAccessor[property] = true;\n this._definePropertyAccessor(property, readOnly);\n }\n }\n\n /**\n * Adds the given `property` to a map matching attribute names\n * to property names, using `attributeNameForProperty`. This map is\n * used when deserializing attribute values to properties.\n *\n * @param {string} property Name of the property\n * @override\n */\n _addPropertyToAttributeMap(property) {\n if (!this.hasOwnProperty(JSCompiler_renameProperty('__dataAttributes', this))) {\n this.__dataAttributes = Object.assign({}, this.__dataAttributes);\n }\n // This check is technically not correct; it's an optimization that\n // assumes that if a _property_ name is already in the map (note this is\n // an attr->property map), the property mapped directly to the attribute\n // and it has already been mapped. This would fail if\n // `attributeNameForProperty` were overridden such that this was not the\n // case.\n let attr = this.__dataAttributes[property];\n if (!attr) {\n attr = this.constructor.attributeNameForProperty(property);\n this.__dataAttributes[attr] = property;\n }\n return attr;\n }\n\n /**\n * Defines a property accessor for the given property.\n * @param {string} property Name of the property\n * @param {boolean=} readOnly When true, no setter is created\n * @return {void}\n * @override\n */\n _definePropertyAccessor(property, readOnly) {\n Object.defineProperty(this, property, {\n /* eslint-disable valid-jsdoc */\n /** @this {PropertiesChanged} */\n get() {\n // Inline for perf instead of using `_getProperty`\n return this.__data[property];\n },\n /** @this {PropertiesChanged} */\n set: readOnly ? function () {} : function (value) {\n // Inline for perf instead of using `_setProperty`\n if (this._setPendingProperty(property, value, true)) {\n this._invalidateProperties();\n }\n }\n /* eslint-enable */\n });\n }\n\n constructor() {\n super();\n /** @type {boolean} */\n this.__dataEnabled = false;\n this.__dataReady = false;\n this.__dataInvalid = false;\n this.__data = {};\n this.__dataPending = null;\n this.__dataOld = null;\n this.__dataInstanceProps = null;\n /** @type {number} */\n // NOTE: used to track re-entrant calls to `_flushProperties`\n this.__dataCounter = 0;\n this.__serializing = false;\n this._initializeProperties();\n }\n\n /**\n * Lifecycle callback called when properties are enabled via\n * `_enableProperties`.\n *\n * Users may override this function to implement behavior that is\n * dependent on the element having its property data initialized, e.g.\n * from defaults (initialized from `constructor`, `_initializeProperties`),\n * `attributeChangedCallback`, or values propagated from host e.g. via\n * bindings. `super.ready()` must be called to ensure the data system\n * becomes enabled.\n *\n * @return {void}\n * @public\n * @override\n */\n ready() {\n this.__dataReady = true;\n this._flushProperties();\n }\n\n /**\n * Initializes the local storage for property accessors.\n *\n * Provided as an override point for performing any setup work prior\n * to initializing the property accessor system.\n *\n * @return {void}\n * @protected\n * @override\n */\n _initializeProperties() {\n // Capture instance properties; these will be set into accessors\n // during first flush. Don't set them here, since we want\n // these to overwrite defaults/constructor assignments\n for (let p in this.__dataHasAccessor) {\n if (this.hasOwnProperty(p)) {\n this.__dataInstanceProps = this.__dataInstanceProps || {};\n this.__dataInstanceProps[p] = this[p];\n delete this[p];\n }\n }\n }\n\n /**\n * Called at ready time with bag of instance properties that overwrote\n * accessors when the element upgraded.\n *\n * The default implementation sets these properties back into the\n * setter at ready time. This method is provided as an override\n * point for customizing or providing more efficient initialization.\n *\n * @param {Object} props Bag of property values that were overwritten\n * when creating property accessors.\n * @return {void}\n * @protected\n * @override\n */\n _initializeInstanceProperties(props) {\n Object.assign(this, props);\n }\n\n /**\n * Updates the local storage for a property (via `_setPendingProperty`)\n * and enqueues a `_proeprtiesChanged` callback.\n *\n * @param {string} property Name of the property\n * @param {*} value Value to set\n * @return {void}\n * @protected\n * @override\n */\n _setProperty(property, value) {\n if (this._setPendingProperty(property, value)) {\n this._invalidateProperties();\n }\n }\n\n /**\n * Returns the value for the given property.\n * @param {string} property Name of property\n * @return {*} Value for the given property\n * @protected\n * @override\n */\n _getProperty(property) {\n return this.__data[property];\n }\n\n /* eslint-disable no-unused-vars */\n /**\n * Updates the local storage for a property, records the previous value,\n * and adds it to the set of \"pending changes\" that will be passed to the\n * `_propertiesChanged` callback. This method does not enqueue the\n * `_propertiesChanged` callback.\n *\n * @param {string} property Name of the property\n * @param {*} value Value to set\n * @param {boolean=} ext Not used here; affordance for closure\n * @return {boolean} Returns true if the property changed\n * @protected\n * @override\n */\n _setPendingProperty(property, value, ext) {\n let old = this.__data[property];\n let changed = this._shouldPropertyChange(property, value, old);\n if (changed) {\n if (!this.__dataPending) {\n this.__dataPending = {};\n this.__dataOld = {};\n }\n // Ensure old is captured from the last turn\n if (this.__dataOld && !(property in this.__dataOld)) {\n this.__dataOld[property] = old;\n }\n this.__data[property] = value;\n this.__dataPending[property] = value;\n }\n return changed;\n }\n /* eslint-enable */\n\n /**\n * @param {string} property Name of the property\n * @return {boolean} Returns true if the property is pending.\n */\n _isPropertyPending(property) {\n return !!(this.__dataPending && this.__dataPending.hasOwnProperty(property));\n }\n\n /**\n * Marks the properties as invalid, and enqueues an async\n * `_propertiesChanged` callback.\n *\n * @return {void}\n * @protected\n * @override\n */\n _invalidateProperties() {\n if (!this.__dataInvalid && this.__dataReady) {\n this.__dataInvalid = true;\n microtask.run(() => {\n if (this.__dataInvalid) {\n this.__dataInvalid = false;\n this._flushProperties();\n }\n });\n }\n }\n\n /**\n * Call to enable property accessor processing. Before this method is\n * called accessor values will be set but side effects are\n * queued. When called, any pending side effects occur immediately.\n * For elements, generally `connectedCallback` is a normal spot to do so.\n * It is safe to call this method multiple times as it only turns on\n * property accessors once.\n *\n * @return {void}\n * @protected\n * @override\n */\n _enableProperties() {\n if (!this.__dataEnabled) {\n this.__dataEnabled = true;\n if (this.__dataInstanceProps) {\n this._initializeInstanceProperties(this.__dataInstanceProps);\n this.__dataInstanceProps = null;\n }\n this.ready();\n }\n }\n\n /**\n * Calls the `_propertiesChanged` callback with the current set of\n * pending changes (and old values recorded when pending changes were\n * set), and resets the pending set of changes. Generally, this method\n * should not be called in user code.\n *\n * @return {void}\n * @protected\n * @override\n */\n _flushProperties() {\n this.__dataCounter++;\n const props = this.__data;\n const changedProps = this.__dataPending;\n const old = this.__dataOld;\n if (this._shouldPropertiesChange(props, changedProps, old)) {\n this.__dataPending = null;\n this.__dataOld = null;\n this._propertiesChanged(props, changedProps, old);\n }\n this.__dataCounter--;\n }\n\n /**\n * Called in `_flushProperties` to determine if `_propertiesChanged`\n * should be called. The default implementation returns true if\n * properties are pending. Override to customize when\n * `_propertiesChanged` is called.\n * @param {!Object} currentProps Bag of all current accessor values\n * @param {?Object} changedProps Bag of properties changed since the last\n * call to `_propertiesChanged`\n * @param {?Object} oldProps Bag of previous values for each property\n * in `changedProps`\n * @return {boolean} true if changedProps is truthy\n * @override\n */\n _shouldPropertiesChange(currentProps, changedProps, oldProps) { // eslint-disable-line no-unused-vars\n return Boolean(changedProps);\n }\n\n /**\n * Callback called when any properties with accessors created via\n * `_createPropertyAccessor` have been set.\n *\n * @param {!Object} currentProps Bag of all current accessor values\n * @param {?Object} changedProps Bag of properties changed since the last\n * call to `_propertiesChanged`\n * @param {?Object} oldProps Bag of previous values for each property\n * in `changedProps`\n * @return {void}\n * @protected\n * @override\n */\n _propertiesChanged(currentProps, changedProps, oldProps) { // eslint-disable-line no-unused-vars\n }\n\n /**\n * Method called to determine whether a property value should be\n * considered as a change and cause the `_propertiesChanged` callback\n * to be enqueued.\n *\n * The default implementation returns `true` if a strict equality\n * check fails. The method always returns false for `NaN`.\n *\n * Override this method to e.g. provide stricter checking for\n * Objects/Arrays when using immutable patterns.\n *\n * @param {string} property Property name\n * @param {*} value New property value\n * @param {*} old Previous property value\n * @return {boolean} Whether the property should be considered a change\n * and enqueue a `_proeprtiesChanged` callback\n * @protected\n * @override\n */\n _shouldPropertyChange(property, value, old) {\n return (\n // Strict equality check\n (old !== value &&\n // This ensures (old==NaN, value==NaN) always returns false\n (old === old || value === value))\n );\n }\n\n /**\n * Implements native Custom Elements `attributeChangedCallback` to\n * set an attribute value to a property via `_attributeToProperty`.\n *\n * @param {string} name Name of attribute that changed\n * @param {?string} old Old attribute value\n * @param {?string} value New attribute value\n * @param {?string} namespace Attribute namespace.\n * @return {void}\n * @suppress {missingProperties} Super may or may not implement the callback\n * @override\n */\n attributeChangedCallback(name, old, value, namespace) {\n if (old !== value) {\n this._attributeToProperty(name, value);\n }\n if (super.attributeChangedCallback) {\n super.attributeChangedCallback(name, old, value, namespace);\n }\n }\n\n /**\n * Deserializes an attribute to its associated property.\n *\n * This method calls the `_deserializeValue` method to convert the string to\n * a typed value.\n *\n * @param {string} attribute Name of attribute to deserialize.\n * @param {?string} value of the attribute.\n * @param {*=} type type to deserialize to, defaults to the value\n * returned from `typeForProperty`\n * @return {void}\n * @override\n */\n _attributeToProperty(attribute, value, type) {\n if (!this.__serializing) {\n const map = this.__dataAttributes;\n const property = map && map[attribute] || attribute;\n this[property] = this._deserializeValue(value, type ||\n this.constructor.typeForProperty(property));\n }\n }\n\n /**\n * Serializes a property to its associated attribute.\n *\n * @suppress {invalidCasts} Closure can't figure out `this` is an element.\n *\n * @param {string} property Property name to reflect.\n * @param {string=} attribute Attribute name to reflect to.\n * @param {*=} value Property value to refect.\n * @return {void}\n * @override\n */\n _propertyToAttribute(property, attribute, value) {\n this.__serializing = true;\n value = (arguments.length < 3) ? this[property] : value;\n this._valueToNodeAttribute(/** @type {!HTMLElement} */(this), value,\n attribute || this.constructor.attributeNameForProperty(property));\n this.__serializing = false;\n }\n\n /**\n * Sets a typed value to an HTML attribute on a node.\n *\n * This method calls the `_serializeValue` method to convert the typed\n * value to a string. If the `_serializeValue` method returns `undefined`,\n * the attribute will be removed (this is the default for boolean\n * type `false`).\n *\n * @param {Element} node Element to set attribute to.\n * @param {*} value Value to serialize.\n * @param {string} attribute Attribute name to serialize to.\n * @return {void}\n * @override\n */\n _valueToNodeAttribute(node, value, attribute) {\n const str = this._serializeValue(value);\n if (attribute === 'class' || attribute === 'name' || attribute === 'slot') {\n node = /** @type {?Element} */(wrap(node));\n }\n if (str === undefined) {\n node.removeAttribute(attribute);\n } else {\n node.setAttribute(\n attribute,\n // Closure's type for `setAttribute`'s second parameter incorrectly\n // excludes `TrustedScript`.\n (str === '' && window.trustedTypes) ?\n /** @type {?} */ (window.trustedTypes.emptyScript) :\n str);\n }\n }\n\n /**\n * Converts a typed JavaScript value to a string.\n *\n * This method is called when setting JS property values to\n * HTML attributes. Users may override this method to provide\n * serialization for custom types.\n *\n * @param {*} value Property value to serialize.\n * @return {string | undefined} String serialized from the provided\n * property value.\n * @override\n */\n _serializeValue(value) {\n switch (typeof value) {\n case 'boolean':\n return value ? '' : undefined;\n default:\n return value != null ? value.toString() : undefined;\n }\n }\n\n /**\n * Converts a string to a typed JavaScript value.\n *\n * This method is called when reading HTML attribute values to\n * JS properties. Users may override this method to provide\n * deserialization for custom `type`s. Types for `Boolean`, `String`,\n * and `Number` convert attributes to the expected types.\n *\n * @param {?string} value Value to deserialize.\n * @param {*=} type Type to deserialize the string to.\n * @return {*} Typed value deserialized from the provided string.\n * @override\n */\n _deserializeValue(value, type) {\n switch (type) {\n case Boolean:\n return (value !== null);\n case Number:\n return Number(value);\n default:\n return value;\n }\n }\n\n }\n\n return PropertiesChanged;\n});\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\nimport '../utils/boot.js';\n\nimport { dedupingMixin } from '../utils/mixin.js';\nimport { camelToDashCase, dashToCamelCase } from '../utils/case-map.js';\nimport { PropertiesChanged } from './properties-changed.js';\n\n// Save map of native properties; this forms a blacklist or properties\n// that won't have their values \"saved\" by `saveAccessorValue`, since\n// reading from an HTMLElement accessor from the context of a prototype throws\nconst nativeProperties = {};\nlet proto = HTMLElement.prototype;\nwhile (proto) {\n let props = Object.getOwnPropertyNames(proto);\n for (let i=0; i<props.length; i++) {\n nativeProperties[props[i]] = true;\n }\n proto = Object.getPrototypeOf(proto);\n}\n\nconst isTrustedType = (() => {\n if (!window.trustedTypes) {\n return () => false;\n }\n return (val) => trustedTypes.isHTML(val) ||\n trustedTypes.isScript(val) || trustedTypes.isScriptURL(val);\n})();\n\n/**\n * Used to save the value of a property that will be overridden with\n * an accessor. If the `model` is a prototype, the values will be saved\n * in `__dataProto`, and it's up to the user (or downstream mixin) to\n * decide how/when to set these values back into the accessors.\n * If `model` is already an instance (it has a `__data` property), then\n * the value will be set as a pending property, meaning the user should\n * call `_invalidateProperties` or `_flushProperties` to take effect\n *\n * @param {Object} model Prototype or instance\n * @param {string} property Name of property\n * @return {void}\n * @private\n */\nfunction saveAccessorValue(model, property) {\n // Don't read/store value for any native properties since they could throw\n if (!nativeProperties[property]) {\n let value = model[property];\n if (value !== undefined) {\n if (model.__data) {\n // Adding accessor to instance; update the property\n // It is the user's responsibility to call _flushProperties\n model._setPendingProperty(property, value);\n } else {\n // Adding accessor to proto; save proto's value for instance-time use\n if (!model.__dataProto) {\n model.__dataProto = {};\n } else if (!model.hasOwnProperty(JSCompiler_renameProperty('__dataProto', model))) {\n model.__dataProto = Object.create(model.__dataProto);\n }\n model.__dataProto[property] = value;\n }\n }\n }\n}\n\n/**\n * Element class mixin that provides basic meta-programming for creating one\n * or more property accessors (getter/setter pair) that enqueue an async\n * (batched) `_propertiesChanged` callback.\n *\n * For basic usage of this mixin:\n *\n * - Declare attributes to observe via the standard `static get\n * observedAttributes()`. Use `dash-case` attribute names to represent\n * `camelCase` property names.\n * - Implement the `_propertiesChanged` callback on the class.\n * - Call `MyClass.createPropertiesForAttributes()` **once** on the class to\n * generate property accessors for each observed attribute. This must be\n * called before the first instance is created, for example, by calling it\n * before calling `customElements.define`. It can also be called lazily from\n * the element's `constructor`, as long as it's guarded so that the call is\n * only made once, when the first instance is created.\n * - Call `this._enableProperties()` in the element's `connectedCallback` to\n * enable the accessors.\n *\n * Any `observedAttributes` will automatically be\n * deserialized via `attributeChangedCallback` and set to the associated\n * property using `dash-case`-to-`camelCase` convention.\n *\n * @mixinFunction\n * @polymer\n * @appliesMixin PropertiesChanged\n * @summary Element class mixin for reacting to property changes from\n * generated property accessors.\n * @template T\n * @param {function(new:T)} superClass Class to apply mixin to.\n * @return {function(new:T)} superClass with mixin applied.\n */\nexport const PropertyAccessors = dedupingMixin(superClass => {\n\n /**\n * @constructor\n * @implements {Polymer_PropertiesChanged}\n * @unrestricted\n * @private\n */\n const base = PropertiesChanged(superClass);\n\n /**\n * @polymer\n * @mixinClass\n * @implements {Polymer_PropertyAccessors}\n * @extends {base}\n * @unrestricted\n */\n class PropertyAccessors extends base {\n\n /**\n * Generates property accessors for all attributes in the standard\n * static `observedAttributes` array.\n *\n * Attribute names are mapped to property names using the `dash-case` to\n * `camelCase` convention\n *\n * @return {void}\n * @nocollapse\n */\n static createPropertiesForAttributes() {\n let a$ = /** @type {?} */ (this).observedAttributes;\n for (let i=0; i < a$.length; i++) {\n this.prototype._createPropertyAccessor(dashToCamelCase(a$[i]));\n }\n }\n\n /**\n * Returns an attribute name that corresponds to the given property.\n * By default, converts camel to dash case, e.g. `fooBar` to `foo-bar`.\n * @param {string} property Property to convert\n * @return {string} Attribute name corresponding to the given property.\n *\n * @protected\n * @nocollapse\n */\n static attributeNameForProperty(property) {\n return camelToDashCase(property);\n }\n\n /**\n * Overrides PropertiesChanged implementation to initialize values for\n * accessors created for values that already existed on the element\n * prototype.\n *\n * @return {void}\n * @protected\n * @override\n */\n _initializeProperties() {\n if (this.__dataProto) {\n this._initializeProtoProperties(this.__dataProto);\n this.__dataProto = null;\n }\n super._initializeProperties();\n }\n\n /**\n * Called at instance time with bag of properties that were overwritten\n * by accessors on the prototype when accessors were created.\n *\n * The default implementation sets these properties back into the\n * setter at instance time. This method is provided as an override\n * point for customizing or providing more efficient initialization.\n *\n * @param {Object} props Bag of property values that were overwritten\n * when creating property accessors.\n * @return {void}\n * @protected\n * @override\n */\n _initializeProtoProperties(props) {\n for (let p in props) {\n this._setProperty(p, props[p]);\n }\n }\n\n /**\n * Ensures the element has the given attribute. If it does not,\n * assigns the given value to the attribute.\n *\n * @suppress {invalidCasts} Closure can't figure out `this` is infact an\n * element\n *\n * @param {string} attribute Name of attribute to ensure is set.\n * @param {string} value of the attribute.\n * @return {void}\n * @override\n */\n _ensureAttribute(attribute, value) {\n const el = /** @type {!HTMLElement} */(this);\n if (!el.hasAttribute(attribute)) {\n this._valueToNodeAttribute(el, value, attribute);\n }\n }\n\n /**\n * Overrides PropertiesChanged implemention to serialize objects as JSON.\n *\n * @param {*} value Property value to serialize.\n * @return {string | undefined} String serialized from the provided property\n * value.\n * @override\n */\n _serializeValue(value) {\n /* eslint-disable no-fallthrough */\n switch (typeof value) {\n case 'object':\n if (value instanceof Date) {\n return value.toString();\n } else if (value) {\n if (isTrustedType(value)) {\n /**\n * Here `value` isn't actually a string, but it should be\n * passed into APIs that normally expect a string, like\n * elem.setAttribute.\n */\n return /** @type {?} */ (value);\n }\n try {\n return JSON.stringify(value);\n } catch(x) {\n return '';\n }\n }\n\n default:\n return super._serializeValue(value);\n }\n }\n\n /**\n * Converts a string to a typed JavaScript value.\n *\n * This method is called by Polymer when reading HTML attribute values to\n * JS properties. Users may override this method on Polymer element\n * prototypes to provide deserialization for custom `type`s. Note,\n * the `type` argument is the value of the `type` field provided in the\n * `properties` configuration object for a given property, and is\n * by convention the constructor for the type to deserialize.\n *\n *\n * @param {?string} value Attribute value to deserialize.\n * @param {*=} type Type to deserialize the string to.\n * @return {*} Typed value deserialized from the provided string.\n * @override\n */\n _deserializeValue(value, type) {\n /**\n * @type {*}\n */\n let outValue;\n switch (type) {\n case Object:\n try {\n outValue = JSON.parse(/** @type {string} */(value));\n } catch(x) {\n // allow non-JSON literals like Strings and Numbers\n outValue = value;\n }\n break;\n case Array:\n try {\n outValue = JSON.parse(/** @type {string} */(value));\n } catch(x) {\n outValue = null;\n console.warn(`Polymer::Attributes: couldn't decode Array as JSON: ${value}`);\n }\n break;\n case Date:\n outValue = isNaN(value) ? String(value) : Number(value);\n outValue = new Date(outValue);\n break;\n default:\n outValue = super._deserializeValue(value, type);\n break;\n }\n return outValue;\n }\n /* eslint-enable no-fallthrough */\n\n /**\n * Overrides PropertiesChanged implementation to save existing prototype\n * property value so that it can be reset.\n * @param {string} property Name of the property\n * @param {boolean=} readOnly When true, no setter is created\n *\n * When calling on a prototype, any overwritten values are saved in\n * `__dataProto`, and it is up to the subclasser to decide how/when\n * to set those properties back into the accessor. When calling on an\n * instance, the overwritten value is set via `_setPendingProperty`,\n * and the user should call `_invalidateProperties` or `_flushProperties`\n * for the values to take effect.\n * @protected\n * @return {void}\n * @override\n */\n _definePropertyAccessor(property, readOnly) {\n saveAccessorValue(this, property);\n super._definePropertyAccessor(property, readOnly);\n }\n\n /**\n * Returns true if this library created an accessor for the given property.\n *\n * @param {string} property Property name\n * @return {boolean} True if an accessor was created\n * @override\n */\n _hasAccessor(property) {\n return this.__dataHasAccessor && this.__dataHasAccessor[property];\n }\n\n /**\n * Returns true if the specified property has a pending change.\n *\n * @param {string} prop Property name\n * @return {boolean} True if property has a pending change\n * @protected\n * @override\n */\n _isPropertyPending(prop) {\n return Boolean(this.__dataPending && (prop in this.__dataPending));\n }\n\n }\n\n return PropertyAccessors;\n\n});\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\nimport '../utils/boot.js';\n\nimport { dedupingMixin } from '../utils/mixin.js';\n\n// 1.x backwards-compatible auto-wrapper for template type extensions\n// This is a clear layering violation and gives favored-nation status to\n// dom-if and dom-repeat templates. This is a conceit we're choosing to keep\n// a.) to ease 1.x backwards-compatibility due to loss of `is`, and\n// b.) to maintain if/repeat capability in parser-constrained elements\n// (e.g. table, select) in lieu of native CE type extensions without\n// massive new invention in this space (e.g. directive system)\nconst templateExtensions = {\n 'dom-if': true,\n 'dom-repeat': true\n};\n\nlet placeholderBugDetect = false;\nlet placeholderBug = false;\n\nfunction hasPlaceholderBug() {\n if (!placeholderBugDetect) {\n placeholderBugDetect = true;\n const t = document.createElement('textarea');\n t.placeholder = 'a';\n placeholderBug = t.placeholder === t.textContent;\n }\n return placeholderBug;\n}\n\n/**\n * Some browsers have a bug with textarea, where placeholder text is copied as\n * a textnode child of the textarea.\n *\n * If the placeholder is a binding, this can break template stamping in two\n * ways.\n *\n * One issue is that when the `placeholder` attribute is removed when the\n * binding is processed, the textnode child of the textarea is deleted, and the\n * template info tries to bind into that node.\n *\n * With `legacyOptimizations` in use, when the template is stamped and the\n * `textarea.textContent` binding is processed, no corresponding node is found\n * because it was removed during parsing. An exception is generated when this\n * binding is updated.\n *\n * With `legacyOptimizations` not in use, the template is cloned before\n * processing and this changes the above behavior. The cloned template also has\n * a value property set to the placeholder and textContent. This prevents the\n * removal of the textContent when the placeholder attribute is removed.\n * Therefore the exception does not occur. However, there is an extra\n * unnecessary binding.\n *\n * @param {!Node} node Check node for placeholder bug\n * @return {void}\n */\nfunction fixPlaceholder(node) {\n if (hasPlaceholderBug() && node.localName === 'textarea' && node.placeholder\n && node.placeholder === node.textContent) {\n node.textContent = null;\n }\n}\n\n/**\n * Copies an attribute from one element to another, converting the value to a\n * `TrustedScript` if it is named like a Polymer template event listener.\n *\n * @param {!Element} dest The element to set the attribute on\n * @param {!Element} src The element to read the attribute from\n * @param {string} name The name of the attribute\n */\nconst copyAttributeWithTemplateEventPolicy = (() => {\n /**\n * This `TrustedTypePolicy` is used to work around a Chrome bug in the Trusted\n * Types API where any attribute that starts with `on` may only be set to a\n * `TrustedScript` value, even if that attribute would not cause an event\n * listener to be created. (See https://crbug.com/993268 for details.)\n *\n * Polymer's template system allows `<dom-if>` and `<dom-repeat>` to be\n * written using the `<template is=\"...\">` syntax, even if there is no UA\n * support for custom element extensions of built-in elements. In doing so, it\n * copies attributes from the original `<template>` to a newly created\n * `<dom-if>` or `<dom-repeat>`, which can trigger the bug mentioned above if\n * any of those attributes uses Polymer's `on-` syntax for event listeners.\n * (Note, the value of these `on-` listeners is not evaluated as script: it is\n * the name of a member function of a component that will be used as the event\n * listener.)\n *\n * @type {!TrustedTypePolicy|undefined}\n */\n const polymerTemplateEventAttributePolicy = window.trustedTypes &&\n window.trustedTypes.createPolicy(\n 'polymer-template-event-attribute-policy', {\n createScript: x => x,\n });\n\n return (dest, src, name) => {\n const value = src.getAttribute(name);\n\n if (polymerTemplateEventAttributePolicy && name.startsWith('on-')) {\n dest.setAttribute(\n name, polymerTemplateEventAttributePolicy.createScript(value, name));\n return;\n }\n\n dest.setAttribute(name, value);\n };\n})();\n\nfunction wrapTemplateExtension(node) {\n let is = node.getAttribute('is');\n if (is && templateExtensions[is]) {\n let t = node;\n t.removeAttribute('is');\n node = t.ownerDocument.createElement(is);\n t.parentNode.replaceChild(node, t);\n node.appendChild(t);\n while(t.attributes.length) {\n const {name} = t.attributes[0];\n copyAttributeWithTemplateEventPolicy(node, t, name);\n t.removeAttribute(name);\n }\n }\n return node;\n}\n\nfunction findTemplateNode(root, nodeInfo) {\n // recursively ascend tree until we hit root\n let parent = nodeInfo.parentInfo && findTemplateNode(root, nodeInfo.parentInfo);\n // unwind the stack, returning the indexed node at each level\n if (parent) {\n // note: marginally faster than indexing via childNodes\n // (http://jsperf.com/childnodes-lookup)\n for (let n=parent.firstChild, i=0; n; n=n.nextSibling) {\n if (nodeInfo.parentIndex === i++) {\n return n;\n }\n }\n } else {\n return root;\n }\n}\n\n// construct `$` map (from id annotations)\nfunction applyIdToMap(inst, map, node, nodeInfo) {\n if (nodeInfo.id) {\n map[nodeInfo.id] = node;\n }\n}\n\n// install event listeners (from event annotations)\nfunction applyEventListener(inst, node, nodeInfo) {\n if (nodeInfo.events && nodeInfo.events.length) {\n for (let j=0, e$=nodeInfo.events, e; (j<e$.length) && (e=e$[j]); j++) {\n inst._addMethodEventListenerToNode(node, e.name, e.value, inst);\n }\n }\n}\n\n// push configuration references at configure time\nfunction applyTemplateInfo(inst, node, nodeInfo, parentTemplateInfo) {\n if (nodeInfo.templateInfo) {\n // Give the node an instance of this templateInfo and set its parent\n node._templateInfo = nodeInfo.templateInfo;\n node._parentTemplateInfo = parentTemplateInfo;\n }\n}\n\nfunction createNodeEventHandler(context, eventName, methodName) {\n // Instances can optionally have a _methodHost which allows redirecting where\n // to find methods. Currently used by `templatize`.\n context = context._methodHost || context;\n let handler = function(e) {\n if (context[methodName]) {\n context[methodName](e, e.detail);\n } else {\n console.warn('listener method `' + methodName + '` not defined');\n }\n };\n return handler;\n}\n\n/**\n * Element mixin that provides basic template parsing and stamping, including\n * the following template-related features for stamped templates:\n *\n * - Declarative event listeners (`on-eventname=\"listener\"`)\n * - Map of node id's to stamped node instances (`this.$.id`)\n * - Nested template content caching/removal and re-installation (performance\n * optimization)\n *\n * @mixinFunction\n * @polymer\n * @summary Element class mixin that provides basic template parsing and stamping\n */\nexport const TemplateStamp = dedupingMixin(\n /**\n * @template T\n * @param {function(new:T)} superClass Class to apply mixin to.\n * @return {function(new:T)} superClass with mixin applied.\n */\n (superClass) => {\n\n /**\n * @polymer\n * @mixinClass\n * @implements {Polymer_TemplateStamp}\n */\n class TemplateStamp extends superClass {\n\n /**\n * Scans a template to produce template metadata.\n *\n * Template-specific metadata are stored in the object returned, and node-\n * specific metadata are stored in objects in its flattened `nodeInfoList`\n * array. Only nodes in the template that were parsed as nodes of\n * interest contain an object in `nodeInfoList`. Each `nodeInfo` object\n * contains an `index` (`childNodes` index in parent) and optionally\n * `parent`, which points to node info of its parent (including its index).\n *\n * The template metadata object returned from this method has the following\n * structure (many fields optional):\n *\n * ```js\n * {\n * // Flattened list of node metadata (for nodes that generated metadata)\n * nodeInfoList: [\n * {\n * // `id` attribute for any nodes with id's for generating `$` map\n * id: {string},\n * // `on-event=\"handler\"` metadata\n * events: [\n * {\n * name: {string}, // event name\n * value: {string}, // handler method name\n * }, ...\n * ],\n * // Notes when the template contained a `<slot>` for shady DOM\n * // optimization purposes\n * hasInsertionPoint: {boolean},\n * // For nested `<template>`` nodes, nested template metadata\n * templateInfo: {object}, // nested template metadata\n * // Metadata to allow efficient retrieval of instanced node\n * // corresponding to this metadata\n * parentInfo: {number}, // reference to parent nodeInfo>\n * parentIndex: {number}, // index in parent's `childNodes` collection\n * infoIndex: {number}, // index of this `nodeInfo` in `templateInfo.nodeInfoList`\n * },\n * ...\n * ],\n * // When true, the template had the `strip-whitespace` attribute\n * // or was nested in a template with that setting\n * stripWhitespace: {boolean},\n * // For nested templates, nested template content is moved into\n * // a document fragment stored here; this is an optimization to\n * // avoid the cost of nested template cloning\n * content: {DocumentFragment}\n * }\n * ```\n *\n * This method kicks off a recursive treewalk as follows:\n *\n * ```\n * _parseTemplate <---------------------+\n * _parseTemplateContent |\n * _parseTemplateNode <------------|--+\n * _parseTemplateNestedTemplate --+ |\n * _parseTemplateChildNodes ---------+\n * _parseTemplateNodeAttributes\n * _parseTemplateNodeAttribute\n *\n * ```\n *\n * These methods may be overridden to add custom metadata about templates\n * to either `templateInfo` or `nodeInfo`.\n *\n * Note that this method may be destructive to the template, in that\n * e.g. event annotations may be removed after being noted in the\n * template metadata.\n *\n * @param {!HTMLTemplateElement} template Template to parse\n * @param {TemplateInfo=} outerTemplateInfo Template metadata from the outer\n * template, for parsing nested templates\n * @return {!TemplateInfo} Parsed template metadata\n * @nocollapse\n */\n static _parseTemplate(template, outerTemplateInfo) {\n // since a template may be re-used, memo-ize metadata\n if (!template._templateInfo) {\n // TODO(rictic): fix typing\n let /** ? */ templateInfo = template._templateInfo = {};\n templateInfo.nodeInfoList = [];\n templateInfo.nestedTemplate = Boolean(outerTemplateInfo);\n templateInfo.stripWhiteSpace =\n (outerTemplateInfo && outerTemplateInfo.stripWhiteSpace) ||\n (template.hasAttribute && template.hasAttribute('strip-whitespace'));\n // TODO(rictic): fix typing\n this._parseTemplateContent(\n template, templateInfo, /** @type {?} */ ({parent: null}));\n }\n return template._templateInfo;\n }\n\n /**\n * See docs for _parseTemplateNode.\n *\n * @param {!HTMLTemplateElement} template .\n * @param {!TemplateInfo} templateInfo .\n * @param {!NodeInfo} nodeInfo .\n * @return {boolean} .\n * @nocollapse\n */\n static _parseTemplateContent(template, templateInfo, nodeInfo) {\n return this._parseTemplateNode(template.content, templateInfo, nodeInfo);\n }\n\n /**\n * Parses template node and adds template and node metadata based on\n * the current node, and its `childNodes` and `attributes`.\n *\n * This method may be overridden to add custom node or template specific\n * metadata based on this node.\n *\n * @param {Node} node Node to parse\n * @param {!TemplateInfo} templateInfo Template metadata for current template\n * @param {!NodeInfo} nodeInfo Node metadata for current template.\n * @return {boolean} `true` if the visited node added node-specific\n * metadata to `nodeInfo`\n * @nocollapse\n */\n static _parseTemplateNode(node, templateInfo, nodeInfo) {\n let noted = false;\n let element = /** @type {!HTMLTemplateElement} */ (node);\n if (element.localName == 'template' && !element.hasAttribute('preserve-content')) {\n noted = this._parseTemplateNestedTemplate(element, templateInfo, nodeInfo) || noted;\n } else if (element.localName === 'slot') {\n // For ShadyDom optimization, indicating there is an insertion point\n templateInfo.hasInsertionPoint = true;\n }\n fixPlaceholder(element);\n if (element.firstChild) {\n this._parseTemplateChildNodes(element, templateInfo, nodeInfo);\n }\n if (element.hasAttributes && element.hasAttributes()) {\n noted = this._parseTemplateNodeAttributes(element, templateInfo, nodeInfo) || noted;\n }\n // Checking `nodeInfo.noted` allows a child node of this node (who gets\n // access to `parentInfo`) to cause the parent to be noted, which\n // otherwise has no return path via `_parseTemplateChildNodes` (used by\n // some optimizations)\n return noted || nodeInfo.noted;\n }\n\n /**\n * Parses template child nodes for the given root node.\n *\n * This method also wraps whitelisted legacy template extensions\n * (`is=\"dom-if\"` and `is=\"dom-repeat\"`) with their equivalent element\n * wrappers, collapses text nodes, and strips whitespace from the template\n * if the `templateInfo.stripWhitespace` setting was provided.\n *\n * @param {Node} root Root node whose `childNodes` will be parsed\n * @param {!TemplateInfo} templateInfo Template metadata for current template\n * @param {!NodeInfo} nodeInfo Node metadata for current template.\n * @return {void}\n */\n static _parseTemplateChildNodes(root, templateInfo, nodeInfo) {\n if (root.localName === 'script' || root.localName === 'style') {\n return;\n }\n for (let node=root.firstChild, parentIndex=0, next; node; node=next) {\n // Wrap templates\n if (node.localName == 'template') {\n node = wrapTemplateExtension(node);\n }\n // collapse adjacent textNodes: fixes an IE issue that can cause\n // text nodes to be inexplicably split =(\n // note that root.normalize() should work but does not so we do this\n // manually.\n next = node.nextSibling;\n if (node.nodeType === Node.TEXT_NODE) {\n let /** Node */ n = next;\n while (n && (n.nodeType === Node.TEXT_NODE)) {\n node.textContent += n.textContent;\n next = n.nextSibling;\n root.removeChild(n);\n n = next;\n }\n // optionally strip whitespace\n if (templateInfo.stripWhiteSpace && !node.textContent.trim()) {\n root.removeChild(node);\n continue;\n }\n }\n let childInfo =\n /** @type {!NodeInfo} */ ({parentIndex, parentInfo: nodeInfo});\n if (this._parseTemplateNode(node, templateInfo, childInfo)) {\n childInfo.infoIndex = templateInfo.nodeInfoList.push(childInfo) - 1;\n }\n // Increment if not removed\n if (node.parentNode) {\n parentIndex++;\n }\n }\n }\n\n /**\n * Parses template content for the given nested `<template>`.\n *\n * Nested template info is stored as `templateInfo` in the current node's\n * `nodeInfo`. `template.content` is removed and stored in `templateInfo`.\n * It will then be the responsibility of the host to set it back to the\n * template and for users stamping nested templates to use the\n * `_contentForTemplate` method to retrieve the content for this template\n * (an optimization to avoid the cost of cloning nested template content).\n *\n * @param {HTMLTemplateElement} node Node to parse (a <template>)\n * @param {TemplateInfo} outerTemplateInfo Template metadata for current template\n * that includes the template `node`\n * @param {!NodeInfo} nodeInfo Node metadata for current template.\n * @return {boolean} `true` if the visited node added node-specific\n * metadata to `nodeInfo`\n * @nocollapse\n */\n static _parseTemplateNestedTemplate(node, outerTemplateInfo, nodeInfo) {\n // TODO(rictic): the type of node should be non-null\n let element = /** @type {!HTMLTemplateElement} */ (node);\n let templateInfo = this._parseTemplate(element, outerTemplateInfo);\n let content = templateInfo.content =\n element.content.ownerDocument.createDocumentFragment();\n content.appendChild(element.content);\n nodeInfo.templateInfo = templateInfo;\n return true;\n }\n\n /**\n * Parses template node attributes and adds node metadata to `nodeInfo`\n * for nodes of interest.\n *\n * @param {Element} node Node to parse\n * @param {!TemplateInfo} templateInfo Template metadata for current\n * template\n * @param {!NodeInfo} nodeInfo Node metadata for current template.\n * @return {boolean} `true` if the visited node added node-specific\n * metadata to `nodeInfo`\n * @nocollapse\n */\n static _parseTemplateNodeAttributes(node, templateInfo, nodeInfo) {\n // Make copy of original attribute list, since the order may change\n // as attributes are added and removed\n let noted = false;\n let attrs = Array.from(node.attributes);\n for (let i=attrs.length-1, a; (a=attrs[i]); i--) {\n noted = this._parseTemplateNodeAttribute(node, templateInfo, nodeInfo, a.name, a.value) || noted;\n }\n return noted;\n }\n\n /**\n * Parses a single template node attribute and adds node metadata to\n * `nodeInfo` for attributes of interest.\n *\n * This implementation adds metadata for `on-event=\"handler\"` attributes\n * and `id` attributes.\n *\n * @param {Element} node Node to parse\n * @param {!TemplateInfo} templateInfo Template metadata for current template\n * @param {!NodeInfo} nodeInfo Node metadata for current template.\n * @param {string} name Attribute name\n * @param {string} value Attribute value\n * @return {boolean} `true` if the visited node added node-specific\n * metadata to `nodeInfo`\n * @nocollapse\n */\n static _parseTemplateNodeAttribute(node, templateInfo, nodeInfo, name, value) {\n // events (on-*)\n if (name.slice(0, 3) === 'on-') {\n node.removeAttribute(name);\n nodeInfo.events = nodeInfo.events || [];\n nodeInfo.events.push({\n name: name.slice(3),\n value\n });\n return true;\n }\n // static id\n else if (name === 'id') {\n nodeInfo.id = value;\n return true;\n }\n return false;\n }\n\n /**\n * Returns the `content` document fragment for a given template.\n *\n * For nested templates, Polymer performs an optimization to cache nested\n * template content to avoid the cost of cloning deeply nested templates.\n * This method retrieves the cached content for a given template.\n *\n * @param {HTMLTemplateElement} template Template to retrieve `content` for\n * @return {DocumentFragment} Content fragment\n * @nocollapse\n */\n static _contentForTemplate(template) {\n let templateInfo = /** @type {HTMLTemplateElementWithInfo} */ (template)._templateInfo;\n return (templateInfo && templateInfo.content) || template.content;\n }\n\n /**\n * Clones the provided template content and returns a document fragment\n * containing the cloned dom.\n *\n * The template is parsed (once and memoized) using this library's\n * template parsing features, and provides the following value-added\n * features:\n * * Adds declarative event listeners for `on-event=\"handler\"` attributes\n * * Generates an \"id map\" for all nodes with id's under `$` on returned\n * document fragment\n * * Passes template info including `content` back to templates as\n * `_templateInfo` (a performance optimization to avoid deep template\n * cloning)\n *\n * Note that the memoized template parsing process is destructive to the\n * template: attributes for bindings and declarative event listeners are\n * removed after being noted in notes, and any nested `<template>.content`\n * is removed and stored in notes as well.\n *\n * @param {!HTMLTemplateElement} template Template to stamp\n * @param {TemplateInfo=} templateInfo Optional template info associated\n * with the template to be stamped; if omitted the template will be\n * automatically parsed.\n * @return {!StampedTemplate} Cloned template content\n * @override\n */\n _stampTemplate(template, templateInfo) {\n // Polyfill support: bootstrap the template if it has not already been\n if (template && !template.content &&\n window.HTMLTemplateElement && HTMLTemplateElement.decorate) {\n HTMLTemplateElement.decorate(template);\n }\n // Accepting the `templateInfo` via an argument allows for creating\n // instances of the `templateInfo` by the caller, useful for adding\n // instance-time information to the prototypical data\n templateInfo = templateInfo || this.constructor._parseTemplate(template);\n let nodeInfo = templateInfo.nodeInfoList;\n let content = templateInfo.content || template.content;\n let dom = /** @type {DocumentFragment} */ (document.importNode(content, true));\n // NOTE: ShadyDom optimization indicating there is an insertion point\n dom.__noInsertionPoint = !templateInfo.hasInsertionPoint;\n let nodes = dom.nodeList = new Array(nodeInfo.length);\n dom.$ = {};\n for (let i=0, l=nodeInfo.length, info; (i<l) && (info=nodeInfo[i]); i++) {\n let node = nodes[i] = findTemplateNode(dom, info);\n applyIdToMap(this, dom.$, node, info);\n applyTemplateInfo(this, node, info, templateInfo);\n applyEventListener(this, node, info);\n }\n dom = /** @type {!StampedTemplate} */(dom); // eslint-disable-line no-self-assign\n return dom;\n }\n\n /**\n * Adds an event listener by method name for the event provided.\n *\n * This method generates a handler function that looks up the method\n * name at handling time.\n *\n * @param {!EventTarget} node Node to add listener on\n * @param {string} eventName Name of event\n * @param {string} methodName Name of method\n * @param {*=} context Context the method will be called on (defaults\n * to `node`)\n * @return {Function} Generated handler function\n * @override\n */\n _addMethodEventListenerToNode(node, eventName, methodName, context) {\n context = context || node;\n let handler = createNodeEventHandler(context, eventName, methodName);\n this._addEventListenerToNode(node, eventName, handler);\n return handler;\n }\n\n /**\n * Override point for adding custom or simulated event handling.\n *\n * @param {!EventTarget} node Node to add event listener to\n * @param {string} eventName Name of event\n * @param {function(!Event):void} handler Listener function to add\n * @return {void}\n * @override\n */\n _addEventListenerToNode(node, eventName, handler) {\n node.addEventListener(eventName, handler);\n }\n\n /**\n * Override point for adding custom or simulated event handling.\n *\n * @param {!EventTarget} node Node to remove event listener from\n * @param {string} eventName Name of event\n * @param {function(!Event):void} handler Listener function to remove\n * @return {void}\n * @override\n */\n _removeEventListenerFromNode(node, eventName, handler) {\n node.removeEventListener(eventName, handler);\n }\n\n }\n\n return TemplateStamp;\n\n});\n","/**\n * @fileoverview\n * @suppress {checkPrototypalTypes}\n * @license Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt The complete set of authors may be found\n * at http://polymer.github.io/AUTHORS.txt The complete set of contributors may\n * be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by\n * Google as part of the polymer project is also subject to an additional IP\n * rights grant found at http://polymer.github.io/PATENTS.txt\n */\n\nimport '../utils/boot.js';\nimport { wrap } from '../utils/wrap.js';\nimport { dedupingMixin } from '../utils/mixin.js';\nimport { root, isAncestor, isDescendant, get, translate, isPath, set, normalize } from '../utils/path.js';\n/* for notify, reflect */\nimport { camelToDashCase, dashToCamelCase } from '../utils/case-map.js';\nimport { PropertyAccessors } from './property-accessors.js';\n/* for annotated effects */\nimport { TemplateStamp } from './template-stamp.js';\nimport { sanitizeDOMValue, legacyUndefined, orderedComputed, removeNestedTemplates, fastDomIf } from '../utils/settings.js';\n\n// Monotonically increasing unique ID used for de-duping effects triggered\n// from multiple properties in the same turn\nlet dedupeId = 0;\n\nconst NOOP = [];\n\n/**\n * Property effect types; effects are stored on the prototype using these keys\n * @enum {string}\n */\nconst TYPES = {\n COMPUTE: '__computeEffects',\n REFLECT: '__reflectEffects',\n NOTIFY: '__notifyEffects',\n PROPAGATE: '__propagateEffects',\n OBSERVE: '__observeEffects',\n READ_ONLY: '__readOnly'\n};\n\nconst COMPUTE_INFO = '__computeInfo';\n\n/** @const {!RegExp} */\nconst capitalAttributeRegex = /[A-Z]/;\n\n/**\n * @typedef {{\n * name: (string | undefined),\n * structured: (boolean | undefined),\n * wildcard: (boolean | undefined)\n * }}\n */\nlet DataTrigger; //eslint-disable-line no-unused-vars\n\n/**\n * @typedef {{\n * info: ?,\n * trigger: (!DataTrigger | undefined),\n * fn: (!Function | undefined)\n * }}\n */\nlet DataEffect; //eslint-disable-line no-unused-vars\n\n/**\n * Ensures that the model has an own-property map of effects for the given type.\n * The model may be a prototype or an instance.\n *\n * Property effects are stored as arrays of effects by property in a map,\n * by named type on the model. e.g.\n *\n * __computeEffects: {\n * foo: [ ... ],\n * bar: [ ... ]\n * }\n *\n * If the model does not yet have an effect map for the type, one is created\n * and returned. If it does, but it is not an own property (i.e. the\n * prototype had effects), the the map is deeply cloned and the copy is\n * set on the model and returned, ready for new effects to be added.\n *\n * @param {Object} model Prototype or instance\n * @param {string} type Property effect type\n * @param {boolean=} cloneArrays Clone any arrays assigned to the map when\n * extending a superclass map onto this subclass\n * @return {Object} The own-property map of effects for the given type\n * @private\n */\nfunction ensureOwnEffectMap(model, type, cloneArrays) {\n let effects = model[type];\n if (!effects) {\n effects = model[type] = {};\n } else if (!model.hasOwnProperty(type)) {\n effects = model[type] = Object.create(model[type]);\n if (cloneArrays) {\n for (let p in effects) {\n let protoFx = effects[p];\n // Perf optimization over Array.slice\n let instFx = effects[p] = Array(protoFx.length);\n for (let i=0; i<protoFx.length; i++) {\n instFx[i] = protoFx[i];\n }\n }\n }\n }\n return effects;\n}\n\n// -- effects ----------------------------------------------\n\n/**\n * Runs all effects of a given type for the given set of property changes\n * on an instance.\n *\n * @param {!Polymer_PropertyEffects} inst The instance with effects to run\n * @param {?Object} effects Object map of property-to-Array of effects\n * @param {?Object} props Bag of current property changes\n * @param {?Object=} oldProps Bag of previous values for changed properties\n * @param {boolean=} hasPaths True with `props` contains one or more paths\n * @param {*=} extraArgs Additional metadata to pass to effect function\n * @return {boolean} True if an effect ran for this property\n * @private\n */\nfunction runEffects(inst, effects, props, oldProps, hasPaths, extraArgs) {\n if (effects) {\n let ran = false;\n const id = dedupeId++;\n for (let prop in props) {\n // Inline `runEffectsForProperty` for perf.\n let rootProperty = hasPaths ? root(prop) : prop;\n let fxs = effects[rootProperty];\n if (fxs) {\n for (let i=0, l=fxs.length, fx; (i<l) && (fx=fxs[i]); i++) {\n if ((!fx.info || fx.info.lastRun !== id) &&\n (!hasPaths || pathMatchesTrigger(prop, fx.trigger))) {\n if (fx.info) {\n fx.info.lastRun = id;\n }\n fx.fn(inst, prop, props, oldProps, fx.info, hasPaths, extraArgs);\n ran = true;\n }\n }\n }\n }\n return ran;\n }\n return false;\n}\n\n/**\n * Runs a list of effects for a given property.\n *\n * @param {!Polymer_PropertyEffects} inst The instance with effects to run\n * @param {!Object} effects Object map of property-to-Array of effects\n * @param {number} dedupeId Counter used for de-duping effects\n * @param {string} prop Name of changed property\n * @param {*} props Changed properties\n * @param {*} oldProps Old properties\n * @param {boolean=} hasPaths True with `props` contains one or more paths\n * @param {*=} extraArgs Additional metadata to pass to effect function\n * @return {boolean} True if an effect ran for this property\n * @private\n */\nfunction runEffectsForProperty(inst, effects, dedupeId, prop, props, oldProps, hasPaths, extraArgs) {\n let ran = false;\n let rootProperty = hasPaths ? root(prop) : prop;\n let fxs = effects[rootProperty];\n if (fxs) {\n for (let i=0, l=fxs.length, fx; (i<l) && (fx=fxs[i]); i++) {\n if ((!fx.info || fx.info.lastRun !== dedupeId) &&\n (!hasPaths || pathMatchesTrigger(prop, fx.trigger))) {\n if (fx.info) {\n fx.info.lastRun = dedupeId;\n }\n fx.fn(inst, prop, props, oldProps, fx.info, hasPaths, extraArgs);\n ran = true;\n }\n }\n }\n return ran;\n}\n\n/**\n * Determines whether a property/path that has changed matches the trigger\n * criteria for an effect. A trigger is a descriptor with the following\n * structure, which matches the descriptors returned from `parseArg`.\n * e.g. for `foo.bar.*`:\n * ```\n * trigger: {\n * name: 'a.b',\n * structured: true,\n * wildcard: true\n * }\n * ```\n * If no trigger is given, the path is deemed to match.\n *\n * @param {string} path Path or property that changed\n * @param {?DataTrigger} trigger Descriptor\n * @return {boolean} Whether the path matched the trigger\n */\nfunction pathMatchesTrigger(path, trigger) {\n if (trigger) {\n let triggerPath = /** @type {string} */ (trigger.name);\n return (triggerPath == path) ||\n !!(trigger.structured && isAncestor(triggerPath, path)) ||\n !!(trigger.wildcard && isDescendant(triggerPath, path));\n } else {\n return true;\n }\n}\n\n/**\n * Implements the \"observer\" effect.\n *\n * Calls the method with `info.methodName` on the instance, passing the\n * new and old values.\n *\n * @param {!Polymer_PropertyEffects} inst The instance the effect will be run on\n * @param {string} property Name of property\n * @param {Object} props Bag of current property changes\n * @param {Object} oldProps Bag of previous values for changed properties\n * @param {?} info Effect metadata\n * @return {void}\n * @private\n */\nfunction runObserverEffect(inst, property, props, oldProps, info) {\n let fn = typeof info.method === \"string\" ? inst[info.method] : info.method;\n let changedProp = info.property;\n if (fn) {\n fn.call(inst, inst.__data[changedProp], oldProps[changedProp]);\n } else if (!info.dynamicFn) {\n console.warn('observer method `' + info.method + '` not defined');\n }\n}\n\n/**\n * Runs \"notify\" effects for a set of changed properties.\n *\n * This method differs from the generic `runEffects` method in that it\n * will dispatch path notification events in the case that the property\n * changed was a path and the root property for that path didn't have a\n * \"notify\" effect. This is to maintain 1.0 behavior that did not require\n * `notify: true` to ensure object sub-property notifications were\n * sent.\n *\n * @param {!Polymer_PropertyEffects} inst The instance with effects to run\n * @param {Object} notifyProps Bag of properties to notify\n * @param {Object} props Bag of current property changes\n * @param {Object} oldProps Bag of previous values for changed properties\n * @param {boolean} hasPaths True with `props` contains one or more paths\n * @return {void}\n * @private\n */\nfunction runNotifyEffects(inst, notifyProps, props, oldProps, hasPaths) {\n // Notify\n let fxs = inst[TYPES.NOTIFY];\n let notified;\n let id = dedupeId++;\n // Try normal notify effects; if none, fall back to try path notification\n for (let prop in notifyProps) {\n if (notifyProps[prop]) {\n if (fxs && runEffectsForProperty(inst, fxs, id, prop, props, oldProps, hasPaths)) {\n notified = true;\n } else if (hasPaths && notifyPath(inst, prop, props)) {\n notified = true;\n }\n }\n }\n // Flush host if we actually notified and host was batching\n // And the host has already initialized clients; this prevents\n // an issue with a host observing data changes before clients are ready.\n let host;\n if (notified && (host = inst.__dataHost) && host._invalidateProperties) {\n host._invalidateProperties();\n }\n}\n\n/**\n * Dispatches {property}-changed events with path information in the detail\n * object to indicate a sub-path of the property was changed.\n *\n * @param {!Polymer_PropertyEffects} inst The element from which to fire the\n * event\n * @param {string} path The path that was changed\n * @param {Object} props Bag of current property changes\n * @return {boolean} Returns true if the path was notified\n * @private\n */\nfunction notifyPath(inst, path, props) {\n let rootProperty = root(path);\n if (rootProperty !== path) {\n let eventName = camelToDashCase(rootProperty) + '-changed';\n dispatchNotifyEvent(inst, eventName, props[path], path);\n return true;\n }\n return false;\n}\n\n/**\n * Dispatches {property}-changed events to indicate a property (or path)\n * changed.\n *\n * @param {!Polymer_PropertyEffects} inst The element from which to fire the\n * event\n * @param {string} eventName The name of the event to send\n * ('{property}-changed')\n * @param {*} value The value of the changed property\n * @param {string | null | undefined} path If a sub-path of this property\n * changed, the path that changed (optional).\n * @return {void}\n * @private\n * @suppress {invalidCasts}\n */\nfunction dispatchNotifyEvent(inst, eventName, value, path) {\n let detail = {\n value: value,\n queueProperty: true\n };\n if (path) {\n detail.path = path;\n }\n // As a performance optimization, we could elide the wrap here since notifying\n // events are non-bubbling and shouldn't need retargeting. However, a very\n // small number of internal tests failed in obscure ways, which may indicate\n // user code relied on timing differences resulting from ShadyDOM flushing\n // as a result of the wrapped `dispatchEvent`.\n wrap(/** @type {!HTMLElement} */(inst)).dispatchEvent(new CustomEvent(eventName, { detail }));\n}\n\n/**\n * Implements the \"notify\" effect.\n *\n * Dispatches a non-bubbling event named `info.eventName` on the instance\n * with a detail object containing the new `value`.\n *\n * @param {!Polymer_PropertyEffects} inst The instance the effect will be run on\n * @param {string} property Name of property\n * @param {Object} props Bag of current property changes\n * @param {Object} oldProps Bag of previous values for changed properties\n * @param {?} info Effect metadata\n * @param {boolean} hasPaths True with `props` contains one or more paths\n * @return {void}\n * @private\n */\nfunction runNotifyEffect(inst, property, props, oldProps, info, hasPaths) {\n let rootProperty = hasPaths ? root(property) : property;\n let path = rootProperty != property ? property : null;\n let value = path ? get(inst, path) : inst.__data[property];\n if (path && value === undefined) {\n value = props[property]; // specifically for .splices\n }\n dispatchNotifyEvent(inst, info.eventName, value, path);\n}\n\n/**\n * Handler function for 2-way notification events. Receives context\n * information captured in the `addNotifyListener` closure from the\n * `__notifyListeners` metadata.\n *\n * Sets the value of the notified property to the host property or path. If\n * the event contained path information, translate that path to the host\n * scope's name for that path first.\n *\n * @param {CustomEvent} event Notification event (e.g. '<property>-changed')\n * @param {!Polymer_PropertyEffects} inst Host element instance handling the\n * notification event\n * @param {string} fromProp Child element property that was bound\n * @param {string} toPath Host property/path that was bound\n * @param {boolean} negate Whether the binding was negated\n * @return {void}\n * @private\n */\nfunction handleNotification(event, inst, fromProp, toPath, negate) {\n let value;\n let detail = /** @type {Object} */(event.detail);\n let fromPath = detail && detail.path;\n if (fromPath) {\n toPath = translate(fromProp, toPath, fromPath);\n value = detail && detail.value;\n } else {\n value = event.currentTarget[fromProp];\n }\n value = negate ? !value : value;\n if (!inst[TYPES.READ_ONLY] || !inst[TYPES.READ_ONLY][toPath]) {\n if (inst._setPendingPropertyOrPath(toPath, value, true, Boolean(fromPath))\n && (!detail || !detail.queueProperty)) {\n inst._invalidateProperties();\n }\n }\n}\n\n/**\n * Implements the \"reflect\" effect.\n *\n * Sets the attribute named `info.attrName` to the given property value.\n *\n * @param {!Polymer_PropertyEffects} inst The instance the effect will be run on\n * @param {string} property Name of property\n * @param {Object} props Bag of current property changes\n * @param {Object} oldProps Bag of previous values for changed properties\n * @param {?} info Effect metadata\n * @return {void}\n * @private\n */\nfunction runReflectEffect(inst, property, props, oldProps, info) {\n let value = inst.__data[property];\n if (sanitizeDOMValue) {\n value = sanitizeDOMValue(value, info.attrName, 'attribute', /** @type {Node} */(inst));\n }\n inst._propertyToAttribute(property, info.attrName, value);\n}\n\n/**\n * Runs \"computed\" effects for a set of changed properties.\n *\n * This method differs from the generic `runEffects` method in that it\n * continues to run computed effects based on the output of each pass until\n * there are no more newly computed properties. This ensures that all\n * properties that will be computed by the initial set of changes are\n * computed before other effects (binding propagation, observers, and notify)\n * run.\n *\n * @param {!Polymer_PropertyEffects} inst The instance the effect will be run on\n * @param {?Object} changedProps Bag of changed properties\n * @param {?Object} oldProps Bag of previous values for changed properties\n * @param {boolean} hasPaths True with `props` contains one or more paths\n * @return {void}\n * @private\n */\nfunction runComputedEffects(inst, changedProps, oldProps, hasPaths) {\n let computeEffects = inst[TYPES.COMPUTE];\n if (computeEffects) {\n if (orderedComputed) {\n // Runs computed effects in efficient order by keeping a topologically-\n // sorted queue of compute effects to run, and inserting subsequently\n // invalidated effects as they are run\n dedupeId++;\n const order = getComputedOrder(inst);\n const queue = [];\n for (let p in changedProps) {\n enqueueEffectsFor(p, computeEffects, queue, order, hasPaths);\n }\n let info;\n while ((info = queue.shift())) {\n if (runComputedEffect(inst, '', changedProps, oldProps, info)) {\n enqueueEffectsFor(info.methodInfo, computeEffects, queue, order, hasPaths);\n }\n }\n Object.assign(/** @type {!Object} */ (oldProps), inst.__dataOld);\n Object.assign(/** @type {!Object} */ (changedProps), inst.__dataPending);\n inst.__dataPending = null;\n } else {\n // Original Polymer 2.x computed effects order, which continues running\n // effects until no further computed properties have been invalidated\n let inputProps = changedProps;\n while (runEffects(inst, computeEffects, inputProps, oldProps, hasPaths)) {\n Object.assign(/** @type {!Object} */ (oldProps), inst.__dataOld);\n Object.assign(/** @type {!Object} */ (changedProps), inst.__dataPending);\n inputProps = inst.__dataPending;\n inst.__dataPending = null;\n }\n }\n }\n}\n\n/**\n * Inserts a computed effect into a queue, given the specified order. Performs\n * the insert using a binary search.\n *\n * Used by `orderedComputed: true` computed property algorithm.\n *\n * @param {Object} info Property effects metadata\n * @param {Array<Object>} queue Ordered queue of effects\n * @param {Map<string,number>} order Map of computed property name->topological\n * sort order\n */\nconst insertEffect = (info, queue, order) => {\n let start = 0;\n let end = queue.length - 1;\n let idx = -1;\n while (start <= end) {\n const mid = (start + end) >> 1;\n // Note `methodInfo` is where the computed property name is stored in\n // the effect metadata\n const cmp = order.get(queue[mid].methodInfo) - order.get(info.methodInfo);\n if (cmp < 0) {\n start = mid + 1;\n } else if (cmp > 0) {\n end = mid - 1;\n } else {\n idx = mid;\n break;\n }\n }\n if (idx < 0) {\n idx = end + 1;\n }\n queue.splice(idx, 0, info);\n};\n\n/**\n * Inserts all downstream computed effects invalidated by the specified property\n * into the topologically-sorted queue of effects to be run.\n *\n * Used by `orderedComputed: true` computed property algorithm.\n *\n * @param {string} prop Property name\n * @param {Object} computeEffects Computed effects for this element\n * @param {Array<Object>} queue Topologically-sorted queue of computed effects\n * to be run\n * @param {Map<string,number>} order Map of computed property name->topological\n * sort order\n * @param {boolean} hasPaths True with `changedProps` contains one or more paths\n */\nconst enqueueEffectsFor = (prop, computeEffects, queue, order, hasPaths) => {\n const rootProperty = hasPaths ? root(prop) : prop;\n const fxs = computeEffects[rootProperty];\n if (fxs) {\n for (let i=0; i<fxs.length; i++) {\n const fx = fxs[i];\n if ((fx.info.lastRun !== dedupeId) &&\n (!hasPaths || pathMatchesTrigger(prop, fx.trigger))) {\n fx.info.lastRun = dedupeId;\n insertEffect(fx.info, queue, order);\n }\n }\n }\n};\n\n/**\n * Generates and retrieves a memoized map of computed property name to its\n * topologically-sorted order.\n *\n * The map is generated by first assigning a \"dependency count\" to each property\n * (defined as number properties it depends on, including its method for\n * \"dynamic functions\"). Any properties that have no dependencies are added to\n * the `ready` queue, which are properties whose order can be added to the final\n * order map. Properties are popped off the `ready` queue one by one and a.) added as\n * the next property in the order map, and b.) each property that it is a\n * dependency for has its dep count decremented (and if that property's dep\n * count goes to zero, it is added to the `ready` queue), until all properties\n * have been visited and ordered.\n *\n * Used by `orderedComputed: true` computed property algorithm.\n *\n * @param {!Polymer_PropertyEffects} inst The instance to retrieve the computed\n * effect order for.\n * @return {Map<string,number>} Map of computed property name->topological sort\n * order\n */\nfunction getComputedOrder(inst) {\n let ordered = inst.constructor.__orderedComputedDeps;\n if (!ordered) {\n ordered = new Map();\n const effects = inst[TYPES.COMPUTE];\n let {counts, ready, total} = dependencyCounts(inst);\n let curr;\n while ((curr = ready.shift())) {\n ordered.set(curr, ordered.size);\n const computedByCurr = effects[curr];\n if (computedByCurr) {\n computedByCurr.forEach(fx => {\n // Note `methodInfo` is where the computed property name is stored\n const computedProp = fx.info.methodInfo;\n --total;\n if (--counts[computedProp] === 0) {\n ready.push(computedProp);\n }\n });\n }\n }\n if (total !== 0) {\n const el = /** @type {HTMLElement} */ (inst);\n console.warn(`Computed graph for ${el.localName} incomplete; circular?`);\n }\n inst.constructor.__orderedComputedDeps = ordered;\n }\n return ordered;\n}\n\n/**\n * Generates a map of property-to-dependency count (`counts`, where \"dependency\n * count\" is the number of dependencies a given property has assuming it is a\n * computed property, otherwise 0). It also returns a pre-populated list of\n * `ready` properties that have no dependencies and a `total` count, which is\n * used for error-checking the graph.\n *\n * Used by `orderedComputed: true` computed property algorithm.\n *\n * @param {!Polymer_PropertyEffects} inst The instance to generate dependency\n * counts for.\n * @return {!Object} Object containing `counts` map (property-to-dependency\n * count) and pre-populated `ready` array of properties that had zero\n * dependencies.\n */\nfunction dependencyCounts(inst) {\n const infoForComputed = inst[COMPUTE_INFO];\n const counts = {};\n const computedDeps = inst[TYPES.COMPUTE];\n const ready = [];\n let total = 0;\n // Count dependencies for each computed property\n for (let p in infoForComputed) {\n const info = infoForComputed[p];\n // Be sure to add the method name itself in case of \"dynamic functions\"\n total += counts[p] =\n info.args.filter(a => !a.literal).length + (info.dynamicFn ? 1 : 0);\n }\n // Build list of ready properties (that aren't themselves computed)\n for (let p in computedDeps) {\n if (!infoForComputed[p]) {\n ready.push(p);\n }\n }\n return {counts, ready, total};\n}\n\n/**\n * Implements the \"computed property\" effect by running the method with the\n * values of the arguments specified in the `info` object and setting the\n * return value to the computed property specified.\n *\n * @param {!Polymer_PropertyEffects} inst The instance the effect will be run on\n * @param {string} property Name of property\n * @param {?Object} changedProps Bag of current property changes\n * @param {?Object} oldProps Bag of previous values for changed properties\n * @param {?} info Effect metadata\n * @return {boolean} True when the property being computed changed\n * @private\n */\nfunction runComputedEffect(inst, property, changedProps, oldProps, info) {\n // Dirty check dependencies and run if any invalid\n let result = runMethodEffect(inst, property, changedProps, oldProps, info);\n // Abort if method returns a no-op result\n if (result === NOOP) {\n return false;\n }\n let computedProp = info.methodInfo;\n if (inst.__dataHasAccessor && inst.__dataHasAccessor[computedProp]) {\n return inst._setPendingProperty(computedProp, result, true);\n } else {\n inst[computedProp] = result;\n return false;\n }\n}\n\n/**\n * Computes path changes based on path links set up using the `linkPaths`\n * API.\n *\n * @param {!Polymer_PropertyEffects} inst The instance whose props are changing\n * @param {string} path Path that has changed\n * @param {*} value Value of changed path\n * @return {void}\n * @private\n */\nfunction computeLinkedPaths(inst, path, value) {\n let links = inst.__dataLinkedPaths;\n if (links) {\n let link;\n for (let a in links) {\n let b = links[a];\n if (isDescendant(a, path)) {\n link = translate(a, b, path);\n inst._setPendingPropertyOrPath(link, value, true, true);\n } else if (isDescendant(b, path)) {\n link = translate(b, a, path);\n inst._setPendingPropertyOrPath(link, value, true, true);\n }\n }\n }\n}\n\n// -- bindings ----------------------------------------------\n\n/**\n * Adds binding metadata to the current `nodeInfo`, and binding effects\n * for all part dependencies to `templateInfo`.\n *\n * @param {Function} constructor Class that `_parseTemplate` is currently\n * running on\n * @param {TemplateInfo} templateInfo Template metadata for current template\n * @param {NodeInfo} nodeInfo Node metadata for current template node\n * @param {string} kind Binding kind, either 'property', 'attribute', or 'text'\n * @param {string} target Target property name\n * @param {!Array<!BindingPart>} parts Array of binding part metadata\n * @param {string=} literal Literal text surrounding binding parts (specified\n * only for 'property' bindings, since these must be initialized as part\n * of boot-up)\n * @return {void}\n * @private\n */\nfunction addBinding(constructor, templateInfo, nodeInfo, kind, target, parts, literal) {\n // Create binding metadata and add to nodeInfo\n nodeInfo.bindings = nodeInfo.bindings || [];\n let /** Binding */ binding = { kind, target, parts, literal, isCompound: (parts.length !== 1) };\n nodeInfo.bindings.push(binding);\n // Add listener info to binding metadata\n if (shouldAddListener(binding)) {\n let {event, negate} = binding.parts[0];\n binding.listenerEvent = event || (camelToDashCase(target) + '-changed');\n binding.listenerNegate = negate;\n }\n // Add \"propagate\" property effects to templateInfo\n let index = templateInfo.nodeInfoList.length;\n for (let i=0; i<binding.parts.length; i++) {\n let part = binding.parts[i];\n part.compoundIndex = i;\n addEffectForBindingPart(constructor, templateInfo, binding, part, index);\n }\n}\n\n/**\n * Adds property effects to the given `templateInfo` for the given binding\n * part.\n *\n * @param {Function} constructor Class that `_parseTemplate` is currently\n * running on\n * @param {TemplateInfo} templateInfo Template metadata for current template\n * @param {!Binding} binding Binding metadata\n * @param {!BindingPart} part Binding part metadata\n * @param {number} index Index into `nodeInfoList` for this node\n * @return {void}\n */\nfunction addEffectForBindingPart(constructor, templateInfo, binding, part, index) {\n if (!part.literal) {\n if (binding.kind === 'attribute' && binding.target[0] === '-') {\n console.warn('Cannot set attribute ' + binding.target +\n ' because \"-\" is not a valid attribute starting character');\n } else {\n let dependencies = part.dependencies;\n let info = { index, binding, part, evaluator: constructor };\n for (let j=0; j<dependencies.length; j++) {\n let trigger = dependencies[j];\n if (typeof trigger == 'string') {\n trigger = parseArg(trigger);\n trigger.wildcard = true;\n }\n constructor._addTemplatePropertyEffect(templateInfo, trigger.rootProperty, {\n fn: runBindingEffect,\n info, trigger\n });\n }\n }\n }\n}\n\n/**\n * Implements the \"binding\" (property/path binding) effect.\n *\n * Note that binding syntax is overridable via `_parseBindings` and\n * `_evaluateBinding`. This method will call `_evaluateBinding` for any\n * non-literal parts returned from `_parseBindings`. However,\n * there is no support for _path_ bindings via custom binding parts,\n * as this is specific to Polymer's path binding syntax.\n *\n * @param {!Polymer_PropertyEffects} inst The instance the effect will be run on\n * @param {string} path Name of property\n * @param {Object} props Bag of current property changes\n * @param {Object} oldProps Bag of previous values for changed properties\n * @param {?} info Effect metadata\n * @param {boolean} hasPaths True with `props` contains one or more paths\n * @param {Array} nodeList List of nodes associated with `nodeInfoList` template\n * metadata\n * @return {void}\n * @private\n */\nfunction runBindingEffect(inst, path, props, oldProps, info, hasPaths, nodeList) {\n let node = nodeList[info.index];\n let binding = info.binding;\n let part = info.part;\n // Subpath notification: transform path and set to client\n // e.g.: foo=\"{{obj.sub}}\", path: 'obj.sub.prop', set 'foo.prop'=obj.sub.prop\n if (hasPaths && part.source && (path.length > part.source.length) &&\n (binding.kind == 'property') && !binding.isCompound &&\n node.__isPropertyEffectsClient &&\n node.__dataHasAccessor && node.__dataHasAccessor[binding.target]) {\n let value = props[path];\n path = translate(part.source, binding.target, path);\n if (node._setPendingPropertyOrPath(path, value, false, true)) {\n inst._enqueueClient(node);\n }\n } else {\n let value = info.evaluator._evaluateBinding(inst, part, path, props, oldProps, hasPaths);\n // Propagate value to child\n // Abort if value is a no-op result\n if (value !== NOOP) {\n applyBindingValue(inst, node, binding, part, value);\n }\n }\n}\n\n/**\n * Sets the value for an \"binding\" (binding) effect to a node,\n * either as a property or attribute.\n *\n * @param {!Polymer_PropertyEffects} inst The instance owning the binding effect\n * @param {Node} node Target node for binding\n * @param {!Binding} binding Binding metadata\n * @param {!BindingPart} part Binding part metadata\n * @param {*} value Value to set\n * @return {void}\n * @private\n */\nfunction applyBindingValue(inst, node, binding, part, value) {\n value = computeBindingValue(node, value, binding, part);\n if (sanitizeDOMValue) {\n value = sanitizeDOMValue(value, binding.target, binding.kind, node);\n }\n if (binding.kind == 'attribute') {\n // Attribute binding\n inst._valueToNodeAttribute(/** @type {Element} */(node), value, binding.target);\n } else {\n // Property binding\n let prop = binding.target;\n if (node.__isPropertyEffectsClient &&\n node.__dataHasAccessor && node.__dataHasAccessor[prop]) {\n if (!node[TYPES.READ_ONLY] || !node[TYPES.READ_ONLY][prop]) {\n if (node._setPendingProperty(prop, value)) {\n inst._enqueueClient(node);\n }\n }\n } else {\n // In legacy no-batching mode, bindings applied before dataReady are\n // equivalent to the \"apply config\" phase, which only set managed props\n inst._setUnmanagedPropertyToNode(node, prop, value);\n }\n }\n}\n\n/**\n * Transforms an \"binding\" effect value based on compound & negation\n * effect metadata, as well as handling for special-case properties\n *\n * @param {Node} node Node the value will be set to\n * @param {*} value Value to set\n * @param {!Binding} binding Binding metadata\n * @param {!BindingPart} part Binding part metadata\n * @return {*} Transformed value to set\n * @private\n */\nfunction computeBindingValue(node, value, binding, part) {\n if (binding.isCompound) {\n let storage = node.__dataCompoundStorage[binding.target];\n storage[part.compoundIndex] = value;\n value = storage.join('');\n }\n if (binding.kind !== 'attribute') {\n // Some browsers serialize `undefined` to `\"undefined\"`\n if (binding.target === 'textContent' ||\n (binding.target === 'value' &&\n (node.localName === 'input' || node.localName === 'textarea'))) {\n value = value == undefined ? '' : value;\n }\n }\n return value;\n}\n\n/**\n * Returns true if a binding's metadata meets all the requirements to allow\n * 2-way binding, and therefore a `<property>-changed` event listener should be\n * added:\n * - used curly braces\n * - is a property (not attribute) binding\n * - is not a textContent binding\n * - is not compound\n *\n * @param {!Binding} binding Binding metadata\n * @return {boolean} True if 2-way listener should be added\n * @private\n */\nfunction shouldAddListener(binding) {\n return Boolean(binding.target) &&\n binding.kind != 'attribute' &&\n binding.kind != 'text' &&\n !binding.isCompound &&\n binding.parts[0].mode === '{';\n}\n\n/**\n * Setup compound binding storage structures, notify listeners, and dataHost\n * references onto the bound nodeList.\n *\n * @param {!Polymer_PropertyEffects} inst Instance that bas been previously\n * bound\n * @param {TemplateInfo} templateInfo Template metadata\n * @return {void}\n * @private\n */\nfunction setupBindings(inst, templateInfo) {\n // Setup compound storage, dataHost, and notify listeners\n let {nodeList, nodeInfoList} = templateInfo;\n if (nodeInfoList.length) {\n for (let i=0; i < nodeInfoList.length; i++) {\n let info = nodeInfoList[i];\n let node = nodeList[i];\n let bindings = info.bindings;\n if (bindings) {\n for (let i=0; i<bindings.length; i++) {\n let binding = bindings[i];\n setupCompoundStorage(node, binding);\n addNotifyListener(node, inst, binding);\n }\n }\n // This ensures all bound elements have a host set, regardless\n // of whether they upgrade synchronous to creation\n node.__dataHost = inst;\n }\n }\n}\n\n/**\n * Initializes `__dataCompoundStorage` local storage on a bound node with\n * initial literal data for compound bindings, and sets the joined\n * literal parts to the bound property.\n *\n * When changes to compound parts occur, they are first set into the compound\n * storage array for that property, and then the array is joined to result in\n * the final value set to the property/attribute.\n *\n * @param {Node} node Bound node to initialize\n * @param {Binding} binding Binding metadata\n * @return {void}\n * @private\n */\nfunction setupCompoundStorage(node, binding) {\n if (binding.isCompound) {\n // Create compound storage map\n let storage = node.__dataCompoundStorage ||\n (node.__dataCompoundStorage = {});\n let parts = binding.parts;\n // Copy literals from parts into storage for this binding\n let literals = new Array(parts.length);\n for (let j=0; j<parts.length; j++) {\n literals[j] = parts[j].literal;\n }\n let target = binding.target;\n storage[target] = literals;\n // Configure properties with their literal parts\n if (binding.literal && binding.kind == 'property') {\n // Note, className needs style scoping so this needs wrapping.\n // We may also want to consider doing this for `textContent` and\n // `innerHTML`.\n if (target === 'className') {\n node = wrap(node);\n }\n node[target] = binding.literal;\n }\n }\n}\n\n/**\n * Adds a 2-way binding notification event listener to the node specified\n *\n * @param {Object} node Child element to add listener to\n * @param {!Polymer_PropertyEffects} inst Host element instance to handle\n * notification event\n * @param {Binding} binding Binding metadata\n * @return {void}\n * @private\n */\nfunction addNotifyListener(node, inst, binding) {\n if (binding.listenerEvent) {\n let part = binding.parts[0];\n node.addEventListener(binding.listenerEvent, function(e) {\n handleNotification(e, inst, binding.target, part.source, part.negate);\n });\n }\n}\n\n// -- for method-based effects (complexObserver & computed) --------------\n\n/**\n * Adds property effects for each argument in the method signature (and\n * optionally, for the method name if `dynamic` is true) that calls the\n * provided effect function.\n *\n * @param {Element | Object} model Prototype or instance\n * @param {!MethodSignature} sig Method signature metadata\n * @param {string} type Type of property effect to add\n * @param {Function} effectFn Function to run when arguments change\n * @param {*=} methodInfo Effect-specific information to be included in\n * method effect metadata\n * @param {boolean|Object=} dynamicFn Boolean or object map indicating whether\n * method names should be included as a dependency to the effect. Note,\n * defaults to true if the signature is static (sig.static is true).\n * @return {!Object} Effect metadata for this method effect\n * @private\n */\nfunction createMethodEffect(model, sig, type, effectFn, methodInfo, dynamicFn) {\n dynamicFn = sig.static || (dynamicFn &&\n (typeof dynamicFn !== 'object' || dynamicFn[sig.methodName]));\n let info = {\n methodName: sig.methodName,\n args: sig.args,\n methodInfo,\n dynamicFn\n };\n for (let i=0, arg; (i<sig.args.length) && (arg=sig.args[i]); i++) {\n if (!arg.literal) {\n model._addPropertyEffect(arg.rootProperty, type, {\n fn: effectFn, info: info, trigger: arg\n });\n }\n }\n if (dynamicFn) {\n model._addPropertyEffect(sig.methodName, type, {\n fn: effectFn, info: info\n });\n }\n return info;\n}\n\n/**\n * Calls a method with arguments marshaled from properties on the instance\n * based on the method signature contained in the effect metadata.\n *\n * Multi-property observers, computed properties, and inline computing\n * functions call this function to invoke the method, then use the return\n * value accordingly.\n *\n * @param {!Polymer_PropertyEffects} inst The instance the effect will be run on\n * @param {string} property Name of property\n * @param {Object} props Bag of current property changes\n * @param {Object} oldProps Bag of previous values for changed properties\n * @param {?} info Effect metadata\n * @return {*} Returns the return value from the method invocation\n * @private\n */\nfunction runMethodEffect(inst, property, props, oldProps, info) {\n // Instances can optionally have a _methodHost which allows redirecting where\n // to find methods. Currently used by `templatize`.\n let context = inst._methodHost || inst;\n let fn = context[info.methodName];\n if (fn) {\n let args = inst._marshalArgs(info.args, property, props);\n return args === NOOP ? NOOP : fn.apply(context, args);\n } else if (!info.dynamicFn) {\n console.warn('method `' + info.methodName + '` not defined');\n }\n}\n\nconst emptyArray = [];\n\n// Regular expressions used for binding\nconst IDENT = '(?:' + '[a-zA-Z_$][\\\\w.:$\\\\-*]*' + ')';\nconst NUMBER = '(?:' + '[-+]?[0-9]*\\\\.?[0-9]+(?:[eE][-+]?[0-9]+)?' + ')';\nconst SQUOTE_STRING = '(?:' + '\\'(?:[^\\'\\\\\\\\]|\\\\\\\\.)*\\'' + ')';\nconst DQUOTE_STRING = '(?:' + '\"(?:[^\"\\\\\\\\]|\\\\\\\\.)*\"' + ')';\nconst STRING = '(?:' + SQUOTE_STRING + '|' + DQUOTE_STRING + ')';\nconst ARGUMENT = '(?:(' + IDENT + '|' + NUMBER + '|' + STRING + ')\\\\s*' + ')';\nconst ARGUMENTS = '(?:' + ARGUMENT + '(?:,\\\\s*' + ARGUMENT + ')*' + ')';\nconst ARGUMENT_LIST = '(?:' + '\\\\(\\\\s*' +\n '(?:' + ARGUMENTS + '?' + ')' +\n '\\\\)\\\\s*' + ')';\nconst BINDING = '(' + IDENT + '\\\\s*' + ARGUMENT_LIST + '?' + ')'; // Group 3\nconst OPEN_BRACKET = '(\\\\[\\\\[|{{)' + '\\\\s*';\nconst CLOSE_BRACKET = '(?:]]|}})';\nconst NEGATE = '(?:(!)\\\\s*)?'; // Group 2\nconst EXPRESSION = OPEN_BRACKET + NEGATE + BINDING + CLOSE_BRACKET;\nconst bindingRegex = new RegExp(EXPRESSION, \"g\");\n\n/**\n * Create a string from binding parts of all the literal parts\n *\n * @param {!Array<BindingPart>} parts All parts to stringify\n * @return {string} String made from the literal parts\n */\nfunction literalFromParts(parts) {\n let s = '';\n for (let i=0; i<parts.length; i++) {\n let literal = parts[i].literal;\n s += literal || '';\n }\n return s;\n}\n\n/**\n * Parses an expression string for a method signature, and returns a metadata\n * describing the method in terms of `methodName`, `static` (whether all the\n * arguments are literals), and an array of `args`\n *\n * @param {string} expression The expression to parse\n * @return {?MethodSignature} The method metadata object if a method expression was\n * found, otherwise `undefined`\n * @private\n */\nfunction parseMethod(expression) {\n // tries to match valid javascript property names\n let m = expression.match(/([^\\s]+?)\\(([\\s\\S]*)\\)/);\n if (m) {\n let methodName = m[1];\n let sig = { methodName, static: true, args: emptyArray };\n if (m[2].trim()) {\n // replace escaped commas with comma entity, split on un-escaped commas\n let args = m[2].replace(/\\\\,/g, '&comma;').split(',');\n return parseArgs(args, sig);\n } else {\n return sig;\n }\n }\n return null;\n}\n\n/**\n * Parses an array of arguments and sets the `args` property of the supplied\n * signature metadata object. Sets the `static` property to false if any\n * argument is a non-literal.\n *\n * @param {!Array<string>} argList Array of argument names\n * @param {!MethodSignature} sig Method signature metadata object\n * @return {!MethodSignature} The updated signature metadata object\n * @private\n */\nfunction parseArgs(argList, sig) {\n sig.args = argList.map(function(rawArg) {\n let arg = parseArg(rawArg);\n if (!arg.literal) {\n sig.static = false;\n }\n return arg;\n }, this);\n return sig;\n}\n\n/**\n * Parses an individual argument, and returns an argument metadata object\n * with the following fields:\n *\n * {\n * value: 'prop', // property/path or literal value\n * literal: false, // whether argument is a literal\n * structured: false, // whether the property is a path\n * rootProperty: 'prop', // the root property of the path\n * wildcard: false // whether the argument was a wildcard '.*' path\n * }\n *\n * @param {string} rawArg The string value of the argument\n * @return {!MethodArg} Argument metadata object\n * @private\n */\nfunction parseArg(rawArg) {\n // clean up whitespace\n let arg = rawArg.trim()\n // replace comma entity with comma\n .replace(/&comma;/g, ',')\n // repair extra escape sequences; note only commas strictly need\n // escaping, but we allow any other char to be escaped since its\n // likely users will do this\n .replace(/\\\\(.)/g, '$1')\n ;\n // basic argument descriptor\n let a = {\n name: arg,\n value: '',\n literal: false\n };\n // detect literal value (must be String or Number)\n let fc = arg[0];\n if (fc === '-') {\n fc = arg[1];\n }\n if (fc >= '0' && fc <= '9') {\n fc = '#';\n }\n switch(fc) {\n case \"'\":\n case '\"':\n a.value = arg.slice(1, -1);\n a.literal = true;\n break;\n case '#':\n a.value = Number(arg);\n a.literal = true;\n break;\n }\n // if not literal, look for structured path\n if (!a.literal) {\n a.rootProperty = root(arg);\n // detect structured path (has dots)\n a.structured = isPath(arg);\n if (a.structured) {\n a.wildcard = (arg.slice(-2) == '.*');\n if (a.wildcard) {\n a.name = arg.slice(0, -2);\n }\n }\n }\n return a;\n}\n\nfunction getArgValue(data, props, path) {\n let value = get(data, path);\n // when data is not stored e.g. `splices`, get the value from changedProps\n // TODO(kschaaf): Note, this can cause a rare issue where the wildcard\n // info.value could pull a stale value out of changedProps during a reentrant\n // change that sets the value back to undefined.\n // https://github.com/Polymer/polymer/issues/5479\n if (value === undefined) {\n value = props[path];\n }\n return value;\n}\n\n// data api\n\n/**\n * Sends array splice notifications (`.splices` and `.length`)\n *\n * Note: this implementation only accepts normalized paths\n *\n * @param {!Polymer_PropertyEffects} inst Instance to send notifications to\n * @param {Array} array The array the mutations occurred on\n * @param {string} path The path to the array that was mutated\n * @param {Array} splices Array of splice records\n * @return {void}\n * @private\n */\nfunction notifySplices(inst, array, path, splices) {\n const splicesData = { indexSplices: splices };\n // Legacy behavior stored splices in `__data__` so it was *not* ephemeral.\n // To match this behavior, we store splices directly on the array.\n if (legacyUndefined && !inst._overrideLegacyUndefined) {\n array.splices = splicesData;\n }\n inst.notifyPath(path + '.splices', splicesData);\n inst.notifyPath(path + '.length', array.length);\n // Clear splice data only when it's stored on the array.\n if (legacyUndefined && !inst._overrideLegacyUndefined) {\n splicesData.indexSplices = [];\n }\n}\n\n/**\n * Creates a splice record and sends an array splice notification for\n * the described mutation\n *\n * Note: this implementation only accepts normalized paths\n *\n * @param {!Polymer_PropertyEffects} inst Instance to send notifications to\n * @param {Array} array The array the mutations occurred on\n * @param {string} path The path to the array that was mutated\n * @param {number} index Index at which the array mutation occurred\n * @param {number} addedCount Number of added items\n * @param {Array} removed Array of removed items\n * @return {void}\n * @private\n */\nfunction notifySplice(inst, array, path, index, addedCount, removed) {\n notifySplices(inst, array, path, [{\n index: index,\n addedCount: addedCount,\n removed: removed,\n object: array,\n type: 'splice'\n }]);\n}\n\n/**\n * Returns an upper-cased version of the string.\n *\n * @param {string} name String to uppercase\n * @return {string} Uppercased string\n * @private\n */\nfunction upper(name) {\n return name[0].toUpperCase() + name.substring(1);\n}\n\n/**\n * Element class mixin that provides meta-programming for Polymer's template\n * binding and data observation (collectively, \"property effects\") system.\n *\n * This mixin uses provides the following key static methods for adding\n * property effects to an element class:\n * - `addPropertyEffect`\n * - `createPropertyObserver`\n * - `createMethodObserver`\n * - `createNotifyingProperty`\n * - `createReadOnlyProperty`\n * - `createReflectedProperty`\n * - `createComputedProperty`\n * - `bindTemplate`\n *\n * Each method creates one or more property accessors, along with metadata\n * used by this mixin's implementation of `_propertiesChanged` to perform\n * the property effects.\n *\n * Underscored versions of the above methods also exist on the element\n * prototype for adding property effects on instances at runtime.\n *\n * Note that this mixin overrides several `PropertyAccessors` methods, in\n * many cases to maintain guarantees provided by the Polymer 1.x features;\n * notably it changes property accessors to be synchronous by default\n * whereas the default when using `PropertyAccessors` standalone is to be\n * async by default.\n *\n * @mixinFunction\n * @polymer\n * @appliesMixin TemplateStamp\n * @appliesMixin PropertyAccessors\n * @summary Element class mixin that provides meta-programming for Polymer's\n * template binding and data observation system.\n */\nexport const PropertyEffects = dedupingMixin(superClass => {\n\n /**\n * @constructor\n * @implements {Polymer_PropertyAccessors}\n * @implements {Polymer_TemplateStamp}\n * @unrestricted\n * @private\n */\n const propertyEffectsBase = TemplateStamp(PropertyAccessors(superClass));\n\n /**\n * @polymer\n * @mixinClass\n * @implements {Polymer_PropertyEffects}\n * @extends {propertyEffectsBase}\n * @unrestricted\n */\n class PropertyEffects extends propertyEffectsBase {\n\n constructor() {\n super();\n /** @type {boolean} */\n // Used to identify users of this mixin, ala instanceof\n this.__isPropertyEffectsClient = true;\n /** @type {boolean} */\n this.__dataClientsReady;\n /** @type {Array} */\n this.__dataPendingClients;\n /** @type {Object} */\n this.__dataToNotify;\n /** @type {Object} */\n this.__dataLinkedPaths;\n /** @type {boolean} */\n this.__dataHasPaths;\n /** @type {Object} */\n this.__dataCompoundStorage;\n /** @type {Polymer_PropertyEffects} */\n this.__dataHost;\n /** @type {!Object} */\n this.__dataTemp;\n /** @type {boolean} */\n this.__dataClientsInitialized;\n /** @type {!Object} */\n this.__data;\n /** @type {!Object|null} */\n this.__dataPending;\n /** @type {!Object} */\n this.__dataOld;\n /** @type {Object} */\n this.__computeEffects;\n /** @type {Object} */\n this.__computeInfo;\n /** @type {Object} */\n this.__reflectEffects;\n /** @type {Object} */\n this.__notifyEffects;\n /** @type {Object} */\n this.__propagateEffects;\n /** @type {Object} */\n this.__observeEffects;\n /** @type {Object} */\n this.__readOnly;\n /** @type {!TemplateInfo} */\n this.__templateInfo;\n /** @type {boolean} */\n this._overrideLegacyUndefined;\n }\n\n get PROPERTY_EFFECT_TYPES() {\n return TYPES;\n }\n\n /**\n * @override\n * @return {void}\n */\n _initializeProperties() {\n super._initializeProperties();\n this._registerHost();\n this.__dataClientsReady = false;\n this.__dataPendingClients = null;\n this.__dataToNotify = null;\n this.__dataLinkedPaths = null;\n this.__dataHasPaths = false;\n // May be set on instance prior to upgrade\n this.__dataCompoundStorage = this.__dataCompoundStorage || null;\n this.__dataHost = this.__dataHost || null;\n this.__dataTemp = {};\n this.__dataClientsInitialized = false;\n }\n\n _registerHost() {\n if (hostStack.length) {\n let host = hostStack[hostStack.length-1];\n host._enqueueClient(this);\n // This ensures even non-bound elements have a host set, as\n // long as they upgrade synchronously\n this.__dataHost = host;\n }\n }\n\n /**\n * Overrides `PropertyAccessors` implementation to provide a\n * more efficient implementation of initializing properties from\n * the prototype on the instance.\n *\n * @override\n * @param {Object} props Properties to initialize on the prototype\n * @return {void}\n */\n _initializeProtoProperties(props) {\n this.__data = Object.create(props);\n this.__dataPending = Object.create(props);\n this.__dataOld = {};\n }\n\n /**\n * Overrides `PropertyAccessors` implementation to avoid setting\n * `_setProperty`'s `shouldNotify: true`.\n *\n * @override\n * @param {Object} props Properties to initialize on the instance\n * @return {void}\n */\n _initializeInstanceProperties(props) {\n let readOnly = this[TYPES.READ_ONLY];\n for (let prop in props) {\n if (!readOnly || !readOnly[prop]) {\n this.__dataPending = this.__dataPending || {};\n this.__dataOld = this.__dataOld || {};\n this.__data[prop] = this.__dataPending[prop] = props[prop];\n }\n }\n }\n\n // Prototype setup ----------------------------------------\n\n /**\n * Equivalent to static `addPropertyEffect` API but can be called on\n * an instance to add effects at runtime. See that method for\n * full API docs.\n *\n * @override\n * @param {string} property Property that should trigger the effect\n * @param {string} type Effect type, from this.PROPERTY_EFFECT_TYPES\n * @param {Object=} effect Effect metadata object\n * @return {void}\n * @protected\n */\n _addPropertyEffect(property, type, effect) {\n this._createPropertyAccessor(property, type == TYPES.READ_ONLY);\n // effects are accumulated into arrays per property based on type\n let effects = ensureOwnEffectMap(this, type, true)[property];\n if (!effects) {\n effects = this[type][property] = [];\n }\n effects.push(effect);\n }\n\n /**\n * Removes the given property effect.\n *\n * @override\n * @param {string} property Property the effect was associated with\n * @param {string} type Effect type, from this.PROPERTY_EFFECT_TYPES\n * @param {Object=} effect Effect metadata object to remove\n * @return {void}\n */\n _removePropertyEffect(property, type, effect) {\n let effects = ensureOwnEffectMap(this, type, true)[property];\n let idx = effects.indexOf(effect);\n if (idx >= 0) {\n effects.splice(idx, 1);\n }\n }\n\n /**\n * Returns whether the current prototype/instance has a property effect\n * of a certain type.\n *\n * @override\n * @param {string} property Property name\n * @param {string=} type Effect type, from this.PROPERTY_EFFECT_TYPES\n * @return {boolean} True if the prototype/instance has an effect of this\n * type\n * @protected\n */\n _hasPropertyEffect(property, type) {\n let effects = this[type];\n return Boolean(effects && effects[property]);\n }\n\n /**\n * Returns whether the current prototype/instance has a \"read only\"\n * accessor for the given property.\n *\n * @override\n * @param {string} property Property name\n * @return {boolean} True if the prototype/instance has an effect of this\n * type\n * @protected\n */\n _hasReadOnlyEffect(property) {\n return this._hasPropertyEffect(property, TYPES.READ_ONLY);\n }\n\n /**\n * Returns whether the current prototype/instance has a \"notify\"\n * property effect for the given property.\n *\n * @override\n * @param {string} property Property name\n * @return {boolean} True if the prototype/instance has an effect of this\n * type\n * @protected\n */\n _hasNotifyEffect(property) {\n return this._hasPropertyEffect(property, TYPES.NOTIFY);\n }\n\n /**\n * Returns whether the current prototype/instance has a \"reflect to\n * attribute\" property effect for the given property.\n *\n * @override\n * @param {string} property Property name\n * @return {boolean} True if the prototype/instance has an effect of this\n * type\n * @protected\n */\n _hasReflectEffect(property) {\n return this._hasPropertyEffect(property, TYPES.REFLECT);\n }\n\n /**\n * Returns whether the current prototype/instance has a \"computed\"\n * property effect for the given property.\n *\n * @override\n * @param {string} property Property name\n * @return {boolean} True if the prototype/instance has an effect of this\n * type\n * @protected\n */\n _hasComputedEffect(property) {\n return this._hasPropertyEffect(property, TYPES.COMPUTE);\n }\n\n // Runtime ----------------------------------------\n\n /**\n * Sets a pending property or path. If the root property of the path in\n * question had no accessor, the path is set, otherwise it is enqueued\n * via `_setPendingProperty`.\n *\n * This function isolates relatively expensive functionality necessary\n * for the public API (`set`, `setProperties`, `notifyPath`, and property\n * change listeners via {{...}} bindings), such that it is only done\n * when paths enter the system, and not at every propagation step. It\n * also sets a `__dataHasPaths` flag on the instance which is used to\n * fast-path slower path-matching code in the property effects host paths.\n *\n * `path` can be a path string or array of path parts as accepted by the\n * public API.\n *\n * @override\n * @param {string | !Array<number|string>} path Path to set\n * @param {*} value Value to set\n * @param {boolean=} shouldNotify Set to true if this change should\n * cause a property notification event dispatch\n * @param {boolean=} isPathNotification If the path being set is a path\n * notification of an already changed value, as opposed to a request\n * to set and notify the change. In the latter `false` case, a dirty\n * check is performed and then the value is set to the path before\n * enqueuing the pending property change.\n * @return {boolean} Returns true if the property/path was enqueued in\n * the pending changes bag.\n * @protected\n */\n _setPendingPropertyOrPath(path, value, shouldNotify, isPathNotification) {\n if (isPathNotification ||\n root(Array.isArray(path) ? path[0] : path) !== path) {\n // Dirty check changes being set to a path against the actual object,\n // since this is the entry point for paths into the system; from here\n // the only dirty checks are against the `__dataTemp` cache to prevent\n // duplicate work in the same turn only. Note, if this was a notification\n // of a change already set to a path (isPathNotification: true),\n // we always let the change through and skip the `set` since it was\n // already dirty checked at the point of entry and the underlying\n // object has already been updated\n if (!isPathNotification) {\n let old = get(this, path);\n path = /** @type {string} */ (set(this, path, value));\n // Use property-accessor's simpler dirty check\n if (!path || !super._shouldPropertyChange(path, value, old)) {\n return false;\n }\n }\n this.__dataHasPaths = true;\n if (this._setPendingProperty(/**@type{string}*/(path), value, shouldNotify)) {\n computeLinkedPaths(this, /**@type{string}*/ (path), value);\n return true;\n }\n } else {\n if (this.__dataHasAccessor && this.__dataHasAccessor[path]) {\n return this._setPendingProperty(/**@type{string}*/(path), value, shouldNotify);\n } else {\n this[path] = value;\n }\n }\n return false;\n }\n\n /**\n * Applies a value to a non-Polymer element/node's property.\n *\n * The implementation makes a best-effort at binding interop:\n * Some native element properties have side-effects when\n * re-setting the same value (e.g. setting `<input>.value` resets the\n * cursor position), so we do a dirty-check before setting the value.\n * However, for better interop with non-Polymer custom elements that\n * accept objects, we explicitly re-set object changes coming from the\n * Polymer world (which may include deep object changes without the\n * top reference changing), erring on the side of providing more\n * information.\n *\n * Users may override this method to provide alternate approaches.\n *\n * @override\n * @param {!Node} node The node to set a property on\n * @param {string} prop The property to set\n * @param {*} value The value to set\n * @return {void}\n * @protected\n */\n _setUnmanagedPropertyToNode(node, prop, value) {\n // It is a judgment call that resetting primitives is\n // \"bad\" and resettings objects is also \"good\"; alternatively we could\n // implement a whitelist of tag & property values that should never\n // be reset (e.g. <input>.value && <select>.value)\n if (value !== node[prop] || typeof value == 'object') {\n // Note, className needs style scoping so this needs wrapping.\n if (prop === 'className') {\n node = /** @type {!Node} */(wrap(node));\n }\n node[prop] = value;\n }\n }\n\n /**\n * Overrides the `PropertiesChanged` implementation to introduce special\n * dirty check logic depending on the property & value being set:\n *\n * 1. Any value set to a path (e.g. 'obj.prop': 42 or 'obj.prop': {...})\n * Stored in `__dataTemp`, dirty checked against `__dataTemp`\n * 2. Object set to simple property (e.g. 'prop': {...})\n * Stored in `__dataTemp` and `__data`, dirty checked against\n * `__dataTemp` by default implementation of `_shouldPropertyChange`\n * 3. Primitive value set to simple property (e.g. 'prop': 42)\n * Stored in `__data`, dirty checked against `__data`\n *\n * The dirty-check is important to prevent cycles due to two-way\n * notification, but paths and objects are only dirty checked against any\n * previous value set during this turn via a \"temporary cache\" that is\n * cleared when the last `_propertiesChanged` exits. This is so:\n * a. any cached array paths (e.g. 'array.3.prop') may be invalidated\n * due to array mutations like shift/unshift/splice; this is fine\n * since path changes are dirty-checked at user entry points like `set`\n * b. dirty-checking for objects only lasts one turn to allow the user\n * to mutate the object in-place and re-set it with the same identity\n * and have all sub-properties re-propagated in a subsequent turn.\n *\n * The temp cache is not necessarily sufficient to prevent invalid array\n * paths, since a splice can happen during the same turn (with pathological\n * user code); we could introduce a \"fixup\" for temporarily cached array\n * paths if needed: https://github.com/Polymer/polymer/issues/4227\n *\n * @override\n * @param {string} property Name of the property\n * @param {*} value Value to set\n * @param {boolean=} shouldNotify True if property should fire notification\n * event (applies only for `notify: true` properties)\n * @return {boolean} Returns true if the property changed\n */\n _setPendingProperty(property, value, shouldNotify) {\n let propIsPath = this.__dataHasPaths && isPath(property);\n let prevProps = propIsPath ? this.__dataTemp : this.__data;\n if (this._shouldPropertyChange(property, value, prevProps[property])) {\n if (!this.__dataPending) {\n this.__dataPending = {};\n this.__dataOld = {};\n }\n // Ensure old is captured from the last turn\n if (!(property in this.__dataOld)) {\n this.__dataOld[property] = this.__data[property];\n }\n // Paths are stored in temporary cache (cleared at end of turn),\n // which is used for dirty-checking, all others stored in __data\n if (propIsPath) {\n this.__dataTemp[property] = value;\n } else {\n this.__data[property] = value;\n }\n // All changes go into pending property bag, passed to _propertiesChanged\n this.__dataPending[property] = value;\n // Track properties that should notify separately\n if (propIsPath || (this[TYPES.NOTIFY] && this[TYPES.NOTIFY][property])) {\n this.__dataToNotify = this.__dataToNotify || {};\n this.__dataToNotify[property] = shouldNotify;\n }\n return true;\n }\n return false;\n }\n\n /**\n * Overrides base implementation to ensure all accessors set `shouldNotify`\n * to true, for per-property notification tracking.\n *\n * @override\n * @param {string} property Name of the property\n * @param {*} value Value to set\n * @return {void}\n */\n _setProperty(property, value) {\n if (this._setPendingProperty(property, value, true)) {\n this._invalidateProperties();\n }\n }\n\n /**\n * Overrides `PropertyAccessor`'s default async queuing of\n * `_propertiesChanged`: if `__dataReady` is false (has not yet been\n * manually flushed), the function no-ops; otherwise flushes\n * `_propertiesChanged` synchronously.\n *\n * @override\n * @return {void}\n */\n _invalidateProperties() {\n if (this.__dataReady) {\n this._flushProperties();\n }\n }\n\n /**\n * Enqueues the given client on a list of pending clients, whose\n * pending property changes can later be flushed via a call to\n * `_flushClients`.\n *\n * @override\n * @param {Object} client PropertyEffects client to enqueue\n * @return {void}\n * @protected\n */\n _enqueueClient(client) {\n this.__dataPendingClients = this.__dataPendingClients || [];\n if (client !== this) {\n this.__dataPendingClients.push(client);\n }\n }\n\n /**\n * Flushes any clients previously enqueued via `_enqueueClient`, causing\n * their `_flushProperties` method to run.\n *\n * @override\n * @return {void}\n * @protected\n */\n _flushClients() {\n if (!this.__dataClientsReady) {\n this.__dataClientsReady = true;\n this._readyClients();\n // Override point where accessors are turned on; importantly,\n // this is after clients have fully readied, providing a guarantee\n // that any property effects occur only after all clients are ready.\n this.__dataReady = true;\n } else {\n this.__enableOrFlushClients();\n }\n }\n\n // NOTE: We ensure clients either enable or flush as appropriate. This\n // handles two corner cases:\n // (1) clients flush properly when connected/enabled before the host\n // enables; e.g.\n // (a) Templatize stamps with no properties and does not flush and\n // (b) the instance is inserted into dom and\n // (c) then the instance flushes.\n // (2) clients enable properly when not connected/enabled when the host\n // flushes; e.g.\n // (a) a template is runtime stamped and not yet connected/enabled\n // (b) a host sets a property, causing stamped dom to flush\n // (c) the stamped dom enables.\n __enableOrFlushClients() {\n let clients = this.__dataPendingClients;\n if (clients) {\n this.__dataPendingClients = null;\n for (let i=0; i < clients.length; i++) {\n let client = clients[i];\n if (!client.__dataEnabled) {\n client._enableProperties();\n } else if (client.__dataPending) {\n client._flushProperties();\n }\n }\n }\n }\n\n /**\n * Perform any initial setup on client dom. Called before the first\n * `_flushProperties` call on client dom and before any element\n * observers are called.\n *\n * @override\n * @return {void}\n * @protected\n */\n _readyClients() {\n this.__enableOrFlushClients();\n }\n\n /**\n * Sets a bag of property changes to this instance, and\n * synchronously processes all effects of the properties as a batch.\n *\n * Property names must be simple properties, not paths. Batched\n * path propagation is not supported.\n *\n * @override\n * @param {Object} props Bag of one or more key-value pairs whose key is\n * a property and value is the new value to set for that property.\n * @param {boolean=} setReadOnly When true, any private values set in\n * `props` will be set. By default, `setProperties` will not set\n * `readOnly: true` root properties.\n * @return {void}\n * @public\n */\n setProperties(props, setReadOnly) {\n for (let path in props) {\n if (setReadOnly || !this[TYPES.READ_ONLY] || !this[TYPES.READ_ONLY][path]) {\n //TODO(kschaaf): explicitly disallow paths in setProperty?\n // wildcard observers currently only pass the first changed path\n // in the `info` object, and you could do some odd things batching\n // paths, e.g. {'foo.bar': {...}, 'foo': null}\n this._setPendingPropertyOrPath(path, props[path], true);\n }\n }\n this._invalidateProperties();\n }\n\n /**\n * Overrides `PropertyAccessors` so that property accessor\n * side effects are not enabled until after client dom is fully ready.\n * Also calls `_flushClients` callback to ensure client dom is enabled\n * that was not enabled as a result of flushing properties.\n *\n * @override\n * @return {void}\n */\n ready() {\n // It is important that `super.ready()` is not called here as it\n // immediately turns on accessors. Instead, we wait until `readyClients`\n // to enable accessors to provide a guarantee that clients are ready\n // before processing any accessors side effects.\n this._flushProperties();\n // If no data was pending, `_flushProperties` will not `flushClients`\n // so ensure this is done.\n if (!this.__dataClientsReady) {\n this._flushClients();\n }\n // Before ready, client notifications do not trigger _flushProperties.\n // Therefore a flush is necessary here if data has been set.\n if (this.__dataPending) {\n this._flushProperties();\n }\n }\n\n /**\n * Implements `PropertyAccessors`'s properties changed callback.\n *\n * Runs each class of effects for the batch of changed properties in\n * a specific order (compute, propagate, reflect, observe, notify).\n *\n * @override\n * @param {!Object} currentProps Bag of all current accessor values\n * @param {?Object} changedProps Bag of properties changed since the last\n * call to `_propertiesChanged`\n * @param {?Object} oldProps Bag of previous values for each property\n * in `changedProps`\n * @return {void}\n */\n _propertiesChanged(currentProps, changedProps, oldProps) {\n // ----------------------------\n // let c = Object.getOwnPropertyNames(changedProps || {});\n // window.debug && console.group(this.localName + '#' + this.id + ': ' + c);\n // if (window.debug) { debugger; }\n // ----------------------------\n let hasPaths = this.__dataHasPaths;\n this.__dataHasPaths = false;\n let notifyProps;\n // Compute properties\n runComputedEffects(this, changedProps, oldProps, hasPaths);\n // Clear notify properties prior to possible reentry (propagate, observe),\n // but after computing effects have a chance to add to them\n notifyProps = this.__dataToNotify;\n this.__dataToNotify = null;\n // Propagate properties to clients\n this._propagatePropertyChanges(changedProps, oldProps, hasPaths);\n // Flush clients\n this._flushClients();\n // Reflect properties\n runEffects(this, this[TYPES.REFLECT], changedProps, oldProps, hasPaths);\n // Observe properties\n runEffects(this, this[TYPES.OBSERVE], changedProps, oldProps, hasPaths);\n // Notify properties to host\n if (notifyProps) {\n runNotifyEffects(this, notifyProps, changedProps, oldProps, hasPaths);\n }\n // Clear temporary cache at end of turn\n if (this.__dataCounter == 1) {\n this.__dataTemp = {};\n }\n // ----------------------------\n // window.debug && console.groupEnd(this.localName + '#' + this.id + ': ' + c);\n // ----------------------------\n }\n\n /**\n * Called to propagate any property changes to stamped template nodes\n * managed by this element.\n *\n * @override\n * @param {Object} changedProps Bag of changed properties\n * @param {Object} oldProps Bag of previous values for changed properties\n * @param {boolean} hasPaths True with `props` contains one or more paths\n * @return {void}\n * @protected\n */\n _propagatePropertyChanges(changedProps, oldProps, hasPaths) {\n if (this[TYPES.PROPAGATE]) {\n runEffects(this, this[TYPES.PROPAGATE], changedProps, oldProps, hasPaths);\n }\n if (this.__templateInfo) {\n this._runEffectsForTemplate(this.__templateInfo, changedProps, oldProps, hasPaths);\n }\n }\n\n _runEffectsForTemplate(templateInfo, changedProps, oldProps, hasPaths) {\n const baseRunEffects = (changedProps, hasPaths) => {\n runEffects(this, templateInfo.propertyEffects, changedProps, oldProps,\n hasPaths, templateInfo.nodeList);\n for (let info=templateInfo.firstChild; info; info=info.nextSibling) {\n this._runEffectsForTemplate(info, changedProps, oldProps, hasPaths);\n }\n };\n if (templateInfo.runEffects) {\n templateInfo.runEffects(baseRunEffects, changedProps, hasPaths);\n } else {\n baseRunEffects(changedProps, hasPaths);\n }\n }\n\n /**\n * Aliases one data path as another, such that path notifications from one\n * are routed to the other.\n *\n * @override\n * @param {string | !Array<string|number>} to Target path to link.\n * @param {string | !Array<string|number>} from Source path to link.\n * @return {void}\n * @public\n */\n linkPaths(to, from) {\n to = normalize(to);\n from = normalize(from);\n this.__dataLinkedPaths = this.__dataLinkedPaths || {};\n this.__dataLinkedPaths[to] = from;\n }\n\n /**\n * Removes a data path alias previously established with `_linkPaths`.\n *\n * Note, the path to unlink should be the target (`to`) used when\n * linking the paths.\n *\n * @override\n * @param {string | !Array<string|number>} path Target path to unlink.\n * @return {void}\n * @public\n */\n unlinkPaths(path) {\n path = normalize(path);\n if (this.__dataLinkedPaths) {\n delete this.__dataLinkedPaths[path];\n }\n }\n\n /**\n * Notify that an array has changed.\n *\n * Example:\n *\n * this.items = [ {name: 'Jim'}, {name: 'Todd'}, {name: 'Bill'} ];\n * ...\n * this.items.splice(1, 1, {name: 'Sam'});\n * this.items.push({name: 'Bob'});\n * this.notifySplices('items', [\n * { index: 1, removed: [{name: 'Todd'}], addedCount: 1,\n * object: this.items, type: 'splice' },\n * { index: 3, removed: [], addedCount: 1,\n * object: this.items, type: 'splice'}\n * ]);\n *\n * @param {string} path Path that should be notified.\n * @param {Array} splices Array of splice records indicating ordered\n * changes that occurred to the array. Each record should have the\n * following fields:\n * * index: index at which the change occurred\n * * removed: array of items that were removed from this index\n * * addedCount: number of new items added at this index\n * * object: a reference to the array in question\n * * type: the string literal 'splice'\n *\n * Note that splice records _must_ be normalized such that they are\n * reported in index order (raw results from `Object.observe` are not\n * ordered and must be normalized/merged before notifying).\n *\n * @override\n * @return {void}\n * @public\n */\n notifySplices(path, splices) {\n let info = {path: ''};\n let array = /** @type {Array} */(get(this, path, info));\n notifySplices(this, array, info.path, splices);\n }\n\n /**\n * Convenience method for reading a value from a path.\n *\n * Note, if any part in the path is undefined, this method returns\n * `undefined` (this method does not throw when dereferencing undefined\n * paths).\n *\n * @override\n * @param {(string|!Array<(string|number)>)} path Path to the value\n * to read. The path may be specified as a string (e.g. `foo.bar.baz`)\n * or an array of path parts (e.g. `['foo.bar', 'baz']`). Note that\n * bracketed expressions are not supported; string-based path parts\n * *must* be separated by dots. Note that when dereferencing array\n * indices, the index may be used as a dotted part directly\n * (e.g. `users.12.name` or `['users', 12, 'name']`).\n * @param {Object=} root Root object from which the path is evaluated.\n * @return {*} Value at the path, or `undefined` if any part of the path\n * is undefined.\n * @public\n */\n get(path, root) {\n return get(root || this, path);\n }\n\n /**\n * Convenience method for setting a value to a path and notifying any\n * elements bound to the same path.\n *\n * Note, if any part in the path except for the last is undefined,\n * this method does nothing (this method does not throw when\n * dereferencing undefined paths).\n *\n * @override\n * @param {(string|!Array<(string|number)>)} path Path to the value\n * to write. The path may be specified as a string (e.g. `'foo.bar.baz'`)\n * or an array of path parts (e.g. `['foo.bar', 'baz']`). Note that\n * bracketed expressions are not supported; string-based path parts\n * *must* be separated by dots. Note that when dereferencing array\n * indices, the index may be used as a dotted part directly\n * (e.g. `'users.12.name'` or `['users', 12, 'name']`).\n * @param {*} value Value to set at the specified path.\n * @param {Object=} root Root object from which the path is evaluated.\n * When specified, no notification will occur.\n * @return {void}\n * @public\n */\n set(path, value, root) {\n if (root) {\n set(root, path, value);\n } else {\n if (!this[TYPES.READ_ONLY] || !this[TYPES.READ_ONLY][/** @type {string} */(path)]) {\n if (this._setPendingPropertyOrPath(path, value, true)) {\n this._invalidateProperties();\n }\n }\n }\n }\n\n /**\n * Adds items onto the end of the array at the path specified.\n *\n * The arguments after `path` and return value match that of\n * `Array.prototype.push`.\n *\n * This method notifies other paths to the same array that a\n * splice occurred to the array.\n *\n * @override\n * @param {string | !Array<string|number>} path Path to array.\n * @param {...*} items Items to push onto array\n * @return {number} New length of the array.\n * @public\n */\n push(path, ...items) {\n let info = {path: ''};\n let array = /** @type {Array}*/(get(this, path, info));\n let len = array.length;\n let ret = array.push(...items);\n if (items.length) {\n notifySplice(this, array, info.path, len, items.length, []);\n }\n return ret;\n }\n\n /**\n * Removes an item from the end of array at the path specified.\n *\n * The arguments after `path` and return value match that of\n * `Array.prototype.pop`.\n *\n * This method notifies other paths to the same array that a\n * splice occurred to the array.\n *\n * @override\n * @param {string | !Array<string|number>} path Path to array.\n * @return {*} Item that was removed.\n * @public\n */\n pop(path) {\n let info = {path: ''};\n let array = /** @type {Array} */(get(this, path, info));\n let hadLength = Boolean(array.length);\n let ret = array.pop();\n if (hadLength) {\n notifySplice(this, array, info.path, array.length, 0, [ret]);\n }\n return ret;\n }\n\n /**\n * Starting from the start index specified, removes 0 or more items\n * from the array and inserts 0 or more new items in their place.\n *\n * The arguments after `path` and return value match that of\n * `Array.prototype.splice`.\n *\n * This method notifies other paths to the same array that a\n * splice occurred to the array.\n *\n * @override\n * @param {string | !Array<string|number>} path Path to array.\n * @param {number} start Index from which to start removing/inserting.\n * @param {number=} deleteCount Number of items to remove.\n * @param {...*} items Items to insert into array.\n * @return {!Array} Array of removed items.\n * @public\n */\n splice(path, start, deleteCount, ...items) {\n let info = {path : ''};\n let array = /** @type {Array} */(get(this, path, info));\n // Normalize fancy native splice handling of crazy start values\n if (start < 0) {\n start = array.length - Math.floor(-start);\n } else if (start) {\n start = Math.floor(start);\n }\n // array.splice does different things based on the number of arguments\n // you pass in. Therefore, array.splice(0) and array.splice(0, undefined)\n // do different things. In the former, the whole array is cleared. In the\n // latter, no items are removed.\n // This means that we need to detect whether 1. one of the arguments\n // is actually passed in and then 2. determine how many arguments\n // we should pass on to the native array.splice\n //\n let ret;\n // Omit any additional arguments if they were not passed in\n if (arguments.length === 2) {\n ret = array.splice(start);\n // Either start was undefined and the others were defined, but in this\n // case we can safely pass on all arguments\n //\n // Note: this includes the case where none of the arguments were passed in,\n // e.g. this.splice('array'). However, if both start and deleteCount\n // are undefined, array.splice will not modify the array (as expected)\n } else {\n ret = array.splice(start, deleteCount, ...items);\n }\n // At the end, check whether any items were passed in (e.g. insertions)\n // or if the return array contains items (e.g. deletions).\n // Only notify if items were added or deleted.\n if (items.length || ret.length) {\n notifySplice(this, array, info.path, start, items.length, ret);\n }\n return ret;\n }\n\n /**\n * Removes an item from the beginning of array at the path specified.\n *\n * The arguments after `path` and return value match that of\n * `Array.prototype.pop`.\n *\n * This method notifies other paths to the same array that a\n * splice occurred to the array.\n *\n * @override\n * @param {string | !Array<string|number>} path Path to array.\n * @return {*} Item that was removed.\n * @public\n */\n shift(path) {\n let info = {path: ''};\n let array = /** @type {Array} */(get(this, path, info));\n let hadLength = Boolean(array.length);\n let ret = array.shift();\n if (hadLength) {\n notifySplice(this, array, info.path, 0, 0, [ret]);\n }\n return ret;\n }\n\n /**\n * Adds items onto the beginning of the array at the path specified.\n *\n * The arguments after `path` and return value match that of\n * `Array.prototype.push`.\n *\n * This method notifies other paths to the same array that a\n * splice occurred to the array.\n *\n * @override\n * @param {string | !Array<string|number>} path Path to array.\n * @param {...*} items Items to insert info array\n * @return {number} New length of the array.\n * @public\n */\n unshift(path, ...items) {\n let info = {path: ''};\n let array = /** @type {Array} */(get(this, path, info));\n let ret = array.unshift(...items);\n if (items.length) {\n notifySplice(this, array, info.path, 0, items.length, []);\n }\n return ret;\n }\n\n /**\n * Notify that a path has changed.\n *\n * Example:\n *\n * this.item.user.name = 'Bob';\n * this.notifyPath('item.user.name');\n *\n * @override\n * @param {string} path Path that should be notified.\n * @param {*=} value Value at the path (optional).\n * @return {void}\n * @public\n */\n notifyPath(path, value) {\n /** @type {string} */\n let propPath;\n if (arguments.length == 1) {\n // Get value if not supplied\n let info = {path: ''};\n value = get(this, path, info);\n propPath = info.path;\n } else if (Array.isArray(path)) {\n // Normalize path if needed\n propPath = normalize(path);\n } else {\n propPath = /** @type{string} */(path);\n }\n if (this._setPendingPropertyOrPath(propPath, value, true, true)) {\n this._invalidateProperties();\n }\n }\n\n /**\n * Equivalent to static `createReadOnlyProperty` API but can be called on\n * an instance to add effects at runtime. See that method for\n * full API docs.\n *\n * @override\n * @param {string} property Property name\n * @param {boolean=} protectedSetter Creates a custom protected setter\n * when `true`.\n * @return {void}\n * @protected\n */\n _createReadOnlyProperty(property, protectedSetter) {\n this._addPropertyEffect(property, TYPES.READ_ONLY);\n if (protectedSetter) {\n this['_set' + upper(property)] = /** @this {PropertyEffects} */function(value) {\n this._setProperty(property, value);\n };\n }\n }\n\n /**\n * Equivalent to static `createPropertyObserver` API but can be called on\n * an instance to add effects at runtime. See that method for\n * full API docs.\n *\n * @override\n * @param {string} property Property name\n * @param {string|function(*,*)} method Function or name of observer method\n * to call\n * @param {boolean=} dynamicFn Whether the method name should be included as\n * a dependency to the effect.\n * @return {void}\n * @protected\n */\n _createPropertyObserver(property, method, dynamicFn) {\n let info = { property, method, dynamicFn: Boolean(dynamicFn) };\n this._addPropertyEffect(property, TYPES.OBSERVE, {\n fn: runObserverEffect, info, trigger: {name: property}\n });\n if (dynamicFn) {\n this._addPropertyEffect(/** @type {string} */(method), TYPES.OBSERVE, {\n fn: runObserverEffect, info, trigger: {name: method}\n });\n }\n }\n\n /**\n * Equivalent to static `createMethodObserver` API but can be called on\n * an instance to add effects at runtime. See that method for\n * full API docs.\n *\n * @override\n * @param {string} expression Method expression\n * @param {boolean|Object=} dynamicFn Boolean or object map indicating\n * whether method names should be included as a dependency to the effect.\n * @return {void}\n * @protected\n */\n _createMethodObserver(expression, dynamicFn) {\n let sig = parseMethod(expression);\n if (!sig) {\n throw new Error(\"Malformed observer expression '\" + expression + \"'\");\n }\n createMethodEffect(this, sig, TYPES.OBSERVE, runMethodEffect, null, dynamicFn);\n }\n\n /**\n * Equivalent to static `createNotifyingProperty` API but can be called on\n * an instance to add effects at runtime. See that method for\n * full API docs.\n *\n * @override\n * @param {string} property Property name\n * @return {void}\n * @protected\n */\n _createNotifyingProperty(property) {\n this._addPropertyEffect(property, TYPES.NOTIFY, {\n fn: runNotifyEffect,\n info: {\n eventName: camelToDashCase(property) + '-changed',\n property: property\n }\n });\n }\n\n /**\n * Equivalent to static `createReflectedProperty` API but can be called on\n * an instance to add effects at runtime. See that method for\n * full API docs.\n *\n * @override\n * @param {string} property Property name\n * @return {void}\n * @protected\n * @suppress {missingProperties} go/missingfnprops\n */\n _createReflectedProperty(property) {\n let attr = this.constructor.attributeNameForProperty(property);\n if (attr[0] === '-') {\n console.warn('Property ' + property + ' cannot be reflected to attribute ' +\n attr + ' because \"-\" is not a valid starting attribute name. Use a lowercase first letter for the property instead.');\n } else {\n this._addPropertyEffect(property, TYPES.REFLECT, {\n fn: runReflectEffect,\n info: {\n attrName: attr\n }\n });\n }\n }\n\n /**\n * Equivalent to static `createComputedProperty` API but can be called on\n * an instance to add effects at runtime. See that method for\n * full API docs.\n *\n * @override\n * @param {string} property Name of computed property to set\n * @param {string} expression Method expression\n * @param {boolean|Object=} dynamicFn Boolean or object map indicating\n * whether method names should be included as a dependency to the effect.\n * @return {void}\n * @protected\n */\n _createComputedProperty(property, expression, dynamicFn) {\n let sig = parseMethod(expression);\n if (!sig) {\n throw new Error(\"Malformed computed expression '\" + expression + \"'\");\n }\n const info = createMethodEffect(this, sig, TYPES.COMPUTE, runComputedEffect, property, dynamicFn);\n // Effects are normally stored as map of dependency->effect, but for\n // ordered computation, we also need tree of computedProp->dependencies\n ensureOwnEffectMap(this, COMPUTE_INFO)[property] = info;\n }\n\n /**\n * Gather the argument values for a method specified in the provided array\n * of argument metadata.\n *\n * The `path` and `value` arguments are used to fill in wildcard descriptor\n * when the method is being called as a result of a path notification.\n *\n * @param {!Array<!MethodArg>} args Array of argument metadata\n * @param {string} path Property/path name that triggered the method effect\n * @param {Object} props Bag of current property changes\n * @return {!Array<*>} Array of argument values\n * @private\n */\n _marshalArgs(args, path, props) {\n const data = this.__data;\n const values = [];\n for (let i=0, l=args.length; i<l; i++) {\n let {name, structured, wildcard, value, literal} = args[i];\n if (!literal) {\n if (wildcard) {\n const matches = isDescendant(name, path);\n const pathValue = getArgValue(data, props, matches ? path : name);\n value = {\n path: matches ? path : name,\n value: pathValue,\n base: matches ? get(data, name) : pathValue\n };\n } else {\n value = structured ? getArgValue(data, props, name) : data[name];\n }\n }\n // When the `legacyUndefined` flag is enabled, pass a no-op value\n // so that the observer, computed property, or compound binding is aborted.\n if (legacyUndefined && !this._overrideLegacyUndefined && value === undefined && args.length > 1) {\n return NOOP;\n }\n values[i] = value;\n }\n return values;\n }\n\n // -- static class methods ------------\n\n /**\n * Ensures an accessor exists for the specified property, and adds\n * to a list of \"property effects\" that will run when the accessor for\n * the specified property is set. Effects are grouped by \"type\", which\n * roughly corresponds to a phase in effect processing. The effect\n * metadata should be in the following form:\n *\n * {\n * fn: effectFunction, // Reference to function to call to perform effect\n * info: { ... } // Effect metadata passed to function\n * trigger: { // Optional triggering metadata; if not provided\n * name: string // the property is treated as a wildcard\n * structured: boolean\n * wildcard: boolean\n * }\n * }\n *\n * Effects are called from `_propertiesChanged` in the following order by\n * type:\n *\n * 1. COMPUTE\n * 2. PROPAGATE\n * 3. REFLECT\n * 4. OBSERVE\n * 5. NOTIFY\n *\n * Effect functions are called with the following signature:\n *\n * effectFunction(inst, path, props, oldProps, info, hasPaths)\n *\n * @param {string} property Property that should trigger the effect\n * @param {string} type Effect type, from this.PROPERTY_EFFECT_TYPES\n * @param {Object=} effect Effect metadata object\n * @return {void}\n * @protected\n * @nocollapse\n */\n static addPropertyEffect(property, type, effect) {\n this.prototype._addPropertyEffect(property, type, effect);\n }\n\n /**\n * Creates a single-property observer for the given property.\n *\n * @param {string} property Property name\n * @param {string|function(*,*)} method Function or name of observer method to call\n * @param {boolean=} dynamicFn Whether the method name should be included as\n * a dependency to the effect.\n * @return {void}\n * @protected\n * @nocollapse\n */\n static createPropertyObserver(property, method, dynamicFn) {\n this.prototype._createPropertyObserver(property, method, dynamicFn);\n }\n\n /**\n * Creates a multi-property \"method observer\" based on the provided\n * expression, which should be a string in the form of a normal JavaScript\n * function signature: `'methodName(arg1, [..., argn])'`. Each argument\n * should correspond to a property or path in the context of this\n * prototype (or instance), or may be a literal string or number.\n *\n * @param {string} expression Method expression\n * @param {boolean|Object=} dynamicFn Boolean or object map indicating\n * @return {void}\n * whether method names should be included as a dependency to the effect.\n * @protected\n * @nocollapse\n */\n static createMethodObserver(expression, dynamicFn) {\n this.prototype._createMethodObserver(expression, dynamicFn);\n }\n\n /**\n * Causes the setter for the given property to dispatch `<property>-changed`\n * events to notify of changes to the property.\n *\n * @param {string} property Property name\n * @return {void}\n * @protected\n * @nocollapse\n */\n static createNotifyingProperty(property) {\n this.prototype._createNotifyingProperty(property);\n }\n\n /**\n * Creates a read-only accessor for the given property.\n *\n * To set the property, use the protected `_setProperty` API.\n * To create a custom protected setter (e.g. `_setMyProp()` for\n * property `myProp`), pass `true` for `protectedSetter`.\n *\n * Note, if the property will have other property effects, this method\n * should be called first, before adding other effects.\n *\n * @param {string} property Property name\n * @param {boolean=} protectedSetter Creates a custom protected setter\n * when `true`.\n * @return {void}\n * @protected\n * @nocollapse\n */\n static createReadOnlyProperty(property, protectedSetter) {\n this.prototype._createReadOnlyProperty(property, protectedSetter);\n }\n\n /**\n * Causes the setter for the given property to reflect the property value\n * to a (dash-cased) attribute of the same name.\n *\n * @param {string} property Property name\n * @return {void}\n * @protected\n * @nocollapse\n */\n static createReflectedProperty(property) {\n this.prototype._createReflectedProperty(property);\n }\n\n /**\n * Creates a computed property whose value is set to the result of the\n * method described by the given `expression` each time one or more\n * arguments to the method changes. The expression should be a string\n * in the form of a normal JavaScript function signature:\n * `'methodName(arg1, [..., argn])'`\n *\n * @param {string} property Name of computed property to set\n * @param {string} expression Method expression\n * @param {boolean|Object=} dynamicFn Boolean or object map indicating whether\n * method names should be included as a dependency to the effect.\n * @return {void}\n * @protected\n * @nocollapse\n */\n static createComputedProperty(property, expression, dynamicFn) {\n this.prototype._createComputedProperty(property, expression, dynamicFn);\n }\n\n /**\n * Parses the provided template to ensure binding effects are created\n * for them, and then ensures property accessors are created for any\n * dependent properties in the template. Binding effects for bound\n * templates are stored in a linked list on the instance so that\n * templates can be efficiently stamped and unstamped.\n *\n * @param {!HTMLTemplateElement} template Template containing binding\n * bindings\n * @return {!TemplateInfo} Template metadata object\n * @protected\n * @nocollapse\n */\n static bindTemplate(template) {\n return this.prototype._bindTemplate(template);\n }\n\n // -- binding ----------------------------------------------\n\n /*\n * Overview of binding flow:\n *\n * During finalization (`instanceBinding==false`, `wasPreBound==false`):\n * `_bindTemplate(t, false)` called directly during finalization - parses\n * the template (for the first time), and then assigns that _prototypical_\n * template info to `__preboundTemplateInfo` _on the prototype_; note in\n * this case `wasPreBound` is false; this is the first time we're binding\n * it, thus we create accessors.\n *\n * During first stamping (`instanceBinding==true`, `wasPreBound==true`):\n * `_stampTemplate` calls `_bindTemplate(t, true)`: the `templateInfo`\n * returned matches the prebound one, and so this is `wasPreBound == true`\n * state; thus we _skip_ creating accessors, but _do_ create an instance\n * of the template info to serve as the start of our linked list (needs to\n * be an instance, not the prototypical one, so that we can add `nodeList`\n * to it to contain the `nodeInfo`-ordered list of instance nodes for\n * bindings, and so we can chain runtime-stamped template infos off of\n * it). At this point, the call to `_stampTemplate` calls\n * `applyTemplateInfo` for each nested `<template>` found during parsing\n * to hand prototypical `_templateInfo` to them; we also pass the _parent_\n * `templateInfo` to the `<template>` so that we have the instance-time\n * parent to link the `templateInfo` under in the case it was\n * runtime-stamped.\n *\n * During subsequent runtime stamping (`instanceBinding==true`,\n * `wasPreBound==false`): `_stampTemplate` calls `_bindTemplate(t, true)`\n * - here `templateInfo` is guaranteed to _not_ match the prebound one,\n * because it was either a different template altogether, or even if it\n * was the same template, the step above created a instance of the info;\n * in this case `wasPreBound == false`, so we _do_ create accessors, _and_\n * link a instance into the linked list.\n */\n\n /**\n * Equivalent to static `bindTemplate` API but can be called on an instance\n * to add effects at runtime. See that method for full API docs.\n *\n * This method may be called on the prototype (for prototypical template\n * binding, to avoid creating accessors every instance) once per prototype,\n * and will be called with `runtimeBinding: true` by `_stampTemplate` to\n * create and link an instance of the template metadata associated with a\n * particular stamping.\n *\n * @override\n * @param {!HTMLTemplateElement} template Template containing binding\n * bindings\n * @param {boolean=} instanceBinding When false (default), performs\n * \"prototypical\" binding of the template and overwrites any previously\n * bound template for the class. When true (as passed from\n * `_stampTemplate`), the template info is instanced and linked into the\n * list of bound templates.\n * @return {!TemplateInfo} Template metadata object; for `runtimeBinding`,\n * this is an instance of the prototypical template info\n * @protected\n * @suppress {missingProperties} go/missingfnprops\n */\n _bindTemplate(template, instanceBinding) {\n let templateInfo = this.constructor._parseTemplate(template);\n let wasPreBound = this.__preBoundTemplateInfo == templateInfo;\n // Optimization: since this is called twice for proto-bound templates,\n // don't attempt to recreate accessors if this template was pre-bound\n if (!wasPreBound) {\n for (let prop in templateInfo.propertyEffects) {\n this._createPropertyAccessor(prop);\n }\n }\n if (instanceBinding) {\n // For instance-time binding, create instance of template metadata\n // and link into tree of templates if necessary\n templateInfo = /** @type {!TemplateInfo} */(Object.create(templateInfo));\n templateInfo.wasPreBound = wasPreBound;\n if (!this.__templateInfo) {\n // Set the info to the root of the tree\n this.__templateInfo = templateInfo;\n } else {\n // Append this template info onto the end of its parent template's\n // list, which will determine the tree structure via which property\n // effects are run; if this template was not nested in another\n // template, use the root template (the first stamped one) as the\n // parent. Note, `parent` is the `templateInfo` instance for this\n // template's parent (containing) template, which was set up in\n // `applyTemplateInfo`. While a given template's `parent` is set\n // apriori, it is only added to the parent's child list at the point\n // that it is being bound, since a template may or may not ever be\n // stamped, and may be stamped more than once (in which case instances\n // of the template info will be in the tree under its parent more than\n // once).\n const parent = template._parentTemplateInfo || this.__templateInfo;\n const previous = parent.lastChild;\n templateInfo.parent = parent;\n parent.lastChild = templateInfo;\n templateInfo.previousSibling = previous;\n if (previous) {\n previous.nextSibling = templateInfo;\n } else {\n parent.firstChild = templateInfo;\n }\n }\n } else {\n this.__preBoundTemplateInfo = templateInfo;\n }\n return templateInfo;\n }\n\n /**\n * Adds a property effect to the given template metadata, which is run\n * at the \"propagate\" stage of `_propertiesChanged` when the template\n * has been bound to the element via `_bindTemplate`.\n *\n * The `effect` object should match the format in `_addPropertyEffect`.\n *\n * @param {Object} templateInfo Template metadata to add effect to\n * @param {string} prop Property that should trigger the effect\n * @param {Object=} effect Effect metadata object\n * @return {void}\n * @protected\n * @nocollapse\n */\n static _addTemplatePropertyEffect(templateInfo, prop, effect) {\n let hostProps = templateInfo.hostProps = templateInfo.hostProps || {};\n hostProps[prop] = true;\n let effects = templateInfo.propertyEffects = templateInfo.propertyEffects || {};\n let propEffects = effects[prop] = effects[prop] || [];\n propEffects.push(effect);\n }\n\n /**\n * Stamps the provided template and performs instance-time setup for\n * Polymer template features, including data bindings, declarative event\n * listeners, and the `this.$` map of `id`'s to nodes. A document fragment\n * is returned containing the stamped DOM, ready for insertion into the\n * DOM.\n *\n * This method may be called more than once; however note that due to\n * `shadycss` polyfill limitations, only styles from templates prepared\n * using `ShadyCSS.prepareTemplate` will be correctly polyfilled (scoped\n * to the shadow root and support CSS custom properties), and note that\n * `ShadyCSS.prepareTemplate` may only be called once per element. As such,\n * any styles required by in runtime-stamped templates must be included\n * in the main element template.\n *\n * @param {!HTMLTemplateElement} template Template to stamp\n * @param {TemplateInfo=} templateInfo Optional bound template info associated\n * with the template to be stamped; if omitted the template will be\n * automatically bound.\n * @return {!StampedTemplate} Cloned template content\n * @override\n * @protected\n */\n _stampTemplate(template, templateInfo) {\n templateInfo = templateInfo || /** @type {!TemplateInfo} */(this._bindTemplate(template, true));\n // Ensures that created dom is `_enqueueClient`'d to this element so\n // that it can be flushed on next call to `_flushProperties`\n hostStack.push(this);\n let dom = super._stampTemplate(template, templateInfo);\n hostStack.pop();\n // Add template-instance-specific data to instanced templateInfo\n templateInfo.nodeList = dom.nodeList;\n // Capture child nodes to allow unstamping of non-prototypical templates\n if (!templateInfo.wasPreBound) {\n let nodes = templateInfo.childNodes = [];\n for (let n=dom.firstChild; n; n=n.nextSibling) {\n nodes.push(n);\n }\n }\n dom.templateInfo = templateInfo;\n // Setup compound storage, 2-way listeners, and dataHost for bindings\n setupBindings(this, templateInfo);\n // Flush properties into template nodes; the check on `__dataClientsReady`\n // ensures we don't needlessly run effects for an element's initial\n // prototypical template stamping since they will happen as a part of the\n // first call to `_propertiesChanged`. This flag is set to true\n // after running the initial propagate effects, and immediately before\n // flushing clients. Since downstream clients could cause stamping on\n // this host (e.g. a fastDomIf `dom-if` being forced to render\n // synchronously), this flag ensures effects for runtime-stamped templates\n // are run at this point during the initial element boot-up.\n if (this.__dataClientsReady) {\n this._runEffectsForTemplate(templateInfo, this.__data, null, false);\n this._flushClients();\n }\n return dom;\n }\n\n /**\n * Removes and unbinds the nodes previously contained in the provided\n * DocumentFragment returned from `_stampTemplate`.\n *\n * @override\n * @param {!StampedTemplate} dom DocumentFragment previously returned\n * from `_stampTemplate` associated with the nodes to be removed\n * @return {void}\n * @protected\n */\n _removeBoundDom(dom) {\n // Unlink template info; Note that while the child is unlinked from its\n // parent list, a template's `parent` reference is never removed, since\n // this is is determined by the tree structure and applied at\n // `applyTemplateInfo` time.\n const templateInfo = dom.templateInfo;\n const {previousSibling, nextSibling, parent} = templateInfo;\n if (previousSibling) {\n previousSibling.nextSibling = nextSibling;\n } else if (parent) {\n parent.firstChild = nextSibling;\n }\n if (nextSibling) {\n nextSibling.previousSibling = previousSibling;\n } else if (parent) {\n parent.lastChild = previousSibling;\n }\n templateInfo.nextSibling = templateInfo.previousSibling = null;\n // Remove stamped nodes\n let nodes = templateInfo.childNodes;\n for (let i=0; i<nodes.length; i++) {\n let node = nodes[i];\n wrap(wrap(node).parentNode).removeChild(node);\n }\n }\n\n /**\n * Overrides default `TemplateStamp` implementation to add support for\n * parsing bindings from `TextNode`'s' `textContent`. A `bindings`\n * array is added to `nodeInfo` and populated with binding metadata\n * with information capturing the binding target, and a `parts` array\n * with one or more metadata objects capturing the source(s) of the\n * binding.\n *\n * @param {Node} node Node to parse\n * @param {TemplateInfo} templateInfo Template metadata for current template\n * @param {NodeInfo} nodeInfo Node metadata for current template node\n * @return {boolean} `true` if the visited node added node-specific\n * metadata to `nodeInfo`\n * @protected\n * @suppress {missingProperties} Interfaces in closure do not inherit statics, but classes do\n * @nocollapse\n */\n static _parseTemplateNode(node, templateInfo, nodeInfo) {\n // TODO(https://github.com/google/closure-compiler/issues/3240):\n // Change back to just super.methodCall()\n let noted = propertyEffectsBase._parseTemplateNode.call(\n this, node, templateInfo, nodeInfo);\n if (node.nodeType === Node.TEXT_NODE) {\n let parts = this._parseBindings(node.textContent, templateInfo);\n if (parts) {\n // Initialize the textContent with any literal parts\n // NOTE: default to a space here so the textNode remains; some browsers\n // (IE) omit an empty textNode following cloneNode/importNode.\n node.textContent = literalFromParts(parts) || ' ';\n addBinding(this, templateInfo, nodeInfo, 'text', 'textContent', parts);\n noted = true;\n }\n }\n return noted;\n }\n\n /**\n * Overrides default `TemplateStamp` implementation to add support for\n * parsing bindings from attributes. A `bindings`\n * array is added to `nodeInfo` and populated with binding metadata\n * with information capturing the binding target, and a `parts` array\n * with one or more metadata objects capturing the source(s) of the\n * binding.\n *\n * @param {Element} node Node to parse\n * @param {TemplateInfo} templateInfo Template metadata for current template\n * @param {NodeInfo} nodeInfo Node metadata for current template node\n * @param {string} name Attribute name\n * @param {string} value Attribute value\n * @return {boolean} `true` if the visited node added node-specific\n * metadata to `nodeInfo`\n * @protected\n * @suppress {missingProperties} Interfaces in closure do not inherit statics, but classes do\n * @nocollapse\n */\n static _parseTemplateNodeAttribute(node, templateInfo, nodeInfo, name, value) {\n let parts = this._parseBindings(value, templateInfo);\n if (parts) {\n // Attribute or property\n let origName = name;\n let kind = 'property';\n // The only way we see a capital letter here is if the attr has\n // a capital letter in it per spec. In this case, to make sure\n // this binding works, we go ahead and make the binding to the attribute.\n if (capitalAttributeRegex.test(name)) {\n kind = 'attribute';\n } else if (name[name.length-1] == '$') {\n name = name.slice(0, -1);\n kind = 'attribute';\n }\n // Initialize attribute bindings with any literal parts\n let literal = literalFromParts(parts);\n if (literal && kind == 'attribute') {\n // Ensure a ShadyCSS template scoped style is not removed\n // when a class$ binding's initial literal value is set.\n if (name == 'class' && node.hasAttribute('class')) {\n literal += ' ' + node.getAttribute(name);\n }\n node.setAttribute(name, literal);\n }\n // support disable-upgrade\n if (kind == 'attribute' && origName == 'disable-upgrade$') {\n node.setAttribute(name, '');\n }\n // Clear attribute before removing, since IE won't allow removing\n // `value` attribute if it previously had a value (can't\n // unconditionally set '' before removing since attributes with `$`\n // can't be set using setAttribute)\n if (node.localName === 'input' && origName === 'value') {\n node.setAttribute(origName, '');\n }\n // Remove annotation\n node.removeAttribute(origName);\n // Case hackery: attributes are lower-case, but bind targets\n // (properties) are case sensitive. Gambit is to map dash-case to\n // camel-case: `foo-bar` becomes `fooBar`.\n // Attribute bindings are excepted.\n if (kind === 'property') {\n name = dashToCamelCase(name);\n }\n addBinding(this, templateInfo, nodeInfo, kind, name, parts, literal);\n return true;\n } else {\n // TODO(https://github.com/google/closure-compiler/issues/3240):\n // Change back to just super.methodCall()\n return propertyEffectsBase._parseTemplateNodeAttribute.call(\n this, node, templateInfo, nodeInfo, name, value);\n }\n }\n\n /**\n * Overrides default `TemplateStamp` implementation to add support for\n * binding the properties that a nested template depends on to the template\n * as `_host_<property>`.\n *\n * @param {Node} node Node to parse\n * @param {TemplateInfo} templateInfo Template metadata for current template\n * @param {NodeInfo} nodeInfo Node metadata for current template node\n * @return {boolean} `true` if the visited node added node-specific\n * metadata to `nodeInfo`\n * @protected\n * @suppress {missingProperties} Interfaces in closure do not inherit statics, but classes do\n * @nocollapse\n */\n static _parseTemplateNestedTemplate(node, templateInfo, nodeInfo) {\n // TODO(https://github.com/google/closure-compiler/issues/3240):\n // Change back to just super.methodCall()\n let noted = propertyEffectsBase._parseTemplateNestedTemplate.call(\n this, node, templateInfo, nodeInfo);\n const parent = node.parentNode;\n const nestedTemplateInfo = nodeInfo.templateInfo;\n const isDomIf = parent.localName === 'dom-if';\n const isDomRepeat = parent.localName === 'dom-repeat';\n // Remove nested template and redirect its host bindings & templateInfo\n // onto the parent (dom-if/repeat element)'s nodeInfo\n if (removeNestedTemplates && (isDomIf || isDomRepeat)) {\n parent.removeChild(node);\n // Use the parent's nodeInfo (for the dom-if/repeat) to record the\n // templateInfo, and use that for any host property bindings below\n nodeInfo = nodeInfo.parentInfo;\n nodeInfo.templateInfo = nestedTemplateInfo;\n // Ensure the parent dom-if/repeat is noted since it now may have host\n // bindings; it may not have been if it did not have its own bindings\n nodeInfo.noted = true;\n noted = false;\n }\n // Merge host props into outer template and add bindings\n let hostProps = nestedTemplateInfo.hostProps;\n if (fastDomIf && isDomIf) {\n // `fastDomIf` mode uses runtime-template stamping to add accessors/\n // effects to properties used in its template; as such we don't need to\n // tax the host element with `_host_` bindings for the `dom-if`.\n // However, in the event it is nested in a `dom-repeat`, it is still\n // important that its host properties are added to the\n // TemplateInstance's `hostProps` so that they are forwarded to the\n // TemplateInstance.\n if (hostProps) {\n templateInfo.hostProps =\n Object.assign(templateInfo.hostProps || {}, hostProps);\n // Ensure the dom-if is noted so that it has a __dataHost, since\n // `fastDomIf` uses the host for runtime template stamping; note this\n // was already ensured above in the `removeNestedTemplates` case\n if (!removeNestedTemplates) {\n nodeInfo.parentInfo.noted = true;\n }\n }\n } else {\n let mode = '{';\n for (let source in hostProps) {\n let parts = [{ mode, source, dependencies: [source], hostProp: true }];\n addBinding(this, templateInfo, nodeInfo, 'property', '_host_' + source, parts);\n }\n }\n return noted;\n }\n\n /**\n * Called to parse text in a template (either attribute values or\n * textContent) into binding metadata.\n *\n * Any overrides of this method should return an array of binding part\n * metadata representing one or more bindings found in the provided text\n * and any \"literal\" text in between. Any non-literal parts will be passed\n * to `_evaluateBinding` when any dependencies change. The only required\n * fields of each \"part\" in the returned array are as follows:\n *\n * - `dependencies` - Array containing trigger metadata for each property\n * that should trigger the binding to update\n * - `literal` - String containing text if the part represents a literal;\n * in this case no `dependencies` are needed\n *\n * Additional metadata for use by `_evaluateBinding` may be provided in\n * each part object as needed.\n *\n * The default implementation handles the following types of bindings\n * (one or more may be intermixed with literal strings):\n * - Property binding: `[[prop]]`\n * - Path binding: `[[object.prop]]`\n * - Negated property or path bindings: `[[!prop]]` or `[[!object.prop]]`\n * - Two-way property or path bindings (supports negation):\n * `{{prop}}`, `{{object.prop}}`, `{{!prop}}` or `{{!object.prop}}`\n * - Inline computed method (supports negation):\n * `[[compute(a, 'literal', b)]]`, `[[!compute(a, 'literal', b)]]`\n *\n * The default implementation uses a regular expression for best\n * performance. However, the regular expression uses a white-list of\n * allowed characters in a data-binding, which causes problems for\n * data-bindings that do use characters not in this white-list.\n *\n * Instead of updating the white-list with all allowed characters,\n * there is a StrictBindingParser (see lib/mixins/strict-binding-parser)\n * that uses a state machine instead. This state machine is able to handle\n * all characters. However, it is slightly less performant, therefore we\n * extracted it into a separate optional mixin.\n *\n * @param {string} text Text to parse from attribute or textContent\n * @param {Object} templateInfo Current template metadata\n * @return {Array<!BindingPart>} Array of binding part metadata\n * @protected\n * @nocollapse\n */\n static _parseBindings(text, templateInfo) {\n let parts = [];\n let lastIndex = 0;\n let m;\n // Example: \"literal1{{prop}}literal2[[!compute(foo,bar)]]final\"\n // Regex matches:\n // Iteration 1: Iteration 2:\n // m[1]: '{{' '[['\n // m[2]: '' '!'\n // m[3]: 'prop' 'compute(foo,bar)'\n while ((m = bindingRegex.exec(text)) !== null) {\n // Add literal part\n if (m.index > lastIndex) {\n parts.push({literal: text.slice(lastIndex, m.index)});\n }\n // Add binding part\n let mode = m[1][0];\n let negate = Boolean(m[2]);\n let source = m[3].trim();\n let customEvent = false, notifyEvent = '', colon = -1;\n if (mode == '{' && (colon = source.indexOf('::')) > 0) {\n notifyEvent = source.substring(colon + 2);\n source = source.substring(0, colon);\n customEvent = true;\n }\n let signature = parseMethod(source);\n let dependencies = [];\n if (signature) {\n // Inline computed function\n let {args, methodName} = signature;\n for (let i=0; i<args.length; i++) {\n let arg = args[i];\n if (!arg.literal) {\n dependencies.push(arg);\n }\n }\n let dynamicFns = templateInfo.dynamicFns;\n if (dynamicFns && dynamicFns[methodName] || signature.static) {\n dependencies.push(methodName);\n signature.dynamicFn = true;\n }\n } else {\n // Property or path\n dependencies.push(source);\n }\n parts.push({\n source, mode, negate, customEvent, signature, dependencies,\n event: notifyEvent\n });\n lastIndex = bindingRegex.lastIndex;\n }\n // Add a final literal part\n if (lastIndex && lastIndex < text.length) {\n let literal = text.substring(lastIndex);\n if (literal) {\n parts.push({\n literal: literal\n });\n }\n }\n if (parts.length) {\n return parts;\n } else {\n return null;\n }\n }\n\n /**\n * Called to evaluate a previously parsed binding part based on a set of\n * one or more changed dependencies.\n *\n * @param {!Polymer_PropertyEffects} inst Element that should be used as\n * scope for binding dependencies\n * @param {BindingPart} part Binding part metadata\n * @param {string} path Property/path that triggered this effect\n * @param {Object} props Bag of current property changes\n * @param {Object} oldProps Bag of previous values for changed properties\n * @param {boolean} hasPaths True with `props` contains one or more paths\n * @return {*} Value the binding part evaluated to\n * @protected\n * @nocollapse\n */\n static _evaluateBinding(inst, part, path, props, oldProps, hasPaths) {\n let value;\n if (part.signature) {\n value = runMethodEffect(inst, path, props, oldProps, part.signature);\n } else if (path != part.source) {\n value = get(inst, part.source);\n } else {\n if (hasPaths && isPath(path)) {\n value = get(inst, path);\n } else {\n value = inst.__data[path];\n }\n }\n if (part.negate) {\n value = !value;\n }\n return value;\n }\n\n }\n\n return PropertyEffects;\n});\n\n/**\n * Stack for enqueuing client dom created by a host element.\n *\n * By default elements are flushed via `_flushProperties` when\n * `connectedCallback` is called. Elements attach their client dom to\n * themselves at `ready` time which results from this first flush.\n * This provides an ordering guarantee that the client dom an element\n * creates is flushed before the element itself (i.e. client `ready`\n * fires before host `ready`).\n *\n * However, if `_flushProperties` is called *before* an element is connected,\n * as for example `Templatize` does, this ordering guarantee cannot be\n * satisfied because no elements are connected. (Note: Bound elements that\n * receive data do become enqueued clients and are properly ordered but\n * unbound elements are not.)\n *\n * To maintain the desired \"client before host\" ordering guarantee for this\n * case we rely on the \"host stack. Client nodes registers themselves with\n * the creating host element when created. This ensures that all client dom\n * is readied in the proper order, maintaining the desired guarantee.\n *\n * @private\n */\nconst hostStack = [];\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\nimport '../utils/boot.js';\n\nimport { dedupingMixin } from '../utils/mixin.js';\nimport { register, incrementInstanceCount } from '../utils/telemetry.js';\nimport { PropertiesChanged } from './properties-changed.js';\n\n/**\n * Creates a copy of `props` with each property normalized such that\n * upgraded it is an object with at least a type property { type: Type}.\n *\n * @param {!Object} props Properties to normalize\n * @return {!Object} Copy of input `props` with normalized properties that\n * are in the form {type: Type}\n * @private\n */\nfunction normalizeProperties(props) {\n const output = {};\n for (let p in props) {\n const o = props[p];\n output[p] = (typeof o === 'function') ? {type: o} : o;\n }\n return output;\n}\n\n/**\n * Mixin that provides a minimal starting point to using the PropertiesChanged\n * mixin by providing a mechanism to declare properties in a static\n * getter (e.g. static get properties() { return { foo: String } }). Changes\n * are reported via the `_propertiesChanged` method.\n *\n * This mixin provides no specific support for rendering. Users are expected\n * to create a ShadowRoot and put content into it and update it in whatever\n * way makes sense. This can be done in reaction to properties changing by\n * implementing `_propertiesChanged`.\n *\n * @mixinFunction\n * @polymer\n * @appliesMixin PropertiesChanged\n * @summary Mixin that provides a minimal starting point for using\n * the PropertiesChanged mixin by providing a declarative `properties` object.\n * @template T\n * @param {function(new:T)} superClass Class to apply mixin to.\n * @return {function(new:T)} superClass with mixin applied.\n */\nexport const PropertiesMixin = dedupingMixin(superClass => {\n\n /**\n * @constructor\n * @implements {Polymer_PropertiesChanged}\n * @private\n */\n const base = PropertiesChanged(superClass);\n\n /**\n * Returns the super class constructor for the given class, if it is an\n * instance of the PropertiesMixin.\n *\n * @param {!PropertiesMixinConstructor} constructor PropertiesMixin constructor\n * @return {?PropertiesMixinConstructor} Super class constructor\n */\n function superPropertiesClass(constructor) {\n const superCtor = Object.getPrototypeOf(constructor);\n\n // Note, the `PropertiesMixin` class below only refers to the class\n // generated by this call to the mixin; the instanceof test only works\n // because the mixin is deduped and guaranteed only to apply once, hence\n // all constructors in a proto chain will see the same `PropertiesMixin`\n return (superCtor.prototype instanceof PropertiesMixin) ?\n /** @type {!PropertiesMixinConstructor} */ (superCtor) : null;\n }\n\n /**\n * Returns a memoized version of the `properties` object for the\n * given class. Properties not in object format are converted to at\n * least {type}.\n *\n * @param {PropertiesMixinConstructor} constructor PropertiesMixin constructor\n * @return {Object} Memoized properties object\n */\n function ownProperties(constructor) {\n if (!constructor.hasOwnProperty(JSCompiler_renameProperty('__ownProperties', constructor))) {\n let props = null;\n\n if (constructor.hasOwnProperty(JSCompiler_renameProperty('properties', constructor))) {\n const properties = constructor.properties;\n\n if (properties) {\n props = normalizeProperties(properties);\n }\n }\n\n constructor.__ownProperties = props;\n }\n return constructor.__ownProperties;\n }\n\n /**\n * @polymer\n * @mixinClass\n * @extends {base}\n * @implements {Polymer_PropertiesMixin}\n * @unrestricted\n */\n class PropertiesMixin extends base {\n\n /**\n * Implements standard custom elements getter to observes the attributes\n * listed in `properties`.\n * @suppress {missingProperties} Interfaces in closure do not inherit statics, but classes do\n * @nocollapse\n */\n static get observedAttributes() {\n if (!this.hasOwnProperty(JSCompiler_renameProperty('__observedAttributes', this))) {\n register(this.prototype);\n const props = this._properties;\n this.__observedAttributes = props ? Object.keys(props).map(p => this.prototype._addPropertyToAttributeMap(p)) : [];\n }\n return this.__observedAttributes;\n }\n\n /**\n * Finalizes an element definition, including ensuring any super classes\n * are also finalized. This includes ensuring property\n * accessors exist on the element prototype. This method calls\n * `_finalizeClass` to finalize each constructor in the prototype chain.\n * @return {void}\n * @nocollapse\n */\n static finalize() {\n if (!this.hasOwnProperty(JSCompiler_renameProperty('__finalized', this))) {\n const superCtor = superPropertiesClass(/** @type {!PropertiesMixinConstructor} */(this));\n if (superCtor) {\n superCtor.finalize();\n }\n this.__finalized = true;\n this._finalizeClass();\n }\n }\n\n /**\n * Finalize an element class. This includes ensuring property\n * accessors exist on the element prototype. This method is called by\n * `finalize` and finalizes the class constructor.\n *\n * @protected\n * @nocollapse\n */\n static _finalizeClass() {\n const props = ownProperties(/** @type {!PropertiesMixinConstructor} */(this));\n if (props) {\n /** @type {?} */ (this).createProperties(props);\n }\n }\n\n /**\n * Returns a memoized version of all properties, including those inherited\n * from super classes. Properties not in object format are converted to\n * at least {type}.\n *\n * @return {Object} Object containing properties for this class\n * @protected\n * @nocollapse\n */\n static get _properties() {\n if (!this.hasOwnProperty(\n JSCompiler_renameProperty('__properties', this))) {\n const superCtor = superPropertiesClass(/** @type {!PropertiesMixinConstructor} */(this));\n this.__properties = Object.assign({},\n superCtor && superCtor._properties,\n ownProperties(/** @type {PropertiesMixinConstructor} */(this)));\n }\n return this.__properties;\n }\n\n /**\n * Overrides `PropertiesChanged` method to return type specified in the\n * static `properties` object for the given property.\n * @param {string} name Name of property\n * @return {*} Type to which to deserialize attribute\n *\n * @protected\n * @nocollapse\n */\n static typeForProperty(name) {\n const info = this._properties[name];\n return info && info.type;\n }\n\n /**\n * Overrides `PropertiesChanged` method and adds a call to\n * `finalize` which lazily configures the element's property accessors.\n * @override\n * @return {void}\n */\n _initializeProperties() {\n incrementInstanceCount();\n this.constructor.finalize();\n super._initializeProperties();\n }\n\n /**\n * Called when the element is added to a document.\n * Calls `_enableProperties` to turn on property system from\n * `PropertiesChanged`.\n * @suppress {missingProperties} Super may or may not implement the callback\n * @return {void}\n * @override\n */\n connectedCallback() {\n if (super.connectedCallback) {\n super.connectedCallback();\n }\n this._enableProperties();\n }\n\n /**\n * Called when the element is removed from a document\n * @suppress {missingProperties} Super may or may not implement the callback\n * @return {void}\n * @override\n */\n disconnectedCallback() {\n if (super.disconnectedCallback) {\n super.disconnectedCallback();\n }\n }\n\n }\n\n return PropertiesMixin;\n\n});\n","/**\n * @fileoverview\n * @suppress {checkPrototypalTypes}\n * @license Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt The complete set of authors may be found\n * at http://polymer.github.io/AUTHORS.txt The complete set of contributors may\n * be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by\n * Google as part of the polymer project is also subject to an additional IP\n * rights grant found at http://polymer.github.io/PATENTS.txt\n */\nimport '../utils/boot.js';\n\nimport { rootPath, strictTemplatePolicy, allowTemplateFromDomModule, legacyOptimizations, legacyWarnings, syncInitialRender, supportsAdoptingStyleSheets, useAdoptedStyleSheetsWithBuiltCSS } from '../utils/settings.js';\nimport { dedupingMixin } from '../utils/mixin.js';\nimport { stylesFromTemplate, stylesFromModuleImports } from '../utils/style-gather.js';\nimport { pathFromUrl, resolveCss, resolveUrl } from '../utils/resolve-url.js';\nimport { DomModule } from '../elements/dom-module.js';\nimport { PropertyEffects } from './property-effects.js';\nimport { PropertiesMixin } from './properties-mixin.js';\nimport { wrap } from '../utils/wrap.js';\n\n/**\n * Current Polymer version in Semver notation.\n * @type {string} Semver notation of the current version of Polymer.\n */\nexport const version = '3.5.1';\n\nexport const builtCSS = window.ShadyCSS && window.ShadyCSS['cssBuild'];\n\n/**\n * Element class mixin that provides the core API for Polymer's meta-programming\n * features including template stamping, data-binding, attribute deserialization,\n * and property change observation.\n *\n * Subclassers may provide the following static getters to return metadata\n * used to configure Polymer's features for the class:\n *\n * - `static get is()`: When the template is provided via a `dom-module`,\n * users should return the `dom-module` id from a static `is` getter. If\n * no template is needed or the template is provided directly via the\n * `template` getter, there is no need to define `is` for the element.\n *\n * - `static get template()`: Users may provide the template directly (as\n * opposed to via `dom-module`) by implementing a static `template` getter.\n * The getter must return an `HTMLTemplateElement`.\n *\n * - `static get properties()`: Should return an object describing\n * property-related metadata used by Polymer features (key: property name\n * value: object containing property metadata). Valid keys in per-property\n * metadata include:\n * - `type` (String|Number|Object|Array|...): Used by\n * `attributeChangedCallback` to determine how string-based attributes\n * are deserialized to JavaScript property values.\n * - `notify` (boolean): Causes a change in the property to fire a\n * non-bubbling event called `<property>-changed`. Elements that have\n * enabled two-way binding to the property use this event to observe changes.\n * - `readOnly` (boolean): Creates a getter for the property, but no setter.\n * To set a read-only property, use the private setter method\n * `_setProperty(property, value)`.\n * - `observer` (string): Observer method name that will be called when\n * the property changes. The arguments of the method are\n * `(value, previousValue)`.\n * - `computed` (string): String describing method and dependent properties\n * for computing the value of this property (e.g. `'computeFoo(bar, zot)'`).\n * Computed properties are read-only by default and can only be changed\n * via the return value of the computing method.\n *\n * - `static get observers()`: Array of strings describing multi-property\n * observer methods and their dependent properties (e.g.\n * `'observeABC(a, b, c)'`).\n *\n * The base class provides default implementations for the following standard\n * custom element lifecycle callbacks; users may override these, but should\n * call the super method to ensure\n * - `constructor`: Run when the element is created or upgraded\n * - `connectedCallback`: Run each time the element is connected to the\n * document\n * - `disconnectedCallback`: Run each time the element is disconnected from\n * the document\n * - `attributeChangedCallback`: Run each time an attribute in\n * `observedAttributes` is set or removed (note: this element's default\n * `observedAttributes` implementation will automatically return an array\n * of dash-cased attributes based on `properties`)\n *\n * @mixinFunction\n * @polymer\n * @appliesMixin PropertyEffects\n * @appliesMixin PropertiesMixin\n * @property rootPath {string} Set to the value of `rootPath`,\n * which defaults to the main document path\n * @property importPath {string} Set to the value of the class's static\n * `importPath` property, which defaults to the path of this element's\n * `dom-module` (when `is` is used), but can be overridden for other\n * import strategies.\n * @summary Element class mixin that provides the core API for Polymer's\n * meta-programming features.\n * @template T\n * @param {function(new:T)} superClass Class to apply mixin to.\n * @return {function(new:T)} superClass with mixin applied.\n */\nexport const ElementMixin = dedupingMixin(base => {\n /**\n * @constructor\n * @implements {Polymer_PropertyEffects}\n * @implements {Polymer_PropertiesMixin}\n * @extends {HTMLElement}\n * @private\n */\n const polymerElementBase = PropertiesMixin(PropertyEffects(base));\n\n /**\n * Returns a list of properties with default values.\n * This list is created as an optimization since it is a subset of\n * the list returned from `_properties`.\n * This list is used in `_initializeProperties` to set property defaults.\n *\n * @param {PolymerElementConstructor} constructor Element class\n * @return {PolymerElementProperties} Flattened properties for this class\n * that have default values\n * @private\n */\n function propertyDefaults(constructor) {\n if (!constructor.hasOwnProperty(\n JSCompiler_renameProperty('__propertyDefaults', constructor))) {\n constructor.__propertyDefaults = null;\n let props = constructor._properties;\n for (let p in props) {\n let info = props[p];\n if ('value' in info) {\n constructor.__propertyDefaults = constructor.__propertyDefaults || {};\n constructor.__propertyDefaults[p] = info;\n }\n }\n }\n return constructor.__propertyDefaults;\n }\n\n /**\n * Returns a memoized version of the `observers` array.\n * @param {PolymerElementConstructor} constructor Element class\n * @return {Array} Array containing own observers for the given class\n * @protected\n */\n function ownObservers(constructor) {\n if (!constructor.hasOwnProperty(\n JSCompiler_renameProperty('__ownObservers', constructor))) {\n constructor.__ownObservers =\n constructor.hasOwnProperty(\n JSCompiler_renameProperty('observers', constructor)) ?\n /** @type {PolymerElementConstructor} */ (constructor).observers :\n null;\n }\n return constructor.__ownObservers;\n }\n\n /**\n * Creates effects for a property.\n *\n * Note, once a property has been set to\n * `readOnly`, `computed`, `reflectToAttribute`, or `notify`\n * these values may not be changed. For example, a subclass cannot\n * alter these settings. However, additional `observers` may be added\n * by subclasses.\n *\n * The info object should contain property metadata as follows:\n *\n * * `type`: {function} type to which an attribute matching the property\n * is deserialized. Note the property is camel-cased from a dash-cased\n * attribute. For example, 'foo-bar' attribute is deserialized to a\n * property named 'fooBar'.\n *\n * * `readOnly`: {boolean} creates a readOnly property and\n * makes a private setter for the private of the form '_setFoo' for a\n * property 'foo',\n *\n * * `computed`: {string} creates a computed property. A computed property\n * is also automatically set to `readOnly: true`. The value is calculated\n * by running a method and arguments parsed from the given string. For\n * example 'compute(foo)' will compute a given property when the\n * 'foo' property changes by executing the 'compute' method. This method\n * must return the computed value.\n *\n * * `reflectToAttribute`: {boolean} If true, the property value is reflected\n * to an attribute of the same name. Note, the attribute is dash-cased\n * so a property named 'fooBar' is reflected as 'foo-bar'.\n *\n * * `notify`: {boolean} sends a non-bubbling notification event when\n * the property changes. For example, a property named 'foo' sends an\n * event named 'foo-changed' with `event.detail` set to the value of\n * the property.\n *\n * * observer: {string} name of a method that runs when the property\n * changes. The arguments of the method are (value, previousValue).\n *\n * Note: Users may want control over modifying property\n * effects via subclassing. For example, a user might want to make a\n * reflectToAttribute property not do so in a subclass. We've chosen to\n * disable this because it leads to additional complication.\n * For example, a readOnly effect generates a special setter. If a subclass\n * disables the effect, the setter would fail unexpectedly.\n * Based on feedback, we may want to try to make effects more malleable\n * and/or provide an advanced api for manipulating them.\n *\n * @param {!PolymerElement} proto Element class prototype to add accessors\n * and effects to\n * @param {string} name Name of the property.\n * @param {Object} info Info object from which to create property effects.\n * Supported keys:\n * @param {Object} allProps Flattened map of all properties defined in this\n * element (including inherited properties)\n * @return {void}\n * @private\n */\n function createPropertyFromConfig(proto, name, info, allProps) {\n // computed forces readOnly...\n if (info.computed) {\n info.readOnly = true;\n }\n // Note, since all computed properties are readOnly, this prevents\n // adding additional computed property effects (which leads to a confusing\n // setup where multiple triggers for setting a property)\n // While we do have `hasComputedEffect` this is set on the property's\n // dependencies rather than itself.\n if (info.computed) {\n if (proto._hasReadOnlyEffect(name)) {\n console.warn(`Cannot redefine computed property '${name}'.`);\n } else {\n proto._createComputedProperty(name, info.computed, allProps);\n }\n }\n if (info.readOnly && !proto._hasReadOnlyEffect(name)) {\n proto._createReadOnlyProperty(name, !info.computed);\n } else if (info.readOnly === false && proto._hasReadOnlyEffect(name)) {\n console.warn(`Cannot make readOnly property '${name}' non-readOnly.`);\n }\n if (info.reflectToAttribute && !proto._hasReflectEffect(name)) {\n proto._createReflectedProperty(name);\n } else if (info.reflectToAttribute === false && proto._hasReflectEffect(name)) {\n console.warn(`Cannot make reflected property '${name}' non-reflected.`);\n }\n if (info.notify && !proto._hasNotifyEffect(name)) {\n proto._createNotifyingProperty(name);\n } else if (info.notify === false && proto._hasNotifyEffect(name)) {\n console.warn(`Cannot make notify property '${name}' non-notify.`);\n }\n // always add observer\n if (info.observer) {\n proto._createPropertyObserver(name, info.observer, allProps[info.observer]);\n }\n // always create the mapping from attribute back to property for deserialization.\n proto._addPropertyToAttributeMap(name);\n }\n\n /**\n * Process all style elements in the element template. Styles with the\n * `include` attribute are processed such that any styles in\n * the associated \"style modules\" are included in the element template.\n * @param {PolymerElementConstructor} klass Element class\n * @param {!HTMLTemplateElement} template Template to process\n * @param {string} is Name of element\n * @param {string} baseURI Base URI for element\n * @private\n */\n function processElementStyles(klass, template, is, baseURI) {\n if (!builtCSS) {\n const templateStyles = template.content.querySelectorAll('style');\n const stylesWithImports = stylesFromTemplate(template);\n // insert styles from <link rel=\"import\" type=\"css\"> at the top of the template\n const linkedStyles = stylesFromModuleImports(is);\n const firstTemplateChild = template.content.firstElementChild;\n for (let idx = 0; idx < linkedStyles.length; idx++) {\n let s = linkedStyles[idx];\n s.textContent = klass._processStyleText(s.textContent, baseURI);\n template.content.insertBefore(s, firstTemplateChild);\n }\n // keep track of the last \"concrete\" style in the template we have encountered\n let templateStyleIndex = 0;\n // ensure all gathered styles are actually in this template.\n for (let i = 0; i < stylesWithImports.length; i++) {\n let s = stylesWithImports[i];\n let templateStyle = templateStyles[templateStyleIndex];\n // if the style is not in this template, it's been \"included\" and\n // we put a clone of it in the template before the style that included it\n if (templateStyle !== s) {\n s = s.cloneNode(true);\n templateStyle.parentNode.insertBefore(s, templateStyle);\n } else {\n templateStyleIndex++;\n }\n s.textContent = klass._processStyleText(s.textContent, baseURI);\n }\n }\n if (window.ShadyCSS) {\n window.ShadyCSS.prepareTemplate(template, is);\n }\n // Support for `adoptedStylesheets` relies on using native Shadow DOM\n // and built CSS. Built CSS is required because runtime transformation of\n // `@apply` is not supported. This is because ShadyCSS relies on being able\n // to update a `style` element in the element template and this is\n // removed when using `adoptedStyleSheets`.\n // Note, it would be more efficient to allow style includes to become\n // separate stylesheets; however, because of `@apply` these are\n // potentially not shareable and sharing the ones that could be shared\n // would require some coordination. To keep it simple, all the includes\n // and styles are collapsed into a single shareable stylesheet.\n if (useAdoptedStyleSheetsWithBuiltCSS && builtCSS &&\n supportsAdoptingStyleSheets) {\n // Remove styles in template and make a shareable stylesheet\n const styles = template.content.querySelectorAll('style');\n if (styles) {\n let css = '';\n Array.from(styles).forEach(s => {\n css += s.textContent;\n s.parentNode.removeChild(s);\n });\n klass._styleSheet = new CSSStyleSheet();\n klass._styleSheet.replaceSync(css);\n }\n }\n }\n\n /**\n * Look up template from dom-module for element\n *\n * @param {string} is Element name to look up\n * @return {?HTMLTemplateElement|undefined} Template found in dom module, or\n * undefined if not found\n * @protected\n */\n function getTemplateFromDomModule(is) {\n let template = null;\n // Under strictTemplatePolicy in 3.x+, dom-module lookup is only allowed\n // when opted-in via allowTemplateFromDomModule\n if (is && (!strictTemplatePolicy || allowTemplateFromDomModule)) {\n template = /** @type {?HTMLTemplateElement} */ (\n DomModule.import(is, 'template'));\n // Under strictTemplatePolicy, require any element with an `is`\n // specified to have a dom-module\n if (strictTemplatePolicy && !template) {\n throw new Error(`strictTemplatePolicy: expecting dom-module or null template for ${is}`);\n }\n }\n return template;\n }\n\n /**\n * @polymer\n * @mixinClass\n * @unrestricted\n * @implements {Polymer_ElementMixin}\n * @extends {polymerElementBase}\n */\n class PolymerElement extends polymerElementBase {\n\n /**\n * Current Polymer version in Semver notation.\n * @type {string} Semver notation of the current version of Polymer.\n * @nocollapse\n */\n static get polymerElementVersion() {\n return version;\n }\n\n /**\n * Override of PropertiesMixin _finalizeClass to create observers and\n * find the template.\n * @return {void}\n * @protected\n * @suppress {missingProperties} Interfaces in closure do not inherit statics, but classes do\n * @nocollapse\n */\n static _finalizeClass() {\n // TODO(https://github.com/google/closure-compiler/issues/3240):\n // Change back to just super.methodCall()\n polymerElementBase._finalizeClass.call(this);\n const observers = ownObservers(this);\n if (observers) {\n this.createObservers(observers, this._properties);\n }\n this._prepareTemplate();\n }\n\n /** @nocollapse */\n static _prepareTemplate() {\n // note: create \"working\" template that is finalized at instance time\n let template = /** @type {PolymerElementConstructor} */ (this).template;\n if (template) {\n if (typeof template === 'string') {\n console.error('template getter must return HTMLTemplateElement');\n template = null;\n } else if (!legacyOptimizations) {\n template = template.cloneNode(true);\n }\n }\n\n /** @override */\n this.prototype._template = template;\n }\n\n /**\n * Override of PropertiesChanged createProperties to create accessors\n * and property effects for all of the properties.\n * @param {!Object} props .\n * @return {void}\n * @protected\n * @nocollapse\n */\n static createProperties(props) {\n for (let p in props) {\n createPropertyFromConfig(\n /** @type {?} */ (this.prototype), p, props[p], props);\n }\n }\n\n /**\n * Creates observers for the given `observers` array.\n * Leverages `PropertyEffects` to create observers.\n * @param {Object} observers Array of observer descriptors for\n * this class\n * @param {Object} dynamicFns Object containing keys for any properties\n * that are functions and should trigger the effect when the function\n * reference is changed\n * @return {void}\n * @protected\n * @nocollapse\n */\n static createObservers(observers, dynamicFns) {\n const proto = this.prototype;\n for (let i=0; i < observers.length; i++) {\n proto._createMethodObserver(observers[i], dynamicFns);\n }\n }\n\n /**\n * Returns the template that will be stamped into this element's shadow root.\n *\n * If a `static get is()` getter is defined, the default implementation will\n * return the first `<template>` in a `dom-module` whose `id` matches this\n * element's `is` (note that a `_template` property on the class prototype\n * takes precedence over the `dom-module` template, to maintain legacy\n * element semantics; a subclass will subsequently fall back to its super\n * class template if neither a `prototype._template` or a `dom-module` for\n * the class's `is` was found).\n *\n * Users may override this getter to return an arbitrary template\n * (in which case the `is` getter is unnecessary). The template returned\n * must be an `HTMLTemplateElement`.\n *\n * Note that when subclassing, if the super class overrode the default\n * implementation and the subclass would like to provide an alternate\n * template via a `dom-module`, it should override this getter and\n * return `DomModule.import(this.is, 'template')`.\n *\n * If a subclass would like to modify the super class template, it should\n * clone it rather than modify it in place. If the getter does expensive\n * work such as cloning/modifying a template, it should memoize the\n * template for maximum performance:\n *\n * let memoizedTemplate;\n * class MySubClass extends MySuperClass {\n * static get template() {\n * if (!memoizedTemplate) {\n * memoizedTemplate = super.template.cloneNode(true);\n * let subContent = document.createElement('div');\n * subContent.textContent = 'This came from MySubClass';\n * memoizedTemplate.content.appendChild(subContent);\n * }\n * return memoizedTemplate;\n * }\n * }\n *\n * @return {!HTMLTemplateElement|string} Template to be stamped\n * @nocollapse\n */\n static get template() {\n // Explanation of template-related properties:\n // - constructor.template (this getter): the template for the class.\n // This can come from the prototype (for legacy elements), from a\n // dom-module, or from the super class's template (or can be overridden\n // altogether by the user)\n // - constructor._template: memoized version of constructor.template\n // - prototype._template: working template for the element, which will be\n // parsed and modified in place. It is a cloned version of\n // constructor.template, saved in _finalizeClass(). Note that before\n // this getter is called, for legacy elements this could be from a\n // _template field on the info object passed to Polymer(), a behavior,\n // or set in registered(); once the static getter runs, a clone of it\n // will overwrite it on the prototype as the working template.\n if (!this.hasOwnProperty(JSCompiler_renameProperty('_template', this))) {\n let protoTemplate = this.prototype.hasOwnProperty(\n JSCompiler_renameProperty('_template', this.prototype)) ?\n this.prototype._template : undefined;\n // Accept a function for the legacy Polymer({_template:...}) field for\n // lazy parsing\n if (typeof protoTemplate === 'function') {\n protoTemplate = protoTemplate();\n }\n this._template =\n // If user has put template on prototype (e.g. in legacy via registered\n // callback or info object), prefer that first. Note that `null` is\n // used as a sentinel to indicate \"no template\" and can be used to\n // override a super template, whereas `undefined` is used as a\n // sentinel to mean \"fall-back to default template lookup\" via\n // dom-module and/or super.template.\n protoTemplate !== undefined ? protoTemplate :\n // Look in dom-module associated with this element's is\n ((this.hasOwnProperty(JSCompiler_renameProperty('is', this)) &&\n (getTemplateFromDomModule(/** @type {PolymerElementConstructor}*/ (this).is))) ||\n // Next look for superclass template (call the super impl this\n // way so that `this` points to the superclass)\n Object.getPrototypeOf(/** @type {PolymerElementConstructor}*/ (this).prototype).constructor.template);\n }\n return this._template;\n }\n\n /**\n * Set the template.\n *\n * @param {!HTMLTemplateElement|string} value Template to set.\n * @nocollapse\n */\n static set template(value) {\n this._template = value;\n }\n\n /**\n * Path matching the url from which the element was imported.\n *\n * This path is used to resolve url's in template style cssText.\n * The `importPath` property is also set on element instances and can be\n * used to create bindings relative to the import path.\n *\n * For elements defined in ES modules, users should implement\n * `static get importMeta() { return import.meta; }`, and the default\n * implementation of `importPath` will return `import.meta.url`'s path.\n * For elements defined in HTML imports, this getter will return the path\n * to the document containing a `dom-module` element matching this\n * element's static `is` property.\n *\n * Note, this path should contain a trailing `/`.\n *\n * @return {string} The import path for this element class\n * @suppress {missingProperties}\n * @nocollapse\n */\n static get importPath() {\n if (!this.hasOwnProperty(JSCompiler_renameProperty('_importPath', this))) {\n const meta = this.importMeta;\n if (meta) {\n this._importPath = pathFromUrl(meta.url);\n } else {\n const module = DomModule.import(/** @type {PolymerElementConstructor} */ (this).is);\n this._importPath = (module && module.assetpath) ||\n Object.getPrototypeOf(/** @type {PolymerElementConstructor}*/ (this).prototype).constructor.importPath;\n }\n }\n return this._importPath;\n }\n\n constructor() {\n super();\n /** @type {HTMLTemplateElement} */\n this._template;\n /** @type {string} */\n this._importPath;\n /** @type {string} */\n this.rootPath;\n /** @type {string} */\n this.importPath;\n /** @type {StampedTemplate | HTMLElement | ShadowRoot} */\n this.root;\n /** @type {!Object<string, !Element>} */\n this.$;\n }\n\n /**\n * Overrides the default `PropertyAccessors` to ensure class\n * metaprogramming related to property accessors and effects has\n * completed (calls `finalize`).\n *\n * It also initializes any property defaults provided via `value` in\n * `properties` metadata.\n *\n * @return {void}\n * @override\n * @suppress {invalidCasts,missingProperties} go/missingfnprops\n */\n _initializeProperties() {\n this.constructor.finalize();\n // note: finalize template when we have access to `localName` to\n // avoid dependence on `is` for polyfilling styling.\n this.constructor._finalizeTemplate(/** @type {!HTMLElement} */(this).localName);\n super._initializeProperties();\n // set path defaults\n this.rootPath = rootPath;\n this.importPath = this.constructor.importPath;\n // apply property defaults...\n let p$ = propertyDefaults(this.constructor);\n if (!p$) {\n return;\n }\n for (let p in p$) {\n let info = p$[p];\n if (this._canApplyPropertyDefault(p)) {\n let value = typeof info.value == 'function' ?\n info.value.call(this) :\n info.value;\n // Set via `_setProperty` if there is an accessor, to enable\n // initializing readOnly property defaults\n if (this._hasAccessor(p)) {\n this._setPendingProperty(p, value, true);\n } else {\n this[p] = value;\n }\n }\n }\n }\n\n /**\n * Determines if a property dfeault can be applied. For example, this\n * prevents a default from being applied when a property that has no\n * accessor is overridden by its host before upgrade (e.g. via a binding).\n * @override\n * @param {string} property Name of the property\n * @return {boolean} Returns true if the property default can be applied.\n */\n _canApplyPropertyDefault(property) {\n return !this.hasOwnProperty(property);\n }\n\n /**\n * Gather style text for a style element in the template.\n *\n * @param {string} cssText Text containing styling to process\n * @param {string} baseURI Base URI to rebase CSS paths against\n * @return {string} The processed CSS text\n * @protected\n * @nocollapse\n */\n static _processStyleText(cssText, baseURI) {\n return resolveCss(cssText, baseURI);\n }\n\n /**\n * Configures an element `proto` to function with a given `template`.\n * The element name `is` and extends `ext` must be specified for ShadyCSS\n * style scoping.\n *\n * @param {string} is Tag name (or type extension name) for this element\n * @return {void}\n * @protected\n * @nocollapse\n */\n static _finalizeTemplate(is) {\n /** @const {HTMLTemplateElement} */\n const template = this.prototype._template;\n if (template && !template.__polymerFinalized) {\n template.__polymerFinalized = true;\n const importPath = this.importPath;\n const baseURI = importPath ? resolveUrl(importPath) : '';\n // e.g. support `include=\"module-name\"`, and ShadyCSS\n processElementStyles(this, template, is, baseURI);\n this.prototype._bindTemplate(template);\n }\n }\n\n /**\n * Provides a default implementation of the standard Custom Elements\n * `connectedCallback`.\n *\n * The default implementation enables the property effects system and\n * flushes any pending properties, and updates shimmed CSS properties\n * when using the ShadyCSS scoping/custom properties polyfill.\n *\n * @override\n * @suppress {missingProperties, invalidCasts} Super may or may not\n * implement the callback\n * @return {void}\n */\n connectedCallback() {\n if (window.ShadyCSS && this._template) {\n window.ShadyCSS.styleElement(/** @type {!HTMLElement} */(this));\n }\n super.connectedCallback();\n }\n\n /**\n * Stamps the element template.\n *\n * @return {void}\n * @override\n */\n ready() {\n if (this._template) {\n this.root = this._stampTemplate(this._template);\n this.$ = this.root.$;\n }\n super.ready();\n }\n\n /**\n * Implements `PropertyEffects`'s `_readyClients` call. Attaches\n * element dom by calling `_attachDom` with the dom stamped from the\n * element's template via `_stampTemplate`. Note that this allows\n * client dom to be attached to the element prior to any observers\n * running.\n *\n * @return {void}\n * @override\n */\n _readyClients() {\n if (this._template) {\n this.root = this._attachDom(/** @type {StampedTemplate} */(this.root));\n }\n // The super._readyClients here sets the clients initialized flag.\n // We must wait to do this until after client dom is created/attached\n // so that this flag can be checked to prevent notifications fired\n // during this process from being handled before clients are ready.\n super._readyClients();\n }\n\n\n /**\n * Attaches an element's stamped dom to itself. By default,\n * this method creates a `shadowRoot` and adds the dom to it.\n * However, this method may be overridden to allow an element\n * to put its dom in another location.\n *\n * @override\n * @throws {Error}\n * @suppress {missingReturn}\n * @param {StampedTemplate} dom to attach to the element.\n * @return {ShadowRoot} node to which the dom has been attached.\n */\n _attachDom(dom) {\n const n = wrap(this);\n if (n.attachShadow) {\n if (dom) {\n if (!n.shadowRoot) {\n n.attachShadow({mode: 'open', shadyUpgradeFragment: dom});\n n.shadowRoot.appendChild(dom);\n // When `adoptedStyleSheets` is supported a stylesheet is made\n // available on the element constructor.\n if (this.constructor._styleSheet) {\n n.shadowRoot.adoptedStyleSheets = [this.constructor._styleSheet];\n }\n }\n if (syncInitialRender && window.ShadyDOM) {\n window.ShadyDOM.flushInitial(n.shadowRoot);\n }\n return n.shadowRoot;\n }\n return null;\n } else {\n throw new Error('ShadowDOM not available. ' +\n // TODO(sorvell): move to compile-time conditional when supported\n 'PolymerElement can create dom as children instead of in ' +\n 'ShadowDOM by setting `this.root = this;\\` before \\`ready\\`.');\n }\n }\n\n /**\n * When using the ShadyCSS scoping and custom property shim, causes all\n * shimmed styles in this element (and its subtree) to be updated\n * based on current custom property values.\n *\n * The optional parameter overrides inline custom property styles with an\n * object of properties where the keys are CSS properties, and the values\n * are strings.\n *\n * Example: `this.updateStyles({'--color': 'blue'})`\n *\n * These properties are retained unless a value of `null` is set.\n *\n * Note: This function does not support updating CSS mixins.\n * You can not dynamically change the value of an `@apply`.\n *\n * @override\n * @param {Object=} properties Bag of custom property key/values to\n * apply to this element.\n * @return {void}\n * @suppress {invalidCasts}\n */\n updateStyles(properties) {\n if (window.ShadyCSS) {\n window.ShadyCSS.styleSubtree(/** @type {!HTMLElement} */(this), properties);\n }\n }\n\n /**\n * Rewrites a given URL relative to a base URL. The base URL defaults to\n * the original location of the document containing the `dom-module` for\n * this element. This method will return the same URL before and after\n * bundling.\n *\n * Note that this function performs no resolution for URLs that start\n * with `/` (absolute URLs) or `#` (hash identifiers). For general purpose\n * URL resolution, use `window.URL`.\n *\n * @override\n * @param {string} url URL to resolve.\n * @param {string=} base Optional base URL to resolve against, defaults\n * to the element's `importPath`\n * @return {string} Rewritten URL relative to base\n */\n resolveUrl(url, base) {\n if (!base && this.importPath) {\n base = resolveUrl(this.importPath);\n }\n return resolveUrl(url, base);\n }\n\n /**\n * Overrides `PropertyEffects` to add map of dynamic functions on\n * template info, for consumption by `PropertyEffects` template binding\n * code. This map determines which method templates should have accessors\n * created for them.\n *\n * @param {!HTMLTemplateElement} template Template\n * @param {!TemplateInfo} templateInfo Template metadata for current template\n * @param {!NodeInfo} nodeInfo Node metadata for current template.\n * @return {boolean} .\n * @suppress {missingProperties} Interfaces in closure do not inherit statics, but classes do\n * @nocollapse\n */\n static _parseTemplateContent(template, templateInfo, nodeInfo) {\n templateInfo.dynamicFns = templateInfo.dynamicFns || this._properties;\n // TODO(https://github.com/google/closure-compiler/issues/3240):\n // Change back to just super.methodCall()\n return polymerElementBase._parseTemplateContent.call(\n this, template, templateInfo, nodeInfo);\n }\n\n /**\n * Overrides `PropertyEffects` to warn on use of undeclared properties in\n * template.\n *\n * @param {Object} templateInfo Template metadata to add effect to\n * @param {string} prop Property that should trigger the effect\n * @param {Object=} effect Effect metadata object\n * @return {void}\n * @protected\n * @suppress {missingProperties} Interfaces in closure do not inherit statics, but classes do\n * @nocollapse\n */\n static _addTemplatePropertyEffect(templateInfo, prop, effect) {\n // Warn if properties are used in template without being declared.\n // Properties must be listed in `properties` to be included in\n // `observedAttributes` since CE V1 reads that at registration time, and\n // since we want to keep template parsing lazy, we can't automatically\n // add undeclared properties used in templates to `observedAttributes`.\n // The warning is only enabled in `legacyOptimizations` mode, since\n // we don't want to spam existing users who might have adopted the\n // shorthand when attribute deserialization is not important.\n if (legacyWarnings && !(prop in this._properties) &&\n // Methods used in templates with no dependencies (or only literal\n // dependencies) become accessors with template effects; ignore these\n !(effect.info.part.signature && effect.info.part.signature.static) &&\n // Warnings for bindings added to nested templates are handled by\n // templatizer so ignore both the host-to-template bindings\n // (`hostProp`) and TemplateInstance-to-child bindings\n // (`nestedTemplate`)\n !effect.info.part.hostProp && !templateInfo.nestedTemplate) {\n console.warn(`Property '${prop}' used in template but not declared in 'properties'; ` +\n `attribute will not be observed.`);\n }\n // TODO(https://github.com/google/closure-compiler/issues/3240):\n // Change back to just super.methodCall()\n return polymerElementBase._addTemplatePropertyEffect.call(\n this, templateInfo, prop, effect);\n }\n\n }\n\n return PolymerElement;\n});\n\n/**\n * When using the ShadyCSS scoping and custom property shim, causes all\n * shimmed `styles` (via `custom-style`) in the document (and its subtree)\n * to be updated based on current custom property values.\n *\n * The optional parameter overrides inline custom property styles with an\n * object of properties where the keys are CSS properties, and the values\n * are strings.\n *\n * Example: `updateStyles({'--color': 'blue'})`\n *\n * These properties are retained unless a value of `null` is set.\n *\n * @param {Object=} props Bag of custom property key/values to\n * apply to the document.\n * @return {void}\n */\nexport const updateStyles = function(props) {\n if (window.ShadyCSS) {\n window.ShadyCSS.styleDocument(props);\n }\n};\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nimport { ElementMixin, version } from './lib/mixins/element-mixin.js';\nexport { html } from './lib/utils/html-tag.js';\n\nexport { version };\n\n/**\n * Base class that provides the core API for Polymer's meta-programming\n * features including template stamping, data-binding, attribute deserialization,\n * and property change observation.\n *\n * @customElement\n * @polymer\n * @constructor\n * @implements {Polymer_ElementMixin}\n * @extends HTMLElement\n * @appliesMixin ElementMixin\n * @summary Custom element base class that provides the core API for Polymer's\n * key meta-programming features including template stamping, data-binding,\n * attribute deserialization, and property change observation\n */\nexport const PolymerElement = ElementMixin(HTMLElement);\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\nimport './boot.js';\n\nimport './mixin.js';\nimport './async.js';\n\n/**\n * @summary Collapse multiple callbacks into one invocation after a timer.\n */\nexport class Debouncer {\n constructor() {\n this._asyncModule = null;\n this._callback = null;\n this._timer = null;\n }\n /**\n * Sets the scheduler; that is, a module with the Async interface,\n * a callback and optional arguments to be passed to the run function\n * from the async module.\n *\n * @param {!AsyncInterface} asyncModule Object with Async interface.\n * @param {function()} callback Callback to run.\n * @return {void}\n */\n setConfig(asyncModule, callback) {\n this._asyncModule = asyncModule;\n this._callback = callback;\n this._timer = this._asyncModule.run(() => {\n this._timer = null;\n debouncerQueue.delete(this);\n this._callback();\n });\n }\n /**\n * Cancels an active debouncer and returns a reference to itself.\n *\n * @return {void}\n */\n cancel() {\n if (this.isActive()) {\n this._cancelAsync();\n // Canceling a debouncer removes its spot from the flush queue,\n // so if a debouncer is manually canceled and re-debounced, it\n // will reset its flush order (this is a very minor difference from 1.x)\n // Re-debouncing via the `debounce` API retains the 1.x FIFO flush order\n debouncerQueue.delete(this);\n }\n }\n /**\n * Cancels a debouncer's async callback.\n *\n * @return {void}\n */\n _cancelAsync() {\n if (this.isActive()) {\n this._asyncModule.cancel(/** @type {number} */(this._timer));\n this._timer = null;\n }\n }\n /**\n * Flushes an active debouncer and returns a reference to itself.\n *\n * @return {void}\n */\n flush() {\n if (this.isActive()) {\n this.cancel();\n this._callback();\n }\n }\n /**\n * Returns true if the debouncer is active.\n *\n * @return {boolean} True if active.\n */\n isActive() {\n return this._timer != null;\n }\n /**\n * Creates a debouncer if no debouncer is passed as a parameter\n * or it cancels an active debouncer otherwise. The following\n * example shows how a debouncer can be called multiple times within a\n * microtask and \"debounced\" such that the provided callback function is\n * called once. Add this method to a custom element:\n *\n * ```js\n * import {microTask} from '@polymer/polymer/lib/utils/async.js';\n * import {Debouncer} from '@polymer/polymer/lib/utils/debounce.js';\n * // ...\n *\n * _debounceWork() {\n * this._debounceJob = Debouncer.debounce(this._debounceJob,\n * microTask, () => this._doWork());\n * }\n * ```\n *\n * If the `_debounceWork` method is called multiple times within the same\n * microtask, the `_doWork` function will be called only once at the next\n * microtask checkpoint.\n *\n * Note: In testing it is often convenient to avoid asynchrony. To accomplish\n * this with a debouncer, you can use `enqueueDebouncer` and\n * `flush`. For example, extend the above example by adding\n * `enqueueDebouncer(this._debounceJob)` at the end of the\n * `_debounceWork` method. Then in a test, call `flush` to ensure\n * the debouncer has completed.\n *\n * @param {Debouncer?} debouncer Debouncer object.\n * @param {!AsyncInterface} asyncModule Object with Async interface\n * @param {function()} callback Callback to run.\n * @return {!Debouncer} Returns a debouncer object.\n */\n static debounce(debouncer, asyncModule, callback) {\n if (debouncer instanceof Debouncer) {\n // Cancel the async callback, but leave in debouncerQueue if it was\n // enqueued, to maintain 1.x flush order\n debouncer._cancelAsync();\n } else {\n debouncer = new Debouncer();\n }\n debouncer.setConfig(asyncModule, callback);\n return debouncer;\n }\n}\n\nlet debouncerQueue = new Set();\n\n/**\n * Adds a `Debouncer` to a list of globally flushable tasks.\n *\n * @param {!Debouncer} debouncer Debouncer to enqueue\n * @return {void}\n */\nexport const enqueueDebouncer = function(debouncer) {\n debouncerQueue.add(debouncer);\n};\n\n/**\n * Flushes any enqueued debouncers\n *\n * @return {boolean} Returns whether any debouncers were flushed\n */\nexport const flushDebouncers = function() {\n const didFlush = Boolean(debouncerQueue.size);\n // If new debouncers are added while flushing, Set.forEach will ensure\n // newly added ones are also flushed\n debouncerQueue.forEach(debouncer => {\n try {\n debouncer.flush();\n } catch(e) {\n setTimeout(() => {\n throw e;\n });\n }\n });\n return didFlush;\n};","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n/**\n * @fileoverview\n *\n * Module for adding listeners to a node for the following normalized\n * cross-platform \"gesture\" events:\n * - `down` - mouse or touch went down\n * - `up` - mouse or touch went up\n * - `tap` - mouse click or finger tap\n * - `track` - mouse drag or touch move\n *\n * @summary Module for adding cross-platform gesture event listeners.\n */\n\nimport './boot.js';\n\nimport { timeOut, microTask } from './async.js';\nimport { Debouncer } from './debounce.js';\nimport { passiveTouchGestures, cancelSyntheticClickEvents } from './settings.js';\nimport { wrap } from './wrap.js';\n\n// detect native touch action support\nlet HAS_NATIVE_TA = typeof document.head.style.touchAction === 'string';\nlet GESTURE_KEY = '__polymerGestures';\nlet HANDLED_OBJ = '__polymerGesturesHandled';\nlet TOUCH_ACTION = '__polymerGesturesTouchAction';\n// radius for tap and track\nlet TAP_DISTANCE = 25;\nlet TRACK_DISTANCE = 5;\n// number of last N track positions to keep\nlet TRACK_LENGTH = 2;\n\n// Disabling \"mouse\" handlers for 2500ms is enough\nlet MOUSE_TIMEOUT = 2500;\nlet MOUSE_EVENTS = ['mousedown', 'mousemove', 'mouseup', 'click'];\n// an array of bitmask values for mapping MouseEvent.which to MouseEvent.buttons\nlet MOUSE_WHICH_TO_BUTTONS = [0, 1, 4, 2];\nlet MOUSE_HAS_BUTTONS = (function() {\n try {\n return new MouseEvent('test', {buttons: 1}).buttons === 1;\n } catch (e) {\n return false;\n }\n})();\n\n/**\n * @param {string} name Possible mouse event name\n * @return {boolean} true if mouse event, false if not\n */\nfunction isMouseEvent(name) {\n return MOUSE_EVENTS.indexOf(name) > -1;\n}\n\n/* eslint no-empty: [\"error\", { \"allowEmptyCatch\": true }] */\n// check for passive event listeners\nlet supportsPassive = false;\n(function() {\n try {\n let opts = Object.defineProperty({}, 'passive', {get() {supportsPassive = true;}});\n window.addEventListener('test', null, opts);\n window.removeEventListener('test', null, opts);\n } catch(e) {}\n})();\n\n/**\n * Generate settings for event listeners, dependant on `passiveTouchGestures`\n *\n * @param {string} eventName Event name to determine if `{passive}` option is\n * needed\n * @return {{passive: boolean} | undefined} Options to use for addEventListener\n * and removeEventListener\n */\nfunction PASSIVE_TOUCH(eventName) {\n if (isMouseEvent(eventName) || eventName === 'touchend') {\n return;\n }\n if (HAS_NATIVE_TA && supportsPassive && passiveTouchGestures) {\n return {passive: true};\n } else {\n return;\n }\n}\n\n// Check for touch-only devices\nlet IS_TOUCH_ONLY = navigator.userAgent.match(/iP(?:[oa]d|hone)|Android/);\n\n// keep track of any labels hit by the mouseCanceller\n/** @type {!Array<!HTMLLabelElement>} */\nconst clickedLabels = [];\n\n/** @type {!Object<boolean>} */\nconst labellable = {\n 'button': true,\n 'input': true,\n 'keygen': true,\n 'meter': true,\n 'output': true,\n 'textarea': true,\n 'progress': true,\n 'select': true\n};\n\n// Defined at https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#enabling-and-disabling-form-controls:-the-disabled-attribute\n/** @type {!Object<boolean>} */\nconst canBeDisabled = {\n 'button': true,\n 'command': true,\n 'fieldset': true,\n 'input': true,\n 'keygen': true,\n 'optgroup': true,\n 'option': true,\n 'select': true,\n 'textarea': true\n};\n\n/**\n * @param {HTMLElement} el Element to check labelling status\n * @return {boolean} element can have labels\n */\nfunction canBeLabelled(el) {\n return labellable[el.localName] || false;\n}\n\n/**\n * @param {HTMLElement} el Element that may be labelled.\n * @return {!Array<!HTMLLabelElement>} Relevant label for `el`\n */\nfunction matchingLabels(el) {\n let labels = Array.prototype.slice.call(/** @type {HTMLInputElement} */(el).labels || []);\n // IE doesn't have `labels` and Safari doesn't populate `labels`\n // if element is in a shadowroot.\n // In this instance, finding the non-ancestor labels is enough,\n // as the mouseCancellor code will handle ancstor labels\n if (!labels.length) {\n labels = [];\n try {\n let root = el.getRootNode();\n // if there is an id on `el`, check for all labels with a matching `for` attribute\n if (el.id) {\n let matching = root.querySelectorAll(`label[for = '${el.id}']`);\n for (let i = 0; i < matching.length; i++) {\n labels.push(/** @type {!HTMLLabelElement} */(matching[i]));\n }\n }\n } catch (e) {\n // Either:\n // 1. el.getRootNode() failed.\n // 2. el.id cannot be used in `querySelectorAll`\n // In both cases, do nothing.\n }\n }\n return labels;\n}\n\n// touch will make synthetic mouse events\n// `preventDefault` on touchend will cancel them,\n// but this breaks `<input>` focus and link clicks\n// disable mouse handlers for MOUSE_TIMEOUT ms after\n// a touchend to ignore synthetic mouse events\nlet mouseCanceller = function(mouseEvent) {\n // Check for sourceCapabilities, used to distinguish synthetic events\n // if mouseEvent did not come from a device that fires touch events,\n // it was made by a real mouse and should be counted\n // http://wicg.github.io/InputDeviceCapabilities/#dom-inputdevicecapabilities-firestouchevents\n let sc = mouseEvent.sourceCapabilities;\n if (sc && !sc.firesTouchEvents) {\n return;\n }\n // skip synthetic mouse events\n mouseEvent[HANDLED_OBJ] = {skip: true};\n // disable \"ghost clicks\"\n if (mouseEvent.type === 'click') {\n let clickFromLabel = false;\n let path = getComposedPath(mouseEvent);\n for (let i = 0; i < path.length; i++) {\n if (path[i].nodeType === Node.ELEMENT_NODE) {\n if (path[i].localName === 'label') {\n clickedLabels.push(/** @type {!HTMLLabelElement} */ (path[i]));\n } else if (canBeLabelled(/** @type {!HTMLElement} */ (path[i]))) {\n let ownerLabels =\n matchingLabels(/** @type {!HTMLElement} */ (path[i]));\n // check if one of the clicked labels is labelling this element\n for (let j = 0; j < ownerLabels.length; j++) {\n clickFromLabel = clickFromLabel || clickedLabels.indexOf(ownerLabels[j]) > -1;\n }\n }\n }\n if (path[i] === POINTERSTATE.mouse.target) {\n return;\n }\n }\n // if one of the clicked labels was labelling the target element,\n // this is not a ghost click\n if (clickFromLabel) {\n return;\n }\n mouseEvent.preventDefault();\n mouseEvent.stopPropagation();\n }\n};\n\n/**\n * @param {boolean=} setup True to add, false to remove.\n * @return {void}\n */\nfunction setupTeardownMouseCanceller(setup) {\n let events = IS_TOUCH_ONLY ? ['click'] : MOUSE_EVENTS;\n for (let i = 0, en; i < events.length; i++) {\n en = events[i];\n if (setup) {\n // reset clickLabels array\n clickedLabels.length = 0;\n document.addEventListener(en, mouseCanceller, true);\n } else {\n document.removeEventListener(en, mouseCanceller, true);\n }\n }\n}\n\nfunction ignoreMouse(e) {\n if (!cancelSyntheticClickEvents) {\n return;\n }\n if (!POINTERSTATE.mouse.mouseIgnoreJob) {\n setupTeardownMouseCanceller(true);\n }\n let unset = function() {\n setupTeardownMouseCanceller();\n POINTERSTATE.mouse.target = null;\n POINTERSTATE.mouse.mouseIgnoreJob = null;\n };\n POINTERSTATE.mouse.target = getComposedPath(e)[0];\n POINTERSTATE.mouse.mouseIgnoreJob = Debouncer.debounce(\n POINTERSTATE.mouse.mouseIgnoreJob\n , timeOut.after(MOUSE_TIMEOUT)\n , unset);\n}\n\n/**\n * @param {MouseEvent} ev event to test for left mouse button down\n * @return {boolean} has left mouse button down\n */\nfunction hasLeftMouseButton(ev) {\n let type = ev.type;\n // exit early if the event is not a mouse event\n if (!isMouseEvent(type)) {\n return false;\n }\n // ev.button is not reliable for mousemove (0 is overloaded as both left button and no buttons)\n // instead we use ev.buttons (bitmask of buttons) or fall back to ev.which (deprecated, 0 for no buttons, 1 for left button)\n if (type === 'mousemove') {\n // allow undefined for testing events\n let buttons = ev.buttons === undefined ? 1 : ev.buttons;\n if ((ev instanceof window.MouseEvent) && !MOUSE_HAS_BUTTONS) {\n buttons = MOUSE_WHICH_TO_BUTTONS[ev.which] || 0;\n }\n // buttons is a bitmask, check that the left button bit is set (1)\n return Boolean(buttons & 1);\n } else {\n // allow undefined for testing events\n let button = ev.button === undefined ? 0 : ev.button;\n // ev.button is 0 in mousedown/mouseup/click for left button activation\n return button === 0;\n }\n}\n\nfunction isSyntheticClick(ev) {\n if (ev.type === 'click') {\n // ev.detail is 0 for HTMLElement.click in most browsers\n if (ev.detail === 0) {\n return true;\n }\n // in the worst case, check that the x/y position of the click is within\n // the bounding box of the target of the event\n // Thanks IE 10 >:(\n let t = _findOriginalTarget(ev);\n // make sure the target of the event is an element so we can use getBoundingClientRect,\n // if not, just assume it is a synthetic click\n if (!t.nodeType || /** @type {Element} */(t).nodeType !== Node.ELEMENT_NODE) {\n return true;\n }\n let bcr = /** @type {Element} */(t).getBoundingClientRect();\n // use page x/y to account for scrolling\n let x = ev.pageX, y = ev.pageY;\n // ev is a synthetic click if the position is outside the bounding box of the target\n return !((x >= bcr.left && x <= bcr.right) && (y >= bcr.top && y <= bcr.bottom));\n }\n return false;\n}\n\nlet POINTERSTATE = {\n mouse: {\n target: null,\n mouseIgnoreJob: null\n },\n touch: {\n x: 0,\n y: 0,\n id: -1,\n scrollDecided: false\n }\n};\n\nfunction firstTouchAction(ev) {\n let ta = 'auto';\n let path = getComposedPath(ev);\n for (let i = 0, n; i < path.length; i++) {\n n = path[i];\n if (n[TOUCH_ACTION]) {\n ta = n[TOUCH_ACTION];\n break;\n }\n }\n return ta;\n}\n\nfunction trackDocument(stateObj, movefn, upfn) {\n stateObj.movefn = movefn;\n stateObj.upfn = upfn;\n document.addEventListener('mousemove', movefn);\n document.addEventListener('mouseup', upfn);\n}\n\nfunction untrackDocument(stateObj) {\n document.removeEventListener('mousemove', stateObj.movefn);\n document.removeEventListener('mouseup', stateObj.upfn);\n stateObj.movefn = null;\n stateObj.upfn = null;\n}\n\nif (cancelSyntheticClickEvents) {\n // use a document-wide touchend listener to start the ghost-click prevention mechanism\n // Use passive event listeners, if supported, to not affect scrolling performance\n document.addEventListener('touchend', ignoreMouse, supportsPassive ? {passive: true} : false);\n}\n\n/**\n * Returns the composedPath for the given event.\n * @param {Event} event to process\n * @return {!Array<!EventTarget>} Path of the event\n */\nconst getComposedPath = window.ShadyDOM && window.ShadyDOM.noPatch ?\n window.ShadyDOM.composedPath :\n (event) => event.composedPath && event.composedPath() || [];\n\n/** @type {!Object<string, !GestureRecognizer>} */\nexport const gestures = {};\n\n/** @type {!Array<!GestureRecognizer>} */\nexport const recognizers = [];\n\n/**\n * Finds the element rendered on the screen at the provided coordinates.\n *\n * Similar to `document.elementFromPoint`, but pierces through\n * shadow roots.\n *\n * @param {number} x Horizontal pixel coordinate\n * @param {number} y Vertical pixel coordinate\n * @return {Element} Returns the deepest shadowRoot inclusive element\n * found at the screen position given.\n */\nexport function deepTargetFind(x, y) {\n let node = document.elementFromPoint(x, y);\n let next = node;\n // this code path is only taken when native ShadowDOM is used\n // if there is a shadowroot, it may have a node at x/y\n // if there is not a shadowroot, exit the loop\n while (next && next.shadowRoot && !window.ShadyDOM) {\n // if there is a node at x/y in the shadowroot, look deeper\n let oldNext = next;\n next = next.shadowRoot.elementFromPoint(x, y);\n // on Safari, elementFromPoint may return the shadowRoot host\n if (oldNext === next) {\n break;\n }\n if (next) {\n node = next;\n }\n }\n return node;\n}\n\n/**\n * a cheaper check than ev.composedPath()[0];\n *\n * @private\n * @param {Event|Touch} ev Event.\n * @return {EventTarget} Returns the event target.\n */\nfunction _findOriginalTarget(ev) {\n const path = getComposedPath(/** @type {?Event} */ (ev));\n // It shouldn't be, but sometimes path is empty (window on Safari).\n return path.length > 0 ? path[0] : ev.target;\n}\n\n/**\n * @private\n * @param {Event} ev Event.\n * @return {void}\n */\nfunction _handleNative(ev) {\n let handled;\n let type = ev.type;\n let node = ev.currentTarget;\n let gobj = node[GESTURE_KEY];\n if (!gobj) {\n return;\n }\n let gs = gobj[type];\n if (!gs) {\n return;\n }\n if (!ev[HANDLED_OBJ]) {\n ev[HANDLED_OBJ] = {};\n if (type.slice(0, 5) === 'touch') {\n ev = /** @type {TouchEvent} */(ev); // eslint-disable-line no-self-assign\n let t = ev.changedTouches[0];\n if (type === 'touchstart') {\n // only handle the first finger\n if (ev.touches.length === 1) {\n POINTERSTATE.touch.id = t.identifier;\n }\n }\n if (POINTERSTATE.touch.id !== t.identifier) {\n return;\n }\n if (!HAS_NATIVE_TA) {\n if (type === 'touchstart' || type === 'touchmove') {\n _handleTouchAction(ev);\n }\n }\n }\n }\n handled = ev[HANDLED_OBJ];\n // used to ignore synthetic mouse events\n if (handled.skip) {\n return;\n }\n // reset recognizer state\n for (let i = 0, r; i < recognizers.length; i++) {\n r = recognizers[i];\n if (gs[r.name] && !handled[r.name]) {\n if (r.flow && r.flow.start.indexOf(ev.type) > -1 && r.reset) {\n r.reset();\n }\n }\n }\n // enforce gesture recognizer order\n for (let i = 0, r; i < recognizers.length; i++) {\n r = recognizers[i];\n if (gs[r.name] && !handled[r.name]) {\n handled[r.name] = true;\n r[type](ev);\n }\n }\n}\n\n/**\n * @private\n * @param {TouchEvent} ev Event.\n * @return {void}\n */\nfunction _handleTouchAction(ev) {\n let t = ev.changedTouches[0];\n let type = ev.type;\n if (type === 'touchstart') {\n POINTERSTATE.touch.x = t.clientX;\n POINTERSTATE.touch.y = t.clientY;\n POINTERSTATE.touch.scrollDecided = false;\n } else if (type === 'touchmove') {\n if (POINTERSTATE.touch.scrollDecided) {\n return;\n }\n POINTERSTATE.touch.scrollDecided = true;\n let ta = firstTouchAction(ev);\n let shouldPrevent = false;\n let dx = Math.abs(POINTERSTATE.touch.x - t.clientX);\n let dy = Math.abs(POINTERSTATE.touch.y - t.clientY);\n if (!ev.cancelable) {\n // scrolling is happening\n } else if (ta === 'none') {\n shouldPrevent = true;\n } else if (ta === 'pan-x') {\n shouldPrevent = dy > dx;\n } else if (ta === 'pan-y') {\n shouldPrevent = dx > dy;\n }\n if (shouldPrevent) {\n ev.preventDefault();\n } else {\n prevent('track');\n }\n }\n}\n\n/**\n * Adds an event listener to a node for the given gesture type.\n *\n * @param {!EventTarget} node Node to add listener on\n * @param {string} evType Gesture type: `down`, `up`, `track`, or `tap`\n * @param {!function(!Event):void} handler Event listener function to call\n * @return {boolean} Returns true if a gesture event listener was added.\n */\nexport function addListener(node, evType, handler) {\n if (gestures[evType]) {\n _add(node, evType, handler);\n return true;\n }\n return false;\n}\n\n/**\n * Removes an event listener from a node for the given gesture type.\n *\n * @param {!EventTarget} node Node to remove listener from\n * @param {string} evType Gesture type: `down`, `up`, `track`, or `tap`\n * @param {!function(!Event):void} handler Event listener function previously passed to\n * `addListener`.\n * @return {boolean} Returns true if a gesture event listener was removed.\n */\nexport function removeListener(node, evType, handler) {\n if (gestures[evType]) {\n _remove(node, evType, handler);\n return true;\n }\n return false;\n}\n\n/**\n * automate the event listeners for the native events\n *\n * @private\n * @param {!EventTarget} node Node on which to add the event.\n * @param {string} evType Event type to add.\n * @param {function(!Event)} handler Event handler function.\n * @return {void}\n */\nfunction _add(node, evType, handler) {\n let recognizer = gestures[evType];\n let deps = recognizer.deps;\n let name = recognizer.name;\n let gobj = node[GESTURE_KEY];\n if (!gobj) {\n node[GESTURE_KEY] = gobj = {};\n }\n for (let i = 0, dep, gd; i < deps.length; i++) {\n dep = deps[i];\n // don't add mouse handlers on iOS because they cause gray selection overlays\n if (IS_TOUCH_ONLY && isMouseEvent(dep) && dep !== 'click') {\n continue;\n }\n gd = gobj[dep];\n if (!gd) {\n gobj[dep] = gd = {_count: 0};\n }\n if (gd._count === 0) {\n node.addEventListener(dep, _handleNative, PASSIVE_TOUCH(dep));\n }\n gd[name] = (gd[name] || 0) + 1;\n gd._count = (gd._count || 0) + 1;\n }\n node.addEventListener(evType, handler);\n if (recognizer.touchAction) {\n setTouchAction(node, recognizer.touchAction);\n }\n}\n\n/**\n * automate event listener removal for native events\n *\n * @private\n * @param {!EventTarget} node Node on which to remove the event.\n * @param {string} evType Event type to remove.\n * @param {function(!Event): void} handler Event handler function.\n * @return {void}\n */\nfunction _remove(node, evType, handler) {\n let recognizer = gestures[evType];\n let deps = recognizer.deps;\n let name = recognizer.name;\n let gobj = node[GESTURE_KEY];\n if (gobj) {\n for (let i = 0, dep, gd; i < deps.length; i++) {\n dep = deps[i];\n gd = gobj[dep];\n if (gd && gd[name]) {\n gd[name] = (gd[name] || 1) - 1;\n gd._count = (gd._count || 1) - 1;\n if (gd._count === 0) {\n node.removeEventListener(dep, _handleNative, PASSIVE_TOUCH(dep));\n }\n }\n }\n }\n node.removeEventListener(evType, handler);\n}\n\n/**\n * Registers a new gesture event recognizer for adding new custom\n * gesture event types.\n *\n * @param {!GestureRecognizer} recog Gesture recognizer descriptor\n * @return {void}\n */\nexport function register(recog) {\n recognizers.push(recog);\n for (let i = 0; i < recog.emits.length; i++) {\n gestures[recog.emits[i]] = recog;\n }\n}\n\n/**\n * @private\n * @param {string} evName Event name.\n * @return {Object} Returns the gesture for the given event name.\n */\nfunction _findRecognizerByEvent(evName) {\n for (let i = 0, r; i < recognizers.length; i++) {\n r = recognizers[i];\n for (let j = 0, n; j < r.emits.length; j++) {\n n = r.emits[j];\n if (n === evName) {\n return r;\n }\n }\n }\n return null;\n}\n\n/**\n * Sets scrolling direction on node.\n *\n * This value is checked on first move, thus it should be called prior to\n * adding event listeners.\n *\n * @param {!EventTarget} node Node to set touch action setting on\n * @param {string} value Touch action value\n * @return {void}\n */\nexport function setTouchAction(node, value) {\n if (HAS_NATIVE_TA && node instanceof HTMLElement) {\n // NOTE: add touchAction async so that events can be added in\n // custom element constructors. Otherwise we run afoul of custom\n // elements restriction against settings attributes (style) in the\n // constructor.\n microTask.run(() => {\n node.style.touchAction = value;\n });\n }\n node[TOUCH_ACTION] = value;\n}\n\n/**\n * Dispatches an event on the `target` element of `type` with the given\n * `detail`.\n * @private\n * @param {!EventTarget} target The element on which to fire an event.\n * @param {string} type The type of event to fire.\n * @param {!Object=} detail The detail object to populate on the event.\n * @return {void}\n */\nfunction _fire(target, type, detail) {\n let ev = new Event(type, { bubbles: true, cancelable: true, composed: true });\n ev.detail = detail;\n wrap(/** @type {!Node} */(target)).dispatchEvent(ev);\n // forward `preventDefault` in a clean way\n if (ev.defaultPrevented) {\n let preventer = detail.preventer || detail.sourceEvent;\n if (preventer && preventer.preventDefault) {\n preventer.preventDefault();\n }\n }\n}\n\n/**\n * Prevents the dispatch and default action of the given event name.\n *\n * @param {string} evName Event name.\n * @return {void}\n */\nexport function prevent(evName) {\n let recognizer = _findRecognizerByEvent(evName);\n if (recognizer.info) {\n recognizer.info.prevent = true;\n }\n}\n\n/**\n * Reset the 2500ms timeout on processing mouse input after detecting touch input.\n *\n * Touch inputs create synthesized mouse inputs anywhere from 0 to 2000ms after the touch.\n * This method should only be called during testing with simulated touch inputs.\n * Calling this method in production may cause duplicate taps or other Gestures.\n *\n * @return {void}\n */\nexport function resetMouseCanceller() {\n if (POINTERSTATE.mouse.mouseIgnoreJob) {\n POINTERSTATE.mouse.mouseIgnoreJob.flush();\n }\n}\n\n/* eslint-disable valid-jsdoc */\n\nregister({\n name: 'downup',\n deps: ['mousedown', 'touchstart', 'touchend'],\n flow: {\n start: ['mousedown', 'touchstart'],\n end: ['mouseup', 'touchend']\n },\n emits: ['down', 'up'],\n\n info: {\n movefn: null,\n upfn: null\n },\n\n /**\n * @this {GestureRecognizer}\n * @return {void}\n */\n reset: function() {\n untrackDocument(this.info);\n },\n\n /**\n * @this {GestureRecognizer}\n * @param {MouseEvent} e\n * @return {void}\n */\n mousedown: function(e) {\n if (!hasLeftMouseButton(e)) {\n return;\n }\n let t = _findOriginalTarget(e);\n let self = this;\n let movefn = function movefn(e) {\n if (!hasLeftMouseButton(e)) {\n downupFire('up', t, e);\n untrackDocument(self.info);\n }\n };\n let upfn = function upfn(e) {\n if (hasLeftMouseButton(e)) {\n downupFire('up', t, e);\n }\n untrackDocument(self.info);\n };\n trackDocument(this.info, movefn, upfn);\n downupFire('down', t, e);\n },\n /**\n * @this {GestureRecognizer}\n * @param {TouchEvent} e\n * @return {void}\n */\n touchstart: function(e) {\n downupFire('down', _findOriginalTarget(e), e.changedTouches[0], e);\n },\n /**\n * @this {GestureRecognizer}\n * @param {TouchEvent} e\n * @return {void}\n */\n touchend: function(e) {\n downupFire('up', _findOriginalTarget(e), e.changedTouches[0], e);\n }\n});\n\n/**\n * @param {string} type\n * @param {EventTarget} target\n * @param {Event|Touch} event\n * @param {Event=} preventer\n * @return {void}\n */\nfunction downupFire(type, target, event, preventer) {\n if (!target) {\n return;\n }\n _fire(target, type, {\n x: event.clientX,\n y: event.clientY,\n sourceEvent: event,\n preventer: preventer,\n prevent: function(e) {\n return prevent(e);\n }\n });\n}\n\nregister({\n name: 'track',\n touchAction: 'none',\n deps: ['mousedown', 'touchstart', 'touchmove', 'touchend'],\n flow: {\n start: ['mousedown', 'touchstart'],\n end: ['mouseup', 'touchend']\n },\n emits: ['track'],\n\n info: {\n x: 0,\n y: 0,\n state: 'start',\n started: false,\n moves: [],\n /** @this {GestureInfo} */\n addMove: function(move) {\n if (this.moves.length > TRACK_LENGTH) {\n this.moves.shift();\n }\n this.moves.push(move);\n },\n movefn: null,\n upfn: null,\n prevent: false\n },\n\n /**\n * @this {GestureRecognizer}\n * @return {void}\n */\n reset: function() {\n this.info.state = 'start';\n this.info.started = false;\n this.info.moves = [];\n this.info.x = 0;\n this.info.y = 0;\n this.info.prevent = false;\n untrackDocument(this.info);\n },\n\n /**\n * @this {GestureRecognizer}\n * @param {MouseEvent} e\n * @return {void}\n */\n mousedown: function(e) {\n if (!hasLeftMouseButton(e)) {\n return;\n }\n let t = _findOriginalTarget(e);\n let self = this;\n let movefn = function movefn(e) {\n let x = e.clientX, y = e.clientY;\n if (trackHasMovedEnough(self.info, x, y)) {\n // first move is 'start', subsequent moves are 'move', mouseup is 'end'\n self.info.state = self.info.started ? (e.type === 'mouseup' ? 'end' : 'track') : 'start';\n if (self.info.state === 'start') {\n // if and only if tracking, always prevent tap\n prevent('tap');\n }\n self.info.addMove({x: x, y: y});\n if (!hasLeftMouseButton(e)) {\n // always fire \"end\"\n self.info.state = 'end';\n untrackDocument(self.info);\n }\n if (t) {\n trackFire(self.info, t, e);\n }\n self.info.started = true;\n }\n };\n let upfn = function upfn(e) {\n if (self.info.started) {\n movefn(e);\n }\n\n // remove the temporary listeners\n untrackDocument(self.info);\n };\n // add temporary document listeners as mouse retargets\n trackDocument(this.info, movefn, upfn);\n this.info.x = e.clientX;\n this.info.y = e.clientY;\n },\n /**\n * @this {GestureRecognizer}\n * @param {TouchEvent} e\n * @return {void}\n */\n touchstart: function(e) {\n let ct = e.changedTouches[0];\n this.info.x = ct.clientX;\n this.info.y = ct.clientY;\n },\n /**\n * @this {GestureRecognizer}\n * @param {TouchEvent} e\n * @return {void}\n */\n touchmove: function(e) {\n let t = _findOriginalTarget(e);\n let ct = e.changedTouches[0];\n let x = ct.clientX, y = ct.clientY;\n if (trackHasMovedEnough(this.info, x, y)) {\n if (this.info.state === 'start') {\n // if and only if tracking, always prevent tap\n prevent('tap');\n }\n this.info.addMove({x: x, y: y});\n trackFire(this.info, t, ct);\n this.info.state = 'track';\n this.info.started = true;\n }\n },\n /**\n * @this {GestureRecognizer}\n * @param {TouchEvent} e\n * @return {void}\n */\n touchend: function(e) {\n let t = _findOriginalTarget(e);\n let ct = e.changedTouches[0];\n // only trackend if track was started and not aborted\n if (this.info.started) {\n // reset started state on up\n this.info.state = 'end';\n this.info.addMove({x: ct.clientX, y: ct.clientY});\n trackFire(this.info, t, ct);\n }\n }\n});\n\n/**\n * @param {!GestureInfo} info\n * @param {number} x\n * @param {number} y\n * @return {boolean}\n */\nfunction trackHasMovedEnough(info, x, y) {\n if (info.prevent) {\n return false;\n }\n if (info.started) {\n return true;\n }\n let dx = Math.abs(info.x - x);\n let dy = Math.abs(info.y - y);\n return (dx >= TRACK_DISTANCE || dy >= TRACK_DISTANCE);\n}\n\n/**\n * @param {!GestureInfo} info\n * @param {?EventTarget} target\n * @param {Touch} touch\n * @return {void}\n */\nfunction trackFire(info, target, touch) {\n if (!target) {\n return;\n }\n let secondlast = info.moves[info.moves.length - 2];\n let lastmove = info.moves[info.moves.length - 1];\n let dx = lastmove.x - info.x;\n let dy = lastmove.y - info.y;\n let ddx, ddy = 0;\n if (secondlast) {\n ddx = lastmove.x - secondlast.x;\n ddy = lastmove.y - secondlast.y;\n }\n _fire(target, 'track', {\n state: info.state,\n x: touch.clientX,\n y: touch.clientY,\n dx: dx,\n dy: dy,\n ddx: ddx,\n ddy: ddy,\n sourceEvent: touch,\n hover: function() {\n return deepTargetFind(touch.clientX, touch.clientY);\n }\n });\n}\n\nregister({\n name: 'tap',\n deps: ['mousedown', 'click', 'touchstart', 'touchend'],\n flow: {\n start: ['mousedown', 'touchstart'],\n end: ['click', 'touchend']\n },\n emits: ['tap'],\n info: {\n x: NaN,\n y: NaN,\n prevent: false\n },\n /**\n * @this {GestureRecognizer}\n * @return {void}\n */\n reset: function() {\n this.info.x = NaN;\n this.info.y = NaN;\n this.info.prevent = false;\n },\n /**\n * @this {GestureRecognizer}\n * @param {MouseEvent} e\n * @return {void}\n */\n mousedown: function(e) {\n if (hasLeftMouseButton(e)) {\n this.info.x = e.clientX;\n this.info.y = e.clientY;\n }\n },\n /**\n * @this {GestureRecognizer}\n * @param {MouseEvent} e\n * @return {void}\n */\n click: function(e) {\n if (hasLeftMouseButton(e)) {\n trackForward(this.info, e);\n }\n },\n /**\n * @this {GestureRecognizer}\n * @param {TouchEvent} e\n * @return {void}\n */\n touchstart: function(e) {\n const touch = e.changedTouches[0];\n this.info.x = touch.clientX;\n this.info.y = touch.clientY;\n },\n /**\n * @this {GestureRecognizer}\n * @param {TouchEvent} e\n * @return {void}\n */\n touchend: function(e) {\n trackForward(this.info, e.changedTouches[0], e);\n }\n});\n\n/**\n * @param {!GestureInfo} info\n * @param {Event | Touch} e\n * @param {Event=} preventer\n * @return {void}\n */\nfunction trackForward(info, e, preventer) {\n let dx = Math.abs(e.clientX - info.x);\n let dy = Math.abs(e.clientY - info.y);\n // find original target from `preventer` for TouchEvents, or `e` for MouseEvents\n let t = _findOriginalTarget((preventer || e));\n if (!t || (canBeDisabled[/** @type {!HTMLElement} */(t).localName] && t.hasAttribute('disabled'))) {\n return;\n }\n // dx,dy can be NaN if `click` has been simulated and there was no `down` for `start`\n if (isNaN(dx) || isNaN(dy) || (dx <= TAP_DISTANCE && dy <= TAP_DISTANCE) || isSyntheticClick(e)) {\n // prevent taps from being generated if an event has canceled them\n if (!info.prevent) {\n _fire(t, 'tap', {\n x: e.clientX,\n y: e.clientY,\n sourceEvent: e,\n preventer: preventer\n });\n }\n }\n}\n\n/* eslint-enable valid-jsdoc */\n\n/** @deprecated */\nexport const findOriginalTarget = _findOriginalTarget;\n\n/** @deprecated */\nexport const add = addListener;\n\n/** @deprecated */\nexport const remove = removeListener;\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\nimport '../utils/boot.js';\n\nimport { dedupingMixin } from '../utils/mixin.js';\nimport { addListener, removeListener } from '../utils/gestures.js';\n\n/**\n * Element class mixin that provides API for adding Polymer's cross-platform\n * gesture events to nodes.\n *\n * The API is designed to be compatible with override points implemented\n * in `TemplateStamp` such that declarative event listeners in\n * templates will support gesture events when this mixin is applied along with\n * `TemplateStamp`.\n *\n * @mixinFunction\n * @polymer\n * @summary Element class mixin that provides API for adding Polymer's\n * cross-platform gesture events to nodes\n * @template T\n * @param {function(new:T)} superClass Class to apply mixin to.\n * @return {function(new:T)} superClass with mixin applied.\n */\nexport const GestureEventListeners = dedupingMixin((superClass) => {\n /**\n * @polymer\n * @mixinClass\n * @implements {Polymer_GestureEventListeners}\n */\n class GestureEventListeners extends superClass {\n /**\n * Add the event listener to the node if it is a gestures event.\n *\n * @param {!EventTarget} node Node to add event listener to\n * @param {string} eventName Name of event\n * @param {function(!Event):void} handler Listener function to add\n * @return {void}\n * @override\n */\n _addEventListenerToNode(node, eventName, handler) {\n if (!addListener(node, eventName, handler)) {\n super._addEventListenerToNode(node, eventName, handler);\n }\n }\n\n /**\n * Remove the event listener to the node if it is a gestures event.\n *\n * @param {!EventTarget} node Node to remove event listener from\n * @param {string} eventName Name of event\n * @param {function(!Event):void} handler Listener function to remove\n * @return {void}\n * @override\n */\n _removeEventListenerFromNode(node, eventName, handler) {\n if (!removeListener(node, eventName, handler)) {\n super._removeEventListenerFromNode(node, eventName, handler);\n }\n }\n }\n\n return GestureEventListeners;\n});\n","/**\n * @polymerMixin\n */\nexport const ThemePropertyMixin = superClass => class VaadinThemePropertyMixin extends superClass {\n static get properties() {\n return {\n /**\n * Helper property with theme attribute value facilitating propagation\n * in shadow DOM.\n *\n * Enables the component implementation to propagate the `theme`\n * attribute value to the subcomponents in Shadow DOM by binding\n * the subcomponent’s \"theme\" attribute to the `theme` property of\n * the host.\n *\n * **NOTE:** Extending the mixin only provides the property for binding,\n * and does not make the propagation alone.\n *\n * See [Theme Attribute and Subcomponents](https://github.com/vaadin/vaadin-themable-mixin/wiki/5.-Theme-Attribute-and-Subcomponents).\n * page for more information.\n *\n * @protected\n */\n theme: {\n type: String,\n readOnly: true\n }\n };\n }\n\n /** @protected */\n attributeChangedCallback(name, oldValue, newValue) {\n super.attributeChangedCallback(name, oldValue, newValue);\n\n if (name === 'theme') {\n this._setTheme(newValue);\n }\n }\n};\n","import { DomModule } from '@polymer/polymer/lib/elements/dom-module.js';\nimport { ThemePropertyMixin } from './vaadin-theme-property-mixin.js';\n\n/**\n * @polymerMixin\n * @mixes ThemePropertyMixin\n */\nexport const ThemableMixin = superClass => class VaadinThemableMixin extends ThemePropertyMixin(superClass) {\n\n /** @protected */\n static finalize() {\n super.finalize();\n\n const template = this.prototype._template;\n\n const hasOwnTemplate = this.template && this.template.parentElement && this.template.parentElement.id === this.is;\n const inheritedTemplate = Object.getPrototypeOf(this.prototype)._template;\n if (inheritedTemplate && !hasOwnTemplate) {\n // The element doesn't define its own template -> include the theme modules from the inherited template\n Array.from(inheritedTemplate.content.querySelectorAll('style[include]')).forEach(s => {\n this._includeStyle(s.getAttribute('include'), template);\n });\n }\n\n this._includeMatchingThemes(template);\n }\n\n /** @private */\n static _includeMatchingThemes(template) {\n const domModule = DomModule;\n const modules = domModule.prototype.modules;\n\n let hasThemes = false;\n const defaultModuleName = this.is + '-default-theme';\n\n Object.keys(modules)\n .sort((moduleNameA, moduleNameB) => {\n const vaadinA = moduleNameA.indexOf('vaadin-') === 0;\n const vaadinB = moduleNameB.indexOf('vaadin-') === 0;\n\n const vaadinThemePrefixes = ['lumo-', 'material-'];\n const vaadinThemeA = vaadinThemePrefixes.filter(prefix => moduleNameA.indexOf(prefix) === 0).length > 0;\n const vaadinThemeB = vaadinThemePrefixes.filter(prefix => moduleNameB.indexOf(prefix) === 0).length > 0;\n\n if (vaadinA !== vaadinB) {\n // Include vaadin core styles first\n return vaadinA ? -1 : 1;\n } else if (vaadinThemeA !== vaadinThemeB) {\n // Include vaadin theme styles after that\n return vaadinThemeA ? -1 : 1;\n } else {\n // Lastly include custom styles so they override all vaadin styles\n return 0;\n }\n })\n .forEach(moduleName => {\n if (moduleName !== defaultModuleName) {\n const themeFor = modules[moduleName].getAttribute('theme-for');\n if (themeFor) {\n themeFor.split(' ').forEach(themeForToken => {\n if (new RegExp('^' + themeForToken.split('*').join('.*') + '$').test(this.is)) {\n hasThemes = true;\n this._includeStyle(moduleName, template);\n }\n });\n }\n }\n });\n\n if (!hasThemes && modules[defaultModuleName]) {\n // No theme modules found, include the default module if it exists\n this._includeStyle(defaultModuleName, template);\n }\n }\n\n /** @private */\n static _includeStyle(moduleName, template) {\n if (template && !template.content.querySelector(`style[include=\"${moduleName}\"]`)) {\n const styleEl = document.createElement('style');\n styleEl.setAttribute('include', moduleName);\n template.content.appendChild(styleEl);\n }\n }\n\n};\n","/**\n@license\nCopyright (c) 2017 Vaadin Ltd.\nThis program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n*/\n// We consider the keyboard to be active if the window has received a keydown\n// event since the last mousedown event.\nlet keyboardActive = false;\n\n// Listen for top-level keydown and mousedown events.\n// Use capture phase so we detect events even if they're handled.\nwindow.addEventListener(\n 'keydown',\n () => {\n keyboardActive = true;\n },\n {capture: true}\n);\n\nwindow.addEventListener(\n 'mousedown',\n () => {\n keyboardActive = false;\n },\n {capture: true}\n);\n\n/**\n * A private mixin to avoid problems with dynamic properties and Polymer Analyzer.\n * No need to expose these properties in the API docs.\n * @polymerMixin\n * @private\n */\nconst TabIndexMixin = superClass => class VaadinTabIndexMixin extends superClass {\n static get properties() {\n var properties = {\n /**\n * Internal property needed to listen to `tabindex` attribute changes.\n *\n * For changing the tabindex of this component use the native `tabIndex` property.\n * @private\n */\n tabindex: {\n type: Number,\n value: 0,\n reflectToAttribute: true,\n observer: '_tabindexChanged'\n }\n };\n\n if (window.ShadyDOM) {\n // ShadyDOM browsers need the `tabIndex` in order to notify when the user changes it programmatically.\n properties['tabIndex'] = properties.tabindex;\n }\n\n return properties;\n }\n};\n\n/**\n * Polymer.IronControlState is not a proper 2.0 class, also, its tabindex\n * implementation fails in the shadow dom, so we have this for vaadin elements.\n * @polymerMixin\n */\nexport const ControlStateMixin = superClass => class VaadinControlStateMixin extends TabIndexMixin(superClass) {\n static get properties() {\n return {\n /**\n * Specify that this control should have input focus when the page loads.\n */\n autofocus: {\n type: Boolean\n },\n\n /**\n * Stores the previous value of tabindex attribute of the disabled element\n * @private\n */\n _previousTabIndex: {\n type: Number\n },\n\n /**\n * If true, the user cannot interact with this element.\n */\n disabled: {\n type: Boolean,\n observer: '_disabledChanged',\n reflectToAttribute: true\n },\n\n /**\n * @private\n */\n _isShiftTabbing: {\n type: Boolean\n }\n };\n }\n\n /**\n * @protected\n * @return {boolean}\n */\n get _keyboardActive() {\n return keyboardActive;\n }\n\n /**\n * @protected\n */\n ready() {\n this.addEventListener('focusin', e => {\n if (e.composedPath()[0] === this) {\n // Only focus if the focus is received from somewhere outside\n if (!this.contains(e.relatedTarget)) {\n this._focus();\n }\n } else if (e.composedPath().indexOf(this.focusElement) !== -1 && !this.disabled) {\n this._setFocused(true);\n }\n });\n this.addEventListener('focusout', e => this._setFocused(false));\n\n // In super.ready() other 'focusin' and 'focusout' listeners might be\n // added, so we call it after our own ones to ensure they execute first.\n // Issue to watch out: when incorrect, <vaadin-combo-box> refocuses the\n // input field on iOS after “Done” is pressed.\n super.ready();\n\n // This fixes the bug in Firefox 61 (https://bugzilla.mozilla.org/show_bug.cgi?id=1472887)\n // where focusout event does not go out of shady DOM because composed property in the event is not true\n const ensureEventComposed = e => {\n if (!e.composed) {\n e.target.dispatchEvent(new CustomEvent(e.type, {\n bubbles: true,\n composed: true,\n cancelable: false\n }));\n }\n };\n this.shadowRoot.addEventListener('focusin', ensureEventComposed);\n this.shadowRoot.addEventListener('focusout', ensureEventComposed);\n\n this.addEventListener('keydown', e => {\n if (!e.defaultPrevented && e.keyCode === 9) {\n if (e.shiftKey) {\n // Flag is checked in _focus event handler.\n this._isShiftTabbing = true;\n HTMLElement.prototype.focus.apply(this);\n this._setFocused(false);\n // Event handling in IE is asynchronous and the flag is removed asynchronously as well\n setTimeout(() => this._isShiftTabbing = false, 0);\n } else {\n // Workaround for FF63-65 bug that causes the focus to get lost when\n // blurring a slotted component with focusable shadow root content\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1528686\n // TODO: Remove when safe\n const firefox = window.navigator.userAgent.match(/Firefox\\/(\\d\\d\\.\\d)/);\n if (firefox\n && parseFloat(firefox[1]) >= 63\n && parseFloat(firefox[1]) < 66\n && this.parentNode\n && this.nextSibling) {\n const fakeTarget = document.createElement('input');\n fakeTarget.style.position = 'absolute';\n fakeTarget.style.opacity = '0';\n fakeTarget.tabIndex = this.tabIndex;\n\n this.parentNode.insertBefore(fakeTarget, this.nextSibling);\n fakeTarget.focus();\n fakeTarget.addEventListener('focusout', () => this.parentNode.removeChild(fakeTarget));\n }\n }\n\n }\n });\n\n if (this.autofocus && !this.disabled) {\n window.requestAnimationFrame(() => {\n this._focus();\n this._setFocused(true);\n this.setAttribute('focus-ring', '');\n });\n }\n }\n\n /**\n * @protected\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n\n // in non-Chrome browsers, blur does not fire on the element when it is disconnected.\n // reproducible in `<vaadin-date-picker>` when closing on `Cancel` or `Today` click.\n if (this.hasAttribute('focused')) {\n this._setFocused(false);\n }\n }\n\n /**\n * @param {boolean} focused\n * @protected\n */\n _setFocused(focused) {\n if (focused) {\n this.setAttribute('focused', '');\n } else {\n this.removeAttribute('focused');\n }\n\n // focus-ring is true when the element was focused from the keyboard.\n // Focus Ring [A11ycasts]: https://youtu.be/ilj2P5-5CjI\n if (focused && keyboardActive) {\n this.setAttribute('focus-ring', '');\n } else {\n this.removeAttribute('focus-ring');\n }\n }\n\n /**\n * Any element extending this mixin is required to implement this getter.\n * It returns the actual focusable element in the component.\n * @return {Element | null | undefined}\n */\n get focusElement() {\n window.console.warn(`Please implement the 'focusElement' property in <${this.localName}>`);\n return this;\n }\n\n /**\n * @protected\n */\n _focus() {\n if (!this.focusElement || this._isShiftTabbing) {\n return;\n }\n\n this.focusElement.focus();\n this._setFocused(true);\n }\n\n /**\n * Moving the focus from the host element causes firing of the blur event what leads to problems in IE.\n * @private\n */\n focus() {\n if (!this.focusElement || this.disabled) {\n return;\n }\n\n this.focusElement.focus();\n this._setFocused(true);\n }\n\n /**\n * Native bluring in the host element does nothing because it does not have the focus.\n * In chrome it works, but not in FF.\n * @private\n */\n blur() {\n if (!this.focusElement) {\n return;\n }\n this.focusElement.blur();\n this._setFocused(false);\n }\n\n /**\n * @param {boolean} disabled\n * @private\n */\n _disabledChanged(disabled) {\n this.focusElement.disabled = disabled;\n if (disabled) {\n this.blur();\n this._previousTabIndex = this.tabindex;\n this.tabindex = -1;\n this.setAttribute('aria-disabled', 'true');\n } else {\n if (typeof this._previousTabIndex !== 'undefined') {\n this.tabindex = this._previousTabIndex;\n }\n this.removeAttribute('aria-disabled');\n }\n }\n\n /**\n * @param {number | null | undefined} tabindex\n * @private\n */\n _tabindexChanged(tabindex) {\n if (tabindex !== undefined) {\n this.focusElement.tabIndex = tabindex;\n }\n\n if (this.disabled && this.tabindex) {\n // If tabindex attribute was changed while checkbox was disabled\n if (this.tabindex !== -1) {\n this._previousTabIndex = this.tabindex;\n }\n this.tabindex = tabindex = undefined;\n }\n\n if (window.ShadyDOM) {\n this.setProperties({tabIndex: tabindex, tabindex: tabindex});\n }\n }\n\n /**\n * @protected\n */\n click() {\n if (!this.disabled) {\n super.click();\n }\n }\n};\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\nimport './boot.js';\nimport {enqueueDebouncer, flushDebouncers} from '../utils/debounce.js';\nexport {enqueueDebouncer};\n\n/**\n * Forces several classes of asynchronously queued tasks to flush:\n * - Debouncers added via `enqueueDebouncer`\n * - ShadyDOM distribution\n *\n * @return {void}\n */\nexport const flush = function() {\n let shadyDOM, debouncers;\n do {\n shadyDOM = window.ShadyDOM && ShadyDOM.flush();\n if (window.ShadyCSS && window.ShadyCSS.ScopingShim) {\n window.ShadyCSS.ScopingShim.flush();\n }\n debouncers = flushDebouncers();\n } while (shadyDOM || debouncers);\n};\n","/**\n@license\nCopyright (c) 2020 Vaadin Ltd.\nThis program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n*/\n/**\n * Helper that provides a set of functions for RTL.\n */\nclass DirHelper {\n /**\n * Get the scroll type in the current browser view.\n *\n * @return {string} the scroll type. Possible values are `default|reverse|negative`\n */\n static detectScrollType() {\n const dummy = document.createElement('div');\n dummy.textContent = 'ABCD';\n dummy.dir = 'rtl';\n dummy.style.fontSize = '14px';\n dummy.style.width = '4px';\n dummy.style.height = '1px';\n dummy.style.position = 'absolute';\n dummy.style.top = '-1000px';\n dummy.style.overflow = 'scroll';\n document.body.appendChild(dummy);\n\n let cachedType = 'reverse';\n if (dummy.scrollLeft > 0) {\n cachedType = 'default';\n } else {\n dummy.scrollLeft = 2;\n if (dummy.scrollLeft < 2) {\n cachedType = 'negative';\n }\n }\n document.body.removeChild(dummy);\n return cachedType;\n }\n\n /**\n * Get the scrollLeft value of the element relative to the direction\n *\n * @param {string} scrollType type of the scroll detected with `detectScrollType`\n * @param {string} direction current direction of the element\n * @param {Element} element\n * @return {number} the scrollLeft value.\n */\n static getNormalizedScrollLeft(scrollType, direction, element) {\n const {scrollLeft} = element;\n if (direction !== 'rtl' || !scrollType) {\n return scrollLeft;\n }\n\n switch (scrollType) {\n case 'negative':\n return element.scrollWidth - element.clientWidth + scrollLeft;\n case 'reverse':\n return element.scrollWidth - element.clientWidth - scrollLeft;\n }\n return scrollLeft;\n }\n\n /**\n * Set the scrollLeft value of the element relative to the direction\n *\n * @param {string} scrollType type of the scroll detected with `detectScrollType`\n * @param {string} direction current direction of the element\n * @param {Element} element\n * @param {number} scrollLeft the scrollLeft value to be set\n */\n static setNormalizedScrollLeft(scrollType, direction, element, scrollLeft) {\n if (direction !== 'rtl' || !scrollType) {\n element.scrollLeft = scrollLeft;\n return;\n }\n\n switch (scrollType) {\n case 'negative':\n element.scrollLeft = element.clientWidth - element.scrollWidth + scrollLeft;\n break;\n case 'reverse':\n element.scrollLeft = element.scrollWidth - element.clientWidth - scrollLeft;\n break;\n default:\n element.scrollLeft = scrollLeft;\n break;\n }\n }\n}\n\nexport { DirHelper };\n","import { DirHelper } from './vaadin-dir-helper.js';\n/**\n * Array of Vaadin custom element classes that have been subscribed to the dir changes.\n */\nconst directionSubscribers = [];\nconst directionUpdater = function() {\n const documentDir = getDocumentDir();\n directionSubscribers.forEach(element => {\n alignDirs(element, documentDir);\n });\n};\n\nlet scrollType;\n\nconst directionObserver = new MutationObserver(directionUpdater);\ndirectionObserver.observe(document.documentElement, {attributes: true, attributeFilter: ['dir']});\n\nconst alignDirs = function(element, documentDir) {\n if (documentDir) {\n element.setAttribute('dir', documentDir);\n } else {\n element.removeAttribute('dir');\n }\n};\n\nconst getDocumentDir = function() {\n return document.documentElement.getAttribute('dir');\n};\n\n/**\n * @polymerMixin\n */\nexport const DirMixin = superClass => class VaadinDirMixin extends superClass {\n static get properties() {\n return {\n /**\n * @protected\n */\n dir: {\n type: String,\n readOnly: true\n }\n };\n }\n\n /** @protected */\n static finalize() {\n super.finalize();\n\n if (!scrollType) {\n scrollType = DirHelper.detectScrollType();\n }\n }\n\n /** @protected */\n connectedCallback() {\n super.connectedCallback();\n\n if (!this.hasAttribute('dir')) {\n this.__subscribe();\n alignDirs(this, getDocumentDir());\n }\n }\n\n /** @protected */\n attributeChangedCallback(name, oldValue, newValue) {\n super.attributeChangedCallback(name, oldValue, newValue);\n if (name !== 'dir') {\n return;\n }\n\n // New value equals to the document direction and the element is not subscribed to the changes\n const newValueEqlDocDir = newValue === getDocumentDir() && directionSubscribers.indexOf(this) === -1;\n // Value was emptied and the element is not subscribed to the changes\n const newValueEmptied = !newValue && oldValue && directionSubscribers.indexOf(this) === -1;\n // New value is different and the old equals to document direction and the element is not subscribed to the changes\n const newDiffValue = newValue !== getDocumentDir() && oldValue === getDocumentDir();\n\n if (newValueEqlDocDir || newValueEmptied) {\n this.__subscribe();\n alignDirs(this, getDocumentDir());\n } else if (newDiffValue) {\n this.__subscribe(false);\n }\n }\n\n /** @protected */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.__subscribe(false);\n this.removeAttribute('dir');\n }\n\n /** @private */\n __subscribe(push = true) {\n if (push) {\n directionSubscribers.indexOf(this) === -1 &&\n directionSubscribers.push(this);\n } else {\n directionSubscribers.indexOf(this) > -1 &&\n directionSubscribers.splice(directionSubscribers.indexOf(this), 1);\n }\n }\n\n /**\n * @param {Element} element\n * @return {number}\n * @protected\n */\n __getNormalizedScrollLeft(element) {\n return DirHelper.getNormalizedScrollLeft(scrollType, this.getAttribute('dir') || 'ltr', element);\n }\n\n /**\n * @param {Element} element\n * @param {number} scrollLeft\n * @protected\n */\n __setNormalizedScrollLeft(element, scrollLeft) {\n return DirHelper.setNormalizedScrollLeft(scrollType, this.getAttribute('dir') || 'ltr', element, scrollLeft);\n }\n};\n","const DEV_MODE_CODE_REGEXP =\n /\\/\\*\\*\\s+vaadin-dev-mode:start([\\s\\S]*)vaadin-dev-mode:end\\s+\\*\\*\\//i;\n\nconst FlowClients = window.Vaadin && window.Vaadin.Flow && window.Vaadin.Flow.clients;\n\nfunction isMinified() {\n function test() {\n /** vaadin-dev-mode:start\n return false;\n vaadin-dev-mode:end **/\n return true;\n }\n return uncommentAndRun(test);\n}\n\nfunction isDevelopmentMode() {\n try {\n if (isForcedDevelopmentMode()) {\n return true;\n }\n\n if (!isLocalhost()) {\n return false;\n }\n\n if (FlowClients) {\n return !isFlowProductionMode();\n }\n\n return !isMinified();\n } catch (e) {\n // Some error in this code, assume production so no further actions will be taken\n return false;\n }\n}\n\nfunction isForcedDevelopmentMode() {\n return localStorage.getItem(\"vaadin.developmentmode.force\");\n}\n\nfunction isLocalhost() {\n return ([\"localhost\",\"127.0.0.1\"].indexOf(window.location.hostname) >= 0);\n}\n\nfunction isFlowProductionMode() {\n if (FlowClients) {\n const productionModeApps = Object.keys(FlowClients)\n .map(key => FlowClients[key])\n .filter(client => client.productionMode);\n if (productionModeApps.length > 0) {\n return true;\n }\n }\n return false;\n}\n\nfunction uncommentAndRun(callback, args) {\n if (typeof callback !== 'function') {\n return;\n }\n\n const match = DEV_MODE_CODE_REGEXP.exec(callback.toString());\n if (match) {\n try {\n // requires CSP: script-src 'unsafe-eval'\n callback = new Function(match[1]);\n } catch (e) {\n // eat the exception\n console.log('vaadin-development-mode-detector: uncommentAndRun() failed', e)\n }\n }\n\n return callback(args);\n}\n\n// A guard against polymer-modulizer removing the window.Vaadin\n// initialization above.\nwindow['Vaadin'] = window['Vaadin'] || {};\n\n/**\n * Inspects the source code of the given `callback` function for\n * specially-marked _commented_ code. If such commented code is found in the\n * callback source, uncomments and runs that code instead of the callback\n * itself. Otherwise runs the callback as is.\n *\n * The optional arguments are passed into the callback / uncommented code,\n * the result is returned.\n *\n * See the `isMinified()` function source code in this file for an example.\n *\n */\nexport const runIfDevelopmentMode = function(callback, args) {\n if (window.Vaadin.developmentMode) {\n return uncommentAndRun(callback, args);\n }\n};\n\nif (window.Vaadin.developmentMode === undefined) {\n window.Vaadin.developmentMode = isDevelopmentMode();\n}\n","/* This file is autogenerated from src/vaadin-usage-statistics.tpl.html */\n/*\n\nThis script gathers usage statistics from the application running in development mode.\n\nStatistics gathering is automatically disabled and excluded from production builds.\n\nFor details and to opt-out, see https://github.com/vaadin/vaadin-usage-statistics.\n\n*/\n/*\n FIXME(polymer-modulizer): the above comments were extracted\n from HTML and may be out of place here. Review them and\n then delete this comment!\n*/\nimport { runIfDevelopmentMode } from '@vaadin/vaadin-development-mode-detector/vaadin-development-mode-detector.js';\n\nfunction maybeGatherAndSendStats() {\n /** vaadin-dev-mode:start\n (function () {\n'use strict';\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n return typeof obj;\n} : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n};\n\nvar classCallCheck = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};\n\nvar createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\nvar getPolymerVersion = function getPolymerVersion() {\n return window.Polymer && window.Polymer.version;\n};\n\nvar StatisticsGatherer = function () {\n function StatisticsGatherer(logger) {\n classCallCheck(this, StatisticsGatherer);\n\n this.now = new Date().getTime();\n this.logger = logger;\n }\n\n createClass(StatisticsGatherer, [{\n key: 'frameworkVersionDetectors',\n value: function frameworkVersionDetectors() {\n return {\n 'Flow': function Flow() {\n if (window.Vaadin && window.Vaadin.Flow && window.Vaadin.Flow.clients) {\n var flowVersions = Object.keys(window.Vaadin.Flow.clients).map(function (key) {\n return window.Vaadin.Flow.clients[key];\n }).filter(function (client) {\n return client.getVersionInfo;\n }).map(function (client) {\n return client.getVersionInfo().flow;\n });\n if (flowVersions.length > 0) {\n return flowVersions[0];\n }\n }\n },\n 'Vaadin Framework': function VaadinFramework() {\n if (window.vaadin && window.vaadin.clients) {\n var frameworkVersions = Object.values(window.vaadin.clients).filter(function (client) {\n return client.getVersionInfo;\n }).map(function (client) {\n return client.getVersionInfo().vaadinVersion;\n });\n if (frameworkVersions.length > 0) {\n return frameworkVersions[0];\n }\n }\n },\n 'AngularJs': function AngularJs() {\n if (window.angular && window.angular.version && window.angular.version) {\n return window.angular.version.full;\n }\n },\n 'Angular': function Angular() {\n if (window.ng) {\n var tags = document.querySelectorAll(\"[ng-version]\");\n if (tags.length > 0) {\n return tags[0].getAttribute(\"ng-version\");\n }\n return \"Unknown\";\n }\n },\n 'Backbone.js': function BackboneJs() {\n if (window.Backbone) {\n return window.Backbone.VERSION;\n }\n },\n 'React': function React() {\n var reactSelector = '[data-reactroot], [data-reactid]';\n if (!!document.querySelector(reactSelector)) {\n // React does not publish the version by default\n return \"unknown\";\n }\n },\n 'Ember': function Ember() {\n if (window.Em && window.Em.VERSION) {\n return window.Em.VERSION;\n } else if (window.Ember && window.Ember.VERSION) {\n return window.Ember.VERSION;\n }\n },\n 'jQuery': function (_jQuery) {\n function jQuery() {\n return _jQuery.apply(this, arguments);\n }\n\n jQuery.toString = function () {\n return _jQuery.toString();\n };\n\n return jQuery;\n }(function () {\n if (typeof jQuery === 'function' && jQuery.prototype.jquery !== undefined) {\n return jQuery.prototype.jquery;\n }\n }),\n 'Polymer': function Polymer() {\n var version = getPolymerVersion();\n if (version) {\n return version;\n }\n },\n 'LitElement': function LitElement() {\n var version = window.litElementVersions && window.litElementVersions[0];\n if (version) {\n return version;\n }\n },\n 'LitHtml': function LitHtml() {\n var version = window.litHtmlVersions && window.litHtmlVersions[0];\n if (version) {\n return version;\n }\n },\n 'Vue.js': function VueJs() {\n if (window.Vue) {\n return window.Vue.version;\n }\n }\n };\n }\n }, {\n key: 'getUsedVaadinElements',\n value: function getUsedVaadinElements(elements) {\n var version = getPolymerVersion();\n var elementClasses = void 0;\n // NOTE: In case you edit the code here, YOU MUST UPDATE any statistics reporting code in Flow.\n // Check all locations calling the method getEntries() in\n // https://github.com/vaadin/flow/blob/master/flow-server/src/main/java/com/vaadin/flow/internal/UsageStatistics.java#L106\n // Currently it is only used by BootstrapHandler.\n if (version && version.indexOf('2') === 0) {\n // Polymer 2: components classes are stored in window.Vaadin\n elementClasses = Object.keys(window.Vaadin).map(function (c) {\n return window.Vaadin[c];\n }).filter(function (c) {\n return c.is;\n });\n } else {\n // Polymer 3: components classes are stored in window.Vaadin.registrations\n elementClasses = window.Vaadin.registrations || [];\n }\n elementClasses.forEach(function (klass) {\n var version = klass.version ? klass.version : \"0.0.0\";\n elements[klass.is] = { version: version };\n });\n }\n }, {\n key: 'getUsedVaadinThemes',\n value: function getUsedVaadinThemes(themes) {\n ['Lumo', 'Material'].forEach(function (themeName) {\n var theme;\n var version = getPolymerVersion();\n if (version && version.indexOf('2') === 0) {\n // Polymer 2: themes are stored in window.Vaadin\n theme = window.Vaadin[themeName];\n } else {\n // Polymer 3: themes are stored in custom element registry\n theme = customElements.get('vaadin-' + themeName.toLowerCase() + '-styles');\n }\n if (theme && theme.version) {\n themes[themeName] = { version: theme.version };\n }\n });\n }\n }, {\n key: 'getFrameworks',\n value: function getFrameworks(frameworks) {\n var detectors = this.frameworkVersionDetectors();\n Object.keys(detectors).forEach(function (framework) {\n var detector = detectors[framework];\n try {\n var version = detector();\n if (version) {\n frameworks[framework] = { version: version };\n }\n } catch (e) {}\n });\n }\n }, {\n key: 'gather',\n value: function gather(storage) {\n var storedStats = storage.read();\n var gatheredStats = {};\n var types = [\"elements\", \"frameworks\", \"themes\"];\n\n types.forEach(function (type) {\n gatheredStats[type] = {};\n if (!storedStats[type]) {\n storedStats[type] = {};\n }\n });\n\n var previousStats = JSON.stringify(storedStats);\n\n this.getUsedVaadinElements(gatheredStats.elements);\n this.getFrameworks(gatheredStats.frameworks);\n this.getUsedVaadinThemes(gatheredStats.themes);\n\n var now = this.now;\n types.forEach(function (type) {\n var keys = Object.keys(gatheredStats[type]);\n keys.forEach(function (key) {\n if (!storedStats[type][key] || _typeof(storedStats[type][key]) != _typeof({})) {\n storedStats[type][key] = { firstUsed: now };\n }\n // Discards any previously logged version number\n storedStats[type][key].version = gatheredStats[type][key].version;\n storedStats[type][key].lastUsed = now;\n });\n });\n\n var newStats = JSON.stringify(storedStats);\n storage.write(newStats);\n if (newStats != previousStats && Object.keys(storedStats).length > 0) {\n this.logger.debug(\"New stats: \" + newStats);\n }\n }\n }]);\n return StatisticsGatherer;\n}();\n\nvar StatisticsStorage = function () {\n function StatisticsStorage(key) {\n classCallCheck(this, StatisticsStorage);\n\n this.key = key;\n }\n\n createClass(StatisticsStorage, [{\n key: 'read',\n value: function read() {\n var localStorageStatsString = localStorage.getItem(this.key);\n try {\n return JSON.parse(localStorageStatsString ? localStorageStatsString : '{}');\n } catch (e) {\n return {};\n }\n }\n }, {\n key: 'write',\n value: function write(data) {\n localStorage.setItem(this.key, data);\n }\n }, {\n key: 'clear',\n value: function clear() {\n localStorage.removeItem(this.key);\n }\n }, {\n key: 'isEmpty',\n value: function isEmpty() {\n var storedStats = this.read();\n var empty = true;\n Object.keys(storedStats).forEach(function (key) {\n if (Object.keys(storedStats[key]).length > 0) {\n empty = false;\n }\n });\n\n return empty;\n }\n }]);\n return StatisticsStorage;\n}();\n\nvar StatisticsSender = function () {\n function StatisticsSender(url, logger) {\n classCallCheck(this, StatisticsSender);\n\n this.url = url;\n this.logger = logger;\n }\n\n createClass(StatisticsSender, [{\n key: 'send',\n value: function send(data, errorHandler) {\n var logger = this.logger;\n\n if (navigator.onLine === false) {\n logger.debug(\"Offline, can't send\");\n errorHandler();\n return;\n }\n logger.debug(\"Sending data to \" + this.url);\n\n var req = new XMLHttpRequest();\n req.withCredentials = true;\n req.addEventListener(\"load\", function () {\n // Stats sent, nothing more to do\n logger.debug(\"Response: \" + req.responseText);\n });\n req.addEventListener(\"error\", function () {\n logger.debug(\"Send failed\");\n errorHandler();\n });\n req.addEventListener(\"abort\", function () {\n logger.debug(\"Send aborted\");\n errorHandler();\n });\n req.open(\"POST\", this.url);\n req.setRequestHeader(\"Content-Type\", \"application/json\");\n req.send(data);\n }\n }]);\n return StatisticsSender;\n}();\n\nvar StatisticsLogger = function () {\n function StatisticsLogger(id) {\n classCallCheck(this, StatisticsLogger);\n\n this.id = id;\n }\n\n createClass(StatisticsLogger, [{\n key: '_isDebug',\n value: function _isDebug() {\n return localStorage.getItem(\"vaadin.\" + this.id + \".debug\");\n }\n }, {\n key: 'debug',\n value: function debug(msg) {\n if (this._isDebug()) {\n console.info(this.id + \": \" + msg);\n }\n }\n }]);\n return StatisticsLogger;\n}();\n\nvar UsageStatistics = function () {\n function UsageStatistics() {\n classCallCheck(this, UsageStatistics);\n\n this.now = new Date();\n this.timeNow = this.now.getTime();\n this.gatherDelay = 10; // Delay between loading this file and gathering stats\n this.initialDelay = 24 * 60 * 60;\n\n this.logger = new StatisticsLogger(\"statistics\");\n this.storage = new StatisticsStorage(\"vaadin.statistics.basket\");\n this.gatherer = new StatisticsGatherer(this.logger);\n this.sender = new StatisticsSender(\"https://tools.vaadin.com/usage-stats/submit\", this.logger);\n }\n\n createClass(UsageStatistics, [{\n key: 'maybeGatherAndSend',\n value: function maybeGatherAndSend() {\n var _this = this;\n\n if (localStorage.getItem(UsageStatistics.optOutKey)) {\n return;\n }\n this.gatherer.gather(this.storage);\n setTimeout(function () {\n _this.maybeSend();\n }, this.gatherDelay * 1000);\n }\n }, {\n key: 'lottery',\n value: function lottery() {\n return true;\n }\n }, {\n key: 'currentMonth',\n value: function currentMonth() {\n return this.now.getYear() * 12 + this.now.getMonth();\n }\n }, {\n key: 'maybeSend',\n value: function maybeSend() {\n var firstUse = Number(localStorage.getItem(UsageStatistics.firstUseKey));\n var monthProcessed = Number(localStorage.getItem(UsageStatistics.monthProcessedKey));\n\n if (!firstUse) {\n // Use a grace period to avoid interfering with tests, incognito mode etc\n firstUse = this.timeNow;\n localStorage.setItem(UsageStatistics.firstUseKey, firstUse);\n }\n\n if (this.timeNow < firstUse + this.initialDelay * 1000) {\n this.logger.debug(\"No statistics will be sent until the initial delay of \" + this.initialDelay + \"s has passed\");\n return;\n }\n if (this.currentMonth() <= monthProcessed) {\n this.logger.debug(\"This month has already been processed\");\n return;\n }\n localStorage.setItem(UsageStatistics.monthProcessedKey, this.currentMonth());\n // Use random sampling\n if (this.lottery()) {\n this.logger.debug(\"Congratulations, we have a winner!\");\n } else {\n this.logger.debug(\"Sorry, no stats from you this time\");\n return;\n }\n\n this.send();\n }\n }, {\n key: 'send',\n value: function send() {\n // Ensure we have the latest data\n this.gatherer.gather(this.storage);\n\n // Read, send and clean up\n var data = this.storage.read();\n data[\"firstUse\"] = Number(localStorage.getItem(UsageStatistics.firstUseKey));\n data[\"usageStatisticsVersion\"] = UsageStatistics.version;\n var info = 'This request contains usage statistics gathered from the application running in development mode. \\n\\nStatistics gathering is automatically disabled and excluded from production builds.\\n\\nFor details and to opt-out, see https://github.com/vaadin/vaadin-usage-statistics.\\n\\n\\n\\n';\n var self = this;\n this.sender.send(info + JSON.stringify(data), function () {\n // Revert the 'month processed' flag\n localStorage.setItem(UsageStatistics.monthProcessedKey, self.currentMonth() - 1);\n });\n }\n }], [{\n key: 'version',\n get: function get$1() {\n return '2.1.2';\n }\n }, {\n key: 'firstUseKey',\n get: function get$1() {\n return 'vaadin.statistics.firstuse';\n }\n }, {\n key: 'monthProcessedKey',\n get: function get$1() {\n return 'vaadin.statistics.monthProcessed';\n }\n }, {\n key: 'optOutKey',\n get: function get$1() {\n return 'vaadin.statistics.optout';\n }\n }]);\n return UsageStatistics;\n}();\n\ntry {\n window.Vaadin = window.Vaadin || {};\n window.Vaadin.usageStatsChecker = window.Vaadin.usageStatsChecker || new UsageStatistics();\n window.Vaadin.usageStatsChecker.maybeGatherAndSend();\n} catch (e) {\n // Intentionally ignored as this is not a problem in the app being developed\n}\n\n}());\n\n vaadin-dev-mode:end **/\n}\n\nexport const usageStatistics = function() {\n if (typeof runIfDevelopmentMode === 'function') {\n return runIfDevelopmentMode(maybeGatherAndSendStats);\n }\n};\n","import { idlePeriod } from '@polymer/polymer/lib/utils/async.js';\nimport { Debouncer } from '@polymer/polymer/lib/utils/debounce.js';\nimport { enqueueDebouncer } from '@polymer/polymer/lib/utils/flush.js';\n\nimport { DirMixin } from './vaadin-dir-mixin.js';\nimport { usageStatistics } from '@vaadin/vaadin-usage-statistics/vaadin-usage-statistics.js';\nif (!window.Vaadin) {\n window['Vaadin'] = {};\n}\n\n/**\n * Array of Vaadin custom element classes that have been finalized.\n */\nwindow['Vaadin'].registrations = window.Vaadin.registrations || [];\n\n// Use the hack to prevent polymer-modulizer from converting to exports\nwindow['Vaadin'].developmentModeCallback = window.Vaadin.developmentModeCallback || {};\nwindow['Vaadin'].developmentModeCallback['vaadin-usage-statistics'] = function() {\n if (usageStatistics) {\n usageStatistics();\n }\n};\n\nlet statsJob;\n\nconst registered = new Set();\n\n/**\n * @polymerMixin\n * @mixes DirMixin\n */\nexport const ElementMixin = superClass => class VaadinElementMixin extends DirMixin(superClass) {\n /** @protected */\n static finalize() {\n super.finalize();\n\n const {is} = this;\n\n // Registers a class prototype for telemetry purposes.\n if (is && !registered.has(is)) {\n window.Vaadin.registrations.push(this);\n registered.add(is);\n\n if (window.Vaadin.developmentModeCallback) {\n statsJob = Debouncer.debounce(statsJob,\n idlePeriod, () => {\n window.Vaadin.developmentModeCallback['vaadin-usage-statistics']();\n }\n );\n enqueueDebouncer(statsJob);\n }\n }\n }\n\n constructor() {\n super();\n if (document.doctype === null) {\n console.warn(\n 'Vaadin components require the \"standards mode\" declaration. Please add <!DOCTYPE html> to the HTML document.'\n );\n }\n }\n};\n","/**\n@license\nCopyright (c) 2017 Vaadin Ltd.\nThis program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n*/\nimport { PolymerElement } from '@polymer/polymer/polymer-element.js';\n\nimport { GestureEventListeners } from '@polymer/polymer/lib/mixins/gesture-event-listeners.js';\nimport { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';\nimport { ControlStateMixin } from '@vaadin/vaadin-control-state-mixin/vaadin-control-state-mixin.js';\nimport { ElementMixin } from '@vaadin/vaadin-element-mixin/vaadin-element-mixin.js';\nimport { html } from '@polymer/polymer/lib/utils/html-tag.js';\nimport { addListener } from '@polymer/polymer/lib/utils/gestures.js';\n/**\n * `<vaadin-button>` is a Web Component providing an accessible and customizable button.\n *\n * ```html\n * <vaadin-button>\n * </vaadin-button>\n * ```\n *\n * ```js\n * document.querySelector('vaadin-button').addEventListener('click', () => alert('Hello World!'));\n * ```\n *\n * ### Styling\n *\n * The following shadow DOM parts are exposed for styling:\n *\n * Part name | Description\n * ----------------|----------------\n * `label` | The label (text) inside the button\n * `prefix` | A slot for e.g. an icon before the label\n * `suffix` | A slot for e.g. an icon after the label\n *\n *\n * The following attributes are exposed for styling:\n *\n * Attribute | Description\n * --------- | -----------\n * `active` | Set when the button is pressed down, either with mouse, touch or the keyboard.\n * `disabled` | Set when the button is disabled.\n * `focus-ring` | Set when the button is focused using the keyboard.\n * `focused` | Set when the button is focused.\n *\n * See [ThemableMixin – how to apply styles for shadow parts](https://github.com/vaadin/vaadin-themable-mixin/wiki)\n *\n * @extends PolymerElement\n * @mixes ElementMixin\n * @mixes ControlStateMixin\n * @mixes ThemableMixin\n * @mixes GestureEventListeners\n * @demo demo/index.html\n */\nclass ButtonElement extends\n ElementMixin(\n ControlStateMixin(\n ThemableMixin(\n GestureEventListeners(PolymerElement)))) {\n static get template() {\n return html`\n <style>\n :host {\n display: inline-block;\n position: relative;\n outline: none;\n white-space: nowrap;\n }\n\n :host([hidden]) {\n display: none !important;\n }\n\n /* Ensure the button is always aligned on the baseline */\n .vaadin-button-container::before {\n content: \"\\\\2003\";\n display: inline-block;\n width: 0;\n }\n\n .vaadin-button-container {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n width: 100%;\n height: 100%;\n min-height: inherit;\n text-shadow: inherit;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n }\n\n [part=\"prefix\"],\n [part=\"suffix\"] {\n flex: none;\n }\n\n [part=\"label\"] {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n #button {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n width: 100%;\n height: 100%;\n opacity: 0;\n cursor: inherit;\n }\n </style>\n <div class=\"vaadin-button-container\">\n <div part=\"prefix\">\n <slot name=\"prefix\"></slot>\n </div>\n <div part=\"label\">\n <slot></slot>\n </div>\n <div part=\"suffix\">\n <slot name=\"suffix\"></slot>\n </div>\n </div>\n <button id=\"button\" type=\"button\"></button>\n`;\n }\n\n static get is() {\n return 'vaadin-button';\n }\n\n static get version() {\n return '2.4.0';\n }\n\n ready() {\n super.ready();\n\n // Leaving default role in the native button, makes navigation announcement\n // being different when using focus navigation (tab) versus using normal\n // navigation (arrows). The first way announces the label on a button\n // since the focus is moved programmatically, and the second on a group.\n this.setAttribute('role', 'button');\n this.$.button.setAttribute('role', 'presentation');\n\n this._addActiveListeners();\n\n // Fix for https://github.com/vaadin/vaadin-button-flow/issues/120\n window.ShadyDOM && window.ShadyDOM.flush();\n }\n\n /**\n * @protected\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n\n // `active` state is preserved when the element is disconnected between keydown and keyup events.\n // reproducible in `<vaadin-date-picker>` when closing on `Cancel` or `Today` click.\n if (this.hasAttribute('active')) {\n this.removeAttribute('active');\n }\n }\n\n /** @private */\n _addActiveListeners() {\n addListener(this, 'down', () => !this.disabled && this.setAttribute('active', ''));\n addListener(this, 'up', () => this.removeAttribute('active'));\n this.addEventListener('keydown', e => !this.disabled && [13, 32].indexOf(e.keyCode) >= 0 && this.setAttribute('active', ''));\n this.addEventListener('keyup', () => this.removeAttribute('active'));\n this.addEventListener('blur', () => this.removeAttribute('active'));\n }\n\n /**\n * @protected\n * @return {Element}\n */\n get focusElement() {\n return this.$.button;\n }\n}\n\ncustomElements.define(ButtonElement.is, ButtonElement);\n\nexport { ButtonElement };\n","import '@vaadin/vaadin-lumo-styles/color.js';\nimport '@vaadin/vaadin-lumo-styles/sizing.js';\nimport '@vaadin/vaadin-lumo-styles/spacing.js';\nimport '@vaadin/vaadin-lumo-styles/style.js';\nimport '@vaadin/vaadin-lumo-styles/typography.js';\nimport '@vaadin/vaadin-button/theme/lumo/vaadin-button.js';\nimport { html } from '@polymer/polymer/lib/utils/html-tag.js';\n\nconst $_documentContainer = html`<dom-module id=\"lumo-date-picker-overlay-content\" theme-for=\"vaadin-date-picker-overlay-content\">\n <template>\n <style>\n :host {\n position: relative;\n background-color: transparent;\n /* Background for the year scroller, placed here as we are using a mask image on the actual years part */\n background-image: linear-gradient(var(--lumo-shade-5pct), var(--lumo-shade-5pct));\n background-size: 57px 100%;\n background-position: top right;\n background-repeat: no-repeat;\n cursor: default;\n }\n\n /* Month scroller */\n\n [part=\"months\"] {\n /* Month calendar height:\n header height + margin-bottom\n + weekdays height + margin-bottom\n + date cell heights\n + small margin between month calendars\n */\n --vaadin-infinite-scroller-item-height:\n calc(\n var(--lumo-font-size-l) + var(--lumo-space-m)\n + var(--lumo-font-size-xs) + var(--lumo-space-s)\n + var(--lumo-size-m) * 6\n + var(--lumo-space-s)\n );\n --vaadin-infinite-scroller-buffer-offset: 20%;\n -webkit-mask-image: linear-gradient(transparent, #000 10%, #000 85%, transparent);\n mask-image: linear-gradient(transparent, #000 10%, #000 85%, transparent);\n position: relative;\n margin-right: 57px;\n }\n\n /* Year scroller */\n\n [part=\"years\"] {\n /* TODO get rid of fixed magic number */\n --vaadin-infinite-scroller-buffer-width: 97px;\n width: 57px;\n height: auto;\n top: 0;\n bottom: 0;\n font-size: var(--lumo-font-size-s);\n box-shadow: inset 2px 0 4px 0 var(--lumo-shade-5pct);\n -webkit-mask-image: linear-gradient(transparent, #000 35%, #000 65%, transparent);\n mask-image: linear-gradient(transparent, #000 35%, #000 65%, transparent);\n }\n\n [part=\"year-number\"],\n [part=\"year-separator\"] {\n opacity: 0.5;\n transition: 0.2s opacity;\n }\n\n [part=\"years\"]:hover [part=\"year-number\"],\n [part=\"years\"]:hover [part=\"year-separator\"] {\n opacity: 1;\n }\n\n /* TODO unsupported selector */\n #scrollers {\n position: static;\n display: block;\n }\n\n /* TODO unsupported selector, should fix this in vaadin-date-picker that it adapts to the\n * width of the year scroller */\n #scrollers[desktop] [part=\"months\"] {\n right: auto;\n }\n\n /* Year scroller position indicator */\n [part=\"years\"]::before {\n border: none;\n width: 1em;\n height: 1em;\n background-color: var(--lumo-base-color);\n background-image: linear-gradient(var(--lumo-tint-5pct), var(--lumo-tint-5pct));\n transform: translate(-75%, -50%) rotate(45deg);\n border-top-right-radius: calc(var(--lumo-border-radius) / 2);\n box-shadow: 2px -2px 6px 0 var(--lumo-shade-5pct);\n z-index: 1;\n }\n\n [part=\"year-number\"],\n [part=\"year-separator\"] {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 50%;\n transform: translateY(-50%);\n }\n\n [part=\"years\"] [part=\"year-separator\"]::after {\n color: var(--lumo-disabled-text-color);\n content: \"•\";\n }\n\n /* Current year */\n\n [part=\"years\"] [part=\"year-number\"][current] {\n color: var(--lumo-primary-text-color);\n }\n\n /* Toolbar (footer) */\n\n [part=\"toolbar\"] {\n padding: var(--lumo-space-s);\n box-shadow: 0 -1px 0 0 var(--lumo-contrast-10pct);\n border-bottom-left-radius: var(--lumo-border-radius);\n margin-right: 57px;\n }\n\n @supports (mask-image: linear-gradient(#000, #000)) or (-webkit-mask-image: linear-gradient(#000, #000)) {\n [part=\"toolbar\"] {\n box-shadow: none;\n }\n }\n\n /* Today and Cancel buttons */\n\n /* TODO: Would be great if I could apply the \"tertiary\" theme from here instead of copying those styles */\n [part=\"toolbar\"] [part\\$=\"button\"] {\n background-color: transparent;\n margin: 0;\n min-width: 0;\n padding: 0 0.75em;\n }\n\n /* Narrow viewport mode (fullscreen) */\n\n :host([fullscreen]) [part=\"toolbar\"] {\n order: -1;\n background-color: var(--lumo-base-color);\n }\n\n :host([fullscreen]) [part=\"overlay-header\"] {\n order: -2;\n height: var(--lumo-size-m);\n padding: var(--lumo-space-s);\n position: absolute;\n left: 0;\n right: 0;\n justify-content: center;\n }\n\n :host([fullscreen]) [part=\"toggle-button\"],\n :host([fullscreen]) [part=\"clear-button\"],\n [part=\"overlay-header\"] [part=\"label\"] {\n display: none;\n }\n\n /* Very narrow screen (year scroller initially hidden) */\n\n [part=\"years-toggle-button\"] {\n position: relative;\n right: auto;\n display: flex;\n align-items: center;\n height: var(--lumo-size-s);\n padding: 0 0.5em;\n border-radius: var(--lumo-border-radius);\n z-index: 3;\n color: var(--lumo-primary-text-color);\n font-weight: 500;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n\n :host([years-visible]) [part=\"years-toggle-button\"] {\n background-color: var(--lumo-primary-color);\n color: var(--lumo-primary-contrast-color);\n }\n\n [part=\"years-toggle-button\"]::before {\n content: none;\n }\n\n /* TODO magic number (same as used for iron-media-query in vaadin-date-picker-overlay-content) */\n @media screen and (max-width: 374px) {\n :host {\n background-image: none;\n }\n\n [part=\"years\"] {\n background-color: var(--lumo-shade-5pct);\n }\n\n [part=\"toolbar\"],\n [part=\"months\"] {\n margin-right: 0;\n }\n\n /* TODO make date-picker adapt to the width of the years part */\n [part=\"years\"] {\n --vaadin-infinite-scroller-buffer-width: 90px;\n width: 50px;\n }\n\n :host([years-visible]) [part=\"months\"] {\n padding-left: 50px;\n }\n }\n </style>\n </template>\n</dom-module>`;\n\ndocument.head.appendChild($_documentContainer.content);\n","import '@vaadin/vaadin-lumo-styles/color.js';\nimport '@vaadin/vaadin-lumo-styles/sizing.js';\nimport '@vaadin/vaadin-lumo-styles/spacing.js';\nimport '@vaadin/vaadin-lumo-styles/style.js';\nimport '@vaadin/vaadin-lumo-styles/typography.js';\nimport { html } from '@polymer/polymer/lib/utils/html-tag.js';\n\nconst $_documentContainer = html`<dom-module id=\"lumo-month-calendar\" theme-for=\"vaadin-month-calendar\">\n <template>\n <style>\n :host {\n -moz-user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n -webkit-tap-highlight-color: transparent;\n user-select: none;\n font-size: var(--lumo-font-size-m);\n color: var(--lumo-body-text-color);\n text-align: center;\n padding: 0 var(--lumo-space-xs);\n }\n\n /* Month header */\n\n [part=\"month-header\"] {\n color: var(--lumo-header-text-color);\n font-size: var(--lumo-font-size-l);\n line-height: 1;\n font-weight: 500;\n margin-bottom: var(--lumo-space-m);\n }\n\n /* Week days and numbers */\n\n [part=\"weekdays\"],\n [part=\"weekday\"],\n [part=\"week-numbers\"] {\n font-size: var(--lumo-font-size-xs);\n line-height: 1;\n color: var(--lumo-tertiary-text-color);\n }\n\n [part=\"weekdays\"] {\n margin-bottom: var(--lumo-space-s);\n }\n\n /* TODO should have part=\"week-number\" for the cell in weekdays-container */\n [part=\"weekday\"]:empty,\n [part=\"week-numbers\"] {\n width: var(--lumo-size-xs);\n }\n\n /* Date and week number cells */\n\n [part=\"date\"],\n [part=\"week-number\"] {\n box-sizing: border-box;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n height: var(--lumo-size-m);\n position: relative;\n }\n\n [part=\"date\"] {\n transition: color 0.1s;\n }\n\n /* Today date */\n\n [part=\"date\"][today] {\n color: var(--lumo-primary-text-color);\n }\n\n /* Focused date */\n\n [part=\"date\"]::before {\n content: \"\";\n position: absolute;\n z-index: -1;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n min-width: 2em;\n min-height: 2em;\n width: 80%;\n height: 80%;\n max-height: 100%;\n max-width: 100%;\n border-radius: var(--lumo-border-radius);\n }\n\n [part=\"date\"][focused]::before {\n box-shadow: 0 0 0 2px var(--lumo-primary-color-50pct);\n }\n\n :host(:not([focused])) [part=\"date\"][focused]::before {\n animation: vaadin-date-picker-month-calendar-focus-date 1.4s infinite;\n }\n\n @keyframes vaadin-date-picker-month-calendar-focus-date {\n 50% {\n box-shadow: 0 0 0 2px transparent;\n }\n }\n\n /* TODO should not rely on the role attribute */\n [part=\"date\"][role=\"button\"]:not([disabled]):not([selected]):hover::before {\n background-color: var(--lumo-primary-color-10pct);\n }\n\n [part=\"date\"][selected] {\n color: var(--lumo-primary-contrast-color);\n }\n\n [part=\"date\"][selected]::before {\n background-color: var(--lumo-primary-color);\n }\n\n [part=\"date\"][disabled] {\n color: var(--lumo-disabled-text-color);\n }\n\n @media (pointer: coarse) {\n [part=\"date\"]:hover:not([selected])::before,\n [part=\"date\"][focused]:not([selected])::before {\n display: none;\n }\n\n [part=\"date\"][role=\"button\"]:not([disabled]):active::before {\n display: block;\n }\n\n [part=\"date\"][selected]::before {\n box-shadow: none;\n }\n }\n\n /* Disabled */\n\n :host([disabled]) * {\n color: var(--lumo-disabled-text-color) !important;\n }\n </style>\n </template>\n</dom-module><custom-style>\n <style>\n @keyframes vaadin-date-picker-month-calendar-focus-date {\n 50% {\n box-shadow: 0 0 0 2px transparent;\n }\n }\n </style>\n</custom-style>`;\n\ndocument.head.appendChild($_documentContainer.content);\n","import '@polymer/polymer/lib/elements/custom-style.js';\nimport './version.js';\nconst $_documentContainer = document.createElement('template');\n\n$_documentContainer.innerHTML = `<custom-style>\n <style>\n @font-face {\n font-family: 'lumo-icons';\n src: url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAABEcAAsAAAAAIiwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAQwAAAFZAIUuKY21hcAAAAYgAAAD4AAADrsCU8d5nbHlmAAACgAAAC2MAABd4h9To2WhlYWQAAA3kAAAAMAAAADZa/6SsaGhlYQAADhQAAAAdAAAAJAbpA35obXR4AAAONAAAABAAAACspBAAAGxvY2EAAA5EAAAAWAAAAFh55IAsbWF4cAAADpwAAAAfAAAAIAFKAXBuYW1lAAAOvAAAATEAAAIuUUJZCHBvc3QAAA/wAAABKwAAAelm8SzVeJxjYGRgYOBiMGCwY2BycfMJYeDLSS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oMyt4baXlu/1GLdNFf5zbcNmdr1YUWCZe47o+zUmb/DoStbw3cVsef9ALjjiPQA) format('woff');\n font-weight: normal;\n font-style: normal;\n }\n\n html {\n --lumo-icons-align-center: \"\\\\ea01\";\n --lumo-icons-align-left: \"\\\\ea02\";\n --lumo-icons-align-right: \"\\\\ea03\";\n --lumo-icons-angle-down: \"\\\\ea04\";\n --lumo-icons-angle-left: \"\\\\ea05\";\n --lumo-icons-angle-right: \"\\\\ea06\";\n --lumo-icons-angle-up: \"\\\\ea07\";\n --lumo-icons-arrow-down: \"\\\\ea08\";\n --lumo-icons-arrow-left: \"\\\\ea09\";\n --lumo-icons-arrow-right: \"\\\\ea0a\";\n --lumo-icons-arrow-up: \"\\\\ea0b\";\n --lumo-icons-bar-chart: \"\\\\ea0c\";\n --lumo-icons-bell: \"\\\\ea0d\";\n --lumo-icons-calendar: \"\\\\ea0e\";\n --lumo-icons-checkmark: \"\\\\ea0f\";\n --lumo-icons-chevron-down: \"\\\\ea10\";\n --lumo-icons-chevron-left: \"\\\\ea11\";\n --lumo-icons-chevron-right: \"\\\\ea12\";\n --lumo-icons-chevron-up: \"\\\\ea13\";\n --lumo-icons-clock: \"\\\\ea14\";\n --lumo-icons-cog: \"\\\\ea15\";\n --lumo-icons-cross: \"\\\\ea16\";\n --lumo-icons-download: \"\\\\ea17\";\n --lumo-icons-dropdown: \"\\\\ea18\";\n --lumo-icons-edit: \"\\\\ea19\";\n --lumo-icons-error: \"\\\\ea1a\";\n --lumo-icons-eye: \"\\\\ea1b\";\n --lumo-icons-eye-disabled: \"\\\\ea1c\";\n --lumo-icons-menu: \"\\\\ea1d\";\n --lumo-icons-minus: \"\\\\ea1e\";\n --lumo-icons-ordered-list: \"\\\\ea1f\";\n --lumo-icons-phone: \"\\\\ea20\";\n --lumo-icons-photo: \"\\\\ea21\";\n --lumo-icons-play: \"\\\\ea22\";\n --lumo-icons-plus: \"\\\\ea23\";\n --lumo-icons-redo: \"\\\\ea24\";\n --lumo-icons-reload: \"\\\\ea25\";\n --lumo-icons-search: \"\\\\ea26\";\n --lumo-icons-undo: \"\\\\ea27\";\n --lumo-icons-unordered-list: \"\\\\ea28\";\n --lumo-icons-upload: \"\\\\ea29\";\n --lumo-icons-user: \"\\\\ea2a\";\n }\n </style>\n</custom-style>`;\n\ndocument.head.appendChild($_documentContainer.content);\n\n/* NOTICE: Generated with 'gulp icons' */\n/*\n FIXME(polymer-modulizer): the above comments were extracted\n from HTML and may be out of place here. Review them and\n then delete this comment!\n*/\n;\n","import '../color.js';\nimport '../font-icons.js';\nimport '../sizing.js';\nimport '../style.js';\nconst $_documentContainer = document.createElement('template');\n\n$_documentContainer.innerHTML = `<dom-module id=\"lumo-field-button\">\n <template>\n <style>\n [part\\$=\"button\"] {\n flex: none;\n width: 1em;\n height: 1em;\n line-height: 1;\n font-size: var(--lumo-icon-size-m);\n text-align: center;\n color: var(--lumo-contrast-60pct);\n transition: 0.2s color;\n cursor: var(--lumo-clickable-cursor);\n }\n\n :host(:not([readonly])) [part\\$=\"button\"]:hover {\n color: var(--lumo-contrast-90pct);\n }\n\n :host([disabled]) [part\\$=\"button\"],\n :host([readonly]) [part\\$=\"button\"] {\n color: var(--lumo-contrast-20pct);\n }\n\n [part\\$=\"button\"]::before {\n font-family: \"lumo-icons\";\n display: block;\n }\n </style>\n </template>\n</dom-module>`;\n\ndocument.head.appendChild($_documentContainer.content);\n","import '../color.js';\nimport '../spacing.js';\nimport '../style.js';\nimport '../typography.js';\nconst $_documentContainer = document.createElement('template');\n\n$_documentContainer.innerHTML = `<dom-module id=\"lumo-required-field\">\n <template>\n <style>\n [part=\"label\"] {\n align-self: flex-start;\n color: var(--lumo-secondary-text-color);\n font-weight: 500;\n font-size: var(--lumo-font-size-s);\n margin-left: calc(var(--lumo-border-radius-m) / 4);\n transition: color 0.2s;\n line-height: 1;\n padding-bottom: 0.5em;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n position: relative;\n max-width: 100%;\n box-sizing: border-box;\n }\n\n :host([has-label])::before {\n margin-top: calc(var(--lumo-font-size-s) * 1.5);\n }\n\n :host([has-label]) {\n padding-top: var(--lumo-space-m);\n }\n\n :host([required]) [part=\"label\"] {\n padding-right: 1em;\n }\n\n [part=\"label\"]::after {\n content: var(--lumo-required-field-indicator, \"•\");\n transition: opacity 0.2s;\n opacity: 0;\n color: var(--lumo-primary-text-color);\n position: absolute;\n right: 0;\n width: 1em;\n text-align: center;\n }\n\n :host([required]:not([has-value])) [part=\"label\"]::after {\n opacity: 1;\n }\n\n :host([invalid]) [part=\"label\"]::after {\n color: var(--lumo-error-text-color);\n }\n\n [part=\"error-message\"] {\n margin-left: calc(var(--lumo-border-radius-m) / 4);\n font-size: var(--lumo-font-size-xs);\n line-height: var(--lumo-line-height-xs);\n color: var(--lumo-error-text-color);\n will-change: max-height;\n transition: 0.4s max-height;\n max-height: 5em;\n }\n\n /* Margin that doesn’t reserve space when there’s no error message */\n [part=\"error-message\"]:not(:empty)::before,\n [part=\"error-message\"]:not(:empty)::after {\n content: \"\";\n display: block;\n height: 0.4em;\n }\n\n :host(:not([invalid])) [part=\"error-message\"] {\n max-height: 0;\n overflow: hidden;\n }\n\n /* RTL specific styles */\n\n :host([dir=\"rtl\"]) [part=\"label\"] {\n margin-left: 0;\n margin-right: calc(var(--lumo-border-radius-m) / 4);\n }\n\n :host([required][dir=\"rtl\"]) [part=\"label\"] {\n padding-left: 1em;\n padding-right: 0;\n }\n\n :host([dir=\"rtl\"]) [part=\"label\"]::after {\n right: auto;\n left: 0;\n }\n\n :host([dir=\"rtl\"]) [part=\"error-message\"] {\n margin-left: 0;\n margin-right: calc(var(--lumo-border-radius-m) / 4);\n }\n\n </style>\n </template>\n</dom-module>`;\n\ndocument.head.appendChild($_documentContainer.content);\n","import '@vaadin/vaadin-lumo-styles/color.js';\nimport '@vaadin/vaadin-lumo-styles/sizing.js';\nimport '@vaadin/vaadin-lumo-styles/spacing.js';\nimport '@vaadin/vaadin-lumo-styles/style.js';\nimport '@vaadin/vaadin-lumo-styles/typography.js';\nimport '@vaadin/vaadin-lumo-styles/mixins/required-field.js';\nimport '@vaadin/vaadin-lumo-styles/font-icons.js';\nimport '@vaadin/vaadin-lumo-styles/mixins/field-button.js';\nimport { html } from '@polymer/polymer/lib/utils/html-tag.js';\n\nconst $_documentContainer = html`<dom-module id=\"lumo-text-field\" theme-for=\"vaadin-text-field\">\n <template>\n <style include=\"lumo-required-field lumo-field-button\">\n :host {\n --lumo-text-field-size: var(--lumo-size-m);\n color: var(--lumo-body-text-color);\n font-size: var(--lumo-font-size-m);\n font-family: var(--lumo-font-family);\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n -webkit-tap-highlight-color: transparent;\n padding: var(--lumo-space-xs) 0;\n }\n\n :host::before {\n height: var(--lumo-text-field-size);\n box-sizing: border-box;\n display: inline-flex;\n align-items: center;\n }\n\n :host([focused]:not([readonly])) [part=\"label\"] {\n color: var(--lumo-primary-text-color);\n }\n\n :host([has-helper]) [part=\"helper-text\"]::before {\n content: \"\";\n display: block;\n height: 0.4em;\n }\n\n [part=\"helper-text\"],\n [part=\"helper-text\"] ::slotted(*) {\n display: block;\n color: var(--lumo-secondary-text-color);\n font-size: var(--lumo-font-size-xs);\n line-height: var(--lumo-line-height-xs);\n margin-left: calc(var(--lumo-border-radius-m) / 4);\n transition: color 0.2s;\n }\n\n [part=\"value\"],\n [part=\"input-field\"] ::slotted(input),\n [part=\"input-field\"] ::slotted(textarea),\n /* Slotted by vaadin-select-text-field */\n [part=\"input-field\"] ::slotted([part=\"value\"]) {\n cursor: inherit;\n min-height: var(--lumo-text-field-size);\n padding: 0 0.25em;\n --_lumo-text-field-overflow-mask-image: linear-gradient(to left, transparent, #000 1.25em);\n -webkit-mask-image: var(--_lumo-text-field-overflow-mask-image);\n }\n\n [part=\"value\"]:focus,\n :host([focused]) [part=\"input-field\"] ::slotted(input),\n :host([focused]) [part=\"input-field\"] ::slotted(textarea) {\n -webkit-mask-image: none;\n mask-image: none;\n }\n\n /*\n TODO: CSS custom property in \\`mask-image\\` causes crash in Edge\n see https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/15415089/\n */\n @-moz-document url-prefix() {\n [part=\"value\"],\n [part=\"input-field\"] ::slotted(input),\n [part=\"input-field\"] ::slotted(textarea),\n [part=\"input-field\"] ::slotted([part=\"value\"]) {\n mask-image: var(--_lumo-text-field-overflow-mask-image);\n }\n }\n\n [part=\"value\"]::-webkit-input-placeholder {\n color: inherit;\n transition: opacity 0.175s 0.05s;\n opacity: 0.5;\n }\n\n [part=\"value\"]:-ms-input-placeholder {\n color: inherit;\n opacity: 0.5;\n }\n\n [part=\"value\"]::-moz-placeholder {\n color: inherit;\n transition: opacity 0.175s 0.05s;\n opacity: 0.5;\n }\n\n [part=\"value\"]::placeholder {\n color: inherit;\n transition: opacity 0.175s 0.1s;\n opacity: 0.5;\n }\n\n [part=\"input-field\"] {\n border-radius: var(--lumo-border-radius);\n background-color: var(--lumo-contrast-10pct);\n padding: 0 calc(0.375em + var(--lumo-border-radius) / 4 - 1px);\n font-weight: 500;\n line-height: 1;\n position: relative;\n cursor: text;\n box-sizing: border-box;\n }\n\n /* Used for hover and activation effects */\n [part=\"input-field\"]::after {\n content: \"\";\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n border-radius: inherit;\n pointer-events: none;\n background-color: var(--lumo-contrast-50pct);\n opacity: 0;\n transition: transform 0.15s, opacity 0.2s;\n transform-origin: 100% 0;\n }\n\n /* Hover */\n\n :host(:hover:not([readonly]):not([focused])) [part=\"label\"],\n :host(:hover:not([readonly])) [part=\"helper-text\"],\n :host(:hover:not([readonly])) [part=\"helper-text\"] ::slotted(*) {\n color: var(--lumo-body-text-color);\n }\n\n :host(:hover:not([readonly]):not([focused])) [part=\"input-field\"]::after {\n opacity: 0.1;\n }\n\n /* Touch device adjustment */\n @media (pointer: coarse) {\n :host(:hover:not([readonly]):not([focused])) [part=\"label\"] {\n color: var(--lumo-secondary-text-color);\n }\n\n :host(:hover:not([readonly]):not([focused])) [part=\"input-field\"]::after {\n opacity: 0;\n }\n\n :host(:active:not([readonly]):not([focused])) [part=\"input-field\"]::after {\n opacity: 0.2;\n }\n }\n\n /* Trigger when not focusing using the keyboard */\n :host([focused]:not([focus-ring]):not([readonly])) [part=\"input-field\"]::after {\n transform: scaleX(0);\n transition-duration: 0.15s, 1s;\n }\n\n /* Focus-ring */\n\n :host([focus-ring]) [part=\"input-field\"] {\n box-shadow: 0 0 0 2px var(--lumo-primary-color-50pct);\n }\n\n /* Read-only and disabled */\n :host([readonly]) [part=\"value\"]::-webkit-input-placeholder,\n :host([disabled]) [part=\"value\"]::-webkit-input-placeholder {\n opacity: 0;\n }\n\n :host([readonly]) [part=\"value\"]:-ms-input-placeholder,\n :host([disabled]) [part=\"value\"]:-ms-input-placeholder {\n opacity: 0;\n }\n\n :host([readonly]) [part=\"value\"]::-moz-placeholder,\n :host([disabled]) [part=\"value\"]::-moz-placeholder {\n opacity: 0;\n }\n\n :host([readonly]) [part=\"value\"]::placeholder,\n :host([disabled]) [part=\"value\"]::placeholder {\n opacity: 0;\n }\n\n /* Read-only */\n\n :host([readonly]) [part=\"input-field\"] {\n color: var(--lumo-secondary-text-color);\n background-color: transparent;\n cursor: default;\n }\n\n :host([readonly]) [part=\"input-field\"]::after {\n background-color: transparent;\n opacity: 1;\n border: 1px dashed var(--lumo-contrast-30pct);\n }\n\n /* Disabled style */\n\n :host([disabled]) {\n pointer-events: none;\n }\n\n :host([disabled]) [part=\"input-field\"] {\n background-color: var(--lumo-contrast-5pct);\n }\n\n :host([disabled]) [part=\"label\"],\n :host([disabled]) [part=\"helper-text\"],\n :host([disabled]) [part=\"value\"],\n :host([disabled]) [part=\"input-field\"] ::slotted(*) {\n color: var(--lumo-disabled-text-color);\n -webkit-text-fill-color: var(--lumo-disabled-text-color);\n }\n\n /* Invalid style */\n\n :host([invalid]) [part=\"input-field\"] {\n background-color: var(--lumo-error-color-10pct);\n }\n\n :host([invalid]) [part=\"input-field\"]::after {\n background-color: var(--lumo-error-color-50pct);\n }\n\n :host([invalid][focus-ring]) [part=\"input-field\"] {\n box-shadow: 0 0 0 2px var(--lumo-error-color-50pct);\n }\n\n :host([input-prevented]) [part=\"input-field\"] {\n color: var(--lumo-error-text-color);\n }\n\n /* Small theme */\n\n :host([theme~=\"small\"]) {\n font-size: var(--lumo-font-size-s);\n --lumo-text-field-size: var(--lumo-size-s);\n }\n\n :host([theme~=\"small\"][has-label]) [part=\"label\"] {\n font-size: var(--lumo-font-size-xs);\n }\n\n :host([theme~=\"small\"][has-label]) [part=\"error-message\"] {\n font-size: var(--lumo-font-size-xxs);\n }\n\n /* Text align */\n\n :host([theme~=\"align-left\"]) [part=\"value\"] {\n text-align: left;\n --_lumo-text-field-overflow-mask-image: none;\n }\n\n :host([theme~=\"align-center\"]) [part=\"value\"] {\n text-align: center;\n --_lumo-text-field-overflow-mask-image: none;\n }\n\n :host([theme~=\"align-right\"]) [part=\"value\"] {\n text-align: right;\n --_lumo-text-field-overflow-mask-image: none;\n }\n\n @-moz-document url-prefix() {\n /* Firefox is smart enough to align overflowing text to right */\n :host([theme~=\"align-right\"]) [part=\"value\"] {\n --_lumo-text-field-overflow-mask-image: linear-gradient(to right, transparent 0.25em, #000 1.5em);\n }\n }\n\n @-moz-document url-prefix() {\n /* Firefox is smart enough to align overflowing text to right */\n :host([theme~=\"align-left\"]) [part=\"value\"] {\n --_lumo-text-field-overflow-mask-image: linear-gradient(to left, transparent 0.25em, #000 1.5em);\n }\n }\n /* helper-text position */\n\n :host([has-helper][theme~=\"helper-above-field\"]) [part=\"helper-text\"]::before {\n display: none;\n }\n\n :host([has-helper][theme~=\"helper-above-field\"]) [part=\"helper-text\"]::after {\n content: \"\";\n display: block;\n height: 0.4em;\n }\n\n :host([has-helper][theme~=\"helper-above-field\"]) [part=\"label\"] {\n order: 0;\n padding-bottom: 0.4em;\n }\n\n :host([has-helper][theme~=\"helper-above-field\"]) [part=\"helper-text\"] {\n order: 1;\n }\n\n :host([has-helper][theme~=\"helper-above-field\"]) [part=\"input-field\"] {\n order: 2;\n }\n\n :host([has-helper][theme~=\"helper-above-field\"]) [part=\"error-message\"] {\n order: 3;\n }\n\n /* Slotted content */\n\n [part=\"input-field\"] ::slotted(:not([part]):not(iron-icon):not(input):not(textarea)) {\n color: var(--lumo-secondary-text-color);\n font-weight: 400;\n }\n\n /* Slotted icons */\n\n [part=\"input-field\"] ::slotted(iron-icon) {\n color: var(--lumo-contrast-60pct);\n width: var(--lumo-icon-size-m);\n height: var(--lumo-icon-size-m);\n }\n\n /* Vaadin icons are based on a 16x16 grid (unlike Lumo and Material icons with 24x24), so they look too big by default */\n [part=\"input-field\"] ::slotted(iron-icon[icon^=\"vaadin:\"]) {\n padding: 0.25em;\n box-sizing: border-box !important;\n }\n\n [part=\"clear-button\"]::before {\n content: var(--lumo-icons-cross);\n }\n\n /* RTL specific styles */\n\n :host([dir=\"rtl\"]) [part=\"input-field\"]::after {\n transform-origin: 0% 0;\n }\n\n :host([dir=\"rtl\"]) [part=\"value\"],\n :host([dir=\"rtl\"]) [part=\"input-field\"] ::slotted(input),\n :host([dir=\"rtl\"]) [part=\"input-field\"] ::slotted(textarea) {\n --_lumo-text-field-overflow-mask-image: linear-gradient(to right, transparent, #000 1.25em);\n }\n\n :host([dir=\"rtl\"]) [part=\"value\"]:focus,\n :host([focused][dir=\"rtl\"]) [part=\"input-field\"] ::slotted(input),\n :host([focused][dir=\"rtl\"]) [part=\"input-field\"] ::slotted(textarea) {\n -webkit-mask-image: none;\n mask-image: none;\n }\n\n @-moz-document url-prefix() {\n :host([dir=\"rtl\"]) [part=\"value\"],\n :host([dir=\"rtl\"]) [part=\"input-field\"] ::slotted(input),\n :host([dir=\"rtl\"]) [part=\"input-field\"] ::slotted(textarea),\n :host([dir=\"rtl\"]) [part=\"input-field\"] ::slotted([part=\"value\"]) {\n mask-image: var(--_lumo-text-field-overflow-mask-image);\n }\n }\n\n :host([theme~=\"align-left\"][dir=\"rtl\"]) [part=\"value\"] {\n --_lumo-text-field-overflow-mask-image: none;\n }\n\n :host([theme~=\"align-center\"][dir=\"rtl\"]) [part=\"value\"] {\n --_lumo-text-field-overflow-mask-image: none;\n }\n\n :host([theme~=\"align-right\"][dir=\"rtl\"]) [part=\"value\"] {\n --_lumo-text-field-overflow-mask-image: none;\n }\n\n @-moz-document url-prefix() {\n /* Firefox is smart enough to align overflowing text to right */\n :host([theme~=\"align-right\"][dir=\"rtl\"]) [part=\"value\"] {\n --_lumo-text-field-overflow-mask-image: linear-gradient(to right, transparent 0.25em, #000 1.5em);\n }\n }\n\n @-moz-document url-prefix() {\n /* Firefox is smart enough to align overflowing text to right */\n :host([theme~=\"align-left\"][dir=\"rtl\"]) [part=\"value\"] {\n --_lumo-text-field-overflow-mask-image: linear-gradient(to left, transparent 0.25em, #000 1.5em);\n }\n }\n </style>\n </template>\n</dom-module>`;\n\ndocument.head.appendChild($_documentContainer.content);\n","/**\n@license\nCopyright (c) 2017 Vaadin Ltd.\nThis program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n*/\nimport { timeOut, animationFrame } from '@polymer/polymer/lib/utils/async.js';\n\nimport { Debouncer } from '@polymer/polymer/lib/utils/debounce.js';\nimport { html } from '@polymer/polymer/lib/utils/html-tag.js';\n\nconst $_documentContainer = html`<dom-module id=\"vaadin-text-field-shared-styles\">\n <template>\n <style>\n :host {\n display: inline-flex;\n outline: none;\n }\n\n :host::before {\n content: \"\\\\2003\";\n width: 0;\n display: inline-block;\n /* Size and position this element on the same vertical position as the input-field element\n to make vertical align for the host element work as expected */\n }\n\n :host([hidden]) {\n display: none !important;\n }\n\n .vaadin-text-field-container,\n .vaadin-text-area-container {\n display: flex;\n flex-direction: column;\n min-width: 100%;\n max-width: 100%;\n width: var(--vaadin-text-field-default-width, 12em);\n }\n\n [part=\"label\"]:empty {\n display: none;\n }\n\n [part=\"input-field\"] {\n display: flex;\n align-items: center;\n flex: auto;\n }\n\n .vaadin-text-field-container [part=\"input-field\"] {\n flex-grow: 0;\n }\n\n /* Reset the native input styles */\n [part=\"value\"],\n [part=\"input-field\"] ::slotted(input),\n [part=\"input-field\"] ::slotted(textarea) {\n -webkit-appearance: none;\n -moz-appearance: none;\n outline: none;\n margin: 0;\n padding: 0;\n border: 0;\n border-radius: 0;\n min-width: 0;\n font: inherit;\n font-size: 1em;\n line-height: normal;\n color: inherit;\n background-color: transparent;\n /* Disable default invalid style in Firefox */\n box-shadow: none;\n }\n\n [part=\"input-field\"] ::slotted(*) {\n flex: none;\n }\n\n [part=\"value\"],\n [part=\"input-field\"] ::slotted(input),\n [part=\"input-field\"] ::slotted(textarea),\n /* Slotted by vaadin-select-text-field */\n [part=\"input-field\"] ::slotted([part=\"value\"]) {\n flex: auto;\n white-space: nowrap;\n overflow: hidden;\n width: 100%;\n height: 100%;\n }\n\n [part=\"input-field\"] ::slotted(textarea) {\n resize: none;\n }\n\n [part=\"value\"]::-ms-clear,\n [part=\"input-field\"] ::slotted(input)::-ms-clear {\n display: none;\n }\n\n [part=\"clear-button\"] {\n cursor: default;\n }\n\n [part=\"clear-button\"]::before {\n content: \"✕\";\n }\n </style>\n </template>\n</dom-module>`;\n\ndocument.head.appendChild($_documentContainer.content);\n\nconst HOST_PROPS = {\n default: ['list', 'autofocus', 'pattern', 'autocapitalize', 'autocorrect', 'maxlength',\n 'minlength', 'name', 'placeholder', 'autocomplete', 'title', 'disabled', 'readonly', 'required'],\n accessible: ['invalid']\n};\n\nconst PROP_TYPE = {\n DEFAULT: 'default',\n ACCESSIBLE: 'accessible'\n};\n\n\n/**\n * @polymerMixin\n */\nexport const TextFieldMixin = subclass => class VaadinTextFieldMixin extends subclass {\n static get properties() {\n return {\n /**\n * Whether the value of the control can be automatically completed by the browser.\n * List of available options at:\n * https://developer.mozilla.org/en/docs/Web/HTML/Element/input#attr-autocomplete\n */\n autocomplete: {\n type: String\n },\n\n /**\n * This is a property supported by Safari that is used to control whether\n * autocorrection should be enabled when the user is entering/editing the text.\n * Possible values are:\n * on: Enable autocorrection.\n * off: Disable autocorrection.\n * @type {!TextFieldAutoCorrect | undefined}\n */\n autocorrect: {\n type: String\n },\n\n /**\n * This is a property supported by Safari and Chrome that is used to control whether\n * autocapitalization should be enabled when the user is entering/editing the text.\n * Possible values are:\n * characters: Characters capitalization.\n * words: Words capitalization.\n * sentences: Sentences capitalization.\n * none: No capitalization.\n * @type {!TextFieldAutoCapitalize | undefined}\n */\n autocapitalize: {\n type: String\n },\n\n /**\n * Specify that the value should be automatically selected when the field gains focus.\n * @type {boolean}\n */\n autoselect: {\n type: Boolean,\n value: false\n },\n\n /**\n * Set to true to display the clear icon which clears the input.\n * @attr {boolean} clear-button-visible\n * @type {boolean}\n */\n clearButtonVisible: {\n type: Boolean,\n value: false\n },\n\n /**\n * Error to show when the input value is invalid.\n * @attr {string} error-message\n * @type {string}\n */\n errorMessage: {\n type: String,\n value: '',\n observer: '_errorMessageChanged'\n },\n\n /**\n * Object with translated strings used for localization. Has\n * the following structure and default values:\n *\n * ```\n * {\n * // Translation of the clear icon button accessible label\n * clear: 'Clear'\n * }\n * ```\n * @type {{clear: string}}\n */\n i18n: {\n type: Object,\n value: () => {\n return {\n clear: 'Clear'\n };\n }\n },\n\n /**\n * String used for the label element.\n * @type {string}\n */\n label: {\n type: String,\n value: '',\n observer: '_labelChanged'\n },\n\n /**\n * String used for the helper text.\n * @attr {string} helper-text\n * @type {string | null}\n */\n helperText: {\n type: String,\n value: '',\n observer: '_helperTextChanged'\n },\n\n /**\n * Maximum number of characters (in Unicode code points) that the user can enter.\n */\n maxlength: {\n type: Number\n },\n\n /**\n * Minimum number of characters (in Unicode code points) that the user can enter.\n */\n minlength: {\n type: Number\n },\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n name: {\n type: String\n },\n\n /**\n * A hint to the user of what can be entered in the control.\n */\n placeholder: {\n type: String\n },\n\n /**\n * This attribute indicates that the user cannot modify the value of the control.\n */\n readonly: {\n type: Boolean,\n reflectToAttribute: true\n },\n\n /**\n * Specifies that the user must fill in a value.\n */\n required: {\n type: Boolean,\n reflectToAttribute: true\n },\n\n\n /**\n * The initial value of the control.\n * It can be used for two-way data binding.\n * @type {string}\n */\n value: {\n type: String,\n value: '',\n observer: '_valueChanged',\n notify: true\n },\n\n /**\n * This property is set to true when the control value is invalid.\n * @type {boolean}\n */\n invalid: {\n type: Boolean,\n reflectToAttribute: true,\n notify: true,\n value: false\n },\n\n /**\n * Specifies that the text field has value.\n * @attr {boolean} has-value\n */\n hasValue: {\n type: Boolean,\n reflectToAttribute: true\n },\n\n /**\n * When set to true, user is prevented from typing a value that\n * conflicts with the given `pattern`.\n * @attr {boolean} prevent-invalid-input\n */\n preventInvalidInput: {\n type: Boolean\n },\n\n /**\n * A pattern matched against individual characters the user inputs.\n * When set, the field will prevent:\n * - `keyDown` events if the entered key doesn't match `/^_enabledCharPattern$/`\n * - `paste` events if the pasted text doesn't match `/^_enabledCharPattern*$/`\n * - `drop` events if the dropped text doesn't match `/^_enabledCharPattern*$/`\n *\n * For example, to enable entering only numbers and minus signs,\n * `_enabledCharPattern = \"[\\\\d-]\"`\n * @protected\n */\n _enabledCharPattern: String,\n\n /** @private */\n _labelId: String,\n\n /** @private */\n _helperTextId: String,\n\n /** @private */\n _errorId: String,\n\n /** @private */\n _inputId: String,\n\n /** @private */\n _hasSlottedHelper: Boolean\n };\n }\n\n static get observers() {\n return ['_stateChanged(disabled, readonly, clearButtonVisible, hasValue)',\n '_hostPropsChanged(' + HOST_PROPS.default.join(', ') + ')',\n '_hostAccessiblePropsChanged(' + HOST_PROPS.accessible.join(', ') + ')',\n '_getActiveErrorId(invalid, errorMessage, _errorId, helperText, _helperTextId, _hasSlottedHelper)',\n '_getActiveLabelId(label, _labelId, _inputId)',\n '__observeOffsetHeight(errorMessage, invalid, label, helperText)',\n '__enabledCharPatternChanged(_enabledCharPattern)'\n ];\n }\n\n /**\n * @return {HTMLElement | undefined}\n * @protected\n */\n get focusElement() {\n if (!this.shadowRoot) {\n return;\n }\n const slotted = this.querySelector(`${this._slottedTagName}[slot=\"${this._slottedTagName}\"]`);\n if (slotted) {\n return slotted;\n }\n return this.shadowRoot.querySelector('[part=\"value\"]');\n }\n\n /**\n * @return {HTMLElement | undefined}}\n * @protected\n */\n get inputElement() {\n return this.focusElement;\n }\n\n /**\n * @return {string}\n * @protected\n */\n get _slottedTagName() {\n return 'input';\n }\n\n /** @protected */\n _createConstraintsObserver() {\n // This complex observer needs to be added dynamically here (instead of defining it above in the `get observers()`)\n // so that it runs after complex observers of inheriting classes. Otherwise e.g. `_stepOrMinChanged()` observer of\n // vaadin-number-field would run after this and the `min` and `step` properties would not yet be propagated to\n // the `inputElement` when this runs.\n this._createMethodObserver('_constraintsChanged(required, minlength, maxlength, pattern)');\n }\n\n /** @private */\n _onInput(e) {\n if (this.__preventInput) {\n e.stopImmediatePropagation();\n this.__preventInput = false;\n return;\n }\n\n if (this.preventInvalidInput) {\n const input = this.inputElement;\n if (input.value.length > 0 && !this.checkValidity()) {\n input.value = this.value || '';\n // add input-prevented attribute for 200ms\n this.setAttribute('input-prevented', '');\n this._inputDebouncer = Debouncer.debounce(\n this._inputDebouncer,\n timeOut.after(200), () => {\n this.removeAttribute('input-prevented');\n });\n return;\n }\n }\n\n if (!e.__fromClearButton) {\n this.__userInput = true;\n }\n\n this.value = e.target.value;\n this.__userInput = false;\n }\n\n // NOTE(yuriy): Workaround needed for IE11 and Edge for proper displaying\n // of the clear button instead of setting display property for it depending on state.\n /** @private */\n _stateChanged(disabled, readonly, clearButtonVisible, hasValue) {\n if (!disabled &&\n !readonly &&\n clearButtonVisible &&\n hasValue\n ) {\n this.$.clearButton.removeAttribute('hidden');\n } else {\n this.$.clearButton.setAttribute('hidden', true);\n }\n }\n\n /**\n * @param {!Event} e\n * @protected\n */\n _onChange(e) {\n if (this._valueClearing) {\n return;\n }\n\n // In the Shadow DOM, the `change` event is not leaked into the\n // ancestor tree, so we must do this manually.\n const changeEvent = new CustomEvent('change', {\n detail: {\n sourceEvent: e\n },\n bubbles: e.bubbles,\n cancelable: e.cancelable,\n });\n this.dispatchEvent(changeEvent);\n }\n\n /**\n * @param {unknown} newVal\n * @param {unknown} oldVal\n * @protected\n */\n _valueChanged(newVal, oldVal) {\n // setting initial value to empty string, skip validation\n if (newVal === '' && oldVal === undefined) {\n return;\n }\n\n if (newVal !== '' && newVal != null) {\n this.hasValue = true;\n } else {\n this.hasValue = false;\n }\n\n if (this.__userInput) {\n return;\n } else if (newVal !== undefined) {\n this.inputElement.value = newVal;\n } else {\n this.value = this.inputElement.value = '';\n }\n\n if (this.invalid) {\n this.validate();\n }\n }\n\n /** @private */\n _labelChanged(label) {\n this._setOrToggleAttribute('has-label', !!label, this);\n }\n\n /** @private */\n _helperTextChanged(helperText) {\n this._setOrToggleAttribute('has-helper', !!helperText, this);\n }\n\n /** @private */\n _errorMessageChanged(errorMessage) {\n this._setOrToggleAttribute('has-error-message', !!errorMessage, this);\n }\n\n /** @private */\n _onHelperSlotChange() {\n const slottedNodes = this.shadowRoot.querySelector(`[name=\"helper\"]`).assignedNodes({flatten: true});\n // Only has slotted helper if not a text node\n // Text nodes are added by the helperText prop and not the helper slot\n // The filter is added due to shady DOM triggering this callback on helperText prop change\n this._hasSlottedHelper = slottedNodes.filter(node => node.nodeType !== 3).length;\n\n if (this._hasSlottedHelper) {\n this.setAttribute('has-helper', 'slotted');\n } else if (this.helperText === '' || this.helperText === null) {\n this.removeAttribute('has-helper');\n }\n }\n\n /** @private */\n _onSlotChange() {\n const slotted = this.querySelector(`${this._slottedTagName}[slot=\"${this._slottedTagName}\"]`);\n\n if (this.value) {\n this.inputElement.value = this.value;\n this.validate();\n }\n\n if (slotted && !this._slottedInput) {\n this._validateSlottedValue(slotted);\n this._addInputListeners(slotted);\n this._addIEListeners(slotted);\n this._slottedInput = slotted;\n } else if (!slotted && this._slottedInput) {\n this._removeInputListeners(this._slottedInput);\n this._removeIEListeners(this._slottedInput);\n this._slottedInput = undefined;\n }\n\n Object.keys(PROP_TYPE).map(key => PROP_TYPE[key]).forEach(type =>\n this._propagateHostAttributes(HOST_PROPS[type].map(attr => this[attr]), type));\n }\n\n /** @private */\n _hostPropsChanged(...attributesValues) {\n this._propagateHostAttributes(attributesValues, PROP_TYPE.DEFAULT);\n }\n\n /** @private */\n _hostAccessiblePropsChanged(...attributesValues) {\n this._propagateHostAttributes(attributesValues, PROP_TYPE.ACCESSIBLE);\n }\n\n /** @private */\n _validateSlottedValue(slotted) {\n if (slotted.value !== this.value) {\n console.warn('Please define value on the vaadin-text-field component!');\n slotted.value = '';\n }\n }\n\n /** @private */\n _propagateHostAttributes(attributesValues, type) {\n const input = this.inputElement;\n const attributeNames = HOST_PROPS[type];\n\n if (type === PROP_TYPE.ACCESSIBLE) {\n attributeNames.forEach((attr, index) => {\n this._setOrToggleAttribute(attr, attributesValues[index], input);\n this._setOrToggleAttribute(`aria-${attr}`, attributesValues[index] ? 'true' : false, input);\n });\n } else {\n attributeNames.forEach((attr, index) => {\n this._setOrToggleAttribute(attr, attributesValues[index], input);\n });\n }\n }\n\n /** @private */\n _setOrToggleAttribute(name, value, node) {\n if (!name || !node) {\n return;\n }\n\n if (value) {\n node.setAttribute(name, (typeof value === 'boolean') ? '' : value);\n } else {\n node.removeAttribute(name);\n }\n }\n\n /**\n * @param {boolean | undefined} required\n * @param {number | undefined} minlength\n * @param {number | undefined} maxlength\n * @param {string | undefined} maxlength\n * @protected\n */\n _constraintsChanged(required, minlength, maxlength, pattern) {\n if (!this.invalid) {\n return;\n }\n\n if (!required && !minlength && !maxlength && !pattern) {\n this.invalid = false;\n } else {\n this.validate();\n }\n }\n\n /**\n * Returns true if the current input value satisfies all constraints (if any)\n * @return {boolean}\n */\n checkValidity() {\n // Note (Yuriy): `__forceCheckValidity` is used in containing components (i.e. `vaadin-date-picker`) in order\n // to force the checkValidity instead of returning the previous invalid state.\n if (this.required || this.pattern || this.maxlength || this.minlength || this.__forceCheckValidity) {\n return this.inputElement.checkValidity();\n } else {\n return !this.invalid;\n }\n }\n\n /** @private */\n _addInputListeners(node) {\n node.addEventListener('input', this._boundOnInput);\n node.addEventListener('change', this._boundOnChange);\n node.addEventListener('blur', this._boundOnBlur);\n node.addEventListener('focus', this._boundOnFocus);\n node.addEventListener('paste', this._boundOnPaste);\n node.addEventListener('drop', this._boundOnDrop);\n node.addEventListener('beforeinput', this._boundOnBeforeInput);\n }\n\n /** @private */\n _removeInputListeners(node) {\n node.removeEventListener('input', this._boundOnInput);\n node.removeEventListener('change', this._boundOnChange);\n node.removeEventListener('blur', this._boundOnBlur);\n node.removeEventListener('focus', this._boundOnFocus);\n node.removeEventListener('paste', this._boundOnPaste);\n node.removeEventListener('drop', this._boundOnDrop);\n node.removeEventListener('beforeinput', this._boundOnBeforeInput);\n }\n\n /** @protected */\n ready() {\n super.ready();\n\n this._createConstraintsObserver();\n\n this._boundOnInput = this._onInput.bind(this);\n this._boundOnChange = this._onChange.bind(this);\n this._boundOnBlur = this._onBlur.bind(this);\n this._boundOnFocus = this._onFocus.bind(this);\n this._boundOnPaste = this._onPaste.bind(this);\n this._boundOnDrop = this._onDrop.bind(this);\n this._boundOnBeforeInput = this._onBeforeInput.bind(this);\n\n const defaultInput = this.shadowRoot.querySelector('[part=\"value\"]');\n this._slottedInput = this.querySelector(`${this._slottedTagName}[slot=\"${this._slottedTagName}\"]`);\n this._addInputListeners(defaultInput);\n this._addIEListeners(defaultInput);\n if (this._slottedInput) {\n this._addIEListeners(this._slottedInput);\n this._addInputListeners(this._slottedInput);\n }\n\n this.shadowRoot.querySelector('[name=\"input\"], [name=\"textarea\"]')\n .addEventListener('slotchange', this._onSlotChange.bind(this));\n\n this._onHelperSlotChange();\n this.shadowRoot.querySelector('[name=\"helper\"]').addEventListener('slotchange', this._onHelperSlotChange.bind(this));\n\n if (!(window.ShadyCSS && window.ShadyCSS.nativeCss)) {\n this.updateStyles();\n }\n\n this.$.clearButton.addEventListener('mousedown', () => this._valueClearing = true);\n this.$.clearButton.addEventListener('mouseleave', () => this._valueClearing = false);\n this.$.clearButton.addEventListener('click', this._onClearButtonClick.bind(this));\n this.addEventListener('keydown', this._onKeyDown.bind(this));\n\n var uniqueId = TextFieldMixin._uniqueId = 1 + TextFieldMixin._uniqueId || 0;\n this._errorId = `${this.constructor.is}-error-${uniqueId}`;\n this._labelId = `${this.constructor.is}-label-${uniqueId}`;\n this._helperTextId = `${this.constructor.is}-helper-${uniqueId}`;\n this._inputId = `${this.constructor.is}-input-${uniqueId}`;\n\n // Lumo theme defines a max-height transition for the \"error-message\"\n // part on invalid state change.\n this.shadowRoot.querySelector('[part=\"error-message\"]')\n .addEventListener('transitionend', () => {\n this.__observeOffsetHeight();\n });\n }\n\n /**\n * Returns true if `value` is valid.\n * `<iron-form>` uses this to check the validity for all its elements.\n *\n * @return {boolean} True if the value is valid.\n */\n validate() {\n return !(this.invalid = !this.checkValidity());\n }\n\n clear() {\n this.value = '';\n }\n\n /** @private */\n _onBlur() {\n this.validate();\n }\n\n /** @private */\n _onFocus() {\n if (this.autoselect) {\n this.inputElement.select();\n // iOS 9 workaround: https://stackoverflow.com/a/7436574\n setTimeout(() => {\n try {\n this.inputElement.setSelectionRange(0, 9999);\n } catch (e) {\n // The workaround may cause errors on different input types.\n // Needs to be suppressed. See https://github.com/vaadin/flow/issues/6070\n }\n });\n }\n }\n\n /** @private */\n _onClearButtonClick(e) {\n e.preventDefault();\n // NOTE(yuriy): This line won't affect focus on the host. Cannot be properly tested.\n this.inputElement.focus();\n this.clear();\n this._valueClearing = false;\n if (navigator.userAgent.match(/Trident/)) {\n // Disable IE input\" event prevention here, we want the input event from\n // below to propagate normally.\n this.__preventInput = false;\n }\n const inputEvent = new Event('input', {bubbles: true, composed: true});\n inputEvent.__fromClearButton = true;\n const changeEvent = new Event('change', {bubbles: !this._slottedInput});\n changeEvent.__fromClearButton = true;\n this.inputElement.dispatchEvent(inputEvent);\n this.inputElement.dispatchEvent(changeEvent);\n }\n\n /**\n * @param {!KeyboardEvent} e\n * @protected\n */\n _onKeyDown(e) {\n if (e.keyCode === 27 && this.clearButtonVisible) {\n const dispatchChange = !!this.value;\n this.clear();\n dispatchChange && this.inputElement.dispatchEvent(new Event('change', {bubbles: !this._slottedInput}));\n }\n\n if (this._enabledCharPattern && !this.__shouldAcceptKey(e)) {\n e.preventDefault();\n }\n }\n\n /** @private */\n __shouldAcceptKey(event) {\n return (event.metaKey || event.ctrlKey)\n || !event.key // allow typing anything if event.key is not supported\n || event.key.length !== 1 // allow \"Backspace\", \"ArrowLeft\" etc.\n || this.__enabledCharRegExp.test(event.key);\n }\n\n /** @private */\n _onPaste(e) {\n if (this._enabledCharPattern) {\n const pastedText = (e.clipboardData || window.clipboardData).getData('text');\n if (!this.__enabledTextRegExp.test(pastedText)) {\n e.preventDefault();\n }\n }\n }\n\n /** @private */\n _onDrop(e) {\n if (this._enabledCharPattern) {\n const draggedText = e.dataTransfer.getData('text');\n if (!this.__enabledTextRegExp.test(draggedText)) {\n e.preventDefault();\n }\n }\n }\n\n /** @private */\n _onBeforeInput(e) {\n // The `beforeinput` event covers all the cases for `_enabledCharPattern`: keyboard, pasting and dropping,\n // but it is still experimental technology so we can't rely on it. It's used here just as an additional check,\n // because it seems to be the only way to detect and prevent specific keys on mobile devices. See issue #429.\n if (this._enabledCharPattern && e.data && !this.__enabledTextRegExp.test(e.data)) {\n e.preventDefault();\n }\n }\n\n /** @private */\n __enabledCharPatternChanged(_enabledCharPattern) {\n this.__enabledCharRegExp = _enabledCharPattern && new RegExp('^' + _enabledCharPattern + '$');\n this.__enabledTextRegExp = _enabledCharPattern && new RegExp('^' + _enabledCharPattern + '*$');\n }\n\n /** @private */\n _addIEListeners(node) {\n /* istanbul ignore if */\n if (navigator.userAgent.match(/Trident/)) {\n // IE11 dispatches `input` event in following cases:\n // - focus or blur, when placeholder attribute is set\n // - placeholder attribute value changed\n // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/101220/\n this._shouldPreventInput = () => {\n this.__preventInput = true;\n requestAnimationFrame(() => {\n this.__preventInput = false;\n });\n };\n node.addEventListener('focusin', this._shouldPreventInput);\n node.addEventListener('focusout', this._shouldPreventInput);\n this._createPropertyObserver('placeholder', this._shouldPreventInput);\n }\n }\n\n /** @private */\n _removeIEListeners(node) {\n /* istanbul ignore if */\n if (navigator.userAgent.match(/Trident/)) {\n node.removeEventListener('focusin', this._shouldPreventInput);\n node.removeEventListener('focusout', this._shouldPreventInput);\n }\n }\n\n /** @private */\n _getActiveErrorId(invalid, errorMessage, errorId, helperText, helperTextId, hasSlottedHelper) {\n const ids = [];\n if (helperText || hasSlottedHelper) {\n ids.push(helperTextId);\n }\n if (errorMessage && invalid) {\n ids.push(errorId);\n }\n this._setOrToggleAttribute('aria-describedby', ids.join(' '), this.focusElement);\n }\n\n /** @private */\n _getActiveLabelId(label, _labelId, _inputId) {\n let ids = _inputId;\n if (label) {\n ids = `${_labelId} ${_inputId}`;\n }\n this.focusElement.setAttribute('aria-labelledby', ids);\n }\n\n /** @private */\n _getErrorMessageAriaHidden(invalid, errorMessage, errorId) {\n return (!(errorMessage && invalid ? errorId : undefined)).toString();\n }\n\n /** @private */\n _dispatchIronResizeEventIfNeeded(sizePropertyName, value) {\n const previousSizePropertyName = '__previous' + sizePropertyName;\n if (this[previousSizePropertyName] !== undefined\n && this[previousSizePropertyName] !== value) {\n this.dispatchEvent(\n new CustomEvent('iron-resize', {bubbles: true, composed: true})\n );\n }\n\n this[previousSizePropertyName] = value;\n }\n\n /** @private */\n __observeOffsetHeight() {\n this.__observeOffsetHeightDebouncer = Debouncer.debounce(\n this.__observeOffsetHeightDebouncer,\n animationFrame, () => {\n this._dispatchIronResizeEventIfNeeded('Height', this.offsetHeight);\n });\n }\n\n /**\n * @param {string} prop\n * @param {string} oldVal\n * @param {string} newVal\n * @protected\n */\n attributeChangedCallback(prop, oldVal, newVal) {\n super.attributeChangedCallback(prop, oldVal, newVal);\n // Needed until Edge has CSS Custom Properties (present in Edge Preview)\n /* istanbul ignore if */\n if (!(window.ShadyCSS && window.ShadyCSS.nativeCss) &&\n /^(focused|focus-ring|invalid|disabled|placeholder|has-value)$/.test(prop)) {\n this.updateStyles();\n }\n\n // Safari has an issue with repainting shadow root element styles when a host attribute changes.\n // Need this workaround (toggle any inline css property on and off) until the issue gets fixed.\n const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);\n /* istanbul ignore if */\n if (isSafari && this.root) {\n const WEBKIT_PROPERTY = '-webkit-backface-visibility';\n this.root.querySelectorAll('*').forEach(el => {\n el.style[WEBKIT_PROPERTY] = 'visible';\n el.style[WEBKIT_PROPERTY] = '';\n });\n }\n }\n\n // Workaround for https://github.com/Polymer/polymer/issues/5259\n get __data() {\n return this.__dataValue || {};\n }\n\n set __data(value) {\n this.__dataValue = value;\n }\n\n /**\n * Fired when the user commits a value change.\n *\n * @event change\n */\n\n /**\n * Fired when the value is changed by the user: on every typing keystroke,\n * and the value is cleared using the clear button.\n *\n * @event input\n */\n\n /**\n * Fired when the size of the element changes.\n *\n * @event iron-resize\n */\n};\n","/**\n@license\nCopyright (c) 2017 Vaadin Ltd.\nThis program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n*/\nimport { PolymerElement } from '@polymer/polymer/polymer-element.js';\n\nimport { TextFieldMixin } from './vaadin-text-field-mixin.js';\nimport { ControlStateMixin } from '@vaadin/vaadin-control-state-mixin/vaadin-control-state-mixin.js';\nimport { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';\nimport { ElementMixin } from '@vaadin/vaadin-element-mixin/vaadin-element-mixin.js';\nimport { html } from '@polymer/polymer/lib/utils/html-tag.js';\n/**\n * `<vaadin-text-field>` is a Web Component for text field control in forms.\n *\n * ```html\n * <vaadin-text-field label=\"First Name\">\n * </vaadin-text-field>\n * ```\n *\n * ### Prefixes and suffixes\n *\n * These are child elements of a `<vaadin-text-field>` that are displayed\n * inline with the input, before or after.\n * In order for an element to be considered as a prefix, it must have the slot\n * attribute set to `prefix` (and similarly for `suffix`).\n *\n * ```html\n * <vaadin-text-field label=\"Email address\">\n * <div slot=\"prefix\">Sent to:</div>\n * <div slot=\"suffix\">@vaadin.com</div>\n * </vaadin-text-area>\n * ```\n *\n * ### Styling\n *\n * The following custom properties are available for styling:\n *\n * Custom property | Description | Default\n * ----------------|-------------|-------------\n * `--vaadin-text-field-default-width` | Set the default width of the input field | `12em`\n *\n * The following shadow DOM parts are available for styling:\n *\n * Part name | Description\n * ----------------|----------------\n * `label` | The label element\n * `input-field` | The element that wraps prefix, value and suffix\n * `value` | The text value element inside the `input-field` element\n * `error-message` | The error message element\n *\n * The following state attributes are available for styling:\n *\n * Attribute | Description | Part name\n * -------------|-------------|------------\n * `disabled` | Set to a disabled text field | :host\n * `has-value` | Set when the element has a value | :host\n * `has-label` | Set when the element has a label | :host\n * `has-helper` | Set when the element has helper text or slot | :host\n * `has-error-message` | Set when the element has an error message | :host\n * `invalid` | Set when the element is invalid | :host\n * `input-prevented` | Temporarily set when invalid input is prevented | :host\n * `focused` | Set when the element is focused | :host\n * `focus-ring` | Set when the element is keyboard focused | :host\n * `readonly` | Set to a readonly text field | :host\n *\n * See [ThemableMixin – how to apply styles for shadow parts](https://github.com/vaadin/vaadin-themable-mixin/wiki)\n *\n * @extends PolymerElement\n * @mixes TextFieldMixin\n * @mixes ControlStateMixin\n * @mixes ThemableMixin\n * @mixes ElementMixin\n * @demo demo/index.html\n */\nclass TextFieldElement extends\n ElementMixin(\n TextFieldMixin(\n ControlStateMixin(\n ThemableMixin(PolymerElement)))) {\n static get template() {\n return html`\n <style include=\"vaadin-text-field-shared-styles\">\n /* polymer-cli linter breaks with empty line */\n </style>\n\n <div class=\"vaadin-text-field-container\">\n\n <label part=\"label\" on-click=\"focus\" id=\"[[_labelId]]\">[[label]]</label>\n\n <div part=\"input-field\" id=\"[[_inputId]]\">\n\n <slot name=\"prefix\"></slot>\n\n <slot name=\"input\">\n <input part=\"value\">\n </slot>\n\n <div part=\"clear-button\" id=\"clearButton\" role=\"button\" aria-label\\$=\"[[i18n.clear]]\"></div>\n <slot name=\"suffix\"></slot>\n\n </div>\n\n <div part=\"helper-text\" id=\"[[_helperTextId]]\">\n <slot name=\"helper\">[[helperText]]</slot>\n </div>\n\n <div part=\"error-message\" id=\"[[_errorId]]\" aria-live=\"assertive\" aria-hidden\\$=\"[[_getErrorMessageAriaHidden(invalid, errorMessage, _errorId)]]\">[[errorMessage]]</div>\n\n </div>\n`;\n }\n\n static get is() {\n return 'vaadin-text-field';\n }\n\n static get version() {\n return '2.9.2';\n }\n\n static get properties() {\n return {\n /**\n * Identifies a list of pre-defined options to suggest to the user.\n * The value must be the id of a <datalist> element in the same document.\n */\n list: {\n type: String\n },\n\n /**\n * A regular expression that the value is checked against.\n * The pattern must match the entire value, not just some subset.\n */\n pattern: {\n type: String\n },\n\n /**\n * The text usually displayed in a tooltip popup when the mouse is over the field.\n * @type {string}\n */\n title: {\n type: String\n }\n };\n }\n}\n\ncustomElements.define(TextFieldElement.is, TextFieldElement);\n\nexport { TextFieldElement };\n","import '@vaadin/vaadin-lumo-styles/font-icons.js';\nimport '@vaadin/vaadin-lumo-styles/mixins/field-button.js';\nimport '@vaadin/vaadin-text-field/theme/lumo/vaadin-text-field.js';\nimport { html } from '@polymer/polymer/lib/utils/html-tag.js';\n\nconst $_documentContainer = html`<dom-module id=\"lumo-date-picker\" theme-for=\"vaadin-date-picker\">\n <template>\n <style include=\"lumo-field-button\">\n :host {\n outline: none;\n }\n\n [part=\"toggle-button\"]::before {\n content: var(--lumo-icons-calendar);\n }\n\n [part=\"clear-button\"]::before {\n content: var(--lumo-icons-cross);\n }\n </style>\n </template>\n</dom-module>`;\n\ndocument.head.appendChild($_documentContainer.content);\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n/*\nExtremely simple css parser. Intended to be not more than what we need\nand definitely not necessarily correct =).\n*/\n\n'use strict';\n\n/** @unrestricted */\nclass StyleNode {\n constructor() {\n /** @type {number} */\n this['start'] = 0;\n /** @type {number} */\n this['end'] = 0;\n /** @type {StyleNode} */\n this['previous'] = null;\n /** @type {StyleNode} */\n this['parent'] = null;\n /** @type {Array<StyleNode>} */\n this['rules'] = null;\n /** @type {string} */\n this['parsedCssText'] = '';\n /** @type {string} */\n this['cssText'] = '';\n /** @type {boolean} */\n this['atRule'] = false;\n /** @type {number} */\n this['type'] = 0;\n /** @type {string} */\n this['keyframesName'] = '';\n /** @type {string} */\n this['selector'] = '';\n /** @type {string} */\n this['parsedSelector'] = '';\n }\n}\n\nexport {StyleNode};\n\n// given a string of css, return a simple rule tree\n/**\n * @param {string} text\n * @return {StyleNode}\n */\nexport function parse(text) {\n text = clean(text);\n return parseCss(lex(text), text);\n}\n\n// remove stuff we don't care about that may hinder parsing\n/**\n * @param {string} cssText\n * @return {string}\n */\nfunction clean(cssText) {\n return cssText.replace(RX.comments, '').replace(RX.port, '');\n}\n\n// super simple {...} lexer that returns a node tree\n/**\n * @param {string} text\n * @return {!StyleNode}\n */\nfunction lex(text) {\n let root = new StyleNode();\n root['start'] = 0;\n root['end'] = text.length;\n let n = root;\n for (let i = 0, l = text.length; i < l; i++) {\n if (text[i] === OPEN_BRACE) {\n if (!n['rules']) {\n n['rules'] = [];\n }\n let p = n;\n let previous = p['rules'][p['rules'].length - 1] || null;\n n = new StyleNode();\n n['start'] = i + 1;\n n['parent'] = p;\n n['previous'] = previous;\n p['rules'].push(n);\n } else if (text[i] === CLOSE_BRACE) {\n n['end'] = i + 1;\n n = n['parent'] || root;\n }\n }\n return root;\n}\n\n// add selectors/cssText to node tree\n/**\n * @param {StyleNode} node\n * @param {string} text\n * @return {!StyleNode}\n */\nfunction parseCss(node, text) {\n let t = text.substring(node['start'], node['end'] - 1);\n node['parsedCssText'] = node['cssText'] = t.trim();\n if (node['parent']) {\n let ss = node['previous']\n ? node['previous']['end']\n : node['parent']['start'];\n t = text.substring(ss, node['start'] - 1);\n t = _expandUnicodeEscapes(t);\n t = t.replace(RX.multipleSpaces, ' ');\n // TODO(sorvell): ad hoc; make selector include only after last ;\n // helps with mixin syntax\n t = t.substring(t.lastIndexOf(';') + 1);\n let s = (node['parsedSelector'] = node['selector'] = t.trim());\n node['atRule'] = s.indexOf(AT_START) === 0;\n // note, support a subset of rule types...\n if (node['atRule']) {\n if (s.indexOf(MEDIA_START) === 0) {\n node['type'] = types.MEDIA_RULE;\n } else if (s.match(RX.keyframesRule)) {\n node['type'] = types.KEYFRAMES_RULE;\n node['keyframesName'] = node['selector'].split(RX.multipleSpaces).pop();\n }\n } else {\n if (s.indexOf(VAR_START) === 0) {\n node['type'] = types.MIXIN_RULE;\n } else {\n node['type'] = types.STYLE_RULE;\n }\n }\n }\n let r$ = node['rules'];\n if (r$) {\n for (let i = 0, l = r$.length, r; i < l && (r = r$[i]); i++) {\n parseCss(r, text);\n }\n }\n return node;\n}\n\n/**\n * conversion of sort unicode escapes with spaces like `\\33 ` (and longer) into\n * expanded form that doesn't require trailing space `\\000033`\n * @param {string} s\n * @return {string}\n */\nfunction _expandUnicodeEscapes(s) {\n return s.replace(/\\\\([0-9a-f]{1,6})\\s/gi, function () {\n let code = arguments[1],\n repeat = 6 - code.length;\n while (repeat--) {\n code = '0' + code;\n }\n return '\\\\' + code;\n });\n}\n\n/**\n * stringify parsed css.\n * @param {StyleNode} node\n * @param {boolean=} preserveProperties\n * @param {string=} text\n * @return {string}\n */\nexport function stringify(node, preserveProperties, text = '') {\n // calc rule cssText\n let cssText = '';\n if (node['cssText'] || node['rules']) {\n let r$ = node['rules'];\n if (r$ && !_hasMixinRules(r$)) {\n for (let i = 0, l = r$.length, r; i < l && (r = r$[i]); i++) {\n cssText = stringify(r, preserveProperties, cssText);\n }\n } else {\n cssText = preserveProperties\n ? node['cssText']\n : removeCustomProps(node['cssText']);\n cssText = cssText.trim();\n if (cssText) {\n cssText = ' ' + cssText + '\\n';\n }\n }\n }\n // emit rule if there is cssText\n if (cssText) {\n if (node['selector']) {\n text += node['selector'] + ' ' + OPEN_BRACE + '\\n';\n }\n text += cssText;\n if (node['selector']) {\n text += CLOSE_BRACE + '\\n\\n';\n }\n }\n return text;\n}\n\n/**\n * @param {Array<StyleNode>} rules\n * @return {boolean}\n */\nfunction _hasMixinRules(rules) {\n let r = rules[0];\n return (\n Boolean(r) &&\n Boolean(r['selector']) &&\n r['selector'].indexOf(VAR_START) === 0\n );\n}\n\n/**\n * @param {string} cssText\n * @return {string}\n */\nfunction removeCustomProps(cssText) {\n cssText = removeCustomPropAssignment(cssText);\n return removeCustomPropApply(cssText);\n}\n\n/**\n * @param {string} cssText\n * @return {string}\n */\nexport function removeCustomPropAssignment(cssText) {\n return cssText.replace(RX.customProp, '').replace(RX.mixinProp, '');\n}\n\n/**\n * @param {string} cssText\n * @return {string}\n */\nfunction removeCustomPropApply(cssText) {\n return cssText.replace(RX.mixinApply, '').replace(RX.varApply, '');\n}\n\n/** @enum {number} */\nexport const types = {\n STYLE_RULE: 1,\n KEYFRAMES_RULE: 7,\n MEDIA_RULE: 4,\n MIXIN_RULE: 1000,\n};\n\nconst OPEN_BRACE = '{';\nconst CLOSE_BRACE = '}';\n\n// helper regexp's\nconst RX = {\n comments: /\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//gim,\n port: /@import[^;]*;/gim,\n customProp: /(?:^[^;\\-\\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\\n]|$)/gim,\n mixinProp: /(?:^[^;\\-\\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\\n]|$)?/gim,\n mixinApply: /@apply\\s*\\(?[^);]*\\)?\\s*(?:[;\\n]|$)?/gim,\n varApply: /[^;:]*?:[^;]*?var\\([^;]*\\)(?:[;\\n]|$)?/gim,\n keyframesRule: /^@[^\\s]*keyframes/,\n multipleSpaces: /\\s+/g,\n};\n\nconst VAR_START = '--';\nconst MEDIA_START = '@media';\nconst AT_START = '@';\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\n/** @type {!Set<string>} */\nconst styleTextSet = new Set();\n\nexport const scopingAttribute = 'shady-unscoped';\n\n/**\n * Add a specifically-marked style to the document directly, and only one copy of that style.\n *\n * @param {!HTMLStyleElement} style\n * @return {undefined}\n */\nexport function processUnscopedStyle(style) {\n const text = style.textContent;\n if (!styleTextSet.has(text)) {\n styleTextSet.add(text);\n const newStyle = document.createElement('style');\n newStyle.setAttribute('shady-unscoped', '');\n newStyle.textContent = text;\n document.head.appendChild(newStyle);\n }\n}\n\n/**\n * Check if a style is supposed to be unscoped\n * @param {!HTMLStyleElement} style\n * @return {boolean} true if the style has the unscoping attribute\n */\nexport function isUnscopedStyle(style) {\n return style.hasAttribute(scopingAttribute);\n}\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport {nativeShadow, nativeCssVariables, cssBuild} from './style-settings.js';\nimport {parse, stringify, types, StyleNode} from './css-parse.js'; // eslint-disable-line @typescript-eslint/no-unused-vars\nimport {MEDIA_MATCH} from './common-regex.js';\n// prettier-ignore\nimport {processUnscopedStyle, isUnscopedStyle} from './unscoped-style-handler.js';\n\n/**\n * @param {string|StyleNode} rules\n * @param {function(StyleNode)=} callback\n * @return {string}\n */\nexport function toCssText(rules, callback) {\n if (!rules) {\n return '';\n }\n if (typeof rules === 'string') {\n rules = parse(rules);\n }\n if (callback) {\n forEachRule(rules, callback);\n }\n return stringify(rules, nativeCssVariables);\n}\n\n/**\n * @param {HTMLStyleElement} style\n * @return {StyleNode}\n */\nexport function rulesForStyle(style) {\n if (!style['__cssRules'] && style.textContent) {\n style['__cssRules'] = parse(style.textContent);\n }\n return style['__cssRules'] || null;\n}\n\n// Tests if a rule is a keyframes selector, which looks almost exactly\n// like a normal selector but is not (it has nothing to do with scoping\n// for example).\n/**\n * @param {StyleNode} rule\n * @return {boolean}\n */\nexport function isKeyframesSelector(rule) {\n return (\n Boolean(rule['parent']) && rule['parent']['type'] === types.KEYFRAMES_RULE\n );\n}\n\n/**\n * @param {StyleNode} node\n * @param {Function=} styleRuleCallback\n * @param {Function=} keyframesRuleCallback\n * @param {boolean=} onlyActiveRules\n */\nexport function forEachRule(\n node,\n styleRuleCallback,\n keyframesRuleCallback,\n onlyActiveRules\n) {\n if (!node) {\n return;\n }\n let skipRules = false;\n let type = node['type'];\n if (onlyActiveRules) {\n if (type === types.MEDIA_RULE) {\n let matchMedia = node['selector'].match(MEDIA_MATCH);\n if (matchMedia) {\n // if rule is a non matching @media rule, skip subrules\n if (!window.matchMedia(matchMedia[1]).matches) {\n skipRules = true;\n }\n }\n }\n }\n if (type === types.STYLE_RULE) {\n styleRuleCallback(node);\n } else if (keyframesRuleCallback && type === types.KEYFRAMES_RULE) {\n keyframesRuleCallback(node);\n } else if (type === types.MIXIN_RULE) {\n skipRules = true;\n }\n let r$ = node['rules'];\n if (r$ && !skipRules) {\n for (let i = 0, l = r$.length, r; i < l && (r = r$[i]); i++) {\n forEachRule(r, styleRuleCallback, keyframesRuleCallback, onlyActiveRules);\n }\n }\n}\n\n// add a string of cssText to the document.\n/**\n * @param {string} cssText\n * @param {string} moniker\n * @param {Node} target\n * @param {Node} contextNode\n * @return {HTMLStyleElement}\n */\nexport function applyCss(cssText, moniker, target, contextNode) {\n let style = createScopeStyle(cssText, moniker);\n applyStyle(style, target, contextNode);\n return style;\n}\n\n/**\n * @param {string} cssText\n * @param {string} moniker\n * @return {!HTMLStyleElement}\n */\nexport function createScopeStyle(cssText, moniker) {\n let style = /** @type {HTMLStyleElement} */ (document.createElement('style'));\n if (moniker) {\n style.setAttribute('scope', moniker);\n }\n style.textContent = cssText;\n return style;\n}\n\n/**\n * Track the position of the last added style for placing placeholders\n * @type {Node}\n */\nlet lastHeadApplyNode = null;\n\n// insert a comment node as a styling position placeholder.\n/**\n * @param {string} moniker\n * @return {!Comment}\n */\nexport function applyStylePlaceHolder(moniker) {\n let placeHolder = document.createComment(\n ' Shady DOM styles for ' + moniker + ' '\n );\n let after = lastHeadApplyNode ? lastHeadApplyNode['nextSibling'] : null;\n let scope = document.head;\n scope.insertBefore(placeHolder, after || scope.firstChild);\n lastHeadApplyNode = placeHolder;\n return placeHolder;\n}\n\n/**\n * @param {HTMLStyleElement} style\n * @param {?Node} target\n * @param {?Node} contextNode\n */\nexport function applyStyle(style, target, contextNode) {\n target = target || document.head;\n let after = (contextNode && contextNode.nextSibling) || target.firstChild;\n target.insertBefore(style, after);\n if (!lastHeadApplyNode) {\n lastHeadApplyNode = style;\n } else {\n // only update lastHeadApplyNode if the new style is inserted after the old lastHeadApplyNode\n let position = style.compareDocumentPosition(lastHeadApplyNode);\n if (position === Node.DOCUMENT_POSITION_PRECEDING) {\n lastHeadApplyNode = style;\n }\n }\n}\n\n/**\n * @param {string} buildType\n * @return {boolean}\n */\nexport function isTargetedBuild(buildType) {\n return nativeShadow ? buildType === 'shadow' : buildType === 'shady';\n}\n\n/**\n * Walk from text[start] matching parens and\n * returns position of the outer end paren\n * @param {string} text\n * @param {number} start\n * @return {number}\n */\nexport function findMatchingParen(text, start) {\n let level = 0;\n for (let i = start, l = text.length; i < l; i++) {\n if (text[i] === '(') {\n level++;\n } else if (text[i] === ')') {\n if (--level === 0) {\n return i;\n }\n }\n }\n return -1;\n}\n\n/**\n * @param {string} str\n * @param {function(string, string, string, string)} callback\n */\nexport function processVariableAndFallback(str, callback) {\n // find 'var('\n let start = str.indexOf('var(');\n if (start === -1) {\n // no var?, everything is prefix\n return callback(str, '', '', '');\n }\n //${prefix}var(${inner})${suffix}\n let end = findMatchingParen(str, start + 3);\n let inner = str.substring(start + 4, end);\n let prefix = str.substring(0, start);\n // suffix may have other variables\n let suffix = processVariableAndFallback(str.substring(end + 1), callback);\n let comma = inner.indexOf(',');\n // value and fallback args should be trimmed to match in property lookup\n if (comma === -1) {\n // variable, no fallback\n return callback(prefix, inner.trim(), '', suffix);\n }\n // var(${value},${fallback})\n let value = inner.substring(0, comma).trim();\n let fallback = inner.substring(comma + 1).trim();\n return callback(prefix, value, fallback, suffix);\n}\n\n/**\n * @param {Element} element\n * @param {string} value\n */\nexport function setElementClassRaw(element, value) {\n // use native setAttribute provided by ShadyDOM when setAttribute is patched\n if (nativeShadow) {\n element.setAttribute('class', value);\n } else {\n window['ShadyDOM']['nativeMethods']['setAttribute'].call(\n element,\n 'class',\n value\n );\n }\n}\n\n/**\n * @type {function(*):*}\n */\nexport const wrap =\n (window['ShadyDOM'] && window['ShadyDOM']['wrap']) || ((node) => node);\n\n/**\n * @param {Element | {is: string, extends: string}} element\n * @return {{is: string, typeExtension: string}}\n */\nexport function getIsExtends(element) {\n let localName = element['localName'];\n let is = '',\n typeExtension = '';\n /*\n NOTE: technically, this can be wrong for certain svg elements\n with `-` in the name like `<font-face>`\n */\n if (localName) {\n if (localName.indexOf('-') > -1) {\n is = localName;\n } else {\n typeExtension = localName;\n is = (element.getAttribute && element.getAttribute('is')) || '';\n }\n } else {\n is = /** @type {?} */ (element).is;\n typeExtension = /** @type {?} */ (element).extends;\n }\n return {is, typeExtension};\n}\n\n/**\n * @param {Element|DocumentFragment} element\n * @return {string}\n */\nexport function gatherStyleText(element) {\n /** @type {!Array<string>} */\n const styleTextParts = [];\n const styles = /** @type {!NodeList<!HTMLStyleElement>} */ (element.querySelectorAll(\n 'style'\n ));\n for (let i = 0; i < styles.length; i++) {\n const style = styles[i];\n if (isUnscopedStyle(style)) {\n if (!nativeShadow) {\n processUnscopedStyle(style);\n style.parentNode.removeChild(style);\n }\n } else {\n styleTextParts.push(style.textContent);\n style.parentNode.removeChild(style);\n }\n }\n return styleTextParts.join('').trim();\n}\n\n/**\n * Split a selector separated by commas into an array in a smart way\n * @param {string} selector\n * @return {!Array<string>}\n */\nexport function splitSelectorList(selector) {\n const parts = [];\n let part = '';\n for (let i = 0; i >= 0 && i < selector.length; i++) {\n // A selector with parentheses will be one complete part\n if (selector[i] === '(') {\n // find the matching paren\n const end = findMatchingParen(selector, i);\n // push the paren block into the part\n part += selector.slice(i, end + 1);\n // move the index to after the paren block\n i = end;\n } else if (selector[i] === ',') {\n parts.push(part);\n part = '';\n } else {\n part += selector[i];\n }\n }\n // catch any pieces after the last comma\n if (part) {\n parts.push(part);\n }\n return parts;\n}\n\nconst CSS_BUILD_ATTR = 'css-build';\n\n/**\n * Return the polymer-css-build \"build type\" applied to this element\n *\n * @param {!HTMLElement} element\n * @return {string} Can be \"\", \"shady\", or \"shadow\"\n */\nexport function getCssBuild(element) {\n if (cssBuild !== undefined) {\n return /** @type {string} */ (cssBuild);\n }\n if (element.__cssBuild === undefined) {\n // try attribute first, as it is the common case\n const attrValue = element.getAttribute(CSS_BUILD_ATTR);\n if (attrValue) {\n element.__cssBuild = attrValue;\n } else {\n const buildComment = getBuildComment(element);\n if (buildComment !== '') {\n // remove build comment so it is not needlessly copied into every element instance\n removeBuildComment(element);\n }\n element.__cssBuild = buildComment;\n }\n }\n return element.__cssBuild || '';\n}\n\n/**\n * Check if the given element, either a <template> or <style>, has been processed\n * by polymer-css-build.\n *\n * If so, then we can make a number of optimizations:\n * - polymer-css-build will decompose mixins into individual CSS Custom Properties,\n * so the ApplyShim can be skipped entirely.\n * - Under native ShadowDOM, the style text can just be copied into each instance\n * without modification\n * - If the build is \"shady\" and ShadyDOM is in use, the styling does not need\n * scoping beyond the shimming of CSS Custom Properties\n *\n * @param {!HTMLElement} element\n * @return {boolean}\n */\nexport function elementHasBuiltCss(element) {\n return getCssBuild(element) !== '';\n}\n\n/**\n * For templates made with tagged template literals, polymer-css-build will\n * insert a comment of the form `<!--css-build:shadow-->`\n *\n * @param {!HTMLElement} element\n * @return {string}\n */\nexport function getBuildComment(element) {\n const buildComment =\n element.localName === 'template'\n ? /** @type {!HTMLTemplateElement} */ (element).content.firstChild\n : element.firstChild;\n if (buildComment instanceof Comment) {\n const commentParts = buildComment.textContent.trim().split(':');\n if (commentParts[0] === CSS_BUILD_ATTR) {\n return commentParts[1];\n }\n }\n return '';\n}\n\n/**\n * Check if the css build status is optimal, and do no unneeded work.\n *\n * @param {string=} cssBuild CSS build status\n * @return {boolean} css build is optimal or not\n */\nexport function isOptimalCssBuild(cssBuild = '') {\n // CSS custom property shim always requires work\n if (cssBuild === '' || !nativeCssVariables) {\n return false;\n }\n return nativeShadow ? cssBuild === 'shadow' : cssBuild === 'shady';\n}\n\n/**\n * @param {!HTMLElement} element\n */\nfunction removeBuildComment(element) {\n const buildComment =\n element.localName === 'template'\n ? /** @type {!HTMLTemplateElement} */ (element).content.firstChild\n : element.firstChild;\n buildComment.parentNode.removeChild(buildComment);\n}\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n/*\n * The apply shim simulates the behavior of `@apply` proposed at\n * https://tabatkins.github.io/specs/css-apply-rule/.\n * The approach is to convert a property like this:\n *\n * --foo: {color: red; background: blue;}\n *\n * to this:\n *\n * --foo_-_color: red;\n * --foo_-_background: blue;\n *\n * Then where `@apply --foo` is used, that is converted to:\n *\n * color: var(--foo_-_color);\n * background: var(--foo_-_background);\n *\n * This approach generally works but there are some issues and limitations.\n * Consider, for example, that somewhere *between* where `--foo` is set and used,\n * another element sets it to:\n *\n * --foo: { border: 2px solid red; }\n *\n * We must now ensure that the color and background from the previous setting\n * do not apply. This is accomplished by changing the property set to this:\n *\n * --foo_-_border: 2px solid red;\n * --foo_-_color: initial;\n * --foo_-_background: initial;\n *\n * This works but introduces one new issue.\n * Consider this setup at the point where the `@apply` is used:\n *\n * background: orange;\n * `@apply` --foo;\n *\n * In this case the background will be unset (initial) rather than the desired\n * `orange`. We address this by altering the property set to use a fallback\n * value like this:\n *\n * color: var(--foo_-_color);\n * background: var(--foo_-_background, orange);\n * border: var(--foo_-_border);\n *\n * Note that the default is retained in the property set and the `background` is\n * the desired `orange`. This leads us to a limitation.\n *\n * Limitation 1:\n\n * Only properties in the rule where the `@apply`\n * is used are considered as default values.\n * If another rule matches the element and sets `background` with\n * less specificity than the rule in which `@apply` appears,\n * the `background` will not be set.\n *\n * Limitation 2:\n *\n * When using Polymer's `updateStyles` api, new properties may not be set for\n * `@apply` properties.\n\n*/\n\n'use strict';\n\n// prettier-ignore\nimport {forEachRule, processVariableAndFallback, rulesForStyle, toCssText, gatherStyleText} from './style-util.js';\nimport {MIXIN_MATCH, VAR_ASSIGN} from './common-regex.js';\nimport {detectMixin} from './common-utils.js';\nimport {StyleNode} from './css-parse.js'; // eslint-disable-line @typescript-eslint/no-unused-vars\n\nconst APPLY_NAME_CLEAN = /;\\s*/m;\nconst INITIAL_INHERIT = /^\\s*(initial)|(inherit)\\s*$/;\nconst IMPORTANT = /\\s*!important/;\n\n// separator used between mixin-name and mixin-property-name when producing properties\n// NOTE: plain '-' may cause collisions in user styles\nconst MIXIN_VAR_SEP = '_-_';\n\n/**\n * @typedef {!Object<string, string>}\n */\nlet PropertyEntry; // eslint-disable-line @typescript-eslint/no-unused-vars\n\n/**\n * @typedef {!Object<string, boolean>}\n */\nlet DependantsEntry; // eslint-disable-line @typescript-eslint/no-unused-vars\n\n/** @typedef {{\n * properties: PropertyEntry,\n * dependants: DependantsEntry\n * }}\n */\nlet MixinMapEntry; // eslint-disable-line @typescript-eslint/no-unused-vars\n\n// map of mixin to property names\n// --foo: {border: 2px} -> {properties: {(--foo, ['border'])}, dependants: {'element-name': proto}}\nclass MixinMap {\n constructor() {\n /** @type {!Object<string, !MixinMapEntry>} */\n this._map = {};\n }\n /**\n * @param {string} name\n * @param {!PropertyEntry} props\n */\n set(name, props) {\n name = name.trim();\n this._map[name] = {\n properties: props,\n dependants: {},\n };\n }\n /**\n * @param {string} name\n * @return {MixinMapEntry}\n */\n get(name) {\n name = name.trim();\n return this._map[name] || null;\n }\n}\n\n/**\n * Callback for when an element is marked invalid\n * @type {?function(string)}\n */\nlet invalidCallback = null;\n\n/** @unrestricted */\nclass ApplyShim {\n constructor() {\n /** @type {?string} */\n this._currentElement = null;\n /** @type {HTMLMetaElement} */\n this._measureElement = null;\n this._map = new MixinMap();\n }\n /**\n * return true if `cssText` contains a mixin definition or consumption\n * @param {string} cssText\n * @return {boolean}\n */\n detectMixin(cssText) {\n return detectMixin(cssText);\n }\n\n /**\n * Gather styles into one style for easier processing\n * @param {!HTMLTemplateElement} template\n * @return {HTMLStyleElement}\n */\n gatherStyles(template) {\n const styleText = gatherStyleText(template.content);\n if (styleText) {\n const style = /** @type {!HTMLStyleElement} */ (document.createElement(\n 'style'\n ));\n style.textContent = styleText;\n template.content.insertBefore(style, template.content.firstChild);\n return style;\n }\n return null;\n }\n /**\n * @param {!HTMLTemplateElement} template\n * @param {string} elementName\n * @return {StyleNode}\n */\n transformTemplate(template, elementName) {\n if (template._gatheredStyle === undefined) {\n template._gatheredStyle = this.gatherStyles(template);\n }\n /** @type {HTMLStyleElement} */\n const style = template._gatheredStyle;\n return style ? this.transformStyle(style, elementName) : null;\n }\n /**\n * @param {!HTMLStyleElement} style\n * @param {string} elementName\n * @return {StyleNode}\n */\n transformStyle(style, elementName = '') {\n let ast = rulesForStyle(style);\n this.transformRules(ast, elementName);\n style.textContent = toCssText(ast);\n return ast;\n }\n /**\n * @param {!HTMLStyleElement} style\n * @return {StyleNode}\n */\n transformCustomStyle(style) {\n let ast = rulesForStyle(style);\n forEachRule(ast, (rule) => {\n if (rule['selector'] === ':root') {\n rule['selector'] = 'html';\n }\n this.transformRule(rule);\n });\n style.textContent = toCssText(ast);\n return ast;\n }\n /**\n * @param {StyleNode} rules\n * @param {string} elementName\n */\n transformRules(rules, elementName) {\n this._currentElement = elementName;\n forEachRule(rules, (r) => {\n this.transformRule(r);\n });\n this._currentElement = null;\n }\n /**\n * @param {!StyleNode} rule\n */\n transformRule(rule) {\n rule['cssText'] = this.transformCssText(rule['parsedCssText'], rule);\n // :root was only used for variable assignment in property shim,\n // but generates invalid selectors with real properties.\n // replace with `:host > *`, which serves the same effect\n if (rule['selector'] === ':root') {\n rule['selector'] = ':host > *';\n }\n }\n /**\n * @param {string} cssText\n * @param {!StyleNode} rule\n * @return {string}\n */\n transformCssText(cssText, rule) {\n // produce variables\n cssText = cssText.replace(\n VAR_ASSIGN,\n (matchText, propertyName, valueProperty, valueMixin) =>\n this._produceCssProperties(\n matchText,\n propertyName,\n valueProperty,\n valueMixin,\n rule\n )\n );\n // consume mixins\n return this._consumeCssProperties(cssText, rule);\n }\n /**\n * @param {string} property\n * @return {string}\n */\n _getInitialValueForProperty(property) {\n if (!this._measureElement) {\n this._measureElement = /** @type {HTMLMetaElement} */ (document.createElement(\n 'meta'\n ));\n this._measureElement.setAttribute('apply-shim-measure', '');\n this._measureElement.style.all = 'initial';\n document.head.appendChild(this._measureElement);\n }\n return window\n .getComputedStyle(this._measureElement)\n .getPropertyValue(property);\n }\n /**\n * Walk over all rules before this rule to find fallbacks for mixins\n *\n * @param {!StyleNode} startRule\n * @return {!Object}\n */\n _fallbacksFromPreviousRules(startRule) {\n // find the \"top\" rule\n let topRule = startRule;\n while (topRule['parent']) {\n topRule = topRule['parent'];\n }\n const fallbacks = {};\n let seenStartRule = false;\n forEachRule(topRule, (r) => {\n // stop when we hit the input rule\n seenStartRule = seenStartRule || r === startRule;\n if (seenStartRule) {\n return;\n }\n // NOTE: Only matching selectors are \"safe\" for this fallback processing\n // It would be prohibitive to run `matchesSelector()` on each selector,\n // so we cheat and only check if the same selector string is used, which\n // guarantees things like specificity matching\n if (r['selector'] === startRule['selector']) {\n Object.assign(fallbacks, this._cssTextToMap(r['parsedCssText']));\n }\n });\n return fallbacks;\n }\n /**\n * replace mixin consumption with variable consumption\n * @param {string} text\n * @param {!StyleNode=} rule\n * @return {string}\n */\n _consumeCssProperties(text, rule) {\n /** @type {Array} */\n let m = null;\n // loop over text until all mixins with defintions have been applied\n while ((m = MIXIN_MATCH.exec(text))) {\n let matchText = m[0];\n let mixinName = m[1];\n let idx = m.index;\n // collect properties before apply to be \"defaults\" if mixin might override them\n // match includes a \"prefix\", so find the start and end positions of @apply\n let applyPos = idx + matchText.indexOf('@apply');\n let afterApplyPos = idx + matchText.length;\n // find props defined before this @apply\n let textBeforeApply = text.slice(0, applyPos);\n let textAfterApply = text.slice(afterApplyPos);\n let defaults = rule ? this._fallbacksFromPreviousRules(rule) : {};\n Object.assign(defaults, this._cssTextToMap(textBeforeApply));\n let replacement = this._atApplyToCssProperties(mixinName, defaults);\n // use regex match position to replace mixin, keep linear processing time\n text = `${textBeforeApply}${replacement}${textAfterApply}`;\n // move regex search to _after_ replacement\n MIXIN_MATCH.lastIndex = idx + replacement.length;\n }\n return text;\n }\n /**\n * produce variable consumption at the site of mixin consumption\n * `@apply` --foo; -> for all props (${propname}: var(--foo_-_${propname}, ${fallback[propname]}}))\n * Example:\n * border: var(--foo_-_border); padding: var(--foo_-_padding, 2px)\n *\n * @param {string} mixinName\n * @param {Object} fallbacks\n * @return {string}\n */\n _atApplyToCssProperties(mixinName, fallbacks) {\n mixinName = mixinName.replace(APPLY_NAME_CLEAN, '');\n let vars = [];\n let mixinEntry = this._map.get(mixinName);\n // if we depend on a mixin before it is created\n // make a sentinel entry in the map to add this element as a dependency for when it is defined.\n if (!mixinEntry) {\n this._map.set(mixinName, {});\n mixinEntry = this._map.get(mixinName);\n }\n if (mixinEntry) {\n if (this._currentElement) {\n mixinEntry.dependants[this._currentElement] = true;\n }\n let p, parts, f;\n const properties = mixinEntry.properties;\n for (p in properties) {\n f = fallbacks && fallbacks[p];\n parts = [p, ': var(', mixinName, MIXIN_VAR_SEP, p];\n if (f) {\n parts.push(',', f.replace(IMPORTANT, ''));\n }\n parts.push(')');\n if (IMPORTANT.test(properties[p])) {\n parts.push(' !important');\n }\n vars.push(parts.join(''));\n }\n }\n return vars.join('; ');\n }\n\n /**\n * @param {string} property\n * @param {string} value\n * @return {string}\n */\n _replaceInitialOrInherit(property, value) {\n let match = INITIAL_INHERIT.exec(value);\n if (match) {\n if (match[1]) {\n // initial\n // replace `initial` with the concrete initial value for this property\n value = this._getInitialValueForProperty(property);\n } else {\n // inherit\n // with this purposfully illegal value, the variable will be invalid at\n // compute time (https://www.w3.org/TR/css-variables/#invalid-at-computed-value-time)\n // and for inheriting values, will behave similarly\n // we cannot support the same behavior for non inheriting values like 'border'\n value = 'apply-shim-inherit';\n }\n }\n return value;\n }\n\n /**\n * \"parse\" a mixin definition into a map of properties and values\n * cssTextToMap('border: 2px solid black') -> ('border', '2px solid black')\n * @param {string} text\n * @param {boolean=} replaceInitialOrInherit\n * @return {!Object<string, string>}\n */\n _cssTextToMap(text, replaceInitialOrInherit = false) {\n let props = text.split(';');\n let property, value;\n let out = {};\n for (let i = 0, p, sp; i < props.length; i++) {\n p = props[i];\n if (p) {\n sp = p.split(':');\n // ignore lines that aren't definitions like @media\n if (sp.length > 1) {\n property = sp[0].trim();\n // some properties may have ':' in the value, like data urls\n value = sp.slice(1).join(':');\n if (replaceInitialOrInherit) {\n value = this._replaceInitialOrInherit(property, value);\n }\n out[property] = value;\n }\n }\n }\n return out;\n }\n\n /**\n * @param {MixinMapEntry} mixinEntry\n */\n _invalidateMixinEntry(mixinEntry) {\n if (!invalidCallback) {\n return;\n }\n for (let elementName in mixinEntry.dependants) {\n if (elementName !== this._currentElement) {\n invalidCallback(elementName);\n }\n }\n }\n\n /**\n * @param {string} matchText\n * @param {string} propertyName\n * @param {?string} valueProperty\n * @param {?string} valueMixin\n * @param {!StyleNode} rule\n * @return {string}\n */\n _produceCssProperties(\n matchText,\n propertyName,\n valueProperty,\n valueMixin,\n rule\n ) {\n // handle case where property value is a mixin\n if (valueProperty) {\n // form: --mixin2: var(--mixin1), where --mixin1 is in the map\n processVariableAndFallback(valueProperty, (prefix, value) => {\n if (value && this._map.get(value)) {\n valueMixin = `@apply ${value};`;\n }\n });\n }\n if (!valueMixin) {\n return matchText;\n }\n let mixinAsProperties = this._consumeCssProperties('' + valueMixin, rule);\n let prefix = matchText.slice(0, matchText.indexOf('--'));\n // `initial` and `inherit` as properties in a map should be replaced because\n // these keywords are eagerly evaluated when the mixin becomes CSS Custom Properties,\n // and would set the variable value, rather than carry the keyword to the `var()` usage.\n let mixinValues = this._cssTextToMap(mixinAsProperties, true);\n let combinedProps = mixinValues;\n let mixinEntry = this._map.get(propertyName);\n let oldProps = mixinEntry && mixinEntry.properties;\n if (oldProps) {\n // NOTE: since we use mixin, the map of properties is updated here\n // and this is what we want.\n combinedProps = Object.assign(Object.create(oldProps), mixinValues);\n } else {\n this._map.set(propertyName, combinedProps);\n }\n let out = [];\n let p, v;\n // set variables defined by current mixin\n let needToInvalidate = false;\n for (p in combinedProps) {\n v = mixinValues[p];\n // if property not defined by current mixin, set initial\n if (v === undefined) {\n v = 'initial';\n }\n if (oldProps && !(p in oldProps)) {\n needToInvalidate = true;\n }\n out.push(`${propertyName}${MIXIN_VAR_SEP}${p}: ${v}`);\n }\n if (needToInvalidate) {\n this._invalidateMixinEntry(mixinEntry);\n }\n if (mixinEntry) {\n mixinEntry.properties = combinedProps;\n }\n // because the mixinMap is global, the mixin might conflict with\n // a different scope's simple variable definition:\n // Example:\n // some style somewhere:\n // --mixin1:{ ... }\n // --mixin2: var(--mixin1);\n // some other element:\n // --mixin1: 10px solid red;\n // --foo: var(--mixin1);\n // In this case, we leave the original variable definition in place.\n if (valueProperty) {\n prefix = `${matchText};${prefix}`;\n }\n return `${prefix}${out.join('; ')};`;\n }\n}\n\n/* exports */\n/* eslint-disable no-self-assign */\nApplyShim.prototype['detectMixin'] = ApplyShim.prototype.detectMixin;\nApplyShim.prototype['transformStyle'] = ApplyShim.prototype.transformStyle;\nApplyShim.prototype['transformCustomStyle'] =\n ApplyShim.prototype.transformCustomStyle;\nApplyShim.prototype['transformRules'] = ApplyShim.prototype.transformRules;\nApplyShim.prototype['transformRule'] = ApplyShim.prototype.transformRule;\nApplyShim.prototype['transformTemplate'] =\n ApplyShim.prototype.transformTemplate;\nApplyShim.prototype['_separator'] = MIXIN_VAR_SEP;\n/* eslint-enable no-self-assign */\nObject.defineProperty(ApplyShim.prototype, 'invalidCallback', {\n /** @return {?function(string)} */\n get() {\n return invalidCallback;\n },\n /** @param {?function(string)} cb */\n set(cb) {\n invalidCallback = cb;\n },\n});\n\nexport default ApplyShim;\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\n/**\n * @const {!Object<string, !HTMLTemplateElement>}\n */\nconst templateMap = {};\nexport default templateMap;\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\nimport templateMap from './template-map.js';\nimport {StyleNode} from './css-parse.js'; // eslint-disable-line @typescript-eslint/no-unused-vars\n\n/*\n * Utilities for handling invalidating apply-shim mixins for a given template.\n *\n * The invalidation strategy involves keeping track of the \"current\" version of a template's mixins, and updating that count when a mixin is invalidated.\n * The template\n */\n\n/** @const {string} */\nconst CURRENT_VERSION = '_applyShimCurrentVersion';\n\n/** @const {string} */\nconst NEXT_VERSION = '_applyShimNextVersion';\n\n/** @const {string} */\nconst VALIDATING_VERSION = '_applyShimValidatingVersion';\n\n/**\n * @const {Promise<void>}\n */\nconst promise = Promise.resolve();\n\n/**\n * @param {string} elementName\n */\nexport function invalidate(elementName) {\n let template = templateMap[elementName];\n if (template) {\n invalidateTemplate(template);\n }\n}\n\n/**\n * This function can be called multiple times to mark a template invalid\n * and signal that the style inside must be regenerated.\n *\n * Use `startValidatingTemplate` to begin an asynchronous validation cycle.\n * During that cycle, call `templateIsValidating` to see if the template must\n * be revalidated\n * @param {HTMLTemplateElement} template\n */\nexport function invalidateTemplate(template) {\n // default the current version to 0\n template[CURRENT_VERSION] = template[CURRENT_VERSION] || 0;\n // ensure the \"validating for\" flag exists\n template[VALIDATING_VERSION] = template[VALIDATING_VERSION] || 0;\n // increment the next version\n template[NEXT_VERSION] = (template[NEXT_VERSION] || 0) + 1;\n}\n\n/**\n * @param {string} elementName\n * @return {boolean}\n */\nexport function isValid(elementName) {\n let template = templateMap[elementName];\n if (template) {\n return templateIsValid(template);\n }\n return true;\n}\n\n/**\n * @param {HTMLTemplateElement} template\n * @return {boolean}\n */\nexport function templateIsValid(template) {\n return template[CURRENT_VERSION] === template[NEXT_VERSION];\n}\n\n/**\n * @param {string} elementName\n * @return {boolean}\n */\nexport function isValidating(elementName) {\n let template = templateMap[elementName];\n if (template) {\n return templateIsValidating(template);\n }\n return false;\n}\n\n/**\n * Returns true if the template is currently invalid and `startValidating` has been called since the last invalidation.\n * If false, the template must be validated.\n * @param {HTMLTemplateElement} template\n * @return {boolean}\n */\nexport function templateIsValidating(template) {\n return (\n !templateIsValid(template) &&\n template[VALIDATING_VERSION] === template[NEXT_VERSION]\n );\n}\n\n/**\n * the template is marked as `validating` for one microtask so that all instances\n * found in the tree crawl of `applyStyle` will update themselves,\n * but the template will only be updated once.\n * @param {string} elementName\n */\nexport function startValidating(elementName) {\n let template = templateMap[elementName];\n startValidatingTemplate(template);\n}\n\n/**\n * Begin an asynchronous invalidation cycle.\n * This should be called after every validation of a template\n *\n * After one microtask, the template will be marked as valid until the next call to `invalidateTemplate`\n * @param {HTMLTemplateElement} template\n */\nexport function startValidatingTemplate(template) {\n // remember that the current \"next version\" is the reason for this validation cycle\n template[VALIDATING_VERSION] = template[NEXT_VERSION];\n // however, there only needs to be one async task to clear the counters\n if (!template._validating) {\n template._validating = true;\n promise.then(function () {\n // sync the current version to let future invalidations cause a refresh cycle\n template[CURRENT_VERSION] = template[NEXT_VERSION];\n template._validating = false;\n });\n }\n}\n\n/**\n * @return {boolean}\n */\nexport function elementsAreInvalid() {\n for (let elementName in templateMap) {\n let template = templateMap[elementName];\n if (!templateIsValid(template)) {\n return true;\n }\n }\n return false;\n}\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport ApplyShim from '../src/apply-shim.js';\nimport templateMap from '../src/template-map.js';\n// prettier-ignore\nimport {getIsExtends, toCssText, elementHasBuiltCss} from '../src/style-util.js';\nimport * as ApplyShimUtils from '../src/apply-shim-utils.js';\n// prettier-ignore\nimport {getComputedStyleValue, updateNativeProperties} from '../src/common-utils.js';\nimport {CustomStyleInterfaceInterface} from '../src/custom-style-interface.js'; // eslint-disable-line @typescript-eslint/no-unused-vars\n// prettier-ignore\nimport {nativeCssVariables, nativeShadow, cssBuild, disableRuntime} from '../src/style-settings.js';\n\n/** @const {ApplyShim} */\nconst applyShim = new ApplyShim();\n\nclass ApplyShimInterface {\n constructor() {\n /** @type {?CustomStyleInterfaceInterface} */\n this.customStyleInterface = null;\n applyShim['invalidCallback'] = ApplyShimUtils.invalidate;\n }\n ensure() {\n if (this.customStyleInterface) {\n return;\n }\n if (window.ShadyCSS.CustomStyleInterface) {\n this.customStyleInterface = /** @type {!CustomStyleInterfaceInterface} */ (window\n .ShadyCSS.CustomStyleInterface);\n this.customStyleInterface['transformCallback'] = (style) => {\n applyShim.transformCustomStyle(style);\n };\n this.customStyleInterface['validateCallback'] = () => {\n requestAnimationFrame(() => {\n if (this.customStyleInterface['enqueued']) {\n this.flushCustomStyles();\n }\n });\n };\n }\n }\n /**\n * @param {!HTMLTemplateElement} template\n * @param {string} elementName\n */\n prepareTemplate(template, elementName) {\n this.ensure();\n if (elementHasBuiltCss(template)) {\n return;\n }\n templateMap[elementName] = template;\n let ast = applyShim.transformTemplate(template, elementName);\n // save original style ast to use for revalidating instances\n template['_styleAst'] = ast;\n }\n flushCustomStyles() {\n this.ensure();\n if (!this.customStyleInterface) {\n return;\n }\n let styles = this.customStyleInterface['processStyles']();\n if (!this.customStyleInterface['enqueued']) {\n return;\n }\n for (let i = 0; i < styles.length; i++) {\n let cs = styles[i];\n let style = this.customStyleInterface['getStyleForCustomStyle'](cs);\n if (style) {\n applyShim.transformCustomStyle(style);\n }\n }\n this.customStyleInterface['enqueued'] = false;\n }\n /**\n * @param {HTMLElement} element\n * @param {Object=} properties\n */\n styleSubtree(element, properties) {\n this.ensure();\n if (properties) {\n updateNativeProperties(element, properties);\n }\n if (element.shadowRoot) {\n this.styleElement(element);\n let shadowChildren =\n /** @type {!ParentNode} */ (element.shadowRoot).children ||\n element.shadowRoot.childNodes;\n for (let i = 0; i < shadowChildren.length; i++) {\n this.styleSubtree(/** @type {HTMLElement} */ (shadowChildren[i]));\n }\n } else {\n let children = element.children || element.childNodes;\n for (let i = 0; i < children.length; i++) {\n this.styleSubtree(/** @type {HTMLElement} */ (children[i]));\n }\n }\n }\n /**\n * @param {HTMLElement} element\n */\n styleElement(element) {\n this.ensure();\n let {is} = getIsExtends(element);\n let template = templateMap[is];\n if (template && elementHasBuiltCss(template)) {\n return;\n }\n if (template && !ApplyShimUtils.templateIsValid(template)) {\n // only revalidate template once\n if (!ApplyShimUtils.templateIsValidating(template)) {\n this.prepareTemplate(template, is);\n ApplyShimUtils.startValidatingTemplate(template);\n }\n // update this element instance\n let root = element.shadowRoot;\n if (root) {\n let style = /** @type {HTMLStyleElement} */ (root.querySelector(\n 'style'\n ));\n if (style) {\n // reuse the template's style ast, it has all the original css text\n style['__cssRules'] = template['_styleAst'];\n style.textContent = toCssText(template['_styleAst']);\n }\n }\n }\n }\n /**\n * @param {Object=} properties\n */\n styleDocument(properties) {\n this.ensure();\n this.styleSubtree(document.body, properties);\n }\n}\n\nif (!window.ShadyCSS || !window.ShadyCSS.ScopingShim) {\n const applyShimInterface = new ApplyShimInterface();\n let CustomStyleInterface =\n window.ShadyCSS && window.ShadyCSS.CustomStyleInterface;\n\n /** @suppress {duplicate} */\n window.ShadyCSS = {\n /**\n * @param {!HTMLTemplateElement} template\n * @param {string} elementName\n * @param {string=} elementExtends\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n prepareTemplate(template, elementName, elementExtends) {\n applyShimInterface.flushCustomStyles();\n applyShimInterface.prepareTemplate(template, elementName);\n },\n\n /**\n * @param {!HTMLTemplateElement} template\n * @param {string} elementName\n * @param {string=} elementExtends\n */\n prepareTemplateStyles(template, elementName, elementExtends) {\n window.ShadyCSS.prepareTemplate(template, elementName, elementExtends);\n },\n\n /**\n * @param {!HTMLTemplateElement} template\n * @param {string} elementName\n */\n prepareTemplateDom(template, elementName) {}, // eslint-disable-line @typescript-eslint/no-unused-vars\n\n /**\n * @param {!HTMLElement} element\n * @param {Object=} properties\n */\n styleSubtree(element, properties) {\n applyShimInterface.flushCustomStyles();\n applyShimInterface.styleSubtree(element, properties);\n },\n\n /**\n * @param {!HTMLElement} element\n */\n styleElement(element) {\n applyShimInterface.flushCustomStyles();\n applyShimInterface.styleElement(element);\n },\n\n /**\n * @param {Object=} properties\n */\n styleDocument(properties) {\n applyShimInterface.flushCustomStyles();\n applyShimInterface.styleDocument(properties);\n },\n\n /**\n * @param {Element} element\n * @param {string} property\n * @return {string}\n */\n getComputedStyleValue(element, property) {\n return getComputedStyleValue(element, property);\n },\n\n flushCustomStyles() {\n applyShimInterface.flushCustomStyles();\n },\n\n nativeCss: nativeCssVariables,\n nativeShadow: nativeShadow,\n cssBuild: cssBuild,\n disableRuntime: disableRuntime,\n };\n\n if (CustomStyleInterface) {\n window.ShadyCSS.CustomStyleInterface = CustomStyleInterface;\n }\n}\n\nwindow.ShadyCSS.ApplyShim = applyShim;\n","/**\n * @fileoverview\n * @suppress {checkPrototypalTypes}\n * @license Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt The complete set of authors may be found\n * at http://polymer.github.io/AUTHORS.txt The complete set of contributors may\n * be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by\n * Google as part of the polymer project is also subject to an additional IP\n * rights grant found at http://polymer.github.io/PATENTS.txt\n */\nimport { PropertyAccessors } from './property-accessors.js';\n\nimport { dedupingMixin } from '../utils/mixin.js';\n\nconst HOST_DIR = /:host\\(:dir\\((ltr|rtl)\\)\\)/g;\nconst HOST_DIR_REPLACMENT = ':host([dir=\"$1\"])';\n\nconst EL_DIR = /([\\s\\w-#\\.\\[\\]\\*]*):dir\\((ltr|rtl)\\)/g;\nconst EL_DIR_REPLACMENT = ':host([dir=\"$2\"]) $1';\n\nconst DIR_CHECK = /:dir\\((?:ltr|rtl)\\)/;\n\nconst SHIM_SHADOW = Boolean(window['ShadyDOM'] && window['ShadyDOM']['inUse']);\n\n/**\n * @type {!Array<!Polymer_DirMixin>}\n */\nconst DIR_INSTANCES = [];\n\n/** @type {?MutationObserver} */\nlet observer = null;\n\nlet documentDir = '';\n\nfunction getRTL() {\n documentDir = document.documentElement.getAttribute('dir');\n}\n\n/**\n * @param {!Polymer_DirMixin} instance Instance to set RTL status on\n */\nfunction setRTL(instance) {\n if (!instance.__autoDirOptOut) {\n const el = /** @type {!HTMLElement} */(instance);\n el.setAttribute('dir', documentDir);\n }\n}\n\nfunction updateDirection() {\n getRTL();\n documentDir = document.documentElement.getAttribute('dir');\n for (let i = 0; i < DIR_INSTANCES.length; i++) {\n setRTL(DIR_INSTANCES[i]);\n }\n}\n\nfunction takeRecords() {\n if (observer && observer.takeRecords().length) {\n updateDirection();\n }\n}\n\n/**\n * Element class mixin that allows elements to use the `:dir` CSS Selector to\n * have text direction specific styling.\n *\n * With this mixin, any stylesheet provided in the template will transform\n * `:dir` into `:host([dir])` and sync direction with the page via the\n * element's `dir` attribute.\n *\n * Elements can opt out of the global page text direction by setting the `dir`\n * attribute directly in `ready()` or in HTML.\n *\n * Caveats:\n * - Applications must set `<html dir=\"ltr\">` or `<html dir=\"rtl\">` to sync\n * direction\n * - Automatic left-to-right or right-to-left styling is sync'd with the\n * `<html>` element only.\n * - Changing `dir` at runtime is supported.\n * - Opting out of the global direction styling is permanent\n *\n * @mixinFunction\n * @polymer\n * @appliesMixin PropertyAccessors\n * @template T\n * @param {function(new:T)} superClass Class to apply mixin to.\n * @return {function(new:T)} superClass with mixin applied.\n */\nexport const DirMixin = dedupingMixin((base) => {\n\n if (!SHIM_SHADOW) {\n if (!observer) {\n getRTL();\n observer = new MutationObserver(updateDirection);\n observer.observe(document.documentElement, {attributes: true, attributeFilter: ['dir']});\n }\n }\n\n /**\n * @constructor\n * @implements {Polymer_PropertyAccessors}\n * @private\n */\n const elementBase = PropertyAccessors(base);\n\n /**\n * @polymer\n * @mixinClass\n * @implements {Polymer_DirMixin}\n */\n class Dir extends elementBase {\n\n /**\n * @param {string} cssText .\n * @param {string} baseURI .\n * @return {string} .\n * @suppress {missingProperties} Interfaces in closure do not inherit statics, but classes do\n * @nocollapse\n */\n static _processStyleText(cssText, baseURI) {\n // TODO(https://github.com/google/closure-compiler/issues/3240):\n // Change back to just super.methodCall()\n cssText = elementBase._processStyleText.call(this, cssText, baseURI);\n if (!SHIM_SHADOW && DIR_CHECK.test(cssText)) {\n cssText = this._replaceDirInCssText(cssText);\n this.__activateDir = true;\n }\n return cssText;\n }\n\n /**\n * Replace `:dir` in the given CSS text\n *\n * @param {string} text CSS text to replace DIR\n * @return {string} Modified CSS\n * @nocollapse\n */\n static _replaceDirInCssText(text) {\n let replacedText = text;\n replacedText = replacedText.replace(HOST_DIR, HOST_DIR_REPLACMENT);\n replacedText = replacedText.replace(EL_DIR, EL_DIR_REPLACMENT);\n return replacedText;\n }\n\n constructor() {\n super();\n /** @type {boolean} */\n this.__autoDirOptOut = false;\n }\n\n /**\n * @override\n * @suppress {invalidCasts} Closure doesn't understand that `this` is an\n * HTMLElement\n * @return {void}\n */\n ready() {\n super.ready();\n this.__autoDirOptOut = /** @type {!HTMLElement} */(this).hasAttribute('dir');\n }\n\n /**\n * @override\n * @suppress {missingProperties} If it exists on elementBase, it can be\n * super'd\n * @return {void}\n */\n connectedCallback() {\n if (elementBase.prototype.connectedCallback) {\n super.connectedCallback();\n }\n if (this.constructor.__activateDir) {\n takeRecords();\n DIR_INSTANCES.push(this);\n setRTL(this);\n }\n }\n\n /**\n * @override\n * @suppress {missingProperties} If it exists on elementBase, it can be\n * super'd\n * @return {void}\n */\n disconnectedCallback() {\n if (elementBase.prototype.disconnectedCallback) {\n super.disconnectedCallback();\n }\n if (this.constructor.__activateDir) {\n const idx = DIR_INSTANCES.indexOf(this);\n if (idx > -1) {\n DIR_INSTANCES.splice(idx, 1);\n }\n }\n }\n }\n\n Dir.__activateDir = false;\n\n return Dir;\n});\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n/**\n * Module for scheduling flushable pre-render and post-render tasks.\n *\n * @summary Module for scheduling flushable pre-render and post-render tasks.\n */\n\nimport './boot.js';\n\nlet scheduled = false;\nlet beforeRenderQueue = [];\nlet afterRenderQueue = [];\n\nfunction schedule() {\n scheduled = true;\n // before next render\n requestAnimationFrame(function() {\n scheduled = false;\n flushQueue(beforeRenderQueue);\n // after the render\n setTimeout(function() {\n runQueue(afterRenderQueue);\n });\n });\n}\n\nfunction flushQueue(queue) {\n while (queue.length) {\n callMethod(queue.shift());\n }\n}\n\nfunction runQueue(queue) {\n for (let i=0, l=queue.length; i < l; i++) {\n callMethod(queue.shift());\n }\n}\n\nfunction callMethod(info) {\n const context = info[0];\n const callback = info[1];\n const args = info[2];\n try {\n callback.apply(context, args);\n } catch(e) {\n setTimeout(() => {\n throw e;\n });\n }\n}\n\n/**\n * Flushes all `beforeNextRender` tasks, followed by all `afterNextRender`\n * tasks.\n *\n * @return {void}\n */\nexport function flush() {\n while (beforeRenderQueue.length || afterRenderQueue.length) {\n flushQueue(beforeRenderQueue);\n flushQueue(afterRenderQueue);\n }\n scheduled = false;\n}\n\n\n/**\n * Enqueues a callback which will be run before the next render, at\n * `requestAnimationFrame` timing.\n *\n * This method is useful for enqueuing work that requires DOM measurement,\n * since measurement may not be reliable in custom element callbacks before\n * the first render, as well as for batching measurement tasks in general.\n *\n * Tasks in this queue may be flushed by calling `flush()`.\n *\n * @param {*} context Context object the callback function will be bound to\n * @param {function(...*):void} callback Callback function\n * @param {!Array=} args An array of arguments to call the callback function with\n * @return {void}\n */\nexport function beforeNextRender(context, callback, args) {\n if (!scheduled) {\n schedule();\n }\n beforeRenderQueue.push([context, callback, args]);\n}\n\n/**\n * Enqueues a callback which will be run after the next render, equivalent\n * to one task (`setTimeout`) after the next `requestAnimationFrame`.\n *\n * This method is useful for tuning the first-render performance of an\n * element or application by deferring non-critical work until after the\n * first paint. Typical non-render-critical work may include adding UI\n * event listeners and aria attributes.\n *\n * @param {*} context Context object the callback function will be bound to\n * @param {function(...*):void} callback Callback function\n * @param {!Array=} args An array of arguments to call the callback function with\n * @return {void}\n */\nexport function afterNextRender(context, callback, args) {\n if (!scheduled) {\n schedule();\n }\n afterRenderQueue.push([context, callback, args]);\n}\n\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nfunction resolve() {\n document.body.removeAttribute('unresolved');\n}\n\nif (document.readyState === 'interactive' || document.readyState === 'complete') {\n resolve();\n} else {\n window.addEventListener('DOMContentLoaded', resolve);\n}\n\nexport {};\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\nimport './boot.js';\n\nfunction newSplice(index, removed, addedCount) {\n return {\n index: index,\n removed: removed,\n addedCount: addedCount\n };\n}\n\nconst EDIT_LEAVE = 0;\nconst EDIT_UPDATE = 1;\nconst EDIT_ADD = 2;\nconst EDIT_DELETE = 3;\n\n// Note: This function is *based* on the computation of the Levenshtein\n// \"edit\" distance. The one change is that \"updates\" are treated as two\n// edits - not one. With Array splices, an update is really a delete\n// followed by an add. By retaining this, we optimize for \"keeping\" the\n// maximum array items in the original array. For example:\n//\n// 'xxxx123' -> '123yyyy'\n//\n// With 1-edit updates, the shortest path would be just to update all seven\n// characters. With 2-edit updates, we delete 4, leave 3, and add 4. This\n// leaves the substring '123' intact.\nfunction calcEditDistances(current, currentStart, currentEnd,\n old, oldStart, oldEnd) {\n // \"Deletion\" columns\n let rowCount = oldEnd - oldStart + 1;\n let columnCount = currentEnd - currentStart + 1;\n let distances = new Array(rowCount);\n\n // \"Addition\" rows. Initialize null column.\n for (let i = 0; i < rowCount; i++) {\n distances[i] = new Array(columnCount);\n distances[i][0] = i;\n }\n\n // Initialize null row\n for (let j = 0; j < columnCount; j++)\n distances[0][j] = j;\n\n for (let i = 1; i < rowCount; i++) {\n for (let j = 1; j < columnCount; j++) {\n if (equals(current[currentStart + j - 1], old[oldStart + i - 1]))\n distances[i][j] = distances[i - 1][j - 1];\n else {\n let north = distances[i - 1][j] + 1;\n let west = distances[i][j - 1] + 1;\n distances[i][j] = north < west ? north : west;\n }\n }\n }\n\n return distances;\n}\n\n// This starts at the final weight, and walks \"backward\" by finding\n// the minimum previous weight recursively until the origin of the weight\n// matrix.\nfunction spliceOperationsFromEditDistances(distances) {\n let i = distances.length - 1;\n let j = distances[0].length - 1;\n let current = distances[i][j];\n let edits = [];\n while (i > 0 || j > 0) {\n if (i == 0) {\n edits.push(EDIT_ADD);\n j--;\n continue;\n }\n if (j == 0) {\n edits.push(EDIT_DELETE);\n i--;\n continue;\n }\n let northWest = distances[i - 1][j - 1];\n let west = distances[i - 1][j];\n let north = distances[i][j - 1];\n\n let min;\n if (west < north)\n min = west < northWest ? west : northWest;\n else\n min = north < northWest ? north : northWest;\n\n if (min == northWest) {\n if (northWest == current) {\n edits.push(EDIT_LEAVE);\n } else {\n edits.push(EDIT_UPDATE);\n current = northWest;\n }\n i--;\n j--;\n } else if (min == west) {\n edits.push(EDIT_DELETE);\n i--;\n current = west;\n } else {\n edits.push(EDIT_ADD);\n j--;\n current = north;\n }\n }\n\n edits.reverse();\n return edits;\n}\n\n/**\n * Splice Projection functions:\n *\n * A splice map is a representation of how a previous array of items\n * was transformed into a new array of items. Conceptually it is a list of\n * tuples of\n *\n * <index, removed, addedCount>\n *\n * which are kept in ascending index order of. The tuple represents that at\n * the |index|, |removed| sequence of items were removed, and counting forward\n * from |index|, |addedCount| items were added.\n */\n\n/**\n * Lacking individual splice mutation information, the minimal set of\n * splices can be synthesized given the previous state and final state of an\n * array. The basic approach is to calculate the edit distance matrix and\n * choose the shortest path through it.\n *\n * Complexity: O(l * p)\n * l: The length of the current array\n * p: The length of the old array\n *\n * @param {!Array} current The current \"changed\" array for which to\n * calculate splices.\n * @param {number} currentStart Starting index in the `current` array for\n * which splices are calculated.\n * @param {number} currentEnd Ending index in the `current` array for\n * which splices are calculated.\n * @param {!Array} old The original \"unchanged\" array to compare `current`\n * against to determine splices.\n * @param {number} oldStart Starting index in the `old` array for\n * which splices are calculated.\n * @param {number} oldEnd Ending index in the `old` array for\n * which splices are calculated.\n * @return {!Array} Returns an array of splice record objects. Each of these\n * contains: `index` the location where the splice occurred; `removed`\n * the array of removed items from this location; `addedCount` the number\n * of items added at this location.\n */\nfunction calcSplices(current, currentStart, currentEnd,\n old, oldStart, oldEnd) {\n let prefixCount = 0;\n let suffixCount = 0;\n let splice;\n\n let minLength = Math.min(currentEnd - currentStart, oldEnd - oldStart);\n if (currentStart == 0 && oldStart == 0)\n prefixCount = sharedPrefix(current, old, minLength);\n\n if (currentEnd == current.length && oldEnd == old.length)\n suffixCount = sharedSuffix(current, old, minLength - prefixCount);\n\n currentStart += prefixCount;\n oldStart += prefixCount;\n currentEnd -= suffixCount;\n oldEnd -= suffixCount;\n\n if (currentEnd - currentStart == 0 && oldEnd - oldStart == 0)\n return [];\n\n if (currentStart == currentEnd) {\n splice = newSplice(currentStart, [], 0);\n while (oldStart < oldEnd)\n splice.removed.push(old[oldStart++]);\n\n return [ splice ];\n } else if (oldStart == oldEnd)\n return [ newSplice(currentStart, [], currentEnd - currentStart) ];\n\n let ops = spliceOperationsFromEditDistances(\n calcEditDistances(current, currentStart, currentEnd,\n old, oldStart, oldEnd));\n\n splice = undefined;\n let splices = [];\n let index = currentStart;\n let oldIndex = oldStart;\n for (let i = 0; i < ops.length; i++) {\n switch(ops[i]) {\n case EDIT_LEAVE:\n if (splice) {\n splices.push(splice);\n splice = undefined;\n }\n\n index++;\n oldIndex++;\n break;\n case EDIT_UPDATE:\n if (!splice)\n splice = newSplice(index, [], 0);\n\n splice.addedCount++;\n index++;\n\n splice.removed.push(old[oldIndex]);\n oldIndex++;\n break;\n case EDIT_ADD:\n if (!splice)\n splice = newSplice(index, [], 0);\n\n splice.addedCount++;\n index++;\n break;\n case EDIT_DELETE:\n if (!splice)\n splice = newSplice(index, [], 0);\n\n splice.removed.push(old[oldIndex]);\n oldIndex++;\n break;\n }\n }\n\n if (splice) {\n splices.push(splice);\n }\n return splices;\n}\n\nfunction sharedPrefix(current, old, searchLength) {\n for (let i = 0; i < searchLength; i++)\n if (!equals(current[i], old[i]))\n return i;\n return searchLength;\n}\n\nfunction sharedSuffix(current, old, searchLength) {\n let index1 = current.length;\n let index2 = old.length;\n let count = 0;\n while (count < searchLength && equals(current[--index1], old[--index2]))\n count++;\n\n return count;\n}\n\n/**\n * Returns an array of splice records indicating the minimum edits required\n * to transform the `previous` array into the `current` array.\n *\n * Splice records are ordered by index and contain the following fields:\n * - `index`: index where edit started\n * - `removed`: array of removed items from this index\n * - `addedCount`: number of items added at this index\n *\n * This function is based on the Levenshtein \"minimum edit distance\"\n * algorithm. Note that updates are treated as removal followed by addition.\n *\n * The worst-case time complexity of this algorithm is `O(l * p)`\n * l: The length of the current array\n * p: The length of the previous array\n *\n * However, the worst-case complexity is reduced by an `O(n)` optimization\n * to detect any shared prefix & suffix between the two arrays and only\n * perform the more expensive minimum edit distance calculation over the\n * non-shared portions of the arrays.\n *\n * @function\n * @param {!Array} current The \"changed\" array for which splices will be\n * calculated.\n * @param {!Array} previous The \"unchanged\" original array to compare\n * `current` against to determine the splices.\n * @return {!Array} Returns an array of splice record objects. Each of these\n * contains: `index` the location where the splice occurred; `removed`\n * the array of removed items from this location; `addedCount` the number\n * of items added at this location.\n */\nexport function calculateSplices(current, previous) {\n return calcSplices(current, 0, current.length, previous, 0,\n previous.length);\n}\n\nfunction equals(currentValue, previousValue) {\n return currentValue === previousValue;\n}\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\nimport './boot.js';\n\nimport { calculateSplices } from './array-splice.js';\nimport { microTask } from './async.js';\nimport { wrap } from './wrap.js';\n\n/**\n * Returns true if `node` is a slot element\n * @param {!Node} node Node to test.\n * @return {boolean} Returns true if the given `node` is a slot\n * @private\n */\nfunction isSlot(node) {\n return (node.localName === 'slot');\n}\n\n/**\n * Class that listens for changes (additions or removals) to\n * \"flattened nodes\" on a given `node`. The list of flattened nodes consists\n * of a node's children and, for any children that are `<slot>` elements,\n * the expanded flattened list of `assignedNodes`.\n * For example, if the observed node has children `<a></a><slot></slot><b></b>`\n * and the `<slot>` has one `<div>` assigned to it, then the flattened\n * nodes list is `<a></a><div></div><b></b>`. If the `<slot>` has other\n * `<slot>` elements assigned to it, these are flattened as well.\n *\n * The provided `callback` is called whenever any change to this list\n * of flattened nodes occurs, where an addition or removal of a node is\n * considered a change. The `callback` is called with one argument, an object\n * containing an array of any `addedNodes` and `removedNodes`.\n *\n * Note: the callback is called asynchronous to any changes\n * at a microtask checkpoint. This is because observation is performed using\n * `MutationObserver` and the `<slot>` element's `slotchange` event which\n * are asynchronous.\n *\n * An example:\n * ```js\n * class TestSelfObserve extends PolymerElement {\n * static get is() { return 'test-self-observe';}\n * connectedCallback() {\n * super.connectedCallback();\n * this._observer = new FlattenedNodesObserver(this, (info) => {\n * this.info = info;\n * });\n * }\n * disconnectedCallback() {\n * super.disconnectedCallback();\n * this._observer.disconnect();\n * }\n * }\n * customElements.define(TestSelfObserve.is, TestSelfObserve);\n * ```\n *\n * @summary Class that listens for changes (additions or removals) to\n * \"flattened nodes\" on a given `node`.\n * @implements {PolymerDomApi.ObserveHandle}\n */\nexport let FlattenedNodesObserver = class {\n\n /**\n * Returns the list of flattened nodes for the given `node`.\n * This list consists of a node's children and, for any children\n * that are `<slot>` elements, the expanded flattened list of `assignedNodes`.\n * For example, if the observed node has children `<a></a><slot></slot><b></b>`\n * and the `<slot>` has one `<div>` assigned to it, then the flattened\n * nodes list is `<a></a><div></div><b></b>`. If the `<slot>` has other\n * `<slot>` elements assigned to it, these are flattened as well.\n *\n * @param {!HTMLElement|!HTMLSlotElement} node The node for which to\n * return the list of flattened nodes.\n * @return {!Array<!Node>} The list of flattened nodes for the given `node`.\n * @nocollapse See https://github.com/google/closure-compiler/issues/2763\n */\n // eslint-disable-next-line\n static getFlattenedNodes(node) {\n const wrapped = wrap(node);\n if (isSlot(node)) {\n node = /** @type {!HTMLSlotElement} */(node); // eslint-disable-line no-self-assign\n return wrapped.assignedNodes({flatten: true});\n } else {\n return Array.from(wrapped.childNodes).map((node) => {\n if (isSlot(node)) {\n node = /** @type {!HTMLSlotElement} */(node); // eslint-disable-line no-self-assign\n return wrap(node).assignedNodes({flatten: true});\n } else {\n return [node];\n }\n }).reduce((a, b) => a.concat(b), []);\n }\n }\n\n /**\n * @param {!HTMLElement} target Node on which to listen for changes.\n * @param {?function(this: Element, { target: !HTMLElement, addedNodes: !Array<!Element>, removedNodes: !Array<!Element> }):void} callback Function called when there are additions\n * or removals from the target's list of flattened nodes.\n */\n // eslint-disable-next-line\n constructor(target, callback) {\n /**\n * @type {MutationObserver}\n * @private\n */\n this._shadyChildrenObserver = null;\n /**\n * @type {MutationObserver}\n * @private\n */\n this._nativeChildrenObserver = null;\n this._connected = false;\n /**\n * @type {!HTMLElement}\n * @private\n */\n this._target = target;\n this.callback = callback;\n this._effectiveNodes = [];\n this._observer = null;\n this._scheduled = false;\n /**\n * @type {function()}\n * @private\n */\n this._boundSchedule = () => {\n this._schedule();\n };\n this.connect();\n this._schedule();\n }\n\n /**\n * Activates an observer. This method is automatically called when\n * a `FlattenedNodesObserver` is created. It should only be called to\n * re-activate an observer that has been deactivated via the `disconnect` method.\n *\n * @return {void}\n */\n connect() {\n if (isSlot(this._target)) {\n this._listenSlots([this._target]);\n } else if (wrap(this._target).children) {\n this._listenSlots(\n /** @type {!NodeList<!Node>} */ (wrap(this._target).children));\n if (window.ShadyDOM) {\n this._shadyChildrenObserver =\n window.ShadyDOM.observeChildren(this._target, (mutations) => {\n this._processMutations(mutations);\n });\n } else {\n this._nativeChildrenObserver =\n new MutationObserver((mutations) => {\n this._processMutations(mutations);\n });\n this._nativeChildrenObserver.observe(this._target, {childList: true});\n }\n }\n this._connected = true;\n }\n\n /**\n * Deactivates the flattened nodes observer. After calling this method\n * the observer callback will not be called when changes to flattened nodes\n * occur. The `connect` method may be subsequently called to reactivate\n * the observer.\n *\n * @return {void}\n * @override\n */\n disconnect() {\n if (isSlot(this._target)) {\n this._unlistenSlots([this._target]);\n } else if (wrap(this._target).children) {\n this._unlistenSlots(\n /** @type {!NodeList<!Node>} */ (wrap(this._target).children));\n if (window.ShadyDOM && this._shadyChildrenObserver) {\n window.ShadyDOM.unobserveChildren(this._shadyChildrenObserver);\n this._shadyChildrenObserver = null;\n } else if (this._nativeChildrenObserver) {\n this._nativeChildrenObserver.disconnect();\n this._nativeChildrenObserver = null;\n }\n }\n this._connected = false;\n }\n\n /**\n * @return {void}\n * @private\n */\n _schedule() {\n if (!this._scheduled) {\n this._scheduled = true;\n microTask.run(() => this.flush());\n }\n }\n\n /**\n * @param {Array<MutationRecord>} mutations Mutations signaled by the mutation observer\n * @return {void}\n * @private\n */\n _processMutations(mutations) {\n this._processSlotMutations(mutations);\n this.flush();\n }\n\n /**\n * @param {Array<MutationRecord>} mutations Mutations signaled by the mutation observer\n * @return {void}\n * @private\n */\n _processSlotMutations(mutations) {\n if (mutations) {\n for (let i=0; i < mutations.length; i++) {\n let mutation = mutations[i];\n if (mutation.addedNodes) {\n this._listenSlots(mutation.addedNodes);\n }\n if (mutation.removedNodes) {\n this._unlistenSlots(mutation.removedNodes);\n }\n }\n }\n }\n\n /**\n * Flushes the observer causing any pending changes to be immediately\n * delivered the observer callback. By default these changes are delivered\n * asynchronously at the next microtask checkpoint.\n *\n * @return {boolean} Returns true if any pending changes caused the observer\n * callback to run.\n */\n flush() {\n if (!this._connected) {\n return false;\n }\n if (window.ShadyDOM) {\n ShadyDOM.flush();\n }\n if (this._nativeChildrenObserver) {\n this._processSlotMutations(this._nativeChildrenObserver.takeRecords());\n } else if (this._shadyChildrenObserver) {\n this._processSlotMutations(this._shadyChildrenObserver.takeRecords());\n }\n this._scheduled = false;\n let info = {\n target: this._target,\n addedNodes: [],\n removedNodes: []\n };\n let newNodes = this.constructor.getFlattenedNodes(this._target);\n let splices = calculateSplices(newNodes,\n this._effectiveNodes);\n // process removals\n for (let i=0, s; (i<splices.length) && (s=splices[i]); i++) {\n for (let j=0, n; (j < s.removed.length) && (n=s.removed[j]); j++) {\n info.removedNodes.push(n);\n }\n }\n // process adds\n for (let i=0, s; (i<splices.length) && (s=splices[i]); i++) {\n for (let j=s.index; j < s.index + s.addedCount; j++) {\n info.addedNodes.push(newNodes[j]);\n }\n }\n // update cache\n this._effectiveNodes = newNodes;\n let didFlush = false;\n if (info.addedNodes.length || info.removedNodes.length) {\n didFlush = true;\n this.callback.call(this._target, info);\n }\n return didFlush;\n }\n\n /**\n * @param {!Array<!Node>|!NodeList<!Node>} nodeList Nodes that could change\n * @return {void}\n * @private\n */\n _listenSlots(nodeList) {\n for (let i=0; i < nodeList.length; i++) {\n let n = nodeList[i];\n if (isSlot(n)) {\n n.addEventListener('slotchange', this._boundSchedule);\n }\n }\n }\n\n /**\n * @param {!Array<!Node>|!NodeList<!Node>} nodeList Nodes that could change\n * @return {void}\n * @private\n */\n _unlistenSlots(nodeList) {\n for (let i=0; i < nodeList.length; i++) {\n let n = nodeList[i];\n if (isSlot(n)) {\n n.removeEventListener('slotchange', this._boundSchedule);\n }\n }\n }\n\n};","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\nimport '../utils/boot.js';\nimport { wrap } from '../utils/wrap.js';\nimport '../utils/settings.js';\nimport { FlattenedNodesObserver } from '../utils/flattened-nodes-observer.js';\nexport { flush, enqueueDebouncer as addDebouncer } from '../utils/flush.js';\n/* eslint-disable no-unused-vars */\nimport { Debouncer } from '../utils/debounce.js'; // used in type annotations\n/* eslint-enable no-unused-vars */\n\nconst p = Element.prototype;\n/**\n * @const {function(this:Node, string): boolean}\n */\nconst normalizedMatchesSelector = p.matches || p.matchesSelector ||\n p.mozMatchesSelector || p.msMatchesSelector ||\n p.oMatchesSelector || p.webkitMatchesSelector;\n\n/**\n * Cross-platform `element.matches` shim.\n *\n * @function matchesSelector\n * @param {!Node} node Node to check selector against\n * @param {string} selector Selector to match\n * @return {boolean} True if node matched selector\n */\nexport const matchesSelector = function(node, selector) {\n return normalizedMatchesSelector.call(node, selector);\n};\n\n/**\n * Node API wrapper class returned from `Polymer.dom.(target)` when\n * `target` is a `Node`.\n * @implements {PolymerDomApi}\n * @unrestricted\n */\nclass DomApiNative {\n\n /**\n * @param {!Node} node Node for which to create a Polymer.dom helper object.\n */\n constructor(node) {\n if (window['ShadyDOM'] && window['ShadyDOM']['inUse']) {\n window['ShadyDOM']['patch'](node);\n }\n this.node = node;\n }\n\n /**\n * Returns an instance of `FlattenedNodesObserver` that\n * listens for node changes on this element.\n *\n * @param {function(this:HTMLElement, { target: !HTMLElement, addedNodes: !Array<!Element>, removedNodes: !Array<!Element> }):void} callback Called when direct or distributed children\n * of this element changes\n * @return {!PolymerDomApi.ObserveHandle} Observer instance\n * @override\n */\n observeNodes(callback) {\n return new FlattenedNodesObserver(\n /** @type {!HTMLElement} */(this.node), callback);\n }\n\n /**\n * Disconnects an observer previously created via `observeNodes`\n *\n * @param {!PolymerDomApi.ObserveHandle} observerHandle Observer instance\n * to disconnect.\n * @return {void}\n * @override\n */\n unobserveNodes(observerHandle) {\n observerHandle.disconnect();\n }\n\n /**\n * Provided as a backwards-compatible API only. This method does nothing.\n * @return {void}\n */\n notifyObserver() {}\n\n /**\n * Returns true if the provided node is contained with this element's\n * light-DOM children or shadow root, including any nested shadow roots\n * of children therein.\n *\n * @param {Node} node Node to test\n * @return {boolean} Returns true if the given `node` is contained within\n * this element's light or shadow DOM.\n * @override\n */\n deepContains(node) {\n if (wrap(this.node).contains(node)) {\n return true;\n }\n let n = node;\n let doc = node.ownerDocument;\n // walk from node to `this` or `document`\n while (n && n !== doc && n !== this.node) {\n // use logical parentnode, or native ShadowRoot host\n n = wrap(n).parentNode || wrap(n).host;\n }\n return n === this.node;\n }\n\n /**\n * Returns the root node of this node. Equivalent to `getRootNode()`.\n *\n * @return {!Node} Top most element in the dom tree in which the node\n * exists. If the node is connected to a document this is either a\n * shadowRoot or the document; otherwise, it may be the node\n * itself or a node or document fragment containing it.\n * @override\n */\n getOwnerRoot() {\n return wrap(this.node).getRootNode();\n }\n\n /**\n * For slot elements, returns the nodes assigned to the slot; otherwise\n * an empty array. It is equivalent to `<slot>.addignedNodes({flatten:true})`.\n *\n * @return {!Array<!Node>} Array of assigned nodes\n * @override\n */\n getDistributedNodes() {\n return (this.node.localName === 'slot') ?\n wrap(this.node).assignedNodes({flatten: true}) :\n [];\n }\n\n /**\n * Returns an array of all slots this element was distributed to.\n *\n * @return {!Array<!HTMLSlotElement>} Description\n * @override\n */\n getDestinationInsertionPoints() {\n let ip$ = [];\n let n = wrap(this.node).assignedSlot;\n while (n) {\n ip$.push(n);\n n = wrap(n).assignedSlot;\n }\n return ip$;\n }\n\n /**\n * Calls `importNode` on the `ownerDocument` for this node.\n *\n * @param {!Node} node Node to import\n * @param {boolean} deep True if the node should be cloned deeply during\n * import\n * @return {Node} Clone of given node imported to this owner document\n */\n importNode(node, deep) {\n let doc = this.node instanceof Document ? this.node :\n this.node.ownerDocument;\n return wrap(doc).importNode(node, deep);\n }\n\n /**\n * @return {!Array<!Node>} Returns a flattened list of all child nodes and\n * nodes assigned to child slots.\n * @override\n */\n getEffectiveChildNodes() {\n return FlattenedNodesObserver.getFlattenedNodes(\n /** @type {!HTMLElement} */ (this.node));\n }\n\n /**\n * Returns a filtered list of flattened child elements for this element based\n * on the given selector.\n *\n * @param {string} selector Selector to filter nodes against\n * @return {!Array<!HTMLElement>} List of flattened child elements\n * @override\n */\n queryDistributedElements(selector) {\n let c$ = this.getEffectiveChildNodes();\n let list = [];\n for (let i=0, l=c$.length, c; (i<l) && (c=c$[i]); i++) {\n if ((c.nodeType === Node.ELEMENT_NODE) &&\n matchesSelector(c, selector)) {\n list.push(c);\n }\n }\n return list;\n }\n\n /**\n * For shadow roots, returns the currently focused element within this\n * shadow root.\n *\n * return {Node|undefined} Currently focused element\n * @override\n */\n get activeElement() {\n let node = this.node;\n return node._activeElement !== undefined ? node._activeElement : node.activeElement;\n }\n}\n\nfunction forwardMethods(proto, methods) {\n for (let i=0; i < methods.length; i++) {\n let method = methods[i];\n /* eslint-disable valid-jsdoc */\n proto[method] = /** @this {DomApiNative} */ function() {\n return this.node[method].apply(this.node, arguments);\n };\n /* eslint-enable */\n }\n}\n\nfunction forwardReadOnlyProperties(proto, properties) {\n for (let i=0; i < properties.length; i++) {\n let name = properties[i];\n Object.defineProperty(proto, name, {\n get: function() {\n const domApi = /** @type {DomApiNative} */(this);\n return domApi.node[name];\n },\n configurable: true\n });\n }\n}\n\nfunction forwardProperties(proto, properties) {\n for (let i=0; i < properties.length; i++) {\n let name = properties[i];\n Object.defineProperty(proto, name, {\n /**\n * @this {DomApiNative}\n * @return {*} .\n */\n get: function() {\n return this.node[name];\n },\n /**\n * @this {DomApiNative}\n * @param {*} value .\n */\n set: function(value) {\n this.node[name] = value;\n },\n configurable: true\n });\n }\n}\n\n\n/**\n * Event API wrapper class returned from `dom.(target)` when\n * `target` is an `Event`.\n */\nexport class EventApi {\n constructor(event) {\n this.event = event;\n }\n\n /**\n * Returns the first node on the `composedPath` of this event.\n *\n * @return {!EventTarget} The node this event was dispatched to\n */\n get rootTarget() {\n return this.path[0];\n }\n\n /**\n * Returns the local (re-targeted) target for this event.\n *\n * @return {!EventTarget} The local (re-targeted) target for this event.\n */\n get localTarget() {\n return this.event.target;\n }\n\n /**\n * Returns the `composedPath` for this event.\n * @return {!Array<!EventTarget>} The nodes this event propagated through\n */\n get path() {\n return this.event.composedPath();\n }\n}\n\n/**\n * @function\n * @param {boolean=} deep\n * @return {!Node}\n */\nDomApiNative.prototype.cloneNode;\n/**\n * @function\n * @param {!Node} node\n * @return {!Node}\n */\nDomApiNative.prototype.appendChild;\n/**\n * @function\n * @param {!Node} newChild\n * @param {Node} refChild\n * @return {!Node}\n */\nDomApiNative.prototype.insertBefore;\n/**\n * @function\n * @param {!Node} node\n * @return {!Node}\n */\nDomApiNative.prototype.removeChild;\n/**\n * @function\n * @param {!Node} oldChild\n * @param {!Node} newChild\n * @return {!Node}\n */\nDomApiNative.prototype.replaceChild;\n/**\n * @function\n * @param {string} name\n * @param {string} value\n * @return {void}\n */\nDomApiNative.prototype.setAttribute;\n/**\n * @function\n * @param {string} name\n * @return {void}\n */\nDomApiNative.prototype.removeAttribute;\n/**\n * @function\n * @param {string} selector\n * @return {?Element}\n */\nDomApiNative.prototype.querySelector;\n/**\n * @function\n * @param {string} selector\n * @return {!NodeList<!Element>}\n */\nDomApiNative.prototype.querySelectorAll;\n\n/** @type {?Node} */\nDomApiNative.prototype.parentNode;\n/** @type {?Node} */\nDomApiNative.prototype.firstChild;\n/** @type {?Node} */\nDomApiNative.prototype.lastChild;\n/** @type {?Node} */\nDomApiNative.prototype.nextSibling;\n/** @type {?Node} */\nDomApiNative.prototype.previousSibling;\n/** @type {?HTMLElement} */\nDomApiNative.prototype.firstElementChild;\n/** @type {?HTMLElement} */\nDomApiNative.prototype.lastElementChild;\n/** @type {?HTMLElement} */\nDomApiNative.prototype.nextElementSibling;\n/** @type {?HTMLElement} */\nDomApiNative.prototype.previousElementSibling;\n/** @type {!Array<!Node>} */\nDomApiNative.prototype.childNodes;\n/** @type {!Array<!HTMLElement>} */\nDomApiNative.prototype.children;\n/** @type {?DOMTokenList} */\nDomApiNative.prototype.classList;\n\n/** @type {string} */\nDomApiNative.prototype.textContent;\n/** @type {string} */\nDomApiNative.prototype.innerHTML;\n\nlet DomApiImpl = DomApiNative;\n\nif (window['ShadyDOM'] && window['ShadyDOM']['inUse'] && window['ShadyDOM']['noPatch'] && window['ShadyDOM']['Wrapper']) {\n\n /**\n * @private\n * @extends {HTMLElement}\n */\n class Wrapper extends window['ShadyDOM']['Wrapper'] {}\n\n // copy bespoke API onto wrapper\n Object.getOwnPropertyNames(DomApiNative.prototype).forEach((prop) => {\n if (prop != 'activeElement') {\n Wrapper.prototype[prop] = DomApiNative.prototype[prop];\n }\n });\n\n // Note, `classList` is here only for legacy compatibility since it does not\n // trigger distribution in v1 Shadow DOM.\n forwardReadOnlyProperties(Wrapper.prototype, [\n 'classList'\n ]);\n\n DomApiImpl = Wrapper;\n\n Object.defineProperties(EventApi.prototype, {\n\n // Returns the \"lowest\" node in the same root as the event's currentTarget.\n // When in `noPatch` mode, this must be calculated by walking the event's\n // path.\n localTarget: {\n get() {\n const current = this.event.currentTarget;\n const currentRoot = current && dom(current).getOwnerRoot();\n const p$ = this.path;\n for (let i = 0; i < p$.length; i++) {\n const e = p$[i];\n if (dom(e).getOwnerRoot() === currentRoot) {\n return e;\n }\n }\n },\n configurable: true\n },\n\n path: {\n get() {\n return window['ShadyDOM']['composedPath'](this.event);\n },\n configurable: true\n }\n });\n\n} else {\n\n // Methods that can provoke distribution or must return the logical, not\n // composed tree.\n forwardMethods(DomApiNative.prototype, [\n 'cloneNode', 'appendChild', 'insertBefore', 'removeChild',\n 'replaceChild', 'setAttribute', 'removeAttribute',\n 'querySelector', 'querySelectorAll', 'attachShadow'\n ]);\n\n // Properties that should return the logical, not composed tree. Note, `classList`\n // is here only for legacy compatibility since it does not trigger distribution\n // in v1 Shadow DOM.\n forwardReadOnlyProperties(DomApiNative.prototype, [\n 'parentNode', 'firstChild', 'lastChild',\n 'nextSibling', 'previousSibling', 'firstElementChild',\n 'lastElementChild', 'nextElementSibling', 'previousElementSibling',\n 'childNodes', 'children', 'classList', 'shadowRoot'\n ]);\n\n forwardProperties(DomApiNative.prototype, [\n 'textContent', 'innerHTML', 'className'\n ]);\n}\n\nexport const DomApi = DomApiImpl;\n\n/**\n * Legacy DOM and Event manipulation API wrapper factory used to abstract\n * differences between native Shadow DOM and \"Shady DOM\" when polyfilling on\n * older browsers.\n *\n * Note that in Polymer 2.x use of `Polymer.dom` is no longer required and\n * in the majority of cases simply facades directly to the standard native\n * API.\n *\n * @summary Legacy DOM and Event manipulation API wrapper factory used to\n * abstract differences between native Shadow DOM and \"Shady DOM.\"\n * @param {(Node|Event|DomApiNative|EventApi)=} obj Node or event to operate on\n * @return {!DomApiNative|!EventApi} Wrapper providing either node API or event API\n */\nexport const dom = function(obj) {\n obj = obj || document;\n if (obj instanceof DomApiImpl) {\n return /** @type {!DomApi} */(obj);\n }\n if (obj instanceof EventApi) {\n return /** @type {!EventApi} */(obj);\n }\n let helper = obj['__domApi'];\n if (!helper) {\n if (obj instanceof Event) {\n helper = new EventApi(obj);\n } else {\n helper = new DomApiImpl(/** @type {Node} */(obj));\n }\n obj['__domApi'] = helper;\n }\n return helper;\n};\n","/**\n@license\nCopyright (c) 2019 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nimport './boot.js';\nimport {wrap} from './wrap.js';\n\nconst ShadyDOM = window.ShadyDOM;\nconst ShadyCSS = window.ShadyCSS;\n\n/**\n * Return true if node scope is correct.\n *\n * @param {!Element} node Node to check scope\n * @param {!Node} scope Scope reference\n * @return {boolean} True if node is in scope\n */\nfunction sameScope(node, scope) {\n return wrap(node).getRootNode() === scope;\n}\n\n/**\n * Ensure that elements in a ShadowDOM container are scoped correctly.\n * This function is only needed when ShadyDOM is used and unpatched DOM APIs are used in third party code.\n * This can happen in noPatch mode or when specialized APIs like ranges or tables are used to mutate DOM.\n *\n * @param {!Element} container Container element to scope\n * @param {boolean=} shouldObserve if true, start a mutation observer for added nodes to the container\n * @return {?MutationObserver} Returns a new MutationObserver on `container` if `shouldObserve` is true.\n */\nexport function scopeSubtree(container, shouldObserve = false) {\n // If using native ShadowDOM, abort\n if (!ShadyDOM || !ShadyCSS) {\n return null;\n }\n // ShadyCSS handles DOM mutations when ShadyDOM does not handle scoping itself\n if (!ShadyDOM['handlesDynamicScoping']) {\n return null;\n }\n const ScopingShim = ShadyCSS['ScopingShim'];\n // if ScopingShim is not available, abort\n if (!ScopingShim) {\n return null;\n }\n // capture correct scope for container\n const containerScope = ScopingShim['scopeForNode'](container);\n const root = wrap(container).getRootNode();\n\n const scopify = (node) => {\n if (!sameScope(node, root)) {\n return;\n }\n // NOTE: native qSA does not honor scoped DOM, but it is faster, and the same behavior as Polymer v1\n const elements = Array.from(ShadyDOM['nativeMethods']['querySelectorAll'].call(node, '*'));\n elements.push(node);\n for (let i = 0; i < elements.length; i++) {\n const el = elements[i];\n if (!sameScope(el, root)) {\n continue;\n }\n const currentScope = ScopingShim['currentScopeForNode'](el);\n if (currentScope !== containerScope) {\n if (currentScope !== '') {\n ScopingShim['unscopeNode'](el, currentScope);\n }\n ScopingShim['scopeNode'](el, containerScope);\n }\n }\n };\n\n // scope everything in container\n scopify(container);\n\n if (shouldObserve) {\n const mo = new MutationObserver((mxns) => {\n for (let i = 0; i < mxns.length; i++) {\n const mxn = mxns[i];\n for (let j = 0; j < mxn.addedNodes.length; j++) {\n const addedNode = mxn.addedNodes[j];\n if (addedNode.nodeType === Node.ELEMENT_NODE) {\n scopify(addedNode);\n }\n }\n }\n });\n mo.observe(container, {childList: true, subtree: true});\n return mo;\n } else {\n return null;\n }\n}","/**\n * @fileoverview\n * @suppress {checkPrototypalTypes}\n * @license Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt The complete set of authors may be found\n * at http://polymer.github.io/AUTHORS.txt The complete set of contributors may\n * be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by\n * Google as part of the polymer project is also subject to an additional IP\n * rights grant found at http://polymer.github.io/PATENTS.txt\n */\nimport { ElementMixin } from './element-mixin.js';\nimport { dedupingMixin } from '../utils/mixin.js';\nimport { wrap } from '../utils/wrap.js';\n\nconst DISABLED_ATTR = 'disable-upgrade';\n\nexport const findObservedAttributesGetter = (ctor) => {\n while (ctor) {\n const desc = Object.getOwnPropertyDescriptor(ctor, 'observedAttributes');\n if (desc) {\n return desc.get;\n }\n ctor = Object.getPrototypeOf(ctor.prototype).constructor;\n }\n return () => [];\n};\n\n/**\n * Element class mixin that allows the element to boot up in a non-enabled\n * state when the `disable-upgrade` attribute is present. This mixin is\n * designed to be used with element classes like PolymerElement that perform\n * initial startup work when they are first connected. When the\n * `disable-upgrade` attribute is removed, if the element is connected, it\n * boots up and \"enables\" as it otherwise would; if it is not connected, the\n * element boots up when it is next connected.\n *\n * Using `disable-upgrade` with PolymerElement prevents any data propagation\n * to the element, any element DOM from stamping, or any work done in\n * connected/disconnctedCallback from occuring, but it does not prevent work\n * done in the element constructor.\n *\n * Note, this mixin must be applied on top of any element class that\n * itself implements a `connectedCallback` so that it can control the work\n * done in `connectedCallback`. For example,\n *\n * MyClass = DisableUpgradeMixin(class extends BaseClass {...});\n *\n * @mixinFunction\n * @polymer\n * @appliesMixin ElementMixin\n * @template T\n * @param {function(new:T)} superClass Class to apply mixin to.\n * @return {function(new:T)} superClass with mixin applied.\n */\nexport const DisableUpgradeMixin = dedupingMixin((base) => {\n /**\n * @constructor\n * @implements {Polymer_ElementMixin}\n * @extends {HTMLElement}\n * @private\n */\n const superClass = ElementMixin(base);\n\n // Work around for closure bug #126934458. Using `super` in a property\n // getter does not work so instead we search the Base prototype for an\n // implementation of observedAttributes so that we can override and call\n // the `super` getter. Note, this is done one time ever because we assume\n // that `Base` is always comes from `Polymer.LegacyElementMixn`.\n let observedAttributesGetter = findObservedAttributesGetter(superClass);\n\n /**\n * @polymer\n * @mixinClass\n * @implements {Polymer_DisableUpgradeMixin}\n */\n class DisableUpgradeClass extends superClass {\n\n constructor() {\n super();\n /** @type {boolean|undefined} */\n this.__isUpgradeDisabled;\n }\n\n static get observedAttributes() {\n return observedAttributesGetter.call(this).concat(DISABLED_ATTR);\n }\n\n // Prevent element from initializing properties when it's upgrade disabled.\n /** @override */\n _initializeProperties() {\n if (this.hasAttribute(DISABLED_ATTR)) {\n this.__isUpgradeDisabled = true;\n } else {\n super._initializeProperties();\n }\n }\n\n // Prevent element from enabling properties when it's upgrade disabled.\n // Normally overriding connectedCallback would be enough, but dom-* elements\n /** @override */\n _enableProperties() {\n if (!this.__isUpgradeDisabled) {\n super._enableProperties();\n }\n }\n\n // If the element starts upgrade-disabled and a property is set for\n // which an accessor exists, the default should not be applied.\n // This additional check is needed because defaults are applied via\n // `_initializeProperties` which is called after initial properties\n // have been set when the element starts upgrade-disabled.\n /** @override */\n _canApplyPropertyDefault(property) {\n return super._canApplyPropertyDefault(property) &&\n !(this.__isUpgradeDisabled && this._isPropertyPending(property));\n }\n\n /**\n * @override\n * @param {string} name Attribute name.\n * @param {?string} old The previous value for the attribute.\n * @param {?string} value The new value for the attribute.\n * @param {?string} namespace The XML namespace for the attribute.\n * @return {void}\n */\n attributeChangedCallback(name, old, value, namespace) {\n if (name == DISABLED_ATTR) {\n // When disable-upgrade is removed, initialize properties and\n // provoke connectedCallback if the element is already connected.\n if (this.__isUpgradeDisabled && value == null) {\n super._initializeProperties();\n this.__isUpgradeDisabled = false;\n if (wrap(this).isConnected) {\n super.connectedCallback();\n }\n }\n } else {\n super.attributeChangedCallback(\n name, old, value, /** @type {null|string} */ (namespace));\n }\n }\n\n // Prevent element from connecting when it's upgrade disabled.\n // This prevents user code in `attached` from being called.\n /** @override */\n connectedCallback() {\n if (!this.__isUpgradeDisabled) {\n super.connectedCallback();\n }\n }\n\n // Prevent element from disconnecting when it's upgrade disabled.\n // This avoids allowing user code `detached` from being called without a\n // paired call to `attached`.\n /** @override */\n disconnectedCallback() {\n if (!this.__isUpgradeDisabled) {\n super.disconnectedCallback();\n }\n }\n\n }\n\n return DisableUpgradeClass;\n});\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\nimport '@webcomponents/shadycss/entrypoints/apply-shim.js';\nimport { ElementMixin, builtCSS } from '../mixins/element-mixin.js';\nimport { GestureEventListeners } from '../mixins/gesture-event-listeners.js';\nimport { DirMixin } from '../mixins/dir-mixin.js';\nimport { dedupingMixin } from '../utils/mixin.js';\nimport '../utils/render-status.js';\nimport '../utils/unresolved.js';\nimport { dom, matchesSelector } from './polymer.dom.js';\nimport { setTouchAction } from '../utils/gestures.js';\nimport { Debouncer } from '../utils/debounce.js';\nimport { timeOut, microTask } from '../utils/async.js';\nimport { get } from '../utils/path.js';\nimport { wrap } from '../utils/wrap.js';\nimport { scopeSubtree } from '../utils/scope-subtree.js';\nimport { legacyOptimizations, legacyNoObservedAttributes } from '../utils/settings.js';\nimport { findObservedAttributesGetter } from '../mixins/disable-upgrade-mixin.js';\nimport { register } from '../utils/telemetry.js';\n\nconst DISABLED_ATTR = 'disable-upgrade';\n\nlet styleInterface = window.ShadyCSS;\n\n/**\n * Element class mixin that provides Polymer's \"legacy\" API intended to be\n * backward-compatible to the greatest extent possible with the API\n * found on the Polymer 1.x `Polymer.Base` prototype applied to all elements\n * defined using the `Polymer({...})` function.\n *\n * @mixinFunction\n * @polymer\n * @appliesMixin ElementMixin\n * @appliesMixin GestureEventListeners\n * @appliesMixin DirMixin\n * @property isAttached {boolean} Set to `true` in this element's\n * `connectedCallback` and `false` in `disconnectedCallback`\n * @summary Element class mixin that provides Polymer's \"legacy\" API\n */\nexport const LegacyElementMixin = dedupingMixin((base) => {\n\n // TODO(kschaaf): Note, the `@implements {Polymer_DirMixin}` is required here\n // (rather than on legacyElementBase) for unknown reasons.\n /**\n * @constructor\n * @implements {Polymer_ElementMixin}\n * @implements {Polymer_GestureEventListeners}\n * @implements {Polymer_DirMixin}\n * @extends {HTMLElement}\n * @private\n */\n const GesturesElement = GestureEventListeners(ElementMixin(base));\n\n // Note, the DirMixin does nothing if css is built so avoid including it\n // in that case.\n\n /**\n * @constructor\n * @extends {GesturesElement}\n * @private\n */\n const legacyElementBase = builtCSS ? GesturesElement :\n DirMixin(GesturesElement);\n\n const observedAttributesGetter = findObservedAttributesGetter(legacyElementBase);\n\n /**\n * Map of simple names to touch action names\n * @dict\n */\n const DIRECTION_MAP = {\n 'x': 'pan-x',\n 'y': 'pan-y',\n 'none': 'none',\n 'all': 'auto'\n };\n\n /**\n * @polymer\n * @mixinClass\n * @extends {legacyElementBase}\n * @implements {Polymer_LegacyElementMixin}\n * @unrestricted\n */\n class LegacyElement extends legacyElementBase {\n\n constructor() {\n super();\n /** @type {boolean} */\n this.isAttached;\n /** @type {?WeakMap<!Element, !Object<string, !Function>>} */\n this.__boundListeners;\n /** @type {?Object<string, ?Function>} */\n this._debouncers;\n // NOTE: Inlined for perf from version of DisableUpgradeMixin.\n /** @type {boolean|undefined} */\n this.__isUpgradeDisabled;\n /** @type {boolean|undefined} */\n this.__needsAttributesAtConnected;\n /** @type {boolean|undefined} */\n this._legacyForceObservedAttributes;\n }\n\n /**\n * Forwards `importMeta` from the prototype (i.e. from the info object\n * passed to `Polymer({...})`) to the static API.\n *\n * @return {!Object} The `import.meta` object set on the prototype\n * @suppress {missingProperties} `this` is always in the instance in\n * closure for some reason even in a static method, rather than the class\n * @nocollapse\n */\n static get importMeta() {\n return this.prototype.importMeta;\n }\n\n /**\n * Legacy callback called during the `constructor`, for overriding\n * by the user.\n * @override\n * @return {void}\n */\n created() {}\n\n /**\n * Processes an attribute reaction when the `legacyNoObservedAttributes`\n * setting is in use.\n * @param {string} name Name of attribute that changed\n * @param {?string} old Old attribute value\n * @param {?string} value New attribute value\n * @return {void}\n */\n __attributeReaction(name, old, value) {\n if ((this.__dataAttributes && this.__dataAttributes[name]) || name === DISABLED_ATTR) {\n this.attributeChangedCallback(name, old, value, null);\n }\n }\n\n /**\n * Sets the value of an attribute.\n * @override\n */\n setAttribute(name, value) {\n if (legacyNoObservedAttributes && !this._legacyForceObservedAttributes) {\n const oldValue = this.getAttribute(name);\n super.setAttribute(name, value);\n // value coerced to String for closure's benefit\n this.__attributeReaction(name, oldValue, String(value));\n } else {\n super.setAttribute(name, value);\n }\n }\n\n /**\n * Removes an attribute.\n * @override\n */\n removeAttribute(name) {\n if (legacyNoObservedAttributes && !this._legacyForceObservedAttributes) {\n const oldValue = this.getAttribute(name);\n super.removeAttribute(name);\n this.__attributeReaction(name, oldValue, null);\n } else {\n super.removeAttribute(name);\n }\n }\n\n // NOTE: Inlined for perf from version of DisableUpgradeMixin.\n static get observedAttributes() {\n if (legacyNoObservedAttributes && !this.prototype._legacyForceObservedAttributes) {\n // Ensure this element is property registered with the telemetry system.\n if (!this.hasOwnProperty(JSCompiler_renameProperty('__observedAttributes', this))) {\n this.__observedAttributes = [];\n register(this.prototype);\n }\n return this.__observedAttributes;\n } else {\n return observedAttributesGetter.call(this).concat(DISABLED_ATTR);\n }\n }\n\n // NOTE: Inlined for perf from version of DisableUpgradeMixin.\n // Prevent element from enabling properties when it's upgrade disabled.\n // Normally overriding connectedCallback would be enough, but dom-* elements\n /** @override */\n _enableProperties() {\n if (!this.__isUpgradeDisabled) {\n super._enableProperties();\n }\n }\n\n // NOTE: Inlined for perf from version of DisableUpgradeMixin.\n // If the element starts upgrade-disabled and a property is set for\n // which an accessor exists, the default should not be applied.\n // This additional check is needed because defaults are applied via\n // `_initializeProperties` which is called after initial properties\n // have been set when the element starts upgrade-disabled.\n /** @override */\n _canApplyPropertyDefault(property) {\n return super._canApplyPropertyDefault(property) &&\n !(this.__isUpgradeDisabled && this._isPropertyPending(property));\n }\n\n /**\n * Provides an implementation of `connectedCallback`\n * which adds Polymer legacy API's `attached` method.\n * @return {void}\n * @override\n */\n connectedCallback() {\n if (this.__needsAttributesAtConnected) {\n this._takeAttributes();\n }\n // NOTE: Inlined for perf from version of DisableUpgradeMixin.\n if (!this.__isUpgradeDisabled) {\n super.connectedCallback();\n this.isAttached = true;\n this.attached();\n }\n }\n\n /**\n * Legacy callback called during `connectedCallback`, for overriding\n * by the user.\n * @override\n * @return {void}\n */\n attached() {}\n\n /**\n * Provides an implementation of `disconnectedCallback`\n * which adds Polymer legacy API's `detached` method.\n * @return {void}\n * @override\n */\n disconnectedCallback() {\n // NOTE: Inlined for perf from version of DisableUpgradeMixin.\n if (!this.__isUpgradeDisabled) {\n super.disconnectedCallback();\n this.isAttached = false;\n this.detached();\n }\n }\n\n /**\n * Legacy callback called during `disconnectedCallback`, for overriding\n * by the user.\n * @override\n * @return {void}\n */\n detached() {}\n\n /**\n * Provides an override implementation of `attributeChangedCallback`\n * which adds the Polymer legacy API's `attributeChanged` method.\n * @param {string} name Name of attribute.\n * @param {?string} old Old value of attribute.\n * @param {?string} value Current value of attribute.\n * @param {?string} namespace Attribute namespace.\n * @return {void}\n * @override\n */\n attributeChangedCallback(name, old, value, namespace) {\n if (old !== value) {\n // NOTE: Inlined for perf from version of DisableUpgradeMixin.\n if (name == DISABLED_ATTR) {\n // When disable-upgrade is removed, intialize properties and\n // provoke connectedCallback if the element is already connected.\n if (this.__isUpgradeDisabled && value == null) {\n this._initializeProperties();\n this.__isUpgradeDisabled = false;\n if (wrap(this).isConnected) {\n this.connectedCallback();\n }\n }\n } else {\n super.attributeChangedCallback(name, old, value, namespace);\n this.attributeChanged(name, old, value);\n }\n }\n }\n\n /**\n * Legacy callback called during `attributeChangedChallback`, for overriding\n * by the user.\n * @param {string} name Name of attribute.\n * @param {?string} old Old value of attribute.\n * @param {?string} value Current value of attribute.\n * @return {void}\n * @override\n */\n attributeChanged(name, old, value) {} // eslint-disable-line no-unused-vars\n\n /**\n * Overrides the default `Polymer.PropertyEffects` implementation to\n * add support for class initialization via the `_registered` callback.\n * This is called only when the first instance of the element is created.\n *\n * @return {void}\n * @override\n * @suppress {invalidCasts}\n */\n _initializeProperties() {\n // NOTE: Inlined for perf from version of DisableUpgradeMixin.\n // Only auto-use disable-upgrade if legacyOptimizations is set.\n if (legacyOptimizations && this.hasAttribute(DISABLED_ATTR)) {\n this.__isUpgradeDisabled = true;\n } else {\n let proto = Object.getPrototypeOf(this);\n if (!proto.hasOwnProperty(JSCompiler_renameProperty('__hasRegisterFinished', proto))) {\n this._registered();\n // backstop in case the `_registered` implementation does not set this\n proto.__hasRegisterFinished = true;\n }\n super._initializeProperties();\n this.root = /** @type {HTMLElement} */(this);\n this.created();\n // Pull all attribute values 1x if `legacyNoObservedAttributes` is set.\n if (legacyNoObservedAttributes && !this._legacyForceObservedAttributes) {\n if (this.hasAttributes()) {\n this._takeAttributes();\n // Element created from scratch or parser generated\n } else if (!this.parentNode) {\n this.__needsAttributesAtConnected = true;\n }\n }\n // Ensure listeners are applied immediately so that they are\n // added before declarative event listeners. This allows an element to\n // decorate itself via an event prior to any declarative listeners\n // seeing the event. Note, this ensures compatibility with 1.x ordering.\n this._applyListeners();\n }\n }\n\n _takeAttributes() {\n const a = this.attributes;\n for (let i=0, l=a.length; i < l; i++) {\n const attr = a[i];\n this.__attributeReaction(attr.name, null, attr.value);\n }\n }\n\n /**\n * Called automatically when an element is initializing.\n * Users may override this method to perform class registration time\n * work. The implementation should ensure the work is performed\n * only once for the class.\n * @protected\n * @return {void}\n * @override\n */\n _registered() {}\n\n /**\n * Overrides the default `Polymer.PropertyEffects` implementation to\n * add support for installing `hostAttributes` and `listeners`.\n *\n * @return {void}\n * @override\n */\n ready() {\n this._ensureAttributes();\n super.ready();\n }\n\n /**\n * Ensures an element has required attributes. Called when the element\n * is being readied via `ready`. Users should override to set the\n * element's required attributes. The implementation should be sure\n * to check and not override existing attributes added by\n * the user of the element. Typically, setting attributes should be left\n * to the element user and not done here; reasonable exceptions include\n * setting aria roles and focusability.\n * @protected\n * @return {void}\n * @override\n */\n _ensureAttributes() {}\n\n /**\n * Adds element event listeners. Called when the element\n * is being readied via `ready`. Users should override to\n * add any required element event listeners.\n * In performance critical elements, the work done here should be kept\n * to a minimum since it is done before the element is rendered. In\n * these elements, consider adding listeners asynchronously so as not to\n * block render.\n * @protected\n * @return {void}\n * @override\n */\n _applyListeners() {}\n\n /**\n * Converts a typed JavaScript value to a string.\n *\n * Note this method is provided as backward-compatible legacy API\n * only. It is not directly called by any Polymer features. To customize\n * how properties are serialized to attributes for attribute bindings and\n * `reflectToAttribute: true` properties as well as this method, override\n * the `_serializeValue` method provided by `Polymer.PropertyAccessors`.\n *\n * @param {*} value Value to deserialize\n * @return {string | undefined} Serialized value\n * @override\n */\n serialize(value) {\n return this._serializeValue(value);\n }\n\n /**\n * Converts a string to a typed JavaScript value.\n *\n * Note this method is provided as backward-compatible legacy API\n * only. It is not directly called by any Polymer features. To customize\n * how attributes are deserialized to properties for in\n * `attributeChangedCallback`, override `_deserializeValue` method\n * provided by `Polymer.PropertyAccessors`.\n *\n * @param {string} value String to deserialize\n * @param {*} type Type to deserialize the string to\n * @return {*} Returns the deserialized value in the `type` given.\n * @override\n */\n deserialize(value, type) {\n return this._deserializeValue(value, type);\n }\n\n /**\n * Serializes a property to its associated attribute.\n *\n * Note this method is provided as backward-compatible legacy API\n * only. It is not directly called by any Polymer features.\n *\n * @param {string} property Property name to reflect.\n * @param {string=} attribute Attribute name to reflect.\n * @param {*=} value Property value to reflect.\n * @return {void}\n * @override\n */\n reflectPropertyToAttribute(property, attribute, value) {\n this._propertyToAttribute(property, attribute, value);\n }\n\n /**\n * Sets a typed value to an HTML attribute on a node.\n *\n * Note this method is provided as backward-compatible legacy API\n * only. It is not directly called by any Polymer features.\n *\n * @param {*} value Value to serialize.\n * @param {string} attribute Attribute name to serialize to.\n * @param {Element} node Element to set attribute to.\n * @return {void}\n * @override\n */\n serializeValueToAttribute(value, attribute, node) {\n this._valueToNodeAttribute(/** @type {Element} */ (node || this), value, attribute);\n }\n\n /**\n * Copies own properties (including accessor descriptors) from a source\n * object to a target object.\n *\n * @param {Object} prototype Target object to copy properties to.\n * @param {Object} api Source object to copy properties from.\n * @return {Object} prototype object that was passed as first argument.\n * @override\n */\n extend(prototype, api) {\n if (!(prototype && api)) {\n return prototype || api;\n }\n let n$ = Object.getOwnPropertyNames(api);\n for (let i=0, n; (i<n$.length) && (n=n$[i]); i++) {\n let pd = Object.getOwnPropertyDescriptor(api, n);\n if (pd) {\n Object.defineProperty(prototype, n, pd);\n }\n }\n return prototype;\n }\n\n /**\n * Copies props from a source object to a target object.\n *\n * Note, this method uses a simple `for...in` strategy for enumerating\n * properties. To ensure only `ownProperties` are copied from source\n * to target and that accessor implementations are copied, use `extend`.\n *\n * @param {!Object} target Target object to copy properties to.\n * @param {!Object} source Source object to copy properties from.\n * @return {!Object} Target object that was passed as first argument.\n * @override\n */\n mixin(target, source) {\n for (let i in source) {\n target[i] = source[i];\n }\n return target;\n }\n\n /**\n * Sets the prototype of an object.\n *\n * Note this method is provided as backward-compatible legacy API\n * only. It is not directly called by any Polymer features.\n * @param {Object} object The object on which to set the prototype.\n * @param {Object} prototype The prototype that will be set on the given\n * `object`.\n * @return {Object} Returns the given `object` with its prototype set\n * to the given `prototype` object.\n * @override\n */\n chainObject(object, prototype) {\n if (object && prototype && object !== prototype) {\n object.__proto__ = prototype;\n }\n return object;\n }\n\n /* **** Begin Template **** */\n\n /**\n * Calls `importNode` on the `content` of the `template` specified and\n * returns a document fragment containing the imported content.\n *\n * @param {HTMLTemplateElement} template HTML template element to instance.\n * @return {!DocumentFragment} Document fragment containing the imported\n * template content.\n * @override\n * @suppress {missingProperties} go/missingfnprops\n */\n instanceTemplate(template) {\n let content = this.constructor._contentForTemplate(template);\n let dom = /** @type {!DocumentFragment} */\n (document.importNode(content, true));\n return dom;\n }\n\n /* **** Begin Events **** */\n\n\n\n /**\n * Dispatches a custom event with an optional detail value.\n *\n * @param {string} type Name of event type.\n * @param {*=} detail Detail value containing event-specific\n * payload.\n * @param {{ bubbles: (boolean|undefined), cancelable: (boolean|undefined),\n * composed: (boolean|undefined) }=}\n * options Object specifying options. These may include:\n * `bubbles` (boolean, defaults to `true`),\n * `cancelable` (boolean, defaults to false), and\n * `node` on which to fire the event (HTMLElement, defaults to `this`).\n * @return {!Event} The new event that was fired.\n * @override\n */\n fire(type, detail, options) {\n options = options || {};\n detail = (detail === null || detail === undefined) ? {} : detail;\n let event = new Event(type, {\n bubbles: options.bubbles === undefined ? true : options.bubbles,\n cancelable: Boolean(options.cancelable),\n composed: options.composed === undefined ? true: options.composed\n });\n event.detail = detail;\n let node = options.node || this;\n wrap(node).dispatchEvent(event);\n return event;\n }\n\n /**\n * Convenience method to add an event listener on a given element,\n * late bound to a named method on this element.\n *\n * @param {?EventTarget} node Element to add event listener to.\n * @param {string} eventName Name of event to listen for.\n * @param {string} methodName Name of handler method on `this` to call.\n * @return {void}\n * @override\n */\n listen(node, eventName, methodName) {\n node = /** @type {!EventTarget} */ (node || this);\n let hbl = this.__boundListeners ||\n (this.__boundListeners = new WeakMap());\n let bl = hbl.get(node);\n if (!bl) {\n bl = {};\n hbl.set(node, bl);\n }\n let key = eventName + methodName;\n if (!bl[key]) {\n bl[key] = this._addMethodEventListenerToNode(\n /** @type {!Node} */ (node), eventName, methodName, this);\n }\n }\n\n /**\n * Convenience method to remove an event listener from a given element,\n * late bound to a named method on this element.\n *\n * @param {?EventTarget} node Element to remove event listener from.\n * @param {string} eventName Name of event to stop listening to.\n * @param {string} methodName Name of handler method on `this` to not call\n anymore.\n * @return {void}\n * @override\n */\n unlisten(node, eventName, methodName) {\n node = /** @type {!EventTarget} */ (node || this);\n let bl = this.__boundListeners &&\n this.__boundListeners.get(/** @type {!Element} */ (node));\n let key = eventName + methodName;\n let handler = bl && bl[key];\n if (handler) {\n this._removeEventListenerFromNode(\n /** @type {!Node} */ (node), eventName, handler);\n bl[key] = /** @type {?} */ (null);\n }\n }\n\n /**\n * Override scrolling behavior to all direction, one direction, or none.\n *\n * Valid scroll directions:\n * - 'all': scroll in any direction\n * - 'x': scroll only in the 'x' direction\n * - 'y': scroll only in the 'y' direction\n * - 'none': disable scrolling for this node\n *\n * @param {string=} direction Direction to allow scrolling\n * Defaults to `all`.\n * @param {Element=} node Element to apply scroll direction setting.\n * Defaults to `this`.\n * @return {void}\n * @override\n */\n setScrollDirection(direction, node) {\n setTouchAction(\n /** @type {!Element} */ (node || this),\n DIRECTION_MAP[direction] || 'auto');\n }\n /* **** End Events **** */\n\n /**\n * Convenience method to run `querySelector` on this local DOM scope.\n *\n * This function calls `Polymer.dom(this.root).querySelector(slctr)`.\n *\n * @param {string} slctr Selector to run on this local DOM scope\n * @return {Element} Element found by the selector, or null if not found.\n * @override\n */\n $$(slctr) {\n // Note, no need to `wrap` this because root is always patched\n return this.root.querySelector(slctr);\n }\n\n /**\n * Return the element whose local dom within which this element\n * is contained. This is a shorthand for\n * `this.getRootNode().host`.\n * @this {Element}\n * @return {?Node} The element whose local dom within which this element is\n * contained.\n * @override\n */\n get domHost() {\n let root = wrap(this).getRootNode();\n return (root instanceof DocumentFragment) ? /** @type {ShadowRoot} */ (root).host : root;\n }\n\n /**\n * Force this element to distribute its children to its local dom.\n * This should not be necessary as of Polymer 2.0.2 and is provided only\n * for backwards compatibility.\n * @return {void}\n * @override\n */\n distributeContent() {\n const thisEl = /** @type {Element} */ (this);\n const domApi = /** @type {PolymerDomApi} */(dom(thisEl));\n if (window.ShadyDOM && domApi.shadowRoot) {\n ShadyDOM.flush();\n }\n }\n\n /**\n * Returns a list of nodes that are the effective childNodes. The effective\n * childNodes list is the same as the element's childNodes except that\n * any `<content>` elements are replaced with the list of nodes distributed\n * to the `<content>`, the result of its `getDistributedNodes` method.\n * @return {!Array<!Node>} List of effective child nodes.\n * @suppress {invalidCasts} LegacyElementMixin must be applied to an\n * HTMLElement\n * @override\n */\n getEffectiveChildNodes() {\n const thisEl = /** @type {Element} */ (this);\n const domApi = /** @type {PolymerDomApi} */ (dom(thisEl));\n return domApi.getEffectiveChildNodes();\n }\n\n /**\n * Returns a list of nodes distributed within this element that match\n * `selector`. These can be dom children or elements distributed to\n * children that are insertion points.\n * @param {string} selector Selector to run.\n * @return {!Array<!Node>} List of distributed elements that match selector.\n * @suppress {invalidCasts} LegacyElementMixin must be applied to an\n * HTMLElement\n * @override\n */\n queryDistributedElements(selector) {\n const thisEl = /** @type {Element} */ (this);\n const domApi = /** @type {PolymerDomApi} */ (dom(thisEl));\n return domApi.queryDistributedElements(selector);\n }\n\n /**\n * Returns a list of elements that are the effective children. The effective\n * children list is the same as the element's children except that\n * any `<content>` elements are replaced with the list of elements\n * distributed to the `<content>`.\n *\n * @return {!Array<!Node>} List of effective children.\n * @override\n */\n getEffectiveChildren() {\n let list = this.getEffectiveChildNodes();\n return list.filter(function(/** @type {!Node} */ n) {\n return (n.nodeType === Node.ELEMENT_NODE);\n });\n }\n\n /**\n * Returns a string of text content that is the concatenation of the\n * text content's of the element's effective childNodes (the elements\n * returned by <a href=\"#getEffectiveChildNodes>getEffectiveChildNodes</a>.\n *\n * @return {string} List of effective children.\n * @override\n */\n getEffectiveTextContent() {\n let cn = this.getEffectiveChildNodes();\n let tc = [];\n for (let i=0, c; (c = cn[i]); i++) {\n if (c.nodeType !== Node.COMMENT_NODE) {\n tc.push(c.textContent);\n }\n }\n return tc.join('');\n }\n\n /**\n * Returns the first effective childNode within this element that\n * match `selector`. These can be dom child nodes or elements distributed\n * to children that are insertion points.\n * @param {string} selector Selector to run.\n * @return {Node} First effective child node that matches selector.\n * @override\n */\n queryEffectiveChildren(selector) {\n let e$ = this.queryDistributedElements(selector);\n return e$ && e$[0];\n }\n\n /**\n * Returns a list of effective childNodes within this element that\n * match `selector`. These can be dom child nodes or elements distributed\n * to children that are insertion points.\n * @param {string} selector Selector to run.\n * @return {!Array<!Node>} List of effective child nodes that match\n * selector.\n * @override\n */\n queryAllEffectiveChildren(selector) {\n return this.queryDistributedElements(selector);\n }\n\n /**\n * Returns a list of nodes distributed to this element's `<slot>`.\n *\n * If this element contains more than one `<slot>` in its local DOM,\n * an optional selector may be passed to choose the desired content.\n *\n * @param {string=} slctr CSS selector to choose the desired\n * `<slot>`. Defaults to `content`.\n * @return {!Array<!Node>} List of distributed nodes for the `<slot>`.\n * @override\n */\n getContentChildNodes(slctr) {\n // Note, no need to `wrap` this because root is always\n let content = this.root.querySelector(slctr || 'slot');\n return content ?\n /** @type {PolymerDomApi} */ (dom(content)).getDistributedNodes() :\n [];\n }\n\n /**\n * Returns a list of element children distributed to this element's\n * `<slot>`.\n *\n * If this element contains more than one `<slot>` in its\n * local DOM, an optional selector may be passed to choose the desired\n * content. This method differs from `getContentChildNodes` in that only\n * elements are returned.\n *\n * @param {string=} slctr CSS selector to choose the desired\n * `<content>`. Defaults to `content`.\n * @return {!Array<!HTMLElement>} List of distributed nodes for the\n * `<slot>`.\n * @suppress {invalidCasts}\n * @override\n */\n getContentChildren(slctr) {\n let children = /** @type {!Array<!HTMLElement>} */(this.getContentChildNodes(slctr).filter(function(n) {\n return (n.nodeType === Node.ELEMENT_NODE);\n }));\n return children;\n }\n\n /**\n * Checks whether an element is in this element's light DOM tree.\n *\n * @param {?Node} node The element to be checked.\n * @return {boolean} true if node is in this element's light DOM tree.\n * @suppress {invalidCasts} LegacyElementMixin must be applied to an\n * HTMLElement\n * @override\n */\n isLightDescendant(node) {\n const thisNode = /** @type {Node} */ (this);\n return thisNode !== node && wrap(thisNode).contains(node) &&\n wrap(thisNode).getRootNode() === wrap(node).getRootNode();\n }\n\n /**\n * Checks whether an element is in this element's local DOM tree.\n *\n * @param {!Element} node The element to be checked.\n * @return {boolean} true if node is in this element's local DOM tree.\n * @override\n */\n isLocalDescendant(node) {\n return this.root === wrap(node).getRootNode();\n }\n\n /**\n * No-op for backwards compatibility. This should now be handled by\n * ShadyCss library.\n * @param {!Element} container Container element to scope\n * @param {boolean=} shouldObserve if true, start a mutation observer for added nodes to the container\n * @return {?MutationObserver} Returns a new MutationObserver on `container` if `shouldObserve` is true.\n * @override\n */\n scopeSubtree(container, shouldObserve = false) {\n return scopeSubtree(container, shouldObserve);\n }\n\n /**\n * Returns the computed style value for the given property.\n * @param {string} property The css property name.\n * @return {string} Returns the computed css property value for the given\n * `property`.\n * @suppress {invalidCasts} LegacyElementMixin must be applied to an\n * HTMLElement\n * @override\n */\n getComputedStyleValue(property) {\n return styleInterface.getComputedStyleValue(/** @type {!Element} */(this), property);\n }\n\n // debounce\n\n /**\n * Call `debounce` to collapse multiple requests for a named task into\n * one invocation which is made after the wait time has elapsed with\n * no new request. If no wait time is given, the callback will be called\n * at microtask timing (guaranteed before paint).\n *\n * debouncedClickAction(e) {\n * // will not call `processClick` more than once per 100ms\n * this.debounce('click', function() {\n * this.processClick();\n * } 100);\n * }\n *\n * @param {string} jobName String to identify the debounce job.\n * @param {function():void} callback Function that is called (with `this`\n * context) when the wait time elapses.\n * @param {number=} wait Optional wait time in milliseconds (ms) after the\n * last signal that must elapse before invoking `callback`\n * @return {!Object} Returns a debouncer object on which exists the\n * following methods: `isActive()` returns true if the debouncer is\n * active; `cancel()` cancels the debouncer if it is active;\n * `flush()` immediately invokes the debounced callback if the debouncer\n * is active.\n * @override\n */\n debounce(jobName, callback, wait) {\n this._debouncers = this._debouncers || {};\n return this._debouncers[jobName] = Debouncer.debounce(\n this._debouncers[jobName]\n , wait > 0 ? timeOut.after(wait) : microTask\n , callback.bind(this));\n }\n\n /**\n * Returns whether a named debouncer is active.\n *\n * @param {string} jobName The name of the debouncer started with `debounce`\n * @return {boolean} Whether the debouncer is active (has not yet fired).\n * @override\n */\n isDebouncerActive(jobName) {\n this._debouncers = this._debouncers || {};\n let debouncer = this._debouncers[jobName];\n return !!(debouncer && debouncer.isActive());\n }\n\n /**\n * Immediately calls the debouncer `callback` and inactivates it.\n *\n * @param {string} jobName The name of the debouncer started with `debounce`\n * @return {void}\n * @override\n */\n flushDebouncer(jobName) {\n this._debouncers = this._debouncers || {};\n let debouncer = this._debouncers[jobName];\n if (debouncer) {\n debouncer.flush();\n }\n }\n\n /**\n * Cancels an active debouncer. The `callback` will not be called.\n *\n * @param {string} jobName The name of the debouncer started with `debounce`\n * @return {void}\n * @override\n */\n cancelDebouncer(jobName) {\n this._debouncers = this._debouncers || {};\n let debouncer = this._debouncers[jobName];\n if (debouncer) {\n debouncer.cancel();\n }\n }\n\n /**\n * Runs a callback function asynchronously.\n *\n * By default (if no waitTime is specified), async callbacks are run at\n * microtask timing, which will occur before paint.\n *\n * @param {!Function} callback The callback function to run, bound to\n * `this`.\n * @param {number=} waitTime Time to wait before calling the\n * `callback`. If unspecified or 0, the callback will be run at microtask\n * timing (before paint).\n * @return {number} Handle that may be used to cancel the async job.\n * @override\n */\n async(callback, waitTime) {\n return waitTime > 0 ? timeOut.run(callback.bind(this), waitTime) :\n ~microTask.run(callback.bind(this));\n }\n\n /**\n * Cancels an async operation started with `async`.\n *\n * @param {number} handle Handle returned from original `async` call to\n * cancel.\n * @return {void}\n * @override\n */\n cancelAsync(handle) {\n handle < 0 ? microTask.cancel(~handle) :\n timeOut.cancel(handle);\n }\n\n // other\n\n /**\n * Convenience method for creating an element and configuring it.\n *\n * @param {string} tag HTML element tag to create.\n * @param {Object=} props Object of properties to configure on the\n * instance.\n * @return {!Element} Newly created and configured element.\n * @override\n */\n create(tag, props) {\n let elt = document.createElement(tag);\n if (props) {\n if (elt.setProperties) {\n elt.setProperties(props);\n } else {\n for (let n in props) {\n elt[n] = props[n];\n }\n }\n }\n return elt;\n }\n\n /**\n * Polyfill for Element.prototype.matches, which is sometimes still\n * prefixed.\n *\n * @param {string} selector Selector to test.\n * @param {!Element=} node Element to test the selector against.\n * @return {boolean} Whether the element matches the selector.\n * @override\n */\n elementMatches(selector, node) {\n return matchesSelector( (node || this), selector);\n }\n\n /**\n * Toggles an HTML attribute on or off.\n *\n * @param {string} name HTML attribute name\n * @param {boolean=} bool Boolean to force the attribute on or off.\n * When unspecified, the state of the attribute will be reversed.\n * @return {boolean} true if the attribute now exists\n * @override\n */\n toggleAttribute(name, bool) {\n let node = /** @type {Element} */(this);\n if (arguments.length === 3) {\n node = /** @type {Element} */(arguments[2]);\n }\n if (arguments.length == 1) {\n bool = !node.hasAttribute(name);\n }\n if (bool) {\n wrap(node).setAttribute(name, '');\n return true;\n } else {\n wrap(node).removeAttribute(name);\n return false;\n }\n }\n\n\n /**\n * Toggles a CSS class on or off.\n *\n * @param {string} name CSS class name\n * @param {boolean=} bool Boolean to force the class on or off.\n * When unspecified, the state of the class will be reversed.\n * @param {Element=} node Node to target. Defaults to `this`.\n * @return {void}\n * @override\n */\n toggleClass(name, bool, node) {\n node = /** @type {Element} */ (node || this);\n if (arguments.length == 1) {\n bool = !node.classList.contains(name);\n }\n if (bool) {\n node.classList.add(name);\n } else {\n node.classList.remove(name);\n }\n }\n\n /**\n * Cross-platform helper for setting an element's CSS `transform` property.\n *\n * @param {string} transformText Transform setting.\n * @param {Element=} node Element to apply the transform to.\n * Defaults to `this`\n * @return {void}\n * @override\n */\n transform(transformText, node) {\n node = /** @type {Element} */ (node || this);\n node.style.webkitTransform = transformText;\n node.style.transform = transformText;\n }\n\n /**\n * Cross-platform helper for setting an element's CSS `translate3d`\n * property.\n *\n * @param {number|string} x X offset.\n * @param {number|string} y Y offset.\n * @param {number|string} z Z offset.\n * @param {Element=} node Element to apply the transform to.\n * Defaults to `this`.\n * @return {void}\n * @override\n */\n translate3d(x, y, z, node) {\n node = /** @type {Element} */ (node || this);\n this.transform('translate3d(' + x + ',' + y + ',' + z + ')', node);\n }\n\n /**\n * Removes an item from an array, if it exists.\n *\n * If the array is specified by path, a change notification is\n * generated, so that observers, data bindings and computed\n * properties watching that path can update.\n *\n * If the array is passed directly, **no change\n * notification is generated**.\n *\n * @param {string | !Array<number|string>} arrayOrPath Path to array from\n * which to remove the item\n * (or the array itself).\n * @param {*} item Item to remove.\n * @return {Array} Array containing item removed.\n * @override\n */\n arrayDelete(arrayOrPath, item) {\n let index;\n if (Array.isArray(arrayOrPath)) {\n index = arrayOrPath.indexOf(item);\n if (index >= 0) {\n return arrayOrPath.splice(index, 1);\n }\n } else {\n let arr = get(this, arrayOrPath);\n index = arr.indexOf(item);\n if (index >= 0) {\n return this.splice(arrayOrPath, index, 1);\n }\n }\n return null;\n }\n\n // logging\n\n /**\n * Facades `console.log`/`warn`/`error` as override point.\n *\n * @param {string} level One of 'log', 'warn', 'error'\n * @param {Array} args Array of strings or objects to log\n * @return {void}\n * @override\n */\n _logger(level, args) {\n // accept ['foo', 'bar'] and [['foo', 'bar']]\n if (Array.isArray(args) && args.length === 1 && Array.isArray(args[0])) {\n args = args[0];\n }\n switch(level) {\n case 'log':\n case 'warn':\n case 'error':\n console[level](...args);\n }\n }\n\n /**\n * Facades `console.log` as an override point.\n *\n * @param {...*} args Array of strings or objects to log\n * @return {void}\n * @override\n */\n _log(...args) {\n this._logger('log', args);\n }\n\n /**\n * Facades `console.warn` as an override point.\n *\n * @param {...*} args Array of strings or objects to log\n * @return {void}\n * @override\n */\n _warn(...args) {\n this._logger('warn', args);\n }\n\n /**\n * Facades `console.error` as an override point.\n *\n * @param {...*} args Array of strings or objects to log\n * @return {void}\n * @override\n */\n _error(...args) {\n this._logger('error', args);\n }\n\n /**\n * Formats a message using the element type an a method name.\n *\n * @param {string} methodName Method name to associate with message\n * @param {...*} args Array of strings or objects to log\n * @return {!Array} Array with formatting information for `console`\n * logging.\n * @override\n */\n _logf(methodName, ...args) {\n return ['[%s::%s]', this.is, methodName, ...args];\n }\n\n }\n\n LegacyElement.prototype.is = '';\n\n return LegacyElement;\n});\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nimport { LegacyElementMixin } from './legacy-element-mixin.js';\nimport { legacyOptimizations } from '../utils/settings.js';\n\nconst lifecycleProps = {\n attached: true,\n detached: true,\n ready: true,\n created: true,\n beforeRegister: true,\n registered: true,\n attributeChanged: true,\n listeners: true,\n hostAttributes: true\n};\n\nconst excludeOnInfo = {\n attached: true,\n detached: true,\n ready: true,\n created: true,\n beforeRegister: true,\n registered: true,\n attributeChanged: true,\n behaviors: true,\n _noAccessors: true\n};\n\nconst excludeOnBehaviors = Object.assign({\n listeners: true,\n hostAttributes: true,\n properties: true,\n observers: true,\n}, excludeOnInfo);\n\nfunction copyProperties(source, target, excludeProps) {\n const noAccessors = source._noAccessors;\n const propertyNames = Object.getOwnPropertyNames(source);\n for (let i = 0; i < propertyNames.length; i++) {\n let p = propertyNames[i];\n if (p in excludeProps) {\n continue;\n }\n if (noAccessors) {\n target[p] = source[p];\n } else {\n let pd = Object.getOwnPropertyDescriptor(source, p);\n if (pd) {\n // ensure property is configurable so that a later behavior can\n // re-configure it.\n pd.configurable = true;\n Object.defineProperty(target, p, pd);\n }\n }\n }\n}\n\n/**\n * Applies a \"legacy\" behavior or array of behaviors to the provided class.\n *\n * Note: this method will automatically also apply the `LegacyElementMixin`\n * to ensure that any legacy behaviors can rely on legacy Polymer API on\n * the underlying element.\n *\n * @function\n * @template T\n * @param {!Object|!Array<!Object>} behaviors Behavior object or array of behaviors.\n * @param {function(new:T)} klass Element class.\n * @return {?} Returns a new Element class extended by the\n * passed in `behaviors` and also by `LegacyElementMixin`.\n * @suppress {invalidCasts, checkTypes}\n */\nexport function mixinBehaviors(behaviors, klass) {\n return GenerateClassFromInfo({}, LegacyElementMixin(klass), behaviors);\n}\n\n// NOTE:\n// 1.x\n// Behaviors were mixed in *in reverse order* and de-duped on the fly.\n// The rule was that behavior properties were copied onto the element\n// prototype if and only if the property did not already exist.\n// Given: Polymer{ behaviors: [A, B, C, A, B]}, property copy order was:\n// (1), B, (2), A, (3) C. This means prototype properties win over\n// B properties win over A win over C. This mirrors what would happen\n// with inheritance if element extended B extended A extended C.\n//\n// Again given, Polymer{ behaviors: [A, B, C, A, B]}, the resulting\n// `behaviors` array was [C, A, B].\n// Behavior lifecycle methods were called in behavior array order\n// followed by the element, e.g. (1) C.created, (2) A.created,\n// (3) B.created, (4) element.created. There was no support for\n// super, and \"super-behavior\" methods were callable only by name).\n//\n// 2.x\n// Behaviors are made into proper mixins which live in the\n// element's prototype chain. Behaviors are placed in the element prototype\n// eldest to youngest and de-duped youngest to oldest:\n// So, first [A, B, C, A, B] becomes [C, A, B] then,\n// the element prototype becomes (oldest) (1) PolymerElement, (2) class(C),\n// (3) class(A), (4) class(B), (5) class(Polymer({...})).\n// Result:\n// This means element properties win over B properties win over A win\n// over C. (same as 1.x)\n// If lifecycle is called (super then me), order is\n// (1) C.created, (2) A.created, (3) B.created, (4) element.created\n// (again same as 1.x)\nfunction applyBehaviors(proto, behaviors, lifecycle) {\n for (let i=0; i<behaviors.length; i++) {\n applyInfo(proto, behaviors[i], lifecycle, excludeOnBehaviors);\n }\n}\n\nfunction applyInfo(proto, info, lifecycle, excludeProps) {\n copyProperties(info, proto, excludeProps);\n for (let p in lifecycleProps) {\n if (info[p]) {\n lifecycle[p] = lifecycle[p] || [];\n lifecycle[p].push(info[p]);\n }\n }\n}\n\n/**\n * @param {Array} behaviors List of behaviors to flatten.\n * @param {Array=} list Target list to flatten behaviors into.\n * @param {Array=} exclude List of behaviors to exclude from the list.\n * @return {!Array} Returns the list of flattened behaviors.\n */\nfunction flattenBehaviors(behaviors, list, exclude) {\n list = list || [];\n for (let i=behaviors.length-1; i >= 0; i--) {\n let b = behaviors[i];\n if (b) {\n if (Array.isArray(b)) {\n flattenBehaviors(b, list);\n } else {\n // dedup\n if (list.indexOf(b) < 0 && (!exclude || exclude.indexOf(b) < 0)) {\n list.unshift(b);\n }\n }\n } else {\n console.warn('behavior is null, check for missing or 404 import');\n }\n }\n return list;\n}\n\n/**\n * Copies property descriptors from source to target, overwriting all fields\n * of any previous descriptor for a property *except* for `value`, which is\n * merged in from the target if it does not exist on the source.\n *\n * @param {*} target Target properties object\n * @param {*} source Source properties object\n */\nfunction mergeProperties(target, source) {\n for (const p in source) {\n const targetInfo = target[p];\n const sourceInfo = source[p];\n if (!('value' in sourceInfo) && targetInfo && ('value' in targetInfo)) {\n target[p] = Object.assign({value: targetInfo.value}, sourceInfo);\n } else {\n target[p] = sourceInfo;\n }\n }\n}\n\nconst LegacyElement = LegacyElementMixin(HTMLElement);\n\n/* Note about construction and extension of legacy classes.\n [Changed in Q4 2018 to optimize performance.]\n\n When calling `Polymer` or `mixinBehaviors`, the generated class below is\n made. The list of behaviors was previously made into one generated class per\n behavior, but this is no longer the case as behaviors are now called\n manually. Note, there may *still* be multiple generated classes in the\n element's prototype chain if extension is used with `mixinBehaviors`.\n\n The generated class is directly tied to the info object and behaviors\n used to create it. That list of behaviors is filtered so it's only the\n behaviors not active on the superclass. In order to call through to the\n entire list of lifecycle methods, it's important to call `super`.\n\n The element's `properties` and `observers` are controlled via the finalization\n mechanism provided by `PropertiesMixin`. `Properties` and `observers` are\n collected by manually traversing the prototype chain and merging.\n\n To limit changes, the `_registered` method is called via `_initializeProperties`\n and not `_finalizeClass`.\n\n*/\n/**\n * @param {!PolymerInit} info Polymer info object\n * @param {function(new:HTMLElement)} Base base class to extend with info object\n * @param {Object=} behaviors behaviors to copy into the element\n * @return {function(new:HTMLElement)} Generated class\n * @suppress {checkTypes}\n * @private\n */\nfunction GenerateClassFromInfo(info, Base, behaviors) {\n\n // manages behavior and lifecycle processing (filled in after class definition)\n let behaviorList;\n const lifecycle = {};\n\n /** @private */\n class PolymerGenerated extends Base {\n\n // explicitly not calling super._finalizeClass\n /** @nocollapse */\n static _finalizeClass() {\n // if calling via a subclass that hasn't been generated, pass through to super\n if (!this.hasOwnProperty(JSCompiler_renameProperty('generatedFrom', this))) {\n // TODO(https://github.com/google/closure-compiler/issues/3240):\n // Change back to just super.methodCall()\n Base._finalizeClass.call(this);\n } else {\n // interleave properties and observers per behavior and `info`\n if (behaviorList) {\n for (let i=0, b; i < behaviorList.length; i++) {\n b = behaviorList[i];\n if (b.properties) {\n this.createProperties(b.properties);\n }\n if (b.observers) {\n this.createObservers(b.observers, b.properties);\n }\n }\n }\n if (info.properties) {\n this.createProperties(info.properties);\n }\n if (info.observers) {\n this.createObservers(info.observers, info.properties);\n }\n // make sure to prepare the element template\n this._prepareTemplate();\n }\n }\n\n /** @nocollapse */\n static get properties() {\n const properties = {};\n if (behaviorList) {\n for (let i=0; i < behaviorList.length; i++) {\n mergeProperties(properties, behaviorList[i].properties);\n }\n }\n mergeProperties(properties, info.properties);\n return properties;\n }\n\n /** @nocollapse */\n static get observers() {\n let observers = [];\n if (behaviorList) {\n for (let i=0, b; i < behaviorList.length; i++) {\n b = behaviorList[i];\n if (b.observers) {\n observers = observers.concat(b.observers);\n }\n }\n }\n if (info.observers) {\n observers = observers.concat(info.observers);\n }\n return observers;\n }\n\n /**\n * @return {void}\n */\n created() {\n super.created();\n const list = lifecycle.created;\n if (list) {\n for (let i=0; i < list.length; i++) {\n list[i].call(this);\n }\n }\n }\n\n /**\n * @return {void}\n */\n _registered() {\n /* NOTE: `beforeRegister` is called here for bc, but the behavior\n is different than in 1.x. In 1.0, the method was called *after*\n mixing prototypes together but *before* processing of meta-objects.\n However, dynamic effects can still be set here and can be done either\n in `beforeRegister` or `registered`. It is no longer possible to set\n `is` in `beforeRegister` as you could in 1.x.\n */\n // only proceed if the generated class' prototype has not been registered.\n const generatedProto = PolymerGenerated.prototype;\n if (!generatedProto.hasOwnProperty(JSCompiler_renameProperty('__hasRegisterFinished', generatedProto))) {\n generatedProto.__hasRegisterFinished = true;\n // ensure superclass is registered first.\n super._registered();\n // copy properties onto the generated class lazily if we're optimizing,\n if (legacyOptimizations) {\n copyPropertiesToProto(generatedProto);\n }\n // make sure legacy lifecycle is called on the *element*'s prototype\n // and not the generated class prototype; if the element has been\n // extended, these are *not* the same.\n const proto = Object.getPrototypeOf(this);\n let list = lifecycle.beforeRegister;\n if (list) {\n for (let i=0; i < list.length; i++) {\n list[i].call(proto);\n }\n }\n list = lifecycle.registered;\n if (list) {\n for (let i=0; i < list.length; i++) {\n list[i].call(proto);\n }\n }\n }\n }\n\n /**\n * @return {void}\n */\n _applyListeners() {\n super._applyListeners();\n const list = lifecycle.listeners;\n if (list) {\n for (let i=0; i < list.length; i++) {\n const listeners = list[i];\n if (listeners) {\n for (let l in listeners) {\n this._addMethodEventListenerToNode(this, l, listeners[l]);\n }\n }\n }\n }\n }\n\n // note: exception to \"super then me\" rule;\n // do work before calling super so that super attributes\n // only apply if not already set.\n /**\n * @return {void}\n */\n _ensureAttributes() {\n const list = lifecycle.hostAttributes;\n if (list) {\n for (let i=list.length-1; i >= 0; i--) {\n const hostAttributes = list[i];\n for (let a in hostAttributes) {\n this._ensureAttribute(a, hostAttributes[a]);\n }\n }\n }\n super._ensureAttributes();\n }\n\n /**\n * @return {void}\n */\n ready() {\n super.ready();\n let list = lifecycle.ready;\n if (list) {\n for (let i=0; i < list.length; i++) {\n list[i].call(this);\n }\n }\n }\n\n /**\n * @return {void}\n */\n attached() {\n super.attached();\n let list = lifecycle.attached;\n if (list) {\n for (let i=0; i < list.length; i++) {\n list[i].call(this);\n }\n }\n }\n\n /**\n * @return {void}\n */\n detached() {\n super.detached();\n let list = lifecycle.detached;\n if (list) {\n for (let i=0; i < list.length; i++) {\n list[i].call(this);\n }\n }\n }\n\n /**\n * Implements native Custom Elements `attributeChangedCallback` to\n * set an attribute value to a property via `_attributeToProperty`.\n *\n * @param {string} name Name of attribute that changed\n * @param {?string} old Old attribute value\n * @param {?string} value New attribute value\n * @return {void}\n */\n attributeChanged(name, old, value) {\n super.attributeChanged();\n let list = lifecycle.attributeChanged;\n if (list) {\n for (let i=0; i < list.length; i++) {\n list[i].call(this, name, old, value);\n }\n }\n }\n }\n\n // apply behaviors, note actual copying is done lazily at first instance creation\n if (behaviors) {\n // NOTE: ensure the behavior is extending a class with\n // legacy element api. This is necessary since behaviors expect to be able\n // to access 1.x legacy api.\n if (!Array.isArray(behaviors)) {\n behaviors = [behaviors];\n }\n let superBehaviors = Base.prototype.behaviors;\n // get flattened, deduped list of behaviors *not* already on super class\n behaviorList = flattenBehaviors(behaviors, null, superBehaviors);\n PolymerGenerated.prototype.behaviors = superBehaviors ?\n superBehaviors.concat(behaviors) : behaviorList;\n }\n\n const copyPropertiesToProto = (proto) => {\n if (behaviorList) {\n applyBehaviors(proto, behaviorList, lifecycle);\n }\n applyInfo(proto, info, lifecycle, excludeOnInfo);\n };\n\n // copy properties if we're not optimizing\n if (!legacyOptimizations) {\n copyPropertiesToProto(PolymerGenerated.prototype);\n }\n\n PolymerGenerated.generatedFrom = info;\n\n return PolymerGenerated;\n}\n\n/**\n * Generates a class that extends `LegacyElement` based on the\n * provided info object. Metadata objects on the `info` object\n * (`properties`, `observers`, `listeners`, `behaviors`, `is`) are used\n * for Polymer's meta-programming systems, and any functions are copied\n * to the generated class.\n *\n * Valid \"metadata\" values are as follows:\n *\n * `is`: String providing the tag name to register the element under. In\n * addition, if a `dom-module` with the same id exists, the first template\n * in that `dom-module` will be stamped into the shadow root of this element,\n * with support for declarative event listeners (`on-...`), Polymer data\n * bindings (`[[...]]` and `{{...}}`), and id-based node finding into\n * `this.$`.\n *\n * `properties`: Object describing property-related metadata used by Polymer\n * features (key: property names, value: object containing property metadata).\n * Valid keys in per-property metadata include:\n * - `type` (String|Number|Object|Array|...): Used by\n * `attributeChangedCallback` to determine how string-based attributes\n * are deserialized to JavaScript property values.\n * - `notify` (boolean): Causes a change in the property to fire a\n * non-bubbling event called `<property>-changed`. Elements that have\n * enabled two-way binding to the property use this event to observe changes.\n * - `readOnly` (boolean): Creates a getter for the property, but no setter.\n * To set a read-only property, use the private setter method\n * `_setProperty(property, value)`.\n * - `observer` (string): Observer method name that will be called when\n * the property changes. The arguments of the method are\n * `(value, previousValue)`.\n * - `computed` (string): String describing method and dependent properties\n * for computing the value of this property (e.g. `'computeFoo(bar, zot)'`).\n * Computed properties are read-only by default and can only be changed\n * via the return value of the computing method.\n *\n * `observers`: Array of strings describing multi-property observer methods\n * and their dependent properties (e.g. `'observeABC(a, b, c)'`).\n *\n * `listeners`: Object describing event listeners to be added to each\n * instance of this element (key: event name, value: method name).\n *\n * `behaviors`: Array of additional `info` objects containing metadata\n * and callbacks in the same format as the `info` object here which are\n * merged into this element.\n *\n * `hostAttributes`: Object listing attributes to be applied to the host\n * once created (key: attribute name, value: attribute value). Values\n * are serialized based on the type of the value. Host attributes should\n * generally be limited to attributes such as `tabIndex` and `aria-...`.\n * Attributes in `hostAttributes` are only applied if a user-supplied\n * attribute is not already present (attributes in markup override\n * `hostAttributes`).\n *\n * In addition, the following Polymer-specific callbacks may be provided:\n * - `registered`: called after first instance of this element,\n * - `created`: called during `constructor`\n * - `attached`: called during `connectedCallback`\n * - `detached`: called during `disconnectedCallback`\n * - `ready`: called before first `attached`, after all properties of\n * this element have been propagated to its template and all observers\n * have run\n *\n * @param {!PolymerInit} info Object containing Polymer metadata and functions\n * to become class methods.\n * @template T\n * @param {function(T):T} mixin Optional mixin to apply to legacy base class\n * before extending with Polymer metaprogramming.\n * @return {function(new:HTMLElement)} Generated class\n */\nexport const Class = function(info, mixin) {\n if (!info) {\n console.warn('Polymer.Class requires `info` argument');\n }\n let klass = mixin ? mixin(LegacyElement) :\n LegacyElement;\n klass = GenerateClassFromInfo(info, klass, info.behaviors);\n // decorate klass with registration info\n klass.is = klass.prototype.is = info.is;\n return klass;\n};\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\nimport { Class } from './class.js';\n\nimport '../utils/boot.js';\n\n/**\n * Legacy class factory and registration helper for defining Polymer\n * elements.\n *\n * This method is equivalent to\n *\n * import {Class} from '@polymer/polymer/lib/legacy/class.js';\n * customElements.define(info.is, Class(info));\n *\n * See `Class` for details on valid legacy metadata format for `info`.\n *\n * @global\n * @override\n * @function\n * @param {!PolymerInit} info Object containing Polymer metadata and functions\n * to become class methods.\n * @return {function(new: HTMLElement)} Generated class\n * @suppress {duplicate, invalidCasts, checkTypes}\n */\nconst Polymer = function(info) {\n // if input is a `class` (aka a function with a prototype), use the prototype\n // remember that the `constructor` will never be called\n let klass;\n if (typeof info === 'function') {\n klass = info;\n } else {\n klass = Polymer.Class(info);\n }\n // Copy opt out for `legacyNoObservedAttributes` from info object to class.\n if (info._legacyForceObservedAttributes) {\n klass.prototype._legacyForceObservedAttributes = info._legacyForceObservedAttributes;\n }\n customElements.define(klass.is, /** @type {!HTMLElement} */(klass));\n return klass;\n};\n\nPolymer.Class = Class;\n\nexport { Polymer };","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\nimport { dedupingMixin } from '../utils/mixin.js';\n\n// Common implementation for mixin & behavior\nfunction mutablePropertyChange(inst, property, value, old, mutableData) {\n let isObject;\n if (mutableData) {\n isObject = (typeof value === 'object' && value !== null);\n // Pull `old` for Objects from temp cache, but treat `null` as a primitive\n if (isObject) {\n old = inst.__dataTemp[property];\n }\n }\n // Strict equality check, but return false for NaN===NaN\n let shouldChange = (old !== value && (old === old || value === value));\n // Objects are stored in temporary cache (cleared at end of\n // turn), which is used for dirty-checking\n if (isObject && shouldChange) {\n inst.__dataTemp[property] = value;\n }\n return shouldChange;\n}\n\n/**\n * Element class mixin to skip strict dirty-checking for objects and arrays\n * (always consider them to be \"dirty\"), for use on elements utilizing\n * `PropertyEffects`\n *\n * By default, `PropertyEffects` performs strict dirty checking on\n * objects, which means that any deep modifications to an object or array will\n * not be propagated unless \"immutable\" data patterns are used (i.e. all object\n * references from the root to the mutation were changed).\n *\n * Polymer also provides a proprietary data mutation and path notification API\n * (e.g. `notifyPath`, `set`, and array mutation API's) that allow efficient\n * mutation and notification of deep changes in an object graph to all elements\n * bound to the same object graph.\n *\n * In cases where neither immutable patterns nor the data mutation API can be\n * used, applying this mixin will cause Polymer to skip dirty checking for\n * objects and arrays (always consider them to be \"dirty\"). This allows a\n * user to make a deep modification to a bound object graph, and then either\n * simply re-set the object (e.g. `this.items = this.items`) or call `notifyPath`\n * (e.g. `this.notifyPath('items')`) to update the tree. Note that all\n * elements that wish to be updated based on deep mutations must apply this\n * mixin or otherwise skip strict dirty checking for objects/arrays.\n * Specifically, any elements in the binding tree between the source of a\n * mutation and the consumption of it must apply this mixin or enable the\n * `OptionalMutableData` mixin.\n *\n * In order to make the dirty check strategy configurable, see\n * `OptionalMutableData`.\n *\n * Note, the performance characteristics of propagating large object graphs\n * will be worse as opposed to using strict dirty checking with immutable\n * patterns or Polymer's path notification API.\n *\n * @mixinFunction\n * @polymer\n * @summary Element class mixin to skip strict dirty-checking for objects\n * and arrays\n * @template T\n * @param {function(new:T)} superClass Class to apply mixin to.\n * @return {function(new:T)} superClass with mixin applied.\n */\nexport const MutableData = dedupingMixin(superClass => {\n\n /**\n * @polymer\n * @mixinClass\n * @implements {Polymer_MutableData}\n */\n class MutableData extends superClass {\n /**\n * Overrides `PropertyEffects` to provide option for skipping\n * strict equality checking for Objects and Arrays.\n *\n * This method pulls the value to dirty check against from the `__dataTemp`\n * cache (rather than the normal `__data` cache) for Objects. Since the temp\n * cache is cleared at the end of a turn, this implementation allows\n * side-effects of deep object changes to be processed by re-setting the\n * same object (using the temp cache as an in-turn backstop to prevent\n * cycles due to 2-way notification).\n *\n * @param {string} property Property name\n * @param {*} value New property value\n * @param {*} old Previous property value\n * @return {boolean} Whether the property should be considered a change\n * @protected\n */\n _shouldPropertyChange(property, value, old) {\n return mutablePropertyChange(this, property, value, old, true);\n }\n\n }\n\n return MutableData;\n\n});\n\n/**\n * Element class mixin to add the optional ability to skip strict\n * dirty-checking for objects and arrays (always consider them to be\n * \"dirty\") by setting a `mutable-data` attribute on an element instance.\n *\n * By default, `PropertyEffects` performs strict dirty checking on\n * objects, which means that any deep modifications to an object or array will\n * not be propagated unless \"immutable\" data patterns are used (i.e. all object\n * references from the root to the mutation were changed).\n *\n * Polymer also provides a proprietary data mutation and path notification API\n * (e.g. `notifyPath`, `set`, and array mutation API's) that allow efficient\n * mutation and notification of deep changes in an object graph to all elements\n * bound to the same object graph.\n *\n * In cases where neither immutable patterns nor the data mutation API can be\n * used, applying this mixin will allow Polymer to skip dirty checking for\n * objects and arrays (always consider them to be \"dirty\"). This allows a\n * user to make a deep modification to a bound object graph, and then either\n * simply re-set the object (e.g. `this.items = this.items`) or call `notifyPath`\n * (e.g. `this.notifyPath('items')`) to update the tree. Note that all\n * elements that wish to be updated based on deep mutations must apply this\n * mixin or otherwise skip strict dirty checking for objects/arrays.\n * Specifically, any elements in the binding tree between the source of a\n * mutation and the consumption of it must enable this mixin or apply the\n * `MutableData` mixin.\n *\n * While this mixin adds the ability to forgo Object/Array dirty checking,\n * the `mutableData` flag defaults to false and must be set on the instance.\n *\n * Note, the performance characteristics of propagating large object graphs\n * will be worse by relying on `mutableData: true` as opposed to using\n * strict dirty checking with immutable patterns or Polymer's path notification\n * API.\n *\n * @mixinFunction\n * @polymer\n * @summary Element class mixin to optionally skip strict dirty-checking\n * for objects and arrays\n */\nexport const OptionalMutableData = dedupingMixin(superClass => {\n\n /**\n * @mixinClass\n * @polymer\n * @implements {Polymer_OptionalMutableData}\n */\n class OptionalMutableData extends superClass {\n\n /** @nocollapse */\n static get properties() {\n return {\n /**\n * Instance-level flag for configuring the dirty-checking strategy\n * for this element. When true, Objects and Arrays will skip dirty\n * checking, otherwise strict equality checking will be used.\n */\n mutableData: Boolean\n };\n }\n\n /**\n * Overrides `PropertyEffects` to provide option for skipping\n * strict equality checking for Objects and Arrays.\n *\n * When `this.mutableData` is true on this instance, this method\n * pulls the value to dirty check against from the `__dataTemp` cache\n * (rather than the normal `__data` cache) for Objects. Since the temp\n * cache is cleared at the end of a turn, this implementation allows\n * side-effects of deep object changes to be processed by re-setting the\n * same object (using the temp cache as an in-turn backstop to prevent\n * cycles due to 2-way notification).\n *\n * @param {string} property Property name\n * @param {*} value New property value\n * @param {*} old Previous property value\n * @return {boolean} Whether the property should be considered a change\n * @protected\n */\n _shouldPropertyChange(property, value, old) {\n return mutablePropertyChange(this, property, value, old, this.mutableData);\n }\n }\n\n return OptionalMutableData;\n\n});\n\n// Export for use by legacy behavior\nMutableData._mutablePropertyChange = mutablePropertyChange;\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n/**\n * Module for preparing and stamping instances of templates that utilize\n * Polymer's data-binding and declarative event listener features.\n *\n * Example:\n *\n * // Get a template from somewhere, e.g. light DOM\n * let template = this.querySelector('template');\n * // Prepare the template\n * let TemplateClass = Templatize.templatize(template);\n * // Instance the template with an initial data model\n * let instance = new TemplateClass({myProp: 'initial'});\n * // Insert the instance's DOM somewhere, e.g. element's shadow DOM\n * this.shadowRoot.appendChild(instance.root);\n * // Changing a property on the instance will propagate to bindings\n * // in the template\n * instance.myProp = 'new value';\n *\n * The `options` dictionary passed to `templatize` allows for customizing\n * features of the generated template class, including how outer-scope host\n * properties should be forwarded into template instances, how any instance\n * properties added into the template's scope should be notified out to\n * the host, and whether the instance should be decorated as a \"parent model\"\n * of any event handlers.\n *\n * // Customize property forwarding and event model decoration\n * let TemplateClass = Templatize.templatize(template, this, {\n * parentModel: true,\n * forwardHostProp(property, value) {...},\n * instanceProps: {...},\n * notifyInstanceProp(instance, property, value) {...},\n * });\n *\n * @summary Module for preparing and stamping instances of templates\n * utilizing Polymer templating features.\n */\n\nimport './boot.js';\n\nimport { PropertyEffects } from '../mixins/property-effects.js';\nimport { MutableData } from '../mixins/mutable-data.js';\nimport { strictTemplatePolicy, legacyWarnings } from './settings.js';\nimport { wrap } from './wrap.js';\n\n// Base class for HTMLTemplateElement extension that has property effects\n// machinery for propagating host properties to children. This is an ES5\n// class only because Babel (incorrectly) requires super() in the class\n// constructor even though no `this` is used and it returns an instance.\nlet newInstance = null;\n\n/**\n * @constructor\n * @extends {HTMLTemplateElement}\n * @private\n */\nfunction HTMLTemplateElementExtension() { return newInstance; }\nHTMLTemplateElementExtension.prototype = Object.create(HTMLTemplateElement.prototype, {\n constructor: {\n value: HTMLTemplateElementExtension,\n writable: true\n }\n});\n\n/**\n * @constructor\n * @implements {Polymer_PropertyEffects}\n * @extends {HTMLTemplateElementExtension}\n * @private\n */\nconst DataTemplate = PropertyEffects(HTMLTemplateElementExtension);\n\n/**\n * @constructor\n * @implements {Polymer_MutableData}\n * @extends {DataTemplate}\n * @private\n */\nconst MutableDataTemplate = MutableData(DataTemplate);\n\n// Applies a DataTemplate subclass to a <template> instance\nfunction upgradeTemplate(template, constructor) {\n newInstance = template;\n Object.setPrototypeOf(template, constructor.prototype);\n new constructor();\n newInstance = null;\n}\n\n/**\n * Base class for TemplateInstance.\n * @constructor\n * @extends {HTMLElement}\n * @implements {Polymer_PropertyEffects}\n * @private\n */\nconst templateInstanceBase = PropertyEffects(class {});\n\nexport function showHideChildren(hide, children) {\n for (let i=0; i<children.length; i++) {\n let n = children[i];\n // Ignore non-changes\n if (Boolean(hide) != Boolean(n.__hideTemplateChildren__)) {\n // clear and restore text\n if (n.nodeType === Node.TEXT_NODE) {\n if (hide) {\n n.__polymerTextContent__ = n.textContent;\n n.textContent = '';\n } else {\n n.textContent = n.__polymerTextContent__;\n }\n // remove and replace slot\n } else if (n.localName === 'slot') {\n if (hide) {\n n.__polymerReplaced__ = document.createComment('hidden-slot');\n wrap(wrap(n).parentNode).replaceChild(n.__polymerReplaced__, n);\n } else {\n const replace = n.__polymerReplaced__;\n if (replace) {\n wrap(wrap(replace).parentNode).replaceChild(n, replace);\n }\n }\n }\n // hide and show nodes\n else if (n.style) {\n if (hide) {\n n.__polymerDisplay__ = n.style.display;\n n.style.display = 'none';\n } else {\n n.style.display = n.__polymerDisplay__;\n }\n }\n }\n n.__hideTemplateChildren__ = hide;\n if (n._showHideChildren) {\n n._showHideChildren(hide);\n }\n }\n}\n\n/**\n * @polymer\n * @customElement\n * @appliesMixin PropertyEffects\n * @unrestricted\n */\nclass TemplateInstanceBase extends templateInstanceBase {\n constructor(props) {\n super();\n this._configureProperties(props);\n /** @type {!StampedTemplate} */\n this.root = this._stampTemplate(this.__dataHost);\n // Save list of stamped children\n let children = [];\n /** @suppress {invalidCasts} */\n this.children = /** @type {!NodeList} */ (children);\n // Polymer 1.x did not use `Polymer.dom` here so not bothering.\n for (let n = this.root.firstChild; n; n=n.nextSibling) {\n children.push(n);\n n.__templatizeInstance = this;\n }\n if (this.__templatizeOwner &&\n this.__templatizeOwner.__hideTemplateChildren__) {\n this._showHideChildren(true);\n }\n // Flush props only when props are passed if instance props exist\n // or when there isn't instance props.\n let options = this.__templatizeOptions;\n if ((props && options.instanceProps) || !options.instanceProps) {\n this._enableProperties();\n }\n }\n /**\n * Configure the given `props` by calling `_setPendingProperty`. Also\n * sets any properties stored in `__hostProps`.\n * @private\n * @param {Object} props Object of property name-value pairs to set.\n * @return {void}\n */\n _configureProperties(props) {\n let options = this.__templatizeOptions;\n if (options.forwardHostProp) {\n for (let hprop in this.__hostProps) {\n this._setPendingProperty(hprop, this.__dataHost['_host_' + hprop]);\n }\n }\n // Any instance props passed in the constructor will overwrite host props;\n // normally this would be a user error but we don't specifically filter them\n for (let iprop in props) {\n this._setPendingProperty(iprop, props[iprop]);\n }\n }\n /**\n * Forwards a host property to this instance. This method should be\n * called on instances from the `options.forwardHostProp` callback\n * to propagate changes of host properties to each instance.\n *\n * Note this method enqueues the change, which are flushed as a batch.\n *\n * @param {string} prop Property or path name\n * @param {*} value Value of the property to forward\n * @return {void}\n */\n forwardHostProp(prop, value) {\n if (this._setPendingPropertyOrPath(prop, value, false, true)) {\n this.__dataHost._enqueueClient(this);\n }\n }\n\n /**\n * Override point for adding custom or simulated event handling.\n *\n * @override\n * @param {!Node} node Node to add event listener to\n * @param {string} eventName Name of event\n * @param {function(!Event):void} handler Listener function to add\n * @return {void}\n */\n _addEventListenerToNode(node, eventName, handler) {\n if (this._methodHost && this.__templatizeOptions.parentModel) {\n // If this instance should be considered a parent model, decorate\n // events this template instance as `model`\n this._methodHost._addEventListenerToNode(node, eventName, (e) => {\n e.model = this;\n handler(e);\n });\n } else {\n // Otherwise delegate to the template's host (which could be)\n // another template instance\n let templateHost = this.__dataHost.__dataHost;\n if (templateHost) {\n templateHost._addEventListenerToNode(node, eventName, handler);\n }\n }\n }\n /**\n * Shows or hides the template instance top level child elements. For\n * text nodes, `textContent` is removed while \"hidden\" and replaced when\n * \"shown.\"\n * @param {boolean} hide Set to true to hide the children;\n * set to false to show them.\n * @return {void}\n * @protected\n */\n _showHideChildren(hide) {\n showHideChildren(hide, this.children);\n }\n /**\n * Overrides default property-effects implementation to intercept\n * textContent bindings while children are \"hidden\" and cache in\n * private storage for later retrieval.\n *\n * @override\n * @param {!Node} node The node to set a property on\n * @param {string} prop The property to set\n * @param {*} value The value to set\n * @return {void}\n * @protected\n */\n _setUnmanagedPropertyToNode(node, prop, value) {\n if (node.__hideTemplateChildren__ &&\n node.nodeType == Node.TEXT_NODE && prop == 'textContent') {\n node.__polymerTextContent__ = value;\n } else {\n super._setUnmanagedPropertyToNode(node, prop, value);\n }\n }\n /**\n * Find the parent model of this template instance. The parent model\n * is either another templatize instance that had option `parentModel: true`,\n * or else the host element.\n *\n * @return {!Polymer_PropertyEffects} The parent model of this instance\n */\n get parentModel() {\n let model = this.__parentModel;\n if (!model) {\n let options;\n model = this;\n do {\n // A template instance's `__dataHost` is a <template>\n // `model.__dataHost.__dataHost` is the template's host\n model = model.__dataHost.__dataHost;\n } while ((options = model.__templatizeOptions) && !options.parentModel);\n this.__parentModel = model;\n }\n return model;\n }\n\n /**\n * Stub of HTMLElement's `dispatchEvent`, so that effects that may\n * dispatch events safely no-op.\n *\n * @param {Event} event Event to dispatch\n * @return {boolean} Always true.\n * @override\n */\n dispatchEvent(event) { // eslint-disable-line no-unused-vars\n return true;\n }\n}\n\n/** @type {!DataTemplate} */\nTemplateInstanceBase.prototype.__dataHost;\n/** @type {!TemplatizeOptions} */\nTemplateInstanceBase.prototype.__templatizeOptions;\n/** @type {!Polymer_PropertyEffects} */\nTemplateInstanceBase.prototype._methodHost;\n/** @type {!Object} */\nTemplateInstanceBase.prototype.__templatizeOwner;\n/** @type {!Object} */\nTemplateInstanceBase.prototype.__hostProps;\n\n/**\n * @constructor\n * @extends {TemplateInstanceBase}\n * @implements {Polymer_MutableData}\n * @private\n */\nconst MutableTemplateInstanceBase = MutableData(\n // This cast shouldn't be neccessary, but Closure doesn't understand that\n // TemplateInstanceBase is a constructor function.\n /** @type {function(new:TemplateInstanceBase)} */ (TemplateInstanceBase));\n\nfunction findMethodHost(template) {\n // Technically this should be the owner of the outermost template.\n // In shadow dom, this is always getRootNode().host, but we can\n // approximate this via cooperation with our dataHost always setting\n // `_methodHost` as long as there were bindings (or id's) on this\n // instance causing it to get a dataHost.\n let templateHost = template.__dataHost;\n return templateHost && templateHost._methodHost || templateHost;\n}\n\n/* eslint-disable valid-jsdoc */\n/**\n * @suppress {missingProperties} class.prototype is not defined for some reason\n */\nfunction createTemplatizerClass(template, templateInfo, options) {\n /**\n * @constructor\n * @extends {TemplateInstanceBase}\n */\n let templatizerBase = options.mutableData ?\n MutableTemplateInstanceBase : TemplateInstanceBase;\n\n // Affordance for global mixins onto TemplatizeInstance\n if (templatize.mixin) {\n templatizerBase = templatize.mixin(templatizerBase);\n }\n\n /**\n * Anonymous class created by the templatize\n * @constructor\n * @private\n */\n let klass = class extends templatizerBase { };\n /** @override */\n klass.prototype.__templatizeOptions = options;\n klass.prototype._bindTemplate(template);\n addNotifyEffects(klass, template, templateInfo, options);\n return klass;\n}\n\n/**\n * Adds propagate effects from the template to the template instance for\n * properties that the host binds to the template using the `_host_` prefix.\n *\n * @suppress {missingProperties} class.prototype is not defined for some reason\n */\nfunction addPropagateEffects(target, templateInfo, options, methodHost) {\n let userForwardHostProp = options.forwardHostProp;\n if (userForwardHostProp && templateInfo.hasHostProps) {\n // Under the `removeNestedTemplates` optimization, a custom element like\n // `dom-if` or `dom-repeat` can itself be treated as the \"template\"; this\n // flag is used to switch between upgrading a `<template>` to be a property\n // effects client vs. adding the effects directly to the custom element\n const isTemplate = target.localName == 'template';\n // Provide data API and property effects on memoized template class\n let klass = templateInfo.templatizeTemplateClass;\n if (!klass) {\n if (isTemplate) {\n /**\n * @constructor\n * @extends {DataTemplate}\n */\n let templatizedBase =\n options.mutableData ? MutableDataTemplate : DataTemplate;\n\n // NOTE: due to https://github.com/google/closure-compiler/issues/2928,\n // combining the next two lines into one assignment causes a spurious\n // type error.\n /** @private */\n class TemplatizedTemplate extends templatizedBase {}\n klass = templateInfo.templatizeTemplateClass = TemplatizedTemplate;\n } else {\n /**\n * @constructor\n * @extends {PolymerElement}\n */\n const templatizedBase = target.constructor;\n\n // Create a cached subclass of the base custom element class onto which\n // to put the template-specific propagate effects\n // NOTE: due to https://github.com/google/closure-compiler/issues/2928,\n // combining the next two lines into one assignment causes a spurious\n // type error.\n /** @private */\n class TemplatizedTemplateExtension extends templatizedBase {}\n klass = templateInfo.templatizeTemplateClass =\n TemplatizedTemplateExtension;\n }\n // Add template - >instances effects\n // and host <- template effects\n let hostProps = templateInfo.hostProps;\n for (let prop in hostProps) {\n klass.prototype._addPropertyEffect('_host_' + prop,\n klass.prototype.PROPERTY_EFFECT_TYPES.PROPAGATE,\n {fn: createForwardHostPropEffect(prop, userForwardHostProp)});\n klass.prototype._createNotifyingProperty('_host_' + prop);\n }\n if (legacyWarnings && methodHost) {\n warnOnUndeclaredProperties(templateInfo, options, methodHost);\n }\n }\n // Mix any pre-bound data into __data; no need to flush this to\n // instances since they pull from the template at instance-time\n if (target.__dataProto) {\n // Note, generally `__dataProto` could be chained, but it's guaranteed\n // to not be since this is a vanilla template we just added effects to\n Object.assign(target.__data, target.__dataProto);\n }\n if (isTemplate) {\n upgradeTemplate(target, klass);\n // Clear any pending data for performance\n target.__dataTemp = {};\n target.__dataPending = null;\n target.__dataOld = null;\n target._enableProperties();\n } else {\n // Swizzle the cached subclass prototype onto the custom element\n Object.setPrototypeOf(target, klass.prototype);\n // Check for any pre-bound instance host properties, and do the\n // instance property delete/assign dance for those (directly into data;\n // not need to go through accessor since they are pulled at instance time)\n const hostProps = templateInfo.hostProps;\n for (let prop in hostProps) {\n prop = '_host_' + prop;\n if (prop in target) {\n const val = target[prop];\n delete target[prop];\n target.__data[prop] = val;\n }\n }\n }\n }\n}\n/* eslint-enable valid-jsdoc */\n\nfunction createForwardHostPropEffect(hostProp, userForwardHostProp) {\n return function forwardHostProp(template, prop, props) {\n userForwardHostProp.call(template.__templatizeOwner,\n prop.substring('_host_'.length), props[prop]);\n };\n}\n\nfunction addNotifyEffects(klass, template, templateInfo, options) {\n let hostProps = templateInfo.hostProps || {};\n for (let iprop in options.instanceProps) {\n delete hostProps[iprop];\n let userNotifyInstanceProp = options.notifyInstanceProp;\n if (userNotifyInstanceProp) {\n klass.prototype._addPropertyEffect(iprop,\n klass.prototype.PROPERTY_EFFECT_TYPES.NOTIFY,\n {fn: createNotifyInstancePropEffect(iprop, userNotifyInstanceProp)});\n }\n }\n if (options.forwardHostProp && template.__dataHost) {\n for (let hprop in hostProps) {\n // As we're iterating hostProps in this function, note whether\n // there were any, for an optimization in addPropagateEffects\n if (!templateInfo.hasHostProps) {\n templateInfo.hasHostProps = true;\n }\n klass.prototype._addPropertyEffect(hprop,\n klass.prototype.PROPERTY_EFFECT_TYPES.NOTIFY,\n {fn: createNotifyHostPropEffect()});\n }\n }\n}\n\nfunction createNotifyInstancePropEffect(instProp, userNotifyInstanceProp) {\n return function notifyInstanceProp(inst, prop, props) {\n userNotifyInstanceProp.call(inst.__templatizeOwner,\n inst, prop, props[prop]);\n };\n}\n\nfunction createNotifyHostPropEffect() {\n return function notifyHostProp(inst, prop, props) {\n inst.__dataHost._setPendingPropertyOrPath('_host_' + prop, props[prop], true, true);\n };\n}\n\n\n/**\n * Returns an anonymous `PropertyEffects` class bound to the\n * `<template>` provided. Instancing the class will result in the\n * template being stamped into a document fragment stored as the instance's\n * `root` property, after which it can be appended to the DOM.\n *\n * Templates may utilize all Polymer data-binding features as well as\n * declarative event listeners. Event listeners and inline computing\n * functions in the template will be called on the host of the template.\n *\n * The constructor returned takes a single argument dictionary of initial\n * property values to propagate into template bindings. Additionally\n * host properties can be forwarded in, and instance properties can be\n * notified out by providing optional callbacks in the `options` dictionary.\n *\n * Valid configuration in `options` are as follows:\n *\n * - `forwardHostProp(property, value)`: Called when a property referenced\n * in the template changed on the template's host. As this library does\n * not retain references to templates instanced by the user, it is the\n * templatize owner's responsibility to forward host property changes into\n * user-stamped instances. The `instance.forwardHostProp(property, value)`\n * method on the generated class should be called to forward host\n * properties into the template to prevent unnecessary property-changed\n * notifications. Any properties referenced in the template that are not\n * defined in `instanceProps` will be notified up to the template's host\n * automatically.\n * - `instanceProps`: Dictionary of property names that will be added\n * to the instance by the templatize owner. These properties shadow any\n * host properties, and changes within the template to these properties\n * will result in `notifyInstanceProp` being called.\n * - `mutableData`: When `true`, the generated class will skip strict\n * dirty-checking for objects and arrays (always consider them to be\n * \"dirty\").\n * - `notifyInstanceProp(instance, property, value)`: Called when\n * an instance property changes. Users may choose to call `notifyPath`\n * on e.g. the owner to notify the change.\n * - `parentModel`: When `true`, events handled by declarative event listeners\n * (`on-event=\"handler\"`) will be decorated with a `model` property pointing\n * to the template instance that stamped it. It will also be returned\n * from `instance.parentModel` in cases where template instance nesting\n * causes an inner model to shadow an outer model.\n *\n * All callbacks are called bound to the `owner`. Any context\n * needed for the callbacks (such as references to `instances` stamped)\n * should be stored on the `owner` such that they can be retrieved via\n * `this`.\n *\n * When `options.forwardHostProp` is declared as an option, any properties\n * referenced in the template will be automatically forwarded from the host of\n * the `<template>` to instances, with the exception of any properties listed in\n * the `options.instanceProps` object. `instanceProps` are assumed to be\n * managed by the owner of the instances, either passed into the constructor\n * or set after the fact. Note, any properties passed into the constructor will\n * always be set to the instance (regardless of whether they would normally\n * be forwarded from the host).\n *\n * Note that `templatize()` can be run only once for a given `<template>`.\n * Further calls will result in an error. Also, there is a special\n * behavior if the template was duplicated through a mechanism such as\n * `<dom-repeat>` or `<test-fixture>`. In this case, all calls to\n * `templatize()` return the same class for all duplicates of a template.\n * The class returned from `templatize()` is generated only once using\n * the `options` from the first call. This means that any `options`\n * provided to subsequent calls will be ignored. Therefore, it is very\n * important not to close over any variables inside the callbacks. Also,\n * arrow functions must be avoided because they bind the outer `this`.\n * Inside the callbacks, any contextual information can be accessed\n * through `this`, which points to the `owner`.\n *\n * @param {!HTMLTemplateElement} template Template to templatize\n * @param {Polymer_PropertyEffects=} owner Owner of the template instances;\n * any optional callbacks will be bound to this owner.\n * @param {Object=} options Options dictionary (see summary for details)\n * @return {function(new:TemplateInstanceBase, Object=)} Generated class bound\n * to the template provided\n * @suppress {invalidCasts}\n */\nexport function templatize(template, owner, options) {\n // Under strictTemplatePolicy, the templatized element must be owned\n // by a (trusted) Polymer element, indicated by existence of _methodHost;\n // e.g. for dom-if & dom-repeat in main document, _methodHost is null\n if (strictTemplatePolicy && !findMethodHost(template)) {\n throw new Error('strictTemplatePolicy: template owner not trusted');\n }\n options = /** @type {!TemplatizeOptions} */(options || {});\n if (template.__templatizeOwner) {\n throw new Error('A <template> can only be templatized once');\n }\n template.__templatizeOwner = owner;\n const ctor = owner ? owner.constructor : TemplateInstanceBase;\n let templateInfo = ctor._parseTemplate(template);\n // Get memoized base class for the prototypical template, which\n // includes property effects for binding template & forwarding\n /**\n * @constructor\n * @extends {TemplateInstanceBase}\n */\n let baseClass = templateInfo.templatizeInstanceClass;\n if (!baseClass) {\n baseClass = createTemplatizerClass(template, templateInfo, options);\n templateInfo.templatizeInstanceClass = baseClass;\n }\n const methodHost = findMethodHost(template);\n // Host property forwarding must be installed onto template instance\n addPropagateEffects(template, templateInfo, options, methodHost);\n // Subclass base class and add reference for this specific template\n /** @private */\n let klass = class TemplateInstance extends baseClass {};\n /** @override */\n klass.prototype._methodHost = methodHost;\n /** @override */\n klass.prototype.__dataHost = /** @type {!DataTemplate} */ (template);\n /** @override */\n klass.prototype.__templatizeOwner = /** @type {!Object} */ (owner);\n /** @override */\n klass.prototype.__hostProps = templateInfo.hostProps;\n klass = /** @type {function(new:TemplateInstanceBase)} */(klass); //eslint-disable-line no-self-assign\n return klass;\n}\n\nfunction warnOnUndeclaredProperties(templateInfo, options, methodHost) {\n const declaredProps = methodHost.constructor._properties;\n const {propertyEffects} = templateInfo;\n const {instanceProps} = options;\n for (let prop in propertyEffects) {\n // Ensure properties with template effects are declared on the outermost\n // host (`methodHost`), unless they are instance props or static functions\n if (!declaredProps[prop] && !(instanceProps && instanceProps[prop])) {\n const effects = propertyEffects[prop];\n for (let i=0; i<effects.length; i++) {\n const {part} = effects[i].info;\n if (!(part.signature && part.signature.static)) {\n console.warn(`Property '${prop}' used in template but not ` +\n `declared in 'properties'; attribute will not be observed.`);\n break;\n }\n }\n }\n }\n}\n\n/**\n * Returns the template \"model\" associated with a given element, which\n * serves as the binding scope for the template instance the element is\n * contained in. A template model is an instance of\n * `TemplateInstanceBase`, and should be used to manipulate data\n * associated with this template instance.\n *\n * Example:\n *\n * let model = modelForElement(el);\n * if (model.index < 10) {\n * model.set('item.checked', true);\n * }\n *\n * @param {HTMLElement} template The model will be returned for\n * elements stamped from this template (accepts either an HTMLTemplateElement)\n * or a `<dom-if>`/`<dom-repeat>` element when using `removeNestedTemplates`\n * optimization.\n * @param {Node=} node Node for which to return a template model.\n * @return {TemplateInstanceBase} Template instance representing the\n * binding scope for the element\n */\nexport function modelForElement(template, node) {\n let model;\n while (node) {\n // An element with a __templatizeInstance marks the top boundary\n // of a scope; walk up until we find one, and then ensure that\n // its __dataHost matches `this`, meaning this dom-repeat stamped it\n if ((model = node.__dataHost ? node : node.__templatizeInstance)) {\n // Found an element stamped by another template; keep walking up\n // from its __dataHost\n if (model.__dataHost != template) {\n node = model.__dataHost;\n } else {\n return model;\n }\n } else {\n // Still in a template scope, keep going up until\n // a __templatizeInstance is found\n node = wrap(node).parentNode;\n }\n }\n return null;\n}\n\nexport { TemplateInstanceBase };\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n/**\n * @fileoverview\n *\n * Module to hide `<dom-bind>`, `<dom-if>`, and `<dom-repeat>` elements\n * optimally in ShadyDOM\n */\n\nimport {legacyOptimizations, useShadow} from './settings.js';\n\nlet elementsHidden = false;\n\n/**\n * @return {boolean} True if elements will be hidden globally\n */\nexport function hideElementsGlobally() {\n if (legacyOptimizations && !useShadow) {\n if (!elementsHidden) {\n elementsHidden = true;\n const style = document.createElement('style');\n style.textContent = 'dom-bind,dom-if,dom-repeat{display:none;}';\n document.head.appendChild(style);\n }\n return true;\n }\n return false;\n}","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\nimport '../utils/boot.js';\n\nimport { PropertyEffects } from '../mixins/property-effects.js';\nimport { OptionalMutableData } from '../mixins/mutable-data.js';\nimport { GestureEventListeners } from '../mixins/gesture-event-listeners.js';\nimport { strictTemplatePolicy } from '../utils/settings.js';\nimport { wrap } from '../utils/wrap.js';\nimport { hideElementsGlobally } from '../utils/hide-template-controls.js';\n\n/**\n * @constructor\n * @extends {HTMLElement}\n * @implements {Polymer_PropertyEffects}\n * @implements {Polymer_OptionalMutableData}\n * @implements {Polymer_GestureEventListeners}\n * @private\n */\nconst domBindBase =\n GestureEventListeners(\n OptionalMutableData(\n PropertyEffects(HTMLElement)));\n\n/**\n * Custom element to allow using Polymer's template features (data binding,\n * declarative event listeners, etc.) in the main document without defining\n * a new custom element.\n *\n * `<template>` tags utilizing bindings may be wrapped with the `<dom-bind>`\n * element, which will immediately stamp the wrapped template into the main\n * document and bind elements to the `dom-bind` element itself as the\n * binding scope.\n *\n * @polymer\n * @customElement\n * @appliesMixin PropertyEffects\n * @appliesMixin OptionalMutableData\n * @appliesMixin GestureEventListeners\n * @extends {domBindBase}\n * @summary Custom element to allow using Polymer's template features (data\n * binding, declarative event listeners, etc.) in the main document.\n */\nexport class DomBind extends domBindBase {\n\n static get observedAttributes() { return ['mutable-data']; }\n\n constructor() {\n super();\n if (strictTemplatePolicy) {\n throw new Error(`strictTemplatePolicy: dom-bind not allowed`);\n }\n this.root = null;\n this.$ = null;\n this.__children = null;\n }\n\n /* eslint-disable no-unused-vars */\n /**\n * @override\n * @param {string} name Name of attribute that changed\n * @param {?string} old Old attribute value\n * @param {?string} value New attribute value\n * @param {?string} namespace Attribute namespace.\n * @return {void}\n */\n attributeChangedCallback(name, old, value, namespace) {\n // assumes only one observed attribute\n this.mutableData = true;\n }\n\n /**\n * @override\n * @return {void}\n */\n connectedCallback() {\n if (!hideElementsGlobally()) {\n this.style.display = 'none';\n }\n this.render();\n }\n\n /**\n * @override\n * @return {void}\n */\n disconnectedCallback() {\n this.__removeChildren();\n }\n\n __insertChildren() {\n wrap(wrap(this).parentNode).insertBefore(this.root, this);\n }\n\n __removeChildren() {\n if (this.__children) {\n for (let i=0; i<this.__children.length; i++) {\n this.root.appendChild(this.__children[i]);\n }\n }\n }\n\n /**\n * Forces the element to render its content. This is typically only\n * necessary to call if HTMLImports with the async attribute are used.\n * @return {void}\n */\n render() {\n let template;\n if (!this.__children) {\n template = /** @type {?HTMLTemplateElement} */(template || this.querySelector('template'));\n if (!template) {\n // Wait until childList changes and template should be there by then\n let observer = new MutationObserver(() => {\n template = /** @type {HTMLTemplateElement} */(this.querySelector('template'));\n if (template) {\n observer.disconnect();\n this.render();\n } else {\n throw new Error('dom-bind requires a <template> child');\n }\n });\n observer.observe(this, {childList: true});\n return;\n }\n this.root = this._stampTemplate(\n /** @type {!HTMLTemplateElement} */(template));\n this.$ = this.root.$;\n this.__children = [];\n for (let n=this.root.firstChild; n; n=n.nextSibling) {\n this.__children[this.__children.length] = n;\n }\n this._enableProperties();\n }\n this.__insertChildren();\n this.dispatchEvent(new CustomEvent('dom-change', {\n bubbles: true,\n composed: true\n }));\n }\n\n}\n\ncustomElements.define('dom-bind', DomBind);\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\nimport { PolymerElement } from '../../polymer-element.js';\n\nimport { TemplateInstanceBase, templatize, modelForElement } from '../utils/templatize.js'; // eslint-disable-line no-unused-vars\nimport { Debouncer } from '../utils/debounce.js';\nimport { enqueueDebouncer, flush } from '../utils/flush.js';\nimport { OptionalMutableData } from '../mixins/mutable-data.js';\nimport { matches, translate } from '../utils/path.js';\nimport { timeOut, microTask } from '../utils/async.js';\nimport { wrap } from '../utils/wrap.js';\nimport { hideElementsGlobally } from '../utils/hide-template-controls.js';\nimport { suppressTemplateNotifications } from '../utils/settings.js';\n\n/**\n * @constructor\n * @implements {Polymer_OptionalMutableData}\n * @extends {PolymerElement}\n * @private\n */\nconst domRepeatBase = OptionalMutableData(PolymerElement);\n\n/**\n * The `<dom-repeat>` element will automatically stamp and binds one instance\n * of template content to each object in a user-provided array.\n * `dom-repeat` accepts an `items` property, and one instance of the template\n * is stamped for each item into the DOM at the location of the `dom-repeat`\n * element. The `item` property will be set on each instance's binding\n * scope, thus templates should bind to sub-properties of `item`.\n *\n * Example:\n *\n * ```html\n * <dom-module id=\"employee-list\">\n *\n * <template>\n *\n * <div> Employee list: </div>\n * <dom-repeat items=\"{{employees}}\">\n * <template>\n * <div>First name: <span>{{item.first}}</span></div>\n * <div>Last name: <span>{{item.last}}</span></div>\n * </template>\n * </dom-repeat>\n *\n * </template>\n *\n * </dom-module>\n * ```\n *\n * With the following custom element definition:\n *\n * ```js\n * class EmployeeList extends PolymerElement {\n * static get is() { return 'employee-list'; }\n * static get properties() {\n * return {\n * employees: {\n * value() {\n * return [\n * {first: 'Bob', last: 'Smith'},\n * {first: 'Sally', last: 'Johnson'},\n * ...\n * ];\n * }\n * }\n * };\n * }\n * }\n * ```\n *\n * Notifications for changes to items sub-properties will be forwarded to template\n * instances, which will update via the normal structured data notification system.\n *\n * Mutations to the `items` array itself should be made using the Array\n * mutation API's on the PropertyEffects mixin (`push`, `pop`, `splice`,\n * `shift`, `unshift`), and template instances will be kept in sync with the\n * data in the array.\n *\n * Events caught by event handlers within the `dom-repeat` template will be\n * decorated with a `model` property, which represents the binding scope for\n * each template instance. The model should be used to manipulate data on the\n * instance, for example `event.model.set('item.checked', true);`.\n *\n * Alternatively, the model for a template instance for an element stamped by\n * a `dom-repeat` can be obtained using the `modelForElement` API on the\n * `dom-repeat` that stamped it, for example\n * `this.$.domRepeat.modelForElement(event.target).set('item.checked', true);`.\n * This may be useful for manipulating instance data of event targets obtained\n * by event handlers on parents of the `dom-repeat` (event delegation).\n *\n * A view-specific filter/sort may be applied to each `dom-repeat` by supplying a\n * `filter` and/or `sort` property. This may be a string that names a function on\n * the host, or a function may be assigned to the property directly. The functions\n * should implemented following the standard `Array` filter/sort API.\n *\n * In order to re-run the filter or sort functions based on changes to sub-fields\n * of `items`, the `observe` property may be set as a space-separated list of\n * `item` sub-fields that should cause a re-filter/sort when modified. If\n * the filter or sort function depends on properties not contained in `items`,\n * the user should observe changes to those properties and call `render` to update\n * the view based on the dependency change.\n *\n * For example, for an `dom-repeat` with a filter of the following:\n *\n * ```js\n * isEngineer(item) {\n * return item.type == 'engineer' || item.manager.type == 'engineer';\n * }\n * ```\n *\n * Then the `observe` property should be configured as follows:\n *\n * ```html\n * <dom-repeat items=\"{{employees}}\" filter=\"isEngineer\" observe=\"type manager.type\">\n * ```\n *\n * @customElement\n * @polymer\n * @extends {domRepeatBase}\n * @appliesMixin OptionalMutableData\n * @summary Custom element for stamping instance of a template bound to\n * items in an array.\n */\nexport class DomRepeat extends domRepeatBase {\n\n // Not needed to find template; can be removed once the analyzer\n // can find the tag name from customElements.define call\n static get is() { return 'dom-repeat'; }\n\n static get template() { return null; }\n\n static get properties() {\n\n /**\n * Fired whenever DOM is added or removed by this template (by\n * default, rendering occurs lazily). To force immediate rendering, call\n * `render`.\n *\n * @event dom-change\n */\n return {\n\n /**\n * An array containing items determining how many instances of the template\n * to stamp and that that each template instance should bind to.\n */\n items: {\n type: Array\n },\n\n /**\n * The name of the variable to add to the binding scope for the array\n * element associated with a given template instance.\n */\n as: {\n type: String,\n value: 'item'\n },\n\n /**\n * The name of the variable to add to the binding scope with the index\n * of the instance in the sorted and filtered list of rendered items.\n * Note, for the index in the `this.items` array, use the value of the\n * `itemsIndexAs` property.\n */\n indexAs: {\n type: String,\n value: 'index'\n },\n\n /**\n * The name of the variable to add to the binding scope with the index\n * of the instance in the `this.items` array. Note, for the index of\n * this instance in the sorted and filtered list of rendered items,\n * use the value of the `indexAs` property.\n */\n itemsIndexAs: {\n type: String,\n value: 'itemsIndex'\n },\n\n /**\n * A function that should determine the sort order of the items. This\n * property should either be provided as a string, indicating a method\n * name on the element's host, or else be an actual function. The\n * function should match the sort function passed to `Array.sort`.\n * Using a sort function has no effect on the underlying `items` array.\n */\n sort: {\n type: Function,\n observer: '__sortChanged'\n },\n\n /**\n * A function that can be used to filter items out of the view. This\n * property should either be provided as a string, indicating a method\n * name on the element's host, or else be an actual function. The\n * function should match the sort function passed to `Array.filter`.\n * Using a filter function has no effect on the underlying `items` array.\n */\n filter: {\n type: Function,\n observer: '__filterChanged'\n },\n\n /**\n * When using a `filter` or `sort` function, the `observe` property\n * should be set to a space-separated list of the names of item\n * sub-fields that should trigger a re-sort or re-filter when changed.\n * These should generally be fields of `item` that the sort or filter\n * function depends on.\n */\n observe: {\n type: String,\n observer: '__observeChanged'\n },\n\n /**\n * When using a `filter` or `sort` function, the `delay` property\n * determines a debounce time in ms after a change to observed item\n * properties that must pass before the filter or sort is re-run.\n * This is useful in rate-limiting shuffling of the view when\n * item changes may be frequent.\n */\n delay: Number,\n\n /**\n * Count of currently rendered items after `filter` (if any) has been applied.\n * If \"chunking mode\" is enabled, `renderedItemCount` is updated each time a\n * set of template instances is rendered.\n *\n */\n renderedItemCount: {\n type: Number,\n notify: !suppressTemplateNotifications,\n readOnly: true\n },\n\n /**\n * When greater than zero, defines an initial count of template instances\n * to render after setting the `items` array, before the next paint, and\n * puts the `dom-repeat` into \"chunking mode\". The remaining items (and\n * any future items as a result of pushing onto the array) will be created\n * and rendered incrementally at each animation frame thereof until all\n * instances have been rendered.\n */\n initialCount: {\n type: Number\n },\n\n /**\n * When `initialCount` is used, this property defines a frame rate (in\n * fps) to target by throttling the number of instances rendered each\n * frame to not exceed the budget for the target frame rate. The\n * framerate is effectively the number of `requestAnimationFrame`s that\n * it tries to allow to actually fire in a given second. It does this\n * by measuring the time between `rAF`s and continuously adjusting the\n * number of items created each `rAF` to maintain the target framerate.\n * Setting this to a higher number allows lower latency and higher\n * throughput for event handlers and other tasks, but results in a\n * longer time for the remaining items to complete rendering.\n */\n targetFramerate: {\n type: Number,\n value: 20\n },\n\n _targetFrameTime: {\n type: Number,\n computed: '__computeFrameTime(targetFramerate)'\n },\n\n /**\n * When the global `suppressTemplateNotifications` setting is used, setting\n * `notifyDomChange: true` will enable firing `dom-change` events on this\n * element.\n */\n notifyDomChange: {\n type: Boolean\n },\n\n /**\n * When chunking is enabled via `initialCount` and the `items` array is\n * set to a new array, this flag controls whether the previously rendered\n * instances are reused or not.\n *\n * When `true`, any previously rendered template instances are updated in\n * place to their new item values synchronously in one shot, and then any\n * further items (if any) are chunked out. When `false`, the list is\n * returned back to its `initialCount` (any instances over the initial\n * count are discarded) and the remainder of the list is chunked back in.\n * Set this to `true` to avoid re-creating the list and losing scroll\n * position, although note that when changing the list to completely\n * different data the render thread will be blocked until all existing\n * instances are updated to their new data.\n */\n reuseChunkedInstances: {\n type: Boolean\n }\n\n };\n\n }\n\n static get observers() {\n return [ '__itemsChanged(items.*)' ];\n }\n\n constructor() {\n super();\n this.__instances = [];\n this.__renderDebouncer = null;\n this.__itemsIdxToInstIdx = {};\n this.__chunkCount = null;\n this.__renderStartTime = null;\n this.__itemsArrayChanged = false;\n this.__shouldMeasureChunk = false;\n this.__shouldContinueChunking = false;\n this.__chunkingId = 0;\n this.__sortFn = null;\n this.__filterFn = null;\n this.__observePaths = null;\n /** @type {?function(new:TemplateInstanceBase, Object=)} */\n this.__ctor = null;\n this.__isDetached = true;\n this.template = null;\n /** @type {TemplateInfo} */\n this._templateInfo;\n }\n\n /**\n * @override\n * @return {void}\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.__isDetached = true;\n for (let i=0; i<this.__instances.length; i++) {\n this.__detachInstance(i);\n }\n // Stop chunking if one was in progress\n if (this.__chunkingId) {\n cancelAnimationFrame(this.__chunkingId);\n }\n }\n\n /**\n * @override\n * @return {void}\n */\n connectedCallback() {\n super.connectedCallback();\n if (!hideElementsGlobally()) {\n this.style.display = 'none';\n }\n // only perform attachment if the element was previously detached.\n if (this.__isDetached) {\n this.__isDetached = false;\n let wrappedParent = wrap(wrap(this).parentNode);\n for (let i=0; i<this.__instances.length; i++) {\n this.__attachInstance(i, wrappedParent);\n }\n // Restart chunking if one was in progress when disconnected\n if (this.__chunkingId) {\n this.__render();\n }\n }\n }\n\n __ensureTemplatized() {\n // Templatizing (generating the instance constructor) needs to wait\n // until ready, since won't have its template content handed back to\n // it until then\n if (!this.__ctor) {\n // When `removeNestedTemplates` is true, the \"template\" is the element\n // itself, which has been given a `_templateInfo` property\n const thisAsTemplate = /** @type {!HTMLTemplateElement} */ (\n /** @type {!HTMLElement} */ (this));\n let template = this.template = thisAsTemplate._templateInfo ?\n thisAsTemplate :\n /** @type {!HTMLTemplateElement} */ (this.querySelector('template'));\n if (!template) {\n // Wait until childList changes and template should be there by then\n let observer = new MutationObserver(() => {\n if (this.querySelector('template')) {\n observer.disconnect();\n this.__render();\n } else {\n throw new Error('dom-repeat requires a <template> child');\n }\n });\n observer.observe(this, {childList: true});\n return false;\n }\n // Template instance props that should be excluded from forwarding\n let instanceProps = {};\n instanceProps[this.as] = true;\n instanceProps[this.indexAs] = true;\n instanceProps[this.itemsIndexAs] = true;\n this.__ctor = templatize(template, this, {\n mutableData: this.mutableData,\n parentModel: true,\n instanceProps: instanceProps,\n /**\n * @this {DomRepeat}\n * @param {string} prop Property to set\n * @param {*} value Value to set property to\n */\n forwardHostProp: function(prop, value) {\n let i$ = this.__instances;\n for (let i=0, inst; (i<i$.length) && (inst=i$[i]); i++) {\n inst.forwardHostProp(prop, value);\n }\n },\n /**\n * @this {DomRepeat}\n * @param {Object} inst Instance to notify\n * @param {string} prop Property to notify\n * @param {*} value Value to notify\n */\n notifyInstanceProp: function(inst, prop, value) {\n if (matches(this.as, prop)) {\n let idx = inst[this.itemsIndexAs];\n if (prop == this.as) {\n this.items[idx] = value;\n }\n let path = translate(this.as, `${JSCompiler_renameProperty('items', this)}.${idx}`, prop);\n this.notifyPath(path, value);\n }\n }\n });\n }\n return true;\n }\n\n __getMethodHost() {\n // Technically this should be the owner of the outermost template.\n // In shadow dom, this is always getRootNode().host, but we can\n // approximate this via cooperation with our dataHost always setting\n // `_methodHost` as long as there were bindings (or id's) on this\n // instance causing it to get a dataHost.\n return this.__dataHost._methodHost || this.__dataHost;\n }\n\n __functionFromPropertyValue(functionOrMethodName) {\n if (typeof functionOrMethodName === 'string') {\n let methodName = functionOrMethodName;\n let obj = this.__getMethodHost();\n return function() { return obj[methodName].apply(obj, arguments); };\n }\n\n return functionOrMethodName;\n }\n\n __sortChanged(sort) {\n this.__sortFn = this.__functionFromPropertyValue(sort);\n if (this.items) { this.__debounceRender(this.__render); }\n }\n\n __filterChanged(filter) {\n this.__filterFn = this.__functionFromPropertyValue(filter);\n if (this.items) { this.__debounceRender(this.__render); }\n }\n\n __computeFrameTime(rate) {\n return Math.ceil(1000/rate);\n }\n\n __observeChanged() {\n this.__observePaths = this.observe &&\n this.observe.replace('.*', '.').split(' ');\n }\n\n __handleObservedPaths(path) {\n // Handle cases where path changes should cause a re-sort/filter\n if (this.__sortFn || this.__filterFn) {\n if (!path) {\n // Always re-render if the item itself changed\n this.__debounceRender(this.__render, this.delay);\n } else if (this.__observePaths) {\n // Otherwise, re-render if the path changed matches an observed path\n let paths = this.__observePaths;\n for (let i=0; i<paths.length; i++) {\n if (path.indexOf(paths[i]) === 0) {\n this.__debounceRender(this.__render, this.delay);\n }\n }\n }\n }\n }\n\n __itemsChanged(change) {\n if (this.items && !Array.isArray(this.items)) {\n console.warn('dom-repeat expected array for `items`, found', this.items);\n }\n // If path was to an item (e.g. 'items.3' or 'items.3.foo'), forward the\n // path to that instance synchronously (returns false for non-item paths)\n if (!this.__handleItemPath(change.path, change.value)) {\n // Otherwise, the array was reset ('items') or spliced ('items.splices'),\n // so queue a render. Restart chunking when the items changed (for\n // backward compatibility), unless `reuseChunkedInstances` option is set\n if (change.path === 'items') {\n this.__itemsArrayChanged = true;\n }\n this.__debounceRender(this.__render);\n }\n }\n\n /**\n * @param {function(this:DomRepeat)} fn Function to debounce.\n * @param {number=} delay Delay in ms to debounce by.\n */\n __debounceRender(fn, delay = 0) {\n this.__renderDebouncer = Debouncer.debounce(\n this.__renderDebouncer\n , delay > 0 ? timeOut.after(delay) : microTask\n , fn.bind(this));\n enqueueDebouncer(this.__renderDebouncer);\n }\n\n /**\n * Forces the element to render its content. Normally rendering is\n * asynchronous to a provoking change. This is done for efficiency so\n * that multiple changes trigger only a single render. The render method\n * should be called if, for example, template rendering is required to\n * validate application state.\n * @return {void}\n */\n render() {\n // Queue this repeater, then flush all in order\n this.__debounceRender(this.__render);\n flush();\n }\n\n __render() {\n if (!this.__ensureTemplatized()) {\n // No template found yet\n return;\n }\n let items = this.items || [];\n // Sort and filter the items into a mapping array from instance->item\n const isntIdxToItemsIdx = this.__sortAndFilterItems(items);\n // If we're chunking, increase the limit if there are new instances to\n // create and schedule the next chunk\n const limit = this.__calculateLimit(isntIdxToItemsIdx.length);\n // Create, update, and/or remove instances\n this.__updateInstances(items, limit, isntIdxToItemsIdx);\n // If we're chunking, schedule a rAF task to measure/continue chunking. \n // Do this before any notifying events (renderedItemCount & dom-change)\n // since those could modify items and enqueue a new full render which will\n // pre-empt this measurement.\n if (this.initialCount &&\n (this.__shouldMeasureChunk || this.__shouldContinueChunking)) {\n cancelAnimationFrame(this.__chunkingId);\n this.__chunkingId = requestAnimationFrame(() => {\n this.__chunkingId = null;\n this.__continueChunking();\n });\n }\n // Set rendered item count\n this._setRenderedItemCount(this.__instances.length);\n // Notify users\n if (!suppressTemplateNotifications || this.notifyDomChange) {\n this.dispatchEvent(new CustomEvent('dom-change', {\n bubbles: true,\n composed: true\n }));\n }\n }\n\n __sortAndFilterItems(items) {\n // Generate array maping the instance index to the items array index\n let isntIdxToItemsIdx = new Array(items.length);\n for (let i=0; i<items.length; i++) {\n isntIdxToItemsIdx[i] = i;\n }\n // Apply user filter\n if (this.__filterFn) {\n isntIdxToItemsIdx = isntIdxToItemsIdx.filter((i, idx, array) =>\n this.__filterFn(items[i], idx, array));\n }\n // Apply user sort\n if (this.__sortFn) {\n isntIdxToItemsIdx.sort((a, b) => this.__sortFn(items[a], items[b]));\n }\n return isntIdxToItemsIdx;\n }\n\n __calculateLimit(filteredItemCount) {\n let limit = filteredItemCount;\n const currentCount = this.__instances.length;\n // When chunking, we increase the limit from the currently rendered count\n // by the chunk count that is re-calculated after each rAF (with special\n // cases for resetting the limit to initialCount after changing items)\n if (this.initialCount) {\n let newCount;\n if (!this.__chunkCount ||\n (this.__itemsArrayChanged && !this.reuseChunkedInstances)) {\n // Limit next render to the initial count\n limit = Math.min(filteredItemCount, this.initialCount);\n // Subtract off any existing instances to determine the number of\n // instances that will be created\n newCount = Math.max(limit - currentCount, 0);\n // Initialize the chunk size with how many items we're creating\n this.__chunkCount = newCount || 1;\n } else {\n // The number of new instances that will be created is based on the\n // existing instances, the new list size, and the chunk size\n newCount = Math.min(\n Math.max(filteredItemCount - currentCount, 0), \n this.__chunkCount);\n // Update the limit based on how many new items we're making, limited\n // buy the total size of the list\n limit = Math.min(currentCount + newCount, filteredItemCount);\n }\n // Record some state about chunking for use in `__continueChunking`\n this.__shouldMeasureChunk = newCount === this.__chunkCount;\n this.__shouldContinueChunking = limit < filteredItemCount;\n this.__renderStartTime = performance.now();\n }\n this.__itemsArrayChanged = false;\n return limit;\n }\n\n __continueChunking() {\n // Simple auto chunkSize throttling algorithm based on feedback loop:\n // measure actual time between frames and scale chunk count by ratio of\n // target/actual frame time. Only modify chunk size if our measurement\n // reflects the cost of a creating a full chunk's worth of instances; this\n // avoids scaling up the chunk size if we e.g. quickly re-rendered instances\n // in place\n if (this.__shouldMeasureChunk) {\n const renderTime = performance.now() - this.__renderStartTime;\n const ratio = this._targetFrameTime / renderTime;\n this.__chunkCount = Math.round(this.__chunkCount * ratio) || 1;\n }\n // Enqueue a new render if we haven't reached the full size of the list\n if (this.__shouldContinueChunking) {\n this.__debounceRender(this.__render);\n }\n }\n \n __updateInstances(items, limit, isntIdxToItemsIdx) {\n // items->inst map kept for item path forwarding\n const itemsIdxToInstIdx = this.__itemsIdxToInstIdx = {};\n let instIdx;\n // Generate instances and assign items\n for (instIdx=0; instIdx<limit; instIdx++) {\n let inst = this.__instances[instIdx];\n let itemIdx = isntIdxToItemsIdx[instIdx];\n let item = items[itemIdx];\n itemsIdxToInstIdx[itemIdx] = instIdx;\n if (inst) {\n inst._setPendingProperty(this.as, item);\n inst._setPendingProperty(this.indexAs, instIdx);\n inst._setPendingProperty(this.itemsIndexAs, itemIdx);\n inst._flushProperties();\n } else {\n this.__insertInstance(item, instIdx, itemIdx);\n }\n }\n // Remove any extra instances from previous state\n for (let i=this.__instances.length-1; i>=instIdx; i--) {\n this.__detachAndRemoveInstance(i);\n }\n }\n\n __detachInstance(idx) {\n let inst = this.__instances[idx];\n const wrappedRoot = wrap(inst.root);\n for (let i=0; i<inst.children.length; i++) {\n let el = inst.children[i];\n wrappedRoot.appendChild(el);\n }\n return inst;\n }\n\n __attachInstance(idx, parent) {\n let inst = this.__instances[idx];\n // Note, this is pre-wrapped as an optimization\n parent.insertBefore(inst.root, this);\n }\n\n __detachAndRemoveInstance(idx) {\n this.__detachInstance(idx);\n this.__instances.splice(idx, 1);\n }\n\n __stampInstance(item, instIdx, itemIdx) {\n let model = {};\n model[this.as] = item;\n model[this.indexAs] = instIdx;\n model[this.itemsIndexAs] = itemIdx;\n return new this.__ctor(model);\n }\n\n __insertInstance(item, instIdx, itemIdx) {\n const inst = this.__stampInstance(item, instIdx, itemIdx);\n let beforeRow = this.__instances[instIdx + 1];\n let beforeNode = beforeRow ? beforeRow.children[0] : this;\n wrap(wrap(this).parentNode).insertBefore(inst.root, beforeNode);\n this.__instances[instIdx] = inst;\n return inst;\n }\n\n // Implements extension point from Templatize mixin\n /**\n * Shows or hides the template instance top level child elements. For\n * text nodes, `textContent` is removed while \"hidden\" and replaced when\n * \"shown.\"\n * @param {boolean} hidden Set to true to hide the children;\n * set to false to show them.\n * @return {void}\n * @protected\n */\n _showHideChildren(hidden) {\n for (let i=0; i<this.__instances.length; i++) {\n this.__instances[i]._showHideChildren(hidden);\n }\n }\n\n // Called as a side effect of a host items.<key>.<path> path change,\n // responsible for notifying item.<path> changes to inst for key\n __handleItemPath(path, value) {\n let itemsPath = path.slice(6); // 'items.'.length == 6\n let dot = itemsPath.indexOf('.');\n let itemsIdx = dot < 0 ? itemsPath : itemsPath.substring(0, dot);\n // If path was index into array...\n if (itemsIdx == parseInt(itemsIdx, 10)) {\n let itemSubPath = dot < 0 ? '' : itemsPath.substring(dot+1);\n // If the path is observed, it will trigger a full refresh\n this.__handleObservedPaths(itemSubPath);\n // Note, even if a rull refresh is triggered, always do the path\n // notification because unless mutableData is used for dom-repeat\n // and all elements in the instance subtree, a full refresh may\n // not trigger the proper update.\n let instIdx = this.__itemsIdxToInstIdx[itemsIdx];\n let inst = this.__instances[instIdx];\n if (inst) {\n let itemPath = this.as + (itemSubPath ? '.' + itemSubPath : '');\n // This is effectively `notifyPath`, but avoids some of the overhead\n // of the public API\n inst._setPendingPropertyOrPath(itemPath, value, false, true);\n inst._flushProperties();\n }\n return true;\n }\n }\n\n /**\n * Returns the item associated with a given element stamped by\n * this `dom-repeat`.\n *\n * Note, to modify sub-properties of the item,\n * `modelForElement(el).set('item.<sub-prop>', value)`\n * should be used.\n *\n * @param {!HTMLElement} el Element for which to return the item.\n * @return {*} Item associated with the element.\n */\n itemForElement(el) {\n let instance = this.modelForElement(el);\n return instance && instance[this.as];\n }\n\n /**\n * Returns the inst index for a given element stamped by this `dom-repeat`.\n * If `sort` is provided, the index will reflect the sorted order (rather\n * than the original array order).\n *\n * @param {!HTMLElement} el Element for which to return the index.\n * @return {?number} Row index associated with the element (note this may\n * not correspond to the array index if a user `sort` is applied).\n */\n indexForElement(el) {\n let instance = this.modelForElement(el);\n return instance && instance[this.indexAs];\n }\n\n /**\n * Returns the template \"model\" associated with a given element, which\n * serves as the binding scope for the template instance the element is\n * contained in. A template model\n * should be used to manipulate data associated with this template instance.\n *\n * Example:\n *\n * let model = modelForElement(el);\n * if (model.index < 10) {\n * model.set('item.checked', true);\n * }\n *\n * @param {!HTMLElement} el Element for which to return a template model.\n * @return {TemplateInstanceBase} Model representing the binding scope for\n * the element.\n */\n modelForElement(el) {\n return modelForElement(this.template, el);\n }\n\n}\n\ncustomElements.define(DomRepeat.is, DomRepeat);\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\nimport { PolymerElement } from '../../polymer-element.js';\n\nimport { Debouncer } from '../utils/debounce.js';\nimport { enqueueDebouncer, flush } from '../utils/flush.js';\nimport { microTask } from '../utils/async.js';\nimport { root } from '../utils/path.js';\nimport { wrap } from '../utils/wrap.js';\nimport { hideElementsGlobally } from '../utils/hide-template-controls.js';\nimport { fastDomIf, strictTemplatePolicy, suppressTemplateNotifications } from '../utils/settings.js';\nimport { showHideChildren, templatize } from '../utils/templatize.js';\n\n/**\n * @customElement\n * @polymer\n * @extends PolymerElement\n * @summary Base class for dom-if element; subclassed into concrete\n * implementation.\n */\nclass DomIfBase extends PolymerElement {\n\n // Not needed to find template; can be removed once the analyzer\n // can find the tag name from customElements.define call\n static get is() { return 'dom-if'; }\n\n static get template() { return null; }\n\n static get properties() {\n\n return {\n\n /**\n * Fired whenever DOM is added or removed/hidden by this template (by\n * default, rendering occurs lazily). To force immediate rendering, call\n * `render`.\n *\n * @event dom-change\n */\n\n /**\n * A boolean indicating whether this template should stamp.\n */\n if: {\n type: Boolean,\n observer: '__debounceRender'\n },\n\n /**\n * When true, elements will be removed from DOM and discarded when `if`\n * becomes false and re-created and added back to the DOM when `if`\n * becomes true. By default, stamped elements will be hidden but left\n * in the DOM when `if` becomes false, which is generally results\n * in better performance.\n */\n restamp: {\n type: Boolean,\n observer: '__debounceRender'\n },\n\n /**\n * When the global `suppressTemplateNotifications` setting is used, setting\n * `notifyDomChange: true` will enable firing `dom-change` events on this\n * element.\n */\n notifyDomChange: {\n type: Boolean\n }\n };\n\n }\n\n constructor() {\n super();\n this.__renderDebouncer = null;\n this._lastIf = false;\n this.__hideTemplateChildren__ = false;\n /** @type {!HTMLTemplateElement|undefined} */\n this.__template;\n /** @type {!TemplateInfo|undefined} */\n this._templateInfo;\n }\n\n __debounceRender() {\n // Render is async for 2 reasons:\n // 1. To eliminate dom creation trashing if user code thrashes `if` in the\n // same turn. This was more common in 1.x where a compound computed\n // property could result in the result changing multiple times, but is\n // mitigated to a large extent by batched property processing in 2.x.\n // 2. To avoid double object propagation when a bag including values bound\n // to the `if` property as well as one or more hostProps could enqueue\n // the <dom-if> to flush before the <template>'s host property\n // forwarding. In that scenario creating an instance would result in\n // the host props being set once, and then the enqueued changes on the\n // template would set properties a second time, potentially causing an\n // object to be set to an instance more than once. Creating the\n // instance async from flushing data ensures this doesn't happen. If\n // we wanted a sync option in the future, simply having <dom-if> flush\n // (or clear) its template's pending host properties before creating\n // the instance would also avoid the problem.\n this.__renderDebouncer = Debouncer.debounce(\n this.__renderDebouncer\n , microTask\n , () => this.__render());\n enqueueDebouncer(this.__renderDebouncer);\n }\n\n /**\n * @override\n * @return {void}\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n const parent = wrap(this).parentNode;\n if (!parent || (parent.nodeType == Node.DOCUMENT_FRAGMENT_NODE &&\n !wrap(parent).host)) {\n this.__teardownInstance();\n }\n }\n\n /**\n * @override\n * @return {void}\n */\n connectedCallback() {\n super.connectedCallback();\n if (!hideElementsGlobally()) {\n this.style.display = 'none';\n }\n if (this.if) {\n this.__debounceRender();\n }\n }\n\n /**\n * Ensures a template has been assigned to `this.__template`. If it has not\n * yet been, it querySelectors for it in its children and if it does not yet\n * exist (e.g. in parser-generated case), opens a mutation observer and\n * waits for it to appear (returns false if it has not yet been found,\n * otherwise true). In the `removeNestedTemplates` case, the \"template\" will\n * be the `dom-if` element itself.\n *\n * @return {boolean} True when a template has been found, false otherwise\n */\n __ensureTemplate() {\n if (!this.__template) {\n // When `removeNestedTemplates` is true, the \"template\" is the element\n // itself, which has been given a `_templateInfo` property\n const thisAsTemplate = /** @type {!HTMLTemplateElement} */ (\n /** @type {!HTMLElement} */ (this));\n let template = thisAsTemplate._templateInfo ?\n thisAsTemplate :\n /** @type {!HTMLTemplateElement} */\n (wrap(thisAsTemplate).querySelector('template'));\n if (!template) {\n // Wait until childList changes and template should be there by then\n let observer = new MutationObserver(() => {\n if (wrap(this).querySelector('template')) {\n observer.disconnect();\n this.__render();\n } else {\n throw new Error('dom-if requires a <template> child');\n }\n });\n observer.observe(this, {childList: true});\n return false;\n }\n this.__template = template;\n }\n return true;\n }\n\n /**\n * Ensures a an instance of the template has been created and inserted. This\n * method may return false if the template has not yet been found or if\n * there is no `parentNode` to insert the template into (in either case,\n * connection or the template-finding mutation observer firing will queue\n * another render, causing this method to be called again at a more\n * appropriate time).\n *\n * Subclasses should implement the following methods called here:\n * - `__hasInstance`\n * - `__createAndInsertInstance`\n * - `__getInstanceNodes`\n *\n * @return {boolean} True if the instance was created, false otherwise.\n */\n __ensureInstance() {\n let parentNode = wrap(this).parentNode;\n if (!this.__hasInstance()) {\n // Guard against element being detached while render was queued\n if (!parentNode) {\n return false;\n }\n // Find the template (when false, there was no template yet)\n if (!this.__ensureTemplate()) {\n return false;\n }\n this.__createAndInsertInstance(parentNode);\n } else {\n // Move instance children if necessary\n let children = this.__getInstanceNodes();\n if (children && children.length) {\n // Detect case where dom-if was re-attached in new position\n let lastChild = wrap(this).previousSibling;\n if (lastChild !== children[children.length-1]) {\n for (let i=0, n; (i<children.length) && (n=children[i]); i++) {\n wrap(parentNode).insertBefore(n, this);\n }\n }\n }\n }\n return true;\n }\n\n /**\n * Forces the element to render its content. Normally rendering is\n * asynchronous to a provoking change. This is done for efficiency so\n * that multiple changes trigger only a single render. The render method\n * should be called if, for example, template rendering is required to\n * validate application state.\n *\n * @return {void}\n */\n render() {\n flush();\n }\n\n /**\n * Performs the key rendering steps:\n * 1. Ensure a template instance has been stamped (when true)\n * 2. Remove the template instance (when false and restamp:true)\n * 3. Sync the hidden state of the instance nodes with the if/restamp state\n * 4. Fires the `dom-change` event when necessary\n *\n * @return {void}\n */\n __render() {\n if (this.if) {\n if (!this.__ensureInstance()) {\n // No template found yet\n return;\n }\n } else if (this.restamp) {\n this.__teardownInstance();\n }\n this._showHideChildren();\n if ((!suppressTemplateNotifications || this.notifyDomChange)\n && this.if != this._lastIf) {\n this.dispatchEvent(new CustomEvent('dom-change', {\n bubbles: true,\n composed: true\n }));\n this._lastIf = this.if;\n }\n }\n\n // Ideally these would be annotated as abstract methods in an abstract class,\n // but closure compiler is finnicky\n /* eslint-disable valid-jsdoc */\n /**\n * Abstract API to be implemented by subclass: Returns true if a template\n * instance has been created and inserted.\n *\n * @protected\n * @return {boolean} True when an instance has been created.\n */\n __hasInstance() { }\n\n /**\n * Abstract API to be implemented by subclass: Returns the child nodes stamped\n * from a template instance.\n *\n * @protected\n * @return {Array<Node>} Array of child nodes stamped from the template\n * instance.\n */\n __getInstanceNodes() { }\n\n /**\n * Abstract API to be implemented by subclass: Creates an instance of the\n * template and inserts it into the given parent node.\n *\n * @protected\n * @param {Node} parentNode The parent node to insert the instance into\n * @return {void}\n */\n __createAndInsertInstance(parentNode) { } // eslint-disable-line no-unused-vars\n\n /**\n * Abstract API to be implemented by subclass: Removes nodes created by an\n * instance of a template and any associated cleanup.\n *\n * @protected\n * @return {void}\n */\n __teardownInstance() { }\n\n /**\n * Abstract API to be implemented by subclass: Shows or hides any template\n * instance childNodes based on the `if` state of the element and its\n * `__hideTemplateChildren__` property.\n *\n * @protected\n * @return {void}\n */\n _showHideChildren() { }\n /* eslint-enable valid-jsdoc */\n}\n\n/**\n * The version of DomIf used when `fastDomIf` setting is in use, which is\n * optimized for first-render (but adds a tax to all subsequent property updates\n * on the host, whether they were used in a given `dom-if` or not).\n *\n * This implementation avoids use of `Templatizer`, which introduces a new scope\n * (a non-element PropertyEffects instance), which is not strictly necessary\n * since `dom-if` never introduces new properties to its scope (unlike\n * `dom-repeat`). Taking advantage of this fact, the `dom-if` reaches up to its\n * `__dataHost` and stamps the template directly from the host using the host's\n * runtime `_stampTemplate` API, which binds the property effects of the\n * template directly to the host. This both avoids the intermediary\n * `Templatizer` instance, but also avoids the need to bind host properties to\n * the `<template>` element and forward those into the template instance.\n *\n * In this version of `dom-if`, the `this.__instance` method is the\n * `DocumentFragment` returned from `_stampTemplate`, which also serves as the\n * handle for later removing it using the `_removeBoundDom` method.\n */\nclass DomIfFast extends DomIfBase {\n\n constructor() {\n super();\n this.__instance = null;\n this.__syncInfo = null;\n }\n\n /**\n * Implementation of abstract API needed by DomIfBase.\n *\n * @override\n * @return {boolean} True when an instance has been created.\n */\n __hasInstance() {\n return Boolean(this.__instance);\n }\n\n /**\n * Implementation of abstract API needed by DomIfBase.\n *\n * @override\n * @return {Array<Node>} Array of child nodes stamped from the template\n * instance.\n */\n __getInstanceNodes() {\n return this.__instance.templateInfo.childNodes;\n }\n\n /**\n * Implementation of abstract API needed by DomIfBase.\n *\n * Stamps the template by calling `_stampTemplate` on the `__dataHost` of this\n * element and then inserts the resulting nodes into the given `parentNode`.\n *\n * @override\n * @param {Node} parentNode The parent node to insert the instance into\n * @return {void}\n */\n __createAndInsertInstance(parentNode) {\n const host = this.__dataHost || this;\n if (strictTemplatePolicy) {\n if (!this.__dataHost) {\n throw new Error('strictTemplatePolicy: template owner not trusted');\n }\n }\n // Pre-bind and link the template into the effects system\n const templateInfo = host._bindTemplate(\n /** @type {!HTMLTemplateElement} */ (this.__template), true);\n // Install runEffects hook that prevents running property effects\n // (and any nested template effects) when the `if` is false\n templateInfo.runEffects = (runEffects, changedProps, hasPaths) => {\n let syncInfo = this.__syncInfo;\n if (this.if) {\n // Mix any props that changed while the `if` was false into `changedProps`\n if (syncInfo) {\n // If there were properties received while the `if` was false, it is\n // important to sync the hidden state with the element _first_, so that\n // new bindings to e.g. `textContent` do not get stomped on by\n // pre-hidden values if `_showHideChildren` were to be called later at\n // the next render. Clearing `__invalidProps` here ensures\n // `_showHideChildren`'s call to `__syncHostProperties` no-ops, so\n // that we don't call `runEffects` more often than necessary.\n this.__syncInfo = null;\n this._showHideChildren();\n changedProps = Object.assign(syncInfo.changedProps, changedProps);\n }\n runEffects(changedProps, hasPaths);\n } else {\n // Accumulate any values changed while `if` was false, along with the\n // runEffects method to sync them, so that we can replay them once `if`\n // becomes true\n if (this.__instance) {\n if (!syncInfo) {\n syncInfo = this.__syncInfo = { runEffects, changedProps: {} };\n }\n if (hasPaths) {\n // Store root object of any paths; this will ensure direct bindings\n // like [[obj.foo]] bindings run after a `set('obj.foo', v)`, but\n // note that path notifications like `set('obj.foo.bar', v)` will\n // not propagate. Since batched path notifications are not\n // supported, we cannot simply accumulate path notifications. This\n // is equivalent to the non-fastDomIf case, which stores root(p) in\n // __invalidProps.\n for (const p in changedProps) {\n const rootProp = root(p);\n syncInfo.changedProps[rootProp] = this.__dataHost[rootProp];\n }\n } else {\n Object.assign(syncInfo.changedProps, changedProps);\n }\n }\n }\n };\n // Stamp the template, and set its DocumentFragment to the \"instance\"\n this.__instance = host._stampTemplate(\n /** @type {!HTMLTemplateElement} */ (this.__template), templateInfo);\n wrap(parentNode).insertBefore(this.__instance, this);\n }\n\n /**\n * Run effects for any properties that changed while the `if` was false.\n *\n * @return {void}\n */\n __syncHostProperties() {\n const syncInfo = this.__syncInfo;\n if (syncInfo) {\n this.__syncInfo = null;\n syncInfo.runEffects(syncInfo.changedProps, false);\n }\n }\n\n /**\n * Implementation of abstract API needed by DomIfBase.\n *\n * Remove the instance and any nodes it created. Uses the `__dataHost`'s\n * runtime `_removeBoundDom` method.\n *\n * @override\n * @return {void}\n */\n __teardownInstance() {\n const host = this.__dataHost || this;\n if (this.__instance) {\n host._removeBoundDom(this.__instance);\n this.__instance = null;\n this.__syncInfo = null;\n }\n }\n\n /**\n * Implementation of abstract API needed by DomIfBase.\n *\n * Shows or hides the template instance top level child nodes. For\n * text nodes, `textContent` is removed while \"hidden\" and replaced when\n * \"shown.\"\n *\n * @override\n * @return {void}\n * @protected\n * @suppress {visibility}\n */\n _showHideChildren() {\n const hidden = this.__hideTemplateChildren__ || !this.if;\n if (this.__instance && Boolean(this.__instance.__hidden) !== hidden) {\n this.__instance.__hidden = hidden;\n showHideChildren(hidden, this.__instance.templateInfo.childNodes);\n }\n if (!hidden) {\n this.__syncHostProperties();\n }\n }\n}\n\n/**\n * The \"legacy\" implementation of `dom-if`, implemented using `Templatizer`.\n *\n * In this version, `this.__instance` is the `TemplateInstance` returned\n * from the templatized constructor.\n */\nclass DomIfLegacy extends DomIfBase {\n\n constructor() {\n super();\n this.__ctor = null;\n this.__instance = null;\n this.__invalidProps = null;\n }\n\n /**\n * Implementation of abstract API needed by DomIfBase.\n *\n * @override\n * @return {boolean} True when an instance has been created.\n */\n __hasInstance() {\n return Boolean(this.__instance);\n }\n\n /**\n * Implementation of abstract API needed by DomIfBase.\n *\n * @override\n * @return {Array<Node>} Array of child nodes stamped from the template\n * instance.\n */\n __getInstanceNodes() {\n return this.__instance.children;\n }\n\n /**\n * Implementation of abstract API needed by DomIfBase.\n *\n * Stamps the template by creating a new instance of the templatized\n * constructor (which is created lazily if it does not yet exist), and then\n * inserts its resulting `root` doc fragment into the given `parentNode`.\n *\n * @override\n * @param {Node} parentNode The parent node to insert the instance into\n * @return {void}\n */\n __createAndInsertInstance(parentNode) {\n // Ensure we have an instance constructor\n if (!this.__ctor) {\n this.__ctor = templatize(\n /** @type {!HTMLTemplateElement} */ (this.__template), this, {\n // dom-if templatizer instances require `mutable: true`, as\n // `__syncHostProperties` relies on that behavior to sync objects\n mutableData: true,\n /**\n * @param {string} prop Property to forward\n * @param {*} value Value of property\n * @this {DomIfLegacy}\n */\n forwardHostProp: function(prop, value) {\n if (this.__instance) {\n if (this.if) {\n this.__instance.forwardHostProp(prop, value);\n } else {\n // If we have an instance but are squelching host property\n // forwarding due to if being false, note the invalidated\n // properties so `__syncHostProperties` can sync them the next\n // time `if` becomes true\n this.__invalidProps =\n this.__invalidProps || Object.create(null);\n this.__invalidProps[root(prop)] = true;\n }\n }\n }\n });\n }\n // Create and insert the instance\n this.__instance = new this.__ctor();\n wrap(parentNode).insertBefore(this.__instance.root, this);\n }\n\n /**\n * Implementation of abstract API needed by DomIfBase.\n *\n * Removes the instance and any nodes it created.\n *\n * @override\n * @return {void}\n */\n __teardownInstance() {\n if (this.__instance) {\n let c$ = this.__instance.children;\n if (c$ && c$.length) {\n // use first child parent, for case when dom-if may have been detached\n let parent = wrap(c$[0]).parentNode;\n // Instance children may be disconnected from parents when dom-if\n // detaches if a tree was innerHTML'ed\n if (parent) {\n parent = wrap(parent);\n for (let i=0, n; (i<c$.length) && (n=c$[i]); i++) {\n parent.removeChild(n);\n }\n }\n }\n this.__invalidProps = null;\n this.__instance = null;\n }\n }\n\n /**\n * Forwards any properties that changed while the `if` was false into the\n * template instance and flushes it.\n *\n * @return {void}\n */\n __syncHostProperties() {\n let props = this.__invalidProps;\n if (props) {\n this.__invalidProps = null;\n for (let prop in props) {\n this.__instance._setPendingProperty(prop, this.__dataHost[prop]);\n }\n this.__instance._flushProperties();\n }\n }\n\n /**\n * Implementation of abstract API needed by DomIfBase.\n *\n * Shows or hides the template instance top level child elements. For\n * text nodes, `textContent` is removed while \"hidden\" and replaced when\n * \"shown.\"\n *\n * @override\n * @protected\n * @return {void}\n * @suppress {visibility}\n */\n _showHideChildren() {\n const hidden = this.__hideTemplateChildren__ || !this.if;\n if (this.__instance && Boolean(this.__instance.__hidden) !== hidden) {\n this.__instance.__hidden = hidden;\n this.__instance._showHideChildren(hidden);\n }\n if (!hidden) {\n this.__syncHostProperties();\n }\n }\n}\n\n/**\n * The `<dom-if>` element will stamp a light-dom `<template>` child when\n * the `if` property becomes truthy, and the template can use Polymer\n * data-binding and declarative event features when used in the context of\n * a Polymer element's template.\n *\n * When `if` becomes falsy, the stamped content is hidden but not\n * removed from dom. When `if` subsequently becomes truthy again, the content\n * is simply re-shown. This approach is used due to its favorable performance\n * characteristics: the expense of creating template content is paid only\n * once and lazily.\n *\n * Set the `restamp` property to true to force the stamped content to be\n * created / destroyed when the `if` condition changes.\n *\n * @customElement\n * @polymer\n * @extends DomIfBase\n * @constructor\n * @summary Custom element that conditionally stamps and hides or removes\n * template content based on a boolean flag.\n */\nexport const DomIf = fastDomIf ? DomIfFast : DomIfLegacy;\n\ncustomElements.define(DomIf.is, DomIf);\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\nimport { PolymerElement } from '../../polymer-element.js';\n\nimport { dedupingMixin } from '../utils/mixin.js';\nimport { calculateSplices } from '../utils/array-splice.js';\nimport { ElementMixin } from '../mixins/element-mixin.js';\n\n/**\n * Element mixin for recording dynamic associations between item paths in a\n * master `items` array and a `selected` array such that path changes to the\n * master array (at the host) element or elsewhere via data-binding) are\n * correctly propagated to items in the selected array and vice-versa.\n *\n * The `items` property accepts an array of user data, and via the\n * `select(item)` and `deselect(item)` API, updates the `selected` property\n * which may be bound to other parts of the application, and any changes to\n * sub-fields of `selected` item(s) will be kept in sync with items in the\n * `items` array. When `multi` is false, `selected` is a property\n * representing the last selected item. When `multi` is true, `selected`\n * is an array of multiply selected items.\n *\n * @polymer\n * @mixinFunction\n * @appliesMixin ElementMixin\n * @summary Element mixin for recording dynamic associations between item paths in a\n * master `items` array and a `selected` array\n */\nlet ArraySelectorMixin = dedupingMixin(superClass => {\n\n /**\n * @constructor\n * @implements {Polymer_ElementMixin}\n * @private\n */\n let elementBase = ElementMixin(superClass);\n\n /**\n * @polymer\n * @mixinClass\n * @implements {Polymer_ArraySelectorMixin}\n * @unrestricted\n */\n class ArraySelectorMixin extends elementBase {\n\n static get properties() {\n return {\n\n /**\n * An array containing items from which selection will be made.\n */\n items: {\n type: Array,\n },\n\n /**\n * When `true`, multiple items may be selected at once (in this case,\n * `selected` is an array of currently selected items). When `false`,\n * only one item may be selected at a time.\n */\n multi: {\n type: Boolean,\n value: false,\n },\n\n /**\n * When `multi` is true, this is an array that contains any selected.\n * When `multi` is false, this is the currently selected item, or `null`\n * if no item is selected.\n * @type {?Object|?Array<!Object>}\n */\n selected: {type: Object, notify: true},\n\n /**\n * When `multi` is false, this is the currently selected item, or `null`\n * if no item is selected.\n * @type {?Object}\n */\n selectedItem: {type: Object, notify: true},\n\n /**\n * When `true`, calling `select` on an item that is already selected\n * will deselect the item.\n */\n toggle: {type: Boolean, value: false}\n\n };\n }\n\n static get observers() {\n return ['__updateSelection(multi, items.*)'];\n }\n\n constructor() {\n super();\n this.__lastItems = null;\n this.__lastMulti = null;\n this.__selectedMap = null;\n }\n\n __updateSelection(multi, itemsInfo) {\n let path = itemsInfo.path;\n if (path == JSCompiler_renameProperty('items', this)) {\n // Case 1 - items array changed, so diff against previous array and\n // deselect any removed items and adjust selected indices\n let newItems = itemsInfo.base || [];\n let lastItems = this.__lastItems;\n let lastMulti = this.__lastMulti;\n if (multi !== lastMulti) {\n this.clearSelection();\n }\n if (lastItems) {\n let splices = calculateSplices(newItems, lastItems);\n this.__applySplices(splices);\n }\n this.__lastItems = newItems;\n this.__lastMulti = multi;\n } else if (itemsInfo.path == `${JSCompiler_renameProperty('items', this)}.splices`) {\n // Case 2 - got specific splice information describing the array mutation:\n // deselect any removed items and adjust selected indices\n this.__applySplices(itemsInfo.value.indexSplices);\n } else {\n // Case 3 - an array element was changed, so deselect the previous\n // item for that index if it was previously selected\n let part = path.slice(`${JSCompiler_renameProperty('items', this)}.`.length);\n let idx = parseInt(part, 10);\n if ((part.indexOf('.') < 0) && part == idx) {\n this.__deselectChangedIdx(idx);\n }\n }\n }\n\n __applySplices(splices) {\n let selected = this.__selectedMap;\n // Adjust selected indices and mark removals\n for (let i=0; i<splices.length; i++) {\n let s = splices[i];\n selected.forEach((idx, item) => {\n if (idx < s.index) {\n // no change\n } else if (idx >= s.index + s.removed.length) {\n // adjust index\n selected.set(item, idx + s.addedCount - s.removed.length);\n } else {\n // remove index\n selected.set(item, -1);\n }\n });\n for (let j=0; j<s.addedCount; j++) {\n let idx = s.index + j;\n if (selected.has(this.items[idx])) {\n selected.set(this.items[idx], idx);\n }\n }\n }\n // Update linked paths\n this.__updateLinks();\n // Remove selected items that were removed from the items array\n let sidx = 0;\n selected.forEach((idx, item) => {\n if (idx < 0) {\n if (this.multi) {\n this.splice(JSCompiler_renameProperty('selected', this), sidx, 1);\n } else {\n this.selected = this.selectedItem = null;\n }\n selected.delete(item);\n } else {\n sidx++;\n }\n });\n }\n\n __updateLinks() {\n this.__dataLinkedPaths = {};\n if (this.multi) {\n let sidx = 0;\n this.__selectedMap.forEach(idx => {\n if (idx >= 0) {\n this.linkPaths(\n `${JSCompiler_renameProperty('items', this)}.${idx}`,\n `${JSCompiler_renameProperty('selected', this)}.${sidx++}`);\n }\n });\n } else {\n this.__selectedMap.forEach(idx => {\n this.linkPaths(\n JSCompiler_renameProperty('selected', this),\n `${JSCompiler_renameProperty('items', this)}.${idx}`);\n this.linkPaths(\n JSCompiler_renameProperty('selectedItem', this),\n `${JSCompiler_renameProperty('items', this)}.${idx}`);\n });\n }\n }\n\n /**\n * Clears the selection state.\n * @override\n * @return {void}\n */\n clearSelection() {\n // Unbind previous selection\n this.__dataLinkedPaths = {};\n // The selected map stores 3 pieces of information:\n // key: items array object\n // value: items array index\n // order: selected array index\n this.__selectedMap = new Map();\n // Initialize selection\n this.selected = this.multi ? [] : null;\n this.selectedItem = null;\n }\n\n /**\n * Returns whether the item is currently selected.\n *\n * @override\n * @param {*} item Item from `items` array to test\n * @return {boolean} Whether the item is selected\n */\n isSelected(item) {\n return this.__selectedMap.has(item);\n }\n\n /**\n * Returns whether the item is currently selected.\n *\n * @override\n * @param {number} idx Index from `items` array to test\n * @return {boolean} Whether the item is selected\n */\n isIndexSelected(idx) {\n return this.isSelected(this.items[idx]);\n }\n\n __deselectChangedIdx(idx) {\n let sidx = this.__selectedIndexForItemIndex(idx);\n if (sidx >= 0) {\n let i = 0;\n this.__selectedMap.forEach((idx, item) => {\n if (sidx == i++) {\n this.deselect(item);\n }\n });\n }\n }\n\n __selectedIndexForItemIndex(idx) {\n let selected = this.__dataLinkedPaths[`${JSCompiler_renameProperty('items', this)}.${idx}`];\n if (selected) {\n return parseInt(selected.slice(`${JSCompiler_renameProperty('selected', this)}.`.length), 10);\n }\n }\n\n /**\n * Deselects the given item if it is already selected.\n *\n * @override\n * @param {*} item Item from `items` array to deselect\n * @return {void}\n */\n deselect(item) {\n let idx = this.__selectedMap.get(item);\n if (idx >= 0) {\n this.__selectedMap.delete(item);\n let sidx;\n if (this.multi) {\n sidx = this.__selectedIndexForItemIndex(idx);\n }\n this.__updateLinks();\n if (this.multi) {\n this.splice(JSCompiler_renameProperty('selected', this), sidx, 1);\n } else {\n this.selected = this.selectedItem = null;\n }\n }\n }\n\n /**\n * Deselects the given index if it is already selected.\n *\n * @override\n * @param {number} idx Index from `items` array to deselect\n * @return {void}\n */\n deselectIndex(idx) {\n this.deselect(this.items[idx]);\n }\n\n /**\n * Selects the given item. When `toggle` is true, this will automatically\n * deselect the item if already selected.\n *\n * @override\n * @param {*} item Item from `items` array to select\n * @return {void}\n */\n select(item) {\n this.selectIndex(this.items.indexOf(item));\n }\n\n /**\n * Selects the given index. When `toggle` is true, this will automatically\n * deselect the item if already selected.\n *\n * @override\n * @param {number} idx Index from `items` array to select\n * @return {void}\n */\n selectIndex(idx) {\n let item = this.items[idx];\n if (!this.isSelected(item)) {\n if (!this.multi) {\n this.__selectedMap.clear();\n }\n this.__selectedMap.set(item, idx);\n this.__updateLinks();\n if (this.multi) {\n this.push(JSCompiler_renameProperty('selected', this), item);\n } else {\n this.selected = this.selectedItem = item;\n }\n } else if (this.toggle) {\n this.deselectIndex(idx);\n }\n }\n\n }\n\n return ArraySelectorMixin;\n\n});\n\n// export mixin\nexport { ArraySelectorMixin };\n\n/**\n * @constructor\n * @extends {PolymerElement}\n * @implements {Polymer_ArraySelectorMixin}\n * @private\n */\nlet baseArraySelector = ArraySelectorMixin(PolymerElement);\n\n/**\n * Element implementing the `ArraySelector` mixin, which records\n * dynamic associations between item paths in a master `items` array and a\n * `selected` array such that path changes to the master array (at the host)\n * element or elsewhere via data-binding) are correctly propagated to items\n * in the selected array and vice-versa.\n *\n * The `items` property accepts an array of user data, and via the\n * `select(item)` and `deselect(item)` API, updates the `selected` property\n * which may be bound to other parts of the application, and any changes to\n * sub-fields of `selected` item(s) will be kept in sync with items in the\n * `items` array. When `multi` is false, `selected` is a property\n * representing the last selected item. When `multi` is true, `selected`\n * is an array of multiply selected items.\n *\n * Example:\n *\n * ```js\n * import {PolymerElement} from '@polymer/polymer';\n * import '@polymer/polymer/lib/elements/array-selector.js';\n *\n * class EmployeeList extends PolymerElement {\n * static get _template() {\n * return html`\n * <div> Employee list: </div>\n * <dom-repeat id=\"employeeList\" items=\"{{employees}}\">\n * <template>\n * <div>First name: <span>{{item.first}}</span></div>\n * <div>Last name: <span>{{item.last}}</span></div>\n * <button on-click=\"toggleSelection\">Select</button>\n * </template>\n * </dom-repeat>\n *\n * <array-selector id=\"selector\"\n * items=\"{{employees}}\"\n * selected=\"{{selected}}\"\n * multi toggle></array-selector>\n *\n * <div> Selected employees: </div>\n * <dom-repeat items=\"{{selected}}\">\n * <template>\n * <div>First name: <span>{{item.first}}</span></div>\n * <div>Last name: <span>{{item.last}}</span></div>\n * </template>\n * </dom-repeat>`;\n * }\n * static get is() { return 'employee-list'; }\n * static get properties() {\n * return {\n * employees: {\n * value() {\n * return [\n * {first: 'Bob', last: 'Smith'},\n * {first: 'Sally', last: 'Johnson'},\n * ...\n * ];\n * }\n * }\n * };\n * }\n * toggleSelection(e) {\n * const item = this.$.employeeList.itemForElement(e.target);\n * this.$.selector.select(item);\n * }\n * }\n * ```\n *\n * @polymer\n * @customElement\n * @extends {baseArraySelector}\n * @appliesMixin ArraySelectorMixin\n * @summary Custom element that links paths between an input `items` array and\n * an output `selected` item or array based on calls to its selection API.\n */\nclass ArraySelector extends baseArraySelector {\n // Not needed to find template; can be removed once the analyzer\n // can find the tag name from customElements.define call\n static get is() { return 'array-selector'; }\n static get template() { return null; }\n}\ncustomElements.define(ArraySelector.is, ArraySelector);\nexport { ArraySelector };\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nimport { LegacyElementMixin } from './lib/legacy/legacy-element-mixin.js';\nexport { Polymer } from './lib/legacy/polymer-fn.js';\n/* template elements */\nimport './lib/legacy/templatizer-behavior.js';\nimport './lib/elements/dom-bind.js';\nimport './lib/elements/dom-repeat.js';\nimport './lib/elements/dom-if.js';\nimport './lib/elements/array-selector.js';\n/* custom-style */\nimport './lib/elements/custom-style.js';\n/* bc behaviors */\nimport './lib/legacy/mutable-data-behavior.js';\n/* import html-tag to export html */\nexport { html } from './lib/utils/html-tag.js';\n\n// bc\nexport const Base = LegacyElementMixin(HTMLElement).prototype;\n","/**\n@license\nCopyright (c) 2015 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at\nhttp://polymer.github.io/LICENSE.txt The complete set of authors may be found at\nhttp://polymer.github.io/AUTHORS.txt The complete set of contributors may be\nfound at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as\npart of the polymer project is also subject to an additional IP rights grant\nfound at http://polymer.github.io/PATENTS.txt\n*/\nimport '@polymer/polymer/polymer-legacy.js';\n\nimport {Polymer} from '@polymer/polymer/lib/legacy/polymer-fn.js';\n\n/**\n`iron-media-query` can be used to data bind to a CSS media query.\nThe `query` property is a bare CSS media query.\nThe `query-matches` property is a boolean representing whether the page matches\nthat media query.\n\nExample:\n\n```html\n<iron-media-query query=\"(min-width: 600px)\" query-matches=\"{{queryMatches}}\">\n</iron-media-query>\n```\n\n@group Iron Elements\n@demo demo/index.html\n@hero hero.svg\n@element iron-media-query\n*/\nPolymer({\n\n is: 'iron-media-query',\n\n properties: {\n\n /**\n * The Boolean return value of the media query.\n */\n queryMatches: {type: Boolean, value: false, readOnly: true, notify: true},\n\n /**\n * The CSS media query to evaluate.\n */\n query: {type: String, observer: 'queryChanged'},\n\n /**\n * If true, the query attribute is assumed to be a complete media query\n * string rather than a single media feature.\n */\n full: {type: Boolean, value: false},\n\n /**\n * @type {function(MediaQueryList)}\n */\n _boundMQHandler: {\n value: function() {\n return this.queryHandler.bind(this);\n }\n },\n\n /**\n * @type {MediaQueryList}\n */\n _mq: {value: null}\n },\n\n attached: function() {\n this.style.display = 'none';\n this.queryChanged();\n },\n\n detached: function() {\n this._remove();\n },\n\n _add: function() {\n if (this._mq) {\n this._mq.addListener(this._boundMQHandler);\n }\n },\n\n _remove: function() {\n if (this._mq) {\n this._mq.removeListener(this._boundMQHandler);\n }\n this._mq = null;\n },\n\n queryChanged: function() {\n this._remove();\n var query = this.query;\n if (!query) {\n return;\n }\n if (!this.full && query[0] !== '(') {\n query = '(' + query + ')';\n }\n this._mq = window.matchMedia(query);\n this._add();\n this.queryHandler(this._mq);\n },\n\n queryHandler: function(mq) {\n this._setQueryMatches(mq.matches);\n }\n\n});\n","const p = Element.prototype;\nconst matches = p.matches || p.matchesSelector || p.mozMatchesSelector ||\n p.msMatchesSelector || p.oMatchesSelector || p.webkitMatchesSelector;\n\n/**\n * `Polymer.IronFocusablesHelper` relies on some Polymer-specific legacy API,\n * especially the `root` property which does not exist for native shadow DOM.\n * That's why we have this helper here.\n * See https://github.com/PolymerElements/iron-overlay-behavior/issues/282\n */\nclass FocusablesHelper {\n\n /**\n * Returns a sorted array of tabbable nodes, including the root node.\n * It searches the tabbable nodes in the light and shadow dom of the children,\n * sorting the result by tabindex.\n * @param {!Node} node\n * @return {!Array<!HTMLElement>}\n */\n static getTabbableNodes(node) {\n const result = [];\n // If there is at least one element with tabindex > 0, we need to sort\n // the final array by tabindex.\n const needsSortByTabIndex = this._collectTabbableNodes(node, result);\n if (needsSortByTabIndex) {\n return this._sortByTabIndex(result);\n }\n return result;\n }\n\n /**\n * Returns if a element is focusable.\n * @param {!HTMLElement} element\n * @return {boolean}\n */\n static isFocusable(element) {\n // From http://stackoverflow.com/a/1600194/4228703:\n // There isn't a definite list, it's up to the browser. The only\n // standard we have is DOM Level 2 HTML\n // https://www.w3.org/TR/DOM-Level-2-HTML/html.html, according to which the\n // only elements that have a focus() method are HTMLInputElement,\n // HTMLSelectElement, HTMLTextAreaElement and HTMLAnchorElement. This\n // notably omits HTMLButtonElement and HTMLAreaElement. Referring to these\n // tests with tabbables in different browsers\n // http://allyjs.io/data-tables/focusable.html\n\n // Elements that cannot be focused if they have [disabled] attribute.\n if (matches.call(element, 'input, select, textarea, button, object')) {\n return matches.call(element, ':not([disabled])');\n }\n // Elements that can be focused even if they have [disabled] attribute.\n return matches.call(element, 'a[href], area[href], iframe, [tabindex], [contentEditable]');\n }\n\n /**\n * Returns if a element is tabbable. To be tabbable, a element must be\n * focusable, visible, and with a tabindex !== -1.\n * @param {!HTMLElement} element\n * @return {boolean}\n */\n static isTabbable(element) {\n return this.isFocusable(element) &&\n matches.call(element, ':not([tabindex=\"-1\"])') &&\n this._isVisible(element);\n }\n\n /**\n * Returns the normalized element tabindex. If not focusable, returns -1.\n * It checks for the attribute \"tabindex\" instead of the element property\n * `tabIndex` since browsers assign different values to it.\n * e.g. in Firefox `<div contenteditable>` has `tabIndex = -1`\n * @param {!HTMLElement} element\n * @return {!number}\n * @private\n */\n static _normalizedTabIndex(element) {\n if (this.isFocusable(element)) {\n const tabIndex = element.getAttribute('tabindex') || 0;\n return Number(tabIndex);\n }\n return -1;\n }\n\n /**\n * Searches for nodes that are tabbable and adds them to the `result` array.\n * Returns if the `result` array needs to be sorted by tabindex.\n * @param {!Node} node The starting point for the search; added to `result` if tabbable.\n * @param {!Array<!HTMLElement>} result\n * @return {boolean}\n * @private\n */\n static _collectTabbableNodes(node, result) {\n // If not an element or not visible, no need to explore children.\n if (node.nodeType !== Node.ELEMENT_NODE || !this._isVisible(node)) {\n return false;\n }\n const element = /** @type {!HTMLElement} */ (node);\n const tabIndex = this._normalizedTabIndex(element);\n let needsSort = tabIndex > 0;\n if (tabIndex >= 0) {\n result.push(element);\n }\n\n // In ShadowDOM v1, tab order is affected by the order of distribution.\n // E.g. getTabbableNodes(#root) in ShadowDOM v1 should return [#A, #B];\n // in ShadowDOM v0 tab order is not affected by the distribution order,\n // in fact getTabbableNodes(#root) returns [#B, #A].\n // <div id=\"root\">\n // <!-- shadow -->\n // <slot name=\"a\">\n // <slot name=\"b\">\n // <!-- /shadow -->\n // <input id=\"A\" slot=\"a\">\n // <input id=\"B\" slot=\"b\" tabindex=\"1\">\n // </div>\n let children;\n if (element.localName === 'slot') {\n children = element.assignedNodes({flatten: true});\n } else {\n // Use shadow root if possible, will check for distributed nodes.\n children = (element.shadowRoot || element).children;\n }\n if (children) {\n for (let i = 0; i < children.length; i++) {\n // Ensure method is always invoked to collect tabbable children.\n needsSort = this._collectTabbableNodes(children[i], result) || needsSort;\n }\n }\n return needsSort;\n }\n\n /**\n * Returns false if the element has `visibility: hidden` or `display: none`\n * @param {!HTMLElement} element\n * @return {boolean}\n * @private\n */\n static _isVisible(element) {\n // Check inline style first to save a re-flow. If looks good, check also\n // computed style.\n let style = element.style;\n if (style.visibility !== 'hidden' && style.display !== 'none') {\n style = window.getComputedStyle(element);\n return (style.visibility !== 'hidden' && style.display !== 'none');\n }\n return false;\n }\n\n /**\n * Sorts an array of tabbable elements by tabindex. Returns a new array.\n * @param {!Array<!HTMLElement>} tabbables\n * @return {!Array<!HTMLElement>}\n * @private\n */\n static _sortByTabIndex(tabbables) {\n // Implement a merge sort as Array.prototype.sort does a non-stable sort\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort\n const len = tabbables.length;\n if (len < 2) {\n return tabbables;\n }\n const pivot = Math.ceil(len / 2);\n const left = this._sortByTabIndex(tabbables.slice(0, pivot));\n const right = this._sortByTabIndex(tabbables.slice(pivot));\n return this._mergeSortByTabIndex(left, right);\n }\n\n /**\n * Merge sort iterator, merges the two arrays into one, sorted by tab index.\n * @param {!Array<!HTMLElement>} left\n * @param {!Array<!HTMLElement>} right\n * @return {!Array<!HTMLElement>}\n * @private\n */\n static _mergeSortByTabIndex(left, right) {\n const result = [];\n while ((left.length > 0) && (right.length > 0)) {\n if (this._hasLowerTabOrder(left[0], right[0])) {\n result.push(right.shift());\n } else {\n result.push(left.shift());\n }\n }\n\n return result.concat(left, right);\n }\n\n /**\n * Returns if element `a` has lower tab order compared to element `b`\n * (both elements are assumed to be focusable and tabbable).\n * Elements with tabindex = 0 have lower tab order compared to elements\n * with tabindex > 0.\n * If both have same tabindex, it returns false.\n * @param {!HTMLElement} a\n * @param {!HTMLElement} b\n * @return {boolean}\n * @private\n */\n static _hasLowerTabOrder(a, b) {\n // Normalize tabIndexes\n // e.g. in Firefox `<div contenteditable>` has `tabIndex = -1`\n const ati = Math.max(a.tabIndex, 0);\n const bti = Math.max(b.tabIndex, 0);\n return (ati === 0 || bti === 0) ? bti > ati : ati > bti;\n }\n}\n\nexport { FocusablesHelper };\n","/**\n@license\nCopyright (c) 2017 Vaadin Ltd.\nThis program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n*/\nimport { PolymerElement } from '@polymer/polymer/polymer-element.js';\n\nimport { templatize } from '@polymer/polymer/lib/utils/templatize.js';\nimport { afterNextRender } from '@polymer/polymer/lib/utils/render-status.js';\nimport { FlattenedNodesObserver } from '@polymer/polymer/lib/utils/flattened-nodes-observer.js';\nimport { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';\nimport { DirMixin } from '@vaadin/vaadin-element-mixin/vaadin-dir-mixin.js';\nimport { FocusablesHelper } from './vaadin-focusables-helper.js';\nimport { html } from '@polymer/polymer/lib/utils/html-tag.js';\nlet overlayContentCounter = 0;\nconst overlayContentCache = {};\n\nconst createOverlayContent = (cssText) => {\n const is = overlayContentCache[cssText] || processOverlayStyles(cssText);\n return document.createElement(is);\n};\n\nconst processOverlayStyles = (cssText) => {\n overlayContentCounter++;\n const is = `vaadin-overlay-content-${overlayContentCounter}`;\n\n const styledTemplate = document.createElement('template');\n const style = document.createElement('style');\n style.textContent = ':host { display: block; }' + cssText;\n styledTemplate.content.appendChild(style);\n\n if (window.ShadyCSS) {\n window.ShadyCSS.prepareTemplate(styledTemplate, is);\n }\n\n // NOTE(platosha): Have to use an awkward IIFE returning class here\n // to prevent this class from showing up in analysis.json & API docs.\n const klass = (() => /** @private */ class extends HTMLElement {\n static get is() {\n return is;\n }\n\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n this.attachShadow({mode: 'open'});\n this.shadowRoot.appendChild(document.importNode(styledTemplate.content, true));\n }\n }\n\n connectedCallback() {\n if (window.ShadyCSS) {\n window.ShadyCSS.styleElement(this);\n }\n }\n })();\n\n customElements.define(klass.is, klass);\n\n overlayContentCache[cssText] = is;\n return is;\n};\n\n/**\n *\n * `<vaadin-overlay>` is a Web Component for creating overlays. The content of the overlay\n * can be populated in two ways: imperatively by using renderer callback function and\n * declaratively by using Polymer's Templates.\n *\n * ### Rendering\n *\n * By default, the overlay uses the content provided by using the renderer callback function.\n *\n * The renderer function provides `root`, `owner`, `model` arguments when applicable.\n * Generate DOM content by using `model` object properties if needed, append it to the `root`\n * element and control the state of the host element by accessing `owner`. Before generating new\n * content, users are able to check if there is already content in `root` for reusing it.\n *\n * ```html\n * <vaadin-overlay id=\"overlay\"></vaadin-overlay>\n * ```\n * ```js\n * const overlay = document.querySelector('#overlay');\n * overlay.renderer = function(root) {\n * root.textContent = \"Overlay content\";\n * };\n * ```\n *\n * Renderer is called on the opening of the overlay and each time the related model is updated.\n * DOM generated during the renderer call can be reused\n * in the next renderer call and will be provided with the `root` argument.\n * On first call it will be empty.\n *\n * **NOTE:** when the renderer property is defined, the `<template>` content is not used.\n *\n * ### Templating\n *\n * Alternatively, the content can be provided with Polymer Template.\n * Overlay finds the first child template and uses that in case renderer callback function\n * is not provided. You can also set a custom template using the `template` property.\n *\n * After the content from the template is stamped, the `content` property\n * points to the content container.\n *\n * The overlay provides `forwardHostProp` when calling\n * `Polymer.Templatize.templatize` for the template, so that the bindings\n * from the parent scope propagate to the content. You can also pass\n * custom `instanceProps` object using the `instanceProps` property.\n *\n * ```html\n * <vaadin-overlay>\n * <template>Overlay content</template>\n * </vaadin-overlay>\n * ```\n *\n * **NOTE:** when using `instanceProps`: because of the Polymer limitation,\n * every template can only be templatized once, so it is important\n * to set `instanceProps` before the `template` is assigned to the overlay.\n *\n * ### Styling\n *\n * To style the overlay content, use styles in the parent scope:\n *\n * - If the overlay is used in a component, then the component styles\n * apply the overlay content.\n * - If the overlay is used in the global DOM scope, then global styles\n * apply to the overlay content.\n *\n * See examples for styling the overlay content in the live demos.\n *\n * The following Shadow DOM parts are available for styling the overlay component itself:\n *\n * Part name | Description\n * -----------|---------------------------------------------------------|\n * `backdrop` | Backdrop of the overlay\n * `overlay` | Container for position/sizing/alignment of the content\n * `content` | Content of the overlay\n *\n * The following state attributes are available for styling:\n *\n * Attribute | Description | Part\n * ---|---|---\n * `opening` | Applied just after the overlay is attached to the DOM. You can apply a CSS @keyframe animation for this state. | `:host`\n * `closing` | Applied just before the overlay is detached from the DOM. You can apply a CSS @keyframe animation for this state. | `:host`\n *\n * The following custom CSS properties are available for styling:\n *\n * Custom CSS property | Description | Default value\n * ---|---|---\n * `--vaadin-overlay-viewport-bottom` | Bottom offset of the visible viewport area | `0` or detected offset\n *\n * See [ThemableMixin – how to apply styles for shadow parts](https://github.com/vaadin/vaadin-themable-mixin/wiki)\n *\n * @extends PolymerElement\n * @mixes ThemableMixin\n * @demo demo/index.html\n */\nclass OverlayElement extends ThemableMixin(DirMixin(PolymerElement)) {\n static get template() {\n return html`\n <style>\n :host {\n z-index: 200;\n position: fixed;\n\n /*\n Despite of what the names say, <vaadin-overlay> is just a container\n for position/sizing/alignment. The actual overlay is the overlay part.\n */\n\n /*\n Default position constraints: the entire viewport. Note: themes can\n override this to introduce gaps between the overlay and the viewport.\n */\n top: 0;\n right: 0;\n bottom: var(--vaadin-overlay-viewport-bottom);\n left: 0;\n\n /* Use flexbox alignment for the overlay part. */\n display: flex;\n flex-direction: column; /* makes dropdowns sizing easier */\n /* Align to center by default. */\n align-items: center;\n justify-content: center;\n\n /* Allow centering when max-width/max-height applies. */\n margin: auto;\n\n /* The host is not clickable, only the overlay part is. */\n pointer-events: none;\n\n /* Remove tap highlight on touch devices. */\n -webkit-tap-highlight-color: transparent;\n\n /* CSS API for host */\n --vaadin-overlay-viewport-bottom: 0;\n }\n\n :host([hidden]),\n :host(:not([opened]):not([closing])) {\n display: none !important;\n }\n\n [part=\"overlay\"] {\n -webkit-overflow-scrolling: touch;\n overflow: auto;\n pointer-events: auto;\n\n /* Prevent overflowing the host in MSIE 11 */\n max-width: 100%;\n box-sizing: border-box;\n\n -webkit-tap-highlight-color: initial; /* reenable tap highlight inside */\n }\n\n [part=\"backdrop\"] {\n z-index: -1;\n content: \"\";\n background: rgba(0, 0, 0, 0.5);\n position: fixed;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n pointer-events: auto;\n }\n </style>\n\n <div id=\"backdrop\" part=\"backdrop\" hidden\\$=\"{{!withBackdrop}}\"></div>\n <div part=\"overlay\" id=\"overlay\" tabindex=\"0\">\n <div part=\"content\" id=\"content\">\n <slot></slot>\n </div>\n </div>\n`;\n }\n\n static get is() {\n return 'vaadin-overlay';\n }\n\n static get properties() {\n return {\n /**\n * When true, the overlay is visible and attached to body.\n */\n opened: {\n type: Boolean,\n notify: true,\n observer: '_openedChanged',\n reflectToAttribute: true\n },\n\n /**\n * Owner element passed with renderer function\n * @type {HTMLElement}\n */\n owner: Element,\n\n /**\n * Custom function for rendering the content of the overlay.\n * Receives three arguments:\n *\n * - `root` The root container DOM element. Append your content to it.\n * - `owner` The host element of the renderer function.\n * - `model` The object with the properties related with rendering.\n * @type {OverlayRenderer | null | undefined}\n */\n renderer: Function,\n\n /**\n * The template of the overlay content.\n * @type {HTMLTemplateElement | null | undefined}\n */\n template: {\n type: Object,\n notify: true\n },\n\n /**\n * Optional argument for `Polymer.Templatize.templatize`.\n */\n instanceProps: {\n type: Object\n },\n\n /**\n * References the content container after the template is stamped.\n * @type {!HTMLElement | undefined}\n */\n content: {\n type: Object,\n notify: true\n },\n\n /**\n * When true the overlay has backdrop on top of content when opened.\n * @type {boolean}\n */\n withBackdrop: {\n type: Boolean,\n value: false,\n reflectToAttribute: true\n },\n\n /**\n * Object with properties that is passed to `renderer` function\n */\n model: Object,\n\n /**\n * When true the overlay won't disable the main content, showing\n * it doesn’t change the functionality of the user interface.\n * @type {boolean}\n */\n modeless: {\n type: Boolean,\n value: false,\n reflectToAttribute: true,\n observer: '_modelessChanged'\n },\n\n /**\n * When set to true, the overlay is hidden. This also closes the overlay\n * immediately in case there is a closing animation in progress.\n * @type {boolean}\n */\n hidden: {\n type: Boolean,\n reflectToAttribute: true,\n observer: '_hiddenChanged'\n },\n\n /**\n * When true move focus to the first focusable element in the overlay,\n * or to the overlay if there are no focusable elements.\n * @type {boolean}\n */\n focusTrap: {\n type: Boolean,\n value: false\n },\n\n /**\n * Set to true to enable restoring of focus when overlay is closed.\n * @type {boolean}\n */\n restoreFocusOnClose: {\n type: Boolean,\n value: false,\n },\n\n /** @private */\n _mouseDownInside: {\n type: Boolean\n },\n\n /** @private */\n _mouseUpInside: {\n type: Boolean\n },\n\n /** @private */\n _instance: {\n type: Object\n },\n\n /** @private */\n _originalContentPart: Object,\n\n /** @private */\n _contentNodes: Array,\n\n /** @private */\n _oldOwner: Element,\n\n /** @private */\n _oldModel: Object,\n\n /** @private */\n _oldTemplate: Object,\n\n /** @private */\n _oldInstanceProps: Object,\n\n /** @private */\n _oldRenderer: Object,\n\n /** @private */\n _oldOpened: Boolean\n };\n }\n\n static get observers() {\n return [\n '_templateOrRendererChanged(template, renderer, owner, model, instanceProps, opened)'\n ];\n }\n\n constructor() {\n super();\n this._boundMouseDownListener = this._mouseDownListener.bind(this);\n this._boundMouseUpListener = this._mouseUpListener.bind(this);\n this._boundOutsideClickListener = this._outsideClickListener.bind(this);\n this._boundKeydownListener = this._keydownListener.bind(this);\n\n this._observer = new FlattenedNodesObserver(this, info => {\n this._setTemplateFromNodes(info.addedNodes);\n });\n\n // Listener for preventing closing of the paper-dialog and all components extending `iron-overlay-behavior`.\n this._boundIronOverlayCanceledListener = this._ironOverlayCanceled.bind(this);\n\n if (/iPad|iPhone|iPod/.test(navigator.userAgent)) {\n this._boundIosResizeListener = () => this._detectIosNavbar();\n }\n }\n\n ready() {\n super.ready();\n\n this._observer.flush();\n\n // Need to add dummy click listeners to this and the backdrop or else\n // the document click event listener (_outsideClickListener) may never\n // get invoked on iOS Safari (reproducible in <vaadin-dialog>\n // and <vaadin-context-menu>).\n this.addEventListener('click', () => {});\n this.$.backdrop.addEventListener('click', () => {});\n }\n\n /** @private */\n _detectIosNavbar() {\n if (!this.opened) {\n return;\n }\n\n const innerHeight = window.innerHeight;\n const innerWidth = window.innerWidth;\n\n const landscape = innerWidth > innerHeight;\n\n const clientHeight = document.documentElement.clientHeight;\n\n if (landscape && clientHeight > innerHeight) {\n this.style.setProperty('--vaadin-overlay-viewport-bottom', clientHeight - innerHeight + 'px');\n } else {\n this.style.setProperty('--vaadin-overlay-viewport-bottom', '0');\n }\n }\n\n /**\n * @param {!Array<!Element>} nodes\n * @protected\n */\n _setTemplateFromNodes(nodes) {\n this.template = nodes.filter(node => node.localName && node.localName === 'template')[0] || this.template;\n }\n\n /**\n * @param {Event=} sourceEvent\n * @event vaadin-overlay-close\n * fired before the `vaadin-overlay` will be closed. If canceled the closing of the overlay is canceled as well.\n */\n close(sourceEvent) {\n var evt = new CustomEvent('vaadin-overlay-close', {bubbles: true, cancelable: true, detail: {sourceEvent: sourceEvent}});\n this.dispatchEvent(evt);\n if (!evt.defaultPrevented) {\n this.opened = false;\n }\n }\n\n connectedCallback() {\n super.connectedCallback();\n\n if (this._boundIosResizeListener) {\n this._detectIosNavbar();\n window.addEventListener('resize', this._boundIosResizeListener);\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n this._boundIosResizeListener && window.removeEventListener('resize', this._boundIosResizeListener);\n }\n\n /** @private */\n _ironOverlayCanceled(event) {\n event.preventDefault();\n }\n\n /** @private */\n _mouseDownListener(event) {\n this._mouseDownInside = event.composedPath().indexOf(this.$.overlay) >= 0;\n }\n\n /** @private */\n _mouseUpListener(event) {\n this._mouseUpInside = event.composedPath().indexOf(this.$.overlay) >= 0;\n }\n\n /**\n * We need to listen on 'click' / 'tap' event and capture it and close the overlay before\n * propagating the event to the listener in the button. Otherwise, if the clicked button would call\n * open(), this would happen: https://www.youtube.com/watch?v=Z86V_ICUCD4\n *\n * @event vaadin-overlay-outside-click\n * fired before the `vaadin-overlay` will be closed on outside click. If canceled the closing of the overlay is canceled as well.\n *\n * @private\n */\n _outsideClickListener(event) {\n if (event.composedPath().indexOf(this.$.overlay) !== -1 ||\n this._mouseDownInside || this._mouseUpInside) {\n this._mouseDownInside = false;\n this._mouseUpInside = false;\n return;\n }\n if (!this._last) {\n return;\n }\n\n const evt = new CustomEvent('vaadin-overlay-outside-click', {bubbles: true, cancelable: true, detail: {sourceEvent: event}});\n this.dispatchEvent(evt);\n\n if (this.opened && !evt.defaultPrevented) {\n this.close(event);\n }\n }\n\n /**\n * @event vaadin-overlay-escape-press\n * fired before the `vaadin-overlay` will be closed on ESC button press. If canceled the closing of the overlay is canceled as well.\n *\n * @private\n */\n _keydownListener(event) {\n if (!this._last) {\n return;\n }\n\n // TAB\n if (event.key === 'Tab' && this.focusTrap && !event.defaultPrevented) {\n // if only tab key is pressed, cycle forward, else cycle backwards.\n this._cycleTab(event.shiftKey ? -1 : 1);\n\n event.preventDefault();\n\n // ESC\n } else if (event.key === 'Escape' || event.key === 'Esc') {\n const evt = new CustomEvent('vaadin-overlay-escape-press', {bubbles: true, cancelable: true, detail: {sourceEvent: event}});\n this.dispatchEvent(evt);\n\n if (this.opened && !evt.defaultPrevented) {\n this.close(event);\n }\n }\n }\n\n /** @protected */\n _ensureTemplatized() {\n this._setTemplateFromNodes(Array.from(this.children));\n }\n\n /**\n * @event vaadin-overlay-open\n * fired after the `vaadin-overlay` is opened.\n *\n * @private\n */\n _openedChanged(opened, wasOpened) {\n if (!this._instance) {\n this._ensureTemplatized();\n }\n\n if (opened) {\n // Store focused node.\n this.__restoreFocusNode = this._getActiveElement();\n this._animatedOpening();\n\n afterNextRender(this, () => {\n if (this.focusTrap && !this.contains(document._activeElement || document.activeElement)) {\n this._cycleTab(0, 0);\n }\n\n const evt = new CustomEvent('vaadin-overlay-open', {bubbles: true});\n this.dispatchEvent(evt);\n });\n\n if (!this.modeless) {\n this._addGlobalListeners();\n }\n } else if (wasOpened) {\n this._animatedClosing();\n\n if (!this.modeless) {\n this._removeGlobalListeners();\n }\n }\n }\n\n /** @private */\n _hiddenChanged(hidden) {\n if (hidden && this.hasAttribute('closing')) {\n this._flushAnimation('closing');\n }\n }\n\n /**\n * @return {boolean}\n * @protected\n */\n _shouldAnimate() {\n const name = getComputedStyle(this).getPropertyValue('animation-name');\n const hidden = getComputedStyle(this).getPropertyValue('display') === 'none';\n return !hidden && name && name != 'none';\n }\n\n /**\n * @param {string} type\n * @param {Function} callback\n * @protected\n */\n _enqueueAnimation(type, callback) {\n const handler = `__${type}Handler`;\n const listener = event => {\n if (event && event.target !== this) {\n return;\n }\n callback();\n this.removeEventListener('animationend', listener);\n delete this[handler];\n };\n this[handler] = listener;\n this.addEventListener('animationend', listener);\n }\n\n /**\n * @param {string} type\n * @protected\n */\n _flushAnimation(type) {\n const handler = `__${type}Handler`;\n if (typeof this[handler] === 'function') {\n this[handler]();\n }\n }\n\n /** @protected */\n _animatedOpening() {\n if (this.parentNode === document.body && this.hasAttribute('closing')) {\n this._flushAnimation('closing');\n }\n this._attachOverlay();\n if (!this.modeless) {\n this._enterModalState();\n }\n this.setAttribute('opening', '');\n\n const finishOpening = () => {\n document.addEventListener('iron-overlay-canceled', this._boundIronOverlayCanceledListener);\n\n this.removeAttribute('opening');\n };\n\n if (this._shouldAnimate()) {\n this._enqueueAnimation('opening', finishOpening);\n } else {\n finishOpening();\n }\n }\n\n /** @protected */\n _attachOverlay() {\n this._placeholder = document.createComment('vaadin-overlay-placeholder');\n this.parentNode.insertBefore(this._placeholder, this);\n document.body.appendChild(this);\n this.bringToFront();\n }\n\n /** @protected */\n _animatedClosing() {\n if (this.hasAttribute('opening')) {\n this._flushAnimation('opening');\n }\n if (this._placeholder) {\n this._exitModalState();\n\n if (this.restoreFocusOnClose && this.__restoreFocusNode) {\n // If the activeElement is `<body>` or inside the overlay,\n // we are allowed to restore the focus. In all the other\n // cases focus might have been moved elsewhere by another\n // component or by the user interaction (e.g. click on a\n // button outside the overlay).\n const activeElement = this._getActiveElement();\n\n if (activeElement === document.body || this._deepContains(activeElement)) {\n this.__restoreFocusNode.focus();\n }\n this.__restoreFocusNode = null;\n }\n\n this.setAttribute('closing', '');\n\n const finishClosing = () => {\n document.removeEventListener('iron-overlay-canceled', this._boundIronOverlayCanceledListener);\n this._detachOverlay();\n this.shadowRoot.querySelector('[part=\"overlay\"]').style.removeProperty('pointer-events');\n this.removeAttribute('closing');\n };\n\n if (this._shouldAnimate()) {\n this._enqueueAnimation('closing', finishClosing);\n } else {\n finishClosing();\n }\n }\n }\n\n /** @protected */\n _detachOverlay() {\n this._placeholder.parentNode.insertBefore(this, this._placeholder);\n this._placeholder.parentNode.removeChild(this._placeholder);\n }\n\n /**\n * Returns all attached overlays in visual stacking order.\n * @private\n */\n static get __attachedInstances() {\n return Array.from(document.body.children)\n .filter(el => el instanceof OverlayElement && !el.hasAttribute('closing'))\n .sort((a, b) => (a.__zIndex - b.__zIndex) || 0);\n }\n\n /**\n * returns true if this is the last one in the opened overlays stack\n * @return {boolean}\n * @protected\n */\n get _last() {\n return this === OverlayElement.__attachedInstances.pop();\n }\n\n /** @private */\n _modelessChanged(modeless) {\n if (!modeless) {\n if (this.opened) {\n this._addGlobalListeners();\n this._enterModalState();\n }\n } else {\n this._removeGlobalListeners();\n this._exitModalState();\n }\n }\n\n /** @protected */\n _addGlobalListeners() {\n document.addEventListener('mousedown', this._boundMouseDownListener);\n document.addEventListener('mouseup', this._boundMouseUpListener);\n // Firefox leaks click to document on contextmenu even if prevented\n // https://bugzilla.mozilla.org/show_bug.cgi?id=990614\n document.documentElement.addEventListener('click', this._boundOutsideClickListener, true);\n document.addEventListener('keydown', this._boundKeydownListener);\n }\n\n /** @protected */\n _enterModalState() {\n if (document.body.style.pointerEvents !== 'none') {\n // Set body pointer-events to 'none' to disable mouse interactions with\n // other document nodes.\n this._previousDocumentPointerEvents = document.body.style.pointerEvents;\n document.body.style.pointerEvents = 'none';\n }\n\n // Disable pointer events in other attached overlays\n OverlayElement.__attachedInstances.forEach(el => {\n if (el !== this) {\n el.shadowRoot.querySelector('[part=\"overlay\"]').style.pointerEvents = 'none';\n }\n });\n }\n\n /** @protected */\n _removeGlobalListeners() {\n document.removeEventListener('mousedown', this._boundMouseDownListener);\n document.removeEventListener('mouseup', this._boundMouseUpListener);\n document.documentElement.removeEventListener('click', this._boundOutsideClickListener, true);\n document.removeEventListener('keydown', this._boundKeydownListener);\n }\n\n /** @protected */\n _exitModalState() {\n if (this._previousDocumentPointerEvents !== undefined) {\n // Restore body pointer-events\n document.body.style.pointerEvents = this._previousDocumentPointerEvents;\n delete this._previousDocumentPointerEvents;\n }\n\n // Restore pointer events in the previous overlay(s)\n const instances = OverlayElement.__attachedInstances;\n let el;\n // Use instances.pop() to ensure the reverse order\n while (el = instances.pop()) {\n if (el === this) {\n // Skip the current instance\n continue;\n }\n el.shadowRoot.querySelector('[part=\"overlay\"]').style.removeProperty('pointer-events');\n if (!el.modeless) {\n // Stop after the last modal\n break;\n }\n }\n }\n\n /** @protected */\n _removeOldContent() {\n if (!this.content || !this._contentNodes) {\n return;\n }\n\n this._observer.disconnect();\n\n this._contentNodes.forEach(node => {\n if (node.parentNode === this.content) {\n this.content.removeChild(node);\n }\n });\n\n if (this._originalContentPart) {\n // Restore the original <div part=\"content\">\n this.$.content.parentNode.replaceChild(this._originalContentPart, this.$.content);\n this.$.content = this._originalContentPart;\n this._originalContentPart = undefined;\n }\n\n this._observer.connect();\n\n this._contentNodes = undefined;\n this.content = undefined;\n }\n\n /**\n * @param {!HTMLTemplateElement} template\n * @param {object} instanceProps\n * @protected\n */\n _stampOverlayTemplate(template, instanceProps) {\n this._removeOldContent();\n\n if (!template._Templatizer) {\n template._Templatizer = templatize(template, this, {\n instanceProps: instanceProps,\n forwardHostProp: function(prop, value) {\n if (this._instance) {\n this._instance.forwardHostProp(prop, value);\n }\n }\n });\n }\n\n this._instance = new template._Templatizer({});\n this._contentNodes = Array.from(this._instance.root.childNodes);\n\n const templateRoot = template._templateRoot || (template._templateRoot = template.getRootNode());\n const _isScoped = templateRoot !== document;\n\n if (_isScoped) {\n const isShady = window.ShadyCSS && !window.ShadyCSS.nativeShadow;\n\n if (!this.$.content.shadowRoot) {\n this.$.content.attachShadow({mode: 'open'});\n }\n\n let scopeCssText = Array.from(templateRoot.querySelectorAll('style'))\n .reduce((result, style) => result + style.textContent, '');\n\n if (isShady) {\n // NOTE(platosha): ShadyCSS removes <style>’s from templates, so\n // we have to use these protected APIs to get their contents back\n const styleInfo = window.ShadyCSS.ScopingShim\n ._styleInfoForNode(templateRoot.host);\n if (styleInfo) {\n scopeCssText += styleInfo._getStyleRules().parsedCssText;\n scopeCssText += '}';\n }\n }\n\n // The overlay root’s :host styles should not apply inside the overlay\n scopeCssText = scopeCssText.replace(/:host/g, ':host-nomatch');\n\n if (scopeCssText) {\n if (isShady) {\n // ShadyDOM: replace the <div part=\"content\"> with a generated\n // styled custom element\n const contentPart = createOverlayContent(scopeCssText);\n contentPart.id = 'content';\n contentPart.setAttribute('part', 'content');\n this.$.content.parentNode.replaceChild(contentPart, this.$.content);\n // NOTE(platosha): carry the style scope of the content part\n contentPart.className = this.$.content.className;\n this._originalContentPart = this.$.content;\n this.$.content = contentPart;\n } else {\n // Shadow DOM: append a style to the content shadowRoot\n const style = document.createElement('style');\n style.textContent = scopeCssText;\n this.$.content.shadowRoot.appendChild(style);\n this._contentNodes.unshift(style);\n }\n }\n\n this.$.content.shadowRoot.appendChild(this._instance.root);\n this.content = this.$.content.shadowRoot;\n } else {\n this.appendChild(this._instance.root);\n this.content = this;\n }\n }\n\n /** @private */\n _removeNewRendererOrTemplate(template, oldTemplate, renderer, oldRenderer) {\n if (template !== oldTemplate) {\n this.template = undefined;\n } else if (renderer !== oldRenderer) {\n this.renderer = undefined;\n }\n }\n\n /**\n * Manually invoke existing renderer.\n */\n render() {\n if (this.renderer) {\n this.renderer.call(this.owner, this.content, this.owner, this.model);\n }\n }\n\n /** @private */\n _templateOrRendererChanged(template, renderer, owner, model, instanceProps, opened) {\n if (template && renderer) {\n this._removeNewRendererOrTemplate(template, this._oldTemplate, renderer, this._oldRenderer);\n throw new Error('You should only use either a renderer or a template for overlay content');\n }\n\n const ownerOrModelChanged = (this._oldOwner !== owner || this._oldModel !== model);\n this._oldModel = model;\n this._oldOwner = owner;\n\n const templateOrInstancePropsChanged = (this._oldInstanceProps !== instanceProps || this._oldTemplate !== template);\n this._oldInstanceProps = instanceProps;\n this._oldTemplate = template;\n\n const rendererChanged = this._oldRenderer !== renderer;\n this._oldRenderer = renderer;\n\n const openedChanged = this._oldOpened !== opened;\n this._oldOpened = opened;\n\n if (template && templateOrInstancePropsChanged) {\n this._stampOverlayTemplate(template, instanceProps);\n } else if (renderer && (rendererChanged || openedChanged || ownerOrModelChanged)) {\n this.content = this;\n\n if (rendererChanged) {\n while (this.content.firstChild) {\n this.content.removeChild(this.content.firstChild);\n }\n }\n\n if (opened) {\n this.render();\n }\n }\n }\n\n /**\n * @param {Element} element\n * @return {boolean}\n * @protected\n */\n _isFocused(element) {\n return element && element.getRootNode().activeElement === element;\n }\n\n /**\n * @param {Element[]} elements\n * @return {number}\n * @protected\n */\n _focusedIndex(elements) {\n elements = elements || this._getFocusableElements();\n return elements.indexOf(elements.filter(this._isFocused).pop());\n }\n\n /**\n * @param {number} increment\n * @param {number | undefined} index\n * @protected\n */\n _cycleTab(increment, index) {\n const focusableElements = this._getFocusableElements();\n\n if (index === undefined) {\n index = this._focusedIndex(focusableElements);\n }\n\n index += increment;\n\n // rollover to first item\n if (index >= focusableElements.length) {\n index = 0;\n // go to last item\n } else if (index < 0) {\n index = focusableElements.length - 1;\n }\n\n focusableElements[index].focus();\n }\n\n /**\n * @return {!Array<!HTMLElement>}\n * @protected\n */\n _getFocusableElements() {\n // collect all focusable elements\n return FocusablesHelper.getTabbableNodes(this.$.overlay);\n }\n\n /**\n * @return {!Element}\n * @protected\n */\n _getActiveElement() {\n let active = document._activeElement || document.activeElement;\n // document.activeElement can be null\n // https://developer.mozilla.org/en-US/docs/Web/API/Document/activeElement\n // In IE 11, it can also be an object when operating in iframes\n // or document.documentElement (when overlay closed on outside click).\n // In these cases, default it to document.body.\n if (!active || active === document.documentElement || active instanceof Element === false) {\n active = document.body;\n }\n while (active.shadowRoot && active.shadowRoot.activeElement) {\n active = active.shadowRoot.activeElement;\n }\n return active;\n }\n\n /**\n * @param {!Node} node\n * @return {boolean}\n * @protected\n */\n _deepContains(node) {\n if (this.contains(node)) {\n return true;\n }\n let n = node;\n const doc = node.ownerDocument;\n // walk from node to `this` or `document`\n while (n && n !== doc && n !== this) {\n n = n.parentNode || n.host;\n }\n return n === this;\n }\n\n /**\n * Brings the overlay as visually the frontmost one\n */\n bringToFront() {\n let zIndex = '';\n const frontmost = OverlayElement.__attachedInstances.filter(o => o !== this).pop();\n if (frontmost) {\n const frontmostZIndex = frontmost.__zIndex;\n zIndex = frontmostZIndex + 1;\n }\n this.style.zIndex = zIndex;\n this.__zIndex = zIndex || parseFloat(getComputedStyle(this).zIndex);\n }\n}\n\ncustomElements.define(OverlayElement.is, OverlayElement);\nexport { OverlayElement };\n","/**\n@license\nCopyright (c) 2017 Vaadin Ltd.\nThis program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n*/\nimport { OverlayElement } from '@vaadin/vaadin-overlay/src/vaadin-overlay.js';\n\nimport { DisableUpgradeMixin } from '@polymer/polymer/lib/mixins/disable-upgrade-mixin.js';\n/**\n * The overlay element.\n *\n * ### Styling\n *\n * See [`<vaadin-overlay>` documentation](https://github.com/vaadin/vaadin-overlay/blob/master/src/vaadin-overlay.html)\n * for `<vaadin-date-picker-overlay>` parts.\n *\n * See [ThemableMixin – how to apply styles for shadow parts](https://github.com/vaadin/vaadin-themable-mixin/wiki)\n *\n * @extends Vaadin.OverlayElement\n * @memberof Vaadin\n * @private\n */\nclass DatePickerOverlayElement extends DisableUpgradeMixin(OverlayElement) {\n static get is() {\n return 'vaadin-date-picker-overlay';\n }\n}\n\ncustomElements.define(DatePickerOverlayElement.is, DatePickerOverlayElement);\n","/**\n@license\nCopyright (c) 2015 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at\nhttp://polymer.github.io/LICENSE.txt The complete set of authors may be found at\nhttp://polymer.github.io/AUTHORS.txt The complete set of contributors may be\nfound at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as\npart of the polymer project is also subject to an additional IP rights grant\nfound at http://polymer.github.io/PATENTS.txt\n*/\nimport '@polymer/polymer/polymer-legacy.js';\n\n/**\n * Chrome uses an older version of DOM Level 3 Keyboard Events\n *\n * Most keys are labeled as text, but some are Unicode codepoints.\n * Values taken from:\n * http://www.w3.org/TR/2007/WD-DOM-Level-3-Events-20071221/keyset.html#KeySet-Set\n */\nvar KEY_IDENTIFIER = {\n 'U+0008': 'backspace',\n 'U+0009': 'tab',\n 'U+001B': 'esc',\n 'U+0020': 'space',\n 'U+007F': 'del'\n};\n\n/**\n * Special table for KeyboardEvent.keyCode.\n * KeyboardEvent.keyIdentifier is better, and KeyBoardEvent.key is even better\n * than that.\n *\n * Values from:\n * https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent.keyCode#Value_of_keyCode\n */\nvar KEY_CODE = {\n 8: 'backspace',\n 9: 'tab',\n 13: 'enter',\n 27: 'esc',\n 33: 'pageup',\n 34: 'pagedown',\n 35: 'end',\n 36: 'home',\n 32: 'space',\n 37: 'left',\n 38: 'up',\n 39: 'right',\n 40: 'down',\n 46: 'del',\n 106: '*'\n};\n\n/**\n * MODIFIER_KEYS maps the short name for modifier keys used in a key\n * combo string to the property name that references those same keys\n * in a KeyboardEvent instance.\n */\nvar MODIFIER_KEYS = {\n 'shift': 'shiftKey',\n 'ctrl': 'ctrlKey',\n 'alt': 'altKey',\n 'meta': 'metaKey'\n};\n\n/**\n * KeyboardEvent.key is mostly represented by printable character made by\n * the keyboard, with unprintable keys labeled nicely.\n *\n * However, on OS X, Alt+char can make a Unicode character that follows an\n * Apple-specific mapping. In this case, we fall back to .keyCode.\n */\nvar KEY_CHAR = /[a-z0-9*]/;\n\n/**\n * Matches a keyIdentifier string.\n */\nvar IDENT_CHAR = /U\\+/;\n\n/**\n * Matches arrow keys in Gecko 27.0+\n */\nvar ARROW_KEY = /^arrow/;\n\n/**\n * Matches space keys everywhere (notably including IE10's exceptional name\n * `spacebar`).\n */\nvar SPACE_KEY = /^space(bar)?/;\n\n/**\n * Matches ESC key.\n *\n * Value from: http://w3c.github.io/uievents-key/#key-Escape\n */\nvar ESC_KEY = /^escape$/;\n\n/**\n * Transforms the key.\n * @param {string} key The KeyBoardEvent.key\n * @param {Boolean} [noSpecialChars] Limits the transformation to\n * alpha-numeric characters.\n */\nfunction transformKey(key, noSpecialChars) {\n var validKey = '';\n if (key) {\n var lKey = key.toLowerCase();\n if (lKey === ' ' || SPACE_KEY.test(lKey)) {\n validKey = 'space';\n } else if (ESC_KEY.test(lKey)) {\n validKey = 'esc';\n } else if (lKey.length == 1) {\n if (!noSpecialChars || KEY_CHAR.test(lKey)) {\n validKey = lKey;\n }\n } else if (ARROW_KEY.test(lKey)) {\n validKey = lKey.replace('arrow', '');\n } else if (lKey == 'multiply') {\n // numpad '*' can map to Multiply on IE/Windows\n validKey = '*';\n } else {\n validKey = lKey;\n }\n }\n return validKey;\n}\n\nfunction transformKeyIdentifier(keyIdent) {\n var validKey = '';\n if (keyIdent) {\n if (keyIdent in KEY_IDENTIFIER) {\n validKey = KEY_IDENTIFIER[keyIdent];\n } else if (IDENT_CHAR.test(keyIdent)) {\n keyIdent = parseInt(keyIdent.replace('U+', '0x'), 16);\n validKey = String.fromCharCode(keyIdent).toLowerCase();\n } else {\n validKey = keyIdent.toLowerCase();\n }\n }\n return validKey;\n}\n\nfunction transformKeyCode(keyCode) {\n var validKey = '';\n if (Number(keyCode)) {\n if (keyCode >= 65 && keyCode <= 90) {\n // ascii a-z\n // lowercase is 32 offset from uppercase\n validKey = String.fromCharCode(32 + keyCode);\n } else if (keyCode >= 112 && keyCode <= 123) {\n // function keys f1-f12\n validKey = 'f' + (keyCode - 112 + 1);\n } else if (keyCode >= 48 && keyCode <= 57) {\n // top 0-9 keys\n validKey = String(keyCode - 48);\n } else if (keyCode >= 96 && keyCode <= 105) {\n // num pad 0-9\n validKey = String(keyCode - 96);\n } else {\n validKey = KEY_CODE[keyCode];\n }\n }\n return validKey;\n}\n\n/**\n * Calculates the normalized key for a KeyboardEvent.\n * @param {KeyboardEvent} keyEvent\n * @param {Boolean} [noSpecialChars] Set to true to limit keyEvent.key\n * transformation to alpha-numeric chars. This is useful with key\n * combinations like shift + 2, which on FF for MacOS produces\n * keyEvent.key = @\n * To get 2 returned, set noSpecialChars = true\n * To get @ returned, set noSpecialChars = false\n */\nfunction normalizedKeyForEvent(keyEvent, noSpecialChars) {\n // Fall back from .key, to .detail.key for artifical keyboard events,\n // and then to deprecated .keyIdentifier and .keyCode.\n if (keyEvent.key) {\n return transformKey(keyEvent.key, noSpecialChars);\n }\n if (keyEvent.detail && keyEvent.detail.key) {\n return transformKey(keyEvent.detail.key, noSpecialChars);\n }\n return transformKeyIdentifier(keyEvent.keyIdentifier) ||\n transformKeyCode(keyEvent.keyCode) || '';\n}\n\nfunction keyComboMatchesEvent(keyCombo, event) {\n // For combos with modifiers we support only alpha-numeric keys\n var keyEvent = normalizedKeyForEvent(event, keyCombo.hasModifiers);\n return keyEvent === keyCombo.key &&\n (!keyCombo.hasModifiers ||\n (!!event.shiftKey === !!keyCombo.shiftKey &&\n !!event.ctrlKey === !!keyCombo.ctrlKey &&\n !!event.altKey === !!keyCombo.altKey &&\n !!event.metaKey === !!keyCombo.metaKey));\n}\n\nfunction parseKeyComboString(keyComboString) {\n if (keyComboString.length === 1) {\n return {combo: keyComboString, key: keyComboString, event: 'keydown'};\n }\n return keyComboString.split('+')\n .reduce(function(parsedKeyCombo, keyComboPart) {\n var eventParts = keyComboPart.split(':');\n var keyName = eventParts[0];\n var event = eventParts[1];\n\n if (keyName in MODIFIER_KEYS) {\n parsedKeyCombo[MODIFIER_KEYS[keyName]] = true;\n parsedKeyCombo.hasModifiers = true;\n } else {\n parsedKeyCombo.key = keyName;\n parsedKeyCombo.event = event || 'keydown';\n }\n\n return parsedKeyCombo;\n }, {combo: keyComboString.split(':').shift()});\n}\n\nfunction parseEventString(eventString) {\n return eventString.trim().split(' ').map(function(keyComboString) {\n return parseKeyComboString(keyComboString);\n });\n}\n\n/**\n * `Polymer.IronA11yKeysBehavior` provides a normalized interface for processing\n * keyboard commands that pertain to [WAI-ARIA best\n * practices](http://www.w3.org/TR/wai-aria-practices/#kbd_general_binding). The\n * element takes care of browser differences with respect to Keyboard events and\n * uses an expressive syntax to filter key presses.\n *\n * Use the `keyBindings` prototype property to express what combination of keys\n * will trigger the callback. A key binding has the format\n * `\"KEY+MODIFIER:EVENT\": \"callback\"` (`\"KEY\": \"callback\"` or\n * `\"KEY:EVENT\": \"callback\"` are valid as well). Some examples:\n *\n * keyBindings: {\n * 'space': '_onKeydown', // same as 'space:keydown'\n * 'shift+tab': '_onKeydown',\n * 'enter:keypress': '_onKeypress',\n * 'esc:keyup': '_onKeyup'\n * }\n *\n * The callback will receive with an event containing the following information\n * in `event.detail`:\n *\n * _onKeydown: function(event) {\n * console.log(event.detail.combo); // KEY+MODIFIER, e.g. \"shift+tab\"\n * console.log(event.detail.key); // KEY only, e.g. \"tab\"\n * console.log(event.detail.event); // EVENT, e.g. \"keydown\"\n * console.log(event.detail.keyboardEvent); // the original KeyboardEvent\n * }\n *\n * Use the `keyEventTarget` attribute to set up event handlers on a specific\n * node.\n *\n * See the [demo source\n * code](https://github.com/PolymerElements/iron-a11y-keys-behavior/blob/master/demo/x-key-aware.html)\n * for an example.\n *\n * @demo demo/index.html\n * @polymerBehavior\n */\nexport const IronA11yKeysBehavior = {\n properties: {\n /**\n * The EventTarget that will be firing relevant KeyboardEvents. Set it to\n * `null` to disable the listeners.\n * @type {?EventTarget}\n */\n keyEventTarget: {\n type: Object,\n value: function() {\n return this;\n }\n },\n\n /**\n * If true, this property will cause the implementing element to\n * automatically stop propagation on any handled KeyboardEvents.\n */\n stopKeyboardEventPropagation: {type: Boolean, value: false},\n\n _boundKeyHandlers: {\n type: Array,\n value: function() {\n return [];\n }\n },\n\n // We use this due to a limitation in IE10 where instances will have\n // own properties of everything on the \"prototype\".\n _imperativeKeyBindings: {\n type: Object,\n value: function() {\n return {};\n }\n }\n },\n\n observers: ['_resetKeyEventListeners(keyEventTarget, _boundKeyHandlers)'],\n\n\n /**\n * To be used to express what combination of keys will trigger the relative\n * callback. e.g. `keyBindings: { 'esc': '_onEscPressed'}`\n * @type {!Object}\n */\n keyBindings: {},\n\n registered: function() {\n this._prepKeyBindings();\n },\n\n attached: function() {\n this._listenKeyEventListeners();\n },\n\n detached: function() {\n this._unlistenKeyEventListeners();\n },\n\n /**\n * Can be used to imperatively add a key binding to the implementing\n * element. This is the imperative equivalent of declaring a keybinding\n * in the `keyBindings` prototype property.\n *\n * @param {string} eventString\n * @param {string} handlerName\n */\n addOwnKeyBinding: function(eventString, handlerName) {\n this._imperativeKeyBindings[eventString] = handlerName;\n this._prepKeyBindings();\n this._resetKeyEventListeners();\n },\n\n /**\n * When called, will remove all imperatively-added key bindings.\n */\n removeOwnKeyBindings: function() {\n this._imperativeKeyBindings = {};\n this._prepKeyBindings();\n this._resetKeyEventListeners();\n },\n\n /**\n * Returns true if a keyboard event matches `eventString`.\n *\n * @param {KeyboardEvent} event\n * @param {string} eventString\n * @return {boolean}\n */\n keyboardEventMatchesKeys: function(event, eventString) {\n var keyCombos = parseEventString(eventString);\n for (var i = 0; i < keyCombos.length; ++i) {\n if (keyComboMatchesEvent(keyCombos[i], event)) {\n return true;\n }\n }\n return false;\n },\n\n _collectKeyBindings: function() {\n var keyBindings = this.behaviors.map(function(behavior) {\n return behavior.keyBindings;\n });\n\n if (keyBindings.indexOf(this.keyBindings) === -1) {\n keyBindings.push(this.keyBindings);\n }\n\n return keyBindings;\n },\n\n _prepKeyBindings: function() {\n this._keyBindings = {};\n\n this._collectKeyBindings().forEach(function(keyBindings) {\n for (var eventString in keyBindings) {\n this._addKeyBinding(eventString, keyBindings[eventString]);\n }\n }, this);\n\n for (var eventString in this._imperativeKeyBindings) {\n this._addKeyBinding(\n eventString, this._imperativeKeyBindings[eventString]);\n }\n\n // Give precedence to combos with modifiers to be checked first.\n for (var eventName in this._keyBindings) {\n this._keyBindings[eventName].sort(function(kb1, kb2) {\n var b1 = kb1[0].hasModifiers;\n var b2 = kb2[0].hasModifiers;\n return (b1 === b2) ? 0 : b1 ? -1 : 1;\n })\n }\n },\n\n _addKeyBinding: function(eventString, handlerName) {\n parseEventString(eventString).forEach(function(keyCombo) {\n this._keyBindings[keyCombo.event] =\n this._keyBindings[keyCombo.event] || [];\n\n this._keyBindings[keyCombo.event].push([keyCombo, handlerName]);\n }, this);\n },\n\n _resetKeyEventListeners: function() {\n this._unlistenKeyEventListeners();\n\n if (this.isAttached) {\n this._listenKeyEventListeners();\n }\n },\n\n _listenKeyEventListeners: function() {\n if (!this.keyEventTarget) {\n return;\n }\n Object.keys(this._keyBindings).forEach(function(eventName) {\n var keyBindings = this._keyBindings[eventName];\n var boundKeyHandler = this._onKeyBindingEvent.bind(this, keyBindings);\n\n this._boundKeyHandlers.push(\n [this.keyEventTarget, eventName, boundKeyHandler]);\n\n this.keyEventTarget.addEventListener(eventName, boundKeyHandler);\n }, this);\n },\n\n _unlistenKeyEventListeners: function() {\n var keyHandlerTuple;\n var keyEventTarget;\n var eventName;\n var boundKeyHandler;\n\n while (this._boundKeyHandlers.length) {\n // My kingdom for block-scope binding and destructuring assignment..\n keyHandlerTuple = this._boundKeyHandlers.pop();\n keyEventTarget = keyHandlerTuple[0];\n eventName = keyHandlerTuple[1];\n boundKeyHandler = keyHandlerTuple[2];\n\n keyEventTarget.removeEventListener(eventName, boundKeyHandler);\n }\n },\n\n _onKeyBindingEvent: function(keyBindings, event) {\n if (this.stopKeyboardEventPropagation) {\n event.stopPropagation();\n }\n\n // if event has been already prevented, don't do anything\n if (event.defaultPrevented) {\n return;\n }\n\n for (var i = 0; i < keyBindings.length; i++) {\n var keyCombo = keyBindings[i][0];\n var handlerName = keyBindings[i][1];\n if (keyComboMatchesEvent(keyCombo, event)) {\n this._triggerKeyHandler(keyCombo, handlerName, event);\n // exit the loop if eventDefault was prevented\n if (event.defaultPrevented) {\n return;\n }\n }\n }\n },\n\n _triggerKeyHandler: function(keyCombo, handlerName, keyboardEvent) {\n var detail = Object.create(keyCombo);\n detail.keyboardEvent = keyboardEvent;\n var event =\n new CustomEvent(keyCombo.event, {detail: detail, cancelable: true});\n this[handlerName].call(this, event);\n if (event.defaultPrevented) {\n keyboardEvent.preventDefault();\n }\n }\n};\n","/**\n@license\nCopyright (c) 2015 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at\nhttp://polymer.github.io/LICENSE.txt The complete set of authors may be found at\nhttp://polymer.github.io/AUTHORS.txt The complete set of contributors may be\nfound at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as\npart of the polymer project is also subject to an additional IP rights grant\nfound at http://polymer.github.io/PATENTS.txt\n*/\nimport '@polymer/polymer/polymer-legacy.js';\n\nimport {Polymer} from '@polymer/polymer/lib/legacy/polymer-fn.js';\nimport {html} from '@polymer/polymer/lib/utils/html-tag.js';\n\n/**\n`iron-a11y-announcer` is a singleton element that is intended to add a11y\nto features that require on-demand announcement from screen readers. In\norder to make use of the announcer, it is best to request its availability\nin the announcing element.\n\nExample:\n\n Polymer({\n\n is: 'x-chatty',\n\n attached: function() {\n // This will create the singleton element if it has not\n // been created yet:\n Polymer.IronA11yAnnouncer.requestAvailability();\n }\n });\n\nAfter the `iron-a11y-announcer` has been made available, elements can\nmake announces by firing bubbling `iron-announce` events.\n\nExample:\n\n this.fire('iron-announce', {\n text: 'This is an announcement!'\n }, { bubbles: true });\n\nNote: announcements are only audible if you have a screen reader enabled.\n\n@demo demo/index.html\n*/\nexport const IronA11yAnnouncer = Polymer({\n /** @override */\n _template: html`\n <style>\n :host {\n display: inline-block;\n position: fixed;\n clip: rect(0px,0px,0px,0px);\n }\n </style>\n <div aria-live$=\"[[mode]]\">[[_text]]</div>\n`,\n\n is: 'iron-a11y-announcer',\n\n properties: {\n\n /**\n * The value of mode is used to set the `aria-live` attribute\n * for the element that will be announced. Valid values are: `off`,\n * `polite` and `assertive`.\n */\n mode: {type: String, value: 'polite'},\n\n /**\n * The timeout on refreshing the announcement text. Larger timeouts are\n * needed for certain screen readers to re-announce the same message.\n */\n timeout: {type: Number, value: 150},\n\n _text: {type: String, value: ''},\n },\n\n /** @override */\n created: function() {\n if (!IronA11yAnnouncer.instance) {\n IronA11yAnnouncer.instance = this;\n }\n\n document.addEventListener('iron-announce', this._onIronAnnounce.bind(this));\n },\n\n /**\n * Cause a text string to be announced by screen readers.\n *\n * @param {string} text The text that should be announced.\n */\n announce: function(text) {\n this._text = '';\n this.async(function() {\n this._text = text;\n }, this.timeout);\n },\n\n _onIronAnnounce: function(event) {\n if (event.detail && event.detail.text) {\n this.announce(event.detail.text);\n }\n }\n});\n\nIronA11yAnnouncer.instance = null;\n\nIronA11yAnnouncer.requestAvailability = function() {\n if (!IronA11yAnnouncer.instance) {\n IronA11yAnnouncer.instance = document.createElement('iron-a11y-announcer');\n }\n\n if (document.body) {\n document.body.appendChild(IronA11yAnnouncer.instance);\n } else {\n document.addEventListener('load', function() {\n document.body.appendChild(IronA11yAnnouncer.instance);\n });\n }\n};\n","/**\n@license\nCopyright (c) 2017 Vaadin Ltd.\nThis program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n*/\nexport const DatePickerHelper = class VaadinDatePickerHelper {\n /**\n * Get ISO 8601 week number for the given date.\n *\n * @param {Date} Date object\n * @return {Number} Week number\n */\n static _getISOWeekNumber(date) {\n // Ported from Vaadin Framework method com.vaadin.client.DateTimeService.getISOWeekNumber(date)\n var dayOfWeek = date.getDay(); // 0 == sunday\n\n // ISO 8601 use weeks that start on monday so we use\n // mon=1,tue=2,...sun=7;\n if (dayOfWeek === 0) {\n dayOfWeek = 7;\n }\n // Find nearest thursday (defines the week in ISO 8601). The week number\n // for the nearest thursday is the same as for the target date.\n var nearestThursdayDiff = 4 - dayOfWeek; // 4 is thursday\n var nearestThursday = new Date(date.getTime() + nearestThursdayDiff * 24 * 3600 * 1000);\n\n var firstOfJanuary = new Date(0, 0);\n firstOfJanuary.setFullYear(nearestThursday.getFullYear());\n\n var timeDiff = nearestThursday.getTime() - firstOfJanuary.getTime();\n\n // Rounding the result, as the division doesn't result in an integer\n // when the given date is inside daylight saving time period.\n var daysSinceFirstOfJanuary = Math.round(timeDiff / (24 * 3600 * 1000));\n\n return Math.floor((daysSinceFirstOfJanuary) / 7 + 1);\n }\n\n /**\n * Check if two dates are equal.\n *\n * @param {Date} date1\n * @param {Date} date2\n * @return {Boolean} True if the given date objects refer to the same date\n */\n static _dateEquals(date1, date2) {\n return date1 instanceof Date && date2 instanceof Date &&\n date1.getFullYear() === date2.getFullYear() &&\n date1.getMonth() === date2.getMonth() &&\n date1.getDate() === date2.getDate();\n }\n\n /**\n * Check if the given date is in the range of allowed dates.\n *\n * @param {Date} date The date to check\n * @param {Date} min Range start\n * @param {Date} max Range end\n * @return {Boolean} True if the date is in the range\n */\n static _dateAllowed(date, min, max) {\n return (!min || date >= min) && (!max || date <= max);\n }\n\n /**\n * Get closest date from array of dates.\n *\n * @param {Date} date The date to compare dates with\n * @param {Array} dates Array of date objects\n * @return {Date} Closest date\n */\n static _getClosestDate(date, dates) {\n return dates.filter(date => date !== undefined)\n .reduce((closestDate, candidate) => {\n if (!candidate) {\n return closestDate;\n }\n\n if (!closestDate) {\n return candidate;\n }\n\n var candidateDiff = Math.abs(date.getTime() - candidate.getTime());\n var closestDateDiff = Math.abs(closestDate.getTime() - date.getTime());\n return candidateDiff < closestDateDiff ? candidate : closestDate;\n });\n }\n\n /**\n * Extracts the basic component parts of a date (day, month and year)\n * to the expected format.\n */\n static _extractDateParts(date) {\n return {\n day: date.getDate(),\n month: date.getMonth(),\n year: date.getFullYear()\n };\n }\n};\n","/**\n@license\nCopyright (c) 2017 Vaadin Ltd.\nThis program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n*/\nimport { PolymerElement } from '@polymer/polymer/polymer-element.js';\n\nimport '@polymer/polymer/lib/elements/dom-repeat.js';\nimport { GestureEventListeners } from '@polymer/polymer/lib/mixins/gesture-event-listeners.js';\nimport { DatePickerHelper } from './vaadin-date-picker-helper.js';\nimport { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';\nimport { html } from '@polymer/polymer/lib/utils/html-tag.js';\n/**\n * @memberof Vaadin\n * @private\n */\nclass MonthCalendarElement extends ThemableMixin(GestureEventListeners(PolymerElement)) {\n static get template() {\n return html`\n <style>\n :host {\n display: block;\n }\n\n [part=\"weekdays\"],\n #days {\n display: flex;\n flex-wrap: wrap;\n flex-grow: 1;\n }\n\n #days-container,\n #weekdays-container {\n display: flex;\n }\n\n [part=\"week-numbers\"] {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n flex-shrink: 0;\n }\n\n [part=\"week-numbers\"][hidden],\n [part=\"weekday\"][hidden] {\n display: none;\n }\n\n [part=\"weekday\"],\n [part=\"date\"] {\n /* Would use calc(100% / 7) but it doesn't work nice on IE */\n width: 14.285714286%;\n }\n\n [part=\"weekday\"]:empty,\n [part=\"week-numbers\"] {\n width: 12.5%;\n flex-shrink: 0;\n }\n </style>\n\n <div part=\"month-header\" role=\"heading\">[[_getTitle(month, i18n.monthNames)]]</div>\n <div id=\"monthGrid\" on-tap=\"_handleTap\" on-touchend=\"_preventDefault\" on-touchstart=\"_onMonthGridTouchStart\">\n <div id=\"weekdays-container\">\n <div hidden=\"[[!_showWeekSeparator(showWeekNumbers, i18n.firstDayOfWeek)]]\" part=\"weekday\"></div>\n <div part=\"weekdays\">\n <template is=\"dom-repeat\" items=\"[[_getWeekDayNames(i18n.weekdays, i18n.weekdaysShort, showWeekNumbers, i18n.firstDayOfWeek)]]\">\n <div part=\"weekday\" role=\"heading\" aria-label\\$=\"[[item.weekDay]]\">[[item.weekDayShort]]</div>\n </template>\n </div>\n </div>\n <div id=\"days-container\">\n <div part=\"week-numbers\" hidden=\"[[!_showWeekSeparator(showWeekNumbers, i18n.firstDayOfWeek)]]\">\n <template is=\"dom-repeat\" items=\"[[_getWeekNumbers(_days)]]\">\n <div part=\"week-number\" role=\"heading\" aria-label\\$=\"[[i18n.week]] [[item]]\">[[item]]</div>\n </template>\n </div>\n <div id=\"days\">\n <template is=\"dom-repeat\" items=\"[[_days]]\">\n <div part=\"date\" today\\$=\"[[_isToday(item)]]\" selected\\$=\"[[_dateEquals(item, selectedDate)]]\" focused\\$=\"[[_dateEquals(item, focusedDate)]]\" date=\"[[item]]\" disabled\\$=\"[[!_dateAllowed(item, minDate, maxDate)]]\" role\\$=\"[[_getRole(item)]]\" aria-label\\$=\"[[_getAriaLabel(item)]]\" aria-disabled\\$=\"[[_getAriaDisabled(item, minDate, maxDate)]]\">[[_getDate(item)]]</div>\n </template>\n </div>\n </div>\n </div>\n`;\n }\n\n static get is() {\n return 'vaadin-month-calendar';\n }\n\n static get properties() {\n return {\n /**\n * A `Date` object defining the month to be displayed. Only year and\n * month properties are actually used.\n */\n month: {\n type: Date,\n value: new Date()\n },\n\n /**\n * A `Date` object for the currently selected date.\n */\n selectedDate: {\n type: Date,\n notify: true\n },\n\n /**\n * A `Date` object for the currently focused date.\n */\n focusedDate: Date,\n\n showWeekNumbers: {\n type: Boolean,\n value: false\n },\n\n i18n: {\n type: Object\n },\n\n /**\n * Flag stating whether taps on the component should be ignored.\n */\n ignoreTaps: Boolean,\n\n _notTapping: Boolean,\n\n /**\n * The earliest date that can be selected. All earlier dates will be disabled.\n */\n minDate: {\n type: Date,\n value: null\n },\n\n /**\n * The latest date that can be selected. All later dates will be disabled.\n */\n maxDate: {\n type: Date,\n value: null\n },\n\n _days: {\n type: Array,\n computed: '_getDays(month, i18n.firstDayOfWeek, minDate, maxDate)'\n },\n\n disabled: {\n type: Boolean,\n reflectToAttribute: true,\n computed: '_isDisabled(month, minDate, maxDate)'\n }\n };\n }\n\n static get observers() {\n return [\n '_showWeekNumbersChanged(showWeekNumbers, i18n.firstDayOfWeek)'\n ];\n }\n\n _dateEquals(date1, date2) {\n return DatePickerHelper._dateEquals(date1, date2);\n }\n\n _dateAllowed(date, min, max) {\n return DatePickerHelper._dateAllowed(date, min, max);\n }\n\n /* Returns true if all the dates in the month are out of the allowed range */\n _isDisabled(month, minDate, maxDate) {\n // First day of the month\n var firstDate = new Date(0, 0);\n firstDate.setFullYear(month.getFullYear());\n firstDate.setMonth(month.getMonth());\n firstDate.setDate(1);\n\n // Last day of the month\n var lastDate = new Date(0, 0);\n lastDate.setFullYear(month.getFullYear());\n lastDate.setMonth(month.getMonth() + 1);\n lastDate.setDate(0);\n\n if ((minDate && maxDate)\n && minDate.getMonth() === maxDate.getMonth()\n && minDate.getMonth() === month.getMonth()\n && maxDate.getDate() - minDate.getDate() >= 0) {\n return false;\n }\n\n return !this._dateAllowed(firstDate, minDate, maxDate)\n && !this._dateAllowed(lastDate, minDate, maxDate);\n }\n\n _getTitle(month, monthNames) {\n if (month === undefined || monthNames === undefined) {\n return;\n }\n return this.i18n.formatTitle(monthNames[month.getMonth()], month.getFullYear());\n }\n\n _onMonthGridTouchStart() {\n this._notTapping = false;\n setTimeout(() => this._notTapping = true, 300);\n }\n\n _dateAdd(date, delta) {\n date.setDate(date.getDate() + delta);\n }\n\n _applyFirstDayOfWeek(weekDayNames, firstDayOfWeek) {\n if (weekDayNames === undefined || firstDayOfWeek === undefined) {\n return;\n }\n\n return weekDayNames.slice(firstDayOfWeek).concat(weekDayNames.slice(0, firstDayOfWeek));\n }\n\n _getWeekDayNames(weekDayNames, weekDayNamesShort, showWeekNumbers, firstDayOfWeek) {\n if (weekDayNames === undefined || weekDayNamesShort === undefined ||\n showWeekNumbers === undefined || firstDayOfWeek === undefined) {\n return;\n }\n weekDayNames = this._applyFirstDayOfWeek(weekDayNames, firstDayOfWeek);\n weekDayNamesShort = this._applyFirstDayOfWeek(weekDayNamesShort, firstDayOfWeek);\n weekDayNames = weekDayNames.map((day, index) => {\n return {\n weekDay: day,\n weekDayShort: weekDayNamesShort[index]\n };\n });\n\n return weekDayNames;\n }\n\n _getDate(date) {\n return date ? date.getDate() : '';\n }\n\n _showWeekNumbersChanged(showWeekNumbers, firstDayOfWeek) {\n if (showWeekNumbers && firstDayOfWeek === 1) {\n this.setAttribute('week-numbers', '');\n } else {\n this.removeAttribute('week-numbers');\n }\n }\n\n _showWeekSeparator(showWeekNumbers, firstDayOfWeek) {\n // Currently only supported for locales that start the week on Monday.\n return showWeekNumbers && firstDayOfWeek === 1;\n }\n\n _isToday(date) {\n return this._dateEquals(new Date(), date);\n }\n\n _getDays(month, firstDayOfWeek) {\n if (month === undefined || firstDayOfWeek === undefined) {\n return;\n }\n // First day of the month (at midnight).\n var date = new Date(0, 0);\n date.setFullYear(month.getFullYear());\n date.setMonth(month.getMonth());\n date.setDate(1);\n\n // Rewind to first day of the week.\n while (date.getDay() !== firstDayOfWeek) {\n this._dateAdd(date, -1);\n }\n\n var days = [];\n var startMonth = date.getMonth();\n var targetMonth = month.getMonth();\n while (date.getMonth() === targetMonth || date.getMonth() === startMonth) {\n days.push(date.getMonth() === targetMonth ? new Date(date.getTime()) : null);\n\n // Advance to next day.\n this._dateAdd(date, 1);\n }\n return days;\n }\n\n _getWeekNumber(date, days) {\n if (date === undefined || days === undefined) {\n return;\n }\n\n if (!date) {\n // Get the first non-null date from the days array.\n date = days.reduce((acc, d) => {\n return !acc && d ? d : acc;\n });\n }\n\n return DatePickerHelper._getISOWeekNumber(date);\n }\n\n _getWeekNumbers(dates) {\n return dates\n .map(date => this._getWeekNumber(date, dates))\n .filter((week, index, arr) => arr.indexOf(week) === index);\n }\n\n _handleTap(e) {\n if (!this.ignoreTaps && !this._notTapping && e.target.date && !e.target.hasAttribute('disabled')) {\n this.selectedDate = e.target.date;\n this.dispatchEvent(new CustomEvent('date-tap', {bubbles: true, composed: true}));\n }\n }\n\n _preventDefault(e) {\n e.preventDefault();\n }\n\n _getRole(date) {\n return date ? 'button' : 'presentation';\n }\n\n _getAriaLabel(date) {\n if (!date) {\n return '';\n }\n\n var ariaLabel = this._getDate(date) + ' ' +\n this.i18n.monthNames[date.getMonth()] + ' ' +\n date.getFullYear() + ', ' +\n this.i18n.weekdays[date.getDay()];\n\n if (this._isToday(date)) {\n ariaLabel += ', ' + this.i18n.today;\n }\n\n return ariaLabel;\n }\n\n _getAriaDisabled(date, min, max) {\n if (date === undefined || min === undefined || max === undefined) {\n return;\n }\n return this._dateAllowed(date, min, max) ? 'false' : 'true';\n }\n}\n\ncustomElements.define(MonthCalendarElement.is, MonthCalendarElement);\n","/**\n@license\nCopyright (c) 2017 Vaadin Ltd.\nThis program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n*/\nimport { PolymerElement } from '@polymer/polymer/polymer-element.js';\n\nimport { timeOut } from '@polymer/polymer/lib/utils/async.js';\nimport { Debouncer } from '@polymer/polymer/lib/utils/debounce.js';\nimport { flush } from '@polymer/polymer/lib/utils/flush.js';\nimport { templatize } from '@polymer/polymer/lib/utils/templatize.js';\nimport { html } from '@polymer/polymer/lib/utils/html-tag.js';\nimport { afterNextRender } from '@polymer/polymer/lib/utils/render-status.js';\n/**\n * @memberof Vaadin\n * @private\n */\nclass InfiniteScrollerElement extends PolymerElement {\n static get template() {\n return html`\n <style>\n :host {\n display: block;\n overflow: hidden;\n height: 500px;\n }\n\n #scroller {\n position: relative;\n height: 100%;\n overflow: auto;\n outline: none;\n margin-right: -40px;\n -webkit-overflow-scrolling: touch;\n -ms-overflow-style: none;\n overflow-x: hidden;\n }\n\n #scroller.notouchscroll {\n -webkit-overflow-scrolling: auto;\n }\n\n #scroller::-webkit-scrollbar {\n display: none;\n }\n\n .buffer {\n position: absolute;\n width: var(--vaadin-infinite-scroller-buffer-width, 100%);\n box-sizing: border-box;\n padding-right: 40px;\n top: var(--vaadin-infinite-scroller-buffer-offset, 0);\n animation: fadein 0.2s;\n }\n\n @keyframes fadein {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n </style>\n\n <div id=\"scroller\" on-scroll=\"_scroll\">\n <div class=\"buffer\"></div>\n <div class=\"buffer\"></div>\n <div id=\"fullHeight\"></div>\n </div>\n`;\n }\n\n static get is() {\n return 'vaadin-infinite-scroller';\n }\n\n static get properties() {\n return {\n\n /**\n * Count of individual items in each buffer.\n * The scroller has 2 buffers altogether so bufferSize of 20\n * will result in 40 buffered DOM items in total.\n * Changing after initialization not supported.\n */\n bufferSize: {\n type: Number,\n value: 20\n },\n\n /**\n * The amount of initial scroll top. Needed in order for the\n * user to be able to scroll backwards.\n */\n _initialScroll: {\n value: 500000\n },\n\n /**\n * The index/position mapped at _initialScroll point.\n */\n _initialIndex: {\n value: 0\n },\n\n _buffers: Array,\n\n _preventScrollEvent: Boolean,\n\n _mayHaveMomentum: Boolean,\n\n _initialized: Boolean,\n\n active: {\n type: Boolean,\n observer: '_activated'\n }\n };\n }\n\n ready() {\n super.ready();\n\n this._buffers = Array.prototype.slice.call(this.root.querySelectorAll('.buffer'));\n\n this.$.fullHeight.style.height = this._initialScroll * 2 + 'px';\n\n var tpl = this.querySelector('template');\n this._TemplateClass = templatize(tpl, this, {\n forwardHostProp: function(prop, value) {\n if (prop !== 'index') {\n this._buffers.forEach(buffer => {\n [].forEach.call(buffer.children, insertionPoint => {\n insertionPoint._itemWrapper.instance[prop] = value;\n });\n });\n }\n }\n });\n\n // Firefox interprets elements with overflow:auto as focusable\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1069739\n var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;\n if (isFirefox) {\n this.$.scroller.tabIndex = -1;\n }\n }\n\n _activated(active) {\n if (active && !this._initialized) {\n this._createPool();\n this._initialized = true;\n }\n }\n\n _finishInit() {\n if (!this._initDone) {\n // Once the first set of items start fading in, stamp the rest\n this._buffers.forEach(buffer => {\n [].forEach.call(buffer.children,\n insertionPoint => this._ensureStampedInstance(insertionPoint._itemWrapper));\n }, this);\n\n if (!this._buffers[0].translateY) {\n this._reset();\n }\n\n this._initDone = true;\n }\n }\n\n _translateBuffer(up) {\n var index = up ? 1 : 0;\n this._buffers[index].translateY = this._buffers[(index ? 0 : 1)].translateY + this._bufferHeight * (index ? -1 : 1);\n this._buffers[index].style.transform = 'translate3d(0, ' + this._buffers[index].translateY + 'px, 0)';\n this._buffers[index].updated = false;\n this._buffers.reverse();\n }\n\n _scroll() {\n if (this._scrollDisabled) {\n return;\n }\n\n var scrollTop = this.$.scroller.scrollTop;\n if (scrollTop < this._bufferHeight || scrollTop > this._initialScroll * 2 - this._bufferHeight) {\n // Scrolled near the end/beginning of the scrollable area -> reset.\n this._initialIndex = ~~this.position;\n this._reset();\n }\n\n // Check if we scrolled enough to translate the buffer positions.\n var bufferOffset = this.root.querySelector('.buffer').offsetTop;\n var upperThresholdReached = scrollTop > this._buffers[1].translateY + this.itemHeight + bufferOffset;\n var lowerThresholdReached = scrollTop < this._buffers[0].translateY + this.itemHeight + bufferOffset;\n\n if (upperThresholdReached || lowerThresholdReached) {\n this._translateBuffer(lowerThresholdReached);\n this._updateClones();\n }\n\n if (!this._preventScrollEvent) {\n this.dispatchEvent(new CustomEvent('custom-scroll', {bubbles: false, composed: true}));\n this._mayHaveMomentum = true;\n }\n this._preventScrollEvent = false;\n\n this._debouncerScrollFinish = Debouncer.debounce(this._debouncerScrollFinish,\n timeOut.after(200), () => {\n var scrollerRect = this.$.scroller.getBoundingClientRect();\n if (!this._isVisible(this._buffers[0], scrollerRect) && !this._isVisible(this._buffers[1], scrollerRect)) {\n this.position = this.position;\n }\n });\n }\n\n /**\n * Current scroller position as index. Can be a fractional number.\n *\n * @type {Number}\n */\n set position(index) {\n this._preventScrollEvent = true;\n if (index > this._firstIndex && index < this._firstIndex + this.bufferSize * 2) {\n this.$.scroller.scrollTop = this.itemHeight * (index - this._firstIndex) + this._buffers[0].translateY;\n } else {\n this._initialIndex = ~~index;\n this._reset();\n this._scrollDisabled = true;\n this.$.scroller.scrollTop += index % 1 * this.itemHeight;\n this._scrollDisabled = false;\n }\n\n if (this._mayHaveMomentum) {\n // Stop the possible iOS Safari momentum with -webkit-overflow-scrolling: auto;\n this.$.scroller.classList.add('notouchscroll');\n this._mayHaveMomentum = false;\n\n setTimeout(() => {\n // Restore -webkit-overflow-scrolling: touch; after a small delay.\n this.$.scroller.classList.remove('notouchscroll');\n }, 10);\n }\n\n }\n\n /**\n * @private\n */\n get position() {\n return (this.$.scroller.scrollTop - this._buffers[0].translateY) / this.itemHeight + this._firstIndex;\n }\n\n get itemHeight() {\n if (!this._itemHeightVal) {\n if (!(window.ShadyCSS && window.ShadyCSS.nativeCss)) {\n this.updateStyles();\n }\n\n const itemHeight = window.ShadyCSS\n ? window.ShadyCSS.getComputedStyleValue(this, '--vaadin-infinite-scroller-item-height')\n : getComputedStyle(this).getPropertyValue('--vaadin-infinite-scroller-item-height');\n // Use background-position temp inline style for unit conversion\n const tmpStyleProp = 'background-position';\n this.$.fullHeight.style.setProperty(tmpStyleProp, itemHeight);\n const itemHeightPx = getComputedStyle(this.$.fullHeight).getPropertyValue(tmpStyleProp);\n this.$.fullHeight.style.removeProperty(tmpStyleProp);\n this._itemHeightVal = parseFloat(itemHeightPx);\n }\n\n return this._itemHeightVal;\n }\n\n get _bufferHeight() {\n return this.itemHeight * this.bufferSize;\n }\n\n _reset() {\n this._scrollDisabled = true;\n this.$.scroller.scrollTop = this._initialScroll;\n this._buffers[0].translateY = this._initialScroll - this._bufferHeight;\n this._buffers[1].translateY = this._initialScroll;\n this._buffers.forEach(buffer => {\n buffer.style.transform = 'translate3d(0, ' + buffer.translateY + 'px, 0)';\n });\n this._buffers[0].updated = this._buffers[1].updated = false;\n this._updateClones(true);\n\n this._debouncerUpdateClones = Debouncer.debounce(\n this._debouncerUpdateClones,\n timeOut.after(200), () => {\n this._buffers[0].updated = this._buffers[1].updated = false;\n this._updateClones();\n });\n\n this._scrollDisabled = false;\n }\n\n _createPool() {\n var container = this.getBoundingClientRect();\n this._buffers.forEach(buffer => {\n for (var i = 0; i < this.bufferSize; i++) {\n const itemWrapper = document.createElement('div');\n itemWrapper.style.height = this.itemHeight + 'px';\n itemWrapper.instance = {};\n\n const contentId = InfiniteScrollerElement._contentIndex = InfiniteScrollerElement._contentIndex + 1 || 0;\n const slotName = 'vaadin-infinite-scroller-item-content-' + contentId;\n\n const insertionPoint = document.createElement('slot');\n insertionPoint.setAttribute('name', slotName);\n insertionPoint._itemWrapper = itemWrapper;\n buffer.appendChild(insertionPoint);\n\n itemWrapper.setAttribute('slot', slotName);\n this.appendChild(itemWrapper);\n\n // This is needed by IE\n flush();\n\n setTimeout(() => {\n // Only stamp the visible instances first\n if (this._isVisible(itemWrapper, container)) {\n this._ensureStampedInstance(itemWrapper);\n }\n }, 1); // Wait for first reset\n }\n }, this);\n\n setTimeout(() => {\n afterNextRender(this, this._finishInit.bind(this));\n }, 1);\n }\n\n _ensureStampedInstance(itemWrapper) {\n if (itemWrapper.firstElementChild) {\n return;\n }\n\n var tmpInstance = itemWrapper.instance;\n\n itemWrapper.instance = new this._TemplateClass({});\n itemWrapper.appendChild(itemWrapper.instance.root);\n\n Object.keys(tmpInstance).forEach(prop => {\n itemWrapper.instance.set(prop, tmpInstance[prop]);\n });\n }\n\n _updateClones(viewPortOnly) {\n this._firstIndex = ~~((this._buffers[0].translateY - this._initialScroll) / this.itemHeight) + this._initialIndex;\n\n var scrollerRect = viewPortOnly ? this.$.scroller.getBoundingClientRect() : undefined;\n this._buffers.forEach((buffer, bufferIndex) => {\n if (!buffer.updated) {\n var firstIndex = this._firstIndex + this.bufferSize * bufferIndex;\n\n [].forEach.call(buffer.children, (insertionPoint, index) => {\n const itemWrapper = insertionPoint._itemWrapper;\n if (!viewPortOnly || this._isVisible(itemWrapper, scrollerRect)) {\n itemWrapper.instance.index = firstIndex + index;\n }\n });\n buffer.updated = true;\n }\n }, this);\n }\n\n _isVisible(element, container) {\n var rect = element.getBoundingClientRect();\n return rect.bottom > container.top && rect.top < container.bottom;\n }\n}\n\ncustomElements.define(InfiniteScrollerElement.is, InfiniteScrollerElement);\n","import '@polymer/polymer/lib/elements/custom-style.js';\nconst $_documentContainer = document.createElement('template');\n\n$_documentContainer.innerHTML = `<dom-module id=\"vaadin-date-picker-overlay-styles\" theme-for=\"vaadin-date-picker-overlay\">\n <template>\n <style>\n :host {\n align-items: flex-start;\n justify-content: flex-start;\n }\n\n :host([bottom-aligned]) {\n justify-content: flex-end;\n }\n\n :host([right-aligned]) {\n align-items: flex-end;\n }\n\n :host([right-aligned][dir=\"rtl\"]) {\n align-items: flex-start;\n }\n\n [part=\"overlay\"] {\n display: flex;\n flex: auto;\n }\n\n [part~=\"content\"] {\n flex: auto;\n }\n </style>\n </template>\n</dom-module>`;\n\ndocument.head.appendChild($_documentContainer.content);\n","/**\n@license\nCopyright (c) 2017 Vaadin Ltd.\nThis program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n*/\nimport { PolymerElement } from '@polymer/polymer/polymer-element.js';\n\nimport { GestureEventListeners } from '@polymer/polymer/lib/mixins/gesture-event-listeners.js';\nimport '@polymer/iron-media-query/iron-media-query.js';\nimport { IronA11yKeysBehavior } from '@polymer/iron-a11y-keys-behavior/iron-a11y-keys-behavior.js';\nimport { IronA11yAnnouncer } from '@polymer/iron-a11y-announcer/iron-a11y-announcer.js';\nimport '@vaadin/vaadin-button/src/vaadin-button.js';\nimport { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';\nimport { ThemePropertyMixin } from '@vaadin/vaadin-themable-mixin/vaadin-theme-property-mixin.js';\nimport './vaadin-month-calendar.js';\nimport './vaadin-infinite-scroller.js';\nimport { DatePickerHelper } from './vaadin-date-picker-helper.js';\nimport './vaadin-date-picker-styles.js';\nimport { html } from '@polymer/polymer/lib/utils/html-tag.js';\nimport { addListener, setTouchAction } from '@polymer/polymer/lib/utils/gestures.js';\nimport { Debouncer } from '@polymer/polymer/lib/utils/debounce.js';\nimport { timeOut } from '@polymer/polymer/lib/utils/async.js';\n/**\n * @memberof Vaadin\n * @private\n */\nclass DatePickerOverlayContentElement extends\n ThemableMixin(\n ThemePropertyMixin(\n GestureEventListeners(PolymerElement))) {\n static get template() {\n return html`\n <style>\n :host {\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n outline: none;\n background: #fff;\n }\n\n [part=\"overlay-header\"] {\n display: flex;\n flex-shrink: 0;\n flex-wrap: nowrap;\n align-items: center;\n }\n\n :host(:not([fullscreen])) [part=\"overlay-header\"] {\n display: none;\n }\n\n [part=\"label\"] {\n flex-grow: 1;\n }\n\n [part=\"clear-button\"]:not([showclear]) {\n display: none;\n }\n\n [part=\"years-toggle-button\"] {\n display: flex;\n }\n\n [part=\"years-toggle-button\"][desktop] {\n display: none;\n }\n\n :host(:not([years-visible])) [part=\"years-toggle-button\"]::before {\n transform: rotate(180deg);\n }\n\n #scrollers {\n display: flex;\n height: 100%;\n width: 100%;\n position: relative;\n overflow: hidden;\n }\n\n [part=\"months\"],\n [part=\"years\"] {\n height: 100%;\n }\n\n [part=\"months\"] {\n --vaadin-infinite-scroller-item-height: 270px;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n }\n\n #scrollers[desktop] [part=\"months\"] {\n right: 50px;\n transform: none !important;\n }\n\n [part=\"years\"] {\n --vaadin-infinite-scroller-item-height: 80px;\n width: 50px;\n position: absolute;\n right: 0;\n transform: translateX(100%);\n -webkit-tap-highlight-color: transparent;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n /* Center the year scroller position. */\n --vaadin-infinite-scroller-buffer-offset: 50%;\n }\n\n #scrollers[desktop] [part=\"years\"] {\n position: absolute;\n transform: none !important;\n }\n\n [part=\"years\"]::before {\n content: '';\n display: block;\n background: transparent;\n width: 0;\n height: 0;\n position: absolute;\n left: 0;\n top: 50%;\n transform: translateY(-50%);\n border-width: 6px;\n border-style: solid;\n border-color: transparent;\n border-left-color: #000;\n }\n\n :host(.animate) [part=\"months\"],\n :host(.animate) [part=\"years\"] {\n transition: all 200ms;\n }\n\n [part=\"toolbar\"] {\n display: flex;\n justify-content: space-between;\n z-index: 2;\n flex-shrink: 0;\n }\n\n [part~=\"overlay-header\"]:not([desktop]) {\n padding-bottom: 40px;\n }\n\n [part~=\"years-toggle-button\"] {\n position: absolute;\n top: auto;\n right: 8px;\n bottom: 0;\n z-index: 1;\n padding: 8px;\n }\n\n #announcer {\n display: inline-block;\n position: fixed;\n clip: rect(0, 0, 0, 0);\n clip-path: inset(100%);\n }\n </style>\n\n <div id=\"announcer\" role=\"alert\" aria-live=\"polite\">\n [[i18n.calendar]]\n </div>\n\n <div part=\"overlay-header\" on-touchend=\"_preventDefault\" desktop\\$=\"[[_desktopMode]]\" aria-hidden=\"true\">\n <div part=\"label\">[[_formatDisplayed(selectedDate, i18n.formatDate, label)]]</div>\n <div part=\"clear-button\" on-tap=\"_clear\" showclear\\$=\"[[_showClear(selectedDate)]]\"></div>\n <div part=\"toggle-button\" on-tap=\"_cancel\"></div>\n\n <div part=\"years-toggle-button\" desktop\\$=\"[[_desktopMode]]\" on-tap=\"_toggleYearScroller\" aria-hidden=\"true\">\n [[_yearAfterXMonths(_visibleMonthIndex)]]\n </div>\n </div>\n\n <div id=\"scrollers\" desktop\\$=\"[[_desktopMode]]\" on-track=\"_track\">\n <vaadin-infinite-scroller id=\"monthScroller\" on-custom-scroll=\"_onMonthScroll\" on-touchstart=\"_onMonthScrollTouchStart\" buffer-size=\"3\" active=\"[[initialPosition]]\" part=\"months\">\n <template>\n <vaadin-month-calendar i18n=\"[[i18n]]\" month=\"[[_dateAfterXMonths(index)]]\" selected-date=\"{{selectedDate}}\" focused-date=\"[[focusedDate]]\" ignore-taps=\"[[_ignoreTaps]]\" show-week-numbers=\"[[showWeekNumbers]]\" min-date=\"[[minDate]]\" max-date=\"[[maxDate]]\" focused\\$=\"[[_focused]]\" part=\"month\" theme\\$=\"[[theme]]\">\n </vaadin-month-calendar>\n </template>\n </vaadin-infinite-scroller>\n <vaadin-infinite-scroller id=\"yearScroller\" on-tap=\"_onYearTap\" on-custom-scroll=\"_onYearScroll\" on-touchstart=\"_onYearScrollTouchStart\" buffer-size=\"12\" active=\"[[initialPosition]]\" part=\"years\">\n <template>\n <div part=\"year-number\" role=\"button\" current\\$=\"[[_isCurrentYear(index)]]\" selected\\$=\"[[_isSelectedYear(index, selectedDate)]]\">\n [[_yearAfterXYears(index)]]\n </div>\n <div part=\"year-separator\" aria-hidden=\"true\"></div>\n </template>\n </vaadin-infinite-scroller>\n </div>\n\n <div on-touchend=\"_preventDefault\" role=\"toolbar\" part=\"toolbar\">\n <vaadin-button id=\"todayButton\" part=\"today-button\" disabled=\"[[!_isTodayAllowed(minDate, maxDate)]]\" on-tap=\"_onTodayTap\">\n [[i18n.today]]\n </vaadin-button>\n <vaadin-button id=\"cancelButton\" part=\"cancel-button\" on-tap=\"_cancel\">\n [[i18n.cancel]]\n </vaadin-button>\n </div>\n\n <iron-media-query query=\"(min-width: 375px)\" query-matches=\"{{_desktopMode}}\"></iron-media-query>\n`;\n }\n\n static get is() {\n return 'vaadin-date-picker-overlay-content';\n }\n\n static get properties() {\n return {\n /**\n * The value for this element.\n */\n selectedDate: {\n type: Date,\n notify: true\n },\n\n /**\n * Date value which is focused using keyboard.\n */\n focusedDate: {\n type: Date,\n notify: true,\n observer: '_focusedDateChanged'\n },\n\n _focusedMonthDate: Number,\n\n /**\n * Date which should be visible when there is no value selected.\n */\n initialPosition: {\n type: Date,\n observer: '_initialPositionChanged'\n },\n\n _originDate: {\n value: new Date()\n },\n\n _visibleMonthIndex: Number,\n\n _desktopMode: Boolean,\n\n _translateX: {\n observer: '_translateXChanged'\n },\n\n _yearScrollerWidth: {\n value: 50\n },\n\n i18n: {\n type: Object\n },\n\n showWeekNumbers: {\n type: Boolean\n },\n\n _ignoreTaps: Boolean,\n\n _notTapping: Boolean,\n\n /**\n * The earliest date that can be selected. All earlier dates will be disabled.\n */\n minDate: Date,\n\n /**\n * The latest date that can be selected. All later dates will be disabled.\n */\n maxDate: Date,\n\n _focused: Boolean,\n\n /**\n * Input label\n */\n label: String\n };\n }\n\n ready() {\n super.ready();\n this.setAttribute('tabindex', 0);\n this.addEventListener('keydown', this._onKeydown.bind(this));\n addListener(this, 'tap', this._stopPropagation);\n this.addEventListener('focus', this._onOverlayFocus.bind(this));\n this.addEventListener('blur', this._onOverlayBlur.bind(this));\n }\n\n /**\n * Fired when the scroller reaches the target scrolling position.\n * @event scroll-animation-finished\n * @param {Number} detail.position new position\n * @param {Number} detail.oldPosition old position\n */\n\n connectedCallback() {\n super.connectedCallback();\n this._closeYearScroller();\n this._toggleAnimateClass(true);\n setTouchAction(this.$.scrollers, 'pan-y');\n IronA11yAnnouncer.requestAvailability();\n }\n\n announceFocusedDate() {\n var focusedDate = this._currentlyFocusedDate();\n var announce = [];\n if (DatePickerHelper._dateEquals(focusedDate, new Date())) {\n announce.push(this.i18n.today);\n }\n announce = announce.concat([\n this.i18n.weekdays[focusedDate.getDay()],\n focusedDate.getDate(),\n this.i18n.monthNames[focusedDate.getMonth()],\n focusedDate.getFullYear()\n ]);\n if (this.showWeekNumbers && this.i18n.firstDayOfWeek === 1) {\n announce.push(this.i18n.week);\n announce.push(DatePickerHelper._getISOWeekNumber(focusedDate));\n }\n this.dispatchEvent(new CustomEvent('iron-announce', {\n bubbles: true,\n composed: true,\n detail: {\n text: announce.join(' ')\n }\n }));\n return;\n }\n\n /**\n * Focuses the cancel button\n */\n focusCancel() {\n this.$.cancelButton.focus();\n }\n\n /**\n * Scrolls the list to the given Date.\n */\n scrollToDate(date, animate) {\n this._scrollToPosition(this._differenceInMonths(date, this._originDate), animate);\n }\n\n _focusedDateChanged(focusedDate) {\n this.revealDate(focusedDate);\n }\n\n _isCurrentYear(yearsFromNow) {\n return yearsFromNow === 0;\n }\n\n _isSelectedYear(yearsFromNow, selectedDate) {\n if (selectedDate) {\n return selectedDate.getFullYear() === this._originDate.getFullYear() + yearsFromNow;\n }\n }\n\n /**\n * Scrolls the month and year scrollers enough to reveal the given date.\n */\n revealDate(date) {\n if (date) {\n var diff = this._differenceInMonths(date, this._originDate);\n var scrolledAboveViewport = this.$.monthScroller.position > diff;\n\n var visibleItems = this.$.monthScroller.clientHeight / this.$.monthScroller.itemHeight;\n var scrolledBelowViewport = this.$.monthScroller.position + visibleItems - 1 < diff;\n\n if (scrolledAboveViewport) {\n this._scrollToPosition(diff, true);\n } else if (scrolledBelowViewport) {\n this._scrollToPosition(diff - visibleItems + 1, true);\n }\n }\n }\n\n _onOverlayFocus() {\n this._focused = true;\n }\n\n _onOverlayBlur() {\n this._focused = false;\n }\n\n _initialPositionChanged(initialPosition) {\n this.scrollToDate(initialPosition);\n }\n\n _repositionYearScroller() {\n this._visibleMonthIndex = Math.floor(this.$.monthScroller.position);\n this.$.yearScroller.position = (this.$.monthScroller.position + this._originDate.getMonth()) / 12;\n }\n\n _repositionMonthScroller() {\n this.$.monthScroller.position = this.$.yearScroller.position * 12 - this._originDate.getMonth();\n this._visibleMonthIndex = Math.floor(this.$.monthScroller.position);\n }\n\n _onMonthScroll() {\n this._repositionYearScroller();\n this._doIgnoreTaps();\n }\n\n _onYearScroll() {\n this._repositionMonthScroller();\n this._doIgnoreTaps();\n }\n\n _onYearScrollTouchStart() {\n this._notTapping = false;\n setTimeout(() => this._notTapping = true, 300);\n\n this._repositionMonthScroller();\n }\n\n _onMonthScrollTouchStart() {\n this._repositionYearScroller();\n }\n\n _doIgnoreTaps() {\n this._ignoreTaps = true;\n this._debouncer = Debouncer.debounce(this._debouncer,\n timeOut.after(300), () => this._ignoreTaps = false);\n }\n\n _formatDisplayed(date, formatDate, label) {\n if (date) {\n return formatDate(DatePickerHelper._extractDateParts(date));\n } else {\n return label;\n }\n }\n\n _onTodayTap() {\n var today = new Date();\n\n if (Math.abs(this.$.monthScroller.position - this._differenceInMonths(today, this._originDate)) < 0.001) {\n // Select today only if the month scroller is positioned approximately\n // at the beginning of the current month\n this.selectedDate = today;\n this._close();\n } else {\n this._scrollToCurrentMonth();\n }\n }\n\n _scrollToCurrentMonth() {\n if (this.focusedDate) {\n this.focusedDate = new Date();\n }\n\n this.scrollToDate(new Date(), true);\n }\n\n _showClear(selectedDate) {\n return !!selectedDate;\n }\n\n _onYearTap(e) {\n if (!this._ignoreTaps && !this._notTapping) {\n var scrollDelta = e.detail.y - (this.$.yearScroller.getBoundingClientRect().top + this.$.yearScroller.clientHeight / 2);\n var yearDelta = scrollDelta / this.$.yearScroller.itemHeight;\n this._scrollToPosition(this.$.monthScroller.position + yearDelta * 12, true);\n }\n }\n\n _scrollToPosition(targetPosition, animate) {\n if (this._targetPosition !== undefined) {\n this._targetPosition = targetPosition;\n return;\n }\n\n if (!animate) {\n this.$.monthScroller.position = targetPosition;\n this._targetPosition = undefined;\n this._repositionYearScroller();\n return;\n }\n\n this._targetPosition = targetPosition;\n\n // http://gizma.com/easing/\n var easingFunction = (t, b, c, d) => {\n t /= d / 2;\n if (t < 1) {\n return c / 2 * t * t + b;\n }\n t--;\n return -c / 2 * (t * (t - 2) - 1) + b;\n };\n\n var duration = animate ? 300 : 0;\n var start = 0;\n var initialPosition = this.$.monthScroller.position;\n\n var smoothScroll = timestamp => {\n start = start || timestamp;\n var currentTime = timestamp - start;\n\n if (currentTime < duration) {\n var currentPos = easingFunction(currentTime, initialPosition, this._targetPosition - initialPosition, duration);\n this.$.monthScroller.position = currentPos;\n window.requestAnimationFrame(smoothScroll);\n } else {\n this.dispatchEvent(new CustomEvent('scroll-animation-finished', {\n bubbles: true,\n composed: true,\n detail: {\n position: this._targetPosition,\n oldPosition: initialPosition\n }\n }));\n\n this.$.monthScroller.position = this._targetPosition;\n this._targetPosition = undefined;\n }\n\n setTimeout(this._repositionYearScroller.bind(this), 1);\n };\n\n // Start the animation.\n window.requestAnimationFrame(smoothScroll);\n }\n\n _limit(value, range) {\n return Math.min(range.max, Math.max(range.min, value));\n }\n\n _handleTrack(e) {\n // Check if horizontal movement threshold (dx) not exceeded or\n // scrolling fast vertically (ddy).\n if (Math.abs(e.detail.dx) < 10 || Math.abs(e.detail.ddy) > 10) {\n return;\n }\n\n // If we're flinging quickly -> start animating already.\n if (Math.abs(e.detail.ddx) > this._yearScrollerWidth / 3) {\n this._toggleAnimateClass(true);\n }\n\n var newTranslateX = this._translateX + e.detail.ddx;\n this._translateX = this._limit(newTranslateX, {\n min: 0,\n max: this._yearScrollerWidth\n });\n }\n\n _track(e) {\n if (this._desktopMode) {\n // No need to track for swipe gestures on desktop.\n return;\n }\n\n switch (e.detail.state) {\n case 'start':\n this._toggleAnimateClass(false);\n break;\n\n case 'track':\n this._handleTrack(e);\n break;\n\n case 'end':\n this._toggleAnimateClass(true);\n if (this._translateX >= this._yearScrollerWidth / 2) {\n this._closeYearScroller();\n } else {\n this._openYearScroller();\n }\n break;\n }\n }\n\n _toggleAnimateClass(enable) {\n if (enable) {\n this.classList.add('animate');\n } else {\n this.classList.remove('animate');\n }\n }\n\n _toggleYearScroller() {\n this._isYearScrollerVisible() ? this._closeYearScroller() : this._openYearScroller();\n }\n\n _openYearScroller() {\n this._translateX = 0;\n this.setAttribute('years-visible', '');\n }\n\n _closeYearScroller() {\n this.removeAttribute('years-visible');\n this._translateX = this._yearScrollerWidth;\n }\n\n _isYearScrollerVisible() {\n return this._translateX < this._yearScrollerWidth / 2;\n }\n\n _translateXChanged(x) {\n if (!this._desktopMode) {\n this.$.monthScroller.style.transform = 'translateX(' + (x - this._yearScrollerWidth) + 'px)';\n this.$.yearScroller.style.transform = 'translateX(' + x + 'px)';\n }\n }\n\n _yearAfterXYears(index) {\n var result = new Date(this._originDate);\n result.setFullYear(parseInt(index) + this._originDate.getFullYear());\n return result.getFullYear();\n }\n\n _yearAfterXMonths(months) {\n return this._dateAfterXMonths(months).getFullYear();\n }\n\n _dateAfterXMonths(months) {\n var result = new Date(this._originDate);\n result.setDate(1);\n result.setMonth(parseInt(months) + this._originDate.getMonth());\n return result;\n }\n\n _differenceInMonths(date1, date2) {\n var months = (date1.getFullYear() - date2.getFullYear()) * 12;\n return months - date2.getMonth() + date1.getMonth();\n }\n\n _differenceInYears(date1, date2) {\n return this._differenceInMonths(date1, date2) / 12;\n }\n\n _clear() {\n this.selectedDate = '';\n }\n\n _close() {\n const overlayContent = this.getRootNode().host;\n const overlay = overlayContent ? overlayContent.getRootNode().host : null;\n if (overlay) {\n overlay.opened = false;\n }\n\n this.dispatchEvent(new CustomEvent('close', {bubbles: true, composed: true}));\n }\n\n _cancel() {\n this.focusedDate = this.selectedDate;\n this._close();\n }\n\n _preventDefault(e) {\n e.preventDefault();\n }\n\n /**\n * Keyboard Navigation\n */\n _eventKey(e) {\n var keys = ['down', 'up', 'right', 'left', 'enter', 'space', 'home', 'end', 'pageup', 'pagedown', 'tab', 'esc'];\n\n for (var i = 0; i < keys.length; i++) {\n var k = keys[i];\n if (IronA11yKeysBehavior.keyboardEventMatchesKeys(e, k)) {\n return k;\n }\n }\n }\n\n _onKeydown(e) {\n var focus = this._currentlyFocusedDate();\n\n // Cannot use (today/cancel).focused flag because vaadin-text-field removes it\n // previously in the keydown event.\n const isToday = e.composedPath().indexOf(this.$.todayButton) >= 0;\n const isCancel = e.composedPath().indexOf(this.$.cancelButton) >= 0;\n const isScroller = !isToday && !isCancel;\n\n var eventKey = this._eventKey(e);\n if (eventKey === 'tab') {\n // We handle tabs here and don't want to bubble up.\n e.stopPropagation();\n\n const isFullscreen = this.hasAttribute('fullscreen');\n const isShift = e.shiftKey;\n\n if (isFullscreen) {\n e.preventDefault();\n } else if (isShift && isScroller || !isShift && isCancel) {\n // Return focus back to the input field\n e.preventDefault();\n this.dispatchEvent(new CustomEvent('focus-input', {bubbles: true, composed: true}));\n } else if (isShift && isToday) {\n // Browser returns focus back to the scrollable area. We need to set\n // the focused flag, and move the scroll to focused date.\n this._focused = true;\n setTimeout(() => this.revealDate(this.focusedDate), 1);\n } else {\n // Browser moves the focus out of the scroller, hence focused flag must\n // set to false.\n this._focused = false;\n }\n } else if (eventKey) {\n e.preventDefault();\n e.stopPropagation();\n switch (eventKey) {\n case 'down':\n this._moveFocusByDays(7);\n this.focus();\n break;\n case 'up':\n this._moveFocusByDays(-7);\n this.focus();\n break;\n case 'right':\n if (isScroller) {\n this._moveFocusByDays(1);\n }\n break;\n case 'left':\n if (isScroller) {\n this._moveFocusByDays(-1);\n }\n break;\n case 'enter':\n if (isScroller || isCancel) {\n this._close();\n } else if (isToday) {\n this._onTodayTap();\n }\n break;\n case 'space':\n if (isCancel) {\n this._close();\n } else if (isToday) {\n this._onTodayTap();\n } else {\n var focusedDate = this.focusedDate;\n if (DatePickerHelper._dateEquals(focusedDate, this.selectedDate)) {\n this.selectedDate = '';\n this.focusedDate = focusedDate;\n } else {\n this.selectedDate = focusedDate;\n }\n }\n break;\n case 'home':\n this._moveFocusInsideMonth(focus, 'minDate');\n break;\n case 'end':\n this._moveFocusInsideMonth(focus, 'maxDate');\n break;\n case 'pagedown':\n this._moveFocusByMonths(e.shiftKey ? 12 : 1);\n break;\n case 'pageup':\n this._moveFocusByMonths(e.shiftKey ? -12 : -1);\n break;\n case 'esc':\n this._cancel();\n break;\n }\n }\n }\n\n _currentlyFocusedDate() {\n return this.focusedDate || this.selectedDate || this.initialPosition || new Date();\n }\n\n _focusDate(dateToFocus) {\n this.focusedDate = dateToFocus;\n this._focusedMonthDate = dateToFocus.getDate();\n }\n\n _focusClosestDate(focus) {\n this._focusDate(DatePickerHelper._getClosestDate(focus, [this.minDate, this.maxDate]));\n }\n\n _moveFocusByDays(days) {\n var focus = this._currentlyFocusedDate();\n var dateToFocus = new Date(0, 0);\n dateToFocus.setFullYear(focus.getFullYear());\n dateToFocus.setMonth(focus.getMonth());\n dateToFocus.setDate(focus.getDate() + days);\n\n if (this._dateAllowed(dateToFocus, this.minDate, this.maxDate)) {\n this._focusDate(dateToFocus);\n } else {\n if (this._dateAllowed(focus, this.minDate, this.maxDate)) {\n // Move to min or max date\n if (days > 0) { // down or right\n this._focusDate(this.maxDate);\n } else { // up or left\n this._focusDate(this.minDate);\n }\n } else {\n // Move to closest allowed date\n this._focusClosestDate(focus);\n }\n }\n }\n\n _moveFocusByMonths(months) {\n var focus = this._currentlyFocusedDate();\n var dateToFocus = new Date(0, 0);\n dateToFocus.setFullYear(focus.getFullYear());\n dateToFocus.setMonth(focus.getMonth() + months);\n\n var targetMonth = dateToFocus.getMonth();\n\n dateToFocus.setDate(this._focusedMonthDate || (this._focusedMonthDate = focus.getDate()));\n if (dateToFocus.getMonth() !== targetMonth) {\n dateToFocus.setDate(0);\n }\n\n if (this._dateAllowed(dateToFocus, this.minDate, this.maxDate)) {\n this.focusedDate = dateToFocus;\n } else {\n if (this._dateAllowed(focus, this.minDate, this.maxDate)) {\n // Move to min or max date\n if (months > 0) { // pagedown\n this._focusDate(this.maxDate);\n } else { // pageup\n this._focusDate(this.minDate);\n }\n } else {\n // Move to closest allowed date\n this._focusClosestDate(focus);\n }\n }\n }\n\n _moveFocusInsideMonth(focusedDate, property) {\n var dateToFocus = new Date(0, 0);\n dateToFocus.setFullYear(focusedDate.getFullYear());\n\n if (property === 'minDate') {\n dateToFocus.setMonth(focusedDate.getMonth());\n dateToFocus.setDate(1);\n } else {\n dateToFocus.setMonth(focusedDate.getMonth() + 1);\n dateToFocus.setDate(0);\n }\n\n if (this._dateAllowed(dateToFocus, this.minDate, this.maxDate)) {\n this._focusDate(dateToFocus);\n } else {\n if (this._dateAllowed(focusedDate, this.minDate, this.maxDate)) {\n // Move to minDate or maxDate\n this._focusDate(this[property]);\n } else {\n // Move to closest allowed date\n this._focusClosestDate(focusedDate);\n }\n }\n }\n\n _dateAllowed(date, min, max) {\n return (!min || date >= min) && (!max || date <= max);\n }\n\n _isTodayAllowed(min, max) {\n var today = new Date();\n var todayMidnight = new Date(0, 0);\n todayMidnight.setFullYear(today.getFullYear());\n todayMidnight.setMonth(today.getMonth());\n todayMidnight.setDate(today.getDate());\n return this._dateAllowed(todayMidnight, min, max);\n }\n\n _stopPropagation(e) {\n e.stopPropagation();\n }\n}\n\ncustomElements.define(DatePickerOverlayContentElement.is, DatePickerOverlayContentElement);\n","/**\n@license\nCopyright (c) 2015 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at\nhttp://polymer.github.io/LICENSE.txt The complete set of authors may be found at\nhttp://polymer.github.io/AUTHORS.txt The complete set of contributors may be\nfound at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as\npart of the polymer project is also subject to an additional IP rights grant\nfound at http://polymer.github.io/PATENTS.txt\n*/\nimport '@polymer/polymer/polymer-legacy.js';\n\nimport {dom} from '@polymer/polymer/lib/legacy/polymer.dom.js';\nimport {useShadow} from '@polymer/polymer/lib/utils/settings.js';\n\n// Contains all connected resizables that do not have a parent.\nvar ORPHANS = new Set();\n\n/**\n * `IronResizableBehavior` is a behavior that can be used in Polymer elements to\n * coordinate the flow of resize events between \"resizers\" (elements that\n *control the size or hidden state of their children) and \"resizables\" (elements\n *that need to be notified when they are resized or un-hidden by their parents\n *in order to take action on their new measurements).\n *\n * Elements that perform measurement should add the `IronResizableBehavior`\n *behavior to their element definition and listen for the `iron-resize` event on\n *themselves. This event will be fired when they become showing after having\n *been hidden, when they are resized explicitly by another resizable, or when\n *the window has been resized.\n *\n * Note, the `iron-resize` event is non-bubbling.\n *\n * @polymerBehavior\n * @demo demo/index.html\n **/\nexport const IronResizableBehavior = {\n properties: {\n /**\n * The closest ancestor element that implements `IronResizableBehavior`.\n */\n _parentResizable: {\n type: Object,\n observer: '_parentResizableChanged',\n },\n\n /**\n * True if this element is currently notifying its descendant elements of\n * resize.\n */\n _notifyingDescendant: {\n type: Boolean,\n value: false,\n }\n },\n\n listeners: {\n 'iron-request-resize-notifications': '_onIronRequestResizeNotifications'\n },\n\n created: function() {\n // We don't really need property effects on these, and also we want them\n // to be created before the `_parentResizable` observer fires:\n this._interestedResizables = [];\n this._boundNotifyResize = this.notifyResize.bind(this);\n this._boundOnDescendantIronResize = this._onDescendantIronResize.bind(this);\n },\n\n attached: function() {\n this._requestResizeNotifications();\n },\n\n detached: function() {\n if (this._parentResizable) {\n this._parentResizable.stopResizeNotificationsFor(this);\n } else {\n ORPHANS.delete(this);\n window.removeEventListener('resize', this._boundNotifyResize);\n }\n\n this._parentResizable = null;\n },\n\n /**\n * Can be called to manually notify a resizable and its descendant\n * resizables of a resize change.\n */\n notifyResize: function() {\n if (!this.isAttached) {\n return;\n }\n\n this._interestedResizables.forEach(function(resizable) {\n if (this.resizerShouldNotify(resizable)) {\n this._notifyDescendant(resizable);\n }\n }, this);\n\n this._fireResize();\n },\n\n /**\n * Used to assign the closest resizable ancestor to this resizable\n * if the ancestor detects a request for notifications.\n */\n assignParentResizable: function(parentResizable) {\n if (this._parentResizable) {\n this._parentResizable.stopResizeNotificationsFor(this);\n }\n\n this._parentResizable = parentResizable;\n\n if (parentResizable &&\n parentResizable._interestedResizables.indexOf(this) === -1) {\n parentResizable._interestedResizables.push(this);\n parentResizable._subscribeIronResize(this);\n }\n },\n\n /**\n * Used to remove a resizable descendant from the list of descendants\n * that should be notified of a resize change.\n */\n stopResizeNotificationsFor: function(target) {\n var index = this._interestedResizables.indexOf(target);\n\n if (index > -1) {\n this._interestedResizables.splice(index, 1);\n this._unsubscribeIronResize(target);\n }\n },\n\n /**\n * Subscribe this element to listen to iron-resize events on the given target.\n *\n * Preferred over target.listen because the property renamer does not\n * understand to rename when the target is not specifically \"this\"\n *\n * @param {!HTMLElement} target Element to listen to for iron-resize events.\n */\n _subscribeIronResize: function(target) {\n target.addEventListener('iron-resize', this._boundOnDescendantIronResize);\n },\n\n /**\n * Unsubscribe this element from listening to to iron-resize events on the\n * given target.\n *\n * Preferred over target.unlisten because the property renamer does not\n * understand to rename when the target is not specifically \"this\"\n *\n * @param {!HTMLElement} target Element to listen to for iron-resize events.\n */\n _unsubscribeIronResize: function(target) {\n target.removeEventListener(\n 'iron-resize', this._boundOnDescendantIronResize);\n },\n\n /**\n * This method can be overridden to filter nested elements that should or\n * should not be notified by the current element. Return true if an element\n * should be notified, or false if it should not be notified.\n *\n * @param {HTMLElement} element A candidate descendant element that\n * implements `IronResizableBehavior`.\n * @return {boolean} True if the `element` should be notified of resize.\n */\n resizerShouldNotify: function(element) {\n return true;\n },\n\n _onDescendantIronResize: function(event) {\n if (this._notifyingDescendant) {\n event.stopPropagation();\n return;\n }\n\n // no need to use this during shadow dom because of event retargeting\n if (!useShadow) {\n this._fireResize();\n }\n },\n\n _fireResize: function() {\n this.fire('iron-resize', null, {node: this, bubbles: false});\n },\n\n _onIronRequestResizeNotifications: function(event) {\n var target = /** @type {!EventTarget} */ (dom(event).rootTarget);\n if (target === this) {\n return;\n }\n\n target.assignParentResizable(this);\n this._notifyDescendant(target);\n\n event.stopPropagation();\n },\n\n _parentResizableChanged: function(parentResizable) {\n if (parentResizable) {\n window.removeEventListener('resize', this._boundNotifyResize);\n }\n },\n\n _notifyDescendant: function(descendant) {\n // NOTE(cdata): In IE10, attached is fired on children first, so it's\n // important not to notify them if the parent is not attached yet (or\n // else they will get redundantly notified when the parent attaches).\n if (!this.isAttached) {\n return;\n }\n\n this._notifyingDescendant = true;\n descendant.notifyResize();\n this._notifyingDescendant = false;\n },\n\n _requestResizeNotifications: function() {\n if (!this.isAttached) {\n return;\n }\n\n if (document.readyState === 'loading') {\n var _requestResizeNotifications =\n this._requestResizeNotifications.bind(this);\n document.addEventListener(\n 'readystatechange', function readystatechanged() {\n document.removeEventListener('readystatechange', readystatechanged);\n _requestResizeNotifications();\n });\n } else {\n this._findParent();\n\n if (!this._parentResizable) {\n // If this resizable is an orphan, tell other orphans to try to find\n // their parent again, in case it's this resizable.\n ORPHANS.forEach(function(orphan) {\n if (orphan !== this) {\n orphan._findParent();\n }\n }, this);\n\n window.addEventListener('resize', this._boundNotifyResize);\n this.notifyResize();\n } else {\n // If this resizable has a parent, tell other child resizables of\n // that parent to try finding their parent again, in case it's this\n // resizable.\n this._parentResizable._interestedResizables\n .forEach(function(resizable) {\n if (resizable !== this) {\n resizable._findParent();\n }\n }, this);\n }\n }\n },\n\n _findParent: function() {\n this.assignParentResizable(null);\n this.fire(\n 'iron-request-resize-notifications',\n null,\n {node: this, bubbles: true, cancelable: true});\n\n if (!this._parentResizable) {\n ORPHANS.add(this);\n } else {\n ORPHANS.delete(this);\n }\n }\n};\n","/**\n@license\nCopyright (c) 2017 Vaadin Ltd.\nThis program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n*/\nimport { PolymerElement } from '@polymer/polymer/polymer-element.js';\n\nimport { GestureEventListeners } from '@polymer/polymer/lib/mixins/gesture-event-listeners.js';\nimport '@polymer/iron-media-query/iron-media-query.js';\nimport { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';\nimport { ThemePropertyMixin } from '@vaadin/vaadin-themable-mixin/vaadin-theme-property-mixin.js';\nimport { ControlStateMixin } from '@vaadin/vaadin-control-state-mixin/vaadin-control-state-mixin.js';\nimport './vaadin-date-picker-overlay.js';\nimport './vaadin-date-picker-overlay-content.js';\nimport { DatePickerMixin } from './vaadin-date-picker-mixin.js';\nimport '@vaadin/vaadin-text-field/src/vaadin-text-field.js';\nimport { ElementMixin } from '@vaadin/vaadin-element-mixin/vaadin-element-mixin.js';\nimport { html } from '@polymer/polymer/lib/utils/html-tag.js';\nimport { afterNextRender } from '@polymer/polymer/lib/utils/render-status.js';\n/**\n *\n * `<vaadin-date-picker>` is a date selection field which includes a scrollable\n * month calendar view.\n * ```html\n * <vaadin-date-picker label=\"Birthday\"></vaadin-date-picker>\n * ```\n * ```js\n * datePicker.value = '2016-03-02';\n * ```\n * When the selected `value` is changed, a `value-changed` event is triggered.\n *\n *\n * ### Styling\n *\n * The following shadow DOM parts are available for styling:\n *\n * Part name | Description | Theme for Element\n * ----------------|----------------|----------------\n * `text-field` | Input element | vaadin-date-picker\n * `clear-button` | Clear button | vaadin-date-picker\n * `toggle-button` | Toggle button | vaadin-date-picker\n * `overlay-content` | The overlay element | vaadin-date-picker\n * `overlay-header` | Fullscreen mode header | vaadin-date-picker-overlay-content\n * `label` | Fullscreen mode value/label | vaadin-date-picker-overlay-content\n * `clear-button` | Fullscreen mode clear button | vaadin-date-picker-overlay-content\n * `toggle-button` | Fullscreen mode toggle button | vaadin-date-picker-overlay-content\n * `years-toggle-button` | Fullscreen mode years scroller toggle | vaadin-date-picker-overlay-content\n * `months` | Months scroller | vaadin-date-picker-overlay-content\n * `years` | Years scroller | vaadin-date-picker-overlay-content\n * `toolbar` | Footer bar with buttons | vaadin-date-picker-overlay-content\n * `today-button` | Today button | vaadin-date-picker-overlay-content\n * `cancel-button` | Cancel button | vaadin-date-picker-overlay-content\n * `month` | Month calendar | vaadin-date-picker-overlay-content\n * `year-number` | Year number | vaadin-date-picker-overlay-content\n * `year-separator` | Year separator | vaadin-date-picker-overlay-content\n * `month-header` | Month title | vaadin-month-calendar\n * `weekdays` | Weekday container | vaadin-month-calendar\n * `weekday` | Weekday element | vaadin-month-calendar\n * `week-numbers` | Week numbers container | vaadin-month-calendar\n * `week-number` | Week number element | vaadin-month-calendar\n * `date` | Date element | vaadin-month-calendar\n *\n * See [ThemableMixin – how to apply styles for shadow parts](https://github.com/vaadin/vaadin-themable-mixin/wiki)\n *\n * The following state attributes are available for styling:\n *\n * Attribute | Description | Part name\n * -------------|-------------|------------\n * `invalid` | Set when the element is invalid | :host\n * `opened` | Set when the date selector overlay is opened | :host\n * `readonly` | Set when the element is readonly | :host\n * `disabled` | Set when the element is disabled | :host\n * `today` | Set on the date corresponding to the current day | date\n * `focused` | Set on the focused date | date\n * `disabled` | Set on the date out of the allowed range | date\n * `selected` | Set on the selected date | date\n *\n * If you want to replace the default input field with a custom implementation, you should use the\n * [`<vaadin-date-picker-light>`](#vaadin-date-picker-light) element.\n *\n * In addition to `<vaadin-date-picker>` itself, the following internal\n * components are themable:\n *\n * - `<vaadin-text-field>`\n * - `<vaadin-date-picker-overlay>`\n * - `<vaadin-date-picker-overlay-content>`\n * - `<vaadin-month-calendar>`\n *\n * Note: the `theme` attribute value set on `<vaadin-date-picker>` is\n * propagated to the internal themable components listed above.\n *\n * @memberof Vaadin\n * @mixes Vaadin.ElementMixin\n * @mixes Vaadin.ControlStateMixin\n * @mixes Vaadin.ThemableMixin\n * @mixes Vaadin.ThemePropertyMixin\n * @mixes Vaadin.DatePickerMixin\n * @mixes Polymer.GestureEventListeners\n * @demo demo/index.html\n */\nclass DatePickerElement extends\n ElementMixin(\n ControlStateMixin(\n ThemableMixin(\n ThemePropertyMixin(\n DatePickerMixin(\n GestureEventListeners(PolymerElement)))))) {\n static get template() {\n return html`\n <style>\n :host {\n display: inline-block;\n }\n\n :host([hidden]) {\n display: none !important;\n }\n\n :host([opened]) {\n pointer-events: auto;\n }\n\n [part=\"text-field\"] {\n width: 100%;\n min-width: 0;\n }\n </style>\n\n\n <vaadin-text-field id=\"input\" role=\"application\" autocomplete=\"off\" on-focus=\"_focus\" value=\"{{_userInputValue}}\" invalid=\"[[invalid]]\" label=\"[[label]]\" name=\"[[name]]\" placeholder=\"[[placeholder]]\" required=\"[[required]]\" disabled=\"[[disabled]]\" readonly=\"[[readonly]]\" error-message=\"[[errorMessage]]\" clear-button-visible=\"[[clearButtonVisible]]\" aria-label\\$=\"[[label]]\" part=\"text-field\" theme\\$=\"[[theme]]\">\n <slot name=\"prefix\" slot=\"prefix\"></slot>\n <div part=\"toggle-button\" slot=\"suffix\" on-tap=\"_toggle\" role=\"button\" aria-label\\$=\"[[i18n.calendar]]\" aria-expanded\\$=\"[[_getAriaExpanded(opened)]]\"></div>\n </vaadin-text-field>\n\n <vaadin-date-picker-overlay id=\"overlay\" fullscreen\\$=\"[[_fullscreen]]\" theme\\$=\"[[__getOverlayTheme(theme, _overlayInitialized)]]\" on-vaadin-overlay-open=\"_onOverlayOpened\" on-vaadin-overlay-close=\"_onOverlayClosed\" disable-upgrade=\"\">\n <template>\n <vaadin-date-picker-overlay-content id=\"overlay-content\" i18n=\"[[i18n]]\" fullscreen\\$=\"[[_fullscreen]]\" label=\"[[label]]\" selected-date=\"{{_selectedDate}}\" slot=\"dropdown-content\" focused-date=\"{{_focusedDate}}\" show-week-numbers=\"[[showWeekNumbers]]\" min-date=\"[[_minDate]]\" max-date=\"[[_maxDate]]\" role=\"dialog\" on-date-tap=\"_close\" part=\"overlay-content\" theme\\$=\"[[__getOverlayTheme(theme, _overlayInitialized)]]\">\n </vaadin-date-picker-overlay-content>\n </template>\n </vaadin-date-picker-overlay>\n\n <iron-media-query query=\"[[_fullscreenMediaQuery]]\" query-matches=\"{{_fullscreen}}\">\n </iron-media-query>\n`;\n }\n\n static get is() {\n return 'vaadin-date-picker';\n }\n\n static get version() {\n return '4.0.1';\n }\n\n static get properties() {\n return {\n /**\n * Set to true to display the clear icon which clears the input.\n */\n clearButtonVisible: {\n type: Boolean,\n value: false\n },\n\n /**\n * Set to true to disable this element.\n */\n disabled: {\n type: Boolean,\n value: false,\n reflectToAttribute: true\n },\n\n /**\n * The error message to display when the input is invalid.\n */\n errorMessage: String,\n\n /**\n * A placeholder string in addition to the label. If this is set, the label will always float.\n */\n placeholder: String,\n\n /**\n * Set to true to make this element read-only.\n */\n readonly: {\n type: Boolean,\n value: false,\n reflectToAttribute: true\n },\n\n /**\n * This property is set to true when the control value invalid.\n */\n invalid: {\n type: Boolean,\n reflectToAttribute: true,\n notify: true,\n value: false\n },\n\n _userInputValue: String\n };\n }\n\n static get observers() {\n return [\n '_userInputValueChanged(_userInputValue)',\n '_setClearButtonLabel(i18n.clear)'\n ];\n }\n\n ready() {\n super.ready();\n\n // In order to have synchronized invalid property, we need to use the same validate logic.\n afterNextRender(this, () => this._inputElement.validate = () => {});\n\n // FIXME(platosha): dispatch `input` event on\n // <vaadin-text-field> clear button\n // https://github.com/vaadin/vaadin-text-field/issues/347\n this._inputElement.addEventListener('change', () => {\n if (this._inputElement.value === '') {\n this.__dispatchChange = true;\n this.value = '';\n this.__dispatchChange = false;\n }\n });\n }\n\n _onVaadinOverlayClose(e) {\n if (this._openedWithFocusRing && this.hasAttribute('focused')) {\n this.focusElement.setAttribute('focus-ring', '');\n } else if (!this.hasAttribute('focused')) {\n this.focusElement.blur();\n }\n if (e.detail.sourceEvent && e.detail.sourceEvent.composedPath().indexOf(this) !== -1) {\n e.preventDefault();\n }\n }\n\n _toggle(e) {\n e.stopPropagation();\n this[(this._overlayInitialized && this.$.overlay.opened) ? 'close' : 'open']();\n }\n\n _input() {\n return this.$.input;\n }\n\n set _inputValue(value) {\n this._inputElement.value = value;\n }\n\n get _inputValue() {\n return this._inputElement.value;\n }\n\n _getAriaExpanded(opened) {\n return Boolean(opened).toString();\n }\n\n /**\n * Focussable element used by vaadin-control-state-mixin\n */\n get focusElement() {\n return this._input() || this;\n }\n\n _setClearButtonLabel(i18nClear) {\n // FIXME(platosha): expose i18n API in <vaadin-text-field>\n // https://github.com/vaadin/vaadin-text-field/issues/348\n this._inputElement.shadowRoot.querySelector('[part=\"clear-button\"]')\n .setAttribute('aria-label', i18nClear);\n }\n}\n\ncustomElements.define(DatePickerElement.is, DatePickerElement);\n\nexport { DatePickerElement };\n","/**\n@license\nCopyright (c) 2017 Vaadin Ltd.\nThis program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n*/\nimport { IronA11yKeysBehavior } from '@polymer/iron-a11y-keys-behavior/iron-a11y-keys-behavior.js';\n\nimport { IronResizableBehavior } from '@polymer/iron-resizable-behavior/iron-resizable-behavior.js';\nimport { DatePickerHelper } from './vaadin-date-picker-helper.js';\nimport { addListener } from '@polymer/polymer/lib/utils/gestures.js';\nimport { mixinBehaviors } from '@polymer/polymer/lib/legacy/class.js';\n\n/**\n * @polymerMixin\n */\nexport const DatePickerMixin = subclass => class VaadinDatePickerMixin extends mixinBehaviors(\n [IronResizableBehavior], subclass\n) {\n\n static get properties() {\n return {\n /**\n * The current selected date.\n */\n _selectedDate: {\n type: Date\n },\n\n _focusedDate: Date,\n\n /**\n * The value for this element.\n *\n * Supported date formats:\n * - ISO 8601 `\"YYYY-MM-DD\"` (default)\n * - 6-digit extended ISO 8601 `\"+YYYYYY-MM-DD\"`, `\"-YYYYYY-MM-DD\"`\n *\n * @type {String}\n */\n value: {\n type: String,\n observer: '_valueChanged',\n notify: true,\n value: ''\n },\n\n /**\n * Set to true to mark the input as required.\n */\n required: {\n type: Boolean,\n value: false\n },\n\n /**\n * The name of this element.\n */\n name: {\n type: String\n },\n\n /**\n * Date which should be visible when there is no value selected.\n *\n * The same date formats as for the `value` property are supported.\n */\n initialPosition: String,\n\n /**\n * The label for this element.\n */\n label: String,\n\n /**\n * Set true to open the date selector overlay.\n */\n opened: {\n type: Boolean,\n reflectToAttribute: true,\n notify: true,\n observer: '_openedChanged'\n },\n\n /**\n * Set true to display ISO-8601 week numbers in the calendar. Notice that\n * displaying week numbers is only supported when `i18n.firstDayOfWeek`\n * is 1 (Monday).\n */\n showWeekNumbers: {\n type: Boolean\n },\n\n _fullscreen: {\n value: false,\n observer: '_fullscreenChanged'\n },\n\n _fullscreenMediaQuery: {\n value: '(max-width: 420px), (max-height: 420px)'\n },\n\n // An array of ancestor elements whose -webkit-overflow-scrolling is forced from value\n // 'touch' to value 'auto' in order to prevent them from clipping the dropdown. iOS only.\n _touchPrevented: Array,\n\n /**\n * The object used to localize this component.\n * To change the default localization, replace the entire\n * _i18n_ object or just the property you want to modify.\n *\n * The object has the following JSON structure and default values:\n\n {\n // An array with the full names of months starting\n // with January.\n monthNames: [\n 'January', 'February', 'March', 'April', 'May',\n 'June', 'July', 'August', 'September',\n 'October', 'November', 'December'\n ],\n\n // An array of weekday names starting with Sunday. Used\n // in screen reader announcements.\n weekdays: [\n 'Sunday', 'Monday', 'Tuesday', 'Wednesday',\n 'Thursday', 'Friday', 'Saturday'\n ],\n\n // An array of short weekday names starting with Sunday.\n // Displayed in the calendar.\n weekdaysShort: [\n 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'\n ],\n\n // An integer indicating the first day of the week\n // (0 = Sunday, 1 = Monday, etc.).\n firstDayOfWeek: 0,\n\n // Used in screen reader announcements along with week\n // numbers, if they are displayed.\n week: 'Week',\n\n // Translation of the Calendar icon button title.\n calendar: 'Calendar',\n\n // Translation of the Clear icon button title.\n clear: 'Clear',\n\n // Translation of the Today shortcut button text.\n today: 'Today',\n\n // Translation of the Cancel button text.\n cancel: 'Cancel',\n\n // A function to format given `Object` as\n // date string. Object is in the format `{ day: ..., month: ..., year: ... }`\n // Note: The argument month is 0-based. This means that January = 0 and December = 11.\n formatDate: d => {\n // returns a string representation of the given\n // object in 'MM/DD/YYYY' -format\n },\n\n // A function to parse the given text to an `Object` in the format `{ day: ..., month: ..., year: ... }`.\n // Must properly parse (at least) text formatted by `formatDate`.\n // Setting the property to null will disable keyboard input feature.\n // Note: The argument month is 0-based. This means that January = 0 and December = 11.\n parseDate: text => {\n // Parses a string in 'MM/DD/YY', 'MM/DD' or 'DD' -format to\n // an `Object` in the format `{ day: ..., month: ..., year: ... }`.\n }\n\n // A function to format given `monthName` and\n // `fullYear` integer as calendar title string.\n formatTitle: (monthName, fullYear) => {\n return monthName + ' ' + fullYear;\n }\n }\n\n *\n * @default {English/US}\n */\n i18n: {\n type: Object,\n value: () => {\n return {\n monthNames: [\n 'January', 'February', 'March', 'April', 'May',\n 'June', 'July', 'August', 'September', 'October', 'November', 'December'\n ],\n weekdays: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],\n weekdaysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n firstDayOfWeek: 0,\n week: 'Week',\n calendar: 'Calendar',\n clear: 'Clear',\n today: 'Today',\n cancel: 'Cancel',\n formatDate: d => {\n const yearStr = String(d.year).replace(/\\d+/, y => '0000'.substr(y.length) + y);\n return [d.month + 1, d.day, yearStr].join('/');\n },\n parseDate: text => {\n const parts = text.split('/');\n const today = new Date();\n let date, month = today.getMonth(), year = today.getFullYear();\n\n if (parts.length === 3) {\n year = parseInt(parts[2]);\n if (parts[2].length < 3 && year >= 0) {\n year += year < 50 ? 2000 : 1900;\n }\n month = parseInt(parts[0]) - 1;\n date = parseInt(parts[1]);\n } else if (parts.length === 2) {\n month = parseInt(parts[0]) - 1;\n date = parseInt(parts[1]);\n } else if (parts.length === 1) {\n date = parseInt(parts[0]);\n }\n\n if (date !== undefined) {\n return {day: date, month, year};\n }\n },\n formatTitle: (monthName, fullYear) => {\n return monthName + ' ' + fullYear;\n }\n };\n }\n },\n\n /**\n * The earliest date that can be selected. All earlier dates will be disabled.\n *\n * Supported date formats:\n * - ISO 8601 `\"YYYY-MM-DD\"` (default)\n * - 6-digit extended ISO 8601 `\"+YYYYYY-MM-DD\"`, `\"-YYYYYY-MM-DD\"`\n *\n * @type {String}\n */\n min: {\n type: String,\n observer: '_minChanged'\n },\n\n /**\n * The latest date that can be selected. All later dates will be disabled.\n *\n * Supported date formats:\n * - ISO 8601 `\"YYYY-MM-DD\"` (default)\n * - 6-digit extended ISO 8601 `\"+YYYYYY-MM-DD\"`, `\"-YYYYYY-MM-DD\"`\n *\n * @type {String}\n */\n max: {\n type: String,\n observer: '_maxChanged'\n },\n\n /**\n * The earliest date that can be selected. All earlier dates will be disabled.\n */\n _minDate: {\n type: Date,\n // null does not work here because minimizer passes undefined to overlay (#351)\n value: ''\n },\n\n /**\n * The latest date that can be selected. All later dates will be disabled.\n */\n _maxDate: {\n type: Date,\n value: ''\n },\n\n _noInput: {\n type: Boolean,\n computed: '_isNoInput(_fullscreen, _ios, i18n, i18n.*)'\n },\n\n _ios: {\n type: Boolean,\n value: navigator.userAgent.match(/iP(?:hone|ad;(?: U;)? CPU) OS (\\d+)/)\n },\n\n _webkitOverflowScroll: {\n type: Boolean,\n value: document.createElement('div').style.webkitOverflowScrolling === ''\n },\n\n _ignoreAnnounce: {\n value: true\n },\n\n _focusOverlayOnOpen: Boolean,\n\n _overlayInitialized: Boolean\n };\n }\n\n static get observers() {\n return [\n '_updateHasValue(value)',\n '_validateInput(_selectedDate, _minDate, _maxDate)',\n '_selectedDateChanged(_selectedDate, i18n.formatDate)',\n '_focusedDateChanged(_focusedDate, i18n.formatDate)',\n '_announceFocusedDate(_focusedDate, opened, _ignoreAnnounce)'\n ];\n }\n\n ready() {\n super.ready();\n this._boundOnScroll = this._onScroll.bind(this);\n this._boundFocus = this._focus.bind(this);\n this._boundUpdateAlignmentAndPosition = this._updateAlignmentAndPosition.bind(this);\n\n addListener(this, 'tap', e => {\n // FIXME(platosha): use preventDefault in the text field clear button,\n // then the following composedPath check could be simplified down\n // to `if (!e.defaultPrevented)`.\n // https://github.com/vaadin/vaadin-text-field/issues/352\n const inputIndex = e.composedPath().indexOf(this._inputElement);\n if (\n e.composedPath().slice(0, inputIndex)\n .filter(el => el.getAttribute && el.getAttribute('part') === 'clear-button')\n .length === 0\n ) {\n this.open();\n }\n });\n\n this.addEventListener('touchend', this._preventDefault.bind(this));\n this.addEventListener('keydown', this._onKeydown.bind(this));\n this.addEventListener('input', this._onUserInput.bind(this));\n this.addEventListener('focus', e => this._noInput && e.target.blur());\n }\n\n _initOverlay() {\n this.$.overlay.removeAttribute('disable-upgrade');\n this._overlayInitialized = true;\n\n this.$.overlay.addEventListener('opened-changed', e => this.opened = e.detail.value);\n\n this._overlayContent.addEventListener('close', this._close.bind(this));\n this._overlayContent.addEventListener('focus-input', this._focusAndSelect.bind(this));\n this.$.overlay.addEventListener('vaadin-overlay-escape-press', this._boundFocus);\n\n // Keep focus attribute in focusElement for styling\n this._overlayContent.addEventListener('focus', () => this.focusElement._setFocused(true));\n\n this.$.overlay.addEventListener('vaadin-overlay-close', this._onVaadinOverlayClose.bind(this));\n }\n\n /**\n * @protected\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n\n if (this._overlayInitialized) {\n this.$.overlay.removeEventListener('vaadin-overlay-escape-press', this._boundFocus);\n }\n\n this.opened = false;\n }\n\n /**\n * Opens the dropdown.\n */\n open() {\n if (!this.disabled && !this.readonly) {\n this.opened = true;\n }\n }\n\n _close(e) {\n if (e) {\n e.stopPropagation();\n }\n this._focus();\n this.close();\n }\n\n /**\n * Closes the dropdown.\n */\n close() {\n if (this._overlayInitialized) {\n this.$.overlay.close();\n }\n }\n\n get _inputElement() {\n return this._input();\n }\n\n get _nativeInput() {\n if (this._inputElement) {\n // vaadin-text-field's input is focusElement\n // iron-input's input is inputElement\n return this._inputElement.focusElement ? this._inputElement.focusElement :\n this._inputElement.inputElement ? this._inputElement.inputElement :\n window.unwrap ? window.unwrap(this._inputElement) : this._inputElement;\n }\n }\n\n _parseDate(str) {\n // Parsing with RegExp to ensure correct format\n var parts = /^([-+]\\d{1}|\\d{2,4}|[-+]\\d{6})-(\\d{1,2})-(\\d{1,2})$/.exec(str);\n if (!parts) {\n return;\n }\n\n var date = new Date(0, 0); // Wrong date (1900-01-01), but with midnight in local time\n date.setFullYear(parseInt(parts[1], 10));\n date.setMonth(parseInt(parts[2], 10) - 1);\n date.setDate(parseInt(parts[3], 10));\n return date;\n }\n\n _isNoInput(fullscreen, ios, i18n) {\n return !this._inputElement || fullscreen || ios || !i18n.parseDate;\n }\n\n _formatISO(date) {\n if (!(date instanceof Date)) {\n return '';\n }\n\n const pad = (num, fmt = '00') => (fmt + num).substr((fmt + num).length - fmt.length);\n\n let yearSign = '';\n let yearFmt = '0000';\n let yearAbs = date.getFullYear();\n if (yearAbs < 0) {\n yearAbs = -yearAbs;\n yearSign = '-';\n yearFmt = '000000';\n } else if (date.getFullYear() >= 10000) {\n yearSign = '+';\n yearFmt = '000000';\n }\n\n const year = yearSign + pad(yearAbs, yearFmt);\n const month = pad(date.getMonth() + 1);\n const day = pad(date.getDate());\n return [year, month, day].join('-');\n }\n\n _openedChanged(opened) {\n if (opened && !this._overlayInitialized) {\n this._initOverlay();\n }\n if (this._overlayInitialized) {\n this.$.overlay.opened = opened;\n }\n if (opened) {\n this._updateAlignmentAndPosition();\n }\n }\n\n _selectedDateChanged(selectedDate, formatDate) {\n if (selectedDate === undefined || formatDate === undefined) {\n return;\n }\n if (this.__userInputOccurred) {\n this.__dispatchChange = true;\n }\n const inputValue = selectedDate && formatDate(DatePickerHelper._extractDateParts(selectedDate));\n const value = this._formatISO(selectedDate);\n if (value !== this.value) {\n this.validate(inputValue);\n this.value = value;\n }\n this.__userInputOccurred = false;\n this.__dispatchChange = false;\n this._focusedDate = selectedDate;\n this._inputValue = selectedDate ? inputValue : '';\n }\n\n _focusedDateChanged(focusedDate, formatDate) {\n if (focusedDate === undefined || formatDate === undefined) {\n return;\n }\n this.__userInputOccurred = true;\n if (!this._ignoreFocusedDateChange && !this._noInput) {\n this._inputValue = focusedDate ? formatDate(DatePickerHelper._extractDateParts(focusedDate)) : '';\n }\n }\n\n _updateHasValue(value) {\n if (value) {\n this.setAttribute('has-value', '');\n } else {\n this.removeAttribute('has-value');\n }\n }\n\n\n __getOverlayTheme(theme, overlayInitialized) {\n if (overlayInitialized) {\n return theme;\n }\n }\n\n _handleDateChange(property, value, oldValue) {\n if (!value) {\n this[property] = '';\n return;\n }\n\n var date = this._parseDate(value);\n if (!date) {\n this.value = oldValue;\n return;\n }\n if (!DatePickerHelper._dateEquals(this[property], date)) {\n this[property] = date;\n }\n }\n\n _valueChanged(value, oldValue) {\n if (this.__dispatchChange) {\n this.dispatchEvent(new CustomEvent('change', {bubbles: true}));\n }\n this._handleDateChange('_selectedDate', value, oldValue);\n }\n\n _minChanged(value, oldValue) {\n this._handleDateChange('_minDate', value, oldValue);\n }\n\n _maxChanged(value, oldValue) {\n this._handleDateChange('_maxDate', value, oldValue);\n }\n\n _updateAlignmentAndPosition() {\n if (!this._overlayInitialized) {\n return;\n }\n if (!this._fullscreen) {\n const inputRect = this._inputElement.getBoundingClientRect();\n\n const bottomAlign = inputRect.top > window.innerHeight / 2;\n const rightAlign = inputRect.left + this.clientWidth / 2 > window.innerWidth / 2;\n\n if (rightAlign) {\n const viewportWidth = Math.min(window.innerWidth, document.documentElement.clientWidth);\n this.$.overlay.setAttribute('right-aligned', '');\n this.$.overlay.style.removeProperty('left');\n this.$.overlay.style.right = (viewportWidth - inputRect.right) + 'px';\n } else {\n this.$.overlay.removeAttribute('right-aligned');\n this.$.overlay.style.removeProperty('right');\n this.$.overlay.style.left = inputRect.left + 'px';\n }\n\n if (bottomAlign) {\n const viewportHeight = Math.min(window.innerHeight, document.documentElement.clientHeight);\n this.$.overlay.setAttribute('bottom-aligned', '');\n this.$.overlay.style.removeProperty('top');\n this.$.overlay.style.bottom = (viewportHeight - inputRect.top) + 'px';\n } else {\n this.$.overlay.removeAttribute('bottom-aligned');\n this.$.overlay.style.removeProperty('bottom');\n this.$.overlay.style.top = inputRect.bottom + 'px';\n }\n }\n\n this.$.overlay.setAttribute('dir',\n getComputedStyle(this._inputElement).getPropertyValue('direction')\n );\n this._overlayContent._repositionYearScroller();\n }\n\n _fullscreenChanged() {\n if (this._overlayInitialized && this.$.overlay.opened) {\n this._updateAlignmentAndPosition();\n }\n }\n\n _onOverlayOpened() {\n this._openedWithFocusRing = this.hasAttribute('focus-ring') || (this.focusElement && this.focusElement.hasAttribute('focus-ring'));\n\n var parsedInitialPosition = this._parseDate(this.initialPosition);\n\n var initialPosition = this._selectedDate || this._overlayContent.initialPosition ||\n parsedInitialPosition || new Date();\n\n if (parsedInitialPosition ||\n DatePickerHelper._dateAllowed(initialPosition, this._minDate, this._maxDate)) {\n this._overlayContent.initialPosition = initialPosition;\n } else {\n this._overlayContent.initialPosition =\n DatePickerHelper._getClosestDate(initialPosition, [this._minDate, this._maxDate]);\n }\n\n this._overlayContent.scrollToDate(this._overlayContent.focusedDate || this._overlayContent.initialPosition);\n // Have a default focused date\n this._ignoreFocusedDateChange = true;\n this._overlayContent.focusedDate = this._overlayContent.focusedDate || this._overlayContent.initialPosition;\n this._ignoreFocusedDateChange = false;\n\n window.addEventListener('scroll', this._boundOnScroll, true);\n this.addEventListener('iron-resize', this._boundUpdateAlignmentAndPosition);\n\n if (this._webkitOverflowScroll) {\n this._touchPrevented = this._preventWebkitOverflowScrollingTouch(this.parentElement);\n }\n\n if (this._focusOverlayOnOpen) {\n this._overlayContent.focus();\n this._focusOverlayOnOpen = false;\n } else {\n this._focus();\n }\n\n if (this._noInput && this.focusElement) {\n this.focusElement.blur();\n }\n\n this.updateStyles();\n\n this._ignoreAnnounce = false;\n }\n\n // A hack needed for iOS to prevent dropdown from being clipped in an\n // ancestor container with -webkit-overflow-scrolling: touch;\n _preventWebkitOverflowScrollingTouch(element) {\n var result = [];\n while (element) {\n if (window.getComputedStyle(element).webkitOverflowScrolling === 'touch') {\n var oldInlineValue = element.style.webkitOverflowScrolling;\n element.style.webkitOverflowScrolling = 'auto';\n result.push({\n element: element,\n oldInlineValue: oldInlineValue\n });\n }\n element = element.parentElement;\n }\n return result;\n }\n\n _onOverlayClosed() {\n this._ignoreAnnounce = true;\n\n window.removeEventListener('scroll', this._boundOnScroll, true);\n this.removeEventListener('iron-resize', this._boundUpdateAlignmentAndPosition);\n\n if (this._touchPrevented) {\n this._touchPrevented.forEach(prevented =>\n prevented.element.style.webkitOverflowScrolling = prevented.oldInlineValue);\n this._touchPrevented = [];\n }\n\n this.updateStyles();\n\n // Select the parsed input or focused date\n this._ignoreFocusedDateChange = true;\n if (this.i18n.parseDate) {\n var inputValue = this._inputValue || '';\n const dateObject = this.i18n.parseDate(inputValue);\n const parsedDate = dateObject &&\n this._parseDate(`${dateObject.year}-${dateObject.month + 1}-${dateObject.day}`);\n\n if (this._isValidDate(parsedDate)) {\n this._selectedDate = parsedDate;\n } else {\n this._selectedDate = null;\n this._inputValue = inputValue;\n }\n } else if (this._focusedDate) {\n this._selectedDate = this._focusedDate;\n }\n this._ignoreFocusedDateChange = false;\n\n if (this._nativeInput && this._nativeInput.selectionStart) {\n this._nativeInput.selectionStart = this._nativeInput.selectionEnd;\n }\n this.validate();\n }\n\n /**\n * Returns true if `value` is valid, and sets the `invalid` flag appropriately.\n *\n * @param {string} value Value to validate. Optional, defaults to user's input value.\n * @return {boolean} True if the value is valid and sets the `invalid` flag appropriately\n */\n validate(value) {\n // reset invalid state on the underlying text field\n this.invalid = false;\n value = value !== undefined ? value : this._inputValue;\n return !(this.invalid = !this.checkValidity(value));\n }\n\n /**\n * Returns true if the current input value satisfies all constraints (if any)\n *\n * Override the `checkValidity` method for custom validations.\n *\n * @param {string} value Value to validate. Optional, defaults to the selected date.\n * @return {boolean} True if the value is valid\n */\n checkValidity(value) {\n var inputValid = !value ||\n (this._selectedDate && value === this.i18n.formatDate(DatePickerHelper._extractDateParts(this._selectedDate)));\n var minMaxValid = !this._selectedDate ||\n DatePickerHelper._dateAllowed(this._selectedDate, this._minDate, this._maxDate);\n\n var inputValidity = true;\n if (this._inputElement) {\n if (this._inputElement.checkValidity) {\n // vaadin native input elements have the checkValidity method\n inputValidity = this._inputElement.checkValidity(value);\n } else if (this._inputElement.validate) {\n // iron-form-elements have the validate API\n inputValidity = this._inputElement.validate(value);\n }\n }\n\n return inputValid && minMaxValid && inputValidity;\n }\n\n _onScroll(e) {\n if (e.target === window || !this._overlayContent.contains(e.target)) {\n this._updateAlignmentAndPosition();\n }\n }\n\n _focus() {\n if (this._noInput) {\n this._overlayInitialized && this._overlayContent.focus();\n } else {\n this._inputElement.focus();\n }\n }\n\n _focusAndSelect() {\n this._focus();\n this._setSelectionRange(0, this._inputValue.length);\n }\n\n _setSelectionRange(a, b) {\n if (this._nativeInput && this._nativeInput.setSelectionRange) {\n this._nativeInput.setSelectionRange(a, b);\n }\n }\n\n _preventDefault(e) {\n e.preventDefault();\n }\n\n /**\n * Keyboard Navigation\n */\n _eventKey(e) {\n var keys = ['down', 'up', 'enter', 'esc', 'tab'];\n\n for (var i = 0; i < keys.length; i++) {\n var k = keys[i];\n if (IronA11yKeysBehavior.keyboardEventMatchesKeys(e, k)) {\n return k;\n }\n }\n }\n\n _isValidDate(d) {\n return d && !isNaN(d.getTime());\n }\n\n _onKeydown(e) {\n if (this._noInput) {\n // The input element cannot be readonly as it would conflict with\n // the required attribute. Both are not allowed on an input element.\n // Therefore we prevent default on most keydown events.\n var allowedKeys = [\n 9 // tab\n ];\n if (allowedKeys.indexOf(e.keyCode) === -1) {\n e.preventDefault();\n }\n }\n\n switch (this._eventKey(e)) {\n case 'down':\n case 'up':\n // prevent scrolling the page with arrows\n e.preventDefault();\n\n if (this.opened) {\n this._overlayContent.focus();\n this._overlayContent._onKeydown(e);\n } else {\n this._focusOverlayOnOpen = true;\n this.open();\n }\n\n break;\n case 'enter': {\n const dateObject = this.i18n.parseDate(this._inputValue);\n const parsedDate = dateObject &&\n this._parseDate(dateObject.year + '-' + (dateObject.month + 1) + '-' + dateObject.day);\n\n if (this._overlayInitialized && this._overlayContent.focusedDate && this._isValidDate(parsedDate)) {\n this._selectedDate = this._overlayContent.focusedDate;\n }\n this.close();\n break;\n }\n case 'esc':\n this._focusedDate = this._selectedDate;\n this._close();\n break;\n case 'tab':\n if (this.opened) {\n e.preventDefault();\n // Clear the selection range (remains visible on IE)\n this._setSelectionRange(0, 0);\n if (e.shiftKey) {\n this._overlayContent.focusCancel();\n } else {\n this._overlayContent.focus();\n this._overlayContent.revealDate(this._focusedDate);\n }\n\n }\n break;\n }\n }\n\n _validateInput(date, min, max) {\n if (date && (min || max)) {\n this.invalid = !DatePickerHelper._dateAllowed(date, min, max);\n }\n }\n\n _onUserInput(e) {\n if (!this.opened && this._inputElement.value) {\n this.open();\n }\n this._userInputValueChanged();\n }\n\n _userInputValueChanged(value) {\n if (this.opened && this._inputValue) {\n const dateObject = this.i18n.parseDate && this.i18n.parseDate(this._inputValue);\n const parsedDate = dateObject &&\n this._parseDate(`${dateObject.year}-${dateObject.month + 1}-${dateObject.day}`);\n\n if (this._isValidDate(parsedDate)) {\n this._ignoreFocusedDateChange = true;\n if (!DatePickerHelper._dateEquals(parsedDate, this._focusedDate)) {\n this._focusedDate = parsedDate;\n }\n this._ignoreFocusedDateChange = false;\n }\n }\n }\n\n _announceFocusedDate(_focusedDate, opened, _ignoreAnnounce) {\n if (opened && !_ignoreAnnounce) {\n this._overlayContent.announceFocusedDate();\n }\n }\n\n get _overlayContent() {\n return this.$.overlay.content.querySelector('#overlay-content');\n }\n\n /**\n * Fired when the user commits a value change.\n *\n * @event change\n */\n};\n","import {\n dictionary,\n locale,\n addMessages,\n _\n} from 'svelte-i18n';\n\nfunction setupI18n({ withLocale: _locale, translations }) {\n locale.subscribe((data) => {\n if (data == null) {\n dictionary.set(translations);\n locale.set(_locale);\n }\n }); // maybe we will need this to make sure that the i18n is set up only once\n /*dictionary.set(translations);\n locale.set(_locale);*/\n}\n\nfunction addNewMessages(lang, dict) {\n addMessages(lang, dict);\n}\n\nfunction setLocale(_locale) {\n locale.set(_locale);\n}\n\nexport { _, setupI18n, addNewMessages, setLocale };\n","export const PlayerBonusHistoryTranslations = {\n en: {\n bonusHistory: {\n title: `Bonus History`,\n dateFrom: `From:`,\n dateTo: `To:`,\n dateFilter: `Filter`,\n noBonusHistory: `You have no bonuses for the selected period.`\n }\n },\n zh: {\n bonusHistory: {\n title: `獎金歷史`,\n dateFrom: `從:`,\n dateTo: `至:`,\n dateFilter: `篩選`,\n noBonusHistory: `您目前沒有獎金歷史。`\n }\n },\n fr: {\n bonusHistory: {\n title: `Historique du bonus`,\n dateFrom: `De:`,\n dateTo: `A:`,\n dateFilter: `Filtre`,\n noBonusHistory: `Vous n'avez pas d'historique de bonus pour le moment.`\n }\n },\n ro: {\n bonusHistory: {\n title: `Istoric bonusuri`,\n dateFrom: `De la`,\n dateTo: `La`,\n dateFilter: `Filtru`,\n noBonusHistory: `Nu ai bonusuri pentru perioada selectata.`\n }\n },\n es: {\n bonusHistory: {\n title: `Historial de bonos`,\n dateFrom: `Desde:`,\n dateTo: `Para:`,\n dateFilter: `Filtro:`,\n noBonusHistory: `Actualmente no tienes historial de bonos.`\n }\n },\n pt: {\n bonusHistory: {\n title: `Histórico de bônus`,\n dateFrom: `A partir de:`,\n dateTo: `Para:`,\n dateFilter: `Filtro:`,\n noBonusHistory: `Você não tem histórico de bônus no momento.`\n }\n },\n};\n","<svelte:options tag={null} />\n<script lang=\"ts\">\n import { onMount } from 'svelte';\n import { getDevice } from 'rvhelper';\n import moment from 'moment';\n\n import '@everymatrix/player-bonus-card';\n import '@vaadin/vaadin-date-picker/vaadin-date-picker.js';\n import { _, addNewMessages, setLocale } from './i18n';\n import { PlayerBonusHistoryTranslations } from './translations';\n\n export let endpoint:string = '';\n export let session:string = '';\n export let playerid:string = '';\n export let lang:string = 'en';\n export let translationUrl:string = '';\n\n let isLoading:boolean = false;\n let userAgent:string = window.navigator.userAgent;\n let isMobile:boolean = (getDevice(userAgent) === 'PC') ? false : true;\n let startCalendar:HTMLElement;\n let endCalendar:HTMLElement;\n let maxDate:string;\n let lastMonth:string;\n\n maxDate = moment(new Date()).format('YYYY-MM-DD');\n lastMonth = moment(new Date()).subtract(3, 'months').format('YYYY-MM-DD')\n\n let bonusCalendarStartDate:string = lastMonth;\n let bonusCalendarEndDate:string = maxDate;\n\n let bonusesPrevPage:number = 0;\n let bonusesNextPage:number = 0;\n let bonusesLastPage:number = 0;\n let numberOfPages:number = 0;\n let bonusesPerPage:number = 6;\n let currentPage:number = 0;\n let bonusesList:Array<Object> = [];\n\n const setTranslationUrl = ():void => {\n let url:string = translationUrl;\n\n fetch(url).then((res:any) => res.json())\n .then((res) => {\n Object.keys(res).forEach((item:any):void => {\n addNewMessages(item, res[item]);\n });\n }).catch((err:any) => {\n console.log(err);\n });\n }\n\n Object.keys(PlayerBonusHistoryTranslations).forEach((item:any) => {\n addNewMessages(item, PlayerBonusHistoryTranslations[item]);\n });\n\n const toggleScreen = ():void => {\n window.postMessage({type: 'PlayerAccountMenuActive', isMobile}, window.location.href);\n }\n\n const getBonuses = (offset:number):void => {\n let url:URL = new URL(`${endpoint}/player/${playerid}/bonusWallet`);\n\n let startDate:string = new Date(bonusCalendarStartDate).toISOString();\n let endDate:string = new Date(bonusCalendarEndDate).toISOString();\n\n let filter:string = `status=closed,status=forfeited,status=released,status=expired,type=standard,type=freeround,type=freebet,granted=[${startDate}~${endDate}]`;\n\n url.searchParams.append('filter', filter);\n url.searchParams.append('pagination', `offset=${offset},limit=${bonusesPerPage}`);\n\n let options = {\n method: \"GET\",\n headers: {\n 'X-SessionId': session,\n }\n };\n\n fetch(url.href, options)\n .then((res:any) => res.json())\n .then((data:any) => {\n numberOfPages = (Math.ceil(data.total/bonusesPerPage));\n\n if ((offset - bonusesPerPage) >= 0) {\n bonusesPrevPage = offset - bonusesPerPage;\n }\n\n if ((offset + bonusesPerPage) < data.total) {\n bonusesNextPage = offset + bonusesPerPage;\n }\n\n bonusesLastPage = (numberOfPages - 1) * bonusesPerPage;\n currentPage = offset / bonusesPerPage;\n\n bonusesList = data.items;\n }, (err:any) => {\n console.error(err);\n });\n }\n\n const startCalendarHandler = (e:any):void => {\n bonusCalendarStartDate = e.target.value;\n }\n\n const endCalendarHandler = (e:any):void => {\n bonusCalendarEndDate = e.target.value;\n }\n\n const setCalendarEventListener = ():void => {\n startCalendar.addEventListener('change', startCalendarHandler, false);\n endCalendar.addEventListener('change', endCalendarHandler, false);\n }\n\n onMount(() => {\n return () => {\n startCalendar.removeEventListener('change', startCalendarHandler);\n endCalendar.removeEventListener('change', endCalendarHandler);\n }\n });\n\n const initialLoad = () => {\n setLocale(lang);\n }\n\n $: lang && initialLoad();\n $: startCalendar && endCalendar && setCalendarEventListener();\n $: session && playerid && endpoint && getBonuses(0);\n $: translationUrl && setTranslationUrl();\n</script>\n\n{#if isLoading}\n <div class=\"ModalLoader\" part=\"ModalLoader\"></div>\n{:else}\n <div class=\"BonusesWrapper {isMobile ? 'BonusesWrapperMobile' : ''}\" part=\"BonusesWrapper {isMobile ? 'BonusesWrapperMobile' : ''}\">\n {#if isMobile}\n <div class=\"MenuReturnButton\" part=\"MenuReturnButton\" on:click={() => toggleScreen()}>\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"15\" height=\"15\" viewBox=\"0 0 15 15\"><defs><style>.aaa{fill:var(--emfe-w-color-primary, #D0046C);}</style></defs><g transform=\"translate(-20 -158)\">\n <g transform=\"translate(20 158)\">\n <path class=\"aaa\" d=\"M7.5,0,6.136,1.364,11.3,6.526H0V8.474H11.3L6.136,13.636,7.5,15,15,7.5Z\" transform=\"translate(15 15) rotate(180)\"/>\n </g></g>\n </svg>\n <h2 class=\"BonusesTitleMobile\" part=\"BonusesTitleMobile\">{$_('bonusHistory.title')}</h2>\n </div>\n {/if}\n <h2 class=\"BonusesTitle {isMobile ? 'BonusesTitleNone' : ''}\" part=\"BonusesTitle {isMobile ? 'BonusesTitleNone' : ''}\">{$_('bonusHistory.title')}</h2>\n\n <div class=\"BonusCalendarWrapper {isMobile ? 'BonusCalendarWrapperMobile' : ''}\" part=\"BonusCalendarWrapper {isMobile ? 'BonusCalendarWrapperMobile' : ''}\">\n <div class=\"BonusesCalendarContainer {isMobile ? 'BonusesCalendarContainerMobile' : ''}\" part=\"BonusesCalendarContainer {isMobile ? 'BonusesCalendarContainerMobile' : ''}\">\n <div class=\"BonusesCalendarStartDate {isMobile ? 'BonusesCalendarMobile' : ''}\" part=\"BonusesCalendarStartDate {isMobile ? 'BonusesCalendarMobile' : ''}\">\n <label for=\"BonusCalendarStartDate\">{$_('bonusHistory.dateFrom')}</label>\n <vaadin-date-picker bind:this={startCalendar} max={maxDate} value={lastMonth} placeholder=\"From\" class=\"VaadinDatePicker\" part=\"VaadinDatePicker\"></vaadin-date-picker>\n </div>\n <div class=\"BonusesCalendarEndDate {isMobile ? 'BonusesCalendarMobile' : ''}\" part=\"BonusesCalendarEndDate {isMobile ? 'BonusesCalendarMobile' : ''}\">\n <label for=\"BonusesCalendarEndDate\">{$_('bonusHistory.dateTo')}</label>\n <vaadin-date-picker bind:this={endCalendar} max={maxDate} value={maxDate} placeholder=\"To\" class=\"VaadinDatePicker\" part=\"VaadinDatePicker\"></vaadin-date-picker>\n </div>\n </div>\n <button class=\"BonusesCalendarFilter {isMobile ? 'BonusesCalendarFilterMobile' : ''}\" part=\"BonusesCalendarFilter {isMobile ? 'BonusesCalendarFilterMobile' : ''}\" on:click={() => getBonuses(0)}>{$_('bonusHistory.dateFilter')}</button>\n </div>\n <div class=\"BonusesGrid {isMobile ? 'BonusesGridMobile' : ''}\" part=\"BonusesGrid {isMobile ? 'BonusesGridMobile' : ''}\">\n {#if bonusesList.length === 0}\n <p>{$_('bonusHistory.noBonusHistory')}</p>\n {:else}\n {#each bonusesList as bonus}\n {#if bonus.type === 'freeRound'}\n <player-bonus-card\n bonuswalletid={bonus.walletId}\n bonusdate={bonus.granted}\n bonusstatus={bonus.status}\n bonusname={bonus.name}\n bonustype={bonus.type}\n bonuscurrency={bonus.currency}\n {lang}\n ></player-bonus-card>\n {:else}\n <player-bonus-card\n bonuswalletid={bonus.walletId}\n bonusdate={bonus.granted}\n bonusstatus={bonus.status}\n bonusname={bonus.name}\n bonustype={bonus.type}\n bonusamount={bonus.grantedAmount}\n bonuswageringamount={bonus.totalWR}\n bonusremainingamount={bonus.currentAmount}\n bonuscurrency={bonus.currency}\n {lang}\n ></player-bonus-card>\n {/if}\n {/each}\n {/if}\n </div>\n {#if bonusesList.length !== 0}\n <div class=\"BonusesPaginationWrapper {isMobile ? 'BonusesPaginationWrapperMobile' : ''}\" part=\"BonusesPaginationWrapper {isMobile ? 'BonusesPaginationWrapperMobile' : ''}\">\n <span class=\"BonusesFirst {currentPage === 0 ? 'Inactive' : ''}\" part=\"BonusesFirst {currentPage === 0 ? 'Inactive' : ''}\" on:click={() => getBonuses(0)}>&vert;&lt;</span>\n <span class=\"BonusesPrev {currentPage === 0 ? 'Inactive' : ''}\" part=\"BonusesPrev {currentPage === 0 ? 'Inactive' : ''}\" on:click={() => getBonuses(bonusesPrevPage)}>&lt;</span>\n {#each Array(numberOfPages) as _, i}\n <span class=\"BonusesPage {i === currentPage ? 'BonusPageActive' : ''}\" part=\"BonusesPage {i === currentPage ? 'BonusPageActive' : ''}\" on:click={() => getBonuses(i*bonusesPerPage)}>{i+1}</span>\n {/each}\n <span class=\"BonusesNext {currentPage === (numberOfPages - 1) ? 'Inactive' : ''}\" part=\"BonusesNext {currentPage === (numberOfPages - 1) ? 'Inactive' : ''}\" on:click={() => getBonuses(bonusesNextPage)}>&gt;</span>\n <span class=\"BonusesLast {currentPage === (numberOfPages - 1) ? 'Inactive' : ''}\" part=\"BonusesLast {currentPage === (numberOfPages - 1) ? 'Inactive' : ''}\" on:click={() => getBonuses(bonusesLastPage)}>&gt;&vert;</span>\n </div>\n {/if}\n </div>\n{/if}\n\n<style lang=\"scss\">\n\n :host {\n font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';\n }\n\n .BonusesWrapper {\n color: var(--emfe-w-color-contrast, #07072A);\n padding: 50px;\n max-width: 850px;\n\n &.BonusesWrapperMobile {\n padding: 20px 15px;\n max-width: unset;\n }\n }\n\n .MenuReturnButton{\n color: var(--emfe-w-color-primary, #D0046C);\n display: inline-flex;\n align-items: center;\n column-gap: 10px;\n margin-bottom: 10px;\n & svg {\n fill: var(--emfe-w-color-primary, #D0046C);\n }\n }\n\n .BonusesTitle {\n font-size: 26px;\n color: var(--emfe-w-color-primary, #D0046C);\n font-weight: 400;\n }\n\n .BonusesTitleMobile {\n font-size: 16px;\n }\n\n .BonusesTitleNone {\n display: none;\n }\n\n .BonusCalendarWrapper {\n display: flex;\n gap: 15px;\n padding-bottom: 30px;\n align-items: center;\n &.BonusCalendarWrapperMobile {\n flex-direction: column;\n gap: 10px;\n padding-bottom: 15px;\n }\n }\n\n .BonusesCalendarContainer {\n display: flex;\n gap: 20px;\n &.BonusesCalendarContainerMobile {\n flex-direction: row;\n gap: 0;\n justify-content: space-between;\n padding-bottom: 0;\n width: 100%;\n }\n }\n\n .BonusesCalendarStartDate,\n .BonusesCalendarEndDate {\n color: var(--emfe-w-color-gray-300, #58586B);\n display: flex;\n position: relative;\n align-items: center;\n gap: 10px;\n &.BonusesCalendarMobile {\n flex-direction: column;\n align-items: flex-start;\n gap: 5px;\n width: 48%;\n .VaadinDatePicker {\n width: 100%;\n }\n }\n\n label {\n font-size: 14px;\n font-weight: 300;\n }\n\n input {\n width: 100%;\n height: 44px;\n border: 1px solid var(--emfe-w-color-gray-100, #E6E6E6);\n border-radius: 5px;\n box-sizing: border-box;\n padding: 5px 15px;\n font-size: 16px;\n line-height: 18px;\n outline-color: var(--emfe-w-color-primary, #D0046C);\n }\n }\n\n .BonusesCalendarFilter {\n background: var(--emfe-w-color-primary, #D0046C);\n border: 1px solid var(--emfe-w-color-primary, #D0046C);\n color: var(--emfe-w-color-white, #FFFFFF);\n cursor: pointer;\n border-radius: 5px;\n width: 120px;\n height: 40px;\n font-size: 15px;\n text-transform: uppercase;\n text-align: center;\n transition-duration: 0.3s;\n box-sizing: border-box;\n padding: 10px;\n &.BonusesCalendarFilterMobile {\n width: 100%;\n height: 44px;\n }\n\n &:active {\n background: var(--emfe-w-color-primary-600, #99034F);\n }\n }\n\n .BonusesGrid {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 50px;\n\n &.BonusesGridMobile {\n grid-template-columns: 1fr;\n gap: 20px;\n }\n }\n\n .BonusesPaginationWrapper {\n margin: 40px 0;\n display: flex;\n justify-content: center;\n &.BonusesPaginationWrapperMobile {\n text-align: center;\n }\n .BonusesFirst, .BonusesPrev, .BonusesNext, .BonusesLast {\n color: var(--emfe-w-color-primary, #D0046C);\n font-size: 16px;\n cursor: pointer;\n padding: 5px 10px;\n font-weight: 700;\n &.Inactive {\n color: var(--emfe-w-color-gray-100, #E6E6E6);\n cursor: default;\n }\n }\n .BonusesPage {\n margin: 0 5px;\n color: var(--emfe-w-color-gray-300, #58586B);\n font-size: 16px;\n cursor: pointer;\n padding: 5px 10px;\n &.BonusPageActive {\n background-color: var(--emfe-w-color-white, #FFFFFF);\n font-weight: 700;\n }\n }\n }\n</style>\n","import PlayerBonusHistory from './PlayerBonusHistory.svelte';\n!customElements.get('player-bonus-history') && customElements.define('player-bonus-history', PlayerBonusHistory);\nexport default PlayerBonusHistory;\n"],"names":["noop","run","fn","blank_object","Object","create","run_all","fns","forEach","is_function","thing","safe_not_equal","a","b","subscribe","store","callbacks","unsub","unsubscribe","component_subscribe","component","callback","$$","on_destroy","push","append","target","node","appendChild","insert","anchor","insertBefore","detach","parentNode","removeChild","destroy_each","iterations","detaching","let","i","length","d","element","name","document","createElement","svg_element","createElementNS","text","data","createTextNode","space","empty","listen","event","handler","options","addEventListener","removeEventListener","attr","attribute","value","removeAttribute","getAttribute","setAttribute","set_custom_element_data","prop","set_data","wholeText","attribute_to_object","attributes","result","current_component","set_current_component","dirty_components","binding_callbacks","render_callbacks","flush_callbacks","resolved_promise","Promise","resolve","update_scheduled","add_render_callback","seen_callbacks","Set","flushidx","flush","saved_component","dirty","update","fragment","before_update","p","ctx","after_update","pop","has","add","clear","outroing","init","instance","create_fragment","not_equal","props","append_styles","parent_component","bound","on_mount","on_disconnect","context","Map","skip_bound","root","ready","ret","rest","then","fill","hydrate","nodes","Array","from","childNodes","l","c","intro","block","delete","local","customElement","m","new_on_destroy","map","filter","SvelteElement","HTMLElement","constructor","super","this","attachShadow","mode","connectedCallback","key","slotted","attributeChangedCallback","_oldValue","newValue","disconnectedCallback","$destroy","$on","type","index","indexOf","splice","$set","$$props","$$set","keys","viewClasses","isArrayBufferView","global","globalThis","self","support","Symbol","Blob","e","normalizeName","String","test","TypeError","toLowerCase","normalizeValue","iteratorFor","items","iterator","next","shift","done","Headers","headers","isArray","header","getOwnPropertyNames","consumed","body","bodyUsed","reject","fileReaderReady","reader","onload","onerror","error","readBlobAsArrayBuffer","blob","FileReader","promise","readAsArrayBuffer","bufferClone","buf","slice","view","Uint8Array","byteLength","set","buffer","Body","_initBody","obj","_bodyInit","_bodyText","prototype","isPrototypeOf","_bodyBlob","FormData","_bodyFormData","URLSearchParams","toString","DataView","_bodyArrayBuffer","ArrayBuffer","call","get","rejected","Error","arrayBuffer","isView","byteOffset","readAsText","chars","fromCharCode","join","formData","decode","json","JSON","parse","oldValue","hasOwnProperty","thisArg","values","entries","methods","Request","input","reParamSearch","url","credentials","method","signal","upcased","toUpperCase","referrer","cache","replace","Date","getTime","form","trim","split","bytes","decodeURIComponent","Response","bodyInit","status","undefined","ok","statusText","clone","response","redirectStatuses","DOMException","redirect","RangeError","location","err","message","stack","fetch","request","aborted","xhr","XMLHttpRequest","abortXhr","abort","rawHeaders","getAllResponseHeaders","substr","line","parts","responseURL","responseText","setTimeout","ontimeout","onabort","open","href","withCredentials","responseType","setRequestHeader","onreadystatechange","readyState","send","fetch$1","polyfill","bind","extendStatics","setPrototypeOf","__proto__","__extends","__","__values","o","s","__read","n","r","ar","return","__spreadArray","to","pack","arguments","concat","isFunction","createErrorClass","createImpl","ctorFunc","UnsubscriptionError","_super","errors","arrRemove","arr","item","Subscription","e_1","_a","e_2","_b","closed","_parentage","_parentage_1","_parentage_1_1","remove","e_1_1","initialFinalizer","initialTeardown","_finalizers","_finalizers_1","_finalizers_1_1","finalizer","execFinalizer","e_2_1","teardown","_hasParent","_addParent","parent","includes","_removeParent","EMPTY","EMPTY_SUBSCRIPTION","isSubscription","config","timeoutProvider","timeout","args","_i","delegate","apply","clearTimeout","handle","t","errorContext","cb","isRoot","errorThrown","Subscriber","complete","SafeSubscriber","isStopped","_next","_error","_complete","destination","_bind","Function","_this","EMPTY_OBSERVER","ConsumerObserver","partialObserver","handleUnhandledError","observerOrNext","context_1","observable","identity","x","Observable","lift","operator","source","subscriber","_subscribe","_trySubscribe","sink","promiseCtor","getPromiseCtor","Symbol_observable","pipe","operations","reduce","prev","toPromise","ObjectUnsubscribedError","Subject","subject","AnonymousSubject","_throwIfClosed","currentObservers","observers","_c","hasError","thrownError","defineProperty","enumerable","configurable","_checkFinalizedStatuses","_innerSubscribe","asObservable","dateTimestampProvider","now","ReplaySubject","_buffer","_infiniteTimeWindow","_timestampProvider","_windowTime","_trimBuffer","subscription","copy","_bufferSize","adjustedBufferSize","Infinity","last","Math","max","topics","subjects","subscriber_queue","writable","start","stop","subscribers","new_value","run_queue","invalidate","size","derived","stores","initial_value","single","stores_array","auto","inited","pending","cleanup","sync","unsubscribers","isMergeableObject","stringValue","$$typeof","REACT_ELEMENT_TYPE","for","cloneUnlessOtherwiseSpecified","deepmerge","defaultArrayMerge","getKeys","getOwnPropertySymbols","symbol","propertyIsEnumerable","propertyIsOnObject","object","property","_","mergeObject","customMerge","arrayMerge","sourceIsArray","all","array","cjs","ErrorKind","TYPE","SKELETON_TYPE","__assign","assign","isLiteralElement","el","literal","isNumberElement","number","isDateElement","date","isTimeElement","time","isSelectElement","select","isPluralElement","plural","isTagElement","tag","isNumberSkeleton","isDateTimeSkeleton","dateTime","EXPECT_ARGUMENT_CLOSING_BRACE","EMPTY_ARGUMENT","MALFORMED_ARGUMENT","EXPECT_ARGUMENT_TYPE","INVALID_ARGUMENT_TYPE","EXPECT_ARGUMENT_STYLE","INVALID_NUMBER_SKELETON","INVALID_DATE_TIME_SKELETON","EXPECT_NUMBER_SKELETON","EXPECT_DATE_TIME_SKELETON","UNCLOSED_QUOTE_IN_ARGUMENT_STYLE","EXPECT_SELECT_ARGUMENT_OPTIONS","EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE","INVALID_PLURAL_ARGUMENT_OFFSET_VALUE","EXPECT_SELECT_ARGUMENT_SELECTOR","EXPECT_PLURAL_ARGUMENT_SELECTOR","EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT","EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT","INVALID_PLURAL_ARGUMENT_SELECTOR","DUPLICATE_PLURAL_ARGUMENT_SELECTOR","DUPLICATE_SELECT_ARGUMENT_SELECTOR","MISSING_OTHER_CLAUSE","INVALID_TAG","INVALID_TAG_NAME","UNMATCHED_CLOSING_TAG","UNCLOSED_TAG","argument","pound","SPACE_SEPARATOR_REGEX","DATE_TIME_REGEX","WHITE_SPACE_REGEX","FRACTION_PRECISION_REGEX","SIGNIFICANT_PRECISION_REGEX","INTEGER_WIDTH_REGEX","CONCISE_INTEGER_WIDTH_REGEX","parseSignificantPrecision","str","roundingPriority","g1","g2","minimumSignificantDigits","maximumSignificantDigits","parseSign","signDisplay","currencySign","parseNotationOptions","opt","parseNumberSkeleton","tokens","tokens_1","conciseScientificAndEngineeringOpts","token","stem","style","scale","currency","useGrouping","maximumFractionDigits","unit","notation","compactDisplay","currencyDisplay","unitDisplay","parseFloat","g3","g4","g5","minimumIntegerDigits","minimumFractionDigits","trailingZeroDisplay","signOpts","parseConciseScientificAndEngineeringStem","timeData","AX","BQ","CP","CZ","DK","FI","ID","IS","ML","NE","RU","SE","SJ","SK","AS","BT","DJ","ER","GH","IN","LS","PG","PW","SO","TO","VU","WS","001","AL","TD","ca-ES","CF","CM","fr-CA","gl-ES","it-CH","it-IT","LU","NP","PF","SC","SM","SN","TF","VA","CY","GR","CO","DO","KP","KR","NA","PA","PR","VE","AC","AI","BW","BZ","CC","CK","CX","DG","FK","GB","GG","GI","IE","IM","IO","JE","LT","MK","MN","MS","NF","NG","NR","NU","PN","SH","SX","TA","ZA","af-ZA","AR","CL","CR","CU","EA","es-BO","es-BR","es-EC","es-ES","es-GQ","es-PE","GT","HN","IC","KG","KM","LK","MA","MX","NI","PY","SV","UY","JP","AD","AM","AO","AT","AW","BE","BF","BJ","BL","BR","CG","CI","CV","DE","EE","FR","GA","GF","GN","GP","GW","HR","IL","IT","KZ","MC","MD","MF","MQ","MZ","NC","NL","PM","PT","RE","RO","SI","SR","ST","TG","TR","WF","YT","BD","PK","AZ","BA","BG","CH","GE","LI","ME","RS","UA","UZ","XK","AG","AU","BB","BM","BS","CA","DM","en-001","FJ","FM","GD","GM","GU","GY","JM","KI","KN","KY","LC","LR","MH","MP","MW","NZ","SB","SG","SL","SS","SZ","TC","TT","UM","US","VC","VG","VI","ZM","BO","EC","ES","GQ","PE","AE","ar-001","BH","DZ","EG","EH","HK","IQ","JO","KW","LB","LY","MO","MR","OM","PH","PS","QA","SA","SD","SY","TN","YE","AF","LA","CN","LV","TL","zu-ZA","CD","IR","hi-IN","kn-IN","ml-IN","te-IN","KH","ta-IN","BN","MY","ET","gu-IN","mr-IN","pa-IN","TW","KE","MM","TZ","UG","SPACE_SEPARATOR_START_REGEX","RegExp","SPACE_SEPARATOR_END_REGEX","createLocation","end","hasNativeStartsWith","startsWith","hasNativeFromCodePoint","fromCodePoint","hasNativeFromEntries","fromEntries","hasNativeCodePointAt","codePointAt","hasTrimStart","trimStart","hasTrimEnd","trimEnd","isSafeInteger","Number","isFinite","floor","abs","REGEX_SUPPORTS_U_AND_Y","exec","IDENTIFIER_PREFIX_RE_1","matchIdentifierAtIndex","search","position","codePoints","code","elements","entries_1","k","v","first","charCodeAt","second","flag","lastIndex","match","_isWhiteSpace","Parser","offset","parseMessage","nestingLevel","parentArgType","expectingCloseTag","isEOF","char","parseArgument","val","ignoreTag","peek","clonePosition","_isAlpha","parseTag","parseLiteral","bump","startPosition","tagName","parseTagName","bumpSpace","bumpIf","childrenResult","children","endTagStartPosition","closingTagNameStartPosition","startOffset","parseQuoteResult","tryParseQuote","parseUnquotedResult","tryParseUnquoted","parseLeftAngleResult","tryParseLeftAngleBracket","codepoint","ch","openingBracePosition","parseIdentifierIfPossible","parseArgumentOptions","startingPosition","endOffset","bumpTo","typeStartPosition","argType","typeEndPosition","styleAndLocation","styleStartPosition","parseSimpleArgStyleIfPossible","styleLocation","argCloseResult","tryParseArgumentClose","location_1","skeleton","parseNumberSkeletonFromString","dateTimePattern","locale","skeletonCopy","patternPos","patternChar","charAt","extraLength","hourLen","dayPeriodLen","hourChar","regionTag","hourCycle","hourCycles","languageTag","language","maximize","region","getDefaultHourSymbolFromLocale","pattern","parsedOptions","shouldParseSkeletons","len","era","year","month","day","weekday","hour12","hour","minute","timeZoneName","typeEndPosition_1","identifierAndLocation","pluralOffset","tryParseDecimalInteger","optionsResult","tryParsePluralOrSelectOptions","location_2","pluralType","nestedBraces","apostrophePosition","bumpUntil","stringTokens_1","stemAndOptions","options_1","expectCloseTag","parsedFirstIdentifier","hasOtherClause","parsedSelectors","selector","selectorLocation","fragmentResult","requiresOtherClause","expectNumberError","invalidNumberError","sign","hasDigits","decimal","column","kind","prefix","currentOffset","targetOffset","min","nextCode","opts","SyntaxError","originalMessage","captureLocation","pruneLocation","els","memoize","cacheDefault","serializer","serializerDefault","strategy","assemble","monadic","variadic","arg","cacheKey","computedValue","serialize","stringify","ObjectWithoutPrototypeCache","ErrorCode","strategies","MISSING_VALUE","INVALID_VALUE","MISSING_INTL_API","FormatError","PART_TYPE","InvalidValueError","InvalidValueTypeError","MissingValueError","variableId","msg","formatToParts","locales","formatters","formats","currentPluralValue","els_1","getNumberFormat","format","varName","getDateTimeFormat","medium","value_1","formatFn","chunks","other","Intl","PluralRules","rule","getPluralRules","part","lastPart","createFastMemoizeCache","IntlMessageFormat","memoizedDefaultLocale","NumberFormat","resolvedOptions","resolveLocale","supportedLocales","supportedLocalesOf","Locale","__parse","integer","percent","short","long","full","overrideFormats","defaultConfig","configs","defaultLocale","formatterCache","pluralRules","ast","resolvedLocale","getAst","c1","c2","DateTimeFormat","E","u","g","h","some","default","j","fallbackLocale","loadingDelay","scientific","engineering","compactLong","compactShort","warnOnMissingMessages","handleMissingMessage","T","L","reverse","P","window","documentElement","D","finally","C","G","J","U","V","H","Y","id","console","warn","defaultValue","f","getDevice","emWidgets","topic","step","replaySubject","userAgent","module","exports","hookCallback","hooks","isObject","hasOwnProp","isObjectEmpty","isUndefined","isNumber","isDate","res","arrLen","extend","valueOf","createUTC","strict","createLocalOrUTC","utc","getParsingFlags","_pf","unusedTokens","unusedInput","overflow","charsLeftOver","nullInput","invalidEra","invalidMonth","invalidFormat","userInvalidated","iso","parsedDateParts","meridiem","rfc2822","weekdayMismatch","isValid","_isValid","flags","parsedParts","isNowValid","isNaN","_d","invalidWeekday","_strict","bigHour","isFrozen","createInvalid","NaN","fun","momentProperties","updateInProgress","copyConfig","momentPropertiesLen","_isAMomentObject","_f","_l","_tzm","_isUTC","_offset","_locale","Moment","updateOffset","isMoment","suppressDeprecationWarnings","deprecate","firstTime","deprecationHandler","argLen","deprecations","deprecateSimple","mergeConfigs","parentConfig","childConfig","zeroFill","targetLength","forceSign","absNumber","pow","formattingTokens","localFormattingTokens","formatFunctions","formatTokenFunctions","addFormatToken","padded","ordinal","func","localeData","formatMoment","expandFormat","mom","output","makeFormatFunction","invalidDate","replaceLongDateFormatTokens","longDateFormat","aliases","addUnitAlias","shorthand","lowerCase","normalizeUnits","units","normalizeObjectUnits","inputObject","normalizedProp","normalizedInput","priorities","addUnitPriority","priority","isLeapYear","absFloor","ceil","toInt","argumentForCoercion","coercedNumber","makeGetSet","keepTime","set$1","daysInMonth","match1","match2","match3","match4","match6","match1to2","match3to4","match5to6","match1to3","match1to4","match1to6","matchUnsigned","matchSigned","matchOffset","matchShortOffset","matchWord","addRegexToken","regex","strictRegex","regexes","isStrict","getParseRegexForToken","regexEscape","matched","p1","p2","p3","p4","addParseToken","tokenLen","addWeekParseToken","_w","YEAR","MONTH","DATE","HOUR","MINUTE","SECOND","MILLISECOND","WEEK","WEEKDAY","modMonth","monthsShort","months","monthsShortRegex","monthsRegex","monthsParse","defaultLocaleMonths","defaultLocaleMonthsShort","MONTHS_IN_FORMAT","defaultMonthsShortRegex","defaultMonthsRegex","setMonth","dayOfMonth","getSetMonth","computeMonthsParse","cmpLenRev","shortPieces","longPieces","mixedPieces","sort","_monthsRegex","_monthsShortRegex","_monthsStrictRegex","_monthsShortStrictRegex","daysInYear","y","parseTwoDigitYear","parseInt","getSetYear","createDate","M","ms","getFullYear","setFullYear","createUTCDate","UTC","getUTCFullYear","setUTCFullYear","firstWeekOffset","dow","doy","fwd","getUTCDay","dayOfYearFromWeeks","week","resYear","dayOfYear","resDayOfYear","weekOfYear","resWeek","weekOffset","weeksInYear","weekOffsetNext","shiftWeekdays","ws","weekdaysMin","weekdaysShort","weekdays","weekdaysMinRegex","weekdaysShortRegex","weekdaysRegex","weekdaysParse","defaultLocaleWeekdays","defaultLocaleWeekdaysShort","defaultLocaleWeekdaysMin","defaultWeekdaysRegex","defaultWeekdaysShortRegex","defaultWeekdaysMinRegex","computeWeekdaysParse","minp","shortp","longp","minPieces","_weekdaysRegex","_weekdaysShortRegex","_weekdaysMinRegex","_weekdaysStrictRegex","_weekdaysShortStrictRegex","_weekdaysMinStrictRegex","hFormat","hours","lowercase","minutes","matchMeridiem","_meridiemParse","seconds","kInput","_isPm","isPM","_meridiem","pos","pos1","pos2","getSetHour","globalLocale","baseConfig","calendar","sameDay","nextDay","nextWeek","lastDay","lastWeek","sameElse","LTS","LL","LLL","LLLL","dayOfMonthOrdinalParse","relativeTime","future","past","ss","mm","hh","dd","w","ww","yy","meridiemParse","localeFamilies","normalizeLocale","chooseLocale","names","loadLocale","commonPrefix","arr1","arr2","minl","oldLocale","_abbr","require","getSetGlobalLocale","getLocale","defineLocale","abbr","_config","parentLocale","checkOverflow","_overflowDayOfYear","_overflowWeeks","_overflowWeekday","extendedIsoRegex","basicIsoRegex","tzRegex","isoDates","isoTimes","aspNetJsonRegex","obsOffsets","UT","GMT","EDT","EST","CDT","CST","MDT","MST","PDT","PST","configFromISO","allowTime","dateFormat","timeFormat","tzFormat","string","isoDatesLen","isoTimesLen","configFromStringAndFormat","extractFromRFC2822Strings","yearStr","monthStr","dayStr","hourStr","minuteStr","secondStr","untruncateYear","configFromRFC2822","parsedArray","weekdayStr","parsedInput","getDay","obsOffset","militaryOffset","numOffset","hm","setUTCMinutes","getUTCMinutes","defaults","configFromArray","currentDate","weekYear","weekdayOverflow","curWeek","nowValue","_useUTC","getUTCMonth","getUTCDate","getMonth","getDate","W","createLocal","_week","gg","temp","_dayOfYear","yearToUse","_nextDay","expectedWeekday","ISO_8601","RFC_2822","stringLength","totalParsedInputLength","skipped","meridiemHour","isPm","erasConvertYear","prepareConfig","dayOrDate","preparse","tempConfig","bestMoment","scoreToBeat","currentScore","validFormatFound","bestFormatIsValid","configfLen","score","configFromStringAndArray","createFromInputFallback","millisecond","isUTC","prototypeMin","prototypeMax","pickBy","moments","ordering","Duration","duration","years","quarters","quarter","weeks","isoWeek","days","milliseconds","unitHasDecimal","orderLen","isDurationValid","_milliseconds","_days","_months","_data","_bubble","isDuration","absRound","round","separator","utcOffset","offsetFromString","chunkOffset","matcher","matches","cloneWithOffset","model","diff","setTime","getDateOffset","getTimezoneOffset","isUtc","aspNetRegex","isoRegex","createDuration","diffRes","parseIso","base","isBefore","positiveMomentsDifference","inp","isAfter","createAdder","direction","period","tmp","addSubtract","isAdding","invalid","subtract","isString","isMomentInput","arrayTest","dataTypeTest","objectTest","propertyTest","properties","propertyLen","isMomentInputObject","monthDiff","wholeMonthDiff","newLocaleData","defaultFormat","defaultFormatUtc","lang","MS_PER_400_YEARS","mod$1","dividend","divisor","localStartOfDate","utcStartOfDate","matchEraAbbr","erasAbbrRegex","computeErasParse","abbrPieces","namePieces","narrowPieces","eras","narrow","_erasRegex","_erasNameRegex","_erasAbbrRegex","_erasNarrowRegex","addWeekYearFormatToken","getter","getSetWeekYearHelper","weeksTarget","dayOfYearData","z","erasNameRegex","erasNarrowRegex","erasParse","_eraYearOrdinalRegex","eraYearOrdinalParse","isoWeekYear","_dayOfMonthOrdinalParse","_ordinalParse","_dayOfMonthOrdinalParseLenient","getSetDayOfMonth","getSetMinute","getSetSecond","parseMs","getSetMillisecond","proto","preParsePostFormat","isCalendarSpec","sod","startOf","calendarFormat","asFloat","that","zoneDelta","endOf","startOfDate","isoWeekday","inputString","postformat","withoutSuffix","humanize","fromNow","toNow","invalidAt","localInput","isBetween","inclusivity","localFrom","localTo","isSame","inputMs","isSameOrAfter","isSameOrBefore","parsingFlags","prioritized","unitsObj","getPrioritizedUnits","prioritizedLen","toArray","toObject","toDate","toISOString","keepOffset","inspect","zone","isLocal","toJSON","unix","creationData","eraName","since","until","eraNarrow","eraAbbr","eraYear","dir","getSetWeek","isoWeeks","weekInfo","weeksInWeekYear","isoWeeksInYear","isoWeeksInISOWeekYear","getSetDayOfWeek","keepLocalTime","keepMinutes","localAdjust","_changeInProgress","parseZone","tZone","hasAlignedHourOffset","isDST","isUtcOffset","zoneAbbr","zoneName","dates","isDSTShifted","_isDSTShifted","compareArrays","array1","array2","dontConvert","lengthDiff","diffs","proto$1","get$1","field","setter","listMonthsImpl","out","listWeekdaysImpl","localeSorted","_calendar","_longDateFormat","formatUpper","tok","_invalidDate","_ordinal","isFuture","_relativeTime","pastFuture","_eras","isFormat","standalone","_monthsShort","monthName","_monthsParseExact","ii","llc","toLocaleLowerCase","_monthsParse","_longMonthsParse","_shortMonthsParse","firstDayOfYear","firstDayOfWeek","_weekdays","_weekdaysMin","_weekdaysShort","weekdayName","_weekdaysParseExact","_weekdaysParse","_shortWeekdaysParse","_minWeekdaysParse","_fullWeekdaysParse","isLower","langData","mathAbs","addSubtract$1","absCeil","daysToMonths","monthsToDays","makeAs","alias","as","asMilliseconds","asSeconds","asMinutes","asHours","asDays","asWeeks","asMonths","asQuarters","asYears","makeGetter","thresholds","relativeTime$1","posNegDuration","substituteTimeAgo","abs$1","toISOString$1","ymSign","daysSign","hmsSign","total","toFixed","proto$2","add$1","subtract$1","monthsFromDays","argWithSuffix","argThresholds","withSuffix","th","toIsoString","version","updateLocale","tmpLocale","relativeTimeRounding","roundingFunction","relativeTimeThreshold","threshold","limit","myMoment","HTML5_FMT","DATETIME_LOCAL","DATETIME_LOCAL_SECONDS","DATETIME_LOCAL_MS","TIME","TIME_SECONDS","TIME_MS","addNewMessages","dict","addMessages","PlayerBonusCardTranslations","en","bonusCard","bonusName","bonusType","bonusAmount","wageringAmount","remainingBonus","forfeitBonus","zh","fr","ro","es","pt","t0_value","div","p0","t0","t_value","button","t2_value","moment","t6_value","t10_value","create_if_block_3","create_if_block_2","create_if_block_1","if_block3","create_if_block","p1_class_value","p1_part_value","div4","div3","div0","span","div1","div2","p5","t2","t6","t10","bonuswalletid","bonusdate","bonusstatus","bonusname","bonustype","bonusamount","bonuswageringamount","bonusremainingamount","bonuscurrency","translationUrl","navigator","isMobile","bonusTypeText","$$invalidate","catch","log","postMessage","customElements","define","Lumo","resolveFn","readyPromise","whenReady","HTMLImports","documentWait","requestAnimationFrame","SEEN_MARKER","CACHED_STYLE","transformFn","validateFn","CustomStyleInterface","customStyles","enqueued","ShadyCSS","flushCustomStyles","enqueueDocumentValidation","addCustomStyle","getStyleForCustomStyle","customStyle","getStyle","processStyles","cs","styleToTransform","__appliedElement","defineProperties","transformCallback","validateCallback","needsEnqueue","VAR_ASSIGN","MIXIN_MATCH","MEDIA_MATCH","updateNativeProperties","removeProperty","setProperty","getComputedStyleValue","getComputedStyle","getPropertyValue","nativeShadow","ShadyDOM","inUse","nativeCssVariables_","cssBuild","calcCssVariables","settings","shimcssproperties","Boolean","CSS","supports","disableRuntime","nativeCss","WebComponents","nativeCssVariables","Ur","customStyleInterface","prepareTemplate","template","elementName","elementExtends","prepareTemplateDom","prepareTemplateStyles","styleSubtree","styleElement","styleDocument","JSCompiler_renameProperty","workingURL","resolveDoc","CSS_URL_RX","ABS_URL","resolveUrl","baseURI","URL","pathname","implementation","createHTMLDocument","head","resolveCss","cssText","pre","post","pathFromUrl","substring","lastIndexOf","useShadow","supportsAdoptingStyleSheets","Document","CSSStyleSheet","sheet","host","replaceSync","shadowRoot","adoptedStyleSheets","rootPath","Polymer","sanitizeDOMValue","passiveTouchGestures","setPassiveTouchGestures","strictTemplatePolicy","allowTemplateFromDomModule","legacyOptimizations","legacyWarnings","syncInitialRender","legacyUndefined","orderedComputed","removeNestedTemplates","fastDomIf","suppressTemplateNotifications","legacyNoObservedAttributes","useAdoptedStyleSheetsWithBuiltCSS","modules","lcModules","setModule","findModule","DomModule","observedAttributes","static","querySelector","old","namespace","register","assetpath","__assetpath","owner","importForElement","ownerDocument","SHADY_UNSCOPED_ATTR","importModule","moduleId","import","styleForImport","importDoc","importCss","textContent","stylesFromModules","moduleIds","styles","_styles","_stylesFromModuleImports","stylesFromTemplate","stylesFromModule","e$","content","querySelectorAll","include","p$","unscoped","hasAttribute","_unscopedStyle","_style","CustomStyle","_cssText","cssFromModule","$_documentContainer","$_documentContainer$h","innerHTML","$_documentContainer$g","$_documentContainer$f","$_documentContainer$e","$_documentContainer$d","$_documentContainer$c","policy","$_documentContainer$b","trustedTypes","createPolicy","createHTML","LiteralString","strings","assertValidTemplateStringParameters","acc","idx","literalValue","html","HTMLTemplateElement","raw","dedupeId","dedupingMixin","mixin","mixinApplications","__mixinApplications","mixinDedupeId","WeakMap","baseSet","__mixinSet","extended","mixinSet","wrap","noPatch","patch","isPath","path","dotIndex","isAncestor","isDescendant","translate","newBase","normalize","info","caseMap","DASH_TO_CAMEL","CAMEL_TO_DASH","dashToCamelCase","dash","camelToDashCase","camel","microtaskCurrHandle","microtaskLastHandle","microtaskCallbacks","microtaskNodeContent","microtaskScheduled","microtaskNode","MutationObserver","observe","characterData","timeOut","after","delay","cancel","animationFrame","cancelAnimationFrame","idlePeriod","requestIdleCallback","cancelIdleCallback","microTask","microtask","PropertiesChanged","superClass","_createPropertyAccessor","readOnly","_addPropertyToAttributeMap","__dataHasAccessor","_definePropertyAccessor","__dataAttributes","attributeNameForProperty","__data","_setPendingProperty","_invalidateProperties","__dataEnabled","__dataReady","__dataInvalid","__dataPending","__dataOld","__dataInstanceProps","__dataCounter","__serializing","_initializeProperties","_flushProperties","_initializeInstanceProperties","_setProperty","_getProperty","ext","changed","_shouldPropertyChange","_isPropertyPending","_enableProperties","changedProps","_shouldPropertiesChange","_propertiesChanged","currentProps","oldProps","_attributeToProperty","_deserializeValue","typeForProperty","_propertyToAttribute","_valueToNodeAttribute","_serializeValue","emptyScript","nativeProperties","getPrototypeOf","isTrustedType","isHTML","isScript","isScriptURL","PropertyAccessors","a$","__dataProto","_initializeProtoProperties","_ensureAttribute","outValue","_hasAccessor","templateExtensions","dom-if","dom-repeat","placeholderBugDetect","placeholderBug","copyAttributeWithTemplateEventPolicy","polymerTemplateEventAttributePolicy","createScript","dest","src","TemplateStamp","outerTemplateInfo","_templateInfo","templateInfo","nestedTemplate","stripWhiteSpace","_parseTemplateContent","nodeInfo","_parseTemplateNode","noted","localName","hasInsertionPoint","_parseTemplateNestedTemplate","placeholder","firstChild","_parseTemplateChildNodes","hasAttributes","_parseTemplateNodeAttributes","parentIndex","is","replaceChild","wrapTemplateExtension","nextSibling","nodeType","Node","TEXT_NODE","childInfo","parentInfo","infoIndex","nodeInfoList","_parseTemplate","createDocumentFragment","attrs","_parseTemplateNodeAttribute","events","_stampTemplate","decorate","dom","importNode","__noInsertionPoint","nodeList","$","findTemplateNode","inst","parentTemplateInfo","_parentTemplateInfo","_addMethodEventListenerToNode","applyTemplateInfo","eventName","methodName","detail","_methodHost","_addEventListenerToNode","_removeEventListenerFromNode","NOOP","TYPES","COMPUTE","REFLECT","NOTIFY","PROPAGATE","OBSERVE","READ_ONLY","capitalAttributeRegex","ensureOwnEffectMap","cloneArrays","effects","protoFx","instFx","runEffects","hasPaths","extraArgs","ran","fxs","fx","lastRun","pathMatchesTrigger","trigger","triggerPath","structured","wildcard","runObserverEffect","changedProp","dynamicFn","dispatchNotifyEvent","queueProperty","dispatchEvent","CustomEvent","runNotifyEffect","runReflectEffect","attrName","insertEffect","queue","order","mid","cmp","methodInfo","enqueueEffectsFor","computeEffects","runComputedEffect","runMethodEffect","computedProp","addBinding","bindings","binding","isCompound","negate","listenerEvent","listenerNegate","compoundIndex","dependencies","addEffectForBindingPart","evaluator","parseArg","_addTemplatePropertyEffect","rootProperty","runBindingEffect","__isPropertyEffectsClient","_setPendingPropertyOrPath","_enqueueClient","_evaluateBinding","storage","__dataCompoundStorage","_setUnmanagedPropertyToNode","addNotifyListener","fromProp","toPath","fromPath","currentTarget","createMethodEffect","sig","effectFn","_addPropertyEffect","_marshalArgs","emptyArray","bindingRegex","OPEN_BRACKET","literalFromParts","parseMethod","expression","argList","rawArg","fc","getArgValue","notifySplices","splices","splicesData","indexSplices","_overrideLegacyUndefined","notifyPath","notifySplice","addedCount","removed","PropertyEffects","propertyEffectsBase","__dataClientsReady","__dataPendingClients","__dataToNotify","__dataLinkedPaths","__dataHasPaths","__dataHost","__dataTemp","__dataClientsInitialized","__computeEffects","__computeInfo","__reflectEffects","__notifyEffects","__propagateEffects","__observeEffects","__readOnly","__templateInfo","PROPERTY_EFFECT_TYPES","_registerHost","hostStack","effect","_removePropertyEffect","_hasPropertyEffect","_hasReadOnlyEffect","_hasNotifyEffect","_hasReflectEffect","_hasComputedEffect","shouldNotify","isPathNotification","links","link","propIsPath","prevProps","client","_flushClients","__enableOrFlushClients","_readyClients","clients","setProperties","setReadOnly","notifyProps","ordered","__orderedComputedDeps","curr","counts","infoForComputed","computedDeps","computedByCurr","inputProps","_propagatePropertyChanges","notified","runEffectsForProperty","_runEffectsForTemplate","baseRunEffects","propertyEffects","linkPaths","unlinkPaths","hadLength","deleteCount","unshift","propPath","_createReadOnlyProperty","protectedSetter","_createPropertyObserver","_createMethodObserver","_createNotifyingProperty","_createReflectedProperty","_createComputedProperty","pathValue","_bindTemplate","instanceBinding","wasPreBound","__preBoundTemplateInfo","previous","lastChild","previousSibling","hostProps","literals","_removeBoundDom","_parseBindings","origName","nestedTemplateInfo","isDomIf","isDomRepeat","hostProp","customEvent","notifyEvent","colon","signature","dynamicFns","PropertiesMixin","superPropertiesClass","superCtor","ownProperties","__ownProperties","_properties","__observedAttributes","finalize","__finalized","_finalizeClass","createProperties","__properties","builtCSS","ElementMixin","polymerElementBase","polymerElementVersion","__ownObservers","createObservers","_prepareTemplate","cloneNode","_template","allProps","computed","reflectToAttribute","notify","observer","protoTemplate","importPath","meta","importMeta","_importPath","_finalizeTemplate","__propertyDefaults","_canApplyPropertyDefault","__polymerFinalized","klass","templateStyles","stylesWithImports","linkedStyles","firstTemplateChild","firstElementChild","_processStyleText","templateStyleIndex","templateStyle","css","_styleSheet","_attachDom","shadyUpgradeFragment","flushInitial","updateStyles","PolymerElement","Debouncer","_asyncModule","_callback","_timer","setConfig","asyncModule","debouncerQueue","isActive","_cancelAsync","debouncer","enqueueDebouncer","HAS_NATIVE_TA","touchAction","GESTURE_KEY","HANDLED_OBJ","TOUCH_ACTION","MOUSE_EVENTS","MOUSE_WHICH_TO_BUTTONS","MOUSE_HAS_BUTTONS","MouseEvent","buttons","isMouseEvent","supportsPassive","PASSIVE_TOUCH","passive","IS_TOUCH_ONLY","clickedLabels","labellable","keygen","meter","textarea","progress","canBeDisabled","command","fieldset","optgroup","option","mouseCanceller","mouseEvent","sc","sourceCapabilities","firesTouchEvents","skip","clickFromLabel","getComposedPath","ELEMENT_NODE","ownerLabels","labels","getRootNode","matching","matchingLabels","POINTERSTATE","mouse","preventDefault","stopPropagation","setupTeardownMouseCanceller","setup","hasLeftMouseButton","ev","which","mouseIgnoreJob","touch","scrollDecided","trackDocument","stateObj","movefn","upfn","untrackDocument","debounce","composedPath","gestures","recognizers","_findOriginalTarget","_handleNative","handled","gobj","gs","changedTouches","touches","identifier","clientX","clientY","ta","shouldPrevent","dx","dy","cancelable","prevent","flow","reset","addListener","evType","recognizer","deps","dep","gd","_count","setTouchAction","recog","emits","_fire","Event","bubbles","composed","defaultPrevented","preventer","sourceEvent","evName","downupFire","trackHasMovedEnough","started","trackFire","ddx","secondlast","moves","lastmove","ddy","state","hover","elementFromPoint","trackForward","bcr","getBoundingClientRect","pageX","pageY","left","right","top","bottom","mousedown","touchstart","touchend","addMove","move","ct","touchmove","click","GestureEventListeners","removeListener","ThemePropertyMixin","theme","_setTheme","ThemableMixin","hasOwnTemplate","parentElement","inheritedTemplate","_includeStyle","_includeMatchingThemes","hasThemes","defaultModuleName","moduleNameA","moduleNameB","vaadinA","vaadinB","vaadinThemePrefixes","vaadinThemeA","vaadinThemeB","moduleName","themeFor","themeForToken","styleEl","keyboardActive","capture","shadyDOM","didFlush","ScopingShim","ControlStateMixin","tabindex","tabIndex","autofocus","_previousTabIndex","disabled","_isShiftTabbing","_keyboardActive","contains","relatedTarget","_focus","focusElement","_setFocused","ensureEventComposed","keyCode","shiftKey","focus","firefox","fakeTarget","opacity","focused","blur","_disabledChanged","_tabindexChanged","DirHelper","dummy","fontSize","width","height","cachedType","scrollLeft","scrollType","scrollWidth","clientWidth","directionSubscribers","directionObserver","documentDir","getDocumentDir","alignDirs","attributeFilter","DirMixin","detectScrollType","__subscribe","newValueEmptied","newValueEqlDocDir","newDiffValue","__getNormalizedScrollLeft","getNormalizedScrollLeft","__setNormalizedScrollLeft","setNormalizedScrollLeft","DEV_MODE_CODE_REGEXP","FlowClients","Vaadin","Flow","uncommentAndRun","maybeGatherAndSendStats","developmentMode","localStorage","getItem","hostname","productionMode","usageStatistics","runIfDevelopmentMode","statsJob","registrations","developmentModeCallback","registered","doctype","ButtonElement","_addActiveListeners","$_documentContainer$6","$_documentContainer$5","$_documentContainer$4","HOST_PROPS","accessible","PROP_TYPE","DEFAULT","ACCESSIBLE","TextFieldMixin","subclass","autocomplete","autocorrect","autocapitalize","autoselect","clearButtonVisible","errorMessage","i18n","label","helperText","maxlength","minlength","readonly","required","hasValue","preventInvalidInput","_enabledCharPattern","_labelId","_helperTextId","_errorId","_inputId","_hasSlottedHelper","_slottedTagName","inputElement","_createConstraintsObserver","_onInput","__preventInput","stopImmediatePropagation","checkValidity","_inputDebouncer","__fromClearButton","__userInput","_stateChanged","clearButton","_onChange","_valueClearing","changeEvent","_valueChanged","newVal","oldVal","validate","_labelChanged","_setOrToggleAttribute","_helperTextChanged","_errorMessageChanged","_onHelperSlotChange","slottedNodes","assignedNodes","flatten","_onSlotChange","_slottedInput","_validateSlottedValue","_addInputListeners","_addIEListeners","_removeInputListeners","_removeIEListeners","_propagateHostAttributes","_hostPropsChanged","attributesValues","_hostAccessiblePropsChanged","attributeNames","_constraintsChanged","__forceCheckValidity","_boundOnInput","_boundOnChange","_boundOnBlur","_boundOnFocus","_boundOnPaste","_boundOnDrop","_boundOnBeforeInput","_onBlur","_onFocus","_onPaste","_onDrop","_onBeforeInput","defaultInput","uniqueId","_onClearButtonClick","_onKeyDown","_uniqueId","__observeOffsetHeight","setSelectionRange","inputEvent","dispatchChange","__shouldAcceptKey","metaKey","ctrlKey","__enabledCharRegExp","pastedText","clipboardData","getData","__enabledTextRegExp","draggedText","dataTransfer","__enabledCharPatternChanged","_shouldPreventInput","_getActiveErrorId","errorId","helperTextId","hasSlottedHelper","ids","_getActiveLabelId","_getErrorMessageAriaHidden","_dispatchIronResizeEventIfNeeded","sizePropertyName","previousSizePropertyName","__observeOffsetHeightDebouncer","offsetHeight","WEBKIT_PROPERTY","__dataValue","TextFieldElement","list","title","StyleNode","rules","parsedCssText","atRule","keyframesName","parsedSelector","parseCss","repeat","RX","multipleSpaces","AT_START","MEDIA_START","types","MEDIA_RULE","keyframesRule","KEYFRAMES_RULE","VAR_START","MIXIN_RULE","STYLE_RULE","r$","OPEN_BRACE","CLOSE_BRACE","comments","port","customProp","mixinProp","mixinApply","varApply","styleTextSet","toCssText","forEachRule","preserveProperties","rulesForStyle","__cssRules","styleRuleCallback","keyframesRuleCallback","onlyActiveRules","skipRules","matchMedia","CSS_BUILD_ATTR","elementHasBuiltCss","$r","__cssBuild","attrValue","buildComment","Comment","commentParts","getCssBuild","APPLY_NAME_CLEAN","INITIAL_INHERIT","IMPORTANT","MixinMap","_map","dependants","invalidCallback","ApplyShim","_currentElement","_measureElement","detectMixin","gatherStyles","styleText","styleTextParts","isUnscopedStyle","processUnscopedStyle","newStyle","transformTemplate","_gatheredStyle","transformStyle","transformRules","transformCustomStyle","transformRule","transformCssText","matchText","propertyName","valueProperty","valueMixin","_produceCssProperties","_consumeCssProperties","_getInitialValueForProperty","_fallbacksFromPreviousRules","startRule","topRule","fallbacks","seenStartRule","_cssTextToMap","mixinName","applyPos","afterApplyPos","textBeforeApply","textAfterApply","replacement","_atApplyToCssProperties","vars","mixinEntry","_replaceInitialOrInherit","replaceInitialOrInherit","sp","_invalidateMixinEntry","processVariableAndFallback","level","inner","suffix","comma","mixinAsProperties","mixinValues","combinedProps","needToInvalidate","_separator","templateMap","CURRENT_VERSION","NEXT_VERSION","VALIDATING_VERSION","templateIsValid","applyShim","applyShimInterface","ApplyShimUtils.invalidate","ensure","_styleAst","shadowChildren","typeExtension","extends","ApplyShimUtils.templateIsValid","_validating","HOST_DIR","EL_DIR","DIR_CHECK","SHIM_SHADOW","DIR_INSTANCES","getRTL","setRTL","__autoDirOptOut","updateDirection","elementBase","Dir","_replaceDirInCssText","__activateDir","replacedText","takeRecords","scheduled","beforeRenderQueue","afterRenderQueue","schedule","callMethod","afterNextRender","newSplice","calculateSplices","current","calcSplices","currentStart","currentEnd","oldStart","oldEnd","prefixCount","suffixCount","minLength","searchLength","index1","index2","count","ops","distances","edits","northWest","west","north","rowCount","columnCount","oldIndex","isSlot","FlattenedNodesObserver","wrapped","_shadyChildrenObserver","_nativeChildrenObserver","_connected","_target","_effectiveNodes","_observer","_scheduled","_boundSchedule","_schedule","connect","_listenSlots","observeChildren","mutations","_processMutations","childList","disconnect","_unlistenSlots","unobserveChildren","_processSlotMutations","mutation","addedNodes","removedNodes","newNodes","getFlattenedNodes","matchesSelector","normalizedMatchesSelector","Element","mozMatchesSelector","msMatchesSelector","oMatchesSelector","webkitMatchesSelector","DomApiNative","observeNodes","unobserveNodes","observerHandle","notifyObserver","deepContains","doc","getOwnerRoot","getDistributedNodes","getDestinationInsertionPoints","ip$","assignedSlot","deep","getEffectiveChildNodes","queryDistributedElements","c$","activeElement","_activeElement","forwardReadOnlyProperties","EventApi","rootTarget","localTarget","DomApiImpl","Wrapper","currentRoot","helper","__domApi","sameScope","scope","DISABLED_ATTR","findObservedAttributesGetter","ctor","desc","getOwnPropertyDescriptor","DisableUpgradeMixin","observedAttributesGetter","__isUpgradeDisabled","isConnected","styleInterface","LegacyElementMixin","GesturesElement","legacyElementBase","DIRECTION_MAP","none","LegacyElement","isAttached","__boundListeners","_debouncers","__needsAttributesAtConnected","_legacyForceObservedAttributes","created","__attributeReaction","_takeAttributes","attached","detached","attributeChanged","_registered","__hasRegisterFinished","_applyListeners","_ensureAttributes","deserialize","reflectPropertyToAttribute","serializeValueToAttribute","api","n$","pd","chainObject","instanceTemplate","_contentForTemplate","fire","hbl","bl","unlisten","setScrollDirection","slctr","domHost","DocumentFragment","distributeContent","domApi","getEffectiveChildren","getEffectiveTextContent","cn","tc","COMMENT_NODE","queryEffectiveChildren","queryAllEffectiveChildren","getContentChildNodes","getContentChildren","isLightDescendant","isLocalDescendant","scopeSubtree","container","shouldObserve","handlesDynamicScoping","containerScope","scopeForNode","scopify","nativeMethods","currentScope","currentScopeForNode","unscopeNode","scopeNode","mo","mxns","mxn","addedNode","subtree","jobName","wait","isDebouncerActive","flushDebouncer","cancelDebouncer","async","waitTime","cancelAsync","elt","elementMatches","toggleAttribute","bool","toggleClass","classList","transform","transformText","webkitTransform","translate3d","arrayDelete","arrayOrPath","_logger","_log","_warn","_logf","lifecycleProps","beforeRegister","listeners","hostAttributes","excludeOnInfo","behaviors","_noAccessors","excludeOnBehaviors","applyInfo","lifecycle","excludeProps","noAccessors","propertyNames","mergeProperties","targetInfo","sourceInfo","GenerateClassFromInfo","Base","behaviorList","PolymerGenerated","generatedProto","copyPropertiesToProto","superBehaviors","flattenBehaviors","exclude","generatedFrom","Class","mutablePropertyChange","mutableData","shouldChange","MutableData","OptionalMutableData","_mutablePropertyChange","newInstance","HTMLTemplateElementExtension","DataTemplate","MutableDataTemplate","showHideChildren","hide","__hideTemplateChildren__","__polymerTextContent__","__polymerReplaced__","createComment","__polymerDisplay__","display","_showHideChildren","TemplateInstanceBase","_configureProperties","__templatizeInstance","__templatizeOwner","__templatizeOptions","instanceProps","forwardHostProp","hprop","__hostProps","iprop","parentModel","templateHost","__parentModel","MutableTemplateInstanceBase","Iu","findMethodHost","createTemplatizerClass","templatizerBase","templatize","userNotifyInstanceProp","notifyInstanceProp","createNotifyInstancePropEffect","hasHostProps","addPropagateEffects","methodHost","userForwardHostProp","isTemplate","templatizeTemplateClass","TemplatizedTemplate","templatizedBase","TemplatizedTemplateExtension","createForwardHostPropEffect","declaredProps","baseClass","templatizeInstanceClass","elementsHidden","hideElementsGlobally","domBindBase","__children","render","__removeChildren","__insertChildren","domRepeatBase","DomRepeat","indexAs","itemsIndexAs","renderedItemCount","initialCount","targetFramerate","_targetFrameTime","notifyDomChange","reuseChunkedInstances","__instances","__renderDebouncer","__itemsIdxToInstIdx","__chunkCount","__renderStartTime","__itemsArrayChanged","__shouldMeasureChunk","__shouldContinueChunking","__chunkingId","__sortFn","__filterFn","__observePaths","__ctor","__isDetached","__detachInstance","wrappedParent","__attachInstance","__render","__ensureTemplatized","i$","__getMethodHost","__functionFromPropertyValue","functionOrMethodName","__sortChanged","__debounceRender","__filterChanged","__computeFrameTime","rate","__observeChanged","__handleObservedPaths","paths","__itemsChanged","change","__handleItemPath","isntIdxToItemsIdx","__sortAndFilterItems","__calculateLimit","__updateInstances","__continueChunking","_setRenderedItemCount","filteredItemCount","currentCount","newCount","performance","ratio","renderTime","itemsIdxToInstIdx","instIdx","itemIdx","__insertInstance","__detachAndRemoveInstance","wrappedRoot","__stampInstance","beforeRow","beforeNode","hidden","itemsPath","dot","itemsIdx","itemSubPath","itemPath","itemForElement","modelForElement","indexForElement","DomIfBase","if","restamp","_lastIf","__template","DOCUMENT_FRAGMENT_NODE","__teardownInstance","__ensureTemplate","__ensureInstance","__hasInstance","__getInstanceNodes","__createAndInsertInstance","DomIf","__instance","__syncInfo","syncInfo","rootProp","__syncHostProperties","__hidden","__invalidProps","ArraySelectorMixin","multi","selected","selectedItem","toggle","__lastItems","__lastMulti","__selectedMap","__updateSelection","itemsInfo","newItems","lastItems","clearSelection","__applySplices","__deselectChangedIdx","__updateLinks","sidx","isSelected","isIndexSelected","__selectedIndexForItemIndex","deselect","deselectIndex","selectIndex","baseArraySelector","ArraySelector","queryMatches","query","_boundMQHandler","queryHandler","_mq","queryChanged","_remove","_add","mq","_setQueryMatches","overlayContentCounter","overlayContentCache","OverlayElement","opened","renderer","withBackdrop","modeless","focusTrap","restoreFocusOnClose","_mouseDownInside","_mouseUpInside","_instance","_originalContentPart","_contentNodes","_oldOwner","_oldModel","_oldTemplate","_oldInstanceProps","_oldRenderer","_oldOpened","_boundMouseDownListener","_mouseDownListener","_boundMouseUpListener","_mouseUpListener","_boundOutsideClickListener","_outsideClickListener","_boundKeydownListener","_keydownListener","_setTemplateFromNodes","_boundIronOverlayCanceledListener","_ironOverlayCanceled","_boundIosResizeListener","_detectIosNavbar","backdrop","innerHeight","landscape","clientHeight","innerWidth","close","evt","overlay","_last","_cycleTab","_ensureTemplatized","_openedChanged","wasOpened","__restoreFocusNode","_getActiveElement","_animatedOpening","_addGlobalListeners","_animatedClosing","_removeGlobalListeners","_hiddenChanged","_flushAnimation","_shouldAnimate","_enqueueAnimation","listener","_attachOverlay","_enterModalState","finishOpening","_placeholder","bringToFront","finishClosing","_exitModalState","_deepContains","_detachOverlay","__attachedInstances","__zIndex","_modelessChanged","pointerEvents","_previousDocumentPointerEvents","instances","_removeOldContent","_stampOverlayTemplate","_Templatizer","templateRoot","_templateRoot","isShady","scopeCssText","styleInfo","_styleInfoForNode","_getStyleRules","contentPart","styledTemplate","processOverlayStyles","className","_removeNewRendererOrTemplate","oldTemplate","oldRenderer","_templateOrRendererChanged","ownerOrModelChanged","templateOrInstancePropsChanged","rendererChanged","openedChanged","_isFocused","_focusedIndex","_getFocusableElements","increment","focusableElements","_collectTabbableNodes","_sortByTabIndex","isFocusable","_isVisible","_normalizedTabIndex","needsSort","visibility","tabbables","pivot","_mergeSortByTabIndex","_hasLowerTabOrder","ati","bti","getTabbableNodes","active","zIndex","frontmost","DatePickerOverlayElement","KEY_IDENTIFIER","U+0008","U+0009","U+001B","U+0020","U+007F","KEY_CODE","8","9","13","27","33","34","35","36","32","37","38","39","40","46","106","MODIFIER_KEYS","ctrl","alt","KEY_CHAR","IDENT_CHAR","ARROW_KEY","SPACE_KEY","ESC_KEY","transformKey","noSpecialChars","validKey","lKey","keyComboMatchesEvent","keyCombo","keyEvent","hasModifiers","keyIdent","keyIdentifier","altKey","IronA11yKeysBehavior","eventString","keyCombos","keyComboString","combo","parsedKeyCombo","keyComboPart","eventParts","keyName","IronA11yAnnouncer","_text","_onIronAnnounce","announce","DatePickerHelper","requestAvailability","dayOfWeek","nearestThursdayDiff","nearestThursday","firstOfJanuary","timeDiff","daysSinceFirstOfJanuary","date1","date2","closestDate","candidate","MonthCalendarElement","selectedDate","focusedDate","showWeekNumbers","ignoreTaps","_notTapping","minDate","maxDate","_dateEquals","_dateAllowed","_isDisabled","firstDate","lastDate","setDate","_getTitle","monthNames","formatTitle","_onMonthGridTouchStart","_dateAdd","delta","_applyFirstDayOfWeek","weekDayNames","_getWeekDayNames","weekDayNamesShort","weekDay","weekDayShort","_getDate","_showWeekNumbersChanged","_showWeekSeparator","_isToday","_getDays","startMonth","targetMonth","_getWeekNumber","_getISOWeekNumber","_getWeekNumbers","_handleTap","_preventDefault","_getRole","_getAriaLabel","ariaLabel","today","_getAriaDisabled","InfiniteScrollerElement","bufferSize","_initialScroll","_initialIndex","_buffers","_preventScrollEvent","_mayHaveMomentum","_initialized","fullHeight","tpl","_TemplateClass","insertionPoint","_itemWrapper","scroller","_activated","_createPool","_finishInit","_initDone","_ensureStampedInstance","translateY","_reset","_translateBuffer","up","_bufferHeight","updated","_scroll","bufferOffset","upperThresholdReached","lowerThresholdReached","_scrollDisabled","scrollTop","offsetTop","itemHeight","_updateClones","_debouncerScrollFinish","scrollerRect","_firstIndex","tmpStyleProp","itemHeightPx","_itemHeightVal","_debouncerUpdateClones","itemWrapper","slotName","_contentIndex","tmpInstance","viewPortOnly","bufferIndex","firstIndex","rect","DatePickerOverlayContentElement","_focusedMonthDate","initialPosition","_originDate","_visibleMonthIndex","_desktopMode","_translateX","_yearScrollerWidth","_ignoreTaps","_focused","_onKeydown","_stopPropagation","_onOverlayFocus","_onOverlayBlur","_closeYearScroller","_toggleAnimateClass","scrollers","announceFocusedDate","_currentlyFocusedDate","focusCancel","cancelButton","scrollToDate","animate","_scrollToPosition","_differenceInMonths","_focusedDateChanged","revealDate","_isCurrentYear","yearsFromNow","_isSelectedYear","scrolledAboveViewport","visibleItems","scrolledBelowViewport","monthScroller","_initialPositionChanged","_repositionYearScroller","yearScroller","_repositionMonthScroller","_onMonthScroll","_doIgnoreTaps","_onYearScroll","_onYearScrollTouchStart","_onMonthScrollTouchStart","_debouncer","_formatDisplayed","formatDate","_extractDateParts","_onTodayTap","_close","_scrollToCurrentMonth","_showClear","_onYearTap","yearDelta","targetPosition","_targetPosition","smoothScroll","timestamp","currentTime","currentPos","oldPosition","_limit","range","_handleTrack","newTranslateX","_track","_openYearScroller","enable","_toggleYearScroller","_isYearScrollerVisible","_translateXChanged","_yearAfterXYears","_yearAfterXMonths","_dateAfterXMonths","_differenceInYears","_clear","overlayContent","_cancel","_eventKey","isToday","todayButton","isCancel","isScroller","eventKey","isFullscreen","isShift","_moveFocusByDays","_moveFocusInsideMonth","_moveFocusByMonths","_focusDate","dateToFocus","_focusClosestDate","_getClosestDate","_isTodayAllowed","todayMidnight","ORPHANS","IronResizableBehavior","_parentResizable","_notifyingDescendant","iron-request-resize-notifications","_interestedResizables","_boundNotifyResize","notifyResize","_boundOnDescendantIronResize","_onDescendantIronResize","_requestResizeNotifications","stopResizeNotificationsFor","resizable","resizerShouldNotify","_notifyDescendant","_fireResize","assignParentResizable","parentResizable","_subscribeIronResize","_unsubscribeIronResize","_onIronRequestResizeNotifications","_parentResizableChanged","descendant","readystatechanged","_findParent","orphan","DatePickerElement","_selectedDate","_focusedDate","_fullscreen","_fullscreenMediaQuery","_touchPrevented","parseDate","fullYear","_minDate","_maxDate","_noInput","_ios","_webkitOverflowScroll","webkitOverflowScrolling","_ignoreAnnounce","_focusOverlayOnOpen","_overlayInitialized","_boundOnScroll","_onScroll","_boundFocus","_boundUpdateAlignmentAndPosition","_updateAlignmentAndPosition","inputIndex","_inputElement","_onUserInput","_initOverlay","_overlayContent","_focusAndSelect","_onVaadinOverlayClose","_input","_nativeInput","unwrap","_parseDate","_isNoInput","fullscreen","ios","_formatISO","pad","num","fmt","yearSign","yearFmt","yearAbs","_selectedDateChanged","__userInputOccurred","__dispatchChange","inputValue","_inputValue","_ignoreFocusedDateChange","_updateHasValue","__getOverlayTheme","overlayInitialized","_handleDateChange","_minChanged","_maxChanged","inputRect","bottomAlign","viewportHeight","viewportWidth","_fullscreenChanged","_onOverlayOpened","_openedWithFocusRing","parsedInitialPosition","_preventWebkitOverflowScrollingTouch","oldInlineValue","_onOverlayClosed","parsedDate","prevented","dateObject","_isValidDate","selectionStart","selectionEnd","inputValid","minMaxValid","inputValidity","_setSelectionRange","_validateInput","_userInputValueChanged","_announceFocusedDate","_userInputValue","_toggle","_getAriaExpanded","_setClearButtonLabel","i18nClear","PlayerBonusHistoryTranslations","bonusHistory","dateFrom","dateTo","dateFilter","noBonusHistory","player_bonus_card_bonuswalletid_value","walletId","player_bonus_card","player_bonus_card_bonusdate_value","granted","player_bonus_card_bonusstatus_value","player_bonus_card_bonusname_value","player_bonus_card_bonustype_value","player_bonus_card_bonusamount_value","grantedAmount","player_bonus_card_bonuswageringamount_value","totalWR","player_bonus_card_bonusremainingamount_value","currentAmount","player_bonus_card_bonuscurrency_value","each_value","span0","span0_class_value","span0_part_value","span1","span1_class_value","span1_part_value","span2","span3","span_class_value","span_part_value","t1_value","t3_value","t9_value","svg","defs","g0","h2","div5","label0","vaadin_date_picker0","label1","vaadin_date_picker1","if_block0","t1","t3","t9","startCalendar","endCalendar","lastMonth","endpoint","session","playerid","bonusCalendarStartDate","bonusCalendarEndDate","bonusesPrevPage","bonusesNextPage","bonusesLastPage","numberOfPages","currentPage","bonusesList","toggleScreen","getBonuses","searchParams","X-SessionId","startCalendarHandler","endCalendarHandler","onMount","$$value","PlayerBonusHistory"],"mappings":"mOAAA,SAASA,KAgBT,SAASC,EAAIC,GACT,OAAOA,IAEX,SAASC,IACL,OAAOC,OAAOC,OAAO,MAEzB,SAASC,EAAQC,GACbA,EAAIC,QAAQP,GAEhB,SAASQ,EAAYC,GACjB,MAAwB,mBAAVA,EAElB,SAASC,EAAeC,EAAGC,GACvB,OAAOD,GAAKA,EAAIC,GAAKA,EAAID,IAAMC,GAAOD,GAAkB,iBAANA,GAAgC,mBAANA,EAqBhF,SAASE,EAAUC,KAAUC,GACzB,GAAa,MAATD,EACA,OAAOf,EAEX,MAAMiB,EAAQF,EAAMD,aAAaE,GACjC,OAAOC,EAAMC,YAAc,IAAMD,EAAMC,cAAgBD,EAO3D,SAASE,EAAoBC,EAAWL,EAAOM,GAC3CD,EAAUE,GAAGC,WAAWC,KAAKV,EAAUC,EAAOM,IAoPlD,SAASI,EAAOC,EAAQC,GACpBD,EAAOE,YAAYD,GAoDvB,SAASE,EAAOH,EAAQC,EAAMG,GAC1BJ,EAAOK,aAAaJ,EAAMG,GAAU,MAUxC,SAASE,EAAOL,GACZA,EAAKM,WAAWC,YAAYP,GAEhC,SAASQ,EAAaC,EAAYC,GAC9B,IAAKC,IAAIC,EAAI,EAAGA,EAAIH,EAAWI,OAAQD,GAAK,EACpCH,EAAWG,IACXH,EAAWG,GAAGE,EAAEJ,GAG5B,SAASK,EAAQC,GACb,OAAOC,SAASC,cAAcF,GAiBlC,SAASG,EAAYH,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IACA,IACA,MAEJC,GAAM,CACF,IACA,IACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,QAAS,CACL,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,QAAS,CACL,IACA,IACA,KACA,MAEJC,QAAS,CACL,IACA,IACA,KACA,MAEJC,QAAS,CACL,IACA,IACA,KACA,MAEJC,QAAS,CACL,IACA,IACA,KACA,MAEJC,QAAS,CACL,IACA,IACA,KACA,MAEJC,QAAS,CACL,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,SAAU,CACN,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,SAAU,CACN,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,QAAS,CACL,IACA,KACA,KACA,KAEJC,GAAM,CACF,KACA,KAEJC,GAAM,CACF,KACA,KAEJC,QAAS,CACL,KACA,IACA,KAEJC,QAAS,CACL,KACA,IACA,KAEJC,QAAS,CACL,KACA,IACA,KAEJC,QAAS,CACL,KACA,IACA,KAEJC,GAAM,CACF,KACA,IACA,IACA,MAEJC,QAAS,CACL,KACA,IACA,KACA,KAEJC,GAAM,CACF,KACA,KACA,IACA,KAEJC,GAAM,CACF,KACA,KACA,IACA,KAEJC,GAAM,CACF,KACA,KACA,IACA,KAEJC,QAAS,CACL,KACA,KACA,IACA,KAEJC,QAAS,CACL,KACA,KACA,IACA,KAEJC,QAAS,CAC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,GAHAH,IAEIE,GAAyBxI,GAAG,4CAA6C,MACpD,SAAgC/Z,EAAGlK,GAIxD,OAFAysB,GAAuBc,UAAYvtB,EAER,OAAnByL,EADIghB,GAAuBD,KAAKtiB,GACrB,IAAgCuB,EAAK,KAKnC,SAAgCvB,EAAGlK,GAExD,IADA,IA+2BkB3B,EA/2BdmvB,EAAQ,KACC,CACT,IAAInvB,EAAIwtB,GAAY3hB,EAAGlK,GACvB,QAAUkH,IAAN7I,GAAmBovB,GAAcpvB,KA62B/B,KADQA,EA52B8CA,IA62B5CA,GAAK,IACnB,KAANA,GACM,IAALA,GAAeA,GAAK,IACf,KAANA,GACM,KAANA,GACM,KAANA,GACM,KAANA,GACM,KAANA,GACM,KAANA,GACM,IAALA,GAAeA,GAAK,IACf,IAALA,GAAeA,GAAK,IACf,IAALA,GAAeA,GAAK,IACf,IAALA,GAAeA,GAAK,IACf,KAANA,GACM,KAANA,GACM,KAANA,GACM,KAANA,GACM,KAANA,GACM,MAANA,GACM,MAANA,GACM,MAANA,GACM,MAANA,GACM,MAANA,GACM,KAALA,GAAeA,GAAK,KACf,MAANA,GACM,MAANA,GACM,MAANA,GACM,MAANA,GACM,MAANA,GACM,MAANA,GACM,MAANA,GACM,MAANA,GACM,MAANA,GACM,MAANA,GACM,MAANA,GACM,MAANA,GACM,MAANA,GACM,MAALA,GAAeA,GAAK,MACf,MAALA,GAAeA,GAAK,MACf,OAANA,GACM,OAANA,GACM,OAANA,GACM,MAALA,GAAeA,GAAK,MACf,OAANA,GACM,OAANA,GACM,OAANA,GACM,MAALA,GAAeA,GAAK,MACf,MAALA,GAAeA,GAAK,MACf,OAANA,GACM,OAANA,GACM,MAALA,GAAeA,GAAK,MACf,MAALA,GAAeA,GAAK,MACf,OAANA,GACM,OAANA,GACM,OAANA,GACM,MAALA,GAAeA,GAAK,MACf,OAANA,GACM,OAANA,GACM,MAALA,GAAeA,GAAK,MACf,MAALA,GAAeA,GAAK,MACf,MAALA,GAAeA,GAAK,MACf,MAALA,GAAeA,GAAK,MACf,MAALA,GAAeA,GAAK,MACf,OAANA,GACM,MAALA,GAAeA,GAAK,MACf,OAANA,GACM,MAALA,GAAeA,GAAK,MACf,OAANA,GACM,MAALA,GAAeA,GAAK,MACf,OAANA,GACM,MAALA,GAAeA,GAAK,MACf,MAALA,GAAeA,GAAK,MACf,MAALA,GAAeA,GAAK,MACf,OAANA,GACM,OAANA,GACM,OAANA,GACM,MAALA,GAAeA,GAAK,MACf,MAALA,GAAeA,GAAK,MACf,MAALA,GAAeA,GAAK,MACf,OAANA,GACM,OAANA,GACM,OAANA,GACM,OAANA,GACM,MAALA,GAAeA,GAAK,MACf,MAALA,GAAeA,GAAK,MACf,MAALA,GAAeA,GAAK,KACf,OAANA,GACM,OAANA,GACM,MAALA,GAAeA,GAAK,MACf,OAANA,GACM,MAALA,GAAeA,GAAK,MACf,MAALA,GAAeA,GAAK,MACf,MAALA,GAAeA,GAAK,MACf,MAALA,GAAeA,GAAK,MACf,MAALA,GAAeA,GAAK,MACf,MAALA,GAAeA,GAAK,MACf,MAALA,GAAeA,GAAK,MACf,MAALA,GAAeA,GAAK,MACf,MAALA,GAAeA,GAAK,MACf,OAANA,GACM,MAALA,GAAeA,GAAK,MACf,OAANA,GACM,MAALA,GAAeA,GAAK,MACf,MAALA,GAAeA,GAAK,MACf,MAALA,GAAeA,GAAK,MACf,OAANA,GACM,MAALA,GAAeA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,OAALA,GAAeA,GAAK,OACf,OAALA,GAAeA,GAAK,OACf,QAANA,GACM,QAANA,GACM,OAALA,GAAeA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,OAALA,GAAeA,GAAK,OACf,OAALA,GAAeA,GAAK,OACf,OAALA,GAAeA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,OAALA,GAAeA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,OAALA,GAAeA,GAAK,OACf,QAANA,GACM,QAANA,GACM,OAALA,GAAeA,GAAK,OACf,OAALA,GAAeA,GAAK,OACf,OAALA,GAAeA,GAAK,OACf,OAALA,GAAeA,GAAK,OACf,OAALA,GAAeA,GAAK,OACf,OAALA,GAAeA,GAAK,OACf,OAALA,GAAeA,GAAK,OACf,OAALA,GAAeA,GAAK,OACf,QAANA,GACM,OAALA,GAAeA,GAAK,OACf,OAALA,GAAeA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,OAALA,GAAeA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,OAALA,GAAeA,GAAK,OACf,QAANA,GACM,OAALA,GAAeA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,OAALA,GAAeA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,OAALA,GAAeA,GAAK,OACf,QAANA,GACM,OAALA,GAAeA,GAAK,OACf,OAALA,GAAeA,GAAK,OACf,OAALA,GAAeA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACM,OAALA,GAAeA,GAAK,OACf,OAALA,GAAeA,GAAK,OACf,QAANA,G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