@sri-xml-viewer/vue 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/VisorXml.vue.d.ts +6 -0
- package/dist/components/barCode.vue.d.ts +12 -0
- package/dist/components/factura.vue.d.ts +43 -0
- package/dist/components/guiaRemision.vue.d.ts +43 -0
- package/dist/components/headDoc.vue.d.ts +41 -0
- package/dist/components/notaCredito.vue.d.ts +43 -0
- package/dist/components/retencion.vue.d.ts +32 -0
- package/dist/components/tableSubtotals.vue.d.ts +20 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.js +1073 -1075
- package/dist/style.css +1 -0
- package/dist/utils.d.ts +3 -0
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),k=require("@sri-xml-viewer/core");function un(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ie={},fe={},$={};Object.defineProperty($,"__esModule",{value:!0});function dn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var fn=function t(e,r){dn(this,t),this.data=e,this.text=r.text||e,this.options=r};$.default=fn;Object.defineProperty(fe,"__esModule",{value:!0});fe.CODE39=void 0;var sn=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),hn=$,vn=mn(hn);function mn(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 _n(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 En(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){En(e,t);function e(r,o){return pn(this,e),r=r.toUpperCase(),o.mod43&&(r+=On(xn(r))),_n(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,o))}return sn(e,[{key:"encode",value:function(){for(var o=ke("*"),a=0;a<this.data.length;a++)o+=ke(this.data[a])+"0";return o+=ke("*"),{data:o,text:this.text}}},{key:"valid",value:function(){return this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)!==-1}}]),e}(vn.default),Dt=["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","-","."," ","$","/","+","%","*"],yn=[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 ke(t){return bn(Vt(t))}function bn(t){return yn[t].toString(2)}function On(t){return Dt[t]}function Vt(t){return Dt.indexOf(t)}function xn(t){for(var e=0,r=0;r<t.length;r++)e+=Vt(t[r]);return e=e%43,e}fe.CODE39=gn;var B={},Ce={},q={},x={};Object.defineProperty(x,"__esModule",{value:!0});var Z;function $e(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Tt=x.SET_A=0,Bt=x.SET_B=1,Rt=x.SET_C=2;x.SHIFT=98;var Nn=x.START_A=103,Sn=x.START_B=104,kn=x.START_C=105;x.MODULO=103;x.STOP=106;x.FNC1=207;x.SET_BY_CODE=(Z={},$e(Z,Nn,Tt),$e(Z,Sn,Bt),$e(Z,kn,Rt),Z);x.SWAP={101:Tt,100:Bt,99:Rt};x.A_START_CHAR="Ð";x.B_START_CHAR="Ñ";x.C_START_CHAR="Ò";x.A_CHARS="[\0-_È-Ï]";x.B_CHARS="[ -È-Ï]";x.C_CHARS="(Ï*[0-9]{2}Ï*)";x.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(q,"__esModule",{value:!0});var $n=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),wn=$,An=Dn(wn),A=x;function Dn(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 Tn(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 Bn(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 Rn=function(t){Bn(e,t);function e(r,o){Vn(this,e);var a=Tn(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r.substring(1),o));return a.bytes=r.split("").map(function(i){return i.charCodeAt(0)}),a}return $n(e,[{key:"valid",value:function(){return/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)}},{key:"encode",value:function(){var o=this.bytes,a=o.shift()-105,i=A.SET_BY_CODE[a];if(i===void 0)throw new RangeError("The encoding does not start with a start character.");this.shouldEncodeAsEan128()===!0&&o.unshift(A.FNC1);var d=e.next(o,1,i);return{text:this.text===this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:e.getBar(a)+d.result+e.getBar((d.checksum+a)%A.MODULO)+e.getBar(A.STOP)}}},{key:"shouldEncodeAsEan128",value:function(){var o=this.options.ean128||!1;return typeof o=="string"&&(o=o.toLowerCase()==="true"),o}}],[{key:"getBar",value:function(o){return A.BARS[o]?A.BARS[o].toString():""}},{key:"correctIndex",value:function(o,a){if(a===A.SET_A){var i=o.shift();return i<32?i+64:i-32}else return a===A.SET_B?o.shift()-32:(o.shift()-48)*10+o.shift()-48}},{key:"next",value:function(o,a,i){if(!o.length)return{result:"",checksum:0};var d=void 0,l=void 0;if(o[0]>=200){l=o.shift()-105;var p=A.SWAP[l];p!==void 0?d=e.next(o,a+1,p):((i===A.SET_A||i===A.SET_B)&&l===A.SHIFT&&(o[0]=i===A.SET_A?o[0]>95?o[0]-96:o[0]:o[0]<32?o[0]+96:o[0]),d=e.next(o,a+1,i))}else l=e.correctIndex(o,i),d=e.next(o,a+1,i);var u=e.getBar(l),f=l*a;return{result:u+d.result,checksum:f+d.checksum}}}]),e}(An.default);q.default=Rn;var Pe={};Object.defineProperty(Pe,"__esModule",{value:!0});var I=x,It=function(e){return e.match(new RegExp("^"+I.A_CHARS+"*"))[0].length},Ct=function(e){return e.match(new RegExp("^"+I.B_CHARS+"*"))[0].length},Pt=function(e){return e.match(new RegExp("^"+I.C_CHARS+"*"))[0]};function Me(t,e){var r=e?I.A_CHARS:I.B_CHARS,o=t.match(new RegExp("^("+r+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(o)return o[1]+"Ì"+Mt(t.substring(o[1].length));var a=t.match(new RegExp("^"+r+"+"))[0];return a.length===t.length?t:a+String.fromCharCode(e?205:206)+Me(t.substring(a.length),!e)}function Mt(t){var e=Pt(t),r=e.length;if(r===t.length)return t;t=t.substring(r);var o=It(t)>=Ct(t);return e+String.fromCharCode(o?206:205)+Me(t,o)}Pe.default=function(t){var e=void 0,r=Pt(t).length;if(r>=2)e=I.C_START_CHAR+Mt(t);else{var o=It(t)>Ct(t);e=(o?I.A_START_CHAR:I.B_START_CHAR)+Me(t,o)}return e.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(a,i){return"Ë"+i})};Object.defineProperty(Ce,"__esModule",{value:!0});var In=q,Cn=Lt(In),Pn=Pe,Mn=Lt(Pn);function Lt(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 we(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 jn(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 zn=function(t){jn(e,t);function e(r,o){if(Ln(this,e),/^[\x00-\x7F\xC8-\xD3]+$/.test(r))var a=we(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,(0,Mn.default)(r),o));else var a=we(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,o));return we(a)}return e}(Cn.default);Ce.default=zn;var Le={};Object.defineProperty(Le,"__esModule",{value:!0});var Un=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),Fn=q,Gn=Hn(Fn),vt=x;function Hn(t){return t&&t.__esModule?t:{default:t}}function qn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Xn(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 Jn=function(t){Yn(e,t);function e(r,o){return qn(this,e),Xn(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,vt.A_START_CHAR+r,o))}return Un(e,[{key:"valid",value:function(){return new RegExp("^"+vt.A_CHARS+"+$").test(this.data)}}]),e}(Gn.default);Le.default=Jn;var je={};Object.defineProperty(je,"__esModule",{value:!0});var Zn=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),Wn=q,Kn=Qn(Wn),mt=x;function Qn(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 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 nr(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 rr=function(t){nr(e,t);function e(r,o){return er(this,e),tr(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,mt.B_START_CHAR+r,o))}return Zn(e,[{key:"valid",value:function(){return new RegExp("^"+mt.B_CHARS+"+$").test(this.data)}}]),e}(Kn.default);je.default=rr;var ze={};Object.defineProperty(ze,"__esModule",{value:!0});var or=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),ar=q,ir=lr(ar),pt=x;function lr(t){return t&&t.__esModule?t:{default:t}}function cr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ur(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 dr(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(t){dr(e,t);function e(r,o){return cr(this,e),ur(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,pt.C_START_CHAR+r,o))}return or(e,[{key:"valid",value:function(){return new RegExp("^"+pt.C_CHARS+"+$").test(this.data)}}]),e}(ir.default);ze.default=fr;Object.defineProperty(B,"__esModule",{value:!0});B.CODE128C=B.CODE128B=B.CODE128A=B.CODE128=void 0;var sr=Ce,hr=se(sr),vr=Le,mr=se(vr),pr=je,_r=se(pr),Er=ze,gr=se(Er);function se(t){return t&&t.__esModule?t:{default:t}}B.CODE128=hr.default;B.CODE128A=mr.default;B.CODE128B=_r.default;B.CODE128C=gr.default;var w={},Ue={},T={};Object.defineProperty(T,"__esModule",{value:!0});T.SIDE_BIN="101";T.MIDDLE_BIN="01010";T.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"]};T.EAN2_STRUCTURE=["LL","LG","GL","GG"];T.EAN5_STRUCTURE=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"];T.EAN13_STRUCTURE=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"];var he={},M={};Object.defineProperty(M,"__esModule",{value:!0});var yr=T,br=function(e,r,o){var a=e.split("").map(function(d,l){return yr.BINARIES[r[l]]}).map(function(d,l){return d?d[e[l]]:""});if(o){var i=e.length-1;a=a.map(function(d,l){return l<i?d+o:d})}return a.join("")};M.default=br;Object.defineProperty(he,"__esModule",{value:!0});var Or=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),z=T,xr=M,_t=jt(xr),Nr=$,Sr=jt(Nr);function jt(t){return t&&t.__esModule?t:{default:t}}function kr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function $r(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 wr(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 Ar=function(t){wr(e,t);function e(r,o){kr(this,e);var a=$r(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,o));return a.fontSize=!o.flat&&o.fontSize>o.width*10?o.width*10:o.fontSize,a.guardHeight=o.height+a.fontSize/2+o.textMargin,a}return Or(e,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(o,a){return this.text.substr(o,a)}},{key:"leftEncode",value:function(o,a){return(0,_t.default)(o,a)}},{key:"rightText",value:function(o,a){return this.text.substr(o,a)}},{key:"rightEncode",value:function(o,a){return(0,_t.default)(o,a)}},{key:"encodeGuarded",value:function(){var o={fontSize:this.fontSize},a={height:this.guardHeight};return[{data:z.SIDE_BIN,options:a},{data:this.leftEncode(),text:this.leftText(),options:o},{data:z.MIDDLE_BIN,options:a},{data:this.rightEncode(),text:this.rightText(),options:o},{data:z.SIDE_BIN,options:a}]}},{key:"encodeFlat",value:function(){var o=[z.SIDE_BIN,this.leftEncode(),z.MIDDLE_BIN,this.rightEncode(),z.SIDE_BIN];return{data:o.join(""),text:this.text}}}]),e}(Sr.default);he.default=Ar;Object.defineProperty(Ue,"__esModule",{value:!0});var Dr=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),W=function t(e,r,o){e===null&&(e=Function.prototype);var a=Object.getOwnPropertyDescriptor(e,r);if(a===void 0){var i=Object.getPrototypeOf(e);return i===null?void 0:t(i,r,o)}else{if("value"in a)return a.value;var d=a.get;return d===void 0?void 0:d.call(o)}},Vr=T,Tr=he,Br=Rr(Tr);function Rr(t){return t&&t.__esModule?t:{default:t}}function Ir(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Cr(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 Pr(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 Et=function(e){var r=e.substr(0,12).split("").map(function(o){return+o}).reduce(function(o,a,i){return i%2?o+a*3:o+a},0);return(10-r%10)%10},Mr=function(t){Pr(e,t);function e(r,o){Ir(this,e),r.search(/^[0-9]{12}$/)!==-1&&(r+=Et(r));var a=Cr(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,o));return a.lastChar=o.lastChar,a}return Dr(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{13}$/)!==-1&&+this.data[12]===Et(this.data)}},{key:"leftText",value:function(){return W(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftText",this).call(this,1,6)}},{key:"leftEncode",value:function(){var o=this.data.substr(1,6),a=Vr.EAN13_STRUCTURE[this.data[0]];return W(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftEncode",this).call(this,o,a)}},{key:"rightText",value:function(){return W(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightText",this).call(this,7,6)}},{key:"rightEncode",value:function(){var o=this.data.substr(7,6);return W(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightEncode",this).call(this,o,"RRRRRR")}},{key:"encodeGuarded",value:function(){var o=W(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"encodeGuarded",this).call(this);return this.options.displayValue&&(o.unshift({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),this.options.lastChar&&(o.push({data:"00"}),o.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}}))),o}}]),e}(Br.default);Ue.default=Mr;var Fe={};Object.defineProperty(Fe,"__esModule",{value:!0});var Lr=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),ie=function t(e,r,o){e===null&&(e=Function.prototype);var a=Object.getOwnPropertyDescriptor(e,r);if(a===void 0){var i=Object.getPrototypeOf(e);return i===null?void 0:t(i,r,o)}else{if("value"in a)return a.value;var d=a.get;return d===void 0?void 0:d.call(o)}},jr=he,zr=Ur(jr);function Ur(t){return t&&t.__esModule?t:{default:t}}function Fr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Gr(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 gt=function(e){var r=e.substr(0,7).split("").map(function(o){return+o}).reduce(function(o,a,i){return i%2?o+a:o+a*3},0);return(10-r%10)%10},qr=function(t){Hr(e,t);function e(r,o){return Fr(this,e),r.search(/^[0-9]{7}$/)!==-1&&(r+=gt(r)),Gr(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,o))}return Lr(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{8}$/)!==-1&&+this.data[7]===gt(this.data)}},{key:"leftText",value:function(){return ie(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftText",this).call(this,0,4)}},{key:"leftEncode",value:function(){var o=this.data.substr(0,4);return ie(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftEncode",this).call(this,o,"LLLL")}},{key:"rightText",value:function(){return ie(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightText",this).call(this,4,4)}},{key:"rightEncode",value:function(){var o=this.data.substr(4,4);return ie(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightEncode",this).call(this,o,"RRRR")}}]),e}(zr.default);Fe.default=qr;var Ge={};Object.defineProperty(Ge,"__esModule",{value:!0});var Xr=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),Yr=T,Jr=M,Zr=zt(Jr),Wr=$,Kr=zt(Wr);function zt(t){return t&&t.__esModule?t:{default:t}}function Qr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function eo(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 to(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 no=function(e){var r=e.split("").map(function(o){return+o}).reduce(function(o,a,i){return i%2?o+a*9:o+a*3},0);return r%10},ro=function(t){to(e,t);function e(r,o){return Qr(this,e),eo(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,o))}return Xr(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{5}$/)!==-1}},{key:"encode",value:function(){var o=Yr.EAN5_STRUCTURE[no(this.data)];return{data:"1011"+(0,Zr.default)(this.data,o,"01"),text:this.text}}}]),e}(Kr.default);Ge.default=ro;var He={};Object.defineProperty(He,"__esModule",{value:!0});var oo=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),ao=T,io=M,lo=Ut(io),co=$,uo=Ut(co);function Ut(t){return t&&t.__esModule?t:{default:t}}function fo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function so(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 ho(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 vo=function(t){ho(e,t);function e(r,o){return fo(this,e),so(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,o))}return oo(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{2}$/)!==-1}},{key:"encode",value:function(){var o=ao.EAN2_STRUCTURE[parseInt(this.data)%4];return{data:"1011"+(0,lo.default)(this.data,o,"01"),text:this.text}}}]),e}(uo.default);He.default=vo;var ee={};Object.defineProperty(ee,"__esModule",{value:!0});var mo=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}();ee.checksum=Te;var po=M,U=Ft(po),_o=$,Eo=Ft(_o);function Ft(t){return t&&t.__esModule?t:{default:t}}function go(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function yo(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 Oo=function(t){bo(e,t);function e(r,o){go(this,e),r.search(/^[0-9]{11}$/)!==-1&&(r+=Te(r));var a=yo(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,o));return a.displayValue=o.displayValue,o.fontSize>o.width*10?a.fontSize=o.width*10:a.fontSize=o.fontSize,a.guardHeight=o.height+a.fontSize/2+o.textMargin,a}return mo(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{12}$/)!==-1&&this.data[11]==Te(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var o="";return o+="101",o+=(0,U.default)(this.data.substr(0,6),"LLLLLL"),o+="01010",o+=(0,U.default)(this.data.substr(6,6),"RRRRRR"),o+="101",{data:o,text:this.text}}},{key:"guardedEncoding",value:function(){var o=[];return this.displayValue&&o.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),o.push({data:"101"+(0,U.default)(this.data[0],"L"),options:{height:this.guardHeight}}),o.push({data:(0,U.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),o.push({data:"01010",options:{height:this.guardHeight}}),o.push({data:(0,U.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),o.push({data:(0,U.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&o.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),o}}]),e}(Eo.default);function Te(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}ee.default=Oo;var qe={};Object.defineProperty(qe,"__esModule",{value:!0});var xo=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),No=M,So=Gt(No),ko=$,$o=Gt(ko),wo=ee;function Gt(t){return t&&t.__esModule?t:{default:t}}function Ao(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ae(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 Do(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 Vo=["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"],To=[["EEEOOO","OOOEEE"],["EEOEOO","OOEOEE"],["EEOOEO","OOEEOE"],["EEOOOE","OOEEEO"],["EOEEOO","OEOOEE"],["EOOEEO","OEEOOE"],["EOOOEE","OEEEOO"],["EOEOEO","OEOEOE"],["EOEOOE","OEOEEO"],["EOOEOE","OEEOEO"]],Bo=function(t){Do(e,t);function e(r,o){Ao(this,e);var a=Ae(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,o));if(a.isValid=!1,r.search(/^[0-9]{6}$/)!==-1)a.middleDigits=r,a.upcA=yt(r,"0"),a.text=o.text||""+a.upcA[0]+r+a.upcA[a.upcA.length-1],a.isValid=!0;else if(r.search(/^[01][0-9]{7}$/)!==-1)if(a.middleDigits=r.substring(1,r.length-1),a.upcA=yt(a.middleDigits,r[0]),a.upcA[a.upcA.length-1]===r[r.length-1])a.isValid=!0;else return Ae(a);else return Ae(a);return a.displayValue=o.displayValue,o.fontSize>o.width*10?a.fontSize=o.width*10:a.fontSize=o.fontSize,a.guardHeight=o.height+a.fontSize/2+o.textMargin,a}return xo(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 o="";return o+="101",o+=this.encodeMiddleDigits(),o+="010101",{data:o,text:this.text}}},{key:"guardedEncoding",value:function(){var o=[];return this.displayValue&&o.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),o.push({data:"101",options:{height:this.guardHeight}}),o.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),o.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&o.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),o}},{key:"encodeMiddleDigits",value:function(){var o=this.upcA[0],a=this.upcA[this.upcA.length-1],i=To[parseInt(a)][parseInt(o)];return(0,So.default)(this.middleDigits,i)}}]),e}($o.default);function yt(t,e){for(var r=parseInt(t[t.length-1]),o=Vo[r],a="",i=0,d=0;d<o.length;d++){var l=o[d];l==="X"?a+=t[i++]:a+=l}return a=""+e+a,""+a+(0,wo.checksum)(a)}qe.default=Bo;Object.defineProperty(w,"__esModule",{value:!0});w.UPCE=w.UPC=w.EAN2=w.EAN5=w.EAN8=w.EAN13=void 0;var Ro=Ue,Io=X(Ro),Co=Fe,Po=X(Co),Mo=Ge,Lo=X(Mo),jo=He,zo=X(jo),Uo=ee,Fo=X(Uo),Go=qe,Ho=X(Go);function X(t){return t&&t.__esModule?t:{default:t}}w.EAN13=Io.default;w.EAN8=Po.default;w.EAN5=Lo.default;w.EAN2=zo.default;w.UPC=Fo.default;w.UPCE=Ho.default;var G={},ve={},te={};Object.defineProperty(te,"__esModule",{value:!0});te.START_BIN="1010";te.END_BIN="11101";te.BINARIES=["00110","10001","01001","11000","00101","10100","01100","00011","10010","01010"];Object.defineProperty(ve,"__esModule",{value:!0});var qo=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),le=te,Xo=$,Yo=Jo(Xo);function Jo(t){return t&&t.__esModule?t:{default:t}}function Zo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Wo(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 Ko(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 Qo=function(t){Ko(e,t);function e(){return Zo(this,e),Wo(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return qo(e,[{key:"valid",value:function(){return this.data.search(/^([0-9]{2})+$/)!==-1}},{key:"encode",value:function(){var o=this,a=this.data.match(/.{2}/g).map(function(i){return o.encodePair(i)}).join("");return{data:le.START_BIN+a+le.END_BIN,text:this.text}}},{key:"encodePair",value:function(o){var a=le.BINARIES[o[1]];return le.BINARIES[o[0]].split("").map(function(i,d){return(i==="1"?"111":"1")+(a[d]==="1"?"000":"0")}).join("")}}]),e}(Yo.default);ve.default=Qo;var Xe={};Object.defineProperty(Xe,"__esModule",{value:!0});var ea=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),ta=ve,na=ra(ta);function ra(t){return t&&t.__esModule?t:{default:t}}function oa(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function aa(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 ia(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 bt=function(e){var r=e.substr(0,13).split("").map(function(o){return parseInt(o,10)}).reduce(function(o,a,i){return o+a*(3-i%2*2)},0);return Math.ceil(r/10)*10-r},la=function(t){ia(e,t);function e(r,o){return oa(this,e),r.search(/^[0-9]{13}$/)!==-1&&(r+=bt(r)),aa(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,o))}return ea(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{14}$/)!==-1&&+this.data[13]===bt(this.data)}}]),e}(na.default);Xe.default=la;Object.defineProperty(G,"__esModule",{value:!0});G.ITF14=G.ITF=void 0;var ca=ve,ua=Ht(ca),da=Xe,fa=Ht(da);function Ht(t){return t&&t.__esModule?t:{default:t}}G.ITF=ua.default;G.ITF14=fa.default;var V={},L={};Object.defineProperty(L,"__esModule",{value:!0});var sa=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),ha=$,va=ma(ha);function ma(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 _a(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 Ea(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 ga=function(t){Ea(e,t);function e(r,o){return pa(this,e),_a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,o))}return sa(e,[{key:"encode",value:function(){for(var o="110",a=0;a<this.data.length;a++){var i=parseInt(this.data[a]),d=i.toString(2);d=ya(d,4-d.length);for(var l=0;l<d.length;l++)o+=d[l]=="0"?"100":"110"}return o+="1001",{data:o,text:this.text}}},{key:"valid",value:function(){return this.data.search(/^[0-9]+$/)!==-1}}]),e}(va.default);function ya(t,e){for(var r=0;r<e;r++)t="0"+t;return t}L.default=ga;var Ye={},j={};Object.defineProperty(j,"__esModule",{value:!0});j.mod10=ba;j.mod11=Oa;function ba(t){for(var e=0,r=0;r<t.length;r++){var o=parseInt(t[r]);(r+t.length)%2===0?e+=o:e+=o*2%10+Math.floor(o*2/10)}return(10-e%10)%10}function Oa(t){for(var e=0,r=[2,3,4,5,6,7],o=0;o<t.length;o++){var a=parseInt(t[t.length-1-o]);e+=r[o%r.length]*a}return(11-e%11)%11}Object.defineProperty(Ye,"__esModule",{value:!0});var xa=L,Na=ka(xa),Sa=j;function ka(t){return t&&t.__esModule?t:{default:t}}function $a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function wa(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 Da=function(t){Aa(e,t);function e(r,o){return $a(this,e),wa(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r+(0,Sa.mod10)(r),o))}return e}(Na.default);Ye.default=Da;var Je={};Object.defineProperty(Je,"__esModule",{value:!0});var Va=L,Ta=Ra(Va),Ba=j;function Ra(t){return t&&t.__esModule?t:{default:t}}function Ia(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ca(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 Pa(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 Ma=function(t){Pa(e,t);function e(r,o){return Ia(this,e),Ca(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r+(0,Ba.mod11)(r),o))}return e}(Ta.default);Je.default=Ma;var Ze={};Object.defineProperty(Ze,"__esModule",{value:!0});var La=L,ja=za(La),Ot=j;function za(t){return t&&t.__esModule?t:{default:t}}function Ua(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Fa(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 Ga(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 Ha=function(t){Ga(e,t);function e(r,o){return Ua(this,e),r+=(0,Ot.mod10)(r),r+=(0,Ot.mod10)(r),Fa(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,o))}return e}(ja.default);Ze.default=Ha;var We={};Object.defineProperty(We,"__esModule",{value:!0});var qa=L,Xa=Ya(qa),xt=j;function Ya(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 Wa(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){Wa(e,t);function e(r,o){return Ja(this,e),r+=(0,xt.mod11)(r),r+=(0,xt.mod10)(r),Za(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,o))}return e}(Xa.default);We.default=Ka;Object.defineProperty(V,"__esModule",{value:!0});V.MSI1110=V.MSI1010=V.MSI11=V.MSI10=V.MSI=void 0;var Qa=L,ei=ne(Qa),ti=Ye,ni=ne(ti),ri=Je,oi=ne(ri),ai=Ze,ii=ne(ai),li=We,ci=ne(li);function ne(t){return t&&t.__esModule?t:{default:t}}V.MSI=ei.default;V.MSI10=ni.default;V.MSI11=oi.default;V.MSI1010=ii.default;V.MSI1110=ci.default;var me={};Object.defineProperty(me,"__esModule",{value:!0});me.pharmacode=void 0;var ui=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),di=$,fi=si(di);function si(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 vi(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 mi(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 pi=function(t){mi(e,t);function e(r,o){hi(this,e);var a=vi(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,o));return a.number=parseInt(r,10),a}return ui(e,[{key:"encode",value:function(){for(var o=this.number,a="";!isNaN(o)&&o!=0;)o%2===0?(a="11100"+a,o=(o-2)/2):(a="100"+a,o=(o-1)/2);return a=a.slice(0,-2),{data:a,text:this.text}}},{key:"valid",value:function(){return this.number>=3&&this.number<=131070}}]),e}(fi.default);me.pharmacode=pi;var pe={};Object.defineProperty(pe,"__esModule",{value:!0});pe.codabar=void 0;var _i=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),Ei=$,gi=yi(Ei);function yi(t){return t&&t.__esModule?t:{default:t}}function bi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Oi(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 xi(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 Ni=function(t){xi(e,t);function e(r,o){bi(this,e),r.search(/^[0-9\-\$\:\.\+\/]+$/)===0&&(r="A"+r+"A");var a=Oi(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r.toUpperCase(),o));return a.text=a.options.text||a.text.replace(/[A-D]/g,""),a}return _i(e,[{key:"valid",value:function(){return this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)!==-1}},{key:"encode",value:function(){for(var o=[],a=this.getEncodings(),i=0;i<this.data.length;i++)o.push(a[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}(gi.default);pe.codabar=Ni;var H={},_e={},re={};Object.defineProperty(re,"__esModule",{value:!0});re.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","-","."," ","$","/","+","%","($)","(%)","(/)","(+)","ÿ"];re.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"];re.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"],"":["(%)","T"]};Object.defineProperty(_e,"__esModule",{value:!0});var Si=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),ce=re,ki=$,$i=wi(ki);function wi(t){return t&&t.__esModule?t:{default:t}}function Ai(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Di(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 Vi(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 Ti=function(t){Vi(e,t);function e(r,o){return Ai(this,e),Di(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,o))}return Si(e,[{key:"valid",value:function(){return/^[0-9A-Z\-. $/+%]+$/.test(this.data)}},{key:"encode",value:function(){var o=this.data.split("").flatMap(function(l){return ce.MULTI_SYMBOLS[l]||l}),a=o.map(function(l){return e.getEncoding(l)}).join(""),i=e.checksum(o,20),d=e.checksum(o.concat(i),15);return{text:this.text,data:e.getEncoding("ÿ")+a+e.getEncoding(i)+e.getEncoding(d)+e.getEncoding("ÿ")+"1"}}}],[{key:"getEncoding",value:function(o){return ce.BINARIES[e.symbolValue(o)]}},{key:"getSymbol",value:function(o){return ce.SYMBOLS[o]}},{key:"symbolValue",value:function(o){return ce.SYMBOLS.indexOf(o)}},{key:"checksum",value:function(o,a){var i=o.slice().reverse().reduce(function(d,l,p){var u=p%a+1;return d+e.symbolValue(l)*u},0);return e.getSymbol(i%47)}}]),e}($i.default);_e.default=Ti;var Ke={};Object.defineProperty(Ke,"__esModule",{value:!0});var Bi=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),Ri=_e,Ii=Ci(Ri);function Ci(t){return t&&t.__esModule?t:{default:t}}function Pi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Mi(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 Li(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 ji=function(t){Li(e,t);function e(r,o){return Pi(this,e),Mi(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,o))}return Bi(e,[{key:"valid",value:function(){return/^[\x00-\x7f]+$/.test(this.data)}}]),e}(Ii.default);Ke.default=ji;Object.defineProperty(H,"__esModule",{value:!0});H.CODE93FullASCII=H.CODE93=void 0;var zi=_e,Ui=qt(zi),Fi=Ke,Gi=qt(Fi);function qt(t){return t&&t.__esModule?t:{default:t}}H.CODE93=Ui.default;H.CODE93FullASCII=Gi.default;var Ee={};Object.defineProperty(Ee,"__esModule",{value:!0});Ee.GenericBarcode=void 0;var Hi=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),qi=$,Xi=Yi(qi);function Yi(t){return t&&t.__esModule?t:{default:t}}function Ji(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 Wi(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 Ki=function(t){Wi(e,t);function e(r,o){return Ji(this,e),Zi(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,o))}return Hi(e,[{key:"encode",value:function(){return{data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return!0}}]),e}(Xi.default);Ee.GenericBarcode=Ki;Object.defineProperty(Ie,"__esModule",{value:!0});var Qi=fe,ue=B,F=w,Nt=G,K=V,el=me,tl=pe,St=H,nl=Ee;Ie.default={CODE39:Qi.CODE39,CODE128:ue.CODE128,CODE128A:ue.CODE128A,CODE128B:ue.CODE128B,CODE128C:ue.CODE128C,EAN13:F.EAN13,EAN8:F.EAN8,EAN5:F.EAN5,EAN2:F.EAN2,UPC:F.UPC,UPCE:F.UPCE,ITF14:Nt.ITF14,ITF:Nt.ITF,MSI:K.MSI,MSI10:K.MSI10,MSI11:K.MSI11,MSI1010:K.MSI1010,MSI1110:K.MSI1110,pharmacode:el.pharmacode,codabar:tl.codabar,CODE93:St.CODE93,CODE93FullASCII:St.CODE93FullASCII,GenericBarcode:nl.GenericBarcode};var Y={};Object.defineProperty(Y,"__esModule",{value:!0});var rl=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t};Y.default=function(t,e){return rl({},t,e)};var Qe={};Object.defineProperty(Qe,"__esModule",{value:!0});Qe.default=ol;function ol(t){var e=[];function r(o){if(Array.isArray(o))for(var a=0;a<o.length;a++)r(o[a]);else o.text=o.text||"",o.data=o.data||"",e.push(o)}return r(t),e}var et={};Object.defineProperty(et,"__esModule",{value:!0});et.default=al;function al(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 tt={},nt={},ge={};Object.defineProperty(ge,"__esModule",{value:!0});ge.default=il;function il(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 ye={};Object.defineProperty(ye,"__esModule",{value:!0});var ll={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(){}};ye.default=ll;Object.defineProperty(nt,"__esModule",{value:!0});var cl=ge,ul=Xt(cl),dl=ye,kt=Xt(dl);function Xt(t){return t&&t.__esModule?t:{default:t}}function fl(t){var e={};for(var r in kt.default)kt.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,ul.default)(e),e}nt.default=fl;var rt={},ot={},D={};Object.defineProperty(D,"__esModule",{value:!0});D.getTotalWidthOfEncodings=D.calculateEncodingAttributes=D.getBarcodePadding=D.getEncodingHeight=D.getMaximumHeightOfEncodings=void 0;var sl=Y,hl=vl(sl);function vl(t){return t&&t.__esModule?t:{default:t}}function Yt(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 ml(t,e,r){for(var o=0;o<t.length;o++){var a=t[o],i=(0,hl.default)(e,a.options),d;i.displayValue?d=El(a.text,i,r):d=0;var l=a.data.length*i.width;a.width=Math.ceil(Math.max(d,l)),a.height=Yt(a,i),a.barcodePadding=Jt(d,l,i)}}function pl(t){for(var e=0,r=0;r<t.length;r++)e+=t[r].width;return e}function _l(t){for(var e=0,r=0;r<t.length;r++)t[r].height>e&&(e=t[r].height);return e}function El(t,e,r){var o;if(r)o=r;else if(typeof document<"u")o=document.createElement("canvas").getContext("2d");else return 0;o.font=e.fontOptions+" "+e.fontSize+"px "+e.font;var a=o.measureText(t);if(!a)return 0;var i=a.width;return i}D.getMaximumHeightOfEncodings=_l;D.getEncodingHeight=Yt;D.getBarcodePadding=Jt;D.calculateEncodingAttributes=ml;D.getTotalWidthOfEncodings=pl;Object.defineProperty(ot,"__esModule",{value:!0});var gl=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),yl=Y,bl=Ol(yl),De=D;function Ol(t){return t&&t.__esModule?t:{default:t}}function xl(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Nl=function(){function t(e,r,o){xl(this,t),this.canvas=e,this.encodings=r,this.options=o}return gl(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 o=(0,bl.default)(this.options,this.encodings[r].options);this.drawCanvasBarcode(o,this.encodings[r]),this.drawCanvasText(o,this.encodings[r]),this.moveCanvasDrawing(this.encodings[r])}this.restoreCanvas()}},{key:"prepareCanvas",value:function(){var r=this.canvas.getContext("2d");r.save(),(0,De.calculateEncodingAttributes)(this.encodings,this.options,r);var o=(0,De.getTotalWidthOfEncodings)(this.encodings),a=(0,De.getMaximumHeightOfEncodings)(this.encodings);this.canvas.width=o+this.options.marginLeft+this.options.marginRight,this.canvas.height=a,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,o){var a=this.canvas.getContext("2d"),i=o.data,d;r.textPosition=="top"?d=r.marginTop+r.fontSize+r.textMargin:d=r.marginTop,a.fillStyle=r.lineColor;for(var l=0;l<i.length;l++){var p=l*r.width+o.barcodePadding;i[l]==="1"?a.fillRect(p,d,r.width,r.height):i[l]&&a.fillRect(p,d,r.width,r.height*i[l])}}},{key:"drawCanvasText",value:function(r,o){var a=this.canvas.getContext("2d"),i=r.fontOptions+" "+r.fontSize+"px "+r.font;if(r.displayValue){var d,l;r.textPosition=="top"?l=r.marginTop+r.fontSize-r.textMargin:l=r.height+r.textMargin+r.marginTop+r.fontSize,a.font=i,r.textAlign=="left"||o.barcodePadding>0?(d=0,a.textAlign="left"):r.textAlign=="right"?(d=o.width-1,a.textAlign="right"):(d=o.width/2,a.textAlign="center"),a.fillText(o.text,d,l)}}},{key:"moveCanvasDrawing",value:function(r){var o=this.canvas.getContext("2d");o.translate(r.width,0)}},{key:"restoreCanvas",value:function(){var r=this.canvas.getContext("2d");r.restore()}}]),t}();ot.default=Nl;var at={};Object.defineProperty(at,"__esModule",{value:!0});var Sl=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),kl=Y,$l=wl(kl),Ve=D;function wl(t){return t&&t.__esModule?t:{default:t}}function Al(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var de="http://www.w3.org/2000/svg",Dl=function(){function t(e,r,o){Al(this,t),this.svg=e,this.encodings=r,this.options=o,this.document=o.xmlDocument||document}return Sl(t,[{key:"render",value:function(){var r=this.options.marginLeft;this.prepareSVG();for(var o=0;o<this.encodings.length;o++){var a=this.encodings[o],i=(0,$l.default)(this.options,a.options),d=this.createGroup(r,i.marginTop,this.svg);this.setGroupOptions(d,i),this.drawSvgBarcode(d,i,a),this.drawSVGText(d,i,a),r+=a.width}}},{key:"prepareSVG",value:function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);(0,Ve.calculateEncodingAttributes)(this.encodings,this.options);var r=(0,Ve.getTotalWidthOfEncodings)(this.encodings),o=(0,Ve.getMaximumHeightOfEncodings)(this.encodings),a=r+this.options.marginLeft+this.options.marginRight;this.setSvgAttributes(a,o),this.options.background&&this.drawRect(0,0,a,o,this.svg).setAttribute("fill",this.options.background)}},{key:"drawSvgBarcode",value:function(r,o,a){var i=a.data,d;o.textPosition=="top"?d=o.fontSize+o.textMargin:d=0;for(var l=0,p=0,u=0;u<i.length;u++)p=u*o.width+a.barcodePadding,i[u]==="1"?l++:l>0&&(this.drawRect(p-o.width*l,d,o.width*l,o.height,r),l=0);l>0&&this.drawRect(p-o.width*(l-1),d,o.width*l,o.height,r)}},{key:"drawSVGText",value:function(r,o,a){var i=this.document.createElementNS(de,"text");if(o.displayValue){var d,l;i.setAttribute("font-family",o.font),i.setAttribute("font-size",o.fontSize),o.fontOptions.includes("bold")&&i.setAttribute("font-weight","bold"),o.fontOptions.includes("italic")&&i.setAttribute("font-style","italic"),o.textPosition=="top"?l=o.fontSize-o.textMargin:l=o.height+o.textMargin+o.fontSize,o.textAlign=="left"||a.barcodePadding>0?(d=0,i.setAttribute("text-anchor","start")):o.textAlign=="right"?(d=a.width-1,i.setAttribute("text-anchor","end")):(d=a.width/2,i.setAttribute("text-anchor","middle")),i.setAttribute("x",d),i.setAttribute("y",l),i.appendChild(this.document.createTextNode(a.text)),r.appendChild(i)}}},{key:"setSvgAttributes",value:function(r,o){var a=this.svg;a.setAttribute("width",r+"px"),a.setAttribute("height",o+"px"),a.setAttribute("x","0px"),a.setAttribute("y","0px"),a.setAttribute("viewBox","0 0 "+r+" "+o),a.setAttribute("xmlns",de),a.setAttribute("version","1.1")}},{key:"createGroup",value:function(r,o,a){var i=this.document.createElementNS(de,"g");return i.setAttribute("transform","translate("+r+", "+o+")"),a.appendChild(i),i}},{key:"setGroupOptions",value:function(r,o){r.setAttribute("fill",o.lineColor)}},{key:"drawRect",value:function(r,o,a,i,d){var l=this.document.createElementNS(de,"rect");return l.setAttribute("x",r),l.setAttribute("y",o),l.setAttribute("width",a),l.setAttribute("height",i),d.appendChild(l),l}}]),t}();at.default=Dl;var it={};Object.defineProperty(it,"__esModule",{value:!0});var Vl=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}();function Tl(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Bl=function(){function t(e,r,o){Tl(this,t),this.object=e,this.encodings=r,this.options=o}return Vl(t,[{key:"render",value:function(){this.object.encodings=this.encodings}}]),t}();it.default=Bl;Object.defineProperty(rt,"__esModule",{value:!0});var Rl=ot,Il=lt(Rl),Cl=at,Pl=lt(Cl),Ml=it,Ll=lt(Ml);function lt(t){return t&&t.__esModule?t:{default:t}}rt.default={CanvasRenderer:Il.default,SVGRenderer:Pl.default,ObjectRenderer:Ll.default};var J={};Object.defineProperty(J,"__esModule",{value:!0});function ct(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ut(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 dt(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 jl=function(t){dt(e,t);function e(r,o){ct(this,e);var a=ut(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return a.name="InvalidInputException",a.symbology=r,a.input=o,a.message='"'+a.input+'" is not a valid input for '+a.symbology,a}return e}(Error),zl=function(t){dt(e,t);function e(){ct(this,e);var r=ut(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return r.name="InvalidElementException",r.message="Not supported type to render on",r}return e}(Error),Ul=function(t){dt(e,t);function e(){ct(this,e);var r=ut(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return r.name="NoElementException",r.message="No element to render on.",r}return e}(Error);J.InvalidInputException=jl;J.InvalidElementException=zl;J.NoElementException=Ul;Object.defineProperty(tt,"__esModule",{value:!0});var Fl=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},Gl=nt,Be=Zt(Gl),Hl=rt,Q=Zt(Hl),ql=J;function Zt(t){return t&&t.__esModule?t:{default:t}}function ft(t){if(typeof t=="string")return Xl(t);if(Array.isArray(t)){for(var e=[],r=0;r<t.length;r++)e.push(ft(t[r]));return e}else{if(typeof HTMLCanvasElement<"u"&&t instanceof HTMLImageElement)return Yl(t);if(t&&t.nodeName&&t.nodeName.toLowerCase()==="svg"||typeof SVGElement<"u"&&t instanceof SVGElement)return{element:t,options:(0,Be.default)(t),renderer:Q.default.SVGRenderer};if(typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement)return{element:t,options:(0,Be.default)(t),renderer:Q.default.CanvasRenderer};if(t&&t.getContext)return{element:t,renderer:Q.default.CanvasRenderer};if(t&&(typeof t>"u"?"undefined":Fl(t))==="object"&&!t.nodeName)return{element:t,renderer:Q.default.ObjectRenderer};throw new ql.InvalidElementException}}function Xl(t){var e=document.querySelectorAll(t);if(e.length!==0){for(var r=[],o=0;o<e.length;o++)r.push(ft(e[o]));return r}}function Yl(t){var e=document.createElement("canvas");return{element:e,options:(0,Be.default)(t),renderer:Q.default.CanvasRenderer,afterRender:function(){t.setAttribute("src",e.toDataURL())}}}tt.default=ft;var st={};Object.defineProperty(st,"__esModule",{value:!0});var Jl=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}();function Zl(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Wl=function(){function t(e){Zl(this,t),this.api=e}return Jl(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 o=r.apply(void 0,arguments);return this.api._options.valid(!0),o}catch(a){return this.handleCatch(a),this.api}}}]),t}();st.default=Wl;var Kl=Ie,P=C(Kl),Ql=Y,oe=C(Ql),ec=Qe,Wt=C(ec),tc=et,$t=C(tc),nc=tt,rc=C(nc),oc=ge,ac=C(oc),ic=st,lc=C(ic),Kt=J,cc=ye,Qt=C(cc);function C(t){return t&&t.__esModule?t:{default:t}}var R=function(){},be=function(e,r,o){var a=new R;if(typeof e>"u")throw Error("No element to render on was provided.");return a._renderProperties=(0,rc.default)(e),a._encodings=[],a._options=Qt.default,a._errorHandler=new lc.default(a),typeof r<"u"&&(o=o||{},o.format||(o.format=tn()),a.options(o)[o.format](r,o).render()),a};be.getModule=function(t){return P.default[t]};for(var wt in P.default)P.default.hasOwnProperty(wt)&&uc(P.default,wt);function uc(t,e){R.prototype[e]=R.prototype[e.toUpperCase()]=R.prototype[e.toLowerCase()]=function(r,o){var a=this;return a._errorHandler.wrapBarcodeCall(function(){o.text=typeof o.text>"u"?void 0:""+o.text;var i=(0,oe.default)(a._options,o);i=(0,ac.default)(i);var d=t[e],l=en(r,d,i);return a._encodings.push(l),a})}}function en(t,e,r){t=""+t;var o=new e(t,r);if(!o.valid())throw new Kt.InvalidInputException(o.constructor.name,t);var a=o.encode();a=(0,Wt.default)(a);for(var i=0;i<a.length;i++)a[i].options=(0,oe.default)(r,a[i].options);return a}function tn(){return P.default.CODE128?"CODE128":Object.keys(P.default)[0]}R.prototype.options=function(t){return this._options=(0,oe.default)(this._options,t),this};R.prototype.blank=function(t){var e=new Array(t+1).join("0");return this._encodings.push({data:e}),this};R.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,oe.default)(this._options,t.options);r.format=="auto"&&(r.format=tn()),this._errorHandler.wrapBarcodeCall(function(){var o=r.value,a=P.default[r.format.toUpperCase()],i=en(o,a,r);Re(t,i,r)})}}};R.prototype.render=function(){if(!this._renderProperties)throw new Kt.NoElementException;if(Array.isArray(this._renderProperties))for(var t=0;t<this._renderProperties.length;t++)Re(this._renderProperties[t],this._encodings,this._options);else Re(this._renderProperties,this._encodings,this._options);return this};R.prototype._defaults=Qt.default;function Re(t,e,r){e=(0,Wt.default)(e);for(var o=0;o<e.length;o++)e[o].options=(0,oe.default)(r,e[o].options),(0,$t.default)(e[o].options);(0,$t.default)(r);var a=t.renderer,i=new a(t.element,e,r);i.render(),t.afterRender&&t.afterRender()}typeof window<"u"&&(window.JsBarcode=be);typeof jQuery<"u"&&(jQuery.fn.JsBarcode=function(t,e){var r=[];return jQuery(this).each(function(){r.push(this)}),be(r,t,e)});var dc=be;const fc=un(dc),sc=n.defineComponent({__name:"barCode",props:{text:{type:String,required:!1}},setup(t){const e=t,{text:r}=n.toRefs(e),o=n.ref(null),a={format:"CODE128",lineColor:"#000",width:2,height:100,displayValue:!1,fontOptions:"",font:"monospace",textAlign:"center",textPosition:"bottom",textMargin:2,fontSize:20,background:"#fff",margin:10,marginTop:void 0,marginBottom:void 0,marginLeft:void 0,marginRight:void 0};function i(){fc(o.value,r.value,a)}return n.onMounted(()=>{i()}),n.watch(()=>e.text,()=>{i()}),(d,l)=>n.unref(r)?(n.openBlock(),n.createElementBlock("svg",{key:0,id:"canvas",ref_key:"canvas",ref:o,class:"flex flex-col items-center justify-center w-full h-full",viewbox:"0 0 210 500",preserveAspectRatio:"none"},null,512)):n.createCommentVNode("",!0)}});function nn(t,e){if(t==null||t==="")return e==="decimal"?"0.00":"$0.00";const r=typeof t=="string"?parseFloat(t):t;return isNaN(r)?e==="decimal"?"0.00":"$0.00":e==="decimal"?r.toFixed(2):new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(r)}function At(t,e=2){return Math.round((t+Number.EPSILON)*Math.pow(10,e))/Math.pow(10,e)}function hc(t,e){return t?String(t):""}const vc={class:"flex gap-2"},mc={class:"flex flex-col justify-between w-full m-1"},pc={class:"flex items-center p-1 flex-1"},_c={key:0,class:"text-red-600 font-bold text-4xl text-center w-full"},Ec=["src"],gc={class:"w-full border rounded-lg"},yc={key:0,class:"text-center"},bc={class:"text-center text-2xl"},Oc={class:"text-xs"},xc={class:"flex-none flex"},Nc={key:0,class:"flex-none flex pr-2"},Sc={key:1,class:"flex"},kc={class:"flex gap-2"},$c={key:2,class:"text-center w-full"},wc={class:"pr-1 font-bold text-red-800"},Ac={key:3,class:"flex w-full justify-center bg-accented p-2 mb-1"},Dc={class:"pr-1 font-bold"},Vc={key:4,class:"flex w-full justify-center bg-accented rounded-lg p-2 mb-1"},Tc={class:"border rounded-lg w-full m-1 overflow-x-auto p-1"},Bc={class:"mx-4 text-2xl"},Rc={class:"text-center text-3xl bg-accented"},Ic={class:"text-sm"},Cc={class:"text-center text-2xl"},Pc={class:"text-center text-clave text-xs"},Mc={key:0,class:"flex"},Lc={class:"flex"},jc={class:"flex"},zc={class:"text-center text-clave text-xs"},Uc={class:"w-full p-2"},ae=n.defineComponent({__name:"headDoc",props:{document:{type:typeof Document<"u"?Document:Object,required:!0},dateAuthorization:{type:String||void 0,default:void 0},logoUrl:{type:String,required:!1,default:void 0}},setup(t){const e=t,r=n.computed(()=>{var f;const d=e.document,l=d==null?void 0:d.getElementsByTagName("infoTributaria");if(!l)return{};const p={},u=(f=l.item(0))==null?void 0:f.children;if(u)for(let c=0;c<u.length;c++){const h=u[c];h!=null&&h.tagName&&(p[h.tagName||"na"]=h.textContent||"")}return p}),o=n.computed(()=>{var d,l;if((d=r.value)!=null&&d.claveAcceso){const p=k.getDataAccessKey((l=r.value)==null?void 0:l.claveAcceso);return p?p.typeWithName:""}return""}),a=n.computed(()=>{var c;const d=e.document;if(!d)return{};const l=["infoFactura","infoNotaCredito","infoGuiaRemision","infoCompRetencion"];let p=null;for(const h of l){const E=d.getElementsByTagName(h);if(E&&E.length>0){p=E;break}}if(!p)return{};const u={},f=(c=p.item(0))==null?void 0:c.children;if(f)for(let h=0;h<f.length;h++){const E=f[h];E!=null&&E.tagName&&(u[E.tagName]=E.textContent||"")}return u}),i=n.computed(()=>{var d,l;if((d=r.value)!=null&&d.claveAcceso){const p=k.getDataAccessKey((l=r.value)==null?void 0:l.claveAcceso);if(p)return p.mode==="2"?"PRODUCCIÓN":"PRUEBAS"}return""});return(d,l)=>(n.openBlock(),n.createElementBlock("div",vc,[n.createElementVNode("div",mc,[n.createElementVNode("div",pc,[t.logoUrl?(n.openBlock(),n.createElementBlock("img",{key:1,src:t.logoUrl,alt:"Logo",class:"w-full h-full object-contain"},null,8,Ec)):(n.openBlock(),n.createElementBlock("div",_c," NO TIENE LOGO "))]),n.createElementVNode("div",gc,[r.value.nombreComercial?(n.openBlock(),n.createElementBlock("div",yc,[n.createElementVNode("strong",null,n.toDisplayString(r.value.nombreComercial),1)])):n.createCommentVNode("",!0),n.createElementVNode("div",bc,[n.createElementVNode("strong",null,n.toDisplayString(r.value.razonSocial),1)]),n.createElementVNode("div",Oc,[n.createElementVNode("div",xc,[l[0]||(l[0]=n.createElementVNode("div",{class:"font-bold pr-2"}," Dirección Matriz ",-1)),n.createElementVNode("div",null,n.toDisplayString(r.value.dirMatriz),1)]),a.value.dirEstablecimiento?(n.openBlock(),n.createElementBlock("div",Nc,[l[1]||(l[1]=n.createElementVNode("div",{class:"font-bold pr-2"}," Dirección Sucursal ",-1)),n.createElementVNode("div",null,n.toDisplayString(a.value.dirEstablecimiento),1)])):n.createCommentVNode("",!0),a.value.contribuyenteEspecial?(n.openBlock(),n.createElementBlock("div",Sc,[l[2]||(l[2]=n.createElementVNode("div",{class:"pr-1 font-bold"}," CONTRIBUYENTE ESPECIAL ",-1)),n.createElementVNode("div",null,n.toDisplayString(a.value.contribuyenteEspecial),1)])):n.createCommentVNode("",!0),n.createElementVNode("div",kc,[l[3]||(l[3]=n.createElementVNode("div",{class:"pr-1 font-bold"}," OBLIGADO A LLEVAR CONTABILIDAD ",-1)),n.createElementVNode("div",null,n.toDisplayString(a.value.obligadoContabilidad),1)]),r.value.agenteRetencion?(n.openBlock(),n.createElementBlock("div",$c,[l[4]||(l[4]=n.createElementVNode("span",{class:"pr-1 font-bold"},"Agente de Retencion",-1)),n.createElementVNode("span",wc," Nº "+n.toDisplayString(r.value.agenteRetencion),1)])):n.createCommentVNode("",!0),r.value.contribuyenteRimpe?(n.openBlock(),n.createElementBlock("div",Ac,[n.createElementVNode("span",Dc,[r.value.contribuyenteRimpe==="CONTRIBUYENTE RÉGIMEN RIMPE"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createTextVNode(" CONTRIBUYENTE RÉGIMEN RIMPE ")],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createTextVNode(n.toDisplayString(r.value.contribuyenteRimpe),1)],64))])])):r.value.contribuyenteEspecial?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",Vc,[...l[5]||(l[5]=[n.createElementVNode("span",{class:"pr-1 font-bold"}," CONTRIBUYENTE RÉGIMEN GENERAL ",-1)])]))])])]),n.createElementVNode("div",Tc,[n.createElementVNode("div",null,[n.createElementVNode("strong",null,[l[6]||(l[6]=n.createElementVNode("span",{class:"text-2xl"}," R.U.C ",-1)),l[7]||(l[7]=n.createTextVNode()),n.createElementVNode("span",Bc,n.toDisplayString(r.value.ruc),1)])]),n.createElementVNode("div",Rc,[n.createElementVNode("strong",null,n.toDisplayString(o.value),1)]),n.createElementVNode("div",Ic,[n.createElementVNode("div",null,[l[8]||(l[8]=n.createElementVNode("div",{class:"font-bold"}," NUMERO COMPROBANTE ",-1)),n.createElementVNode("div",Cc,n.toDisplayString(r.value.estab)+"-"+n.toDisplayString(r.value.ptoEmi)+"-"+n.toDisplayString(r.value.secuencial),1)]),l[13]||(l[13]=n.createElementVNode("div",{class:"font-bold"}," NUMERO DE AUTORIZACIÓN ",-1)),n.createElementVNode("div",Pc,n.toDisplayString(r.value.claveAcceso),1),t.dateAuthorization?(n.openBlock(),n.createElementBlock("div",Mc,[l[9]||(l[9]=n.createElementVNode("div",{class:"font-bold pr-2"}," FECHA AUTORIZACIÓN ",-1)),n.createElementVNode("div",null,n.toDisplayString(n.unref(hc)(t.dateAuthorization,"dd/mm/yyyy HH:mm:ss")||"SRI"),1)])):n.createCommentVNode("",!0),n.createElementVNode("div",Lc,[l[10]||(l[10]=n.createElementVNode("div",{class:"font-bold pr-2"}," AMBIENTE ",-1)),n.createElementVNode("div",null,n.toDisplayString(i.value),1)]),n.createElementVNode("div",jc,[l[11]||(l[11]=n.createElementVNode("div",{class:"font-bold pr-2"}," EMISIÓN ",-1)),n.createElementVNode("div",null,n.toDisplayString(r.value.tipoEmision==="1"?"NORMAL":"ERROR"),1)]),l[14]||(l[14]=n.createElementVNode("div",{class:"text-center font-bold"}," CLAVE DE ACCESO ",-1)),n.createElementVNode("div",zc,n.toDisplayString(r.value.claveAcceso),1),n.createElementVNode("div",Uc,[n.createVNode(sc,{class:"flex-1 barcode",text:r.value.claveAcceso},null,8,["text"]),l[12]||(l[12]=n.createElementVNode("div",{id:"barcode"},null,-1))])])])]))}}),Fc={class:"w-full text-xs border border-accented"},Gc={class:"text-right border pr-1 border-accented"},Hc={class:"text-right w-24 border border-accented"},rn=n.defineComponent({__name:"tableSubtotals",props:{data:{type:typeof Document<"u"?Document:Object,required:!0}},setup(t){const e=t;return(r,o)=>(n.openBlock(),n.createElementBlock("table",Fc,[n.createElementVNode("tbody",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(k.getTotals)(e.data),(a,i)=>(n.openBlock(),n.createElementBlock("tr",{key:i},[n.createElementVNode("td",Gc,n.toDisplayString(a.name),1),n.createElementVNode("td",Hc,n.toDisplayString(n.unref(nn)(a.valor,"decimal")),1)]))),128))])]))}}),qc={class:"bg-white! font-sans antialiased text-gray-800 max-w-6xl mx-auto print:mx-0 print:w-full text-black m-1 rounded-md p-1 printContent"},Xc={key:0,class:"print:hidden flex justify-end"},Yc={class:"font-bold text-green-700"},Jc={class:"flex mt-2 text-sm"},Zc={class:"border rounded-lg w-full px-1"},Wc={class:"flex-none flex"},Kc={class:"flex-none flex gap-x-2"},Qc={class:"font-bold pr-2"},eu={class:"flex-none flex"},tu={key:0},nu={key:0,class:"flex-none flex"},ru={class:"overflow-x-auto mt-1"},ou={class:"w-full table-bordered text-xs"},au={class:"flex justify-between gap-2"},iu={class:"flex-1"},lu={key:0,class:"text-center"},cu={key:1,class:"mb-1"},uu={class:"text-xs w-full table-fixed border border-accented"},du={class:"w-[100px] break-words !p-0 !pr-1 border border-accented"},fu={class:"break-words !p-0 !pl-1 border-b border-accented"},su={key:2,class:"w-full text-xs border border-accented"},hu={class:"text-center"},vu={class:"text-right"},mu={class:"text-right"},pu={class:""},_u={class:"rounded-lg mt-1 min-w-[400px]"},Eu={class:"w-full text-xs"},on=n.defineComponent({__name:"factura",props:{document:{type:typeof Document<"u"?Document:Object,required:!0},dateAuthorization:{type:String,required:!1,default:void 0},logoUrl:{type:String,required:!1,default:void 0}},setup(t){const e=t,r=k.getInfoFactura(e.document),o=k.getInfoAdicional(e.document),a=k.getPagos(e.document),i=n.computed(()=>{var f;const u=(f=k.TYPE_IDENTITY.find(c=>c.value==r.tipoIdentificacionComprador))==null?void 0:f.label;return u||"NO ENCONTRADO"}),d=k.getDetailsFc(e.document);function l(){if(d.length===0)return[];const u=d.some(E=>E.codigoAuxiliar),f=d.some(E=>E.unidadMedida),c=d[0],h=["#"];return c!=null&&c.codigoPrincipal&&h.push("COD"),u&&h.push("COD.aux"),c!=null&&c.descripcion&&h.push("Descripcion"),c!=null&&c.cantidad&&h.push("CANT"),f&&h.push("UNIDAD"),c!=null&&c.precioUnitario&&h.push("PVP"),c!=null&&c.descuento&&h.push("DESC"),c!=null&&c.detallesAdicionales&&(c==null||c.detallesAdicionales.detAdicional.forEach(E=>{h.push(E["@nombre"])})),c!=null&&c.precioTotalSinImpuesto&&h.push("TOTAL"),h}function p(){let u=[];const f=[];let c=[];u=d;const h=u.some(_=>_.codigoAuxiliar),E=u.some(_=>_.unidadMedida);return u.forEach((_,S)=>{c=[],c.push({valor:S+1,clase:"text-center"}),_.codigoPrincipal&&c.push({valor:_.codigoPrincipal}),h&&c.push({valor:_.codigoAuxiliar??""}),_.descripcion&&c.push({valor:_.descripcion}),_.cantidad&&c.push({valor:_.cantidad,clase:"text-right"}),E&&c.push({valor:_.unidadMedida??"",clase:"text-right"}),_.precioUnitario&&c.push({valor:_.precioUnitario,clase:"text-right"}),_.descuento&&c.push({valor:_.descuento,clase:"text-right"}),_.detallesAdicionales&&_.detallesAdicionales.detAdicional.forEach(m=>{c.push({valor:m["@valor"]})}),_.precioTotalSinImpuesto&&c.push({valor:_.precioTotalSinImpuesto,clase:"text-right"}),f.push(c)}),f}return(u,f)=>(n.openBlock(),n.createElementBlock("div",qc,[t.dateAuthorization?(n.openBlock(),n.createElementBlock("div",Xc,[n.createElementVNode("div",Yc," Documento autorizado el "+n.toDisplayString(t.dateAuthorization??"SIN FECHA"),1)])):n.createCommentVNode("",!0),n.createVNode(ae,{document:t.document,logoUrl:t.logoUrl,dateAuthorization:t.dateAuthorization},null,8,["document","logoUrl","dateAuthorization"]),n.createElementVNode("div",Jc,[n.createElementVNode("div",Zc,[n.createElementVNode("div",Wc,[f[0]||(f[0]=n.createElementVNode("div",{class:"font-bold pr-2"}," Razón Social / Nombres y Apellidos : ",-1)),n.createElementVNode("div",null,n.toDisplayString(n.unref(r).razonSocialComprador||"no hay"),1)]),n.createElementVNode("div",Kc,[f[1]||(f[1]=n.createElementVNode("div",{class:"font-bold"}," Identificación: ",-1)),n.createElementVNode("div",null,n.toDisplayString(n.unref(r).identificacionComprador||"no hay"),1),n.createElementVNode("div",Qc,n.toDisplayString(n.unref(r).tipoIdentificacionComprador)+": "+n.toDisplayString(i.value),1)]),n.createElementVNode("div",eu,[f[2]||(f[2]=n.createElementVNode("div",{class:"font-bold pr-2"}," FECHA EMISION: ",-1)),n.createElementVNode("div",null,n.toDisplayString(n.unref(r).fechaEmision),1),f[3]||(f[3]=n.createElementVNode("div",{class:"font-bold pr-2 pl-4"}," GUIA: ",-1)),n.unref(r).guiaRemision?(n.openBlock(),n.createElementBlock("div",tu,n.toDisplayString(n.unref(r).guiaRemision),1)):n.createCommentVNode("",!0)]),n.unref(r).direccionComprador?(n.openBlock(),n.createElementBlock("div",nu,[f[4]||(f[4]=n.createElementVNode("div",{class:"font-bold pr-2"}," Dirección: ",-1)),n.createElementVNode("div",null,n.toDisplayString(n.unref(r).direccionComprador),1)])):n.createCommentVNode("",!0)])]),n.createElementVNode("div",ru,[n.createElementVNode("table",ou,[n.createElementVNode("thead",null,[n.createElementVNode("tr",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l(),(c,h)=>(n.openBlock(),n.createElementBlock("th",{key:h,class:"border"},n.toDisplayString(c),1))),128))])]),n.createElementVNode("tbody",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(p(),(c,h)=>(n.openBlock(),n.createElementBlock("tr",{key:h},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(c,(E,_)=>(n.openBlock(),n.createElementBlock("td",{key:_,class:n.normalizeClass(["break-words border",E.clase?E.clase:""])},n.toDisplayString(E.valor),3))),128))]))),128))])])]),n.createElementVNode("div",au,[n.createElementVNode("div",iu,[n.unref(o)?(n.openBlock(),n.createElementBlock("div",lu," Información Adicional ")):n.createCommentVNode("",!0),n.unref(o)?(n.openBlock(),n.createElementBlock("div",cu,[n.createElementVNode("table",uu,[n.createElementVNode("tbody",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(o),(c,h)=>(n.openBlock(),n.createElementBlock("tr",{key:h},[n.createElementVNode("td",du,n.toDisplayString(c.name),1),n.createElementVNode("td",fu,n.toDisplayString(c.value),1)]))),128))])])])):n.createCommentVNode("",!0),n.unref(a)?(n.openBlock(),n.createElementBlock("table",su,[f[5]||(f[5]=n.createElementVNode("thead",null,[n.createElementVNode("tr",null,[n.createElementVNode("th",{class:""}," Forma de pago "),n.createElementVNode("th",{class:""}," Valor "),n.createElementVNode("th",{class:""}," PAZO "),n.createElementVNode("th",{class:""}," TIEMPO ")])],-1)),n.createElementVNode("tbody",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(a),(c,h)=>(n.openBlock(),n.createElementBlock("tr",{key:h},[n.createElementVNode("td",hu,n.toDisplayString(c.formaPago),1),n.createElementVNode("td",vu,n.toDisplayString(c.total),1),n.createElementVNode("td",mu,n.toDisplayString(c.plazo),1),n.createElementVNode("td",pu,n.toDisplayString(c.unidadTiempo),1)]))),128))])])):n.createCommentVNode("",!0)]),n.createElementVNode("div",_u,[n.createElementVNode("table",Eu,[n.createVNode(rn,{data:t.document},null,8,["data"])])])])]))}}),gu={class:"max-w-5xl mx-auto print:border bg-gray-50 text-black m-1 rounded-md p-1 printContent print:mx-0 print:w-screen"},yu={key:0,class:"print:hidden flex justify-end"},bu={class:"font-bold text-green-700"},Ou={class:"border rounded-lg w-full mt-8"},xu={class:"flex-none flex"},Nu={class:"font-bold mx-2"},Su={class:"flex"},ku={class:"flex"},$u={class:"flex gap-x-2"},wu={class:"mx-10"},Au={class:"flex"},Du={class:"flex justify-between items-center"},Vu={class:"font-bold text-2xl"},Tu={class:"border rounded-lg w-full mt-8"},Bu={class:"overflow-x-auto"},Ru={class:"w-full table-bordered text-xs"},Iu={class:"flex justify-center flex-wrap"},Cu={class:"border rounded-lg w-1/2"},Pu={key:0,class:"text-xs w-full table-fixed"},Mu={class:"break-words font-bold"},Lu={class:"w-full break-words"},ju={class:"rounded-lg w-1/2"},an=n.defineComponent({__name:"notaCredito",props:{document:{type:typeof Document<"u"?Document:Object,required:!0},authorization:{type:String,required:!1,default:void 0},logoUrl:{type:String,required:!1,default:void 0}},setup(t){const e=t;n.computed(()=>k.getInfoTributaria(e.document));const r=n.computed(()=>k.getInfoAdicional(e.document)),o=n.computed(()=>k.getDetailsFc(e.document)),a=n.computed(()=>{const p=e.document.getElementsByTagName("infoNotaCredito");if(!p||p.length===0)return{};const u=p[0],f={};for(let c=0;c<u.children.length;c++){const h=u.children[c];f[h.tagName]=h.textContent||""}return f});function i(p,u=0){switch(u){case 0:switch(p){case"05":return"Cedula";case"04":return"RUC";case"06":return"Pasaporte";case"07":return"Consumidor final";case"08":return"Identificacion extranjera";case"09":return"Placa"}break;case 1:switch(p){case"01":return"FACTURA";case"04":return"NOTA DE CREDITO";case"05":return"NOTA DE DEBITO";case"06":return"GUIA DE REMISION";case"07":return"COMPROBANTE DE RETENCION";default:return"FACTURA"}case 2:switch(p){case"2":return"RENTA";case"1":return"IVA"}}return""}function d(){if(o.value.length===0)return[];const p=o.value[0],u=["#"];return p.codigoPrincipal&&u.push("COD"),p.codigoAuxiliar&&u.push("COD.aux"),p.descripcion&&u.push("Descripcion"),p.cantidad&&u.push("CANT"),p.precioUnitario&&u.push("PVP"),p.descuento&&u.push("DESC"),p.precioTotalSinImpuesto&&u.push("TOTAL"),u}function l(){const p=[];return o.value.forEach((u,f)=>{const c=[];c.push({valor:f+1}),u.codigoPrincipal&&c.push({valor:u.codigoPrincipal}),u.codigoAuxiliar&&c.push({valor:u.codigoAuxiliar}),u.descripcion&&c.push({valor:u.descripcion}),u.cantidad&&c.push({valor:u.cantidad,clase:"text-right"}),u.precioUnitario&&c.push({valor:u.precioUnitario,clase:"text-right"}),u.descuento&&c.push({valor:u.descuento,clase:"text-right"}),u.precioTotalSinImpuesto&&c.push({valor:u.precioTotalSinImpuesto,clase:"text-right"}),p.push(c)}),p}return(p,u)=>(n.openBlock(),n.createElementBlock("div",gu,[t.authorization?(n.openBlock(),n.createElementBlock("div",yu,[n.createElementVNode("div",bu," Documento autorizado el "+n.toDisplayString(t.authorization),1)])):n.createCommentVNode("",!0),n.createVNode(ae,{document:t.document,logoUrl:t.logoUrl,dateAuthorization:t.authorization},null,8,["document","logoUrl","dateAuthorization"]),n.createElementVNode("div",Ou,[n.createElementVNode("div",xu,[u[0]||(u[0]=n.createElementVNode("div",{class:"font-bold pr-2"}," Razón Social / Nombres y Apellidos : ",-1)),n.createElementVNode("div",null,n.toDisplayString(a.value.razonSocialComprador),1),u[1]||(u[1]=n.createElementVNode("div",{class:"font-bold pr-2 mx-2"}," Identificacion : ",-1)),n.createElementVNode("div",null,n.toDisplayString(a.value.identificacionComprador),1),n.createElementVNode("div",Nu," ("+n.toDisplayString(i(a.value.tipoIdentificacionComprador,0))+") ",1)]),n.createElementVNode("div",Su,[n.createElementVNode("div",ku,[u[2]||(u[2]=n.createElementVNode("div",{class:"font-bold pr-2"}," Fecha Emisión : ",-1)),n.createElementVNode("div",null,n.toDisplayString(a.value.fechaEmision),1)])]),u[7]||(u[7]=n.createElementVNode("div",{class:"px-10 py-4"},[n.createElementVNode("hr")],-1)),n.createElementVNode("div",null,[n.createElementVNode("div",$u,[u[3]||(u[3]=n.createElementVNode("div",{class:"font-bold pr-2"}," Comprobante que se modifica : ",-1)),n.createElementVNode("div",null,n.toDisplayString(i(a.value.codDocModificado,1)),1),n.createElementVNode("div",wu,n.toDisplayString(a.value.numDocModificado),1)]),n.createElementVNode("div",Au,[u[4]||(u[4]=n.createElementVNode("div",{class:"font-bold pr-2"}," Fecha Emision (Comprobante a modificar) : ",-1)),n.createElementVNode("div",null,n.toDisplayString(a.value.fechaEmisionDocSustento),1)]),n.createElementVNode("div",Du,[u[5]||(u[5]=n.createElementVNode("div",{class:"font-bold pr-2"}," Razón de Modificación: ",-1)),n.createElementVNode("div",Vu,n.toDisplayString(a.value.motivo),1),u[6]||(u[6]=n.createElementVNode("div",{class:"mx-10"},null,-1))])])]),n.createElementVNode("div",Tu,[n.createElementVNode("div",Bu,[n.createElementVNode("table",Ru,[n.createElementVNode("thead",null,[n.createElementVNode("tr",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d(),(f,c)=>(n.openBlock(),n.createElementBlock("th",{key:c,class:"border"},n.toDisplayString(f),1))),128))])]),n.createElementVNode("tbody",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l(),(f,c)=>(n.openBlock(),n.createElementBlock("tr",{key:c},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(f,(h,E)=>(n.openBlock(),n.createElementBlock("td",{key:E,class:n.normalizeClass(["break-words border",h.clase?h.clase:""])},n.toDisplayString(h.valor),3))),128))]))),128))])])]),n.createElementVNode("div",Iu,[n.createElementVNode("div",Cu,[u[8]||(u[8]=n.createElementVNode("div",{class:"text-center"}," Información Adicional ",-1)),n.createElementVNode("div",null,[r.value&&r.value.length>0?(n.openBlock(),n.createElementBlock("table",Pu,[n.createElementVNode("tbody",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(r.value,(f,c)=>(n.openBlock(),n.createElementBlock("tr",{key:c},[n.createElementVNode("td",Mu,n.toDisplayString(f.name),1),n.createElementVNode("td",Lu,n.toDisplayString(f.value),1)]))),128))])])):n.createCommentVNode("",!0)])]),n.createElementVNode("div",ju,[n.createVNode(rn,{data:t.document},null,8,["data"])])])])]))}}),zu={class:"text-xs flex flex-col gap-2 max-w-5xl mx-auto bg-gray-50 text-black m-1 rounded-md p-1 printContent print:mx-0 print:w-full"},Uu={key:0,class:"print:hidden flex justify-end"},Fu={class:"font-bold text-green-700"},Gu={class:"border rounded-lg p-2 mt-2"},Hu={class:"grid grid-cols-2 gap-2"},qu={class:"bg-gray-200 px-2 py-0.5 rounded font-mono font-bold"},Xu={class:"grid grid-cols-[200px_1fr]"},Yu={class:"font-bold uppercase"},Ju={class:"ml-5"},Zu={class:"font-bold"},Wu={class:"font-bold"},Ku={class:"font-bold"},Qu={class:"font-bold"},ed={class:"font-bold"},td={class:"font-bold"},nd={class:"font-bold"},rd={class:"p-4"},od={class:"w-full border border-accented text-xs"},ad={class:"bg-accented text-left text-gray-700"},id={key:1,class:"mx-20"},ld={class:"text-xs w-full table-fixed border border-accented"},cd={class:"w-1/3 break-words !p-1 border font-bold bg-gray-50"},ud={class:"w-2/3 break-words !p-1 border"},ln=n.defineComponent({__name:"guiaRemision",props:{document:{type:typeof Document<"u"?Document:Object,required:!0},authorization:{type:String,required:!1,default:void 0},logoUrl:{type:String,required:!1,default:void 0}},setup(t){const e=t,r=n.computed(()=>{const u=e.document,f=u==null?void 0:u.getElementsByTagName("infoGuiaRemision").item(0);if(!f)return{};const c={};for(let h=0;h<f.children.length;h++){const E=f.children[h];c[E.tagName]=E.textContent||""}return c}),o=n.computed(()=>{const u=e.document,f=u==null?void 0:u.getElementsByTagName("destinatario");if(!f)return[];const c=[];for(let h=0;h<f.length;h++){const E=f.item(h);if(!E)continue;const _={};for(let m=0;m<E.children.length;m++){const s=E.children[m];s.tagName!=="detalles"&&(_[s.tagName]=s.textContent||"")}_.detalles=[];const S=E.getElementsByTagName("detalle");for(let m=0;m<S.length;m++){const s=S.item(m);if(!s)continue;const v={};for(let g=0;g<s.children.length;g++){const b=s.children[g];if(b.tagName==="detallesAdicionales"){v.detallesAdicionales=[];const y=b.getElementsByTagName("detAdicional");for(let O=0;O<y.length;O++){const N=y.item(O);N&&v.detallesAdicionales.push({nombre:N.getAttribute("nombre")||"",valor:N.getAttribute("valor")||N.textContent||""})}}else v[b.tagName]=b.textContent||""}_.detalles.push(v)}c.push(_)}return c}),a=k.getInfoAdicional(e.document);function i(u){const f=new Set;return u.forEach(c=>{c.detallesAdicionales&&Array.isArray(c.detallesAdicionales)&&c.detallesAdicionales.forEach(h=>{h.nombre&&f.add(h.nombre)})}),Array.from(f)}function d(u){if(u.length===0)return[];const f=[{label:"#",headerClassName:"text-center"}];return f.push({label:"CANT",headerClassName:"text-center"}),f.push({label:"Descripción"}),u.some(_=>_.codigoInterno)&&f.push({label:"Còdigo Princial"}),u.some(_=>_.codigoAdicional)&&f.push({label:"COD.aux"}),i(u).forEach(_=>{f.push({label:_})}),f}function l(u){const f=[],c=u.some(_=>_.codigoInterno),h=u.some(_=>_.codigoAdicional),E=i(u);return u.forEach((_,S)=>{const m=[];m.push({valor:S+1,clase:"text-center"}),m.push({valor:_.cantidad||"0",clase:"text-right font-bold"}),m.push({valor:_.descripcion||""}),c&&m.push({valor:_.codigoInterno||""}),h&&m.push({valor:_.codigoAdicional||""}),E.forEach(s=>{let v="";if(_.detallesAdicionales&&Array.isArray(_.detallesAdicionales)){const g=_.detallesAdicionales.find(b=>b.nombre===s);g&&(v=g.valor)}m.push({valor:v})}),f.push(m)}),f}function p(u){switch(u){case"01":return"Factura";case"04":return"Nota de Crédito";case"05":return"Nota de Débito";default:return"Comprobante"}}return(u,f)=>(n.openBlock(),n.createElementBlock("div",zu,[t.authorization?(n.openBlock(),n.createElementBlock("div",Uu,[n.createElementVNode("div",Fu," Documento autorizado el "+n.toDisplayString(t.authorization),1)])):n.createCommentVNode("",!0),n.createVNode(ae,{document:t.document,dateAuthorization:t.authorization,logoUrl:t.logoUrl},null,8,["document","dateAuthorization","logoUrl"]),n.createElementVNode("div",Gu,[n.createElementVNode("div",Hu,[n.createElementVNode("div",null,[f[0]||(f[0]=n.createElementVNode("span",{class:"font-bold"},"Transportista (Razón Social):",-1)),n.createTextVNode(" "+n.toDisplayString(r.value.razonSocialTransportista),1)]),n.createElementVNode("div",null,[f[1]||(f[1]=n.createElementVNode("span",{class:"font-bold"},"R.U.C. / C.I.:",-1)),n.createTextVNode(" "+n.toDisplayString(r.value.rucTransportista),1)]),n.createElementVNode("div",null,[f[2]||(f[2]=n.createElementVNode("span",{class:"font-bold"},"Placa del Vehículo:",-1)),f[3]||(f[3]=n.createTextVNode()),n.createElementVNode("span",qu,n.toDisplayString(r.value.placa),1)]),n.createElementVNode("div",null,[f[4]||(f[4]=n.createElementVNode("span",{class:"font-bold"},"Punto de Partida:",-1)),n.createTextVNode(" "+n.toDisplayString(r.value.dirPartida),1)]),n.createElementVNode("div",null,[f[5]||(f[5]=n.createElementVNode("span",{class:"font-bold"},"Fecha Inicio Transporte:",-1)),n.createTextVNode(" "+n.toDisplayString(r.value.fechaIniTransporte),1)]),n.createElementVNode("div",null,[f[6]||(f[6]=n.createElementVNode("span",{class:"font-bold"},"Fecha Fin Transporte:",-1)),n.createTextVNode(" "+n.toDisplayString(r.value.fechaFinTransporte),1)])])]),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(o.value,(c,h)=>(n.openBlock(),n.createElementBlock("div",{key:h,class:"border rounded-lg p-2 mt-2"},[n.createElementVNode("div",Xu,[c.numDocSustento?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[f[8]||(f[8]=n.createElementVNode("div",null," Comprobante de venta: ",-1)),n.createElementVNode("div",null,[n.createElementVNode("span",Yu,n.toDisplayString(p(c.codDocSustento??""))+" "+n.toDisplayString(c.numDocSustento),1),n.createElementVNode("span",Ju,[f[7]||(f[7]=n.createTextVNode(" Fecha de emisión: ",-1)),n.createElementVNode("span",Zu,n.toDisplayString(c.fechaEmisionDocSustento),1)])]),f[9]||(f[9]=n.createElementVNode("div",null," Numero de autorización: ",-1)),n.createElementVNode("div",null,[n.createElementVNode("span",Wu,n.toDisplayString(c.numAutDocSustento),1)])],64)):n.createCommentVNode("",!0),f[10]||(f[10]=n.createElementVNode("div",null," Motivo de Traslado: ",-1)),n.createElementVNode("div",Ku,n.toDisplayString(c.motivoTraslado),1),f[11]||(f[11]=n.createElementVNode("div",null," DESTINO (punto de llegada) : ",-1)),n.createElementVNode("div",Qu,n.toDisplayString(c.dirDestinatario),1),f[12]||(f[12]=n.createElementVNode("div",null," Identificación(Destinatario) : ",-1)),n.createElementVNode("div",ed,n.toDisplayString(c.identificacionDestinatario),1),f[13]||(f[13]=n.createElementVNode("div",null," Nombre / Razón Social ",-1)),n.createElementVNode("div",td,n.toDisplayString(c.razonSocialDestinatario),1),f[14]||(f[14]=n.createElementVNode("div",null," Ruta: ",-1)),n.createElementVNode("div",nd,n.toDisplayString(c.ruta??""),1)]),n.createElementVNode("div",rd,[n.createElementVNode("table",od,[n.createElementVNode("thead",null,[n.createElementVNode("tr",ad,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d(c.detalles),(E,_)=>(n.openBlock(),n.createElementBlock("th",{key:_,class:n.normalizeClass(["p-1 font-bold",E.headerClassName?E.headerClassName:""])},n.toDisplayString(E.label),3))),128))])]),n.createElementVNode("tbody",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l(c.detalles),(E,_)=>(n.openBlock(),n.createElementBlock("tr",{key:_},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(E,(S,m)=>(n.openBlock(),n.createElementBlock("td",{key:m,class:n.normalizeClass(["border border-accented p-1 break-words",S.clase?S.clase:""])},n.toDisplayString(S.valor),3))),128))]))),128))])])])]))),128)),n.unref(a)&&n.unref(a).length>0?(n.openBlock(),n.createElementBlock("div",id,[n.createElementVNode("table",ld,[f[15]||(f[15]=n.createElementVNode("thead",{class:"border"},[n.createElementVNode("tr",{class:"bg-gray-100 text-gray-700"},[n.createElementVNode("th",{colspan:"2",class:"p-1 text-center font-bold"}," INFORMACIÓN ADICIONAL ")])],-1)),n.createElementVNode("tbody",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(a),(c,h)=>(n.openBlock(),n.createElementBlock("tr",{key:h},[n.createElementVNode("td",cd,n.toDisplayString(c.name),1),n.createElementVNode("td",ud,n.toDisplayString(c.value),1)]))),128))])])])):n.createCommentVNode("",!0)]))}}),dd={class:"text-xs flex flex-col gap-1 max-w-5xl mx-auto bg-gray-50 text-black m-1 rounded-md p-1 printContent print:mx-0 print:w-full"},fd={key:0,class:"print:hidden flex justify-end"},sd={class:"font-bold text-green-700"},hd={class:"flex mt-5"},vd={class:"border rounded-lg w-full"},md={class:"flex-none flex"},pd={class:"flex-none flex"},_d={class:"mx-2 font-bold"},Ed={class:"flex-none flex"},gd={key:0},yd={key:1},bd={key:0},Od={class:"flex gap-2"},xd={class:"flex gap-2"},Nd={class:"flex gap-2"},Sd={class:"font-bold"},kd={class:"px-2 rounded-md border bg-gray-300"},$d={key:0,class:"flex mx-4"},wd={class:"flex gap-2"},Ad={class:"text-center"},Dd={key:0},Vd={class:"text-center"},Td={class:"text-center"},Bd={class:"text-center"},Rd={class:"text-center"},Id={class:"hidden"},Cd={class:"w-full"},Pd={key:0,class:"w-full text-xs"},Md={class:"border text-center"},Ld={class:"border text-right"},jd={class:"border text-right"},zd={class:"border"},Ud={class:"w-full"},Fd={key:0,class:"w-full text-xs"},Gd={class:"border text-right"},Hd={class:"border text-right"},qd={class:"border text-right"},Xd={class:"px-4 pt-4"},Yd={border:"","border-gray-500":"","mb-2":""},Jd={class:"w-full table-bordered text-xs"},Zd=["colspan"],Wd={class:"break-words border"},Kd={class:"break-words border text-center"},Qd={class:"break-words border"},ef={class:"break-words border text-right"},tf={class:"break-words border text-right"},nf={class:"break-words border text-right"},rf={class:"text-right"},of={class:"px-2 bg-gray-300"},af={key:1,class:"border border-gray-500 mt-4"},lf={border:"","border-gray-500":"","mb-2":""},cf={class:"w-full table-bordered text-xs"},uf=["colspan"],df={class:"break-words border text-center"},ff={class:"break-words border text-center"},sf={class:"break-words border"},hf={class:"break-words border"},vf={class:"break-words border text-right"},mf={class:"break-words border text-right"},pf={class:"break-words border text-right"},_f={class:"break-words border text-right"},Ef={class:"text-right"},gf={class:"px-2 bg-gray-300"},yf={class:"p-8"},bf={class:"border rounded-lg w-full mt-2"},Of={key:0,class:"text-xs w-full table-fixed"},xf={class:"w-1/3 break-words"},Nf={class:"w-full break-words"},cn=n.defineComponent({__name:"retencion",props:{document:{type:typeof Document<"u"?Document:Object,required:!0},authorization:{type:String,required:!1,default:void 0}},setup(t){const e=t,r=n.computed(()=>{var m,s;return(s=(m=e.document)==null?void 0:m.getElementsByTagName("comprobanteRetencion").item(0))==null?void 0:s.getAttribute("version")}),o=k.getInfoAdicional(e.document);function a(m){return k.nameCodeRetention(m)}function i(m,s=0){switch(s){case 0:switch(m){case"05":return"Cedula";case"04":return"RUC";case"06":return"Pasaporte";case"07":return"Consumidor final";case"08":return"Identificacion extranjera";case"09":return"Placa"}break;case 1:switch(m){case"01":return"FACTURA";case"04":return"NOTA DE CREDITO";case"05":return"NOTA DE DEBITO";case"06":return"GUIA DE REMISION";case"07":return"COMPROBANTE DE RETENCION";default:return"FACTURA"}case 2:switch(m){case"2":return"IVA";case"1":return"RENTA"}}}function d(){return["#","TIPO","CODIGO","PORCENTAJE","BASE IMPONIBLE","VALOR"]}function l(){return["Comprobante","Número","Fecha Emisión","Ejercicio Fiscal","Base Imponible para la Retención","Impuesto","Porcentaje Retención","Valor Retenido"]}function p(m){const s=m.substring(0,3),v=m.substring(3,6),g=m.substring(6,15);return`${s}-${v}-${g}`}function u(m){const s=[{name:"SIN UTILIZACION DEL SISTEMA FINANCIERO",value:"01"},{name:"COMPENSACIÓN DE DEUDAS",value:"15"},{name:"TARJETA DE DÉBITO",value:"16"},{name:"DINERO ELECTRÓNICO",value:"17"},{name:"TARJETA PREPAGO",value:"18"},{name:"TARJETA DE CRÉDITO",value:"19"},{name:"OTROS CON UTILIZACION DEL SISTEMA FINANCIERO",value:"20"},{name:"ENDOSO DE TÍTULOS",value:"21"}];return m.map(g=>{var b;return{formaPago:((b=s.find(y=>y.value===g.formaPago))==null?void 0:b.name)||"",total:g.total,plazo:g.plazo&&g.plazo||0,unidadTiempo:g.unidadTiempo&&g.unidadTiempo||0}})}function f(m){const s=[{name:"IVA",value:"2"},{name:"ICE",value:"3"},{name:"IRBPNR",value:"5"}],v=[{name:"0%",value:"0"},{name:"IVA 12% ",value:"2"},{name:"IVA 15% ",value:"7"},{name:"IVA 5% ",value:"6"},{name:"IVA 5% ",value:"6"},{name:"IVA 14%",value:"3"},{name:"No Objeto de Impuesto",value:"6"},{name:"Exento de IVA",value:"7"}];return m.map(b=>{var y,O;return{typeTax:((y=s.find(N=>N.value===b.codImpuestoDocSustento))==null?void 0:y.name)||"",typePor:((O=v.find(N=>N.value===b.codigoPorcentaje))==null?void 0:O.name)||"",tarifa:b.tarifa,baseImponible:b.baseImponible,valor:b.valorImpuesto}})}const c=n.computed(()=>{const m=e.document;if(!m)return[];const s=m.getElementsByTagName("impuesto"),v=[];for(let g=0;g<s.length;g++){const b=s[g],y={};if(b){for(let O=0;O<b.children.length;O++){const N=b.children[O];N&&(y[N.tagName]=N.textContent||"")}v.push(y)}}return v}),h=n.computed(()=>{const m=e.document;if(!m)return[];const s=m.getElementsByTagName("docSustento"),v=[];for(let g=0;g<s.length;g++){const b=s[g],y={};if(b){for(let O=0;O<b.children.length;O++){const N=b.children[O];if(N&&(N.tagName==="impuestosDocSustento"||N.tagName==="retenciones"||N.tagName==="pagos")){y[N.tagName]=[];for(let Oe=0;Oe<N.children.length;Oe++){const xe=N.children[Oe];if(!xe)continue;const ht={};for(let Ne=0;Ne<xe.children.length;Ne++){const Se=xe.children[Ne];Se&&(ht[Se.tagName]=Se.textContent||"")}y[N.tagName].push(ht)}}else N&&(y[N.tagName]=N.textContent||"")}v.push(y)}}return v}),E=n.computed(()=>{const m=c.value;let s=0;return m.forEach(v=>{s+=Number.parseFloat(v.valorRetenido||"0")}),At(s,2)}),_=n.computed(()=>{const m=h.value;let s=0;return m.forEach(v=>{v.retenciones.forEach(g=>{s+=Number.parseFloat(g.valorRetenido)})}),At(s,2)}),S=n.computed(()=>{var b;const m=e.document,s=m==null?void 0:m.getElementsByTagName("infoCompRetencion");if(!s)return{};const v={},g=(b=s.item(0))==null?void 0:b.children;if(g)for(let y=0;y<g.length;y++){const O=g[y];O!=null&&O.tagName&&(v[O.tagName||"na"]=O.textContent||"")}return v});return(m,s)=>(n.openBlock(),n.createElementBlock("div",dd,[t.authorization?(n.openBlock(),n.createElementBlock("div",fd,[n.createElementVNode("div",sd," Documento autorizado el "+n.toDisplayString(t.authorization),1)])):n.createCommentVNode("",!0),n.createVNode(ae,{document:t.document,dateAuthorization:t.authorization},null,8,["document","dateAuthorization"]),n.createElementVNode("div",hd,[n.createElementVNode("div",vd,[n.createElementVNode("div",md,[s[0]||(s[0]=n.createElementVNode("div",{class:"font-bold pr-2"}," Razón Social / Nombres y Apellidos : ",-1)),n.createElementVNode("div",null,n.toDisplayString(S.value.razonSocialSujetoRetenido),1)]),n.createElementVNode("div",pd,[s[1]||(s[1]=n.createElementVNode("div",{class:"font-bold pr-2"}," Identificación: ",-1)),n.createElementVNode("div",null,n.toDisplayString(S.value.identificacionSujetoRetenido),1),n.createElementVNode("div",_d," ("+n.toDisplayString(i(S.value.tipoIdentificacionSujetoRetenido))+") ",1)]),n.createElementVNode("div",Ed,[s[2]||(s[2]=n.createElementVNode("div",{class:"font-bold pr-2"}," FECHA EMISION: ",-1)),n.createElementVNode("div",null,n.toDisplayString(S.value.fechaEmision),1),s[3]||(s[3]=n.createElementVNode("div",{class:"font-bold pr-2 pl-4"}," Es obligado a llevar Contablilidad: ",-1)),S.value.obligadoContabilidad?(n.openBlock(),n.createElementBlock("div",gd,n.toDisplayString(S.value.obligadoContabilidad),1)):n.createCommentVNode("",!0),s[4]||(s[4]=n.createElementVNode("div",{class:"font-bold pr-2 pl-4"}," Parte Relacionada: ",-1)),n.createElementVNode("div",null,n.toDisplayString(S.value.parteRel??"NO"),1),s[5]||(s[5]=n.createElementVNode("div",{class:"font-bold pr-2 pl-4"}," Periodo Fiscal: ",-1)),S.value.periodoFiscal?(n.openBlock(),n.createElementBlock("div",yd,n.toDisplayString(S.value.periodoFiscal),1)):n.createCommentVNode("",!0)]),r.value==="2.0.0"?(n.openBlock(),n.createElementBlock("div",bd,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(h.value,(v,g)=>{var b;return n.openBlock(),n.createElementBlock("div",{key:g,class:"border border-gray-500 mt-4"},[s[17]||(s[17]=n.createElementVNode("div",{class:"text-center font-bold italic"}," DATOS DOCUMENTOS DE SUSTENTO V2.0.0 ",-1)),n.createElementVNode("div",Od,[n.createElementVNode("div",xd,[n.createElementVNode("div",Nd,[n.createElementVNode("div",Sd,n.toDisplayString(i(v.codDocSustento,1)),1),n.createElementVNode("div",kd,n.toDisplayString(p(v.numDocSustento)),1)]),v.numAutDocSustento?(n.openBlock(),n.createElementBlock("div",$d,[s[6]||(s[6]=n.createElementVNode("div",{class:"font-bold"}," Numero Autorización: ",-1)),n.createElementVNode("div",null,n.toDisplayString(v.numAutDocSustento),1)])):n.createCommentVNode("",!0)])]),n.createElementVNode("div",wd,[n.createElementVNode("div",null,[s[7]||(s[7]=n.createElementVNode("div",{class:"font-bold"}," Fecha Emisión: ",-1)),n.createElementVNode("div",Ad,n.toDisplayString(v.fechaEmisionDocSustento),1)]),v.fechaRegistroContable?(n.openBlock(),n.createElementBlock("div",Dd,[s[8]||(s[8]=n.createElementVNode("div",{class:"font-bold"}," Fecha Registro Contable: ",-1)),n.createElementVNode("div",Vd,n.toDisplayString(v.fechaRegistroContable),1)])):n.createCommentVNode("",!0),n.createElementVNode("div",null,[s[9]||(s[9]=n.createElementVNode("div",{class:"font-bold"}," Pago a Residente: ",-1)),n.createElementVNode("div",Td,n.toDisplayString(v.pagoLocExt==="01"?"SI":"NO"),1)]),n.createElementVNode("div",null,[s[10]||(s[10]=n.createElementVNode("div",{class:"font-bold"}," Total Sin impuestos: ",-1)),n.createElementVNode("div",Bd,n.toDisplayString(v.totalSinImpuestos),1)]),n.createElementVNode("div",null,[s[11]||(s[11]=n.createElementVNode("div",{class:"font-bold"}," Importe Total: ",-1)),n.createElementVNode("div",Rd,n.toDisplayString(v.importeTotal),1)])]),n.createElementVNode("div",Id,[n.createElementVNode("div",Cd,[s[13]||(s[13]=n.createElementVNode("div",{class:"text-center"}," FORMAS DE PAGOS ",-1)),v.pagos.pago?(n.openBlock(),n.createElementBlock("table",Pd,[s[12]||(s[12]=n.createElementVNode("thead",null,[n.createElementVNode("tr",null,[n.createElementVNode("th",{class:"border"}," TIPO "),n.createElementVNode("th",{class:"border"}," VALOR "),n.createElementVNode("th",{class:"border"}," PAZO "),n.createElementVNode("th",{class:"border"}," TIEMPO ")])],-1)),n.createElementVNode("tbody",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(u(v.pagos.pago),(y,O)=>(n.openBlock(),n.createElementBlock("tr",{key:O},[n.createElementVNode("td",Md,n.toDisplayString(y.formaPago),1),n.createElementVNode("td",Ld,n.toDisplayString(y.total),1),n.createElementVNode("td",jd,n.toDisplayString(y.plazo),1),n.createElementVNode("td",zd,n.toDisplayString(y.unidadTiempo),1)]))),128))])])):n.createCommentVNode("",!0)]),n.createElementVNode("div",Ud,[s[14]||(s[14]=n.createElementVNode("div",{class:"text-center"}," Detalle Impuestos Doc de Sustento ",-1)),(b=v==null?void 0:v.pagos)!=null&&b.pago?(n.openBlock(),n.createElementBlock("table",Fd,[n.createElementVNode("tbody",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(f(v.impuestosDocSustento.impuestoDocSustento),(y,O)=>(n.openBlock(),n.createElementBlock("tr",{key:O},[n.createElementVNode("td",Gd,n.toDisplayString(y.typePor),1),n.createElementVNode("td",Hd,n.toDisplayString(y.baseImponible),1),n.createElementVNode("td",qd,n.toDisplayString(y.valor),1)]))),128))])])):n.createCommentVNode("",!0)])]),n.createElementVNode("div",null,[n.createElementVNode("div",Xd,[n.createElementVNode("div",Yd,[n.createElementVNode("table",Jd,[n.createElementVNode("thead",null,[n.createElementVNode("tr",null,[n.createElementVNode("td",{class:"text-center font-bold",colspan:d().length}," DETALLES DE LA RETENCION ",8,Zd)]),n.createElementVNode("tr",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d(),(y,O)=>(n.openBlock(),n.createElementBlock("th",{key:O,class:"border"},n.toDisplayString(y),1))),128))])]),n.createElementVNode("tbody",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(v.retenciones,(y,O)=>(n.openBlock(),n.createElementBlock("tr",{key:O},[n.createElementVNode("td",Wd,n.toDisplayString(O+1),1),n.createElementVNode("td",Kd,n.toDisplayString(i(y.codigo,2)),1),n.createElementVNode("td",Qd,n.toDisplayString(a(y.codigoRetencion)),1),n.createElementVNode("td",ef," %"+n.toDisplayString(y.porcentajeRetener),1),n.createElementVNode("td",tf,n.toDisplayString(y.baseImponible),1),n.createElementVNode("td",nf,n.toDisplayString(y.valorRetenido),1)]))),128)),n.createElementVNode("tr",null,[s[16]||(s[16]=n.createElementVNode("td",{colspan:"5"},null,-1)),n.createElementVNode("td",rf,[s[15]||(s[15]=n.createTextVNode(" TOTAL RETENIDO ",-1)),n.createElementVNode("span",of,n.toDisplayString(n.unref(nn)(_.value)),1)])])])])])])])])}),128))])):n.createCommentVNode("",!0),r.value==="1.0.0"?(n.openBlock(),n.createElementBlock("div",af,[n.createElementVNode("div",lf,[n.createElementVNode("table",cf,[n.createElementVNode("thead",null,[n.createElementVNode("tr",null,[n.createElementVNode("td",{class:"text-center font-bold",colspan:l().length}," DETALLES DE LA RETENCION V1 ",8,uf)]),n.createElementVNode("tr",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l(),(v,g)=>(n.openBlock(),n.createElementBlock("th",{key:g,class:"border"},n.toDisplayString(v),1))),128))])]),n.createElementVNode("tbody",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(c.value,(v,g)=>(n.openBlock(),n.createElementBlock("tr",{key:g},[n.createElementVNode("td",df,n.toDisplayString(i(v.codDocSustento,1)),1),n.createElementVNode("td",ff,n.toDisplayString(p(v.numDocSustento)),1),n.createElementVNode("td",sf,n.toDisplayString(v.fechaEmisionDocSustento),1),n.createElementVNode("td",hf,n.toDisplayString(S.value.periodoFiscal),1),n.createElementVNode("td",vf,n.toDisplayString(v.baseImponible),1),n.createElementVNode("td",mf,n.toDisplayString(i(v.codigo,2))+" "+n.toDisplayString(v.codigoRetencion),1),n.createElementVNode("td",pf," %"+n.toDisplayString(v.porcentajeRetener),1),n.createElementVNode("td",_f,n.toDisplayString(v.valorRetenido),1)]))),128)),n.createElementVNode("tr",null,[s[19]||(s[19]=n.createElementVNode("td",{colspan:"7"},null,-1)),n.createElementVNode("td",Ef,[s[18]||(s[18]=n.createTextVNode(" TOTAL RETENIDO ",-1)),n.createElementVNode("span",gf,n.toDisplayString(E.value),1)])])])])])])):n.createCommentVNode("",!0),n.createElementVNode("div",yf,[n.createElementVNode("div",bf,[s[20]||(s[20]=n.createElementVNode("div",{class:"text-center text-lg font-bold"}," INFORMACIÓN ADICIONAL ",-1)),n.createElementVNode("div",null,[n.unref(o)?(n.openBlock(),n.createElementBlock("table",Of,[n.createElementVNode("tbody",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(o),(v,g)=>(n.openBlock(),n.createElementBlock("tr",{key:g},[n.createElementVNode("td",xf,n.toDisplayString(v.name),1),n.createElementVNode("td",Nf,n.toDisplayString(v.value),1)]))),128))])])):n.createCommentVNode("",!0)])])])])])]))}}),Sf={class:"w-full"},kf={key:0,class:"p-6 text-center bg-red-50 dark:bg-red-950/20 border border-red-200 dark:border-red-800 rounded-xl"},$f={class:"text-sm text-red-600 dark:text-red-300"},wf={key:1},Af=n.defineComponent({__name:"VisorXml",props:{xml:{},logoUrl:{}},setup(t){const e=t,r=n.ref(null),o=n.ref("");return n.watchEffect(()=>{if(!(typeof window>"u")&&e.xml)try{r.value=k.getFullInvoiceDataFromXml(e.xml),o.value=""}catch(a){o.value=a.message||"Error al procesar el XML",console.error(a)}}),n.ref(!1),(a,i)=>(n.openBlock(),n.createElementBlock("div",Sf,[o.value?(n.openBlock(),n.createElementBlock("div",kf,[i[0]||(i[0]=n.createElementVNode("div",{class:"inline-flex items-center justify-center w-12 h-12 rounded-full bg-red-100 dark:bg-red-900/40 text-red-600 dark:text-red-400 mb-3"},[n.createElementVNode("svg",{class:"w-6 h-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[n.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})])],-1)),i[1]||(i[1]=n.createElementVNode("h4",{class:"text-base font-bold text-red-800 dark:text-red-400 mb-1"}," Error al procesar el comprobante ",-1)),n.createElementVNode("p",$f,n.toDisplayString(o.value),1)])):r.value?(n.openBlock(),n.createElementBlock("div",wf,[r.value.typeDoc==="01"?(n.openBlock(),n.createBlock(on,{key:0,document:r.value.documentData,logoUrl:t.logoUrl,dateAuthorization:r.value.dateAuthorization},null,8,["document","logoUrl","dateAuthorization"])):r.value.typeDoc==="04"?(n.openBlock(),n.createBlock(an,{key:1,document:r.value.documentData,logoUrl:t.logoUrl,authorization:r.value.dateAuthorization},null,8,["document","logoUrl","authorization"])):r.value.typeDoc==="06"?(n.openBlock(),n.createBlock(ln,{key:2,document:r.value.documentData,logoUrl:t.logoUrl,authorization:r.value.dateAuthorization},null,8,["document","logoUrl","authorization"])):r.value.typeDoc==="07"?(n.openBlock(),n.createBlock(cn,{key:3,document:r.value.documentData,authorization:r.value.dateAuthorization},null,8,["document","authorization"])):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)]))}});exports.VisorXml=Af;exports.facturaSri=on;exports.guiaRemisionSri=ln;exports.headDocSri=ae;exports.notaCreditoSri=an;exports.retencionSri=cn;Object.keys(k).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>k[t]})});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),k=require("@sri-xml-viewer/core");function un(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ie={},fe={},$={};Object.defineProperty($,"__esModule",{value:!0});function dn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var fn=function t(e,r){dn(this,t),this.data=e,this.text=r.text||e,this.options=r};$.default=fn;Object.defineProperty(fe,"__esModule",{value:!0});fe.CODE39=void 0;var sn=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),hn=$,mn=vn(hn);function vn(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 _n(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 En(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){En(e,t);function e(r,o){return pn(this,e),r=r.toUpperCase(),o.mod43&&(r+=xn(On(r))),_n(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,o))}return sn(e,[{key:"encode",value:function(){for(var o=ke("*"),a=0;a<this.data.length;a++)o+=ke(this.data[a])+"0";return o+=ke("*"),{data:o,text:this.text}}},{key:"valid",value:function(){return this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)!==-1}}]),e}(mn.default),Dt=["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","-","."," ","$","/","+","%","*"],yn=[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 ke(t){return bn(Vt(t))}function bn(t){return yn[t].toString(2)}function xn(t){return Dt[t]}function Vt(t){return Dt.indexOf(t)}function On(t){for(var e=0,r=0;r<t.length;r++)e+=Vt(t[r]);return e=e%43,e}fe.CODE39=gn;var B={},Ce={},q={},O={};Object.defineProperty(O,"__esModule",{value:!0});var Z;function $e(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Tt=O.SET_A=0,Bt=O.SET_B=1,Rt=O.SET_C=2;O.SHIFT=98;var Nn=O.START_A=103,Sn=O.START_B=104,kn=O.START_C=105;O.MODULO=103;O.STOP=106;O.FNC1=207;O.SET_BY_CODE=(Z={},$e(Z,Nn,Tt),$e(Z,Sn,Bt),$e(Z,kn,Rt),Z);O.SWAP={101:Tt,100:Bt,99:Rt};O.A_START_CHAR="Ð";O.B_START_CHAR="Ñ";O.C_START_CHAR="Ò";O.A_CHARS="[\0-_È-Ï]";O.B_CHARS="[ -È-Ï]";O.C_CHARS="(Ï*[0-9]{2}Ï*)";O.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(q,"__esModule",{value:!0});var $n=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),wn=$,An=Dn(wn),A=O;function Dn(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 Tn(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 Bn(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 Rn=function(t){Bn(e,t);function e(r,o){Vn(this,e);var a=Tn(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r.substring(1),o));return a.bytes=r.split("").map(function(i){return i.charCodeAt(0)}),a}return $n(e,[{key:"valid",value:function(){return/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)}},{key:"encode",value:function(){var o=this.bytes,a=o.shift()-105,i=A.SET_BY_CODE[a];if(i===void 0)throw new RangeError("The encoding does not start with a start character.");this.shouldEncodeAsEan128()===!0&&o.unshift(A.FNC1);var d=e.next(o,1,i);return{text:this.text===this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:e.getBar(a)+d.result+e.getBar((d.checksum+a)%A.MODULO)+e.getBar(A.STOP)}}},{key:"shouldEncodeAsEan128",value:function(){var o=this.options.ean128||!1;return typeof o=="string"&&(o=o.toLowerCase()==="true"),o}}],[{key:"getBar",value:function(o){return A.BARS[o]?A.BARS[o].toString():""}},{key:"correctIndex",value:function(o,a){if(a===A.SET_A){var i=o.shift();return i<32?i+64:i-32}else return a===A.SET_B?o.shift()-32:(o.shift()-48)*10+o.shift()-48}},{key:"next",value:function(o,a,i){if(!o.length)return{result:"",checksum:0};var d=void 0,l=void 0;if(o[0]>=200){l=o.shift()-105;var p=A.SWAP[l];p!==void 0?d=e.next(o,a+1,p):((i===A.SET_A||i===A.SET_B)&&l===A.SHIFT&&(o[0]=i===A.SET_A?o[0]>95?o[0]-96:o[0]:o[0]<32?o[0]+96:o[0]),d=e.next(o,a+1,i))}else l=e.correctIndex(o,i),d=e.next(o,a+1,i);var u=e.getBar(l),f=l*a;return{result:u+d.result,checksum:f+d.checksum}}}]),e}(An.default);q.default=Rn;var Pe={};Object.defineProperty(Pe,"__esModule",{value:!0});var I=O,It=function(e){return e.match(new RegExp("^"+I.A_CHARS+"*"))[0].length},Ct=function(e){return e.match(new RegExp("^"+I.B_CHARS+"*"))[0].length},Pt=function(e){return e.match(new RegExp("^"+I.C_CHARS+"*"))[0]};function Me(t,e){var r=e?I.A_CHARS:I.B_CHARS,o=t.match(new RegExp("^("+r+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(o)return o[1]+"Ì"+Mt(t.substring(o[1].length));var a=t.match(new RegExp("^"+r+"+"))[0];return a.length===t.length?t:a+String.fromCharCode(e?205:206)+Me(t.substring(a.length),!e)}function Mt(t){var e=Pt(t),r=e.length;if(r===t.length)return t;t=t.substring(r);var o=It(t)>=Ct(t);return e+String.fromCharCode(o?206:205)+Me(t,o)}Pe.default=function(t){var e=void 0,r=Pt(t).length;if(r>=2)e=I.C_START_CHAR+Mt(t);else{var o=It(t)>Ct(t);e=(o?I.A_START_CHAR:I.B_START_CHAR)+Me(t,o)}return e.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(a,i){return"Ë"+i})};Object.defineProperty(Ce,"__esModule",{value:!0});var In=q,Cn=Lt(In),Pn=Pe,Mn=Lt(Pn);function Lt(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 we(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 jn(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 zn=function(t){jn(e,t);function e(r,o){if(Ln(this,e),/^[\x00-\x7F\xC8-\xD3]+$/.test(r))var a=we(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,(0,Mn.default)(r),o));else var a=we(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,o));return we(a)}return e}(Cn.default);Ce.default=zn;var Le={};Object.defineProperty(Le,"__esModule",{value:!0});var Un=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),Fn=q,Gn=Hn(Fn),mt=O;function Hn(t){return t&&t.__esModule?t:{default:t}}function qn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Xn(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 Jn=function(t){Yn(e,t);function e(r,o){return qn(this,e),Xn(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,mt.A_START_CHAR+r,o))}return Un(e,[{key:"valid",value:function(){return new RegExp("^"+mt.A_CHARS+"+$").test(this.data)}}]),e}(Gn.default);Le.default=Jn;var je={};Object.defineProperty(je,"__esModule",{value:!0});var Zn=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),Wn=q,Kn=Qn(Wn),vt=O;function Qn(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 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 nr(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 rr=function(t){nr(e,t);function e(r,o){return er(this,e),tr(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,vt.B_START_CHAR+r,o))}return Zn(e,[{key:"valid",value:function(){return new RegExp("^"+vt.B_CHARS+"+$").test(this.data)}}]),e}(Kn.default);je.default=rr;var ze={};Object.defineProperty(ze,"__esModule",{value:!0});var or=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),ar=q,ir=lr(ar),pt=O;function lr(t){return t&&t.__esModule?t:{default:t}}function cr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ur(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 dr(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(t){dr(e,t);function e(r,o){return cr(this,e),ur(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,pt.C_START_CHAR+r,o))}return or(e,[{key:"valid",value:function(){return new RegExp("^"+pt.C_CHARS+"+$").test(this.data)}}]),e}(ir.default);ze.default=fr;Object.defineProperty(B,"__esModule",{value:!0});B.CODE128C=B.CODE128B=B.CODE128A=B.CODE128=void 0;var sr=Ce,hr=se(sr),mr=Le,vr=se(mr),pr=je,_r=se(pr),Er=ze,gr=se(Er);function se(t){return t&&t.__esModule?t:{default:t}}B.CODE128=hr.default;B.CODE128A=vr.default;B.CODE128B=_r.default;B.CODE128C=gr.default;var w={},Ue={},T={};Object.defineProperty(T,"__esModule",{value:!0});T.SIDE_BIN="101";T.MIDDLE_BIN="01010";T.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"]};T.EAN2_STRUCTURE=["LL","LG","GL","GG"];T.EAN5_STRUCTURE=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"];T.EAN13_STRUCTURE=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"];var he={},M={};Object.defineProperty(M,"__esModule",{value:!0});var yr=T,br=function(e,r,o){var a=e.split("").map(function(d,l){return yr.BINARIES[r[l]]}).map(function(d,l){return d?d[e[l]]:""});if(o){var i=e.length-1;a=a.map(function(d,l){return l<i?d+o:d})}return a.join("")};M.default=br;Object.defineProperty(he,"__esModule",{value:!0});var xr=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),z=T,Or=M,_t=jt(Or),Nr=$,Sr=jt(Nr);function jt(t){return t&&t.__esModule?t:{default:t}}function kr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function $r(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 wr(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 Ar=function(t){wr(e,t);function e(r,o){kr(this,e);var a=$r(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,o));return a.fontSize=!o.flat&&o.fontSize>o.width*10?o.width*10:o.fontSize,a.guardHeight=o.height+a.fontSize/2+o.textMargin,a}return xr(e,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(o,a){return this.text.substr(o,a)}},{key:"leftEncode",value:function(o,a){return(0,_t.default)(o,a)}},{key:"rightText",value:function(o,a){return this.text.substr(o,a)}},{key:"rightEncode",value:function(o,a){return(0,_t.default)(o,a)}},{key:"encodeGuarded",value:function(){var o={fontSize:this.fontSize},a={height:this.guardHeight};return[{data:z.SIDE_BIN,options:a},{data:this.leftEncode(),text:this.leftText(),options:o},{data:z.MIDDLE_BIN,options:a},{data:this.rightEncode(),text:this.rightText(),options:o},{data:z.SIDE_BIN,options:a}]}},{key:"encodeFlat",value:function(){var o=[z.SIDE_BIN,this.leftEncode(),z.MIDDLE_BIN,this.rightEncode(),z.SIDE_BIN];return{data:o.join(""),text:this.text}}}]),e}(Sr.default);he.default=Ar;Object.defineProperty(Ue,"__esModule",{value:!0});var Dr=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),W=function t(e,r,o){e===null&&(e=Function.prototype);var a=Object.getOwnPropertyDescriptor(e,r);if(a===void 0){var i=Object.getPrototypeOf(e);return i===null?void 0:t(i,r,o)}else{if("value"in a)return a.value;var d=a.get;return d===void 0?void 0:d.call(o)}},Vr=T,Tr=he,Br=Rr(Tr);function Rr(t){return t&&t.__esModule?t:{default:t}}function Ir(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Cr(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 Pr(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 Et=function(e){var r=e.substr(0,12).split("").map(function(o){return+o}).reduce(function(o,a,i){return i%2?o+a*3:o+a},0);return(10-r%10)%10},Mr=function(t){Pr(e,t);function e(r,o){Ir(this,e),r.search(/^[0-9]{12}$/)!==-1&&(r+=Et(r));var a=Cr(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,o));return a.lastChar=o.lastChar,a}return Dr(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{13}$/)!==-1&&+this.data[12]===Et(this.data)}},{key:"leftText",value:function(){return W(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftText",this).call(this,1,6)}},{key:"leftEncode",value:function(){var o=this.data.substr(1,6),a=Vr.EAN13_STRUCTURE[this.data[0]];return W(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftEncode",this).call(this,o,a)}},{key:"rightText",value:function(){return W(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightText",this).call(this,7,6)}},{key:"rightEncode",value:function(){var o=this.data.substr(7,6);return W(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightEncode",this).call(this,o,"RRRRRR")}},{key:"encodeGuarded",value:function(){var o=W(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"encodeGuarded",this).call(this);return this.options.displayValue&&(o.unshift({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),this.options.lastChar&&(o.push({data:"00"}),o.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}}))),o}}]),e}(Br.default);Ue.default=Mr;var Fe={};Object.defineProperty(Fe,"__esModule",{value:!0});var Lr=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),ie=function t(e,r,o){e===null&&(e=Function.prototype);var a=Object.getOwnPropertyDescriptor(e,r);if(a===void 0){var i=Object.getPrototypeOf(e);return i===null?void 0:t(i,r,o)}else{if("value"in a)return a.value;var d=a.get;return d===void 0?void 0:d.call(o)}},jr=he,zr=Ur(jr);function Ur(t){return t&&t.__esModule?t:{default:t}}function Fr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Gr(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 gt=function(e){var r=e.substr(0,7).split("").map(function(o){return+o}).reduce(function(o,a,i){return i%2?o+a:o+a*3},0);return(10-r%10)%10},qr=function(t){Hr(e,t);function e(r,o){return Fr(this,e),r.search(/^[0-9]{7}$/)!==-1&&(r+=gt(r)),Gr(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,o))}return Lr(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{8}$/)!==-1&&+this.data[7]===gt(this.data)}},{key:"leftText",value:function(){return ie(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftText",this).call(this,0,4)}},{key:"leftEncode",value:function(){var o=this.data.substr(0,4);return ie(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftEncode",this).call(this,o,"LLLL")}},{key:"rightText",value:function(){return ie(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightText",this).call(this,4,4)}},{key:"rightEncode",value:function(){var o=this.data.substr(4,4);return ie(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightEncode",this).call(this,o,"RRRR")}}]),e}(zr.default);Fe.default=qr;var Ge={};Object.defineProperty(Ge,"__esModule",{value:!0});var Xr=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),Yr=T,Jr=M,Zr=zt(Jr),Wr=$,Kr=zt(Wr);function zt(t){return t&&t.__esModule?t:{default:t}}function Qr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function eo(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 to(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 no=function(e){var r=e.split("").map(function(o){return+o}).reduce(function(o,a,i){return i%2?o+a*9:o+a*3},0);return r%10},ro=function(t){to(e,t);function e(r,o){return Qr(this,e),eo(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,o))}return Xr(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{5}$/)!==-1}},{key:"encode",value:function(){var o=Yr.EAN5_STRUCTURE[no(this.data)];return{data:"1011"+(0,Zr.default)(this.data,o,"01"),text:this.text}}}]),e}(Kr.default);Ge.default=ro;var He={};Object.defineProperty(He,"__esModule",{value:!0});var oo=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),ao=T,io=M,lo=Ut(io),co=$,uo=Ut(co);function Ut(t){return t&&t.__esModule?t:{default:t}}function fo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function so(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 ho(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 mo=function(t){ho(e,t);function e(r,o){return fo(this,e),so(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,o))}return oo(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{2}$/)!==-1}},{key:"encode",value:function(){var o=ao.EAN2_STRUCTURE[parseInt(this.data)%4];return{data:"1011"+(0,lo.default)(this.data,o,"01"),text:this.text}}}]),e}(uo.default);He.default=mo;var ee={};Object.defineProperty(ee,"__esModule",{value:!0});var vo=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}();ee.checksum=Te;var po=M,U=Ft(po),_o=$,Eo=Ft(_o);function Ft(t){return t&&t.__esModule?t:{default:t}}function go(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function yo(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 xo=function(t){bo(e,t);function e(r,o){go(this,e),r.search(/^[0-9]{11}$/)!==-1&&(r+=Te(r));var a=yo(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,o));return a.displayValue=o.displayValue,o.fontSize>o.width*10?a.fontSize=o.width*10:a.fontSize=o.fontSize,a.guardHeight=o.height+a.fontSize/2+o.textMargin,a}return vo(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{12}$/)!==-1&&this.data[11]==Te(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var o="";return o+="101",o+=(0,U.default)(this.data.substr(0,6),"LLLLLL"),o+="01010",o+=(0,U.default)(this.data.substr(6,6),"RRRRRR"),o+="101",{data:o,text:this.text}}},{key:"guardedEncoding",value:function(){var o=[];return this.displayValue&&o.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),o.push({data:"101"+(0,U.default)(this.data[0],"L"),options:{height:this.guardHeight}}),o.push({data:(0,U.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),o.push({data:"01010",options:{height:this.guardHeight}}),o.push({data:(0,U.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),o.push({data:(0,U.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&o.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),o}}]),e}(Eo.default);function Te(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}ee.default=xo;var qe={};Object.defineProperty(qe,"__esModule",{value:!0});var Oo=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),No=M,So=Gt(No),ko=$,$o=Gt(ko),wo=ee;function Gt(t){return t&&t.__esModule?t:{default:t}}function Ao(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ae(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 Do(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 Vo=["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"],To=[["EEEOOO","OOOEEE"],["EEOEOO","OOEOEE"],["EEOOEO","OOEEOE"],["EEOOOE","OOEEEO"],["EOEEOO","OEOOEE"],["EOOEEO","OEEOOE"],["EOOOEE","OEEEOO"],["EOEOEO","OEOEOE"],["EOEOOE","OEOEEO"],["EOOEOE","OEEOEO"]],Bo=function(t){Do(e,t);function e(r,o){Ao(this,e);var a=Ae(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,o));if(a.isValid=!1,r.search(/^[0-9]{6}$/)!==-1)a.middleDigits=r,a.upcA=yt(r,"0"),a.text=o.text||""+a.upcA[0]+r+a.upcA[a.upcA.length-1],a.isValid=!0;else if(r.search(/^[01][0-9]{7}$/)!==-1)if(a.middleDigits=r.substring(1,r.length-1),a.upcA=yt(a.middleDigits,r[0]),a.upcA[a.upcA.length-1]===r[r.length-1])a.isValid=!0;else return Ae(a);else return Ae(a);return a.displayValue=o.displayValue,o.fontSize>o.width*10?a.fontSize=o.width*10:a.fontSize=o.fontSize,a.guardHeight=o.height+a.fontSize/2+o.textMargin,a}return Oo(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 o="";return o+="101",o+=this.encodeMiddleDigits(),o+="010101",{data:o,text:this.text}}},{key:"guardedEncoding",value:function(){var o=[];return this.displayValue&&o.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),o.push({data:"101",options:{height:this.guardHeight}}),o.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),o.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&o.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),o}},{key:"encodeMiddleDigits",value:function(){var o=this.upcA[0],a=this.upcA[this.upcA.length-1],i=To[parseInt(a)][parseInt(o)];return(0,So.default)(this.middleDigits,i)}}]),e}($o.default);function yt(t,e){for(var r=parseInt(t[t.length-1]),o=Vo[r],a="",i=0,d=0;d<o.length;d++){var l=o[d];l==="X"?a+=t[i++]:a+=l}return a=""+e+a,""+a+(0,wo.checksum)(a)}qe.default=Bo;Object.defineProperty(w,"__esModule",{value:!0});w.UPCE=w.UPC=w.EAN2=w.EAN5=w.EAN8=w.EAN13=void 0;var Ro=Ue,Io=X(Ro),Co=Fe,Po=X(Co),Mo=Ge,Lo=X(Mo),jo=He,zo=X(jo),Uo=ee,Fo=X(Uo),Go=qe,Ho=X(Go);function X(t){return t&&t.__esModule?t:{default:t}}w.EAN13=Io.default;w.EAN8=Po.default;w.EAN5=Lo.default;w.EAN2=zo.default;w.UPC=Fo.default;w.UPCE=Ho.default;var G={},me={},te={};Object.defineProperty(te,"__esModule",{value:!0});te.START_BIN="1010";te.END_BIN="11101";te.BINARIES=["00110","10001","01001","11000","00101","10100","01100","00011","10010","01010"];Object.defineProperty(me,"__esModule",{value:!0});var qo=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),le=te,Xo=$,Yo=Jo(Xo);function Jo(t){return t&&t.__esModule?t:{default:t}}function Zo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Wo(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 Ko(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 Qo=function(t){Ko(e,t);function e(){return Zo(this,e),Wo(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return qo(e,[{key:"valid",value:function(){return this.data.search(/^([0-9]{2})+$/)!==-1}},{key:"encode",value:function(){var o=this,a=this.data.match(/.{2}/g).map(function(i){return o.encodePair(i)}).join("");return{data:le.START_BIN+a+le.END_BIN,text:this.text}}},{key:"encodePair",value:function(o){var a=le.BINARIES[o[1]];return le.BINARIES[o[0]].split("").map(function(i,d){return(i==="1"?"111":"1")+(a[d]==="1"?"000":"0")}).join("")}}]),e}(Yo.default);me.default=Qo;var Xe={};Object.defineProperty(Xe,"__esModule",{value:!0});var ea=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),ta=me,na=ra(ta);function ra(t){return t&&t.__esModule?t:{default:t}}function oa(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function aa(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 ia(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 bt=function(e){var r=e.substr(0,13).split("").map(function(o){return parseInt(o,10)}).reduce(function(o,a,i){return o+a*(3-i%2*2)},0);return Math.ceil(r/10)*10-r},la=function(t){ia(e,t);function e(r,o){return oa(this,e),r.search(/^[0-9]{13}$/)!==-1&&(r+=bt(r)),aa(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,o))}return ea(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{14}$/)!==-1&&+this.data[13]===bt(this.data)}}]),e}(na.default);Xe.default=la;Object.defineProperty(G,"__esModule",{value:!0});G.ITF14=G.ITF=void 0;var ca=me,ua=Ht(ca),da=Xe,fa=Ht(da);function Ht(t){return t&&t.__esModule?t:{default:t}}G.ITF=ua.default;G.ITF14=fa.default;var V={},L={};Object.defineProperty(L,"__esModule",{value:!0});var sa=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),ha=$,ma=va(ha);function va(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 _a(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 Ea(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 ga=function(t){Ea(e,t);function e(r,o){return pa(this,e),_a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,o))}return sa(e,[{key:"encode",value:function(){for(var o="110",a=0;a<this.data.length;a++){var i=parseInt(this.data[a]),d=i.toString(2);d=ya(d,4-d.length);for(var l=0;l<d.length;l++)o+=d[l]=="0"?"100":"110"}return o+="1001",{data:o,text:this.text}}},{key:"valid",value:function(){return this.data.search(/^[0-9]+$/)!==-1}}]),e}(ma.default);function ya(t,e){for(var r=0;r<e;r++)t="0"+t;return t}L.default=ga;var Ye={},j={};Object.defineProperty(j,"__esModule",{value:!0});j.mod10=ba;j.mod11=xa;function ba(t){for(var e=0,r=0;r<t.length;r++){var o=parseInt(t[r]);(r+t.length)%2===0?e+=o:e+=o*2%10+Math.floor(o*2/10)}return(10-e%10)%10}function xa(t){for(var e=0,r=[2,3,4,5,6,7],o=0;o<t.length;o++){var a=parseInt(t[t.length-1-o]);e+=r[o%r.length]*a}return(11-e%11)%11}Object.defineProperty(Ye,"__esModule",{value:!0});var Oa=L,Na=ka(Oa),Sa=j;function ka(t){return t&&t.__esModule?t:{default:t}}function $a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function wa(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 Da=function(t){Aa(e,t);function e(r,o){return $a(this,e),wa(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r+(0,Sa.mod10)(r),o))}return e}(Na.default);Ye.default=Da;var Je={};Object.defineProperty(Je,"__esModule",{value:!0});var Va=L,Ta=Ra(Va),Ba=j;function Ra(t){return t&&t.__esModule?t:{default:t}}function Ia(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ca(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 Pa(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 Ma=function(t){Pa(e,t);function e(r,o){return Ia(this,e),Ca(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r+(0,Ba.mod11)(r),o))}return e}(Ta.default);Je.default=Ma;var Ze={};Object.defineProperty(Ze,"__esModule",{value:!0});var La=L,ja=za(La),xt=j;function za(t){return t&&t.__esModule?t:{default:t}}function Ua(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Fa(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 Ga(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 Ha=function(t){Ga(e,t);function e(r,o){return Ua(this,e),r+=(0,xt.mod10)(r),r+=(0,xt.mod10)(r),Fa(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,o))}return e}(ja.default);Ze.default=Ha;var We={};Object.defineProperty(We,"__esModule",{value:!0});var qa=L,Xa=Ya(qa),Ot=j;function Ya(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 Wa(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){Wa(e,t);function e(r,o){return Ja(this,e),r+=(0,Ot.mod11)(r),r+=(0,Ot.mod10)(r),Za(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,o))}return e}(Xa.default);We.default=Ka;Object.defineProperty(V,"__esModule",{value:!0});V.MSI1110=V.MSI1010=V.MSI11=V.MSI10=V.MSI=void 0;var Qa=L,ei=ne(Qa),ti=Ye,ni=ne(ti),ri=Je,oi=ne(ri),ai=Ze,ii=ne(ai),li=We,ci=ne(li);function ne(t){return t&&t.__esModule?t:{default:t}}V.MSI=ei.default;V.MSI10=ni.default;V.MSI11=oi.default;V.MSI1010=ii.default;V.MSI1110=ci.default;var ve={};Object.defineProperty(ve,"__esModule",{value:!0});ve.pharmacode=void 0;var ui=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),di=$,fi=si(di);function si(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 mi(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 vi(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 pi=function(t){vi(e,t);function e(r,o){hi(this,e);var a=mi(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,o));return a.number=parseInt(r,10),a}return ui(e,[{key:"encode",value:function(){for(var o=this.number,a="";!isNaN(o)&&o!=0;)o%2===0?(a="11100"+a,o=(o-2)/2):(a="100"+a,o=(o-1)/2);return a=a.slice(0,-2),{data:a,text:this.text}}},{key:"valid",value:function(){return this.number>=3&&this.number<=131070}}]),e}(fi.default);ve.pharmacode=pi;var pe={};Object.defineProperty(pe,"__esModule",{value:!0});pe.codabar=void 0;var _i=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),Ei=$,gi=yi(Ei);function yi(t){return t&&t.__esModule?t:{default:t}}function bi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function xi(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 Oi(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 Ni=function(t){Oi(e,t);function e(r,o){bi(this,e),r.search(/^[0-9\-\$\:\.\+\/]+$/)===0&&(r="A"+r+"A");var a=xi(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r.toUpperCase(),o));return a.text=a.options.text||a.text.replace(/[A-D]/g,""),a}return _i(e,[{key:"valid",value:function(){return this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)!==-1}},{key:"encode",value:function(){for(var o=[],a=this.getEncodings(),i=0;i<this.data.length;i++)o.push(a[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}(gi.default);pe.codabar=Ni;var H={},_e={},re={};Object.defineProperty(re,"__esModule",{value:!0});re.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","-","."," ","$","/","+","%","($)","(%)","(/)","(+)","ÿ"];re.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"];re.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"],"":["(%)","T"]};Object.defineProperty(_e,"__esModule",{value:!0});var Si=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),ce=re,ki=$,$i=wi(ki);function wi(t){return t&&t.__esModule?t:{default:t}}function Ai(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Di(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 Vi(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 Ti=function(t){Vi(e,t);function e(r,o){return Ai(this,e),Di(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,o))}return Si(e,[{key:"valid",value:function(){return/^[0-9A-Z\-. $/+%]+$/.test(this.data)}},{key:"encode",value:function(){var o=this.data.split("").flatMap(function(l){return ce.MULTI_SYMBOLS[l]||l}),a=o.map(function(l){return e.getEncoding(l)}).join(""),i=e.checksum(o,20),d=e.checksum(o.concat(i),15);return{text:this.text,data:e.getEncoding("ÿ")+a+e.getEncoding(i)+e.getEncoding(d)+e.getEncoding("ÿ")+"1"}}}],[{key:"getEncoding",value:function(o){return ce.BINARIES[e.symbolValue(o)]}},{key:"getSymbol",value:function(o){return ce.SYMBOLS[o]}},{key:"symbolValue",value:function(o){return ce.SYMBOLS.indexOf(o)}},{key:"checksum",value:function(o,a){var i=o.slice().reverse().reduce(function(d,l,p){var u=p%a+1;return d+e.symbolValue(l)*u},0);return e.getSymbol(i%47)}}]),e}($i.default);_e.default=Ti;var Ke={};Object.defineProperty(Ke,"__esModule",{value:!0});var Bi=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),Ri=_e,Ii=Ci(Ri);function Ci(t){return t&&t.__esModule?t:{default:t}}function Pi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Mi(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 Li(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 ji=function(t){Li(e,t);function e(r,o){return Pi(this,e),Mi(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,o))}return Bi(e,[{key:"valid",value:function(){return/^[\x00-\x7f]+$/.test(this.data)}}]),e}(Ii.default);Ke.default=ji;Object.defineProperty(H,"__esModule",{value:!0});H.CODE93FullASCII=H.CODE93=void 0;var zi=_e,Ui=qt(zi),Fi=Ke,Gi=qt(Fi);function qt(t){return t&&t.__esModule?t:{default:t}}H.CODE93=Ui.default;H.CODE93FullASCII=Gi.default;var Ee={};Object.defineProperty(Ee,"__esModule",{value:!0});Ee.GenericBarcode=void 0;var Hi=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),qi=$,Xi=Yi(qi);function Yi(t){return t&&t.__esModule?t:{default:t}}function Ji(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 Wi(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 Ki=function(t){Wi(e,t);function e(r,o){return Ji(this,e),Zi(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,o))}return Hi(e,[{key:"encode",value:function(){return{data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return!0}}]),e}(Xi.default);Ee.GenericBarcode=Ki;Object.defineProperty(Ie,"__esModule",{value:!0});var Qi=fe,ue=B,F=w,Nt=G,K=V,el=ve,tl=pe,St=H,nl=Ee;Ie.default={CODE39:Qi.CODE39,CODE128:ue.CODE128,CODE128A:ue.CODE128A,CODE128B:ue.CODE128B,CODE128C:ue.CODE128C,EAN13:F.EAN13,EAN8:F.EAN8,EAN5:F.EAN5,EAN2:F.EAN2,UPC:F.UPC,UPCE:F.UPCE,ITF14:Nt.ITF14,ITF:Nt.ITF,MSI:K.MSI,MSI10:K.MSI10,MSI11:K.MSI11,MSI1010:K.MSI1010,MSI1110:K.MSI1110,pharmacode:el.pharmacode,codabar:tl.codabar,CODE93:St.CODE93,CODE93FullASCII:St.CODE93FullASCII,GenericBarcode:nl.GenericBarcode};var Y={};Object.defineProperty(Y,"__esModule",{value:!0});var rl=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t};Y.default=function(t,e){return rl({},t,e)};var Qe={};Object.defineProperty(Qe,"__esModule",{value:!0});Qe.default=ol;function ol(t){var e=[];function r(o){if(Array.isArray(o))for(var a=0;a<o.length;a++)r(o[a]);else o.text=o.text||"",o.data=o.data||"",e.push(o)}return r(t),e}var et={};Object.defineProperty(et,"__esModule",{value:!0});et.default=al;function al(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 tt={},nt={},ge={};Object.defineProperty(ge,"__esModule",{value:!0});ge.default=il;function il(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 ye={};Object.defineProperty(ye,"__esModule",{value:!0});var ll={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(){}};ye.default=ll;Object.defineProperty(nt,"__esModule",{value:!0});var cl=ge,ul=Xt(cl),dl=ye,kt=Xt(dl);function Xt(t){return t&&t.__esModule?t:{default:t}}function fl(t){var e={};for(var r in kt.default)kt.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,ul.default)(e),e}nt.default=fl;var rt={},ot={},D={};Object.defineProperty(D,"__esModule",{value:!0});D.getTotalWidthOfEncodings=D.calculateEncodingAttributes=D.getBarcodePadding=D.getEncodingHeight=D.getMaximumHeightOfEncodings=void 0;var sl=Y,hl=ml(sl);function ml(t){return t&&t.__esModule?t:{default:t}}function Yt(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 vl(t,e,r){for(var o=0;o<t.length;o++){var a=t[o],i=(0,hl.default)(e,a.options),d;i.displayValue?d=El(a.text,i,r):d=0;var l=a.data.length*i.width;a.width=Math.ceil(Math.max(d,l)),a.height=Yt(a,i),a.barcodePadding=Jt(d,l,i)}}function pl(t){for(var e=0,r=0;r<t.length;r++)e+=t[r].width;return e}function _l(t){for(var e=0,r=0;r<t.length;r++)t[r].height>e&&(e=t[r].height);return e}function El(t,e,r){var o;if(r)o=r;else if(typeof document<"u")o=document.createElement("canvas").getContext("2d");else return 0;o.font=e.fontOptions+" "+e.fontSize+"px "+e.font;var a=o.measureText(t);if(!a)return 0;var i=a.width;return i}D.getMaximumHeightOfEncodings=_l;D.getEncodingHeight=Yt;D.getBarcodePadding=Jt;D.calculateEncodingAttributes=vl;D.getTotalWidthOfEncodings=pl;Object.defineProperty(ot,"__esModule",{value:!0});var gl=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),yl=Y,bl=xl(yl),De=D;function xl(t){return t&&t.__esModule?t:{default:t}}function Ol(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Nl=function(){function t(e,r,o){Ol(this,t),this.canvas=e,this.encodings=r,this.options=o}return gl(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 o=(0,bl.default)(this.options,this.encodings[r].options);this.drawCanvasBarcode(o,this.encodings[r]),this.drawCanvasText(o,this.encodings[r]),this.moveCanvasDrawing(this.encodings[r])}this.restoreCanvas()}},{key:"prepareCanvas",value:function(){var r=this.canvas.getContext("2d");r.save(),(0,De.calculateEncodingAttributes)(this.encodings,this.options,r);var o=(0,De.getTotalWidthOfEncodings)(this.encodings),a=(0,De.getMaximumHeightOfEncodings)(this.encodings);this.canvas.width=o+this.options.marginLeft+this.options.marginRight,this.canvas.height=a,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,o){var a=this.canvas.getContext("2d"),i=o.data,d;r.textPosition=="top"?d=r.marginTop+r.fontSize+r.textMargin:d=r.marginTop,a.fillStyle=r.lineColor;for(var l=0;l<i.length;l++){var p=l*r.width+o.barcodePadding;i[l]==="1"?a.fillRect(p,d,r.width,r.height):i[l]&&a.fillRect(p,d,r.width,r.height*i[l])}}},{key:"drawCanvasText",value:function(r,o){var a=this.canvas.getContext("2d"),i=r.fontOptions+" "+r.fontSize+"px "+r.font;if(r.displayValue){var d,l;r.textPosition=="top"?l=r.marginTop+r.fontSize-r.textMargin:l=r.height+r.textMargin+r.marginTop+r.fontSize,a.font=i,r.textAlign=="left"||o.barcodePadding>0?(d=0,a.textAlign="left"):r.textAlign=="right"?(d=o.width-1,a.textAlign="right"):(d=o.width/2,a.textAlign="center"),a.fillText(o.text,d,l)}}},{key:"moveCanvasDrawing",value:function(r){var o=this.canvas.getContext("2d");o.translate(r.width,0)}},{key:"restoreCanvas",value:function(){var r=this.canvas.getContext("2d");r.restore()}}]),t}();ot.default=Nl;var at={};Object.defineProperty(at,"__esModule",{value:!0});var Sl=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),kl=Y,$l=wl(kl),Ve=D;function wl(t){return t&&t.__esModule?t:{default:t}}function Al(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var de="http://www.w3.org/2000/svg",Dl=function(){function t(e,r,o){Al(this,t),this.svg=e,this.encodings=r,this.options=o,this.document=o.xmlDocument||document}return Sl(t,[{key:"render",value:function(){var r=this.options.marginLeft;this.prepareSVG();for(var o=0;o<this.encodings.length;o++){var a=this.encodings[o],i=(0,$l.default)(this.options,a.options),d=this.createGroup(r,i.marginTop,this.svg);this.setGroupOptions(d,i),this.drawSvgBarcode(d,i,a),this.drawSVGText(d,i,a),r+=a.width}}},{key:"prepareSVG",value:function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);(0,Ve.calculateEncodingAttributes)(this.encodings,this.options);var r=(0,Ve.getTotalWidthOfEncodings)(this.encodings),o=(0,Ve.getMaximumHeightOfEncodings)(this.encodings),a=r+this.options.marginLeft+this.options.marginRight;this.setSvgAttributes(a,o),this.options.background&&this.drawRect(0,0,a,o,this.svg).setAttribute("fill",this.options.background)}},{key:"drawSvgBarcode",value:function(r,o,a){var i=a.data,d;o.textPosition=="top"?d=o.fontSize+o.textMargin:d=0;for(var l=0,p=0,u=0;u<i.length;u++)p=u*o.width+a.barcodePadding,i[u]==="1"?l++:l>0&&(this.drawRect(p-o.width*l,d,o.width*l,o.height,r),l=0);l>0&&this.drawRect(p-o.width*(l-1),d,o.width*l,o.height,r)}},{key:"drawSVGText",value:function(r,o,a){var i=this.document.createElementNS(de,"text");if(o.displayValue){var d,l;i.setAttribute("font-family",o.font),i.setAttribute("font-size",o.fontSize),o.fontOptions.includes("bold")&&i.setAttribute("font-weight","bold"),o.fontOptions.includes("italic")&&i.setAttribute("font-style","italic"),o.textPosition=="top"?l=o.fontSize-o.textMargin:l=o.height+o.textMargin+o.fontSize,o.textAlign=="left"||a.barcodePadding>0?(d=0,i.setAttribute("text-anchor","start")):o.textAlign=="right"?(d=a.width-1,i.setAttribute("text-anchor","end")):(d=a.width/2,i.setAttribute("text-anchor","middle")),i.setAttribute("x",d),i.setAttribute("y",l),i.appendChild(this.document.createTextNode(a.text)),r.appendChild(i)}}},{key:"setSvgAttributes",value:function(r,o){var a=this.svg;a.setAttribute("width",r+"px"),a.setAttribute("height",o+"px"),a.setAttribute("x","0px"),a.setAttribute("y","0px"),a.setAttribute("viewBox","0 0 "+r+" "+o),a.setAttribute("xmlns",de),a.setAttribute("version","1.1")}},{key:"createGroup",value:function(r,o,a){var i=this.document.createElementNS(de,"g");return i.setAttribute("transform","translate("+r+", "+o+")"),a.appendChild(i),i}},{key:"setGroupOptions",value:function(r,o){r.setAttribute("fill",o.lineColor)}},{key:"drawRect",value:function(r,o,a,i,d){var l=this.document.createElementNS(de,"rect");return l.setAttribute("x",r),l.setAttribute("y",o),l.setAttribute("width",a),l.setAttribute("height",i),d.appendChild(l),l}}]),t}();at.default=Dl;var it={};Object.defineProperty(it,"__esModule",{value:!0});var Vl=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}();function Tl(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Bl=function(){function t(e,r,o){Tl(this,t),this.object=e,this.encodings=r,this.options=o}return Vl(t,[{key:"render",value:function(){this.object.encodings=this.encodings}}]),t}();it.default=Bl;Object.defineProperty(rt,"__esModule",{value:!0});var Rl=ot,Il=lt(Rl),Cl=at,Pl=lt(Cl),Ml=it,Ll=lt(Ml);function lt(t){return t&&t.__esModule?t:{default:t}}rt.default={CanvasRenderer:Il.default,SVGRenderer:Pl.default,ObjectRenderer:Ll.default};var J={};Object.defineProperty(J,"__esModule",{value:!0});function ct(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ut(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 dt(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 jl=function(t){dt(e,t);function e(r,o){ct(this,e);var a=ut(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return a.name="InvalidInputException",a.symbology=r,a.input=o,a.message='"'+a.input+'" is not a valid input for '+a.symbology,a}return e}(Error),zl=function(t){dt(e,t);function e(){ct(this,e);var r=ut(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return r.name="InvalidElementException",r.message="Not supported type to render on",r}return e}(Error),Ul=function(t){dt(e,t);function e(){ct(this,e);var r=ut(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return r.name="NoElementException",r.message="No element to render on.",r}return e}(Error);J.InvalidInputException=jl;J.InvalidElementException=zl;J.NoElementException=Ul;Object.defineProperty(tt,"__esModule",{value:!0});var Fl=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},Gl=nt,Be=Zt(Gl),Hl=rt,Q=Zt(Hl),ql=J;function Zt(t){return t&&t.__esModule?t:{default:t}}function ft(t){if(typeof t=="string")return Xl(t);if(Array.isArray(t)){for(var e=[],r=0;r<t.length;r++)e.push(ft(t[r]));return e}else{if(typeof HTMLCanvasElement<"u"&&t instanceof HTMLImageElement)return Yl(t);if(t&&t.nodeName&&t.nodeName.toLowerCase()==="svg"||typeof SVGElement<"u"&&t instanceof SVGElement)return{element:t,options:(0,Be.default)(t),renderer:Q.default.SVGRenderer};if(typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement)return{element:t,options:(0,Be.default)(t),renderer:Q.default.CanvasRenderer};if(t&&t.getContext)return{element:t,renderer:Q.default.CanvasRenderer};if(t&&(typeof t>"u"?"undefined":Fl(t))==="object"&&!t.nodeName)return{element:t,renderer:Q.default.ObjectRenderer};throw new ql.InvalidElementException}}function Xl(t){var e=document.querySelectorAll(t);if(e.length!==0){for(var r=[],o=0;o<e.length;o++)r.push(ft(e[o]));return r}}function Yl(t){var e=document.createElement("canvas");return{element:e,options:(0,Be.default)(t),renderer:Q.default.CanvasRenderer,afterRender:function(){t.setAttribute("src",e.toDataURL())}}}tt.default=ft;var st={};Object.defineProperty(st,"__esModule",{value:!0});var Jl=function(){function t(e,r){for(var o=0;o<r.length;o++){var a=r[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}();function Zl(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Wl=function(){function t(e){Zl(this,t),this.api=e}return Jl(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 o=r.apply(void 0,arguments);return this.api._options.valid(!0),o}catch(a){return this.handleCatch(a),this.api}}}]),t}();st.default=Wl;var Kl=Ie,P=C(Kl),Ql=Y,oe=C(Ql),ec=Qe,Wt=C(ec),tc=et,$t=C(tc),nc=tt,rc=C(nc),oc=ge,ac=C(oc),ic=st,lc=C(ic),Kt=J,cc=ye,Qt=C(cc);function C(t){return t&&t.__esModule?t:{default:t}}var R=function(){},be=function(e,r,o){var a=new R;if(typeof e>"u")throw Error("No element to render on was provided.");return a._renderProperties=(0,rc.default)(e),a._encodings=[],a._options=Qt.default,a._errorHandler=new lc.default(a),typeof r<"u"&&(o=o||{},o.format||(o.format=tn()),a.options(o)[o.format](r,o).render()),a};be.getModule=function(t){return P.default[t]};for(var wt in P.default)P.default.hasOwnProperty(wt)&&uc(P.default,wt);function uc(t,e){R.prototype[e]=R.prototype[e.toUpperCase()]=R.prototype[e.toLowerCase()]=function(r,o){var a=this;return a._errorHandler.wrapBarcodeCall(function(){o.text=typeof o.text>"u"?void 0:""+o.text;var i=(0,oe.default)(a._options,o);i=(0,ac.default)(i);var d=t[e],l=en(r,d,i);return a._encodings.push(l),a})}}function en(t,e,r){t=""+t;var o=new e(t,r);if(!o.valid())throw new Kt.InvalidInputException(o.constructor.name,t);var a=o.encode();a=(0,Wt.default)(a);for(var i=0;i<a.length;i++)a[i].options=(0,oe.default)(r,a[i].options);return a}function tn(){return P.default.CODE128?"CODE128":Object.keys(P.default)[0]}R.prototype.options=function(t){return this._options=(0,oe.default)(this._options,t),this};R.prototype.blank=function(t){var e=new Array(t+1).join("0");return this._encodings.push({data:e}),this};R.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,oe.default)(this._options,t.options);r.format=="auto"&&(r.format=tn()),this._errorHandler.wrapBarcodeCall(function(){var o=r.value,a=P.default[r.format.toUpperCase()],i=en(o,a,r);Re(t,i,r)})}}};R.prototype.render=function(){if(!this._renderProperties)throw new Kt.NoElementException;if(Array.isArray(this._renderProperties))for(var t=0;t<this._renderProperties.length;t++)Re(this._renderProperties[t],this._encodings,this._options);else Re(this._renderProperties,this._encodings,this._options);return this};R.prototype._defaults=Qt.default;function Re(t,e,r){e=(0,Wt.default)(e);for(var o=0;o<e.length;o++)e[o].options=(0,oe.default)(r,e[o].options),(0,$t.default)(e[o].options);(0,$t.default)(r);var a=t.renderer,i=new a(t.element,e,r);i.render(),t.afterRender&&t.afterRender()}typeof window<"u"&&(window.JsBarcode=be);typeof jQuery<"u"&&(jQuery.fn.JsBarcode=function(t,e){var r=[];return jQuery(this).each(function(){r.push(this)}),be(r,t,e)});var dc=be;const fc=un(dc),sc=n.defineComponent({__name:"barCode",props:{text:{type:String,required:!1}},setup(t){const e=t,r=n.computed(()=>e.text),o=n.ref(null),a={format:"CODE128",lineColor:"#000",width:2,height:100,displayValue:!1,fontOptions:"",font:"monospace",textAlign:"center",textPosition:"bottom",textMargin:2,fontSize:20,background:"#fff",margin:10,marginTop:void 0,marginBottom:void 0,marginLeft:void 0,marginRight:void 0};function i(){fc(o.value,r.value||"",a)}return n.onMounted(()=>{i()}),n.watch(()=>e.text,()=>{i()}),(d,l)=>r.value?(n.openBlock(),n.createElementBlock("svg",{key:0,id:"canvas",ref_key:"canvas",ref:o,class:"flex flex-col items-center justify-center w-full h-full",viewbox:"0 0 210 500",preserveAspectRatio:"none"},null,512)):n.createCommentVNode("",!0)}});function nn(t,e){if(t==null||t==="")return e==="decimal"?"0.00":"$0.00";const r=typeof t=="string"?parseFloat(t):t;return isNaN(r)?e==="decimal"?"0.00":"$0.00":e==="decimal"?r.toFixed(2):new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(r)}function At(t,e=2){return Math.round((t+Number.EPSILON)*Math.pow(10,e))/Math.pow(10,e)}function hc(t,e){return t?String(t):""}const mc={class:"grid grid-cols-2 gap-2"},vc={class:"flex flex-col justify-between m-1"},pc={class:"flex items-center p-1 flex-1"},_c={key:0,class:"text-error font-bold text-4xl text-center w-full"},Ec=["src"],gc={class:"w-full border border-default rounded-lg"},yc={key:0,class:"text-center"},bc={class:"text-center text-2xl"},xc={class:"text-xs"},Oc={class:"flex-none flex"},Nc={key:0,class:"flex-none flex pr-2"},Sc={key:1,class:"flex"},kc={class:"flex gap-2"},$c={key:2,class:"text-center w-full"},wc={class:"pr-1 font-bold text-error"},Ac={key:3,class:"flex w-full justify-center bg-accented p-2 mb-1"},Dc={class:"pr-1 font-bold"},Vc={key:4,class:"flex w-full justify-center bg-accented rounded-lg p-2 mb-1"},Tc={class:"border border-default rounded-lg m-1 p-2"},Bc={class:"mx-4 text-2xl"},Rc={class:"text-center text-3xl bg-accented"},Ic={class:"text-sm"},Cc={class:"text-center text-2xl"},Pc={class:"text-center text-clave text-xs"},Mc={key:0,class:"flex"},Lc={class:"flex"},jc={class:"flex"},zc={class:"text-center text-clave text-xs"},Uc={class:"w-full p-2"},ae=n.defineComponent({__name:"headDoc",props:{document:{type:typeof Document<"u"?Document:Object,required:!0},dateAuthorization:{type:String||void 0,default:void 0},logoUrl:{type:String,required:!1,default:void 0}},setup(t){const e=t,r=n.computed(()=>{var f;const d=e.document,l=d==null?void 0:d.getElementsByTagName("infoTributaria");if(!l)return{};const p={},u=(f=l.item(0))==null?void 0:f.children;if(u)for(let c=0;c<u.length;c++){const h=u[c];h!=null&&h.tagName&&(p[h.tagName||"na"]=h.textContent||"")}return p}),o=n.computed(()=>{var d,l;if((d=r.value)!=null&&d.claveAcceso){const p=k.getDataAccessKey((l=r.value)==null?void 0:l.claveAcceso);return p?p.typeWithName:""}return""}),a=n.computed(()=>{var c;const d=e.document;if(!d)return{};const l=["infoFactura","infoNotaCredito","infoGuiaRemision","infoCompRetencion"];let p=null;for(const h of l){const E=d.getElementsByTagName(h);if(E&&E.length>0){p=E;break}}if(!p)return{};const u={},f=(c=p.item(0))==null?void 0:c.children;if(f)for(let h=0;h<f.length;h++){const E=f[h];E!=null&&E.tagName&&(u[E.tagName]=E.textContent||"")}return u}),i=n.computed(()=>{var d,l;if((d=r.value)!=null&&d.claveAcceso){const p=k.getDataAccessKey((l=r.value)==null?void 0:l.claveAcceso);if(p)return p.mode==="2"?"PRODUCCIÓN":"PRUEBAS"}return""});return(d,l)=>(n.openBlock(),n.createElementBlock("div",mc,[n.createElementVNode("div",vc,[n.createElementVNode("div",pc,[t.logoUrl?(n.openBlock(),n.createElementBlock("img",{key:1,src:t.logoUrl,alt:"Logo",class:"w-full h-full object-contain"},null,8,Ec)):(n.openBlock(),n.createElementBlock("div",_c," NO TIENE LOGO "))]),n.createElementVNode("div",gc,[r.value.nombreComercial?(n.openBlock(),n.createElementBlock("div",yc,[n.createElementVNode("strong",null,n.toDisplayString(r.value.nombreComercial),1)])):n.createCommentVNode("",!0),n.createElementVNode("div",bc,[n.createElementVNode("strong",null,n.toDisplayString(r.value.razonSocial),1)]),n.createElementVNode("div",xc,[n.createElementVNode("div",Oc,[l[0]||(l[0]=n.createElementVNode("div",{class:"font-bold pr-2"}," Dirección Matriz ",-1)),n.createElementVNode("div",null,n.toDisplayString(r.value.dirMatriz),1)]),a.value.dirEstablecimiento?(n.openBlock(),n.createElementBlock("div",Nc,[l[1]||(l[1]=n.createElementVNode("div",{class:"font-bold pr-2"}," Dirección Sucursal ",-1)),n.createElementVNode("div",null,n.toDisplayString(a.value.dirEstablecimiento),1)])):n.createCommentVNode("",!0),a.value.contribuyenteEspecial?(n.openBlock(),n.createElementBlock("div",Sc,[l[2]||(l[2]=n.createElementVNode("div",{class:"pr-1 font-bold"}," CONTRIBUYENTE ESPECIAL ",-1)),n.createElementVNode("div",null,n.toDisplayString(a.value.contribuyenteEspecial),1)])):n.createCommentVNode("",!0),n.createElementVNode("div",kc,[l[3]||(l[3]=n.createElementVNode("div",{class:"pr-1 font-bold"}," OBLIGADO A LLEVAR CONTABILIDAD ",-1)),n.createElementVNode("div",null,n.toDisplayString(a.value.obligadoContabilidad),1)]),r.value.agenteRetencion?(n.openBlock(),n.createElementBlock("div",$c,[l[4]||(l[4]=n.createElementVNode("span",{class:"pr-1 font-bold"},"Agente de Retencion",-1)),n.createElementVNode("span",wc," Nº "+n.toDisplayString(r.value.agenteRetencion),1)])):n.createCommentVNode("",!0),r.value.contribuyenteRimpe?(n.openBlock(),n.createElementBlock("div",Ac,[n.createElementVNode("span",Dc,[r.value.contribuyenteRimpe==="CONTRIBUYENTE RÉGIMEN RIMPE"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createTextVNode(" CONTRIBUYENTE RÉGIMEN RIMPE ")],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createTextVNode(n.toDisplayString(r.value.contribuyenteRimpe),1)],64))])])):r.value.contribuyenteEspecial?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",Vc,[...l[5]||(l[5]=[n.createElementVNode("span",{class:"pr-1 font-bold"}," CONTRIBUYENTE RÉGIMEN GENERAL ",-1)])]))])])]),n.createElementVNode("div",Tc,[n.createElementVNode("div",null,[n.createElementVNode("strong",null,[l[6]||(l[6]=n.createElementVNode("span",{class:"text-2xl"}," R.U.C ",-1)),l[7]||(l[7]=n.createTextVNode()),n.createElementVNode("span",Bc,n.toDisplayString(r.value.ruc),1)])]),n.createElementVNode("div",Rc,[n.createElementVNode("strong",null,n.toDisplayString(o.value),1)]),n.createElementVNode("div",Ic,[n.createElementVNode("div",null,[l[8]||(l[8]=n.createElementVNode("div",{class:"font-bold"}," NUMERO COMPROBANTE ",-1)),n.createElementVNode("div",Cc,n.toDisplayString(r.value.estab)+"-"+n.toDisplayString(r.value.ptoEmi)+"-"+n.toDisplayString(r.value.secuencial),1)]),l[13]||(l[13]=n.createElementVNode("div",{class:"font-bold"}," NUMERO DE AUTORIZACIÓN ",-1)),n.createElementVNode("div",Pc,n.toDisplayString(r.value.claveAcceso),1),t.dateAuthorization?(n.openBlock(),n.createElementBlock("div",Mc,[l[9]||(l[9]=n.createElementVNode("div",{class:"font-bold pr-2"}," FECHA AUTORIZACIÓN ",-1)),n.createElementVNode("div",null,n.toDisplayString(n.unref(hc)(t.dateAuthorization,"dd/mm/yyyy HH:mm:ss")||"SRI"),1)])):n.createCommentVNode("",!0),n.createElementVNode("div",Lc,[l[10]||(l[10]=n.createElementVNode("div",{class:"font-bold pr-2"}," AMBIENTE ",-1)),n.createElementVNode("div",null,n.toDisplayString(i.value),1)]),n.createElementVNode("div",jc,[l[11]||(l[11]=n.createElementVNode("div",{class:"font-bold pr-2"}," EMISIÓN ",-1)),n.createElementVNode("div",null,n.toDisplayString(r.value.tipoEmision==="1"?"NORMAL":"ERROR"),1)]),l[14]||(l[14]=n.createElementVNode("div",{class:"text-center font-bold"}," CLAVE DE ACCESO ",-1)),n.createElementVNode("div",zc,n.toDisplayString(r.value.claveAcceso),1),n.createElementVNode("div",Uc,[n.createVNode(sc,{class:"flex-1 barcode",text:r.value.claveAcceso},null,8,["text"]),l[12]||(l[12]=n.createElementVNode("div",{id:"barcode"},null,-1))])])])]))}}),Fc={class:"w-full text-xs border border-accented"},Gc={class:"text-right border pr-1 border-accented"},Hc={class:"text-right w-24 border border-accented"},rn=n.defineComponent({__name:"tableSubtotals",props:{data:{type:typeof Document<"u"?Document:Object,required:!0}},setup(t){const e=t;return(r,o)=>(n.openBlock(),n.createElementBlock("table",Fc,[n.createElementVNode("tbody",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(k.getTotals)(e.data),(a,i)=>(n.openBlock(),n.createElementBlock("tr",{key:i},[n.createElementVNode("td",Gc,n.toDisplayString(a.name),1),n.createElementVNode("td",Hc,n.toDisplayString(n.unref(nn)(a.valor,"decimal")),1)]))),128))])]))}}),qc={class:"font-sans antialiased text-default max-w-6xl mx-auto print:mx-0 print:w-full m-1 rounded-md p-1 printContent"},Xc={key:0,class:"print:!hidden flex justify-end"},Yc={class:"font-bold text-primary"},Jc={class:"flex mt-2 text-sm"},Zc={class:"border border-default rounded-lg w-full px-1"},Wc={class:"flex-none flex"},Kc={class:"flex-none flex gap-x-2"},Qc={class:"font-bold pr-2"},eu={class:"flex-none flex"},tu={key:0},nu={key:0,class:"flex-none flex"},ru={class:"overflow-x-auto mt-1"},ou={class:"w-full table-bordered text-xs border border-default"},au={class:"flex justify-between gap-2 mt-2"},iu={class:"flex-1"},lu={key:0,class:"text-center font-bold mb-1"},cu={key:1,class:"mb-2"},uu={class:"text-xs w-full table-fixed border border-default"},du={class:"w-[100px] break-words !p-1 border border-default"},fu={class:"break-words !p-1 border border-default"},su={key:2,class:"w-full text-xs border border-default"},hu={class:"p-1 border border-default text-center"},mu={class:"p-1 border border-default text-right"},vu={class:"p-1 border border-default text-right"},pu={class:"p-1 border border-default"},_u={class:"rounded-lg mt-1 w-[320px] shrink-0"},Eu={class:"w-full text-xs"},on=n.defineComponent({__name:"factura",props:{document:{type:typeof Document<"u"?Document:Object,required:!0},dateAuthorization:{type:String,required:!1,default:void 0},logoUrl:{type:String,required:!1,default:void 0}},setup(t){const e=t,r=k.getInfoFactura(e.document),o=k.getInfoAdicional(e.document),a=k.getPagos(e.document),i=n.computed(()=>{var f;const u=(f=k.TYPE_IDENTITY.find(c=>c.value==r.tipoIdentificacionComprador))==null?void 0:f.label;return u||"NO ENCONTRADO"}),d=k.getDetailsFc(e.document);function l(){if(d.length===0)return[];const u=d.some(E=>E.codigoAuxiliar),f=d.some(E=>E.unidadMedida),c=d[0],h=["#"];return c!=null&&c.codigoPrincipal&&h.push("COD"),u&&h.push("COD.aux"),c!=null&&c.descripcion&&h.push("Descripcion"),c!=null&&c.cantidad&&h.push("CANT"),f&&h.push("UNIDAD"),c!=null&&c.precioUnitario&&h.push("PVP"),c!=null&&c.descuento&&h.push("DESC"),c!=null&&c.detallesAdicionales&&(c==null||c.detallesAdicionales.detAdicional.forEach(E=>{h.push(E["@nombre"])})),c!=null&&c.precioTotalSinImpuesto&&h.push("TOTAL"),h}function p(){let u=[];const f=[];let c=[];u=d;const h=u.some(_=>_.codigoAuxiliar),E=u.some(_=>_.unidadMedida);return u.forEach((_,S)=>{c=[],c.push({valor:S+1,clase:"text-center"}),_.codigoPrincipal&&c.push({valor:_.codigoPrincipal}),h&&c.push({valor:_.codigoAuxiliar??""}),_.descripcion&&c.push({valor:_.descripcion}),_.cantidad&&c.push({valor:_.cantidad,clase:"text-right"}),E&&c.push({valor:_.unidadMedida??"",clase:"text-right"}),_.precioUnitario&&c.push({valor:_.precioUnitario,clase:"text-right"}),_.descuento&&c.push({valor:_.descuento,clase:"text-right"}),_.detallesAdicionales&&_.detallesAdicionales.detAdicional.forEach(v=>{c.push({valor:v["@valor"]})}),_.precioTotalSinImpuesto&&c.push({valor:_.precioTotalSinImpuesto,clase:"text-right"}),f.push(c)}),f}return(u,f)=>(n.openBlock(),n.createElementBlock("div",qc,[t.dateAuthorization?(n.openBlock(),n.createElementBlock("div",Xc,[n.createElementVNode("div",Yc," Documento autorizado el "+n.toDisplayString(t.dateAuthorization??"SIN FECHA"),1)])):n.createCommentVNode("",!0),n.createVNode(ae,{document:t.document,logoUrl:t.logoUrl,dateAuthorization:t.dateAuthorization},null,8,["document","logoUrl","dateAuthorization"]),n.createElementVNode("div",Jc,[n.createElementVNode("div",Zc,[n.createElementVNode("div",Wc,[f[0]||(f[0]=n.createElementVNode("div",{class:"font-bold pr-2"}," Razón Social / Nombres y Apellidos : ",-1)),n.createElementVNode("div",null,n.toDisplayString(n.unref(r).razonSocialComprador||"no hay"),1)]),n.createElementVNode("div",Kc,[f[1]||(f[1]=n.createElementVNode("div",{class:"font-bold"}," Identificación: ",-1)),n.createElementVNode("div",null,n.toDisplayString(n.unref(r).identificacionComprador||"no hay"),1),n.createElementVNode("div",Qc,n.toDisplayString(n.unref(r).tipoIdentificacionComprador)+": "+n.toDisplayString(i.value),1)]),n.createElementVNode("div",eu,[f[2]||(f[2]=n.createElementVNode("div",{class:"font-bold pr-2"}," FECHA EMISION: ",-1)),n.createElementVNode("div",null,n.toDisplayString(n.unref(r).fechaEmision),1),f[3]||(f[3]=n.createElementVNode("div",{class:"font-bold pr-2 pl-4"}," GUIA: ",-1)),n.unref(r).guiaRemision?(n.openBlock(),n.createElementBlock("div",tu,n.toDisplayString(n.unref(r).guiaRemision),1)):n.createCommentVNode("",!0)]),n.unref(r).direccionComprador?(n.openBlock(),n.createElementBlock("div",nu,[f[4]||(f[4]=n.createElementVNode("div",{class:"font-bold pr-2"}," Dirección: ",-1)),n.createElementVNode("div",null,n.toDisplayString(n.unref(r).direccionComprador),1)])):n.createCommentVNode("",!0)])]),n.createElementVNode("div",ru,[n.createElementVNode("table",ou,[n.createElementVNode("thead",null,[n.createElementVNode("tr",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l(),(c,h)=>(n.openBlock(),n.createElementBlock("th",{key:h,class:"border border-default"},n.toDisplayString(c),1))),128))])]),n.createElementVNode("tbody",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(p(),(c,h)=>(n.openBlock(),n.createElementBlock("tr",{key:h},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(c,(E,_)=>(n.openBlock(),n.createElementBlock("td",{key:_,class:n.normalizeClass(["break-words border border-default",E.clase?E.clase:""])},n.toDisplayString(E.valor),3))),128))]))),128))])])]),n.createElementVNode("div",au,[n.createElementVNode("div",iu,[n.unref(o)?(n.openBlock(),n.createElementBlock("div",lu," Información Adicional ")):n.createCommentVNode("",!0),n.unref(o)?(n.openBlock(),n.createElementBlock("div",cu,[n.createElementVNode("table",uu,[n.createElementVNode("tbody",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(o),(c,h)=>(n.openBlock(),n.createElementBlock("tr",{key:h},[n.createElementVNode("td",du,n.toDisplayString(c.name),1),n.createElementVNode("td",fu,n.toDisplayString(c.value),1)]))),128))])])])):n.createCommentVNode("",!0),n.unref(a)?(n.openBlock(),n.createElementBlock("table",su,[f[5]||(f[5]=n.createElementVNode("thead",null,[n.createElementVNode("tr",{class:"text-left"},[n.createElementVNode("th",{class:"p-1 border border-default"}," Forma de pago "),n.createElementVNode("th",{class:"p-1 border border-default text-right"}," Valor "),n.createElementVNode("th",{class:"p-1 border border-default text-right"}," PLAZO "),n.createElementVNode("th",{class:"p-1 border border-default"}," TIEMPO ")])],-1)),n.createElementVNode("tbody",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(a),(c,h)=>(n.openBlock(),n.createElementBlock("tr",{key:h},[n.createElementVNode("td",hu,n.toDisplayString(c.formaPago),1),n.createElementVNode("td",mu,n.toDisplayString(c.total),1),n.createElementVNode("td",vu,n.toDisplayString(c.plazo),1),n.createElementVNode("td",pu,n.toDisplayString(c.unidadTiempo),1)]))),128))])])):n.createCommentVNode("",!0)]),n.createElementVNode("div",_u,[n.createElementVNode("table",Eu,[n.createVNode(rn,{data:t.document},null,8,["data"])])])])]))}}),gu={class:"max-w-5xl mx-auto bg-default text-default m-1 rounded-md p-1 printContent print:mx-0 print:w-screen"},yu={key:0,class:"print:!hidden flex justify-end"},bu={class:"font-bold text-primary"},xu={class:"border border-default rounded-lg w-full mt-8 p-2"},Ou={class:"flex-none flex"},Nu={class:"font-bold mx-2"},Su={class:"flex"},ku={class:"flex"},$u={class:"flex gap-x-2"},wu={class:"mx-10"},Au={class:"flex"},Du={class:"flex justify-between items-center"},Vu={class:"font-bold text-2xl"},Tu={class:"border border-default rounded-lg w-full mt-8 p-1"},Bu={class:"overflow-x-auto"},Ru={class:"w-full table-bordered text-xs border border-default"},Iu={class:"bg-muted"},Cu={class:"flex justify-between gap-4 mt-2 p-1"},Pu={class:"border border-default rounded-lg w-1/2 p-2"},Mu={key:0,class:"text-xs w-full table-fixed"},Lu={class:"break-words font-bold bg-muted p-1 border border-default w-[120px]"},ju={class:"break-words p-1 border border-default"},zu={class:"rounded-lg w-1/2"},an=n.defineComponent({__name:"notaCredito",props:{document:{type:typeof Document<"u"?Document:Object,required:!0},authorization:{type:String,required:!1,default:void 0},logoUrl:{type:String,required:!1,default:void 0}},setup(t){const e=t;n.computed(()=>k.getInfoTributaria(e.document));const r=n.computed(()=>k.getInfoAdicional(e.document)),o=n.computed(()=>k.getDetailsFc(e.document)),a=n.computed(()=>{const p=e.document.getElementsByTagName("infoNotaCredito");if(!p||p.length===0)return{};const u=p[0],f={};for(let c=0;c<u.children.length;c++){const h=u.children[c];f[h.tagName]=h.textContent||""}return f});function i(p,u=0){switch(u){case 0:switch(p){case"05":return"Cedula";case"04":return"RUC";case"06":return"Pasaporte";case"07":return"Consumidor final";case"08":return"Identificacion extranjera";case"09":return"Placa"}break;case 1:switch(p){case"01":return"FACTURA";case"04":return"NOTA DE CREDITO";case"05":return"NOTA DE DEBITO";case"06":return"GUIA DE REMISION";case"07":return"COMPROBANTE DE RETENCION";default:return"FACTURA"}case 2:switch(p){case"2":return"RENTA";case"1":return"IVA"}}return""}function d(){if(o.value.length===0)return[];const p=o.value[0],u=["#"];return p.codigoPrincipal&&u.push("COD"),p.codigoAuxiliar&&u.push("COD.aux"),p.descripcion&&u.push("Descripcion"),p.cantidad&&u.push("CANT"),p.precioUnitario&&u.push("PVP"),p.descuento&&u.push("DESC"),p.precioTotalSinImpuesto&&u.push("TOTAL"),u}function l(){const p=[];return o.value.forEach((u,f)=>{const c=[];c.push({valor:f+1}),u.codigoPrincipal&&c.push({valor:u.codigoPrincipal}),u.codigoAuxiliar&&c.push({valor:u.codigoAuxiliar}),u.descripcion&&c.push({valor:u.descripcion}),u.cantidad&&c.push({valor:u.cantidad,clase:"text-right"}),u.precioUnitario&&c.push({valor:u.precioUnitario,clase:"text-right"}),u.descuento&&c.push({valor:u.descuento,clase:"text-right"}),u.precioTotalSinImpuesto&&c.push({valor:u.precioTotalSinImpuesto,clase:"text-right"}),p.push(c)}),p}return(p,u)=>(n.openBlock(),n.createElementBlock("div",gu,[t.authorization?(n.openBlock(),n.createElementBlock("div",yu,[n.createElementVNode("div",bu," Documento autorizado el "+n.toDisplayString(t.authorization),1)])):n.createCommentVNode("",!0),n.createVNode(ae,{document:t.document,logoUrl:t.logoUrl,dateAuthorization:t.authorization},null,8,["document","logoUrl","dateAuthorization"]),n.createElementVNode("div",xu,[n.createElementVNode("div",Ou,[u[0]||(u[0]=n.createElementVNode("div",{class:"font-bold pr-2"}," Razón Social / Nombres y Apellidos : ",-1)),n.createElementVNode("div",null,n.toDisplayString(a.value.razonSocialComprador),1),u[1]||(u[1]=n.createElementVNode("div",{class:"font-bold pr-2 mx-2"}," Identificacion : ",-1)),n.createElementVNode("div",null,n.toDisplayString(a.value.identificacionComprador),1),n.createElementVNode("div",Nu," ("+n.toDisplayString(i(a.value.tipoIdentificacionComprador,0))+") ",1)]),n.createElementVNode("div",Su,[n.createElementVNode("div",ku,[u[2]||(u[2]=n.createElementVNode("div",{class:"font-bold pr-2"}," Fecha Emisión : ",-1)),n.createElementVNode("div",null,n.toDisplayString(a.value.fechaEmision),1)])]),u[7]||(u[7]=n.createElementVNode("div",{class:"py-4"},[n.createElementVNode("hr",{class:"border-default"})],-1)),n.createElementVNode("div",null,[n.createElementVNode("div",$u,[u[3]||(u[3]=n.createElementVNode("div",{class:"font-bold pr-2"}," Comprobante que se modifica : ",-1)),n.createElementVNode("div",null,n.toDisplayString(i(a.value.codDocModificado,1)),1),n.createElementVNode("div",wu,n.toDisplayString(a.value.numDocModificado),1)]),n.createElementVNode("div",Au,[u[4]||(u[4]=n.createElementVNode("div",{class:"font-bold pr-2"}," Fecha Emision (Comprobante a modificar) : ",-1)),n.createElementVNode("div",null,n.toDisplayString(a.value.fechaEmisionDocSustento),1)]),n.createElementVNode("div",Du,[u[5]||(u[5]=n.createElementVNode("div",{class:"font-bold pr-2"}," Razón de Modificación: ",-1)),n.createElementVNode("div",Vu,n.toDisplayString(a.value.motivo),1),u[6]||(u[6]=n.createElementVNode("div",{class:"mx-10"},null,-1))])])]),n.createElementVNode("div",Tu,[n.createElementVNode("div",Bu,[n.createElementVNode("table",Ru,[n.createElementVNode("thead",null,[n.createElementVNode("tr",Iu,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d(),(f,c)=>(n.openBlock(),n.createElementBlock("th",{key:c,class:"border border-default p-1 text-left"},n.toDisplayString(f),1))),128))])]),n.createElementVNode("tbody",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l(),(f,c)=>(n.openBlock(),n.createElementBlock("tr",{key:c},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(f,(h,E)=>(n.openBlock(),n.createElementBlock("td",{key:E,class:n.normalizeClass(["break-words border border-default p-1",h.clase?h.clase:""])},n.toDisplayString(h.valor),3))),128))]))),128))])])]),n.createElementVNode("div",Cu,[n.createElementVNode("div",Pu,[u[8]||(u[8]=n.createElementVNode("div",{class:"text-center font-bold mb-1"}," Información Adicional ",-1)),n.createElementVNode("div",null,[r.value&&r.value.length>0?(n.openBlock(),n.createElementBlock("table",Mu,[n.createElementVNode("tbody",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(r.value,(f,c)=>(n.openBlock(),n.createElementBlock("tr",{key:c},[n.createElementVNode("td",Lu,n.toDisplayString(f.name),1),n.createElementVNode("td",ju,n.toDisplayString(f.value),1)]))),128))])])):n.createCommentVNode("",!0)])]),n.createElementVNode("div",zu,[n.createVNode(rn,{data:t.document},null,8,["data"])])])])]))}}),Uu={class:"text-xs flex flex-col gap-2 max-w-5xl mx-auto bg-default text-default m-1 rounded-md p-1 printContent print:mx-0 print:w-full"},Fu={key:0,class:"print:!hidden flex justify-end"},Gu={class:"font-bold text-primary"},Hu={class:"border border-default rounded-lg p-2 mt-2"},qu={class:"grid grid-cols-2 gap-2"},Xu={class:"bg-muted px-2 py-0.5 rounded font-mono font-bold"},Yu={class:"grid grid-cols-[200px_1fr] gap-y-1"},Ju={class:"font-bold uppercase text-primary"},Zu={class:"ml-5"},Wu={class:"font-bold"},Ku={class:"font-bold"},Qu={class:"font-bold"},ed={class:"font-bold"},td={class:"font-bold"},nd={class:"font-bold"},rd={class:"font-bold"},od={class:"p-2 mt-2"},ad={class:"w-full border border-default text-xs"},id={class:"bg-muted text-left text-default"},ld={key:1,class:"mx-20 mt-2"},cd={class:"text-xs w-full table-fixed border border-default"},ud={class:"w-1/3 break-words !p-1 border border-default font-bold bg-muted"},dd={class:"w-2/3 break-words !p-1 border border-default"},ln=n.defineComponent({__name:"guiaRemision",props:{document:{type:typeof Document<"u"?Document:Object,required:!0},authorization:{type:String,required:!1,default:void 0},logoUrl:{type:String,required:!1,default:void 0}},setup(t){const e=t,r=n.computed(()=>{const u=e.document,f=u==null?void 0:u.getElementsByTagName("infoGuiaRemision").item(0);if(!f)return{};const c={};for(let h=0;h<f.children.length;h++){const E=f.children[h];c[E.tagName]=E.textContent||""}return c}),o=n.computed(()=>{const u=e.document,f=u==null?void 0:u.getElementsByTagName("destinatario");if(!f)return[];const c=[];for(let h=0;h<f.length;h++){const E=f.item(h);if(!E)continue;const _={};for(let v=0;v<E.children.length;v++){const s=E.children[v];s.tagName!=="detalles"&&(_[s.tagName]=s.textContent||"")}_.detalles=[];const S=E.getElementsByTagName("detalle");for(let v=0;v<S.length;v++){const s=S.item(v);if(!s)continue;const m={};for(let g=0;g<s.children.length;g++){const b=s.children[g];if(b.tagName==="detallesAdicionales"){m.detallesAdicionales=[];const y=b.getElementsByTagName("detAdicional");for(let x=0;x<y.length;x++){const N=y.item(x);N&&m.detallesAdicionales.push({nombre:N.getAttribute("nombre")||"",valor:N.getAttribute("valor")||N.textContent||""})}}else m[b.tagName]=b.textContent||""}_.detalles.push(m)}c.push(_)}return c}),a=k.getInfoAdicional(e.document);function i(u){const f=new Set;return u.forEach(c=>{c.detallesAdicionales&&Array.isArray(c.detallesAdicionales)&&c.detallesAdicionales.forEach(h=>{h.nombre&&f.add(h.nombre)})}),Array.from(f)}function d(u){if(u.length===0)return[];const f=[{label:"#",headerClassName:"text-center"}];return f.push({label:"CANT",headerClassName:"text-center"}),f.push({label:"Descripción"}),u.some(_=>_.codigoInterno)&&f.push({label:"Còdigo Princial"}),u.some(_=>_.codigoAdicional)&&f.push({label:"COD.aux"}),i(u).forEach(_=>{f.push({label:_})}),f}function l(u){const f=[],c=u.some(_=>_.codigoInterno),h=u.some(_=>_.codigoAdicional),E=i(u);return u.forEach((_,S)=>{const v=[];v.push({valor:S+1,clase:"text-center"}),v.push({valor:_.cantidad||"0",clase:"text-right font-bold"}),v.push({valor:_.descripcion||""}),c&&v.push({valor:_.codigoInterno||""}),h&&v.push({valor:_.codigoAdicional||""}),E.forEach(s=>{let m="";if(_.detallesAdicionales&&Array.isArray(_.detallesAdicionales)){const g=_.detallesAdicionales.find(b=>b.nombre===s);g&&(m=g.valor)}v.push({valor:m})}),f.push(v)}),f}function p(u){switch(u){case"01":return"Factura";case"04":return"Nota de Crédito";case"05":return"Nota de Débito";default:return"Comprobante"}}return(u,f)=>(n.openBlock(),n.createElementBlock("div",Uu,[t.authorization?(n.openBlock(),n.createElementBlock("div",Fu,[n.createElementVNode("div",Gu," Documento autorizado el "+n.toDisplayString(t.authorization),1)])):n.createCommentVNode("",!0),n.createVNode(ae,{document:t.document,dateAuthorization:t.authorization,logoUrl:t.logoUrl},null,8,["document","dateAuthorization","logoUrl"]),n.createElementVNode("div",Hu,[n.createElementVNode("div",qu,[n.createElementVNode("div",null,[f[0]||(f[0]=n.createElementVNode("span",{class:"font-bold text-dimmed"},"Transportista (Razón Social):",-1)),n.createTextVNode(" "+n.toDisplayString(r.value.razonSocialTransportista),1)]),n.createElementVNode("div",null,[f[1]||(f[1]=n.createElementVNode("span",{class:"font-bold text-dimmed"},"R.U.C. / C.I.:",-1)),n.createTextVNode(" "+n.toDisplayString(r.value.rucTransportista),1)]),n.createElementVNode("div",null,[f[2]||(f[2]=n.createElementVNode("span",{class:"font-bold text-dimmed"},"Placa del Vehículo:",-1)),f[3]||(f[3]=n.createTextVNode()),n.createElementVNode("span",Xu,n.toDisplayString(r.value.placa),1)]),n.createElementVNode("div",null,[f[4]||(f[4]=n.createElementVNode("span",{class:"font-bold text-dimmed"},"Punto de Partida:",-1)),n.createTextVNode(" "+n.toDisplayString(r.value.dirPartida),1)]),n.createElementVNode("div",null,[f[5]||(f[5]=n.createElementVNode("span",{class:"font-bold text-dimmed"},"Fecha Inicio Transporte:",-1)),n.createTextVNode(" "+n.toDisplayString(r.value.fechaIniTransporte),1)]),n.createElementVNode("div",null,[f[6]||(f[6]=n.createElementVNode("span",{class:"font-bold text-dimmed"},"Fecha Fin Transporte:",-1)),n.createTextVNode(" "+n.toDisplayString(r.value.fechaFinTransporte),1)])])]),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(o.value,(c,h)=>(n.openBlock(),n.createElementBlock("div",{key:h,class:"border border-default rounded-lg p-2 mt-2"},[n.createElementVNode("div",Yu,[c.numDocSustento?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[f[8]||(f[8]=n.createElementVNode("div",{class:"text-dimmed"}," Comprobante de venta: ",-1)),n.createElementVNode("div",null,[n.createElementVNode("span",Ju,n.toDisplayString(p(c.codDocSustento??""))+" "+n.toDisplayString(c.numDocSustento),1),n.createElementVNode("span",Zu,[f[7]||(f[7]=n.createTextVNode(" Fecha de emisión: ",-1)),n.createElementVNode("span",Wu,n.toDisplayString(c.fechaEmisionDocSustento),1)])]),f[9]||(f[9]=n.createElementVNode("div",{class:"text-dimmed"}," Numero de autorización: ",-1)),n.createElementVNode("div",null,[n.createElementVNode("span",Ku,n.toDisplayString(c.numAutDocSustento),1)])],64)):n.createCommentVNode("",!0),f[10]||(f[10]=n.createElementVNode("div",{class:"text-dimmed"}," Motivo de Traslado: ",-1)),n.createElementVNode("div",Qu,n.toDisplayString(c.motivoTraslado),1),f[11]||(f[11]=n.createElementVNode("div",{class:"text-dimmed"}," DESTINO (punto de llegada) : ",-1)),n.createElementVNode("div",ed,n.toDisplayString(c.dirDestinatario),1),f[12]||(f[12]=n.createElementVNode("div",{class:"text-dimmed"}," Identificación(Destinatario) : ",-1)),n.createElementVNode("div",td,n.toDisplayString(c.identificacionDestinatario),1),f[13]||(f[13]=n.createElementVNode("div",{class:"text-dimmed"}," Nombre / Razón Social ",-1)),n.createElementVNode("div",nd,n.toDisplayString(c.razonSocialDestinatario),1),f[14]||(f[14]=n.createElementVNode("div",{class:"text-dimmed"}," Ruta: ",-1)),n.createElementVNode("div",rd,n.toDisplayString(c.ruta??""),1)]),n.createElementVNode("div",od,[n.createElementVNode("table",ad,[n.createElementVNode("thead",null,[n.createElementVNode("tr",id,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d(c.detalles),(E,_)=>(n.openBlock(),n.createElementBlock("th",{key:_,class:n.normalizeClass(["border border-default p-1 font-bold",E.headerClassName?E.headerClassName:""])},n.toDisplayString(E.label),3))),128))])]),n.createElementVNode("tbody",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l(c.detalles),(E,_)=>(n.openBlock(),n.createElementBlock("tr",{key:_},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(E,(S,v)=>(n.openBlock(),n.createElementBlock("td",{key:v,class:n.normalizeClass(["border border-default p-1 break-words",S.clase?S.clase:""])},n.toDisplayString(S.valor),3))),128))]))),128))])])])]))),128)),n.unref(a)&&n.unref(a).length>0?(n.openBlock(),n.createElementBlock("div",ld,[n.createElementVNode("table",cd,[f[15]||(f[15]=n.createElementVNode("thead",null,[n.createElementVNode("tr",{class:"bg-muted text-default"},[n.createElementVNode("th",{colspan:"2",class:"p-1 text-center font-bold border border-default"}," INFORMACIÓN ADICIONAL ")])],-1)),n.createElementVNode("tbody",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(a),(c,h)=>(n.openBlock(),n.createElementBlock("tr",{key:h},[n.createElementVNode("td",ud,n.toDisplayString(c.name),1),n.createElementVNode("td",dd,n.toDisplayString(c.value),1)]))),128))])])])):n.createCommentVNode("",!0)]))}}),fd={class:"text-xs flex flex-col gap-1 max-w-5xl mx-auto bg-default text-default m-1 rounded-md p-1 printContent print:mx-0 print:w-full"},sd={key:0,class:"print:!hidden flex justify-end"},hd={class:"font-bold text-primary"},md={class:"flex mt-5"},vd={class:"border border-default rounded-lg w-full p-2"},pd={class:"flex-none flex"},_d={class:"flex-none flex"},Ed={class:"mx-2 font-bold text-primary"},gd={class:"flex-none flex"},yd={key:0},bd={key:1},xd={key:0},Od={class:"flex gap-2 mb-2"},Nd={class:"flex gap-2"},Sd={class:"flex gap-2"},kd={class:"font-bold text-dimmed"},$d={class:"px-2 rounded-md border border-default bg-muted"},wd={key:0,class:"flex mx-4"},Ad={class:"flex gap-4 mb-2"},Dd={class:"text-center"},Vd={key:0},Td={class:"text-center"},Bd={class:"text-center"},Rd={class:"text-center"},Id={class:"text-center"},Cd={class:"hidden"},Pd={class:"w-full"},Md={key:0,class:"w-full text-xs border border-default"},Ld={class:"border border-default p-1 text-center"},jd={class:"border border-default p-1 text-right"},zd={class:"border border-default p-1 text-right"},Ud={class:"border border-default p-1"},Fd={class:"w-full"},Gd={key:0,class:"w-full text-xs border border-default"},Hd={class:"border border-default p-1 text-right"},qd={class:"border border-default p-1 text-right"},Xd={class:"border border-default p-1 text-right"},Yd={class:"px-2 pt-2"},Jd={class:"border border-default rounded-lg mb-2 p-1"},Zd={class:"w-full table-bordered text-xs"},Wd={class:"bg-muted"},Kd=["colspan"],Qd={class:"bg-muted"},ef={class:"break-words border border-default p-1"},tf={class:"break-words border border-default p-1 text-center"},nf={class:"break-words border border-default p-1"},rf={class:"break-words border border-default p-1 text-right"},of={class:"break-words border border-default p-1 text-right"},af={class:"break-words border border-default p-1 text-right"},lf={class:"bg-muted"},cf={class:"text-right border border-default p-1 font-bold"},uf={class:"px-2 py-0.5 rounded bg-primary/15 text-primary ml-1 font-bold"},df={key:1,class:"border border-default rounded-lg p-2 mt-4"},ff={class:"border border-default rounded-lg mb-2 p-1"},sf={class:"w-full table-bordered text-xs"},hf={class:"bg-muted text-primary"},mf=["colspan"],vf={class:"bg-muted"},pf={class:"break-words border border-default p-1 text-center"},_f={class:"break-words border border-default p-1 text-center"},Ef={class:"break-words border border-default p-1"},gf={class:"break-words border border-default p-1"},yf={class:"break-words border border-default p-1 text-right"},bf={class:"break-words border border-default p-1 text-right"},xf={class:"break-words border border-default p-1 text-right"},Of={class:"break-words border border-default p-1 text-right"},Nf={class:"bg-muted"},Sf={class:"text-right border border-default p-1 font-bold"},kf={class:"px-2 py-0.5 rounded bg-primary/15 text-primary ml-1 font-bold"},$f={class:"p-4"},wf={class:"border border-default rounded-lg w-full mt-2 p-2"},Af={key:0,class:"text-xs w-full table-fixed border border-default"},Df={class:"w-1/3 break-words p-1 border border-default font-bold bg-muted"},Vf={class:"w-full break-words p-1 border border-default"},cn=n.defineComponent({__name:"retencion",props:{document:{type:typeof Document<"u"?Document:Object,required:!0},authorization:{type:String,required:!1,default:void 0}},setup(t){const e=t,r=n.computed(()=>{var v,s;return(s=(v=e.document)==null?void 0:v.getElementsByTagName("comprobanteRetencion").item(0))==null?void 0:s.getAttribute("version")}),o=k.getInfoAdicional(e.document);function a(v){return k.nameCodeRetention(v)}function i(v,s=0){switch(s){case 0:switch(v){case"05":return"Cedula";case"04":return"RUC";case"06":return"Pasaporte";case"07":return"Consumidor final";case"08":return"Identificacion extranjera";case"09":return"Placa"}break;case 1:switch(v){case"01":return"FACTURA";case"04":return"NOTA DE CREDITO";case"05":return"NOTA DE DEBITO";case"06":return"GUIA DE REMISION";case"07":return"COMPROBANTE DE RETENCION";default:return"FACTURA"}case 2:switch(v){case"2":return"IVA";case"1":return"RENTA"}}}function d(){return["#","TIPO","CODIGO","PORCENTAJE","BASE IMPONIBLE","VALOR"]}function l(){return["Comprobante","Número","Fecha Emisión","Ejercicio Fiscal","Base Imponible para la Retención","Impuesto","Porcentaje Retención","Valor Retenido"]}function p(v){const s=v.substring(0,3),m=v.substring(3,6),g=v.substring(6,15);return`${s}-${m}-${g}`}function u(v){const s=[{name:"SIN UTILIZACION DEL SISTEMA FINANCIERO",value:"01"},{name:"COMPENSACIÓN DE DEUDAS",value:"15"},{name:"TARJETA DE DÉBITO",value:"16"},{name:"DINERO ELECTRÓNICO",value:"17"},{name:"TARJETA PREPAGO",value:"18"},{name:"TARJETA DE CRÉDITO",value:"19"},{name:"OTROS CON UTILIZACION DEL SISTEMA FINANCIERO",value:"20"},{name:"ENDOSO DE TÍTULOS",value:"21"}];return v.map(g=>{var b;return{formaPago:((b=s.find(y=>y.value===g.formaPago))==null?void 0:b.name)||"",total:g.total,plazo:g.plazo&&g.plazo||0,unidadTiempo:g.unidadTiempo&&g.unidadTiempo||0}})}function f(v){const s=[{name:"IVA",value:"2"},{name:"ICE",value:"3"},{name:"IRBPNR",value:"5"}],m=[{name:"0%",value:"0"},{name:"IVA 12% ",value:"2"},{name:"IVA 15% ",value:"7"},{name:"IVA 5% ",value:"6"},{name:"IVA 5% ",value:"6"},{name:"IVA 14%",value:"3"},{name:"No Objeto de Impuesto",value:"6"},{name:"Exento de IVA",value:"7"}];return v.map(b=>{var y,x;return{typeTax:((y=s.find(N=>N.value===b.codImpuestoDocSustento))==null?void 0:y.name)||"",typePor:((x=m.find(N=>N.value===b.codigoPorcentaje))==null?void 0:x.name)||"",tarifa:b.tarifa,baseImponible:b.baseImponible,valor:b.valorImpuesto}})}const c=n.computed(()=>{const v=e.document;if(!v)return[];const s=v.getElementsByTagName("impuesto"),m=[];for(let g=0;g<s.length;g++){const b=s[g],y={};if(b){for(let x=0;x<b.children.length;x++){const N=b.children[x];N&&(y[N.tagName]=N.textContent||"")}m.push(y)}}return m}),h=n.computed(()=>{const v=e.document;if(!v)return[];const s=v.getElementsByTagName("docSustento"),m=[];for(let g=0;g<s.length;g++){const b=s[g],y={};if(b){for(let x=0;x<b.children.length;x++){const N=b.children[x];if(N&&(N.tagName==="impuestosDocSustento"||N.tagName==="retenciones"||N.tagName==="pagos")){y[N.tagName]=[];for(let xe=0;xe<N.children.length;xe++){const Oe=N.children[xe];if(!Oe)continue;const ht={};for(let Ne=0;Ne<Oe.children.length;Ne++){const Se=Oe.children[Ne];Se&&(ht[Se.tagName]=Se.textContent||"")}y[N.tagName].push(ht)}}else N&&(y[N.tagName]=N.textContent||"")}m.push(y)}}return m}),E=n.computed(()=>{const v=c.value;let s=0;return v.forEach(m=>{s+=Number.parseFloat(m.valorRetenido||"0")}),At(s,2)}),_=n.computed(()=>{const v=h.value;let s=0;return v.forEach(m=>{m.retenciones.forEach(g=>{s+=Number.parseFloat(g.valorRetenido)})}),At(s,2)}),S=n.computed(()=>{var b;const v=e.document,s=v==null?void 0:v.getElementsByTagName("infoCompRetencion");if(!s)return{};const m={},g=(b=s.item(0))==null?void 0:b.children;if(g)for(let y=0;y<g.length;y++){const x=g[y];x!=null&&x.tagName&&(m[x.tagName||"na"]=x.textContent||"")}return m});return(v,s)=>(n.openBlock(),n.createElementBlock("div",fd,[t.authorization?(n.openBlock(),n.createElementBlock("div",sd,[n.createElementVNode("div",hd," Documento autorizado el "+n.toDisplayString(t.authorization),1)])):n.createCommentVNode("",!0),n.createVNode(ae,{document:t.document,dateAuthorization:t.authorization},null,8,["document","dateAuthorization"]),n.createElementVNode("div",md,[n.createElementVNode("div",vd,[n.createElementVNode("div",pd,[s[0]||(s[0]=n.createElementVNode("div",{class:"font-bold pr-2 text-dimmed"}," Razón Social / Nombres y Apellidos : ",-1)),n.createElementVNode("div",null,n.toDisplayString(S.value.razonSocialSujetoRetenido),1)]),n.createElementVNode("div",_d,[s[1]||(s[1]=n.createElementVNode("div",{class:"font-bold pr-2 text-dimmed"}," Identificación: ",-1)),n.createElementVNode("div",null,n.toDisplayString(S.value.identificacionSujetoRetenido),1),n.createElementVNode("div",Ed," ("+n.toDisplayString(i(S.value.tipoIdentificacionSujetoRetenido))+") ",1)]),n.createElementVNode("div",gd,[s[2]||(s[2]=n.createElementVNode("div",{class:"font-bold pr-2 text-dimmed"}," FECHA EMISION: ",-1)),n.createElementVNode("div",null,n.toDisplayString(S.value.fechaEmision),1),s[3]||(s[3]=n.createElementVNode("div",{class:"font-bold pr-2 pl-4 text-dimmed"}," Es obligado a llevar Contabilidad: ",-1)),S.value.obligadoContabilidad?(n.openBlock(),n.createElementBlock("div",yd,n.toDisplayString(S.value.obligadoContabilidad),1)):n.createCommentVNode("",!0),s[4]||(s[4]=n.createElementVNode("div",{class:"font-bold pr-2 pl-4 text-dimmed"}," Parte Relacionada: ",-1)),n.createElementVNode("div",null,n.toDisplayString(S.value.parteRel??"NO"),1),s[5]||(s[5]=n.createElementVNode("div",{class:"font-bold pr-2 pl-4 text-dimmed"}," Periodo Fiscal: ",-1)),S.value.periodoFiscal?(n.openBlock(),n.createElementBlock("div",bd,n.toDisplayString(S.value.periodoFiscal),1)):n.createCommentVNode("",!0)]),r.value==="2.0.0"?(n.openBlock(),n.createElementBlock("div",xd,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(h.value,(m,g)=>{var b;return n.openBlock(),n.createElementBlock("div",{key:g,class:"border border-default rounded-lg p-2 mt-4"},[s[17]||(s[17]=n.createElementVNode("div",{class:"text-center font-bold italic text-primary"}," DATOS DOCUMENTOS DE SUSTENTO V2.0.0 ",-1)),n.createElementVNode("div",Od,[n.createElementVNode("div",Nd,[n.createElementVNode("div",Sd,[n.createElementVNode("div",kd,n.toDisplayString(i(m.codDocSustento,1)),1),n.createElementVNode("div",$d,n.toDisplayString(p(m.numDocSustento)),1)]),m.numAutDocSustento?(n.openBlock(),n.createElementBlock("div",wd,[s[6]||(s[6]=n.createElementVNode("div",{class:"font-bold text-dimmed"}," Numero Autorización: ",-1)),n.createElementVNode("div",null,n.toDisplayString(m.numAutDocSustento),1)])):n.createCommentVNode("",!0)])]),n.createElementVNode("div",Ad,[n.createElementVNode("div",null,[s[7]||(s[7]=n.createElementVNode("div",{class:"font-bold text-dimmed"}," Fecha Emisión: ",-1)),n.createElementVNode("div",Dd,n.toDisplayString(m.fechaEmisionDocSustento),1)]),m.fechaRegistroContable?(n.openBlock(),n.createElementBlock("div",Vd,[s[8]||(s[8]=n.createElementVNode("div",{class:"font-bold text-dimmed"}," Fecha Registro Contable: ",-1)),n.createElementVNode("div",Td,n.toDisplayString(m.fechaRegistroContable),1)])):n.createCommentVNode("",!0),n.createElementVNode("div",null,[s[9]||(s[9]=n.createElementVNode("div",{class:"font-bold text-dimmed"}," Pago a Residente: ",-1)),n.createElementVNode("div",Bd,n.toDisplayString(m.pagoLocExt==="01"?"SI":"NO"),1)]),n.createElementVNode("div",null,[s[10]||(s[10]=n.createElementVNode("div",{class:"font-bold text-dimmed"}," Total Sin impuestos: ",-1)),n.createElementVNode("div",Rd,n.toDisplayString(m.totalSinImpuestos),1)]),n.createElementVNode("div",null,[s[11]||(s[11]=n.createElementVNode("div",{class:"font-bold text-dimmed"}," Importe Total: ",-1)),n.createElementVNode("div",Id,n.toDisplayString(m.importeTotal),1)])]),n.createElementVNode("div",Cd,[n.createElementVNode("div",Pd,[s[13]||(s[13]=n.createElementVNode("div",{class:"text-center font-bold"}," FORMAS DE PAGOS ",-1)),m.pagos.pago?(n.openBlock(),n.createElementBlock("table",Md,[s[12]||(s[12]=n.createElementVNode("thead",null,[n.createElementVNode("tr",{class:"bg-muted"},[n.createElementVNode("th",{class:"border border-default p-1 text-left"}," TIPO "),n.createElementVNode("th",{class:"border border-default p-1 text-right"}," VALOR "),n.createElementVNode("th",{class:"border border-default p-1 text-right"}," PLAZO "),n.createElementVNode("th",{class:"border border-default p-1"}," TIEMPO ")])],-1)),n.createElementVNode("tbody",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(u(m.pagos.pago),(y,x)=>(n.openBlock(),n.createElementBlock("tr",{key:x},[n.createElementVNode("td",Ld,n.toDisplayString(y.formaPago),1),n.createElementVNode("td",jd,n.toDisplayString(y.total),1),n.createElementVNode("td",zd,n.toDisplayString(y.plazo),1),n.createElementVNode("td",Ud,n.toDisplayString(y.unidadTiempo),1)]))),128))])])):n.createCommentVNode("",!0)]),n.createElementVNode("div",Fd,[s[14]||(s[14]=n.createElementVNode("div",{class:"text-center font-bold"}," Detalle Impuestos Doc de Sustento ",-1)),(b=m==null?void 0:m.pagos)!=null&&b.pago?(n.openBlock(),n.createElementBlock("table",Gd,[n.createElementVNode("tbody",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(f(m.impuestosDocSustento.impuestoDocSustento),(y,x)=>(n.openBlock(),n.createElementBlock("tr",{key:x},[n.createElementVNode("td",Hd,n.toDisplayString(y.typePor),1),n.createElementVNode("td",qd,n.toDisplayString(y.baseImponible),1),n.createElementVNode("td",Xd,n.toDisplayString(y.valor),1)]))),128))])])):n.createCommentVNode("",!0)])]),n.createElementVNode("div",null,[n.createElementVNode("div",Yd,[n.createElementVNode("div",Jd,[n.createElementVNode("table",Zd,[n.createElementVNode("thead",null,[n.createElementVNode("tr",Wd,[n.createElementVNode("td",{class:"text-center font-bold border border-default p-1 text-primary",colspan:d().length}," DETALLES DE LA RETENCION ",8,Kd)]),n.createElementVNode("tr",Qd,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d(),(y,x)=>(n.openBlock(),n.createElementBlock("th",{key:x,class:"border border-default p-1 text-left"},n.toDisplayString(y),1))),128))])]),n.createElementVNode("tbody",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(m.retenciones,(y,x)=>(n.openBlock(),n.createElementBlock("tr",{key:x},[n.createElementVNode("td",ef,n.toDisplayString(x+1),1),n.createElementVNode("td",tf,n.toDisplayString(i(y.codigo,2)),1),n.createElementVNode("td",nf,n.toDisplayString(a(y.codigoRetencion)),1),n.createElementVNode("td",rf," %"+n.toDisplayString(y.porcentajeRetener),1),n.createElementVNode("td",of,n.toDisplayString(y.baseImponible),1),n.createElementVNode("td",af,n.toDisplayString(y.valorRetenido),1)]))),128)),n.createElementVNode("tr",lf,[s[16]||(s[16]=n.createElementVNode("td",{colspan:"5",class:"border border-default"},null,-1)),n.createElementVNode("td",cf,[s[15]||(s[15]=n.createTextVNode(" TOTAL RETENIDO ",-1)),n.createElementVNode("span",uf,n.toDisplayString(n.unref(nn)(_.value)),1)])])])])])])])])}),128))])):n.createCommentVNode("",!0),r.value==="1.0.0"?(n.openBlock(),n.createElementBlock("div",df,[n.createElementVNode("div",ff,[n.createElementVNode("table",sf,[n.createElementVNode("thead",null,[n.createElementVNode("tr",hf,[n.createElementVNode("td",{class:"text-center font-bold border border-default p-1",colspan:l().length}," DETALLES DE LA RETENCION V1 ",8,mf)]),n.createElementVNode("tr",vf,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l(),(m,g)=>(n.openBlock(),n.createElementBlock("th",{key:g,class:"border border-default p-1 text-left"},n.toDisplayString(m),1))),128))])]),n.createElementVNode("tbody",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(c.value,(m,g)=>(n.openBlock(),n.createElementBlock("tr",{key:g},[n.createElementVNode("td",pf,n.toDisplayString(i(m.codDocSustento,1)),1),n.createElementVNode("td",_f,n.toDisplayString(p(m.numDocSustento)),1),n.createElementVNode("td",Ef,n.toDisplayString(m.fechaEmisionDocSustento),1),n.createElementVNode("td",gf,n.toDisplayString(S.value.periodoFiscal),1),n.createElementVNode("td",yf,n.toDisplayString(m.baseImponible),1),n.createElementVNode("td",bf,n.toDisplayString(i(m.codigo,2))+" "+n.toDisplayString(m.codigoRetencion),1),n.createElementVNode("td",xf," %"+n.toDisplayString(m.porcentajeRetener),1),n.createElementVNode("td",Of,n.toDisplayString(m.valorRetenido),1)]))),128)),n.createElementVNode("tr",Nf,[s[19]||(s[19]=n.createElementVNode("td",{colspan:"7",class:"border border-default"},null,-1)),n.createElementVNode("td",Sf,[s[18]||(s[18]=n.createTextVNode(" TOTAL RETENIDO ",-1)),n.createElementVNode("span",kf,n.toDisplayString(E.value),1)])])])])])])):n.createCommentVNode("",!0),n.createElementVNode("div",$f,[n.createElementVNode("div",wf,[s[20]||(s[20]=n.createElementVNode("div",{class:"text-center text-sm font-bold text-primary mb-1"}," INFORMACIÓN ADICIONAL ",-1)),n.createElementVNode("div",null,[n.unref(o)?(n.openBlock(),n.createElementBlock("table",Af,[n.createElementVNode("tbody",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(o),(m,g)=>(n.openBlock(),n.createElementBlock("tr",{key:g},[n.createElementVNode("td",Df,n.toDisplayString(m.name),1),n.createElementVNode("td",Vf,n.toDisplayString(m.value),1)]))),128))])])):n.createCommentVNode("",!0)])])])])])]))}}),Tf={class:"w-full visor-xml-container"},Bf={key:0,class:"p-6 text-center bg-red-50 dark:bg-red-950/20 border border-red-200 dark:border-red-800 rounded-xl"},Rf={class:"text-sm text-red-600 dark:text-red-300"},If={key:1},Cf=n.defineComponent({__name:"VisorXml",props:{xml:{},logoUrl:{}},setup(t){const e=t,r=n.ref(null),o=n.ref("");return n.watchEffect(()=>{if(!(typeof window>"u")&&e.xml)try{r.value=k.getFullInvoiceDataFromXml(e.xml),o.value=""}catch(a){o.value=a.message||"Error al procesar el XML",console.error(a)}}),n.ref(!1),(a,i)=>(n.openBlock(),n.createElementBlock("div",Tf,[o.value?(n.openBlock(),n.createElementBlock("div",Bf,[i[0]||(i[0]=n.createElementVNode("div",{class:"inline-flex items-center justify-center w-12 h-12 rounded-full bg-red-100 dark:bg-red-900/40 text-red-600 dark:text-red-400 mb-3"},[n.createElementVNode("svg",{class:"w-6 h-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[n.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})])],-1)),i[1]||(i[1]=n.createElementVNode("h4",{class:"text-base font-bold text-red-800 dark:text-red-400 mb-1"}," Error al procesar el comprobante ",-1)),n.createElementVNode("p",Rf,n.toDisplayString(o.value),1)])):r.value?(n.openBlock(),n.createElementBlock("div",If,[r.value.typeDoc==="01"?(n.openBlock(),n.createBlock(on,{key:0,document:r.value.documentData,logoUrl:t.logoUrl,dateAuthorization:r.value.dateAuthorization},null,8,["document","logoUrl","dateAuthorization"])):r.value.typeDoc==="04"?(n.openBlock(),n.createBlock(an,{key:1,document:r.value.documentData,logoUrl:t.logoUrl,authorization:r.value.dateAuthorization},null,8,["document","logoUrl","authorization"])):r.value.typeDoc==="06"?(n.openBlock(),n.createBlock(ln,{key:2,document:r.value.documentData,logoUrl:t.logoUrl,authorization:r.value.dateAuthorization},null,8,["document","logoUrl","authorization"])):r.value.typeDoc==="07"?(n.openBlock(),n.createBlock(cn,{key:3,document:r.value.documentData,authorization:r.value.dateAuthorization},null,8,["document","authorization"])):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)]))}});exports.VisorXml=Cf;exports.facturaSri=on;exports.guiaRemisionSri=ln;exports.headDocSri=ae;exports.notaCreditoSri=an;exports.retencionSri=cn;Object.keys(k).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>k[t]})});
|