diff --git a/dist/cozy-sun-bear.js b/dist/cozy-sun-bear.js index ba49d12..4b79f38 100644 --- a/dist/cozy-sun-bear.js +++ b/dist/cozy-sun-bear.js @@ -1,5 +1,5 @@ /* - * Cozy Sun Bear 1.0.0c8958fa, a JS library for interactive books. http://github.com/mlibrary/cozy-sun-bear + * Cozy Sun Bear 1.0.0f80d5a6, a JS library for interactive books. http://github.com/mlibrary/cozy-sun-bear * (c) 2018 Regents of the University of Michigan */ (function (global, factory) { @@ -356,6 +356,14 @@ var Util = (Object.freeze || Object)({ loader: loader }); +// @class Class +// @aka L.Class + +// @section +// @uninheritable + +// Thanks to John Resig and Dean Edwards for inspiration! + function Class() {} Class.extend = function (props) { @@ -483,6 +491,31 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; +/* + * @class Evented + * @aka L.Evented + * @inherits Class + * + * A set of methods shared between event-powered classes (like `Map` and `Marker`). Generally, events allow you to execute some function when something happens with an object (e.g. the user clicks on the map, causing the map to fire `'click'` event). + * + * @example + * + * ```js + * map.on('click', function(e) { + * alert(e.latlng); + * } ); + * ``` + * + * Leaflet deals with event listeners by reference, so if you want to add a listener and then remove it, define it as a function: + * + * ```js + * function onClick(e) { ... } + * + * map.on('click', onClick); + * map.off('click', onClick); + * ``` + */ + var Evented = Class.extend({ /* @method on(type: String, fn: Function, context?: Object): this @@ -923,6 +956,26 @@ var Browser = (Object.freeze || Object)({ classList: classList }); +/* + * @class Point + * @aka L.Point + * + * Represents a point with `x` and `y` coordinates in pixels. + * + * @example + * + * ```js + * var point = L.point(200, 300); + * ``` + * + * All Leaflet methods and options that accept `Point` objects also accept them in a simple Array form (unless noted otherwise), so these lines are equivalent: + * + * ```js + * map.panBy([200, 300]); + * map.panBy(L.point(200, 300)); + * ``` + */ + function Point(x, y, round) { // @property x: Number; The `x` coordinate of the point this.x = round ? Math.round(x) : x; @@ -1100,6 +1153,10 @@ function toPoint(x, y, round) { return new Point(x, y, round); } +/* + * Extends L.DomEvent to provide touch support for Internet Explorer and Windows-based devices. + */ + var POINTER_DOWN = msPointer ? 'MSPointerDown' : 'pointerdown'; var POINTER_MOVE = msPointer ? 'MSPointerMove' : 'pointermove'; var POINTER_UP = msPointer ? 'MSPointerUp' : 'pointerup'; @@ -1222,6 +1279,10 @@ function _addPointerEnd(obj, handler, id) { obj.addEventListener(POINTER_CANCEL, onUp, false); } +/* + * Extends the event handling code with double tap support for mobile browsers. + */ + var _touchstart = msPointer ? 'MSPointerDown' : pointer ? 'pointerdown' : 'touchstart'; var _touchend = msPointer ? 'MSPointerUp' : pointer ? 'pointerup' : 'touchend'; var _pre = '_leaflet_'; @@ -1310,6 +1371,22 @@ function removeDoubleTapListener(obj, id) { return this; } +/* + * @namespace DomEvent + * Utility functions to work with the [DOM events](https://developer.mozilla.org/docs/Web/API/Event), used by Leaflet internally. + */ + +// Inspired by John Resig, Dean Edwards and YUI addEvent implementations. + +// @function on(el: HTMLElement, types: String, fn: Function, context?: Object): this +// Adds a listener function (`fn`) to a particular DOM event type of the +// element `el`. You can optionally specify the context of the listener +// (object the `this` keyword will point to). You can also pass several +// space-separated types (e.g. `'click dblclick'`). + +// @alternative +// @function on(el: HTMLElement, eventMap: Object, context?: Object): this +// Adds a set of type/listener pairs, e.g. `{click: onClick, mousemove: onMouseMove}` function on(obj, types, fn, context) { if ((typeof types === 'undefined' ? 'undefined' : _typeof(types)) === 'object') { @@ -1584,8 +1661,6 @@ function filterClick(e, handler) { handler(e); } -// @function addListener(…): this -// Alias to [`L.DomEvent.on`](#domevent-on) var DomEvent = (Object.freeze || Object)({ @@ -1605,6 +1680,17 @@ var DomEvent = (Object.freeze || Object)({ removeListener: off }); +/* + * @namespace DomUtil + * + * Utility functions to work with the [DOM](https://developer.mozilla.org/docs/Web/API/Document_Object_Model) + * tree, used by Leaflet internally. + * + * Most functions expecting or returning a `HTMLElement` also work for + * SVG elements. The only difference is that classes refer to CSS classes + * in HTML and SVG classes in SVG. + */ + if (!Element.prototype.matches) { var ep = Element.prototype; @@ -1991,10 +2077,12 @@ function createCommonjsModule(fn, module) { return module = { exports: {} }, fn(module, module.exports), module.exports; } +/** Detect free variable `global` from Node.js. */ var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; var _freeGlobal = freeGlobal; +/** Detect free variable `self`. */ var freeSelf = typeof self == 'object' && self && self.Object === Object && self; /** Used as a reference to the global object. */ @@ -2002,10 +2090,12 @@ var root = _freeGlobal || freeSelf || Function('return this')(); var _root = root; +/** Built-in value references. */ var Symbol$1 = _root.Symbol; var _Symbol = Symbol$1; +/** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ @@ -2073,6 +2163,7 @@ function objectToString(value) { var _objectToString = objectToString; +/** `Object#toString` result references. */ var nullTag = '[object Null]'; var undefinedTag = '[object Undefined]'; @@ -2127,6 +2218,7 @@ function isObjectLike(value) { var isObjectLike_1 = isObjectLike; +/** `Object#toString` result references. */ var asyncTag = '[object AsyncFunction]'; var funcTag = '[object Function]'; var genTag = '[object GeneratorFunction]'; @@ -2161,10 +2253,12 @@ function isFunction(value) { var isFunction_1 = isFunction; +/** Used to detect overreaching core-js shims. */ var coreJsData = _root['__core-js_shared__']; var _coreJsData = coreJsData; +/** Used to detect methods masquerading as native. */ var maskSrcKey = (function() { var uid = /[^.]+$/.exec(_coreJsData && _coreJsData.keys && _coreJsData.keys.IE_PROTO || ''); return uid ? ('Symbol(src)_1.' + uid) : ''; @@ -2210,6 +2304,10 @@ function toSource(func) { var _toSource = toSource; +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; /** Used to detect host constructors (Safari). */ @@ -2263,6 +2361,14 @@ function getValue(object, key) { var _getValue = getValue; +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ function getNative(object, key) { var value = _getValue(object, key); return _baseIsNative(value) ? value : undefined; @@ -2280,6 +2386,15 @@ var defineProperty$1 = (function() { var _defineProperty = defineProperty$1; +/** + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ function baseAssignValue(object, key, value) { if (key == '__proto__' && _defineProperty) { _defineProperty(object, key, { @@ -2333,6 +2448,7 @@ function eq(value, other) { var eq_1 = eq; +/** Used for built-in method references. */ var objectProto$3 = Object.prototype; /** Used to check objects for own properties. */ @@ -2358,6 +2474,16 @@ function assignValue(object, key, value) { var _assignValue = assignValue; +/** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ function copyObject(source, props, object, customizer) { var isNew = !object; object || (object = {}); @@ -2430,6 +2556,7 @@ function apply(func, thisArg, args) { var _apply = apply; +/* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax$1 = Math.max; /** @@ -2491,6 +2618,14 @@ function constant(value) { var constant_1 = constant; +/** + * The base implementation of `setToString` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ var baseSetToString = !_defineProperty ? identity_1 : function(func, string) { return _defineProperty(func, 'toString', { 'configurable': true, @@ -2540,10 +2675,26 @@ function shortOut(func) { var _shortOut = shortOut; +/** + * Sets the `toString` method of `func` to return `string`. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ var setToString = _shortOut(_baseSetToString); var _setToString = setToString; +/** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ function baseRest(func, start) { return _setToString(_overRest(func, start, identity_1), func + ''); } @@ -2586,6 +2737,31 @@ function isLength(value) { var isLength_1 = isLength; +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ function isArrayLike(value) { return value != null && isLength_1(value.length) && !isFunction_1(value); } @@ -2615,6 +2791,16 @@ function isIndex(value, length) { var _isIndex = isIndex; +/** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ function isIterateeCall(value, index, object) { if (!isObject_1(object)) { return false; @@ -2631,6 +2817,13 @@ function isIterateeCall(value, index, object) { var _isIterateeCall = isIterateeCall; +/** + * Creates a function like `_.assign`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ function createAssigner(assigner) { return _baseRest(function(object, sources) { var index = -1, @@ -2699,6 +2892,7 @@ function baseTimes(n, iteratee) { var _baseTimes = baseTimes; +/** `Object#toString` result references. */ var argsTag = '[object Arguments]'; /** @@ -2714,6 +2908,7 @@ function baseIsArguments(value) { var _baseIsArguments = baseIsArguments; +/** Used for built-in method references. */ var objectProto$7 = Object.prototype; /** Used to check objects for own properties. */ @@ -2831,6 +3026,7 @@ var isBuffer = nativeIsBuffer || stubFalse_1; module.exports = isBuffer; }); +/** `Object#toString` result references. */ var argsTag$1 = '[object Arguments]'; var arrayTag = '[object Array]'; var boolTag = '[object Boolean]'; @@ -2925,6 +3121,7 @@ var nodeUtil = (function() { module.exports = nodeUtil; }); +/* Node.js helper references. */ var nodeIsTypedArray = _nodeUtil && _nodeUtil.isTypedArray; /** @@ -2948,6 +3145,7 @@ var isTypedArray = nodeIsTypedArray ? _baseUnary(nodeIsTypedArray) : _baseIsType var isTypedArray_1 = isTypedArray; +/** Used for built-in method references. */ var objectProto$6 = Object.prototype; /** Used to check objects for own properties. */ @@ -3006,10 +3204,12 @@ function overArg(func, transform) { var _overArg = overArg; +/* Built-in method references for those with the same name as other `lodash` methods. */ var nativeKeys = _overArg(Object.keys, Object); var _nativeKeys = nativeKeys; +/** Used for built-in method references. */ var objectProto$8 = Object.prototype; /** Used to check objects for own properties. */ @@ -3037,12 +3237,41 @@ function baseKeys(object) { var _baseKeys = baseKeys; +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ function keys(object) { return isArrayLike_1(object) ? _arrayLikeKeys(object) : _baseKeys(object); } var keys_1 = keys; +/** Used for built-in method references. */ var objectProto$2 = Object.prototype; /** Used to check objects for own properties. */ @@ -3196,6 +3425,7 @@ Object.defineProperties(screenfull, { } }); +// import {Class} from '../core/Class'; var Reader = Evented.extend({ options: { regions: ['header', 'toolbar.top', 'toolbar.left', 'main', 'toolbar.right', 'toolbar.bottom', 'footer'], @@ -3653,6 +3883,15 @@ var Reader = Evented.extend({ EOT: true }); +/* + * @class Control + * @aka L.Control + * @inherits Class + * + * L.Control is a base class for implementing reader controls. Handles regioning. + * All other controls extend from this class. + */ + var Control = Class.extend({ // @section // @aka Control options @@ -4007,6 +4246,7 @@ var pageLast = function pageLast(options) { }; var activeModal; +// from https://github.com/ghosh/micromodal/blob/master/src/index.js var FOCUSABLE_ELEMENTS = ['a[href]', 'area[href]', 'input:not([disabled]):not([type="hidden"])', 'select:not([disabled])', 'textarea:not([disabled])', 'button:not([disabled])', 'iframe', 'object', 'embed', '[contenteditable]', '[tabindex]:not([tabindex^="-"])']; var ACTIONABLE_ELEMENTS = ['a[href]', 'area[href]', 'input[type="submit"]:not([disabled])', 'button:not([disabled])']; @@ -4421,6 +4661,8 @@ var contents = function contents(options) { return new Contents(options); }; +// Title + Chapter + var Title = Control.extend({ onAdd: function onAdd(reader) { var self = this; @@ -4432,27 +4674,31 @@ var Title = Control.extend({ // var control = new DOMParser().parseFromString(template, "text/html").body.firstChild; var h1 = create$1('h1', 'cozy-h1', container); + setOpacity(h1, 0); this._title = create$1('span', 'cozy-title', h1); this._divider = create$1('span', 'cozy-divider', h1); this._divider.textContent = " · "; this._section = create$1('span', 'cozy-section', h1); - this._reader.on('updateSection', function (data) { - if (data && data.label) { - self._section.textContent = data.label; - setOpacity(self._section, 1.0); - setOpacity(self._divider, 1.0); - } else { - setOpacity(self._section, 0); - setOpacity(self._divider, 0); - } - }); + // --- TODO: disable until we can work out how to + // --- more reliably match the current section to the contents + // this._reader.on('updateSection', function(data) { + // if ( data && data.label ) { + // self._section.textContent = data.label; + // DomUtil.setOpacity(self._section, 1.0); + // DomUtil.setOpacity(self._divider, 1.0); + // } else { + // DomUtil.setOpacity(self._section, 0); + // DomUtil.setOpacity(self._divider, 0); + // } + // }) this._reader.on('updateTitle', function (data) { if (data) { self._title.textContent = data.title || data.bookTitle; setOpacity(self._section, 0); setOpacity(self._divider, 0); + setOpacity(h1, 1); } }); @@ -4486,6 +4732,8 @@ var title = function title(options) { return new Title(options); }; +// Title + Chapter + var PublicationMetadata = Control.extend({ onAdd: function onAdd(reader) { var self = this; @@ -5304,6 +5552,8 @@ var search = function search(options) { return new Search(options); }; +// Title + Chapter + var BibliographicInformation = Control.extend({ options: { label: 'Info', @@ -5620,6 +5870,9 @@ var navigator$1 = function navigator(options) { return new Navigator(options); }; +// import {Zoom, zoom} from './Control.Zoom'; +// import {Attribution, attribution} from './Control.Attribution'; + Control.PageNext = PageNext; Control.PagePrevious = PagePrevious; Control.PageFirst = PageFirst; @@ -6221,6 +6474,8 @@ var reader = function reader(id, options) { return engines[engine].apply(_this, [id, options]); }; +// misc + var oldCozy = window.cozy; function noConflict() { window.cozy = oldCozy; diff --git a/dist/cozy-sun-bear.js.map b/dist/cozy-sun-bear.js.map index 6d6f125..3fe007b 100644 --- a/dist/cozy-sun-bear.js.map +++ b/dist/cozy-sun-bear.js.map @@ -1 +1 @@ -{"version":3,"file":"cozy-sun-bear.js","sources":["../src/core/Util.js","../src/core/Class.js","../src/core/Events.js","../src/core/Browser.js","../src/geometry/Point.js","../src/dom/DomEvent.Pointer.js","../src/dom/DomEvent.DoubleTap.js","../src/dom/DomEvent.js","../src/dom/DomUtil.js","../node_modules/lodash/isObject.js","../node_modules/lodash/_freeGlobal.js","../node_modules/lodash/_root.js","../node_modules/lodash/_Symbol.js","../node_modules/lodash/_getRawTag.js","../node_modules/lodash/_objectToString.js","../node_modules/lodash/_baseGetTag.js","../node_modules/lodash/isObjectLike.js","../node_modules/lodash/isFunction.js","../node_modules/lodash/_coreJsData.js","../node_modules/lodash/_isMasked.js","../node_modules/lodash/_toSource.js","../node_modules/lodash/_baseIsNative.js","../node_modules/lodash/_getValue.js","../node_modules/lodash/_getNative.js","../node_modules/lodash/_defineProperty.js","../node_modules/lodash/_baseAssignValue.js","../node_modules/lodash/eq.js","../node_modules/lodash/_assignValue.js","../node_modules/lodash/_copyObject.js","../node_modules/lodash/identity.js","../node_modules/lodash/_apply.js","../node_modules/lodash/_overRest.js","../node_modules/lodash/constant.js","../node_modules/lodash/_baseSetToString.js","../node_modules/lodash/_shortOut.js","../node_modules/lodash/_setToString.js","../node_modules/lodash/_baseRest.js","../node_modules/lodash/isLength.js","../node_modules/lodash/isArrayLike.js","../node_modules/lodash/_isIndex.js","../node_modules/lodash/_isIterateeCall.js","../node_modules/lodash/_createAssigner.js","../node_modules/lodash/_isPrototype.js","../node_modules/lodash/_baseTimes.js","../node_modules/lodash/_baseIsArguments.js","../node_modules/lodash/isArguments.js","../node_modules/lodash/isArray.js","../node_modules/lodash/stubFalse.js","../node_modules/lodash/isBuffer.js","../node_modules/lodash/_baseIsTypedArray.js","../node_modules/lodash/_baseUnary.js","../node_modules/lodash/_nodeUtil.js","../node_modules/lodash/isTypedArray.js","../node_modules/lodash/_arrayLikeKeys.js","../node_modules/lodash/_overArg.js","../node_modules/lodash/_nativeKeys.js","../node_modules/lodash/_baseKeys.js","../node_modules/lodash/keys.js","../node_modules/lodash/assign.js","../src/screenfull.js","../src/reader/Reader.js","../src/control/Control.js","../src/control/Control.Paging.js","../src/control/Modal.js","../src/control/Control.Contents.js","../src/control/Control.Title.js","../src/control/Control.PublicationMetadata.js","../src/control/Control.Preferences.js","../src/control/Control.Widget.js","../src/control/Control.Citation.js","../src/control/Control.Search.js","../src/control/Control.BibliographicInformation.js","../src/control/Control.Download.js","../src/control/Control.Navigator.js","../src/control/index.js","../src/core/Bus.js","../src/core/index.js","../src/epubjs.js","../src/reader/Reader.EpubJS.js","../src/reader/Reader.Mock.js","../src/reader/index.js","../src/cozy.js"],"sourcesContent":["/*\n * @namespace Util\n *\n * Various utility functions, used by Leaflet internally.\n */\n\n// @function extend(dest: Object, src?: Object): Object\n// Merges the properties of the `src` object (or multiple objects) into `dest` object and returns the latter. Has an `L.extend` shortcut.\nexport function extend(dest) {\n var i, j, len, src;\n\n for (j = 1, len = arguments.length; j < len; j++) {\n src = arguments[j];\n for (i in src) {\n dest[i] = src[i];\n }\n }\n return dest;\n}\n\n// @function create(proto: Object, properties?: Object): Object\n// Compatibility polyfill for [Object.create](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/create)\nexport var create = Object.create || (function () {\n function F() {}\n return function (proto) {\n F.prototype = proto;\n return new F();\n };\n})();\n\n// @function bind(fn: Function, …): Function\n// Returns a new function bound to the arguments passed, like [Function.prototype.bind](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind).\n// Has a `L.bind()` shortcut.\nexport function bind(fn, obj) {\n var slice = Array.prototype.slice;\n\n if (fn.bind) {\n return fn.bind.apply(fn, slice.call(arguments, 1));\n }\n\n var args = slice.call(arguments, 2);\n\n return function () {\n return fn.apply(obj, args.length ? args.concat(slice.call(arguments)) : arguments);\n };\n}\n\n// @property lastId: Number\n// Last unique ID used by [`stamp()`](#util-stamp)\nexport var lastId = 0;\n\n// @function stamp(obj: Object): Number\n// Returns the unique ID of an object, assiging it one if it doesn't have it.\nexport function stamp(obj) {\n /*eslint-disable */\n obj._cozy_id = obj._cozy_id || ++lastId;\n return obj._cozy_id; /* not leaflet */\n /*eslint-enable */\n}\n\n// @function throttle(fn: Function, time: Number, context: Object): Function\n// Returns a function which executes function `fn` with the given scope `context`\n// (so that the `this` keyword refers to `context` inside `fn`'s code). The function\n// `fn` will be called no more than one time per given amount of `time`. The arguments\n// received by the bound function will be any arguments passed when binding the\n// function, followed by any arguments passed when invoking the bound function.\n// Has an `L.throttle` shortcut.\nexport function throttle(fn, time, context) {\n var lock, args, wrapperFn, later;\n\n later = function () {\n // reset lock and call if queued\n lock = false;\n if (args) {\n wrapperFn.apply(context, args);\n args = false;\n }\n };\n\n wrapperFn = function () {\n if (lock) {\n // called too soon, queue to call later\n args = arguments;\n\n } else {\n // call and lock until later\n fn.apply(context, arguments);\n setTimeout(later, time);\n lock = true;\n }\n };\n\n return wrapperFn;\n}\n\n// @function wrapNum(num: Number, range: Number[], includeMax?: Boolean): Number\n// Returns the number `num` modulo `range` in such a way so it lies within\n// `range[0]` and `range[1]`. The returned value will be always smaller than\n// `range[1]` unless `includeMax` is set to `true`.\nexport function wrapNum(x, range, includeMax) {\n var max = range[1],\n min = range[0],\n d = max - min;\n return x === max && includeMax ? x : ((x - min) % d + d) % d + min;\n}\n\n// @function falseFn(): Function\n// Returns a function which always returns `false`.\nexport function falseFn() { return false; }\n\n// @function formatNum(num: Number, digits?: Number): Number\n// Returns the number `num` rounded to `digits` decimals, or to 5 decimals by default.\nexport function formatNum(num, digits) {\n var pow = Math.pow(10, digits || 5);\n return Math.round(num * pow) / pow;\n}\n\n// @function isNumeric(num: Number): Boolean\n// Returns whether num is actually numeric\nexport function isNumeric(num) {\n return !isNaN(parseFloat(num)) && isFinite(num);\n}\n\n// @function trim(str: String): String\n// Compatibility polyfill for [String.prototype.trim](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/Trim)\nexport function trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n// @function splitWords(str: String): String[]\n// Trims and splits the string on whitespace and returns the array of parts.\nexport function splitWords(str) {\n return trim(str).split(/\\s+/);\n}\n\n// @function setOptions(obj: Object, options: Object): Object\n// Merges the given properties to the `options` of the `obj` object, returning the resulting options. See `Class options`. Has an `L.setOptions` shortcut.\nexport function setOptions(obj, options) {\n if (!obj.hasOwnProperty('options')) {\n obj.options = obj.options ? create(obj.options) : {};\n }\n for (var i in options) {\n obj.options[i] = options[i];\n }\n return obj.options;\n}\n\n// @function getParamString(obj: Object, existingUrl?: String, uppercase?: Boolean): String\n// Converts an object into a parameter URL string, e.g. `{a: \"foo\", b: \"bar\"}`\n// translates to `'?a=foo&b=bar'`. If `existingUrl` is set, the parameters will\n// be appended at the end. If `uppercase` is `true`, the parameter names will\n// be uppercased (e.g. `'?A=foo&B=bar'`)\nexport function getParamString(obj, existingUrl, uppercase) {\n var params = [];\n for (var i in obj) {\n params.push(encodeURIComponent(uppercase ? i.toUpperCase() : i) + '=' + encodeURIComponent(obj[i]));\n }\n return ((!existingUrl || existingUrl.indexOf('?') === -1) ? '?' : '&') + params.join('&');\n}\n\nvar templateRe = /\\{ *([\\w_\\-]+) *\\}/g;\n\n// @function template(str: String, data: Object): String\n// Simple templating facility, accepts a template string of the form `'Hello {a}, {b}'`\n// and a data object like `{a: 'foo', b: 'bar'}`, returns evaluated string\n// `('Hello foo, bar')`. You can also specify functions instead of strings for\n// data values — they will be evaluated passing `data` as an argument.\nexport function template(str, data) {\n return str.replace(templateRe, function (str, key) {\n var value = data[key];\n\n if (value === undefined) {\n throw new Error('No value provided for variable ' + str);\n\n } else if (typeof value === 'function') {\n value = value(data);\n }\n return value;\n });\n}\n\n// @function isArray(obj): Boolean\n// Compatibility polyfill for [Array.isArray](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray)\nexport var isArray = Array.isArray || function (obj) {\n return (Object.prototype.toString.call(obj) === '[object Array]');\n};\n\n// @function indexOf(array: Array, el: Object): Number\n// Compatibility polyfill for [Array.prototype.indexOf](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf)\nexport function indexOf(array, el) {\n for (var i = 0; i < array.length; i++) {\n if (array[i] === el) { return i; }\n }\n return -1;\n}\n\n// @property emptyImageUrl: String\n// Data URI string containing a base64-encoded empty GIF image.\n// Used as a hack to free memory from unused images on WebKit-powered\n// mobile devices (by setting image `src` to this string).\nexport var emptyImageUrl = 'data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=';\n\n// inspired by http://paulirish.com/2011/requestanimationframe-for-smart-animating/\n\nfunction getPrefixed(name) {\n return window['webkit' + name] || window['moz' + name] || window['ms' + name];\n}\n\nvar lastTime = 0;\n\n// fallback for IE 7-8\nfunction timeoutDefer(fn) {\n var time = +new Date(),\n timeToCall = Math.max(0, 16 - (time - lastTime));\n\n lastTime = time + timeToCall;\n return window.setTimeout(fn, timeToCall);\n}\n\nexport var requestFn = window.requestAnimationFrame || getPrefixed('RequestAnimationFrame') || timeoutDefer;\nexport var cancelFn = window.cancelAnimationFrame || getPrefixed('CancelAnimationFrame') ||\n getPrefixed('CancelRequestAnimationFrame') || function (id) { window.clearTimeout(id); };\n\n// @function requestAnimFrame(fn: Function, context?: Object, immediate?: Boolean): Number\n// Schedules `fn` to be executed when the browser repaints. `fn` is bound to\n// `context` if given. When `immediate` is set, `fn` is called immediately if\n// the browser doesn't have native support for\n// [`window.requestAnimationFrame`](https://developer.mozilla.org/docs/Web/API/window/requestAnimationFrame),\n// otherwise it's delayed. Returns a request ID that can be used to cancel the request.\nexport function requestAnimFrame(fn, context, immediate) {\n if (immediate && requestFn === timeoutDefer) {\n fn.call(context);\n } else {\n return requestFn.call(window, bind(fn, context));\n }\n}\n\n// @function cancelAnimFrame(id: Number): undefined\n// Cancels a previous `requestAnimFrame`. See also [window.cancelAnimationFrame](https://developer.mozilla.org/docs/Web/API/window/cancelAnimationFrame).\nexport function cancelAnimFrame(id) {\n if (id) {\n cancelFn.call(window, id);\n }\n}\n\nexport var loader = {\n js: function(url) {\n var handler = { _resolved: false };\n handler.callbacks = [];\n handler.error = [];\n handler.then = function(cb) {\n handler.callbacks.push(cb);\n if ( handler._resolved ) { return handler.resolve(); }\n return handler;\n }\n handler.catch = function(cb) {\n handler.error.push(cb);\n if ( handler._resolved ) { return handler.reject(); }\n return handler;\n }\n handler.resolve = function(_argv) {\n // var _argv;\n handler._resolved = true;\n while ( handler.callbacks.length ) {\n var cb = handler.callbacks.shift();\n var retval;\n try {\n _argv = cb(_argv);\n } catch(e) {\n console.log(e);\n handler.reject(e);\n break;\n }\n }\n return handler;\n }\n\n handler.reject = function(e) {\n while ( handler.error.length ) {\n var cb = handler.error.shift();\n cb(e);\n }\n console.log(e);\n console.trace();\n return handler;\n }\n\n if ( url == undefined ) {\n handler._resolved = true;\n return handler;\n }\n\n var element = document.createElement('script');\n\n element.onload = function() {\n handler.resolve(url);\n };\n element.onerror = function() {\n handler.catch.apply(arguments);\n };\n\n element.async = true;\n var parent = 'body';\n var attr = 'src';\n element[attr] = url;\n document[parent].appendChild(element);\n\n console.log(\"AHOY APPENDED\", url);\n\n return handler;\n }\n}","import * as Util from './Util';\r\n\r\n// @class Class\r\n// @aka L.Class\r\n\r\n// @section\r\n// @uninheritable\r\n\r\n// Thanks to John Resig and Dean Edwards for inspiration!\r\n\r\nexport function Class() {}\r\n\r\nClass.extend = function (props) {\r\n\r\n\t// @function extend(props: Object): Function\r\n\t// [Extends the current class](#class-inheritance) given the properties to be included.\r\n\t// Returns a Javascript function that is a class constructor (to be called with `new`).\r\n\tvar NewClass = function () {\r\n\r\n\t\t// call the constructor\r\n\t\tif (this.initialize) {\r\n\t\t\tthis.initialize.apply(this, arguments);\r\n\t\t}\r\n\r\n\t\t// call all constructor hooks\r\n\t\tthis.callInitHooks();\r\n\t};\r\n\r\n\tvar parentProto = NewClass.__super__ = this.prototype;\r\n\r\n\tvar proto = Util.create(parentProto);\r\n\tproto.constructor = NewClass;\r\n\r\n\tNewClass.prototype = proto;\r\n\r\n\t// inherit parent's statics\r\n\tfor (var i in this) {\r\n\t\tif (this.hasOwnProperty(i) && i !== 'prototype') {\r\n\t\t\tNewClass[i] = this[i];\r\n\t\t}\r\n\t}\r\n\r\n\t// mix static properties into the class\r\n\tif (props.statics) {\r\n\t\tUtil.extend(NewClass, props.statics);\r\n\t\tdelete props.statics;\r\n\t}\r\n\r\n\t// mix includes into the prototype\r\n\tif (props.includes) {\r\n\t\tcheckDeprecatedMixinEvents(props.includes);\r\n\t\tUtil.extend.apply(null, [proto].concat(props.includes));\r\n\t\tdelete props.includes;\r\n\t}\r\n\r\n\t// merge options\r\n\tif (proto.options) {\r\n\t\tprops.options = Util.extend(Util.create(proto.options), props.options);\r\n\t}\r\n\r\n\t// mix given properties into the prototype\r\n\tUtil.extend(proto, props);\r\n\t\r\n\tproto._initHooks = [];\r\n\r\n\t// add method for calling all hooks\r\n\tproto.callInitHooks = function () {\r\n\r\n\t\tif (this._initHooksCalled) { return; }\r\n\r\n\t\tif (parentProto.callInitHooks) {\r\n\t\t\tparentProto.callInitHooks.call(this);\r\n\t\t}\r\n\r\n\t\tthis._initHooksCalled = true;\r\n\r\n\t\tfor (var i = 0, len = proto._initHooks.length; i < len; i++) {\r\n\t\t\tproto._initHooks[i].call(this);\r\n\t\t}\r\n\t};\r\n\r\n\treturn NewClass;\r\n};\r\n\r\n\r\n// @function include(properties: Object): this\r\n// [Includes a mixin](#class-includes) into the current class.\r\nClass.include = function (props) {\r\n\tUtil.extend(this.prototype, props);\r\n\treturn this;\r\n};\r\n\r\n// @function mergeOptions(options: Object): this\r\n// [Merges `options`](#class-options) into the defaults of the class.\r\nClass.mergeOptions = function (options) {\r\n\tUtil.extend(this.prototype.options, options);\r\n\treturn this;\r\n};\r\n\r\n// @function addInitHook(fn: Function): this\r\n// Adds a [constructor hook](#class-constructor-hooks) to the class.\r\nClass.addInitHook = function (fn) { // (Function) || (String, args...)\r\n\tvar args = Array.prototype.slice.call(arguments, 1);\r\n\r\n\tvar init = typeof fn === 'function' ? fn : function () {\r\n\t\tthis[fn].apply(this, args);\r\n\t};\r\n\r\n\tthis.prototype._initHooks = this.prototype._initHooks || [];\r\n\tthis.prototype._initHooks.push(init);\r\n\treturn this;\r\n};\r\n\r\nfunction checkDeprecatedMixinEvents(includes) {\r\n\tif (!cozy || !cozy.Mixin) { return; }\r\n\r\n\tincludes = cozy.Util.isArray(includes) ? includes : [includes];\r\n\r\n\t// for (var i = 0; i < includes.length; i++) {\r\n\t// \tif (includes[i] === cozy.Mixin.Events) {\r\n\t// \t\tconsole.warn('Deprecated include of cozy.Mixin.Events: ' +\r\n\t// \t\t\t'this property will be removed in future releases, ' +\r\n\t// \t\t\t'please inherit from cozy.Evented instead.', new Error().stack);\r\n\t// \t}\r\n\t// }\r\n}\r\n","import {Class} from './Class';\r\nimport * as Util from './Util';\r\n\r\n/*\r\n * @class Evented\r\n * @aka L.Evented\r\n * @inherits Class\r\n *\r\n * A set of methods shared between event-powered classes (like `Map` and `Marker`). Generally, events allow you to execute some function when something happens with an object (e.g. the user clicks on the map, causing the map to fire `'click'` event).\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * map.on('click', function(e) {\r\n * \talert(e.latlng);\r\n * } );\r\n * ```\r\n *\r\n * Leaflet deals with event listeners by reference, so if you want to add a listener and then remove it, define it as a function:\r\n *\r\n * ```js\r\n * function onClick(e) { ... }\r\n *\r\n * map.on('click', onClick);\r\n * map.off('click', onClick);\r\n * ```\r\n */\r\n\r\nexport var Evented = Class.extend({\r\n\r\n\t/* @method on(type: String, fn: Function, context?: Object): this\r\n\t * Adds a listener function (`fn`) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. `'click dblclick'`).\r\n\t *\r\n\t * @alternative\r\n\t * @method on(eventMap: Object): this\r\n\t * Adds a set of type/listener pairs, e.g. `{click: onClick, mousemove: onMouseMove}`\r\n\t */\r\n\ton: function (types, fn, context) {\r\n\r\n\t\t// types can be a map of types/handlers\r\n\t\tif (typeof types === 'object') {\r\n\t\t\tfor (var type in types) {\r\n\t\t\t\t// we don't process space-separated events here for performance;\r\n\t\t\t\t// it's a hot path since Layer uses the on(obj) syntax\r\n\t\t\t\tthis._on(type, types[type], fn);\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\t// types can be a string of space-separated words\r\n\t\t\ttypes = Util.splitWords(types);\r\n\r\n\t\t\tfor (var i = 0, len = types.length; i < len; i++) {\r\n\t\t\t\tthis._on(types[i], fn, context);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t/* @method off(type: String, fn?: Function, context?: Object): this\r\n\t * Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to `on`, you must pass the same context to `off` in order to remove the listener.\r\n\t *\r\n\t * @alternative\r\n\t * @method off(eventMap: Object): this\r\n\t * Removes a set of type/listener pairs.\r\n\t *\r\n\t * @alternative\r\n\t * @method off: this\r\n\t * Removes all listeners to all events on the object.\r\n\t */\r\n\toff: function (types, fn, context) {\r\n\r\n\t\tif (!types) {\r\n\t\t\t// clear all listeners if called without arguments\r\n\t\t\tdelete this._events;\r\n\r\n\t\t} else if (typeof types === 'object') {\r\n\t\t\tfor (var type in types) {\r\n\t\t\t\tthis._off(type, types[type], fn);\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\ttypes = Util.splitWords(types);\r\n\r\n\t\t\tfor (var i = 0, len = types.length; i < len; i++) {\r\n\t\t\t\tthis._off(types[i], fn, context);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// attach listener (without syntactic sugar now)\r\n\t_on: function (type, fn, context) {\r\n\t\tthis._events = this._events || {};\r\n\r\n\t\t/* get/init listeners for type */\r\n\t\tvar typeListeners = this._events[type];\r\n\t\tif (!typeListeners) {\r\n\t\t\ttypeListeners = [];\r\n\t\t\tthis._events[type] = typeListeners;\r\n\t\t}\r\n\r\n\t\tif (context === this) {\r\n\t\t\t// Less memory footprint.\r\n\t\t\tcontext = undefined;\r\n\t\t}\r\n\t\tvar newListener = {fn: fn, ctx: context},\r\n\t\t listeners = typeListeners;\r\n\r\n\t\t// check if fn already there\r\n\t\tfor (var i = 0, len = listeners.length; i < len; i++) {\r\n\t\t\tif (listeners[i].fn === fn && listeners[i].ctx === context) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tlisteners.push(newListener);\r\n\t},\r\n\r\n\t_off: function (type, fn, context) {\r\n\t\tvar listeners,\r\n\t\t i,\r\n\t\t len;\r\n\r\n\t\tif (!this._events) { return; }\r\n\r\n\t\tlisteners = this._events[type];\r\n\r\n\t\tif (!listeners) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (!fn) {\r\n\t\t\t// Set all removed listeners to noop so they are not called if remove happens in fire\r\n\t\t\tfor (i = 0, len = listeners.length; i < len; i++) {\r\n\t\t\t\tlisteners[i].fn = Util.falseFn;\r\n\t\t\t}\r\n\t\t\t// clear all listeners for a type if function isn't specified\r\n\t\t\tdelete this._events[type];\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (context === this) {\r\n\t\t\tcontext = undefined;\r\n\t\t}\r\n\r\n\t\tif (listeners) {\r\n\r\n\t\t\t// find fn and remove it\r\n\t\t\tfor (i = 0, len = listeners.length; i < len; i++) {\r\n\t\t\t\tvar l = listeners[i];\r\n\t\t\t\tif (l.ctx !== context) { continue; }\r\n\t\t\t\tif (l.fn === fn) {\r\n\r\n\t\t\t\t\t// set the removed listener to noop so that's not called if remove happens in fire\r\n\t\t\t\t\tl.fn = Util.falseFn;\r\n\r\n\t\t\t\t\tif (this._firingCount) {\r\n\t\t\t\t\t\t/* copy array in case events are being fired */\r\n\t\t\t\t\t\tthis._events[type] = listeners = listeners.slice();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tlisteners.splice(i, 1);\r\n\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t// @method fire(type: String, data?: Object, propagate?: Boolean): this\r\n\t// Fires an event of the specified type. You can optionally provide an data\r\n\t// object — the first argument of the listener function will contain its\r\n\t// properties. The event can optionally be propagated to event parents.\r\n\tfire: function (type, data, propagate) {\r\n\t\tif (!this.listens(type, propagate)) { return this; }\r\n\r\n\t\tvar event = Util.extend({}, data, {type: type, target: this});\r\n\r\n\t\tif (this._events) {\r\n\t\t\tvar listeners = this._events[type];\r\n\r\n\t\t\tif (listeners) {\r\n\t\t\t\tthis._firingCount = (this._firingCount + 1) || 1;\r\n\t\t\t\tfor (var i = 0, len = listeners.length; i < len; i++) {\r\n\t\t\t\t\tvar l = listeners[i];\r\n\t\t\t\t\tl.fn.call(l.ctx || this, event);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis._firingCount--;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (propagate) {\r\n\t\t\t// propagate the event to parents (set with addEventParent)\r\n\t\t\tthis._propagateEvent(event);\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method listens(type: String): Boolean\r\n\t// Returns `true` if a particular event type has any listeners attached to it.\r\n\tlistens: function (type, propagate) {\r\n\t\tvar listeners = this._events && this._events[type];\r\n\t\tif (listeners && listeners.length) { return true; }\r\n\r\n\t\tif (propagate) {\r\n\t\t\t// also check parents for listeners if event propagates\r\n\t\t\tfor (var id in this._eventParents) {\r\n\t\t\t\tif (this._eventParents[id].listens(type, propagate)) { return true; }\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\r\n\t// @method once(…): this\r\n\t// Behaves as [`on(…)`](#evented-on), except the listener will only get fired once and then removed.\r\n\tonce: function (types, fn, context) {\r\n\r\n\t\tif (typeof types === 'object') {\r\n\t\t\tfor (var type in types) {\r\n\t\t\t\tthis.once(type, types[type], fn);\r\n\t\t\t}\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\tvar handler = Util.bind(function () {\r\n\t\t\tthis\r\n\t\t\t .off(types, fn, context)\r\n\t\t\t .off(types, handler, context);\r\n\t\t}, this);\r\n\r\n\t\t// add a listener that's executed once and removed after that\r\n\t\treturn this\r\n\t\t .on(types, fn, context)\r\n\t\t .on(types, handler, context);\r\n\t},\r\n\r\n\t// @method addEventParent(obj: Evented): this\r\n\t// Adds an event parent - an `Evented` that will receive propagated events\r\n\taddEventParent: function (obj) {\r\n\t\tthis._eventParents = this._eventParents || {};\r\n\t\tthis._eventParents[Util.stamp(obj)] = obj;\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method removeEventParent(obj: Evented): this\r\n\t// Removes an event parent, so it will stop receiving propagated events\r\n\tremoveEventParent: function (obj) {\r\n\t\tif (this._eventParents) {\r\n\t\t\tdelete this._eventParents[Util.stamp(obj)];\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t_propagateEvent: function (e) {\r\n\t\tfor (var id in this._eventParents) {\r\n\t\t\tthis._eventParents[id].fire(e.type, Util.extend({layer: e.target}, e), true);\r\n\t\t}\r\n\t}\r\n});\r\n\r\nvar proto = Evented.prototype;\r\n\r\n// aliases; we should ditch those eventually\r\n\r\n// @method addEventListener(…): this\r\n// Alias to [`on(…)`](#evented-on)\r\nproto.addEventListener = proto.on;\r\n\r\n// @method removeEventListener(…): this\r\n// Alias to [`off(…)`](#evented-off)\r\n\r\n// @method clearAllEventListeners(…): this\r\n// Alias to [`off()`](#evented-off)\r\nproto.removeEventListener = proto.clearAllEventListeners = proto.off;\r\n\r\n// @method addOneTimeEventListener(…): this\r\n// Alias to [`once(…)`](#evented-once)\r\nproto.addOneTimeEventListener = proto.once;\r\n\r\n// @method fireEvent(…): this\r\n// Alias to [`fire(…)`](#evented-fire)\r\nproto.fireEvent = proto.fire;\r\n\r\n// @method hasEventListeners(…): Boolean\r\n// Alias to [`listens(…)`](#evented-listens)\r\nproto.hasEventListeners = proto.listens;\r\n","\n/*\n * @namespace Browser\n * @aka L.Browser\n *\n * A namespace with static properties for browser/feature detection used by Leaflet internally.\n *\n * @example\n *\n * ```js\n * if (L.Browser.ielt9) {\n * alert('Upgrade your browser, dude!');\n * }\n * ```\n */\n\nvar style = document.documentElement.style;\n\n// @property ie: Boolean; `true` for all Internet Explorer versions (not Edge).\nexport var ie = 'ActiveXObject' in window;\n\n// @property ielt9: Boolean; `true` for Internet Explorer versions less than 9.\nexport var ielt9 = ie && !document.addEventListener;\n\n// @property edge: Boolean; `true` for the Edge web browser.\nexport var edge = 'msLaunchUri' in navigator && !('documentMode' in document);\n\n// @property webkit: Boolean;\n// `true` for webkit-based browsers like Chrome and Safari (including mobile versions).\nexport var webkit = userAgentContains('webkit');\n\n// @property android: Boolean\n// `true` for any browser running on an Android platform.\nexport var android = userAgentContains('android');\n\n// @property android23: Boolean; `true` for browsers running on Android 2 or Android 3.\nexport var android23 = userAgentContains('android 2') || userAgentContains('android 3');\n\n// @property opera: Boolean; `true` for the Opera browser\nexport var opera = !!window.opera;\n\n// @property chrome: Boolean; `true` for the Chrome browser.\nexport var chrome = userAgentContains('chrome');\n\n// @property gecko: Boolean; `true` for gecko-based browsers like Firefox.\nexport var gecko = userAgentContains('gecko') && !webkit && !opera && !ie;\n\n// @property safari: Boolean; `true` for the Safari browser.\nexport var safari = !chrome && userAgentContains('safari');\n\nexport var phantom = userAgentContains('phantom');\n\n// @property opera12: Boolean\n// `true` for the Opera browser supporting CSS transforms (version 12 or later).\nexport var opera12 = 'OTransition' in style;\n\n// @property win: Boolean; `true` when the browser is running in a Windows platform\nexport var win = navigator.platform.indexOf('Win') === 0;\n\n// @property ie3d: Boolean; `true` for all Internet Explorer versions supporting CSS transforms.\nexport var ie3d = ie && ('transition' in style);\n\n// @property webkit3d: Boolean; `true` for webkit-based browsers supporting CSS transforms.\nexport var webkit3d = ('WebKitCSSMatrix' in window) && ('m11' in new window.WebKitCSSMatrix()) && !android23;\n\n// @property gecko3d: Boolean; `true` for gecko-based browsers supporting CSS transforms.\nexport var gecko3d = 'MozPerspective' in style;\n\n// @property any3d: Boolean\n// `true` for all browsers supporting CSS transforms.\nexport var any3d = !window.L_DISABLE_3D && (ie3d || webkit3d || gecko3d) && !opera12 && !phantom;\n\n// @property mobile: Boolean; `true` for all browsers running in a mobile device.\nexport var mobile = typeof orientation !== 'undefined' || userAgentContains('mobile');\n\n// @property mobileWebkit: Boolean; `true` for all webkit-based browsers in a mobile device.\nexport var mobileWebkit = mobile && webkit;\n\n// @property mobileWebkit3d: Boolean\n// `true` for all webkit-based browsers in a mobile device supporting CSS transforms.\nexport var mobileWebkit3d = mobile && webkit3d;\n\n// @property msPointer: Boolean\n// `true` for browsers implementing the Microsoft touch events model (notably IE10).\nexport var msPointer = !window.PointerEvent && window.MSPointerEvent;\n\n// @property pointer: Boolean\n// `true` for all browsers supporting [pointer events](https://msdn.microsoft.com/en-us/library/dn433244%28v=vs.85%29.aspx).\nexport var pointer = !!(window.PointerEvent || msPointer);\n\n// @property touch: Boolean\n// `true` for all browsers supporting [touch events](https://developer.mozilla.org/docs/Web/API/Touch_events).\n// This does not necessarily mean that the browser is running in a computer with\n// a touchscreen, it only means that the browser is capable of understanding\n// touch events.\nexport var touch = !window.L_NO_TOUCH && (pointer || 'ontouchstart' in window ||\n (window.DocumentTouch && document instanceof window.DocumentTouch));\n\n// @property mobileOpera: Boolean; `true` for the Opera browser in a mobile device.\nexport var mobileOpera = mobile && opera;\n\n// @property mobileGecko: Boolean\n// `true` for gecko-based browsers running in a mobile device.\nexport var mobileGecko = mobile && gecko;\n\n// @property retina: Boolean\n// `true` for browsers on a high-resolution \"retina\" screen.\nexport var retina = (window.devicePixelRatio || (window.screen.deviceXDPI / window.screen.logicalXDPI)) > 1;\n\n\n// @property canvas: Boolean\n// `true` when the browser supports [``](https://developer.mozilla.org/docs/Web/API/Canvas_API).\nexport var canvas = (function () {\n return !!document.createElement('canvas').getContext;\n}());\n\n// @property svg: Boolean\n// `true` when the browser supports [SVG](https://developer.mozilla.org/docs/Web/SVG).\n// export var svg = !!(document.createElementNS && svgCreate('svg').createSVGRect);\nexport var svg = true;\n\n// @property vml: Boolean\n// `true` if the browser supports [VML](https://en.wikipedia.org/wiki/Vector_Markup_Language).\nexport var vml = !svg && (function () {\n try {\n var div = document.createElement('div');\n div.innerHTML = '';\n\n var shape = div.firstChild;\n shape.style.behavior = 'url(#default#VML)';\n\n return shape && (typeof shape.adj === 'object');\n\n } catch (e) {\n return false;\n }\n}());\n\nexport var columnCount = ( 'columnCount' in style );\nexport var classList = ( document.documentElement.classList !== undefined );\n\nfunction userAgentContains(str) {\n return navigator.userAgent.toLowerCase().indexOf(str) >= 0;\n}\n","import {isArray, formatNum} from '../core/Util';\r\n\r\n/*\r\n * @class Point\r\n * @aka L.Point\r\n *\r\n * Represents a point with `x` and `y` coordinates in pixels.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * var point = L.point(200, 300);\r\n * ```\r\n *\r\n * All Leaflet methods and options that accept `Point` objects also accept them in a simple Array form (unless noted otherwise), so these lines are equivalent:\r\n *\r\n * ```js\r\n * map.panBy([200, 300]);\r\n * map.panBy(L.point(200, 300));\r\n * ```\r\n */\r\n\r\nexport function Point(x, y, round) {\r\n\t// @property x: Number; The `x` coordinate of the point\r\n\tthis.x = (round ? Math.round(x) : x);\r\n\t// @property y: Number; The `y` coordinate of the point\r\n\tthis.y = (round ? Math.round(y) : y);\r\n}\r\n\r\nPoint.prototype = {\r\n\r\n\t// @method clone(): Point\r\n\t// Returns a copy of the current point.\r\n\tclone: function () {\r\n\t\treturn new Point(this.x, this.y);\r\n\t},\r\n\r\n\t// @method add(otherPoint: Point): Point\r\n\t// Returns the result of addition of the current and the given points.\r\n\tadd: function (point) {\r\n\t\t// non-destructive, returns a new point\r\n\t\treturn this.clone()._add(toPoint(point));\r\n\t},\r\n\r\n\t_add: function (point) {\r\n\t\t// destructive, used directly for performance in situations where it's safe to modify existing point\r\n\t\tthis.x += point.x;\r\n\t\tthis.y += point.y;\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method subtract(otherPoint: Point): Point\r\n\t// Returns the result of subtraction of the given point from the current.\r\n\tsubtract: function (point) {\r\n\t\treturn this.clone()._subtract(toPoint(point));\r\n\t},\r\n\r\n\t_subtract: function (point) {\r\n\t\tthis.x -= point.x;\r\n\t\tthis.y -= point.y;\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method divideBy(num: Number): Point\r\n\t// Returns the result of division of the current point by the given number.\r\n\tdivideBy: function (num) {\r\n\t\treturn this.clone()._divideBy(num);\r\n\t},\r\n\r\n\t_divideBy: function (num) {\r\n\t\tthis.x /= num;\r\n\t\tthis.y /= num;\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method multiplyBy(num: Number): Point\r\n\t// Returns the result of multiplication of the current point by the given number.\r\n\tmultiplyBy: function (num) {\r\n\t\treturn this.clone()._multiplyBy(num);\r\n\t},\r\n\r\n\t_multiplyBy: function (num) {\r\n\t\tthis.x *= num;\r\n\t\tthis.y *= num;\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method scaleBy(scale: Point): Point\r\n\t// Multiply each coordinate of the current point by each coordinate of\r\n\t// `scale`. In linear algebra terms, multiply the point by the\r\n\t// [scaling matrix](https://en.wikipedia.org/wiki/Scaling_%28geometry%29#Matrix_representation)\r\n\t// defined by `scale`.\r\n\tscaleBy: function (point) {\r\n\t\treturn new Point(this.x * point.x, this.y * point.y);\r\n\t},\r\n\r\n\t// @method unscaleBy(scale: Point): Point\r\n\t// Inverse of `scaleBy`. Divide each coordinate of the current point by\r\n\t// each coordinate of `scale`.\r\n\tunscaleBy: function (point) {\r\n\t\treturn new Point(this.x / point.x, this.y / point.y);\r\n\t},\r\n\r\n\t// @method round(): Point\r\n\t// Returns a copy of the current point with rounded coordinates.\r\n\tround: function () {\r\n\t\treturn this.clone()._round();\r\n\t},\r\n\r\n\t_round: function () {\r\n\t\tthis.x = Math.round(this.x);\r\n\t\tthis.y = Math.round(this.y);\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method floor(): Point\r\n\t// Returns a copy of the current point with floored coordinates (rounded down).\r\n\tfloor: function () {\r\n\t\treturn this.clone()._floor();\r\n\t},\r\n\r\n\t_floor: function () {\r\n\t\tthis.x = Math.floor(this.x);\r\n\t\tthis.y = Math.floor(this.y);\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method ceil(): Point\r\n\t// Returns a copy of the current point with ceiled coordinates (rounded up).\r\n\tceil: function () {\r\n\t\treturn this.clone()._ceil();\r\n\t},\r\n\r\n\t_ceil: function () {\r\n\t\tthis.x = Math.ceil(this.x);\r\n\t\tthis.y = Math.ceil(this.y);\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method distanceTo(otherPoint: Point): Number\r\n\t// Returns the cartesian distance between the current and the given points.\r\n\tdistanceTo: function (point) {\r\n\t\tpoint = toPoint(point);\r\n\r\n\t\tvar x = point.x - this.x,\r\n\t\t y = point.y - this.y;\r\n\r\n\t\treturn Math.sqrt(x * x + y * y);\r\n\t},\r\n\r\n\t// @method equals(otherPoint: Point): Boolean\r\n\t// Returns `true` if the given point has the same coordinates.\r\n\tequals: function (point) {\r\n\t\tpoint = toPoint(point);\r\n\r\n\t\treturn point.x === this.x &&\r\n\t\t point.y === this.y;\r\n\t},\r\n\r\n\t// @method contains(otherPoint: Point): Boolean\r\n\t// Returns `true` if both coordinates of the given point are less than the corresponding current point coordinates (in absolute values).\r\n\tcontains: function (point) {\r\n\t\tpoint = toPoint(point);\r\n\r\n\t\treturn Math.abs(point.x) <= Math.abs(this.x) &&\r\n\t\t Math.abs(point.y) <= Math.abs(this.y);\r\n\t},\r\n\r\n\t// @method toString(): String\r\n\t// Returns a string representation of the point for debugging purposes.\r\n\ttoString: function () {\r\n\t\treturn 'Point(' +\r\n\t\t formatNum(this.x) + ', ' +\r\n\t\t formatNum(this.y) + ')';\r\n\t}\r\n};\r\n\r\n// @factory L.point(x: Number, y: Number, round?: Boolean)\r\n// Creates a Point object with the given `x` and `y` coordinates. If optional `round` is set to true, rounds the `x` and `y` values.\r\n\r\n// @alternative\r\n// @factory L.point(coords: Number[])\r\n// Expects an array of the form `[x, y]` instead.\r\n\r\n// @alternative\r\n// @factory L.point(coords: Object)\r\n// Expects a plain object of the form `{x: Number, y: Number}` instead.\r\nexport function toPoint(x, y, round) {\r\n\tif (x instanceof Point) {\r\n\t\treturn x;\r\n\t}\r\n\tif (isArray(x)) {\r\n\t\treturn new Point(x[0], x[1]);\r\n\t}\r\n\tif (x === undefined || x === null) {\r\n\t\treturn x;\r\n\t}\r\n\tif (typeof x === 'object' && 'x' in x && 'y' in x) {\r\n\t\treturn new Point(x.x, x.y);\r\n\t}\r\n\treturn new Point(x, y, round);\r\n}\r\n","import * as DomEvent from './DomEvent';\nimport * as Util from '../core/Util';\nimport * as Browser from '../core/Browser';\n\n/*\n * Extends L.DomEvent to provide touch support for Internet Explorer and Windows-based devices.\n */\n\n\nvar POINTER_DOWN = Browser.msPointer ? 'MSPointerDown' : 'pointerdown',\n POINTER_MOVE = Browser.msPointer ? 'MSPointerMove' : 'pointermove',\n POINTER_UP = Browser.msPointer ? 'MSPointerUp' : 'pointerup',\n POINTER_CANCEL = Browser.msPointer ? 'MSPointerCancel' : 'pointercancel',\n TAG_WHITE_LIST = ['INPUT', 'SELECT', 'OPTION'],\n\n _pointers = {},\n _pointerDocListener = false;\n\n// DomEvent.DoubleTap needs to know about this\nexport var _pointersCount = 0;\n\n// Provides a touch events wrapper for (ms)pointer events.\n// ref http://www.w3.org/TR/pointerevents/ https://www.w3.org/Bugs/Public/show_bug.cgi?id=22890\n\nexport function addPointerListener(obj, type, handler, id) {\n\tif (type === 'touchstart') {\n\t\t_addPointerStart(obj, handler, id);\n\n\t} else if (type === 'touchmove') {\n\t\t_addPointerMove(obj, handler, id);\n\n\t} else if (type === 'touchend') {\n\t\t_addPointerEnd(obj, handler, id);\n\t}\n\n\treturn this;\n}\n\nexport function removePointerListener(obj, type, id) {\n\tvar handler = obj['_leaflet_' + type + id];\n\n\tif (type === 'touchstart') {\n\t\tobj.removeEventListener(POINTER_DOWN, handler, false);\n\n\t} else if (type === 'touchmove') {\n\t\tobj.removeEventListener(POINTER_MOVE, handler, false);\n\n\t} else if (type === 'touchend') {\n\t\tobj.removeEventListener(POINTER_UP, handler, false);\n\t\tobj.removeEventListener(POINTER_CANCEL, handler, false);\n\t}\n\n\treturn this;\n}\n\nfunction _addPointerStart(obj, handler, id) {\n\tvar onDown = Util.bind(function (e) {\n\t\tif (e.pointerType !== 'mouse' && e.pointerType !== e.MSPOINTER_TYPE_MOUSE && e.pointerType !== e.MSPOINTER_TYPE_MOUSE) {\n\t\t\t// In IE11, some touch events needs to fire for form controls, or\n\t\t\t// the controls will stop working. We keep a whitelist of tag names that\n\t\t\t// need these events. For other target tags, we prevent default on the event.\n\t\t\tif (TAG_WHITE_LIST.indexOf(e.target.tagName) < 0) {\n\t\t\t\tDomEvent.preventDefault(e);\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t_handlePointer(e, handler);\n\t});\n\n\tobj['_leaflet_touchstart' + id] = onDown;\n\tobj.addEventListener(POINTER_DOWN, onDown, false);\n\n\t// need to keep track of what pointers and how many are active to provide e.touches emulation\n\tif (!_pointerDocListener) {\n\t\t// we listen documentElement as any drags that end by moving the touch off the screen get fired there\n\t\tdocument.documentElement.addEventListener(POINTER_DOWN, _globalPointerDown, true);\n\t\tdocument.documentElement.addEventListener(POINTER_MOVE, _globalPointerMove, true);\n\t\tdocument.documentElement.addEventListener(POINTER_UP, _globalPointerUp, true);\n\t\tdocument.documentElement.addEventListener(POINTER_CANCEL, _globalPointerUp, true);\n\n\t\t_pointerDocListener = true;\n\t}\n}\n\nfunction _globalPointerDown(e) {\n\t_pointers[e.pointerId] = e;\n\t_pointersCount++;\n}\n\nfunction _globalPointerMove(e) {\n\tif (_pointers[e.pointerId]) {\n\t\t_pointers[e.pointerId] = e;\n\t}\n}\n\nfunction _globalPointerUp(e) {\n\tdelete _pointers[e.pointerId];\n\t_pointersCount--;\n}\n\nfunction _handlePointer(e, handler) {\n\te.touches = [];\n\tfor (var i in _pointers) {\n\t\te.touches.push(_pointers[i]);\n\t}\n\te.changedTouches = [e];\n\n\thandler(e);\n}\n\nfunction _addPointerMove(obj, handler, id) {\n\tvar onMove = function (e) {\n\t\t// don't fire touch moves when mouse isn't down\n\t\tif ((e.pointerType === e.MSPOINTER_TYPE_MOUSE || e.pointerType === 'mouse') && e.buttons === 0) { return; }\n\n\t\t_handlePointer(e, handler);\n\t};\n\n\tobj['_leaflet_touchmove' + id] = onMove;\n\tobj.addEventListener(POINTER_MOVE, onMove, false);\n}\n\nfunction _addPointerEnd(obj, handler, id) {\n\tvar onUp = function (e) {\n\t\t_handlePointer(e, handler);\n\t};\n\n\tobj['_leaflet_touchend' + id] = onUp;\n\tobj.addEventListener(POINTER_UP, onUp, false);\n\tobj.addEventListener(POINTER_CANCEL, onUp, false);\n}\n\n","import * as Browser from '../core/Browser';\r\nimport {_pointersCount} from './DomEvent.Pointer';\r\n\r\n/*\r\n * Extends the event handling code with double tap support for mobile browsers.\r\n */\r\n\r\nvar _touchstart = Browser.msPointer ? 'MSPointerDown' : Browser.pointer ? 'pointerdown' : 'touchstart',\r\n _touchend = Browser.msPointer ? 'MSPointerUp' : Browser.pointer ? 'pointerup' : 'touchend',\r\n _pre = '_leaflet_';\r\n\r\n// inspired by Zepto touch code by Thomas Fuchs\r\nexport function addDoubleTapListener(obj, handler, id) {\r\n\tvar last, touch,\r\n\t doubleTap = false,\r\n\t delay = 250;\r\n\r\n\tfunction onTouchStart(e) {\r\n\t\tvar count;\r\n\r\n\t\tif (Browser.pointer) {\r\n\t\t\tif ((!Browser.edge) || e.pointerType === 'mouse') { return; }\r\n\t\t\tcount = _pointersCount;\r\n\t\t} else {\r\n\t\t\tcount = e.touches.length;\r\n\t\t}\r\n\r\n\t\tif (count > 1) { return; }\r\n\r\n\t\tvar now = Date.now(),\r\n\t\t delta = now - (last || now);\r\n\r\n\t\ttouch = e.touches ? e.touches[0] : e;\r\n\t\tdoubleTap = (delta > 0 && delta <= delay);\r\n\t\tlast = now;\r\n\t}\r\n\r\n\tfunction onTouchEnd(e) {\r\n\t\tif (doubleTap && !touch.cancelBubble) {\r\n\t\t\tif (Browser.pointer) {\r\n\t\t\t\tif ((!Browser.edge) || e.pointerType === 'mouse') { return; }\r\n\t\t\t\t// work around .type being readonly with MSPointer* events\r\n\t\t\t\tvar newTouch = {},\r\n\t\t\t\t prop, i;\r\n\r\n\t\t\t\tfor (i in touch) {\r\n\t\t\t\t\tprop = touch[i];\r\n\t\t\t\t\tnewTouch[i] = prop && prop.bind ? prop.bind(touch) : prop;\r\n\t\t\t\t}\r\n\t\t\t\ttouch = newTouch;\r\n\t\t\t}\r\n\t\t\ttouch.type = 'dblclick';\r\n\t\t\thandler(touch);\r\n\t\t\tlast = null;\r\n\t\t}\r\n\t}\r\n\r\n\tobj[_pre + _touchstart + id] = onTouchStart;\r\n\tobj[_pre + _touchend + id] = onTouchEnd;\r\n\tobj[_pre + 'dblclick' + id] = handler;\r\n\r\n\tobj.addEventListener(_touchstart, onTouchStart, false);\r\n\tobj.addEventListener(_touchend, onTouchEnd, false);\r\n\r\n\t// On some platforms (notably, chrome<55 on win10 + touchscreen + mouse),\r\n\t// the browser doesn't fire touchend/pointerup events but does fire\r\n\t// native dblclicks. See #4127.\r\n\t// Edge 14 also fires native dblclicks, but only for pointerType mouse, see #5180.\r\n\tobj.addEventListener('dblclick', handler, false);\r\n\r\n\treturn this;\r\n}\r\n\r\nexport function removeDoubleTapListener(obj, id) {\r\n\tvar touchstart = obj[_pre + _touchstart + id],\r\n\t touchend = obj[_pre + _touchend + id],\r\n\t dblclick = obj[_pre + 'dblclick' + id];\r\n\r\n\tobj.removeEventListener(_touchstart, touchstart, false);\r\n\tobj.removeEventListener(_touchend, touchend, false);\r\n\tif (!Browser.edge) {\r\n\t\tobj.removeEventListener('dblclick', dblclick, false);\r\n\t}\r\n\r\n\treturn this;\r\n}\r\n","import {Point} from '../geometry/Point';\r\nimport * as Util from '../core/Util';\r\nimport * as Browser from '../core/Browser';\r\nimport {addPointerListener, removePointerListener} from './DomEvent.Pointer';\r\nimport {addDoubleTapListener, removeDoubleTapListener} from './DomEvent.DoubleTap';\r\n\r\n/*\r\n * @namespace DomEvent\r\n * Utility functions to work with the [DOM events](https://developer.mozilla.org/docs/Web/API/Event), used by Leaflet internally.\r\n */\r\n\r\n// Inspired by John Resig, Dean Edwards and YUI addEvent implementations.\r\n\r\n// @function on(el: HTMLElement, types: String, fn: Function, context?: Object): this\r\n// Adds a listener function (`fn`) to a particular DOM event type of the\r\n// element `el`. You can optionally specify the context of the listener\r\n// (object the `this` keyword will point to). You can also pass several\r\n// space-separated types (e.g. `'click dblclick'`).\r\n\r\n// @alternative\r\n// @function on(el: HTMLElement, eventMap: Object, context?: Object): this\r\n// Adds a set of type/listener pairs, e.g. `{click: onClick, mousemove: onMouseMove}`\r\nexport function on(obj, types, fn, context) {\r\n\r\n\tif (typeof types === 'object') {\r\n\t\tfor (var type in types) {\r\n\t\t\taddOne(obj, type, types[type], fn);\r\n\t\t}\r\n\t} else {\r\n\t\ttypes = Util.splitWords(types);\r\n\r\n\t\tfor (var i = 0, len = types.length; i < len; i++) {\r\n\t\t\taddOne(obj, types[i], fn, context);\r\n\t\t}\r\n\t}\r\n\r\n\treturn this;\r\n}\r\n\r\nvar eventsKey = '_leaflet_events';\r\n\r\n// @function off(el: HTMLElement, types: String, fn: Function, context?: Object): this\r\n// Removes a previously added listener function. If no function is specified,\r\n// it will remove all the listeners of that particular DOM event from the element.\r\n// Note that if you passed a custom context to on, you must pass the same\r\n// context to `off` in order to remove the listener.\r\n\r\n// @alternative\r\n// @function off(el: HTMLElement, eventMap: Object, context?: Object): this\r\n// Removes a set of type/listener pairs, e.g. `{click: onClick, mousemove: onMouseMove}`\r\n\r\n// @alternative\r\n// @function off(el: HTMLElement): this\r\n// Removes all known event listeners\r\nexport function off(obj, types, fn, context) {\r\n\r\n\tif (typeof types === 'object') {\r\n\t\tfor (var type in types) {\r\n\t\t\tremoveOne(obj, type, types[type], fn);\r\n\t\t}\r\n\t} else if (types) {\r\n\t\ttypes = Util.splitWords(types);\r\n\r\n\t\tfor (var i = 0, len = types.length; i < len; i++) {\r\n\t\t\tremoveOne(obj, types[i], fn, context);\r\n\t\t}\r\n\t} else {\r\n\t\tfor (var j in obj[eventsKey]) {\r\n\t\t\tremoveOne(obj, j, obj[eventsKey][j]);\r\n\t\t}\r\n\t\tdelete obj[eventsKey];\r\n\t}\r\n}\r\n\r\nfunction addOne(obj, type, fn, context) {\r\n\tvar id = type + Util.stamp(fn) + (context ? '_' + Util.stamp(context) : '');\r\n\r\n\tif (obj[eventsKey] && obj[eventsKey][id]) { return this; }\r\n\r\n\tvar handler = function (e) {\r\n\t\treturn fn.call(context || obj, e || window.event);\r\n\t};\r\n\r\n\tvar originalHandler = handler;\r\n\r\n\tif (Browser.pointer && type.indexOf('touch') === 0) {\r\n\t\t// Needs DomEvent.Pointer.js\r\n\t\taddPointerListener(obj, type, handler, id);\r\n\r\n\t} else if (Browser.touch && (type === 'dblclick') && addDoubleTapListener &&\r\n\t !(Browser.pointer && Browser.chrome)) {\r\n\t\t// Chrome >55 does not need the synthetic dblclicks from addDoubleTapListener\r\n\t\t// See #5180\r\n\t\taddDoubleTapListener(obj, handler, id);\r\n\r\n\t} else if ('addEventListener' in obj) {\r\n\r\n\t\tif (type === 'mousewheel') {\r\n\t\t\tobj.addEventListener('onwheel' in obj ? 'wheel' : 'mousewheel', handler, false);\r\n\r\n\t\t} else if ((type === 'mouseenter') || (type === 'mouseleave')) {\r\n\t\t\thandler = function (e) {\r\n\t\t\t\te = e || window.event;\r\n\t\t\t\tif (isExternalTarget(obj, e)) {\r\n\t\t\t\t\toriginalHandler(e);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\tobj.addEventListener(type === 'mouseenter' ? 'mouseover' : 'mouseout', handler, false);\r\n\r\n\t\t} else {\r\n\t\t\tif (type === 'click' && Browser.android) {\r\n\t\t\t\thandler = function (e) {\r\n\t\t\t\t\tfilterClick(e, originalHandler);\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t\tobj.addEventListener(type, handler, false);\r\n\t\t}\r\n\r\n\t} else if ('attachEvent' in obj) {\r\n\t\tobj.attachEvent('on' + type, handler);\r\n\t}\r\n\r\n\tobj[eventsKey] = obj[eventsKey] || {};\r\n\tobj[eventsKey][id] = handler;\r\n}\r\n\r\nfunction removeOne(obj, type, fn, context) {\r\n\r\n\tvar id = type + Util.stamp(fn) + (context ? '_' + Util.stamp(context) : ''),\r\n\t handler = obj[eventsKey] && obj[eventsKey][id];\r\n\r\n\tif (!handler) { return this; }\r\n\r\n\tif (Browser.pointer && type.indexOf('touch') === 0) {\r\n\t\tremovePointerListener(obj, type, id);\r\n\r\n\t} else if (Browser.touch && (type === 'dblclick') && removeDoubleTapListener) {\r\n\t\tremoveDoubleTapListener(obj, id);\r\n\r\n\t} else if ('removeEventListener' in obj) {\r\n\r\n\t\tif (type === 'mousewheel') {\r\n\t\t\tobj.removeEventListener('onwheel' in obj ? 'wheel' : 'mousewheel', handler, false);\r\n\r\n\t\t} else {\r\n\t\t\tobj.removeEventListener(\r\n\t\t\t\ttype === 'mouseenter' ? 'mouseover' :\r\n\t\t\t\ttype === 'mouseleave' ? 'mouseout' : type, handler, false);\r\n\t\t}\r\n\r\n\t} else if ('detachEvent' in obj) {\r\n\t\tobj.detachEvent('on' + type, handler);\r\n\t}\r\n\r\n\tobj[eventsKey][id] = null;\r\n}\r\n\r\n// @function stopPropagation(ev: DOMEvent): this\r\n// Stop the given event from propagation to parent elements. Used inside the listener functions:\r\n// ```js\r\n// L.DomEvent.on(div, 'click', function (ev) {\r\n// \tL.DomEvent.stopPropagation(ev);\r\n// });\r\n// ```\r\nexport function stopPropagation(e) {\r\n\r\n\tif (e.stopPropagation) {\r\n\t\te.stopPropagation();\r\n\t} else if (e.originalEvent) { // In case of Leaflet event.\r\n\t\te.originalEvent._stopped = true;\r\n\t} else {\r\n\t\te.cancelBubble = true;\r\n\t}\r\n\tskipped(e);\r\n\r\n\treturn this;\r\n}\r\n\r\n// @function disableScrollPropagation(el: HTMLElement): this\r\n// Adds `stopPropagation` to the element's `'mousewheel'` events (plus browser variants).\r\nexport function disableScrollPropagation(el) {\r\n\treturn addOne(el, 'mousewheel', stopPropagation);\r\n}\r\n\r\n// @function disableClickPropagation(el: HTMLElement): this\r\n// Adds `stopPropagation` to the element's `'click'`, `'doubleclick'`,\r\n// `'mousedown'` and `'touchstart'` events (plus browser variants).\r\nexport function disableClickPropagation(el) {\r\n\ton(el, 'mousedown touchstart dblclick', stopPropagation);\r\n\taddOne(el, 'click', fakeStop);\r\n\treturn this;\r\n}\r\n\r\n// @function preventDefault(ev: DOMEvent): this\r\n// Prevents the default action of the DOM Event `ev` from happening (such as\r\n// following a link in the href of the a element, or doing a POST request\r\n// with page reload when a `
` is submitted).\r\n// Use it inside listener functions.\r\nexport function preventDefault(e) {\r\n\tif (e.preventDefault) {\r\n\t\te.preventDefault();\r\n\t} else {\r\n\t\te.returnValue = false;\r\n\t}\r\n\treturn this;\r\n}\r\n\r\n// @function stop(ev): this\r\n// Does `stopPropagation` and `preventDefault` at the same time.\r\nexport function stop(e) {\r\n\tpreventDefault(e);\r\n\tstopPropagation(e);\r\n\treturn this;\r\n}\r\n\r\n// @function getMousePosition(ev: DOMEvent, container?: HTMLElement): Point\r\n// Gets normalized mouse position from a DOM event relative to the\r\n// `container` or to the whole page if not specified.\r\nexport function getMousePosition(e, container) {\r\n\tif (!container) {\r\n\t\treturn new Point(e.clientX, e.clientY);\r\n\t}\r\n\r\n\tvar rect = container.getBoundingClientRect();\r\n\r\n\treturn new Point(\r\n\t\te.clientX - rect.left - container.clientLeft,\r\n\t\te.clientY - rect.top - container.clientTop);\r\n}\r\n\r\n// Chrome on Win scrolls double the pixels as in other platforms (see #4538),\r\n// and Firefox scrolls device pixels, not CSS pixels\r\nvar wheelPxFactor =\r\n\t(Browser.win && Browser.chrome) ? 2 :\r\n\tBrowser.gecko ? window.devicePixelRatio : 1;\r\n\r\n// @function getWheelDelta(ev: DOMEvent): Number\r\n// Gets normalized wheel delta from a mousewheel DOM event, in vertical\r\n// pixels scrolled (negative if scrolling down).\r\n// Events from pointing devices without precise scrolling are mapped to\r\n// a best guess of 60 pixels.\r\nexport function getWheelDelta(e) {\r\n\treturn (Browser.edge) ? e.wheelDeltaY / 2 : // Don't trust window-geometry-based delta\r\n\t (e.deltaY && e.deltaMode === 0) ? -e.deltaY / wheelPxFactor : // Pixels\r\n\t (e.deltaY && e.deltaMode === 1) ? -e.deltaY * 20 : // Lines\r\n\t (e.deltaY && e.deltaMode === 2) ? -e.deltaY * 60 : // Pages\r\n\t (e.deltaX || e.deltaZ) ? 0 :\t// Skip horizontal/depth wheel events\r\n\t e.wheelDelta ? (e.wheelDeltaY || e.wheelDelta) / 2 : // Legacy IE pixels\r\n\t (e.detail && Math.abs(e.detail) < 32765) ? -e.detail * 20 : // Legacy Moz lines\r\n\t e.detail ? e.detail / -32765 * 60 : // Legacy Moz pages\r\n\t 0;\r\n}\r\n\r\nvar skipEvents = {};\r\n\r\nexport function fakeStop(e) {\r\n\t// fakes stopPropagation by setting a special event flag, checked/reset with skipped(e)\r\n\tskipEvents[e.type] = true;\r\n}\r\n\r\nexport function skipped(e) {\r\n\tvar events = skipEvents[e.type];\r\n\t// reset when checking, as it's only used in map container and propagates outside of the map\r\n\tskipEvents[e.type] = false;\r\n\treturn events;\r\n}\r\n\r\n// check if element really left/entered the event target (for mouseenter/mouseleave)\r\nexport function isExternalTarget(el, e) {\r\n\r\n\tvar related = e.relatedTarget;\r\n\r\n\tif (!related) { return true; }\r\n\r\n\ttry {\r\n\t\twhile (related && (related !== el)) {\r\n\t\t\trelated = related.parentNode;\r\n\t\t}\r\n\t} catch (err) {\r\n\t\treturn false;\r\n\t}\r\n\treturn (related !== el);\r\n}\r\n\r\nvar lastClick;\r\n\r\n// this is a horrible workaround for a bug in Android where a single touch triggers two click events\r\nfunction filterClick(e, handler) {\r\n\tvar timeStamp = (e.timeStamp || (e.originalEvent && e.originalEvent.timeStamp)),\r\n\t elapsed = lastClick && (timeStamp - lastClick);\r\n\r\n\t// are they closer together than 500ms yet more than 100ms?\r\n\t// Android typically triggers them ~300ms apart while multiple listeners\r\n\t// on the same event should be triggered far faster;\r\n\t// or check if click is simulated on the element, and if it is, reject any non-simulated events\r\n\r\n\tif ((elapsed && elapsed > 100 && elapsed < 500) || (e.target._simulatedClick && !e._simulated)) {\r\n\t\tstop(e);\r\n\t\treturn;\r\n\t}\r\n\tlastClick = timeStamp;\r\n\r\n\thandler(e);\r\n}\r\n\r\n// @function addListener(…): this\r\n// Alias to [`L.DomEvent.on`](#domevent-on)\r\nexport {on as addListener};\r\n\r\n// @function removeListener(…): this\r\n// Alias to [`L.DomEvent.off`](#domevent-off)\r\nexport {off as removeListener};\r\n","import * as DomEvent from './DomEvent';\nimport * as Util from '../core/Util';\nimport {Point} from '../geometry/Point';\nimport * as Browser from '../core/Browser';\n\n/*\n * @namespace DomUtil\n *\n * Utility functions to work with the [DOM](https://developer.mozilla.org/docs/Web/API/Document_Object_Model)\n * tree, used by Leaflet internally.\n *\n * Most functions expecting or returning a `HTMLElement` also work for\n * SVG elements. The only difference is that classes refer to CSS classes\n * in HTML and SVG classes in SVG.\n */\n\n if (!Element.prototype.matches) {\n var ep = Element.prototype;\n \n if (ep.webkitMatchesSelector) // Chrome <34, SF<7.1, iOS<8\n ep.matches = ep.webkitMatchesSelector;\n \n if (ep.msMatchesSelector) // IE9/10/11 & Edge\n ep.matches = ep.msMatchesSelector;\n \n if (ep.mozMatchesSelector) // FF<34\n ep.matches = ep.mozMatchesSelector;\n }\n\n// @property TRANSFORM: String\n// Vendor-prefixed fransform style name (e.g. `'webkitTransform'` for WebKit).\nexport var TRANSFORM = testProp(\n ['transform', 'WebkitTransform', 'OTransform', 'MozTransform', 'msTransform']);\n\n// webkitTransition comes first because some browser versions that drop vendor prefix don't do\n// the same for the transitionend event, in particular the Android 4.1 stock browser\n\n// @property TRANSITION: String\n// Vendor-prefixed transform style name.\nexport var TRANSITION = testProp(\n ['webkitTransition', 'transition', 'OTransition', 'MozTransition', 'msTransition']);\n\nexport var TRANSITION_END =\n TRANSITION === 'webkitTransition' || TRANSITION === 'OTransition' ? TRANSITION + 'End' : 'transitionend';\n\n\n// @function get(id: String|HTMLElement): HTMLElement\n// Returns an element given its DOM id, or returns the element itself\n// if it was passed directly.\nexport function get(id) {\n return typeof id === 'string' ? document.getElementById(id) : id;\n}\n\n// @function getStyle(el: HTMLElement, styleAttrib: String): String\n// Returns the value for a certain style attribute on an element,\n// including computed values or values set through CSS.\nexport function getStyle(el, style) {\n var value = el.style[style] || (el.currentStyle && el.currentStyle[style]);\n\n if ((!value || value === 'auto') && document.defaultView) {\n var css = document.defaultView.getComputedStyle(el, null);\n value = css ? css[style] : null;\n }\n return value === 'auto' ? null : value;\n}\n\n// @function create(tagName: String, className?: String, container?: HTMLElement): HTMLElement\n// Creates an HTML element with `tagName`, sets its class to `className`, and optionally appends it to `container` element.\nexport function create(tagName, className, container) {\n var el = document.createElement(tagName);\n el.className = className || '';\n\n if (container) {\n container.appendChild(el);\n }\n return el;\n}\n\n// @function remove(el: HTMLElement)\n// Removes `el` from its parent element\nexport function remove(el) {\n var parent = el.parentNode;\n if (parent) {\n parent.removeChild(el);\n }\n}\n\n// @function empty(el: HTMLElement)\n// Removes all of `el`'s children elements from `el`\nexport function empty(el) {\n while (el.firstChild) {\n el.removeChild(el.firstChild);\n }\n}\n\n// @function toFront(el: HTMLElement)\n// Makes `el` the last child of its parent, so it renders in front of the other children.\nexport function toFront(el) {\n el.parentNode.appendChild(el);\n}\n\n// @function toBack(el: HTMLElement)\n// Makes `el` the first child of its parent, so it renders behind the other children.\nexport function toBack(el) {\n var parent = el.parentNode;\n parent.insertBefore(el, parent.firstChild);\n}\n\n// @function hasClass(el: HTMLElement, name: String): Boolean\n// Returns `true` if the element's class attribute contains `name`.\nexport function hasClass(el, name) {\n if (el.classList !== undefined) {\n return el.classList.contains(name);\n }\n var className = getClass(el);\n return className.length > 0 && new RegExp('(^|\\\\s)' + name + '(\\\\s|$)').test(className);\n}\n\n// @function addClass(el: HTMLElement, name: String)\n// Adds `name` to the element's class attribute.\nexport function addClass(el, name) {\n if (el.classList !== undefined) {\n var classes = Util.splitWords(name);\n for (var i = 0, len = classes.length; i < len; i++) {\n el.classList.add(classes[i]);\n }\n } else if (!hasClass(el, name)) {\n var className = getClass(el);\n setClass(el, (className ? className + ' ' : '') + name);\n }\n}\n\n// @function removeClass(el: HTMLElement, name: String)\n// Removes `name` from the element's class attribute.\nexport function removeClass(el, name) {\n if (el.classList !== undefined) {\n el.classList.remove(name);\n } else {\n setClass(el, Util.trim((' ' + getClass(el) + ' ').replace(' ' + name + ' ', ' ')));\n }\n}\n\n// @function setClass(el: HTMLElement, name: String)\n// Sets the element's class.\nexport function setClass(el, name) {\n if (el.className.baseVal === undefined) {\n el.className = name;\n } else {\n // in case of SVG element\n el.className.baseVal = name;\n }\n}\n\n// @function getClass(el: HTMLElement): String\n// Returns the element's class.\nexport function getClass(el) {\n return el.className.baseVal === undefined ? el.className : el.className.baseVal;\n}\n\n// @function setOpacity(el: HTMLElement, opacity: Number)\n// Set the opacity of an element (including old IE support).\n// `opacity` must be a number from `0` to `1`.\nexport function setOpacity(el, value) {\n if ('opacity' in el.style) {\n el.style.opacity = value;\n } else if ('filter' in el.style) {\n _setOpacityIE(el, value);\n }\n}\n\nfunction _setOpacityIE(el, value) {\n var filter = false,\n filterName = 'DXImageTransform.Microsoft.Alpha';\n\n // filters collection throws an error if we try to retrieve a filter that doesn't exist\n try {\n filter = el.filters.item(filterName);\n } catch (e) {\n // don't set opacity to 1 if we haven't already set an opacity,\n // it isn't needed and breaks transparent pngs.\n if (value === 1) { return; }\n }\n\n value = Math.round(value * 100);\n\n if (filter) {\n filter.Enabled = (value !== 100);\n filter.Opacity = value;\n } else {\n el.style.filter += ' progid:' + filterName + '(opacity=' + value + ')';\n }\n}\n\n// @function testProp(props: String[]): String|false\n// Goes through the array of style names and returns the first name\n// that is a valid style name for an element. If no such name is found,\n// it returns false. Useful for vendor-prefixed styles like `transform`.\nexport function testProp(props) {\n var style = document.documentElement.style;\n\n for (var i = 0; i < props.length; i++) {\n if (props[i] in style) {\n return props[i];\n }\n }\n return false;\n}\n\nexport function isPropertySupported(prop) {\n var style = document.documentElement.style;\n return prop in style;\n}\n\n// @function setTransform(el: HTMLElement, offset: Point, scale?: Number)\n// Resets the 3D CSS transform of `el` so it is translated by `offset` pixels\n// and optionally scaled by `scale`. Does not have an effect if the\n// browser doesn't support 3D CSS transforms.\nexport function setTransform(el, offset, scale) {\n var pos = offset || new Point(0, 0);\n\n el.style[TRANSFORM] =\n (Browser.ie3d ?\n 'translate(' + pos.x + 'px,' + pos.y + 'px)' :\n 'translate3d(' + pos.x + 'px,' + pos.y + 'px,0)') +\n (scale ? ' scale(' + scale + ')' : '');\n}\n\n// @function setPosition(el: HTMLElement, position: Point)\n// Sets the position of `el` to coordinates specified by `position`,\n// using CSS translate or top/left positioning depending on the browser\n// (used by Leaflet internally to position its layers).\nexport function setPosition(el, point) {\n\n /*eslint-disable */\n el._leaflet_pos = point;\n /*eslint-enable */\n\n if (Browser.any3d) {\n setTransform(el, point);\n } else {\n el.style.left = point.x + 'px';\n el.style.top = point.y + 'px';\n }\n}\n\n// @function getPosition(el: HTMLElement): Point\n// Returns the coordinates of an element previously positioned with setPosition.\nexport function getPosition(el) {\n // this method is only used for elements previously positioned using setPosition,\n // so it's safe to cache the position for performance\n\n return el._leaflet_pos || new Point(0, 0);\n}\n\n// @function disableTextSelection()\n// Prevents the user from generating `selectstart` DOM events, usually generated\n// when the user drags the mouse through a page with text. Used internally\n// by Leaflet to override the behaviour of any click-and-drag interaction on\n// the map. Affects drag interactions on the whole document.\n\n// @function enableTextSelection()\n// Cancels the effects of a previous [`L.DomUtil.disableTextSelection`](#domutil-disabletextselection).\nexport var disableTextSelection;\nexport var enableTextSelection;\nvar _userSelect;\nif ('onselectstart' in document) {\n disableTextSelection = function () {\n DomEvent.on(window, 'selectstart', DomEvent.preventDefault);\n };\n enableTextSelection = function () {\n DomEvent.off(window, 'selectstart', DomEvent.preventDefault);\n };\n} else {\n var userSelectProperty = testProp(\n ['userSelect', 'WebkitUserSelect', 'OUserSelect', 'MozUserSelect', 'msUserSelect']);\n\n disableTextSelection = function () {\n if (userSelectProperty) {\n var style = document.documentElement.style;\n _userSelect = style[userSelectProperty];\n style[userSelectProperty] = 'none';\n }\n };\n enableTextSelection = function () {\n if (userSelectProperty) {\n document.documentElement.style[userSelectProperty] = _userSelect;\n _userSelect = undefined;\n }\n };\n}\n\n// @function disableImageDrag()\n// As [`L.DomUtil.disableTextSelection`](#domutil-disabletextselection), but\n// for `dragstart` DOM events, usually generated when the user drags an image.\nexport function disableImageDrag() {\n DomEvent.on(window, 'dragstart', DomEvent.preventDefault);\n}\n\n// @function enableImageDrag()\n// Cancels the effects of a previous [`L.DomUtil.disableImageDrag`](#domutil-disabletextselection).\nexport function enableImageDrag() {\n DomEvent.off(window, 'dragstart', DomEvent.preventDefault);\n}\n\nvar _outlineElement, _outlineStyle;\n// @function preventOutline(el: HTMLElement)\n// Makes the [outline](https://developer.mozilla.org/docs/Web/CSS/outline)\n// of the element `el` invisible. Used internally by Leaflet to prevent\n// focusable elements from displaying an outline when the user performs a\n// drag interaction on them.\nexport function preventOutline(element) {\n while (element.tabIndex === -1) {\n element = element.parentNode;\n }\n if (!element || !element.style) { return; }\n restoreOutline();\n _outlineElement = element;\n _outlineStyle = element.style.outline;\n element.style.outline = 'none';\n DomEvent.on(window, 'keydown', restoreOutline);\n}\n\n// @function restoreOutline()\n// Cancels the effects of a previous [`L.DomUtil.preventOutline`]().\nexport function restoreOutline() {\n if (!_outlineElement) { return; }\n _outlineElement.style.outline = _outlineStyle;\n _outlineElement = undefined;\n _outlineStyle = undefined;\n DomEvent.off(window, 'keydown', restoreOutline);\n}\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var baseGetTag = require('./_baseGetTag'),\n isObject = require('./isObject');\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nmodule.exports = isFunction;\n","var root = require('./_root');\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nmodule.exports = coreJsData;\n","var coreJsData = require('./_coreJsData');\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nmodule.exports = isMasked;\n","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nmodule.exports = toSource;\n","var isFunction = require('./isFunction'),\n isMasked = require('./_isMasked'),\n isObject = require('./isObject'),\n toSource = require('./_toSource');\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nmodule.exports = baseIsNative;\n","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nmodule.exports = getValue;\n","var baseIsNative = require('./_baseIsNative'),\n getValue = require('./_getValue');\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nmodule.exports = getNative;\n","var getNative = require('./_getNative');\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nmodule.exports = defineProperty;\n","var defineProperty = require('./_defineProperty');\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nmodule.exports = baseAssignValue;\n","/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nmodule.exports = eq;\n","var baseAssignValue = require('./_baseAssignValue'),\n eq = require('./eq');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nmodule.exports = assignValue;\n","var assignValue = require('./_assignValue'),\n baseAssignValue = require('./_baseAssignValue');\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\nmodule.exports = copyObject;\n","/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nmodule.exports = identity;\n","/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\nmodule.exports = apply;\n","var apply = require('./_apply');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\nmodule.exports = overRest;\n","/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\nmodule.exports = constant;\n","var constant = require('./constant'),\n defineProperty = require('./_defineProperty'),\n identity = require('./identity');\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\nmodule.exports = baseSetToString;\n","/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeNow = Date.now;\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\nmodule.exports = shortOut;\n","var baseSetToString = require('./_baseSetToString'),\n shortOut = require('./_shortOut');\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\nmodule.exports = setToString;\n","var identity = require('./identity'),\n overRest = require('./_overRest'),\n setToString = require('./_setToString');\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\nmodule.exports = baseRest;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nmodule.exports = isLength;\n","var isFunction = require('./isFunction'),\n isLength = require('./isLength');\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nmodule.exports = isArrayLike;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nmodule.exports = isIndex;\n","var eq = require('./eq'),\n isArrayLike = require('./isArrayLike'),\n isIndex = require('./_isIndex'),\n isObject = require('./isObject');\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\nmodule.exports = isIterateeCall;\n","var baseRest = require('./_baseRest'),\n isIterateeCall = require('./_isIterateeCall');\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\nmodule.exports = createAssigner;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nmodule.exports = isPrototype;\n","/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nmodule.exports = baseTimes;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;\n","var baseIsArguments = require('./_baseIsArguments'),\n isObjectLike = require('./isObjectLike');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nmodule.exports = isArguments;\n","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, 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;\n\nmodule.exports = isArray;\n","/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = stubFalse;\n","var root = require('./_root'),\n stubFalse = require('./stubFalse');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nmodule.exports = isBuffer;\n","var baseGetTag = require('./_baseGetTag'),\n isLength = require('./isLength'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nmodule.exports = baseIsTypedArray;\n","/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nmodule.exports = baseUnary;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nmodule.exports = nodeUtil;\n","var baseIsTypedArray = require('./_baseIsTypedArray'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nmodule.exports = isTypedArray;\n","var baseTimes = require('./_baseTimes'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isIndex = require('./_isIndex'),\n isTypedArray = require('./isTypedArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = arrayLikeKeys;\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nmodule.exports = overArg;\n","var overArg = require('./_overArg');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nmodule.exports = nativeKeys;\n","var isPrototype = require('./_isPrototype'),\n nativeKeys = require('./_nativeKeys');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeys;\n","var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeys = require('./_baseKeys'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nmodule.exports = keys;\n","var assignValue = require('./_assignValue'),\n copyObject = require('./_copyObject'),\n createAssigner = require('./_createAssigner'),\n isArrayLike = require('./isArrayLike'),\n isPrototype = require('./_isPrototype'),\n keys = require('./keys');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns own enumerable string keyed properties of source objects to the\n * destination object. Source objects are applied from left to right.\n * Subsequent sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object` and is loosely based on\n * [`Object.assign`](https://mdn.io/Object/assign).\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assignIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assign({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'c': 3 }\n */\nvar assign = createAssigner(function(object, source) {\n if (isPrototype(source) || isArrayLike(source)) {\n copyObject(source, keys(source), object);\n return;\n }\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n assignValue(object, key, source[key]);\n }\n }\n});\n\nmodule.exports = assign;\n","var document = typeof window !== 'undefined' && typeof window.document !== 'undefined' ? window.document : {};\nvar keyboardAllowed = typeof Element !== 'undefined' && 'ALLOW_KEYBOARD_INPUT' in Element;\n\nvar fn = (function () {\n var val;\n\n var fnMap = [\n [\n 'requestFullscreen',\n 'exitFullscreen',\n 'fullscreenElement',\n 'fullscreenEnabled',\n 'fullscreenchange',\n 'fullscreenerror'\n ],\n // New WebKit\n [\n 'webkitRequestFullscreen',\n 'webkitExitFullscreen',\n 'webkitFullscreenElement',\n 'webkitFullscreenEnabled',\n 'webkitfullscreenchange',\n 'webkitfullscreenerror'\n\n ],\n // Old WebKit (Safari 5.1)\n [\n 'webkitRequestFullScreen',\n 'webkitCancelFullScreen',\n 'webkitCurrentFullScreenElement',\n 'webkitCancelFullScreen',\n 'webkitfullscreenchange',\n 'webkitfullscreenerror'\n\n ],\n [\n 'mozRequestFullScreen',\n 'mozCancelFullScreen',\n 'mozFullScreenElement',\n 'mozFullScreenEnabled',\n 'mozfullscreenchange',\n 'mozfullscreenerror'\n ],\n [\n 'msRequestFullscreen',\n 'msExitFullscreen',\n 'msFullscreenElement',\n 'msFullscreenEnabled',\n 'MSFullscreenChange',\n 'MSFullscreenError'\n ]\n ];\n\n var i = 0;\n var l = fnMap.length;\n var ret = {};\n\n for (; i < l; i++) {\n val = fnMap[i];\n if (val && val[1] in document) {\n for (i = 0; i < val.length; i++) {\n ret[fnMap[0][i]] = val[i];\n }\n return ret;\n }\n }\n\n return false;\n})();\n\nvar eventNameMap = {\n change: fn.fullscreenchange,\n error: fn.fullscreenerror\n};\n\nvar screenfull = {\n request: function (elem) {\n var request = fn.requestFullscreen;\n\n elem = elem || document.documentElement;\n\n // Work around Safari 5.1 bug: reports support for\n // keyboard in fullscreen even though it doesn't.\n // Browser sniffing, since the alternative with\n // setTimeout is even worse.\n if (/5\\.1[.\\d]* Safari/.test(navigator.userAgent)) {\n elem[request]();\n } else {\n elem[request](keyboardAllowed && Element.ALLOW_KEYBOARD_INPUT);\n }\n },\n exit: function () {\n document[fn.exitFullscreen]();\n },\n toggle: function (elem) {\n if (this.isFullscreen) {\n this.exit();\n } else {\n this.request(elem);\n }\n },\n onchange: function (callback) {\n this.on('change', callback);\n },\n onerror: function (callback) {\n this.on('error', callback);\n },\n on: function (event, callback) {\n var eventName = eventNameMap[event];\n if (eventName) {\n document.addEventListener(eventName, callback, false);\n }\n },\n off: function (event, callback) {\n var eventName = eventNameMap[event];\n if (eventName) {\n document.removeEventListener(eventName, callback, false);\n }\n },\n raw: fn\n};\n\nObject.defineProperties(screenfull, {\n isFullscreen: {\n get: function () {\n return Boolean(document[fn.fullscreenElement]);\n }\n },\n element: {\n enumerable: true,\n get: function () {\n return document[fn.fullscreenElement];\n }\n },\n enabled: {\n enumerable: true,\n get: function () {\n // Coerce to boolean in case of old WebKit\n return Boolean(document[fn.fullscreenEnabled]);\n }\n }\n});\n\nexport {screenfull};","import * as Util from '../core/Util';\nimport {Evented} from '../core/Events';\n// import {Class} from '../core/Class';\nimport * as Browser from '../core/Browser';\nimport * as DomEvent from '../dom/DomEvent';\nimport * as DomUtil from '../dom/DomUtil';\n\nimport debounce from 'lodash/debounce';\nimport assign from 'lodash/assign';\n\nimport {screenfull} from '../screenfull';\n\n/*\n * @class Reader\n * @aka cozy.Map\n * @inherits Evented\n *\n * The central class of the API — it is used to create a book on a page and manipulate it.\n *\n * @example\n *\n * ```js\n * // initialize the map on the \"map\" div with a given center and zoom\n * var map = L.map('map', {\n * center: [51.505, -0.09],\n * zoom: 13\n * });\n * ```\n *\n */\n\nvar _padding = 1.0;\nexport var Reader = Evented.extend({\n options: {\n regions: [\n 'header',\n 'toolbar.top',\n 'toolbar.left',\n 'main',\n 'toolbar.right',\n 'toolbar.bottom',\n 'footer'\n ],\n metadata: {},\n flow: 'auto',\n engine: 'epubjs',\n fontSizeLarge: '140%',\n fontSizeSmall: '90%',\n fontSizeDefault: '100%',\n trackResize: true,\n text_size: 100,\n mobileMediaQuery: '(min-device-width : 300px) and (max-device-width : 600px)',\n theme: 'default',\n themes: []\n },\n\n initialize: function(id, options) {\n var self = this\n\n if ( localStorage.getItem('cozy.options') ) {\n options = assign(options, JSON.parse(localStorage.getItem('cozy.options')));\n }\n options = Util.setOptions(this, options);\n\n this._checkFeatureCompatibility();\n\n this.metadata = this.options.metadata; // initial seed\n\n this._initContainer(id);\n this._initLayout();\n\n if ( this.options.themes && this.options.themes.length > 0 ) {\n this.options.themes.forEach(function(theme) {\n if ( theme.href ) { return; }\n var klass = theme.klass;\n var rules = {};\n for(var rule in theme.rules) {\n var new_rule = '.' + klass;\n if ( rule == 'body' ) { new_rule = 'body' + new_rule; }\n else { new_rule += ' ' + rule ; }\n rules[new_rule] = theme.rules[rule];\n }\n theme.rules = rules;\n });\n }\n\n this._updateTheme();\n\n // hack for https://github.com/Leaflet/Leaflet/issues/1980\n // this._onResize = Util.bind(this._onResize, this);\n\n this._initEvents();\n\n this.callInitHooks();\n\n this._mode = this.options.mode;\n },\n\n start: function(target, cb) {\n var self = this;\n\n if ( typeof(target) == 'function' && cb === undefined ) {\n cb = target;\n target = undefined;\n }\n\n Util.loader.js(this.options.engine_href).then(function() {\n self._start(target, cb);\n self._loaded = true;\n })\n },\n\n _start: function(target, cb) {\n var self = this;\n target = target || 0;\n\n self.open(function() {\n self.draw(target, cb);\n });\n },\n\n switch: function(flow, target) {\n var target = target || this.currentLocation();\n if ( flow === undefined ) {\n flow = ( this.options.flow == 'auto' ) ? 'scrolled-doc' : 'auto';\n }\n this.options.flow = flow;\n this.destroy();\n this.draw(target);\n },\n\n reopen: function(options, target) {\n var target = target || this.currentLocation();\n Util.extend(this.options, options);\n this.destroy();\n console.log(\"AHOY REOPENED?\");\n return;\n this.draw(target);\n this.fire('reopen');\n },\n\n saveOptions: function(options) {\n localStorage.setItem('cozy.options', JSON.stringify(options));\n },\n\n _updateTheme: function() {\n DomUtil.removeClass(this._container, 'cozy-theme-' + ( this._container.dataset.theme || 'default' ));\n DomUtil.addClass(this._container, 'cozy-theme-' + this.options.theme);\n this._container.dataset.theme = this.options.theme;\n },\n\n draw: function(target) {\n // NOOP\n },\n\n next: function() {\n // NOOP\n },\n\n prev: function() {\n // NOOP\n },\n\n display: function(index) {\n // NOOP\n },\n\n gotoPage: function(target) {\n // NOOP\n },\n\n goBack: function() {\n history.back();\n },\n\n goForward: function() {\n history.forward();\n },\n\n requestFullscreen: function() {\n if ( screenfull.enabled ) {\n // this._preResize();\n screenfull.toggle(this._container);\n }\n },\n\n _preResize: function() {\n\n },\n\n _initContainer: function (id) {\n var container = this._container = DomUtil.get(id);\n\n if (!container) {\n throw new Error('Reader container not found.');\n } else if (container._cozy_id) {\n throw new Error('Reader container is already initialized.');\n }\n\n DomEvent.on(container, 'scroll', this._onScroll, this);\n this._containerId = Util.stamp(container);\n },\n\n _initLayout: function () {\n var container = this._container;\n\n this._fadeAnimated = this.options.fadeAnimation && Browser.any3d;\n\n DomUtil.addClass(container, 'cozy-container' +\n (Browser.touch ? ' cozy-touch' : '') +\n (Browser.retina ? ' cozy-retina' : '') +\n (Browser.ielt9 ? ' cozy-oldie' : '') +\n (Browser.safari ? ' cozy-safari' : '') +\n (this._fadeAnimated ? ' cozy-fade-anim' : '') +\n ' cozy-engine-' + this.options.engine + \n ' cozy-theme-' + this.options.theme);\n\n var position = DomUtil.getStyle(container, 'position');\n\n this._initPanes();\n\n if ( ! Browser.columnCount ) {\n this.options.flow = 'scrolled-doc';\n }\n },\n\n _initPanes: function () {\n var self = this;\n\n var panes = this._panes = {};\n\n var l = 'cozy-';\n var container = this._container;\n\n var prefix = 'cozy-module-';\n\n DomUtil.addClass(container, 'cozy-container');\n panes['top'] = DomUtil.create('div', prefix + 'top', container);\n panes['main'] = DomUtil.create('div', prefix + 'main', container);\n panes['bottom'] = DomUtil.create('div', prefix + 'bottom', container);\n\n panes['left'] = DomUtil.create('div', prefix + 'left', panes['main']);\n panes['book-cover'] = DomUtil.create('div', prefix + 'book-cover', panes['main']);\n panes['right'] = DomUtil.create('div', prefix + 'right', panes['main']);\n panes['book'] = DomUtil.create('div', prefix + 'book', panes['book-cover']);\n panes['loader'] = DomUtil.create('div', prefix + 'book-loading', panes['book']);\n this._initLoader();\n },\n\n _checkIfLoaded: function () {\n if (!this._loaded) {\n throw new Error('Set map center and zoom first.');\n }\n },\n\n // DOM event handling\n\n // @section Interaction events\n _initEvents: function (remove) {\n this._targets = {};\n this._targets[Util.stamp(this._container)] = this;\n\n var onOff = remove ? DomEvent.off : DomEvent.on;\n\n // @event click: MouseEvent\n // Fired when the user clicks (or taps) the map.\n // @event dblclick: MouseEvent\n // Fired when the user double-clicks (or double-taps) the map.\n // @event mousedown: MouseEvent\n // Fired when the user pushes the mouse button on the map.\n // @event mouseup: MouseEvent\n // Fired when the user releases the mouse button on the map.\n // @event mouseover: MouseEvent\n // Fired when the mouse enters the map.\n // @event mouseout: MouseEvent\n // Fired when the mouse leaves the map.\n // @event mousemove: MouseEvent\n // Fired while the mouse moves over the map.\n // @event contextmenu: MouseEvent\n // Fired when the user pushes the right mouse button on the map, prevents\n // default browser context menu from showing if there are listeners on\n // this event. Also fired on mobile when the user holds a single touch\n // for a second (also called long press).\n // @event keypress: KeyboardEvent\n // Fired when the user presses a key from the keyboard while the map is focused.\n // onOff(this._container, 'click dblclick mousedown mouseup ' +\n // 'mouseover mouseout mousemove contextmenu keypress', this._handleDOMEvent, this);\n\n // if (this.options.trackResize) {\n // var self = this;\n // var fn = debounce(function(){ self.invalidateSize({}); }, 150);\n // onOff(window, 'resize', fn, this);\n // }\n\n if (Browser.any3d && this.options.transform3DLimit) {\n (remove ? this.off : this.on).call(this, 'moveend', this._onMoveEnd);\n }\n\n var self = this;\n if (screenfull.enabled) {\n screenfull.on('change', function() {\n // setTimeout(function() {\n // self.invalidateSize({});\n // }, 100);\n console.log('AHOY: Am I fullscreen?', screenfull.isFullscreen ? 'YES' : 'NO');\n });\n }\n\n self.on(\"updateLocation\", function(location) {\n var location_href = location.start;\n\n if ( self._ignoreHistory ) {\n self._ignoreHistory = false;\n } else {\n var tmp_href = window.location.href.split(\"#\");\n tmp_href[1] = location_href.substr(8, location_href.length - 8 - 1);\n history.pushState({ cfi: location_href }, '', tmp_href.join('#'));\n }\n\n // window.location.hash = '#' + location_href.substr(8, location_href.length - 8 - 1);\n })\n\n window.addEventListener('popstate', function(event) {\n if ( event.isTrusted && event.state !== null ) {\n self._ignoreHistory = true;\n self.gotoPage(event.state.cfi);\n }\n })\n\n document.addEventListener('keydown', function(event) {\n var keyName = event.key;\n var target = event.target;\n var IGNORE_TARGETS = [ 'input', 'target' ];\n if ( IGNORE_TARGETS.indexOf(target.localName) >= 0 ) {\n return;\n }\n\n self.fire('keyDown', { keyName: keyName });\n });\n\n self.on('keyDown', function(keyName) {\n switch(keyName.keyName) {\n case 'ArrowRight':\n case 'PageDown':\n self.next();\n break;\n case 'ArrowLeft':\n case 'PageUp':\n self.prev();\n break;\n case 'Home':\n self._scroll('HOME');\n break;\n case 'End':\n self._scroll('END')\n break;\n }\n });\n },\n\n // _onResize: function() {\n // if ( ! this._resizeRequest ) {\n // this._resizeRequest = Util.requestAnimFrame(function() {\n // this.invalidateSize({})\n // }, this);\n // }\n // },\n\n _onScroll: function () {\n this._container.scrollTop = 0;\n this._container.scrollLeft = 0;\n },\n\n _handleDOMEvent: function (e) {\n if (!this._loaded || DomEvent.skipped(e)) { return; }\n\n var type = e.type === 'keypress' && e.keyCode === 13 ? 'click' : e.type;\n\n if (type === 'mousedown') {\n // prevents outline when clicking on keyboard-focusable element\n DomUtil.preventOutline(e.target || e.srcElement);\n }\n\n this._fireDOMEvent(e, type);\n },\n\n _fireDOMEvent: function (e, type, targets) {\n\n if (e.type === 'click') {\n // Fire a synthetic 'preclick' event which propagates up (mainly for closing popups).\n // @event preclick: MouseEvent\n // Fired before mouse click on the map (sometimes useful when you\n // want something to happen on click before any existing click\n // handlers start running).\n var synth = Util.extend({}, e);\n synth.type = 'preclick';\n this._fireDOMEvent(synth, synth.type, targets);\n }\n\n if (e._stopped) { return; }\n\n // Find the layer the event is propagating from and its parents.\n targets = (targets || []).concat(this._findEventTargets(e, type));\n\n if (!targets.length) { return; }\n\n var target = targets[0];\n if (type === 'contextmenu' && target.listens(type, true)) {\n DomEvent.preventDefault(e);\n }\n\n var data = {\n originalEvent: e\n };\n\n if (e.type !== 'keypress') {\n var isMarker = (target.options && 'icon' in target.options);\n data.containerPoint = isMarker ?\n this.latLngToContainerPoint(target.getLatLng()) : this.mouseEventToContainerPoint(e);\n data.layerPoint = this.containerPointToLayerPoint(data.containerPoint);\n data.latlng = isMarker ? target.getLatLng() : this.layerPointToLatLng(data.layerPoint);\n }\n\n for (var i = 0; i < targets.length; i++) {\n targets[i].fire(type, data, true);\n if (data.originalEvent._stopped ||\n (targets[i].options.nonBubblingEvents && Util.indexOf(targets[i].options.nonBubblingEvents, type) !== -1)) { return; }\n }\n },\n\n getFixedBookPanelSize: function() {\n // have to make the book \n var style = window.getComputedStyle(this._panes['book']);\n var h = this._panes['book'].clientHeight - parseFloat(style.paddingTop) - parseFloat(style.paddingBottom);\n var w = this._panes['book'].clientWidth - parseFloat(style.paddingRight) - parseFloat(style.paddingLeft);\n return { height: Math.floor(h * 1.00), width: Math.floor(w * 1.00) };\n },\n\n invalidateSize: function(options) {\n // TODO: IS THIS EVER USED?\n var self = this;\n\n if ( ! self._drawn ) { return; }\n\n Util.cancelAnimFrame(this._resizeRequest);\n\n if (! this._loaded) { return this; }\n\n this.fire('resized');\n },\n\n _resizeBookPane: function() {\n\n },\n\n _setupHooks: function() {\n\n },\n\n _checkFeatureCompatibility: function() {\n if ( ! DomUtil.isPropertySupported('columnCount') || this._checkMobileDevice() ) {\n // force\n this.options.flow = 'scrolled-doc';\n }\n if ( this._checkMobileDevice() ) {\n // this.options.fontSizeLarge = '160%';\n // this.options.fontSizeSmall ='100%';\n // this.options.fontSizeDefault = '120%';\n this.options.text_size = 120;\n }\n },\n\n _checkMobileDevice: function() {\n if ( this._isMobile === undefined ) {\n this._isMobile = false;\n if ( this.options.mobileMediaQuery ) {\n this._isMobile = window.matchMedia(this.options.mobileMediaQuery).matches;\n }\n }\n return this._isMobile;\n },\n\n _initLoader: function() {\n // is this not awesome?\n var template = `
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
`;\n\n var body = new DOMParser().parseFromString(template, \"text/html\").body;\n while ( body.children.length ) {\n this._panes['loader'].appendChild(body.children[0]);\n }\n },\n\n EOT: true\n});\n\nexport function createReader(id, options) {\n return new Reader(id, options);\n}\n","import {Class} from '../core/Class';\nimport {Reader} from '../reader/Reader';\nimport * as Util from '../core/Util';\nimport * as DomUtil from '../dom/DomUtil';\n\n/*\n * @class Control\n * @aka L.Control\n * @inherits Class\n *\n * L.Control is a base class for implementing reader controls. Handles regioning.\n * All other controls extend from this class.\n */\n\nexport var Control = Class.extend({\n // @section\n // @aka Control options\n options: {\n // @option region: String = 'topright'\n // The region of the control (one of the reader corners). Possible values are `'topleft'`,\n // `'topright'`, `'bottomleft'` or `'bottomright'`\n },\n\n initialize: function (options) {\n Util.setOptions(this, options);\n if ( options.container ) {\n this._container = options.container;\n this._locked = true;\n }\n this._id = (new Date()).getTime() + '-' + parseInt(Math.random((new Date()).getTime()) * 1000, 10);\n },\n\n /* @section\n * Classes extending L.Control will inherit the following methods:\n *\n * @method getRegion: string\n * Returns the region of the control.\n */\n getRegion: function () {\n return this.options.region;\n },\n\n // @method setRegion(region: string): this\n // Sets the region of the control.\n setRegion: function (region) {\n var reader = this._reader;\n\n if (reader) {\n reader.removeControl(this);\n }\n\n this.options.region = region;\n\n if (reader) {\n reader.addControl(this);\n }\n\n return this;\n },\n\n // @method getContainer: HTMLElement\n // Returns the HTMLElement that contains the control.\n getContainer: function () {\n return this._container;\n },\n\n // @method addTo(reader: Map): this\n // Adds the control to the given reader.\n addTo: function (reader) {\n this.remove();\n this._reader = reader;\n\n var container = this._container = this.onAdd(reader);\n\n DomUtil.addClass(container, 'cozy-control');\n\n if ( ! this._locked ) {\n var region = this.getRegion();\n var area = reader.getControlRegion(region);\n area.appendChild(container);\n }\n\n return this;\n },\n\n // @method remove: this\n // Removes the control from the reader it is currently active on.\n remove: function () {\n if (!this._reader) {\n return this;\n }\n\n if (! this._container) {\n return this;\n }\n\n if ( ! this._locked ) {\n DomUtil.remove(this._container);\n }\n\n if (this.onRemove) {\n this.onRemove(this._reader);\n }\n\n this._reader = null;\n\n return this;\n },\n\n _refocusOnMap: function (e) {\n // if reader exists and event is not a keyboard event\n if (this._reader && e && e.screenX > 0 && e.screenY > 0) {\n this._reader.getContainer().focus();\n }\n },\n\n _className: function(widget) {\n var className = [ 'cozy-control' ];\n if ( this.options.direction ) {\n className.push('cozy-control-' + this.options.direction);\n }\n if ( widget ) {\n className.push('cozy-control-' + widget);\n }\n return className.join(' ');\n }\n});\n\nexport var control = function (options) {\n return new Control(options);\n};\n\n/* @section Extension methods\n * @uninheritable\n *\n * Every control should extend from `L.Control` and (re-)implement the following methods.\n *\n * @method onAdd(reader: Map): HTMLElement\n * Should return the container DOM element for the control and add listeners on relevant reader events. Called on [`control.addTo(reader)`](#control-addTo).\n *\n * @method onRemove(reader: Map)\n * Optional method. Should contain all clean up code that removes the listeners previously added in [`onAdd`](#control-onadd). Called on [`control.remove()`](#control-remove).\n */\n\n/* @namespace Map\n * @section Methods for Layers and Controls\n */\nReader.include({\n // @method addControl(control: Control): this\n // Adds the given control to the reader\n addControl: function (control) {\n control.addTo(this);\n return this;\n },\n\n // @method removeControl(control: Control): this\n // Removes the given control from the reader\n removeControl: function (control) {\n control.remove();\n return this;\n },\n\n getControlContainer: function() {\n var l = 'cozy-';\n if ( ! this._controlContainer ) {\n this._controlContainer =\n DomUtil.create('div', l + 'control-container', this._container);\n }\n return this._controlContainer;\n },\n\n getControlRegion: function (target) {\n\n if ( ! this._panes[target] ) {\n // target is dot-delimited string\n // first dot is the panel\n var parts = target.split('.');\n var tmp = [];\n var parent = this._container;\n var x = 0;\n while ( parts.length ) {\n var slug = parts.shift();\n tmp.push(slug);\n var panel = tmp.join(\".\");\n var className = 'cozy-panel-' + slug;\n if ( ! this._panes[panel] ) {\n this._panes[panel] = DomUtil.create('div', className, parent);\n }\n parent = this._panes[panel];\n x += 1;\n if ( x > 100 ) { break; }\n }\n }\n return this._panes[target];\n },\n\n getControlRegion_1: function (target) {\n\n var tmp = target.split('.');\n var region = tmp.shift();\n var slot = tmp.pop() || '-slot';\n\n var container = this._panes[region];\n if ( ! this._panes[target] ) {\n var className = 'cozy-' + region + '--item cozy-slot-' + slot\n if ( ! this._panes[region + '.' + slot] ) {\n var div = DomUtil.create('div', className);\n if ( slot == 'left' || slot == 'bottom' ) {\n var childElement = this._panes[region].firstChild;\n this._panes[region].insertBefore(div, childElement);\n } else {\n this._panes[region].appendChild(div);\n }\n this._panes[region + '.' + slot] = div;\n }\n className = this._classify(tmp);\n this._panes[target] = DomUtil.create('div', className, this._panes[region + '.' + slot]);\n }\n\n return this._panes[target];\n },\n\n _classify: function(tmp) {\n var l = 'cozy-';\n var className = [];\n for(var i in tmp) {\n className.push(l + tmp[i]);\n }\n className = className.join(' ');\n return className;\n },\n\n _clearControlRegion: function () {\n for (var i in this._controlRegions) {\n DomUtil.remove(this._controlRegions[i]);\n }\n DomUtil.remove(this._controlContainer);\n delete this._controlRegions;\n delete this._controlContainer;\n }\n});\n","import {Control} from './Control';\nimport {Reader} from '../reader/Reader';\nimport * as DomUtil from '../dom/DomUtil';\nimport * as DomEvent from '../dom/DomEvent';\n\nvar PageControl = Control.extend({\n onAdd: function(reader) {\n var container = this._container;\n if ( container ) {\n this._control = container.querySelector(\"[data-target=\" + this.options.direction + \"]\");\n } else {\n\n var className = this._className(),\n options = this.options;\n container = DomUtil.create('div', className),\n\n this._control = this._createButton(this._fill(options.html || options.label), this._fill(options.label),\n className, container);\n }\n this._bindEvents();\n\n return container;\n },\n\n _createButton: function (html, title, className, container) {\n var link = DomUtil.create('a', className, container);\n link.innerHTML = html;\n link.href = '#';\n link.title = title;\n\n /*\n * Will force screen readers like VoiceOver to read this as \"Zoom in - button\"\n */\n link.setAttribute('role', 'button');\n link.setAttribute('aria-label', title);\n\n return link;\n },\n\n _bindEvents: function() {\n var self = this;\n DomEvent.disableClickPropagation(this._control);\n DomEvent.on(this._control, 'click', DomEvent.stop);\n DomEvent.on(this._control, 'click', this._action, this);\n\n this._reader.on('reopen', function(data) {\n // update the button text / titles\n var html = self.options.html || self.options.label;\n self._control.innerHTML = self._fill(html);\n self._control.setAttribute('title', self._fill(self.options.label));\n self._control.setAttribute('aria-label', self._fill(self.options.label));\n });\n\n },\n\n _unit: function() {\n return ( this._reader.options.flow == 'scrolled-doc' ) ? 'Section' : 'Page';\n },\n\n _fill: function(s) {\n var unit = this._unit();\n return s.replace(/\\$\\{unit\\}/g, unit);\n },\n\n _label: function() {\n return this.options.label + \" \" + ( this._reader.options.flow == 'scrolled-doc' ) ? 'Section' : 'Page';\n },\n\n EOT: true\n});\n\nexport var PagePrevious = PageControl.extend({\n options: {\n region: 'edge.left',\n direction: 'previous',\n label: 'Previous ${unit}',\n html: ''\n },\n\n _action: function(e) {\n this._reader.prev();\n }\n});\n\nexport var PageNext = PageControl.extend({\n options: {\n region: 'edge.right',\n direction: 'next',\n label: 'Next ${unit}',\n html: ''\n },\n\n _action: function(e) {\n this._reader.next();\n }\n});\n\nexport var PageFirst = PageControl.extend({\n options: {\n direction: 'first',\n label: 'First ${unit}'\n },\n _action: function(e) {\n this._reader.first();\n }\n});\n\nexport var PageLast = PageControl.extend({\n options: {\n direction: 'last',\n label: 'Last ${unit}'\n },\n _action: function(e) {\n this._reader.last();\n }\n});\n\nexport var pageNext = function(options) {\n return new PageNext(options);\n}\n\nexport var pagePrevious = function(options) {\n return new PagePrevious(options);\n}\n\nexport var pageFirst = function(options) {\n return new PageFirst(options);\n}\n\nexport var pageLast = function(options) {\n return new PageLast(options);\n}\n","import {Class} from '../core/Class';\nimport {Reader} from '../reader/Reader';\nimport * as Util from '../core/Util';\nimport * as DomUtil from '../dom/DomUtil';\nimport * as DomEvent from '../dom/DomEvent';\n\nimport assign from 'lodash/assign';\n\nvar activeModal;\nvar dismissModalListener = false;\n\n// from https://github.com/ghosh/micromodal/blob/master/src/index.js\nconst FOCUSABLE_ELEMENTS = [\n 'a[href]',\n 'area[href]',\n 'input:not([disabled]):not([type=\"hidden\"])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n 'button:not([disabled])',\n 'iframe',\n 'object',\n 'embed',\n '[contenteditable]',\n '[tabindex]:not([tabindex^=\"-\"])'\n ];\n\nconst ACTIONABLE_ELEMENTS = [\n 'a[href]',\n 'area[href]',\n 'input[type=\"submit\"]:not([disabled])',\n 'button:not([disabled])'\n ];\n\nexport var Modal = Class.extend({\n options: {\n // @option region: String = 'topright'\n // The region of the control (one of the reader edges). Possible values are `'left' ad 'right'`\n region: 'left',\n fraction: 0,\n width: null,\n className: {},\n actions: null,\n callbacks: { onShow: function() {}, onClose: function() {} },\n handlers: {}\n },\n\n initialize: function (options) {\n options = Util.setOptions(this, options);\n this._id = (new Date()).getTime() + '-' + parseInt(Math.random((new Date()).getTime()) * 1000, 10);\n this._initializedEvents = false;\n this.callbacks = assign({}, this.options.callbacks);\n this.actions = this.options.actions ? assign({}, this.options.actions) : null;\n this.handlers = assign({}, this.options.handlers);\n if ( typeof(this.options.className) == 'string' ) {\n this.options.className = { container: this.options.className };\n }\n },\n\n addTo: function(reader) {\n var self = this;\n this._reader = reader;\n var template = this.options.template;\n\n var panelHTML = `
\n
\n
\n
\n
\n

${this.options.title}

\n \n
\n
\n ${template}\n
`;\n\n if ( this.options.actions ) {\n panelHTML += '
'\n for(var i in this.options.actions) {\n var action = this.options.actions[i];\n var button_cls = action.className || 'button--default';\n panelHTML += ``;\n }\n panelHTML += '
';\n }\n\n panelHTML += '
';\n\n var body = new DOMParser().parseFromString(panelHTML, \"text/html\").body;\n\n this.modal = reader._container.appendChild(body.children[0]);\n this._container = this.modal; // compatibility\n\n this.container = this.modal.querySelector('.modal__container');\n this._bindEvents();\n return this;\n },\n\n _bindEvents: function() {\n var self = this;\n this.onClick = this.onClick.bind(this);\n this.onKeydown = this.onKeydown.bind(this);\n this.onModalTransition = this.onModalTransition.bind(this);\n\n this.modal.addEventListener('transitionend', function() {\n }.bind(this));\n\n // bind any actions\n if ( this.actions ) {\n for(var i in this.actions) {\n let action = this.actions[i];\n let button_id = '#action-' + this._id + '-' + i;\n let button = this.modal.querySelector(button_id);\n if ( button ) {\n DomEvent.on(button, 'click', function(event) {\n event.preventDefault();\n action.callback(event);\n if ( action.close ) {\n self.closeModal();\n }\n })\n }\n }\n }\n },\n\n deactivate: function() {\n this.closeModal();\n },\n\n closeModal: function() {\n var self = this;\n this.modal.setAttribute('aria-hidden', 'true');\n this.removeEventListeners();\n this.activeElement.focus();\n this.callbacks.onClose(this.modal);\n },\n\n showModal: function() {\n this.activeElement = document.activeElement\n this._resize();\n this.modal.setAttribute('aria-hidden', 'false')\n this.setFocusToFirstNode()\n this.addEventListeners()\n this.callbacks.onShow(this.modal)\n },\n\n activate: function() {\n return this.showModal();\n var self = this;\n activeModal = this;\n DomUtil.addClass(self._reader._container, 'st-modal-activating');\n this._resize();\n DomUtil.addClass(this._reader._container, 'st-modal-open');\n setTimeout(function() {\n DomUtil.addClass(self._container, 'active');\n DomUtil.removeClass(self._reader._container, 'st-modal-activating');\n self._container.setAttribute('aria-hidden', 'false');\n self.setFocusToFirstNode();\n }, 25);\n },\n\n addEventListeners: function () {\n // --- do we need touch listeners?\n // this.modal.addEventListener('touchstart', this.onClick)\n // this.modal.addEventListener('touchend', this.onClick)\n this.modal.addEventListener('click', this.onClick)\n document.addEventListener('keydown', this.onKeydown)\n 'webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend'.split(' ').forEach(function(event) {\n this.modal.addEventListener(event, this.onModalTransition);\n }.bind(this))\n },\n\n removeEventListeners: function () {\n this.modal.removeEventListener('touchstart', this.onClick)\n this.modal.removeEventListener('click', this.onClick)\n 'webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend'.split(' ').forEach(function(event) {\n this.modal.removeEventListener(event, this.onModalTransition);\n }.bind(this))\n document.removeEventListener('keydown', this.onKeydown)\n },\n\n _resize: function() {\n var container = this._reader._container;\n this.container.style.height = container.offsetHeight + 'px';\n if ( ! this.options.className.container ) {\n this.container.style.width = this.options.width || parseInt(container.offsetWidth * this.options.fraction) + 'px';\n }\n\n var header = this.container.querySelector('header');\n var footer = this.container.querySelector('footer');\n var main = this.container.querySelector('main');\n var height = this.container.clientHeight - header.clientHeight;\n if ( footer ) {\n height -= footer.clientHeight;\n }\n main.style.height = height + 'px';\n },\n\n getFocusableNodes: function() {\n const nodes = this.modal.querySelectorAll(FOCUSABLE_ELEMENTS);\n return Object.keys(nodes).map((key) => nodes[key]);\n },\n\n setFocusToFirstNode: function() {\n var focusableNodes = this.getFocusableNodes();\n if ( focusableNodes.length ) {\n focusableNodes[0].focus();\n } else {\n activeModal._container.focus();\n }\n },\n\n getActionableNodes: function() {\n const nodes = this.modal.querySelectorAll(ACTIONABLE_ELEMENTS);\n return Object.keys(nodes).map((key) => nodes[key]);\n },\n\n onKeydown: function(event) {\n if ( event.keyCode == 27 ) { this.closeModal(); }\n if ( event.keyCode == 9 ) {\n this.maintainFocus(event);\n }\n },\n\n onClick: function(event) {\n\n var closeAfterAction = false;\n var target = event.target;\n\n // As far as I can tell, the code below isn't catching direct clicks on\n // items with class='data-modal-close' as they're not ACTIONABLE_ELEMENTS.\n // Adding them to ACTIONABLE_ELEMENTS causes undesirable behavior where\n // their child items also close the modal thanks to the loop below.\n // Children of .modal__overlay include the modal header, border area and\n // padding. We don't want clicks on these closing the modal.\n // Just close the modal now for direct clicks on a '.data-modal-close'.\n if (target.hasAttribute('data-modal-close')) {\n this.closeModal();\n return;\n }\n\n // if the target isn't an actionable type, walk the DOM until\n // one is found\n var actionableNodes = this.getActionableNodes();\n while ( actionableNodes.indexOf(target) < 0 && target != this.modal ) {\n target = target.parentElement;\n }\n\n // no target found, punt\n if ( actionableNodes.indexOf(target) < 0 ) {\n return;\n }\n\n if (this.handlers.click) {\n var did_match = false;\n for(var selector in this.handlers.click) {\n if ( target.matches(selector) ) {\n closeAfterAction = this.handlers.click[selector](this, target);\n break;\n }\n }\n }\n\n if (closeAfterAction || target.hasAttribute('data-modal-close')) this.closeModal();\n\n event.preventDefault();\n },\n\n onModalTransition: function(event) {\n if ( this.modal.getAttribute('aria-hidden') == 'true' ) {\n this._reader.fire('modal-closed');\n } else {\n this._reader.fire('modal-opened');\n }\n },\n\n on: function(event, selector, handler) {\n if (! this.handlers[event] ) {\n this.handlers[event] = {};\n }\n this.handlers[event][selector] = handler;\n },\n\n maintainFocus: function(event) {\n var focusableNodes = this.getFocusableNodes();\n var focusedItemIndex = focusableNodes.indexOf(document.activeElement);\n if (event.shiftKey && focusedItemIndex === 0) {\n focusableNodes[focusableNodes.length - 1].focus()\n event.preventDefault()\n }\n\n if (!event.shiftKey && focusedItemIndex === focusableNodes.length - 1) {\n focusableNodes[0].focus()\n event.preventDefault()\n }\n },\n\n EOT: true\n});\n\nReader.include({\n modal: function (options) {\n var modal = new Modal(options);\n return modal.addTo(this);\n // return this;\n },\n\n EOT: true\n});\n","import {Control} from './Control';\nimport {Reader} from '../reader/Reader';\nimport {Modal} from './Modal';\nimport * as DomUtil from '../dom/DomUtil';\nimport * as DomEvent from '../dom/DomEvent';\n\nexport var Contents = Control.extend({\n\n defaultTemplate: ``,\n\n onAdd: function(reader) {\n var self = this;\n var container = this._container;\n if ( container ) {\n this._control = container.querySelector(\"[data-target=\" + this.options.direction + \"]\");\n } else {\n\n var className = this._className(),\n options = this.options;\n\n container = DomUtil.create('div', className);\n\n var template = this.options.template || this.defaultTemplate;\n\n var body = new DOMParser().parseFromString(template, \"text/html\").body;\n while ( body.children.length ) {\n container.appendChild(body.children[0]);\n }\n }\n\n this._control = container.querySelector(\"[data-toggle=open]\");\n this._control.setAttribute('id', 'action-' + this._id);\n container.style.position = 'relative';\n\n this._reader.on('updateContents', function(data) {\n\n DomEvent.on(this._control, 'click', function(event) {\n event.preventDefault();\n self._modal.activate();\n }, this)\n\n this._modal = this._reader.modal({\n template: '
    ',\n title: 'Contents',\n region: 'left',\n className: 'cozy-modal-contents'\n });\n\n this._modal.on('click', 'a[href]', function(modal, target) {\n target = target.getAttribute('href');\n this._reader.gotoPage(target);\n return true;\n }.bind(this))\n\n this._setupSkipLink();\n\n var parent = self._modal._container.querySelector('ul');\n var s = data.toc.filter(function(value) { return value.parent == null }).map(function(value) { return [ value, 0, parent ] });\n while ( s.length ) {\n var tuple = s.shift();\n var chapter = tuple[0];\n var tabindex = tuple[1];\n var parent = tuple[2];\n\n var option = self._createOption(chapter, tabindex, parent);\n data.toc.filter(function(value) { return value.parent == chapter.id }).reverse().forEach(function(chapter_) {\n s.unshift([chapter_, tabindex + 1, option]);\n });\n }\n }.bind(this))\n\n return container;\n },\n\n _createOption(chapter, tabindex, parent) {\n\n function pad(value, length) {\n return (value.toString().length < length) ? pad(\"-\"+value, length):value;\n }\n var option = DomUtil.create('li');\n var anchor = DomUtil.create('a', null, option);\n anchor.textContent = chapter.label;\n // var tab = pad('', tabindex); tab = tab.length ? tab + ' ' : '';\n // option.textContent = tab + chapter.label;\n anchor.setAttribute('href', chapter.href);\n\n if ( parent.tagName == 'LI' ) {\n // need to nest\n var tmp = parent.querySelector('ul');\n if ( ! tmp ) {\n tmp = DomUtil.create('ul', null, parent);\n }\n parent = tmp;\n }\n\n parent.appendChild(option);\n return option;\n },\n\n _setupSkipLink: function() {\n if ( ! this.options.skipLink ) { return; }\n \n var target = document.querySelector(this.options.skipLink);\n if ( ! target ) { return; }\n\n var link = document.createElement('a');\n link.textContent = 'Skip to contents';\n link.setAttribute('href', '#action-' + this._id);\n\n var ul = target.querySelector('ul');\n if ( ul ) {\n // add to list\n target = document.createElement('li');\n ul.appendChild(target);\n }\n target.appendChild(link);\n link.addEventListener('click', function(event) {\n event.preventDefault();\n event.stopPropagation();\n this._control.click();\n }.bind(this))\n\n },\n\n EOT: true\n});\n\nexport var contents = function(options) {\n return new Contents(options);\n}\n","import {Control} from './Control';\nimport {Reader} from '../reader/Reader';\nimport * as DomUtil from '../dom/DomUtil';\nimport * as DomEvent from '../dom/DomEvent';\n\n// Title + Chapter\n\nexport var Title = Control.extend({\n onAdd: function(reader) {\n var self = this;\n var className = this._className(),\n container = DomUtil.create('div', className),\n options = this.options;\n\n // var template = '

    Contents: ';\n // var control = new DOMParser().parseFromString(template, \"text/html\").body.firstChild;\n\n var h1 = DomUtil.create('h1', 'cozy-h1', container);\n this._title = DomUtil.create('span', 'cozy-title', h1);\n this._divider = DomUtil.create('span', 'cozy-divider', h1);\n this._divider.textContent = \" · \";\n this._section = DomUtil.create('span', 'cozy-section', h1);\n\n this._reader.on('updateSection', function(data) {\n if ( data && data.label ) {\n self._section.textContent = data.label;\n DomUtil.setOpacity(self._section, 1.0);\n DomUtil.setOpacity(self._divider, 1.0);\n } else {\n DomUtil.setOpacity(self._section, 0);\n DomUtil.setOpacity(self._divider, 0);\n }\n })\n\n this._reader.on('updateTitle', function(data) {\n if ( data ) {\n self._title.textContent = data.title || data.bookTitle;\n DomUtil.setOpacity(self._section, 0);\n DomUtil.setOpacity(self._divider, 0);\n }\n })\n\n return container;\n },\n\n _createButton: function (html, title, className, container, fn) {\n var link = DomUtil.create('a', className, container);\n link.innerHTML = html;\n link.href = '#';\n link.title = title;\n\n /*\n * Will force screen readers like VoiceOver to read this as \"Zoom in - button\"\n */\n link.setAttribute('role', 'button');\n link.setAttribute('aria-label', title);\n\n DomEvent.disableClickPropagation(link);\n DomEvent.on(link, 'click', DomEvent.stop);\n DomEvent.on(link, 'click', fn, this);\n // DomEvent.on(link, 'click', this._refocusOnMap, this);\n\n return link;\n },\n\n EOT: true\n});\n\nexport var title = function(options) {\n return new Title(options);\n}\n","import {Control} from './Control';\nimport {Reader} from '../reader/Reader';\nimport * as DomUtil from '../dom/DomUtil';\nimport * as DomEvent from '../dom/DomEvent';\n\n// Title + Chapter\n\nexport var PublicationMetadata = Control.extend({\n onAdd: function(reader) {\n var self = this;\n var className = this._className(),\n container = DomUtil.create('div', className),\n options = this.options;\n\n // var template = '

    Contents: ';\n // var control = new DOMParser().parseFromString(template, \"text/html\").body.firstChild;\n\n this._publisher = DomUtil.create('div', 'cozy-publisher', container);\n this._rights = DomUtil.create('div', 'cozy-rights', container);\n\n this._reader.on('updateTitle', function(data) {\n if ( data ) {\n self._publisher.textContent = data.publisher;\n self._rights.textContent = data.rights;\n }\n })\n\n return container;\n },\n\n _createButton: function (html, title, className, container, fn) {\n var link = DomUtil.create('a', className, container);\n link.innerHTML = html;\n link.href = '#';\n link.title = title;\n\n /*\n * Will force screen readers like VoiceOver to read this as \"Zoom in - button\"\n */\n link.setAttribute('role', 'button');\n link.setAttribute('aria-label', title);\n\n DomEvent.disableClickPropagation(link);\n DomEvent.on(link, 'click', DomEvent.stop);\n DomEvent.on(link, 'click', fn, this);\n // DomEvent.on(link, 'click', this._refocusOnMap, this);\n\n return link;\n },\n\n EOT: true\n});\n\nexport var publicationMetadata = function(options) {\n return new PublicationMetadata(options);\n}\n","import {Class} from '../core/Class';\nimport {Control} from './Control';\nimport {Reader} from '../reader/Reader';\nimport * as DomUtil from '../dom/DomUtil';\nimport * as DomEvent from '../dom/DomEvent';\nimport * as Util from '../core/Util';\n\nimport assign from 'lodash/assign';\nimport keys from 'lodash/keys';\n\nexport var Preferences = Control.extend({\n options: {\n label: 'Preferences',\n hasThemes: false,\n html: ''\n },\n\n onAdd: function(reader) {\n var self = this;\n var className = this._className('preferences'),\n container = DomUtil.create('div', className),\n options = this.options;\n\n this._activated = false;\n this._control = this._createButton(options.html || options.label, options.label,\n className, container, this._action)\n\n this._createPanel();\n\n return container;\n },\n\n _action: function() {\n var self = this;\n self.initializeForm();\n self._modal.activate();\n },\n\n _createButton: function (html, title, className, container, fn) {\n var link = DomUtil.create('button', className, container);\n link.innerHTML = html;\n link.title = title;\n\n /*\n * Will force screen readers like VoiceOver to read this as \"Zoom in - button\"\n */\n link.setAttribute('role', 'button');\n link.setAttribute('aria-label', title);\n\n DomEvent.disableClickPropagation(link);\n DomEvent.on(link, 'click', DomEvent.stop);\n DomEvent.on(link, 'click', fn, this);\n\n return link;\n },\n\n _createPanel: function() {\n var self = this;\n var template = '';\n\n var possible_fieldsets = [];\n if ( this._reader.metadata.layout == 'pre-paginated' ) {\n // different panel\n } else {\n possible_fieldsets.push('TextSize');\n }\n possible_fieldsets.push('Display');\n\n if ( this._reader.options.themes && this._reader.options.themes.length > 0 ) {\n this.options.hasThemes = true;\n possible_fieldsets.push('Theme');\n }\n\n this._fieldsets = [];\n possible_fieldsets.forEach(function(cls) {\n var fieldset = new Preferences.fieldset[cls](this);\n template += fieldset.template();\n this._fieldsets.push(fieldset);\n }.bind(this))\n\n if ( this.options.fields ) {\n this.options.hasFields = true;\n for(var i in this.options.fields) {\n var field = this.options.fields[i];\n var id = \"preferences-custom-\" + i;\n template += `
    \n ${field.label}\n `;\n for(var j in field.inputs) {\n var input = field.inputs[j];\n var checked = input.value == field.value ? ' checked=\"checked\"' : '';\n template += ``;\n }\n if ( field.hint ) {\n template += `

    ${field.hint}

    `;\n }\n }\n }\n\n template = '' + template + '';\n\n this._modal = this._reader.modal({\n template: template,\n title: 'Preferences',\n className: 'cozy-modal-preferences',\n actions: [\n {\n label: 'Save Changes',\n callback: function(event) {\n self.updatePreferences(event);\n }\n }\n ],\n region: 'right'\n });\n\n this._form = this._modal._container.querySelector('form');\n },\n\n initializeForm: function() {\n this._fieldsets.forEach(function(fieldset) {\n fieldset.initializeForm(this._form);\n }.bind(this));\n },\n\n updatePreferences: function(event) {\n event.preventDefault();\n\n var doUpdate = false;\n var new_options = {};\n this._fieldsets.forEach(function(fieldset) {\n // doUpdate = doUpdate || fieldset.updateForm(this._form, new_options);\n assign(new_options, fieldset.updateForm(this._form));\n }.bind(this));\n\n if ( this.options.hasFields ) {\n for(var i in this.options.fields) {\n var field = this.options.fields[i];\n var id = \"preferences-custom-\" + i;\n var input = this._form.querySelector(`input[name=\"x${field.name}\"]:checked`);\n if ( input.value != field.value ) {\n field.value = input.value;\n field.callback(field.value);\n }\n }\n }\n\n this._modal.deactivate();\n\n setTimeout(function() {\n this._reader.saveOptions(new_options);\n this._reader.reopen(new_options);\n }.bind(this), 100);\n },\n\n EOT: true\n});\n\nPreferences.fieldset = {};\n\nvar Fieldset = Class.extend({\n\n options: {},\n\n initialize: function (control, options) {\n Util.setOptions(this, options);\n this._control = control;\n this._current = {};\n this._id = (new Date()).getTime() + '-' + parseInt(Math.random((new Date()).getTime()) * 1000, 10);\n },\n\n template: function() {\n\n },\n\n EOT: true\n\n\n});\n\nPreferences.fieldset.TextSize = Fieldset.extend({\n\n initializeForm: function(form) {\n if ( ! this._input ) {\n this._input = form.querySelector(`#x${this._id}-input`);\n this._output = form.querySelector(`#x${this._id}-output`);\n this._preview = form.querySelector(`#x${this._id}-preview`);\n\n this._input.addEventListener('input', this._updatePreview.bind(this));\n this._input.addEventListener('change', this._updatePreview.bind(this));\n }\n\n var text_size = this._control._reader.options.text_size || 100;\n if ( text_size == 'auto' ) { text_size = 100; }\n this._current.text_size = text_size;\n this._input.value = text_size;\n this._updatePreview();\n },\n\n updateForm: function(form) {\n return { text_size: this._input.value };\n // options.text_size = this._input.value;\n // return ( this._input.value != this._current.text_size );\n },\n\n template: function() {\n return `
    \n Text Size\n
    \n ‘Yes, that’s it,’ said the Hatter with a sigh: ‘it’s always tea-time, and we’ve no time to wash the things between whiles.’\n
    \n

    \n T-\n \n T+\n

    \n

    \n Text Size: \n 100\n

    \n
    `;\n },\n\n _updatePreview: function() {\n this._preview.style.fontSize = `${( parseInt(this._input.value, 10) / 100 )}em`;\n this._output.value = `${this._input.value}%`;\n },\n\n EOT: true\n\n});\n\nPreferences.fieldset.Display = Fieldset.extend({\n\n initializeForm: function(form) {\n var flow = this._control._reader.options.flow || this._control._reader.metadata.flow || 'paginated';\n if ( flow == 'auto' ) { flow = 'paginated'; }\n\n var input = form.querySelector(`#x${this._id}-input-${flow}`);\n input.checked = true;\n this._current.flow = flow;\n\n },\n\n updateForm: function(form) {\n var input = form.querySelector(`input[name=\"x${this._id}-flow\"]:checked`);\n return { flow: input.value };\n },\n\n template: function() {\n return `
    \n Display\n \n \n
    `;\n },\n\n EOT: true\n\n});\n\nPreferences.fieldset.Theme = Fieldset.extend({\n\n initializeForm: function(form) {\n var theme = this._control._reader.options.theme || 'default';\n\n var input = form.querySelector(`#x${this._id}-input-theme-${theme}`);\n input.checked = true;\n this._current.theme = theme;\n },\n\n updateForm: function(form) {\n var input = form.querySelector(`input[name=\"x${this._id}-theme\"]:checked`);\n return { theme: input.value };\n },\n\n template: function() {\n var template = `
    \n Theme\n `;\n\n this._control._reader.options.themes.forEach(function(theme) {\n template += ``\n }.bind(this));\n\n template += '
    ';\n\n return template;\n\n },\n\n EOT: true\n\n});\n\nexport var preferences = function(options) {\n return new Preferences(options);\n}\n","import {Control} from './Control';\nimport {Reader} from '../reader/Reader';\nimport * as DomUtil from '../dom/DomUtil';\nimport * as DomEvent from '../dom/DomEvent';\n\nexport var Widget = Control.extend({\n\n\n options: {\n // @option region: String = 'topright'\n // The region of the control (one of the reader corners). Possible values are `'topleft'`,\n // `'topright'`, `'bottomleft'` or `'bottomright'`\n },\n\n onAdd: function(reader) {\n var container = this._container;\n if ( container ) {\n // NOOP\n } else {\n\n var className = this._className(),\n options = this.options;\n\n container = DomUtil.create('div', className);\n\n var template = this.options.template || this.defaultTemplate;\n var body = new DOMParser().parseFromString(template, \"text/html\").body;\n while ( body.children.length ) {\n container.appendChild(body.children[0]);\n }\n\n }\n\n this._onAddExtra(container);\n this._updateTemplate(container);\n this._updateClass(container);\n this._bindEvents(container);\n\n return container;\n },\n\n _updateTemplate: function(container) {\n var data = this.data();\n for(var slot in data) {\n if ( data.hasOwnProperty(slot) ) {\n var value = data[slot];\n if ( typeof(value) == \"function\" ) { value = value(); }\n var node = container.querySelector(`[data-slot=${slot}]`);\n if ( node ) {\n if ( node.hasAttribute('value') ) {\n node.setAttribute('value', value);\n } else {\n node.innerHTML = value;\n }\n }\n }\n }\n },\n\n _updateClass: function(container) {\n if ( this.options.className ) {\n DomUtil.addClass(container, this.options.className);\n }\n },\n\n _onAddExtra: function() { },\n\n _bindEvents: function(container) {\n var control = container.querySelector(\"[data-toggle=button]\");\n if ( ! control ) { return ; }\n DomEvent.disableClickPropagation(control);\n DomEvent.on(control, 'click', DomEvent.stop);\n DomEvent.on(control, 'click', this._action, this);\n },\n\n _action: function() {\n },\n\n data: function() {\n return this.options.data || {};\n },\n\n EOT: true\n});\n\nWidget.Button = Widget.extend({\n defaultTemplate: ``,\n\n _action: function() {\n this.options.onClick(this, this._reader);\n },\n\n EOT: true\n});\n\nWidget.Panel = Widget.extend({\n defaultTemplate: `
    `,\n\n\n EOT: true\n});\n\nWidget.Toggle = Widget.extend({\n defaultTemplate: ``,\n\n _onAddExtra: function(container) {\n this.state(this.options.states[0].stateName, container);\n\n return container;\n },\n\n state: function(stateName, container) {\n container = container || this._container;\n this._resetState(container);\n this._state = this.options.states.filter(function(s) { return s.stateName == stateName })[0];\n this._updateClass(container);\n this._updateTemplate(container);\n },\n\n _resetState: function(container) {\n if ( ! this._state ) { return; }\n if ( this._state.className ) {\n DomUtil.removeClass(container, this._state.className);\n }\n },\n\n _updateClass: function(container) {\n if ( this._state.className ) {\n DomUtil.addClass(container, this._state.className);\n }\n },\n\n _action: function() {\n this._state.onClick(this, this._reader);\n },\n\n data: function() {\n return this._state.data || {};\n },\n\n EOT: true\n});\n\n// export var widget = function(options) {\n// return new Widget(options);\n// }\n\nexport var widget = {\n button: function(options) { return new Widget.Button(options); },\n panel: function(options) { return new Widget.Panel(options); },\n toggle: function(options) { return new Widget.Toggle(options); }\n}\n","import {Control} from './Control';\nimport {Reader} from '../reader/Reader';\nimport * as DomUtil from '../dom/DomUtil';\nimport * as DomEvent from '../dom/DomEvent';\n\nexport var Citation = Control.extend({\n options: {\n label: 'Citation',\n html: 'Get Citation'\n },\n\n defaultTemplate: ``,\n\n\n onAdd: function(reader) {\n var self = this;\n var container = this._container;\n if ( container ) {\n this._control = container.querySelector(\"[data-target=\" + this.options.direction + \"]\");\n } else {\n\n var className = this._className(),\n options = this.options;\n\n container = DomUtil.create('div', className);\n\n var template = this.options.template || this.defaultTemplate;\n\n var body = new DOMParser().parseFromString(template, \"text/html\").body;\n while ( body.children.length ) {\n container.appendChild(body.children[0]);\n }\n }\n\n this._reader.on('updateContents', function(data) {\n self._createPanel();\n });\n\n\n this._control = container.querySelector(\"[data-toggle=open]\");\n DomEvent.on(this._control, 'click', function(event) {\n event.preventDefault();\n self._modal.activate();\n }, this)\n\n return container;\n },\n\n _action: function() {\n var self = this;\n self._modal.activate();\n },\n\n _createButton: function (html, title, className, container, fn) {\n var link = DomUtil.create('button', className, container);\n link.innerHTML = html;\n link.title = title;\n\n link.setAttribute('role', 'button');\n link.setAttribute('aria-label', title);\n\n DomEvent.disableClickPropagation(link);\n DomEvent.on(link, 'click', DomEvent.stop);\n DomEvent.on(link, 'click', fn, this);\n\n return link;\n },\n\n _createPanel: function() {\n var self = this;\n\n var template = `
    \n
    \n Select Citation Format\n
    \n
    \n
    \n
    `;\n\n this._modal = this._reader.modal({\n template: template,\n title: 'Copy Citation to Clipboard',\n className: 'cozy-modal-citatation',\n actions: [\n {\n label: 'Copy Citation',\n callback: function(event) {\n document.designMode = \"on\";\n var formatted = self._modal._container.querySelector(\"#formatted\");\n\n var range = document.createRange();\n range.selectNode(formatted);\n var sel = window.getSelection();\n sel.removeAllRanges();\n sel.addRange(range);\n\n // formatted.select();\n\n try {\n var flag = document.execCommand('copy');\n } catch(err) {\n console.log(\"AHOY COPY FAILED\", err);\n }\n\n self._message.innerHTML = 'Success! Citation copied to your clipboard.';\n self._message.style.display = 'block';\n sel.removeAllRanges();\n range.detach();\n document.designMode = \"off\";\n }\n }\n ],\n region: 'left',\n fraction: 1.0\n });\n\n this._form = this._modal._container.querySelector('form');\n var fieldset = this._form.querySelector('fieldset');\n\n var citations = this.options.citations || this._reader.metadata.citations;\n\n citations.forEach(function(citation, index) {\n var label = DomUtil.create('label', null, fieldset);\n var input = DomUtil.create('input', null, label);\n input.setAttribute('name', 'format');\n input.setAttribute('value', citation.format);\n input.setAttribute('type', 'radio');\n if ( index == 0 ) {\n input.setAttribute('checked', 'checked');\n }\n var text = document.createTextNode(\" \" + citation.format);\n label.appendChild(text);\n input.setAttribute('data-text', citation.text);\n });\n\n this._formatted = this._modal._container.querySelector(\"#formatted\");\n this._message = this._modal._container.querySelector(\"#message\");\n DomEvent.on(this._form, 'change', function(event) {\n var target = event.target;\n if ( target.tagName == 'INPUT' ) {\n this._initializeForm();\n }\n }, this);\n\n this._initializeForm();\n },\n\n _initializeForm: function() {\n var formatted = this._formatCitation();\n this._formatted.innerHTML = formatted;\n this._message.style.display = 'none';\n this._message.innerHTML = '';\n },\n\n _formatCitation: function(format) {\n if ( format == null ) {\n var selected = this._form.querySelector(\"input:checked\");\n format = selected.value;\n }\n var selected = this._form.querySelector(\"input[value=\" + format + \"]\");\n return selected.getAttribute('data-text');\n // return selected.dataset.text;\n },\n\n EOT: true\n});\n\nexport var citation = function(options) {\n return new Citation(options);\n}\n","import {Control} from './Control';\nimport {Reader} from '../reader/Reader';\nimport * as DomUtil from '../dom/DomUtil';\nimport * as DomEvent from '../dom/DomEvent';\n\nexport var Search = Control.extend({\n options: {\n label: 'Search',\n html: 'Search'\n },\n\n defaultTemplate: `
    \n \n \n \n
    `,\n\n onAdd: function(reader) {\n var self = this;\n var container = this._container;\n if ( container ) {\n this._control = container.querySelector(\"[data-target=\" + this.options.direction + \"]\");\n } else {\n\n var className = this._className(),\n options = this.options;\n\n container = DomUtil.create('div', className);\n\n var template = this.options.template || this.defaultTemplate;\n\n var body = new DOMParser().parseFromString(template, \"text/html\").body;\n while ( body.children.length ) {\n container.appendChild(body.children[0]);\n }\n }\n\n this._control = container.querySelector(\"[data-toggle=open]\");\n container.style.position = 'relative';\n\n this._data = null;\n this._canceled = false;\n this._processing = false;\n\n this._reader.on('ready', function() {\n\n this._modal = this._reader.modal({\n template: '
    ',\n title: 'Search Results',\n className: { container: 'cozy-modal-search' },\n region: 'left',\n });\n\n this._modal.callbacks.onClose = function() {\n if ( self._processing ) {\n self._canceled = true;\n }\n };\n\n this._article = this._modal._container.querySelector('article');\n\n this._modal.on('click', 'a[href]', function(modal, target) {\n target = target.getAttribute('href');\n this._reader.gotoPage(target);\n return true;\n }.bind(this));\n\n }.bind(this));\n\n DomEvent.on(this._control, 'click', function(event) {\n event.preventDefault();\n\n var searchString = this._container.querySelector(\"#cozy-search-string\").value;\n searchString = searchString.replace(/^\\s*/, '').replace(/\\s*$/, '');\n\n if ( ! searchString ) {\n // just punt\n return;\n }\n\n if ( searchString == this.searchString ) {\n // cached results\n self.openModalResults();\n } else {\n this.searchString = searchString;\n self.openModalWaiting();\n self.submitQuery();\n }\n }, this);\n\n return container;\n },\n\n openModalWaiting: function() {\n this._processing = true;\n this._emptyArticle();\n var value = this.searchString;\n this._article.innerHTML = '

    Submitting query for ' + value + '...

    ';\n this._modal.activate();\n },\n\n openModalResults: function() {\n if ( this._canceled ) {\n this._canceled = false;\n return;\n }\n this._buildResults();\n this._modal.activate();\n },\n\n submitQuery: function() {\n var self = this;\n\n var url = this.options.searchUrl + this.searchString;\n\n var request = new XMLHttpRequest();\n request.open('GET', url, true);\n\n request.onload = function() {\n if (this.status >= 200 && this.status < 400) {\n // Success!\n var data = JSON.parse(this.response);\n console.log(\"SEARCH DATA\", data);\n\n self._data = data;\n\n } else {\n // We reached our target server, but it returned an error\n\n self._data = null;\n console.log(this.response);\n }\n\n self.openModalResults();\n\n };\n\n request.onerror = function() {\n // There was a connection error of some sort\n self._data = null;\n self.openModalResults();\n };\n\n request.send();\n\n },\n\n _emptyArticle: function() {\n while (this._article.hasChildNodes()) {\n this._article.removeChild(this._article.lastChild);\n }\n },\n\n _buildResults: function() {\n var self = this;\n var content;\n\n this._processing = false;\n\n self._emptyArticle();\n\n var reader = this._reader;\n reader.annotations.reset();\n\n if ( this._data ) {\n if ( this._data.search_results.length ) {\n content = DomUtil.create('ul');\n\n this._data.search_results.forEach(function(result) {\n var option = DomUtil.create('li');\n var anchor = DomUtil.create('a', null, option);\n var cfiRange = \"epubcfi(\" + result.cfi + \")\";\n\n if (result.title) {\n var chapterTitle = DomUtil.create('i');\n chapterTitle.textContent = result.title + \": \";\n anchor.appendChild(chapterTitle);\n }\n anchor.appendChild(document.createTextNode(result.snippet));\n\n anchor.setAttribute(\"href\", cfiRange);\n content.appendChild(option);\n\n reader.annotations.highlight(cfiRange);\n });\n } else {\n content = DomUtil.create(\"p\")\n content.textContent = 'No results found for \"' + self.searchString + '\"';\n }\n } else {\n content = DomUtil.create(\"p\")\n content.textContent = 'There was a problem processing this query.';\n }\n\n self._article.appendChild(content);\n },\n\n EOT: true\n});\n\nexport var search = function(options) {\n return new Search(options);\n}\n","import {Control} from './Control';\nimport {Reader} from '../reader/Reader';\nimport * as DomUtil from '../dom/DomUtil';\nimport * as DomEvent from '../dom/DomEvent';\n\n// Title + Chapter\n\nexport var BibliographicInformation = Control.extend({\n options: {\n label: 'Info',\n direction: 'left',\n html: 'Info'\n },\n\n defaultTemplate: ``,\n\n onAdd: function(reader) {\n var self = this;\n var container = this._container;\n if ( container ) {\n this._control = container.querySelector(\"[data-target=\" + this.options.direction + \"]\");\n } else {\n\n var className = this._className(),\n options = this.options;\n\n container = DomUtil.create('div', className);\n\n var template = this.options.template || this.defaultTemplate;\n\n var body = new DOMParser().parseFromString(template, \"text/html\").body;\n while ( body.children.length ) {\n container.appendChild(body.children[0]);\n }\n }\n\n this._reader.on('updateContents', function(data) {\n self._createPanel();\n });\n\n\n this._control = container.querySelector(\"[data-toggle=open]\");\n DomEvent.on(this._control, 'click', function(event) {\n event.preventDefault();\n self._modal.activate();\n }, this)\n\n return container;\n },\n\n _createPanel: function() {\n var self = this;\n\n var template = `
    \n
    `;\n\n this._modal = this._reader.modal({\n template: template,\n title: 'Info',\n region: 'left',\n fraction: 1.0\n });\n\n var dl = this._modal._container.querySelector('dl');\n\n var metadata_fields = [\n [ 'title', 'Title' ],\n [ 'creator', 'Author' ],\n [ 'pubdate', 'Publication Date' ],\n [ 'modified_date', 'Modified Date' ],\n [ 'publisher', 'Publisher' ],\n [ 'rights', 'Rights' ],\n [ 'doi', 'DOI' ],\n [ 'description', 'Description' ],\n ];\n\n var metadata_fields_seen = {};\n\n var metadata = this._reader.metadata;\n\n for(var idx in metadata_fields) {\n var key = metadata_fields[idx][0];\n var label = metadata_fields[idx][1];\n if ( metadata[key] ) {\n var value = metadata[key];\n if ( key == 'pubdate' || key == 'modified_date' ) {\n value = this._formatDate(value);\n if ( ! value ) { continue; }\n // value = d.toISOString().slice(0,10); // for YYYY-MM-DD\n }\n metadata_fields_seen[key] = true;\n var dt = DomUtil.create('dt', 'cozy-bib-info-label', dl);\n dt.innerHTML = label;\n var dd = DomUtil.create('dd', 'cozy-bib-info-value cozy-bib-info-value-' + key, dl);\n dd.innerHTML = value;\n }\n }\n\n },\n\n _formatDate: function(value) {\n var match = value.match(/\\d{4}/);\n if ( match ) {\n return match[0];\n }\n return null;\n },\n\n EOT: true\n});\n\nexport var bibliographicInformation = function(options) {\n return new BibliographicInformation(options);\n}\n","import {Control} from './Control';\nimport {Reader} from '../reader/Reader';\nimport * as DomUtil from '../dom/DomUtil';\nimport * as DomEvent from '../dom/DomEvent';\n\nexport var Download = Control.extend({\n options: {\n label: 'Download Book',\n html: 'Download Book'\n },\n\n defaultTemplate: ``,\n\n\n onAdd: function(reader) {\n var self = this;\n var container = this._container;\n if ( container ) {\n this._control = container.querySelector(\"[data-target=\" + this.options.direction + \"]\");\n } else {\n\n var className = this._className(),\n options = this.options;\n\n container = DomUtil.create('div', className);\n\n var template = this.options.template || this.defaultTemplate;\n\n var body = new DOMParser().parseFromString(template, \"text/html\").body;\n while ( body.children.length ) {\n container.appendChild(body.children[0]);\n }\n }\n\n this._reader.on('updateContents', function(data) {\n self._createPanel();\n });\n\n\n this._control = container.querySelector(\"[data-toggle=open]\");\n DomEvent.on(this._control, 'click', function(event) {\n event.preventDefault();\n self._modal.activate();\n }, this)\n\n return container;\n },\n\n _createPanel: function() {\n var self = this;\n\n var template = `
    \n
    \n Choose File Format\n
    \n
    `;\n\n this._modal = this._reader.modal({\n template: template,\n title: 'Download Book',\n className: 'cozy-modal-download',\n actions: [\n {\n label: 'Download',\n callback: function(event) {\n var selected = self._form.querySelector(\"input:checked\");\n var href = selected.getAttribute('data-href');\n self._configureDownloadForm(href);\n self._form.submit();\n }\n }\n ],\n region: 'left',\n fraction: 1.0\n });\n\n this._form = this._modal._container.querySelector('form'); \n var fieldset = this._form.querySelector('fieldset');\n this._reader.options.download_links.forEach(function(link, index) {\n var label = DomUtil.create('label', null, fieldset);\n var input = DomUtil.create('input', null, label);\n input.setAttribute('name', 'format');\n input.setAttribute('value', link.format);\n input.setAttribute('data-href', link.href);\n input.setAttribute('type', 'radio');\n if ( index == 0 ) {\n input.setAttribute('checked', 'checked');\n }\n var text = link.format;\n if ( link.size ) {\n text += \" (\" + link.size + \")\";\n }\n var text = document.createTextNode(\" \" + text);\n label.appendChild(text);\n });\n\n },\n\n _configureDownloadForm: function(href) {\n var self = this;\n self._form.setAttribute('method', 'GET');\n self._form.setAttribute('action', href);\n self._form.setAttribute('target', '_blank');\n },\n\n\n EOT: true\n});\n\nexport var download = function(options) {\n return new Download(options);\n}\n","import {Control} from './Control';\nimport {Reader} from '../reader/Reader';\nimport * as DomUtil from '../dom/DomUtil';\nimport * as DomEvent from '../dom/DomEvent';\n\nexport var Navigator = Control.extend({\n onAdd: function(reader) {\n var container = this._container;\n if ( container ) {\n } else {\n\n var className = this._className('navigator'),\n options = this.options;\n \n container = DomUtil.create('div', className);\n }\n this._setup(container);\n\n this._reader.on('updateLocations', function(locations) {\n this._initiated = true;\n this._total = this._reader.locations.total;\n this._control.value = Math.ceil(this._reader.locations.percentageFromCfi(this._reader.currentLocation().start.cfi) * 100);\n this._last_value = this._control.value;\n\n this._spanTotalLocations.innerHTML = this._total;\n\n this._update();\n setTimeout(function() {\n DomUtil.addClass(this._container, 'initialized');\n }.bind(this), 0);\n }.bind(this));\n\n return container;\n },\n\n _setup: function(container) {\n this._control = container.querySelector(\"input[type=range]\");\n if ( ! this._control ) {\n this._createControl(container);\n }\n this._background = container.querySelector(\".cozy-navigator-range__background\");\n this._status = container.querySelector(\".cozy-navigator-range__status\");\n this._spanCurrentPercentage = container.querySelector(\".currentPercentage\");\n this._spanCurrentLocation = container.querySelector(\".currentLocation\");\n this._spanTotalLocations = container.querySelector(\".totalLocations\");\n\n this._bindEvents();\n },\n\n _createControl: function (container) {\n var template = `
    \n \n \n
    \n
    \n
    0% • Location 0 of ?
    \n `;\n\n var body = new DOMParser().parseFromString(template, \"text/html\").body;\n while ( body.children.length ) {\n container.appendChild(body.children[0]);\n }\n\n this._control = container.querySelector(\"input[type=range]\");\n },\n\n _bindEvents: function() {\n var self = this;\n\n this._control.addEventListener(\"input\", function() {\n self._update();\n }, false);\n this._control.addEventListener(\"change\", function() { self._action(); }, false);\n this._control.addEventListener(\"mousedown\", function(){\n self._mouseDown = true;\n }, false);\n this._control.addEventListener(\"mouseup\", function(){\n self._mouseDown = false;\n }, false);\n this._control.addEventListener(\"keydown\", function(){\n self._mouseDown = true;\n }, false);\n this._control.addEventListener(\"keyup\", function(){\n self._mouseDown = false;\n }, false);\n\n this._reader.on('relocated', function(location) {\n if ( ! self._initiated ) { return; }\n if ( ! self._mouseDown ) {\n self._control.value = Math.ceil(self._reader.locations.percentageFromCfi(self._reader.currentLocation().start.cfi) * 100);\n self._update();\n }\n })\n\n },\n\n _action: function() {\n var value = this._control.value;\n var locations = this._reader.locations;\n var cfi = locations.cfiFromPercentage(value / 100);\n this._reader.gotoPage(cfi);\n },\n\n _update: function() {\n var self = this;\n\n var rangeBg = this._background;\n var range = self._control;\n\n var value = parseInt(range.value, 10);\n var percentage = value;\n\n rangeBg.setAttribute('style', 'background-position: ' + (-percentage) + '% 0%, left top;');\n self._control.setAttribute('data-background-position', Math.ceil(percentage));\n\n this._spanCurrentPercentage.innerHTML = percentage + '%';\n var current = this._reader.currentLocation();\n var current_location = this._reader.locations.locationFromCfi(current.start.cfi);\n this._spanCurrentLocation.innerHTML = ( current_location );\n self._last_delta = self._last_value > value; self._last_value = value;\n },\n\n EOT: true\n});\n\nexport var navigator = function(options) {\n return new Navigator(options);\n}\n","import {Control, control} from './Control';\nimport {PageNext, PagePrevious, pageNext, pagePrevious, PageFirst, pageFirst, PageLast, pageLast} from './Control.Paging';\nimport {Contents, contents} from './Control.Contents';\nimport {Title, title} from './Control.Title';\nimport {PublicationMetadata, publicationMetadata} from './Control.PublicationMetadata';\nimport {Preferences, preferences} from './Control.Preferences';\nimport {Widget, widget} from './Control.Widget';\nimport {Citation, citation} from './Control.Citation';\nimport {Search, search} from './Control.Search';\nimport {BibliographicInformation, bibliographicInformation} from './Control.BibliographicInformation';\nimport {Download, download} from './Control.Download';\nimport {Navigator, navigator} from './Control.Navigator';\n\n// import {Zoom, zoom} from './Control.Zoom';\n// import {Attribution, attribution} from './Control.Attribution';\n\nControl.PageNext = PageNext;\nControl.PagePrevious = PagePrevious;\nControl.PageFirst = PageFirst;\nControl.PageLast = PageLast;\ncontrol.pagePrevious = pagePrevious;\ncontrol.pageNext = pageNext;\ncontrol.pageFirst = pageFirst;\ncontrol.pageLast = pageLast;\n\nControl.Contents = Contents;\ncontrol.contents = contents;\n\nControl.Title = Title;\ncontrol.title = title;\n\nControl.PublicationMetadata = PublicationMetadata;\ncontrol.publicationMetadata = publicationMetadata;\n\nControl.Preferences = Preferences;\ncontrol.preferences = preferences;\n\nControl.Widget = Widget;\ncontrol.widget = widget;\n\nControl.Citation = Citation;\ncontrol.citation = citation;\n\nControl.Search = Search;\ncontrol.search = search;\n\nControl.BibliographicInformation = BibliographicInformation;\ncontrol.bibliographicInformation = bibliographicInformation;\n\nControl.Download = Download;\ncontrol.download = download;\n\nControl.Navigator = Navigator;\ncontrol.navigator = navigator;\n\nexport {Control, control};\n","import {Evented} from './Events';\n\nvar Bus = Evented.extend({\n});\n\nvar instance;\nexport var bus = function() {\n return instance || ( instance = new Bus() );\n}\n","import * as Browser from './Browser';\nexport {Browser};\n\nexport {Class} from './Class';\n\nimport {Evented} from './Events';\nexport {Evented};\nexport var Mixin = {Events: Evented.prototype};\n\nimport * as Util from './Util';\nexport {Util};\nexport {extend, bind, stamp, setOptions} from './Util';\nexport {bus} from './Bus';\n","\n// var ePub = window.ePub;\n// export {ePub};\n\nexport function ePub(options) {\n\tif ( window.require !== undefined ) {\n\t\twindow.ePub = require(\"ePub\");\n\t}\n return window.ePub(options);\n}","import * as Util from '../core/Util';\nimport {Reader} from './Reader';\nimport * as epubjs from '../epubjs';\nimport * as DomUtil from '../dom/DomUtil';\nimport * as Browser from '../core/Browser';\n\nReader.EpubJS = Reader.extend({\n\n initialize: function(id, options) {\n Reader.prototype.initialize.apply(this, arguments);\n this._epubjs_ready = false;\n },\n\n open: function(callback) {\n var self = this;\n this._book = epubjs.ePub(this.options.href);\n this._book.loaded.navigation.then(function(toc) {\n self._contents = toc;\n self.metadata = self._book.package.metadata;\n self.fire('updateContents', toc);\n self.fire('updateTitle', self._book.package.metadata);\n })\n this._book.ready.then(function() {\n self._book.locations.generate(1600).then(function(locations) {\n self.fire('updateLocations', locations);\n })\n })\n .then(callback);\n },\n\n draw: function(target, callback) {\n var self = this;\n this.settings = { flow: this.options.flow };\n this.settings.manager = this.options.manager || 'default';\n\n if ( this.options.flow == 'auto' ) {\n this._panes['book'].style.overflow = 'hidden';\n } else {\n this._panes['book'].style.overflow = 'auto';\n }\n\n // start the rendition after all the epub parts \n // have been loaded\n this._book.ready.then(function() {\n\n // have to set fixed dimensions to avoid edge clipping\n var size = self.getFixedBookPanelSize();\n self.settings.height = size.height; // + 'px';\n self.settings.width = size.width; // + 'px';\n self.settings.height = '100%';\n self.settings.width = '100%';\n\n self.settings['ignoreClass'] = 'annotator-hl';\n self._rendition = self._book.renderTo(self._panes['book'], self.settings);\n self._updateFontSize();\n self._bindEvents();\n self._drawn = true;\n\n self._rendition.hooks.content.register(function(contents) {\n self.fire('ready:contents', contents);\n self.fire('readyContents', contents);\n contents.document.addEventListener('keydown', (event) => {\n const keyName = event.key;\n self.fire('keyDown', { keyName: keyName });\n console.log('inner keydown event: ', keyName);\n });\n })\n\n if ( target && target.start ) { target = target.start; }\n if ( ! target && window.location.hash ) {\n if ( window.location.hash.substr(1, 3) == '/6/' ) {\n target = \"epubcfi(\" + window.location.hash.substr(1) + \")\";\n } else {\n target = window.location.hash.substr(2);\n target = self._book.url.path().resolve(target);\n }\n }\n\n self.gotoPage(target, function() {\n window._loaded = true;\n self._initializeReaderStyles();\n\n if ( callback ) { callback(); }\n\n self.fire('opened');\n self.fire('ready');\n self._epubjs_ready = true;\n }) \n })\n },\n\n _scroll: function(delta) {\n var self = this;\n if ( self.options.flow == 'scrolled-doc' ) {\n var container = self._rendition.manager.container;\n var rect = container.getBoundingClientRect();\n var scrollTop = container.scrollTop;\n var newScrollTop = scrollTop;\n var scrollBy = ( rect.height * 0.98 );\n switch(delta) {\n case 'PREV':\n newScrollTop = -( scrollTop + scrollBy );\n break;\n case 'NEXT':\n newScrollTop = ( scrollTop + scrollBy );\n break;\n case 'HOME':\n newScrollTop = 0;\n break;\n case 'END':\n newScrollTop = container.scrollHeight - scrollBy;\n break;\n }\n container.scrollTop = newScrollTop;\n return ( Math.floor(container.scrollTop) != Math.floor(scrollTop) );\n }\n return false;\n },\n\n _navigate: function(promise, callback) {\n var self = this;\n var t = setTimeout(function() {\n self._panes['loader'].style.display = 'block';\n }, 100);\n promise.then(function() {\n clearTimeout(t);\n self._panes['loader'].style.display = 'none';\n if ( callback ) { callback(); }\n }).catch(function(e) {\n clearTimeout(t);\n self._panes['loader'].style.display = 'none';\n if ( callback ) { callback(); }\n throw(e);\n })\n },\n\n next: function() {\n var self = this;\n self._scroll('NEXT') || self._navigate(this._rendition.next());\n },\n\n prev: function() {\n this._scroll('PREV') || this._navigate(this._rendition.prev());\n },\n\n first: function() {\n this._navigate(this._rendition.display(0));\n },\n\n last: function() {\n var self = this;\n var target = this._book.spine.length - 1;\n this._navigate(this._rendition.display(target));\n },\n\n gotoPage: function(target, callback) {\n if ( target ) {\n var section = this._book.spine.get(target);\n if ( ! section ) {\n if ( ! this._epubjs_ready ) {\n target = 0;\n } else {\n return;\n }\n }\n }\n\n this._navigate(this._rendition.display(target), callback);\n },\n\n percentageFromCfi: function(cfi) {\n return this._book.percentageFromCfi(cfi);\n },\n\n destroy: function() {\n if ( this._rendition ) {\n try {\n this._rendition.destroy();\n } catch(e) {}\n }\n this._rendition = null;\n this._drawn = false;\n },\n\n reopen: function(options, target) {\n // different per reader?\n var target = target || this.currentLocation();\n if( target.start ) { target = target.start ; }\n if ( target.cfi ) { target = target.cfi ; }\n\n var doUpdate = false;\n Object.keys(options).forEach(function(key) {\n doUpdate = doUpdate || ( options[key] != this.options[key] );\n }.bind(this));\n\n if ( ! doUpdate ) {\n return;\n }\n\n Util.extend(this.options, options);\n\n if ( this._rendition.settings.flow != options.flow ) {\n if ( this.options.flow == 'auto' || this.options.flow == 'paginated' ) {\n this._panes['book'].style.overflow = 'hidden';\n } else {\n this._panes['book'].style.overflow = 'auto';\n }\n this._rendition.flow(this.options.flow);\n }\n\n this._updateFontSize();\n this._updateTheme();\n this._selectTheme(true);\n },\n\n currentLocation: function() {\n if ( this._rendition && this._rendition.manager ) { \n this._cached_location = this._rendition.currentLocation();\n }\n return this._cached_location;\n },\n\n _bindEvents: function() {\n var self = this;\n\n // add a stylesheet to stop images from breaking their columns\n var add_max_img_styles = false;\n if ( this._book.package.metadata.layout == 'pre-paginated' ) {\n // NOOP\n } else if ( this.options.flow == 'auto' || this.options.flow == 'paginated' ) {\n add_max_img_styles = true;\n }\n\n var custom_stylesheet_rules = [];\n\n // if ( add_max_img_styles ) {\n // // WHY IN HEAVENS NAME?\n // // var style = window.getComputedStyle(this._panes['book']);\n // var style = window.getComputedStyle(this._rendition.manager.container);\n // var height = parseInt(style.getPropertyValue('height'));\n // height -= parseInt(style.getPropertyValue('padding-top'));\n // height -= parseInt(style.getPropertyValue('padding-bottom'));\n // // height -= 100;\n // console.log(\"AHOY\", height, style);\n // custom_stylesheet_rules.push([ 'img', [ 'max-height', height + 'px !important' ], [ 'max-width', '100% !important'], [ 'height', 'auto' ], [ 'width', 'auto' ]]);\n // }\n\n this._updateFontSize();\n\n if ( custom_stylesheet_rules.length ) {\n this._rendition.hooks.content.register(function(view) {\n view.addStylesheetRules(custom_stylesheet_rules);\n })\n }\n\n this._rendition.on('resized', function(box) {\n self.fire('resized', box);\n })\n\n this._rendition.on('relocated', function(location) {\n self.fire('relocated', location);\n })\n\n this._rendition.on(\"locationChanged\", function(location) {\n var view = this.manager.current();\n var section = view.section;\n var current = this.book.navigation.get(section.href);\n\n self.fire(\"updateSection\", current);\n self.fire(\"updateLocation\", location);\n });\n\n this._rendition.on(\"rendered\", function(section, view) {\n if ( view.contents ) {\n view.contents.on(\"linkClicked\", function(href) {\n self._rendition.display(href);\n })\n }\n if ( ! self._rendition.manager.__scroll ) {\n var ticking;\n self._rendition.manager.container.addEventListener(\"scroll\", function(event) {\n if ( ! ticking ) {\n var mod = event.target.scrollLeft % parseInt(self._rendition.manager.layout.delta, 10);\n if ( mod > 0 ) {\n ticking = true;\n var x = Math.floor(event.target.scrollLeft / parseInt(self._rendition.manager.layout.delta, 10)) + 1;\n var delta = ( x * self._rendition.manager.layout.delta) - event.target.scrollLeft;\n self._rendition.manager.scrollBy(delta);\n setTimeout(function() { ticking = false; }, 100);\n }\n }\n })\n self._rendition.manager.views.__scroll = true;\n }\n })\n },\n\n _initializeReaderStyles: function() {\n var self = this;\n var themes = this.options.themes;\n if ( themes ) {\n themes.forEach(function(theme) {\n self._rendition.themes.register(theme['klass'], theme.href ? theme.href : theme.rules);\n })\n }\n\n // base for highlights\n this._rendition.themes.override('.epubjs-hl', \"fill: yellow; fill-opacity: 0.3; mix-blend-mode: multiply;\");\n },\n\n _selectTheme: function(refresh) {\n var theme = this.options.theme || 'default';\n this._rendition.themes.select(theme);\n if ( 0 && refresh ) {\n var cfi = this.currentLocation().end.cfi;\n this._rendition.manager.clear();\n console.log(\"AHOY\", cfi);\n this._rendition.display(cfi);\n }\n },\n\n _updateFontSize: function() {\n var text_size = this.options.text_size == 'auto' ? 100 : this.options.text_size;\n this._rendition.themes.fontSize(`${text_size}%`);\n // if ( this.options.text_size == 'large' ) {\n // this._rendition.themes.fontSize(this.options.fontSizeLarge);\n // } else if ( this.options.text_size == 'small' ) {\n // this._rendition.themes.fontSize(this.options.fontSizeSmall);\n // } else {\n // this._rendition.themes.fontSize(this.options.fontSizeDefault);\n // }\n },\n\n EOT: true\n\n})\n\nObject.defineProperty(Reader.EpubJS.prototype, 'metadata', {\n get: function() {\n // return the combined metadata of configured + book metadata\n return this._metadata;\n },\n\n set: function(data) {\n this._metadata = Util.extend({}, data, this.options.metadata);\n }\n});\n\nObject.defineProperty(Reader.EpubJS.prototype, 'annotations', {\n get: function() {\n // return the combined metadata of configured + book metadata\n if ( Browser.ie ) {\n return {\n reset: function() { /* NOOP */ },\n highlight: function(cfiRange) { /* NOOP */ }\n }\n }\n return this._rendition.annotations;\n }\n});\n\nObject.defineProperty(Reader.EpubJS.prototype, 'locations', {\n get: function() {\n // return the combined metadata of configured + book metadata\n return this._book.locations;\n }\n});\n\nwindow.Reader = Reader;\n\nexport function createReader(id, options) {\n return new Reader.EpubJS(id, options);\n}\n","import * as Util from '../core/Util';\nimport {Reader} from './Reader';\nimport * as DomUtil from '../dom/DomUtil';\n\nReader.Mock = Reader.extend({\n\n initialize: function(id, options) {\n Reader.prototype.initialize.apply(this, arguments);\n },\n\n open: function(callback) {\n var self = this;\n this._book = {\n metadata: {\n title: 'The Mock Life',\n creator: 'Alex Mock',\n publisher: 'University Press',\n location: 'Ann Arbor, MI',\n pubdate: '2017-05-23'\n },\n contents: {\n toc: [\n {id: 1, href: \"/epubs/mock/ops/xhtml/TitlePage.xhtml\", label: \"Title\", parent: null},\n {id: 2, href: \"/epubs/mock/ops/xhtml/Chapter01.xhtml\", label: \"Chapter 1\", parent: null},\n {id: 3, href: \"/epubs/mock/ops/xhtml/Chapter02.xhtml\", label: \"Chapter 2\", parent: null},\n {id: 4, href: \"/epubs/mock/ops/xhtml/Chapter03.xhtml\", label: \"Chapter 3\", parent: null},\n {id: 5, href: \"/epubs/mock/ops/xhtml/Chapter04.xhtml\", label: \"Chapter 4\", parent: null},\n {id: 6, href: \"/epubs/mock/ops/xhtml/Chapter05.xhtml\", label: \"Chapter 5\", parent: null},\n {id: 7, href: \"/epubs/mock/ops/xhtml/Chapter06.xhtml\", label: \"Chapter 6\", parent: null},\n {id: 8, href: \"/epubs/mock/ops/xhtml/Chapter07.xhtml\", label: \"Chapter 7\", parent: null},\n {id: 9, href: \"/epubs/mock/ops/xhtml/Index.xhtml\", label: \"Index\", parent: null},\n ]\n }\n };\n\n this._locations = [\n 'epubcfi(/6/4[TitlePage.xhtml])',\n 'epubcfi(/6/4[Chapter01.xhtml])',\n 'epubcfi(/6/4[Chapter02.xhtml])',\n 'epubcfi(/6/4[Chapter03.xhtml])',\n 'epubcfi(/6/4[Chapter04.xhtml])',\n 'epubcfi(/6/4[Chapter05.xhtml])',\n 'epubcfi(/6/4[Chapter06.xhtml])',\n 'epubcfi(/6/4[Chapter07.xhtml])',\n 'epubcfi(/6/4[Chapter08.xhtml])',\n 'epubcfi(/6/4[Index.xhtml])',\n ];\n\n this.__currentIndex = 0;\n\n this.metadata = this._book.metadata;\n this.fire('updateContents', this._book.contents);\n this.fire('updateTitle', this._metadata);\n this.fire('updateLocations', this._locations);\n callback();\n },\n\n draw: function(target, callback) {\n var self = this;\n this.settings = { flow: this.options.flow };\n this.settings.height = '100%';\n this.settings.width = '99%';\n // this.settings.width = '100%';\n if ( this.options.flow == 'auto' ) {\n this._panes['book'].style.overflow = 'hidden';\n } else {\n this._panes['book'].style.overflow = 'auto';\n }\n if ( typeof(target) == 'function' && cb === undefined ) {\n callback = target;\n target = undefined;\n }\n callback();\n self.fire('ready');\n },\n\n next: function() {\n // this._rendition.next();\n },\n\n prev: function() {\n // this._rendition.prev();\n },\n\n first: function() {\n // this._rendition.display(0);\n },\n\n last: function() {\n },\n\n gotoPage: function(target) {\n if ( typeof(target) == \"string\" ) {\n this.__currentIndex = this._locations.indexOf(target);\n } else {\n this.__currentIndex = target;\n }\n this.fire(\"relocated\", this.currentLocation());\n },\n\n destroy: function() {\n // if ( this._rendition ) {\n // this._rendition.destroy();\n // }\n // this._rendition = null;\n },\n\n currentLocation: function() {\n var cfi = this._locations[this.__currentIndex];\n return {\n start: { cfi: cfi, href: cfi },\n end: { cfi: cfi, href: cfi }\n }\n },\n\n _bindEvents: function() {\n var self = this;\n\n },\n\n _updateTheme: function() {\n\n },\n\n EOT: true\n\n})\n\nObject.defineProperty(Reader.Mock.prototype, 'metadata', {\n get: function() {\n // return the combined metadata of configured + book metadata\n return this._metadata;\n },\n\n set: function(data) {\n this._metadata = Util.extend({}, data, this.options.metadata);\n }\n});\n\nObject.defineProperty(Reader.Mock.prototype, 'locations', {\n get: function() {\n // return the combined metadata of configured + book metadata\n var self = this;\n return {\n total: self._locations.length,\n locationFromCfi: function(cfi) {\n return self._locations.indexOf(cfi);\n },\n percentageFromCfi: function(cfi) {\n var index = self.locations.locationFromCfi(cfi);\n return ( index / self.locations.total );\n },\n cfiFromPercentage: function(percentage) {\n var index = Math.ceil(percentage * 10);\n return self._locations[index];\n }\n }\n }\n});\n\nObject.defineProperty(Reader.Mock.prototype, 'annotations', {\n get: function() {\n return {\n reset: function() {},\n highlight: function() {}\n }\n }\n})\n\nexport function createReader(id, options) {\n return new Reader.Mock(id, options);\n}\n","import {Reader} from './Reader';\nimport * as EpubJS from './Reader.EpubJS';\nimport * as Mock from './Reader.Mock';\n\nvar engines = {\n epubjs: EpubJS.createReader,\n mock: Mock.createReader\n}\n\nexport var reader = function(id, options) {\n options = options || {};\n var engine = options.engine || window.COZY_EPUB_ENGINE || 'epubjs';\n var engine_href = options.engine_href || window.COZY_EPUB_ENGINE_HREF;\n var _this = this;\n var _arguments = arguments;\n\n options.engine = engine;\n options.engine_href = engine_href;\n\n return engines[engine].apply(_this, [id, options]);\n}","\nimport {version} from '../package.json';\nexport {version};\n\n// control\nexport * from './control/index';\n\n// core\nexport * from './core/index';\n\n// dom\nexport * from './dom/index';\n\n// reader\nexport * from './reader/index';\n\n// misc\n\nvar oldCozy = window.cozy;\nexport function noConflict() {\n window.cozy = oldCozy;\n return this;\n}\n"],"names":["extend","dest","i","j","len","src","arguments","length","create","Object","F","proto","prototype","bind","fn","obj","slice","Array","apply","call","args","concat","lastId","stamp","_cozy_id","throttle","time","context","lock","wrapperFn","later","wrapNum","x","range","includeMax","max","min","d","falseFn","formatNum","num","digits","pow","Math","round","isNumeric","isNaN","parseFloat","isFinite","trim","str","replace","splitWords","split","setOptions","options","hasOwnProperty","getParamString","existingUrl","uppercase","params","push","encodeURIComponent","toUpperCase","indexOf","join","templateRe","template","data","key","value","undefined","Error","isArray","toString","array","el","emptyImageUrl","getPrefixed","name","window","lastTime","timeoutDefer","Date","timeToCall","setTimeout","requestFn","requestAnimationFrame","cancelFn","cancelAnimationFrame","id","clearTimeout","requestAnimFrame","immediate","cancelAnimFrame","loader","url","handler","_resolved","callbacks","error","then","cb","resolve","catch","reject","_argv","shift","retval","e","log","trace","element","document","createElement","onload","onerror","async","parent","attr","appendChild","Class","props","NewClass","initialize","callInitHooks","parentProto","__super__","Util","constructor","statics","includes","_initHooks","_initHooksCalled","include","mergeOptions","addInitHook","init","checkDeprecatedMixinEvents","cozy","Mixin","Evented","types","type","_on","_events","_off","typeListeners","newListener","ctx","listeners","l","_firingCount","splice","propagate","listens","event","target","_propagateEvent","_eventParents","once","off","on","fire","layer","addEventListener","removeEventListener","clearAllEventListeners","addOneTimeEventListener","fireEvent","hasEventListeners","style","documentElement","ie","ielt9","edge","navigator","webkit","userAgentContains","android","android23","opera","chrome","gecko","safari","phantom","opera12","win","platform","ie3d","webkit3d","WebKitCSSMatrix","gecko3d","any3d","L_DISABLE_3D","mobile","orientation","mobileWebkit","mobileWebkit3d","msPointer","PointerEvent","MSPointerEvent","pointer","touch","L_NO_TOUCH","DocumentTouch","mobileOpera","mobileGecko","retina","devicePixelRatio","screen","deviceXDPI","logicalXDPI","canvas","getContext","svg","vml","div","innerHTML","shape","firstChild","behavior","babelHelpers.typeof","adj","columnCount","classList","userAgent","toLowerCase","Point","y","point","clone","_add","toPoint","_subtract","_divideBy","_multiplyBy","_round","_floor","floor","_ceil","ceil","sqrt","abs","POINTER_DOWN","Browser","POINTER_MOVE","POINTER_UP","POINTER_CANCEL","TAG_WHITE_LIST","_pointers","_pointerDocListener","_pointersCount","addPointerListener","removePointerListener","_addPointerStart","onDown","pointerType","MSPOINTER_TYPE_MOUSE","tagName","_globalPointerDown","_globalPointerMove","_globalPointerUp","pointerId","_handlePointer","touches","changedTouches","_addPointerMove","onMove","buttons","_addPointerEnd","onUp","_touchstart","_touchend","_pre","addDoubleTapListener","last","doubleTap","delay","onTouchStart","count","now","delta","onTouchEnd","cancelBubble","newTouch","prop","removeDoubleTapListener","touchstart","touchend","dblclick","eventsKey","addOne","originalHandler","isExternalTarget","attachEvent","removeOne","detachEvent","stopPropagation","originalEvent","_stopped","disableScrollPropagation","disableClickPropagation","fakeStop","preventDefault","returnValue","stop","getMousePosition","container","clientX","clientY","rect","getBoundingClientRect","left","clientLeft","top","clientTop","wheelPxFactor","getWheelDelta","wheelDeltaY","deltaY","deltaMode","deltaX","deltaZ","wheelDelta","detail","skipEvents","skipped","events","related","relatedTarget","parentNode","err","lastClick","filterClick","timeStamp","elapsed","_simulatedClick","_simulated","Element","matches","ep","webkitMatchesSelector","msMatchesSelector","mozMatchesSelector","TRANSFORM","testProp","TRANSITION","TRANSITION_END","get","getElementById","getStyle","currentStyle","defaultView","css","getComputedStyle","className","remove","removeChild","empty","toFront","toBack","insertBefore","hasClass","contains","getClass","RegExp","test","addClass","classes","add","removeClass","setClass","baseVal","setOpacity","opacity","_setOpacityIE","filter","filterName","filters","item","Enabled","Opacity","isPropertySupported","setTransform","offset","scale","pos","setPosition","_leaflet_pos","getPosition","disableTextSelection","enableTextSelection","_userSelect","DomEvent","userSelectProperty","disableImageDrag","enableImageDrag","_outlineElement","_outlineStyle","preventOutline","tabIndex","outline","restoreOutline","global","freeGlobal","Symbol","root","symToStringTag","objectProto","nativeObjectToString","getRawTag","objectToString","isObject","baseGetTag","coreJsData","funcProto","funcToString","isMasked","isFunction","toSource","getValue","baseIsNative","defineProperty","getNative","eq","baseAssignValue","assignValue","nativeMax","identity","constant","shortOut","baseSetToString","setToString","overRest","isLength","MAX_SAFE_INTEGER","isArrayLike","isIndex","baseRest","isIterateeCall","isObjectLike","baseIsArguments","stubFalse","argsTag","funcTag","nodeUtil","baseUnary","baseIsTypedArray","isArguments","isBuffer","isTypedArray","baseTimes","overArg","isPrototype","nativeKeys","arrayLikeKeys","baseKeys","createAssigner","copyObject","keys","keyboardAllowed","val","fnMap","ret","eventNameMap","fullscreenchange","fullscreenerror","screenfull","elem","request","requestFullscreen","ALLOW_KEYBOARD_INPUT","exitFullscreen","isFullscreen","exit","callback","eventName","defineProperties","Boolean","fullscreenElement","fullscreenEnabled","Reader","self","localStorage","getItem","assign","JSON","parse","_checkFeatureCompatibility","metadata","_initContainer","_initLayout","themes","forEach","theme","href","klass","rules","rule","new_rule","_updateTheme","_initEvents","_mode","mode","js","engine_href","_start","_loaded","open","draw","flow","currentLocation","destroy","setItem","stringify","_container","dataset","index","back","forward","enabled","toggle","DomUtil","_onScroll","_containerId","_fadeAnimated","fadeAnimation","engine","position","_initPanes","panes","_panes","prefix","_initLoader","_targets","onOff","transform3DLimit","_onMoveEnd","location","location_href","start","_ignoreHistory","tmp_href","substr","pushState","cfi","isTrusted","state","gotoPage","keyName","IGNORE_TARGETS","localName","next","prev","_scroll","scrollTop","scrollLeft","keyCode","srcElement","_fireDOMEvent","targets","synth","_findEventTargets","isMarker","containerPoint","latLngToContainerPoint","getLatLng","mouseEventToContainerPoint","layerPoint","containerPointToLayerPoint","latlng","layerPointToLatLng","nonBubblingEvents","h","clientHeight","paddingTop","paddingBottom","w","clientWidth","paddingRight","paddingLeft","height","width","_drawn","_resizeRequest","_checkMobileDevice","text_size","_isMobile","mobileMediaQuery","matchMedia","body","DOMParser","parseFromString","children","Control","_locked","_id","getTime","parseInt","random","region","reader","_reader","removeControl","addControl","onAdd","getRegion","area","getControlRegion","onRemove","screenX","screenY","getContainer","focus","widget","direction","control","addTo","_controlContainer","parts","tmp","slug","panel","slot","pop","childElement","_classify","_controlRegions","PageControl","_control","querySelector","_className","_createButton","_fill","html","label","_bindEvents","title","link","setAttribute","_action","s","unit","_unit","PagePrevious","PageNext","PageFirst","first","PageLast","pageNext","pagePrevious","pageFirst","pageLast","activeModal","FOCUSABLE_ELEMENTS","ACTIONABLE_ELEMENTS","Modal","onShow","onClose","_initializedEvents","actions","handlers","panelHTML","main","action","button_cls","modal","onClick","onKeydown","onModalTransition","button_id","button","close","closeModal","removeEventListeners","activeElement","_resize","setFocusToFirstNode","addEventListeners","showModal","offsetHeight","offsetWidth","fraction","header","footer","nodes","querySelectorAll","map","focusableNodes","getFocusableNodes","maintainFocus","closeAfterAction","hasAttribute","actionableNodes","getActionableNodes","parentElement","click","did_match","selector","getAttribute","focusedItemIndex","shiftKey","Contents","defaultTemplate","_modal","activate","_setupSkipLink","toc","tuple","chapter","tabindex","option","_createOption","reverse","chapter_","unshift","anchor","textContent","skipLink","ul","contents","Title","h1","_title","_divider","_section","bookTitle","PublicationMetadata","_publisher","_rights","publisher","rights","publicationMetadata","Preferences","_activated","_createPanel","initializeForm","possible_fieldsets","layout","hasThemes","_fieldsets","cls","fieldset","fields","hasFields","field","inputs","input","checked","hint","updatePreferences","_form","doUpdate","new_options","updateForm","deactivate","saveOptions","reopen","Fieldset","_current","TextSize","form","_input","_output","_preview","_updatePreview","fontSize","Display","Theme","preferences","Widget","_onAddExtra","_updateTemplate","_updateClass","node","Button","Panel","Toggle","states","stateName","_resetState","_state","Citation","designMode","formatted","createRange","selectNode","sel","getSelection","removeAllRanges","addRange","flag","execCommand","_message","display","detach","citations","citation","format","text","createTextNode","_formatted","_initializeForm","_formatCitation","selected","Search","_data","_canceled","_processing","_article","searchString","openModalResults","openModalWaiting","submitQuery","_emptyArticle","_buildResults","searchUrl","XMLHttpRequest","status","response","send","hasChildNodes","lastChild","content","annotations","reset","search_results","result","cfiRange","chapterTitle","snippet","highlight","search","BibliographicInformation","dl","metadata_fields","metadata_fields_seen","idx","_formatDate","dt","dd","match","bibliographicInformation","Download","_configureDownloadForm","submit","download_links","size","download","Navigator","_setup","locations","_initiated","_total","total","percentageFromCfi","_last_value","_spanTotalLocations","_update","_createControl","_background","_status","_spanCurrentPercentage","_spanCurrentLocation","_mouseDown","cfiFromPercentage","rangeBg","percentage","current","current_location","locationFromCfi","_last_delta","Bus","instance","bus","Events","ePub","require","EpubJS","_epubjs_ready","_book","epubjs","loaded","navigation","_contents","package","ready","generate","settings","manager","overflow","getFixedBookPanelSize","_rendition","renderTo","_updateFontSize","hooks","register","hash","path","_initializeReaderStyles","newScrollTop","scrollBy","scrollHeight","promise","t","_navigate","spine","section","_selectTheme","_cached_location","add_max_img_styles","custom_stylesheet_rules","view","addStylesheetRules","box","book","__scroll","ticking","mod","views","override","refresh","select","end","clear","_metadata","createReader","Mock","_locations","__currentIndex","engines","COZY_EPUB_ENGINE","COZY_EPUB_ENGINE_HREF","_this","_arguments","oldCozy","noConflict"],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;AAQA,AAAO,SAASA,MAAT,CAAgBC,IAAhB,EAAsB;QACrBC,CAAJ,EAAOC,CAAP,EAAUC,GAAV,EAAeC,GAAf;;SAEKF,IAAI,CAAJ,EAAOC,MAAME,UAAUC,MAA5B,EAAoCJ,IAAIC,GAAxC,EAA6CD,GAA7C,EAAkD;cACxCG,UAAUH,CAAV,CAAN;aACKD,CAAL,IAAUG,GAAV,EAAe;iBACNH,CAAL,IAAUG,IAAIH,CAAJ,CAAV;;;WAGDD,IAAP;;;;;AAKJ,AAAO,IAAIO,SAASC,OAAOD,MAAP,IAAkB,YAAY;aACrCE,CAAT,GAAa;WACN,UAAUC,KAAV,EAAiB;UAClBC,SAAF,GAAcD,KAAd;eACO,IAAID,CAAJ,EAAP;KAFJ;CAFiC,EAA9B;;;;;AAWP,AAAO,SAASG,IAAT,CAAcC,EAAd,EAAkBC,GAAlB,EAAuB;QACtBC,QAAQC,MAAML,SAAN,CAAgBI,KAA5B;;QAEIF,GAAGD,IAAP,EAAa;eACFC,GAAGD,IAAH,CAAQK,KAAR,CAAcJ,EAAd,EAAkBE,MAAMG,IAAN,CAAWb,SAAX,EAAsB,CAAtB,CAAlB,CAAP;;;QAGAc,OAAOJ,MAAMG,IAAN,CAAWb,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EAAmC;SACjC,IAAI2a,OAAO8b,IAAX,CAAgBt0B,EAAhB,EAAoBnC,OAApB,CAAP;;;ACtKF,IAAI42B,UAAU;UACJpD,cADI;QAENiD;CAFR;;AAKA,AAAO,IAAItU,SAAS,SAATA,MAAS,CAAShgB,EAAT,EAAanC,OAAb,EAAsB;YAC9BA,WAAW,EAArB;MACIyd,SAASzd,QAAQyd,MAAR,IAAkBhc,OAAOo1B,gBAAzB,IAA6C,QAA1D;MACI1a,cAAcnc,QAAQmc,WAAR,IAAuB1a,OAAOq1B,qBAAhD;MACIC,QAAQ,IAAZ;MACIC,aAAaj6B,SAAjB;;UAEQ0gB,MAAR,GAAiBA,MAAjB;UACQtB,WAAR,GAAsBA,WAAtB;;SAEOya,QAAQnZ,MAAR,EAAgB9f,KAAhB,CAAsBo5B,KAAtB,EAA6B,CAAC50B,EAAD,EAAKnC,OAAL,CAA7B,CAAP;CAVK;;ACSP,IAAIi3B,UAAUx1B,OAAO2D,IAArB;AACA,AAAO,SAAS8xB,UAAT,GAAsB;SACpB9xB,IAAP,GAAc6xB,OAAd;SACO,IAAP;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"cozy-sun-bear.js","sources":["../src/core/Util.js","../src/core/Class.js","../src/core/Events.js","../src/core/Browser.js","../src/geometry/Point.js","../src/dom/DomEvent.Pointer.js","../src/dom/DomEvent.DoubleTap.js","../src/dom/DomEvent.js","../src/dom/DomUtil.js","../node_modules/lodash/isObject.js","../node_modules/lodash/_freeGlobal.js","../node_modules/lodash/_root.js","../node_modules/lodash/_Symbol.js","../node_modules/lodash/_getRawTag.js","../node_modules/lodash/_objectToString.js","../node_modules/lodash/_baseGetTag.js","../node_modules/lodash/isObjectLike.js","../node_modules/lodash/isFunction.js","../node_modules/lodash/_coreJsData.js","../node_modules/lodash/_isMasked.js","../node_modules/lodash/_toSource.js","../node_modules/lodash/_baseIsNative.js","../node_modules/lodash/_getValue.js","../node_modules/lodash/_getNative.js","../node_modules/lodash/_defineProperty.js","../node_modules/lodash/_baseAssignValue.js","../node_modules/lodash/eq.js","../node_modules/lodash/_assignValue.js","../node_modules/lodash/_copyObject.js","../node_modules/lodash/identity.js","../node_modules/lodash/_apply.js","../node_modules/lodash/_overRest.js","../node_modules/lodash/constant.js","../node_modules/lodash/_baseSetToString.js","../node_modules/lodash/_shortOut.js","../node_modules/lodash/_setToString.js","../node_modules/lodash/_baseRest.js","../node_modules/lodash/isLength.js","../node_modules/lodash/isArrayLike.js","../node_modules/lodash/_isIndex.js","../node_modules/lodash/_isIterateeCall.js","../node_modules/lodash/_createAssigner.js","../node_modules/lodash/_isPrototype.js","../node_modules/lodash/_baseTimes.js","../node_modules/lodash/_baseIsArguments.js","../node_modules/lodash/isArguments.js","../node_modules/lodash/isArray.js","../node_modules/lodash/stubFalse.js","../node_modules/lodash/isBuffer.js","../node_modules/lodash/_baseIsTypedArray.js","../node_modules/lodash/_baseUnary.js","../node_modules/lodash/_nodeUtil.js","../node_modules/lodash/isTypedArray.js","../node_modules/lodash/_arrayLikeKeys.js","../node_modules/lodash/_overArg.js","../node_modules/lodash/_nativeKeys.js","../node_modules/lodash/_baseKeys.js","../node_modules/lodash/keys.js","../node_modules/lodash/assign.js","../src/screenfull.js","../src/reader/Reader.js","../src/control/Control.js","../src/control/Control.Paging.js","../src/control/Modal.js","../src/control/Control.Contents.js","../src/control/Control.Title.js","../src/control/Control.PublicationMetadata.js","../src/control/Control.Preferences.js","../src/control/Control.Widget.js","../src/control/Control.Citation.js","../src/control/Control.Search.js","../src/control/Control.BibliographicInformation.js","../src/control/Control.Download.js","../src/control/Control.Navigator.js","../src/control/index.js","../src/core/Bus.js","../src/core/index.js","../src/epubjs.js","../src/reader/Reader.EpubJS.js","../src/reader/Reader.Mock.js","../src/reader/index.js","../src/cozy.js"],"sourcesContent":["/*\n * @namespace Util\n *\n * Various utility functions, used by Leaflet internally.\n */\n\n// @function extend(dest: Object, src?: Object): Object\n// Merges the properties of the `src` object (or multiple objects) into `dest` object and returns the latter. Has an `L.extend` shortcut.\nexport function extend(dest) {\n var i, j, len, src;\n\n for (j = 1, len = arguments.length; j < len; j++) {\n src = arguments[j];\n for (i in src) {\n dest[i] = src[i];\n }\n }\n return dest;\n}\n\n// @function create(proto: Object, properties?: Object): Object\n// Compatibility polyfill for [Object.create](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/create)\nexport var create = Object.create || (function () {\n function F() {}\n return function (proto) {\n F.prototype = proto;\n return new F();\n };\n})();\n\n// @function bind(fn: Function, …): Function\n// Returns a new function bound to the arguments passed, like [Function.prototype.bind](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind).\n// Has a `L.bind()` shortcut.\nexport function bind(fn, obj) {\n var slice = Array.prototype.slice;\n\n if (fn.bind) {\n return fn.bind.apply(fn, slice.call(arguments, 1));\n }\n\n var args = slice.call(arguments, 2);\n\n return function () {\n return fn.apply(obj, args.length ? args.concat(slice.call(arguments)) : arguments);\n };\n}\n\n// @property lastId: Number\n// Last unique ID used by [`stamp()`](#util-stamp)\nexport var lastId = 0;\n\n// @function stamp(obj: Object): Number\n// Returns the unique ID of an object, assiging it one if it doesn't have it.\nexport function stamp(obj) {\n /*eslint-disable */\n obj._cozy_id = obj._cozy_id || ++lastId;\n return obj._cozy_id; /* not leaflet */\n /*eslint-enable */\n}\n\n// @function throttle(fn: Function, time: Number, context: Object): Function\n// Returns a function which executes function `fn` with the given scope `context`\n// (so that the `this` keyword refers to `context` inside `fn`'s code). The function\n// `fn` will be called no more than one time per given amount of `time`. The arguments\n// received by the bound function will be any arguments passed when binding the\n// function, followed by any arguments passed when invoking the bound function.\n// Has an `L.throttle` shortcut.\nexport function throttle(fn, time, context) {\n var lock, args, wrapperFn, later;\n\n later = function () {\n // reset lock and call if queued\n lock = false;\n if (args) {\n wrapperFn.apply(context, args);\n args = false;\n }\n };\n\n wrapperFn = function () {\n if (lock) {\n // called too soon, queue to call later\n args = arguments;\n\n } else {\n // call and lock until later\n fn.apply(context, arguments);\n setTimeout(later, time);\n lock = true;\n }\n };\n\n return wrapperFn;\n}\n\n// @function wrapNum(num: Number, range: Number[], includeMax?: Boolean): Number\n// Returns the number `num` modulo `range` in such a way so it lies within\n// `range[0]` and `range[1]`. The returned value will be always smaller than\n// `range[1]` unless `includeMax` is set to `true`.\nexport function wrapNum(x, range, includeMax) {\n var max = range[1],\n min = range[0],\n d = max - min;\n return x === max && includeMax ? x : ((x - min) % d + d) % d + min;\n}\n\n// @function falseFn(): Function\n// Returns a function which always returns `false`.\nexport function falseFn() { return false; }\n\n// @function formatNum(num: Number, digits?: Number): Number\n// Returns the number `num` rounded to `digits` decimals, or to 5 decimals by default.\nexport function formatNum(num, digits) {\n var pow = Math.pow(10, digits || 5);\n return Math.round(num * pow) / pow;\n}\n\n// @function isNumeric(num: Number): Boolean\n// Returns whether num is actually numeric\nexport function isNumeric(num) {\n return !isNaN(parseFloat(num)) && isFinite(num);\n}\n\n// @function trim(str: String): String\n// Compatibility polyfill for [String.prototype.trim](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/Trim)\nexport function trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n// @function splitWords(str: String): String[]\n// Trims and splits the string on whitespace and returns the array of parts.\nexport function splitWords(str) {\n return trim(str).split(/\\s+/);\n}\n\n// @function setOptions(obj: Object, options: Object): Object\n// Merges the given properties to the `options` of the `obj` object, returning the resulting options. See `Class options`. Has an `L.setOptions` shortcut.\nexport function setOptions(obj, options) {\n if (!obj.hasOwnProperty('options')) {\n obj.options = obj.options ? create(obj.options) : {};\n }\n for (var i in options) {\n obj.options[i] = options[i];\n }\n return obj.options;\n}\n\n// @function getParamString(obj: Object, existingUrl?: String, uppercase?: Boolean): String\n// Converts an object into a parameter URL string, e.g. `{a: \"foo\", b: \"bar\"}`\n// translates to `'?a=foo&b=bar'`. If `existingUrl` is set, the parameters will\n// be appended at the end. If `uppercase` is `true`, the parameter names will\n// be uppercased (e.g. `'?A=foo&B=bar'`)\nexport function getParamString(obj, existingUrl, uppercase) {\n var params = [];\n for (var i in obj) {\n params.push(encodeURIComponent(uppercase ? i.toUpperCase() : i) + '=' + encodeURIComponent(obj[i]));\n }\n return ((!existingUrl || existingUrl.indexOf('?') === -1) ? '?' : '&') + params.join('&');\n}\n\nvar templateRe = /\\{ *([\\w_\\-]+) *\\}/g;\n\n// @function template(str: String, data: Object): String\n// Simple templating facility, accepts a template string of the form `'Hello {a}, {b}'`\n// and a data object like `{a: 'foo', b: 'bar'}`, returns evaluated string\n// `('Hello foo, bar')`. You can also specify functions instead of strings for\n// data values — they will be evaluated passing `data` as an argument.\nexport function template(str, data) {\n return str.replace(templateRe, function (str, key) {\n var value = data[key];\n\n if (value === undefined) {\n throw new Error('No value provided for variable ' + str);\n\n } else if (typeof value === 'function') {\n value = value(data);\n }\n return value;\n });\n}\n\n// @function isArray(obj): Boolean\n// Compatibility polyfill for [Array.isArray](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray)\nexport var isArray = Array.isArray || function (obj) {\n return (Object.prototype.toString.call(obj) === '[object Array]');\n};\n\n// @function indexOf(array: Array, el: Object): Number\n// Compatibility polyfill for [Array.prototype.indexOf](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf)\nexport function indexOf(array, el) {\n for (var i = 0; i < array.length; i++) {\n if (array[i] === el) { return i; }\n }\n return -1;\n}\n\n// @property emptyImageUrl: String\n// Data URI string containing a base64-encoded empty GIF image.\n// Used as a hack to free memory from unused images on WebKit-powered\n// mobile devices (by setting image `src` to this string).\nexport var emptyImageUrl = 'data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=';\n\n// inspired by http://paulirish.com/2011/requestanimationframe-for-smart-animating/\n\nfunction getPrefixed(name) {\n return window['webkit' + name] || window['moz' + name] || window['ms' + name];\n}\n\nvar lastTime = 0;\n\n// fallback for IE 7-8\nfunction timeoutDefer(fn) {\n var time = +new Date(),\n timeToCall = Math.max(0, 16 - (time - lastTime));\n\n lastTime = time + timeToCall;\n return window.setTimeout(fn, timeToCall);\n}\n\nexport var requestFn = window.requestAnimationFrame || getPrefixed('RequestAnimationFrame') || timeoutDefer;\nexport var cancelFn = window.cancelAnimationFrame || getPrefixed('CancelAnimationFrame') ||\n getPrefixed('CancelRequestAnimationFrame') || function (id) { window.clearTimeout(id); };\n\n// @function requestAnimFrame(fn: Function, context?: Object, immediate?: Boolean): Number\n// Schedules `fn` to be executed when the browser repaints. `fn` is bound to\n// `context` if given. When `immediate` is set, `fn` is called immediately if\n// the browser doesn't have native support for\n// [`window.requestAnimationFrame`](https://developer.mozilla.org/docs/Web/API/window/requestAnimationFrame),\n// otherwise it's delayed. Returns a request ID that can be used to cancel the request.\nexport function requestAnimFrame(fn, context, immediate) {\n if (immediate && requestFn === timeoutDefer) {\n fn.call(context);\n } else {\n return requestFn.call(window, bind(fn, context));\n }\n}\n\n// @function cancelAnimFrame(id: Number): undefined\n// Cancels a previous `requestAnimFrame`. See also [window.cancelAnimationFrame](https://developer.mozilla.org/docs/Web/API/window/cancelAnimationFrame).\nexport function cancelAnimFrame(id) {\n if (id) {\n cancelFn.call(window, id);\n }\n}\n\nexport var loader = {\n js: function(url) {\n var handler = { _resolved: false };\n handler.callbacks = [];\n handler.error = [];\n handler.then = function(cb) {\n handler.callbacks.push(cb);\n if ( handler._resolved ) { return handler.resolve(); }\n return handler;\n }\n handler.catch = function(cb) {\n handler.error.push(cb);\n if ( handler._resolved ) { return handler.reject(); }\n return handler;\n }\n handler.resolve = function(_argv) {\n // var _argv;\n handler._resolved = true;\n while ( handler.callbacks.length ) {\n var cb = handler.callbacks.shift();\n var retval;\n try {\n _argv = cb(_argv);\n } catch(e) {\n console.log(e);\n handler.reject(e);\n break;\n }\n }\n return handler;\n }\n\n handler.reject = function(e) {\n while ( handler.error.length ) {\n var cb = handler.error.shift();\n cb(e);\n }\n console.log(e);\n console.trace();\n return handler;\n }\n\n if ( url == undefined ) {\n handler._resolved = true;\n return handler;\n }\n\n var element = document.createElement('script');\n\n element.onload = function() {\n handler.resolve(url);\n };\n element.onerror = function() {\n handler.catch.apply(arguments);\n };\n\n element.async = true;\n var parent = 'body';\n var attr = 'src';\n element[attr] = url;\n document[parent].appendChild(element);\n\n console.log(\"AHOY APPENDED\", url);\n\n return handler;\n }\n}","import * as Util from './Util';\r\n\r\n// @class Class\r\n// @aka L.Class\r\n\r\n// @section\r\n// @uninheritable\r\n\r\n// Thanks to John Resig and Dean Edwards for inspiration!\r\n\r\nexport function Class() {}\r\n\r\nClass.extend = function (props) {\r\n\r\n\t// @function extend(props: Object): Function\r\n\t// [Extends the current class](#class-inheritance) given the properties to be included.\r\n\t// Returns a Javascript function that is a class constructor (to be called with `new`).\r\n\tvar NewClass = function () {\r\n\r\n\t\t// call the constructor\r\n\t\tif (this.initialize) {\r\n\t\t\tthis.initialize.apply(this, arguments);\r\n\t\t}\r\n\r\n\t\t// call all constructor hooks\r\n\t\tthis.callInitHooks();\r\n\t};\r\n\r\n\tvar parentProto = NewClass.__super__ = this.prototype;\r\n\r\n\tvar proto = Util.create(parentProto);\r\n\tproto.constructor = NewClass;\r\n\r\n\tNewClass.prototype = proto;\r\n\r\n\t// inherit parent's statics\r\n\tfor (var i in this) {\r\n\t\tif (this.hasOwnProperty(i) && i !== 'prototype') {\r\n\t\t\tNewClass[i] = this[i];\r\n\t\t}\r\n\t}\r\n\r\n\t// mix static properties into the class\r\n\tif (props.statics) {\r\n\t\tUtil.extend(NewClass, props.statics);\r\n\t\tdelete props.statics;\r\n\t}\r\n\r\n\t// mix includes into the prototype\r\n\tif (props.includes) {\r\n\t\tcheckDeprecatedMixinEvents(props.includes);\r\n\t\tUtil.extend.apply(null, [proto].concat(props.includes));\r\n\t\tdelete props.includes;\r\n\t}\r\n\r\n\t// merge options\r\n\tif (proto.options) {\r\n\t\tprops.options = Util.extend(Util.create(proto.options), props.options);\r\n\t}\r\n\r\n\t// mix given properties into the prototype\r\n\tUtil.extend(proto, props);\r\n\t\r\n\tproto._initHooks = [];\r\n\r\n\t// add method for calling all hooks\r\n\tproto.callInitHooks = function () {\r\n\r\n\t\tif (this._initHooksCalled) { return; }\r\n\r\n\t\tif (parentProto.callInitHooks) {\r\n\t\t\tparentProto.callInitHooks.call(this);\r\n\t\t}\r\n\r\n\t\tthis._initHooksCalled = true;\r\n\r\n\t\tfor (var i = 0, len = proto._initHooks.length; i < len; i++) {\r\n\t\t\tproto._initHooks[i].call(this);\r\n\t\t}\r\n\t};\r\n\r\n\treturn NewClass;\r\n};\r\n\r\n\r\n// @function include(properties: Object): this\r\n// [Includes a mixin](#class-includes) into the current class.\r\nClass.include = function (props) {\r\n\tUtil.extend(this.prototype, props);\r\n\treturn this;\r\n};\r\n\r\n// @function mergeOptions(options: Object): this\r\n// [Merges `options`](#class-options) into the defaults of the class.\r\nClass.mergeOptions = function (options) {\r\n\tUtil.extend(this.prototype.options, options);\r\n\treturn this;\r\n};\r\n\r\n// @function addInitHook(fn: Function): this\r\n// Adds a [constructor hook](#class-constructor-hooks) to the class.\r\nClass.addInitHook = function (fn) { // (Function) || (String, args...)\r\n\tvar args = Array.prototype.slice.call(arguments, 1);\r\n\r\n\tvar init = typeof fn === 'function' ? fn : function () {\r\n\t\tthis[fn].apply(this, args);\r\n\t};\r\n\r\n\tthis.prototype._initHooks = this.prototype._initHooks || [];\r\n\tthis.prototype._initHooks.push(init);\r\n\treturn this;\r\n};\r\n\r\nfunction checkDeprecatedMixinEvents(includes) {\r\n\tif (!cozy || !cozy.Mixin) { return; }\r\n\r\n\tincludes = cozy.Util.isArray(includes) ? includes : [includes];\r\n\r\n\t// for (var i = 0; i < includes.length; i++) {\r\n\t// \tif (includes[i] === cozy.Mixin.Events) {\r\n\t// \t\tconsole.warn('Deprecated include of cozy.Mixin.Events: ' +\r\n\t// \t\t\t'this property will be removed in future releases, ' +\r\n\t// \t\t\t'please inherit from cozy.Evented instead.', new Error().stack);\r\n\t// \t}\r\n\t// }\r\n}\r\n","import {Class} from './Class';\r\nimport * as Util from './Util';\r\n\r\n/*\r\n * @class Evented\r\n * @aka L.Evented\r\n * @inherits Class\r\n *\r\n * A set of methods shared between event-powered classes (like `Map` and `Marker`). Generally, events allow you to execute some function when something happens with an object (e.g. the user clicks on the map, causing the map to fire `'click'` event).\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * map.on('click', function(e) {\r\n * \talert(e.latlng);\r\n * } );\r\n * ```\r\n *\r\n * Leaflet deals with event listeners by reference, so if you want to add a listener and then remove it, define it as a function:\r\n *\r\n * ```js\r\n * function onClick(e) { ... }\r\n *\r\n * map.on('click', onClick);\r\n * map.off('click', onClick);\r\n * ```\r\n */\r\n\r\nexport var Evented = Class.extend({\r\n\r\n\t/* @method on(type: String, fn: Function, context?: Object): this\r\n\t * Adds a listener function (`fn`) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. `'click dblclick'`).\r\n\t *\r\n\t * @alternative\r\n\t * @method on(eventMap: Object): this\r\n\t * Adds a set of type/listener pairs, e.g. `{click: onClick, mousemove: onMouseMove}`\r\n\t */\r\n\ton: function (types, fn, context) {\r\n\r\n\t\t// types can be a map of types/handlers\r\n\t\tif (typeof types === 'object') {\r\n\t\t\tfor (var type in types) {\r\n\t\t\t\t// we don't process space-separated events here for performance;\r\n\t\t\t\t// it's a hot path since Layer uses the on(obj) syntax\r\n\t\t\t\tthis._on(type, types[type], fn);\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\t// types can be a string of space-separated words\r\n\t\t\ttypes = Util.splitWords(types);\r\n\r\n\t\t\tfor (var i = 0, len = types.length; i < len; i++) {\r\n\t\t\t\tthis._on(types[i], fn, context);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t/* @method off(type: String, fn?: Function, context?: Object): this\r\n\t * Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to `on`, you must pass the same context to `off` in order to remove the listener.\r\n\t *\r\n\t * @alternative\r\n\t * @method off(eventMap: Object): this\r\n\t * Removes a set of type/listener pairs.\r\n\t *\r\n\t * @alternative\r\n\t * @method off: this\r\n\t * Removes all listeners to all events on the object.\r\n\t */\r\n\toff: function (types, fn, context) {\r\n\r\n\t\tif (!types) {\r\n\t\t\t// clear all listeners if called without arguments\r\n\t\t\tdelete this._events;\r\n\r\n\t\t} else if (typeof types === 'object') {\r\n\t\t\tfor (var type in types) {\r\n\t\t\t\tthis._off(type, types[type], fn);\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\ttypes = Util.splitWords(types);\r\n\r\n\t\t\tfor (var i = 0, len = types.length; i < len; i++) {\r\n\t\t\t\tthis._off(types[i], fn, context);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// attach listener (without syntactic sugar now)\r\n\t_on: function (type, fn, context) {\r\n\t\tthis._events = this._events || {};\r\n\r\n\t\t/* get/init listeners for type */\r\n\t\tvar typeListeners = this._events[type];\r\n\t\tif (!typeListeners) {\r\n\t\t\ttypeListeners = [];\r\n\t\t\tthis._events[type] = typeListeners;\r\n\t\t}\r\n\r\n\t\tif (context === this) {\r\n\t\t\t// Less memory footprint.\r\n\t\t\tcontext = undefined;\r\n\t\t}\r\n\t\tvar newListener = {fn: fn, ctx: context},\r\n\t\t listeners = typeListeners;\r\n\r\n\t\t// check if fn already there\r\n\t\tfor (var i = 0, len = listeners.length; i < len; i++) {\r\n\t\t\tif (listeners[i].fn === fn && listeners[i].ctx === context) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tlisteners.push(newListener);\r\n\t},\r\n\r\n\t_off: function (type, fn, context) {\r\n\t\tvar listeners,\r\n\t\t i,\r\n\t\t len;\r\n\r\n\t\tif (!this._events) { return; }\r\n\r\n\t\tlisteners = this._events[type];\r\n\r\n\t\tif (!listeners) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (!fn) {\r\n\t\t\t// Set all removed listeners to noop so they are not called if remove happens in fire\r\n\t\t\tfor (i = 0, len = listeners.length; i < len; i++) {\r\n\t\t\t\tlisteners[i].fn = Util.falseFn;\r\n\t\t\t}\r\n\t\t\t// clear all listeners for a type if function isn't specified\r\n\t\t\tdelete this._events[type];\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (context === this) {\r\n\t\t\tcontext = undefined;\r\n\t\t}\r\n\r\n\t\tif (listeners) {\r\n\r\n\t\t\t// find fn and remove it\r\n\t\t\tfor (i = 0, len = listeners.length; i < len; i++) {\r\n\t\t\t\tvar l = listeners[i];\r\n\t\t\t\tif (l.ctx !== context) { continue; }\r\n\t\t\t\tif (l.fn === fn) {\r\n\r\n\t\t\t\t\t// set the removed listener to noop so that's not called if remove happens in fire\r\n\t\t\t\t\tl.fn = Util.falseFn;\r\n\r\n\t\t\t\t\tif (this._firingCount) {\r\n\t\t\t\t\t\t/* copy array in case events are being fired */\r\n\t\t\t\t\t\tthis._events[type] = listeners = listeners.slice();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tlisteners.splice(i, 1);\r\n\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t// @method fire(type: String, data?: Object, propagate?: Boolean): this\r\n\t// Fires an event of the specified type. You can optionally provide an data\r\n\t// object — the first argument of the listener function will contain its\r\n\t// properties. The event can optionally be propagated to event parents.\r\n\tfire: function (type, data, propagate) {\r\n\t\tif (!this.listens(type, propagate)) { return this; }\r\n\r\n\t\tvar event = Util.extend({}, data, {type: type, target: this});\r\n\r\n\t\tif (this._events) {\r\n\t\t\tvar listeners = this._events[type];\r\n\r\n\t\t\tif (listeners) {\r\n\t\t\t\tthis._firingCount = (this._firingCount + 1) || 1;\r\n\t\t\t\tfor (var i = 0, len = listeners.length; i < len; i++) {\r\n\t\t\t\t\tvar l = listeners[i];\r\n\t\t\t\t\tl.fn.call(l.ctx || this, event);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis._firingCount--;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (propagate) {\r\n\t\t\t// propagate the event to parents (set with addEventParent)\r\n\t\t\tthis._propagateEvent(event);\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method listens(type: String): Boolean\r\n\t// Returns `true` if a particular event type has any listeners attached to it.\r\n\tlistens: function (type, propagate) {\r\n\t\tvar listeners = this._events && this._events[type];\r\n\t\tif (listeners && listeners.length) { return true; }\r\n\r\n\t\tif (propagate) {\r\n\t\t\t// also check parents for listeners if event propagates\r\n\t\t\tfor (var id in this._eventParents) {\r\n\t\t\t\tif (this._eventParents[id].listens(type, propagate)) { return true; }\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\r\n\t// @method once(…): this\r\n\t// Behaves as [`on(…)`](#evented-on), except the listener will only get fired once and then removed.\r\n\tonce: function (types, fn, context) {\r\n\r\n\t\tif (typeof types === 'object') {\r\n\t\t\tfor (var type in types) {\r\n\t\t\t\tthis.once(type, types[type], fn);\r\n\t\t\t}\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\tvar handler = Util.bind(function () {\r\n\t\t\tthis\r\n\t\t\t .off(types, fn, context)\r\n\t\t\t .off(types, handler, context);\r\n\t\t}, this);\r\n\r\n\t\t// add a listener that's executed once and removed after that\r\n\t\treturn this\r\n\t\t .on(types, fn, context)\r\n\t\t .on(types, handler, context);\r\n\t},\r\n\r\n\t// @method addEventParent(obj: Evented): this\r\n\t// Adds an event parent - an `Evented` that will receive propagated events\r\n\taddEventParent: function (obj) {\r\n\t\tthis._eventParents = this._eventParents || {};\r\n\t\tthis._eventParents[Util.stamp(obj)] = obj;\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method removeEventParent(obj: Evented): this\r\n\t// Removes an event parent, so it will stop receiving propagated events\r\n\tremoveEventParent: function (obj) {\r\n\t\tif (this._eventParents) {\r\n\t\t\tdelete this._eventParents[Util.stamp(obj)];\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t_propagateEvent: function (e) {\r\n\t\tfor (var id in this._eventParents) {\r\n\t\t\tthis._eventParents[id].fire(e.type, Util.extend({layer: e.target}, e), true);\r\n\t\t}\r\n\t}\r\n});\r\n\r\nvar proto = Evented.prototype;\r\n\r\n// aliases; we should ditch those eventually\r\n\r\n// @method addEventListener(…): this\r\n// Alias to [`on(…)`](#evented-on)\r\nproto.addEventListener = proto.on;\r\n\r\n// @method removeEventListener(…): this\r\n// Alias to [`off(…)`](#evented-off)\r\n\r\n// @method clearAllEventListeners(…): this\r\n// Alias to [`off()`](#evented-off)\r\nproto.removeEventListener = proto.clearAllEventListeners = proto.off;\r\n\r\n// @method addOneTimeEventListener(…): this\r\n// Alias to [`once(…)`](#evented-once)\r\nproto.addOneTimeEventListener = proto.once;\r\n\r\n// @method fireEvent(…): this\r\n// Alias to [`fire(…)`](#evented-fire)\r\nproto.fireEvent = proto.fire;\r\n\r\n// @method hasEventListeners(…): Boolean\r\n// Alias to [`listens(…)`](#evented-listens)\r\nproto.hasEventListeners = proto.listens;\r\n","\n/*\n * @namespace Browser\n * @aka L.Browser\n *\n * A namespace with static properties for browser/feature detection used by Leaflet internally.\n *\n * @example\n *\n * ```js\n * if (L.Browser.ielt9) {\n * alert('Upgrade your browser, dude!');\n * }\n * ```\n */\n\nvar style = document.documentElement.style;\n\n// @property ie: Boolean; `true` for all Internet Explorer versions (not Edge).\nexport var ie = 'ActiveXObject' in window;\n\n// @property ielt9: Boolean; `true` for Internet Explorer versions less than 9.\nexport var ielt9 = ie && !document.addEventListener;\n\n// @property edge: Boolean; `true` for the Edge web browser.\nexport var edge = 'msLaunchUri' in navigator && !('documentMode' in document);\n\n// @property webkit: Boolean;\n// `true` for webkit-based browsers like Chrome and Safari (including mobile versions).\nexport var webkit = userAgentContains('webkit');\n\n// @property android: Boolean\n// `true` for any browser running on an Android platform.\nexport var android = userAgentContains('android');\n\n// @property android23: Boolean; `true` for browsers running on Android 2 or Android 3.\nexport var android23 = userAgentContains('android 2') || userAgentContains('android 3');\n\n// @property opera: Boolean; `true` for the Opera browser\nexport var opera = !!window.opera;\n\n// @property chrome: Boolean; `true` for the Chrome browser.\nexport var chrome = userAgentContains('chrome');\n\n// @property gecko: Boolean; `true` for gecko-based browsers like Firefox.\nexport var gecko = userAgentContains('gecko') && !webkit && !opera && !ie;\n\n// @property safari: Boolean; `true` for the Safari browser.\nexport var safari = !chrome && userAgentContains('safari');\n\nexport var phantom = userAgentContains('phantom');\n\n// @property opera12: Boolean\n// `true` for the Opera browser supporting CSS transforms (version 12 or later).\nexport var opera12 = 'OTransition' in style;\n\n// @property win: Boolean; `true` when the browser is running in a Windows platform\nexport var win = navigator.platform.indexOf('Win') === 0;\n\n// @property ie3d: Boolean; `true` for all Internet Explorer versions supporting CSS transforms.\nexport var ie3d = ie && ('transition' in style);\n\n// @property webkit3d: Boolean; `true` for webkit-based browsers supporting CSS transforms.\nexport var webkit3d = ('WebKitCSSMatrix' in window) && ('m11' in new window.WebKitCSSMatrix()) && !android23;\n\n// @property gecko3d: Boolean; `true` for gecko-based browsers supporting CSS transforms.\nexport var gecko3d = 'MozPerspective' in style;\n\n// @property any3d: Boolean\n// `true` for all browsers supporting CSS transforms.\nexport var any3d = !window.L_DISABLE_3D && (ie3d || webkit3d || gecko3d) && !opera12 && !phantom;\n\n// @property mobile: Boolean; `true` for all browsers running in a mobile device.\nexport var mobile = typeof orientation !== 'undefined' || userAgentContains('mobile');\n\n// @property mobileWebkit: Boolean; `true` for all webkit-based browsers in a mobile device.\nexport var mobileWebkit = mobile && webkit;\n\n// @property mobileWebkit3d: Boolean\n// `true` for all webkit-based browsers in a mobile device supporting CSS transforms.\nexport var mobileWebkit3d = mobile && webkit3d;\n\n// @property msPointer: Boolean\n// `true` for browsers implementing the Microsoft touch events model (notably IE10).\nexport var msPointer = !window.PointerEvent && window.MSPointerEvent;\n\n// @property pointer: Boolean\n// `true` for all browsers supporting [pointer events](https://msdn.microsoft.com/en-us/library/dn433244%28v=vs.85%29.aspx).\nexport var pointer = !!(window.PointerEvent || msPointer);\n\n// @property touch: Boolean\n// `true` for all browsers supporting [touch events](https://developer.mozilla.org/docs/Web/API/Touch_events).\n// This does not necessarily mean that the browser is running in a computer with\n// a touchscreen, it only means that the browser is capable of understanding\n// touch events.\nexport var touch = !window.L_NO_TOUCH && (pointer || 'ontouchstart' in window ||\n (window.DocumentTouch && document instanceof window.DocumentTouch));\n\n// @property mobileOpera: Boolean; `true` for the Opera browser in a mobile device.\nexport var mobileOpera = mobile && opera;\n\n// @property mobileGecko: Boolean\n// `true` for gecko-based browsers running in a mobile device.\nexport var mobileGecko = mobile && gecko;\n\n// @property retina: Boolean\n// `true` for browsers on a high-resolution \"retina\" screen.\nexport var retina = (window.devicePixelRatio || (window.screen.deviceXDPI / window.screen.logicalXDPI)) > 1;\n\n\n// @property canvas: Boolean\n// `true` when the browser supports [``](https://developer.mozilla.org/docs/Web/API/Canvas_API).\nexport var canvas = (function () {\n return !!document.createElement('canvas').getContext;\n}());\n\n// @property svg: Boolean\n// `true` when the browser supports [SVG](https://developer.mozilla.org/docs/Web/SVG).\n// export var svg = !!(document.createElementNS && svgCreate('svg').createSVGRect);\nexport var svg = true;\n\n// @property vml: Boolean\n// `true` if the browser supports [VML](https://en.wikipedia.org/wiki/Vector_Markup_Language).\nexport var vml = !svg && (function () {\n try {\n var div = document.createElement('div');\n div.innerHTML = '';\n\n var shape = div.firstChild;\n shape.style.behavior = 'url(#default#VML)';\n\n return shape && (typeof shape.adj === 'object');\n\n } catch (e) {\n return false;\n }\n}());\n\nexport var columnCount = ( 'columnCount' in style );\nexport var classList = ( document.documentElement.classList !== undefined );\n\nfunction userAgentContains(str) {\n return navigator.userAgent.toLowerCase().indexOf(str) >= 0;\n}\n","import {isArray, formatNum} from '../core/Util';\r\n\r\n/*\r\n * @class Point\r\n * @aka L.Point\r\n *\r\n * Represents a point with `x` and `y` coordinates in pixels.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * var point = L.point(200, 300);\r\n * ```\r\n *\r\n * All Leaflet methods and options that accept `Point` objects also accept them in a simple Array form (unless noted otherwise), so these lines are equivalent:\r\n *\r\n * ```js\r\n * map.panBy([200, 300]);\r\n * map.panBy(L.point(200, 300));\r\n * ```\r\n */\r\n\r\nexport function Point(x, y, round) {\r\n\t// @property x: Number; The `x` coordinate of the point\r\n\tthis.x = (round ? Math.round(x) : x);\r\n\t// @property y: Number; The `y` coordinate of the point\r\n\tthis.y = (round ? Math.round(y) : y);\r\n}\r\n\r\nPoint.prototype = {\r\n\r\n\t// @method clone(): Point\r\n\t// Returns a copy of the current point.\r\n\tclone: function () {\r\n\t\treturn new Point(this.x, this.y);\r\n\t},\r\n\r\n\t// @method add(otherPoint: Point): Point\r\n\t// Returns the result of addition of the current and the given points.\r\n\tadd: function (point) {\r\n\t\t// non-destructive, returns a new point\r\n\t\treturn this.clone()._add(toPoint(point));\r\n\t},\r\n\r\n\t_add: function (point) {\r\n\t\t// destructive, used directly for performance in situations where it's safe to modify existing point\r\n\t\tthis.x += point.x;\r\n\t\tthis.y += point.y;\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method subtract(otherPoint: Point): Point\r\n\t// Returns the result of subtraction of the given point from the current.\r\n\tsubtract: function (point) {\r\n\t\treturn this.clone()._subtract(toPoint(point));\r\n\t},\r\n\r\n\t_subtract: function (point) {\r\n\t\tthis.x -= point.x;\r\n\t\tthis.y -= point.y;\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method divideBy(num: Number): Point\r\n\t// Returns the result of division of the current point by the given number.\r\n\tdivideBy: function (num) {\r\n\t\treturn this.clone()._divideBy(num);\r\n\t},\r\n\r\n\t_divideBy: function (num) {\r\n\t\tthis.x /= num;\r\n\t\tthis.y /= num;\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method multiplyBy(num: Number): Point\r\n\t// Returns the result of multiplication of the current point by the given number.\r\n\tmultiplyBy: function (num) {\r\n\t\treturn this.clone()._multiplyBy(num);\r\n\t},\r\n\r\n\t_multiplyBy: function (num) {\r\n\t\tthis.x *= num;\r\n\t\tthis.y *= num;\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method scaleBy(scale: Point): Point\r\n\t// Multiply each coordinate of the current point by each coordinate of\r\n\t// `scale`. In linear algebra terms, multiply the point by the\r\n\t// [scaling matrix](https://en.wikipedia.org/wiki/Scaling_%28geometry%29#Matrix_representation)\r\n\t// defined by `scale`.\r\n\tscaleBy: function (point) {\r\n\t\treturn new Point(this.x * point.x, this.y * point.y);\r\n\t},\r\n\r\n\t// @method unscaleBy(scale: Point): Point\r\n\t// Inverse of `scaleBy`. Divide each coordinate of the current point by\r\n\t// each coordinate of `scale`.\r\n\tunscaleBy: function (point) {\r\n\t\treturn new Point(this.x / point.x, this.y / point.y);\r\n\t},\r\n\r\n\t// @method round(): Point\r\n\t// Returns a copy of the current point with rounded coordinates.\r\n\tround: function () {\r\n\t\treturn this.clone()._round();\r\n\t},\r\n\r\n\t_round: function () {\r\n\t\tthis.x = Math.round(this.x);\r\n\t\tthis.y = Math.round(this.y);\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method floor(): Point\r\n\t// Returns a copy of the current point with floored coordinates (rounded down).\r\n\tfloor: function () {\r\n\t\treturn this.clone()._floor();\r\n\t},\r\n\r\n\t_floor: function () {\r\n\t\tthis.x = Math.floor(this.x);\r\n\t\tthis.y = Math.floor(this.y);\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method ceil(): Point\r\n\t// Returns a copy of the current point with ceiled coordinates (rounded up).\r\n\tceil: function () {\r\n\t\treturn this.clone()._ceil();\r\n\t},\r\n\r\n\t_ceil: function () {\r\n\t\tthis.x = Math.ceil(this.x);\r\n\t\tthis.y = Math.ceil(this.y);\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method distanceTo(otherPoint: Point): Number\r\n\t// Returns the cartesian distance between the current and the given points.\r\n\tdistanceTo: function (point) {\r\n\t\tpoint = toPoint(point);\r\n\r\n\t\tvar x = point.x - this.x,\r\n\t\t y = point.y - this.y;\r\n\r\n\t\treturn Math.sqrt(x * x + y * y);\r\n\t},\r\n\r\n\t// @method equals(otherPoint: Point): Boolean\r\n\t// Returns `true` if the given point has the same coordinates.\r\n\tequals: function (point) {\r\n\t\tpoint = toPoint(point);\r\n\r\n\t\treturn point.x === this.x &&\r\n\t\t point.y === this.y;\r\n\t},\r\n\r\n\t// @method contains(otherPoint: Point): Boolean\r\n\t// Returns `true` if both coordinates of the given point are less than the corresponding current point coordinates (in absolute values).\r\n\tcontains: function (point) {\r\n\t\tpoint = toPoint(point);\r\n\r\n\t\treturn Math.abs(point.x) <= Math.abs(this.x) &&\r\n\t\t Math.abs(point.y) <= Math.abs(this.y);\r\n\t},\r\n\r\n\t// @method toString(): String\r\n\t// Returns a string representation of the point for debugging purposes.\r\n\ttoString: function () {\r\n\t\treturn 'Point(' +\r\n\t\t formatNum(this.x) + ', ' +\r\n\t\t formatNum(this.y) + ')';\r\n\t}\r\n};\r\n\r\n// @factory L.point(x: Number, y: Number, round?: Boolean)\r\n// Creates a Point object with the given `x` and `y` coordinates. If optional `round` is set to true, rounds the `x` and `y` values.\r\n\r\n// @alternative\r\n// @factory L.point(coords: Number[])\r\n// Expects an array of the form `[x, y]` instead.\r\n\r\n// @alternative\r\n// @factory L.point(coords: Object)\r\n// Expects a plain object of the form `{x: Number, y: Number}` instead.\r\nexport function toPoint(x, y, round) {\r\n\tif (x instanceof Point) {\r\n\t\treturn x;\r\n\t}\r\n\tif (isArray(x)) {\r\n\t\treturn new Point(x[0], x[1]);\r\n\t}\r\n\tif (x === undefined || x === null) {\r\n\t\treturn x;\r\n\t}\r\n\tif (typeof x === 'object' && 'x' in x && 'y' in x) {\r\n\t\treturn new Point(x.x, x.y);\r\n\t}\r\n\treturn new Point(x, y, round);\r\n}\r\n","import * as DomEvent from './DomEvent';\nimport * as Util from '../core/Util';\nimport * as Browser from '../core/Browser';\n\n/*\n * Extends L.DomEvent to provide touch support for Internet Explorer and Windows-based devices.\n */\n\n\nvar POINTER_DOWN = Browser.msPointer ? 'MSPointerDown' : 'pointerdown',\n POINTER_MOVE = Browser.msPointer ? 'MSPointerMove' : 'pointermove',\n POINTER_UP = Browser.msPointer ? 'MSPointerUp' : 'pointerup',\n POINTER_CANCEL = Browser.msPointer ? 'MSPointerCancel' : 'pointercancel',\n TAG_WHITE_LIST = ['INPUT', 'SELECT', 'OPTION'],\n\n _pointers = {},\n _pointerDocListener = false;\n\n// DomEvent.DoubleTap needs to know about this\nexport var _pointersCount = 0;\n\n// Provides a touch events wrapper for (ms)pointer events.\n// ref http://www.w3.org/TR/pointerevents/ https://www.w3.org/Bugs/Public/show_bug.cgi?id=22890\n\nexport function addPointerListener(obj, type, handler, id) {\n\tif (type === 'touchstart') {\n\t\t_addPointerStart(obj, handler, id);\n\n\t} else if (type === 'touchmove') {\n\t\t_addPointerMove(obj, handler, id);\n\n\t} else if (type === 'touchend') {\n\t\t_addPointerEnd(obj, handler, id);\n\t}\n\n\treturn this;\n}\n\nexport function removePointerListener(obj, type, id) {\n\tvar handler = obj['_leaflet_' + type + id];\n\n\tif (type === 'touchstart') {\n\t\tobj.removeEventListener(POINTER_DOWN, handler, false);\n\n\t} else if (type === 'touchmove') {\n\t\tobj.removeEventListener(POINTER_MOVE, handler, false);\n\n\t} else if (type === 'touchend') {\n\t\tobj.removeEventListener(POINTER_UP, handler, false);\n\t\tobj.removeEventListener(POINTER_CANCEL, handler, false);\n\t}\n\n\treturn this;\n}\n\nfunction _addPointerStart(obj, handler, id) {\n\tvar onDown = Util.bind(function (e) {\n\t\tif (e.pointerType !== 'mouse' && e.pointerType !== e.MSPOINTER_TYPE_MOUSE && e.pointerType !== e.MSPOINTER_TYPE_MOUSE) {\n\t\t\t// In IE11, some touch events needs to fire for form controls, or\n\t\t\t// the controls will stop working. We keep a whitelist of tag names that\n\t\t\t// need these events. For other target tags, we prevent default on the event.\n\t\t\tif (TAG_WHITE_LIST.indexOf(e.target.tagName) < 0) {\n\t\t\t\tDomEvent.preventDefault(e);\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t_handlePointer(e, handler);\n\t});\n\n\tobj['_leaflet_touchstart' + id] = onDown;\n\tobj.addEventListener(POINTER_DOWN, onDown, false);\n\n\t// need to keep track of what pointers and how many are active to provide e.touches emulation\n\tif (!_pointerDocListener) {\n\t\t// we listen documentElement as any drags that end by moving the touch off the screen get fired there\n\t\tdocument.documentElement.addEventListener(POINTER_DOWN, _globalPointerDown, true);\n\t\tdocument.documentElement.addEventListener(POINTER_MOVE, _globalPointerMove, true);\n\t\tdocument.documentElement.addEventListener(POINTER_UP, _globalPointerUp, true);\n\t\tdocument.documentElement.addEventListener(POINTER_CANCEL, _globalPointerUp, true);\n\n\t\t_pointerDocListener = true;\n\t}\n}\n\nfunction _globalPointerDown(e) {\n\t_pointers[e.pointerId] = e;\n\t_pointersCount++;\n}\n\nfunction _globalPointerMove(e) {\n\tif (_pointers[e.pointerId]) {\n\t\t_pointers[e.pointerId] = e;\n\t}\n}\n\nfunction _globalPointerUp(e) {\n\tdelete _pointers[e.pointerId];\n\t_pointersCount--;\n}\n\nfunction _handlePointer(e, handler) {\n\te.touches = [];\n\tfor (var i in _pointers) {\n\t\te.touches.push(_pointers[i]);\n\t}\n\te.changedTouches = [e];\n\n\thandler(e);\n}\n\nfunction _addPointerMove(obj, handler, id) {\n\tvar onMove = function (e) {\n\t\t// don't fire touch moves when mouse isn't down\n\t\tif ((e.pointerType === e.MSPOINTER_TYPE_MOUSE || e.pointerType === 'mouse') && e.buttons === 0) { return; }\n\n\t\t_handlePointer(e, handler);\n\t};\n\n\tobj['_leaflet_touchmove' + id] = onMove;\n\tobj.addEventListener(POINTER_MOVE, onMove, false);\n}\n\nfunction _addPointerEnd(obj, handler, id) {\n\tvar onUp = function (e) {\n\t\t_handlePointer(e, handler);\n\t};\n\n\tobj['_leaflet_touchend' + id] = onUp;\n\tobj.addEventListener(POINTER_UP, onUp, false);\n\tobj.addEventListener(POINTER_CANCEL, onUp, false);\n}\n\n","import * as Browser from '../core/Browser';\r\nimport {_pointersCount} from './DomEvent.Pointer';\r\n\r\n/*\r\n * Extends the event handling code with double tap support for mobile browsers.\r\n */\r\n\r\nvar _touchstart = Browser.msPointer ? 'MSPointerDown' : Browser.pointer ? 'pointerdown' : 'touchstart',\r\n _touchend = Browser.msPointer ? 'MSPointerUp' : Browser.pointer ? 'pointerup' : 'touchend',\r\n _pre = '_leaflet_';\r\n\r\n// inspired by Zepto touch code by Thomas Fuchs\r\nexport function addDoubleTapListener(obj, handler, id) {\r\n\tvar last, touch,\r\n\t doubleTap = false,\r\n\t delay = 250;\r\n\r\n\tfunction onTouchStart(e) {\r\n\t\tvar count;\r\n\r\n\t\tif (Browser.pointer) {\r\n\t\t\tif ((!Browser.edge) || e.pointerType === 'mouse') { return; }\r\n\t\t\tcount = _pointersCount;\r\n\t\t} else {\r\n\t\t\tcount = e.touches.length;\r\n\t\t}\r\n\r\n\t\tif (count > 1) { return; }\r\n\r\n\t\tvar now = Date.now(),\r\n\t\t delta = now - (last || now);\r\n\r\n\t\ttouch = e.touches ? e.touches[0] : e;\r\n\t\tdoubleTap = (delta > 0 && delta <= delay);\r\n\t\tlast = now;\r\n\t}\r\n\r\n\tfunction onTouchEnd(e) {\r\n\t\tif (doubleTap && !touch.cancelBubble) {\r\n\t\t\tif (Browser.pointer) {\r\n\t\t\t\tif ((!Browser.edge) || e.pointerType === 'mouse') { return; }\r\n\t\t\t\t// work around .type being readonly with MSPointer* events\r\n\t\t\t\tvar newTouch = {},\r\n\t\t\t\t prop, i;\r\n\r\n\t\t\t\tfor (i in touch) {\r\n\t\t\t\t\tprop = touch[i];\r\n\t\t\t\t\tnewTouch[i] = prop && prop.bind ? prop.bind(touch) : prop;\r\n\t\t\t\t}\r\n\t\t\t\ttouch = newTouch;\r\n\t\t\t}\r\n\t\t\ttouch.type = 'dblclick';\r\n\t\t\thandler(touch);\r\n\t\t\tlast = null;\r\n\t\t}\r\n\t}\r\n\r\n\tobj[_pre + _touchstart + id] = onTouchStart;\r\n\tobj[_pre + _touchend + id] = onTouchEnd;\r\n\tobj[_pre + 'dblclick' + id] = handler;\r\n\r\n\tobj.addEventListener(_touchstart, onTouchStart, false);\r\n\tobj.addEventListener(_touchend, onTouchEnd, false);\r\n\r\n\t// On some platforms (notably, chrome<55 on win10 + touchscreen + mouse),\r\n\t// the browser doesn't fire touchend/pointerup events but does fire\r\n\t// native dblclicks. See #4127.\r\n\t// Edge 14 also fires native dblclicks, but only for pointerType mouse, see #5180.\r\n\tobj.addEventListener('dblclick', handler, false);\r\n\r\n\treturn this;\r\n}\r\n\r\nexport function removeDoubleTapListener(obj, id) {\r\n\tvar touchstart = obj[_pre + _touchstart + id],\r\n\t touchend = obj[_pre + _touchend + id],\r\n\t dblclick = obj[_pre + 'dblclick' + id];\r\n\r\n\tobj.removeEventListener(_touchstart, touchstart, false);\r\n\tobj.removeEventListener(_touchend, touchend, false);\r\n\tif (!Browser.edge) {\r\n\t\tobj.removeEventListener('dblclick', dblclick, false);\r\n\t}\r\n\r\n\treturn this;\r\n}\r\n","import {Point} from '../geometry/Point';\r\nimport * as Util from '../core/Util';\r\nimport * as Browser from '../core/Browser';\r\nimport {addPointerListener, removePointerListener} from './DomEvent.Pointer';\r\nimport {addDoubleTapListener, removeDoubleTapListener} from './DomEvent.DoubleTap';\r\n\r\n/*\r\n * @namespace DomEvent\r\n * Utility functions to work with the [DOM events](https://developer.mozilla.org/docs/Web/API/Event), used by Leaflet internally.\r\n */\r\n\r\n// Inspired by John Resig, Dean Edwards and YUI addEvent implementations.\r\n\r\n// @function on(el: HTMLElement, types: String, fn: Function, context?: Object): this\r\n// Adds a listener function (`fn`) to a particular DOM event type of the\r\n// element `el`. You can optionally specify the context of the listener\r\n// (object the `this` keyword will point to). You can also pass several\r\n// space-separated types (e.g. `'click dblclick'`).\r\n\r\n// @alternative\r\n// @function on(el: HTMLElement, eventMap: Object, context?: Object): this\r\n// Adds a set of type/listener pairs, e.g. `{click: onClick, mousemove: onMouseMove}`\r\nexport function on(obj, types, fn, context) {\r\n\r\n\tif (typeof types === 'object') {\r\n\t\tfor (var type in types) {\r\n\t\t\taddOne(obj, type, types[type], fn);\r\n\t\t}\r\n\t} else {\r\n\t\ttypes = Util.splitWords(types);\r\n\r\n\t\tfor (var i = 0, len = types.length; i < len; i++) {\r\n\t\t\taddOne(obj, types[i], fn, context);\r\n\t\t}\r\n\t}\r\n\r\n\treturn this;\r\n}\r\n\r\nvar eventsKey = '_leaflet_events';\r\n\r\n// @function off(el: HTMLElement, types: String, fn: Function, context?: Object): this\r\n// Removes a previously added listener function. If no function is specified,\r\n// it will remove all the listeners of that particular DOM event from the element.\r\n// Note that if you passed a custom context to on, you must pass the same\r\n// context to `off` in order to remove the listener.\r\n\r\n// @alternative\r\n// @function off(el: HTMLElement, eventMap: Object, context?: Object): this\r\n// Removes a set of type/listener pairs, e.g. `{click: onClick, mousemove: onMouseMove}`\r\n\r\n// @alternative\r\n// @function off(el: HTMLElement): this\r\n// Removes all known event listeners\r\nexport function off(obj, types, fn, context) {\r\n\r\n\tif (typeof types === 'object') {\r\n\t\tfor (var type in types) {\r\n\t\t\tremoveOne(obj, type, types[type], fn);\r\n\t\t}\r\n\t} else if (types) {\r\n\t\ttypes = Util.splitWords(types);\r\n\r\n\t\tfor (var i = 0, len = types.length; i < len; i++) {\r\n\t\t\tremoveOne(obj, types[i], fn, context);\r\n\t\t}\r\n\t} else {\r\n\t\tfor (var j in obj[eventsKey]) {\r\n\t\t\tremoveOne(obj, j, obj[eventsKey][j]);\r\n\t\t}\r\n\t\tdelete obj[eventsKey];\r\n\t}\r\n}\r\n\r\nfunction addOne(obj, type, fn, context) {\r\n\tvar id = type + Util.stamp(fn) + (context ? '_' + Util.stamp(context) : '');\r\n\r\n\tif (obj[eventsKey] && obj[eventsKey][id]) { return this; }\r\n\r\n\tvar handler = function (e) {\r\n\t\treturn fn.call(context || obj, e || window.event);\r\n\t};\r\n\r\n\tvar originalHandler = handler;\r\n\r\n\tif (Browser.pointer && type.indexOf('touch') === 0) {\r\n\t\t// Needs DomEvent.Pointer.js\r\n\t\taddPointerListener(obj, type, handler, id);\r\n\r\n\t} else if (Browser.touch && (type === 'dblclick') && addDoubleTapListener &&\r\n\t !(Browser.pointer && Browser.chrome)) {\r\n\t\t// Chrome >55 does not need the synthetic dblclicks from addDoubleTapListener\r\n\t\t// See #5180\r\n\t\taddDoubleTapListener(obj, handler, id);\r\n\r\n\t} else if ('addEventListener' in obj) {\r\n\r\n\t\tif (type === 'mousewheel') {\r\n\t\t\tobj.addEventListener('onwheel' in obj ? 'wheel' : 'mousewheel', handler, false);\r\n\r\n\t\t} else if ((type === 'mouseenter') || (type === 'mouseleave')) {\r\n\t\t\thandler = function (e) {\r\n\t\t\t\te = e || window.event;\r\n\t\t\t\tif (isExternalTarget(obj, e)) {\r\n\t\t\t\t\toriginalHandler(e);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\tobj.addEventListener(type === 'mouseenter' ? 'mouseover' : 'mouseout', handler, false);\r\n\r\n\t\t} else {\r\n\t\t\tif (type === 'click' && Browser.android) {\r\n\t\t\t\thandler = function (e) {\r\n\t\t\t\t\tfilterClick(e, originalHandler);\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t\tobj.addEventListener(type, handler, false);\r\n\t\t}\r\n\r\n\t} else if ('attachEvent' in obj) {\r\n\t\tobj.attachEvent('on' + type, handler);\r\n\t}\r\n\r\n\tobj[eventsKey] = obj[eventsKey] || {};\r\n\tobj[eventsKey][id] = handler;\r\n}\r\n\r\nfunction removeOne(obj, type, fn, context) {\r\n\r\n\tvar id = type + Util.stamp(fn) + (context ? '_' + Util.stamp(context) : ''),\r\n\t handler = obj[eventsKey] && obj[eventsKey][id];\r\n\r\n\tif (!handler) { return this; }\r\n\r\n\tif (Browser.pointer && type.indexOf('touch') === 0) {\r\n\t\tremovePointerListener(obj, type, id);\r\n\r\n\t} else if (Browser.touch && (type === 'dblclick') && removeDoubleTapListener) {\r\n\t\tremoveDoubleTapListener(obj, id);\r\n\r\n\t} else if ('removeEventListener' in obj) {\r\n\r\n\t\tif (type === 'mousewheel') {\r\n\t\t\tobj.removeEventListener('onwheel' in obj ? 'wheel' : 'mousewheel', handler, false);\r\n\r\n\t\t} else {\r\n\t\t\tobj.removeEventListener(\r\n\t\t\t\ttype === 'mouseenter' ? 'mouseover' :\r\n\t\t\t\ttype === 'mouseleave' ? 'mouseout' : type, handler, false);\r\n\t\t}\r\n\r\n\t} else if ('detachEvent' in obj) {\r\n\t\tobj.detachEvent('on' + type, handler);\r\n\t}\r\n\r\n\tobj[eventsKey][id] = null;\r\n}\r\n\r\n// @function stopPropagation(ev: DOMEvent): this\r\n// Stop the given event from propagation to parent elements. Used inside the listener functions:\r\n// ```js\r\n// L.DomEvent.on(div, 'click', function (ev) {\r\n// \tL.DomEvent.stopPropagation(ev);\r\n// });\r\n// ```\r\nexport function stopPropagation(e) {\r\n\r\n\tif (e.stopPropagation) {\r\n\t\te.stopPropagation();\r\n\t} else if (e.originalEvent) { // In case of Leaflet event.\r\n\t\te.originalEvent._stopped = true;\r\n\t} else {\r\n\t\te.cancelBubble = true;\r\n\t}\r\n\tskipped(e);\r\n\r\n\treturn this;\r\n}\r\n\r\n// @function disableScrollPropagation(el: HTMLElement): this\r\n// Adds `stopPropagation` to the element's `'mousewheel'` events (plus browser variants).\r\nexport function disableScrollPropagation(el) {\r\n\treturn addOne(el, 'mousewheel', stopPropagation);\r\n}\r\n\r\n// @function disableClickPropagation(el: HTMLElement): this\r\n// Adds `stopPropagation` to the element's `'click'`, `'doubleclick'`,\r\n// `'mousedown'` and `'touchstart'` events (plus browser variants).\r\nexport function disableClickPropagation(el) {\r\n\ton(el, 'mousedown touchstart dblclick', stopPropagation);\r\n\taddOne(el, 'click', fakeStop);\r\n\treturn this;\r\n}\r\n\r\n// @function preventDefault(ev: DOMEvent): this\r\n// Prevents the default action of the DOM Event `ev` from happening (such as\r\n// following a link in the href of the a element, or doing a POST request\r\n// with page reload when a `
    ` is submitted).\r\n// Use it inside listener functions.\r\nexport function preventDefault(e) {\r\n\tif (e.preventDefault) {\r\n\t\te.preventDefault();\r\n\t} else {\r\n\t\te.returnValue = false;\r\n\t}\r\n\treturn this;\r\n}\r\n\r\n// @function stop(ev): this\r\n// Does `stopPropagation` and `preventDefault` at the same time.\r\nexport function stop(e) {\r\n\tpreventDefault(e);\r\n\tstopPropagation(e);\r\n\treturn this;\r\n}\r\n\r\n// @function getMousePosition(ev: DOMEvent, container?: HTMLElement): Point\r\n// Gets normalized mouse position from a DOM event relative to the\r\n// `container` or to the whole page if not specified.\r\nexport function getMousePosition(e, container) {\r\n\tif (!container) {\r\n\t\treturn new Point(e.clientX, e.clientY);\r\n\t}\r\n\r\n\tvar rect = container.getBoundingClientRect();\r\n\r\n\treturn new Point(\r\n\t\te.clientX - rect.left - container.clientLeft,\r\n\t\te.clientY - rect.top - container.clientTop);\r\n}\r\n\r\n// Chrome on Win scrolls double the pixels as in other platforms (see #4538),\r\n// and Firefox scrolls device pixels, not CSS pixels\r\nvar wheelPxFactor =\r\n\t(Browser.win && Browser.chrome) ? 2 :\r\n\tBrowser.gecko ? window.devicePixelRatio : 1;\r\n\r\n// @function getWheelDelta(ev: DOMEvent): Number\r\n// Gets normalized wheel delta from a mousewheel DOM event, in vertical\r\n// pixels scrolled (negative if scrolling down).\r\n// Events from pointing devices without precise scrolling are mapped to\r\n// a best guess of 60 pixels.\r\nexport function getWheelDelta(e) {\r\n\treturn (Browser.edge) ? e.wheelDeltaY / 2 : // Don't trust window-geometry-based delta\r\n\t (e.deltaY && e.deltaMode === 0) ? -e.deltaY / wheelPxFactor : // Pixels\r\n\t (e.deltaY && e.deltaMode === 1) ? -e.deltaY * 20 : // Lines\r\n\t (e.deltaY && e.deltaMode === 2) ? -e.deltaY * 60 : // Pages\r\n\t (e.deltaX || e.deltaZ) ? 0 :\t// Skip horizontal/depth wheel events\r\n\t e.wheelDelta ? (e.wheelDeltaY || e.wheelDelta) / 2 : // Legacy IE pixels\r\n\t (e.detail && Math.abs(e.detail) < 32765) ? -e.detail * 20 : // Legacy Moz lines\r\n\t e.detail ? e.detail / -32765 * 60 : // Legacy Moz pages\r\n\t 0;\r\n}\r\n\r\nvar skipEvents = {};\r\n\r\nexport function fakeStop(e) {\r\n\t// fakes stopPropagation by setting a special event flag, checked/reset with skipped(e)\r\n\tskipEvents[e.type] = true;\r\n}\r\n\r\nexport function skipped(e) {\r\n\tvar events = skipEvents[e.type];\r\n\t// reset when checking, as it's only used in map container and propagates outside of the map\r\n\tskipEvents[e.type] = false;\r\n\treturn events;\r\n}\r\n\r\n// check if element really left/entered the event target (for mouseenter/mouseleave)\r\nexport function isExternalTarget(el, e) {\r\n\r\n\tvar related = e.relatedTarget;\r\n\r\n\tif (!related) { return true; }\r\n\r\n\ttry {\r\n\t\twhile (related && (related !== el)) {\r\n\t\t\trelated = related.parentNode;\r\n\t\t}\r\n\t} catch (err) {\r\n\t\treturn false;\r\n\t}\r\n\treturn (related !== el);\r\n}\r\n\r\nvar lastClick;\r\n\r\n// this is a horrible workaround for a bug in Android where a single touch triggers two click events\r\nfunction filterClick(e, handler) {\r\n\tvar timeStamp = (e.timeStamp || (e.originalEvent && e.originalEvent.timeStamp)),\r\n\t elapsed = lastClick && (timeStamp - lastClick);\r\n\r\n\t// are they closer together than 500ms yet more than 100ms?\r\n\t// Android typically triggers them ~300ms apart while multiple listeners\r\n\t// on the same event should be triggered far faster;\r\n\t// or check if click is simulated on the element, and if it is, reject any non-simulated events\r\n\r\n\tif ((elapsed && elapsed > 100 && elapsed < 500) || (e.target._simulatedClick && !e._simulated)) {\r\n\t\tstop(e);\r\n\t\treturn;\r\n\t}\r\n\tlastClick = timeStamp;\r\n\r\n\thandler(e);\r\n}\r\n\r\n// @function addListener(…): this\r\n// Alias to [`L.DomEvent.on`](#domevent-on)\r\nexport {on as addListener};\r\n\r\n// @function removeListener(…): this\r\n// Alias to [`L.DomEvent.off`](#domevent-off)\r\nexport {off as removeListener};\r\n","import * as DomEvent from './DomEvent';\nimport * as Util from '../core/Util';\nimport {Point} from '../geometry/Point';\nimport * as Browser from '../core/Browser';\n\n/*\n * @namespace DomUtil\n *\n * Utility functions to work with the [DOM](https://developer.mozilla.org/docs/Web/API/Document_Object_Model)\n * tree, used by Leaflet internally.\n *\n * Most functions expecting or returning a `HTMLElement` also work for\n * SVG elements. The only difference is that classes refer to CSS classes\n * in HTML and SVG classes in SVG.\n */\n\n if (!Element.prototype.matches) {\n var ep = Element.prototype;\n \n if (ep.webkitMatchesSelector) // Chrome <34, SF<7.1, iOS<8\n ep.matches = ep.webkitMatchesSelector;\n \n if (ep.msMatchesSelector) // IE9/10/11 & Edge\n ep.matches = ep.msMatchesSelector;\n \n if (ep.mozMatchesSelector) // FF<34\n ep.matches = ep.mozMatchesSelector;\n }\n\n// @property TRANSFORM: String\n// Vendor-prefixed fransform style name (e.g. `'webkitTransform'` for WebKit).\nexport var TRANSFORM = testProp(\n ['transform', 'WebkitTransform', 'OTransform', 'MozTransform', 'msTransform']);\n\n// webkitTransition comes first because some browser versions that drop vendor prefix don't do\n// the same for the transitionend event, in particular the Android 4.1 stock browser\n\n// @property TRANSITION: String\n// Vendor-prefixed transform style name.\nexport var TRANSITION = testProp(\n ['webkitTransition', 'transition', 'OTransition', 'MozTransition', 'msTransition']);\n\nexport var TRANSITION_END =\n TRANSITION === 'webkitTransition' || TRANSITION === 'OTransition' ? TRANSITION + 'End' : 'transitionend';\n\n\n// @function get(id: String|HTMLElement): HTMLElement\n// Returns an element given its DOM id, or returns the element itself\n// if it was passed directly.\nexport function get(id) {\n return typeof id === 'string' ? document.getElementById(id) : id;\n}\n\n// @function getStyle(el: HTMLElement, styleAttrib: String): String\n// Returns the value for a certain style attribute on an element,\n// including computed values or values set through CSS.\nexport function getStyle(el, style) {\n var value = el.style[style] || (el.currentStyle && el.currentStyle[style]);\n\n if ((!value || value === 'auto') && document.defaultView) {\n var css = document.defaultView.getComputedStyle(el, null);\n value = css ? css[style] : null;\n }\n return value === 'auto' ? null : value;\n}\n\n// @function create(tagName: String, className?: String, container?: HTMLElement): HTMLElement\n// Creates an HTML element with `tagName`, sets its class to `className`, and optionally appends it to `container` element.\nexport function create(tagName, className, container) {\n var el = document.createElement(tagName);\n el.className = className || '';\n\n if (container) {\n container.appendChild(el);\n }\n return el;\n}\n\n// @function remove(el: HTMLElement)\n// Removes `el` from its parent element\nexport function remove(el) {\n var parent = el.parentNode;\n if (parent) {\n parent.removeChild(el);\n }\n}\n\n// @function empty(el: HTMLElement)\n// Removes all of `el`'s children elements from `el`\nexport function empty(el) {\n while (el.firstChild) {\n el.removeChild(el.firstChild);\n }\n}\n\n// @function toFront(el: HTMLElement)\n// Makes `el` the last child of its parent, so it renders in front of the other children.\nexport function toFront(el) {\n el.parentNode.appendChild(el);\n}\n\n// @function toBack(el: HTMLElement)\n// Makes `el` the first child of its parent, so it renders behind the other children.\nexport function toBack(el) {\n var parent = el.parentNode;\n parent.insertBefore(el, parent.firstChild);\n}\n\n// @function hasClass(el: HTMLElement, name: String): Boolean\n// Returns `true` if the element's class attribute contains `name`.\nexport function hasClass(el, name) {\n if (el.classList !== undefined) {\n return el.classList.contains(name);\n }\n var className = getClass(el);\n return className.length > 0 && new RegExp('(^|\\\\s)' + name + '(\\\\s|$)').test(className);\n}\n\n// @function addClass(el: HTMLElement, name: String)\n// Adds `name` to the element's class attribute.\nexport function addClass(el, name) {\n if (el.classList !== undefined) {\n var classes = Util.splitWords(name);\n for (var i = 0, len = classes.length; i < len; i++) {\n el.classList.add(classes[i]);\n }\n } else if (!hasClass(el, name)) {\n var className = getClass(el);\n setClass(el, (className ? className + ' ' : '') + name);\n }\n}\n\n// @function removeClass(el: HTMLElement, name: String)\n// Removes `name` from the element's class attribute.\nexport function removeClass(el, name) {\n if (el.classList !== undefined) {\n el.classList.remove(name);\n } else {\n setClass(el, Util.trim((' ' + getClass(el) + ' ').replace(' ' + name + ' ', ' ')));\n }\n}\n\n// @function setClass(el: HTMLElement, name: String)\n// Sets the element's class.\nexport function setClass(el, name) {\n if (el.className.baseVal === undefined) {\n el.className = name;\n } else {\n // in case of SVG element\n el.className.baseVal = name;\n }\n}\n\n// @function getClass(el: HTMLElement): String\n// Returns the element's class.\nexport function getClass(el) {\n return el.className.baseVal === undefined ? el.className : el.className.baseVal;\n}\n\n// @function setOpacity(el: HTMLElement, opacity: Number)\n// Set the opacity of an element (including old IE support).\n// `opacity` must be a number from `0` to `1`.\nexport function setOpacity(el, value) {\n if ('opacity' in el.style) {\n el.style.opacity = value;\n } else if ('filter' in el.style) {\n _setOpacityIE(el, value);\n }\n}\n\nfunction _setOpacityIE(el, value) {\n var filter = false,\n filterName = 'DXImageTransform.Microsoft.Alpha';\n\n // filters collection throws an error if we try to retrieve a filter that doesn't exist\n try {\n filter = el.filters.item(filterName);\n } catch (e) {\n // don't set opacity to 1 if we haven't already set an opacity,\n // it isn't needed and breaks transparent pngs.\n if (value === 1) { return; }\n }\n\n value = Math.round(value * 100);\n\n if (filter) {\n filter.Enabled = (value !== 100);\n filter.Opacity = value;\n } else {\n el.style.filter += ' progid:' + filterName + '(opacity=' + value + ')';\n }\n}\n\n// @function testProp(props: String[]): String|false\n// Goes through the array of style names and returns the first name\n// that is a valid style name for an element. If no such name is found,\n// it returns false. Useful for vendor-prefixed styles like `transform`.\nexport function testProp(props) {\n var style = document.documentElement.style;\n\n for (var i = 0; i < props.length; i++) {\n if (props[i] in style) {\n return props[i];\n }\n }\n return false;\n}\n\nexport function isPropertySupported(prop) {\n var style = document.documentElement.style;\n return prop in style;\n}\n\n// @function setTransform(el: HTMLElement, offset: Point, scale?: Number)\n// Resets the 3D CSS transform of `el` so it is translated by `offset` pixels\n// and optionally scaled by `scale`. Does not have an effect if the\n// browser doesn't support 3D CSS transforms.\nexport function setTransform(el, offset, scale) {\n var pos = offset || new Point(0, 0);\n\n el.style[TRANSFORM] =\n (Browser.ie3d ?\n 'translate(' + pos.x + 'px,' + pos.y + 'px)' :\n 'translate3d(' + pos.x + 'px,' + pos.y + 'px,0)') +\n (scale ? ' scale(' + scale + ')' : '');\n}\n\n// @function setPosition(el: HTMLElement, position: Point)\n// Sets the position of `el` to coordinates specified by `position`,\n// using CSS translate or top/left positioning depending on the browser\n// (used by Leaflet internally to position its layers).\nexport function setPosition(el, point) {\n\n /*eslint-disable */\n el._leaflet_pos = point;\n /*eslint-enable */\n\n if (Browser.any3d) {\n setTransform(el, point);\n } else {\n el.style.left = point.x + 'px';\n el.style.top = point.y + 'px';\n }\n}\n\n// @function getPosition(el: HTMLElement): Point\n// Returns the coordinates of an element previously positioned with setPosition.\nexport function getPosition(el) {\n // this method is only used for elements previously positioned using setPosition,\n // so it's safe to cache the position for performance\n\n return el._leaflet_pos || new Point(0, 0);\n}\n\n// @function disableTextSelection()\n// Prevents the user from generating `selectstart` DOM events, usually generated\n// when the user drags the mouse through a page with text. Used internally\n// by Leaflet to override the behaviour of any click-and-drag interaction on\n// the map. Affects drag interactions on the whole document.\n\n// @function enableTextSelection()\n// Cancels the effects of a previous [`L.DomUtil.disableTextSelection`](#domutil-disabletextselection).\nexport var disableTextSelection;\nexport var enableTextSelection;\nvar _userSelect;\nif ('onselectstart' in document) {\n disableTextSelection = function () {\n DomEvent.on(window, 'selectstart', DomEvent.preventDefault);\n };\n enableTextSelection = function () {\n DomEvent.off(window, 'selectstart', DomEvent.preventDefault);\n };\n} else {\n var userSelectProperty = testProp(\n ['userSelect', 'WebkitUserSelect', 'OUserSelect', 'MozUserSelect', 'msUserSelect']);\n\n disableTextSelection = function () {\n if (userSelectProperty) {\n var style = document.documentElement.style;\n _userSelect = style[userSelectProperty];\n style[userSelectProperty] = 'none';\n }\n };\n enableTextSelection = function () {\n if (userSelectProperty) {\n document.documentElement.style[userSelectProperty] = _userSelect;\n _userSelect = undefined;\n }\n };\n}\n\n// @function disableImageDrag()\n// As [`L.DomUtil.disableTextSelection`](#domutil-disabletextselection), but\n// for `dragstart` DOM events, usually generated when the user drags an image.\nexport function disableImageDrag() {\n DomEvent.on(window, 'dragstart', DomEvent.preventDefault);\n}\n\n// @function enableImageDrag()\n// Cancels the effects of a previous [`L.DomUtil.disableImageDrag`](#domutil-disabletextselection).\nexport function enableImageDrag() {\n DomEvent.off(window, 'dragstart', DomEvent.preventDefault);\n}\n\nvar _outlineElement, _outlineStyle;\n// @function preventOutline(el: HTMLElement)\n// Makes the [outline](https://developer.mozilla.org/docs/Web/CSS/outline)\n// of the element `el` invisible. Used internally by Leaflet to prevent\n// focusable elements from displaying an outline when the user performs a\n// drag interaction on them.\nexport function preventOutline(element) {\n while (element.tabIndex === -1) {\n element = element.parentNode;\n }\n if (!element || !element.style) { return; }\n restoreOutline();\n _outlineElement = element;\n _outlineStyle = element.style.outline;\n element.style.outline = 'none';\n DomEvent.on(window, 'keydown', restoreOutline);\n}\n\n// @function restoreOutline()\n// Cancels the effects of a previous [`L.DomUtil.preventOutline`]().\nexport function restoreOutline() {\n if (!_outlineElement) { return; }\n _outlineElement.style.outline = _outlineStyle;\n _outlineElement = undefined;\n _outlineStyle = undefined;\n DomEvent.off(window, 'keydown', restoreOutline);\n}\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var baseGetTag = require('./_baseGetTag'),\n isObject = require('./isObject');\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nmodule.exports = isFunction;\n","var root = require('./_root');\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nmodule.exports = coreJsData;\n","var coreJsData = require('./_coreJsData');\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nmodule.exports = isMasked;\n","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nmodule.exports = toSource;\n","var isFunction = require('./isFunction'),\n isMasked = require('./_isMasked'),\n isObject = require('./isObject'),\n toSource = require('./_toSource');\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nmodule.exports = baseIsNative;\n","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nmodule.exports = getValue;\n","var baseIsNative = require('./_baseIsNative'),\n getValue = require('./_getValue');\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nmodule.exports = getNative;\n","var getNative = require('./_getNative');\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nmodule.exports = defineProperty;\n","var defineProperty = require('./_defineProperty');\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nmodule.exports = baseAssignValue;\n","/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nmodule.exports = eq;\n","var baseAssignValue = require('./_baseAssignValue'),\n eq = require('./eq');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nmodule.exports = assignValue;\n","var assignValue = require('./_assignValue'),\n baseAssignValue = require('./_baseAssignValue');\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\nmodule.exports = copyObject;\n","/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nmodule.exports = identity;\n","/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\nmodule.exports = apply;\n","var apply = require('./_apply');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\nmodule.exports = overRest;\n","/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\nmodule.exports = constant;\n","var constant = require('./constant'),\n defineProperty = require('./_defineProperty'),\n identity = require('./identity');\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\nmodule.exports = baseSetToString;\n","/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeNow = Date.now;\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\nmodule.exports = shortOut;\n","var baseSetToString = require('./_baseSetToString'),\n shortOut = require('./_shortOut');\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\nmodule.exports = setToString;\n","var identity = require('./identity'),\n overRest = require('./_overRest'),\n setToString = require('./_setToString');\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\nmodule.exports = baseRest;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nmodule.exports = isLength;\n","var isFunction = require('./isFunction'),\n isLength = require('./isLength');\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nmodule.exports = isArrayLike;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nmodule.exports = isIndex;\n","var eq = require('./eq'),\n isArrayLike = require('./isArrayLike'),\n isIndex = require('./_isIndex'),\n isObject = require('./isObject');\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\nmodule.exports = isIterateeCall;\n","var baseRest = require('./_baseRest'),\n isIterateeCall = require('./_isIterateeCall');\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\nmodule.exports = createAssigner;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nmodule.exports = isPrototype;\n","/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nmodule.exports = baseTimes;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;\n","var baseIsArguments = require('./_baseIsArguments'),\n isObjectLike = require('./isObjectLike');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nmodule.exports = isArguments;\n","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, 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;\n\nmodule.exports = isArray;\n","/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = stubFalse;\n","var root = require('./_root'),\n stubFalse = require('./stubFalse');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nmodule.exports = isBuffer;\n","var baseGetTag = require('./_baseGetTag'),\n isLength = require('./isLength'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nmodule.exports = baseIsTypedArray;\n","/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nmodule.exports = baseUnary;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nmodule.exports = nodeUtil;\n","var baseIsTypedArray = require('./_baseIsTypedArray'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nmodule.exports = isTypedArray;\n","var baseTimes = require('./_baseTimes'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isIndex = require('./_isIndex'),\n isTypedArray = require('./isTypedArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = arrayLikeKeys;\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nmodule.exports = overArg;\n","var overArg = require('./_overArg');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nmodule.exports = nativeKeys;\n","var isPrototype = require('./_isPrototype'),\n nativeKeys = require('./_nativeKeys');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeys;\n","var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeys = require('./_baseKeys'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nmodule.exports = keys;\n","var assignValue = require('./_assignValue'),\n copyObject = require('./_copyObject'),\n createAssigner = require('./_createAssigner'),\n isArrayLike = require('./isArrayLike'),\n isPrototype = require('./_isPrototype'),\n keys = require('./keys');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns own enumerable string keyed properties of source objects to the\n * destination object. Source objects are applied from left to right.\n * Subsequent sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object` and is loosely based on\n * [`Object.assign`](https://mdn.io/Object/assign).\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assignIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assign({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'c': 3 }\n */\nvar assign = createAssigner(function(object, source) {\n if (isPrototype(source) || isArrayLike(source)) {\n copyObject(source, keys(source), object);\n return;\n }\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n assignValue(object, key, source[key]);\n }\n }\n});\n\nmodule.exports = assign;\n","var document = typeof window !== 'undefined' && typeof window.document !== 'undefined' ? window.document : {};\nvar keyboardAllowed = typeof Element !== 'undefined' && 'ALLOW_KEYBOARD_INPUT' in Element;\n\nvar fn = (function () {\n var val;\n\n var fnMap = [\n [\n 'requestFullscreen',\n 'exitFullscreen',\n 'fullscreenElement',\n 'fullscreenEnabled',\n 'fullscreenchange',\n 'fullscreenerror'\n ],\n // New WebKit\n [\n 'webkitRequestFullscreen',\n 'webkitExitFullscreen',\n 'webkitFullscreenElement',\n 'webkitFullscreenEnabled',\n 'webkitfullscreenchange',\n 'webkitfullscreenerror'\n\n ],\n // Old WebKit (Safari 5.1)\n [\n 'webkitRequestFullScreen',\n 'webkitCancelFullScreen',\n 'webkitCurrentFullScreenElement',\n 'webkitCancelFullScreen',\n 'webkitfullscreenchange',\n 'webkitfullscreenerror'\n\n ],\n [\n 'mozRequestFullScreen',\n 'mozCancelFullScreen',\n 'mozFullScreenElement',\n 'mozFullScreenEnabled',\n 'mozfullscreenchange',\n 'mozfullscreenerror'\n ],\n [\n 'msRequestFullscreen',\n 'msExitFullscreen',\n 'msFullscreenElement',\n 'msFullscreenEnabled',\n 'MSFullscreenChange',\n 'MSFullscreenError'\n ]\n ];\n\n var i = 0;\n var l = fnMap.length;\n var ret = {};\n\n for (; i < l; i++) {\n val = fnMap[i];\n if (val && val[1] in document) {\n for (i = 0; i < val.length; i++) {\n ret[fnMap[0][i]] = val[i];\n }\n return ret;\n }\n }\n\n return false;\n})();\n\nvar eventNameMap = {\n change: fn.fullscreenchange,\n error: fn.fullscreenerror\n};\n\nvar screenfull = {\n request: function (elem) {\n var request = fn.requestFullscreen;\n\n elem = elem || document.documentElement;\n\n // Work around Safari 5.1 bug: reports support for\n // keyboard in fullscreen even though it doesn't.\n // Browser sniffing, since the alternative with\n // setTimeout is even worse.\n if (/5\\.1[.\\d]* Safari/.test(navigator.userAgent)) {\n elem[request]();\n } else {\n elem[request](keyboardAllowed && Element.ALLOW_KEYBOARD_INPUT);\n }\n },\n exit: function () {\n document[fn.exitFullscreen]();\n },\n toggle: function (elem) {\n if (this.isFullscreen) {\n this.exit();\n } else {\n this.request(elem);\n }\n },\n onchange: function (callback) {\n this.on('change', callback);\n },\n onerror: function (callback) {\n this.on('error', callback);\n },\n on: function (event, callback) {\n var eventName = eventNameMap[event];\n if (eventName) {\n document.addEventListener(eventName, callback, false);\n }\n },\n off: function (event, callback) {\n var eventName = eventNameMap[event];\n if (eventName) {\n document.removeEventListener(eventName, callback, false);\n }\n },\n raw: fn\n};\n\nObject.defineProperties(screenfull, {\n isFullscreen: {\n get: function () {\n return Boolean(document[fn.fullscreenElement]);\n }\n },\n element: {\n enumerable: true,\n get: function () {\n return document[fn.fullscreenElement];\n }\n },\n enabled: {\n enumerable: true,\n get: function () {\n // Coerce to boolean in case of old WebKit\n return Boolean(document[fn.fullscreenEnabled]);\n }\n }\n});\n\nexport {screenfull};","import * as Util from '../core/Util';\nimport {Evented} from '../core/Events';\n// import {Class} from '../core/Class';\nimport * as Browser from '../core/Browser';\nimport * as DomEvent from '../dom/DomEvent';\nimport * as DomUtil from '../dom/DomUtil';\n\nimport debounce from 'lodash/debounce';\nimport assign from 'lodash/assign';\n\nimport {screenfull} from '../screenfull';\n\n/*\n * @class Reader\n * @aka cozy.Map\n * @inherits Evented\n *\n * The central class of the API — it is used to create a book on a page and manipulate it.\n *\n * @example\n *\n * ```js\n * // initialize the map on the \"map\" div with a given center and zoom\n * var map = L.map('map', {\n * center: [51.505, -0.09],\n * zoom: 13\n * });\n * ```\n *\n */\n\nvar _padding = 1.0;\nexport var Reader = Evented.extend({\n options: {\n regions: [\n 'header',\n 'toolbar.top',\n 'toolbar.left',\n 'main',\n 'toolbar.right',\n 'toolbar.bottom',\n 'footer'\n ],\n metadata: {},\n flow: 'auto',\n engine: 'epubjs',\n fontSizeLarge: '140%',\n fontSizeSmall: '90%',\n fontSizeDefault: '100%',\n trackResize: true,\n text_size: 100,\n mobileMediaQuery: '(min-device-width : 300px) and (max-device-width : 600px)',\n theme: 'default',\n themes: []\n },\n\n initialize: function(id, options) {\n var self = this\n\n if ( localStorage.getItem('cozy.options') ) {\n options = assign(options, JSON.parse(localStorage.getItem('cozy.options')));\n }\n options = Util.setOptions(this, options);\n\n this._checkFeatureCompatibility();\n\n this.metadata = this.options.metadata; // initial seed\n\n this._initContainer(id);\n this._initLayout();\n\n if ( this.options.themes && this.options.themes.length > 0 ) {\n this.options.themes.forEach(function(theme) {\n if ( theme.href ) { return; }\n var klass = theme.klass;\n var rules = {};\n for(var rule in theme.rules) {\n var new_rule = '.' + klass;\n if ( rule == 'body' ) { new_rule = 'body' + new_rule; }\n else { new_rule += ' ' + rule ; }\n rules[new_rule] = theme.rules[rule];\n }\n theme.rules = rules;\n });\n }\n\n this._updateTheme();\n\n // hack for https://github.com/Leaflet/Leaflet/issues/1980\n // this._onResize = Util.bind(this._onResize, this);\n\n this._initEvents();\n\n this.callInitHooks();\n\n this._mode = this.options.mode;\n },\n\n start: function(target, cb) {\n var self = this;\n\n if ( typeof(target) == 'function' && cb === undefined ) {\n cb = target;\n target = undefined;\n }\n\n Util.loader.js(this.options.engine_href).then(function() {\n self._start(target, cb);\n self._loaded = true;\n })\n },\n\n _start: function(target, cb) {\n var self = this;\n target = target || 0;\n\n self.open(function() {\n self.draw(target, cb);\n });\n },\n\n switch: function(flow, target) {\n var target = target || this.currentLocation();\n if ( flow === undefined ) {\n flow = ( this.options.flow == 'auto' ) ? 'scrolled-doc' : 'auto';\n }\n this.options.flow = flow;\n this.destroy();\n this.draw(target);\n },\n\n reopen: function(options, target) {\n var target = target || this.currentLocation();\n Util.extend(this.options, options);\n this.destroy();\n console.log(\"AHOY REOPENED?\");\n return;\n this.draw(target);\n this.fire('reopen');\n },\n\n saveOptions: function(options) {\n localStorage.setItem('cozy.options', JSON.stringify(options));\n },\n\n _updateTheme: function() {\n DomUtil.removeClass(this._container, 'cozy-theme-' + ( this._container.dataset.theme || 'default' ));\n DomUtil.addClass(this._container, 'cozy-theme-' + this.options.theme);\n this._container.dataset.theme = this.options.theme;\n },\n\n draw: function(target) {\n // NOOP\n },\n\n next: function() {\n // NOOP\n },\n\n prev: function() {\n // NOOP\n },\n\n display: function(index) {\n // NOOP\n },\n\n gotoPage: function(target) {\n // NOOP\n },\n\n goBack: function() {\n history.back();\n },\n\n goForward: function() {\n history.forward();\n },\n\n requestFullscreen: function() {\n if ( screenfull.enabled ) {\n // this._preResize();\n screenfull.toggle(this._container);\n }\n },\n\n _preResize: function() {\n\n },\n\n _initContainer: function (id) {\n var container = this._container = DomUtil.get(id);\n\n if (!container) {\n throw new Error('Reader container not found.');\n } else if (container._cozy_id) {\n throw new Error('Reader container is already initialized.');\n }\n\n DomEvent.on(container, 'scroll', this._onScroll, this);\n this._containerId = Util.stamp(container);\n },\n\n _initLayout: function () {\n var container = this._container;\n\n this._fadeAnimated = this.options.fadeAnimation && Browser.any3d;\n\n DomUtil.addClass(container, 'cozy-container' +\n (Browser.touch ? ' cozy-touch' : '') +\n (Browser.retina ? ' cozy-retina' : '') +\n (Browser.ielt9 ? ' cozy-oldie' : '') +\n (Browser.safari ? ' cozy-safari' : '') +\n (this._fadeAnimated ? ' cozy-fade-anim' : '') +\n ' cozy-engine-' + this.options.engine + \n ' cozy-theme-' + this.options.theme);\n\n var position = DomUtil.getStyle(container, 'position');\n\n this._initPanes();\n\n if ( ! Browser.columnCount ) {\n this.options.flow = 'scrolled-doc';\n }\n },\n\n _initPanes: function () {\n var self = this;\n\n var panes = this._panes = {};\n\n var l = 'cozy-';\n var container = this._container;\n\n var prefix = 'cozy-module-';\n\n DomUtil.addClass(container, 'cozy-container');\n panes['top'] = DomUtil.create('div', prefix + 'top', container);\n panes['main'] = DomUtil.create('div', prefix + 'main', container);\n panes['bottom'] = DomUtil.create('div', prefix + 'bottom', container);\n\n panes['left'] = DomUtil.create('div', prefix + 'left', panes['main']);\n panes['book-cover'] = DomUtil.create('div', prefix + 'book-cover', panes['main']);\n panes['right'] = DomUtil.create('div', prefix + 'right', panes['main']);\n panes['book'] = DomUtil.create('div', prefix + 'book', panes['book-cover']);\n panes['loader'] = DomUtil.create('div', prefix + 'book-loading', panes['book']);\n this._initLoader();\n },\n\n _checkIfLoaded: function () {\n if (!this._loaded) {\n throw new Error('Set map center and zoom first.');\n }\n },\n\n // DOM event handling\n\n // @section Interaction events\n _initEvents: function (remove) {\n this._targets = {};\n this._targets[Util.stamp(this._container)] = this;\n\n var onOff = remove ? DomEvent.off : DomEvent.on;\n\n // @event click: MouseEvent\n // Fired when the user clicks (or taps) the map.\n // @event dblclick: MouseEvent\n // Fired when the user double-clicks (or double-taps) the map.\n // @event mousedown: MouseEvent\n // Fired when the user pushes the mouse button on the map.\n // @event mouseup: MouseEvent\n // Fired when the user releases the mouse button on the map.\n // @event mouseover: MouseEvent\n // Fired when the mouse enters the map.\n // @event mouseout: MouseEvent\n // Fired when the mouse leaves the map.\n // @event mousemove: MouseEvent\n // Fired while the mouse moves over the map.\n // @event contextmenu: MouseEvent\n // Fired when the user pushes the right mouse button on the map, prevents\n // default browser context menu from showing if there are listeners on\n // this event. Also fired on mobile when the user holds a single touch\n // for a second (also called long press).\n // @event keypress: KeyboardEvent\n // Fired when the user presses a key from the keyboard while the map is focused.\n // onOff(this._container, 'click dblclick mousedown mouseup ' +\n // 'mouseover mouseout mousemove contextmenu keypress', this._handleDOMEvent, this);\n\n // if (this.options.trackResize) {\n // var self = this;\n // var fn = debounce(function(){ self.invalidateSize({}); }, 150);\n // onOff(window, 'resize', fn, this);\n // }\n\n if (Browser.any3d && this.options.transform3DLimit) {\n (remove ? this.off : this.on).call(this, 'moveend', this._onMoveEnd);\n }\n\n var self = this;\n if (screenfull.enabled) {\n screenfull.on('change', function() {\n // setTimeout(function() {\n // self.invalidateSize({});\n // }, 100);\n console.log('AHOY: Am I fullscreen?', screenfull.isFullscreen ? 'YES' : 'NO');\n });\n }\n\n self.on(\"updateLocation\", function(location) {\n var location_href = location.start;\n\n if ( self._ignoreHistory ) {\n self._ignoreHistory = false;\n } else {\n var tmp_href = window.location.href.split(\"#\");\n tmp_href[1] = location_href.substr(8, location_href.length - 8 - 1);\n history.pushState({ cfi: location_href }, '', tmp_href.join('#'));\n }\n\n // window.location.hash = '#' + location_href.substr(8, location_href.length - 8 - 1);\n })\n\n window.addEventListener('popstate', function(event) {\n if ( event.isTrusted && event.state !== null ) {\n self._ignoreHistory = true;\n self.gotoPage(event.state.cfi);\n }\n })\n\n document.addEventListener('keydown', function(event) {\n var keyName = event.key;\n var target = event.target;\n var IGNORE_TARGETS = [ 'input', 'target' ];\n if ( IGNORE_TARGETS.indexOf(target.localName) >= 0 ) {\n return;\n }\n\n self.fire('keyDown', { keyName: keyName });\n });\n\n self.on('keyDown', function(keyName) {\n switch(keyName.keyName) {\n case 'ArrowRight':\n case 'PageDown':\n self.next();\n break;\n case 'ArrowLeft':\n case 'PageUp':\n self.prev();\n break;\n case 'Home':\n self._scroll('HOME');\n break;\n case 'End':\n self._scroll('END')\n break;\n }\n });\n },\n\n // _onResize: function() {\n // if ( ! this._resizeRequest ) {\n // this._resizeRequest = Util.requestAnimFrame(function() {\n // this.invalidateSize({})\n // }, this);\n // }\n // },\n\n _onScroll: function () {\n this._container.scrollTop = 0;\n this._container.scrollLeft = 0;\n },\n\n _handleDOMEvent: function (e) {\n if (!this._loaded || DomEvent.skipped(e)) { return; }\n\n var type = e.type === 'keypress' && e.keyCode === 13 ? 'click' : e.type;\n\n if (type === 'mousedown') {\n // prevents outline when clicking on keyboard-focusable element\n DomUtil.preventOutline(e.target || e.srcElement);\n }\n\n this._fireDOMEvent(e, type);\n },\n\n _fireDOMEvent: function (e, type, targets) {\n\n if (e.type === 'click') {\n // Fire a synthetic 'preclick' event which propagates up (mainly for closing popups).\n // @event preclick: MouseEvent\n // Fired before mouse click on the map (sometimes useful when you\n // want something to happen on click before any existing click\n // handlers start running).\n var synth = Util.extend({}, e);\n synth.type = 'preclick';\n this._fireDOMEvent(synth, synth.type, targets);\n }\n\n if (e._stopped) { return; }\n\n // Find the layer the event is propagating from and its parents.\n targets = (targets || []).concat(this._findEventTargets(e, type));\n\n if (!targets.length) { return; }\n\n var target = targets[0];\n if (type === 'contextmenu' && target.listens(type, true)) {\n DomEvent.preventDefault(e);\n }\n\n var data = {\n originalEvent: e\n };\n\n if (e.type !== 'keypress') {\n var isMarker = (target.options && 'icon' in target.options);\n data.containerPoint = isMarker ?\n this.latLngToContainerPoint(target.getLatLng()) : this.mouseEventToContainerPoint(e);\n data.layerPoint = this.containerPointToLayerPoint(data.containerPoint);\n data.latlng = isMarker ? target.getLatLng() : this.layerPointToLatLng(data.layerPoint);\n }\n\n for (var i = 0; i < targets.length; i++) {\n targets[i].fire(type, data, true);\n if (data.originalEvent._stopped ||\n (targets[i].options.nonBubblingEvents && Util.indexOf(targets[i].options.nonBubblingEvents, type) !== -1)) { return; }\n }\n },\n\n getFixedBookPanelSize: function() {\n // have to make the book \n var style = window.getComputedStyle(this._panes['book']);\n var h = this._panes['book'].clientHeight - parseFloat(style.paddingTop) - parseFloat(style.paddingBottom);\n var w = this._panes['book'].clientWidth - parseFloat(style.paddingRight) - parseFloat(style.paddingLeft);\n return { height: Math.floor(h * 1.00), width: Math.floor(w * 1.00) };\n },\n\n invalidateSize: function(options) {\n // TODO: IS THIS EVER USED?\n var self = this;\n\n if ( ! self._drawn ) { return; }\n\n Util.cancelAnimFrame(this._resizeRequest);\n\n if (! this._loaded) { return this; }\n\n this.fire('resized');\n },\n\n _resizeBookPane: function() {\n\n },\n\n _setupHooks: function() {\n\n },\n\n _checkFeatureCompatibility: function() {\n if ( ! DomUtil.isPropertySupported('columnCount') || this._checkMobileDevice() ) {\n // force\n this.options.flow = 'scrolled-doc';\n }\n if ( this._checkMobileDevice() ) {\n // this.options.fontSizeLarge = '160%';\n // this.options.fontSizeSmall ='100%';\n // this.options.fontSizeDefault = '120%';\n this.options.text_size = 120;\n }\n },\n\n _checkMobileDevice: function() {\n if ( this._isMobile === undefined ) {\n this._isMobile = false;\n if ( this.options.mobileMediaQuery ) {\n this._isMobile = window.matchMedia(this.options.mobileMediaQuery).matches;\n }\n }\n return this._isMobile;\n },\n\n _initLoader: function() {\n // is this not awesome?\n var template = `
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    `;\n\n var body = new DOMParser().parseFromString(template, \"text/html\").body;\n while ( body.children.length ) {\n this._panes['loader'].appendChild(body.children[0]);\n }\n },\n\n EOT: true\n});\n\nexport function createReader(id, options) {\n return new Reader(id, options);\n}\n","import {Class} from '../core/Class';\nimport {Reader} from '../reader/Reader';\nimport * as Util from '../core/Util';\nimport * as DomUtil from '../dom/DomUtil';\n\n/*\n * @class Control\n * @aka L.Control\n * @inherits Class\n *\n * L.Control is a base class for implementing reader controls. Handles regioning.\n * All other controls extend from this class.\n */\n\nexport var Control = Class.extend({\n // @section\n // @aka Control options\n options: {\n // @option region: String = 'topright'\n // The region of the control (one of the reader corners). Possible values are `'topleft'`,\n // `'topright'`, `'bottomleft'` or `'bottomright'`\n },\n\n initialize: function (options) {\n Util.setOptions(this, options);\n if ( options.container ) {\n this._container = options.container;\n this._locked = true;\n }\n this._id = (new Date()).getTime() + '-' + parseInt(Math.random((new Date()).getTime()) * 1000, 10);\n },\n\n /* @section\n * Classes extending L.Control will inherit the following methods:\n *\n * @method getRegion: string\n * Returns the region of the control.\n */\n getRegion: function () {\n return this.options.region;\n },\n\n // @method setRegion(region: string): this\n // Sets the region of the control.\n setRegion: function (region) {\n var reader = this._reader;\n\n if (reader) {\n reader.removeControl(this);\n }\n\n this.options.region = region;\n\n if (reader) {\n reader.addControl(this);\n }\n\n return this;\n },\n\n // @method getContainer: HTMLElement\n // Returns the HTMLElement that contains the control.\n getContainer: function () {\n return this._container;\n },\n\n // @method addTo(reader: Map): this\n // Adds the control to the given reader.\n addTo: function (reader) {\n this.remove();\n this._reader = reader;\n\n var container = this._container = this.onAdd(reader);\n\n DomUtil.addClass(container, 'cozy-control');\n\n if ( ! this._locked ) {\n var region = this.getRegion();\n var area = reader.getControlRegion(region);\n area.appendChild(container);\n }\n\n return this;\n },\n\n // @method remove: this\n // Removes the control from the reader it is currently active on.\n remove: function () {\n if (!this._reader) {\n return this;\n }\n\n if (! this._container) {\n return this;\n }\n\n if ( ! this._locked ) {\n DomUtil.remove(this._container);\n }\n\n if (this.onRemove) {\n this.onRemove(this._reader);\n }\n\n this._reader = null;\n\n return this;\n },\n\n _refocusOnMap: function (e) {\n // if reader exists and event is not a keyboard event\n if (this._reader && e && e.screenX > 0 && e.screenY > 0) {\n this._reader.getContainer().focus();\n }\n },\n\n _className: function(widget) {\n var className = [ 'cozy-control' ];\n if ( this.options.direction ) {\n className.push('cozy-control-' + this.options.direction);\n }\n if ( widget ) {\n className.push('cozy-control-' + widget);\n }\n return className.join(' ');\n }\n});\n\nexport var control = function (options) {\n return new Control(options);\n};\n\n/* @section Extension methods\n * @uninheritable\n *\n * Every control should extend from `L.Control` and (re-)implement the following methods.\n *\n * @method onAdd(reader: Map): HTMLElement\n * Should return the container DOM element for the control and add listeners on relevant reader events. Called on [`control.addTo(reader)`](#control-addTo).\n *\n * @method onRemove(reader: Map)\n * Optional method. Should contain all clean up code that removes the listeners previously added in [`onAdd`](#control-onadd). Called on [`control.remove()`](#control-remove).\n */\n\n/* @namespace Map\n * @section Methods for Layers and Controls\n */\nReader.include({\n // @method addControl(control: Control): this\n // Adds the given control to the reader\n addControl: function (control) {\n control.addTo(this);\n return this;\n },\n\n // @method removeControl(control: Control): this\n // Removes the given control from the reader\n removeControl: function (control) {\n control.remove();\n return this;\n },\n\n getControlContainer: function() {\n var l = 'cozy-';\n if ( ! this._controlContainer ) {\n this._controlContainer =\n DomUtil.create('div', l + 'control-container', this._container);\n }\n return this._controlContainer;\n },\n\n getControlRegion: function (target) {\n\n if ( ! this._panes[target] ) {\n // target is dot-delimited string\n // first dot is the panel\n var parts = target.split('.');\n var tmp = [];\n var parent = this._container;\n var x = 0;\n while ( parts.length ) {\n var slug = parts.shift();\n tmp.push(slug);\n var panel = tmp.join(\".\");\n var className = 'cozy-panel-' + slug;\n if ( ! this._panes[panel] ) {\n this._panes[panel] = DomUtil.create('div', className, parent);\n }\n parent = this._panes[panel];\n x += 1;\n if ( x > 100 ) { break; }\n }\n }\n return this._panes[target];\n },\n\n getControlRegion_1: function (target) {\n\n var tmp = target.split('.');\n var region = tmp.shift();\n var slot = tmp.pop() || '-slot';\n\n var container = this._panes[region];\n if ( ! this._panes[target] ) {\n var className = 'cozy-' + region + '--item cozy-slot-' + slot\n if ( ! this._panes[region + '.' + slot] ) {\n var div = DomUtil.create('div', className);\n if ( slot == 'left' || slot == 'bottom' ) {\n var childElement = this._panes[region].firstChild;\n this._panes[region].insertBefore(div, childElement);\n } else {\n this._panes[region].appendChild(div);\n }\n this._panes[region + '.' + slot] = div;\n }\n className = this._classify(tmp);\n this._panes[target] = DomUtil.create('div', className, this._panes[region + '.' + slot]);\n }\n\n return this._panes[target];\n },\n\n _classify: function(tmp) {\n var l = 'cozy-';\n var className = [];\n for(var i in tmp) {\n className.push(l + tmp[i]);\n }\n className = className.join(' ');\n return className;\n },\n\n _clearControlRegion: function () {\n for (var i in this._controlRegions) {\n DomUtil.remove(this._controlRegions[i]);\n }\n DomUtil.remove(this._controlContainer);\n delete this._controlRegions;\n delete this._controlContainer;\n }\n});\n","import {Control} from './Control';\nimport {Reader} from '../reader/Reader';\nimport * as DomUtil from '../dom/DomUtil';\nimport * as DomEvent from '../dom/DomEvent';\n\nvar PageControl = Control.extend({\n onAdd: function(reader) {\n var container = this._container;\n if ( container ) {\n this._control = container.querySelector(\"[data-target=\" + this.options.direction + \"]\");\n } else {\n\n var className = this._className(),\n options = this.options;\n container = DomUtil.create('div', className),\n\n this._control = this._createButton(this._fill(options.html || options.label), this._fill(options.label),\n className, container);\n }\n this._bindEvents();\n\n return container;\n },\n\n _createButton: function (html, title, className, container) {\n var link = DomUtil.create('a', className, container);\n link.innerHTML = html;\n link.href = '#';\n link.title = title;\n\n /*\n * Will force screen readers like VoiceOver to read this as \"Zoom in - button\"\n */\n link.setAttribute('role', 'button');\n link.setAttribute('aria-label', title);\n\n return link;\n },\n\n _bindEvents: function() {\n var self = this;\n DomEvent.disableClickPropagation(this._control);\n DomEvent.on(this._control, 'click', DomEvent.stop);\n DomEvent.on(this._control, 'click', this._action, this);\n\n this._reader.on('reopen', function(data) {\n // update the button text / titles\n var html = self.options.html || self.options.label;\n self._control.innerHTML = self._fill(html);\n self._control.setAttribute('title', self._fill(self.options.label));\n self._control.setAttribute('aria-label', self._fill(self.options.label));\n });\n\n },\n\n _unit: function() {\n return ( this._reader.options.flow == 'scrolled-doc' ) ? 'Section' : 'Page';\n },\n\n _fill: function(s) {\n var unit = this._unit();\n return s.replace(/\\$\\{unit\\}/g, unit);\n },\n\n _label: function() {\n return this.options.label + \" \" + ( this._reader.options.flow == 'scrolled-doc' ) ? 'Section' : 'Page';\n },\n\n EOT: true\n});\n\nexport var PagePrevious = PageControl.extend({\n options: {\n region: 'edge.left',\n direction: 'previous',\n label: 'Previous ${unit}',\n html: ''\n },\n\n _action: function(e) {\n this._reader.prev();\n }\n});\n\nexport var PageNext = PageControl.extend({\n options: {\n region: 'edge.right',\n direction: 'next',\n label: 'Next ${unit}',\n html: ''\n },\n\n _action: function(e) {\n this._reader.next();\n }\n});\n\nexport var PageFirst = PageControl.extend({\n options: {\n direction: 'first',\n label: 'First ${unit}'\n },\n _action: function(e) {\n this._reader.first();\n }\n});\n\nexport var PageLast = PageControl.extend({\n options: {\n direction: 'last',\n label: 'Last ${unit}'\n },\n _action: function(e) {\n this._reader.last();\n }\n});\n\nexport var pageNext = function(options) {\n return new PageNext(options);\n}\n\nexport var pagePrevious = function(options) {\n return new PagePrevious(options);\n}\n\nexport var pageFirst = function(options) {\n return new PageFirst(options);\n}\n\nexport var pageLast = function(options) {\n return new PageLast(options);\n}\n","import {Class} from '../core/Class';\nimport {Reader} from '../reader/Reader';\nimport * as Util from '../core/Util';\nimport * as DomUtil from '../dom/DomUtil';\nimport * as DomEvent from '../dom/DomEvent';\n\nimport assign from 'lodash/assign';\n\nvar activeModal;\nvar dismissModalListener = false;\n\n// from https://github.com/ghosh/micromodal/blob/master/src/index.js\nconst FOCUSABLE_ELEMENTS = [\n 'a[href]',\n 'area[href]',\n 'input:not([disabled]):not([type=\"hidden\"])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n 'button:not([disabled])',\n 'iframe',\n 'object',\n 'embed',\n '[contenteditable]',\n '[tabindex]:not([tabindex^=\"-\"])'\n ];\n\nconst ACTIONABLE_ELEMENTS = [\n 'a[href]',\n 'area[href]',\n 'input[type=\"submit\"]:not([disabled])',\n 'button:not([disabled])'\n ];\n\nexport var Modal = Class.extend({\n options: {\n // @option region: String = 'topright'\n // The region of the control (one of the reader edges). Possible values are `'left' ad 'right'`\n region: 'left',\n fraction: 0,\n width: null,\n className: {},\n actions: null,\n callbacks: { onShow: function() {}, onClose: function() {} },\n handlers: {}\n },\n\n initialize: function (options) {\n options = Util.setOptions(this, options);\n this._id = (new Date()).getTime() + '-' + parseInt(Math.random((new Date()).getTime()) * 1000, 10);\n this._initializedEvents = false;\n this.callbacks = assign({}, this.options.callbacks);\n this.actions = this.options.actions ? assign({}, this.options.actions) : null;\n this.handlers = assign({}, this.options.handlers);\n if ( typeof(this.options.className) == 'string' ) {\n this.options.className = { container: this.options.className };\n }\n },\n\n addTo: function(reader) {\n var self = this;\n this._reader = reader;\n var template = this.options.template;\n\n var panelHTML = `
    \n
    \n
    \n
    \n
    \n

    ${this.options.title}

    \n \n
    \n
    \n ${template}\n
    `;\n\n if ( this.options.actions ) {\n panelHTML += '
    '\n for(var i in this.options.actions) {\n var action = this.options.actions[i];\n var button_cls = action.className || 'button--default';\n panelHTML += ``;\n }\n panelHTML += '
    ';\n }\n\n panelHTML += '
    ';\n\n var body = new DOMParser().parseFromString(panelHTML, \"text/html\").body;\n\n this.modal = reader._container.appendChild(body.children[0]);\n this._container = this.modal; // compatibility\n\n this.container = this.modal.querySelector('.modal__container');\n this._bindEvents();\n return this;\n },\n\n _bindEvents: function() {\n var self = this;\n this.onClick = this.onClick.bind(this);\n this.onKeydown = this.onKeydown.bind(this);\n this.onModalTransition = this.onModalTransition.bind(this);\n\n this.modal.addEventListener('transitionend', function() {\n }.bind(this));\n\n // bind any actions\n if ( this.actions ) {\n for(var i in this.actions) {\n let action = this.actions[i];\n let button_id = '#action-' + this._id + '-' + i;\n let button = this.modal.querySelector(button_id);\n if ( button ) {\n DomEvent.on(button, 'click', function(event) {\n event.preventDefault();\n action.callback(event);\n if ( action.close ) {\n self.closeModal();\n }\n })\n }\n }\n }\n },\n\n deactivate: function() {\n this.closeModal();\n },\n\n closeModal: function() {\n var self = this;\n this.modal.setAttribute('aria-hidden', 'true');\n this.removeEventListeners();\n this.activeElement.focus();\n this.callbacks.onClose(this.modal);\n },\n\n showModal: function() {\n this.activeElement = document.activeElement\n this._resize();\n this.modal.setAttribute('aria-hidden', 'false')\n this.setFocusToFirstNode()\n this.addEventListeners()\n this.callbacks.onShow(this.modal)\n },\n\n activate: function() {\n return this.showModal();\n var self = this;\n activeModal = this;\n DomUtil.addClass(self._reader._container, 'st-modal-activating');\n this._resize();\n DomUtil.addClass(this._reader._container, 'st-modal-open');\n setTimeout(function() {\n DomUtil.addClass(self._container, 'active');\n DomUtil.removeClass(self._reader._container, 'st-modal-activating');\n self._container.setAttribute('aria-hidden', 'false');\n self.setFocusToFirstNode();\n }, 25);\n },\n\n addEventListeners: function () {\n // --- do we need touch listeners?\n // this.modal.addEventListener('touchstart', this.onClick)\n // this.modal.addEventListener('touchend', this.onClick)\n this.modal.addEventListener('click', this.onClick)\n document.addEventListener('keydown', this.onKeydown)\n 'webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend'.split(' ').forEach(function(event) {\n this.modal.addEventListener(event, this.onModalTransition);\n }.bind(this))\n },\n\n removeEventListeners: function () {\n this.modal.removeEventListener('touchstart', this.onClick)\n this.modal.removeEventListener('click', this.onClick)\n 'webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend'.split(' ').forEach(function(event) {\n this.modal.removeEventListener(event, this.onModalTransition);\n }.bind(this))\n document.removeEventListener('keydown', this.onKeydown)\n },\n\n _resize: function() {\n var container = this._reader._container;\n this.container.style.height = container.offsetHeight + 'px';\n if ( ! this.options.className.container ) {\n this.container.style.width = this.options.width || parseInt(container.offsetWidth * this.options.fraction) + 'px';\n }\n\n var header = this.container.querySelector('header');\n var footer = this.container.querySelector('footer');\n var main = this.container.querySelector('main');\n var height = this.container.clientHeight - header.clientHeight;\n if ( footer ) {\n height -= footer.clientHeight;\n }\n main.style.height = height + 'px';\n },\n\n getFocusableNodes: function() {\n const nodes = this.modal.querySelectorAll(FOCUSABLE_ELEMENTS);\n return Object.keys(nodes).map((key) => nodes[key]);\n },\n\n setFocusToFirstNode: function() {\n var focusableNodes = this.getFocusableNodes();\n if ( focusableNodes.length ) {\n focusableNodes[0].focus();\n } else {\n activeModal._container.focus();\n }\n },\n\n getActionableNodes: function() {\n const nodes = this.modal.querySelectorAll(ACTIONABLE_ELEMENTS);\n return Object.keys(nodes).map((key) => nodes[key]);\n },\n\n onKeydown: function(event) {\n if ( event.keyCode == 27 ) { this.closeModal(); }\n if ( event.keyCode == 9 ) {\n this.maintainFocus(event);\n }\n },\n\n onClick: function(event) {\n\n var closeAfterAction = false;\n var target = event.target;\n\n // As far as I can tell, the code below isn't catching direct clicks on\n // items with class='data-modal-close' as they're not ACTIONABLE_ELEMENTS.\n // Adding them to ACTIONABLE_ELEMENTS causes undesirable behavior where\n // their child items also close the modal thanks to the loop below.\n // Children of .modal__overlay include the modal header, border area and\n // padding. We don't want clicks on these closing the modal.\n // Just close the modal now for direct clicks on a '.data-modal-close'.\n if (target.hasAttribute('data-modal-close')) {\n this.closeModal();\n return;\n }\n\n // if the target isn't an actionable type, walk the DOM until\n // one is found\n var actionableNodes = this.getActionableNodes();\n while ( actionableNodes.indexOf(target) < 0 && target != this.modal ) {\n target = target.parentElement;\n }\n\n // no target found, punt\n if ( actionableNodes.indexOf(target) < 0 ) {\n return;\n }\n\n if (this.handlers.click) {\n var did_match = false;\n for(var selector in this.handlers.click) {\n if ( target.matches(selector) ) {\n closeAfterAction = this.handlers.click[selector](this, target);\n break;\n }\n }\n }\n\n if (closeAfterAction || target.hasAttribute('data-modal-close')) this.closeModal();\n\n event.preventDefault();\n },\n\n onModalTransition: function(event) {\n if ( this.modal.getAttribute('aria-hidden') == 'true' ) {\n this._reader.fire('modal-closed');\n } else {\n this._reader.fire('modal-opened');\n }\n },\n\n on: function(event, selector, handler) {\n if (! this.handlers[event] ) {\n this.handlers[event] = {};\n }\n this.handlers[event][selector] = handler;\n },\n\n maintainFocus: function(event) {\n var focusableNodes = this.getFocusableNodes();\n var focusedItemIndex = focusableNodes.indexOf(document.activeElement);\n if (event.shiftKey && focusedItemIndex === 0) {\n focusableNodes[focusableNodes.length - 1].focus()\n event.preventDefault()\n }\n\n if (!event.shiftKey && focusedItemIndex === focusableNodes.length - 1) {\n focusableNodes[0].focus()\n event.preventDefault()\n }\n },\n\n EOT: true\n});\n\nReader.include({\n modal: function (options) {\n var modal = new Modal(options);\n return modal.addTo(this);\n // return this;\n },\n\n EOT: true\n});\n","import {Control} from './Control';\nimport {Reader} from '../reader/Reader';\nimport {Modal} from './Modal';\nimport * as DomUtil from '../dom/DomUtil';\nimport * as DomEvent from '../dom/DomEvent';\n\nexport var Contents = Control.extend({\n\n defaultTemplate: ``,\n\n onAdd: function(reader) {\n var self = this;\n var container = this._container;\n if ( container ) {\n this._control = container.querySelector(\"[data-target=\" + this.options.direction + \"]\");\n } else {\n\n var className = this._className(),\n options = this.options;\n\n container = DomUtil.create('div', className);\n\n var template = this.options.template || this.defaultTemplate;\n\n var body = new DOMParser().parseFromString(template, \"text/html\").body;\n while ( body.children.length ) {\n container.appendChild(body.children[0]);\n }\n }\n\n this._control = container.querySelector(\"[data-toggle=open]\");\n this._control.setAttribute('id', 'action-' + this._id);\n container.style.position = 'relative';\n\n this._reader.on('updateContents', function(data) {\n\n DomEvent.on(this._control, 'click', function(event) {\n event.preventDefault();\n self._modal.activate();\n }, this)\n\n this._modal = this._reader.modal({\n template: '
      ',\n title: 'Contents',\n region: 'left',\n className: 'cozy-modal-contents'\n });\n\n this._modal.on('click', 'a[href]', function(modal, target) {\n target = target.getAttribute('href');\n this._reader.gotoPage(target);\n return true;\n }.bind(this))\n\n this._setupSkipLink();\n\n var parent = self._modal._container.querySelector('ul');\n var s = data.toc.filter(function(value) { return value.parent == null }).map(function(value) { return [ value, 0, parent ] });\n while ( s.length ) {\n var tuple = s.shift();\n var chapter = tuple[0];\n var tabindex = tuple[1];\n var parent = tuple[2];\n\n var option = self._createOption(chapter, tabindex, parent);\n data.toc.filter(function(value) { return value.parent == chapter.id }).reverse().forEach(function(chapter_) {\n s.unshift([chapter_, tabindex + 1, option]);\n });\n }\n }.bind(this))\n\n return container;\n },\n\n _createOption(chapter, tabindex, parent) {\n\n function pad(value, length) {\n return (value.toString().length < length) ? pad(\"-\"+value, length):value;\n }\n var option = DomUtil.create('li');\n var anchor = DomUtil.create('a', null, option);\n anchor.textContent = chapter.label;\n // var tab = pad('', tabindex); tab = tab.length ? tab + ' ' : '';\n // option.textContent = tab + chapter.label;\n anchor.setAttribute('href', chapter.href);\n\n if ( parent.tagName == 'LI' ) {\n // need to nest\n var tmp = parent.querySelector('ul');\n if ( ! tmp ) {\n tmp = DomUtil.create('ul', null, parent);\n }\n parent = tmp;\n }\n\n parent.appendChild(option);\n return option;\n },\n\n _setupSkipLink: function() {\n if ( ! this.options.skipLink ) { return; }\n \n var target = document.querySelector(this.options.skipLink);\n if ( ! target ) { return; }\n\n var link = document.createElement('a');\n link.textContent = 'Skip to contents';\n link.setAttribute('href', '#action-' + this._id);\n\n var ul = target.querySelector('ul');\n if ( ul ) {\n // add to list\n target = document.createElement('li');\n ul.appendChild(target);\n }\n target.appendChild(link);\n link.addEventListener('click', function(event) {\n event.preventDefault();\n event.stopPropagation();\n this._control.click();\n }.bind(this))\n\n },\n\n EOT: true\n});\n\nexport var contents = function(options) {\n return new Contents(options);\n}\n","import {Control} from './Control';\nimport {Reader} from '../reader/Reader';\nimport * as DomUtil from '../dom/DomUtil';\nimport * as DomEvent from '../dom/DomEvent';\n\n// Title + Chapter\n\nexport var Title = Control.extend({\n onAdd: function(reader) {\n var self = this;\n var className = this._className(),\n container = DomUtil.create('div', className),\n options = this.options;\n\n // var template = '

      Contents: ';\n // var control = new DOMParser().parseFromString(template, \"text/html\").body.firstChild;\n\n var h1 = DomUtil.create('h1', 'cozy-h1', container);\n DomUtil.setOpacity(h1, 0);\n this._title = DomUtil.create('span', 'cozy-title', h1);\n this._divider = DomUtil.create('span', 'cozy-divider', h1);\n this._divider.textContent = \" · \";\n this._section = DomUtil.create('span', 'cozy-section', h1);\n\n // --- TODO: disable until we can work out how to \n // --- more reliably match the current section to the contents\n // this._reader.on('updateSection', function(data) {\n // if ( data && data.label ) {\n // self._section.textContent = data.label;\n // DomUtil.setOpacity(self._section, 1.0);\n // DomUtil.setOpacity(self._divider, 1.0);\n // } else {\n // DomUtil.setOpacity(self._section, 0);\n // DomUtil.setOpacity(self._divider, 0);\n // }\n // })\n\n this._reader.on('updateTitle', function(data) {\n if ( data ) {\n self._title.textContent = data.title || data.bookTitle;\n DomUtil.setOpacity(self._section, 0);\n DomUtil.setOpacity(self._divider, 0);\n DomUtil.setOpacity(h1, 1);\n }\n })\n\n return container;\n },\n\n _createButton: function (html, title, className, container, fn) {\n var link = DomUtil.create('a', className, container);\n link.innerHTML = html;\n link.href = '#';\n link.title = title;\n\n /*\n * Will force screen readers like VoiceOver to read this as \"Zoom in - button\"\n */\n link.setAttribute('role', 'button');\n link.setAttribute('aria-label', title);\n\n DomEvent.disableClickPropagation(link);\n DomEvent.on(link, 'click', DomEvent.stop);\n DomEvent.on(link, 'click', fn, this);\n // DomEvent.on(link, 'click', this._refocusOnMap, this);\n\n return link;\n },\n\n EOT: true\n});\n\nexport var title = function(options) {\n return new Title(options);\n}\n","import {Control} from './Control';\nimport {Reader} from '../reader/Reader';\nimport * as DomUtil from '../dom/DomUtil';\nimport * as DomEvent from '../dom/DomEvent';\n\n// Title + Chapter\n\nexport var PublicationMetadata = Control.extend({\n onAdd: function(reader) {\n var self = this;\n var className = this._className(),\n container = DomUtil.create('div', className),\n options = this.options;\n\n // var template = '

      Contents: ';\n // var control = new DOMParser().parseFromString(template, \"text/html\").body.firstChild;\n\n this._publisher = DomUtil.create('div', 'cozy-publisher', container);\n this._rights = DomUtil.create('div', 'cozy-rights', container);\n\n this._reader.on('updateTitle', function(data) {\n if ( data ) {\n self._publisher.textContent = data.publisher;\n self._rights.textContent = data.rights;\n }\n })\n\n return container;\n },\n\n _createButton: function (html, title, className, container, fn) {\n var link = DomUtil.create('a', className, container);\n link.innerHTML = html;\n link.href = '#';\n link.title = title;\n\n /*\n * Will force screen readers like VoiceOver to read this as \"Zoom in - button\"\n */\n link.setAttribute('role', 'button');\n link.setAttribute('aria-label', title);\n\n DomEvent.disableClickPropagation(link);\n DomEvent.on(link, 'click', DomEvent.stop);\n DomEvent.on(link, 'click', fn, this);\n // DomEvent.on(link, 'click', this._refocusOnMap, this);\n\n return link;\n },\n\n EOT: true\n});\n\nexport var publicationMetadata = function(options) {\n return new PublicationMetadata(options);\n}\n","import {Class} from '../core/Class';\nimport {Control} from './Control';\nimport {Reader} from '../reader/Reader';\nimport * as DomUtil from '../dom/DomUtil';\nimport * as DomEvent from '../dom/DomEvent';\nimport * as Util from '../core/Util';\n\nimport assign from 'lodash/assign';\nimport keys from 'lodash/keys';\n\nexport var Preferences = Control.extend({\n options: {\n label: 'Preferences',\n hasThemes: false,\n html: ''\n },\n\n onAdd: function(reader) {\n var self = this;\n var className = this._className('preferences'),\n container = DomUtil.create('div', className),\n options = this.options;\n\n this._activated = false;\n this._control = this._createButton(options.html || options.label, options.label,\n className, container, this._action)\n\n this._createPanel();\n\n return container;\n },\n\n _action: function() {\n var self = this;\n self.initializeForm();\n self._modal.activate();\n },\n\n _createButton: function (html, title, className, container, fn) {\n var link = DomUtil.create('button', className, container);\n link.innerHTML = html;\n link.title = title;\n\n /*\n * Will force screen readers like VoiceOver to read this as \"Zoom in - button\"\n */\n link.setAttribute('role', 'button');\n link.setAttribute('aria-label', title);\n\n DomEvent.disableClickPropagation(link);\n DomEvent.on(link, 'click', DomEvent.stop);\n DomEvent.on(link, 'click', fn, this);\n\n return link;\n },\n\n _createPanel: function() {\n var self = this;\n var template = '';\n\n var possible_fieldsets = [];\n if ( this._reader.metadata.layout == 'pre-paginated' ) {\n // different panel\n } else {\n possible_fieldsets.push('TextSize');\n }\n possible_fieldsets.push('Display');\n\n if ( this._reader.options.themes && this._reader.options.themes.length > 0 ) {\n this.options.hasThemes = true;\n possible_fieldsets.push('Theme');\n }\n\n this._fieldsets = [];\n possible_fieldsets.forEach(function(cls) {\n var fieldset = new Preferences.fieldset[cls](this);\n template += fieldset.template();\n this._fieldsets.push(fieldset);\n }.bind(this))\n\n if ( this.options.fields ) {\n this.options.hasFields = true;\n for(var i in this.options.fields) {\n var field = this.options.fields[i];\n var id = \"preferences-custom-\" + i;\n template += `
      \n ${field.label}\n `;\n for(var j in field.inputs) {\n var input = field.inputs[j];\n var checked = input.value == field.value ? ' checked=\"checked\"' : '';\n template += ``;\n }\n if ( field.hint ) {\n template += `

      ${field.hint}

      `;\n }\n }\n }\n\n template = '' + template + '';\n\n this._modal = this._reader.modal({\n template: template,\n title: 'Preferences',\n className: 'cozy-modal-preferences',\n actions: [\n {\n label: 'Save Changes',\n callback: function(event) {\n self.updatePreferences(event);\n }\n }\n ],\n region: 'right'\n });\n\n this._form = this._modal._container.querySelector('form');\n },\n\n initializeForm: function() {\n this._fieldsets.forEach(function(fieldset) {\n fieldset.initializeForm(this._form);\n }.bind(this));\n },\n\n updatePreferences: function(event) {\n event.preventDefault();\n\n var doUpdate = false;\n var new_options = {};\n this._fieldsets.forEach(function(fieldset) {\n // doUpdate = doUpdate || fieldset.updateForm(this._form, new_options);\n assign(new_options, fieldset.updateForm(this._form));\n }.bind(this));\n\n if ( this.options.hasFields ) {\n for(var i in this.options.fields) {\n var field = this.options.fields[i];\n var id = \"preferences-custom-\" + i;\n var input = this._form.querySelector(`input[name=\"x${field.name}\"]:checked`);\n if ( input.value != field.value ) {\n field.value = input.value;\n field.callback(field.value);\n }\n }\n }\n\n this._modal.deactivate();\n\n setTimeout(function() {\n this._reader.saveOptions(new_options);\n this._reader.reopen(new_options);\n }.bind(this), 100);\n },\n\n EOT: true\n});\n\nPreferences.fieldset = {};\n\nvar Fieldset = Class.extend({\n\n options: {},\n\n initialize: function (control, options) {\n Util.setOptions(this, options);\n this._control = control;\n this._current = {};\n this._id = (new Date()).getTime() + '-' + parseInt(Math.random((new Date()).getTime()) * 1000, 10);\n },\n\n template: function() {\n\n },\n\n EOT: true\n\n\n});\n\nPreferences.fieldset.TextSize = Fieldset.extend({\n\n initializeForm: function(form) {\n if ( ! this._input ) {\n this._input = form.querySelector(`#x${this._id}-input`);\n this._output = form.querySelector(`#x${this._id}-output`);\n this._preview = form.querySelector(`#x${this._id}-preview`);\n\n this._input.addEventListener('input', this._updatePreview.bind(this));\n this._input.addEventListener('change', this._updatePreview.bind(this));\n }\n\n var text_size = this._control._reader.options.text_size || 100;\n if ( text_size == 'auto' ) { text_size = 100; }\n this._current.text_size = text_size;\n this._input.value = text_size;\n this._updatePreview();\n },\n\n updateForm: function(form) {\n return { text_size: this._input.value };\n // options.text_size = this._input.value;\n // return ( this._input.value != this._current.text_size );\n },\n\n template: function() {\n return `
      \n Text Size\n
      \n ‘Yes, that’s it,’ said the Hatter with a sigh: ‘it’s always tea-time, and we’ve no time to wash the things between whiles.’\n
      \n

      \n T-\n \n T+\n

      \n

      \n Text Size: \n 100\n

      \n
      `;\n },\n\n _updatePreview: function() {\n this._preview.style.fontSize = `${( parseInt(this._input.value, 10) / 100 )}em`;\n this._output.value = `${this._input.value}%`;\n },\n\n EOT: true\n\n});\n\nPreferences.fieldset.Display = Fieldset.extend({\n\n initializeForm: function(form) {\n var flow = this._control._reader.options.flow || this._control._reader.metadata.flow || 'paginated';\n if ( flow == 'auto' ) { flow = 'paginated'; }\n\n var input = form.querySelector(`#x${this._id}-input-${flow}`);\n input.checked = true;\n this._current.flow = flow;\n\n },\n\n updateForm: function(form) {\n var input = form.querySelector(`input[name=\"x${this._id}-flow\"]:checked`);\n return { flow: input.value };\n },\n\n template: function() {\n return `
      \n Display\n \n \n
      `;\n },\n\n EOT: true\n\n});\n\nPreferences.fieldset.Theme = Fieldset.extend({\n\n initializeForm: function(form) {\n var theme = this._control._reader.options.theme || 'default';\n\n var input = form.querySelector(`#x${this._id}-input-theme-${theme}`);\n input.checked = true;\n this._current.theme = theme;\n },\n\n updateForm: function(form) {\n var input = form.querySelector(`input[name=\"x${this._id}-theme\"]:checked`);\n return { theme: input.value };\n },\n\n template: function() {\n var template = `
      \n Theme\n `;\n\n this._control._reader.options.themes.forEach(function(theme) {\n template += ``\n }.bind(this));\n\n template += '
      ';\n\n return template;\n\n },\n\n EOT: true\n\n});\n\nexport var preferences = function(options) {\n return new Preferences(options);\n}\n","import {Control} from './Control';\nimport {Reader} from '../reader/Reader';\nimport * as DomUtil from '../dom/DomUtil';\nimport * as DomEvent from '../dom/DomEvent';\n\nexport var Widget = Control.extend({\n\n\n options: {\n // @option region: String = 'topright'\n // The region of the control (one of the reader corners). Possible values are `'topleft'`,\n // `'topright'`, `'bottomleft'` or `'bottomright'`\n },\n\n onAdd: function(reader) {\n var container = this._container;\n if ( container ) {\n // NOOP\n } else {\n\n var className = this._className(),\n options = this.options;\n\n container = DomUtil.create('div', className);\n\n var template = this.options.template || this.defaultTemplate;\n var body = new DOMParser().parseFromString(template, \"text/html\").body;\n while ( body.children.length ) {\n container.appendChild(body.children[0]);\n }\n\n }\n\n this._onAddExtra(container);\n this._updateTemplate(container);\n this._updateClass(container);\n this._bindEvents(container);\n\n return container;\n },\n\n _updateTemplate: function(container) {\n var data = this.data();\n for(var slot in data) {\n if ( data.hasOwnProperty(slot) ) {\n var value = data[slot];\n if ( typeof(value) == \"function\" ) { value = value(); }\n var node = container.querySelector(`[data-slot=${slot}]`);\n if ( node ) {\n if ( node.hasAttribute('value') ) {\n node.setAttribute('value', value);\n } else {\n node.innerHTML = value;\n }\n }\n }\n }\n },\n\n _updateClass: function(container) {\n if ( this.options.className ) {\n DomUtil.addClass(container, this.options.className);\n }\n },\n\n _onAddExtra: function() { },\n\n _bindEvents: function(container) {\n var control = container.querySelector(\"[data-toggle=button]\");\n if ( ! control ) { return ; }\n DomEvent.disableClickPropagation(control);\n DomEvent.on(control, 'click', DomEvent.stop);\n DomEvent.on(control, 'click', this._action, this);\n },\n\n _action: function() {\n },\n\n data: function() {\n return this.options.data || {};\n },\n\n EOT: true\n});\n\nWidget.Button = Widget.extend({\n defaultTemplate: ``,\n\n _action: function() {\n this.options.onClick(this, this._reader);\n },\n\n EOT: true\n});\n\nWidget.Panel = Widget.extend({\n defaultTemplate: `
      `,\n\n\n EOT: true\n});\n\nWidget.Toggle = Widget.extend({\n defaultTemplate: ``,\n\n _onAddExtra: function(container) {\n this.state(this.options.states[0].stateName, container);\n\n return container;\n },\n\n state: function(stateName, container) {\n container = container || this._container;\n this._resetState(container);\n this._state = this.options.states.filter(function(s) { return s.stateName == stateName })[0];\n this._updateClass(container);\n this._updateTemplate(container);\n },\n\n _resetState: function(container) {\n if ( ! this._state ) { return; }\n if ( this._state.className ) {\n DomUtil.removeClass(container, this._state.className);\n }\n },\n\n _updateClass: function(container) {\n if ( this._state.className ) {\n DomUtil.addClass(container, this._state.className);\n }\n },\n\n _action: function() {\n this._state.onClick(this, this._reader);\n },\n\n data: function() {\n return this._state.data || {};\n },\n\n EOT: true\n});\n\n// export var widget = function(options) {\n// return new Widget(options);\n// }\n\nexport var widget = {\n button: function(options) { return new Widget.Button(options); },\n panel: function(options) { return new Widget.Panel(options); },\n toggle: function(options) { return new Widget.Toggle(options); }\n}\n","import {Control} from './Control';\nimport {Reader} from '../reader/Reader';\nimport * as DomUtil from '../dom/DomUtil';\nimport * as DomEvent from '../dom/DomEvent';\n\nexport var Citation = Control.extend({\n options: {\n label: 'Citation',\n html: 'Get Citation'\n },\n\n defaultTemplate: ``,\n\n\n onAdd: function(reader) {\n var self = this;\n var container = this._container;\n if ( container ) {\n this._control = container.querySelector(\"[data-target=\" + this.options.direction + \"]\");\n } else {\n\n var className = this._className(),\n options = this.options;\n\n container = DomUtil.create('div', className);\n\n var template = this.options.template || this.defaultTemplate;\n\n var body = new DOMParser().parseFromString(template, \"text/html\").body;\n while ( body.children.length ) {\n container.appendChild(body.children[0]);\n }\n }\n\n this._reader.on('updateContents', function(data) {\n self._createPanel();\n });\n\n\n this._control = container.querySelector(\"[data-toggle=open]\");\n DomEvent.on(this._control, 'click', function(event) {\n event.preventDefault();\n self._modal.activate();\n }, this)\n\n return container;\n },\n\n _action: function() {\n var self = this;\n self._modal.activate();\n },\n\n _createButton: function (html, title, className, container, fn) {\n var link = DomUtil.create('button', className, container);\n link.innerHTML = html;\n link.title = title;\n\n link.setAttribute('role', 'button');\n link.setAttribute('aria-label', title);\n\n DomEvent.disableClickPropagation(link);\n DomEvent.on(link, 'click', DomEvent.stop);\n DomEvent.on(link, 'click', fn, this);\n\n return link;\n },\n\n _createPanel: function() {\n var self = this;\n\n var template = `
      \n
      \n Select Citation Format\n
      \n
      \n
      \n
      `;\n\n this._modal = this._reader.modal({\n template: template,\n title: 'Copy Citation to Clipboard',\n className: 'cozy-modal-citatation',\n actions: [\n {\n label: 'Copy Citation',\n callback: function(event) {\n document.designMode = \"on\";\n var formatted = self._modal._container.querySelector(\"#formatted\");\n\n var range = document.createRange();\n range.selectNode(formatted);\n var sel = window.getSelection();\n sel.removeAllRanges();\n sel.addRange(range);\n\n // formatted.select();\n\n try {\n var flag = document.execCommand('copy');\n } catch(err) {\n console.log(\"AHOY COPY FAILED\", err);\n }\n\n self._message.innerHTML = 'Success! Citation copied to your clipboard.';\n self._message.style.display = 'block';\n sel.removeAllRanges();\n range.detach();\n document.designMode = \"off\";\n }\n }\n ],\n region: 'left',\n fraction: 1.0\n });\n\n this._form = this._modal._container.querySelector('form');\n var fieldset = this._form.querySelector('fieldset');\n\n var citations = this.options.citations || this._reader.metadata.citations;\n\n citations.forEach(function(citation, index) {\n var label = DomUtil.create('label', null, fieldset);\n var input = DomUtil.create('input', null, label);\n input.setAttribute('name', 'format');\n input.setAttribute('value', citation.format);\n input.setAttribute('type', 'radio');\n if ( index == 0 ) {\n input.setAttribute('checked', 'checked');\n }\n var text = document.createTextNode(\" \" + citation.format);\n label.appendChild(text);\n input.setAttribute('data-text', citation.text);\n });\n\n this._formatted = this._modal._container.querySelector(\"#formatted\");\n this._message = this._modal._container.querySelector(\"#message\");\n DomEvent.on(this._form, 'change', function(event) {\n var target = event.target;\n if ( target.tagName == 'INPUT' ) {\n this._initializeForm();\n }\n }, this);\n\n this._initializeForm();\n },\n\n _initializeForm: function() {\n var formatted = this._formatCitation();\n this._formatted.innerHTML = formatted;\n this._message.style.display = 'none';\n this._message.innerHTML = '';\n },\n\n _formatCitation: function(format) {\n if ( format == null ) {\n var selected = this._form.querySelector(\"input:checked\");\n format = selected.value;\n }\n var selected = this._form.querySelector(\"input[value=\" + format + \"]\");\n return selected.getAttribute('data-text');\n // return selected.dataset.text;\n },\n\n EOT: true\n});\n\nexport var citation = function(options) {\n return new Citation(options);\n}\n","import {Control} from './Control';\nimport {Reader} from '../reader/Reader';\nimport * as DomUtil from '../dom/DomUtil';\nimport * as DomEvent from '../dom/DomEvent';\n\nexport var Search = Control.extend({\n options: {\n label: 'Search',\n html: 'Search'\n },\n\n defaultTemplate: `
      \n \n \n \n
      `,\n\n onAdd: function(reader) {\n var self = this;\n var container = this._container;\n if ( container ) {\n this._control = container.querySelector(\"[data-target=\" + this.options.direction + \"]\");\n } else {\n\n var className = this._className(),\n options = this.options;\n\n container = DomUtil.create('div', className);\n\n var template = this.options.template || this.defaultTemplate;\n\n var body = new DOMParser().parseFromString(template, \"text/html\").body;\n while ( body.children.length ) {\n container.appendChild(body.children[0]);\n }\n }\n\n this._control = container.querySelector(\"[data-toggle=open]\");\n container.style.position = 'relative';\n\n this._data = null;\n this._canceled = false;\n this._processing = false;\n\n this._reader.on('ready', function() {\n\n this._modal = this._reader.modal({\n template: '
      ',\n title: 'Search Results',\n className: { container: 'cozy-modal-search' },\n region: 'left',\n });\n\n this._modal.callbacks.onClose = function() {\n if ( self._processing ) {\n self._canceled = true;\n }\n };\n\n this._article = this._modal._container.querySelector('article');\n\n this._modal.on('click', 'a[href]', function(modal, target) {\n target = target.getAttribute('href');\n this._reader.gotoPage(target);\n return true;\n }.bind(this));\n\n }.bind(this));\n\n DomEvent.on(this._control, 'click', function(event) {\n event.preventDefault();\n\n var searchString = this._container.querySelector(\"#cozy-search-string\").value;\n searchString = searchString.replace(/^\\s*/, '').replace(/\\s*$/, '');\n\n if ( ! searchString ) {\n // just punt\n return;\n }\n\n if ( searchString == this.searchString ) {\n // cached results\n self.openModalResults();\n } else {\n this.searchString = searchString;\n self.openModalWaiting();\n self.submitQuery();\n }\n }, this);\n\n return container;\n },\n\n openModalWaiting: function() {\n this._processing = true;\n this._emptyArticle();\n var value = this.searchString;\n this._article.innerHTML = '

      Submitting query for ' + value + '...

      ';\n this._modal.activate();\n },\n\n openModalResults: function() {\n if ( this._canceled ) {\n this._canceled = false;\n return;\n }\n this._buildResults();\n this._modal.activate();\n },\n\n submitQuery: function() {\n var self = this;\n\n var url = this.options.searchUrl + this.searchString;\n\n var request = new XMLHttpRequest();\n request.open('GET', url, true);\n\n request.onload = function() {\n if (this.status >= 200 && this.status < 400) {\n // Success!\n var data = JSON.parse(this.response);\n console.log(\"SEARCH DATA\", data);\n\n self._data = data;\n\n } else {\n // We reached our target server, but it returned an error\n\n self._data = null;\n console.log(this.response);\n }\n\n self.openModalResults();\n\n };\n\n request.onerror = function() {\n // There was a connection error of some sort\n self._data = null;\n self.openModalResults();\n };\n\n request.send();\n\n },\n\n _emptyArticle: function() {\n while (this._article.hasChildNodes()) {\n this._article.removeChild(this._article.lastChild);\n }\n },\n\n _buildResults: function() {\n var self = this;\n var content;\n\n this._processing = false;\n\n self._emptyArticle();\n\n var reader = this._reader;\n reader.annotations.reset();\n\n if ( this._data ) {\n if ( this._data.search_results.length ) {\n content = DomUtil.create('ul');\n\n this._data.search_results.forEach(function(result) {\n var option = DomUtil.create('li');\n var anchor = DomUtil.create('a', null, option);\n var cfiRange = \"epubcfi(\" + result.cfi + \")\";\n\n if (result.title) {\n var chapterTitle = DomUtil.create('i');\n chapterTitle.textContent = result.title + \": \";\n anchor.appendChild(chapterTitle);\n }\n anchor.appendChild(document.createTextNode(result.snippet));\n\n anchor.setAttribute(\"href\", cfiRange);\n content.appendChild(option);\n\n reader.annotations.highlight(cfiRange);\n });\n } else {\n content = DomUtil.create(\"p\")\n content.textContent = 'No results found for \"' + self.searchString + '\"';\n }\n } else {\n content = DomUtil.create(\"p\")\n content.textContent = 'There was a problem processing this query.';\n }\n\n self._article.appendChild(content);\n },\n\n EOT: true\n});\n\nexport var search = function(options) {\n return new Search(options);\n}\n","import {Control} from './Control';\nimport {Reader} from '../reader/Reader';\nimport * as DomUtil from '../dom/DomUtil';\nimport * as DomEvent from '../dom/DomEvent';\n\n// Title + Chapter\n\nexport var BibliographicInformation = Control.extend({\n options: {\n label: 'Info',\n direction: 'left',\n html: 'Info'\n },\n\n defaultTemplate: ``,\n\n onAdd: function(reader) {\n var self = this;\n var container = this._container;\n if ( container ) {\n this._control = container.querySelector(\"[data-target=\" + this.options.direction + \"]\");\n } else {\n\n var className = this._className(),\n options = this.options;\n\n container = DomUtil.create('div', className);\n\n var template = this.options.template || this.defaultTemplate;\n\n var body = new DOMParser().parseFromString(template, \"text/html\").body;\n while ( body.children.length ) {\n container.appendChild(body.children[0]);\n }\n }\n\n this._reader.on('updateContents', function(data) {\n self._createPanel();\n });\n\n\n this._control = container.querySelector(\"[data-toggle=open]\");\n DomEvent.on(this._control, 'click', function(event) {\n event.preventDefault();\n self._modal.activate();\n }, this)\n\n return container;\n },\n\n _createPanel: function() {\n var self = this;\n\n var template = `
      \n
      `;\n\n this._modal = this._reader.modal({\n template: template,\n title: 'Info',\n region: 'left',\n fraction: 1.0\n });\n\n var dl = this._modal._container.querySelector('dl');\n\n var metadata_fields = [\n [ 'title', 'Title' ],\n [ 'creator', 'Author' ],\n [ 'pubdate', 'Publication Date' ],\n [ 'modified_date', 'Modified Date' ],\n [ 'publisher', 'Publisher' ],\n [ 'rights', 'Rights' ],\n [ 'doi', 'DOI' ],\n [ 'description', 'Description' ],\n ];\n\n var metadata_fields_seen = {};\n\n var metadata = this._reader.metadata;\n\n for(var idx in metadata_fields) {\n var key = metadata_fields[idx][0];\n var label = metadata_fields[idx][1];\n if ( metadata[key] ) {\n var value = metadata[key];\n if ( key == 'pubdate' || key == 'modified_date' ) {\n value = this._formatDate(value);\n if ( ! value ) { continue; }\n // value = d.toISOString().slice(0,10); // for YYYY-MM-DD\n }\n metadata_fields_seen[key] = true;\n var dt = DomUtil.create('dt', 'cozy-bib-info-label', dl);\n dt.innerHTML = label;\n var dd = DomUtil.create('dd', 'cozy-bib-info-value cozy-bib-info-value-' + key, dl);\n dd.innerHTML = value;\n }\n }\n\n },\n\n _formatDate: function(value) {\n var match = value.match(/\\d{4}/);\n if ( match ) {\n return match[0];\n }\n return null;\n },\n\n EOT: true\n});\n\nexport var bibliographicInformation = function(options) {\n return new BibliographicInformation(options);\n}\n","import {Control} from './Control';\nimport {Reader} from '../reader/Reader';\nimport * as DomUtil from '../dom/DomUtil';\nimport * as DomEvent from '../dom/DomEvent';\n\nexport var Download = Control.extend({\n options: {\n label: 'Download Book',\n html: 'Download Book'\n },\n\n defaultTemplate: ``,\n\n\n onAdd: function(reader) {\n var self = this;\n var container = this._container;\n if ( container ) {\n this._control = container.querySelector(\"[data-target=\" + this.options.direction + \"]\");\n } else {\n\n var className = this._className(),\n options = this.options;\n\n container = DomUtil.create('div', className);\n\n var template = this.options.template || this.defaultTemplate;\n\n var body = new DOMParser().parseFromString(template, \"text/html\").body;\n while ( body.children.length ) {\n container.appendChild(body.children[0]);\n }\n }\n\n this._reader.on('updateContents', function(data) {\n self._createPanel();\n });\n\n\n this._control = container.querySelector(\"[data-toggle=open]\");\n DomEvent.on(this._control, 'click', function(event) {\n event.preventDefault();\n self._modal.activate();\n }, this)\n\n return container;\n },\n\n _createPanel: function() {\n var self = this;\n\n var template = `
      \n
      \n Choose File Format\n
      \n
      `;\n\n this._modal = this._reader.modal({\n template: template,\n title: 'Download Book',\n className: 'cozy-modal-download',\n actions: [\n {\n label: 'Download',\n callback: function(event) {\n var selected = self._form.querySelector(\"input:checked\");\n var href = selected.getAttribute('data-href');\n self._configureDownloadForm(href);\n self._form.submit();\n }\n }\n ],\n region: 'left',\n fraction: 1.0\n });\n\n this._form = this._modal._container.querySelector('form'); \n var fieldset = this._form.querySelector('fieldset');\n this._reader.options.download_links.forEach(function(link, index) {\n var label = DomUtil.create('label', null, fieldset);\n var input = DomUtil.create('input', null, label);\n input.setAttribute('name', 'format');\n input.setAttribute('value', link.format);\n input.setAttribute('data-href', link.href);\n input.setAttribute('type', 'radio');\n if ( index == 0 ) {\n input.setAttribute('checked', 'checked');\n }\n var text = link.format;\n if ( link.size ) {\n text += \" (\" + link.size + \")\";\n }\n var text = document.createTextNode(\" \" + text);\n label.appendChild(text);\n });\n\n },\n\n _configureDownloadForm: function(href) {\n var self = this;\n self._form.setAttribute('method', 'GET');\n self._form.setAttribute('action', href);\n self._form.setAttribute('target', '_blank');\n },\n\n\n EOT: true\n});\n\nexport var download = function(options) {\n return new Download(options);\n}\n","import {Control} from './Control';\nimport {Reader} from '../reader/Reader';\nimport * as DomUtil from '../dom/DomUtil';\nimport * as DomEvent from '../dom/DomEvent';\n\nexport var Navigator = Control.extend({\n onAdd: function(reader) {\n var container = this._container;\n if ( container ) {\n } else {\n\n var className = this._className('navigator'),\n options = this.options;\n \n container = DomUtil.create('div', className);\n }\n this._setup(container);\n\n this._reader.on('updateLocations', function(locations) {\n this._initiated = true;\n this._total = this._reader.locations.total;\n this._control.value = Math.ceil(this._reader.locations.percentageFromCfi(this._reader.currentLocation().start.cfi) * 100);\n this._last_value = this._control.value;\n\n this._spanTotalLocations.innerHTML = this._total;\n\n this._update();\n setTimeout(function() {\n DomUtil.addClass(this._container, 'initialized');\n }.bind(this), 0);\n }.bind(this));\n\n return container;\n },\n\n _setup: function(container) {\n this._control = container.querySelector(\"input[type=range]\");\n if ( ! this._control ) {\n this._createControl(container);\n }\n this._background = container.querySelector(\".cozy-navigator-range__background\");\n this._status = container.querySelector(\".cozy-navigator-range__status\");\n this._spanCurrentPercentage = container.querySelector(\".currentPercentage\");\n this._spanCurrentLocation = container.querySelector(\".currentLocation\");\n this._spanTotalLocations = container.querySelector(\".totalLocations\");\n\n this._bindEvents();\n },\n\n _createControl: function (container) {\n var template = `
      \n \n \n
      \n
      \n
      0% • Location 0 of ?
      \n `;\n\n var body = new DOMParser().parseFromString(template, \"text/html\").body;\n while ( body.children.length ) {\n container.appendChild(body.children[0]);\n }\n\n this._control = container.querySelector(\"input[type=range]\");\n },\n\n _bindEvents: function() {\n var self = this;\n\n this._control.addEventListener(\"input\", function() {\n self._update();\n }, false);\n this._control.addEventListener(\"change\", function() { self._action(); }, false);\n this._control.addEventListener(\"mousedown\", function(){\n self._mouseDown = true;\n }, false);\n this._control.addEventListener(\"mouseup\", function(){\n self._mouseDown = false;\n }, false);\n this._control.addEventListener(\"keydown\", function(){\n self._mouseDown = true;\n }, false);\n this._control.addEventListener(\"keyup\", function(){\n self._mouseDown = false;\n }, false);\n\n this._reader.on('relocated', function(location) {\n if ( ! self._initiated ) { return; }\n if ( ! self._mouseDown ) {\n self._control.value = Math.ceil(self._reader.locations.percentageFromCfi(self._reader.currentLocation().start.cfi) * 100);\n self._update();\n }\n })\n\n },\n\n _action: function() {\n var value = this._control.value;\n var locations = this._reader.locations;\n var cfi = locations.cfiFromPercentage(value / 100);\n this._reader.gotoPage(cfi);\n },\n\n _update: function() {\n var self = this;\n\n var rangeBg = this._background;\n var range = self._control;\n\n var value = parseInt(range.value, 10);\n var percentage = value;\n\n rangeBg.setAttribute('style', 'background-position: ' + (-percentage) + '% 0%, left top;');\n self._control.setAttribute('data-background-position', Math.ceil(percentage));\n\n this._spanCurrentPercentage.innerHTML = percentage + '%';\n var current = this._reader.currentLocation();\n var current_location = this._reader.locations.locationFromCfi(current.start.cfi);\n this._spanCurrentLocation.innerHTML = ( current_location );\n self._last_delta = self._last_value > value; self._last_value = value;\n },\n\n EOT: true\n});\n\nexport var navigator = function(options) {\n return new Navigator(options);\n}\n","import {Control, control} from './Control';\nimport {PageNext, PagePrevious, pageNext, pagePrevious, PageFirst, pageFirst, PageLast, pageLast} from './Control.Paging';\nimport {Contents, contents} from './Control.Contents';\nimport {Title, title} from './Control.Title';\nimport {PublicationMetadata, publicationMetadata} from './Control.PublicationMetadata';\nimport {Preferences, preferences} from './Control.Preferences';\nimport {Widget, widget} from './Control.Widget';\nimport {Citation, citation} from './Control.Citation';\nimport {Search, search} from './Control.Search';\nimport {BibliographicInformation, bibliographicInformation} from './Control.BibliographicInformation';\nimport {Download, download} from './Control.Download';\nimport {Navigator, navigator} from './Control.Navigator';\n\n// import {Zoom, zoom} from './Control.Zoom';\n// import {Attribution, attribution} from './Control.Attribution';\n\nControl.PageNext = PageNext;\nControl.PagePrevious = PagePrevious;\nControl.PageFirst = PageFirst;\nControl.PageLast = PageLast;\ncontrol.pagePrevious = pagePrevious;\ncontrol.pageNext = pageNext;\ncontrol.pageFirst = pageFirst;\ncontrol.pageLast = pageLast;\n\nControl.Contents = Contents;\ncontrol.contents = contents;\n\nControl.Title = Title;\ncontrol.title = title;\n\nControl.PublicationMetadata = PublicationMetadata;\ncontrol.publicationMetadata = publicationMetadata;\n\nControl.Preferences = Preferences;\ncontrol.preferences = preferences;\n\nControl.Widget = Widget;\ncontrol.widget = widget;\n\nControl.Citation = Citation;\ncontrol.citation = citation;\n\nControl.Search = Search;\ncontrol.search = search;\n\nControl.BibliographicInformation = BibliographicInformation;\ncontrol.bibliographicInformation = bibliographicInformation;\n\nControl.Download = Download;\ncontrol.download = download;\n\nControl.Navigator = Navigator;\ncontrol.navigator = navigator;\n\nexport {Control, control};\n","import {Evented} from './Events';\n\nvar Bus = Evented.extend({\n});\n\nvar instance;\nexport var bus = function() {\n return instance || ( instance = new Bus() );\n}\n","import * as Browser from './Browser';\nexport {Browser};\n\nexport {Class} from './Class';\n\nimport {Evented} from './Events';\nexport {Evented};\nexport var Mixin = {Events: Evented.prototype};\n\nimport * as Util from './Util';\nexport {Util};\nexport {extend, bind, stamp, setOptions} from './Util';\nexport {bus} from './Bus';\n","\n// var ePub = window.ePub;\n// export {ePub};\n\nexport function ePub(options) {\n\tif ( window.require !== undefined ) {\n\t\twindow.ePub = require(\"ePub\");\n\t}\n return window.ePub(options);\n}","import * as Util from '../core/Util';\nimport {Reader} from './Reader';\nimport * as epubjs from '../epubjs';\nimport * as DomUtil from '../dom/DomUtil';\nimport * as Browser from '../core/Browser';\n\nReader.EpubJS = Reader.extend({\n\n initialize: function(id, options) {\n Reader.prototype.initialize.apply(this, arguments);\n this._epubjs_ready = false;\n },\n\n open: function(callback) {\n var self = this;\n this._book = epubjs.ePub(this.options.href);\n this._book.loaded.navigation.then(function(toc) {\n self._contents = toc;\n self.metadata = self._book.package.metadata;\n self.fire('updateContents', toc);\n self.fire('updateTitle', self._book.package.metadata);\n })\n this._book.ready.then(function() {\n self._book.locations.generate(1600).then(function(locations) {\n self.fire('updateLocations', locations);\n })\n })\n .then(callback);\n },\n\n draw: function(target, callback) {\n var self = this;\n this.settings = { flow: this.options.flow };\n this.settings.manager = this.options.manager || 'default';\n\n if ( this.options.flow == 'auto' ) {\n this._panes['book'].style.overflow = 'hidden';\n } else {\n this._panes['book'].style.overflow = 'auto';\n }\n\n // start the rendition after all the epub parts \n // have been loaded\n this._book.ready.then(function() {\n\n // have to set fixed dimensions to avoid edge clipping\n var size = self.getFixedBookPanelSize();\n self.settings.height = size.height; // + 'px';\n self.settings.width = size.width; // + 'px';\n self.settings.height = '100%';\n self.settings.width = '100%';\n\n self.settings['ignoreClass'] = 'annotator-hl';\n self._rendition = self._book.renderTo(self._panes['book'], self.settings);\n self._updateFontSize();\n self._bindEvents();\n self._drawn = true;\n\n self._rendition.hooks.content.register(function(contents) {\n self.fire('ready:contents', contents);\n self.fire('readyContents', contents);\n contents.document.addEventListener('keydown', (event) => {\n const keyName = event.key;\n self.fire('keyDown', { keyName: keyName });\n console.log('inner keydown event: ', keyName);\n });\n })\n\n if ( target && target.start ) { target = target.start; }\n if ( ! target && window.location.hash ) {\n if ( window.location.hash.substr(1, 3) == '/6/' ) {\n target = \"epubcfi(\" + window.location.hash.substr(1) + \")\";\n } else {\n target = window.location.hash.substr(2);\n target = self._book.url.path().resolve(target);\n }\n }\n\n self.gotoPage(target, function() {\n window._loaded = true;\n self._initializeReaderStyles();\n\n if ( callback ) { callback(); }\n\n self.fire('opened');\n self.fire('ready');\n self._epubjs_ready = true;\n }) \n })\n },\n\n _scroll: function(delta) {\n var self = this;\n if ( self.options.flow == 'scrolled-doc' ) {\n var container = self._rendition.manager.container;\n var rect = container.getBoundingClientRect();\n var scrollTop = container.scrollTop;\n var newScrollTop = scrollTop;\n var scrollBy = ( rect.height * 0.98 );\n switch(delta) {\n case 'PREV':\n newScrollTop = -( scrollTop + scrollBy );\n break;\n case 'NEXT':\n newScrollTop = ( scrollTop + scrollBy );\n break;\n case 'HOME':\n newScrollTop = 0;\n break;\n case 'END':\n newScrollTop = container.scrollHeight - scrollBy;\n break;\n }\n container.scrollTop = newScrollTop;\n return ( Math.floor(container.scrollTop) != Math.floor(scrollTop) );\n }\n return false;\n },\n\n _navigate: function(promise, callback) {\n var self = this;\n var t = setTimeout(function() {\n self._panes['loader'].style.display = 'block';\n }, 100);\n promise.then(function() {\n clearTimeout(t);\n self._panes['loader'].style.display = 'none';\n if ( callback ) { callback(); }\n }).catch(function(e) {\n clearTimeout(t);\n self._panes['loader'].style.display = 'none';\n if ( callback ) { callback(); }\n throw(e);\n })\n },\n\n next: function() {\n var self = this;\n self._scroll('NEXT') || self._navigate(this._rendition.next());\n },\n\n prev: function() {\n this._scroll('PREV') || this._navigate(this._rendition.prev());\n },\n\n first: function() {\n this._navigate(this._rendition.display(0));\n },\n\n last: function() {\n var self = this;\n var target = this._book.spine.length - 1;\n this._navigate(this._rendition.display(target));\n },\n\n gotoPage: function(target, callback) {\n if ( target ) {\n var section = this._book.spine.get(target);\n if ( ! section ) {\n if ( ! this._epubjs_ready ) {\n target = 0;\n } else {\n return;\n }\n }\n }\n\n this._navigate(this._rendition.display(target), callback);\n },\n\n percentageFromCfi: function(cfi) {\n return this._book.percentageFromCfi(cfi);\n },\n\n destroy: function() {\n if ( this._rendition ) {\n try {\n this._rendition.destroy();\n } catch(e) {}\n }\n this._rendition = null;\n this._drawn = false;\n },\n\n reopen: function(options, target) {\n // different per reader?\n var target = target || this.currentLocation();\n if( target.start ) { target = target.start ; }\n if ( target.cfi ) { target = target.cfi ; }\n\n var doUpdate = false;\n Object.keys(options).forEach(function(key) {\n doUpdate = doUpdate || ( options[key] != this.options[key] );\n }.bind(this));\n\n if ( ! doUpdate ) {\n return;\n }\n\n Util.extend(this.options, options);\n\n if ( this._rendition.settings.flow != options.flow ) {\n if ( this.options.flow == 'auto' || this.options.flow == 'paginated' ) {\n this._panes['book'].style.overflow = 'hidden';\n } else {\n this._panes['book'].style.overflow = 'auto';\n }\n this._rendition.flow(this.options.flow);\n }\n\n this._updateFontSize();\n this._updateTheme();\n this._selectTheme(true);\n },\n\n currentLocation: function() {\n if ( this._rendition && this._rendition.manager ) { \n this._cached_location = this._rendition.currentLocation();\n }\n return this._cached_location;\n },\n\n _bindEvents: function() {\n var self = this;\n\n // add a stylesheet to stop images from breaking their columns\n var add_max_img_styles = false;\n if ( this._book.package.metadata.layout == 'pre-paginated' ) {\n // NOOP\n } else if ( this.options.flow == 'auto' || this.options.flow == 'paginated' ) {\n add_max_img_styles = true;\n }\n\n var custom_stylesheet_rules = [];\n\n // if ( add_max_img_styles ) {\n // // WHY IN HEAVENS NAME?\n // // var style = window.getComputedStyle(this._panes['book']);\n // var style = window.getComputedStyle(this._rendition.manager.container);\n // var height = parseInt(style.getPropertyValue('height'));\n // height -= parseInt(style.getPropertyValue('padding-top'));\n // height -= parseInt(style.getPropertyValue('padding-bottom'));\n // // height -= 100;\n // console.log(\"AHOY\", height, style);\n // custom_stylesheet_rules.push([ 'img', [ 'max-height', height + 'px !important' ], [ 'max-width', '100% !important'], [ 'height', 'auto' ], [ 'width', 'auto' ]]);\n // }\n\n this._updateFontSize();\n\n if ( custom_stylesheet_rules.length ) {\n this._rendition.hooks.content.register(function(view) {\n view.addStylesheetRules(custom_stylesheet_rules);\n })\n }\n\n this._rendition.on('resized', function(box) {\n self.fire('resized', box);\n })\n\n this._rendition.on('relocated', function(location) {\n self.fire('relocated', location);\n })\n\n this._rendition.on(\"locationChanged\", function(location) {\n var view = this.manager.current();\n var section = view.section;\n var current = this.book.navigation.get(section.href);\n\n self.fire(\"updateSection\", current);\n self.fire(\"updateLocation\", location);\n });\n\n this._rendition.on(\"rendered\", function(section, view) {\n if ( view.contents ) {\n view.contents.on(\"linkClicked\", function(href) {\n self._rendition.display(href);\n })\n }\n if ( ! self._rendition.manager.__scroll ) {\n var ticking;\n self._rendition.manager.container.addEventListener(\"scroll\", function(event) {\n if ( ! ticking ) {\n var mod = event.target.scrollLeft % parseInt(self._rendition.manager.layout.delta, 10);\n if ( mod > 0 ) {\n ticking = true;\n var x = Math.floor(event.target.scrollLeft / parseInt(self._rendition.manager.layout.delta, 10)) + 1;\n var delta = ( x * self._rendition.manager.layout.delta) - event.target.scrollLeft;\n self._rendition.manager.scrollBy(delta);\n setTimeout(function() { ticking = false; }, 100);\n }\n }\n })\n self._rendition.manager.views.__scroll = true;\n }\n })\n },\n\n _initializeReaderStyles: function() {\n var self = this;\n var themes = this.options.themes;\n if ( themes ) {\n themes.forEach(function(theme) {\n self._rendition.themes.register(theme['klass'], theme.href ? theme.href : theme.rules);\n })\n }\n\n // base for highlights\n this._rendition.themes.override('.epubjs-hl', \"fill: yellow; fill-opacity: 0.3; mix-blend-mode: multiply;\");\n },\n\n _selectTheme: function(refresh) {\n var theme = this.options.theme || 'default';\n this._rendition.themes.select(theme);\n if ( 0 && refresh ) {\n var cfi = this.currentLocation().end.cfi;\n this._rendition.manager.clear();\n console.log(\"AHOY\", cfi);\n this._rendition.display(cfi);\n }\n },\n\n _updateFontSize: function() {\n var text_size = this.options.text_size == 'auto' ? 100 : this.options.text_size;\n this._rendition.themes.fontSize(`${text_size}%`);\n // if ( this.options.text_size == 'large' ) {\n // this._rendition.themes.fontSize(this.options.fontSizeLarge);\n // } else if ( this.options.text_size == 'small' ) {\n // this._rendition.themes.fontSize(this.options.fontSizeSmall);\n // } else {\n // this._rendition.themes.fontSize(this.options.fontSizeDefault);\n // }\n },\n\n EOT: true\n\n})\n\nObject.defineProperty(Reader.EpubJS.prototype, 'metadata', {\n get: function() {\n // return the combined metadata of configured + book metadata\n return this._metadata;\n },\n\n set: function(data) {\n this._metadata = Util.extend({}, data, this.options.metadata);\n }\n});\n\nObject.defineProperty(Reader.EpubJS.prototype, 'annotations', {\n get: function() {\n // return the combined metadata of configured + book metadata\n if ( Browser.ie ) {\n return {\n reset: function() { /* NOOP */ },\n highlight: function(cfiRange) { /* NOOP */ }\n }\n }\n return this._rendition.annotations;\n }\n});\n\nObject.defineProperty(Reader.EpubJS.prototype, 'locations', {\n get: function() {\n // return the combined metadata of configured + book metadata\n return this._book.locations;\n }\n});\n\nwindow.Reader = Reader;\n\nexport function createReader(id, options) {\n return new Reader.EpubJS(id, options);\n}\n","import * as Util from '../core/Util';\nimport {Reader} from './Reader';\nimport * as DomUtil from '../dom/DomUtil';\n\nReader.Mock = Reader.extend({\n\n initialize: function(id, options) {\n Reader.prototype.initialize.apply(this, arguments);\n },\n\n open: function(callback) {\n var self = this;\n this._book = {\n metadata: {\n title: 'The Mock Life',\n creator: 'Alex Mock',\n publisher: 'University Press',\n location: 'Ann Arbor, MI',\n pubdate: '2017-05-23'\n },\n contents: {\n toc: [\n {id: 1, href: \"/epubs/mock/ops/xhtml/TitlePage.xhtml\", label: \"Title\", parent: null},\n {id: 2, href: \"/epubs/mock/ops/xhtml/Chapter01.xhtml\", label: \"Chapter 1\", parent: null},\n {id: 3, href: \"/epubs/mock/ops/xhtml/Chapter02.xhtml\", label: \"Chapter 2\", parent: null},\n {id: 4, href: \"/epubs/mock/ops/xhtml/Chapter03.xhtml\", label: \"Chapter 3\", parent: null},\n {id: 5, href: \"/epubs/mock/ops/xhtml/Chapter04.xhtml\", label: \"Chapter 4\", parent: null},\n {id: 6, href: \"/epubs/mock/ops/xhtml/Chapter05.xhtml\", label: \"Chapter 5\", parent: null},\n {id: 7, href: \"/epubs/mock/ops/xhtml/Chapter06.xhtml\", label: \"Chapter 6\", parent: null},\n {id: 8, href: \"/epubs/mock/ops/xhtml/Chapter07.xhtml\", label: \"Chapter 7\", parent: null},\n {id: 9, href: \"/epubs/mock/ops/xhtml/Index.xhtml\", label: \"Index\", parent: null},\n ]\n }\n };\n\n this._locations = [\n 'epubcfi(/6/4[TitlePage.xhtml])',\n 'epubcfi(/6/4[Chapter01.xhtml])',\n 'epubcfi(/6/4[Chapter02.xhtml])',\n 'epubcfi(/6/4[Chapter03.xhtml])',\n 'epubcfi(/6/4[Chapter04.xhtml])',\n 'epubcfi(/6/4[Chapter05.xhtml])',\n 'epubcfi(/6/4[Chapter06.xhtml])',\n 'epubcfi(/6/4[Chapter07.xhtml])',\n 'epubcfi(/6/4[Chapter08.xhtml])',\n 'epubcfi(/6/4[Index.xhtml])',\n ];\n\n this.__currentIndex = 0;\n\n this.metadata = this._book.metadata;\n this.fire('updateContents', this._book.contents);\n this.fire('updateTitle', this._metadata);\n this.fire('updateLocations', this._locations);\n callback();\n },\n\n draw: function(target, callback) {\n var self = this;\n this.settings = { flow: this.options.flow };\n this.settings.height = '100%';\n this.settings.width = '99%';\n // this.settings.width = '100%';\n if ( this.options.flow == 'auto' ) {\n this._panes['book'].style.overflow = 'hidden';\n } else {\n this._panes['book'].style.overflow = 'auto';\n }\n if ( typeof(target) == 'function' && cb === undefined ) {\n callback = target;\n target = undefined;\n }\n callback();\n self.fire('ready');\n },\n\n next: function() {\n // this._rendition.next();\n },\n\n prev: function() {\n // this._rendition.prev();\n },\n\n first: function() {\n // this._rendition.display(0);\n },\n\n last: function() {\n },\n\n gotoPage: function(target) {\n if ( typeof(target) == \"string\" ) {\n this.__currentIndex = this._locations.indexOf(target);\n } else {\n this.__currentIndex = target;\n }\n this.fire(\"relocated\", this.currentLocation());\n },\n\n destroy: function() {\n // if ( this._rendition ) {\n // this._rendition.destroy();\n // }\n // this._rendition = null;\n },\n\n currentLocation: function() {\n var cfi = this._locations[this.__currentIndex];\n return {\n start: { cfi: cfi, href: cfi },\n end: { cfi: cfi, href: cfi }\n }\n },\n\n _bindEvents: function() {\n var self = this;\n\n },\n\n _updateTheme: function() {\n\n },\n\n EOT: true\n\n})\n\nObject.defineProperty(Reader.Mock.prototype, 'metadata', {\n get: function() {\n // return the combined metadata of configured + book metadata\n return this._metadata;\n },\n\n set: function(data) {\n this._metadata = Util.extend({}, data, this.options.metadata);\n }\n});\n\nObject.defineProperty(Reader.Mock.prototype, 'locations', {\n get: function() {\n // return the combined metadata of configured + book metadata\n var self = this;\n return {\n total: self._locations.length,\n locationFromCfi: function(cfi) {\n return self._locations.indexOf(cfi);\n },\n percentageFromCfi: function(cfi) {\n var index = self.locations.locationFromCfi(cfi);\n return ( index / self.locations.total );\n },\n cfiFromPercentage: function(percentage) {\n var index = Math.ceil(percentage * 10);\n return self._locations[index];\n }\n }\n }\n});\n\nObject.defineProperty(Reader.Mock.prototype, 'annotations', {\n get: function() {\n return {\n reset: function() {},\n highlight: function() {}\n }\n }\n})\n\nexport function createReader(id, options) {\n return new Reader.Mock(id, options);\n}\n","import {Reader} from './Reader';\nimport * as EpubJS from './Reader.EpubJS';\nimport * as Mock from './Reader.Mock';\n\nvar engines = {\n epubjs: EpubJS.createReader,\n mock: Mock.createReader\n}\n\nexport var reader = function(id, options) {\n options = options || {};\n var engine = options.engine || window.COZY_EPUB_ENGINE || 'epubjs';\n var engine_href = options.engine_href || window.COZY_EPUB_ENGINE_HREF;\n var _this = this;\n var _arguments = arguments;\n\n options.engine = engine;\n options.engine_href = engine_href;\n\n return engines[engine].apply(_this, [id, options]);\n}","\nimport {version} from '../package.json';\nexport {version};\n\n// control\nexport * from './control/index';\n\n// core\nexport * from './core/index';\n\n// dom\nexport * from './dom/index';\n\n// reader\nexport * from './reader/index';\n\n// misc\n\nvar oldCozy = window.cozy;\nexport function noConflict() {\n window.cozy = oldCozy;\n return this;\n}\n"],"names":["extend","dest","i","j","len","src","arguments","length","create","Object","F","proto","prototype","bind","fn","obj","slice","Array","apply","call","args","concat","lastId","stamp","_cozy_id","throttle","time","context","lock","wrapperFn","later","wrapNum","x","range","includeMax","max","min","d","falseFn","formatNum","num","digits","pow","Math","round","isNumeric","isNaN","parseFloat","isFinite","trim","str","replace","splitWords","split","setOptions","options","hasOwnProperty","getParamString","existingUrl","uppercase","params","push","encodeURIComponent","toUpperCase","indexOf","join","templateRe","template","data","key","value","undefined","Error","isArray","toString","array","el","emptyImageUrl","getPrefixed","name","window","lastTime","timeoutDefer","Date","timeToCall","setTimeout","requestFn","requestAnimationFrame","cancelFn","cancelAnimationFrame","id","clearTimeout","requestAnimFrame","immediate","cancelAnimFrame","loader","url","handler","_resolved","callbacks","error","then","cb","resolve","catch","reject","_argv","shift","retval","e","log","trace","element","document","createElement","onload","onerror","async","parent","attr","appendChild","Class","props","NewClass","initialize","callInitHooks","parentProto","__super__","Util","constructor","statics","includes","_initHooks","_initHooksCalled","include","mergeOptions","addInitHook","init","checkDeprecatedMixinEvents","cozy","Mixin","Evented","types","type","_on","_events","_off","typeListeners","newListener","ctx","listeners","l","_firingCount","splice","propagate","listens","event","target","_propagateEvent","_eventParents","once","off","on","fire","layer","addEventListener","removeEventListener","clearAllEventListeners","addOneTimeEventListener","fireEvent","hasEventListeners","style","documentElement","ie","ielt9","edge","navigator","webkit","userAgentContains","android","android23","opera","chrome","gecko","safari","phantom","opera12","win","platform","ie3d","webkit3d","WebKitCSSMatrix","gecko3d","any3d","L_DISABLE_3D","mobile","orientation","mobileWebkit","mobileWebkit3d","msPointer","PointerEvent","MSPointerEvent","pointer","touch","L_NO_TOUCH","DocumentTouch","mobileOpera","mobileGecko","retina","devicePixelRatio","screen","deviceXDPI","logicalXDPI","canvas","getContext","svg","vml","div","innerHTML","shape","firstChild","behavior","babelHelpers.typeof","adj","columnCount","classList","userAgent","toLowerCase","Point","y","point","clone","_add","toPoint","_subtract","_divideBy","_multiplyBy","_round","_floor","floor","_ceil","ceil","sqrt","abs","POINTER_DOWN","Browser","POINTER_MOVE","POINTER_UP","POINTER_CANCEL","TAG_WHITE_LIST","_pointers","_pointerDocListener","_pointersCount","addPointerListener","removePointerListener","_addPointerStart","onDown","pointerType","MSPOINTER_TYPE_MOUSE","tagName","_globalPointerDown","_globalPointerMove","_globalPointerUp","pointerId","_handlePointer","touches","changedTouches","_addPointerMove","onMove","buttons","_addPointerEnd","onUp","_touchstart","_touchend","_pre","addDoubleTapListener","last","doubleTap","delay","onTouchStart","count","now","delta","onTouchEnd","cancelBubble","newTouch","prop","removeDoubleTapListener","touchstart","touchend","dblclick","eventsKey","addOne","originalHandler","isExternalTarget","attachEvent","removeOne","detachEvent","stopPropagation","originalEvent","_stopped","disableScrollPropagation","disableClickPropagation","fakeStop","preventDefault","returnValue","stop","getMousePosition","container","clientX","clientY","rect","getBoundingClientRect","left","clientLeft","top","clientTop","wheelPxFactor","getWheelDelta","wheelDeltaY","deltaY","deltaMode","deltaX","deltaZ","wheelDelta","detail","skipEvents","skipped","events","related","relatedTarget","parentNode","err","lastClick","filterClick","timeStamp","elapsed","_simulatedClick","_simulated","Element","matches","ep","webkitMatchesSelector","msMatchesSelector","mozMatchesSelector","TRANSFORM","testProp","TRANSITION","TRANSITION_END","get","getElementById","getStyle","currentStyle","defaultView","css","getComputedStyle","className","remove","removeChild","empty","toFront","toBack","insertBefore","hasClass","contains","getClass","RegExp","test","addClass","classes","add","removeClass","setClass","baseVal","setOpacity","opacity","_setOpacityIE","filter","filterName","filters","item","Enabled","Opacity","isPropertySupported","setTransform","offset","scale","pos","setPosition","_leaflet_pos","getPosition","disableTextSelection","enableTextSelection","_userSelect","DomEvent","userSelectProperty","disableImageDrag","enableImageDrag","_outlineElement","_outlineStyle","preventOutline","tabIndex","outline","restoreOutline","global","freeGlobal","Symbol","root","symToStringTag","objectProto","nativeObjectToString","getRawTag","objectToString","isObject","baseGetTag","coreJsData","funcProto","funcToString","isMasked","isFunction","toSource","getValue","baseIsNative","defineProperty","getNative","eq","baseAssignValue","assignValue","nativeMax","identity","constant","shortOut","baseSetToString","setToString","overRest","isLength","MAX_SAFE_INTEGER","isArrayLike","isIndex","baseRest","isIterateeCall","isObjectLike","baseIsArguments","stubFalse","argsTag","funcTag","nodeUtil","baseUnary","baseIsTypedArray","isArguments","isBuffer","isTypedArray","baseTimes","overArg","isPrototype","nativeKeys","arrayLikeKeys","baseKeys","createAssigner","copyObject","keys","keyboardAllowed","val","fnMap","ret","eventNameMap","fullscreenchange","fullscreenerror","screenfull","elem","request","requestFullscreen","ALLOW_KEYBOARD_INPUT","exitFullscreen","isFullscreen","exit","callback","eventName","defineProperties","Boolean","fullscreenElement","fullscreenEnabled","Reader","self","localStorage","getItem","assign","JSON","parse","_checkFeatureCompatibility","metadata","_initContainer","_initLayout","themes","forEach","theme","href","klass","rules","rule","new_rule","_updateTheme","_initEvents","_mode","mode","js","engine_href","_start","_loaded","open","draw","flow","currentLocation","destroy","setItem","stringify","_container","dataset","index","back","forward","enabled","toggle","DomUtil","_onScroll","_containerId","_fadeAnimated","fadeAnimation","engine","position","_initPanes","panes","_panes","prefix","_initLoader","_targets","onOff","transform3DLimit","_onMoveEnd","location","location_href","start","_ignoreHistory","tmp_href","substr","pushState","cfi","isTrusted","state","gotoPage","keyName","IGNORE_TARGETS","localName","next","prev","_scroll","scrollTop","scrollLeft","keyCode","srcElement","_fireDOMEvent","targets","synth","_findEventTargets","isMarker","containerPoint","latLngToContainerPoint","getLatLng","mouseEventToContainerPoint","layerPoint","containerPointToLayerPoint","latlng","layerPointToLatLng","nonBubblingEvents","h","clientHeight","paddingTop","paddingBottom","w","clientWidth","paddingRight","paddingLeft","height","width","_drawn","_resizeRequest","_checkMobileDevice","text_size","_isMobile","mobileMediaQuery","matchMedia","body","DOMParser","parseFromString","children","Control","_locked","_id","getTime","parseInt","random","region","reader","_reader","removeControl","addControl","onAdd","getRegion","area","getControlRegion","onRemove","screenX","screenY","getContainer","focus","widget","direction","control","addTo","_controlContainer","parts","tmp","slug","panel","slot","pop","childElement","_classify","_controlRegions","PageControl","_control","querySelector","_className","_createButton","_fill","html","label","_bindEvents","title","link","setAttribute","_action","s","unit","_unit","PagePrevious","PageNext","PageFirst","first","PageLast","pageNext","pagePrevious","pageFirst","pageLast","activeModal","FOCUSABLE_ELEMENTS","ACTIONABLE_ELEMENTS","Modal","onShow","onClose","_initializedEvents","actions","handlers","panelHTML","main","action","button_cls","modal","onClick","onKeydown","onModalTransition","button_id","button","close","closeModal","removeEventListeners","activeElement","_resize","setFocusToFirstNode","addEventListeners","showModal","offsetHeight","offsetWidth","fraction","header","footer","nodes","querySelectorAll","map","focusableNodes","getFocusableNodes","maintainFocus","closeAfterAction","hasAttribute","actionableNodes","getActionableNodes","parentElement","click","did_match","selector","getAttribute","focusedItemIndex","shiftKey","Contents","defaultTemplate","_modal","activate","_setupSkipLink","toc","tuple","chapter","tabindex","option","_createOption","reverse","chapter_","unshift","anchor","textContent","skipLink","ul","contents","Title","h1","_title","_divider","_section","bookTitle","PublicationMetadata","_publisher","_rights","publisher","rights","publicationMetadata","Preferences","_activated","_createPanel","initializeForm","possible_fieldsets","layout","hasThemes","_fieldsets","cls","fieldset","fields","hasFields","field","inputs","input","checked","hint","updatePreferences","_form","doUpdate","new_options","updateForm","deactivate","saveOptions","reopen","Fieldset","_current","TextSize","form","_input","_output","_preview","_updatePreview","fontSize","Display","Theme","preferences","Widget","_onAddExtra","_updateTemplate","_updateClass","node","Button","Panel","Toggle","states","stateName","_resetState","_state","Citation","designMode","formatted","createRange","selectNode","sel","getSelection","removeAllRanges","addRange","flag","execCommand","_message","display","detach","citations","citation","format","text","createTextNode","_formatted","_initializeForm","_formatCitation","selected","Search","_data","_canceled","_processing","_article","searchString","openModalResults","openModalWaiting","submitQuery","_emptyArticle","_buildResults","searchUrl","XMLHttpRequest","status","response","send","hasChildNodes","lastChild","content","annotations","reset","search_results","result","cfiRange","chapterTitle","snippet","highlight","search","BibliographicInformation","dl","metadata_fields","metadata_fields_seen","idx","_formatDate","dt","dd","match","bibliographicInformation","Download","_configureDownloadForm","submit","download_links","size","download","Navigator","_setup","locations","_initiated","_total","total","percentageFromCfi","_last_value","_spanTotalLocations","_update","_createControl","_background","_status","_spanCurrentPercentage","_spanCurrentLocation","_mouseDown","cfiFromPercentage","rangeBg","percentage","current","current_location","locationFromCfi","_last_delta","Bus","instance","bus","Events","ePub","require","EpubJS","_epubjs_ready","_book","epubjs","loaded","navigation","_contents","package","ready","generate","settings","manager","overflow","getFixedBookPanelSize","_rendition","renderTo","_updateFontSize","hooks","register","hash","path","_initializeReaderStyles","newScrollTop","scrollBy","scrollHeight","promise","t","_navigate","spine","section","_selectTheme","_cached_location","add_max_img_styles","custom_stylesheet_rules","view","addStylesheetRules","box","book","__scroll","ticking","mod","views","override","refresh","select","end","clear","_metadata","createReader","Mock","_locations","__currentIndex","engines","COZY_EPUB_ENGINE","COZY_EPUB_ENGINE_HREF","_this","_arguments","oldCozy","noConflict"],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;AAQA,AAAO,SAASA,MAAT,CAAgBC,IAAhB,EAAsB;QACrBC,CAAJ,EAAOC,CAAP,EAAUC,GAAV,EAAeC,GAAf;;SAEKF,IAAI,CAAJ,EAAOC,MAAME,UAAUC,MAA5B,EAAoCJ,IAAIC,GAAxC,EAA6CD,GAA7C,EAAkD;cACxCG,UAAU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;MACIC,aAAaj6B,SAAjB;;UAEQ0gB,MAAR,GAAiBA,MAAjB;UACQtB,WAAR,GAAsBA,WAAtB;;SAEOya,QAAQnZ,MAAR,EAAgB9f,KAAhB,CAAsBo5B,KAAtB,EAA6B,CAAC50B,EAAD,EAAKnC,OAAL,CAA7B,CAAP;CAVK;;ACOP;;AAEA,IAAIi3B,UAAUx1B,OAAO2D,IAArB;AACA,AAAO,SAAS8xB,UAAT,GAAsB;SACpB9xB,IAAP,GAAc6xB,OAAd;SACO,IAAP;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/src/control/Control.Title.js b/src/control/Control.Title.js index 9eb0e69..06c5f73 100644 --- a/src/control/Control.Title.js +++ b/src/control/Control.Title.js @@ -16,27 +16,31 @@ export var Title = Control.extend({ // var control = new DOMParser().parseFromString(template, "text/html").body.firstChild; var h1 = DomUtil.create('h1', 'cozy-h1', container); + DomUtil.setOpacity(h1, 0); this._title = DomUtil.create('span', 'cozy-title', h1); this._divider = DomUtil.create('span', 'cozy-divider', h1); this._divider.textContent = " · "; this._section = DomUtil.create('span', 'cozy-section', h1); - this._reader.on('updateSection', function(data) { - if ( data && data.label ) { - self._section.textContent = data.label; - DomUtil.setOpacity(self._section, 0.0); // TODO: Set to 1.0 when solution to section title is found - DomUtil.setOpacity(self._divider, 0.0); // TODO: Set to 1.0 when solution to section title is found - } else { - DomUtil.setOpacity(self._section, 0); - DomUtil.setOpacity(self._divider, 0); - } - }) + // --- TODO: disable until we can work out how to + // --- more reliably match the current section to the contents + // this._reader.on('updateSection', function(data) { + // if ( data && data.label ) { + // self._section.textContent = data.label; + // DomUtil.setOpacity(self._section, 1.0); + // DomUtil.setOpacity(self._divider, 1.0); + // } else { + // DomUtil.setOpacity(self._section, 0); + // DomUtil.setOpacity(self._divider, 0); + // } + // }) this._reader.on('updateTitle', function(data) { if ( data ) { self._title.textContent = data.title || data.bookTitle; DomUtil.setOpacity(self._section, 0); DomUtil.setOpacity(self._divider, 0); + DomUtil.setOpacity(h1, 1); } })