daShangDao_psiWebApp/dist/assets/print.2cb2e0db.js
2026-06-03 10:53:47 +08:00

4 lines
70 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var we={},te={},d={};Object.defineProperty(d,"__esModule",{value:!0});function qt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Yt=function t(e,r){qt(this,t),this.data=e,this.text=r.text||e,this.options=r};d.default=Yt;Object.defineProperty(te,"__esModule",{value:!0});te.CODE39=void 0;var Wt=function(){function t(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),Jt=d,Zt=Qt(Jt);function Qt(t){return t&&t.__esModule?t:{default:t}}function Kt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function en(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function tn(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var nn=function(t){tn(e,t);function e(r,n){return Kt(this,e),r=r.toUpperCase(),n.mod43&&(r+=on(un(r))),en(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,n))}return Wt(e,[{key:"encode",value:function(){for(var n=_e("*"),i=0;i<this.data.length;i++)n+=_e(this.data[i])+"0";return n+=_e("*"),{data:n,text:this.text}}},{key:"valid",value:function(){return this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)!==-1}}]),e}(Zt.default),mt=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","-","."," ","$","/","+","%","*"],rn=[20957,29783,23639,30485,20951,29813,23669,20855,29789,23645,29975,23831,30533,22295,30149,24005,21623,29981,23837,22301,30023,23879,30545,22343,30161,24017,21959,30065,23921,22385,29015,18263,29141,17879,29045,18293,17783,29021,18269,17477,17489,17681,20753,35770];function _e(t){return an(Ot(t))}function an(t){return rn[t].toString(2)}function on(t){return mt[t]}function Ot(t){return mt.indexOf(t)}function un(t){for(var e=0,r=0;r<t.length;r++)e+=Ot(t[r]);return e=e%43,e}te.CODE39=nn;var p={},$e={},B={},f={};Object.defineProperty(f,"__esModule",{value:!0});var j;function ve(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var bt=f.SET_A=0,wt=f.SET_B=1,$t=f.SET_C=2;f.SHIFT=98;var fn=f.START_A=103,cn=f.START_B=104,ln=f.START_C=105;f.MODULO=103;f.STOP=106;f.FNC1=207;f.SET_BY_CODE=(j={},ve(j,fn,bt),ve(j,cn,wt),ve(j,ln,$t),j);f.SWAP={101:bt,100:wt,99:$t};f.A_START_CHAR=String.fromCharCode(208);f.B_START_CHAR=String.fromCharCode(209);f.C_START_CHAR=String.fromCharCode(210);f.A_CHARS="[\0-_\xC8-\xCF]";f.B_CHARS="[ -\x7F\xC8-\xCF]";f.C_CHARS="(\xCF*[0-9]{2}\xCF*)";f.BARS=[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];Object.defineProperty(B,"__esModule",{value:!0});var dn=function(){function t(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),hn=d,_n=vn(hn),v=f;function vn(t){return t&&t.__esModule?t:{default:t}}function sn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function yn(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function gn(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var pn=function(t){gn(e,t);function e(r,n){sn(this,e);var i=yn(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r.substring(1),n));return i.bytes=r.split("").map(function(a){return a.charCodeAt(0)}),i}return dn(e,[{key:"valid",value:function(){return/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)}},{key:"encode",value:function(){var n=this.bytes,i=n.shift()-105,a=v.SET_BY_CODE[i];if(a===void 0)throw new RangeError("The encoding does not start with a start character.");this.shouldEncodeAsEan128()===!0&&n.unshift(v.FNC1);var o=e.next(n,1,a);return{text:this.text===this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:e.getBar(i)+o.result+e.getBar((o.checksum+i)%v.MODULO)+e.getBar(v.STOP)}}},{key:"shouldEncodeAsEan128",value:function(){var n=this.options.ean128||!1;return typeof n=="string"&&(n=n.toLowerCase()==="true"),n}}],[{key:"getBar",value:function(n){return v.BARS[n]?v.BARS[n].toString():""}},{key:"correctIndex",value:function(n,i){if(i===v.SET_A){var a=n.shift();return a<32?a+64:a-32}else return i===v.SET_B?n.shift()-32:(n.shift()-48)*10+n.shift()-48}},{key:"next",value:function(n,i,a){if(!n.length)return{result:"",checksum:0};var o=void 0,u=void 0;if(n[0]>=200){u=n.shift()-105;var h=v.SWAP[u];h!==void 0?o=e.next(n,i+1,h):((a===v.SET_A||a===v.SET_B)&&u===v.SHIFT&&(n[0]=a===v.SET_A?n[0]>95?n[0]-96:n[0]:n[0]<32?n[0]+96:n[0]),o=e.next(n,i+1,a))}else u=e.correctIndex(n,a),o=e.next(n,i+1,a);var l=e.getBar(u),x=u*i;return{result:l+o.result,checksum:x+o.checksum}}}]),e}(_n.default);B.default=pn;var Se={};Object.defineProperty(Se,"__esModule",{value:!0});var m=f,St=function(e){return e.match(new RegExp("^"+m.A_CHARS+"*"))[0].length},xt=function(e){return e.match(new RegExp("^"+m.B_CHARS+"*"))[0].length},At=function(e){return e.match(new RegExp("^"+m.C_CHARS+"*"))[0]};function xe(t,e){var r=e?m.A_CHARS:m.B_CHARS,n=t.match(new RegExp("^("+r+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(n)return n[1]+String.fromCharCode(204)+Tt(t.substring(n[1].length));var i=t.match(new RegExp("^"+r+"+"))[0];return i.length===t.length?t:i+String.fromCharCode(e?205:206)+xe(t.substring(i.length),!e)}function Tt(t){var e=At(t),r=e.length;if(r===t.length)return t;t=t.substring(r);var n=St(t)>=xt(t);return e+String.fromCharCode(n?206:205)+xe(t,n)}Se.default=function(t){var e=void 0,r=At(t).length;if(r>=2)e=m.C_START_CHAR+Tt(t);else{var n=St(t)>xt(t);e=(n?m.A_START_CHAR:m.B_START_CHAR)+xe(t,n)}return e.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(i,a){return String.fromCharCode(203)+a})};Object.defineProperty($e,"__esModule",{value:!0});var En=B,mn=Rt(En),On=Se,bn=Rt(On);function Rt(t){return t&&t.__esModule?t:{default:t}}function wn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function se(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function $n(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Sn=function(t){$n(e,t);function e(r,n){if(wn(this,e),/^[\x00-\x7F\xC8-\xD3]+$/.test(r))var i=se(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,(0,bn.default)(r),n));else var i=se(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,n));return se(i)}return e}(mn.default);$e.default=Sn;var Ae={};Object.defineProperty(Ae,"__esModule",{value:!0});var xn=function(){function t(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),An=B,Tn=Rn(An),it=f;function Rn(t){return t&&t.__esModule?t:{default:t}}function Pn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function In(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Mn(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Dn=function(t){Mn(e,t);function e(r,n){return Pn(this,e),In(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,it.A_START_CHAR+r,n))}return xn(e,[{key:"valid",value:function(){return new RegExp("^"+it.A_CHARS+"+$").test(this.data)}}]),e}(Tn.default);Ae.default=Dn;var Te={};Object.defineProperty(Te,"__esModule",{value:!0});var kn=function(){function t(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),Bn=B,Cn=Nn(Bn),at=f;function Nn(t){return t&&t.__esModule?t:{default:t}}function Ln(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function jn(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Fn(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Gn=function(t){Fn(e,t);function e(r,n){return Ln(this,e),jn(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,at.B_START_CHAR+r,n))}return kn(e,[{key:"valid",value:function(){return new RegExp("^"+at.B_CHARS+"+$").test(this.data)}}]),e}(Cn.default);Te.default=Gn;var Re={};Object.defineProperty(Re,"__esModule",{value:!0});var zn=function(){function t(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),Hn=B,Xn=Un(Hn),ot=f;function Un(t){return t&&t.__esModule?t:{default:t}}function Vn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function qn(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Yn(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Wn=function(t){Yn(e,t);function e(r,n){return Vn(this,e),qn(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,ot.C_START_CHAR+r,n))}return zn(e,[{key:"valid",value:function(){return new RegExp("^"+ot.C_CHARS+"+$").test(this.data)}}]),e}(Xn.default);Re.default=Wn;Object.defineProperty(p,"__esModule",{value:!0});p.CODE128C=p.CODE128B=p.CODE128A=p.CODE128=void 0;var Jn=$e,Zn=ne(Jn),Qn=Ae,Kn=ne(Qn),er=Te,tr=ne(er),nr=Re,rr=ne(nr);function ne(t){return t&&t.__esModule?t:{default:t}}p.CODE128=Zn.default;p.CODE128A=Kn.default;p.CODE128B=tr.default;p.CODE128C=rr.default;var _={},Pe={},g={};Object.defineProperty(g,"__esModule",{value:!0});g.SIDE_BIN="101";g.MIDDLE_BIN="01010";g.BINARIES={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"]};g.EAN2_STRUCTURE=["LL","LG","GL","GG"];g.EAN5_STRUCTURE=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"];g.EAN13_STRUCTURE=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"];var re={},w={};Object.defineProperty(w,"__esModule",{value:!0});var ir=g,ar=function(e,r,n){var i=e.split("").map(function(o,u){return ir.BINARIES[r[u]]}).map(function(o,u){return o?o[e[u]]:""});if(n){var a=e.length-1;i=i.map(function(o,u){return u<a?o+n:o})}return i.join("")};w.default=ar;Object.defineProperty(re,"__esModule",{value:!0});var or=function(){function t(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),P=g,ur=w,ut=Pt(ur),fr=d,cr=Pt(fr);function Pt(t){return t&&t.__esModule?t:{default:t}}function lr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function dr(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function hr(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var _r=function(t){hr(e,t);function e(r,n){lr(this,e);var i=dr(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,n));return i.fontSize=!n.flat&&n.fontSize>n.width*10?n.width*10:n.fontSize,i.guardHeight=n.height+i.fontSize/2+n.textMargin,i}return or(e,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(n,i){return this.text.substr(n,i)}},{key:"leftEncode",value:function(n,i){return(0,ut.default)(n,i)}},{key:"rightText",value:function(n,i){return this.text.substr(n,i)}},{key:"rightEncode",value:function(n,i){return(0,ut.default)(n,i)}},{key:"encodeGuarded",value:function(){var n={fontSize:this.fontSize},i={height:this.guardHeight};return[{data:P.SIDE_BIN,options:i},{data:this.leftEncode(),text:this.leftText(),options:n},{data:P.MIDDLE_BIN,options:i},{data:this.rightEncode(),text:this.rightText(),options:n},{data:P.SIDE_BIN,options:i}]}},{key:"encodeFlat",value:function(){var n=[P.SIDE_BIN,this.leftEncode(),P.MIDDLE_BIN,this.rightEncode(),P.SIDE_BIN];return{data:n.join(""),text:this.text}}}]),e}(cr.default);re.default=_r;Object.defineProperty(Pe,"__esModule",{value:!0});var vr=function(){function t(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),F=function t(e,r,n){e===null&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,r);if(i===void 0){var a=Object.getPrototypeOf(e);return a===null?void 0:t(a,r,n)}else{if("value"in i)return i.value;var o=i.get;return o===void 0?void 0:o.call(n)}},sr=g,yr=re,gr=pr(yr);function pr(t){return t&&t.__esModule?t:{default:t}}function Er(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function mr(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Or(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var ft=function(e){var r=e.substr(0,12).split("").map(function(n){return+n}).reduce(function(n,i,a){return a%2?n+i*3:n+i},0);return(10-r%10)%10},br=function(t){Or(e,t);function e(r,n){Er(this,e),r.search(/^[0-9]{12}$/)!==-1&&(r+=ft(r));var i=mr(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,n));return i.lastChar=n.lastChar,i}return vr(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{13}$/)!==-1&&+this.data[12]===ft(this.data)}},{key:"leftText",value:function(){return F(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftText",this).call(this,1,6)}},{key:"leftEncode",value:function(){var n=this.data.substr(1,6),i=sr.EAN13_STRUCTURE[this.data[0]];return F(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftEncode",this).call(this,n,i)}},{key:"rightText",value:function(){return F(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightText",this).call(this,7,6)}},{key:"rightEncode",value:function(){var n=this.data.substr(7,6);return F(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightEncode",this).call(this,n,"RRRRRR")}},{key:"encodeGuarded",value:function(){var n=F(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"encodeGuarded",this).call(this);return this.options.displayValue&&(n.unshift({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),this.options.lastChar&&(n.push({data:"00"}),n.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}}))),n}}]),e}(gr.default);Pe.default=br;var Ie={};Object.defineProperty(Ie,"__esModule",{value:!0});var wr=function(){function t(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),W=function t(e,r,n){e===null&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,r);if(i===void 0){var a=Object.getPrototypeOf(e);return a===null?void 0:t(a,r,n)}else{if("value"in i)return i.value;var o=i.get;return o===void 0?void 0:o.call(n)}},$r=re,Sr=xr($r);function xr(t){return t&&t.__esModule?t:{default:t}}function Ar(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Tr(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Rr(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var ct=function(e){var r=e.substr(0,7).split("").map(function(n){return+n}).reduce(function(n,i,a){return a%2?n+i:n+i*3},0);return(10-r%10)%10},Pr=function(t){Rr(e,t);function e(r,n){return Ar(this,e),r.search(/^[0-9]{7}$/)!==-1&&(r+=ct(r)),Tr(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,n))}return wr(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{8}$/)!==-1&&+this.data[7]===ct(this.data)}},{key:"leftText",value:function(){return W(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftText",this).call(this,0,4)}},{key:"leftEncode",value:function(){var n=this.data.substr(0,4);return W(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftEncode",this).call(this,n,"LLLL")}},{key:"rightText",value:function(){return W(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightText",this).call(this,4,4)}},{key:"rightEncode",value:function(){var n=this.data.substr(4,4);return W(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightEncode",this).call(this,n,"RRRR")}}]),e}(Sr.default);Ie.default=Pr;var Me={};Object.defineProperty(Me,"__esModule",{value:!0});var Ir=function(){function t(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),Mr=g,Dr=w,kr=It(Dr),Br=d,Cr=It(Br);function It(t){return t&&t.__esModule?t:{default:t}}function Nr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Lr(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function jr(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Fr=function(e){var r=e.split("").map(function(n){return+n}).reduce(function(n,i,a){return a%2?n+i*9:n+i*3},0);return r%10},Gr=function(t){jr(e,t);function e(r,n){return Nr(this,e),Lr(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,n))}return Ir(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{5}$/)!==-1}},{key:"encode",value:function(){var n=Mr.EAN5_STRUCTURE[Fr(this.data)];return{data:"1011"+(0,kr.default)(this.data,n,"01"),text:this.text}}}]),e}(Cr.default);Me.default=Gr;var De={};Object.defineProperty(De,"__esModule",{value:!0});var zr=function(){function t(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),Hr=g,Xr=w,Ur=Mt(Xr),Vr=d,qr=Mt(Vr);function Mt(t){return t&&t.__esModule?t:{default:t}}function Yr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Wr(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Jr(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Zr=function(t){Jr(e,t);function e(r,n){return Yr(this,e),Wr(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,n))}return zr(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{2}$/)!==-1}},{key:"encode",value:function(){var n=Hr.EAN2_STRUCTURE[parseInt(this.data)%4];return{data:"1011"+(0,Ur.default)(this.data,n,"01"),text:this.text}}}]),e}(qr.default);De.default=Zr;var X={};Object.defineProperty(X,"__esModule",{value:!0});var Qr=function(){function t(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();X.checksum=me;var Kr=w,I=Dt(Kr),ei=d,ti=Dt(ei);function Dt(t){return t&&t.__esModule?t:{default:t}}function ni(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ri(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function ii(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var ai=function(t){ii(e,t);function e(r,n){ni(this,e),r.search(/^[0-9]{11}$/)!==-1&&(r+=me(r));var i=ri(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,n));return i.displayValue=n.displayValue,n.fontSize>n.width*10?i.fontSize=n.width*10:i.fontSize=n.fontSize,i.guardHeight=n.height+i.fontSize/2+n.textMargin,i}return Qr(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{12}$/)!==-1&&this.data[11]==me(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var n="";return n+="101",n+=(0,I.default)(this.data.substr(0,6),"LLLLLL"),n+="01010",n+=(0,I.default)(this.data.substr(6,6),"RRRRRR"),n+="101",{data:n,text:this.text}}},{key:"guardedEncoding",value:function(){var n=[];return this.displayValue&&n.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),n.push({data:"101"+(0,I.default)(this.data[0],"L"),options:{height:this.guardHeight}}),n.push({data:(0,I.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),n.push({data:"01010",options:{height:this.guardHeight}}),n.push({data:(0,I.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),n.push({data:(0,I.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&n.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),n}}]),e}(ti.default);function me(t){var e=0,r;for(r=1;r<11;r+=2)e+=parseInt(t[r]);for(r=0;r<11;r+=2)e+=parseInt(t[r])*3;return(10-e%10)%10}X.default=ai;var ke={};Object.defineProperty(ke,"__esModule",{value:!0});var oi=function(){function t(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),ui=w,fi=kt(ui),ci=d,li=kt(ci),di=X;function kt(t){return t&&t.__esModule?t:{default:t}}function hi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ye(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function _i(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var vi=["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"],si=[["EEEOOO","OOOEEE"],["EEOEOO","OOEOEE"],["EEOOEO","OOEEOE"],["EEOOOE","OOEEEO"],["EOEEOO","OEOOEE"],["EOOEEO","OEEOOE"],["EOOOEE","OEEEOO"],["EOEOEO","OEOEOE"],["EOEOOE","OEOEEO"],["EOOEOE","OEEOEO"]],yi=function(t){_i(e,t);function e(r,n){hi(this,e);var i=ye(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,n));if(i.isValid=!1,r.search(/^[0-9]{6}$/)!==-1)i.middleDigits=r,i.upcA=lt(r,"0"),i.text=n.text||""+i.upcA[0]+r+i.upcA[i.upcA.length-1],i.isValid=!0;else if(r.search(/^[01][0-9]{7}$/)!==-1)if(i.middleDigits=r.substring(1,r.length-1),i.upcA=lt(i.middleDigits,r[0]),i.upcA[i.upcA.length-1]===r[r.length-1])i.isValid=!0;else return ye(i);else return ye(i);return i.displayValue=n.displayValue,n.fontSize>n.width*10?i.fontSize=n.width*10:i.fontSize=n.fontSize,i.guardHeight=n.height+i.fontSize/2+n.textMargin,i}return oi(e,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var n="";return n+="101",n+=this.encodeMiddleDigits(),n+="010101",{data:n,text:this.text}}},{key:"guardedEncoding",value:function(){var n=[];return this.displayValue&&n.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),n.push({data:"101",options:{height:this.guardHeight}}),n.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),n.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&n.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),n}},{key:"encodeMiddleDigits",value:function(){var n=this.upcA[0],i=this.upcA[this.upcA.length-1],a=si[parseInt(i)][parseInt(n)];return(0,fi.default)(this.middleDigits,a)}}]),e}(li.default);function lt(t,e){for(var r=parseInt(t[t.length-1]),n=vi[r],i="",a=0,o=0;o<n.length;o++){var u=n[o];u==="X"?i+=t[a++]:i+=u}return i=""+e+i,""+i+(0,di.checksum)(i)}ke.default=yi;Object.defineProperty(_,"__esModule",{value:!0});_.UPCE=_.UPC=_.EAN2=_.EAN5=_.EAN8=_.EAN13=void 0;var gi=Pe,pi=C(gi),Ei=Ie,mi=C(Ei),Oi=Me,bi=C(Oi),wi=De,$i=C(wi),Si=X,xi=C(Si),Ai=ke,Ti=C(Ai);function C(t){return t&&t.__esModule?t:{default:t}}_.EAN13=pi.default;_.EAN8=mi.default;_.EAN5=bi.default;_.EAN2=$i.default;_.UPC=xi.default;_.UPCE=Ti.default;var D={},ie={},U={};Object.defineProperty(U,"__esModule",{value:!0});U.START_BIN="1010";U.END_BIN="11101";U.BINARIES=["00110","10001","01001","11000","00101","10100","01100","00011","10010","01010"];Object.defineProperty(ie,"__esModule",{value:!0});var Ri=function(){function t(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),J=U,Pi=d,Ii=Mi(Pi);function Mi(t){return t&&t.__esModule?t:{default:t}}function Di(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ki(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Bi(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Ci=function(t){Bi(e,t);function e(){return Di(this,e),ki(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return Ri(e,[{key:"valid",value:function(){return this.data.search(/^([0-9]{2})+$/)!==-1}},{key:"encode",value:function(){var n=this,i=this.data.match(/.{2}/g).map(function(a){return n.encodePair(a)}).join("");return{data:J.START_BIN+i+J.END_BIN,text:this.text}}},{key:"encodePair",value:function(n){var i=J.BINARIES[n[1]];return J.BINARIES[n[0]].split("").map(function(a,o){return(a==="1"?"111":"1")+(i[o]==="1"?"000":"0")}).join("")}}]),e}(Ii.default);ie.default=Ci;var Be={};Object.defineProperty(Be,"__esModule",{value:!0});var Ni=function(){function t(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),Li=ie,ji=Fi(Li);function Fi(t){return t&&t.__esModule?t:{default:t}}function Gi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function zi(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Hi(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var dt=function(e){var r=e.substr(0,13).split("").map(function(n){return parseInt(n,10)}).reduce(function(n,i,a){return n+i*(3-a%2*2)},0);return Math.ceil(r/10)*10-r},Xi=function(t){Hi(e,t);function e(r,n){return Gi(this,e),r.search(/^[0-9]{13}$/)!==-1&&(r+=dt(r)),zi(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,n))}return Ni(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{14}$/)!==-1&&+this.data[13]===dt(this.data)}}]),e}(ji.default);Be.default=Xi;Object.defineProperty(D,"__esModule",{value:!0});D.ITF14=D.ITF=void 0;var Ui=ie,Vi=Bt(Ui),qi=Be,Yi=Bt(qi);function Bt(t){return t&&t.__esModule?t:{default:t}}D.ITF=Vi.default;D.ITF14=Yi.default;var y={},$={};Object.defineProperty($,"__esModule",{value:!0});var Wi=function(){function t(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),Ji=d,Zi=Qi(Ji);function Qi(t){return t&&t.__esModule?t:{default:t}}function Ki(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ea(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function ta(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var na=function(t){ta(e,t);function e(r,n){return Ki(this,e),ea(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,n))}return Wi(e,[{key:"encode",value:function(){for(var n="110",i=0;i<this.data.length;i++){var a=parseInt(this.data[i]),o=a.toString(2);o=ra(o,4-o.length);for(var u=0;u<o.length;u++)n+=o[u]=="0"?"100":"110"}return n+="1001",{data:n,text:this.text}}},{key:"valid",value:function(){return this.data.search(/^[0-9]+$/)!==-1}}]),e}(Zi.default);function ra(t,e){for(var r=0;r<e;r++)t="0"+t;return t}$.default=na;var Ce={},S={};Object.defineProperty(S,"__esModule",{value:!0});S.mod10=ia;S.mod11=aa;function ia(t){for(var e=0,r=0;r<t.length;r++){var n=parseInt(t[r]);(r+t.length)%2===0?e+=n:e+=n*2%10+Math.floor(n*2/10)}return(10-e%10)%10}function aa(t){for(var e=0,r=[2,3,4,5,6,7],n=0;n<t.length;n++){var i=parseInt(t[t.length-1-n]);e+=r[n%r.length]*i}return(11-e%11)%11}Object.defineProperty(Ce,"__esModule",{value:!0});var oa=$,ua=ca(oa),fa=S;function ca(t){return t&&t.__esModule?t:{default:t}}function la(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function da(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function ha(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var _a=function(t){ha(e,t);function e(r,n){return la(this,e),da(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r+(0,fa.mod10)(r),n))}return e}(ua.default);Ce.default=_a;var Ne={};Object.defineProperty(Ne,"__esModule",{value:!0});var va=$,sa=ga(va),ya=S;function ga(t){return t&&t.__esModule?t:{default:t}}function pa(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ea(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function ma(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Oa=function(t){ma(e,t);function e(r,n){return pa(this,e),Ea(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r+(0,ya.mod11)(r),n))}return e}(sa.default);Ne.default=Oa;var Le={};Object.defineProperty(Le,"__esModule",{value:!0});var ba=$,wa=$a(ba),ht=S;function $a(t){return t&&t.__esModule?t:{default:t}}function Sa(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function xa(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Aa(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Ta=function(t){Aa(e,t);function e(r,n){return Sa(this,e),r+=(0,ht.mod10)(r),r+=(0,ht.mod10)(r),xa(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,n))}return e}(wa.default);Le.default=Ta;var je={};Object.defineProperty(je,"__esModule",{value:!0});var Ra=$,Pa=Ia(Ra),_t=S;function Ia(t){return t&&t.__esModule?t:{default:t}}function Ma(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Da(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function ka(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Ba=function(t){ka(e,t);function e(r,n){return Ma(this,e),r+=(0,_t.mod11)(r),r+=(0,_t.mod10)(r),Da(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,n))}return e}(Pa.default);je.default=Ba;Object.defineProperty(y,"__esModule",{value:!0});y.MSI1110=y.MSI1010=y.MSI11=y.MSI10=y.MSI=void 0;var Ca=$,Na=V(Ca),La=Ce,ja=V(La),Fa=Ne,Ga=V(Fa),za=Le,Ha=V(za),Xa=je,Ua=V(Xa);function V(t){return t&&t.__esModule?t:{default:t}}y.MSI=Na.default;y.MSI10=ja.default;y.MSI11=Ga.default;y.MSI1010=Ha.default;y.MSI1110=Ua.default;var ae={};Object.defineProperty(ae,"__esModule",{value:!0});ae.pharmacode=void 0;var Va=function(){function t(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),qa=d,Ya=Wa(qa);function Wa(t){return t&&t.__esModule?t:{default:t}}function Ja(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Za(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Qa(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Ka=function(t){Qa(e,t);function e(r,n){Ja(this,e);var i=Za(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,n));return i.number=parseInt(r,10),i}return Va(e,[{key:"encode",value:function(){for(var n=this.number,i="";!isNaN(n)&&n!=0;)n%2===0?(i="11100"+i,n=(n-2)/2):(i="100"+i,n=(n-1)/2);return i=i.slice(0,-2),{data:i,text:this.text}}},{key:"valid",value:function(){return this.number>=3&&this.number<=131070}}]),e}(Ya.default);ae.pharmacode=Ka;var oe={};Object.defineProperty(oe,"__esModule",{value:!0});oe.codabar=void 0;var eo=function(){function t(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),to=d,no=ro(to);function ro(t){return t&&t.__esModule?t:{default:t}}function io(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ao(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function oo(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var uo=function(t){oo(e,t);function e(r,n){io(this,e),r.search(/^[0-9\-\$\:\.\+\/]+$/)===0&&(r="A"+r+"A");var i=ao(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r.toUpperCase(),n));return i.text=i.options.text||i.text.replace(/[A-D]/g,""),i}return eo(e,[{key:"valid",value:function(){return this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)!==-1}},{key:"encode",value:function(){for(var n=[],i=this.getEncodings(),a=0;a<this.data.length;a++)n.push(i[this.data.charAt(a)]),a!==this.data.length-1&&n.push("0");return{text:this.text,data:n.join("")}}},{key:"getEncodings",value: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","+":"1011011011",A:"1011001001",B:"1001001011",C:"1010010011",D:"1010011001"}}}]),e}(no.default);oe.codabar=uo;var k={},ue={},q={};Object.defineProperty(q,"__esModule",{value:!0});q.SYMBOLS=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","-","."," ","$","/","+","%","($)","(%)","(/)","(+)","\xFF"];q.BINARIES=["100010100","101001000","101000100","101000010","100101000","100100100","100100010","101010000","100010010","100001010","110101000","110100100","110100010","110010100","110010010","110001010","101101000","101100100","101100010","100110100","100011010","101011000","101001100","101000110","100101100","100010110","110110100","110110010","110101100","110100110","110010110","110011010","101101100","101100110","100110110","100111010","100101110","111010100","111010010","111001010","101101110","101110110","110101110","100100110","111011010","111010110","100110010","101011110"];q.MULTI_SYMBOLS={"\0":["(%)","U"],"":["($)","A"],"":["($)","B"],"":["($)","C"],"":["($)","D"],"":["($)","E"],"":["($)","F"],"\x07":["($)","G"],"\b":["($)","H"]," ":["($)","I"],"\n":["($)","J"],"\v":["($)","K"],"\f":["($)","L"],"\r":["($)","M"],"":["($)","N"],"":["($)","O"],"":["($)","P"],"":["($)","Q"],"":["($)","R"],"":["($)","S"],"":["($)","T"],"":["($)","U"],"":["($)","V"],"":["($)","W"],"":["($)","X"],"":["($)","Y"],"":["($)","Z"],"\x1B":["(%)","A"],"":["(%)","B"],"":["(%)","C"],"":["(%)","D"],"":["(%)","E"],"!":["(/)","A"],'"':["(/)","B"],"#":["(/)","C"],"&":["(/)","F"],"'":["(/)","G"],"(":["(/)","H"],")":["(/)","I"],"*":["(/)","J"],",":["(/)","L"],":":["(/)","Z"],";":["(%)","F"],"<":["(%)","G"],"=":["(%)","H"],">":["(%)","I"],"?":["(%)","J"],"@":["(%)","V"],"[":["(%)","K"],"\\":["(%)","L"],"]":["(%)","M"],"^":["(%)","N"],_:["(%)","O"],"`":["(%)","W"],a:["(+)","A"],b:["(+)","B"],c:["(+)","C"],d:["(+)","D"],e:["(+)","E"],f:["(+)","F"],g:["(+)","G"],h:["(+)","H"],i:["(+)","I"],j:["(+)","J"],k:["(+)","K"],l:["(+)","L"],m:["(+)","M"],n:["(+)","N"],o:["(+)","O"],p:["(+)","P"],q:["(+)","Q"],r:["(+)","R"],s:["(+)","S"],t:["(+)","T"],u:["(+)","U"],v:["(+)","V"],w:["(+)","W"],x:["(+)","X"],y:["(+)","Y"],z:["(+)","Z"],"{":["(%)","P"],"|":["(%)","Q"],"}":["(%)","R"],"~":["(%)","S"],"\x7F":["(%)","T"]};Object.defineProperty(ue,"__esModule",{value:!0});var fo=function(){function t(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),Z=q,co=d,lo=ho(co);function ho(t){return t&&t.__esModule?t:{default:t}}function _o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function vo(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function so(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var yo=function(t){so(e,t);function e(r,n){return _o(this,e),vo(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,n))}return fo(e,[{key:"valid",value:function(){return/^[0-9A-Z\-. $/+%]+$/.test(this.data)}},{key:"encode",value:function(){var n=this.data.split("").flatMap(function(u){return Z.MULTI_SYMBOLS[u]||u}),i=n.map(function(u){return e.getEncoding(u)}).join(""),a=e.checksum(n,20),o=e.checksum(n.concat(a),15);return{text:this.text,data:e.getEncoding("\xFF")+i+e.getEncoding(a)+e.getEncoding(o)+e.getEncoding("\xFF")+"1"}}}],[{key:"getEncoding",value:function(n){return Z.BINARIES[e.symbolValue(n)]}},{key:"getSymbol",value:function(n){return Z.SYMBOLS[n]}},{key:"symbolValue",value:function(n){return Z.SYMBOLS.indexOf(n)}},{key:"checksum",value:function(n,i){var a=n.slice().reverse().reduce(function(o,u,h){var l=h%i+1;return o+e.symbolValue(u)*l},0);return e.getSymbol(a%47)}}]),e}(lo.default);ue.default=yo;var Fe={};Object.defineProperty(Fe,"__esModule",{value:!0});var go=function(){function t(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),po=ue,Eo=mo(po);function mo(t){return t&&t.__esModule?t:{default:t}}function Oo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function bo(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function wo(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var $o=function(t){wo(e,t);function e(r,n){return Oo(this,e),bo(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,n))}return go(e,[{key:"valid",value:function(){return/^[\x00-\x7f]+$/.test(this.data)}}]),e}(Eo.default);Fe.default=$o;Object.defineProperty(k,"__esModule",{value:!0});k.CODE93FullASCII=k.CODE93=void 0;var So=ue,xo=Ct(So),Ao=Fe,To=Ct(Ao);function Ct(t){return t&&t.__esModule?t:{default:t}}k.CODE93=xo.default;k.CODE93FullASCII=To.default;var fe={};Object.defineProperty(fe,"__esModule",{value:!0});fe.GenericBarcode=void 0;var Ro=function(){function t(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),Po=d,Io=Mo(Po);function Mo(t){return t&&t.__esModule?t:{default:t}}function Do(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ko(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Bo(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Co=function(t){Bo(e,t);function e(r,n){return Do(this,e),ko(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,n))}return Ro(e,[{key:"encode",value:function(){return{data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return!0}}]),e}(Io.default);fe.GenericBarcode=Co;Object.defineProperty(we,"__esModule",{value:!0});var No=te,Q=p,M=_,vt=D,G=y,Lo=ae,jo=oe,st=k,Fo=fe;we.default={CODE39:No.CODE39,CODE128:Q.CODE128,CODE128A:Q.CODE128A,CODE128B:Q.CODE128B,CODE128C:Q.CODE128C,EAN13:M.EAN13,EAN8:M.EAN8,EAN5:M.EAN5,EAN2:M.EAN2,UPC:M.UPC,UPCE:M.UPCE,ITF14:vt.ITF14,ITF:vt.ITF,MSI:G.MSI,MSI10:G.MSI10,MSI11:G.MSI11,MSI1010:G.MSI1010,MSI1110:G.MSI1110,pharmacode:Lo.pharmacode,codabar:jo.codabar,CODE93:st.CODE93,CODE93FullASCII:st.CODE93FullASCII,GenericBarcode:Fo.GenericBarcode};var N={};Object.defineProperty(N,"__esModule",{value:!0});var Go=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t};N.default=function(t,e){return Go({},t,e)};var Ge={};Object.defineProperty(Ge,"__esModule",{value:!0});Ge.default=zo;function zo(t){var e=[];function r(n){if(Array.isArray(n))for(var i=0;i<n.length;i++)r(n[i]);else n.text=n.text||"",n.data=n.data||"",e.push(n)}return r(t),e}var ze={};Object.defineProperty(ze,"__esModule",{value:!0});ze.default=Ho;function Ho(t){return t.marginTop=t.marginTop||t.margin,t.marginBottom=t.marginBottom||t.margin,t.marginRight=t.marginRight||t.margin,t.marginLeft=t.marginLeft||t.margin,t}var He={},Xe={},ce={};Object.defineProperty(ce,"__esModule",{value:!0});ce.default=Xo;function Xo(t){var e=["width","height","textMargin","fontSize","margin","marginTop","marginBottom","marginLeft","marginRight"];for(var r in e)e.hasOwnProperty(r)&&(r=e[r],typeof t[r]=="string"&&(t[r]=parseInt(t[r],10)));return typeof t.displayValue=="string"&&(t.displayValue=t.displayValue!="false"),t}var le={};Object.defineProperty(le,"__esModule",{value:!0});var Uo={width:2,height:100,format:"auto",displayValue:!0,fontOptions:"",font:"monospace",text:void 0,textAlign:"center",textPosition:"bottom",textMargin:2,fontSize:20,background:"#ffffff",lineColor:"#000000",margin:10,marginTop:void 0,marginBottom:void 0,marginLeft:void 0,marginRight:void 0,valid:function(){}};le.default=Uo;Object.defineProperty(Xe,"__esModule",{value:!0});var Vo=ce,qo=Nt(Vo),Yo=le,yt=Nt(Yo);function Nt(t){return t&&t.__esModule?t:{default:t}}function Wo(t){var e={};for(var r in yt.default)yt.default.hasOwnProperty(r)&&(t.hasAttribute("jsbarcode-"+r.toLowerCase())&&(e[r]=t.getAttribute("jsbarcode-"+r.toLowerCase())),t.hasAttribute("data-"+r.toLowerCase())&&(e[r]=t.getAttribute("data-"+r.toLowerCase())));return e.value=t.getAttribute("jsbarcode-value")||t.getAttribute("data-value"),e=(0,qo.default)(e),e}Xe.default=Wo;var Ue={},Ve={},s={};Object.defineProperty(s,"__esModule",{value:!0});s.getTotalWidthOfEncodings=s.calculateEncodingAttributes=s.getBarcodePadding=s.getEncodingHeight=s.getMaximumHeightOfEncodings=void 0;var Jo=N,Zo=Qo(Jo);function Qo(t){return t&&t.__esModule?t:{default:t}}function Lt(t,e){return e.height+(e.displayValue&&t.text.length>0?e.fontSize+e.textMargin:0)+e.marginTop+e.marginBottom}function jt(t,e,r){if(r.displayValue&&e<t){if(r.textAlign=="center")return Math.floor((t-e)/2);if(r.textAlign=="left")return 0;if(r.textAlign=="right")return Math.floor(t-e)}return 0}function Ko(t,e,r){for(var n=0;n<t.length;n++){var i=t[n],a=(0,Zo.default)(e,i.options),o;a.displayValue?o=nu(i.text,a,r):o=0;var u=i.data.length*a.width;i.width=Math.ceil(Math.max(o,u)),i.height=Lt(i,a),i.barcodePadding=jt(o,u,a)}}function eu(t){for(var e=0,r=0;r<t.length;r++)e+=t[r].width;return e}function tu(t){for(var e=0,r=0;r<t.length;r++)t[r].height>e&&(e=t[r].height);return e}function nu(t,e,r){var n;if(r)n=r;else if(typeof document!="undefined")n=document.createElement("canvas").getContext("2d");else return 0;n.font=e.fontOptions+" "+e.fontSize+"px "+e.font;var i=n.measureText(t);if(!i)return 0;var a=i.width;return a}s.getMaximumHeightOfEncodings=tu;s.getEncodingHeight=Lt;s.getBarcodePadding=jt;s.calculateEncodingAttributes=Ko;s.getTotalWidthOfEncodings=eu;Object.defineProperty(Ve,"__esModule",{value:!0});var ru=function(){function t(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),iu=N,au=ou(iu),ge=s;function ou(t){return t&&t.__esModule?t:{default:t}}function uu(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var fu=function(){function t(e,r,n){uu(this,t),this.canvas=e,this.encodings=r,this.options=n}return ru(t,[{key:"render",value:function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var r=0;r<this.encodings.length;r++){var n=(0,au.default)(this.options,this.encodings[r].options);this.drawCanvasBarcode(n,this.encodings[r]),this.drawCanvasText(n,this.encodings[r]),this.moveCanvasDrawing(this.encodings[r])}this.restoreCanvas()}},{key:"prepareCanvas",value:function(){var r=this.canvas.getContext("2d");r.save(),(0,ge.calculateEncodingAttributes)(this.encodings,this.options,r);var n=(0,ge.getTotalWidthOfEncodings)(this.encodings),i=(0,ge.getMaximumHeightOfEncodings)(this.encodings);this.canvas.width=n+this.options.marginLeft+this.options.marginRight,this.canvas.height=i,r.clearRect(0,0,this.canvas.width,this.canvas.height),this.options.background&&(r.fillStyle=this.options.background,r.fillRect(0,0,this.canvas.width,this.canvas.height)),r.translate(this.options.marginLeft,0)}},{key:"drawCanvasBarcode",value:function(r,n){var i=this.canvas.getContext("2d"),a=n.data,o;r.textPosition=="top"?o=r.marginTop+r.fontSize+r.textMargin:o=r.marginTop,i.fillStyle=r.lineColor;for(var u=0;u<a.length;u++){var h=u*r.width+n.barcodePadding;a[u]==="1"?i.fillRect(h,o,r.width,r.height):a[u]&&i.fillRect(h,o,r.width,r.height*a[u])}}},{key:"drawCanvasText",value:function(r,n){var i=this.canvas.getContext("2d"),a=r.fontOptions+" "+r.fontSize+"px "+r.font;if(r.displayValue){var o,u;r.textPosition=="top"?u=r.marginTop+r.fontSize-r.textMargin:u=r.height+r.textMargin+r.marginTop+r.fontSize,i.font=a,r.textAlign=="left"||n.barcodePadding>0?(o=0,i.textAlign="left"):r.textAlign=="right"?(o=n.width-1,i.textAlign="right"):(o=n.width/2,i.textAlign="center"),i.fillText(n.text,o,u)}}},{key:"moveCanvasDrawing",value:function(r){var n=this.canvas.getContext("2d");n.translate(r.width,0)}},{key:"restoreCanvas",value:function(){var r=this.canvas.getContext("2d");r.restore()}}]),t}();Ve.default=fu;var qe={};Object.defineProperty(qe,"__esModule",{value:!0});var cu=function(){function t(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),lu=N,du=hu(lu),pe=s;function hu(t){return t&&t.__esModule?t:{default:t}}function _u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var K="http://www.w3.org/2000/svg",vu=function(){function t(e,r,n){_u(this,t),this.svg=e,this.encodings=r,this.options=n,this.document=n.xmlDocument||document}return cu(t,[{key:"render",value:function(){var r=this.options.marginLeft;this.prepareSVG();for(var n=0;n<this.encodings.length;n++){var i=this.encodings[n],a=(0,du.default)(this.options,i.options),o=this.createGroup(r,a.marginTop,this.svg);this.setGroupOptions(o,a),this.drawSvgBarcode(o,a,i),this.drawSVGText(o,a,i),r+=i.width}}},{key:"prepareSVG",value:function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);(0,pe.calculateEncodingAttributes)(this.encodings,this.options);var r=(0,pe.getTotalWidthOfEncodings)(this.encodings),n=(0,pe.getMaximumHeightOfEncodings)(this.encodings),i=r+this.options.marginLeft+this.options.marginRight;this.setSvgAttributes(i,n),this.options.background&&this.drawRect(0,0,i,n,this.svg).setAttribute("fill",this.options.background)}},{key:"drawSvgBarcode",value:function(r,n,i){var a=i.data,o;n.textPosition=="top"?o=n.fontSize+n.textMargin:o=0;for(var u=0,h=0,l=0;l<a.length;l++)h=l*n.width+i.barcodePadding,a[l]==="1"?u++:u>0&&(this.drawRect(h-n.width*u,o,n.width*u,n.height,r),u=0);u>0&&this.drawRect(h-n.width*(u-1),o,n.width*u,n.height,r)}},{key:"drawSVGText",value:function(r,n,i){var a=this.document.createElementNS(K,"text");if(n.displayValue){var o,u;a.setAttribute("font-family",n.font),a.setAttribute("font-size",n.fontSize),n.fontOptions.includes("bold")&&a.setAttribute("font-weight","bold"),n.fontOptions.includes("italic")&&a.setAttribute("font-style","italic"),n.textPosition=="top"?u=n.fontSize-n.textMargin:u=n.height+n.textMargin+n.fontSize,n.textAlign=="left"||i.barcodePadding>0?(o=0,a.setAttribute("text-anchor","start")):n.textAlign=="right"?(o=i.width-1,a.setAttribute("text-anchor","end")):(o=i.width/2,a.setAttribute("text-anchor","middle")),a.setAttribute("x",o),a.setAttribute("y",u),a.appendChild(this.document.createTextNode(i.text)),r.appendChild(a)}}},{key:"setSvgAttributes",value:function(r,n){var i=this.svg;i.setAttribute("width",r+"px"),i.setAttribute("height",n+"px"),i.setAttribute("x","0px"),i.setAttribute("y","0px"),i.setAttribute("viewBox","0 0 "+r+" "+n),i.setAttribute("xmlns",K),i.setAttribute("version","1.1")}},{key:"createGroup",value:function(r,n,i){var a=this.document.createElementNS(K,"g");return a.setAttribute("transform","translate("+r+", "+n+")"),i.appendChild(a),a}},{key:"setGroupOptions",value:function(r,n){r.setAttribute("fill",n.lineColor)}},{key:"drawRect",value:function(r,n,i,a,o){var u=this.document.createElementNS(K,"rect");return u.setAttribute("x",r),u.setAttribute("y",n),u.setAttribute("width",i),u.setAttribute("height",a),o.appendChild(u),u}}]),t}();qe.default=vu;var Ye={};Object.defineProperty(Ye,"__esModule",{value:!0});var su=function(){function t(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();function yu(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var gu=function(){function t(e,r,n){yu(this,t),this.object=e,this.encodings=r,this.options=n}return su(t,[{key:"render",value:function(){this.object.encodings=this.encodings}}]),t}();Ye.default=gu;Object.defineProperty(Ue,"__esModule",{value:!0});var pu=Ve,Eu=We(pu),mu=qe,Ou=We(mu),bu=Ye,wu=We(bu);function We(t){return t&&t.__esModule?t:{default:t}}Ue.default={CanvasRenderer:Eu.default,SVGRenderer:Ou.default,ObjectRenderer:wu.default};var L={};Object.defineProperty(L,"__esModule",{value:!0});function Je(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ze(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Qe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var $u=function(t){Qe(e,t);function e(r,n){Je(this,e);var i=Ze(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return i.name="InvalidInputException",i.symbology=r,i.input=n,i.message='"'+i.input+'" is not a valid input for '+i.symbology,i}return e}(Error),Su=function(t){Qe(e,t);function e(){Je(this,e);var r=Ze(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return r.name="InvalidElementException",r.message="Not supported type to render on",r}return e}(Error),xu=function(t){Qe(e,t);function e(){Je(this,e);var r=Ze(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return r.name="NoElementException",r.message="No element to render on.",r}return e}(Error);L.InvalidInputException=$u;L.InvalidElementException=Su;L.NoElementException=xu;Object.defineProperty(He,"__esModule",{value:!0});var Au=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},Tu=Xe,Oe=Ft(Tu),Ru=Ue,H=Ft(Ru),Pu=L;function Ft(t){return t&&t.__esModule?t:{default:t}}function Ke(t){if(typeof t=="string")return Iu(t);if(Array.isArray(t)){for(var e=[],r=0;r<t.length;r++)e.push(Ke(t[r]));return e}else{if(typeof HTMLCanvasElement!="undefined"&&t instanceof HTMLImageElement)return Mu(t);if(t&&t.nodeName&&t.nodeName.toLowerCase()==="svg"||typeof SVGElement!="undefined"&&t instanceof SVGElement)return{element:t,options:(0,Oe.default)(t),renderer:H.default.SVGRenderer};if(typeof HTMLCanvasElement!="undefined"&&t instanceof HTMLCanvasElement)return{element:t,options:(0,Oe.default)(t),renderer:H.default.CanvasRenderer};if(t&&t.getContext)return{element:t,renderer:H.default.CanvasRenderer};if(t&&(typeof t=="undefined"?"undefined":Au(t))==="object"&&!t.nodeName)return{element:t,renderer:H.default.ObjectRenderer};throw new Pu.InvalidElementException}}function Iu(t){var e=document.querySelectorAll(t);if(e.length!==0){for(var r=[],n=0;n<e.length;n++)r.push(Ke(e[n]));return r}}function Mu(t){var e=document.createElement("canvas");return{element:e,options:(0,Oe.default)(t),renderer:H.default.CanvasRenderer,afterRender:function(){t.setAttribute("src",e.toDataURL())}}}He.default=Ke;var et={};Object.defineProperty(et,"__esModule",{value:!0});var Du=function(){function t(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();function ku(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Bu=function(){function t(e){ku(this,t),this.api=e}return Du(t,[{key:"handleCatch",value:function(r){if(r.name==="InvalidInputException")if(this.api._options.valid!==this.api._defaults.valid)this.api._options.valid(!1);else throw r.message;else throw r;this.api.render=function(){}}},{key:"wrapBarcodeCall",value:function(r){try{var n=r.apply(void 0,arguments);return this.api._options.valid(!0),n}catch(i){return this.handleCatch(i),this.api}}}]),t}();et.default=Bu;var Cu=we,b=O(Cu),Nu=N,Y=O(Nu),Lu=Ge,Gt=O(Lu),ju=ze,gt=O(ju),Fu=He,Gu=O(Fu),zu=ce,Hu=O(zu),Xu=et,Uu=O(Xu),zt=L,Vu=le,Ht=O(Vu);function O(t){return t&&t.__esModule?t:{default:t}}var E=function(){},de=function(e,r,n){var i=new E;if(typeof e=="undefined")throw Error("No element to render on was provided.");return i._renderProperties=(0,Gu.default)(e),i._encodings=[],i._options=Ht.default,i._errorHandler=new Uu.default(i),typeof r!="undefined"&&(n=n||{},n.format||(n.format=Ut()),i.options(n)[n.format](r,n).render()),i};de.getModule=function(t){return b.default[t]};for(var pt in b.default)b.default.hasOwnProperty(pt)&&qu(b.default,pt);function qu(t,e){E.prototype[e]=E.prototype[e.toUpperCase()]=E.prototype[e.toLowerCase()]=function(r,n){var i=this;return i._errorHandler.wrapBarcodeCall(function(){n.text=typeof n.text=="undefined"?void 0:""+n.text;var a=(0,Y.default)(i._options,n);a=(0,Hu.default)(a);var o=t[e],u=Xt(r,o,a);return i._encodings.push(u),i})}}function Xt(t,e,r){t=""+t;var n=new e(t,r);if(!n.valid())throw new zt.InvalidInputException(n.constructor.name,t);var i=n.encode();i=(0,Gt.default)(i);for(var a=0;a<i.length;a++)i[a].options=(0,Y.default)(r,i[a].options);return i}function Ut(){return b.default.CODE128?"CODE128":Object.keys(b.default)[0]}E.prototype.options=function(t){return this._options=(0,Y.default)(this._options,t),this};E.prototype.blank=function(t){var e=new Array(t+1).join("0");return this._encodings.push({data:e}),this};E.prototype.init=function(){if(!!this._renderProperties){Array.isArray(this._renderProperties)||(this._renderProperties=[this._renderProperties]);var t;for(var e in this._renderProperties){t=this._renderProperties[e];var r=(0,Y.default)(this._options,t.options);r.format=="auto"&&(r.format=Ut()),this._errorHandler.wrapBarcodeCall(function(){var n=r.value,i=b.default[r.format.toUpperCase()],a=Xt(n,i,r);be(t,a,r)})}}};E.prototype.render=function(){if(!this._renderProperties)throw new zt.NoElementException;if(Array.isArray(this._renderProperties))for(var t=0;t<this._renderProperties.length;t++)be(this._renderProperties[t],this._encodings,this._options);else be(this._renderProperties,this._encodings,this._options);return this};E.prototype._defaults=Ht.default;function be(t,e,r){e=(0,Gt.default)(e);for(var n=0;n<e.length;n++)e[n].options=(0,Y.default)(r,e[n].options),(0,gt.default)(e[n].options);(0,gt.default)(r);var i=t.renderer,a=new i(t.element,e,r);a.render(),t.afterRender&&t.afterRender()}typeof window!="undefined"&&(window.JsBarcode=de);typeof jQuery!="undefined"&&(jQuery.fn.JsBarcode=function(t,e){var r=[];return jQuery(this).each(function(){r.push(this)}),de(r,t,e)});var ee=de;let z=null;function Ee(t,e,r,n){var i=document.createElement("canvas");i.width=t,i.height=e;var a=i.getContext("2d");return a.fillStyle="#ffffff",a.fillRect(0,0,i.width,i.height),a.fillStyle="#FFFFFF",a.fillText("",r,n),i.toDataURL("image/png")}function Yu(t,e=!1){const o=document.createElement("canvas"),u=document.createElement("canvas");if(ee(u,t,{format:"CODE128",fontSize:15,margin:0,displayValue:!0,lineColor:"#000000",width:1.43,height:40}),o.width=u.width*2,o.height=40*2,o.getContext("2d").scale(2,2),ee(o,t,{format:"CODE128",fontSize:15,margin:0,displayValue:!0,lineColor:"#000000",width:1.43,height:40}),!e)return o.toDataURL("image/png",1);const l=document.createElement("canvas");l.width=o.height,l.height=o.width;const x=l.getContext("2d");return x.translate(l.width/2,l.height/2),x.rotate(Math.PI/2),x.drawImage(o,-u.width/2,-40/2),l.toDataURL("image/png",1)}function Wu(t){const e=document.createElement("canvas");ee(e,t,{format:"CODE128",fontSize:"15",margin:0,displayValue:!0,lineColor:"#000000",width:1.5,height:40});const r=document.createElement("canvas");r.width=e.width,r.height=40,ee(r,t,{format:"CODE128",fontSize:"15",margin:0,displayValue:!0,lineColor:"#000000",width:1.5,height:40});const n=document.createElement("canvas");n.width=r.height,n.height=r.width;const i=n.getContext("2d");return i.translate(n.width/2,n.height/2),i.rotate(Math.PI/2),i.drawImage(r,-r.width/2,-r.height/2),n.toDataURL("image/png")}const Et={receipt:(t,e)=>{t.PRINT_INIT("\u9500\u552E\u5C0F\u7968"),t.SET_PRINT_PAGESIZE(1,"76mm","110mm",""),t.ADD_PRINT_TEXT("10mm","5mm","60mm","5mm","=== \u9500\u552E\u5C0F\u7968 ==="),t.SET_PRINT_STYLEA(0,"FontSize",12),e.items.forEach((r,n)=>{t.ADD_PRINT_TEXT(`${25+n*8}mm`,"5mm","60mm","5mm",`${r.name} x${r.qty} \uFFE5${r.price}`)})},yunda:(t,e)=>{var tt;t.PRINT_INIT("\u97F5\u8FBE\u5FEB\u9012\u5355"),e.mailno?(t.SET_PRINT_PAGESIZE(3,"77mm","120mm",""),t.ADD_PRINT_PDF("-4mm","-1mm","10mm","10mm",e.pdf_info),t.ADD_PRINT_IMAGE("100.5mm","1.5mm","5mm","15mm",Ee(210,60,0,0)),t.ADD_PRINT_IMAGE("21.5mm","1.5mm","5mm","15mm",Ee(210,60,0,0)),t.ADD_PRINT_IMAGE("38mm","56mm","4mm","15mm",Ee(75,225,0,0)),t.ADD_PRINT_IMAGE("22mm","4mm","40mm","15mm",Yu(e.mailno,!1)),t.ADD_PRINT_IMAGE("40mm","56mm","0mm","0mm",Wu(e.mailno)),t.ADD_PRINT_RECT("10.6mm","0","76mm","118mm",0,1)):(t.SET_PRINT_PAGESIZE(3,"77mm","0mm",""),t.ADD_PRINT_PDF("0","0mm","10mm","10mm",e.pdfInfo),t.ADD_PRINT_TEXT("55mm","10mm","48mm","8mm",((tt=e.receiver)==null?void 0:tt.name)+" "+e.receiver.mobile),t.SET_PRINT_STYLEA(0,"FontSize",10),t.ADD_PRINT_TEXT("60mm","10mm","48mm","8mm",e.receiver.address),t.SET_PRINT_STYLEA(0,"FontSize",9),t.ADD_PRINT_TEXT("71mm","10mm","48mm","8mm",e.sender.name+" "+e.sender.mobile),t.SET_PRINT_STYLEA(0,"FontSize",8),t.ADD_PRINT_TEXT("74mm","10mm","48mm","8mm",e.sender.address),t.SET_PRINT_STYLEA(0,"FontSize",8));let r=[];try{r=JSON.parse(e.printTemplateData||"[]"),r=r.sort((c,A)=>c.sort-A.sort)}catch{r=[]}function n(c,A=30){if(!c)return"-";let T=0,R="";for(let he=0;he<c.length;he++){const nt=c.charAt(he),rt=/[\u4e00-\u9fa5]/.test(nt)?2:1;if(T+rt>A)break;R+=nt,T+=rt}return R.length<c.length?`${R}`:R}const i={isGoodsIsbn:{label:"ISBN\uFF1A",getValue:c=>c.isbn||"-"},isGoodsName:{label:"\u5546\u54C1\u540D\u79F0\uFF1A",getValue:c=>n(c.goodsName)},isGoodsArtno:{label:"\u8D27\u53F7/\u539F\u8D27\u53F7\uFF1A",getValue:c=>`${(c.artNo||"").toString().slice(0,6)}/${c.originalArtNo||""}`},isGoodsNum:{label:"\u6570\u91CF\uFF1A",getValue:c=>c.goodsCount||0}};let a=95;const o=3.5,u=2,h=80,l=5;(Array.isArray(e.dataList)?e.dataList:[]).forEach(c=>{r.forEach(A=>{if(!A.checked)return;const T=i[A.value];if(!T)return;const R=`${T.label}${T.getValue(c)}`;t.ADD_PRINT_TEXT(`${a}mm`,`${u}mm`,`${h}mm`,`${l}mm`,R),t.SET_PRINT_STYLEA(0,"FontSize",9),t.SET_PRINT_STYLEA(0,"Bold",1),a+=o})})}},Vt=()=>new Promise((t,e)=>{if(z)return t(z);const r=document.createElement("script");r.src="http://localhost:8000/CLodopfuncs.js",r.onload=()=>{z=getCLodop(),z||e(new Error("C-Lodop \u672A\u6B63\u786E\u5B89\u88C5")),t(z)},r.onerror=()=>{const n=new Error("\u52A0\u8F7D C-Lodop \u5931\u8D25");Ju("C-Lodop\u63D2\u4EF6\u52A0\u8F7D\u5931\u8D25\uFF01"),e(n)},document.head.appendChild(r)});function Ju(t){const e=`${t}
\u8BF7\u5148\u4E0B\u8F7D\u5B89\u88C5\u63D2\u4EF6\u540E\u91CD\u8BD5\uFF01
\u70B9\u51FB\u3010\u786E\u5B9A\u3011\u5F00\u59CB\u4E0B\u8F7D\uFF0C\u3010\u53D6\u6D88\u3011\u5219\u653E\u5F03\u3002`;if(confirm(e)){const r="http://103.236.68.64:19000/my-pics/Lodop/CLodop_Setup_for_Win64NT_6.623EN.exe",n=document.createElement("a");n.href=r,n.download="CLodop_Setup_for_Win64NT_6.623EN.exe",n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n)}}const Zu=async(t,e)=>{console.log("\u521B\u5EFA\u6253\u5370\u4EFB\u52A1\uFF0C\u6A21\u677F:",t,"\u5185\u5BB9:",e);try{const r=await Vt();if(r.SET_LICENSES("","630D8906DC4186920589CAE3FFA925A278D","",""),!Et[t])throw console.log(t),new Error(`\u672A\u627E\u5230\u6A21\u677F: ${t}`);return Et[t](r,e),r}catch(r){throw r}},Qu=async()=>{try{const t=await Vt(),e=[],r=t.GET_PRINTER_COUNT();for(let n=0;n<r;n++){const i=t.GET_PRINTER_NAME(n);e.push(i)}return e}catch{return[]}};export{Zu as c,Qu as g,Vt as i};