{"version":3,"file":"kendo.dataviz.qrcode.min.js","names":["factory","define","amd","$","undefined$1","kendo","window","extend","draw","drawing","dataviz","Widget","ui","Box2D","terminator","NUMERIC","ALPHA_NUMERIC","BYTE","powersOfTwo","powersOfTwoResult","generatorPolynomials","irregularAlignmentPatternsStartDistance","versionsCodewordsInformation","L","groups","totalDataCodewords","errorCodewordsPerBlock","M","Q","H","finderPattern","alignmentPattern","errorCorrectionPatterns","paddingCodewords","maskPatternConditions","row","column","Math","floor","numberRegex","alphaRegex","RegExp","alphaNumericRegex","byteRegex","round","crossPattern","squarePattern","toDecimal","value","parseInt","toBitsString","length","result","Number","toString","Array","join","splitInto","str","n","idx","push","substring","QRDataMode","Class","getVersionIndex","version","getBitsCharacterCount","this","bitsInCharacterCount","getModeCountString","modeIndicator","encode","getStringBitsLength","getValue","modes","character","parts","i","inputLength","mod3","characters","A","B","C","D","E","F","G","I","J","K","N","O","P","R","S","T","U","V","W","X","Y","Z","mode","charAt","code","charCodeAt","Error","modeInstances","FreeCellVisitor","matrix","that","startColumn","dir","c","move","getNextCell","getNextRemainderCell","fillFunctionCell","matrices","bit","x","y","fillDataCell","fillData","blocks","block","codewordIdx","cell","cellVisitor","blockIdx","j","splice","padDataString","dataString","dataBitsCount","terminatorIndex","paddingCodewordIndex","xorPolynomials","multiplyPolynomials","multiplyByConstant","polynomial","power","generatePowersOfTwo","firstPolynomial","secondPolynomial","generateGeneratorPolynomials","generateErrorCodewords","data","errorCodewordsCount","divisor","generator","concat","generatorPolynomial","steps","errorCodewords","getBlocks","dataStream","versionCodewordsInformation","dataBlock","blockCodewordsCount","groupBlocksCount","messagePolynomial","codeword","codewordStart","dataBlocks","errorBlocks","versionGroups","groupIdx","chooseMode","minNumericBeforeAlpha","minNumericBeforeByte","minAlphaBeforeByte","previousMode","modeString","numeric","exec","numericMatch","alpha","alphaMatch","alphaNumeric","alphaNumericMatch","test","getModes","substr","nextMode","getDataCodewordsCount","ceil","getVersion","dataCodewordsCount","errorCorrectionLevel","getDataString","encodeFormatInformation","format","encodedString","encodeBCH","codeLength","generatorNumber","polynomialLength","valueNumber","valueString","dividePolynomials","numberX","numberY","yLength","xLength","getNumberAt","initMatrices","modules","addFormatInformation","formatString","encodeVersionInformation","addVersionInformation","quotient","mod","y1","x2","addCentricPattern","pattern","size","addFinderSeparator","direction","nextX","nextY","addFinderPatterns","addAlignmentPatterns","startDistance","distance","pointsCount","points","addTimingFunctions","scoreMaskMatrixes","scores","previousBits","darkModules","patterns","adjacentSameBits","k","scoreFinderPatternOccurance","scoreAdjacentSameBits","minIdx","total","min","MAX_VALUE","calculateDarkModulesRatioScore","rowColumn","adjacentBits","percent","mod5","previous","abs","next","EncodingResult","IsoEncoder","getEncodingResult","inputString","UTF8Encoder","encodingMode","fn","prototype","utfBOM","initialModeCountStringLength","dataLength","encodeCharacter","bytesCount","getBytesCount","bc","significantOnes","ranges","QRCodeDataEncoder","encoding","toLowerCase","indexOf","encodeData","encodingResult","versionInformation","optimalMatrix","QRCodeDefaults","DEFAULT_SIZE","QUIET_ZONE_LENGTH","DEFAULT_ERROR_CORRECTION_LEVEL","DEFAULT_BACKGROUND","DEFAULT_DARK_MODULE_COLOR","MIN_BASE_UNIT_SIZE","QRCode","init","element","options","call","wrapper","addClass","surfaceWrap","css","appendTo","surface","Surface","create","type","renderAs","setOptions","redraw","_getSize","width","height","clear","resize","createVisual","visual","getSize","dimensions","_resize","_render","exportVisual","baseUnit","quietZoneSize","contentSize","_value","border","padding","borderWidth","Group","errorCorrection","_calculateBaseUnit","append","_renderBackground","_renderMatrix","_hasCustomLogo","_renderLogo","_isSwiss","_renderSwissCode","qrSize","imageRect","center","logoSize","_getLogoSize","logoUrl","overlay","imageUrl","position","geometry","Rect","Point","Size","Image","crossSize","max","crossOffset","start","_renderShape","color","step","path","MultiPath","fill","stroke","moveTo","lineTo","close","matrixSize","x1","y2","box","unpad","Path","fromRect","toRect","background","name","defautLogoSize","ExportMixin","plugin","deepExtend","QRCodeFunctions","QRCode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D,QAAQvC,MAGhCqC,aAAc,SAASkC,GACnB,IAAIlE,EAAQ3O,KAAK4N,QAAQiD,QAAQlC,MAC7BC,EAAS5O,KAAK4N,QAAQiD,QAAQjC,OAUlC,OARKD,GAAUC,EAEJD,IAAUC,EACjBA,EAASD,GACDA,GAASC,IACjBD,EAAQC,GAJRD,EAAQC,EAASiE,EAOd,CACHlE,MAAOA,EACPC,OAAQA,MAKpBtS,EAAQwW,YAAY3W,OAAOsR,GAAO1B,IAClCzP,EAAQE,GAAGuW,OAAOtF,IAEpBxR,EAAM+W,WAAW1W,EAAS,CACpBmR,OAAQA,GACRP,eAAgBA,GAChB+F,gBAAiB,CACbvQ,gBAAiBA,EACjBe,SAAUA,EACVS,cAAeA,EACfc,uBAAwBA,EACxBT,eAAgBA,EAChBkB,UAAWA,EACXjB,oBAAqBA,EACrB8B,WAAYA,EACZc,SAAUA,EACVG,sBAAuBA,EACvBE,WAAYA,EACZG,cAAeA,EACfC,wBAAyBA,EACzBG,UAAWA,EACXM,kBAAmBA,EACnBM,aAAcA,GACdE,qBAAsBA,GACtBE,yBAA0BA,GAC1BC,sBAAuBA,GACvBK,kBAAmBA,GACnBG,mBAAoBA,GACpBI,kBAAmBA,GACnBC,qBAAsBA,GACtBK,mBAAoBA,GACpBC,kBAAmBA,GACnB0C,WAAYA,GACZjB,YAAaA,IAEjBqH,aAAc,CACV3S,MAAOkC,EACP3F,YAAaA,EACbC,kBAAmBA,EACnBC,qBAAsBA,KAvtCtC,CA2tCGd,OAAOD,MAAMkX","sourcesContent":["(function (factory) {\n typeof define === 'function' && define.amd ? define(['kendo.dataviz.core', 'kendo.drawing'], factory) :\n factory();\n})((function () {\n var __meta__ = {\n id: \"dataviz.qrcode\",\n name: \"QRCode\",\n category: \"dataviz\",\n description: \"QRCode widget.\",\n depends: [ \"dataviz.core\", \"drawing\" ]\n };\n\n (function($, undefined$1) {\n var kendo = window.kendo,\n extend = $.extend,\n draw = kendo.drawing,\n dataviz = kendo.dataviz,\n Widget = kendo.ui.Widget,\n Box2D = dataviz.Box2D,\n terminator = \"0000\",\n NUMERIC = \"numeric\",\n ALPHA_NUMERIC = \"alphanumeric\",\n BYTE = \"byte\",\n powersOfTwo = { \"1\": 0 },\n powersOfTwoResult = { \"0\": 1 },\n generatorPolynomials = [[1,0],[1,25,0]],\n irregularAlignmentPatternsStartDistance = { 15: 20,16: 20,18: 24,19: 24,22: 20,24: 22,26: 24,28: 20,30: 20,31: 24,32: 28,33: 24,36: 18,37: 22,39: 20,40: 24 },\n versionsCodewordsInformation = [{ L: { groups: [[1,19]],totalDataCodewords: 19,errorCodewordsPerBlock: 7 },M: { groups: [[1,16]],totalDataCodewords: 16,errorCodewordsPerBlock: 10 },Q: { groups: [[1,13]],totalDataCodewords: 13,errorCodewordsPerBlock: 13 },H: { groups: [[1,9]],totalDataCodewords: 9,errorCodewordsPerBlock: 17 } },{ L: { groups: [[1,34]],totalDataCodewords: 34,errorCodewordsPerBlock: 10 },M: { groups: [[1,28]],totalDataCodewords: 28,errorCodewordsPerBlock: 16 },Q: { groups: [[1,22]],totalDataCodewords: 22,errorCodewordsPerBlock: 22 },H: { groups: [[1,16]],totalDataCodewords: 16,errorCodewordsPerBlock: 28 } },{ L: { groups: [[1,55]],totalDataCodewords: 55,errorCodewordsPerBlock: 15 },M: { groups: [[1,44]],totalDataCodewords: 44,errorCodewordsPerBlock: 26 },Q: { groups: [[2,17]],totalDataCodewords: 34,errorCodewordsPerBlock: 18 },H: { groups: [[2,13]],totalDataCodewords: 26,errorCodewordsPerBlock: 22 } },{ L: { groups: [[1,80]],totalDataCodewords: 80,errorCodewordsPerBlock: 20 },M: { groups: [[2,32]],totalDataCodewords: 64,errorCodewordsPerBlock: 18 },Q: { groups: [[2,24]],totalDataCodewords: 48,errorCodewordsPerBlock: 26 },H: { groups: [[4,9]],totalDataCodewords: 36,errorCodewordsPerBlock: 16 } },{ L: { groups: [[1,108]],totalDataCodewords: 108,errorCodewordsPerBlock: 26 },M: { groups: [[2,43]],totalDataCodewords: 86,errorCodewordsPerBlock: 24 },Q: { groups: [[2,15],[2,16]],totalDataCodewords: 62,errorCodewordsPerBlock: 18 },H: { groups: [[2,11],[2,12]],totalDataCodewords: 46,errorCodewordsPerBlock: 22 } },{ L: { groups: [[2,68]],totalDataCodewords: 136,errorCodewordsPerBlock: 18 },M: { groups: [[4,27]],totalDataCodewords: 108,errorCodewordsPerBlock: 16 },Q: { groups: [[4,19]],totalDataCodewords: 76,errorCodewordsPerBlock: 24 },H: { groups: [[4,15]],totalDataCodewords: 60,errorCodewordsPerBlock: 28 } },{ L: { groups: [[2,78]],totalDataCodewords: 156,errorCodewordsPerBlock: 20 },M: { groups: [[4,31]],totalDataCodewords: 124,errorCodewordsPerBlock: 18 },Q: { groups: [[2,14],[4,15]],totalDataCodewords: 88,errorCodewordsPerBlock: 18 },H: { groups: [[4,13],[1,14]],totalDataCodewords: 66,errorCodewordsPerBlock: 26 } },{ L: { groups: [[2,97]],totalDataCodewords: 194,errorCodewordsPerBlock: 24 },M: { groups: [[2,38],[2,39]],totalDataCodewords: 154,errorCodewordsPerBlock: 22 },Q: { groups: [[4,18],[2,19]],totalDataCodewords: 110,errorCodewordsPerBlock: 22 },H: { groups: [[4,14],[2,15]],totalDataCodewords: 86,errorCodewordsPerBlock: 26 } },{ L: { groups: [[2,116]],totalDataCodewords: 232,errorCodewordsPerBlock: 30 },M: { groups: [[3,36],[2,37]],totalDataCodewords: 182,errorCodewordsPerBlock: 22 },Q: { groups: [[4,16],[4,17]],totalDataCodewords: 132,errorCodewordsPerBlock: 20 },H: { groups: [[4,12],[4,13]],totalDataCodewords: 100,errorCodewordsPerBlock: 24 } },{ L: { groups: [[2,68],[2,69]],totalDataCodewords: 274,errorCodewordsPerBlock: 18 },M: { groups: [[4,43],[1,44]],totalDataCodewords: 216,errorCodewordsPerBlock: 26 },Q: { groups: [[6,19],[2,20]],totalDataCodewords: 154,errorCodewordsPerBlock: 24 },H: { groups: [[6,15],[2,16]],totalDataCodewords: 122,errorCodewordsPerBlock: 28 } },{ L: { groups: [[4,81]],totalDataCodewords: 324,errorCodewordsPerBlock: 20 },M: { groups: [[1,50],[4,51]],totalDataCodewords: 254,errorCodewordsPerBlock: 30 },Q: { groups: [[4,22],[4,23]],totalDataCodewords: 180,errorCodewordsPerBlock: 28 },H: { groups: [[3,12],[8,13]],totalDataCodewords: 140,errorCodewordsPerBlock: 24 } },{ L: { groups: [[2,92],[2,93]],totalDataCodewords: 370,errorCodewordsPerBlock: 24 },M: { groups: [[6,36],[2,37]],totalDataCodewords: 290,errorCodewordsPerBlock: 22 },Q: { groups: [[4,20],[6,21]],totalDataCodewords: 206,errorCodewordsPerBlock: 26 },H: { groups: [[7,14],[4,15]],totalDataCodewords: 158,errorCodewordsPerBlock: 28 } },{ L: { groups: [[4,107]],totalDataCodewords: 428,errorCodewordsPerBlock: 26 },M: { groups: [[8,37],[1,38]],totalDataCodewords: 334,errorCodewordsPerBlock: 22 },Q: { groups: [[8,20],[4,21]],totalDataCodewords: 244,errorCodewordsPerBlock: 24 },H: { groups: [[12,11],[4,12]],totalDataCodewords: 180,errorCodewordsPerBlock: 22 } },{ L: { groups: [[3,115],[1,116]],totalDataCodewords: 461,errorCodewordsPerBlock: 30 },M: { groups: [[4,40],[5,41]],totalDataCodewords: 365,errorCodewordsPerBlock: 24 },Q: { groups: [[11,16],[5,17]],totalDataCodewords: 261,errorCodewordsPerBlock: 20 },H: { groups: [[11,12],[5,13]],totalDataCodewords: 197,errorCodewordsPerBlock: 24 } },{ L: { groups: [[5,87],[1,88]],totalDataCodewords: 523,errorCodewordsPerBlock: 22 },M: { groups: [[5,41],[5,42]],totalDataCodewords: 415,errorCodewordsPerBlock: 24 },Q: { groups: [[5,24],[7,25]],totalDataCodewords: 295,errorCodewordsPerBlock: 30 },H: { groups: [[11,12],[7,13]],totalDataCodewords: 223,errorCodewordsPerBlock: 24 } },{ L: { groups: [[5,98],[1,99]],totalDataCodewords: 589,errorCodewordsPerBlock: 24 },M: { groups: [[7,45],[3,46]],totalDataCodewords: 453,errorCodewordsPerBlock: 28 },Q: { groups: [[15,19],[2,20]],totalDataCodewords: 325,errorCodewordsPerBlock: 24 },H: { groups: [[3,15],[13,16]],totalDataCodewords: 253,errorCodewordsPerBlock: 30 } },{ L: { groups: [[1,107],[5,108]],totalDataCodewords: 647,errorCodewordsPerBlock: 28 },M: { groups: [[10,46],[1,47]],totalDataCodewords: 507,errorCodewordsPerBlock: 28 },Q: { groups: [[1,22],[15,23]],totalDataCodewords: 367,errorCodewordsPerBlock: 28 },H: { groups: [[2,14],[17,15]],totalDataCodewords: 283,errorCodewordsPerBlock: 28 } },{ L: { groups: [[5,120],[1,121]],totalDataCodewords: 721,errorCodewordsPerBlock: 30 },M: { groups: [[9,43],[4,44]],totalDataCodewords: 563,errorCodewordsPerBlock: 26 },Q: { groups: [[17,22],[1,23]],totalDataCodewords: 397,errorCodewordsPerBlock: 28 },H: { groups: [[2,14],[19,15]],totalDataCodewords: 313,errorCodewordsPerBlock: 28 } },{ L: { groups: [[3,113],[4,114]],totalDataCodewords: 795,errorCodewordsPerBlock: 28 },M: { groups: [[3,44],[11,45]],totalDataCodewords: 627,errorCodewordsPerBlock: 26 },Q: { groups: [[17,21],[4,22]],totalDataCodewords: 445,errorCodewordsPerBlock: 26 },H: { groups: [[9,13],[16,14]],totalDataCodewords: 341,errorCodewordsPerBlock: 26 } },{ L: { groups: [[3,107],[5,108]],totalDataCodewords: 861,errorCodewordsPerBlock: 28 },M: { groups: [[3,41],[13,42]],totalDataCodewords: 669,errorCodewordsPerBlock: 26 },Q: { groups: [[15,24],[5,25]],totalDataCodewords: 485,errorCodewordsPerBlock: 30 },H: { groups: [[15,15],[10,16]],totalDataCodewords: 385,errorCodewordsPerBlock: 28 } },{ L: { groups: [[4,116],[4,117]],totalDataCodewords: 932,errorCodewordsPerBlock: 28 },M: { groups: [[17,42]],totalDataCodewords: 714,errorCodewordsPerBlock: 26 },Q: { groups: [[17,22],[6,23]],totalDataCodewords: 512,errorCodewordsPerBlock: 28 },H: { groups: [[19,16],[6,17]],totalDataCodewords: 406,errorCodewordsPerBlock: 30 } },{ L: { groups: [[2,111],[7,112]],totalDataCodewords: 1006,errorCodewordsPerBlock: 28 },M: { groups: [[17,46]],totalDataCodewords: 782,errorCodewordsPerBlock: 28 },Q: { groups: [[7,24],[16,25]],totalDataCodewords: 568,errorCodewordsPerBlock: 30 },H: { groups: [[34,13]],totalDataCodewords: 442,errorCodewordsPerBlock: 24 } },{ L: { groups: [[4,121],[5,122]],totalDataCodewords: 1094,errorCodewordsPerBlock: 30 },M: { groups: [[4,47],[14,48]],totalDataCodewords: 860,errorCodewordsPerBlock: 28 },Q: { groups: [[11,24],[14,25]],totalDataCodewords: 614,errorCodewordsPerBlock: 30 },H: { groups: [[16,15],[14,16]],totalDataCodewords: 464,errorCodewordsPerBlock: 30 } },{ L: { groups: [[6,117],[4,118]],totalDataCodewords: 1174,errorCodewordsPerBlock: 30 },M: { groups: [[6,45],[14,46]],totalDataCodewords: 914,errorCodewordsPerBlock: 28 },Q: { groups: [[11,24],[16,25]],totalDataCodewords: 664,errorCodewordsPerBlock: 30 },H: { groups: [[30,16],[2,17]],totalDataCodewords: 514,errorCodewordsPerBlock: 30 } },{ L: { groups: [[8,106],[4,107]],totalDataCodewords: 1276,errorCodewordsPerBlock: 26 },M: { groups: [[8,47],[13,48]],totalDataCodewords: 1000,errorCodewordsPerBlock: 28 },Q: { groups: [[7,24],[22,25]],totalDataCodewords: 718,errorCodewordsPerBlock: 30 },H: { groups: [[22,15],[13,16]],totalDataCodewords: 538,errorCodewordsPerBlock: 30 } },{ L: { groups: [[10,114],[2,115]],totalDataCodewords: 1370,errorCodewordsPerBlock: 28 },M: { groups: [[19,46],[4,47]],totalDataCodewords: 1062,errorCodewordsPerBlock: 28 },Q: { groups: [[28,22],[6,23]],totalDataCodewords: 754,errorCodewordsPerBlock: 28 },H: { groups: [[33,16],[4,17]],totalDataCodewords: 596,errorCodewordsPerBlock: 30 } },{ L: { groups: [[8,122],[4,123]],totalDataCodewords: 1468,errorCodewordsPerBlock: 30 },M: { groups: [[22,45],[3,46]],totalDataCodewords: 1128,errorCodewordsPerBlock: 28 },Q: { groups: [[8,23],[26,24]],totalDataCodewords: 808,errorCodewordsPerBlock: 30 },H: { groups: [[12,15],[28,16]],totalDataCodewords: 628,errorCodewordsPerBlock: 30 } },{ L: { groups: [[3,117],[10,118]],totalDataCodewords: 1531,errorCodewordsPerBlock: 30 },M: { groups: [[3,45],[23,46]],totalDataCodewords: 1193,errorCodewordsPerBlock: 28 },Q: { groups: [[4,24],[31,25]],totalDataCodewords: 871,errorCodewordsPerBlock: 30 },H: { groups: [[11,15],[31,16]],totalDataCodewords: 661,errorCodewordsPerBlock: 30 } },{ L: { groups: [[7,116],[7,117]],totalDataCodewords: 1631,errorCodewordsPerBlock: 30 },M: { groups: [[21,45],[7,46]],totalDataCodewords: 1267,errorCodewordsPerBlock: 28 },Q: { groups: [[1,23],[37,24]],totalDataCodewords: 911,errorCodewordsPerBlock: 30 },H: { groups: [[19,15],[26,16]],totalDataCodewords: 701,errorCodewordsPerBlock: 30 } },{ L: { groups: [[5,115],[10,116]],totalDataCodewords: 1735,errorCodewordsPerBlock: 30 },M: { groups: [[19,47],[10,48]],totalDataCodewords: 1373,errorCodewordsPerBlock: 28 },Q: { groups: [[15,24],[25,25]],totalDataCodewords: 985,errorCodewordsPerBlock: 30 },H: { groups: [[23,15],[25,16]],totalDataCodewords: 745,errorCodewordsPerBlock: 30 } },{ L: { groups: [[13,115],[3,116]],totalDataCodewords: 1843,errorCodewordsPerBlock: 30 },M: { groups: [[2,46],[29,47]],totalDataCodewords: 1455,errorCodewordsPerBlock: 28 },Q: { groups: [[42,24],[1,25]],totalDataCodewords: 1033,errorCodewordsPerBlock: 30 },H: { groups: [[23,15],[28,16]],totalDataCodewords: 793,errorCodewordsPerBlock: 30 } },{ L: { groups: [[17,115]],totalDataCodewords: 1955,errorCodewordsPerBlock: 30 },M: { groups: [[10,46],[23,47]],totalDataCodewords: 1541,errorCodewordsPerBlock: 28 },Q: { groups: [[10,24],[35,25]],totalDataCodewords: 1115,errorCodewordsPerBlock: 30 },H: { groups: [[19,15],[35,16]],totalDataCodewords: 845,errorCodewordsPerBlock: 30 } },{ L: { groups: [[17,115],[1,116]],totalDataCodewords: 2071,errorCodewordsPerBlock: 30 },M: { groups: [[14,46],[21,47]],totalDataCodewords: 1631,errorCodewordsPerBlock: 28 },Q: { groups: [[29,24],[19,25]],totalDataCodewords: 1171,errorCodewordsPerBlock: 30 },H: { groups: [[11,15],[46,16]],totalDataCodewords: 901,errorCodewordsPerBlock: 30 } },{ L: { groups: [[13,115],[6,116]],totalDataCodewords: 2191,errorCodewordsPerBlock: 30 },M: { groups: [[14,46],[23,47]],totalDataCodewords: 1725,errorCodewordsPerBlock: 28 },Q: { groups: [[44,24],[7,25]],totalDataCodewords: 1231,errorCodewordsPerBlock: 30 },H: { groups: [[59,16],[1,17]],totalDataCodewords: 961,errorCodewordsPerBlock: 30 } },{ L: { groups: [[12,121],[7,122]],totalDataCodewords: 2306,errorCodewordsPerBlock: 30 },M: { groups: [[12,47],[26,48]],totalDataCodewords: 1812,errorCodewordsPerBlock: 28 },Q: { groups: [[39,24],[14,25]],totalDataCodewords: 1286,errorCodewordsPerBlock: 30 },H: { groups: [[22,15],[41,16]],totalDataCodewords: 986,errorCodewordsPerBlock: 30 } },{ L: { groups: [[6,121],[14,122]],totalDataCodewords: 2434,errorCodewordsPerBlock: 30 },M: { groups: [[6,47],[34,48]],totalDataCodewords: 1914,errorCodewordsPerBlock: 28 },Q: { groups: [[46,24],[10,25]],totalDataCodewords: 1354,errorCodewordsPerBlock: 30 },H: { groups: [[2,15],[64,16]],totalDataCodewords: 1054,errorCodewordsPerBlock: 30 } },{ L: { groups: [[17,122],[4,123]],totalDataCodewords: 2566,errorCodewordsPerBlock: 30 },M: { groups: [[29,46],[14,47]],totalDataCodewords: 1992,errorCodewordsPerBlock: 28 },Q: { groups: [[49,24],[10,25]],totalDataCodewords: 1426,errorCodewordsPerBlock: 30 },H: { groups: [[24,15],[46,16]],totalDataCodewords: 1096,errorCodewordsPerBlock: 30 } },{ L: { groups: [[4,122],[18,123]],totalDataCodewords: 2702,errorCodewordsPerBlock: 30 },M: { groups: [[13,46],[32,47]],totalDataCodewords: 2102,errorCodewordsPerBlock: 28 },Q: { groups: [[48,24],[14,25]],totalDataCodewords: 1502,errorCodewordsPerBlock: 30 },H: { groups: [[42,15],[32,16]],totalDataCodewords: 1142,errorCodewordsPerBlock: 30 } },{ L: { groups: [[20,117],[4,118]],totalDataCodewords: 2812,errorCodewordsPerBlock: 30 },M: { groups: [[40,47],[7,48]],totalDataCodewords: 2216,errorCodewordsPerBlock: 28 },Q: { groups: [[43,24],[22,25]],totalDataCodewords: 1582,errorCodewordsPerBlock: 30 },H: { groups: [[10,15],[67,16]],totalDataCodewords: 1222,errorCodewordsPerBlock: 30 } },{ L: { groups: [[19,118],[6,119]],totalDataCodewords: 2956,errorCodewordsPerBlock: 30 },M: { groups: [[18,47],[31,48]],totalDataCodewords: 2334,errorCodewordsPerBlock: 28 },Q: { groups: [[34,24],[34,25]],totalDataCodewords: 1666,errorCodewordsPerBlock: 30 },H: { groups: [[20,15],[61,16]],totalDataCodewords: 1276,errorCodewordsPerBlock: 30 } }],\n finderPattern = [1,0,1,1,1],\n alignmentPattern = [1,0,1],\n errorCorrectionPatterns = { L: \"01\", M: \"00\", Q: \"11\", H: \"10\" },\n formatMaskPattern = \"101010000010010\",\n formatGeneratorPolynomial = \"10100110111\",\n versionGeneratorPolynomial = \"1111100100101\",\n paddingCodewords = [\"11101100\", \"00010001\"],\n finderPatternValue = 93,\n maskPatternConditions = [\n function(row,column) {return (row + column) % 2 === 0;},\n function(row) {return row % 2 === 0;},\n function(row,column) {return column % 3 === 0;},\n function(row,column) {return (row + column) % 3 === 0;},\n function(row,column) {return (Math.floor(row / 2) + Math.floor(column / 3)) % 2 === 0;},\n function(row,column) {return ((row * column) % 2) + ((row * column) % 3) === 0;},\n function(row,column) {return (((row * column) % 2) + ((row * column) % 3)) % 2 === 0;},\n function(row,column) {return (((row + column) % 2) + ((row * column) % 3)) % 2 === 0;}\n ],\n numberRegex = /^\\d+/,\n alphaPattern = \"A-Z0-9 $%*+./:-\",\n alphaExclusiveSet = \"A-Z $%*+./:-\",\n alphaRegex = new RegExp(\"^[\" + alphaExclusiveSet + \"]+\"),\n alphaNumericRegex = new RegExp(\"^[\" + alphaPattern + \"]+\"),\n byteRegex = new RegExp(\"^[^\" + alphaPattern + \"]+\"),\n initMinNumericBeforeAlpha = 8,\n initMinNumericBeforeByte = 5,\n initMinAlphaBeforeByte = 8,\n minNumericBeforeAlpha = 17,\n minNumericBeforeByte = 9,\n minAlphaBeforeByte = 16,\n round = Math.round,\n IMAGE = \"image\",\n SWISS_QR = \"swiss\",\n crossPattern = [[0,1],[1,1],[1,2],[2,2],[2,1],[3,1],[3,0],[2,0],[2,-1],[1,-1],[1,0]],\n squarePattern = [[0,1],[1,1],[1,0]],\n DEFAULT_LOGO_SIZE = 7;\n\n function toDecimal(value) {\n return parseInt(value, 2);\n }\n\n function toBitsString(value, length) {\n var result = Number(value).toString(2);\n if (result.length < length) {\n result = new Array(length - result.length + 1).join(0) + result;\n }\n return result;\n }\n\n function splitInto(str, n) {\n var result = [],\n idx = 0;\n while (idx < str.length) {\n result.push(str.substring(idx, idx + n));\n idx += n;\n }\n return result;\n }\n\n var QRDataMode = kendo.Class.extend({\n getVersionIndex: function(version) {\n if (version < 10) {\n return 0;\n }\n else if (version > 26) {\n return 2;\n }\n\n return 1;\n },\n getBitsCharacterCount: function(version) {\n var mode = this;\n return mode.bitsInCharacterCount[mode.getVersionIndex(version || 40)];\n },\n getModeCountString: function(length, version) {\n var mode = this;\n return mode.modeIndicator + toBitsString(length, mode.getBitsCharacterCount(version));\n },\n encode: function() {},\n getStringBitsLength: function() {},\n getValue: function() {},\n modeIndicator: \"\",\n bitsInCharacterCount: []\n });\n\n var modes = {};\n modes[NUMERIC] = QRDataMode.extend({\n bitsInCharacterCount: [10, 12, 14],\n modeIndicator: \"0001\",\n getValue: function(character) {\n return parseInt(character, 10);\n },\n encode: function(str, version) {\n var mode = this,\n parts = splitInto(str, 3),\n result = mode.getModeCountString(str.length, version);\n\n for (var i = 0; i < parts.length - 1; i++) {\n result += toBitsString(parts[i], 10);\n }\n return result + toBitsString(parts[i], 1 + 3 * parts[i].length);\n },\n getStringBitsLength: function(inputLength, version) {\n var mod3 = inputLength % 3;\n return 4 + this.getBitsCharacterCount(version) + 10 * Math.floor(inputLength / 3) + 3 * mod3 + (mod3 === 0 ? 0 : 1);\n }\n });\n\n modes[ALPHA_NUMERIC] = QRDataMode.extend({\n characters: { \"0\": 0,\"1\": 1,\"2\": 2,\"3\": 3,\"4\": 4,\"5\": 5,\"6\": 6,\"7\": 7,\"8\": 8,\"9\": 9,\"A\": 10,\"B\": 11,\"C\": 12,\"D\": 13,\"E\": 14,\"F\": 15,\"G\": 16,\"H\": 17,\"I\": 18,\"J\": 19,\"K\": 20,\"L\": 21,\"M\": 22,\"N\": 23,\"O\": 24,\"P\": 25,\"Q\": 26,\"R\": 27,\"S\": 28,\"T\": 29,\"U\": 30,\"V\": 31,\"W\": 32,\"X\": 33,\"Y\": 34,\"Z\": 35,\" \": 36,\"$\": 37,\"%\": 38,\"*\": 39,\"+\": 40,\"-\": 41,\".\": 42,\"/\": 43,\":\": 44 },\n bitsInCharacterCount: [9,11,13],\n modeIndicator: \"0010\",\n getValue: function(character) {\n return this.characters[character];\n },\n encode: function(str, version) {\n var mode = this,\n parts = splitInto(str, 2),\n result = mode.getModeCountString(str.length, version),\n value;\n for (var i = 0; i < parts.length - 1; i++) {\n value = 45 * mode.getValue(parts[i].charAt(0)) + mode.getValue(parts[i].charAt(1));\n result += toBitsString(value, 11);\n }\n value = parts[i].length == 2 ?\n 45 * mode.getValue(parts[i].charAt(0)) + mode.getValue(parts[i].charAt(1)) :\n mode.getValue(parts[i].charAt(0));\n return result + toBitsString(value, 1 + 5 * parts[i].length);\n },\n getStringBitsLength: function(inputLength, version) {\n return 4 + this.getBitsCharacterCount(version) + 11 * Math.floor(inputLength / 2) + 6 * (inputLength % 2);\n }\n });\n\n modes[BYTE] = QRDataMode.extend({\n bitsInCharacterCount: [8,16,16],\n modeIndicator: \"0100\",\n getValue: function(character) {\n var code = character.charCodeAt(0);\n if (code <= 127 || (160 <= code && code <= 255)) {\n return code;\n }\n else {\n throw new Error(\"Unsupported character: \" + character);\n }\n },\n encode: function(str, version) {\n var mode = this,\n result = mode.getModeCountString(str.length, version);\n\n for (var i = 0; i < str.length; i++) {\n result += toBitsString(mode.getValue(str.charAt(i)), 8);\n }\n return result;\n },\n getStringBitsLength: function(inputLength, version) {\n return 4 + this.getBitsCharacterCount(version) + 8 * inputLength;\n }\n });\n\n var modeInstances = {};\n for (var mode in modes) {\n modeInstances[mode] = new modes[mode]();\n }\n\n var FreeCellVisitor = function(matrix) {\n var that = this,\n row = matrix.length - 1,\n column = matrix.length - 1,\n startColumn = column,\n dir = -1,\n c = 0;\n that.move = function() {\n row += dir * c;\n c ^= 1;\n column = startColumn - c;\n };\n that.getNextCell = function() {\n while (matrix[row][column] !== undefined$1) {\n that.move();\n if (row < 0 || row >= matrix.length) {\n dir = -dir;\n startColumn -= startColumn != 8 ? 2 : 3;\n column = startColumn;\n row = dir < 0 ? matrix.length - 1 : 0;\n }\n }\n return { row: row, column: column };\n };\n that.getNextRemainderCell = function() {\n that.move();\n if (matrix[row][column] === undefined$1) {\n return { row: row, column: column };\n }\n };\n };\n\n function fillFunctionCell(matrices, bit, x, y) {\n for (var i = 0; i < matrices.length; i++) {\n matrices[i][x][y] = bit;\n }\n }\n\n function fillDataCell(matrices, bit, x, y) {\n for (var i = 0; i < maskPatternConditions.length; i++) {\n matrices[i][x][y] = maskPatternConditions[i](x,y) ? bit ^ 1 : parseInt(bit, 10);\n }\n }\n\n var fillData = function(matrices, blocks) {\n var cellVisitor = new FreeCellVisitor(matrices[0]),\n block,\n codewordIdx,\n cell;\n\n for (var blockIdx = 0; blockIdx < blocks.length; blockIdx++) {\n block = blocks[blockIdx];\n codewordIdx = 0;\n while (block.length > 0) {\n for (var i = 0; i < block.length; i++) {\n for (var j = 0; j < 8; j++) {\n cell = cellVisitor.getNextCell();\n fillDataCell(matrices, block[i][codewordIdx].charAt(j), cell.row, cell.column);\n }\n }\n\n codewordIdx++;\n while (block[0] && codewordIdx == block[0].length) {\n block.splice(0,1);\n }\n }\n }\n\n while ((cell = cellVisitor.getNextRemainderCell())) {\n fillDataCell(matrices, 0, cell.row, cell.column);\n }\n };\n\n var padDataString = function(dataString, totalDataCodewords) {\n var dataBitsCount = totalDataCodewords * 8,\n terminatorIndex = 0,\n paddingCodewordIndex = 0;\n while (dataString.length < dataBitsCount && terminatorIndex < terminator.length) {\n dataString += terminator.charAt(terminatorIndex++);\n }\n\n if (dataString.length % 8 !== 0) {\n dataString += new Array(9 - dataString.length % 8).join(\"0\");\n }\n\n while (dataString.length < dataBitsCount) {\n dataString += paddingCodewords[paddingCodewordIndex];\n paddingCodewordIndex ^= 1;\n }\n return dataString;\n };\n\n function generatePowersOfTwo() {\n var result;\n for (var power = 1; power < 255; power++) {\n\n result = powersOfTwoResult[power - 1] * 2;\n if (result > 255) {\n result = result ^ 285;\n }\n\n powersOfTwoResult[power] = result;\n powersOfTwo[result] = power;\n }\n\n result = (powersOfTwoResult[power - 1] * 2) ^ 285;\n powersOfTwoResult[power] = result;\n powersOfTwoResult[-1] = 0;\n }\n\n var xorPolynomials = function(x,y) {\n var result = [],\n idx = x.length - 2;\n for (var i = idx; i >= 0; i--) {\n result[i] = x[i] ^ y[i];\n }\n\n return result;\n };\n\n var multiplyPolynomials = function(x, y) {\n var result = [];\n for (var i = 0; i < x.length; i++) {\n for (var j = 0; j < y.length; j++) {\n if (result[i + j] === undefined$1) {\n result[i + j] = (x[i] + (y[j] >= 0 ? y[j] : 0)) % 255;\n }\n else {\n result[i + j] = powersOfTwo[powersOfTwoResult[result[i + j]] ^ powersOfTwoResult[(x[i] + y[j]) % 255]];\n }\n }\n }\n\n return result;\n };\n\n function generateGeneratorPolynomials() {\n var maxErrorCorrectionCodeWordsCount = 68;\n for (var idx = 2; idx <= maxErrorCorrectionCodeWordsCount; idx++) {\n var firstPolynomial = generatorPolynomials[idx - 1],\n secondPolynomial = [idx, 0];\n generatorPolynomials[idx] = multiplyPolynomials(firstPolynomial, secondPolynomial);\n }\n }\n\n //possibly generate on demand\n generatePowersOfTwo();\n generateGeneratorPolynomials();\n\n function multiplyByConstant(polynomial, power) {\n var result = [],\n idx = polynomial.length - 1;\n do {\n result[idx] = powersOfTwoResult[(polynomial[idx] + power) % 255];\n idx--;\n } while (polynomial[idx] !== undefined$1);\n\n return result;\n }\n\n var generateErrorCodewords = function(data, errorCodewordsCount) {\n var generator = generatorPolynomials[errorCodewordsCount - 1],\n result = new Array(errorCodewordsCount).concat(data),\n generatorPolynomial = new Array(result.length - generator.length).concat(generator),\n steps = data.length,\n errorCodewords = [],\n divisor,\n idx;\n\n for (idx = 0; idx < steps; idx++) {\n divisor = multiplyByConstant(generatorPolynomial, powersOfTwo[result[result.length - 1]]);\n generatorPolynomial.splice(0,1);\n\n result = xorPolynomials(divisor, result);\n }\n\n for (idx = result.length - 1; idx >= 0; idx--) {\n errorCodewords[errorCodewordsCount - 1 - idx] = toBitsString(result[idx], 8);\n }\n\n return errorCodewords;\n };\n\n var getBlocks = function(dataStream, versionCodewordsInformation) {\n var codewordStart = 0,\n dataBlocks = [],\n errorBlocks = [],\n dataBlock,\n versionGroups = versionCodewordsInformation.groups,\n blockCodewordsCount,\n groupBlocksCount,\n messagePolynomial,\n codeword;\n\n for (var groupIdx = 0; groupIdx < versionGroups.length; groupIdx++) {\n groupBlocksCount = versionGroups[groupIdx][0];\n for (var blockIdx = 0; blockIdx < groupBlocksCount; blockIdx++) {\n blockCodewordsCount = versionGroups[groupIdx][1];\n dataBlock = [];\n messagePolynomial = [];\n for (var codewordIdx = 1; codewordIdx <= blockCodewordsCount; codewordIdx++) {\n codeword = dataStream.substring(codewordStart, codewordStart + 8);\n dataBlock.push(codeword);\n messagePolynomial[blockCodewordsCount - codewordIdx] = toDecimal(codeword);\n codewordStart += 8;\n }\n dataBlocks.push(dataBlock);\n errorBlocks.push(generateErrorCodewords(messagePolynomial,\n versionCodewordsInformation.errorCodewordsPerBlock));\n }\n }\n return [dataBlocks, errorBlocks];\n };\n\n var chooseMode = function(str, minNumericBeforeAlpha, minNumericBeforeByte, minAlphaBeforeByte, previousMode) {\n var numeric = numberRegex.exec(str),\n numericMatch = numeric ? numeric[0] : \"\",\n alpha = alphaRegex.exec(str),\n alphaMatch = alpha ? alpha[0] : \"\",\n alphaNumeric = alphaNumericRegex.exec(str),\n alphaNumericMatch = alphaNumeric ? alphaNumeric[0] : \"\",\n mode,\n modeString;\n\n if (numericMatch && (numericMatch.length >= minNumericBeforeAlpha ||\n str.length == numericMatch.length || (numericMatch.length >= minNumericBeforeByte &&\n !alphaNumericRegex.test(str.charAt(numericMatch.length))))) {\n mode = NUMERIC;\n modeString = numericMatch;\n }\n else if (alphaNumericMatch && (str.length == alphaNumericMatch.length ||\n alphaNumericMatch.length >= minAlphaBeforeByte || previousMode == ALPHA_NUMERIC)) {\n mode = ALPHA_NUMERIC;\n modeString = numericMatch || alphaMatch;\n }\n else {\n mode = BYTE;\n if (alphaNumericMatch) {\n modeString = alphaNumericMatch + byteRegex.exec(str.substring(alphaNumericMatch.length))[0];\n }\n else {\n modeString = byteRegex.exec(str)[0];\n }\n }\n\n return {\n mode: mode,\n modeString: modeString\n };\n };\n\n var getModes = function(str) {\n var modes = [],\n previousMode,\n idx = 0;\n modes.push(chooseMode(str, initMinNumericBeforeAlpha, initMinNumericBeforeByte, initMinAlphaBeforeByte, previousMode));\n previousMode = modes[0].mode;\n str = str.substr(modes[0].modeString.length);\n\n while (str.length > 0) {\n var nextMode = chooseMode(str, minNumericBeforeAlpha, minNumericBeforeByte, minAlphaBeforeByte, previousMode);\n if (nextMode.mode != previousMode) {\n previousMode = nextMode.mode;\n modes.push(nextMode);\n idx++;\n }\n else {\n modes[idx].modeString += nextMode.modeString;\n }\n str = str.substr(nextMode.modeString.length);\n }\n\n return modes;\n };\n\n var getDataCodewordsCount = function(modes) {\n var length = 0,\n mode;\n for (var i = 0; i < modes.length; i++) {\n mode = modeInstances[modes[i].mode];\n length += mode.getStringBitsLength(modes[i].modeString.length);\n }\n\n return Math.ceil(length / 8);\n };\n\n var getVersion = function(dataCodewordsCount, errorCorrectionLevel) {\n var x = 0,\n y = versionsCodewordsInformation.length - 1,\n version = Math.floor(versionsCodewordsInformation.length / 2);\n\n do {\n if (dataCodewordsCount < versionsCodewordsInformation[version][errorCorrectionLevel].totalDataCodewords) {\n y = version;\n }\n else {\n x = version;\n }\n version = x + Math.floor((y - x) / 2);\n\n } while (y - x > 1);\n\n if (dataCodewordsCount <= versionsCodewordsInformation[x][errorCorrectionLevel].totalDataCodewords) {\n return version + 1;\n }\n return y + 1;\n };\n\n var getDataString = function(modes, version) {\n var dataString = \"\",\n mode;\n for (var i = 0; i < modes.length; i++) {\n mode = modeInstances[modes[i].mode];\n dataString += mode.encode(modes[i].modeString, version);\n }\n\n return dataString;\n };\n\n //fix case all zeros\n var encodeFormatInformation = function(format) {\n var formatNumber = toDecimal(format),\n encodedString,\n result = \"\";\n if (formatNumber === 0) {\n return \"101010000010010\";\n }\n else {\n encodedString = encodeBCH(toDecimal(format), formatGeneratorPolynomial, 15);\n }\n for (var i = 0; i < encodedString.length; i++) {\n result += encodedString.charAt(i) ^ formatMaskPattern.charAt(i);\n }\n\n return result;\n };\n\n var encodeBCH = function(value, generatorPolynomial, codeLength) {\n var generatorNumber = toDecimal(generatorPolynomial),\n polynomialLength = generatorPolynomial.length - 1,\n valueNumber = value << polynomialLength,\n length = codeLength - polynomialLength,\n valueString = toBitsString(value, length),\n result = dividePolynomials(valueNumber, generatorNumber);\n result = valueString + toBitsString(result, polynomialLength);\n return result;\n };\n\n var dividePolynomials = function(numberX,numberY) {\n var yLength = numberY.toString(2).length,\n xLength = numberX.toString(2).length;\n do {\n numberX ^= numberY << xLength - yLength;\n xLength = numberX.toString(2).length;\n }\n while (xLength >= yLength);\n\n return numberX;\n };\n\n function getNumberAt(str, idx) {\n return parseInt(str.charAt(idx), 10);\n }\n\n var initMatrices = function(version) {\n var matrices = [],\n modules = 17 + 4 * version;\n for (var i = 0; i < maskPatternConditions.length; i++) {\n matrices[i] = new Array(modules);\n for (var j = 0; j < modules; j++) {\n matrices[i][j] = new Array(modules);\n }\n }\n\n return matrices;\n };\n\n var addFormatInformation = function(matrices, formatString) {\n var matrix = matrices[0],\n x,\n y,\n idx = 0,\n length = formatString.length;\n\n for (x = 0, y = 8; x <= 8; x++) {\n if (x !== 6) {\n fillFunctionCell(matrices, getNumberAt(formatString, length - 1 - idx++), x, y);\n }\n }\n\n for (x = 8, y = 7; y >= 0; y--) {\n if (y !== 6) {\n fillFunctionCell(matrices, getNumberAt(formatString, length - 1 - idx++), x, y);\n }\n }\n idx = 0;\n for (y = matrix.length - 1, x = 8; y >= matrix.length - 8; y--) {\n fillFunctionCell(matrices,getNumberAt(formatString, length - 1 - idx++), x, y);\n }\n\n fillFunctionCell(matrices, 1, matrix.length - 8, 8);\n\n for (x = matrix.length - 7, y = 8; x < matrix.length; x++) {\n fillFunctionCell(matrices, getNumberAt(formatString, length - 1 - idx++), x, y);\n }\n };\n\n var encodeVersionInformation = function(version) {\n return encodeBCH(version, versionGeneratorPolynomial, 18);\n };\n\n var addVersionInformation = function(matrices, dataString) {\n var matrix = matrices[0],\n modules = matrix.length,\n x1 = 0,\n y1 = modules - 11,\n x2 = modules - 11,\n y2 = 0,\n quotient,\n mod,\n value;\n\n for (var idx = 0; idx < dataString.length; idx++) {\n quotient = Math.floor(idx / 3);\n mod = idx % 3;\n value = getNumberAt(dataString, dataString.length - idx - 1);\n fillFunctionCell(matrices, value, x1 + quotient, y1 + mod);\n fillFunctionCell(matrices, value, x2 + mod, y2 + quotient);\n }\n };\n\n var addCentricPattern = function(matrices, pattern, x, y) {\n var size = pattern.length + 2,\n length = pattern.length + 1,\n value;\n\n for (var i = 0; i < pattern.length; i++) {\n for (var j = i; j < size - i; j++) {\n value = pattern[i];\n fillFunctionCell(matrices, value, x + j, y + i);\n fillFunctionCell(matrices, value, x + i, y + j);\n fillFunctionCell(matrices, value, x + length - j, y + length - i);\n fillFunctionCell(matrices, value, x + length - i, y + length - j);\n }\n }\n };\n\n var addFinderSeparator = function(matrices, direction, x, y) {\n var nextX = x,\n nextY = y,\n matrix = matrices[0];\n do {\n fillFunctionCell(matrices, 0, nextX, y);\n fillFunctionCell(matrices, 0, x, nextY);\n nextX += direction[0];\n nextY += direction[1];\n }\n while (nextX >= 0 && nextX < matrix.length);\n };\n\n var addFinderPatterns = function(matrices) {\n var modules = matrices[0].length;\n addCentricPattern(matrices, finderPattern, 0, 0);\n addFinderSeparator(matrices, [-1,-1], 7,7);\n addCentricPattern(matrices, finderPattern, modules - 7, 0);\n addFinderSeparator(matrices, [1,-1], modules - 8, 7);\n addCentricPattern(matrices, finderPattern, 0 , modules - 7);\n addFinderSeparator(matrices, [-1,1],7, modules - 8);\n };\n\n var addAlignmentPatterns = function(matrices, version) {\n if (version < 2) {\n return;\n }\n\n var matrix = matrices[0],\n modules = matrix.length,\n pointsCount = Math.floor(version / 7),\n points = [6],\n startDistance,\n distance,\n idx = 0;\n\n if ((startDistance = irregularAlignmentPatternsStartDistance[version])) {\n distance = (modules - 13 - startDistance) / pointsCount;\n }\n else {\n startDistance = distance = (modules - 13) / (pointsCount + 1);\n }\n points.push(points[idx++] + startDistance);\n while ((points[idx] + distance) < modules) {\n points.push(points[idx++] + distance);\n }\n for (var i = 0; i < points.length; i++) {\n for (var j = 0; j < points.length; j++) {\n if (matrix[points[i]][points[j]] === undefined$1) {\n addCentricPattern(matrices, alignmentPattern, points[i] - 2, points[j] - 2);\n }\n }\n }\n };\n\n var addTimingFunctions = function(matrices) {\n var row = 6,\n column = 6,\n value = 1,\n modules = matrices[0].length;\n for (var i = 8; i < modules - 8; i++) {\n fillFunctionCell(matrices, value, row, i);\n fillFunctionCell(matrices, value, i, column);\n value ^= 1;\n }\n };\n\n var scoreMaskMatrixes = function(matrices) {\n var scores = [],\n previousBits = [],\n darkModules = [],\n patterns = [],\n adjacentSameBits = [],\n matrix,\n i,\n row = 0,\n column = 1,\n modules = matrices[0].length;\n\n\n for (i = 0; i < matrices.length; i++) {\n scores[i] = 0;\n darkModules[i] = 0;\n adjacentSameBits[i] = [0,0];\n patterns[i] = [0, 0];\n previousBits[i] = [];\n }\n for (i = 0; i < modules; i++) {\n for (var j = 0; j < modules; j++) {\n for (var k = 0; k < matrices.length; k++) {\n matrix = matrices[k];\n darkModules[k] += parseInt(matrix[i][j], 10);\n if (previousBits[k][row] === matrix[i][j] && i + 1 < modules && j - 1 >= 0 &&\n matrix[i + 1][j] == previousBits[k][row] && matrix[i + 1][j - 1] == previousBits[k][row]) {\n scores[k] += 3;\n }\n scoreFinderPatternOccurance(k, patterns, scores, row, matrix[i][j]);\n scoreFinderPatternOccurance(k, patterns, scores, column, matrix[j][i]);\n scoreAdjacentSameBits(k,scores,previousBits,matrix[i][j],adjacentSameBits,row);\n scoreAdjacentSameBits(k,scores,previousBits,matrix[j][i],adjacentSameBits,column);\n }\n }\n }\n var total = modules * modules,\n minIdx,\n min = Number.MAX_VALUE;\n\n for (i = 0; i < scores.length; i++) {\n scores[i] += calculateDarkModulesRatioScore(darkModules[i], total);\n if (scores[i] < min) {\n min = scores[i];\n minIdx = i;\n }\n }\n\n return minIdx;\n };\n\n function scoreFinderPatternOccurance(idx, patterns, scores, rowColumn, bit) {\n patterns[idx][rowColumn] = ((patterns[idx][rowColumn] << 1) ^ bit) % 128;\n if (patterns[idx][rowColumn] == finderPatternValue) {\n scores[idx] += 40;\n }\n }\n\n function scoreAdjacentSameBits(idx, scores, previousBits, bit, adjacentBits, rowColumn) {\n if (previousBits[idx][rowColumn] == bit) {\n adjacentBits[idx][rowColumn]++;\n }\n else {\n previousBits[idx][rowColumn] = bit;\n if (adjacentBits[idx][rowColumn] >= 5) {\n scores[idx] += 3 + adjacentBits[idx][rowColumn] - 5;\n }\n adjacentBits[idx][rowColumn] = 1;\n }\n }\n\n function calculateDarkModulesRatioScore(darkModules, total) {\n var percent = Math.floor((darkModules / total) * 100),\n mod5 = percent % 5,\n previous = Math.abs(percent - mod5 - 50),\n next = Math.abs(percent + 5 - mod5 - 50),\n score = 10 * Math.min(previous / 5, next / 5);\n return score;\n }\n\n var EncodingResult = function(dataString, version) {\n this.dataString = dataString;\n this.version = version;\n };\n\n var IsoEncoder = function() {\n this.getEncodingResult = function(inputString, errorCorrectionLevel) {\n var modes = getModes(inputString),\n dataCodewordsCount = getDataCodewordsCount(modes),\n version = getVersion(dataCodewordsCount, errorCorrectionLevel),\n dataString = getDataString(modes, version);\n\n return new EncodingResult(dataString, version);\n };\n };\n\n var UTF8Encoder = function() {\n this.mode = modeInstances[this.encodingMode];\n };\n\n UTF8Encoder.fn = UTF8Encoder.prototype = {\n encodingMode: BYTE,\n utfBOM: \"111011111011101110111111\",\n initialModeCountStringLength: 20,\n getEncodingResult: function(inputString, errorCorrectionLevel) {\n var that = this,\n data = that.encode(inputString),\n dataCodewordsCount = that.getDataCodewordsCount(data),\n version = getVersion(dataCodewordsCount, errorCorrectionLevel),\n dataString = that.mode.getModeCountString(data.length / 8, version) + data;\n\n return new EncodingResult(dataString, version);\n },\n getDataCodewordsCount: function(data) {\n var that = this,\n dataLength = data.length,\n dataCodewordsCount = Math.ceil(( that.initialModeCountStringLength + dataLength) / 8);\n\n return dataCodewordsCount;\n },\n encode: function(str) {\n var that = this,\n result = that.utfBOM;\n for (var i = 0; i < str.length; i++) {\n result += that.encodeCharacter(str.charCodeAt(i));\n }\n return result;\n },\n encodeCharacter: function(code) {\n var bytesCount = this.getBytesCount(code),\n bc = bytesCount - 1,\n result = \"\";\n\n if (bytesCount == 1) {\n result = toBitsString(code, 8);\n }\n else {\n var significantOnes = 8 - bytesCount;\n\n for (var i = 0; i < bc; i++) {\n result = toBitsString(code >> (i * 6) & 63 | 128, 8) + result;\n }\n\n result = ((code >> bc * 6) | ((255 >> significantOnes) << significantOnes)).toString(2) + result;\n }\n return result;\n },\n getBytesCount: function(code) {\n var ranges = this.ranges;\n for (var i = 0; i < ranges.length; i++) {\n if (code < ranges[i]) {\n return i + 1;\n }\n }\n },\n ranges: [128,2048,65536,2097152,67108864]\n };\n\n var QRCodeDataEncoder = function(encoding) {\n if (encoding && encoding.toLowerCase().indexOf(\"utf_8\") >= 0) {\n return new UTF8Encoder();\n }\n else {\n return new IsoEncoder();\n }\n };\n\n var encodeData = function(inputString, errorCorrectionLevel, encoding) {\n var encoder = new QRCodeDataEncoder(encoding),\n encodingResult = encoder.getEncodingResult(inputString, errorCorrectionLevel),\n version = encodingResult.version,\n versionInformation = versionsCodewordsInformation[version - 1][errorCorrectionLevel],\n dataString = padDataString(encodingResult.dataString, versionInformation.totalDataCodewords),\n blocks = getBlocks(dataString, versionInformation),\n matrices = initMatrices(version);\n\n addFinderPatterns(matrices);\n addAlignmentPatterns(matrices, version);\n addTimingFunctions(matrices);\n\n if (version >= 7) {\n addVersionInformation(matrices, toBitsString(0, 18));\n }\n\n addFormatInformation(matrices, toBitsString(0, 15));\n fillData(matrices, blocks);\n\n var minIdx = scoreMaskMatrixes(matrices),\n optimalMatrix = matrices[minIdx];\n\n if (version >= 7) {\n addVersionInformation([optimalMatrix], encodeVersionInformation(version));\n }\n\n var formatString = errorCorrectionPatterns[errorCorrectionLevel] + toBitsString(minIdx, 3);\n addFormatInformation([optimalMatrix], encodeFormatInformation(formatString));\n\n return optimalMatrix;\n };\n\n var QRCodeDefaults = {\n DEFAULT_SIZE: 200,\n QUIET_ZONE_LENGTH: 4,\n DEFAULT_ERROR_CORRECTION_LEVEL: \"L\",\n DEFAULT_BACKGROUND: \"#fff\",\n DEFAULT_DARK_MODULE_COLOR: \"#000\",\n MIN_BASE_UNIT_SIZE: 1\n };\n\n var QRCode = Widget.extend({\n init: function(element, options) {\n var that = this;\n\n Widget.fn.init.call(that, element, options);\n\n that.element = $(element);\n that.wrapper = that.element;\n that.element.addClass(\"k-qrcode\");\n that.surfaceWrap = $(\"
\").css(\"position\", \"relative\").appendTo(this.element);\n that.surface = draw.Surface.create(that.surfaceWrap, {\n type: that.options.renderAs\n });\n that.setOptions(options);\n },\n\n redraw: function() {\n var size = this._getSize();\n\n this.surfaceWrap.css({\n width: size,\n height: size\n });\n this.surface.clear();\n this.surface.resize();\n\n this.createVisual();\n this.surface.draw(this.visual);\n },\n\n getSize: function() {\n return kendo.dimensions(this.element);\n },\n\n _resize: function() {\n this.redraw();\n },\n\n createVisual: function() {\n this.visual = this._render();\n },\n\n exportVisual: function() {\n return this._render();\n },\n\n _render: function() {\n var that = this,\n value = that._value,\n baseUnit,\n border = that.options.border || {},\n padding = that.options.padding || 0,\n borderWidth = border.width || 0,\n quietZoneSize,\n matrix,\n size,\n dataSize,\n contentSize;\n\n border.width = borderWidth;\n\n var visual = new draw.Group();\n\n if (value) {\n matrix = encodeData(value, that.options.errorCorrection, that.options.encoding);\n size = that._getSize();\n contentSize = size - 2 * (borderWidth + padding);\n baseUnit = that._calculateBaseUnit(contentSize, matrix.length);\n dataSize = matrix.length * baseUnit;\n quietZoneSize = borderWidth + padding + (contentSize - dataSize) / 2;\n\n visual.append(that._renderBackground(size, border));\n visual.append(that._renderMatrix(matrix, baseUnit, quietZoneSize));\n if (that._hasCustomLogo()) {\n visual.append(that._renderLogo(size, baseUnit));\n } else if (that._isSwiss()) {\n visual.append(that._renderSwissCode(size, baseUnit));\n }\n }\n\n return visual;\n },\n\n _renderLogo: function name(qrSize, baseUnit) {\n var image;\n var imageRect;\n var center = round(qrSize / 2);\n var logoSize = this._getLogoSize(baseUnit * DEFAULT_LOGO_SIZE);\n var logoUrl = this.options.overlay.imageUrl;\n var position = {\n x: center - logoSize.width / 2,\n y: center - logoSize.height / 2\n };\n\n imageRect = new kendo.geometry.Rect(\n new kendo.geometry.Point(position.x, position.y),\n new kendo.geometry.Size(logoSize.width, logoSize.height)\n );\n\n image = new draw.Image(logoUrl, imageRect);\n return image;\n },\n\n _renderSwissCode: function(qrSize, baseUnit) {\n var logoSize = this._getLogoSize(baseUnit * DEFAULT_LOGO_SIZE);\n logoSize = Math.max(logoSize.width, logoSize.height);\n var crossSize = logoSize / 4;\n var crossOffset = crossSize / 2;\n var center = qrSize / 2;\n var start = {};\n var visual = new draw.Group();\n\n start.x = start.y = Math.ceil(center - baseUnit - logoSize / 2);\n visual.append(this._renderShape(start, Math.ceil(logoSize + baseUnit * 2), squarePattern, \"#fff\"));\n\n start.x = start.y = center - logoSize / 2;\n visual.append(this._renderShape(start, logoSize, squarePattern, this.options.color));\n\n start.x = center + crossOffset - logoSize / 2;\n start.y = center + crossOffset + crossSize - logoSize / 2;\n visual.append(this._renderShape(start, crossSize, crossPattern, \"#fff\"));\n\n return visual;\n },\n\n _renderShape: function(start, step, pattern, color) {\n var path = new draw.MultiPath({\n fill: {\n color: color\n },\n stroke: null\n });\n\n path.moveTo(start.x, start.y);\n for (var i = 0; i < pattern.length; i++) {\n path.lineTo(start.x + step * pattern[i][0], start.y + step * pattern[i][1]);\n }\n path.close();\n\n return path;\n },\n\n _getSize: function() {\n var that = this,\n size;\n\n if (that.options.size) {\n size = parseInt(that.options.size, 10);\n } else {\n var element = that.element,\n min = Math.min(element.width(), element.height());\n\n if (min > 0) {\n size = min;\n } else {\n size = QRCodeDefaults.DEFAULT_SIZE;\n }\n }\n\n return size;\n },\n\n _calculateBaseUnit: function(size, matrixSize) {\n var baseUnit = Math.floor(size / matrixSize);\n\n if (baseUnit < QRCodeDefaults.MIN_BASE_UNIT_SIZE) {\n throw new Error(\"Insufficient size.\");\n }\n\n if (baseUnit * matrixSize >= size &&\n baseUnit - 1 >= QRCodeDefaults.MIN_BASE_UNIT_SIZE) {\n baseUnit--;\n }\n\n return baseUnit;\n },\n\n _renderMatrix: function(matrix, baseUnit, quietZoneSize) {\n var path = new draw.MultiPath({\n fill: {\n color: this.options.color\n },\n stroke: null\n });\n\n for (var row = 0; row < matrix.length; row++) {\n var y = quietZoneSize + row * baseUnit;\n var column = 0;\n\n while (column < matrix.length) {\n while (matrix[row][column] === 0 && column < matrix.length) {\n column++;\n }\n\n if (column < matrix.length) {\n var x = column;\n while (matrix[row][column] == 1) {\n column++;\n }\n\n var x1 = round(quietZoneSize + x * baseUnit);\n var y1 = round(y);\n var x2 = round(quietZoneSize + column * baseUnit);\n var y2 = round(y + baseUnit);\n\n path.moveTo(x1, y1)\n .lineTo(x1, y2)\n .lineTo(x2, y2)\n .lineTo(x2, y1)\n .close();\n }\n }\n }\n\n return path;\n },\n\n _renderBackground: function(size, border) {\n var box = new Box2D(0,0, size, size).unpad(border.width / 2);\n return draw.Path.fromRect(box.toRect(), {\n fill: {\n color: this.options.background\n },\n stroke: {\n color: border.color,\n width: border.width\n }\n });\n },\n\n setOptions: function(options) {\n var that = this;\n options = options || {};\n that.options = extend(that.options, options);\n if (options.value !== undefined$1) {\n that._value = that.options.value + \"\";\n }\n that.redraw();\n },\n value: function(value) {\n var that = this;\n if (value === undefined$1) {\n return that._value;\n }\n that._value = value + \"\";\n that.redraw();\n },\n options: {\n name: \"QRCode\",\n renderAs: \"svg\",\n encoding: \"ISO_8859_1\",\n value: \"\",\n errorCorrection: QRCodeDefaults.DEFAULT_ERROR_CORRECTION_LEVEL,\n background: QRCodeDefaults.DEFAULT_BACKGROUND,\n color: QRCodeDefaults.DEFAULT_DARK_MODULE_COLOR,\n size: \"\",\n padding: 0,\n border: {\n color: \"\",\n width: 0\n },\n overlay: {\n type: IMAGE,\n imageUrl: \"\",\n width: 0,\n height: 0\n }\n },\n\n _hasCustomLogo: function() {\n return !!this.options.overlay.imageUrl;\n },\n\n _isSwiss: function() {\n return this.options.overlay.type === SWISS_QR;\n },\n\n _getLogoSize: function(defautLogoSize) {\n var width = this.options.overlay.width;\n var height = this.options.overlay.height;\n\n if (!width && !height) {\n width = height = defautLogoSize;\n } else if (width && !height) {\n height = width;\n } else if (!width && height) {\n width = height;\n }\n\n return {\n width: width,\n height: height\n };\n }\n });\n\n dataviz.ExportMixin.extend(QRCode.fn);\n dataviz.ui.plugin(QRCode);\n\n kendo.deepExtend(dataviz, {\n QRCode: QRCode,\n QRCodeDefaults: QRCodeDefaults,\n QRCodeFunctions: {\n FreeCellVisitor: FreeCellVisitor,\n fillData: fillData,\n padDataString: padDataString,\n generateErrorCodewords: generateErrorCodewords,\n xorPolynomials: xorPolynomials,\n getBlocks: getBlocks,\n multiplyPolynomials: multiplyPolynomials,\n chooseMode: chooseMode,\n getModes: getModes,\n getDataCodewordsCount: getDataCodewordsCount,\n getVersion: getVersion,\n getDataString: getDataString,\n encodeFormatInformation: encodeFormatInformation,\n encodeBCH: encodeBCH,\n dividePolynomials: dividePolynomials,\n initMatrices: initMatrices,\n addFormatInformation: addFormatInformation,\n encodeVersionInformation: encodeVersionInformation,\n addVersionInformation: addVersionInformation,\n addCentricPattern: addCentricPattern,\n addFinderSeparator: addFinderSeparator,\n addFinderPatterns: addFinderPatterns,\n addAlignmentPatterns: addAlignmentPatterns,\n addTimingFunctions: addTimingFunctions,\n scoreMaskMatrixes: scoreMaskMatrixes,\n encodeData: encodeData,\n UTF8Encoder: UTF8Encoder\n },\n QRCodeFields: {\n modes: modeInstances,\n powersOfTwo: powersOfTwo,\n powersOfTwoResult: powersOfTwoResult,\n generatorPolynomials: generatorPolynomials\n }\n });\n\n })(window.kendo.jQuery);\n\n}));\n"]}