You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
4 lines
125 KiB
JavaScript
4 lines
125 KiB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(t.toString())["default"]:"object"==typeof exports?exports.Quagga=t(t.toString())["default"]:e.Quagga=t(t.toString())["default"]}(this,function(e){return function(e){function t(r){if(n[r])return n[r].e;var i=n[r]={e:{},i:r,l:!1};return e[r].call(i.e,i,i.e,t),i.l=!0,i.e}var n={};return t.m=e,t.c=n,t.p="/",t(t.s=188)}([function(e,t,n){"use strict";var r=!0,i={disableLog:function(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(r=e,e?"adapter.js logging disabled":"adapter.js logging enabled")},log:function(){if("object"==typeof window){if(r)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}},extractVersion:function(e,t,n){var r=e.match(t);return r&&r.length>=n&&parseInt(r[n],10)},detectBrowser:function(){var e={};if(e.browser=null,e.version=null,"undefined"==typeof window||!window.navigator)return e.browser="Not a browser.",e;if(navigator.mozGetUserMedia)e.browser="firefox",e.version=this.extractVersion(navigator.userAgent,/Firefox\/([0-9]+)\./,1);else if(navigator.webkitGetUserMedia)if(window.webkitRTCPeerConnection)e.browser="chrome",e.version=this.extractVersion(navigator.userAgent,/Chrom(e|ium)\/([0-9]+)\./,2);else{if(!navigator.userAgent.match(/Version\/(\d+).(\d+)/))return e.browser="Unsupported webkit-based browser with GUM support but no WebRTC support.",e;e.browser="safari",e.version=this.extractVersion(navigator.userAgent,/AppleWebKit\/([0-9]+)\./,1)}else{if(!navigator.mediaDevices||!navigator.userAgent.match(/Edge\/(\d+).(\d+)$/))return e.browser="Not a supported browser.",e;e.browser="edge",e.version=this.extractVersion(navigator.userAgent,/Edge\/(\d+).(\d+)$/,2)}return e}};e.e={log:i.log,disableLog:i.disableLog,browserDetails:i.detectBrowser(),extractVersion:i.extractVersion}},function(e,t,n){var r=n(51),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.e=o},function(e,t,n){function r(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.e=r},function(e,t,n){function r(e,t){e=a.a.bind()(i(),e),c.a.call(this,e,t)}function i(){var e={};return Object.keys(r.CONFIG_KEYS).forEach(function(t){e[t]=r.CONFIG_KEYS[t]["default"]}),e}var o=n(33),a=o&&o.__esModule?function(){return o["default"]}:function(){return o};Object.defineProperty(a,"a",{get:a});var c=n(6),s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u={CODE_L_START:{value:0},CODE_G_START:{value:10},START_PATTERN:{value:[1,1,1]},STOP_PATTERN:{value:[1,1,1]},MIDDLE_PATTERN:{value:[1,1,1,1,1]},EXTENSION_START_PATTERN:{value:[1,1,2]},CODE_PATTERN:{value:[[3,2,1,1],[2,2,2,1],[2,1,2,2],[1,4,1,1],[1,1,3,2],[1,2,3,1],[1,1,1,4],[1,3,1,2],[1,2,1,3],[3,1,1,2],[1,1,2,3],[1,2,2,2],[2,2,1,2],[1,1,4,1],[2,3,1,1],[1,3,2,1],[4,1,1,1],[2,1,3,1],[3,1,2,1],[2,1,1,3]]},CODE_FREQUENCY:{value:[0,11,13,14,19,25,28,21,22,26]},SINGLE_CODE_ERROR:{value:.7},AVG_CODE_ERROR:{value:.48},FORMAT:{value:"ean_13",writeable:!1}};r.prototype=Object.create(c.a.prototype,u),r.prototype.constructor=r,r.prototype._decodeCode=function(e,t){var n,r,i,o=[0,0,0,0],a=this,c=e,s=!a._row[c],u=0,f={error:Number.MAX_VALUE,code:-1,start:e,end:e};for(t||(t=a.CODE_PATTERN.length),n=c;n<a._row.length;n++)if(a._row[n]^s)o[u]++;else{if(u===o.length-1){for(r=0;r<t;r++)i=a._matchPattern(o,a.CODE_PATTERN[r]),i<f.error&&(f.code=r,f.error=i);return f.end=n,f.error>a.AVG_CODE_ERROR?null:f}u++,o[u]=1,s=!s}return null},r.prototype._findPattern=function(e,t,n,r,i){var o,a,c,s,u=[],f=this,d=0,l={error:Number.MAX_VALUE,code:-1,start:0,end:0};for(t||(t=f._nextSet(f._row)),void 0===n&&(n=!1),void 0===r&&(r=!0),void 0===i&&(i=f.AVG_CODE_ERROR),o=0;o<e.length;o++)u[o]=0;for(o=t;o<f._row.length;o++)if(f._row[o]^n)u[d]++;else{if(d===u.length-1){for(s=0,c=0;c<u.length;c++)s+=u[c];if(a=f._matchPattern(u,e),a<i)return l.error=a,l.start=o-s,l.end=o,l;if(!r)return null;for(c=0;c<u.length-2;c++)u[c]=u[c+2];u[u.length-2]=0,u[u.length-1]=0,d--}else d++;u[d]=1,n=!n}return null},r.prototype._findStart=function(){for(var e,t,n=this,r=n._nextSet(n._row);!t;){if(t=n._findPattern(n.START_PATTERN,r),!t)return null;if(e=t.start-(t.end-t.start),e>=0&&n._matchRange(e,t.start,0))return t;r=t.end,t=null}},r.prototype._verifyTrailingWhitespace=function(e){var t,n=this;return t=e.end+(e.end-e.start),t<n._row.length&&n._matchRange(e.end,t,0)?e:null},r.prototype._findEnd=function(e,t){var n=this,r=n._findPattern(n.STOP_PATTERN,e,t,!1);return null!==r?n._verifyTrailingWhitespace(r):null},r.prototype._calculateFirstDigit=function(e){var t,n=this;for(t=0;t<n.CODE_FREQUENCY.length;t++)if(e===n.CODE_FREQUENCY[t])return t;return null},r.prototype._decodePayload=function(e,t,n){var r,i,o=this,a=0;for(r=0;r<6;r++){if(e=o._decodeCode(e.end),!e)return null;e.code>=o.CODE_G_START?(e.code=e.code-o.CODE_G_START,a|=1<<5-r):a|=0<<5-r,t.push(e.code),n.push(e)}if(i=o._calculateFirstDigit(a),null===i)return null;if(t.unshift(i),e=o._findPattern(o.MIDDLE_PATTERN,e.end,!0,!1),null===e)return null;for(n.push(e),r=0;r<6;r++){if(e=o._decodeCode(e.end,o.CODE_G_START),!e)return null;n.push(e),t.push(e.code)}return e},r.prototype._decode=function(){var e,t,n=this,r=[],i=[],o={};if(e=n._findStart(),!e)return null;if(t={code:e.code,start:e.start,end:e.end},i.push(t),t=n._decodePayload(t,r,i),!t)return null;if(t=n._findEnd(t.end,!1),!t)return null;if(i.push(t),!n._checksum(r))return null;if(this.supplements.length>0){var a=this._decodeExtensions(t.end);if(!a)return null;var c=a.decodedCodes[a.decodedCodes.length-1],u={start:c.start+((c.end-c.start)/2|0),end:c.end};if(!n._verifyTrailingWhitespace(u))return null;o={supplement:a,code:r.join("")+a.code}}return s({code:r.join(""),start:e.start,end:t.end,codeset:"",startInfo:e,decodedCodes:i},o)},r.prototype._decodeExtensions=function(e){var t,n,r=this._nextSet(this._row,e),i=this._findPattern(this.EXTENSION_START_PATTERN,r,!1,!1);if(null===i)return null;for(t=0;t<this.supplements.length;t++)if(n=this.supplements[t].decode(this._row,i.end),null!==n)return{code:n.code,start:r,startInfo:i,end:n.end,codeset:"",decodedCodes:n.decodedCodes};return null},r.prototype._checksum=function(e){var t,n=0;for(t=e.length-2;t>=0;t-=2)n+=e[t];for(n*=3,t=e.length-1;t>=0;t-=2)n+=e[t];return n%10===0},r.CONFIG_KEYS={supplements:{type:"arrayOf(string)","default":[],description:"Allowed extensions to be decoded (2 and/or 5)"}},t.a=r},function(e,t,n){function r(e,t){var n=o(e,t);return i(n)?n:void 0}var i=n(115),o=n(137);e.e=r},function(e,t,n){var r=Array.isArray;e.e=r},function(e,t,n){function r(e,t){return this._row=[],this.config=e||{},this.supplements=t,this}r.prototype._nextUnset=function(e,t){var n;for(void 0===t&&(t=0),n=t;n<e.length;n++)if(!e[n])return n;return e.length},r.prototype._matchPattern=function(e,t,n){var r,i,o,a,c=0,s=0,u=0,f=0;for(n=n||this.SINGLE_CODE_ERROR||1,r=0;r<e.length;r++)u+=e[r],f+=t[r];if(u<f)return Number.MAX_VALUE;for(i=u/f,n*=i,r=0;r<e.length;r++){if(o=e[r],a=t[r]*i,s=Math.abs(o-a)/a,s>n)return Number.MAX_VALUE;c+=s}return c/f},r.prototype._nextSet=function(e,t){var n;for(t=t||0,n=t;n<e.length;n++)if(e[n])return n;return e.length},r.prototype._correctBars=function(e,t,n){for(var r=n.length,i=0;r--;)i=e[n[r]]*(1-(1-t)/2),i>1&&(e[n[r]]=i)},r.prototype._matchTrace=function(e,t){var n,r,i=[],o=this,a=o._nextSet(o._row),c=!o._row[a],s=0,u={error:Number.MAX_VALUE,code:-1,start:0};if(e){for(n=0;n<e.length;n++)i.push(0);for(n=a;n<o._row.length;n++)if(o._row[n]^c)i[s]++;else{if(s===i.length-1)return r=o._matchPattern(i,e),r<t?(u.start=n-a,u.end=n,u.counter=i,u):null;s++,i[s]=1,c=!c}}else for(i.push(0),n=a;n<o._row.length;n++)o._row[n]^c?i[s]++:(s++,i.push(0),i[s]=1,c=!c);return u.start=a,u.end=o._row.length-1,u.counter=i,u},r.prototype.decodePattern=function(e){var t,n=this;return n._row=e,t=n._decode(),null===t?(n._row.reverse(),t=n._decode(),t&&(t.direction=r.DIRECTION.REVERSE,t.start=n._row.length-t.start,t.end=n._row.length-t.end)):t.direction=r.DIRECTION.FORWARD,t&&(t.format=n.FORMAT),t},r.prototype._matchRange=function(e,t,n){var r;for(e=e<0?0:e,r=e;r<t;r++)if(this._row[r]!==n)return!1;return!0},r.prototype._fillCounters=function(e,t,n){var r,i=this,o=0,a=[];for(n="undefined"==typeof n||n,e="undefined"!=typeof e?e:i._nextUnset(i._row),t=t||i._row.length,a[o]=0,r=e;r<t;r++)i._row[r]^n?a[o]++:(o++,a[o]=1,n=!n);return a},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={},t.a=r},function(e,t,n){function r(e){var t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t}e.e=r},function(e,t,n){t.a={init:function(e,t){for(var n=e.length;n--;)e[n]=t},shuffle:function(e){var t,n,r=e.length-1;for(r;r>=0;r--)t=Math.floor(Math.random()*r),n=e[r],e[r]=e[t],e[t]=n;return e},toPointList:function(e){var t,n,r=[],i=[];for(t=0;t<e.length;t++){for(r=[],n=0;n<e[t].length;n++)r[n]=e[t][n];i[t]="["+r.join(",")+"]"}return"["+i.join(",\r\n")+"]"},threshold:function(e,t,n){var r,i=[];for(r=0;r<e.length;r++)n.apply(e,[e[r]])>=t&&i.push(e[r]);return i},maxIndex:function(e){var t,n=0;for(t=0;t<e.length;t++)e[t]>e[n]&&(n=t);return n},max:function r(e){var t,r=0;for(t=0;t<e.length;t++)e[t]>r&&(r=e[t]);return r},sum:function i(e){for(var t=e.length,i=0;t--;)i+=e[t];return i}}},function(e,t,n){t.a={drawRect:function(e,t,n,r){n.strokeStyle=r.color,n.fillStyle=r.color,n.lineWidth=1,n.beginPath(),n.strokeRect(e.x,e.y,t.x,t.y)},drawPath:function(e,t,n,r){n.strokeStyle=r.color,n.fillStyle=r.color,n.lineWidth=r.lineWidth,n.beginPath(),n.moveTo(e[0][t.x],e[0][t.y]);for(var i=1;i<e.length;i++)n.lineTo(e[i][t.x],e[i][t.y]);n.closePath(),n.stroke()},drawImage:function(e,t,n){var r,i=n.getImageData(0,0,t.x,t.y),o=i.data,a=e.length,c=o.length;if(c/a!==4)return!1;for(;a--;)r=e[a],o[--c]=255,o[--c]=r,o[--c]=r,o[--c]=r;return n.putImageData(i,0,0),!0}}},function(e,t,n){function r(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}var i=n(150),o=n(151),a=n(152),c=n(153),s=n(154);r.prototype.clear=i,r.prototype["delete"]=o,r.prototype.get=a,r.prototype.has=c,r.prototype.set=s,e.e=r},function(e,t,n){function r(e,t){for(var n=e.length;n--;)if(i(e[n][0],t))return n;return-1}var i=n(14);e.e=r},function(e,t,n){function r(e,t){var n=e.__data__;return i(t)?n["string"==typeof t?"string":"hash"]:n.map}var i=n(148);e.e=r},function(e,t,n){var r=n(4),i=r(Object,"create");e.e=i},function(e,t,n){function r(e,t){return e===t||e!==e&&t!==t}e.e=r},function(e,t,n){function r(e){return null!=e&&o(e.length)&&!i(e)}var i=n(31),o=n(56);e.e=r},function(e,t,n){function r(e){return!!e&&"object"==typeof e}e.e=r},function(e,t,n){function r(e,t){var n={x:e,y:t,toVec2:function(){return w.clone([this.x,this.y])},toVec3:function(){return C.clone([this.x,this.y,1])},round:function(){return this.x=this.x>0?Math.floor(this.x+.5):Math.floor(this.x-.5),this.y=this.y>0?Math.floor(this.y+.5):Math.floor(this.y-.5),this}};return n}function i(e,t,n){n||(n=e);for(var r=e.data,i=r.length,o=n.data;i--;)o[i]=r[i]<t?1:0}function o(e,t){t||(t=8);for(var n=e.data,r=n.length,i=8-t,o=1<<t,a=new Int32Array(o);r--;)a[n[r]>>i]++;return a}function a(e,t){function n(e,t){var n,r=0;for(n=e;n<=t;n++)r+=a[n];return r}function r(e,t){var n,r=0;for(n=e;n<=t;n++)r+=n*a[n];return r}function i(){var i,c,s,u,f,d,l,p=[0],h=(1<<t)-1;for(a=o(e,t),u=1;u<h;u++)i=n(0,u),c=n(u+1,h),s=i*c,0===s&&(s=1),f=r(0,u)*c,d=r(u+1,h)*i,l=f-d,p[u]=l*l/s;return _.a.maxIndex(p)}t||(t=8);var a,c,s=8-t;return c=i(),c<<s}function c(e,t){var n=a(e);return i(e,n,t),n}function s(e,t,n){function r(e){var t=!1;for(o=0;o<s.length;o++)a=s[o],a.fits(e)&&(a.add(e),t=!0);return t}var i,o,a,c,s=[];for(n||(n="rad"),i=0;i<e.length;i++)c=b.a.createPoint(e[i],i,n),r(c)||s.push(b.a.create(c,t));return s}function u(e,t,n){var r,i,o,a,c=0,s=0,u=[];for(r=0;r<t;r++)u[r]={score:0,item:null};for(r=0;r<e.length;r++)if(i=n.apply(this,[e[r]]),i>s)for(o=u[c],o.score=i,o.item=e[r],s=Number.MAX_VALUE,a=0;a<t;a++)u[a].score<s&&(s=u[a].score,c=a);return u}function f(e,t,n){for(var r,i=0,o=t.x,a=Math.floor(e.length/4),c=t.x/2,s=0,u=t.x;o<a;){for(r=0;r<c;r++)n[s]=Math.floor((.299*e[4*i+0]+.587*e[4*i+1]+.114*e[4*i+2]+(.299*e[4*(i+1)+0]+.587*e[4*(i+1)+1]+.114*e[4*(i+1)+2])+(.299*e[4*o+0]+.587*e[4*o+1]+.114*e[4*o+2])+(.299*e[4*(o+1)+0]+.587*e[4*(o+1)+1]+.114*e[4*(o+1)+2]))/4),s++,i+=2,o+=2;i+=u,o+=u}}function d(e,t,n){var r,i=e.length/4|0,o=n&&n.singleChannel===!0;if(o)for(r=0;r<i;r++)t[r]=e[4*r+0];else for(r=0;r<i;r++)t[r]=Math.floor(.299*e[4*r+0]+.587*e[4*r+1]+.114*e[4*r+2])}function l(e,t){for(var n=e.data,r=e.size.x,i=t.data,o=0,a=r,c=n.length,s=r/2,u=0;a<c;){for(var f=0;f<s;f++)i[u]=Math.floor((n[o]+n[o+1]+n[a]+n[a+1])/4),u++,o+=2,a+=2;o+=r,a+=r}}function p(e,t){var n=e[0],r=e[1],i=e[2],o=i*r,a=o*(1-Math.abs(n/60%2-1)),c=i-o,s=0,u=0,f=0;return t=t||[0,0,0],n<60?(s=o,u=a):n<120?(s=a,u=o):n<180?(u=o,f=a):n<240?(u=a,f=o):n<300?(s=a,f=o):n<360&&(s=o,f=a),t[0]=255*(s+c)|0,t[1]=255*(u+c)|0,t[2]=255*(f+c)|0,t}function h(e){var t,n=[],r=[];for(t=1;t<Math.sqrt(e)+1;t++)e%t===0&&(r.push(t),t!==e/t&&n.unshift(Math.floor(e/t)));return r.concat(n)}function v(e,t){for(var n=0,r=0,i=[];n<e.length&&r<t.length;)e[n]===t[r]?(i.push(e[n]),n++,r++):e[n]>t[r]?r++:n++;return i}function g(e,t){function n(e){for(var t=0,n=e[Math.floor(e.length/2)];t<e.length-1&&e[t]<l;)t++;return t>0&&(n=Math.abs(e[t]-l)>Math.abs(e[t-1]-l)?e[t-1]:e[t]),l/n<s[f+1]/s[f]&&l/n>s[f-1]/s[f]?{x:n,y:n}:null}var r,i=h(t.x),o=h(t.y),a=Math.max(t.x,t.y),c=v(i,o),s=[8,10,15,20,32,60,80],u={"x-small":5,small:4,medium:3,large:2,"x-large":1},f=u[e]||u.medium,d=s[f],l=Math.floor(a/d);return r=n(c),r||(r=n(h(a)),r||(r=n(h(l*d)))),r}function m(e){var t={value:parseFloat(e),unit:(e.indexOf("%")===e.length-1,"%")};return t}function y(e,t,n){var r={width:e,height:t},i=Object.keys(n).reduce(function(e,t){var i=n[t],o=m(i),a=E[t](o,r);return e[t]=a,e},{});return{sx:i.left,sy:i.top,sw:i.right-i.left,sh:i.bottom-i.top}}var b=n(63),_=n(8);t.f=r,t.c=c,t.d=s,t.e=u,t.i=f,t.j=d,t.g=l,t.a=p,t.b=g,t.h=y;var w={clone:n(7)},C={clone:n(94)},E={top:function(e,t){if("%"===e.unit)return Math.floor(t.height*(e.value/100))},right:function(e,t){if("%"===e.unit)return Math.floor(t.width-t.width*(e.value/100))},bottom:function(e,t){if("%"===e.unit)return Math.floor(t.height-t.height*(e.value/100))},left:function(e,t){if("%"===e.unit)return Math.floor(t.width*(e.value/100))}}},function(e,t,n){function r(e,t,n,r){t?this.data=t:n?(this.data=new n(e.x*e.y),n===Array&&r&&a.a.init(this.data,0)):(this.data=new Uint8Array(e.x*e.y),Uint8Array===Array&&r&&a.a.init(this.data,0)),this.size=e}var i=n(66),o=n(17),a=n(8),c={clone:n(7)};r.prototype.inImageWithBorder=function(e,t){return e.x>=t&&e.y>=t&&e.x<this.size.x-t&&e.y<this.size.y-t},r.sample=function(e,t,n){var r=Math.floor(t),i=Math.floor(n),o=e.size.x,a=i*e.size.x+r,c=e.data[a+0],s=e.data[a+1],u=e.data[a+o],f=e.data[a+o+1],d=c-s;t-=r,n-=i;var l=Math.floor(t*(n*(d-u+f)-d)+n*(u-c)+c);return l},r.clearArray=function(e){for(var t=e.length;t--;)e[t]=0},r.prototype.subImage=function(e,t){return new i.a(e,t,this)},r.prototype.subImageAsCopy=function(e,t){var n,r,i=e.size.y,o=e.size.x;for(n=0;n<o;n++)for(r=0;r<i;r++)e.data[r*o+n]=this.data[(t.y+r)*this.size.x+t.x+n]},r.prototype.copyTo=function(e){for(var t=this.data.length,n=this.data,r=e.data;t--;)r[t]=n[t]},r.prototype.get=function(e,t){return this.data[t*this.size.x+e]},r.prototype.getSafe=function(e,t){var n;if(!this.indexMapping){for(this.indexMapping={x:[],y:[]},n=0;n<this.size.x;n++)this.indexMapping.x[n]=n,this.indexMapping.x[n+this.size.x]=n;for(n=0;n<this.size.y;n++)this.indexMapping.y[n]=n,this.indexMapping.y[n+this.size.y]=n}return this.data[this.indexMapping.y[t+this.size.y]*this.size.x+this.indexMapping.x[e+this.size.x]]},r.prototype.set=function(e,t,n){return this.data[t*this.size.x+e]=n,this},r.prototype.zeroBorder=function(){var e,t=this.size.x,n=this.size.y,r=this.data;for(e=0;e<t;e++)r[e]=r[(n-1)*t+e]=0;for(e=1;e<n-1;e++)r[e*t]=r[e*t+(t-1)]=0},r.prototype.invert=function(){for(var e=this.data,t=e.length;t--;)e[t]=e[t]?0:1},r.prototype.convolve=function(e){var t,n,r,i,o=e.length/2|0,a=0;for(n=0;n<this.size.y;n++)for(t=0;t<this.size.x;t++){for(a=0,i=-o;i<=o;i++)for(r=-o;r<=o;r++)a+=e[i+o][r+o]*this.getSafe(t+r,n+i);this.data[n*this.size.x+t]=a}},r.prototype.moments=function(e){var t,n,r,i,o,a,s,u,f,d,l,p,h=this.data,v=this.size.y,g=this.size.x,m=[],y=[],b=Math.PI,_=b/4;if(e<=0)return y;for(o=0;o<e;o++)m[o]={m00:0,m01:0,m10:0,m11:0,m02:0,m20:0,theta:0,rad:0};for(n=0;n<v;n++)for(i=n*n,t=0;t<g;t++)r=h[n*g+t],r>0&&(a=m[r-1],a.m00+=1,a.m01+=n,a.m10+=t,a.m11+=t*n,a.m02+=i,a.m20+=t*t);for(o=0;o<e;o++)a=m[o],isNaN(a.m00)||0===a.m00||(d=a.m10/a.m00,l=a.m01/a.m00,s=a.m11/a.m00-d*l,u=a.m02/a.m00-l*l,f=a.m20/a.m00-d*d,p=(u-f)/(2*s),p=.5*Math.atan(p)+(s>=0?_:-_)+b,a.theta=(180*p/b+90)%180-90,a.theta<0&&(a.theta+=180),a.rad=p>b?p-b:p,a.vec=c.clone([Math.cos(p),Math.sin(p)]),y.push(a));return y},r.prototype.show=function(e,t){var n,r,i,o,a,c,s;for(t||(t=1),n=e.getContext("2d"),e.width=this.size.x,e.height=this.size.y,r=n.getImageData(0,0,e.width,e.height),i=r.data,o=0,s=0;s<this.size.y;s++)for(c=0;c<this.size.x;c++)a=s*this.size.x+c,o=this.get(c,s)*t,i[4*a+0]=o,i[4*a+1]=o,i[4*a+2]=o,i[4*a+3]=255;n.putImageData(r,0,0)},r.prototype.overlay=function(e,t,n){(!t||t<0||t>360)&&(t=360);for(var r=[0,1,1],i=[0,0,0],a=[255,255,255],c=[0,0,0],s=[],u=e.getContext("2d"),f=u.getImageData(n.x,n.y,this.size.x,this.size.y),d=f.data,l=this.data.length;l--;)r[0]=this.data[l]*t,s=r[0]<=0?a:r[0]>=360?c:o.a.bind()(r,i),d[4*l+0]=s[0],d[4*l+1]=s[1],d[4*l+2]=s[2],d[4*l+3]=255;u.putImageData(f,n.x,n.y)},t.a=r},function(e,t,n){var r=n(4),i=n(1),o=r(i,"Map");e.e=o},function(e,t,n){function r(e,t){for(var n=-1,r=e?e.length:0,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}e.e=r},function(e,t,n){function r(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}e.e=r},function(e,t,n){function r(e,t){return t=o(void 0===t?e.length-1:t,0),function(){for(var n=arguments,r=-1,a=o(n.length-t,0),c=Array(a);++r<a;)c[r]=n[t+r];r=-1;for(var s=Array(t+1);++r<t;)s[r]=n[r];return s[t]=c,i(e,this,s)}}var i=n(104),o=Math.max;e.e=r},function(e,t,n){function r(e){var t=new e.constructor(e.byteLength);return new i(t).set(new i(e)),t}var i=n(100);e.e=r},function(e,t,n){function r(e,t,n,r){n||(n={});for(var o=-1,a=t.length;++o<a;){var c=t[o],s=r?r(n[c],e[c],c,n,e):void 0;i(n,c,void 0===s?e[c]:s)}return n}var i=n(44);e.e=r},function(e,t,n){var r=n(29),i=r(Object.getPrototypeOf,Object);e.e=i},function(e,t,n){var r=n(29),i=n(59),o=Object.getOwnPropertySymbols,a=o?r(o,Object):i;e.e=a},function(e,t,n){function r(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(n){}return t}e.e=r},function(e,t,n){function r(e){var t=e&&e.constructor,n="function"==typeof t&&t.prototype||i;return e===n}var i=Object.prototype;e.e=r},function(e,t,n){function r(e,t){return function(n){return e(t(n))}}e.e=r},function(e,t,n){function r(e){return i(e)&&c.call(e,"callee")&&(!u.call(e,"callee")||s.call(e)==o)}var i=n(55),o="[object Arguments]",a=Object.prototype,c=a.hasOwnProperty,s=a.toString,u=a.propertyIsEnumerable;e.e=r},function(e,t,n){function r(e){var t=i(e)?s.call(e):"";return t==o||t==a}var i=n(2),o="[object Function]",a="[object GeneratorFunction]",c=Object.prototype,s=c.toString;e.e=r},function(e,t,n){function r(e){return a(e)?i(e):o(e)}var i=n(41),o=n(117),a=n(15);e.e=r},function(e,t,n){var r=n(118),i=n(132),o=i(function(e,t,n){r(e,t,n)});e.e=o},function(e,t,n){var r={searchDirections:[[0,1],[1,1],[1,0],[1,-1],[0,-1],[-1,-1],[-1,0],[-1,1]],create:function(e,t){function n(e,t,n,r){var i,f,d;for(i=0;i<7;i++){if(f=e.cy+s[e.dir][0],d=e.cx+s[e.dir][1],o=f*u+d,a[o]===t&&(0===c[o]||c[o]===n))return c[o]=n,e.cy=f,e.cx=d,!0;0===c[o]&&(c[o]=r),e.dir=(e.dir+1)%8}return!1}function r(e,t,n){return{dir:n,x:e,y:t,next:null,prev:null}}function i(e,t,i,o,a){var c,s,u,f=null,d={cx:t,cy:e,dir:0};if(n(d,o,i,a)){f=r(t,e,d.dir),c=f,u=d.dir,s=r(d.cx,d.cy,0),s.prev=c,c.next=s,s.next=null,c=s;do d.dir=(d.dir+6)%8,n(d,o,i,a),u!==d.dir?(c.dir=d.dir,s=r(d.cx,d.cy,0),s.prev=c,c.next=s,s.next=null,c=s):(c.dir=u,c.x=d.cx,c.y=d.cy),u=d.dir;while(d.cx!==t||d.cy!==e);f.prev=c.prev,c.prev.next=f}return f}var o,a=e.data,c=t.data,s=this.searchDirections,u=e.size.x;return{trace:function(e,t,r,i){return n(e,t,r,i)},contourTracing:function(e,t,n,r,o){return i(e,t,n,r,o)}}}};t.a=r},function(e,t,n){function r(){i.a.call(this)}var i=n(6),o=n(8),a={ALPHABETH_STRING:{value:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. *$/+%"},ALPHABET:{value:[48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,45,46,32,42,36,47,43,37]},CHARACTER_ENCODINGS:{value:[52,289,97,352,49,304,112,37,292,100,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,148,168,162,138,42]},ASTERISK:{value:148},FORMAT:{value:"code_39",writeable:!1}};r.prototype=Object.create(i.a.prototype,a),r.prototype.constructor=r,r.prototype._toCounters=function(e,t){var n,r=this,i=t.length,a=r._row.length,c=!r._row[e],s=0;for(o.a.init(t,0),n=e;n<a;n++)if(r._row[n]^c)t[s]++;else{if(s++,s===i)break;t[s]=1,c=!c}return t},r.prototype._decode=function(){var e,t,n,r,i=this,a=[0,0,0,0,0,0,0,0,0],c=[],s=i._findStart();if(!s)return null;r=i._nextSet(i._row,s.end);do{if(a=i._toCounters(r,a),n=i._toPattern(a),n<0)return null;if(e=i._patternToChar(n),e<0)return null;c.push(e),t=r,r+=o.a.sum(a),r=i._nextSet(i._row,r)}while("*"!==e);return c.pop(),c.length&&i._verifyTrailingWhitespace(t,r,a)?{code:c.join(""),start:s.start,end:r,startInfo:s,decodedCodes:c}:null},r.prototype._verifyTrailingWhitespace=function(e,t,n){var r,i=o.a.sum(n);return r=t-e-i,3*r>=i},r.prototype._patternToChar=function(e){var t,n=this;for(t=0;t<n.CHARACTER_ENCODINGS.length;t++)if(n.CHARACTER_ENCODINGS[t]===e)return String.fromCharCode(n.ALPHABET[t]);return-1},r.prototype._findNextWidth=function(e,t){var n,r=Number.MAX_VALUE;for(n=0;n<e.length;n++)e[n]<r&&e[n]>t&&(r=e[n]);return r},r.prototype._toPattern=function(e){for(var t,n,r=e.length,i=0,o=r,a=0,c=this;o>3;){for(i=c._findNextWidth(e,i),o=0,t=0,n=0;n<r;n++)e[n]>i&&(t|=1<<r-1-n,o++,a+=e[n]);if(3===o){for(n=0;n<r&&o>0;n++)if(e[n]>i&&(o--,2*e[n]>=a))return-1;return t}}return-1},r.prototype._findStart=function(){var e,t,n,r=this,i=r._nextSet(r._row),o=i,a=[0,0,0,0,0,0,0,0,0],c=0,s=!1;for(e=i;e<r._row.length;e++)if(r._row[e]^s)a[c]++;else{if(c===a.length-1){if(r._toPattern(a)===r.ASTERISK&&(n=Math.floor(Math.max(0,o-(e-o)/4)),r._matchRange(n,o,0)))return{start:o,end:e};for(o+=a[0]+a[1],t=0;t<7;t++)a[t]=a[t+2];a[7]=0,a[8]=0,c--}else c++;a[c]=1,s=!s}return null},t.a=r},function(e,t,n){function r(e,t){return e[0]*t[0]+e[1]*t[1]}e.e=r},function(e,t,n){function r(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}var i=n(155),o=n(156),a=n(157),c=n(158),s=n(159);r.prototype.clear=i,r.prototype["delete"]=o,r.prototype.get=a,r.prototype.has=c,r.prototype.set=s,e.e=r},function(e,t,n){function r(e){this.__data__=new i(e)}var i=n(10),o=n(167),a=n(168),c=n(169),s=n(170),u=n(171);r.prototype.clear=o,r.prototype["delete"]=a,r.prototype.get=c,r.prototype.has=s,r.prototype.set=u,e.e=r},function(e,t,n){var r=n(1),i=r.Symbol;e.e=i},function(e,t,n){function r(e,t){for(var n=-1,r=e?e.length:0;++n<r&&t(e[n],n,e)!==!1;);return e}e.e=r},function(e,t,n){function r(e,t){var n=a(e)||o(e)?i(e.length,String):[],r=n.length,s=!!r;for(var f in e)!t&&!u.call(e,f)||s&&("length"==f||c(f,r))||n.push(f);return n}var i=n(121),o=n(30),a=n(5),c=n(52),s=Object.prototype,u=s.hasOwnProperty;e.e=r},function(e,t,n){function r(e,t,n,r){var i=-1,o=e?e.length:0;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}e.e=r},function(e,t,n){function r(e,t,n){(void 0===n||i(e[t],n))&&("number"!=typeof t||void 0!==n||t in e)||(e[t]=n)}var i=n(14);e.e=r},function(e,t,n){function r(e,t,n){var r=e[t];a.call(e,t)&&i(r,n)&&(void 0!==n||t in e)||(e[t]=n)}var i=n(14),o=Object.prototype,a=o.hasOwnProperty;e.e=r},function(e,t,n){function r(e,t,n,a,c){var s=-1,u=e.length;for(n||(n=o),c||(c=[]);++s<u;){var f=e[s];t>0&&n(f)?t>1?r(f,t-1,n,a,c):i(c,f):a||(c[c.length]=f)}return c}var i=n(21),o=n(146);e.e=r},function(e,t,n){function r(e,t,n){var r=t(e);return o(e)?r:i(r,n(e))}var i=n(21),o=n(5);e.e=r},function(e,t,n){function r(e){if(!i(e))return a(e);var t=o(e),n=[];for(var r in e)("constructor"!=r||!t&&s.call(e,r))&&n.push(r);return n}var i=n(2),o=n(28),a=n(162),c=Object.prototype,s=c.hasOwnProperty;e.e=r},function(e,t,n){function r(e,t){return e=Object(e),i(e,t,function(t,n){return n in e})}var i=n(120);e.e=r},function(e,t,n){function r(e){return function(t){return e(t)}}e.e=r},function(e,t,n){function r(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}e.e=r},function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.e=n}).call(t,function(){return this}())},function(e,t,n){function r(e,t){return t=null==t?i:t,!!t&&("number"==typeof e||o.test(e))&&e>-1&&e%1==0&&e<t}var i=9007199254740991,o=/^(?:0|[1-9]\d*)$/;e.e=r},function(e,t,n){function r(e){if("string"==typeof e||i(e))return e;var t=e+"";return"0"==t&&1/e==-o?"-0":t}var i=n(174),o=1/0;e.e=r},function(e,t,n){function r(e){if(null!=e){try{return o.call(e)}catch(t){}try{return e+""}catch(t){}}return""}var i=Function.prototype,o=i.toString;e.e=r},function(e,t,n){function r(e){return o(e)&&i(e)}var i=n(15),o=n(16);e.e=r},function(e,t,n){function r(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=i}var i=9007199254740991;e.e=r},function(e,t,n){var r=n(116),i=n(49),o=n(163),a=o&&o.isTypedArray,c=a?i(a):r;e.e=c},function(e,t,n){function r(e){return a(e)?i(e,!0):o(e)}var i=n(41),o=n(47),a=n(15);e.e=r},function(e,t,n){function r(){return[]}e.e=r},function(e,t,n){e.e=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],Object.defineProperty(e,"exports",{enumerable:!0,configurable:!1,get:function(){return e.e},set:function(t){return e.e=t}}),Object.defineProperty(e,"loaded",{enumerable:!0,configurable:!1,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,configurable:!1,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(t,n,r){function i(e){f(e),U=G.a.create(ee.decoder,k)}function o(e){var t;if("VideoStream"===ee.inputStream.type)t=document.createElement("video"),M=X.a.createVideoStream(t);else if("ImageStream"===ee.inputStream.type)M=X.a.createImageStream();else if("LiveStream"===ee.inputStream.type){var n=a();n&&(t=n.querySelector("video"),t||(t=document.createElement("video"),n.appendChild(t))),M=X.a.createLiveStream(t),W.a.request(t,ee.inputStream.constraints).then(function(){M.trigger("canrecord")})["catch"](function(t){return e(t)})}M.setAttribute("preload","auto"),M.setInputStream(ee.inputStream),M.addEventListener("canrecord",c.bind(void 0,e))}function a(){var e=ee.inputStream.target;if(e&&e.nodeName&&1===e.nodeType)return e;var t="string"==typeof e?e:"#interactive.viewport";return document.querySelector(t)}function c(e){F.a.checkImageConstraints(M,ee.locator),u(ee),j=Y.a.create(M,K.dom.image),R(ee.numOfWorkers,function(){0===ee.numOfWorkers&&i(),s(e)})}function s(e){M.play(),e()}function u(){if("undefined"!=typeof document){var e=a();if(K.dom.image=document.querySelector("canvas.imgBuffer"),K.dom.image||(K.dom.image=document.createElement("canvas"),K.dom.image.className="imgBuffer",e&&"ImageStream"===ee.inputStream.type&&e.appendChild(K.dom.image)),K.ctx.image=K.dom.image.getContext("2d"),K.dom.image.width=M.getCanvasSize().x,K.dom.image.height=M.getCanvasSize().y,K.dom.overlay=document.querySelector("canvas.drawingBuffer"),!K.dom.overlay){K.dom.overlay=document.createElement("canvas"),K.dom.overlay.className="drawingBuffer",e&&e.appendChild(K.dom.overlay);var t=document.createElement("br");t.setAttribute("clear","all"),e&&e.appendChild(t)}K.ctx.overlay=K.dom.overlay.getContext("2d"),K.dom.overlay.width=M.getCanvasSize().x,K.dom.overlay.height=M.getCanvasSize().y}}function f(e){k=e?e:new z.a({x:M.getWidth(),y:M.getHeight()}),N=[J.clone([0,0]),J.clone([0,k.size.y]),J.clone([k.size.x,k.size.y]),J.clone([k.size.x,0])],F.a.init(k,ee.locator)}function d(){return ee.locate?F.a.locate():[[J.clone(N[0]),J.clone(N[1]),J.clone(N[2]),J.clone(N[3])]]}function l(e){function t(e){for(var t=e.length;t--;)e[t][0]+=o,e[t][1]+=a}function n(e){e[0].x+=o,e[0].y+=a,e[1].x+=o,e[1].y+=a}var r,i=M.getTopRight(),o=i.x,a=i.y;if(0!==o||0!==a){if(e.barcodes)for(r=0;r<e.barcodes.length;r++)l(e.barcodes[r]);if(e.line&&2===e.line.length&&n(e.line),e.box&&t(e.box),e.boxes&&e.boxes.length>0)for(r=0;r<e.boxes.length;r++)t(e.boxes[r])}}function p(e,t){t&&L&&(e.barcodes?e.barcodes.filter(function(e){return e.codeResult}).forEach(function(e){return p(e,t)}):e.codeResult&&L.addResult(t,M.getCanvasSize(),e.codeResult))}function h(e){return e&&(e.barcodes?e.barcodes.some(function(e){return e.codeResult}):e.codeResult)}function v(e,t){var n=e;e&&Z&&(l(e),p(e,t),n=e.barcodes||e),B.a.publish("processed",n),h(e)&&B.a.publish("detected",n)}function g(){var e,t;t=d(),t?(e=U.decodeFromBoundingBoxes(t),e=e||{},e.boxes=t,v(e,k.data)):v()}function m(){var e;if(Z){if($.length>0){if(e=$.filter(function(e){return!e.busy})[0],!e)return;j.attachData(e.imageData)}else j.attachData(k.data);j.grab()&&(e?(e.busy=!0,e.worker.postMessage({cmd:"process",imageData:e.imageData},[e.imageData.buffer])):g())}else g()}function y(){var e=null,t=1e3/(ee.frequency||60);I=!1,function n(r){e=e||r,I||(r>=e&&(e+=t,m()),window.requestAnimFrame(n))}(performance.now())}function b(){Z&&"LiveStream"===ee.inputStream.type?y():m()}function _(e){var t,n={worker:void 0,imageData:new Uint8Array(M.getWidth()*M.getHeight()),busy:!0};t=E(),n.worker=new Worker(t),n.worker.onmessage=function(r){return"initialized"===r.data.event?(URL.revokeObjectURL(t),n.busy=!1,n.imageData=new Uint8Array(r.data.imageData),e(n)):void("processed"===r.data.event?(n.imageData=new Uint8Array(r.data.imageData),n.busy=!1,v(r.data.result,n.imageData)):"error"===r.data.event)},n.worker.postMessage({cmd:"init",size:{x:M.getWidth(),y:M.getHeight()},imageData:n.imageData,config:w(ee)},[n.imageData.buffer])}function w(e){return Q({},e,{inputStream:Q({},e.inputStream,{target:null})})}function C(e){function t(e){self.postMessage({event:"processed",imageData:i.data,result:e},[i.data.buffer])}function n(){self.postMessage({event:"initialized",imageData:i.data},[i.data.buffer])}if(e){var r=e()["default"];if(!r)return void self.postMessage({event:"error",message:"Quagga could not be created"})}var i;self.onmessage=function(e){if("init"===e.data.cmd){var o=e.data.config;o.numOfWorkers=0,i=new r.ImageWrapper({x:e.data.size.x,y:e.data.size.y},new Uint8Array(e.data.imageData)),r.init(o,n,i),r.onProcessed(t)}else"process"===e.data.cmd?(i.data=new Uint8Array(e.data.imageData),r.start()):"setReaders"===e.data.cmd&&r.setReaders(e.data.readers)}}function E(){var t,n;return"undefined"!=typeof e&&(n=e),t=new Blob(["("+C.toString()+")("+n+");"],{type:"text/javascript"}),window.URL.createObjectURL(t)}function T(e){U?U.setReaders(e):Z&&$.length>0&&$.forEach(function(t){t.worker.postMessage({cmd:"setReaders",readers:e})})}function R(e,t){var n=e-$.length;if(0===n)return t&&t();if(n<0){var r=$.slice(n);return r.forEach(function(e){e.worker.terminate()}),$=$.slice(0,n),t&&t()}for(var i=function(n){$.push(n),$.length>=e&&t&&t()},o=0;o<n;o++)_(i)}var S=r(33),x=S&&S.__esModule?function(){return S["default"]}:function(){return S};Object.defineProperty(x,"a",{get:x});var O=r(67),P=O&&O.__esModule?function(){return O["default"]}:function(){return O};Object.defineProperty(P,"a",{get:P});var D=r(180),A=D&&D.__esModule?function(){
|
|
return D["default"]}:function(){return D};Object.defineProperty(A,"a",{get:A});var M,j,I,k,N,U,L,z=r(18),F=r(77),G=r(70),B=r(64),W=r(72),V=r(9),H=r(62),q=r(68),X=r(76),Y=r(74),Q=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},J={clone:r(7)},K={ctx:{image:null,overlay:null},dom:{image:null,overlay:null}},$=[],Z=!0,ee={};n["default"]={init:function(e,t,n){return ee=x.a.bind()({},q.a,e),n?(Z=!1,i(n),t()):void o(t)},start:function(){b()},stop:function(){I=!0,R(0),"LiveStream"===ee.inputStream.type&&(W.a.release(),M.clearEventHandlers())},pause:function(){I=!0},onDetected:function(e){B.a.subscribe("detected",e)},offDetected:function(e){B.a.unsubscribe("detected",e)},onProcessed:function(e){B.a.subscribe("processed",e)},offProcessed:function(e){B.a.unsubscribe("processed",e)},setReaders:function(e){T(e)},registerResultCollector:function(e){e&&"function"==typeof e.addResult&&(L=e)},canvas:K,decodeSingle:function(e,t){var n=this;e=x.a.bind()({inputStream:{type:"ImageStream",sequence:!1,size:800,src:e.src},numOfWorkers:1,locator:{halfSample:!1}},e),this.init(e,function(){B.a.once("processed",function(e){n.stop(),t.call(null,e)},!0),b()})},ImageWrapper:z.a,ImageDebug:V.a,ResultCollector:H.a}},function(e,t,n){function r(e,t){return!!t&&t.some(function(t){return Object.keys(t).every(function(n){return t[n]===e[n]})})}function i(e,t){return"function"!=typeof t||t(e)}var o=n(9);t.a={create:function(e){function t(t){return s&&t&&!r(t,e.blacklist)&&i(t,e.filter)}var n=document.createElement("canvas"),a=n.getContext("2d"),c=[],s=e.capacity||20,u=e.capture===!0;return{addResult:function(e,r,i){var f={};t(i)&&(s--,f.codeResult=i,u&&(n.width=r.x,n.height=r.y,o.a.drawImage(e,r,a),f.frame=n.toDataURL()),c.push(f))},getResults:function(){return c}}}}},function(e,t,n){var r={clone:n(7),dot:n(36)};t.a={create:function(e,t){function n(){i(e),o()}function i(e){s[e.id]=e,a.push(e)}function o(){var e,t=0;for(e=0;e<a.length;e++)t+=a[e].rad;c.rad=t/a.length,c.vec=r.clone([Math.cos(c.rad),Math.sin(c.rad)])}var a=[],c={rad:0,vec:r.clone([0,0])},s={};return n(),{add:function(e){s[e.id]||(i(e),o())},fits:function(e){var n=Math.abs(r.dot(e.point.vec,c.vec));return n>t},getPoints:function(){return a},getCenter:function(){return c}}},createPoint:function(e,t,n){return{rad:e[n],point:e,id:t}}}},function(e,t,n){t.a=function(){function e(e){return i[e]||(i[e]={subscribers:[]}),i[e]}function t(){i={}}function n(e,t){e.async?setTimeout(function(){e.callback(t)},4):e.callback(t)}function r(t,n,r){var i;if("function"==typeof n)i={callback:n,async:r};else if(i=n,!i.callback)throw"Callback was not specified on options";e(t).subscribers.push(i)}var i={};return{subscribe:function(e,t,n){return r(e,t,n)},publish:function(t,r){var i=e(t),o=i.subscribers;o.filter(function(e){return!!e.once}).forEach(function(e){n(e,r)}),i.subscribers=o.filter(function(e){return!e.once}),i.subscribers.forEach(function(e){n(e,r)})},once:function(e,t,n){r(e,{callback:t,async:n,once:!0})},unsubscribe:function(n,r){var i;n?(i=e(n),i&&r?i.subscribers=i.subscribers.filter(function(e){return e.callback!==r}):i.subscribers=[]):t()}}}()},function(e,t,n){function r(){return navigator.mediaDevices&&"function"==typeof navigator.mediaDevices.enumerateDevices?navigator.mediaDevices.enumerateDevices():Promise.reject(new Error("enumerateDevices is not defined"))}function i(e){return navigator.mediaDevices&&"function"==typeof navigator.mediaDevices.getUserMedia?navigator.mediaDevices.getUserMedia(e):Promise.reject(new Error("getUserMedia is not defined"))}t.b=r,t.a=i},function(e,t,n){function r(e,t,n){n||(n={data:null,size:t}),this.data=n.data,this.originalSize=n.size,this.I=n,this.from=e,this.size=t}r.prototype.show=function(e,t){var n,r,i,o,a,c,s;for(t||(t=1),n=e.getContext("2d"),e.width=this.size.x,e.height=this.size.y,r=n.getImageData(0,0,e.width,e.height),i=r.data,o=0,a=0;a<this.size.y;a++)for(c=0;c<this.size.x;c++)s=a*this.size.x+c,o=this.get(c,a)*t,i[4*s+0]=o,i[4*s+1]=o,i[4*s+2]=o,i[4*s+3]=255;r.data=i,n.putImageData(r,0,0)},r.prototype.get=function(e,t){return this.data[(this.from.y+t)*this.originalSize.x+this.from.x+e]},r.prototype.updateData=function(e){this.originalSize=e.size,this.data=e.data},r.prototype.updateFrom=function(e){return this.from=e,this},t.a=r},function(e,t){"undefined"!=typeof window&&(window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}()),Math.imul=Math.imul||function(e,t){var n=e>>>16&65535,r=65535&e,i=t>>>16&65535,o=65535&t;return r*o+(n*o+r*i<<16>>>0)|0}},function(e,t,n){var r=void 0;r=n(69),t.a=r},function(e,t,n){e.e={inputStream:{name:"Live",type:"LiveStream",constraints:{width:640,height:480,facingMode:"environment"},area:{top:"0%",right:"0%",left:"0%",bottom:"0%"},singleChannel:!1},locate:!0,numOfWorkers:4,decoder:{readers:["code_128_reader"]},locator:{halfSample:!0,patchSize:"medium"}}},function(e,t,n){var r=n(71),i=(n(9),n(81)),o=n(3),a=n(35),c=n(82),s=n(80),u=n(88),f=n(85),d=n(83),l=n(84),p=n(87),h=n(86),v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},g={code_128_reader:i.a,ean_reader:o.a,ean_5_reader:l.a,ean_2_reader:d.a,ean_8_reader:f.a,code_39_reader:a.a,code_39_vin_reader:c.a,codabar_reader:s.a,upc_reader:u.a,upc_e_reader:p.a,i2of5_reader:h.a};t.a={create:function(e,t){function n(){}function i(){e.readers.forEach(function(e){var t,n={},r=[];"object"===("undefined"==typeof e?"undefined":v(e))?(t=e.format,n=e.config):"string"==typeof e&&(t=e),n.supplements&&(r=n.supplements.map(function(e){return new g[e]})),p.push(new g[t](n,r))})}function o(){}function a(e,n,r){function i(t){var r={y:t*Math.sin(n),x:t*Math.cos(n)};e[0].y-=r.y,e[0].x-=r.x,e[1].y+=r.y,e[1].x+=r.x}for(i(r);r>1&&(!t.inImageWithBorder(e[0],0)||!t.inImageWithBorder(e[1],0));)r-=Math.ceil(r/2),i(-r);return e}function c(e){return[{x:(e[1][0]-e[0][0])/2+e[0][0],y:(e[1][1]-e[0][1])/2+e[0][1]},{x:(e[3][0]-e[2][0])/2+e[2][0],y:(e[3][1]-e[2][1])/2+e[2][1]}]}function s(e){var n,i=null,o=r.a.getBarcodeLine(t,e[0],e[1]);for(r.a.toBinaryLine(o),n=0;n<p.length&&null===i;n++)i=p[n].decodePattern(o.line);return null===i?null:{codeResult:i,barcodeLine:o}}function u(e,t,n){var r,i,o,a=Math.sqrt(Math.pow(e[1][0]-e[0][0],2)+Math.pow(e[1][1]-e[0][1],2)),c=16,u=null,f=Math.sin(n),d=Math.cos(n);for(r=1;r<c&&null===u;r++)i=a/c*r*(r%2===0?-1:1),o={y:i*f,x:i*d},t[0].y+=o.x,t[0].x-=o.y,t[1].y+=o.x,t[1].x-=o.y,u=s(t);return u}function f(e){return Math.sqrt(Math.pow(Math.abs(e[1].y-e[0].y),2)+Math.pow(Math.abs(e[1].x-e[0].x),2))}function d(e){var t,n,r,i;l.ctx.overlay;return t=c(e),i=f(t),n=Math.atan2(t[1].y-t[0].y,t[1].x-t[0].x),t=a(t,n,Math.floor(.1*i)),null===t?null:(r=s(t),null===r&&(r=u(e,t,n)),null===r?null:{codeResult:r.codeResult,line:t,angle:n,pattern:r.barcodeLine.line,threshold:r.barcodeLine.threshold})}var l={ctx:{frequency:null,pattern:null,overlay:null},dom:{frequency:null,pattern:null,overlay:null}},p=[];return n(),i(),o(),{decodeFromBoundingBox:function(e){return d(e)},decodeFromBoundingBoxes:function(t){var n,r,i=[],o=e.multiple;for(n=0;n<t.length;n++){var a=t[n];if(r=d(a)||{},r.box=a,o)i.push(r);else if(r.codeResult)return r}if(o)return{barcodes:i}},setReaders:function(t){e.readers=t,p.length=0,i()}}}}},function(e,t,n){var r=(n(18),{}),i={DIR:{UP:1,DOWN:-1}};r.getBarcodeLine=function(e,t,n){function r(e,t){d=y[t*b+e],_+=d,w=d<w?d:w,C=d>C?d:C,m.push(d)}var i,o,a,c,s,u,f,d,l=0|t.x,p=0|t.y,h=0|n.x,v=0|n.y,g=Math.abs(v-p)>Math.abs(h-l),m=[],y=e.data,b=e.size.x,_=0,w=255,C=0;for(g&&(u=l,l=p,p=u,u=h,h=v,v=u),l>h&&(u=l,l=h,h=u,u=p,p=v,v=u),i=h-l,o=Math.abs(v-p),a=i/2|0,s=p,c=p<v?1:-1,f=l;f<h;f++)g?r(s,f):r(f,s),a-=o,a<0&&(s+=c,a+=i);return{line:m,min:w,max:C}},r.toBinaryLine=function(e){var t,n,r,o,a,c,s=e.min,u=e.max,f=e.line,d=s+(u-s)/2,l=[],p=(u-s)/12,h=-p;for(r=f[0]>d?i.DIR.UP:i.DIR.DOWN,l.push({pos:0,val:f[0]}),a=0;a<f.length-2;a++)t=f[a+1]-f[a],n=f[a+2]-f[a+1],o=t+n<h&&f[a+1]<1.5*d?i.DIR.DOWN:t+n>p&&f[a+1]>.5*d?i.DIR.UP:r,r!==o&&(l.push({pos:a,val:f[a]}),r=o);for(l.push({pos:f.length,val:f[f.length-1]}),c=l[0].pos;c<l[1].pos;c++)f[c]=f[c]>d?0:1;for(a=1;a<l.length-1;a++)for(p=l[a+1].val>l[a].val?l[a].val+(l[a+1].val-l[a].val)/3*2|0:l[a+1].val+(l[a].val-l[a+1].val)/3|0,c=l[a].pos;c<l[a+1].pos;c++)f[c]=f[c]>p?0:1;return{line:f,threshold:p}},r.debug={printFrequency:function(e,t){var n,r=t.getContext("2d");for(t.width=e.length,t.height=256,r.beginPath(),r.strokeStyle="blue",n=0;n<e.length;n++)r.moveTo(n,255),r.lineTo(n,255-e[n]);r.stroke(),r.closePath()},printPattern:function(e,t){var n,r=t.getContext("2d");for(t.width=e.length,r.fillColor="black",n=0;n<e.length;n++)1===e[n]&&r.fillRect(n,0,1,100)}},t.a=r},function(e,t,n){function r(e){return new Promise(function(t,n){function r(){i>0?e.videoWidth>0&&e.videoHeight>0?t():window.setTimeout(r,500):n("Unable to play video stream. Is webcam working?"),i--}var i=10;r()})}function i(e,t){return p.a.bind()(t).then(function(t){return new Promise(function(n){l=t,e.setAttribute("autoplay","true"),e.srcObject=t,e.addEventListener("loadedmetadata",function(){e.play(),n()})})}).then(r.bind(null,e))}function o(e){var t=u.a.bind()(e,["width","height","facingMode","aspectRatio","deviceId"]);return"undefined"!=typeof e.minAspectRatio&&e.minAspectRatio>0&&(t.aspectRatio=e.minAspectRatio,console.log("WARNING: Constraint 'minAspectRatio' is deprecated; Use 'aspectRatio' instead")),"undefined"!=typeof e.facing&&(t.facingMode=e.facing,console.log("WARNING: Constraint 'facing' is deprecated. Use 'facingMode' instead'")),t}function a(e){var t=e.video.facingMode,n=v[t];return n?p.b.bind()().then(function(t){var r=t.filter(function(e){return"videoinput"===e.kind&&n.test(e.label)}).map(function(e){return e.deviceId})[0];return r&&(e=h({},e,{video:h({},d.a.bind()(e.video,["facingMode"]),{deviceId:r})})),Promise.resolve(e)}):Promise.resolve(e)}function c(e){var t={audio:!1,video:o(e)};return!t.video.deviceId&&"string"==typeof t.video.facingMode&&t.video.facingMode.length>0?a(t):Promise.resolve(t)}var s=n(176),u=s&&s.__esModule?function(){return s["default"]}:function(){return s};Object.defineProperty(u,"a",{get:u});var f=n(175),d=f&&f.__esModule?function(){return f["default"]}:function(){return f};Object.defineProperty(d,"a",{get:d});var l,p=n(65),h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},v={user:/front/i,environment:/back/i};t.a={request:function(e,t){return c(t).then(i.bind(null,e))},release:function(){var e=l&&l.getVideoTracks();e&&e.length&&e[0].stop(),l=null}}},function(e,t,n){function r(e){var t=arguments.length<=1||void 0===arguments[1]?l:arguments[1];return/^blob\:/i.test(e)?o(e).then(i).then(function(e){return a(e,t)}):Promise.resolve(null)}function i(e){return new Promise(function(t){var n=new FileReader;n.onload=function(e){return t(e.target.result)},n.readAsArrayBuffer(e)})}function o(e){return new Promise(function(t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="blob",r.onreadystatechange=function(){r.readyState!==XMLHttpRequest.DONE||200!==r.status&&0!==r.status||t(this.response)},r.onerror=n,r.send()})}function a(e){var t=arguments.length<=1||void 0===arguments[1]?l:arguments[1],n=new DataView(e),r=e.byteLength,i=t.reduce(function(e,t){var n=Object.keys(d).filter(function(e){return d[e]===t})[0];return n&&(e[n]=t),e},{}),o=2,a=void 0;if(255!==n.getUint8(0)||216!==n.getUint8(1))return!1;for(;o<r;){if(255!==n.getUint8(o))return!1;if(a=n.getUint8(o+1),225===a)return c(n,o+4,i);o+=2+n.getUint16(o+2)}}function c(e,t,n){if("Exif"!==f(e,t,4))return!1;var r=t+6,i=void 0,o=void 0;if(18761===e.getUint16(r))i=!1;else{if(19789!==e.getUint16(r))return!1;i=!0}if(42!==e.getUint16(r+2,!i))return!1;var a=e.getUint32(r+4,!i);return!(a<8)&&(o=s(e,r,r+a,n,i))}function s(e,t,n,r,i){for(var o=e.getUint16(n,!i),a={},c=0;c<o;c++){var s=n+12*c+2,f=r[e.getUint16(s,!i)];f&&(a[f]=u(e,s,t,n,i))}return a}function u(e,t,n,r,i){var o=e.getUint16(t+2,!i),a=e.getUint32(t+4,!i);switch(o){case 3:if(1===a)return e.getUint16(t+8,!i)}}function f(e,t,n){for(var r="",i=t;i<t+n;i++)r+=String.fromCharCode(e.getUint8(i));return r}t.a=r;var d={274:"orientation"},l=Object.keys(d).map(function(e){return d[e]})},function(e,t,n){function r(e,t){e.width!==t.x&&(e.width=t.x),e.height!==t.y&&(e.height=t.y)}var i=n(17),o=Math.PI/180,a={};a.create=function(e,t){var n,a={},c=e.getConfig(),s=(i.f.bind()(e.getRealWidth(),e.getRealHeight()),e.getCanvasSize()),u=i.f.bind()(e.getWidth(),e.getHeight()),f=e.getTopRight(),d=f.x,l=f.y,p=null,h=null;return n=t?t:document.createElement("canvas"),n.width=s.x,n.height=s.y,p=n.getContext("2d"),h=new Uint8Array(u.x*u.y),a.attachData=function(e){h=e},a.getData=function(){return h},a.grab=function(){var t,a=c.halfSample,f=e.getFrame(),v=f,g=0;if(v){if(r(n,s),"ImageStream"===c.type&&(v=f.img,f.tags&&f.tags.orientation))switch(f.tags.orientation){case 6:g=90*o;break;case 8:g=-90*o}return 0!==g?(p.translate(s.x/2,s.y/2),p.rotate(g),p.drawImage(v,-s.y/2,-s.x/2,s.y,s.x),p.rotate(-g),p.translate(-s.x/2,-s.y/2)):p.drawImage(v,0,0,s.x,s.y),t=p.getImageData(d,l,u.x,u.y).data,a?i.i.bind()(t,u,h):i.j.bind()(t,h,c),!0}return!1},a.getSize=function(){return u},a},t.a=a},function(e,t,n){function r(e,t){e.onload=function(){t.loaded(this)}}var i=n(73),o={};o.load=function(e,t,n,o,a){var c,s,u,f=new Array(o),d=new Array(f.length);if(a===!1)f[0]=e;else for(c=0;c<f.length;c++)u=n+c,f[c]=e+"image-"+("00"+u).slice(-3)+".jpg";for(d.notLoaded=[],d.addImage=function(e){d.notLoaded.push(e)},d.loaded=function(n){for(var r=d.notLoaded,o=0;o<r.length;o++)if(r[o]===n){r.splice(o,1);for(var c=0;c<f.length;c++){var s=f[c].substr(f[c].lastIndexOf("/"));if(n.src.lastIndexOf(s)!==-1){d[c]={img:n};break}}break}0===r.length&&(a===!1?i.a.bind()(e,["orientation"]).then(function(e){d[0].tags=e,t(d)})["catch"](function(e){console.log(e),t(d)}):t(d))},c=0;c<f.length;c++)s=new Image,d.addImage(s),r(s,d),s.src=f[c]},t.a=o},function(e,t,n){var r=n(75),i={};i.createVideoStream=function(e){function t(){var t=e.videoWidth,i=e.videoHeight;n=o.size?t/i>1?o.size:Math.floor(t/i*o.size):t,r=o.size?t/i>1?Math.floor(i/t*o.size):o.size:i,u.x=n,u.y=r}var n,r,i={},o=null,a=["canrecord","ended"],c={},s={x:0,y:0},u={x:0,y:0};return i.getRealWidth=function(){return e.videoWidth},i.getRealHeight=function(){return e.videoHeight},i.getWidth=function(){return n},i.getHeight=function(){return r},i.setWidth=function(e){n=e},i.setHeight=function(e){r=e},i.setInputStream=function(t){o=t,e.src="undefined"!=typeof t.src?t.src:""},i.ended=function(){return e.ended},i.getConfig=function(){return o},i.setAttribute=function(t,n){e.setAttribute(t,n)},i.pause=function(){e.pause()},i.play=function(){e.play()},i.setCurrentTime=function(t){"LiveStream"!==o.type&&(e.currentTime=t)},i.addEventListener=function(t,n,r){a.indexOf(t)!==-1?(c[t]||(c[t]=[]),c[t].push(n)):e.addEventListener(t,n,r)},i.clearEventHandlers=function(){a.forEach(function(t){var n=c[t];n&&n.length>0&&n.forEach(function(n){e.removeEventListener(t,n)})})},i.trigger=function(e,n){var r,o=c[e];if("canrecord"===e&&t(),o&&o.length>0)for(r=0;r<o.length;r++)o[r].apply(i,n)},i.setTopRight=function(e){s.x=e.x,s.y=e.y},i.getTopRight=function(){return s},i.setCanvasSize=function(e){u.x=e.x,u.y=e.y},i.getCanvasSize=function(){return u},i.getFrame=function(){return e},i},i.createLiveStream=function(e){e.setAttribute("autoplay",!0);var t=i.createVideoStream(e);return t.ended=function(){return!1},t},i.createImageStream=function(){function e(){d=!1,r.a.load(v,function(e){if(l=e,e[0].tags&&e[0].tags.orientation)switch(e[0].tags.orientation){case 6:case 8:c=e[0].img.height,s=e[0].img.width;break;default:c=e[0].img.width,s=e[0].img.height}else c=e[0].img.width,s=e[0].img.height;n=a.size?c/s>1?a.size:Math.floor(c/s*a.size):c,i=a.size?c/s>1?Math.floor(s/c*a.size):a.size:s,_.x=n,_.y=i,d=!0,u=0,setTimeout(function(){t("canrecord",[])},0)},h,p,a.sequence)}function t(e,t){var n,r=y[e];if(r&&r.length>0)for(n=0;n<r.length;n++)r[n].apply(o,t)}var n,i,o={},a=null,c=0,s=0,u=0,f=!0,d=!1,l=null,p=0,h=1,v=null,g=!1,m=["canrecord","ended"],y={},b={x:0,y:0},_={x:0,y:0};return o.trigger=t,o.getWidth=function(){return n},o.getHeight=function(){return i},o.setWidth=function(e){n=e},o.setHeight=function(e){i=e},o.getRealWidth=function(){return c},o.getRealHeight=function(){return s},o.setInputStream=function(t){a=t,t.sequence===!1?(v=t.src,p=1):(v=t.src,p=t.length),e()},o.ended=function(){return g},o.setAttribute=function(){},o.getConfig=function(){return a},o.pause=function(){f=!0},o.play=function(){f=!1},o.setCurrentTime=function(e){u=e},o.addEventListener=function(e,t){m.indexOf(e)!==-1&&(y[e]||(y[e]=[]),y[e].push(t))},o.setTopRight=function(e){b.x=e.x,b.y=e.y},o.getTopRight=function(){return b},o.setCanvasSize=function(e){_.x=e.x,_.y=e.y},o.getCanvasSize=function(){return _},o.getFrame=function(){var e;return d?(f||(e=l[u],u<p-1?u++:setTimeout(function(){g=!0,t("ended",[])},0)),e):null},o},t.a=i},function(e,t,n){(function(e){function r(){var t;v=h.halfSample?new S.a({x:T.size.x/2|0,y:T.size.y/2|0}):T,E=x.b.bind()(h.patchSize,v.size),k.x=v.size.x/E.x|0,k.y=v.size.y/E.y|0,C=new S.a(v.size,(void 0),Uint8Array,(!1)),y=new S.a(E,(void 0),Array,(!0)),t=new ArrayBuffer(65536),m=new S.a(E,new Uint8Array(t,0,E.x*E.y)),g=new S.a(E,new Uint8Array(t,E.x*E.y*3,E.x*E.y),(void 0),(!0)),R=A.a.bind()("undefined"!=typeof window?window:"undefined"!=typeof self?self:e,{size:E.x},t),w=new S.a({x:v.size.x/m.size.x|0,y:v.size.y/m.size.y|0},(void 0),Array,(!0)),b=new S.a(w.size,(void 0),(void 0),(!0)),_=new S.a(w.size,(void 0),Int32Array,(!0))}function i(){h.useWorker||"undefined"==typeof document||(I.dom.binary=document.createElement("canvas"),I.dom.binary.className="binaryBuffer",I.ctx.binary=I.dom.binary.getContext("2d"),I.dom.binary.width=C.size.x,I.dom.binary.height=C.size.y)}function o(e){var t,n,r,i,o,a,c,s=C.size.x,u=C.size.y,f=-C.size.x,d=-C.size.y;for(t=0,n=0;n<e.length;n++)i=e[n],t+=i.rad;for(t/=e.length,t=(180*t/Math.PI+90)%180-90,t<0&&(t+=180),t=(180-t)*Math.PI/180,o=j.copy(j.create(),[Math.cos(t),Math.sin(t),-Math.sin(t),Math.cos(t)]),n=0;n<e.length;n++)for(i=e[n],r=0;r<4;r++)M.transformMat2(i.box[r],i.box[r],o);for(n=0;n<e.length;n++)for(i=e[n],r=0;r<4;r++)i.box[r][0]<s&&(s=i.box[r][0]),i.box[r][0]>f&&(f=i.box[r][0]),i.box[r][1]<u&&(u=i.box[r][1]),i.box[r][1]>d&&(d=i.box[r][1]);for(a=[[s,u],[f,u],[f,d],[s,d]],c=h.halfSample?2:1,o=j.invert(o,o),r=0;r<4;r++)M.transformMat2(a[r],a[r],o);for(r=0;r<4;r++)M.scale(a[r],a[r],c);return a}function a(){x.c.bind()(v,C),C.zeroBorder()}function c(){var e,t,n,r,i,o,a,c=[];for(e=0;e<k.x;e++)for(t=0;t<k.y;t++)n=m.size.x*e,r=m.size.y*t,d(n,r),g.zeroBorder(),O.a.init(y.data,0),o=P.a.create(g,y),a=o.rasterize(0),i=y.moments(a.count),c=c.concat(l(i,[e,t],n,r));return c}function s(e){var t,n,r=[],i=[];for(t=0;t<e;t++)r.push(0);for(n=_.data.length;n--;)_.data[n]>0&&r[_.data[n]-1]++;return r=r.map(function(e,t){return{val:e,label:t+1}}),r.sort(function(e,t){return t.val-e.val}),i=r.filter(function(e){return e.val>=5})}function u(e,t){var n,r,i,a,c=[],s=[];for(n=0;n<e.length;n++){for(r=_.data.length,c.length=0;r--;)_.data[r]===e[n].label&&(i=w.data[r],c.push(i));a=o(c),a&&s.push(a)}return s}function f(e){var t=x.d.bind()(e,.9),n=x.e.bind()(t,1,function(e){return e.getPoints().length}),r=[],i=[];if(1===n.length){r=n[0].item.getPoints();for(var o=0;o<r.length;o++)i.push(r[o].point)}return i}function d(e,t){C.subImageAsCopy(m,x.f.bind()(e,t)),R.skeletonize()}function l(e,t,n,r){var i,o,a,c,s=[],u=[],d=Math.ceil(E.x/3);if(e.length>=2){for(i=0;i<e.length;i++)e[i].m00>d&&s.push(e[i]);if(s.length>=2){for(a=f(s),o=0,i=0;i<a.length;i++)o+=a[i].rad;a.length>1&&a.length>=s.length/4*3&&a.length>e.length/4&&(o/=a.length,c={index:t[1]*k.x+t[0],pos:{x:n,y:r},box:[M.clone([n,r]),M.clone([n+m.size.x,r]),M.clone([n+m.size.x,r+m.size.y]),M.clone([n,r+m.size.y])],moments:a,rad:o,vec:M.clone([Math.cos(o),Math.sin(o)])},u.push(c))}}return u}function p(e){function t(){var e;for(e=0;e<_.data.length;e++)if(0===_.data[e]&&1===b.data[e])return e;return _.length}function n(e){var t,r,i,c,s,u,f={x:e%_.size.x,y:e/_.size.x|0};if(e<_.data.length)for(i=w.data[e],_.data[e]=o,s=0;s<D.a.searchDirections.length;s++)r=f.y+D.a.searchDirections[s][0],t=f.x+D.a.searchDirections[s][1],c=r*_.size.x+t,0!==b.data[c]?0===_.data[c]&&(u=Math.abs(M.dot(w.data[c].vec,i.vec)),u>a&&n(c)):_.data[c]=Number.MAX_VALUE}var r,i,o=0,a=.95,c=0;for(O.a.init(b.data,0),O.a.init(_.data,0),O.a.init(w.data,null),r=0;r<e.length;r++)i=e[r],w.data[i.index]=i,b.data[i.index]=1;for(b.zeroBorder();(c=t())<_.data.length;)o++,n(c);return o}var h,v,g,m,y,b,_,w,C,E,T,R,S=n(18),x=n(17),O=n(8),P=(n(9),n(78)),D=n(34),A=n(79),M={clone:n(7),dot:n(36),scale:n(92),transformMat2:n(93)},j={copy:n(89),create:n(90),invert:n(91)},I={ctx:{binary:null},dom:{binary:null}},k={x:0,y:0};t.a={init:function(e,t){h=t,T=e,r(),i()},locate:function(){var e,t,n;if(h.halfSample&&x.g.bind()(T,v),a(),e=c(),e.length<k.x*k.y*.05)return null;var r=p(e);return r<1?null:(t=s(r),0===t.length?null:n=u(t,r))},checkImageConstraints:function(e,t){var n,r,i,o=e.getWidth(),a=e.getHeight(),c=t.halfSample?.5:1;if(e.getConfig().area&&(i=x.h.bind()(o,a,e.getConfig().area),e.setTopRight({x:i.sx,y:i.sy}),e.setCanvasSize({x:o,y:a}),o=i.sw,a=i.sh),r={x:Math.floor(o*c),y:Math.floor(a*c)},n=x.b.bind()(t.patchSize,r),e.setWidth(Math.floor(Math.floor(r.x/n.x)*(1/c)*n.x)),e.setHeight(Math.floor(Math.floor(r.y/n.y)*(1/c)*n.y)),e.getWidth()%n.x===0&&e.getHeight()%n.y===0)return!0;throw new Error("Image dimensions do not comply with the current settings: Width ("+o+" )and height ("+a+") must a multiple of "+n.x)}}}).call(t,function(){return this}())},function(e,t,n){var r=n(34),i={createContour2D:function(){return{dir:null,index:null,firstVertex:null,insideContours:null,nextpeer:null,prevpeer:null}},CONTOUR_DIR:{CW_DIR:0,CCW_DIR:1,UNKNOWN_DIR:2},DIR:{OUTSIDE_EDGE:-32767,INSIDE_EDGE:-32766},create:function(e,t){var n=e.data,o=t.data,a=e.size.x,c=e.size.y,s=r.a.create(e,t);return{rasterize:function(e){var t,r,u,f,d,l,p,h,v,g,m,y,b=[],_=0;for(y=0;y<400;y++)b[y]=0;for(b[0]=n[0],v=null,l=1;l<c-1;l++)for(f=0,r=b[0],d=1;d<a-1;d++)if(m=l*a+d,0===o[m])if(t=n[m],t!==r){if(0===f)u=_+1,b[u]=t,r=t,p=s.contourTracing(l,d,u,t,i.DIR.OUTSIDE_EDGE),null!==p&&(_++,f=u,h=i.createContour2D(),h.dir=i.CONTOUR_DIR.CW_DIR,h.index=f,h.firstVertex=p,h.nextpeer=v,h.insideContours=null,null!==v&&(v.prevpeer=h),v=h);else if(p=s.contourTracing(l,d,i.DIR.INSIDE_EDGE,t,f),null!==p){for(h=i.createContour2D(),h.firstVertex=p,h.insideContours=null,0===e?h.dir=i.CONTOUR_DIR.CCW_DIR:h.dir=i.CONTOUR_DIR.CW_DIR,h.index=e,g=v;null!==g&&g.index!==f;)g=g.nextpeer;null!==g&&(h.nextpeer=g.insideContours,null!==g.insideContours&&(g.insideContours.prevpeer=h),g.insideContours=h)}}else o[m]=f;else o[m]===i.DIR.OUTSIDE_EDGE||o[m]===i.DIR.INSIDE_EDGE?(f=0,r=o[m]===i.DIR.INSIDE_EDGE?n[m]:b[0]):(f=o[m],r=b[f]);for(g=v;null!==g;)g.index=e,g=g.nextpeer;return{cc:v,count:_}},debug:{drawContour:function(e,t){var n,r,o,a=e.getContext("2d"),c=t;for(a.strokeStyle="red",a.fillStyle="red",a.lineWidth=1,n=null!==c?c.insideContours:null;null!==c;){switch(null!==n?(r=n,n=n.nextpeer):(r=c,c=c.nextpeer,n=null!==c?c.insideContours:null),r.dir){case i.CONTOUR_DIR.CW_DIR:a.strokeStyle="red";break;case i.CONTOUR_DIR.CCW_DIR:a.strokeStyle="blue";break;case i.CONTOUR_DIR.UNKNOWN_DIR:a.strokeStyle="green"}o=r.firstVertex,a.beginPath(),a.moveTo(o.x,o.y);do o=o.next,a.lineTo(o.x,o.y);while(o!==r.firstVertex);a.stroke()}}}}}};t.a=i},function(module, exports, __webpack_require__) {function Skeletonizer(stdlib, foreign, buffer) {"use asm";var images=new stdlib.Uint8Array(buffer),size=foreign.size|0,imul=stdlib.Math.imul;function erode(inImagePtr, outImagePtr) {inImagePtr=inImagePtr|0;outImagePtr=outImagePtr|0;var v=0,u=0,sum=0,yStart1=0,yStart2=0,xStart1=0,xStart2=0,offset=0;for (v=1; (v|0)<(size - 1|0); v=v+1|0) {offset=offset+size|0;for (u=1; (u|0)<(size - 1|0); u=u+1|0) {yStart1=offset - size|0;yStart2=offset+size|0;xStart1=u - 1|0;xStart2=u+1|0;sum=(images[inImagePtr+yStart1+xStart1|0]|0)+(images[inImagePtr+yStart1+xStart2|0]|0)+(images[inImagePtr+offset+u|0]|0)+(images[inImagePtr+yStart2+xStart1|0]|0)+(images[inImagePtr+yStart2+xStart2|0]|0)|0;if ((sum|0) == (5|0)) {images[outImagePtr+offset+u|0]=1;} else {images[outImagePtr+offset+u|0]=0;}}}return;}function subtract(aImagePtr, bImagePtr, outImagePtr) {aImagePtr=aImagePtr|0;bImagePtr=bImagePtr|0;outImagePtr=outImagePtr|0;var length=0;length=imul(size, size)|0;while ((length|0)>0) {length=length - 1|0;images[outImagePtr+length|0]=(images[aImagePtr+length|0]|0) - (images[bImagePtr+length|0]|0)|0;}}function bitwiseOr(aImagePtr, bImagePtr, outImagePtr) {aImagePtr=aImagePtr|0;bImagePtr=bImagePtr|0;outImagePtr=outImagePtr|0;var length=0;length=imul(size, size)|0;while ((length|0)>0) {length=length - 1|0;images[outImagePtr+length|0]=images[aImagePtr+length|0]|0|(images[bImagePtr+length|0]|0)|0;}}function countNonZero(imagePtr) {imagePtr=imagePtr|0;var sum=0,length=0;length=imul(size, size)|0;while ((length|0)>0) {length=length - 1|0;sum=(sum|0)+(images[imagePtr+length|0]|0)|0;}return sum|0;}function init(imagePtr, value) {imagePtr=imagePtr|0;value=value|0;var length=0;length=imul(size, size)|0;while ((length|0)>0) {length=length - 1|0;images[imagePtr+length|0]=value;}}function dilate(inImagePtr, outImagePtr) {inImagePtr=inImagePtr|0;outImagePtr=outImagePtr|0;var v=0,u=0,sum=0,yStart1=0,yStart2=0,xStart1=0,xStart2=0,offset=0;for (v=1; (v|0)<(size - 1|0); v=v+1|0) {offset=offset+size|0;for (u=1; (u|0)<(size - 1|0); u=u+1|0) {yStart1=offset - size|0;yStart2=offset+size|0;xStart1=u - 1|0;xStart2=u+1|0;sum=(images[inImagePtr+yStart1+xStart1|0]|0)+(images[inImagePtr+yStart1+xStart2|0]|0)+(images[inImagePtr+offset+u|0]|0)+(images[inImagePtr+yStart2+xStart1|0]|0)+(images[inImagePtr+yStart2+xStart2|0]|0)|0;if ((sum|0)>(0|0)) {images[outImagePtr+offset+u|0]=1;} else {images[outImagePtr+offset+u|0]=0;}}}return;}function memcpy(srcImagePtr, dstImagePtr) {srcImagePtr=srcImagePtr|0;dstImagePtr=dstImagePtr|0;var length=0;length=imul(size, size)|0;while ((length|0)>0) {length=length - 1|0;images[dstImagePtr+length|0]=images[srcImagePtr+length|0]|0;}}function zeroBorder(imagePtr) {imagePtr=imagePtr|0;var x=0,y=0;for (x=0; (x|0)<(size - 1|0); x=x+1|0) {images[imagePtr+x|0]=0;images[imagePtr+y|0]=0;y=y+size - 1|0;images[imagePtr+y|0]=0;y=y+1|0;}for (x=0; (x|0)<(size|0); x=x+1|0) {images[imagePtr+y|0]=0;y=y+1|0;}}function skeletonize() {var subImagePtr=0,erodedImagePtr=0,tempImagePtr=0,skelImagePtr=0,sum=0,done=0;erodedImagePtr=imul(size, size)|0;tempImagePtr=erodedImagePtr+erodedImagePtr|0;skelImagePtr=tempImagePtr+erodedImagePtr|0;init(skelImagePtr, 0);zeroBorder(subImagePtr);do {erode(subImagePtr, erodedImagePtr);dilate(erodedImagePtr, tempImagePtr);subtract(subImagePtr, tempImagePtr, tempImagePtr);bitwiseOr(skelImagePtr, tempImagePtr, skelImagePtr);memcpy(erodedImagePtr, subImagePtr);sum=countNonZero(subImagePtr)|0;done=(sum|0) == 0|0;} while (!done);}return {skeletonize: skeletonize};} exports["a"]=Skeletonizer; },function(e,t,n){function r(){i.a.call(this),this._counters=[]}var i=n(6),o={ALPHABETH_STRING:{value:"0123456789-$:/.+ABCD"},ALPHABET:{value:[48,49,50,51,52,53,54,55,56,57,45,36,58,47,46,43,65,66,67,68]},CHARACTER_ENCODINGS:{value:[3,6,9,96,18,66,33,36,48,72,12,24,69,81,84,21,26,41,11,14]},START_END:{value:[26,41,11,14]},MIN_ENCODED_CHARS:{value:4},MAX_ACCEPTABLE:{value:2},PADDING:{value:1.5},FORMAT:{value:"codabar",writeable:!1}};r.prototype=Object.create(i.a.prototype,o),r.prototype.constructor=r,r.prototype._decode=function(){var e,t,n,r,i,o=this,a=[];if(this._counters=o._fillCounters(),e=o._findStart(),!e)return null;r=e.startCounter;do{if(n=o._toPattern(r),n<0)return null;if(t=o._patternToChar(n),t<0)return null;if(a.push(t),r+=8,a.length>1&&o._isStartEnd(n))break}while(r<o._counters.length);return a.length-2<o.MIN_ENCODED_CHARS||!o._isStartEnd(n)?null:o._verifyWhitespace(e.startCounter,r-8)&&o._validateResult(a,e.startCounter)?(r=r>o._counters.length?o._counters.length:r,i=e.start+o._sumCounters(e.startCounter,r-8),{code:a.join(""),start:e.start,end:i,startInfo:e,decodedCodes:a}):null},r.prototype._verifyWhitespace=function(e,t){return(e-1<=0||this._counters[e-1]>=this._calculatePatternLength(e)/2)&&(t+8>=this._counters.length||this._counters[t+7]>=this._calculatePatternLength(t)/2)},r.prototype._calculatePatternLength=function(e){var t,n=0;for(t=e;t<e+7;t++)n+=this._counters[t];return n},r.prototype._thresholdResultPattern=function(e,t){var n,r,i,o,a,c=this,s={space:{narrow:{size:0,counts:0,min:0,max:Number.MAX_VALUE},wide:{size:0,counts:0,min:0,max:Number.MAX_VALUE}},bar:{narrow:{size:0,counts:0,min:0,max:Number.MAX_VALUE},wide:{size:0,counts:0,min:0,max:Number.MAX_VALUE}}},u=t;for(i=0;i<e.length;i++){for(a=c._charToPattern(e[i]),o=6;o>=0;o--)n=2===(1&o)?s.bar:s.space,r=1===(1&a)?n.wide:n.narrow,r.size+=c._counters[u+o],r.counts++,a>>=1;u+=8}return["space","bar"].forEach(function(e){var t=s[e];t.wide.min=Math.floor((t.narrow.size/t.narrow.counts+t.wide.size/t.wide.counts)/2),t.narrow.max=Math.ceil(t.wide.min),t.wide.max=Math.ceil((t.wide.size*c.MAX_ACCEPTABLE+c.PADDING)/t.wide.counts)}),s},r.prototype._charToPattern=function(e){var t,n=this,r=e.charCodeAt(0);for(t=0;t<n.ALPHABET.length;t++)if(n.ALPHABET[t]===r)return n.CHARACTER_ENCODINGS[t];return 0},r.prototype._validateResult=function(e,t){var n,r,i,o,a,c,s=this,u=s._thresholdResultPattern(e,t),f=t;for(n=0;n<e.length;n++){for(c=s._charToPattern(e[n]),r=6;r>=0;r--){if(i=0===(1&r)?u.bar:u.space,o=1===(1&c)?i.wide:i.narrow,a=s._counters[f+r],a<o.min||a>o.max)return!1;c>>=1}f+=8}return!0},r.prototype._patternToChar=function(e){var t,n=this;for(t=0;t<n.CHARACTER_ENCODINGS.length;t++)if(n.CHARACTER_ENCODINGS[t]===e)return String.fromCharCode(n.ALPHABET[t]);return-1},r.prototype._computeAlternatingThreshold=function(e,t){var n,r,i=Number.MAX_VALUE,o=0;for(n=e;n<t;n+=2)r=this._counters[n],r>o&&(o=r),r<i&&(i=r);return(i+o)/2|0},r.prototype._toPattern=function(e){var t,n,r,i,o=7,a=e+o,c=1<<o-1,s=0;if(a>this._counters.length)return-1;for(t=this._computeAlternatingThreshold(e,a),n=this._computeAlternatingThreshold(e+1,a),r=0;r<o;r++)i=0===(1&r)?t:n,this._counters[e+r]>i&&(s|=c),c>>=1;return s},r.prototype._isStartEnd=function(e){var t;for(t=0;t<this.START_END.length;t++)if(this.START_END[t]===e)return!0;return!1},r.prototype._sumCounters=function(e,t){var n,r=0;for(n=e;n<t;n++)r+=this._counters[n];return r},r.prototype._findStart=function(){var e,t,n,r=this,i=r._nextUnset(r._row);for(e=1;e<this._counters.length;e++)if(t=r._toPattern(e),t!==-1&&r._isStartEnd(t))return i+=r._sumCounters(0,e),n=i+r._sumCounters(e,e+8),{start:i,end:n,startCounter:e,endCounter:e+8}},t.a=r},function(e,t,n){function r(){o.a.call(this)}function i(e,t,n){for(var r=n.length,i=0,o=0;r--;)o+=e[n[r]],i+=t[n[r]];return o/i}var o=n(6),a={CODE_SHIFT:{value:98},CODE_C:{value:99},CODE_B:{value:100},CODE_A:{value:101},START_CODE_A:{value:103},START_CODE_B:{value:104},START_CODE_C:{value:105},STOP_CODE:{value:106},CODE_PATTERN:{value:[[2,1,2,2,2,2],[2,2,2,1,2,2],[2,2,2,2,2,1],[1,2,1,2,2,3],[1,2,1,3,2,2],[1,3,1,2,2,2],[1,2,2,2,1,3],[1,2,2,3,1,2],[1,3,2,2,1,2],[2,2,1,2,1,3],[2,2,1,3,1,2],[2,3,1,2,1,2],[1,1,2,2,3,2],[1,2,2,1,3,2],[1,2,2,2,3,1],[1,1,3,2,2,2],[1,2,3,1,2,2],[1,2,3,2,2,1],[2,2,3,2,1,1],[2,2,1,1,3,2],[2,2,1,2,3,1],[2,1,3,2,1,2],[2,2,3,1,1,2],[3,1,2,1,3,1],[3,1,1,2,2,2],[3,2,1,1,2,2],[3,2,1,2,2,1],[3,1,2,2,1,2],[3,2,2,1,1,2],[3,2,2,2,1,1],[2,1,2,1,2,3],[2,1,2,3,2,1],[2,3,2,1,2,1],[1,1,1,3,2,3],[1,3,1,1,2,3],[1,3,1,3,2,1],[1,1,2,3,1,3],[1,3,2,1,1,3],[1,3,2,3,1,1],[2,1,1,3,1,3],[2,3,1,1,1,3],[2,3,1,3,1,1],[1,1,2,1,3,3],[1,1,2,3,3,1],[1,3,2,1,3,1],[1,1,3,1,2,3],[1,1,3,3,2,1],[1,3,3,1,2,1],[3,1,3,1,2,1],[2,1,1,3,3,1],[2,3,1,1,3,1],[2,1,3,1,1,3],[2,1,3,3,1,1],[2,1,3,1,3,1],[3,1,1,1,2,3],[3,1,1,3,2,1],[3,3,1,1,2,1],[3,1,2,1,1,3],[3,1,2,3,1,1],[3,3,2,1,1,1],[3,1,4,1,1,1],[2,2,1,4,1,1],[4,3,1,1,1,1],[1,1,1,2,2,4],[1,1,1,4,2,2],[1,2,1,1,2,4],[1,2,1,4,2,1],[1,4,1,1,2,2],[1,4,1,2,2,1],[1,1,2,2,1,4],[1,1,2,4,1,2],[1,2,2,1,1,4],[1,2,2,4,1,1],[1,4,2,1,1,2],[1,4,2,2,1,1],[2,4,1,2,1,1],[2,2,1,1,1,4],[4,1,3,1,1,1],[2,4,1,1,1,2],[1,3,4,1,1,1],[1,1,1,2,4,2],[1,2,1,1,4,2],[1,2,1,2,4,1],[1,1,4,2,1,2],[1,2,4,1,1,2],[1,2,4,2,1,1],[4,1,1,2,1,2],[4,2,1,1,1,2],[4,2,1,2,1,1],[2,1,2,1,4,1],[2,1,4,1,2,1],[4,1,2,1,2,1],[1,1,1,1,4,3],[1,1,1,3,4,1],[1,3,1,1,4,1],[1,1,4,1,1,3],[1,1,4,3,1,1],[4,1,1,1,1,3],[4,1,1,3,1,1],[1,1,3,1,4,1],[1,1,4,1,3,1],[3,1,1,1,4,1],[4,1,1,1,3,1],[2,1,1,4,1,2],[2,1,1,2,1,4],[2,1,1,2,3,2],[2,3,3,1,1,1,2]]},SINGLE_CODE_ERROR:{value:.64},AVG_CODE_ERROR:{value:.3},FORMAT:{value:"code_128",writeable:!1},MODULE_INDICES:{value:{bar:[0,2,4],space:[1,3,5]}}};r.prototype=Object.create(o.a.prototype,a),r.prototype.constructor=r,r.prototype._decodeCode=function(e,t){var n,r,o,a=[0,0,0,0,0,0],c=this,s=e,u=!c._row[s],f=0,d={error:Number.MAX_VALUE,code:-1,start:e,end:e,correction:{bar:1,space:1}};for(n=s;n<c._row.length;n++)if(c._row[n]^u)a[f]++;else{if(f===a.length-1){for(t&&c._correct(a,t),r=0;r<c.CODE_PATTERN.length;r++)o=c._matchPattern(a,c.CODE_PATTERN[r]),o<d.error&&(d.code=r,d.error=o);return d.end=n,d.code===-1||d.error>c.AVG_CODE_ERROR?null:(c.CODE_PATTERN[d.code]&&(d.correction.bar=i(c.CODE_PATTERN[d.code],a,this.MODULE_INDICES.bar),d.correction.space=i(c.CODE_PATTERN[d.code],a,this.MODULE_INDICES.space)),d)}f++,a[f]=1,u=!u}return null},r.prototype._correct=function(e,t){this._correctBars(e,t.bar,this.MODULE_INDICES.bar),this._correctBars(e,t.space,this.MODULE_INDICES.space)},r.prototype._findStart=function(){var e,t,n,r,o,a=[0,0,0,0,0,0],c=this,s=c._nextSet(c._row),u=!1,f=0,d={error:Number.MAX_VALUE,code:-1,start:0,end:0,correction:{bar:1,space:1}};for(e=s;e<c._row.length;e++)if(c._row[e]^u)a[f]++;else{if(f===a.length-1){for(o=0,r=0;r<a.length;r++)o+=a[r];for(t=c.START_CODE_A;t<=c.START_CODE_C;t++)n=c._matchPattern(a,c.CODE_PATTERN[t]),n<d.error&&(d.code=t,d.error=n);if(d.error<c.AVG_CODE_ERROR)return d.start=e-o,d.end=e,d.correction.bar=i(c.CODE_PATTERN[d.code],a,this.MODULE_INDICES.bar),d.correction.space=i(c.CODE_PATTERN[d.code],a,this.MODULE_INDICES.space),d;for(r=0;r<4;r++)a[r]=a[r+2];a[4]=0,a[5]=0,f--}else f++;a[f]=1,u=!u}return null},r.prototype._decode=function(){var e,t,n=this,r=n._findStart(),i=null,o=!1,a=[],c=0,s=0,u=[],f=[],d=!1,l=!0;if(null===r)return null;switch(i={code:r.code,start:r.start,end:r.end,correction:{bar:r.correction.bar,space:r.correction.space}},f.push(i),s=i.code,i.code){case n.START_CODE_A:e=n.CODE_A;break;case n.START_CODE_B:e=n.CODE_B;break;case n.START_CODE_C:e=n.CODE_C;break;default:return null}for(;!o;){if(t=d,d=!1,i=n._decodeCode(i.end,i.correction),null!==i)switch(i.code!==n.STOP_CODE&&(l=!0),i.code!==n.STOP_CODE&&(u.push(i.code),c++,s+=c*i.code),f.push(i),e){case n.CODE_A:if(i.code<64)a.push(String.fromCharCode(32+i.code));else if(i.code<96)a.push(String.fromCharCode(i.code-64));else switch(i.code!==n.STOP_CODE&&(l=!1),i.code){case n.CODE_SHIFT:d=!0,e=n.CODE_B;break;case n.CODE_B:e=n.CODE_B;break;case n.CODE_C:e=n.CODE_C;break;case n.STOP_CODE:o=!0}break;case n.CODE_B:if(i.code<96)a.push(String.fromCharCode(32+i.code));else switch(i.code!==n.STOP_CODE&&(l=!1),i.code){case n.CODE_SHIFT:d=!0,e=n.CODE_A;break;case n.CODE_A:e=n.CODE_A;break;case n.CODE_C:e=n.CODE_C;break;case n.STOP_CODE:o=!0}break;case n.CODE_C:if(i.code<100)a.push(i.code<10?"0"+i.code:i.code);else switch(i.code!==n.STOP_CODE&&(l=!1),i.code){case n.CODE_A:e=n.CODE_A;break;case n.CODE_B:e=n.CODE_B;break;case n.STOP_CODE:o=!0}}else o=!0;t&&(e=e===n.CODE_A?n.CODE_B:n.CODE_A)}return null===i?null:(i.end=n._nextUnset(n._row,i.end),n._verifyTrailingWhitespace(i)?(s-=c*u[u.length-1],s%103!==u[u.length-1]?null:a.length?(l&&a.splice(a.length-1,1),{code:a.join(""),start:r.start,end:i.end,codeset:e,startInfo:r,decodedCodes:f,endInfo:i}):null):null)},o.a.prototype._verifyTrailingWhitespace=function(e){var t,n=this;return t=e.end+(e.end-e.start)/2,t<n._row.length&&n._matchRange(e.end,t,0)?e:null},t.a=r},function(e,t,n){function r(){i.a.call(this)}var i=n(35),o={IOQ:/[IOQ]/g,AZ09:/[A-Z0-9]{17}/};r.prototype=Object.create(i.a.prototype),r.prototype.constructor=r,r.prototype._decode=function(){var e=i.a.prototype._decode.apply(this);if(!e)return null;var t=e.code;return t?(t=t.replace(o.IOQ,""),t.match(o.AZ09)&&this._checkChecksum(t)?(e.code=t,e):null):null},r.prototype._checkChecksum=function(e){return!!e},t.a=r},function(e,t,n){function r(){i.a.call(this)}var i=n(3),o={FORMAT:{value:"ean_2",writeable:!1}};r.prototype=Object.create(i.a.prototype,o),r.prototype.constructor=r,r.prototype.decode=function(e,t){this._row=e;var n,r=0,i=0,o=t,a=this._row.length,c=[],s=[];for(i=0;i<2&&o<a;i++){if(n=this._decodeCode(o),!n)return null;s.push(n),c.push(n.code%10),n.code>=this.CODE_G_START&&(r|=1<<1-i),1!=i&&(o=this._nextSet(this._row,n.end),o=this._nextUnset(this._row,o))}return 2!=c.length||parseInt(c.join(""))%4!==r?null:{code:c.join(""),decodedCodes:s,end:n.end}},t.a=r},function(e,t,n){function r(){a.a.call(this)}function i(e){var t;for(t=0;t<10;t++)if(e===s[t])return t;return null}function o(e){var t,n=e.length,r=0;for(t=n-2;t>=0;t-=2)r+=e[t];for(r*=3,t=n-1;t>=0;t-=2)r+=e[t];return r*=3,r%10}var a=n(3),c={FORMAT:{value:"ean_5",writeable:!1}},s=[24,20,18,17,12,6,3,10,9,5];r.prototype=Object.create(a.a.prototype,c),r.prototype.constructor=r,r.prototype.decode=function(e,t){this._row=e;var n,r=0,a=0,c=t,s=this._row.length,u=[],f=[];for(a=0;a<5&&c<s;a++){if(n=this._decodeCode(c),!n)return null;f.push(n),u.push(n.code%10),n.code>=this.CODE_G_START&&(r|=1<<4-a),4!=a&&(c=this._nextSet(this._row,n.end),c=this._nextUnset(this._row,c))}return 5!=u.length?null:o(u)!==i(r)?null:{code:u.join(""),decodedCodes:f,end:n.end}},t.a=r},function(e,t,n){function r(e,t){i.a.call(this,e,t)}var i=n(3),o={FORMAT:{value:"ean_8",writeable:!1}};r.prototype=Object.create(i.a.prototype,o),r.prototype.constructor=r,r.prototype._decodePayload=function(e,t,n){var r,i=this;for(r=0;r<4;r++){if(e=i._decodeCode(e.end,i.CODE_G_START),!e)return null;t.push(e.code),n.push(e)}if(e=i._findPattern(i.MIDDLE_PATTERN,e.end,!0,!1),null===e)return null;for(n.push(e),r=0;r<4;r++){if(e=i._decodeCode(e.end,i.CODE_G_START),!e)return null;n.push(e),t.push(e.code)}return e},t.a=r},function(e,t,n){function r(e){e=a.a.bind()(i(),e),c.a.call(this,e),this.barSpaceRatio=[1,1],e.normalizeBarSpaceWidth&&(this.SINGLE_CODE_ERROR=.38,this.AVG_CODE_ERROR=.09)}function i(){var e={};return Object.keys(r.CONFIG_KEYS).forEach(function(t){e[t]=r.CONFIG_KEYS[t]["default"]}),e}var o=n(33),a=o&&o.__esModule?function(){return o["default"]}:function(){return o};Object.defineProperty(a,"a",{get:a});var c=n(6),s=1,u=3,f={START_PATTERN:{value:[s,s,s,s]},STOP_PATTERN:{value:[s,s,u]},CODE_PATTERN:{value:[[s,s,u,u,s],[u,s,s,s,u],[s,u,s,s,u],[u,u,s,s,s],[s,s,u,s,u],[u,s,u,s,s],[s,u,u,s,s],[s,s,s,u,u],[u,s,s,u,s],[s,u,s,u,s]]},SINGLE_CODE_ERROR:{value:.78,writable:!0},AVG_CODE_ERROR:{value:.38,writable:!0},MAX_CORRECTION_FACTOR:{value:5},FORMAT:{value:"i2of5"}};r.prototype=Object.create(c.a.prototype,f),r.prototype.constructor=r,r.prototype._matchPattern=function(e,t){if(this.config.normalizeBarSpaceWidth){var n,r=[0,0],i=[0,0],o=[0,0],a=this.MAX_CORRECTION_FACTOR,s=1/a;for(n=0;n<e.length;n++)r[n%2]+=e[n],i[n%2]+=t[n];for(o[0]=i[0]/r[0],o[1]=i[1]/r[1],o[0]=Math.max(Math.min(o[0],a),s),o[1]=Math.max(Math.min(o[1],a),s),this.barSpaceRatio=o,n=0;n<e.length;n++)e[n]*=this.barSpaceRatio[n%2]}return c.a.prototype._matchPattern.call(this,e,t)},r.prototype._findPattern=function(e,t,n,r){var i,o,a,c,s=[],u=this,f=0,d={error:Number.MAX_VALUE,code:-1,start:0,end:0},l=u.AVG_CODE_ERROR;for(n=n||!1,r=r||!1,t||(t=u._nextSet(u._row)),i=0;i<e.length;i++)s[i]=0;for(i=t;i<u._row.length;i++)if(u._row[i]^n)s[f]++;else{if(f===s.length-1){for(c=0,a=0;a<s.length;a++)c+=s[a];if(o=u._matchPattern(s,e),o<l)return d.error=o,d.start=i-c,d.end=i,d;if(!r)return null;for(a=0;a<s.length-2;a++)s[a]=s[a+2];s[s.length-2]=0,s[s.length-1]=0,f--}else f++;s[f]=1,n=!n}return null},r.prototype._findStart=function(){for(var e,t,n=this,r=n._nextSet(n._row),i=1;!t;){if(t=n._findPattern(n.START_PATTERN,r,!1,!0),!t)return null;if(i=Math.floor((t.end-t.start)/4),e=t.start-10*i,e>=0&&n._matchRange(e,t.start,0))return t;r=t.end,t=null}},r.prototype._verifyTrailingWhitespace=function(e){var t,n=this;return t=e.end+(e.end-e.start)/2,t<n._row.length&&n._matchRange(e.end,t,0)?e:null},r.prototype._findEnd=function(){var e,t,n=this;return n._row.reverse(),e=n._findPattern(n.STOP_PATTERN),n._row.reverse(),null===e?null:(t=e.start,e.start=n._row.length-e.end,e.end=n._row.length-t,null!==e?n._verifyTrailingWhitespace(e):null)},r.prototype._decodePair=function(e){var t,n,r=[],i=this;for(t=0;t<e.length;t++){if(n=i._decodeCode(e[t]),!n)return null;r.push(n)}return r},r.prototype._decodeCode=function(e){var t,n,r,i=this,o=0,a=i.AVG_CODE_ERROR,c={error:Number.MAX_VALUE,code:-1,start:0,end:0};for(t=0;t<e.length;t++)o+=e[t];for(r=0;r<i.CODE_PATTERN.length;r++)n=i._matchPattern(e,i.CODE_PATTERN[r]),n<c.error&&(c.code=r,c.error=n);if(c.error<a)return c},r.prototype._decodePayload=function(e,t,n){for(var r,i,o=this,a=0,c=e.length,s=[[0,0,0,0,0],[0,0,0,0,0]];a<c;){for(r=0;r<5;r++)s[0][r]=e[a]*this.barSpaceRatio[0],s[1][r]=e[a+1]*this.barSpaceRatio[1],a+=2;if(i=o._decodePair(s),!i)return null;for(r=0;r<i.length;r++)t.push(i[r].code+""),n.push(i[r])}return i},r.prototype._verifyCounterLength=function(e){return e.length%10===0},r.prototype._decode=function(){var e,t,n,r,i=this,o=[],a=[];return(e=i._findStart())?(a.push(e),(t=i._findEnd())?(r=i._fillCounters(e.end,t.start,!1),i._verifyCounterLength(r)&&(n=i._decodePayload(r,o,a))?o.length%2!==0||o.length<6?null:(a.push(t),{code:o.join(""),start:e.start,end:t.end,startInfo:e,decodedCodes:a}):null):null):null},r.CONFIG_KEYS={normalizeBarSpaceWidth:{type:"boolean","default":!1,description:"If true, the reader tries to normalize thewidth-difference between bars and spaces"}},t.a=r},function(e,t,n){function r(e,t){i.a.call(this,e,t)}var i=n(3),o={CODE_FREQUENCY:{value:[[56,52,50,49,44,38,35,42,41,37],[7,11,13,14,19,25,28,21,22,26]]},STOP_PATTERN:{value:[1/6*7,1/6*7,1/6*7,1/6*7,1/6*7,1/6*7]},FORMAT:{value:"upc_e",writeable:!1}};r.prototype=Object.create(i.a.prototype,o),r.prototype.constructor=r,r.prototype._decodePayload=function(e,t,n){var r,i=this,o=0;for(r=0;r<6;r++){if(e=i._decodeCode(e.end),!e)return null;e.code>=i.CODE_G_START&&(e.code=e.code-i.CODE_G_START,o|=1<<5-r),t.push(e.code),n.push(e)}return i._determineParity(o,t)?e:null},r.prototype._determineParity=function(e,t){var n,r;for(r=0;r<this.CODE_FREQUENCY.length;r++)for(n=0;n<this.CODE_FREQUENCY[r].length;n++)if(e===this.CODE_FREQUENCY[r][n])return t.unshift(r),t.push(n),!0;return!1},r.prototype._convertToUPCA=function(e){var t=[e[0]],n=e[e.length-2];return t=n<=2?t.concat(e.slice(1,3)).concat([n,0,0,0,0]).concat(e.slice(3,6)):3===n?t.concat(e.slice(1,4)).concat([0,0,0,0,0]).concat(e.slice(4,6)):4===n?t.concat(e.slice(1,5)).concat([0,0,0,0,0,e[5]]):t.concat(e.slice(1,6)).concat([0,0,0,0,n]),t.push(e[e.length-1]),t},r.prototype._checksum=function(e){return i.a.prototype._checksum.call(this,this._convertToUPCA(e))},r.prototype._findEnd=function(e,t){return t=!0,i.a.prototype._findEnd.call(this,e,t)},r.prototype._verifyTrailingWhitespace=function(e){var t,n=this;if(t=e.end+(e.end-e.start)/2,t<n._row.length&&n._matchRange(e.end,t,0))return e},t.a=r},function(e,t,n){function r(e,t){i.a.call(this,e,t)}var i=n(3),o={FORMAT:{value:"upc_a",writeable:!1}};r.prototype=Object.create(i.a.prototype,o),r.prototype.constructor=r,r.prototype._decode=function(){var e=i.a.prototype._decode.call(this);return e&&e.code&&13===e.code.length&&"0"===e.code.charAt(0)?(e.code=e.code.substring(1),e):null},t.a=r},function(e,t,n){function r(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}e.e=r},function(e,t,n){function r(){var e=new Float32Array(4);return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}e.e=r},function(e,t,n){function r(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n*o-i*r;return a?(a=1/a,e[0]=o*a,e[1]=-r*a,e[2]=-i*a,e[3]=n*a,e):null}e.e=r},function(e,t,n){function r(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}e.e=r},function(e,t,n){function r(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[2]*i,e[1]=n[1]*r+n[3]*i,e}e.e=r},function(e,t,n){function r(e){var t=new Float32Array(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}e.e=r},function(e,t,n){var r=n(4),i=n(1),o=r(i,"DataView");e.e=o},function(e,t,n){function r(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}var i=n(138),o=n(139),a=n(140),c=n(141),s=n(142);r.prototype.clear=i,r.prototype["delete"]=o,r.prototype.get=a,r.prototype.has=c,r.prototype.set=s,e.e=r},function(e,t,n){var r=n(4),i=n(1),o=r(i,"Promise");e.e=o},function(e,t,n){var r=n(4),i=n(1),o=r(i,"Set");e.e=o},function(e,t,n){function r(e){var t=-1,n=e?e.length:0;for(this.__data__=new i;++t<n;)this.add(e[t])}var i=n(37),o=n(164),a=n(165);r.prototype.add=r.prototype.push=o,r.prototype.has=a,e.e=r},function(e,t,n){var r=n(1),i=r.Uint8Array;e.e=i},function(e,t,n){var r=n(4),i=n(1),o=r(i,"WeakMap");e.e=o},function(e,t,n){function r(e,t){return e.set(t[0],t[1]),e}e.e=r},function(e,t,n){function r(e,t){return e.add(t),e}e.e=r},function(e,t,n){function r(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}e.e=r},function(e,t,n){function r(e,t){var n=e?e.length:0;return!!n&&i(e,t,0)>-1}var i=n(113);e.e=r},function(e,t,n){function r(e,t,n){for(var r=-1,i=e?e.length:0;++r<i;)if(n(t,e[r]))return!0;return!1}e.e=r},function(e,t,n){function r(e,t){return e&&i(t,o(t),e)}var i=n(24),o=n(32);e.e=r},function(e,t,n){function r(e,t,n,C,E,T,R){var O;if(C&&(O=T?C(e,E,T,R):C(e)),void 0!==O)return O;if(!b(e))return e;var P=g(e);if(P){if(O=p(e),!t)return u(e,O)}else{var A=l(e),M=A==S||A==x;if(m(e))return s(e,t);if(A==D||A==w||M&&!T){if(y(e))return T?e:{};if(O=v(M?{}:e),!t)return f(e,c(O,e))}else{if(!X[A])return T?e:{};O=h(e,A,r,t)}}R||(R=new i);var j=R.get(e);if(j)return j;if(R.set(e,O),!P)var I=n?d(e):_(e);return o(I||e,function(i,o){I&&(o=i,i=e[o]),a(O,o,r(i,t,n,C,o,e,R))}),O}var i=n(38),o=n(40),a=n(44),c=n(107),s=n(123),u=n(50),f=n(130),d=n(133),l=n(136),p=n(143),h=n(144),v=n(145),g=n(5),m=n(172),y=n(27),b=n(2),_=n(32),w="[object Arguments]",C="[object Array]",E="[object Boolean]",T="[object Date]",R="[object Error]",S="[object Function]",x="[object GeneratorFunction]",O="[object Map]",P="[object Number]",D="[object Object]",A="[object RegExp]",M="[object Set]",j="[object String]",I="[object Symbol]",k="[object WeakMap]",N="[object ArrayBuffer]",U="[object DataView]",L="[object Float32Array]",z="[object Float64Array]",F="[object Int8Array]",G="[object Int16Array]",B="[object Int32Array]",W="[object Uint8Array]",V="[object Uint8ClampedArray]",H="[object Uint16Array]",q="[object Uint32Array]",X={};X[w]=X[C]=X[N]=X[U]=X[E]=X[T]=X[L]=X[z]=X[F]=X[G]=X[B]=X[O]=X[P]=X[D]=X[A]=X[M]=X[j]=X[I]=X[W]=X[V]=X[H]=X[q]=!0,X[R]=X[S]=X[k]=!1,e.e=r},function(e,t,n){function r(e){return i(e)?o(e):{}}var i=n(2),o=Object.create;e.e=r},function(e,t,n){function r(e,t,n,r){var d=-1,l=o,p=!0,h=e.length,v=[],g=t.length;if(!h)return v;n&&(t=c(t,s(n))),r?(l=a,p=!1):t.length>=f&&(l=u,p=!1,t=new i(t));e:for(;++d<h;){var m=e[d],y=n?n(m):m;if(m=r||0!==m?m:0,p&&y===y){for(var b=g;b--;)if(t[b]===y)continue e;v.push(m)}else l(t,y,r)||v.push(m)}return v}var i=n(99),o=n(105),a=n(106),c=n(20),s=n(49),u=n(122),f=200;e.e=r},function(e,t,n){function r(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}e.e=r},function(e,t,n){function r(e){return o.call(e)}var i=Object.prototype,o=i.toString;e.e=r},function(e,t,n){function r(e,t,n){if(t!==t)return i(e,o,n);for(var r=n-1,a=e.length;++r<a;)if(e[r]===t)return r;return-1}var i=n(111),o=n(114);e.e=r},function(e,t,n){function r(e){return e!==e}e.e=r},function(e,t,n){function r(e){if(!c(e)||a(e))return!1;var t=i(e)||o(e)?v:f;return t.test(s(e))}var i=n(31),o=n(27),a=n(149),c=n(2),s=n(54),u=/[\\^$.*+?()[\]{}|]/g,f=/^\[object .+?Constructor\]$/,d=Function.prototype,l=Object.prototype,p=d.toString,h=l.hasOwnProperty,v=RegExp("^"+p.call(h).replace(u,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.e=r},function(e,t,n){function r(e){return o(e)&&i(e.length)&&!!D[M.call(e)]}var i=n(56),o=n(16),a="[object Arguments]",c="[object Array]",s="[object Boolean]",u="[object Date]",f="[object Error]",d="[object Function]",l="[object Map]",p="[object Number]",h="[object Object]",v="[object RegExp]",g="[object Set]",m="[object String]",y="[object WeakMap]",b="[object ArrayBuffer]",_="[object DataView]",w="[object Float32Array]",C="[object Float64Array]",E="[object Int8Array]",T="[object Int16Array]",R="[object Int32Array]",S="[object Uint8Array]",x="[object Uint8ClampedArray]",O="[object Uint16Array]",P="[object Uint32Array]",D={};D[w]=D[C]=D[E]=D[T]=D[R]=D[S]=D[x]=D[O]=D[P]=!0,D[a]=D[c]=D[b]=D[s]=D[_]=D[u]=D[f]=D[d]=D[l]=D[p]=D[h]=D[v]=D[g]=D[m]=D[y]=!1;var A=Object.prototype,M=A.toString;e.e=r},function(e,t,n){function r(e){if(!i(e))return o(e);var t=[];for(var n in Object(e))c.call(e,n)&&"constructor"!=n&&t.push(n);return t}var i=n(28),o=n(161),a=Object.prototype,c=a.hasOwnProperty;e.e=r},function(e,t,n){function r(e,t,n,l,p){if(e!==t){if(!u(t)&&!d(t))var h=c(t);o(h||t,function(o,c){if(h&&(c=o,o=t[c]),f(o))p||(p=new i),s(e,t,c,n,r,l,p);else{var u=l?l(e[c],o,c+"",e,t,p):void 0;void 0===u&&(u=o),a(e,c,u)}})}}var i=n(38),o=n(40),a=n(43),c=n(47),s=n(119),u=n(5),f=n(2),d=n(57);e.e=r},function(e,t,n){function r(e,t,n,r,v,g,m){var y=e[n],b=t[n],_=m.get(b);if(_)return void i(e,n,_);var w=g?g(y,b,n+"",e,t,m):void 0,C=void 0===w;C&&(w=b,s(b)||p(b)?s(y)?w=y:u(y)?w=a(y):(C=!1,w=o(b,!0)):l(b)||c(b)?c(y)?w=h(y):!d(y)||r&&f(y)?(C=!1,w=o(b,!0)):w=y:C=!1),C&&(m.set(b,w),v(w,b,r,g,m),m["delete"](b)),i(e,n,w)}var i=n(43),o=n(108),a=n(50),c=n(30),s=n(5),u=n(55),f=n(31),d=n(2),l=n(173),p=n(57),h=n(178);e.e=r},function(e,t,n){function r(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var a=t[r],c=e[a];n(c,a)&&(o[a]=c)}return o}e.e=r},function(e,t,n){function r(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}e.e=r},function(e,t,n){function r(e,t){return e.has(t)}e.e=r},function(e,t,n){function r(e,t){if(t)return e.slice();var n=new e.constructor(e.length);return e.copy(n),n}e.e=r},function(e,t,n){function r(e,t){var n=t?i(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var i=n(23);e.e=r},function(e,t,n){function r(e,t,n){var r=t?n(a(e),!0):a(e);return o(r,i,new e.constructor)}var i=n(102),o=n(42),a=n(160);e.e=r},function(e,t,n){function r(e){var t=new e.constructor(e.source,i.exec(e));return t.lastIndex=e.lastIndex,t}var i=/\w*$/;e.e=r},function(e,t,n){function r(e,t,n){var r=t?n(a(e),!0):a(e);return o(r,i,new e.constructor)}var i=n(103),o=n(42),a=n(166);e.e=r},function(e,t,n){function r(e){return a?Object(a.call(e)):{}}var i=n(39),o=i?i.prototype:void 0,a=o?o.valueOf:void 0;e.e=r},function(e,t,n){function r(e,t){var n=t?i(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var i=n(23);e.e=r},function(e,t,n){function r(e,t){return i(e,o(e),t)}var i=n(24),o=n(26);e.e=r},function(e,t,n){var r=n(1),i=r["__core-js_shared__"];e.e=i},function(e,t,n){function r(e){return i(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,c=i>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(i--,a):void 0,c&&o(n[0],n[1],c)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t})}var i=n(22),o=n(147);e.e=r},function(e,t,n){function r(e){return i(e,a,o)}var i=n(46),o=n(26),a=n(32);e.e=r},function(e,t,n){function r(e){return i(e,a,o)}var i=n(46),o=n(135),a=n(58);e.e=r},function(e,t,n){var r=n(21),i=n(25),o=n(26),a=n(59),c=Object.getOwnPropertySymbols,s=c?function(e){for(var t=[];e;)r(t,o(e)),e=i(e);return t}:a;e.e=s},function(e,t,n){var r=n(95),i=n(19),o=n(97),a=n(98),c=n(101),s=n(112),u=n(54),f="[object Map]",d="[object Object]",l="[object Promise]",p="[object Set]",h="[object WeakMap]",v="[object DataView]",g=Object.prototype,m=g.toString,y=u(r),b=u(i),_=u(o),w=u(a),C=u(c),E=s;(r&&E(new r(new ArrayBuffer(1)))!=v||i&&E(new i)!=f||o&&E(o.resolve())!=l||a&&E(new a)!=p||c&&E(new c)!=h)&&(E=function(e){var t=m.call(e),n=t==d?e.constructor:void 0,r=n?u(n):void 0;if(r)switch(r){case y:return v;case b:return f;case _:return l;case w:return p;case C:return h}return t}),e.e=E},function(e,t,n){function r(e,t){return null==e?void 0:e[t]}e.e=r},function(e,t,n){function r(){this.__data__=i?i(null):{}}var i=n(13);e.e=r},function(e,t,n){function r(e){return this.has(e)&&delete this.__data__[e]}e.e=r},function(e,t,n){function r(e){var t=this.__data__;if(i){var n=t[e];return n===o?void 0:n}return c.call(t,e)?t[e]:void 0}var i=n(13),o="__lodash_hash_undefined__",a=Object.prototype,c=a.hasOwnProperty;e.e=r},function(e,t,n){function r(e){var t=this.__data__;return i?void 0!==t[e]:a.call(t,e)}var i=n(13),o=Object.prototype,a=o.hasOwnProperty;e.e=r},function(e,t,n){function r(e,t){var n=this.__data__;return n[e]=i&&void 0===t?o:t,this}var i=n(13),o="__lodash_hash_undefined__";e.e=r},function(e,t,n){function r(e){var t=e.length,n=e.constructor(t);return t&&"string"==typeof e[0]&&o.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var i=Object.prototype,o=i.hasOwnProperty;e.e=r},function(e,t,n){function r(e,t,n,r){var D=e.constructor;switch(t){case b:return i(e);case d:case l:return new D((+e));case _:return o(e,r);case w:case C:case E:case T:case R:case S:case x:case O:case P:return f(e,r);case p:return a(e,r,n);case h:case m:return new D(e);case v:return c(e);case g:return s(e,r,n);case y:return u(e)}}var i=n(23),o=n(124),a=n(125),c=n(126),s=n(127),u=n(128),f=n(129),d="[object Boolean]",l="[object Date]",p="[object Map]",h="[object Number]",v="[object RegExp]",g="[object Set]",m="[object String]",y="[object Symbol]",b="[object ArrayBuffer]",_="[object DataView]",w="[object Float32Array]",C="[object Float64Array]",E="[object Int8Array]",T="[object Int16Array]",R="[object Int32Array]",S="[object Uint8Array]",x="[object Uint8ClampedArray]",O="[object Uint16Array]",P="[object Uint32Array]";e.e=r},function(e,t,n){function r(e){return"function"!=typeof e.constructor||a(e)?{}:i(o(e))}var i=n(109),o=n(25),a=n(28);e.e=r},function(e,t,n){function r(e){return a(e)||o(e)||!!(c&&e&&e[c])}var i=n(39),o=n(30),a=n(5),c=i?i.isConcatSpreadable:void 0;e.e=r},function(e,t,n){function r(e,t,n){if(!c(n))return!1;var r=typeof t;return!!("number"==r?o(n)&&a(t,n.length):"string"==r&&t in n)&&i(n[t],e)}var i=n(14),o=n(15),a=n(52),c=n(2);e.e=r},function(e,t,n){function r(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}e.e=r},function(e,t,n){function r(e){return!!o&&o in e}var i=n(131),o=function(){var e=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();e.e=r},function(e,t,n){function r(){this.__data__=[]}e.e=r},function(e,t,n){function r(e){var t=this.__data__,n=i(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():a.call(t,n,1),!0}var i=n(11),o=Array.prototype,a=o.splice;e.e=r},function(e,t,n){function r(e){var t=this.__data__,n=i(t,e);return n<0?void 0:t[n][1]}var i=n(11);e.e=r},function(e,t,n){function r(e){return i(this.__data__,e)>-1}var i=n(11);e.e=r},function(e,t,n){function r(e,t){var n=this.__data__,r=i(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}var i=n(11);e.e=r},function(e,t,n){function r(){this.__data__={hash:new i,map:new(a||o),string:new i}}var i=n(96),o=n(10),a=n(19);e.e=r},function(e,t,n){function r(e){return i(this,e)["delete"](e)}var i=n(12);e.e=r},function(e,t,n){function r(e){return i(this,e).get(e)}var i=n(12);e.e=r},function(e,t,n){function r(e){return i(this,e).has(e)}var i=n(12);e.e=r},function(e,t,n){function r(e,t){return i(this,e).set(e,t),this}var i=n(12);e.e=r},function(e,t,n){function r(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}e.e=r},function(e,t,n){var r=n(29),i=r(Object.keys,Object);e.e=i},function(e,t,n){function r(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}e.e=r},function(e,t,n){(function(e){var r=n(51),i="object"==typeof t&&t&&!t.nodeType&&t,o=i&&"object"==typeof e&&e&&!e.nodeType&&e,a=o&&o.exports===i,c=a&&r.process,s=function(){try{return c&&c.binding("util")}catch(e){}}();e.e=s}).call(t,n(60)(e))},function(e,t,n){function r(e){return this.__data__.set(e,i),this}var i="__lodash_hash_undefined__";e.e=r},function(e,t,n){function r(e){return this.__data__.has(e)}e.e=r},function(e,t,n){function r(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}e.e=r},function(e,t,n){function r(){this.__data__=new i}var i=n(10);e.e=r},function(e,t,n){function r(e){return this.__data__["delete"](e)}e.e=r},function(e,t,n){function r(e){return this.__data__.get(e)}e.e=r},function(e,t,n){function r(e){return this.__data__.has(e)}e.e=r},function(e,t,n){function r(e,t){var n=this.__data__;if(n instanceof i){var r=n.__data__;if(!o||r.length<c-1)return r.push([e,t]),this;n=this.__data__=new a(r)}return n.set(e,t),this}var i=n(10),o=n(19),a=n(37),c=200;e.e=r},function(e,t,n){(function(e){var r=n(1),i=n(177),o="object"==typeof t&&t&&!t.nodeType&&t,a=o&&"object"==typeof e&&e&&!e.nodeType&&e,c=a&&a.exports===o,s=c?r.Buffer:void 0,u=s?s.isBuffer:void 0,f=u||i;e.e=f}).call(t,n(60)(e))},function(e,t,n){function r(e){if(!a(e)||p.call(e)!=c||o(e))return!1;var t=i(e);if(null===t)return!0;var n=d.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&f.call(n)==l}var i=n(25),o=n(27),a=n(16),c="[object Object]",s=Function.prototype,u=Object.prototype,f=s.toString,d=u.hasOwnProperty,l=f.call(Object),p=u.toString;e.e=r},function(e,t,n){function r(e){return"symbol"==typeof e||i(e)&&c.call(e)==o}var i=n(16),o="[object Symbol]",a=Object.prototype,c=a.toString;e.e=r},function(e,t,n){var r=n(20),i=n(110),o=n(45),a=n(48),c=n(22),s=n(134),u=n(53),f=c(function(e,t){return null==e?{}:(t=r(o(t,1),u),a(e,i(s(e),t)))});e.e=f},function(e,t,n){var r=n(20),i=n(45),o=n(48),a=n(22),c=n(53),s=a(function(e,t){return null==e?{}:o(e,r(i(t,1),c))});e.e=s},function(e,t,n){function r(){return!1}e.e=r},function(e,t,n){function r(e){return i(e,o(e))}var i=n(24),o=n(58);e.e=r},function(e,t,n){"use strict";var r={};r.generateIdentifier=function(){return Math.random().toString(36).substr(2,10)},r.localCName=r.generateIdentifier(),r.splitLines=function(e){return e.trim().split("\n").map(function(e){return e.trim()})},r.splitSections=function(e){var t=e.split("\nm=");return t.map(function(e,t){return(t>0?"m="+e:e).trim()+"\r\n"})},r.matchPrefix=function(e,t){return r.splitLines(e).filter(function(e){return 0===e.indexOf(t)})},r.parseCandidate=function(e){var t;t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" ");for(var n={foundation:t[0],component:t[1],protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),
|
|
ip:t[4],port:parseInt(t[5],10),type:t[7]},r=8;r<t.length;r+=2)switch(t[r]){case"raddr":n.relatedAddress=t[r+1];break;case"rport":n.relatedPort=parseInt(t[r+1],10);break;case"tcptype":n.tcpType=t[r+1]}return n},r.writeCandidate=function(e){var t=[];t.push(e.foundation),t.push(e.component),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.ip),t.push(e.port);var n=e.type;return t.push("typ"),t.push(n),"host"!==n&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),"candidate:"+t.join(" ")},r.parseRtpMap=function(e){var t=e.substr(9).split(" "),n={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),n.name=t[0],n.clockRate=parseInt(t[1],10),n.numChannels=3===t.length?parseInt(t[2],10):1,n},r.writeRtpMap=function(e){var t=e.payloadType;return void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType),"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==e.numChannels?"/"+e.numChannels:"")+"\r\n"},r.parseExtmap=function(e){var t=e.substr(9).split(" ");return{id:parseInt(t[0],10),uri:t[1]}},r.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+" "+e.uri+"\r\n"},r.parseFmtp=function(e){for(var t,n={},r=e.substr(e.indexOf(" ")+1).split(";"),i=0;i<r.length;i++)t=r[i].trim().split("="),n[t[0].trim()]=t[1];return n},r.writeFmtp=function(e){var t="",n=e.payloadType;if(void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){var r=[];Object.keys(e.parameters).forEach(function(t){r.push(t+"="+e.parameters[t])}),t+="a=fmtp:"+n+" "+r.join(";")+"\r\n"}return t},r.parseRtcpFb=function(e){var t=e.substr(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},r.writeRtcpFb=function(e){var t="",n=e.payloadType;return void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach(function(e){t+="a=rtcp-fb:"+n+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"}),t},r.parseSsrcMedia=function(e){var t=e.indexOf(" "),n={ssrc:parseInt(e.substr(7,t-7),10)},r=e.indexOf(":",t);return r>-1?(n.attribute=e.substr(t+1,r-t-1),n.value=e.substr(r+1)):n.attribute=e.substr(t+1),n},r.getDtlsParameters=function(e,t){var n=r.splitLines(e);n=n.concat(r.splitLines(t));var i=n.filter(function(e){return 0===e.indexOf("a=fingerprint:")})[0].substr(14),o={role:"auto",fingerprints:[{algorithm:i.split(" ")[0],value:i.split(" ")[1]}]};return o},r.writeDtlsParameters=function(e,t){var n="a=setup:"+t+"\r\n";return e.fingerprints.forEach(function(e){n+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"}),n},r.getIceParameters=function(e,t){var n=r.splitLines(e);n=n.concat(r.splitLines(t));var i={usernameFragment:n.filter(function(e){return 0===e.indexOf("a=ice-ufrag:")})[0].substr(12),password:n.filter(function(e){return 0===e.indexOf("a=ice-pwd:")})[0].substr(10)};return i},r.writeIceParameters=function(e){return"a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n"},r.parseRtpParameters=function(e){for(var t={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=r.splitLines(e),i=n[0].split(" "),o=3;o<i.length;o++){var a=i[o],c=r.matchPrefix(e,"a=rtpmap:"+a+" ")[0];if(c){var s=r.parseRtpMap(c),u=r.matchPrefix(e,"a=fmtp:"+a+" ");switch(s.parameters=u.length?r.parseFmtp(u[0]):{},s.rtcpFeedback=r.matchPrefix(e,"a=rtcp-fb:"+a+" ").map(r.parseRtcpFb),t.codecs.push(s),s.name.toUpperCase()){case"RED":case"ULPFEC":t.fecMechanisms.push(s.name.toUpperCase())}}}return r.matchPrefix(e,"a=extmap:").forEach(function(e){t.headerExtensions.push(r.parseExtmap(e))}),t},r.writeRtpDescription=function(e,t){var n="";return n+="m="+e+" ",n+=t.codecs.length>0?"9":"0",n+=" UDP/TLS/RTP/SAVPF ",n+=t.codecs.map(function(e){return void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType}).join(" ")+"\r\n",n+="c=IN IP4 0.0.0.0\r\n",n+="a=rtcp:9 IN IP4 0.0.0.0\r\n",t.codecs.forEach(function(e){n+=r.writeRtpMap(e),n+=r.writeFmtp(e),n+=r.writeRtcpFb(e)}),n+="a=rtcp-mux\r\n"},r.parseRtpEncodingParameters=function(e){var t,n=[],i=r.parseRtpParameters(e),o=i.fecMechanisms.indexOf("RED")!==-1,a=i.fecMechanisms.indexOf("ULPFEC")!==-1,c=r.matchPrefix(e,"a=ssrc:").map(function(e){return r.parseSsrcMedia(e)}).filter(function(e){return"cname"===e.attribute}),s=c.length>0&&c[0].ssrc,u=r.matchPrefix(e,"a=ssrc-group:FID").map(function(e){var t=e.split(" ");return t.shift(),t.map(function(e){return parseInt(e,10)})});u.length>0&&u[0].length>1&&u[0][0]===s&&(t=u[0][1]),i.codecs.forEach(function(e){if("RTX"===e.name.toUpperCase()&&e.parameters.apt){var r={ssrc:s,codecPayloadType:parseInt(e.parameters.apt,10),rtx:{payloadType:e.payloadType,ssrc:t}};n.push(r),o&&(r=JSON.parse(JSON.stringify(r)),r.fec={ssrc:t,mechanism:a?"red+ulpfec":"red"},n.push(r))}}),0===n.length&&s&&n.push({ssrc:s});var f=r.matchPrefix(e,"b=");return f.length&&(0===f[0].indexOf("b=TIAS:")?f=parseInt(f[0].substr(7),10):0===f[0].indexOf("b=AS:")&&(f=parseInt(f[0].substr(5),10)),n.forEach(function(e){e.maxBitrate=f})),n},r.writeSessionBoilerplate=function(){return"v=0\r\no=thisisadapterortc 8169639915646943137 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},r.writeMediaSection=function(e,t,n,i){var o=r.writeRtpDescription(e.kind,t);if(o+=r.writeIceParameters(e.iceGatherer.getLocalParameters()),o+=r.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===n?"actpass":"active"),o+="a=mid:"+e.mid+"\r\n",o+=e.rtpSender&&e.rtpReceiver?"a=sendrecv\r\n":e.rtpSender?"a=sendonly\r\n":e.rtpReceiver?"a=recvonly\r\n":"a=inactive\r\n",e.rtpSender){var a="msid:"+i.id+" "+e.rtpSender.track.id+"\r\n";o+="a="+a,o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+a}return o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+r.localCName+"\r\n"},r.getDirection=function(e,t){for(var n=r.splitLines(e),i=0;i<n.length;i++)switch(n[i]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[i].substr(2)}return t?r.getDirection(t):"sendrecv"},e.e=r},function(e,t,n){"use strict";!function(){var t=n(0).log,r=n(0).browserDetails;e.e.browserDetails=r,e.e.extractVersion=n(0).extractVersion,e.e.disableLog=n(0).disableLog;var i=n(181)||null,o=n(183)||null,a=n(185)||null,c=n(187)||null;switch(r.browser){case"opera":case"chrome":if(!i||!i.shimPeerConnection)return void t("Chrome shim is not included in this adapter release.");t("adapter.js shimming chrome."),e.e.browserShim=i,i.shimGetUserMedia(),i.shimMediaStream(),i.shimSourceObject(),i.shimPeerConnection(),i.shimOnTrack();break;case"firefox":if(!a||!a.shimPeerConnection)return void t("Firefox shim is not included in this adapter release.");t("adapter.js shimming firefox."),e.e.browserShim=a,a.shimGetUserMedia(),a.shimSourceObject(),a.shimPeerConnection(),a.shimOnTrack();break;case"edge":if(!o||!o.shimPeerConnection)return void t("MS edge shim is not included in this adapter release.");t("adapter.js shimming edge."),e.e.browserShim=o,o.shimGetUserMedia(),o.shimPeerConnection();break;case"safari":if(!c)return void t("Safari shim is not included in this adapter release.");t("adapter.js shimming safari."),e.e.browserShim=c,c.shimGetUserMedia();break;default:t("Unsupported browser!")}}()},function(e,t,n){"use strict";var r=n(0).log,i=n(0).browserDetails,o={shimMediaStream:function(){window.MediaStream=window.MediaStream||window.webkitMediaStream},shimOnTrack:function(){"object"!=typeof window||!window.RTCPeerConnection||"ontrack"in window.RTCPeerConnection.prototype||Object.defineProperty(window.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(e){var t=this;this._ontrack&&(this.removeEventListener("track",this._ontrack),this.removeEventListener("addstream",this._ontrackpoly)),this.addEventListener("track",this._ontrack=e),this.addEventListener("addstream",this._ontrackpoly=function(e){e.stream.addEventListener("addtrack",function(n){var r=new Event("track");r.track=n.track,r.receiver={track:n.track},r.streams=[e.stream],t.dispatchEvent(r)}),e.stream.getTracks().forEach(function(t){var n=new Event("track");n.track=t,n.receiver={track:t},n.streams=[e.stream],this.dispatchEvent(n)}.bind(this))}.bind(this))}})},shimSourceObject:function(){"object"==typeof window&&(!window.HTMLMediaElement||"srcObject"in window.HTMLMediaElement.prototype||Object.defineProperty(window.HTMLMediaElement.prototype,"srcObject",{get:function(){return this._srcObject},set:function(e){var t=this;return this._srcObject=e,this.src&&URL.revokeObjectURL(this.src),e?(this.src=URL.createObjectURL(e),e.addEventListener("addtrack",function(){t.src&&URL.revokeObjectURL(t.src),t.src=URL.createObjectURL(e)}),void e.addEventListener("removetrack",function(){t.src&&URL.revokeObjectURL(t.src),t.src=URL.createObjectURL(e)})):void(this.src="")}}))},shimPeerConnection:function(){window.RTCPeerConnection=function(e,t){r("PeerConnection"),e&&e.iceTransportPolicy&&(e.iceTransports=e.iceTransportPolicy);var n=new webkitRTCPeerConnection(e,t),i=n.getStats.bind(n);return n.getStats=function(e,t,n){var r=this,o=arguments;if(arguments.length>0&&"function"==typeof e)return i(e,t);var a=function(e){var t={},n=e.result();return n.forEach(function(e){var n={id:e.id,timestamp:e.timestamp,type:e.type};e.names().forEach(function(t){n[t]=e.stat(t)}),t[n.id]=n}),t},c=function(e,t){var n=new Map(Object.keys(e).map(function(t){return[t,e[t]]}));return t=t||e,Object.keys(t).forEach(function(e){n[e]=t[e]}),n};if(arguments.length>=2){var s=function(e){o[1](c(a(e)))};return i.apply(this,[s,arguments[0]])}return new Promise(function(t,n){1===o.length&&"object"==typeof e?i.apply(r,[function(e){t(c(a(e)))},n]):i.apply(r,[function(e){t(c(a(e),e.result()))},n])}).then(t,n)},n},window.RTCPeerConnection.prototype=webkitRTCPeerConnection.prototype,webkitRTCPeerConnection.generateCertificate&&Object.defineProperty(window.RTCPeerConnection,"generateCertificate",{get:function(){return webkitRTCPeerConnection.generateCertificate}}),["createOffer","createAnswer"].forEach(function(e){var t=webkitRTCPeerConnection.prototype[e];webkitRTCPeerConnection.prototype[e]=function(){var e=this;if(arguments.length<1||1===arguments.length&&"object"==typeof arguments[0]){var n=1===arguments.length?arguments[0]:void 0;return new Promise(function(r,i){t.apply(e,[r,i,n])})}return t.apply(this,arguments)}}),i.version<51&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(e){var t=webkitRTCPeerConnection.prototype[e];webkitRTCPeerConnection.prototype[e]=function(){var e=arguments,n=this,r=new Promise(function(r,i){t.apply(n,[e[0],r,i])});return e.length<2?r:r.then(function(){e[1].apply(null,[])},function(t){e.length>=3&&e[2].apply(null,[t])})}}),["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(e){var t=webkitRTCPeerConnection.prototype[e];webkitRTCPeerConnection.prototype[e]=function(){return arguments[0]=new("addIceCandidate"===e?RTCIceCandidate:RTCSessionDescription)(arguments[0]),t.apply(this,arguments)}});var e=RTCPeerConnection.prototype.addIceCandidate;RTCPeerConnection.prototype.addIceCandidate=function(){return null===arguments[0]?Promise.resolve():e.apply(this,arguments)}}};e.e={shimMediaStream:o.shimMediaStream,shimOnTrack:o.shimOnTrack,shimSourceObject:o.shimSourceObject,shimPeerConnection:o.shimPeerConnection,shimGetUserMedia:n(182)}},function(e,t,n){"use strict";var r=n(0).log;e.e=function(){var e=function(e){if("object"!=typeof e||e.mandatory||e.optional)return e;var t={};return Object.keys(e).forEach(function(n){if("require"!==n&&"advanced"!==n&&"mediaSource"!==n){var r="object"==typeof e[n]?e[n]:{ideal:e[n]};void 0!==r.exact&&"number"==typeof r.exact&&(r.min=r.max=r.exact);var i=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==r.ideal){t.optional=t.optional||[];var o={};"number"==typeof r.ideal?(o[i("min",n)]=r.ideal,t.optional.push(o),o={},o[i("max",n)]=r.ideal,t.optional.push(o)):(o[i("",n)]=r.ideal,t.optional.push(o))}void 0!==r.exact&&"number"!=typeof r.exact?(t.mandatory=t.mandatory||{},t.mandatory[i("",n)]=r.exact):["min","max"].forEach(function(e){void 0!==r[e]&&(t.mandatory=t.mandatory||{},t.mandatory[i(e,n)]=r[e])})}}),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},t=function(t,n){if(t=JSON.parse(JSON.stringify(t)),t&&t.audio&&(t.audio=e(t.audio)),t&&"object"==typeof t.video){var i=t.video.facingMode;if(i=i&&("object"==typeof i?i:{ideal:i}),i&&("user"===i.exact||"environment"===i.exact||"user"===i.ideal||"environment"===i.ideal)&&(!navigator.mediaDevices.getSupportedConstraints||!navigator.mediaDevices.getSupportedConstraints().facingMode)&&(delete t.video.facingMode,"environment"===i.exact||"environment"===i.ideal))return navigator.mediaDevices.enumerateDevices().then(function(o){o=o.filter(function(e){return"videoinput"===e.kind});var a=o.find(function(e){return e.label.toLowerCase().indexOf("back")!==-1})||o.length&&o[o.length-1];return a&&(t.video.deviceId=i.exact?{exact:a.deviceId}:{ideal:a.deviceId}),t.video=e(t.video),r("chrome: "+JSON.stringify(t)),n(t)});t.video=e(t.video)}return r("chrome: "+JSON.stringify(t)),n(t)},n=function(e){return{name:{PermissionDeniedError:"NotAllowedError",ConstraintNotSatisfiedError:"OverconstrainedError"}[e.name]||e.name,message:e.message,constraint:e.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}},i=function(e,r,i){t(e,function(e){navigator.webkitGetUserMedia(e,r,function(e){i(n(e))})})};navigator.getUserMedia=i;var o=function(e){return new Promise(function(t,n){navigator.getUserMedia(e,t,n)})};if(navigator.mediaDevices||(navigator.mediaDevices={getUserMedia:o,enumerateDevices:function(){return new Promise(function(e){var t={audio:"audioinput",video:"videoinput"};return MediaStreamTrack.getSources(function(n){e(n.map(function(e){return{label:e.label,kind:t[e.kind],deviceId:e.id,groupId:""}}))})})}}),navigator.mediaDevices.getUserMedia){var a=navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);navigator.mediaDevices.getUserMedia=function(e){return t(e,function(e){return a(e)["catch"](function(e){return Promise.reject(n(e))})})}}else navigator.mediaDevices.getUserMedia=function(e){return o(e)};"undefined"==typeof navigator.mediaDevices.addEventListener&&(navigator.mediaDevices.addEventListener=function(){r("Dummy mediaDevices.addEventListener called.")}),"undefined"==typeof navigator.mediaDevices.removeEventListener&&(navigator.mediaDevices.removeEventListener=function(){r("Dummy mediaDevices.removeEventListener called.")})}},function(e,t,n){"use strict";var r=n(179),i=n(0).browserDetails,o={shimPeerConnection:function(){window.RTCIceGatherer&&(window.RTCIceCandidate||(window.RTCIceCandidate=function(e){return e}),window.RTCSessionDescription||(window.RTCSessionDescription=function(e){return e})),window.RTCPeerConnection=function(e){var t=this,n=document.createDocumentFragment();if(["addEventListener","removeEventListener","dispatchEvent"].forEach(function(e){t[e]=n[e].bind(n)}),this.onicecandidate=null,this.onaddstream=null,this.ontrack=null,this.onremovestream=null,this.onsignalingstatechange=null,this.oniceconnectionstatechange=null,this.onnegotiationneeded=null,this.ondatachannel=null,this.localStreams=[],this.remoteStreams=[],this.getLocalStreams=function(){return t.localStreams},this.getRemoteStreams=function(){return t.remoteStreams},this.localDescription=new RTCSessionDescription({type:"",sdp:""}),this.remoteDescription=new RTCSessionDescription({type:"",sdp:""}),this.signalingState="stable",this.iceConnectionState="new",this.iceGatheringState="new",this.iceOptions={gatherPolicy:"all",iceServers:[]},e&&e.iceTransportPolicy)switch(e.iceTransportPolicy){case"all":case"relay":this.iceOptions.gatherPolicy=e.iceTransportPolicy;break;case"none":throw new TypeError('iceTransportPolicy "none" not supported')}if(this.usingBundle=e&&"max-bundle"===e.bundlePolicy,e&&e.iceServers){var r=JSON.parse(JSON.stringify(e.iceServers));this.iceOptions.iceServers=r.filter(function(e){if(e&&e.urls){var t=e.urls;return"string"==typeof t&&(t=[t]),t=t.filter(function(e){return 0===e.indexOf("turn:")&&e.indexOf("transport=udp")!==-1&&e.indexOf("turn:[")===-1||0===e.indexOf("stun:")&&i.version>=14393})[0],!!t}return!1})}this.transceivers=[],this._localIceCandidatesBuffer=[]},window.RTCPeerConnection.prototype._emitBufferedCandidates=function(){var e=this,t=r.splitSections(e.localDescription.sdp);this._localIceCandidatesBuffer.forEach(function(n){var r=!n.candidate||0===Object.keys(n.candidate).length;if(r)for(var i=1;i<t.length;i++)t[i].indexOf("\r\na=end-of-candidates\r\n")===-1&&(t[i]+="a=end-of-candidates\r\n");else n.candidate.candidate.indexOf("typ endOfCandidates")===-1&&(t[n.candidate.sdpMLineIndex+1]+="a="+n.candidate.candidate+"\r\n");if(e.localDescription.sdp=t.join(""),e.dispatchEvent(n),null!==e.onicecandidate&&e.onicecandidate(n),!n.candidate&&"complete"!==e.iceGatheringState){var o=e.transceivers.every(function(e){return e.iceGatherer&&"completed"===e.iceGatherer.state});o&&(e.iceGatheringState="complete")}}),this._localIceCandidatesBuffer=[]},window.RTCPeerConnection.prototype.addStream=function(e){this.localStreams.push(e.clone()),this._maybeFireNegotiationNeeded()},window.RTCPeerConnection.prototype.removeStream=function(e){var t=this.localStreams.indexOf(e);t>-1&&(this.localStreams.splice(t,1),this._maybeFireNegotiationNeeded())},window.RTCPeerConnection.prototype.getSenders=function(){return this.transceivers.filter(function(e){return!!e.rtpSender}).map(function(e){return e.rtpSender})},window.RTCPeerConnection.prototype.getReceivers=function(){return this.transceivers.filter(function(e){return!!e.rtpReceiver}).map(function(e){return e.rtpReceiver})},window.RTCPeerConnection.prototype._getCommonCapabilities=function(e,t){var n={codecs:[],headerExtensions:[],fecMechanisms:[]};return e.codecs.forEach(function(e){for(var r=0;r<t.codecs.length;r++){var i=t.codecs[r];if(e.name.toLowerCase()===i.name.toLowerCase()&&e.clockRate===i.clockRate&&e.numChannels===i.numChannels){n.codecs.push(i),i.rtcpFeedback=i.rtcpFeedback.filter(function(t){for(var n=0;n<e.rtcpFeedback.length;n++)if(e.rtcpFeedback[n].type===t.type&&e.rtcpFeedback[n].parameter===t.parameter)return!0;return!1});break}}}),e.headerExtensions.forEach(function(e){for(var r=0;r<t.headerExtensions.length;r++){var i=t.headerExtensions[r];if(e.uri===i.uri){n.headerExtensions.push(i);break}}}),n},window.RTCPeerConnection.prototype._createIceAndDtlsTransports=function(e,t){var n=this,i=new RTCIceGatherer(n.iceOptions),o=new RTCIceTransport(i);i.onlocalcandidate=function(a){var c=new Event("icecandidate");c.candidate={sdpMid:e,sdpMLineIndex:t};var s=a.candidate,u=!s||0===Object.keys(s).length;u?(void 0===i.state&&(i.state="completed"),c.candidate.candidate="candidate:1 1 udp 1 0.0.0.0 9 typ endOfCandidates"):(s.component="RTCP"===o.component?2:1,c.candidate.candidate=r.writeCandidate(s));var f=r.splitSections(n.localDescription.sdp);c.candidate.candidate.indexOf("typ endOfCandidates")===-1?f[c.candidate.sdpMLineIndex+1]+="a="+c.candidate.candidate+"\r\n":f[c.candidate.sdpMLineIndex+1]+="a=end-of-candidates\r\n",n.localDescription.sdp=f.join("");var d=n.transceivers.every(function(e){return e.iceGatherer&&"completed"===e.iceGatherer.state});switch(n.iceGatheringState){case"new":n._localIceCandidatesBuffer.push(c),u&&d&&n._localIceCandidatesBuffer.push(new Event("icecandidate"));break;case"gathering":n._emitBufferedCandidates(),n.dispatchEvent(c),null!==n.onicecandidate&&n.onicecandidate(c),d&&(n.dispatchEvent(new Event("icecandidate")),null!==n.onicecandidate&&n.onicecandidate(new Event("icecandidate")),n.iceGatheringState="complete");break;case"complete":}},o.onicestatechange=function(){n._updateConnectionState()};var a=new RTCDtlsTransport(o);return a.ondtlsstatechange=function(){n._updateConnectionState()},a.onerror=function(){a.state="failed",n._updateConnectionState()},{iceGatherer:i,iceTransport:o,dtlsTransport:a}},window.RTCPeerConnection.prototype._transceive=function(e,t,n){var i=this._getCommonCapabilities(e.localCapabilities,e.remoteCapabilities);t&&e.rtpSender&&(i.encodings=e.sendEncodingParameters,i.rtcp={cname:r.localCName},e.recvEncodingParameters.length&&(i.rtcp.ssrc=e.recvEncodingParameters[0].ssrc),e.rtpSender.send(i)),n&&e.rtpReceiver&&(i.encodings=e.recvEncodingParameters,i.rtcp={cname:e.cname},e.sendEncodingParameters.length&&(i.rtcp.ssrc=e.sendEncodingParameters[0].ssrc),e.rtpReceiver.receive(i))},window.RTCPeerConnection.prototype.setLocalDescription=function(e){var t,n,i=this;if("offer"===e.type)this._pendingOffer&&(t=r.splitSections(e.sdp),n=t.shift(),t.forEach(function(e,t){var n=r.parseRtpParameters(e);i._pendingOffer[t].localCapabilities=n}),this.transceivers=this._pendingOffer,delete this._pendingOffer);else if("answer"===e.type){t=r.splitSections(i.remoteDescription.sdp),n=t.shift();var o=r.matchPrefix(n,"a=ice-lite").length>0;t.forEach(function(e,t){var a=i.transceivers[t],c=a.iceGatherer,s=a.iceTransport,u=a.dtlsTransport,f=a.localCapabilities,d=a.remoteCapabilities,l="0"===e.split("\n",1)[0].split(" ",2)[1];if(!l){var p=r.getIceParameters(e,n);if(o){var h=r.matchPrefix(e,"a=candidate:").map(function(e){return r.parseCandidate(e)}).filter(function(e){return"1"===e.component});h.length&&s.setRemoteCandidates(h)}var v=r.getDtlsParameters(e,n);o&&(v.role="server"),i.usingBundle&&0!==t||(s.start(c,p,o?"controlling":"controlled"),u.start(v));var g=i._getCommonCapabilities(f,d);i._transceive(a,g.codecs.length>0,!1)}})}switch(this.localDescription={type:e.type,sdp:e.sdp},e.type){case"offer":this._updateSignalingState("have-local-offer");break;case"answer":this._updateSignalingState("stable");break;default:throw new TypeError('unsupported type "'+e.type+'"')}var a=arguments.length>1&&"function"==typeof arguments[1];if(a){var c=arguments[1];window.setTimeout(function(){c(),"new"===i.iceGatheringState&&(i.iceGatheringState="gathering"),i._emitBufferedCandidates()},0)}var s=Promise.resolve();return s.then(function(){a||("new"===i.iceGatheringState&&(i.iceGatheringState="gathering"),window.setTimeout(i._emitBufferedCandidates.bind(i),500))}),s},window.RTCPeerConnection.prototype.setRemoteDescription=function(e){var t=this,n=new MediaStream,i=[],o=r.splitSections(e.sdp),a=o.shift(),c=r.matchPrefix(a,"a=ice-lite").length>0;switch(this.usingBundle=r.matchPrefix(a,"a=group:BUNDLE ").length>0,o.forEach(function(o,s){var u,f,d,l,p,h,v,g,m,y,b,_,w=r.splitLines(o),C=w[0].substr(2).split(" "),E=C[0],T="0"===C[1],R=r.getDirection(o,a),S=r.parseRtpParameters(o);T||(b=r.getIceParameters(o,a),_=r.getDtlsParameters(o,a),_.role="client"),g=r.parseRtpEncodingParameters(o);var x=r.matchPrefix(o,"a=mid:");x=x.length?x[0].substr(6):r.generateIdentifier();var O,P=r.matchPrefix(o,"a=ssrc:").map(function(e){return r.parseSsrcMedia(e)}).filter(function(e){return"cname"===e.attribute})[0];P&&(O=P.value);var D=r.matchPrefix(o,"a=end-of-candidates",a).length>0,A=r.matchPrefix(o,"a=candidate:").map(function(e){return r.parseCandidate(e)}).filter(function(e){return"1"===e.component});if("offer"!==e.type||T)"answer"!==e.type||T||(u=t.transceivers[s],f=u.iceGatherer,d=u.iceTransport,l=u.dtlsTransport,p=u.rtpSender,h=u.rtpReceiver,v=u.sendEncodingParameters,m=u.localCapabilities,t.transceivers[s].recvEncodingParameters=g,t.transceivers[s].remoteCapabilities=S,t.transceivers[s].cname=O,(c||D)&&A.length&&d.setRemoteCandidates(A),t.usingBundle&&0!==s||(d.start(f,b,"controlling"),l.start(_)),t._transceive(u,"sendrecv"===R||"recvonly"===R,"sendrecv"===R||"sendonly"===R),!h||"sendrecv"!==R&&"sendonly"!==R?delete u.rtpReceiver:(y=h.track,i.push([y,h]),n.addTrack(y)));else{var M=t.usingBundle&&s>0?{iceGatherer:t.transceivers[0].iceGatherer,iceTransport:t.transceivers[0].iceTransport,dtlsTransport:t.transceivers[0].dtlsTransport}:t._createIceAndDtlsTransports(x,s);if(D&&M.iceTransport.setRemoteCandidates(A),m=RTCRtpReceiver.getCapabilities(E),v=[{ssrc:1001*(2*s+2)}],h=new RTCRtpReceiver(M.dtlsTransport,E),y=h.track,i.push([y,h]),n.addTrack(y),t.localStreams.length>0&&t.localStreams[0].getTracks().length>=s){var j;"audio"===E?j=t.localStreams[0].getAudioTracks()[0]:"video"===E&&(j=t.localStreams[0].getVideoTracks()[0]),j&&(p=new RTCRtpSender(j,M.dtlsTransport))}t.transceivers[s]={iceGatherer:M.iceGatherer,iceTransport:M.iceTransport,dtlsTransport:M.dtlsTransport,localCapabilities:m,remoteCapabilities:S,rtpSender:p,rtpReceiver:h,kind:E,mid:x,cname:O,sendEncodingParameters:v,recvEncodingParameters:g},t._transceive(t.transceivers[s],!1,"sendrecv"===R||"sendonly"===R)}}),this.remoteDescription={type:e.type,sdp:e.sdp},e.type){case"offer":this._updateSignalingState("have-remote-offer");break;case"answer":this._updateSignalingState("stable");break;default:throw new TypeError('unsupported type "'+e.type+'"')}return n.getTracks().length&&(t.remoteStreams.push(n),window.setTimeout(function(){var e=new Event("addstream");e.stream=n,t.dispatchEvent(e),null!==t.onaddstream&&window.setTimeout(function(){t.onaddstream(e)},0),i.forEach(function(r){var i=r[0],o=r[1],a=new Event("track");a.track=i,a.receiver=o,a.streams=[n],t.dispatchEvent(e),null!==t.ontrack&&window.setTimeout(function(){t.ontrack(a)},0)})},0)),arguments.length>1&&"function"==typeof arguments[1]&&window.setTimeout(arguments[1],0),Promise.resolve()},window.RTCPeerConnection.prototype.close=function(){this.transceivers.forEach(function(e){e.iceTransport&&e.iceTransport.stop(),e.dtlsTransport&&e.dtlsTransport.stop(),e.rtpSender&&e.rtpSender.stop(),e.rtpReceiver&&e.rtpReceiver.stop()}),this._updateSignalingState("closed")},window.RTCPeerConnection.prototype._updateSignalingState=function(e){this.signalingState=e;var t=new Event("signalingstatechange");this.dispatchEvent(t),null!==this.onsignalingstatechange&&this.onsignalingstatechange(t)},window.RTCPeerConnection.prototype._maybeFireNegotiationNeeded=function(){var e=new Event("negotiationneeded");this.dispatchEvent(e),null!==this.onnegotiationneeded&&this.onnegotiationneeded(e)},window.RTCPeerConnection.prototype._updateConnectionState=function(){var e,t=this,n={"new":0,closed:0,connecting:0,checking:0,connected:0,completed:0,failed:0};if(this.transceivers.forEach(function(e){n[e.iceTransport.state]++,n[e.dtlsTransport.state]++}),n.connected+=n.completed,e="new",n.failed>0?e="failed":n.connecting>0||n.checking>0?e="connecting":n.disconnected>0?e="disconnected":n["new"]>0?e="new":(n.connected>0||n.completed>0)&&(e="connected"),e!==t.iceConnectionState){t.iceConnectionState=e;var r=new Event("iceconnectionstatechange");this.dispatchEvent(r),null!==this.oniceconnectionstatechange&&this.oniceconnectionstatechange(r)}},window.RTCPeerConnection.prototype.createOffer=function(){var e=this;if(this._pendingOffer)throw new Error("createOffer called while there is a pending offer.");var t;1===arguments.length&&"function"!=typeof arguments[0]?t=arguments[0]:3===arguments.length&&(t=arguments[2]);var n=[],i=0,o=0;if(this.localStreams.length&&(i=this.localStreams[0].getAudioTracks().length,o=this.localStreams[0].getVideoTracks().length),t){if(t.mandatory||t.optional)throw new TypeError("Legacy mandatory/optional constraints not supported.");void 0!==t.offerToReceiveAudio&&(i=t.offerToReceiveAudio),void 0!==t.offerToReceiveVideo&&(o=t.offerToReceiveVideo)}for(this.localStreams.length&&this.localStreams[0].getTracks().forEach(function(e){n.push({kind:e.kind,track:e,wantReceive:"audio"===e.kind?i>0:o>0}),"audio"===e.kind?i--:"video"===e.kind&&o--});i>0||o>0;)i>0&&(n.push({kind:"audio",wantReceive:!0}),i--),o>0&&(n.push({kind:"video",wantReceive:!0}),o--);var a=r.writeSessionBoilerplate(),c=[];n.forEach(function(t,n){var i,o,a=t.track,s=t.kind,u=r.generateIdentifier(),f=e.usingBundle&&n>0?{iceGatherer:c[0].iceGatherer,iceTransport:c[0].iceTransport,dtlsTransport:c[0].dtlsTransport}:e._createIceAndDtlsTransports(u,n),d=RTCRtpSender.getCapabilities(s),l=[{ssrc:1001*(2*n+1)}];a&&(i=new RTCRtpSender(a,f.dtlsTransport)),t.wantReceive&&(o=new RTCRtpReceiver(f.dtlsTransport,s)),c[n]={iceGatherer:f.iceGatherer,iceTransport:f.iceTransport,dtlsTransport:f.dtlsTransport,localCapabilities:d,remoteCapabilities:null,rtpSender:i,rtpReceiver:o,kind:s,mid:u,sendEncodingParameters:l,recvEncodingParameters:null}}),this.usingBundle&&(a+="a=group:BUNDLE "+c.map(function(e){return e.mid}).join(" ")+"\r\n"),n.forEach(function(t,n){var i=c[n];a+=r.writeMediaSection(i,i.localCapabilities,"offer",e.localStreams[0])}),this._pendingOffer=c;var s=new RTCSessionDescription({type:"offer",sdp:a});return arguments.length&&"function"==typeof arguments[0]&&window.setTimeout(arguments[0],0,s),Promise.resolve(s)},window.RTCPeerConnection.prototype.createAnswer=function(){var e=this,t=r.writeSessionBoilerplate();this.usingBundle&&(t+="a=group:BUNDLE "+this.transceivers.map(function(e){return e.mid}).join(" ")+"\r\n"),this.transceivers.forEach(function(n){var i=e._getCommonCapabilities(n.localCapabilities,n.remoteCapabilities);t+=r.writeMediaSection(n,i,"answer",e.localStreams[0])});var n=new RTCSessionDescription({type:"answer",sdp:t});return arguments.length&&"function"==typeof arguments[0]&&window.setTimeout(arguments[0],0,n),Promise.resolve(n)},window.RTCPeerConnection.prototype.addIceCandidate=function(e){if(null===e)this.transceivers.forEach(function(e){e.iceTransport.addRemoteCandidate({})});else{var t=e.sdpMLineIndex;if(e.sdpMid)for(var n=0;n<this.transceivers.length;n++)if(this.transceivers[n].mid===e.sdpMid){t=n;break}var i=this.transceivers[t];if(i){var o=Object.keys(e.candidate).length>0?r.parseCandidate(e.candidate):{};if("tcp"===o.protocol&&(0===o.port||9===o.port))return;if("1"!==o.component)return;"endOfCandidates"===o.type&&(o={}),i.iceTransport.addRemoteCandidate(o);var a=r.splitSections(this.remoteDescription.sdp);a[t+1]+=(o.type?e.candidate.trim():"a=end-of-candidates")+"\r\n",this.remoteDescription.sdp=a.join("")}}return arguments.length>1&&"function"==typeof arguments[1]&&window.setTimeout(arguments[1],0),Promise.resolve()},window.RTCPeerConnection.prototype.getStats=function(){var e=[];this.transceivers.forEach(function(t){["rtpSender","rtpReceiver","iceGatherer","iceTransport","dtlsTransport"].forEach(function(n){t[n]&&e.push(t[n].getStats())})});var t=arguments.length>1&&"function"==typeof arguments[1]&&arguments[1];return new Promise(function(n){var r=new Map;Promise.all(e).then(function(e){e.forEach(function(e){Object.keys(e).forEach(function(t){r.set(t,e[t]),r[t]=e[t]})}),t&&window.setTimeout(t,0,r),n(r)})})}}};e.e={shimPeerConnection:o.shimPeerConnection,shimGetUserMedia:n(184)}},function(e,t,n){"use strict";e.e=function(){var e=function(e){return{name:{PermissionDeniedError:"NotAllowedError"}[e.name]||e.name,message:e.message,constraint:e.constraint,toString:function(){return this.name}}},t=navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);navigator.mediaDevices.getUserMedia=function(n){return t(n)["catch"](function(t){return Promise.reject(e(t))})}}},function(e,t,n){"use strict";var r=n(0).browserDetails,i={shimOnTrack:function(){"object"!=typeof window||!window.RTCPeerConnection||"ontrack"in window.RTCPeerConnection.prototype||Object.defineProperty(window.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(e){this._ontrack&&(this.removeEventListener("track",this._ontrack),this.removeEventListener("addstream",this._ontrackpoly)),this.addEventListener("track",this._ontrack=e),this.addEventListener("addstream",this._ontrackpoly=function(e){e.stream.getTracks().forEach(function(t){var n=new Event("track");n.track=t,n.receiver={track:t},n.streams=[e.stream],this.dispatchEvent(n)}.bind(this))}.bind(this))}})},shimSourceObject:function(){"object"==typeof window&&(!window.HTMLMediaElement||"srcObject"in window.HTMLMediaElement.prototype||Object.defineProperty(window.HTMLMediaElement.prototype,"srcObject",{get:function(){
|
|
return this.mozSrcObject},set:function(e){this.mozSrcObject=e}}))},shimPeerConnection:function(){if("object"==typeof window&&(window.RTCPeerConnection||window.mozRTCPeerConnection)){window.RTCPeerConnection||(window.RTCPeerConnection=function(e,t){if(r.version<38&&e&&e.iceServers){for(var n=[],i=0;i<e.iceServers.length;i++){var o=e.iceServers[i];if(o.hasOwnProperty("urls"))for(var a=0;a<o.urls.length;a++){var c={url:o.urls[a]};0===o.urls[a].indexOf("turn")&&(c.username=o.username,c.credential=o.credential),n.push(c)}else n.push(e.iceServers[i])}e.iceServers=n}return new mozRTCPeerConnection(e,t)},window.RTCPeerConnection.prototype=mozRTCPeerConnection.prototype,mozRTCPeerConnection.generateCertificate&&Object.defineProperty(window.RTCPeerConnection,"generateCertificate",{get:function(){return mozRTCPeerConnection.generateCertificate}}),window.RTCSessionDescription=mozRTCSessionDescription,window.RTCIceCandidate=mozRTCIceCandidate),["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(e){var t=RTCPeerConnection.prototype[e];RTCPeerConnection.prototype[e]=function(){return arguments[0]=new("addIceCandidate"===e?RTCIceCandidate:RTCSessionDescription)(arguments[0]),t.apply(this,arguments)}});var e=RTCPeerConnection.prototype.addIceCandidate;RTCPeerConnection.prototype.addIceCandidate=function(){return null===arguments[0]?Promise.resolve():e.apply(this,arguments)};var t=function(e){var t=new Map;return Object.keys(e).forEach(function(n){t.set(n,e[n]),t[n]=e[n]}),t},n=RTCPeerConnection.prototype.getStats;RTCPeerConnection.prototype.getStats=function(e,r,i){return n.apply(this,[e||null]).then(function(e){return t(e)}).then(r,i)}}}};e.e={shimOnTrack:i.shimOnTrack,shimSourceObject:i.shimSourceObject,shimPeerConnection:i.shimPeerConnection,shimGetUserMedia:n(186)}},function(e,t,n){"use strict";var r=n(0).log,i=n(0).browserDetails;e.e=function(){var e=function(e){return{name:{SecurityError:"NotAllowedError",PermissionDeniedError:"NotAllowedError"}[e.name]||e.name,message:{"The operation is insecure.":"The request is not allowed by the user agent or the platform in the current context."}[e.message]||e.message,constraint:e.constraint,toString:function(){return this.name+(this.message&&": ")+this.message}}},t=function(t,n,o){var a=function(e){if("object"!=typeof e||e.require)return e;var t=[];return Object.keys(e).forEach(function(n){if("require"!==n&&"advanced"!==n&&"mediaSource"!==n){var r=e[n]="object"==typeof e[n]?e[n]:{ideal:e[n]};if(void 0===r.min&&void 0===r.max&&void 0===r.exact||t.push(n),void 0!==r.exact&&("number"==typeof r.exact?r.min=r.max=r.exact:e[n]=r.exact,delete r.exact),void 0!==r.ideal){e.advanced=e.advanced||[];var i={};"number"==typeof r.ideal?i[n]={min:r.ideal,max:r.ideal}:i[n]=r.ideal,e.advanced.push(i),delete r.ideal,Object.keys(r).length||delete e[n]}}}),t.length&&(e.require=t),e};return t=JSON.parse(JSON.stringify(t)),i.version<38&&(r("spec: "+JSON.stringify(t)),t.audio&&(t.audio=a(t.audio)),t.video&&(t.video=a(t.video)),r("ff37: "+JSON.stringify(t))),navigator.mozGetUserMedia(t,n,function(t){o(e(t))})},n=function(e){return new Promise(function(n,r){t(e,n,r)})};if(navigator.mediaDevices||(navigator.mediaDevices={getUserMedia:n,addEventListener:function(){},removeEventListener:function(){}}),navigator.mediaDevices.enumerateDevices=navigator.mediaDevices.enumerateDevices||function(){return new Promise(function(e){var t=[{kind:"audioinput",deviceId:"default",label:"",groupId:""},{kind:"videoinput",deviceId:"default",label:"",groupId:""}];e(t)})},i.version<41){var o=navigator.mediaDevices.enumerateDevices.bind(navigator.mediaDevices);navigator.mediaDevices.enumerateDevices=function(){return o().then(void 0,function(e){if("NotFoundError"===e.name)return[];throw e})}}if(i.version<49){var a=navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);navigator.mediaDevices.getUserMedia=function(t){return a(t)["catch"](function(t){return Promise.reject(e(t))})}}navigator.getUserMedia=function(e,n,r){return i.version<44?t(e,n,r):(console.warn("navigator.getUserMedia has been replaced by navigator.mediaDevices.getUserMedia"),void navigator.mediaDevices.getUserMedia(e).then(n,r))}}},function(e,t,n){"use strict";var r={shimGetUserMedia:function(){navigator.getUserMedia=navigator.webkitGetUserMedia}};e.e={shimGetUserMedia:r.shimGetUserMedia}},function(e,t,n){e.e=n(61)}])}); |