var ur=Object.defineProperty,or=Object.defineProperties;var fr=Object.getOwnPropertyDescriptors;var He=Object.getOwnPropertySymbols;var cr=Object.prototype.hasOwnProperty,lr=Object.prototype.propertyIsEnumerable;var ze=(s,f,v)=>f in s?ur(s,f,{enumerable:!0,configurable:!0,writable:!0,value:v}):s[f]=v,Xe=(s,f)=>{for(var v in f||(f={}))cr.call(f,v)&&ze(s,v,f[v]);if(He)for(var v of He(f))lr.call(f,v)&&ze(s,v,f[v]);return s},Ve=(s,f)=>or(s,fr(f));import{R as dr,d as Yt,a as hr,m as vr,b as _r,e as Ge,U as sr,V as yr,k as Je,f as k,w as C,h as Z,F as pr,l as gr,u as Or,g as Er,j as K}from"./index-DL_RpRaM.js";var ee={},G={},te={},Ye;function T(){if(Ye)return te;Ye=1,Object.defineProperty(te,"__esModule",{value:!0});function s(v,l){if(!(v instanceof l))throw new TypeError("Cannot call a class as a function")}var f=function v(l,h){s(this,v),this.data=l,this.text=h.text||l,this.options=h};return te.default=f,te}var Qe;function br(){if(Qe)return G;Qe=1,Object.defineProperty(G,"__esModule",{value:!0}),G.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),w=y*i;return{result:g+o.result,checksum:w+o.checksum}}}]),t}(v.default);return ne.default=a,ne}var ie={},Ke;function mr(){if(Ke)return ie;Ke=1,Object.defineProperty(ie,"__esModule",{value:!0});var s=V(),f=function(c){return c.match(new RegExp("^"+s.A_CHARS+"*"))[0].length},v=function(c){return c.match(new RegExp("^"+s.B_CHARS+"*"))[0].length},l=function(c){return c.match(new RegExp("^"+s.C_CHARS+"*"))[0]};function h(d,c){var a=c?s.A_CHARS:s.B_CHARS,e=d.match(new RegExp("^("+a+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(e)return e[1]+"Ì"+_(d.substring(e[1].length));var t=d.match(new RegExp("^"+a+"+"))[0];return t.length===d.length?d:t+String.fromCharCode(c?205:206)+h(d.substring(t.length),!c)}function _(d){var c=l(d),a=c.length;if(a===d.length)return d;d=d.substring(a);var e=f(d)>=v(d);return c+String.fromCharCode(e?206:205)+h(d,e)}return ie.default=function(d){var c=void 0,a=l(d).length;if(a>=2)c=s.C_START_CHAR+_(d);else{var e=f(d)>v(d);c=(e?s.A_START_CHAR:s.B_START_CHAR)+h(d,e)}return c.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(t,n){return"Ë"+n})},ie}var et;function wr(){if(et)return re;et=1,Object.defineProperty(re,"__esModule",{value:!0});var s=qe(),f=h(s),v=mr(),l=h(v);function h(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 d(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 c(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){c(t,e);function t(n,r){if(_(this,t),/^[\x00-\x7F\xC8-\xD3]+$/.test(n))var i=d(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,(0,l.default)(n),r));else var i=d(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,n,r));return d(i)}return t}(f.default);return re.default=a,re}var ae={},tt;function xr(){if(tt)return ae;tt=1,Object.defineProperty(ae,"__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:f.SIDE_BIN,options:o},{data:this.leftEncode(),text:this.leftText(),options:u},{data:f.MIDDLE_BIN,options:o},{data:this.rightEncode(),text:this.rightText(),options:u},{data:f.SIDE_BIN,options:o}]}},{key:"encodeFlat",value:function(){var u=[f.SIDE_BIN,this.leftEncode(),f.MIDDLE_BIN,this.rightEncode(),f.SIDE_BIN];return{data:u.join(""),text:this.text}}}]),r}(_.default);return ce.default=t,ce}var ft;function Pr(){if(ft)return fe;ft=1,Object.defineProperty(fe,"__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}(h.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 F.default=e,F}var _e={},vt;function Dr(){if(vt)return _e;vt=1,Object.defineProperty(_e,"__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],w=n[parseInt(g)][parseInt(p)];return(0,v.default)(this.middleDigits,w)}}]),o}(h.default);function i(u,o){for(var y=parseInt(u[u.length-1]),p=t[y],g="",w=0,j=0;j=3&&this.number<=131070}}]),e}(v.default);return H.pharmacode=c,H}var z={},At;function Ur(){if(At)return z;At=1,Object.defineProperty(z,"__esModule",{value:!0}),z.codabar=void 0;var s=function(){function a(e,t){for(var n=0;n":["(%)","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"],"":["(%)","T"]}),N}var Tt;function Kt(){if(Tt)return me;Tt=1,Object.defineProperty(me,"__esModule",{value:!0});var s=function(){function e(t,n){for(var r=0;r0?t.fontSize+t.textMargin:0)+t.marginTop+t.marginBottom}function h(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!="undefined")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=c,P.getEncodingHeight=l,P.getBarcodePadding=h,P.calculateEncodingAttributes=_,P.getTotalWidthOfEncodings=d,P}var Gt;function Zr(){if(Gt)return De;Gt=1,Object.defineProperty(De,"__esModule",{value:!0});var s=function(){function c(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()}}]),c}();return De.default=d,De}var ke={},Ft;function Kr(){if(Ft)return ke;Ft=1,Object.defineProperty(ke,"__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(d,"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",d),r.setAttribute("version","1.1"),r.setAttribute("style","transform: translate(0,0)")}},{key:"createGroup",value:function(t,n,r){var i=this.document.createElementNS(d,"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(d,"rect");return o.setAttribute("x",t),o.setAttribute("y",n),o.setAttribute("width",r),o.setAttribute("height",i),u.appendChild(o),o}}]),a}();return ke.default=c,ke}var Ce={},Ut;function en(){if(Ut)return Ce;Ut=1,Object.defineProperty(Ce,"__esModule",{value:!0});var s=function(){function l(h,_){for(var d=0;d<_.length;d++){var c=_[d];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(h,c.key,c)}}return function(h,_,d){return _&&l(h.prototype,_),d&&l(h,d),h}}();function f(l,h){if(!(l instanceof h))throw new TypeError("Cannot call a class as a function")}var v=function(){function l(h,_,d){f(this,l),this.object=h,this.encodings=_,this.options=d}return s(l,[{key:"render",value:function(){this.object.encodings=this.encodings}}]),l}();return Ce.default=v,Ce}var Ht;function tn(){if(Ht)return Ie;Ht=1,Object.defineProperty(Ie,"__esModule",{value:!0});var s=Zr(),f=d(s),v=Kr(),l=d(v),h=en(),_=d(h);function d(c){return c&&c.__esModule?c:{default:c}}return Ie.default={CanvasRenderer:f.default,SVGRenderer:l.default,ObjectRenderer:_.default},Ie}var $={},zt;function nr(){if(zt)return $;zt=1,Object.defineProperty($,"__esModule",{value:!0});function s(d,c){if(!(d instanceof c))throw new TypeError("Cannot call a class as a function")}function f(d,c){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c&&(typeof c=="object"||typeof c=="function")?c:d}function v(d,c){if(typeof c!="function"&&c!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof c);d.prototype=Object.create(c&&c.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(d,c):d.__proto__=c)}var l=function(d){v(c,d);function c(a,e){s(this,c);var t=f(this,(c.__proto__||Object.getPrototypeOf(c)).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 c}(Error),h=function(d){v(c,d);function c(){s(this,c);var a=f(this,(c.__proto__||Object.getPrototypeOf(c)).call(this));return a.name="InvalidElementException",a.message="Not supported type to render on",a}return c}(Error),_=function(d){v(c,d);function c(){s(this,c);var a=f(this,(c.__proto__||Object.getPrototypeOf(c)).call(this));return a.name="NoElementException",a.message="No element to render on.",a}return c}(Error);return $.InvalidInputException=l,$.InvalidElementException=h,$.NoElementException=_,$}var Xt;function rn(){if(Xt)return Ae;Xt=1,Object.defineProperty(Ae,"__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},f=Wr(),v=d(f),l=tn(),h=d(l),_=nr();function d(t){return t&&t.__esModule?t:{default:t}}function c(t){if(typeof t=="string")return a(t);if(Array.isArray(t)){for(var n=[],r=0;r{const l=Ve(Xe({},f.options),{format:f.type});on(v.value,f.text,l)}),(l,h)=>(Ge(),_r(sr(s.tag),{ref_key:"wrapEl",ref:v},null,512))}}),cn=yr(fn),ln={class:"font-medium"},vn=Yt({name:"BarCode",__name:"barcode",setup(s){const f=[{text:"CODE128",type:"CODE128",options:{}},{text:"CODE39",type:"CODE39",options:{lineColor:"#990000"}},{text:"123456",type:"pharmacode",options:{background:"#eee",width:5}}];return(v,l)=>{const h=Z("el-link"),_=Z("el-card"),d=Z("el-col"),c=Z("el-row");return Ge(),Je("div",null,[k(_,{shadow:"never"},{header:C(()=>[Er("div",ln,[l[1]||(l[1]=K(" 条形码(基于 ",-1)),k(h,{href:"https://lindell.me/JsBarcode/",target:"_blank",style:{margin:"0 5px 4px 0","font-size":"16px"}},{default:C(()=>l[0]||(l[0]=[K(" JsBarcode ",-1)])),_:1,__:[0]}),l[2]||(l[2]=K(" 生成) ",-1))]),k(h,{class:"mt-2",href:"https://github.com/pure-admin/vue-pure-admin/blob/main/src/views/able/barcode.vue",target:"_blank"},{default:C(()=>l[3]||(l[3]=[K(" 代码位置 src/views/able/barcode.vue ",-1)])),_:1,__:[3]})]),default:C(()=>[k(c,{gutter:12},{default:C(()=>[(Ge(),Je(pr,null,gr(f,(a,e)=>k(d,{key:e,xs:24,sm:24,md:12,lg:8,xl:8},{default:C(()=>[k(_,{shadow:"hover",class:"flex justify-center"},{default:C(()=>[k(Or(cn),{text:a.text,type:a.type,options:a.options},null,8,["text","type","options"])]),_:2},1024)]),_:2},1024)),64))]),_:1})]),_:1})])}}});export{vn as default};