\n );\n }\n}\n\nToolbar.Item = ToolbarItem;\n\nexport default Toolbar;\n","\"use strict\";\n\nexports.__esModule = true;\n\nvar _assign = require(\"../core-js/object/assign\");\n\nvar _assign2 = _interopRequireDefault(_assign);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = _assign2.default || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};","/*!\n Copyright (c) 2017 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n\n/* global define */\n(function () {\n 'use strict';\n\n var hasOwn = {}.hasOwnProperty;\n\n function classNames() {\n var classes = [];\n\n for (var i = 0; i < arguments.length; i++) {\n var arg = arguments[i];\n if (!arg) continue;\n var argType = typeof arg;\n\n if (argType === 'string' || argType === 'number') {\n classes.push(arg);\n } else if (Array.isArray(arg) && arg.length) {\n var inner = classNames.apply(null, arg);\n\n if (inner) {\n classes.push(inner);\n }\n } else if (argType === 'object') {\n for (var key in arg) {\n if (hasOwn.call(arg, key) && arg[key]) {\n classes.push(key);\n }\n }\n }\n }\n\n return classes.join(' ');\n }\n\n if (typeof module !== 'undefined' && module.exports) {\n classNames.default = classNames;\n module.exports = classNames;\n } else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n // register as 'classnames', consistent with npm package name\n define('classnames', [], function () {\n return classNames;\n });\n } else {\n window.classNames = classNames;\n }\n})();","function generatePatches(state, basepath, patches, inversePatches, baseValue, resultValue) {\n if (patches) if (Array.isArray(baseValue)) generateArrayPatches(state, basepath, patches, inversePatches, baseValue, resultValue);else generateObjectPatches(state, basepath, patches, inversePatches, baseValue, resultValue);\n}\n\nfunction generateArrayPatches(state, basepath, patches, inversePatches, baseValue, resultValue) {\n var shared = Math.min(baseValue.length, resultValue.length);\n\n for (var i = 0; i < shared; i++) {\n if (state.assigned[i] && baseValue[i] !== resultValue[i]) {\n var path = basepath.concat(i);\n patches.push({\n op: \"replace\",\n path: path,\n value: resultValue[i]\n });\n inversePatches.push({\n op: \"replace\",\n path: path,\n value: baseValue[i]\n });\n }\n }\n\n if (shared < resultValue.length) {\n // stuff was added\n for (var _i = shared; _i < resultValue.length; _i++) {\n var _path = basepath.concat(_i);\n\n patches.push({\n op: \"add\",\n path: _path,\n value: resultValue[_i]\n });\n }\n\n inversePatches.push({\n op: \"replace\",\n path: basepath.concat(\"length\"),\n value: baseValue.length\n });\n } else if (shared < baseValue.length) {\n // stuff was removed\n patches.push({\n op: \"replace\",\n path: basepath.concat(\"length\"),\n value: resultValue.length\n });\n\n for (var _i2 = shared; _i2 < baseValue.length; _i2++) {\n var _path2 = basepath.concat(_i2);\n\n inversePatches.push({\n op: \"add\",\n path: _path2,\n value: baseValue[_i2]\n });\n }\n }\n}\n\nfunction generateObjectPatches(state, basepath, patches, inversePatches, baseValue, resultValue) {\n each(state.assigned, function (key, assignedValue) {\n var origValue = baseValue[key];\n var value = resultValue[key];\n var op = !assignedValue ? \"remove\" : key in baseValue ? \"replace\" : \"add\";\n if (origValue === baseValue && op === \"replace\") return;\n var path = basepath.concat(key);\n patches.push(op === \"remove\" ? {\n op: op,\n path: path\n } : {\n op: op,\n path: path,\n value: value\n });\n inversePatches.push(op === \"add\" ? {\n op: \"remove\",\n path: path\n } : op === \"remove\" ? {\n op: \"add\",\n path: path,\n value: origValue\n } : {\n op: \"replace\",\n path: path,\n value: origValue\n });\n });\n}\n\nfunction applyPatches(draft, patches) {\n var _loop = function _loop(i) {\n var patch = patches[i];\n\n if (patch.path.length === 0 && patch.op === \"replace\") {\n draft = patch.value;\n } else {\n var path = patch.path.slice();\n var key = path.pop();\n var base = path.reduce(function (current, part) {\n if (!current) throw new Error(\"Cannot apply patch, path doesn't resolve: \" + patch.path.join(\"/\"));\n return current[part];\n }, draft);\n if (!base) throw new Error(\"Cannot apply patch, path doesn't resolve: \" + patch.path.join(\"/\"));\n\n switch (patch.op) {\n case \"replace\":\n case \"add\":\n // TODO: add support is not extensive, it does not support insertion or `-` atm!\n base[key] = patch.value;\n break;\n\n case \"remove\":\n if (Array.isArray(base)) {\n if (key === base.length - 1) base.length -= 1;else throw new Error(\"Remove can only remove the last key of an array, index: \" + key + \", length: \" + base.length);\n } else delete base[key];\n\n break;\n\n default:\n throw new Error(\"Unsupported patch operation: \" + patch.op);\n }\n }\n };\n\n for (var i = 0; i < patches.length; i++) {\n _loop(i);\n }\n\n return draft;\n}\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 defineProperty = function (obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n};\n\nvar NOTHING = typeof Symbol !== \"undefined\" ? Symbol(\"immer-nothing\") : defineProperty({}, \"immer-nothing\", true);\nvar PROXY_STATE = typeof Symbol !== \"undefined\" ? Symbol(\"immer-proxy-state\") : \"__$immer_state\";\nvar RETURNED_AND_MODIFIED_ERROR = \"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.\";\n\nfunction verifyMinified() {}\n\nvar inProduction = typeof process !== \"undefined\" && process.env.NODE_ENV === \"production\" || verifyMinified.name !== \"verifyMinified\";\nvar autoFreeze = !inProduction;\nvar useProxies = typeof Proxy !== \"undefined\";\n/**\n * Automatically freezes any state trees generated by immer.\n * This protects against accidental modifications of the state tree outside of an immer function.\n * This comes with a performance impact, so it is recommended to disable this option in production.\n * It is by default enabled.\n *\n * @returns {void}\n */\n\nfunction setAutoFreeze(enableAutoFreeze) {\n autoFreeze = enableAutoFreeze;\n}\n\nfunction setUseProxies(value) {\n useProxies = value;\n}\n\nfunction getUseProxies() {\n return useProxies;\n}\n\nfunction isProxy(value) {\n return !!value && !!value[PROXY_STATE];\n}\n\nfunction isProxyable(value) {\n if (!value) return false;\n if ((typeof value === \"undefined\" ? \"undefined\" : _typeof(value)) !== \"object\") return false;\n if (Array.isArray(value)) return true;\n var proto = Object.getPrototypeOf(value);\n return proto === null || proto === Object.prototype;\n}\n\nfunction freeze(value) {\n if (autoFreeze) {\n Object.freeze(value);\n }\n\n return value;\n}\n\nfunction original(value) {\n if (value && value[PROXY_STATE]) {\n return value[PROXY_STATE].base;\n } // otherwise return undefined\n\n}\n\nvar assign = Object.assign || function assign(target, value) {\n for (var key in value) {\n if (has(value, key)) {\n target[key] = value[key];\n }\n }\n\n return target;\n};\n\nfunction shallowCopy(value) {\n if (Array.isArray(value)) return value.slice();\n var target = value.__proto__ === undefined ? Object.create(null) : {};\n return assign(target, value);\n}\n\nfunction each(value, cb) {\n if (Array.isArray(value)) {\n for (var i = 0; i < value.length; i++) {\n cb(i, value[i]);\n }\n } else {\n for (var key in value) {\n cb(key, value[key]);\n }\n }\n}\n\nfunction has(thing, prop) {\n return Object.prototype.hasOwnProperty.call(thing, prop);\n} // given a base object, returns it if unmodified, or return the changed cloned if modified\n\n\nfunction finalize(base, path, patches, inversePatches) {\n if (isProxy(base)) {\n var state = base[PROXY_STATE];\n\n if (state.modified === true) {\n if (state.finalized === true) return state.copy;\n state.finalized = true;\n var result = finalizeObject(useProxies ? state.copy : state.copy = shallowCopy(base), state, path, patches, inversePatches);\n generatePatches(state, path, patches, inversePatches, state.base, result);\n return result;\n } else {\n return state.base;\n }\n }\n\n finalizeNonProxiedObject(base);\n return base;\n}\n\nfunction finalizeObject(copy, state, path, patches, inversePatches) {\n var base = state.base;\n each(copy, function (prop, value) {\n if (value !== base[prop]) {\n // if there was an assignment on this property, we don't need to generate\n // patches for the subtree\n var _generatePatches = patches && !has(state.assigned, prop);\n\n copy[prop] = finalize(value, _generatePatches && path.concat(prop), _generatePatches && patches, inversePatches);\n }\n });\n return freeze(copy);\n}\n\nfunction finalizeNonProxiedObject(parent) {\n // If finalize is called on an object that was not a proxy, it means that it is an object that was not there in the original\n // tree and it could contain proxies at arbitrarily places. Let's find and finalize them as well\n if (!isProxyable(parent)) return;\n if (Object.isFrozen(parent)) return;\n each(parent, function (i, child) {\n if (isProxy(child)) {\n parent[i] = finalize(child);\n } else finalizeNonProxiedObject(child);\n }); // always freeze completely new data\n\n freeze(parent);\n}\n\nfunction is(x, y) {\n // From: https://github.com/facebook/fbjs/blob/c69904a511b900266935168223063dd8772dfc40/packages/fbjs/src/core/shallowEqual.js\n if (x === y) {\n return x !== 0 || 1 / x === 1 / y;\n } else {\n return x !== x && y !== y;\n }\n} // @ts-check\n\n\nvar proxies = null;\nvar objectTraps = {\n get: get$1,\n has: function has$$1(target, prop) {\n return prop in source(target);\n },\n ownKeys: function ownKeys(target) {\n return Reflect.ownKeys(source(target));\n },\n set: set$1,\n deleteProperty: deleteProperty,\n getOwnPropertyDescriptor: getOwnPropertyDescriptor,\n defineProperty: defineProperty$1,\n setPrototypeOf: function setPrototypeOf() {\n throw new Error(\"Immer does not support `setPrototypeOf()`.\");\n }\n};\nvar arrayTraps = {};\neach(objectTraps, function (key, fn) {\n arrayTraps[key] = function () {\n arguments[0] = arguments[0][0];\n return fn.apply(this, arguments);\n };\n});\n\narrayTraps.deleteProperty = function (state, prop) {\n if (isNaN(parseInt(prop))) throw new Error(\"Immer does not support deleting properties from arrays: \" + prop);\n return objectTraps.deleteProperty.call(this, state[0], prop);\n};\n\narrayTraps.set = function (state, prop, value) {\n if (prop !== \"length\" && isNaN(parseInt(prop))) throw new Error(\"Immer does not support setting non-numeric properties on arrays: \" + prop);\n return objectTraps.set.call(this, state[0], prop, value);\n};\n\nfunction createState(parent, base) {\n return {\n modified: false,\n // this tree is modified (either this object or one of it's children)\n assigned: {},\n // true: value was assigned to these props, false: was removed\n finalized: false,\n parent: parent,\n base: base,\n copy: undefined,\n proxies: {}\n };\n}\n\nfunction source(state) {\n return state.modified === true ? state.copy : state.base;\n}\n\nfunction get$1(state, prop) {\n if (prop === PROXY_STATE) return state;\n\n if (state.modified) {\n var value = state.copy[prop];\n if (value === state.base[prop] && isProxyable(value)) // only create proxy if it is not yet a proxy, and not a new object\n // (new objects don't need proxying, they will be processed in finalize anyway)\n return state.copy[prop] = createProxy(state, value);\n return value;\n } else {\n if (has(state.proxies, prop)) return state.proxies[prop];\n var _value = state.base[prop];\n if (!isProxy(_value) && isProxyable(_value)) return state.proxies[prop] = createProxy(state, _value);\n return _value;\n }\n}\n\nfunction set$1(state, prop, value) {\n // TODO: optimize\n state.assigned[prop] = true;\n\n if (!state.modified) {\n if (prop in state.base && is(state.base[prop], value) || has(state.proxies, prop) && state.proxies[prop] === value) return true;\n markChanged(state);\n }\n\n state.copy[prop] = value;\n return true;\n}\n\nfunction deleteProperty(state, prop) {\n state.assigned[prop] = false;\n markChanged(state);\n delete state.copy[prop];\n return true;\n}\n\nfunction getOwnPropertyDescriptor(state, prop) {\n var owner = state.modified ? state.copy : has(state.proxies, prop) ? state.proxies : state.base;\n var descriptor = Reflect.getOwnPropertyDescriptor(owner, prop);\n if (descriptor && !(Array.isArray(owner) && prop === \"length\")) descriptor.configurable = true;\n return descriptor;\n}\n\nfunction defineProperty$1() {\n throw new Error(\"Immer does not support defining properties on draft objects.\");\n}\n\nfunction markChanged(state) {\n if (!state.modified) {\n state.modified = true;\n state.copy = shallowCopy(state.base); // copy the proxies over the base-copy\n\n Object.assign(state.copy, state.proxies); // yup that works for arrays as well\n\n if (state.parent) markChanged(state.parent);\n }\n} // creates a proxy for plain objects / arrays\n\n\nfunction createProxy(parentState, base, key) {\n if (isProxy(base)) throw new Error(\"Immer bug. Plz report.\");\n var state = createState(parentState, base, key);\n var proxy = Array.isArray(base) ? Proxy.revocable([state], arrayTraps) : Proxy.revocable(state, objectTraps);\n proxies.push(proxy);\n return proxy.proxy;\n}\n\nfunction produceProxy(baseState, producer, patchListener) {\n if (isProxy(baseState)) {\n // See #100, don't nest producers\n var returnValue = producer.call(baseState, baseState);\n return returnValue === undefined ? baseState : returnValue;\n }\n\n var previousProxies = proxies;\n proxies = [];\n var patches = patchListener && [];\n var inversePatches = patchListener && [];\n\n try {\n // create proxy for root\n var rootProxy = createProxy(undefined, baseState); // execute the thunk\n\n var _returnValue = producer.call(rootProxy, rootProxy); // and finalize the modified proxy\n\n\n var result = void 0; // check whether the draft was modified and/or a value was returned\n\n if (_returnValue !== undefined && _returnValue !== rootProxy) {\n // something was returned, and it wasn't the proxy itself\n if (rootProxy[PROXY_STATE].modified) throw new Error(RETURNED_AND_MODIFIED_ERROR); // See #117\n // Should we just throw when returning a proxy which is not the root, but a subset of the original state?\n // Looks like a wrongly modeled reducer\n\n result = finalize(_returnValue);\n\n if (patches) {\n patches.push({\n op: \"replace\",\n path: [],\n value: result\n });\n inversePatches.push({\n op: \"replace\",\n path: [],\n value: baseState\n });\n }\n } else {\n result = finalize(rootProxy, [], patches, inversePatches);\n } // revoke all proxies\n\n\n each(proxies, function (_, p) {\n return p.revoke();\n });\n patchListener && patchListener(patches, inversePatches);\n return result;\n } finally {\n proxies = previousProxies;\n }\n} // @ts-check\n\n\nvar descriptors = {};\nvar states = null;\n\nfunction createState$1(parent, proxy, base) {\n return {\n modified: false,\n assigned: {},\n // true: value was assigned to these props, false: was removed\n hasCopy: false,\n parent: parent,\n base: base,\n proxy: proxy,\n copy: undefined,\n finished: false,\n finalizing: false,\n finalized: false\n };\n}\n\nfunction source$1(state) {\n return state.hasCopy ? state.copy : state.base;\n}\n\nfunction _get(state, prop) {\n assertUnfinished(state);\n var value = source$1(state)[prop];\n\n if (!state.finalizing && value === state.base[prop] && isProxyable(value)) {\n // only create a proxy if the value is proxyable, and the value was in the base state\n // if it wasn't in the base state, the object is already modified and we will process it in finalize\n prepareCopy(state);\n return state.copy[prop] = createProxy$1(state, value);\n }\n\n return value;\n}\n\nfunction _set(state, prop, value) {\n assertUnfinished(state);\n state.assigned[prop] = true; // optimization; skip this if there is no listener\n\n if (!state.modified) {\n if (is(source$1(state)[prop], value)) return;\n markChanged$1(state);\n prepareCopy(state);\n }\n\n state.copy[prop] = value;\n}\n\nfunction markChanged$1(state) {\n if (!state.modified) {\n state.modified = true;\n if (state.parent) markChanged$1(state.parent);\n }\n}\n\nfunction prepareCopy(state) {\n if (state.hasCopy) return;\n state.hasCopy = true;\n state.copy = shallowCopy(state.base);\n} // creates a proxy for plain objects / arrays\n\n\nfunction createProxy$1(parent, base) {\n var proxy = shallowCopy(base);\n each(base, function (i) {\n Object.defineProperty(proxy, \"\" + i, createPropertyProxy(\"\" + i));\n });\n var state = createState$1(parent, proxy, base);\n createHiddenProperty(proxy, PROXY_STATE, state);\n states.push(state);\n return proxy;\n}\n\nfunction createPropertyProxy(prop) {\n return descriptors[prop] || (descriptors[prop] = {\n configurable: true,\n enumerable: true,\n get: function get$$1() {\n return _get(this[PROXY_STATE], prop);\n },\n set: function set$$1(value) {\n _set(this[PROXY_STATE], prop, value);\n }\n });\n}\n\nfunction assertUnfinished(state) {\n if (state.finished === true) throw new Error(\"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? \" + JSON.stringify(state.copy || state.base));\n} // this sounds very expensive, but actually it is not that expensive in practice\n// as it will only visit proxies, and only do key-based change detection for objects for\n// which it is not already know that they are changed (that is, only object for which no known key was changed)\n\n\nfunction markChangesSweep() {\n // intentionally we process the proxies in reverse order;\n // ideally we start by processing leafs in the tree, because if a child has changed, we don't have to check the parent anymore\n // reverse order of proxy creation approximates this\n for (var i = states.length - 1; i >= 0; i--) {\n var state = states[i];\n\n if (state.modified === false) {\n if (Array.isArray(state.base)) {\n if (hasArrayChanges(state)) markChanged$1(state);\n } else if (hasObjectChanges(state)) markChanged$1(state);\n }\n }\n}\n\nfunction markChangesRecursively(object) {\n if (!object || (typeof object === \"undefined\" ? \"undefined\" : _typeof(object)) !== \"object\") return;\n var state = object[PROXY_STATE];\n if (!state) return;\n var proxy = state.proxy,\n base = state.base;\n\n if (Array.isArray(object)) {\n if (hasArrayChanges(state)) {\n markChanged$1(state);\n state.assigned.length = true;\n if (proxy.length < base.length) for (var i = proxy.length; i < base.length; i++) {\n state.assigned[i] = false;\n } else for (var _i = base.length; _i < proxy.length; _i++) {\n state.assigned[_i] = true;\n }\n each(proxy, function (index, child) {\n if (!state.assigned[index]) markChangesRecursively(child);\n });\n }\n } else {\n var _diffKeys = diffKeys(base, proxy),\n added = _diffKeys.added,\n removed = _diffKeys.removed;\n\n if (added.length > 0 || removed.length > 0) markChanged$1(state);\n each(added, function (_, key) {\n state.assigned[key] = true;\n });\n each(removed, function (_, key) {\n state.assigned[key] = false;\n });\n each(proxy, function (key, child) {\n if (!state.assigned[key]) markChangesRecursively(child);\n });\n }\n}\n\nfunction diffKeys(from, to) {\n // TODO: optimize\n var a = Object.keys(from);\n var b = Object.keys(to);\n return {\n added: b.filter(function (key) {\n return a.indexOf(key) === -1;\n }),\n removed: a.filter(function (key) {\n return b.indexOf(key) === -1;\n })\n };\n}\n\nfunction hasObjectChanges(state) {\n var baseKeys = Object.keys(state.base);\n var keys = Object.keys(state.proxy);\n return !shallowEqual(baseKeys, keys);\n}\n\nfunction hasArrayChanges(state) {\n var proxy = state.proxy;\n if (proxy.length !== state.base.length) return true; // See #116\n // If we first shorten the length, our array interceptors will be removed.\n // If after that new items are added, result in the same original length,\n // those last items will have no intercepting property.\n // So if there is no own descriptor on the last position, we know that items were removed and added\n // N.B.: splice, unshift, etc only shift values around, but not prop descriptors, so we only have to check\n // the last one\n\n var descriptor = Object.getOwnPropertyDescriptor(proxy, proxy.length - 1); // descriptor can be null, but only for newly created sparse arrays, eg. new Array(10)\n\n if (descriptor && !descriptor.get) return true; // For all other cases, we don't have to compare, as they would have been picked up by the index setters\n\n return false;\n}\n\nfunction produceEs5(baseState, producer, patchListener) {\n if (isProxy(baseState)) {\n // See #100, don't nest producers\n var returnValue = producer.call(baseState, baseState);\n return returnValue === undefined ? baseState : returnValue;\n }\n\n var prevStates = states;\n states = [];\n var patches = patchListener && [];\n var inversePatches = patchListener && [];\n\n try {\n // create proxy for root\n var rootProxy = createProxy$1(undefined, baseState); // execute the thunk\n\n var _returnValue = producer.call(rootProxy, rootProxy); // and finalize the modified proxy\n\n\n each(states, function (_, state) {\n state.finalizing = true;\n });\n var result = void 0; // check whether the draft was modified and/or a value was returned\n\n if (_returnValue !== undefined && _returnValue !== rootProxy) {\n // something was returned, and it wasn't the proxy itself\n if (rootProxy[PROXY_STATE].modified) throw new Error(RETURNED_AND_MODIFIED_ERROR);\n result = finalize(_returnValue);\n\n if (patches) {\n patches.push({\n op: \"replace\",\n path: [],\n value: result\n });\n inversePatches.push({\n op: \"replace\",\n path: [],\n value: baseState\n });\n }\n } else {\n if (patchListener) markChangesRecursively(rootProxy);\n markChangesSweep(); // this one is more efficient if we don't need to know which attributes have changed\n\n result = finalize(rootProxy, [], patches, inversePatches);\n } // make sure all proxies become unusable\n\n\n each(states, function (_, state) {\n state.finished = true;\n });\n patchListener && patchListener(patches, inversePatches);\n return result;\n } finally {\n states = prevStates;\n }\n}\n\nfunction shallowEqual(objA, objB) {\n //From: https://github.com/facebook/fbjs/blob/c69904a511b900266935168223063dd8772dfc40/packages/fbjs/src/core/shallowEqual.js\n if (is(objA, objB)) return true;\n\n if ((typeof objA === \"undefined\" ? \"undefined\" : _typeof(objA)) !== \"object\" || objA === null || (typeof objB === \"undefined\" ? \"undefined\" : _typeof(objB)) !== \"object\" || objB === null) {\n return false;\n }\n\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n if (keysA.length !== keysB.length) return false;\n\n for (var i = 0; i < keysA.length; i++) {\n if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction createHiddenProperty(target, prop, value) {\n Object.defineProperty(target, prop, {\n value: value,\n enumerable: false,\n writable: true\n });\n}\n/**\n * produce takes a state, and runs a function against it.\n * That function can freely mutate the state, as it will create copies-on-write.\n * This means that the original state will stay unchanged, and once the function finishes, the modified state is returned\n *\n * @export\n * @param {any} baseState - the state to start with\n * @param {Function} producer - function that receives a proxy of the base state as first argument and which can be freely modified\n * @param {Function} patchListener - optional function that will be called with all the patches produced here\n * @returns {any} a new state, or the base state if nothing was modified\n */\n\n\nfunction produce(baseState, producer, patchListener) {\n // prettier-ignore\n if (arguments.length < 1 || arguments.length > 3) throw new Error(\"produce expects 1 to 3 arguments, got \" + arguments.length); // curried invocation\n\n if (typeof baseState === \"function\") {\n // prettier-ignore\n if (typeof producer === \"function\") throw new Error(\"if first argument is a function (curried invocation), the second argument to produce cannot be a function\");\n var initialState = producer;\n var recipe = baseState;\n return function () {\n var args = arguments;\n var currentState = args[0] === undefined && initialState !== undefined ? initialState : args[0];\n return produce(currentState, function (draft) {\n args[0] = draft; // blegh!\n\n return recipe.apply(draft, args);\n });\n };\n } // prettier-ignore\n\n\n {\n if (typeof producer !== \"function\") throw new Error(\"if first argument is not a function, the second argument to produce should be a function\");\n if (patchListener !== undefined && typeof patchListener !== \"function\") throw new Error(\"the third argument of a producer should not be set or a function\");\n } // if state is a primitive, don't bother proxying at all\n\n if ((typeof baseState === \"undefined\" ? \"undefined\" : _typeof(baseState)) !== \"object\" || baseState === null) {\n var returnValue = producer(baseState);\n return returnValue === undefined ? baseState : normalizeResult(returnValue);\n }\n\n if (!isProxyable(baseState)) throw new Error(\"the first argument to an immer producer should be a primitive, plain object or array, got \" + (typeof baseState === \"undefined\" ? \"undefined\" : _typeof(baseState)) + \": \\\"\" + baseState + \"\\\"\");\n return normalizeResult(getUseProxies() ? produceProxy(baseState, producer, patchListener) : produceEs5(baseState, producer, patchListener));\n}\n\nfunction normalizeResult(result) {\n return result === NOTHING ? undefined : result;\n}\n\nvar applyPatches$1 = produce(applyPatches);\nvar nothing = NOTHING;\nexport { produce, applyPatches$1 as applyPatches, nothing, setAutoFreeze, setUseProxies, original };\nexport default produce;","var parser = require('graphql/language/parser');\n\nvar parse = parser.parse; // Strip insignificant whitespace\n// Note that this could do a lot more, such as reorder fields etc.\n\nfunction normalize(string) {\n return string.replace(/[\\s,]+/g, ' ').trim();\n} // A map docString -> graphql document\n\n\nvar docCache = {}; // A map fragmentName -> [normalized source]\n\nvar fragmentSourceMap = {};\n\nfunction cacheKeyFromLoc(loc) {\n return normalize(loc.source.body.substring(loc.start, loc.end));\n} // For testing.\n\n\nfunction resetCaches() {\n docCache = {};\n fragmentSourceMap = {};\n} // Take a unstripped parsed document (query/mutation or even fragment), and\n// check all fragment definitions, checking for name->source uniqueness.\n// We also want to make sure only unique fragments exist in the document.\n\n\nvar printFragmentWarnings = true;\n\nfunction processFragments(ast) {\n var astFragmentMap = {};\n var definitions = [];\n\n for (var i = 0; i < ast.definitions.length; i++) {\n var fragmentDefinition = ast.definitions[i];\n\n if (fragmentDefinition.kind === 'FragmentDefinition') {\n var fragmentName = fragmentDefinition.name.value;\n var sourceKey = cacheKeyFromLoc(fragmentDefinition.loc); // We know something about this fragment\n\n if (fragmentSourceMap.hasOwnProperty(fragmentName) && !fragmentSourceMap[fragmentName][sourceKey]) {\n // this is a problem because the app developer is trying to register another fragment with\n // the same name as one previously registered. So, we tell them about it.\n if (printFragmentWarnings) {\n console.warn(\"Warning: fragment with name \" + fragmentName + \" already exists.\\n\" + \"graphql-tag enforces all fragment names across your application to be unique; read more about\\n\" + \"this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names\");\n }\n\n fragmentSourceMap[fragmentName][sourceKey] = true;\n } else if (!fragmentSourceMap.hasOwnProperty(fragmentName)) {\n fragmentSourceMap[fragmentName] = {};\n fragmentSourceMap[fragmentName][sourceKey] = true;\n }\n\n if (!astFragmentMap[sourceKey]) {\n astFragmentMap[sourceKey] = true;\n definitions.push(fragmentDefinition);\n }\n } else {\n definitions.push(fragmentDefinition);\n }\n }\n\n ast.definitions = definitions;\n return ast;\n}\n\nfunction disableFragmentWarnings() {\n printFragmentWarnings = false;\n}\n\nfunction stripLoc(doc, removeLocAtThisLevel) {\n var docType = Object.prototype.toString.call(doc);\n\n if (docType === '[object Array]') {\n return doc.map(function (d) {\n return stripLoc(d, removeLocAtThisLevel);\n });\n }\n\n if (docType !== '[object Object]') {\n throw new Error('Unexpected input.');\n } // We don't want to remove the root loc field so we can use it\n // for fragment substitution (see below)\n\n\n if (removeLocAtThisLevel && doc.loc) {\n delete doc.loc;\n } // https://github.com/apollographql/graphql-tag/issues/40\n\n\n if (doc.loc) {\n delete doc.loc.startToken;\n delete doc.loc.endToken;\n }\n\n var keys = Object.keys(doc);\n var key;\n var value;\n var valueType;\n\n for (key in keys) {\n if (keys.hasOwnProperty(key)) {\n value = doc[keys[key]];\n valueType = Object.prototype.toString.call(value);\n\n if (valueType === '[object Object]' || valueType === '[object Array]') {\n doc[keys[key]] = stripLoc(value, true);\n }\n }\n }\n\n return doc;\n}\n\nvar experimentalFragmentVariables = false;\n\nfunction parseDocument(doc) {\n var cacheKey = normalize(doc);\n\n if (docCache[cacheKey]) {\n return docCache[cacheKey];\n }\n\n var parsed = parse(doc, {\n experimentalFragmentVariables: experimentalFragmentVariables\n });\n\n if (!parsed || parsed.kind !== 'Document') {\n throw new Error('Not a valid GraphQL document.');\n } // check that all \"new\" fragments inside the documents are consistent with\n // existing fragments of the same name\n\n\n parsed = processFragments(parsed);\n parsed = stripLoc(parsed, false);\n docCache[cacheKey] = parsed;\n return parsed;\n}\n\nfunction enableExperimentalFragmentVariables() {\n experimentalFragmentVariables = true;\n}\n\nfunction disableExperimentalFragmentVariables() {\n experimentalFragmentVariables = false;\n} // XXX This should eventually disallow arbitrary string interpolation, like Relay does\n\n\nfunction\n /* arguments */\ngql() {\n var args = Array.prototype.slice.call(arguments);\n var literals = args[0]; // We always get literals[0] and then matching post literals for each arg given\n\n var result = typeof literals === \"string\" ? literals : literals[0];\n\n for (var i = 1; i < args.length; i++) {\n if (args[i] && args[i].kind && args[i].kind === 'Document') {\n result += args[i].loc.source.body;\n } else {\n result += args[i];\n }\n\n result += literals[i];\n }\n\n return parseDocument(result);\n} // Support typescript, which isn't as nice as Babel about default exports\n\n\ngql.default = gql;\ngql.resetCaches = resetCaches;\ngql.disableFragmentWarnings = disableFragmentWarnings;\ngql.enableExperimentalFragmentVariables = enableExperimentalFragmentVariables;\ngql.disableExperimentalFragmentVariables = disableExperimentalFragmentVariables;\nmodule.exports = gql;","\"use strict\";\n\nexports.__esModule = true;\n\nexports.default = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};","import React from \"react\";\nimport cls from \"classnames\";\nimport Icon from \"./Icon\";\n\nconst Button = ({\n children,\n icon,\n primary,\n info,\n link,\n success,\n danger,\n active,\n small,\n block,\n ...rest\n}) => (\n \n);\n\nButton.Group = ({ children }) =>
{children}
;\n\nexport default Button;\n","\"use strict\";\n\nexports.__esModule = true;\n\nvar _typeof2 = require(\"../helpers/typeof\");\n\nvar _typeof3 = _interopRequireDefault(_typeof2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && ((typeof call === \"undefined\" ? \"undefined\" : (0, _typeof3.default)(call)) === \"object\" || typeof call === \"function\") ? call : self;\n};","import React from \"react\";\nimport { withProvider } from \"../../graphql\";\n\nconst view = WrappedComponent => {\n return withProvider(\n class extends React.Component {\n render() {\n return ;\n }\n }\n );\n};\n\nexport default view;\n","\"use strict\";\n\nexports.__esModule = true;\n\nvar _defineProperty = require(\"../core-js/object/define-property\");\n\nvar _defineProperty2 = _interopRequireDefault(_defineProperty);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = 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 (0, _defineProperty2.default)(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}();","(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('prop-types'), require('apollo-client')) : typeof define === 'function' && define.amd ? define(['exports', 'react', 'prop-types', 'apollo-client'], factory) : factory(global['react-apollo'] = {}, global.React, global.PropTypes, global.apolloClient);\n})(this, function (exports, React, PropTypes, apolloClient) {\n 'use strict';\n\n function getProps(element) {\n return element.props || element.attributes;\n }\n\n function isReactElement(element) {\n return !!element.type;\n }\n\n function isComponentClass(Comp) {\n return Comp.prototype && (Comp.prototype.render || Comp.prototype.isReactComponent);\n }\n\n function providesChildContext(instance) {\n return !!instance.getChildContext;\n }\n\n function walkTree(element, context, visitor) {\n if (Array.isArray(element)) {\n element.forEach(function (item) {\n return walkTree(item, context, visitor);\n });\n return;\n }\n\n if (!element) {\n return;\n }\n\n if (isReactElement(element)) {\n if (typeof element.type === 'function') {\n var Comp = element.type;\n var props = Object.assign({}, Comp.defaultProps, getProps(element));\n var childContext_1 = context;\n var child = void 0;\n\n if (isComponentClass(Comp)) {\n var instance_1 = new Comp(props, context);\n Object.defineProperty(instance_1, 'props', {\n value: instance_1.props || props\n });\n instance_1.context = instance_1.context || context;\n instance_1.state = instance_1.state || null;\n\n instance_1.setState = function (newState) {\n if (typeof newState === 'function') {\n newState = newState(instance_1.state, instance_1.props, instance_1.context);\n }\n\n instance_1.state = Object.assign({}, instance_1.state, newState);\n };\n\n if (Comp.getDerivedStateFromProps) {\n var result = Comp.getDerivedStateFromProps(instance_1.props, instance_1.state);\n\n if (result !== null) {\n instance_1.state = Object.assign({}, instance_1.state, result);\n }\n } else if (instance_1.UNSAFE_componentWillMount) {\n instance_1.UNSAFE_componentWillMount();\n } else if (instance_1.componentWillMount) {\n instance_1.componentWillMount();\n }\n\n if (providesChildContext(instance_1)) {\n childContext_1 = Object.assign({}, context, instance_1.getChildContext());\n }\n\n if (visitor(element, instance_1, context, childContext_1) === false) {\n return;\n }\n\n child = instance_1.render();\n } else {\n if (visitor(element, null, context) === false) {\n return;\n }\n\n child = Comp(props, context);\n }\n\n if (child) {\n if (Array.isArray(child)) {\n child.forEach(function (item) {\n return walkTree(item, childContext_1, visitor);\n });\n } else {\n walkTree(child, childContext_1, visitor);\n }\n }\n } else if (element.type._context || element.type.Consumer) {\n if (visitor(element, null, context) === false) {\n return;\n }\n\n var child = void 0;\n\n if (element.type._context) {\n element.type._context._currentValue = element.props.value;\n child = element.props.children;\n } else {\n child = element.props.children(element.type._currentValue);\n }\n\n if (child) {\n if (Array.isArray(child)) {\n child.forEach(function (item) {\n return walkTree(item, context, visitor);\n });\n } else {\n walkTree(child, context, visitor);\n }\n }\n } else {\n if (visitor(element, null, context) === false) {\n return;\n }\n\n if (element.props && element.props.children) {\n React.Children.forEach(element.props.children, function (child) {\n if (child) {\n walkTree(child, context, visitor);\n }\n });\n }\n }\n } else if (typeof element === 'string' || typeof element === 'number') {\n visitor(element, null, context);\n }\n }\n\n function hasFetchDataFunction(instance) {\n return typeof instance.fetchData === 'function';\n }\n\n function isPromise(promise) {\n return typeof promise.then === 'function';\n }\n\n function getPromisesFromTree(_a) {\n var rootElement = _a.rootElement,\n _b = _a.rootContext,\n rootContext = _b === void 0 ? {} : _b;\n var promises = [];\n walkTree(rootElement, rootContext, function (_, instance, context, childContext) {\n if (instance && hasFetchDataFunction(instance)) {\n var promise = instance.fetchData();\n\n if (isPromise(promise)) {\n promises.push({\n promise: promise,\n context: childContext || context,\n instance: instance\n });\n return false;\n }\n }\n });\n return promises;\n }\n\n function getDataAndErrorsFromTree(rootElement, rootContext, storeError) {\n if (rootContext === void 0) {\n rootContext = {};\n }\n\n var promises = getPromisesFromTree({\n rootElement: rootElement,\n rootContext: rootContext\n });\n\n if (!promises.length) {\n return Promise.resolve();\n }\n\n var mappedPromises = promises.map(function (_a) {\n var promise = _a.promise,\n context = _a.context,\n instance = _a.instance;\n return promise.then(function (_) {\n return getDataAndErrorsFromTree(instance.render(), context, storeError);\n }).catch(function (e) {\n return storeError(e);\n });\n });\n return Promise.all(mappedPromises);\n }\n\n function processErrors(errors) {\n switch (errors.length) {\n case 0:\n break;\n\n case 1:\n throw errors.pop();\n\n default:\n var wrapperError = new Error(errors.length + \" errors were thrown when executing your fetchData functions.\");\n wrapperError.queryErrors = errors;\n throw wrapperError;\n }\n }\n\n function getDataFromTree(rootElement, rootContext) {\n if (rootContext === void 0) {\n rootContext = {};\n }\n\n var errors = [];\n\n var storeError = function (error) {\n return errors.push(error);\n };\n\n return getDataAndErrorsFromTree(rootElement, rootContext, storeError).then(function (_) {\n return processErrors(errors);\n });\n }\n\n var invariant = require('invariant');\n\n var ApolloConsumer = function (props, context) {\n invariant(!!context.client, \"Could not find \\\"client\\\" in the context of ApolloConsumer. Wrap the root component in an \");\n return props.children(context.client);\n };\n\n ApolloConsumer.contextTypes = {\n client: PropTypes.object.isRequired\n };\n ApolloConsumer.propTypes = {\n children: PropTypes.func.isRequired\n };\n\n var __extends = undefined && undefined.__extends || function () {\n var extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n };\n\n return function (d, b) {\n extendStatics(d, b);\n\n function __() {\n this.constructor = d;\n }\n\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n }();\n\n var invariant$1 = require('invariant');\n\n var ApolloProvider = function (_super) {\n __extends(ApolloProvider, _super);\n\n function ApolloProvider(props, context) {\n var _this = _super.call(this, props, context) || this;\n\n _this.operations = new Map();\n invariant$1(props.client, 'ApolloProvider was not passed a client instance. Make ' + 'sure you pass in your client via the \"client\" prop.');\n\n if (!props.client.__operations_cache__) {\n props.client.__operations_cache__ = _this.operations;\n }\n\n return _this;\n }\n\n ApolloProvider.prototype.getChildContext = function () {\n return {\n client: this.props.client,\n operations: this.props.client.__operations_cache__\n };\n };\n\n ApolloProvider.prototype.render = function () {\n return this.props.children;\n };\n\n ApolloProvider.propTypes = {\n client: PropTypes.object.isRequired,\n children: PropTypes.node.isRequired\n };\n ApolloProvider.childContextTypes = {\n client: PropTypes.object.isRequired,\n operations: PropTypes.object\n };\n return ApolloProvider;\n }(React.Component);\n\n var invariant$2 = require('invariant');\n\n var DocumentType;\n\n (function (DocumentType) {\n DocumentType[DocumentType[\"Query\"] = 0] = \"Query\";\n DocumentType[DocumentType[\"Mutation\"] = 1] = \"Mutation\";\n DocumentType[DocumentType[\"Subscription\"] = 2] = \"Subscription\";\n })(DocumentType || (DocumentType = {}));\n\n var cache = new Map();\n\n function parser(document) {\n var cached = cache.get(document);\n if (cached) return cached;\n var variables, type, name;\n invariant$2(!!document && !!document.kind, \"Argument of \" + document + \" passed to parser was not a valid GraphQL \" + \"DocumentNode. You may need to use 'graphql-tag' or another method \" + \"to convert your operation into a document\");\n var fragments = document.definitions.filter(function (x) {\n return x.kind === 'FragmentDefinition';\n });\n var queries = document.definitions.filter(function (x) {\n return x.kind === 'OperationDefinition' && x.operation === 'query';\n });\n var mutations = document.definitions.filter(function (x) {\n return x.kind === 'OperationDefinition' && x.operation === 'mutation';\n });\n var subscriptions = document.definitions.filter(function (x) {\n return x.kind === 'OperationDefinition' && x.operation === 'subscription';\n });\n invariant$2(!fragments.length || queries.length || mutations.length || subscriptions.length, \"Passing only a fragment to 'graphql' is not yet supported. \" + \"You must include a query, subscription or mutation as well\");\n invariant$2(queries.length + mutations.length + subscriptions.length <= 1, \"react-apollo only supports a query, subscription, or a mutation per HOC. \" + (document + \" had \" + queries.length + \" queries, \" + subscriptions.length + \" \") + (\"subscriptions and \" + mutations.length + \" mutations. \") + \"You can use 'compose' to join multiple operation types to a component\");\n type = queries.length ? DocumentType.Query : DocumentType.Mutation;\n if (!queries.length && !mutations.length) type = DocumentType.Subscription;\n var definitions = queries.length ? queries : mutations.length ? mutations : subscriptions;\n invariant$2(definitions.length === 1, \"react-apollo only supports one defintion per HOC. \" + document + \" had \" + (definitions.length + \" definitions. \") + \"You can use 'compose' to join multiple operation types to a component\");\n var definition = definitions[0];\n variables = definition.variableDefinitions || [];\n\n if (definition.name && definition.name.kind === 'Name') {\n name = definition.name.value;\n } else {\n name = 'data';\n }\n\n var payload = {\n name: name,\n type: type,\n variables: variables\n };\n cache.set(document, payload);\n return payload;\n }\n\n var __extends$1 = undefined && undefined.__extends || function () {\n var extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n };\n\n return function (d, b) {\n extendStatics(d, b);\n\n function __() {\n this.constructor = d;\n }\n\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n }();\n\n var __assign = undefined && undefined.__assign || Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n\n return t;\n };\n\n var __rest = undefined && undefined.__rest || function (s, e) {\n var t = {};\n\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) t[p[i]] = s[p[i]];\n return t;\n };\n\n var shallowEqual = require('fbjs/lib/shallowEqual');\n\n var invariant$3 = require('invariant');\n\n function compact(obj) {\n return Object.keys(obj).reduce(function (acc, key) {\n if (obj[key] !== undefined) {\n acc[key] = obj[key];\n }\n\n return acc;\n }, {});\n }\n\n function observableQueryFields(observable) {\n var fields = {\n variables: observable.variables,\n refetch: observable.refetch.bind(observable),\n fetchMore: observable.fetchMore.bind(observable),\n updateQuery: observable.updateQuery.bind(observable),\n startPolling: observable.startPolling.bind(observable),\n stopPolling: observable.stopPolling.bind(observable),\n subscribeToMore: observable.subscribeToMore.bind(observable)\n };\n return fields;\n }\n\n var Query = function (_super) {\n __extends$1(Query, _super);\n\n function Query(props, context) {\n var _this = _super.call(this, props, context) || this;\n\n _this.previousData = {};\n _this.hasMounted = false;\n\n _this.startQuerySubscription = function () {\n if (_this.querySubscription) return;\n\n var initial = _this.getQueryResult();\n\n _this.querySubscription = _this.queryObservable.subscribe({\n next: function (_a) {\n var data = _a.data;\n\n if (initial && initial.networkStatus === 7 && shallowEqual(initial.data, data)) {\n initial = undefined;\n return;\n }\n\n initial = undefined;\n\n _this.updateCurrentData();\n },\n error: function (error) {\n _this.resubscribeToQuery();\n\n if (!error.hasOwnProperty('graphQLErrors')) throw error;\n\n _this.updateCurrentData();\n }\n });\n };\n\n _this.removeQuerySubscription = function () {\n if (_this.querySubscription) {\n _this.querySubscription.unsubscribe();\n\n delete _this.querySubscription;\n }\n };\n\n _this.updateCurrentData = function () {\n var _a = _this.props,\n onCompleted = _a.onCompleted,\n onError = _a.onError;\n\n if (onCompleted || onError) {\n var currentResult = _this.queryObservable.currentResult();\n\n var loading = currentResult.loading,\n error = currentResult.error,\n data = currentResult.data;\n\n if (onCompleted && !loading && !error) {\n onCompleted(data);\n } else if (onError && !loading && error) {\n onError(error);\n }\n }\n\n if (_this.hasMounted) _this.forceUpdate();\n };\n\n _this.getQueryResult = function () {\n var data = {\n data: Object.create(null)\n };\n Object.assign(data, observableQueryFields(_this.queryObservable));\n\n var currentResult = _this.queryObservable.currentResult();\n\n var loading = currentResult.loading,\n networkStatus = currentResult.networkStatus,\n errors = currentResult.errors;\n var error = currentResult.error;\n\n if (errors && errors.length > 0) {\n error = new apolloClient.ApolloError({\n graphQLErrors: errors\n });\n }\n\n Object.assign(data, {\n loading: loading,\n networkStatus: networkStatus,\n error: error\n });\n\n if (loading) {\n Object.assign(data.data, _this.previousData, currentResult.data);\n } else if (error) {\n Object.assign(data, {\n data: (_this.queryObservable.getLastResult() || {}).data\n });\n } else {\n Object.assign(data.data, currentResult.data);\n _this.previousData = currentResult.data;\n }\n\n if (!_this.querySubscription) {\n var oldRefetch_1 = data.refetch;\n\n data.refetch = function (args) {\n if (_this.querySubscription) {\n return oldRefetch_1(args);\n } else {\n return new Promise(function (r, f) {\n _this.refetcherQueue = {\n resolve: r,\n reject: f,\n args: args\n };\n });\n }\n };\n }\n\n data.client = _this.client;\n return data;\n };\n\n _this.client = props.client || context.client;\n invariant$3(!!_this.client, \"Could not find \\\"client\\\" in the context of Query or as passed props. Wrap the root component in an \");\n\n _this.initializeQueryObservable(props);\n\n return _this;\n }\n\n Query.prototype.fetchData = function () {\n if (this.props.skip) return false;\n\n var _a = this.props,\n children = _a.children,\n ssr = _a.ssr,\n displayName = _a.displayName,\n skip = _a.skip,\n client = _a.client,\n onCompleted = _a.onCompleted,\n onError = _a.onError,\n opts = __rest(_a, [\"children\", \"ssr\", \"displayName\", \"skip\", \"client\", \"onCompleted\", \"onError\"]);\n\n var fetchPolicy = opts.fetchPolicy;\n if (ssr === false) return false;\n\n if (fetchPolicy === 'network-only' || fetchPolicy === 'cache-and-network') {\n fetchPolicy = 'cache-first';\n }\n\n var observable = this.client.watchQuery(__assign({}, opts, {\n fetchPolicy: fetchPolicy\n }));\n var result = this.queryObservable.currentResult();\n return result.loading ? observable.result() : false;\n };\n\n Query.prototype.componentDidMount = function () {\n this.hasMounted = true;\n if (this.props.skip) return;\n this.startQuerySubscription();\n\n if (this.refetcherQueue) {\n var _a = this.refetcherQueue,\n args = _a.args,\n resolve = _a.resolve,\n reject = _a.reject;\n this.queryObservable.refetch(args).then(resolve).catch(reject);\n }\n };\n\n Query.prototype.componentWillReceiveProps = function (nextProps, nextContext) {\n if (nextProps.skip && !this.props.skip) {\n this.removeQuerySubscription();\n return;\n }\n\n var client = nextProps.client;\n\n if (shallowEqual(this.props, nextProps) && (this.client === client || this.client === nextContext.client)) {\n return;\n }\n\n if (this.client !== client && this.client !== nextContext.client) {\n if (client) {\n this.client = client;\n } else {\n this.client = nextContext.client;\n }\n\n this.removeQuerySubscription();\n this.queryObservable = null;\n this.previousData = {};\n this.updateQuery(nextProps);\n }\n\n if (this.props.query !== nextProps.query) {\n this.removeQuerySubscription();\n }\n\n this.updateQuery(nextProps);\n if (nextProps.skip) return;\n this.startQuerySubscription();\n };\n\n Query.prototype.componentWillUnmount = function () {\n this.removeQuerySubscription();\n this.hasMounted = false;\n };\n\n Query.prototype.render = function () {\n var children = this.props.children;\n var queryResult = this.getQueryResult();\n return children(queryResult);\n };\n\n Query.prototype.extractOptsFromProps = function (props) {\n var variables = props.variables,\n pollInterval = props.pollInterval,\n fetchPolicy = props.fetchPolicy,\n errorPolicy = props.errorPolicy,\n notifyOnNetworkStatusChange = props.notifyOnNetworkStatusChange,\n query = props.query,\n _a = props.displayName,\n displayName = _a === void 0 ? 'Query' : _a,\n _b = props.context,\n context = _b === void 0 ? {} : _b;\n this.operation = parser(query);\n invariant$3(this.operation.type === DocumentType.Query, \"The component requires a graphql query, but got a \" + (this.operation.type === DocumentType.Mutation ? 'mutation' : 'subscription') + \".\");\n return compact({\n variables: variables,\n pollInterval: pollInterval,\n query: query,\n fetchPolicy: fetchPolicy,\n errorPolicy: errorPolicy,\n notifyOnNetworkStatusChange: notifyOnNetworkStatusChange,\n metadata: {\n reactComponent: {\n displayName: displayName\n }\n },\n context: context\n });\n };\n\n Query.prototype.initializeQueryObservable = function (props) {\n var opts = this.extractOptsFromProps(props);\n\n if (this.context.operations) {\n this.context.operations.set(this.operation.name, {\n query: opts.query,\n variables: opts.variables\n });\n }\n\n this.queryObservable = this.client.watchQuery(opts);\n };\n\n Query.prototype.updateQuery = function (props) {\n if (!this.queryObservable) this.initializeQueryObservable(props);\n this.queryObservable.setOptions(this.extractOptsFromProps(props)).catch(function () {\n return null;\n });\n };\n\n Query.prototype.resubscribeToQuery = function () {\n this.removeQuerySubscription();\n var lastError = this.queryObservable.getLastError();\n var lastResult = this.queryObservable.getLastResult();\n this.queryObservable.resetLastResults();\n this.startQuerySubscription();\n Object.assign(this.queryObservable, {\n lastError: lastError,\n lastResult: lastResult\n });\n };\n\n Query.contextTypes = {\n client: PropTypes.object.isRequired,\n operations: PropTypes.object\n };\n Query.propTypes = {\n children: PropTypes.func.isRequired,\n fetchPolicy: PropTypes.string,\n notifyOnNetworkStatusChange: PropTypes.bool,\n onCompleted: PropTypes.func,\n onError: PropTypes.func,\n pollInterval: PropTypes.number,\n query: PropTypes.object.isRequired,\n variables: PropTypes.object,\n ssr: PropTypes.bool\n };\n return Query;\n }(React.Component);\n\n var __extends$2 = undefined && undefined.__extends || function () {\n var extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n };\n\n return function (d, b) {\n extendStatics(d, b);\n\n function __() {\n this.constructor = d;\n }\n\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n }();\n\n var __assign$1 = undefined && undefined.__assign || Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n\n return t;\n };\n\n var invariant$4 = require('invariant');\n\n var shallowEqual$1 = require('fbjs/lib/shallowEqual');\n\n var initialState = {\n loading: false,\n called: false,\n error: undefined,\n data: undefined\n };\n\n var Mutation = function (_super) {\n __extends$2(Mutation, _super);\n\n function Mutation(props, context) {\n var _this = _super.call(this, props, context) || this;\n\n _this.hasMounted = false;\n\n _this.runMutation = function (options) {\n if (options === void 0) {\n options = {};\n }\n\n _this.onMutationStart();\n\n var mutationId = _this.generateNewMutationId();\n\n return _this.mutate(options).then(function (response) {\n _this.onMutationCompleted(response, mutationId);\n\n return response;\n }).catch(function (e) {\n _this.onMutationError(e, mutationId);\n\n if (!_this.props.onError) throw e;\n });\n };\n\n _this.mutate = function (options) {\n var _a = _this.props,\n mutation = _a.mutation,\n variables = _a.variables,\n optimisticResponse = _a.optimisticResponse,\n update = _a.update,\n _b = _a.context,\n context = _b === void 0 ? {} : _b,\n _c = _a.awaitRefetchQueries,\n awaitRefetchQueries = _c === void 0 ? false : _c;\n var refetchQueries = options.refetchQueries || _this.props.refetchQueries;\n\n if (refetchQueries && refetchQueries.length && Array.isArray(refetchQueries)) {\n refetchQueries = refetchQueries.map(function (x) {\n if (typeof x === 'string' && _this.context.operations) return _this.context.operations.get(x) || x;\n return x;\n });\n delete options.refetchQueries;\n }\n\n return _this.client.mutate(__assign$1({\n mutation: mutation,\n variables: variables,\n optimisticResponse: optimisticResponse,\n refetchQueries: refetchQueries,\n awaitRefetchQueries: awaitRefetchQueries,\n update: update,\n context: context\n }, options));\n };\n\n _this.onMutationStart = function () {\n if (!_this.state.loading && !_this.props.ignoreResults) {\n _this.setState({\n loading: true,\n error: undefined,\n data: undefined,\n called: true\n });\n }\n };\n\n _this.onMutationCompleted = function (response, mutationId) {\n if (_this.hasMounted === false) {\n return;\n }\n\n var _a = _this.props,\n onCompleted = _a.onCompleted,\n ignoreResults = _a.ignoreResults;\n var data = response.data;\n\n var callOncomplete = function () {\n return onCompleted ? onCompleted(data) : null;\n };\n\n if (_this.isMostRecentMutation(mutationId) && !ignoreResults) {\n _this.setState({\n loading: false,\n data: data\n }, callOncomplete);\n } else {\n callOncomplete();\n }\n };\n\n _this.onMutationError = function (error, mutationId) {\n if (_this.hasMounted === false) {\n return;\n }\n\n var onError = _this.props.onError;\n\n var callOnError = function () {\n return onError ? onError(error) : null;\n };\n\n if (_this.isMostRecentMutation(mutationId)) {\n _this.setState({\n loading: false,\n error: error\n }, callOnError);\n } else {\n callOnError();\n }\n };\n\n _this.generateNewMutationId = function () {\n _this.mostRecentMutationId = _this.mostRecentMutationId + 1;\n return _this.mostRecentMutationId;\n };\n\n _this.isMostRecentMutation = function (mutationId) {\n return _this.mostRecentMutationId === mutationId;\n };\n\n _this.verifyDocumentIsMutation = function (mutation) {\n var operation = parser(mutation);\n invariant$4(operation.type === DocumentType.Mutation, \"The component requires a graphql mutation, but got a \" + (operation.type === DocumentType.Query ? 'query' : 'subscription') + \".\");\n };\n\n _this.client = props.client || context.client;\n invariant$4(!!_this.client, 'Could not find \"client\" in the context or props of Mutation. Wrap ' + 'the root component in an , or pass an ApolloClient ' + 'instance in via props.');\n\n _this.verifyDocumentIsMutation(props.mutation);\n\n _this.mostRecentMutationId = 0;\n _this.state = initialState;\n return _this;\n }\n\n Mutation.prototype.componentDidMount = function () {\n this.hasMounted = true;\n };\n\n Mutation.prototype.componentWillUnmount = function () {\n this.hasMounted = false;\n };\n\n Mutation.prototype.componentWillReceiveProps = function (nextProps, nextContext) {\n var client = nextProps.client;\n\n if (shallowEqual$1(this.props, nextProps) && (this.client === client || this.client === nextContext.client)) {\n return;\n }\n\n if (this.props.mutation !== nextProps.mutation) {\n this.verifyDocumentIsMutation(nextProps.mutation);\n }\n\n if (this.client !== client && this.client !== nextContext.client) {\n this.client = client || nextContext.client;\n this.setState(initialState);\n }\n };\n\n Mutation.prototype.render = function () {\n var children = this.props.children;\n var _a = this.state,\n loading = _a.loading,\n data = _a.data,\n error = _a.error,\n called = _a.called;\n var result = {\n called: called,\n loading: loading,\n data: data,\n error: error,\n client: this.client\n };\n return children(this.runMutation, result);\n };\n\n Mutation.contextTypes = {\n client: PropTypes.object.isRequired,\n operations: PropTypes.object\n };\n Mutation.propTypes = {\n mutation: PropTypes.object.isRequired,\n variables: PropTypes.object,\n optimisticResponse: PropTypes.object,\n refetchQueries: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.object])), PropTypes.func]),\n awaitRefetchQueries: PropTypes.bool,\n update: PropTypes.func,\n children: PropTypes.func.isRequired,\n onCompleted: PropTypes.func,\n onError: PropTypes.func\n };\n return Mutation;\n }(React.Component);\n\n var __extends$3 = undefined && undefined.__extends || function () {\n var extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n };\n\n return function (d, b) {\n extendStatics(d, b);\n\n function __() {\n this.constructor = d;\n }\n\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n }();\n\n var shallowEqual$2 = require('fbjs/lib/shallowEqual');\n\n var invariant$5 = require('invariant');\n\n var Subscription = function (_super) {\n __extends$3(Subscription, _super);\n\n function Subscription(props, context) {\n var _this = _super.call(this, props, context) || this;\n\n _this.initialize = function (props) {\n if (_this.queryObservable) return;\n _this.queryObservable = _this.client.subscribe({\n query: props.subscription,\n variables: props.variables\n });\n };\n\n _this.startSubscription = function () {\n if (_this.querySubscription) return;\n _this.querySubscription = _this.queryObservable.subscribe({\n next: _this.updateCurrentData,\n error: _this.updateError\n });\n };\n\n _this.getInitialState = function () {\n return {\n loading: true,\n error: undefined,\n data: undefined\n };\n };\n\n _this.updateCurrentData = function (result) {\n _this.setState({\n data: result.data,\n loading: false,\n error: undefined\n });\n };\n\n _this.updateError = function (error) {\n _this.setState({\n error: error,\n loading: false\n });\n };\n\n _this.endSubscription = function () {\n if (_this.querySubscription) {\n _this.querySubscription.unsubscribe();\n\n delete _this.querySubscription;\n }\n };\n\n invariant$5(!!context.client, \"Could not find \\\"client\\\" in the context of Subscription. Wrap the root component in an \");\n _this.client = context.client;\n\n _this.initialize(props);\n\n _this.state = _this.getInitialState();\n return _this;\n }\n\n Subscription.prototype.componentDidMount = function () {\n this.startSubscription();\n };\n\n Subscription.prototype.componentWillReceiveProps = function (nextProps, nextContext) {\n if (shallowEqual$2(this.props.variables, nextProps.variables) && this.client === nextContext.client && this.props.subscription === nextProps.subscription) {\n return;\n }\n\n var shouldResubscribe = nextProps.shouldResubscribe;\n\n if (typeof shouldResubscribe === 'function') {\n shouldResubscribe = !!shouldResubscribe(this.props, nextProps);\n }\n\n var shouldNotResubscribe = shouldResubscribe === false;\n\n if (this.client !== nextContext.client) {\n this.client = nextContext.client;\n }\n\n if (!shouldNotResubscribe) {\n this.endSubscription();\n delete this.queryObservable;\n this.initialize(nextProps);\n this.startSubscription();\n this.setState(this.getInitialState());\n return;\n }\n\n this.initialize(nextProps);\n this.startSubscription();\n };\n\n Subscription.prototype.componentWillUnmount = function () {\n this.endSubscription();\n };\n\n Subscription.prototype.render = function () {\n var result = Object.assign({}, this.state, {\n variables: this.props.variables\n });\n return this.props.children(result);\n };\n\n Subscription.contextTypes = {\n client: PropTypes.object.isRequired\n };\n Subscription.propTypes = {\n subscription: PropTypes.object.isRequired,\n variables: PropTypes.object,\n children: PropTypes.func.isRequired,\n shouldResubscribe: PropTypes.oneOfType([PropTypes.func, PropTypes.bool])\n };\n return Subscription;\n }(React.Component);\n\n var __extends$4 = undefined && undefined.__extends || function () {\n var extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n };\n\n return function (d, b) {\n extendStatics(d, b);\n\n function __() {\n this.constructor = d;\n }\n\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n }();\n\n var invariant$6 = require('invariant');\n\n var defaultMapPropsToOptions = function () {\n return {};\n };\n\n var defaultMapPropsToSkip = function () {\n return false;\n };\n\n function getDisplayName(WrappedComponent) {\n return WrappedComponent.displayName || WrappedComponent.name || 'Component';\n }\n\n function calculateVariablesFromProps(operation, props, graphQLDisplayName, wrapperName) {\n var variables = {};\n\n for (var _i = 0, _a = operation.variables; _i < _a.length; _i++) {\n var _b = _a[_i],\n variable = _b.variable,\n type = _b.type;\n if (!variable.name || !variable.name.value) continue;\n var variableName = variable.name.value;\n var variableProp = props[variableName];\n\n if (typeof variableProp !== 'undefined') {\n variables[variableName] = variableProp;\n continue;\n }\n\n if (type.kind !== 'NonNullType') {\n variables[variableName] = null;\n continue;\n }\n\n if (operation.type === DocumentType.Mutation) return;\n invariant$6(typeof variableProp !== 'undefined', \"The operation '\" + operation.name + \"' wrapping '\" + wrapperName + \"' \" + (\"is expecting a variable: '\" + variable.name.value + \"' but it was not found in the props \") + (\"passed to '\" + graphQLDisplayName + \"'\"));\n }\n\n return variables;\n }\n\n var GraphQLBase = function (_super) {\n __extends$4(GraphQLBase, _super);\n\n function GraphQLBase(props) {\n var _this = _super.call(this, props) || this;\n\n _this.withRef = false;\n _this.setWrappedInstance = _this.setWrappedInstance.bind(_this);\n return _this;\n }\n\n GraphQLBase.prototype.getWrappedInstance = function () {\n invariant$6(this.withRef, \"To access the wrapped instance, you need to specify \" + \"{ withRef: true } in the options\");\n return this.wrappedInstance;\n };\n\n GraphQLBase.prototype.setWrappedInstance = function (ref) {\n this.wrappedInstance = ref;\n };\n\n return GraphQLBase;\n }(React.Component);\n\n var __extends$5 = undefined && undefined.__extends || function () {\n var extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n };\n\n return function (d, b) {\n extendStatics(d, b);\n\n function __() {\n this.constructor = d;\n }\n\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n }();\n\n var __assign$2 = undefined && undefined.__assign || Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n\n return t;\n };\n\n var __rest$1 = undefined && undefined.__rest || function (s, e) {\n var t = {};\n\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) t[p[i]] = s[p[i]];\n return t;\n };\n\n var hoistNonReactStatics = require('hoist-non-react-statics');\n\n function query(document, operationOptions) {\n if (operationOptions === void 0) {\n operationOptions = {};\n }\n\n var operation = parser(document);\n var _a = operationOptions.options,\n options = _a === void 0 ? defaultMapPropsToOptions : _a,\n _b = operationOptions.skip,\n skip = _b === void 0 ? defaultMapPropsToSkip : _b,\n _c = operationOptions.alias,\n alias = _c === void 0 ? 'Apollo' : _c;\n var mapPropsToOptions = options;\n if (typeof mapPropsToOptions !== 'function') mapPropsToOptions = function () {\n return options;\n };\n var mapPropsToSkip = skip;\n if (typeof mapPropsToSkip !== 'function') mapPropsToSkip = function () {\n return skip;\n };\n var lastResultProps;\n return function (WrappedComponent) {\n var graphQLDisplayName = alias + \"(\" + getDisplayName(WrappedComponent) + \")\";\n\n var GraphQL = function (_super) {\n __extends$5(GraphQL, _super);\n\n function GraphQL() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n GraphQL.prototype.render = function () {\n var _this = this;\n\n var props = this.props;\n var shouldSkip = mapPropsToSkip(props);\n var opts = shouldSkip ? Object.create(null) : mapPropsToOptions(props);\n\n if (!shouldSkip && !opts.variables && operation.variables.length > 0) {\n opts.variables = calculateVariablesFromProps(operation, props, graphQLDisplayName, getDisplayName(WrappedComponent));\n }\n\n return React.createElement(Query, __assign$2({}, opts, {\n displayName: graphQLDisplayName,\n skip: shouldSkip,\n query: document,\n warnUnhandledError: true\n }), function (_a) {\n var _ = _a.client,\n data = _a.data,\n r = __rest$1(_a, [\"client\", \"data\"]);\n\n var _b, _c;\n\n if (operationOptions.withRef) {\n _this.withRef = true;\n props = Object.assign({}, props, {\n ref: _this.setWrappedInstance\n });\n }\n\n if (shouldSkip) return React.createElement(WrappedComponent, __assign$2({}, props));\n var result = Object.assign(r, data || {});\n var name = operationOptions.name || 'data';\n var childProps = (_b = {}, _b[name] = result, _b);\n\n if (operationOptions.props) {\n var newResult = (_c = {}, _c[name] = result, _c.ownProps = props, _c);\n lastResultProps = operationOptions.props(newResult, lastResultProps);\n childProps = lastResultProps;\n }\n\n return React.createElement(WrappedComponent, __assign$2({}, props, childProps));\n });\n };\n\n GraphQL.displayName = graphQLDisplayName;\n GraphQL.WrappedComponent = WrappedComponent;\n return GraphQL;\n }(GraphQLBase);\n\n return hoistNonReactStatics(GraphQL, WrappedComponent, {});\n };\n }\n\n var __extends$6 = undefined && undefined.__extends || function () {\n var extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n };\n\n return function (d, b) {\n extendStatics(d, b);\n\n function __() {\n this.constructor = d;\n }\n\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n }();\n\n var __assign$3 = undefined && undefined.__assign || Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n\n return t;\n };\n\n var hoistNonReactStatics$1 = require('hoist-non-react-statics');\n\n function mutation(document, operationOptions) {\n if (operationOptions === void 0) {\n operationOptions = {};\n }\n\n var operation = parser(document);\n var _a = operationOptions.options,\n options = _a === void 0 ? defaultMapPropsToOptions : _a,\n _b = operationOptions.alias,\n alias = _b === void 0 ? 'Apollo' : _b;\n var mapPropsToOptions = options;\n if (typeof mapPropsToOptions !== 'function') mapPropsToOptions = function () {\n return options;\n };\n return function (WrappedComponent) {\n var graphQLDisplayName = alias + \"(\" + getDisplayName(WrappedComponent) + \")\";\n\n var GraphQL = function (_super) {\n __extends$6(GraphQL, _super);\n\n function GraphQL() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n GraphQL.prototype.render = function () {\n var props = this.props;\n var opts = mapPropsToOptions(props);\n\n if (operationOptions.withRef) {\n this.withRef = true;\n props = Object.assign({}, props, {\n ref: this.setWrappedInstance\n });\n }\n\n if (!opts.variables && operation.variables.length > 0) {\n opts.variables = calculateVariablesFromProps(operation, props, graphQLDisplayName, getDisplayName(WrappedComponent));\n }\n\n return React.createElement(Mutation, __assign$3({}, opts, {\n mutation: document,\n ignoreResults: true\n }), function (mutate, _result) {\n var _a, _b;\n\n var name = operationOptions.name || 'mutate';\n var childProps = (_a = {}, _a[name] = mutate, _a);\n\n if (operationOptions.props) {\n var newResult = (_b = {}, _b[name] = mutate, _b.ownProps = props, _b);\n childProps = operationOptions.props(newResult);\n }\n\n return React.createElement(WrappedComponent, __assign$3({}, props, childProps));\n });\n };\n\n GraphQL.displayName = graphQLDisplayName;\n GraphQL.WrappedComponent = WrappedComponent;\n return GraphQL;\n }(GraphQLBase);\n\n return hoistNonReactStatics$1(GraphQL, WrappedComponent, {});\n };\n }\n\n var __extends$7 = undefined && undefined.__extends || function () {\n var extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n };\n\n return function (d, b) {\n extendStatics(d, b);\n\n function __() {\n this.constructor = d;\n }\n\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n }();\n\n var __assign$4 = undefined && undefined.__assign || Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n\n return t;\n };\n\n var __rest$2 = undefined && undefined.__rest || function (s, e) {\n var t = {};\n\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) t[p[i]] = s[p[i]];\n return t;\n };\n\n var hoistNonReactStatics$2 = require('hoist-non-react-statics');\n\n function subscribe(document, operationOptions) {\n if (operationOptions === void 0) {\n operationOptions = {};\n }\n\n var operation = parser(document);\n var _a = operationOptions.options,\n options = _a === void 0 ? defaultMapPropsToOptions : _a,\n _b = operationOptions.skip,\n skip = _b === void 0 ? defaultMapPropsToSkip : _b,\n _c = operationOptions.alias,\n alias = _c === void 0 ? 'Apollo' : _c,\n shouldResubscribe = operationOptions.shouldResubscribe;\n var mapPropsToOptions = options;\n if (typeof mapPropsToOptions !== 'function') mapPropsToOptions = function () {\n return options;\n };\n var mapPropsToSkip = skip;\n if (typeof mapPropsToSkip !== 'function') mapPropsToSkip = function () {\n return skip;\n };\n var lastResultProps;\n return function (WrappedComponent) {\n var graphQLDisplayName = alias + \"(\" + getDisplayName(WrappedComponent) + \")\";\n\n var GraphQL = function (_super) {\n __extends$7(GraphQL, _super);\n\n function GraphQL(props) {\n var _this = _super.call(this, props) || this;\n\n _this.state = {\n resubscribe: false\n };\n return _this;\n }\n\n GraphQL.prototype.componentWillReceiveProps = function (nextProps) {\n if (!shouldResubscribe) return;\n this.setState({\n resubscribe: shouldResubscribe(this.props, nextProps)\n });\n };\n\n GraphQL.prototype.render = function () {\n var _this = this;\n\n var props = this.props;\n var shouldSkip = mapPropsToSkip(props);\n var opts = shouldSkip ? Object.create(null) : mapPropsToOptions(props);\n\n if (!shouldSkip && !opts.variables && operation.variables.length > 0) {\n opts.variables = calculateVariablesFromProps(operation, props, graphQLDisplayName, getDisplayName(WrappedComponent));\n }\n\n return React.createElement(Subscription, __assign$4({}, opts, {\n displayName: graphQLDisplayName,\n skip: shouldSkip,\n subscription: document,\n shouldResubscribe: this.state.resubscribe\n }), function (_a) {\n var data = _a.data,\n r = __rest$2(_a, [\"data\"]);\n\n var _b, _c;\n\n if (operationOptions.withRef) {\n _this.withRef = true;\n props = Object.assign({}, props, {\n ref: _this.setWrappedInstance\n });\n }\n\n if (shouldSkip) return React.createElement(WrappedComponent, __assign$4({}, props));\n var result = Object.assign(r, data || {});\n var name = operationOptions.name || 'data';\n var childProps = (_b = {}, _b[name] = result, _b);\n\n if (operationOptions.props) {\n var newResult = (_c = {}, _c[name] = result, _c.ownProps = props, _c);\n lastResultProps = operationOptions.props(newResult, lastResultProps);\n childProps = lastResultProps;\n }\n\n return React.createElement(WrappedComponent, __assign$4({}, props, childProps));\n });\n };\n\n GraphQL.displayName = graphQLDisplayName;\n GraphQL.WrappedComponent = WrappedComponent;\n return GraphQL;\n }(GraphQLBase);\n\n return hoistNonReactStatics$2(GraphQL, WrappedComponent, {});\n };\n }\n\n function graphql(document, operationOptions) {\n if (operationOptions === void 0) {\n operationOptions = {};\n }\n\n switch (parser(document).type) {\n case DocumentType.Mutation:\n return mutation(document, operationOptions);\n\n case DocumentType.Subscription:\n return subscribe(document, operationOptions);\n\n case DocumentType.Query:\n default:\n return query(document, operationOptions);\n }\n }\n\n var __extends$8 = undefined && undefined.__extends || function () {\n var extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n };\n\n return function (d, b) {\n extendStatics(d, b);\n\n function __() {\n this.constructor = d;\n }\n\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n }();\n\n var __assign$5 = undefined && undefined.__assign || Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n\n return t;\n };\n\n var invariant$7 = require('invariant');\n\n var hoistNonReactStatics$3 = require('hoist-non-react-statics');\n\n function getDisplayName$1(WrappedComponent) {\n return WrappedComponent.displayName || WrappedComponent.name || 'Component';\n }\n\n function withApollo(WrappedComponent, operationOptions) {\n if (operationOptions === void 0) {\n operationOptions = {};\n }\n\n var withDisplayName = \"withApollo(\" + getDisplayName$1(WrappedComponent) + \")\";\n\n var WithApollo = function (_super) {\n __extends$8(WithApollo, _super);\n\n function WithApollo(props) {\n var _this = _super.call(this, props) || this;\n\n _this.setWrappedInstance = _this.setWrappedInstance.bind(_this);\n return _this;\n }\n\n WithApollo.prototype.getWrappedInstance = function () {\n invariant$7(operationOptions.withRef, \"To access the wrapped instance, you need to specify \" + \"{ withRef: true } in the options\");\n return this.wrappedInstance;\n };\n\n WithApollo.prototype.setWrappedInstance = function (ref) {\n this.wrappedInstance = ref;\n };\n\n WithApollo.prototype.render = function () {\n var _this = this;\n\n return React.createElement(ApolloConsumer, null, function (client) {\n var props = Object.assign({}, _this.props, {\n client: client,\n ref: operationOptions.withRef ? _this.setWrappedInstance : undefined\n });\n return React.createElement(WrappedComponent, __assign$5({}, props));\n });\n };\n\n WithApollo.displayName = withDisplayName;\n WithApollo.WrappedComponent = WrappedComponent;\n return WithApollo;\n }(React.Component);\n\n return hoistNonReactStatics$3(WithApollo, WrappedComponent, {});\n }\n\n var compose = require('lodash/flowRight');\n\n exports.compose = compose;\n exports.getDataFromTree = getDataFromTree;\n exports.ApolloConsumer = ApolloConsumer;\n exports.ApolloProvider = ApolloProvider;\n exports.Query = Query;\n exports.Mutation = Mutation;\n exports.Subscription = Subscription;\n exports.graphql = graphql;\n exports.withApollo = withApollo;\n exports.walkTree = walkTree;\n Object.defineProperty(exports, '__esModule', {\n value: true\n });\n});","import React from \"react\";\nimport IframeModal from \"./IframeModal\";\n\nclass IframeModalLink extends React.Component {\n state = {\n open: false\n };\n\n render() {\n const { to, children, onRequestClose, as, onClick, ...rest } = this.props;\n const { open } = this.state;\n const Component = as ? as : \"a\";\n\n return (\n \n {open && (\n {\n if (onRequestClose) onRequestClose();\n this.setState({ open: false });\n }}\n path={to}\n />\n )}\n {\n e.preventDefault();\n if (onClick) onClick(e);\n this.setState({ open: true });\n }}\n {...rest}\n >\n {children}\n \n \n );\n }\n}\n\nexport default IframeModalLink;\n","\"use strict\";\n\nexports.__esModule = true;\n\nvar _setPrototypeOf = require(\"../core-js/object/set-prototype-of\");\n\nvar _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf);\n\nvar _create = require(\"../core-js/object/create\");\n\nvar _create2 = _interopRequireDefault(_create);\n\nvar _typeof2 = require(\"../helpers/typeof\");\n\nvar _typeof3 = _interopRequireDefault(_typeof2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + (typeof superClass === \"undefined\" ? \"undefined\" : (0, _typeof3.default)(superClass)));\n }\n\n subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass;\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar DISPLAY_FORMAT = exports.DISPLAY_FORMAT = 'L';\nvar ISO_FORMAT = exports.ISO_FORMAT = 'YYYY-MM-DD';\nvar ISO_MONTH_FORMAT = exports.ISO_MONTH_FORMAT = 'YYYY-MM';\nvar START_DATE = exports.START_DATE = 'startDate';\nvar END_DATE = exports.END_DATE = 'endDate';\nvar HORIZONTAL_ORIENTATION = exports.HORIZONTAL_ORIENTATION = 'horizontal';\nvar VERTICAL_ORIENTATION = exports.VERTICAL_ORIENTATION = 'vertical';\nvar VERTICAL_SCROLLABLE = exports.VERTICAL_SCROLLABLE = 'verticalScrollable';\nvar ICON_BEFORE_POSITION = exports.ICON_BEFORE_POSITION = 'before';\nvar ICON_AFTER_POSITION = exports.ICON_AFTER_POSITION = 'after';\nvar INFO_POSITION_TOP = exports.INFO_POSITION_TOP = 'top';\nvar INFO_POSITION_BOTTOM = exports.INFO_POSITION_BOTTOM = 'bottom';\nvar INFO_POSITION_BEFORE = exports.INFO_POSITION_BEFORE = 'before';\nvar INFO_POSITION_AFTER = exports.INFO_POSITION_AFTER = 'after';\nvar ANCHOR_LEFT = exports.ANCHOR_LEFT = 'left';\nvar ANCHOR_RIGHT = exports.ANCHOR_RIGHT = 'right';\nvar OPEN_DOWN = exports.OPEN_DOWN = 'down';\nvar OPEN_UP = exports.OPEN_UP = 'up';\nvar DAY_SIZE = exports.DAY_SIZE = 39;\nvar BLOCKED_MODIFIER = exports.BLOCKED_MODIFIER = 'blocked';\nvar WEEKDAYS = exports.WEEKDAYS = [0, 1, 2, 3, 4, 5, 6];\nvar FANG_WIDTH_PX = exports.FANG_WIDTH_PX = 20;\nvar FANG_HEIGHT_PX = exports.FANG_HEIGHT_PX = 10;\nvar DEFAULT_VERTICAL_SPACING = exports.DEFAULT_VERTICAL_SPACING = 22;\nvar MODIFIER_KEY_NAMES = exports.MODIFIER_KEY_NAMES = new Set(['Shift', 'Control', 'Alt', 'Meta']);","// extracted by mini-css-extract-plugin\nmodule.exports = {\"row\":\"calendar-module__row___2ECVO\",\"date\":\"calendar-module__date___2FWis\",\"header\":\"calendar-module__header____a9x4\",\"headerMonths\":\"calendar-module__headerMonths___1pazf\",\"headerDates\":\"calendar-module__headerDates___pE7wi\",\"selectable\":\"calendar-module__selectable___33c_y\",\"firstDate\":\"calendar-module__firstDate___2TwKw\",\"weekend\":\"calendar-module__weekend___2jhhj\",\"month\":\"calendar-module__month___1CCcr\",\"tenancy\":\"calendar-module__tenancy___338YD\",\"tenancyUser\":\"calendar-module__tenancyUser___3d-dt\",\"tenancyDate\":\"calendar-module__tenancyDate___1e8rC\",\"loading\":\"calendar-module__loading___1Y_UI\",\"service\":\"calendar-module__service___4WNql\",\"serviceList\":\"calendar-module__serviceList___8ucby\",\"serviceNumber\":\"calendar-module__serviceNumber___2YWj2\",\"success\":\"calendar-module__success___35xGY\",\"important\":\"calendar-module__important___3NM7i\",\"critical\":\"calendar-module__critical___3ALT4\",\"now\":\"calendar-module__now___2brz-\",\"tenancy-attention-critical\":\"calendar-module__tenancy-attention-critical___voW8F\",\"tenancy-attention-important\":\"calendar-module__tenancy-attention-important___32f-Y\",\"tenancy-attention-success\":\"calendar-module__tenancy-attention-success___C2IRD\"};","module.exports = { \"default\": require(\"core-js/library/fn/object/get-prototype-of\"), __esModule: true };","// extracted by mini-css-extract-plugin\nmodule.exports = {\"color-primary\":\"styles-module__color-primary___2Sk9h\",\"clickable\":\"styles-module__clickable___3AXLE\",\"color-secondary\":\"styles-module__color-secondary___Je-5y\",\"color-secondary-darken\":\"styles-module__color-secondary-darken___1FwJs\",\"color-background\":\"styles-module__color-background___-7aql\",\"color-dark-background\":\"styles-module__color-dark-background___1NGgl\",\"color-green\":\"styles-module__color-green___smh1p\",\"color-yellow\":\"styles-module__color-yellow___2VajO\",\"color-red\":\"styles-module__color-red___1p8bn\",\"color-blue\":\"styles-module__color-blue___3qoSC\",\"color-black\":\"styles-module__color-black___2jHtx\",\"color-grey\":\"styles-module__color-grey___1qS9H\",\"color-light-grey\":\"styles-module__color-light-grey___2HH9y\",\"color-attention-normal\":\"styles-module__color-attention-normal___37TFC\",\"color-attention-important\":\"styles-module__color-attention-important___2jwNE\",\"color-attention-critical\":\"styles-module__color-attention-critical___2iPfg\",\"color-attention-success\":\"styles-module__color-attention-success___1TB9l\",\"color-table-border\":\"styles-module__color-table-border___4I5OY\",\"Toolbar\":\"styles-module__Toolbar___1bUqj\",\"ToolbarItem\":\"styles-module__ToolbarItem___2poVy\",\"Overlay\":\"styles-module__Overlay___yH8oC\",\"Rating\":\"styles-module__Rating___HrfNd\",\"CaseItem\":\"styles-module__CaseItem___2P1VA\",\"info\":\"styles-module__info___b6q_9\",\"extras\":\"styles-module__extras___3cM4k\",\"extra\":\"styles-module__extra___3PIXN\",\"hasPast\":\"styles-module__hasPast___JjUY9\",\"hasFuture\":\"styles-module__hasFuture___UTEL9\",\"ListCalendar\":\"styles-module__ListCalendar___rUc5p\",\"date\":\"styles-module__date___1VEZg\",\"today\":\"styles-module__today___KQRrq\",\"dateContent\":\"styles-module__dateContent___2k5ev\",\"column\":\"styles-module__column___1ePLF\",\"items\":\"styles-module__items___hecIl\"};","import createEmotion from 'create-emotion';\nvar context = typeof global !== 'undefined' ? global : {};\n\nvar _createEmotion = createEmotion(context),\n flush = _createEmotion.flush,\n hydrate = _createEmotion.hydrate,\n cx = _createEmotion.cx,\n merge = _createEmotion.merge,\n getRegisteredStyles = _createEmotion.getRegisteredStyles,\n injectGlobal = _createEmotion.injectGlobal,\n keyframes = _createEmotion.keyframes,\n css = _createEmotion.css,\n sheet = _createEmotion.sheet,\n caches = _createEmotion.caches;\n\nexport { flush, hydrate, cx, merge, getRegisteredStyles, injectGlobal, keyframes, css, sheet, caches };","var __extends = this && this.__extends || function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n };\n\n return extendStatics(d, b);\n };\n\n return function (d, b) {\n extendStatics(d, b);\n\n function __() {\n this.constructor = d;\n }\n\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\n\nvar __assign = this && this.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n\n return t;\n };\n\n return __assign.apply(this, arguments);\n};\n\nimport { getOperationName } from 'apollo-utilities';\nimport Observable from 'zen-observable-ts';\nimport { print } from 'graphql/language/printer';\nexport function validateOperation(operation) {\n var OPERATION_FIELDS = ['query', 'operationName', 'variables', 'extensions', 'context'];\n\n for (var _i = 0, _a = Object.keys(operation); _i < _a.length; _i++) {\n var key = _a[_i];\n\n if (OPERATION_FIELDS.indexOf(key) < 0) {\n throw new Error(\"illegal argument: \" + key);\n }\n }\n\n return operation;\n}\n\nvar LinkError =\n/** @class */\nfunction (_super) {\n __extends(LinkError, _super);\n\n function LinkError(message, link) {\n var _this = _super.call(this, message) || this;\n\n _this.link = link;\n return _this;\n }\n\n return LinkError;\n}(Error);\n\nexport { LinkError };\nexport function isTerminating(link) {\n return link.request.length <= 1;\n}\nexport function toPromise(observable) {\n var completed = false;\n return new Promise(function (resolve, reject) {\n observable.subscribe({\n next: function (data) {\n if (completed) {\n console.warn(\"Promise Wrapper does not support multiple results from Observable\");\n } else {\n completed = true;\n resolve(data);\n }\n },\n error: reject\n });\n });\n} // backwards compat\n\nexport var makePromise = toPromise;\nexport function fromPromise(promise) {\n return new Observable(function (observer) {\n promise.then(function (value) {\n observer.next(value);\n observer.complete();\n }).catch(observer.error.bind(observer));\n });\n}\nexport function fromError(errorValue) {\n return new Observable(function (observer) {\n observer.error(errorValue);\n });\n}\nexport function transformOperation(operation) {\n var transformedOperation = {\n variables: operation.variables || {},\n extensions: operation.extensions || {},\n operationName: operation.operationName,\n query: operation.query\n }; // best guess at an operation name\n\n if (!transformedOperation.operationName) {\n transformedOperation.operationName = typeof transformedOperation.query !== 'string' ? getOperationName(transformedOperation.query) : '';\n }\n\n return transformedOperation;\n}\nexport function createOperation(starting, operation) {\n var context = __assign({}, starting);\n\n var setContext = function (next) {\n if (typeof next === 'function') {\n context = __assign({}, context, next(context));\n } else {\n context = __assign({}, context, next);\n }\n };\n\n var getContext = function () {\n return __assign({}, context);\n };\n\n Object.defineProperty(operation, 'setContext', {\n enumerable: false,\n value: setContext\n });\n Object.defineProperty(operation, 'getContext', {\n enumerable: false,\n value: getContext\n });\n Object.defineProperty(operation, 'toKey', {\n enumerable: false,\n value: function () {\n return getKey(operation);\n }\n });\n return operation;\n}\nexport function getKey(operation) {\n // XXX we're assuming here that variables will be serialized in the same order.\n // that might not always be true\n return print(operation.query) + \"|\" + JSON.stringify(operation.variables) + \"|\" + operation.operationName;\n}","import { Observable } from './zenObservable';\nexport * from './zenObservable';\nexport default Observable;","/* tslint:disable */\nimport zenObservable from 'zen-observable';\nexport var Observable = zenObservable;","import Observable from 'zen-observable-ts';\nimport { validateOperation, isTerminating, LinkError, transformOperation, createOperation } from './linkUtils';\n\nvar passthrough = function (op, forward) {\n return forward ? forward(op) : Observable.of();\n};\n\nvar toLink = function (handler) {\n return typeof handler === 'function' ? new ApolloLink(handler) : handler;\n};\n\nexport var empty = function () {\n return new ApolloLink(function (op, forward) {\n return Observable.of();\n });\n};\nexport var from = function (links) {\n if (links.length === 0) return empty();\n return links.map(toLink).reduce(function (x, y) {\n return x.concat(y);\n });\n};\nexport var split = function (test, left, right) {\n if (right === void 0) {\n right = new ApolloLink(passthrough);\n }\n\n var leftLink = toLink(left);\n var rightLink = toLink(right);\n\n if (isTerminating(leftLink) && isTerminating(rightLink)) {\n return new ApolloLink(function (operation) {\n return test(operation) ? leftLink.request(operation) || Observable.of() : rightLink.request(operation) || Observable.of();\n });\n } else {\n return new ApolloLink(function (operation, forward) {\n return test(operation) ? leftLink.request(operation, forward) || Observable.of() : rightLink.request(operation, forward) || Observable.of();\n });\n }\n}; // join two Links together\n\nexport var concat = function (first, second) {\n var firstLink = toLink(first);\n\n if (isTerminating(firstLink)) {\n console.warn(new LinkError(\"You are calling concat on a terminating link, which will have no effect\", firstLink));\n return firstLink;\n }\n\n var nextLink = toLink(second);\n\n if (isTerminating(nextLink)) {\n return new ApolloLink(function (operation) {\n return firstLink.request(operation, function (op) {\n return nextLink.request(op) || Observable.of();\n }) || Observable.of();\n });\n } else {\n return new ApolloLink(function (operation, forward) {\n return firstLink.request(operation, function (op) {\n return nextLink.request(op, forward) || Observable.of();\n }) || Observable.of();\n });\n }\n};\n\nvar ApolloLink =\n/** @class */\nfunction () {\n function ApolloLink(request) {\n if (request) this.request = request;\n }\n\n ApolloLink.prototype.split = function (test, left, right) {\n if (right === void 0) {\n right = new ApolloLink(passthrough);\n }\n\n return this.concat(split(test, left, right));\n };\n\n ApolloLink.prototype.concat = function (next) {\n return concat(this, next);\n };\n\n ApolloLink.prototype.request = function (operation, forward) {\n throw new Error('request is not implemented');\n };\n\n ApolloLink.empty = empty;\n ApolloLink.from = from;\n ApolloLink.split = split;\n ApolloLink.execute = execute;\n return ApolloLink;\n}();\n\nexport { ApolloLink };\nexport function execute(link, operation) {\n return link.request(createOperation(operation.context, transformOperation(validateOperation(operation)))) || Observable.of();\n}","var __assign = this && this.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n\n return t;\n };\n\n return __assign.apply(this, arguments);\n};\n\nimport { print } from 'graphql/language/printer';\nvar defaultHttpOptions = {\n includeQuery: true,\n includeExtensions: false\n};\nvar defaultHeaders = {\n // headers are case insensitive (https://stackoverflow.com/a/5259004)\n accept: '*/*',\n 'content-type': 'application/json'\n};\nvar defaultOptions = {\n method: 'POST'\n};\nexport var fallbackHttpConfig = {\n http: defaultHttpOptions,\n headers: defaultHeaders,\n options: defaultOptions\n};\nexport var throwServerError = function (response, result, message) {\n var error = new Error(message);\n error.response = response;\n error.statusCode = response.status;\n error.result = result;\n throw error;\n}; //TODO: when conditional types come in ts 2.8, operations should be a generic type that extends Operation | Array\n\nexport var parseAndCheckHttpResponse = function (operations) {\n return function (response) {\n return response.text().then(function (bodyText) {\n try {\n return JSON.parse(bodyText);\n } catch (err) {\n var parseError = err;\n parseError.response = response;\n parseError.statusCode = response.status;\n parseError.bodyText = bodyText;\n return Promise.reject(parseError);\n }\n }) //TODO: when conditional types come out then result should be T extends Array ? Array : FetchResult\n .then(function (result) {\n if (response.status >= 300) {\n //Network error\n throwServerError(response, result, \"Response not successful: Received status code \" + response.status);\n } //TODO should really error per response in a Batch based on properties\n // - could be done in a validation link\n\n\n if (!Array.isArray(result) && !result.hasOwnProperty('data') && !result.hasOwnProperty('errors')) {\n //Data error\n throwServerError(response, result, \"Server response was missing for query '\" + (Array.isArray(operations) ? operations.map(function (op) {\n return op.operationName;\n }) : operations.operationName) + \"'.\");\n }\n\n return result;\n });\n };\n};\nexport var checkFetcher = function (fetcher) {\n if (!fetcher && typeof fetch === 'undefined') {\n var library = 'unfetch';\n if (typeof window === 'undefined') library = 'node-fetch';\n throw new Error(\"\\nfetch is not found globally and no fetcher passed, to fix pass a fetch for\\nyour environment like https://www.npmjs.com/package/\" + library + \".\\n\\nFor example:\\nimport fetch from '\" + library + \"';\\nimport { createHttpLink } from 'apollo-link-http';\\n\\nconst link = createHttpLink({ uri: '/graphql', fetch: fetch });\");\n }\n};\nexport var createSignalIfSupported = function () {\n if (typeof AbortController === 'undefined') return {\n controller: false,\n signal: false\n };\n var controller = new AbortController();\n var signal = controller.signal;\n return {\n controller: controller,\n signal: signal\n };\n};\nexport var selectHttpOptionsAndBody = function (operation, fallbackConfig) {\n var configs = [];\n\n for (var _i = 2; _i < arguments.length; _i++) {\n configs[_i - 2] = arguments[_i];\n }\n\n var options = __assign({}, fallbackConfig.options, {\n headers: fallbackConfig.headers,\n credentials: fallbackConfig.credentials\n });\n\n var http = fallbackConfig.http;\n /*\n * use the rest of the configs to populate the options\n * configs later in the list will overwrite earlier fields\n */\n\n configs.forEach(function (config) {\n options = __assign({}, options, config.options, {\n headers: __assign({}, options.headers, config.headers)\n });\n if (config.credentials) options.credentials = config.credentials;\n http = __assign({}, http, config.http);\n }); //The body depends on the http options\n\n var operationName = operation.operationName,\n extensions = operation.extensions,\n variables = operation.variables,\n query = operation.query;\n var body = {\n operationName: operationName,\n variables: variables\n };\n if (http.includeExtensions) body.extensions = extensions; // not sending the query (i.e persisted queries)\n\n if (http.includeQuery) body.query = print(query);\n return {\n options: options,\n body: body\n };\n};\nexport var serializeFetchParameter = function (p, label) {\n var serialized;\n\n try {\n serialized = JSON.stringify(p);\n } catch (e) {\n var parseError = new Error(\"Network request failed. \" + label + \" is not serializable: \" + e.message);\n parseError.parseError = e;\n throw parseError;\n }\n\n return serialized;\n}; //selects \"/graphql\" by default\n\nexport var selectURI = function (operation, fallbackURI) {\n var context = operation.getContext();\n var contextURI = context.uri;\n\n if (contextURI) {\n return contextURI;\n } else if (typeof fallbackURI === 'function') {\n return fallbackURI(operation);\n } else {\n return fallbackURI || '/graphql';\n }\n};","var __assign = this && this.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n\n return t;\n };\n\n return __assign.apply(this, arguments);\n};\n\nimport { Observable } from 'apollo-link'; // QueryBatcher doesn't fire requests immediately. Requests that were enqueued within\n// a certain amount of time (configurable through `batchInterval`) will be batched together\n// into one query.\n\nvar OperationBatcher =\n/** @class */\nfunction () {\n function OperationBatcher(_a) {\n var batchInterval = _a.batchInterval,\n _b = _a.batchMax,\n batchMax = _b === void 0 ? 0 : _b,\n batchHandler = _a.batchHandler,\n _c = _a.batchKey,\n batchKey = _c === void 0 ? function () {\n return '';\n } : _c;\n this.queuedRequests = new Map();\n this.batchInterval = batchInterval;\n this.batchMax = batchMax;\n this.batchHandler = batchHandler;\n this.batchKey = batchKey;\n }\n\n OperationBatcher.prototype.enqueueRequest = function (request) {\n var _this = this;\n\n var requestCopy = __assign({}, request);\n\n var queued = false;\n var key = this.batchKey(request.operation);\n\n if (!requestCopy.observable) {\n requestCopy.observable = new Observable(function (observer) {\n if (!_this.queuedRequests.has(key)) {\n _this.queuedRequests.set(key, []);\n }\n\n if (!queued) {\n _this.queuedRequests.get(key).push(requestCopy);\n\n queued = true;\n } //called for each subscriber, so need to save all listeners(next, error, complete)\n\n\n requestCopy.next = requestCopy.next || [];\n if (observer.next) requestCopy.next.push(observer.next.bind(observer));\n requestCopy.error = requestCopy.error || [];\n if (observer.error) requestCopy.error.push(observer.error.bind(observer));\n requestCopy.complete = requestCopy.complete || [];\n if (observer.complete) requestCopy.complete.push(observer.complete.bind(observer)); // The first enqueued request triggers the queue consumption after `batchInterval` milliseconds.\n\n if (_this.queuedRequests.get(key).length === 1) {\n _this.scheduleQueueConsumption(key);\n } // When amount of requests reaches `batchMax`, trigger the queue consumption without waiting on the `batchInterval`.\n\n\n if (_this.queuedRequests.get(key).length === _this.batchMax) {\n _this.consumeQueue(key);\n }\n });\n }\n\n return requestCopy.observable;\n }; // Consumes the queue.\n // Returns a list of promises (one for each query).\n\n\n OperationBatcher.prototype.consumeQueue = function (key) {\n if (key === void 0) {\n key = '';\n }\n\n var queuedRequests = this.queuedRequests.get(key);\n\n if (!queuedRequests) {\n return;\n }\n\n this.queuedRequests.delete(key);\n var requests = queuedRequests.map(function (queuedRequest) {\n return queuedRequest.operation;\n });\n var forwards = queuedRequests.map(function (queuedRequest) {\n return queuedRequest.forward;\n });\n var observables = [];\n var nexts = [];\n var errors = [];\n var completes = [];\n queuedRequests.forEach(function (batchableRequest, index) {\n observables.push(batchableRequest.observable);\n nexts.push(batchableRequest.next);\n errors.push(batchableRequest.error);\n completes.push(batchableRequest.complete);\n });\n var batchedObservable = this.batchHandler(requests, forwards) || Observable.of();\n\n var onError = function (error) {\n //each callback list in batch\n errors.forEach(function (rejecters) {\n if (rejecters) {\n //each subscriber to request\n rejecters.forEach(function (e) {\n return e(error);\n });\n }\n });\n };\n\n batchedObservable.subscribe({\n next: function (results) {\n if (!Array.isArray(results)) {\n results = [results];\n }\n\n if (nexts.length !== results.length) {\n var error = new Error(\"server returned results with length \" + results.length + \", expected length of \" + nexts.length);\n error.result = results;\n return onError(error);\n }\n\n results.forEach(function (result, index) {\n // attach the raw response to the context for usage\n requests[index].setContext({\n response: result\n });\n\n if (nexts[index]) {\n nexts[index].forEach(function (next) {\n return next(result);\n });\n }\n });\n },\n error: onError,\n complete: function () {\n completes.forEach(function (complete) {\n if (complete) {\n //each subscriber to request\n complete.forEach(function (c) {\n return c();\n });\n }\n });\n }\n });\n return observables;\n };\n\n OperationBatcher.prototype.scheduleQueueConsumption = function (key) {\n var _this = this;\n\n if (key === void 0) {\n key = '';\n }\n\n setTimeout(function () {\n if (_this.queuedRequests.get(key) && _this.queuedRequests.get(key).length) {\n _this.consumeQueue(key);\n }\n }, this.batchInterval);\n };\n\n return OperationBatcher;\n}();\n\nexport { OperationBatcher };","var __extends = this && this.__extends || function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n };\n\n return extendStatics(d, b);\n };\n\n return function (d, b) {\n extendStatics(d, b);\n\n function __() {\n this.constructor = d;\n }\n\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\n\nimport { ApolloLink } from 'apollo-link';\nimport { OperationBatcher } from './batching';\nexport { OperationBatcher } from './batching';\n\nvar BatchLink =\n/** @class */\nfunction (_super) {\n __extends(BatchLink, _super);\n\n function BatchLink(fetchParams) {\n if (fetchParams === void 0) {\n fetchParams = {};\n }\n\n var _this = _super.call(this) || this;\n\n var _a = fetchParams.batchInterval,\n batchInterval = _a === void 0 ? 10 : _a,\n _b = fetchParams.batchMax,\n batchMax = _b === void 0 ? 0 : _b,\n _c = fetchParams.batchHandler,\n batchHandler = _c === void 0 ? function () {\n return null;\n } : _c,\n _d = fetchParams.batchKey,\n batchKey = _d === void 0 ? function () {\n return '';\n } : _d;\n _this.batcher = new OperationBatcher({\n batchInterval: batchInterval,\n batchMax: batchMax,\n batchHandler: batchHandler,\n batchKey: batchKey\n }); //make this link terminating\n\n if (fetchParams.batchHandler.length <= 1) {\n _this.request = function (operation) {\n return _this.batcher.enqueueRequest({\n operation: operation\n });\n };\n }\n\n return _this;\n }\n\n BatchLink.prototype.request = function (operation, forward) {\n return this.batcher.enqueueRequest({\n operation: operation,\n forward: forward\n });\n };\n\n return BatchLink;\n}(ApolloLink);\n\nexport { BatchLink };","var __extends = this && this.__extends || function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n };\n\n return extendStatics(d, b);\n };\n\n return function (d, b) {\n extendStatics(d, b);\n\n function __() {\n this.constructor = d;\n }\n\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) t[p[i]] = s[p[i]];\n return t;\n};\n\nimport { ApolloLink, Observable, fromError } from 'apollo-link';\nimport { serializeFetchParameter, selectURI, parseAndCheckHttpResponse, checkFetcher, selectHttpOptionsAndBody, createSignalIfSupported, fallbackHttpConfig } from 'apollo-link-http-common';\nimport { BatchLink } from 'apollo-link-batch';\n/**\n * Transforms Operation for into HTTP results.\n * context can include the headers property, which will be passed to the fetch function\n */\n\nvar BatchHttpLink =\n/** @class */\nfunction (_super) {\n __extends(BatchHttpLink, _super);\n\n function BatchHttpLink(fetchParams) {\n if (fetchParams === void 0) {\n fetchParams = {};\n }\n\n var _this = _super.call(this) || this;\n\n var _a = fetchParams.uri,\n uri = _a === void 0 ? '/graphql' : _a,\n // use default global fetch is nothing passed in\n fetcher = fetchParams.fetch,\n includeExtensions = fetchParams.includeExtensions,\n batchInterval = fetchParams.batchInterval,\n batchMax = fetchParams.batchMax,\n batchKey = fetchParams.batchKey,\n requestOptions = __rest(fetchParams, [\"uri\", \"fetch\", \"includeExtensions\", \"batchInterval\", \"batchMax\", \"batchKey\"]); // dev warnings to ensure fetch is present\n\n\n checkFetcher(fetcher); //fetcher is set here rather than the destructuring to ensure fetch is\n //declared before referencing it. Reference in the destructuring would cause\n //a ReferenceError\n\n if (!fetcher) {\n fetcher = fetch;\n }\n\n var linkConfig = {\n http: {\n includeExtensions: includeExtensions\n },\n options: requestOptions.fetchOptions,\n credentials: requestOptions.credentials,\n headers: requestOptions.headers\n };\n _this.batchInterval = batchInterval || 10;\n _this.batchMax = batchMax || 10;\n\n var batchHandler = function (operations) {\n var chosenURI = selectURI(operations[0], uri);\n var context = operations[0].getContext();\n var contextConfig = {\n http: context.http,\n options: context.fetchOptions,\n credentials: context.credentials,\n headers: context.headers\n }; //uses fallback, link, and then context to build options\n\n var optsAndBody = operations.map(function (operation) {\n return selectHttpOptionsAndBody(operation, fallbackHttpConfig, linkConfig, contextConfig);\n });\n var loadedBody = optsAndBody.map(function (_a) {\n var body = _a.body;\n return body;\n });\n var options = optsAndBody[0].options; // There's no spec for using GET with batches.\n\n if (options.method === 'GET') {\n return fromError(new Error('apollo-link-batch-http does not support GET requests'));\n }\n\n try {\n options.body = serializeFetchParameter(loadedBody, 'Payload');\n } catch (parseError) {\n return fromError(parseError);\n }\n\n var controller;\n\n if (!options.signal) {\n var _a = createSignalIfSupported(),\n _controller = _a.controller,\n signal = _a.signal;\n\n controller = _controller;\n if (controller) options.signal = signal;\n }\n\n return new Observable(function (observer) {\n // the raw response is attached to the context in the BatchingLink\n fetcher(chosenURI, options).then(parseAndCheckHttpResponse(operations)).then(function (result) {\n // we have data and can send it to back up the link chain\n observer.next(result);\n observer.complete();\n return result;\n }).catch(function (err) {\n // fetch was cancelled so its already been cleaned up in the unsubscribe\n if (err.name === 'AbortError') return; // if it is a network error, BUT there is graphql result info\n // fire the next observer before calling error\n // this gives apollo-client (and react-apollo) the `graphqlErrors` and `networErrors`\n // to pass to UI\n // this should only happen if we *also* have data as part of the response key per\n // the spec\n\n if (err.result && err.result.errors && err.result.data) {\n // if we dont' call next, the UI can only show networkError because AC didn't\n // get andy graphqlErrors\n // this is graphql execution result info (i.e errors and possibly data)\n // this is because there is no formal spec how errors should translate to\n // http status codes. So an auth error (401) could have both data\n // from a public field, errors from a private field, and a status of 401\n // {\n // user { // this will have errors\n // firstName\n // }\n // products { // this is public so will have data\n // cost\n // }\n // }\n //\n // the result of above *could* look like this:\n // {\n // data: { products: [{ cost: \"$10\" }] },\n // errors: [{\n // message: 'your session has timed out',\n // path: []\n // }]\n // }\n // status code of above would be a 401\n // in the UI you want to show data where you can, errors as data where you can\n // and use correct http status codes\n observer.next(err.result);\n }\n\n observer.error(err);\n });\n return function () {\n // XXX support canceling this request\n // https://developers.google.com/web/updates/2017/09/abortable-fetch\n if (controller) controller.abort();\n };\n });\n };\n\n batchKey = batchKey || function (operation) {\n var context = operation.getContext();\n var contextConfig = {\n http: context.http,\n options: context.fetchOptions,\n credentials: context.credentials,\n headers: context.headers\n }; //may throw error if config not serializable\n\n return selectURI(operation, uri) + JSON.stringify(contextConfig);\n };\n\n _this.batcher = new BatchLink({\n batchInterval: _this.batchInterval,\n batchMax: _this.batchMax,\n batchKey: batchKey,\n batchHandler: batchHandler\n });\n return _this;\n }\n\n BatchHttpLink.prototype.request = function (operation) {\n return this.batcher.request(operation);\n };\n\n return BatchHttpLink;\n}(ApolloLink);\n\nexport { BatchHttpLink };","var __assign = this && this.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n\n return t;\n };\n\n return __assign.apply(this, arguments);\n};\n\nexport function getFragmentQueryDocument(document, fragmentName) {\n var actualFragmentName = fragmentName;\n var fragments = [];\n document.definitions.forEach(function (definition) {\n if (definition.kind === 'OperationDefinition') {\n throw new Error(\"Found a \" + definition.operation + \" operation\" + (definition.name ? \" named '\" + definition.name.value + \"'\" : '') + \". \" + 'No operations are allowed when using a fragment as a query. Only fragments are allowed.');\n }\n\n if (definition.kind === 'FragmentDefinition') {\n fragments.push(definition);\n }\n });\n\n if (typeof actualFragmentName === 'undefined') {\n if (fragments.length !== 1) {\n throw new Error(\"Found \" + fragments.length + \" fragments. `fragmentName` must be provided when there is not exactly 1 fragment.\");\n }\n\n actualFragmentName = fragments[0].name.value;\n }\n\n var query = __assign({}, document, {\n definitions: [{\n kind: 'OperationDefinition',\n operation: 'query',\n selectionSet: {\n kind: 'SelectionSet',\n selections: [{\n kind: 'FragmentSpread',\n name: {\n kind: 'Name',\n value: actualFragmentName\n }\n }]\n }\n }].concat(document.definitions)\n });\n\n return query;\n}","export function queryFromPojo(obj) {\n var op = {\n kind: 'OperationDefinition',\n operation: 'query',\n name: {\n kind: 'Name',\n value: 'GeneratedClientQuery'\n },\n selectionSet: selectionSetFromObj(obj)\n };\n var out = {\n kind: 'Document',\n definitions: [op]\n };\n return out;\n}\nexport function fragmentFromPojo(obj, typename) {\n var frag = {\n kind: 'FragmentDefinition',\n typeCondition: {\n kind: 'NamedType',\n name: {\n kind: 'Name',\n value: typename || '__FakeType'\n }\n },\n name: {\n kind: 'Name',\n value: 'GeneratedClientQuery'\n },\n selectionSet: selectionSetFromObj(obj)\n };\n var out = {\n kind: 'Document',\n definitions: [frag]\n };\n return out;\n}\n\nfunction selectionSetFromObj(obj) {\n if (typeof obj === 'number' || typeof obj === 'boolean' || typeof obj === 'string' || typeof obj === 'undefined' || obj === null) {\n return null;\n }\n\n if (Array.isArray(obj)) {\n return selectionSetFromObj(obj[0]);\n }\n\n var selections = [];\n Object.keys(obj).forEach(function (key) {\n var field = {\n kind: 'Field',\n name: {\n kind: 'Name',\n value: key\n }\n };\n var nestedSelSet = selectionSetFromObj(obj[key]);\n\n if (nestedSelSet) {\n field.selectionSet = nestedSelSet;\n }\n\n selections.push(field);\n });\n var selectionSet = {\n kind: 'SelectionSet',\n selections: selections\n };\n return selectionSet;\n}\n\nexport var justTypenameQuery = {\n kind: 'Document',\n definitions: [{\n kind: 'OperationDefinition',\n operation: 'query',\n name: null,\n variableDefinitions: null,\n directives: [],\n selectionSet: {\n kind: 'SelectionSet',\n selections: [{\n kind: 'Field',\n alias: null,\n name: {\n kind: 'Name',\n value: '__typename'\n },\n arguments: [],\n directives: [],\n selectionSet: null\n }]\n }\n }]\n};","import { getFragmentQueryDocument } from 'apollo-utilities';\nimport { justTypenameQuery, queryFromPojo, fragmentFromPojo } from './utils';\n\nvar ApolloCache = function () {\n function ApolloCache() {}\n\n ApolloCache.prototype.transformDocument = function (document) {\n return document;\n };\n\n ApolloCache.prototype.transformForLink = function (document) {\n return document;\n };\n\n ApolloCache.prototype.readQuery = function (options, optimistic) {\n if (optimistic === void 0) {\n optimistic = false;\n }\n\n return this.read({\n query: options.query,\n variables: options.variables,\n optimistic: optimistic\n });\n };\n\n ApolloCache.prototype.readFragment = function (options, optimistic) {\n if (optimistic === void 0) {\n optimistic = false;\n }\n\n return this.read({\n query: getFragmentQueryDocument(options.fragment, options.fragmentName),\n variables: options.variables,\n rootId: options.id,\n optimistic: optimistic\n });\n };\n\n ApolloCache.prototype.writeQuery = function (options) {\n this.write({\n dataId: 'ROOT_QUERY',\n result: options.data,\n query: options.query,\n variables: options.variables\n });\n };\n\n ApolloCache.prototype.writeFragment = function (options) {\n this.write({\n dataId: options.id,\n result: options.data,\n variables: options.variables,\n query: getFragmentQueryDocument(options.fragment, options.fragmentName)\n });\n };\n\n ApolloCache.prototype.writeData = function (_a) {\n var id = _a.id,\n data = _a.data;\n\n if (typeof id !== 'undefined') {\n var typenameResult = null;\n\n try {\n typenameResult = this.read({\n rootId: id,\n optimistic: false,\n query: justTypenameQuery\n });\n } catch (e) {}\n\n var __typename = typenameResult && typenameResult.__typename || '__ClientData';\n\n var dataToWrite = Object.assign({\n __typename: __typename\n }, data);\n this.writeFragment({\n id: id,\n fragment: fragmentFromPojo(dataToWrite, __typename),\n data: dataToWrite\n });\n } else {\n this.writeQuery({\n query: queryFromPojo(data),\n data: data\n });\n }\n };\n\n return ApolloCache;\n}();\n\nexport { ApolloCache };","import { isProduction, isTest } from './environment';\nvar haveWarned = Object.create({});\nexport function warnOnceInDevelopment(msg, type) {\n if (type === void 0) {\n type = 'warn';\n }\n\n if (isProduction()) {\n return;\n }\n\n if (!haveWarned[msg]) {\n if (!isTest()) {\n haveWarned[msg] = true;\n }\n\n switch (type) {\n case 'error':\n console.error(msg);\n break;\n\n default:\n console.warn(msg);\n }\n }\n}","import { isTest, warnOnceInDevelopment } from 'apollo-utilities';\nvar haveWarned = false;\n\nvar HeuristicFragmentMatcher = function () {\n function HeuristicFragmentMatcher() {}\n\n HeuristicFragmentMatcher.prototype.ensureReady = function () {\n return Promise.resolve();\n };\n\n HeuristicFragmentMatcher.prototype.canBypassInit = function () {\n return true;\n };\n\n HeuristicFragmentMatcher.prototype.match = function (idValue, typeCondition, context) {\n var obj = context.store.get(idValue.id);\n\n if (!obj && idValue.id === 'ROOT_QUERY') {\n return true;\n }\n\n if (!obj) {\n return false;\n }\n\n if (!obj.__typename) {\n if (!haveWarned) {\n console.warn(\"You're using fragments in your queries, but either don't have the addTypename:\\n true option set in Apollo Client, or you are trying to write a fragment to the store without the __typename.\\n Please turn on the addTypename option and include __typename when writing fragments so that Apollo Client\\n can accurately match fragments.\");\n console.warn('Could not find __typename on Fragment ', typeCondition, obj);\n console.warn(\"DEPRECATION WARNING: using fragments without __typename is unsupported behavior \" + \"and will be removed in future versions of Apollo client. You should fix this and set addTypename to true now.\");\n\n if (!isTest()) {\n haveWarned = true;\n }\n }\n\n context.returnPartialData = true;\n return true;\n }\n\n if (obj.__typename === typeCondition) {\n return true;\n }\n\n warnOnceInDevelopment('You are using the simple (heuristic) fragment matcher, but your ' + 'queries contain union or interface types. Apollo Client will not be ' + 'able to accurately map fragments. To make this error go away, use ' + 'the `IntrospectionFragmentMatcher` as described in the docs: ' + 'https://www.apollographql.com/docs/react/recipes/fragment-matching.html', 'error');\n context.returnPartialData = true;\n return true;\n };\n\n return HeuristicFragmentMatcher;\n}();\n\nexport { HeuristicFragmentMatcher };\n\nvar IntrospectionFragmentMatcher = function () {\n function IntrospectionFragmentMatcher(options) {\n if (options && options.introspectionQueryResultData) {\n this.possibleTypesMap = this.parseIntrospectionResult(options.introspectionQueryResultData);\n this.isReady = true;\n } else {\n this.isReady = false;\n }\n\n this.match = this.match.bind(this);\n }\n\n IntrospectionFragmentMatcher.prototype.match = function (idValue, typeCondition, context) {\n if (!this.isReady) {\n throw new Error('FragmentMatcher.match() was called before FragmentMatcher.init()');\n }\n\n var obj = context.store.get(idValue.id);\n\n if (!obj) {\n return false;\n }\n\n if (!obj.__typename) {\n throw new Error(\"Cannot match fragment because __typename property is missing: \" + JSON.stringify(obj));\n }\n\n if (obj.__typename === typeCondition) {\n return true;\n }\n\n var implementingTypes = this.possibleTypesMap[typeCondition];\n\n if (implementingTypes && implementingTypes.indexOf(obj.__typename) > -1) {\n return true;\n }\n\n return false;\n };\n\n IntrospectionFragmentMatcher.prototype.parseIntrospectionResult = function (introspectionResultData) {\n var typeMap = {};\n\n introspectionResultData.__schema.types.forEach(function (type) {\n if (type.kind === 'UNION' || type.kind === 'INTERFACE') {\n typeMap[type.name] = type.possibleTypes.map(function (implementingType) {\n return implementingType.name;\n });\n }\n });\n\n return typeMap;\n };\n\n return IntrospectionFragmentMatcher;\n}();\n\nexport { IntrospectionFragmentMatcher };","var ObjectCache = function () {\n function ObjectCache(data) {\n if (data === void 0) {\n data = Object.create(null);\n }\n\n this.data = data;\n }\n\n ObjectCache.prototype.toObject = function () {\n return this.data;\n };\n\n ObjectCache.prototype.get = function (dataId) {\n return this.data[dataId];\n };\n\n ObjectCache.prototype.set = function (dataId, value) {\n this.data[dataId] = value;\n };\n\n ObjectCache.prototype.delete = function (dataId) {\n this.data[dataId] = undefined;\n };\n\n ObjectCache.prototype.clear = function () {\n this.data = Object.create(null);\n };\n\n ObjectCache.prototype.replace = function (newData) {\n this.data = newData || Object.create(null);\n };\n\n return ObjectCache;\n}();\n\nexport { ObjectCache };\nexport function defaultNormalizedCacheFactory(seed) {\n return new ObjectCache(seed);\n}","var __extends = this && this.__extends || function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n };\n\n return extendStatics(d, b);\n };\n\n return function (d, b) {\n extendStatics(d, b);\n\n function __() {\n this.constructor = d;\n }\n\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\n\nvar __assign = this && this.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n\n return t;\n };\n\n return __assign.apply(this, arguments);\n};\n\nimport { print } from 'graphql/language/printer';\nimport { assign, createFragmentMap, getDefaultValues, getFragmentDefinitions, getOperationDefinition, isField, isIdValue, isInlineFragment, isProduction, resultKeyNameFromField, shouldInclude, storeKeyNameFromField, getQueryDefinition, toIdValue } from 'apollo-utilities';\nimport { defaultNormalizedCacheFactory, ObjectCache } from './objectCache';\n\nvar WriteError = function (_super) {\n __extends(WriteError, _super);\n\n function WriteError() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = 'WriteError';\n return _this;\n }\n\n return WriteError;\n}(Error);\n\nexport { WriteError };\nexport function enhanceErrorWithDocument(error, document) {\n var enhancedError = new WriteError(\"Error writing result to store for query:\\n \" + print(document));\n enhancedError.message += '\\n' + error.message;\n enhancedError.stack = error.stack;\n return enhancedError;\n}\nexport function writeQueryToStore(_a) {\n var result = _a.result,\n query = _a.query,\n _b = _a.storeFactory,\n storeFactory = _b === void 0 ? defaultNormalizedCacheFactory : _b,\n _c = _a.store,\n store = _c === void 0 ? storeFactory() : _c,\n variables = _a.variables,\n dataIdFromObject = _a.dataIdFromObject,\n _d = _a.fragmentMap,\n fragmentMap = _d === void 0 ? {} : _d,\n fragmentMatcherFunction = _a.fragmentMatcherFunction;\n var queryDefinition = getQueryDefinition(query);\n variables = assign({}, getDefaultValues(queryDefinition), variables);\n\n try {\n return writeSelectionSetToStore({\n dataId: 'ROOT_QUERY',\n result: result,\n selectionSet: queryDefinition.selectionSet,\n context: {\n store: store,\n storeFactory: storeFactory,\n processedData: {},\n variables: variables,\n dataIdFromObject: dataIdFromObject,\n fragmentMap: fragmentMap,\n fragmentMatcherFunction: fragmentMatcherFunction\n }\n });\n } catch (e) {\n throw enhanceErrorWithDocument(e, query);\n }\n}\nexport function writeResultToStore(_a) {\n var dataId = _a.dataId,\n result = _a.result,\n document = _a.document,\n _b = _a.storeFactory,\n storeFactory = _b === void 0 ? defaultNormalizedCacheFactory : _b,\n _c = _a.store,\n store = _c === void 0 ? storeFactory() : _c,\n variables = _a.variables,\n dataIdFromObject = _a.dataIdFromObject,\n fragmentMatcherFunction = _a.fragmentMatcherFunction;\n var operationDefinition = getOperationDefinition(document);\n var selectionSet = operationDefinition.selectionSet;\n var fragmentMap = createFragmentMap(getFragmentDefinitions(document));\n variables = assign({}, getDefaultValues(operationDefinition), variables);\n\n try {\n return writeSelectionSetToStore({\n result: result,\n dataId: dataId,\n selectionSet: selectionSet,\n context: {\n store: store,\n storeFactory: storeFactory,\n processedData: {},\n variables: variables,\n dataIdFromObject: dataIdFromObject,\n fragmentMap: fragmentMap,\n fragmentMatcherFunction: fragmentMatcherFunction\n }\n });\n } catch (e) {\n throw enhanceErrorWithDocument(e, document);\n }\n}\nexport function writeSelectionSetToStore(_a) {\n var result = _a.result,\n dataId = _a.dataId,\n selectionSet = _a.selectionSet,\n context = _a.context;\n var variables = context.variables,\n store = context.store,\n fragmentMap = context.fragmentMap;\n selectionSet.selections.forEach(function (selection) {\n var included = shouldInclude(selection, variables);\n\n if (isField(selection)) {\n var resultFieldKey = resultKeyNameFromField(selection);\n var value = result[resultFieldKey];\n\n if (included) {\n if (typeof value !== 'undefined') {\n writeFieldToStore({\n dataId: dataId,\n value: value,\n field: selection,\n context: context\n });\n } else {\n var isDefered = selection.directives && selection.directives.length && selection.directives.some(function (directive) {\n return directive.name && directive.name.value === 'defer';\n });\n\n if (!isDefered && context.fragmentMatcherFunction) {\n if (!isProduction()) {\n console.warn(\"Missing field \" + resultFieldKey + \" in \" + JSON.stringify(result, null, 2).substring(0, 100));\n }\n }\n }\n }\n } else {\n var fragment = void 0;\n\n if (isInlineFragment(selection)) {\n fragment = selection;\n } else {\n fragment = (fragmentMap || {})[selection.name.value];\n\n if (!fragment) {\n throw new Error(\"No fragment named \" + selection.name.value + \".\");\n }\n }\n\n var matches = true;\n\n if (context.fragmentMatcherFunction && fragment.typeCondition) {\n var idValue = toIdValue({\n id: 'self',\n typename: undefined\n });\n var fakeContext = {\n store: new ObjectCache({\n self: result\n }),\n returnPartialData: false,\n hasMissingField: false,\n cacheRedirects: {}\n };\n matches = context.fragmentMatcherFunction(idValue, fragment.typeCondition.name.value, fakeContext);\n\n if (!isProduction() && fakeContext.returnPartialData) {\n console.error('WARNING: heuristic fragment matching going on!');\n }\n }\n\n if (included && matches) {\n writeSelectionSetToStore({\n result: result,\n selectionSet: fragment.selectionSet,\n dataId: dataId,\n context: context\n });\n }\n }\n });\n return store;\n}\n\nfunction isGeneratedId(id) {\n return id[0] === '$';\n}\n\nfunction mergeWithGenerated(generatedKey, realKey, cache) {\n var generated = cache.get(generatedKey);\n var real = cache.get(realKey);\n Object.keys(generated).forEach(function (key) {\n var value = generated[key];\n var realValue = real[key];\n\n if (isIdValue(value) && isGeneratedId(value.id) && isIdValue(realValue)) {\n mergeWithGenerated(value.id, realValue.id, cache);\n }\n\n cache.delete(generatedKey);\n cache.set(realKey, __assign({}, generated, real));\n });\n}\n\nfunction isDataProcessed(dataId, field, processedData) {\n if (!processedData) {\n return false;\n }\n\n if (processedData[dataId]) {\n if (processedData[dataId].indexOf(field) >= 0) {\n return true;\n } else {\n processedData[dataId].push(field);\n }\n } else {\n processedData[dataId] = [field];\n }\n\n return false;\n}\n\nfunction writeFieldToStore(_a) {\n var field = _a.field,\n value = _a.value,\n dataId = _a.dataId,\n context = _a.context;\n\n var _b;\n\n var variables = context.variables,\n dataIdFromObject = context.dataIdFromObject,\n store = context.store;\n var storeValue;\n var storeObject;\n var storeFieldName = storeKeyNameFromField(field, variables);\n var shouldMerge = false;\n var generatedKey = '';\n\n if (!field.selectionSet || value === null) {\n storeValue = value != null && typeof value === 'object' ? {\n type: 'json',\n json: value\n } : value;\n } else if (Array.isArray(value)) {\n var generatedId = dataId + \".\" + storeFieldName;\n storeValue = processArrayValue(value, generatedId, field.selectionSet, context);\n } else {\n var valueDataId = dataId + \".\" + storeFieldName;\n var generated = true;\n\n if (!isGeneratedId(valueDataId)) {\n valueDataId = '$' + valueDataId;\n }\n\n if (dataIdFromObject) {\n var semanticId = dataIdFromObject(value);\n\n if (semanticId && isGeneratedId(semanticId)) {\n throw new Error('IDs returned by dataIdFromObject cannot begin with the \"$\" character.');\n }\n\n if (semanticId || typeof semanticId === 'number' && semanticId === 0) {\n valueDataId = semanticId;\n generated = false;\n }\n }\n\n if (!isDataProcessed(valueDataId, field, context.processedData)) {\n writeSelectionSetToStore({\n dataId: valueDataId,\n result: value,\n selectionSet: field.selectionSet,\n context: context\n });\n }\n\n var typename = value.__typename;\n storeValue = toIdValue({\n id: valueDataId,\n typename: typename\n }, generated);\n storeObject = store.get(dataId);\n var escapedId = storeObject && storeObject[storeFieldName];\n\n if (escapedId !== storeValue && isIdValue(escapedId)) {\n var hadTypename = escapedId.typename !== undefined;\n var hasTypename = typename !== undefined;\n var typenameChanged = hadTypename && hasTypename && escapedId.typename !== typename;\n\n if (generated && !escapedId.generated && !typenameChanged) {\n throw new Error(\"Store error: the application attempted to write an object with no provided id\" + (\" but the store already contains an id of \" + escapedId.id + \" for this object. The selectionSet\") + \" that was trying to be written is:\\n\" + print(field));\n }\n\n if (hadTypename && !hasTypename) {\n throw new Error(\"Store error: the application attempted to write an object with no provided typename\" + (\" but the store already contains an object with typename of \" + escapedId.typename + \" for the object of id \" + escapedId.id + \". The selectionSet\") + \" that was trying to be written is:\\n\" + print(field));\n }\n\n if (escapedId.generated) {\n generatedKey = escapedId.id;\n\n if (typenameChanged) {\n if (!generated) {\n store.delete(generatedKey);\n }\n } else {\n shouldMerge = true;\n }\n }\n }\n }\n\n var newStoreObj = __assign({}, store.get(dataId), (_b = {}, _b[storeFieldName] = storeValue, _b));\n\n if (shouldMerge) {\n mergeWithGenerated(generatedKey, storeValue.id, store);\n }\n\n storeObject = store.get(dataId);\n\n if (!storeObject || storeValue !== storeObject[storeFieldName]) {\n store.set(dataId, newStoreObj);\n }\n}\n\nfunction processArrayValue(value, generatedId, selectionSet, context) {\n return value.map(function (item, index) {\n if (item === null) {\n return null;\n }\n\n var itemDataId = generatedId + \".\" + index;\n\n if (Array.isArray(item)) {\n return processArrayValue(item, itemDataId, selectionSet, context);\n }\n\n var generated = true;\n\n if (context.dataIdFromObject) {\n var semanticId = context.dataIdFromObject(item);\n\n if (semanticId) {\n itemDataId = semanticId;\n generated = false;\n }\n }\n\n if (!isDataProcessed(itemDataId, selectionSet, context.processedData)) {\n writeSelectionSetToStore({\n dataId: itemDataId,\n result: item,\n selectionSet: selectionSet,\n context: context\n });\n }\n\n return toIdValue({\n id: itemDataId,\n typename: item.__typename\n }, generated);\n });\n}","import { getMainDefinition, getFragmentDefinitions, createFragmentMap, shouldInclude, getDirectiveInfoFromField, isField, isInlineFragment, resultKeyNameFromField, argumentsObjectFromField } from 'apollo-utilities';\nexport function graphql(resolver, document, rootValue, contextValue, variableValues, execOptions) {\n if (execOptions === void 0) {\n execOptions = {};\n }\n\n var mainDefinition = getMainDefinition(document);\n var fragments = getFragmentDefinitions(document);\n var fragmentMap = createFragmentMap(fragments);\n var resultMapper = execOptions.resultMapper;\n\n var fragmentMatcher = execOptions.fragmentMatcher || function () {\n return true;\n };\n\n var execContext = {\n fragmentMap: fragmentMap,\n contextValue: contextValue,\n variableValues: variableValues,\n resultMapper: resultMapper,\n resolver: resolver,\n fragmentMatcher: fragmentMatcher\n };\n return executeSelectionSet(mainDefinition.selectionSet, rootValue, execContext);\n}\n\nfunction executeSelectionSet(selectionSet, rootValue, execContext) {\n var fragmentMap = execContext.fragmentMap,\n contextValue = execContext.contextValue,\n variables = execContext.variableValues;\n var result = {};\n selectionSet.selections.forEach(function (selection) {\n if (!shouldInclude(selection, variables)) {\n return;\n }\n\n if (isField(selection)) {\n var fieldResult = executeField(selection, rootValue, execContext);\n var resultFieldKey = resultKeyNameFromField(selection);\n\n if (fieldResult !== undefined) {\n if (result[resultFieldKey] === undefined) {\n result[resultFieldKey] = fieldResult;\n } else {\n merge(result[resultFieldKey], fieldResult);\n }\n }\n } else {\n var fragment = void 0;\n\n if (isInlineFragment(selection)) {\n fragment = selection;\n } else {\n fragment = fragmentMap[selection.name.value];\n\n if (!fragment) {\n throw new Error(\"No fragment named \" + selection.name.value);\n }\n }\n\n var typeCondition = fragment.typeCondition.name.value;\n\n if (execContext.fragmentMatcher(rootValue, typeCondition, contextValue)) {\n var fragmentResult = executeSelectionSet(fragment.selectionSet, rootValue, execContext);\n merge(result, fragmentResult);\n }\n }\n });\n\n if (execContext.resultMapper) {\n return execContext.resultMapper(result, rootValue);\n }\n\n return result;\n}\n\nfunction executeField(field, rootValue, execContext) {\n var variables = execContext.variableValues,\n contextValue = execContext.contextValue,\n resolver = execContext.resolver;\n var fieldName = field.name.value;\n var args = argumentsObjectFromField(field, variables);\n var info = {\n isLeaf: !field.selectionSet,\n resultKey: resultKeyNameFromField(field),\n directives: getDirectiveInfoFromField(field, variables)\n };\n var result = resolver(fieldName, rootValue, args, contextValue, info);\n\n if (!field.selectionSet) {\n return result;\n }\n\n if (result == null) {\n return result;\n }\n\n if (Array.isArray(result)) {\n return executeSubSelectedArray(field, result, execContext);\n }\n\n return executeSelectionSet(field.selectionSet, result, execContext);\n}\n\nfunction executeSubSelectedArray(field, result, execContext) {\n return result.map(function (item) {\n if (item === null) {\n return null;\n }\n\n if (Array.isArray(item)) {\n return executeSubSelectedArray(field, item, execContext);\n }\n\n return executeSelectionSet(field.selectionSet, item, execContext);\n });\n}\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nexport function merge(dest, src) {\n if (src !== null && typeof src === 'object') {\n Object.keys(src).forEach(function (key) {\n var srcVal = src[key];\n\n if (!hasOwn.call(dest, key)) {\n dest[key] = srcVal;\n } else {\n merge(dest[key], srcVal);\n }\n });\n }\n}","export { filter, check, propType } from './utilities';\nimport { graphql } from './graphql';\nexport default graphql;","var __assign = this && this.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n\n return t;\n };\n\n return __assign.apply(this, arguments);\n};\n\nimport graphqlAnywhere from 'graphql-anywhere';\nimport { assign, isEqual, getDefaultValues, getQueryDefinition, isJsonValue, isIdValue, toIdValue, getStoreKeyName } from 'apollo-utilities';\nexport var ID_KEY = typeof Symbol !== 'undefined' ? Symbol('id') : '@@id';\nexport function readQueryFromStore(options) {\n var optsPatch = {\n returnPartialData: false\n };\n return diffQueryAgainstStore(__assign({}, options, optsPatch)).result;\n}\n\nvar readStoreResolver = function (fieldName, idValue, args, context, _a) {\n var resultKey = _a.resultKey,\n directives = _a.directives;\n assertIdValue(idValue);\n var objId = idValue.id;\n var obj = context.store.get(objId);\n var storeKeyName = fieldName;\n\n if (args || directives) {\n storeKeyName = getStoreKeyName(storeKeyName, args, directives);\n }\n\n var fieldValue = void 0;\n\n if (obj) {\n fieldValue = obj[storeKeyName];\n\n if (typeof fieldValue === 'undefined' && context.cacheRedirects && (obj.__typename || objId === 'ROOT_QUERY')) {\n var typename = obj.__typename || 'Query';\n var type = context.cacheRedirects[typename];\n\n if (type) {\n var resolver = type[fieldName];\n\n if (resolver) {\n fieldValue = resolver(obj, args, {\n getCacheKey: function (storeObj) {\n return toIdValue({\n id: context.dataIdFromObject(storeObj),\n typename: storeObj.__typename\n });\n }\n });\n }\n }\n }\n }\n\n if (typeof fieldValue === 'undefined') {\n if (!context.returnPartialData) {\n throw new Error(\"Can't find field \" + storeKeyName + \" on object (\" + objId + \") \" + JSON.stringify(obj, null, 2) + \".\");\n }\n\n context.hasMissingField = true;\n return fieldValue;\n }\n\n if (isJsonValue(fieldValue)) {\n if (idValue.previousResult && isEqual(idValue.previousResult[resultKey], fieldValue.json)) {\n return idValue.previousResult[resultKey];\n }\n\n return fieldValue.json;\n }\n\n if (idValue.previousResult) {\n fieldValue = addPreviousResultToIdValues(fieldValue, idValue.previousResult[resultKey]);\n }\n\n return fieldValue;\n};\n\nexport function diffQueryAgainstStore(_a) {\n var store = _a.store,\n query = _a.query,\n variables = _a.variables,\n previousResult = _a.previousResult,\n _b = _a.returnPartialData,\n returnPartialData = _b === void 0 ? true : _b,\n _c = _a.rootId,\n rootId = _c === void 0 ? 'ROOT_QUERY' : _c,\n fragmentMatcherFunction = _a.fragmentMatcherFunction,\n config = _a.config;\n var queryDefinition = getQueryDefinition(query);\n variables = assign({}, getDefaultValues(queryDefinition), variables);\n var context = {\n store: store,\n returnPartialData: returnPartialData,\n dataIdFromObject: config && config.dataIdFromObject || null,\n cacheRedirects: config && config.cacheRedirects || {},\n hasMissingField: false\n };\n var rootIdValue = {\n type: 'id',\n id: rootId,\n previousResult: previousResult\n };\n var result = graphqlAnywhere(readStoreResolver, query, rootIdValue, context, variables, {\n fragmentMatcher: fragmentMatcherFunction,\n resultMapper: resultMapper\n });\n return {\n result: result,\n complete: !context.hasMissingField\n };\n}\nexport function assertIdValue(idValue) {\n if (!isIdValue(idValue)) {\n throw new Error(\"Encountered a sub-selection on the query, but the store doesn't have an object reference. This should never happen during normal use unless you have custom code that is directly manipulating the store; please file an issue.\");\n }\n}\n\nfunction addPreviousResultToIdValues(value, previousResult) {\n if (isIdValue(value)) {\n return __assign({}, value, {\n previousResult: previousResult\n });\n } else if (Array.isArray(value)) {\n var idToPreviousResult_1 = new Map();\n\n if (Array.isArray(previousResult)) {\n previousResult.forEach(function (item) {\n if (item && item[ID_KEY]) {\n idToPreviousResult_1.set(item[ID_KEY], item);\n }\n });\n }\n\n return value.map(function (item, i) {\n var itemPreviousResult = previousResult && previousResult[i];\n\n if (isIdValue(item)) {\n itemPreviousResult = idToPreviousResult_1.get(item.id) || itemPreviousResult;\n }\n\n return addPreviousResultToIdValues(item, itemPreviousResult);\n });\n }\n\n return value;\n}\n\nfunction resultMapper(resultFields, idValue) {\n if (idValue.previousResult) {\n var currentResultKeys_1 = Object.keys(resultFields);\n var sameAsPreviousResult = Object.keys(idValue.previousResult).every(function (key) {\n return currentResultKeys_1.indexOf(key) > -1;\n }) && currentResultKeys_1.every(function (key) {\n return areNestedArrayItemsStrictlyEqual(resultFields[key], idValue.previousResult[key]);\n });\n\n if (sameAsPreviousResult) {\n return idValue.previousResult;\n }\n }\n\n Object.defineProperty(resultFields, ID_KEY, {\n enumerable: false,\n configurable: true,\n writable: false,\n value: idValue.id\n });\n return resultFields;\n}\n\nfunction areNestedArrayItemsStrictlyEqual(a, b) {\n if (a === b) {\n return true;\n }\n\n if (!Array.isArray(a) || !Array.isArray(b) || a.length !== b.length) {\n return false;\n }\n\n return a.every(function (item, i) {\n return areNestedArrayItemsStrictlyEqual(item, b[i]);\n });\n}","var __assign = this && this.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n\n return t;\n };\n\n return __assign.apply(this, arguments);\n};\n\nvar RecordingCache = function () {\n function RecordingCache(data) {\n if (data === void 0) {\n data = {};\n }\n\n this.data = data;\n this.recordedData = {};\n }\n\n RecordingCache.prototype.record = function (transaction) {\n transaction(this);\n var recordedData = this.recordedData;\n this.recordedData = {};\n return recordedData;\n };\n\n RecordingCache.prototype.toObject = function () {\n return __assign({}, this.data, this.recordedData);\n };\n\n RecordingCache.prototype.get = function (dataId) {\n if (this.recordedData.hasOwnProperty(dataId)) {\n return this.recordedData[dataId];\n }\n\n return this.data[dataId];\n };\n\n RecordingCache.prototype.set = function (dataId, value) {\n if (this.get(dataId) !== value) {\n this.recordedData[dataId] = value;\n }\n };\n\n RecordingCache.prototype.delete = function (dataId) {\n this.recordedData[dataId] = undefined;\n };\n\n RecordingCache.prototype.clear = function () {\n var _this = this;\n\n Object.keys(this.data).forEach(function (dataId) {\n return _this.delete(dataId);\n });\n this.recordedData = {};\n };\n\n RecordingCache.prototype.replace = function (newData) {\n this.clear();\n this.recordedData = __assign({}, newData);\n };\n\n return RecordingCache;\n}();\n\nexport { RecordingCache };\nexport function record(startingState, transaction) {\n var recordingCache = new RecordingCache(startingState);\n return recordingCache.record(transaction);\n}","var __extends = this && this.__extends || function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n };\n\n return extendStatics(d, b);\n };\n\n return function (d, b) {\n extendStatics(d, b);\n\n function __() {\n this.constructor = d;\n }\n\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\n\nvar __assign = this && this.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n\n return t;\n };\n\n return __assign.apply(this, arguments);\n};\n\nimport { ApolloCache } from 'apollo-cache';\nimport { getFragmentQueryDocument, addTypenameToDocument } from 'apollo-utilities';\nimport { HeuristicFragmentMatcher } from './fragmentMatcher';\nimport { writeResultToStore } from './writeToStore';\nimport { readQueryFromStore, diffQueryAgainstStore } from './readFromStore';\nimport { defaultNormalizedCacheFactory } from './objectCache';\nimport { record } from './recordingCache';\nvar defaultConfig = {\n fragmentMatcher: new HeuristicFragmentMatcher(),\n dataIdFromObject: defaultDataIdFromObject,\n addTypename: true,\n storeFactory: defaultNormalizedCacheFactory\n};\nexport function defaultDataIdFromObject(result) {\n if (result.__typename) {\n if (result.id !== undefined) {\n return result.__typename + \":\" + result.id;\n }\n\n if (result._id !== undefined) {\n return result.__typename + \":\" + result._id;\n }\n }\n\n return null;\n}\n\nvar InMemoryCache = function (_super) {\n __extends(InMemoryCache, _super);\n\n function InMemoryCache(config) {\n if (config === void 0) {\n config = {};\n }\n\n var _this = _super.call(this) || this;\n\n _this.optimistic = [];\n _this.watches = [];\n _this.typenameDocumentCache = new WeakMap();\n _this.silenceBroadcast = false;\n _this.config = __assign({}, defaultConfig, config);\n\n if (_this.config.customResolvers) {\n console.warn('customResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating customResolvers in the next major version.');\n _this.config.cacheRedirects = _this.config.customResolvers;\n }\n\n if (_this.config.cacheResolvers) {\n console.warn('cacheResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating cacheResolvers in the next major version.');\n _this.config.cacheRedirects = _this.config.cacheResolvers;\n }\n\n _this.addTypename = _this.config.addTypename;\n _this.data = _this.config.storeFactory();\n return _this;\n }\n\n InMemoryCache.prototype.restore = function (data) {\n if (data) this.data.replace(data);\n return this;\n };\n\n InMemoryCache.prototype.extract = function (optimistic) {\n if (optimistic === void 0) {\n optimistic = false;\n }\n\n if (optimistic && this.optimistic.length > 0) {\n var patches = this.optimistic.map(function (opt) {\n return opt.data;\n });\n return Object.assign.apply(Object, [{}, this.data.toObject()].concat(patches));\n }\n\n return this.data.toObject();\n };\n\n InMemoryCache.prototype.read = function (query) {\n if (query.rootId && this.data.get(query.rootId) === undefined) {\n return null;\n }\n\n return readQueryFromStore({\n store: this.config.storeFactory(this.extract(query.optimistic)),\n query: this.transformDocument(query.query),\n variables: query.variables,\n rootId: query.rootId,\n fragmentMatcherFunction: this.config.fragmentMatcher.match,\n previousResult: query.previousResult,\n config: this.config\n });\n };\n\n InMemoryCache.prototype.write = function (write) {\n writeResultToStore({\n dataId: write.dataId,\n result: write.result,\n variables: write.variables,\n document: this.transformDocument(write.query),\n store: this.data,\n dataIdFromObject: this.config.dataIdFromObject,\n fragmentMatcherFunction: this.config.fragmentMatcher.match\n });\n this.broadcastWatches();\n };\n\n InMemoryCache.prototype.diff = function (query) {\n return diffQueryAgainstStore({\n store: this.config.storeFactory(this.extract(query.optimistic)),\n query: this.transformDocument(query.query),\n variables: query.variables,\n returnPartialData: query.returnPartialData,\n previousResult: query.previousResult,\n fragmentMatcherFunction: this.config.fragmentMatcher.match,\n config: this.config\n });\n };\n\n InMemoryCache.prototype.watch = function (watch) {\n var _this = this;\n\n this.watches.push(watch);\n return function () {\n _this.watches = _this.watches.filter(function (c) {\n return c !== watch;\n });\n };\n };\n\n InMemoryCache.prototype.evict = function (query) {\n throw new Error(\"eviction is not implemented on InMemory Cache\");\n };\n\n InMemoryCache.prototype.reset = function () {\n this.data.clear();\n this.broadcastWatches();\n return Promise.resolve();\n };\n\n InMemoryCache.prototype.removeOptimistic = function (id) {\n var _this = this;\n\n var toPerform = this.optimistic.filter(function (item) {\n return item.id !== id;\n });\n this.optimistic = [];\n toPerform.forEach(function (change) {\n _this.recordOptimisticTransaction(change.transaction, change.id);\n });\n this.broadcastWatches();\n };\n\n InMemoryCache.prototype.performTransaction = function (transaction) {\n var alreadySilenced = this.silenceBroadcast;\n this.silenceBroadcast = true;\n transaction(this);\n\n if (!alreadySilenced) {\n this.silenceBroadcast = false;\n }\n\n this.broadcastWatches();\n };\n\n InMemoryCache.prototype.recordOptimisticTransaction = function (transaction, id) {\n var _this = this;\n\n this.silenceBroadcast = true;\n var patch = record(this.extract(true), function (recordingCache) {\n var dataCache = _this.data;\n _this.data = recordingCache;\n\n _this.performTransaction(transaction);\n\n _this.data = dataCache;\n });\n this.optimistic.push({\n id: id,\n transaction: transaction,\n data: patch\n });\n this.silenceBroadcast = false;\n this.broadcastWatches();\n };\n\n InMemoryCache.prototype.transformDocument = function (document) {\n if (this.addTypename) {\n var result = this.typenameDocumentCache.get(document);\n\n if (!result) {\n this.typenameDocumentCache.set(document, result = addTypenameToDocument(document));\n }\n\n return result;\n }\n\n return document;\n };\n\n InMemoryCache.prototype.readQuery = function (options, optimistic) {\n if (optimistic === void 0) {\n optimistic = false;\n }\n\n return this.read({\n query: options.query,\n variables: options.variables,\n optimistic: optimistic\n });\n };\n\n InMemoryCache.prototype.readFragment = function (options, optimistic) {\n if (optimistic === void 0) {\n optimistic = false;\n }\n\n return this.read({\n query: this.transformDocument(getFragmentQueryDocument(options.fragment, options.fragmentName)),\n variables: options.variables,\n rootId: options.id,\n optimistic: optimistic\n });\n };\n\n InMemoryCache.prototype.writeQuery = function (options) {\n this.write({\n dataId: 'ROOT_QUERY',\n result: options.data,\n query: this.transformDocument(options.query),\n variables: options.variables\n });\n };\n\n InMemoryCache.prototype.writeFragment = function (options) {\n this.write({\n dataId: options.id,\n result: options.data,\n query: this.transformDocument(getFragmentQueryDocument(options.fragment, options.fragmentName)),\n variables: options.variables\n });\n };\n\n InMemoryCache.prototype.broadcastWatches = function () {\n var _this = this;\n\n if (this.silenceBroadcast) return;\n this.watches.forEach(function (c) {\n var newData = _this.diff({\n query: c.query,\n variables: c.variables,\n previousResult: c.previousResult && c.previousResult(),\n optimistic: c.optimistic\n });\n\n c.callback(newData);\n });\n };\n\n return InMemoryCache;\n}(ApolloCache);\n\nexport { InMemoryCache };","import React from \"react\";\nimport { ApolloProvider } from \"react-apollo\";\nimport ApolloClient from \"apollo-client\";\nimport { BatchHttpLink } from \"apollo-link-batch-http\";\nimport { InMemoryCache } from \"apollo-cache-inmemory\";\n\nconst link = new BatchHttpLink({\n uri: \"/admin/graphql/admin\",\n batchMax: 25,\n batchInterval: 50,\n credentials: \"include\"\n});\nconst cache = new InMemoryCache();\n\nexport const client = new ApolloClient({ link, cache });\n\nexport const withProvider = WrappedComponent => {\n return class extends React.Component {\n render() {\n return (\n \n \n \n );\n }\n };\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nif (process.env.NODE_ENV !== 'production') {\n var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol.for && Symbol.for('react.element') || 0xeac7;\n\n var isValidElement = function (object) {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n }; // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n\n\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}","'use strict';\n\nfunction checkDCE() {\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\n if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function') {\n return;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n // This branch is unreachable because this function is only called\n // in production, but the condition is true only in development.\n // Therefore if the branch is still here, dead code elimination wasn't\n // properly applied.\n // Don't change the message. React DevTools relies on it. Also make sure\n // this message doesn't occur elsewhere in this function, or it will cause\n // a false positive.\n throw new Error('^_^');\n }\n\n try {\n // Verify that the code above has been dead code eliminated (DCE'd).\n __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);\n } catch (err) {\n // DevTools shouldn't crash React, no matter what.\n // We should still report in case we break this code.\n console.error(err);\n }\n}\n\nif (process.env.NODE_ENV === 'production') {\n // DCE check should happen before ReactDOM bundle executes so that\n // DevTools can report bad minification during injection.\n checkDCE();\n module.exports = require('./cjs/react-dom.production.min.js');\n} else {\n module.exports = require('./cjs/react-dom.development.js');\n}","var arrayMap = require('./_arrayMap'),\n baseIteratee = require('./_baseIteratee'),\n baseMap = require('./_baseMap'),\n isArray = require('./isArray');\n/**\n * Creates an array of values by running each element in `collection` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.\n *\n * The guarded methods are:\n * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,\n * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,\n * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,\n * `template`, `trim`, `trimEnd`, `trimStart`, and `words`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array|Function|Object|string} [iteratee=_.identity]\n * The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * _.map([4, 8], square);\n * // => [16, 64]\n *\n * _.map({ 'a': 4, 'b': 8 }, square);\n * // => [16, 64] (iteration order is not guaranteed)\n *\n * var users = [\n * { 'user': 'barney' },\n * { 'user': 'fred' }\n * ];\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, 'user');\n * // => ['barney', 'fred']\n */\n\n\nfunction map(collection, iteratee) {\n var func = isArray(collection) ? arrayMap : baseMap;\n return func(collection, baseIteratee(iteratee, 3));\n}\n\nmodule.exports = map;","import React from \"react\";\nimport Select from \"react-select\";\nimport Field from \"./Field\";\nimport { t } from \"../../utils/translations\";\n\nclass SelectField extends React.Component {\n render() {\n const { prepend, append, label, ...rest } = this.props;\n\n return (\n \n \n );\n }\n}\n\nexport default SelectField;\n","module.exports = process.env.NODE_ENV === 'production' ? require('./build/mocks') : require('./build');","// extracted by mini-css-extract-plugin\nmodule.exports = {\"toolbox\":\"TopbarTools-module__toolbox___znjgD\",\"tool\":\"TopbarTools-module__tool___3I9tT\",\"iconTool\":\"TopbarTools-module__iconTool___3VjCX\",\"iconButton\":\"TopbarTools-module__iconButton___3b2JJ\",\"iconIcon\":\"TopbarTools-module__iconIcon___23MeM\",\"iconButtonActive\":\"TopbarTools-module__iconButtonActive___2w5ay\",\"iconBadge\":\"TopbarTools-module__iconBadge___2_2XS\",\"overlay\":\"TopbarTools-module__overlay___3YDII\",\"overlayCase\":\"TopbarTools-module__overlayCase___6-Ts7\",\"searchTool\":\"TopbarTools-module__searchTool___1dha8\",\"searchContainer\":\"TopbarTools-module__searchContainer___1MfLF\",\"searchGroup\":\"TopbarTools-module__searchGroup___3gn63\",\"searchOptionLabel\":\"TopbarTools-module__searchOptionLabel___ujqPz\",\"searchOptionInfo\":\"TopbarTools-module__searchOptionInfo___1f7Xo\"};","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport inspect from '../jsutils/inspect';\nexport var QueryDocumentKeys = {\n Name: [],\n Document: ['definitions'],\n OperationDefinition: ['name', 'variableDefinitions', 'directives', 'selectionSet'],\n VariableDefinition: ['variable', 'type', 'defaultValue', 'directives'],\n Variable: ['name'],\n SelectionSet: ['selections'],\n Field: ['alias', 'name', 'arguments', 'directives', 'selectionSet'],\n Argument: ['name', 'value'],\n FragmentSpread: ['name', 'directives'],\n InlineFragment: ['typeCondition', 'directives', 'selectionSet'],\n FragmentDefinition: ['name', // Note: fragment variable definitions are experimental and may be changed\n // or removed in the future.\n 'variableDefinitions', 'typeCondition', 'directives', 'selectionSet'],\n IntValue: [],\n FloatValue: [],\n StringValue: [],\n BooleanValue: [],\n NullValue: [],\n EnumValue: [],\n ListValue: ['values'],\n ObjectValue: ['fields'],\n ObjectField: ['name', 'value'],\n Directive: ['name', 'arguments'],\n NamedType: ['name'],\n ListType: ['type'],\n NonNullType: ['type'],\n SchemaDefinition: ['directives', 'operationTypes'],\n OperationTypeDefinition: ['type'],\n ScalarTypeDefinition: ['description', 'name', 'directives'],\n ObjectTypeDefinition: ['description', 'name', 'interfaces', 'directives', 'fields'],\n FieldDefinition: ['description', 'name', 'arguments', 'type', 'directives'],\n InputValueDefinition: ['description', 'name', 'type', 'defaultValue', 'directives'],\n InterfaceTypeDefinition: ['description', 'name', 'directives', 'fields'],\n UnionTypeDefinition: ['description', 'name', 'directives', 'types'],\n EnumTypeDefinition: ['description', 'name', 'directives', 'values'],\n EnumValueDefinition: ['description', 'name', 'directives'],\n InputObjectTypeDefinition: ['description', 'name', 'directives', 'fields'],\n DirectiveDefinition: ['description', 'name', 'arguments', 'locations'],\n SchemaExtension: ['directives', 'operationTypes'],\n ScalarTypeExtension: ['name', 'directives'],\n ObjectTypeExtension: ['name', 'interfaces', 'directives', 'fields'],\n InterfaceTypeExtension: ['name', 'directives', 'fields'],\n UnionTypeExtension: ['name', 'directives', 'types'],\n EnumTypeExtension: ['name', 'directives', 'values'],\n InputObjectTypeExtension: ['name', 'directives', 'fields']\n};\nexport var BREAK = {};\n/**\n * visit() will walk through an AST using a depth first traversal, calling\n * the visitor's enter function at each node in the traversal, and calling the\n * leave function after visiting that node and all of its child nodes.\n *\n * By returning different values from the enter and leave functions, the\n * behavior of the visitor can be altered, including skipping over a sub-tree of\n * the AST (by returning false), editing the AST by returning a value or null\n * to remove the value, or to stop the whole traversal by returning BREAK.\n *\n * When using visit() to edit an AST, the original AST will not be modified, and\n * a new version of the AST with the changes applied will be returned from the\n * visit function.\n *\n * const editedAST = visit(ast, {\n * enter(node, key, parent, path, ancestors) {\n * // @return\n * // undefined: no action\n * // false: skip visiting this node\n * // visitor.BREAK: stop visiting altogether\n * // null: delete this node\n * // any value: replace this node with the returned value\n * },\n * leave(node, key, parent, path, ancestors) {\n * // @return\n * // undefined: no action\n * // false: no action\n * // visitor.BREAK: stop visiting altogether\n * // null: delete this node\n * // any value: replace this node with the returned value\n * }\n * });\n *\n * Alternatively to providing enter() and leave() functions, a visitor can\n * instead provide functions named the same as the kinds of AST nodes, or\n * enter/leave visitors at a named key, leading to four permutations of\n * visitor API:\n *\n * 1) Named visitors triggered when entering a node a specific kind.\n *\n * visit(ast, {\n * Kind(node) {\n * // enter the \"Kind\" node\n * }\n * })\n *\n * 2) Named visitors that trigger upon entering and leaving a node of\n * a specific kind.\n *\n * visit(ast, {\n * Kind: {\n * enter(node) {\n * // enter the \"Kind\" node\n * }\n * leave(node) {\n * // leave the \"Kind\" node\n * }\n * }\n * })\n *\n * 3) Generic visitors that trigger upon entering and leaving any node.\n *\n * visit(ast, {\n * enter(node) {\n * // enter any node\n * },\n * leave(node) {\n * // leave any node\n * }\n * })\n *\n * 4) Parallel visitors for entering and leaving nodes of a specific kind.\n *\n * visit(ast, {\n * enter: {\n * Kind(node) {\n * // enter the \"Kind\" node\n * }\n * },\n * leave: {\n * Kind(node) {\n * // leave the \"Kind\" node\n * }\n * }\n * })\n */\n\nexport function visit(root, visitor) {\n var visitorKeys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : QueryDocumentKeys;\n /* eslint-disable no-undef-init */\n\n var stack = undefined;\n var inArray = Array.isArray(root);\n var keys = [root];\n var index = -1;\n var edits = [];\n var node = undefined;\n var key = undefined;\n var parent = undefined;\n var path = [];\n var ancestors = [];\n var newRoot = root;\n /* eslint-enable no-undef-init */\n\n do {\n index++;\n var isLeaving = index === keys.length;\n var isEdited = isLeaving && edits.length !== 0;\n\n if (isLeaving) {\n key = ancestors.length === 0 ? undefined : path[path.length - 1];\n node = parent;\n parent = ancestors.pop();\n\n if (isEdited) {\n if (inArray) {\n node = node.slice();\n } else {\n var clone = {};\n\n for (var k in node) {\n if (node.hasOwnProperty(k)) {\n clone[k] = node[k];\n }\n }\n\n node = clone;\n }\n\n var editOffset = 0;\n\n for (var ii = 0; ii < edits.length; ii++) {\n var editKey = edits[ii][0];\n var editValue = edits[ii][1];\n\n if (inArray) {\n editKey -= editOffset;\n }\n\n if (inArray && editValue === null) {\n node.splice(editKey, 1);\n editOffset++;\n } else {\n node[editKey] = editValue;\n }\n }\n }\n\n index = stack.index;\n keys = stack.keys;\n edits = stack.edits;\n inArray = stack.inArray;\n stack = stack.prev;\n } else {\n key = parent ? inArray ? index : keys[index] : undefined;\n node = parent ? parent[key] : newRoot;\n\n if (node === null || node === undefined) {\n continue;\n }\n\n if (parent) {\n path.push(key);\n }\n }\n\n var result = void 0;\n\n if (!Array.isArray(node)) {\n if (!isNode(node)) {\n throw new Error('Invalid AST Node: ' + inspect(node));\n }\n\n var visitFn = getVisitFn(visitor, node.kind, isLeaving);\n\n if (visitFn) {\n result = visitFn.call(visitor, node, key, parent, path, ancestors);\n\n if (result === BREAK) {\n break;\n }\n\n if (result === false) {\n if (!isLeaving) {\n path.pop();\n continue;\n }\n } else if (result !== undefined) {\n edits.push([key, result]);\n\n if (!isLeaving) {\n if (isNode(result)) {\n node = result;\n } else {\n path.pop();\n continue;\n }\n }\n }\n }\n }\n\n if (result === undefined && isEdited) {\n edits.push([key, node]);\n }\n\n if (isLeaving) {\n path.pop();\n } else {\n stack = {\n inArray: inArray,\n index: index,\n keys: keys,\n edits: edits,\n prev: stack\n };\n inArray = Array.isArray(node);\n keys = inArray ? node : visitorKeys[node.kind] || [];\n index = -1;\n edits = [];\n\n if (parent) {\n ancestors.push(parent);\n }\n\n parent = node;\n }\n } while (stack !== undefined);\n\n if (edits.length !== 0) {\n newRoot = edits[edits.length - 1][1];\n }\n\n return newRoot;\n}\n\nfunction isNode(maybeNode) {\n return Boolean(maybeNode && typeof maybeNode.kind === 'string');\n}\n/**\n * Creates a new visitor instance which delegates to many visitors to run in\n * parallel. Each visitor will be visited for each node before moving on.\n *\n * If a prior visitor edits a node, no following visitors will see that node.\n */\n\n\nexport function visitInParallel(visitors) {\n var skipping = new Array(visitors.length);\n return {\n enter: function enter(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (!skipping[i]) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === false) {\n skipping[i] = node;\n } else if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined) {\n return result;\n }\n }\n }\n }\n },\n leave: function leave(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (!skipping[i]) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n true);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined && result !== false) {\n return result;\n }\n }\n } else if (skipping[i] === node) {\n skipping[i] = null;\n }\n }\n }\n };\n}\n/**\n * Creates a new visitor instance which maintains a provided TypeInfo instance\n * along with visiting visitor.\n */\n\nexport function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitor, arguments);\n\n if (result !== undefined) {\n typeInfo.leave(node);\n\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n true);\n var result;\n\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n\n typeInfo.leave(node);\n return result;\n }\n };\n}\n/**\n * Given a visitor instance, if it is leaving or not, and a node kind, return\n * the function the visitor runtime should call.\n */\n\nexport function getVisitFn(visitor, kind, isLeaving) {\n var kindVisitor = visitor[kind];\n\n if (kindVisitor) {\n if (!isLeaving && typeof kindVisitor === 'function') {\n // { Kind() {} }\n return kindVisitor;\n }\n\n var kindSpecificVisitor = isLeaving ? kindVisitor.leave : kindVisitor.enter;\n\n if (typeof kindSpecificVisitor === 'function') {\n // { Kind: { enter() {}, leave() {} } }\n return kindSpecificVisitor;\n }\n } else {\n var specificVisitor = isLeaving ? visitor.leave : visitor.enter;\n\n if (specificVisitor) {\n if (typeof specificVisitor === 'function') {\n // { enter() {}, leave() {} }\n return specificVisitor;\n }\n\n var specificKindVisitor = specificVisitor[kind];\n\n if (typeof specificKindVisitor === 'function') {\n // { enter: { Kind() {} }, leave: { Kind() {} } }\n return specificKindVisitor;\n }\n }\n }\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { visit } from './visitor';\n/**\n * Converts an AST into a string, using one set of reasonable\n * formatting rules.\n */\n\nexport function print(ast) {\n return visit(ast, {\n leave: printDocASTReducer\n });\n}\nvar printDocASTReducer = {\n Name: function Name(node) {\n return node.value;\n },\n Variable: function Variable(node) {\n return '$' + node.name;\n },\n // Document\n Document: function Document(node) {\n return join(node.definitions, '\\n\\n') + '\\n';\n },\n OperationDefinition: function OperationDefinition(node) {\n var op = node.operation;\n var name = node.name;\n var varDefs = wrap('(', join(node.variableDefinitions, ', '), ')');\n var directives = join(node.directives, ' ');\n var selectionSet = node.selectionSet; // Anonymous queries with no directives or variable definitions can use\n // the query short form.\n\n return !name && !directives && !varDefs && op === 'query' ? selectionSet : join([op, join([name, varDefs]), directives, selectionSet], ' ');\n },\n VariableDefinition: function VariableDefinition(_ref) {\n var variable = _ref.variable,\n type = _ref.type,\n defaultValue = _ref.defaultValue,\n directives = _ref.directives;\n return variable + ': ' + type + wrap(' = ', defaultValue) + wrap(' ', join(directives, ' '));\n },\n SelectionSet: function SelectionSet(_ref2) {\n var selections = _ref2.selections;\n return block(selections);\n },\n Field: function Field(_ref3) {\n var alias = _ref3.alias,\n name = _ref3.name,\n args = _ref3.arguments,\n directives = _ref3.directives,\n selectionSet = _ref3.selectionSet;\n return join([wrap('', alias, ': ') + name + wrap('(', join(args, ', '), ')'), join(directives, ' '), selectionSet], ' ');\n },\n Argument: function Argument(_ref4) {\n var name = _ref4.name,\n value = _ref4.value;\n return name + ': ' + value;\n },\n // Fragments\n FragmentSpread: function FragmentSpread(_ref5) {\n var name = _ref5.name,\n directives = _ref5.directives;\n return '...' + name + wrap(' ', join(directives, ' '));\n },\n InlineFragment: function InlineFragment(_ref6) {\n var typeCondition = _ref6.typeCondition,\n directives = _ref6.directives,\n selectionSet = _ref6.selectionSet;\n return join(['...', wrap('on ', typeCondition), join(directives, ' '), selectionSet], ' ');\n },\n FragmentDefinition: function FragmentDefinition(_ref7) {\n var name = _ref7.name,\n typeCondition = _ref7.typeCondition,\n variableDefinitions = _ref7.variableDefinitions,\n directives = _ref7.directives,\n selectionSet = _ref7.selectionSet;\n return (// Note: fragment variable definitions are experimental and may be changed\n // or removed in the future.\n \"fragment \".concat(name).concat(wrap('(', join(variableDefinitions, ', '), ')'), \" \") + \"on \".concat(typeCondition, \" \").concat(wrap('', join(directives, ' '), ' ')) + selectionSet\n );\n },\n // Value\n IntValue: function IntValue(_ref8) {\n var value = _ref8.value;\n return value;\n },\n FloatValue: function FloatValue(_ref9) {\n var value = _ref9.value;\n return value;\n },\n StringValue: function StringValue(_ref10, key) {\n var value = _ref10.value,\n isBlockString = _ref10.block;\n return isBlockString ? printBlockString(value, key === 'description') : JSON.stringify(value);\n },\n BooleanValue: function BooleanValue(_ref11) {\n var value = _ref11.value;\n return value ? 'true' : 'false';\n },\n NullValue: function NullValue() {\n return 'null';\n },\n EnumValue: function EnumValue(_ref12) {\n var value = _ref12.value;\n return value;\n },\n ListValue: function ListValue(_ref13) {\n var values = _ref13.values;\n return '[' + join(values, ', ') + ']';\n },\n ObjectValue: function ObjectValue(_ref14) {\n var fields = _ref14.fields;\n return '{' + join(fields, ', ') + '}';\n },\n ObjectField: function ObjectField(_ref15) {\n var name = _ref15.name,\n value = _ref15.value;\n return name + ': ' + value;\n },\n // Directive\n Directive: function Directive(_ref16) {\n var name = _ref16.name,\n args = _ref16.arguments;\n return '@' + name + wrap('(', join(args, ', '), ')');\n },\n // Type\n NamedType: function NamedType(_ref17) {\n var name = _ref17.name;\n return name;\n },\n ListType: function ListType(_ref18) {\n var type = _ref18.type;\n return '[' + type + ']';\n },\n NonNullType: function NonNullType(_ref19) {\n var type = _ref19.type;\n return type + '!';\n },\n // Type System Definitions\n SchemaDefinition: function SchemaDefinition(_ref20) {\n var directives = _ref20.directives,\n operationTypes = _ref20.operationTypes;\n return join(['schema', join(directives, ' '), block(operationTypes)], ' ');\n },\n OperationTypeDefinition: function OperationTypeDefinition(_ref21) {\n var operation = _ref21.operation,\n type = _ref21.type;\n return operation + ': ' + type;\n },\n ScalarTypeDefinition: addDescription(function (_ref22) {\n var name = _ref22.name,\n directives = _ref22.directives;\n return join(['scalar', name, join(directives, ' ')], ' ');\n }),\n ObjectTypeDefinition: addDescription(function (_ref23) {\n var name = _ref23.name,\n interfaces = _ref23.interfaces,\n directives = _ref23.directives,\n fields = _ref23.fields;\n return join(['type', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' ');\n }),\n FieldDefinition: addDescription(function (_ref24) {\n var name = _ref24.name,\n args = _ref24.arguments,\n type = _ref24.type,\n directives = _ref24.directives;\n return name + (args.every(function (arg) {\n return arg.indexOf('\\n') === -1;\n }) ? wrap('(', join(args, ', '), ')') : wrap('(\\n', indent(join(args, '\\n')), '\\n)')) + ': ' + type + wrap(' ', join(directives, ' '));\n }),\n InputValueDefinition: addDescription(function (_ref25) {\n var name = _ref25.name,\n type = _ref25.type,\n defaultValue = _ref25.defaultValue,\n directives = _ref25.directives;\n return join([name + ': ' + type, wrap('= ', defaultValue), join(directives, ' ')], ' ');\n }),\n InterfaceTypeDefinition: addDescription(function (_ref26) {\n var name = _ref26.name,\n directives = _ref26.directives,\n fields = _ref26.fields;\n return join(['interface', name, join(directives, ' '), block(fields)], ' ');\n }),\n UnionTypeDefinition: addDescription(function (_ref27) {\n var name = _ref27.name,\n directives = _ref27.directives,\n types = _ref27.types;\n return join(['union', name, join(directives, ' '), types && types.length !== 0 ? '= ' + join(types, ' | ') : ''], ' ');\n }),\n EnumTypeDefinition: addDescription(function (_ref28) {\n var name = _ref28.name,\n directives = _ref28.directives,\n values = _ref28.values;\n return join(['enum', name, join(directives, ' '), block(values)], ' ');\n }),\n EnumValueDefinition: addDescription(function (_ref29) {\n var name = _ref29.name,\n directives = _ref29.directives;\n return join([name, join(directives, ' ')], ' ');\n }),\n InputObjectTypeDefinition: addDescription(function (_ref30) {\n var name = _ref30.name,\n directives = _ref30.directives,\n fields = _ref30.fields;\n return join(['input', name, join(directives, ' '), block(fields)], ' ');\n }),\n DirectiveDefinition: addDescription(function (_ref31) {\n var name = _ref31.name,\n args = _ref31.arguments,\n locations = _ref31.locations;\n return 'directive @' + name + (args.every(function (arg) {\n return arg.indexOf('\\n') === -1;\n }) ? wrap('(', join(args, ', '), ')') : wrap('(\\n', indent(join(args, '\\n')), '\\n)')) + ' on ' + join(locations, ' | ');\n }),\n SchemaExtension: function SchemaExtension(_ref32) {\n var directives = _ref32.directives,\n operationTypes = _ref32.operationTypes;\n return join(['extend schema', join(directives, ' '), block(operationTypes)], ' ');\n },\n ScalarTypeExtension: function ScalarTypeExtension(_ref33) {\n var name = _ref33.name,\n directives = _ref33.directives;\n return join(['extend scalar', name, join(directives, ' ')], ' ');\n },\n ObjectTypeExtension: function ObjectTypeExtension(_ref34) {\n var name = _ref34.name,\n interfaces = _ref34.interfaces,\n directives = _ref34.directives,\n fields = _ref34.fields;\n return join(['extend type', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' ');\n },\n InterfaceTypeExtension: function InterfaceTypeExtension(_ref35) {\n var name = _ref35.name,\n directives = _ref35.directives,\n fields = _ref35.fields;\n return join(['extend interface', name, join(directives, ' '), block(fields)], ' ');\n },\n UnionTypeExtension: function UnionTypeExtension(_ref36) {\n var name = _ref36.name,\n directives = _ref36.directives,\n types = _ref36.types;\n return join(['extend union', name, join(directives, ' '), types && types.length !== 0 ? '= ' + join(types, ' | ') : ''], ' ');\n },\n EnumTypeExtension: function EnumTypeExtension(_ref37) {\n var name = _ref37.name,\n directives = _ref37.directives,\n values = _ref37.values;\n return join(['extend enum', name, join(directives, ' '), block(values)], ' ');\n },\n InputObjectTypeExtension: function InputObjectTypeExtension(_ref38) {\n var name = _ref38.name,\n directives = _ref38.directives,\n fields = _ref38.fields;\n return join(['extend input', name, join(directives, ' '), block(fields)], ' ');\n }\n};\n\nfunction addDescription(cb) {\n return function (node) {\n return join([node.description, cb(node)], '\\n');\n };\n}\n/**\n * Given maybeArray, print an empty string if it is null or empty, otherwise\n * print all items together separated by separator if provided\n */\n\n\nfunction join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}\n/**\n * Given array, print each item on its own line, wrapped in an\n * indented \"{ }\" block.\n */\n\n\nfunction block(array) {\n return array && array.length !== 0 ? '{\\n' + indent(join(array, '\\n')) + '\\n}' : '';\n}\n/**\n * If maybeString is not null or empty, then wrap with start and end, otherwise\n * print an empty string.\n */\n\n\nfunction wrap(start, maybeString, end) {\n return maybeString ? start + maybeString + (end || '') : '';\n}\n\nfunction indent(maybeString) {\n return maybeString && ' ' + maybeString.replace(/\\n/g, '\\n ');\n}\n/**\n * Print a block string in the indented block form by adding a leading and\n * trailing blank line. However, if a block string starts with whitespace and is\n * a single-line, adding a leading blank line would strip that whitespace.\n */\n\n\nfunction printBlockString(value, isDescription) {\n var escaped = value.replace(/\"\"\"/g, '\\\\\"\"\"');\n return (value[0] === ' ' || value[0] === '\\t') && value.indexOf('\\n') === -1 ? \"\\\"\\\"\\\"\".concat(escaped.replace(/\"$/, '\"\\n'), \"\\\"\\\"\\\"\") : \"\\\"\\\"\\\"\\n\".concat(isDescription ? escaped : indent(escaped), \"\\n\\\"\\\"\\\"\");\n}","var core = module.exports = { version: '2.5.7' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n","import forEach from \"lodash/forEach\";\nimport produce from \"immer\";\n\nexport function columnsFilter(columns, mode, keep) {\n return produce(columns, draft => {\n for (let gk in draft) {\n if (!draft[gk].modes || draft[gk].modes.includes(mode)) {\n for (let ck in draft[gk].columns) {\n if (!keep.includes(`${gk}.${ck}`) && !draft[gk].locked) {\n delete draft[gk].columns[ck];\n }\n }\n } else {\n delete draft[gk];\n }\n }\n });\n}\n\nexport function columnsSortKey(columns, sortBy, sortDirection) {\n const [orderByGroupKey, orderByColumnKey] = sortBy.split(\".\");\n const orderByColumn = columns[orderByGroupKey]\n ? columns[orderByGroupKey].columns[orderByColumnKey]\n : null;\n if (orderByColumn && orderByColumn.sort) {\n return `${orderByColumn.sort}_${sortDirection}`;\n } else {\n return null;\n }\n}\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"container\":\"styles-module__container___27lfZ\",\"toolbars\":\"styles-module__toolbars___vEWpx\",\"body\":\"styles-module__body___31a0i\",\"nav\":\"styles-module__nav___3Lwah\",\"pill\":\"styles-module__pill___1oUhf\",\"activePill\":\"styles-module__activePill___8DSI_\",\"emptyBox\":\"styles-module__emptyBox___1o_ZY\",\"calendar\":\"styles-module__calendar___2Boa2\",\"calendarHeader\":\"styles-module__calendarHeader___1O6lj\",\"calendarDays\":\"styles-module__calendarDays___2XBAI\",\"calendarDay\":\"styles-module__calendarDay___1z9T8\",\"calendarDayHeader\":\"styles-module__calendarDayHeader___3viPb\",\"calendarBody\":\"styles-module__calendarBody___1cCA6\",\"calendarEntryContainer\":\"styles-module__calendarEntryContainer___tEjYx\",\"calendarEntry\":\"styles-module__calendarEntry___1INFS\"};","var g; // This works in non-strict mode\n\ng = function () {\n return this;\n}();\n\ntry {\n // This works if eval is allowed (see CSP)\n g = g || new Function(\"return this\")();\n} catch (e) {\n // This works if the window reference is available\n if (typeof window === \"object\") g = window;\n} // g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\n\nmodule.exports = g;","'use strict';\n\nvar defineProperties = require('define-properties');\n\nvar implementation = require('./implementation');\n\nvar getPolyfill = require('./polyfill');\n\nvar shim = require('./shim');\n\nvar polyfill = getPolyfill();\ndefineProperties(polyfill, {\n getPolyfill: getPolyfill,\n implementation: implementation,\n shim: shim\n});\nmodule.exports = polyfill;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar calendarLabel = 'Calendar';\nvar closeDatePicker = 'Close';\nvar focusStartDate = 'Interact with the calendar and add the check-in date for your trip.';\nvar clearDate = 'Clear Date';\nvar clearDates = 'Clear Dates';\nvar jumpToPrevMonth = 'Move backward to switch to the previous month.';\nvar jumpToNextMonth = 'Move forward to switch to the next month.';\nvar keyboardShortcuts = 'Keyboard Shortcuts';\nvar showKeyboardShortcutsPanel = 'Open the keyboard shortcuts panel.';\nvar hideKeyboardShortcutsPanel = 'Close the shortcuts panel.';\nvar openThisPanel = 'Open this panel.';\nvar enterKey = 'Enter key';\nvar leftArrowRightArrow = 'Right and left arrow keys';\nvar upArrowDownArrow = 'up and down arrow keys';\nvar pageUpPageDown = 'page up and page down keys';\nvar homeEnd = 'Home and end keys';\nvar escape = 'Escape key';\nvar questionMark = 'Question mark';\nvar selectFocusedDate = 'Select the date in focus.';\nvar moveFocusByOneDay = 'Move backward (left) and forward (right) by one day.';\nvar moveFocusByOneWeek = 'Move backward (up) and forward (down) by one week.';\nvar moveFocusByOneMonth = 'Switch months.';\nvar moveFocustoStartAndEndOfWeek = 'Go to the first or last day of a week.';\nvar returnFocusToInput = 'Return to the date input field.';\nvar keyboardNavigationInstructions = 'Press the down arrow key to interact with the calendar and\\n select a date. Press the question mark key to get the keyboard shortcuts for changing dates.';\n\nvar chooseAvailableStartDate = function chooseAvailableStartDate(_ref) {\n var date = _ref.date;\n return 'Choose ' + String(date) + ' as your check-in date. It\\u2019s available.';\n};\n\nvar chooseAvailableEndDate = function chooseAvailableEndDate(_ref2) {\n var date = _ref2.date;\n return 'Choose ' + String(date) + ' as your check-out date. It\\u2019s available.';\n};\n\nvar chooseAvailableDate = function chooseAvailableDate(_ref3) {\n var date = _ref3.date;\n return date;\n};\n\nvar dateIsUnavailable = function dateIsUnavailable(_ref4) {\n var date = _ref4.date;\n return 'Not available. ' + String(date);\n};\n\nvar dateIsSelected = function dateIsSelected(_ref5) {\n var date = _ref5.date;\n return 'Selected. ' + String(date);\n};\n\nexports['default'] = {\n calendarLabel: calendarLabel,\n closeDatePicker: closeDatePicker,\n focusStartDate: focusStartDate,\n clearDate: clearDate,\n clearDates: clearDates,\n jumpToPrevMonth: jumpToPrevMonth,\n jumpToNextMonth: jumpToNextMonth,\n keyboardShortcuts: keyboardShortcuts,\n showKeyboardShortcutsPanel: showKeyboardShortcutsPanel,\n hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,\n openThisPanel: openThisPanel,\n enterKey: enterKey,\n leftArrowRightArrow: leftArrowRightArrow,\n upArrowDownArrow: upArrowDownArrow,\n pageUpPageDown: pageUpPageDown,\n homeEnd: homeEnd,\n escape: escape,\n questionMark: questionMark,\n selectFocusedDate: selectFocusedDate,\n moveFocusByOneDay: moveFocusByOneDay,\n moveFocusByOneWeek: moveFocusByOneWeek,\n moveFocusByOneMonth: moveFocusByOneMonth,\n moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek,\n returnFocusToInput: returnFocusToInput,\n keyboardNavigationInstructions: keyboardNavigationInstructions,\n chooseAvailableStartDate: chooseAvailableStartDate,\n chooseAvailableEndDate: chooseAvailableEndDate,\n dateIsUnavailable: dateIsUnavailable,\n dateIsSelected: dateIsSelected\n};\nvar DateRangePickerPhrases = exports.DateRangePickerPhrases = {\n calendarLabel: calendarLabel,\n closeDatePicker: closeDatePicker,\n clearDates: clearDates,\n focusStartDate: focusStartDate,\n jumpToPrevMonth: jumpToPrevMonth,\n jumpToNextMonth: jumpToNextMonth,\n keyboardShortcuts: keyboardShortcuts,\n showKeyboardShortcutsPanel: showKeyboardShortcutsPanel,\n hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,\n openThisPanel: openThisPanel,\n enterKey: enterKey,\n leftArrowRightArrow: leftArrowRightArrow,\n upArrowDownArrow: upArrowDownArrow,\n pageUpPageDown: pageUpPageDown,\n homeEnd: homeEnd,\n escape: escape,\n questionMark: questionMark,\n selectFocusedDate: selectFocusedDate,\n moveFocusByOneDay: moveFocusByOneDay,\n moveFocusByOneWeek: moveFocusByOneWeek,\n moveFocusByOneMonth: moveFocusByOneMonth,\n moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek,\n returnFocusToInput: returnFocusToInput,\n keyboardNavigationInstructions: keyboardNavigationInstructions,\n chooseAvailableStartDate: chooseAvailableStartDate,\n chooseAvailableEndDate: chooseAvailableEndDate,\n dateIsUnavailable: dateIsUnavailable,\n dateIsSelected: dateIsSelected\n};\nvar DateRangePickerInputPhrases = exports.DateRangePickerInputPhrases = {\n focusStartDate: focusStartDate,\n clearDates: clearDates,\n keyboardNavigationInstructions: keyboardNavigationInstructions\n};\nvar SingleDatePickerPhrases = exports.SingleDatePickerPhrases = {\n calendarLabel: calendarLabel,\n closeDatePicker: closeDatePicker,\n clearDate: clearDate,\n jumpToPrevMonth: jumpToPrevMonth,\n jumpToNextMonth: jumpToNextMonth,\n keyboardShortcuts: keyboardShortcuts,\n showKeyboardShortcutsPanel: showKeyboardShortcutsPanel,\n hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,\n openThisPanel: openThisPanel,\n enterKey: enterKey,\n leftArrowRightArrow: leftArrowRightArrow,\n upArrowDownArrow: upArrowDownArrow,\n pageUpPageDown: pageUpPageDown,\n homeEnd: homeEnd,\n escape: escape,\n questionMark: questionMark,\n selectFocusedDate: selectFocusedDate,\n moveFocusByOneDay: moveFocusByOneDay,\n moveFocusByOneWeek: moveFocusByOneWeek,\n moveFocusByOneMonth: moveFocusByOneMonth,\n moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek,\n returnFocusToInput: returnFocusToInput,\n keyboardNavigationInstructions: keyboardNavigationInstructions,\n chooseAvailableDate: chooseAvailableDate,\n dateIsUnavailable: dateIsUnavailable,\n dateIsSelected: dateIsSelected\n};\nvar SingleDatePickerInputPhrases = exports.SingleDatePickerInputPhrases = {\n clearDate: clearDate,\n keyboardNavigationInstructions: keyboardNavigationInstructions\n};\nvar DayPickerPhrases = exports.DayPickerPhrases = {\n calendarLabel: calendarLabel,\n jumpToPrevMonth: jumpToPrevMonth,\n jumpToNextMonth: jumpToNextMonth,\n keyboardShortcuts: keyboardShortcuts,\n showKeyboardShortcutsPanel: showKeyboardShortcutsPanel,\n hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,\n openThisPanel: openThisPanel,\n enterKey: enterKey,\n leftArrowRightArrow: leftArrowRightArrow,\n upArrowDownArrow: upArrowDownArrow,\n pageUpPageDown: pageUpPageDown,\n homeEnd: homeEnd,\n escape: escape,\n questionMark: questionMark,\n selectFocusedDate: selectFocusedDate,\n moveFocusByOneDay: moveFocusByOneDay,\n moveFocusByOneWeek: moveFocusByOneWeek,\n moveFocusByOneMonth: moveFocusByOneMonth,\n moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek,\n returnFocusToInput: returnFocusToInput,\n chooseAvailableStartDate: chooseAvailableStartDate,\n chooseAvailableEndDate: chooseAvailableEndDate,\n chooseAvailableDate: chooseAvailableDate,\n dateIsUnavailable: dateIsUnavailable,\n dateIsSelected: dateIsSelected\n};\nvar DayPickerKeyboardShortcutsPhrases = exports.DayPickerKeyboardShortcutsPhrases = {\n keyboardShortcuts: keyboardShortcuts,\n showKeyboardShortcutsPanel: showKeyboardShortcutsPanel,\n hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,\n openThisPanel: openThisPanel,\n enterKey: enterKey,\n leftArrowRightArrow: leftArrowRightArrow,\n upArrowDownArrow: upArrowDownArrow,\n pageUpPageDown: pageUpPageDown,\n homeEnd: homeEnd,\n escape: escape,\n questionMark: questionMark,\n selectFocusedDate: selectFocusedDate,\n moveFocusByOneDay: moveFocusByOneDay,\n moveFocusByOneWeek: moveFocusByOneWeek,\n moveFocusByOneMonth: moveFocusByOneMonth,\n moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek,\n returnFocusToInput: returnFocusToInput\n};\nvar DayPickerNavigationPhrases = exports.DayPickerNavigationPhrases = {\n jumpToPrevMonth: jumpToPrevMonth,\n jumpToNextMonth: jumpToNextMonth\n};\nvar CalendarDayPhrases = exports.CalendarDayPhrases = {\n chooseAvailableDate: chooseAvailableDate,\n dateIsUnavailable: dateIsUnavailable,\n dateIsSelected: dateIsSelected\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.pureComponentAvailable = undefined;\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 _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _reactAddonsShallowCompare = require('react-addons-shallow-compare');\n\nvar _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare);\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n 'default': obj\n };\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n}\n\nvar BaseClass = function (_ref) {\n _inherits(BaseClass, _ref);\n\n function BaseClass() {\n _classCallCheck(this, BaseClass);\n\n return _possibleConstructorReturn(this, (BaseClass.__proto__ || Object.getPrototypeOf(BaseClass)).apply(this, arguments));\n }\n\n _createClass(BaseClass, [{\n key: !_react2['default'].PureComponent && 'shouldComponentUpdate',\n value: function () {\n function value(nextProps, nextState) {\n return (0, _reactAddonsShallowCompare2['default'])(this, nextProps, nextState);\n }\n\n return value;\n }()\n }]);\n\n return BaseClass;\n}(_react2['default'].PureComponent || _react2['default'].Component);\n\nvar pureComponentAvailable = exports.pureComponentAvailable = typeof _react2['default'].PureComponent !== 'undefined';\nexports['default'] = BaseClass;","import \"react-virtualized/styles.css\";\nimport React from \"react\";\nimport { Table, Column, AutoSizer, SortIndicator } from \"react-virtualized\";\nimport cls from \"classnames\";\nimport flatten from \"lodash/flatten\";\nimport snakeCase from \"lodash/snakeCase\";\nimport sum from \"lodash/sum\";\nimport map from \"lodash/map\";\nimport random from \"lodash/random\";\nimport { attr } from \"../../utils/translations\";\nimport RecordLoader from \"./RecordLoader\";\n\nconst DEFAULT_COLUMN_WIDTH = 150;\n\nfunction calcMinWidth(groups) {\n return (\n sum(\n flatten(\n map(groups, g => map(g.columns, c => c.width || DEFAULT_COLUMN_WIDTH))\n )\n ) +\n Object.keys(groups).length * 2 -\n 2\n );\n}\n\nconst Loading = () => (\n \n);\n\nconst defaultCellRenderer = ({ cellData, rowData, columnData }) => {\n const content = columnData.format(\n cellData == null ? \"\" : cellData,\n rowData,\n columnData.refetch\n );\n\n return (\n
\n )}\n \n )}\n \n );\n }\n}\n\nexport default RecordTable;\n","import React from \"react\";\nimport get from \"lodash/get\";\nimport gql from \"graphql-tag\";\nimport QuerySelectField from \"./QuerySelectField\";\nimport { model } from \"../../utils/translations\";\n\nconst PROPERTIES_QUERY = gql`\n query Properties($byId: [ID!], $byOwner: [ID!], $byAdministrator: [ID!]) {\n result: properties(\n orderBy: name_ASC\n where: {\n archived: false\n byId: $byId\n byOwner: $byOwner\n byAdministrator: $byAdministrator\n }\n limit: 1000\n ) {\n options: records {\n value: id\n label: name\n }\n }\n }\n`;\n\nclass PropertyField extends React.Component {\n render() {\n const { value, filter, ...rest } = this.props;\n\n const variables = {\n byId: get(filter, \"byId\", null),\n byOwner: get(filter, \"byOwner\", null),\n byAdministrator: get(filter, \"byAdministrator\", null)\n };\n\n return (\n \n );\n }\n}\n\nexport default PropertyField;\n","import React from \"react\";\nimport Icon from \"../elements/Icon\";\nimport TextField from \"./TextField\";\n\nclass SearchField extends React.Component {\n render() {\n return } {...this.props} />;\n }\n}\n\nexport default SearchField;\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"triggerButton\":\"styles-module__triggerButton___1HDv-\",\"iconWrapper\":\"styles-module__iconWrapper___1EpMY\",\"databaseContainer\":\"styles-module__databaseContainer___1MwKX\",\"databaseNav\":\"styles-module__databaseNav___2S155\",\"databaseActive\":\"styles-module__databaseActive___2G0P1\",\"macroContainer\":\"styles-module__macroContainer___3UWOK\",\"macroName\":\"styles-module__macroName___1Asyy\",\"macroContent\":\"styles-module__macroContent___2AYUH\",\"macroActions\":\"styles-module__macroActions___MmmuZ\"};","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nif (process.env.NODE_ENV !== 'production') {\n var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol.for && Symbol.for('react.element') || 0xeac7;\n\n var isValidElement = function (object) {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n }; // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n\n\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}","var isObject = require('./isObject'),\n now = require('./now'),\n toNumber = require('./toNumber');\n/** Used as the `TypeError` message for \"Functions\" methods. */\n\n\nvar FUNC_ERROR_TEXT = 'Expected a function';\n/* Built-in method references for those with the same name as other `lodash` methods. */\n\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide an options object to indicate whether `func` should be invoked on\n * the leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent calls\n * to the debounced function return the result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked\n * on the trailing edge of the timeout only if the debounced function is\n * invoked more than once during the `wait` timeout.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\n\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n\n wait = toNumber(wait) || 0;\n\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time; // Start the timer for the trailing edge.\n\n timerId = setTimeout(timerExpired, wait); // Invoke the leading edge.\n\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n result = wait - timeSinceLastCall;\n return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime; // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n\n return lastCallTime === undefined || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;\n }\n\n function timerExpired() {\n var time = now();\n\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n } // Restart the timer.\n\n\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined; // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n\n if (maxing) {\n // Handle invocations in a tight loop.\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n\n return result;\n }\n\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nmodule.exports = debounce;","// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n","var store = require('./_shared')('wks');\nvar uid = require('./_uid');\nvar Symbol = require('./_global').Symbol;\nvar USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function (name) {\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports['default'] = getPhrasePropTypes;\n\nvar _object = require('object.assign');\n\nvar _object2 = _interopRequireDefault(_object);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n 'default': obj\n };\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction getPhrasePropTypes(defaultPhrases) {\n return Object.keys(defaultPhrases).reduce(function (phrases, key) {\n return (0, _object2['default'])({}, phrases, _defineProperty({}, key, _propTypes2['default'].oneOfType([_propTypes2['default'].string, _propTypes2['default'].func, _propTypes2['default'].node])));\n }, {});\n}","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nfunction componentWillMount() {\n // Call this.constructor.gDSFP to support sub-classes.\n var state = this.constructor.getDerivedStateFromProps(this.props, this.state);\n\n if (state !== null && state !== undefined) {\n this.setState(state);\n }\n}\n\nfunction componentWillReceiveProps(nextProps) {\n // Call this.constructor.gDSFP to support sub-classes.\n // Use the setState() updater to ensure state isn't stale in certain edge cases.\n function updater(prevState) {\n var state = this.constructor.getDerivedStateFromProps(nextProps, prevState);\n return state !== null && state !== undefined ? state : null;\n } // Binding \"this\" is important for shallow renderer support.\n\n\n this.setState(updater.bind(this));\n}\n\nfunction componentWillUpdate(nextProps, nextState) {\n try {\n var prevProps = this.props;\n var prevState = this.state;\n this.props = nextProps;\n this.state = nextState;\n this.__reactInternalSnapshotFlag = true;\n this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(prevProps, prevState);\n } finally {\n this.props = prevProps;\n this.state = prevState;\n }\n} // React may warn about cWM/cWRP/cWU methods being deprecated.\n// Add a flag to suppress these warnings for this special case.\n\n\ncomponentWillMount.__suppressDeprecationWarning = true;\ncomponentWillReceiveProps.__suppressDeprecationWarning = true;\ncomponentWillUpdate.__suppressDeprecationWarning = true;\n\nfunction polyfill(Component) {\n var prototype = Component.prototype;\n\n if (!prototype || !prototype.isReactComponent) {\n throw new Error('Can only polyfill class components');\n }\n\n if (typeof Component.getDerivedStateFromProps !== 'function' && typeof prototype.getSnapshotBeforeUpdate !== 'function') {\n return Component;\n } // If new component APIs are defined, \"unsafe\" lifecycles won't be called.\n // Error if any of these lifecycles are present,\n // Because they would work differently between older and newer (16.3+) versions of React.\n\n\n var foundWillMountName = null;\n var foundWillReceivePropsName = null;\n var foundWillUpdateName = null;\n\n if (typeof prototype.componentWillMount === 'function') {\n foundWillMountName = 'componentWillMount';\n } else if (typeof prototype.UNSAFE_componentWillMount === 'function') {\n foundWillMountName = 'UNSAFE_componentWillMount';\n }\n\n if (typeof prototype.componentWillReceiveProps === 'function') {\n foundWillReceivePropsName = 'componentWillReceiveProps';\n } else if (typeof prototype.UNSAFE_componentWillReceiveProps === 'function') {\n foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';\n }\n\n if (typeof prototype.componentWillUpdate === 'function') {\n foundWillUpdateName = 'componentWillUpdate';\n } else if (typeof prototype.UNSAFE_componentWillUpdate === 'function') {\n foundWillUpdateName = 'UNSAFE_componentWillUpdate';\n }\n\n if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) {\n var componentName = Component.displayName || Component.name;\n var newApiName = typeof Component.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()';\n throw Error('Unsafe legacy lifecycles will not be called for components using new component APIs.\\n\\n' + componentName + ' uses ' + newApiName + ' but also contains the following legacy lifecycles:' + (foundWillMountName !== null ? '\\n ' + foundWillMountName : '') + (foundWillReceivePropsName !== null ? '\\n ' + foundWillReceivePropsName : '') + (foundWillUpdateName !== null ? '\\n ' + foundWillUpdateName : '') + '\\n\\nThe above lifecycles should be removed. Learn more about this warning here:\\n' + 'https://fb.me/react-async-component-lifecycle-hooks');\n } // React <= 16.2 does not support static getDerivedStateFromProps.\n // As a workaround, use cWM and cWRP to invoke the new static lifecycle.\n // Newer versions of React will ignore these lifecycles if gDSFP exists.\n\n\n if (typeof Component.getDerivedStateFromProps === 'function') {\n prototype.componentWillMount = componentWillMount;\n prototype.componentWillReceiveProps = componentWillReceiveProps;\n } // React <= 16.2 does not support getSnapshotBeforeUpdate.\n // As a workaround, use cWU to invoke the new lifecycle.\n // Newer versions of React will ignore that lifecycle if gSBU exists.\n\n\n if (typeof prototype.getSnapshotBeforeUpdate === 'function') {\n if (typeof prototype.componentDidUpdate !== 'function') {\n throw new Error('Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype');\n }\n\n prototype.componentWillUpdate = componentWillUpdate;\n var componentDidUpdate = prototype.componentDidUpdate;\n\n prototype.componentDidUpdate = function componentDidUpdatePolyfill(prevProps, prevState, maybeSnapshot) {\n // 16.3+ will not execute our will-update method;\n // It will pass a snapshot value to did-update though.\n // Older versions will require our polyfilled will-update value.\n // We need to handle both cases, but can't just check for the presence of \"maybeSnapshot\",\n // Because for <= 15.x versions this might be a \"prevContext\" object.\n // We also can't just check \"__reactInternalSnapshot\",\n // Because get-snapshot might return a falsy value.\n // So check for the explicit __reactInternalSnapshotFlag flag to determine behavior.\n var snapshot = this.__reactInternalSnapshotFlag ? this.__reactInternalSnapshot : maybeSnapshot;\n componentDidUpdate.call(this, prevProps, prevState, snapshot);\n };\n }\n\n return Component;\n}\n\nexport { polyfill };","import React from \"react\";\nimport moment from \"moment\";\nimport { DateRangePicker } from \"react-dates\";\nimport Field from \"./Field\";\nimport { t } from \"../../utils/translations\";\n\nclass DateRangeField extends React.Component {\n state = {\n focused: null\n };\n\n render() {\n const {\n prepend,\n append,\n startDate,\n endDate,\n label,\n onChange,\n ...rest\n } = this.props;\n\n return (\n \n moment().isSame(day, \"day\")}\n withPortal\n showDefaultInputIcon\n inputIconPosition=\"before\"\n numberOfMonths={\n window.matchMedia(\"(max-width: 700px)\").matches ? 1 : 2\n }\n small\n noBorder\n focusedInput={this.state.focused}\n isOutsideRange={() => false}\n onDatesChange={({ startDate, endDate }) => {\n if (onChange)\n onChange(\n startDate ? startDate.toDate() : null,\n endDate ? endDate.toDate() : null\n );\n }}\n onFocusChange={focused => this.setState({ focused })}\n {...rest}\n />\n \n );\n }\n}\n\nexport default DateRangeField;\n","import React from \"react\";\nimport isEqual from \"lodash/isEqual\";\n\nfunction historyReplaceSlate(state) {\n if (window.history && window.history.replaceState) {\n window.history.replaceState(\n {},\n \"\",\n window.location.pathname + `?state=${encodeURIComponent(state)}`\n );\n }\n}\n\nconst withLocationState = (WrappedComponent, storageKey = null) => {\n return class extends React.Component {\n constructor(props) {\n super(props);\n\n try {\n const urlParams = new URLSearchParams(window.location.search);\n if (urlParams.has(\"state\")) {\n this.state = JSON.parse(urlParams.get(\"state\"));\n } else if (storageKey) {\n const fromSession = window.sessionStorage.getItem(storageKey);\n if (fromSession) {\n this.state = JSON.parse(fromSession);\n historyReplaceSlate(fromSession);\n }\n }\n } catch (e) {\n // ignore\n }\n }\n\n handlePersistLocationState = state => {\n if (!isEqual(state, this.state)) {\n try {\n const stringed = JSON.stringify(state);\n historyReplaceSlate(stringed);\n if (storageKey) {\n window.sessionStorage.setItem(storageKey, stringed);\n }\n this.setState(() => state);\n } catch (e) {\n // ignore\n }\n }\n };\n\n render() {\n return (\n \n );\n }\n };\n};\n\nexport default withLocationState;\n","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @type {Function}\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified,\n * else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\nmodule.exports = isArray;","Object.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.withStylesPropTypes = exports.css = undefined;\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\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\nexports.withStyles = withStyles;\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _hoistNonReactStatics = require('hoist-non-react-statics');\n\nvar _hoistNonReactStatics2 = _interopRequireDefault(_hoistNonReactStatics);\n\nvar _deepmerge = require('deepmerge');\n\nvar _deepmerge2 = _interopRequireDefault(_deepmerge);\n\nvar _constants = require('react-with-direction/dist/constants');\n\nvar _brcast = require('react-with-direction/dist/proptypes/brcast');\n\nvar _brcast2 = _interopRequireDefault(_brcast);\n\nvar _ThemedStyleSheet = require('./ThemedStyleSheet');\n\nvar _ThemedStyleSheet2 = _interopRequireDefault(_ThemedStyleSheet);\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n 'default': obj\n };\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n} // Add some named exports to assist in upgrading and for convenience\n\n\nvar css = exports.css = _ThemedStyleSheet2['default'].resolveLTR;\nvar withStylesPropTypes = exports.withStylesPropTypes = {\n styles: _propTypes2['default'].object.isRequired,\n // eslint-disable-line react/forbid-prop-types\n theme: _propTypes2['default'].object.isRequired,\n // eslint-disable-line react/forbid-prop-types\n css: _propTypes2['default'].func.isRequired\n};\nvar EMPTY_STYLES = {};\n\nvar EMPTY_STYLES_FN = function EMPTY_STYLES_FN() {\n return EMPTY_STYLES;\n};\n\nfunction baseClass(pureComponent) {\n if (pureComponent) {\n if (!_react2['default'].PureComponent) {\n throw new ReferenceError('withStyles() pureComponent option requires React 15.3.0 or later');\n }\n\n return _react2['default'].PureComponent;\n }\n\n return _react2['default'].Component;\n}\n\nvar contextTypes = _defineProperty({}, _constants.CHANNEL, _brcast2['default']);\n\nvar defaultDirection = _constants.DIRECTIONS.LTR;\n\nfunction withStyles(styleFn) {\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n _ref$stylesPropName = _ref.stylesPropName,\n stylesPropName = _ref$stylesPropName === undefined ? 'styles' : _ref$stylesPropName,\n _ref$themePropName = _ref.themePropName,\n themePropName = _ref$themePropName === undefined ? 'theme' : _ref$themePropName,\n _ref$cssPropName = _ref.cssPropName,\n cssPropName = _ref$cssPropName === undefined ? 'css' : _ref$cssPropName,\n _ref$flushBefore = _ref.flushBefore,\n flushBefore = _ref$flushBefore === undefined ? false : _ref$flushBefore,\n _ref$pureComponent = _ref.pureComponent,\n pureComponent = _ref$pureComponent === undefined ? false : _ref$pureComponent;\n\n var styleDefLTR = void 0;\n var styleDefRTL = void 0;\n var currentThemeLTR = void 0;\n var currentThemeRTL = void 0;\n var BaseClass = baseClass(pureComponent);\n\n function getResolveMethod(direction) {\n return direction === _constants.DIRECTIONS.LTR ? _ThemedStyleSheet2['default'].resolveLTR : _ThemedStyleSheet2['default'].resolveRTL;\n }\n\n function getCurrentTheme(direction) {\n return direction === _constants.DIRECTIONS.LTR ? currentThemeLTR : currentThemeRTL;\n }\n\n function getStyleDef(direction, wrappedComponentName) {\n var currentTheme = getCurrentTheme(direction);\n var styleDef = direction === _constants.DIRECTIONS.LTR ? styleDefLTR : styleDefRTL;\n\n var registeredTheme = _ThemedStyleSheet2['default'].get(); // Return the existing styles if they've already been defined\n // and if the theme used to create them corresponds to the theme\n // registered with ThemedStyleSheet\n\n\n if (styleDef && currentTheme === registeredTheme) {\n return styleDef;\n }\n\n if (process.env.NODE_ENV !== 'production' && typeof performance !== 'undefined' && performance.mark !== undefined) {\n performance.mark('react-with-styles.createStyles.start');\n }\n\n var isRTL = direction === _constants.DIRECTIONS.RTL;\n\n if (isRTL) {\n styleDefRTL = styleFn ? _ThemedStyleSheet2['default'].createRTL(styleFn) : EMPTY_STYLES_FN;\n currentThemeRTL = registeredTheme;\n styleDef = styleDefRTL;\n } else {\n styleDefLTR = styleFn ? _ThemedStyleSheet2['default'].createLTR(styleFn) : EMPTY_STYLES_FN;\n currentThemeLTR = registeredTheme;\n styleDef = styleDefLTR;\n }\n\n if (process.env.NODE_ENV !== 'production' && typeof performance !== 'undefined' && performance.mark !== undefined) {\n performance.mark('react-with-styles.createStyles.end');\n performance.measure('\\uD83D\\uDC69\\u200D\\uD83C\\uDFA8 withStyles(' + String(wrappedComponentName) + ') [create styles]', 'react-with-styles.createStyles.start', 'react-with-styles.createStyles.end');\n }\n\n return styleDef;\n }\n\n function getState(direction, wrappedComponentName) {\n return {\n resolveMethod: getResolveMethod(direction),\n styleDef: getStyleDef(direction, wrappedComponentName)\n };\n }\n\n return function () {\n function withStylesHOC(WrappedComponent) {\n var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component'; // NOTE: Use a class here so components are ref-able if need be:\n // eslint-disable-next-line react/prefer-stateless-function\n\n var WithStyles = function (_BaseClass) {\n _inherits(WithStyles, _BaseClass);\n\n function WithStyles(props, context) {\n _classCallCheck(this, WithStyles);\n\n var _this = _possibleConstructorReturn(this, (WithStyles.__proto__ || Object.getPrototypeOf(WithStyles)).call(this, props, context));\n\n var direction = _this.context[_constants.CHANNEL] ? _this.context[_constants.CHANNEL].getState() : defaultDirection;\n _this.state = getState(direction, wrappedComponentName);\n return _this;\n }\n\n _createClass(WithStyles, [{\n key: 'componentDidMount',\n value: function () {\n function componentDidMount() {\n var _this2 = this;\n\n if (this.context[_constants.CHANNEL]) {\n // subscribe to future direction changes\n this.channelUnsubscribe = this.context[_constants.CHANNEL].subscribe(function (direction) {\n _this2.setState(getState(direction, wrappedComponentName));\n });\n }\n }\n\n return componentDidMount;\n }()\n }, {\n key: 'componentWillUnmount',\n value: function () {\n function componentWillUnmount() {\n if (this.channelUnsubscribe) {\n this.channelUnsubscribe();\n }\n }\n\n return componentWillUnmount;\n }()\n }, {\n key: 'render',\n value: function () {\n function render() {\n var _ref2; // As some components will depend on previous styles in\n // the component tree, we provide the option of flushing the\n // buffered styles (i.e. to a style tag) **before** the rendering\n // cycle begins.\n //\n // The interfaces provide the optional \"flush\" method which\n // is run in turn by ThemedStyleSheet.flush.\n\n\n if (flushBefore) {\n _ThemedStyleSheet2['default'].flush();\n }\n\n var _state = this.state,\n resolveMethod = _state.resolveMethod,\n styleDef = _state.styleDef;\n return _react2['default'].createElement(WrappedComponent, _extends({}, this.props, (_ref2 = {}, _defineProperty(_ref2, themePropName, _ThemedStyleSheet2['default'].get()), _defineProperty(_ref2, stylesPropName, styleDef()), _defineProperty(_ref2, cssPropName, resolveMethod), _ref2)));\n }\n\n return render;\n }()\n }]);\n\n return WithStyles;\n }(BaseClass);\n\n WithStyles.WrappedComponent = WrappedComponent;\n WithStyles.displayName = 'withStyles(' + String(wrappedComponentName) + ')';\n WithStyles.contextTypes = contextTypes;\n\n if (WrappedComponent.propTypes) {\n WithStyles.propTypes = (0, _deepmerge2['default'])({}, WrappedComponent.propTypes);\n delete WithStyles.propTypes[stylesPropName];\n delete WithStyles.propTypes[themePropName];\n delete WithStyles.propTypes[cssPropName];\n }\n\n if (WrappedComponent.defaultProps) {\n WithStyles.defaultProps = (0, _deepmerge2['default'])({}, WrappedComponent.defaultProps);\n }\n\n return (0, _hoistNonReactStatics2['default'])(WithStyles, WrappedComponent);\n }\n\n return withStylesHOC;\n }();\n}","/**\n * Copyright 2014-2015, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar warning = function () {};\n\nif (process.env.NODE_ENV !== 'production') {\n warning = function (condition, format, args) {\n var len = arguments.length;\n args = new Array(len > 2 ? len - 2 : 0);\n\n for (var key = 2; key < len; key++) {\n args[key - 2] = arguments[key];\n }\n\n if (format === undefined) {\n throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');\n }\n\n if (format.length < 10 || /^[s\\W]*$/.test(format)) {\n throw new Error('The warning format should be able to uniquely identify this ' + 'warning. Please, use a more descriptive format than: ' + format);\n }\n\n if (!condition) {\n var argIndex = 0;\n var message = 'Warning: ' + format.replace(/%s/g, function () {\n return args[argIndex++];\n });\n\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n\n try {\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n }\n };\n}\n\nmodule.exports = warning;","import React from \"react\";\nimport styles from \"./styles.module.scss\";\nimport cls from \"classnames\";\n\nclass Field extends React.Component {\n render() {\n const { prepend, append, label, error, children } = this.props;\n\n return (\n \n {label && }\n
\n );\n }\n },\n requestedEndDate: {\n width: 200,\n value: r => get(r, \"nextTenancy.requestedEndDate\"),\n flexGrow: 0,\n label: attr(\"requested_end_date\"),\n format: shortDate,\n sort: \"nextTenantRequestedEndDate\"\n },\n intervalAmount: {\n width: 95,\n value: r => get(r, \"nextTenancy.intervalAmount\"),\n label: attr(\"interval_amount\"),\n format: number,\n sort: \"nextTenantIntervalAmount\"\n },\n depositAmount: {\n width: 95,\n value: r => get(r, \"nextTenancy.depositAmount\"),\n label: attr(\"deposit_amount\"),\n format: number,\n sort: \"nextTenantDepositAmount\"\n },\n depositDueDate: {\n width: 200,\n value: r => get(r, \"nextTenancy.depositDueDate\"),\n flexGrow: 0,\n label: attr(\"deposit_due_date\"),\n format: shortDate,\n sort: \"nextTenantDepositDueDate\"\n },\n heatingAmount: {\n format: number,\n width: 95,\n value: r => get(r, \"nextTenancy.heatingAmount\"),\n label: attr(\"heating_amount\")\n },\n waterAmount: {\n format: number,\n width: 95,\n value: r => get(r, \"nextTenancy.waterAmount\"),\n label: attr(\"water_amount\")\n },\n electricityAmount: {\n format: number,\n width: 95,\n value: r => get(r, \"nextTenancy.electricityAmount\"),\n label: attr(\"electricity_amount\")\n },\n contract: {\n width: 180,\n value: r => get(r, \"nextTenancy.contractCase\"),\n format: (value, row) =>\n value ? (\n \n \n {value.stateText}\n \n ) : null\n }\n }\n },\n calendar: {\n modes: [\"calendar\"],\n locked: true,\n columns: {\n range: {\n width: 250,\n flexGrow: 1000,\n value: r => r.id,\n headerComponent: ({ columnData: { dates } }) => (\n \n ),\n component: ({ cellData, rowData, columnData }) => (\n \n \n \n )\n }\n }\n }\n};\n","import React from \"react\";\nimport get from \"lodash/get\";\nimport { model } from \"../../../utils/translations\";\nimport CalendarRow from \"../../calendar/Row\";\nimport CalendarHeader from \"../../calendar/Header\";\nimport CalendarPropertyEntries from \"../../calendar/PropertyEntries\";\n\nexport const PROPERTIES_COLUMNS = {\n property: {\n columns: {\n name: {\n width: 200,\n sort: \"name\",\n format: (value, row) => (\n {value}\n )\n },\n owner: { value: r => get(r, \"owner.name\") },\n administrator: { value: r => get(r, \"administrator.name\") },\n service: {\n width: 100,\n format: (value, row) =>\n value > 0 ? `${value} ${model(\"case\", { count: value })}` : null\n }\n }\n },\n calendar: {\n locked: true,\n columns: {\n range: {\n width: 250,\n flexGrow: 1000,\n value: r => r.id,\n headerComponent: ({ columnData: { dates } }) => (\n \n ),\n component: ({ cellData, rowData, columnData }) => (\n \n \n \n )\n }\n }\n }\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nif (process.env.NODE_ENV !== 'production') {\n var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol.for && Symbol.for('react.element') || 0xeac7;\n\n var isValidElement = function (object) {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n }; // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n\n\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n","// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = require('./_object-keys-internal');\nvar enumBugKeys = require('./_enum-bug-keys');\n\nmodule.exports = Object.keys || function keys(O) {\n return $keys(O, enumBugKeys);\n};\n","var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n","module.exports = true;\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nif (process.env.NODE_ENV !== 'production') {\n var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol.for && Symbol.for('react.element') || 0xeac7;\n\n var isValidElement = function (object) {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n }; // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n\n\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _constants = require('../constants');\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n 'default': obj\n };\n}\n\nexports['default'] = _propTypes2['default'].oneOf([_constants.ICON_BEFORE_POSITION, _constants.ICON_AFTER_POSITION]);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _constants = require('../constants');\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n 'default': obj\n };\n}\n\nexports['default'] = _propTypes2['default'].oneOf([_constants.INFO_POSITION_TOP, _constants.INFO_POSITION_BOTTOM, _constants.INFO_POSITION_BEFORE, _constants.INFO_POSITION_AFTER]);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports['default'] = isInclusivelyAfterDay;\n\nvar _moment = require('moment');\n\nvar _moment2 = _interopRequireDefault(_moment);\n\nvar _isBeforeDay = require('./isBeforeDay');\n\nvar _isBeforeDay2 = _interopRequireDefault(_isBeforeDay);\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n 'default': obj\n };\n}\n\nfunction isInclusivelyAfterDay(a, b) {\n if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false;\n return !(0, _isBeforeDay2['default'])(a, b);\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports['default'] = isBeforeDay;\n\nvar _moment = require('moment');\n\nvar _moment2 = _interopRequireDefault(_moment);\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n 'default': obj\n };\n}\n\nfunction isBeforeDay(a, b) {\n if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false;\n var aYear = a.year();\n var aMonth = a.month();\n var bYear = b.year();\n var bMonth = b.month();\n var isSameYear = aYear === bYear;\n var isSameMonth = aMonth === bMonth;\n if (isSameYear && isSameMonth) return a.date() < b.date();\n if (isSameYear) return aMonth < bMonth;\n return aYear < bYear;\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n 'default': obj\n };\n}\n\nvar CloseButton = function () {\n function CloseButton(props) {\n return _react2['default'].createElement('svg', props, _react2['default'].createElement('path', {\n fillRule: 'evenodd',\n d: 'M11.53.47a.75.75 0 0 0-1.061 0l-4.47 4.47L1.529.47A.75.75 0 1 0 .468 1.531l4.47 4.47-4.47 4.47a.75.75 0 1 0 1.061 1.061l4.47-4.47 4.47 4.47a.75.75 0 1 0 1.061-1.061l-4.47-4.47 4.47-4.47a.75.75 0 0 0 0-1.061z'\n }));\n }\n\n return CloseButton;\n}();\n\nCloseButton.defaultProps = {\n focusable: 'false',\n viewBox: '0 0 12 12'\n};\nexports['default'] = CloseButton;","// extracted by mini-css-extract-plugin\nmodule.exports = {\"ToggleCaseFlag\":\"styles-module__ToggleCaseFlag___eWfWL\"};","import React from \"react\";\nimport Modal from \"react-modal\";\nimport Icon from \"../elements/Icon\";\n\nconst modalStyles = {\n overlay: {\n zIndex: 100,\n background: \"rgba(0,0,0,0.5)\"\n },\n content: {\n border: 0,\n borderRadius: 0,\n padding: \"20px\",\n background: \"#f4f5f8\",\n boxShadow: \"0 5px 15px rgba(0, 0, 0, 0.5)\",\n position: \"relative\",\n width: \"90%\",\n top: \"10%\",\n left: \"auto\",\n right: \"auto\",\n marginLeft: \"auto\",\n marginRight: \"auto\"\n }\n};\n\nclass SimpleModal extends React.Component {\n render() {\n const { children, maxWidth, ...rest } = this.props;\n\n const styles = {\n overlay: { ...modalStyles.overlay },\n content: { ...modalStyles.content, maxWidth }\n };\n\n return (\n \n \n {children}\n \n );\n }\n}\n\nSimpleModal.defaultProps = {\n maxWidth: 500\n};\n\nexport default SimpleModal;\n","export function datesList(start, end) {\n const list = [];\n let curDate = moment(start);\n while (curDate.isSameOrBefore(end)) {\n list.push(curDate.toDate());\n curDate = curDate.add(1, \"day\");\n }\n return list;\n}\n","import gql from \"graphql-tag\";\n\nexport const APARTMENTS_QUERY = gql`\n query Apartments(\n $offset: Int\n $limit: Int\n $where: ApartmentWhereInput\n $orderBy: ApartmentOrderByEnum\n ) {\n result: apartments(\n offset: $offset\n limit: $limit\n where: $where\n orderBy: $orderBy\n ) {\n total\n records {\n id\n publicId\n address\n city\n postalCode\n key\n service: activeServiceCasesCount\n inactive\n inactiveStartDate\n inactiveEndDate\n inactiveDescription\n property {\n name\n owner {\n name\n }\n }\n previousTenancy {\n startDate\n endDate\n requestedEndDate\n intervalAmount\n intervalAmountType\n depositAmount\n depositDueDate\n heatingAmount\n waterAmount\n electricityAmount\n user {\n name\n email\n phone\n protected\n }\n expectedMovingInCases {\n type\n name\n icon\n }\n expectedMovingOutCases {\n type\n name\n icon\n }\n movingInCase {\n id\n icon\n attention\n children {\n id\n type\n shortName\n icon\n attention\n }\n }\n movingOutCase {\n id\n icon\n attention\n children {\n id\n type\n shortName\n icon\n attention\n }\n }\n contractCase {\n id\n icon\n attention\n stateText\n }\n }\n currentTenancy {\n startDate\n endDate\n requestedEndDate\n intervalAmount\n intervalAmountType\n depositAmount\n depositDueDate\n heatingAmount\n waterAmount\n electricityAmount\n user {\n name\n email\n phone\n protected\n }\n expectedMovingInCases {\n type\n name\n icon\n }\n expectedMovingOutCases {\n type\n name\n icon\n }\n movingInCase {\n id\n icon\n attention\n children {\n id\n type\n shortName\n icon\n attention\n }\n }\n movingOutCase {\n id\n icon\n attention\n children {\n id\n type\n shortName\n icon\n attention\n }\n }\n contractCase {\n id\n icon\n attention\n stateText\n }\n }\n nextTenancy {\n startDate\n endDate\n requestedEndDate\n intervalAmount\n intervalAmountType\n depositAmount\n depositDueDate\n heatingAmount\n waterAmount\n electricityAmount\n user {\n name\n email\n phone\n protected\n }\n expectedMovingInCases {\n type\n name\n icon\n }\n expectedMovingOutCases {\n type\n name\n icon\n }\n movingInCase {\n id\n icon\n attention\n children {\n id\n type\n shortName\n icon\n attention\n }\n }\n movingOutCase {\n id\n icon\n attention\n children {\n id\n type\n shortName\n icon\n attention\n }\n }\n contractCase {\n id\n icon\n attention\n stateText\n }\n }\n }\n }\n }\n`;\n","import React from \"react\";\nimport { shortTime, model } from \"../../../utils/translations\";\n\nexport const INTERESTED_COLUMNS = {\n entry: {\n label: false,\n columns: {\n name: {\n sort: \"name\",\n format: (value, row) => (\n {value}\n )\n },\n createdAt: {\n width: 130,\n sort: \"createdAt\",\n format: shortTime\n },\n email: {\n sort: \"email\"\n },\n phone: {\n width: 100,\n sort: \"phone\"\n },\n properties: {\n width: 300,\n format: val => (val ? val.map(v => v.name).join(\", \") : \"\")\n }\n }\n }\n};\n","var baseFlatten = require('./_baseFlatten');\n/**\n * Flattens `array` a single level deep.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, [3, [4]], 5]]);\n * // => [1, 2, [3, [4]], 5]\n */\n\n\nfunction flatten(array) {\n var length = array ? array.length : 0;\n return length ? baseFlatten(array, 1) : [];\n}\n\nmodule.exports = flatten;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nexports.default = function (recalc) {\n if (!size && size !== 0 || recalc) {\n if (_inDOM2.default) {\n var scrollDiv = document.createElement('div');\n scrollDiv.style.position = 'absolute';\n scrollDiv.style.top = '-9999px';\n scrollDiv.style.width = '50px';\n scrollDiv.style.height = '50px';\n scrollDiv.style.overflow = 'scroll';\n document.body.appendChild(scrollDiv);\n size = scrollDiv.offsetWidth - scrollDiv.clientWidth;\n document.body.removeChild(scrollDiv);\n }\n }\n\n return size;\n};\n\nvar _inDOM = require('./inDOM');\n\nvar _inDOM2 = _interopRequireDefault(_inDOM);\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nvar size = void 0;\nmodule.exports = exports['default'];","var isArray = require('./isArray');\n/**\n * Casts `value` as an array if it's not one.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Lang\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast array.\n * @example\n *\n * _.castArray(1);\n * // => [1]\n *\n * _.castArray({ 'a': 1 });\n * // => [{ 'a': 1 }]\n *\n * _.castArray('abc');\n * // => ['abc']\n *\n * _.castArray(null);\n * // => [null]\n *\n * _.castArray(undefined);\n * // => [undefined]\n *\n * _.castArray();\n * // => []\n *\n * var array = [1, 2, 3];\n * console.log(_.castArray(array) === array);\n * // => true\n */\n\n\nfunction castArray() {\n if (!arguments.length) {\n return [];\n }\n\n var value = arguments[0];\n return isArray(value) ? value : [value];\n}\n\nmodule.exports = castArray;","\"use strict\";\n\nexports.__esModule = true;\n\nvar _defineProperty = require(\"../core-js/object/define-property\");\n\nvar _defineProperty2 = _interopRequireDefault(_defineProperty);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (obj, key, value) {\n if (key in obj) {\n (0, _defineProperty2.default)(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n};","/*!\n * jQuery JavaScript Library v2.2.4\n * http://jquery.com/\n *\n * Includes Sizzle.js\n * http://sizzlejs.com/\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license\n * http://jquery.org/license\n *\n * Date: 2016-05-20T17:23Z\n */\n(function (global, factory) {\n if (typeof module === \"object\" && typeof module.exports === \"object\") {\n // For CommonJS and CommonJS-like environments where a proper `window`\n // is present, execute the factory and get jQuery.\n // For environments that do not have a `window` with a `document`\n // (such as Node.js), expose a factory as module.exports.\n // This accentuates the need for the creation of a real `window`.\n // e.g. var jQuery = require(\"jquery\")(window);\n // See ticket #14549 for more info.\n module.exports = global.document ? factory(global, true) : function (w) {\n if (!w.document) {\n throw new Error(\"jQuery requires a window with a document\");\n }\n\n return factory(w);\n };\n } else {\n factory(global);\n } // Pass this if window is not defined yet\n\n})(typeof window !== \"undefined\" ? window : this, function (window, noGlobal) {\n // Support: Firefox 18+\n // Can't be in strict mode, several libs including ASP.NET trace\n // the stack via arguments.caller.callee and Firefox dies if\n // you try to trace through \"use strict\" call chains. (#13335)\n //\"use strict\";\n var arr = [];\n var document = window.document;\n var slice = arr.slice;\n var concat = arr.concat;\n var push = arr.push;\n var indexOf = arr.indexOf;\n var class2type = {};\n var toString = class2type.toString;\n var hasOwn = class2type.hasOwnProperty;\n var support = {};\n\n var version = \"2.2.4\",\n // Define a local copy of jQuery\n jQuery = function (selector, context) {\n // The jQuery object is actually just the init constructor 'enhanced'\n // Need init if jQuery is called (just allow error to be thrown if not included)\n return new jQuery.fn.init(selector, context);\n },\n // Support: Android<4.1\n // Make sure we trim BOM and NBSP\n rtrim = /^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g,\n // Matches dashed string for camelizing\n rmsPrefix = /^-ms-/,\n rdashAlpha = /-([\\da-z])/gi,\n // Used by jQuery.camelCase as callback to replace()\n fcamelCase = function (all, letter) {\n return letter.toUpperCase();\n };\n\n jQuery.fn = jQuery.prototype = {\n // The current version of jQuery being used\n jquery: version,\n constructor: jQuery,\n // Start with an empty selector\n selector: \"\",\n // The default length of a jQuery object is 0\n length: 0,\n toArray: function () {\n return slice.call(this);\n },\n // Get the Nth element in the matched element set OR\n // Get the whole matched element set as a clean array\n get: function (num) {\n return num != null ? // Return just the one element from the set\n num < 0 ? this[num + this.length] : this[num] : // Return all the elements in a clean array\n slice.call(this);\n },\n // Take an array of elements and push it onto the stack\n // (returning the new matched element set)\n pushStack: function (elems) {\n // Build a new jQuery matched element set\n var ret = jQuery.merge(this.constructor(), elems); // Add the old object onto the stack (as a reference)\n\n ret.prevObject = this;\n ret.context = this.context; // Return the newly-formed element set\n\n return ret;\n },\n // Execute a callback for every element in the matched set.\n each: function (callback) {\n return jQuery.each(this, callback);\n },\n map: function (callback) {\n return this.pushStack(jQuery.map(this, function (elem, i) {\n return callback.call(elem, i, elem);\n }));\n },\n slice: function () {\n return this.pushStack(slice.apply(this, arguments));\n },\n first: function () {\n return this.eq(0);\n },\n last: function () {\n return this.eq(-1);\n },\n eq: function (i) {\n var len = this.length,\n j = +i + (i < 0 ? len : 0);\n return this.pushStack(j >= 0 && j < len ? [this[j]] : []);\n },\n end: function () {\n return this.prevObject || this.constructor();\n },\n // For internal use only.\n // Behaves like an Array's method, not like a jQuery method.\n push: push,\n sort: arr.sort,\n splice: arr.splice\n };\n\n jQuery.extend = jQuery.fn.extend = function () {\n var options,\n name,\n src,\n copy,\n copyIsArray,\n clone,\n target = arguments[0] || {},\n i = 1,\n length = arguments.length,\n deep = false; // Handle a deep copy situation\n\n if (typeof target === \"boolean\") {\n deep = target; // Skip the boolean and the target\n\n target = arguments[i] || {};\n i++;\n } // Handle case when target is a string or something (possible in deep copy)\n\n\n if (typeof target !== \"object\" && !jQuery.isFunction(target)) {\n target = {};\n } // Extend jQuery itself if only one argument is passed\n\n\n if (i === length) {\n target = this;\n i--;\n }\n\n for (; i < length; i++) {\n // Only deal with non-null/undefined values\n if ((options = arguments[i]) != null) {\n // Extend the base object\n for (name in options) {\n src = target[name];\n copy = options[name]; // Prevent never-ending loop\n\n if (target === copy) {\n continue;\n } // Recurse if we're merging plain objects or arrays\n\n\n if (deep && copy && (jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)))) {\n if (copyIsArray) {\n copyIsArray = false;\n clone = src && jQuery.isArray(src) ? src : [];\n } else {\n clone = src && jQuery.isPlainObject(src) ? src : {};\n } // Never move original objects, clone them\n\n\n target[name] = jQuery.extend(deep, clone, copy); // Don't bring in undefined values\n } else if (copy !== undefined) {\n target[name] = copy;\n }\n }\n }\n } // Return the modified object\n\n\n return target;\n };\n\n jQuery.extend({\n // Unique for each copy of jQuery on the page\n expando: \"jQuery\" + (version + Math.random()).replace(/\\D/g, \"\"),\n // Assume jQuery is ready without the ready module\n isReady: true,\n error: function (msg) {\n throw new Error(msg);\n },\n noop: function () {},\n isFunction: function (obj) {\n return jQuery.type(obj) === \"function\";\n },\n isArray: Array.isArray,\n isWindow: function (obj) {\n return obj != null && obj === obj.window;\n },\n isNumeric: function (obj) {\n // parseFloat NaNs numeric-cast false positives (null|true|false|\"\")\n // ...but misinterprets leading-number strings, particularly hex literals (\"0x...\")\n // subtraction forces infinities to NaN\n // adding 1 corrects loss of precision from parseFloat (#15100)\n var realStringObj = obj && obj.toString();\n return !jQuery.isArray(obj) && realStringObj - parseFloat(realStringObj) + 1 >= 0;\n },\n isPlainObject: function (obj) {\n var key; // Not plain objects:\n // - Any object or value whose internal [[Class]] property is not \"[object Object]\"\n // - DOM nodes\n // - window\n\n if (jQuery.type(obj) !== \"object\" || obj.nodeType || jQuery.isWindow(obj)) {\n return false;\n } // Not own constructor property must be Object\n\n\n if (obj.constructor && !hasOwn.call(obj, \"constructor\") && !hasOwn.call(obj.constructor.prototype || {}, \"isPrototypeOf\")) {\n return false;\n } // Own properties are enumerated firstly, so to speed up,\n // if last one is own, then all properties are own\n\n\n for (key in obj) {}\n\n return key === undefined || hasOwn.call(obj, key);\n },\n isEmptyObject: function (obj) {\n var name;\n\n for (name in obj) {\n return false;\n }\n\n return true;\n },\n type: function (obj) {\n if (obj == null) {\n return obj + \"\";\n } // Support: Android<4.0, iOS<6 (functionish RegExp)\n\n\n return typeof obj === \"object\" || typeof obj === \"function\" ? class2type[toString.call(obj)] || \"object\" : typeof obj;\n },\n // Evaluates a script in a global context\n globalEval: function (code) {\n var script,\n indirect = eval;\n code = jQuery.trim(code);\n\n if (code) {\n // If the code includes a valid, prologue position\n // strict mode pragma, execute code by injecting a\n // script tag into the document.\n if (code.indexOf(\"use strict\") === 1) {\n script = document.createElement(\"script\");\n script.text = code;\n document.head.appendChild(script).parentNode.removeChild(script);\n } else {\n // Otherwise, avoid the DOM node creation, insertion\n // and removal by using an indirect global eval\n indirect(code);\n }\n }\n },\n // Convert dashed to camelCase; used by the css and data modules\n // Support: IE9-11+\n // Microsoft forgot to hump their vendor prefix (#9572)\n camelCase: function (string) {\n return string.replace(rmsPrefix, \"ms-\").replace(rdashAlpha, fcamelCase);\n },\n nodeName: function (elem, name) {\n return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();\n },\n each: function (obj, callback) {\n var length,\n i = 0;\n\n if (isArrayLike(obj)) {\n length = obj.length;\n\n for (; i < length; i++) {\n if (callback.call(obj[i], i, obj[i]) === false) {\n break;\n }\n }\n } else {\n for (i in obj) {\n if (callback.call(obj[i], i, obj[i]) === false) {\n break;\n }\n }\n }\n\n return obj;\n },\n // Support: Android<4.1\n trim: function (text) {\n return text == null ? \"\" : (text + \"\").replace(rtrim, \"\");\n },\n // results is for internal usage only\n makeArray: function (arr, results) {\n var ret = results || [];\n\n if (arr != null) {\n if (isArrayLike(Object(arr))) {\n jQuery.merge(ret, typeof arr === \"string\" ? [arr] : arr);\n } else {\n push.call(ret, arr);\n }\n }\n\n return ret;\n },\n inArray: function (elem, arr, i) {\n return arr == null ? -1 : indexOf.call(arr, elem, i);\n },\n merge: function (first, second) {\n var len = +second.length,\n j = 0,\n i = first.length;\n\n for (; j < len; j++) {\n first[i++] = second[j];\n }\n\n first.length = i;\n return first;\n },\n grep: function (elems, callback, invert) {\n var callbackInverse,\n matches = [],\n i = 0,\n length = elems.length,\n callbackExpect = !invert; // Go through the array, only saving the items\n // that pass the validator function\n\n for (; i < length; i++) {\n callbackInverse = !callback(elems[i], i);\n\n if (callbackInverse !== callbackExpect) {\n matches.push(elems[i]);\n }\n }\n\n return matches;\n },\n // arg is for internal usage only\n map: function (elems, callback, arg) {\n var length,\n value,\n i = 0,\n ret = []; // Go through the array, translating each of the items to their new values\n\n if (isArrayLike(elems)) {\n length = elems.length;\n\n for (; i < length; i++) {\n value = callback(elems[i], i, arg);\n\n if (value != null) {\n ret.push(value);\n }\n } // Go through every key on the object,\n\n } else {\n for (i in elems) {\n value = callback(elems[i], i, arg);\n\n if (value != null) {\n ret.push(value);\n }\n }\n } // Flatten any nested arrays\n\n\n return concat.apply([], ret);\n },\n // A global GUID counter for objects\n guid: 1,\n // Bind a function to a context, optionally partially applying any\n // arguments.\n proxy: function (fn, context) {\n var tmp, args, proxy;\n\n if (typeof context === \"string\") {\n tmp = fn[context];\n context = fn;\n fn = tmp;\n } // Quick check to determine if target is callable, in the spec\n // this throws a TypeError, but we will just return undefined.\n\n\n if (!jQuery.isFunction(fn)) {\n return undefined;\n } // Simulated bind\n\n\n args = slice.call(arguments, 2);\n\n proxy = function () {\n return fn.apply(context || this, args.concat(slice.call(arguments)));\n }; // Set the guid of unique handler to the same of original handler, so it can be removed\n\n\n proxy.guid = fn.guid = fn.guid || jQuery.guid++;\n return proxy;\n },\n now: Date.now,\n // jQuery.support is not used in Core but other projects attach their\n // properties to it so it needs to exist.\n support: support\n }); // JSHint would error on this code due to the Symbol not being defined in ES5.\n // Defining this global in .jshintrc would create a danger of using the global\n // unguarded in another place, it seems safer to just disable JSHint for these\n // three lines.\n\n /* jshint ignore: start */\n\n if (typeof Symbol === \"function\") {\n jQuery.fn[Symbol.iterator] = arr[Symbol.iterator];\n }\n /* jshint ignore: end */\n // Populate the class2type map\n\n\n jQuery.each(\"Boolean Number String Function Array Date RegExp Object Error Symbol\".split(\" \"), function (i, name) {\n class2type[\"[object \" + name + \"]\"] = name.toLowerCase();\n });\n\n function isArrayLike(obj) {\n // Support: iOS 8.2 (not reproducible in simulator)\n // `in` check used to prevent JIT error (gh-2145)\n // hasOwn isn't used here due to false negatives\n // regarding Nodelist length in IE\n var length = !!obj && \"length\" in obj && obj.length,\n type = jQuery.type(obj);\n\n if (type === \"function\" || jQuery.isWindow(obj)) {\n return false;\n }\n\n return type === \"array\" || length === 0 || typeof length === \"number\" && length > 0 && length - 1 in obj;\n }\n\n var Sizzle =\n /*!\n * Sizzle CSS Selector Engine v2.2.1\n * http://sizzlejs.com/\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license\n * http://jquery.org/license\n *\n * Date: 2015-10-17\n */\n function (window) {\n var i,\n support,\n Expr,\n getText,\n isXML,\n tokenize,\n compile,\n select,\n outermostContext,\n sortInput,\n hasDuplicate,\n // Local document vars\n setDocument,\n document,\n docElem,\n documentIsHTML,\n rbuggyQSA,\n rbuggyMatches,\n matches,\n contains,\n // Instance-specific data\n expando = \"sizzle\" + 1 * new Date(),\n preferredDoc = window.document,\n dirruns = 0,\n done = 0,\n classCache = createCache(),\n tokenCache = createCache(),\n compilerCache = createCache(),\n sortOrder = function (a, b) {\n if (a === b) {\n hasDuplicate = true;\n }\n\n return 0;\n },\n // General-purpose constants\n MAX_NEGATIVE = 1 << 31,\n // Instance methods\n hasOwn = {}.hasOwnProperty,\n arr = [],\n pop = arr.pop,\n push_native = arr.push,\n push = arr.push,\n slice = arr.slice,\n // Use a stripped-down indexOf as it's faster than native\n // http://jsperf.com/thor-indexof-vs-for/5\n indexOf = function (list, elem) {\n var i = 0,\n len = list.length;\n\n for (; i < len; i++) {\n if (list[i] === elem) {\n return i;\n }\n }\n\n return -1;\n },\n booleans = \"checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped\",\n // Regular expressions\n // http://www.w3.org/TR/css3-selectors/#whitespace\n whitespace = \"[\\\\x20\\\\t\\\\r\\\\n\\\\f]\",\n // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier\n identifier = \"(?:\\\\\\\\.|[\\\\w-]|[^\\\\x00-\\\\xa0])+\",\n // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors\n attributes = \"\\\\[\" + whitespace + \"*(\" + identifier + \")(?:\" + whitespace + // Operator (capture 2)\n \"*([*^$|!~]?=)\" + whitespace + // \"Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]\"\n \"*(?:'((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\"|(\" + identifier + \"))|)\" + whitespace + \"*\\\\]\",\n pseudos = \":(\" + identifier + \")(?:\\\\((\" + // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:\n // 1. quoted (capture 3; capture 4 or capture 5)\n \"('((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\")|\" + // 2. simple (capture 6)\n \"((?:\\\\\\\\.|[^\\\\\\\\()[\\\\]]|\" + attributes + \")*)|\" + // 3. anything else (capture 2)\n \".*\" + \")\\\\)|)\",\n // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter\n rwhitespace = new RegExp(whitespace + \"+\", \"g\"),\n rtrim = new RegExp(\"^\" + whitespace + \"+|((?:^|[^\\\\\\\\])(?:\\\\\\\\.)*)\" + whitespace + \"+$\", \"g\"),\n rcomma = new RegExp(\"^\" + whitespace + \"*,\" + whitespace + \"*\"),\n rcombinators = new RegExp(\"^\" + whitespace + \"*([>+~]|\" + whitespace + \")\" + whitespace + \"*\"),\n rattributeQuotes = new RegExp(\"=\" + whitespace + \"*([^\\\\]'\\\"]*?)\" + whitespace + \"*\\\\]\", \"g\"),\n rpseudo = new RegExp(pseudos),\n ridentifier = new RegExp(\"^\" + identifier + \"$\"),\n matchExpr = {\n \"ID\": new RegExp(\"^#(\" + identifier + \")\"),\n \"CLASS\": new RegExp(\"^\\\\.(\" + identifier + \")\"),\n \"TAG\": new RegExp(\"^(\" + identifier + \"|[*])\"),\n \"ATTR\": new RegExp(\"^\" + attributes),\n \"PSEUDO\": new RegExp(\"^\" + pseudos),\n \"CHILD\": new RegExp(\"^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\\\(\" + whitespace + \"*(even|odd|(([+-]|)(\\\\d*)n|)\" + whitespace + \"*(?:([+-]|)\" + whitespace + \"*(\\\\d+)|))\" + whitespace + \"*\\\\)|)\", \"i\"),\n \"bool\": new RegExp(\"^(?:\" + booleans + \")$\", \"i\"),\n // For use in libraries implementing .is()\n // We use this for POS matching in `select`\n \"needsContext\": new RegExp(\"^\" + whitespace + \"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\\\(\" + whitespace + \"*((?:-\\\\d)?\\\\d*)\" + whitespace + \"*\\\\)|)(?=[^-]|$)\", \"i\")\n },\n rinputs = /^(?:input|select|textarea|button)$/i,\n rheader = /^h\\d$/i,\n rnative = /^[^{]+\\{\\s*\\[native \\w/,\n // Easily-parseable/retrievable ID or TAG or CLASS selectors\n rquickExpr = /^(?:#([\\w-]+)|(\\w+)|\\.([\\w-]+))$/,\n rsibling = /[+~]/,\n rescape = /'|\\\\/g,\n // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters\n runescape = new RegExp(\"\\\\\\\\([\\\\da-f]{1,6}\" + whitespace + \"?|(\" + whitespace + \")|.)\", \"ig\"),\n funescape = function (_, escaped, escapedWhitespace) {\n var high = \"0x\" + escaped - 0x10000; // NaN means non-codepoint\n // Support: Firefox<24\n // Workaround erroneous numeric interpretation of +\"0x\"\n\n return high !== high || escapedWhitespace ? escaped : high < 0 ? // BMP codepoint\n String.fromCharCode(high + 0x10000) : // Supplemental Plane codepoint (surrogate pair)\n String.fromCharCode(high >> 10 | 0xD800, high & 0x3FF | 0xDC00);\n },\n // Used for iframes\n // See setDocument()\n // Removing the function wrapper causes a \"Permission Denied\"\n // error in IE\n unloadHandler = function () {\n setDocument();\n }; // Optimize for push.apply( _, NodeList )\n\n\n try {\n push.apply(arr = slice.call(preferredDoc.childNodes), preferredDoc.childNodes); // Support: Android<4.0\n // Detect silently failing push.apply\n\n arr[preferredDoc.childNodes.length].nodeType;\n } catch (e) {\n push = {\n apply: arr.length ? // Leverage slice if possible\n function (target, els) {\n push_native.apply(target, slice.call(els));\n } : // Support: IE<9\n // Otherwise append directly\n function (target, els) {\n var j = target.length,\n i = 0; // Can't trust NodeList.length\n\n while (target[j++] = els[i++]) {}\n\n target.length = j - 1;\n }\n };\n }\n\n function Sizzle(selector, context, results, seed) {\n var m,\n i,\n elem,\n nid,\n nidselect,\n match,\n groups,\n newSelector,\n newContext = context && context.ownerDocument,\n // nodeType defaults to 9, since context defaults to document\n nodeType = context ? context.nodeType : 9;\n results = results || []; // Return early from calls with invalid selector or context\n\n if (typeof selector !== \"string\" || !selector || nodeType !== 1 && nodeType !== 9 && nodeType !== 11) {\n return results;\n } // Try to shortcut find operations (as opposed to filters) in HTML documents\n\n\n if (!seed) {\n if ((context ? context.ownerDocument || context : preferredDoc) !== document) {\n setDocument(context);\n }\n\n context = context || document;\n\n if (documentIsHTML) {\n // If the selector is sufficiently simple, try using a \"get*By*\" DOM method\n // (excepting DocumentFragment context, where the methods don't exist)\n if (nodeType !== 11 && (match = rquickExpr.exec(selector))) {\n // ID selector\n if (m = match[1]) {\n // Document context\n if (nodeType === 9) {\n if (elem = context.getElementById(m)) {\n // Support: IE, Opera, Webkit\n // TODO: identify versions\n // getElementById can match elements by name instead of ID\n if (elem.id === m) {\n results.push(elem);\n return results;\n }\n } else {\n return results;\n } // Element context\n\n } else {\n // Support: IE, Opera, Webkit\n // TODO: identify versions\n // getElementById can match elements by name instead of ID\n if (newContext && (elem = newContext.getElementById(m)) && contains(context, elem) && elem.id === m) {\n results.push(elem);\n return results;\n }\n } // Type selector\n\n } else if (match[2]) {\n push.apply(results, context.getElementsByTagName(selector));\n return results; // Class selector\n } else if ((m = match[3]) && support.getElementsByClassName && context.getElementsByClassName) {\n push.apply(results, context.getElementsByClassName(m));\n return results;\n }\n } // Take advantage of querySelectorAll\n\n\n if (support.qsa && !compilerCache[selector + \" \"] && (!rbuggyQSA || !rbuggyQSA.test(selector))) {\n if (nodeType !== 1) {\n newContext = context;\n newSelector = selector; // qSA looks outside Element context, which is not what we want\n // Thanks to Andrew Dupont for this workaround technique\n // Support: IE <=8\n // Exclude object elements\n } else if (context.nodeName.toLowerCase() !== \"object\") {\n // Capture the context ID, setting it first if necessary\n if (nid = context.getAttribute(\"id\")) {\n nid = nid.replace(rescape, \"\\\\$&\");\n } else {\n context.setAttribute(\"id\", nid = expando);\n } // Prefix every selector in the list\n\n\n groups = tokenize(selector);\n i = groups.length;\n nidselect = ridentifier.test(nid) ? \"#\" + nid : \"[id='\" + nid + \"']\";\n\n while (i--) {\n groups[i] = nidselect + \" \" + toSelector(groups[i]);\n }\n\n newSelector = groups.join(\",\"); // Expand context for sibling selectors\n\n newContext = rsibling.test(selector) && testContext(context.parentNode) || context;\n }\n\n if (newSelector) {\n try {\n push.apply(results, newContext.querySelectorAll(newSelector));\n return results;\n } catch (qsaError) {} finally {\n if (nid === expando) {\n context.removeAttribute(\"id\");\n }\n }\n }\n }\n }\n } // All others\n\n\n return select(selector.replace(rtrim, \"$1\"), context, results, seed);\n }\n /**\n * Create key-value caches of limited size\n * @returns {function(string, object)} Returns the Object data after storing it on itself with\n *\tproperty name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)\n *\tdeleting the oldest entry\n */\n\n\n function createCache() {\n var keys = [];\n\n function cache(key, value) {\n // Use (key + \" \") to avoid collision with native prototype properties (see Issue #157)\n if (keys.push(key + \" \") > Expr.cacheLength) {\n // Only keep the most recent entries\n delete cache[keys.shift()];\n }\n\n return cache[key + \" \"] = value;\n }\n\n return cache;\n }\n /**\n * Mark a function for special use by Sizzle\n * @param {Function} fn The function to mark\n */\n\n\n function markFunction(fn) {\n fn[expando] = true;\n return fn;\n }\n /**\n * Support testing using an element\n * @param {Function} fn Passed the created div and expects a boolean result\n */\n\n\n function assert(fn) {\n var div = document.createElement(\"div\");\n\n try {\n return !!fn(div);\n } catch (e) {\n return false;\n } finally {\n // Remove from its parent by default\n if (div.parentNode) {\n div.parentNode.removeChild(div);\n } // release memory in IE\n\n\n div = null;\n }\n }\n /**\n * Adds the same handler for all of the specified attrs\n * @param {String} attrs Pipe-separated list of attributes\n * @param {Function} handler The method that will be applied\n */\n\n\n function addHandle(attrs, handler) {\n var arr = attrs.split(\"|\"),\n i = arr.length;\n\n while (i--) {\n Expr.attrHandle[arr[i]] = handler;\n }\n }\n /**\n * Checks document order of two siblings\n * @param {Element} a\n * @param {Element} b\n * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b\n */\n\n\n function siblingCheck(a, b) {\n var cur = b && a,\n diff = cur && a.nodeType === 1 && b.nodeType === 1 && (~b.sourceIndex || MAX_NEGATIVE) - (~a.sourceIndex || MAX_NEGATIVE); // Use IE sourceIndex if available on both nodes\n\n if (diff) {\n return diff;\n } // Check if b follows a\n\n\n if (cur) {\n while (cur = cur.nextSibling) {\n if (cur === b) {\n return -1;\n }\n }\n }\n\n return a ? 1 : -1;\n }\n /**\n * Returns a function to use in pseudos for input types\n * @param {String} type\n */\n\n\n function createInputPseudo(type) {\n return function (elem) {\n var name = elem.nodeName.toLowerCase();\n return name === \"input\" && elem.type === type;\n };\n }\n /**\n * Returns a function to use in pseudos for buttons\n * @param {String} type\n */\n\n\n function createButtonPseudo(type) {\n return function (elem) {\n var name = elem.nodeName.toLowerCase();\n return (name === \"input\" || name === \"button\") && elem.type === type;\n };\n }\n /**\n * Returns a function to use in pseudos for positionals\n * @param {Function} fn\n */\n\n\n function createPositionalPseudo(fn) {\n return markFunction(function (argument) {\n argument = +argument;\n return markFunction(function (seed, matches) {\n var j,\n matchIndexes = fn([], seed.length, argument),\n i = matchIndexes.length; // Match elements found at the specified indexes\n\n while (i--) {\n if (seed[j = matchIndexes[i]]) {\n seed[j] = !(matches[j] = seed[j]);\n }\n }\n });\n });\n }\n /**\n * Checks a node for validity as a Sizzle context\n * @param {Element|Object=} context\n * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value\n */\n\n\n function testContext(context) {\n return context && typeof context.getElementsByTagName !== \"undefined\" && context;\n } // Expose support vars for convenience\n\n\n support = Sizzle.support = {};\n /**\n * Detects XML nodes\n * @param {Element|Object} elem An element or a document\n * @returns {Boolean} True iff elem is a non-HTML XML node\n */\n\n isXML = Sizzle.isXML = function (elem) {\n // documentElement is verified for cases where it doesn't yet exist\n // (such as loading iframes in IE - #4833)\n var documentElement = elem && (elem.ownerDocument || elem).documentElement;\n return documentElement ? documentElement.nodeName !== \"HTML\" : false;\n };\n /**\n * Sets document-related variables once based on the current document\n * @param {Element|Object} [doc] An element or document object to use to set the document\n * @returns {Object} Returns the current document\n */\n\n\n setDocument = Sizzle.setDocument = function (node) {\n var hasCompare,\n parent,\n doc = node ? node.ownerDocument || node : preferredDoc; // Return early if doc is invalid or already selected\n\n if (doc === document || doc.nodeType !== 9 || !doc.documentElement) {\n return document;\n } // Update global variables\n\n\n document = doc;\n docElem = document.documentElement;\n documentIsHTML = !isXML(document); // Support: IE 9-11, Edge\n // Accessing iframe documents after unload throws \"permission denied\" errors (jQuery #13936)\n\n if ((parent = document.defaultView) && parent.top !== parent) {\n // Support: IE 11\n if (parent.addEventListener) {\n parent.addEventListener(\"unload\", unloadHandler, false); // Support: IE 9 - 10 only\n } else if (parent.attachEvent) {\n parent.attachEvent(\"onunload\", unloadHandler);\n }\n }\n /* Attributes\n ---------------------------------------------------------------------- */\n // Support: IE<8\n // Verify that getAttribute really returns attributes and not properties\n // (excepting IE8 booleans)\n\n\n support.attributes = assert(function (div) {\n div.className = \"i\";\n return !div.getAttribute(\"className\");\n });\n /* getElement(s)By*\n ---------------------------------------------------------------------- */\n // Check if getElementsByTagName(\"*\") returns only elements\n\n support.getElementsByTagName = assert(function (div) {\n div.appendChild(document.createComment(\"\"));\n return !div.getElementsByTagName(\"*\").length;\n }); // Support: IE<9\n\n support.getElementsByClassName = rnative.test(document.getElementsByClassName); // Support: IE<10\n // Check if getElementById returns elements by name\n // The broken getElementById methods don't pick up programatically-set names,\n // so use a roundabout getElementsByName test\n\n support.getById = assert(function (div) {\n docElem.appendChild(div).id = expando;\n return !document.getElementsByName || !document.getElementsByName(expando).length;\n }); // ID find and filter\n\n if (support.getById) {\n Expr.find[\"ID\"] = function (id, context) {\n if (typeof context.getElementById !== \"undefined\" && documentIsHTML) {\n var m = context.getElementById(id);\n return m ? [m] : [];\n }\n };\n\n Expr.filter[\"ID\"] = function (id) {\n var attrId = id.replace(runescape, funescape);\n return function (elem) {\n return elem.getAttribute(\"id\") === attrId;\n };\n };\n } else {\n // Support: IE6/7\n // getElementById is not reliable as a find shortcut\n delete Expr.find[\"ID\"];\n\n Expr.filter[\"ID\"] = function (id) {\n var attrId = id.replace(runescape, funescape);\n return function (elem) {\n var node = typeof elem.getAttributeNode !== \"undefined\" && elem.getAttributeNode(\"id\");\n return node && node.value === attrId;\n };\n };\n } // Tag\n\n\n Expr.find[\"TAG\"] = support.getElementsByTagName ? function (tag, context) {\n if (typeof context.getElementsByTagName !== \"undefined\") {\n return context.getElementsByTagName(tag); // DocumentFragment nodes don't have gEBTN\n } else if (support.qsa) {\n return context.querySelectorAll(tag);\n }\n } : function (tag, context) {\n var elem,\n tmp = [],\n i = 0,\n // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too\n results = context.getElementsByTagName(tag); // Filter out possible comments\n\n if (tag === \"*\") {\n while (elem = results[i++]) {\n if (elem.nodeType === 1) {\n tmp.push(elem);\n }\n }\n\n return tmp;\n }\n\n return results;\n }; // Class\n\n Expr.find[\"CLASS\"] = support.getElementsByClassName && function (className, context) {\n if (typeof context.getElementsByClassName !== \"undefined\" && documentIsHTML) {\n return context.getElementsByClassName(className);\n }\n };\n /* QSA/matchesSelector\n ---------------------------------------------------------------------- */\n // QSA and matchesSelector support\n // matchesSelector(:active) reports false when true (IE9/Opera 11.5)\n\n\n rbuggyMatches = []; // qSa(:focus) reports false when true (Chrome 21)\n // We allow this because of a bug in IE8/9 that throws an error\n // whenever `document.activeElement` is accessed on an iframe\n // So, we allow :focus to pass through QSA all the time to avoid the IE error\n // See http://bugs.jquery.com/ticket/13378\n\n rbuggyQSA = [];\n\n if (support.qsa = rnative.test(document.querySelectorAll)) {\n // Build QSA regex\n // Regex strategy adopted from Diego Perini\n assert(function (div) {\n // Select is set to empty string on purpose\n // This is to test IE's treatment of not explicitly\n // setting a boolean content attribute,\n // since its presence should be enough\n // http://bugs.jquery.com/ticket/12359\n docElem.appendChild(div).innerHTML = \"\" + \"\"; // Support: IE8, Opera 11-12.16\n // Nothing should be selected when empty strings follow ^= or $= or *=\n // The test attribute must be unknown in Opera but \"safe\" for WinRT\n // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section\n\n if (div.querySelectorAll(\"[msallowcapture^='']\").length) {\n rbuggyQSA.push(\"[*^$]=\" + whitespace + \"*(?:''|\\\"\\\")\");\n } // Support: IE8\n // Boolean attributes and \"value\" are not treated correctly\n\n\n if (!div.querySelectorAll(\"[selected]\").length) {\n rbuggyQSA.push(\"\\\\[\" + whitespace + \"*(?:value|\" + booleans + \")\");\n } // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+\n\n\n if (!div.querySelectorAll(\"[id~=\" + expando + \"-]\").length) {\n rbuggyQSA.push(\"~=\");\n } // Webkit/Opera - :checked should return selected option elements\n // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n // IE8 throws error here and will not see later tests\n\n\n if (!div.querySelectorAll(\":checked\").length) {\n rbuggyQSA.push(\":checked\");\n } // Support: Safari 8+, iOS 8+\n // https://bugs.webkit.org/show_bug.cgi?id=136851\n // In-page `selector#id sibing-combinator selector` fails\n\n\n if (!div.querySelectorAll(\"a#\" + expando + \"+*\").length) {\n rbuggyQSA.push(\".#.+[+~]\");\n }\n });\n assert(function (div) {\n // Support: Windows 8 Native Apps\n // The type and name attributes are restricted during .innerHTML assignment\n var input = document.createElement(\"input\");\n input.setAttribute(\"type\", \"hidden\");\n div.appendChild(input).setAttribute(\"name\", \"D\"); // Support: IE8\n // Enforce case-sensitivity of name attribute\n\n if (div.querySelectorAll(\"[name=d]\").length) {\n rbuggyQSA.push(\"name\" + whitespace + \"*[*^$|!~]?=\");\n } // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)\n // IE8 throws error here and will not see later tests\n\n\n if (!div.querySelectorAll(\":enabled\").length) {\n rbuggyQSA.push(\":enabled\", \":disabled\");\n } // Opera 10-11 does not throw on post-comma invalid pseudos\n\n\n div.querySelectorAll(\"*,:x\");\n rbuggyQSA.push(\",.*:\");\n });\n }\n\n if (support.matchesSelector = rnative.test(matches = docElem.matches || docElem.webkitMatchesSelector || docElem.mozMatchesSelector || docElem.oMatchesSelector || docElem.msMatchesSelector)) {\n assert(function (div) {\n // Check to see if it's possible to do matchesSelector\n // on a disconnected node (IE 9)\n support.disconnectedMatch = matches.call(div, \"div\"); // This should fail with an exception\n // Gecko does not error, returns false instead\n\n matches.call(div, \"[s!='']:x\");\n rbuggyMatches.push(\"!=\", pseudos);\n });\n }\n\n rbuggyQSA = rbuggyQSA.length && new RegExp(rbuggyQSA.join(\"|\"));\n rbuggyMatches = rbuggyMatches.length && new RegExp(rbuggyMatches.join(\"|\"));\n /* Contains\n ---------------------------------------------------------------------- */\n\n hasCompare = rnative.test(docElem.compareDocumentPosition); // Element contains another\n // Purposefully self-exclusive\n // As in, an element does not contain itself\n\n contains = hasCompare || rnative.test(docElem.contains) ? function (a, b) {\n var adown = a.nodeType === 9 ? a.documentElement : a,\n bup = b && b.parentNode;\n return a === bup || !!(bup && bup.nodeType === 1 && (adown.contains ? adown.contains(bup) : a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16));\n } : function (a, b) {\n if (b) {\n while (b = b.parentNode) {\n if (b === a) {\n return true;\n }\n }\n }\n\n return false;\n };\n /* Sorting\n ---------------------------------------------------------------------- */\n // Document order sorting\n\n sortOrder = hasCompare ? function (a, b) {\n // Flag for duplicate removal\n if (a === b) {\n hasDuplicate = true;\n return 0;\n } // Sort on method existence if only one input has compareDocumentPosition\n\n\n var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;\n\n if (compare) {\n return compare;\n } // Calculate position if both inputs belong to the same document\n\n\n compare = (a.ownerDocument || a) === (b.ownerDocument || b) ? a.compareDocumentPosition(b) : // Otherwise we know they are disconnected\n 1; // Disconnected nodes\n\n if (compare & 1 || !support.sortDetached && b.compareDocumentPosition(a) === compare) {\n // Choose the first element that is related to our preferred document\n if (a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a)) {\n return -1;\n }\n\n if (b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b)) {\n return 1;\n } // Maintain original order\n\n\n return sortInput ? indexOf(sortInput, a) - indexOf(sortInput, b) : 0;\n }\n\n return compare & 4 ? -1 : 1;\n } : function (a, b) {\n // Exit early if the nodes are identical\n if (a === b) {\n hasDuplicate = true;\n return 0;\n }\n\n var cur,\n i = 0,\n aup = a.parentNode,\n bup = b.parentNode,\n ap = [a],\n bp = [b]; // Parentless nodes are either documents or disconnected\n\n if (!aup || !bup) {\n return a === document ? -1 : b === document ? 1 : aup ? -1 : bup ? 1 : sortInput ? indexOf(sortInput, a) - indexOf(sortInput, b) : 0; // If the nodes are siblings, we can do a quick check\n } else if (aup === bup) {\n return siblingCheck(a, b);\n } // Otherwise we need full lists of their ancestors for comparison\n\n\n cur = a;\n\n while (cur = cur.parentNode) {\n ap.unshift(cur);\n }\n\n cur = b;\n\n while (cur = cur.parentNode) {\n bp.unshift(cur);\n } // Walk down the tree looking for a discrepancy\n\n\n while (ap[i] === bp[i]) {\n i++;\n }\n\n return i ? // Do a sibling check if the nodes have a common ancestor\n siblingCheck(ap[i], bp[i]) : // Otherwise nodes in our document sort first\n ap[i] === preferredDoc ? -1 : bp[i] === preferredDoc ? 1 : 0;\n };\n return document;\n };\n\n Sizzle.matches = function (expr, elements) {\n return Sizzle(expr, null, null, elements);\n };\n\n Sizzle.matchesSelector = function (elem, expr) {\n // Set document vars if needed\n if ((elem.ownerDocument || elem) !== document) {\n setDocument(elem);\n } // Make sure that attribute selectors are quoted\n\n\n expr = expr.replace(rattributeQuotes, \"='$1']\");\n\n if (support.matchesSelector && documentIsHTML && !compilerCache[expr + \" \"] && (!rbuggyMatches || !rbuggyMatches.test(expr)) && (!rbuggyQSA || !rbuggyQSA.test(expr))) {\n try {\n var ret = matches.call(elem, expr); // IE 9's matchesSelector returns false on disconnected nodes\n\n if (ret || support.disconnectedMatch || // As well, disconnected nodes are said to be in a document\n // fragment in IE 9\n elem.document && elem.document.nodeType !== 11) {\n return ret;\n }\n } catch (e) {}\n }\n\n return Sizzle(expr, document, null, [elem]).length > 0;\n };\n\n Sizzle.contains = function (context, elem) {\n // Set document vars if needed\n if ((context.ownerDocument || context) !== document) {\n setDocument(context);\n }\n\n return contains(context, elem);\n };\n\n Sizzle.attr = function (elem, name) {\n // Set document vars if needed\n if ((elem.ownerDocument || elem) !== document) {\n setDocument(elem);\n }\n\n var fn = Expr.attrHandle[name.toLowerCase()],\n // Don't get fooled by Object.prototype properties (jQuery #13807)\n val = fn && hasOwn.call(Expr.attrHandle, name.toLowerCase()) ? fn(elem, name, !documentIsHTML) : undefined;\n return val !== undefined ? val : support.attributes || !documentIsHTML ? elem.getAttribute(name) : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null;\n };\n\n Sizzle.error = function (msg) {\n throw new Error(\"Syntax error, unrecognized expression: \" + msg);\n };\n /**\n * Document sorting and removing duplicates\n * @param {ArrayLike} results\n */\n\n\n Sizzle.uniqueSort = function (results) {\n var elem,\n duplicates = [],\n j = 0,\n i = 0; // Unless we *know* we can detect duplicates, assume their presence\n\n hasDuplicate = !support.detectDuplicates;\n sortInput = !support.sortStable && results.slice(0);\n results.sort(sortOrder);\n\n if (hasDuplicate) {\n while (elem = results[i++]) {\n if (elem === results[i]) {\n j = duplicates.push(i);\n }\n }\n\n while (j--) {\n results.splice(duplicates[j], 1);\n }\n } // Clear input after sorting to release objects\n // See https://github.com/jquery/sizzle/pull/225\n\n\n sortInput = null;\n return results;\n };\n /**\n * Utility function for retrieving the text value of an array of DOM nodes\n * @param {Array|Element} elem\n */\n\n\n getText = Sizzle.getText = function (elem) {\n var node,\n ret = \"\",\n i = 0,\n nodeType = elem.nodeType;\n\n if (!nodeType) {\n // If no nodeType, this is expected to be an array\n while (node = elem[i++]) {\n // Do not traverse comment nodes\n ret += getText(node);\n }\n } else if (nodeType === 1 || nodeType === 9 || nodeType === 11) {\n // Use textContent for elements\n // innerText usage removed for consistency of new lines (jQuery #11153)\n if (typeof elem.textContent === \"string\") {\n return elem.textContent;\n } else {\n // Traverse its children\n for (elem = elem.firstChild; elem; elem = elem.nextSibling) {\n ret += getText(elem);\n }\n }\n } else if (nodeType === 3 || nodeType === 4) {\n return elem.nodeValue;\n } // Do not include comment or processing instruction nodes\n\n\n return ret;\n };\n\n Expr = Sizzle.selectors = {\n // Can be adjusted by the user\n cacheLength: 50,\n createPseudo: markFunction,\n match: matchExpr,\n attrHandle: {},\n find: {},\n relative: {\n \">\": {\n dir: \"parentNode\",\n first: true\n },\n \" \": {\n dir: \"parentNode\"\n },\n \"+\": {\n dir: \"previousSibling\",\n first: true\n },\n \"~\": {\n dir: \"previousSibling\"\n }\n },\n preFilter: {\n \"ATTR\": function (match) {\n match[1] = match[1].replace(runescape, funescape); // Move the given value to match[3] whether quoted or unquoted\n\n match[3] = (match[3] || match[4] || match[5] || \"\").replace(runescape, funescape);\n\n if (match[2] === \"~=\") {\n match[3] = \" \" + match[3] + \" \";\n }\n\n return match.slice(0, 4);\n },\n \"CHILD\": function (match) {\n /* matches from matchExpr[\"CHILD\"]\n \t1 type (only|nth|...)\n \t2 what (child|of-type)\n \t3 argument (even|odd|\\d*|\\d*n([+-]\\d+)?|...)\n \t4 xn-component of xn+y argument ([+-]?\\d*n|)\n \t5 sign of xn-component\n \t6 x of xn-component\n \t7 sign of y-component\n \t8 y of y-component\n */\n match[1] = match[1].toLowerCase();\n\n if (match[1].slice(0, 3) === \"nth\") {\n // nth-* requires argument\n if (!match[3]) {\n Sizzle.error(match[0]);\n } // numeric x and y parameters for Expr.filter.CHILD\n // remember that false/true cast respectively to 0/1\n\n\n match[4] = +(match[4] ? match[5] + (match[6] || 1) : 2 * (match[3] === \"even\" || match[3] === \"odd\"));\n match[5] = +(match[7] + match[8] || match[3] === \"odd\"); // other types prohibit arguments\n } else if (match[3]) {\n Sizzle.error(match[0]);\n }\n\n return match;\n },\n \"PSEUDO\": function (match) {\n var excess,\n unquoted = !match[6] && match[2];\n\n if (matchExpr[\"CHILD\"].test(match[0])) {\n return null;\n } // Accept quoted arguments as-is\n\n\n if (match[3]) {\n match[2] = match[4] || match[5] || \"\"; // Strip excess characters from unquoted arguments\n } else if (unquoted && rpseudo.test(unquoted) && ( // Get excess from tokenize (recursively)\n excess = tokenize(unquoted, true)) && ( // advance to the next closing parenthesis\n excess = unquoted.indexOf(\")\", unquoted.length - excess) - unquoted.length)) {\n // excess is a negative index\n match[0] = match[0].slice(0, excess);\n match[2] = unquoted.slice(0, excess);\n } // Return only captures needed by the pseudo filter method (type and argument)\n\n\n return match.slice(0, 3);\n }\n },\n filter: {\n \"TAG\": function (nodeNameSelector) {\n var nodeName = nodeNameSelector.replace(runescape, funescape).toLowerCase();\n return nodeNameSelector === \"*\" ? function () {\n return true;\n } : function (elem) {\n return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;\n };\n },\n \"CLASS\": function (className) {\n var pattern = classCache[className + \" \"];\n return pattern || (pattern = new RegExp(\"(^|\" + whitespace + \")\" + className + \"(\" + whitespace + \"|$)\")) && classCache(className, function (elem) {\n return pattern.test(typeof elem.className === \"string\" && elem.className || typeof elem.getAttribute !== \"undefined\" && elem.getAttribute(\"class\") || \"\");\n });\n },\n \"ATTR\": function (name, operator, check) {\n return function (elem) {\n var result = Sizzle.attr(elem, name);\n\n if (result == null) {\n return operator === \"!=\";\n }\n\n if (!operator) {\n return true;\n }\n\n result += \"\";\n return operator === \"=\" ? result === check : operator === \"!=\" ? result !== check : operator === \"^=\" ? check && result.indexOf(check) === 0 : operator === \"*=\" ? check && result.indexOf(check) > -1 : operator === \"$=\" ? check && result.slice(-check.length) === check : operator === \"~=\" ? (\" \" + result.replace(rwhitespace, \" \") + \" \").indexOf(check) > -1 : operator === \"|=\" ? result === check || result.slice(0, check.length + 1) === check + \"-\" : false;\n };\n },\n \"CHILD\": function (type, what, argument, first, last) {\n var simple = type.slice(0, 3) !== \"nth\",\n forward = type.slice(-4) !== \"last\",\n ofType = what === \"of-type\";\n return first === 1 && last === 0 ? // Shortcut for :nth-*(n)\n function (elem) {\n return !!elem.parentNode;\n } : function (elem, context, xml) {\n var cache,\n uniqueCache,\n outerCache,\n node,\n nodeIndex,\n start,\n dir = simple !== forward ? \"nextSibling\" : \"previousSibling\",\n parent = elem.parentNode,\n name = ofType && elem.nodeName.toLowerCase(),\n useCache = !xml && !ofType,\n diff = false;\n\n if (parent) {\n // :(first|last|only)-(child|of-type)\n if (simple) {\n while (dir) {\n node = elem;\n\n while (node = node[dir]) {\n if (ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1) {\n return false;\n }\n } // Reverse direction for :only-* (if we haven't yet done so)\n\n\n start = dir = type === \"only\" && !start && \"nextSibling\";\n }\n\n return true;\n }\n\n start = [forward ? parent.firstChild : parent.lastChild]; // non-xml :nth-child(...) stores cache data on `parent`\n\n if (forward && useCache) {\n // Seek `elem` from a previously-cached index\n // ...in a gzip-friendly way\n node = parent;\n outerCache = node[expando] || (node[expando] = {}); // Support: IE <9 only\n // Defend against cloned attroperties (jQuery gh-1709)\n\n uniqueCache = outerCache[node.uniqueID] || (outerCache[node.uniqueID] = {});\n cache = uniqueCache[type] || [];\n nodeIndex = cache[0] === dirruns && cache[1];\n diff = nodeIndex && cache[2];\n node = nodeIndex && parent.childNodes[nodeIndex];\n\n while (node = ++nodeIndex && node && node[dir] || ( // Fallback to seeking `elem` from the start\n diff = nodeIndex = 0) || start.pop()) {\n // When found, cache indexes on `parent` and break\n if (node.nodeType === 1 && ++diff && node === elem) {\n uniqueCache[type] = [dirruns, nodeIndex, diff];\n break;\n }\n }\n } else {\n // Use previously-cached element index if available\n if (useCache) {\n // ...in a gzip-friendly way\n node = elem;\n outerCache = node[expando] || (node[expando] = {}); // Support: IE <9 only\n // Defend against cloned attroperties (jQuery gh-1709)\n\n uniqueCache = outerCache[node.uniqueID] || (outerCache[node.uniqueID] = {});\n cache = uniqueCache[type] || [];\n nodeIndex = cache[0] === dirruns && cache[1];\n diff = nodeIndex;\n } // xml :nth-child(...)\n // or :nth-last-child(...) or :nth(-last)?-of-type(...)\n\n\n if (diff === false) {\n // Use the same loop as above to seek `elem` from the start\n while (node = ++nodeIndex && node && node[dir] || (diff = nodeIndex = 0) || start.pop()) {\n if ((ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1) && ++diff) {\n // Cache the index of each encountered element\n if (useCache) {\n outerCache = node[expando] || (node[expando] = {}); // Support: IE <9 only\n // Defend against cloned attroperties (jQuery gh-1709)\n\n uniqueCache = outerCache[node.uniqueID] || (outerCache[node.uniqueID] = {});\n uniqueCache[type] = [dirruns, diff];\n }\n\n if (node === elem) {\n break;\n }\n }\n }\n }\n } // Incorporate the offset, then check against cycle size\n\n\n diff -= last;\n return diff === first || diff % first === 0 && diff / first >= 0;\n }\n };\n },\n \"PSEUDO\": function (pseudo, argument) {\n // pseudo-class names are case-insensitive\n // http://www.w3.org/TR/selectors/#pseudo-classes\n // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters\n // Remember that setFilters inherits from pseudos\n var args,\n fn = Expr.pseudos[pseudo] || Expr.setFilters[pseudo.toLowerCase()] || Sizzle.error(\"unsupported pseudo: \" + pseudo); // The user may use createPseudo to indicate that\n // arguments are needed to create the filter function\n // just as Sizzle does\n\n if (fn[expando]) {\n return fn(argument);\n } // But maintain support for old signatures\n\n\n if (fn.length > 1) {\n args = [pseudo, pseudo, \"\", argument];\n return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase()) ? markFunction(function (seed, matches) {\n var idx,\n matched = fn(seed, argument),\n i = matched.length;\n\n while (i--) {\n idx = indexOf(seed, matched[i]);\n seed[idx] = !(matches[idx] = matched[i]);\n }\n }) : function (elem) {\n return fn(elem, 0, args);\n };\n }\n\n return fn;\n }\n },\n pseudos: {\n // Potentially complex pseudos\n \"not\": markFunction(function (selector) {\n // Trim the selector passed to compile\n // to avoid treating leading and trailing\n // spaces as combinators\n var input = [],\n results = [],\n matcher = compile(selector.replace(rtrim, \"$1\"));\n return matcher[expando] ? markFunction(function (seed, matches, context, xml) {\n var elem,\n unmatched = matcher(seed, null, xml, []),\n i = seed.length; // Match elements unmatched by `matcher`\n\n while (i--) {\n if (elem = unmatched[i]) {\n seed[i] = !(matches[i] = elem);\n }\n }\n }) : function (elem, context, xml) {\n input[0] = elem;\n matcher(input, null, xml, results); // Don't keep the element (issue #299)\n\n input[0] = null;\n return !results.pop();\n };\n }),\n \"has\": markFunction(function (selector) {\n return function (elem) {\n return Sizzle(selector, elem).length > 0;\n };\n }),\n \"contains\": markFunction(function (text) {\n text = text.replace(runescape, funescape);\n return function (elem) {\n return (elem.textContent || elem.innerText || getText(elem)).indexOf(text) > -1;\n };\n }),\n // \"Whether an element is represented by a :lang() selector\n // is based solely on the element's language value\n // being equal to the identifier C,\n // or beginning with the identifier C immediately followed by \"-\".\n // The matching of C against the element's language value is performed case-insensitively.\n // The identifier C does not have to be a valid language name.\"\n // http://www.w3.org/TR/selectors/#lang-pseudo\n \"lang\": markFunction(function (lang) {\n // lang value must be a valid identifier\n if (!ridentifier.test(lang || \"\")) {\n Sizzle.error(\"unsupported lang: \" + lang);\n }\n\n lang = lang.replace(runescape, funescape).toLowerCase();\n return function (elem) {\n var elemLang;\n\n do {\n if (elemLang = documentIsHTML ? elem.lang : elem.getAttribute(\"xml:lang\") || elem.getAttribute(\"lang\")) {\n elemLang = elemLang.toLowerCase();\n return elemLang === lang || elemLang.indexOf(lang + \"-\") === 0;\n }\n } while ((elem = elem.parentNode) && elem.nodeType === 1);\n\n return false;\n };\n }),\n // Miscellaneous\n \"target\": function (elem) {\n var hash = window.location && window.location.hash;\n return hash && hash.slice(1) === elem.id;\n },\n \"root\": function (elem) {\n return elem === docElem;\n },\n \"focus\": function (elem) {\n return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);\n },\n // Boolean properties\n \"enabled\": function (elem) {\n return elem.disabled === false;\n },\n \"disabled\": function (elem) {\n return elem.disabled === true;\n },\n \"checked\": function (elem) {\n // In CSS3, :checked should return both checked and selected elements\n // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n var nodeName = elem.nodeName.toLowerCase();\n return nodeName === \"input\" && !!elem.checked || nodeName === \"option\" && !!elem.selected;\n },\n \"selected\": function (elem) {\n // Accessing this property makes selected-by-default\n // options in Safari work properly\n if (elem.parentNode) {\n elem.parentNode.selectedIndex;\n }\n\n return elem.selected === true;\n },\n // Contents\n \"empty\": function (elem) {\n // http://www.w3.org/TR/selectors/#empty-pseudo\n // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),\n // but not by others (comment: 8; processing instruction: 7; etc.)\n // nodeType < 6 works because attributes (2) do not appear as children\n for (elem = elem.firstChild; elem; elem = elem.nextSibling) {\n if (elem.nodeType < 6) {\n return false;\n }\n }\n\n return true;\n },\n \"parent\": function (elem) {\n return !Expr.pseudos[\"empty\"](elem);\n },\n // Element/input types\n \"header\": function (elem) {\n return rheader.test(elem.nodeName);\n },\n \"input\": function (elem) {\n return rinputs.test(elem.nodeName);\n },\n \"button\": function (elem) {\n var name = elem.nodeName.toLowerCase();\n return name === \"input\" && elem.type === \"button\" || name === \"button\";\n },\n \"text\": function (elem) {\n var attr;\n return elem.nodeName.toLowerCase() === \"input\" && elem.type === \"text\" && ( // Support: IE<8\n // New HTML5 attribute values (e.g., \"search\") appear with elem.type === \"text\"\n (attr = elem.getAttribute(\"type\")) == null || attr.toLowerCase() === \"text\");\n },\n // Position-in-collection\n \"first\": createPositionalPseudo(function () {\n return [0];\n }),\n \"last\": createPositionalPseudo(function (matchIndexes, length) {\n return [length - 1];\n }),\n \"eq\": createPositionalPseudo(function (matchIndexes, length, argument) {\n return [argument < 0 ? argument + length : argument];\n }),\n \"even\": createPositionalPseudo(function (matchIndexes, length) {\n var i = 0;\n\n for (; i < length; i += 2) {\n matchIndexes.push(i);\n }\n\n return matchIndexes;\n }),\n \"odd\": createPositionalPseudo(function (matchIndexes, length) {\n var i = 1;\n\n for (; i < length; i += 2) {\n matchIndexes.push(i);\n }\n\n return matchIndexes;\n }),\n \"lt\": createPositionalPseudo(function (matchIndexes, length, argument) {\n var i = argument < 0 ? argument + length : argument;\n\n for (; --i >= 0;) {\n matchIndexes.push(i);\n }\n\n return matchIndexes;\n }),\n \"gt\": createPositionalPseudo(function (matchIndexes, length, argument) {\n var i = argument < 0 ? argument + length : argument;\n\n for (; ++i < length;) {\n matchIndexes.push(i);\n }\n\n return matchIndexes;\n })\n }\n };\n Expr.pseudos[\"nth\"] = Expr.pseudos[\"eq\"]; // Add button/input type pseudos\n\n for (i in {\n radio: true,\n checkbox: true,\n file: true,\n password: true,\n image: true\n }) {\n Expr.pseudos[i] = createInputPseudo(i);\n }\n\n for (i in {\n submit: true,\n reset: true\n }) {\n Expr.pseudos[i] = createButtonPseudo(i);\n } // Easy API for creating new setFilters\n\n\n function setFilters() {}\n\n setFilters.prototype = Expr.filters = Expr.pseudos;\n Expr.setFilters = new setFilters();\n\n tokenize = Sizzle.tokenize = function (selector, parseOnly) {\n var matched,\n match,\n tokens,\n type,\n soFar,\n groups,\n preFilters,\n cached = tokenCache[selector + \" \"];\n\n if (cached) {\n return parseOnly ? 0 : cached.slice(0);\n }\n\n soFar = selector;\n groups = [];\n preFilters = Expr.preFilter;\n\n while (soFar) {\n // Comma and first run\n if (!matched || (match = rcomma.exec(soFar))) {\n if (match) {\n // Don't consume trailing commas as valid\n soFar = soFar.slice(match[0].length) || soFar;\n }\n\n groups.push(tokens = []);\n }\n\n matched = false; // Combinators\n\n if (match = rcombinators.exec(soFar)) {\n matched = match.shift();\n tokens.push({\n value: matched,\n // Cast descendant combinators to space\n type: match[0].replace(rtrim, \" \")\n });\n soFar = soFar.slice(matched.length);\n } // Filters\n\n\n for (type in Expr.filter) {\n if ((match = matchExpr[type].exec(soFar)) && (!preFilters[type] || (match = preFilters[type](match)))) {\n matched = match.shift();\n tokens.push({\n value: matched,\n type: type,\n matches: match\n });\n soFar = soFar.slice(matched.length);\n }\n }\n\n if (!matched) {\n break;\n }\n } // Return the length of the invalid excess\n // if we're just parsing\n // Otherwise, throw an error or return tokens\n\n\n return parseOnly ? soFar.length : soFar ? Sizzle.error(selector) : // Cache the tokens\n tokenCache(selector, groups).slice(0);\n };\n\n function toSelector(tokens) {\n var i = 0,\n len = tokens.length,\n selector = \"\";\n\n for (; i < len; i++) {\n selector += tokens[i].value;\n }\n\n return selector;\n }\n\n function addCombinator(matcher, combinator, base) {\n var dir = combinator.dir,\n checkNonElements = base && dir === \"parentNode\",\n doneName = done++;\n return combinator.first ? // Check against closest ancestor/preceding element\n function (elem, context, xml) {\n while (elem = elem[dir]) {\n if (elem.nodeType === 1 || checkNonElements) {\n return matcher(elem, context, xml);\n }\n }\n } : // Check against all ancestor/preceding elements\n function (elem, context, xml) {\n var oldCache,\n uniqueCache,\n outerCache,\n newCache = [dirruns, doneName]; // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching\n\n if (xml) {\n while (elem = elem[dir]) {\n if (elem.nodeType === 1 || checkNonElements) {\n if (matcher(elem, context, xml)) {\n return true;\n }\n }\n }\n } else {\n while (elem = elem[dir]) {\n if (elem.nodeType === 1 || checkNonElements) {\n outerCache = elem[expando] || (elem[expando] = {}); // Support: IE <9 only\n // Defend against cloned attroperties (jQuery gh-1709)\n\n uniqueCache = outerCache[elem.uniqueID] || (outerCache[elem.uniqueID] = {});\n\n if ((oldCache = uniqueCache[dir]) && oldCache[0] === dirruns && oldCache[1] === doneName) {\n // Assign to newCache so results back-propagate to previous elements\n return newCache[2] = oldCache[2];\n } else {\n // Reuse newcache so results back-propagate to previous elements\n uniqueCache[dir] = newCache; // A match means we're done; a fail means we have to keep checking\n\n if (newCache[2] = matcher(elem, context, xml)) {\n return true;\n }\n }\n }\n }\n }\n };\n }\n\n function elementMatcher(matchers) {\n return matchers.length > 1 ? function (elem, context, xml) {\n var i = matchers.length;\n\n while (i--) {\n if (!matchers[i](elem, context, xml)) {\n return false;\n }\n }\n\n return true;\n } : matchers[0];\n }\n\n function multipleContexts(selector, contexts, results) {\n var i = 0,\n len = contexts.length;\n\n for (; i < len; i++) {\n Sizzle(selector, contexts[i], results);\n }\n\n return results;\n }\n\n function condense(unmatched, map, filter, context, xml) {\n var elem,\n newUnmatched = [],\n i = 0,\n len = unmatched.length,\n mapped = map != null;\n\n for (; i < len; i++) {\n if (elem = unmatched[i]) {\n if (!filter || filter(elem, context, xml)) {\n newUnmatched.push(elem);\n\n if (mapped) {\n map.push(i);\n }\n }\n }\n }\n\n return newUnmatched;\n }\n\n function setMatcher(preFilter, selector, matcher, postFilter, postFinder, postSelector) {\n if (postFilter && !postFilter[expando]) {\n postFilter = setMatcher(postFilter);\n }\n\n if (postFinder && !postFinder[expando]) {\n postFinder = setMatcher(postFinder, postSelector);\n }\n\n return markFunction(function (seed, results, context, xml) {\n var temp,\n i,\n elem,\n preMap = [],\n postMap = [],\n preexisting = results.length,\n // Get initial elements from seed or context\n elems = seed || multipleContexts(selector || \"*\", context.nodeType ? [context] : context, []),\n // Prefilter to get matcher input, preserving a map for seed-results synchronization\n matcherIn = preFilter && (seed || !selector) ? condense(elems, preMap, preFilter, context, xml) : elems,\n matcherOut = matcher ? // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,\n postFinder || (seed ? preFilter : preexisting || postFilter) ? // ...intermediate processing is necessary\n [] : // ...otherwise use results directly\n results : matcherIn; // Find primary matches\n\n if (matcher) {\n matcher(matcherIn, matcherOut, context, xml);\n } // Apply postFilter\n\n\n if (postFilter) {\n temp = condense(matcherOut, postMap);\n postFilter(temp, [], context, xml); // Un-match failing elements by moving them back to matcherIn\n\n i = temp.length;\n\n while (i--) {\n if (elem = temp[i]) {\n matcherOut[postMap[i]] = !(matcherIn[postMap[i]] = elem);\n }\n }\n }\n\n if (seed) {\n if (postFinder || preFilter) {\n if (postFinder) {\n // Get the final matcherOut by condensing this intermediate into postFinder contexts\n temp = [];\n i = matcherOut.length;\n\n while (i--) {\n if (elem = matcherOut[i]) {\n // Restore matcherIn since elem is not yet a final match\n temp.push(matcherIn[i] = elem);\n }\n }\n\n postFinder(null, matcherOut = [], temp, xml);\n } // Move matched elements from seed to results to keep them synchronized\n\n\n i = matcherOut.length;\n\n while (i--) {\n if ((elem = matcherOut[i]) && (temp = postFinder ? indexOf(seed, elem) : preMap[i]) > -1) {\n seed[temp] = !(results[temp] = elem);\n }\n }\n } // Add elements to results, through postFinder if defined\n\n } else {\n matcherOut = condense(matcherOut === results ? matcherOut.splice(preexisting, matcherOut.length) : matcherOut);\n\n if (postFinder) {\n postFinder(null, results, matcherOut, xml);\n } else {\n push.apply(results, matcherOut);\n }\n }\n });\n }\n\n function matcherFromTokens(tokens) {\n var checkContext,\n matcher,\n j,\n len = tokens.length,\n leadingRelative = Expr.relative[tokens[0].type],\n implicitRelative = leadingRelative || Expr.relative[\" \"],\n i = leadingRelative ? 1 : 0,\n // The foundational matcher ensures that elements are reachable from top-level context(s)\n matchContext = addCombinator(function (elem) {\n return elem === checkContext;\n }, implicitRelative, true),\n matchAnyContext = addCombinator(function (elem) {\n return indexOf(checkContext, elem) > -1;\n }, implicitRelative, true),\n matchers = [function (elem, context, xml) {\n var ret = !leadingRelative && (xml || context !== outermostContext) || ((checkContext = context).nodeType ? matchContext(elem, context, xml) : matchAnyContext(elem, context, xml)); // Avoid hanging onto element (issue #299)\n\n checkContext = null;\n return ret;\n }];\n\n for (; i < len; i++) {\n if (matcher = Expr.relative[tokens[i].type]) {\n matchers = [addCombinator(elementMatcher(matchers), matcher)];\n } else {\n matcher = Expr.filter[tokens[i].type].apply(null, tokens[i].matches); // Return special upon seeing a positional matcher\n\n if (matcher[expando]) {\n // Find the next relative operator (if any) for proper handling\n j = ++i;\n\n for (; j < len; j++) {\n if (Expr.relative[tokens[j].type]) {\n break;\n }\n }\n\n return setMatcher(i > 1 && elementMatcher(matchers), i > 1 && toSelector( // If the preceding token was a descendant combinator, insert an implicit any-element `*`\n tokens.slice(0, i - 1).concat({\n value: tokens[i - 2].type === \" \" ? \"*\" : \"\"\n })).replace(rtrim, \"$1\"), matcher, i < j && matcherFromTokens(tokens.slice(i, j)), j < len && matcherFromTokens(tokens = tokens.slice(j)), j < len && toSelector(tokens));\n }\n\n matchers.push(matcher);\n }\n }\n\n return elementMatcher(matchers);\n }\n\n function matcherFromGroupMatchers(elementMatchers, setMatchers) {\n var bySet = setMatchers.length > 0,\n byElement = elementMatchers.length > 0,\n superMatcher = function (seed, context, xml, results, outermost) {\n var elem,\n j,\n matcher,\n matchedCount = 0,\n i = \"0\",\n unmatched = seed && [],\n setMatched = [],\n contextBackup = outermostContext,\n // We must always have either seed elements or outermost context\n elems = seed || byElement && Expr.find[\"TAG\"](\"*\", outermost),\n // Use integer dirruns iff this is the outermost matcher\n dirrunsUnique = dirruns += contextBackup == null ? 1 : Math.random() || 0.1,\n len = elems.length;\n\n if (outermost) {\n outermostContext = context === document || context || outermost;\n } // Add elements passing elementMatchers directly to results\n // Support: IE<9, Safari\n // Tolerate NodeList properties (IE: \"length\"; Safari: ) matching elements by id\n\n\n for (; i !== len && (elem = elems[i]) != null; i++) {\n if (byElement && elem) {\n j = 0;\n\n if (!context && elem.ownerDocument !== document) {\n setDocument(elem);\n xml = !documentIsHTML;\n }\n\n while (matcher = elementMatchers[j++]) {\n if (matcher(elem, context || document, xml)) {\n results.push(elem);\n break;\n }\n }\n\n if (outermost) {\n dirruns = dirrunsUnique;\n }\n } // Track unmatched elements for set filters\n\n\n if (bySet) {\n // They will have gone through all possible matchers\n if (elem = !matcher && elem) {\n matchedCount--;\n } // Lengthen the array for every element, matched or not\n\n\n if (seed) {\n unmatched.push(elem);\n }\n }\n } // `i` is now the count of elements visited above, and adding it to `matchedCount`\n // makes the latter nonnegative.\n\n\n matchedCount += i; // Apply set filters to unmatched elements\n // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`\n // equals `i`), unless we didn't visit _any_ elements in the above loop because we have\n // no element matchers and no seed.\n // Incrementing an initially-string \"0\" `i` allows `i` to remain a string only in that\n // case, which will result in a \"00\" `matchedCount` that differs from `i` but is also\n // numerically zero.\n\n if (bySet && i !== matchedCount) {\n j = 0;\n\n while (matcher = setMatchers[j++]) {\n matcher(unmatched, setMatched, context, xml);\n }\n\n if (seed) {\n // Reintegrate element matches to eliminate the need for sorting\n if (matchedCount > 0) {\n while (i--) {\n if (!(unmatched[i] || setMatched[i])) {\n setMatched[i] = pop.call(results);\n }\n }\n } // Discard index placeholder values to get only actual matches\n\n\n setMatched = condense(setMatched);\n } // Add matches to results\n\n\n push.apply(results, setMatched); // Seedless set matches succeeding multiple successful matchers stipulate sorting\n\n if (outermost && !seed && setMatched.length > 0 && matchedCount + setMatchers.length > 1) {\n Sizzle.uniqueSort(results);\n }\n } // Override manipulation of globals by nested matchers\n\n\n if (outermost) {\n dirruns = dirrunsUnique;\n outermostContext = contextBackup;\n }\n\n return unmatched;\n };\n\n return bySet ? markFunction(superMatcher) : superMatcher;\n }\n\n compile = Sizzle.compile = function (selector, match\n /* Internal Use Only */\n ) {\n var i,\n setMatchers = [],\n elementMatchers = [],\n cached = compilerCache[selector + \" \"];\n\n if (!cached) {\n // Generate a function of recursive functions that can be used to check each element\n if (!match) {\n match = tokenize(selector);\n }\n\n i = match.length;\n\n while (i--) {\n cached = matcherFromTokens(match[i]);\n\n if (cached[expando]) {\n setMatchers.push(cached);\n } else {\n elementMatchers.push(cached);\n }\n } // Cache the compiled function\n\n\n cached = compilerCache(selector, matcherFromGroupMatchers(elementMatchers, setMatchers)); // Save selector and tokenization\n\n cached.selector = selector;\n }\n\n return cached;\n };\n /**\n * A low-level selection function that works with Sizzle's compiled\n * selector functions\n * @param {String|Function} selector A selector or a pre-compiled\n * selector function built with Sizzle.compile\n * @param {Element} context\n * @param {Array} [results]\n * @param {Array} [seed] A set of elements to match against\n */\n\n\n select = Sizzle.select = function (selector, context, results, seed) {\n var i,\n tokens,\n token,\n type,\n find,\n compiled = typeof selector === \"function\" && selector,\n match = !seed && tokenize(selector = compiled.selector || selector);\n results = results || []; // Try to minimize operations if there is only one selector in the list and no seed\n // (the latter of which guarantees us context)\n\n if (match.length === 1) {\n // Reduce context if the leading compound selector is an ID\n tokens = match[0] = match[0].slice(0);\n\n if (tokens.length > 2 && (token = tokens[0]).type === \"ID\" && support.getById && context.nodeType === 9 && documentIsHTML && Expr.relative[tokens[1].type]) {\n context = (Expr.find[\"ID\"](token.matches[0].replace(runescape, funescape), context) || [])[0];\n\n if (!context) {\n return results; // Precompiled matchers will still verify ancestry, so step up a level\n } else if (compiled) {\n context = context.parentNode;\n }\n\n selector = selector.slice(tokens.shift().value.length);\n } // Fetch a seed set for right-to-left matching\n\n\n i = matchExpr[\"needsContext\"].test(selector) ? 0 : tokens.length;\n\n while (i--) {\n token = tokens[i]; // Abort if we hit a combinator\n\n if (Expr.relative[type = token.type]) {\n break;\n }\n\n if (find = Expr.find[type]) {\n // Search, expanding context for leading sibling combinators\n if (seed = find(token.matches[0].replace(runescape, funescape), rsibling.test(tokens[0].type) && testContext(context.parentNode) || context)) {\n // If seed is empty or no tokens remain, we can return early\n tokens.splice(i, 1);\n selector = seed.length && toSelector(tokens);\n\n if (!selector) {\n push.apply(results, seed);\n return results;\n }\n\n break;\n }\n }\n }\n } // Compile and execute a filtering function if one is not provided\n // Provide `match` to avoid retokenization if we modified the selector above\n\n\n (compiled || compile(selector, match))(seed, context, !documentIsHTML, results, !context || rsibling.test(selector) && testContext(context.parentNode) || context);\n return results;\n }; // One-time assignments\n // Sort stability\n\n\n support.sortStable = expando.split(\"\").sort(sortOrder).join(\"\") === expando; // Support: Chrome 14-35+\n // Always assume duplicates if they aren't passed to the comparison function\n\n support.detectDuplicates = !!hasDuplicate; // Initialize against the default document\n\n setDocument(); // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)\n // Detached nodes confoundingly follow *each other*\n\n support.sortDetached = assert(function (div1) {\n // Should return 1, but returns 4 (following)\n return div1.compareDocumentPosition(document.createElement(\"div\")) & 1;\n }); // Support: IE<8\n // Prevent attribute/property \"interpolation\"\n // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx\n\n if (!assert(function (div) {\n div.innerHTML = \"\";\n return div.firstChild.getAttribute(\"href\") === \"#\";\n })) {\n addHandle(\"type|href|height|width\", function (elem, name, isXML) {\n if (!isXML) {\n return elem.getAttribute(name, name.toLowerCase() === \"type\" ? 1 : 2);\n }\n });\n } // Support: IE<9\n // Use defaultValue in place of getAttribute(\"value\")\n\n\n if (!support.attributes || !assert(function (div) {\n div.innerHTML = \"\";\n div.firstChild.setAttribute(\"value\", \"\");\n return div.firstChild.getAttribute(\"value\") === \"\";\n })) {\n addHandle(\"value\", function (elem, name, isXML) {\n if (!isXML && elem.nodeName.toLowerCase() === \"input\") {\n return elem.defaultValue;\n }\n });\n } // Support: IE<9\n // Use getAttributeNode to fetch booleans when getAttribute lies\n\n\n if (!assert(function (div) {\n return div.getAttribute(\"disabled\") == null;\n })) {\n addHandle(booleans, function (elem, name, isXML) {\n var val;\n\n if (!isXML) {\n return elem[name] === true ? name.toLowerCase() : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null;\n }\n });\n }\n\n return Sizzle;\n }(window);\n\n jQuery.find = Sizzle;\n jQuery.expr = Sizzle.selectors;\n jQuery.expr[\":\"] = jQuery.expr.pseudos;\n jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;\n jQuery.text = Sizzle.getText;\n jQuery.isXMLDoc = Sizzle.isXML;\n jQuery.contains = Sizzle.contains;\n\n var dir = function (elem, dir, until) {\n var matched = [],\n truncate = until !== undefined;\n\n while ((elem = elem[dir]) && elem.nodeType !== 9) {\n if (elem.nodeType === 1) {\n if (truncate && jQuery(elem).is(until)) {\n break;\n }\n\n matched.push(elem);\n }\n }\n\n return matched;\n };\n\n var siblings = function (n, elem) {\n var matched = [];\n\n for (; n; n = n.nextSibling) {\n if (n.nodeType === 1 && n !== elem) {\n matched.push(n);\n }\n }\n\n return matched;\n };\n\n var rneedsContext = jQuery.expr.match.needsContext;\n var rsingleTag = /^<([\\w-]+)\\s*\\/?>(?:<\\/\\1>|)$/;\n var risSimple = /^.[^:#\\[\\.,]*$/; // Implement the identical functionality for filter and not\n\n function winnow(elements, qualifier, not) {\n if (jQuery.isFunction(qualifier)) {\n return jQuery.grep(elements, function (elem, i) {\n /* jshint -W018 */\n return !!qualifier.call(elem, i, elem) !== not;\n });\n }\n\n if (qualifier.nodeType) {\n return jQuery.grep(elements, function (elem) {\n return elem === qualifier !== not;\n });\n }\n\n if (typeof qualifier === \"string\") {\n if (risSimple.test(qualifier)) {\n return jQuery.filter(qualifier, elements, not);\n }\n\n qualifier = jQuery.filter(qualifier, elements);\n }\n\n return jQuery.grep(elements, function (elem) {\n return indexOf.call(qualifier, elem) > -1 !== not;\n });\n }\n\n jQuery.filter = function (expr, elems, not) {\n var elem = elems[0];\n\n if (not) {\n expr = \":not(\" + expr + \")\";\n }\n\n return elems.length === 1 && elem.nodeType === 1 ? jQuery.find.matchesSelector(elem, expr) ? [elem] : [] : jQuery.find.matches(expr, jQuery.grep(elems, function (elem) {\n return elem.nodeType === 1;\n }));\n };\n\n jQuery.fn.extend({\n find: function (selector) {\n var i,\n len = this.length,\n ret = [],\n self = this;\n\n if (typeof selector !== \"string\") {\n return this.pushStack(jQuery(selector).filter(function () {\n for (i = 0; i < len; i++) {\n if (jQuery.contains(self[i], this)) {\n return true;\n }\n }\n }));\n }\n\n for (i = 0; i < len; i++) {\n jQuery.find(selector, self[i], ret);\n } // Needed because $( selector, context ) becomes $( context ).find( selector )\n\n\n ret = this.pushStack(len > 1 ? jQuery.unique(ret) : ret);\n ret.selector = this.selector ? this.selector + \" \" + selector : selector;\n return ret;\n },\n filter: function (selector) {\n return this.pushStack(winnow(this, selector || [], false));\n },\n not: function (selector) {\n return this.pushStack(winnow(this, selector || [], true));\n },\n is: function (selector) {\n return !!winnow(this, // If this is a positional/relative selector, check membership in the returned set\n // so $(\"p:first\").is(\"p:last\") won't return true for a doc with two \"p\".\n typeof selector === \"string\" && rneedsContext.test(selector) ? jQuery(selector) : selector || [], false).length;\n }\n }); // Initialize a jQuery object\n // A central reference to the root jQuery(document)\n\n var rootjQuery,\n // A simple way to check for HTML strings\n // Prioritize #id over to avoid XSS via location.hash (#9521)\n // Strict HTML recognition (#11290: must start with <)\n rquickExpr = /^(?:\\s*(<[\\w\\W]+>)[^>]*|#([\\w-]*))$/,\n init = jQuery.fn.init = function (selector, context, root) {\n var match, elem; // HANDLE: $(\"\"), $(null), $(undefined), $(false)\n\n if (!selector) {\n return this;\n } // Method init() accepts an alternate rootjQuery\n // so migrate can support jQuery.sub (gh-2101)\n\n\n root = root || rootjQuery; // Handle HTML strings\n\n if (typeof selector === \"string\") {\n if (selector[0] === \"<\" && selector[selector.length - 1] === \">\" && selector.length >= 3) {\n // Assume that strings that start and end with <> are HTML and skip the regex check\n match = [null, selector, null];\n } else {\n match = rquickExpr.exec(selector);\n } // Match html or make sure no context is specified for #id\n\n\n if (match && (match[1] || !context)) {\n // HANDLE: $(html) -> $(array)\n if (match[1]) {\n context = context instanceof jQuery ? context[0] : context; // Option to run scripts is true for back-compat\n // Intentionally let the error be thrown if parseHTML is not present\n\n jQuery.merge(this, jQuery.parseHTML(match[1], context && context.nodeType ? context.ownerDocument || context : document, true)); // HANDLE: $(html, props)\n\n if (rsingleTag.test(match[1]) && jQuery.isPlainObject(context)) {\n for (match in context) {\n // Properties of context are called as methods if possible\n if (jQuery.isFunction(this[match])) {\n this[match](context[match]); // ...and otherwise set as attributes\n } else {\n this.attr(match, context[match]);\n }\n }\n }\n\n return this; // HANDLE: $(#id)\n } else {\n elem = document.getElementById(match[2]); // Support: Blackberry 4.6\n // gEBID returns nodes no longer in the document (#6963)\n\n if (elem && elem.parentNode) {\n // Inject the element directly into the jQuery object\n this.length = 1;\n this[0] = elem;\n }\n\n this.context = document;\n this.selector = selector;\n return this;\n } // HANDLE: $(expr, $(...))\n\n } else if (!context || context.jquery) {\n return (context || root).find(selector); // HANDLE: $(expr, context)\n // (which is just equivalent to: $(context).find(expr)\n } else {\n return this.constructor(context).find(selector);\n } // HANDLE: $(DOMElement)\n\n } else if (selector.nodeType) {\n this.context = this[0] = selector;\n this.length = 1;\n return this; // HANDLE: $(function)\n // Shortcut for document ready\n } else if (jQuery.isFunction(selector)) {\n return root.ready !== undefined ? root.ready(selector) : // Execute immediately if ready is not present\n selector(jQuery);\n }\n\n if (selector.selector !== undefined) {\n this.selector = selector.selector;\n this.context = selector.context;\n }\n\n return jQuery.makeArray(selector, this);\n }; // Give the init function the jQuery prototype for later instantiation\n\n\n init.prototype = jQuery.fn; // Initialize central reference\n\n rootjQuery = jQuery(document);\n var rparentsprev = /^(?:parents|prev(?:Until|All))/,\n // Methods guaranteed to produce a unique set when starting from a unique set\n guaranteedUnique = {\n children: true,\n contents: true,\n next: true,\n prev: true\n };\n jQuery.fn.extend({\n has: function (target) {\n var targets = jQuery(target, this),\n l = targets.length;\n return this.filter(function () {\n var i = 0;\n\n for (; i < l; i++) {\n if (jQuery.contains(this, targets[i])) {\n return true;\n }\n }\n });\n },\n closest: function (selectors, context) {\n var cur,\n i = 0,\n l = this.length,\n matched = [],\n pos = rneedsContext.test(selectors) || typeof selectors !== \"string\" ? jQuery(selectors, context || this.context) : 0;\n\n for (; i < l; i++) {\n for (cur = this[i]; cur && cur !== context; cur = cur.parentNode) {\n // Always skip document fragments\n if (cur.nodeType < 11 && (pos ? pos.index(cur) > -1 : // Don't pass non-elements to Sizzle\n cur.nodeType === 1 && jQuery.find.matchesSelector(cur, selectors))) {\n matched.push(cur);\n break;\n }\n }\n }\n\n return this.pushStack(matched.length > 1 ? jQuery.uniqueSort(matched) : matched);\n },\n // Determine the position of an element within the set\n index: function (elem) {\n // No argument, return index in parent\n if (!elem) {\n return this[0] && this[0].parentNode ? this.first().prevAll().length : -1;\n } // Index in selector\n\n\n if (typeof elem === \"string\") {\n return indexOf.call(jQuery(elem), this[0]);\n } // Locate the position of the desired element\n\n\n return indexOf.call(this, // If it receives a jQuery object, the first element is used\n elem.jquery ? elem[0] : elem);\n },\n add: function (selector, context) {\n return this.pushStack(jQuery.uniqueSort(jQuery.merge(this.get(), jQuery(selector, context))));\n },\n addBack: function (selector) {\n return this.add(selector == null ? this.prevObject : this.prevObject.filter(selector));\n }\n });\n\n function sibling(cur, dir) {\n while ((cur = cur[dir]) && cur.nodeType !== 1) {}\n\n return cur;\n }\n\n jQuery.each({\n parent: function (elem) {\n var parent = elem.parentNode;\n return parent && parent.nodeType !== 11 ? parent : null;\n },\n parents: function (elem) {\n return dir(elem, \"parentNode\");\n },\n parentsUntil: function (elem, i, until) {\n return dir(elem, \"parentNode\", until);\n },\n next: function (elem) {\n return sibling(elem, \"nextSibling\");\n },\n prev: function (elem) {\n return sibling(elem, \"previousSibling\");\n },\n nextAll: function (elem) {\n return dir(elem, \"nextSibling\");\n },\n prevAll: function (elem) {\n return dir(elem, \"previousSibling\");\n },\n nextUntil: function (elem, i, until) {\n return dir(elem, \"nextSibling\", until);\n },\n prevUntil: function (elem, i, until) {\n return dir(elem, \"previousSibling\", until);\n },\n siblings: function (elem) {\n return siblings((elem.parentNode || {}).firstChild, elem);\n },\n children: function (elem) {\n return siblings(elem.firstChild);\n },\n contents: function (elem) {\n return elem.contentDocument || jQuery.merge([], elem.childNodes);\n }\n }, function (name, fn) {\n jQuery.fn[name] = function (until, selector) {\n var matched = jQuery.map(this, fn, until);\n\n if (name.slice(-5) !== \"Until\") {\n selector = until;\n }\n\n if (selector && typeof selector === \"string\") {\n matched = jQuery.filter(selector, matched);\n }\n\n if (this.length > 1) {\n // Remove duplicates\n if (!guaranteedUnique[name]) {\n jQuery.uniqueSort(matched);\n } // Reverse order for parents* and prev-derivatives\n\n\n if (rparentsprev.test(name)) {\n matched.reverse();\n }\n }\n\n return this.pushStack(matched);\n };\n });\n var rnotwhite = /\\S+/g; // Convert String-formatted options into Object-formatted ones\n\n function createOptions(options) {\n var object = {};\n jQuery.each(options.match(rnotwhite) || [], function (_, flag) {\n object[flag] = true;\n });\n return object;\n }\n /*\n * Create a callback list using the following parameters:\n *\n *\toptions: an optional list of space-separated options that will change how\n *\t\t\tthe callback list behaves or a more traditional option object\n *\n * By default a callback list will act like an event callback list and can be\n * \"fired\" multiple times.\n *\n * Possible options:\n *\n *\tonce:\t\t\twill ensure the callback list can only be fired once (like a Deferred)\n *\n *\tmemory:\t\t\twill keep track of previous values and will call any callback added\n *\t\t\t\t\tafter the list has been fired right away with the latest \"memorized\"\n *\t\t\t\t\tvalues (like a Deferred)\n *\n *\tunique:\t\t\twill ensure a callback can only be added once (no duplicate in the list)\n *\n *\tstopOnFalse:\tinterrupt callings when a callback returns false\n *\n */\n\n\n jQuery.Callbacks = function (options) {\n // Convert options from String-formatted to Object-formatted if needed\n // (we check in cache first)\n options = typeof options === \"string\" ? createOptions(options) : jQuery.extend({}, options);\n\n var // Flag to know if list is currently firing\n firing,\n // Last fire value for non-forgettable lists\n memory,\n // Flag to know if list was already fired\n fired,\n // Flag to prevent firing\n locked,\n // Actual callback list\n list = [],\n // Queue of execution data for repeatable lists\n queue = [],\n // Index of currently firing callback (modified by add/remove as needed)\n firingIndex = -1,\n // Fire callbacks\n fire = function () {\n // Enforce single-firing\n locked = options.once; // Execute callbacks for all pending executions,\n // respecting firingIndex overrides and runtime changes\n\n fired = firing = true;\n\n for (; queue.length; firingIndex = -1) {\n memory = queue.shift();\n\n while (++firingIndex < list.length) {\n // Run callback and check for early termination\n if (list[firingIndex].apply(memory[0], memory[1]) === false && options.stopOnFalse) {\n // Jump to end and forget the data so .add doesn't re-fire\n firingIndex = list.length;\n memory = false;\n }\n }\n } // Forget the data if we're done with it\n\n\n if (!options.memory) {\n memory = false;\n }\n\n firing = false; // Clean up if we're done firing for good\n\n if (locked) {\n // Keep an empty list if we have data for future add calls\n if (memory) {\n list = []; // Otherwise, this object is spent\n } else {\n list = \"\";\n }\n }\n },\n // Actual Callbacks object\n self = {\n // Add a callback or a collection of callbacks to the list\n add: function () {\n if (list) {\n // If we have memory from a past run, we should fire after adding\n if (memory && !firing) {\n firingIndex = list.length - 1;\n queue.push(memory);\n }\n\n (function add(args) {\n jQuery.each(args, function (_, arg) {\n if (jQuery.isFunction(arg)) {\n if (!options.unique || !self.has(arg)) {\n list.push(arg);\n }\n } else if (arg && arg.length && jQuery.type(arg) !== \"string\") {\n // Inspect recursively\n add(arg);\n }\n });\n })(arguments);\n\n if (memory && !firing) {\n fire();\n }\n }\n\n return this;\n },\n // Remove a callback from the list\n remove: function () {\n jQuery.each(arguments, function (_, arg) {\n var index;\n\n while ((index = jQuery.inArray(arg, list, index)) > -1) {\n list.splice(index, 1); // Handle firing indexes\n\n if (index <= firingIndex) {\n firingIndex--;\n }\n }\n });\n return this;\n },\n // Check if a given callback is in the list.\n // If no argument is given, return whether or not list has callbacks attached.\n has: function (fn) {\n return fn ? jQuery.inArray(fn, list) > -1 : list.length > 0;\n },\n // Remove all callbacks from the list\n empty: function () {\n if (list) {\n list = [];\n }\n\n return this;\n },\n // Disable .fire and .add\n // Abort any current/pending executions\n // Clear all callbacks and values\n disable: function () {\n locked = queue = [];\n list = memory = \"\";\n return this;\n },\n disabled: function () {\n return !list;\n },\n // Disable .fire\n // Also disable .add unless we have memory (since it would have no effect)\n // Abort any pending executions\n lock: function () {\n locked = queue = [];\n\n if (!memory) {\n list = memory = \"\";\n }\n\n return this;\n },\n locked: function () {\n return !!locked;\n },\n // Call all callbacks with the given context and arguments\n fireWith: function (context, args) {\n if (!locked) {\n args = args || [];\n args = [context, args.slice ? args.slice() : args];\n queue.push(args);\n\n if (!firing) {\n fire();\n }\n }\n\n return this;\n },\n // Call all the callbacks with the given arguments\n fire: function () {\n self.fireWith(this, arguments);\n return this;\n },\n // To know if the callbacks have already been called at least once\n fired: function () {\n return !!fired;\n }\n };\n\n return self;\n };\n\n jQuery.extend({\n Deferred: function (func) {\n var tuples = [// action, add listener, listener list, final state\n [\"resolve\", \"done\", jQuery.Callbacks(\"once memory\"), \"resolved\"], [\"reject\", \"fail\", jQuery.Callbacks(\"once memory\"), \"rejected\"], [\"notify\", \"progress\", jQuery.Callbacks(\"memory\")]],\n state = \"pending\",\n promise = {\n state: function () {\n return state;\n },\n always: function () {\n deferred.done(arguments).fail(arguments);\n return this;\n },\n then: function\n /* fnDone, fnFail, fnProgress */\n () {\n var fns = arguments;\n return jQuery.Deferred(function (newDefer) {\n jQuery.each(tuples, function (i, tuple) {\n var fn = jQuery.isFunction(fns[i]) && fns[i]; // deferred[ done | fail | progress ] for forwarding actions to newDefer\n\n deferred[tuple[1]](function () {\n var returned = fn && fn.apply(this, arguments);\n\n if (returned && jQuery.isFunction(returned.promise)) {\n returned.promise().progress(newDefer.notify).done(newDefer.resolve).fail(newDefer.reject);\n } else {\n newDefer[tuple[0] + \"With\"](this === promise ? newDefer.promise() : this, fn ? [returned] : arguments);\n }\n });\n });\n fns = null;\n }).promise();\n },\n // Get a promise for this deferred\n // If obj is provided, the promise aspect is added to the object\n promise: function (obj) {\n return obj != null ? jQuery.extend(obj, promise) : promise;\n }\n },\n deferred = {}; // Keep pipe for back-compat\n\n promise.pipe = promise.then; // Add list-specific methods\n\n jQuery.each(tuples, function (i, tuple) {\n var list = tuple[2],\n stateString = tuple[3]; // promise[ done | fail | progress ] = list.add\n\n promise[tuple[1]] = list.add; // Handle state\n\n if (stateString) {\n list.add(function () {\n // state = [ resolved | rejected ]\n state = stateString; // [ reject_list | resolve_list ].disable; progress_list.lock\n }, tuples[i ^ 1][2].disable, tuples[2][2].lock);\n } // deferred[ resolve | reject | notify ]\n\n\n deferred[tuple[0]] = function () {\n deferred[tuple[0] + \"With\"](this === deferred ? promise : this, arguments);\n return this;\n };\n\n deferred[tuple[0] + \"With\"] = list.fireWith;\n }); // Make the deferred a promise\n\n promise.promise(deferred); // Call given func if any\n\n if (func) {\n func.call(deferred, deferred);\n } // All done!\n\n\n return deferred;\n },\n // Deferred helper\n when: function (subordinate\n /* , ..., subordinateN */\n ) {\n var i = 0,\n resolveValues = slice.call(arguments),\n length = resolveValues.length,\n // the count of uncompleted subordinates\n remaining = length !== 1 || subordinate && jQuery.isFunction(subordinate.promise) ? length : 0,\n // the master Deferred.\n // If resolveValues consist of only a single Deferred, just use that.\n deferred = remaining === 1 ? subordinate : jQuery.Deferred(),\n // Update function for both resolve and progress values\n updateFunc = function (i, contexts, values) {\n return function (value) {\n contexts[i] = this;\n values[i] = arguments.length > 1 ? slice.call(arguments) : value;\n\n if (values === progressValues) {\n deferred.notifyWith(contexts, values);\n } else if (! --remaining) {\n deferred.resolveWith(contexts, values);\n }\n };\n },\n progressValues,\n progressContexts,\n resolveContexts; // Add listeners to Deferred subordinates; treat others as resolved\n\n\n if (length > 1) {\n progressValues = new Array(length);\n progressContexts = new Array(length);\n resolveContexts = new Array(length);\n\n for (; i < length; i++) {\n if (resolveValues[i] && jQuery.isFunction(resolveValues[i].promise)) {\n resolveValues[i].promise().progress(updateFunc(i, progressContexts, progressValues)).done(updateFunc(i, resolveContexts, resolveValues)).fail(deferred.reject);\n } else {\n --remaining;\n }\n }\n } // If we're not waiting on anything, resolve the master\n\n\n if (!remaining) {\n deferred.resolveWith(resolveContexts, resolveValues);\n }\n\n return deferred.promise();\n }\n }); // The deferred used on DOM ready\n\n var readyList;\n\n jQuery.fn.ready = function (fn) {\n // Add the callback\n jQuery.ready.promise().done(fn);\n return this;\n };\n\n jQuery.extend({\n // Is the DOM ready to be used? Set to true once it occurs.\n isReady: false,\n // A counter to track how many items to wait for before\n // the ready event fires. See #6781\n readyWait: 1,\n // Hold (or release) the ready event\n holdReady: function (hold) {\n if (hold) {\n jQuery.readyWait++;\n } else {\n jQuery.ready(true);\n }\n },\n // Handle when the DOM is ready\n ready: function (wait) {\n // Abort if there are pending holds or we're already ready\n if (wait === true ? --jQuery.readyWait : jQuery.isReady) {\n return;\n } // Remember that the DOM is ready\n\n\n jQuery.isReady = true; // If a normal DOM Ready event fired, decrement, and wait if need be\n\n if (wait !== true && --jQuery.readyWait > 0) {\n return;\n } // If there are functions bound, to execute\n\n\n readyList.resolveWith(document, [jQuery]); // Trigger any bound ready events\n\n if (jQuery.fn.triggerHandler) {\n jQuery(document).triggerHandler(\"ready\");\n jQuery(document).off(\"ready\");\n }\n }\n });\n /**\n * The ready event handler and self cleanup method\n */\n\n function completed() {\n document.removeEventListener(\"DOMContentLoaded\", completed);\n window.removeEventListener(\"load\", completed);\n jQuery.ready();\n }\n\n jQuery.ready.promise = function (obj) {\n if (!readyList) {\n readyList = jQuery.Deferred(); // Catch cases where $(document).ready() is called\n // after the browser event has already occurred.\n // Support: IE9-10 only\n // Older IE sometimes signals \"interactive\" too soon\n\n if (document.readyState === \"complete\" || document.readyState !== \"loading\" && !document.documentElement.doScroll) {\n // Handle it asynchronously to allow scripts the opportunity to delay ready\n window.setTimeout(jQuery.ready);\n } else {\n // Use the handy event callback\n document.addEventListener(\"DOMContentLoaded\", completed); // A fallback to window.onload, that will always work\n\n window.addEventListener(\"load\", completed);\n }\n }\n\n return readyList.promise(obj);\n }; // Kick off the DOM ready check even if the user does not\n\n\n jQuery.ready.promise(); // Multifunctional method to get and set values of a collection\n // The value/s can optionally be executed if it's a function\n\n var access = function (elems, fn, key, value, chainable, emptyGet, raw) {\n var i = 0,\n len = elems.length,\n bulk = key == null; // Sets many values\n\n if (jQuery.type(key) === \"object\") {\n chainable = true;\n\n for (i in key) {\n access(elems, fn, i, key[i], true, emptyGet, raw);\n } // Sets one value\n\n } else if (value !== undefined) {\n chainable = true;\n\n if (!jQuery.isFunction(value)) {\n raw = true;\n }\n\n if (bulk) {\n // Bulk operations run against the entire set\n if (raw) {\n fn.call(elems, value);\n fn = null; // ...except when executing function values\n } else {\n bulk = fn;\n\n fn = function (elem, key, value) {\n return bulk.call(jQuery(elem), value);\n };\n }\n }\n\n if (fn) {\n for (; i < len; i++) {\n fn(elems[i], key, raw ? value : value.call(elems[i], i, fn(elems[i], key)));\n }\n }\n }\n\n return chainable ? elems : // Gets\n bulk ? fn.call(elems) : len ? fn(elems[0], key) : emptyGet;\n };\n\n var acceptData = function (owner) {\n // Accepts only:\n // - Node\n // - Node.ELEMENT_NODE\n // - Node.DOCUMENT_NODE\n // - Object\n // - Any\n\n /* jshint -W018 */\n return owner.nodeType === 1 || owner.nodeType === 9 || !+owner.nodeType;\n };\n\n function Data() {\n this.expando = jQuery.expando + Data.uid++;\n }\n\n Data.uid = 1;\n Data.prototype = {\n register: function (owner, initial) {\n var value = initial || {}; // If it is a node unlikely to be stringify-ed or looped over\n // use plain assignment\n\n if (owner.nodeType) {\n owner[this.expando] = value; // Otherwise secure it in a non-enumerable, non-writable property\n // configurability must be true to allow the property to be\n // deleted with the delete operator\n } else {\n Object.defineProperty(owner, this.expando, {\n value: value,\n writable: true,\n configurable: true\n });\n }\n\n return owner[this.expando];\n },\n cache: function (owner) {\n // We can accept data for non-element nodes in modern browsers,\n // but we should not, see #8335.\n // Always return an empty object.\n if (!acceptData(owner)) {\n return {};\n } // Check if the owner object already has a cache\n\n\n var value = owner[this.expando]; // If not, create one\n\n if (!value) {\n value = {}; // We can accept data for non-element nodes in modern browsers,\n // but we should not, see #8335.\n // Always return an empty object.\n\n if (acceptData(owner)) {\n // If it is a node unlikely to be stringify-ed or looped over\n // use plain assignment\n if (owner.nodeType) {\n owner[this.expando] = value; // Otherwise secure it in a non-enumerable property\n // configurable must be true to allow the property to be\n // deleted when data is removed\n } else {\n Object.defineProperty(owner, this.expando, {\n value: value,\n configurable: true\n });\n }\n }\n }\n\n return value;\n },\n set: function (owner, data, value) {\n var prop,\n cache = this.cache(owner); // Handle: [ owner, key, value ] args\n\n if (typeof data === \"string\") {\n cache[data] = value; // Handle: [ owner, { properties } ] args\n } else {\n // Copy the properties one-by-one to the cache object\n for (prop in data) {\n cache[prop] = data[prop];\n }\n }\n\n return cache;\n },\n get: function (owner, key) {\n return key === undefined ? this.cache(owner) : owner[this.expando] && owner[this.expando][key];\n },\n access: function (owner, key, value) {\n var stored; // In cases where either:\n //\n // 1. No key was specified\n // 2. A string key was specified, but no value provided\n //\n // Take the \"read\" path and allow the get method to determine\n // which value to return, respectively either:\n //\n // 1. The entire cache object\n // 2. The data stored at the key\n //\n\n if (key === undefined || key && typeof key === \"string\" && value === undefined) {\n stored = this.get(owner, key);\n return stored !== undefined ? stored : this.get(owner, jQuery.camelCase(key));\n } // When the key is not a string, or both a key and value\n // are specified, set or extend (existing objects) with either:\n //\n // 1. An object of properties\n // 2. A key and value\n //\n\n\n this.set(owner, key, value); // Since the \"set\" path can have two possible entry points\n // return the expected data based on which path was taken[*]\n\n return value !== undefined ? value : key;\n },\n remove: function (owner, key) {\n var i,\n name,\n camel,\n cache = owner[this.expando];\n\n if (cache === undefined) {\n return;\n }\n\n if (key === undefined) {\n this.register(owner);\n } else {\n // Support array or space separated string of keys\n if (jQuery.isArray(key)) {\n // If \"name\" is an array of keys...\n // When data is initially created, via (\"key\", \"val\") signature,\n // keys will be converted to camelCase.\n // Since there is no way to tell _how_ a key was added, remove\n // both plain key and camelCase key. #12786\n // This will only penalize the array argument path.\n name = key.concat(key.map(jQuery.camelCase));\n } else {\n camel = jQuery.camelCase(key); // Try the string as a key before any manipulation\n\n if (key in cache) {\n name = [key, camel];\n } else {\n // If a key with the spaces exists, use it.\n // Otherwise, create an array by matching non-whitespace\n name = camel;\n name = name in cache ? [name] : name.match(rnotwhite) || [];\n }\n }\n\n i = name.length;\n\n while (i--) {\n delete cache[name[i]];\n }\n } // Remove the expando if there's no more data\n\n\n if (key === undefined || jQuery.isEmptyObject(cache)) {\n // Support: Chrome <= 35-45+\n // Webkit & Blink performance suffers when deleting properties\n // from DOM nodes, so set to undefined instead\n // https://code.google.com/p/chromium/issues/detail?id=378607\n if (owner.nodeType) {\n owner[this.expando] = undefined;\n } else {\n delete owner[this.expando];\n }\n }\n },\n hasData: function (owner) {\n var cache = owner[this.expando];\n return cache !== undefined && !jQuery.isEmptyObject(cache);\n }\n };\n var dataPriv = new Data();\n var dataUser = new Data(); //\tImplementation Summary\n //\n //\t1. Enforce API surface and semantic compatibility with 1.9.x branch\n //\t2. Improve the module's maintainability by reducing the storage\n //\t\tpaths to a single mechanism.\n //\t3. Use the same single mechanism to support \"private\" and \"user\" data.\n //\t4. _Never_ expose \"private\" data to user code (TODO: Drop _data, _removeData)\n //\t5. Avoid exposing implementation details on user objects (eg. expando properties)\n //\t6. Provide a clear path for implementation upgrade to WeakMap in 2014\n\n var rbrace = /^(?:\\{[\\w\\W]*\\}|\\[[\\w\\W]*\\])$/,\n rmultiDash = /[A-Z]/g;\n\n function dataAttr(elem, key, data) {\n var name; // If nothing was found internally, try to fetch any\n // data from the HTML5 data-* attribute\n\n if (data === undefined && elem.nodeType === 1) {\n name = \"data-\" + key.replace(rmultiDash, \"-$&\").toLowerCase();\n data = elem.getAttribute(name);\n\n if (typeof data === \"string\") {\n try {\n data = data === \"true\" ? true : data === \"false\" ? false : data === \"null\" ? null : // Only convert to a number if it doesn't change the string\n +data + \"\" === data ? +data : rbrace.test(data) ? jQuery.parseJSON(data) : data;\n } catch (e) {} // Make sure we set the data so it isn't changed later\n\n\n dataUser.set(elem, key, data);\n } else {\n data = undefined;\n }\n }\n\n return data;\n }\n\n jQuery.extend({\n hasData: function (elem) {\n return dataUser.hasData(elem) || dataPriv.hasData(elem);\n },\n data: function (elem, name, data) {\n return dataUser.access(elem, name, data);\n },\n removeData: function (elem, name) {\n dataUser.remove(elem, name);\n },\n // TODO: Now that all calls to _data and _removeData have been replaced\n // with direct calls to dataPriv methods, these can be deprecated.\n _data: function (elem, name, data) {\n return dataPriv.access(elem, name, data);\n },\n _removeData: function (elem, name) {\n dataPriv.remove(elem, name);\n }\n });\n jQuery.fn.extend({\n data: function (key, value) {\n var i,\n name,\n data,\n elem = this[0],\n attrs = elem && elem.attributes; // Gets all values\n\n if (key === undefined) {\n if (this.length) {\n data = dataUser.get(elem);\n\n if (elem.nodeType === 1 && !dataPriv.get(elem, \"hasDataAttrs\")) {\n i = attrs.length;\n\n while (i--) {\n // Support: IE11+\n // The attrs elements can be null (#14894)\n if (attrs[i]) {\n name = attrs[i].name;\n\n if (name.indexOf(\"data-\") === 0) {\n name = jQuery.camelCase(name.slice(5));\n dataAttr(elem, name, data[name]);\n }\n }\n }\n\n dataPriv.set(elem, \"hasDataAttrs\", true);\n }\n }\n\n return data;\n } // Sets multiple values\n\n\n if (typeof key === \"object\") {\n return this.each(function () {\n dataUser.set(this, key);\n });\n }\n\n return access(this, function (value) {\n var data, camelKey; // The calling jQuery object (element matches) is not empty\n // (and therefore has an element appears at this[ 0 ]) and the\n // `value` parameter was not undefined. An empty jQuery object\n // will result in `undefined` for elem = this[ 0 ] which will\n // throw an exception if an attempt to read a data cache is made.\n\n if (elem && value === undefined) {\n // Attempt to get data from the cache\n // with the key as-is\n data = dataUser.get(elem, key) || // Try to find dashed key if it exists (gh-2779)\n // This is for 2.2.x only\n dataUser.get(elem, key.replace(rmultiDash, \"-$&\").toLowerCase());\n\n if (data !== undefined) {\n return data;\n }\n\n camelKey = jQuery.camelCase(key); // Attempt to get data from the cache\n // with the key camelized\n\n data = dataUser.get(elem, camelKey);\n\n if (data !== undefined) {\n return data;\n } // Attempt to \"discover\" the data in\n // HTML5 custom data-* attrs\n\n\n data = dataAttr(elem, camelKey, undefined);\n\n if (data !== undefined) {\n return data;\n } // We tried really hard, but the data doesn't exist.\n\n\n return;\n } // Set the data...\n\n\n camelKey = jQuery.camelCase(key);\n this.each(function () {\n // First, attempt to store a copy or reference of any\n // data that might've been store with a camelCased key.\n var data = dataUser.get(this, camelKey); // For HTML5 data-* attribute interop, we have to\n // store property names with dashes in a camelCase form.\n // This might not apply to all properties...*\n\n dataUser.set(this, camelKey, value); // *... In the case of properties that might _actually_\n // have dashes, we need to also store a copy of that\n // unchanged property.\n\n if (key.indexOf(\"-\") > -1 && data !== undefined) {\n dataUser.set(this, key, value);\n }\n });\n }, null, value, arguments.length > 1, null, true);\n },\n removeData: function (key) {\n return this.each(function () {\n dataUser.remove(this, key);\n });\n }\n });\n jQuery.extend({\n queue: function (elem, type, data) {\n var queue;\n\n if (elem) {\n type = (type || \"fx\") + \"queue\";\n queue = dataPriv.get(elem, type); // Speed up dequeue by getting out quickly if this is just a lookup\n\n if (data) {\n if (!queue || jQuery.isArray(data)) {\n queue = dataPriv.access(elem, type, jQuery.makeArray(data));\n } else {\n queue.push(data);\n }\n }\n\n return queue || [];\n }\n },\n dequeue: function (elem, type) {\n type = type || \"fx\";\n\n var queue = jQuery.queue(elem, type),\n startLength = queue.length,\n fn = queue.shift(),\n hooks = jQuery._queueHooks(elem, type),\n next = function () {\n jQuery.dequeue(elem, type);\n }; // If the fx queue is dequeued, always remove the progress sentinel\n\n\n if (fn === \"inprogress\") {\n fn = queue.shift();\n startLength--;\n }\n\n if (fn) {\n // Add a progress sentinel to prevent the fx queue from being\n // automatically dequeued\n if (type === \"fx\") {\n queue.unshift(\"inprogress\");\n } // Clear up the last queue stop function\n\n\n delete hooks.stop;\n fn.call(elem, next, hooks);\n }\n\n if (!startLength && hooks) {\n hooks.empty.fire();\n }\n },\n // Not public - generate a queueHooks object, or return the current one\n _queueHooks: function (elem, type) {\n var key = type + \"queueHooks\";\n return dataPriv.get(elem, key) || dataPriv.access(elem, key, {\n empty: jQuery.Callbacks(\"once memory\").add(function () {\n dataPriv.remove(elem, [type + \"queue\", key]);\n })\n });\n }\n });\n jQuery.fn.extend({\n queue: function (type, data) {\n var setter = 2;\n\n if (typeof type !== \"string\") {\n data = type;\n type = \"fx\";\n setter--;\n }\n\n if (arguments.length < setter) {\n return jQuery.queue(this[0], type);\n }\n\n return data === undefined ? this : this.each(function () {\n var queue = jQuery.queue(this, type, data); // Ensure a hooks for this queue\n\n jQuery._queueHooks(this, type);\n\n if (type === \"fx\" && queue[0] !== \"inprogress\") {\n jQuery.dequeue(this, type);\n }\n });\n },\n dequeue: function (type) {\n return this.each(function () {\n jQuery.dequeue(this, type);\n });\n },\n clearQueue: function (type) {\n return this.queue(type || \"fx\", []);\n },\n // Get a promise resolved when queues of a certain type\n // are emptied (fx is the type by default)\n promise: function (type, obj) {\n var tmp,\n count = 1,\n defer = jQuery.Deferred(),\n elements = this,\n i = this.length,\n resolve = function () {\n if (! --count) {\n defer.resolveWith(elements, [elements]);\n }\n };\n\n if (typeof type !== \"string\") {\n obj = type;\n type = undefined;\n }\n\n type = type || \"fx\";\n\n while (i--) {\n tmp = dataPriv.get(elements[i], type + \"queueHooks\");\n\n if (tmp && tmp.empty) {\n count++;\n tmp.empty.add(resolve);\n }\n }\n\n resolve();\n return defer.promise(obj);\n }\n });\n var pnum = /[+-]?(?:\\d*\\.|)\\d+(?:[eE][+-]?\\d+|)/.source;\n var rcssNum = new RegExp(\"^(?:([+-])=|)(\" + pnum + \")([a-z%]*)$\", \"i\");\n var cssExpand = [\"Top\", \"Right\", \"Bottom\", \"Left\"];\n\n var isHidden = function (elem, el) {\n // isHidden might be called from jQuery#filter function;\n // in that case, element will be second argument\n elem = el || elem;\n return jQuery.css(elem, \"display\") === \"none\" || !jQuery.contains(elem.ownerDocument, elem);\n };\n\n function adjustCSS(elem, prop, valueParts, tween) {\n var adjusted,\n scale = 1,\n maxIterations = 20,\n currentValue = tween ? function () {\n return tween.cur();\n } : function () {\n return jQuery.css(elem, prop, \"\");\n },\n initial = currentValue(),\n unit = valueParts && valueParts[3] || (jQuery.cssNumber[prop] ? \"\" : \"px\"),\n // Starting value computation is required for potential unit mismatches\n initialInUnit = (jQuery.cssNumber[prop] || unit !== \"px\" && +initial) && rcssNum.exec(jQuery.css(elem, prop));\n\n if (initialInUnit && initialInUnit[3] !== unit) {\n // Trust units reported by jQuery.css\n unit = unit || initialInUnit[3]; // Make sure we update the tween properties later on\n\n valueParts = valueParts || []; // Iteratively approximate from a nonzero starting point\n\n initialInUnit = +initial || 1;\n\n do {\n // If previous iteration zeroed out, double until we get *something*.\n // Use string for doubling so we don't accidentally see scale as unchanged below\n scale = scale || \".5\"; // Adjust and apply\n\n initialInUnit = initialInUnit / scale;\n jQuery.style(elem, prop, initialInUnit + unit); // Update scale, tolerating zero or NaN from tween.cur()\n // Break the loop if scale is unchanged or perfect, or if we've just had enough.\n } while (scale !== (scale = currentValue() / initial) && scale !== 1 && --maxIterations);\n }\n\n if (valueParts) {\n initialInUnit = +initialInUnit || +initial || 0; // Apply relative offset (+=/-=) if specified\n\n adjusted = valueParts[1] ? initialInUnit + (valueParts[1] + 1) * valueParts[2] : +valueParts[2];\n\n if (tween) {\n tween.unit = unit;\n tween.start = initialInUnit;\n tween.end = adjusted;\n }\n }\n\n return adjusted;\n }\n\n var rcheckableType = /^(?:checkbox|radio)$/i;\n var rtagName = /<([\\w:-]+)/;\n var rscriptType = /^$|\\/(?:java|ecma)script/i; // We have to close these tags to support XHTML (#13200)\n\n var wrapMap = {\n // Support: IE9\n option: [1, \"\"],\n // XHTML parsers do not magically insert elements in the\n // same way that tag soup parsers do. So we cannot shorten\n // this by omitting or other required elements.\n thead: [1, \"
\", \"
\"],\n col: [2, \"
\", \"
\"],\n tr: [2, \"
\", \"
\"],\n td: [3, \"
\", \"
\"],\n _default: [0, \"\", \"\"]\n }; // Support: IE9\n\n wrapMap.optgroup = wrapMap.option;\n wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;\n wrapMap.th = wrapMap.td;\n\n function getAll(context, tag) {\n // Support: IE9-11+\n // Use typeof to avoid zero-argument method invocation on host objects (#15151)\n var ret = typeof context.getElementsByTagName !== \"undefined\" ? context.getElementsByTagName(tag || \"*\") : typeof context.querySelectorAll !== \"undefined\" ? context.querySelectorAll(tag || \"*\") : [];\n return tag === undefined || tag && jQuery.nodeName(context, tag) ? jQuery.merge([context], ret) : ret;\n } // Mark scripts as having already been evaluated\n\n\n function setGlobalEval(elems, refElements) {\n var i = 0,\n l = elems.length;\n\n for (; i < l; i++) {\n dataPriv.set(elems[i], \"globalEval\", !refElements || dataPriv.get(refElements[i], \"globalEval\"));\n }\n }\n\n var rhtml = /<|?\\w+;/;\n\n function buildFragment(elems, context, scripts, selection, ignored) {\n var elem,\n tmp,\n tag,\n wrap,\n contains,\n j,\n fragment = context.createDocumentFragment(),\n nodes = [],\n i = 0,\n l = elems.length;\n\n for (; i < l; i++) {\n elem = elems[i];\n\n if (elem || elem === 0) {\n // Add nodes directly\n if (jQuery.type(elem) === \"object\") {\n // Support: Android<4.1, PhantomJS<2\n // push.apply(_, arraylike) throws on ancient WebKit\n jQuery.merge(nodes, elem.nodeType ? [elem] : elem); // Convert non-html into a text node\n } else if (!rhtml.test(elem)) {\n nodes.push(context.createTextNode(elem)); // Convert html into DOM nodes\n } else {\n tmp = tmp || fragment.appendChild(context.createElement(\"div\")); // Deserialize a standard representation\n\n tag = (rtagName.exec(elem) || [\"\", \"\"])[1].toLowerCase();\n wrap = wrapMap[tag] || wrapMap._default;\n tmp.innerHTML = wrap[1] + jQuery.htmlPrefilter(elem) + wrap[2]; // Descend through wrappers to the right content\n\n j = wrap[0];\n\n while (j--) {\n tmp = tmp.lastChild;\n } // Support: Android<4.1, PhantomJS<2\n // push.apply(_, arraylike) throws on ancient WebKit\n\n\n jQuery.merge(nodes, tmp.childNodes); // Remember the top-level container\n\n tmp = fragment.firstChild; // Ensure the created nodes are orphaned (#12392)\n\n tmp.textContent = \"\";\n }\n }\n } // Remove wrapper from fragment\n\n\n fragment.textContent = \"\";\n i = 0;\n\n while (elem = nodes[i++]) {\n // Skip elements already in the context collection (trac-4087)\n if (selection && jQuery.inArray(elem, selection) > -1) {\n if (ignored) {\n ignored.push(elem);\n }\n\n continue;\n }\n\n contains = jQuery.contains(elem.ownerDocument, elem); // Append to fragment\n\n tmp = getAll(fragment.appendChild(elem), \"script\"); // Preserve script evaluation history\n\n if (contains) {\n setGlobalEval(tmp);\n } // Capture executables\n\n\n if (scripts) {\n j = 0;\n\n while (elem = tmp[j++]) {\n if (rscriptType.test(elem.type || \"\")) {\n scripts.push(elem);\n }\n }\n }\n }\n\n return fragment;\n }\n\n (function () {\n var fragment = document.createDocumentFragment(),\n div = fragment.appendChild(document.createElement(\"div\")),\n input = document.createElement(\"input\"); // Support: Android 4.0-4.3, Safari<=5.1\n // Check state lost if the name is set (#11217)\n // Support: Windows Web Apps (WWA)\n // `name` and `type` must use .setAttribute for WWA (#14901)\n\n input.setAttribute(\"type\", \"radio\");\n input.setAttribute(\"checked\", \"checked\");\n input.setAttribute(\"name\", \"t\");\n div.appendChild(input); // Support: Safari<=5.1, Android<4.2\n // Older WebKit doesn't clone checked state correctly in fragments\n\n support.checkClone = div.cloneNode(true).cloneNode(true).lastChild.checked; // Support: IE<=11+\n // Make sure textarea (and checkbox) defaultValue is properly cloned\n\n div.innerHTML = \"\";\n support.noCloneChecked = !!div.cloneNode(true).lastChild.defaultValue;\n })();\n\n var rkeyEvent = /^key/,\n rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,\n rtypenamespace = /^([^.]*)(?:\\.(.+)|)/;\n\n function returnTrue() {\n return true;\n }\n\n function returnFalse() {\n return false;\n } // Support: IE9\n // See #13393 for more info\n\n\n function safeActiveElement() {\n try {\n return document.activeElement;\n } catch (err) {}\n }\n\n function on(elem, types, selector, data, fn, one) {\n var origFn, type; // Types can be a map of types/handlers\n\n if (typeof types === \"object\") {\n // ( types-Object, selector, data )\n if (typeof selector !== \"string\") {\n // ( types-Object, data )\n data = data || selector;\n selector = undefined;\n }\n\n for (type in types) {\n on(elem, type, selector, data, types[type], one);\n }\n\n return elem;\n }\n\n if (data == null && fn == null) {\n // ( types, fn )\n fn = selector;\n data = selector = undefined;\n } else if (fn == null) {\n if (typeof selector === \"string\") {\n // ( types, selector, fn )\n fn = data;\n data = undefined;\n } else {\n // ( types, data, fn )\n fn = data;\n data = selector;\n selector = undefined;\n }\n }\n\n if (fn === false) {\n fn = returnFalse;\n } else if (!fn) {\n return elem;\n }\n\n if (one === 1) {\n origFn = fn;\n\n fn = function (event) {\n // Can use an empty set, since event contains the info\n jQuery().off(event);\n return origFn.apply(this, arguments);\n }; // Use same guid so caller can remove using origFn\n\n\n fn.guid = origFn.guid || (origFn.guid = jQuery.guid++);\n }\n\n return elem.each(function () {\n jQuery.event.add(this, types, fn, data, selector);\n });\n }\n /*\n * Helper functions for managing events -- not part of the public interface.\n * Props to Dean Edwards' addEvent library for many of the ideas.\n */\n\n\n jQuery.event = {\n global: {},\n add: function (elem, types, handler, data, selector) {\n var handleObjIn,\n eventHandle,\n tmp,\n events,\n t,\n handleObj,\n special,\n handlers,\n type,\n namespaces,\n origType,\n elemData = dataPriv.get(elem); // Don't attach events to noData or text/comment nodes (but allow plain objects)\n\n if (!elemData) {\n return;\n } // Caller can pass in an object of custom data in lieu of the handler\n\n\n if (handler.handler) {\n handleObjIn = handler;\n handler = handleObjIn.handler;\n selector = handleObjIn.selector;\n } // Make sure that the handler has a unique ID, used to find/remove it later\n\n\n if (!handler.guid) {\n handler.guid = jQuery.guid++;\n } // Init the element's event structure and main handler, if this is the first\n\n\n if (!(events = elemData.events)) {\n events = elemData.events = {};\n }\n\n if (!(eventHandle = elemData.handle)) {\n eventHandle = elemData.handle = function (e) {\n // Discard the second event of a jQuery.event.trigger() and\n // when an event is called after a page has unloaded\n return typeof jQuery !== \"undefined\" && jQuery.event.triggered !== e.type ? jQuery.event.dispatch.apply(elem, arguments) : undefined;\n };\n } // Handle multiple events separated by a space\n\n\n types = (types || \"\").match(rnotwhite) || [\"\"];\n t = types.length;\n\n while (t--) {\n tmp = rtypenamespace.exec(types[t]) || [];\n type = origType = tmp[1];\n namespaces = (tmp[2] || \"\").split(\".\").sort(); // There *must* be a type, no attaching namespace-only handlers\n\n if (!type) {\n continue;\n } // If event changes its type, use the special event handlers for the changed type\n\n\n special = jQuery.event.special[type] || {}; // If selector defined, determine special event api type, otherwise given type\n\n type = (selector ? special.delegateType : special.bindType) || type; // Update special based on newly reset type\n\n special = jQuery.event.special[type] || {}; // handleObj is passed to all event handlers\n\n handleObj = jQuery.extend({\n type: type,\n origType: origType,\n data: data,\n handler: handler,\n guid: handler.guid,\n selector: selector,\n needsContext: selector && jQuery.expr.match.needsContext.test(selector),\n namespace: namespaces.join(\".\")\n }, handleObjIn); // Init the event handler queue if we're the first\n\n if (!(handlers = events[type])) {\n handlers = events[type] = [];\n handlers.delegateCount = 0; // Only use addEventListener if the special events handler returns false\n\n if (!special.setup || special.setup.call(elem, data, namespaces, eventHandle) === false) {\n if (elem.addEventListener) {\n elem.addEventListener(type, eventHandle);\n }\n }\n }\n\n if (special.add) {\n special.add.call(elem, handleObj);\n\n if (!handleObj.handler.guid) {\n handleObj.handler.guid = handler.guid;\n }\n } // Add to the element's handler list, delegates in front\n\n\n if (selector) {\n handlers.splice(handlers.delegateCount++, 0, handleObj);\n } else {\n handlers.push(handleObj);\n } // Keep track of which events have ever been used, for event optimization\n\n\n jQuery.event.global[type] = true;\n }\n },\n // Detach an event or set of events from an element\n remove: function (elem, types, handler, selector, mappedTypes) {\n var j,\n origCount,\n tmp,\n events,\n t,\n handleObj,\n special,\n handlers,\n type,\n namespaces,\n origType,\n elemData = dataPriv.hasData(elem) && dataPriv.get(elem);\n\n if (!elemData || !(events = elemData.events)) {\n return;\n } // Once for each type.namespace in types; type may be omitted\n\n\n types = (types || \"\").match(rnotwhite) || [\"\"];\n t = types.length;\n\n while (t--) {\n tmp = rtypenamespace.exec(types[t]) || [];\n type = origType = tmp[1];\n namespaces = (tmp[2] || \"\").split(\".\").sort(); // Unbind all events (on this namespace, if provided) for the element\n\n if (!type) {\n for (type in events) {\n jQuery.event.remove(elem, type + types[t], handler, selector, true);\n }\n\n continue;\n }\n\n special = jQuery.event.special[type] || {};\n type = (selector ? special.delegateType : special.bindType) || type;\n handlers = events[type] || [];\n tmp = tmp[2] && new RegExp(\"(^|\\\\.)\" + namespaces.join(\"\\\\.(?:.*\\\\.|)\") + \"(\\\\.|$)\"); // Remove matching events\n\n origCount = j = handlers.length;\n\n while (j--) {\n handleObj = handlers[j];\n\n if ((mappedTypes || origType === handleObj.origType) && (!handler || handler.guid === handleObj.guid) && (!tmp || tmp.test(handleObj.namespace)) && (!selector || selector === handleObj.selector || selector === \"**\" && handleObj.selector)) {\n handlers.splice(j, 1);\n\n if (handleObj.selector) {\n handlers.delegateCount--;\n }\n\n if (special.remove) {\n special.remove.call(elem, handleObj);\n }\n }\n } // Remove generic event handler if we removed something and no more handlers exist\n // (avoids potential for endless recursion during removal of special event handlers)\n\n\n if (origCount && !handlers.length) {\n if (!special.teardown || special.teardown.call(elem, namespaces, elemData.handle) === false) {\n jQuery.removeEvent(elem, type, elemData.handle);\n }\n\n delete events[type];\n }\n } // Remove data and the expando if it's no longer used\n\n\n if (jQuery.isEmptyObject(events)) {\n dataPriv.remove(elem, \"handle events\");\n }\n },\n dispatch: function (event) {\n // Make a writable jQuery.Event from the native event object\n event = jQuery.event.fix(event);\n var i,\n j,\n ret,\n matched,\n handleObj,\n handlerQueue = [],\n args = slice.call(arguments),\n handlers = (dataPriv.get(this, \"events\") || {})[event.type] || [],\n special = jQuery.event.special[event.type] || {}; // Use the fix-ed jQuery.Event rather than the (read-only) native event\n\n args[0] = event;\n event.delegateTarget = this; // Call the preDispatch hook for the mapped type, and let it bail if desired\n\n if (special.preDispatch && special.preDispatch.call(this, event) === false) {\n return;\n } // Determine handlers\n\n\n handlerQueue = jQuery.event.handlers.call(this, event, handlers); // Run delegates first; they may want to stop propagation beneath us\n\n i = 0;\n\n while ((matched = handlerQueue[i++]) && !event.isPropagationStopped()) {\n event.currentTarget = matched.elem;\n j = 0;\n\n while ((handleObj = matched.handlers[j++]) && !event.isImmediatePropagationStopped()) {\n // Triggered event must either 1) have no namespace, or 2) have namespace(s)\n // a subset or equal to those in the bound event (both can have no namespace).\n if (!event.rnamespace || event.rnamespace.test(handleObj.namespace)) {\n event.handleObj = handleObj;\n event.data = handleObj.data;\n ret = ((jQuery.event.special[handleObj.origType] || {}).handle || handleObj.handler).apply(matched.elem, args);\n\n if (ret !== undefined) {\n if ((event.result = ret) === false) {\n event.preventDefault();\n event.stopPropagation();\n }\n }\n }\n }\n } // Call the postDispatch hook for the mapped type\n\n\n if (special.postDispatch) {\n special.postDispatch.call(this, event);\n }\n\n return event.result;\n },\n handlers: function (event, handlers) {\n var i,\n matches,\n sel,\n handleObj,\n handlerQueue = [],\n delegateCount = handlers.delegateCount,\n cur = event.target; // Support (at least): Chrome, IE9\n // Find delegate handlers\n // Black-hole SVG