text: /*
  * Kendo UI v2014.2.903 (http://www.telerik.com/kendo-ui)
  * Copyright 2014 Telerik AD. All rights reserved.
  *
  * Kendo UI commercial licenses may be obtained at
  * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete
  * If you do not own a commercial license, this file shall be governed by the trial license terms.
  */
  !function(e,define){define(["./kendo.dataviz.core.min","./kendo.dataviz.svg.min","./kendo.dataviz.canvas.min"],e)}(function(){return function(e,t){function n(e,t,n){return e.substring(t,t+n)}var i,r,o,a,s,l,d=window.kendo,c=e.extend,u=d.deepExtend,h=e.inArray,p=e.isPlainObject,f=d.dataviz,g=f.defined,m=f.append,v=d.ui.Widget,_=f.Box2D,w=f.TextBox,y=300,b=100,k=10,x=/^\d+$/,C=/^[a-z0-9]+$/i,S="Character '{0}'  is not valid for symbology {1}",T=d.Class.extend({init:function(e){this.setOptions(e)},setOptions:function(e){var t=this;t.options=c({},t.options,e),t.quietZoneLength=t.options.addQuietZone?2*t.options.quietZoneLength:0},encode:function(e,t,n){var i=this;return g(e)&&(e+=""),i.initValue(e,t,n),i.options.addQuietZone&&i.addQuietZone(),i.addData(),i.options.addQuietZone&&i.addQuietZone(),{baseUnit:i.baseUnit,pattern:i.pattern}},options:{quietZoneLength:k,addQuietZone:!0,addCheckSum:!0},initValue:function(){},addQuietZone:function(){this.pattern.push(this.options.quietZoneLength||k)},addData:function(){},invalidCharacterError:function(e){throw Error(d.format(S,e,this.name))}}),D={},A=T.extend({minBaseUnitLength:.7,addData:function(){var e,t=this,n=t.value;for(t.addStart(),e=0;n.length>e;e++)t.addCharacter(n.charAt(e));t.options.addCheckSum&&t.pushCheckSum(),t.addStop(),t.prepareValues()},addCharacter:function(e){var t=this,n=t.characterMap[e];n||t.invalidCharacterError(e),t.addBase(n)},addBase:function(){}}),E={addCharacter:function(e){var t=this;t.characterMap[e]?t.addBase(t.characterMap[e]):e.charCodeAt(0)>127?t.invalidCharacterError(e):t.addExtended(e.charCodeAt(0))},addExtended:function(e){var n,i,r,o=this;for(i=0;o.extendedMappings.length>i;i++)if(n=o.extendedMappings[i].call(o,e)){for(r=0;n.length>r;r++)o.addBase(n[r]);return o.dataLength+=n.length-1,t}},extendedMappings:[function(e){if(e>=97&&122>=e){var t=this;return[t.characterMap[t.shiftCharacters[0]],t.characterMap[String.fromCharCode(e-32)]]}},function(e){if(e>=33&&58>=e){var t=this;return[t.characterMap[t.shiftCharacters[1]],t.characterMap[String.fromCharCode(e+32)]]}},function(e){if(e>=1&&26>=e){var t=this;return[t.characterMap[t.shiftCharacters[2]],t.characterMap[String.fromCharCode(e+64)]]}},function(e){var t,n,i,r=this;if(r.specialAsciiCodes[e])for(t=[],i=0;r.specialAsciiCodes[e].length>i;i++)t.push(r.characterMap[r.shiftCharacters[3]]),t.push(r.characterMap[r.specialAsciiCodes[e][i]]);else n=6*Math.floor(e/32)+(e-27)%32+64,t=[r.characterMap[r.shiftCharacters[3]],r.characterMap[String.fromCharCode(n)]];return t}],specialAsciiCodes:{0:["U"],64:["V"],96:["W"],127:["T","X","Y","Z"]},shiftValuesAsciiCodes:{39:36,40:47,41:43,42:37},characterMap:{"+":!1,"/":!1,$:!1,"%":!1},shiftCharacters:["SHIFT0","SHIFT1","SHIFT2","SHIFT3"]};D.code39=A.extend({name:"Code 39",checkSumMod:43,minRatio:2.5,maxRatio:3,gapWidth:1,splitCharacter:"|",initValue:function(e,t,n){var i=this;i.width=t,i.height=n,i.value=e,i.dataLength=e.length,i.pattern=[],i.patternString=""},prepareValues:function(){var e,t,n=this,i=n.minBaseUnitLength,r=n.maxRatio,o=n.minRatio,a=Math.max(.15*n.width,24);if(a>n.height)throw Error("Insufficient Height. The minimum height for value: "+n.value+" is: "+a);for(;(e=n.getBaseUnit(r))<i&&r>o;)r=parseFloat((r-.1).toFixed(1));if(i>e)throw t=Math.ceil(n.getBaseWidth(o)*i),Error("Insufficient width. The minimum width for value: "+n.value+" is: "+t);n.ratio=r,n.baseUnit=e,n.patternString=n.patternString.substring(0,n.patternString.length-1),n.pattern=n.pattern.concat(n.patternString.replace(/ratio/g,r).split(n.splitCharacter))},getBaseUnit:function(e){return this.width/this.getBaseWidth(e)},getBaseWidth:function(e){var t=this,n=3*(e+2);return t.quietZoneLength+n*(t.dataLength+2)+t.gapWidth*(t.dataLength+1)},addStart:function(){var e=this;e.addPattern(e.characterMap.START.pattern),e.addCharacterGap()},addBase:function(e){this.addPattern(e.pattern),this.addCharacterGap()},addStop:function(){this.addPattern(this.characterMap.START.pattern)},addPattern:function(e){for(var t=0;e.length>t;t++)this.patternString+=this.patternMappings[e.charAt(t)]},addCharacterGap:function(){var e=this;e.patternString+=e.gapWidth+e.splitCharacter},patternMappings:{b:"1|",w:"1|",B:"ratio|",W:"ratio|"},characterMap:{0:{pattern:"bwbWBwBwb",value:0},1:{pattern:"BwbWbwbwB",value:1},2:{pattern:"bwBWbwbwB",value:2},3:{pattern:"BwBWbwbwb",value:3},4:{pattern:"bwbWBwbwB",value:4},5:{pattern:"BwbWBwbwb",value:5},6:{pattern:"bwBWBwbwb",value:6},7:{pattern:"bwbWbwBwB",value:7},8:{pattern:"BwbWbwBwb",value:8},9:{pattern:"bwBWbwBwb",value:9},A:{pattern:"BwbwbWbwB",value:10},B:{pattern:"bwBwbWbwB",value:11},C:{pattern:"BwBwbWbwb",value:12},D:{pattern:"bwbwBWbwB",value:13},E:{pattern:"BwbwBWbwb",value:14},F:{pattern:"bwBwBWbwb",value:15},G:{pattern:"bwbwbWBwB",value:16},H:{pattern:"BwbwbWBwb",value:17},I:{pattern:"bwBwbWBwb",value:18},J:{pattern:"bwbwBWBwb",value:19},K:{pattern:"BwbwbwbWB",value:20},L:{pattern:"bwBwbwbWB",value:21},M:{pattern:"BwBwbwbWb",value:22},N:{pattern:"bwbwBwbWB",value:23},O:{pattern:"BwbwBwbWb",value:24},P:{pattern:"bwBwBwbWb",value:25},Q:{pattern:"bwbwbwBWB",value:26},R:{pattern:"BwbwbwBWb",value:27},S:{pattern:"bwBwbwBWb",value:28},T:{pattern:"bwbwBwBWb",value:29},U:{pattern:"BWbwbwbwB",value:30},V:{pattern:"bWBwbwbwB",value:31},W:{pattern:"BWBwbwbwb",value:32},X:{pattern:"bWbwBwbwB",value:33},Y:{pattern:"BWbwBwbwb",value:34},Z:{pattern:"bWBwBwbwb",value:35},"-":{pattern:"bWbwbwBwB",value:36},".":{pattern:"BWbwbwBwb",value:37}," ":{pattern:"bWBwbwBwb",value:38},$:{pattern:"bWbWbWbwb",value:39},"/":{pattern:"bWbWbwbWb",value:40},"+":{pattern:"bWbwbWbWb",value:41},"%":{pattern:"bwbWbWbWb",value:42},START:{pattern:"bWbwBwBwb"}},options:{addCheckSum:!1}}),D.code39extended=D.code39.extend(u({},E,{name:"Code 39 extended",characterMap:{SHIFT0:{pattern:"bWbwbWbWb",value:41},SHIFT1:{pattern:"bWbWbwbWb",value:40},SHIFT2:{pattern:"bWbWbWbwb",value:39},SHIFT3:{pattern:"bwbWbWbWb",value:42}}})),D.code93=A.extend({name:"Code 93",cCheckSumTotal:20,kCheckSumTotal:15,checkSumMod:47,initValue:function(e,t,n){var i=this;i.value=e,i.width=t,i.height=n,i.pattern=[],i.values=[],i.dataLength=e.length},prepareValues:function(){var e=this,t=Math.max(.15*e.width,24);if(t>e.height)throw Error("Insufficient Height");if(e.setBaseUnit(),e.minBaseUnitLength>e.baseUnit)throw Error("Insufficient Width")},setBaseUnit:function(){var e=this,t=2;e.baseUnit=e.width/(9*(e.dataLength+2+t)+e.quietZoneLength+1)},addStart:function(){var e=this.characterMap.START.pattern;this.addPattern(e)},addStop:function(){var e=this;e.addStart(),e.pattern.push(e.characterMap.TERMINATION_BAR)},addBase:function(e){this.addPattern(e.pattern),this.values.push(e.value)},pushCheckSum:function(){var e,t,n=this,i=n._getCheckValues();for(n.checksum=i.join(""),t=0;i.length>t;t++)e=n.characterMap[n._findCharacterByValue(i[t])],n.addPattern(e.pattern)},_getCheckValues:function(){var e,t,n,i=this,r=i.values,o=r.length,a=0;for(n=o-1;n>=0;n--)a+=i.weightedValue(r[n],o-n,i.cCheckSumTotal);for(e=a%i.checkSumMod,a=i.weightedValue(e,1,i.kCheckSumTotal),n=o-1;n>=0;n--)a+=i.weightedValue(r[n],o-n+1,i.kCheckSumTotal);return t=a%i.checkSumMod,[e,t]},_findCharacterByValue:function(e){for(var t in this.characterMap)if(this.characterMap[t].value===e)return t},weightedValue:function(e,t,n){return(t%n||n)*e},addPattern:function(e){var t,n;for(n=0;e.length>n;n++)t=parseInt(e.charAt(n),10),this.pattern.push(t)},characterMap:{0:{pattern:"131112",value:0},1:{pattern:"111213",value:1},2:{pattern:"111312",value:2},3:{pattern:"111411",value:3},4:{pattern:"121113",value:4},5:{pattern:"121212",value:5},6:{pattern:"121311",value:6},7:{pattern:"111114",value:7},8:{pattern:"131211",value:8},9:{pattern:"141111",value:9},A:{pattern:"211113",value:10},B:{pattern:"211212",value:11},C:{pattern:"211311",value:12},D:{pattern:"221112",value:13},E:{pattern:"221211",value:14},F:{pattern:"231111",value:15},G:{pattern:"112113",value:16},H:{pattern:"112212",value:17},I:{pattern:"112311",value:18},J:{pattern:"122112",value:19},K:{pattern:"132111",value:20},L:{pattern:"111123",value:21},M:{pattern:"111222",value:22},N:{pattern:"111321",value:23},O:{pattern:"121122",value:24},P:{pattern:"131121",value:25},Q:{pattern:"212112",value:26},R:{pattern:"212211",value:27},S:{pattern:"211122",value:28},T:{pattern:"211221",value:29},U:{pattern:"221121",value:30},V:{pattern:"222111",value:31},W:{pattern:"112122",value:32},X:{pattern:"112221",value:33},Y:{pattern:"122121",value:34},Z:{pattern:"123111",value:35},"-":{pattern:"121131",value:36},".":{pattern:"311112",value:37}," ":{pattern:"311211",value:38},$:{pattern:"321111",value:39},"/":{pattern:"112131",value:40},"+":{pattern:"113121",value:41},"%":{pattern:"211131",value:42},SHIFT0:{pattern:"122211",value:46},SHIFT1:{pattern:"311121",value:45},SHIFT2:{pattern:"121221",value:43},SHIFT3:{pattern:"312111",value:44},START:{pattern:"111141"},TERMINATION_BAR:"1"}}),D.code93extended=D.code93.extend(u({},E,{name:"Code 93 extended",pushCheckSum:function(){var e,t,n=this,i=n._getCheckValues();for(n.checksum=i.join(""),t=0;i.length>t;t++)e=i[t],n.shiftValuesAsciiCodes[e]?n.addExtended(n.shiftValuesAsciiCodes[e]):n.addPattern(n.characterMap[n._findCharacterByValue(e)].pattern)}})),i=d.Class.extend({init:function(e){this.encoding=e},addStart:function(){},is:function(){},move:function(){},pushState:function(){}}),r=i.extend({FNC4:"FNC4",init:function(e,t){var n=this;n.encoding=e,n.states=t,n._initMoves(t)},addStart:function(){this.encoding.addPattern(this.START)},is:function(e,t){var n=e.charCodeAt(t);return this.isCode(n)},move:function(e){for(var t=this,n=0;!t._moves[n].call(t,e)&&t._moves.length>n;)n++},pushState:function(e){var t,n,i=this,r=i.states,o=e.value,a=o.length;for(h("C",r)>=0&&(n=o.substr(e.index).match(/\d{4,}/g),n&&(a=o.indexOf(n[0],e.index)));(t=e.value.charCodeAt(e.index))>=0&&i.isCode(t)&&a>e.index;)i.encoding.addPattern(i.getValue(t)),e.index++},_initMoves:function(e){var t=this;t._moves=[],h(t.FNC4,e)>=0&&t._moves.push(t._moveFNC),h(t.shiftKey,e)>=0&&t._moves.push(t._shiftState),t._moves.push(t._moveState)},_moveFNC:function(e){return e.fnc?(e.fnc=!1,e.previousState==this.key):t},_shiftState:function(e){var n=this;return e.previousState==n.shiftKey&&(e.index+1>=e.value.length||n.encoding[n.shiftKey].is(e.value,e.index+1))?(n.encoding.addPattern(n.SHIFT),e.shifted=!0,!0):t},_moveState:function(){return this.encoding.addPattern(this.MOVE),!0},SHIFT:98}),o={},o.A=r.extend({key:"A",shiftKey:"B",isCode:function(e){return e>=0&&96>e},getValue:function(e){return 32>e?e+64:e-32},MOVE:101,START:103}),o.B=r.extend({key:"B",shiftKey:"A",isCode:function(e){return e>=32&&128>e},getValue:function(e){return e-32},MOVE:100,START:104}),o.C=i.extend({key:"C",addStart:function(){this.encoding.addPattern(this.START)},is:function(e,t){var i=n(e,t,4);return(e.length>=t+4||2==e.length)&&x.test(i)},move:function(){this.encoding.addPattern(this.MOVE)},pushState:function(e){for(var t;(t=n(e.value,e.index,2))&&x.test(t)&&2==t.length;)this.encoding.addPattern(parseInt(t,10)),e.index+=2},getValue:function(e){return e},MOVE:99,START:105}),o.FNC4=i.extend({key:"FNC4",dependentStates:["A","B"],init:function(e,t){this.encoding=e,this._initSubStates(t)},addStart:function(e){var t=e.value.charCodeAt(0)-128,n=this._getSubState(t);this.encoding[n].addStart()},is:function(e,t){var n=e.charCodeAt(t);return this.isCode(n)},isCode:function(e){return e>=128&&256>e},pushState:function(e){var t,n=this,i=n._initSubState(e),r=n.encoding,o=i.value.length;if(e.index+=o,3>o)for(;o>i.index;i.index++)t=i.value.charCodeAt(i.index),i.state=n._getSubState(t),i.previousState!=i.state&&(i.previousState=i.state,r[i.state].move(i)),r.addPattern(r[i.state].MOVE),r.addPattern(r[i.state].getValue(t));else i.state!=i.previousState&&r[i.state].move(i),n._pushStart(i),r.pushData(i,n.subStates),e.value.length>e.index&&n._pushStart(i);e.fnc=!0,e.state=i.state},_pushStart:function(e){var t=this;t.encoding.addPattern(t.encoding[e.state].MOVE),t.encoding.addPattern(t.encoding[e.state].MOVE)},_initSubState:function(e){var t=this,n={value:t._getAll(e.value,e.index),index:0};return n.state=t._getSubState(n.value.charCodeAt(0)),n.previousState=e.previousState==t.key?n.state:e.previousState,n},_initSubStates:function(e){var t,n=this;for(n.subStates=[],t=0;e.length>t;t++)h(e[t],n.dependentStates)>=0&&n.subStates.push(e[t])},_getSubState:function(e){var t,n=this;for(t=0;n.subStates.length>t;t++)if(n.encoding[n.subStates[t]].isCode(e))return n.subStates[t]},_getAll:function(e,t){for(var n,i="";(n=e.charCodeAt(t++))&&this.isCode(n);)i+=String.fromCharCode(n-128);return i}}),o.FNC1=i.extend({key:"FNC1",startState:"C",dependentStates:["C","B"],startAI:"(",endAI:")",init:function(e,t){this.encoding=e,this.states=t},addStart:function(){this.encoding[this.startState].addStart()},is:function(){return h(this.key,this.states)>=0},pushState:function(e){var t,n,i,r=this,o=r.encoding,a=e.value.replace(/\s/g,""),s=RegExp("["+r.startAI+r.endAI+"]","g"),l=e.index,d={state:r.startState};for(o.addPattern(r.START);;){if(d.index=0,i=a.charAt(l)===r.startAI?2:0,t=i>0?r.getBySeparator(a,l):r.getByLength(a,l),t.ai.length)n=l+i+t.id.length+t.ai.length;else if(n=a.indexOf(r.startAI,l+1),0>n){if(a.length>l+t.ai.max+t.id.length+i)throw Error("Separators are required after variable length identifiers");n=a.length}if(d.value=a.substring(l,n).replace(s,""),r.validate(t,d.value),o.pushData(d,r.dependentStates),n>=a.length)break;l=n,d.state!=r.startState&&(o[r.startState].move(d),d.state=r.startState),t.ai.length||o.addPattern(r.START)}e.index=e.value.length},validate:function(e,t){var n=t.substr(e.id.length),i=e.ai;if(!i.type&&!x.test(n))throw Error("Application identifier "+e.id+" is numeric only but contains non numeric character(s).");if("alphanumeric"==i.type&&!C.test(n))throw Error("Application identifier "+e.id+" is alphanumeric only but contains non alphanumeric character(s).");if(i.length&&i.length!==n.length)throw Error("Application identifier "+e.id+" must be "+i.length+" characters long.");if(i.min&&i.min>n.length)throw Error("Application identifier "+e.id+" must be at least "+i.min+" characters long.");if(i.max&&n.length>i.max)throw Error("Application identifier "+e.id+" must be at most "+i.max+" characters long.")},getByLength:function(e,t){var i,r,o,a=this;for(o=2;4>=o;o++)if(i=n(e,t,o),r=a.getAI(i)||a.getAI(i.substring(0,i.length-1)))return{id:i,ai:r};a.unsupportedAIError(i)},unsupportedAIError:function(e){throw Error(d.format("'{0}' is not a supported Application Identifier"),e)},getBySeparator:function(e,t){var n=this,i=e.indexOf(n.startAI,t),r=e.indexOf(n.endAI,i),o=e.substring(i+1,r),a=n.getAI(o)||n.getAI(o.substr(o.length-1));return a||n.unsupportedAIError(o),{ai:a,id:o}},getAI:function(e){var t,n,i,r=this.applicationIdentifiers,o=r.multiKey;if(r[e])return r[e];for(t=0;o.length>t;t++){if(o[t].ids&&h(e,o[t].ids)>=0)return o[t].type;if(o[t].ranges)for(n=o[t].ranges,i=0;n.length>i;i++)if(e>=n[i][0]&&n[i][1]>=e)return o[t].type}},applicationIdentifiers:{22:{max:29,type:"alphanumeric"},402:{length:17},7004:{max:4,type:"alphanumeric"},242:{max:6,type:"alphanumeric"},8020:{max:25,type:"alphanumeric"},703:{min:3,max:30,type:"alphanumeric"},8008:{min:8,max:12,type:"alphanumeric"},253:{min:13,max:17,type:"alphanumeric"},8003:{min:14,max:30,type:"alphanumeric"},multiKey:[{ids:["15","17","8005","8100"],ranges:[[11,13],[310,316],[320,336],[340,369]],type:{length:6}},{ids:["240","241","250","251","400","401","403","7002","8004","8007","8110"],ranges:[[-9]],type:{max:30,type:"alphanumeric"}},{ids:["7001"],ranges:[[410,414]],type:{length:13}},{ids:["10","21","254","420","8002"],type:{max:20,type:"alphanumeric"}},{ids:["00","8006","8017","8018"],type:{length:18}},{ids:["01","02","8001"],type:{length:14}},{ids:["422"],ranges:[[424,426]],type:{length:3}},{ids:["20","8102"],type:{length:2}},{ids:["30","37"],type:{max:8,type:"alphanumeric"}},{ids:["390","392"],type:{max:15,type:"alphanumeric"}},{ids:["421","423"],type:{min:3,max:15,type:"alphanumeric"}},{ids:["391","393"],type:{min:3,max:18,type:"alphanumeric"}},{ids:["7003","8101"],type:{length:10}}]},START:102}),a=T.extend({init:function(e){T.fn.init.call(this,e),this._initStates()},_initStates:function(){var e,t=this;for(e=0;t.states.length>e;e++)t[t.states[e]]=new o[t.states[e]](t,t.states)},initValue:function(e,t,n){var i=this;i.pattern=[],i.value=e,i.width=t,i.height=n,i.checkSum=0,i.totalUnits=0,i.index=0,i.position=1},addData:function(){var e=this,t={value:e.value,index:0,state:""};0!==e.value.length&&(t.state=t.previousState=e.getNextState(t,e.states),e.addStart(t),e.pushData(t,e.states),e.addCheckSum(),e.addStop(),e.setBaseUnit())},pushData:function(e,t){for(var n,i=this;;){if(i[e.state].pushState(e),e.index>=e.value.length)break;e.shifted?(n=e.state,e.state=e.previousState,e.previousState=n,e.shifted=!1):(e.previousState=e.state,e.state=i.getNextState(e,t),i[e.state].move(e))}},addStart:function(e){this[e.state].addStart(e),this.position=1},addCheckSum:function(){var e=this;e.checksum=e.checkSum%103,e.addPattern(e.checksum)},addStop:function(){this.addPattern(this.STOP)},setBaseUnit:function(){var e=this;e.baseUnit=e.width/(e.totalUnits+e.quietZoneLength)},addPattern:function(e){var t,n,i=this,r=""+i.characterMap[e];for(n=0;r.length>n;n++)t=parseInt(r.charAt(n),10),i.pattern.push(t),i.totalUnits+=t;i.checkSum+=e*i.position++},getNextState:function(e,t){for(var n=0;t.length>n;n++)if(this[t[n]].is(e.value,e.index))return t[n];this.invalidCharacterError(e.value.charAt(e.index))},characterMap:[212222,222122,222221,121223,121322,131222,122213,122312,132212,221213,221312,231212,112232,122132,122231,113222,123122,123221,223211,221132,221231,213212,223112,312131,311222,321122,321221,312212,322112,322211,212123,212321,232121,111323,131123,131321,112313,132113,132311,211313,231113,231311,112133,112331,132131,113123,113321,133121,313121,211331,231131,213113,213311,213131,311123,311321,331121,312113,312311,332111,314111,221411,431111,111224,111422,121124,121421,141122,141221,112214,112412,122114,122411,142112,142211,241211,221114,413111,241112,134111,111242,121142,121241,114212,124112,124211,411212,421112,421211,212141,214121,412121,111143,111341,131141,114113,114311,411113,411311,113141,114131,311141,411131,211412,211214,211232,2331112],STOP:106}),D.code128a=a.extend({name:"Code 128 A",states:["A"]}),D.code128b=a.extend({name:"Code 128 B",states:["B"]}),D.code128c=a.extend({name:"Code 128 C",states:["C"]}),D.code128=a.extend({name:"Code 128",states:["C","B","A","FNC4"]}),D["gs1-128"]=a.extend({name:"Code GS1-128",states:["FNC1","C","B"]}),s=T.extend({initValue:function(e,t){var n=this;n.pattern=[],n.value=e,n.checkSumLength=0,n.width=t},setBaseUnit:function(){var e=this,t=7;e.baseUnit=e.width/(12*(e.value.length+e.checkSumLength)+e.quietZoneLength+t)},addData:function(){var e,t=this,n=t.value;for(t.addPattern(t.START),e=0;n.length>e;e++)t.addCharacter(n.charAt(e));t.options.addCheckSum&&t.addCheckSum(),t.addPattern(t.STOP),t.setBaseUnit()},addCharacter:function(e){var t=this,n=t.characterMap[e];n||t.invalidCharacterError(e),t.addPattern(n)},addPattern:function(e){for(var t=0;e.length>t;t++)this.pattern.push(parseInt(e.charAt(t),10))},addCheckSum:function(){var e,t=this,n=t.checkSums[t.checkSumType],i=n.call(t.checkSums,t.value);for(t.checksum=i.join(""),e=0;i.length>e;e++)t.checkSumLength++,t.addPattern(t.characterMap[i[e]])},checkSums:{Modulo10:function(e){var t,n,i,r=[0,""],o=e.length%2;for(t=0;e.length>t;t++)r[(t+o)%2]+=parseInt(e.charAt(t),10);for(i=r[0],n=""+2*r[1],t=0;n.length>t;t++)i+=parseInt(n.charAt(t),10);return[(10-i%10)%10]},Modulo11:function(e){var t,n,i,r=0,o=11,a=e.length;for(i=0;a>i;i++)t=((a-i)%6||6)+1,r+=t*e.charAt(i);return n=(o-r%o)%o,10!=n?[n]:[1,0]},Modulo11Modulo10:function(e){var t,n=this.Modulo11(e);return t=e+n[0],n.concat(this.Modulo10(t))},Modulo10Modulo10:function(e){var t,n=this.Modulo10(e);return t=e+n[0],n.concat(this.Modulo10(t))}},characterMap:["12121212","12121221","12122112","12122121","12211212","12211221","12212112","12212121","21121212","21121221"],START:"21",STOP:"121",checkSumType:""}),D.msimod10=s.extend({name:"MSI Modulo10",checkSumType:"Modulo10"}),D.msimod11=s.extend({name:"MSI Modulo11",checkSumType:"Modulo11"}),D.msimod1110=s.extend({name:"MSI Modulo11 Modulo10",checkSumType:"Modulo11Modulo10"}),D.msimod1010=s.extend({name:"MSI Modulo10 Modulo10",checkSumType:"Modulo10Modulo10"}),D.code11=T.extend({name:"Code 11",cCheckSumTotal:10,kCheckSumTotal:9,kCheckSumMinLength:10,checkSumMod:11,DASH_VALUE:10,DASH:"-",START:"112211",STOP:"11221",initValue:function(e,t){var n=this;n.pattern=[],n.value=e,n.width=t,n.totalUnits=0},addData:function(){var e,t=this,n=t.value;for(t.addPattern(t.START),e=0;n.length>e;e++)t.addCharacter(n.charAt(e));t.options.addCheckSum&&t.addCheckSum(),t.addPattern(t.STOP),t.setBaseUnit()},setBaseUnit:function(){var e=this;e.baseUnit=e.width/(e.totalUnits+e.quietZoneLength)},addCheckSum:function(){var e,t=this,n=t.value,i=n.length,r=t.getWeightedSum(n,i,t.cCheckSumTotal)%t.checkSumMod;t.checksum=r+"",t.addPattern(t.characterMap[r]),i++,i>=t.kCheckSumMinLength&&(e=(r+t.getWeightedSum(n,i,t.kCheckSumTotal))%t.checkSumMod,t.checksum+=e,t.addPattern(t.characterMap[e]))},getWeightedSum:function(e,t,n){var i,r=0;for(i=0;e.length>i;i++)r+=this.weightedValue(this.getValue(e.charAt(i)),t,i,n);return r},weightedValue:function(e,t,n,i){var r=(t-n)%i||i;return r*e},getValue:function(e){var t=this;return isNaN(e)?(e!==t.DASH&&t.invalidCharacterError(e),t.DASH_VALUE):parseInt(e,10)},addCharacter:function(e){var t=this,n=t.getValue(e),i=t.characterMap[n];t.addPattern(i)},addPattern:function(e){var t,n;for(n=0;e.length>n;n++)t=parseInt(e.charAt(n),10),this.pattern.push(t),this.totalUnits+=t},characterMap:["111121","211121","121121","221111","112121","212111","122111","111221","211211","211111","112111"],options:{addCheckSum:!0}}),D.postnet=T.extend({name:"Postnet",START:"2",VALID_CODE_LENGTHS:[5,9,11],DIGIT_SEPARATOR:"-",initValue:function(e,t,n){var i=this;i.height=n,i.width=t,i.baseHeight=n/2,i.value=e.replace(RegExp(i.DIGIT_SEPARATOR,"g"),""),i.pattern=[],i.validate(i.value),i.checkSum=0,i.setBaseUnit()},addData:function(){var e,t=this,n=t.value;for(t.addPattern(t.START),e=0;n.length>e;e++)t.addCharacter(n.charAt(e));t.options.addCheckSum&&t.addCheckSum(),t.addPattern(t.START),t.pattern.pop()},addCharacter:function(e){var t=this,n=t.characterMap[e];t.checkSum+=parseInt(e,10),t.addPattern(n)},addCheckSum:function(){var e=this;e.checksum=(10-e.checkSum%10)%10,e.addCharacter(e.checksum)},setBaseUnit:function(){var e=this,t=3;e.baseUnit=e.width/(10*(e.value.length+1)+t+e.quietZoneLength)},validate:function(e){var t=this;if(x.test(e)||t.invalidCharacterError(e.match(/[^0-9]/)[0]),h(e.length,t.VALID_CODE_LENGTHS)<0)throw Error("Invalid value length. Valid lengths for the Postnet symbology are "+t.VALID_CODE_LENGTHS.join(","))},addPattern:function(e){var t,n,i=this;for(n=0;e.length>n;n++)t=i.height-i.baseHeight*e.charAt(n),i.pattern.push({width:1,y1:t,y2:i.height}),i.pattern.push(1)},characterMap:["22111","11122","11212","11221","12112","12121","12211","21112","21121","21211"]}),D.ean13=T.extend({initValue:function(e,t,n){if(e+="",12!=e.length||/\D/.test(e))throw Error('The value of the "EAN13" encoding should be 12 symbols');var i=this;i.pattern=[],i.options.height=n,i.baseUnit=t/(95+i.quietZoneLength),i.value=e,i.checksum=i.calculateChecksum(),i.leftKey=e[0],i.leftPart=e.substr(1,6),i.rightPart=e.substr(7)+i.checksum},addData:function(){var e=this;e.addPieces(e.characterMap.start),e.addSide(e.leftPart,e.leftKey),e.addPieces(e.characterMap.middle),e.addSide(e.rightPart),e.addPieces(e.characterMap.start)},addSide:function(e,t){var n,i=this;for(n=0;e.length>n;n++)t&&parseInt(i.keyTable[t].charAt(n),10)?i.addPieces(Array.prototype.slice.call(i.characterMap.digits[e.charAt(n)]).reverse(),!0):i.addPieces(i.characterMap.digits[e.charAt(n)],!0)},addPieces:function(e,t){var n,i=this;for(n=0;e.length>n;n++)i.pattern.push(t?{y1:0,y2:.95*i.options.height,width:e[n]}:e[n])},calculateChecksum:function(){var e,t,n=0,i=0,r=this.value.split("").reverse().join("");for(e=0;r.length>e;e++)e%2?i+=parseInt(r.charAt(e),10):n+=parseInt(r.charAt(e),10);return t=(10-(3*n+i)%10)%10},keyTable:["000000","001011","001101","001110","010011","011001","011100","010101","010110","011010"],characterMap:{digits:[[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]],start:[1,1,1],middle:[1,1,1,1,1]}}),D.ean8=D.ean13.extend({initValue:function(e,t,n){var i=this;if(7!=e.length||/\D/.test(e))throw Error("Invalid value provided");i.value=e,i.options.height=n,i.checksum=i.calculateChecksum(i.value),i.leftPart=i.value.substr(0,4),i.rightPart=i.value.substr(4)+i.checksum,i.pattern=[],i.baseUnit=t/(67+i.quietZoneLength)}}),l=v.extend({init:function(t,n){var i=this;v.fn.init.call(i,t,n),i.element=e(t),i.wrapper=i.element,i.element.addClass("k-barcode"),i.view=f.ViewFactory.current.create({},i.options.renderAs),i.setOptions(n)},setOptions:function(e){var t=this;if(t.type=(e.type||t.options.type).toLowerCase(),"upca"==t.type&&(t.type="ean13",e.value="0"+e.value),"upce"==t.type&&(t.type="ean8",e.value="0"+e.value),!D[t.type])throw Error("Encoding "+t.type+"is not supported.");t.encoding=new D[t.type],t.options=c(!0,t.options,e),g(e.value)&&t.redraw()},redraw:function(){var e=this,t=e.view;e._redraw(t),t.renderTo(e.element[0])},svg:function(){if(f.SVGView){var e=new f.SVGView;return this._redraw(e),e.render()}throw Error("Unable to create SVGView. Check that kendo.dataviz.svg.js is loaded.")},imageDataURL:function(){if(f.CanvasView){if(f.supportsCanvas()){var e=document.createElement("div"),t=new f.CanvasView;return this._redraw(t),t.renderTo(e).toDataURL()}return d.logToConsole("Warning: Unable to generate image. The browser does not support Canvas.\nUser agent: "+navigator.userAgent),null}throw Error("Unable to create CanvasView. Check that kendo.dataviz.canvas.js is loaded.")},getSize:function(){return d.dimensions(this.element)},_resize:function(){this.redraw()},_redraw:function(e){var t,n,i,r=this,o=r.options,a=o.value,s=o.text,l=f.getSpacing(s.margin),d=r._getSize(),c=o.border||{},u=r.encoding,h=_(0,0,d.width,d.height).unpad(c.width).unpad(o.padding),p=h.height();r.contentBox=h,e.children=[],r._renderBackground(e,d),s.visible&&(i=f.measureText(a,{font:s.font}).height,p-=i+l.top+l.bottom),t=u.encode(a,h.width(),p),s.visible&&(n=a,o.checksum&&g(u.checksum)&&(n+=" "+u.checksum),r._renderTextElement(e,n)),r.barHeight=p,e.options.width=d.width,e.options.height=d.height,r._renderElements(e,t.pattern,t.baseUnit)},_getSize:function(){var e=this,t=e.element,n={width:y,height:b};return t.width()>0&&(n.width=t.width()),t.height()>0&&(n.height=t.height()),e.options.width&&(n.width=e.options.width),e.options.height&&(n.height=e.options.height),n},value:function(e){var n=this;return g(e)?(n.options.value=e+"",n.redraw(),t):n.options.value},_renderElements:function(e,t,n){var i,r,o,a=this,s=a.contentBox,l=s.x1;for(o=0;t.length>o;o++)r=p(t[o])?t[o]:{width:t[o],y1:0,y2:a.barHeight},i=r.width*n,o%2&&e.children.push(e.createRect(new _(l,r.y1+s.y1,l+i,r.y2+s.y1),{fill:a.options.color})),l+=i},_renderBackground:function(e,t){var n=this,i=n.options,r=i.border||{},o=_(0,0,t.width,t.height).unpad(r.width/2),a=e.createRect(o,{fill:i.background,stroke:r.width?r.color:"",strokeWidth:r.width,dashType:r.dashType});e.children.push(a)},_renderTextElement:function(e,t){var n=this,i=n.options.text,r=new w(t,{font:i.font,color:i.color,align:"center",vAlign:"bottom",margin:i.margin});r.reflow(n.contentBox),m(e.children,r.getViewElements(e))},options:{name:"Barcode",renderAs:"svg",value:"",type:"code39",checksum:!1,width:0,height:0,color:"black",background:"white",text:{visible:!0,font:"16px Consolas, Monaco, Sans Mono, monospace, sans-serif",color:"black",margin:{top:0,bottom:0,left:0,right:0}},border:{width:0,dashType:"solid",color:"black"},padding:{top:0,bottom:0,left:0,right:0}}}),f.ui.plugin(l),d.deepExtend(f,{encodings:D,Encoding:T})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t){t()});