ll-package
Version:
2 lines (1 loc) • 2.19 kB
JavaScript
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("../../../../../_virtual/index8.js");require("../Barcode.js");const u=require("../../../../../_virtual/Barcode.js");Object.defineProperty(a.__exports,"__esModule",{value:!0});a.__exports.codabar=void 0;var f=function(){function t(e,r){for(var o=0;o<r.length;o++){var n=r[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),c=u.__exports,l=_(c);function _(t){return t&&t.__esModule?t:{default:t}}function d(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function h(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 v(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 p=function(t){v(e,t);function e(r,o){d(this,e),r.search(/^[0-9\-\$\:\.\+\/]+$/)===0&&(r="A"+r+"A");var n=h(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r.toUpperCase(),o));return n.text=n.options.text||n.text.replace(/[A-D]/g,""),n}return f(e,[{key:"valid",value:function(){return this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)!==-1}},{key:"encode",value:function(){for(var o=[],n=this.getEncodings(),i=0;i<this.data.length;i++)o.push(n[this.data.charAt(i)]),i!==this.data.length-1&&o.push("0");return{text:this.text,data:o.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}(l.default);a.__exports.codabar=p;exports.default=a.__exports;
;