var J={},L={},Q={},Be;function M(){if(Be)return Q;Be=1,Object.defineProperty(Q,"__esModule",{value:!0});function s(v,l){if(!(v instanceof l))throw new TypeError("Cannot call a class as a function")}var h=function v(l,d){s(this,v),this.data=l,this.text=d.text||l,this.options=d};return Q.default=h,Q}var je;function Gt(){if(je)return L;je=1,Object.defineProperty(L,"__esModule",{value:!0}),L.CODE39=void 0;var s=function(){function o(y,p){for(var g=0;g=200){y=r.shift()-105;var p=l.SWAP[y];p!==void 0?o=t.next(r,i+1,p):((u===l.SET_A||u===l.SET_B)&&y===l.SHIFT&&(r[0]=u===l.SET_A?r[0]>95?r[0]-96:r[0]:r[0]<32?r[0]+96:r[0]),o=t.next(r,i+1,u))}else y=t.correctIndex(r,u),o=t.next(r,i+1,u);var g=t.getBar(y),m=y*i;return{result:g+o.result,checksum:m+o.checksum}}}]),t}(v.default);return Y.default=a,Y}var Z={},Ne;function $t(){if(Ne)return Z;Ne=1,Object.defineProperty(Z,"__esModule",{value:!0});var s=H(),h=function(f){return f.match(new RegExp("^"+s.A_CHARS+"*"))[0].length},v=function(f){return f.match(new RegExp("^"+s.B_CHARS+"*"))[0].length},l=function(f){return f.match(new RegExp("^"+s.C_CHARS+"*"))[0]};function d(c,f){var a=f?s.A_CHARS:s.B_CHARS,e=c.match(new RegExp("^("+a+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(e)return e[1]+String.fromCharCode(204)+_(c.substring(e[1].length));var t=c.match(new RegExp("^"+a+"+"))[0];return t.length===c.length?c:t+String.fromCharCode(f?205:206)+d(c.substring(t.length),!f)}function _(c){var f=l(c),a=f.length;if(a===c.length)return c;c=c.substring(a);var e=h(c)>=v(c);return f+String.fromCharCode(e?206:205)+d(c,e)}return Z.default=function(c){var f=void 0,a=l(c).length;if(a>=2)f=s.C_START_CHAR+_(c);else{var e=h(c)>v(c);f=(e?s.A_START_CHAR:s.B_START_CHAR)+d(c,e)}return f.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(t,n){return String.fromCharCode(203)+n})},Z}var Ge;function Ft(){if(Ge)return W;Ge=1,Object.defineProperty(W,"__esModule",{value:!0});var s=Pe(),h=d(s),v=$t(),l=d(v);function d(e){return e&&e.__esModule?e:{default:e}}function _(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function f(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=function(e){f(t,e);function t(n,r){if(_(this,t),/^[\x00-\x7F\xC8-\xD3]+$/.test(n))var i=c(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,(0,l.default)(n),r));else var i=c(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,n,r));return c(i)}return t}(h.default);return W.default=a,W}var K={},$e;function Ht(){if($e)return K;$e=1,Object.defineProperty(K,"__esModule",{value:!0});var s=function(){function e(t,n){for(var r=0;ru.width*10?u.width*10:u.fontSize,o.guardHeight=u.height+o.fontSize/2+u.textMargin,o}return s(r,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(u,o){return this.text.substr(u,o)}},{key:"leftEncode",value:function(u,o){return(0,l.default)(u,o)}},{key:"rightText",value:function(u,o){return this.text.substr(u,o)}},{key:"rightEncode",value:function(u,o){return(0,l.default)(u,o)}},{key:"encodeGuarded",value:function(){var u={fontSize:this.fontSize},o={height:this.guardHeight};return[{data:h.SIDE_BIN,options:o},{data:this.leftEncode(),text:this.leftText(),options:u},{data:h.MIDDLE_BIN,options:o},{data:this.rightEncode(),text:this.rightText(),options:u},{data:h.SIDE_BIN,options:o}]}},{key:"encodeFlat",value:function(){var u=[h.SIDE_BIN,this.leftEncode(),h.MIDDLE_BIN,this.rightEncode(),h.SIDE_BIN];return{data:u.join(""),text:this.text}}}]),r}(_.default);return ne.default=t,ne}var Je;function Vt(){if(Je)return re;Je=1,Object.defineProperty(re,"__esModule",{value:!0});var s=function(){function n(r,i){for(var u=0;uu.width*10?o.fontSize=u.width*10:o.fontSize=u.fontSize,o.guardHeight=u.height+o.fontSize/2+u.textMargin,o}return s(r,[{key:"valid",value:function(){return this.data.search(/^[0-9]{12}$/)!==-1&&this.data[11]==t(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var u="";return u+="101",u+=(0,v.default)(this.data.substr(0,6),"LLLLLL"),u+="01010",u+=(0,v.default)(this.data.substr(6,6),"RRRRRR"),u+="101",{data:u,text:this.text}}},{key:"guardedEncoding",value:function(){var u=[];return this.displayValue&&u.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),u.push({data:"101"+(0,v.default)(this.data[0],"L"),options:{height:this.guardHeight}}),u.push({data:(0,v.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),u.push({data:"01010",options:{height:this.guardHeight}}),u.push({data:(0,v.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),u.push({data:(0,v.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&u.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),u}}]),r}(d.default);function t(n){var r=0,i;for(i=1;i<11;i+=2)r+=parseInt(n[i]);for(i=0;i<11;i+=2)r+=parseInt(n[i])*3;return(10-r%10)%10}return C.default=e,C}var fe={},Ke;function Yt(){if(Ke)return fe;Ke=1,Object.defineProperty(fe,"__esModule",{value:!0});var s=function(){function u(o,y){for(var p=0;pp.width*10?g.fontSize=p.width*10:g.fontSize=p.fontSize,g.guardHeight=p.height+g.fontSize/2+p.textMargin,g}return s(o,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var p="";return p+="101",p+=this.encodeMiddleDigits(),p+="010101",{data:p,text:this.text}}},{key:"guardedEncoding",value:function(){var p=[];return this.displayValue&&p.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),p.push({data:"101",options:{height:this.guardHeight}}),p.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),p.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&p.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),p}},{key:"encodeMiddleDigits",value:function(){var p=this.upcA[0],g=this.upcA[this.upcA.length-1],m=n[parseInt(g)][parseInt(p)];return(0,v.default)(this.middleDigits,m)}}]),o}(d.default);function i(u,o){for(var y=parseInt(u[u.length-1]),p=t[y],g="",m=0,q=0;q=3&&this.number<=131070}}]),e}(v.default);return G.pharmacode=f,G}var $={},vt;function fr(){if(vt)return $;vt=1,Object.defineProperty($,"__esModule",{value:!0}),$.codabar=void 0;var s=function(){function a(e,t){for(var n=0;n0?t.fontSize+t.textMargin:0)+t.marginTop+t.marginBottom}function d(e,t,n){if(n.displayValue&&tt&&(t=e[n].height);return t}function a(e,t,n){var r;if(n)r=n;else if(typeof document<"u")r=document.createElement("canvas").getContext("2d");else return 0;r.font=t.fontOptions+" "+t.fontSize+"px "+t.font;var i=r.measureText(e);if(!i)return 0;var u=i.width;return u}return P.getMaximumHeightOfEncodings=f,P.getEncodingHeight=l,P.getBarcodePadding=d,P.calculateEncodingAttributes=_,P.getTotalWidthOfEncodings=c,P}var mt;function _r(){if(mt)return Se;mt=1,Object.defineProperty(Se,"__esModule",{value:!0});var s=function(){function f(a,e){for(var t=0;t0?(i=0,n.textAlign="left"):e.textAlign=="right"?(i=t.width-1,n.textAlign="right"):(i=t.width/2,n.textAlign="center"),n.fillText(t.text,i,u)}}},{key:"moveCanvasDrawing",value:function(e){var t=this.canvas.getContext("2d");t.translate(e.width,0)}},{key:"restoreCanvas",value:function(){var e=this.canvas.getContext("2d");e.restore()}}]),f}();return Se.default=c,Se}var Re={},St;function sr(){if(St)return Re;St=1,Object.defineProperty(Re,"__esModule",{value:!0});var s=function(){function a(e,t){for(var n=0;n0&&(this.drawRect(y-n.width*o,u,n.width*o,n.height,t),o=0);o>0&&this.drawRect(y-n.width*(o-1),u,n.width*o,n.height,t)}},{key:"drawSVGText",value:function(t,n,r){var i=this.document.createElementNS(c,"text");if(n.displayValue){var u,o;i.setAttribute("style","font:"+n.fontOptions+" "+n.fontSize+"px "+n.font),n.textPosition=="top"?o=n.fontSize-n.textMargin:o=n.height+n.textMargin+n.fontSize,n.textAlign=="left"||r.barcodePadding>0?(u=0,i.setAttribute("text-anchor","start")):n.textAlign=="right"?(u=r.width-1,i.setAttribute("text-anchor","end")):(u=r.width/2,i.setAttribute("text-anchor","middle")),i.setAttribute("x",u),i.setAttribute("y",o),i.appendChild(this.document.createTextNode(r.text)),t.appendChild(i)}}},{key:"setSvgAttributes",value:function(t,n){var r=this.svg;r.setAttribute("width",t+"px"),r.setAttribute("height",n+"px"),r.setAttribute("x","0px"),r.setAttribute("y","0px"),r.setAttribute("viewBox","0 0 "+t+" "+n),r.setAttribute("xmlns",c),r.setAttribute("version","1.1"),r.setAttribute("style","transform: translate(0,0)")}},{key:"createGroup",value:function(t,n,r){var i=this.document.createElementNS(c,"g");return i.setAttribute("transform","translate("+t+", "+n+")"),r.appendChild(i),i}},{key:"setGroupOptions",value:function(t,n){t.setAttribute("style","fill:"+n.lineColor+";")}},{key:"drawRect",value:function(t,n,r,i,u){var o=this.document.createElementNS(c,"rect");return o.setAttribute("x",t),o.setAttribute("y",n),o.setAttribute("width",r),o.setAttribute("height",i),u.appendChild(o),o}}]),a}();return Re.default=f,Re}var xe={},Rt;function yr(){if(Rt)return xe;Rt=1,Object.defineProperty(xe,"__esModule",{value:!0});var s=function(){function l(d,_){for(var c=0;c<_.length;c++){var f=_[c];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(d,f.key,f)}}return function(d,_,c){return _&&l(d.prototype,_),c&&l(d,c),d}}();function h(l,d){if(!(l instanceof d))throw new TypeError("Cannot call a class as a function")}var v=function(){function l(d,_,c){h(this,l),this.object=d,this.encodings=_,this.options=c}return s(l,[{key:"render",value:function(){this.object.encodings=this.encodings}}]),l}();return xe.default=v,xe}var xt;function pr(){if(xt)return me;xt=1,Object.defineProperty(me,"__esModule",{value:!0});var s=_r(),h=c(s),v=sr(),l=c(v),d=yr(),_=c(d);function c(f){return f&&f.__esModule?f:{default:f}}return me.default={CanvasRenderer:h.default,SVGRenderer:l.default,ObjectRenderer:_.default},me}var j={},At;function Lt(){if(At)return j;At=1,Object.defineProperty(j,"__esModule",{value:!0});function s(c,f){if(!(c instanceof f))throw new TypeError("Cannot call a class as a function")}function h(c,f){if(!c)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:c}function v(c,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);c.prototype=Object.create(f&&f.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(c,f):c.__proto__=f)}var l=function(c){v(f,c);function f(a,e){s(this,f);var t=h(this,(f.__proto__||Object.getPrototypeOf(f)).call(this));return t.name="InvalidInputException",t.symbology=a,t.input=e,t.message='"'+t.input+'" is not a valid input for '+t.symbology,t}return f}(Error),d=function(c){v(f,c);function f(){s(this,f);var a=h(this,(f.__proto__||Object.getPrototypeOf(f)).call(this));return a.name="InvalidElementException",a.message="Not supported type to render on",a}return f}(Error),_=function(c){v(f,c);function f(){s(this,f);var a=h(this,(f.__proto__||Object.getPrototypeOf(f)).call(this));return a.name="NoElementException",a.message="No element to render on.",a}return f}(Error);return j.InvalidInputException=l,j.InvalidElementException=d,j.NoElementException=_,j}var Pt;function gr(){if(Pt)return Ee;Pt=1,Object.defineProperty(Ee,"__esModule",{value:!0});var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h=vr(),v=c(h),l=pr(),d=c(l),_=Lt();function c(t){return t&&t.__esModule?t:{default:t}}function f(t){if(typeof t=="string")return a(t);if(Array.isArray(t)){for(var n=[],r=0;r"u"?"undefined":s(t))==="object"&&!t.nodeName)return{element:t,renderer:d.default.ObjectRenderer};throw new _.InvalidElementException}}function a(t){var n=document.querySelectorAll(t);if(n.length!==0){for(var r=[],i=0;i"u")throw Error("No element to render on was provided.");return w._renderProperties=(0,e.default)(b),w._encodings=[],w._options=y.default,w._errorHandler=new i.default(w),typeof R<"u"&&(O=O||{},O.format||(O.format=qe()),w.options(O)[O.format](R,O).render()),w};m.getModule=function(E){return h.default[E]};for(var q in h.default)h.default.hasOwnProperty(q)&&V(h.default,q);function V(E,b){g.prototype[b]=g.prototype[b.toUpperCase()]=g.prototype[b.toLowerCase()]=function(R,O){var w=this;return w._errorHandler.wrapBarcodeCall(function(){O.text=typeof O.text>"u"?void 0:""+O.text;var T=(0,l.default)(w._options,O);T=(0,n.default)(T);var Ct=E[b],Nt=De(R,Ct,T);return w._encodings.push(Nt),w})}}function De(E,b,R){E=""+E;var O=new b(E,R);if(!O.valid())throw new u.InvalidInputException(O.constructor.name,E);var w=O.encode();w=(0,_.default)(w);for(var T=0;T