var Pe={},ce={},E={};Object.defineProperty(E,"__esModule",{value:!0});function en(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var tn=function t(e,n){en(this,t),this.data=e,this.text=n.text||e,this.options=n};E.default=tn;Object.defineProperty(ce,"__esModule",{value:!0});ce.CODE39=void 0;var nn=function(){function t(e,n){for(var r=0;r=200){u=r.shift()-105;var s=p.SWAP[u];s!==void 0?a=e.next(r,o+1,s):((i===p.SET_A||i===p.SET_B)&&u===p.SHIFT&&(r[0]=i===p.SET_A?r[0]>95?r[0]-96:r[0]:r[0]<32?r[0]+96:r[0]),a=e.next(r,o+1,i))}else u=e.correctIndex(r,i),a=e.next(r,o+1,i);var _=e.getBar(u),g=u*o;return{result:_+a.result,checksum:g+a.checksum}}}]),e}(yn.default);Y.default=In;var Me={};Object.defineProperty(Me,"__esModule",{value:!0});var x=d,Dt=function(e){return e.match(new RegExp("^"+x.A_CHARS+"*"))[0].length},Mt=function(e){return e.match(new RegExp("^"+x.B_CHARS+"*"))[0].length},Ft=function(e){return e.match(new RegExp("^"+x.C_CHARS+"*"))[0]};function Fe(t,e){var n=e?x.A_CHARS:x.B_CHARS,r=t.match(new RegExp("^("+n+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(r)return r[1]+String.fromCharCode(204)+kt(t.substring(r[1].length));var o=t.match(new RegExp("^"+n+"+"))[0];return o.length===t.length?t:o+String.fromCharCode(e?205:206)+Fe(t.substring(o.length),!e)}function kt(t){var e=Ft(t),n=e.length;if(n===t.length)return t;t=t.substring(n);var r=Dt(t)>=Mt(t);return e+String.fromCharCode(r?206:205)+Fe(t,r)}Me.default=function(t){var e=void 0,n=Ft(t).length;if(n>=2)e=x.C_START_CHAR+kt(t);else{var r=Dt(t)>Mt(t);e=(r?x.A_START_CHAR:x.B_START_CHAR)+Fe(t,r)}return e.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(o,i){return String.fromCharCode(203)+i})};Object.defineProperty(De,"__esModule",{value:!0});var Rn=Y,wn=Bt(Rn),Nn=Me,$n=Bt(Nn);function Bt(t){return t&&t.__esModule?t:{default:t}}function xn(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 Pn(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){Pn(e,t);function e(n,r){if(xn(this,e),/^[\x00-\x7F\xC8-\xD3]+$/.test(n))var o=Se(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,(0,$n.default)(n),r));else var o=Se(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,r));return Se(o)}return e}(wn.default);De.default=Dn;var ke={};Object.defineProperty(ke,"__esModule",{value:!0});var Mn=function(){function t(e,n){for(var r=0;rr.width*10?r.width*10:r.fontSize,o.guardHeight=r.height+o.fontSize/2+r.textMargin,o}return hr(e,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(r,o){return this.text.substr(r,o)}},{key:"leftEncode",value:function(r,o){return(0,dt.default)(r,o)}},{key:"rightText",value:function(r,o){return this.text.substr(r,o)}},{key:"rightEncode",value:function(r,o){return(0,dt.default)(r,o)}},{key:"encodeGuarded",value:function(){var r={fontSize:this.fontSize},o={height:this.guardHeight};return[{data:O.SIDE_BIN,options:o},{data:this.leftEncode(),text:this.leftText(),options:r},{data:O.MIDDLE_BIN,options:o},{data:this.rightEncode(),text:this.rightText(),options:r},{data:O.SIDE_BIN,options:o}]}},{key:"encodeFlat",value:function(){var r=[O.SIDE_BIN,this.leftEncode(),O.MIDDLE_BIN,this.rightEncode(),O.SIDE_BIN];return{data:r.join(""),text:this.text}}}]),e}(vr.default);_e.default=yr;Object.defineProperty(Oe,"__esModule",{value:!0});var pr=function(){function t(e,n){for(var r=0;rr.width*10?o.fontSize=r.width*10:o.fontSize=r.fontSize,o.guardHeight=r.height+o.fontSize/2+r.textMargin,o}return io(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{12}$/)!==-1&&this.data[11]==Ne(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var r="";return r+="101",r+=(0,G.default)(this.data.substr(0,6),"LLLLLL"),r+="01010",r+=(0,G.default)(this.data.substr(6,6),"RRRRRR"),r+="101",{data:r,text:this.text}}},{key:"guardedEncoding",value:function(){var r=[];return this.displayValue&&r.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),r.push({data:"101"+(0,G.default)(this.data[0],"L"),options:{height:this.guardHeight}}),r.push({data:(0,G.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),r.push({data:"01010",options:{height:this.guardHeight}}),r.push({data:(0,G.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),r.push({data:(0,G.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&r.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),r}}]),e}(fo.default);function Ne(t){var e=0,n;for(n=1;n<11;n+=2)e+=parseInt(t[n]);for(n=0;n<11;n+=2)e+=parseInt(t[n])*3;return(10-e%10)%10}Q.default=ho;var Le={};Object.defineProperty(Le,"__esModule",{value:!0});var mo=function(){function t(e,n){for(var r=0;rr.width*10?o.fontSize=r.width*10:o.fontSize=r.fontSize,o.guardHeight=r.height+o.fontSize/2+r.textMargin,o}return mo(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 r="";return r+="101",r+=this.encodeMiddleDigits(),r+="010101",{data:r,text:this.text}}},{key:"guardedEncoding",value:function(){var r=[];return this.displayValue&&r.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),r.push({data:"101",options:{height:this.guardHeight}}),r.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),r.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&r.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),r}},{key:"encodeMiddleDigits",value:function(){var r=this.upcA[0],o=this.upcA[this.upcA.length-1],i=Ao[parseInt(o)][parseInt(r)];return(0,vo.default)(this.middleDigits,i)}}]),e}(go.default);function st(t,e){for(var n=parseInt(t[t.length-1]),r=So[n],o="",i=0,a=0;a=3&&this.number<=131070}}]),e}(na.default);he.pharmacode=ua;var me={};Object.defineProperty(me,"__esModule",{value:!0});me.codabar=void 0;var fa=function(){function t(e,n){for(var r=0;r":["(%)","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(se,"__esModule",{value:!0});var va=function(){function t(e,n){for(var r=0;r0?e.fontSize+e.textMargin:0)+e.marginTop+e.marginBottom}function Vt(t,e,n){if(n.displayValue&&ee&&(e=t[n].height);return e}function cu(t,e,n){var r;if(n)r=n;else if(typeof document!="undefined")r=document.createElement("canvas").getContext("2d");else return 0;r.font=e.fontOptions+" "+e.fontSize+"px "+e.font;var o=r.measureText(t);if(!o)return 0;var i=o.width;return i}S.getMaximumHeightOfEncodings=fu;S.getEncodingHeight=Ht;S.getBarcodePadding=Vt;S.calculateEncodingAttributes=au;S.getTotalWidthOfEncodings=uu;Object.defineProperty(et,"__esModule",{value:!0});var lu=function(){function t(e,n){for(var r=0;r0?(a=0,o.textAlign="left"):n.textAlign=="right"?(a=r.width-1,o.textAlign="right"):(a=r.width/2,o.textAlign="center"),o.fillText(r.text,a,u)}}},{key:"moveCanvasDrawing",value:function(n){var r=this.canvas.getContext("2d");r.translate(n.width,0)}},{key:"restoreCanvas",value:function(){var n=this.canvas.getContext("2d");n.restore()}}]),t}();et.default=su;var tt={};Object.defineProperty(tt,"__esModule",{value:!0});var vu=function(){function t(e,n){for(var r=0;r0&&(this.drawRect(s-r.width*u,a,r.width*u,r.height,n),u=0);u>0&&this.drawRect(s-r.width*(u-1),a,r.width*u,r.height,n)}},{key:"drawSVGText",value:function(n,r,o){var i=this.document.createElementNS(ue,"text");if(r.displayValue){var a,u;i.setAttribute("font-family",r.font),i.setAttribute("font-size",r.fontSize),r.fontOptions.includes("bold")&&i.setAttribute("font-weight","bold"),r.fontOptions.includes("italic")&&i.setAttribute("font-style","italic"),r.textPosition=="top"?u=r.fontSize-r.textMargin:u=r.height+r.textMargin+r.fontSize,r.textAlign=="left"||o.barcodePadding>0?(a=0,i.setAttribute("text-anchor","start")):r.textAlign=="right"?(a=o.width-1,i.setAttribute("text-anchor","end")):(a=o.width/2,i.setAttribute("text-anchor","middle")),i.setAttribute("x",a),i.setAttribute("y",u),i.appendChild(this.document.createTextNode(o.text)),n.appendChild(i)}}},{key:"setSvgAttributes",value:function(n,r){var o=this.svg;o.setAttribute("width",n+"px"),o.setAttribute("height",r+"px"),o.setAttribute("x","0px"),o.setAttribute("y","0px"),o.setAttribute("viewBox","0 0 "+n+" "+r),o.setAttribute("xmlns",ue),o.setAttribute("version","1.1")}},{key:"createGroup",value:function(n,r,o){var i=this.document.createElementNS(ue,"g");return i.setAttribute("transform","translate("+n+", "+r+")"),o.appendChild(i),i}},{key:"setGroupOptions",value:function(n,r){n.setAttribute("fill",r.lineColor)}},{key:"drawRect",value:function(n,r,o,i,a){var u=this.document.createElementNS(ue,"rect");return u.setAttribute("x",n),u.setAttribute("y",r),u.setAttribute("width",o),u.setAttribute("height",i),a.appendChild(u),u}}]),t}();tt.default=pu;var nt={};Object.defineProperty(nt,"__esModule",{value:!0});var Su=function(){function t(e,n){for(var r=0;rl.sort-y.sort)}catch(l){console.error("\u89E3\u6790printTemplateData\u5931\u8D25\uFF1A",l),u=[]}function s(l,y=30){if(!l)return"-";let c=0,f="";for(let h=0;hy)break;f+=m,c+=v}return f.lengthl.isbn||"-"},isGoodsName:{label:"\u5546\u54C1\u540D\u79F0\uFF1A",getValue:l=>s(l.name)+" \xD7"+l.num},isGoodsArtno:{label:"\u8D27\u53F7/\u539F\u8D27\u53F7\uFF1A",getValue:l=>`${(l.artNo||"").toString().slice(0,6)}/${l.originalArtNo||""}`},isGoodsNum:{label:"\u6570\u91CF\uFF1A",getValue:l=>l.num||0}},g=Array.isArray(JSON.parse(t.itemStr))?JSON.parse(t.itemStr):[];g.forEach(l=>{u.forEach(y=>{if(!y.checked)return;const c=_[y.value];if(!c)return;const f=`${c.label}${c.getValue(l)}`;A.ADD_PRINT_TEXT(`${e}mm`,`${r}mm`,`${o}mm`,`${i}mm`,f),A.SET_PRINT_STYLEA(0,"FontSize",9),A.SET_PRINT_STYLEA(0,"Bold",1),e+=n})});const M=t.waybillNo.slice(-4);g.length>1&&(A.ADD_PRINT_TEXT("118mm","0mm","55mm","10mm",M),A.SET_PRINT_STYLEA(0,"Bold",1),A.SET_PRINT_STYLEA(0,"Alignment",2),A.SET_PRINT_STYLEA(0,"FontSize",16))}const It={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((n,r)=>{t.ADD_PRINT_TEXT(`${25+r*8}mm`,"5mm","60mm","5mm",`${n.name} x${n.qty} \uFFE5${n.price}`)})},yunda:(t,e)=>{t.PRINT_INIT("\u97F5\u8FBE\u5FEB\u9012\u5355");debugger;const n=e.mailno||e.mail_no;let r;if(n)r=n.slice(-4),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",Re(210,60,0,0)),t.ADD_PRINT_IMAGE("21.5mm","1.5mm","5mm","15mm",Re(210,60,0,0)),t.ADD_PRINT_IMAGE("38mm","56mm","4mm","15mm",Re(75,225,0,0)),t.ADD_PRINT_IMAGE("22mm","4mm","40mm","15mm",fe(n,!1)),t.ADD_PRINT_IMAGE("40mm","56mm","0mm","0mm",we(n)),t.ADD_PRINT_RECT("10.6mm","0","76mm","118mm",0,1);else{t.SET_PRINT_PAGESIZE(3,"77mm","0mm",""),t.ADD_PRINT_PDF("0","0mm","10mm","10mm",e.pdfInfo);const c=e.receiver||{},f=e.sender||{};t.ADD_PRINT_TEXT("55mm","10mm","48mm","8mm",(c.name||"")+" "+(c.mobile||"")),t.SET_PRINT_STYLEA(0,"FontSize",10),t.ADD_PRINT_TEXT("60mm","10mm","48mm","8mm",c.address||""),t.SET_PRINT_STYLEA(0,"FontSize",9),t.ADD_PRINT_TEXT("71mm","10mm","48mm","8mm",(f.name||"")+" "+(f.mobile||"")),t.SET_PRINT_STYLEA(0,"FontSize",8),t.ADD_PRINT_TEXT("74mm","10mm","48mm","8mm",f.address||""),t.SET_PRINT_STYLEA(0,"FontSize",8)}const o='[{"value":"isGoodsName","checked":true,"sort":1},{"value":"isGoodsArtno","checked":false,"sort":2},{"value":"isGoodsIsbn","checked":false,"sort":3},{"value":"isGoodsNum","checked":false,"sort":4}]';let i=[];try{i=JSON.parse(o||"[]"),i=i.sort((c,f)=>c.sort-f.sort)}catch{i=[]}function a(c,f=30){if(!c)return"-";let h=0,m="";for(let v=0;vf)break;m+=R,h+=$}return m.lengthc.isbn||"-"},isGoodsName:{label:"\u5546\u54C1\u540D\u79F0\uFF1A",getValue:c=>a(c.goodsName)+" \xD7"+c.goodsCount},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 s=100;const _=3.5,g=2,M=80,l=5;debugger;const y=Array.isArray(e.dataList)?e.dataList:[];y.forEach(c=>{i.forEach(f=>{if(!f.checked)return;const h=u[f.value];if(!h)return;const m=`${h.label}${h.getValue(c)}`;t.ADD_PRINT_TEXT(`${s}mm`,`${g}mm`,`${M}mm`,`${l}mm`,m),t.SET_PRINT_STYLEA(0,"FontSize",9),t.SET_PRINT_STYLEA(0,"Bold",1),s+=_})}),y.length>1&&(t.ADD_PRINT_TEXT("118mm","0mm","55mm","10mm",r),t.SET_PRINT_STYLEA(0,"Bold",1),t.SET_PRINT_STYLEA(0,"Alignment",2),t.SET_PRINT_STYLEA(0,"FontSize",16))},YZXB:(t,e)=>{e=Rt(e),t.PRINT_INIT("\u90AE\u653F\u5FEB\u9012"),t.SET_PRINT_PAGESIZE(3,"76mm","130mm",""),t.ADD_PRINT_RECT("28mm","0","76mm","93mm",0,1);const n=e.waybillNo.slice(-4);t.ADD_PRINT_TEXT("1mm","66mm","15mm","50mm","\u5FEB\u9012\u5305\u88F9"),t.SET_PRINT_STYLEA(0,"Bold",1),t.SET_PRINT_STYLEA(0,"FontSize",13),t.SET_PRINT_STYLEA(0,"LineSpacing",-5),t.ADD_PRINT_LINE("95mm","55mm","28mm","55mm",0,1),t.ADD_PRINT_LINE("45mm","0mm","45mm","55mm",0,1),t.ADD_PRINT_LINE("53mm","0mm","53mm","55mm",0,1),t.ADD_PRINT_LINE("79mm","0mm","79mm","55mm",0,1),t.ADD_PRINT_IMAGE("12mm","14mm","40mm","15mm",fe(e.waybillNo,!1)),t.ADD_PRINT_IMAGE("35mm","58mm","0mm","0mm",we(e.waybillNo)),t.ADD_PRINT_TEXT("34mm","0mm","55mm","10mm",e.markDestinationName),t.SET_PRINT_STYLEA(0,"Bold",1),t.SET_PRINT_STYLEA(0,"Alignment",2),t.SET_PRINT_STYLEA(0,"FontSize",16);const r=JSON.parse(e.receiverStr);t.ADD_PRINT_RECT("54mm","1mm","6mm","6mm",0,3),t.ADD_PRINT_TEXT("55mm","2mm","5mm","8mm","\u6536"),t.SET_PRINT_STYLEA(0,"Bold",1),t.SET_PRINT_STYLEA(0,"FontSize",11),t.ADD_PRINT_TEXT("55mm","9mm","48mm","8mm",r.name+" "+r.phone),t.SET_PRINT_STYLEA(0,"Bold",1),t.SET_PRINT_STYLEA(0,"FontSize",10),t.ADD_PRINT_TEXT("64mm","9mm","48mm","20mm",r.prov+r.city+r.county+r.address),t.SET_PRINT_STYLEA(0,"Bold",1),t.SET_PRINT_STYLEA(0,"FontSize",10),t.SET_PRINT_STYLEA(0,"LineSpacing",-5);const o=JSON.parse(e.senderStr);t.ADD_PRINT_TEXT("81mm","2mm","6mm","6mm","\u5BC4"),t.SET_PRINT_STYLEA(0,"FontSize",11),t.ADD_PRINT_TEXT("79.5mm","9mm","70mm","8mm",o.name+" "+o.phone),t.SET_PRINT_STYLEA(0,"FontSize",9),t.ADD_PRINT_TEXT("85mm","9mm","45mm","20mm",o.prov+o.city+o.county+o.address),t.SET_PRINT_STYLEA(0,"FontSize",9),t.SET_PRINT_STYLEA(0,"LineSpacing",-5),t.ADD_PRINT_LINE("95mm","0mm","95mm","76mm",0,1);const i='[{"value":"isGoodsName","checked":true,"sort":1},{"value":"isGoodsArtno","checked":false,"sort":2},{"value":"isGoodsIsbn","checked":false,"sort":3},{"value":"isGoodsNum","checked":false,"sort":4}]';let a=[];try{a=JSON.parse(i||"[]"),a=a.sort((f,h)=>f.sort-h.sort)}catch(f){console.error("\u89E3\u6790printTemplateData\u5931\u8D25\uFF1A",f),a=[]}function u(f,h=26){if(!f)return"-";let m=0,v="";for(let R=0;Rh)break;v+=$,m+=U}return v.lengthf.isbn||"-"},isGoodsName:{label:"\u5546\u54C1\u540D\u79F0\uFF1A",getValue:f=>u(f.name)+" \xD7"+f.num},isGoodsArtno:{label:"\u8D27\u53F7/\u539F\u8D27\u53F7\uFF1A",getValue:f=>`${(f.artNo||"").toString().slice(0,6)}/${f.originalArtNo||""}`},isGoodsNum:{label:"\u6570\u91CF\uFF1A",getValue:f=>f.num||0}};let _=96;const g=3.5,M=2,l=75,y=5,c=Array.isArray(JSON.parse(e.itemStr))?JSON.parse(e.itemStr):[];c.forEach(f=>{a.forEach(h=>{if(!h.checked)return;const m=s[h.value];if(!m)return;const v=`${m.label}${m.getValue(f)}`;t.ADD_PRINT_TEXT(`${_}mm`,`${M}mm`,`${l}mm`,`${y}mm`,v),t.SET_PRINT_STYLEA(0,"FontSize",9),t.SET_PRINT_STYLEA(0,"Bold",1),_+=g})}),c.length>1&&(t.ADD_PRINT_TEXT("121mm","0mm","55mm","10mm",n),t.SET_PRINT_STYLEA(0,"Bold",1),t.SET_PRINT_STYLEA(0,"FontSize",16))},JTSD:(t,e)=>{t.PRINT_INIT("\u6781\u5154\u901F\u9012"),t.SET_PRINT_PAGESIZE(3,"76mm","120mm",""),t.ADD_PRINT_RECT("10.6mm","0","76mm","118mm",0,1),t.ADD_PRINT_IMAGE("24mm","18mm","40mm","15mm",fe(e.waybillNo,!1)),t.ADD_PRINT_IMAGE("50mm","58mm","0mm","0mm",we(e.waybillNo)),t.ADD_PRINT_LINE("106mm","55mm","40mm","55mm",0,1),t.ADD_PRINT_LINE("106mm","8mm","56mm","8mm",0,1);const n=e.waybillNo.slice(-4);t.ADD_PRINT_LINE("23mm","0mm","23mm","76mm",0,1),t.ADD_PRINT_LINE("40mm","0mm","40mm","76mm",0,1),t.ADD_PRINT_LINE("48mm","0mm","48mm","55mm",0,1),t.ADD_PRINT_LINE("56mm","0mm","56mm","55mm",0,1),t.ADD_PRINT_LINE("74mm","0mm","74mm","55mm",0,1),t.ADD_PRINT_LINE("90mm","0mm","90mm","55mm",0,1),t.ADD_PRINT_TEXT("13mm","0mm","79mm","10mm",e.markDestinationName),t.SET_PRINT_STYLEA(0,"Bold",1),t.SET_PRINT_STYLEA(0,"Alignment",2),t.SET_PRINT_STYLEA(0,"FontSize",19),t.ADD_PRINT_RECT("41mm","1mm","6mm","6mm",0,3),t.ADD_PRINT_TEXT("42mm","2mm","5mm","8mm","\u96C6"),t.SET_PRINT_STYLEA(0,"Bold",1),t.SET_PRINT_STYLEA(0,"FontSize",12),t.ADD_PRINT_TEXT("42mm","9mm","40mm","8mm",e.packageCodeName),t.SET_PRINT_STYLEA(0,"Bold",1),t.SET_PRINT_STYLEA(0,"FontSize",13),t.ADD_PRINT_RECT("49mm","1mm","6mm","6mm",0,3),t.ADD_PRINT_TEXT("50mm","2mm","5mm","8mm","\u672B"),t.SET_PRINT_STYLEA(0,"Bold",1),t.SET_PRINT_STYLEA(0,"FontSize",12),t.ADD_PRINT_TEXT("50mm","9mm","40mm","8mm",e.moStr),t.SET_PRINT_STYLEA(0,"Bold",1),t.SET_PRINT_STYLEA(0,"FontSize",13);const r=JSON.parse(e.receiverStr);t.ADD_PRINT_RECT("57mm","1mm","6mm","6mm",0,3),t.ADD_PRINT_TEXT("58mm","2mm","5mm","8mm","\u6536"),t.SET_PRINT_STYLEA(0,"FontSize",11),t.ADD_PRINT_TEXT("57mm","9mm","48mm","8mm",r.name+" "+r.phone),t.SET_PRINT_STYLEA(0,"FontSize",9),t.ADD_PRINT_TEXT("64mm","9mm","48mm","20mm",r.prov+r.city+r.county+r.address),t.SET_PRINT_STYLEA(0,"FontSize",9),t.SET_PRINT_STYLEA(0,"LineSpacing",-5);const o=JSON.parse(e.senderStr);t.ADD_PRINT_TEXT("76mm","2mm","6mm","6mm","\u5BC4"),t.SET_PRINT_STYLEA(0,"Bold",1),t.SET_PRINT_STYLEA(0,"FontSize",12),t.ADD_PRINT_TEXT("74.5mm","9mm","70mm","8mm",o.name+" "+o.phone),t.SET_PRINT_STYLEA(0,"FontSize",8),t.ADD_PRINT_TEXT("80mm","9mm","45mm","20mm",o.prov+o.city+o.county+o.address),t.SET_PRINT_STYLEA(0,"FontSize",8),t.SET_PRINT_STYLEA(0,"LineSpacing",-5),t.ADD_PRINT_TEXT("93mm","2mm","5mm","8mm","\u4FDD"),t.SET_PRINT_STYLEA(0,"Bold",1),t.SET_PRINT_STYLEA(0,"FontSize",12),t.ADD_PRINT_LINE("96mm","8mm","96mm","55mm",0,1),t.ADD_PRINT_LINE("106mm","23mm","90mm","23mm",0,1),t.ADD_PRINT_LINE("106mm","40mm","90mm","40mm",0,1),t.ADD_PRINT_TEXT("91.5mm","9mm","20mm","9mm","\u4EE3\u6536\u8D37\u6B3E"),t.SET_PRINT_STYLEA(0,"Bold",1),t.ADD_PRINT_TEXT("91.5mm","25mm","20mm","25mm","\u5230\u4ED8\u8D37\u6B3E"),t.SET_PRINT_STYLEA(0,"Bold",1),t.ADD_PRINT_TEXT("91.5mm","41mm","20mm","41mm","\u8BA1\u4EF6\u91CD\u91CF"),t.SET_PRINT_STYLEA(0,"Bold",1),t.ADD_PRINT_LINE("106mm","0mm","106mm","76mm",0,1);const i='[{"value":"isGoodsName","checked":true,"sort":1},{"value":"isGoodsArtno","checked":false,"sort":2},{"value":"isGoodsIsbn","checked":false,"sort":3},{"value":"isGoodsNum","checked":false,"sort":4}]';let a=[];try{a=JSON.parse(i||"[]"),a=a.sort((f,h)=>f.sort-h.sort)}catch(f){console.error("\u89E3\u6790printTemplateData\u5931\u8D25\uFF1A",f),a=[]}function u(f,h=30){if(!f)return"-";let m=0,v="";for(let R=0;Rh)break;v+=$,m+=U}return v.lengthf.isbn||"-"},isGoodsName:{label:"\u5546\u54C1\u540D\u79F0\uFF1A",getValue:f=>u(f.name)+" \xD7"+f.num},isGoodsArtno:{label:"\u8D27\u53F7/\u539F\u8D27\u53F7\uFF1A",getValue:f=>`${(f.artNo||"").toString().slice(0,6)}/${f.originalArtNo||""}`},isGoodsNum:{label:"\u6570\u91CF\uFF1A",getValue:f=>f.num||0}};let _=107;const g=3.5,M=2,l=80,y=5;debugger;const c=Array.isArray(JSON.parse(e.itemStr))?JSON.parse(e.itemStr):[];c.forEach(f=>{a.forEach(h=>{if(!h.checked)return;const m=s[h.value];if(!m)return;const v=`${m.label}${m.getValue(f)}`;t.ADD_PRINT_TEXT(`${_}mm`,`${M}mm`,`${l}mm`,`${y}mm`,v),t.SET_PRINT_STYLEA(0,"FontSize",9),t.SET_PRINT_STYLEA(0,"Bold",1),_+=g})}),c.length>1&&(t.ADD_PRINT_TEXT("121mm","0mm","55mm","10mm",n),t.SET_PRINT_STYLEA(0,"Bold",1),t.SET_PRINT_STYLEA(0,"FontSize",16))},YTO:(t,e)=>{e=Rt(e),t.PRINT_INIT("\u90AE\u653F\u5FEB\u9012"),t.SET_PRINT_PAGESIZE(3,"76mm","130mm",""),t.SET_PRINT_MODE("PRINT_NO_PAGE",!0),t.ADD_PRINT_RECT("28mm","0","76mm","93mm",0,1),t.ADD_PRINT_TEXT("1mm","66mm","15mm","50mm","\u5FEB\u9012\u5305\u88F9"),t.SET_PRINT_STYLEA(0,"Bold",1),t.SET_PRINT_STYLEA(0,"FontSize",13),t.SET_PRINT_STYLEA(0,"LineSpacing",-5),t.ADD_PRINT_LINE("38mm","0mm","38mm","76mm",0,1),t.ADD_PRINT_LINE("60mm","0mm","60mm","76mm",0,1),t.ADD_PRINT_LINE("73mm","0mm","73mm","76mm",0,1),t.ADD_PRINT_LINE("90mm","0mm","90mm","76mm",0,1),t.ADD_PRINT_LINE("90mm","30mm","73mm","30mm",0,1);const n=fe(e.waybillNo,!1);t.ADD_PRINT_IMAGE("12mm","18mm","40mm","15mm",n),t.ADD_PRINT_IMAGE("74mm","34mm","40mm","15mm",n),t.ADD_PRINT_TEXT("30mm","0mm","75mm","10mm",e.markDestinationName),t.SET_PRINT_STYLEA(0,"Bold",1),t.SET_PRINT_STYLEA(0,"Alignment",2),t.SET_PRINT_STYLEA(0,"FontSize",18);const r=JSON.parse(e.receiverStr);t.ADD_PRINT_RECT("40mm","1mm","6mm","6mm",0,3),t.ADD_PRINT_TEXT("41mm","2mm","5mm","8mm","\u6536"),t.SET_PRINT_STYLEA(0,"Bold",1),t.SET_PRINT_STYLEA(0,"FontSize",11),t.ADD_PRINT_TEXT("41mm","9mm","75mm","8mm",r.name+" "+r.phone),t.SET_PRINT_STYLEA(0,"Bold",1),t.SET_PRINT_STYLEA(0,"FontSize",10),t.ADD_PRINT_TEXT("50mm","9mm","75mm","20mm",r.prov+r.city+r.county+r.address),t.SET_PRINT_STYLEA(0,"Bold",1),t.SET_PRINT_STYLEA(0,"FontSize",10),t.SET_PRINT_STYLEA(0,"LineSpacing",-5);const o=JSON.parse(e.senderStr);t.ADD_PRINT_TEXT("62mm","2mm","6mm","6mm","\u5BC4"),t.SET_PRINT_STYLEA(0,"FontSize",15),t.ADD_PRINT_TEXT("60.5mm","9mm","75mm","8mm",o.name+" "+o.phone),t.SET_PRINT_STYLEA(0,"FontSize",9),t.ADD_PRINT_TEXT("66mm","9mm","75mm","20mm",o.prov+o.city+o.county+o.address),t.SET_PRINT_STYLEA(0,"FontSize",9),t.SET_PRINT_STYLEA(0,"LineSpacing",-5),n0(e,92)},barcode:async(t,e)=>{const n=e.content||"";if(!n)return;const r=localStorage.getItem("printer_paper_size")||"60*40";t.PRINT_INIT("\u5E93\u4F4D-"+n),r==="60*30"?(t.SET_PRINT_PAGESIZE(3,"60mm","30mm",""),t.ADD_PRINT_IMAGE("5mm","0mm","40mm","10mm",bt(n)),t.SET_PRINT_STYLEA(0,"Horient",2)):r==="40*60"?(t.SET_PRINT_PAGESIZE(3,"40mm","60mm",""),t.ADD_PRINT_IMAGE("5mm","0mm","40mm","10mm",t0(n)),t.SET_PRINT_STYLEA(0,"Horient",2)):(t.SET_PRINT_PAGESIZE(3,"60mm","40mm",""),t.ADD_PRINT_IMAGE("5mm","0mm","35mm","10mm",bt(n)),t.SET_PRINT_STYLEA(0,"Horient",2))}},Kt=()=>new Promise((t,e)=>{if(A)return t(A);const n=document.createElement("script");n.src="http://localhost:8000/CLodopfuncs.js",n.onload=()=>{A=getCLodop(),A||e(new Error("C-Lodop \u672A\u6B63\u786E\u5B89\u88C5")),t(A)},n.onerror=()=>{const r=new Error("\u52A0\u8F7D C-Lodop \u5931\u8D25");r0("C-Lodop\u63D2\u4EF6\u52A0\u8F7D\u5931\u8D25\uFF01"),e(r)},document.head.appendChild(n)});function r0(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 n="http://103.236.68.64:19000/my-pics/Lodop/CLodop_Setup_for_Win64NT_6.623EN.exe",r=document.createElement("a");r.href=n,r.download="CLodop_Setup_for_Win64NT_6.623EN.exe",r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r)}}const o0=async(t,e)=>{console.log("\u521B\u5EFA\u6253\u5370\u4EFB\u52A1\uFF0C\u6A21\u677F:",t,"\u5185\u5BB9:",e);try{const n=await Kt();if(n.SET_LICENSES("","630D8906DC4186920589CAE3FFA925A278D","",""),!It[t])throw console.log(t),new Error(`\u672A\u627E\u5230\u6A21\u677F: ${t}`);return await It[t](n,e),n}catch(n){throw n}},i0=async()=>{try{const t=await Kt(),e=[],n=t.GET_PRINTER_COUNT();for(let r=0;r1){const n=e.name;n.length===2?e.name=n[0]+"*":n.length>2&&(e.name=n[0]+"*".repeat(n.length-2)+n[n.length-1])}if(e.phone){const n=e.phone;if(n.length===11)e.phone=n.slice(0,3)+"****"+n.slice(7);else if(n.length>4){const r=Math.min(3,Math.floor(n.length/3)),o=Math.min(4,Math.floor(n.length/3)),i=n.length-r-o;e.phone=n.slice(0,r)+"*".repeat(i)+n.slice(-o)}}if(e.address){const n=e.address;n.length>6?e.address=n.slice(0,6)+"***":n.length>3&&(e.address=n.slice(0,3)+"***")}t.receiverStr=JSON.stringify(e)}}catch(e){console.error("\u6536\u4EF6\u4EBA\u6570\u636E\u8131\u654F\u5931\u8D25\uFF1A",e)}if(t.senderStr)try{const e=JSON.parse(t.senderStr);if(e){if(e.name&&e.name.length>1){const n=e.name;n.length===2?e.name=n[0]+"*":n.length>2&&(e.name=n[0]+"*".repeat(n.length-2)+n[n.length-1])}if(e.phone){const n=e.phone;if(n.length===11)e.phone=n.slice(0,3)+"****"+n.slice(7);else if(n.length>4){const r=Math.min(3,Math.floor(n.length/3)),o=Math.min(4,Math.floor(n.length/3)),i=n.length-r-o;e.phone=n.slice(0,r)+"*".repeat(i)+n.slice(-o)}}if(e.address){const n=e.address;n.length>6?e.address=n.slice(0,6)+"***":n.length>3&&(e.address=n.slice(0,3)+"***")}t.senderStr=JSON.stringify(e)}}catch(e){console.error("\u53D1\u4EF6\u4EBA\u6570\u636E\u8131\u654F\u5931\u8D25\uFF1A",e)}return t}export{P as J,o0 as c,i0 as g};