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.
1 line
949 KiB
Plaintext
1 line
949 KiB
Plaintext
{"version":3,"sources":["webpack:///webpack/myModuleDefinition","webpack:///quagga.min.js","webpack:///webpack/bootstrap bbe7819afe77c7859a4a","webpack:///./src/quagga.js","webpack:///./src/typedefs.js","webpack:///./src/input_stream.js","webpack:///./src/image_loader.js","webpack:///./src/image_wrapper.js","webpack:///./src/subImage.js","webpack:///./src/cv_utils.js","webpack:///./src/cluster.js","webpack:///./~/gl-matrix/src/gl-matrix.js","webpack:///./~/gl-matrix/src/gl-matrix/common.js","webpack:///./~/gl-matrix/src/gl-matrix/mat2.js","webpack:///./~/gl-matrix/src/gl-matrix/mat2d.js","webpack:///./~/gl-matrix/src/gl-matrix/mat3.js","webpack:///./~/gl-matrix/src/gl-matrix/mat4.js","webpack:///./~/gl-matrix/src/gl-matrix/quat.js","webpack:///./~/gl-matrix/src/gl-matrix/vec3.js","webpack:///./~/gl-matrix/src/gl-matrix/vec4.js","webpack:///./~/gl-matrix/src/gl-matrix/vec2.js","webpack:///./src/array_helper.js","webpack:///./src/barcode_locator.js","webpack:///./src/rasterizer.js","webpack:///./src/tracer.js","webpack:///./src/skeletonizer.js","webpack:///./src/image_debug.js","webpack:///./src/barcode_decoder.js","webpack:///./src/bresenham.js","webpack:///./src/code_128_reader.js","webpack:///./src/barcode_reader.js","webpack:///./src/ean_reader.js","webpack:///./src/code_39_reader.js","webpack:///./src/code_39_vin_reader.js","webpack:///./src/codabar_reader.js","webpack:///./src/upc_reader.js","webpack:///./src/ean_8_reader.js","webpack:///./src/upc_e_reader.js","webpack:///./src/i2of5_reader.js","webpack:///./~/lodash/object/merge.js","webpack:///./~/lodash/internal/baseMerge.js","webpack:///./~/lodash/internal/arrayEach.js","webpack:///./~/lodash/internal/baseMergeDeep.js","webpack:///./~/lodash/internal/arrayCopy.js","webpack:///./~/lodash/lang/isArguments.js","webpack:///./~/lodash/internal/isArrayLike.js","webpack:///./~/lodash/internal/getLength.js","webpack:///./~/lodash/internal/baseProperty.js","webpack:///./~/lodash/internal/isLength.js","webpack:///./~/lodash/internal/isObjectLike.js","webpack:///./~/lodash/lang/isArray.js","webpack:///./~/lodash/internal/getNative.js","webpack:///./~/lodash/lang/isNative.js","webpack:///./~/lodash/lang/isFunction.js","webpack:///./~/lodash/lang/isObject.js","webpack:///./~/lodash/lang/isPlainObject.js","webpack:///./~/lodash/internal/baseForIn.js","webpack:///./~/lodash/internal/baseFor.js","webpack:///./~/lodash/internal/createBaseFor.js","webpack:///./~/lodash/internal/toObject.js","webpack:///./~/lodash/object/keysIn.js","webpack:///./~/lodash/internal/isIndex.js","webpack:///./~/lodash/lang/isTypedArray.js","webpack:///./~/lodash/lang/toPlainObject.js","webpack:///./~/lodash/internal/baseCopy.js","webpack:///./~/lodash/object/keys.js","webpack:///./~/lodash/internal/shimKeys.js","webpack:///./~/lodash/internal/createAssigner.js","webpack:///./~/lodash/internal/bindCallback.js","webpack:///./~/lodash/utility/identity.js","webpack:///./~/lodash/internal/isIterateeCall.js","webpack:///./~/lodash/function/restParam.js","webpack:///./src/frame_grabber.js","webpack:///./src/config.js","webpack:///./src/events.js","webpack:///./src/camera_access.js","webpack:///./src/result_collector.js"],"names":["root","factory","exports","module","toString","this","__factorySource__","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","_interopRequireDefault","obj","__esModule","default","initializeData","imageWrapper","initBuffers","_decoder","_barcode_decoder2","create","_config","decoder","_inputImageWrapper","initConfig","document","vis","node","querySelector","prop","controls","_canvasContainer","dom","overlay","visual","show","i","length","style","display","initInputStream","cb","video","inputStream","type","createElement","_inputStream","_input_stream2","createVideoStream","createImageStream","$viewport","appendChild","createLiveStream","_camera_access2","request","constraints","err","trigger","setAttribute","setInputStream","addEventListener","canRecord","bind","undefined","_barcode_locator2","checkImageConstraints","locator","initCanvas","_framegrabber","_frame_grabber2","image","numOfWorkers","initWorkers","console","log","ready","play","className","ctx","getContext","width","getCanvasSize","x","height","y","clearFix","_image_wrapper2","getWidth","getHeight","size","_boxSize","_glMatrix","vec2","clone","init","getBoundingBoxes","locate","transformResult","result","moveBox","box","corner","xOffset","yOffset","moveLine","line","topRight","getTopRight","boxes","publishResult","imageData","_onUIThread","codeResult","_resultCollector","addResult","_events2","publish","locateAndDecode","decodeFromBoundingBoxes","data","update","availableWorker","_workerPool","filter","workerThread","busy","attachData","grab","worker","postMessage","cmd","buffer","_start","_stopped","frame","window","requestAnimFrame","workerInitialized","push","initWorker","blobURL","Uint8Array","generateWorkerBlob","Worker","onmessage","e","event","URL","revokeObjectURL","message","config","workerInterface","onProcessed","self","Quagga","ImageWrapper","start","setReaders","readers","blob","factorySource","Blob","createObjectURL","_setReaders","forEach","Object","defineProperty","value","_typedefs","_input_stream","_image_wrapper","_barcode_locator","_barcode_decoder","_frame_grabber","_config2","_config3","_events","_camera_access","_image_debug","_image_debug2","_result_collector","_result_collector2","merge","stop","terminate","release","clearEventHandlers","pause","onDetected","callback","subscribe","offDetected","unsubscribe","offProcessed","registerResultCollector","resultCollector","canvas","decodeSingle","resultCallback","sequence","src","halfSample","once","ImageDebug","ResultCollector","requestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","oRequestAnimationFrame","msRequestAnimationFrame","element","setTimeout","navigator","getUserMedia","webkitGetUserMedia","mozGetUserMedia","msGetUserMedia","webkitURL","mozURL","msURL","Math","imul","a","b","ah","al","bh","bl","_image_loader","_image_loader2","InputStream","initSize","videoWidth","videoHeight","_calculatedWidth","floor","_calculatedHeight","_canvasSize","that","_eventNames","_eventHandlers","_topRight","getRealWidth","getRealHeight","setWidth","setHeight","ended","getConfig","name","setCurrentTime","time","currentTime","f","bool","indexOf","eventName","handlers","handler","removeEventListener","args","j","apply","setTopRight","setCanvasSize","getFrame","loadImages","load","baseUrl","imgs","imgArray","calculatedWidth","calculatedHeight","frameIdx","publishEvent","offset","paused","stream","addOnloadHandler","img","htmlImagesArray","onload","ImageLoader","directory","num","htmlImagesSrcArray","Array","slice","notLoaded","addImage","loadedImg","notloadedImgs","splice","imgName","substr","lastIndexOf","Image","ArrayType","initialize","_array_helper2","_subImage","_subImage2","_cv_utils","_cv_utils2","_array_helper","prototype","inImageWithBorder","imgRef","border","transform","inImg","outImg","M","inOrig","outOrig","w","h","iw","ih","across","down","defaultValue","p0","subtract","mat2","xVec2","min_x","min_y","max_x","max_y","sampleFunc","sample","carrigeReturn","scale","add","set","x_bound","y_bound","count","lx","ly","base","d","clearArray","array","l","subImage","from","subImageAsCopy","sizeY","sizeX","copyTo","srcData","dstData","get","getSafe","indexMapping","zeroBorder","invert","convolve","kernel","kx","ky","kSize","accu","moments","labelcount","val","ysq","label","mu11","mu02","mu20","x_","y_","tmp","labelsum","PI","PI_4","m00","m01","m10","m11","m02","m20","theta","rad","isNaN","atan","vec","cos","sin","current","pixel","getImageData","putImageData","hsv","rgb","whiteRgb","blackRgb","hsv2rgb","SubImage","I","originalSize","updateData","updateFrom","_cluster","_cluster2","CVUtils","imageRef","toVec2","toVec3","vec3","round","computeIntegralImage2","integralWrapper","integralImageData","sum","posA","posB","posC","posD","computeIntegralImage","v","u","thresholdImage","threshold","targetWrapper","targetData","computeHistogram","bitsPerPixel","bitShift","bucketCnt","hist","Int32Array","sharpenLine","right","left","center","determineOtsuThreshold","px","end","mx","determineThreshold","p1","p2","p12","k","m1","m2","m12","vet","max","maxIndex","otsuThreshold","computeBinaryImage","A","B","C","D","avg","cluster","points","property","addToCluster","point","found","clusters","fits","createPoint","Tracer","trace","idx","forward","match","pos","predicted","thresholdX","thresholdY","to","toIdx","predictedPos","abs","iteration","maxIterations","top","centerPos","currentPos","random","DILATE","ERODE","dilate","inImageWrapper","outImageWrapper","yStart1","yStart2","xStart1","xStart2","inImageData","outImageData","erode","aImageWrapper","bImageWrapper","resultImageWrapper","aImageData","bImageData","cImageData","bitwiseOr","countNonZero","topGeneric","list","scoreFunc","score","hit","minIdx","min","queue","item","Number","MAX_VALUE","grayArrayFromImage","htmlImage","offsetX","drawImage","ctxData","computeGray","grayArrayFromContext","grayAndHalfSampleFromCanvasData","canvasData","outArray","topRowIdx","bottomRowIdx","endIdx","outWidth","outImgIdx","inWidth","singleChannel","loadImageArray","inImgWrapper","outImgWrapper","s","r","g","_computeDivisors","n","largeDivisors","divisors","sqrt","unshift","concat","_computeIntersection","arr1","arr2","calculatePatchSize","patchSize","imgSize","findPatchSizeForDivisors","desiredPatchSize","nrOfPatchesList","nrOfPatchesIdx","optimalPatchSize","divisorsX","divisorsY","wideSide","common","nrOfPatchesMap","x-small","small","medium","large","x-large","nrOfPatches","_parseCSSDimensionValues","dimension","parseFloat","unit","_dimensionsConverters","context","bottom","computeImageArea","inputWidth","inputHeight","area","parsedArea","keys","reduce","key","parsed","calculated","sx","sy","sw","sh","_add","updateCenter","pointMap","similarity","dot","getPoints","getCenter","glMatrix","mat2d","mat3","mat4","quat","vec4","EPSILON","ARRAY_TYPE","Float32Array","RANDOM","setMatrixArrayType","GLMAT_ARRAY_TYPE","degree","toRadian","out","copy","identity","transpose","a1","a0","a2","a3","det","adjoint","determinant","multiply","b0","b1","b2","b3","mul","rotate","v0","v1","fromRotation","fromScaling","str","frob","pow","LDU","L","U","aa","ab","ac","ad","atx","aty","a4","a5","b4","b5","translate","fromTranslation","fromMat4","a01","a02","a12","a00","a10","a11","a20","a21","a22","b01","b11","b21","b00","b02","b10","b12","b20","b22","fromMat2d","fromQuat","q","z","x2","y2","z2","xx","yx","yy","zx","zy","zz","wx","wy","wz","normalFromMat4","a03","a13","a23","a30","a31","a32","a33","b03","b04","b05","b06","b07","b08","b09","axis","t","len","rotateX","rotateY","rotateZ","fromXRotation","fromYRotation","fromZRotation","fromRotationTranslation","xy","xz","yz","fromRotationTranslationScale","sz","fromRotationTranslationScaleOrigin","o","ox","oy","oz","frustum","near","far","rl","tb","nf","perspective","fovy","aspect","tan","perspectiveFromFieldOfView","fov","upTan","upDegrees","downTan","downDegrees","leftTan","leftDegrees","rightTan","rightDegrees","xScale","yScale","ortho","lr","bt","lookAt","eye","up","x0","x1","y0","y1","z0","z1","eyex","eyey","eyez","upx","upy","upz","centerx","centery","centerz","rotationTo","tmpvec3","xUnitVec3","fromValues","yUnitVec3","cross","normalize","setAxisAngle","setAxes","matr","view","fromMat3","ax","ay","az","aw","bx","by","bz","bw","calculateW","lerp","slerp","omega","cosom","sinom","scale0","scale1","acos","sqlerp","temp1","temp2","invDot","conjugate","squaredLength","sqrLen","fRoot","fTrace","sub","divide","div","scaleAndAdd","distance","dist","squaredDistance","sqrDist","negate","inverse","hermite","factorTimes2","factor1","factor2","factor3","factor4","bezier","inverseFactor","inverseFactorTimesTwo","zScale","transformMat4","transformMat3","transformQuat","qx","qy","qz","qw","ix","iy","iz","stride","fn","arg","angle","tempA","tempB","cosine","transformMat2","transformMat2d","arr","shuffle","toPointList","row","rows","join","_threshold","skeletonImageData","_currentImageWrapper","_patchSize","_numPatches","_binaryImageWrapper","_labelImageWrapper","ArrayBuffer","_subImageWrapper","_skelImageWrapper","_skeletonizer","_skeletonizer3","_imageToPatchGrid","_patchGrid","_patchLabelGrid","useWorker","binary","showCanvas","boxFromPatches","patches","overAvg","patch","transMat","minx","miny","maxx","maxy","showPatches","drawRect","color","showTransformed","drawPath","lineWidth","showTransformedBox","showBB","binarizeImage","findPatches","rasterizer","rasterResult","patchesFound","skeletonize","_rasterizer2","rasterize","showLabels","describePatch","showFoundPatches","findBiggestConnectedAreas","maxLabel","labelHist","topLabels","map","sort","el","findBoxes","showRemainingPatchLabels","similarMoments","topCluster","showSkeleton","patchPos","matchingMoments","eligibleMoments","minComponentWeight","ceil","index","rasterizeAngularSimilarity","notYetProcessed","currentIdx","currentPatch","dir","_tracer2","searchDirections","currIdx","showPatchLabels","_rasterizer","_tracer","_skeletonizer2","_glMatrix2","inputImageWrapper","JSON","stringify","Error","Rasterizer","createContour2D","firstVertex","insideContours","nextpeer","prevpeer","CONTOUR_DIR","CW_DIR","CCW_DIR","UNKNOWN_DIR","DIR","OUTSIDE_EDGE","INSIDE_EDGE","labelWrapper","labelData","tracer","depthlabel","bc","lc","labelindex","cx","cy","vertex","cc","sc","colorMap","connectedCount","contourTracing","debug","drawContour","firstContour","iq","pq","strokeStyle","fillStyle","beginPath","moveTo","next","lineTo","stroke","_trace","edgelabel","vertex2D","prev","_contourTracing","Cv","P","ldir","Fv","Skeletonizer","stdlib","foreign","inImagePtr","outImagePtr","images","aImagePtr","bImagePtr","imagePtr","memcpy","srcImagePtr","dstImagePtr","subImagePtr","erodedImagePtr","tempImagePtr","skelImagePtr","done","strokeRect","path","def","closePath","imageDataPos","canvasDataPos","_bresenham","_bresenham2","_code_128_reader","_code_128_reader2","_ean_reader","_ean_reader2","_code_39_reader","_code_39_reader2","_code_39_vin_reader","_code_39_vin_reader2","_codabar_reader","_codabar_reader2","_upc_reader","_upc_reader2","_ean_8_reader","_ean_8_reader2","_upc_e_reader","_upc_e_reader2","_i2of5_reader","_i2of5_reader2","code_128_reader","ean_reader","ean_8_reader","code_39_reader","code_39_vin_reader","codabar_reader","upc_reader","upc_e_reader","i2of5_reader","$debug","_canvas","frequency","pattern","initReaders","readerConfig","reader","format","_barcodeReaders","FORMAT","showFrequency","showPattern","getExtendedLine","ext","extendLine","amount","extension","getLine","tryDecode","barcodeLine","getBarcodeLine","printFrequency","toBinaryLine","printPattern","decodePattern","tryDecodeBruteForce","lineAngle","sideLength","slices","xdir","ydir","getLineLength","_decodeFromBoundingBox","lineLength","drawBoundingBox","atan2","drawScanline","decodeFromBoundingBox","Bresenham","Slope","UP","DOWN","read","deltax","deltay","error","ystep","steep","toOtsuBinaryLine","slope","slope2","currentDir","extrema","rThreshold","fillColor","fillRect","Code128Reader","_barcode_reader2","_barcode_reader","properties","CODE_SHIFT","CODE_C","CODE_B","CODE_A","START_CODE_A","START_CODE_B","START_CODE_C","STOP_CODE","MODULO","CODE_PATTERN","SINGLE_CODE_ERROR","AVG_CODE_ERROR","writeable","constructor","_decodeCode","code","normalized","counter","isWhite","_row","counterPos","bestMatch","_normalize","_matchPattern","_findStart","_nextSet","_decode","codeset","lastCharacterWasPrintable","startInfo","multiplier","checksum","rawResult","decodedCodes","shiftNext","String","fromCharCode","_nextUnset","_verifyTrailingWhitespace","endInfo","trailingWhitespaceEnd","_matchRange","BarcodeReader","singleError","modulo","maxSingleError","ratio","numOnes","norm","_matchTrace","cmpCounter","epsilon","reverse","direction","DIRECTION","REVERSE","FORWARD","_fillCounters","counters","Exception","StartNotFoundException","CodeNotFoundException","PatternNotFoundException","CONFIG_KEYS","EANReader","opts","CODE_L_START","CODE_G_START","START_PATTERN","STOP_PATTERN","MIDDLE_PATTERN","CODE_FREQUENCY","coderange","_findPattern","tryHarder","leadingWhitespaceStart","_findEnd","_calculateFirstDigit","codeFrequency","_decodePayload","firstDigit","_checksum","Code39Reader","ALPHABETH_STRING","ALPHABET","CHARACTER_ENCODINGS","ASTERISK","_toCounters","numCounters","decodedChar","lastStart","nextStart","_toPattern","_patternToChar","pop","patternSize","_findNextWidth","minWidth","maxNarrowWidth","numWideBars","wideBarWidth","whiteSpaceMustStart","patternStart","Code39VINReader","patterns","IOQ","AZ09","replace","_checkChecksum","CodabarReader","_counters","START_END","MIN_ENCODED_CHARS","MAX_ACCEPTABLE","PADDING","startCounter","_isStartEnd","_verifyWhitespace","_validateResult","_sumCounters","endCounter","_calculatePatternLength","_thresholdResultPattern","kind","cat","categorization","space","narrow","counts","wide","bar","_charToPattern","char","charCode","charCodeAt","thresholds","_computeAlternatingThreshold","barThreshold","spaceThreshold","bitmask","UPCReader","charAt","substring","EAN8Reader","UPCEReader","_determineParity","nrSystem","_convertToUPCA","upca","lastDigit","I2of5Reader","getDefaulConfig","barSpaceRatio","normalizeBarSpaceWidth","N","W","writable","MAX_CORRECTION_FACTOR","counterSum","codeSum","correction","correctionRatio","correctionRatioInverse","narrowBarWidth","_decodePair","counterPair","codes","counterLength","_verifyCounterLength","description","baseMerge","createAssigner","object","source","customizer","stackA","stackB","isObject","isSrcArr","isArrayLike","isArray","isTypedArray","props","arrayEach","srcValue","isObjectLike","baseMergeDeep","isCommon","iteratee","mergeFunc","arrayCopy","isPlainObject","isArguments","toPlainObject","hasOwnProperty","propertyIsEnumerable","objectProto","isLength","getLength","baseProperty","MAX_SAFE_INTEGER","getNative","arrayTag","objToString","nativeIsArray","isNative","isFunction","reIsNative","test","fnToString","reIsHostCtor","Function","RegExp","funcTag","Ctor","objectTag","baseForIn","subValue","baseFor","keysIn","createBaseFor","fromRight","keysFunc","iterable","toObject","isProto","skipIndexes","isIndex","reIsUint","typedArrayTags","argsTag","boolTag","dateTag","errorTag","mapTag","numberTag","regexpTag","setTag","stringTag","weakMapTag","arrayBufferTag","float32Tag","float64Tag","int8Tag","int16Tag","int32Tag","uint8Tag","uint8ClampedTag","uint16Tag","uint32Tag","baseCopy","shimKeys","nativeKeys","propsLength","allowIndexes","assigner","restParam","sources","guard","thisArg","bindCallback","isIterateeCall","func","argCount","collection","accumulator","other","arguments","TypeError","FUNC_ERROR_TEXT","nativeMax","rest","otherArgs","FrameGrabber","_that","_streamConfig","_video_size","_size","_sx","_sy","_ctx","_data","videoSize","canvasSize","getData","doHalfSample","getSize","minAspectRatio","maxAspectRatio","facing","tracking","getEvent","events","subscribers","clearEvents","publishSubscription","subscription","async","_subscribe","subscriber","success","failure","streamRef","videoSrc","loadedData","checkVideo","attempts","initCamera","loadedDataHandler","normalizeConstraints","audio","videoConstraints","MediaStreamTrack","getSources","mediaSource","require","sourceInfos","videoSourceId","sourceInfo","mandatory","minHeight","optional","sourceId","_request","tracks","getVideoTracks","contains","some","every","passesFilter","matchesConstraints","capacity","blacklist","results","capture","imageSize","toDataURL","getResults"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IAAAG,YACA,gBAAAF,SACAA,QAAA,OAAAD,IAAAG,YAEAJ,EAAA,OAAAC,IAAAG,aACCC,KAAA,SAAAC,GACD,MCAgB,UAAUC,GCJ1B,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9B,MAAsB,kBAAXA,GACAA,EAAOX,IAEX,E3EopZVqD,OAAOC,eAAe1K,EAAS,cAC3B2K,OAAO,GAKX,IAAIW,GAAehL,E2E3qZG,I3E6qZlBiL,EAAgBxK,EAAuBuK,EAoB3CtL,GAAQ,Y2E5qZLwB,OAAQ,SAASkI,GAOb,QAASuvC,GAAmB7xC,GACxB,MAAO8xC,IAAY9xC,IAAeyxC,EAASzxC,EAAYsC,EAAOyvC,YAAcH,EAAa5xC,EAAYsC,EAAO3B,QAPhH,GAAIyE,GAAS3K,SAASoB,cAAc,UAChCiC,EAAMsH,EAAOrH,WAAW,MACxBi0C,KACAF,EAAWxvC,EAAOwvC,UAAY,GAC9BG,EAAU3vC,EAAO2vC,WAAY,CAMjC,QACI/xC,UAAW,SAASK,EAAM2xC,EAAWlyC,GACjC,GAAId,KAEA2yC,GAAmB7xC,KACnB8xC,IACA5yC,EAAOc,WAAaA,EAChBiyC,IACA7sC,EAAOpH,MAAQk0C,EAAUh0C,EACzBkH,EAAOjH,OAAS+zC,EAAU9zC,EAC1B+F,EAAA,WAAWuV,UAAUnZ,EAAM2xC,EAAWp0C,GACtCoB,EAAOoC,MAAQ8D,EAAO+sC,aAE1BH,EAAQtwC,KAAKxC,KAGrBkzC,WAAY,WACR,MAAOJ,O3EkrZtBn5C,EAAOD,QAAUA,EAAQ","file":"quagga.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(factory.toString());\n\telse if(typeof exports === 'object')\n\t\texports[\"Quagga\"] = factory(factory.toString());\n\telse\n\t\troot[\"Quagga\"] = factory(factory.toString());\n})(this, function(__factorySource__) {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/myModuleDefinition\n **/","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(factory.toString());\n\telse if(typeof exports === 'object')\n\t\texports[\"Quagga\"] = factory(factory.toString());\n\telse\n\t\troot[\"Quagga\"] = factory(factory.toString());\n})(this, function(__factorySource__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"/\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __webpack_require__(1);\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar _typedefs = __webpack_require__(2);\n\t\n\tvar _typedefs2 = _interopRequireDefault(_typedefs);\n\t\n\tvar _input_stream = __webpack_require__(3);\n\t\n\tvar _input_stream2 = _interopRequireDefault(_input_stream);\n\t\n\tvar _image_wrapper = __webpack_require__(5);\n\t\n\tvar _image_wrapper2 = _interopRequireDefault(_image_wrapper);\n\t\n\tvar _barcode_locator = __webpack_require__(20);\n\t\n\tvar _barcode_locator2 = _interopRequireDefault(_barcode_locator);\n\t\n\tvar _barcode_decoder = __webpack_require__(25);\n\t\n\tvar _barcode_decoder2 = _interopRequireDefault(_barcode_decoder);\n\t\n\tvar _frame_grabber = __webpack_require__(70);\n\t\n\tvar _frame_grabber2 = _interopRequireDefault(_frame_grabber);\n\t\n\tvar _config2 = __webpack_require__(71);\n\t\n\tvar _config3 = _interopRequireDefault(_config2);\n\t\n\tvar _events = __webpack_require__(72);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _camera_access = __webpack_require__(73);\n\t\n\tvar _camera_access2 = _interopRequireDefault(_camera_access);\n\t\n\tvar _image_debug = __webpack_require__(24);\n\t\n\tvar _image_debug2 = _interopRequireDefault(_image_debug);\n\t\n\tvar _glMatrix = __webpack_require__(9);\n\t\n\tvar _result_collector = __webpack_require__(74);\n\t\n\tvar _result_collector2 = _interopRequireDefault(_result_collector);\n\t\n\tvar merge = __webpack_require__(37);\n\t\n\tvar _inputStream,\n\t _framegrabber,\n\t _stopped,\n\t _canvasContainer = {\n\t ctx: {\n\t image: null,\n\t overlay: null\n\t },\n\t dom: {\n\t image: null,\n\t overlay: null\n\t }\n\t},\n\t _inputImageWrapper,\n\t _boxSize,\n\t _decoder,\n\t _workerPool = [],\n\t _onUIThread = true,\n\t _resultCollector,\n\t _config = {};\n\t\n\tfunction initializeData(imageWrapper) {\n\t initBuffers(imageWrapper);\n\t _decoder = _barcode_decoder2['default'].create(_config.decoder, _inputImageWrapper);\n\t}\n\t\n\tfunction initConfig() {\n\t if (typeof document !== \"undefined\") {\n\t var vis = [{\n\t node: document.querySelector(\"div[data-controls]\"),\n\t prop: _config.controls\n\t }, {\n\t node: _canvasContainer.dom.overlay,\n\t prop: _config.visual.show\n\t }];\n\t\n\t for (var i = 0; i < vis.length; i++) {\n\t if (vis[i].node) {\n\t if (vis[i].prop === true) {\n\t vis[i].node.style.display = \"block\";\n\t } else {\n\t vis[i].node.style.display = \"none\";\n\t }\n\t }\n\t }\n\t }\n\t}\n\t\n\tfunction initInputStream(cb) {\n\t var video;\n\t if (_config.inputStream.type == \"VideoStream\") {\n\t video = document.createElement(\"video\");\n\t _inputStream = _input_stream2['default'].createVideoStream(video);\n\t } else if (_config.inputStream.type == \"ImageStream\") {\n\t _inputStream = _input_stream2['default'].createImageStream();\n\t } else if (_config.inputStream.type == \"LiveStream\") {\n\t var $viewport = document.querySelector(\"#interactive.viewport\");\n\t if ($viewport) {\n\t video = $viewport.querySelector(\"video\");\n\t if (!video) {\n\t video = document.createElement(\"video\");\n\t $viewport.appendChild(video);\n\t }\n\t }\n\t _inputStream = _input_stream2['default'].createLiveStream(video);\n\t _camera_access2['default'].request(video, _config.inputStream.constraints, function (err) {\n\t if (!err) {\n\t _inputStream.trigger(\"canrecord\");\n\t } else {\n\t return cb(err);\n\t }\n\t });\n\t }\n\t\n\t _inputStream.setAttribute(\"preload\", \"auto\");\n\t _inputStream.setAttribute(\"autoplay\", true);\n\t _inputStream.setInputStream(_config.inputStream);\n\t _inputStream.addEventListener(\"canrecord\", canRecord.bind(undefined, cb));\n\t}\n\t\n\tfunction canRecord(cb) {\n\t _barcode_locator2['default'].checkImageConstraints(_inputStream, _config.locator);\n\t initCanvas();\n\t _framegrabber = _frame_grabber2['default'].create(_inputStream, _canvasContainer.dom.image);\n\t initConfig();\n\t\n\t if (_config.numOfWorkers > 0) {\n\t initWorkers(function () {\n\t console.log(\"Workers created\");\n\t ready(cb);\n\t });\n\t } else {\n\t initializeData();\n\t ready(cb);\n\t }\n\t}\n\t\n\tfunction ready(cb) {\n\t _inputStream.play();\n\t cb();\n\t}\n\t\n\tfunction initCanvas() {\n\t if (typeof document !== \"undefined\") {\n\t var $viewport = document.querySelector(\"#interactive.viewport\");\n\t _canvasContainer.dom.image = document.querySelector(\"canvas.imgBuffer\");\n\t if (!_canvasContainer.dom.image) {\n\t _canvasContainer.dom.image = document.createElement(\"canvas\");\n\t _canvasContainer.dom.image.className = \"imgBuffer\";\n\t if ($viewport && _config.inputStream.type == \"ImageStream\") {\n\t $viewport.appendChild(_canvasContainer.dom.image);\n\t }\n\t }\n\t _canvasContainer.ctx.image = _canvasContainer.dom.image.getContext(\"2d\");\n\t _canvasContainer.dom.image.width = _inputStream.getCanvasSize().x;\n\t _canvasContainer.dom.image.height = _inputStream.getCanvasSize().y;\n\t\n\t _canvasContainer.dom.overlay = document.querySelector(\"canvas.drawingBuffer\");\n\t if (!_canvasContainer.dom.overlay) {\n\t _canvasContainer.dom.overlay = document.createElement(\"canvas\");\n\t _canvasContainer.dom.overlay.className = \"drawingBuffer\";\n\t if ($viewport) {\n\t $viewport.appendChild(_canvasContainer.dom.overlay);\n\t }\n\t var clearFix = document.createElement(\"br\");\n\t clearFix.setAttribute(\"clear\", \"all\");\n\t if ($viewport) {\n\t $viewport.appendChild(clearFix);\n\t }\n\t }\n\t _canvasContainer.ctx.overlay = _canvasContainer.dom.overlay.getContext(\"2d\");\n\t _canvasContainer.dom.overlay.width = _inputStream.getCanvasSize().x;\n\t _canvasContainer.dom.overlay.height = _inputStream.getCanvasSize().y;\n\t }\n\t}\n\t\n\tfunction initBuffers(imageWrapper) {\n\t if (imageWrapper) {\n\t _inputImageWrapper = imageWrapper;\n\t } else {\n\t _inputImageWrapper = new _image_wrapper2['default']({\n\t x: _inputStream.getWidth(),\n\t y: _inputStream.getHeight()\n\t });\n\t }\n\t\n\t console.log(_inputImageWrapper.size);\n\t _boxSize = [_glMatrix.vec2.clone([0, 0]), _glMatrix.vec2.clone([0, _inputImageWrapper.size.y]), _glMatrix.vec2.clone([_inputImageWrapper.size.x, _inputImageWrapper.size.y]), _glMatrix.vec2.clone([_inputImageWrapper.size.x, 0])];\n\t _barcode_locator2['default'].init(_inputImageWrapper, _config.locator);\n\t}\n\t\n\tfunction getBoundingBoxes() {\n\t if (_config.locate) {\n\t return _barcode_locator2['default'].locate();\n\t } else {\n\t return [[_glMatrix.vec2.clone(_boxSize[0]), _glMatrix.vec2.clone(_boxSize[1]), _glMatrix.vec2.clone(_boxSize[2]), _glMatrix.vec2.clone(_boxSize[3])]];\n\t }\n\t}\n\t\n\tfunction transformResult(result) {\n\t var topRight = _inputStream.getTopRight(),\n\t xOffset = topRight.x,\n\t yOffset = topRight.y,\n\t i;\n\t\n\t if (!result || xOffset === 0 && yOffset === 0) {\n\t return;\n\t }\n\t\n\t if (result.line && result.line.length === 2) {\n\t moveLine(result.line);\n\t }\n\t if (result.boxes && result.boxes.length > 0) {\n\t for (i = 0; i < result.boxes.length; i++) {\n\t moveBox(result.boxes[i]);\n\t }\n\t }\n\t\n\t function moveBox(box) {\n\t var corner = box.length;\n\t\n\t while (corner--) {\n\t box[corner][0] += xOffset;\n\t box[corner][1] += yOffset;\n\t }\n\t }\n\t\n\t function moveLine(line) {\n\t line[0].x += xOffset;\n\t line[0].y += yOffset;\n\t line[1].x += xOffset;\n\t line[1].y += yOffset;\n\t }\n\t}\n\t\n\tfunction publishResult(result, imageData) {\n\t if (_onUIThread) {\n\t transformResult(result);\n\t if (imageData && result && result.codeResult) {\n\t if (_resultCollector) {\n\t _resultCollector.addResult(imageData, _inputStream.getCanvasSize(), result.codeResult);\n\t }\n\t }\n\t }\n\t\n\t _events2['default'].publish(\"processed\", result);\n\t if (result && result.codeResult) {\n\t _events2['default'].publish(\"detected\", result);\n\t }\n\t}\n\t\n\tfunction locateAndDecode() {\n\t var result, boxes;\n\t\n\t boxes = getBoundingBoxes();\n\t if (boxes) {\n\t result = _decoder.decodeFromBoundingBoxes(boxes);\n\t result = result || {};\n\t result.boxes = boxes;\n\t publishResult(result, _inputImageWrapper.data);\n\t } else {\n\t publishResult();\n\t }\n\t}\n\t\n\tfunction update() {\n\t var availableWorker;\n\t\n\t if (_onUIThread) {\n\t if (_workerPool.length > 0) {\n\t availableWorker = _workerPool.filter(function (workerThread) {\n\t return !workerThread.busy;\n\t })[0];\n\t if (availableWorker) {\n\t _framegrabber.attachData(availableWorker.imageData);\n\t } else {\n\t return; // all workers are busy\n\t }\n\t } else {\n\t _framegrabber.attachData(_inputImageWrapper.data);\n\t }\n\t if (_framegrabber.grab()) {\n\t if (availableWorker) {\n\t availableWorker.busy = true;\n\t availableWorker.worker.postMessage({\n\t cmd: 'process',\n\t imageData: availableWorker.imageData\n\t }, [availableWorker.imageData.buffer]);\n\t } else {\n\t locateAndDecode();\n\t }\n\t }\n\t } else {\n\t locateAndDecode();\n\t }\n\t}\n\t\n\tfunction _start() {\n\t _stopped = false;\n\t (function frame() {\n\t if (!_stopped) {\n\t update();\n\t if (_onUIThread && _config.inputStream.type == \"LiveStream\") {\n\t window.requestAnimFrame(frame);\n\t }\n\t }\n\t })();\n\t}\n\t\n\tfunction initWorkers(cb) {\n\t var i;\n\t _workerPool = [];\n\t\n\t for (i = 0; i < _config.numOfWorkers; i++) {\n\t initWorker(workerInitialized);\n\t }\n\t\n\t function workerInitialized(workerThread) {\n\t _workerPool.push(workerThread);\n\t if (_workerPool.length >= _config.numOfWorkers) {\n\t cb();\n\t }\n\t }\n\t}\n\t\n\tfunction initWorker(cb) {\n\t var blobURL,\n\t workerThread = {\n\t worker: undefined,\n\t imageData: new Uint8Array(_inputStream.getWidth() * _inputStream.getHeight()),\n\t busy: true\n\t };\n\t\n\t blobURL = generateWorkerBlob();\n\t workerThread.worker = new Worker(blobURL);\n\t\n\t workerThread.worker.onmessage = function (e) {\n\t if (e.data.event === 'initialized') {\n\t URL.revokeObjectURL(blobURL);\n\t workerThread.busy = false;\n\t workerThread.imageData = new Uint8Array(e.data.imageData);\n\t console.log(\"Worker initialized\");\n\t return cb(workerThread);\n\t } else if (e.data.event === 'processed') {\n\t workerThread.imageData = new Uint8Array(e.data.imageData);\n\t workerThread.busy = false;\n\t publishResult(e.data.result, workerThread.imageData);\n\t } else if (e.data.event === 'error') {\n\t console.log(\"Worker error: \" + e.data.message);\n\t }\n\t };\n\t\n\t workerThread.worker.postMessage({\n\t cmd: 'init',\n\t size: { x: _inputStream.getWidth(), y: _inputStream.getHeight() },\n\t imageData: workerThread.imageData,\n\t config: _config\n\t }, [workerThread.imageData.buffer]);\n\t}\n\t\n\tfunction workerInterface(factory) {\n\t window = self;\n\t if (factory) {\n\t /* jshint ignore:start */\n\t var Quagga = factory();\n\t if (!Quagga) {\n\t self.postMessage({ 'event': 'error', message: 'Quagga could not be created' });\n\t return;\n\t }\n\t /* jshint ignore:end */\n\t }\n\t /* jshint ignore:start */\n\t var imageWrapper;\n\t\n\t self.onmessage = function (e) {\n\t if (e.data.cmd === 'init') {\n\t var config = e.data.config;\n\t config.numOfWorkers = 0;\n\t imageWrapper = new Quagga.ImageWrapper({\n\t x: e.data.size.x,\n\t y: e.data.size.y\n\t }, new Uint8Array(e.data.imageData));\n\t Quagga.init(config, ready, imageWrapper);\n\t Quagga.onProcessed(onProcessed);\n\t } else if (e.data.cmd === 'process') {\n\t imageWrapper.data = new Uint8Array(e.data.imageData);\n\t Quagga.start();\n\t } else if (e.data.cmd === 'setReaders') {\n\t Quagga.setReaders(e.data.readers);\n\t }\n\t };\n\t\n\t function onProcessed(result) {\n\t self.postMessage({ 'event': 'processed', imageData: imageWrapper.data, result: result }, [imageWrapper.data.buffer]);\n\t }\n\t\n\t function ready() {\n\t self.postMessage({ 'event': 'initialized', imageData: imageWrapper.data }, [imageWrapper.data.buffer]);\n\t }\n\t /* jshint ignore:end */\n\t}\n\t\n\tfunction generateWorkerBlob() {\n\t var blob, factorySource;\n\t\n\t /* jshint ignore:start */\n\t if (typeof __factorySource__ !== 'undefined') {\n\t factorySource = __factorySource__;\n\t }\n\t /* jshint ignore:end */\n\t\n\t blob = new Blob(['(' + workerInterface.toString() + ')(' + factorySource + ');'], { type: 'text/javascript' });\n\t\n\t return window.URL.createObjectURL(blob);\n\t}\n\t\n\tfunction _setReaders(readers) {\n\t if (_decoder) {\n\t _decoder.setReaders(readers);\n\t } else if (_onUIThread && _workerPool.length > 0) {\n\t _workerPool.forEach(function (workerThread) {\n\t workerThread.worker.postMessage({ cmd: 'setReaders', readers: readers });\n\t });\n\t }\n\t}\n\t\n\texports['default'] = {\n\t init: function init(config, cb, imageWrapper) {\n\t _config = merge({}, _config3['default'], config);\n\t if (imageWrapper) {\n\t _onUIThread = false;\n\t initializeData(imageWrapper);\n\t return cb();\n\t } else {\n\t initInputStream(cb);\n\t }\n\t },\n\t start: function start() {\n\t _start();\n\t },\n\t stop: function stop() {\n\t _stopped = true;\n\t _workerPool.forEach(function (workerThread) {\n\t workerThread.worker.terminate();\n\t console.log(\"Worker terminated!\");\n\t });\n\t _workerPool.length = 0;\n\t if (_config.inputStream.type === \"LiveStream\") {\n\t _camera_access2['default'].release();\n\t _inputStream.clearEventHandlers();\n\t }\n\t },\n\t pause: function pause() {\n\t _stopped = true;\n\t },\n\t onDetected: function onDetected(callback) {\n\t _events2['default'].subscribe(\"detected\", callback);\n\t },\n\t offDetected: function offDetected(callback) {\n\t _events2['default'].unsubscribe(\"detected\", callback);\n\t },\n\t onProcessed: function onProcessed(callback) {\n\t _events2['default'].subscribe(\"processed\", callback);\n\t },\n\t offProcessed: function offProcessed(callback) {\n\t _events2['default'].unsubscribe(\"processed\", callback);\n\t },\n\t setReaders: function setReaders(readers) {\n\t _setReaders(readers);\n\t },\n\t registerResultCollector: function registerResultCollector(resultCollector) {\n\t if (resultCollector && typeof resultCollector.addResult === 'function') {\n\t _resultCollector = resultCollector;\n\t }\n\t },\n\t canvas: _canvasContainer,\n\t decodeSingle: function decodeSingle(config, resultCallback) {\n\t config = merge({\n\t inputStream: {\n\t type: \"ImageStream\",\n\t sequence: false,\n\t size: 800,\n\t src: config.src\n\t },\n\t numOfWorkers: 1,\n\t locator: {\n\t halfSample: false\n\t }\n\t }, config);\n\t this.init(config, function () {\n\t _events2['default'].once(\"processed\", function (result) {\n\t _stopped = true;\n\t resultCallback.call(null, result);\n\t }, true);\n\t _start();\n\t });\n\t },\n\t ImageWrapper: _image_wrapper2['default'],\n\t ImageDebug: _image_debug2['default'],\n\t ResultCollector: _result_collector2['default']\n\t};\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 2 */\n/***/ function(module, exports) {\n\n\t/*\n\t * typedefs.js\n\t * Normalizes browser-specific prefixes\n\t */\n\t\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\tif (typeof window !== 'undefined') {\n\t window.requestAnimFrame = (function () {\n\t return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function ( /* function FrameRequestCallback */callback, /* DOMElement Element */element) {\n\t window.setTimeout(callback, 1000 / 60);\n\t };\n\t })();\n\t\n\t navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia;\n\t window.URL = window.URL || window.webkitURL || window.mozURL || window.msURL;\n\t}\n\tMath.imul = Math.imul || function (a, b) {\n\t var ah = a >>> 16 & 0xffff,\n\t al = a & 0xffff,\n\t bh = b >>> 16 & 0xffff,\n\t bl = b & 0xffff;\n\t // the shift by 0 fixes the sign on the high part\n\t // the final |0 converts the unsigned value into a signed value\n\t return al * bl + (ah * bl + al * bh << 16 >>> 0) | 0;\n\t};\n\t\n\texports['default'] = {};\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 3 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar _image_loader = __webpack_require__(4);\n\t\n\tvar _image_loader2 = _interopRequireDefault(_image_loader);\n\t\n\tvar InputStream = {};\n\tInputStream.createVideoStream = function (video) {\n\t var that = {},\n\t _config = null,\n\t _eventNames = ['canrecord', 'ended'],\n\t _eventHandlers = {},\n\t _calculatedWidth,\n\t _calculatedHeight,\n\t _topRight = { x: 0, y: 0 },\n\t _canvasSize = { x: 0, y: 0 };\n\t\n\t function initSize() {\n\t var width = video.videoWidth,\n\t height = video.videoHeight;\n\t\n\t _calculatedWidth = _config.size ? width / height > 1 ? _config.size : Math.floor(width / height * _config.size) : width;\n\t _calculatedHeight = _config.size ? width / height > 1 ? Math.floor(height / width * _config.size) : _config.size : height;\n\t\n\t _canvasSize.x = _calculatedWidth;\n\t _canvasSize.y = _calculatedHeight;\n\t }\n\t\n\t that.getRealWidth = function () {\n\t return video.videoWidth;\n\t };\n\t\n\t that.getRealHeight = function () {\n\t return video.videoHeight;\n\t };\n\t\n\t that.getWidth = function () {\n\t return _calculatedWidth;\n\t };\n\t\n\t that.getHeight = function () {\n\t return _calculatedHeight;\n\t };\n\t\n\t that.setWidth = function (width) {\n\t _calculatedWidth = width;\n\t };\n\t\n\t that.setHeight = function (height) {\n\t _calculatedHeight = height;\n\t };\n\t\n\t that.setInputStream = function (config) {\n\t _config = config;\n\t video.src = typeof config.src !== 'undefined' ? config.src : '';\n\t };\n\t\n\t that.ended = function () {\n\t return video.ended;\n\t };\n\t\n\t that.getConfig = function () {\n\t return _config;\n\t };\n\t\n\t that.setAttribute = function (name, value) {\n\t video.setAttribute(name, value);\n\t };\n\t\n\t that.pause = function () {\n\t video.pause();\n\t };\n\t\n\t that.play = function () {\n\t video.play();\n\t };\n\t\n\t that.setCurrentTime = function (time) {\n\t if (_config.type !== \"LiveStream\") video.currentTime = time;\n\t };\n\t\n\t that.addEventListener = function (event, f, bool) {\n\t if (_eventNames.indexOf(event) !== -1) {\n\t if (!_eventHandlers[event]) {\n\t _eventHandlers[event] = [];\n\t }\n\t _eventHandlers[event].push(f);\n\t } else {\n\t video.addEventListener(event, f, bool);\n\t }\n\t };\n\t\n\t that.clearEventHandlers = function () {\n\t _eventNames.forEach(function (eventName) {\n\t var handlers = _eventHandlers[eventName];\n\t if (handlers && handlers.length > 0) {\n\t handlers.forEach(function (handler) {\n\t video.removeEventListener(eventName, handler);\n\t });\n\t }\n\t });\n\t };\n\t\n\t that.trigger = function (eventName, args) {\n\t var j,\n\t handlers = _eventHandlers[eventName];\n\t\n\t if (eventName === 'canrecord') {\n\t initSize();\n\t }\n\t if (handlers && handlers.length > 0) {\n\t for (j = 0; j < handlers.length; j++) {\n\t handlers[j].apply(that, args);\n\t }\n\t }\n\t };\n\t\n\t that.setTopRight = function (topRight) {\n\t _topRight.x = topRight.x;\n\t _topRight.y = topRight.y;\n\t };\n\t\n\t that.getTopRight = function () {\n\t return _topRight;\n\t };\n\t\n\t that.setCanvasSize = function (size) {\n\t _canvasSize.x = size.x;\n\t _canvasSize.y = size.y;\n\t };\n\t\n\t that.getCanvasSize = function () {\n\t return _canvasSize;\n\t };\n\t\n\t that.getFrame = function () {\n\t return video;\n\t };\n\t\n\t return that;\n\t};\n\t\n\tInputStream.createLiveStream = function (video) {\n\t video.setAttribute(\"autoplay\", true);\n\t var that = InputStream.createVideoStream(video);\n\t\n\t that.ended = function () {\n\t return false;\n\t };\n\t\n\t return that;\n\t};\n\t\n\tInputStream.createImageStream = function () {\n\t var that = {};\n\t var _config = null;\n\t\n\t var width = 0,\n\t height = 0,\n\t frameIdx = 0,\n\t paused = true,\n\t loaded = false,\n\t imgArray = null,\n\t size = 0,\n\t offset = 1,\n\t baseUrl = null,\n\t ended = false,\n\t calculatedWidth,\n\t calculatedHeight,\n\t _eventNames = ['canrecord', 'ended'],\n\t _eventHandlers = {},\n\t _topRight = { x: 0, y: 0 },\n\t _canvasSize = { x: 0, y: 0 };\n\t\n\t function loadImages() {\n\t loaded = false;\n\t _image_loader2['default'].load(baseUrl, function (imgs) {\n\t imgArray = imgs;\n\t width = imgs[0].width;\n\t height = imgs[0].height;\n\t calculatedWidth = _config.size ? width / height > 1 ? _config.size : Math.floor(width / height * _config.size) : width;\n\t calculatedHeight = _config.size ? width / height > 1 ? Math.floor(height / width * _config.size) : _config.size : height;\n\t _canvasSize.x = calculatedWidth;\n\t _canvasSize.y = calculatedHeight;\n\t loaded = true;\n\t frameIdx = 0;\n\t setTimeout(function () {\n\t publishEvent(\"canrecord\", []);\n\t }, 0);\n\t }, offset, size, _config.sequence);\n\t }\n\t\n\t function publishEvent(eventName, args) {\n\t var j,\n\t handlers = _eventHandlers[eventName];\n\t\n\t if (handlers && handlers.length > 0) {\n\t for (j = 0; j < handlers.length; j++) {\n\t handlers[j].apply(that, args);\n\t }\n\t }\n\t }\n\t\n\t that.trigger = publishEvent;\n\t\n\t that.getWidth = function () {\n\t return calculatedWidth;\n\t };\n\t\n\t that.getHeight = function () {\n\t return calculatedHeight;\n\t };\n\t\n\t that.setWidth = function (width) {\n\t calculatedWidth = width;\n\t };\n\t\n\t that.setHeight = function (height) {\n\t calculatedHeight = height;\n\t };\n\t\n\t that.getRealWidth = function () {\n\t return width;\n\t };\n\t\n\t that.getRealHeight = function () {\n\t return height;\n\t };\n\t\n\t that.setInputStream = function (stream) {\n\t _config = stream;\n\t if (stream.sequence === false) {\n\t baseUrl = stream.src;\n\t size = 1;\n\t } else {\n\t baseUrl = stream.src;\n\t size = stream.length;\n\t }\n\t loadImages();\n\t };\n\t\n\t that.ended = function () {\n\t return ended;\n\t };\n\t\n\t that.setAttribute = function () {};\n\t\n\t that.getConfig = function () {\n\t return _config;\n\t };\n\t\n\t that.pause = function () {\n\t paused = true;\n\t };\n\t\n\t that.play = function () {\n\t paused = false;\n\t };\n\t\n\t that.setCurrentTime = function (time) {\n\t frameIdx = time;\n\t };\n\t\n\t that.addEventListener = function (event, f) {\n\t if (_eventNames.indexOf(event) !== -1) {\n\t if (!_eventHandlers[event]) {\n\t _eventHandlers[event] = [];\n\t }\n\t _eventHandlers[event].push(f);\n\t }\n\t };\n\t\n\t that.setTopRight = function (topRight) {\n\t _topRight.x = topRight.x;\n\t _topRight.y = topRight.y;\n\t };\n\t\n\t that.getTopRight = function () {\n\t return _topRight;\n\t };\n\t\n\t that.setCanvasSize = function (size) {\n\t _canvasSize.x = size.x;\n\t _canvasSize.y = size.y;\n\t };\n\t\n\t that.getCanvasSize = function () {\n\t return _canvasSize;\n\t };\n\t\n\t that.getFrame = function () {\n\t var frame;\n\t\n\t if (!loaded) {\n\t return null;\n\t }\n\t if (!paused) {\n\t frame = imgArray[frameIdx];\n\t if (frameIdx < size - 1) {\n\t frameIdx++;\n\t } else {\n\t setTimeout(function () {\n\t ended = true;\n\t publishEvent(\"ended\", []);\n\t }, 0);\n\t }\n\t }\n\t return frame;\n\t };\n\t\n\t return that;\n\t};\n\t\n\texports['default'] = InputStream;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 4 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\tvar ImageLoader = {};\n\tImageLoader.load = function (directory, callback, offset, size, sequence) {\n\t var htmlImagesSrcArray = new Array(size),\n\t htmlImagesArray = new Array(htmlImagesSrcArray.length),\n\t i,\n\t img,\n\t num;\n\t\n\t if (sequence === false) {\n\t htmlImagesSrcArray[0] = directory;\n\t } else {\n\t for (i = 0; i < htmlImagesSrcArray.length; i++) {\n\t num = offset + i;\n\t htmlImagesSrcArray[i] = directory + \"image-\" + (\"00\" + num).slice(-3) + \".jpg\";\n\t }\n\t }\n\t htmlImagesArray.notLoaded = [];\n\t htmlImagesArray.addImage = function (img) {\n\t htmlImagesArray.notLoaded.push(img);\n\t };\n\t htmlImagesArray.loaded = function (loadedImg) {\n\t var notloadedImgs = htmlImagesArray.notLoaded;\n\t for (var x = 0; x < notloadedImgs.length; x++) {\n\t if (notloadedImgs[x] == loadedImg) {\n\t notloadedImgs.splice(x, 1);\n\t for (var y = 0; y < htmlImagesSrcArray.length; y++) {\n\t var imgName = htmlImagesSrcArray[y].substr(htmlImagesSrcArray[y].lastIndexOf(\"/\"));\n\t if (loadedImg.src.lastIndexOf(imgName) != -1) {\n\t htmlImagesArray[y] = loadedImg;\n\t break;\n\t }\n\t }\n\t break;\n\t }\n\t }\n\t if (notloadedImgs.length === 0) {\n\t console.log(\"Images loaded\");\n\t callback.apply(null, [htmlImagesArray]);\n\t }\n\t };\n\t\n\t for (i = 0; i < htmlImagesSrcArray.length; i++) {\n\t img = new Image();\n\t htmlImagesArray.addImage(img);\n\t addOnloadHandler(img, htmlImagesArray);\n\t img.src = htmlImagesSrcArray[i];\n\t }\n\t};\n\t\n\tfunction addOnloadHandler(img, htmlImagesArray) {\n\t img.onload = function () {\n\t htmlImagesArray.loaded(this);\n\t };\n\t}\n\t\n\texports[\"default\"] = ImageLoader;\n\tmodule.exports = exports[\"default\"];\n\n/***/ },\n/* 5 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar _subImage = __webpack_require__(6);\n\t\n\tvar _subImage2 = _interopRequireDefault(_subImage);\n\t\n\tvar _cv_utils = __webpack_require__(7);\n\t\n\tvar _cv_utils2 = _interopRequireDefault(_cv_utils);\n\t\n\tvar _array_helper = __webpack_require__(19);\n\t\n\tvar _array_helper2 = _interopRequireDefault(_array_helper);\n\t\n\tvar _glMatrix = __webpack_require__(9);\n\t\n\t/**\n\t * Represents a basic image combining the data and size.\n\t * In addition, some methods for manipulation are contained.\n\t * @param size {x,y} The size of the image in pixel\n\t * @param data {Array} If given, a flat array containing the pixel data\n\t * @param ArrayType {Type} If given, the desired DataType of the Array (may be typed/non-typed)\n\t * @param initialize {Boolean} Indicating if the array should be initialized on creation.\n\t * @returns {ImageWrapper}\n\t */\n\tfunction ImageWrapper(size, data, ArrayType, initialize) {\n\t if (!data) {\n\t if (ArrayType) {\n\t this.data = new ArrayType(size.x * size.y);\n\t if (ArrayType === Array && initialize) {\n\t _array_helper2['default'].init(this.data, 0);\n\t }\n\t } else {\n\t this.data = new Uint8Array(size.x * size.y);\n\t if (Uint8Array === Array && initialize) {\n\t _array_helper2['default'].init(this.data, 0);\n\t }\n\t }\n\t } else {\n\t this.data = data;\n\t }\n\t this.size = size;\n\t}\n\t\n\t/**\n\t * tests if a position is within the image with a given offset\n\t * @param imgRef {x, y} The location to test\n\t * @param border Number the padding value in pixel\n\t * @returns {Boolean} true if location inside the image's border, false otherwise\n\t * @see cvd/image.h\n\t */\n\tImageWrapper.prototype.inImageWithBorder = function (imgRef, border) {\n\t return imgRef.x >= border && imgRef.y >= border && imgRef.x < this.size.x - border && imgRef.y < this.size.y - border;\n\t};\n\t\n\t/**\n\t * Transforms an image according to the given affine-transformation matrix.\n\t * @param inImg ImageWrapper a image containing the information to be extracted.\n\t * @param outImg ImageWrapper the image to be filled. The whole image out image is filled by the in image.\n\t * @param M mat2 the matrix used to map point in the out matrix to those in the in matrix\n\t * @param inOrig vec2 origin in the in image\n\t * @param outOrig vec2 origin in the out image\n\t * @returns Number the number of pixels not in the in image\n\t * @see cvd/vision.h\n\t */\n\tImageWrapper.transform = function (inImg, outImg, M, inOrig, outOrig) {\n\t var w = outImg.size.x,\n\t h = outImg.size.y,\n\t iw = inImg.size.x,\n\t ih = inImg.size.y;\n\t var across = _glMatrix.vec2.clone([M[0], M[2]]);\n\t var down = _glMatrix.vec2.clone([M[1], M[3]]);\n\t var defaultValue = 0;\n\t\n\t var p0 = _glMatrix.vec2.subtract(inOrig, _glMatrix.mat2.xVec2(M, outOrig, _glMatrix.vec2.clone()), _glMatrix.vec2.clone());\n\t\n\t var min_x = p0[0],\n\t min_y = p0[1];\n\t var max_x = min_x,\n\t max_y = min_y;\n\t var p, i, j;\n\t\n\t var sampleFunc = ImageWrapper.sample;\n\t\n\t if (across[0] < 0) min_x += w * across[0];else max_x += w * across[0];\n\t\n\t if (down[0] < 0) min_x += h * down[0];else max_x += h * down[0];\n\t\n\t if (across[1] < 0) min_y += w * across[1];else max_y += w * across[1];\n\t\n\t if (down[1] < 0) min_y += h * down[1];else max_y += h * down[1];\n\t\n\t var carrigeReturn = _glMatrix.vec2.subtract(down, _glMatrix.vec2.scale(across, w, _glMatrix.vec2.clone()), _glMatrix.vec2.clone());\n\t\n\t if (min_x >= 0 && min_y >= 0 && max_x < iw - 1 && max_y < ih - 1) {\n\t p = p0;\n\t for (i = 0; i < h; ++i, _glMatrix.vec2.add(p, carrigeReturn)) for (j = 0; j < w; ++j, _glMatrix.vec2.add(p, across)) outImg.set(j, i, sampleFunc(inImg, p[0], p[1]));\n\t return 0;\n\t } else {\n\t var x_bound = iw - 1;\n\t var y_bound = ih - 1;\n\t var count = 0;\n\t p = p0;\n\t for (i = 0; i < h; ++i, _glMatrix.vec2.add(p, carrigeReturn)) {\n\t for (j = 0; j < w; ++j, _glMatrix.vec2.add(p, across)) {\n\t if (0 <= p[0] && 0 <= p[1] && p[0] < x_bound && p[1] < y_bound) {\n\t outImg.set(j, i, sampleFunc(inImg, p[0], p[1]));\n\t } else {\n\t outImg.set(j, i, defaultValue);++count;\n\t }\n\t }\n\t }\n\t return count;\n\t }\n\t};\n\t\n\t/**\n\t * Performs bilinear sampling\n\t * @param inImg Image to extract sample from\n\t * @param x the x-coordinate\n\t * @param y the y-coordinate\n\t * @returns the sampled value\n\t * @see cvd/vision.h\n\t */\n\tImageWrapper.sample = function (inImg, x, y) {\n\t var lx = Math.floor(x);\n\t var ly = Math.floor(y);\n\t var w = inImg.size.x;\n\t var base = ly * inImg.size.x + lx;\n\t var a = inImg.data[base + 0];\n\t var b = inImg.data[base + 1];\n\t var c = inImg.data[base + w];\n\t var d = inImg.data[base + w + 1];\n\t var e = a - b;\n\t x -= lx;\n\t y -= ly;\n\t\n\t var result = Math.floor(x * (y * (e - c + d) - e) + y * (c - a) + a);\n\t return result;\n\t};\n\t\n\t/**\n\t * Initializes a given array. Sets each element to zero.\n\t * @param array {Array} The array to initialize\n\t */\n\tImageWrapper.clearArray = function (array) {\n\t var l = array.length;\n\t while (l--) {\n\t array[l] = 0;\n\t }\n\t};\n\t\n\t/**\n\t * Creates a {SubImage} from the current image ({this}).\n\t * @param from {ImageRef} The position where to start the {SubImage} from. (top-left corner)\n\t * @param size {ImageRef} The size of the resulting image\n\t * @returns {SubImage} A shared part of the original image\n\t */\n\tImageWrapper.prototype.subImage = function (from, size) {\n\t return new _subImage2['default'](from, size, this);\n\t};\n\t\n\t/**\n\t * Creates an {ImageWrapper) and copies the needed underlying image-data area\n\t * @param imageWrapper {ImageWrapper} The target {ImageWrapper} where the data should be copied\n\t * @param from {ImageRef} The location where to copy from (top-left location)\n\t */\n\tImageWrapper.prototype.subImageAsCopy = function (imageWrapper, from) {\n\t var sizeY = imageWrapper.size.y,\n\t sizeX = imageWrapper.size.x;\n\t var x, y;\n\t for (x = 0; x < sizeX; x++) {\n\t for (y = 0; y < sizeY; y++) {\n\t imageWrapper.data[y * sizeX + x] = this.data[(from.y + y) * this.size.x + from.x + x];\n\t }\n\t }\n\t};\n\t\n\tImageWrapper.prototype.copyTo = function (imageWrapper) {\n\t var length = this.data.length,\n\t srcData = this.data,\n\t dstData = imageWrapper.data;\n\t\n\t while (length--) {\n\t dstData[length] = srcData[length];\n\t }\n\t};\n\t\n\t/**\n\t * Retrieves a given pixel position from the image\n\t * @param x {Number} The x-position\n\t * @param y {Number} The y-position\n\t * @returns {Number} The grayscale value at the pixel-position\n\t */\n\tImageWrapper.prototype.get = function (x, y) {\n\t return this.data[y * this.size.x + x];\n\t};\n\t\n\t/**\n\t * Retrieves a given pixel position from the image\n\t * @param x {Number} The x-position\n\t * @param y {Number} The y-position\n\t * @returns {Number} The grayscale value at the pixel-position\n\t */\n\tImageWrapper.prototype.getSafe = function (x, y) {\n\t var i;\n\t\n\t if (!this.indexMapping) {\n\t this.indexMapping = {\n\t x: [],\n\t y: []\n\t };\n\t for (i = 0; i < this.size.x; i++) {\n\t this.indexMapping.x[i] = i;\n\t this.indexMapping.x[i + this.size.x] = i;\n\t }\n\t for (i = 0; i < this.size.y; i++) {\n\t this.indexMapping.y[i] = i;\n\t this.indexMapping.y[i + this.size.y] = i;\n\t }\n\t }\n\t return this.data[this.indexMapping.y[y + this.size.y] * this.size.x + this.indexMapping.x[x + this.size.x]];\n\t};\n\t\n\t/**\n\t * Sets a given pixel position in the image\n\t * @param x {Number} The x-position\n\t * @param y {Number} The y-position\n\t * @param value {Number} The grayscale value to set\n\t * @returns {ImageWrapper} The Image itself (for possible chaining)\n\t */\n\tImageWrapper.prototype.set = function (x, y, value) {\n\t this.data[y * this.size.x + x] = value;\n\t return this;\n\t};\n\t\n\t/**\n\t * Sets the border of the image (1 pixel) to zero\n\t */\n\tImageWrapper.prototype.zeroBorder = function () {\n\t var i,\n\t width = this.size.x,\n\t height = this.size.y,\n\t data = this.data;\n\t for (i = 0; i < width; i++) {\n\t data[i] = data[(height - 1) * width + i] = 0;\n\t }\n\t for (i = 1; i < height - 1; i++) {\n\t data[i * width] = data[i * width + (width - 1)] = 0;\n\t }\n\t};\n\t\n\t/**\n\t * Inverts a binary image in place\n\t */\n\tImageWrapper.prototype.invert = function () {\n\t var data = this.data,\n\t length = data.length;\n\t\n\t while (length--) {\n\t data[length] = data[length] ? 0 : 1;\n\t }\n\t};\n\t\n\tImageWrapper.prototype.convolve = function (kernel) {\n\t var x,\n\t y,\n\t kx,\n\t ky,\n\t kSize = kernel.length / 2 | 0,\n\t accu = 0;\n\t for (y = 0; y < this.size.y; y++) {\n\t for (x = 0; x < this.size.x; x++) {\n\t accu = 0;\n\t for (ky = -kSize; ky <= kSize; ky++) {\n\t for (kx = -kSize; kx <= kSize; kx++) {\n\t accu += kernel[ky + kSize][kx + kSize] * this.getSafe(x + kx, y + ky);\n\t }\n\t }\n\t this.data[y * this.size.x + x] = accu;\n\t }\n\t }\n\t};\n\t\n\tImageWrapper.prototype.moments = function (labelcount) {\n\t var data = this.data,\n\t x,\n\t y,\n\t height = this.size.y,\n\t width = this.size.x,\n\t val,\n\t ysq,\n\t labelsum = [],\n\t i,\n\t label,\n\t mu11,\n\t mu02,\n\t mu20,\n\t x_,\n\t y_,\n\t tmp,\n\t result = [],\n\t PI = Math.PI,\n\t PI_4 = PI / 4;\n\t\n\t if (labelcount <= 0) {\n\t return result;\n\t }\n\t\n\t for (i = 0; i < labelcount; i++) {\n\t labelsum[i] = {\n\t m00: 0,\n\t m01: 0,\n\t m10: 0,\n\t m11: 0,\n\t m02: 0,\n\t m20: 0,\n\t theta: 0,\n\t rad: 0\n\t };\n\t }\n\t\n\t for (y = 0; y < height; y++) {\n\t ysq = y * y;\n\t for (x = 0; x < width; x++) {\n\t val = data[y * width + x];\n\t if (val > 0) {\n\t label = labelsum[val - 1];\n\t label.m00 += 1;\n\t label.m01 += y;\n\t label.m10 += x;\n\t label.m11 += x * y;\n\t label.m02 += ysq;\n\t label.m20 += x * x;\n\t }\n\t }\n\t }\n\t\n\t for (i = 0; i < labelcount; i++) {\n\t label = labelsum[i];\n\t if (!isNaN(label.m00) && label.m00 !== 0) {\n\t x_ = label.m10 / label.m00;\n\t y_ = label.m01 / label.m00;\n\t mu11 = label.m11 / label.m00 - x_ * y_;\n\t mu02 = label.m02 / label.m00 - y_ * y_;\n\t mu20 = label.m20 / label.m00 - x_ * x_;\n\t tmp = (mu02 - mu20) / (2 * mu11);\n\t tmp = 0.5 * Math.atan(tmp) + (mu11 >= 0 ? PI_4 : -PI_4) + PI;\n\t label.theta = (tmp * 180 / PI + 90) % 180 - 90;\n\t if (label.theta < 0) {\n\t label.theta += 180;\n\t }\n\t label.rad = tmp > PI ? tmp - PI : tmp;\n\t label.vec = _glMatrix.vec2.clone([Math.cos(tmp), Math.sin(tmp)]);\n\t result.push(label);\n\t }\n\t }\n\t\n\t return result;\n\t};\n\t\n\t/**\n\t * Displays the {ImageWrapper} in a given canvas\n\t * @param canvas {Canvas} The canvas element to write to\n\t * @param scale {Number} Scale which is applied to each pixel-value\n\t */\n\tImageWrapper.prototype.show = function (canvas, scale) {\n\t var ctx, frame, data, current, pixel, x, y;\n\t\n\t if (!scale) {\n\t scale = 1.0;\n\t }\n\t ctx = canvas.getContext('2d');\n\t canvas.width = this.size.x;\n\t canvas.height = this.size.y;\n\t frame = ctx.getImageData(0, 0, canvas.width, canvas.height);\n\t data = frame.data;\n\t current = 0;\n\t for (y = 0; y < this.size.y; y++) {\n\t for (x = 0; x < this.size.x; x++) {\n\t pixel = y * this.size.x + x;\n\t current = this.get(x, y) * scale;\n\t data[pixel * 4 + 0] = current;\n\t data[pixel * 4 + 1] = current;\n\t data[pixel * 4 + 2] = current;\n\t data[pixel * 4 + 3] = 255;\n\t }\n\t }\n\t //frame.data = data;\n\t ctx.putImageData(frame, 0, 0);\n\t};\n\t\n\t/**\n\t * Displays the {SubImage} in a given canvas\n\t * @param canvas {Canvas} The canvas element to write to\n\t * @param scale {Number} Scale which is applied to each pixel-value\n\t */\n\tImageWrapper.prototype.overlay = function (canvas, scale, from) {\n\t if (!scale || scale < 0 || scale > 360) {\n\t scale = 360;\n\t }\n\t var hsv = [0, 1, 1];\n\t var rgb = [0, 0, 0];\n\t var whiteRgb = [255, 255, 255];\n\t var blackRgb = [0, 0, 0];\n\t var result = [];\n\t var ctx = canvas.getContext('2d');\n\t var frame = ctx.getImageData(from.x, from.y, this.size.x, this.size.y);\n\t var data = frame.data;\n\t var length = this.data.length;\n\t while (length--) {\n\t hsv[0] = this.data[length] * scale;\n\t result = hsv[0] <= 0 ? whiteRgb : hsv[0] >= 360 ? blackRgb : _cv_utils2['default'].hsv2rgb(hsv, rgb);\n\t data[length * 4 + 0] = result[0];\n\t data[length * 4 + 1] = result[1];\n\t data[length * 4 + 2] = result[2];\n\t data[length * 4 + 3] = 255;\n\t }\n\t ctx.putImageData(frame, from.x, from.y);\n\t};\n\t\n\texports['default'] = ImageWrapper;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 6 */\n/***/ function(module, exports) {\n\n\t/**\n\t * Construct representing a part of another {ImageWrapper}. Shares data\n\t * between the parent and the child.\n\t * @param from {ImageRef} The position where to start the {SubImage} from. (top-left corner)\n\t * @param size {ImageRef} The size of the resulting image\n\t * @param I {ImageWrapper} The {ImageWrapper} to share from\n\t * @returns {SubImage} A shared part of the original image\n\t */\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\tfunction SubImage(from, size, I) {\n\t if (!I) {\n\t I = {\n\t data: null,\n\t size: size\n\t };\n\t }\n\t this.data = I.data;\n\t this.originalSize = I.size;\n\t this.I = I;\n\t\n\t this.from = from;\n\t this.size = size;\n\t}\n\t\n\t/**\n\t * Displays the {SubImage} in a given canvas\n\t * @param canvas {Canvas} The canvas element to write to\n\t * @param scale {Number} Scale which is applied to each pixel-value\n\t */\n\tSubImage.prototype.show = function (canvas, scale) {\n\t var ctx, frame, data, current, y, x, pixel;\n\t\n\t if (!scale) {\n\t scale = 1.0;\n\t }\n\t ctx = canvas.getContext('2d');\n\t canvas.width = this.size.x;\n\t canvas.height = this.size.y;\n\t frame = ctx.getImageData(0, 0, canvas.width, canvas.height);\n\t data = frame.data;\n\t current = 0;\n\t for (y = 0; y < this.size.y; y++) {\n\t for (x = 0; x < this.size.x; x++) {\n\t pixel = y * this.size.x + x;\n\t current = this.get(x, y) * scale;\n\t data[pixel * 4 + 0] = current;\n\t data[pixel * 4 + 1] = current;\n\t data[pixel * 4 + 2] = current;\n\t data[pixel * 4 + 3] = 255;\n\t }\n\t }\n\t frame.data = data;\n\t ctx.putImageData(frame, 0, 0);\n\t};\n\t\n\t/**\n\t * Retrieves a given pixel position from the {SubImage}\n\t * @param x {Number} The x-position\n\t * @param y {Number} The y-position\n\t * @returns {Number} The grayscale value at the pixel-position\n\t */\n\tSubImage.prototype.get = function (x, y) {\n\t return this.data[(this.from.y + y) * this.originalSize.x + this.from.x + x];\n\t};\n\t\n\t/**\n\t * Updates the underlying data from a given {ImageWrapper}\n\t * @param image {ImageWrapper} The updated image\n\t */\n\tSubImage.prototype.updateData = function (image) {\n\t this.originalSize = image.size;\n\t this.data = image.data;\n\t};\n\t\n\t/**\n\t * Updates the position of the shared area\n\t * @param from {x,y} The new location\n\t * @returns {SubImage} returns {this} for possible chaining\n\t */\n\tSubImage.prototype.updateFrom = function (from) {\n\t this.from = from;\n\t return this;\n\t};\n\t\n\texports['default'] = SubImage;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 7 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar _cluster = __webpack_require__(8);\n\t\n\tvar _cluster2 = _interopRequireDefault(_cluster);\n\t\n\tvar _array_helper = __webpack_require__(19);\n\t\n\tvar _array_helper2 = _interopRequireDefault(_array_helper);\n\t\n\tvar _glMatrix = __webpack_require__(9);\n\t\n\tvar CVUtils = {};\n\t\n\t/**\n\t * @param x x-coordinate\n\t * @param y y-coordinate\n\t * @return ImageReference {x,y} Coordinate\n\t */\n\tCVUtils.imageRef = function (x, y) {\n\t var that = {\n\t x: x,\n\t y: y,\n\t toVec2: function toVec2() {\n\t return _glMatrix.vec2.clone([this.x, this.y]);\n\t },\n\t toVec3: function toVec3() {\n\t return _glMatrix.vec3.clone([this.x, this.y, 1]);\n\t },\n\t round: function round() {\n\t this.x = this.x > 0.0 ? Math.floor(this.x + 0.5) : Math.floor(this.x - 0.5);\n\t this.y = this.y > 0.0 ? Math.floor(this.y + 0.5) : Math.floor(this.y - 0.5);\n\t return this;\n\t }\n\t };\n\t return that;\n\t};\n\t\n\t/**\n\t * Computes an integral image of a given grayscale image.\n\t * @param imageDataContainer {ImageDataContainer} the image to be integrated\n\t */\n\tCVUtils.computeIntegralImage2 = function (imageWrapper, integralWrapper) {\n\t var imageData = imageWrapper.data;\n\t var width = imageWrapper.size.x;\n\t var height = imageWrapper.size.y;\n\t var integralImageData = integralWrapper.data;\n\t var sum = 0,\n\t posA = 0,\n\t posB = 0,\n\t posC = 0,\n\t posD = 0,\n\t x,\n\t y;\n\t\n\t // sum up first column\n\t posB = width;\n\t sum = 0;\n\t for (y = 1; y < height; y++) {\n\t sum += imageData[posA];\n\t integralImageData[posB] += sum;\n\t posA += width;\n\t posB += width;\n\t }\n\t\n\t posA = 0;\n\t posB = 1;\n\t sum = 0;\n\t for (x = 1; x < width; x++) {\n\t sum += imageData[posA];\n\t integralImageData[posB] += sum;\n\t posA++;\n\t posB++;\n\t }\n\t\n\t for (y = 1; y < height; y++) {\n\t posA = y * width + 1;\n\t posB = (y - 1) * width + 1;\n\t posC = y * width;\n\t posD = (y - 1) * width;\n\t for (x = 1; x < width; x++) {\n\t integralImageData[posA] += imageData[posA] + integralImageData[posB] + integralImageData[posC] - integralImageData[posD];\n\t posA++;\n\t posB++;\n\t posC++;\n\t posD++;\n\t }\n\t }\n\t};\n\t\n\tCVUtils.computeIntegralImage = function (imageWrapper, integralWrapper) {\n\t var imageData = imageWrapper.data;\n\t var width = imageWrapper.size.x;\n\t var height = imageWrapper.size.y;\n\t var integralImageData = integralWrapper.data;\n\t var sum = 0;\n\t\n\t // sum up first row\n\t for (var i = 0; i < width; i++) {\n\t sum += imageData[i];\n\t integralImageData[i] = sum;\n\t }\n\t\n\t for (var v = 1; v < height; v++) {\n\t sum = 0;\n\t for (var u = 0; u < width; u++) {\n\t sum += imageData[v * width + u];\n\t integralImageData[v * width + u] = sum + integralImageData[(v - 1) * width + u];\n\t }\n\t }\n\t};\n\t\n\tCVUtils.thresholdImage = function (imageWrapper, threshold, targetWrapper) {\n\t if (!targetWrapper) {\n\t targetWrapper = imageWrapper;\n\t }\n\t var imageData = imageWrapper.data,\n\t length = imageData.length,\n\t targetData = targetWrapper.data;\n\t\n\t while (length--) {\n\t targetData[length] = imageData[length] < threshold ? 1 : 0;\n\t }\n\t};\n\t\n\tCVUtils.computeHistogram = function (imageWrapper, bitsPerPixel) {\n\t if (!bitsPerPixel) {\n\t bitsPerPixel = 8;\n\t }\n\t var imageData = imageWrapper.data,\n\t length = imageData.length,\n\t bitShift = 8 - bitsPerPixel,\n\t bucketCnt = 1 << bitsPerPixel,\n\t hist = new Int32Array(bucketCnt);\n\t\n\t while (length--) {\n\t hist[imageData[length] >> bitShift]++;\n\t }\n\t return hist;\n\t};\n\t\n\tCVUtils.sharpenLine = function (line) {\n\t var i,\n\t length = line.length,\n\t left = line[0],\n\t center = line[1],\n\t right;\n\t\n\t for (i = 1; i < length - 1; i++) {\n\t right = line[i + 1];\n\t // -1 4 -1 kernel\n\t line[i - 1] = center * 2 - left - right & 255;\n\t left = center;\n\t center = right;\n\t }\n\t return line;\n\t};\n\t\n\tCVUtils.determineOtsuThreshold = function (imageWrapper, bitsPerPixel) {\n\t if (!bitsPerPixel) {\n\t bitsPerPixel = 8;\n\t }\n\t var hist,\n\t threshold,\n\t bitShift = 8 - bitsPerPixel;\n\t\n\t function px(init, end) {\n\t var sum = 0,\n\t i;\n\t for (i = init; i <= end; i++) {\n\t sum += hist[i];\n\t }\n\t return sum;\n\t }\n\t\n\t function mx(init, end) {\n\t var i,\n\t sum = 0;\n\t\n\t for (i = init; i <= end; i++) {\n\t sum += i * hist[i];\n\t }\n\t\n\t return sum;\n\t }\n\t\n\t function determineThreshold() {\n\t var vet = [0],\n\t p1,\n\t p2,\n\t p12,\n\t k,\n\t m1,\n\t m2,\n\t m12,\n\t max = (1 << bitsPerPixel) - 1;\n\t\n\t hist = CVUtils.computeHistogram(imageWrapper, bitsPerPixel);\n\t for (k = 1; k < max; k++) {\n\t p1 = px(0, k);\n\t p2 = px(k + 1, max);\n\t p12 = p1 * p2;\n\t if (p12 === 0) {\n\t p12 = 1;\n\t }\n\t m1 = mx(0, k) * p2;\n\t m2 = mx(k + 1, max) * p1;\n\t m12 = m1 - m2;\n\t vet[k] = m12 * m12 / p12;\n\t }\n\t return _array_helper2['default'].maxIndex(vet);\n\t }\n\t\n\t threshold = determineThreshold();\n\t return threshold << bitShift;\n\t};\n\t\n\tCVUtils.otsuThreshold = function (imageWrapper, targetWrapper) {\n\t var threshold = CVUtils.determineOtsuThreshold(imageWrapper);\n\t\n\t CVUtils.thresholdImage(imageWrapper, threshold, targetWrapper);\n\t return threshold;\n\t};\n\t\n\t// local thresholding\n\tCVUtils.computeBinaryImage = function (imageWrapper, integralWrapper, targetWrapper) {\n\t CVUtils.computeIntegralImage(imageWrapper, integralWrapper);\n\t\n\t if (!targetWrapper) {\n\t targetWrapper = imageWrapper;\n\t }\n\t var imageData = imageWrapper.data;\n\t var targetData = targetWrapper.data;\n\t var width = imageWrapper.size.x;\n\t var height = imageWrapper.size.y;\n\t var integralImageData = integralWrapper.data;\n\t var sum = 0,\n\t v,\n\t u,\n\t kernel = 3,\n\t A,\n\t B,\n\t C,\n\t D,\n\t avg,\n\t size = (kernel * 2 + 1) * (kernel * 2 + 1);\n\t\n\t // clear out top & bottom-border\n\t for (v = 0; v <= kernel; v++) {\n\t for (u = 0; u < width; u++) {\n\t targetData[v * width + u] = 0;\n\t targetData[(height - 1 - v) * width + u] = 0;\n\t }\n\t }\n\t\n\t // clear out left & right border\n\t for (v = kernel; v < height - kernel; v++) {\n\t for (u = 0; u <= kernel; u++) {\n\t targetData[v * width + u] = 0;\n\t targetData[v * width + (width - 1 - u)] = 0;\n\t }\n\t }\n\t\n\t for (v = kernel + 1; v < height - kernel - 1; v++) {\n\t for (u = kernel + 1; u < width - kernel; u++) {\n\t A = integralImageData[(v - kernel - 1) * width + (u - kernel - 1)];\n\t B = integralImageData[(v - kernel - 1) * width + (u + kernel)];\n\t C = integralImageData[(v + kernel) * width + (u - kernel - 1)];\n\t D = integralImageData[(v + kernel) * width + (u + kernel)];\n\t sum = D - C - B + A;\n\t avg = sum / size;\n\t targetData[v * width + u] = imageData[v * width + u] > avg + 5 ? 0 : 1;\n\t }\n\t }\n\t};\n\t\n\tCVUtils.cluster = function (points, threshold, property) {\n\t var i,\n\t k,\n\t cluster,\n\t point,\n\t clusters = [];\n\t\n\t if (!property) {\n\t property = \"rad\";\n\t }\n\t\n\t function addToCluster(point) {\n\t var found = false;\n\t for (k = 0; k < clusters.length; k++) {\n\t cluster = clusters[k];\n\t if (cluster.fits(point)) {\n\t cluster.add(point);\n\t found = true;\n\t }\n\t }\n\t return found;\n\t }\n\t\n\t // iterate over each cloud\n\t for (i = 0; i < points.length; i++) {\n\t point = _cluster2['default'].createPoint(points[i], i, property);\n\t if (!addToCluster(point)) {\n\t clusters.push(_cluster2['default'].create(point, threshold));\n\t }\n\t }\n\t\n\t return clusters;\n\t};\n\t\n\tCVUtils.Tracer = {\n\t trace: function trace(points, vec) {\n\t var iteration,\n\t maxIterations = 10,\n\t top = [],\n\t result = [],\n\t centerPos = 0,\n\t currentPos = 0;\n\t\n\t function trace(idx, forward) {\n\t var from,\n\t to,\n\t toIdx,\n\t predictedPos,\n\t thresholdX = 1,\n\t thresholdY = Math.abs(vec[1] / 10),\n\t found = false;\n\t\n\t function match(pos, predicted) {\n\t if (pos.x > predicted.x - thresholdX && pos.x < predicted.x + thresholdX && pos.y > predicted.y - thresholdY && pos.y < predicted.y + thresholdY) {\n\t return true;\n\t } else {\n\t return false;\n\t }\n\t }\n\t\n\t // check if the next index is within the vec specifications\n\t // if not, check as long as the threshold is met\n\t\n\t from = points[idx];\n\t if (forward) {\n\t predictedPos = {\n\t x: from.x + vec[0],\n\t y: from.y + vec[1]\n\t };\n\t } else {\n\t predictedPos = {\n\t x: from.x - vec[0],\n\t y: from.y - vec[1]\n\t };\n\t }\n\t\n\t toIdx = forward ? idx + 1 : idx - 1;\n\t to = points[toIdx];\n\t while (to && (found = match(to, predictedPos)) !== true && Math.abs(to.y - from.y) < vec[1]) {\n\t toIdx = forward ? toIdx + 1 : toIdx - 1;\n\t to = points[toIdx];\n\t }\n\t\n\t return found ? toIdx : null;\n\t }\n\t\n\t for (iteration = 0; iteration < maxIterations; iteration++) {\n\t // randomly select point to start with\n\t centerPos = Math.floor(Math.random() * points.length);\n\t\n\t // trace forward\n\t top = [];\n\t currentPos = centerPos;\n\t top.push(points[currentPos]);\n\t while ((currentPos = trace(currentPos, true)) !== null) {\n\t top.push(points[currentPos]);\n\t }\n\t if (centerPos > 0) {\n\t currentPos = centerPos;\n\t while ((currentPos = trace(currentPos, false)) !== null) {\n\t top.push(points[currentPos]);\n\t }\n\t }\n\t\n\t if (top.length > result.length) {\n\t result = top;\n\t }\n\t }\n\t\n\t return result;\n\t }\n\t};\n\t\n\tCVUtils.DILATE = 1;\n\tCVUtils.ERODE = 2;\n\t\n\tCVUtils.dilate = function (inImageWrapper, outImageWrapper) {\n\t var v,\n\t u,\n\t inImageData = inImageWrapper.data,\n\t outImageData = outImageWrapper.data,\n\t height = inImageWrapper.size.y,\n\t width = inImageWrapper.size.x,\n\t sum,\n\t yStart1,\n\t yStart2,\n\t xStart1,\n\t xStart2;\n\t\n\t for (v = 1; v < height - 1; v++) {\n\t for (u = 1; u < width - 1; u++) {\n\t yStart1 = v - 1;\n\t yStart2 = v + 1;\n\t xStart1 = u - 1;\n\t xStart2 = u + 1;\n\t sum = inImageData[yStart1 * width + xStart1] /* + inImageData[yStart1*width+u] */ + inImageData[yStart1 * width + xStart2] +\n\t /* inImageData[v*width+xStart1] + */\n\t inImageData[v * width + u] + /* inImageData[v*width+xStart2] +*/\n\t inImageData[yStart2 * width + xStart1] /* + inImageData[yStart2*width+u]*/ + inImageData[yStart2 * width + xStart2];\n\t outImageData[v * width + u] = sum > 0 ? 1 : 0;\n\t }\n\t }\n\t};\n\t\n\tCVUtils.erode = function (inImageWrapper, outImageWrapper) {\n\t var v,\n\t u,\n\t inImageData = inImageWrapper.data,\n\t outImageData = outImageWrapper.data,\n\t height = inImageWrapper.size.y,\n\t width = inImageWrapper.size.x,\n\t sum,\n\t yStart1,\n\t yStart2,\n\t xStart1,\n\t xStart2;\n\t\n\t for (v = 1; v < height - 1; v++) {\n\t for (u = 1; u < width - 1; u++) {\n\t yStart1 = v - 1;\n\t yStart2 = v + 1;\n\t xStart1 = u - 1;\n\t xStart2 = u + 1;\n\t sum = inImageData[yStart1 * width + xStart1] /* + inImageData[yStart1*width+u] */ + inImageData[yStart1 * width + xStart2] +\n\t /* inImageData[v*width+xStart1] + */\n\t inImageData[v * width + u] + /* inImageData[v*width+xStart2] +*/\n\t inImageData[yStart2 * width + xStart1] /* + inImageData[yStart2*width+u]*/ + inImageData[yStart2 * width + xStart2];\n\t outImageData[v * width + u] = sum === 5 ? 1 : 0;\n\t }\n\t }\n\t};\n\t\n\tCVUtils.subtract = function (aImageWrapper, bImageWrapper, resultImageWrapper) {\n\t if (!resultImageWrapper) {\n\t resultImageWrapper = aImageWrapper;\n\t }\n\t var length = aImageWrapper.data.length,\n\t aImageData = aImageWrapper.data,\n\t bImageData = bImageWrapper.data,\n\t cImageData = resultImageWrapper.data;\n\t\n\t while (length--) {\n\t cImageData[length] = aImageData[length] - bImageData[length];\n\t }\n\t};\n\t\n\tCVUtils.bitwiseOr = function (aImageWrapper, bImageWrapper, resultImageWrapper) {\n\t if (!resultImageWrapper) {\n\t resultImageWrapper = aImageWrapper;\n\t }\n\t var length = aImageWrapper.data.length,\n\t aImageData = aImageWrapper.data,\n\t bImageData = bImageWrapper.data,\n\t cImageData = resultImageWrapper.data;\n\t\n\t while (length--) {\n\t cImageData[length] = aImageData[length] || bImageData[length];\n\t }\n\t};\n\t\n\tCVUtils.countNonZero = function (imageWrapper) {\n\t var length = imageWrapper.data.length,\n\t data = imageWrapper.data,\n\t sum = 0;\n\t\n\t while (length--) {\n\t sum += data[length];\n\t }\n\t return sum;\n\t};\n\t\n\tCVUtils.topGeneric = function (list, top, scoreFunc) {\n\t var i,\n\t minIdx = 0,\n\t min = 0,\n\t queue = [],\n\t score,\n\t hit,\n\t pos;\n\t\n\t for (i = 0; i < top; i++) {\n\t queue[i] = {\n\t score: 0,\n\t item: null\n\t };\n\t }\n\t\n\t for (i = 0; i < list.length; i++) {\n\t score = scoreFunc.apply(this, [list[i]]);\n\t if (score > min) {\n\t hit = queue[minIdx];\n\t hit.score = score;\n\t hit.item = list[i];\n\t min = Number.MAX_VALUE;\n\t for (pos = 0; pos < top; pos++) {\n\t if (queue[pos].score < min) {\n\t min = queue[pos].score;\n\t minIdx = pos;\n\t }\n\t }\n\t }\n\t }\n\t\n\t return queue;\n\t};\n\t\n\tCVUtils.grayArrayFromImage = function (htmlImage, offsetX, ctx, array) {\n\t ctx.drawImage(htmlImage, offsetX, 0, htmlImage.width, htmlImage.height);\n\t var ctxData = ctx.getImageData(offsetX, 0, htmlImage.width, htmlImage.height).data;\n\t CVUtils.computeGray(ctxData, array);\n\t};\n\t\n\tCVUtils.grayArrayFromContext = function (ctx, size, offset, array) {\n\t var ctxData = ctx.getImageData(offset.x, offset.y, size.x, size.y).data;\n\t CVUtils.computeGray(ctxData, array);\n\t};\n\t\n\tCVUtils.grayAndHalfSampleFromCanvasData = function (canvasData, size, outArray) {\n\t var topRowIdx = 0;\n\t var bottomRowIdx = size.x;\n\t var endIdx = Math.floor(canvasData.length / 4);\n\t var outWidth = size.x / 2;\n\t var outImgIdx = 0;\n\t var inWidth = size.x;\n\t var i;\n\t\n\t while (bottomRowIdx < endIdx) {\n\t for (i = 0; i < outWidth; i++) {\n\t outArray[outImgIdx] = Math.floor((0.299 * canvasData[topRowIdx * 4 + 0] + 0.587 * canvasData[topRowIdx * 4 + 1] + 0.114 * canvasData[topRowIdx * 4 + 2] + (0.299 * canvasData[(topRowIdx + 1) * 4 + 0] + 0.587 * canvasData[(topRowIdx + 1) * 4 + 1] + 0.114 * canvasData[(topRowIdx + 1) * 4 + 2]) + (0.299 * canvasData[bottomRowIdx * 4 + 0] + 0.587 * canvasData[bottomRowIdx * 4 + 1] + 0.114 * canvasData[bottomRowIdx * 4 + 2]) + (0.299 * canvasData[(bottomRowIdx + 1) * 4 + 0] + 0.587 * canvasData[(bottomRowIdx + 1) * 4 + 1] + 0.114 * canvasData[(bottomRowIdx + 1) * 4 + 2])) / 4);\n\t outImgIdx++;\n\t topRowIdx = topRowIdx + 2;\n\t bottomRowIdx = bottomRowIdx + 2;\n\t }\n\t topRowIdx = topRowIdx + inWidth;\n\t bottomRowIdx = bottomRowIdx + inWidth;\n\t }\n\t};\n\t\n\tCVUtils.computeGray = function (imageData, outArray, config) {\n\t var l = imageData.length / 4 | 0,\n\t i,\n\t singleChannel = config && config.singleChannel === true;\n\t\n\t if (singleChannel) {\n\t for (i = 0; i < l; i++) {\n\t outArray[i] = imageData[i * 4 + 0];\n\t }\n\t } else {\n\t for (i = 0; i < l; i++) {\n\t outArray[i] = Math.floor(0.299 * imageData[i * 4 + 0] + 0.587 * imageData[i * 4 + 1] + 0.114 * imageData[i * 4 + 2]);\n\t }\n\t }\n\t};\n\t\n\tCVUtils.loadImageArray = function (src, callback, canvas) {\n\t if (!canvas) canvas = document.createElement('canvas');\n\t var img = new Image();\n\t img.callback = callback;\n\t img.onload = function () {\n\t canvas.width = this.width;\n\t canvas.height = this.height;\n\t var ctx = canvas.getContext('2d');\n\t ctx.drawImage(this, 0, 0);\n\t var array = new Uint8Array(this.width * this.height);\n\t ctx.drawImage(this, 0, 0);\n\t var data = ctx.getImageData(0, 0, this.width, this.height).data;\n\t CVUtils.computeGray(data, array);\n\t this.callback(array, {\n\t x: this.width,\n\t y: this.height\n\t }, this);\n\t };\n\t img.src = src;\n\t};\n\t\n\t/**\n\t * @param inImg {ImageWrapper} input image to be sampled\n\t * @param outImg {ImageWrapper} to be stored in\n\t */\n\tCVUtils.halfSample = function (inImgWrapper, outImgWrapper) {\n\t var inImg = inImgWrapper.data;\n\t var inWidth = inImgWrapper.size.x;\n\t var outImg = outImgWrapper.data;\n\t var topRowIdx = 0;\n\t var bottomRowIdx = inWidth;\n\t var endIdx = inImg.length;\n\t var outWidth = inWidth / 2;\n\t var outImgIdx = 0;\n\t while (bottomRowIdx < endIdx) {\n\t for (var i = 0; i < outWidth; i++) {\n\t outImg[outImgIdx] = Math.floor((inImg[topRowIdx] + inImg[topRowIdx + 1] + inImg[bottomRowIdx] + inImg[bottomRowIdx + 1]) / 4);\n\t outImgIdx++;\n\t topRowIdx = topRowIdx + 2;\n\t bottomRowIdx = bottomRowIdx + 2;\n\t }\n\t topRowIdx = topRowIdx + inWidth;\n\t bottomRowIdx = bottomRowIdx + inWidth;\n\t }\n\t};\n\t\n\tCVUtils.hsv2rgb = function (hsv, rgb) {\n\t var h = hsv[0],\n\t s = hsv[1],\n\t v = hsv[2],\n\t c = v * s,\n\t x = c * (1 - Math.abs(h / 60 % 2 - 1)),\n\t m = v - c,\n\t r = 0,\n\t g = 0,\n\t b = 0;\n\t rgb = rgb || [0, 0, 0];\n\t\n\t if (h < 60) {\n\t r = c;\n\t g = x;\n\t } else if (h < 120) {\n\t r = x;\n\t g = c;\n\t } else if (h < 180) {\n\t g = c;\n\t b = x;\n\t } else if (h < 240) {\n\t g = x;\n\t b = c;\n\t } else if (h < 300) {\n\t r = x;\n\t b = c;\n\t } else if (h < 360) {\n\t r = c;\n\t b = x;\n\t }\n\t rgb[0] = (r + m) * 255 | 0;\n\t rgb[1] = (g + m) * 255 | 0;\n\t rgb[2] = (b + m) * 255 | 0;\n\t return rgb;\n\t};\n\t\n\tCVUtils._computeDivisors = function (n) {\n\t var largeDivisors = [],\n\t divisors = [],\n\t i;\n\t\n\t for (i = 1; i < Math.sqrt(n) + 1; i++) {\n\t if (n % i === 0) {\n\t divisors.push(i);\n\t if (i !== n / i) {\n\t largeDivisors.unshift(Math.floor(n / i));\n\t }\n\t }\n\t }\n\t return divisors.concat(largeDivisors);\n\t};\n\t\n\tCVUtils._computeIntersection = function (arr1, arr2) {\n\t var i = 0,\n\t j = 0,\n\t result = [];\n\t\n\t while (i < arr1.length && j < arr2.length) {\n\t if (arr1[i] === arr2[j]) {\n\t result.push(arr1[i]);\n\t i++;\n\t j++;\n\t } else if (arr1[i] > arr2[j]) {\n\t j++;\n\t } else {\n\t i++;\n\t }\n\t }\n\t return result;\n\t};\n\t\n\tCVUtils.calculatePatchSize = function (patchSize, imgSize) {\n\t var divisorsX = this._computeDivisors(imgSize.x),\n\t divisorsY = this._computeDivisors(imgSize.y),\n\t wideSide = Math.max(imgSize.x, imgSize.y),\n\t common = this._computeIntersection(divisorsX, divisorsY),\n\t nrOfPatchesList = [8, 10, 15, 20, 32, 60, 80],\n\t nrOfPatchesMap = {\n\t \"x-small\": 5,\n\t \"small\": 4,\n\t \"medium\": 3,\n\t \"large\": 2,\n\t \"x-large\": 1\n\t },\n\t nrOfPatchesIdx = nrOfPatchesMap[patchSize] || nrOfPatchesMap.medium,\n\t nrOfPatches = nrOfPatchesList[nrOfPatchesIdx],\n\t desiredPatchSize = Math.floor(wideSide / nrOfPatches),\n\t optimalPatchSize;\n\t\n\t function findPatchSizeForDivisors(divisors) {\n\t var i = 0,\n\t found = divisors[Math.floor(divisors.length / 2)];\n\t\n\t while (i < divisors.length - 1 && divisors[i] < desiredPatchSize) {\n\t i++;\n\t }\n\t if (i > 0) {\n\t if (Math.abs(divisors[i] - desiredPatchSize) > Math.abs(divisors[i - 1] - desiredPatchSize)) {\n\t found = divisors[i - 1];\n\t } else {\n\t found = divisors[i];\n\t }\n\t }\n\t if (desiredPatchSize / found < nrOfPatchesList[nrOfPatchesIdx + 1] / nrOfPatchesList[nrOfPatchesIdx] && desiredPatchSize / found > nrOfPatchesList[nrOfPatchesIdx - 1] / nrOfPatchesList[nrOfPatchesIdx]) {\n\t return { x: found, y: found };\n\t }\n\t return null;\n\t }\n\t\n\t optimalPatchSize = findPatchSizeForDivisors(common);\n\t if (!optimalPatchSize) {\n\t optimalPatchSize = findPatchSizeForDivisors(this._computeDivisors(wideSide));\n\t if (!optimalPatchSize) {\n\t optimalPatchSize = findPatchSizeForDivisors(this._computeDivisors(desiredPatchSize * nrOfPatches));\n\t }\n\t }\n\t return optimalPatchSize;\n\t};\n\t\n\tCVUtils._parseCSSDimensionValues = function (value) {\n\t var dimension = {\n\t value: parseFloat(value),\n\t unit: value.indexOf(\"%\") === value.length - 1 ? \"%\" : \"%\"\n\t };\n\t\n\t return dimension;\n\t};\n\t\n\tCVUtils._dimensionsConverters = {\n\t top: function top(dimension, context) {\n\t if (dimension.unit === \"%\") {\n\t return Math.floor(context.height * (dimension.value / 100));\n\t }\n\t },\n\t right: function right(dimension, context) {\n\t if (dimension.unit === \"%\") {\n\t return Math.floor(context.width - context.width * (dimension.value / 100));\n\t }\n\t },\n\t bottom: function bottom(dimension, context) {\n\t if (dimension.unit === \"%\") {\n\t return Math.floor(context.height - context.height * (dimension.value / 100));\n\t }\n\t },\n\t left: function left(dimension, context) {\n\t if (dimension.unit === \"%\") {\n\t return Math.floor(context.width * (dimension.value / 100));\n\t }\n\t }\n\t};\n\t\n\tCVUtils.computeImageArea = function (inputWidth, inputHeight, area) {\n\t var context = { width: inputWidth, height: inputHeight };\n\t\n\t var parsedArea = Object.keys(area).reduce(function (result, key) {\n\t var value = area[key],\n\t parsed = CVUtils._parseCSSDimensionValues(value),\n\t calculated = CVUtils._dimensionsConverters[key](parsed, context);\n\t\n\t result[key] = calculated;\n\t return result;\n\t }, {});\n\t\n\t return {\n\t sx: parsedArea.left,\n\t sy: parsedArea.top,\n\t sw: parsedArea.right - parsedArea.left,\n\t sh: parsedArea.bottom - parsedArea.top\n\t };\n\t};\n\t\n\texports['default'] = CVUtils;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 8 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tvar _glMatrix = __webpack_require__(9);\n\t\n\t/**\n\t * Creates a cluster for grouping similar orientations of datapoints\n\t */\n\texports['default'] = {\n\t create: function create(point, threshold) {\n\t var points = [],\n\t center = {\n\t rad: 0,\n\t vec: _glMatrix.vec2.clone([0, 0])\n\t },\n\t pointMap = {};\n\t\n\t function init() {\n\t _add(point);\n\t updateCenter();\n\t }\n\t\n\t function _add(point) {\n\t pointMap[point.id] = point;\n\t points.push(point);\n\t }\n\t\n\t function updateCenter() {\n\t var i,\n\t sum = 0;\n\t for (i = 0; i < points.length; i++) {\n\t sum += points[i].rad;\n\t }\n\t center.rad = sum / points.length;\n\t center.vec = _glMatrix.vec2.clone([Math.cos(center.rad), Math.sin(center.rad)]);\n\t }\n\t\n\t init();\n\t\n\t return {\n\t add: function add(point) {\n\t if (!pointMap[point.id]) {\n\t _add(point);\n\t updateCenter();\n\t }\n\t },\n\t fits: function fits(point) {\n\t // check cosine similarity to center-angle\n\t var similarity = Math.abs(_glMatrix.vec2.dot(point.point.vec, center.vec));\n\t if (similarity > threshold) {\n\t return true;\n\t }\n\t return false;\n\t },\n\t getPoints: function getPoints() {\n\t return points;\n\t },\n\t getCenter: function getCenter() {\n\t return center;\n\t }\n\t };\n\t },\n\t createPoint: function createPoint(point, id, property) {\n\t return {\n\t rad: point[property],\n\t point: point,\n\t id: id\n\t };\n\t }\n\t};\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 9 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/**\n\t * @fileoverview gl-matrix - High performance matrix and vector operations\n\t * @author Brandon Jones\n\t * @author Colin MacKenzie IV\n\t * @version 2.3.0\n\t */\n\t\n\t/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.\n\t\n\tPermission is hereby granted, free of charge, to any person obtaining a copy\n\tof this software and associated documentation files (the \"Software\"), to deal\n\tin the Software without restriction, including without limitation the rights\n\tto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\tcopies of the Software, and to permit persons to whom the Software is\n\tfurnished to do so, subject to the following conditions:\n\t\n\tThe above copyright notice and this permission notice shall be included in\n\tall copies or substantial portions of the Software.\n\t\n\tTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\tIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\tFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\tAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\tLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\tOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\tTHE SOFTWARE. */\n\t// END HEADER\n\t\n\texports.glMatrix = __webpack_require__(10);\n\texports.mat2 = __webpack_require__(11);\n\texports.mat2d = __webpack_require__(12);\n\texports.mat3 = __webpack_require__(13);\n\texports.mat4 = __webpack_require__(14);\n\texports.quat = __webpack_require__(15);\n\texports.vec2 = __webpack_require__(18);\n\texports.vec3 = __webpack_require__(16);\n\texports.vec4 = __webpack_require__(17);\n\n/***/ },\n/* 10 */\n/***/ function(module, exports) {\n\n\t/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.\n\t\n\tPermission is hereby granted, free of charge, to any person obtaining a copy\n\tof this software and associated documentation files (the \"Software\"), to deal\n\tin the Software without restriction, including without limitation the rights\n\tto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\tcopies of the Software, and to permit persons to whom the Software is\n\tfurnished to do so, subject to the following conditions:\n\t\n\tThe above copyright notice and this permission notice shall be included in\n\tall copies or substantial portions of the Software.\n\t\n\tTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\tIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\tFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\tAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\tLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\tOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\tTHE SOFTWARE. */\n\t\n\t/**\n\t * @class Common utilities\n\t * @name glMatrix\n\t */\n\tvar glMatrix = {};\n\t\n\t// Constants\n\tglMatrix.EPSILON = 0.000001;\n\tglMatrix.ARRAY_TYPE = (typeof Float32Array !== 'undefined') ? Float32Array : Array;\n\tglMatrix.RANDOM = Math.random;\n\t\n\t/**\n\t * Sets the type of array used when creating new vectors and matrices\n\t *\n\t * @param {Type} type Array type, such as Float32Array or Array\n\t */\n\tglMatrix.setMatrixArrayType = function(type) {\n\t GLMAT_ARRAY_TYPE = type;\n\t}\n\t\n\tvar degree = Math.PI / 180;\n\t\n\t/**\n\t* Convert Degree To Radian\n\t*\n\t* @param {Number} Angle in Degrees\n\t*/\n\tglMatrix.toRadian = function(a){\n\t return a * degree;\n\t}\n\t\n\tmodule.exports = glMatrix;\n\n\n/***/ },\n/* 11 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.\n\t\n\tPermission is hereby granted, free of charge, to any person obtaining a copy\n\tof this software and associated documentation files (the \"Software\"), to deal\n\tin the Software without restriction, including without limitation the rights\n\tto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\tcopies of the Software, and to permit persons to whom the Software is\n\tfurnished to do so, subject to the following conditions:\n\t\n\tThe above copyright notice and this permission notice shall be included in\n\tall copies or substantial portions of the Software.\n\t\n\tTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\tIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\tFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\tAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\tLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\tOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\tTHE SOFTWARE. */\n\t\n\tvar glMatrix = __webpack_require__(10);\n\t\n\t/**\n\t * @class 2x2 Matrix\n\t * @name mat2\n\t */\n\tvar mat2 = {};\n\t\n\t/**\n\t * Creates a new identity mat2\n\t *\n\t * @returns {mat2} a new 2x2 matrix\n\t */\n\tmat2.create = function() {\n\t var out = new glMatrix.ARRAY_TYPE(4);\n\t out[0] = 1;\n\t out[1] = 0;\n\t out[2] = 0;\n\t out[3] = 1;\n\t return out;\n\t};\n\t\n\t/**\n\t * Creates a new mat2 initialized with values from an existing matrix\n\t *\n\t * @param {mat2} a matrix to clone\n\t * @returns {mat2} a new 2x2 matrix\n\t */\n\tmat2.clone = function(a) {\n\t var out = new glMatrix.ARRAY_TYPE(4);\n\t out[0] = a[0];\n\t out[1] = a[1];\n\t out[2] = a[2];\n\t out[3] = a[3];\n\t return out;\n\t};\n\t\n\t/**\n\t * Copy the values from one mat2 to another\n\t *\n\t * @param {mat2} out the receiving matrix\n\t * @param {mat2} a the source matrix\n\t * @returns {mat2} out\n\t */\n\tmat2.copy = function(out, a) {\n\t out[0] = a[0];\n\t out[1] = a[1];\n\t out[2] = a[2];\n\t out[3] = a[3];\n\t return out;\n\t};\n\t\n\t/**\n\t * Set a mat2 to the identity matrix\n\t *\n\t * @param {mat2} out the receiving matrix\n\t * @returns {mat2} out\n\t */\n\tmat2.identity = function(out) {\n\t out[0] = 1;\n\t out[1] = 0;\n\t out[2] = 0;\n\t out[3] = 1;\n\t return out;\n\t};\n\t\n\t/**\n\t * Transpose the values of a mat2\n\t *\n\t * @param {mat2} out the receiving matrix\n\t * @param {mat2} a the source matrix\n\t * @returns {mat2} out\n\t */\n\tmat2.transpose = function(out, a) {\n\t // If we are transposing ourselves we can skip a few steps but have to cache some values\n\t if (out === a) {\n\t var a1 = a[1];\n\t out[1] = a[2];\n\t out[2] = a1;\n\t } else {\n\t out[0] = a[0];\n\t out[1] = a[2];\n\t out[2] = a[1];\n\t out[3] = a[3];\n\t }\n\t \n\t return out;\n\t};\n\t\n\t/**\n\t * Inverts a mat2\n\t *\n\t * @param {mat2} out the receiving matrix\n\t * @param {mat2} a the source matrix\n\t * @returns {mat2} out\n\t */\n\tmat2.invert = function(out, a) {\n\t var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3],\n\t\n\t // Calculate the determinant\n\t det = a0 * a3 - a2 * a1;\n\t\n\t if (!det) {\n\t return null;\n\t }\n\t det = 1.0 / det;\n\t \n\t out[0] = a3 * det;\n\t out[1] = -a1 * det;\n\t out[2] = -a2 * det;\n\t out[3] = a0 * det;\n\t\n\t return out;\n\t};\n\t\n\t/**\n\t * Calculates the adjugate of a mat2\n\t *\n\t * @param {mat2} out the receiving matrix\n\t * @param {mat2} a the source matrix\n\t * @returns {mat2} out\n\t */\n\tmat2.adjoint = function(out, a) {\n\t // Caching this value is nessecary if out == a\n\t var a0 = a[0];\n\t out[0] = a[3];\n\t out[1] = -a[1];\n\t out[2] = -a[2];\n\t out[3] = a0;\n\t\n\t return out;\n\t};\n\t\n\t/**\n\t * Calculates the determinant of a mat2\n\t *\n\t * @param {mat2} a the source matrix\n\t * @returns {Number} determinant of a\n\t */\n\tmat2.determinant = function (a) {\n\t return a[0] * a[3] - a[2] * a[1];\n\t};\n\t\n\t/**\n\t * Multiplies two mat2's\n\t *\n\t * @param {mat2} out the receiving matrix\n\t * @param {mat2} a the first operand\n\t * @param {mat2} b the second operand\n\t * @returns {mat2} out\n\t */\n\tmat2.multiply = function (out, a, b) {\n\t var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3];\n\t var b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3];\n\t out[0] = a0 * b0 + a2 * b1;\n\t out[1] = a1 * b0 + a3 * b1;\n\t out[2] = a0 * b2 + a2 * b3;\n\t out[3] = a1 * b2 + a3 * b3;\n\t return out;\n\t};\n\t\n\t/**\n\t * Alias for {@link mat2.multiply}\n\t * @function\n\t */\n\tmat2.mul = mat2.multiply;\n\t\n\t/**\n\t * Rotates a mat2 by the given angle\n\t *\n\t * @param {mat2} out the receiving matrix\n\t * @param {mat2} a the matrix to rotate\n\t * @param {Number} rad the angle to rotate the matrix by\n\t * @returns {mat2} out\n\t */\n\tmat2.rotate = function (out, a, rad) {\n\t var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3],\n\t s = Math.sin(rad),\n\t c = Math.cos(rad);\n\t out[0] = a0 * c + a2 * s;\n\t out[1] = a1 * c + a3 * s;\n\t out[2] = a0 * -s + a2 * c;\n\t out[3] = a1 * -s + a3 * c;\n\t return out;\n\t};\n\t\n\t/**\n\t * Scales the mat2 by the dimensions in the given vec2\n\t *\n\t * @param {mat2} out the receiving matrix\n\t * @param {mat2} a the matrix to rotate\n\t * @param {vec2} v the vec2 to scale the matrix by\n\t * @returns {mat2} out\n\t **/\n\tmat2.scale = function(out, a, v) {\n\t var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3],\n\t v0 = v[0], v1 = v[1];\n\t out[0] = a0 * v0;\n\t out[1] = a1 * v0;\n\t out[2] = a2 * v1;\n\t out[3] = a3 * v1;\n\t return out;\n\t};\n\t\n\t/**\n\t * Creates a matrix from a given angle\n\t * This is equivalent to (but much faster than):\n\t *\n\t * mat2.identity(dest);\n\t * mat2.rotate(dest, dest, rad);\n\t *\n\t * @param {mat2} out mat2 receiving operation result\n\t * @param {Number} rad the angle to rotate the matrix by\n\t * @returns {mat2} out\n\t */\n\tmat2.fromRotation = function(out, rad) {\n\t var s = Math.sin(rad),\n\t c = Math.cos(rad);\n\t out[0] = c;\n\t out[1] = s;\n\t out[2] = -s;\n\t out[3] = c;\n\t return out;\n\t}\n\t\n\t/**\n\t * Creates a matrix from a vector scaling\n\t * This is equivalent to (but much faster than):\n\t *\n\t * mat2.identity(dest);\n\t * mat2.scale(dest, dest, vec);\n\t *\n\t * @param {mat2} out mat2 receiving operation result\n\t * @param {vec2} v Scaling vector\n\t * @returns {mat2} out\n\t */\n\tmat2.fromScaling = function(out, v) {\n\t out[0] = v[0];\n\t out[1] = 0;\n\t out[2] = 0;\n\t out[3] = v[1];\n\t return out;\n\t}\n\t\n\t/**\n\t * Returns a string representation of a mat2\n\t *\n\t * @param {mat2} mat matrix to represent as a string\n\t * @returns {String} string representation of the matrix\n\t */\n\tmat2.str = function (a) {\n\t return 'mat2(' + a[0] + ', ' + a[1] + ', ' + a[2] + ', ' + a[3] + ')';\n\t};\n\t\n\t/**\n\t * Returns Frobenius norm of a mat2\n\t *\n\t * @param {mat2} a the matrix to calculate Frobenius norm of\n\t * @returns {Number} Frobenius norm\n\t */\n\tmat2.frob = function (a) {\n\t return(Math.sqrt(Math.pow(a[0], 2) + Math.pow(a[1], 2) + Math.pow(a[2], 2) + Math.pow(a[3], 2)))\n\t};\n\t\n\t/**\n\t * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\n\t * @param {mat2} L the lower triangular matrix \n\t * @param {mat2} D the diagonal matrix \n\t * @param {mat2} U the upper triangular matrix \n\t * @param {mat2} a the input matrix to factorize\n\t */\n\t\n\tmat2.LDU = function (L, D, U, a) { \n\t L[2] = a[2]/a[0]; \n\t U[0] = a[0]; \n\t U[1] = a[1]; \n\t U[3] = a[3] - L[2] * U[1]; \n\t return [L, D, U]; \n\t}; \n\t\n\t\n\tmodule.exports = mat2;\n\n\n/***/ },\n/* 12 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.\n\t\n\tPermission is hereby granted, free of charge, to any person obtaining a copy\n\tof this software and associated documentation files (the \"Software\"), to deal\n\tin the Software without restriction, including without limitation the rights\n\tto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\tcopies of the Software, and to permit persons to whom the Software is\n\tfurnished to do so, subject to the following conditions:\n\t\n\tThe above copyright notice and this permission notice shall be included in\n\tall copies or substantial portions of the Software.\n\t\n\tTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\tIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\tFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\tAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\tLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\tOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\tTHE SOFTWARE. */\n\t\n\tvar glMatrix = __webpack_require__(10);\n\t\n\t/**\n\t * @class 2x3 Matrix\n\t * @name mat2d\n\t * \n\t * @description \n\t * A mat2d contains six elements defined as:\n\t * <pre>\n\t * [a, c, tx,\n\t * b, d, ty]\n\t * </pre>\n\t * This is a short form for the 3x3 matrix:\n\t * <pre>\n\t * [a, c, tx,\n\t * b, d, ty,\n\t * 0, 0, 1]\n\t * </pre>\n\t * The last row is ignored so the array is shorter and operations are faster.\n\t */\n\tvar mat2d = {};\n\t\n\t/**\n\t * Creates a new identity mat2d\n\t *\n\t * @returns {mat2d} a new 2x3 matrix\n\t */\n\tmat2d.create = function() {\n\t var out = new glMatrix.ARRAY_TYPE(6);\n\t out[0] = 1;\n\t out[1] = 0;\n\t out[2] = 0;\n\t out[3] = 1;\n\t out[4] = 0;\n\t out[5] = 0;\n\t return out;\n\t};\n\t\n\t/**\n\t * Creates a new mat2d initialized with values from an existing matrix\n\t *\n\t * @param {mat2d} a matrix to clone\n\t * @returns {mat2d} a new 2x3 matrix\n\t */\n\tmat2d.clone = function(a) {\n\t var out = new glMatrix.ARRAY_TYPE(6);\n\t out[0] = a[0];\n\t out[1] = a[1];\n\t out[2] = a[2];\n\t out[3] = a[3];\n\t out[4] = a[4];\n\t out[5] = a[5];\n\t return out;\n\t};\n\t\n\t/**\n\t * Copy the values from one mat2d to another\n\t *\n\t * @param {mat2d} out the receiving matrix\n\t * @param {mat2d} a the source matrix\n\t * @returns {mat2d} out\n\t */\n\tmat2d.copy = function(out, a) {\n\t out[0] = a[0];\n\t out[1] = a[1];\n\t out[2] = a[2];\n\t out[3] = a[3];\n\t out[4] = a[4];\n\t out[5] = a[5];\n\t return out;\n\t};\n\t\n\t/**\n\t * Set a mat2d to the identity matrix\n\t *\n\t * @param {mat2d} out the receiving matrix\n\t * @returns {mat2d} out\n\t */\n\tmat2d.identity = function(out) {\n\t out[0] = 1;\n\t out[1] = 0;\n\t out[2] = 0;\n\t out[3] = 1;\n\t out[4] = 0;\n\t out[5] = 0;\n\t return out;\n\t};\n\t\n\t/**\n\t * Inverts a mat2d\n\t *\n\t * @param {mat2d} out the receiving matrix\n\t * @param {mat2d} a the source matrix\n\t * @returns {mat2d} out\n\t */\n\tmat2d.invert = function(out, a) {\n\t var aa = a[0], ab = a[1], ac = a[2], ad = a[3],\n\t atx = a[4], aty = a[5];\n\t\n\t var det = aa * ad - ab * ac;\n\t if(!det){\n\t return null;\n\t }\n\t det = 1.0 / det;\n\t\n\t out[0] = ad * det;\n\t out[1] = -ab * det;\n\t out[2] = -ac * det;\n\t out[3] = aa * det;\n\t out[4] = (ac * aty - ad * atx) * det;\n\t out[5] = (ab * atx - aa * aty) * det;\n\t return out;\n\t};\n\t\n\t/**\n\t * Calculates the determinant of a mat2d\n\t *\n\t * @param {mat2d} a the source matrix\n\t * @returns {Number} determinant of a\n\t */\n\tmat2d.determinant = function (a) {\n\t return a[0] * a[3] - a[1] * a[2];\n\t};\n\t\n\t/**\n\t * Multiplies two mat2d's\n\t *\n\t * @param {mat2d} out the receiving matrix\n\t * @param {mat2d} a the first operand\n\t * @param {mat2d} b the second operand\n\t * @returns {mat2d} out\n\t */\n\tmat2d.multiply = function (out, a, b) {\n\t var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3], a4 = a[4], a5 = a[5],\n\t b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3], b4 = b[4], b5 = b[5];\n\t out[0] = a0 * b0 + a2 * b1;\n\t out[1] = a1 * b0 + a3 * b1;\n\t out[2] = a0 * b2 + a2 * b3;\n\t out[3] = a1 * b2 + a3 * b3;\n\t out[4] = a0 * b4 + a2 * b5 + a4;\n\t out[5] = a1 * b4 + a3 * b5 + a5;\n\t return out;\n\t};\n\t\n\t/**\n\t * Alias for {@link mat2d.multiply}\n\t * @function\n\t */\n\tmat2d.mul = mat2d.multiply;\n\t\n\t/**\n\t * Rotates a mat2d by the given angle\n\t *\n\t * @param {mat2d} out the receiving matrix\n\t * @param {mat2d} a the matrix to rotate\n\t * @param {Number} rad the angle to rotate the matrix by\n\t * @returns {mat2d} out\n\t */\n\tmat2d.rotate = function (out, a, rad) {\n\t var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3], a4 = a[4], a5 = a[5],\n\t s = Math.sin(rad),\n\t c = Math.cos(rad);\n\t out[0] = a0 * c + a2 * s;\n\t out[1] = a1 * c + a3 * s;\n\t out[2] = a0 * -s + a2 * c;\n\t out[3] = a1 * -s + a3 * c;\n\t out[4] = a4;\n\t out[5] = a5;\n\t return out;\n\t};\n\t\n\t/**\n\t * Scales the mat2d by the dimensions in the given vec2\n\t *\n\t * @param {mat2d} out the receiving matrix\n\t * @param {mat2d} a the matrix to translate\n\t * @param {vec2} v the vec2 to scale the matrix by\n\t * @returns {mat2d} out\n\t **/\n\tmat2d.scale = function(out, a, v) {\n\t var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3], a4 = a[4], a5 = a[5],\n\t v0 = v[0], v1 = v[1];\n\t out[0] = a0 * v0;\n\t out[1] = a1 * v0;\n\t out[2] = a2 * v1;\n\t out[3] = a3 * v1;\n\t out[4] = a4;\n\t out[5] = a5;\n\t return out;\n\t};\n\t\n\t/**\n\t * Translates the mat2d by the dimensions in the given vec2\n\t *\n\t * @param {mat2d} out the receiving matrix\n\t * @param {mat2d} a the matrix to translate\n\t * @param {vec2} v the vec2 to translate the matrix by\n\t * @returns {mat2d} out\n\t **/\n\tmat2d.translate = function(out, a, v) {\n\t var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3], a4 = a[4], a5 = a[5],\n\t v0 = v[0], v1 = v[1];\n\t out[0] = a0;\n\t out[1] = a1;\n\t out[2] = a2;\n\t out[3] = a3;\n\t out[4] = a0 * v0 + a2 * v1 + a4;\n\t out[5] = a1 * v0 + a3 * v1 + a5;\n\t return out;\n\t};\n\t\n\t/**\n\t * Creates a matrix from a given angle\n\t * This is equivalent to (but much faster than):\n\t *\n\t * mat2d.identity(dest);\n\t * mat2d.rotate(dest, dest, rad);\n\t *\n\t * @param {mat2d} out mat2d receiving operation result\n\t * @param {Number} rad the angle to rotate the matrix by\n\t * @returns {mat2d} out\n\t */\n\tmat2d.fromRotation = function(out, rad) {\n\t var s = Math.sin(rad), c = Math.cos(rad);\n\t out[0] = c;\n\t out[1] = s;\n\t out[2] = -s;\n\t out[3] = c;\n\t out[4] = 0;\n\t out[5] = 0;\n\t return out;\n\t}\n\t\n\t/**\n\t * Creates a matrix from a vector scaling\n\t * This is equivalent to (but much faster than):\n\t *\n\t * mat2d.identity(dest);\n\t * mat2d.scale(dest, dest, vec);\n\t *\n\t * @param {mat2d} out mat2d receiving operation result\n\t * @param {vec2} v Scaling vector\n\t * @returns {mat2d} out\n\t */\n\tmat2d.fromScaling = function(out, v) {\n\t out[0] = v[0];\n\t out[1] = 0;\n\t out[2] = 0;\n\t out[3] = v[1];\n\t out[4] = 0;\n\t out[5] = 0;\n\t return out;\n\t}\n\t\n\t/**\n\t * Creates a matrix from a vector translation\n\t * This is equivalent to (but much faster than):\n\t *\n\t * mat2d.identity(dest);\n\t * mat2d.translate(dest, dest, vec);\n\t *\n\t * @param {mat2d} out mat2d receiving operation result\n\t * @param {vec2} v Translation vector\n\t * @returns {mat2d} out\n\t */\n\tmat2d.fromTranslation = function(out, v) {\n\t out[0] = 1;\n\t out[1] = 0;\n\t out[2] = 0;\n\t out[3] = 1;\n\t out[4] = v[0];\n\t out[5] = v[1];\n\t return out;\n\t}\n\t\n\t/**\n\t * Returns a string representation of a mat2d\n\t *\n\t * @param {mat2d} a matrix to represent as a string\n\t * @returns {String} string representation of the matrix\n\t */\n\tmat2d.str = function (a) {\n\t return 'mat2d(' + a[0] + ', ' + a[1] + ', ' + a[2] + ', ' + \n\t a[3] + ', ' + a[4] + ', ' + a[5] + ')';\n\t};\n\t\n\t/**\n\t * Returns Frobenius norm of a mat2d\n\t *\n\t * @param {mat2d} a the matrix to calculate Frobenius norm of\n\t * @returns {Number} Frobenius norm\n\t */\n\tmat2d.frob = function (a) { \n\t return(Math.sqrt(Math.pow(a[0], 2) + Math.pow(a[1], 2) + Math.pow(a[2], 2) + Math.pow(a[3], 2) + Math.pow(a[4], 2) + Math.pow(a[5], 2) + 1))\n\t}; \n\t\n\tmodule.exports = mat2d;\n\n\n/***/ },\n/* 13 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.\n\t\n\tPermission is hereby granted, free of charge, to any person obtaining a copy\n\tof this software and associated documentation files (the \"Software\"), to deal\n\tin the Software without restriction, including without limitation the rights\n\tto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\tcopies of the Software, and to permit persons to whom the Software is\n\tfurnished to do so, subject to the following conditions:\n\t\n\tThe above copyright notice and this permission notice shall be included in\n\tall copies or substantial portions of the Software.\n\t\n\tTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\tIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\tFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\tAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\tLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\tOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\tTHE SOFTWARE. */\n\t\n\tvar glMatrix = __webpack_require__(10);\n\t\n\t/**\n\t * @class 3x3 Matrix\n\t * @name mat3\n\t */\n\tvar mat3 = {};\n\t\n\t/**\n\t * Creates a new identity mat3\n\t *\n\t * @returns {mat3} a new 3x3 matrix\n\t */\n\tmat3.create = function() {\n\t var out = new glMatrix.ARRAY_TYPE(9);\n\t out[0] = 1;\n\t out[1] = 0;\n\t out[2] = 0;\n\t out[3] = 0;\n\t out[4] = 1;\n\t out[5] = 0;\n\t out[6] = 0;\n\t out[7] = 0;\n\t out[8] = 1;\n\t return out;\n\t};\n\t\n\t/**\n\t * Copies the upper-left 3x3 values into the given mat3.\n\t *\n\t * @param {mat3} out the receiving 3x3 matrix\n\t * @param {mat4} a the source 4x4 matrix\n\t * @returns {mat3} out\n\t */\n\tmat3.fromMat4 = function(out, a) {\n\t out[0] = a[0];\n\t out[1] = a[1];\n\t out[2] = a[2];\n\t out[3] = a[4];\n\t out[4] = a[5];\n\t out[5] = a[6];\n\t out[6] = a[8];\n\t out[7] = a[9];\n\t out[8] = a[10];\n\t return out;\n\t};\n\t\n\t/**\n\t * Creates a new mat3 initialized with values from an existing matrix\n\t *\n\t * @param {mat3} a matrix to clone\n\t * @returns {mat3} a new 3x3 matrix\n\t */\n\tmat3.clone = function(a) {\n\t var out = new glMatrix.ARRAY_TYPE(9);\n\t out[0] = a[0];\n\t out[1] = a[1];\n\t out[2] = a[2];\n\t out[3] = a[3];\n\t out[4] = a[4];\n\t out[5] = a[5];\n\t out[6] = a[6];\n\t out[7] = a[7];\n\t out[8] = a[8];\n\t return out;\n\t};\n\t\n\t/**\n\t * Copy the values from one mat3 to another\n\t *\n\t * @param {mat3} out the receiving matrix\n\t * @param {mat3} a the source matrix\n\t * @returns {mat3} out\n\t */\n\tmat3.copy = function(out, a) {\n\t out[0] = a[0];\n\t out[1] = a[1];\n\t out[2] = a[2];\n\t out[3] = a[3];\n\t out[4] = a[4];\n\t out[5] = a[5];\n\t out[6] = a[6];\n\t out[7] = a[7];\n\t out[8] = a[8];\n\t return out;\n\t};\n\t\n\t/**\n\t * Set a mat3 to the identity matrix\n\t *\n\t * @param {mat3} out the receiving matrix\n\t * @returns {mat3} out\n\t */\n\tmat3.identity = function(out) {\n\t out[0] = 1;\n\t out[1] = 0;\n\t out[2] = 0;\n\t out[3] = 0;\n\t out[4] = 1;\n\t out[5] = 0;\n\t out[6] = 0;\n\t out[7] = 0;\n\t out[8] = 1;\n\t return out;\n\t};\n\t\n\t/**\n\t * Transpose the values of a mat3\n\t *\n\t * @param {mat3} out the receiving matrix\n\t * @param {mat3} a the source matrix\n\t * @returns {mat3} out\n\t */\n\tmat3.transpose = function(out, a) {\n\t // If we are transposing ourselves we can skip a few steps but have to cache some values\n\t if (out === a) {\n\t var a01 = a[1], a02 = a[2], a12 = a[5];\n\t out[1] = a[3];\n\t out[2] = a[6];\n\t out[3] = a01;\n\t out[5] = a[7];\n\t out[6] = a02;\n\t out[7] = a12;\n\t } else {\n\t out[0] = a[0];\n\t out[1] = a[3];\n\t out[2] = a[6];\n\t out[3] = a[1];\n\t out[4] = a[4];\n\t out[5] = a[7];\n\t out[6] = a[2];\n\t out[7] = a[5];\n\t out[8] = a[8];\n\t }\n\t \n\t return out;\n\t};\n\t\n\t/**\n\t * Inverts a mat3\n\t *\n\t * @param {mat3} out the receiving matrix\n\t * @param {mat3} a the source matrix\n\t * @returns {mat3} out\n\t */\n\tmat3.invert = function(out, a) {\n\t var a00 = a[0], a01 = a[1], a02 = a[2],\n\t a10 = a[3], a11 = a[4], a12 = a[5],\n\t a20 = a[6], a21 = a[7], a22 = a[8],\n\t\n\t b01 = a22 * a11 - a12 * a21,\n\t b11 = -a22 * a10 + a12 * a20,\n\t b21 = a21 * a10 - a11 * a20,\n\t\n\t // Calculate the determinant\n\t det = a00 * b01 + a01 * b11 + a02 * b21;\n\t\n\t if (!det) { \n\t return null; \n\t }\n\t det = 1.0 / det;\n\t\n\t out[0] = b01 * det;\n\t out[1] = (-a22 * a01 + a02 * a21) * det;\n\t out[2] = (a12 * a01 - a02 * a11) * det;\n\t out[3] = b11 * det;\n\t out[4] = (a22 * a00 - a02 * a20) * det;\n\t out[5] = (-a12 * a00 + a02 * a10) * det;\n\t out[6] = b21 * det;\n\t out[7] = (-a21 * a00 + a01 * a20) * det;\n\t out[8] = (a11 * a00 - a01 * a10) * det;\n\t return out;\n\t};\n\t\n\t/**\n\t * Calculates the adjugate of a mat3\n\t *\n\t * @param {mat3} out the receiving matrix\n\t * @param {mat3} a the source matrix\n\t * @returns {mat3} out\n\t */\n\tmat3.adjoint = function(out, a) {\n\t var a00 = a[0], a01 = a[1], a02 = a[2],\n\t a10 = a[3], a11 = a[4], a12 = a[5],\n\t a20 = a[6], a21 = a[7], a22 = a[8];\n\t\n\t out[0] = (a11 * a22 - a12 * a21);\n\t out[1] = (a02 * a21 - a01 * a22);\n\t out[2] = (a01 * a12 - a02 * a11);\n\t out[3] = (a12 * a20 - a10 * a22);\n\t out[4] = (a00 * a22 - a02 * a20);\n\t out[5] = (a02 * a10 - a00 * a12);\n\t out[6] = (a10 * a21 - a11 * a20);\n\t out[7] = (a01 * a20 - a00 * a21);\n\t out[8] = (a00 * a11 - a01 * a10);\n\t return out;\n\t};\n\t\n\t/**\n\t * Calculates the determinant of a mat3\n\t *\n\t * @param {mat3} a the source matrix\n\t * @returns {Number} determinant of a\n\t */\n\tmat3.determinant = function (a) {\n\t var a00 = a[0], a01 = a[1], a02 = a[2],\n\t a10 = a[3], a11 = a[4], a12 = a[5],\n\t a20 = a[6], a21 = a[7], a22 = a[8];\n\t\n\t return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\n\t};\n\t\n\t/**\n\t * Multiplies two mat3's\n\t *\n\t * @param {mat3} out the receiving matrix\n\t * @param {mat3} a the first operand\n\t * @param {mat3} b the second operand\n\t * @returns {mat3} out\n\t */\n\tmat3.multiply = function (out, a, b) {\n\t var a00 = a[0], a01 = a[1], a02 = a[2],\n\t a10 = a[3], a11 = a[4], a12 = a[5],\n\t a20 = a[6], a21 = a[7], a22 = a[8],\n\t\n\t b00 = b[0], b01 = b[1], b02 = b[2],\n\t b10 = b[3], b11 = b[4], b12 = b[5],\n\t b20 = b[6], b21 = b[7], b22 = b[8];\n\t\n\t out[0] = b00 * a00 + b01 * a10 + b02 * a20;\n\t out[1] = b00 * a01 + b01 * a11 + b02 * a21;\n\t out[2] = b00 * a02 + b01 * a12 + b02 * a22;\n\t\n\t out[3] = b10 * a00 + b11 * a10 + b12 * a20;\n\t out[4] = b10 * a01 + b11 * a11 + b12 * a21;\n\t out[5] = b10 * a02 + b11 * a12 + b12 * a22;\n\t\n\t out[6] = b20 * a00 + b21 * a10 + b22 * a20;\n\t out[7] = b20 * a01 + b21 * a11 + b22 * a21;\n\t out[8] = b20 * a02 + b21 * a12 + b22 * a22;\n\t return out;\n\t};\n\t\n\t/**\n\t * Alias for {@link mat3.multiply}\n\t * @function\n\t */\n\tmat3.mul = mat3.multiply;\n\t\n\t/**\n\t * Translate a mat3 by the given vector\n\t *\n\t * @param {mat3} out the receiving matrix\n\t * @param {mat3} a the matrix to translate\n\t * @param {vec2} v vector to translate by\n\t * @returns {mat3} out\n\t */\n\tmat3.translate = function(out, a, v) {\n\t var a00 = a[0], a01 = a[1], a02 = a[2],\n\t a10 = a[3], a11 = a[4], a12 = a[5],\n\t a20 = a[6], a21 = a[7], a22 = a[8],\n\t x = v[0], y = v[1];\n\t\n\t out[0] = a00;\n\t out[1] = a01;\n\t out[2] = a02;\n\t\n\t out[3] = a10;\n\t out[4] = a11;\n\t out[5] = a12;\n\t\n\t out[6] = x * a00 + y * a10 + a20;\n\t out[7] = x * a01 + y * a11 + a21;\n\t out[8] = x * a02 + y * a12 + a22;\n\t return out;\n\t};\n\t\n\t/**\n\t * Rotates a mat3 by the given angle\n\t *\n\t * @param {mat3} out the receiving matrix\n\t * @param {mat3} a the matrix to rotate\n\t * @param {Number} rad the angle to rotate the matrix by\n\t * @returns {mat3} out\n\t */\n\tmat3.rotate = function (out, a, rad) {\n\t var a00 = a[0], a01 = a[1], a02 = a[2],\n\t a10 = a[3], a11 = a[4], a12 = a[5],\n\t a20 = a[6], a21 = a[7], a22 = a[8],\n\t\n\t s = Math.sin(rad),\n\t c = Math.cos(rad);\n\t\n\t out[0] = c * a00 + s * a10;\n\t out[1] = c * a01 + s * a11;\n\t out[2] = c * a02 + s * a12;\n\t\n\t out[3] = c * a10 - s * a00;\n\t out[4] = c * a11 - s * a01;\n\t out[5] = c * a12 - s * a02;\n\t\n\t out[6] = a20;\n\t out[7] = a21;\n\t out[8] = a22;\n\t return out;\n\t};\n\t\n\t/**\n\t * Scales the mat3 by the dimensions in the given vec2\n\t *\n\t * @param {mat3} out the receiving matrix\n\t * @param {mat3} a the matrix to rotate\n\t * @param {vec2} v the vec2 to scale the matrix by\n\t * @returns {mat3} out\n\t **/\n\tmat3.scale = function(out, a, v) {\n\t var x = v[0], y = v[1];\n\t\n\t out[0] = x * a[0];\n\t out[1] = x * a[1];\n\t out[2] = x * a[2];\n\t\n\t out[3] = y * a[3];\n\t out[4] = y * a[4];\n\t out[5] = y * a[5];\n\t\n\t out[6] = a[6];\n\t out[7] = a[7];\n\t out[8] = a[8];\n\t return out;\n\t};\n\t\n\t/**\n\t * Creates a matrix from a vector translation\n\t * This is equivalent to (but much faster than):\n\t *\n\t * mat3.identity(dest);\n\t * mat3.translate(dest, dest, vec);\n\t *\n\t * @param {mat3} out mat3 receiving operation result\n\t * @param {vec2} v Translation vector\n\t * @returns {mat3} out\n\t */\n\tmat3.fromTranslation = function(out, v) {\n\t out[0] = 1;\n\t out[1] = 0;\n\t out[2] = 0;\n\t out[3] = 0;\n\t out[4] = 1;\n\t out[5] = 0;\n\t out[6] = v[0];\n\t out[7] = v[1];\n\t out[8] = 1;\n\t return out;\n\t}\n\t\n\t/**\n\t * Creates a matrix from a given angle\n\t * This is equivalent to (but much faster than):\n\t *\n\t * mat3.identity(dest);\n\t * mat3.rotate(dest, dest, rad);\n\t *\n\t * @param {mat3} out mat3 receiving operation result\n\t * @param {Number} rad the angle to rotate the matrix by\n\t * @returns {mat3} out\n\t */\n\tmat3.fromRotation = function(out, rad) {\n\t var s = Math.sin(rad), c = Math.cos(rad);\n\t\n\t out[0] = c;\n\t out[1] = s;\n\t out[2] = 0;\n\t\n\t out[3] = -s;\n\t out[4] = c;\n\t out[5] = 0;\n\t\n\t out[6] = 0;\n\t out[7] = 0;\n\t out[8] = 1;\n\t return out;\n\t}\n\t\n\t/**\n\t * Creates a matrix from a vector scaling\n\t * This is equivalent to (but much faster than):\n\t *\n\t * mat3.identity(dest);\n\t * mat3.scale(dest, dest, vec);\n\t *\n\t * @param {mat3} out mat3 receiving operation result\n\t * @param {vec2} v Scaling vector\n\t * @returns {mat3} out\n\t */\n\tmat3.fromScaling = function(out, v) {\n\t out[0] = v[0];\n\t out[1] = 0;\n\t out[2] = 0;\n\t\n\t out[3] = 0;\n\t out[4] = v[1];\n\t out[5] = 0;\n\t\n\t out[6] = 0;\n\t out[7] = 0;\n\t out[8] = 1;\n\t return out;\n\t}\n\t\n\t/**\n\t * Copies the values from a mat2d into a mat3\n\t *\n\t * @param {mat3} out the receiving matrix\n\t * @param {mat2d} a the matrix to copy\n\t * @returns {mat3} out\n\t **/\n\tmat3.fromMat2d = function(out, a) {\n\t out[0] = a[0];\n\t out[1] = a[1];\n\t out[2] = 0;\n\t\n\t out[3] = a[2];\n\t out[4] = a[3];\n\t out[5] = 0;\n\t\n\t out[6] = a[4];\n\t out[7] = a[5];\n\t out[8] = 1;\n\t return out;\n\t};\n\t\n\t/**\n\t* Calculates a 3x3 matrix from the given quaternion\n\t*\n\t* @param {mat3} out mat3 receiving operation result\n\t* @param {quat} q Quaternion to create matrix from\n\t*\n\t* @returns {mat3} out\n\t*/\n\tmat3.fromQuat = function (out, q) {\n\t var x = q[0], y = q[1], z = q[2], w = q[3],\n\t x2 = x + x,\n\t y2 = y + y,\n\t z2 = z + z,\n\t\n\t xx = x * x2,\n\t yx = y * x2,\n\t yy = y * y2,\n\t zx = z * x2,\n\t zy = z * y2,\n\t zz = z * z2,\n\t wx = w * x2,\n\t wy = w * y2,\n\t wz = w * z2;\n\t\n\t out[0] = 1 - yy - zz;\n\t out[3] = yx - wz;\n\t out[6] = zx + wy;\n\t\n\t out[1] = yx + wz;\n\t out[4] = 1 - xx - zz;\n\t out[7] = zy - wx;\n\t\n\t out[2] = zx - wy;\n\t out[5] = zy + wx;\n\t out[8] = 1 - xx - yy;\n\t\n\t return out;\n\t};\n\t\n\t/**\n\t* Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\n\t*\n\t* @param {mat3} out mat3 receiving operation result\n\t* @param {mat4} a Mat4 to derive the normal matrix from\n\t*\n\t* @returns {mat3} out\n\t*/\n\tmat3.normalFromMat4 = function (out, a) {\n\t var a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3],\n\t a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7],\n\t a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11],\n\t a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15],\n\t\n\t b00 = a00 * a11 - a01 * a10,\n\t b01 = a00 * a12 - a02 * a10,\n\t b02 = a00 * a13 - a03 * a10,\n\t b03 = a01 * a12 - a02 * a11,\n\t b04 = a01 * a13 - a03 * a11,\n\t b05 = a02 * a13 - a03 * a12,\n\t b06 = a20 * a31 - a21 * a30,\n\t b07 = a20 * a32 - a22 * a30,\n\t b08 = a20 * a33 - a23 * a30,\n\t b09 = a21 * a32 - a22 * a31,\n\t b10 = a21 * a33 - a23 * a31,\n\t b11 = a22 * a33 - a23 * a32,\n\t\n\t // Calculate the determinant\n\t det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\t\n\t if (!det) { \n\t return null; \n\t }\n\t det = 1.0 / det;\n\t\n\t out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n\t out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n\t out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n\t\n\t out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n\t out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n\t out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n\t\n\t out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n\t out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n\t out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n\t\n\t return out;\n\t};\n\t\n\t/**\n\t * Returns a string representation of a mat3\n\t *\n\t * @param {mat3} mat matrix to represent as a string\n\t * @returns {String} string representation of the matrix\n\t */\n\tmat3.str = function (a) {\n\t return 'mat3(' + a[0] + ', ' + a[1] + ', ' + a[2] + ', ' + \n\t a[3] + ', ' + a[4] + ', ' + a[5] + ', ' + \n\t a[6] + ', ' + a[7] + ', ' + a[8] + ')';\n\t};\n\t\n\t/**\n\t * Returns Frobenius norm of a mat3\n\t *\n\t * @param {mat3} a the matrix to calculate Frobenius norm of\n\t * @returns {Number} Frobenius norm\n\t */\n\tmat3.frob = function (a) {\n\t return(Math.sqrt(Math.pow(a[0], 2) + Math.pow(a[1], 2) + Math.pow(a[2], 2) + Math.pow(a[3], 2) + Math.pow(a[4], 2) + Math.pow(a[5], 2) + Math.pow(a[6], 2) + Math.pow(a[7], 2) + Math.pow(a[8], 2)))\n\t};\n\t\n\t\n\tmodule.exports = mat3;\n\n\n/***/ },\n/* 14 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.\n\t\n\tPermission is hereby granted, free of charge, to any person obtaining a copy\n\tof this software and associated documentation files (the \"Software\"), to deal\n\tin the Software without restriction, including without limitation the rights\n\tto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\tcopies of the Software, and to permit persons to whom the Software is\n\tfurnished to do so, subject to the following conditions:\n\t\n\tThe above copyright notice and this permission notice shall be included in\n\tall copies or substantial portions of the Software.\n\t\n\tTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\tIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\tFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\tAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\tLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\tOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\tTHE SOFTWARE. */\n\t\n\tvar glMatrix = __webpack_require__(10);\n\t\n\t/**\n\t * @class 4x4 Matrix\n\t * @name mat4\n\t */\n\tvar mat4 = {};\n\t\n\t/**\n\t * Creates a new identity mat4\n\t *\n\t * @returns {mat4} a new 4x4 matrix\n\t */\n\tmat4.create = function() {\n\t var out = new glMatrix.ARRAY_TYPE(16);\n\t out[0] = 1;\n\t out[1] = 0;\n\t out[2] = 0;\n\t out[3] = 0;\n\t out[4] = 0;\n\t out[5] = 1;\n\t out[6] = 0;\n\t out[7] = 0;\n\t out[8] = 0;\n\t out[9] = 0;\n\t out[10] = 1;\n\t out[11] = 0;\n\t out[12] = 0;\n\t out[13] = 0;\n\t out[14] = 0;\n\t out[15] = 1;\n\t return out;\n\t};\n\t\n\t/**\n\t * Creates a new mat4 initialized with values from an existing matrix\n\t *\n\t * @param {mat4} a matrix to clone\n\t * @returns {mat4} a new 4x4 matrix\n\t */\n\tmat4.clone = function(a) {\n\t var out = new glMatrix.ARRAY_TYPE(16);\n\t out[0] = a[0];\n\t out[1] = a[1];\n\t out[2] = a[2];\n\t out[3] = a[3];\n\t out[4] = a[4];\n\t out[5] = a[5];\n\t out[6] = a[6];\n\t out[7] = a[7];\n\t out[8] = a[8];\n\t out[9] = a[9];\n\t out[10] = a[10];\n\t out[11] = a[11];\n\t out[12] = a[12];\n\t out[13] = a[13];\n\t out[14] = a[14];\n\t out[15] = a[15];\n\t return out;\n\t};\n\t\n\t/**\n\t * Copy the values from one mat4 to another\n\t *\n\t * @param {mat4} out the receiving matrix\n\t * @param {mat4} a the source matrix\n\t * @returns {mat4} out\n\t */\n\tmat4.copy = function(out, a) {\n\t out[0] = a[0];\n\t out[1] = a[1];\n\t out[2] = a[2];\n\t out[3] = a[3];\n\t out[4] = a[4];\n\t out[5] = a[5];\n\t out[6] = a[6];\n\t out[7] = a[7];\n\t out[8] = a[8];\n\t out[9] = a[9];\n\t out[10] = a[10];\n\t out[11] = a[11];\n\t out[12] = a[12];\n\t out[13] = a[13];\n\t out[14] = a[14];\n\t out[15] = a[15];\n\t return out;\n\t};\n\t\n\t/**\n\t * Set a mat4 to the identity matrix\n\t *\n\t * @param {mat4} out the receiving matrix\n\t * @returns {mat4} out\n\t */\n\tmat4.identity = function(out) {\n\t out[0] = 1;\n\t out[1] = 0;\n\t out[2] = 0;\n\t out[3] = 0;\n\t out[4] = 0;\n\t out[5] = 1;\n\t out[6] = 0;\n\t out[7] = 0;\n\t out[8] = 0;\n\t out[9] = 0;\n\t out[10] = 1;\n\t out[11] = 0;\n\t out[12] = 0;\n\t out[13] = 0;\n\t out[14] = 0;\n\t out[15] = 1;\n\t return out;\n\t};\n\t\n\t/**\n\t * Transpose the values of a mat4\n\t *\n\t * @param {mat4} out the receiving matrix\n\t * @param {mat4} a the source matrix\n\t * @returns {mat4} out\n\t */\n\tmat4.transpose = function(out, a) {\n\t // If we are transposing ourselves we can skip a few steps but have to cache some values\n\t if (out === a) {\n\t var a01 = a[1], a02 = a[2], a03 = a[3],\n\t a12 = a[6], a13 = a[7],\n\t a23 = a[11];\n\t\n\t out[1] = a[4];\n\t out[2] = a[8];\n\t out[3] = a[12];\n\t out[4] = a01;\n\t out[6] = a[9];\n\t out[7] = a[13];\n\t out[8] = a02;\n\t out[9] = a12;\n\t out[11] = a[14];\n\t out[12] = a03;\n\t out[13] = a13;\n\t out[14] = a23;\n\t } else {\n\t out[0] = a[0];\n\t out[1] = a[4];\n\t out[2] = a[8];\n\t out[3] = a[12];\n\t out[4] = a[1];\n\t out[5] = a[5];\n\t out[6] = a[9];\n\t out[7] = a[13];\n\t out[8] = a[2];\n\t out[9] = a[6];\n\t out[10] = a[10];\n\t out[11] = a[14];\n\t out[12] = a[3];\n\t out[13] = a[7];\n\t out[14] = a[11];\n\t out[15] = a[15];\n\t }\n\t \n\t return out;\n\t};\n\t\n\t/**\n\t * Inverts a mat4\n\t *\n\t * @param {mat4} out the receiving matrix\n\t * @param {mat4} a the source matrix\n\t * @returns {mat4} out\n\t */\n\tmat4.invert = function(out, a) {\n\t var a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3],\n\t a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7],\n\t a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11],\n\t a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15],\n\t\n\t b00 = a00 * a11 - a01 * a10,\n\t b01 = a00 * a12 - a02 * a10,\n\t b02 = a00 * a13 - a03 * a10,\n\t b03 = a01 * a12 - a02 * a11,\n\t b04 = a01 * a13 - a03 * a11,\n\t b05 = a02 * a13 - a03 * a12,\n\t b06 = a20 * a31 - a21 * a30,\n\t b07 = a20 * a32 - a22 * a30,\n\t b08 = a20 * a33 - a23 * a30,\n\t b09 = a21 * a32 - a22 * a31,\n\t b10 = a21 * a33 - a23 * a31,\n\t b11 = a22 * a33 - a23 * a32,\n\t\n\t // Calculate the determinant\n\t det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\t\n\t if (!det) { \n\t return null; \n\t }\n\t det = 1.0 / det;\n\t\n\t out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n\t out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n\t out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n\t out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n\t out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n\t out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n\t out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n\t out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n\t out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n\t out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n\t out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n\t out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n\t out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n\t out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n\t out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n\t out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n\t\n\t return out;\n\t};\n\t\n\t/**\n\t * Calculates the adjugate of a mat4\n\t *\n\t * @param {mat4} out the receiving matrix\n\t * @param {mat4} a the source matrix\n\t * @returns {mat4} out\n\t */\n\tmat4.adjoint = function(out, a) {\n\t var a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3],\n\t a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7],\n\t a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11],\n\t a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n\t\n\t out[0] = (a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22));\n\t out[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22));\n\t out[2] = (a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12));\n\t out[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12));\n\t out[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22));\n\t out[5] = (a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22));\n\t out[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12));\n\t out[7] = (a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12));\n\t out[8] = (a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21));\n\t out[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21));\n\t out[10] = (a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11));\n\t out[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11));\n\t out[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21));\n\t out[13] = (a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21));\n\t out[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11));\n\t out[15] = (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11));\n\t return out;\n\t};\n\t\n\t/**\n\t * Calculates the determinant of a mat4\n\t *\n\t * @param {mat4} a the source matrix\n\t * @returns {Number} determinant of a\n\t */\n\tmat4.determinant = function (a) {\n\t var a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3],\n\t a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7],\n\t a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11],\n\t a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15],\n\t\n\t b00 = a00 * a11 - a01 * a10,\n\t b01 = a00 * a12 - a02 * a10,\n\t b02 = a00 * a13 - a03 * a10,\n\t b03 = a01 * a12 - a02 * a11,\n\t b04 = a01 * a13 - a03 * a11,\n\t b05 = a02 * a13 - a03 * a12,\n\t b06 = a20 * a31 - a21 * a30,\n\t b07 = a20 * a32 - a22 * a30,\n\t b08 = a20 * a33 - a23 * a30,\n\t b09 = a21 * a32 - a22 * a31,\n\t b10 = a21 * a33 - a23 * a31,\n\t b11 = a22 * a33 - a23 * a32;\n\t\n\t // Calculate the determinant\n\t return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\t};\n\t\n\t/**\n\t * Multiplies two mat4's\n\t *\n\t * @param {mat4} out the receiving matrix\n\t * @param {mat4} a the first operand\n\t * @param {mat4} b the second operand\n\t * @returns {mat4} out\n\t */\n\tmat4.multiply = function (out, a, b) {\n\t var a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3],\n\t a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7],\n\t a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11],\n\t a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n\t\n\t // Cache only the current line of the second matrix\n\t var b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3]; \n\t out[0] = b0*a00 + b1*a10 + b2*a20 + b3*a30;\n\t out[1] = b0*a01 + b1*a11 + b2*a21 + b3*a31;\n\t out[2] = b0*a02 + b1*a12 + b2*a22 + b3*a32;\n\t out[3] = b0*a03 + b1*a13 + b2*a23 + b3*a33;\n\t\n\t b0 = b[4]; b1 = b[5]; b2 = b[6]; b3 = b[7];\n\t out[4] = b0*a00 + b1*a10 + b2*a20 + b3*a30;\n\t out[5] = b0*a01 + b1*a11 + b2*a21 + b3*a31;\n\t out[6] = b0*a02 + b1*a12 + b2*a22 + b3*a32;\n\t out[7] = b0*a03 + b1*a13 + b2*a23 + b3*a33;\n\t\n\t b0 = b[8]; b1 = b[9]; b2 = b[10]; b3 = b[11];\n\t out[8] = b0*a00 + b1*a10 + b2*a20 + b3*a30;\n\t out[9] = b0*a01 + b1*a11 + b2*a21 + b3*a31;\n\t out[10] = b0*a02 + b1*a12 + b2*a22 + b3*a32;\n\t out[11] = b0*a03 + b1*a13 + b2*a23 + b3*a33;\n\t\n\t b0 = b[12]; b1 = b[13]; b2 = b[14]; b3 = b[15];\n\t out[12] = b0*a00 + b1*a10 + b2*a20 + b3*a30;\n\t out[13] = b0*a01 + b1*a11 + b2*a21 + b3*a31;\n\t out[14] = b0*a02 + b1*a12 + b2*a22 + b3*a32;\n\t out[15] = b0*a03 + b1*a13 + b2*a23 + b3*a33;\n\t return out;\n\t};\n\t\n\t/**\n\t * Alias for {@link mat4.multiply}\n\t * @function\n\t */\n\tmat4.mul = mat4.multiply;\n\t\n\t/**\n\t * Translate a mat4 by the given vector\n\t *\n\t * @param {mat4} out the receiving matrix\n\t * @param {mat4} a the matrix to translate\n\t * @param {vec3} v vector to translate by\n\t * @returns {mat4} out\n\t */\n\tmat4.translate = function (out, a, v) {\n\t var x = v[0], y = v[1], z = v[2],\n\t a00, a01, a02, a03,\n\t a10, a11, a12, a13,\n\t a20, a21, a22, a23;\n\t\n\t if (a === out) {\n\t out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n\t out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n\t out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n\t out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n\t } else {\n\t a00 = a[0]; a01 = a[1]; a02 = a[2]; a03 = a[3];\n\t a10 = a[4]; a11 = a[5]; a12 = a[6]; a13 = a[7];\n\t a20 = a[8]; a21 = a[9]; a22 = a[10]; a23 = a[11];\n\t\n\t out[0] = a00; out[1] = a01; out[2] = a02; out[3] = a03;\n\t out[4] = a10; out[5] = a11; out[6] = a12; out[7] = a13;\n\t out[8] = a20; out[9] = a21; out[10] = a22; out[11] = a23;\n\t\n\t out[12] = a00 * x + a10 * y + a20 * z + a[12];\n\t out[13] = a01 * x + a11 * y + a21 * z + a[13];\n\t out[14] = a02 * x + a12 * y + a22 * z + a[14];\n\t out[15] = a03 * x + a13 * y + a23 * z + a[15];\n\t }\n\t\n\t return out;\n\t};\n\t\n\t/**\n\t * Scales the mat4 by the dimensions in the given vec3\n\t *\n\t * @param {mat4} out the receiving matrix\n\t * @param {mat4} a the matrix to scale\n\t * @param {vec3} v the vec3 to scale the matrix by\n\t * @returns {mat4} out\n\t **/\n\tmat4.scale = function(out, a, v) {\n\t var x = v[0], y = v[1], z = v[2];\n\t\n\t out[0] = a[0] * x;\n\t out[1] = a[1] * x;\n\t out[2] = a[2] * x;\n\t out[3] = a[3] * x;\n\t out[4] = a[4] * y;\n\t out[5] = a[5] * y;\n\t out[6] = a[6] * y;\n\t out[7] = a[7] * y;\n\t out[8] = a[8] * z;\n\t out[9] = a[9] * z;\n\t out[10] = a[10] * z;\n\t out[11] = a[11] * z;\n\t out[12] = a[12];\n\t out[13] = a[13];\n\t out[14] = a[14];\n\t out[15] = a[15];\n\t return out;\n\t};\n\t\n\t/**\n\t * Rotates a mat4 by the given angle around the given axis\n\t *\n\t * @param {mat4} out the receiving matrix\n\t * @param {mat4} a the matrix to rotate\n\t * @param {Number} rad the angle to rotate the matrix by\n\t * @param {vec3} axis the axis to rotate around\n\t * @returns {mat4} out\n\t */\n\tmat4.rotate = function (out, a, rad, axis) {\n\t var x = axis[0], y = axis[1], z = axis[2],\n\t len = Math.sqrt(x * x + y * y + z * z),\n\t s, c, t,\n\t a00, a01, a02, a03,\n\t a10, a11, a12, a13,\n\t a20, a21, a22, a23,\n\t b00, b01, b02,\n\t b10, b11, b12,\n\t b20, b21, b22;\n\t\n\t if (Math.abs(len) < glMatrix.EPSILON) { return null; }\n\t \n\t len = 1 / len;\n\t x *= len;\n\t y *= len;\n\t z *= len;\n\t\n\t s = Math.sin(rad);\n\t c = Math.cos(rad);\n\t t = 1 - c;\n\t\n\t a00 = a[0]; a01 = a[1]; a02 = a[2]; a03 = a[3];\n\t a10 = a[4]; a11 = a[5]; a12 = a[6]; a13 = a[7];\n\t a20 = a[8]; a21 = a[9]; a22 = a[10]; a23 = a[11];\n\t\n\t // Construct the elements of the rotation matrix\n\t b00 = x * x * t + c; b01 = y * x * t + z * s; b02 = z * x * t - y * s;\n\t b10 = x * y * t - z * s; b11 = y * y * t + c; b12 = z * y * t + x * s;\n\t b20 = x * z * t + y * s; b21 = y * z * t - x * s; b22 = z * z * t + c;\n\t\n\t // Perform rotation-specific matrix multiplication\n\t out[0] = a00 * b00 + a10 * b01 + a20 * b02;\n\t out[1] = a01 * b00 + a11 * b01 + a21 * b02;\n\t out[2] = a02 * b00 + a12 * b01 + a22 * b02;\n\t out[3] = a03 * b00 + a13 * b01 + a23 * b02;\n\t out[4] = a00 * b10 + a10 * b11 + a20 * b12;\n\t out[5] = a01 * b10 + a11 * b11 + a21 * b12;\n\t out[6] = a02 * b10 + a12 * b11 + a22 * b12;\n\t out[7] = a03 * b10 + a13 * b11 + a23 * b12;\n\t out[8] = a00 * b20 + a10 * b21 + a20 * b22;\n\t out[9] = a01 * b20 + a11 * b21 + a21 * b22;\n\t out[10] = a02 * b20 + a12 * b21 + a22 * b22;\n\t out[11] = a03 * b20 + a13 * b21 + a23 * b22;\n\t\n\t if (a !== out) { // If the source and destination differ, copy the unchanged last row\n\t out[12] = a[12];\n\t out[13] = a[13];\n\t out[14] = a[14];\n\t out[15] = a[15];\n\t }\n\t return out;\n\t};\n\t\n\t/**\n\t * Rotates a matrix by the given angle around the X axis\n\t *\n\t * @param {mat4} out the receiving matrix\n\t * @param {mat4} a the matrix to rotate\n\t * @param {Number} rad the angle to rotate the matrix by\n\t * @returns {mat4} out\n\t */\n\tmat4.rotateX = function (out, a, rad) {\n\t var s = Math.sin(rad),\n\t c = Math.cos(rad),\n\t a10 = a[4],\n\t a11 = a[5],\n\t a12 = a[6],\n\t a13 = a[7],\n\t a20 = a[8],\n\t a21 = a[9],\n\t a22 = a[10],\n\t a23 = a[11];\n\t\n\t if (a !== out) { // If the source and destination differ, copy the unchanged rows\n\t out[0] = a[0];\n\t out[1] = a[1];\n\t out[2] = a[2];\n\t out[3] = a[3];\n\t out[12] = a[12];\n\t out[13] = a[13];\n\t out[14] = a[14];\n\t out[15] = a[15];\n\t }\n\t\n\t // Perform axis-specific matrix multiplication\n\t out[4] = a10 * c + a20 * s;\n\t out[5] = a11 * c + a21 * s;\n\t out[6] = a12 * c + a22 * s;\n\t out[7] = a13 * c + a23 * s;\n\t out[8] = a20 * c - a10 * s;\n\t out[9] = a21 * c - a11 * s;\n\t out[10] = a22 * c - a12 * s;\n\t out[11] = a23 * c - a13 * s;\n\t return out;\n\t};\n\t\n\t/**\n\t * Rotates a matrix by the given angle around the Y axis\n\t *\n\t * @param {mat4} out the receiving matrix\n\t * @param {mat4} a the matrix to rotate\n\t * @param {Number} rad the angle to rotate the matrix by\n\t * @returns {mat4} out\n\t */\n\tmat4.rotateY = function (out, a, rad) {\n\t var s = Math.sin(rad),\n\t c = Math.cos(rad),\n\t a00 = a[0],\n\t a01 = a[1],\n\t a02 = a[2],\n\t a03 = a[3],\n\t a20 = a[8],\n\t a21 = a[9],\n\t a22 = a[10],\n\t a23 = a[11];\n\t\n\t if (a !== out) { // If the source and destination differ, copy the unchanged rows\n\t out[4] = a[4];\n\t out[5] = a[5];\n\t out[6] = a[6];\n\t out[7] = a[7];\n\t out[12] = a[12];\n\t out[13] = a[13];\n\t out[14] = a[14];\n\t out[15] = a[15];\n\t }\n\t\n\t // Perform axis-specific matrix multiplication\n\t out[0] = a00 * c - a20 * s;\n\t out[1] = a01 * c - a21 * s;\n\t out[2] = a02 * c - a22 * s;\n\t out[3] = a03 * c - a23 * s;\n\t out[8] = a00 * s + a20 * c;\n\t out[9] = a01 * s + a21 * c;\n\t out[10] = a02 * s + a22 * c;\n\t out[11] = a03 * s + a23 * c;\n\t return out;\n\t};\n\t\n\t/**\n\t * Rotates a matrix by the given angle around the Z axis\n\t *\n\t * @param {mat4} out the receiving matrix\n\t * @param {mat4} a the matrix to rotate\n\t * @param {Number} rad the angle to rotate the matrix by\n\t * @returns {mat4} out\n\t */\n\tmat4.rotateZ = function (out, a, rad) {\n\t var s = Math.sin(rad),\n\t c = Math.cos(rad),\n\t a00 = a[0],\n\t a01 = a[1],\n\t a02 = a[2],\n\t a03 = a[3],\n\t a10 = a[4],\n\t a11 = a[5],\n\t a12 = a[6],\n\t a13 = a[7];\n\t\n\t if (a !== out) { // If the source and destination differ, copy the unchanged last row\n\t out[8] = a[8];\n\t out[9] = a[9];\n\t out[10] = a[10];\n\t out[11] = a[11];\n\t out[12] = a[12];\n\t out[13] = a[13];\n\t out[14] = a[14];\n\t out[15] = a[15];\n\t }\n\t\n\t // Perform axis-specific matrix multiplication\n\t out[0] = a00 * c + a10 * s;\n\t out[1] = a01 * c + a11 * s;\n\t out[2] = a02 * c + a12 * s;\n\t out[3] = a03 * c + a13 * s;\n\t out[4] = a10 * c - a00 * s;\n\t out[5] = a11 * c - a01 * s;\n\t out[6] = a12 * c - a02 * s;\n\t out[7] = a13 * c - a03 * s;\n\t return out;\n\t};\n\t\n\t/**\n\t * Creates a matrix from a vector translation\n\t * This is equivalent to (but much faster than):\n\t *\n\t * mat4.identity(dest);\n\t * mat4.translate(dest, dest, vec);\n\t *\n\t * @param {mat4} out mat4 receiving operation result\n\t * @param {vec3} v Translation vector\n\t * @returns {mat4} out\n\t */\n\tmat4.fromTranslation = function(out, v) {\n\t out[0] = 1;\n\t out[1] = 0;\n\t out[2] = 0;\n\t out[3] = 0;\n\t out[4] = 0;\n\t out[5] = 1;\n\t out[6] = 0;\n\t out[7] = 0;\n\t out[8] = 0;\n\t out[9] = 0;\n\t out[10] = 1;\n\t out[11] = 0;\n\t out[12] = v[0];\n\t out[13] = v[1];\n\t out[14] = v[2];\n\t out[15] = 1;\n\t return out;\n\t}\n\t\n\t/**\n\t * Creates a matrix from a vector scaling\n\t * This is equivalent to (but much faster than):\n\t *\n\t * mat4.identity(dest);\n\t * mat4.scale(dest, dest, vec);\n\t *\n\t * @param {mat4} out mat4 receiving operation result\n\t * @param {vec3} v Scaling vector\n\t * @returns {mat4} out\n\t */\n\tmat4.fromScaling = function(out, v) {\n\t out[0] = v[0];\n\t out[1] = 0;\n\t out[2] = 0;\n\t out[3] = 0;\n\t out[4] = 0;\n\t out[5] = v[1];\n\t out[6] = 0;\n\t out[7] = 0;\n\t out[8] = 0;\n\t out[9] = 0;\n\t out[10] = v[2];\n\t out[11] = 0;\n\t out[12] = 0;\n\t out[13] = 0;\n\t out[14] = 0;\n\t out[15] = 1;\n\t return out;\n\t}\n\t\n\t/**\n\t * Creates a matrix from a given angle around a given axis\n\t * This is equivalent to (but much faster than):\n\t *\n\t * mat4.identity(dest);\n\t * mat4.rotate(dest, dest, rad, axis);\n\t *\n\t * @param {mat4} out mat4 receiving operation result\n\t * @param {Number} rad the angle to rotate the matrix by\n\t * @param {vec3} axis the axis to rotate around\n\t * @returns {mat4} out\n\t */\n\tmat4.fromRotation = function(out, rad, axis) {\n\t var x = axis[0], y = axis[1], z = axis[2],\n\t len = Math.sqrt(x * x + y * y + z * z),\n\t s, c, t;\n\t \n\t if (Math.abs(len) < glMatrix.EPSILON) { return null; }\n\t \n\t len = 1 / len;\n\t x *= len;\n\t y *= len;\n\t z *= len;\n\t \n\t s = Math.sin(rad);\n\t c = Math.cos(rad);\n\t t = 1 - c;\n\t \n\t // Perform rotation-specific matrix multiplication\n\t out[0] = x * x * t + c;\n\t out[1] = y * x * t + z * s;\n\t out[2] = z * x * t - y * s;\n\t out[3] = 0;\n\t out[4] = x * y * t - z * s;\n\t out[5] = y * y * t + c;\n\t out[6] = z * y * t + x * s;\n\t out[7] = 0;\n\t out[8] = x * z * t + y * s;\n\t out[9] = y * z * t - x * s;\n\t out[10] = z * z * t + c;\n\t out[11] = 0;\n\t out[12] = 0;\n\t out[13] = 0;\n\t out[14] = 0;\n\t out[15] = 1;\n\t return out;\n\t}\n\t\n\t/**\n\t * Creates a matrix from the given angle around the X axis\n\t * This is equivalent to (but much faster than):\n\t *\n\t * mat4.identity(dest);\n\t * mat4.rotateX(dest, dest, rad);\n\t *\n\t * @param {mat4} out mat4 receiving operation result\n\t * @param {Number} rad the angle to rotate the matrix by\n\t * @returns {mat4} out\n\t */\n\tmat4.fromXRotation = function(out, rad) {\n\t var s = Math.sin(rad),\n\t c = Math.cos(rad);\n\t \n\t // Perform axis-specific matrix multiplication\n\t out[0] = 1;\n\t out[1] = 0;\n\t out[2] = 0;\n\t out[3] = 0;\n\t out[4] = 0;\n\t out[5] = c;\n\t out[6] = s;\n\t out[7] = 0;\n\t out[8] = 0;\n\t out[9] = -s;\n\t out[10] = c;\n\t out[11] = 0;\n\t out[12] = 0;\n\t out[13] = 0;\n\t out[14] = 0;\n\t out[15] = 1;\n\t return out;\n\t}\n\t\n\t/**\n\t * Creates a matrix from the given angle around the Y axis\n\t * This is equivalent to (but much faster than):\n\t *\n\t * mat4.identity(dest);\n\t * mat4.rotateY(dest, dest, rad);\n\t *\n\t * @param {mat4} out mat4 receiving operation result\n\t * @param {Number} rad the angle to rotate the matrix by\n\t * @returns {mat4} out\n\t */\n\tmat4.fromYRotation = function(out, rad) {\n\t var s = Math.sin(rad),\n\t c = Math.cos(rad);\n\t \n\t // Perform axis-specific matrix multiplication\n\t out[0] = c;\n\t out[1] = 0;\n\t out[2] = -s;\n\t out[3] = 0;\n\t out[4] = 0;\n\t out[5] = 1;\n\t out[6] = 0;\n\t out[7] = 0;\n\t out[8] = s;\n\t out[9] = 0;\n\t out[10] = c;\n\t out[11] = 0;\n\t out[12] = 0;\n\t out[13] = 0;\n\t out[14] = 0;\n\t out[15] = 1;\n\t return out;\n\t}\n\t\n\t/**\n\t * Creates a matrix from the given angle around the Z axis\n\t * This is equivalent to (but much faster than):\n\t *\n\t * mat4.identity(dest);\n\t * mat4.rotateZ(dest, dest, rad);\n\t *\n\t * @param {mat4} out mat4 receiving operation result\n\t * @param {Number} rad the angle to rotate the matrix by\n\t * @returns {mat4} out\n\t */\n\tmat4.fromZRotation = function(out, rad) {\n\t var s = Math.sin(rad),\n\t c = Math.cos(rad);\n\t \n\t // Perform axis-specific matrix multiplication\n\t out[0] = c;\n\t out[1] = s;\n\t out[2] = 0;\n\t out[3] = 0;\n\t out[4] = -s;\n\t out[5] = c;\n\t out[6] = 0;\n\t out[7] = 0;\n\t out[8] = 0;\n\t out[9] = 0;\n\t out[10] = 1;\n\t out[11] = 0;\n\t out[12] = 0;\n\t out[13] = 0;\n\t out[14] = 0;\n\t out[15] = 1;\n\t return out;\n\t}\n\t\n\t/**\n\t * Creates a matrix from a quaternion rotation and vector translation\n\t * This is equivalent to (but much faster than):\n\t *\n\t * mat4.identity(dest);\n\t * mat4.translate(dest, vec);\n\t * var quatMat = mat4.create();\n\t * quat4.toMat4(quat, quatMat);\n\t * mat4.multiply(dest, quatMat);\n\t *\n\t * @param {mat4} out mat4 receiving operation result\n\t * @param {quat4} q Rotation quaternion\n\t * @param {vec3} v Translation vector\n\t * @returns {mat4} out\n\t */\n\tmat4.fromRotationTranslation = function (out, q, v) {\n\t // Quaternion math\n\t var x = q[0], y = q[1], z = q[2], w = q[3],\n\t x2 = x + x,\n\t y2 = y + y,\n\t z2 = z + z,\n\t\n\t xx = x * x2,\n\t xy = x * y2,\n\t xz = x * z2,\n\t yy = y * y2,\n\t yz = y * z2,\n\t zz = z * z2,\n\t wx = w * x2,\n\t wy = w * y2,\n\t wz = w * z2;\n\t\n\t out[0] = 1 - (yy + zz);\n\t out[1] = xy + wz;\n\t out[2] = xz - wy;\n\t out[3] = 0;\n\t out[4] = xy - wz;\n\t out[5] = 1 - (xx + zz);\n\t out[6] = yz + wx;\n\t out[7] = 0;\n\t out[8] = xz + wy;\n\t out[9] = yz - wx;\n\t out[10] = 1 - (xx + yy);\n\t out[11] = 0;\n\t out[12] = v[0];\n\t out[13] = v[1];\n\t out[14] = v[2];\n\t out[15] = 1;\n\t \n\t return out;\n\t};\n\t\n\t/**\n\t * Creates a matrix from a quaternion rotation, vector translation and vector scale\n\t * This is equivalent to (but much faster than):\n\t *\n\t * mat4.identity(dest);\n\t * mat4.translate(dest, vec);\n\t * var quatMat = mat4.create();\n\t * quat4.toMat4(quat, quatMat);\n\t * mat4.multiply(dest, quatMat);\n\t * mat4.scale(dest, scale)\n\t *\n\t * @param {mat4} out mat4 receiving operation result\n\t * @param {quat4} q Rotation quaternion\n\t * @param {vec3} v Translation vector\n\t * @param {vec3} s Scaling vector\n\t * @returns {mat4} out\n\t */\n\tmat4.fromRotationTranslationScale = function (out, q, v, s) {\n\t // Quaternion math\n\t var x = q[0], y = q[1], z = q[2], w = q[3],\n\t x2 = x + x,\n\t y2 = y + y,\n\t z2 = z + z,\n\t\n\t xx = x * x2,\n\t xy = x * y2,\n\t xz = x * z2,\n\t yy = y * y2,\n\t yz = y * z2,\n\t zz = z * z2,\n\t wx = w * x2,\n\t wy = w * y2,\n\t wz = w * z2,\n\t sx = s[0],\n\t sy = s[1],\n\t sz = s[2];\n\t\n\t out[0] = (1 - (yy + zz)) * sx;\n\t out[1] = (xy + wz) * sx;\n\t out[2] = (xz - wy) * sx;\n\t out[3] = 0;\n\t out[4] = (xy - wz) * sy;\n\t out[5] = (1 - (xx + zz)) * sy;\n\t out[6] = (yz + wx) * sy;\n\t out[7] = 0;\n\t out[8] = (xz + wy) * sz;\n\t out[9] = (yz - wx) * sz;\n\t out[10] = (1 - (xx + yy)) * sz;\n\t out[11] = 0;\n\t out[12] = v[0];\n\t out[13] = v[1];\n\t out[14] = v[2];\n\t out[15] = 1;\n\t \n\t return out;\n\t};\n\t\n\t/**\n\t * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\n\t * This is equivalent to (but much faster than):\n\t *\n\t * mat4.identity(dest);\n\t * mat4.translate(dest, vec);\n\t * mat4.translate(dest, origin);\n\t * var quatMat = mat4.create();\n\t * quat4.toMat4(quat, quatMat);\n\t * mat4.multiply(dest, quatMat);\n\t * mat4.scale(dest, scale)\n\t * mat4.translate(dest, negativeOrigin);\n\t *\n\t * @param {mat4} out mat4 receiving operation result\n\t * @param {quat4} q Rotation quaternion\n\t * @param {vec3} v Translation vector\n\t * @param {vec3} s Scaling vector\n\t * @param {vec3} o The origin vector around which to scale and rotate\n\t * @returns {mat4} out\n\t */\n\tmat4.fromRotationTranslationScaleOrigin = function (out, q, v, s, o) {\n\t // Quaternion math\n\t var x = q[0], y = q[1], z = q[2], w = q[3],\n\t x2 = x + x,\n\t y2 = y + y,\n\t z2 = z + z,\n\t\n\t xx = x * x2,\n\t xy = x * y2,\n\t xz = x * z2,\n\t yy = y * y2,\n\t yz = y * z2,\n\t zz = z * z2,\n\t wx = w * x2,\n\t wy = w * y2,\n\t wz = w * z2,\n\t \n\t sx = s[0],\n\t sy = s[1],\n\t sz = s[2],\n\t\n\t ox = o[0],\n\t oy = o[1],\n\t oz = o[2];\n\t \n\t out[0] = (1 - (yy + zz)) * sx;\n\t out[1] = (xy + wz) * sx;\n\t out[2] = (xz - wy) * sx;\n\t out[3] = 0;\n\t out[4] = (xy - wz) * sy;\n\t out[5] = (1 - (xx + zz)) * sy;\n\t out[6] = (yz + wx) * sy;\n\t out[7] = 0;\n\t out[8] = (xz + wy) * sz;\n\t out[9] = (yz - wx) * sz;\n\t out[10] = (1 - (xx + yy)) * sz;\n\t out[11] = 0;\n\t out[12] = v[0] + ox - (out[0] * ox + out[4] * oy + out[8] * oz);\n\t out[13] = v[1] + oy - (out[1] * ox + out[5] * oy + out[9] * oz);\n\t out[14] = v[2] + oz - (out[2] * ox + out[6] * oy + out[10] * oz);\n\t out[15] = 1;\n\t \n\t return out;\n\t};\n\t\n\tmat4.fromQuat = function (out, q) {\n\t var x = q[0], y = q[1], z = q[2], w = q[3],\n\t x2 = x + x,\n\t y2 = y + y,\n\t z2 = z + z,\n\t\n\t xx = x * x2,\n\t yx = y * x2,\n\t yy = y * y2,\n\t zx = z * x2,\n\t zy = z * y2,\n\t zz = z * z2,\n\t wx = w * x2,\n\t wy = w * y2,\n\t wz = w * z2;\n\t\n\t out[0] = 1 - yy - zz;\n\t out[1] = yx + wz;\n\t out[2] = zx - wy;\n\t out[3] = 0;\n\t\n\t out[4] = yx - wz;\n\t out[5] = 1 - xx - zz;\n\t out[6] = zy + wx;\n\t out[7] = 0;\n\t\n\t out[8] = zx + wy;\n\t out[9] = zy - wx;\n\t out[10] = 1 - xx - yy;\n\t out[11] = 0;\n\t\n\t out[12] = 0;\n\t out[13] = 0;\n\t out[14] = 0;\n\t out[15] = 1;\n\t\n\t return out;\n\t};\n\t\n\t/**\n\t * Generates a frustum matrix with the given bounds\n\t *\n\t * @param {mat4} out mat4 frustum matrix will be written into\n\t * @param {Number} left Left bound of the frustum\n\t * @param {Number} right Right bound of the frustum\n\t * @param {Number} bottom Bottom bound of the frustum\n\t * @param {Number} top Top bound of the frustum\n\t * @param {Number} near Near bound of the frustum\n\t * @param {Number} far Far bound of the frustum\n\t * @returns {mat4} out\n\t */\n\tmat4.frustum = function (out, left, right, bottom, top, near, far) {\n\t var rl = 1 / (right - left),\n\t tb = 1 / (top - bottom),\n\t nf = 1 / (near - far);\n\t out[0] = (near * 2) * rl;\n\t out[1] = 0;\n\t out[2] = 0;\n\t out[3] = 0;\n\t out[4] = 0;\n\t out[5] = (near * 2) * tb;\n\t out[6] = 0;\n\t out[7] = 0;\n\t out[8] = (right + left) * rl;\n\t out[9] = (top + bottom) * tb;\n\t out[10] = (far + near) * nf;\n\t out[11] = -1;\n\t out[12] = 0;\n\t out[13] = 0;\n\t out[14] = (far * near * 2) * nf;\n\t out[15] = 0;\n\t return out;\n\t};\n\t\n\t/**\n\t * Generates a perspective projection matrix with the given bounds\n\t *\n\t * @param {mat4} out mat4 frustum matrix will be written into\n\t * @param {number} fovy Vertical field of view in radians\n\t * @param {number} aspect Aspect ratio. typically viewport width/height\n\t * @param {number} near Near bound of the frustum\n\t * @param {number} far Far bound of the frustum\n\t * @returns {mat4} out\n\t */\n\tmat4.perspective = function (out, fovy, aspect, near, far) {\n\t var f = 1.0 / Math.tan(fovy / 2),\n\t nf = 1 / (near - far);\n\t out[0] = f / aspect;\n\t out[1] = 0;\n\t out[2] = 0;\n\t out[3] = 0;\n\t out[4] = 0;\n\t out[5] = f;\n\t out[6] = 0;\n\t out[7] = 0;\n\t out[8] = 0;\n\t out[9] = 0;\n\t out[10] = (far + near) * nf;\n\t out[11] = -1;\n\t out[12] = 0;\n\t out[13] = 0;\n\t out[14] = (2 * far * near) * nf;\n\t out[15] = 0;\n\t return out;\n\t};\n\t\n\t/**\n\t * Generates a perspective projection matrix with the given field of view.\n\t * This is primarily useful for generating projection matrices to be used\n\t * with the still experiemental WebVR API.\n\t *\n\t * @param {mat4} out mat4 frustum matrix will be written into\n\t * @param {number} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\n\t * @param {number} near Near bound of the frustum\n\t * @param {number} far Far bound of the frustum\n\t * @returns {mat4} out\n\t */\n\tmat4.perspectiveFromFieldOfView = function (out, fov, near, far) {\n\t var upTan = Math.tan(fov.upDegrees * Math.PI/180.0),\n\t downTan = Math.tan(fov.downDegrees * Math.PI/180.0),\n\t leftTan = Math.tan(fov.leftDegrees * Math.PI/180.0),\n\t rightTan = Math.tan(fov.rightDegrees * Math.PI/180.0),\n\t xScale = 2.0 / (leftTan + rightTan),\n\t yScale = 2.0 / (upTan + downTan);\n\t\n\t out[0] = xScale;\n\t out[1] = 0.0;\n\t out[2] = 0.0;\n\t out[3] = 0.0;\n\t out[4] = 0.0;\n\t out[5] = yScale;\n\t out[6] = 0.0;\n\t out[7] = 0.0;\n\t out[8] = -((leftTan - rightTan) * xScale * 0.5);\n\t out[9] = ((upTan - downTan) * yScale * 0.5);\n\t out[10] = far / (near - far);\n\t out[11] = -1.0;\n\t out[12] = 0.0;\n\t out[13] = 0.0;\n\t out[14] = (far * near) / (near - far);\n\t out[15] = 0.0;\n\t return out;\n\t}\n\t\n\t/**\n\t * Generates a orthogonal projection matrix with the given bounds\n\t *\n\t * @param {mat4} out mat4 frustum matrix will be written into\n\t * @param {number} left Left bound of the frustum\n\t * @param {number} right Right bound of the frustum\n\t * @param {number} bottom Bottom bound of the frustum\n\t * @param {number} top Top bound of the frustum\n\t * @param {number} near Near bound of the frustum\n\t * @param {number} far Far bound of the frustum\n\t * @returns {mat4} out\n\t */\n\tmat4.ortho = function (out, left, right, bottom, top, near, far) {\n\t var lr = 1 / (left - right),\n\t bt = 1 / (bottom - top),\n\t nf = 1 / (near - far);\n\t out[0] = -2 * lr;\n\t out[1] = 0;\n\t out[2] = 0;\n\t out[3] = 0;\n\t out[4] = 0;\n\t out[5] = -2 * bt;\n\t out[6] = 0;\n\t out[7] = 0;\n\t out[8] = 0;\n\t out[9] = 0;\n\t out[10] = 2 * nf;\n\t out[11] = 0;\n\t out[12] = (left + right) * lr;\n\t out[13] = (top + bottom) * bt;\n\t out[14] = (far + near) * nf;\n\t out[15] = 1;\n\t return out;\n\t};\n\t\n\t/**\n\t * Generates a look-at matrix with the given eye position, focal point, and up axis\n\t *\n\t * @param {mat4} out mat4 frustum matrix will be written into\n\t * @param {vec3} eye Position of the viewer\n\t * @param {vec3} center Point the viewer is looking at\n\t * @param {vec3} up vec3 pointing up\n\t * @returns {mat4} out\n\t */\n\tmat4.lookAt = function (out, eye, center, up) {\n\t var x0, x1, x2, y0, y1, y2, z0, z1, z2, len,\n\t eyex = eye[0],\n\t eyey = eye[1],\n\t eyez = eye[2],\n\t upx = up[0],\n\t upy = up[1],\n\t upz = up[2],\n\t centerx = center[0],\n\t centery = center[1],\n\t centerz = center[2];\n\t\n\t if (Math.abs(eyex - centerx) < glMatrix.EPSILON &&\n\t Math.abs(eyey - centery) < glMatrix.EPSILON &&\n\t Math.abs(eyez - centerz) < glMatrix.EPSILON) {\n\t return mat4.identity(out);\n\t }\n\t\n\t z0 = eyex - centerx;\n\t z1 = eyey - centery;\n\t z2 = eyez - centerz;\n\t\n\t len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\n\t z0 *= len;\n\t z1 *= len;\n\t z2 *= len;\n\t\n\t x0 = upy * z2 - upz * z1;\n\t x1 = upz * z0 - upx * z2;\n\t x2 = upx * z1 - upy * z0;\n\t len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\n\t if (!len) {\n\t x0 = 0;\n\t x1 = 0;\n\t x2 = 0;\n\t } else {\n\t len = 1 / len;\n\t x0 *= len;\n\t x1 *= len;\n\t x2 *= len;\n\t }\n\t\n\t y0 = z1 * x2 - z2 * x1;\n\t y1 = z2 * x0 - z0 * x2;\n\t y2 = z0 * x1 - z1 * x0;\n\t\n\t len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\n\t if (!len) {\n\t y0 = 0;\n\t y1 = 0;\n\t y2 = 0;\n\t } else {\n\t len = 1 / len;\n\t y0 *= len;\n\t y1 *= len;\n\t y2 *= len;\n\t }\n\t\n\t out[0] = x0;\n\t out[1] = y0;\n\t out[2] = z0;\n\t out[3] = 0;\n\t out[4] = x1;\n\t out[5] = y1;\n\t out[6] = z1;\n\t out[7] = 0;\n\t out[8] = x2;\n\t out[9] = y2;\n\t out[10] = z2;\n\t out[11] = 0;\n\t out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n\t out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n\t out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n\t out[15] = 1;\n\t\n\t return out;\n\t};\n\t\n\t/**\n\t * Returns a string representation of a mat4\n\t *\n\t * @param {mat4} mat matrix to represent as a string\n\t * @returns {String} string representation of the matrix\n\t */\n\tmat4.str = function (a) {\n\t return 'mat4(' + a[0] + ', ' + a[1] + ', ' + a[2] + ', ' + a[3] + ', ' +\n\t a[4] + ', ' + a[5] + ', ' + a[6] + ', ' + a[7] + ', ' +\n\t a[8] + ', ' + a[9] + ', ' + a[10] + ', ' + a[11] + ', ' + \n\t a[12] + ', ' + a[13] + ', ' + a[14] + ', ' + a[15] + ')';\n\t};\n\t\n\t/**\n\t * Returns Frobenius norm of a mat4\n\t *\n\t * @param {mat4} a the matrix to calculate Frobenius norm of\n\t * @returns {Number} Frobenius norm\n\t */\n\tmat4.frob = function (a) {\n\t return(Math.sqrt(Math.pow(a[0], 2) + Math.pow(a[1], 2) + Math.pow(a[2], 2) + Math.pow(a[3], 2) + Math.pow(a[4], 2) + Math.pow(a[5], 2) + Math.pow(a[6], 2) + Math.pow(a[7], 2) + Math.pow(a[8], 2) + Math.pow(a[9], 2) + Math.pow(a[10], 2) + Math.pow(a[11], 2) + Math.pow(a[12], 2) + Math.pow(a[13], 2) + Math.pow(a[14], 2) + Math.pow(a[15], 2) ))\n\t};\n\t\n\t\n\tmodule.exports = mat4;\n\n\n/***/ },\n/* 15 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.\n\t\n\tPermission is hereby granted, free of charge, to any person obtaining a copy\n\tof this software and associated documentation files (the \"Software\"), to deal\n\tin the Software without restriction, including without limitation the rights\n\tto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\tcopies of the Software, and to permit persons to whom the Software is\n\tfurnished to do so, subject to the following conditions:\n\t\n\tThe above copyright notice and this permission notice shall be included in\n\tall copies or substantial portions of the Software.\n\t\n\tTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\tIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\tFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\tAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\tLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\tOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\tTHE SOFTWARE. */\n\t\n\tvar glMatrix = __webpack_require__(10);\n\tvar mat3 = __webpack_require__(13);\n\tvar vec3 = __webpack_require__(16);\n\tvar vec4 = __webpack_require__(17);\n\t\n\t/**\n\t * @class Quaternion\n\t * @name quat\n\t */\n\tvar quat = {};\n\t\n\t/**\n\t * Creates a new identity quat\n\t *\n\t * @returns {quat} a new quaternion\n\t */\n\tquat.create = function() {\n\t var out = new glMatrix.ARRAY_TYPE(4);\n\t out[0] = 0;\n\t out[1] = 0;\n\t out[2] = 0;\n\t out[3] = 1;\n\t return out;\n\t};\n\t\n\t/**\n\t * Sets a quaternion to represent the shortest rotation from one\n\t * vector to another.\n\t *\n\t * Both vectors are assumed to be unit length.\n\t *\n\t * @param {quat} out the receiving quaternion.\n\t * @param {vec3} a the initial vector\n\t * @param {vec3} b the destination vector\n\t * @returns {quat} out\n\t */\n\tquat.rotationTo = (function() {\n\t var tmpvec3 = vec3.create();\n\t var xUnitVec3 = vec3.fromValues(1,0,0);\n\t var yUnitVec3 = vec3.fromValues(0,1,0);\n\t\n\t return function(out, a, b) {\n\t var dot = vec3.dot(a, b);\n\t if (dot < -0.999999) {\n\t vec3.cross(tmpvec3, xUnitVec3, a);\n\t if (vec3.length(tmpvec3) < 0.000001)\n\t vec3.cross(tmpvec3, yUnitVec3, a);\n\t vec3.normalize(tmpvec3, tmpvec3);\n\t quat.setAxisAngle(out, tmpvec3, Math.PI);\n\t return out;\n\t } else if (dot > 0.999999) {\n\t out[0] = 0;\n\t out[1] = 0;\n\t out[2] = 0;\n\t out[3] = 1;\n\t return out;\n\t } else {\n\t vec3.cross(tmpvec3, a, b);\n\t out[0] = tmpvec3[0];\n\t out[1] = tmpvec3[1];\n\t out[2] = tmpvec3[2];\n\t out[3] = 1 + dot;\n\t return quat.normalize(out, out);\n\t }\n\t };\n\t})();\n\t\n\t/**\n\t * Sets the specified quaternion with values corresponding to the given\n\t * axes. Each axis is a vec3 and is expected to be unit length and\n\t * perpendicular to all other specified axes.\n\t *\n\t * @param {vec3} view the vector representing the viewing direction\n\t * @param {vec3} right the vector representing the local \"right\" direction\n\t * @param {vec3} up the vector representing the local \"up\" direction\n\t * @returns {quat} out\n\t */\n\tquat.setAxes = (function() {\n\t var matr = mat3.create();\n\t\n\t return function(out, view, right, up) {\n\t matr[0] = right[0];\n\t matr[3] = right[1];\n\t matr[6] = right[2];\n\t\n\t matr[1] = up[0];\n\t matr[4] = up[1];\n\t matr[7] = up[2];\n\t\n\t matr[2] = -view[0];\n\t matr[5] = -view[1];\n\t matr[8] = -view[2];\n\t\n\t return quat.normalize(out, quat.fromMat3(out, matr));\n\t };\n\t})();\n\t\n\t/**\n\t * Creates a new quat initialized with values from an existing quaternion\n\t *\n\t * @param {quat} a quaternion to clone\n\t * @returns {quat} a new quaternion\n\t * @function\n\t */\n\tquat.clone = vec4.clone;\n\t\n\t/**\n\t * Creates a new quat initialized with the given values\n\t *\n\t * @param {Number} x X component\n\t * @param {Number} y Y component\n\t * @param {Number} z Z component\n\t * @param {Number} w W component\n\t * @returns {quat} a new quaternion\n\t * @function\n\t */\n\tquat.fromValues = vec4.fromValues;\n\t\n\t/**\n\t * Copy the values from one quat to another\n\t *\n\t * @param {quat} out the receiving quaternion\n\t * @param {quat} a the source quaternion\n\t * @returns {quat} out\n\t * @function\n\t */\n\tquat.copy = vec4.copy;\n\t\n\t/**\n\t * Set the components of a quat to the given values\n\t *\n\t * @param {quat} out the receiving quaternion\n\t * @param {Number} x X component\n\t * @param {Number} y Y component\n\t * @param {Number} z Z component\n\t * @param {Number} w W component\n\t * @returns {quat} out\n\t * @function\n\t */\n\tquat.set = vec4.set;\n\t\n\t/**\n\t * Set a quat to the identity quaternion\n\t *\n\t * @param {quat} out the receiving quaternion\n\t * @returns {quat} out\n\t */\n\tquat.identity = function(out) {\n\t out[0] = 0;\n\t out[1] = 0;\n\t out[2] = 0;\n\t out[3] = 1;\n\t return out;\n\t};\n\t\n\t/**\n\t * Sets a quat from the given angle and rotation axis,\n\t * then returns it.\n\t *\n\t * @param {quat} out the receiving quaternion\n\t * @param {vec3} axis the axis around which to rotate\n\t * @param {Number} rad the angle in radians\n\t * @returns {quat} out\n\t **/\n\tquat.setAxisAngle = function(out, axis, rad) {\n\t rad = rad * 0.5;\n\t var s = Math.sin(rad);\n\t out[0] = s * axis[0];\n\t out[1] = s * axis[1];\n\t out[2] = s * axis[2];\n\t out[3] = Math.cos(rad);\n\t return out;\n\t};\n\t\n\t/**\n\t * Adds two quat's\n\t *\n\t * @param {quat} out the receiving quaternion\n\t * @param {quat} a the first operand\n\t * @param {quat} b the second operand\n\t * @returns {quat} out\n\t * @function\n\t */\n\tquat.add = vec4.add;\n\t\n\t/**\n\t * Multiplies two quat's\n\t *\n\t * @param {quat} out the receiving quaternion\n\t * @param {quat} a the first operand\n\t * @param {quat} b the second operand\n\t * @returns {quat} out\n\t */\n\tquat.multiply = function(out, a, b) {\n\t var ax = a[0], ay = a[1], az = a[2], aw = a[3],\n\t bx = b[0], by = b[1], bz = b[2], bw = b[3];\n\t\n\t out[0] = ax * bw + aw * bx + ay * bz - az * by;\n\t out[1] = ay * bw + aw * by + az * bx - ax * bz;\n\t out[2] = az * bw + aw * bz + ax * by - ay * bx;\n\t out[3] = aw * bw - ax * bx - ay * by - az * bz;\n\t return out;\n\t};\n\t\n\t/**\n\t * Alias for {@link quat.multiply}\n\t * @function\n\t */\n\tquat.mul = quat.multiply;\n\t\n\t/**\n\t * Scales a quat by a scalar number\n\t *\n\t * @param {quat} out the receiving vector\n\t * @param {quat} a the vector to scale\n\t * @param {Number} b amount to scale the vector by\n\t * @returns {quat} out\n\t * @function\n\t */\n\tquat.scale = vec4.scale;\n\t\n\t/**\n\t * Rotates a quaternion by the given angle about the X axis\n\t *\n\t * @param {quat} out quat receiving operation result\n\t * @param {quat} a quat to rotate\n\t * @param {number} rad angle (in radians) to rotate\n\t * @returns {quat} out\n\t */\n\tquat.rotateX = function (out, a, rad) {\n\t rad *= 0.5; \n\t\n\t var ax = a[0], ay = a[1], az = a[2], aw = a[3],\n\t bx = Math.sin(rad), bw = Math.cos(rad);\n\t\n\t out[0] = ax * bw + aw * bx;\n\t out[1] = ay * bw + az * bx;\n\t out[2] = az * bw - ay * bx;\n\t out[3] = aw * bw - ax * bx;\n\t return out;\n\t};\n\t\n\t/**\n\t * Rotates a quaternion by the given angle about the Y axis\n\t *\n\t * @param {quat} out quat receiving operation result\n\t * @param {quat} a quat to rotate\n\t * @param {number} rad angle (in radians) to rotate\n\t * @returns {quat} out\n\t */\n\tquat.rotateY = function (out, a, rad) {\n\t rad *= 0.5; \n\t\n\t var ax = a[0], ay = a[1], az = a[2], aw = a[3],\n\t by = Math.sin(rad), bw = Math.cos(rad);\n\t\n\t out[0] = ax * bw - az * by;\n\t out[1] = ay * bw + aw * by;\n\t out[2] = az * bw + ax * by;\n\t out[3] = aw * bw - ay * by;\n\t return out;\n\t};\n\t\n\t/**\n\t * Rotates a quaternion by the given angle about the Z axis\n\t *\n\t * @param {quat} out quat receiving operation result\n\t * @param {quat} a quat to rotate\n\t * @param {number} rad angle (in radians) to rotate\n\t * @returns {quat} out\n\t */\n\tquat.rotateZ = function (out, a, rad) {\n\t rad *= 0.5; \n\t\n\t var ax = a[0], ay = a[1], az = a[2], aw = a[3],\n\t bz = Math.sin(rad), bw = Math.cos(rad);\n\t\n\t out[0] = ax * bw + ay * bz;\n\t out[1] = ay * bw - ax * bz;\n\t out[2] = az * bw + aw * bz;\n\t out[3] = aw * bw - az * bz;\n\t return out;\n\t};\n\t\n\t/**\n\t * Calculates the W component of a quat from the X, Y, and Z components.\n\t * Assumes that quaternion is 1 unit in length.\n\t * Any existing W component will be ignored.\n\t *\n\t * @param {quat} out the receiving quaternion\n\t * @param {quat} a quat to calculate W component of\n\t * @returns {quat} out\n\t */\n\tquat.calculateW = function (out, a) {\n\t var x = a[0], y = a[1], z = a[2];\n\t\n\t out[0] = x;\n\t out[1] = y;\n\t out[2] = z;\n\t out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\n\t return out;\n\t};\n\t\n\t/**\n\t * Calculates the dot product of two quat's\n\t *\n\t * @param {quat} a the first operand\n\t * @param {quat} b the second operand\n\t * @returns {Number} dot product of a and b\n\t * @function\n\t */\n\tquat.dot = vec4.dot;\n\t\n\t/**\n\t * Performs a linear interpolation between two quat's\n\t *\n\t * @param {quat} out the receiving quaternion\n\t * @param {quat} a the first operand\n\t * @param {quat} b the second operand\n\t * @param {Number} t interpolation amount between the two inputs\n\t * @returns {quat} out\n\t * @function\n\t */\n\tquat.lerp = vec4.lerp;\n\t\n\t/**\n\t * Performs a spherical linear interpolation between two quat\n\t *\n\t * @param {quat} out the receiving quaternion\n\t * @param {quat} a the first operand\n\t * @param {quat} b the second operand\n\t * @param {Number} t interpolation amount between the two inputs\n\t * @returns {quat} out\n\t */\n\tquat.slerp = function (out, a, b, t) {\n\t // benchmarks:\n\t // http://jsperf.com/quaternion-slerp-implementations\n\t\n\t var ax = a[0], ay = a[1], az = a[2], aw = a[3],\n\t bx = b[0], by = b[1], bz = b[2], bw = b[3];\n\t\n\t var omega, cosom, sinom, scale0, scale1;\n\t\n\t // calc cosine\n\t cosom = ax * bx + ay * by + az * bz + aw * bw;\n\t // adjust signs (if necessary)\n\t if ( cosom < 0.0 ) {\n\t cosom = -cosom;\n\t bx = - bx;\n\t by = - by;\n\t bz = - bz;\n\t bw = - bw;\n\t }\n\t // calculate coefficients\n\t if ( (1.0 - cosom) > 0.000001 ) {\n\t // standard case (slerp)\n\t omega = Math.acos(cosom);\n\t sinom = Math.sin(omega);\n\t scale0 = Math.sin((1.0 - t) * omega) / sinom;\n\t scale1 = Math.sin(t * omega) / sinom;\n\t } else { \n\t // \"from\" and \"to\" quaternions are very close \n\t // ... so we can do a linear interpolation\n\t scale0 = 1.0 - t;\n\t scale1 = t;\n\t }\n\t // calculate final values\n\t out[0] = scale0 * ax + scale1 * bx;\n\t out[1] = scale0 * ay + scale1 * by;\n\t out[2] = scale0 * az + scale1 * bz;\n\t out[3] = scale0 * aw + scale1 * bw;\n\t \n\t return out;\n\t};\n\t\n\t/**\n\t * Performs a spherical linear interpolation with two control points\n\t *\n\t * @param {quat} out the receiving quaternion\n\t * @param {quat} a the first operand\n\t * @param {quat} b the second operand\n\t * @param {quat} c the third operand\n\t * @param {quat} d the fourth operand\n\t * @param {Number} t interpolation amount\n\t * @returns {quat} out\n\t */\n\tquat.sqlerp = (function () {\n\t var temp1 = quat.create();\n\t var temp2 = quat.create();\n\t \n\t return function (out, a, b, c, d, t) {\n\t quat.slerp(temp1, a, d, t);\n\t quat.slerp(temp2, b, c, t);\n\t quat.slerp(out, temp1, temp2, 2 * t * (1 - t));\n\t \n\t return out;\n\t };\n\t}());\n\t\n\t/**\n\t * Calculates the inverse of a quat\n\t *\n\t * @param {quat} out the receiving quaternion\n\t * @param {quat} a quat to calculate inverse of\n\t * @returns {quat} out\n\t */\n\tquat.invert = function(out, a) {\n\t var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3],\n\t dot = a0*a0 + a1*a1 + a2*a2 + a3*a3,\n\t invDot = dot ? 1.0/dot : 0;\n\t \n\t // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\n\t\n\t out[0] = -a0*invDot;\n\t out[1] = -a1*invDot;\n\t out[2] = -a2*invDot;\n\t out[3] = a3*invDot;\n\t return out;\n\t};\n\t\n\t/**\n\t * Calculates the conjugate of a quat\n\t * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\n\t *\n\t * @param {quat} out the receiving quaternion\n\t * @param {quat} a quat to calculate conjugate of\n\t * @returns {quat} out\n\t */\n\tquat.conjugate = function (out, a) {\n\t out[0] = -a[0];\n\t out[1] = -a[1];\n\t out[2] = -a[2];\n\t out[3] = a[3];\n\t return out;\n\t};\n\t\n\t/**\n\t * Calculates the length of a quat\n\t *\n\t * @param {quat} a vector to calculate length of\n\t * @returns {Number} length of a\n\t * @function\n\t */\n\tquat.length = vec4.length;\n\t\n\t/**\n\t * Alias for {@link quat.length}\n\t * @function\n\t */\n\tquat.len = quat.length;\n\t\n\t/**\n\t * Calculates the squared length of a quat\n\t *\n\t * @param {quat} a vector to calculate squared length of\n\t * @returns {Number} squared length of a\n\t * @function\n\t */\n\tquat.squaredLength = vec4.squaredLength;\n\t\n\t/**\n\t * Alias for {@link quat.squaredLength}\n\t * @function\n\t */\n\tquat.sqrLen = quat.squaredLength;\n\t\n\t/**\n\t * Normalize a quat\n\t *\n\t * @param {quat} out the receiving quaternion\n\t * @param {quat} a quaternion to normalize\n\t * @returns {quat} out\n\t * @function\n\t */\n\tquat.normalize = vec4.normalize;\n\t\n\t/**\n\t * Creates a quaternion from the given 3x3 rotation matrix.\n\t *\n\t * NOTE: The resultant quaternion is not normalized, so you should be sure\n\t * to renormalize the quaternion yourself where necessary.\n\t *\n\t * @param {quat} out the receiving quaternion\n\t * @param {mat3} m rotation matrix\n\t * @returns {quat} out\n\t * @function\n\t */\n\tquat.fromMat3 = function(out, m) {\n\t // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\n\t // article \"Quaternion Calculus and Fast Animation\".\n\t var fTrace = m[0] + m[4] + m[8];\n\t var fRoot;\n\t\n\t if ( fTrace > 0.0 ) {\n\t // |w| > 1/2, may as well choose w > 1/2\n\t fRoot = Math.sqrt(fTrace + 1.0); // 2w\n\t out[3] = 0.5 * fRoot;\n\t fRoot = 0.5/fRoot; // 1/(4w)\n\t out[0] = (m[5]-m[7])*fRoot;\n\t out[1] = (m[6]-m[2])*fRoot;\n\t out[2] = (m[1]-m[3])*fRoot;\n\t } else {\n\t // |w| <= 1/2\n\t var i = 0;\n\t if ( m[4] > m[0] )\n\t i = 1;\n\t if ( m[8] > m[i*3+i] )\n\t i = 2;\n\t var j = (i+1)%3;\n\t var k = (i+2)%3;\n\t \n\t fRoot = Math.sqrt(m[i*3+i]-m[j*3+j]-m[k*3+k] + 1.0);\n\t out[i] = 0.5 * fRoot;\n\t fRoot = 0.5 / fRoot;\n\t out[3] = (m[j*3+k] - m[k*3+j]) * fRoot;\n\t out[j] = (m[j*3+i] + m[i*3+j]) * fRoot;\n\t out[k] = (m[k*3+i] + m[i*3+k]) * fRoot;\n\t }\n\t \n\t return out;\n\t};\n\t\n\t/**\n\t * Returns a string representation of a quatenion\n\t *\n\t * @param {quat} vec vector to represent as a string\n\t * @returns {String} string representation of the vector\n\t */\n\tquat.str = function (a) {\n\t return 'quat(' + a[0] + ', ' + a[1] + ', ' + a[2] + ', ' + a[3] + ')';\n\t};\n\t\n\tmodule.exports = quat;\n\n\n/***/ },\n/* 16 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.\n\t\n\tPermission is hereby granted, free of charge, to any person obtaining a copy\n\tof this software and associated documentation files (the \"Software\"), to deal\n\tin the Software without restriction, including without limitation the rights\n\tto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\tcopies of the Software, and to permit persons to whom the Software is\n\tfurnished to do so, subject to the following conditions:\n\t\n\tThe above copyright notice and this permission notice shall be included in\n\tall copies or substantial portions of the Software.\n\t\n\tTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\tIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\tFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\tAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\tLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\tOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\tTHE SOFTWARE. */\n\t\n\tvar glMatrix = __webpack_require__(10);\n\t\n\t/**\n\t * @class 3 Dimensional Vector\n\t * @name vec3\n\t */\n\tvar vec3 = {};\n\t\n\t/**\n\t * Creates a new, empty vec3\n\t *\n\t * @returns {vec3} a new 3D vector\n\t */\n\tvec3.create = function() {\n\t var out = new glMatrix.ARRAY_TYPE(3);\n\t out[0] = 0;\n\t out[1] = 0;\n\t out[2] = 0;\n\t return out;\n\t};\n\t\n\t/**\n\t * Creates a new vec3 initialized with values from an existing vector\n\t *\n\t * @param {vec3} a vector to clone\n\t * @returns {vec3} a new 3D vector\n\t */\n\tvec3.clone = function(a) {\n\t var out = new glMatrix.ARRAY_TYPE(3);\n\t out[0] = a[0];\n\t out[1] = a[1];\n\t out[2] = a[2];\n\t return out;\n\t};\n\t\n\t/**\n\t * Creates a new vec3 initialized with the given values\n\t *\n\t * @param {Number} x X component\n\t * @param {Number} y Y component\n\t * @param {Number} z Z component\n\t * @returns {vec3} a new 3D vector\n\t */\n\tvec3.fromValues = function(x, y, z) {\n\t var out = new glMatrix.ARRAY_TYPE(3);\n\t out[0] = x;\n\t out[1] = y;\n\t out[2] = z;\n\t return out;\n\t};\n\t\n\t/**\n\t * Copy the values from one vec3 to another\n\t *\n\t * @param {vec3} out the receiving vector\n\t * @param {vec3} a the source vector\n\t * @returns {vec3} out\n\t */\n\tvec3.copy = function(out, a) {\n\t out[0] = a[0];\n\t out[1] = a[1];\n\t out[2] = a[2];\n\t return out;\n\t};\n\t\n\t/**\n\t * Set the components of a vec3 to the given values\n\t *\n\t * @param {vec3} out the receiving vector\n\t * @param {Number} x X component\n\t * @param {Number} y Y component\n\t * @param {Number} z Z component\n\t * @returns {vec3} out\n\t */\n\tvec3.set = function(out, x, y, z) {\n\t out[0] = x;\n\t out[1] = y;\n\t out[2] = z;\n\t return out;\n\t};\n\t\n\t/**\n\t * Adds two vec3's\n\t *\n\t * @param {vec3} out the receiving vector\n\t * @param {vec3} a the first operand\n\t * @param {vec3} b the second operand\n\t * @returns {vec3} out\n\t */\n\tvec3.add = function(out, a, b) {\n\t out[0] = a[0] + b[0];\n\t out[1] = a[1] + b[1];\n\t out[2] = a[2] + b[2];\n\t return out;\n\t};\n\t\n\t/**\n\t * Subtracts vector b from vector a\n\t *\n\t * @param {vec3} out the receiving vector\n\t * @param {vec3} a the first operand\n\t * @param {vec3} b the second operand\n\t * @returns {vec3} out\n\t */\n\tvec3.subtract = function(out, a, b) {\n\t out[0] = a[0] - b[0];\n\t out[1] = a[1] - b[1];\n\t out[2] = a[2] - b[2];\n\t return out;\n\t};\n\t\n\t/**\n\t * Alias for {@link vec3.subtract}\n\t * @function\n\t */\n\tvec3.sub = vec3.subtract;\n\t\n\t/**\n\t * Multiplies two vec3's\n\t *\n\t * @param {vec3} out the receiving vector\n\t * @param {vec3} a the first operand\n\t * @param {vec3} b the second operand\n\t * @returns {vec3} out\n\t */\n\tvec3.multiply = function(out, a, b) {\n\t out[0] = a[0] * b[0];\n\t out[1] = a[1] * b[1];\n\t out[2] = a[2] * b[2];\n\t return out;\n\t};\n\t\n\t/**\n\t * Alias for {@link vec3.multiply}\n\t * @function\n\t */\n\tvec3.mul = vec3.multiply;\n\t\n\t/**\n\t * Divides two vec3's\n\t *\n\t * @param {vec3} out the receiving vector\n\t * @param {vec3} a the first operand\n\t * @param {vec3} b the second operand\n\t * @returns {vec3} out\n\t */\n\tvec3.divide = function(out, a, b) {\n\t out[0] = a[0] / b[0];\n\t out[1] = a[1] / b[1];\n\t out[2] = a[2] / b[2];\n\t return out;\n\t};\n\t\n\t/**\n\t * Alias for {@link vec3.divide}\n\t * @function\n\t */\n\tvec3.div = vec3.divide;\n\t\n\t/**\n\t * Returns the minimum of two vec3's\n\t *\n\t * @param {vec3} out the receiving vector\n\t * @param {vec3} a the first operand\n\t * @param {vec3} b the second operand\n\t * @returns {vec3} out\n\t */\n\tvec3.min = function(out, a, b) {\n\t out[0] = Math.min(a[0], b[0]);\n\t out[1] = Math.min(a[1], b[1]);\n\t out[2] = Math.min(a[2], b[2]);\n\t return out;\n\t};\n\t\n\t/**\n\t * Returns the maximum of two vec3's\n\t *\n\t * @param {vec3} out the receiving vector\n\t * @param {vec3} a the first operand\n\t * @param {vec3} b the second operand\n\t * @returns {vec3} out\n\t */\n\tvec3.max = function(out, a, b) {\n\t out[0] = Math.max(a[0], b[0]);\n\t out[1] = Math.max(a[1], b[1]);\n\t out[2] = Math.max(a[2], b[2]);\n\t return out;\n\t};\n\t\n\t/**\n\t * Scales a vec3 by a scalar number\n\t *\n\t * @param {vec3} out the receiving vector\n\t * @param {vec3} a the vector to scale\n\t * @param {Number} b amount to scale the vector by\n\t * @returns {vec3} out\n\t */\n\tvec3.scale = function(out, a, b) {\n\t out[0] = a[0] * b;\n\t out[1] = a[1] * b;\n\t out[2] = a[2] * b;\n\t return out;\n\t};\n\t\n\t/**\n\t * Adds two vec3's after scaling the second operand by a scalar value\n\t *\n\t * @param {vec3} out the receiving vector\n\t * @param {vec3} a the first operand\n\t * @param {vec3} b the second operand\n\t * @param {Number} scale the amount to scale b by before adding\n\t * @returns {vec3} out\n\t */\n\tvec3.scaleAndAdd = function(out, a, b, scale) {\n\t out[0] = a[0] + (b[0] * scale);\n\t out[1] = a[1] + (b[1] * scale);\n\t out[2] = a[2] + (b[2] * scale);\n\t return out;\n\t};\n\t\n\t/**\n\t * Calculates the euclidian distance between two vec3's\n\t *\n\t * @param {vec3} a the first operand\n\t * @param {vec3} b the second operand\n\t * @returns {Number} distance between a and b\n\t */\n\tvec3.distance = function(a, b) {\n\t var x = b[0] - a[0],\n\t y = b[1] - a[1],\n\t z = b[2] - a[2];\n\t return Math.sqrt(x*x + y*y + z*z);\n\t};\n\t\n\t/**\n\t * Alias for {@link vec3.distance}\n\t * @function\n\t */\n\tvec3.dist = vec3.distance;\n\t\n\t/**\n\t * Calculates the squared euclidian distance between two vec3's\n\t *\n\t * @param {vec3} a the first operand\n\t * @param {vec3} b the second operand\n\t * @returns {Number} squared distance between a and b\n\t */\n\tvec3.squaredDistance = function(a, b) {\n\t var x = b[0] - a[0],\n\t y = b[1] - a[1],\n\t z = b[2] - a[2];\n\t return x*x + y*y + z*z;\n\t};\n\t\n\t/**\n\t * Alias for {@link vec3.squaredDistance}\n\t * @function\n\t */\n\tvec3.sqrDist = vec3.squaredDistance;\n\t\n\t/**\n\t * Calculates the length of a vec3\n\t *\n\t * @param {vec3} a vector to calculate length of\n\t * @returns {Number} length of a\n\t */\n\tvec3.length = function (a) {\n\t var x = a[0],\n\t y = a[1],\n\t z = a[2];\n\t return Math.sqrt(x*x + y*y + z*z);\n\t};\n\t\n\t/**\n\t * Alias for {@link vec3.length}\n\t * @function\n\t */\n\tvec3.len = vec3.length;\n\t\n\t/**\n\t * Calculates the squared length of a vec3\n\t *\n\t * @param {vec3} a vector to calculate squared length of\n\t * @returns {Number} squared length of a\n\t */\n\tvec3.squaredLength = function (a) {\n\t var x = a[0],\n\t y = a[1],\n\t z = a[2];\n\t return x*x + y*y + z*z;\n\t};\n\t\n\t/**\n\t * Alias for {@link vec3.squaredLength}\n\t * @function\n\t */\n\tvec3.sqrLen = vec3.squaredLength;\n\t\n\t/**\n\t * Negates the components of a vec3\n\t *\n\t * @param {vec3} out the receiving vector\n\t * @param {vec3} a vector to negate\n\t * @returns {vec3} out\n\t */\n\tvec3.negate = function(out, a) {\n\t out[0] = -a[0];\n\t out[1] = -a[1];\n\t out[2] = -a[2];\n\t return out;\n\t};\n\t\n\t/**\n\t * Returns the inverse of the components of a vec3\n\t *\n\t * @param {vec3} out the receiving vector\n\t * @param {vec3} a vector to invert\n\t * @returns {vec3} out\n\t */\n\tvec3.inverse = function(out, a) {\n\t out[0] = 1.0 / a[0];\n\t out[1] = 1.0 / a[1];\n\t out[2] = 1.0 / a[2];\n\t return out;\n\t};\n\t\n\t/**\n\t * Normalize a vec3\n\t *\n\t * @param {vec3} out the receiving vector\n\t * @param {vec3} a vector to normalize\n\t * @returns {vec3} out\n\t */\n\tvec3.normalize = function(out, a) {\n\t var x = a[0],\n\t y = a[1],\n\t z = a[2];\n\t var len = x*x + y*y + z*z;\n\t if (len > 0) {\n\t //TODO: evaluate use of glm_invsqrt here?\n\t len = 1 / Math.sqrt(len);\n\t out[0] = a[0] * len;\n\t out[1] = a[1] * len;\n\t out[2] = a[2] * len;\n\t }\n\t return out;\n\t};\n\t\n\t/**\n\t * Calculates the dot product of two vec3's\n\t *\n\t * @param {vec3} a the first operand\n\t * @param {vec3} b the second operand\n\t * @returns {Number} dot product of a and b\n\t */\n\tvec3.dot = function (a, b) {\n\t return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n\t};\n\t\n\t/**\n\t * Computes the cross product of two vec3's\n\t *\n\t * @param {vec3} out the receiving vector\n\t * @param {vec3} a the first operand\n\t * @param {vec3} b the second operand\n\t * @returns {vec3} out\n\t */\n\tvec3.cross = function(out, a, b) {\n\t var ax = a[0], ay = a[1], az = a[2],\n\t bx = b[0], by = b[1], bz = b[2];\n\t\n\t out[0] = ay * bz - az * by;\n\t out[1] = az * bx - ax * bz;\n\t out[2] = ax * by - ay * bx;\n\t return out;\n\t};\n\t\n\t/**\n\t * Performs a linear interpolation between two vec3's\n\t *\n\t * @param {vec3} out the receiving vector\n\t * @param {vec3} a the first operand\n\t * @param {vec3} b the second operand\n\t * @param {Number} t interpolation amount between the two inputs\n\t * @returns {vec3} out\n\t */\n\tvec3.lerp = function (out, a, b, t) {\n\t var ax = a[0],\n\t ay = a[1],\n\t az = a[2];\n\t out[0] = ax + t * (b[0] - ax);\n\t out[1] = ay + t * (b[1] - ay);\n\t out[2] = az + t * (b[2] - az);\n\t return out;\n\t};\n\t\n\t/**\n\t * Performs a hermite interpolation with two control points\n\t *\n\t * @param {vec3} out the receiving vector\n\t * @param {vec3} a the first operand\n\t * @param {vec3} b the second operand\n\t * @param {vec3} c the third operand\n\t * @param {vec3} d the fourth operand\n\t * @param {Number} t interpolation amount between the two inputs\n\t * @returns {vec3} out\n\t */\n\tvec3.hermite = function (out, a, b, c, d, t) {\n\t var factorTimes2 = t * t,\n\t factor1 = factorTimes2 * (2 * t - 3) + 1,\n\t factor2 = factorTimes2 * (t - 2) + t,\n\t factor3 = factorTimes2 * (t - 1),\n\t factor4 = factorTimes2 * (3 - 2 * t);\n\t \n\t out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n\t out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n\t out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n\t \n\t return out;\n\t};\n\t\n\t/**\n\t * Performs a bezier interpolation with two control points\n\t *\n\t * @param {vec3} out the receiving vector\n\t * @param {vec3} a the first operand\n\t * @param {vec3} b the second operand\n\t * @param {vec3} c the third operand\n\t * @param {vec3} d the fourth operand\n\t * @param {Number} t interpolation amount between the two inputs\n\t * @returns {vec3} out\n\t */\n\tvec3.bezier = function (out, a, b, c, d, t) {\n\t var inverseFactor = 1 - t,\n\t inverseFactorTimesTwo = inverseFactor * inverseFactor,\n\t factorTimes2 = t * t,\n\t factor1 = inverseFactorTimesTwo * inverseFactor,\n\t factor2 = 3 * t * inverseFactorTimesTwo,\n\t factor3 = 3 * factorTimes2 * inverseFactor,\n\t factor4 = factorTimes2 * t;\n\t \n\t out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n\t out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n\t out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n\t \n\t return out;\n\t};\n\t\n\t/**\n\t * Generates a random vector with the given scale\n\t *\n\t * @param {vec3} out the receiving vector\n\t * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\n\t * @returns {vec3} out\n\t */\n\tvec3.random = function (out, scale) {\n\t scale = scale || 1.0;\n\t\n\t var r = glMatrix.RANDOM() * 2.0 * Math.PI;\n\t var z = (glMatrix.RANDOM() * 2.0) - 1.0;\n\t var zScale = Math.sqrt(1.0-z*z) * scale;\n\t\n\t out[0] = Math.cos(r) * zScale;\n\t out[1] = Math.sin(r) * zScale;\n\t out[2] = z * scale;\n\t return out;\n\t};\n\t\n\t/**\n\t * Transforms the vec3 with a mat4.\n\t * 4th vector component is implicitly '1'\n\t *\n\t * @param {vec3} out the receiving vector\n\t * @param {vec3} a the vector to transform\n\t * @param {mat4} m matrix to transform with\n\t * @returns {vec3} out\n\t */\n\tvec3.transformMat4 = function(out, a, m) {\n\t var x = a[0], y = a[1], z = a[2],\n\t w = m[3] * x + m[7] * y + m[11] * z + m[15];\n\t w = w || 1.0;\n\t out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n\t out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n\t out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n\t return out;\n\t};\n\t\n\t/**\n\t * Transforms the vec3 with a mat3.\n\t *\n\t * @param {vec3} out the receiving vector\n\t * @param {vec3} a the vector to transform\n\t * @param {mat4} m the 3x3 matrix to transform with\n\t * @returns {vec3} out\n\t */\n\tvec3.transformMat3 = function(out, a, m) {\n\t var x = a[0], y = a[1], z = a[2];\n\t out[0] = x * m[0] + y * m[3] + z * m[6];\n\t out[1] = x * m[1] + y * m[4] + z * m[7];\n\t out[2] = x * m[2] + y * m[5] + z * m[8];\n\t return out;\n\t};\n\t\n\t/**\n\t * Transforms the vec3 with a quat\n\t *\n\t * @param {vec3} out the receiving vector\n\t * @param {vec3} a the vector to transform\n\t * @param {quat} q quaternion to transform with\n\t * @returns {vec3} out\n\t */\n\tvec3.transformQuat = function(out, a, q) {\n\t // benchmarks: http://jsperf.com/quaternion-transform-vec3-implementations\n\t\n\t var x = a[0], y = a[1], z = a[2],\n\t qx = q[0], qy = q[1], qz = q[2], qw = q[3],\n\t\n\t // calculate quat * vec\n\t ix = qw * x + qy * z - qz * y,\n\t iy = qw * y + qz * x - qx * z,\n\t iz = qw * z + qx * y - qy * x,\n\t iw = -qx * x - qy * y - qz * z;\n\t\n\t // calculate result * inverse quat\n\t out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n\t out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n\t out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n\t return out;\n\t};\n\t\n\t/**\n\t * Rotate a 3D vector around the x-axis\n\t * @param {vec3} out The receiving vec3\n\t * @param {vec3} a The vec3 point to rotate\n\t * @param {vec3} b The origin of the rotation\n\t * @param {Number} c The angle of rotation\n\t * @returns {vec3} out\n\t */\n\tvec3.rotateX = function(out, a, b, c){\n\t var p = [], r=[];\n\t\t //Translate point to the origin\n\t\t p[0] = a[0] - b[0];\n\t\t p[1] = a[1] - b[1];\n\t \tp[2] = a[2] - b[2];\n\t\n\t\t //perform rotation\n\t\t r[0] = p[0];\n\t\t r[1] = p[1]*Math.cos(c) - p[2]*Math.sin(c);\n\t\t r[2] = p[1]*Math.sin(c) + p[2]*Math.cos(c);\n\t\n\t\t //translate to correct position\n\t\t out[0] = r[0] + b[0];\n\t\t out[1] = r[1] + b[1];\n\t\t out[2] = r[2] + b[2];\n\t\n\t \treturn out;\n\t};\n\t\n\t/**\n\t * Rotate a 3D vector around the y-axis\n\t * @param {vec3} out The receiving vec3\n\t * @param {vec3} a The vec3 point to rotate\n\t * @param {vec3} b The origin of the rotation\n\t * @param {Number} c The angle of rotation\n\t * @returns {vec3} out\n\t */\n\tvec3.rotateY = function(out, a, b, c){\n\t \tvar p = [], r=[];\n\t \t//Translate point to the origin\n\t \tp[0] = a[0] - b[0];\n\t \tp[1] = a[1] - b[1];\n\t \tp[2] = a[2] - b[2];\n\t \n\t \t//perform rotation\n\t \tr[0] = p[2]*Math.sin(c) + p[0]*Math.cos(c);\n\t \tr[1] = p[1];\n\t \tr[2] = p[2]*Math.cos(c) - p[0]*Math.sin(c);\n\t \n\t \t//translate to correct position\n\t \tout[0] = r[0] + b[0];\n\t \tout[1] = r[1] + b[1];\n\t \tout[2] = r[2] + b[2];\n\t \n\t \treturn out;\n\t};\n\t\n\t/**\n\t * Rotate a 3D vector around the z-axis\n\t * @param {vec3} out The receiving vec3\n\t * @param {vec3} a The vec3 point to rotate\n\t * @param {vec3} b The origin of the rotation\n\t * @param {Number} c The angle of rotation\n\t * @returns {vec3} out\n\t */\n\tvec3.rotateZ = function(out, a, b, c){\n\t \tvar p = [], r=[];\n\t \t//Translate point to the origin\n\t \tp[0] = a[0] - b[0];\n\t \tp[1] = a[1] - b[1];\n\t \tp[2] = a[2] - b[2];\n\t \n\t \t//perform rotation\n\t \tr[0] = p[0]*Math.cos(c) - p[1]*Math.sin(c);\n\t \tr[1] = p[0]*Math.sin(c) + p[1]*Math.cos(c);\n\t \tr[2] = p[2];\n\t \n\t \t//translate to correct position\n\t \tout[0] = r[0] + b[0];\n\t \tout[1] = r[1] + b[1];\n\t \tout[2] = r[2] + b[2];\n\t \n\t \treturn out;\n\t};\n\t\n\t/**\n\t * Perform some operation over an array of vec3s.\n\t *\n\t * @param {Array} a the array of vectors to iterate over\n\t * @param {Number} stride Number of elements between the start of each vec3. If 0 assumes tightly packed\n\t * @param {Number} offset Number of elements to skip at the beginning of the array\n\t * @param {Number} count Number of vec3s to iterate over. If 0 iterates over entire array\n\t * @param {Function} fn Function to call for each vector in the array\n\t * @param {Object} [arg] additional argument to pass to fn\n\t * @returns {Array} a\n\t * @function\n\t */\n\tvec3.forEach = (function() {\n\t var vec = vec3.create();\n\t\n\t return function(a, stride, offset, count, fn, arg) {\n\t var i, l;\n\t if(!stride) {\n\t stride = 3;\n\t }\n\t\n\t if(!offset) {\n\t offset = 0;\n\t }\n\t \n\t if(count) {\n\t l = Math.min((count * stride) + offset, a.length);\n\t } else {\n\t l = a.length;\n\t }\n\t\n\t for(i = offset; i < l; i += stride) {\n\t vec[0] = a[i]; vec[1] = a[i+1]; vec[2] = a[i+2];\n\t fn(vec, vec, arg);\n\t a[i] = vec[0]; a[i+1] = vec[1]; a[i+2] = vec[2];\n\t }\n\t \n\t return a;\n\t };\n\t})();\n\t\n\t/**\n\t * Get the angle between two 3D vectors\n\t * @param {vec3} a The first operand\n\t * @param {vec3} b The second operand\n\t * @returns {Number} The angle in radians\n\t */\n\tvec3.angle = function(a, b) {\n\t \n\t var tempA = vec3.fromValues(a[0], a[1], a[2]);\n\t var tempB = vec3.fromValues(b[0], b[1], b[2]);\n\t \n\t vec3.normalize(tempA, tempA);\n\t vec3.normalize(tempB, tempB);\n\t \n\t var cosine = vec3.dot(tempA, tempB);\n\t\n\t if(cosine > 1.0){\n\t return 0;\n\t } else {\n\t return Math.acos(cosine);\n\t } \n\t};\n\t\n\t/**\n\t * Returns a string representation of a vector\n\t *\n\t * @param {vec3} vec vector to represent as a string\n\t * @returns {String} string representation of the vector\n\t */\n\tvec3.str = function (a) {\n\t return 'vec3(' + a[0] + ', ' + a[1] + ', ' + a[2] + ')';\n\t};\n\t\n\tmodule.exports = vec3;\n\n\n/***/ },\n/* 17 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.\n\t\n\tPermission is hereby granted, free of charge, to any person obtaining a copy\n\tof this software and associated documentation files (the \"Software\"), to deal\n\tin the Software without restriction, including without limitation the rights\n\tto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\tcopies of the Software, and to permit persons to whom the Software is\n\tfurnished to do so, subject to the following conditions:\n\t\n\tThe above copyright notice and this permission notice shall be included in\n\tall copies or substantial portions of the Software.\n\t\n\tTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\tIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\tFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\tAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\tLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\tOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\tTHE SOFTWARE. */\n\t\n\tvar glMatrix = __webpack_require__(10);\n\t\n\t/**\n\t * @class 4 Dimensional Vector\n\t * @name vec4\n\t */\n\tvar vec4 = {};\n\t\n\t/**\n\t * Creates a new, empty vec4\n\t *\n\t * @returns {vec4} a new 4D vector\n\t */\n\tvec4.create = function() {\n\t var out = new glMatrix.ARRAY_TYPE(4);\n\t out[0] = 0;\n\t out[1] = 0;\n\t out[2] = 0;\n\t out[3] = 0;\n\t return out;\n\t};\n\t\n\t/**\n\t * Creates a new vec4 initialized with values from an existing vector\n\t *\n\t * @param {vec4} a vector to clone\n\t * @returns {vec4} a new 4D vector\n\t */\n\tvec4.clone = function(a) {\n\t var out = new glMatrix.ARRAY_TYPE(4);\n\t out[0] = a[0];\n\t out[1] = a[1];\n\t out[2] = a[2];\n\t out[3] = a[3];\n\t return out;\n\t};\n\t\n\t/**\n\t * Creates a new vec4 initialized with the given values\n\t *\n\t * @param {Number} x X component\n\t * @param {Number} y Y component\n\t * @param {Number} z Z component\n\t * @param {Number} w W component\n\t * @returns {vec4} a new 4D vector\n\t */\n\tvec4.fromValues = function(x, y, z, w) {\n\t var out = new glMatrix.ARRAY_TYPE(4);\n\t out[0] = x;\n\t out[1] = y;\n\t out[2] = z;\n\t out[3] = w;\n\t return out;\n\t};\n\t\n\t/**\n\t * Copy the values from one vec4 to another\n\t *\n\t * @param {vec4} out the receiving vector\n\t * @param {vec4} a the source vector\n\t * @returns {vec4} out\n\t */\n\tvec4.copy = function(out, a) {\n\t out[0] = a[0];\n\t out[1] = a[1];\n\t out[2] = a[2];\n\t out[3] = a[3];\n\t return out;\n\t};\n\t\n\t/**\n\t * Set the components of a vec4 to the given values\n\t *\n\t * @param {vec4} out the receiving vector\n\t * @param {Number} x X component\n\t * @param {Number} y Y component\n\t * @param {Number} z Z component\n\t * @param {Number} w W component\n\t * @returns {vec4} out\n\t */\n\tvec4.set = function(out, x, y, z, w) {\n\t out[0] = x;\n\t out[1] = y;\n\t out[2] = z;\n\t out[3] = w;\n\t return out;\n\t};\n\t\n\t/**\n\t * Adds two vec4's\n\t *\n\t * @param {vec4} out the receiving vector\n\t * @param {vec4} a the first operand\n\t * @param {vec4} b the second operand\n\t * @returns {vec4} out\n\t */\n\tvec4.add = function(out, a, b) {\n\t out[0] = a[0] + b[0];\n\t out[1] = a[1] + b[1];\n\t out[2] = a[2] + b[2];\n\t out[3] = a[3] + b[3];\n\t return out;\n\t};\n\t\n\t/**\n\t * Subtracts vector b from vector a\n\t *\n\t * @param {vec4} out the receiving vector\n\t * @param {vec4} a the first operand\n\t * @param {vec4} b the second operand\n\t * @returns {vec4} out\n\t */\n\tvec4.subtract = function(out, a, b) {\n\t out[0] = a[0] - b[0];\n\t out[1] = a[1] - b[1];\n\t out[2] = a[2] - b[2];\n\t out[3] = a[3] - b[3];\n\t return out;\n\t};\n\t\n\t/**\n\t * Alias for {@link vec4.subtract}\n\t * @function\n\t */\n\tvec4.sub = vec4.subtract;\n\t\n\t/**\n\t * Multiplies two vec4's\n\t *\n\t * @param {vec4} out the receiving vector\n\t * @param {vec4} a the first operand\n\t * @param {vec4} b the second operand\n\t * @returns {vec4} out\n\t */\n\tvec4.multiply = function(out, a, b) {\n\t out[0] = a[0] * b[0];\n\t out[1] = a[1] * b[1];\n\t out[2] = a[2] * b[2];\n\t out[3] = a[3] * b[3];\n\t return out;\n\t};\n\t\n\t/**\n\t * Alias for {@link vec4.multiply}\n\t * @function\n\t */\n\tvec4.mul = vec4.multiply;\n\t\n\t/**\n\t * Divides two vec4's\n\t *\n\t * @param {vec4} out the receiving vector\n\t * @param {vec4} a the first operand\n\t * @param {vec4} b the second operand\n\t * @returns {vec4} out\n\t */\n\tvec4.divide = function(out, a, b) {\n\t out[0] = a[0] / b[0];\n\t out[1] = a[1] / b[1];\n\t out[2] = a[2] / b[2];\n\t out[3] = a[3] / b[3];\n\t return out;\n\t};\n\t\n\t/**\n\t * Alias for {@link vec4.divide}\n\t * @function\n\t */\n\tvec4.div = vec4.divide;\n\t\n\t/**\n\t * Returns the minimum of two vec4's\n\t *\n\t * @param {vec4} out the receiving vector\n\t * @param {vec4} a the first operand\n\t * @param {vec4} b the second operand\n\t * @returns {vec4} out\n\t */\n\tvec4.min = function(out, a, b) {\n\t out[0] = Math.min(a[0], b[0]);\n\t out[1] = Math.min(a[1], b[1]);\n\t out[2] = Math.min(a[2], b[2]);\n\t out[3] = Math.min(a[3], b[3]);\n\t return out;\n\t};\n\t\n\t/**\n\t * Returns the maximum of two vec4's\n\t *\n\t * @param {vec4} out the receiving vector\n\t * @param {vec4} a the first operand\n\t * @param {vec4} b the second operand\n\t * @returns {vec4} out\n\t */\n\tvec4.max = function(out, a, b) {\n\t out[0] = Math.max(a[0], b[0]);\n\t out[1] = Math.max(a[1], b[1]);\n\t out[2] = Math.max(a[2], b[2]);\n\t out[3] = Math.max(a[3], b[3]);\n\t return out;\n\t};\n\t\n\t/**\n\t * Scales a vec4 by a scalar number\n\t *\n\t * @param {vec4} out the receiving vector\n\t * @param {vec4} a the vector to scale\n\t * @param {Number} b amount to scale the vector by\n\t * @returns {vec4} out\n\t */\n\tvec4.scale = function(out, a, b) {\n\t out[0] = a[0] * b;\n\t out[1] = a[1] * b;\n\t out[2] = a[2] * b;\n\t out[3] = a[3] * b;\n\t return out;\n\t};\n\t\n\t/**\n\t * Adds two vec4's after scaling the second operand by a scalar value\n\t *\n\t * @param {vec4} out the receiving vector\n\t * @param {vec4} a the first operand\n\t * @param {vec4} b the second operand\n\t * @param {Number} scale the amount to scale b by before adding\n\t * @returns {vec4} out\n\t */\n\tvec4.scaleAndAdd = function(out, a, b, scale) {\n\t out[0] = a[0] + (b[0] * scale);\n\t out[1] = a[1] + (b[1] * scale);\n\t out[2] = a[2] + (b[2] * scale);\n\t out[3] = a[3] + (b[3] * scale);\n\t return out;\n\t};\n\t\n\t/**\n\t * Calculates the euclidian distance between two vec4's\n\t *\n\t * @param {vec4} a the first operand\n\t * @param {vec4} b the second operand\n\t * @returns {Number} distance between a and b\n\t */\n\tvec4.distance = function(a, b) {\n\t var x = b[0] - a[0],\n\t y = b[1] - a[1],\n\t z = b[2] - a[2],\n\t w = b[3] - a[3];\n\t return Math.sqrt(x*x + y*y + z*z + w*w);\n\t};\n\t\n\t/**\n\t * Alias for {@link vec4.distance}\n\t * @function\n\t */\n\tvec4.dist = vec4.distance;\n\t\n\t/**\n\t * Calculates the squared euclidian distance between two vec4's\n\t *\n\t * @param {vec4} a the first operand\n\t * @param {vec4} b the second operand\n\t * @returns {Number} squared distance between a and b\n\t */\n\tvec4.squaredDistance = function(a, b) {\n\t var x = b[0] - a[0],\n\t y = b[1] - a[1],\n\t z = b[2] - a[2],\n\t w = b[3] - a[3];\n\t return x*x + y*y + z*z + w*w;\n\t};\n\t\n\t/**\n\t * Alias for {@link vec4.squaredDistance}\n\t * @function\n\t */\n\tvec4.sqrDist = vec4.squaredDistance;\n\t\n\t/**\n\t * Calculates the length of a vec4\n\t *\n\t * @param {vec4} a vector to calculate length of\n\t * @returns {Number} length of a\n\t */\n\tvec4.length = function (a) {\n\t var x = a[0],\n\t y = a[1],\n\t z = a[2],\n\t w = a[3];\n\t return Math.sqrt(x*x + y*y + z*z + w*w);\n\t};\n\t\n\t/**\n\t * Alias for {@link vec4.length}\n\t * @function\n\t */\n\tvec4.len = vec4.length;\n\t\n\t/**\n\t * Calculates the squared length of a vec4\n\t *\n\t * @param {vec4} a vector to calculate squared length of\n\t * @returns {Number} squared length of a\n\t */\n\tvec4.squaredLength = function (a) {\n\t var x = a[0],\n\t y = a[1],\n\t z = a[2],\n\t w = a[3];\n\t return x*x + y*y + z*z + w*w;\n\t};\n\t\n\t/**\n\t * Alias for {@link vec4.squaredLength}\n\t * @function\n\t */\n\tvec4.sqrLen = vec4.squaredLength;\n\t\n\t/**\n\t * Negates the components of a vec4\n\t *\n\t * @param {vec4} out the receiving vector\n\t * @param {vec4} a vector to negate\n\t * @returns {vec4} out\n\t */\n\tvec4.negate = function(out, a) {\n\t out[0] = -a[0];\n\t out[1] = -a[1];\n\t out[2] = -a[2];\n\t out[3] = -a[3];\n\t return out;\n\t};\n\t\n\t/**\n\t * Returns the inverse of the components of a vec4\n\t *\n\t * @param {vec4} out the receiving vector\n\t * @param {vec4} a vector to invert\n\t * @returns {vec4} out\n\t */\n\tvec4.inverse = function(out, a) {\n\t out[0] = 1.0 / a[0];\n\t out[1] = 1.0 / a[1];\n\t out[2] = 1.0 / a[2];\n\t out[3] = 1.0 / a[3];\n\t return out;\n\t};\n\t\n\t/**\n\t * Normalize a vec4\n\t *\n\t * @param {vec4} out the receiving vector\n\t * @param {vec4} a vector to normalize\n\t * @returns {vec4} out\n\t */\n\tvec4.normalize = function(out, a) {\n\t var x = a[0],\n\t y = a[1],\n\t z = a[2],\n\t w = a[3];\n\t var len = x*x + y*y + z*z + w*w;\n\t if (len > 0) {\n\t len = 1 / Math.sqrt(len);\n\t out[0] = x * len;\n\t out[1] = y * len;\n\t out[2] = z * len;\n\t out[3] = w * len;\n\t }\n\t return out;\n\t};\n\t\n\t/**\n\t * Calculates the dot product of two vec4's\n\t *\n\t * @param {vec4} a the first operand\n\t * @param {vec4} b the second operand\n\t * @returns {Number} dot product of a and b\n\t */\n\tvec4.dot = function (a, b) {\n\t return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n\t};\n\t\n\t/**\n\t * Performs a linear interpolation between two vec4's\n\t *\n\t * @param {vec4} out the receiving vector\n\t * @param {vec4} a the first operand\n\t * @param {vec4} b the second operand\n\t * @param {Number} t interpolation amount between the two inputs\n\t * @returns {vec4} out\n\t */\n\tvec4.lerp = function (out, a, b, t) {\n\t var ax = a[0],\n\t ay = a[1],\n\t az = a[2],\n\t aw = a[3];\n\t out[0] = ax + t * (b[0] - ax);\n\t out[1] = ay + t * (b[1] - ay);\n\t out[2] = az + t * (b[2] - az);\n\t out[3] = aw + t * (b[3] - aw);\n\t return out;\n\t};\n\t\n\t/**\n\t * Generates a random vector with the given scale\n\t *\n\t * @param {vec4} out the receiving vector\n\t * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\n\t * @returns {vec4} out\n\t */\n\tvec4.random = function (out, scale) {\n\t scale = scale || 1.0;\n\t\n\t //TODO: This is a pretty awful way of doing this. Find something better.\n\t out[0] = glMatrix.RANDOM();\n\t out[1] = glMatrix.RANDOM();\n\t out[2] = glMatrix.RANDOM();\n\t out[3] = glMatrix.RANDOM();\n\t vec4.normalize(out, out);\n\t vec4.scale(out, out, scale);\n\t return out;\n\t};\n\t\n\t/**\n\t * Transforms the vec4 with a mat4.\n\t *\n\t * @param {vec4} out the receiving vector\n\t * @param {vec4} a the vector to transform\n\t * @param {mat4} m matrix to transform with\n\t * @returns {vec4} out\n\t */\n\tvec4.transformMat4 = function(out, a, m) {\n\t var x = a[0], y = a[1], z = a[2], w = a[3];\n\t out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n\t out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n\t out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n\t out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n\t return out;\n\t};\n\t\n\t/**\n\t * Transforms the vec4 with a quat\n\t *\n\t * @param {vec4} out the receiving vector\n\t * @param {vec4} a the vector to transform\n\t * @param {quat} q quaternion to transform with\n\t * @returns {vec4} out\n\t */\n\tvec4.transformQuat = function(out, a, q) {\n\t var x = a[0], y = a[1], z = a[2],\n\t qx = q[0], qy = q[1], qz = q[2], qw = q[3],\n\t\n\t // calculate quat * vec\n\t ix = qw * x + qy * z - qz * y,\n\t iy = qw * y + qz * x - qx * z,\n\t iz = qw * z + qx * y - qy * x,\n\t iw = -qx * x - qy * y - qz * z;\n\t\n\t // calculate result * inverse quat\n\t out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n\t out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n\t out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n\t out[3] = a[3];\n\t return out;\n\t};\n\t\n\t/**\n\t * Perform some operation over an array of vec4s.\n\t *\n\t * @param {Array} a the array of vectors to iterate over\n\t * @param {Number} stride Number of elements between the start of each vec4. If 0 assumes tightly packed\n\t * @param {Number} offset Number of elements to skip at the beginning of the array\n\t * @param {Number} count Number of vec4s to iterate over. If 0 iterates over entire array\n\t * @param {Function} fn Function to call for each vector in the array\n\t * @param {Object} [arg] additional argument to pass to fn\n\t * @returns {Array} a\n\t * @function\n\t */\n\tvec4.forEach = (function() {\n\t var vec = vec4.create();\n\t\n\t return function(a, stride, offset, count, fn, arg) {\n\t var i, l;\n\t if(!stride) {\n\t stride = 4;\n\t }\n\t\n\t if(!offset) {\n\t offset = 0;\n\t }\n\t \n\t if(count) {\n\t l = Math.min((count * stride) + offset, a.length);\n\t } else {\n\t l = a.length;\n\t }\n\t\n\t for(i = offset; i < l; i += stride) {\n\t vec[0] = a[i]; vec[1] = a[i+1]; vec[2] = a[i+2]; vec[3] = a[i+3];\n\t fn(vec, vec, arg);\n\t a[i] = vec[0]; a[i+1] = vec[1]; a[i+2] = vec[2]; a[i+3] = vec[3];\n\t }\n\t \n\t return a;\n\t };\n\t})();\n\t\n\t/**\n\t * Returns a string representation of a vector\n\t *\n\t * @param {vec4} vec vector to represent as a string\n\t * @returns {String} string representation of the vector\n\t */\n\tvec4.str = function (a) {\n\t return 'vec4(' + a[0] + ', ' + a[1] + ', ' + a[2] + ', ' + a[3] + ')';\n\t};\n\t\n\tmodule.exports = vec4;\n\n\n/***/ },\n/* 18 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.\n\t\n\tPermission is hereby granted, free of charge, to any person obtaining a copy\n\tof this software and associated documentation files (the \"Software\"), to deal\n\tin the Software without restriction, including without limitation the rights\n\tto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\tcopies of the Software, and to permit persons to whom the Software is\n\tfurnished to do so, subject to the following conditions:\n\t\n\tThe above copyright notice and this permission notice shall be included in\n\tall copies or substantial portions of the Software.\n\t\n\tTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\tIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\tFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\tAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\tLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\tOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\tTHE SOFTWARE. */\n\t\n\tvar glMatrix = __webpack_require__(10);\n\t\n\t/**\n\t * @class 2 Dimensional Vector\n\t * @name vec2\n\t */\n\tvar vec2 = {};\n\t\n\t/**\n\t * Creates a new, empty vec2\n\t *\n\t * @returns {vec2} a new 2D vector\n\t */\n\tvec2.create = function() {\n\t var out = new glMatrix.ARRAY_TYPE(2);\n\t out[0] = 0;\n\t out[1] = 0;\n\t return out;\n\t};\n\t\n\t/**\n\t * Creates a new vec2 initialized with values from an existing vector\n\t *\n\t * @param {vec2} a vector to clone\n\t * @returns {vec2} a new 2D vector\n\t */\n\tvec2.clone = function(a) {\n\t var out = new glMatrix.ARRAY_TYPE(2);\n\t out[0] = a[0];\n\t out[1] = a[1];\n\t return out;\n\t};\n\t\n\t/**\n\t * Creates a new vec2 initialized with the given values\n\t *\n\t * @param {Number} x X component\n\t * @param {Number} y Y component\n\t * @returns {vec2} a new 2D vector\n\t */\n\tvec2.fromValues = function(x, y) {\n\t var out = new glMatrix.ARRAY_TYPE(2);\n\t out[0] = x;\n\t out[1] = y;\n\t return out;\n\t};\n\t\n\t/**\n\t * Copy the values from one vec2 to another\n\t *\n\t * @param {vec2} out the receiving vector\n\t * @param {vec2} a the source vector\n\t * @returns {vec2} out\n\t */\n\tvec2.copy = function(out, a) {\n\t out[0] = a[0];\n\t out[1] = a[1];\n\t return out;\n\t};\n\t\n\t/**\n\t * Set the components of a vec2 to the given values\n\t *\n\t * @param {vec2} out the receiving vector\n\t * @param {Number} x X component\n\t * @param {Number} y Y component\n\t * @returns {vec2} out\n\t */\n\tvec2.set = function(out, x, y) {\n\t out[0] = x;\n\t out[1] = y;\n\t return out;\n\t};\n\t\n\t/**\n\t * Adds two vec2's\n\t *\n\t * @param {vec2} out the receiving vector\n\t * @param {vec2} a the first operand\n\t * @param {vec2} b the second operand\n\t * @returns {vec2} out\n\t */\n\tvec2.add = function(out, a, b) {\n\t out[0] = a[0] + b[0];\n\t out[1] = a[1] + b[1];\n\t return out;\n\t};\n\t\n\t/**\n\t * Subtracts vector b from vector a\n\t *\n\t * @param {vec2} out the receiving vector\n\t * @param {vec2} a the first operand\n\t * @param {vec2} b the second operand\n\t * @returns {vec2} out\n\t */\n\tvec2.subtract = function(out, a, b) {\n\t out[0] = a[0] - b[0];\n\t out[1] = a[1] - b[1];\n\t return out;\n\t};\n\t\n\t/**\n\t * Alias for {@link vec2.subtract}\n\t * @function\n\t */\n\tvec2.sub = vec2.subtract;\n\t\n\t/**\n\t * Multiplies two vec2's\n\t *\n\t * @param {vec2} out the receiving vector\n\t * @param {vec2} a the first operand\n\t * @param {vec2} b the second operand\n\t * @returns {vec2} out\n\t */\n\tvec2.multiply = function(out, a, b) {\n\t out[0] = a[0] * b[0];\n\t out[1] = a[1] * b[1];\n\t return out;\n\t};\n\t\n\t/**\n\t * Alias for {@link vec2.multiply}\n\t * @function\n\t */\n\tvec2.mul = vec2.multiply;\n\t\n\t/**\n\t * Divides two vec2's\n\t *\n\t * @param {vec2} out the receiving vector\n\t * @param {vec2} a the first operand\n\t * @param {vec2} b the second operand\n\t * @returns {vec2} out\n\t */\n\tvec2.divide = function(out, a, b) {\n\t out[0] = a[0] / b[0];\n\t out[1] = a[1] / b[1];\n\t return out;\n\t};\n\t\n\t/**\n\t * Alias for {@link vec2.divide}\n\t * @function\n\t */\n\tvec2.div = vec2.divide;\n\t\n\t/**\n\t * Returns the minimum of two vec2's\n\t *\n\t * @param {vec2} out the receiving vector\n\t * @param {vec2} a the first operand\n\t * @param {vec2} b the second operand\n\t * @returns {vec2} out\n\t */\n\tvec2.min = function(out, a, b) {\n\t out[0] = Math.min(a[0], b[0]);\n\t out[1] = Math.min(a[1], b[1]);\n\t return out;\n\t};\n\t\n\t/**\n\t * Returns the maximum of two vec2's\n\t *\n\t * @param {vec2} out the receiving vector\n\t * @param {vec2} a the first operand\n\t * @param {vec2} b the second operand\n\t * @returns {vec2} out\n\t */\n\tvec2.max = function(out, a, b) {\n\t out[0] = Math.max(a[0], b[0]);\n\t out[1] = Math.max(a[1], b[1]);\n\t return out;\n\t};\n\t\n\t/**\n\t * Scales a vec2 by a scalar number\n\t *\n\t * @param {vec2} out the receiving vector\n\t * @param {vec2} a the vector to scale\n\t * @param {Number} b amount to scale the vector by\n\t * @returns {vec2} out\n\t */\n\tvec2.scale = function(out, a, b) {\n\t out[0] = a[0] * b;\n\t out[1] = a[1] * b;\n\t return out;\n\t};\n\t\n\t/**\n\t * Adds two vec2's after scaling the second operand by a scalar value\n\t *\n\t * @param {vec2} out the receiving vector\n\t * @param {vec2} a the first operand\n\t * @param {vec2} b the second operand\n\t * @param {Number} scale the amount to scale b by before adding\n\t * @returns {vec2} out\n\t */\n\tvec2.scaleAndAdd = function(out, a, b, scale) {\n\t out[0] = a[0] + (b[0] * scale);\n\t out[1] = a[1] + (b[1] * scale);\n\t return out;\n\t};\n\t\n\t/**\n\t * Calculates the euclidian distance between two vec2's\n\t *\n\t * @param {vec2} a the first operand\n\t * @param {vec2} b the second operand\n\t * @returns {Number} distance between a and b\n\t */\n\tvec2.distance = function(a, b) {\n\t var x = b[0] - a[0],\n\t y = b[1] - a[1];\n\t return Math.sqrt(x*x + y*y);\n\t};\n\t\n\t/**\n\t * Alias for {@link vec2.distance}\n\t * @function\n\t */\n\tvec2.dist = vec2.distance;\n\t\n\t/**\n\t * Calculates the squared euclidian distance between two vec2's\n\t *\n\t * @param {vec2} a the first operand\n\t * @param {vec2} b the second operand\n\t * @returns {Number} squared distance between a and b\n\t */\n\tvec2.squaredDistance = function(a, b) {\n\t var x = b[0] - a[0],\n\t y = b[1] - a[1];\n\t return x*x + y*y;\n\t};\n\t\n\t/**\n\t * Alias for {@link vec2.squaredDistance}\n\t * @function\n\t */\n\tvec2.sqrDist = vec2.squaredDistance;\n\t\n\t/**\n\t * Calculates the length of a vec2\n\t *\n\t * @param {vec2} a vector to calculate length of\n\t * @returns {Number} length of a\n\t */\n\tvec2.length = function (a) {\n\t var x = a[0],\n\t y = a[1];\n\t return Math.sqrt(x*x + y*y);\n\t};\n\t\n\t/**\n\t * Alias for {@link vec2.length}\n\t * @function\n\t */\n\tvec2.len = vec2.length;\n\t\n\t/**\n\t * Calculates the squared length of a vec2\n\t *\n\t * @param {vec2} a vector to calculate squared length of\n\t * @returns {Number} squared length of a\n\t */\n\tvec2.squaredLength = function (a) {\n\t var x = a[0],\n\t y = a[1];\n\t return x*x + y*y;\n\t};\n\t\n\t/**\n\t * Alias for {@link vec2.squaredLength}\n\t * @function\n\t */\n\tvec2.sqrLen = vec2.squaredLength;\n\t\n\t/**\n\t * Negates the components of a vec2\n\t *\n\t * @param {vec2} out the receiving vector\n\t * @param {vec2} a vector to negate\n\t * @returns {vec2} out\n\t */\n\tvec2.negate = function(out, a) {\n\t out[0] = -a[0];\n\t out[1] = -a[1];\n\t return out;\n\t};\n\t\n\t/**\n\t * Returns the inverse of the components of a vec2\n\t *\n\t * @param {vec2} out the receiving vector\n\t * @param {vec2} a vector to invert\n\t * @returns {vec2} out\n\t */\n\tvec2.inverse = function(out, a) {\n\t out[0] = 1.0 / a[0];\n\t out[1] = 1.0 / a[1];\n\t return out;\n\t};\n\t\n\t/**\n\t * Normalize a vec2\n\t *\n\t * @param {vec2} out the receiving vector\n\t * @param {vec2} a vector to normalize\n\t * @returns {vec2} out\n\t */\n\tvec2.normalize = function(out, a) {\n\t var x = a[0],\n\t y = a[1];\n\t var len = x*x + y*y;\n\t if (len > 0) {\n\t //TODO: evaluate use of glm_invsqrt here?\n\t len = 1 / Math.sqrt(len);\n\t out[0] = a[0] * len;\n\t out[1] = a[1] * len;\n\t }\n\t return out;\n\t};\n\t\n\t/**\n\t * Calculates the dot product of two vec2's\n\t *\n\t * @param {vec2} a the first operand\n\t * @param {vec2} b the second operand\n\t * @returns {Number} dot product of a and b\n\t */\n\tvec2.dot = function (a, b) {\n\t return a[0] * b[0] + a[1] * b[1];\n\t};\n\t\n\t/**\n\t * Computes the cross product of two vec2's\n\t * Note that the cross product must by definition produce a 3D vector\n\t *\n\t * @param {vec3} out the receiving vector\n\t * @param {vec2} a the first operand\n\t * @param {vec2} b the second operand\n\t * @returns {vec3} out\n\t */\n\tvec2.cross = function(out, a, b) {\n\t var z = a[0] * b[1] - a[1] * b[0];\n\t out[0] = out[1] = 0;\n\t out[2] = z;\n\t return out;\n\t};\n\t\n\t/**\n\t * Performs a linear interpolation between two vec2's\n\t *\n\t * @param {vec2} out the receiving vector\n\t * @param {vec2} a the first operand\n\t * @param {vec2} b the second operand\n\t * @param {Number} t interpolation amount between the two inputs\n\t * @returns {vec2} out\n\t */\n\tvec2.lerp = function (out, a, b, t) {\n\t var ax = a[0],\n\t ay = a[1];\n\t out[0] = ax + t * (b[0] - ax);\n\t out[1] = ay + t * (b[1] - ay);\n\t return out;\n\t};\n\t\n\t/**\n\t * Generates a random vector with the given scale\n\t *\n\t * @param {vec2} out the receiving vector\n\t * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\n\t * @returns {vec2} out\n\t */\n\tvec2.random = function (out, scale) {\n\t scale = scale || 1.0;\n\t var r = glMatrix.RANDOM() * 2.0 * Math.PI;\n\t out[0] = Math.cos(r) * scale;\n\t out[1] = Math.sin(r) * scale;\n\t return out;\n\t};\n\t\n\t/**\n\t * Transforms the vec2 with a mat2\n\t *\n\t * @param {vec2} out the receiving vector\n\t * @param {vec2} a the vector to transform\n\t * @param {mat2} m matrix to transform with\n\t * @returns {vec2} out\n\t */\n\tvec2.transformMat2 = function(out, a, m) {\n\t var x = a[0],\n\t y = a[1];\n\t out[0] = m[0] * x + m[2] * y;\n\t out[1] = m[1] * x + m[3] * y;\n\t return out;\n\t};\n\t\n\t/**\n\t * Transforms the vec2 with a mat2d\n\t *\n\t * @param {vec2} out the receiving vector\n\t * @param {vec2} a the vector to transform\n\t * @param {mat2d} m matrix to transform with\n\t * @returns {vec2} out\n\t */\n\tvec2.transformMat2d = function(out, a, m) {\n\t var x = a[0],\n\t y = a[1];\n\t out[0] = m[0] * x + m[2] * y + m[4];\n\t out[1] = m[1] * x + m[3] * y + m[5];\n\t return out;\n\t};\n\t\n\t/**\n\t * Transforms the vec2 with a mat3\n\t * 3rd vector component is implicitly '1'\n\t *\n\t * @param {vec2} out the receiving vector\n\t * @param {vec2} a the vector to transform\n\t * @param {mat3} m matrix to transform with\n\t * @returns {vec2} out\n\t */\n\tvec2.transformMat3 = function(out, a, m) {\n\t var x = a[0],\n\t y = a[1];\n\t out[0] = m[0] * x + m[3] * y + m[6];\n\t out[1] = m[1] * x + m[4] * y + m[7];\n\t return out;\n\t};\n\t\n\t/**\n\t * Transforms the vec2 with a mat4\n\t * 3rd vector component is implicitly '0'\n\t * 4th vector component is implicitly '1'\n\t *\n\t * @param {vec2} out the receiving vector\n\t * @param {vec2} a the vector to transform\n\t * @param {mat4} m matrix to transform with\n\t * @returns {vec2} out\n\t */\n\tvec2.transformMat4 = function(out, a, m) {\n\t var x = a[0], \n\t y = a[1];\n\t out[0] = m[0] * x + m[4] * y + m[12];\n\t out[1] = m[1] * x + m[5] * y + m[13];\n\t return out;\n\t};\n\t\n\t/**\n\t * Perform some operation over an array of vec2s.\n\t *\n\t * @param {Array} a the array of vectors to iterate over\n\t * @param {Number} stride Number of elements between the start of each vec2. If 0 assumes tightly packed\n\t * @param {Number} offset Number of elements to skip at the beginning of the array\n\t * @param {Number} count Number of vec2s to iterate over. If 0 iterates over entire array\n\t * @param {Function} fn Function to call for each vector in the array\n\t * @param {Object} [arg] additional argument to pass to fn\n\t * @returns {Array} a\n\t * @function\n\t */\n\tvec2.forEach = (function() {\n\t var vec = vec2.create();\n\t\n\t return function(a, stride, offset, count, fn, arg) {\n\t var i, l;\n\t if(!stride) {\n\t stride = 2;\n\t }\n\t\n\t if(!offset) {\n\t offset = 0;\n\t }\n\t \n\t if(count) {\n\t l = Math.min((count * stride) + offset, a.length);\n\t } else {\n\t l = a.length;\n\t }\n\t\n\t for(i = offset; i < l; i += stride) {\n\t vec[0] = a[i]; vec[1] = a[i+1];\n\t fn(vec, vec, arg);\n\t a[i] = vec[0]; a[i+1] = vec[1];\n\t }\n\t \n\t return a;\n\t };\n\t})();\n\t\n\t/**\n\t * Returns a string representation of a vector\n\t *\n\t * @param {vec2} vec vector to represent as a string\n\t * @returns {String} string representation of the vector\n\t */\n\tvec2.str = function (a) {\n\t return 'vec2(' + a[0] + ', ' + a[1] + ')';\n\t};\n\t\n\tmodule.exports = vec2;\n\n\n/***/ },\n/* 19 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports[\"default\"] = {\n\t init: function init(arr, val) {\n\t var l = arr.length;\n\t while (l--) {\n\t arr[l] = val;\n\t }\n\t },\n\t\n\t /**\n\t * Shuffles the content of an array\n\t * @return {Array} the array itself shuffled\n\t */\n\t shuffle: function shuffle(arr) {\n\t var i = arr.length - 1,\n\t j,\n\t x;\n\t for (i; i >= 0; i--) {\n\t j = Math.floor(Math.random() * i);\n\t x = arr[i];\n\t arr[i] = arr[j];\n\t arr[j] = x;\n\t }\n\t return arr;\n\t },\n\t\n\t toPointList: function toPointList(arr) {\n\t var i,\n\t j,\n\t row = [],\n\t rows = [];\n\t for (i = 0; i < arr.length; i++) {\n\t row = [];\n\t for (j = 0; j < arr[i].length; j++) {\n\t row[j] = arr[i][j];\n\t }\n\t rows[i] = \"[\" + row.join(\",\") + \"]\";\n\t }\n\t return \"[\" + rows.join(\",\\r\\n\") + \"]\";\n\t },\n\t\n\t /**\n\t * returns the elements which's score is bigger than the threshold\n\t * @return {Array} the reduced array\n\t */\n\t threshold: function threshold(arr, _threshold, scoreFunc) {\n\t var i,\n\t queue = [];\n\t for (i = 0; i < arr.length; i++) {\n\t if (scoreFunc.apply(arr, [arr[i]]) >= _threshold) {\n\t queue.push(arr[i]);\n\t }\n\t }\n\t return queue;\n\t },\n\t\n\t maxIndex: function maxIndex(arr) {\n\t var i,\n\t max = 0;\n\t for (i = 0; i < arr.length; i++) {\n\t if (arr[i] > arr[max]) {\n\t max = i;\n\t }\n\t }\n\t return max;\n\t },\n\t\n\t max: function max(arr) {\n\t var i,\n\t max = 0;\n\t for (i = 0; i < arr.length; i++) {\n\t if (arr[i] > max) {\n\t max = arr[i];\n\t }\n\t }\n\t return max;\n\t },\n\t\n\t sum: function sum(arr) {\n\t var length = arr.length,\n\t sum = 0;\n\t\n\t while (length--) {\n\t sum += arr[length];\n\t }\n\t return sum;\n\t }\n\t};\n\tmodule.exports = exports[\"default\"];\n\n/***/ },\n/* 20 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* jshint undef: true, unused: true, browser:true, devel: true */\n\t/* global define */\n\t\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar _image_wrapper = __webpack_require__(5);\n\t\n\tvar _image_wrapper2 = _interopRequireDefault(_image_wrapper);\n\t\n\tvar _cv_utils = __webpack_require__(7);\n\t\n\tvar _cv_utils2 = _interopRequireDefault(_cv_utils);\n\t\n\tvar _rasterizer = __webpack_require__(21);\n\t\n\tvar _rasterizer2 = _interopRequireDefault(_rasterizer);\n\t\n\tvar _tracer = __webpack_require__(22);\n\t\n\tvar _tracer2 = _interopRequireDefault(_tracer);\n\t\n\tvar _skeletonizer2 = __webpack_require__(23);\n\t\n\tvar _skeletonizer3 = _interopRequireDefault(_skeletonizer2);\n\t\n\tvar _array_helper = __webpack_require__(19);\n\t\n\tvar _array_helper2 = _interopRequireDefault(_array_helper);\n\t\n\tvar _image_debug = __webpack_require__(24);\n\t\n\tvar _image_debug2 = _interopRequireDefault(_image_debug);\n\t\n\tvar _glMatrix = __webpack_require__(9);\n\t\n\tvar _glMatrix2 = _interopRequireDefault(_glMatrix);\n\t\n\tvar _config,\n\t _currentImageWrapper,\n\t _skelImageWrapper,\n\t _subImageWrapper,\n\t _labelImageWrapper,\n\t _patchGrid,\n\t _patchLabelGrid,\n\t _imageToPatchGrid,\n\t _binaryImageWrapper,\n\t _patchSize,\n\t _canvasContainer = {\n\t ctx: {\n\t binary: null\n\t },\n\t dom: {\n\t binary: null\n\t }\n\t},\n\t _numPatches = { x: 0, y: 0 },\n\t _inputImageWrapper,\n\t _skeletonizer,\n\t vec2 = _glMatrix2['default'].vec2,\n\t mat2 = _glMatrix2['default'].mat2,\n\t self = typeof window !== 'undefined' ? window : self;\n\t\n\tfunction initBuffers() {\n\t var skeletonImageData;\n\t\n\t if (_config.halfSample) {\n\t _currentImageWrapper = new _image_wrapper2['default']({\n\t x: _inputImageWrapper.size.x / 2 | 0,\n\t y: _inputImageWrapper.size.y / 2 | 0\n\t });\n\t } else {\n\t _currentImageWrapper = _inputImageWrapper;\n\t }\n\t\n\t _patchSize = _cv_utils2['default'].calculatePatchSize(_config.patchSize, _currentImageWrapper.size);\n\t\n\t _numPatches.x = _currentImageWrapper.size.x / _patchSize.x | 0;\n\t _numPatches.y = _currentImageWrapper.size.y / _patchSize.y | 0;\n\t\n\t _binaryImageWrapper = new _image_wrapper2['default'](_currentImageWrapper.size, undefined, Uint8Array, false);\n\t\n\t _labelImageWrapper = new _image_wrapper2['default'](_patchSize, undefined, Array, true);\n\t\n\t skeletonImageData = new ArrayBuffer(64 * 1024);\n\t _subImageWrapper = new _image_wrapper2['default'](_patchSize, new Uint8Array(skeletonImageData, 0, _patchSize.x * _patchSize.y));\n\t _skelImageWrapper = new _image_wrapper2['default'](_patchSize, new Uint8Array(skeletonImageData, _patchSize.x * _patchSize.y * 3, _patchSize.x * _patchSize.y), undefined, true);\n\t _skeletonizer = (0, _skeletonizer3['default'])(self, {\n\t size: _patchSize.x\n\t }, skeletonImageData);\n\t\n\t _imageToPatchGrid = new _image_wrapper2['default']({\n\t x: _currentImageWrapper.size.x / _subImageWrapper.size.x | 0,\n\t y: _currentImageWrapper.size.y / _subImageWrapper.size.y | 0\n\t }, undefined, Array, true);\n\t _patchGrid = new _image_wrapper2['default'](_imageToPatchGrid.size, undefined, undefined, true);\n\t _patchLabelGrid = new _image_wrapper2['default'](_imageToPatchGrid.size, undefined, Int32Array, true);\n\t}\n\t\n\tfunction initCanvas() {\n\t if (_config.useWorker || typeof document === 'undefined') {\n\t return;\n\t }\n\t _canvasContainer.dom.binary = document.createElement(\"canvas\");\n\t _canvasContainer.dom.binary.className = \"binaryBuffer\";\n\t if (_config.showCanvas === true) {\n\t document.querySelector(\"#debug\").appendChild(_canvasContainer.dom.binary);\n\t }\n\t _canvasContainer.ctx.binary = _canvasContainer.dom.binary.getContext(\"2d\");\n\t _canvasContainer.dom.binary.width = _binaryImageWrapper.size.x;\n\t _canvasContainer.dom.binary.height = _binaryImageWrapper.size.y;\n\t}\n\t\n\t/**\n\t * Creates a bounding box which encloses all the given patches\n\t * @returns {Array} The minimal bounding box\n\t */\n\tfunction boxFromPatches(patches) {\n\t var overAvg,\n\t i,\n\t j,\n\t patch,\n\t transMat,\n\t minx = _binaryImageWrapper.size.x,\n\t miny = _binaryImageWrapper.size.y,\n\t maxx = -_binaryImageWrapper.size.x,\n\t maxy = -_binaryImageWrapper.size.y,\n\t box,\n\t scale;\n\t\n\t // draw all patches which are to be taken into consideration\n\t overAvg = 0;\n\t for (i = 0; i < patches.length; i++) {\n\t patch = patches[i];\n\t overAvg += patch.rad;\n\t if (_config.showPatches) {\n\t _image_debug2['default'].drawRect(patch.pos, _subImageWrapper.size, _canvasContainer.ctx.binary, { color: \"red\" });\n\t }\n\t }\n\t\n\t overAvg /= patches.length;\n\t overAvg = (overAvg * 180 / Math.PI + 90) % 180 - 90;\n\t if (overAvg < 0) {\n\t overAvg += 180;\n\t }\n\t\n\t overAvg = (180 - overAvg) * Math.PI / 180;\n\t transMat = mat2.clone([Math.cos(overAvg), Math.sin(overAvg), -Math.sin(overAvg), Math.cos(overAvg)]);\n\t\n\t // iterate over patches and rotate by angle\n\t for (i = 0; i < patches.length; i++) {\n\t patch = patches[i];\n\t for (j = 0; j < 4; j++) {\n\t vec2.transformMat2(patch.box[j], patch.box[j], transMat);\n\t }\n\t\n\t if (_config.boxFromPatches.showTransformed) {\n\t _image_debug2['default'].drawPath(patch.box, { x: 0, y: 1 }, _canvasContainer.ctx.binary, { color: '#99ff00', lineWidth: 2 });\n\t }\n\t }\n\t\n\t // find bounding box\n\t for (i = 0; i < patches.length; i++) {\n\t patch = patches[i];\n\t for (j = 0; j < 4; j++) {\n\t if (patch.box[j][0] < minx) {\n\t minx = patch.box[j][0];\n\t }\n\t if (patch.box[j][0] > maxx) {\n\t maxx = patch.box[j][0];\n\t }\n\t if (patch.box[j][1] < miny) {\n\t miny = patch.box[j][1];\n\t }\n\t if (patch.box[j][1] > maxy) {\n\t maxy = patch.box[j][1];\n\t }\n\t }\n\t }\n\t\n\t box = [[minx, miny], [maxx, miny], [maxx, maxy], [minx, maxy]];\n\t\n\t if (_config.boxFromPatches.showTransformedBox) {\n\t _image_debug2['default'].drawPath(box, { x: 0, y: 1 }, _canvasContainer.ctx.binary, { color: '#ff0000', lineWidth: 2 });\n\t }\n\t\n\t scale = _config.halfSample ? 2 : 1;\n\t // reverse rotation;\n\t transMat = mat2.invert(transMat, transMat);\n\t for (j = 0; j < 4; j++) {\n\t vec2.transformMat2(box[j], box[j], transMat);\n\t }\n\t\n\t if (_config.boxFromPatches.showBB) {\n\t _image_debug2['default'].drawPath(box, { x: 0, y: 1 }, _canvasContainer.ctx.binary, { color: '#ff0000', lineWidth: 2 });\n\t }\n\t\n\t for (j = 0; j < 4; j++) {\n\t vec2.scale(box[j], box[j], scale);\n\t }\n\t\n\t return box;\n\t}\n\t\n\t/**\n\t * Creates a binary image of the current image\n\t */\n\tfunction binarizeImage() {\n\t _cv_utils2['default'].otsuThreshold(_currentImageWrapper, _binaryImageWrapper);\n\t _binaryImageWrapper.zeroBorder();\n\t if (_config.showCanvas) {\n\t _binaryImageWrapper.show(_canvasContainer.dom.binary, 255);\n\t }\n\t}\n\t\n\t/**\n\t * Iterate over the entire image\n\t * extract patches\n\t */\n\tfunction findPatches() {\n\t var i,\n\t j,\n\t x,\n\t y,\n\t moments,\n\t patchesFound = [],\n\t rasterizer,\n\t rasterResult,\n\t patch;\n\t for (i = 0; i < _numPatches.x; i++) {\n\t for (j = 0; j < _numPatches.y; j++) {\n\t\n\t x = _subImageWrapper.size.x * i;\n\t y = _subImageWrapper.size.y * j;\n\t\n\t // seperate parts\n\t skeletonize(x, y);\n\t\n\t // Rasterize, find individual bars\n\t _skelImageWrapper.zeroBorder();\n\t _array_helper2['default'].init(_labelImageWrapper.data, 0);\n\t rasterizer = _rasterizer2['default'].create(_skelImageWrapper, _labelImageWrapper);\n\t rasterResult = rasterizer.rasterize(0);\n\t\n\t if (_config.showLabels) {\n\t _labelImageWrapper.overlay(_canvasContainer.dom.binary, Math.floor(360 / rasterResult.count), { x: x, y: y });\n\t }\n\t\n\t // calculate moments from the skeletonized patch\n\t moments = _labelImageWrapper.moments(rasterResult.count);\n\t\n\t // extract eligible patches\n\t patchesFound = patchesFound.concat(describePatch(moments, [i, j], x, y));\n\t }\n\t }\n\t\n\t if (_config.showFoundPatches) {\n\t for (i = 0; i < patchesFound.length; i++) {\n\t patch = patchesFound[i];\n\t _image_debug2['default'].drawRect(patch.pos, _subImageWrapper.size, _canvasContainer.ctx.binary, { color: \"#99ff00\", lineWidth: 2 });\n\t }\n\t }\n\t\n\t return patchesFound;\n\t}\n\t\n\t/**\n\t * Finds those connected areas which contain at least 6 patches\n\t * and returns them ordered DESC by the number of contained patches\n\t * @param {Number} maxLabel\n\t */\n\tfunction findBiggestConnectedAreas(maxLabel) {\n\t var i,\n\t sum,\n\t labelHist = [],\n\t topLabels = [];\n\t\n\t for (i = 0; i < maxLabel; i++) {\n\t labelHist.push(0);\n\t }\n\t sum = _patchLabelGrid.data.length;\n\t while (sum--) {\n\t if (_patchLabelGrid.data[sum] > 0) {\n\t labelHist[_patchLabelGrid.data[sum] - 1]++;\n\t }\n\t }\n\t\n\t labelHist = labelHist.map(function (val, idx) {\n\t return {\n\t val: val,\n\t label: idx + 1\n\t };\n\t });\n\t\n\t labelHist.sort(function (a, b) {\n\t return b.val - a.val;\n\t });\n\t\n\t // extract top areas with at least 6 patches present\n\t topLabels = labelHist.filter(function (el) {\n\t return el.val >= 5;\n\t });\n\t\n\t return topLabels;\n\t}\n\t\n\t/**\n\t *\n\t */\n\tfunction findBoxes(topLabels, maxLabel) {\n\t var i,\n\t j,\n\t sum,\n\t patches = [],\n\t patch,\n\t box,\n\t boxes = [],\n\t hsv = [0, 1, 1],\n\t rgb = [0, 0, 0];\n\t\n\t for (i = 0; i < topLabels.length; i++) {\n\t sum = _patchLabelGrid.data.length;\n\t patches.length = 0;\n\t while (sum--) {\n\t if (_patchLabelGrid.data[sum] === topLabels[i].label) {\n\t patch = _imageToPatchGrid.data[sum];\n\t patches.push(patch);\n\t }\n\t }\n\t box = boxFromPatches(patches);\n\t if (box) {\n\t boxes.push(box);\n\t\n\t // draw patch-labels if requested\n\t if (_config.showRemainingPatchLabels) {\n\t for (j = 0; j < patches.length; j++) {\n\t patch = patches[j];\n\t hsv[0] = topLabels[i].label / (maxLabel + 1) * 360;\n\t _cv_utils2['default'].hsv2rgb(hsv, rgb);\n\t _image_debug2['default'].drawRect(patch.pos, _subImageWrapper.size, _canvasContainer.ctx.binary, { color: \"rgb(\" + rgb.join(\",\") + \")\", lineWidth: 2 });\n\t }\n\t }\n\t }\n\t }\n\t return boxes;\n\t}\n\t\n\t/**\n\t * Find similar moments (via cluster)\n\t * @param {Object} moments\n\t */\n\tfunction similarMoments(moments) {\n\t var clusters = _cv_utils2['default'].cluster(moments, 0.90);\n\t var topCluster = _cv_utils2['default'].topGeneric(clusters, 1, function (e) {\n\t return e.getPoints().length;\n\t });\n\t var points = [],\n\t result = [];\n\t if (topCluster.length === 1) {\n\t points = topCluster[0].item.getPoints();\n\t for (var i = 0; i < points.length; i++) {\n\t result.push(points[i].point);\n\t }\n\t }\n\t return result;\n\t}\n\t\n\tfunction skeletonize(x, y) {\n\t _binaryImageWrapper.subImageAsCopy(_subImageWrapper, _cv_utils2['default'].imageRef(x, y));\n\t _skeletonizer.skeletonize();\n\t\n\t // Show skeleton if requested\n\t if (_config.showSkeleton) {\n\t _skelImageWrapper.overlay(_canvasContainer.dom.binary, 360, _cv_utils2['default'].imageRef(x, y));\n\t }\n\t}\n\t\n\t/**\n\t * Extracts and describes those patches which seem to contain a barcode pattern\n\t * @param {Array} moments\n\t * @param {Object} patchPos,\n\t * @param {Number} x\n\t * @param {Number} y\n\t * @returns {Array} list of patches\n\t */\n\tfunction describePatch(moments, patchPos, x, y) {\n\t var k,\n\t avg,\n\t sum = 0,\n\t eligibleMoments = [],\n\t matchingMoments,\n\t patch,\n\t patchesFound = [],\n\t minComponentWeight = Math.ceil(_patchSize.x / 3);\n\t\n\t if (moments.length >= 2) {\n\t // only collect moments which's area covers at least minComponentWeight pixels.\n\t for (k = 0; k < moments.length; k++) {\n\t if (moments[k].m00 > minComponentWeight) {\n\t eligibleMoments.push(moments[k]);\n\t }\n\t }\n\t\n\t // if at least 2 moments are found which have at least minComponentWeights covered\n\t if (eligibleMoments.length >= 2) {\n\t sum = eligibleMoments.length;\n\t matchingMoments = similarMoments(eligibleMoments);\n\t avg = 0;\n\t // determine the similarity of the moments\n\t for (k = 0; k < matchingMoments.length; k++) {\n\t avg += matchingMoments[k].rad;\n\t }\n\t\n\t // Only two of the moments are allowed not to fit into the equation\n\t // add the patch to the set\n\t if (matchingMoments.length > 1 && matchingMoments.length >= eligibleMoments.length / 4 * 3 && matchingMoments.length > moments.length / 4) {\n\t avg /= matchingMoments.length;\n\t patch = {\n\t index: patchPos[1] * _numPatches.x + patchPos[0],\n\t pos: {\n\t x: x,\n\t y: y\n\t },\n\t box: [vec2.clone([x, y]), vec2.clone([x + _subImageWrapper.size.x, y]), vec2.clone([x + _subImageWrapper.size.x, y + _subImageWrapper.size.y]), vec2.clone([x, y + _subImageWrapper.size.y])],\n\t moments: matchingMoments,\n\t rad: avg,\n\t vec: vec2.clone([Math.cos(avg), Math.sin(avg)])\n\t };\n\t patchesFound.push(patch);\n\t }\n\t }\n\t }\n\t return patchesFound;\n\t}\n\t\n\t/**\n\t * finds patches which are connected and share the same orientation\n\t * @param {Object} patchesFound\n\t */\n\tfunction rasterizeAngularSimilarity(patchesFound) {\n\t var label = 0,\n\t threshold = 0.95,\n\t currIdx = 0,\n\t j,\n\t patch,\n\t hsv = [0, 1, 1],\n\t rgb = [0, 0, 0];\n\t\n\t function notYetProcessed() {\n\t var i;\n\t for (i = 0; i < _patchLabelGrid.data.length; i++) {\n\t if (_patchLabelGrid.data[i] === 0 && _patchGrid.data[i] === 1) {\n\t return i;\n\t }\n\t }\n\t return _patchLabelGrid.length;\n\t }\n\t\n\t function trace(currentIdx) {\n\t var x,\n\t y,\n\t currentPatch,\n\t patch,\n\t idx,\n\t dir,\n\t current = {\n\t x: currentIdx % _patchLabelGrid.size.x,\n\t y: currentIdx / _patchLabelGrid.size.x | 0\n\t },\n\t similarity;\n\t\n\t if (currentIdx < _patchLabelGrid.data.length) {\n\t currentPatch = _imageToPatchGrid.data[currentIdx];\n\t // assign label\n\t _patchLabelGrid.data[currentIdx] = label;\n\t for (dir = 0; dir < _tracer2['default'].searchDirections.length; dir++) {\n\t y = current.y + _tracer2['default'].searchDirections[dir][0];\n\t x = current.x + _tracer2['default'].searchDirections[dir][1];\n\t idx = y * _patchLabelGrid.size.x + x;\n\t\n\t // continue if patch empty\n\t if (_patchGrid.data[idx] === 0) {\n\t _patchLabelGrid.data[idx] = Number.MAX_VALUE;\n\t continue;\n\t }\n\t\n\t patch = _imageToPatchGrid.data[idx];\n\t if (_patchLabelGrid.data[idx] === 0) {\n\t similarity = Math.abs(vec2.dot(patch.vec, currentPatch.vec));\n\t if (similarity > threshold) {\n\t trace(idx);\n\t }\n\t }\n\t }\n\t }\n\t }\n\t\n\t // prepare for finding the right patches\n\t _array_helper2['default'].init(_patchGrid.data, 0);\n\t _array_helper2['default'].init(_patchLabelGrid.data, 0);\n\t _array_helper2['default'].init(_imageToPatchGrid.data, null);\n\t\n\t for (j = 0; j < patchesFound.length; j++) {\n\t patch = patchesFound[j];\n\t _imageToPatchGrid.data[patch.index] = patch;\n\t _patchGrid.data[patch.index] = 1;\n\t }\n\t\n\t // rasterize the patches found to determine area\n\t _patchGrid.zeroBorder();\n\t\n\t while ((currIdx = notYetProcessed()) < _patchLabelGrid.data.length) {\n\t label++;\n\t trace(currIdx);\n\t }\n\t\n\t // draw patch-labels if requested\n\t if (_config.showPatchLabels) {\n\t for (j = 0; j < _patchLabelGrid.data.length; j++) {\n\t if (_patchLabelGrid.data[j] > 0 && _patchLabelGrid.data[j] <= label) {\n\t patch = _imageToPatchGrid.data[j];\n\t hsv[0] = _patchLabelGrid.data[j] / (label + 1) * 360;\n\t _cv_utils2['default'].hsv2rgb(hsv, rgb);\n\t _image_debug2['default'].drawRect(patch.pos, _subImageWrapper.size, _canvasContainer.ctx.binary, { color: \"rgb(\" + rgb.join(\",\") + \")\", lineWidth: 2 });\n\t }\n\t }\n\t }\n\t\n\t return label;\n\t}\n\t\n\texports['default'] = {\n\t init: function init(inputImageWrapper, config) {\n\t _config = config;\n\t _inputImageWrapper = inputImageWrapper;\n\t\n\t initBuffers();\n\t initCanvas();\n\t },\n\t\n\t locate: function locate() {\n\t var patchesFound, topLabels, boxes;\n\t\n\t if (_config.halfSample) {\n\t _cv_utils2['default'].halfSample(_inputImageWrapper, _currentImageWrapper);\n\t }\n\t\n\t binarizeImage();\n\t patchesFound = findPatches();\n\t // return unless 5% or more patches are found\n\t if (patchesFound.length < _numPatches.x * _numPatches.y * 0.05) {\n\t return null;\n\t }\n\t\n\t // rasterrize area by comparing angular similarity;\n\t var maxLabel = rasterizeAngularSimilarity(patchesFound);\n\t if (maxLabel < 1) {\n\t return null;\n\t }\n\t\n\t // search for area with the most patches (biggest connected area)\n\t topLabels = findBiggestConnectedAreas(maxLabel);\n\t if (topLabels.length === 0) {\n\t return null;\n\t }\n\t\n\t boxes = findBoxes(topLabels, maxLabel);\n\t return boxes;\n\t },\n\t\n\t checkImageConstraints: function checkImageConstraints(inputStream, config) {\n\t var patchSize,\n\t width = inputStream.getWidth(),\n\t height = inputStream.getHeight(),\n\t halfSample = config.halfSample ? 0.5 : 1,\n\t size,\n\t area;\n\t\n\t // calculate width and height based on area\n\t if (inputStream.getConfig().area) {\n\t area = _cv_utils2['default'].computeImageArea(width, height, inputStream.getConfig().area);\n\t inputStream.setTopRight({ x: area.sx, y: area.sy });\n\t inputStream.setCanvasSize({ x: width, y: height });\n\t width = area.sw;\n\t height = area.sh;\n\t }\n\t\n\t size = {\n\t x: Math.floor(width * halfSample),\n\t y: Math.floor(height * halfSample)\n\t };\n\t\n\t patchSize = _cv_utils2['default'].calculatePatchSize(config.patchSize, size);\n\t console.log(\"Patch-Size: \" + JSON.stringify(patchSize));\n\t\n\t inputStream.setWidth(Math.floor(Math.floor(size.x / patchSize.x) * (1 / halfSample) * patchSize.x));\n\t inputStream.setHeight(Math.floor(Math.floor(size.y / patchSize.y) * (1 / halfSample) * patchSize.y));\n\t\n\t if (inputStream.getWidth() % patchSize.x === 0 && inputStream.getHeight() % patchSize.y === 0) {\n\t return true;\n\t }\n\t\n\t throw new Error(\"Image dimensions do not comply with the current settings: Width (\" + width + \" )and height (\" + height + \") must a multiple of \" + patchSize.x);\n\t }\n\t};\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 21 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\t\n\tvar _tracer = __webpack_require__(22);\n\t\n\tvar _tracer2 = _interopRequireDefault(_tracer);\n\t\n\t/**\n\t * http://www.codeproject.com/Tips/407172/Connected-Component-Labeling-and-Vectorization\n\t */\n\tvar Rasterizer = {\n\t createContour2D: function createContour2D() {\n\t return {\n\t dir: null,\n\t index: null,\n\t firstVertex: null,\n\t insideContours: null,\n\t nextpeer: null,\n\t prevpeer: null\n\t };\n\t },\n\t CONTOUR_DIR: {\n\t CW_DIR: 0,\n\t CCW_DIR: 1,\n\t UNKNOWN_DIR: 2\n\t },\n\t DIR: {\n\t OUTSIDE_EDGE: -32767,\n\t INSIDE_EDGE: -32766\n\t },\n\t create: function create(imageWrapper, labelWrapper) {\n\t var imageData = imageWrapper.data,\n\t labelData = labelWrapper.data,\n\t width = imageWrapper.size.x,\n\t height = imageWrapper.size.y,\n\t tracer = _tracer2[\"default\"].create(imageWrapper, labelWrapper);\n\t\n\t return {\n\t rasterize: function rasterize(depthlabel) {\n\t var color,\n\t bc,\n\t lc,\n\t labelindex,\n\t cx,\n\t cy,\n\t colorMap = [],\n\t vertex,\n\t p,\n\t cc,\n\t sc,\n\t pos,\n\t connectedCount = 0,\n\t i;\n\t\n\t for (i = 0; i < 400; i++) {\n\t colorMap[i] = 0;\n\t }\n\t\n\t colorMap[0] = imageData[0];\n\t cc = null;\n\t for (cy = 1; cy < height - 1; cy++) {\n\t labelindex = 0;\n\t bc = colorMap[0];\n\t for (cx = 1; cx < width - 1; cx++) {\n\t pos = cy * width + cx;\n\t if (labelData[pos] === 0) {\n\t color = imageData[pos];\n\t if (color !== bc) {\n\t if (labelindex === 0) {\n\t lc = connectedCount + 1;\n\t colorMap[lc] = color;\n\t bc = color;\n\t vertex = tracer.contourTracing(cy, cx, lc, color, Rasterizer.DIR.OUTSIDE_EDGE);\n\t if (vertex !== null) {\n\t connectedCount++;\n\t labelindex = lc;\n\t p = Rasterizer.createContour2D();\n\t p.dir = Rasterizer.CONTOUR_DIR.CW_DIR;\n\t p.index = labelindex;\n\t p.firstVertex = vertex;\n\t p.nextpeer = cc;\n\t p.insideContours = null;\n\t if (cc !== null) {\n\t cc.prevpeer = p;\n\t }\n\t cc = p;\n\t }\n\t } else {\n\t vertex = tracer.contourTracing(cy, cx, Rasterizer.DIR.INSIDE_EDGE, color, labelindex);\n\t if (vertex !== null) {\n\t p = Rasterizer.createContour2D();\n\t p.firstVertex = vertex;\n\t p.insideContours = null;\n\t if (depthlabel === 0) {\n\t p.dir = Rasterizer.CONTOUR_DIR.CCW_DIR;\n\t } else {\n\t p.dir = Rasterizer.CONTOUR_DIR.CW_DIR;\n\t }\n\t p.index = depthlabel;\n\t sc = cc;\n\t while (sc !== null && sc.index !== labelindex) {\n\t sc = sc.nextpeer;\n\t }\n\t if (sc !== null) {\n\t p.nextpeer = sc.insideContours;\n\t if (sc.insideContours !== null) {\n\t sc.insideContours.prevpeer = p;\n\t }\n\t sc.insideContours = p;\n\t }\n\t }\n\t }\n\t } else {\n\t labelData[pos] = labelindex;\n\t }\n\t } else if (labelData[pos] === Rasterizer.DIR.OUTSIDE_EDGE || labelData[pos] === Rasterizer.DIR.INSIDE_EDGE) {\n\t labelindex = 0;\n\t if (labelData[pos] === Rasterizer.DIR.INSIDE_EDGE) {\n\t bc = imageData[pos];\n\t } else {\n\t bc = colorMap[0];\n\t }\n\t } else {\n\t labelindex = labelData[pos];\n\t bc = colorMap[labelindex];\n\t }\n\t }\n\t }\n\t sc = cc;\n\t while (sc !== null) {\n\t sc.index = depthlabel;\n\t sc = sc.nextpeer;\n\t }\n\t return {\n\t cc: cc,\n\t count: connectedCount\n\t };\n\t },\n\t debug: {\n\t drawContour: function drawContour(canvas, firstContour) {\n\t var ctx = canvas.getContext(\"2d\"),\n\t pq = firstContour,\n\t iq,\n\t q,\n\t p;\n\t\n\t ctx.strokeStyle = \"red\";\n\t ctx.fillStyle = \"red\";\n\t ctx.lineWidth = 1;\n\t\n\t if (pq !== null) {\n\t iq = pq.insideContours;\n\t } else {\n\t iq = null;\n\t }\n\t\n\t while (pq !== null) {\n\t if (iq !== null) {\n\t q = iq;\n\t iq = iq.nextpeer;\n\t } else {\n\t q = pq;\n\t pq = pq.nextpeer;\n\t if (pq !== null) {\n\t iq = pq.insideContours;\n\t } else {\n\t iq = null;\n\t }\n\t }\n\t\n\t switch (q.dir) {\n\t case Rasterizer.CONTOUR_DIR.CW_DIR:\n\t ctx.strokeStyle = \"red\";\n\t break;\n\t case Rasterizer.CONTOUR_DIR.CCW_DIR:\n\t ctx.strokeStyle = \"blue\";\n\t break;\n\t case Rasterizer.CONTOUR_DIR.UNKNOWN_DIR:\n\t ctx.strokeStyle = \"green\";\n\t break;\n\t }\n\t\n\t p = q.firstVertex;\n\t ctx.beginPath();\n\t ctx.moveTo(p.x, p.y);\n\t do {\n\t p = p.next;\n\t ctx.lineTo(p.x, p.y);\n\t } while (p !== q.firstVertex);\n\t ctx.stroke();\n\t }\n\t }\n\t }\n\t };\n\t }\n\t};\n\t\n\texports[\"default\"] = Rasterizer;\n\tmodule.exports = exports[\"default\"];\n\n/***/ },\n/* 22 */\n/***/ function(module, exports) {\n\n\t/**\n\t * http://www.codeproject.com/Tips/407172/Connected-Component-Labeling-and-Vectorization\n\t */\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\tvar Tracer = {\n\t searchDirections: [[0, 1], [1, 1], [1, 0], [1, -1], [0, -1], [-1, -1], [-1, 0], [-1, 1]],\n\t create: function create(imageWrapper, labelWrapper) {\n\t var imageData = imageWrapper.data,\n\t labelData = labelWrapper.data,\n\t searchDirections = this.searchDirections,\n\t width = imageWrapper.size.x,\n\t pos;\n\t\n\t function _trace(current, color, label, edgelabel) {\n\t var i, y, x;\n\t\n\t for (i = 0; i < 7; i++) {\n\t y = current.cy + searchDirections[current.dir][0];\n\t x = current.cx + searchDirections[current.dir][1];\n\t pos = y * width + x;\n\t if (imageData[pos] === color && (labelData[pos] === 0 || labelData[pos] === label)) {\n\t labelData[pos] = label;\n\t current.cy = y;\n\t current.cx = x;\n\t return true;\n\t } else {\n\t if (labelData[pos] === 0) {\n\t labelData[pos] = edgelabel;\n\t }\n\t current.dir = (current.dir + 1) % 8;\n\t }\n\t }\n\t return false;\n\t }\n\t\n\t function vertex2D(x, y, dir) {\n\t return {\n\t dir: dir,\n\t x: x,\n\t y: y,\n\t next: null,\n\t prev: null\n\t };\n\t }\n\t\n\t function _contourTracing(sy, sx, label, color, edgelabel) {\n\t var Fv = null,\n\t Cv,\n\t P,\n\t ldir,\n\t current = {\n\t cx: sx,\n\t cy: sy,\n\t dir: 0\n\t };\n\t\n\t if (_trace(current, color, label, edgelabel)) {\n\t Fv = vertex2D(sx, sy, current.dir);\n\t Cv = Fv;\n\t ldir = current.dir;\n\t P = vertex2D(current.cx, current.cy, 0);\n\t P.prev = Cv;\n\t Cv.next = P;\n\t P.next = null;\n\t Cv = P;\n\t do {\n\t current.dir = (current.dir + 6) % 8;\n\t _trace(current, color, label, edgelabel);\n\t if (ldir != current.dir) {\n\t Cv.dir = current.dir;\n\t P = vertex2D(current.cx, current.cy, 0);\n\t P.prev = Cv;\n\t Cv.next = P;\n\t P.next = null;\n\t Cv = P;\n\t } else {\n\t Cv.dir = ldir;\n\t Cv.x = current.cx;\n\t Cv.y = current.cy;\n\t }\n\t ldir = current.dir;\n\t } while (current.cx != sx || current.cy != sy);\n\t Fv.prev = Cv.prev;\n\t Cv.prev.next = Fv;\n\t }\n\t return Fv;\n\t }\n\t\n\t return {\n\t trace: function trace(current, color, label, edgelabel) {\n\t return _trace(current, color, label, edgelabel);\n\t },\n\t contourTracing: function contourTracing(sy, sx, label, color, edgelabel) {\n\t return _contourTracing(sy, sx, label, color, edgelabel);\n\t }\n\t };\n\t }\n\t};\n\t\n\texports[\"default\"] = Tracer;\n\tmodule.exports = exports[\"default\"];\n\n/***/ },\n/* 23 */\n/***/ function(module, exports) {\n\n\t/* @preserve ASM BEGIN */\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\tfunction Skeletonizer(stdlib, foreign, buffer) {\n\t \"use asm\";\n\t\n\t var images = new stdlib.Uint8Array(buffer),\n\t size = foreign.size | 0,\n\t imul = stdlib.Math.imul;\n\t\n\t function erode(inImagePtr, outImagePtr) {\n\t inImagePtr = inImagePtr | 0;\n\t outImagePtr = outImagePtr | 0;\n\t\n\t var v = 0,\n\t u = 0,\n\t sum = 0,\n\t yStart1 = 0,\n\t yStart2 = 0,\n\t xStart1 = 0,\n\t xStart2 = 0,\n\t offset = 0;\n\t\n\t for (v = 1; (v | 0) < (size - 1 | 0); v = v + 1 | 0) {\n\t offset = offset + size | 0;\n\t for (u = 1; (u | 0) < (size - 1 | 0); u = u + 1 | 0) {\n\t yStart1 = offset - size | 0;\n\t yStart2 = offset + size | 0;\n\t xStart1 = u - 1 | 0;\n\t xStart2 = u + 1 | 0;\n\t 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;\n\t if ((sum | 0) == (5 | 0)) {\n\t images[outImagePtr + offset + u | 0] = 1;\n\t } else {\n\t images[outImagePtr + offset + u | 0] = 0;\n\t }\n\t }\n\t }\n\t return;\n\t }\n\t\n\t function subtract(aImagePtr, bImagePtr, outImagePtr) {\n\t aImagePtr = aImagePtr | 0;\n\t bImagePtr = bImagePtr | 0;\n\t outImagePtr = outImagePtr | 0;\n\t\n\t var length = 0;\n\t\n\t length = imul(size, size) | 0;\n\t\n\t while ((length | 0) > 0) {\n\t length = length - 1 | 0;\n\t images[outImagePtr + length | 0] = (images[aImagePtr + length | 0] | 0) - (images[bImagePtr + length | 0] | 0) | 0;\n\t }\n\t }\n\t\n\t function bitwiseOr(aImagePtr, bImagePtr, outImagePtr) {\n\t aImagePtr = aImagePtr | 0;\n\t bImagePtr = bImagePtr | 0;\n\t outImagePtr = outImagePtr | 0;\n\t\n\t var length = 0;\n\t\n\t length = imul(size, size) | 0;\n\t\n\t while ((length | 0) > 0) {\n\t length = length - 1 | 0;\n\t images[outImagePtr + length | 0] = images[aImagePtr + length | 0] | 0 | (images[bImagePtr + length | 0] | 0) | 0;\n\t }\n\t }\n\t\n\t function countNonZero(imagePtr) {\n\t imagePtr = imagePtr | 0;\n\t\n\t var sum = 0,\n\t length = 0;\n\t\n\t length = imul(size, size) | 0;\n\t\n\t while ((length | 0) > 0) {\n\t length = length - 1 | 0;\n\t sum = (sum | 0) + (images[imagePtr + length | 0] | 0) | 0;\n\t }\n\t\n\t return sum | 0;\n\t }\n\t\n\t function init(imagePtr, value) {\n\t imagePtr = imagePtr | 0;\n\t value = value | 0;\n\t\n\t var length = 0;\n\t\n\t length = imul(size, size) | 0;\n\t\n\t while ((length | 0) > 0) {\n\t length = length - 1 | 0;\n\t images[imagePtr + length | 0] = value;\n\t }\n\t }\n\t\n\t function dilate(inImagePtr, outImagePtr) {\n\t inImagePtr = inImagePtr | 0;\n\t outImagePtr = outImagePtr | 0;\n\t\n\t var v = 0,\n\t u = 0,\n\t sum = 0,\n\t yStart1 = 0,\n\t yStart2 = 0,\n\t xStart1 = 0,\n\t xStart2 = 0,\n\t offset = 0;\n\t\n\t for (v = 1; (v | 0) < (size - 1 | 0); v = v + 1 | 0) {\n\t offset = offset + size | 0;\n\t for (u = 1; (u | 0) < (size - 1 | 0); u = u + 1 | 0) {\n\t yStart1 = offset - size | 0;\n\t yStart2 = offset + size | 0;\n\t xStart1 = u - 1 | 0;\n\t xStart2 = u + 1 | 0;\n\t 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;\n\t if ((sum | 0) > (0 | 0)) {\n\t images[outImagePtr + offset + u | 0] = 1;\n\t } else {\n\t images[outImagePtr + offset + u | 0] = 0;\n\t }\n\t }\n\t }\n\t return;\n\t }\n\t\n\t function memcpy(srcImagePtr, dstImagePtr) {\n\t srcImagePtr = srcImagePtr | 0;\n\t dstImagePtr = dstImagePtr | 0;\n\t\n\t var length = 0;\n\t\n\t length = imul(size, size) | 0;\n\t\n\t while ((length | 0) > 0) {\n\t length = length - 1 | 0;\n\t images[dstImagePtr + length | 0] = images[srcImagePtr + length | 0] | 0;\n\t }\n\t }\n\t\n\t function zeroBorder(imagePtr) {\n\t imagePtr = imagePtr | 0;\n\t\n\t var x = 0,\n\t y = 0;\n\t\n\t for (x = 0; (x | 0) < (size - 1 | 0); x = x + 1 | 0) {\n\t images[imagePtr + x | 0] = 0;\n\t images[imagePtr + y | 0] = 0;\n\t y = y + size - 1 | 0;\n\t images[imagePtr + y | 0] = 0;\n\t y = y + 1 | 0;\n\t }\n\t for (x = 0; (x | 0) < (size | 0); x = x + 1 | 0) {\n\t images[imagePtr + y | 0] = 0;\n\t y = y + 1 | 0;\n\t }\n\t }\n\t\n\t function skeletonize() {\n\t var subImagePtr = 0,\n\t erodedImagePtr = 0,\n\t tempImagePtr = 0,\n\t skelImagePtr = 0,\n\t sum = 0,\n\t done = 0;\n\t\n\t erodedImagePtr = imul(size, size) | 0;\n\t tempImagePtr = erodedImagePtr + erodedImagePtr | 0;\n\t skelImagePtr = tempImagePtr + erodedImagePtr | 0;\n\t\n\t // init skel-image\n\t init(skelImagePtr, 0);\n\t zeroBorder(subImagePtr);\n\t\n\t do {\n\t erode(subImagePtr, erodedImagePtr);\n\t dilate(erodedImagePtr, tempImagePtr);\n\t subtract(subImagePtr, tempImagePtr, tempImagePtr);\n\t bitwiseOr(skelImagePtr, tempImagePtr, skelImagePtr);\n\t memcpy(erodedImagePtr, subImagePtr);\n\t sum = countNonZero(subImagePtr) | 0;\n\t done = (sum | 0) == 0 | 0;\n\t } while (!done);\n\t }\n\t\n\t return {\n\t skeletonize: skeletonize\n\t };\n\t}\n\t/* @preserve ASM END */\n\t\n\texports[\"default\"] = Skeletonizer;\n\tmodule.exports = exports[\"default\"];\n\n/***/ },\n/* 24 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports[\"default\"] = {\n\t drawRect: function drawRect(pos, size, ctx, style) {\n\t ctx.strokeStyle = style.color;\n\t ctx.fillStyle = style.color;\n\t ctx.lineWidth = 1;\n\t ctx.beginPath();\n\t ctx.strokeRect(pos.x, pos.y, size.x, size.y);\n\t },\n\t drawPath: function drawPath(path, def, ctx, style) {\n\t ctx.strokeStyle = style.color;\n\t ctx.fillStyle = style.color;\n\t ctx.lineWidth = style.lineWidth;\n\t ctx.beginPath();\n\t ctx.moveTo(path[0][def.x], path[0][def.y]);\n\t for (var j = 1; j < path.length; j++) {\n\t ctx.lineTo(path[j][def.x], path[j][def.y]);\n\t }\n\t ctx.closePath();\n\t ctx.stroke();\n\t },\n\t drawImage: function drawImage(imageData, size, ctx) {\n\t var canvasData = ctx.getImageData(0, 0, size.x, size.y),\n\t data = canvasData.data,\n\t imageDataPos = imageData.length,\n\t canvasDataPos = data.length,\n\t value;\n\t\n\t if (canvasDataPos / imageDataPos !== 4) {\n\t return false;\n\t }\n\t while (imageDataPos--) {\n\t value = imageData[imageDataPos];\n\t data[--canvasDataPos] = 255;\n\t data[--canvasDataPos] = value;\n\t data[--canvasDataPos] = value;\n\t data[--canvasDataPos] = value;\n\t }\n\t ctx.putImageData(canvasData, 0, 0);\n\t return true;\n\t }\n\t};\n\tmodule.exports = exports[\"default\"];\n\n/***/ },\n/* 25 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar _bresenham = __webpack_require__(26);\n\t\n\tvar _bresenham2 = _interopRequireDefault(_bresenham);\n\t\n\tvar _image_debug = __webpack_require__(24);\n\t\n\tvar _image_debug2 = _interopRequireDefault(_image_debug);\n\t\n\tvar _code_128_reader = __webpack_require__(27);\n\t\n\tvar _code_128_reader2 = _interopRequireDefault(_code_128_reader);\n\t\n\tvar _ean_reader = __webpack_require__(29);\n\t\n\tvar _ean_reader2 = _interopRequireDefault(_ean_reader);\n\t\n\tvar _code_39_reader = __webpack_require__(30);\n\t\n\tvar _code_39_reader2 = _interopRequireDefault(_code_39_reader);\n\t\n\tvar _code_39_vin_reader = __webpack_require__(31);\n\t\n\tvar _code_39_vin_reader2 = _interopRequireDefault(_code_39_vin_reader);\n\t\n\tvar _codabar_reader = __webpack_require__(32);\n\t\n\tvar _codabar_reader2 = _interopRequireDefault(_codabar_reader);\n\t\n\tvar _upc_reader = __webpack_require__(33);\n\t\n\tvar _upc_reader2 = _interopRequireDefault(_upc_reader);\n\t\n\tvar _ean_8_reader = __webpack_require__(34);\n\t\n\tvar _ean_8_reader2 = _interopRequireDefault(_ean_8_reader);\n\t\n\tvar _upc_e_reader = __webpack_require__(35);\n\t\n\tvar _upc_e_reader2 = _interopRequireDefault(_upc_e_reader);\n\t\n\tvar _i2of5_reader = __webpack_require__(36);\n\t\n\tvar _i2of5_reader2 = _interopRequireDefault(_i2of5_reader);\n\t\n\tvar readers = {\n\t code_128_reader: _code_128_reader2['default'],\n\t ean_reader: _ean_reader2['default'],\n\t ean_8_reader: _ean_8_reader2['default'],\n\t code_39_reader: _code_39_reader2['default'],\n\t code_39_vin_reader: _code_39_vin_reader2['default'],\n\t codabar_reader: _codabar_reader2['default'],\n\t upc_reader: _upc_reader2['default'],\n\t upc_e_reader: _upc_e_reader2['default'],\n\t i2of5_reader: _i2of5_reader2['default']\n\t};\n\texports['default'] = {\n\t create: function create(config, inputImageWrapper) {\n\t var _canvas = {\n\t ctx: {\n\t frequency: null,\n\t pattern: null,\n\t overlay: null\n\t },\n\t dom: {\n\t frequency: null,\n\t pattern: null,\n\t overlay: null\n\t }\n\t },\n\t _barcodeReaders = [];\n\t\n\t initCanvas();\n\t initReaders();\n\t initConfig();\n\t\n\t function initCanvas() {\n\t if (typeof document !== 'undefined') {\n\t var $debug = document.querySelector(\"#debug.detection\");\n\t _canvas.dom.frequency = document.querySelector(\"canvas.frequency\");\n\t if (!_canvas.dom.frequency) {\n\t _canvas.dom.frequency = document.createElement(\"canvas\");\n\t _canvas.dom.frequency.className = \"frequency\";\n\t if ($debug) {\n\t $debug.appendChild(_canvas.dom.frequency);\n\t }\n\t }\n\t _canvas.ctx.frequency = _canvas.dom.frequency.getContext(\"2d\");\n\t\n\t _canvas.dom.pattern = document.querySelector(\"canvas.patternBuffer\");\n\t if (!_canvas.dom.pattern) {\n\t _canvas.dom.pattern = document.createElement(\"canvas\");\n\t _canvas.dom.pattern.className = \"patternBuffer\";\n\t if ($debug) {\n\t $debug.appendChild(_canvas.dom.pattern);\n\t }\n\t }\n\t _canvas.ctx.pattern = _canvas.dom.pattern.getContext(\"2d\");\n\t\n\t _canvas.dom.overlay = document.querySelector(\"canvas.drawingBuffer\");\n\t if (_canvas.dom.overlay) {\n\t _canvas.ctx.overlay = _canvas.dom.overlay.getContext(\"2d\");\n\t }\n\t }\n\t }\n\t\n\t function initReaders() {\n\t config.readers.forEach(function (readerConfig) {\n\t var reader,\n\t config = {};\n\t\n\t if (typeof readerConfig === 'object') {\n\t reader = readerConfig.format;\n\t config = readerConfig.config;\n\t } else if (typeof readerConfig === 'string') {\n\t reader = readerConfig;\n\t }\n\t _barcodeReaders.push(new readers[reader](config));\n\t });\n\t console.log(\"Registered Readers: \" + _barcodeReaders.map(function (reader) {\n\t return JSON.stringify({ format: reader.FORMAT, config: reader.config });\n\t }).join(', '));\n\t }\n\t\n\t function initConfig() {\n\t if (typeof document !== 'undefined') {\n\t var i,\n\t vis = [{\n\t node: _canvas.dom.frequency,\n\t prop: config.showFrequency\n\t }, {\n\t node: _canvas.dom.pattern,\n\t prop: config.showPattern\n\t }];\n\t\n\t for (i = 0; i < vis.length; i++) {\n\t if (vis[i].prop === true) {\n\t vis[i].node.style.display = \"block\";\n\t } else {\n\t vis[i].node.style.display = \"none\";\n\t }\n\t }\n\t }\n\t }\n\t\n\t /**\n\t * extend the line on both ends\n\t * @param {Array} line\n\t * @param {Number} angle\n\t */\n\t function getExtendedLine(line, angle, ext) {\n\t function extendLine(amount) {\n\t var extension = {\n\t y: amount * Math.sin(angle),\n\t x: amount * Math.cos(angle)\n\t };\n\t\n\t line[0].y -= extension.y;\n\t line[0].x -= extension.x;\n\t line[1].y += extension.y;\n\t line[1].x += extension.x;\n\t }\n\t\n\t // check if inside image\n\t extendLine(ext);\n\t while (ext > 1 && (!inputImageWrapper.inImageWithBorder(line[0], 0) || !inputImageWrapper.inImageWithBorder(line[1], 0))) {\n\t ext -= Math.ceil(ext / 2);\n\t extendLine(-ext);\n\t }\n\t return line;\n\t }\n\t\n\t function getLine(box) {\n\t return [{\n\t x: (box[1][0] - box[0][0]) / 2 + box[0][0],\n\t y: (box[1][1] - box[0][1]) / 2 + box[0][1]\n\t }, {\n\t x: (box[3][0] - box[2][0]) / 2 + box[2][0],\n\t y: (box[3][1] - box[2][1]) / 2 + box[2][1]\n\t }];\n\t }\n\t\n\t function tryDecode(line) {\n\t var result = null,\n\t i,\n\t barcodeLine = _bresenham2['default'].getBarcodeLine(inputImageWrapper, line[0], line[1]);\n\t\n\t if (config.showFrequency) {\n\t _image_debug2['default'].drawPath(line, { x: 'x', y: 'y' }, _canvas.ctx.overlay, { color: 'red', lineWidth: 3 });\n\t _bresenham2['default'].debug.printFrequency(barcodeLine.line, _canvas.dom.frequency);\n\t }\n\t _bresenham2['default'].toBinaryLine(barcodeLine);\n\t if (config.showPattern) {\n\t _bresenham2['default'].debug.printPattern(barcodeLine.line, _canvas.dom.pattern);\n\t }\n\t\n\t for (i = 0; i < _barcodeReaders.length && result === null; i++) {\n\t result = _barcodeReaders[i].decodePattern(barcodeLine.line);\n\t }\n\t if (result === null) {\n\t return null;\n\t }\n\t return {\n\t codeResult: result,\n\t barcodeLine: barcodeLine\n\t };\n\t }\n\t\n\t /**\n\t * This method slices the given area apart and tries to detect a barcode-pattern\n\t * for each slice. It returns the decoded barcode, or null if nothing was found\n\t * @param {Array} box\n\t * @param {Array} line\n\t * @param {Number} lineAngle\n\t */\n\t function tryDecodeBruteForce(box, line, lineAngle) {\n\t var sideLength = Math.sqrt(Math.pow(box[1][0] - box[0][0], 2) + Math.pow(box[1][1] - box[0][1], 2)),\n\t i,\n\t slices = 16,\n\t result = null,\n\t dir,\n\t extension,\n\t xdir = Math.sin(lineAngle),\n\t ydir = Math.cos(lineAngle);\n\t\n\t for (i = 1; i < slices && result === null; i++) {\n\t // move line perpendicular to angle\n\t dir = sideLength / slices * i * (i % 2 === 0 ? -1 : 1);\n\t extension = {\n\t y: dir * xdir,\n\t x: dir * ydir\n\t };\n\t line[0].y += extension.x;\n\t line[0].x -= extension.y;\n\t line[1].y += extension.x;\n\t line[1].x -= extension.y;\n\t\n\t result = tryDecode(line);\n\t }\n\t return result;\n\t }\n\t\n\t function getLineLength(line) {\n\t return Math.sqrt(Math.pow(Math.abs(line[1].y - line[0].y), 2) + Math.pow(Math.abs(line[1].x - line[0].x), 2));\n\t }\n\t\n\t /**\n\t * With the help of the configured readers (Code128 or EAN) this function tries to detect a\n\t * valid barcode pattern within the given area.\n\t * @param {Object} box The area to search in\n\t * @returns {Object} the result {codeResult, line, angle, pattern, threshold}\n\t */\n\t function _decodeFromBoundingBox(box) {\n\t var line,\n\t lineAngle,\n\t ctx = _canvas.ctx.overlay,\n\t result,\n\t lineLength;\n\t\n\t if (config.drawBoundingBox && ctx) {\n\t _image_debug2['default'].drawPath(box, { x: 0, y: 1 }, ctx, { color: \"blue\", lineWidth: 2 });\n\t }\n\t\n\t line = getLine(box);\n\t lineLength = getLineLength(line);\n\t lineAngle = Math.atan2(line[1].y - line[0].y, line[1].x - line[0].x);\n\t line = getExtendedLine(line, lineAngle, Math.floor(lineLength * 0.1));\n\t if (line === null) {\n\t return null;\n\t }\n\t\n\t result = tryDecode(line);\n\t if (result === null) {\n\t result = tryDecodeBruteForce(box, line, lineAngle);\n\t }\n\t\n\t if (result === null) {\n\t return null;\n\t }\n\t\n\t if (result && config.drawScanline && ctx) {\n\t _image_debug2['default'].drawPath(line, { x: 'x', y: 'y' }, ctx, { color: 'red', lineWidth: 3 });\n\t }\n\t\n\t return {\n\t codeResult: result.codeResult,\n\t line: line,\n\t angle: lineAngle,\n\t pattern: result.barcodeLine.line,\n\t threshold: result.barcodeLine.threshold\n\t };\n\t }\n\t\n\t return {\n\t decodeFromBoundingBox: function decodeFromBoundingBox(box) {\n\t return _decodeFromBoundingBox(box);\n\t },\n\t decodeFromBoundingBoxes: function decodeFromBoundingBoxes(boxes) {\n\t var i, result;\n\t for (i = 0; i < boxes.length; i++) {\n\t result = _decodeFromBoundingBox(boxes[i]);\n\t if (result && result.codeResult) {\n\t result.box = boxes[i];\n\t return result;\n\t }\n\t }\n\t },\n\t setReaders: function setReaders(readers) {\n\t config.readers = readers;\n\t _barcodeReaders.length = 0;\n\t initReaders();\n\t }\n\t };\n\t }\n\t};\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 26 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar _cv_utils = __webpack_require__(7);\n\t\n\tvar _cv_utils2 = _interopRequireDefault(_cv_utils);\n\t\n\tvar _image_wrapper = __webpack_require__(5);\n\t\n\tvar _image_wrapper2 = _interopRequireDefault(_image_wrapper);\n\t\n\tvar Bresenham = {};\n\t\n\tvar Slope = {\n\t DIR: {\n\t UP: 1,\n\t DOWN: -1\n\t }\n\t};\n\t/**\n\t * Scans a line of the given image from point p1 to p2 and returns a result object containing\n\t * gray-scale values (0-255) of the underlying pixels in addition to the min\n\t * and max values.\n\t * @param {Object} imageWrapper\n\t * @param {Object} p1 The start point {x,y}\n\t * @param {Object} p2 The end point {x,y}\n\t * @returns {line, min, max}\n\t */\n\tBresenham.getBarcodeLine = function (imageWrapper, p1, p2) {\n\t var x0 = p1.x | 0,\n\t y0 = p1.y | 0,\n\t x1 = p2.x | 0,\n\t y1 = p2.y | 0,\n\t steep = Math.abs(y1 - y0) > Math.abs(x1 - x0),\n\t deltax,\n\t deltay,\n\t error,\n\t ystep,\n\t y,\n\t tmp,\n\t x,\n\t line = [],\n\t imageData = imageWrapper.data,\n\t width = imageWrapper.size.x,\n\t sum = 0,\n\t val,\n\t min = 255,\n\t max = 0;\n\t\n\t function read(a, b) {\n\t val = imageData[b * width + a];\n\t sum += val;\n\t min = val < min ? val : min;\n\t max = val > max ? val : max;\n\t line.push(val);\n\t }\n\t\n\t if (steep) {\n\t tmp = x0;\n\t x0 = y0;\n\t y0 = tmp;\n\t\n\t tmp = x1;\n\t x1 = y1;\n\t y1 = tmp;\n\t }\n\t if (x0 > x1) {\n\t tmp = x0;\n\t x0 = x1;\n\t x1 = tmp;\n\t\n\t tmp = y0;\n\t y0 = y1;\n\t y1 = tmp;\n\t }\n\t deltax = x1 - x0;\n\t deltay = Math.abs(y1 - y0);\n\t error = deltax / 2 | 0;\n\t y = y0;\n\t ystep = y0 < y1 ? 1 : -1;\n\t for (x = x0; x < x1; x++) {\n\t if (steep) {\n\t read(y, x);\n\t } else {\n\t read(x, y);\n\t }\n\t error = error - deltay;\n\t if (error < 0) {\n\t y = y + ystep;\n\t error = error + deltax;\n\t }\n\t }\n\t\n\t return {\n\t line: line,\n\t min: min,\n\t max: max\n\t };\n\t};\n\t\n\tBresenham.toOtsuBinaryLine = function (result) {\n\t var line = result.line,\n\t image = new _image_wrapper2['default']({ x: line.length - 1, y: 1 }, line),\n\t threshold = _cv_utils2['default'].determineOtsuThreshold(image, 5);\n\t\n\t line = _cv_utils2['default'].sharpenLine(line);\n\t _cv_utils2['default'].thresholdImage(image, threshold);\n\t\n\t return {\n\t line: line,\n\t threshold: threshold\n\t };\n\t};\n\t\n\t/**\n\t * Converts the result from getBarcodeLine into a binary representation\n\t * also considering the frequency and slope of the signal for more robust results\n\t * @param {Object} result {line, min, max}\n\t */\n\tBresenham.toBinaryLine = function (result) {\n\t\n\t var min = result.min,\n\t max = result.max,\n\t line = result.line,\n\t slope,\n\t slope2,\n\t center = min + (max - min) / 2,\n\t extrema = [],\n\t currentDir,\n\t dir,\n\t threshold = (max - min) / 12,\n\t rThreshold = -threshold,\n\t i,\n\t j;\n\t\n\t // 1. find extrema\n\t currentDir = line[0] > center ? Slope.DIR.UP : Slope.DIR.DOWN;\n\t extrema.push({\n\t pos: 0,\n\t val: line[0]\n\t });\n\t for (i = 0; i < line.length - 2; i++) {\n\t slope = line[i + 1] - line[i];\n\t slope2 = line[i + 2] - line[i + 1];\n\t if (slope + slope2 < rThreshold && line[i + 1] < center * 1.5) {\n\t dir = Slope.DIR.DOWN;\n\t } else if (slope + slope2 > threshold && line[i + 1] > center * 0.5) {\n\t dir = Slope.DIR.UP;\n\t } else {\n\t dir = currentDir;\n\t }\n\t\n\t if (currentDir !== dir) {\n\t extrema.push({\n\t pos: i,\n\t val: line[i]\n\t });\n\t currentDir = dir;\n\t }\n\t }\n\t extrema.push({\n\t pos: line.length,\n\t val: line[line.length - 1]\n\t });\n\t\n\t for (j = extrema[0].pos; j < extrema[1].pos; j++) {\n\t line[j] = line[j] > center ? 0 : 1;\n\t }\n\t\n\t // iterate over extrema and convert to binary based on avg between minmax\n\t for (i = 1; i < extrema.length - 1; i++) {\n\t if (extrema[i + 1].val > extrema[i].val) {\n\t threshold = extrema[i].val + (extrema[i + 1].val - extrema[i].val) / 3 * 2 | 0;\n\t } else {\n\t threshold = extrema[i + 1].val + (extrema[i].val - extrema[i + 1].val) / 3 | 0;\n\t }\n\t\n\t for (j = extrema[i].pos; j < extrema[i + 1].pos; j++) {\n\t line[j] = line[j] > threshold ? 0 : 1;\n\t }\n\t }\n\t\n\t return {\n\t line: line,\n\t threshold: threshold\n\t };\n\t};\n\t\n\t/**\n\t * Used for development only\n\t */\n\tBresenham.debug = {\n\t printFrequency: function printFrequency(line, canvas) {\n\t var i,\n\t ctx = canvas.getContext(\"2d\");\n\t canvas.width = line.length;\n\t canvas.height = 256;\n\t\n\t ctx.beginPath();\n\t ctx.strokeStyle = \"blue\";\n\t for (i = 0; i < line.length; i++) {\n\t ctx.moveTo(i, 255);\n\t ctx.lineTo(i, 255 - line[i]);\n\t }\n\t ctx.stroke();\n\t ctx.closePath();\n\t },\n\t\n\t printPattern: function printPattern(line, canvas) {\n\t var ctx = canvas.getContext(\"2d\"),\n\t i;\n\t\n\t canvas.width = line.length;\n\t ctx.fillColor = \"black\";\n\t for (i = 0; i < line.length; i++) {\n\t if (line[i] === 1) {\n\t ctx.fillRect(i, 0, 1, 100);\n\t }\n\t }\n\t }\n\t};\n\t\n\texports['default'] = Bresenham;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 27 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\t\n\tvar _barcode_reader = __webpack_require__(28);\n\t\n\tvar _barcode_reader2 = _interopRequireDefault(_barcode_reader);\n\t\n\tfunction Code128Reader() {\n\t _barcode_reader2[\"default\"].call(this);\n\t}\n\t\n\tvar properties = {\n\t CODE_SHIFT: { value: 98 },\n\t CODE_C: { value: 99 },\n\t CODE_B: { value: 100 },\n\t CODE_A: { value: 101 },\n\t START_CODE_A: { value: 103 },\n\t START_CODE_B: { value: 104 },\n\t START_CODE_C: { value: 105 },\n\t STOP_CODE: { value: 106 },\n\t MODULO: { value: 11 },\n\t 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]] },\n\t SINGLE_CODE_ERROR: { value: 1 },\n\t AVG_CODE_ERROR: { value: 0.5 },\n\t FORMAT: { value: \"code_128\", writeable: false }\n\t};\n\t\n\tCode128Reader.prototype = Object.create(_barcode_reader2[\"default\"].prototype, properties);\n\tCode128Reader.prototype.constructor = Code128Reader;\n\t\n\tCode128Reader.prototype._decodeCode = function (start) {\n\t var counter = [0, 0, 0, 0, 0, 0],\n\t i,\n\t self = this,\n\t offset = start,\n\t isWhite = !self._row[offset],\n\t counterPos = 0,\n\t bestMatch = {\n\t error: Number.MAX_VALUE,\n\t code: -1,\n\t start: start,\n\t end: start\n\t },\n\t code,\n\t error,\n\t normalized;\n\t\n\t for (i = offset; i < self._row.length; i++) {\n\t if (self._row[i] ^ isWhite) {\n\t counter[counterPos]++;\n\t } else {\n\t if (counterPos === counter.length - 1) {\n\t normalized = self._normalize(counter);\n\t if (normalized) {\n\t for (code = 0; code < self.CODE_PATTERN.length; code++) {\n\t error = self._matchPattern(normalized, self.CODE_PATTERN[code]);\n\t if (error < bestMatch.error) {\n\t bestMatch.code = code;\n\t bestMatch.error = error;\n\t }\n\t }\n\t bestMatch.end = i;\n\t return bestMatch;\n\t }\n\t } else {\n\t counterPos++;\n\t }\n\t counter[counterPos] = 1;\n\t isWhite = !isWhite;\n\t }\n\t }\n\t return null;\n\t};\n\t\n\tCode128Reader.prototype._findStart = function () {\n\t var counter = [0, 0, 0, 0, 0, 0],\n\t i,\n\t self = this,\n\t offset = self._nextSet(self._row),\n\t isWhite = false,\n\t counterPos = 0,\n\t bestMatch = {\n\t error: Number.MAX_VALUE,\n\t code: -1,\n\t start: 0,\n\t end: 0\n\t },\n\t code,\n\t error,\n\t j,\n\t sum,\n\t normalized;\n\t\n\t for (i = offset; i < self._row.length; i++) {\n\t if (self._row[i] ^ isWhite) {\n\t counter[counterPos]++;\n\t } else {\n\t if (counterPos === counter.length - 1) {\n\t sum = 0;\n\t for (j = 0; j < counter.length; j++) {\n\t sum += counter[j];\n\t }\n\t normalized = self._normalize(counter);\n\t if (normalized) {\n\t for (code = self.START_CODE_A; code <= self.START_CODE_C; code++) {\n\t error = self._matchPattern(normalized, self.CODE_PATTERN[code]);\n\t if (error < bestMatch.error) {\n\t bestMatch.code = code;\n\t bestMatch.error = error;\n\t }\n\t }\n\t if (bestMatch.error < self.AVG_CODE_ERROR) {\n\t bestMatch.start = i - sum;\n\t bestMatch.end = i;\n\t return bestMatch;\n\t }\n\t }\n\t\n\t for (j = 0; j < 4; j++) {\n\t counter[j] = counter[j + 2];\n\t }\n\t counter[4] = 0;\n\t counter[5] = 0;\n\t counterPos--;\n\t } else {\n\t counterPos++;\n\t }\n\t counter[counterPos] = 1;\n\t isWhite = !isWhite;\n\t }\n\t }\n\t return null;\n\t};\n\t\n\tCode128Reader.prototype._decode = function () {\n\t var self = this,\n\t startInfo = self._findStart(),\n\t code = null,\n\t done = false,\n\t result = [],\n\t multiplier = 0,\n\t checksum = 0,\n\t codeset,\n\t rawResult = [],\n\t decodedCodes = [],\n\t shiftNext = false,\n\t unshift,\n\t lastCharacterWasPrintable;\n\t\n\t if (startInfo === null) {\n\t return null;\n\t }\n\t code = {\n\t code: startInfo.code,\n\t start: startInfo.start,\n\t end: startInfo.end\n\t };\n\t decodedCodes.push(code);\n\t checksum = code.code;\n\t switch (code.code) {\n\t case self.START_CODE_A:\n\t codeset = self.CODE_A;\n\t break;\n\t case self.START_CODE_B:\n\t codeset = self.CODE_B;\n\t break;\n\t case self.START_CODE_C:\n\t codeset = self.CODE_C;\n\t break;\n\t default:\n\t return null;\n\t }\n\t\n\t while (!done) {\n\t unshift = shiftNext;\n\t shiftNext = false;\n\t code = self._decodeCode(code.end);\n\t if (code !== null) {\n\t if (code.code !== self.STOP_CODE) {\n\t rawResult.push(code.code);\n\t multiplier++;\n\t checksum += multiplier * code.code;\n\t }\n\t decodedCodes.push(code);\n\t\n\t switch (codeset) {\n\t case self.CODE_A:\n\t if (code.code < 64) {\n\t result.push(String.fromCharCode(32 + code.code));\n\t } else if (code.code < 96) {\n\t result.push(String.fromCharCode(code.code - 64));\n\t } else {\n\t switch (code.code) {\n\t case self.CODE_SHIFT:\n\t shiftNext = true;\n\t codeset = self.CODE_B;\n\t break;\n\t case self.CODE_B:\n\t codeset = self.CODE_B;\n\t break;\n\t case self.CODE_C:\n\t codeset = self.CODE_C;\n\t break;\n\t case self.STOP_CODE:\n\t done = true;\n\t break;\n\t }\n\t }\n\t break;\n\t case self.CODE_B:\n\t if (code.code < 96) {\n\t result.push(String.fromCharCode(32 + code.code));\n\t } else {\n\t if (code.code != self.STOP_CODE) {\n\t lastCharacterWasPrintable = false;\n\t }\n\t switch (code.code) {\n\t case self.CODE_SHIFT:\n\t shiftNext = true;\n\t codeset = self.CODE_A;\n\t break;\n\t case self.CODE_A:\n\t codeset = self.CODE_A;\n\t break;\n\t case self.CODE_C:\n\t codeset = self.CODE_C;\n\t break;\n\t case self.STOP_CODE:\n\t done = true;\n\t break;\n\t }\n\t }\n\t break;\n\t case self.CODE_C:\n\t if (code.code < 100) {\n\t result.push(code.code < 10 ? \"0\" + code.code : code.code);\n\t }\n\t switch (code.code) {\n\t case self.CODE_A:\n\t codeset = self.CODE_A;\n\t break;\n\t case self.CODE_B:\n\t codeset = self.CODE_B;\n\t break;\n\t case self.STOP_CODE:\n\t done = true;\n\t break;\n\t }\n\t break;\n\t }\n\t } else {\n\t done = true;\n\t }\n\t if (unshift) {\n\t codeset = codeset == self.CODE_A ? self.CODE_B : self.CODE_A;\n\t }\n\t }\n\t\n\t if (code === null) {\n\t return null;\n\t }\n\t\n\t // find end bar\n\t code.end = self._nextUnset(self._row, code.end);\n\t if (!self._verifyTrailingWhitespace(code)) {\n\t return null;\n\t }\n\t\n\t // checksum\n\t // Does not work correctly yet!!! startcode - endcode?\n\t checksum -= multiplier * rawResult[rawResult.length - 1];\n\t if (checksum % 103 != rawResult[rawResult.length - 1]) {\n\t return null;\n\t }\n\t\n\t if (!result.length) {\n\t return null;\n\t }\n\t\n\t // remove last code from result (checksum)\n\t result.splice(result.length - 1, 1);\n\t\n\t return {\n\t code: result.join(\"\"),\n\t start: startInfo.start,\n\t end: code.end,\n\t codeset: codeset,\n\t startInfo: startInfo,\n\t decodedCodes: decodedCodes,\n\t endInfo: code\n\t };\n\t};\n\t\n\t_barcode_reader2[\"default\"].prototype._verifyTrailingWhitespace = function (endInfo) {\n\t var self = this,\n\t trailingWhitespaceEnd;\n\t\n\t trailingWhitespaceEnd = endInfo.end + (endInfo.end - endInfo.start) / 2;\n\t if (trailingWhitespaceEnd < self._row.length) {\n\t if (self._matchRange(endInfo.end, trailingWhitespaceEnd, 0)) {\n\t return endInfo;\n\t }\n\t }\n\t return null;\n\t};\n\t\n\texports[\"default\"] = Code128Reader;\n\tmodule.exports = exports[\"default\"];\n\n/***/ },\n/* 28 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\tfunction BarcodeReader(config) {\n\t this._row = [];\n\t this.config = config || {};\n\t return this;\n\t}\n\t\n\tBarcodeReader.prototype._nextUnset = function (line, start) {\n\t var i;\n\t\n\t if (start === undefined) {\n\t start = 0;\n\t }\n\t for (i = start; i < line.length; i++) {\n\t if (!line[i]) {\n\t return i;\n\t }\n\t }\n\t return line.length;\n\t};\n\t\n\tBarcodeReader.prototype._matchPattern = function (counter, code) {\n\t var i,\n\t error = 0,\n\t singleError = 0,\n\t modulo = this.MODULO,\n\t maxSingleError = this.SINGLE_CODE_ERROR || 1;\n\t\n\t for (i = 0; i < counter.length; i++) {\n\t singleError = Math.abs(code[i] - counter[i]);\n\t if (singleError > maxSingleError) {\n\t return Number.MAX_VALUE;\n\t }\n\t error += singleError;\n\t }\n\t return error / modulo;\n\t};\n\t\n\tBarcodeReader.prototype._nextSet = function (line, offset) {\n\t var i;\n\t\n\t offset = offset || 0;\n\t for (i = offset; i < line.length; i++) {\n\t if (line[i]) {\n\t return i;\n\t }\n\t }\n\t return line.length;\n\t};\n\t\n\tBarcodeReader.prototype._normalize = function (counter, modulo) {\n\t var i,\n\t self = this,\n\t sum = 0,\n\t ratio,\n\t numOnes = 0,\n\t normalized = [],\n\t norm = 0;\n\t\n\t if (!modulo) {\n\t modulo = self.MODULO;\n\t }\n\t for (i = 0; i < counter.length; i++) {\n\t if (counter[i] === 1) {\n\t numOnes++;\n\t } else {\n\t sum += counter[i];\n\t }\n\t }\n\t ratio = sum / (modulo - numOnes);\n\t if (ratio > 1.0) {\n\t for (i = 0; i < counter.length; i++) {\n\t norm = counter[i] === 1 ? counter[i] : counter[i] / ratio;\n\t normalized.push(norm);\n\t }\n\t } else {\n\t ratio = (sum + numOnes) / modulo;\n\t for (i = 0; i < counter.length; i++) {\n\t norm = counter[i] / ratio;\n\t normalized.push(norm);\n\t }\n\t }\n\t return normalized;\n\t};\n\t\n\tBarcodeReader.prototype._matchTrace = function (cmpCounter, epsilon) {\n\t var counter = [],\n\t i,\n\t self = this,\n\t offset = self._nextSet(self._row),\n\t isWhite = !self._row[offset],\n\t counterPos = 0,\n\t bestMatch = {\n\t error: Number.MAX_VALUE,\n\t code: -1,\n\t start: 0\n\t },\n\t error;\n\t\n\t if (cmpCounter) {\n\t for (i = 0; i < cmpCounter.length; i++) {\n\t counter.push(0);\n\t }\n\t for (i = offset; i < self._row.length; i++) {\n\t if (self._row[i] ^ isWhite) {\n\t counter[counterPos]++;\n\t } else {\n\t if (counterPos === counter.length - 1) {\n\t error = self._matchPattern(counter, cmpCounter);\n\t\n\t if (error < epsilon) {\n\t bestMatch.start = i - offset;\n\t bestMatch.end = i;\n\t bestMatch.counter = counter;\n\t return bestMatch;\n\t } else {\n\t return null;\n\t }\n\t } else {\n\t counterPos++;\n\t }\n\t counter[counterPos] = 1;\n\t isWhite = !isWhite;\n\t }\n\t }\n\t } else {\n\t counter.push(0);\n\t for (i = offset; i < self._row.length; i++) {\n\t if (self._row[i] ^ isWhite) {\n\t counter[counterPos]++;\n\t } else {\n\t counterPos++;\n\t counter.push(0);\n\t counter[counterPos] = 1;\n\t isWhite = !isWhite;\n\t }\n\t }\n\t }\n\t\n\t // if cmpCounter was not given\n\t bestMatch.start = offset;\n\t bestMatch.end = self._row.length - 1;\n\t bestMatch.counter = counter;\n\t return bestMatch;\n\t};\n\t\n\tBarcodeReader.prototype.decodePattern = function (pattern) {\n\t var self = this,\n\t result;\n\t\n\t self._row = pattern;\n\t result = self._decode();\n\t if (result === null) {\n\t self._row.reverse();\n\t result = self._decode();\n\t if (result) {\n\t result.direction = BarcodeReader.DIRECTION.REVERSE;\n\t result.start = self._row.length - result.start;\n\t result.end = self._row.length - result.end;\n\t }\n\t } else {\n\t result.direction = BarcodeReader.DIRECTION.FORWARD;\n\t }\n\t if (result) {\n\t result.format = self.FORMAT;\n\t }\n\t return result;\n\t};\n\t\n\tBarcodeReader.prototype._matchRange = function (start, end, value) {\n\t var i;\n\t\n\t start = start < 0 ? 0 : start;\n\t for (i = start; i < end; i++) {\n\t if (this._row[i] !== value) {\n\t return false;\n\t }\n\t }\n\t return true;\n\t};\n\t\n\tBarcodeReader.prototype._fillCounters = function (offset, end, isWhite) {\n\t var self = this,\n\t counterPos = 0,\n\t i,\n\t counters = [];\n\t\n\t isWhite = typeof isWhite !== 'undefined' ? isWhite : true;\n\t offset = typeof offset !== 'undefined' ? offset : self._nextUnset(self._row);\n\t end = end || self._row.length;\n\t\n\t counters[counterPos] = 0;\n\t for (i = offset; i < end; i++) {\n\t if (self._row[i] ^ isWhite) {\n\t counters[counterPos]++;\n\t } else {\n\t counterPos++;\n\t counters[counterPos] = 1;\n\t isWhite = !isWhite;\n\t }\n\t }\n\t return counters;\n\t};\n\t\n\tObject.defineProperty(BarcodeReader.prototype, \"FORMAT\", {\n\t value: 'unknown',\n\t writeable: false\n\t});\n\t\n\tBarcodeReader.DIRECTION = {\n\t FORWARD: 1,\n\t REVERSE: -1\n\t};\n\t\n\tBarcodeReader.Exception = {\n\t StartNotFoundException: \"Start-Info was not found!\",\n\t CodeNotFoundException: \"Code could not be found!\",\n\t PatternNotFoundException: \"Pattern could not be found!\"\n\t};\n\t\n\tBarcodeReader.CONFIG_KEYS = {};\n\t\n\texports['default'] = BarcodeReader;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 29 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\t\n\tvar _barcode_reader = __webpack_require__(28);\n\t\n\tvar _barcode_reader2 = _interopRequireDefault(_barcode_reader);\n\t\n\tfunction EANReader(opts) {\n\t _barcode_reader2[\"default\"].call(this, opts);\n\t}\n\t\n\tvar properties = {\n\t CODE_L_START: { value: 0 },\n\t MODULO: { value: 7 },\n\t CODE_G_START: { value: 10 },\n\t START_PATTERN: { value: [1 / 3 * 7, 1 / 3 * 7, 1 / 3 * 7] },\n\t STOP_PATTERN: { value: [1 / 3 * 7, 1 / 3 * 7, 1 / 3 * 7] },\n\t MIDDLE_PATTERN: { value: [1 / 5 * 7, 1 / 5 * 7, 1 / 5 * 7, 1 / 5 * 7, 1 / 5 * 7] },\n\t 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]] },\n\t CODE_FREQUENCY: { value: [0, 11, 13, 14, 19, 25, 28, 21, 22, 26] },\n\t SINGLE_CODE_ERROR: { value: 0.67 },\n\t AVG_CODE_ERROR: { value: 0.27 },\n\t FORMAT: { value: \"ean_13\", writeable: false }\n\t};\n\t\n\tEANReader.prototype = Object.create(_barcode_reader2[\"default\"].prototype, properties);\n\tEANReader.prototype.constructor = EANReader;\n\t\n\tEANReader.prototype._decodeCode = function (start, coderange) {\n\t var counter = [0, 0, 0, 0],\n\t i,\n\t self = this,\n\t offset = start,\n\t isWhite = !self._row[offset],\n\t counterPos = 0,\n\t bestMatch = {\n\t error: Number.MAX_VALUE,\n\t code: -1,\n\t start: start,\n\t end: start\n\t },\n\t code,\n\t error,\n\t normalized;\n\t\n\t if (!coderange) {\n\t coderange = self.CODE_PATTERN.length;\n\t }\n\t\n\t for (i = offset; i < self._row.length; i++) {\n\t if (self._row[i] ^ isWhite) {\n\t counter[counterPos]++;\n\t } else {\n\t if (counterPos === counter.length - 1) {\n\t normalized = self._normalize(counter);\n\t if (normalized) {\n\t for (code = 0; code < coderange; code++) {\n\t error = self._matchPattern(normalized, self.CODE_PATTERN[code]);\n\t if (error < bestMatch.error) {\n\t bestMatch.code = code;\n\t bestMatch.error = error;\n\t }\n\t }\n\t bestMatch.end = i;\n\t if (bestMatch.error > self.AVG_CODE_ERROR) {\n\t return null;\n\t }\n\t return bestMatch;\n\t }\n\t } else {\n\t counterPos++;\n\t }\n\t counter[counterPos] = 1;\n\t isWhite = !isWhite;\n\t }\n\t }\n\t return null;\n\t};\n\t\n\tEANReader.prototype._findPattern = function (pattern, offset, isWhite, tryHarder, epsilon) {\n\t var counter = [],\n\t self = this,\n\t i,\n\t counterPos = 0,\n\t bestMatch = {\n\t error: Number.MAX_VALUE,\n\t code: -1,\n\t start: 0,\n\t end: 0\n\t },\n\t error,\n\t j,\n\t sum,\n\t normalized;\n\t\n\t if (!offset) {\n\t offset = self._nextSet(self._row);\n\t }\n\t\n\t if (isWhite === undefined) {\n\t isWhite = false;\n\t }\n\t\n\t if (tryHarder === undefined) {\n\t tryHarder = true;\n\t }\n\t\n\t if (epsilon === undefined) {\n\t epsilon = self.AVG_CODE_ERROR;\n\t }\n\t\n\t for (i = 0; i < pattern.length; i++) {\n\t counter[i] = 0;\n\t }\n\t\n\t for (i = offset; i < self._row.length; i++) {\n\t if (self._row[i] ^ isWhite) {\n\t counter[counterPos]++;\n\t } else {\n\t if (counterPos === counter.length - 1) {\n\t sum = 0;\n\t for (j = 0; j < counter.length; j++) {\n\t sum += counter[j];\n\t }\n\t normalized = self._normalize(counter);\n\t if (normalized) {\n\t error = self._matchPattern(normalized, pattern);\n\t\n\t if (error < epsilon) {\n\t bestMatch.error = error;\n\t bestMatch.start = i - sum;\n\t bestMatch.end = i;\n\t return bestMatch;\n\t }\n\t }\n\t if (tryHarder) {\n\t for (j = 0; j < counter.length - 2; j++) {\n\t counter[j] = counter[j + 2];\n\t }\n\t counter[counter.length - 2] = 0;\n\t counter[counter.length - 1] = 0;\n\t counterPos--;\n\t } else {\n\t return null;\n\t }\n\t } else {\n\t counterPos++;\n\t }\n\t counter[counterPos] = 1;\n\t isWhite = !isWhite;\n\t }\n\t }\n\t return null;\n\t};\n\t\n\tEANReader.prototype._findStart = function () {\n\t var self = this,\n\t leadingWhitespaceStart,\n\t offset = self._nextSet(self._row),\n\t startInfo;\n\t\n\t while (!startInfo) {\n\t startInfo = self._findPattern(self.START_PATTERN, offset);\n\t if (!startInfo) {\n\t return null;\n\t }\n\t leadingWhitespaceStart = startInfo.start - (startInfo.end - startInfo.start);\n\t if (leadingWhitespaceStart >= 0) {\n\t if (self._matchRange(leadingWhitespaceStart, startInfo.start, 0)) {\n\t return startInfo;\n\t }\n\t }\n\t offset = startInfo.end;\n\t startInfo = null;\n\t }\n\t};\n\t\n\tEANReader.prototype._verifyTrailingWhitespace = function (endInfo) {\n\t var self = this,\n\t trailingWhitespaceEnd;\n\t\n\t trailingWhitespaceEnd = endInfo.end + (endInfo.end - endInfo.start);\n\t if (trailingWhitespaceEnd < self._row.length) {\n\t if (self._matchRange(endInfo.end, trailingWhitespaceEnd, 0)) {\n\t return endInfo;\n\t }\n\t }\n\t return null;\n\t};\n\t\n\tEANReader.prototype._findEnd = function (offset, isWhite) {\n\t var self = this,\n\t endInfo = self._findPattern(self.STOP_PATTERN, offset, isWhite, false);\n\t\n\t return endInfo !== null ? self._verifyTrailingWhitespace(endInfo) : null;\n\t};\n\t\n\tEANReader.prototype._calculateFirstDigit = function (codeFrequency) {\n\t var i,\n\t self = this;\n\t\n\t for (i = 0; i < self.CODE_FREQUENCY.length; i++) {\n\t if (codeFrequency === self.CODE_FREQUENCY[i]) {\n\t return i;\n\t }\n\t }\n\t return null;\n\t};\n\t\n\tEANReader.prototype._decodePayload = function (code, result, decodedCodes) {\n\t var i,\n\t self = this,\n\t codeFrequency = 0x0,\n\t firstDigit;\n\t\n\t for (i = 0; i < 6; i++) {\n\t code = self._decodeCode(code.end);\n\t if (!code) {\n\t return null;\n\t }\n\t if (code.code >= self.CODE_G_START) {\n\t code.code = code.code - self.CODE_G_START;\n\t codeFrequency |= 1 << 5 - i;\n\t } else {\n\t codeFrequency |= 0 << 5 - i;\n\t }\n\t result.push(code.code);\n\t decodedCodes.push(code);\n\t }\n\t\n\t firstDigit = self._calculateFirstDigit(codeFrequency);\n\t if (firstDigit === null) {\n\t return null;\n\t }\n\t result.unshift(firstDigit);\n\t\n\t code = self._findPattern(self.MIDDLE_PATTERN, code.end, true, false);\n\t if (code === null) {\n\t return null;\n\t }\n\t decodedCodes.push(code);\n\t\n\t for (i = 0; i < 6; i++) {\n\t code = self._decodeCode(code.end, self.CODE_G_START);\n\t if (!code) {\n\t return null;\n\t }\n\t decodedCodes.push(code);\n\t result.push(code.code);\n\t }\n\t\n\t return code;\n\t};\n\t\n\tEANReader.prototype._decode = function () {\n\t var startInfo,\n\t self = this,\n\t code,\n\t result = [],\n\t decodedCodes = [];\n\t\n\t startInfo = self._findStart();\n\t if (!startInfo) {\n\t return null;\n\t }\n\t code = {\n\t code: startInfo.code,\n\t start: startInfo.start,\n\t end: startInfo.end\n\t };\n\t decodedCodes.push(code);\n\t code = self._decodePayload(code, result, decodedCodes);\n\t if (!code) {\n\t return null;\n\t }\n\t code = self._findEnd(code.end, false);\n\t if (!code) {\n\t return null;\n\t }\n\t\n\t decodedCodes.push(code);\n\t\n\t // Checksum\n\t if (!self._checksum(result)) {\n\t return null;\n\t }\n\t\n\t return {\n\t code: result.join(\"\"),\n\t start: startInfo.start,\n\t end: code.end,\n\t codeset: \"\",\n\t startInfo: startInfo,\n\t decodedCodes: decodedCodes\n\t };\n\t};\n\t\n\tEANReader.prototype._checksum = function (result) {\n\t var sum = 0,\n\t i;\n\t\n\t for (i = result.length - 2; i >= 0; i -= 2) {\n\t sum += result[i];\n\t }\n\t sum *= 3;\n\t for (i = result.length - 1; i >= 0; i -= 2) {\n\t sum += result[i];\n\t }\n\t return sum % 10 === 0;\n\t};\n\t\n\texports[\"default\"] = EANReader;\n\tmodule.exports = exports[\"default\"];\n\n/***/ },\n/* 30 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar _barcode_reader = __webpack_require__(28);\n\t\n\tvar _barcode_reader2 = _interopRequireDefault(_barcode_reader);\n\t\n\tvar _array_helper = __webpack_require__(19);\n\t\n\tvar _array_helper2 = _interopRequireDefault(_array_helper);\n\t\n\tfunction Code39Reader() {\n\t _barcode_reader2['default'].call(this);\n\t}\n\t\n\tvar properties = {\n\t ALPHABETH_STRING: { value: \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. *$/+%\" },\n\t 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] },\n\t CHARACTER_ENCODINGS: { value: [0x034, 0x121, 0x061, 0x160, 0x031, 0x130, 0x070, 0x025, 0x124, 0x064, 0x109, 0x049, 0x148, 0x019, 0x118, 0x058, 0x00D, 0x10C, 0x04C, 0x01C, 0x103, 0x043, 0x142, 0x013, 0x112, 0x052, 0x007, 0x106, 0x046, 0x016, 0x181, 0x0C1, 0x1C0, 0x091, 0x190, 0x0D0, 0x085, 0x184, 0x0C4, 0x094, 0x0A8, 0x0A2, 0x08A, 0x02A] },\n\t ASTERISK: { value: 0x094 },\n\t FORMAT: { value: \"code_39\", writeable: false }\n\t};\n\t\n\tCode39Reader.prototype = Object.create(_barcode_reader2['default'].prototype, properties);\n\tCode39Reader.prototype.constructor = Code39Reader;\n\t\n\tCode39Reader.prototype._toCounters = function (start, counter) {\n\t var self = this,\n\t numCounters = counter.length,\n\t end = self._row.length,\n\t isWhite = !self._row[start],\n\t i,\n\t counterPos = 0;\n\t\n\t _array_helper2['default'].init(counter, 0);\n\t\n\t for (i = start; i < end; i++) {\n\t if (self._row[i] ^ isWhite) {\n\t counter[counterPos]++;\n\t } else {\n\t counterPos++;\n\t if (counterPos === numCounters) {\n\t break;\n\t } else {\n\t counter[counterPos] = 1;\n\t isWhite = !isWhite;\n\t }\n\t }\n\t }\n\t\n\t return counter;\n\t};\n\t\n\tCode39Reader.prototype._decode = function () {\n\t var self = this,\n\t counters = [0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t result = [],\n\t start = self._findStart(),\n\t decodedChar,\n\t lastStart,\n\t pattern,\n\t nextStart;\n\t\n\t if (!start) {\n\t return null;\n\t }\n\t nextStart = self._nextSet(self._row, start.end);\n\t\n\t do {\n\t counters = self._toCounters(nextStart, counters);\n\t pattern = self._toPattern(counters);\n\t if (pattern < 0) {\n\t return null;\n\t }\n\t decodedChar = self._patternToChar(pattern);\n\t if (decodedChar < 0) {\n\t return null;\n\t }\n\t result.push(decodedChar);\n\t lastStart = nextStart;\n\t nextStart += _array_helper2['default'].sum(counters);\n\t nextStart = self._nextSet(self._row, nextStart);\n\t } while (decodedChar !== '*');\n\t result.pop();\n\t\n\t if (!result.length) {\n\t return null;\n\t }\n\t\n\t if (!self._verifyTrailingWhitespace(lastStart, nextStart, counters)) {\n\t return null;\n\t }\n\t\n\t return {\n\t code: result.join(\"\"),\n\t start: start.start,\n\t end: nextStart,\n\t startInfo: start,\n\t decodedCodes: result\n\t };\n\t};\n\t\n\tCode39Reader.prototype._verifyTrailingWhitespace = function (lastStart, nextStart, counters) {\n\t var trailingWhitespaceEnd,\n\t patternSize = _array_helper2['default'].sum(counters);\n\t\n\t trailingWhitespaceEnd = nextStart - lastStart - patternSize;\n\t if (trailingWhitespaceEnd * 3 >= patternSize) {\n\t return true;\n\t }\n\t return false;\n\t};\n\t\n\tCode39Reader.prototype._patternToChar = function (pattern) {\n\t var i,\n\t self = this;\n\t\n\t for (i = 0; i < self.CHARACTER_ENCODINGS.length; i++) {\n\t if (self.CHARACTER_ENCODINGS[i] === pattern) {\n\t return String.fromCharCode(self.ALPHABET[i]);\n\t }\n\t }\n\t};\n\t\n\tCode39Reader.prototype._findNextWidth = function (counters, current) {\n\t var i,\n\t minWidth = Number.MAX_VALUE;\n\t\n\t for (i = 0; i < counters.length; i++) {\n\t if (counters[i] < minWidth && counters[i] > current) {\n\t minWidth = counters[i];\n\t }\n\t }\n\t\n\t return minWidth;\n\t};\n\t\n\tCode39Reader.prototype._toPattern = function (counters) {\n\t var numCounters = counters.length,\n\t maxNarrowWidth = 0,\n\t numWideBars = numCounters,\n\t wideBarWidth = 0,\n\t self = this,\n\t pattern,\n\t i;\n\t\n\t while (numWideBars > 3) {\n\t maxNarrowWidth = self._findNextWidth(counters, maxNarrowWidth);\n\t numWideBars = 0;\n\t pattern = 0;\n\t for (i = 0; i < numCounters; i++) {\n\t if (counters[i] > maxNarrowWidth) {\n\t pattern |= 1 << numCounters - 1 - i;\n\t numWideBars++;\n\t wideBarWidth += counters[i];\n\t }\n\t }\n\t\n\t if (numWideBars === 3) {\n\t for (i = 0; i < numCounters && numWideBars > 0; i++) {\n\t if (counters[i] > maxNarrowWidth) {\n\t numWideBars--;\n\t if (counters[i] * 2 >= wideBarWidth) {\n\t return -1;\n\t }\n\t }\n\t }\n\t return pattern;\n\t }\n\t }\n\t return -1;\n\t};\n\t\n\tCode39Reader.prototype._findStart = function () {\n\t var self = this,\n\t offset = self._nextSet(self._row),\n\t patternStart = offset,\n\t counter = [0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t counterPos = 0,\n\t isWhite = false,\n\t i,\n\t j,\n\t whiteSpaceMustStart;\n\t\n\t for (i = offset; i < self._row.length; i++) {\n\t if (self._row[i] ^ isWhite) {\n\t counter[counterPos]++;\n\t } else {\n\t if (counterPos === counter.length - 1) {\n\t\n\t // find start pattern\n\t if (self._toPattern(counter) === self.ASTERISK) {\n\t whiteSpaceMustStart = Math.floor(Math.max(0, patternStart - (i - patternStart) / 4));\n\t if (self._matchRange(whiteSpaceMustStart, patternStart, 0)) {\n\t return {\n\t start: patternStart,\n\t end: i\n\t };\n\t }\n\t }\n\t\n\t patternStart += counter[0] + counter[1];\n\t for (j = 0; j < 7; j++) {\n\t counter[j] = counter[j + 2];\n\t }\n\t counter[7] = 0;\n\t counter[8] = 0;\n\t counterPos--;\n\t } else {\n\t counterPos++;\n\t }\n\t counter[counterPos] = 1;\n\t isWhite = !isWhite;\n\t }\n\t }\n\t return null;\n\t};\n\t\n\texports['default'] = Code39Reader;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 31 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar _code_39_reader = __webpack_require__(30);\n\t\n\tvar _code_39_reader2 = _interopRequireDefault(_code_39_reader);\n\t\n\tfunction Code39VINReader() {\n\t _code_39_reader2['default'].call(this);\n\t}\n\t\n\tvar patterns = {\n\t IOQ: /[IOQ]/g,\n\t AZ09: /[A-Z0-9]{17}/\n\t};\n\t\n\tCode39VINReader.prototype = Object.create(_code_39_reader2['default'].prototype);\n\tCode39VINReader.prototype.constructor = Code39VINReader;\n\t\n\t// Cribbed from:\n\t// https://github.com/zxing/zxing/blob/master/core/src/main/java/com/google/zxing/client/result/VINResultParser.java\n\tCode39VINReader.prototype._decode = function () {\n\t var result = _code_39_reader2['default'].prototype._decode.apply(this);\n\t if (!result) {\n\t return null;\n\t }\n\t\n\t var code = result.code;\n\t\n\t if (!code) {\n\t return;\n\t }\n\t\n\t code = code.replace(patterns.IOQ, '');\n\t\n\t if (!code.match(patterns.AZ09)) {\n\t console.log('Failed AZ09 pattern code:', code);\n\t return null;\n\t }\n\t\n\t if (!this._checkChecksum(code)) {\n\t return null;\n\t }\n\t\n\t result.code = code;\n\t return result;\n\t};\n\t\n\tCode39VINReader.prototype._checkChecksum = function (code) {\n\t // TODO\n\t return !!code;\n\t};\n\t\n\texports['default'] = Code39VINReader;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 32 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\t\n\tvar _barcode_reader = __webpack_require__(28);\n\t\n\tvar _barcode_reader2 = _interopRequireDefault(_barcode_reader);\n\t\n\tfunction CodabarReader() {\n\t _barcode_reader2[\"default\"].call(this);\n\t this._counters = [];\n\t}\n\t\n\tvar properties = {\n\t ALPHABETH_STRING: { value: \"0123456789-$:/.+ABCD\" },\n\t ALPHABET: { value: [48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 45, 36, 58, 47, 46, 43, 65, 66, 67, 68] },\n\t CHARACTER_ENCODINGS: { value: [0x003, 0x006, 0x009, 0x060, 0x012, 0x042, 0x021, 0x024, 0x030, 0x048, 0x00c, 0x018, 0x045, 0x051, 0x054, 0x015, 0x01A, 0x029, 0x00B, 0x00E] },\n\t START_END: { value: [0x01A, 0x029, 0x00B, 0x00E] },\n\t MIN_ENCODED_CHARS: { value: 4 },\n\t MAX_ACCEPTABLE: { value: 2.0 },\n\t PADDING: { value: 1.5 },\n\t FORMAT: { value: \"codabar\", writeable: false }\n\t};\n\t\n\tCodabarReader.prototype = Object.create(_barcode_reader2[\"default\"].prototype, properties);\n\tCodabarReader.prototype.constructor = CodabarReader;\n\t\n\tCodabarReader.prototype._decode = function () {\n\t var self = this,\n\t result = [],\n\t start,\n\t decodedChar,\n\t pattern,\n\t nextStart,\n\t end;\n\t\n\t this._counters = self._fillCounters();\n\t start = self._findStart();\n\t if (!start) {\n\t return null;\n\t }\n\t nextStart = start.startCounter;\n\t\n\t do {\n\t pattern = self._toPattern(nextStart);\n\t if (pattern < 0) {\n\t return null;\n\t }\n\t decodedChar = self._patternToChar(pattern);\n\t if (decodedChar < 0) {\n\t return null;\n\t }\n\t result.push(decodedChar);\n\t nextStart += 8;\n\t if (result.length > 1 && self._isStartEnd(pattern)) {\n\t break;\n\t }\n\t } while (nextStart < self._counters.length);\n\t\n\t // verify end\n\t if (result.length - 2 < self.MIN_ENCODED_CHARS || !self._isStartEnd(pattern)) {\n\t return null;\n\t }\n\t\n\t // verify end white space\n\t if (!self._verifyWhitespace(start.startCounter, nextStart - 8)) {\n\t return null;\n\t }\n\t\n\t if (!self._validateResult(result, start.startCounter)) {\n\t return null;\n\t }\n\t\n\t nextStart = nextStart > self._counters.length ? self._counters.length : nextStart;\n\t end = start.start + self._sumCounters(start.startCounter, nextStart - 8);\n\t\n\t return {\n\t code: result.join(\"\"),\n\t start: start.start,\n\t end: end,\n\t startInfo: start,\n\t decodedCodes: result\n\t };\n\t};\n\t\n\tCodabarReader.prototype._verifyWhitespace = function (startCounter, endCounter) {\n\t if (startCounter - 1 <= 0 || this._counters[startCounter - 1] >= this._calculatePatternLength(startCounter) / 2.0) {\n\t if (endCounter + 8 >= this._counters.length || this._counters[endCounter + 7] >= this._calculatePatternLength(endCounter) / 2.0) {\n\t return true;\n\t }\n\t }\n\t return false;\n\t};\n\t\n\tCodabarReader.prototype._calculatePatternLength = function (offset) {\n\t var i,\n\t sum = 0;\n\t\n\t for (i = offset; i < offset + 7; i++) {\n\t sum += this._counters[i];\n\t }\n\t\n\t return sum;\n\t};\n\t\n\tCodabarReader.prototype._thresholdResultPattern = function (result, startCounter) {\n\t var self = this,\n\t categorization = {\n\t space: {\n\t narrow: { size: 0, counts: 0, min: 0, max: Number.MAX_VALUE },\n\t wide: { size: 0, counts: 0, min: 0, max: Number.MAX_VALUE }\n\t },\n\t bar: {\n\t narrow: { size: 0, counts: 0, min: 0, max: Number.MAX_VALUE },\n\t wide: { size: 0, counts: 0, min: 0, max: Number.MAX_VALUE }\n\t }\n\t },\n\t kind,\n\t cat,\n\t i,\n\t j,\n\t pos = startCounter,\n\t pattern;\n\t\n\t for (i = 0; i < result.length; i++) {\n\t pattern = self._charToPattern(result[i]);\n\t for (j = 6; j >= 0; j--) {\n\t kind = (j & 1) === 2 ? categorization.bar : categorization.space;\n\t cat = (pattern & 1) === 1 ? kind.wide : kind.narrow;\n\t cat.size += self._counters[pos + j];\n\t cat.counts++;\n\t pattern >>= 1;\n\t }\n\t pos += 8;\n\t }\n\t\n\t [\"space\", \"bar\"].forEach(function (key) {\n\t var kind = categorization[key];\n\t kind.wide.min = Math.floor((kind.narrow.size / kind.narrow.counts + kind.wide.size / kind.wide.counts) / 2);\n\t kind.narrow.max = Math.ceil(kind.wide.min);\n\t kind.wide.max = Math.ceil((kind.wide.size * self.MAX_ACCEPTABLE + self.PADDING) / kind.wide.counts);\n\t });\n\t\n\t return categorization;\n\t};\n\t\n\tCodabarReader.prototype._charToPattern = function (char) {\n\t var self = this,\n\t charCode = char.charCodeAt(0),\n\t i;\n\t\n\t for (i = 0; i < self.ALPHABET.length; i++) {\n\t if (self.ALPHABET[i] === charCode) {\n\t return self.CHARACTER_ENCODINGS[i];\n\t }\n\t }\n\t return 0x0;\n\t};\n\t\n\tCodabarReader.prototype._validateResult = function (result, startCounter) {\n\t var self = this,\n\t thresholds = self._thresholdResultPattern(result, startCounter),\n\t i,\n\t j,\n\t kind,\n\t cat,\n\t size,\n\t pos = startCounter,\n\t pattern;\n\t\n\t for (i = 0; i < result.length; i++) {\n\t pattern = self._charToPattern(result[i]);\n\t for (j = 6; j >= 0; j--) {\n\t kind = (j & 1) === 0 ? thresholds.bar : thresholds.space;\n\t cat = (pattern & 1) === 1 ? kind.wide : kind.narrow;\n\t size = self._counters[pos + j];\n\t if (size < cat.min || size > cat.max) {\n\t return false;\n\t }\n\t pattern >>= 1;\n\t }\n\t pos += 8;\n\t }\n\t return true;\n\t};\n\t\n\tCodabarReader.prototype._patternToChar = function (pattern) {\n\t var i,\n\t self = this;\n\t\n\t for (i = 0; i < self.CHARACTER_ENCODINGS.length; i++) {\n\t if (self.CHARACTER_ENCODINGS[i] === pattern) {\n\t return String.fromCharCode(self.ALPHABET[i]);\n\t }\n\t }\n\t return -1;\n\t};\n\t\n\tCodabarReader.prototype._computeAlternatingThreshold = function (offset, end) {\n\t var i,\n\t min = Number.MAX_VALUE,\n\t max = 0,\n\t counter;\n\t\n\t for (i = offset; i < end; i += 2) {\n\t counter = this._counters[i];\n\t if (counter > max) {\n\t max = counter;\n\t }\n\t if (counter < min) {\n\t min = counter;\n\t }\n\t }\n\t\n\t return (min + max) / 2.0 | 0;\n\t};\n\t\n\tCodabarReader.prototype._toPattern = function (offset) {\n\t var numCounters = 7,\n\t end = offset + numCounters,\n\t barThreshold,\n\t spaceThreshold,\n\t bitmask = 1 << numCounters - 1,\n\t pattern = 0,\n\t i,\n\t threshold;\n\t\n\t if (end > this._counters.length) {\n\t return -1;\n\t }\n\t\n\t barThreshold = this._computeAlternatingThreshold(offset, end);\n\t spaceThreshold = this._computeAlternatingThreshold(offset + 1, end);\n\t\n\t for (i = 0; i < numCounters; i++) {\n\t threshold = (i & 1) === 0 ? barThreshold : spaceThreshold;\n\t if (this._counters[offset + i] > threshold) {\n\t pattern |= bitmask;\n\t }\n\t bitmask >>= 1;\n\t }\n\t\n\t return pattern;\n\t};\n\t\n\tCodabarReader.prototype._isStartEnd = function (pattern) {\n\t var i;\n\t\n\t for (i = 0; i < this.START_END.length; i++) {\n\t if (this.START_END[i] === pattern) {\n\t return true;\n\t }\n\t }\n\t return false;\n\t};\n\t\n\tCodabarReader.prototype._sumCounters = function (start, end) {\n\t var i,\n\t sum = 0;\n\t\n\t for (i = start; i < end; i++) {\n\t sum += this._counters[i];\n\t }\n\t return sum;\n\t};\n\t\n\tCodabarReader.prototype._findStart = function () {\n\t var self = this,\n\t i,\n\t pattern,\n\t start = self._nextUnset(self._row),\n\t end;\n\t\n\t for (i = 1; i < this._counters.length; i++) {\n\t pattern = self._toPattern(i);\n\t if (pattern !== -1 && self._isStartEnd(pattern)) {\n\t // TODO: Look for whitespace ahead\n\t start += self._sumCounters(0, i);\n\t end = start + self._sumCounters(i, i + 8);\n\t return {\n\t start: start,\n\t end: end,\n\t startCounter: i,\n\t endCounter: i + 8\n\t };\n\t }\n\t }\n\t};\n\t\n\texports[\"default\"] = CodabarReader;\n\tmodule.exports = exports[\"default\"];\n\n/***/ },\n/* 33 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\t\n\tvar _ean_reader = __webpack_require__(29);\n\t\n\tvar _ean_reader2 = _interopRequireDefault(_ean_reader);\n\t\n\tfunction UPCReader() {\n\t _ean_reader2[\"default\"].call(this);\n\t}\n\t\n\tvar properties = {\n\t FORMAT: { value: \"upc_a\", writeable: false }\n\t};\n\t\n\tUPCReader.prototype = Object.create(_ean_reader2[\"default\"].prototype, properties);\n\tUPCReader.prototype.constructor = UPCReader;\n\t\n\tUPCReader.prototype._decode = function () {\n\t var result = _ean_reader2[\"default\"].prototype._decode.call(this);\n\t\n\t if (result && result.code && result.code.length === 13 && result.code.charAt(0) === \"0\") {\n\t\n\t result.code = result.code.substring(1);\n\t return result;\n\t }\n\t return null;\n\t};\n\t\n\texports[\"default\"] = _ean_reader2[\"default\"];\n\tmodule.exports = exports[\"default\"];\n\n/***/ },\n/* 34 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\t\n\tvar _ean_reader = __webpack_require__(29);\n\t\n\tvar _ean_reader2 = _interopRequireDefault(_ean_reader);\n\t\n\tfunction EAN8Reader() {\n\t _ean_reader2[\"default\"].call(this);\n\t}\n\t\n\tvar properties = {\n\t FORMAT: { value: \"ean_8\", writeable: false }\n\t};\n\t\n\tEAN8Reader.prototype = Object.create(_ean_reader2[\"default\"].prototype, properties);\n\tEAN8Reader.prototype.constructor = EAN8Reader;\n\t\n\tEAN8Reader.prototype._decodePayload = function (code, result, decodedCodes) {\n\t var i,\n\t self = this;\n\t\n\t for (i = 0; i < 4; i++) {\n\t code = self._decodeCode(code.end, self.CODE_G_START);\n\t if (!code) {\n\t return null;\n\t }\n\t result.push(code.code);\n\t decodedCodes.push(code);\n\t }\n\t\n\t code = self._findPattern(self.MIDDLE_PATTERN, code.end, true, false);\n\t if (code === null) {\n\t return null;\n\t }\n\t decodedCodes.push(code);\n\t\n\t for (i = 0; i < 4; i++) {\n\t code = self._decodeCode(code.end, self.CODE_G_START);\n\t if (!code) {\n\t return null;\n\t }\n\t decodedCodes.push(code);\n\t result.push(code.code);\n\t }\n\t\n\t return code;\n\t};\n\t\n\texports[\"default\"] = EAN8Reader;\n\tmodule.exports = exports[\"default\"];\n\n/***/ },\n/* 35 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\t\n\tvar _ean_reader = __webpack_require__(29);\n\t\n\tvar _ean_reader2 = _interopRequireDefault(_ean_reader);\n\t\n\tfunction UPCEReader() {\n\t _ean_reader2[\"default\"].call(this);\n\t}\n\t\n\tvar properties = {\n\t CODE_FREQUENCY: { value: [[56, 52, 50, 49, 44, 38, 35, 42, 41, 37], [7, 11, 13, 14, 19, 25, 28, 21, 22, 26]] },\n\t STOP_PATTERN: { value: [1 / 6 * 7, 1 / 6 * 7, 1 / 6 * 7, 1 / 6 * 7, 1 / 6 * 7, 1 / 6 * 7] },\n\t FORMAT: { value: \"upc_e\", writeable: false }\n\t};\n\t\n\tUPCEReader.prototype = Object.create(_ean_reader2[\"default\"].prototype, properties);\n\tUPCEReader.prototype.constructor = UPCEReader;\n\t\n\tUPCEReader.prototype._decodePayload = function (code, result, decodedCodes) {\n\t var i,\n\t self = this,\n\t codeFrequency = 0x0;\n\t\n\t for (i = 0; i < 6; i++) {\n\t code = self._decodeCode(code.end);\n\t if (!code) {\n\t return null;\n\t }\n\t if (code.code >= self.CODE_G_START) {\n\t code.code = code.code - self.CODE_G_START;\n\t codeFrequency |= 1 << 5 - i;\n\t }\n\t result.push(code.code);\n\t decodedCodes.push(code);\n\t }\n\t if (!self._determineParity(codeFrequency, result)) {\n\t return null;\n\t }\n\t\n\t return code;\n\t};\n\t\n\tUPCEReader.prototype._determineParity = function (codeFrequency, result) {\n\t var self = this,\n\t i,\n\t nrSystem;\n\t\n\t for (nrSystem = 0; nrSystem < self.CODE_FREQUENCY.length; nrSystem++) {\n\t for (i = 0; i < self.CODE_FREQUENCY[nrSystem].length; i++) {\n\t if (codeFrequency === self.CODE_FREQUENCY[nrSystem][i]) {\n\t result.unshift(nrSystem);\n\t result.push(i);\n\t return true;\n\t }\n\t }\n\t }\n\t return false;\n\t};\n\t\n\tUPCEReader.prototype._convertToUPCA = function (result) {\n\t var upca = [result[0]],\n\t lastDigit = result[result.length - 2];\n\t\n\t if (lastDigit <= 2) {\n\t upca = upca.concat(result.slice(1, 3)).concat([lastDigit, 0, 0, 0, 0]).concat(result.slice(3, 6));\n\t } else if (lastDigit === 3) {\n\t upca = upca.concat(result.slice(1, 4)).concat([0, 0, 0, 0, 0]).concat(result.slice(4, 6));\n\t } else if (lastDigit === 4) {\n\t upca = upca.concat(result.slice(1, 5)).concat([0, 0, 0, 0, 0, result[5]]);\n\t } else {\n\t upca = upca.concat(result.slice(1, 6)).concat([0, 0, 0, 0, lastDigit]);\n\t }\n\t\n\t upca.push(result[result.length - 1]);\n\t return upca;\n\t};\n\t\n\tUPCEReader.prototype._checksum = function (result) {\n\t return _ean_reader2[\"default\"].prototype._checksum.call(this, this._convertToUPCA(result));\n\t};\n\t\n\tUPCEReader.prototype._findEnd = function (offset, isWhite) {\n\t isWhite = true;\n\t return _ean_reader2[\"default\"].prototype._findEnd.call(this, offset, isWhite);\n\t};\n\t\n\tUPCEReader.prototype._verifyTrailingWhitespace = function (endInfo) {\n\t var self = this,\n\t trailingWhitespaceEnd;\n\t\n\t trailingWhitespaceEnd = endInfo.end + (endInfo.end - endInfo.start) / 2;\n\t if (trailingWhitespaceEnd < self._row.length) {\n\t if (self._matchRange(endInfo.end, trailingWhitespaceEnd, 0)) {\n\t return endInfo;\n\t }\n\t }\n\t};\n\t\n\texports[\"default\"] = UPCEReader;\n\tmodule.exports = exports[\"default\"];\n\n/***/ },\n/* 36 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar _barcode_reader = __webpack_require__(28);\n\t\n\tvar _barcode_reader2 = _interopRequireDefault(_barcode_reader);\n\t\n\tvar merge = __webpack_require__(37);\n\t\n\tfunction I2of5Reader(opts) {\n\t opts = merge(getDefaulConfig(), opts);\n\t _barcode_reader2['default'].call(this, opts);\n\t this.barSpaceRatio = [1, 1];\n\t if (opts.normalizeBarSpaceWidth) {\n\t this.SINGLE_CODE_ERROR = 0.38;\n\t this.AVG_CODE_ERROR = 0.09;\n\t }\n\t}\n\t\n\tfunction getDefaulConfig() {\n\t var config = {};\n\t\n\t Object.keys(I2of5Reader.CONFIG_KEYS).forEach(function (key) {\n\t config[key] = I2of5Reader.CONFIG_KEYS[key]['default'];\n\t });\n\t return config;\n\t}\n\t\n\tvar N = 1,\n\t W = 3,\n\t properties = {\n\t MODULO: { value: 10 },\n\t START_PATTERN: { value: [N * 2.5, N * 2.5, N * 2.5, N * 2.5] },\n\t STOP_PATTERN: { value: [N * 2, N * 2, W * 2] },\n\t CODE_PATTERN: { value: [[N, N, W, W, N], [W, N, N, N, W], [N, W, N, N, W], [W, W, N, N, N], [N, N, W, N, W], [W, N, W, N, N], [N, W, W, N, N], [N, N, N, W, W], [W, N, N, W, N], [N, W, N, W, N]] },\n\t SINGLE_CODE_ERROR: { value: 0.78, writable: true },\n\t AVG_CODE_ERROR: { value: 0.38, writable: true },\n\t MAX_CORRECTION_FACTOR: { value: 5 },\n\t FORMAT: { value: \"i2of5\" }\n\t};\n\t\n\tI2of5Reader.prototype = Object.create(_barcode_reader2['default'].prototype, properties);\n\tI2of5Reader.prototype.constructor = I2of5Reader;\n\t\n\tI2of5Reader.prototype._matchPattern = function (counter, code) {\n\t if (this.config.normalizeBarSpaceWidth) {\n\t var i,\n\t counterSum = [0, 0],\n\t codeSum = [0, 0],\n\t correction = [0, 0],\n\t correctionRatio = this.MAX_CORRECTION_FACTOR,\n\t correctionRatioInverse = 1 / correctionRatio;\n\t\n\t for (i = 0; i < counter.length; i++) {\n\t counterSum[i % 2] += counter[i];\n\t codeSum[i % 2] += code[i];\n\t }\n\t correction[0] = codeSum[0] / counterSum[0];\n\t correction[1] = codeSum[1] / counterSum[1];\n\t\n\t correction[0] = Math.max(Math.min(correction[0], correctionRatio), correctionRatioInverse);\n\t correction[1] = Math.max(Math.min(correction[1], correctionRatio), correctionRatioInverse);\n\t this.barSpaceRatio = correction;\n\t for (i = 0; i < counter.length; i++) {\n\t counter[i] *= this.barSpaceRatio[i % 2];\n\t }\n\t }\n\t return _barcode_reader2['default'].prototype._matchPattern.call(this, counter, code);\n\t};\n\t\n\tI2of5Reader.prototype._findPattern = function (pattern, offset, isWhite, tryHarder) {\n\t var counter = [],\n\t self = this,\n\t i,\n\t counterPos = 0,\n\t bestMatch = {\n\t error: Number.MAX_VALUE,\n\t code: -1,\n\t start: 0,\n\t end: 0\n\t },\n\t error,\n\t j,\n\t sum,\n\t normalized,\n\t epsilon = self.AVG_CODE_ERROR;\n\t\n\t isWhite = isWhite || false;\n\t tryHarder = tryHarder || false;\n\t\n\t if (!offset) {\n\t offset = self._nextSet(self._row);\n\t }\n\t\n\t for (i = 0; i < pattern.length; i++) {\n\t counter[i] = 0;\n\t }\n\t\n\t for (i = offset; i < self._row.length; i++) {\n\t if (self._row[i] ^ isWhite) {\n\t counter[counterPos]++;\n\t } else {\n\t if (counterPos === counter.length - 1) {\n\t sum = 0;\n\t for (j = 0; j < counter.length; j++) {\n\t sum += counter[j];\n\t }\n\t normalized = self._normalize(counter);\n\t if (normalized) {\n\t error = self._matchPattern(normalized, pattern);\n\t\n\t if (error < epsilon) {\n\t bestMatch.error = error;\n\t bestMatch.start = i - sum;\n\t bestMatch.end = i;\n\t return bestMatch;\n\t }\n\t }\n\t if (tryHarder) {\n\t for (j = 0; j < counter.length - 2; j++) {\n\t counter[j] = counter[j + 2];\n\t }\n\t counter[counter.length - 2] = 0;\n\t counter[counter.length - 1] = 0;\n\t counterPos--;\n\t } else {\n\t return null;\n\t }\n\t } else {\n\t counterPos++;\n\t }\n\t counter[counterPos] = 1;\n\t isWhite = !isWhite;\n\t }\n\t }\n\t return null;\n\t};\n\t\n\tI2of5Reader.prototype._findStart = function () {\n\t var self = this,\n\t leadingWhitespaceStart,\n\t offset = self._nextSet(self._row),\n\t startInfo,\n\t narrowBarWidth = 1;\n\t\n\t while (!startInfo) {\n\t startInfo = self._findPattern(self.START_PATTERN, offset, false, true);\n\t if (!startInfo) {\n\t return null;\n\t }\n\t narrowBarWidth = Math.floor((startInfo.end - startInfo.start) / 4);\n\t leadingWhitespaceStart = startInfo.start - narrowBarWidth * 10;\n\t if (leadingWhitespaceStart >= 0) {\n\t if (self._matchRange(leadingWhitespaceStart, startInfo.start, 0)) {\n\t return startInfo;\n\t }\n\t }\n\t offset = startInfo.end;\n\t startInfo = null;\n\t }\n\t};\n\t\n\tI2of5Reader.prototype._verifyTrailingWhitespace = function (endInfo) {\n\t var self = this,\n\t trailingWhitespaceEnd;\n\t\n\t trailingWhitespaceEnd = endInfo.end + (endInfo.end - endInfo.start) / 2;\n\t if (trailingWhitespaceEnd < self._row.length) {\n\t if (self._matchRange(endInfo.end, trailingWhitespaceEnd, 0)) {\n\t return endInfo;\n\t }\n\t }\n\t return null;\n\t};\n\t\n\tI2of5Reader.prototype._findEnd = function () {\n\t var self = this,\n\t endInfo,\n\t tmp;\n\t\n\t self._row.reverse();\n\t endInfo = self._findPattern(self.STOP_PATTERN);\n\t self._row.reverse();\n\t\n\t if (endInfo === null) {\n\t return null;\n\t }\n\t\n\t // reverse numbers\n\t tmp = endInfo.start;\n\t endInfo.start = self._row.length - endInfo.end;\n\t endInfo.end = self._row.length - tmp;\n\t\n\t return endInfo !== null ? self._verifyTrailingWhitespace(endInfo) : null;\n\t};\n\t\n\tI2of5Reader.prototype._decodePair = function (counterPair) {\n\t var i,\n\t code,\n\t codes = [],\n\t self = this;\n\t\n\t for (i = 0; i < counterPair.length; i++) {\n\t code = self._decodeCode(counterPair[i]);\n\t if (!code) {\n\t return null;\n\t }\n\t codes.push(code);\n\t }\n\t return codes;\n\t};\n\t\n\tI2of5Reader.prototype._decodeCode = function (counter) {\n\t var j,\n\t self = this,\n\t sum = 0,\n\t normalized,\n\t error,\n\t epsilon = self.AVG_CODE_ERROR,\n\t code,\n\t bestMatch = {\n\t error: Number.MAX_VALUE,\n\t code: -1,\n\t start: 0,\n\t end: 0\n\t };\n\t\n\t for (j = 0; j < counter.length; j++) {\n\t sum += counter[j];\n\t }\n\t normalized = self._normalize(counter);\n\t if (normalized) {\n\t for (code = 0; code < self.CODE_PATTERN.length; code++) {\n\t error = self._matchPattern(normalized, self.CODE_PATTERN[code]);\n\t if (error < bestMatch.error) {\n\t bestMatch.code = code;\n\t bestMatch.error = error;\n\t }\n\t }\n\t if (bestMatch.error < epsilon) {\n\t return bestMatch;\n\t }\n\t }\n\t return null;\n\t};\n\t\n\tI2of5Reader.prototype._decodePayload = function (counters, result, decodedCodes) {\n\t var i,\n\t self = this,\n\t pos = 0,\n\t counterLength = counters.length,\n\t counterPair = [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0]],\n\t codes;\n\t\n\t while (pos < counterLength) {\n\t for (i = 0; i < 5; i++) {\n\t counterPair[0][i] = counters[pos] * this.barSpaceRatio[0];\n\t counterPair[1][i] = counters[pos + 1] * this.barSpaceRatio[1];\n\t pos += 2;\n\t }\n\t codes = self._decodePair(counterPair);\n\t if (!codes) {\n\t return null;\n\t }\n\t for (i = 0; i < codes.length; i++) {\n\t result.push(codes[i].code + \"\");\n\t decodedCodes.push(codes[i]);\n\t }\n\t }\n\t return codes;\n\t};\n\t\n\tI2of5Reader.prototype._verifyCounterLength = function (counters) {\n\t return counters.length % 10 === 0;\n\t};\n\t\n\tI2of5Reader.prototype._decode = function () {\n\t var startInfo,\n\t endInfo,\n\t self = this,\n\t code,\n\t result = [],\n\t decodedCodes = [],\n\t counters;\n\t\n\t startInfo = self._findStart();\n\t if (!startInfo) {\n\t return null;\n\t }\n\t decodedCodes.push(startInfo);\n\t\n\t endInfo = self._findEnd();\n\t if (!endInfo) {\n\t return null;\n\t }\n\t\n\t counters = self._fillCounters(startInfo.end, endInfo.start, false);\n\t if (!self._verifyCounterLength(counters)) {\n\t return null;\n\t }\n\t code = self._decodePayload(counters, result, decodedCodes);\n\t if (!code) {\n\t return null;\n\t }\n\t if (result.length % 2 !== 0 || result.length < 6) {\n\t return null;\n\t }\n\t\n\t decodedCodes.push(endInfo);\n\t return {\n\t code: result.join(\"\"),\n\t start: startInfo.start,\n\t end: endInfo.end,\n\t startInfo: startInfo,\n\t decodedCodes: decodedCodes\n\t };\n\t};\n\t\n\tI2of5Reader.CONFIG_KEYS = {\n\t normalizeBarSpaceWidth: {\n\t 'type': 'boolean',\n\t 'default': false,\n\t 'description': 'If true, the reader tries to normalize the' + 'width-difference between bars and spaces'\n\t }\n\t};\n\t\n\texports['default'] = I2of5Reader;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 37 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar baseMerge = __webpack_require__(38),\n\t createAssigner = __webpack_require__(65);\n\t\n\t/**\n\t * Recursively merges own enumerable properties of the source object(s), that\n\t * don't resolve to `undefined` into the destination object. Subsequent sources\n\t * overwrite property assignments of previous sources. If `customizer` is\n\t * provided it's invoked to produce the merged values of the destination and\n\t * source properties. If `customizer` returns `undefined` merging is handled\n\t * by the method instead. The `customizer` is bound to `thisArg` and invoked\n\t * with five arguments: (objectValue, sourceValue, key, object, source).\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Object\n\t * @param {Object} object The destination object.\n\t * @param {...Object} [sources] The source objects.\n\t * @param {Function} [customizer] The function to customize assigned values.\n\t * @param {*} [thisArg] The `this` binding of `customizer`.\n\t * @returns {Object} Returns `object`.\n\t * @example\n\t *\n\t * var users = {\n\t * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }]\n\t * };\n\t *\n\t * var ages = {\n\t * 'data': [{ 'age': 36 }, { 'age': 40 }]\n\t * };\n\t *\n\t * _.merge(users, ages);\n\t * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] }\n\t *\n\t * // using a customizer callback\n\t * var object = {\n\t * 'fruits': ['apple'],\n\t * 'vegetables': ['beet']\n\t * };\n\t *\n\t * var other = {\n\t * 'fruits': ['banana'],\n\t * 'vegetables': ['carrot']\n\t * };\n\t *\n\t * _.merge(object, other, function(a, b) {\n\t * if (_.isArray(a)) {\n\t * return a.concat(b);\n\t * }\n\t * });\n\t * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] }\n\t */\n\tvar merge = createAssigner(baseMerge);\n\t\n\tmodule.exports = merge;\n\n\n/***/ },\n/* 38 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar arrayEach = __webpack_require__(39),\n\t baseMergeDeep = __webpack_require__(40),\n\t isArray = __webpack_require__(48),\n\t isArrayLike = __webpack_require__(43),\n\t isObject = __webpack_require__(52),\n\t isObjectLike = __webpack_require__(47),\n\t isTypedArray = __webpack_require__(60),\n\t keys = __webpack_require__(63);\n\t\n\t/**\n\t * The base implementation of `_.merge` without support for argument juggling,\n\t * multiple sources, and `this` binding `customizer` functions.\n\t *\n\t * @private\n\t * @param {Object} object The destination object.\n\t * @param {Object} source The source object.\n\t * @param {Function} [customizer] The function to customize merged values.\n\t * @param {Array} [stackA=[]] Tracks traversed source objects.\n\t * @param {Array} [stackB=[]] Associates values with source counterparts.\n\t * @returns {Object} Returns `object`.\n\t */\n\tfunction baseMerge(object, source, customizer, stackA, stackB) {\n\t if (!isObject(object)) {\n\t return object;\n\t }\n\t var isSrcArr = isArrayLike(source) && (isArray(source) || isTypedArray(source)),\n\t props = isSrcArr ? undefined : keys(source);\n\t\n\t arrayEach(props || source, function(srcValue, key) {\n\t if (props) {\n\t key = srcValue;\n\t srcValue = source[key];\n\t }\n\t if (isObjectLike(srcValue)) {\n\t stackA || (stackA = []);\n\t stackB || (stackB = []);\n\t baseMergeDeep(object, source, key, baseMerge, customizer, stackA, stackB);\n\t }\n\t else {\n\t var value = object[key],\n\t result = customizer ? customizer(value, srcValue, key, object, source) : undefined,\n\t isCommon = result === undefined;\n\t\n\t if (isCommon) {\n\t result = srcValue;\n\t }\n\t if ((result !== undefined || (isSrcArr && !(key in object))) &&\n\t (isCommon || (result === result ? (result !== value) : (value === value)))) {\n\t object[key] = result;\n\t }\n\t }\n\t });\n\t return object;\n\t}\n\t\n\tmodule.exports = baseMerge;\n\n\n/***/ },\n/* 39 */\n/***/ function(module, exports) {\n\n\t/**\n\t * A specialized version of `_.forEach` for arrays without support for callback\n\t * shorthands and `this` binding.\n\t *\n\t * @private\n\t * @param {Array} array The array to iterate over.\n\t * @param {Function} iteratee The function invoked per iteration.\n\t * @returns {Array} Returns `array`.\n\t */\n\tfunction arrayEach(array, iteratee) {\n\t var index = -1,\n\t length = array.length;\n\t\n\t while (++index < length) {\n\t if (iteratee(array[index], index, array) === false) {\n\t break;\n\t }\n\t }\n\t return array;\n\t}\n\t\n\tmodule.exports = arrayEach;\n\n\n/***/ },\n/* 40 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar arrayCopy = __webpack_require__(41),\n\t isArguments = __webpack_require__(42),\n\t isArray = __webpack_require__(48),\n\t isArrayLike = __webpack_require__(43),\n\t isPlainObject = __webpack_require__(53),\n\t isTypedArray = __webpack_require__(60),\n\t toPlainObject = __webpack_require__(61);\n\t\n\t/**\n\t * A specialized version of `baseMerge` for arrays and objects which performs\n\t * deep merges and tracks traversed objects enabling objects with circular\n\t * references to be merged.\n\t *\n\t * @private\n\t * @param {Object} object The destination object.\n\t * @param {Object} source The source object.\n\t * @param {string} key The key of the value to merge.\n\t * @param {Function} mergeFunc The function to merge values.\n\t * @param {Function} [customizer] The function to customize merged values.\n\t * @param {Array} [stackA=[]] Tracks traversed source objects.\n\t * @param {Array} [stackB=[]] Associates values with source counterparts.\n\t * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n\t */\n\tfunction baseMergeDeep(object, source, key, mergeFunc, customizer, stackA, stackB) {\n\t var length = stackA.length,\n\t srcValue = source[key];\n\t\n\t while (length--) {\n\t if (stackA[length] == srcValue) {\n\t object[key] = stackB[length];\n\t return;\n\t }\n\t }\n\t var value = object[key],\n\t result = customizer ? customizer(value, srcValue, key, object, source) : undefined,\n\t isCommon = result === undefined;\n\t\n\t if (isCommon) {\n\t result = srcValue;\n\t if (isArrayLike(srcValue) && (isArray(srcValue) || isTypedArray(srcValue))) {\n\t result = isArray(value)\n\t ? value\n\t : (isArrayLike(value) ? arrayCopy(value) : []);\n\t }\n\t else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n\t result = isArguments(value)\n\t ? toPlainObject(value)\n\t : (isPlainObject(value) ? value : {});\n\t }\n\t else {\n\t isCommon = false;\n\t }\n\t }\n\t // Add the source value to the stack of traversed objects and associate\n\t // it with its merged value.\n\t stackA.push(srcValue);\n\t stackB.push(result);\n\t\n\t if (isCommon) {\n\t // Recursively merge objects and arrays (susceptible to call stack limits).\n\t object[key] = mergeFunc(result, srcValue, customizer, stackA, stackB);\n\t } else if (result === result ? (result !== value) : (value === value)) {\n\t object[key] = result;\n\t }\n\t}\n\t\n\tmodule.exports = baseMergeDeep;\n\n\n/***/ },\n/* 41 */\n/***/ function(module, exports) {\n\n\t/**\n\t * Copies the values of `source` to `array`.\n\t *\n\t * @private\n\t * @param {Array} source The array to copy values from.\n\t * @param {Array} [array=[]] The array to copy values to.\n\t * @returns {Array} Returns `array`.\n\t */\n\tfunction arrayCopy(source, array) {\n\t var index = -1,\n\t length = source.length;\n\t\n\t array || (array = Array(length));\n\t while (++index < length) {\n\t array[index] = source[index];\n\t }\n\t return array;\n\t}\n\t\n\tmodule.exports = arrayCopy;\n\n\n/***/ },\n/* 42 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar isArrayLike = __webpack_require__(43),\n\t isObjectLike = __webpack_require__(47);\n\t\n\t/** Used for native method references. */\n\tvar objectProto = Object.prototype;\n\t\n\t/** Used to check objects for own properties. */\n\tvar hasOwnProperty = objectProto.hasOwnProperty;\n\t\n\t/** Native method references. */\n\tvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\t\n\t/**\n\t * Checks if `value` is classified as an `arguments` object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n\t * @example\n\t *\n\t * _.isArguments(function() { return arguments; }());\n\t * // => true\n\t *\n\t * _.isArguments([1, 2, 3]);\n\t * // => false\n\t */\n\tfunction isArguments(value) {\n\t return isObjectLike(value) && isArrayLike(value) &&\n\t hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');\n\t}\n\t\n\tmodule.exports = isArguments;\n\n\n/***/ },\n/* 43 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar getLength = __webpack_require__(44),\n\t isLength = __webpack_require__(46);\n\t\n\t/**\n\t * Checks if `value` is array-like.\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n\t */\n\tfunction isArrayLike(value) {\n\t return value != null && isLength(getLength(value));\n\t}\n\t\n\tmodule.exports = isArrayLike;\n\n\n/***/ },\n/* 44 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar baseProperty = __webpack_require__(45);\n\t\n\t/**\n\t * Gets the \"length\" property value of `object`.\n\t *\n\t * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)\n\t * that affects Safari on at least iOS 8.1-8.3 ARM64.\n\t *\n\t * @private\n\t * @param {Object} object The object to query.\n\t * @returns {*} Returns the \"length\" value.\n\t */\n\tvar getLength = baseProperty('length');\n\t\n\tmodule.exports = getLength;\n\n\n/***/ },\n/* 45 */\n/***/ function(module, exports) {\n\n\t/**\n\t * The base implementation of `_.property` without support for deep paths.\n\t *\n\t * @private\n\t * @param {string} key The key of the property to get.\n\t * @returns {Function} Returns the new function.\n\t */\n\tfunction baseProperty(key) {\n\t return function(object) {\n\t return object == null ? undefined : object[key];\n\t };\n\t}\n\t\n\tmodule.exports = baseProperty;\n\n\n/***/ },\n/* 46 */\n/***/ function(module, exports) {\n\n\t/**\n\t * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)\n\t * of an array-like value.\n\t */\n\tvar MAX_SAFE_INTEGER = 9007199254740991;\n\t\n\t/**\n\t * Checks if `value` is a valid array-like length.\n\t *\n\t * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n\t */\n\tfunction isLength(value) {\n\t return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n\t}\n\t\n\tmodule.exports = isLength;\n\n\n/***/ },\n/* 47 */\n/***/ function(module, exports) {\n\n\t/**\n\t * Checks if `value` is object-like.\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n\t */\n\tfunction isObjectLike(value) {\n\t return !!value && typeof value == 'object';\n\t}\n\t\n\tmodule.exports = isObjectLike;\n\n\n/***/ },\n/* 48 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar getNative = __webpack_require__(49),\n\t isLength = __webpack_require__(46),\n\t isObjectLike = __webpack_require__(47);\n\t\n\t/** `Object#toString` result references. */\n\tvar arrayTag = '[object Array]';\n\t\n\t/** Used for native method references. */\n\tvar objectProto = Object.prototype;\n\t\n\t/**\n\t * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n\t * of values.\n\t */\n\tvar objToString = objectProto.toString;\n\t\n\t/* Native method references for those with the same name as other `lodash` methods. */\n\tvar nativeIsArray = getNative(Array, 'isArray');\n\t\n\t/**\n\t * Checks if `value` is classified as an `Array` object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n\t * @example\n\t *\n\t * _.isArray([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isArray(function() { return arguments; }());\n\t * // => false\n\t */\n\tvar isArray = nativeIsArray || function(value) {\n\t return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;\n\t};\n\t\n\tmodule.exports = isArray;\n\n\n/***/ },\n/* 49 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar isNative = __webpack_require__(50);\n\t\n\t/**\n\t * Gets the native function at `key` of `object`.\n\t *\n\t * @private\n\t * @param {Object} object The object to query.\n\t * @param {string} key The key of the method to get.\n\t * @returns {*} Returns the function if it's native, else `undefined`.\n\t */\n\tfunction getNative(object, key) {\n\t var value = object == null ? undefined : object[key];\n\t return isNative(value) ? value : undefined;\n\t}\n\t\n\tmodule.exports = getNative;\n\n\n/***/ },\n/* 50 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar isFunction = __webpack_require__(51),\n\t isObjectLike = __webpack_require__(47);\n\t\n\t/** Used to detect host constructors (Safari > 5). */\n\tvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\t\n\t/** Used for native method references. */\n\tvar objectProto = Object.prototype;\n\t\n\t/** Used to resolve the decompiled source of functions. */\n\tvar fnToString = Function.prototype.toString;\n\t\n\t/** Used to check objects for own properties. */\n\tvar hasOwnProperty = objectProto.hasOwnProperty;\n\t\n\t/** Used to detect if a method is native. */\n\tvar reIsNative = RegExp('^' +\n\t fnToString.call(hasOwnProperty).replace(/[\\\\^$.*+?()[\\]{}|]/g, '\\\\$&')\n\t .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n\t);\n\t\n\t/**\n\t * Checks if `value` is a native function.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a native function, else `false`.\n\t * @example\n\t *\n\t * _.isNative(Array.prototype.push);\n\t * // => true\n\t *\n\t * _.isNative(_);\n\t * // => false\n\t */\n\tfunction isNative(value) {\n\t if (value == null) {\n\t return false;\n\t }\n\t if (isFunction(value)) {\n\t return reIsNative.test(fnToString.call(value));\n\t }\n\t return isObjectLike(value) && reIsHostCtor.test(value);\n\t}\n\t\n\tmodule.exports = isNative;\n\n\n/***/ },\n/* 51 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar isObject = __webpack_require__(52);\n\t\n\t/** `Object#toString` result references. */\n\tvar funcTag = '[object Function]';\n\t\n\t/** Used for native method references. */\n\tvar objectProto = Object.prototype;\n\t\n\t/**\n\t * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n\t * of values.\n\t */\n\tvar objToString = objectProto.toString;\n\t\n\t/**\n\t * Checks if `value` is classified as a `Function` object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n\t * @example\n\t *\n\t * _.isFunction(_);\n\t * // => true\n\t *\n\t * _.isFunction(/abc/);\n\t * // => false\n\t */\n\tfunction isFunction(value) {\n\t // The use of `Object#toString` avoids issues with the `typeof` operator\n\t // in older versions of Chrome and Safari which return 'function' for regexes\n\t // and Safari 8 which returns 'object' for typed array constructors.\n\t return isObject(value) && objToString.call(value) == funcTag;\n\t}\n\t\n\tmodule.exports = isFunction;\n\n\n/***/ },\n/* 52 */\n/***/ function(module, exports) {\n\n\t/**\n\t * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.\n\t * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n\t * @example\n\t *\n\t * _.isObject({});\n\t * // => true\n\t *\n\t * _.isObject([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isObject(1);\n\t * // => false\n\t */\n\tfunction isObject(value) {\n\t // Avoid a V8 JIT bug in Chrome 19-20.\n\t // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.\n\t var type = typeof value;\n\t return !!value && (type == 'object' || type == 'function');\n\t}\n\t\n\tmodule.exports = isObject;\n\n\n/***/ },\n/* 53 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar baseForIn = __webpack_require__(54),\n\t isArguments = __webpack_require__(42),\n\t isObjectLike = __webpack_require__(47);\n\t\n\t/** `Object#toString` result references. */\n\tvar objectTag = '[object Object]';\n\t\n\t/** Used for native method references. */\n\tvar objectProto = Object.prototype;\n\t\n\t/** Used to check objects for own properties. */\n\tvar hasOwnProperty = objectProto.hasOwnProperty;\n\t\n\t/**\n\t * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n\t * of values.\n\t */\n\tvar objToString = objectProto.toString;\n\t\n\t/**\n\t * Checks if `value` is a plain object, that is, an object created by the\n\t * `Object` constructor or one with a `[[Prototype]]` of `null`.\n\t *\n\t * **Note:** This method assumes objects created by the `Object` constructor\n\t * have no inherited enumerable properties.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n\t * @example\n\t *\n\t * function Foo() {\n\t * this.a = 1;\n\t * }\n\t *\n\t * _.isPlainObject(new Foo);\n\t * // => false\n\t *\n\t * _.isPlainObject([1, 2, 3]);\n\t * // => false\n\t *\n\t * _.isPlainObject({ 'x': 0, 'y': 0 });\n\t * // => true\n\t *\n\t * _.isPlainObject(Object.create(null));\n\t * // => true\n\t */\n\tfunction isPlainObject(value) {\n\t var Ctor;\n\t\n\t // Exit early for non `Object` objects.\n\t if (!(isObjectLike(value) && objToString.call(value) == objectTag && !isArguments(value)) ||\n\t (!hasOwnProperty.call(value, 'constructor') && (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor)))) {\n\t return false;\n\t }\n\t // IE < 9 iterates inherited properties before own properties. If the first\n\t // iterated property is an object's own property then there are no inherited\n\t // enumerable properties.\n\t var result;\n\t // In most environments an object's own properties are iterated before\n\t // its inherited properties. If the last iterated property is an object's\n\t // own property then there are no inherited enumerable properties.\n\t baseForIn(value, function(subValue, key) {\n\t result = key;\n\t });\n\t return result === undefined || hasOwnProperty.call(value, result);\n\t}\n\t\n\tmodule.exports = isPlainObject;\n\n\n/***/ },\n/* 54 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar baseFor = __webpack_require__(55),\n\t keysIn = __webpack_require__(58);\n\t\n\t/**\n\t * The base implementation of `_.forIn` without support for callback\n\t * shorthands and `this` binding.\n\t *\n\t * @private\n\t * @param {Object} object The object to iterate over.\n\t * @param {Function} iteratee The function invoked per iteration.\n\t * @returns {Object} Returns `object`.\n\t */\n\tfunction baseForIn(object, iteratee) {\n\t return baseFor(object, iteratee, keysIn);\n\t}\n\t\n\tmodule.exports = baseForIn;\n\n\n/***/ },\n/* 55 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar createBaseFor = __webpack_require__(56);\n\t\n\t/**\n\t * The base implementation of `baseForIn` and `baseForOwn` which iterates\n\t * over `object` properties returned by `keysFunc` invoking `iteratee` for\n\t * each property. Iteratee functions may exit iteration early by explicitly\n\t * returning `false`.\n\t *\n\t * @private\n\t * @param {Object} object The object to iterate over.\n\t * @param {Function} iteratee The function invoked per iteration.\n\t * @param {Function} keysFunc The function to get the keys of `object`.\n\t * @returns {Object} Returns `object`.\n\t */\n\tvar baseFor = createBaseFor();\n\t\n\tmodule.exports = baseFor;\n\n\n/***/ },\n/* 56 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar toObject = __webpack_require__(57);\n\t\n\t/**\n\t * Creates a base function for `_.forIn` or `_.forInRight`.\n\t *\n\t * @private\n\t * @param {boolean} [fromRight] Specify iterating from right to left.\n\t * @returns {Function} Returns the new base function.\n\t */\n\tfunction createBaseFor(fromRight) {\n\t return function(object, iteratee, keysFunc) {\n\t var iterable = toObject(object),\n\t props = keysFunc(object),\n\t length = props.length,\n\t index = fromRight ? length : -1;\n\t\n\t while ((fromRight ? index-- : ++index < length)) {\n\t var key = props[index];\n\t if (iteratee(iterable[key], key, iterable) === false) {\n\t break;\n\t }\n\t }\n\t return object;\n\t };\n\t}\n\t\n\tmodule.exports = createBaseFor;\n\n\n/***/ },\n/* 57 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar isObject = __webpack_require__(52);\n\t\n\t/**\n\t * Converts `value` to an object if it's not one.\n\t *\n\t * @private\n\t * @param {*} value The value to process.\n\t * @returns {Object} Returns the object.\n\t */\n\tfunction toObject(value) {\n\t return isObject(value) ? value : Object(value);\n\t}\n\t\n\tmodule.exports = toObject;\n\n\n/***/ },\n/* 58 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar isArguments = __webpack_require__(42),\n\t isArray = __webpack_require__(48),\n\t isIndex = __webpack_require__(59),\n\t isLength = __webpack_require__(46),\n\t isObject = __webpack_require__(52);\n\t\n\t/** Used for native method references. */\n\tvar objectProto = Object.prototype;\n\t\n\t/** Used to check objects for own properties. */\n\tvar hasOwnProperty = objectProto.hasOwnProperty;\n\t\n\t/**\n\t * Creates an array of the own and inherited enumerable property names of `object`.\n\t *\n\t * **Note:** Non-object values are coerced to objects.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Object\n\t * @param {Object} object The object to query.\n\t * @returns {Array} Returns the array of property names.\n\t * @example\n\t *\n\t * function Foo() {\n\t * this.a = 1;\n\t * this.b = 2;\n\t * }\n\t *\n\t * Foo.prototype.c = 3;\n\t *\n\t * _.keysIn(new Foo);\n\t * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n\t */\n\tfunction keysIn(object) {\n\t if (object == null) {\n\t return [];\n\t }\n\t if (!isObject(object)) {\n\t object = Object(object);\n\t }\n\t var length = object.length;\n\t length = (length && isLength(length) &&\n\t (isArray(object) || isArguments(object)) && length) || 0;\n\t\n\t var Ctor = object.constructor,\n\t index = -1,\n\t isProto = typeof Ctor == 'function' && Ctor.prototype === object,\n\t result = Array(length),\n\t skipIndexes = length > 0;\n\t\n\t while (++index < length) {\n\t result[index] = (index + '');\n\t }\n\t for (var key in object) {\n\t if (!(skipIndexes && isIndex(key, length)) &&\n\t !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n\t result.push(key);\n\t }\n\t }\n\t return result;\n\t}\n\t\n\tmodule.exports = keysIn;\n\n\n/***/ },\n/* 59 */\n/***/ function(module, exports) {\n\n\t/** Used to detect unsigned integer values. */\n\tvar reIsUint = /^\\d+$/;\n\t\n\t/**\n\t * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)\n\t * of an array-like value.\n\t */\n\tvar MAX_SAFE_INTEGER = 9007199254740991;\n\t\n\t/**\n\t * Checks if `value` is a valid array-like index.\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n\t * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n\t */\n\tfunction isIndex(value, length) {\n\t value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;\n\t length = length == null ? MAX_SAFE_INTEGER : length;\n\t return value > -1 && value % 1 == 0 && value < length;\n\t}\n\t\n\tmodule.exports = isIndex;\n\n\n/***/ },\n/* 60 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar isLength = __webpack_require__(46),\n\t isObjectLike = __webpack_require__(47);\n\t\n\t/** `Object#toString` result references. */\n\tvar argsTag = '[object Arguments]',\n\t arrayTag = '[object Array]',\n\t boolTag = '[object Boolean]',\n\t dateTag = '[object Date]',\n\t errorTag = '[object Error]',\n\t funcTag = '[object Function]',\n\t mapTag = '[object Map]',\n\t numberTag = '[object Number]',\n\t objectTag = '[object Object]',\n\t regexpTag = '[object RegExp]',\n\t setTag = '[object Set]',\n\t stringTag = '[object String]',\n\t weakMapTag = '[object WeakMap]';\n\t\n\tvar arrayBufferTag = '[object ArrayBuffer]',\n\t float32Tag = '[object Float32Array]',\n\t float64Tag = '[object Float64Array]',\n\t int8Tag = '[object Int8Array]',\n\t int16Tag = '[object Int16Array]',\n\t int32Tag = '[object Int32Array]',\n\t uint8Tag = '[object Uint8Array]',\n\t uint8ClampedTag = '[object Uint8ClampedArray]',\n\t uint16Tag = '[object Uint16Array]',\n\t uint32Tag = '[object Uint32Array]';\n\t\n\t/** Used to identify `toStringTag` values of typed arrays. */\n\tvar typedArrayTags = {};\n\ttypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\n\ttypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\n\ttypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\n\ttypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\n\ttypedArrayTags[uint32Tag] = true;\n\ttypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\n\ttypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\n\ttypedArrayTags[dateTag] = typedArrayTags[errorTag] =\n\ttypedArrayTags[funcTag] = typedArrayTags[mapTag] =\n\ttypedArrayTags[numberTag] = typedArrayTags[objectTag] =\n\ttypedArrayTags[regexpTag] = typedArrayTags[setTag] =\n\ttypedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;\n\t\n\t/** Used for native method references. */\n\tvar objectProto = Object.prototype;\n\t\n\t/**\n\t * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n\t * of values.\n\t */\n\tvar objToString = objectProto.toString;\n\t\n\t/**\n\t * Checks if `value` is classified as a typed array.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n\t * @example\n\t *\n\t * _.isTypedArray(new Uint8Array);\n\t * // => true\n\t *\n\t * _.isTypedArray([]);\n\t * // => false\n\t */\n\tfunction isTypedArray(value) {\n\t return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)];\n\t}\n\t\n\tmodule.exports = isTypedArray;\n\n\n/***/ },\n/* 61 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar baseCopy = __webpack_require__(62),\n\t keysIn = __webpack_require__(58);\n\t\n\t/**\n\t * Converts `value` to a plain object flattening inherited enumerable\n\t * properties of `value` to own properties of the plain object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Lang\n\t * @param {*} value The value to convert.\n\t * @returns {Object} Returns the converted plain object.\n\t * @example\n\t *\n\t * function Foo() {\n\t * this.b = 2;\n\t * }\n\t *\n\t * Foo.prototype.c = 3;\n\t *\n\t * _.assign({ 'a': 1 }, new Foo);\n\t * // => { 'a': 1, 'b': 2 }\n\t *\n\t * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n\t * // => { 'a': 1, 'b': 2, 'c': 3 }\n\t */\n\tfunction toPlainObject(value) {\n\t return baseCopy(value, keysIn(value));\n\t}\n\t\n\tmodule.exports = toPlainObject;\n\n\n/***/ },\n/* 62 */\n/***/ function(module, exports) {\n\n\t/**\n\t * Copies properties of `source` to `object`.\n\t *\n\t * @private\n\t * @param {Object} source The object to copy properties from.\n\t * @param {Array} props The property names to copy.\n\t * @param {Object} [object={}] The object to copy properties to.\n\t * @returns {Object} Returns `object`.\n\t */\n\tfunction baseCopy(source, props, object) {\n\t object || (object = {});\n\t\n\t var index = -1,\n\t length = props.length;\n\t\n\t while (++index < length) {\n\t var key = props[index];\n\t object[key] = source[key];\n\t }\n\t return object;\n\t}\n\t\n\tmodule.exports = baseCopy;\n\n\n/***/ },\n/* 63 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar getNative = __webpack_require__(49),\n\t isArrayLike = __webpack_require__(43),\n\t isObject = __webpack_require__(52),\n\t shimKeys = __webpack_require__(64);\n\t\n\t/* Native method references for those with the same name as other `lodash` methods. */\n\tvar nativeKeys = getNative(Object, 'keys');\n\t\n\t/**\n\t * Creates an array of the own enumerable property names of `object`.\n\t *\n\t * **Note:** Non-object values are coerced to objects. See the\n\t * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)\n\t * for more details.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Object\n\t * @param {Object} object The object to query.\n\t * @returns {Array} Returns the array of property names.\n\t * @example\n\t *\n\t * function Foo() {\n\t * this.a = 1;\n\t * this.b = 2;\n\t * }\n\t *\n\t * Foo.prototype.c = 3;\n\t *\n\t * _.keys(new Foo);\n\t * // => ['a', 'b'] (iteration order is not guaranteed)\n\t *\n\t * _.keys('hi');\n\t * // => ['0', '1']\n\t */\n\tvar keys = !nativeKeys ? shimKeys : function(object) {\n\t var Ctor = object == null ? undefined : object.constructor;\n\t if ((typeof Ctor == 'function' && Ctor.prototype === object) ||\n\t (typeof object != 'function' && isArrayLike(object))) {\n\t return shimKeys(object);\n\t }\n\t return isObject(object) ? nativeKeys(object) : [];\n\t};\n\t\n\tmodule.exports = keys;\n\n\n/***/ },\n/* 64 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar isArguments = __webpack_require__(42),\n\t isArray = __webpack_require__(48),\n\t isIndex = __webpack_require__(59),\n\t isLength = __webpack_require__(46),\n\t keysIn = __webpack_require__(58);\n\t\n\t/** Used for native method references. */\n\tvar objectProto = Object.prototype;\n\t\n\t/** Used to check objects for own properties. */\n\tvar hasOwnProperty = objectProto.hasOwnProperty;\n\t\n\t/**\n\t * A fallback implementation of `Object.keys` which creates an array of the\n\t * own enumerable property names of `object`.\n\t *\n\t * @private\n\t * @param {Object} object The object to query.\n\t * @returns {Array} Returns the array of property names.\n\t */\n\tfunction shimKeys(object) {\n\t var props = keysIn(object),\n\t propsLength = props.length,\n\t length = propsLength && object.length;\n\t\n\t var allowIndexes = !!length && isLength(length) &&\n\t (isArray(object) || isArguments(object));\n\t\n\t var index = -1,\n\t result = [];\n\t\n\t while (++index < propsLength) {\n\t var key = props[index];\n\t if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {\n\t result.push(key);\n\t }\n\t }\n\t return result;\n\t}\n\t\n\tmodule.exports = shimKeys;\n\n\n/***/ },\n/* 65 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar bindCallback = __webpack_require__(66),\n\t isIterateeCall = __webpack_require__(68),\n\t restParam = __webpack_require__(69);\n\t\n\t/**\n\t * Creates a `_.assign`, `_.defaults`, or `_.merge` function.\n\t *\n\t * @private\n\t * @param {Function} assigner The function to assign values.\n\t * @returns {Function} Returns the new assigner function.\n\t */\n\tfunction createAssigner(assigner) {\n\t return restParam(function(object, sources) {\n\t var index = -1,\n\t length = object == null ? 0 : sources.length,\n\t customizer = length > 2 ? sources[length - 2] : undefined,\n\t guard = length > 2 ? sources[2] : undefined,\n\t thisArg = length > 1 ? sources[length - 1] : undefined;\n\t\n\t if (typeof customizer == 'function') {\n\t customizer = bindCallback(customizer, thisArg, 5);\n\t length -= 2;\n\t } else {\n\t customizer = typeof thisArg == 'function' ? thisArg : undefined;\n\t length -= (customizer ? 1 : 0);\n\t }\n\t if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n\t customizer = length < 3 ? undefined : customizer;\n\t length = 1;\n\t }\n\t while (++index < length) {\n\t var source = sources[index];\n\t if (source) {\n\t assigner(object, source, customizer);\n\t }\n\t }\n\t return object;\n\t });\n\t}\n\t\n\tmodule.exports = createAssigner;\n\n\n/***/ },\n/* 66 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar identity = __webpack_require__(67);\n\t\n\t/**\n\t * A specialized version of `baseCallback` which only supports `this` binding\n\t * and specifying the number of arguments to provide to `func`.\n\t *\n\t * @private\n\t * @param {Function} func The function to bind.\n\t * @param {*} thisArg The `this` binding of `func`.\n\t * @param {number} [argCount] The number of arguments to provide to `func`.\n\t * @returns {Function} Returns the callback.\n\t */\n\tfunction bindCallback(func, thisArg, argCount) {\n\t if (typeof func != 'function') {\n\t return identity;\n\t }\n\t if (thisArg === undefined) {\n\t return func;\n\t }\n\t switch (argCount) {\n\t case 1: return function(value) {\n\t return func.call(thisArg, value);\n\t };\n\t case 3: return function(value, index, collection) {\n\t return func.call(thisArg, value, index, collection);\n\t };\n\t case 4: return function(accumulator, value, index, collection) {\n\t return func.call(thisArg, accumulator, value, index, collection);\n\t };\n\t case 5: return function(value, other, key, object, source) {\n\t return func.call(thisArg, value, other, key, object, source);\n\t };\n\t }\n\t return function() {\n\t return func.apply(thisArg, arguments);\n\t };\n\t}\n\t\n\tmodule.exports = bindCallback;\n\n\n/***/ },\n/* 67 */\n/***/ function(module, exports) {\n\n\t/**\n\t * This method returns the first argument provided to it.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Utility\n\t * @param {*} value Any value.\n\t * @returns {*} Returns `value`.\n\t * @example\n\t *\n\t * var object = { 'user': 'fred' };\n\t *\n\t * _.identity(object) === object;\n\t * // => true\n\t */\n\tfunction identity(value) {\n\t return value;\n\t}\n\t\n\tmodule.exports = identity;\n\n\n/***/ },\n/* 68 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar isArrayLike = __webpack_require__(43),\n\t isIndex = __webpack_require__(59),\n\t isObject = __webpack_require__(52);\n\t\n\t/**\n\t * Checks if the provided arguments are from an iteratee call.\n\t *\n\t * @private\n\t * @param {*} value The potential iteratee value argument.\n\t * @param {*} index The potential iteratee index or key argument.\n\t * @param {*} object The potential iteratee object argument.\n\t * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.\n\t */\n\tfunction isIterateeCall(value, index, object) {\n\t if (!isObject(object)) {\n\t return false;\n\t }\n\t var type = typeof index;\n\t if (type == 'number'\n\t ? (isArrayLike(object) && isIndex(index, object.length))\n\t : (type == 'string' && index in object)) {\n\t var other = object[index];\n\t return value === value ? (value === other) : (other !== other);\n\t }\n\t return false;\n\t}\n\t\n\tmodule.exports = isIterateeCall;\n\n\n/***/ },\n/* 69 */\n/***/ function(module, exports) {\n\n\t/** Used as the `TypeError` message for \"Functions\" methods. */\n\tvar FUNC_ERROR_TEXT = 'Expected a function';\n\t\n\t/* Native method references for those with the same name as other `lodash` methods. */\n\tvar nativeMax = Math.max;\n\t\n\t/**\n\t * Creates a function that invokes `func` with the `this` binding of the\n\t * created function and arguments from `start` and beyond provided as an array.\n\t *\n\t * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/Web/JavaScript/Reference/Functions/rest_parameters).\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Function\n\t * @param {Function} func The function to apply a rest parameter to.\n\t * @param {number} [start=func.length-1] The start position of the rest parameter.\n\t * @returns {Function} Returns the new function.\n\t * @example\n\t *\n\t * var say = _.restParam(function(what, names) {\n\t * return what + ' ' + _.initial(names).join(', ') +\n\t * (_.size(names) > 1 ? ', & ' : '') + _.last(names);\n\t * });\n\t *\n\t * say('hello', 'fred', 'barney', 'pebbles');\n\t * // => 'hello fred, barney, & pebbles'\n\t */\n\tfunction restParam(func, start) {\n\t if (typeof func != 'function') {\n\t throw new TypeError(FUNC_ERROR_TEXT);\n\t }\n\t start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0);\n\t return function() {\n\t var args = arguments,\n\t index = -1,\n\t length = nativeMax(args.length - start, 0),\n\t rest = Array(length);\n\t\n\t while (++index < length) {\n\t rest[index] = args[start + index];\n\t }\n\t switch (start) {\n\t case 0: return func.call(this, rest);\n\t case 1: return func.call(this, args[0], rest);\n\t case 2: return func.call(this, args[0], args[1], rest);\n\t }\n\t var otherArgs = Array(start + 1);\n\t index = -1;\n\t while (++index < start) {\n\t otherArgs[index] = args[index];\n\t }\n\t otherArgs[start] = rest;\n\t return func.apply(this, otherArgs);\n\t };\n\t}\n\t\n\tmodule.exports = restParam;\n\n\n/***/ },\n/* 70 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\t\n\tvar _cv_utils = __webpack_require__(7);\n\t\n\tvar _cv_utils2 = _interopRequireDefault(_cv_utils);\n\t\n\tvar FrameGrabber = {};\n\t\n\tFrameGrabber.create = function (inputStream, canvas) {\n\t var _that = {},\n\t _streamConfig = inputStream.getConfig(),\n\t _video_size = _cv_utils2[\"default\"].imageRef(inputStream.getRealWidth(), inputStream.getRealHeight()),\n\t _canvasSize = inputStream.getCanvasSize(),\n\t _size = _cv_utils2[\"default\"].imageRef(inputStream.getWidth(), inputStream.getHeight()),\n\t topRight = inputStream.getTopRight(),\n\t _sx = topRight.x,\n\t _sy = topRight.y,\n\t _canvas,\n\t _ctx = null,\n\t _data = null;\n\t\n\t _canvas = canvas ? canvas : document.createElement(\"canvas\");\n\t _canvas.width = _canvasSize.x;\n\t _canvas.height = _canvasSize.y;\n\t _ctx = _canvas.getContext(\"2d\");\n\t _data = new Uint8Array(_size.x * _size.y);\n\t console.log(\"FrameGrabber\", JSON.stringify({\n\t size: _size,\n\t topRight: topRight,\n\t videoSize: _video_size,\n\t canvasSize: _canvasSize\n\t }));\n\t\n\t /**\n\t * Uses the given array as frame-buffer\n\t */\n\t _that.attachData = function (data) {\n\t _data = data;\n\t };\n\t\n\t /**\n\t * Returns the used frame-buffer\n\t */\n\t _that.getData = function () {\n\t return _data;\n\t };\n\t\n\t /**\n\t * Fetches a frame from the input-stream and puts into the frame-buffer.\n\t * The image-data is converted to gray-scale and then half-sampled if configured.\n\t */\n\t _that.grab = function () {\n\t var doHalfSample = _streamConfig.halfSample,\n\t frame = inputStream.getFrame(),\n\t ctxData;\n\t if (frame) {\n\t _ctx.drawImage(frame, 0, 0, _canvasSize.x, _canvasSize.y);\n\t ctxData = _ctx.getImageData(_sx, _sy, _size.x, _size.y).data;\n\t if (doHalfSample) {\n\t _cv_utils2[\"default\"].grayAndHalfSampleFromCanvasData(ctxData, _size, _data);\n\t } else {\n\t _cv_utils2[\"default\"].computeGray(ctxData, _data, _streamConfig);\n\t }\n\t return true;\n\t } else {\n\t return false;\n\t }\n\t };\n\t\n\t _that.getSize = function () {\n\t return _size;\n\t };\n\t\n\t return _that;\n\t};\n\t\n\texports[\"default\"] = FrameGrabber;\n\tmodule.exports = exports[\"default\"];\n\n/***/ },\n/* 71 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports[\"default\"] = {\n\t inputStream: {\n\t name: \"Live\",\n\t type: \"LiveStream\",\n\t constraints: {\n\t width: 640,\n\t height: 480,\n\t minAspectRatio: 0,\n\t maxAspectRatio: 100,\n\t facing: \"environment\" // or user\n\t },\n\t area: {\n\t top: \"0%\",\n\t right: \"0%\",\n\t left: \"0%\",\n\t bottom: \"0%\"\n\t },\n\t singleChannel: false // true: only the red color-channel is read\n\t },\n\t tracking: false,\n\t debug: false,\n\t controls: false,\n\t locate: true,\n\t numOfWorkers: 4,\n\t visual: {\n\t show: true\n\t },\n\t decoder: {\n\t drawBoundingBox: false,\n\t showFrequency: false,\n\t drawScanline: false,\n\t showPattern: false,\n\t readers: ['code_128_reader']\n\t },\n\t locator: {\n\t halfSample: true,\n\t patchSize: \"medium\", // x-small, small, medium, large, x-large\n\t showCanvas: false,\n\t showPatches: false,\n\t showFoundPatches: false,\n\t showSkeleton: false,\n\t showLabels: false,\n\t showPatchLabels: false,\n\t showRemainingPatchLabels: false,\n\t boxFromPatches: {\n\t showTransformed: false,\n\t showTransformedBox: false,\n\t showBB: false\n\t }\n\t }\n\t};\n\tmodule.exports = exports[\"default\"];\n\n/***/ },\n/* 72 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\texports[\"default\"] = (function () {\n\t var events = {};\n\t\n\t function getEvent(eventName) {\n\t if (!events[eventName]) {\n\t events[eventName] = {\n\t subscribers: []\n\t };\n\t }\n\t return events[eventName];\n\t }\n\t\n\t function clearEvents() {\n\t events = {};\n\t }\n\t\n\t function publishSubscription(subscription, data) {\n\t if (subscription.async) {\n\t setTimeout(function () {\n\t subscription.callback(data);\n\t }, 4);\n\t } else {\n\t subscription.callback(data);\n\t }\n\t }\n\t\n\t function _subscribe(event, callback, async) {\n\t var subscription;\n\t\n\t if (typeof callback === \"function\") {\n\t subscription = {\n\t callback: callback,\n\t async: async\n\t };\n\t } else {\n\t subscription = callback;\n\t if (!subscription.callback) {\n\t throw \"Callback was not specified on options\";\n\t }\n\t }\n\t\n\t getEvent(event).subscribers.push(subscription);\n\t }\n\t\n\t return {\n\t subscribe: function subscribe(event, callback, async) {\n\t return _subscribe(event, callback, async);\n\t },\n\t publish: function publish(eventName, data) {\n\t var event = getEvent(eventName),\n\t subscribers = event.subscribers;\n\t\n\t event.subscribers = subscribers.filter(function (subscriber) {\n\t publishSubscription(subscriber, data);\n\t return !subscriber.once;\n\t });\n\t },\n\t once: function once(event, callback, async) {\n\t _subscribe(event, {\n\t callback: callback,\n\t async: async,\n\t once: true\n\t });\n\t },\n\t unsubscribe: function unsubscribe(eventName, callback) {\n\t var event;\n\t\n\t if (eventName) {\n\t event = getEvent(eventName);\n\t if (event && callback) {\n\t event.subscribers = event.subscribers.filter(function (subscriber) {\n\t return subscriber.callback !== callback;\n\t });\n\t } else {\n\t event.subscribers = [];\n\t }\n\t } else {\n\t clearEvents();\n\t }\n\t }\n\t };\n\t})();\n\t\n\t;\n\tmodule.exports = exports[\"default\"];\n\n/***/ },\n/* 73 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\tvar merge = __webpack_require__(37);\n\t\n\tvar streamRef, loadedDataHandler;\n\t\n\t/**\n\t * Wraps browser-specific getUserMedia\n\t * @param {Object} constraints\n\t * @param {Object} success Callback\n\t * @param {Object} failure Callback\n\t */\n\tfunction getUserMedia(constraints, success, failure) {\n\t if (typeof navigator.getUserMedia !== 'undefined') {\n\t navigator.getUserMedia(constraints, function (stream) {\n\t streamRef = stream;\n\t var videoSrc = window.URL && window.URL.createObjectURL(stream) || stream;\n\t success.apply(null, [videoSrc]);\n\t }, failure);\n\t } else {\n\t failure(new TypeError(\"getUserMedia not available\"));\n\t }\n\t}\n\t\n\tfunction loadedData(video, callback) {\n\t var attempts = 10;\n\t\n\t function checkVideo() {\n\t if (attempts > 0) {\n\t if (video.videoWidth > 0 && video.videoHeight > 0) {\n\t console.log(video.videoWidth + \"px x \" + video.videoHeight + \"px\");\n\t callback();\n\t } else {\n\t window.setTimeout(checkVideo, 500);\n\t }\n\t } else {\n\t callback('Unable to play video stream. Is webcam working?');\n\t }\n\t attempts--;\n\t }\n\t checkVideo();\n\t}\n\t\n\t/**\n\t * Tries to attach the camera-stream to a given video-element\n\t * and calls the callback function when the content is ready\n\t * @param {Object} constraints\n\t * @param {Object} video\n\t * @param {Object} callback\n\t */\n\tfunction initCamera(constraints, video, callback) {\n\t getUserMedia(constraints, function (src) {\n\t video.src = src;\n\t if (loadedDataHandler) {\n\t video.removeEventListener(\"loadeddata\", loadedDataHandler, false);\n\t }\n\t loadedDataHandler = loadedData.bind(null, video, callback);\n\t video.addEventListener('loadeddata', loadedDataHandler, false);\n\t video.play();\n\t }, function (e) {\n\t callback(e);\n\t });\n\t}\n\t\n\t/**\n\t * Normalizes the incoming constraints to satisfy the current browser\n\t * @param config\n\t * @param cb Callback which is called whenever constraints are created\n\t * @returns {*}\n\t */\n\tfunction normalizeConstraints(config, cb) {\n\t var constraints = {\n\t audio: false,\n\t video: true\n\t },\n\t videoConstraints = merge({\n\t width: 640,\n\t height: 480,\n\t minAspectRatio: 0,\n\t maxAspectRatio: 100,\n\t facing: \"environment\"\n\t }, config);\n\t\n\t if (typeof MediaStreamTrack !== 'undefined' && typeof MediaStreamTrack.getSources !== 'undefined') {\n\t MediaStreamTrack.getSources(function (sourceInfos) {\n\t var videoSourceId;\n\t for (var i = 0; i != sourceInfos.length; ++i) {\n\t var sourceInfo = sourceInfos[i];\n\t if (sourceInfo.kind == \"video\" && sourceInfo.facing == videoConstraints.facing) {\n\t videoSourceId = sourceInfo.id;\n\t }\n\t }\n\t constraints.video = {\n\t mandatory: {\n\t minWidth: videoConstraints.width,\n\t minHeight: videoConstraints.height,\n\t minAspectRatio: videoConstraints.minAspectRatio,\n\t maxAspectRatio: videoConstraints.maxAspectRatio\n\t },\n\t optional: [{\n\t sourceId: videoSourceId\n\t }]\n\t };\n\t return cb(constraints);\n\t });\n\t } else {\n\t constraints.video = {\n\t mediaSource: \"camera\",\n\t width: { min: videoConstraints.width, max: videoConstraints.width },\n\t height: { min: videoConstraints.height, max: videoConstraints.height },\n\t require: [\"width\", \"height\"]\n\t };\n\t return cb(constraints);\n\t }\n\t}\n\t\n\t/**\n\t * Requests the back-facing camera of the user. The callback is called\n\t * whenever the stream is ready to be consumed, or if an error occures.\n\t * @param {Object} video\n\t * @param {Object} callback\n\t */\n\tfunction _request(video, videoConstraints, callback) {\n\t normalizeConstraints(videoConstraints, function (constraints) {\n\t initCamera(constraints, video, callback);\n\t });\n\t}\n\t\n\texports['default'] = {\n\t request: function request(video, constraints, callback) {\n\t _request(video, constraints, callback);\n\t },\n\t release: function release() {\n\t var tracks = streamRef && streamRef.getVideoTracks();\n\t if (tracks.length) {\n\t tracks[0].stop();\n\t }\n\t streamRef = null;\n\t }\n\t};\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 74 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar _image_debug = __webpack_require__(24);\n\t\n\tvar _image_debug2 = _interopRequireDefault(_image_debug);\n\t\n\tfunction contains(codeResult, list) {\n\t if (list) {\n\t return list.some(function (item) {\n\t return Object.keys(item).every(function (key) {\n\t return item[key] === codeResult[key];\n\t });\n\t });\n\t }\n\t return false;\n\t}\n\t\n\tfunction passesFilter(codeResult, filter) {\n\t if (typeof filter === 'function') {\n\t return filter(codeResult);\n\t }\n\t return true;\n\t}\n\t\n\texports['default'] = {\n\t create: function create(config) {\n\t var canvas = document.createElement(\"canvas\"),\n\t ctx = canvas.getContext(\"2d\"),\n\t results = [],\n\t capacity = config.capacity || 20,\n\t capture = config.capture === true;\n\t\n\t function matchesConstraints(codeResult) {\n\t return capacity && codeResult && !contains(codeResult, config.blacklist) && passesFilter(codeResult, config.filter);\n\t }\n\t\n\t return {\n\t addResult: function addResult(data, imageSize, codeResult) {\n\t var result = {};\n\t\n\t if (matchesConstraints(codeResult)) {\n\t capacity--;\n\t result.codeResult = codeResult;\n\t if (capture) {\n\t canvas.width = imageSize.x;\n\t canvas.height = imageSize.y;\n\t _image_debug2['default'].drawImage(data, imageSize, ctx);\n\t result.frame = canvas.toDataURL();\n\t }\n\t results.push(result);\n\t }\n\t },\n\t getResults: function getResults() {\n\t return results;\n\t }\n\t };\n\t }\n\t};\n\tmodule.exports = exports['default'];\n\n/***/ }\n/******/ ])\n});\n;\n\n\n/** WEBPACK FOOTER **\n ** quagga.min.js\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap bbe7819afe77c7859a4a\n **/","import TypeDefs from './typedefs';\nimport InputStream from './input_stream';\nimport ImageWrapper from './image_wrapper';\nimport BarcodeLocator from './barcode_locator';\nimport BarcodeDecoder from './barcode_decoder';\nimport FrameGrabber from './frame_grabber';\nimport Config from './config';\nimport Events from './events';\nimport CameraAccess from './camera_access';\nimport ImageDebug from './image_debug';\nimport {vec2} from 'gl-matrix';\nimport ResultCollector from './result_collector';\n\nconst merge = require('lodash/object/merge');\n\nvar _inputStream,\n _framegrabber,\n _stopped,\n _canvasContainer = {\n ctx : {\n image : null,\n overlay : null\n },\n dom : {\n image : null,\n overlay : null\n }\n },\n _inputImageWrapper,\n _boxSize,\n _decoder,\n _workerPool = [],\n _onUIThread = true,\n _resultCollector,\n _config = {};\n\nfunction initializeData(imageWrapper) {\n initBuffers(imageWrapper);\n _decoder = BarcodeDecoder.create(_config.decoder, _inputImageWrapper);\n}\n\nfunction initConfig() {\n if (typeof document !== \"undefined\") {\n var vis = [{\n node: document.querySelector(\"div[data-controls]\"),\n prop: _config.controls\n }, {\n node: _canvasContainer.dom.overlay,\n prop: _config.visual.show\n }];\n\n for (var i = 0; i < vis.length; i++) {\n if (vis[i].node) {\n if (vis[i].prop === true) {\n vis[i].node.style.display = \"block\";\n } else {\n vis[i].node.style.display = \"none\";\n }\n }\n }\n }\n}\n\nfunction initInputStream(cb) {\n var video;\n if (_config.inputStream.type == \"VideoStream\") {\n video = document.createElement(\"video\");\n _inputStream = InputStream.createVideoStream(video);\n } else if (_config.inputStream.type == \"ImageStream\") {\n _inputStream = InputStream.createImageStream();\n } else if (_config.inputStream.type == \"LiveStream\") {\n var $viewport = document.querySelector(\"#interactive.viewport\");\n if ($viewport) {\n video = $viewport.querySelector(\"video\");\n if (!video) {\n video = document.createElement(\"video\");\n $viewport.appendChild(video);\n }\n }\n _inputStream = InputStream.createLiveStream(video);\n CameraAccess.request(video, _config.inputStream.constraints, function(err) {\n if (!err) {\n _inputStream.trigger(\"canrecord\");\n } else {\n return cb(err);\n }\n });\n }\n\n _inputStream.setAttribute(\"preload\", \"auto\");\n _inputStream.setAttribute(\"autoplay\", true);\n _inputStream.setInputStream(_config.inputStream);\n _inputStream.addEventListener(\"canrecord\", canRecord.bind(undefined, cb));\n}\n\nfunction canRecord(cb) {\n BarcodeLocator.checkImageConstraints(_inputStream, _config.locator);\n initCanvas();\n _framegrabber = FrameGrabber.create(_inputStream, _canvasContainer.dom.image);\n initConfig();\n\n if (_config.numOfWorkers > 0) {\n initWorkers(function() {\n console.log(\"Workers created\");\n ready(cb);\n });\n } else {\n initializeData();\n ready(cb);\n }\n}\n\nfunction ready(cb){\n _inputStream.play();\n cb();\n}\n\nfunction initCanvas() {\n if (typeof document !== \"undefined\") {\n var $viewport = document.querySelector(\"#interactive.viewport\");\n _canvasContainer.dom.image = document.querySelector(\"canvas.imgBuffer\");\n if (!_canvasContainer.dom.image) {\n _canvasContainer.dom.image = document.createElement(\"canvas\");\n _canvasContainer.dom.image.className = \"imgBuffer\";\n if ($viewport && _config.inputStream.type == \"ImageStream\") {\n $viewport.appendChild(_canvasContainer.dom.image);\n }\n }\n _canvasContainer.ctx.image = _canvasContainer.dom.image.getContext(\"2d\");\n _canvasContainer.dom.image.width = _inputStream.getCanvasSize().x;\n _canvasContainer.dom.image.height = _inputStream.getCanvasSize().y;\n\n _canvasContainer.dom.overlay = document.querySelector(\"canvas.drawingBuffer\");\n if (!_canvasContainer.dom.overlay) {\n _canvasContainer.dom.overlay = document.createElement(\"canvas\");\n _canvasContainer.dom.overlay.className = \"drawingBuffer\";\n if ($viewport) {\n $viewport.appendChild(_canvasContainer.dom.overlay);\n }\n var clearFix = document.createElement(\"br\");\n clearFix.setAttribute(\"clear\", \"all\");\n if ($viewport) {\n $viewport.appendChild(clearFix);\n }\n }\n _canvasContainer.ctx.overlay = _canvasContainer.dom.overlay.getContext(\"2d\");\n _canvasContainer.dom.overlay.width = _inputStream.getCanvasSize().x;\n _canvasContainer.dom.overlay.height = _inputStream.getCanvasSize().y;\n }\n}\n\nfunction initBuffers(imageWrapper) {\n if (imageWrapper) {\n _inputImageWrapper = imageWrapper;\n } else {\n _inputImageWrapper = new ImageWrapper({\n x : _inputStream.getWidth(),\n y : _inputStream.getHeight()\n });\n }\n\n console.log(_inputImageWrapper.size);\n _boxSize = [\n vec2.clone([0, 0]),\n vec2.clone([0, _inputImageWrapper.size.y]),\n vec2.clone([_inputImageWrapper.size.x, _inputImageWrapper.size.y]),\n vec2.clone([_inputImageWrapper.size.x, 0])\n ];\n BarcodeLocator.init(_inputImageWrapper, _config.locator);\n}\n\nfunction getBoundingBoxes() {\n if (_config.locate) {\n return BarcodeLocator.locate();\n } else {\n return [[\n vec2.clone(_boxSize[0]),\n vec2.clone(_boxSize[1]),\n vec2.clone(_boxSize[2]),\n vec2.clone(_boxSize[3])]];\n }\n}\n\nfunction transformResult(result) {\n var topRight = _inputStream.getTopRight(),\n xOffset = topRight.x,\n yOffset = topRight.y,\n i;\n\n if (!result || (xOffset === 0 && yOffset === 0)) {\n return;\n }\n\n\n if (result.line && result.line.length === 2) {\n moveLine(result.line);\n }\n if (result.boxes && result.boxes.length > 0) {\n for (i = 0; i < result.boxes.length; i++) {\n moveBox(result.boxes[i]);\n }\n }\n\n function moveBox(box) {\n var corner = box.length;\n\n while(corner--) {\n box[corner][0] += xOffset;\n box[corner][1] += yOffset;\n }\n }\n\n function moveLine(line) {\n line[0].x += xOffset;\n line[0].y += yOffset;\n line[1].x += xOffset;\n line[1].y += yOffset;\n }\n}\n\nfunction publishResult(result, imageData) {\n if (_onUIThread) {\n transformResult(result);\n if (imageData && result && result.codeResult) {\n if (_resultCollector) {\n _resultCollector.addResult(imageData, _inputStream.getCanvasSize(), result.codeResult);\n }\n }\n }\n\n Events.publish(\"processed\", result);\n if (result && result.codeResult) {\n Events.publish(\"detected\", result);\n }\n}\n\nfunction locateAndDecode() {\n var result,\n boxes;\n\n boxes = getBoundingBoxes();\n if (boxes) {\n result = _decoder.decodeFromBoundingBoxes(boxes);\n result = result || {};\n result.boxes = boxes;\n publishResult(result, _inputImageWrapper.data);\n } else {\n publishResult();\n }\n}\n\nfunction update() {\n var availableWorker;\n\n if (_onUIThread) {\n if (_workerPool.length > 0) {\n availableWorker = _workerPool.filter(function(workerThread) {\n return !workerThread.busy;\n })[0];\n if (availableWorker) {\n _framegrabber.attachData(availableWorker.imageData);\n } else {\n return; // all workers are busy\n }\n } else {\n _framegrabber.attachData(_inputImageWrapper.data);\n }\n if (_framegrabber.grab()) {\n if (availableWorker) {\n availableWorker.busy = true;\n availableWorker.worker.postMessage({\n cmd: 'process',\n imageData: availableWorker.imageData\n }, [availableWorker.imageData.buffer]);\n } else {\n locateAndDecode();\n }\n }\n } else {\n locateAndDecode();\n }\n}\n\nfunction start() {\n _stopped = false;\n ( function frame() {\n if (!_stopped) {\n update();\n if (_onUIThread && _config.inputStream.type == \"LiveStream\") {\n window.requestAnimFrame(frame);\n }\n }\n }());\n}\n\nfunction initWorkers(cb) {\n var i;\n _workerPool = [];\n\n for (i = 0; i < _config.numOfWorkers; i++) {\n initWorker(workerInitialized);\n }\n\n function workerInitialized(workerThread) {\n _workerPool.push(workerThread);\n if (_workerPool.length >= _config.numOfWorkers){\n cb();\n }\n }\n}\n\nfunction initWorker(cb) {\n var blobURL,\n workerThread = {\n worker: undefined,\n imageData: new Uint8Array(_inputStream.getWidth() * _inputStream.getHeight()),\n busy: true\n };\n\n blobURL = generateWorkerBlob();\n workerThread.worker = new Worker(blobURL);\n\n workerThread.worker.onmessage = function(e) {\n if (e.data.event === 'initialized') {\n URL.revokeObjectURL(blobURL);\n workerThread.busy = false;\n workerThread.imageData = new Uint8Array(e.data.imageData);\n console.log(\"Worker initialized\");\n return cb(workerThread);\n } else if (e.data.event === 'processed') {\n workerThread.imageData = new Uint8Array(e.data.imageData);\n workerThread.busy = false;\n publishResult(e.data.result, workerThread.imageData);\n } else if (e.data.event === 'error') {\n console.log(\"Worker error: \" + e.data.message);\n }\n };\n\n workerThread.worker.postMessage({\n cmd: 'init',\n size: {x: _inputStream.getWidth(), y: _inputStream.getHeight()},\n imageData: workerThread.imageData,\n config: _config\n }, [workerThread.imageData.buffer]);\n}\n\n\nfunction workerInterface(factory) {\n window = self;\n if (factory) {\n /* jshint ignore:start */\n var Quagga = factory();\n if (!Quagga) {\n self.postMessage({'event': 'error', message: 'Quagga could not be created'});\n return;\n }\n /* jshint ignore:end */\n }\n /* jshint ignore:start */\n var imageWrapper;\n\n self.onmessage = function(e) {\n if (e.data.cmd === 'init') {\n var config = e.data.config;\n config.numOfWorkers = 0;\n imageWrapper = new Quagga.ImageWrapper({\n x : e.data.size.x,\n y : e.data.size.y\n }, new Uint8Array(e.data.imageData));\n Quagga.init(config, ready, imageWrapper);\n Quagga.onProcessed(onProcessed);\n } else if (e.data.cmd === 'process') {\n imageWrapper.data = new Uint8Array(e.data.imageData);\n Quagga.start();\n } else if (e.data.cmd === 'setReaders') {\n Quagga.setReaders(e.data.readers);\n }\n };\n\n function onProcessed(result) {\n self.postMessage({'event': 'processed', imageData: imageWrapper.data, result: result}, [imageWrapper.data.buffer]);\n }\n\n function ready() {\n self.postMessage({'event': 'initialized', imageData: imageWrapper.data}, [imageWrapper.data.buffer]);\n }\n /* jshint ignore:end */\n}\n\nfunction generateWorkerBlob() {\n var blob,\n factorySource;\n\n /* jshint ignore:start */\n if (typeof __factorySource__ !== 'undefined') {\n factorySource = __factorySource__;\n }\n /* jshint ignore:end */\n\n blob = new Blob(['(' + workerInterface.toString() + ')(' + factorySource + ');'],\n {type : 'text/javascript'});\n\n return window.URL.createObjectURL(blob);\n}\n\nfunction setReaders(readers) {\n if (_decoder) {\n _decoder.setReaders(readers);\n } else if (_onUIThread && _workerPool.length > 0) {\n _workerPool.forEach(function(workerThread) {\n workerThread.worker.postMessage({cmd: 'setReaders', readers: readers});\n });\n }\n}\n\nexport default {\n init : function(config, cb, imageWrapper) {\n _config = merge({}, Config, config);\n if (imageWrapper) {\n _onUIThread = false;\n initializeData(imageWrapper);\n return cb();\n } else {\n initInputStream(cb);\n }\n },\n start : function() {\n start();\n },\n stop : function() {\n _stopped = true;\n _workerPool.forEach(function(workerThread) {\n workerThread.worker.terminate();\n console.log(\"Worker terminated!\");\n });\n _workerPool.length = 0;\n if (_config.inputStream.type === \"LiveStream\") {\n CameraAccess.release();\n _inputStream.clearEventHandlers();\n }\n },\n pause: function() {\n _stopped = true;\n },\n onDetected : function(callback) {\n Events.subscribe(\"detected\", callback);\n },\n offDetected: function(callback) {\n Events.unsubscribe(\"detected\", callback);\n },\n onProcessed: function(callback) {\n Events.subscribe(\"processed\", callback);\n },\n offProcessed: function(callback) {\n Events.unsubscribe(\"processed\", callback);\n },\n setReaders: function(readers) {\n setReaders(readers);\n },\n registerResultCollector: function(resultCollector) {\n if (resultCollector && typeof resultCollector.addResult === 'function') {\n _resultCollector = resultCollector;\n }\n },\n canvas : _canvasContainer,\n decodeSingle : function(config, resultCallback) {\n config = merge({\n inputStream: {\n type : \"ImageStream\",\n sequence : false,\n size: 800,\n src: config.src\n },\n numOfWorkers: 1,\n locator: {\n halfSample: false\n }\n }, config);\n this.init(config, function() {\n Events.once(\"processed\", function(result) {\n _stopped = true;\n resultCallback.call(null, result);\n }, true);\n start();\n });\n },\n ImageWrapper: ImageWrapper,\n ImageDebug: ImageDebug,\n ResultCollector: ResultCollector\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/quagga.js\n **/","/*\n * typedefs.js\n * Normalizes browser-specific prefixes\n */\n\n if (typeof window !== 'undefined') {\n window.requestAnimFrame = (function () {\n return window.requestAnimationFrame ||\n window.webkitRequestAnimationFrame ||\n window.mozRequestAnimationFrame ||\n window.oRequestAnimationFrame ||\n window.msRequestAnimationFrame ||\n function (/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) {\n window.setTimeout(callback, 1000 / 60);\n };\n })();\n\n navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia;\n window.URL = window.URL || window.webkitURL || window.mozURL || window.msURL;\n }\n Math.imul = Math.imul || function(a, b) {\n var ah = (a >>> 16) & 0xffff,\n al = a & 0xffff,\n bh = (b >>> 16) & 0xffff,\n bl = b & 0xffff;\n // the shift by 0 fixes the sign on the high part\n // the final |0 converts the unsigned value into a signed value\n return ((al * bl) + (((ah * bl + al * bh) << 16) >>> 0)|0);\n };\n\nexport default {\n \n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/typedefs.js\n **/","import ImageLoader from './image_loader';\n\nvar InputStream = {};\nInputStream.createVideoStream = function(video) {\n var that = {},\n _config = null,\n _eventNames = ['canrecord', 'ended'],\n _eventHandlers = {},\n _calculatedWidth,\n _calculatedHeight,\n _topRight = {x: 0, y: 0},\n _canvasSize = {x: 0, y: 0};\n\n function initSize() {\n var width = video.videoWidth,\n height = video.videoHeight;\n\n _calculatedWidth = _config.size ? width/height > 1 ? _config.size : Math.floor((width/height) * _config.size) : width;\n _calculatedHeight = _config.size ? width/height > 1 ? Math.floor((height/width) * _config.size) : _config.size : height;\n\n _canvasSize.x = _calculatedWidth;\n _canvasSize.y = _calculatedHeight;\n }\n\n that.getRealWidth = function() {\n return video.videoWidth;\n };\n\n that.getRealHeight = function() {\n return video.videoHeight;\n };\n\n that.getWidth = function() {\n return _calculatedWidth;\n };\n\n that.getHeight = function() {\n return _calculatedHeight;\n };\n\n that.setWidth = function(width) {\n _calculatedWidth = width;\n };\n\n that.setHeight = function(height) {\n _calculatedHeight = height;\n };\n\n that.setInputStream = function(config) {\n _config = config;\n video.src = (typeof config.src !== 'undefined') ? config.src : '';\n };\n\n that.ended = function() {\n return video.ended;\n };\n\n that.getConfig = function() {\n return _config;\n };\n\n that.setAttribute = function(name, value) {\n video.setAttribute(name, value);\n };\n\n that.pause = function() {\n video.pause();\n };\n\n that.play = function() {\n video.play();\n };\n\n that.setCurrentTime = function(time) {\n if (_config.type !== \"LiveStream\")\n video.currentTime = time;\n };\n\n that.addEventListener = function(event, f, bool) {\n if (_eventNames.indexOf(event) !== -1) {\n if (!_eventHandlers[event]) {\n _eventHandlers[event] = [];\n }\n _eventHandlers[event].push(f);\n } else {\n video.addEventListener(event, f, bool);\n }\n };\n\n that.clearEventHandlers = function() {\n _eventNames.forEach(function(eventName) {\n var handlers = _eventHandlers[eventName];\n if (handlers && handlers.length > 0) {\n handlers.forEach(function(handler) {\n video.removeEventListener(eventName, handler);\n });\n }\n });\n };\n\n that.trigger = function(eventName, args) {\n var j,\n handlers = _eventHandlers[eventName];\n\n if (eventName === 'canrecord') {\n initSize();\n }\n if (handlers && handlers.length > 0) {\n for ( j = 0; j < handlers.length; j++) {\n handlers[j].apply(that, args);\n }\n }\n };\n\n that.setTopRight = function(topRight) {\n _topRight.x = topRight.x;\n _topRight.y = topRight.y;\n };\n\n that.getTopRight = function() {\n return _topRight;\n };\n\n that.setCanvasSize = function(size) {\n _canvasSize.x = size.x;\n _canvasSize.y = size.y;\n };\n\n that.getCanvasSize = function() {\n return _canvasSize;\n };\n\n that.getFrame = function() {\n return video;\n };\n\n return that;\n};\n\nInputStream.createLiveStream = function(video) {\n video.setAttribute(\"autoplay\", true);\n var that = InputStream.createVideoStream(video);\n\n that.ended = function() {\n return false;\n };\n\n return that;\n};\n\nInputStream.createImageStream = function() {\n var that = {};\n var _config = null;\n\n var width = 0,\n height = 0,\n frameIdx = 0,\n paused = true,\n loaded = false,\n imgArray = null,\n size = 0,\n offset = 1,\n baseUrl = null,\n ended = false,\n calculatedWidth,\n calculatedHeight,\n _eventNames = ['canrecord', 'ended'],\n _eventHandlers = {},\n _topRight = {x: 0, y: 0},\n _canvasSize = {x: 0, y: 0};\n\n function loadImages() {\n loaded = false;\n ImageLoader.load(baseUrl, function(imgs) {\n imgArray = imgs;\n width = imgs[0].width;\n height = imgs[0].height;\n calculatedWidth = _config.size ? width/height > 1 ? _config.size : Math.floor((width/height) * _config.size) : width;\n calculatedHeight = _config.size ? width/height > 1 ? Math.floor((height/width) * _config.size) : _config.size : height;\n _canvasSize.x = calculatedWidth;\n _canvasSize.y = calculatedHeight;\n loaded = true;\n frameIdx = 0;\n setTimeout(function() {\n publishEvent(\"canrecord\", []);\n }, 0);\n }, offset, size, _config.sequence);\n }\n\n function publishEvent(eventName, args) {\n var j,\n handlers = _eventHandlers[eventName];\n\n if (handlers && handlers.length > 0) {\n for ( j = 0; j < handlers.length; j++) {\n handlers[j].apply(that, args);\n }\n }\n }\n\n\n that.trigger = publishEvent;\n\n that.getWidth = function() {\n return calculatedWidth;\n };\n\n that.getHeight = function() {\n return calculatedHeight;\n };\n\n that.setWidth = function(width) {\n calculatedWidth = width;\n };\n\n that.setHeight = function(height) {\n calculatedHeight = height;\n };\n\n that.getRealWidth = function() {\n return width;\n };\n\n that.getRealHeight = function() {\n return height;\n };\n\n that.setInputStream = function(stream) {\n _config = stream;\n if (stream.sequence === false) {\n baseUrl = stream.src;\n size = 1;\n } else {\n baseUrl = stream.src;\n size = stream.length;\n }\n loadImages();\n };\n\n that.ended = function() {\n return ended;\n };\n\n that.setAttribute = function() {};\n\n that.getConfig = function() {\n return _config;\n };\n\n that.pause = function() {\n paused = true;\n };\n\n that.play = function() {\n paused = false;\n };\n\n that.setCurrentTime = function(time) {\n frameIdx = time;\n };\n\n that.addEventListener = function(event, f) {\n if (_eventNames.indexOf(event) !== -1) {\n if (!_eventHandlers[event]) {\n _eventHandlers[event] = [];\n }\n _eventHandlers[event].push(f);\n }\n };\n\n that.setTopRight = function(topRight) {\n _topRight.x = topRight.x;\n _topRight.y = topRight.y;\n };\n\n that.getTopRight = function() {\n return _topRight;\n };\n\n that.setCanvasSize = function(size) {\n _canvasSize.x = size.x;\n _canvasSize.y = size.y;\n };\n\n that.getCanvasSize = function() {\n return _canvasSize;\n };\n\n that.getFrame = function() {\n var frame;\n\n if (!loaded){\n return null;\n }\n if (!paused) {\n frame = imgArray[frameIdx];\n if (frameIdx < (size - 1)) {\n frameIdx++;\n } else {\n setTimeout(function() {\n ended = true;\n publishEvent(\"ended\", []);\n }, 0);\n }\n }\n return frame;\n };\n\n return that;\n};\n\nexport default InputStream;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/input_stream.js\n **/","var ImageLoader = {};\nImageLoader.load = function(directory, callback, offset, size, sequence) {\n var htmlImagesSrcArray = new Array(size),\n htmlImagesArray = new Array(htmlImagesSrcArray.length),\n i,\n img,\n num;\n\n if (sequence === false) {\n htmlImagesSrcArray[0] = directory;\n } else {\n for ( i = 0; i < htmlImagesSrcArray.length; i++) {\n num = (offset + i);\n htmlImagesSrcArray[i] = directory + \"image-\" + (\"00\" + num).slice(-3) + \".jpg\";\n }\n }\n htmlImagesArray.notLoaded = [];\n htmlImagesArray.addImage = function(img) {\n htmlImagesArray.notLoaded.push(img);\n };\n htmlImagesArray.loaded = function(loadedImg) {\n var notloadedImgs = htmlImagesArray.notLoaded;\n for (var x = 0; x < notloadedImgs.length; x++) {\n if (notloadedImgs[x] == loadedImg) {\n notloadedImgs.splice(x, 1);\n for (var y = 0; y < htmlImagesSrcArray.length; y++) {\n var imgName = htmlImagesSrcArray[y].substr(htmlImagesSrcArray[y].lastIndexOf(\"/\"));\n if (loadedImg.src.lastIndexOf(imgName) != -1) {\n htmlImagesArray[y] = loadedImg;\n break;\n }\n }\n break;\n }\n }\n if (notloadedImgs.length === 0) {\n console.log(\"Images loaded\");\n callback.apply(null, [htmlImagesArray]);\n }\n };\n\n for ( i = 0; i < htmlImagesSrcArray.length; i++) {\n img = new Image();\n htmlImagesArray.addImage(img);\n addOnloadHandler(img, htmlImagesArray);\n img.src = htmlImagesSrcArray[i];\n }\n};\n\nfunction addOnloadHandler(img, htmlImagesArray) {\n img.onload = function() {\n htmlImagesArray.loaded(this);\n };\n}\n\nexport default (ImageLoader);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/image_loader.js\n **/","import SubImage from './subImage';\nimport CVUtils from './cv_utils';\nimport ArrayHelper from './array_helper';\nimport {vec2, mat2} from 'gl-matrix';\n\n/**\n * Represents a basic image combining the data and size.\n * In addition, some methods for manipulation are contained.\n * @param size {x,y} The size of the image in pixel\n * @param data {Array} If given, a flat array containing the pixel data\n * @param ArrayType {Type} If given, the desired DataType of the Array (may be typed/non-typed)\n * @param initialize {Boolean} Indicating if the array should be initialized on creation.\n * @returns {ImageWrapper}\n */\nfunction ImageWrapper(size, data, ArrayType, initialize) {\n if (!data) {\n if (ArrayType) {\n this.data = new ArrayType(size.x * size.y);\n if (ArrayType === Array && initialize) {\n ArrayHelper.init(this.data, 0);\n }\n } else {\n this.data = new Uint8Array(size.x * size.y);\n if (Uint8Array === Array && initialize) {\n ArrayHelper.init(this.data, 0);\n }\n }\n\n } else {\n this.data = data;\n }\n this.size = size;\n}\n\n/**\n * tests if a position is within the image with a given offset\n * @param imgRef {x, y} The location to test\n * @param border Number the padding value in pixel\n * @returns {Boolean} true if location inside the image's border, false otherwise\n * @see cvd/image.h\n */\nImageWrapper.prototype.inImageWithBorder = function(imgRef, border) {\n return (imgRef.x >= border) && (imgRef.y >= border) && (imgRef.x < (this.size.x - border)) && (imgRef.y < (this.size.y - border));\n};\n\n/**\n * Transforms an image according to the given affine-transformation matrix.\n * @param inImg ImageWrapper a image containing the information to be extracted.\n * @param outImg ImageWrapper the image to be filled. The whole image out image is filled by the in image.\n * @param M mat2 the matrix used to map point in the out matrix to those in the in matrix\n * @param inOrig vec2 origin in the in image\n * @param outOrig vec2 origin in the out image\n * @returns Number the number of pixels not in the in image\n * @see cvd/vision.h\n */\nImageWrapper.transform = function(inImg, outImg, M, inOrig, outOrig) {\n var w = outImg.size.x, h = outImg.size.y, iw = inImg.size.x, ih = inImg.size.y;\n var across = vec2.clone([M[0], M[2]]);\n var down = vec2.clone([M[1], M[3]]);\n var defaultValue = 0;\n\n var p0 = vec2.subtract(inOrig, mat2.xVec2(M, outOrig, vec2.clone()), vec2.clone());\n\n var min_x = p0[0], min_y = p0[1];\n var max_x = min_x, max_y = min_y;\n var p, i, j;\n\n var sampleFunc = ImageWrapper.sample;\n\n if (across[0] < 0)\n min_x += w * across[0];\n else\n max_x += w * across[0];\n\n if (down[0] < 0)\n min_x += h * down[0];\n else\n max_x += h * down[0];\n\n if (across[1] < 0)\n min_y += w * across[1];\n else\n max_y += w * across[1];\n\n if (down[1] < 0)\n min_y += h * down[1];\n else\n max_y += h * down[1];\n\n var carrigeReturn = vec2.subtract(down, vec2.scale(across, w, vec2.clone()), vec2.clone());\n\n if (min_x >= 0 && min_y >= 0 && max_x < iw - 1 && max_y < ih - 1) {\n p = p0;\n for ( i = 0; i < h; ++i, vec2.add(p, carrigeReturn))\n for ( j = 0; j < w; ++j, vec2.add(p, across))\n outImg.set(j, i, sampleFunc(inImg, p[0], p[1]));\n return 0;\n } else {\n var x_bound = iw - 1;\n var y_bound = ih - 1;\n var count = 0;\n p = p0;\n for ( i = 0; i < h; ++i, vec2.add(p, carrigeReturn)) {\n for ( j = 0; j < w; ++j, vec2.add(p, across)) {\n if (0 <= p[0] && 0 <= p[1] && p[0] < x_bound && p[1] < y_bound) {\n outImg.set(j, i, sampleFunc(inImg, p[0], p[1]));\n } else {\n outImg.set(j, i, defaultValue); ++count;\n }\n }\n }\n return count;\n }\n};\n\n/**\n * Performs bilinear sampling\n * @param inImg Image to extract sample from\n * @param x the x-coordinate\n * @param y the y-coordinate\n * @returns the sampled value\n * @see cvd/vision.h\n */\nImageWrapper.sample = function(inImg, x, y) {\n var lx = Math.floor(x);\n var ly = Math.floor(y);\n var w = inImg.size.x;\n var base = ly * inImg.size.x + lx;\n var a = inImg.data[base + 0];\n var b = inImg.data[base + 1];\n var c = inImg.data[base + w];\n var d = inImg.data[base + w + 1];\n var e = a - b;\n x -= lx;\n y -= ly;\n\n var result = Math.floor(x * (y * (e - c + d) - e) + y * (c - a) + a);\n return result;\n};\n\n/**\n * Initializes a given array. Sets each element to zero.\n * @param array {Array} The array to initialize\n */\nImageWrapper.clearArray = function(array) {\n var l = array.length;\n while (l--) {\n array[l] = 0;\n }\n};\n\n/**\n * Creates a {SubImage} from the current image ({this}).\n * @param from {ImageRef} The position where to start the {SubImage} from. (top-left corner)\n * @param size {ImageRef} The size of the resulting image\n * @returns {SubImage} A shared part of the original image\n */\nImageWrapper.prototype.subImage = function(from, size) {\n return new SubImage(from, size, this);\n};\n\n/**\n * Creates an {ImageWrapper) and copies the needed underlying image-data area\n * @param imageWrapper {ImageWrapper} The target {ImageWrapper} where the data should be copied\n * @param from {ImageRef} The location where to copy from (top-left location)\n */\nImageWrapper.prototype.subImageAsCopy = function(imageWrapper, from) {\n var sizeY = imageWrapper.size.y, sizeX = imageWrapper.size.x;\n var x, y;\n for ( x = 0; x < sizeX; x++) {\n for ( y = 0; y < sizeY; y++) {\n imageWrapper.data[y * sizeX + x] = this.data[(from.y + y) * this.size.x + from.x + x];\n }\n }\n};\n\nImageWrapper.prototype.copyTo = function(imageWrapper) {\n var length = this.data.length, srcData = this.data, dstData = imageWrapper.data;\n\n while (length--) {\n dstData[length] = srcData[length];\n }\n};\n\n/**\n * Retrieves a given pixel position from the image\n * @param x {Number} The x-position\n * @param y {Number} The y-position\n * @returns {Number} The grayscale value at the pixel-position\n */\nImageWrapper.prototype.get = function(x, y) {\n return this.data[y * this.size.x + x];\n};\n\n/**\n * Retrieves a given pixel position from the image\n * @param x {Number} The x-position\n * @param y {Number} The y-position\n * @returns {Number} The grayscale value at the pixel-position\n */\nImageWrapper.prototype.getSafe = function(x, y) {\n var i;\n\n if (!this.indexMapping) {\n this.indexMapping = {\n x : [],\n y : []\n };\n for (i = 0; i < this.size.x; i++) {\n this.indexMapping.x[i] = i;\n this.indexMapping.x[i + this.size.x] = i;\n }\n for (i = 0; i < this.size.y; i++) {\n this.indexMapping.y[i] = i;\n this.indexMapping.y[i + this.size.y] = i;\n }\n }\n return this.data[(this.indexMapping.y[y + this.size.y]) * this.size.x + this.indexMapping.x[x + this.size.x]];\n};\n\n/**\n * Sets a given pixel position in the image\n * @param x {Number} The x-position\n * @param y {Number} The y-position\n * @param value {Number} The grayscale value to set\n * @returns {ImageWrapper} The Image itself (for possible chaining)\n */\nImageWrapper.prototype.set = function(x, y, value) {\n this.data[y * this.size.x + x] = value;\n return this;\n};\n\n/**\n * Sets the border of the image (1 pixel) to zero\n */\nImageWrapper.prototype.zeroBorder = function() {\n var i, width = this.size.x, height = this.size.y, data = this.data;\n for ( i = 0; i < width; i++) {\n data[i] = data[(height - 1) * width + i] = 0;\n }\n for ( i = 1; i < height - 1; i++) {\n data[i * width] = data[i * width + (width - 1)] = 0;\n }\n};\n\n/**\n * Inverts a binary image in place\n */\nImageWrapper.prototype.invert = function() {\n var data = this.data, length = data.length;\n\n while (length--) {\n data[length] = data[length] ? 0 : 1;\n }\n\n};\n\nImageWrapper.prototype.convolve = function(kernel) {\n var x, y, kx, ky, kSize = (kernel.length / 2) | 0, accu = 0;\n for ( y = 0; y < this.size.y; y++) {\n for ( x = 0; x < this.size.x; x++) {\n accu = 0;\n for ( ky = -kSize; ky <= kSize; ky++) {\n for ( kx = -kSize; kx <= kSize; kx++) {\n accu += kernel[ky+kSize][kx + kSize] * this.getSafe(x + kx, y + ky);\n }\n }\n this.data[y * this.size.x + x] = accu;\n }\n }\n};\n\nImageWrapper.prototype.moments = function(labelcount) {\n var data = this.data,\n x,\n y,\n height = this.size.y,\n width = this.size.x,\n val,\n ysq,\n labelsum = [],\n i,\n label,\n mu11,\n mu02,\n mu20,\n x_,\n y_,\n tmp,\n result = [],\n PI = Math.PI,\n PI_4 = PI / 4;\n\n if (labelcount <= 0) {\n return result;\n }\n\n for ( i = 0; i < labelcount; i++) {\n labelsum[i] = {\n m00 : 0,\n m01 : 0,\n m10 : 0,\n m11 : 0,\n m02 : 0,\n m20 : 0,\n theta : 0,\n rad : 0\n };\n }\n\n for ( y = 0; y < height; y++) {\n ysq = y * y;\n for ( x = 0; x < width; x++) {\n val = data[y * width + x];\n if (val > 0) {\n label = labelsum[val - 1];\n label.m00 += 1;\n label.m01 += y;\n label.m10 += x;\n label.m11 += x * y;\n label.m02 += ysq;\n label.m20 += x * x;\n }\n }\n }\n\n for ( i = 0; i < labelcount; i++) {\n label = labelsum[i];\n if (!isNaN(label.m00) && label.m00 !== 0) {\n x_ = label.m10 / label.m00;\n y_ = label.m01 / label.m00;\n mu11 = label.m11 / label.m00 - x_ * y_;\n mu02 = label.m02 / label.m00 - y_ * y_;\n mu20 = label.m20 / label.m00 - x_ * x_;\n tmp = (mu02 - mu20) / (2 * mu11);\n tmp = 0.5 * Math.atan(tmp) + (mu11 >= 0 ? PI_4 : -PI_4 ) + PI;\n label.theta = (tmp * 180 / PI + 90) % 180 - 90;\n if (label.theta < 0) {\n label.theta += 180;\n }\n label.rad = tmp > PI ? tmp - PI : tmp;\n label.vec = vec2.clone([Math.cos(tmp), Math.sin(tmp)]);\n result.push(label);\n }\n }\n\n return result;\n};\n\n/**\n * Displays the {ImageWrapper} in a given canvas\n * @param canvas {Canvas} The canvas element to write to\n * @param scale {Number} Scale which is applied to each pixel-value\n */\nImageWrapper.prototype.show = function(canvas, scale) {\n var ctx,\n frame,\n data,\n current,\n pixel,\n x,\n y;\n\n if (!scale) {\n scale = 1.0;\n }\n ctx = canvas.getContext('2d');\n canvas.width = this.size.x;\n canvas.height = this.size.y;\n frame = ctx.getImageData(0, 0, canvas.width, canvas.height);\n data = frame.data;\n current = 0;\n for (y = 0; y < this.size.y; y++) {\n for (x = 0; x < this.size.x; x++) {\n pixel = y * this.size.x + x;\n current = this.get(x, y) * scale;\n data[pixel * 4 + 0] = current;\n data[pixel * 4 + 1] = current;\n data[pixel * 4 + 2] = current;\n data[pixel * 4 + 3] = 255;\n }\n }\n //frame.data = data;\n ctx.putImageData(frame, 0, 0);\n};\n\n/**\n * Displays the {SubImage} in a given canvas\n * @param canvas {Canvas} The canvas element to write to\n * @param scale {Number} Scale which is applied to each pixel-value\n */\nImageWrapper.prototype.overlay = function(canvas, scale, from) {\n if (!scale || scale < 0 || scale > 360) {\n scale = 360;\n }\n var hsv = [0, 1, 1];\n var rgb = [0, 0, 0];\n var whiteRgb = [255, 255, 255];\n var blackRgb = [0, 0, 0];\n var result = [];\n var ctx = canvas.getContext('2d');\n var frame = ctx.getImageData(from.x, from.y, this.size.x, this.size.y);\n var data = frame.data;\n var length = this.data.length;\n while (length--) {\n hsv[0] = this.data[length] * scale;\n result = hsv[0] <= 0 ? whiteRgb : hsv[0] >= 360 ? blackRgb : CVUtils.hsv2rgb(hsv, rgb);\n data[length * 4 + 0] = result[0];\n data[length * 4 + 1] = result[1];\n data[length * 4 + 2] = result[2];\n data[length * 4 + 3] = 255;\n }\n ctx.putImageData(frame, from.x, from.y);\n};\n\nexport default ImageWrapper;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/image_wrapper.js\n **/","/**\n * Construct representing a part of another {ImageWrapper}. Shares data\n * between the parent and the child.\n * @param from {ImageRef} The position where to start the {SubImage} from. (top-left corner)\n * @param size {ImageRef} The size of the resulting image\n * @param I {ImageWrapper} The {ImageWrapper} to share from\n * @returns {SubImage} A shared part of the original image\n */\nfunction SubImage(from, size, I) {\n if (!I) {\n I = {\n data : null,\n size : size\n };\n }\n this.data = I.data;\n this.originalSize = I.size;\n this.I = I;\n\n this.from = from;\n this.size = size;\n}\n\n/**\n * Displays the {SubImage} in a given canvas\n * @param canvas {Canvas} The canvas element to write to\n * @param scale {Number} Scale which is applied to each pixel-value\n */\nSubImage.prototype.show = function(canvas, scale) {\n var ctx,\n frame,\n data,\n current,\n y,\n x,\n pixel;\n\n if (!scale) {\n scale = 1.0;\n }\n ctx = canvas.getContext('2d');\n canvas.width = this.size.x;\n canvas.height = this.size.y;\n frame = ctx.getImageData(0, 0, canvas.width, canvas.height);\n data = frame.data;\n current = 0;\n for (y = 0; y < this.size.y; y++) {\n for (x = 0; x < this.size.x; x++) {\n pixel = y * this.size.x + x;\n current = this.get(x, y) * scale;\n data[pixel * 4 + 0] = current;\n data[pixel * 4 + 1] = current;\n data[pixel * 4 + 2] = current;\n data[pixel * 4 + 3] = 255;\n }\n }\n frame.data = data;\n ctx.putImageData(frame, 0, 0);\n};\n\n/**\n * Retrieves a given pixel position from the {SubImage}\n * @param x {Number} The x-position\n * @param y {Number} The y-position\n * @returns {Number} The grayscale value at the pixel-position\n */\nSubImage.prototype.get = function(x, y) {\n return this.data[(this.from.y + y) * this.originalSize.x + this.from.x + x];\n};\n\n/**\n * Updates the underlying data from a given {ImageWrapper}\n * @param image {ImageWrapper} The updated image\n */\nSubImage.prototype.updateData = function(image) {\n this.originalSize = image.size;\n this.data = image.data;\n};\n\n/**\n * Updates the position of the shared area\n * @param from {x,y} The new location\n * @returns {SubImage} returns {this} for possible chaining\n */\nSubImage.prototype.updateFrom = function(from) {\n this.from = from;\n return this;\n};\n\nexport default (SubImage);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/subImage.js\n **/","import Cluster2 from './cluster';\nimport ArrayHelper from './array_helper';\nimport {vec2, vec3} from 'gl-matrix';\n\nvar CVUtils = {};\n\n/**\n * @param x x-coordinate\n * @param y y-coordinate\n * @return ImageReference {x,y} Coordinate\n */\nCVUtils.imageRef = function(x, y) {\n var that = {\n x : x,\n y : y,\n toVec2 : function() {\n return vec2.clone([this.x, this.y]);\n },\n toVec3 : function() {\n return vec3.clone([this.x, this.y, 1]);\n },\n round : function() {\n this.x = this.x > 0.0 ? Math.floor(this.x + 0.5) : Math.floor(this.x - 0.5);\n this.y = this.y > 0.0 ? Math.floor(this.y + 0.5) : Math.floor(this.y - 0.5);\n return this;\n }\n };\n return that;\n};\n\n/**\n * Computes an integral image of a given grayscale image.\n * @param imageDataContainer {ImageDataContainer} the image to be integrated\n */\nCVUtils.computeIntegralImage2 = function(imageWrapper, integralWrapper) {\n var imageData = imageWrapper.data;\n var width = imageWrapper.size.x;\n var height = imageWrapper.size.y;\n var integralImageData = integralWrapper.data;\n var sum = 0, posA = 0, posB = 0, posC = 0, posD = 0, x, y;\n\n // sum up first column\n posB = width;\n sum = 0;\n for ( y = 1; y < height; y++) {\n sum += imageData[posA];\n integralImageData[posB] += sum;\n posA += width;\n posB += width;\n }\n\n posA = 0;\n posB = 1;\n sum = 0;\n for ( x = 1; x < width; x++) {\n sum += imageData[posA];\n integralImageData[posB] += sum;\n posA++;\n posB++;\n }\n\n for ( y = 1; y < height; y++) {\n posA = y * width + 1;\n posB = (y - 1) * width + 1;\n posC = y * width;\n posD = (y - 1) * width;\n for ( x = 1; x < width; x++) {\n integralImageData[posA] += imageData[posA] + integralImageData[posB] + integralImageData[posC] - integralImageData[posD];\n posA++;\n posB++;\n posC++;\n posD++;\n }\n }\n};\n\nCVUtils.computeIntegralImage = function(imageWrapper, integralWrapper) {\n var imageData = imageWrapper.data;\n var width = imageWrapper.size.x;\n var height = imageWrapper.size.y;\n var integralImageData = integralWrapper.data;\n var sum = 0;\n\n // sum up first row\n for (var i = 0; i < width; i++) {\n sum += imageData[i];\n integralImageData[i] = sum;\n }\n\n for (var v = 1; v < height; v++) {\n sum = 0;\n for (var u = 0; u < width; u++) {\n sum += imageData[v * width + u];\n integralImageData[((v) * width) + u] = sum + integralImageData[(v - 1) * width + u];\n }\n }\n};\n\nCVUtils.thresholdImage = function(imageWrapper, threshold, targetWrapper) {\n if (!targetWrapper) {\n targetWrapper = imageWrapper;\n }\n var imageData = imageWrapper.data, length = imageData.length, targetData = targetWrapper.data;\n\n while (length--) {\n targetData[length] = imageData[length] < threshold ? 1 : 0;\n }\n};\n\nCVUtils.computeHistogram = function(imageWrapper, bitsPerPixel) {\n if (!bitsPerPixel) {\n bitsPerPixel = 8;\n }\n var imageData = imageWrapper.data,\n length = imageData.length,\n bitShift = 8 - bitsPerPixel,\n bucketCnt = 1 << bitsPerPixel,\n hist = new Int32Array(bucketCnt);\n\n while (length--) {\n hist[imageData[length] >> bitShift]++;\n }\n return hist;\n};\n\nCVUtils.sharpenLine = function(line) {\n var i,\n length = line.length,\n left = line[0],\n center = line[1],\n right;\n\n for (i = 1; i < length - 1; i++) {\n right = line[i + 1];\n // -1 4 -1 kernel\n line[i-1] = (((center * 2) - left - right)) & 255;\n left = center;\n center = right;\n }\n return line;\n};\n\nCVUtils.determineOtsuThreshold = function(imageWrapper, bitsPerPixel) {\n if (!bitsPerPixel) {\n bitsPerPixel = 8;\n }\n var hist,\n threshold,\n bitShift = 8 - bitsPerPixel;\n\n function px(init, end) {\n var sum = 0, i;\n for ( i = init; i <= end; i++) {\n sum += hist[i];\n }\n return sum;\n }\n\n function mx(init, end) {\n var i, sum = 0;\n\n for ( i = init; i <= end; i++) {\n sum += i * hist[i];\n }\n\n return sum;\n }\n\n function determineThreshold() {\n var vet = [0], p1, p2, p12, k, m1, m2, m12,\n max = (1 << bitsPerPixel) - 1;\n\n hist = CVUtils.computeHistogram(imageWrapper, bitsPerPixel);\n for ( k = 1; k < max; k++) {\n p1 = px(0, k);\n p2 = px(k + 1, max);\n p12 = p1 * p2;\n if (p12 === 0) {\n p12 = 1;\n }\n m1 = mx(0, k) * p2;\n m2 = mx(k + 1, max) * p1;\n m12 = m1 - m2;\n vet[k] = m12 * m12 / p12;\n }\n return ArrayHelper.maxIndex(vet);\n }\n\n threshold = determineThreshold();\n return threshold << bitShift;\n};\n\nCVUtils.otsuThreshold = function(imageWrapper, targetWrapper) {\n var threshold = CVUtils.determineOtsuThreshold(imageWrapper);\n\n CVUtils.thresholdImage(imageWrapper, threshold, targetWrapper);\n return threshold;\n};\n\n// local thresholding\nCVUtils.computeBinaryImage = function(imageWrapper, integralWrapper, targetWrapper) {\n CVUtils.computeIntegralImage(imageWrapper, integralWrapper);\n\n if (!targetWrapper) {\n targetWrapper = imageWrapper;\n }\n var imageData = imageWrapper.data;\n var targetData = targetWrapper.data;\n var width = imageWrapper.size.x;\n var height = imageWrapper.size.y;\n var integralImageData = integralWrapper.data;\n var sum = 0, v, u, kernel = 3, A, B, C, D, avg, size = (kernel * 2 + 1) * (kernel * 2 + 1);\n\n // clear out top & bottom-border\n for ( v = 0; v <= kernel; v++) {\n for ( u = 0; u < width; u++) {\n targetData[((v) * width) + u] = 0;\n targetData[(((height - 1) - v) * width) + u] = 0;\n }\n }\n\n // clear out left & right border\n for ( v = kernel; v < height - kernel; v++) {\n for ( u = 0; u <= kernel; u++) {\n targetData[((v) * width) + u] = 0;\n targetData[((v) * width) + (width - 1 - u)] = 0;\n }\n }\n\n for ( v = kernel + 1; v < height - kernel - 1; v++) {\n for ( u = kernel + 1; u < width - kernel; u++) {\n A = integralImageData[(v - kernel - 1) * width + (u - kernel - 1)];\n B = integralImageData[(v - kernel - 1) * width + (u + kernel)];\n C = integralImageData[(v + kernel) * width + (u - kernel - 1)];\n D = integralImageData[(v + kernel) * width + (u + kernel)];\n sum = D - C - B + A;\n avg = sum / (size);\n targetData[v * width + u] = imageData[v * width + u] > (avg + 5) ? 0 : 1;\n }\n }\n};\n\nCVUtils.cluster = function(points, threshold, property) {\n var i, k, cluster, point, clusters = [];\n\n if (!property) {\n property = \"rad\";\n }\n\n function addToCluster(point) {\n var found = false;\n for ( k = 0; k < clusters.length; k++) {\n cluster = clusters[k];\n if (cluster.fits(point)) {\n cluster.add(point);\n found = true;\n }\n }\n return found;\n }\n\n // iterate over each cloud\n for ( i = 0; i < points.length; i++) {\n point = Cluster2.createPoint(points[i], i, property);\n if (!addToCluster(point)) {\n clusters.push(Cluster2.create(point, threshold));\n }\n }\n\n return clusters;\n\n};\n\nCVUtils.Tracer = {\n trace : function(points, vec) {\n var iteration, maxIterations = 10, top = [], result = [], centerPos = 0, currentPos = 0;\n\n function trace(idx, forward) {\n var from, to, toIdx, predictedPos, thresholdX = 1, thresholdY = Math.abs(vec[1] / 10), found = false;\n\n function match(pos, predicted) {\n if (pos.x > (predicted.x - thresholdX) && pos.x < (predicted.x + thresholdX) && pos.y > (predicted.y - thresholdY) && pos.y < (predicted.y + thresholdY)) {\n return true;\n } else {\n return false;\n }\n }\n\n // check if the next index is within the vec specifications\n // if not, check as long as the threshold is met\n\n from = points[idx];\n if (forward) {\n predictedPos = {\n x : from.x + vec[0],\n y : from.y + vec[1]\n };\n } else {\n predictedPos = {\n x : from.x - vec[0],\n y : from.y - vec[1]\n };\n }\n\n toIdx = forward ? idx + 1 : idx - 1;\n to = points[toIdx];\n while (to && ( found = match(to, predictedPos)) !== true && (Math.abs(to.y - from.y) < vec[1])) {\n toIdx = forward ? toIdx + 1 : toIdx - 1;\n to = points[toIdx];\n }\n\n return found ? toIdx : null;\n }\n\n for ( iteration = 0; iteration < maxIterations; iteration++) {\n // randomly select point to start with\n centerPos = Math.floor(Math.random() * points.length);\n\n // trace forward\n top = [];\n currentPos = centerPos;\n top.push(points[currentPos]);\n while (( currentPos = trace(currentPos, true)) !== null) {\n top.push(points[currentPos]);\n }\n if (centerPos > 0) {\n currentPos = centerPos;\n while (( currentPos = trace(currentPos, false)) !== null) {\n top.push(points[currentPos]);\n }\n }\n\n if (top.length > result.length) {\n result = top;\n }\n }\n\n return result;\n\n }\n};\n\nCVUtils.DILATE = 1;\nCVUtils.ERODE = 2;\n\nCVUtils.dilate = function(inImageWrapper, outImageWrapper) {\n var v, u, inImageData = inImageWrapper.data, outImageData = outImageWrapper.data, height = inImageWrapper.size.y, width = inImageWrapper.size.x, sum, yStart1, yStart2, xStart1, xStart2;\n\n for ( v = 1; v < height - 1; v++) {\n for ( u = 1; u < width - 1; u++) {\n yStart1 = v - 1;\n yStart2 = v + 1;\n xStart1 = u - 1;\n xStart2 = u + 1;\n sum = inImageData[yStart1 * width + xStart1]/* + inImageData[yStart1*width+u] */ + inImageData[yStart1 * width + xStart2] +\n /* inImageData[v*width+xStart1] + */\n inImageData[v * width + u] + /* inImageData[v*width+xStart2] +*/\n inImageData[yStart2 * width + xStart1]/* + inImageData[yStart2*width+u]*/ + inImageData[yStart2 * width + xStart2];\n outImageData[v * width + u] = sum > 0 ? 1 : 0;\n }\n }\n};\n\nCVUtils.erode = function(inImageWrapper, outImageWrapper) {\n var v, u, inImageData = inImageWrapper.data, outImageData = outImageWrapper.data, height = inImageWrapper.size.y, width = inImageWrapper.size.x, sum, yStart1, yStart2, xStart1, xStart2;\n\n for ( v = 1; v < height - 1; v++) {\n for ( u = 1; u < width - 1; u++) {\n yStart1 = v - 1;\n yStart2 = v + 1;\n xStart1 = u - 1;\n xStart2 = u + 1;\n sum = inImageData[yStart1 * width + xStart1]/* + inImageData[yStart1*width+u] */ + inImageData[yStart1 * width + xStart2] +\n /* inImageData[v*width+xStart1] + */\n inImageData[v * width + u] + /* inImageData[v*width+xStart2] +*/\n inImageData[yStart2 * width + xStart1]/* + inImageData[yStart2*width+u]*/ + inImageData[yStart2 * width + xStart2];\n outImageData[v * width + u] = sum === 5 ? 1 : 0;\n }\n }\n};\n\nCVUtils.subtract = function(aImageWrapper, bImageWrapper, resultImageWrapper) {\n if (!resultImageWrapper) {\n resultImageWrapper = aImageWrapper;\n }\n var length = aImageWrapper.data.length, aImageData = aImageWrapper.data, bImageData = bImageWrapper.data, cImageData = resultImageWrapper.data;\n\n while (length--) {\n cImageData[length] = aImageData[length] - bImageData[length];\n }\n};\n\nCVUtils.bitwiseOr = function(aImageWrapper, bImageWrapper, resultImageWrapper) {\n if (!resultImageWrapper) {\n resultImageWrapper = aImageWrapper;\n }\n var length = aImageWrapper.data.length, aImageData = aImageWrapper.data, bImageData = bImageWrapper.data, cImageData = resultImageWrapper.data;\n\n while (length--) {\n cImageData[length] = aImageData[length] || bImageData[length];\n }\n};\n\nCVUtils.countNonZero = function(imageWrapper) {\n var length = imageWrapper.data.length, data = imageWrapper.data, sum = 0;\n\n while (length--) {\n sum += data[length];\n }\n return sum;\n};\n\nCVUtils.topGeneric = function(list, top, scoreFunc) {\n var i, minIdx = 0, min = 0, queue = [], score, hit, pos;\n\n for ( i = 0; i < top; i++) {\n queue[i] = {\n score : 0,\n item : null\n };\n }\n\n for ( i = 0; i < list.length; i++) {\n score = scoreFunc.apply(this, [list[i]]);\n if (score > min) {\n hit = queue[minIdx];\n hit.score = score;\n hit.item = list[i];\n min = Number.MAX_VALUE;\n for ( pos = 0; pos < top; pos++) {\n if (queue[pos].score < min) {\n min = queue[pos].score;\n minIdx = pos;\n }\n }\n }\n }\n\n return queue;\n};\n\nCVUtils.grayArrayFromImage = function(htmlImage, offsetX, ctx, array) {\n ctx.drawImage(htmlImage, offsetX, 0, htmlImage.width, htmlImage.height);\n var ctxData = ctx.getImageData(offsetX, 0, htmlImage.width, htmlImage.height).data;\n CVUtils.computeGray(ctxData, array);\n};\n\nCVUtils.grayArrayFromContext = function(ctx, size, offset, array) {\n var ctxData = ctx.getImageData(offset.x, offset.y, size.x, size.y).data;\n CVUtils.computeGray(ctxData, array);\n};\n\nCVUtils.grayAndHalfSampleFromCanvasData = function(canvasData, size, outArray) {\n var topRowIdx = 0;\n var bottomRowIdx = size.x;\n var endIdx = Math.floor(canvasData.length / 4);\n var outWidth = size.x / 2;\n var outImgIdx = 0;\n var inWidth = size.x;\n var i;\n\n while (bottomRowIdx < endIdx) {\n for ( i = 0; i < outWidth; i++) {\n outArray[outImgIdx] = Math.floor(((0.299 * canvasData[topRowIdx * 4 + 0] + 0.587 * canvasData[topRowIdx * 4 + 1] + 0.114 * canvasData[topRowIdx * 4 + 2]) + (0.299 * canvasData[(topRowIdx + 1) * 4 + 0] + 0.587 * canvasData[(topRowIdx + 1) * 4 + 1] + 0.114 * canvasData[(topRowIdx + 1) * 4 + 2]) + (0.299 * canvasData[(bottomRowIdx) * 4 + 0] + 0.587 * canvasData[(bottomRowIdx) * 4 + 1] + 0.114 * canvasData[(bottomRowIdx) * 4 + 2]) + (0.299 * canvasData[(bottomRowIdx + 1) * 4 + 0] + 0.587 * canvasData[(bottomRowIdx + 1) * 4 + 1] + 0.114 * canvasData[(bottomRowIdx + 1) * 4 + 2])) / 4);\n outImgIdx++;\n topRowIdx = topRowIdx + 2;\n bottomRowIdx = bottomRowIdx + 2;\n }\n topRowIdx = topRowIdx + inWidth;\n bottomRowIdx = bottomRowIdx + inWidth;\n }\n\n};\n\nCVUtils.computeGray = function(imageData, outArray, config) {\n var l = (imageData.length / 4) | 0,\n i,\n singleChannel = config && config.singleChannel === true;\n\n if (singleChannel) {\n for (i = 0; i < l; i++) {\n outArray[i] = imageData[i * 4 + 0];\n }\n } else {\n for (i = 0; i < l; i++) {\n outArray[i] = Math.floor(0.299 * imageData[i * 4 + 0] + 0.587 * imageData[i * 4 + 1] + 0.114 * imageData[i * 4 + 2]);\n }\n }\n};\n\nCVUtils.loadImageArray = function(src, callback, canvas) {\n if (!canvas)\n canvas = document.createElement('canvas');\n var img = new Image();\n img.callback = callback;\n img.onload = function() {\n canvas.width = this.width;\n canvas.height = this.height;\n var ctx = canvas.getContext('2d');\n ctx.drawImage(this, 0, 0);\n var array = new Uint8Array(this.width * this.height);\n ctx.drawImage(this, 0, 0);\n var data = ctx.getImageData(0, 0, this.width, this.height).data;\n CVUtils.computeGray(data, array);\n this.callback(array, {\n x : this.width,\n y : this.height\n }, this);\n };\n img.src = src;\n};\n\n/**\n * @param inImg {ImageWrapper} input image to be sampled\n * @param outImg {ImageWrapper} to be stored in\n */\nCVUtils.halfSample = function(inImgWrapper, outImgWrapper) {\n var inImg = inImgWrapper.data;\n var inWidth = inImgWrapper.size.x;\n var outImg = outImgWrapper.data;\n var topRowIdx = 0;\n var bottomRowIdx = inWidth;\n var endIdx = inImg.length;\n var outWidth = inWidth / 2;\n var outImgIdx = 0;\n while (bottomRowIdx < endIdx) {\n for (var i = 0; i < outWidth; i++) {\n outImg[outImgIdx] = Math.floor((inImg[topRowIdx] + inImg[topRowIdx + 1] + inImg[bottomRowIdx] + inImg[bottomRowIdx + 1]) / 4);\n outImgIdx++;\n topRowIdx = topRowIdx + 2;\n bottomRowIdx = bottomRowIdx + 2;\n }\n topRowIdx = topRowIdx + inWidth;\n bottomRowIdx = bottomRowIdx + inWidth;\n }\n};\n\nCVUtils.hsv2rgb = function(hsv, rgb) {\n var h = hsv[0], s = hsv[1], v = hsv[2], c = v * s, x = c * (1 - Math.abs((h / 60) % 2 - 1)), m = v - c, r = 0, g = 0, b = 0;\n rgb = rgb || [0, 0, 0];\n\n if (h < 60) {\n r = c;\n g = x;\n } else if (h < 120) {\n r = x;\n g = c;\n } else if (h < 180) {\n g = c;\n b = x;\n } else if (h < 240) {\n g = x;\n b = c;\n } else if (h < 300) {\n r = x;\n b = c;\n } else if (h < 360) {\n r = c;\n b = x;\n }\n rgb[0] = ((r + m) * 255) | 0;\n rgb[1] = ((g + m) * 255) | 0;\n rgb[2] = ((b + m) * 255) | 0;\n return rgb;\n};\n\nCVUtils._computeDivisors = function(n) {\n var largeDivisors = [],\n divisors = [],\n i;\n\n for (i = 1; i < Math.sqrt(n) + 1; i++) {\n if (n % i === 0) {\n divisors.push(i);\n if (i !== n/i) {\n largeDivisors.unshift(Math.floor(n/i));\n }\n }\n }\n return divisors.concat(largeDivisors);\n};\n\nCVUtils._computeIntersection = function(arr1, arr2) {\n var i = 0,\n j = 0,\n result = [];\n\n while (i < arr1.length && j < arr2.length) {\n if (arr1[i] === arr2[j]) {\n result.push(arr1[i]);\n i++;\n j++;\n } else if (arr1[i] > arr2[j]) {\n j++;\n } else {\n i++;\n }\n }\n return result;\n};\n\nCVUtils.calculatePatchSize = function(patchSize, imgSize) {\n var divisorsX = this._computeDivisors(imgSize.x),\n divisorsY = this._computeDivisors(imgSize.y),\n wideSide = Math.max(imgSize.x, imgSize.y),\n common = this._computeIntersection(divisorsX, divisorsY),\n nrOfPatchesList = [8, 10, 15, 20, 32, 60, 80],\n nrOfPatchesMap = {\n \"x-small\": 5,\n \"small\": 4,\n \"medium\": 3,\n \"large\": 2,\n \"x-large\": 1\n },\n nrOfPatchesIdx = nrOfPatchesMap[patchSize] || nrOfPatchesMap.medium,\n nrOfPatches = nrOfPatchesList[nrOfPatchesIdx],\n desiredPatchSize = Math.floor(wideSide/nrOfPatches),\n optimalPatchSize;\n\n function findPatchSizeForDivisors(divisors) {\n var i = 0,\n found = divisors[Math.floor(divisors.length/2)];\n\n while(i < (divisors.length - 1) && divisors[i] < desiredPatchSize) {\n i++;\n }\n if (i > 0) {\n if (Math.abs(divisors[i] - desiredPatchSize) > Math.abs(divisors[i-1] - desiredPatchSize)) {\n found = divisors[i-1];\n } else {\n found = divisors[i];\n }\n }\n if (desiredPatchSize / found < nrOfPatchesList[nrOfPatchesIdx+1] / nrOfPatchesList[nrOfPatchesIdx] &&\n desiredPatchSize / found > nrOfPatchesList[nrOfPatchesIdx-1]/nrOfPatchesList[nrOfPatchesIdx] ) {\n return {x: found, y: found};\n }\n return null;\n }\n\n optimalPatchSize = findPatchSizeForDivisors(common);\n if (!optimalPatchSize) {\n optimalPatchSize = findPatchSizeForDivisors(this._computeDivisors(wideSide));\n if (!optimalPatchSize) {\n optimalPatchSize = findPatchSizeForDivisors((this._computeDivisors(desiredPatchSize * nrOfPatches)));\n }\n }\n return optimalPatchSize;\n};\n\nCVUtils._parseCSSDimensionValues = function(value) {\n var dimension = {\n value: parseFloat(value),\n unit: value.indexOf(\"%\") === value.length-1 ? \"%\" : \"%\"\n };\n\n return dimension;\n};\n\nCVUtils._dimensionsConverters = {\n top: function(dimension, context) {\n if (dimension.unit === \"%\") {\n return Math.floor(context.height * (dimension.value / 100));\n }\n },\n right: function(dimension, context) {\n if (dimension.unit === \"%\") {\n return Math.floor(context.width - (context.width * (dimension.value / 100)));\n }\n },\n bottom: function(dimension, context) {\n if (dimension.unit === \"%\") {\n return Math.floor(context.height - (context.height * (dimension.value / 100)));\n }\n },\n left: function(dimension, context) {\n if (dimension.unit === \"%\") {\n return Math.floor(context.width * (dimension.value / 100));\n }\n }\n};\n\nCVUtils.computeImageArea = function(inputWidth, inputHeight, area) {\n var context = {width: inputWidth, height: inputHeight};\n\n var parsedArea = Object.keys(area).reduce(function(result, key) {\n var value = area[key],\n parsed = CVUtils._parseCSSDimensionValues(value),\n calculated = CVUtils._dimensionsConverters[key](parsed, context);\n\n result[key] = calculated;\n return result;\n }, {});\n\n return {\n sx: parsedArea.left,\n sy: parsedArea.top,\n sw: parsedArea.right - parsedArea.left,\n sh: parsedArea.bottom - parsedArea.top\n };\n};\n\nexport default CVUtils;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/cv_utils.js\n **/","import {vec2} from 'gl-matrix';\n /**\n * Creates a cluster for grouping similar orientations of datapoints\n */\nexport default {\n create : function(point, threshold) {\n var points = [], center = {\n rad : 0,\n vec : vec2.clone([0, 0])\n }, pointMap = {};\n\n function init() {\n add(point);\n updateCenter();\n }\n\n function add(point) {\n pointMap[point.id] = point;\n points.push(point);\n }\n\n function updateCenter() {\n var i, sum = 0;\n for ( i = 0; i < points.length; i++) {\n sum += points[i].rad;\n }\n center.rad = sum / points.length;\n center.vec = vec2.clone([Math.cos(center.rad), Math.sin(center.rad)]);\n }\n\n init();\n\n return {\n add : function(point) {\n if (!pointMap[point.id]) {\n add(point);\n updateCenter();\n }\n },\n fits : function(point) {\n // check cosine similarity to center-angle\n var similarity = Math.abs(vec2.dot(point.point.vec, center.vec));\n if (similarity > threshold) {\n return true;\n }\n return false;\n },\n getPoints : function() {\n return points;\n },\n getCenter : function() {\n return center;\n }\n };\n },\n createPoint : function(point, id, property) {\n return {\n rad : point[property],\n point : point,\n id : id\n };\n }\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/cluster.js\n **/","/**\n * @fileoverview gl-matrix - High performance matrix and vector operations\n * @author Brandon Jones\n * @author Colin MacKenzie IV\n * @version 2.3.0\n */\n\n/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE. */\n// END HEADER\n\nexports.glMatrix = require(\"./gl-matrix/common.js\");\nexports.mat2 = require(\"./gl-matrix/mat2.js\");\nexports.mat2d = require(\"./gl-matrix/mat2d.js\");\nexports.mat3 = require(\"./gl-matrix/mat3.js\");\nexports.mat4 = require(\"./gl-matrix/mat4.js\");\nexports.quat = require(\"./gl-matrix/quat.js\");\nexports.vec2 = require(\"./gl-matrix/vec2.js\");\nexports.vec3 = require(\"./gl-matrix/vec3.js\");\nexports.vec4 = require(\"./gl-matrix/vec4.js\");\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/gl-matrix/src/gl-matrix.js\n ** module id = 9\n ** module chunks = 0\n **/","/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE. */\n\n/**\n * @class Common utilities\n * @name glMatrix\n */\nvar glMatrix = {};\n\n// Constants\nglMatrix.EPSILON = 0.000001;\nglMatrix.ARRAY_TYPE = (typeof Float32Array !== 'undefined') ? Float32Array : Array;\nglMatrix.RANDOM = Math.random;\n\n/**\n * Sets the type of array used when creating new vectors and matrices\n *\n * @param {Type} type Array type, such as Float32Array or Array\n */\nglMatrix.setMatrixArrayType = function(type) {\n GLMAT_ARRAY_TYPE = type;\n}\n\nvar degree = Math.PI / 180;\n\n/**\n* Convert Degree To Radian\n*\n* @param {Number} Angle in Degrees\n*/\nglMatrix.toRadian = function(a){\n return a * degree;\n}\n\nmodule.exports = glMatrix;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/gl-matrix/src/gl-matrix/common.js\n ** module id = 10\n ** module chunks = 0\n **/","/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE. */\n\nvar glMatrix = require(\"./common.js\");\n\n/**\n * @class 2x2 Matrix\n * @name mat2\n */\nvar mat2 = {};\n\n/**\n * Creates a new identity mat2\n *\n * @returns {mat2} a new 2x2 matrix\n */\nmat2.create = function() {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n};\n\n/**\n * Creates a new mat2 initialized with values from an existing matrix\n *\n * @param {mat2} a matrix to clone\n * @returns {mat2} a new 2x2 matrix\n */\nmat2.clone = function(a) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n};\n\n/**\n * Copy the values from one mat2 to another\n *\n * @param {mat2} out the receiving matrix\n * @param {mat2} a the source matrix\n * @returns {mat2} out\n */\nmat2.copy = function(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n};\n\n/**\n * Set a mat2 to the identity matrix\n *\n * @param {mat2} out the receiving matrix\n * @returns {mat2} out\n */\nmat2.identity = function(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n};\n\n/**\n * Transpose the values of a mat2\n *\n * @param {mat2} out the receiving matrix\n * @param {mat2} a the source matrix\n * @returns {mat2} out\n */\nmat2.transpose = function(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache some values\n if (out === a) {\n var a1 = a[1];\n out[1] = a[2];\n out[2] = a1;\n } else {\n out[0] = a[0];\n out[1] = a[2];\n out[2] = a[1];\n out[3] = a[3];\n }\n \n return out;\n};\n\n/**\n * Inverts a mat2\n *\n * @param {mat2} out the receiving matrix\n * @param {mat2} a the source matrix\n * @returns {mat2} out\n */\nmat2.invert = function(out, a) {\n var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3],\n\n // Calculate the determinant\n det = a0 * a3 - a2 * a1;\n\n if (!det) {\n return null;\n }\n det = 1.0 / det;\n \n out[0] = a3 * det;\n out[1] = -a1 * det;\n out[2] = -a2 * det;\n out[3] = a0 * det;\n\n return out;\n};\n\n/**\n * Calculates the adjugate of a mat2\n *\n * @param {mat2} out the receiving matrix\n * @param {mat2} a the source matrix\n * @returns {mat2} out\n */\nmat2.adjoint = function(out, a) {\n // Caching this value is nessecary if out == a\n var a0 = a[0];\n out[0] = a[3];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a0;\n\n return out;\n};\n\n/**\n * Calculates the determinant of a mat2\n *\n * @param {mat2} a the source matrix\n * @returns {Number} determinant of a\n */\nmat2.determinant = function (a) {\n return a[0] * a[3] - a[2] * a[1];\n};\n\n/**\n * Multiplies two mat2's\n *\n * @param {mat2} out the receiving matrix\n * @param {mat2} a the first operand\n * @param {mat2} b the second operand\n * @returns {mat2} out\n */\nmat2.multiply = function (out, a, b) {\n var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3];\n var b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n return out;\n};\n\n/**\n * Alias for {@link mat2.multiply}\n * @function\n */\nmat2.mul = mat2.multiply;\n\n/**\n * Rotates a mat2 by the given angle\n *\n * @param {mat2} out the receiving matrix\n * @param {mat2} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat2} out\n */\nmat2.rotate = function (out, a, rad) {\n var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3],\n s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n return out;\n};\n\n/**\n * Scales the mat2 by the dimensions in the given vec2\n *\n * @param {mat2} out the receiving matrix\n * @param {mat2} a the matrix to rotate\n * @param {vec2} v the vec2 to scale the matrix by\n * @returns {mat2} out\n **/\nmat2.scale = function(out, a, v) {\n var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3],\n v0 = v[0], v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n return out;\n};\n\n/**\n * Creates a matrix from a given angle\n * This is equivalent to (but much faster than):\n *\n * mat2.identity(dest);\n * mat2.rotate(dest, dest, rad);\n *\n * @param {mat2} out mat2 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat2} out\n */\nmat2.fromRotation = function(out, rad) {\n var s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n return out;\n}\n\n/**\n * Creates a matrix from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * mat2.identity(dest);\n * mat2.scale(dest, dest, vec);\n *\n * @param {mat2} out mat2 receiving operation result\n * @param {vec2} v Scaling vector\n * @returns {mat2} out\n */\nmat2.fromScaling = function(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n return out;\n}\n\n/**\n * Returns a string representation of a mat2\n *\n * @param {mat2} mat matrix to represent as a string\n * @returns {String} string representation of the matrix\n */\nmat2.str = function (a) {\n return 'mat2(' + a[0] + ', ' + a[1] + ', ' + a[2] + ', ' + a[3] + ')';\n};\n\n/**\n * Returns Frobenius norm of a mat2\n *\n * @param {mat2} a the matrix to calculate Frobenius norm of\n * @returns {Number} Frobenius norm\n */\nmat2.frob = function (a) {\n return(Math.sqrt(Math.pow(a[0], 2) + Math.pow(a[1], 2) + Math.pow(a[2], 2) + Math.pow(a[3], 2)))\n};\n\n/**\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\n * @param {mat2} L the lower triangular matrix \n * @param {mat2} D the diagonal matrix \n * @param {mat2} U the upper triangular matrix \n * @param {mat2} a the input matrix to factorize\n */\n\nmat2.LDU = function (L, D, U, a) { \n L[2] = a[2]/a[0]; \n U[0] = a[0]; \n U[1] = a[1]; \n U[3] = a[3] - L[2] * U[1]; \n return [L, D, U]; \n}; \n\n\nmodule.exports = mat2;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/gl-matrix/src/gl-matrix/mat2.js\n ** module id = 11\n ** module chunks = 0\n **/","/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE. */\n\nvar glMatrix = require(\"./common.js\");\n\n/**\n * @class 2x3 Matrix\n * @name mat2d\n * \n * @description \n * A mat2d contains six elements defined as:\n * <pre>\n * [a, c, tx,\n * b, d, ty]\n * </pre>\n * This is a short form for the 3x3 matrix:\n * <pre>\n * [a, c, tx,\n * b, d, ty,\n * 0, 0, 1]\n * </pre>\n * The last row is ignored so the array is shorter and operations are faster.\n */\nvar mat2d = {};\n\n/**\n * Creates a new identity mat2d\n *\n * @returns {mat2d} a new 2x3 matrix\n */\nmat2d.create = function() {\n var out = new glMatrix.ARRAY_TYPE(6);\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n return out;\n};\n\n/**\n * Creates a new mat2d initialized with values from an existing matrix\n *\n * @param {mat2d} a matrix to clone\n * @returns {mat2d} a new 2x3 matrix\n */\nmat2d.clone = function(a) {\n var out = new glMatrix.ARRAY_TYPE(6);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n};\n\n/**\n * Copy the values from one mat2d to another\n *\n * @param {mat2d} out the receiving matrix\n * @param {mat2d} a the source matrix\n * @returns {mat2d} out\n */\nmat2d.copy = function(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n};\n\n/**\n * Set a mat2d to the identity matrix\n *\n * @param {mat2d} out the receiving matrix\n * @returns {mat2d} out\n */\nmat2d.identity = function(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n return out;\n};\n\n/**\n * Inverts a mat2d\n *\n * @param {mat2d} out the receiving matrix\n * @param {mat2d} a the source matrix\n * @returns {mat2d} out\n */\nmat2d.invert = function(out, a) {\n var aa = a[0], ab = a[1], ac = a[2], ad = a[3],\n atx = a[4], aty = a[5];\n\n var det = aa * ad - ab * ac;\n if(!det){\n return null;\n }\n det = 1.0 / det;\n\n out[0] = ad * det;\n out[1] = -ab * det;\n out[2] = -ac * det;\n out[3] = aa * det;\n out[4] = (ac * aty - ad * atx) * det;\n out[5] = (ab * atx - aa * aty) * det;\n return out;\n};\n\n/**\n * Calculates the determinant of a mat2d\n *\n * @param {mat2d} a the source matrix\n * @returns {Number} determinant of a\n */\nmat2d.determinant = function (a) {\n return a[0] * a[3] - a[1] * a[2];\n};\n\n/**\n * Multiplies two mat2d's\n *\n * @param {mat2d} out the receiving matrix\n * @param {mat2d} a the first operand\n * @param {mat2d} b the second operand\n * @returns {mat2d} out\n */\nmat2d.multiply = function (out, a, b) {\n var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3], a4 = a[4], a5 = a[5],\n b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3], b4 = b[4], b5 = b[5];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n out[4] = a0 * b4 + a2 * b5 + a4;\n out[5] = a1 * b4 + a3 * b5 + a5;\n return out;\n};\n\n/**\n * Alias for {@link mat2d.multiply}\n * @function\n */\nmat2d.mul = mat2d.multiply;\n\n/**\n * Rotates a mat2d by the given angle\n *\n * @param {mat2d} out the receiving matrix\n * @param {mat2d} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat2d} out\n */\nmat2d.rotate = function (out, a, rad) {\n var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3], a4 = a[4], a5 = a[5],\n s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n out[4] = a4;\n out[5] = a5;\n return out;\n};\n\n/**\n * Scales the mat2d by the dimensions in the given vec2\n *\n * @param {mat2d} out the receiving matrix\n * @param {mat2d} a the matrix to translate\n * @param {vec2} v the vec2 to scale the matrix by\n * @returns {mat2d} out\n **/\nmat2d.scale = function(out, a, v) {\n var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3], a4 = a[4], a5 = a[5],\n v0 = v[0], v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n out[4] = a4;\n out[5] = a5;\n return out;\n};\n\n/**\n * Translates the mat2d by the dimensions in the given vec2\n *\n * @param {mat2d} out the receiving matrix\n * @param {mat2d} a the matrix to translate\n * @param {vec2} v the vec2 to translate the matrix by\n * @returns {mat2d} out\n **/\nmat2d.translate = function(out, a, v) {\n var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3], a4 = a[4], a5 = a[5],\n v0 = v[0], v1 = v[1];\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = a0 * v0 + a2 * v1 + a4;\n out[5] = a1 * v0 + a3 * v1 + a5;\n return out;\n};\n\n/**\n * Creates a matrix from a given angle\n * This is equivalent to (but much faster than):\n *\n * mat2d.identity(dest);\n * mat2d.rotate(dest, dest, rad);\n *\n * @param {mat2d} out mat2d receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat2d} out\n */\nmat2d.fromRotation = function(out, rad) {\n var s = Math.sin(rad), c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n\n/**\n * Creates a matrix from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * mat2d.identity(dest);\n * mat2d.scale(dest, dest, vec);\n *\n * @param {mat2d} out mat2d receiving operation result\n * @param {vec2} v Scaling vector\n * @returns {mat2d} out\n */\nmat2d.fromScaling = function(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n\n/**\n * Creates a matrix from a vector translation\n * This is equivalent to (but much faster than):\n *\n * mat2d.identity(dest);\n * mat2d.translate(dest, dest, vec);\n *\n * @param {mat2d} out mat2d receiving operation result\n * @param {vec2} v Translation vector\n * @returns {mat2d} out\n */\nmat2d.fromTranslation = function(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = v[0];\n out[5] = v[1];\n return out;\n}\n\n/**\n * Returns a string representation of a mat2d\n *\n * @param {mat2d} a matrix to represent as a string\n * @returns {String} string representation of the matrix\n */\nmat2d.str = function (a) {\n return 'mat2d(' + a[0] + ', ' + a[1] + ', ' + a[2] + ', ' + \n a[3] + ', ' + a[4] + ', ' + a[5] + ')';\n};\n\n/**\n * Returns Frobenius norm of a mat2d\n *\n * @param {mat2d} a the matrix to calculate Frobenius norm of\n * @returns {Number} Frobenius norm\n */\nmat2d.frob = function (a) { \n return(Math.sqrt(Math.pow(a[0], 2) + Math.pow(a[1], 2) + Math.pow(a[2], 2) + Math.pow(a[3], 2) + Math.pow(a[4], 2) + Math.pow(a[5], 2) + 1))\n}; \n\nmodule.exports = mat2d;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/gl-matrix/src/gl-matrix/mat2d.js\n ** module id = 12\n ** module chunks = 0\n **/","/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE. */\n\nvar glMatrix = require(\"./common.js\");\n\n/**\n * @class 3x3 Matrix\n * @name mat3\n */\nvar mat3 = {};\n\n/**\n * Creates a new identity mat3\n *\n * @returns {mat3} a new 3x3 matrix\n */\nmat3.create = function() {\n var out = new glMatrix.ARRAY_TYPE(9);\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n};\n\n/**\n * Copies the upper-left 3x3 values into the given mat3.\n *\n * @param {mat3} out the receiving 3x3 matrix\n * @param {mat4} a the source 4x4 matrix\n * @returns {mat3} out\n */\nmat3.fromMat4 = function(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[4];\n out[4] = a[5];\n out[5] = a[6];\n out[6] = a[8];\n out[7] = a[9];\n out[8] = a[10];\n return out;\n};\n\n/**\n * Creates a new mat3 initialized with values from an existing matrix\n *\n * @param {mat3} a matrix to clone\n * @returns {mat3} a new 3x3 matrix\n */\nmat3.clone = function(a) {\n var out = new glMatrix.ARRAY_TYPE(9);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n};\n\n/**\n * Copy the values from one mat3 to another\n *\n * @param {mat3} out the receiving matrix\n * @param {mat3} a the source matrix\n * @returns {mat3} out\n */\nmat3.copy = function(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n};\n\n/**\n * Set a mat3 to the identity matrix\n *\n * @param {mat3} out the receiving matrix\n * @returns {mat3} out\n */\nmat3.identity = function(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n};\n\n/**\n * Transpose the values of a mat3\n *\n * @param {mat3} out the receiving matrix\n * @param {mat3} a the source matrix\n * @returns {mat3} out\n */\nmat3.transpose = function(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache some values\n if (out === a) {\n var a01 = a[1], a02 = a[2], a12 = a[5];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a01;\n out[5] = a[7];\n out[6] = a02;\n out[7] = a12;\n } else {\n out[0] = a[0];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a[1];\n out[4] = a[4];\n out[5] = a[7];\n out[6] = a[2];\n out[7] = a[5];\n out[8] = a[8];\n }\n \n return out;\n};\n\n/**\n * Inverts a mat3\n *\n * @param {mat3} out the receiving matrix\n * @param {mat3} a the source matrix\n * @returns {mat3} out\n */\nmat3.invert = function(out, a) {\n var a00 = a[0], a01 = a[1], a02 = a[2],\n a10 = a[3], a11 = a[4], a12 = a[5],\n a20 = a[6], a21 = a[7], a22 = a[8],\n\n b01 = a22 * a11 - a12 * a21,\n b11 = -a22 * a10 + a12 * a20,\n b21 = a21 * a10 - a11 * a20,\n\n // Calculate the determinant\n det = a00 * b01 + a01 * b11 + a02 * b21;\n\n if (!det) { \n return null; \n }\n det = 1.0 / det;\n\n out[0] = b01 * det;\n out[1] = (-a22 * a01 + a02 * a21) * det;\n out[2] = (a12 * a01 - a02 * a11) * det;\n out[3] = b11 * det;\n out[4] = (a22 * a00 - a02 * a20) * det;\n out[5] = (-a12 * a00 + a02 * a10) * det;\n out[6] = b21 * det;\n out[7] = (-a21 * a00 + a01 * a20) * det;\n out[8] = (a11 * a00 - a01 * a10) * det;\n return out;\n};\n\n/**\n * Calculates the adjugate of a mat3\n *\n * @param {mat3} out the receiving matrix\n * @param {mat3} a the source matrix\n * @returns {mat3} out\n */\nmat3.adjoint = function(out, a) {\n var a00 = a[0], a01 = a[1], a02 = a[2],\n a10 = a[3], a11 = a[4], a12 = a[5],\n a20 = a[6], a21 = a[7], a22 = a[8];\n\n out[0] = (a11 * a22 - a12 * a21);\n out[1] = (a02 * a21 - a01 * a22);\n out[2] = (a01 * a12 - a02 * a11);\n out[3] = (a12 * a20 - a10 * a22);\n out[4] = (a00 * a22 - a02 * a20);\n out[5] = (a02 * a10 - a00 * a12);\n out[6] = (a10 * a21 - a11 * a20);\n out[7] = (a01 * a20 - a00 * a21);\n out[8] = (a00 * a11 - a01 * a10);\n return out;\n};\n\n/**\n * Calculates the determinant of a mat3\n *\n * @param {mat3} a the source matrix\n * @returns {Number} determinant of a\n */\nmat3.determinant = function (a) {\n var a00 = a[0], a01 = a[1], a02 = a[2],\n a10 = a[3], a11 = a[4], a12 = a[5],\n a20 = a[6], a21 = a[7], a22 = a[8];\n\n return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\n};\n\n/**\n * Multiplies two mat3's\n *\n * @param {mat3} out the receiving matrix\n * @param {mat3} a the first operand\n * @param {mat3} b the second operand\n * @returns {mat3} out\n */\nmat3.multiply = function (out, a, b) {\n var a00 = a[0], a01 = a[1], a02 = a[2],\n a10 = a[3], a11 = a[4], a12 = a[5],\n a20 = a[6], a21 = a[7], a22 = a[8],\n\n b00 = b[0], b01 = b[1], b02 = b[2],\n b10 = b[3], b11 = b[4], b12 = b[5],\n b20 = b[6], b21 = b[7], b22 = b[8];\n\n out[0] = b00 * a00 + b01 * a10 + b02 * a20;\n out[1] = b00 * a01 + b01 * a11 + b02 * a21;\n out[2] = b00 * a02 + b01 * a12 + b02 * a22;\n\n out[3] = b10 * a00 + b11 * a10 + b12 * a20;\n out[4] = b10 * a01 + b11 * a11 + b12 * a21;\n out[5] = b10 * a02 + b11 * a12 + b12 * a22;\n\n out[6] = b20 * a00 + b21 * a10 + b22 * a20;\n out[7] = b20 * a01 + b21 * a11 + b22 * a21;\n out[8] = b20 * a02 + b21 * a12 + b22 * a22;\n return out;\n};\n\n/**\n * Alias for {@link mat3.multiply}\n * @function\n */\nmat3.mul = mat3.multiply;\n\n/**\n * Translate a mat3 by the given vector\n *\n * @param {mat3} out the receiving matrix\n * @param {mat3} a the matrix to translate\n * @param {vec2} v vector to translate by\n * @returns {mat3} out\n */\nmat3.translate = function(out, a, v) {\n var a00 = a[0], a01 = a[1], a02 = a[2],\n a10 = a[3], a11 = a[4], a12 = a[5],\n a20 = a[6], a21 = a[7], a22 = a[8],\n x = v[0], y = v[1];\n\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n\n out[3] = a10;\n out[4] = a11;\n out[5] = a12;\n\n out[6] = x * a00 + y * a10 + a20;\n out[7] = x * a01 + y * a11 + a21;\n out[8] = x * a02 + y * a12 + a22;\n return out;\n};\n\n/**\n * Rotates a mat3 by the given angle\n *\n * @param {mat3} out the receiving matrix\n * @param {mat3} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat3} out\n */\nmat3.rotate = function (out, a, rad) {\n var a00 = a[0], a01 = a[1], a02 = a[2],\n a10 = a[3], a11 = a[4], a12 = a[5],\n a20 = a[6], a21 = a[7], a22 = a[8],\n\n s = Math.sin(rad),\n c = Math.cos(rad);\n\n out[0] = c * a00 + s * a10;\n out[1] = c * a01 + s * a11;\n out[2] = c * a02 + s * a12;\n\n out[3] = c * a10 - s * a00;\n out[4] = c * a11 - s * a01;\n out[5] = c * a12 - s * a02;\n\n out[6] = a20;\n out[7] = a21;\n out[8] = a22;\n return out;\n};\n\n/**\n * Scales the mat3 by the dimensions in the given vec2\n *\n * @param {mat3} out the receiving matrix\n * @param {mat3} a the matrix to rotate\n * @param {vec2} v the vec2 to scale the matrix by\n * @returns {mat3} out\n **/\nmat3.scale = function(out, a, v) {\n var x = v[0], y = v[1];\n\n out[0] = x * a[0];\n out[1] = x * a[1];\n out[2] = x * a[2];\n\n out[3] = y * a[3];\n out[4] = y * a[4];\n out[5] = y * a[5];\n\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n};\n\n/**\n * Creates a matrix from a vector translation\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.translate(dest, dest, vec);\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {vec2} v Translation vector\n * @returns {mat3} out\n */\nmat3.fromTranslation = function(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = v[0];\n out[7] = v[1];\n out[8] = 1;\n return out;\n}\n\n/**\n * Creates a matrix from a given angle\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.rotate(dest, dest, rad);\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat3} out\n */\nmat3.fromRotation = function(out, rad) {\n var s = Math.sin(rad), c = Math.cos(rad);\n\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n\n out[3] = -s;\n out[4] = c;\n out[5] = 0;\n\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n\n/**\n * Creates a matrix from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.scale(dest, dest, vec);\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {vec2} v Scaling vector\n * @returns {mat3} out\n */\nmat3.fromScaling = function(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n\n out[3] = 0;\n out[4] = v[1];\n out[5] = 0;\n\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n\n/**\n * Copies the values from a mat2d into a mat3\n *\n * @param {mat3} out the receiving matrix\n * @param {mat2d} a the matrix to copy\n * @returns {mat3} out\n **/\nmat3.fromMat2d = function(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = 0;\n\n out[3] = a[2];\n out[4] = a[3];\n out[5] = 0;\n\n out[6] = a[4];\n out[7] = a[5];\n out[8] = 1;\n return out;\n};\n\n/**\n* Calculates a 3x3 matrix from the given quaternion\n*\n* @param {mat3} out mat3 receiving operation result\n* @param {quat} q Quaternion to create matrix from\n*\n* @returns {mat3} out\n*/\nmat3.fromQuat = function (out, q) {\n var x = q[0], y = q[1], z = q[2], w = q[3],\n x2 = x + x,\n y2 = y + y,\n z2 = z + z,\n\n xx = x * x2,\n yx = y * x2,\n yy = y * y2,\n zx = z * x2,\n zy = z * y2,\n zz = z * z2,\n wx = w * x2,\n wy = w * y2,\n wz = w * z2;\n\n out[0] = 1 - yy - zz;\n out[3] = yx - wz;\n out[6] = zx + wy;\n\n out[1] = yx + wz;\n out[4] = 1 - xx - zz;\n out[7] = zy - wx;\n\n out[2] = zx - wy;\n out[5] = zy + wx;\n out[8] = 1 - xx - yy;\n\n return out;\n};\n\n/**\n* Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\n*\n* @param {mat3} out mat3 receiving operation result\n* @param {mat4} a Mat4 to derive the normal matrix from\n*\n* @returns {mat3} out\n*/\nmat3.normalFromMat4 = function (out, a) {\n var a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3],\n a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7],\n a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11],\n a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15],\n\n b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32,\n\n // Calculate the determinant\n det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n if (!det) { \n return null; \n }\n det = 1.0 / det;\n\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n\n return out;\n};\n\n/**\n * Returns a string representation of a mat3\n *\n * @param {mat3} mat matrix to represent as a string\n * @returns {String} string representation of the matrix\n */\nmat3.str = function (a) {\n return 'mat3(' + a[0] + ', ' + a[1] + ', ' + a[2] + ', ' + \n a[3] + ', ' + a[4] + ', ' + a[5] + ', ' + \n a[6] + ', ' + a[7] + ', ' + a[8] + ')';\n};\n\n/**\n * Returns Frobenius norm of a mat3\n *\n * @param {mat3} a the matrix to calculate Frobenius norm of\n * @returns {Number} Frobenius norm\n */\nmat3.frob = function (a) {\n return(Math.sqrt(Math.pow(a[0], 2) + Math.pow(a[1], 2) + Math.pow(a[2], 2) + Math.pow(a[3], 2) + Math.pow(a[4], 2) + Math.pow(a[5], 2) + Math.pow(a[6], 2) + Math.pow(a[7], 2) + Math.pow(a[8], 2)))\n};\n\n\nmodule.exports = mat3;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/gl-matrix/src/gl-matrix/mat3.js\n ** module id = 13\n ** module chunks = 0\n **/","/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE. */\n\nvar glMatrix = require(\"./common.js\");\n\n/**\n * @class 4x4 Matrix\n * @name mat4\n */\nvar mat4 = {};\n\n/**\n * Creates a new identity mat4\n *\n * @returns {mat4} a new 4x4 matrix\n */\nmat4.create = function() {\n var out = new glMatrix.ARRAY_TYPE(16);\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n};\n\n/**\n * Creates a new mat4 initialized with values from an existing matrix\n *\n * @param {mat4} a matrix to clone\n * @returns {mat4} a new 4x4 matrix\n */\nmat4.clone = function(a) {\n var out = new glMatrix.ARRAY_TYPE(16);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n};\n\n/**\n * Copy the values from one mat4 to another\n *\n * @param {mat4} out the receiving matrix\n * @param {mat4} a the source matrix\n * @returns {mat4} out\n */\nmat4.copy = function(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n};\n\n/**\n * Set a mat4 to the identity matrix\n *\n * @param {mat4} out the receiving matrix\n * @returns {mat4} out\n */\nmat4.identity = function(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n};\n\n/**\n * Transpose the values of a mat4\n *\n * @param {mat4} out the receiving matrix\n * @param {mat4} a the source matrix\n * @returns {mat4} out\n */\nmat4.transpose = function(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache some values\n if (out === a) {\n var a01 = a[1], a02 = a[2], a03 = a[3],\n a12 = a[6], a13 = a[7],\n a23 = a[11];\n\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a01;\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a02;\n out[9] = a12;\n out[11] = a[14];\n out[12] = a03;\n out[13] = a13;\n out[14] = a23;\n } else {\n out[0] = a[0];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a[1];\n out[5] = a[5];\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a[2];\n out[9] = a[6];\n out[10] = a[10];\n out[11] = a[14];\n out[12] = a[3];\n out[13] = a[7];\n out[14] = a[11];\n out[15] = a[15];\n }\n \n return out;\n};\n\n/**\n * Inverts a mat4\n *\n * @param {mat4} out the receiving matrix\n * @param {mat4} a the source matrix\n * @returns {mat4} out\n */\nmat4.invert = function(out, a) {\n var a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3],\n a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7],\n a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11],\n a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15],\n\n b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32,\n\n // Calculate the determinant\n det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n if (!det) { \n return null; \n }\n det = 1.0 / det;\n\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n\n return out;\n};\n\n/**\n * Calculates the adjugate of a mat4\n *\n * @param {mat4} out the receiving matrix\n * @param {mat4} a the source matrix\n * @returns {mat4} out\n */\nmat4.adjoint = function(out, a) {\n var a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3],\n a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7],\n a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11],\n a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n\n out[0] = (a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22));\n out[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22));\n out[2] = (a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12));\n out[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12));\n out[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22));\n out[5] = (a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22));\n out[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12));\n out[7] = (a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12));\n out[8] = (a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21));\n out[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21));\n out[10] = (a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11));\n out[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11));\n out[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21));\n out[13] = (a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21));\n out[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11));\n out[15] = (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11));\n return out;\n};\n\n/**\n * Calculates the determinant of a mat4\n *\n * @param {mat4} a the source matrix\n * @returns {Number} determinant of a\n */\nmat4.determinant = function (a) {\n var a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3],\n a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7],\n a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11],\n a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15],\n\n b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n // Calculate the determinant\n return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n};\n\n/**\n * Multiplies two mat4's\n *\n * @param {mat4} out the receiving matrix\n * @param {mat4} a the first operand\n * @param {mat4} b the second operand\n * @returns {mat4} out\n */\nmat4.multiply = function (out, a, b) {\n var a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3],\n a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7],\n a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11],\n a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n\n // Cache only the current line of the second matrix\n var b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3]; \n out[0] = b0*a00 + b1*a10 + b2*a20 + b3*a30;\n out[1] = b0*a01 + b1*a11 + b2*a21 + b3*a31;\n out[2] = b0*a02 + b1*a12 + b2*a22 + b3*a32;\n out[3] = b0*a03 + b1*a13 + b2*a23 + b3*a33;\n\n b0 = b[4]; b1 = b[5]; b2 = b[6]; b3 = b[7];\n out[4] = b0*a00 + b1*a10 + b2*a20 + b3*a30;\n out[5] = b0*a01 + b1*a11 + b2*a21 + b3*a31;\n out[6] = b0*a02 + b1*a12 + b2*a22 + b3*a32;\n out[7] = b0*a03 + b1*a13 + b2*a23 + b3*a33;\n\n b0 = b[8]; b1 = b[9]; b2 = b[10]; b3 = b[11];\n out[8] = b0*a00 + b1*a10 + b2*a20 + b3*a30;\n out[9] = b0*a01 + b1*a11 + b2*a21 + b3*a31;\n out[10] = b0*a02 + b1*a12 + b2*a22 + b3*a32;\n out[11] = b0*a03 + b1*a13 + b2*a23 + b3*a33;\n\n b0 = b[12]; b1 = b[13]; b2 = b[14]; b3 = b[15];\n out[12] = b0*a00 + b1*a10 + b2*a20 + b3*a30;\n out[13] = b0*a01 + b1*a11 + b2*a21 + b3*a31;\n out[14] = b0*a02 + b1*a12 + b2*a22 + b3*a32;\n out[15] = b0*a03 + b1*a13 + b2*a23 + b3*a33;\n return out;\n};\n\n/**\n * Alias for {@link mat4.multiply}\n * @function\n */\nmat4.mul = mat4.multiply;\n\n/**\n * Translate a mat4 by the given vector\n *\n * @param {mat4} out the receiving matrix\n * @param {mat4} a the matrix to translate\n * @param {vec3} v vector to translate by\n * @returns {mat4} out\n */\nmat4.translate = function (out, a, v) {\n var x = v[0], y = v[1], z = v[2],\n a00, a01, a02, a03,\n a10, a11, a12, a13,\n a20, a21, a22, a23;\n\n if (a === out) {\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n } else {\n a00 = a[0]; a01 = a[1]; a02 = a[2]; a03 = a[3];\n a10 = a[4]; a11 = a[5]; a12 = a[6]; a13 = a[7];\n a20 = a[8]; a21 = a[9]; a22 = a[10]; a23 = a[11];\n\n out[0] = a00; out[1] = a01; out[2] = a02; out[3] = a03;\n out[4] = a10; out[5] = a11; out[6] = a12; out[7] = a13;\n out[8] = a20; out[9] = a21; out[10] = a22; out[11] = a23;\n\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\n }\n\n return out;\n};\n\n/**\n * Scales the mat4 by the dimensions in the given vec3\n *\n * @param {mat4} out the receiving matrix\n * @param {mat4} a the matrix to scale\n * @param {vec3} v the vec3 to scale the matrix by\n * @returns {mat4} out\n **/\nmat4.scale = function(out, a, v) {\n var x = v[0], y = v[1], z = v[2];\n\n out[0] = a[0] * x;\n out[1] = a[1] * x;\n out[2] = a[2] * x;\n out[3] = a[3] * x;\n out[4] = a[4] * y;\n out[5] = a[5] * y;\n out[6] = a[6] * y;\n out[7] = a[7] * y;\n out[8] = a[8] * z;\n out[9] = a[9] * z;\n out[10] = a[10] * z;\n out[11] = a[11] * z;\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n};\n\n/**\n * Rotates a mat4 by the given angle around the given axis\n *\n * @param {mat4} out the receiving matrix\n * @param {mat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @param {vec3} axis the axis to rotate around\n * @returns {mat4} out\n */\nmat4.rotate = function (out, a, rad, axis) {\n var x = axis[0], y = axis[1], z = axis[2],\n len = Math.sqrt(x * x + y * y + z * z),\n s, c, t,\n a00, a01, a02, a03,\n a10, a11, a12, a13,\n a20, a21, a22, a23,\n b00, b01, b02,\n b10, b11, b12,\n b20, b21, b22;\n\n if (Math.abs(len) < glMatrix.EPSILON) { return null; }\n \n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n\n s = Math.sin(rad);\n c = Math.cos(rad);\n t = 1 - c;\n\n a00 = a[0]; a01 = a[1]; a02 = a[2]; a03 = a[3];\n a10 = a[4]; a11 = a[5]; a12 = a[6]; a13 = a[7];\n a20 = a[8]; a21 = a[9]; a22 = a[10]; a23 = a[11];\n\n // Construct the elements of the rotation matrix\n b00 = x * x * t + c; b01 = y * x * t + z * s; b02 = z * x * t - y * s;\n b10 = x * y * t - z * s; b11 = y * y * t + c; b12 = z * y * t + x * s;\n b20 = x * z * t + y * s; b21 = y * z * t - x * s; b22 = z * z * t + c;\n\n // Perform rotation-specific matrix multiplication\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\n\n if (a !== out) { // If the source and destination differ, copy the unchanged last row\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n return out;\n};\n\n/**\n * Rotates a matrix by the given angle around the X axis\n *\n * @param {mat4} out the receiving matrix\n * @param {mat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\nmat4.rotateX = function (out, a, rad) {\n var s = Math.sin(rad),\n c = Math.cos(rad),\n a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7],\n a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n\n if (a !== out) { // If the source and destination differ, copy the unchanged rows\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n\n // Perform axis-specific matrix multiplication\n out[4] = a10 * c + a20 * s;\n out[5] = a11 * c + a21 * s;\n out[6] = a12 * c + a22 * s;\n out[7] = a13 * c + a23 * s;\n out[8] = a20 * c - a10 * s;\n out[9] = a21 * c - a11 * s;\n out[10] = a22 * c - a12 * s;\n out[11] = a23 * c - a13 * s;\n return out;\n};\n\n/**\n * Rotates a matrix by the given angle around the Y axis\n *\n * @param {mat4} out the receiving matrix\n * @param {mat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\nmat4.rotateY = function (out, a, rad) {\n var s = Math.sin(rad),\n c = Math.cos(rad),\n a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3],\n a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n\n if (a !== out) { // If the source and destination differ, copy the unchanged rows\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n\n // Perform axis-specific matrix multiplication\n out[0] = a00 * c - a20 * s;\n out[1] = a01 * c - a21 * s;\n out[2] = a02 * c - a22 * s;\n out[3] = a03 * c - a23 * s;\n out[8] = a00 * s + a20 * c;\n out[9] = a01 * s + a21 * c;\n out[10] = a02 * s + a22 * c;\n out[11] = a03 * s + a23 * c;\n return out;\n};\n\n/**\n * Rotates a matrix by the given angle around the Z axis\n *\n * @param {mat4} out the receiving matrix\n * @param {mat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\nmat4.rotateZ = function (out, a, rad) {\n var s = Math.sin(rad),\n c = Math.cos(rad),\n a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3],\n a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n\n if (a !== out) { // If the source and destination differ, copy the unchanged last row\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n\n // Perform axis-specific matrix multiplication\n out[0] = a00 * c + a10 * s;\n out[1] = a01 * c + a11 * s;\n out[2] = a02 * c + a12 * s;\n out[3] = a03 * c + a13 * s;\n out[4] = a10 * c - a00 * s;\n out[5] = a11 * c - a01 * s;\n out[6] = a12 * c - a02 * s;\n out[7] = a13 * c - a03 * s;\n return out;\n};\n\n/**\n * Creates a matrix from a vector translation\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, dest, vec);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {vec3} v Translation vector\n * @returns {mat4} out\n */\nmat4.fromTranslation = function(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n\n/**\n * Creates a matrix from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.scale(dest, dest, vec);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {vec3} v Scaling vector\n * @returns {mat4} out\n */\nmat4.fromScaling = function(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = v[1];\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = v[2];\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n\n/**\n * Creates a matrix from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotate(dest, dest, rad, axis);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @param {vec3} axis the axis to rotate around\n * @returns {mat4} out\n */\nmat4.fromRotation = function(out, rad, axis) {\n var x = axis[0], y = axis[1], z = axis[2],\n len = Math.sqrt(x * x + y * y + z * z),\n s, c, t;\n \n if (Math.abs(len) < glMatrix.EPSILON) { return null; }\n \n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n \n s = Math.sin(rad);\n c = Math.cos(rad);\n t = 1 - c;\n \n // Perform rotation-specific matrix multiplication\n out[0] = x * x * t + c;\n out[1] = y * x * t + z * s;\n out[2] = z * x * t - y * s;\n out[3] = 0;\n out[4] = x * y * t - z * s;\n out[5] = y * y * t + c;\n out[6] = z * y * t + x * s;\n out[7] = 0;\n out[8] = x * z * t + y * s;\n out[9] = y * z * t - x * s;\n out[10] = z * z * t + c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n\n/**\n * Creates a matrix from the given angle around the X axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateX(dest, dest, rad);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\nmat4.fromXRotation = function(out, rad) {\n var s = Math.sin(rad),\n c = Math.cos(rad);\n \n // Perform axis-specific matrix multiplication\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = c;\n out[6] = s;\n out[7] = 0;\n out[8] = 0;\n out[9] = -s;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n\n/**\n * Creates a matrix from the given angle around the Y axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateY(dest, dest, rad);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\nmat4.fromYRotation = function(out, rad) {\n var s = Math.sin(rad),\n c = Math.cos(rad);\n \n // Perform axis-specific matrix multiplication\n out[0] = c;\n out[1] = 0;\n out[2] = -s;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = s;\n out[9] = 0;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n\n/**\n * Creates a matrix from the given angle around the Z axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateZ(dest, dest, rad);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\nmat4.fromZRotation = function(out, rad) {\n var s = Math.sin(rad),\n c = Math.cos(rad);\n \n // Perform axis-specific matrix multiplication\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = 0;\n out[4] = -s;\n out[5] = c;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n\n/**\n * Creates a matrix from a quaternion rotation and vector translation\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * var quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {quat4} q Rotation quaternion\n * @param {vec3} v Translation vector\n * @returns {mat4} out\n */\nmat4.fromRotationTranslation = function (out, q, v) {\n // Quaternion math\n var x = q[0], y = q[1], z = q[2], w = q[3],\n x2 = x + x,\n y2 = y + y,\n z2 = z + z,\n\n xx = x * x2,\n xy = x * y2,\n xz = x * z2,\n yy = y * y2,\n yz = y * z2,\n zz = z * z2,\n wx = w * x2,\n wy = w * y2,\n wz = w * z2;\n\n out[0] = 1 - (yy + zz);\n out[1] = xy + wz;\n out[2] = xz - wy;\n out[3] = 0;\n out[4] = xy - wz;\n out[5] = 1 - (xx + zz);\n out[6] = yz + wx;\n out[7] = 0;\n out[8] = xz + wy;\n out[9] = yz - wx;\n out[10] = 1 - (xx + yy);\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n \n return out;\n};\n\n/**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * var quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale)\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {quat4} q Rotation quaternion\n * @param {vec3} v Translation vector\n * @param {vec3} s Scaling vector\n * @returns {mat4} out\n */\nmat4.fromRotationTranslationScale = function (out, q, v, s) {\n // Quaternion math\n var x = q[0], y = q[1], z = q[2], w = q[3],\n x2 = x + x,\n y2 = y + y,\n z2 = z + z,\n\n xx = x * x2,\n xy = x * y2,\n xz = x * z2,\n yy = y * y2,\n yz = y * z2,\n zz = z * z2,\n wx = w * x2,\n wy = w * y2,\n wz = w * z2,\n sx = s[0],\n sy = s[1],\n sz = s[2];\n\n out[0] = (1 - (yy + zz)) * sx;\n out[1] = (xy + wz) * sx;\n out[2] = (xz - wy) * sx;\n out[3] = 0;\n out[4] = (xy - wz) * sy;\n out[5] = (1 - (xx + zz)) * sy;\n out[6] = (yz + wx) * sy;\n out[7] = 0;\n out[8] = (xz + wy) * sz;\n out[9] = (yz - wx) * sz;\n out[10] = (1 - (xx + yy)) * sz;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n \n return out;\n};\n\n/**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * mat4.translate(dest, origin);\n * var quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale)\n * mat4.translate(dest, negativeOrigin);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {quat4} q Rotation quaternion\n * @param {vec3} v Translation vector\n * @param {vec3} s Scaling vector\n * @param {vec3} o The origin vector around which to scale and rotate\n * @returns {mat4} out\n */\nmat4.fromRotationTranslationScaleOrigin = function (out, q, v, s, o) {\n // Quaternion math\n var x = q[0], y = q[1], z = q[2], w = q[3],\n x2 = x + x,\n y2 = y + y,\n z2 = z + z,\n\n xx = x * x2,\n xy = x * y2,\n xz = x * z2,\n yy = y * y2,\n yz = y * z2,\n zz = z * z2,\n wx = w * x2,\n wy = w * y2,\n wz = w * z2,\n \n sx = s[0],\n sy = s[1],\n sz = s[2],\n\n ox = o[0],\n oy = o[1],\n oz = o[2];\n \n out[0] = (1 - (yy + zz)) * sx;\n out[1] = (xy + wz) * sx;\n out[2] = (xz - wy) * sx;\n out[3] = 0;\n out[4] = (xy - wz) * sy;\n out[5] = (1 - (xx + zz)) * sy;\n out[6] = (yz + wx) * sy;\n out[7] = 0;\n out[8] = (xz + wy) * sz;\n out[9] = (yz - wx) * sz;\n out[10] = (1 - (xx + yy)) * sz;\n out[11] = 0;\n out[12] = v[0] + ox - (out[0] * ox + out[4] * oy + out[8] * oz);\n out[13] = v[1] + oy - (out[1] * ox + out[5] * oy + out[9] * oz);\n out[14] = v[2] + oz - (out[2] * ox + out[6] * oy + out[10] * oz);\n out[15] = 1;\n \n return out;\n};\n\nmat4.fromQuat = function (out, q) {\n var x = q[0], y = q[1], z = q[2], w = q[3],\n x2 = x + x,\n y2 = y + y,\n z2 = z + z,\n\n xx = x * x2,\n yx = y * x2,\n yy = y * y2,\n zx = z * x2,\n zy = z * y2,\n zz = z * z2,\n wx = w * x2,\n wy = w * y2,\n wz = w * z2;\n\n out[0] = 1 - yy - zz;\n out[1] = yx + wz;\n out[2] = zx - wy;\n out[3] = 0;\n\n out[4] = yx - wz;\n out[5] = 1 - xx - zz;\n out[6] = zy + wx;\n out[7] = 0;\n\n out[8] = zx + wy;\n out[9] = zy - wx;\n out[10] = 1 - xx - yy;\n out[11] = 0;\n\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n\n return out;\n};\n\n/**\n * Generates a frustum matrix with the given bounds\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {Number} left Left bound of the frustum\n * @param {Number} right Right bound of the frustum\n * @param {Number} bottom Bottom bound of the frustum\n * @param {Number} top Top bound of the frustum\n * @param {Number} near Near bound of the frustum\n * @param {Number} far Far bound of the frustum\n * @returns {mat4} out\n */\nmat4.frustum = function (out, left, right, bottom, top, near, far) {\n var rl = 1 / (right - left),\n tb = 1 / (top - bottom),\n nf = 1 / (near - far);\n out[0] = (near * 2) * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = (near * 2) * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[10] = (far + near) * nf;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[14] = (far * near * 2) * nf;\n out[15] = 0;\n return out;\n};\n\n/**\n * Generates a perspective projection matrix with the given bounds\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} fovy Vertical field of view in radians\n * @param {number} aspect Aspect ratio. typically viewport width/height\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum\n * @returns {mat4} out\n */\nmat4.perspective = function (out, fovy, aspect, near, far) {\n var f = 1.0 / Math.tan(fovy / 2),\n nf = 1 / (near - far);\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = (far + near) * nf;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[14] = (2 * far * near) * nf;\n out[15] = 0;\n return out;\n};\n\n/**\n * Generates a perspective projection matrix with the given field of view.\n * This is primarily useful for generating projection matrices to be used\n * with the still experiemental WebVR API.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum\n * @returns {mat4} out\n */\nmat4.perspectiveFromFieldOfView = function (out, fov, near, far) {\n var upTan = Math.tan(fov.upDegrees * Math.PI/180.0),\n downTan = Math.tan(fov.downDegrees * Math.PI/180.0),\n leftTan = Math.tan(fov.leftDegrees * Math.PI/180.0),\n rightTan = Math.tan(fov.rightDegrees * Math.PI/180.0),\n xScale = 2.0 / (leftTan + rightTan),\n yScale = 2.0 / (upTan + downTan);\n\n out[0] = xScale;\n out[1] = 0.0;\n out[2] = 0.0;\n out[3] = 0.0;\n out[4] = 0.0;\n out[5] = yScale;\n out[6] = 0.0;\n out[7] = 0.0;\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\n out[9] = ((upTan - downTan) * yScale * 0.5);\n out[10] = far / (near - far);\n out[11] = -1.0;\n out[12] = 0.0;\n out[13] = 0.0;\n out[14] = (far * near) / (near - far);\n out[15] = 0.0;\n return out;\n}\n\n/**\n * Generates a orthogonal projection matrix with the given bounds\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} left Left bound of the frustum\n * @param {number} right Right bound of the frustum\n * @param {number} bottom Bottom bound of the frustum\n * @param {number} top Top bound of the frustum\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum\n * @returns {mat4} out\n */\nmat4.ortho = function (out, left, right, bottom, top, near, far) {\n var lr = 1 / (left - right),\n bt = 1 / (bottom - top),\n nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 2 * nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = (far + near) * nf;\n out[15] = 1;\n return out;\n};\n\n/**\n * Generates a look-at matrix with the given eye position, focal point, and up axis\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {vec3} eye Position of the viewer\n * @param {vec3} center Point the viewer is looking at\n * @param {vec3} up vec3 pointing up\n * @returns {mat4} out\n */\nmat4.lookAt = function (out, eye, center, up) {\n var x0, x1, x2, y0, y1, y2, z0, z1, z2, len,\n eyex = eye[0],\n eyey = eye[1],\n eyez = eye[2],\n upx = up[0],\n upy = up[1],\n upz = up[2],\n centerx = center[0],\n centery = center[1],\n centerz = center[2];\n\n if (Math.abs(eyex - centerx) < glMatrix.EPSILON &&\n Math.abs(eyey - centery) < glMatrix.EPSILON &&\n Math.abs(eyez - centerz) < glMatrix.EPSILON) {\n return mat4.identity(out);\n }\n\n z0 = eyex - centerx;\n z1 = eyey - centery;\n z2 = eyez - centerz;\n\n len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n\n x0 = upy * z2 - upz * z1;\n x1 = upz * z0 - upx * z2;\n x2 = upx * z1 - upy * z0;\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n y0 = z1 * x2 - z2 * x1;\n y1 = z2 * x0 - z0 * x2;\n y2 = z0 * x1 - z1 * x0;\n\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n\n out[0] = x0;\n out[1] = y0;\n out[2] = z0;\n out[3] = 0;\n out[4] = x1;\n out[5] = y1;\n out[6] = z1;\n out[7] = 0;\n out[8] = x2;\n out[9] = y2;\n out[10] = z2;\n out[11] = 0;\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n out[15] = 1;\n\n return out;\n};\n\n/**\n * Returns a string representation of a mat4\n *\n * @param {mat4} mat matrix to represent as a string\n * @returns {String} string representation of the matrix\n */\nmat4.str = function (a) {\n return 'mat4(' + a[0] + ', ' + a[1] + ', ' + a[2] + ', ' + a[3] + ', ' +\n a[4] + ', ' + a[5] + ', ' + a[6] + ', ' + a[7] + ', ' +\n a[8] + ', ' + a[9] + ', ' + a[10] + ', ' + a[11] + ', ' + \n a[12] + ', ' + a[13] + ', ' + a[14] + ', ' + a[15] + ')';\n};\n\n/**\n * Returns Frobenius norm of a mat4\n *\n * @param {mat4} a the matrix to calculate Frobenius norm of\n * @returns {Number} Frobenius norm\n */\nmat4.frob = function (a) {\n return(Math.sqrt(Math.pow(a[0], 2) + Math.pow(a[1], 2) + Math.pow(a[2], 2) + Math.pow(a[3], 2) + Math.pow(a[4], 2) + Math.pow(a[5], 2) + Math.pow(a[6], 2) + Math.pow(a[7], 2) + Math.pow(a[8], 2) + Math.pow(a[9], 2) + Math.pow(a[10], 2) + Math.pow(a[11], 2) + Math.pow(a[12], 2) + Math.pow(a[13], 2) + Math.pow(a[14], 2) + Math.pow(a[15], 2) ))\n};\n\n\nmodule.exports = mat4;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/gl-matrix/src/gl-matrix/mat4.js\n ** module id = 14\n ** module chunks = 0\n **/","/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE. */\n\nvar glMatrix = require(\"./common.js\");\nvar mat3 = require(\"./mat3.js\");\nvar vec3 = require(\"./vec3.js\");\nvar vec4 = require(\"./vec4.js\");\n\n/**\n * @class Quaternion\n * @name quat\n */\nvar quat = {};\n\n/**\n * Creates a new identity quat\n *\n * @returns {quat} a new quaternion\n */\nquat.create = function() {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n};\n\n/**\n * Sets a quaternion to represent the shortest rotation from one\n * vector to another.\n *\n * Both vectors are assumed to be unit length.\n *\n * @param {quat} out the receiving quaternion.\n * @param {vec3} a the initial vector\n * @param {vec3} b the destination vector\n * @returns {quat} out\n */\nquat.rotationTo = (function() {\n var tmpvec3 = vec3.create();\n var xUnitVec3 = vec3.fromValues(1,0,0);\n var yUnitVec3 = vec3.fromValues(0,1,0);\n\n return function(out, a, b) {\n var dot = vec3.dot(a, b);\n if (dot < -0.999999) {\n vec3.cross(tmpvec3, xUnitVec3, a);\n if (vec3.length(tmpvec3) < 0.000001)\n vec3.cross(tmpvec3, yUnitVec3, a);\n vec3.normalize(tmpvec3, tmpvec3);\n quat.setAxisAngle(out, tmpvec3, Math.PI);\n return out;\n } else if (dot > 0.999999) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n } else {\n vec3.cross(tmpvec3, a, b);\n out[0] = tmpvec3[0];\n out[1] = tmpvec3[1];\n out[2] = tmpvec3[2];\n out[3] = 1 + dot;\n return quat.normalize(out, out);\n }\n };\n})();\n\n/**\n * Sets the specified quaternion with values corresponding to the given\n * axes. Each axis is a vec3 and is expected to be unit length and\n * perpendicular to all other specified axes.\n *\n * @param {vec3} view the vector representing the viewing direction\n * @param {vec3} right the vector representing the local \"right\" direction\n * @param {vec3} up the vector representing the local \"up\" direction\n * @returns {quat} out\n */\nquat.setAxes = (function() {\n var matr = mat3.create();\n\n return function(out, view, right, up) {\n matr[0] = right[0];\n matr[3] = right[1];\n matr[6] = right[2];\n\n matr[1] = up[0];\n matr[4] = up[1];\n matr[7] = up[2];\n\n matr[2] = -view[0];\n matr[5] = -view[1];\n matr[8] = -view[2];\n\n return quat.normalize(out, quat.fromMat3(out, matr));\n };\n})();\n\n/**\n * Creates a new quat initialized with values from an existing quaternion\n *\n * @param {quat} a quaternion to clone\n * @returns {quat} a new quaternion\n * @function\n */\nquat.clone = vec4.clone;\n\n/**\n * Creates a new quat initialized with the given values\n *\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @param {Number} w W component\n * @returns {quat} a new quaternion\n * @function\n */\nquat.fromValues = vec4.fromValues;\n\n/**\n * Copy the values from one quat to another\n *\n * @param {quat} out the receiving quaternion\n * @param {quat} a the source quaternion\n * @returns {quat} out\n * @function\n */\nquat.copy = vec4.copy;\n\n/**\n * Set the components of a quat to the given values\n *\n * @param {quat} out the receiving quaternion\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @param {Number} w W component\n * @returns {quat} out\n * @function\n */\nquat.set = vec4.set;\n\n/**\n * Set a quat to the identity quaternion\n *\n * @param {quat} out the receiving quaternion\n * @returns {quat} out\n */\nquat.identity = function(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n};\n\n/**\n * Sets a quat from the given angle and rotation axis,\n * then returns it.\n *\n * @param {quat} out the receiving quaternion\n * @param {vec3} axis the axis around which to rotate\n * @param {Number} rad the angle in radians\n * @returns {quat} out\n **/\nquat.setAxisAngle = function(out, axis, rad) {\n rad = rad * 0.5;\n var s = Math.sin(rad);\n out[0] = s * axis[0];\n out[1] = s * axis[1];\n out[2] = s * axis[2];\n out[3] = Math.cos(rad);\n return out;\n};\n\n/**\n * Adds two quat's\n *\n * @param {quat} out the receiving quaternion\n * @param {quat} a the first operand\n * @param {quat} b the second operand\n * @returns {quat} out\n * @function\n */\nquat.add = vec4.add;\n\n/**\n * Multiplies two quat's\n *\n * @param {quat} out the receiving quaternion\n * @param {quat} a the first operand\n * @param {quat} b the second operand\n * @returns {quat} out\n */\nquat.multiply = function(out, a, b) {\n var ax = a[0], ay = a[1], az = a[2], aw = a[3],\n bx = b[0], by = b[1], bz = b[2], bw = b[3];\n\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n};\n\n/**\n * Alias for {@link quat.multiply}\n * @function\n */\nquat.mul = quat.multiply;\n\n/**\n * Scales a quat by a scalar number\n *\n * @param {quat} out the receiving vector\n * @param {quat} a the vector to scale\n * @param {Number} b amount to scale the vector by\n * @returns {quat} out\n * @function\n */\nquat.scale = vec4.scale;\n\n/**\n * Rotates a quaternion by the given angle about the X axis\n *\n * @param {quat} out quat receiving operation result\n * @param {quat} a quat to rotate\n * @param {number} rad angle (in radians) to rotate\n * @returns {quat} out\n */\nquat.rotateX = function (out, a, rad) {\n rad *= 0.5; \n\n var ax = a[0], ay = a[1], az = a[2], aw = a[3],\n bx = Math.sin(rad), bw = Math.cos(rad);\n\n out[0] = ax * bw + aw * bx;\n out[1] = ay * bw + az * bx;\n out[2] = az * bw - ay * bx;\n out[3] = aw * bw - ax * bx;\n return out;\n};\n\n/**\n * Rotates a quaternion by the given angle about the Y axis\n *\n * @param {quat} out quat receiving operation result\n * @param {quat} a quat to rotate\n * @param {number} rad angle (in radians) to rotate\n * @returns {quat} out\n */\nquat.rotateY = function (out, a, rad) {\n rad *= 0.5; \n\n var ax = a[0], ay = a[1], az = a[2], aw = a[3],\n by = Math.sin(rad), bw = Math.cos(rad);\n\n out[0] = ax * bw - az * by;\n out[1] = ay * bw + aw * by;\n out[2] = az * bw + ax * by;\n out[3] = aw * bw - ay * by;\n return out;\n};\n\n/**\n * Rotates a quaternion by the given angle about the Z axis\n *\n * @param {quat} out quat receiving operation result\n * @param {quat} a quat to rotate\n * @param {number} rad angle (in radians) to rotate\n * @returns {quat} out\n */\nquat.rotateZ = function (out, a, rad) {\n rad *= 0.5; \n\n var ax = a[0], ay = a[1], az = a[2], aw = a[3],\n bz = Math.sin(rad), bw = Math.cos(rad);\n\n out[0] = ax * bw + ay * bz;\n out[1] = ay * bw - ax * bz;\n out[2] = az * bw + aw * bz;\n out[3] = aw * bw - az * bz;\n return out;\n};\n\n/**\n * Calculates the W component of a quat from the X, Y, and Z components.\n * Assumes that quaternion is 1 unit in length.\n * Any existing W component will be ignored.\n *\n * @param {quat} out the receiving quaternion\n * @param {quat} a quat to calculate W component of\n * @returns {quat} out\n */\nquat.calculateW = function (out, a) {\n var x = a[0], y = a[1], z = a[2];\n\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\n return out;\n};\n\n/**\n * Calculates the dot product of two quat's\n *\n * @param {quat} a the first operand\n * @param {quat} b the second operand\n * @returns {Number} dot product of a and b\n * @function\n */\nquat.dot = vec4.dot;\n\n/**\n * Performs a linear interpolation between two quat's\n *\n * @param {quat} out the receiving quaternion\n * @param {quat} a the first operand\n * @param {quat} b the second operand\n * @param {Number} t interpolation amount between the two inputs\n * @returns {quat} out\n * @function\n */\nquat.lerp = vec4.lerp;\n\n/**\n * Performs a spherical linear interpolation between two quat\n *\n * @param {quat} out the receiving quaternion\n * @param {quat} a the first operand\n * @param {quat} b the second operand\n * @param {Number} t interpolation amount between the two inputs\n * @returns {quat} out\n */\nquat.slerp = function (out, a, b, t) {\n // benchmarks:\n // http://jsperf.com/quaternion-slerp-implementations\n\n var ax = a[0], ay = a[1], az = a[2], aw = a[3],\n bx = b[0], by = b[1], bz = b[2], bw = b[3];\n\n var omega, cosom, sinom, scale0, scale1;\n\n // calc cosine\n cosom = ax * bx + ay * by + az * bz + aw * bw;\n // adjust signs (if necessary)\n if ( cosom < 0.0 ) {\n cosom = -cosom;\n bx = - bx;\n by = - by;\n bz = - bz;\n bw = - bw;\n }\n // calculate coefficients\n if ( (1.0 - cosom) > 0.000001 ) {\n // standard case (slerp)\n omega = Math.acos(cosom);\n sinom = Math.sin(omega);\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\n scale1 = Math.sin(t * omega) / sinom;\n } else { \n // \"from\" and \"to\" quaternions are very close \n // ... so we can do a linear interpolation\n scale0 = 1.0 - t;\n scale1 = t;\n }\n // calculate final values\n out[0] = scale0 * ax + scale1 * bx;\n out[1] = scale0 * ay + scale1 * by;\n out[2] = scale0 * az + scale1 * bz;\n out[3] = scale0 * aw + scale1 * bw;\n \n return out;\n};\n\n/**\n * Performs a spherical linear interpolation with two control points\n *\n * @param {quat} out the receiving quaternion\n * @param {quat} a the first operand\n * @param {quat} b the second operand\n * @param {quat} c the third operand\n * @param {quat} d the fourth operand\n * @param {Number} t interpolation amount\n * @returns {quat} out\n */\nquat.sqlerp = (function () {\n var temp1 = quat.create();\n var temp2 = quat.create();\n \n return function (out, a, b, c, d, t) {\n quat.slerp(temp1, a, d, t);\n quat.slerp(temp2, b, c, t);\n quat.slerp(out, temp1, temp2, 2 * t * (1 - t));\n \n return out;\n };\n}());\n\n/**\n * Calculates the inverse of a quat\n *\n * @param {quat} out the receiving quaternion\n * @param {quat} a quat to calculate inverse of\n * @returns {quat} out\n */\nquat.invert = function(out, a) {\n var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3],\n dot = a0*a0 + a1*a1 + a2*a2 + a3*a3,\n invDot = dot ? 1.0/dot : 0;\n \n // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\n\n out[0] = -a0*invDot;\n out[1] = -a1*invDot;\n out[2] = -a2*invDot;\n out[3] = a3*invDot;\n return out;\n};\n\n/**\n * Calculates the conjugate of a quat\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\n *\n * @param {quat} out the receiving quaternion\n * @param {quat} a quat to calculate conjugate of\n * @returns {quat} out\n */\nquat.conjugate = function (out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n return out;\n};\n\n/**\n * Calculates the length of a quat\n *\n * @param {quat} a vector to calculate length of\n * @returns {Number} length of a\n * @function\n */\nquat.length = vec4.length;\n\n/**\n * Alias for {@link quat.length}\n * @function\n */\nquat.len = quat.length;\n\n/**\n * Calculates the squared length of a quat\n *\n * @param {quat} a vector to calculate squared length of\n * @returns {Number} squared length of a\n * @function\n */\nquat.squaredLength = vec4.squaredLength;\n\n/**\n * Alias for {@link quat.squaredLength}\n * @function\n */\nquat.sqrLen = quat.squaredLength;\n\n/**\n * Normalize a quat\n *\n * @param {quat} out the receiving quaternion\n * @param {quat} a quaternion to normalize\n * @returns {quat} out\n * @function\n */\nquat.normalize = vec4.normalize;\n\n/**\n * Creates a quaternion from the given 3x3 rotation matrix.\n *\n * NOTE: The resultant quaternion is not normalized, so you should be sure\n * to renormalize the quaternion yourself where necessary.\n *\n * @param {quat} out the receiving quaternion\n * @param {mat3} m rotation matrix\n * @returns {quat} out\n * @function\n */\nquat.fromMat3 = function(out, m) {\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\n // article \"Quaternion Calculus and Fast Animation\".\n var fTrace = m[0] + m[4] + m[8];\n var fRoot;\n\n if ( fTrace > 0.0 ) {\n // |w| > 1/2, may as well choose w > 1/2\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\n out[3] = 0.5 * fRoot;\n fRoot = 0.5/fRoot; // 1/(4w)\n out[0] = (m[5]-m[7])*fRoot;\n out[1] = (m[6]-m[2])*fRoot;\n out[2] = (m[1]-m[3])*fRoot;\n } else {\n // |w| <= 1/2\n var i = 0;\n if ( m[4] > m[0] )\n i = 1;\n if ( m[8] > m[i*3+i] )\n i = 2;\n var j = (i+1)%3;\n var k = (i+2)%3;\n \n fRoot = Math.sqrt(m[i*3+i]-m[j*3+j]-m[k*3+k] + 1.0);\n out[i] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[3] = (m[j*3+k] - m[k*3+j]) * fRoot;\n out[j] = (m[j*3+i] + m[i*3+j]) * fRoot;\n out[k] = (m[k*3+i] + m[i*3+k]) * fRoot;\n }\n \n return out;\n};\n\n/**\n * Returns a string representation of a quatenion\n *\n * @param {quat} vec vector to represent as a string\n * @returns {String} string representation of the vector\n */\nquat.str = function (a) {\n return 'quat(' + a[0] + ', ' + a[1] + ', ' + a[2] + ', ' + a[3] + ')';\n};\n\nmodule.exports = quat;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/gl-matrix/src/gl-matrix/quat.js\n ** module id = 15\n ** module chunks = 0\n **/","/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE. */\n\nvar glMatrix = require(\"./common.js\");\n\n/**\n * @class 3 Dimensional Vector\n * @name vec3\n */\nvar vec3 = {};\n\n/**\n * Creates a new, empty vec3\n *\n * @returns {vec3} a new 3D vector\n */\nvec3.create = function() {\n var out = new glMatrix.ARRAY_TYPE(3);\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n return out;\n};\n\n/**\n * Creates a new vec3 initialized with values from an existing vector\n *\n * @param {vec3} a vector to clone\n * @returns {vec3} a new 3D vector\n */\nvec3.clone = function(a) {\n var out = new glMatrix.ARRAY_TYPE(3);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n};\n\n/**\n * Creates a new vec3 initialized with the given values\n *\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @returns {vec3} a new 3D vector\n */\nvec3.fromValues = function(x, y, z) {\n var out = new glMatrix.ARRAY_TYPE(3);\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n};\n\n/**\n * Copy the values from one vec3 to another\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a the source vector\n * @returns {vec3} out\n */\nvec3.copy = function(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n};\n\n/**\n * Set the components of a vec3 to the given values\n *\n * @param {vec3} out the receiving vector\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @returns {vec3} out\n */\nvec3.set = function(out, x, y, z) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n};\n\n/**\n * Adds two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a the first operand\n * @param {vec3} b the second operand\n * @returns {vec3} out\n */\nvec3.add = function(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n return out;\n};\n\n/**\n * Subtracts vector b from vector a\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a the first operand\n * @param {vec3} b the second operand\n * @returns {vec3} out\n */\nvec3.subtract = function(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n return out;\n};\n\n/**\n * Alias for {@link vec3.subtract}\n * @function\n */\nvec3.sub = vec3.subtract;\n\n/**\n * Multiplies two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a the first operand\n * @param {vec3} b the second operand\n * @returns {vec3} out\n */\nvec3.multiply = function(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n return out;\n};\n\n/**\n * Alias for {@link vec3.multiply}\n * @function\n */\nvec3.mul = vec3.multiply;\n\n/**\n * Divides two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a the first operand\n * @param {vec3} b the second operand\n * @returns {vec3} out\n */\nvec3.divide = function(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n return out;\n};\n\n/**\n * Alias for {@link vec3.divide}\n * @function\n */\nvec3.div = vec3.divide;\n\n/**\n * Returns the minimum of two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a the first operand\n * @param {vec3} b the second operand\n * @returns {vec3} out\n */\nvec3.min = function(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n return out;\n};\n\n/**\n * Returns the maximum of two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a the first operand\n * @param {vec3} b the second operand\n * @returns {vec3} out\n */\nvec3.max = function(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n return out;\n};\n\n/**\n * Scales a vec3 by a scalar number\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a the vector to scale\n * @param {Number} b amount to scale the vector by\n * @returns {vec3} out\n */\nvec3.scale = function(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n return out;\n};\n\n/**\n * Adds two vec3's after scaling the second operand by a scalar value\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a the first operand\n * @param {vec3} b the second operand\n * @param {Number} scale the amount to scale b by before adding\n * @returns {vec3} out\n */\nvec3.scaleAndAdd = function(out, a, b, scale) {\n out[0] = a[0] + (b[0] * scale);\n out[1] = a[1] + (b[1] * scale);\n out[2] = a[2] + (b[2] * scale);\n return out;\n};\n\n/**\n * Calculates the euclidian distance between two vec3's\n *\n * @param {vec3} a the first operand\n * @param {vec3} b the second operand\n * @returns {Number} distance between a and b\n */\nvec3.distance = function(a, b) {\n var x = b[0] - a[0],\n y = b[1] - a[1],\n z = b[2] - a[2];\n return Math.sqrt(x*x + y*y + z*z);\n};\n\n/**\n * Alias for {@link vec3.distance}\n * @function\n */\nvec3.dist = vec3.distance;\n\n/**\n * Calculates the squared euclidian distance between two vec3's\n *\n * @param {vec3} a the first operand\n * @param {vec3} b the second operand\n * @returns {Number} squared distance between a and b\n */\nvec3.squaredDistance = function(a, b) {\n var x = b[0] - a[0],\n y = b[1] - a[1],\n z = b[2] - a[2];\n return x*x + y*y + z*z;\n};\n\n/**\n * Alias for {@link vec3.squaredDistance}\n * @function\n */\nvec3.sqrDist = vec3.squaredDistance;\n\n/**\n * Calculates the length of a vec3\n *\n * @param {vec3} a vector to calculate length of\n * @returns {Number} length of a\n */\nvec3.length = function (a) {\n var x = a[0],\n y = a[1],\n z = a[2];\n return Math.sqrt(x*x + y*y + z*z);\n};\n\n/**\n * Alias for {@link vec3.length}\n * @function\n */\nvec3.len = vec3.length;\n\n/**\n * Calculates the squared length of a vec3\n *\n * @param {vec3} a vector to calculate squared length of\n * @returns {Number} squared length of a\n */\nvec3.squaredLength = function (a) {\n var x = a[0],\n y = a[1],\n z = a[2];\n return x*x + y*y + z*z;\n};\n\n/**\n * Alias for {@link vec3.squaredLength}\n * @function\n */\nvec3.sqrLen = vec3.squaredLength;\n\n/**\n * Negates the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a vector to negate\n * @returns {vec3} out\n */\nvec3.negate = function(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n return out;\n};\n\n/**\n * Returns the inverse of the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a vector to invert\n * @returns {vec3} out\n */\nvec3.inverse = function(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n out[2] = 1.0 / a[2];\n return out;\n};\n\n/**\n * Normalize a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a vector to normalize\n * @returns {vec3} out\n */\nvec3.normalize = function(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2];\n var len = x*x + y*y + z*z;\n if (len > 0) {\n //TODO: evaluate use of glm_invsqrt here?\n len = 1 / Math.sqrt(len);\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n out[2] = a[2] * len;\n }\n return out;\n};\n\n/**\n * Calculates the dot product of two vec3's\n *\n * @param {vec3} a the first operand\n * @param {vec3} b the second operand\n * @returns {Number} dot product of a and b\n */\nvec3.dot = function (a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n};\n\n/**\n * Computes the cross product of two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a the first operand\n * @param {vec3} b the second operand\n * @returns {vec3} out\n */\nvec3.cross = function(out, a, b) {\n var ax = a[0], ay = a[1], az = a[2],\n bx = b[0], by = b[1], bz = b[2];\n\n out[0] = ay * bz - az * by;\n out[1] = az * bx - ax * bz;\n out[2] = ax * by - ay * bx;\n return out;\n};\n\n/**\n * Performs a linear interpolation between two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a the first operand\n * @param {vec3} b the second operand\n * @param {Number} t interpolation amount between the two inputs\n * @returns {vec3} out\n */\nvec3.lerp = function (out, a, b, t) {\n var ax = a[0],\n ay = a[1],\n az = a[2];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n return out;\n};\n\n/**\n * Performs a hermite interpolation with two control points\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a the first operand\n * @param {vec3} b the second operand\n * @param {vec3} c the third operand\n * @param {vec3} d the fourth operand\n * @param {Number} t interpolation amount between the two inputs\n * @returns {vec3} out\n */\nvec3.hermite = function (out, a, b, c, d, t) {\n var factorTimes2 = t * t,\n factor1 = factorTimes2 * (2 * t - 3) + 1,\n factor2 = factorTimes2 * (t - 2) + t,\n factor3 = factorTimes2 * (t - 1),\n factor4 = factorTimes2 * (3 - 2 * t);\n \n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n \n return out;\n};\n\n/**\n * Performs a bezier interpolation with two control points\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a the first operand\n * @param {vec3} b the second operand\n * @param {vec3} c the third operand\n * @param {vec3} d the fourth operand\n * @param {Number} t interpolation amount between the two inputs\n * @returns {vec3} out\n */\nvec3.bezier = function (out, a, b, c, d, t) {\n var inverseFactor = 1 - t,\n inverseFactorTimesTwo = inverseFactor * inverseFactor,\n factorTimes2 = t * t,\n factor1 = inverseFactorTimesTwo * inverseFactor,\n factor2 = 3 * t * inverseFactorTimesTwo,\n factor3 = 3 * factorTimes2 * inverseFactor,\n factor4 = factorTimes2 * t;\n \n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n \n return out;\n};\n\n/**\n * Generates a random vector with the given scale\n *\n * @param {vec3} out the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns {vec3} out\n */\nvec3.random = function (out, scale) {\n scale = scale || 1.0;\n\n var r = glMatrix.RANDOM() * 2.0 * Math.PI;\n var z = (glMatrix.RANDOM() * 2.0) - 1.0;\n var zScale = Math.sqrt(1.0-z*z) * scale;\n\n out[0] = Math.cos(r) * zScale;\n out[1] = Math.sin(r) * zScale;\n out[2] = z * scale;\n return out;\n};\n\n/**\n * Transforms the vec3 with a mat4.\n * 4th vector component is implicitly '1'\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a the vector to transform\n * @param {mat4} m matrix to transform with\n * @returns {vec3} out\n */\nvec3.transformMat4 = function(out, a, m) {\n var x = a[0], y = a[1], z = a[2],\n w = m[3] * x + m[7] * y + m[11] * z + m[15];\n w = w || 1.0;\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n return out;\n};\n\n/**\n * Transforms the vec3 with a mat3.\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a the vector to transform\n * @param {mat4} m the 3x3 matrix to transform with\n * @returns {vec3} out\n */\nvec3.transformMat3 = function(out, a, m) {\n var x = a[0], y = a[1], z = a[2];\n out[0] = x * m[0] + y * m[3] + z * m[6];\n out[1] = x * m[1] + y * m[4] + z * m[7];\n out[2] = x * m[2] + y * m[5] + z * m[8];\n return out;\n};\n\n/**\n * Transforms the vec3 with a quat\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a the vector to transform\n * @param {quat} q quaternion to transform with\n * @returns {vec3} out\n */\nvec3.transformQuat = function(out, a, q) {\n // benchmarks: http://jsperf.com/quaternion-transform-vec3-implementations\n\n var x = a[0], y = a[1], z = a[2],\n qx = q[0], qy = q[1], qz = q[2], qw = q[3],\n\n // calculate quat * vec\n ix = qw * x + qy * z - qz * y,\n iy = qw * y + qz * x - qx * z,\n iz = qw * z + qx * y - qy * x,\n iw = -qx * x - qy * y - qz * z;\n\n // calculate result * inverse quat\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n return out;\n};\n\n/**\n * Rotate a 3D vector around the x-axis\n * @param {vec3} out The receiving vec3\n * @param {vec3} a The vec3 point to rotate\n * @param {vec3} b The origin of the rotation\n * @param {Number} c The angle of rotation\n * @returns {vec3} out\n */\nvec3.rotateX = function(out, a, b, c){\n var p = [], r=[];\n\t //Translate point to the origin\n\t p[0] = a[0] - b[0];\n\t p[1] = a[1] - b[1];\n \tp[2] = a[2] - b[2];\n\n\t //perform rotation\n\t r[0] = p[0];\n\t r[1] = p[1]*Math.cos(c) - p[2]*Math.sin(c);\n\t r[2] = p[1]*Math.sin(c) + p[2]*Math.cos(c);\n\n\t //translate to correct position\n\t out[0] = r[0] + b[0];\n\t out[1] = r[1] + b[1];\n\t out[2] = r[2] + b[2];\n\n \treturn out;\n};\n\n/**\n * Rotate a 3D vector around the y-axis\n * @param {vec3} out The receiving vec3\n * @param {vec3} a The vec3 point to rotate\n * @param {vec3} b The origin of the rotation\n * @param {Number} c The angle of rotation\n * @returns {vec3} out\n */\nvec3.rotateY = function(out, a, b, c){\n \tvar p = [], r=[];\n \t//Translate point to the origin\n \tp[0] = a[0] - b[0];\n \tp[1] = a[1] - b[1];\n \tp[2] = a[2] - b[2];\n \n \t//perform rotation\n \tr[0] = p[2]*Math.sin(c) + p[0]*Math.cos(c);\n \tr[1] = p[1];\n \tr[2] = p[2]*Math.cos(c) - p[0]*Math.sin(c);\n \n \t//translate to correct position\n \tout[0] = r[0] + b[0];\n \tout[1] = r[1] + b[1];\n \tout[2] = r[2] + b[2];\n \n \treturn out;\n};\n\n/**\n * Rotate a 3D vector around the z-axis\n * @param {vec3} out The receiving vec3\n * @param {vec3} a The vec3 point to rotate\n * @param {vec3} b The origin of the rotation\n * @param {Number} c The angle of rotation\n * @returns {vec3} out\n */\nvec3.rotateZ = function(out, a, b, c){\n \tvar p = [], r=[];\n \t//Translate point to the origin\n \tp[0] = a[0] - b[0];\n \tp[1] = a[1] - b[1];\n \tp[2] = a[2] - b[2];\n \n \t//perform rotation\n \tr[0] = p[0]*Math.cos(c) - p[1]*Math.sin(c);\n \tr[1] = p[0]*Math.sin(c) + p[1]*Math.cos(c);\n \tr[2] = p[2];\n \n \t//translate to correct position\n \tout[0] = r[0] + b[0];\n \tout[1] = r[1] + b[1];\n \tout[2] = r[2] + b[2];\n \n \treturn out;\n};\n\n/**\n * Perform some operation over an array of vec3s.\n *\n * @param {Array} a the array of vectors to iterate over\n * @param {Number} stride Number of elements between the start of each vec3. If 0 assumes tightly packed\n * @param {Number} offset Number of elements to skip at the beginning of the array\n * @param {Number} count Number of vec3s to iterate over. If 0 iterates over entire array\n * @param {Function} fn Function to call for each vector in the array\n * @param {Object} [arg] additional argument to pass to fn\n * @returns {Array} a\n * @function\n */\nvec3.forEach = (function() {\n var vec = vec3.create();\n\n return function(a, stride, offset, count, fn, arg) {\n var i, l;\n if(!stride) {\n stride = 3;\n }\n\n if(!offset) {\n offset = 0;\n }\n \n if(count) {\n l = Math.min((count * stride) + offset, a.length);\n } else {\n l = a.length;\n }\n\n for(i = offset; i < l; i += stride) {\n vec[0] = a[i]; vec[1] = a[i+1]; vec[2] = a[i+2];\n fn(vec, vec, arg);\n a[i] = vec[0]; a[i+1] = vec[1]; a[i+2] = vec[2];\n }\n \n return a;\n };\n})();\n\n/**\n * Get the angle between two 3D vectors\n * @param {vec3} a The first operand\n * @param {vec3} b The second operand\n * @returns {Number} The angle in radians\n */\nvec3.angle = function(a, b) {\n \n var tempA = vec3.fromValues(a[0], a[1], a[2]);\n var tempB = vec3.fromValues(b[0], b[1], b[2]);\n \n vec3.normalize(tempA, tempA);\n vec3.normalize(tempB, tempB);\n \n var cosine = vec3.dot(tempA, tempB);\n\n if(cosine > 1.0){\n return 0;\n } else {\n return Math.acos(cosine);\n } \n};\n\n/**\n * Returns a string representation of a vector\n *\n * @param {vec3} vec vector to represent as a string\n * @returns {String} string representation of the vector\n */\nvec3.str = function (a) {\n return 'vec3(' + a[0] + ', ' + a[1] + ', ' + a[2] + ')';\n};\n\nmodule.exports = vec3;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/gl-matrix/src/gl-matrix/vec3.js\n ** module id = 16\n ** module chunks = 0\n **/","/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE. */\n\nvar glMatrix = require(\"./common.js\");\n\n/**\n * @class 4 Dimensional Vector\n * @name vec4\n */\nvar vec4 = {};\n\n/**\n * Creates a new, empty vec4\n *\n * @returns {vec4} a new 4D vector\n */\nvec4.create = function() {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n return out;\n};\n\n/**\n * Creates a new vec4 initialized with values from an existing vector\n *\n * @param {vec4} a vector to clone\n * @returns {vec4} a new 4D vector\n */\nvec4.clone = function(a) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n};\n\n/**\n * Creates a new vec4 initialized with the given values\n *\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @param {Number} w W component\n * @returns {vec4} a new 4D vector\n */\nvec4.fromValues = function(x, y, z, w) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n};\n\n/**\n * Copy the values from one vec4 to another\n *\n * @param {vec4} out the receiving vector\n * @param {vec4} a the source vector\n * @returns {vec4} out\n */\nvec4.copy = function(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n};\n\n/**\n * Set the components of a vec4 to the given values\n *\n * @param {vec4} out the receiving vector\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @param {Number} w W component\n * @returns {vec4} out\n */\nvec4.set = function(out, x, y, z, w) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n};\n\n/**\n * Adds two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {vec4} a the first operand\n * @param {vec4} b the second operand\n * @returns {vec4} out\n */\nvec4.add = function(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n};\n\n/**\n * Subtracts vector b from vector a\n *\n * @param {vec4} out the receiving vector\n * @param {vec4} a the first operand\n * @param {vec4} b the second operand\n * @returns {vec4} out\n */\nvec4.subtract = function(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n};\n\n/**\n * Alias for {@link vec4.subtract}\n * @function\n */\nvec4.sub = vec4.subtract;\n\n/**\n * Multiplies two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {vec4} a the first operand\n * @param {vec4} b the second operand\n * @returns {vec4} out\n */\nvec4.multiply = function(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n out[3] = a[3] * b[3];\n return out;\n};\n\n/**\n * Alias for {@link vec4.multiply}\n * @function\n */\nvec4.mul = vec4.multiply;\n\n/**\n * Divides two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {vec4} a the first operand\n * @param {vec4} b the second operand\n * @returns {vec4} out\n */\nvec4.divide = function(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n out[3] = a[3] / b[3];\n return out;\n};\n\n/**\n * Alias for {@link vec4.divide}\n * @function\n */\nvec4.div = vec4.divide;\n\n/**\n * Returns the minimum of two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {vec4} a the first operand\n * @param {vec4} b the second operand\n * @returns {vec4} out\n */\nvec4.min = function(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n out[3] = Math.min(a[3], b[3]);\n return out;\n};\n\n/**\n * Returns the maximum of two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {vec4} a the first operand\n * @param {vec4} b the second operand\n * @returns {vec4} out\n */\nvec4.max = function(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n out[3] = Math.max(a[3], b[3]);\n return out;\n};\n\n/**\n * Scales a vec4 by a scalar number\n *\n * @param {vec4} out the receiving vector\n * @param {vec4} a the vector to scale\n * @param {Number} b amount to scale the vector by\n * @returns {vec4} out\n */\nvec4.scale = function(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n};\n\n/**\n * Adds two vec4's after scaling the second operand by a scalar value\n *\n * @param {vec4} out the receiving vector\n * @param {vec4} a the first operand\n * @param {vec4} b the second operand\n * @param {Number} scale the amount to scale b by before adding\n * @returns {vec4} out\n */\nvec4.scaleAndAdd = function(out, a, b, scale) {\n out[0] = a[0] + (b[0] * scale);\n out[1] = a[1] + (b[1] * scale);\n out[2] = a[2] + (b[2] * scale);\n out[3] = a[3] + (b[3] * scale);\n return out;\n};\n\n/**\n * Calculates the euclidian distance between two vec4's\n *\n * @param {vec4} a the first operand\n * @param {vec4} b the second operand\n * @returns {Number} distance between a and b\n */\nvec4.distance = function(a, b) {\n var x = b[0] - a[0],\n y = b[1] - a[1],\n z = b[2] - a[2],\n w = b[3] - a[3];\n return Math.sqrt(x*x + y*y + z*z + w*w);\n};\n\n/**\n * Alias for {@link vec4.distance}\n * @function\n */\nvec4.dist = vec4.distance;\n\n/**\n * Calculates the squared euclidian distance between two vec4's\n *\n * @param {vec4} a the first operand\n * @param {vec4} b the second operand\n * @returns {Number} squared distance between a and b\n */\nvec4.squaredDistance = function(a, b) {\n var x = b[0] - a[0],\n y = b[1] - a[1],\n z = b[2] - a[2],\n w = b[3] - a[3];\n return x*x + y*y + z*z + w*w;\n};\n\n/**\n * Alias for {@link vec4.squaredDistance}\n * @function\n */\nvec4.sqrDist = vec4.squaredDistance;\n\n/**\n * Calculates the length of a vec4\n *\n * @param {vec4} a vector to calculate length of\n * @returns {Number} length of a\n */\nvec4.length = function (a) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n return Math.sqrt(x*x + y*y + z*z + w*w);\n};\n\n/**\n * Alias for {@link vec4.length}\n * @function\n */\nvec4.len = vec4.length;\n\n/**\n * Calculates the squared length of a vec4\n *\n * @param {vec4} a vector to calculate squared length of\n * @returns {Number} squared length of a\n */\nvec4.squaredLength = function (a) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n return x*x + y*y + z*z + w*w;\n};\n\n/**\n * Alias for {@link vec4.squaredLength}\n * @function\n */\nvec4.sqrLen = vec4.squaredLength;\n\n/**\n * Negates the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {vec4} a vector to negate\n * @returns {vec4} out\n */\nvec4.negate = function(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = -a[3];\n return out;\n};\n\n/**\n * Returns the inverse of the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {vec4} a vector to invert\n * @returns {vec4} out\n */\nvec4.inverse = function(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n out[2] = 1.0 / a[2];\n out[3] = 1.0 / a[3];\n return out;\n};\n\n/**\n * Normalize a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {vec4} a vector to normalize\n * @returns {vec4} out\n */\nvec4.normalize = function(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n var len = x*x + y*y + z*z + w*w;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n out[0] = x * len;\n out[1] = y * len;\n out[2] = z * len;\n out[3] = w * len;\n }\n return out;\n};\n\n/**\n * Calculates the dot product of two vec4's\n *\n * @param {vec4} a the first operand\n * @param {vec4} b the second operand\n * @returns {Number} dot product of a and b\n */\nvec4.dot = function (a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n};\n\n/**\n * Performs a linear interpolation between two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {vec4} a the first operand\n * @param {vec4} b the second operand\n * @param {Number} t interpolation amount between the two inputs\n * @returns {vec4} out\n */\nvec4.lerp = function (out, a, b, t) {\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n out[3] = aw + t * (b[3] - aw);\n return out;\n};\n\n/**\n * Generates a random vector with the given scale\n *\n * @param {vec4} out the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns {vec4} out\n */\nvec4.random = function (out, scale) {\n scale = scale || 1.0;\n\n //TODO: This is a pretty awful way of doing this. Find something better.\n out[0] = glMatrix.RANDOM();\n out[1] = glMatrix.RANDOM();\n out[2] = glMatrix.RANDOM();\n out[3] = glMatrix.RANDOM();\n vec4.normalize(out, out);\n vec4.scale(out, out, scale);\n return out;\n};\n\n/**\n * Transforms the vec4 with a mat4.\n *\n * @param {vec4} out the receiving vector\n * @param {vec4} a the vector to transform\n * @param {mat4} m matrix to transform with\n * @returns {vec4} out\n */\nvec4.transformMat4 = function(out, a, m) {\n var x = a[0], y = a[1], z = a[2], w = a[3];\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n return out;\n};\n\n/**\n * Transforms the vec4 with a quat\n *\n * @param {vec4} out the receiving vector\n * @param {vec4} a the vector to transform\n * @param {quat} q quaternion to transform with\n * @returns {vec4} out\n */\nvec4.transformQuat = function(out, a, q) {\n var x = a[0], y = a[1], z = a[2],\n qx = q[0], qy = q[1], qz = q[2], qw = q[3],\n\n // calculate quat * vec\n ix = qw * x + qy * z - qz * y,\n iy = qw * y + qz * x - qx * z,\n iz = qw * z + qx * y - qy * x,\n iw = -qx * x - qy * y - qz * z;\n\n // calculate result * inverse quat\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n out[3] = a[3];\n return out;\n};\n\n/**\n * Perform some operation over an array of vec4s.\n *\n * @param {Array} a the array of vectors to iterate over\n * @param {Number} stride Number of elements between the start of each vec4. If 0 assumes tightly packed\n * @param {Number} offset Number of elements to skip at the beginning of the array\n * @param {Number} count Number of vec4s to iterate over. If 0 iterates over entire array\n * @param {Function} fn Function to call for each vector in the array\n * @param {Object} [arg] additional argument to pass to fn\n * @returns {Array} a\n * @function\n */\nvec4.forEach = (function() {\n var vec = vec4.create();\n\n return function(a, stride, offset, count, fn, arg) {\n var i, l;\n if(!stride) {\n stride = 4;\n }\n\n if(!offset) {\n offset = 0;\n }\n \n if(count) {\n l = Math.min((count * stride) + offset, a.length);\n } else {\n l = a.length;\n }\n\n for(i = offset; i < l; i += stride) {\n vec[0] = a[i]; vec[1] = a[i+1]; vec[2] = a[i+2]; vec[3] = a[i+3];\n fn(vec, vec, arg);\n a[i] = vec[0]; a[i+1] = vec[1]; a[i+2] = vec[2]; a[i+3] = vec[3];\n }\n \n return a;\n };\n})();\n\n/**\n * Returns a string representation of a vector\n *\n * @param {vec4} vec vector to represent as a string\n * @returns {String} string representation of the vector\n */\nvec4.str = function (a) {\n return 'vec4(' + a[0] + ', ' + a[1] + ', ' + a[2] + ', ' + a[3] + ')';\n};\n\nmodule.exports = vec4;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/gl-matrix/src/gl-matrix/vec4.js\n ** module id = 17\n ** module chunks = 0\n **/","/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE. */\n\nvar glMatrix = require(\"./common.js\");\n\n/**\n * @class 2 Dimensional Vector\n * @name vec2\n */\nvar vec2 = {};\n\n/**\n * Creates a new, empty vec2\n *\n * @returns {vec2} a new 2D vector\n */\nvec2.create = function() {\n var out = new glMatrix.ARRAY_TYPE(2);\n out[0] = 0;\n out[1] = 0;\n return out;\n};\n\n/**\n * Creates a new vec2 initialized with values from an existing vector\n *\n * @param {vec2} a vector to clone\n * @returns {vec2} a new 2D vector\n */\nvec2.clone = function(a) {\n var out = new glMatrix.ARRAY_TYPE(2);\n out[0] = a[0];\n out[1] = a[1];\n return out;\n};\n\n/**\n * Creates a new vec2 initialized with the given values\n *\n * @param {Number} x X component\n * @param {Number} y Y component\n * @returns {vec2} a new 2D vector\n */\nvec2.fromValues = function(x, y) {\n var out = new glMatrix.ARRAY_TYPE(2);\n out[0] = x;\n out[1] = y;\n return out;\n};\n\n/**\n * Copy the values from one vec2 to another\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a the source vector\n * @returns {vec2} out\n */\nvec2.copy = function(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n return out;\n};\n\n/**\n * Set the components of a vec2 to the given values\n *\n * @param {vec2} out the receiving vector\n * @param {Number} x X component\n * @param {Number} y Y component\n * @returns {vec2} out\n */\nvec2.set = function(out, x, y) {\n out[0] = x;\n out[1] = y;\n return out;\n};\n\n/**\n * Adds two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a the first operand\n * @param {vec2} b the second operand\n * @returns {vec2} out\n */\nvec2.add = function(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n return out;\n};\n\n/**\n * Subtracts vector b from vector a\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a the first operand\n * @param {vec2} b the second operand\n * @returns {vec2} out\n */\nvec2.subtract = function(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n return out;\n};\n\n/**\n * Alias for {@link vec2.subtract}\n * @function\n */\nvec2.sub = vec2.subtract;\n\n/**\n * Multiplies two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a the first operand\n * @param {vec2} b the second operand\n * @returns {vec2} out\n */\nvec2.multiply = function(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n return out;\n};\n\n/**\n * Alias for {@link vec2.multiply}\n * @function\n */\nvec2.mul = vec2.multiply;\n\n/**\n * Divides two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a the first operand\n * @param {vec2} b the second operand\n * @returns {vec2} out\n */\nvec2.divide = function(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n return out;\n};\n\n/**\n * Alias for {@link vec2.divide}\n * @function\n */\nvec2.div = vec2.divide;\n\n/**\n * Returns the minimum of two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a the first operand\n * @param {vec2} b the second operand\n * @returns {vec2} out\n */\nvec2.min = function(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n return out;\n};\n\n/**\n * Returns the maximum of two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a the first operand\n * @param {vec2} b the second operand\n * @returns {vec2} out\n */\nvec2.max = function(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n return out;\n};\n\n/**\n * Scales a vec2 by a scalar number\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a the vector to scale\n * @param {Number} b amount to scale the vector by\n * @returns {vec2} out\n */\nvec2.scale = function(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n return out;\n};\n\n/**\n * Adds two vec2's after scaling the second operand by a scalar value\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a the first operand\n * @param {vec2} b the second operand\n * @param {Number} scale the amount to scale b by before adding\n * @returns {vec2} out\n */\nvec2.scaleAndAdd = function(out, a, b, scale) {\n out[0] = a[0] + (b[0] * scale);\n out[1] = a[1] + (b[1] * scale);\n return out;\n};\n\n/**\n * Calculates the euclidian distance between two vec2's\n *\n * @param {vec2} a the first operand\n * @param {vec2} b the second operand\n * @returns {Number} distance between a and b\n */\nvec2.distance = function(a, b) {\n var x = b[0] - a[0],\n y = b[1] - a[1];\n return Math.sqrt(x*x + y*y);\n};\n\n/**\n * Alias for {@link vec2.distance}\n * @function\n */\nvec2.dist = vec2.distance;\n\n/**\n * Calculates the squared euclidian distance between two vec2's\n *\n * @param {vec2} a the first operand\n * @param {vec2} b the second operand\n * @returns {Number} squared distance between a and b\n */\nvec2.squaredDistance = function(a, b) {\n var x = b[0] - a[0],\n y = b[1] - a[1];\n return x*x + y*y;\n};\n\n/**\n * Alias for {@link vec2.squaredDistance}\n * @function\n */\nvec2.sqrDist = vec2.squaredDistance;\n\n/**\n * Calculates the length of a vec2\n *\n * @param {vec2} a vector to calculate length of\n * @returns {Number} length of a\n */\nvec2.length = function (a) {\n var x = a[0],\n y = a[1];\n return Math.sqrt(x*x + y*y);\n};\n\n/**\n * Alias for {@link vec2.length}\n * @function\n */\nvec2.len = vec2.length;\n\n/**\n * Calculates the squared length of a vec2\n *\n * @param {vec2} a vector to calculate squared length of\n * @returns {Number} squared length of a\n */\nvec2.squaredLength = function (a) {\n var x = a[0],\n y = a[1];\n return x*x + y*y;\n};\n\n/**\n * Alias for {@link vec2.squaredLength}\n * @function\n */\nvec2.sqrLen = vec2.squaredLength;\n\n/**\n * Negates the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a vector to negate\n * @returns {vec2} out\n */\nvec2.negate = function(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n return out;\n};\n\n/**\n * Returns the inverse of the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a vector to invert\n * @returns {vec2} out\n */\nvec2.inverse = function(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n return out;\n};\n\n/**\n * Normalize a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a vector to normalize\n * @returns {vec2} out\n */\nvec2.normalize = function(out, a) {\n var x = a[0],\n y = a[1];\n var len = x*x + y*y;\n if (len > 0) {\n //TODO: evaluate use of glm_invsqrt here?\n len = 1 / Math.sqrt(len);\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n }\n return out;\n};\n\n/**\n * Calculates the dot product of two vec2's\n *\n * @param {vec2} a the first operand\n * @param {vec2} b the second operand\n * @returns {Number} dot product of a and b\n */\nvec2.dot = function (a, b) {\n return a[0] * b[0] + a[1] * b[1];\n};\n\n/**\n * Computes the cross product of two vec2's\n * Note that the cross product must by definition produce a 3D vector\n *\n * @param {vec3} out the receiving vector\n * @param {vec2} a the first operand\n * @param {vec2} b the second operand\n * @returns {vec3} out\n */\nvec2.cross = function(out, a, b) {\n var z = a[0] * b[1] - a[1] * b[0];\n out[0] = out[1] = 0;\n out[2] = z;\n return out;\n};\n\n/**\n * Performs a linear interpolation between two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a the first operand\n * @param {vec2} b the second operand\n * @param {Number} t interpolation amount between the two inputs\n * @returns {vec2} out\n */\nvec2.lerp = function (out, a, b, t) {\n var ax = a[0],\n ay = a[1];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n return out;\n};\n\n/**\n * Generates a random vector with the given scale\n *\n * @param {vec2} out the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns {vec2} out\n */\nvec2.random = function (out, scale) {\n scale = scale || 1.0;\n var r = glMatrix.RANDOM() * 2.0 * Math.PI;\n out[0] = Math.cos(r) * scale;\n out[1] = Math.sin(r) * scale;\n return out;\n};\n\n/**\n * Transforms the vec2 with a mat2\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a the vector to transform\n * @param {mat2} m matrix to transform with\n * @returns {vec2} out\n */\nvec2.transformMat2 = function(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[2] * y;\n out[1] = m[1] * x + m[3] * y;\n return out;\n};\n\n/**\n * Transforms the vec2 with a mat2d\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a the vector to transform\n * @param {mat2d} m matrix to transform with\n * @returns {vec2} out\n */\nvec2.transformMat2d = function(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[2] * y + m[4];\n out[1] = m[1] * x + m[3] * y + m[5];\n return out;\n};\n\n/**\n * Transforms the vec2 with a mat3\n * 3rd vector component is implicitly '1'\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a the vector to transform\n * @param {mat3} m matrix to transform with\n * @returns {vec2} out\n */\nvec2.transformMat3 = function(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[3] * y + m[6];\n out[1] = m[1] * x + m[4] * y + m[7];\n return out;\n};\n\n/**\n * Transforms the vec2 with a mat4\n * 3rd vector component is implicitly '0'\n * 4th vector component is implicitly '1'\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a the vector to transform\n * @param {mat4} m matrix to transform with\n * @returns {vec2} out\n */\nvec2.transformMat4 = function(out, a, m) {\n var x = a[0], \n y = a[1];\n out[0] = m[0] * x + m[4] * y + m[12];\n out[1] = m[1] * x + m[5] * y + m[13];\n return out;\n};\n\n/**\n * Perform some operation over an array of vec2s.\n *\n * @param {Array} a the array of vectors to iterate over\n * @param {Number} stride Number of elements between the start of each vec2. If 0 assumes tightly packed\n * @param {Number} offset Number of elements to skip at the beginning of the array\n * @param {Number} count Number of vec2s to iterate over. If 0 iterates over entire array\n * @param {Function} fn Function to call for each vector in the array\n * @param {Object} [arg] additional argument to pass to fn\n * @returns {Array} a\n * @function\n */\nvec2.forEach = (function() {\n var vec = vec2.create();\n\n return function(a, stride, offset, count, fn, arg) {\n var i, l;\n if(!stride) {\n stride = 2;\n }\n\n if(!offset) {\n offset = 0;\n }\n \n if(count) {\n l = Math.min((count * stride) + offset, a.length);\n } else {\n l = a.length;\n }\n\n for(i = offset; i < l; i += stride) {\n vec[0] = a[i]; vec[1] = a[i+1];\n fn(vec, vec, arg);\n a[i] = vec[0]; a[i+1] = vec[1];\n }\n \n return a;\n };\n})();\n\n/**\n * Returns a string representation of a vector\n *\n * @param {vec2} vec vector to represent as a string\n * @returns {String} string representation of the vector\n */\nvec2.str = function (a) {\n return 'vec2(' + a[0] + ', ' + a[1] + ')';\n};\n\nmodule.exports = vec2;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/gl-matrix/src/gl-matrix/vec2.js\n ** module id = 18\n ** module chunks = 0\n **/","export default {\n init : function(arr, val) {\n var l = arr.length;\n while (l--) {\n arr[l] = val;\n }\n },\n\n /**\n * Shuffles the content of an array\n * @return {Array} the array itself shuffled\n */\n shuffle : function(arr) {\n var i = arr.length - 1, j, x;\n for (i; i >= 0; i--) {\n j = Math.floor(Math.random() * i);\n x = arr[i];\n arr[i] = arr[j];\n arr[j] = x;\n }\n return arr;\n },\n\n toPointList : function(arr) {\n var i, j, row = [], rows = [];\n for ( i = 0; i < arr.length; i++) {\n row = [];\n for ( j = 0; j < arr[i].length; j++) {\n row[j] = arr[i][j];\n }\n rows[i] = \"[\" + row.join(\",\") + \"]\";\n }\n return \"[\" + rows.join(\",\\r\\n\") + \"]\";\n },\n\n /**\n * returns the elements which's score is bigger than the threshold\n * @return {Array} the reduced array\n */\n threshold : function(arr, threshold, scoreFunc) {\n var i, queue = [];\n for ( i = 0; i < arr.length; i++) {\n if (scoreFunc.apply(arr, [arr[i]]) >= threshold) {\n queue.push(arr[i]);\n }\n }\n return queue;\n },\n\n maxIndex : function(arr) {\n var i, max = 0;\n for ( i = 0; i < arr.length; i++) {\n if (arr[i] > arr[max]) {\n max = i;\n }\n }\n return max;\n },\n\n max : function(arr) {\n var i, max = 0;\n for ( i = 0; i < arr.length; i++) {\n if (arr[i] > max) {\n max = arr[i];\n }\n }\n return max;\n },\n\n sum: function(arr) {\n var length = arr.length,\n sum = 0;\n\n while(length--) {\n sum += arr[length];\n }\n return sum;\n }\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/array_helper.js\n **/","/* jshint undef: true, unused: true, browser:true, devel: true */\n/* global define */\n\nimport ImageWrapper from './image_wrapper';\nimport CVUtils from './cv_utils';\nimport Rasterizer from './rasterizer';\nimport Tracer from './tracer';\nimport skeletonizer from './skeletonizer';\nimport ArrayHelper from './array_helper';\nimport ImageDebug from './image_debug';\nimport glMatrix from 'gl-matrix';\n\nvar _config,\n _currentImageWrapper,\n _skelImageWrapper,\n _subImageWrapper,\n _labelImageWrapper,\n _patchGrid,\n _patchLabelGrid,\n _imageToPatchGrid,\n _binaryImageWrapper,\n _patchSize,\n _canvasContainer = {\n ctx : {\n binary : null\n },\n dom : {\n binary : null\n }\n },\n _numPatches = {x: 0, y: 0},\n _inputImageWrapper,\n _skeletonizer,\n vec2 = glMatrix.vec2,\n mat2 = glMatrix.mat2,\n self = (typeof window !== 'undefined') ? window : self;\n\nfunction initBuffers() {\n var skeletonImageData;\n\n if (_config.halfSample) {\n _currentImageWrapper = new ImageWrapper({\n x : _inputImageWrapper.size.x / 2 | 0,\n y : _inputImageWrapper.size.y / 2 | 0\n });\n } else {\n _currentImageWrapper = _inputImageWrapper;\n }\n\n _patchSize = CVUtils.calculatePatchSize(_config.patchSize, _currentImageWrapper.size);\n\n _numPatches.x = _currentImageWrapper.size.x / _patchSize.x | 0;\n _numPatches.y = _currentImageWrapper.size.y / _patchSize.y | 0;\n\n _binaryImageWrapper = new ImageWrapper(_currentImageWrapper.size, undefined, Uint8Array, false);\n\n _labelImageWrapper = new ImageWrapper(_patchSize, undefined, Array, true);\n\n skeletonImageData = new ArrayBuffer(64*1024);\n _subImageWrapper = new ImageWrapper(_patchSize, new Uint8Array(skeletonImageData, 0, _patchSize.x * _patchSize.y));\n _skelImageWrapper = new ImageWrapper(_patchSize, new Uint8Array(skeletonImageData, _patchSize.x * _patchSize.y * 3, _patchSize.x * _patchSize.y), undefined, true);\n _skeletonizer = skeletonizer(self, {\n size : _patchSize.x\n }, skeletonImageData);\n\n _imageToPatchGrid = new ImageWrapper({\n x : (_currentImageWrapper.size.x / _subImageWrapper.size.x) | 0,\n y : (_currentImageWrapper.size.y / _subImageWrapper.size.y) | 0\n }, undefined, Array, true);\n _patchGrid = new ImageWrapper(_imageToPatchGrid.size, undefined, undefined, true);\n _patchLabelGrid = new ImageWrapper(_imageToPatchGrid.size, undefined, Int32Array, true);\n}\n\nfunction initCanvas() {\n if (_config.useWorker || typeof document === 'undefined') {\n return;\n }\n _canvasContainer.dom.binary = document.createElement(\"canvas\");\n _canvasContainer.dom.binary.className = \"binaryBuffer\";\n if (_config.showCanvas === true) {\n document.querySelector(\"#debug\").appendChild(_canvasContainer.dom.binary);\n }\n _canvasContainer.ctx.binary = _canvasContainer.dom.binary.getContext(\"2d\");\n _canvasContainer.dom.binary.width = _binaryImageWrapper.size.x;\n _canvasContainer.dom.binary.height = _binaryImageWrapper.size.y;\n}\n\n/**\n * Creates a bounding box which encloses all the given patches\n * @returns {Array} The minimal bounding box\n */\nfunction boxFromPatches(patches) {\n var overAvg, i, j, patch, transMat, minx = _binaryImageWrapper.size.x, miny = _binaryImageWrapper.size.y, maxx = -_binaryImageWrapper.size.x, maxy = -_binaryImageWrapper.size.y, box, scale;\n\n // draw all patches which are to be taken into consideration\n overAvg = 0;\n for ( i = 0; i < patches.length; i++) {\n patch = patches[i];\n overAvg += patch.rad;\n if (_config.showPatches) {\n ImageDebug.drawRect(patch.pos, _subImageWrapper.size, _canvasContainer.ctx.binary, {color: \"red\"});\n }\n }\n\n overAvg /= patches.length;\n overAvg = (overAvg * 180 / Math.PI + 90) % 180 - 90;\n if (overAvg < 0) {\n overAvg += 180;\n }\n\n overAvg = (180 - overAvg) * Math.PI / 180;\n transMat = mat2.clone([Math.cos(overAvg), Math.sin(overAvg), -Math.sin(overAvg), Math.cos(overAvg)]);\n\n // iterate over patches and rotate by angle\n for ( i = 0; i < patches.length; i++) {\n patch = patches[i];\n for ( j = 0; j < 4; j++) {\n vec2.transformMat2(patch.box[j], patch.box[j], transMat);\n }\n\n if (_config.boxFromPatches.showTransformed) {\n ImageDebug.drawPath(patch.box, {x: 0, y: 1}, _canvasContainer.ctx.binary, {color: '#99ff00', lineWidth: 2});\n }\n }\n\n // find bounding box\n for ( i = 0; i < patches.length; i++) {\n patch = patches[i];\n for ( j = 0; j < 4; j++) {\n if (patch.box[j][0] < minx) {\n minx = patch.box[j][0];\n }\n if (patch.box[j][0] > maxx) {\n maxx = patch.box[j][0];\n }\n if (patch.box[j][1] < miny) {\n miny = patch.box[j][1];\n }\n if (patch.box[j][1] > maxy) {\n maxy = patch.box[j][1];\n }\n }\n }\n\n box = [[minx, miny], [maxx, miny], [maxx, maxy], [minx, maxy]];\n\n if (_config.boxFromPatches.showTransformedBox) {\n ImageDebug.drawPath(box, {x: 0, y: 1}, _canvasContainer.ctx.binary, {color: '#ff0000', lineWidth: 2});\n }\n\n scale = _config.halfSample ? 2 : 1;\n // reverse rotation;\n transMat = mat2.invert(transMat, transMat);\n for ( j = 0; j < 4; j++) {\n vec2.transformMat2(box[j], box[j], transMat);\n }\n\n if (_config.boxFromPatches.showBB) {\n ImageDebug.drawPath(box, {x: 0, y: 1}, _canvasContainer.ctx.binary, {color: '#ff0000', lineWidth: 2});\n }\n\n for ( j = 0; j < 4; j++) {\n vec2.scale(box[j], box[j], scale);\n }\n\n return box;\n}\n\n/**\n * Creates a binary image of the current image\n */\nfunction binarizeImage() {\n CVUtils.otsuThreshold(_currentImageWrapper, _binaryImageWrapper);\n _binaryImageWrapper.zeroBorder();\n if (_config.showCanvas) {\n _binaryImageWrapper.show(_canvasContainer.dom.binary, 255);\n }\n}\n\n/**\n * Iterate over the entire image\n * extract patches\n */\nfunction findPatches() {\n var i,\n j,\n x,\n y,\n moments,\n patchesFound = [],\n rasterizer,\n rasterResult,\n patch;\n for ( i = 0; i < _numPatches.x; i++) {\n for ( j = 0; j < _numPatches.y; j++) {\n\n x = _subImageWrapper.size.x * i;\n y = _subImageWrapper.size.y * j;\n\n // seperate parts\n skeletonize(x, y);\n\n // Rasterize, find individual bars\n _skelImageWrapper.zeroBorder();\n ArrayHelper.init(_labelImageWrapper.data, 0);\n rasterizer = Rasterizer.create(_skelImageWrapper, _labelImageWrapper);\n rasterResult = rasterizer.rasterize(0);\n\n if (_config.showLabels) {\n _labelImageWrapper.overlay(_canvasContainer.dom.binary, Math.floor(360 / rasterResult.count), {x : x, y : y});\n }\n\n // calculate moments from the skeletonized patch\n moments = _labelImageWrapper.moments(rasterResult.count);\n\n // extract eligible patches\n patchesFound = patchesFound.concat(describePatch(moments, [i, j], x, y));\n }\n }\n\n if (_config.showFoundPatches) {\n for ( i = 0; i < patchesFound.length; i++) {\n patch = patchesFound[i];\n ImageDebug.drawRect(patch.pos, _subImageWrapper.size, _canvasContainer.ctx.binary, {color: \"#99ff00\", lineWidth: 2});\n }\n }\n\n return patchesFound;\n}\n\n/**\n * Finds those connected areas which contain at least 6 patches\n * and returns them ordered DESC by the number of contained patches\n * @param {Number} maxLabel\n */\nfunction findBiggestConnectedAreas(maxLabel){\n var i,\n sum,\n labelHist = [],\n topLabels = [];\n\n for ( i = 0; i < maxLabel; i++) {\n labelHist.push(0);\n }\n sum = _patchLabelGrid.data.length;\n while (sum--) {\n if (_patchLabelGrid.data[sum] > 0) {\n labelHist[_patchLabelGrid.data[sum] - 1]++;\n }\n }\n\n labelHist = labelHist.map(function(val, idx) {\n return {\n val : val,\n label : idx + 1\n };\n });\n\n labelHist.sort(function(a, b) {\n return b.val - a.val;\n });\n\n // extract top areas with at least 6 patches present\n topLabels = labelHist.filter(function(el) {\n return el.val >= 5;\n });\n\n return topLabels;\n}\n\n/**\n *\n */\nfunction findBoxes(topLabels, maxLabel) {\n var i,\n j,\n sum,\n patches = [],\n patch,\n box,\n boxes = [],\n hsv = [0, 1, 1],\n rgb = [0, 0, 0];\n\n for ( i = 0; i < topLabels.length; i++) {\n sum = _patchLabelGrid.data.length;\n patches.length = 0;\n while (sum--) {\n if (_patchLabelGrid.data[sum] === topLabels[i].label) {\n patch = _imageToPatchGrid.data[sum];\n patches.push(patch);\n }\n }\n box = boxFromPatches(patches);\n if (box) {\n boxes.push(box);\n\n // draw patch-labels if requested\n if (_config.showRemainingPatchLabels) {\n for ( j = 0; j < patches.length; j++) {\n patch = patches[j];\n hsv[0] = (topLabels[i].label / (maxLabel + 1)) * 360;\n CVUtils.hsv2rgb(hsv, rgb);\n ImageDebug.drawRect(patch.pos, _subImageWrapper.size, _canvasContainer.ctx.binary, {color: \"rgb(\" + rgb.join(\",\") + \")\", lineWidth: 2});\n }\n }\n }\n }\n return boxes;\n}\n\n/**\n * Find similar moments (via cluster)\n * @param {Object} moments\n */\nfunction similarMoments(moments) {\n var clusters = CVUtils.cluster(moments, 0.90);\n var topCluster = CVUtils.topGeneric(clusters, 1, function(e) {\n return e.getPoints().length;\n });\n var points = [], result = [];\n if (topCluster.length === 1) {\n points = topCluster[0].item.getPoints();\n for (var i = 0; i < points.length; i++) {\n result.push(points[i].point);\n }\n }\n return result;\n}\n\nfunction skeletonize(x, y) {\n _binaryImageWrapper.subImageAsCopy(_subImageWrapper, CVUtils.imageRef(x, y));\n _skeletonizer.skeletonize();\n\n // Show skeleton if requested\n if (_config.showSkeleton) {\n _skelImageWrapper.overlay(_canvasContainer.dom.binary, 360, CVUtils.imageRef(x, y));\n }\n}\n\n/**\n * Extracts and describes those patches which seem to contain a barcode pattern\n * @param {Array} moments\n * @param {Object} patchPos,\n * @param {Number} x\n * @param {Number} y\n * @returns {Array} list of patches\n */\nfunction describePatch(moments, patchPos, x, y) {\n var k,\n avg,\n sum = 0,\n eligibleMoments = [],\n matchingMoments,\n patch,\n patchesFound = [],\n minComponentWeight = Math.ceil(_patchSize.x/3);\n\n if (moments.length >= 2) {\n // only collect moments which's area covers at least minComponentWeight pixels.\n for ( k = 0; k < moments.length; k++) {\n if (moments[k].m00 > minComponentWeight) {\n eligibleMoments.push(moments[k]);\n }\n }\n\n // if at least 2 moments are found which have at least minComponentWeights covered\n if (eligibleMoments.length >= 2) {\n sum = eligibleMoments.length;\n matchingMoments = similarMoments(eligibleMoments);\n avg = 0;\n // determine the similarity of the moments\n for ( k = 0; k < matchingMoments.length; k++) {\n avg += matchingMoments[k].rad;\n }\n\n // Only two of the moments are allowed not to fit into the equation\n // add the patch to the set\n if (matchingMoments.length > 1 && matchingMoments.length >= (eligibleMoments.length / 4) * 3 && matchingMoments.length > moments.length / 4) {\n avg /= matchingMoments.length;\n patch = {\n index : patchPos[1] * _numPatches.x + patchPos[0],\n pos : {\n x : x,\n y : y\n },\n box : [vec2.clone([x, y]), vec2.clone([x + _subImageWrapper.size.x, y]), vec2.clone([x + _subImageWrapper.size.x, y + _subImageWrapper.size.y]), vec2.clone([x, y + _subImageWrapper.size.y])],\n moments : matchingMoments,\n rad : avg,\n vec : vec2.clone([Math.cos(avg), Math.sin(avg)])\n };\n patchesFound.push(patch);\n }\n }\n }\n return patchesFound;\n}\n\n/**\n * finds patches which are connected and share the same orientation\n * @param {Object} patchesFound\n */\nfunction rasterizeAngularSimilarity(patchesFound) {\n var label = 0,\n threshold = 0.95,\n currIdx = 0,\n j,\n patch,\n hsv = [0, 1, 1],\n rgb = [0, 0, 0];\n\n function notYetProcessed() {\n var i;\n for ( i = 0; i < _patchLabelGrid.data.length; i++) {\n if (_patchLabelGrid.data[i] === 0 && _patchGrid.data[i] === 1) {\n return i;\n }\n }\n return _patchLabelGrid.length;\n }\n\n function trace(currentIdx) {\n var x, y, currentPatch, patch, idx, dir, current = {\n x : currentIdx % _patchLabelGrid.size.x,\n y : (currentIdx / _patchLabelGrid.size.x) | 0\n }, similarity;\n\n if (currentIdx < _patchLabelGrid.data.length) {\n currentPatch = _imageToPatchGrid.data[currentIdx];\n // assign label\n _patchLabelGrid.data[currentIdx] = label;\n for ( dir = 0; dir < Tracer.searchDirections.length; dir++) {\n y = current.y + Tracer.searchDirections[dir][0];\n x = current.x + Tracer.searchDirections[dir][1];\n idx = y * _patchLabelGrid.size.x + x;\n\n // continue if patch empty\n if (_patchGrid.data[idx] === 0) {\n _patchLabelGrid.data[idx] = Number.MAX_VALUE;\n continue;\n }\n\n patch = _imageToPatchGrid.data[idx];\n if (_patchLabelGrid.data[idx] === 0) {\n similarity = Math.abs(vec2.dot(patch.vec, currentPatch.vec));\n if (similarity > threshold) {\n trace(idx);\n }\n }\n }\n }\n }\n\n // prepare for finding the right patches\n ArrayHelper.init(_patchGrid.data, 0);\n ArrayHelper.init(_patchLabelGrid.data, 0);\n ArrayHelper.init(_imageToPatchGrid.data, null);\n\n for ( j = 0; j < patchesFound.length; j++) {\n patch = patchesFound[j];\n _imageToPatchGrid.data[patch.index] = patch;\n _patchGrid.data[patch.index] = 1;\n }\n\n // rasterize the patches found to determine area\n _patchGrid.zeroBorder();\n\n while (( currIdx = notYetProcessed()) < _patchLabelGrid.data.length) {\n label++;\n trace(currIdx);\n }\n\n // draw patch-labels if requested\n if (_config.showPatchLabels) {\n for ( j = 0; j < _patchLabelGrid.data.length; j++) {\n if (_patchLabelGrid.data[j] > 0 && _patchLabelGrid.data[j] <= label) {\n patch = _imageToPatchGrid.data[j];\n hsv[0] = (_patchLabelGrid.data[j] / (label + 1)) * 360;\n CVUtils.hsv2rgb(hsv, rgb);\n ImageDebug.drawRect(patch.pos, _subImageWrapper.size, _canvasContainer.ctx.binary, {color: \"rgb(\" + rgb.join(\",\") + \")\", lineWidth: 2});\n }\n }\n }\n\n return label;\n}\n\nexport default {\n init : function(inputImageWrapper, config) {\n _config = config;\n _inputImageWrapper = inputImageWrapper;\n\n initBuffers();\n initCanvas();\n },\n\n locate : function() {\n var patchesFound,\n topLabels,\n boxes;\n\n if (_config.halfSample) {\n CVUtils.halfSample(_inputImageWrapper, _currentImageWrapper);\n }\n\n binarizeImage();\n patchesFound = findPatches();\n // return unless 5% or more patches are found\n if (patchesFound.length < _numPatches.x * _numPatches.y * 0.05) {\n return null;\n }\n\n // rasterrize area by comparing angular similarity;\n var maxLabel = rasterizeAngularSimilarity(patchesFound);\n if (maxLabel < 1) {\n return null;\n }\n\n // search for area with the most patches (biggest connected area)\n topLabels = findBiggestConnectedAreas(maxLabel);\n if (topLabels.length === 0) {\n return null;\n }\n\n boxes = findBoxes(topLabels, maxLabel);\n return boxes;\n },\n\n checkImageConstraints: function(inputStream, config) {\n var patchSize,\n width = inputStream.getWidth(),\n height = inputStream.getHeight(),\n halfSample = config.halfSample ? 0.5 : 1,\n size,\n area;\n\n // calculate width and height based on area\n if (inputStream.getConfig().area) {\n area = CVUtils.computeImageArea(width, height, inputStream.getConfig().area);\n inputStream.setTopRight({x: area.sx, y: area.sy});\n inputStream.setCanvasSize({x: width, y: height});\n width = area.sw;\n height = area.sh;\n }\n\n size = {\n x: Math.floor(width * halfSample),\n y: Math.floor(height * halfSample)\n };\n\n patchSize = CVUtils.calculatePatchSize(config.patchSize, size);\n console.log(\"Patch-Size: \" + JSON.stringify(patchSize));\n\n inputStream.setWidth(Math.floor(Math.floor(size.x/patchSize.x)*(1/halfSample)*patchSize.x));\n inputStream.setHeight(Math.floor(Math.floor(size.y/patchSize.y)*(1/halfSample)*patchSize.y));\n\n if ((inputStream.getWidth() % patchSize.x) === 0 && (inputStream.getHeight() % patchSize.y) === 0) {\n return true;\n }\n\n throw new Error(\"Image dimensions do not comply with the current settings: Width (\" +\n width + \" )and height (\" + height +\n \") must a multiple of \" + patchSize.x);\n }\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/barcode_locator.js\n **/","import Tracer from './tracer';\n\n/**\n * http://www.codeproject.com/Tips/407172/Connected-Component-Labeling-and-Vectorization\n */\nvar Rasterizer = {\n createContour2D : function() {\n return {\n dir : null,\n index : null,\n firstVertex : null,\n insideContours : null,\n nextpeer : null,\n prevpeer : null\n };\n },\n CONTOUR_DIR : {\n CW_DIR : 0,\n CCW_DIR : 1,\n UNKNOWN_DIR : 2\n },\n DIR : {\n OUTSIDE_EDGE : -32767,\n INSIDE_EDGE : -32766\n },\n create : function(imageWrapper, labelWrapper) {\n var imageData = imageWrapper.data,\n labelData = labelWrapper.data,\n width = imageWrapper.size.x,\n height = imageWrapper.size.y,\n tracer = Tracer.create(imageWrapper, labelWrapper);\n\n return {\n rasterize : function(depthlabel) {\n var color,\n bc,\n lc,\n labelindex,\n cx,\n cy,\n colorMap = [],\n vertex,\n p,\n cc,\n sc,\n pos,\n connectedCount = 0,\n i;\n\n for ( i = 0; i < 400; i++) {\n colorMap[i] = 0;\n }\n\n colorMap[0] = imageData[0];\n cc = null;\n for ( cy = 1; cy < height - 1; cy++) {\n labelindex = 0;\n bc = colorMap[0];\n for ( cx = 1; cx < width - 1; cx++) {\n pos = cy * width + cx;\n if (labelData[pos] === 0) {\n color = imageData[pos];\n if (color !== bc) {\n if (labelindex === 0) {\n lc = connectedCount + 1;\n colorMap[lc] = color;\n bc = color;\n vertex = tracer.contourTracing(cy, cx, lc, color, Rasterizer.DIR.OUTSIDE_EDGE);\n if (vertex !== null) {\n connectedCount++;\n labelindex = lc;\n p = Rasterizer.createContour2D();\n p.dir = Rasterizer.CONTOUR_DIR.CW_DIR;\n p.index = labelindex;\n p.firstVertex = vertex;\n p.nextpeer = cc;\n p.insideContours = null;\n if (cc !== null) {\n cc.prevpeer = p;\n }\n cc = p;\n }\n } else {\n vertex = tracer.contourTracing(cy, cx, Rasterizer.DIR.INSIDE_EDGE, color, labelindex);\n if (vertex !== null) {\n p = Rasterizer.createContour2D();\n p.firstVertex = vertex;\n p.insideContours = null;\n if (depthlabel === 0) {\n p.dir = Rasterizer.CONTOUR_DIR.CCW_DIR;\n } else {\n p.dir = Rasterizer.CONTOUR_DIR.CW_DIR;\n }\n p.index = depthlabel;\n sc = cc;\n while ((sc !== null) && sc.index !== labelindex) {\n sc = sc.nextpeer;\n }\n if (sc !== null) {\n p.nextpeer = sc.insideContours;\n if (sc.insideContours !== null) {\n sc.insideContours.prevpeer = p;\n }\n sc.insideContours = p;\n }\n }\n }\n } else {\n labelData[pos] = labelindex;\n }\n } else if (labelData[pos] === Rasterizer.DIR.OUTSIDE_EDGE || labelData[pos] === Rasterizer.DIR.INSIDE_EDGE) {\n labelindex = 0;\n if (labelData[pos] === Rasterizer.DIR.INSIDE_EDGE) {\n bc = imageData[pos];\n } else {\n bc = colorMap[0];\n }\n } else {\n labelindex = labelData[pos];\n bc = colorMap[labelindex];\n }\n }\n }\n sc = cc;\n while (sc !== null) {\n sc.index = depthlabel;\n sc = sc.nextpeer;\n }\n return {\n cc : cc,\n count : connectedCount\n };\n },\n debug: {\n drawContour : function(canvas, firstContour) {\n var ctx = canvas.getContext(\"2d\"),\n pq = firstContour,\n iq,\n q,\n p;\n\n ctx.strokeStyle = \"red\";\n ctx.fillStyle = \"red\";\n ctx.lineWidth = 1;\n\n if (pq !== null) {\n iq = pq.insideContours;\n } else {\n iq = null;\n }\n\n while (pq !== null) {\n if (iq !== null) {\n q = iq;\n iq = iq.nextpeer;\n } else {\n q = pq;\n pq = pq.nextpeer;\n if (pq !== null) {\n iq = pq.insideContours;\n } else {\n iq = null;\n }\n }\n\n switch(q.dir) {\n case Rasterizer.CONTOUR_DIR.CW_DIR:\n ctx.strokeStyle = \"red\";\n break;\n case Rasterizer.CONTOUR_DIR.CCW_DIR:\n ctx.strokeStyle = \"blue\";\n break;\n case Rasterizer.CONTOUR_DIR.UNKNOWN_DIR:\n ctx.strokeStyle = \"green\";\n break;\n }\n\n p = q.firstVertex;\n ctx.beginPath();\n ctx.moveTo(p.x, p.y);\n do {\n p = p.next;\n ctx.lineTo(p.x, p.y);\n } while(p !== q.firstVertex);\n ctx.stroke();\n }\n }\n }\n };\n }\n};\n\nexport default Rasterizer;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/rasterizer.js\n **/","/**\n * http://www.codeproject.com/Tips/407172/Connected-Component-Labeling-and-Vectorization\n */\nvar Tracer = {\n searchDirections : [[0, 1], [1, 1], [1, 0], [1, -1], [0, -1], [-1, -1], [-1, 0], [-1, 1]],\n create : function(imageWrapper, labelWrapper) {\n var imageData = imageWrapper.data,\n labelData = labelWrapper.data,\n searchDirections = this.searchDirections,\n width = imageWrapper.size.x,\n pos;\n\n function trace(current, color, label, edgelabel) {\n var i,\n y,\n x;\n\n for ( i = 0; i < 7; i++) {\n y = current.cy + searchDirections[current.dir][0];\n x = current.cx + searchDirections[current.dir][1];\n pos = y * width + x;\n if ((imageData[pos] === color) && ((labelData[pos] === 0) || (labelData[pos] === label))) {\n labelData[pos] = label;\n current.cy = y;\n current.cx = x;\n return true;\n } else {\n if (labelData[pos] === 0) {\n labelData[pos] = edgelabel;\n }\n current.dir = (current.dir + 1) % 8;\n }\n }\n return false;\n }\n\n function vertex2D(x, y, dir) {\n return {\n dir : dir,\n x : x,\n y : y,\n next : null,\n prev : null\n };\n }\n\n function contourTracing(sy, sx, label, color, edgelabel) {\n var Fv = null,\n Cv,\n P,\n ldir,\n current = {\n cx : sx,\n cy : sy,\n dir : 0\n };\n\n if (trace(current, color, label, edgelabel)) {\n Fv = vertex2D(sx, sy, current.dir);\n Cv = Fv;\n ldir = current.dir;\n P = vertex2D(current.cx, current.cy, 0);\n P.prev = Cv;\n Cv.next = P;\n P.next = null;\n Cv = P;\n do {\n current.dir = (current.dir + 6) % 8;\n trace(current, color, label, edgelabel);\n if (ldir != current.dir) {\n Cv.dir = current.dir;\n P = vertex2D(current.cx, current.cy, 0);\n P.prev = Cv;\n Cv.next = P;\n P.next = null;\n Cv = P;\n } else {\n Cv.dir = ldir;\n Cv.x = current.cx;\n Cv.y = current.cy;\n }\n ldir = current.dir;\n } while(current.cx != sx || current.cy != sy);\n Fv.prev = Cv.prev;\n Cv.prev.next = Fv;\n }\n return Fv;\n }\n\n return {\n trace : function(current, color, label, edgelabel) {\n return trace(current, color, label, edgelabel);\n },\n contourTracing : function(sy, sx, label, color, edgelabel) {\n return contourTracing(sy, sx, label, color, edgelabel);\n }\n };\n }\n};\n\nexport default (Tracer);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/tracer.js\n **/","/* @preserve ASM BEGIN */\nfunction Skeletonizer(stdlib, foreign, buffer) {\n \"use asm\";\n\n var images = new stdlib.Uint8Array(buffer),\n size = foreign.size | 0,\n imul = stdlib.Math.imul;\n\n function erode(inImagePtr, outImagePtr) {\n inImagePtr = inImagePtr | 0;\n outImagePtr = outImagePtr | 0;\n\n var v = 0,\n u = 0,\n sum = 0,\n yStart1 = 0,\n yStart2 = 0,\n xStart1 = 0,\n xStart2 = 0,\n offset = 0;\n\n for ( v = 1; (v | 0) < ((size - 1) | 0); v = (v + 1) | 0) {\n offset = (offset + size) | 0;\n for ( u = 1; (u | 0) < ((size - 1) | 0); u = (u + 1) | 0) {\n yStart1 = (offset - size) | 0;\n yStart2 = (offset + size) | 0;\n xStart1 = (u - 1) | 0;\n xStart2 = (u + 1) | 0;\n 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;\n if ((sum | 0) == (5 | 0)) {\n images[(outImagePtr + offset + u) | 0] = 1;\n } else {\n images[(outImagePtr + offset + u) | 0] = 0;\n }\n }\n }\n return;\n }\n\n function subtract(aImagePtr, bImagePtr, outImagePtr) {\n aImagePtr = aImagePtr | 0;\n bImagePtr = bImagePtr | 0;\n outImagePtr = outImagePtr | 0;\n\n var length = 0;\n\n length = imul(size, size) | 0;\n\n while ((length | 0) > 0) {\n length = (length - 1) | 0;\n images[(outImagePtr + length) | 0] = ((images[(aImagePtr + length) | 0] | 0) - (images[(bImagePtr + length) | 0] | 0)) | 0;\n }\n }\n\n function bitwiseOr(aImagePtr, bImagePtr, outImagePtr) {\n aImagePtr = aImagePtr | 0;\n bImagePtr = bImagePtr | 0;\n outImagePtr = outImagePtr | 0;\n\n var length = 0;\n\n length = imul(size, size) | 0;\n\n while ((length | 0) > 0) {\n length = (length - 1) | 0;\n images[(outImagePtr + length) | 0] = ((images[(aImagePtr + length) | 0] | 0) | (images[(bImagePtr + length) | 0] | 0)) | 0;\n }\n }\n\n function countNonZero(imagePtr) {\n imagePtr = imagePtr | 0;\n\n var sum = 0,\n length = 0;\n\n length = imul(size, size) | 0;\n\n while ((length | 0) > 0) {\n length = (length - 1) | 0;\n sum = ((sum | 0) + (images[(imagePtr + length) | 0] | 0)) | 0;\n }\n\n return (sum | 0);\n }\n\n function init(imagePtr, value) {\n imagePtr = imagePtr | 0;\n value = value | 0;\n\n var length = 0;\n\n length = imul(size, size) | 0;\n\n while ((length | 0) > 0) {\n length = (length - 1) | 0;\n images[(imagePtr + length) | 0] = value;\n }\n }\n\n function dilate(inImagePtr, outImagePtr) {\n inImagePtr = inImagePtr | 0;\n outImagePtr = outImagePtr | 0;\n\n var v = 0,\n u = 0,\n sum = 0,\n yStart1 = 0,\n yStart2 = 0,\n xStart1 = 0,\n xStart2 = 0,\n offset = 0;\n\n for ( v = 1; (v | 0) < ((size - 1) | 0); v = (v + 1) | 0) {\n offset = (offset + size) | 0;\n for ( u = 1; (u | 0) < ((size - 1) | 0); u = (u + 1) | 0) {\n yStart1 = (offset - size) | 0;\n yStart2 = (offset + size) | 0;\n xStart1 = (u - 1) | 0;\n xStart2 = (u + 1) | 0;\n 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;\n if ((sum | 0) > (0 | 0)) {\n images[(outImagePtr + offset + u) | 0] = 1;\n } else {\n images[(outImagePtr + offset + u) | 0] = 0;\n }\n }\n }\n return;\n }\n\n function memcpy(srcImagePtr, dstImagePtr) {\n srcImagePtr = srcImagePtr | 0;\n dstImagePtr = dstImagePtr | 0;\n\n var length = 0;\n\n length = imul(size, size) | 0;\n\n while ((length | 0) > 0) {\n length = (length - 1) | 0;\n images[(dstImagePtr + length) | 0] = (images[(srcImagePtr + length) | 0] | 0);\n }\n }\n\n function zeroBorder(imagePtr) {\n imagePtr = imagePtr | 0;\n\n var x = 0,\n y = 0;\n\n for ( x = 0; (x | 0) < ((size - 1) | 0); x = (x + 1) | 0) {\n images[(imagePtr + x) | 0] = 0;\n images[(imagePtr + y) | 0] = 0;\n y = ((y + size) - 1) | 0;\n images[(imagePtr + y) | 0] = 0;\n y = (y + 1) | 0;\n }\n for ( x = 0; (x | 0) < (size | 0); x = (x + 1) | 0) {\n images[(imagePtr + y) | 0] = 0;\n y = (y + 1) | 0;\n }\n }\n\n function skeletonize() {\n var subImagePtr = 0,\n erodedImagePtr = 0,\n tempImagePtr = 0,\n skelImagePtr = 0,\n sum = 0,\n done = 0;\n\n erodedImagePtr = imul(size, size) | 0;\n tempImagePtr = (erodedImagePtr + erodedImagePtr) | 0;\n skelImagePtr = (tempImagePtr + erodedImagePtr) | 0;\n\n // init skel-image\n init(skelImagePtr, 0);\n zeroBorder(subImagePtr);\n\n do {\n erode(subImagePtr, erodedImagePtr);\n dilate(erodedImagePtr, tempImagePtr);\n subtract(subImagePtr, tempImagePtr, tempImagePtr);\n bitwiseOr(skelImagePtr, tempImagePtr, skelImagePtr);\n memcpy(erodedImagePtr, subImagePtr);\n sum = countNonZero(subImagePtr) | 0;\n done = ((sum | 0) == 0 | 0);\n } while(!done);\n }\n\n return {\n skeletonize : skeletonize\n };\n}\n/* @preserve ASM END */\n\nexport default Skeletonizer;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/skeletonizer.js\n **/","export default {\n drawRect: function(pos, size, ctx, style){\n ctx.strokeStyle = style.color;\n ctx.fillStyle = style.color;\n ctx.lineWidth = 1;\n ctx.beginPath();\n ctx.strokeRect(pos.x, pos.y, size.x, size.y);\n },\n drawPath: function(path, def, ctx, style) {\n ctx.strokeStyle = style.color;\n ctx.fillStyle = style.color;\n ctx.lineWidth = style.lineWidth;\n ctx.beginPath();\n ctx.moveTo(path[0][def.x], path[0][def.y]);\n for (var j = 1; j < path.length; j++) {\n ctx.lineTo(path[j][def.x], path[j][def.y]);\n }\n ctx.closePath();\n ctx.stroke();\n },\n drawImage: function(imageData, size, ctx) {\n var canvasData = ctx.getImageData(0, 0, size.x, size.y),\n data = canvasData.data,\n imageDataPos = imageData.length,\n canvasDataPos = data.length,\n value;\n\n if (canvasDataPos/imageDataPos !== 4) {\n return false;\n }\n while(imageDataPos--){\n value = imageData[imageDataPos];\n data[--canvasDataPos] = 255;\n data[--canvasDataPos] = value;\n data[--canvasDataPos] = value;\n data[--canvasDataPos] = value;\n }\n ctx.putImageData(canvasData, 0, 0);\n return true;\n }\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/image_debug.js\n **/","import Bresenham from './bresenham';\nimport ImageDebug from './image_debug';\nimport Code128Reader from './code_128_reader';\nimport EANReader from './ean_reader';\nimport Code39Reader from './code_39_reader';\nimport Code39VINReader from './code_39_vin_reader';\nimport CodabarReader from './codabar_reader';\nimport UPCReader from './upc_reader';\nimport EAN8Reader from './ean_8_reader';\nimport UPCEReader from './upc_e_reader';\nimport I2of5Reader from './i2of5_reader';\n\nvar readers = {\n code_128_reader: Code128Reader,\n ean_reader: EANReader,\n ean_8_reader: EAN8Reader,\n code_39_reader: Code39Reader,\n code_39_vin_reader: Code39VINReader,\n codabar_reader: CodabarReader,\n upc_reader: UPCReader,\n upc_e_reader: UPCEReader,\n i2of5_reader: I2of5Reader\n};\nexport default {\n create : function(config, inputImageWrapper) {\n var _canvas = {\n ctx : {\n frequency : null,\n pattern : null,\n overlay : null\n },\n dom : {\n frequency : null,\n pattern : null,\n overlay : null\n }\n },\n _barcodeReaders = [];\n\n initCanvas();\n initReaders();\n initConfig();\n\n function initCanvas() {\n if (typeof document !== 'undefined') {\n var $debug = document.querySelector(\"#debug.detection\");\n _canvas.dom.frequency = document.querySelector(\"canvas.frequency\");\n if (!_canvas.dom.frequency) {\n _canvas.dom.frequency = document.createElement(\"canvas\");\n _canvas.dom.frequency.className = \"frequency\";\n if($debug) {\n $debug.appendChild(_canvas.dom.frequency);\n }\n }\n _canvas.ctx.frequency = _canvas.dom.frequency.getContext(\"2d\");\n\n _canvas.dom.pattern = document.querySelector(\"canvas.patternBuffer\");\n if (!_canvas.dom.pattern) {\n _canvas.dom.pattern = document.createElement(\"canvas\");\n _canvas.dom.pattern.className = \"patternBuffer\";\n if($debug) {\n $debug.appendChild(_canvas.dom.pattern);\n }\n }\n _canvas.ctx.pattern = _canvas.dom.pattern.getContext(\"2d\");\n\n _canvas.dom.overlay = document.querySelector(\"canvas.drawingBuffer\");\n if (_canvas.dom.overlay) {\n _canvas.ctx.overlay = _canvas.dom.overlay.getContext(\"2d\");\n }\n }\n }\n\n function initReaders() {\n config.readers.forEach(function(readerConfig) {\n var reader,\n config = {};\n\n if (typeof readerConfig === 'object') {\n reader = readerConfig.format;\n config = readerConfig.config;\n } else if (typeof readerConfig === 'string') {\n reader = readerConfig;\n }\n _barcodeReaders.push(new readers[reader](config));\n });\n console.log(\"Registered Readers: \" + _barcodeReaders\n .map(function(reader) {return JSON.stringify({format: reader.FORMAT, config: reader.config});})\n .join(', '));\n }\n\n function initConfig() {\n if (typeof document !== 'undefined') {\n var i,\n vis = [{\n node : _canvas.dom.frequency,\n prop : config.showFrequency\n }, {\n node : _canvas.dom.pattern,\n prop : config.showPattern\n }];\n\n for (i = 0; i < vis.length; i++) {\n if (vis[i].prop === true) {\n vis[i].node.style.display = \"block\";\n } else {\n vis[i].node.style.display = \"none\";\n }\n }\n }\n }\n\n /**\n * extend the line on both ends\n * @param {Array} line\n * @param {Number} angle\n */\n function getExtendedLine(line, angle, ext) {\n function extendLine(amount) {\n var extension = {\n y : amount * Math.sin(angle),\n x : amount * Math.cos(angle)\n };\n\n line[0].y -= extension.y;\n line[0].x -= extension.x;\n line[1].y += extension.y;\n line[1].x += extension.x;\n }\n\n // check if inside image\n extendLine(ext);\n while (ext > 1 && (!inputImageWrapper.inImageWithBorder(line[0], 0) || !inputImageWrapper.inImageWithBorder(line[1], 0))) {\n ext -= Math.ceil(ext/2);\n extendLine(-ext);\n }\n return line;\n }\n\n function getLine(box) {\n return [{\n x : (box[1][0] - box[0][0]) / 2 + box[0][0],\n y : (box[1][1] - box[0][1]) / 2 + box[0][1]\n }, {\n x : (box[3][0] - box[2][0]) / 2 + box[2][0],\n y : (box[3][1] - box[2][1]) / 2 + box[2][1]\n }];\n }\n\n function tryDecode(line) {\n var result = null,\n i,\n barcodeLine = Bresenham.getBarcodeLine(inputImageWrapper, line[0], line[1]);\n\n if (config.showFrequency) {\n ImageDebug.drawPath(line, {x: 'x', y: 'y'}, _canvas.ctx.overlay, {color: 'red', lineWidth: 3});\n Bresenham.debug.printFrequency(barcodeLine.line, _canvas.dom.frequency);\n }\n Bresenham.toBinaryLine(barcodeLine);\n if (config.showPattern) {\n Bresenham.debug.printPattern(barcodeLine.line, _canvas.dom.pattern);\n }\n\n for ( i = 0; i < _barcodeReaders.length && result === null; i++) {\n result = _barcodeReaders[i].decodePattern(barcodeLine.line);\n }\n if(result === null){\n return null;\n }\n return {\n codeResult: result,\n barcodeLine: barcodeLine\n };\n\n }\n\n /**\n * This method slices the given area apart and tries to detect a barcode-pattern\n * for each slice. It returns the decoded barcode, or null if nothing was found\n * @param {Array} box\n * @param {Array} line\n * @param {Number} lineAngle\n */\n function tryDecodeBruteForce(box, line, lineAngle) {\n var sideLength = Math.sqrt(Math.pow(box[1][0] - box[0][0], 2) + Math.pow((box[1][1] - box[0][1]), 2)),\n i,\n slices = 16,\n result = null,\n dir,\n extension,\n xdir = Math.sin(lineAngle),\n ydir = Math.cos(lineAngle);\n\n for ( i = 1; i < slices && result === null; i++) {\n // move line perpendicular to angle\n dir = sideLength / slices * i * (i % 2 === 0 ? -1 : 1);\n extension = {\n y : dir * xdir,\n x : dir * ydir\n };\n line[0].y += extension.x;\n line[0].x -= extension.y;\n line[1].y += extension.x;\n line[1].x -= extension.y;\n\n result = tryDecode(line);\n }\n return result;\n }\n\n function getLineLength(line) {\n return Math.sqrt(\n Math.pow(Math.abs(line[1].y - line[0].y), 2) +\n Math.pow(Math.abs(line[1].x - line[0].x), 2));\n }\n\n /**\n * With the help of the configured readers (Code128 or EAN) this function tries to detect a\n * valid barcode pattern within the given area.\n * @param {Object} box The area to search in\n * @returns {Object} the result {codeResult, line, angle, pattern, threshold}\n */\n function decodeFromBoundingBox(box) {\n var line,\n lineAngle,\n ctx = _canvas.ctx.overlay,\n result,\n lineLength;\n\n if (config.drawBoundingBox && ctx) {\n ImageDebug.drawPath(box, {x: 0, y: 1}, ctx, {color: \"blue\", lineWidth: 2});\n }\n\n line = getLine(box);\n lineLength = getLineLength(line);\n lineAngle = Math.atan2(line[1].y - line[0].y, line[1].x - line[0].x);\n line = getExtendedLine(line, lineAngle, Math.floor(lineLength*0.1));\n if(line === null){\n return null;\n }\n\n result = tryDecode(line);\n if(result === null) {\n result = tryDecodeBruteForce(box, line, lineAngle);\n }\n\n if(result === null) {\n return null;\n }\n\n if (result && config.drawScanline && ctx) {\n ImageDebug.drawPath(line, {x: 'x', y: 'y'}, ctx, {color: 'red', lineWidth: 3});\n }\n\n return {\n codeResult : result.codeResult,\n line : line,\n angle : lineAngle,\n pattern : result.barcodeLine.line,\n threshold : result.barcodeLine.threshold\n };\n }\n\n return {\n decodeFromBoundingBox : function(box) {\n return decodeFromBoundingBox(box);\n },\n decodeFromBoundingBoxes : function(boxes) {\n var i, result;\n for ( i = 0; i < boxes.length; i++) {\n result = decodeFromBoundingBox(boxes[i]);\n if (result && result.codeResult) {\n result.box = boxes[i];\n return result;\n }\n }\n },\n setReaders: function(readers) {\n config.readers = readers;\n _barcodeReaders.length = 0;\n initReaders();\n }\n };\n }\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/barcode_decoder.js\n **/","import CVUtils from './cv_utils';\nimport ImageWrapper from './image_wrapper';\n\nvar Bresenham = {};\n\nvar Slope = {\n DIR : {\n UP : 1,\n DOWN : -1\n }\n};\n/**\n * Scans a line of the given image from point p1 to p2 and returns a result object containing\n * gray-scale values (0-255) of the underlying pixels in addition to the min\n * and max values.\n * @param {Object} imageWrapper\n * @param {Object} p1 The start point {x,y}\n * @param {Object} p2 The end point {x,y}\n * @returns {line, min, max}\n */\nBresenham.getBarcodeLine = function(imageWrapper, p1, p2) {\n var x0 = p1.x | 0,\n y0 = p1.y | 0,\n x1 = p2.x | 0,\n y1 = p2.y | 0,\n steep = Math.abs(y1 - y0) > Math.abs(x1 - x0),\n deltax,\n deltay,\n error,\n ystep,\n y,\n tmp,\n x,\n line = [],\n imageData = imageWrapper.data,\n width = imageWrapper.size.x,\n sum = 0,\n val,\n min = 255,\n max = 0;\n\n function read(a, b) {\n val = imageData[b * width + a];\n sum += val;\n min = val < min ? val : min;\n max = val > max ? val : max;\n line.push(val);\n }\n\n if (steep) {\n tmp = x0;\n x0 = y0;\n y0 = tmp;\n\n tmp = x1;\n x1 = y1;\n y1 = tmp;\n }\n if (x0 > x1) {\n tmp = x0;\n x0 = x1;\n x1 = tmp;\n\n tmp = y0;\n y0 = y1;\n y1 = tmp;\n }\n deltax = x1 - x0;\n deltay = Math.abs(y1 - y0);\n error = (deltax / 2) | 0;\n y = y0;\n ystep = y0 < y1 ? 1 : -1;\n for ( x = x0; x < x1; x++) {\n if(steep){\n read(y, x);\n } else {\n read(x, y);\n }\n error = error - deltay;\n if (error < 0) {\n y = y + ystep;\n error = error + deltax;\n }\n }\n\n return {\n line : line,\n min : min,\n max : max\n };\n};\n\nBresenham.toOtsuBinaryLine = function(result) {\n var line = result.line,\n image = new ImageWrapper({x: line.length - 1, y: 1}, line),\n threshold = CVUtils.determineOtsuThreshold(image, 5);\n\n line = CVUtils.sharpenLine(line);\n CVUtils.thresholdImage(image, threshold);\n\n return {\n line: line,\n threshold: threshold\n };\n};\n\n/**\n * Converts the result from getBarcodeLine into a binary representation\n * also considering the frequency and slope of the signal for more robust results\n * @param {Object} result {line, min, max}\n */\nBresenham.toBinaryLine = function(result) {\n\n var min = result.min,\n max = result.max,\n line = result.line,\n slope,\n slope2,\n center = min + (max - min) / 2,\n extrema = [],\n currentDir,\n dir,\n threshold = (max - min) / 12,\n rThreshold = -threshold,\n i,\n j;\n\n // 1. find extrema\n currentDir = line[0] > center ? Slope.DIR.UP : Slope.DIR.DOWN;\n extrema.push({\n pos : 0,\n val : line[0]\n });\n for ( i = 0; i < line.length - 2; i++) {\n slope = (line[i + 1] - line[i]);\n slope2 = (line[i + 2] - line[i + 1]);\n if ((slope + slope2) < rThreshold && line[i + 1] < (center*1.5)) {\n dir = Slope.DIR.DOWN;\n } else if ((slope + slope2) > threshold && line[i + 1] > (center*0.5)) {\n dir = Slope.DIR.UP;\n } else {\n dir = currentDir;\n }\n\n if (currentDir !== dir) {\n extrema.push({\n pos : i,\n val : line[i]\n });\n currentDir = dir;\n }\n }\n extrema.push({\n pos : line.length,\n val : line[line.length - 1]\n });\n\n for ( j = extrema[0].pos; j < extrema[1].pos; j++) {\n line[j] = line[j] > center ? 0 : 1;\n }\n\n // iterate over extrema and convert to binary based on avg between minmax\n for ( i = 1; i < extrema.length - 1; i++) {\n if (extrema[i + 1].val > extrema[i].val) {\n threshold = (extrema[i].val + ((extrema[i + 1].val - extrema[i].val) / 3) * 2) | 0;\n } else {\n threshold = (extrema[i + 1].val + ((extrema[i].val - extrema[i + 1].val) / 3)) | 0;\n }\n\n for ( j = extrema[i].pos; j < extrema[i + 1].pos; j++) {\n line[j] = line[j] > threshold ? 0 : 1;\n }\n }\n\n return {\n line : line,\n threshold : threshold\n };\n};\n\n/**\n * Used for development only\n */\nBresenham.debug = {\n printFrequency: function(line, canvas) {\n var i,\n ctx = canvas.getContext(\"2d\");\n canvas.width = line.length;\n canvas.height = 256;\n\n ctx.beginPath();\n ctx.strokeStyle = \"blue\";\n for ( i = 0; i < line.length; i++) {\n ctx.moveTo(i, 255);\n ctx.lineTo(i, 255 - line[i]);\n }\n ctx.stroke();\n ctx.closePath();\n },\n\n printPattern: function(line, canvas) {\n var ctx = canvas.getContext(\"2d\"), i;\n\n canvas.width = line.length;\n ctx.fillColor = \"black\";\n for ( i = 0; i < line.length; i++) {\n if (line[i] === 1) {\n ctx.fillRect(i, 0, 1, 100);\n }\n }\n }\n};\n\nexport default Bresenham;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/bresenham.js\n **/","import BarcodeReader from './barcode_reader';\n\nfunction Code128Reader() {\n BarcodeReader.call(this);\n}\n\nvar properties = {\n CODE_SHIFT : {value: 98},\n CODE_C : {value: 99},\n CODE_B : {value: 100},\n CODE_A : {value: 101},\n START_CODE_A : {value: 103},\n START_CODE_B : {value: 104},\n START_CODE_C : {value: 105},\n STOP_CODE : {value: 106},\n MODULO : {value: 11},\n CODE_PATTERN : {value: [\n [2, 1, 2, 2, 2, 2],\n [2, 2, 2, 1, 2, 2],\n [2, 2, 2, 2, 2, 1],\n [1, 2, 1, 2, 2, 3],\n [1, 2, 1, 3, 2, 2],\n [1, 3, 1, 2, 2, 2],\n [1, 2, 2, 2, 1, 3],\n [1, 2, 2, 3, 1, 2],\n [1, 3, 2, 2, 1, 2],\n [2, 2, 1, 2, 1, 3],\n [2, 2, 1, 3, 1, 2],\n [2, 3, 1, 2, 1, 2],\n [1, 1, 2, 2, 3, 2],\n [1, 2, 2, 1, 3, 2],\n [1, 2, 2, 2, 3, 1],\n [1, 1, 3, 2, 2, 2],\n [1, 2, 3, 1, 2, 2],\n [1, 2, 3, 2, 2, 1],\n [2, 2, 3, 2, 1, 1],\n [2, 2, 1, 1, 3, 2],\n [2, 2, 1, 2, 3, 1],\n [2, 1, 3, 2, 1, 2],\n [2, 2, 3, 1, 1, 2],\n [3, 1, 2, 1, 3, 1],\n [3, 1, 1, 2, 2, 2],\n [3, 2, 1, 1, 2, 2],\n [3, 2, 1, 2, 2, 1],\n [3, 1, 2, 2, 1, 2],\n [3, 2, 2, 1, 1, 2],\n [3, 2, 2, 2, 1, 1],\n [2, 1, 2, 1, 2, 3],\n [2, 1, 2, 3, 2, 1],\n [2, 3, 2, 1, 2, 1],\n [1, 1, 1, 3, 2, 3],\n [1, 3, 1, 1, 2, 3],\n [1, 3, 1, 3, 2, 1],\n [1, 1, 2, 3, 1, 3],\n [1, 3, 2, 1, 1, 3],\n [1, 3, 2, 3, 1, 1],\n [2, 1, 1, 3, 1, 3],\n [2, 3, 1, 1, 1, 3],\n [2, 3, 1, 3, 1, 1],\n [1, 1, 2, 1, 3, 3],\n [1, 1, 2, 3, 3, 1],\n [1, 3, 2, 1, 3, 1],\n [1, 1, 3, 1, 2, 3],\n [1, 1, 3, 3, 2, 1],\n [1, 3, 3, 1, 2, 1],\n [3, 1, 3, 1, 2, 1],\n [2, 1, 1, 3, 3, 1],\n [2, 3, 1, 1, 3, 1],\n [2, 1, 3, 1, 1, 3],\n [2, 1, 3, 3, 1, 1],\n [2, 1, 3, 1, 3, 1],\n [3, 1, 1, 1, 2, 3],\n [3, 1, 1, 3, 2, 1],\n [3, 3, 1, 1, 2, 1],\n [3, 1, 2, 1, 1, 3],\n [3, 1, 2, 3, 1, 1],\n [3, 3, 2, 1, 1, 1],\n [3, 1, 4, 1, 1, 1],\n [2, 2, 1, 4, 1, 1],\n [4, 3, 1, 1, 1, 1],\n [1, 1, 1, 2, 2, 4],\n [1, 1, 1, 4, 2, 2],\n [1, 2, 1, 1, 2, 4],\n [1, 2, 1, 4, 2, 1],\n [1, 4, 1, 1, 2, 2],\n [1, 4, 1, 2, 2, 1],\n [1, 1, 2, 2, 1, 4],\n [1, 1, 2, 4, 1, 2],\n [1, 2, 2, 1, 1, 4],\n [1, 2, 2, 4, 1, 1],\n [1, 4, 2, 1, 1, 2],\n [1, 4, 2, 2, 1, 1],\n [2, 4, 1, 2, 1, 1],\n [2, 2, 1, 1, 1, 4],\n [4, 1, 3, 1, 1, 1],\n [2, 4, 1, 1, 1, 2],\n [1, 3, 4, 1, 1, 1],\n [1, 1, 1, 2, 4, 2],\n [1, 2, 1, 1, 4, 2],\n [1, 2, 1, 2, 4, 1],\n [1, 1, 4, 2, 1, 2],\n [1, 2, 4, 1, 1, 2],\n [1, 2, 4, 2, 1, 1],\n [4, 1, 1, 2, 1, 2],\n [4, 2, 1, 1, 1, 2],\n [4, 2, 1, 2, 1, 1],\n [2, 1, 2, 1, 4, 1],\n [2, 1, 4, 1, 2, 1],\n [4, 1, 2, 1, 2, 1],\n [1, 1, 1, 1, 4, 3],\n [1, 1, 1, 3, 4, 1],\n [1, 3, 1, 1, 4, 1],\n [1, 1, 4, 1, 1, 3],\n [1, 1, 4, 3, 1, 1],\n [4, 1, 1, 1, 1, 3],\n [4, 1, 1, 3, 1, 1],\n [1, 1, 3, 1, 4, 1],\n [1, 1, 4, 1, 3, 1],\n [3, 1, 1, 1, 4, 1],\n [4, 1, 1, 1, 3, 1],\n [2, 1, 1, 4, 1, 2],\n [2, 1, 1, 2, 1, 4],\n [2, 1, 1, 2, 3, 2],\n [2, 3, 3, 1, 1, 1, 2]\n ]},\n SINGLE_CODE_ERROR: {value: 1},\n AVG_CODE_ERROR: {value: 0.5},\n FORMAT: {value: \"code_128\", writeable: false}\n};\n\nCode128Reader.prototype = Object.create(BarcodeReader.prototype, properties);\nCode128Reader.prototype.constructor = Code128Reader;\n\nCode128Reader.prototype._decodeCode = function(start) {\n var counter = [0, 0, 0, 0, 0, 0],\n i,\n self = this,\n offset = start,\n isWhite = !self._row[offset],\n counterPos = 0,\n bestMatch = {\n error : Number.MAX_VALUE,\n code : -1,\n start : start,\n end : start\n },\n code,\n error,\n normalized;\n\n for ( i = offset; i < self._row.length; i++) {\n if (self._row[i] ^ isWhite) {\n counter[counterPos]++;\n } else {\n if (counterPos === counter.length - 1) {\n normalized = self._normalize(counter);\n if (normalized) {\n for (code = 0; code < self.CODE_PATTERN.length; code++) {\n error = self._matchPattern(normalized, self.CODE_PATTERN[code]);\n if (error < bestMatch.error) {\n bestMatch.code = code;\n bestMatch.error = error;\n }\n }\n bestMatch.end = i;\n return bestMatch;\n }\n } else {\n counterPos++;\n }\n counter[counterPos] = 1;\n isWhite = !isWhite;\n }\n }\n return null;\n};\n\nCode128Reader.prototype._findStart = function() {\n var counter = [0, 0, 0, 0, 0, 0],\n i,\n self = this,\n offset = self._nextSet(self._row),\n isWhite = false,\n counterPos = 0,\n bestMatch = {\n error : Number.MAX_VALUE,\n code : -1,\n start : 0,\n end : 0\n },\n code,\n error,\n j,\n sum,\n normalized;\n\n for ( i = offset; i < self._row.length; i++) {\n if (self._row[i] ^ isWhite) {\n counter[counterPos]++;\n } else {\n if (counterPos === counter.length - 1) {\n sum = 0;\n for ( j = 0; j < counter.length; j++) {\n sum += counter[j];\n }\n normalized = self._normalize(counter);\n if (normalized) {\n for (code = self.START_CODE_A; code <= self.START_CODE_C; code++) {\n error = self._matchPattern(normalized, self.CODE_PATTERN[code]);\n if (error < bestMatch.error) {\n bestMatch.code = code;\n bestMatch.error = error;\n }\n }\n if (bestMatch.error < self.AVG_CODE_ERROR) {\n bestMatch.start = i - sum;\n bestMatch.end = i;\n return bestMatch;\n }\n }\n\n for ( j = 0; j < 4; j++) {\n counter[j] = counter[j + 2];\n }\n counter[4] = 0;\n counter[5] = 0;\n counterPos--;\n } else {\n counterPos++;\n }\n counter[counterPos] = 1;\n isWhite = !isWhite;\n }\n }\n return null;\n};\n\nCode128Reader.prototype._decode = function() {\n var self = this,\n startInfo = self._findStart(),\n code = null,\n done = false,\n result = [],\n multiplier = 0,\n checksum = 0,\n codeset,\n rawResult = [],\n decodedCodes = [],\n shiftNext = false,\n unshift,\n lastCharacterWasPrintable;\n\n if (startInfo === null) {\n return null;\n }\n code = {\n code : startInfo.code,\n start : startInfo.start,\n end : startInfo.end\n };\n decodedCodes.push(code);\n checksum = code.code;\n switch(code.code) {\n case self.START_CODE_A:\n codeset = self.CODE_A;\n break;\n case self.START_CODE_B:\n codeset = self.CODE_B;\n break;\n case self.START_CODE_C:\n codeset = self.CODE_C;\n break;\n default:\n return null;\n }\n\n while (!done) {\n unshift = shiftNext;\n shiftNext = false;\n code = self._decodeCode(code.end);\n if (code !== null) {\n if (code.code !== self.STOP_CODE) {\n rawResult.push(code.code);\n multiplier++;\n checksum += multiplier * code.code;\n }\n decodedCodes.push(code);\n\n switch(codeset) {\n case self.CODE_A:\n if (code.code < 64) {\n result.push(String.fromCharCode(32 + code.code));\n } else if (code.code < 96) {\n result.push(String.fromCharCode(code.code - 64));\n } else {\n switch (code.code) {\n case self.CODE_SHIFT:\n shiftNext = true;\n codeset = self.CODE_B;\n break;\n case self.CODE_B:\n codeset = self.CODE_B;\n break;\n case self.CODE_C:\n codeset = self.CODE_C;\n break;\n case self.STOP_CODE:\n done = true;\n break;\n }\n }\n break;\n case self.CODE_B:\n if (code.code < 96) {\n result.push(String.fromCharCode(32 + code.code));\n } else {\n if (code.code != self.STOP_CODE) {\n lastCharacterWasPrintable = false;\n }\n switch (code.code) {\n case self.CODE_SHIFT:\n shiftNext = true;\n codeset = self.CODE_A;\n break;\n case self.CODE_A:\n codeset = self.CODE_A;\n break;\n case self.CODE_C:\n codeset = self.CODE_C;\n break;\n case self.STOP_CODE:\n done = true;\n break;\n }\n }\n break;\n case self.CODE_C:\n if (code.code < 100) {\n result.push(code.code < 10 ? \"0\" + code.code : code.code);\n }\n switch (code.code) {\n case self.CODE_A:\n codeset = self.CODE_A;\n break;\n case self.CODE_B:\n codeset = self.CODE_B;\n break;\n case self.STOP_CODE:\n done = true;\n break;\n }\n break;\n }\n } else {\n done = true;\n }\n if (unshift) {\n codeset = codeset == self.CODE_A ? self.CODE_B : self.CODE_A;\n }\n }\n\n if (code === null) {\n return null;\n }\n\n // find end bar\n code.end = self._nextUnset(self._row, code.end);\n if(!self._verifyTrailingWhitespace(code)){\n return null;\n }\n\n // checksum\n // Does not work correctly yet!!! startcode - endcode?\n checksum -= multiplier * rawResult[rawResult.length - 1];\n if (checksum % 103 != rawResult[rawResult.length - 1]) {\n return null;\n }\n\n if (!result.length) {\n return null;\n }\n\n // remove last code from result (checksum)\n result.splice(result.length - 1, 1);\n\n\n\n return {\n code : result.join(\"\"),\n start : startInfo.start,\n end : code.end,\n codeset : codeset,\n startInfo : startInfo,\n decodedCodes : decodedCodes,\n endInfo : code\n };\n};\n\n\nBarcodeReader.prototype._verifyTrailingWhitespace = function(endInfo) {\n var self = this,\n trailingWhitespaceEnd;\n\n trailingWhitespaceEnd = endInfo.end + ((endInfo.end - endInfo.start) / 2);\n if (trailingWhitespaceEnd < self._row.length) {\n if (self._matchRange(endInfo.end, trailingWhitespaceEnd, 0)) {\n return endInfo;\n }\n }\n return null;\n};\n\nexport default Code128Reader;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/code_128_reader.js\n **/","function BarcodeReader(config) {\n this._row = [];\n this.config = config || {};\n return this;\n}\n\nBarcodeReader.prototype._nextUnset = function(line, start) {\n var i;\n\n if (start === undefined) {\n start = 0;\n }\n for (i = start; i < line.length; i++) {\n if (!line[i]) {\n return i;\n }\n }\n return line.length;\n};\n\nBarcodeReader.prototype._matchPattern = function(counter, code) {\n var i,\n error = 0,\n singleError = 0,\n modulo = this.MODULO,\n maxSingleError = this.SINGLE_CODE_ERROR || 1;\n\n for (i = 0; i < counter.length; i++) {\n singleError = Math.abs(code[i] - counter[i]);\n if (singleError > maxSingleError) {\n return Number.MAX_VALUE;\n }\n error += singleError;\n }\n return error/modulo;\n};\n\nBarcodeReader.prototype._nextSet = function(line, offset) {\n var i;\n\n offset = offset || 0;\n for (i = offset; i < line.length; i++) {\n if (line[i]) {\n return i;\n }\n }\n return line.length;\n};\n\nBarcodeReader.prototype._normalize = function(counter, modulo) {\n var i,\n self = this,\n sum = 0,\n ratio,\n numOnes = 0,\n normalized = [],\n norm = 0;\n\n if (!modulo) {\n modulo = self.MODULO;\n }\n for (i = 0; i < counter.length; i++) {\n if (counter[i] === 1) {\n numOnes++;\n } else {\n sum += counter[i];\n }\n }\n ratio = sum / (modulo - numOnes);\n if (ratio > 1.0) {\n for (i = 0; i < counter.length; i++) {\n norm = counter[i] === 1 ? counter[i] : counter[i] / ratio;\n normalized.push(norm);\n }\n } else {\n ratio = (sum + numOnes)/modulo;\n for (i = 0; i < counter.length; i++) {\n norm = counter[i] / ratio;\n normalized.push(norm);\n }\n }\n return normalized;\n};\n\nBarcodeReader.prototype._matchTrace = function(cmpCounter, epsilon) {\n var counter = [],\n i,\n self = this,\n offset = self._nextSet(self._row),\n isWhite = !self._row[offset],\n counterPos = 0,\n bestMatch = {\n error : Number.MAX_VALUE,\n code : -1,\n start : 0\n },\n error;\n\n if (cmpCounter) {\n for ( i = 0; i < cmpCounter.length; i++) {\n counter.push(0);\n }\n for ( i = offset; i < self._row.length; i++) {\n if (self._row[i] ^ isWhite) {\n counter[counterPos]++;\n } else {\n if (counterPos === counter.length - 1) {\n error = self._matchPattern(counter, cmpCounter);\n\n if (error < epsilon) {\n bestMatch.start = i - offset;\n bestMatch.end = i;\n bestMatch.counter = counter;\n return bestMatch;\n } else {\n return null;\n }\n } else {\n counterPos++;\n }\n counter[counterPos] = 1;\n isWhite = !isWhite;\n }\n }\n } else {\n counter.push(0);\n for ( i = offset; i < self._row.length; i++) {\n if (self._row[i] ^ isWhite) {\n counter[counterPos]++;\n } else {\n counterPos++;\n counter.push(0);\n counter[counterPos] = 1;\n isWhite = !isWhite;\n }\n }\n }\n\n // if cmpCounter was not given\n bestMatch.start = offset;\n bestMatch.end = self._row.length - 1;\n bestMatch.counter = counter;\n return bestMatch;\n};\n\nBarcodeReader.prototype.decodePattern = function(pattern) {\n var self = this,\n result;\n\n self._row = pattern;\n result = self._decode();\n if (result === null) {\n self._row.reverse();\n result = self._decode();\n if (result) {\n result.direction = BarcodeReader.DIRECTION.REVERSE;\n result.start = self._row.length - result.start;\n result.end = self._row.length - result.end;\n }\n } else {\n result.direction = BarcodeReader.DIRECTION.FORWARD;\n }\n if (result) {\n result.format = self.FORMAT;\n }\n return result;\n};\n\nBarcodeReader.prototype._matchRange = function(start, end, value) {\n var i;\n\n start = start < 0 ? 0 : start;\n for (i = start; i < end; i++) {\n if (this._row[i] !== value) {\n return false;\n }\n }\n return true;\n};\n\nBarcodeReader.prototype._fillCounters = function(offset, end, isWhite) {\n var self = this,\n counterPos = 0,\n i,\n counters = [];\n\n isWhite = (typeof isWhite !== 'undefined') ? isWhite : true;\n offset = (typeof offset !== 'undefined') ? offset : self._nextUnset(self._row);\n end = end || self._row.length;\n\n counters[counterPos] = 0;\n for (i = offset; i < end; i++) {\n if (self._row[i] ^ isWhite) {\n counters[counterPos]++;\n } else {\n counterPos++;\n counters[counterPos] = 1;\n isWhite = !isWhite;\n }\n }\n return counters;\n};\n\nObject.defineProperty(BarcodeReader.prototype, \"FORMAT\", {\n value: 'unknown',\n writeable: false\n});\n\nBarcodeReader.DIRECTION = {\n FORWARD : 1,\n REVERSE : -1\n};\n\nBarcodeReader.Exception = {\n StartNotFoundException : \"Start-Info was not found!\",\n CodeNotFoundException : \"Code could not be found!\",\n PatternNotFoundException : \"Pattern could not be found!\"\n};\n\nBarcodeReader.CONFIG_KEYS = {};\n\nexport default BarcodeReader;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/barcode_reader.js\n **/","import BarcodeReader from './barcode_reader';\n\nfunction EANReader(opts) {\n BarcodeReader.call(this, opts);\n}\n\nvar properties = {\n CODE_L_START : {value: 0},\n MODULO : {value: 7},\n CODE_G_START : {value: 10},\n START_PATTERN : {value: [1 / 3 * 7, 1 / 3 * 7, 1 / 3 * 7]},\n STOP_PATTERN : {value: [1 / 3 * 7, 1 / 3 * 7, 1 / 3 * 7]},\n MIDDLE_PATTERN : {value: [1 / 5 * 7, 1 / 5 * 7, 1 / 5 * 7, 1 / 5 * 7, 1 / 5 * 7]},\n CODE_PATTERN : {value: [\n [3, 2, 1, 1],\n [2, 2, 2, 1],\n [2, 1, 2, 2],\n [1, 4, 1, 1],\n [1, 1, 3, 2],\n [1, 2, 3, 1],\n [1, 1, 1, 4],\n [1, 3, 1, 2],\n [1, 2, 1, 3],\n [3, 1, 1, 2],\n [1, 1, 2, 3],\n [1, 2, 2, 2],\n [2, 2, 1, 2],\n [1, 1, 4, 1],\n [2, 3, 1, 1],\n [1, 3, 2, 1],\n [4, 1, 1, 1],\n [2, 1, 3, 1],\n [3, 1, 2, 1],\n [2, 1, 1, 3]\n ]},\n CODE_FREQUENCY : {value: [0, 11, 13, 14, 19, 25, 28, 21, 22, 26]},\n SINGLE_CODE_ERROR: {value: 0.67},\n AVG_CODE_ERROR: {value: 0.27},\n FORMAT: {value: \"ean_13\", writeable: false}\n};\n\nEANReader.prototype = Object.create(BarcodeReader.prototype, properties);\nEANReader.prototype.constructor = EANReader;\n\nEANReader.prototype._decodeCode = function(start, coderange) {\n var counter = [0, 0, 0, 0],\n i,\n self = this,\n offset = start,\n isWhite = !self._row[offset],\n counterPos = 0,\n bestMatch = {\n error : Number.MAX_VALUE,\n code : -1,\n start : start,\n end : start\n },\n code,\n error,\n normalized;\n\n if (!coderange) {\n coderange = self.CODE_PATTERN.length;\n }\n\n for ( i = offset; i < self._row.length; i++) {\n if (self._row[i] ^ isWhite) {\n counter[counterPos]++;\n } else {\n if (counterPos === counter.length - 1) {\n normalized = self._normalize(counter);\n if (normalized) {\n for (code = 0; code < coderange; code++) {\n error = self._matchPattern(normalized, self.CODE_PATTERN[code]);\n if (error < bestMatch.error) {\n bestMatch.code = code;\n bestMatch.error = error;\n }\n }\n bestMatch.end = i;\n if (bestMatch.error > self.AVG_CODE_ERROR) {\n return null;\n }\n return bestMatch;\n }\n } else {\n counterPos++;\n }\n counter[counterPos] = 1;\n isWhite = !isWhite;\n }\n }\n return null;\n};\n\nEANReader.prototype._findPattern = function(pattern, offset, isWhite, tryHarder, epsilon) {\n var counter = [],\n self = this,\n i,\n counterPos = 0,\n bestMatch = {\n error : Number.MAX_VALUE,\n code : -1,\n start : 0,\n end : 0\n },\n error,\n j,\n sum,\n normalized;\n\n if (!offset) {\n offset = self._nextSet(self._row);\n }\n\n if (isWhite === undefined) {\n isWhite = false;\n }\n\n if (tryHarder === undefined) {\n tryHarder = true;\n }\n\n if ( epsilon === undefined) {\n epsilon = self.AVG_CODE_ERROR;\n }\n\n for ( i = 0; i < pattern.length; i++) {\n counter[i] = 0;\n }\n\n for ( i = offset; i < self._row.length; i++) {\n if (self._row[i] ^ isWhite) {\n counter[counterPos]++;\n } else {\n if (counterPos === counter.length - 1) {\n sum = 0;\n for ( j = 0; j < counter.length; j++) {\n sum += counter[j];\n }\n normalized = self._normalize(counter);\n if (normalized) {\n error = self._matchPattern(normalized, pattern);\n\n if (error < epsilon) {\n bestMatch.error = error;\n bestMatch.start = i - sum;\n bestMatch.end = i;\n return bestMatch;\n }\n }\n if (tryHarder) {\n for ( j = 0; j < counter.length - 2; j++) {\n counter[j] = counter[j + 2];\n }\n counter[counter.length - 2] = 0;\n counter[counter.length - 1] = 0;\n counterPos--;\n } else {\n return null;\n }\n } else {\n counterPos++;\n }\n counter[counterPos] = 1;\n isWhite = !isWhite;\n }\n }\n return null;\n};\n\nEANReader.prototype._findStart = function() {\n var self = this,\n leadingWhitespaceStart,\n offset = self._nextSet(self._row),\n startInfo;\n\n while(!startInfo) {\n startInfo = self._findPattern(self.START_PATTERN, offset);\n if (!startInfo) {\n return null;\n }\n leadingWhitespaceStart = startInfo.start - (startInfo.end - startInfo.start);\n if (leadingWhitespaceStart >= 0) {\n if (self._matchRange(leadingWhitespaceStart, startInfo.start, 0)) {\n return startInfo;\n }\n }\n offset = startInfo.end;\n startInfo = null;\n }\n};\n\nEANReader.prototype._verifyTrailingWhitespace = function(endInfo) {\n var self = this,\n trailingWhitespaceEnd;\n\n trailingWhitespaceEnd = endInfo.end + (endInfo.end - endInfo.start);\n if (trailingWhitespaceEnd < self._row.length) {\n if (self._matchRange(endInfo.end, trailingWhitespaceEnd, 0)) {\n return endInfo;\n }\n }\n return null;\n};\n\nEANReader.prototype._findEnd = function(offset, isWhite) {\n var self = this,\n endInfo = self._findPattern(self.STOP_PATTERN, offset, isWhite, false);\n\n return endInfo !== null ? self._verifyTrailingWhitespace(endInfo) : null;\n};\n\nEANReader.prototype._calculateFirstDigit = function(codeFrequency) {\n var i,\n self = this;\n\n for ( i = 0; i < self.CODE_FREQUENCY.length; i++) {\n if (codeFrequency === self.CODE_FREQUENCY[i]) {\n return i;\n }\n }\n return null;\n};\n\nEANReader.prototype._decodePayload = function(code, result, decodedCodes) {\n var i,\n self = this,\n codeFrequency = 0x0,\n firstDigit;\n\n for ( i = 0; i < 6; i++) {\n code = self._decodeCode(code.end);\n if (!code) {\n return null;\n }\n if (code.code >= self.CODE_G_START) {\n code.code = code.code - self.CODE_G_START;\n codeFrequency |= 1 << (5 - i);\n } else {\n codeFrequency |= 0 << (5 - i);\n }\n result.push(code.code);\n decodedCodes.push(code);\n }\n\n firstDigit = self._calculateFirstDigit(codeFrequency);\n if (firstDigit === null) {\n return null;\n }\n result.unshift(firstDigit);\n\n code = self._findPattern(self.MIDDLE_PATTERN, code.end, true, false);\n if (code === null) {\n return null;\n }\n decodedCodes.push(code);\n\n for ( i = 0; i < 6; i++) {\n code = self._decodeCode(code.end, self.CODE_G_START);\n if (!code) {\n return null;\n }\n decodedCodes.push(code);\n result.push(code.code);\n }\n\n return code;\n};\n\nEANReader.prototype._decode = function() {\n var startInfo,\n self = this,\n code,\n result = [],\n decodedCodes = [];\n\n startInfo = self._findStart();\n if (!startInfo) {\n return null;\n }\n code = {\n code : startInfo.code,\n start : startInfo.start,\n end : startInfo.end\n };\n decodedCodes.push(code);\n code = self._decodePayload(code, result, decodedCodes);\n if (!code) {\n return null;\n }\n code = self._findEnd(code.end, false);\n if (!code){\n return null;\n }\n\n decodedCodes.push(code);\n\n // Checksum\n if (!self._checksum(result)) {\n return null;\n }\n\n return {\n code : result.join(\"\"),\n start : startInfo.start,\n end : code.end,\n codeset : \"\",\n startInfo : startInfo,\n decodedCodes : decodedCodes\n };\n};\n\nEANReader.prototype._checksum = function(result) {\n var sum = 0, i;\n\n for ( i = result.length - 2; i >= 0; i -= 2) {\n sum += result[i];\n }\n sum *= 3;\n for ( i = result.length - 1; i >= 0; i -= 2) {\n sum += result[i];\n }\n return sum % 10 === 0;\n};\n\nexport default (EANReader);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/ean_reader.js\n **/","import BarcodeReader from './barcode_reader';\nimport ArrayHelper from './array_helper';\n\nfunction Code39Reader() {\n BarcodeReader.call(this);\n}\n\nvar properties = {\n ALPHABETH_STRING: {value: \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. *$/+%\"},\n 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]},\n CHARACTER_ENCODINGS: {value: [0x034, 0x121, 0x061, 0x160, 0x031, 0x130, 0x070, 0x025, 0x124, 0x064, 0x109, 0x049, 0x148, 0x019, 0x118, 0x058, 0x00D, 0x10C, 0x04C, 0x01C, 0x103, 0x043, 0x142, 0x013, 0x112, 0x052, 0x007, 0x106, 0x046, 0x016, 0x181, 0x0C1, 0x1C0, 0x091, 0x190, 0x0D0, 0x085, 0x184, 0x0C4, 0x094, 0x0A8, 0x0A2, 0x08A, 0x02A]},\n ASTERISK: {value: 0x094},\n FORMAT: {value: \"code_39\", writeable: false}\n};\n\nCode39Reader.prototype = Object.create(BarcodeReader.prototype, properties);\nCode39Reader.prototype.constructor = Code39Reader;\n\nCode39Reader.prototype._toCounters = function(start, counter) {\n var self = this,\n numCounters = counter.length,\n end = self._row.length,\n isWhite = !self._row[start],\n i,\n counterPos = 0;\n\n ArrayHelper.init(counter, 0);\n\n for ( i = start; i < end; i++) {\n if (self._row[i] ^ isWhite) {\n counter[counterPos]++;\n } else {\n counterPos++;\n if (counterPos === numCounters) {\n break;\n } else {\n counter[counterPos] = 1;\n isWhite = !isWhite;\n }\n }\n }\n\n return counter;\n};\n\nCode39Reader.prototype._decode = function() {\n var self = this,\n counters = [0,0,0,0,0,0,0,0,0],\n result = [],\n start = self._findStart(),\n decodedChar,\n lastStart,\n pattern,\n nextStart;\n\n if (!start) {\n return null;\n }\n nextStart = self._nextSet(self._row, start.end);\n\n do {\n counters = self._toCounters(nextStart, counters);\n pattern = self._toPattern(counters);\n if (pattern < 0) {\n return null;\n }\n decodedChar = self._patternToChar(pattern);\n if (decodedChar < 0){\n return null;\n }\n result.push(decodedChar);\n lastStart = nextStart;\n nextStart += ArrayHelper.sum(counters);\n nextStart = self._nextSet(self._row, nextStart);\n } while(decodedChar !== '*');\n result.pop();\n\n if (!result.length) {\n return null;\n }\n\n if(!self._verifyTrailingWhitespace(lastStart, nextStart, counters)) {\n return null;\n }\n\n return {\n code : result.join(\"\"),\n start : start.start,\n end : nextStart,\n startInfo : start,\n decodedCodes : result\n };\n};\n\nCode39Reader.prototype._verifyTrailingWhitespace = function(lastStart, nextStart, counters) {\n var trailingWhitespaceEnd,\n patternSize = ArrayHelper.sum(counters);\n\n trailingWhitespaceEnd = nextStart - lastStart - patternSize;\n if ((trailingWhitespaceEnd * 3) >= patternSize) {\n return true;\n }\n return false;\n};\n\nCode39Reader.prototype._patternToChar = function(pattern) {\n var i,\n self = this;\n\n for (i = 0; i < self.CHARACTER_ENCODINGS.length; i++) {\n if (self.CHARACTER_ENCODINGS[i] === pattern) {\n return String.fromCharCode(self.ALPHABET[i]);\n }\n }\n};\n\nCode39Reader.prototype._findNextWidth = function(counters, current) {\n var i,\n minWidth = Number.MAX_VALUE;\n\n for (i = 0; i < counters.length; i++) {\n if (counters[i] < minWidth && counters[i] > current) {\n minWidth = counters[i];\n }\n }\n\n return minWidth;\n};\n\nCode39Reader.prototype._toPattern = function(counters) {\n var numCounters = counters.length,\n maxNarrowWidth = 0,\n numWideBars = numCounters,\n wideBarWidth = 0,\n self = this,\n pattern,\n i;\n\n while(numWideBars > 3) {\n maxNarrowWidth = self._findNextWidth(counters, maxNarrowWidth);\n numWideBars = 0;\n pattern = 0;\n for (i = 0; i < numCounters; i++) {\n if (counters[i] > maxNarrowWidth) {\n pattern |= 1 << (numCounters - 1 - i);\n numWideBars++;\n wideBarWidth += counters[i];\n }\n }\n\n if (numWideBars === 3) {\n for (i = 0; i < numCounters && numWideBars > 0; i++) {\n if (counters[i] > maxNarrowWidth) {\n numWideBars--;\n if ((counters[i] * 2) >= wideBarWidth) {\n return -1;\n }\n }\n }\n return pattern;\n }\n }\n return -1;\n};\n\nCode39Reader.prototype._findStart = function() {\n var self = this,\n offset = self._nextSet(self._row),\n patternStart = offset,\n counter = [0,0,0,0,0,0,0,0,0],\n counterPos = 0,\n isWhite = false,\n i,\n j,\n whiteSpaceMustStart;\n\n for ( i = offset; i < self._row.length; i++) {\n if (self._row[i] ^ isWhite) {\n counter[counterPos]++;\n } else {\n if (counterPos === counter.length - 1) {\n\n // find start pattern\n if (self._toPattern(counter) === self.ASTERISK) {\n whiteSpaceMustStart = Math.floor(Math.max(0, patternStart - ((i - patternStart) / 4)));\n if (self._matchRange(whiteSpaceMustStart, patternStart, 0)) {\n return {\n start: patternStart,\n end: i\n };\n }\n }\n\n patternStart += counter[0] + counter[1];\n for ( j = 0; j < 7; j++) {\n counter[j] = counter[j + 2];\n }\n counter[7] = 0;\n counter[8] = 0;\n counterPos--;\n } else {\n counterPos++;\n }\n counter[counterPos] = 1;\n isWhite = !isWhite;\n }\n }\n return null;\n};\n\nexport default Code39Reader;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/code_39_reader.js\n **/","import Code39Reader from './code_39_reader';\n\nfunction Code39VINReader() {\n Code39Reader.call(this);\n}\n\nvar patterns = {\n IOQ: /[IOQ]/g,\n AZ09: /[A-Z0-9]{17}/\n};\n\nCode39VINReader.prototype = Object.create(Code39Reader.prototype);\nCode39VINReader.prototype.constructor = Code39VINReader;\n\n// Cribbed from:\n// https://github.com/zxing/zxing/blob/master/core/src/main/java/com/google/zxing/client/result/VINResultParser.java\nCode39VINReader.prototype._decode = function() {\n var result = Code39Reader.prototype._decode.apply(this);\n if (!result) {\n return null;\n }\n\n var code = result.code;\n\n if (!code) {\n return;\n }\n\n code = code.replace(patterns.IOQ, '');\n\n if (!code.match(patterns.AZ09)) {\n console.log('Failed AZ09 pattern code:', code);\n return null;\n }\n\n if (!this._checkChecksum(code)) {\n return null;\n }\n\n result.code = code;\n return result;\n};\n\nCode39VINReader.prototype._checkChecksum = function(code) {\n // TODO\n return !!code;\n};\n\nexport default Code39VINReader;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/code_39_vin_reader.js\n **/","import BarcodeReader from './barcode_reader';\n\nfunction CodabarReader() {\n BarcodeReader.call(this);\n this._counters = [];\n}\n\nvar properties = {\n ALPHABETH_STRING: {value: \"0123456789-$:/.+ABCD\"},\n ALPHABET: {value: [48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 45, 36, 58, 47, 46, 43, 65, 66, 67, 68]},\n CHARACTER_ENCODINGS: {value: [0x003, 0x006, 0x009, 0x060, 0x012, 0x042, 0x021, 0x024, 0x030, 0x048, 0x00c, 0x018, 0x045, 0x051, 0x054, 0x015, 0x01A, 0x029, 0x00B, 0x00E]},\n START_END: {value: [0x01A, 0x029, 0x00B, 0x00E]},\n MIN_ENCODED_CHARS: {value: 4},\n MAX_ACCEPTABLE: {value: 2.0},\n PADDING: {value: 1.5},\n FORMAT: {value: \"codabar\", writeable: false}\n};\n\nCodabarReader.prototype = Object.create(BarcodeReader.prototype, properties);\nCodabarReader.prototype.constructor = CodabarReader;\n\nCodabarReader.prototype._decode = function() {\n var self = this,\n result = [],\n start,\n decodedChar,\n pattern,\n nextStart,\n end;\n\n this._counters = self._fillCounters();\n start = self._findStart();\n if (!start) {\n return null;\n }\n nextStart = start.startCounter;\n\n do {\n pattern = self._toPattern(nextStart);\n if (pattern < 0) {\n return null;\n }\n decodedChar = self._patternToChar(pattern);\n if (decodedChar < 0){\n return null;\n }\n result.push(decodedChar);\n nextStart += 8;\n if (result.length > 1 && self._isStartEnd(pattern)) {\n break;\n }\n } while(nextStart < self._counters.length);\n\n // verify end\n if ((result.length - 2) < self.MIN_ENCODED_CHARS || !self._isStartEnd(pattern)) {\n return null;\n }\n\n // verify end white space\n if (!self._verifyWhitespace(start.startCounter, nextStart - 8)){\n return null;\n }\n\n if (!self._validateResult(result, start.startCounter)){\n return null;\n }\n\n nextStart = nextStart > self._counters.length ? self._counters.length : nextStart;\n end = start.start + self._sumCounters(start.startCounter, nextStart - 8);\n\n return {\n code : result.join(\"\"),\n start : start.start,\n end : end,\n startInfo : start,\n decodedCodes : result\n };\n};\n\nCodabarReader.prototype._verifyWhitespace = function(startCounter, endCounter) {\n if ((startCounter - 1 <= 0) || this._counters[startCounter-1] >= (this._calculatePatternLength(startCounter) / 2.0)) {\n if ((endCounter + 8 >= this._counters.length) || this._counters[endCounter+7] >= (this._calculatePatternLength(endCounter) / 2.0)) {\n return true;\n }\n }\n return false;\n};\n\nCodabarReader.prototype._calculatePatternLength = function(offset) {\n var i,\n sum = 0;\n\n for (i = offset; i < offset + 7; i++) {\n sum += this._counters[i];\n }\n\n return sum;\n};\n\nCodabarReader.prototype._thresholdResultPattern = function(result, startCounter){\n var self = this,\n categorization = {\n space: {\n narrow: { size: 0, counts: 0, min: 0, max: Number.MAX_VALUE},\n wide: {size: 0, counts: 0, min: 0, max: Number.MAX_VALUE}\n },\n bar: {\n narrow: { size: 0, counts: 0, min: 0, max: Number.MAX_VALUE},\n wide: { size: 0, counts: 0, min: 0, max: Number.MAX_VALUE}\n }\n },\n kind,\n cat,\n i,\n j,\n pos = startCounter,\n pattern;\n\n for (i = 0; i < result.length; i++){\n pattern = self._charToPattern(result[i]);\n for (j = 6; j >= 0; j--) {\n kind = (j & 1) === 2 ? categorization.bar : categorization.space;\n cat = (pattern & 1) === 1 ? kind.wide : kind.narrow;\n cat.size += self._counters[pos + j];\n cat.counts++;\n pattern >>= 1;\n }\n pos += 8;\n }\n\n [\"space\", \"bar\"].forEach(function(key) {\n var kind = categorization[key];\n kind.wide.min = Math.floor((kind.narrow.size/kind.narrow.counts + kind.wide.size / kind.wide.counts) / 2);\n kind.narrow.max = Math.ceil(kind.wide.min);\n kind.wide.max = Math.ceil((kind.wide.size * self.MAX_ACCEPTABLE + self.PADDING) / kind.wide.counts);\n });\n\n return categorization;\n};\n\nCodabarReader.prototype._charToPattern = function(char) {\n var self = this,\n charCode = char.charCodeAt(0),\n i;\n\n for (i = 0; i < self.ALPHABET.length; i++) {\n if (self.ALPHABET[i] === charCode){\n return self.CHARACTER_ENCODINGS[i];\n }\n }\n return 0x0;\n};\n\nCodabarReader.prototype._validateResult = function(result, startCounter) {\n var self = this,\n thresholds = self._thresholdResultPattern(result, startCounter),\n i,\n j,\n kind,\n cat,\n size,\n pos = startCounter,\n pattern;\n\n for (i = 0; i < result.length; i++) {\n pattern = self._charToPattern(result[i]);\n for (j = 6; j >= 0; j--) {\n kind = (j & 1) === 0 ? thresholds.bar : thresholds.space;\n cat = (pattern & 1) === 1 ? kind.wide : kind.narrow;\n size = self._counters[pos + j];\n if (size < cat.min || size > cat.max) {\n return false;\n }\n pattern >>= 1;\n }\n pos += 8;\n }\n return true;\n};\n\nCodabarReader.prototype._patternToChar = function(pattern) {\n var i,\n self = this;\n\n for (i = 0; i < self.CHARACTER_ENCODINGS.length; i++) {\n if (self.CHARACTER_ENCODINGS[i] === pattern) {\n return String.fromCharCode(self.ALPHABET[i]);\n }\n }\n return -1;\n};\n\nCodabarReader.prototype._computeAlternatingThreshold = function(offset, end) {\n var i,\n min = Number.MAX_VALUE,\n max = 0,\n counter;\n\n for (i = offset; i < end; i += 2){\n counter = this._counters[i];\n if (counter > max) {\n max = counter;\n }\n if (counter < min) {\n min = counter;\n }\n }\n\n return ((min + max) / 2.0) | 0;\n};\n\nCodabarReader.prototype._toPattern = function(offset) {\n var numCounters = 7,\n end = offset + numCounters,\n barThreshold,\n spaceThreshold,\n bitmask = 1 << (numCounters - 1),\n pattern = 0,\n i,\n threshold;\n\n if (end > this._counters.length) {\n return -1;\n }\n\n barThreshold = this._computeAlternatingThreshold(offset, end);\n spaceThreshold = this._computeAlternatingThreshold(offset + 1, end);\n\n for (i = 0; i < numCounters; i++){\n threshold = (i & 1) === 0 ? barThreshold : spaceThreshold;\n if (this._counters[offset + i] > threshold) {\n pattern |= bitmask;\n }\n bitmask >>= 1;\n }\n\n return pattern;\n};\n\nCodabarReader.prototype._isStartEnd = function(pattern) {\n var i;\n\n for (i = 0; i < this.START_END.length; i++) {\n if (this.START_END[i] === pattern) {\n return true;\n }\n }\n return false;\n};\n\nCodabarReader.prototype._sumCounters = function(start, end) {\n var i,\n sum = 0;\n\n for (i = start; i < end; i++) {\n sum += this._counters[i];\n }\n return sum;\n};\n\nCodabarReader.prototype._findStart = function() {\n var self = this,\n i,\n pattern,\n start = self._nextUnset(self._row),\n end;\n\n for (i = 1; i < this._counters.length; i++) {\n pattern = self._toPattern(i);\n if (pattern !== -1 && self._isStartEnd(pattern)) {\n // TODO: Look for whitespace ahead\n start += self._sumCounters(0, i);\n end = start + self._sumCounters(i, i + 8);\n return {\n start: start,\n end: end,\n startCounter: i,\n endCounter: i + 8\n };\n }\n }\n};\n\nexport default CodabarReader;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/codabar_reader.js\n **/","import EANReader from './ean_reader';\n\nfunction UPCReader() {\n EANReader.call(this);\n}\n\nvar properties = {\n FORMAT: {value: \"upc_a\", writeable: false}\n};\n\nUPCReader.prototype = Object.create(EANReader.prototype, properties);\nUPCReader.prototype.constructor = UPCReader;\n\nUPCReader.prototype._decode = function() {\n var result = EANReader.prototype._decode.call(this);\n\n if (result && result.code && result.code.length === 13 && result.code.charAt(0) === \"0\") {\n\n result.code = result.code.substring(1);\n return result;\n }\n return null;\n};\n\nexport default EANReader;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/upc_reader.js\n **/","import EANReader from './ean_reader';\n\nfunction EAN8Reader() {\n EANReader.call(this);\n}\n\nvar properties = {\n FORMAT: {value: \"ean_8\", writeable: false}\n};\n\nEAN8Reader.prototype = Object.create(EANReader.prototype, properties);\nEAN8Reader.prototype.constructor = EAN8Reader;\n\nEAN8Reader.prototype._decodePayload = function(code, result, decodedCodes) {\n var i,\n self = this;\n\n for ( i = 0; i < 4; i++) {\n code = self._decodeCode(code.end, self.CODE_G_START);\n if (!code) {\n return null;\n }\n result.push(code.code);\n decodedCodes.push(code);\n }\n\n code = self._findPattern(self.MIDDLE_PATTERN, code.end, true, false);\n if (code === null) {\n return null;\n }\n decodedCodes.push(code);\n\n for ( i = 0; i < 4; i++) {\n code = self._decodeCode(code.end, self.CODE_G_START);\n if (!code) {\n return null;\n }\n decodedCodes.push(code);\n result.push(code.code);\n }\n\n return code;\n};\n\nexport default EAN8Reader;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/ean_8_reader.js\n **/","import EANReader from './ean_reader';\n\nfunction UPCEReader() {\n EANReader.call(this);\n}\n\nvar properties = {\n CODE_FREQUENCY : {value: [\n [ 56, 52, 50, 49, 44, 38, 35, 42, 41, 37 ],\n [7, 11, 13, 14, 19, 25, 28, 21, 22, 26]]},\n STOP_PATTERN: { value: [1 / 6 * 7, 1 / 6 * 7, 1 / 6 * 7, 1 / 6 * 7, 1 / 6 * 7, 1 / 6 * 7]},\n FORMAT: {value: \"upc_e\", writeable: false}\n};\n\nUPCEReader.prototype = Object.create(EANReader.prototype, properties);\nUPCEReader.prototype.constructor = UPCEReader;\n\nUPCEReader.prototype._decodePayload = function(code, result, decodedCodes) {\n var i,\n self = this,\n codeFrequency = 0x0;\n\n for ( i = 0; i < 6; i++) {\n code = self._decodeCode(code.end);\n if (!code) {\n return null;\n }\n if (code.code >= self.CODE_G_START) {\n code.code = code.code - self.CODE_G_START;\n codeFrequency |= 1 << (5 - i);\n }\n result.push(code.code);\n decodedCodes.push(code);\n }\n if (!self._determineParity(codeFrequency, result)) {\n return null;\n }\n\n return code;\n};\n\nUPCEReader.prototype._determineParity = function(codeFrequency, result) {\n var self =this,\n i,\n nrSystem;\n\n for (nrSystem = 0; nrSystem < self.CODE_FREQUENCY.length; nrSystem++){\n for ( i = 0; i < self.CODE_FREQUENCY[nrSystem].length; i++) {\n if (codeFrequency === self.CODE_FREQUENCY[nrSystem][i]) {\n result.unshift(nrSystem);\n result.push(i);\n return true;\n }\n }\n }\n return false;\n};\n\nUPCEReader.prototype._convertToUPCA = function(result) {\n var upca = [result[0]],\n lastDigit = result[result.length - 2];\n\n if (lastDigit <= 2) {\n upca = upca.concat(result.slice(1, 3))\n .concat([lastDigit, 0, 0, 0, 0])\n .concat(result.slice(3, 6));\n } else if (lastDigit === 3) {\n upca = upca.concat(result.slice(1, 4))\n .concat([0 ,0, 0, 0, 0])\n .concat(result.slice(4,6));\n } else if (lastDigit === 4) {\n upca = upca.concat(result.slice(1, 5))\n .concat([0, 0, 0, 0, 0, result[5]]);\n } else {\n upca = upca.concat(result.slice(1, 6))\n .concat([0, 0, 0, 0, lastDigit]);\n }\n\n upca.push(result[result.length - 1]);\n return upca;\n};\n\nUPCEReader.prototype._checksum = function(result) {\n return EANReader.prototype._checksum.call(this, this._convertToUPCA(result));\n};\n\nUPCEReader.prototype._findEnd = function(offset, isWhite) {\n isWhite = true;\n return EANReader.prototype._findEnd.call(this, offset, isWhite);\n};\n\nUPCEReader.prototype._verifyTrailingWhitespace = function(endInfo) {\n var self = this,\n trailingWhitespaceEnd;\n\n trailingWhitespaceEnd = endInfo.end + ((endInfo.end - endInfo.start)/2);\n if (trailingWhitespaceEnd < self._row.length) {\n if (self._matchRange(endInfo.end, trailingWhitespaceEnd, 0)) {\n return endInfo;\n }\n }\n};\n\nexport default UPCEReader;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/upc_e_reader.js\n **/","import BarcodeReader from './barcode_reader';\nconst merge = require('lodash/object/merge');\n\nfunction I2of5Reader(opts) {\n opts = merge(getDefaulConfig(), opts);\n BarcodeReader.call(this, opts);\n this.barSpaceRatio = [1, 1];\n if (opts.normalizeBarSpaceWidth) {\n this.SINGLE_CODE_ERROR = 0.38;\n this.AVG_CODE_ERROR = 0.09;\n }\n}\n\nfunction getDefaulConfig() {\n var config = {};\n\n Object.keys(I2of5Reader.CONFIG_KEYS).forEach(function(key) {\n config[key] = I2of5Reader.CONFIG_KEYS[key]['default'];\n });\n return config;\n}\n\nvar N = 1,\n W = 3,\n properties = {\n MODULO : {value: 10},\n START_PATTERN : {value: [N*2.5, N*2.5, N*2.5, N*2.5]},\n STOP_PATTERN : {value: [N*2, N*2, W*2]},\n CODE_PATTERN : {value: [\n [N, N, W, W, N],\n [W, N, N, N, W],\n [N, W, N, N, W],\n [W, W, N, N, N],\n [N, N, W, N, W],\n [W, N, W, N, N],\n [N, W, W, N, N],\n [N, N, N, W, W],\n [W, N, N, W, N],\n [N, W, N, W, N]\n ]},\n SINGLE_CODE_ERROR: {value: 0.78, writable: true},\n AVG_CODE_ERROR: {value: 0.38, writable: true},\n MAX_CORRECTION_FACTOR: {value: 5},\n FORMAT: {value: \"i2of5\"}\n};\n\nI2of5Reader.prototype = Object.create(BarcodeReader.prototype, properties);\nI2of5Reader.prototype.constructor = I2of5Reader;\n\nI2of5Reader.prototype._matchPattern = function(counter, code) {\n if (this.config.normalizeBarSpaceWidth) {\n var i,\n counterSum = [0, 0],\n codeSum = [0, 0],\n correction = [0, 0],\n correctionRatio = this.MAX_CORRECTION_FACTOR,\n correctionRatioInverse = 1 / correctionRatio;\n\n for (i = 0; i < counter.length; i++) {\n counterSum[i % 2] += counter[i];\n codeSum[i % 2] += code[i];\n }\n correction[0] = codeSum[0] / counterSum[0];\n correction[1] = codeSum[1] / counterSum[1];\n\n correction[0] = Math.max(Math.min(correction[0], correctionRatio), correctionRatioInverse);\n correction[1] = Math.max(Math.min(correction[1], correctionRatio), correctionRatioInverse);\n this.barSpaceRatio = correction;\n for (i = 0; i < counter.length; i++) {\n counter[i] *= this.barSpaceRatio[i % 2];\n }\n }\n return BarcodeReader.prototype._matchPattern.call(this, counter, code);\n};\n\nI2of5Reader.prototype._findPattern = function(pattern, offset, isWhite, tryHarder) {\n var counter = [],\n self = this,\n i,\n counterPos = 0,\n bestMatch = {\n error : Number.MAX_VALUE,\n code : -1,\n start : 0,\n end : 0\n },\n error,\n j,\n sum,\n normalized,\n epsilon = self.AVG_CODE_ERROR;\n\n isWhite = isWhite || false;\n tryHarder = tryHarder || false;\n\n if (!offset) {\n offset = self._nextSet(self._row);\n }\n\n for ( i = 0; i < pattern.length; i++) {\n counter[i] = 0;\n }\n\n for ( i = offset; i < self._row.length; i++) {\n if (self._row[i] ^ isWhite) {\n counter[counterPos]++;\n } else {\n if (counterPos === counter.length - 1) {\n sum = 0;\n for ( j = 0; j < counter.length; j++) {\n sum += counter[j];\n }\n normalized = self._normalize(counter);\n if (normalized) {\n error = self._matchPattern(normalized, pattern);\n\n if (error < epsilon) {\n bestMatch.error = error;\n bestMatch.start = i - sum;\n bestMatch.end = i;\n return bestMatch;\n }\n }\n if (tryHarder) {\n for (j = 0; j < counter.length - 2; j++) {\n counter[j] = counter[j + 2];\n }\n counter[counter.length - 2] = 0;\n counter[counter.length - 1] = 0;\n counterPos--;\n } else {\n return null;\n }\n } else {\n counterPos++;\n }\n counter[counterPos] = 1;\n isWhite = !isWhite;\n }\n }\n return null;\n};\n\nI2of5Reader.prototype._findStart = function() {\n var self = this,\n leadingWhitespaceStart,\n offset = self._nextSet(self._row),\n startInfo,\n narrowBarWidth = 1;\n\n while(!startInfo) {\n startInfo = self._findPattern(self.START_PATTERN, offset, false, true);\n if (!startInfo) {\n return null;\n }\n narrowBarWidth = Math.floor((startInfo.end - startInfo.start) / 4);\n leadingWhitespaceStart = startInfo.start - narrowBarWidth*10;\n if (leadingWhitespaceStart >= 0) {\n if (self._matchRange(leadingWhitespaceStart, startInfo.start, 0)) {\n return startInfo;\n }\n }\n offset = startInfo.end;\n startInfo = null;\n }\n};\n\nI2of5Reader.prototype._verifyTrailingWhitespace = function(endInfo) {\n var self = this,\n trailingWhitespaceEnd;\n\n trailingWhitespaceEnd = endInfo.end + ((endInfo.end - endInfo.start) / 2);\n if (trailingWhitespaceEnd < self._row.length) {\n if (self._matchRange(endInfo.end, trailingWhitespaceEnd, 0)) {\n return endInfo;\n }\n }\n return null;\n};\n\nI2of5Reader.prototype._findEnd = function() {\n var self = this,\n endInfo,\n tmp;\n\n self._row.reverse();\n endInfo = self._findPattern(self.STOP_PATTERN);\n self._row.reverse();\n\n if (endInfo === null) {\n return null;\n }\n\n // reverse numbers\n tmp = endInfo.start;\n endInfo.start = self._row.length - endInfo.end;\n endInfo.end = self._row.length - tmp;\n\n return endInfo !== null ? self._verifyTrailingWhitespace(endInfo) : null;\n};\n\nI2of5Reader.prototype._decodePair = function(counterPair) {\n var i,\n code,\n codes = [],\n self = this;\n\n for (i = 0; i < counterPair.length; i++) {\n code = self._decodeCode(counterPair[i]);\n if (!code) {\n return null;\n }\n codes.push(code);\n }\n return codes;\n};\n\nI2of5Reader.prototype._decodeCode = function(counter) {\n var j,\n self = this,\n sum = 0,\n normalized,\n error,\n epsilon = self.AVG_CODE_ERROR,\n code,\n bestMatch = {\n error : Number.MAX_VALUE,\n code : -1,\n start : 0,\n end : 0\n };\n\n for ( j = 0; j < counter.length; j++) {\n sum += counter[j];\n }\n normalized = self._normalize(counter);\n if (normalized) {\n for (code = 0; code < self.CODE_PATTERN.length; code++) {\n error = self._matchPattern(normalized, self.CODE_PATTERN[code]);\n if (error < bestMatch.error) {\n bestMatch.code = code;\n bestMatch.error = error;\n }\n }\n if (bestMatch.error < epsilon) {\n return bestMatch;\n }\n }\n return null;\n};\n\nI2of5Reader.prototype._decodePayload = function(counters, result, decodedCodes) {\n var i,\n self = this,\n pos = 0,\n counterLength = counters.length,\n counterPair = [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0]],\n codes;\n\n while (pos < counterLength) {\n for (i = 0; i < 5; i++) {\n counterPair[0][i] = counters[pos]*this.barSpaceRatio[0];\n counterPair[1][i] = counters[pos + 1]*this.barSpaceRatio[1];\n pos += 2;\n }\n codes = self._decodePair(counterPair);\n if (!codes) {\n return null;\n }\n for (i = 0; i < codes.length; i++) {\n result.push(codes[i].code + \"\");\n decodedCodes.push(codes[i]);\n }\n }\n return codes;\n};\n\nI2of5Reader.prototype._verifyCounterLength = function(counters) {\n return (counters.length % 10 === 0);\n};\n\nI2of5Reader.prototype._decode = function() {\n var startInfo,\n endInfo,\n self = this,\n code,\n result = [],\n decodedCodes = [],\n counters;\n\n startInfo = self._findStart();\n if (!startInfo) {\n return null;\n }\n decodedCodes.push(startInfo);\n\n endInfo = self._findEnd();\n if (!endInfo) {\n return null;\n }\n\n counters = self._fillCounters(startInfo.end, endInfo.start, false);\n if (!self._verifyCounterLength(counters)) {\n return null;\n }\n code = self._decodePayload(counters, result, decodedCodes);\n if (!code) {\n return null;\n }\n if (result.length % 2 !== 0 ||\n result.length < 6) {\n return null;\n }\n\n decodedCodes.push(endInfo);\n return {\n code : result.join(\"\"),\n start : startInfo.start,\n end : endInfo.end,\n startInfo : startInfo,\n decodedCodes : decodedCodes\n };\n};\n\nI2of5Reader.CONFIG_KEYS = {\n normalizeBarSpaceWidth: {\n 'type': 'boolean',\n 'default': false,\n 'description': 'If true, the reader tries to normalize the' +\n 'width-difference between bars and spaces'\n }\n};\n\nexport default I2of5Reader;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/i2of5_reader.js\n **/","var baseMerge = require('../internal/baseMerge'),\n createAssigner = require('../internal/createAssigner');\n\n/**\n * Recursively merges own enumerable properties of the source object(s), that\n * don't resolve to `undefined` into the destination object. Subsequent sources\n * overwrite property assignments of previous sources. If `customizer` is\n * provided it's invoked to produce the merged values of the destination and\n * source properties. If `customizer` returns `undefined` merging is handled\n * by the method instead. The `customizer` is bound to `thisArg` and invoked\n * with five arguments: (objectValue, sourceValue, key, object, source).\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {*} [thisArg] The `this` binding of `customizer`.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var users = {\n * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }]\n * };\n *\n * var ages = {\n * 'data': [{ 'age': 36 }, { 'age': 40 }]\n * };\n *\n * _.merge(users, ages);\n * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] }\n *\n * // using a customizer callback\n * var object = {\n * 'fruits': ['apple'],\n * 'vegetables': ['beet']\n * };\n *\n * var other = {\n * 'fruits': ['banana'],\n * 'vegetables': ['carrot']\n * };\n *\n * _.merge(object, other, function(a, b) {\n * if (_.isArray(a)) {\n * return a.concat(b);\n * }\n * });\n * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] }\n */\nvar merge = createAssigner(baseMerge);\n\nmodule.exports = merge;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/lodash/object/merge.js\n ** module id = 37\n ** module chunks = 0\n **/","var arrayEach = require('./arrayEach'),\n baseMergeDeep = require('./baseMergeDeep'),\n isArray = require('../lang/isArray'),\n isArrayLike = require('./isArrayLike'),\n isObject = require('../lang/isObject'),\n isObjectLike = require('./isObjectLike'),\n isTypedArray = require('../lang/isTypedArray'),\n keys = require('../object/keys');\n\n/**\n * The base implementation of `_.merge` without support for argument juggling,\n * multiple sources, and `this` binding `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Array} [stackA=[]] Tracks traversed source objects.\n * @param {Array} [stackB=[]] Associates values with source counterparts.\n * @returns {Object} Returns `object`.\n */\nfunction baseMerge(object, source, customizer, stackA, stackB) {\n if (!isObject(object)) {\n return object;\n }\n var isSrcArr = isArrayLike(source) && (isArray(source) || isTypedArray(source)),\n props = isSrcArr ? undefined : keys(source);\n\n arrayEach(props || source, function(srcValue, key) {\n if (props) {\n key = srcValue;\n srcValue = source[key];\n }\n if (isObjectLike(srcValue)) {\n stackA || (stackA = []);\n stackB || (stackB = []);\n baseMergeDeep(object, source, key, baseMerge, customizer, stackA, stackB);\n }\n else {\n var value = object[key],\n result = customizer ? customizer(value, srcValue, key, object, source) : undefined,\n isCommon = result === undefined;\n\n if (isCommon) {\n result = srcValue;\n }\n if ((result !== undefined || (isSrcArr && !(key in object))) &&\n (isCommon || (result === result ? (result !== value) : (value === value)))) {\n object[key] = result;\n }\n }\n });\n return object;\n}\n\nmodule.exports = baseMerge;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/lodash/internal/baseMerge.js\n ** module id = 38\n ** module chunks = 0\n **/","/**\n * A specialized version of `_.forEach` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\nmodule.exports = arrayEach;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/lodash/internal/arrayEach.js\n ** module id = 39\n ** module chunks = 0\n **/","var arrayCopy = require('./arrayCopy'),\n isArguments = require('../lang/isArguments'),\n isArray = require('../lang/isArray'),\n isArrayLike = require('./isArrayLike'),\n isPlainObject = require('../lang/isPlainObject'),\n isTypedArray = require('../lang/isTypedArray'),\n toPlainObject = require('../lang/toPlainObject');\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Array} [stackA=[]] Tracks traversed source objects.\n * @param {Array} [stackB=[]] Associates values with source counterparts.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseMergeDeep(object, source, key, mergeFunc, customizer, stackA, stackB) {\n var length = stackA.length,\n srcValue = source[key];\n\n while (length--) {\n if (stackA[length] == srcValue) {\n object[key] = stackB[length];\n return;\n }\n }\n var value = object[key],\n result = customizer ? customizer(value, srcValue, key, object, source) : undefined,\n isCommon = result === undefined;\n\n if (isCommon) {\n result = srcValue;\n if (isArrayLike(srcValue) && (isArray(srcValue) || isTypedArray(srcValue))) {\n result = isArray(value)\n ? value\n : (isArrayLike(value) ? arrayCopy(value) : []);\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n result = isArguments(value)\n ? toPlainObject(value)\n : (isPlainObject(value) ? value : {});\n }\n else {\n isCommon = false;\n }\n }\n // Add the source value to the stack of traversed objects and associate\n // it with its merged value.\n stackA.push(srcValue);\n stackB.push(result);\n\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n object[key] = mergeFunc(result, srcValue, customizer, stackA, stackB);\n } else if (result === result ? (result !== value) : (value === value)) {\n object[key] = result;\n }\n}\n\nmodule.exports = baseMergeDeep;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/lodash/internal/baseMergeDeep.js\n ** module id = 40\n ** module chunks = 0\n **/","/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction arrayCopy(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\nmodule.exports = arrayCopy;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/lodash/internal/arrayCopy.js\n ** module id = 41\n ** module chunks = 0\n **/","var isArrayLike = require('../internal/isArrayLike'),\n isObjectLike = require('../internal/isObjectLike');\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Native method references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is classified as an `arguments` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n return isObjectLike(value) && isArrayLike(value) &&\n hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');\n}\n\nmodule.exports = isArguments;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/lodash/lang/isArguments.js\n ** module id = 42\n ** module chunks = 0\n **/","var getLength = require('./getLength'),\n isLength = require('./isLength');\n\n/**\n * Checks if `value` is array-like.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n */\nfunction isArrayLike(value) {\n return value != null && isLength(getLength(value));\n}\n\nmodule.exports = isArrayLike;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/lodash/internal/isArrayLike.js\n ** module id = 43\n ** module chunks = 0\n **/","var baseProperty = require('./baseProperty');\n\n/**\n * Gets the \"length\" property value of `object`.\n *\n * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)\n * that affects Safari on at least iOS 8.1-8.3 ARM64.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {*} Returns the \"length\" value.\n */\nvar getLength = baseProperty('length');\n\nmodule.exports = getLength;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/lodash/internal/getLength.js\n ** module id = 44\n ** module chunks = 0\n **/","/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new function.\n */\nfunction baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n}\n\nmodule.exports = baseProperty;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/lodash/internal/baseProperty.js\n ** module id = 45\n ** module chunks = 0\n **/","/**\n * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)\n * of an array-like value.\n */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n */\nfunction isLength(value) {\n return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nmodule.exports = isLength;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/lodash/internal/isLength.js\n ** module id = 46\n ** module chunks = 0\n **/","/**\n * Checks if `value` is object-like.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/lodash/internal/isObjectLike.js\n ** module id = 47\n ** module chunks = 0\n **/","var getNative = require('../internal/getNative'),\n isLength = require('../internal/isLength'),\n isObjectLike = require('../internal/isObjectLike');\n\n/** `Object#toString` result references. */\nvar arrayTag = '[object Array]';\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeIsArray = getNative(Array, 'isArray');\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(function() { return arguments; }());\n * // => false\n */\nvar isArray = nativeIsArray || function(value) {\n return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;\n};\n\nmodule.exports = isArray;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/lodash/lang/isArray.js\n ** module id = 48\n ** module chunks = 0\n **/","var isNative = require('../lang/isNative');\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = object == null ? undefined : object[key];\n return isNative(value) ? value : undefined;\n}\n\nmodule.exports = getNative;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/lodash/internal/getNative.js\n ** module id = 49\n ** module chunks = 0\n **/","var isFunction = require('./isFunction'),\n isObjectLike = require('../internal/isObjectLike');\n\n/** Used to detect host constructors (Safari > 5). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar fnToString = Function.prototype.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n fnToString.call(hasOwnProperty).replace(/[\\\\^$.*+?()[\\]{}|]/g, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * Checks if `value` is a native function.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function, else `false`.\n * @example\n *\n * _.isNative(Array.prototype.push);\n * // => true\n *\n * _.isNative(_);\n * // => false\n */\nfunction isNative(value) {\n if (value == null) {\n return false;\n }\n if (isFunction(value)) {\n return reIsNative.test(fnToString.call(value));\n }\n return isObjectLike(value) && reIsHostCtor.test(value);\n}\n\nmodule.exports = isNative;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/lodash/lang/isNative.js\n ** module id = 50\n ** module chunks = 0\n **/","var isObject = require('./isObject');\n\n/** `Object#toString` result references. */\nvar funcTag = '[object Function]';\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in older versions of Chrome and Safari which return 'function' for regexes\n // and Safari 8 which returns 'object' for typed array constructors.\n return isObject(value) && objToString.call(value) == funcTag;\n}\n\nmodule.exports = isFunction;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/lodash/lang/isFunction.js\n ** module id = 51\n ** module chunks = 0\n **/","/**\n * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.\n * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(1);\n * // => false\n */\nfunction isObject(value) {\n // Avoid a V8 JIT bug in Chrome 19-20.\n // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/lodash/lang/isObject.js\n ** module id = 52\n ** module chunks = 0\n **/","var baseForIn = require('../internal/baseForIn'),\n isArguments = require('./isArguments'),\n isObjectLike = require('../internal/isObjectLike');\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * **Note:** This method assumes objects created by the `Object` constructor\n * have no inherited enumerable properties.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n var Ctor;\n\n // Exit early for non `Object` objects.\n if (!(isObjectLike(value) && objToString.call(value) == objectTag && !isArguments(value)) ||\n (!hasOwnProperty.call(value, 'constructor') && (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor)))) {\n return false;\n }\n // IE < 9 iterates inherited properties before own properties. If the first\n // iterated property is an object's own property then there are no inherited\n // enumerable properties.\n var result;\n // In most environments an object's own properties are iterated before\n // its inherited properties. If the last iterated property is an object's\n // own property then there are no inherited enumerable properties.\n baseForIn(value, function(subValue, key) {\n result = key;\n });\n return result === undefined || hasOwnProperty.call(value, result);\n}\n\nmodule.exports = isPlainObject;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/lodash/lang/isPlainObject.js\n ** module id = 53\n ** module chunks = 0\n **/","var baseFor = require('./baseFor'),\n keysIn = require('../object/keysIn');\n\n/**\n * The base implementation of `_.forIn` without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForIn(object, iteratee) {\n return baseFor(object, iteratee, keysIn);\n}\n\nmodule.exports = baseForIn;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/lodash/internal/baseForIn.js\n ** module id = 54\n ** module chunks = 0\n **/","var createBaseFor = require('./createBaseFor');\n\n/**\n * The base implementation of `baseForIn` and `baseForOwn` which iterates\n * over `object` properties returned by `keysFunc` invoking `iteratee` for\n * each property. Iteratee functions may exit iteration early by explicitly\n * returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\nmodule.exports = baseFor;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/lodash/internal/baseFor.js\n ** module id = 55\n ** module chunks = 0\n **/","var toObject = require('./toObject');\n\n/**\n * Creates a base function for `_.forIn` or `_.forInRight`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var iterable = toObject(object),\n props = keysFunc(object),\n length = props.length,\n index = fromRight ? length : -1;\n\n while ((fromRight ? index-- : ++index < length)) {\n var key = props[index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nmodule.exports = createBaseFor;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/lodash/internal/createBaseFor.js\n ** module id = 56\n ** module chunks = 0\n **/","var isObject = require('../lang/isObject');\n\n/**\n * Converts `value` to an object if it's not one.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {Object} Returns the object.\n */\nfunction toObject(value) {\n return isObject(value) ? value : Object(value);\n}\n\nmodule.exports = toObject;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/lodash/internal/toObject.js\n ** module id = 57\n ** module chunks = 0\n **/","var isArguments = require('../lang/isArguments'),\n isArray = require('../lang/isArray'),\n isIndex = require('../internal/isIndex'),\n isLength = require('../internal/isLength'),\n isObject = require('../lang/isObject');\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n if (object == null) {\n return [];\n }\n if (!isObject(object)) {\n object = Object(object);\n }\n var length = object.length;\n length = (length && isLength(length) &&\n (isArray(object) || isArguments(object)) && length) || 0;\n\n var Ctor = object.constructor,\n index = -1,\n isProto = typeof Ctor == 'function' && Ctor.prototype === object,\n result = Array(length),\n skipIndexes = length > 0;\n\n while (++index < length) {\n result[index] = (index + '');\n }\n for (var key in object) {\n if (!(skipIndexes && isIndex(key, length)) &&\n !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = keysIn;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/lodash/object/keysIn.js\n ** module id = 58\n ** module chunks = 0\n **/","/** Used to detect unsigned integer values. */\nvar reIsUint = /^\\d+$/;\n\n/**\n * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)\n * of an array-like value.\n */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;\n length = length == null ? MAX_SAFE_INTEGER : length;\n return value > -1 && value % 1 == 0 && value < length;\n}\n\nmodule.exports = isIndex;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/lodash/internal/isIndex.js\n ** module id = 59\n ** module chunks = 0\n **/","var isLength = require('../internal/isLength'),\n isObjectLike = require('../internal/isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dateTag] = typedArrayTags[errorTag] =\ntypedArrayTags[funcTag] = typedArrayTags[mapTag] =\ntypedArrayTags[numberTag] = typedArrayTags[objectTag] =\ntypedArrayTags[regexpTag] = typedArrayTags[setTag] =\ntypedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nfunction isTypedArray(value) {\n return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)];\n}\n\nmodule.exports = isTypedArray;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/lodash/lang/isTypedArray.js\n ** module id = 60\n ** module chunks = 0\n **/","var baseCopy = require('../internal/baseCopy'),\n keysIn = require('../object/keysIn');\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable\n * properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n return baseCopy(value, keysIn(value));\n}\n\nmodule.exports = toPlainObject;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/lodash/lang/toPlainObject.js\n ** module id = 61\n ** module chunks = 0\n **/","/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property names to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @returns {Object} Returns `object`.\n */\nfunction baseCopy(source, props, object) {\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n object[key] = source[key];\n }\n return object;\n}\n\nmodule.exports = baseCopy;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/lodash/internal/baseCopy.js\n ** module id = 62\n ** module chunks = 0\n **/","var getNative = require('../internal/getNative'),\n isArrayLike = require('../internal/isArrayLike'),\n isObject = require('../lang/isObject'),\n shimKeys = require('../internal/shimKeys');\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = getNative(Object, 'keys');\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nvar keys = !nativeKeys ? shimKeys : function(object) {\n var Ctor = object == null ? undefined : object.constructor;\n if ((typeof Ctor == 'function' && Ctor.prototype === object) ||\n (typeof object != 'function' && isArrayLike(object))) {\n return shimKeys(object);\n }\n return isObject(object) ? nativeKeys(object) : [];\n};\n\nmodule.exports = keys;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/lodash/object/keys.js\n ** module id = 63\n ** module chunks = 0\n **/","var isArguments = require('../lang/isArguments'),\n isArray = require('../lang/isArray'),\n isIndex = require('./isIndex'),\n isLength = require('./isLength'),\n keysIn = require('../object/keysIn');\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A fallback implementation of `Object.keys` which creates an array of the\n * own enumerable property names of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction shimKeys(object) {\n var props = keysIn(object),\n propsLength = props.length,\n length = propsLength && object.length;\n\n var allowIndexes = !!length && isLength(length) &&\n (isArray(object) || isArguments(object));\n\n var index = -1,\n result = [];\n\n while (++index < propsLength) {\n var key = props[index];\n if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = shimKeys;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/lodash/internal/shimKeys.js\n ** module id = 64\n ** module chunks = 0\n **/","var bindCallback = require('./bindCallback'),\n isIterateeCall = require('./isIterateeCall'),\n restParam = require('../function/restParam');\n\n/**\n * Creates a `_.assign`, `_.defaults`, or `_.merge` function.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return restParam(function(object, sources) {\n var index = -1,\n length = object == null ? 0 : sources.length,\n customizer = length > 2 ? sources[length - 2] : undefined,\n guard = length > 2 ? sources[2] : undefined,\n thisArg = length > 1 ? sources[length - 1] : undefined;\n\n if (typeof customizer == 'function') {\n customizer = bindCallback(customizer, thisArg, 5);\n length -= 2;\n } else {\n customizer = typeof thisArg == 'function' ? thisArg : undefined;\n length -= (customizer ? 1 : 0);\n }\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, customizer);\n }\n }\n return object;\n });\n}\n\nmodule.exports = createAssigner;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/lodash/internal/createAssigner.js\n ** module id = 65\n ** module chunks = 0\n **/","var identity = require('../utility/identity');\n\n/**\n * A specialized version of `baseCallback` which only supports `this` binding\n * and specifying the number of arguments to provide to `func`.\n *\n * @private\n * @param {Function} func The function to bind.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {number} [argCount] The number of arguments to provide to `func`.\n * @returns {Function} Returns the callback.\n */\nfunction bindCallback(func, thisArg, argCount) {\n if (typeof func != 'function') {\n return identity;\n }\n if (thisArg === undefined) {\n return func;\n }\n switch (argCount) {\n case 1: return function(value) {\n return func.call(thisArg, value);\n };\n case 3: return function(value, index, collection) {\n return func.call(thisArg, value, index, collection);\n };\n case 4: return function(accumulator, value, index, collection) {\n return func.call(thisArg, accumulator, value, index, collection);\n };\n case 5: return function(value, other, key, object, source) {\n return func.call(thisArg, value, other, key, object, source);\n };\n }\n return function() {\n return func.apply(thisArg, arguments);\n };\n}\n\nmodule.exports = bindCallback;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/lodash/internal/bindCallback.js\n ** module id = 66\n ** module chunks = 0\n **/","/**\n * This method returns the first argument provided to it.\n *\n * @static\n * @memberOf _\n * @category Utility\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'user': 'fred' };\n *\n * _.identity(object) === object;\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nmodule.exports = identity;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/lodash/utility/identity.js\n ** module id = 67\n ** module chunks = 0\n **/","var isArrayLike = require('./isArrayLike'),\n isIndex = require('./isIndex'),\n isObject = require('../lang/isObject');\n\n/**\n * Checks if the provided arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)) {\n var other = object[index];\n return value === value ? (value === other) : (other !== other);\n }\n return false;\n}\n\nmodule.exports = isIterateeCall;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/lodash/internal/isIterateeCall.js\n ** module id = 68\n ** module chunks = 0\n **/","/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Creates a function that invokes `func` with the `this` binding of the\n * created function and arguments from `start` and beyond provided as an array.\n *\n * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/Web/JavaScript/Reference/Functions/rest_parameters).\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.restParam(function(what, names) {\n * return what + ' ' + _.initial(names).join(', ') +\n * (_.size(names) > 1 ? ', & ' : '') + _.last(names);\n * });\n *\n * say('hello', 'fred', 'barney', 'pebbles');\n * // => 'hello fred, barney, & pebbles'\n */\nfunction restParam(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n rest = Array(length);\n\n while (++index < length) {\n rest[index] = args[start + index];\n }\n switch (start) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, args[0], rest);\n case 2: return func.call(this, args[0], args[1], rest);\n }\n var otherArgs = Array(start + 1);\n index = -1;\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = rest;\n return func.apply(this, otherArgs);\n };\n}\n\nmodule.exports = restParam;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/lodash/function/restParam.js\n ** module id = 69\n ** module chunks = 0\n **/","import CVUtils from './cv_utils';\n\nvar FrameGrabber = {};\n\nFrameGrabber.create = function(inputStream, canvas) {\n var _that = {},\n _streamConfig = inputStream.getConfig(),\n _video_size = CVUtils.imageRef(inputStream.getRealWidth(), inputStream.getRealHeight()),\n _canvasSize = inputStream.getCanvasSize(),\n _size = CVUtils.imageRef(inputStream.getWidth(), inputStream.getHeight()),\n topRight = inputStream.getTopRight(),\n _sx = topRight.x,\n _sy = topRight.y,\n _canvas,\n _ctx = null,\n _data = null;\n\n _canvas = canvas ? canvas : document.createElement(\"canvas\");\n _canvas.width = _canvasSize.x;\n _canvas.height = _canvasSize.y;\n _ctx = _canvas.getContext(\"2d\");\n _data = new Uint8Array(_size.x * _size.y);\n console.log(\"FrameGrabber\", JSON.stringify({\n size: _size,\n topRight: topRight,\n videoSize: _video_size,\n canvasSize: _canvasSize\n }));\n\n /**\n * Uses the given array as frame-buffer\n */\n _that.attachData = function(data) {\n _data = data;\n };\n\n /**\n * Returns the used frame-buffer\n */\n _that.getData = function() {\n return _data;\n };\n\n /**\n * Fetches a frame from the input-stream and puts into the frame-buffer.\n * The image-data is converted to gray-scale and then half-sampled if configured.\n */\n _that.grab = function() {\n var doHalfSample = _streamConfig.halfSample,\n frame = inputStream.getFrame(),\n ctxData;\n if (frame) {\n _ctx.drawImage(frame, 0, 0, _canvasSize.x, _canvasSize.y);\n ctxData = _ctx.getImageData(_sx, _sy, _size.x, _size.y).data;\n if(doHalfSample){\n CVUtils.grayAndHalfSampleFromCanvasData(ctxData, _size, _data);\n } else {\n CVUtils.computeGray(ctxData, _data, _streamConfig);\n }\n return true;\n } else {\n return false;\n }\n };\n\n _that.getSize = function() {\n return _size;\n };\n\n return _that;\n};\n\nexport default FrameGrabber;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/frame_grabber.js\n **/","export default {\n inputStream: {\n name: \"Live\",\n type: \"LiveStream\",\n constraints: {\n width: 640,\n height: 480,\n minAspectRatio: 0,\n maxAspectRatio: 100,\n facing: \"environment\" // or user\n },\n area: {\n top: \"0%\",\n right: \"0%\",\n left: \"0%\",\n bottom: \"0%\"\n },\n singleChannel: false // true: only the red color-channel is read\n },\n tracking: false,\n debug: false,\n controls: false,\n locate: true,\n numOfWorkers: 4,\n visual: {\n show: true\n },\n decoder: {\n drawBoundingBox: false,\n showFrequency: false,\n drawScanline: false,\n showPattern: false,\n readers: [\n 'code_128_reader'\n ]\n },\n locator: {\n halfSample: true,\n patchSize: \"medium\", // x-small, small, medium, large, x-large\n showCanvas: false,\n showPatches: false,\n showFoundPatches: false,\n showSkeleton: false,\n showLabels: false,\n showPatchLabels: false,\n showRemainingPatchLabels: false,\n boxFromPatches: {\n showTransformed: false,\n showTransformedBox: false,\n showBB: false\n }\n }\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/config.js\n **/","export default function() {\n var events = {};\n\n function getEvent(eventName) {\n if (!events[eventName]) {\n events[eventName] = {\n subscribers : []\n };\n }\n return events[eventName];\n }\n\n function clearEvents(){\n events = {};\n }\n\n function publishSubscription(subscription, data) {\n if (subscription.async) {\n setTimeout(function() {\n subscription.callback(data);\n }, 4);\n } else {\n subscription.callback(data);\n }\n }\n\n function subscribe(event, callback, async) {\n var subscription;\n\n if ( typeof callback === \"function\") {\n subscription = {\n callback : callback,\n async : async\n };\n } else {\n subscription = callback;\n if (!subscription.callback) {\n throw \"Callback was not specified on options\";\n }\n }\n\n getEvent(event).subscribers.push(subscription);\n }\n\n return {\n subscribe : function(event, callback, async) {\n return subscribe(event, callback, async);\n },\n publish : function(eventName, data) {\n var event = getEvent(eventName),\n subscribers = event.subscribers;\n\n event.subscribers = subscribers.filter(function(subscriber) {\n publishSubscription(subscriber, data);\n return !subscriber.once;\n });\n },\n once: function(event, callback, async) {\n subscribe(event, {\n callback: callback,\n async: async,\n once: true\n });\n },\n unsubscribe: function(eventName, callback) {\n var event;\n\n if (eventName) {\n event = getEvent(eventName);\n if (event && callback) {\n event.subscribers = event.subscribers.filter(function(subscriber){\n return subscriber.callback !== callback;\n });\n } else {\n event.subscribers = [];\n }\n } else {\n clearEvents();\n }\n }\n };\n}();\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/events.js\n **/","const merge = require('lodash/object/merge');\n\nvar streamRef,\n loadedDataHandler;\n\n/**\n * Wraps browser-specific getUserMedia\n * @param {Object} constraints\n * @param {Object} success Callback\n * @param {Object} failure Callback\n */\nfunction getUserMedia(constraints, success, failure) {\n if (typeof navigator.getUserMedia !== 'undefined') {\n navigator.getUserMedia(constraints, function (stream) {\n streamRef = stream;\n var videoSrc = (window.URL && window.URL.createObjectURL(stream)) || stream;\n success.apply(null, [videoSrc]);\n }, failure);\n } else {\n failure(new TypeError(\"getUserMedia not available\"));\n }\n}\n\nfunction loadedData(video, callback) {\n var attempts = 10;\n\n function checkVideo() {\n if (attempts > 0) {\n if (video.videoWidth > 0 && video.videoHeight > 0) {\n console.log(video.videoWidth + \"px x \" + video.videoHeight + \"px\");\n callback();\n } else {\n window.setTimeout(checkVideo, 500);\n }\n } else {\n callback('Unable to play video stream. Is webcam working?');\n }\n attempts--;\n }\n checkVideo();\n}\n\n/**\n * Tries to attach the camera-stream to a given video-element\n * and calls the callback function when the content is ready\n * @param {Object} constraints\n * @param {Object} video\n * @param {Object} callback\n */\nfunction initCamera(constraints, video, callback) {\n getUserMedia(constraints, function(src) {\n video.src = src;\n if (loadedDataHandler) {\n video.removeEventListener(\"loadeddata\", loadedDataHandler, false);\n }\n loadedDataHandler = loadedData.bind(null, video, callback);\n video.addEventListener('loadeddata', loadedDataHandler, false);\n video.play();\n }, function(e) {\n callback(e);\n });\n}\n\n/**\n * Normalizes the incoming constraints to satisfy the current browser\n * @param config\n * @param cb Callback which is called whenever constraints are created\n * @returns {*}\n */\nfunction normalizeConstraints(config, cb) {\n var constraints = {\n audio: false,\n video: true\n },\n videoConstraints = merge({\n width: 640,\n height: 480,\n minAspectRatio: 0,\n maxAspectRatio: 100,\n facing: \"environment\"\n }, config);\n\n if ( typeof MediaStreamTrack !== 'undefined' && typeof MediaStreamTrack.getSources !== 'undefined') {\n MediaStreamTrack.getSources(function(sourceInfos) {\n var videoSourceId;\n for (var i = 0; i != sourceInfos.length; ++i) {\n var sourceInfo = sourceInfos[i];\n if (sourceInfo.kind == \"video\" && sourceInfo.facing == videoConstraints.facing) {\n videoSourceId = sourceInfo.id;\n }\n }\n constraints.video = {\n mandatory: {\n minWidth: videoConstraints.width,\n minHeight: videoConstraints.height,\n minAspectRatio: videoConstraints.minAspectRatio,\n maxAspectRatio: videoConstraints.maxAspectRatio\n },\n optional: [{\n sourceId: videoSourceId\n }]\n };\n return cb(constraints);\n });\n } else {\n constraints.video = {\n mediaSource: \"camera\",\n width: { min: videoConstraints.width, max: videoConstraints.width },\n height: { min: videoConstraints.height, max: videoConstraints.height },\n require: [\"width\", \"height\"]\n };\n return cb(constraints);\n }\n}\n\n/**\n * Requests the back-facing camera of the user. The callback is called\n * whenever the stream is ready to be consumed, or if an error occures.\n * @param {Object} video\n * @param {Object} callback\n */\nfunction request(video, videoConstraints, callback) {\n normalizeConstraints(videoConstraints, function(constraints) {\n initCamera(constraints, video, callback);\n });\n}\n\nexport default {\n request : function(video, constraints, callback) {\n request(video, constraints, callback);\n },\n release : function() {\n var tracks = streamRef && streamRef.getVideoTracks();\n if (tracks.length) {\n tracks[0].stop();\n }\n streamRef = null;\n }\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/camera_access.js\n **/","import ImageDebug from './image_debug';\n\nfunction contains(codeResult, list) {\n if (list) {\n return list.some(function (item) {\n return Object.keys(item).every(function (key) {\n return item[key] === codeResult[key];\n });\n });\n }\n return false;\n}\n\nfunction passesFilter(codeResult, filter) {\n if (typeof filter === 'function') {\n return filter(codeResult);\n }\n return true;\n}\n\nexport default {\n create: function(config) {\n var canvas = document.createElement(\"canvas\"),\n ctx = canvas.getContext(\"2d\"),\n results = [],\n capacity = config.capacity || 20,\n capture = config.capture === true;\n\n function matchesConstraints(codeResult) {\n return capacity && codeResult && !contains(codeResult, config.blacklist) && passesFilter(codeResult, config.filter);\n }\n\n return {\n addResult: function(data, imageSize, codeResult) {\n var result = {};\n\n if (matchesConstraints(codeResult)) {\n capacity--;\n result.codeResult = codeResult;\n if (capture) {\n canvas.width = imageSize.x;\n canvas.height = imageSize.y;\n ImageDebug.drawImage(data, imageSize, ctx);\n result.frame = canvas.toDataURL();\n }\n results.push(result);\n }\n },\n getResults: function() {\n return results;\n }\n };\n }\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/result_collector.js\n **/"],"sourceRoot":""} |