forked from mirrors/bookwyrm
1 line
91 KiB
JavaScript
1 line
91 KiB
JavaScript
|
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(e.toString()).default:"object"==typeof exports?exports.Quagga=e(e.toString()).default:t.Quagga=e(e.toString()).default}(this,function(t){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/",e(e.s=166)}([function(t,e){function n(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}t.exports=n},function(t,e,n){"use strict";function r(t,e){return this._row=[],this.config=t||{},this.supplements=e,this}var o=n(3);r.prototype._nextUnset=function(t,e){var n;for(void 0===e&&(e=0),n=e;n<t.length;n++)if(!t[n])return n;return t.length},r.prototype._matchPattern=function(t,e,n){var r,o,i,a,u=0,c=0,s=0,f=0;for(n=n||this.SINGLE_CODE_ERROR||1,r=0;r<t.length;r++)s+=t[r],f+=e[r];if(s<f)return Number.MAX_VALUE;for(o=s/f,n*=o,r=0;r<t.length;r++){if(i=t[r],a=e[r]*o,(c=Math.abs(i-a)/a)>n)return Number.MAX_VALUE;u+=c}return u/f},r.prototype._nextSet=function(t,e){var n;for(e=e||0,n=e;n<t.length;n++)if(t[n])return n;return t.length},r.prototype._correctBars=function(t,e,n){for(var r=n.length,o=0;r--;)(o=t[n[r]]*(1-(1-e)/2))>1&&(t[n[r]]=o)},r.prototype._matchTrace=function(t,e){var n,r,o=[],i=this,a=i._nextSet(i._row),u=!i._row[a],c=0,s={error:Number.MAX_VALUE,code:-1,start:0};if(t){for(n=0;n<t.length;n++)o.push(0);for(n=a;n<i._row.length;n++)if(i._row[n]^u)o[c]++;else{if(c===o.length-1)return r=i._matchPattern(o,t),r<e?(s.start=n-a,s.end=n,s.counter=o,s):null;c++,o[c]=1,u=!u}}else for(o.push(0),n=a;n<i._row.length;n++)i._row[n]^u?o[c]++:(c++,o.push(0),o[c]=1,u=!u);return s.start=a,s.end=i._row.length-1,s.counter=o,s},r.prototype.decodePattern=function(t){var e,n=this;return n._row=t,e=n._decode(),null===e?(n._row.reverse(),(e=n._decode())&&(e.direction=r.DIRECTION.REVERSE,e.start=n._row.length-e.start,e.end=n._row.length-e.end)):e.direction=r.DIRECTION.FORWARD,e&&(e.format=n.FORMAT),e},r.prototype._matchRange=function(t,e,n){var r;for(t=t<0?0:t,r=t;r<e;r++)if(this._row[r]!==n)return!1;return!0},r.prototype._fillCounters=function(t,e,n){var r,o=this,i=0,a=[];for(n=void 0===n||n,t=void 0!==t?t:o._nextUnset(o._row),e=e||o._row.length,a[i]=0,r=t;r<e;r++)o._row[r]^n?a[i]++:(i++,a[i]=1,n=!n);return a},r.prototype._toCounters=function(t,e){var n,r=this,i=e.length,a=r._row.length,u=!r._row[t],c=0;for(o.a.init(e,0),n=t;n<a;n++)if(r._row[n]^u)e[c]++;else{if(++c===i)break;e[c]=1,u=!u}return e},Object.defineProperty(r.prototype,"FORMAT",{value:"unknown",writeable:!1}),r.DIRECTION={FORWARD:1,REVERSE:-1},r.Exception={StartNotFoundException:"Start-Info was not found!",CodeNotFoundException:"Code could not be found!",PatternNotFoundException:"Pattern could not be found!"},r.CONFIG_KEYS={},e.a=r},function(t,e){var n=Array.isArray;t.exports=n},function(t,e,n){"use strict";e.a={init:function(t,e){for(var n=t.length;n--;)t[n]=e},shuffle:function(t){var e,n,r=t.length-1;for(r;r>=0;r--)e=Math.floor(Math.random()*r),n=t[r],t[r]=t[e],t[e]=n;return t},toPointList:function(t){var e,n,r=[],o=[];for(e=0;e<t.length;e++){for(r=[],n=0;n<t[e].length;n++)r[n]=t[e][n];o[e]="["+r.join(",")+"]"}return"["+o.join(",\r\n")+"]"},threshold:function(t,e,n){var r,o=[];for(r=0;r<t.length;r++)n.apply(t,[t[r]])>=e&&o.push(t[r]);return o},maxIndex:function(t){var e,n=0;for(e=0;e<t.length;e++)t[e]>t[n]&&(n=e);return n},max:function t(e){var n,t=0;for(n=0;n<e.length;n++)e[n]>t&&(t=e[n]);return t},sum:function t(e){for(var n=e.length,t=0;n--;)t+=e[n];return t}}},function(t,e,n){"use strict";function r(t,e){t=a()(o(),t),u.a.call(this,t,e)}function o(){var t={};return Object.keys(r.CONFIG_KEYS).forEach(function(e){t[e]=r.CONFIG_KEYS[e].default}),t}var i=n(28),a=n.n(i),u=n(1)
|