UNPKG

@syncfusion/ej2-barcode-generator

Version:

Barcode generator component is a pure JavaScript library which will convert a string to Barcode and show it to the user. This supports major 1D and 2D barcodes including coda bar, code 128, QR Code.

10 lines 153 kB
/*! * filename: ej2-barcode-generator.min.js * version : 30.2.4 * Copyright Syncfusion Inc. 2001 - 2024. All rights reserved. * Use of this code is subject to the terms of our license. * A copy of the current license can be obtained at any time by e-mailing * licensing@syncfusion.com. Any infringement will be prosecuted under * applicable laws. */ this.ej=this.ej||{},this.ej.barcodegenerator=function(t,e){"use strict";function r(t,r){var i=e.createElement(t);return r&&o(i,r),i}function i(t){var r,i=[];if("msie"===e.Browser.info.name||"edge"===e.Browser.info.name)for(var a=0;a<t.childNodes.length;a++)1===(r=t.childNodes[parseInt(a.toString(),10)]).nodeType&&i.push(r);else i=t.children;return i}function a(t){window.barcodeMeasureElement.style.visibility="visible";var e=i(window.barcodeMeasureElement.children[1])[0];e.textContent=t.string,e.style.fontSize=t.stringSize+"px",e.style.fontFamily=t.fontStyle,e.style.fontWeight="";var r=new g(0,0);return r.width=e.getBBox().width,r.height=e.getBBox().height,window.barcodeMeasureElement.style.visibility="hidden",r}function o(t,e){for(var r=Object.keys(e),i=0;i<r.length;i++)r.forEach(function(r){var i=e[r];"style"===r&&"string"==typeof i?i.split(";").forEach(function(e){var r=e.split(":"),i=r[0],a=r[1];i&&a&&t.style.setProperty(i.trim(),a.trim())}):t.setAttribute(r,i)})}function n(t,e){var r=document.createElementNS("http://www.w3.org/2000/svg",t);return o(r,e),r}function s(){if(window.barcodeMeasureElement)window.barcodeMeasureElement.usageCount+=1;else{var t=r("div",{id:"barcodeMeasureElement",class:"barcodeMeasureElement",style:"visibility:hidden ; height: 0px ; width: 0px; overflow: hidden;"}),e=r("span",{style:"display:inline-block ; line-height: normal"});t.appendChild(e);var i=document.createElementNS("http://www.w3.org/2000/svg","svg");i.setAttribute("xlink","http://www.w3.org/1999/xlink"),t.appendChild(i);var a=document.createElementNS("http://www.w3.org/2000/svg","text");a.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),i.appendChild(a),window.barcodeMeasureElement=t,window.barcodeMeasureElement.usageCount=1,document.body.appendChild(t)}}function c(t,e,r,i){var a=e;return"SVG"!==r||t.mode?t.mode&&a.parentNode.removeChild(a):a.innerHTML="",new y(i,"SVG"===r)}function h(t,e,r,i,a,o){return{width:t,height:e,x:r,y:i,color:a,strokeColor:o}}function l(t,e){var r=1.5*t.element.offsetWidth,i=1.5*t.element.offsetHeight;b.getContext(e).clearRect(0,0,r,i)}function u(t,e){l(t,e)}function p(t,e,r){var i=document.createElement("a");i.download=e+"."+t.toLocaleLowerCase(),i.href=r,i.click()}function d(t,e,r,i,a){var o=m(t,e,r,i,a);return o instanceof Promise&&o.then(function(t){return t}),o}function m(t,e,r,i,a){return new Promise(function(o,n){var s=r.children[0],c=document.createElement("canvas");c.height=r.clientHeight,c.width=r.clientWidth;var h=c.getContext("2d"),l=new Image;l.onload=function(){if(h.drawImage(l,0,0),i){var r="JPG"===t?c.toDataURL("image/jpg"):c.toDataURL("image/png");o(r)}else p(t,e,c.toDataURL("image/png").replace("image/png","image/octet-stream")),o(null)},"Canvas"===a.mode?(l.src="JPG"===t?s.toDataURL("image/jpg"):s.toDataURL("image/png"),c.height=1.5*r.clientHeight,c.width=1.5*r.clientWidth,h.scale(2/3,2/3)):l.src=window.URL.createObjectURL(new Blob([(new window.XMLSerializer).serializeToString(r.children[0])],{type:"image/svg+xml"}))})}!function(t){t[t.invalid=0]="invalid"}(t.BarcodeEvent||(t.BarcodeEvent={})),function(t){t[t.All=2]="All"}(t.QuietZone||(t.QuietZone={})),function(t){t[t.Auto=0]="Auto",t[t.Size10x10=1]="Size10x10",t[t.Size12x12=2]="Size12x12",t[t.Size14x14=3]="Size14x14",t[t.Size16x16=4]="Size16x16",t[t.Size18x18=5]="Size18x18",t[t.Size20x20=6]="Size20x20",t[t.Size22x22=7]="Size22x22",t[t.Size24x24=8]="Size24x24",t[t.Size26x26=9]="Size26x26",t[t.Size32x32=10]="Size32x32",t[t.Size36x36=11]="Size36x36",t[t.Size40x40=12]="Size40x40",t[t.Size44x44=13]="Size44x44",t[t.Size48x48=14]="Size48x48",t[t.Size52x52=15]="Size52x52",t[t.Size64x64=16]="Size64x64",t[t.Size72x72=17]="Size72x72",t[t.Size80x80=18]="Size80x80",t[t.Size88x88=19]="Size88x88",t[t.Size96x96=20]="Size96x96",t[t.Size104x104=21]="Size104x104",t[t.Size120x120=22]="Size120x120",t[t.Size132x132=23]="Size132x132",t[t.Size144x144=24]="Size144x144",t[t.Size8x18=25]="Size8x18",t[t.Size8x32=26]="Size8x32",t[t.Size12x26=27]="Size12x26",t[t.Size12x36=28]="Size12x36",t[t.Size16x36=29]="Size16x36",t[t.Size16x48=30]="Size16x48"}(t.DataMatrixSize||(t.DataMatrixSize={})),function(t){t[t.Auto=0]="Auto",t[t.Version01=1]="Version01",t[t.Version02=2]="Version02",t[t.Version03=3]="Version03",t[t.Version04=4]="Version04",t[t.Version05=5]="Version05",t[t.Version06=6]="Version06",t[t.Version07=7]="Version07",t[t.Version08=8]="Version08",t[t.Version09=9]="Version09",t[t.Version10=10]="Version10",t[t.Version11=11]="Version11",t[t.Version12=12]="Version12",t[t.Version13=13]="Version13",t[t.Version14=14]="Version14",t[t.Version15=15]="Version15",t[t.Version16=16]="Version16",t[t.Version17=17]="Version17",t[t.Version18=18]="Version18",t[t.Version19=19]="Version19",t[t.Version20=20]="Version20",t[t.Version21=21]="Version21",t[t.Version22=22]="Version22",t[t.Version23=23]="Version23",t[t.Version24=24]="Version24",t[t.Version25=25]="Version25",t[t.Version26=26]="Version26",t[t.Version27=27]="Version27",t[t.Version28=28]="Version28",t[t.Version29=29]="Version29",t[t.Version30=30]="Version30",t[t.Version31=31]="Version31",t[t.Version32=32]="Version32",t[t.Version33=33]="Version33",t[t.Version34=34]="Version34",t[t.Version35=35]="Version35",t[t.Version36=36]="Version36",t[t.Version37=37]="Version37",t[t.Version38=38]="Version38",t[t.Version39=39]="Version39",t[t.Version40=40]="Version40"}(t.QRCodeVersion||(t.QRCodeVersion={})),function(t){t[t.Low=7]="Low",t[t.Medium=15]="Medium",t[t.Quartile=25]="Quartile",t[t.High=30]="High"}(t.ErrorCorrectionLevel||(t.ErrorCorrectionLevel={}));var g=function(){function t(t,e){this.width=t,this.height=e}return t}(),b=function(){function t(){}return t.getContext=function(t){return t.getContext("2d")},t.prototype.renderRootElement=function(t,e,i,a){var o=r("canvas",t),n=o.getContext("2d");return n.fillStyle=e,n.fillRect(0,0,i,a),o},t.prototype.renderRect=function(t,e){var r=t.getContext("2d");if(e.imageSource){var i=new Image;i.src=e.imageSource,i.onload=function(){r.drawImage(i,e.x,e.y,e.width,e.height)}}else r.fillStyle=e.color,r.fillRect(e.x,e.y,e.width,e.height);return t},t.prototype.renderText=function(t,e){var r=t.getContext("2d");return r.save(),r.font=e.stringSize+"px "+e.fontStyle,r.fillStyle=e.color,r.fillText(e.string,e.x,e.y),t},t}(),f=function(){function t(){}return t.prototype.renderRootElement=function(t,e){var r=n("svg",t);return r.style.background=e,r},t.prototype.renderRect=function(t,e){if(e.imageSource)return this.renderImage(t,e);var r=document.createElementNS("http://www.w3.org/2000/svg","rect");return r.setAttribute("x",e.x.toString()),r.setAttribute("y",e.y.toString()),r.setAttribute("width",e.width.toString()),r.setAttribute("height",e.height.toString()),r.setAttribute("fill",e.color),r.style.shapeRendering="crispEdges",t.appendChild(r),t},t.prototype.renderText=function(t,e){var r=document.createElementNS("http://www.w3.org/2000/svg","text");return r.setAttribute("x",e.x.toString()),r.setAttribute("y",e.y.toString()),r.setAttribute("fill",e.color),r.style.fontSize=e.stringSize.toString()+"px",r.style.fontFamily=e.fontStyle,r.textContent=e.string,t.appendChild(r),t},t.prototype.renderImage=function(t,e){var r=document.createElementNS("http://www.w3.org/2000/svg","image");return r.setAttribute("x",e.x.toString()),r.setAttribute("y",e.y.toString()),r.setAttribute("width",e.width.toString()),r.setAttribute("height",e.height.toString()),r.setAttribute("href",e.imageSource),r.setAttribute("preserveAspectRatio","none"),t.appendChild(r),t},t}(),y=function(){function t(t,e){this.renderer=null,this.isSvgMode=null,this.isSvgMode=e,this.renderer=e?new f:new b}return t.prototype.renderRootElement=function(t,e,r,i){return this.renderer.renderRootElement(t,e,r,i)},t.prototype.renderRectElement=function(t,e){return this.renderer.renderRect(t,e)},t.prototype.renderTextElement=function(t,e){return this.renderer.renderText(t,e)},t}(),v=function(){function t(){}return t}(),k=function(){function t(t,e,r,i){this.x=Number.MAX_VALUE,this.y=Number.MAX_VALUE,this.width=0,this.height=0,this.x=t,this.y=e,this.width=r,this.height=i}return t}(),S=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),C=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return S(e,t),e.prototype.getInstance=function(t){var e=document.getElementById(t);return new y(e.id,this.isSvgMode)},e.prototype.getDrawableSize=function(t,e,r){var i=(this.isSvgMode?t.bottom:1.5*t.bottom)+(this.isSvgMode?t.top:1.5*t.top),a=(this.isSvgMode?t.right:1.5*t.right)+(this.isSvgMode?t.left:1.5*t.left);return new k(t.left,t.top,e-a,r-i)},e.prototype.getBaseAttributes=function(t,e,r,i,a,o,n,s,c){var h={width:t,height:e,x:r,y:i,color:a,string:o,stringSize:n,visibility:s,fontStyle:c};if(this.isSvgMode||(h.height=h.height/1.5),o&&!this.isSvgMode){var l=1.5*this.margin.bottom-this.margin.bottom;h.y+=l}return h},e.prototype.getBarLineRatio=function(t,e){var r=this.type;if("Code39"===r||"Code32"===r||"Code39Extension"===r||"Code11"===r){var i=t.length*("Code39"===r||"Code32"===r||"Code39Extension"===r?6:3);return e/(t.length*("Code39"===r||"Code32"===r||"Code39Extension"===r?3:2)*2+i+t.length-1)}if("Code128A"===r||"Code128B"===r||"Code128C"===r||"Code128"===r)return e/((c=t[0].length)+t.length-1);if("Code93Extension"===r){for(var a=0,o=0;o<t.length;o++)for(var n=t[parseInt(o.toString(),10)],s=0;s<n.length;s++)a+=Number(n[parseInt(s.toString(),10)]);return e/a}for(var c=0,o=0;o<t.length;o++)c+=n=t[parseInt(o.toString(),10)].length;var h=void 0;return"Ean8"===r||"Ean13"===r||"UpcA"===r?h=2:"Code93"===r&&(h=1-t.length),e/(h?c+t.length-1+h:c+t.length-1)},e.prototype.multipleWidth=function(t,e,r){var i;return"1"===t[parseInt(e.toString(),10)]&&"1"===t[e+1]?(i=r+1,this.multipleWidth(t,e+1,i)):r},e.prototype.barCodeType=function(t){return"Code39"===t||"UpcE"===t||"Code39Extension"===t?"twoBars":"UpcA"===t||"Ean13"===t||"Ean8"===t?"threeBars":"noBars"},e.prototype.checkStartValueCondition=function(t,e,r,i){return 1===t&&0===e&&"twoBars"===i&&"UpcE"!==this.type||(0===t&&e===r-1||2===t&&e===r-2)&&("Ean8"===this.type||"Ean13"===this.type)||"UpcE"===this.type&&2===t&&0===e||"UpcA"!==this.type&&"threeBars"===i&&2===t&&e===r-1||"UpcA"===this.type&&(1===t&&e===r-2||3===t&&e===r-2)||"noBars"===i&&0===t&&0===e},e.prototype.checkEndValueCondition=function(t,e,r,i,a,o){var n=this.type;return t===r&&e===i.length-2&&("Code39"===n||"Code39Extension"===n)||"Code11"===n&&e===i.length-1&&t===r-1||"Code93Extension"===n&&e===i.length-1&&t===r-1||"Ean8"===n&&(1===e&&t===r||e===i.length-2&&t===r)||"Ean13"===this.type&&(2===e&&1===t||e===i.length-2&&t===r)||"UpcA"===n&&(3===e&&0===t||5===e&&(a?t===o:1===t))||"UpcE"===n&&e===i.length-2&&1===t||"Code93"===n&&e===i.length-1&&t===r-1||"Code39"!==n&&"Code39Extension"!==n&&"Ean8"!==n&&"Ean13"!==n&&e===i.length-1&&t===r},e.prototype.getDisplayText=function(t,e){return"Ean8"===this.type?1===t?this.value.substring(0,4):this.value.substring(4,8):"Ean13"===this.type?2===t?this.value.substring(1,7):this.value.substring(7):"UpcA"===this.type?3===t?this.value.substring(0,6):this.value.substring(6,12):e.text?e.text:this.value},e.prototype.checkExtraHeight=function(t,e,r){return!(0!==t&&t!==r.length-1||"Code39"!==e&&"Code39Extension"!==e)||!("Ean8"!==e&&"Ean13"!==e||0!==t&&2!==t&&t!==r.length-1)||"UpcA"===e&&(1===t||t===r.length-2||t===r.length-4)||"UpcE"===e&&(1===t||t===r.length-2||t===r.length-4)},e.prototype.getWidthValue=function(t,e,r){return"Code93Extension"!==this.type&&(e=t?t%("Code32"===r?3:2)?1:2:1),"Code93Extension"===this.type&&(e=!t||t%4?!t||t%2?!t||t%3?1:3:2:4),e},e.prototype.calculateBarCodeAttributes=function(t,e,r){var i,o=!1,n=this.getDrawableSize(this.margin,this.width,this.height);if(n.height>0&&n.width>0){var c=void 0,h=[],l=n.x,u=this.getBarLineRatio(t,n.width);u=this.isSvgMode?u:u/1.5;for(var p=0,d=void 0,m=this.type,g=this.displayText.position,b=this.isSvgMode?1:1.5,f=void 0,y=void 0,v=void 0,k=void 0,S=0;S<t.length;S++){var C=t[parseInt(S.toString(),10)],w="UpcA"!==m&&"UpcE"!==m&&"Code11"!==m&&"Code93"!==m&&"Code93Extension"!==m,I=this.barCodeType(this.type),x=this.checkExtraHeight(S,m,t),V=C.length;o=!1;for(var E=0;w?E<=V:E<V;E++){var A=!1;this.checkStartValueCondition(S,E,V,I)?p=l:this.checkEndValueCondition(E,S,V,t,o,i)&&(d=l,"UpcA"===this.type&&o&&i&&(d-=i*u),A=!0);var M="Code39"===m||"Code93Extension"===m||"Code32"===m||"Code11"===m||"Code39Extension"===m?!(E%2):"1"===C[parseInt(E.toString(),10)],D=C.toString(),B=Number(D[parseInt(E.toString(),10)]),O=void 0;O=this.getWidthValue(B,O,m),O*=u,k=this.displayText;var P=this.getDisplayText(S,k);if(f=this.getBaseAttributes(void 0,void 0,p,"Bottom"===g?n.y+n.height+2:n.y+v-2,this.foreColor,r||P,k.size,k.visibility,k.font),v||(s(),v=(y=a(f)).height/2+2),x&&(c=this.getBaseAttributes(O,"Top"===g&&"noBars"!==I?n.height-v-this.displayText.margin.top:n.height,l,"Bottom"===g?n.y:n.y+v+this.displayText.margin.top,this.foreColor)),"Ean13"===m&&0===E&&0===S&&k.visibility&&((f=this.getBaseAttributes(void 0,void 0,p,"Bottom"===g?n.y+n.height+2:n.y+v+this.displayText.margin.top-2-this.displayText.margin.bottom,this.foreColor,r||P,k.size,k.visibility,k.font)).string=this.value[0],this.drawText(e,f)),!x||A||"UpcA"===m&&x){var L="Code39"===m||"Code32"===m||"Code93Extension"===m||"Code39Extension"===m||"Code11"===m,N=n.height,_=N-v*b>0?N-v*b:0;if(L||"Ean8"===m||"Ean13"===m){_="Top"===g&&"noBars"!==I?_-v:_;z=x?n.height:_;"Code39"!==this.type&&(z="Top"===g&&"noBars"!==I?z-this.displayText.margin.top-v:z),c=this.getBaseAttributes(O,z,l,"Bottom"===g?n.y:n.y+v+this.displayText.margin.top,this.foreColor)}if(!(L&&(A||L)||A&&"UpcE"===this.type)){E+=(i=this.multipleWidth(C,E,1))-1,i>1&&(o=!0);var R=i>1?i*O:O,T=n.height-v*b,z=x?n.height:T;z="Top"===g&&"noBars"!==I?z-this.displayText.margin.top-v:z,c=this.getBaseAttributes(R,z,l,"Bottom"===g?n.y:n.y+v+this.displayText.margin.top,this.foreColor),l=i>1?l+i*O:l+1*O}if(!A&&x||this.verticalTextMargin(k,c,f),k.visibility&&(d&&"Ean8"!==m&&"Ean13"!==m&&"UpcA"!==m&&"UpcE"!==m||("Ean8"===m||"UpcA"===m||"UpcE"===m||"Ean13"===m)&&A)){if(k.margin.left||k.margin.right||!k.text&&"UpcA"!==m?this.getAlignmentPosition(f,d,p,y):this.updateOverlappedTextPosition(d-p,f,y,p,k,d),"UpcA"===m){var j=f.string===this.value.substr(0,6);f.string=j?this.value.substr(0,1):f.string.substr(0,5);var Q=j?h[0].x/2:h[h.length-1].x+f.stringSize,F=0;if(j){var X=f.x;f.x=Q,F=f.y,this.drawText(e,f),f.x=X,this.isSvgMode||(f.y=F),f.string=this.value.substr(1,5),this.updateOverlappedTextPosition(d-p,f,y,p,k,d)}else this.updateOverlappedTextPosition(d-p,f,y,p,k,d),F=f.y,this.drawText(e,f),this.isSvgMode||(f.y=F),f.string=this.value.substr(11,12),f.x=Q}this.alignDisplayText(f,k,p,d,y),this.drawText(e,f)}}M&&h.push(c),this.canIncrementCheck(m,S,t)&&(l+=O)}}this.drawImage(e,h)}},e.prototype.canIncrementCheck=function(t,e,r){return"Code39"===t||"Code32"===t||"Code39Extension"===t||"Code93Extension"===t||"Code11"===t||"UpcE"===t&&(1===e||e===r.length-2)||!("Ean8"!==t&&"Ean13"!==t||0!==e&&e!==r.length-1&&2!==e)},e.prototype.verticalTextMargin=function(t,e,r){t.margin.top&&e.height-t.margin.top>0&&(t.margin.top>0&&"Bottom"===t.position?e.height-=t.margin.top:r.y+=t.margin.top),t.margin.bottom&&e.height-t.margin.bottom>0&&(t.margin.bottom>0?(r.y-=t.margin.bottom,"Bottom"===this.displayText.position&&(e.height-=t.margin.bottom)):r.y-=t.margin.bottom)},e.prototype.getAlignmentPosition=function(t,e,r,i){"Center"===this.displayText.alignment?t.x+=(e-r)/2-.5*i.width:"Left"===this.displayText.alignment?t.x=r:t.x=e-i.width},e.prototype.drawImage=function(t,e){for(var r=this.getInstance(t.id),i=0;i<e.length;i++)r.renderRectElement(t,e[parseInt(i.toString(),10)])},e.prototype.updateDisplayTextSize=function(t,e,r,i,o){if(t.x+e.width>r||t.x<i&&t.stringSize>2){t.x<i&&o.margin.right;if(t.x<i&&o.margin.right){t.stringSize-=2;var n=a(t);t.x+=(r-i)/2-.5*n.width;var s=o.margin.right-(r-(t.x+e.width));t.x-=s,this.updateDisplayTextSize(t,n,r,i,o)}}},e.prototype.alignDisplayText=function(t,e,r,i,o){var n=!1;if(e.margin.left||e.margin.right){if(t.x-r<e.margin.left&&e.margin.left){n=!0;s=e.margin.left-(t.x-r);t.x+=s,this.updateDisplayTextSize(t,o,i,r,e)}if(i-(t.x+o.width)<e.margin.right&&e.margin.right&&!n){var s=e.margin.right-(i-(t.x+o.width));t.x-=s,this.updateDisplayTextSize(t,o,i,r,e)}else if(i-(t.x+o.width)<e.margin.right){var c=a(t);this.updateOverlappedTextPosition(i-r,t,c,r,e,i),this.updateDisplayTextSize(t,c,i,r,e)}}},e.prototype.updateOverlappedTextPosition=function(t,e,r,i,o,n){if((r.width>t||o)&&n-(e.x+r.width)<=o.margin.right&&e.stringSize>2){e.stringSize-=o?.2:2;var s=a(e);this.updateOverlappedTextPosition(t,e,s,i,o,n)}else!o.margin.left&&!o.margin.right&&e.stringSize>2&&this.getAlignmentPosition(e,n,i,r)},e.prototype.drawText=function(t,e){this.isSvgMode||(e.y/=1.5),this.getInstance(t.id).renderTextElement(t,e)},e}(v),w=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),I=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return w(e,t),e.prototype.validateInput=function(t){return-1===t.search(/^[0-9A-Za-z\-\.\ \@\$\/\+\%\!\@\#\$\%\&\*\^\(\)\_\+\=\<\>\?\{\}\[\]\~\-\Ê]+$/)?"Supports only 128 characters of ASCII.":void 0},e.prototype.getCodeValue=function(){return[11011001100,11001101100,11001100110,10010011e3,10010001100,10001001100,10011001e3,10011000100,10001100100,11001001e3,11001000100,11000100100,10110011100,10011011100,10011001110,10111001100,10011101100,10011100110,11001110010,11001011100,11001001110,11011100100,11001110100,11101101110,11101001100,11100101100,11100100110,11101100100,11100110100,11100110010,11011011e3,11011000110,11000110110,10100011e3,10001011e3,10001000110,10110001e3,10001101e3,10001100010,11010001e3,11000101e3,11000100010,10110111e3,10110001110,10001101110,10111011e3,10111000110,10001110110,11101110110,11010001110,11000101110,11011101e3,11011100010,11011101110,11101011e3,11101000110,11100010110,11101101e3,11101100010,11100011010,11101111010,11001000010,11110001010,1010011e4,10100001100,1001011e4,10010000110,10000101100,10000100110,1011001e4,10110000100,1001101e4,10011000010,10000110100,10000110010,11000010010,1100101e4,11110111010,11000010100,10001111010,10100111100,10010111100,10010011110,10111100100,10011110100,10011110010,11110100100,11110010100,11110010010,11011011110,11011110110,11110110110,10101111e3,10100011110,10001011110,10111101e3,10111100010,11110101e3,11110100010,10111011110,10111101110,11101011110,11110101110,11010000100,1101001e4,11010011100,1100011101011]},e.prototype.getBytes=function(t){for(var e=[],r=0;r<t.length;r++)e.push(t[parseInt(r.toString(),10)].charCodeAt(0));return e},e.prototype.appendStartStopCharacters=function(t){var e;return"Code128A"===this.type?e=String.fromCharCode(208):"Code128B"===this.type?e=String.fromCharCode(209):"Code128C"===this.type&&(e=String.fromCharCode(210)),e+t},e.prototype.check128C=function(t){return t.match(new RegExp("^(Ï*[0-9]{2}Ï*)*"))[0]},e.prototype.check128A=function(t){return t.match(new RegExp("^[\0-_È-Ï]*"))[0]},e.prototype.check128B=function(t){return t.match(new RegExp("^[ -È-Ï]*"))[0]},e.prototype.clipAB=function(t,e){var r=e?"[\0-_È-Ï]":"[ -È-Ï]",i=t.match(new RegExp("^("+r+"+?)(([0-9]{2}){2,})([^0-9]|$)"));return i?i[1]+String.fromCharCode(204)+this.clipC(t.substring(i[1].length)):(t.match(new RegExp("^"+r+"+"))[0].length,t.length,t)},e.prototype.code128Clip=function(){if(this.check128C(this.value).length>=2)return String.fromCharCode(210)+this.clipC(this.value);var t=this.check128A(this.value)>this.check128B(this.value);return(t?String.fromCharCode(208):String.fromCharCode(209))+this.clipAB(this.value,t)},e.prototype.clipC=function(t){var e=this.check128C(t),r=e.length;if(r===t.length)return t;t=t.substring(r);var i=this.check128A(t)>=this.check128B(t);return e+String.fromCharCode(i?206:205)+this.clipAB(t,i)},e.prototype.draw=function(t){this.code128(t)},e.prototype.code128=function(t){var e=this.value;e="Code128"!==this.type?this.appendStartStopCharacters(e):this.code128Clip();var r,i=this.getBytes(e),a=i.shift()-105;r=103===a?"0":104===a?"1":"2";var o=this.encodeData(i,1,r),n=this.encode(a,o),s=[];s.push(n),this.calculateBarCodeAttributes(s,t)},e.prototype.encodeData=function(t,e,r){if(!t.length)return{result:"",checksum:0};var i,a;if(t[0]>=200){a=t.shift()-105;var o=this.swap(a);void 0!==o&&(i=this.encodeData(t,e+1,o))}else a=this.correctIndex(t,r),i=this.encodeData(t,e+1,r);var n=a*e;return{result:this.getCodes(a)+i.result,checksum:n+i.checksum}},e.prototype.swap=function(t){return 99===t?"2":100===t?"1":"0"},e.prototype.encode=function(t,e){var r=this.getCodes(t)+e.result;return this.enableCheckSum&&(r+=this.getCodes((e.checksum+t)%103)),r+=this.getCodes(106)},e.prototype.correctIndex=function(t,e){if("0"===e){var r=t.shift();return r<32?r+64:r-32}return"1"===e?t.shift()-32:10*(t.shift()-48)+t.shift()-48},e.prototype.getCodes=function(t){var e=this.getCodeValue();return e[parseInt(t.toString(),10)]?e[parseInt(t.toString(),10)].toString():""},e}(C),x=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),V=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return x(e,t),e.prototype.validateInput=function(t){return new RegExp("^[ -È-Ï]+$").test(t)?void 0:"Supports only ASCII characters 32 to 127 (0–9, A–Z, a–z), and special characters."},e.prototype.draw=function(t){this.code128(t)},e}(I),E=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),A=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return E(e,t),e.prototype.validateInput=function(t){return new RegExp("^(Ï*[0-9]{2}Ï*)+$").test(t)?void 0:"Supports even number of numeric characters (00-99)."},e.prototype.draw=function(t){this.code128(t)},e}(I),M=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),D=function(t,e,r,i){var a,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(n=(o<3?a(n):o>3?a(e,r,n):a(e,r))||n);return o>3&&n&&Object.defineProperty(e,r,n),n},B=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return M(r,t),D([e.Property(10)],r.prototype,"left",void 0),D([e.Property(10)],r.prototype,"right",void 0),D([e.Property(10)],r.prototype,"top",void 0),D([e.Property(10)],r.prototype,"bottom",void 0),r}(e.ChildProperty),O=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),P=function(t,e,r,i){var a,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(n=(o<3?a(n):o>3?a(e,r,n):a(e,r))||n);return o>3&&n&&Object.defineProperty(e,r,n),n},L=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return O(r,t),P([e.Property("")],r.prototype,"text",void 0),P([e.Property(!0)],r.prototype,"visibility",void 0),P([e.Property("monospace")],r.prototype,"font",void 0),P([e.Property(20)],r.prototype,"size",void 0),P([e.Complex({left:0,right:0,top:0,bottom:0},B)],r.prototype,"margin",void 0),P([e.Property("Center")],r.prototype,"alignment",void 0),P([e.Property("Bottom")],r.prototype,"position",void 0),r}(e.ChildProperty),N=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),_=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return N(e,t),e.prototype.getCodeValue=function(){return["111221211","211211112","112211112","212211111","111221112","211221111","112221111","111211212","211211211","112211211","211112112","112112112","212112111","111122112","211122111","112122111","111112212","211112211","112112211","111122211","211111122","112111122","212111121","111121122","211121121","112121121","111111222","211111221","112111221","111121221","221111112","122111112","222111111","121121112","221121111","122121111","121111212","221111211","122111211","121121211","121212111","121211121","121112121","111212121"]},e.prototype.getCharacter=function(){return"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. *$/+%"},e.prototype.checkSum=function(t,e){for(var r=0,i=0;i<t.length;i++)r+=e.indexOf(t[parseInt(i.toString(),10)]);return r%=43},e.prototype.validateInput=function(t){return-1===t.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)?"Supports A-Z, 0-9, and symbols ( - . $ / + % SPACE).":void 0},e.prototype.getPatternCollection=function(t,e){for(var r,i=[],a=this.getCodeValue(),o=0;o<t.length;o++)r=e.indexOf(t.charAt(o)),i.push(a[parseInt(r.toString(),10)]);return i},e.prototype.appendStartStopCharacters=function(t){return"*"+t+"*"},e.prototype.drawCode39Extension=function(t,e){this.draw(t,e)},e.prototype.draw=function(t,e){var r=e||this.value,i=this.getCharacter();this.enableCheckSum&&(r+=this.checkSum(r,i)),r=this.appendStartStopCharacters(r);var a=this.getPatternCollection(r,i);this.calculateBarCodeAttributes(a,t)},e}(C),R=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),T=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e.prototype.validateInput=function(t){return-1===t.search(/^[0-9A-D\-\.\$\/\+\%\:]+$/)?"Supports 0-9, A-D and symbols (-,$, /, ., +).":void 0},e.prototype.getCodeValue=function(){return{0:"101010011",1:"101011001",2:"101001011",3:"110010101",4:"101101001",5:"110101001",6:"100101011",7:"100101101",8:"100110101",9:"110100101","-":"101001101",$:"101100101",":":"1101011011","/":"1101101011",".":"1101101101","+":"101100110011",A:"1011001001",B:"1001001011",C:"1010010011",D:"1010011001"}},e.prototype.appendStartStopCharacters=function(t){return"A"+t+"A"},e.prototype.getPatternCollection=function(t,e){for(var r=[],i=0;i<t.length;i++){var a=t[parseInt(i.toString(),10)];r.push(e[""+a])}return r},e.prototype.draw=function(t){var e=this.getCodeValue(),r=this.value;r=this.appendStartStopCharacters(r);var i=this.getPatternCollection(r,e);this.calculateBarCodeAttributes(i,t)},e}(C),z=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),j=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return z(e,t),e.prototype.validateInput=function(t){return new RegExp("^[\0-_È-Ï]+$").test(t)?void 0:"Supports only ASCII characters 00 to 95 (0–9, A–Z and control codes) and special characters."},e.prototype.draw=function(t){this.code128(t)},e}(I),Q=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),F=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Q(e,t),e.prototype.validateInput=function(t){return-1!==t.search(/^[0-9]{8}$/)&&Number(t[7])===this.checkSumData(t)?void 0:"Accepts 8 numeric characters."},e.prototype.getCodeValueRight=function(t){return t?{0:"0001101",1:"0011001",2:"0010011",3:"0111101",4:"0100011",5:"0110001",6:"0101111",7:"0111011",8:"0110111",9:"0001011"}:{0:"1110010",1:"1100110",2:"1101100",3:"1000010",4:"1011100",5:"1001110",6:"1010000",7:"1000100",8:"1001000",9:"1110100"}},e.prototype.checkSumData=function(t){for(var e=0;e<t.length;e++){var r=10-(Number(t[1])+Number(t[3])+Number(t[5])+3*(Number(t[0])+Number(t[2])+Number(t[4])+Number(t[6])))%10;return 0===r?r=0:r}return 0},e.prototype.draw=function(t){var e=this.getCodeValueRight(!0),r=[];r.push("101"),r.push(this.leftValue(e,!0)),r.push("01010"),e=this.getCodeValueRight(!1),r.push(this.leftValue(e,!1)),r.push("101"),this.calculateBarCodeAttributes(r,t)},e.prototype.leftValue=function(t,e){for(var r,i=e?0:this.value.length-4;i<(e?this.value.length-4:this.value.length);i++)0===i||4===i?r=t[this.value[parseInt(i.toString(),10)]]:r+=t[this.value[parseInt(i.toString(),10)]];return r},e}(C),X=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),G=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return X(e,t),e.prototype.validateInput=function(t){var e=this.checksumValue(t);return-1===t.search(/^[0-9]{13}$/)||Number(t[12])!==this.checkSumData(t)&&Number(t[12])!==e?-1!==t.search(/^[0-9]{12}$/)?(t+=this.checkSumData(t),void(this.value=t)):"Accepts 12 numeric characters.":void 0},e.prototype.checksumValue=function(t){return(10-t.substr(0,12).split("").map(function(t){return+t}).reduce(function(t,e,r){return r%2?t+3*e:t+e},0)%10)%10},e.prototype.checkSumData=function(t){var e=3*(Number(t[11])+Number(t[9])+Number(t[7])+Number(t[5])+Number(t[3])+Number(t[1]))+(Number(t[10])+Number(t[8])+Number(t[6])+Number(t[4])+Number(t[2])+Number(t[0]));return 10*Math.round(e/10)-e},e.prototype.getStructure=function(){return{0:"LLLLLL",1:"LLGLGG",2:"LLGGLG",3:"LLGGGL",4:"LGLLGG",5:"LGGLLG",6:"LGGGLL",7:"LGLGLG",8:"LGLGGL",9:"LGGLGL"}},e.prototype.getBinaries=function(){return{L:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],G:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"],R:["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"],O:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],E:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"]}},e.prototype.draw=function(t){var e=[],r=this.getStructure()[this.value[0]];e.push("101");var i=this.value.substr(1,6);e.push(this.leftValue(!0,r,i)),e.push("01010"),i=this.value.substr(7,6),e.push(this.leftValue(!1,"RRRRRR",i)),e.push("101"),this.calculateBarCodeAttributes(e,t)},e.prototype.leftValue=function(t,e,r){for(var i,a,o=this.getBinaries(),n=0;n<r.length;n++)a=o[e[parseInt(n.toString(),10)]],0===n?i=a[r[parseInt(n.toString(),10)]]:i+=a[r[parseInt(n.toString(),10)]];return i},e}(C),U=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),W=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return U(e,t),e.prototype.validateInput=function(t){return-1!==t.search(/^[0-9]{6}$/)?void 0:"Accepts 6 numeric characters."},e.prototype.checkSum=function(t){var e,r=0;for(e=1;e<11;e+=2)r+=parseInt(t[e],void 0);for(e=0;e<11;e+=2)r+=3*parseInt(t[e],void 0);return(10-r%10)%10},e.prototype.getStructure=function(){return{0:"EEEOOO",1:"EEOEOO",2:"EEOOEO",3:"EEOOOE",4:"EOEEOO",5:"EOOEEO",6:"EOOOEE",7:"EOEOEO",8:"EOEOOE",9:"EOOEOE"}},e.prototype.getValue=function(){return["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"]},e.prototype.getExpansion=function(t){return this.getValue()[""+t]},e.prototype.getUpcValue=function(){for(var t=this.value[this.value.length-1],e=this.getExpansion(t),r="",i=0,a=0;a<e.length;a++){var o=e[parseInt(a.toString(),10)];r+="X"===o?this.value[i++]:o}var n=""+(r="0"+r);return this.enableCheckSum&&(n+=this.checkSum(r)),n},e.prototype.getBinaries=function(){return{O:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],E:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"]}},e.prototype.encoding=function(t,e,r){for(var i,a,o=this.getBinaries(),n=0;n<e.length;n++)a=o[r[parseInt(n.toString(),10)]],0===n?i=a[e[parseInt(n.toString(),10)]]:i+=a[e[parseInt(n.toString(),10)]];return i},e.prototype.draw=function(t){var e=[],r=this.getUpcValue(),i=this.getStructure()[r[r.length-1]];e.push("00000000"),e.push("101"),e.push(this.encoding(r,this.value,i)),e.push("010101"),e.push("00000000");var a=r[0]+this.value+r[r.length-1];this.calculateBarCodeAttributes(e,t,""===this.displayText.text?a:void 0)},e}(C),$=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),H=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return $(e,t),e.prototype.validateInput=function(t){return-1!==t.search(/^[0-9]{11}$/)&&this.enableCheckSum&&(this.value+=this.checkSumData(this.value)),-1!==this.value.search(/^[0-9]{12}$/)&&Number(this.value[11])===this.checkSumData(this.value)?void 0:"Accepts 11 numeric characters."},e.prototype.checkSumData=function(t){return(10-(3*(Number(t[0])+Number(t[2])+Number(t[4])+Number(t[6])+Number(t[8])+Number(t[10]))+(Number(t[9])+Number(t[7])+Number(t[5])+Number(t[3])+Number(t[1])))%10)%10},e.prototype.getBinaries=function(){return{L:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],R:["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"]}},e.prototype.draw=function(t){var e=[];e.push("00000000"),e.push("101"+this.leftValue(!0,"L",this.value[0])),e.push(this.leftValue(!0,"LLLLL",this.value.substr(1,5))),e.push("01010"),e.push(this.leftValue(!0,"RRRRR",this.value.substr(6,5))),e.push(this.leftValue(!0,"R",this.value[11])+"101"),e.push("00000000"),this.calculateBarCodeAttributes(e,t)},e.prototype.leftValue=function(t,e,r){for(var i,a,o=this.getBinaries(),n=0;n<r.length;n++)a=o[e[parseInt(n.toString(),10)]],0===n?i=a[r[parseInt(n.toString(),10)]]:i+=a[r[parseInt(n.toString(),10)]];return i},e}(C),Z=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),J=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Z(e,t),e.prototype.validateInput=function(t){return-1===t.search(/^[0-9\-\*]+$/)?"This bar code support 0-9 , * , -":void 0},e.prototype.getCodeValue=function(){return{0:"111121",1:"211121",2:"121121",3:"221111",4:"112121",5:"212111",6:"122111",7:"111221",8:"211211",9:"211111","-":"112111","*":"112211"}},e.prototype.getPatternCollection=function(t){for(var e=[],r=this.getCodeValue(),i=0;i<t.length;i++)e.push(r[t[parseInt(i.toString(),10)]]);return e},e.prototype.draw=function(t){var e=[],r="*"+this.value+"*";e=this.getPatternCollection(r),this.calculateBarCodeAttributes(e,t)},e}(C),K=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return K(e,t),e.prototype.validateInput=function(t){return-1===t.search(/^[0-9A-Z\-\.\*\$\/\+\ %\ ]+$/)?"Supports A-Z, 0-9, and symbols ( - . $ / + % SPACE).":void 0},e.prototype.getCharacterWeight=function(){return{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","(+)":"45","(%)":"46"}},e.prototype.getCodeValue=function(){return{0:"100010100",1:"101001000",2:"101000100",3:"101000010",4:"100101000",5:"100100100",6:"100100010",7:"101010000",8:"100010010",9:"100001010",A:"110101000",B:"110100100",C:"110100010",D:"110010100",E:"110010010",F:"110001010",G:"101101000",H:"101100100",I:"101100010",J:"100110100",K:"100011010",L:"101011000",M:"101001100",N:"101000110",O:"100101100",P:"100010110",Q:"110110100",R:"110110010",S:"110101100",T:"110100110",U:"110010110",V:"110011010",W:"101101100",X:"101100110",Y:"100110110",Z:"100111010","-":"100101110",".":"111010100"," ":"111010010",$:"111001010","/":"101101110","+":"101110110","%":"110101110","($)":"100100110","(/)":"111010110","(+)":"100110010","(%)":"111011010"}},e.prototype.getPatternCollection=function(t,e,r){for(var i=r,a=0;a<t.length;a++){var o=t[parseInt(a.toString(),10)];i.push(e[""+o])}},e.prototype.calculateCheckSum=function(t){for(var e=t,r=0,i=0,a=this.getCharacterWeight(),o=e.length;o>0;o--)r+=a[e[parseInt(i.toString(),10)]]*o,i++;var n=r%47;return Object.keys(a)[parseInt(n.toString(),10)]},e.prototype.draw=function(t){var e=this.getCodeValue(),r=[],i=this.value;this.enableCheckSum&&(i+=this.calculateCheckSum(i),i+=this.calculateCheckSum(i)),r.push("101011110"),this.getPatternCollection(i,e,r),r.push("101011110"),r.push("1"),this.calculateBarCodeAttributes(r,t)},e}(C),q=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),tt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.barcodeSymbols=[],e}return q(e,t),e.prototype.validateInput=function(t){return this.getValue(t)?void 0:"Supports 128 characters of ASCII."},e.prototype.getValue=function(t){for(var e=0;e<t.length;e++)if(t.charCodeAt(e)>127)return!1;return!0},e.prototype.getBars=function(){this.barcodeSymbols[0]={value:"",checkDigit:0,bars:"111213"},this.barcodeSymbols[1]={value:"1",checkDigit:1,bars:"111213"},this.barcodeSymbols[2]={value:"2",checkDigit:2,bars:"111312 "},this.barcodeSymbols[3]={value:"3",checkDigit:3,bars:"111411 "},this.barcodeSymbols[4]={value:"4",checkDigit:4,bars:"121113"},this.barcodeSymbols[5]={value:"5",checkDigit:5,bars:"121212"},this.barcodeSymbols[6]={value:"6",checkDigit:6,bars:"121311"},this.barcodeSymbols[7]={value:"7",checkDigit:7,bars:"111114"},this.barcodeSymbols[8]={value:"8",checkDigit:8,bars:"131211"},this.barcodeSymbols[9]={value:"9",checkDigit:9,bars:"141111"},this.barcodeSymbols[10]={value:"A",checkDigit:10,bars:"211113"},this.barcodeSymbols[11]={value:"B",checkDigit:11,bars:"211212"},this.barcodeSymbols[12]={value:"C",checkDigit:12,bars:"211311"},this.barcodeSymbols[13]={value:"D",checkDigit:13,bars:"221112"},this.barcodeSymbols[14]={value:"E",checkDigit:14,bars:"221211 "},this.barcodeSymbols[15]={value:"F",checkDigit:15,bars:"231111"},this.barcodeSymbols[16]={value:"G",checkDigit:16,bars:"112113"},this.barcodeSymbols[17]={value:"H",checkDigit:17,bars:"112212"},this.barcodeSymbols[18]={value:"I",checkDigit:18,bars:"112311"},this.barcodeSymbols[19]={value:"J",checkDigit:19,bars:"122112"},this.barcodeSymbols[20]={value:"K",checkDigit:20,bars:"132111 "},this.barcodeSymbols[21]={value:"L",checkDigit:21,bars:"111123"},this.barcodeSymbols[22]={value:"M",checkDigit:22,bars:"111222"},this.barcodeSymbols[23]={value:"N",checkDigit:23,bars:"111321"},this.barcodeSymbols[24]={value:"O",checkDigit:24,bars:"121122 "},this.barcodeSymbols[25]={value:"P",checkDigit:25,bars:"131121 "},this.barcodeSymbols[26]={value:"Q",checkDigit:26,bars:"212112 "},this.barcodeSymbols[27]={value:"R",checkDigit:27,bars:" 212211 "},this.barcodeSymbols[28]={value:"S",checkDigit:28,bars:"211122"},this.barcodeSymbols[29]={value:"T",checkDigit:29,bars:"211221"},this.barcodeSymbols[30]={value:"U",checkDigit:30,bars:"221121"},this.barcodeSymbols[31]={value:"V",checkDigit:31,bars:"222111"},this.barcodeSymbols[32]={value:"W",checkDigit:32,bars:"112122"},this.barcodeSymbols[33]={value:"X",checkDigit:33,bars:"112221"},this.barcodeSymbols[34]={value:"Y",checkDigit:34,bars:"122121"},this.barcodeSymbols[35]={value:"Z",checkDigit:35,bars:" 123111"},this.barcodeSymbols[36]={value:"-",checkDigit:36,bars:"121131"},this.barcodeSymbols[37]={value:".",checkDigit:37,bars:"311112"},this.barcodeSymbols[38]={value:" ",checkDigit:38,bars:"311211"},this.barcodeSymbols[39]={value:"$",checkDigit:39,bars:"321111"},this.barcodeSymbols[40]={value:"/",checkDigit:40,bars:"112131"},this.barcodeSymbols[41]={value:"+",checkDigit:41,bars:"113121"},this.barcodeSymbols[42]={value:"%",checkDigit:42,bars:"211131"},this.barcodeSymbols[43]={value:"*",checkDigit:42,bars:"111141"},this.barcodeSymbols[44]={value:"ÿ",checkDigit:47,bars:"1111411"},this.barcodeSymbols[45]={value:"û",checkDigit:43,bars:"121220"},this.barcodeSymbols[46]={value:"ü",checkDigit:44,bars:"312111 "},this.barcodeSymbols[47]={value:"ý",checkDigit:45,bars:"311121"},this.barcodeSymbols[48]={value:"þ",checkDigit:46,bars:"122211"}},e.prototype.GetExtendedText=function(t){var e,r=this.value;this.extendedText="";for(var i=0;i<r.length;i++){for(var a=t.length-1;a>0;a--)if(t[parseInt(a.toString(),10)]&&t[parseInt(a.toString(),10)].value&&t[parseInt(a.toString(),10)].character===r[parseInt(i.toString(),10)]){e=t[parseInt(a.toString(),10)];break}e.keyword&&e.value?this.extendedText+=e.keyword+e.value:e.value&&e.value&&(this.extendedText+=e.value)}},e.prototype.drawCode93=function(t){this.getBars();var e=[],r=this.getArrayValue();this.GetExtendedText(r);for(var i=this.CalculateCheckDigit(),a=0;a<i.length;a++)this.extendedText+=i[parseInt(a.toString(),10)];e[0]="*"+this.extendedText+"ÿ";var o=[];o=this.encoding(e),this.calculateBarCodeAttributes(o,t)},e.prototype.GetCheckSumSymbols=function(){for(var t,e=this.extendedText,r=e,i=[],a=0,o=r.length,n=0;n<o;n++){0===(u=(o-n)%20)&&(u=20);for(var s=0;s<this.barcodeSymbols.length;s++)r[parseInt(n.toString(),10)]===this.barcodeSymbols[parseInt(s.toString(),10)].value&&(t=this.barcodeSymbols[parseInt(s.toString(),10)].checkDigit);a+=t*u}a%=47;for(var c="",h=0;h<this.barcodeSymbols.length;h++)if(a===this.barcodeSymbols[parseInt(h.toString(),10)].checkDigit){c=this.barcodeSymbols[parseInt(h.toString(),10)].value;break}var l=this.extendedText;l+=c,i[0]=c,a=0,o=(r=e=l).length;for(n=0;n<o;n++){var u=(o-n)%15;0===u&&(u=15);for(var p=0;p<this.barcodeSymbols.length;p++)r[parseInt(n.toString(),10)]===this.barcodeSymbols[parseInt(p.toString(),10)].value&&(a+=this.barcodeSymbols[parseInt(p.toString(),10)].checkDigit*u)}e+=a%=47;for(var d=" ",n=0;n<this.barcodeSymbols.length;n++)if(a===this.barcodeSymbols[parseInt(n.toString(),10)].checkDigit){d=this.barcodeSymbols[parseInt(n.toString(),10)].value;break}return l+=d,i[1]=d,i},e.prototype.CalculateCheckDigit=function(){for(var t=this.extendedText,e=0,r=0;r<t.length;r++)for(var i=0;i<this.barcodeSymbols.length;i++)t[parseInt(r.toString(),10)]===this.barcodeSymbols[parseInt(i.toString(),10)].value&&(e+=this.barcodeSymbols[i].checkDigit);return this.GetCheckSumSymbols()},e.prototype.getArrayValue=function(){var t=[];return t[0]={character:"\0",keyword:"ü",value:"U"},t[1]={character:"\x0001",keyword:"û",value:"A"},t[2]={character:"\x0002",keyword:"x00fb",value:"B"},t[3]={character:"\x0003",keyword:"û",value:"C"},t[4]={character:"\x0004",keyword:"û",value:"D"},t[5]={character:"\x0005",keyword:"û",value:"E"},t[6]={character:"\x0006",keyword:"û",value:"F"},t[7]={character:"a",keyword:"û",value:"G"},t[8]={character:"\b",keyword:"û",value:"H"},t[9]={character:"\t",keyword:"û",value:"I"},t[10]={character:"\n",keyword:"û",value:"J"},t[12]={character:"\v",keyword:"û",value:"K"},t[13]={character:"\f",keyword:"û",value:"L"},t[14]={character:"\r",keyword:"û",value:"M"},t[15]={character:"\x000e",keyword:"û",value:"N"},t[16]={character:"\x000f",keyword:"û",value:"O"},t[17]={character:"\x0010",keyword:"û",value:"P"},t[18]={character:"\x0011",keyword:"û",value:"Q"},t[19]={character:"\x0012",keyword:"û",value:"R"},t[20]={character:"\x0013",keyword:"û",value:"S"},t[21]={character:"\x0014",keyword:"û",value:"T"},t[22]={character:"\x0015",keyword:"û",value:"U"},t[23]={character:"\x0016",keyword:"û",value:"V"},t[24]={character:"\x0017",keyword:"û",value:"W"},t[25]={character:"\x0018",keyword:"û",value:"X"},t[26]={character:"\x0019",keyword:"û",value:"Y"},t[27]={character:"\x001a",keyword:"û",value:"Z"},t[28]={character:"\x001b",keyword:"ü",value:"A"},t[29]={character:"\x001c",keyword:"ü",value:"B"},t[30]={character:"\x001d",keyword:"ü",value:"C"},t[31]={character:"\x001e",keyword:"ü",value:"D"},t[32]={character:"\x001f",keyword:"ü",value:"E"},t[33]={character:" ",keyword:" "},t[34]={character:"!",keyword:"ý",value:"A"},t[35]={character:'"',keyword:"ý",value:"B"},t[36]={character:"#",keyword:"ý",value:"C"},t[37]={character:"$",keyword:"ý",value:"D"},t[38]={character:"%",keyword:"ý",value:"E"},t[39]={character:"&",keyword:"ý",value:"F"},t[40]={character:"'",keyword:"ý",value:"G"},t[41]={character:"(",keyword:"ý",value:"H"},t[42]={character:")",keyword:"ý",value:"I"},t[43]={character:"*",keyword:"ý",value:"J"},t[44]={character:"+",keyword:"ý",value:"K"},t[45]={character:",",keyword:"ý",value:"L"},t[46]={character:"-",keyword:"ý",value:"M"},t[47]={character:".",keyword:"ý",value:"N"},t[48]={character:"/",keyword:"ý",value:"O"},t[49]={character:"0",value:"0"},t[50]={character:"1",value:"1"},t[51]={character:"2",value:"2"},t[52]={character:"3",value:"3"},t[53]={character:"4",value:"4"},t[54]={character:"5",value:"5"},t[55]={character:"6",value:"6"},t[56]={character:"7",value:"7"},t[57]={character:"8",value:"8"},t[58]={character:"9",value:"9"},t[59]={character:":",keyword:"ý",value:"Z"},t[60]={character:";",keyword:"ü",value:"F"},t[61]={character:"<",keyword:"ü",value:"G"},t[62]={character:"=",keyword:"ü",value:"H"},t[63]={character:">",keyword:"ü",value:"I"},t[64]={character:"?",keyword:"ü",value:"J"},t[65]={character:"@",keyword:"ü",value:"V"},t[66]={character:"A",value:"A"},t[67]={character:"B",value:"B"},t[68]={character:"C",value:"C"},t[69]={character:"D",value:"D"},t[70]={character:"E",value:"E"},t[71]={character:"F",value:"F"},t[72]={character:"G",value:"G"},t[73]={character:"H",value:"H"},t[74]={character:"I",value:"I"},t[75]={character:"J",value:"J"},t[76]={character:"K",value:"K"},t[77]={character:"L",value:"L"},t[78]={character:"M",value:"M"},t[79]={character:"N",value:"N"},t[80]={character:"O",value:"O"},t[81]={character:"P",value:"P"},t[82]={character:"Q",value:"Q"},t[83]={character:"R",value:"R"},t[84]={character:"S",value:"S"},t[85]={character:"T",value:"T"},t[86]={character:"U",value:"U"},t[87]={character:"V",value:"V"},t[88]={character:"W",value:"W"},t[88]={character:"X",value:"X"},t[89]={character:"Y",value:"Y"},t[90]={character:"Z",value:"Z"},t[91]={character:"[",keyword:"ü",value:"K"},t[92]={character:"\\",keyword:"ü",value:"L"},t[93]={character:"]",keyword:"ü",value:"M"},t[94]={character:"^",keyword:"ü",value:"N"},t[95]={character:"_",keyword:"ü",value:"O"},t[96]={character:"`",keyword:"ü",value:"W"},t[97]={charact