diff --git a/.eslintrc b/.eslintrc index 628f484..d1a5e75 100644 --- a/.eslintrc +++ b/.eslintrc @@ -25,18 +25,19 @@ }, "globals": { "ENV": true, - "beforeEach": true, - "describe": true, "it": true, + "describe": true, + "beforeEach": true, + "sinon": true, "expect": true, - "sinon": true + "afterEach": true }, "rules": { "no-unused-expressions": 1, "no-extra-boolean-cast": 1, "no-multi-spaces": 2, "no-underscore-dangle": 0, - "comma-dangle": 2, + "comma-dangle": 0, "camelcase": 0, "curly": 2, "eqeqeq": 2, diff --git a/dist/quagga.js b/dist/quagga.js index 0a358b0..e104478 100644 --- a/dist/quagga.js +++ b/dist/quagga.js @@ -45,11 +45,43 @@ return /******/ (function(modules) { // webpackBootstrap /******/ __webpack_require__.p = "/"; /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 163); +/******/ return __webpack_require__(__webpack_require__.s = 222); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ + var isArray = Array.isArray; + + module.e = isArray; + + +/***/ }, +/* 1 */ /***/ function(module, exports, __webpack_require__) { /* @@ -59,9 +91,10 @@ return /******/ (function(modules) { // webpackBootstrap * that can be found in the LICENSE file in the root of the source * tree. */ + /* eslint-env node */ 'use strict'; - var logDisabled_ = false; + var logDisabled_ = true; // Utility methods. var utils = { @@ -80,7 +113,9 @@ return /******/ (function(modules) { // webpackBootstrap if (logDisabled_) { return; } - console.log.apply(console, arguments); + if (typeof console !== 'undefined' && typeof console.log === 'function') { + console.log.apply(console, arguments); + } } }, @@ -110,28 +145,65 @@ return /******/ (function(modules) { // webpackBootstrap result.version = null; result.minVersion = null; + // Fail early if it's not a browser if (typeof window === 'undefined' || !window.navigator) { result.browser = 'Not a browser.'; return result; - } else if (navigator.mozGetUserMedia) { - // Firefox. + } + + // Firefox. + if (navigator.mozGetUserMedia) { result.browser = 'firefox'; result.version = this.extractVersion(navigator.userAgent, /Firefox\/([0-9]+)\./, 1); result.minVersion = 31; - } else if (navigator.webkitGetUserMedia && window.webkitRTCPeerConnection) { - // Chrome, Chromium, WebView, Opera and other WebKit browsers. - result.browser = 'chrome'; - result.version = this.extractVersion(navigator.userAgent, + + // all webkit-based browsers + } else if (navigator.webkitGetUserMedia) { + // Chrome, Chromium, Webview, Opera, all use the chrome shim for now + if (window.webkitRTCPeerConnection) { + result.browser = 'chrome'; + result.version = this.extractVersion(navigator.userAgent, /Chrom(e|ium)\/([0-9]+)\./, 2); - result.minVersion = 38; - } else if(navigator.mediaDevices && + result.minVersion = 38; + + // Safari or unknown webkit-based + // for the time being Safari has support for MediaStreams but not webRTC + } else { + // Safari UA substrings of interest for reference: + // - webkit version: AppleWebKit/602.1.25 (also used in Op,Cr) + // - safari UI version: Version/9.0.3 (unique to Safari) + // - safari UI webkit version: Safari/601.4.4 (also used in Op,Cr) + // + // if the webkit version and safari UI webkit versions are equals, + // ... this is a stable version. + // + // only the internal webkit version is important today to know if + // media streams are supported + // + if (navigator.userAgent.match(/Version\/(\d+).(\d+)/)) { + result.browser = 'safari'; + result.version = this.extractVersion(navigator.userAgent, + /AppleWebKit\/([0-9]+)\./, 1); + result.minVersion = 602; + + // unknown webkit-based browser + } else { + result.browser = 'Unsupported webkit-based browser ' + + 'with GUM support but no WebRTC support.'; + return result; + } + } + + // Edge. + } else if (navigator.mediaDevices && navigator.userAgent.match(/Edge\/(\d+).(\d+)$/)) { - // Edge. result.browser = 'edge'; result.version = this.extractVersion(navigator.userAgent, /Edge\/(\d+).(\d+)$/, 2); result.minVersion = 10547; + + // Default fallthrough: not supported. } else { result.browser = 'Not a supported browser.'; return result; @@ -157,61 +229,13 @@ return /******/ (function(modules) { // webpackBootstrap }; -/***/ }, -/* 1 */ -/***/ function(module, exports, __webpack_require__) { - - /* WEBPACK VAR INJECTION */(function(module, global) {var checkGlobal = __webpack_require__(112); - - /** Used to determine if values are of the language type `Object`. */ - var objectTypes = { - 'function': true, - 'object': true - }; - - /** Detect free variable `exports`. */ - var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) - ? exports - : undefined; - - /** Detect free variable `module`. */ - var freeModule = (objectTypes[typeof module] && module && !module.nodeType) - ? module - : undefined; - - /** Detect free variable `global` from Node.js. */ - var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); - - /** Detect free variable `self`. */ - var freeSelf = checkGlobal(objectTypes[typeof self] && self); - - /** Detect free variable `window`. */ - var freeWindow = checkGlobal(objectTypes[typeof window] && window); - - /** Detect `this` as the global object. */ - var thisGlobal = checkGlobal(objectTypes[typeof this] && this); - - /** - * Used as a reference to the global object. - * - * The `this` value is used if it's the global object to avoid Greasemonkey's - * restricted `window` object, otherwise the `window` object is used. - */ - var root = freeGlobal || - ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || - freeSelf || thisGlobal || Function('return this')(); - - module.e = root; - - /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(54)(module), (function() { return this; }()))) - /***/ }, /* 2 */ /***/ function(module, exports, __webpack_require__) { /** * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static @@ -246,44 +270,25 @@ return /******/ (function(modules) { // webpackBootstrap /* 3 */ /***/ function(module, exports, __webpack_require__) { - /** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @type {Function} - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ - var isArray = Array.isArray; + var freeGlobal = __webpack_require__(68); - module.e = isArray; + /** Detect free variable `self`. */ + var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + + /** Used as a reference to the global object. */ + var root = freeGlobal || freeSelf || Function('return this')(); + + module.e = root; /***/ }, /* 4 */ /***/ function(module, exports, __webpack_require__) { - /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_merge__ = __webpack_require__(17); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_merge__ = __webpack_require__(7); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_merge___default = __WEBPACK_IMPORTED_MODULE_0_lodash_merge__ && __WEBPACK_IMPORTED_MODULE_0_lodash_merge__.__esModule ? function() { return __WEBPACK_IMPORTED_MODULE_0_lodash_merge__['default'] } : function() { return __WEBPACK_IMPORTED_MODULE_0_lodash_merge__; } /* harmony import */ Object.defineProperty(__WEBPACK_IMPORTED_MODULE_0_lodash_merge___default, 'a', { get: __WEBPACK_IMPORTED_MODULE_0_lodash_merge___default }); - /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__barcode_reader__ = __webpack_require__(7); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__barcode_reader__ = __webpack_require__(9); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; @@ -657,39 +662,145 @@ return /******/ (function(modules) { // webpackBootstrap /* 5 */ /***/ function(module, exports, __webpack_require__) { - var getNative = __webpack_require__(6), - root = __webpack_require__(1); + var baseIsNative = __webpack_require__(138), + getValue = __webpack_require__(165); - /* Built-in method references that are verified to be native. */ - var Map = getNative(root, 'Map'); + /** + * 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; + } - module.e = Map; + module.e = getNative; /***/ }, /* 6 */ /***/ function(module, exports, __webpack_require__) { - var isNative = __webpack_require__(148); + var isSymbol = __webpack_require__(42); + + /** Used as references for various `Number` constants. */ + var INFINITY = 1 / 0; /** - * Gets the native function at `key` of `object`. + * Converts `value` to a string key if it's not a string or symbol. * * @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`. + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. */ - function getNative(object, key) { - var value = object[key]; - return isNative(value) ? value : undefined; + function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; } - module.e = getNative; + module.e = toKey; /***/ }, /* 7 */ +/***/ function(module, exports, __webpack_require__) { + + var baseMerge = __webpack_require__(143), + createAssigner = __webpack_require__(159); + + /** + * This method is like `_.assign` except that it recursively merges own and + * inherited enumerable string keyed properties of source objects into the + * destination object. Source properties that resolve to `undefined` are + * skipped if a destination value exists. Array and plain object properties + * are merged recursively. Other objects and value types are overridden by + * assignment. Source objects are applied from left to right. Subsequent + * sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * var object = { + * 'a': [{ 'b': 2 }, { 'd': 4 }] + * }; + * + * var other = { + * 'a': [{ 'c': 3 }, { 'e': 5 }] + * }; + * + * _.merge(object, other); + * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } + */ + var merge = createAssigner(function(object, source, srcIndex) { + baseMerge(object, source, srcIndex); + }); + + module.e = merge; + + +/***/ }, +/* 8 */ +/***/ function(module, exports, __webpack_require__) { + + /* harmony default export */ exports["a"] = { + drawRect: function drawRect(pos, size, ctx, style) { + ctx.strokeStyle = style.color; + ctx.fillStyle = style.color; + ctx.lineWidth = 1; + ctx.beginPath(); + ctx.strokeRect(pos.x, pos.y, size.x, size.y); + }, + drawPath: function drawPath(path, def, ctx, style) { + ctx.strokeStyle = style.color; + ctx.fillStyle = style.color; + ctx.lineWidth = style.lineWidth; + ctx.beginPath(); + ctx.moveTo(path[0][def.x], path[0][def.y]); + for (var j = 1; j < path.length; j++) { + ctx.lineTo(path[j][def.x], path[j][def.y]); + } + ctx.closePath(); + ctx.stroke(); + }, + drawImage: function drawImage(imageData, size, ctx) { + var canvasData = ctx.getImageData(0, 0, size.x, size.y), + data = canvasData.data, + imageDataPos = imageData.length, + canvasDataPos = data.length, + value; + + if (canvasDataPos / imageDataPos !== 4) { + return false; + } + while (imageDataPos--) { + value = imageData[imageDataPos]; + data[--canvasDataPos] = 255; + data[--canvasDataPos] = value; + data[--canvasDataPos] = value; + data[--canvasDataPos] = value; + } + ctx.putImageData(canvasData, 0, 0); + return true; + } + }; + +/***/ }, +/* 9 */ /***/ function(module, exports, __webpack_require__) { function BarcodeReader(config, supplements) { @@ -910,7 +1021,7 @@ return /******/ (function(modules) { // webpackBootstrap /* harmony default export */ exports["a"] = BarcodeReader; /***/ }, -/* 8 */ +/* 10 */ /***/ function(module, exports, __webpack_require__) { module.e = clone @@ -929,56 +1040,141 @@ return /******/ (function(modules) { // webpackBootstrap } /***/ }, -/* 9 */ +/* 11 */ /***/ function(module, exports, __webpack_require__) { - var isObject = __webpack_require__(2); - - /** `Object#toString` result references. */ - var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]'; - - /** Used for built-in method references. */ - var objectProto = Object.prototype; - - /** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ - var objectToString = objectProto.toString; - /** - * Checks if `value` is classified as a `Function` object. + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. * * @static * @memberOf _ - * @since 0.1.0 + * @since 4.0.0 * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * - * _.isFunction(_); + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); * // => true * - * _.isFunction(/abc/); + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); * // => false + * + * _.eq(NaN, NaN); + * // => true */ - function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array and weak map constructors, - // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; + function eq(value, other) { + return value === other || (value !== value && other !== other); } - module.e = isFunction; + module.e = eq; /***/ }, -/* 10 */ +/* 12 */ +/***/ function(module, exports, __webpack_require__) { + + var isArrayLikeObject = __webpack_require__(76); + + /** `Object#toString` result references. */ + var argsTag = '[object Arguments]'; + + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var objectToString = objectProto.toString; + + /** Built-in value references. */ + var propertyIsEnumerable = objectProto.propertyIsEnumerable; + + /** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + function isArguments(value) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && + (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); + } + + module.e = isArguments; + + +/***/ }, +/* 13 */ +/***/ function(module, exports, __webpack_require__) { + + var isFunction = __webpack_require__(40), + isLength = __webpack_require__(41); + + /** + * 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(value.length) && !isFunction(value); + } + + module.e = isArrayLike; + + +/***/ }, +/* 14 */ /***/ function(module, exports, __webpack_require__) { /** @@ -1013,7 +1209,50 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 11 */ +/* 15 */ +/***/ function(module, exports, __webpack_require__) { + + var arrayLikeKeys = __webpack_require__(52), + baseKeys = __webpack_require__(140), + isArrayLike = __webpack_require__(13); + + /** + * 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(object) ? arrayLikeKeys(object) : baseKeys(object); + } + + module.e = keys; + + +/***/ }, +/* 16 */ /***/ function(module, exports, __webpack_require__) { /* harmony default export */ exports["a"] = { @@ -1024,9 +1263,9 @@ return /******/ (function(modules) { // webpackBootstrap } }, - /** - * Shuffles the content of an array - * @return {Array} the array itself shuffled + /** + * Shuffles the content of an array + * @return {Array} the array itself shuffled */ shuffle: function shuffle(arr) { var i = arr.length - 1, @@ -1056,9 +1295,9 @@ return /******/ (function(modules) { // webpackBootstrap return "[" + rows.join(",\r\n") + "]"; }, - /** - * returns the elements which's score is bigger than the threshold - * @return {Array} the reduced array + /** + * returns the elements which's score is bigger than the threshold + * @return {Array} the reduced array */ threshold: function threshold(arr, _threshold, scoreFunc) { var i, @@ -1105,62 +1344,98 @@ return /******/ (function(modules) { // webpackBootstrap }; /***/ }, -/* 12 */ +/* 17 */ /***/ function(module, exports, __webpack_require__) { - /* harmony default export */ exports["a"] = { - drawRect: function drawRect(pos, size, ctx, style) { - ctx.strokeStyle = style.color; - ctx.fillStyle = style.color; - ctx.lineWidth = 1; - ctx.beginPath(); - ctx.strokeRect(pos.x, pos.y, size.x, size.y); - }, - drawPath: function drawPath(path, def, ctx, style) { - ctx.strokeStyle = style.color; - ctx.fillStyle = style.color; - ctx.lineWidth = style.lineWidth; - ctx.beginPath(); - ctx.moveTo(path[0][def.x], path[0][def.y]); - for (var j = 1; j < path.length; j++) { - ctx.lineTo(path[j][def.x], path[j][def.y]); - } - ctx.closePath(); - ctx.stroke(); - }, - drawImage: function drawImage(imageData, size, ctx) { - var canvasData = ctx.getImageData(0, 0, size.x, size.y), - data = canvasData.data, - imageDataPos = imageData.length, - canvasDataPos = data.length, - value; + var listCacheClear = __webpack_require__(179), + listCacheDelete = __webpack_require__(180), + listCacheGet = __webpack_require__(181), + listCacheHas = __webpack_require__(182), + listCacheSet = __webpack_require__(183); - if (canvasDataPos / imageDataPos !== 4) { - return false; - } - while (imageDataPos--) { - value = imageData[imageDataPos]; - data[--canvasDataPos] = 255; - data[--canvasDataPos] = value; - data[--canvasDataPos] = value; - data[--canvasDataPos] = value; - } - ctx.putImageData(canvasData, 0, 0); - return true; - } - }; + /** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function ListCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + // Add methods to `ListCache`. + ListCache.prototype.clear = listCacheClear; + ListCache.prototype['delete'] = listCacheDelete; + ListCache.prototype.get = listCacheGet; + ListCache.prototype.has = listCacheHas; + ListCache.prototype.set = listCacheSet; + + module.e = ListCache; + /***/ }, -/* 13 */ +/* 18 */ +/***/ function(module, exports, __webpack_require__) { + + var ListCache = __webpack_require__(17), + stackClear = __webpack_require__(193), + stackDelete = __webpack_require__(194), + stackGet = __webpack_require__(195), + stackHas = __webpack_require__(196), + stackSet = __webpack_require__(197); + + /** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function Stack(entries) { + this.__data__ = new ListCache(entries); + } + + // Add methods to `Stack`. + Stack.prototype.clear = stackClear; + Stack.prototype['delete'] = stackDelete; + Stack.prototype.get = stackGet; + Stack.prototype.has = stackHas; + Stack.prototype.set = stackSet; + + module.e = Stack; + + +/***/ }, +/* 19 */ +/***/ function(module, exports, __webpack_require__) { + + var root = __webpack_require__(3); + + /** Built-in value references. */ + var Symbol = root.Symbol; + + module.e = Symbol; + + +/***/ }, +/* 20 */ /***/ function(module, exports, __webpack_require__) { - var eq = __webpack_require__(16); + var eq = __webpack_require__(11); /** * Gets the index at which the `key` is found in `array` of key-value pairs. * * @private - * @param {Array} array The array to search. + * @param {Array} array The array to inspect. * @param {*} key The key to search for. * @returns {number} Returns the index of the matched value, else `-1`. */ @@ -1178,144 +1453,145 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 14 */ +/* 21 */ /***/ function(module, exports, __webpack_require__) { + var isKeyable = __webpack_require__(177); + /** - * Checks if `value` is suitable for use as unique object key. + * Gets the data for `map`. * * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. */ - function isKeyable(value) { - var type = typeof value; - return type == 'number' || type == 'boolean' || - (type == 'string' && value != '__proto__') || value == null; + function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; } - module.e = isKeyable; + module.e = getMapData; /***/ }, -/* 15 */ +/* 22 */ /***/ function(module, exports, __webpack_require__) { - var getNative = __webpack_require__(6); - - /* Built-in method references that are verified to be native. */ - var nativeCreate = getNative(Object, 'create'); + /** + * Checks if `value` is a host object in IE < 9. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a host object, else `false`. + */ + function isHostObject(value) { + // Many host objects are `Object` objects that can coerce to strings + // despite having improperly defined `toString` methods. + var result = false; + if (value != null && typeof value.toString != 'function') { + try { + result = !!(value + ''); + } catch (e) {} + } + return result; + } - module.e = nativeCreate; + module.e = isHostObject; /***/ }, -/* 16 */ +/* 23 */ /***/ function(module, exports, __webpack_require__) { + var isArray = __webpack_require__(0), + isSymbol = __webpack_require__(42); + + /** Used to match property names within property paths. */ + var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/; + /** - * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false + * Checks if `value` is a property name and not a property path. * - * _.eq(NaN, NaN); - * // => true + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. */ - function eq(value, other) { - return value === other || (value !== value && other !== other); + function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == 'number' || type == 'symbol' || type == 'boolean' || + value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object)); } - module.e = eq; + module.e = isKey; /***/ }, -/* 17 */ +/* 24 */ /***/ function(module, exports, __webpack_require__) { - var baseMerge = __webpack_require__(107), - createAssigner = __webpack_require__(122); + /** Used for built-in method references. */ + var objectProto = Object.prototype; /** - * This method is like `_.assign` except that it recursively merges own and - * inherited enumerable string keyed properties of source objects into the - * destination object. Source properties that resolve to `undefined` are - * skipped if a destination value exists. Array and plain object properties - * are merged recursively.Other objects and value types are overridden by - * assignment. Source objects are applied from left to right. Subsequent - * sources overwrite property assignments of previous sources. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 0.5.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @example - * - * var users = { - * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] - * }; - * - * var ages = { - * 'data': [{ 'age': 36 }, { 'age': 40 }] - * }; + * Checks if `value` is likely a prototype object. * - * _.merge(users, ages); - * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] } + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. */ - var merge = createAssigner(function(object, source, srcIndex) { - baseMerge(object, source, srcIndex); - }); + function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; - module.e = merge; + return value === proto; + } + + module.e = isPrototype; /***/ }, -/* 18 */ +/* 25 */ +/***/ function(module, exports, __webpack_require__) { + + var getNative = __webpack_require__(5); + + /* Built-in method references that are verified to be native. */ + var nativeCreate = getNative(Object, 'create'); + + module.e = nativeCreate; + + +/***/ }, +/* 26 */ /***/ function(module, exports, __webpack_require__) { - /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cluster__ = __webpack_require__(57); - /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__array_helper__ = __webpack_require__(11); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cluster__ = __webpack_require__(83); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__array_helper__ = __webpack_require__(16); /* harmony export */ exports["f"] = imageRef;/* unused harmony export computeIntegralImage2 *//* unused harmony export computeIntegralImage *//* unused harmony export thresholdImage *//* unused harmony export computeHistogram *//* unused harmony export sharpenLine *//* unused harmony export determineOtsuThreshold *//* harmony export */ exports["c"] = otsuThreshold;/* unused harmony export computeBinaryImage *//* harmony export */ exports["d"] = cluster;/* unused harmony export dilate *//* unused harmony export erode *//* unused harmony export subtract *//* unused harmony export bitwiseOr *//* unused harmony export countNonZero *//* harmony export */ exports["e"] = topGeneric;/* unused harmony export grayArrayFromImage *//* unused harmony export grayArrayFromContext *//* harmony export */ exports["i"] = grayAndHalfSampleFromCanvasData;/* harmony export */ exports["j"] = computeGray;/* unused harmony export loadImageArray *//* harmony export */ exports["g"] = halfSample;/* harmony export */ exports["a"] = hsv2rgb;/* unused harmony export _computeDivisors *//* harmony export */ exports["b"] = calculatePatchSize;/* unused harmony export _parseCSSDimensionValues *//* harmony export */ exports["h"] = computeImageArea; var vec2 = { - clone: __webpack_require__(8) + clone: __webpack_require__(10) }; var vec3 = { - clone: __webpack_require__(87) + clone: __webpack_require__(115) }; - /** - * @param x x-coordinate - * @param y y-coordinate - * @return ImageReference {x,y} Coordinate + /** + * @param x x-coordinate + * @param y y-coordinate + * @return ImageReference {x,y} Coordinate */ function imageRef(x, y) { var that = { @@ -1336,9 +1612,9 @@ return /******/ (function(modules) { // webpackBootstrap return that; }; - /** - * Computes an integral image of a given grayscale image. - * @param imageDataContainer {ImageDataContainer} the image to be integrated + /** + * Computes an integral image of a given grayscale image. + * @param imageDataContainer {ImageDataContainer} the image to be integrated */ function computeIntegralImage2(imageWrapper, integralWrapper) { var imageData = imageWrapper.data; @@ -1883,9 +2159,9 @@ return /******/ (function(modules) { // webpackBootstrap img.src = src; }; - /** - * @param inImg {ImageWrapper} input image to be sampled - * @param outImg {ImageWrapper} to be stored in + /** + * @param inImg {ImageWrapper} input image to be sampled + * @param outImg {ImageWrapper} to be stored in */ function halfSample(inImgWrapper, outImgWrapper) { var inImg = inImgWrapper.data; @@ -2082,27 +2358,27 @@ return /******/ (function(modules) { // webpackBootstrap }; /***/ }, -/* 19 */ +/* 27 */ /***/ function(module, exports, __webpack_require__) { - /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__subImage__ = __webpack_require__(59); - /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__common_cv_utils__ = __webpack_require__(18); - /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__common_array_helper__ = __webpack_require__(11); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__subImage__ = __webpack_require__(86); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__common_cv_utils__ = __webpack_require__(26); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__common_array_helper__ = __webpack_require__(16); var vec2 = { - clone: __webpack_require__(8) + clone: __webpack_require__(10) }; - /** - * Represents a basic image combining the data and size. - * In addition, some methods for manipulation are contained. - * @param size {x,y} The size of the image in pixel - * @param data {Array} If given, a flat array containing the pixel data - * @param ArrayType {Type} If given, the desired DataType of the Array (may be typed/non-typed) - * @param initialize {Boolean} Indicating if the array should be initialized on creation. - * @returns {ImageWrapper} + /** + * Represents a basic image combining the data and size. + * In addition, some methods for manipulation are contained. + * @param size {x,y} The size of the image in pixel + * @param data {Array} If given, a flat array containing the pixel data + * @param ArrayType {Type} If given, the desired DataType of the Array (may be typed/non-typed) + * @param initialize {Boolean} Indicating if the array should be initialized on creation. + * @returns {ImageWrapper} */ function ImageWrapper(size, data, ArrayType, initialize) { if (!data) { @@ -2123,24 +2399,24 @@ return /******/ (function(modules) { // webpackBootstrap this.size = size; } - /** - * tests if a position is within the image with a given offset - * @param imgRef {x, y} The location to test - * @param border Number the padding value in pixel - * @returns {Boolean} true if location inside the image's border, false otherwise - * @see cvd/image.h + /** + * tests if a position is within the image with a given offset + * @param imgRef {x, y} The location to test + * @param border Number the padding value in pixel + * @returns {Boolean} true if location inside the image's border, false otherwise + * @see cvd/image.h */ ImageWrapper.prototype.inImageWithBorder = function (imgRef, border) { return imgRef.x >= border && imgRef.y >= border && imgRef.x < this.size.x - border && imgRef.y < this.size.y - border; }; - /** - * Performs bilinear sampling - * @param inImg Image to extract sample from - * @param x the x-coordinate - * @param y the y-coordinate - * @returns the sampled value - * @see cvd/vision.h + /** + * Performs bilinear sampling + * @param inImg Image to extract sample from + * @param x the x-coordinate + * @param y the y-coordinate + * @returns the sampled value + * @see cvd/vision.h */ ImageWrapper.sample = function (inImg, x, y) { var lx = Math.floor(x); @@ -2159,9 +2435,9 @@ return /******/ (function(modules) { // webpackBootstrap return result; }; - /** - * Initializes a given array. Sets each element to zero. - * @param array {Array} The array to initialize + /** + * Initializes a given array. Sets each element to zero. + * @param array {Array} The array to initialize */ ImageWrapper.clearArray = function (array) { var l = array.length; @@ -2170,20 +2446,20 @@ return /******/ (function(modules) { // webpackBootstrap } }; - /** - * Creates a {SubImage} from the current image ({this}). - * @param from {ImageRef} The position where to start the {SubImage} from. (top-left corner) - * @param size {ImageRef} The size of the resulting image - * @returns {SubImage} A shared part of the original image + /** + * Creates a {SubImage} from the current image ({this}). + * @param from {ImageRef} The position where to start the {SubImage} from. (top-left corner) + * @param size {ImageRef} The size of the resulting image + * @returns {SubImage} A shared part of the original image */ ImageWrapper.prototype.subImage = function (from, size) { return new /* harmony import */__WEBPACK_IMPORTED_MODULE_0__subImage__["a"](from, size, this); }; - /** - * Creates an {ImageWrapper) and copies the needed underlying image-data area - * @param imageWrapper {ImageWrapper} The target {ImageWrapper} where the data should be copied - * @param from {ImageRef} The location where to copy from (top-left location) + /** + * Creates an {ImageWrapper) and copies the needed underlying image-data area + * @param imageWrapper {ImageWrapper} The target {ImageWrapper} where the data should be copied + * @param from {ImageRef} The location where to copy from (top-left location) */ ImageWrapper.prototype.subImageAsCopy = function (imageWrapper, from) { var sizeY = imageWrapper.size.y, @@ -2206,21 +2482,21 @@ return /******/ (function(modules) { // webpackBootstrap } }; - /** - * Retrieves a given pixel position from the image - * @param x {Number} The x-position - * @param y {Number} The y-position - * @returns {Number} The grayscale value at the pixel-position + /** + * Retrieves a given pixel position from the image + * @param x {Number} The x-position + * @param y {Number} The y-position + * @returns {Number} The grayscale value at the pixel-position */ ImageWrapper.prototype.get = function (x, y) { return this.data[y * this.size.x + x]; }; - /** - * Retrieves a given pixel position from the image - * @param x {Number} The x-position - * @param y {Number} The y-position - * @returns {Number} The grayscale value at the pixel-position + /** + * Retrieves a given pixel position from the image + * @param x {Number} The x-position + * @param y {Number} The y-position + * @returns {Number} The grayscale value at the pixel-position */ ImageWrapper.prototype.getSafe = function (x, y) { var i; @@ -2242,20 +2518,20 @@ return /******/ (function(modules) { // webpackBootstrap return this.data[this.indexMapping.y[y + this.size.y] * this.size.x + this.indexMapping.x[x + this.size.x]]; }; - /** - * Sets a given pixel position in the image - * @param x {Number} The x-position - * @param y {Number} The y-position - * @param value {Number} The grayscale value to set - * @returns {ImageWrapper} The Image itself (for possible chaining) + /** + * Sets a given pixel position in the image + * @param x {Number} The x-position + * @param y {Number} The y-position + * @param value {Number} The grayscale value to set + * @returns {ImageWrapper} The Image itself (for possible chaining) */ ImageWrapper.prototype.set = function (x, y, value) { this.data[y * this.size.x + x] = value; return this; }; - /** - * Sets the border of the image (1 pixel) to zero + /** + * Sets the border of the image (1 pixel) to zero */ ImageWrapper.prototype.zeroBorder = function () { var i, @@ -2270,8 +2546,8 @@ return /******/ (function(modules) { // webpackBootstrap } }; - /** - * Inverts a binary image in place + /** + * Inverts a binary image in place */ ImageWrapper.prototype.invert = function () { var data = this.data, @@ -2379,10 +2655,10 @@ return /******/ (function(modules) { // webpackBootstrap return result; }; - /** - * Displays the {ImageWrapper} in a given canvas - * @param canvas {Canvas} The canvas element to write to - * @param scale {Number} Scale which is applied to each pixel-value + /** + * Displays the {ImageWrapper} in a given canvas + * @param canvas {Canvas} The canvas element to write to + * @param scale {Number} Scale which is applied to each pixel-value */ ImageWrapper.prototype.show = function (canvas, scale) { var ctx, frame, data, current, pixel, x, y; @@ -2410,10 +2686,10 @@ return /******/ (function(modules) { // webpackBootstrap ctx.putImageData(frame, 0, 0); }; - /** - * Displays the {SubImage} in a given canvas - * @param canvas {Canvas} The canvas element to write to - * @param scale {Number} Scale which is applied to each pixel-value + /** + * Displays the {SubImage} in a given canvas + * @param canvas {Canvas} The canvas element to write to + * @param scale {Number} Scale which is applied to each pixel-value */ ImageWrapper.prototype.overlay = function (canvas, scale, from) { if (!scale || scale < 0 || scale > 360) { @@ -2442,312 +2718,416 @@ return /******/ (function(modules) { // webpackBootstrap /* harmony default export */ exports["a"] = ImageWrapper; /***/ }, -/* 20 */ +/* 28 */ +/***/ function(module, exports, __webpack_require__) { + + var getNative = __webpack_require__(5), + root = __webpack_require__(3); + + /* Built-in method references that are verified to be native. */ + var Map = getNative(root, 'Map'); + + module.e = Map; + + +/***/ }, +/* 29 */ /***/ function(module, exports, __webpack_require__) { + var mapCacheClear = __webpack_require__(184), + mapCacheDelete = __webpack_require__(185), + mapCacheGet = __webpack_require__(186), + mapCacheHas = __webpack_require__(187), + mapCacheSet = __webpack_require__(188); + /** - * A specialized version of `_.reduce` for arrays without support for - * iteratee shorthands. + * Creates a map cache object to store key-value pairs. * * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initAccum] Specify using the first element of `array` as - * the initial value. - * @returns {*} Returns the accumulated value. + * @constructor + * @param {Array} [entries] The key-value pairs to cache. */ - function arrayReduce(array, iteratee, accumulator, initAccum) { + function MapCache(entries) { var index = -1, - length = array.length; + length = entries ? entries.length : 0; - if (initAccum && length) { - accumulator = array[++index]; - } + this.clear(); while (++index < length) { - accumulator = iteratee(accumulator, array[index], index, array); + var entry = entries[index]; + this.set(entry[0], entry[1]); } - return accumulator; } - module.e = arrayReduce; + // Add methods to `MapCache`. + MapCache.prototype.clear = mapCacheClear; + MapCache.prototype['delete'] = mapCacheDelete; + MapCache.prototype.get = mapCacheGet; + MapCache.prototype.has = mapCacheHas; + MapCache.prototype.set = mapCacheSet; + + module.e = MapCache; /***/ }, -/* 21 */ +/* 30 */ /***/ function(module, exports, __webpack_require__) { - var Uint8Array = __webpack_require__(94); - /** - * Creates a clone of `arrayBuffer`. + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. * * @private - * @param {ArrayBuffer} arrayBuffer The array buffer to clone. - * @returns {ArrayBuffer} Returns the cloned array buffer. + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. */ - function cloneArrayBuffer(arrayBuffer) { - var result = new arrayBuffer.constructor(arrayBuffer.byteLength); - new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + function arrayMap(array, iteratee) { + var index = -1, + length = array ? array.length : 0, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } return result; } - module.e = cloneArrayBuffer; + module.e = arrayMap; /***/ }, -/* 22 */ +/* 31 */ /***/ function(module, exports, __webpack_require__) { - var copyObjectWith = __webpack_require__(120); - /** - * Copies properties of `source` to `object`. + * Appends the elements of `values` to `array`. * * @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. - * @returns {Object} Returns `object`. + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. */ - function copyObject(source, props, object) { - return copyObjectWith(source, props, object); + function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; } - module.e = copyObject; + module.e = arrayPush; /***/ }, -/* 23 */ +/* 32 */ /***/ function(module, exports, __webpack_require__) { + var apply = __webpack_require__(123); + /* Built-in method references for those with the same name as other `lodash` methods. */ - var nativeGetPrototype = Object.getPrototypeOf; + var nativeMax = Math.max; /** - * Gets the `[[Prototype]]` of `value`. + * The base implementation of `_.rest` which doesn't validate or coerce arguments. * * @private - * @param {*} value The value to query. - * @returns {null|Object} Returns the `[[Prototype]]`. + * @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 getPrototype(value) { - return nativeGetPrototype(Object(value)); + function baseRest(func, start) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = array; + return apply(func, this, otherArgs); + }; } - module.e = getPrototype; + module.e = baseRest; /***/ }, -/* 24 */ +/* 33 */ /***/ function(module, exports, __webpack_require__) { + var Uint8Array = __webpack_require__(50); + /** - * Checks if `value` is a host object in IE < 9. + * Creates a clone of `arrayBuffer`. * * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a host object, else `false`. + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. */ - function isHostObject(value) { - // Many host objects are `Object` objects that can coerce to strings - // despite having improperly defined `toString` methods. - var result = false; - if (value != null && typeof value.toString != 'function') { - try { - result = !!(value + ''); - } catch (e) {} - } + function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); return result; } - module.e = isHostObject; + module.e = cloneArrayBuffer; /***/ }, -/* 25 */ +/* 34 */ /***/ function(module, exports, __webpack_require__) { - /** Used as references for various `Number` constants. */ - var MAX_SAFE_INTEGER = 9007199254740991; - - /** Used to detect unsigned integer values. */ - var reIsUint = /^(?:0|[1-9]\d*)$/; + var assignValue = __webpack_require__(55); /** - * Checks if `value` is a valid array-like index. + * Copies properties of `source` to `object`. * * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + * @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 isIndex(value, length) { - value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; - length = length == null ? MAX_SAFE_INTEGER : length; - return value > -1 && value % 1 == 0 && value < length; - } + function copyObject(source, props, object, customizer) { + object || (object = {}); - module.e = isIndex; - - -/***/ }, -/* 26 */ + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + assignValue(object, key, newValue === undefined ? source[key] : newValue); + } + return object; + } + + module.e = copyObject; + + +/***/ }, +/* 35 */ /***/ function(module, exports, __webpack_require__) { - /** Used for built-in method references. */ - var objectProto = Object.prototype; + var overArg = __webpack_require__(39); + + /** Built-in value references. */ + var getPrototype = overArg(Object.getPrototypeOf, Object); + + module.e = getPrototype; + + +/***/ }, +/* 36 */ +/***/ function(module, exports, __webpack_require__) { + + var overArg = __webpack_require__(39), + stubArray = __webpack_require__(80); + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeGetSymbols = Object.getOwnPropertySymbols; /** - * Checks if `value` is likely a prototype object. + * Creates an array of the own enumerable symbol properties of `object`. * * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. */ - function isPrototype(value) { - var Ctor = value && value.constructor, - proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; - - return value === proto; - } + var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray; - module.e = isPrototype; + module.e = getSymbols; /***/ }, -/* 27 */ +/* 37 */ /***/ function(module, exports, __webpack_require__) { - var isArrayLikeObject = __webpack_require__(29); + var DataView = __webpack_require__(116), + Map = __webpack_require__(28), + Promise = __webpack_require__(118), + Set = __webpack_require__(119), + WeakMap = __webpack_require__(120), + baseGetTag = __webpack_require__(132), + toSource = __webpack_require__(75); /** `Object#toString` result references. */ - var argsTag = '[object Arguments]'; + var mapTag = '[object Map]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + setTag = '[object Set]', + weakMapTag = '[object WeakMap]'; + + var dataViewTag = '[object DataView]'; /** Used for built-in method references. */ var objectProto = Object.prototype; - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; - /** * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; - /** Built-in value references. */ - var propertyIsEnumerable = objectProto.propertyIsEnumerable; + /** Used to detect maps, sets, and weakmaps. */ + var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); /** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true + * Gets the `toStringTag` of `value`. * - * _.isArguments([1, 2, 3]); - * // => false + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. */ - function isArguments(value) { - // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. - return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && - (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); + var getTag = baseGetTag; + + // Fallback for data views, maps, sets, and weak maps in IE 11, + // for data views in Edge < 14, and promises in Node.js. + if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = objectToString.call(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : undefined; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; } - module.e = isArguments; + module.e = getTag; /***/ }, -/* 28 */ +/* 38 */ /***/ function(module, exports, __webpack_require__) { - var getLength = __webpack_require__(124), - isFunction = __webpack_require__(9), - isLength = __webpack_require__(30); + /** Used as references for various `Number` constants. */ + var MAX_SAFE_INTEGER = 9007199254740991; + + /** Used to detect unsigned integer values. */ + var reIsUint = /^(?:0|[1-9]\d*)$/; /** - * 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`. + * Checks if `value` is a valid array-like index. * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang + * @private * @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 + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ + function isIndex(value, length) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && + (typeof value == 'number' || reIsUint.test(value)) && + (value > -1 && value % 1 == 0 && value < length); + } + + module.e = isIndex; + + +/***/ }, +/* 39 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Creates a unary function that invokes `func` with its argument transformed. * - * _.isArrayLike(_.noop); - * // => false + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. */ - function isArrayLike(value) { - return value != null && isLength(getLength(value)) && !isFunction(value); + function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; } - module.e = isArrayLike; + module.e = overArg; /***/ }, -/* 29 */ +/* 40 */ /***/ function(module, exports, __webpack_require__) { - var isArrayLike = __webpack_require__(28), - isObjectLike = __webpack_require__(10); + var isObject = __webpack_require__(2); + + /** `Object#toString` result references. */ + var funcTag = '[object Function]', + genTag = '[object GeneratorFunction]'; + + /** Used for built-in method references. */ + var objectProto = Object.prototype; /** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var objectToString = objectProto.toString; + + /** + * Checks if `value` is classified as a `Function` object. * * @static * @memberOf _ - * @since 4.0.0 + * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. * @example * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); + * _.isFunction(_); * // => true * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); + * _.isFunction(/abc/); * // => false */ - function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); + function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8-9 which returns 'object' for typed array and other constructors. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; } - module.e = isArrayLikeObject; + module.e = isFunction; /***/ }, -/* 30 */ +/* 41 */ /***/ function(module, exports, __webpack_require__) { /** Used as references for various `Number` constants. */ @@ -2756,16 +3136,15 @@ return /******/ (function(modules) { // webpackBootstrap /** * Checks if `value` is a valid array-like length. * - * **Note:** This function is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. * @example * * _.isLength(3); @@ -2789,73 +3168,164 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 31 */ +/* 42 */ /***/ function(module, exports, __webpack_require__) { - var baseHas = __webpack_require__(104), - baseKeys = __webpack_require__(105), - indexKeys = __webpack_require__(48), - isArrayLike = __webpack_require__(28), - isIndex = __webpack_require__(25), - isPrototype = __webpack_require__(26); + var isObjectLike = __webpack_require__(14); + + /** `Object#toString` result references. */ + var symbolTag = '[object Symbol]'; + + /** Used for built-in method references. */ + var objectProto = Object.prototype; /** - * 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/6.0/#sec-object.keys) - * for more details. + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var objectToString = objectProto.toString; + + /** + * Checks if `value` is classified as a `Symbol` primitive or object. * * @static - * @since 0.1.0 * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. * @example * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) + * _.isSymbol(Symbol.iterator); + * // => true * - * _.keys('hi'); - * // => ['0', '1'] + * _.isSymbol('abc'); + * // => false */ - function keys(object) { - var isProto = isPrototype(object); - if (!(isProto || isArrayLike(object))) { - return baseKeys(object); - } - var indexes = indexKeys(object), - skipIndexes = !!indexes, - result = indexes || [], - length = result.length; + function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); + } - for (var key in object) { - if (baseHas(object, key) && - !(skipIndexes && (key == 'length' || isIndex(key, length))) && - !(isProto && key == 'constructor')) { - result.push(key); - } - } - return result; + module.e = isSymbol; + + +/***/ }, +/* 43 */ +/***/ function(module, exports, __webpack_require__) { + + var baseIsTypedArray = __webpack_require__(139), + baseUnary = __webpack_require__(64), + nodeUtil = __webpack_require__(190); + + /* Node.js helper references. */ + var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + + /** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ + var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + + module.e = isTypedArray; + + +/***/ }, +/* 44 */ +/***/ function(module, exports, __webpack_require__) { + + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__common_image_debug__ = __webpack_require__(8); + + + function contains(codeResult, list) { + if (list) { + return list.some(function (item) { + return Object.keys(item).every(function (key) { + return item[key] === codeResult[key]; + }); + }); + } + return false; } - module.e = keys; + function passesFilter(codeResult, filter) { + if (typeof filter === 'function') { + return filter(codeResult); + } + return true; + } + + /* harmony default export */ exports["a"] = { + create: function create(config) { + var canvas = document.createElement("canvas"), + ctx = canvas.getContext("2d"), + results = [], + capacity = config.capacity || 20, + capture = config.capture === true; + + function matchesConstraints(codeResult) { + return capacity && codeResult && !contains(codeResult, config.blacklist) && passesFilter(codeResult, config.filter); + } + + return { + addResult: function addResult(data, imageSize, codeResult) { + var result = {}; + + if (matchesConstraints(codeResult)) { + capacity--; + result.codeResult = codeResult; + if (capture) { + canvas.width = imageSize.x; + canvas.height = imageSize.y; + /* harmony import */__WEBPACK_IMPORTED_MODULE_0__common_image_debug__["a"].drawImage(data, imageSize, ctx); + result.frame = canvas.toDataURL(); + } + results.push(result); + } + }, + getResults: function getResults() { + return results; + } + }; + } + }; +/***/ }, +/* 45 */ +/***/ function(module, exports, __webpack_require__) { + + var config = void 0; + + if (true) { + config = __webpack_require__(88); + } else if (ENV.node) { + config = require('./config.node.js'); + } else { + config = require('./config.prod.js'); + } + + /* harmony default export */ exports["a"] = config; /***/ }, -/* 32 */ +/* 46 */ /***/ function(module, exports, __webpack_require__) { - /** - * http://www.codeproject.com/Tips/407172/Connected-Component-Labeling-and-Vectorization + /** + * http://www.codeproject.com/Tips/407172/Connected-Component-Labeling-and-Vectorization */ var Tracer = { searchDirections: [[0, 1], [1, 1], [1, 0], [1, -1], [0, -1], [-1, -1], [-1, 0], [-1, 1]], @@ -2955,11 +3425,11 @@ return /******/ (function(modules) { // webpackBootstrap /* harmony default export */ exports["a"] = Tracer; /***/ }, -/* 33 */ +/* 47 */ /***/ function(module, exports, __webpack_require__) { - /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__barcode_reader__ = __webpack_require__(7); - /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__common_array_helper__ = __webpack_require__(11); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__barcode_reader__ = __webpack_require__(9); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__common_array_helper__ = __webpack_require__(16); @@ -3173,7 +3643,7 @@ return /******/ (function(modules) { // webpackBootstrap /* harmony default export */ exports["a"] = Code39Reader; /***/ }, -/* 34 */ +/* 48 */ /***/ function(module, exports, __webpack_require__) { module.e = dot @@ -3190,57 +3660,52 @@ return /******/ (function(modules) { // webpackBootstrap } /***/ }, -/* 35 */ +/* 49 */ /***/ function(module, exports, __webpack_require__) { - var stackClear = __webpack_require__(141), - stackDelete = __webpack_require__(142), - stackGet = __webpack_require__(143), - stackHas = __webpack_require__(144), - stackSet = __webpack_require__(145); + var MapCache = __webpack_require__(29), + setCacheAdd = __webpack_require__(191), + setCacheHas = __webpack_require__(192); /** - * Creates a stack cache object to store key-value pairs. + * + * Creates an array cache object to store unique values. * * @private * @constructor * @param {Array} [values] The values to cache. */ - function Stack(values) { + function SetCache(values) { var index = -1, length = values ? values.length : 0; - this.clear(); + this.__data__ = new MapCache; while (++index < length) { - var entry = values[index]; - this.set(entry[0], entry[1]); + this.add(values[index]); } } - // Add methods to `Stack`. - Stack.prototype.clear = stackClear; - Stack.prototype['delete'] = stackDelete; - Stack.prototype.get = stackGet; - Stack.prototype.has = stackHas; - Stack.prototype.set = stackSet; + // Add methods to `SetCache`. + SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; + SetCache.prototype.has = setCacheHas; - module.e = Stack; + module.e = SetCache; /***/ }, -/* 36 */ +/* 50 */ /***/ function(module, exports, __webpack_require__) { - var root = __webpack_require__(1); + var root = __webpack_require__(3); /** Built-in value references. */ - var Symbol = root.Symbol; + var Uint8Array = root.Uint8Array; - module.e = Symbol; + module.e = Uint8Array; /***/ }, -/* 37 */ +/* 51 */ /***/ function(module, exports, __webpack_require__) { /** @@ -3248,13 +3713,13 @@ return /******/ (function(modules) { // webpackBootstrap * iteratee shorthands. * * @private - * @param {Array} array The array to iterate over. + * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns `array`. */ function arrayEach(array, iteratee) { var index = -1, - length = array.length; + length = array ? array.length : 0; while (++index < length) { if (iteratee(array[index], index, array) === false) { @@ -3268,36 +3733,87 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 38 */ +/* 52 */ /***/ function(module, exports, __webpack_require__) { + var baseTimes = __webpack_require__(147), + isArguments = __webpack_require__(12), + isArray = __webpack_require__(0), + isIndex = __webpack_require__(38); + + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + /** - * Appends the elements of `values` to `array`. + * Creates an array of the enumerable property names of the array-like `value`. * * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to append. - * @returns {Array} Returns `array`. + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. */ - function arrayPush(array, values) { + function arrayLikeKeys(value, inherited) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + // Safari 9 makes `arguments.length` enumerable in strict mode. + var result = (isArray(value) || isArguments(value)) + ? baseTimes(value.length, String) + : []; + + var length = result.length, + skipIndexes = !!length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && (key == 'length' || isIndex(key, length)))) { + result.push(key); + } + } + return result; + } + + module.e = arrayLikeKeys; + + +/***/ }, +/* 53 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * A specialized version of `_.reduce` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the first element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ + function arrayReduce(array, iteratee, accumulator, initAccum) { var index = -1, - length = values.length, - offset = array.length; + length = array ? array.length : 0; + if (initAccum && length) { + accumulator = array[++index]; + } while (++index < length) { - array[offset + index] = values[index]; + accumulator = iteratee(accumulator, array[index], index, array); } - return array; + return accumulator; } - module.e = arrayPush; + module.e = arrayReduce; /***/ }, -/* 39 */ +/* 54 */ /***/ function(module, exports, __webpack_require__) { - var eq = __webpack_require__(16); + var eq = __webpack_require__(11); /** * This function is like `assignValue` except that it doesn't assign @@ -3319,10 +3835,10 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 40 */ +/* 55 */ /***/ function(module, exports, __webpack_require__) { - var eq = __webpack_require__(16); + var eq = __webpack_require__(11); /** Used for built-in method references. */ var objectProto = Object.prototype; @@ -3332,7 +3848,7 @@ return /******/ (function(modules) { // webpackBootstrap /** * Assigns `value` to `key` of `object` if the existing value is not equivalent - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * @private @@ -3352,1198 +3868,1032 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 41 */ +/* 56 */ /***/ function(module, exports, __webpack_require__) { - var assocIndexOf = __webpack_require__(13); - - /** Used for built-in method references. */ - var arrayProto = Array.prototype; - - /** Built-in value references. */ - var splice = arrayProto.splice; + var arrayPush = __webpack_require__(31), + isFlattenable = __webpack_require__(175); /** - * Removes `key` and its value from the associative array. + * The base implementation of `_.flatten` with support for restricting flattening. * * @private - * @param {Array} array The array to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. */ - function assocDelete(array, key) { - var index = assocIndexOf(array, key); - if (index < 0) { - return false; - } - var lastIndex = array.length - 1; - if (index == lastIndex) { - array.pop(); - } else { - splice.call(array, index, 1); + function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; + + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } } - return true; + return result; } - module.e = assocDelete; + module.e = baseFlatten; /***/ }, -/* 42 */ +/* 57 */ /***/ function(module, exports, __webpack_require__) { - var assocIndexOf = __webpack_require__(13); + var castPath = __webpack_require__(65), + isKey = __webpack_require__(23), + toKey = __webpack_require__(6); /** - * Gets the associative array value for `key`. + * The base implementation of `_.get` without support for default values. * * @private - * @param {Array} array The array to query. - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. */ - function assocGet(array, key) { - var index = assocIndexOf(array, key); - return index < 0 ? undefined : array[index][1]; + function baseGet(object, path) { + path = isKey(path, object) ? [path] : castPath(path); + + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + return (index && index == length) ? object : undefined; } - module.e = assocGet; + module.e = baseGet; /***/ }, -/* 43 */ +/* 58 */ /***/ function(module, exports, __webpack_require__) { - var assocIndexOf = __webpack_require__(13); + var arrayPush = __webpack_require__(31), + isArray = __webpack_require__(0); /** - * Checks if an associative array value for `key` exists. + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. * * @private - * @param {Array} array The array to query. - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. */ - function assocHas(array, key) { - return assocIndexOf(array, key) > -1; + function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); } - module.e = assocHas; + module.e = baseGetAllKeys; /***/ }, -/* 44 */ +/* 59 */ /***/ function(module, exports, __webpack_require__) { - var assocIndexOf = __webpack_require__(13); + var baseIsEqualDeep = __webpack_require__(135), + isObject = __webpack_require__(2), + isObjectLike = __webpack_require__(14); /** - * Sets the associative array `key` to `value`. + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. * * @private - * @param {Array} array The array to modify. - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - */ - function assocSet(array, key, value) { - var index = assocIndexOf(array, key); - if (index < 0) { - array.push([key, value]); - } else { - array[index][1] = value; + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparisons. + * @param {boolean} [bitmask] The bitmask of comparison flags. + * The bitmask may be composed of the following flags: + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ + function baseIsEqual(value, other, customizer, bitmask, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) { + return value !== value && other !== other; } + return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack); } - module.e = assocSet; + module.e = baseIsEqual; /***/ }, -/* 45 */ +/* 60 */ /***/ function(module, exports, __webpack_require__) { + var baseMatches = __webpack_require__(141), + baseMatchesProperty = __webpack_require__(142), + identity = __webpack_require__(201), + isArray = __webpack_require__(0), + property = __webpack_require__(209); + /** - * Copies the values of `source` to `array`. + * The base implementation of `_.iteratee`. * * @private - * @param {Array} source The array to copy values from. - * @param {Array} [array=[]] The array to copy values to. - * @returns {Array} Returns `array`. + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. */ - function copyArray(source, array) { - var index = -1, - length = source.length; - - array || (array = Array(length)); - while (++index < length) { - array[index] = source[index]; + function baseIteratee(value) { + // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. + // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. + if (typeof value == 'function') { + return value; } - return array; + if (value == null) { + return identity; + } + if (typeof value == 'object') { + return isArray(value) + ? baseMatchesProperty(value[0], value[1]) + : baseMatches(value); + } + return property(value); } - module.e = copyArray; + module.e = baseIteratee; /***/ }, -/* 46 */ +/* 61 */ /***/ function(module, exports, __webpack_require__) { - /** Built-in value references. */ - var getOwnPropertySymbols = Object.getOwnPropertySymbols; + var isObject = __webpack_require__(2), + isPrototype = __webpack_require__(24), + nativeKeysIn = __webpack_require__(189); + + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; /** - * Creates an array of the own enumerable symbol properties of `object`. + * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. * * @private * @param {Object} object The object to query. - * @returns {Array} Returns the array of symbols. + * @returns {Array} Returns the array of property names. */ - function getSymbols(object) { - // Coerce `object` to an object to avoid non-object errors in V8. - // See https://bugs.chromium.org/p/v8/issues/detail?id=3443 for more details. - return getOwnPropertySymbols(Object(object)); - } + function baseKeysIn(object) { + if (!isObject(object)) { + return nativeKeysIn(object); + } + var isProto = isPrototype(object), + result = []; - // Fallback for IE < 11. - if (!getOwnPropertySymbols) { - getSymbols = function() { - return []; - }; + for (var key in object) { + if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; } - module.e = getSymbols; + module.e = baseKeysIn; /***/ }, -/* 47 */ +/* 62 */ /***/ function(module, exports, __webpack_require__) { - var nativeCreate = __webpack_require__(15); - - /** Used for built-in method references. */ - var objectProto = Object.prototype; - - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; + var basePickBy = __webpack_require__(63); /** - * Checks if a hash value for `key` exists. + * The base implementation of `_.pick` without support for individual + * property identifiers. * * @private - * @param {Object} hash The hash to query. - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + * @param {Object} object The source object. + * @param {string[]} props The property identifiers to pick. + * @returns {Object} Returns the new object. */ - function hashHas(hash, key) { - return nativeCreate ? hash[key] !== undefined : hasOwnProperty.call(hash, key); + function basePick(object, props) { + object = Object(object); + return basePickBy(object, props, function(value, key) { + return key in object; + }); } - module.e = hashHas; + module.e = basePick; /***/ }, -/* 48 */ +/* 63 */ /***/ function(module, exports, __webpack_require__) { - var baseTimes = __webpack_require__(111), - isArguments = __webpack_require__(27), - isArray = __webpack_require__(3), - isLength = __webpack_require__(30), - isString = __webpack_require__(150); - /** - * Creates an array of index keys for `object` values of arrays, - * `arguments` objects, and strings, otherwise `null` is returned. + * The base implementation of `_.pickBy` without support for iteratee shorthands. * * @private - * @param {Object} object The object to query. - * @returns {Array|null} Returns index keys, else `null`. + * @param {Object} object The source object. + * @param {string[]} props The property identifiers to pick from. + * @param {Function} predicate The function invoked per property. + * @returns {Object} Returns the new object. */ - function indexKeys(object) { - var length = object ? object.length : undefined; - if (isLength(length) && - (isArray(object) || isString(object) || isArguments(object))) { - return baseTimes(length, String); + function basePickBy(object, props, predicate) { + var index = -1, + length = props.length, + result = {}; + + while (++index < length) { + var key = props[index], + value = object[key]; + + if (predicate(value, key)) { + result[key] = value; + } } - return null; + return result; } - module.e = indexKeys; + module.e = basePickBy; /***/ }, -/* 49 */ +/* 64 */ /***/ function(module, exports, __webpack_require__) { - var isFunction = __webpack_require__(9), - toString = __webpack_require__(155); - - /** Used to resolve the decompiled source of functions. */ - var funcToString = Function.prototype.toString; - /** - * Converts `func` to its source code. + * The base implementation of `_.unary` without support for storing metadata. * * @private - * @param {Function} func The function to process. - * @returns {string} Returns the source code. + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. */ - function toSource(func) { - if (isFunction(func)) { - try { - return funcToString.call(func); - } catch (e) {} - } - return toString(func); + function baseUnary(func) { + return function(value) { + return func(value); + }; } - module.e = toSource; + module.e = baseUnary; /***/ }, -/* 50 */ +/* 65 */ /***/ function(module, exports, __webpack_require__) { - var isObjectLike = __webpack_require__(10); - - /** `Object#toString` result references. */ - var symbolTag = '[object Symbol]'; - - /** Used for built-in method references. */ - var objectProto = Object.prototype; + var isArray = __webpack_require__(0), + stringToPath = __webpack_require__(198); /** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast property path array. */ - var objectToString = objectProto.toString; + function castPath(value) { + return isArray(value) ? value : stringToPath(value); + } + module.e = castPath; + + +/***/ }, +/* 66 */ +/***/ function(module, exports, __webpack_require__) { + /** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true + * Copies the values of `source` to `array`. * - * _.isSymbol('abc'); - * // => false + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. */ - function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString.call(value) == symbolTag); + function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; } - module.e = isSymbol; + module.e = copyArray; /***/ }, -/* 51 */ +/* 67 */ /***/ function(module, exports, __webpack_require__) { - var isLength = __webpack_require__(30), - isObjectLike = __webpack_require__(10); - - /** `Object#toString` result references. */ - var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - mapTag = '[object Map]', - numberTag = '[object Number]', - objectTag = '[object Object]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - weakMapTag = '[object WeakMap]'; + var SetCache = __webpack_require__(49), + arraySome = __webpack_require__(126); - var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; + /** Used to compose bitmasks for comparison styles. */ + var UNORDERED_COMPARE_FLAG = 1, + PARTIAL_COMPARE_FLAG = 2; - /** Used to identify `toStringTag` values of typed arrays. */ - var typedArrayTags = {}; - typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = - typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = - typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = - typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = - typedArrayTags[uint32Tag] = true; - typedArrayTags[argsTag] = typedArrayTags[arrayTag] = - typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = - typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = - typedArrayTags[errorTag] = typedArrayTags[funcTag] = - typedArrayTags[mapTag] = typedArrayTags[numberTag] = - typedArrayTags[objectTag] = typedArrayTags[regexpTag] = - typedArrayTags[setTag] = typedArrayTags[stringTag] = - typedArrayTags[weakMapTag] = false; + /** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ + function equalArrays(array, other, equalFunc, customizer, bitmask, stack) { + var isPartial = bitmask & PARTIAL_COMPARE_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(array); + if (stacked && stack.get(other)) { + return stacked == other; + } + var index = -1, + result = true, + seen = (bitmask & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined; - /** Used for built-in method references. */ - var objectProto = Object.prototype; + stack.set(array, other); + stack.set(other, array); - /** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ - var objectToString = objectProto.toString; + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; - /** - * Checks if `value` is classified as a typed array. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isTypedArray(new Uint8Array); - * // => true - * - * _.isTypedArray([]); - * // => false - */ - function isTypedArray(value) { - return isObjectLike(value) && - isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!seen.has(othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) { + return seen.add(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, customizer, bitmask, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + stack['delete'](other); + return result; } - module.e = isTypedArray; + module.e = equalArrays; /***/ }, -/* 52 */ +/* 68 */ /***/ function(module, exports, __webpack_require__) { - var baseKeysIn = __webpack_require__(106), - indexKeys = __webpack_require__(48), - isIndex = __webpack_require__(25), - isPrototype = __webpack_require__(26); + /* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */ + var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; - /** Used for built-in method references. */ - var objectProto = Object.prototype; + module.e = freeGlobal; - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; + /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) + +/***/ }, +/* 69 */ +/***/ function(module, exports, __webpack_require__) { + + var baseGetAllKeys = __webpack_require__(58), + getSymbolsIn = __webpack_require__(164), + keysIn = __webpack_require__(78); /** - * Creates an array of the own and inherited enumerable property names of `object`. + * Creates an array of own and inherited enumerable property names and + * symbols of `object`. * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Object + * @private * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } + * @returns {Array} Returns the array of property names and symbols. + */ + function getAllKeysIn(object) { + return baseGetAllKeys(object, keysIn, getSymbolsIn); + } + + module.e = getAllKeysIn; + + +/***/ }, +/* 70 */ +/***/ function(module, exports, __webpack_require__) { + + var isObject = __webpack_require__(2); + + /** + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. * - * Foo.prototype.c = 3; + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. + */ + function isStrictComparable(value) { + return value === value && !isObject(value); + } + + module.e = isStrictComparable; + + +/***/ }, +/* 71 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Converts `map` to its key-value pairs. * - * _.keysIn(new Foo); - * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. */ - function keysIn(object) { + function mapToArray(map) { var index = -1, - isProto = isPrototype(object), - props = baseKeysIn(object), - propsLength = props.length, - indexes = indexKeys(object), - skipIndexes = !!indexes, - result = indexes || [], - length = result.length; + result = Array(map.size); - while (++index < propsLength) { - var key = props[index]; - if (!(skipIndexes && (key == 'length' || isIndex(key, length))) && - !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { - result.push(key); - } - } + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); return result; } - module.e = keysIn; + module.e = mapToArray; /***/ }, -/* 53 */ +/* 72 */ /***/ function(module, exports, __webpack_require__) { - var apply = __webpack_require__(98), - toInteger = __webpack_require__(152); - - /** Used as the `TypeError` message for "Functions" methods. */ - var FUNC_ERROR_TEXT = 'Expected a function'; - - /* Built-in method references for those with the same name as other `lodash` methods. */ - var nativeMax = Math.max; - /** - * Creates a function that invokes `func` with the `this` binding of the - * created function and arguments from `start` and beyond provided as - * an array. - * - * **Note:** This method is based on the - * [rest parameter](https://mdn.io/rest_parameters). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Function - * @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. - * @example + * A specialized version of `matchesProperty` for source values suitable + * for strict equality comparisons, i.e. `===`. * - * var say = _.rest(function(what, names) { - * return what + ' ' + _.initial(names).join(', ') + - * (_.size(names) > 1 ? ', & ' : '') + _.last(names); - * }); - * - * say('hello', 'fred', 'barney', 'pebbles'); - * // => 'hello fred, barney, & pebbles' + * @private + * @param {string} key The key of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. */ - function rest(func, start) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - start = nativeMax(start === undefined ? (func.length - 1) : toInteger(start), 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - array = Array(length); - - while (++index < length) { - array[index] = args[start + index]; - } - switch (start) { - case 0: return func.call(this, array); - case 1: return func.call(this, args[0], array); - case 2: return func.call(this, args[0], args[1], array); - } - var otherArgs = Array(start + 1); - index = -1; - while (++index < start) { - otherArgs[index] = args[index]; + function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; } - otherArgs[start] = array; - return apply(func, this, otherArgs); + return object[key] === srcValue && + (srcValue !== undefined || (key in Object(object))); }; } - module.e = rest; + module.e = matchesStrictComparable; /***/ }, -/* 54 */ +/* 73 */ /***/ function(module, exports, __webpack_require__) { - module.e = function(module) { - if(!module.webpackPolyfill) { - module.deprecate = function() {}; - module.paths = []; - // module.parent = undefined by default - module.children = []; - Object.defineProperty(module, "exports", { - enumerable: true, - configurable: false, - get: function() { return module.e; }, - set: function(v) { return module.e = v; } - }); - Object.defineProperty(module, "loaded", { - enumerable: true, - configurable: false, - get: function() { return module.l; } - }); - Object.defineProperty(module, "id", { - enumerable: true, - configurable: false, - get: function() { return module.i; } - }); - module.webpackPolyfill = 1; - } - return module; - } + var overArg = __webpack_require__(39); + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeKeys = overArg(Object.keys, Object); + + module.e = nativeKeys; /***/ }, -/* 55 */ +/* 74 */ /***/ function(module, exports, __webpack_require__) { - /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_merge__ = __webpack_require__(17); - /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_merge___default = __WEBPACK_IMPORTED_MODULE_0_lodash_merge__ && __WEBPACK_IMPORTED_MODULE_0_lodash_merge__.__esModule ? function() { return __WEBPACK_IMPORTED_MODULE_0_lodash_merge__['default'] } : function() { return __WEBPACK_IMPORTED_MODULE_0_lodash_merge__; } - /* harmony import */ Object.defineProperty(__WEBPACK_IMPORTED_MODULE_0_lodash_merge___default, 'a', { get: __WEBPACK_IMPORTED_MODULE_0_lodash_merge___default }); - /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__common_typedefs__ = __webpack_require__(60); - /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__common_typedefs___default = __WEBPACK_IMPORTED_MODULE_1__common_typedefs__ && __WEBPACK_IMPORTED_MODULE_1__common_typedefs__.__esModule ? function() { return __WEBPACK_IMPORTED_MODULE_1__common_typedefs__['default'] } : function() { return __WEBPACK_IMPORTED_MODULE_1__common_typedefs__; } - /* harmony import */ Object.defineProperty(__WEBPACK_IMPORTED_MODULE_1__common_typedefs___default, 'a', { get: __WEBPACK_IMPORTED_MODULE_1__common_typedefs___default }); - /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_webrtc_adapter__ = __webpack_require__(156); - /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_webrtc_adapter___default = __WEBPACK_IMPORTED_MODULE_2_webrtc_adapter__ && __WEBPACK_IMPORTED_MODULE_2_webrtc_adapter__.__esModule ? function() { return __WEBPACK_IMPORTED_MODULE_2_webrtc_adapter__['default'] } : function() { return __WEBPACK_IMPORTED_MODULE_2_webrtc_adapter__; } - /* harmony import */ Object.defineProperty(__WEBPACK_IMPORTED_MODULE_2_webrtc_adapter___default, 'a', { get: __WEBPACK_IMPORTED_MODULE_2_webrtc_adapter___default }); - /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__common_image_wrapper__ = __webpack_require__(19); - /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__locator_barcode_locator__ = __webpack_require__(70); - /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__decoder_barcode_decoder__ = __webpack_require__(63); - /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__common_events__ = __webpack_require__(58); - /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__input_camera_access__ = __webpack_require__(65); - /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__common_image_debug__ = __webpack_require__(12); - /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__analytics_result_collector__ = __webpack_require__(56); - /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__config_config__ = __webpack_require__(62); - /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_input_stream__ = __webpack_require__(69); - /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12_frame_grabber__ = __webpack_require__(67); - + /** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ + function setToArray(set) { + var index = -1, + result = Array(set.size); - var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + set.forEach(function(value) { + result[++index] = value; + }); + return result; + } - // eslint-disable-line no-unused-vars - // eslint-disable-line no-unused-vars + module.e = setToArray; + + +/***/ }, +/* 75 */ +/***/ function(module, exports, __webpack_require__) { + + /** Used for built-in method references. */ + var funcProto = Function.prototype; + /** Used to resolve the decompiled source of functions. */ + var funcToString = funcProto.toString; + /** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to process. + * @returns {string} Returns the source code. + */ + function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; + } + module.e = toSource; + + +/***/ }, +/* 76 */ +/***/ function(module, exports, __webpack_require__) { + + var isArrayLike = __webpack_require__(13), + isObjectLike = __webpack_require__(14); + /** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ + function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); + } + module.e = isArrayLikeObject; + + +/***/ }, +/* 77 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(3), + stubFalse = __webpack_require__(210); + /** Detect free variable `exports`. */ + var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + /** Detect free variable `module`. */ + var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + /** Detect the popular CommonJS extension `module.exports`. */ + var moduleExports = freeModule && freeModule.exports === freeExports; + /** Built-in value references. */ + var Buffer = moduleExports ? root.Buffer : undefined; + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; - var vec2 = { - clone: __webpack_require__(8) - }; + /** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ + var isBuffer = nativeIsBuffer || stubFalse; - var _inputStream, - _framegrabber, - _stopped, - _canvasContainer = { - ctx: { - image: null, - overlay: null - }, - dom: { - image: null, - overlay: null - } - }, - _inputImageWrapper, - _boxSize, - _decoder, - _workerPool = [], - _onUIThread = true, - _resultCollector, - _config = {}; - - function initializeData(imageWrapper) { - initBuffers(imageWrapper); - _decoder = /* harmony import */__WEBPACK_IMPORTED_MODULE_5__decoder_barcode_decoder__["a"].create(_config.decoder, _inputImageWrapper); - } - - function initInputStream(cb) { - var video; - if (_config.inputStream.type === "VideoStream") { - video = document.createElement("video"); - _inputStream = /* harmony import */__WEBPACK_IMPORTED_MODULE_11_input_stream__["a"].createVideoStream(video); - } else if (_config.inputStream.type === "ImageStream") { - _inputStream = /* harmony import */__WEBPACK_IMPORTED_MODULE_11_input_stream__["a"].createImageStream(); - } else if (_config.inputStream.type === "LiveStream") { - var $viewport = getViewPort(); - if ($viewport) { - video = $viewport.querySelector("video"); - if (!video) { - video = document.createElement("video"); - $viewport.appendChild(video); - } - } - _inputStream = /* harmony import */__WEBPACK_IMPORTED_MODULE_11_input_stream__["a"].createLiveStream(video); - /* harmony import */__WEBPACK_IMPORTED_MODULE_7__input_camera_access__["a"].request(video, _config.inputStream.constraints).then(function () { - _inputStream.trigger("canrecord"); - }).catch(function (err) { - return cb(err); - }); - } + module.e = isBuffer; - _inputStream.setAttribute("preload", "auto"); - _inputStream.setInputStream(_config.inputStream); - _inputStream.addEventListener("canrecord", canRecord.bind(undefined, cb)); - } + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(81)(module))) + +/***/ }, +/* 78 */ +/***/ function(module, exports, __webpack_require__) { + + var arrayLikeKeys = __webpack_require__(52), + baseKeysIn = __webpack_require__(61), + isArrayLike = __webpack_require__(13); - function getViewPort() { - var target = _config.inputStream.target; - // Check if target is already a DOM element - if (target && target.nodeName && target.nodeType === 1) { - return target; - } else { - // Use '#interactive.viewport' as a fallback selector (backwards compatibility) - var selector = typeof target === 'string' ? target : '#interactive.viewport'; - return document.querySelector(selector); - } - } - - function canRecord(cb) { - /* harmony import */__WEBPACK_IMPORTED_MODULE_4__locator_barcode_locator__["a"].checkImageConstraints(_inputStream, _config.locator); - initCanvas(_config); - _framegrabber = /* harmony import */__WEBPACK_IMPORTED_MODULE_12_frame_grabber__["a"].create(_inputStream, _canvasContainer.dom.image); - - adjustWorkerPool(_config.numOfWorkers, function () { - if (_config.numOfWorkers === 0) { - initializeData(); - } - ready(cb); - }); - } - - function ready(cb) { - _inputStream.play(); - cb(); - } - - function initCanvas() { - if (typeof document !== "undefined") { - var $viewport = getViewPort(); - _canvasContainer.dom.image = document.querySelector("canvas.imgBuffer"); - if (!_canvasContainer.dom.image) { - _canvasContainer.dom.image = document.createElement("canvas"); - _canvasContainer.dom.image.className = "imgBuffer"; - if ($viewport && _config.inputStream.type === "ImageStream") { - $viewport.appendChild(_canvasContainer.dom.image); - } - } - _canvasContainer.ctx.image = _canvasContainer.dom.image.getContext("2d"); - _canvasContainer.dom.image.width = _inputStream.getCanvasSize().x; - _canvasContainer.dom.image.height = _inputStream.getCanvasSize().y; - - _canvasContainer.dom.overlay = document.querySelector("canvas.drawingBuffer"); - if (!_canvasContainer.dom.overlay) { - _canvasContainer.dom.overlay = document.createElement("canvas"); - _canvasContainer.dom.overlay.className = "drawingBuffer"; - if ($viewport) { - $viewport.appendChild(_canvasContainer.dom.overlay); - } - var clearFix = document.createElement("br"); - clearFix.setAttribute("clear", "all"); - if ($viewport) { - $viewport.appendChild(clearFix); - } - } - _canvasContainer.ctx.overlay = _canvasContainer.dom.overlay.getContext("2d"); - _canvasContainer.dom.overlay.width = _inputStream.getCanvasSize().x; - _canvasContainer.dom.overlay.height = _inputStream.getCanvasSize().y; - } + /** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @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; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ + function keysIn(object) { + return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); } - function initBuffers(imageWrapper) { - if (imageWrapper) { - _inputImageWrapper = imageWrapper; - } else { - _inputImageWrapper = new /* harmony import */__WEBPACK_IMPORTED_MODULE_3__common_image_wrapper__["a"]({ - x: _inputStream.getWidth(), - y: _inputStream.getHeight() - }); - } + module.e = keysIn; + + +/***/ }, +/* 79 */ +/***/ function(module, exports, __webpack_require__) { + + var arrayMap = __webpack_require__(30), + baseFlatten = __webpack_require__(56), + basePick = __webpack_require__(62), + baseRest = __webpack_require__(32), + toKey = __webpack_require__(6); - if (true) { - console.log(_inputImageWrapper.size); - } - _boxSize = [vec2.clone([0, 0]), vec2.clone([0, _inputImageWrapper.size.y]), vec2.clone([_inputImageWrapper.size.x, _inputImageWrapper.size.y]), vec2.clone([_inputImageWrapper.size.x, 0])]; - /* harmony import */__WEBPACK_IMPORTED_MODULE_4__locator_barcode_locator__["a"].init(_inputImageWrapper, _config.locator); - } + /** + * Creates an object composed of the picked `object` properties. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [props] The property identifiers to pick. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pick(object, ['a', 'c']); + * // => { 'a': 1, 'c': 3 } + */ + var pick = baseRest(function(object, props) { + return object == null ? {} : basePick(object, arrayMap(baseFlatten(props, 1), toKey)); + }); - function getBoundingBoxes() { - if (_config.locate) { - return /* harmony import */__WEBPACK_IMPORTED_MODULE_4__locator_barcode_locator__["a"].locate(); - } else { - return [[vec2.clone(_boxSize[0]), vec2.clone(_boxSize[1]), vec2.clone(_boxSize[2]), vec2.clone(_boxSize[3])]]; - } + module.e = pick; + + +/***/ }, +/* 80 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * This method returns a new empty array. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {Array} Returns the new empty array. + * @example + * + * var arrays = _.times(2, _.stubArray); + * + * console.log(arrays); + * // => [[], []] + * + * console.log(arrays[0] === arrays[1]); + * // => false + */ + function stubArray() { + return []; } - function transformResult(result) { - var topRight = _inputStream.getTopRight(), - xOffset = topRight.x, - yOffset = topRight.y, - i; - - if (xOffset === 0 && yOffset === 0) { - return; - } - - if (result.barcodes) { - for (i = 0; i < result.barcodes.length; i++) { - transformResult(result.barcodes[i]); - } - } - - if (result.line && result.line.length === 2) { - moveLine(result.line); - } - - if (result.box) { - moveBox(result.box); - } - - if (result.boxes && result.boxes.length > 0) { - for (i = 0; i < result.boxes.length; i++) { - moveBox(result.boxes[i]); - } - } + module.e = stubArray; + + +/***/ }, +/* 81 */ +/***/ function(module, exports, __webpack_require__) { + + module.e = function(module) { + if(!module.webpackPolyfill) { + module.deprecate = function() {}; + module.paths = []; + // module.parent = undefined by default + module.children = []; + Object.defineProperty(module, "exports", { + enumerable: true, + configurable: false, + get: function() { return module.e; }, + set: function(v) { return module.e = v; } + }); + Object.defineProperty(module, "loaded", { + enumerable: true, + configurable: false, + get: function() { return module.l; } + }); + Object.defineProperty(module, "id", { + enumerable: true, + configurable: false, + get: function() { return module.i; } + }); + module.webpackPolyfill = 1; + } + return module; + } + + +/***/ }, +/* 82 */ +/***/ function(module, exports, __webpack_require__) { + + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_merge__ = __webpack_require__(7); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_merge___default = __WEBPACK_IMPORTED_MODULE_0_lodash_merge__ && __WEBPACK_IMPORTED_MODULE_0_lodash_merge__.__esModule ? function() { return __WEBPACK_IMPORTED_MODULE_0_lodash_merge__['default'] } : function() { return __WEBPACK_IMPORTED_MODULE_0_lodash_merge__; } + /* harmony import */ Object.defineProperty(__WEBPACK_IMPORTED_MODULE_0_lodash_merge___default, 'a', { get: __WEBPACK_IMPORTED_MODULE_0_lodash_merge___default }); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__common_typedefs__ = __webpack_require__(87); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__common_typedefs___default = __WEBPACK_IMPORTED_MODULE_1__common_typedefs__ && __WEBPACK_IMPORTED_MODULE_1__common_typedefs__.__esModule ? function() { return __WEBPACK_IMPORTED_MODULE_1__common_typedefs__['default'] } : function() { return __WEBPACK_IMPORTED_MODULE_1__common_typedefs__; } + /* harmony import */ Object.defineProperty(__WEBPACK_IMPORTED_MODULE_1__common_typedefs___default, 'a', { get: __WEBPACK_IMPORTED_MODULE_1__common_typedefs___default }); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_webrtc_adapter__ = __webpack_require__(214); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_webrtc_adapter___default = __WEBPACK_IMPORTED_MODULE_2_webrtc_adapter__ && __WEBPACK_IMPORTED_MODULE_2_webrtc_adapter__.__esModule ? function() { return __WEBPACK_IMPORTED_MODULE_2_webrtc_adapter__['default'] } : function() { return __WEBPACK_IMPORTED_MODULE_2_webrtc_adapter__; } + /* harmony import */ Object.defineProperty(__WEBPACK_IMPORTED_MODULE_2_webrtc_adapter___default, 'a', { get: __WEBPACK_IMPORTED_MODULE_2_webrtc_adapter___default }); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__scanner__ = __webpack_require__(109); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__common_image_wrapper__ = __webpack_require__(27); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__common_image_debug__ = __webpack_require__(8); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__analytics_result_collector__ = __webpack_require__(44); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__config_config__ = __webpack_require__(45); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__input_config_factory__ = __webpack_require__(92); - function moveBox(box) { - var corner = box.length; - while (corner--) { - box[corner][0] += xOffset; - box[corner][1] += yOffset; - } - } + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; - function moveLine(line) { - line[0].x += xOffset; - line[0].y += yOffset; - line[1].x += xOffset; - line[1].y += yOffset; - } - } - function addResult(result, imageData) { - if (!imageData || !_resultCollector) { - return; - } - if (result.barcodes) { - result.barcodes.filter(function (barcode) { - return barcode.codeResult; - }).forEach(function (barcode) { - return addResult(barcode, imageData); - }); - } else if (result.codeResult) { - _resultCollector.addResult(imageData, _inputStream.getCanvasSize(), result.codeResult); - } - } - function hasCodeResult(result) { - return result && (result.barcodes ? result.barcodes.some(function (barcode) { - return barcode.codeResult; - }) : result.codeResult); - } - function publishResult(result, imageData) { - var resultToPublish = result; - if (result && _onUIThread) { - transformResult(result); - addResult(result, imageData); - resultToPublish = result.barcodes || result; - } - /* harmony import */__WEBPACK_IMPORTED_MODULE_6__common_events__["a"].publish("processed", resultToPublish); - if (hasCodeResult(result)) { - /* harmony import */__WEBPACK_IMPORTED_MODULE_6__common_events__["a"].publish("detected", resultToPublish); - } - } - function locateAndDecode() { - var result, boxes; - boxes = getBoundingBoxes(); - if (boxes) { - result = _decoder.decodeFromBoundingBoxes(boxes); - result = result || {}; - result.boxes = boxes; - publishResult(result, _inputImageWrapper.data); - } else { - publishResult(); - } - } - function update() { - var availableWorker; - if (_onUIThread) { - if (_workerPool.length > 0) { - availableWorker = _workerPool.filter(function (workerThread) { - return !workerThread.busy; - })[0]; - if (availableWorker) { - _framegrabber.attachData(availableWorker.imageData); - } else { - return; // all workers are busy + function _fromConfig(config) { + var scanner = /* harmony import */__WEBPACK_IMPORTED_MODULE_3__scanner__["a"].bind()(); + var pendingStart = null; + var initialized = false; + return { + addEventListener: function addEventListener(eventType, cb) { + scanner.subscribe(eventType, cb); + return this; + }, + removeEventListener: function removeEventListener(eventType, cb) { + scanner.unsubscribe(eventType, cb); + return this; + }, + start: function start() { + if (scanner.isRunning()) { + return Promise.resolve(true); } - } else { - _framegrabber.attachData(_inputImageWrapper.data); + if (pendingStart) { + return pendingStart; } - if (_framegrabber.grab()) { - if (availableWorker) { - availableWorker.busy = true; - availableWorker.worker.postMessage({ - cmd: 'process', - imageData: availableWorker.imageData - }, [availableWorker.imageData.buffer]); - } else { - locateAndDecode(); + if (initialized) { + scanner.start(); + return Promise.resolve(true); } - } - } else { - locateAndDecode(); - } - } + pendingStart = new Promise(function (resolve, reject) { + scanner.init(config, function (error) { + if (error) { + console.log(error); + reject(error); + } + initialized = true; + scanner.start(); + resolve(); + pendingStart = null; + }); + }); + return pendingStart; + }, + stop: function stop() { + scanner.stop(); + initialized = false; + return this; + }, + toPromise: function toPromise() { + var _this = this; - function startContinuousUpdate() { - var next = null, - delay = 1000 / (_config.frequency || 60); + if (config.inputStream.type === 'LiveStream' || config.inputStream.type === 'VideoStream') { + var _ret = function () { + var cancelRequested = false; + return { + v: { + cancel: function cancel() { + cancelRequested = true; + }, + + promise: new Promise(function (resolve, reject) { + function onProcessed(result) { + if (result && result.codeResult && result.codeResult.code) { + scanner.stop(); + scanner.unsubscribe("processed", onProcessed); + resolve(result); + } + if (cancelRequested) { + scanner.stop(); + scanner.unsubscribe("processed", onProcessed); + reject("cancelled!"); + } + } + scanner.subscribe("processed", onProcessed); + _this.start(); + }) + } + }; + }(); - _stopped = false; - (function frame(timestamp) { - next = next || timestamp; - if (!_stopped) { - if (timestamp >= next) { - next += delay; - update(); + if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === "object") return _ret.v; + } else { + return new Promise(function (resolve, reject) { + scanner.decodeSingle(config, function (result) { + if (result && result.codeResult && result.codeResult.code) { + return resolve(result); + } + return reject(result); + }); + }); } - window.requestAnimFrame(frame); + }, + registerResultCollector: function registerResultCollector(resultCollector) { + scanner.registerResultCollector(resultCollector); + }, + getCanvas: function getCanvas() { + return scanner.canvas.dom.image; } - })(performance.now()); + }; } - function _start() { - if (_onUIThread && _config.inputStream.type === "LiveStream") { - startContinuousUpdate(); - } else { - update(); - } + function _fromSource(config, source) { + var inputConfig = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; + + config = /* harmony import */__WEBPACK_IMPORTED_MODULE_8__input_config_factory__["a"].bind()(config, inputConfig, source); + return _fromConfig(config); } - function initWorker(cb) { - var blobURL, - workerThread = { - worker: undefined, - imageData: new Uint8Array(_inputStream.getWidth() * _inputStream.getHeight()), - busy: true - }; + function setConfig() { + var configuration = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; - blobURL = generateWorkerBlob(); - workerThread.worker = new Worker(blobURL); + var _merge2; - workerThread.worker.onmessage = function (e) { - if (e.data.event === 'initialized') { - URL.revokeObjectURL(blobURL); - workerThread.busy = false; - workerThread.imageData = new Uint8Array(e.data.imageData); - if (true) { - console.log("Worker initialized"); - } - return cb(workerThread); - } else if (e.data.event === 'processed') { - workerThread.imageData = new Uint8Array(e.data.imageData); - workerThread.busy = false; - publishResult(e.data.result, workerThread.imageData); - } else if (e.data.event === 'error') { - if (true) { - console.log("Worker error: " + e.data.message); - } - } - }; + var key = arguments[1]; + var config = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; - workerThread.worker.postMessage({ - cmd: 'init', - size: { x: _inputStream.getWidth(), y: _inputStream.getHeight() }, - imageData: workerThread.imageData, - config: configForWorker(_config) - }, [workerThread.imageData.buffer]); + var mergedConfig = /* harmony import */__WEBPACK_IMPORTED_MODULE_0_lodash_merge___default.a.bind()({}, configuration, (_merge2 = {}, _merge2[key] = config, _merge2)); + return createApi(mergedConfig); } - function configForWorker(config) { - return _extends({}, config, { - inputStream: _extends({}, config.inputStream, { - target: null - }) - }); - } + function createApi() { + var configuration = arguments.length <= 0 || arguments[0] === undefined ? /* harmony import */__WEBPACK_IMPORTED_MODULE_7__config_config__["a"] : arguments[0]; - function workerInterface(factory) { - /* eslint-disable no-undef*/ - if (factory) { - var Quagga = factory().default; - if (!Quagga) { - self.postMessage({ 'event': 'error', message: 'Quagga could not be created' }); - return; - } - } - var imageWrapper; - - self.onmessage = function (e) { - if (e.data.cmd === 'init') { - var config = e.data.config; - config.numOfWorkers = 0; - imageWrapper = new Quagga.ImageWrapper({ - x: e.data.size.x, - y: e.data.size.y - }, new Uint8Array(e.data.imageData)); - Quagga.init(config, ready, imageWrapper); - Quagga.onProcessed(onProcessed); - } else if (e.data.cmd === 'process') { - imageWrapper.data = new Uint8Array(e.data.imageData); - Quagga.start(); - } else if (e.data.cmd === 'setReaders') { - Quagga.setReaders(e.data.readers); + return { + fromSource: function fromSource(src, inputConfig) { + return _fromSource(configuration, src, inputConfig); + }, + fromConfig: function fromConfig(conf) { + return _fromConfig(/* harmony import */__WEBPACK_IMPORTED_MODULE_0_lodash_merge___default.a.bind()({}, configuration, conf)); + }, + decoder: function decoder(conf) { + return setConfig(configuration, "decoder", conf); + }, + locator: function locator(conf) { + return setConfig(configuration, "locator", conf); + }, + throttle: function throttle(timeInMs) { + return setConfig(configuration, "frequency", 1000 / parseInt(timeInMs)); + }, + config: function config(conf) { + return createApi(/* harmony import */__WEBPACK_IMPORTED_MODULE_0_lodash_merge___default.a.bind()({}, configuration, conf)); + }, + + ImageWrapper: /* harmony import */__WEBPACK_IMPORTED_MODULE_4__common_image_wrapper__["a"], + ImageDebug: /* harmony import */__WEBPACK_IMPORTED_MODULE_5__common_image_debug__["a"], + ResultCollector: /* harmony import */__WEBPACK_IMPORTED_MODULE_6__analytics_result_collector__["a"], + _worker: { + createScanner: /* harmony import */__WEBPACK_IMPORTED_MODULE_3__scanner__["a"] } }; - - function onProcessed(result) { - self.postMessage({ - 'event': 'processed', - imageData: imageWrapper.data, - result: result - }, [imageWrapper.data.buffer]); - } - - function ready() { - // eslint-disable-line - self.postMessage({ 'event': 'initialized', imageData: imageWrapper.data }, [imageWrapper.data.buffer]); - } - - /* eslint-enable */ } + /* harmony default export */ exports["default"] = createApi(); + +/***/ }, +/* 83 */ +/***/ function(module, exports, __webpack_require__) { + + var vec2 = { + clone: __webpack_require__(10), + dot: __webpack_require__(48) + }; - function generateWorkerBlob() { - var blob, factorySource; - - /* jshint ignore:start */ - if (typeof __factorySource__ !== 'undefined') { - factorySource = __factorySource__; // eslint-disable-line no-undef - } - /* jshint ignore:end */ + /** + * Creates a cluster for grouping similar orientations of datapoints + */ + /* harmony default export */ exports["a"] = { + create: function create(point, threshold) { + var points = [], + center = { + rad: 0, + vec: vec2.clone([0, 0]) + }, + pointMap = {}; - blob = new Blob(['(' + workerInterface.toString() + ')(' + factorySource + ');'], { type: 'text/javascript' }); + function init() { + _add(point); + updateCenter(); + } - return window.URL.createObjectURL(blob); - } - - function _setReaders(readers) { - if (_decoder) { - _decoder.setReaders(readers); - } else if (_onUIThread && _workerPool.length > 0) { - _workerPool.forEach(function (workerThread) { - workerThread.worker.postMessage({ cmd: 'setReaders', readers: readers }); - }); - } - } - - function adjustWorkerPool(capacity, cb) { - var increaseBy = capacity - _workerPool.length; - if (increaseBy === 0) { - return cb && cb(); - } - if (increaseBy < 0) { - var workersToTerminate = _workerPool.slice(increaseBy); - workersToTerminate.forEach(function (workerThread) { - workerThread.worker.terminate(); - if (true) { - console.log("Worker terminated!"); - } - }); - _workerPool = _workerPool.slice(0, increaseBy); - return cb && cb(); - } else { - var workerInitialized = function workerInitialized(workerThread) { - _workerPool.push(workerThread); - if (_workerPool.length >= capacity) { - cb && cb(); - } - }; - - for (var i = 0; i < increaseBy; i++) { - initWorker(workerInitialized); - } - } - } - - /* harmony default export */ exports["default"] = { - init: function init(config, cb, imageWrapper) { - _config = /* harmony import */__WEBPACK_IMPORTED_MODULE_0_lodash_merge___default.a.bind()({}, /* harmony import */__WEBPACK_IMPORTED_MODULE_10__config_config__["a"], config); - if (imageWrapper) { - _onUIThread = false; - initializeData(imageWrapper); - return cb(); - } else { - initInputStream(cb); - } - }, - start: function start() { - _start(); - }, - stop: function stop() { - _stopped = true; - adjustWorkerPool(0); - if (_config.inputStream.type === "LiveStream") { - /* harmony import */__WEBPACK_IMPORTED_MODULE_7__input_camera_access__["a"].release(); - _inputStream.clearEventHandlers(); - } - }, - pause: function pause() { - _stopped = true; - }, - onDetected: function onDetected(callback) { - /* harmony import */__WEBPACK_IMPORTED_MODULE_6__common_events__["a"].subscribe("detected", callback); - }, - offDetected: function offDetected(callback) { - /* harmony import */__WEBPACK_IMPORTED_MODULE_6__common_events__["a"].unsubscribe("detected", callback); - }, - onProcessed: function onProcessed(callback) { - /* harmony import */__WEBPACK_IMPORTED_MODULE_6__common_events__["a"].subscribe("processed", callback); - }, - offProcessed: function offProcessed(callback) { - /* harmony import */__WEBPACK_IMPORTED_MODULE_6__common_events__["a"].unsubscribe("processed", callback); - }, - setReaders: function setReaders(readers) { - _setReaders(readers); - }, - registerResultCollector: function registerResultCollector(resultCollector) { - if (resultCollector && typeof resultCollector.addResult === 'function') { - _resultCollector = resultCollector; - } - }, - canvas: _canvasContainer, - decodeSingle: function decodeSingle(config, resultCallback) { - var _this = this; - - config = /* harmony import */__WEBPACK_IMPORTED_MODULE_0_lodash_merge___default.a.bind()({ - inputStream: { - type: "ImageStream", - sequence: false, - size: 800, - src: config.src - }, - numOfWorkers: true && config.debug ? 0 : 1, - locator: { - halfSample: false - } - }, config); - this.init(config, function () { - /* harmony import */__WEBPACK_IMPORTED_MODULE_6__common_events__["a"].once("processed", function (result) { - _this.stop(); - resultCallback.call(null, result); - }, true); - _start(); - }); - }, - ImageWrapper: /* harmony import */__WEBPACK_IMPORTED_MODULE_3__common_image_wrapper__["a"], - ImageDebug: /* harmony import */__WEBPACK_IMPORTED_MODULE_8__common_image_debug__["a"], - ResultCollector: /* harmony import */__WEBPACK_IMPORTED_MODULE_9__analytics_result_collector__["a"] - }; - -/***/ }, -/* 56 */ -/***/ function(module, exports, __webpack_require__) { - - /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__common_image_debug__ = __webpack_require__(12); - - - function contains(codeResult, list) { - if (list) { - return list.some(function (item) { - return Object.keys(item).every(function (key) { - return item[key] === codeResult[key]; - }); - }); - } - return false; - } - - function passesFilter(codeResult, filter) { - if (typeof filter === 'function') { - return filter(codeResult); - } - return true; - } - - /* harmony default export */ exports["a"] = { - create: function create(config) { - var canvas = document.createElement("canvas"), - ctx = canvas.getContext("2d"), - results = [], - capacity = config.capacity || 20, - capture = config.capture === true; - - function matchesConstraints(codeResult) { - return capacity && codeResult && !contains(codeResult, config.blacklist) && passesFilter(codeResult, config.filter); - } - - return { - addResult: function addResult(data, imageSize, codeResult) { - var result = {}; - - if (matchesConstraints(codeResult)) { - capacity--; - result.codeResult = codeResult; - if (capture) { - canvas.width = imageSize.x; - canvas.height = imageSize.y; - /* harmony import */__WEBPACK_IMPORTED_MODULE_0__common_image_debug__["a"].drawImage(data, imageSize, ctx); - result.frame = canvas.toDataURL(); - } - results.push(result); - } - }, - getResults: function getResults() { - return results; - } - }; - } - }; - -/***/ }, -/* 57 */ -/***/ function(module, exports, __webpack_require__) { - - var vec2 = { - clone: __webpack_require__(8), - dot: __webpack_require__(34) - }; - /** - * Creates a cluster for grouping similar orientations of datapoints - */ - /* harmony default export */ exports["a"] = { - create: function create(point, threshold) { - var points = [], - center = { - rad: 0, - vec: vec2.clone([0, 0]) - }, - pointMap = {}; - - function init() { - _add(point); - updateCenter(); - } - - function _add(pointToAdd) { - pointMap[pointToAdd.id] = pointToAdd; - points.push(pointToAdd); - } + function _add(pointToAdd) { + pointMap[pointToAdd.id] = pointToAdd; + points.push(pointToAdd); + } function updateCenter() { var i, @@ -4590,10 +4940,33 @@ return /******/ (function(modules) { // webpackBootstrap }; /***/ }, -/* 58 */ +/* 84 */ +/***/ function(module, exports, __webpack_require__) { + + var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + + var hasWindow = typeof window !== 'undefined'; + var windowRef = hasWindow ? window : {}; + + var windowObjects = ["MediaStream", "HTMLImageElement", "HTMLVideoElement", "HTMLCanvasElement", "FileList", "File", "URL"]; + + var DOMHelper = windowObjects.reduce(function (result, obj) { + var _extends2; + + return _extends({}, result, (_extends2 = {}, _extends2[obj] = obj in windowRef ? windowRef[obj] : function () {}, _extends2)); + }, {}); + + DOMHelper.setObject = function (key, value) { + DOMHelper[key] = value; + }; + + /* harmony default export */ exports["a"] = DOMHelper; + +/***/ }, +/* 85 */ /***/ function(module, exports, __webpack_require__) { - /* harmony default export */ exports["a"] = (function () { + /* harmony export */ exports["a"] = createEventedElement;function createEventedElement() { var events = {}; function getEvent(eventName) { @@ -4686,19 +5059,19 @@ return /******/ (function(modules) { // webpackBootstrap } } }; - })(); + }; /***/ }, -/* 59 */ +/* 86 */ /***/ function(module, exports, __webpack_require__) { - /** - * Construct representing a part of another {ImageWrapper}. Shares data - * between the parent and the child. - * @param from {ImageRef} The position where to start the {SubImage} from. (top-left corner) - * @param size {ImageRef} The size of the resulting image - * @param I {ImageWrapper} The {ImageWrapper} to share from - * @returns {SubImage} A shared part of the original image + /** + * Construct representing a part of another {ImageWrapper}. Shares data + * between the parent and the child. + * @param from {ImageRef} The position where to start the {SubImage} from. (top-left corner) + * @param size {ImageRef} The size of the resulting image + * @param I {ImageWrapper} The {ImageWrapper} to share from + * @returns {SubImage} A shared part of the original image */ function SubImage(from, size, I) { if (!I) { @@ -4715,10 +5088,10 @@ return /******/ (function(modules) { // webpackBootstrap this.size = size; } - /** - * Displays the {SubImage} in a given canvas - * @param canvas {Canvas} The canvas element to write to - * @param scale {Number} Scale which is applied to each pixel-value + /** + * Displays the {SubImage} in a given canvas + * @param canvas {Canvas} The canvas element to write to + * @param scale {Number} Scale which is applied to each pixel-value */ SubImage.prototype.show = function (canvas, scale) { var ctx, frame, data, current, y, x, pixel; @@ -4746,29 +5119,29 @@ return /******/ (function(modules) { // webpackBootstrap ctx.putImageData(frame, 0, 0); }; - /** - * Retrieves a given pixel position from the {SubImage} - * @param x {Number} The x-position - * @param y {Number} The y-position - * @returns {Number} The grayscale value at the pixel-position + /** + * Retrieves a given pixel position from the {SubImage} + * @param x {Number} The x-position + * @param y {Number} The y-position + * @returns {Number} The grayscale value at the pixel-position */ SubImage.prototype.get = function (x, y) { return this.data[(this.from.y + y) * this.originalSize.x + this.from.x + x]; }; - /** - * Updates the underlying data from a given {ImageWrapper} - * @param image {ImageWrapper} The updated image + /** + * Updates the underlying data from a given {ImageWrapper} + * @param image {ImageWrapper} The updated image */ SubImage.prototype.updateData = function (image) { this.originalSize = image.size; this.data = image.data; }; - /** - * Updates the position of the shared area - * @param from {x,y} The new location - * @returns {SubImage} returns {this} for possible chaining + /** + * Updates the position of the shared area + * @param from {x,y} The new location + * @returns {SubImage} returns {this} for possible chaining */ SubImage.prototype.updateFrom = function (from) { this.from = from; @@ -4778,12 +5151,12 @@ return /******/ (function(modules) { // webpackBootstrap /* harmony default export */ exports["a"] = SubImage; /***/ }, -/* 60 */ +/* 87 */ /***/ function(module, exports) { - /* - * typedefs.js - * Normalizes browser-specific prefixes + /* + * typedefs.js + * Normalizes browser-specific prefixes */ if (typeof window !== 'undefined') { @@ -4804,7 +5177,7 @@ return /******/ (function(modules) { // webpackBootstrap }; /***/ }, -/* 61 */ +/* 88 */ /***/ function(module, exports, __webpack_require__) { module.e = { @@ -4816,8 +5189,6 @@ return /******/ (function(modules) { // webpackBootstrap height: 480, // aspectRatio: 640/480, // optional facingMode: "environment" }, - // or user - // deviceId: "38745983457387598375983759834" area: { top: "0%", right: "0%", @@ -4827,7 +5198,7 @@ return /******/ (function(modules) { // webpackBootstrap singleChannel: false // true: only the red color-channel is read }, locate: true, - numOfWorkers: 0, + numOfWorkers: 2, decoder: { readers: ['code_128_reader'], debug: { @@ -4858,38 +5229,22 @@ return /******/ (function(modules) { // webpackBootstrap }; /***/ }, -/* 62 */ -/***/ function(module, exports, __webpack_require__) { - - var config = void 0; - - if (true) { - config = __webpack_require__(61); - } else if (ENV.node) { - config = require('./config.node.js'); - } else { - config = require('./config.prod.js'); - } - - /* harmony default export */ exports["a"] = config; - -/***/ }, -/* 63 */ +/* 89 */ /***/ function(module, exports, __webpack_require__) { - /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__bresenham__ = __webpack_require__(64); - /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__common_image_debug__ = __webpack_require__(12); - /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__reader_code_128_reader__ = __webpack_require__(74); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__bresenham__ = __webpack_require__(90); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__common_image_debug__ = __webpack_require__(8); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__reader_code_128_reader__ = __webpack_require__(101); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__reader_ean_reader__ = __webpack_require__(4); - /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__reader_code_39_reader__ = __webpack_require__(33); - /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__reader_code_39_vin_reader__ = __webpack_require__(75); - /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__reader_codabar_reader__ = __webpack_require__(73); - /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__reader_upc_reader__ = __webpack_require__(81); - /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__reader_ean_8_reader__ = __webpack_require__(78); - /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__reader_ean_2_reader__ = __webpack_require__(76); - /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__reader_ean_5_reader__ = __webpack_require__(77); - /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__reader_upc_e_reader__ = __webpack_require__(80); - /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__reader_i2of5_reader__ = __webpack_require__(79); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__reader_code_39_reader__ = __webpack_require__(47); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__reader_code_39_vin_reader__ = __webpack_require__(102); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__reader_codabar_reader__ = __webpack_require__(100); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__reader_upc_reader__ = __webpack_require__(108); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__reader_ean_8_reader__ = __webpack_require__(105); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__reader_ean_2_reader__ = __webpack_require__(103); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__reader_ean_5_reader__ = __webpack_require__(104); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__reader_upc_e_reader__ = __webpack_require__(107); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__reader_i2of5_reader__ = __webpack_require__(106); var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -4962,8 +5317,13 @@ return /******/ (function(modules) { // webpackBootstrap } _canvas.ctx.pattern = _canvas.dom.pattern.getContext("2d"); - _canvas.dom.overlay = document.querySelector("canvas.drawingBuffer"); - if (_canvas.dom.overlay) { + if ($debug) { + _canvas.dom.overlay = document.querySelector("canvas.drawingBuffer"); + if (!_canvas.dom.overlay) { + _canvas.dom.overlay = document.createElement("canvas"); + _canvas.dom.overlay.className = "drawingBuffer"; + $debug.appendChild(_canvas.dom.overlay); + } _canvas.ctx.overlay = _canvas.dom.overlay.getContext("2d"); } } @@ -5019,10 +5379,10 @@ return /******/ (function(modules) { // webpackBootstrap } } - /** - * extend the line on both ends - * @param {Array} line - * @param {Number} angle + /** + * extend the line on both ends + * @param {Array} line + * @param {Number} angle */ function getExtendedLine(line, angle, ext) { function extendLine(amount) { @@ -5084,12 +5444,12 @@ return /******/ (function(modules) { // webpackBootstrap }; } - /** - * This method slices the given area apart and tries to detect a barcode-pattern - * for each slice. It returns the decoded barcode, or null if nothing was found - * @param {Array} box - * @param {Array} line - * @param {Number} lineAngle + /** + * This method slices the given area apart and tries to detect a barcode-pattern + * for each slice. It returns the decoded barcode, or null if nothing was found + * @param {Array} box + * @param {Array} line + * @param {Number} lineAngle */ function tryDecodeBruteForce(box, line, lineAngle) { var sideLength = Math.sqrt(Math.pow(box[1][0] - box[0][0], 2) + Math.pow(box[1][1] - box[0][1], 2)), @@ -5122,11 +5482,11 @@ return /******/ (function(modules) { // webpackBootstrap return Math.sqrt(Math.pow(Math.abs(line[1].y - line[0].y), 2) + Math.pow(Math.abs(line[1].x - line[0].x), 2)); } - /** - * With the help of the configured readers (Code128 or EAN) this function tries to detect a - * valid barcode pattern within the given area. - * @param {Object} box The area to search in - * @returns {Object} the result {codeResult, line, angle, pattern, threshold} + /** + * With the help of the configured readers (Code128 or EAN) this function tries to detect a + * valid barcode pattern within the given area. + * @param {Object} box The area to search in + * @returns {Object} the result {codeResult, line, angle, pattern, threshold} */ function _decodeFromBoundingBox(box) { var line, @@ -5209,12 +5569,9 @@ return /******/ (function(modules) { // webpackBootstrap }; /***/ }, -/* 64 */ +/* 90 */ /***/ function(module, exports, __webpack_require__) { - /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__common_image_wrapper__ = __webpack_require__(19); - - var Bresenham = {}; var Slope = { @@ -5223,14 +5580,14 @@ return /******/ (function(modules) { // webpackBootstrap DOWN: -1 } }; - /** - * Scans a line of the given image from point p1 to p2 and returns a result object containing - * gray-scale values (0-255) of the underlying pixels in addition to the min - * and max values. - * @param {Object} imageWrapper - * @param {Object} p1 The start point {x,y} - * @param {Object} p2 The end point {x,y} - * @returns {line, min, max} + /** + * Scans a line of the given image from point p1 to p2 and returns a result object containing + * gray-scale values (0-255) of the underlying pixels in addition to the min + * and max values. + * @param {Object} imageWrapper + * @param {Object} p1 The start point {x,y} + * @param {Object} p2 The end point {x,y} + * @returns {line, min, max} */ Bresenham.getBarcodeLine = function (imageWrapper, p1, p2) { var x0 = p1.x | 0, @@ -5304,10 +5661,10 @@ return /******/ (function(modules) { // webpackBootstrap }; }; - /** - * Converts the result from getBarcodeLine into a binary representation - * also considering the frequency and slope of the signal for more robust results - * @param {Object} result {line, min, max} + /** + * Converts the result from getBarcodeLine into a binary representation + * also considering the frequency and slope of the signal for more robust results + * @param {Object} result {line, min, max} */ Bresenham.toBinaryLine = function (result) { var min = result.min, @@ -5377,8 +5734,8 @@ return /******/ (function(modules) { // webpackBootstrap }; }; - /** - * Used for development only + /** + * Used for development only */ Bresenham.debug = { printFrequency: function printFrequency(line, canvas) { @@ -5414,19 +5771,24 @@ return /******/ (function(modules) { // webpackBootstrap /* harmony default export */ exports["a"] = Bresenham; /***/ }, -/* 65 */ +/* 91 */ /***/ function(module, exports, __webpack_require__) { - /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_pick__ = __webpack_require__(151); - /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_pick___default = __WEBPACK_IMPORTED_MODULE_0_lodash_pick__ && __WEBPACK_IMPORTED_MODULE_0_lodash_pick__.__esModule ? function() { return __WEBPACK_IMPORTED_MODULE_0_lodash_pick__['default'] } : function() { return __WEBPACK_IMPORTED_MODULE_0_lodash_pick__; } - /* harmony import */ Object.defineProperty(__WEBPACK_IMPORTED_MODULE_0_lodash_pick___default, 'a', { get: __WEBPACK_IMPORTED_MODULE_0_lodash_pick___default }); - /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_merge__ = __webpack_require__(17); - /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_merge___default = __WEBPACK_IMPORTED_MODULE_1_lodash_merge__ && __WEBPACK_IMPORTED_MODULE_1_lodash_merge__.__esModule ? function() { return __WEBPACK_IMPORTED_MODULE_1_lodash_merge__['default'] } : function() { return __WEBPACK_IMPORTED_MODULE_1_lodash_merge__; } - /* harmony import */ Object.defineProperty(__WEBPACK_IMPORTED_MODULE_1_lodash_merge___default, 'a', { get: __WEBPACK_IMPORTED_MODULE_1_lodash_merge___default }); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_omit__ = __webpack_require__(206); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_omit___default = __WEBPACK_IMPORTED_MODULE_0_lodash_omit__ && __WEBPACK_IMPORTED_MODULE_0_lodash_omit__.__esModule ? function() { return __WEBPACK_IMPORTED_MODULE_0_lodash_omit__['default'] } : function() { return __WEBPACK_IMPORTED_MODULE_0_lodash_omit__; } + /* harmony import */ Object.defineProperty(__WEBPACK_IMPORTED_MODULE_0_lodash_omit___default, 'a', { get: __WEBPACK_IMPORTED_MODULE_0_lodash_omit___default }); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_pick__ = __webpack_require__(79); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_pick___default = __WEBPACK_IMPORTED_MODULE_1_lodash_pick__ && __WEBPACK_IMPORTED_MODULE_1_lodash_pick__.__esModule ? function() { return __WEBPACK_IMPORTED_MODULE_1_lodash_pick__['default'] } : function() { return __WEBPACK_IMPORTED_MODULE_1_lodash_pick__; } + /* harmony import */ Object.defineProperty(__WEBPACK_IMPORTED_MODULE_1_lodash_pick___default, 'a', { get: __WEBPACK_IMPORTED_MODULE_1_lodash_pick___default }); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash_merge__ = __webpack_require__(7); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash_merge___default = __WEBPACK_IMPORTED_MODULE_2_lodash_merge__ && __WEBPACK_IMPORTED_MODULE_2_lodash_merge__.__esModule ? function() { return __WEBPACK_IMPORTED_MODULE_2_lodash_merge__['default'] } : function() { return __WEBPACK_IMPORTED_MODULE_2_lodash_merge__; } + /* harmony import */ Object.defineProperty(__WEBPACK_IMPORTED_MODULE_2_lodash_merge___default, 'a', { get: __WEBPACK_IMPORTED_MODULE_2_lodash_merge___default }); + var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + var streamRef; function waitForVideo(video) { @@ -5452,11 +5814,11 @@ return /******/ (function(modules) { // webpackBootstrap }); } - /** - * Tries to attach the camera-stream to a given video-element - * and calls the callback function when the content is ready - * @param {Object} constraints - * @param {Object} video + /** + * Tries to attach the camera-stream to a given video-element + * and calls the callback function when the content is ready + * @param {Object} constraints + * @param {Object} video */ function initCamera(video, constraints) { return navigator.mediaDevices.getUserMedia(constraints).then(function (stream) { @@ -5473,7 +5835,7 @@ return /******/ (function(modules) { // webpackBootstrap } function deprecatedConstraints(videoConstraints) { - var normalized = /* harmony import */__WEBPACK_IMPORTED_MODULE_0_lodash_pick___default.a.bind()(videoConstraints, ["width", "height", "facingMode", "aspectRatio", "deviceId"]); + var normalized = /* harmony import */__WEBPACK_IMPORTED_MODULE_1_lodash_pick___default.a.bind()(videoConstraints, ["width", "height", "facingMode", "aspectRatio", "deviceId"]); if (typeof videoConstraints.minAspectRatio !== 'undefined' && videoConstraints.minAspectRatio > 0) { normalized.aspectRatio = videoConstraints.minAspectRatio; @@ -5487,7 +5849,11 @@ return /******/ (function(modules) { // webpackBootstrap } function applyCameraFacing(facing, constraints) { - if (typeof constraints.video.deviceId !== 'undefined' || !facing) { + if (typeof constraints.video.deviceId === 'string' && constraints.video.deviceId.length > 0) { + return Promise.resolve(_extends({}, constraints, { + video: _extends({}, /* harmony import */__WEBPACK_IMPORTED_MODULE_0_lodash_omit___default.a.bind()(constraints.video, "facingMode")) + })); + } else if (!facing) { return Promise.resolve(constraints); } if (typeof MediaStreamTrack !== 'undefined' && typeof MediaStreamTrack.getSources !== 'undefined') { @@ -5497,13 +5863,13 @@ return /******/ (function(modules) { // webpackBootstrap return sourceInfo.kind === "video" && sourceInfo.facing === facing; })[0]; if (videoSource) { - return resolve(/* harmony import */__WEBPACK_IMPORTED_MODULE_1_lodash_merge___default.a.bind()({}, constraints, { video: { deviceId: videoSource.id } })); + return resolve(/* harmony import */__WEBPACK_IMPORTED_MODULE_2_lodash_merge___default.a.bind()({}, constraints, { video: { deviceId: videoSource.id } })); } return resolve(constraints); }); }); } - return Promise.resolve(/* harmony import */__WEBPACK_IMPORTED_MODULE_1_lodash_merge___default.a.bind()({}, constraints, { video: { facingMode: facing } })); + return Promise.resolve(/* harmony import */__WEBPACK_IMPORTED_MODULE_2_lodash_merge___default.a.bind()({}, constraints, { video: { facingMode: facing } })); } function pickConstraints(videoConstraints) { @@ -5528,7 +5894,190 @@ return /******/ (function(modules) { // webpackBootstrap }; /***/ }, -/* 66 */ +/* 92 */ +/***/ function(module, exports, __webpack_require__) { + + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_isEmpty__ = __webpack_require__(202); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_isEmpty___default = __WEBPACK_IMPORTED_MODULE_0_lodash_isEmpty__ && __WEBPACK_IMPORTED_MODULE_0_lodash_isEmpty__.__esModule ? function() { return __WEBPACK_IMPORTED_MODULE_0_lodash_isEmpty__['default'] } : function() { return __WEBPACK_IMPORTED_MODULE_0_lodash_isEmpty__; } + /* harmony import */ Object.defineProperty(__WEBPACK_IMPORTED_MODULE_0_lodash_isEmpty___default, 'a', { get: __WEBPACK_IMPORTED_MODULE_0_lodash_isEmpty___default }); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_omitBy__ = __webpack_require__(207); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_omitBy___default = __WEBPACK_IMPORTED_MODULE_1_lodash_omitBy__ && __WEBPACK_IMPORTED_MODULE_1_lodash_omitBy__.__esModule ? function() { return __WEBPACK_IMPORTED_MODULE_1_lodash_omitBy__['default'] } : function() { return __WEBPACK_IMPORTED_MODULE_1_lodash_omitBy__; } + /* harmony import */ Object.defineProperty(__WEBPACK_IMPORTED_MODULE_1_lodash_omitBy___default, 'a', { get: __WEBPACK_IMPORTED_MODULE_1_lodash_omitBy___default }); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash_pick__ = __webpack_require__(79); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash_pick___default = __WEBPACK_IMPORTED_MODULE_2_lodash_pick__ && __WEBPACK_IMPORTED_MODULE_2_lodash_pick__.__esModule ? function() { return __WEBPACK_IMPORTED_MODULE_2_lodash_pick__['default'] } : function() { return __WEBPACK_IMPORTED_MODULE_2_lodash_pick__; } + /* harmony import */ Object.defineProperty(__WEBPACK_IMPORTED_MODULE_2_lodash_pick___default, 'a', { get: __WEBPACK_IMPORTED_MODULE_2_lodash_pick___default }); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_lodash_merge__ = __webpack_require__(7); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_lodash_merge___default = __WEBPACK_IMPORTED_MODULE_3_lodash_merge__ && __WEBPACK_IMPORTED_MODULE_3_lodash_merge__.__esModule ? function() { return __WEBPACK_IMPORTED_MODULE_3_lodash_merge__['default'] } : function() { return __WEBPACK_IMPORTED_MODULE_3_lodash_merge__; } + /* harmony import */ Object.defineProperty(__WEBPACK_IMPORTED_MODULE_3_lodash_merge___default, 'a', { get: __WEBPACK_IMPORTED_MODULE_3_lodash_merge___default }); + /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__common_dom_helper__ = __webpack_require__(84); + /* harmony export */ exports["a"] = createConfigFromSource; + + + + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; + + + + var isDataURL = { regex: /^\s*data:([a-z]+\/[a-z0-9\-\+]+(;[a-z\-]+\=[a-z0-9\-]+)?)?(;base64)?,[a-z0-9\!\$\&\'\,\(\)\*\+\,\;\=\-\.\_\~\:\@\/\?\%\s]*\s*$/i }, + // eslint-disable-line max-len + isBlobURL = { regex: /^\s*blob:(.*)$/i }, + isMediaURL = { regex: /^(?:(?:http[s]?|ftp):\/)?\/?(?:(?:[^:\/\s]+)(?:(?:\/\w+)*\/))?([\w\-]+\.([^#?\s]+))(?:.*)?(?:#[\w\-]+)?$/i }, + // eslint-disable-line max-len + isImageExt = { regex: /(jpe?g|png|gif|tiff)(?:\s+|$)/i }, + isVideoExt = { regex: /(webm|ogg|mp4|m4v)/i }; + + function createConfigFromSource(config, sourceConfig, source) { + if (source instanceof /* harmony import */__WEBPACK_IMPORTED_MODULE_4__common_dom_helper__["a"].MediaStream) { + return createConfigForStream(config, sourceConfig, { srcObject: source }); + } else if (source instanceof /* harmony import */__WEBPACK_IMPORTED_MODULE_4__common_dom_helper__["a"].HTMLImageElement) { + throw new Error('Source "HTMLImageElement": not yet supported'); + // return createConfigForImage(config, inputConfig, {image: source}); + } else if (source instanceof /* harmony import */__WEBPACK_IMPORTED_MODULE_4__common_dom_helper__["a"].HTMLVideoElement) { + throw new Error('Source "HTMLVideoElement": not yet supported'); + // return createConfigForVideo(config, inputConfig, {video: source}); + } else if (source instanceof /* harmony import */__WEBPACK_IMPORTED_MODULE_4__common_dom_helper__["a"].HTMLCanvasElement) { + return createConfigForCanvas(config, sourceConfig, { canvas: source }); + } else if (source instanceof /* harmony import */__WEBPACK_IMPORTED_MODULE_4__common_dom_helper__["a"].FileList) { + if (source.length > 0) { + return createConfigForFile(config, sourceConfig, source[0]); + } + } else if (source instanceof /* harmony import */__WEBPACK_IMPORTED_MODULE_4__common_dom_helper__["a"].File) { + return createConfigForFile(config, sourceConfig, source); + } else if (typeof source === 'string') { + return createConfigForString(config, sourceConfig, source); + } else if ((typeof source === 'undefined' ? 'undefined' : _typeof(source)) === 'object' && (typeof source.constraints !== 'undefined' || typeof source.area !== 'undefined')) { + return createConfigForLiveStream(config, source); + } else { + throw new Error("No source given!"); + } + } + + function createConfigForImage(config, source) { + var inputConfig = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; + + var staticImageConfig = { + inputStream: /* harmony import */__WEBPACK_IMPORTED_MODULE_3_lodash_merge___default.a.bind()({ + type: "ImageStream", + sequence: false, + size: 800 + }, source), + numOfWorkers: true && config.debug ? 0 : 1 + }; + return /* harmony import */__WEBPACK_IMPORTED_MODULE_3_lodash_merge___default.a.bind()(config, staticImageConfig, { numOfWorkers: typeof config.numOfWorkers === 'number' && config.numOfWorkers > 0 ? 1 : 0 }, { inputStream: /* harmony import */__WEBPACK_IMPORTED_MODULE_1_lodash_omitBy___default.a.bind()(/* harmony import */__WEBPACK_IMPORTED_MODULE_2_lodash_pick___default.a.bind()(config.inputStream, ['size']), /* harmony import */__WEBPACK_IMPORTED_MODULE_0_lodash_isEmpty___default.a) }, { inputStream: inputConfig }); + } + + function createConfigForMimeType(config, inputConfig, _ref) { + var src = _ref.src; + var mime = _ref.mime; + + var _ref2 = mime.match(/^(video|image)\/(.*)$/i) || []; + + var type = _ref2[1]; + + if (type === 'video') { + return createConfigForVideo(config, { src: src }, inputConfig); + } else if (type === 'image') { + return createConfigForImage(config, { src: src }, inputConfig); + } + throw new Error('Source with mimetype: "' + type + '" not supported'); + } + + function createConfigForFile(config, inputConfig, file) { + var src = /* harmony import */__WEBPACK_IMPORTED_MODULE_4__common_dom_helper__["a"].URL.createObjectURL(file); + return createConfigForMimeType(config, inputConfig, { + src: src, + mime: file.type + }); + } + + function createConfigForString(config) { + var inputConfig = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + var source = arguments[2]; + + var _ref3 = source.match(isDataURL.regex) || []; + + var mime = _ref3[1]; + + if (mime) { + return createConfigForMimeType(config, inputConfig, { src: source, mime: mime }); + } + var blobURL = source.match(isBlobURL.regex); + if (blobURL) { + throw new Error('Source "objectURL": not supported'); + } + + var _ref4 = source.match(isMediaURL.regex) || []; + + var ext = _ref4[2]; + + if (ext) { + return createConfigForMediaExtension(config, inputConfig, { src: source, ext: ext }); + } + throw new Error('Source "' + source + '": not recognized'); + } + + function createConfigForMediaExtension(config, inputConfig, _ref5) { + var src = _ref5.src; + var ext = _ref5.ext; + + if (ext.match(isImageExt.regex)) { + return createConfigForImage(config, { src: src }, inputConfig); + } else if (ext.match(isVideoExt.regex)) { + return createConfigForVideo(config, { src: src }, inputConfig); + } + throw new Error('Source "MediaString": not recognized'); + } + + function createConfigForCanvas(config, _ref6) { + var canvas = _ref6.canvas; + var inputConfig = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; + + // TODO: adjust stream & frame-grabber + // once/continous + throw new Error('Source "Canvas": not implemented!'); + } + + function createConfigForVideo(config, source) { + var inputConfig = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; + + return /* harmony import */__WEBPACK_IMPORTED_MODULE_3_lodash_merge___default.a.bind()({}, config, { + inputStream: /* harmony import */__WEBPACK_IMPORTED_MODULE_3_lodash_merge___default.a.bind()({ + type: "VideoStream" + }, source) + }, { + inputStream: inputConfig + }); + } + + function createConfigForStream(config, _ref7) { + var srcObject = _ref7.srcObject; + var inputConfig = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; + + // TODO: attach to