var JA=Object.defineProperty,QA=Object.defineProperties;var eT=Object.getOwnPropertyDescriptors;var Kv=Object.getOwnPropertySymbols;var tT=Object.prototype.hasOwnProperty,rT=Object.prototype.propertyIsEnumerable;var Hp=(r,t,e)=>t in r?JA(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,An=(r,t)=>{for(var e in t||(t={}))tT.call(t,e)&&Hp(r,e,t[e]);if(Kv)for(var e of Kv(t))rT.call(t,e)&&Hp(r,e,t[e]);return r},$o=(r,t)=>QA(r,eT(t));var fi=(r,t,e)=>(Hp(r,typeof t!="symbol"?t+"":t,e),e);var st=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Zv(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Vo(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Yv={exports:{}};(function(r){var t=typeof window!="undefined"?window:typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope?self:{};/** * Prism: Lightweight, robust, elegant syntax highlighting * * @license MIT * @author Lea Verou * @namespace * @public */var e=function(n){var i=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,a=0,o={},s={manual:n.Prism&&n.Prism.manual,disableWorkerMessageHandler:n.Prism&&n.Prism.disableWorkerMessageHandler,util:{encode:function v(b){return b instanceof u?new u(b.type,v(b.content),b.alias):Array.isArray(b)?b.map(v):b.replace(/&/g,"&").replace(/"+F.content+""};function c(v,b,E,D){v.lastIndex=b;var F=v.exec(E);if(F&&D&&F[1]){var z=F[1].length;F.index+=z,F[0]=F[0].slice(z)}return F}function l(v,b,E,D,F,z){for(var W in E)if(!(!E.hasOwnProperty(W)||!E[W])){var U=E[W];U=Array.isArray(U)?U:[U];for(var G=0;G=z.reach);A+=x.value.length,x=x.next){var k=x.value;if(b.length>v.length)return;if(!(k instanceof u)){var R=1,M;if(S){if(M=c(w,A,v,I),!M||M.index>=v.length)break;var $=M.index,X=M.index+M[0].length,K=A;for(K+=x.value.length;$>=K;)x=x.next,K+=x.value.length;if(K-=x.value.length,A=K,x.value instanceof u)continue;for(var te=x;te!==b.tail&&(Kz.reach&&(z.reach=V);var J=x.prev;O&&(J=h(b,J,O),A+=O.length),f(b,J,R);var re=new u(W,P?s.tokenize(q,P):q,C,q);if(x=h(b,J,re),L&&h(b,x,L),R>1){var ae={cause:W+","+G,reach:V};l(v,b,E,x.prev,A,ae),z&&ae.reach>z.reach&&(z.reach=ae.reach)}}}}}}function d(){var v={value:null,prev:null,next:null},b={value:null,prev:v,next:null};v.next=b,this.head=v,this.tail=b,this.length=0}function h(v,b,E){var D=b.next,F={value:E,prev:b,next:D};return b.next=F,D.prev=F,v.length++,F}function f(v,b,E){for(var D=b.next,F=0;F/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside["attr-value"].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside["internal-subset"].inside=e.languages.markup,e.hooks.add("wrap",function(n){n.type==="entity"&&(n.attributes.title=n.content.replace(/&/,"&"))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(i,a){var o={};o["language-"+a]={pattern:/(^$)/i,lookbehind:!0,inside:e.languages[a]},o.cdata=/^$/i;var s={"included-cdata":{pattern://i,inside:o}};s["language-"+a]={pattern:/[\s\S]+/,inside:e.languages[a]};var u={};u[i]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return i}),"i"),lookbehind:!0,greedy:!0,inside:s},e.languages.insertBefore("markup","cdata",u)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(n,i){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+n+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[i,"language-"+i],inside:e.languages[i]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend("markup",{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml,function(n){var i=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;n.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+i.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+i.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+i.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:i,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},n.languages.css.atrule.inside.rest=n.languages.css;var a=n.languages.markup;a&&(a.tag.addInlined("style","css"),a.tag.addAttribute("style","css"))}(e),e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},e.languages.javascript=e.languages.extend("clike",{"class-name":[e.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),e.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),e.languages.markup&&(e.languages.markup.tag.addInlined("script","javascript"),e.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),e.languages.js=e.languages.javascript,function(){if(typeof e=="undefined"||typeof document=="undefined")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var n="Loading\u2026",i=function(m,p){return"\u2716 Error "+m+" while fetching file: "+p},a="\u2716 Error: File does not exist or is empty",o={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},s="data-src-status",u="loading",c="loaded",l="failed",d="pre[data-src]:not(["+s+'="'+c+'"]):not(['+s+'="'+u+'"])';function h(m,p,y){var v=new XMLHttpRequest;v.open("GET",m,!0),v.onreadystatechange=function(){v.readyState==4&&(v.status<400&&v.responseText?p(v.responseText):v.status>=400?y(i(v.status,v.statusText)):y(a))},v.send(null)}function f(m){var p=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(m||"");if(p){var y=Number(p[1]),v=p[2],b=p[3];return v?b?[y,Number(b)]:[y,void 0]:[y,y]}}e.hooks.add("before-highlightall",function(m){m.selector+=", "+d}),e.hooks.add("before-sanity-check",function(m){var p=m.element;if(p.matches(d)){m.code="",p.setAttribute(s,u);var y=p.appendChild(document.createElement("CODE"));y.textContent=n;var v=p.getAttribute("data-src"),b=m.language;if(b==="none"){var E=(/\.(\w+)$/.exec(v)||[,"none"])[1];b=o[E]||E}e.util.setLanguage(y,b),e.util.setLanguage(p,b);var D=e.plugins.autoloader;D&&D.loadLanguages(b),h(v,function(F){p.setAttribute(s,c);var z=f(p.getAttribute("data-range"));if(z){var W=F.split(/\r\n?|\n/g),U=z[0],G=z[1]==null?W.length:z[1];U<0&&(U+=W.length),U=Math.max(0,Math.min(U-1,W.length)),G<0&&(G+=W.length),G=Math.max(0,Math.min(G,W.length)),F=W.slice(U,G).join(` `),p.hasAttribute("data-start")||p.setAttribute("data-start",String(U+1))}y.textContent=F,e.highlightElement(y)},function(F){p.setAttribute(s,l),y.textContent=F})}}),e.plugins.fileHighlight={highlight:function(p){for(var y=(p||document).querySelectorAll(d),v=0,b;b=y[v++];)e.highlightElement(b)}};var g=!1;e.fileHighlight=function(){g||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),g=!0),e.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(Yv);var oX=Yv.exports,$p={},Jf={},xi={};Object.defineProperty(xi,"__esModule",{value:!0});function nT(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}var iT=function r(t,e){nT(this,r),this.data=t,this.text=e.text||t,this.options=e};xi.default=iT;Object.defineProperty(Jf,"__esModule",{value:!0});Jf.CODE39=void 0;var aT=function(){function r(t,e){for(var n=0;n=200){s=n.shift()-105;var u=ji.SWAP[s];u!==void 0?o=t.next(n,i+1,u):((a===ji.SET_A||a===ji.SET_B)&&s===ji.SHIFT&&(n[0]=a===ji.SET_A?n[0]>95?n[0]-96:n[0]:n[0]<32?n[0]+96:n[0]),o=t.next(n,i+1,a))}else s=t.correctIndex(n,a),o=t.next(n,i+1,a);var c=t.getBar(s),l=s*i;return{result:c+o.result,checksum:l+o.checksum}}}]),t}(xT.default);cu.default=DT;var Xp={};Object.defineProperty(Xp,"__esModule",{value:!0});var qo=Kr,ny=function(t){return t.match(new RegExp("^"+qo.A_CHARS+"*"))[0].length},iy=function(t){return t.match(new RegExp("^"+qo.B_CHARS+"*"))[0].length},ay=function(t){return t.match(new RegExp("^"+qo.C_CHARS+"*"))[0]};function Kp(r,t){var e=t?qo.A_CHARS:qo.B_CHARS,n=r.match(new RegExp("^("+e+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(n)return n[1]+String.fromCharCode(204)+oy(r.substring(n[1].length));var i=r.match(new RegExp("^"+e+"+"))[0];return i.length===r.length?r:i+String.fromCharCode(t?205:206)+Kp(r.substring(i.length),!t)}function oy(r){var t=ay(r),e=t.length;if(e===r.length)return r;r=r.substring(e);var n=ny(r)>=iy(r);return t+String.fromCharCode(n?206:205)+Kp(r,n)}Xp.default=function(r){var t=void 0,e=ay(r).length;if(e>=2)t=qo.C_START_CHAR+oy(r);else{var n=ny(r)>iy(r);t=(n?qo.A_START_CHAR:qo.B_START_CHAR)+Kp(r,n)}return t.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(i,a){return String.fromCharCode(203)+a})};Object.defineProperty(qp,"__esModule",{value:!0});var CT=cu,OT=sy(CT),IT=Xp,kT=sy(IT);function sy(r){return r&&r.__esModule?r:{default:r}}function RT(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}function Zp(r,t){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:r}function NT(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);r.prototype=Object.create(t&&t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(r,t):r.__proto__=t)}var FT=function(r){NT(t,r);function t(e,n){if(RT(this,t),/^[\x00-\x7F\xC8-\xD3]+$/.test(e))var i=Zp(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,(0,kT.default)(e),n));else var i=Zp(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return Zp(i)}return t}(OT.default);qp.default=FT;var Yp={};Object.defineProperty(Yp,"__esModule",{value:!0});var MT=function(){function r(t,e){for(var n=0;nn.width*10?n.width*10:n.fontSize,i.guardHeight=n.height+i.fontSize/2+n.textMargin,i}return mS(t,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(n,i){return this.text.substr(n,i)}},{key:"leftEncode",value:function(n,i){return(0,fy.default)(n,i)}},{key:"rightText",value:function(n,i){return this.text.substr(n,i)}},{key:"rightEncode",value:function(n,i){return(0,fy.default)(n,i)}},{key:"encodeGuarded",value:function(){var n={fontSize:this.fontSize},i={height:this.guardHeight};return[{data:lu.SIDE_BIN,options:i},{data:this.leftEncode(),text:this.leftText(),options:n},{data:lu.MIDDLE_BIN,options:i},{data:this.rightEncode(),text:this.rightText(),options:n},{data:lu.SIDE_BIN,options:i}]}},{key:"encodeFlat",value:function(){var n=[lu.SIDE_BIN,this.leftEncode(),lu.MIDDLE_BIN,this.rightEncode(),lu.SIDE_BIN];return{data:n.join(""),text:this.text}}}]),t}(yS.default);eh.default=xS;Object.defineProperty(e0,"__esModule",{value:!0});var ES=function(){function r(t,e){for(var n=0;nn.width*10?i.fontSize=n.width*10:i.fontSize=n.fontSize,i.guardHeight=n.height+i.fontSize/2+n.textMargin,i}return sD(t,[{key:"valid",value:function(){return this.data.search(/^[0-9]{12}$/)!==-1&&this.data[11]==i0(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var n="";return n+="101",n+=(0,fu.default)(this.data.substr(0,6),"LLLLLL"),n+="01010",n+=(0,fu.default)(this.data.substr(6,6),"RRRRRR"),n+="101",{data:n,text:this.text}}},{key:"guardedEncoding",value:function(){var n=[];return this.displayValue&&n.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),n.push({data:"101"+(0,fu.default)(this.data[0],"L"),options:{height:this.guardHeight}}),n.push({data:(0,fu.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),n.push({data:"01010",options:{height:this.guardHeight}}),n.push({data:(0,fu.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),n.push({data:(0,fu.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&n.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),n}}]),t}(lD.default);function i0(r){var t=0,e;for(e=1;e<11;e+=2)t+=parseInt(r[e]);for(e=0;e<11;e+=2)t+=parseInt(r[e])*3;return(10-t%10)%10}Lc.default=pD;var a0={};Object.defineProperty(a0,"__esModule",{value:!0});var mD=function(){function r(t,e){for(var n=0;nn.width*10?i.fontSize=n.width*10:i.fontSize=n.fontSize,i.guardHeight=n.height+i.fontSize/2+n.textMargin,i}return mD(t,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var n="";return n+="101",n+=this.encodeMiddleDigits(),n+="010101",{data:n,text:this.text}}},{key:"guardedEncoding",value:function(){var n=[];return this.displayValue&&n.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),n.push({data:"101",options:{height:this.guardHeight}}),n.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),n.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&n.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),n}},{key:"encodeMiddleDigits",value:function(){var n=this.upcA[0],i=this.upcA[this.upcA.length-1],a=AD[parseInt(i)][parseInt(n)];return(0,vD.default)(this.middleDigits,a)}}]),t}(bD.default);function by(r,t){for(var e=parseInt(r[r.length-1]),n=ED[e],i="",a=0,o=0;o=3&&this.number<=131070}}]),t}(nO.default);ih.pharmacode=uO;var ah={};Object.defineProperty(ah,"__esModule",{value:!0});ah.codabar=void 0;var cO=function(){function r(t,e){for(var n=0;n0?t.fontSize+t.textMargin:0)+t.marginTop+t.marginBottom}function Cy(r,t,e){if(e.displayValue&&tt&&(t=r[e].height);return t}function $O(r,t,e){var n;if(e)n=e;else if(typeof document!="undefined")n=document.createElement("canvas").getContext("2d");else return 0;n.font=t.fontOptions+" "+t.fontSize+"px "+t.font;var i=n.measureText(r);if(!i)return 0;var a=i.width;return a}Wi.getMaximumHeightOfEncodings=HO;Wi.getEncodingHeight=Dy;Wi.getBarcodePadding=Cy;Wi.calculateEncodingAttributes=WO;Wi.getTotalWidthOfEncodings=zO;Object.defineProperty(v0,"__esModule",{value:!0});var VO=function(){function r(t,e){for(var n=0;n0?(o=0,i.textAlign="left"):e.textAlign=="right"?(o=n.width-1,i.textAlign="right"):(o=n.width/2,i.textAlign="center"),i.fillText(n.text,o,s)}}},{key:"moveCanvasDrawing",value:function(e){var n=this.canvas.getContext("2d");n.translate(e.width,0)}},{key:"restoreCanvas",value:function(){var e=this.canvas.getContext("2d");e.restore()}}]),r}();v0.default=ZO;var b0={};Object.defineProperty(b0,"__esModule",{value:!0});var YO=function(){function r(t,e){for(var n=0;n0&&(this.drawRect(u-n.width*s,o,n.width*s,n.height,e),s=0);s>0&&this.drawRect(u-n.width*(s-1),o,n.width*s,n.height,e)}},{key:"drawSVGText",value:function(e,n,i){var a=this.document.createElementNS(lh,"text");if(n.displayValue){var o,s;a.setAttribute("style","font:"+n.fontOptions+" "+n.fontSize+"px "+n.font),n.textPosition=="top"?s=n.fontSize-n.textMargin:s=n.height+n.textMargin+n.fontSize,n.textAlign=="left"||i.barcodePadding>0?(o=0,a.setAttribute("text-anchor","start")):n.textAlign=="right"?(o=i.width-1,a.setAttribute("text-anchor","end")):(o=i.width/2,a.setAttribute("text-anchor","middle")),a.setAttribute("x",o),a.setAttribute("y",s),a.appendChild(this.document.createTextNode(i.text)),e.appendChild(a)}}},{key:"setSvgAttributes",value:function(e,n){var i=this.svg;i.setAttribute("width",e+"px"),i.setAttribute("height",n+"px"),i.setAttribute("x","0px"),i.setAttribute("y","0px"),i.setAttribute("viewBox","0 0 "+e+" "+n),i.setAttribute("xmlns",lh),i.setAttribute("version","1.1"),i.setAttribute("style","transform: translate(0,0)")}},{key:"createGroup",value:function(e,n,i){var a=this.document.createElementNS(lh,"g");return a.setAttribute("transform","translate("+e+", "+n+")"),i.appendChild(a),a}},{key:"setGroupOptions",value:function(e,n){e.setAttribute("style","fill:"+n.lineColor+";")}},{key:"drawRect",value:function(e,n,i,a,o){var s=this.document.createElementNS(lh,"rect");return s.setAttribute("x",e),s.setAttribute("y",n),s.setAttribute("width",i),s.setAttribute("height",a),o.appendChild(s),s}}]),r}();b0.default=rI;var _0={};Object.defineProperty(_0,"__esModule",{value:!0});var nI=function(){function r(t,e){for(var n=0;n=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Tn=function(){function r(){}return r.fill=function(t,e){for(var n=0,i=t.length;nn)throw new Bt("fromIndex("+e+") > toIndex("+n+")");if(e<0)throw new Py(e);if(n>t)throw new Py(n)},r.asList=function(){for(var t=[],e=0;e>1,s=n(e,t[o]);if(s>0)i=o+1;else if(s<0)a=o-1;else return o}return-i-1},r.numberComparator=function(t,e){return t-e},r}(),ln=function(){function r(){}return r.numberOfTrailingZeros=function(t){var e;if(t===0)return 32;var n=31;return e=t<<16,e!==0&&(n-=16,t=e),e=t<<8,e!==0&&(n-=8,t=e),e=t<<4,e!==0&&(n-=4,t=e),e=t<<2,e!==0&&(n-=2,t=e),n-(t<<1>>>31)},r.numberOfLeadingZeros=function(t){if(t===0)return 32;var e=1;return t>>>16==0&&(e+=16,t<<=16),t>>>24==0&&(e+=8,t<<=8),t>>>28==0&&(e+=4,t<<=4),t>>>30==0&&(e+=2,t<<=2),e-=t>>>31,e},r.toHexString=function(t){return t.toString(16)},r.toBinaryString=function(t){return String(parseInt(String(t),2))},r.bitCount=function(t){return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),t=t+(t>>>4)&252645135,t=t+(t>>>8),t=t+(t>>>16),t&63},r.truncDivision=function(t,e){return Math.trunc(t/e)},r.parseInt=function(t,e){return e===void 0&&(e=void 0),parseInt(t,e)},r.MIN_VALUE_32_BITS=-2147483648,r.MAX_VALUE=Number.MAX_SAFE_INTEGER,r}(),Ti=function(){function r(t,e){t===void 0?(this.size=0,this.bits=new Int32Array(1)):(this.size=t,e==null?this.bits=r.makeArray(t):this.bits=e)}return r.prototype.getSize=function(){return this.size},r.prototype.getSizeInBytes=function(){return Math.floor((this.size+7)/8)},r.prototype.ensureCapacity=function(t){if(t>this.bits.length*32){var e=r.makeArray(t);zr.arraycopy(this.bits,0,e,0,this.bits.length),this.bits=e}},r.prototype.get=function(t){return(this.bits[Math.floor(t/32)]&1<<(t&31))!=0},r.prototype.set=function(t){this.bits[Math.floor(t/32)]|=1<<(t&31)},r.prototype.flip=function(t){this.bits[Math.floor(t/32)]^=1<<(t&31)},r.prototype.getNextSet=function(t){var e=this.size;if(t>=e)return e;var n=this.bits,i=Math.floor(t/32),a=n[i];a&=~((1<<(t&31))-1);for(var o=n.length;a===0;){if(++i===o)return e;a=n[i]}var s=i*32+ln.numberOfTrailingZeros(a);return s>e?e:s},r.prototype.getNextUnset=function(t){var e=this.size;if(t>=e)return e;var n=this.bits,i=Math.floor(t/32),a=~n[i];a&=~((1<<(t&31))-1);for(var o=n.length;a===0;){if(++i===o)return e;a=~n[i]}var s=i*32+ln.numberOfTrailingZeros(a);return s>e?e:s},r.prototype.setBulk=function(t,e){this.bits[Math.floor(t/32)]=e},r.prototype.setRange=function(t,e){if(ethis.size)throw new Bt;if(e!==t){e--;for(var n=Math.floor(t/32),i=Math.floor(e/32),a=this.bits,o=n;o<=i;o++){var s=o>n?0:t&31,u=othis.size)throw new Bt;if(e===t)return!0;e--;for(var i=Math.floor(t/32),a=Math.floor(e/32),o=this.bits,s=i;s<=a;s++){var u=s>i?0:t&31,c=s32)throw new Bt("Num bits must be between 0 and 32");this.ensureCapacity(this.size+e);for(var n=e;n>0;n--)this.appendBit((t>>n-1&1)==1)},r.prototype.appendBitArray=function(t){var e=t.size;this.ensureCapacity(this.size+e);for(var n=0;n>1&1431655765|(o&1431655765)<<1,o=o>>2&858993459|(o&858993459)<<2,o=o>>4&252645135|(o&252645135)<<4,o=o>>8&16711935|(o&16711935)<<8,o=o>>16&65535|(o&65535)<<16,t[e-a]=o}if(this.size!==n*32){for(var s=n*32-this.size,u=t[0]>>>s,a=1;a>>s}t[n-1]=u}this.bits=t},r.makeArray=function(t){return new Int32Array(Math.floor((t+31)/32))},r.prototype.equals=function(t){if(!(t instanceof r))return!1;var e=t;return this.size===e.size&&Tn.equals(this.bits,e.bits)},r.prototype.hashCode=function(){return 31*this.size+Tn.hashCode(this.bits)},r.prototype.toString=function(){for(var t="",e=0,n=this.size;e=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Or;(function(r){r[r.Cp437=0]="Cp437",r[r.ISO8859_1=1]="ISO8859_1",r[r.ISO8859_2=2]="ISO8859_2",r[r.ISO8859_3=3]="ISO8859_3",r[r.ISO8859_4=4]="ISO8859_4",r[r.ISO8859_5=5]="ISO8859_5",r[r.ISO8859_6=6]="ISO8859_6",r[r.ISO8859_7=7]="ISO8859_7",r[r.ISO8859_8=8]="ISO8859_8",r[r.ISO8859_9=9]="ISO8859_9",r[r.ISO8859_10=10]="ISO8859_10",r[r.ISO8859_11=11]="ISO8859_11",r[r.ISO8859_13=12]="ISO8859_13",r[r.ISO8859_14=13]="ISO8859_14",r[r.ISO8859_15=14]="ISO8859_15",r[r.ISO8859_16=15]="ISO8859_16",r[r.SJIS=16]="SJIS",r[r.Cp1250=17]="Cp1250",r[r.Cp1251=18]="Cp1251",r[r.Cp1252=19]="Cp1252",r[r.Cp1256=20]="Cp1256",r[r.UnicodeBigUnmarked=21]="UnicodeBigUnmarked",r[r.UTF8=22]="UTF8",r[r.ASCII=23]="ASCII",r[r.Big5=24]="Big5",r[r.GB18030=25]="GB18030",r[r.EUC_KR=26]="EUC_KR"})(Or||(Or={}));var Sn=function(){function r(t,e,n){for(var i,a,o=[],s=3;s=900)throw new ct("incorect value");var e=r.VALUES_TO_ECI.get(t);if(e===void 0)throw new ct("incorect value");return e},r.getCharacterSetECIByName=function(t){var e=r.NAME_TO_ECI.get(t);if(e===void 0)throw new ct("incorect value");return e},r.prototype.equals=function(t){if(!(t instanceof r))return!1;var e=t;return this.getName()===e.getName()},r.VALUE_IDENTIFIER_TO_ECI=new Map,r.VALUES_TO_ECI=new Map,r.NAME_TO_ECI=new Map,r.Cp437=new r(Or.Cp437,Int32Array.from([0,2]),"Cp437"),r.ISO8859_1=new r(Or.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),r.ISO8859_2=new r(Or.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),r.ISO8859_3=new r(Or.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),r.ISO8859_4=new r(Or.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),r.ISO8859_5=new r(Or.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),r.ISO8859_6=new r(Or.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),r.ISO8859_7=new r(Or.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),r.ISO8859_8=new r(Or.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),r.ISO8859_9=new r(Or.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),r.ISO8859_10=new r(Or.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),r.ISO8859_11=new r(Or.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),r.ISO8859_13=new r(Or.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),r.ISO8859_14=new r(Or.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),r.ISO8859_15=new r(Or.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),r.ISO8859_16=new r(Or.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),r.SJIS=new r(Or.SJIS,20,"SJIS","Shift_JIS"),r.Cp1250=new r(Or.Cp1250,21,"Cp1250","windows-1250"),r.Cp1251=new r(Or.Cp1251,22,"Cp1251","windows-1251"),r.Cp1252=new r(Or.Cp1252,23,"Cp1252","windows-1252"),r.Cp1256=new r(Or.Cp1256,24,"Cp1256","windows-1256"),r.UnicodeBigUnmarked=new r(Or.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),r.UTF8=new r(Or.UTF8,26,"UTF8","UTF-8"),r.ASCII=new r(Or.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),r.Big5=new r(Or.Big5,28,"Big5"),r.GB18030=new r(Or.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),r.EUC_KR=new r(Or.EUC_KR,30,"EUC_KR","EUC-KR"),r}(),ZI=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),hh=function(r){ZI(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="UnsupportedOperationException",t}(Ai),ta=function(){function r(){}return r.decode=function(t,e){var n=this.encodingName(e);return this.customDecoder?this.customDecoder(t,n):typeof TextDecoder=="undefined"||this.shouldDecodeOnFallback(n)?this.decodeFallback(t,n):new TextDecoder(n).decode(t)},r.shouldDecodeOnFallback=function(t){return!r.isBrowser()&&t==="ISO-8859-1"},r.encode=function(t,e){var n=this.encodingName(e);return this.customEncoder?this.customEncoder(t,n):typeof TextEncoder=="undefined"?this.encodeFallback(t):new TextEncoder().encode(t)},r.isBrowser=function(){return typeof window!="undefined"&&{}.toString.call(window)==="[object Window]"},r.encodingName=function(t){return typeof t=="string"?t:t.getName()},r.encodingCharacterSet=function(t){return t instanceof Sn?t:Sn.getCharacterSetECIByName(t)},r.decodeFallback=function(t,e){var n=this.encodingCharacterSet(e);if(r.isDecodeFallbackSupported(n)){for(var i="",a=0,o=t.length;a3&&t[0]===239&&t[1]===187&&t[2]===191,b=0;b0?(E&128)==0?o=!1:s--:(E&128)!=0&&((E&64)==0?o=!1:(s++,(E&32)==0?u++:(s++,(E&16)==0?c++:(s++,(E&8)==0?l++:o=!1))))),i&&(E>127&&E<160?i=!1:E>159&&(E<192||E===215||E===247)&&y++),a&&(d>0?E<64||E===127||E>252?a=!1:d--:E===128||E===160||E>239?a=!1:E>160&&E<224?(h++,g=0,f++,f>m&&(m=f)):E>127?(d++,f=0,g++,g>p&&(p=g)):(f=0,g=0))}return o&&s>0&&(o=!1),a&&d>0&&(a=!1),o&&(v||u+c+l>0)?r.UTF8:a&&(r.ASSUME_SHIFT_JIS||m>=3||p>=3)?r.SHIFT_JIS:i&&a?m===2&&h===2||y*10>=n?r.SHIFT_JIS:r.ISO88591:i?r.ISO88591:a?r.SHIFT_JIS:o?r.UTF8:r.PLATFORM_DEFAULT_ENCODING},r.format=function(t){for(var e=[],n=1;no){if(s===-1)s=a-o;else if(a-o!==s)throw new Bt("row lengths do not match");o=a,u++}c++}else if(t.substring(c,c+e.length)===e)c+=e.length,i[a]=!0,a++;else if(t.substring(c,c+n.length)===n)c+=n.length,i[a]=!1,a++;else throw new Bt("illegal character encountered: "+t.substring(c));if(a>o){if(s===-1)s=a-o;else if(a-o!==s)throw new Bt("row lengths do not match");u++}for(var l=new r(s,u),d=0;d>>(t&31)&1)!=0},r.prototype.set=function(t,e){var n=e*this.rowSize+Math.floor(t/32);this.bits[n]|=1<<(t&31)&4294967295},r.prototype.unset=function(t,e){var n=e*this.rowSize+Math.floor(t/32);this.bits[n]&=~(1<<(t&31)&4294967295)},r.prototype.flip=function(t,e){var n=e*this.rowSize+Math.floor(t/32);this.bits[n]^=1<<(t&31)&4294967295},r.prototype.xor=function(t){if(this.width!==t.getWidth()||this.height!==t.getHeight()||this.rowSize!==t.getRowSize())throw new Bt("input matrix dimensions do not match");for(var e=new Ti(Math.floor(this.width/32)+1),n=this.rowSize,i=this.bits,a=0,o=this.height;athis.height||a>this.width)throw new Bt("The region must fit inside the matrix");for(var s=this.rowSize,u=this.bits,c=e;cu&&(u=c),l*32s){for(var h=31;d>>>h==0;)h--;l*32+h>s&&(s=l*32+h)}}}return s=0&&e[n]===0;)n--;if(n<0)return null;for(var i=Math.floor(n/t),a=Math.floor(n%t)*32,o=e[n],s=31;o>>>s==0;)s--;return a+=s,Int32Array.from([a,i])},r.prototype.getWidth=function(){return this.width},r.prototype.getHeight=function(){return this.height},r.prototype.getRowSize=function(){return this.rowSize},r.prototype.equals=function(t){if(!(t instanceof r))return!1;var e=t;return this.width===e.width&&this.height===e.height&&this.rowSize===e.rowSize&&Tn.equals(this.bits,e.bits)},r.prototype.hashCode=function(){var t=this.width;return t=31*t+this.width,t=31*t+this.height,t=31*t+this.rowSize,t=31*t+Tn.hashCode(this.bits),t},r.prototype.toString=function(t,e,n){return t===void 0&&(t="X "),e===void 0&&(e=" "),n===void 0&&(n=` `),this.buildToString(t,e,n)},r.prototype.buildToString=function(t,e,n){for(var i=new er,a=0,o=this.height;a>t.LUMINANCE_SHIFT]++;var c=t.estimateBlackPoint(s);if(a<3)for(var u=0;u>t.LUMINANCE_SHIFT]++}for(var f=t.estimateBlackPoint(o),g=e.getMatrix(),s=0;so&&(a=s,o=e[s]),e[s]>i&&(i=e[s]);for(var u=0,c=0,s=0;sc&&(u=s,c=d)}if(a>u){var h=a;a=u,u=h}if(u-a<=n/16)throw new ze;for(var f=u-1,g=-1,s=u-1;s>a;s--){var m=s-a,d=m*m*(u-s)*(i-e[s]);d>g&&(f=s,g=d)}return f<=t.MINIMUM_DIMENSION&&i>=t.MINIMUM_DIMENSION){var a=e.getMatrix(),o=n>>t.BLOCK_SIZE_POWER;(n&t.BLOCK_SIZE_MASK)!=0&&o++;var s=i>>t.BLOCK_SIZE_POWER;(i&t.BLOCK_SIZE_MASK)!=0&&s++;var u=t.calculateBlackPoints(a,o,s,n,i),c=new po(n,i);t.calculateThresholdForBlock(a,o,s,n,i,u,c),this.matrix=c}else this.matrix=r.prototype.getBlackMatrix.call(this);return this.matrix},t.prototype.createBinarizer=function(e){return new t(e)},t.calculateThresholdForBlock=function(e,n,i,a,o,s,u){for(var c=o-t.BLOCK_SIZE,l=a-t.BLOCK_SIZE,d=0;dc&&(h=c);for(var f=t.cap(d,2,i-3),g=0;gl&&(m=l);for(var p=t.cap(g,2,n-3),y=0,v=-2;v<=2;v++){var b=s[f+v];y+=b[p-2]+b[p-1]+b[p]+b[p+1]+b[p+2]}var E=y/25;t.thresholdBlock(e,m,h,E,a,u)}}},t.cap=function(e,n,i){return ei?i:e},t.thresholdBlock=function(e,n,i,a,o,s){for(var u=0,c=i*o+n;us&&(d=s);for(var h=0;hu&&(f=u);for(var g=0,m=255,p=0,y=0,v=d*a+f;yp&&(p=E)}if(p-m>t.MIN_DYNAMIC_RANGE)for(y++,v+=a;y>t.BLOCK_SIZE_POWER*2;if(p-m<=t.MIN_DYNAMIC_RANGE&&(D=m/2,l>0&&h>0)){var F=(c[l-1][h]+2*c[l][h-1]+c[l-1][h-1])/4;m>10}o[u]=l}else for(var s=0,u=0,m=e.length;s>10}o[u]=255-l}return o},t.prototype.getRow=function(e,n){if(e<0||e>=this.getHeight())throw new Bt("Requested row is outside the image: "+e);var i=this.getWidth(),a=e*i;return n===null?n=this.buffer.slice(a,a+i):(n.length0&&a[a.length-1])&&(c[0]===6||c[0]===2)){e=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},vu=function(){function r(t,e,n){e===void 0&&(e=500),this.reader=t,this.timeBetweenScansMillis=e,this._hints=n,this._stopContinuousDecode=!1,this._stopAsyncDecode=!1,this._timeBetweenDecodingAttempts=0}return Object.defineProperty(r.prototype,"hasNavigator",{get:function(){return typeof navigator!="undefined"},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isMediaDevicesSuported",{get:function(){return this.hasNavigator&&!!navigator.mediaDevices},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"canEnumerateDevices",{get:function(){return!!(this.isMediaDevicesSuported&&navigator.mediaDevices.enumerateDevices)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"timeBetweenDecodingAttempts",{get:function(){return this._timeBetweenDecodingAttempts},set:function(t){this._timeBetweenDecodingAttempts=t<0?0:t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"hints",{get:function(){return this._hints},set:function(t){this._hints=t||null},enumerable:!1,configurable:!0}),r.prototype.listVideoInputDevices=function(){return hi(this,void 0,void 0,function(){var t,e,n,i,a,o,s,u,c,l,d,h;return di(this,function(f){switch(f.label){case 0:if(!this.hasNavigator)throw new Error("Can't enumerate devices, navigator is not present.");if(!this.canEnumerateDevices)throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:t=f.sent(),e=[];try{for(n=ak(t),i=n.next();!i.done;i=n.next())a=i.value,o=a.kind==="video"?"videoinput":a.kind,o==="videoinput"&&(s=a.deviceId||a.id,u=a.label||"Video device "+(e.length+1),c=a.groupId,l={deviceId:s,label:u,kind:o,groupId:c},e.push(l))}catch(g){d={error:g}}finally{try{i&&!i.done&&(h=n.return)&&h.call(n)}finally{if(d)throw d.error}}return[2,e]}})})},r.prototype.getVideoInputDevices=function(){return hi(this,void 0,void 0,function(){var t;return di(this,function(e){switch(e.label){case 0:return[4,this.listVideoInputDevices()];case 1:return t=e.sent(),[2,t.map(function(n){return new ik(n.deviceId,n.label)})]}})})},r.prototype.findDeviceById=function(t){return hi(this,void 0,void 0,function(){var e;return di(this,function(n){switch(n.label){case 0:return[4,this.listVideoInputDevices()];case 1:return e=n.sent(),e?[2,e.find(function(i){return i.deviceId===t})]:[2,null]}})})},r.prototype.decodeFromInputVideoDevice=function(t,e){return hi(this,void 0,void 0,function(){return di(this,function(n){switch(n.label){case 0:return[4,this.decodeOnceFromVideoDevice(t,e)];case 1:return[2,n.sent()]}})})},r.prototype.decodeOnceFromVideoDevice=function(t,e){return hi(this,void 0,void 0,function(){var n,i;return di(this,function(a){switch(a.label){case 0:return this.reset(),t?n={deviceId:{exact:t}}:n={facingMode:"environment"},i={video:n},[4,this.decodeOnceFromConstraints(i,e)];case 1:return[2,a.sent()]}})})},r.prototype.decodeOnceFromConstraints=function(t,e){return hi(this,void 0,void 0,function(){var n;return di(this,function(i){switch(i.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return n=i.sent(),[4,this.decodeOnceFromStream(n,e)];case 2:return[2,i.sent()]}})})},r.prototype.decodeOnceFromStream=function(t,e){return hi(this,void 0,void 0,function(){var n,i;return di(this,function(a){switch(a.label){case 0:return this.reset(),[4,this.attachStreamToVideo(t,e)];case 1:return n=a.sent(),[4,this.decodeOnce(n)];case 2:return i=a.sent(),[2,i]}})})},r.prototype.decodeFromInputVideoDeviceContinuously=function(t,e,n){return hi(this,void 0,void 0,function(){return di(this,function(i){switch(i.label){case 0:return[4,this.decodeFromVideoDevice(t,e,n)];case 1:return[2,i.sent()]}})})},r.prototype.decodeFromVideoDevice=function(t,e,n){return hi(this,void 0,void 0,function(){var i,a;return di(this,function(o){switch(o.label){case 0:return t?i={deviceId:{exact:t}}:i={facingMode:"environment"},a={video:i},[4,this.decodeFromConstraints(a,e,n)];case 1:return[2,o.sent()]}})})},r.prototype.decodeFromConstraints=function(t,e,n){return hi(this,void 0,void 0,function(){var i;return di(this,function(a){switch(a.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return i=a.sent(),[4,this.decodeFromStream(i,e,n)];case 2:return[2,a.sent()]}})})},r.prototype.decodeFromStream=function(t,e,n){return hi(this,void 0,void 0,function(){var i;return di(this,function(a){switch(a.label){case 0:return this.reset(),[4,this.attachStreamToVideo(t,e)];case 1:return i=a.sent(),[4,this.decodeContinuously(i,n)];case 2:return[2,a.sent()]}})})},r.prototype.stopAsyncDecode=function(){this._stopAsyncDecode=!0},r.prototype.stopContinuousDecode=function(){this._stopContinuousDecode=!0},r.prototype.attachStreamToVideo=function(t,e){return hi(this,void 0,void 0,function(){var n;return di(this,function(i){switch(i.label){case 0:return n=this.prepareVideoElement(e),this.addVideoSource(n,t),this.videoElement=n,this.stream=t,[4,this.playVideoOnLoadAsync(n)];case 1:return i.sent(),[2,n]}})})},r.prototype.playVideoOnLoadAsync=function(t){var e=this;return new Promise(function(n,i){return e.playVideoOnLoad(t,function(){return n()})})},r.prototype.playVideoOnLoad=function(t,e){var n=this;this.videoEndedListener=function(){return n.stopStreams()},this.videoCanPlayListener=function(){return n.tryPlayVideo(t)},t.addEventListener("ended",this.videoEndedListener),t.addEventListener("canplay",this.videoCanPlayListener),t.addEventListener("playing",e),this.tryPlayVideo(t)},r.prototype.isVideoPlaying=function(t){return t.currentTime>0&&!t.paused&&!t.ended&&t.readyState>2},r.prototype.tryPlayVideo=function(t){return hi(this,void 0,void 0,function(){return di(this,function(e){switch(e.label){case 0:if(this.isVideoPlaying(t))return console.warn("Trying to play video that is already playing."),[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,t.play()];case 2:return e.sent(),[3,4];case 3:return e.sent(),console.warn("It was not possible to play the video."),[3,4];case 4:return[2]}})})},r.prototype.getMediaElement=function(t,e){var n=document.getElementById(t);if(!n)throw new cn("element with id '"+t+"' not found");if(n.nodeName.toLowerCase()!==e.toLowerCase())throw new cn("element with id '"+t+"' must be an "+e+" element");return n},r.prototype.decodeFromImage=function(t,e){if(!t&&!e)throw new cn("either imageElement with a src set or an url must be provided");return e&&!t?this.decodeFromImageUrl(e):this.decodeFromImageElement(t)},r.prototype.decodeFromVideo=function(t,e){if(!t&&!e)throw new cn("Either an element with a src set or an URL must be provided");return e&&!t?this.decodeFromVideoUrl(e):this.decodeFromVideoElement(t)},r.prototype.decodeFromVideoContinuously=function(t,e,n){if(t===void 0&&e===void 0)throw new cn("Either an element with a src set or an URL must be provided");return e&&!t?this.decodeFromVideoUrlContinuously(e,n):this.decodeFromVideoElementContinuously(t,n)},r.prototype.decodeFromImageElement=function(t){if(!t)throw new cn("An image element must be provided.");this.reset();var e=this.prepareImageElement(t);this.imageElement=e;var n;return this.isImageLoaded(e)?n=this.decodeOnce(e,!1,!0):n=this._decodeOnLoadImage(e),n},r.prototype.decodeFromVideoElement=function(t){var e=this._decodeFromVideoElementSetup(t);return this._decodeOnLoadVideo(e)},r.prototype.decodeFromVideoElementContinuously=function(t,e){var n=this._decodeFromVideoElementSetup(t);return this._decodeOnLoadVideoContinuously(n,e)},r.prototype._decodeFromVideoElementSetup=function(t){if(!t)throw new cn("A video element must be provided.");this.reset();var e=this.prepareVideoElement(t);return this.videoElement=e,e},r.prototype.decodeFromImageUrl=function(t){if(!t)throw new cn("An URL must be provided.");this.reset();var e=this.prepareImageElement();this.imageElement=e;var n=this._decodeOnLoadImage(e);return e.src=t,n},r.prototype.decodeFromVideoUrl=function(t){if(!t)throw new cn("An URL must be provided.");this.reset();var e=this.prepareVideoElement(),n=this.decodeFromVideoElement(e);return e.src=t,n},r.prototype.decodeFromVideoUrlContinuously=function(t,e){if(!t)throw new cn("An URL must be provided.");this.reset();var n=this.prepareVideoElement(),i=this.decodeFromVideoElementContinuously(n,e);return n.src=t,i},r.prototype._decodeOnLoadImage=function(t){var e=this;return new Promise(function(n,i){e.imageLoadedListener=function(){return e.decodeOnce(t,!1,!0).then(n,i)},t.addEventListener("load",e.imageLoadedListener)})},r.prototype._decodeOnLoadVideo=function(t){return hi(this,void 0,void 0,function(){return di(this,function(e){switch(e.label){case 0:return[4,this.playVideoOnLoadAsync(t)];case 1:return e.sent(),[4,this.decodeOnce(t)];case 2:return[2,e.sent()]}})})},r.prototype._decodeOnLoadVideoContinuously=function(t,e){return hi(this,void 0,void 0,function(){return di(this,function(n){switch(n.label){case 0:return[4,this.playVideoOnLoadAsync(t)];case 1:return n.sent(),this.decodeContinuously(t,e),[2]}})})},r.prototype.isImageLoaded=function(t){return!(!t.complete||t.naturalWidth===0)},r.prototype.prepareImageElement=function(t){var e;return typeof t=="undefined"&&(e=document.createElement("img"),e.width=200,e.height=200),typeof t=="string"&&(e=this.getMediaElement(t,"img")),t instanceof HTMLImageElement&&(e=t),e},r.prototype.prepareVideoElement=function(t){var e;return!t&&typeof document!="undefined"&&(e=document.createElement("video"),e.width=200,e.height=200),typeof t=="string"&&(e=this.getMediaElement(t,"video")),t instanceof HTMLVideoElement&&(e=t),e.setAttribute("autoplay","true"),e.setAttribute("muted","true"),e.setAttribute("playsinline","true"),e},r.prototype.decodeOnce=function(t,e,n){var i=this;e===void 0&&(e=!0),n===void 0&&(n=!0),this._stopAsyncDecode=!1;var a=function(o,s){if(i._stopAsyncDecode){s(new ze("Video stream has ended before any code could be detected.")),i._stopAsyncDecode=void 0;return}try{var u=i.decode(t);o(u)}catch(h){var c=e&&h instanceof ze,l=h instanceof bn||h instanceof ct,d=l&&n;if(c||d)return setTimeout(a,i._timeBetweenDecodingAttempts,o,s);s(h)}};return new Promise(function(o,s){return a(o,s)})},r.prototype.decodeContinuously=function(t,e){var n=this;this._stopContinuousDecode=!1;var i=function(){if(n._stopContinuousDecode){n._stopContinuousDecode=void 0;return}try{var a=n.decode(t);e(a,null),setTimeout(i,n.timeBetweenScansMillis)}catch(u){e(null,u);var o=u instanceof bn||u instanceof ct,s=u instanceof ze;(o||s)&&setTimeout(i,n._timeBetweenDecodingAttempts)}};i()},r.prototype.decode=function(t){var e=this.createBinaryBitmap(t);return this.decodeBitmap(e)},r.prototype.createBinaryBitmap=function(t){this.getCaptureCanvasContext(t);var e=!1;t instanceof HTMLVideoElement?(this.drawFrameOnCanvas(t),e=!0):this.drawImageOnCanvas(t);var n=this.getCaptureCanvas(t),i=new nk(n,e),a=new Ly(i);return new By(a)},r.prototype.getCaptureCanvasContext=function(t){if(!this.captureCanvasContext){var e=this.getCaptureCanvas(t),n=void 0;try{n=e.getContext("2d",{willReadFrequently:!0})}catch{n=e.getContext("2d")}this.captureCanvasContext=n}return this.captureCanvasContext},r.prototype.getCaptureCanvas=function(t){if(!this.captureCanvas){var e=this.createCaptureCanvas(t);this.captureCanvas=e}return this.captureCanvas},r.prototype.drawFrameOnCanvas=function(t,e,n){e===void 0&&(e={sx:0,sy:0,sWidth:t.videoWidth,sHeight:t.videoHeight,dx:0,dy:0,dWidth:t.videoWidth,dHeight:t.videoHeight}),n===void 0&&(n=this.captureCanvasContext),n.drawImage(t,e.sx,e.sy,e.sWidth,e.sHeight,e.dx,e.dy,e.dWidth,e.dHeight)},r.prototype.drawImageOnCanvas=function(t,e,n){e===void 0&&(e={sx:0,sy:0,sWidth:t.naturalWidth,sHeight:t.naturalHeight,dx:0,dy:0,dWidth:t.naturalWidth,dHeight:t.naturalHeight}),n===void 0&&(n=this.captureCanvasContext),n.drawImage(t,e.sx,e.sy,e.sWidth,e.sHeight,e.dx,e.dy,e.dWidth,e.dHeight)},r.prototype.decodeBitmap=function(t){return this.reader.decode(t,this._hints)},r.prototype.createCaptureCanvas=function(t){if(typeof document=="undefined")return this._destroyCaptureCanvas(),null;var e=document.createElement("canvas"),n,i;return typeof t!="undefined"&&(t instanceof HTMLVideoElement?(n=t.videoWidth,i=t.videoHeight):t instanceof HTMLImageElement&&(n=t.naturalWidth||t.width,i=t.naturalHeight||t.height)),e.style.width=n+"px",e.style.height=i+"px",e.width=n,e.height=i,e},r.prototype.stopStreams=function(){this.stream&&(this.stream.getVideoTracks().forEach(function(t){return t.stop()}),this.stream=void 0),this._stopAsyncDecode===!1&&this.stopAsyncDecode(),this._stopContinuousDecode===!1&&this.stopContinuousDecode()},r.prototype.reset=function(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()},r.prototype._destroyVideoElement=function(){!this.videoElement||(typeof this.videoEndedListener!="undefined"&&this.videoElement.removeEventListener("ended",this.videoEndedListener),typeof this.videoPlayingEventListener!="undefined"&&this.videoElement.removeEventListener("playing",this.videoPlayingEventListener),typeof this.videoCanPlayListener!="undefined"&&this.videoElement.removeEventListener("loadedmetadata",this.videoCanPlayListener),this.cleanVideoSource(this.videoElement),this.videoElement=void 0)},r.prototype._destroyImageElement=function(){!this.imageElement||(this.imageLoadedListener!==void 0&&this.imageElement.removeEventListener("load",this.imageLoadedListener),this.imageElement.src=void 0,this.imageElement.removeAttribute("src"),this.imageElement=void 0)},r.prototype._destroyCaptureCanvas=function(){this.captureCanvasContext=void 0,this.captureCanvas=void 0},r.prototype.addVideoSource=function(t,e){try{t.srcObject=e}catch{t.src=URL.createObjectURL(e)}},r.prototype.cleanVideoSource=function(t){try{t.srcObject=null}catch{t.src=""}this.videoElement.removeAttribute("src")},r}(),Yn=function(){function r(t,e,n,i,a,o){n===void 0&&(n=e==null?0:8*e.length),o===void 0&&(o=zr.currentTimeMillis()),this.text=t,this.rawBytes=e,this.numBits=n,this.resultPoints=i,this.format=a,this.timestamp=o,this.text=t,this.rawBytes=e,n==null?this.numBits=e==null?0:8*e.length:this.numBits=n,this.resultPoints=i,this.format=a,this.resultMetadata=null,o==null?this.timestamp=zr.currentTimeMillis():this.timestamp=o}return r.prototype.getText=function(){return this.text},r.prototype.getRawBytes=function(){return this.rawBytes},r.prototype.getNumBits=function(){return this.numBits},r.prototype.getResultPoints=function(){return this.resultPoints},r.prototype.getBarcodeFormat=function(){return this.format},r.prototype.getResultMetadata=function(){return this.resultMetadata},r.prototype.putMetadata=function(t,e){this.resultMetadata===null&&(this.resultMetadata=new Map),this.resultMetadata.set(t,e)},r.prototype.putAllMetadata=function(t){t!==null&&(this.resultMetadata===null?this.resultMetadata=t:this.resultMetadata=new Map(t))},r.prototype.addResultPoints=function(t){var e=this.resultPoints;if(e===null)this.resultPoints=t;else if(t!==null&&t.length>0){var n=new Array(e.length+t.length);zr.arraycopy(e,0,n,0,e.length),zr.arraycopy(t,0,n,e.length,t.length),this.resultPoints=n}},r.prototype.getTimestamp=function(){return this.timestamp},r.prototype.toString=function(){return this.text},r}(),R0;(function(r){r[r.AZTEC=0]="AZTEC",r[r.CODABAR=1]="CODABAR",r[r.CODE_39=2]="CODE_39",r[r.CODE_93=3]="CODE_93",r[r.CODE_128=4]="CODE_128",r[r.DATA_MATRIX=5]="DATA_MATRIX",r[r.EAN_8=6]="EAN_8",r[r.EAN_13=7]="EAN_13",r[r.ITF=8]="ITF",r[r.MAXICODE=9]="MAXICODE",r[r.PDF_417=10]="PDF_417",r[r.QR_CODE=11]="QR_CODE",r[r.RSS_14=12]="RSS_14",r[r.RSS_EXPANDED=13]="RSS_EXPANDED",r[r.UPC_A=14]="UPC_A",r[r.UPC_E=15]="UPC_E",r[r.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"})(R0||(R0={}));var It=R0,N0;(function(r){r[r.OTHER=0]="OTHER",r[r.ORIENTATION=1]="ORIENTATION",r[r.BYTE_SEGMENTS=2]="BYTE_SEGMENTS",r[r.ERROR_CORRECTION_LEVEL=3]="ERROR_CORRECTION_LEVEL",r[r.ISSUE_NUMBER=4]="ISSUE_NUMBER",r[r.SUGGESTED_PRICE=5]="SUGGESTED_PRICE",r[r.POSSIBLE_COUNTRY=6]="POSSIBLE_COUNTRY",r[r.UPC_EAN_EXTENSION=7]="UPC_EAN_EXTENSION",r[r.PDF417_EXTRA_METADATA=8]="PDF417_EXTRA_METADATA",r[r.STRUCTURED_APPEND_SEQUENCE=9]="STRUCTURED_APPEND_SEQUENCE",r[r.STRUCTURED_APPEND_PARITY=10]="STRUCTURED_APPEND_PARITY"})(N0||(N0={}));var zn=N0,ph=function(){function r(t,e,n,i,a,o){a===void 0&&(a=-1),o===void 0&&(o=-1),this.rawBytes=t,this.text=e,this.byteSegments=n,this.ecLevel=i,this.structuredAppendSequenceNumber=a,this.structuredAppendParity=o,this.numBits=t==null?0:8*t.length}return r.prototype.getRawBytes=function(){return this.rawBytes},r.prototype.getNumBits=function(){return this.numBits},r.prototype.setNumBits=function(t){this.numBits=t},r.prototype.getText=function(){return this.text},r.prototype.getByteSegments=function(){return this.byteSegments},r.prototype.getECLevel=function(){return this.ecLevel},r.prototype.getErrorsCorrected=function(){return this.errorsCorrected},r.prototype.setErrorsCorrected=function(t){this.errorsCorrected=t},r.prototype.getErasures=function(){return this.erasures},r.prototype.setErasures=function(t){this.erasures=t},r.prototype.getOther=function(){return this.other},r.prototype.setOther=function(t){this.other=t},r.prototype.hasStructuredAppend=function(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0},r.prototype.getStructuredAppendParity=function(){return this.structuredAppendParity},r.prototype.getStructuredAppendSequenceNumber=function(){return this.structuredAppendSequenceNumber},r}(),qc=function(){function r(){}return r.prototype.exp=function(t){return this.expTable[t]},r.prototype.log=function(t){if(t===0)throw new Bt;return this.logTable[t]},r.addOrSubtract=function(t,e){return t^e},r}(),Xo=function(){function r(t,e){if(e.length===0)throw new Bt;this.field=t;var n=e.length;if(n>1&&e[0]===0){for(var i=1;in.length){var i=e;e=n,n=i}var a=new Int32Array(n.length),o=n.length-e.length;zr.arraycopy(n,0,a,0,o);for(var s=o;s=t.getDegree()&&!i.isZero();){var s=i.getDegree()-t.getDegree(),u=e.multiply(i.getCoefficient(i.getDegree()),o),c=t.multiplyByMonomial(s,u),l=e.buildMonomial(s,u);n=n.addOrSubtract(l),i=i.addOrSubtract(c)}return[n,i]},r.prototype.toString=function(){for(var t="",e=this.getDegree();e>=0;e--){var n=this.getCoefficient(e);if(n!==0){if(n<0?(t+=" - ",n=-n):t.length>0&&(t+=" + "),e===0||n!==1){var i=this.field.log(n);i===0?t+="1":i===1?t+="a":(t+="a^",t+=i)}e!==0&&(e===1?t+="x":(t+="x^",t+=e))}}return t},r}(),ok=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),jy=function(r){ok(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="ArithmeticException",t}(Ai),sk=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),mo=function(r){sk(t,r);function t(e,n,i){var a=r.call(this)||this;a.primitive=e,a.size=n,a.generatorBase=i;for(var o=new Int32Array(n),s=1,u=0;u=n&&(s^=e,s&=n-1);a.expTable=o;for(var c=new Int32Array(n),u=0;u=(n/2|0);){var l=o,d=u;if(o=s,u=c,o.isZero())throw new mh("r_{i-1} was zero");s=l;for(var h=a.getZero(),f=o.getCoefficient(o.getDegree()),g=a.inverse(f);s.getDegree()>=o.getDegree()&&!s.isZero();){var m=s.getDegree()-o.getDegree(),p=a.multiply(s.getCoefficient(s.getDegree()),g);h=h.addOrSubtract(a.buildMonomial(m,p)),s=s.addOrSubtract(o.multiplyByMonomial(m,p))}if(c=h.multiply(u).addOrSubtract(d),s.getDegree()>=o.getDegree())throw new yu("Division algorithm failed to reduce polynomial?")}var y=c.getCoefficient(0);if(y===0)throw new mh("sigmaTilde(0) was zero");var v=a.inverse(y),b=c.multiplyScalar(v),E=s.multiplyScalar(v);return[b,E]},r.prototype.findErrorLocations=function(t){var e=t.getDegree();if(e===1)return Int32Array.from([t.getCoefficient(1)]);for(var n=new Int32Array(e),i=0,a=this.field,o=1;o1,g,g+n-1),g+=n-1;else for(var m=n-1;m>=0;--m)f[g++]=(h&1<=8?r.readCode(t,e,8):r.readCode(t,e,n)<<8-n},r.convertBoolArrayToByteArray=function(t){for(var e=new Uint8Array((t.length+7)/8),n=0;n","?","[","]","{","}","CTRL_UL"],r.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"],r}(),yr=function(){function r(){}return r.round=function(t){return isNaN(t)?0:t<=Number.MIN_SAFE_INTEGER?Number.MIN_SAFE_INTEGER:t>=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:t+(t<0?-.5:.5)|0},r.distance=function(t,e,n,i){var a=t-n,o=e-i;return Math.sqrt(a*a+o*o)},r.sum=function(t){for(var e=0,n=0,i=t.length;n!==i;n++){var a=t[n];e+=a}return e},r}(),F0=function(){function r(){}return r.floatToIntBits=function(t){return t},r.MAX_VALUE=Number.MAX_SAFE_INTEGER,r}(),yt=function(){function r(t,e){this.x=t,this.y=e}return r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.equals=function(t){if(t instanceof r){var e=t;return this.x===e.x&&this.y===e.y}return!1},r.prototype.hashCode=function(){return 31*F0.floatToIntBits(this.x)+F0.floatToIntBits(this.y)},r.prototype.toString=function(){return"("+this.x+","+this.y+")"},r.orderBestPatterns=function(t){var e=this.distance(t[0],t[1]),n=this.distance(t[1],t[2]),i=this.distance(t[0],t[2]),a,o,s;if(n>=e&&n>=i?(o=t[0],a=t[1],s=t[2]):i>=n&&i>=e?(o=t[1],a=t[0],s=t[2]):(o=t[2],a=t[0],s=t[1]),this.crossProductZ(a,o,s)<0){var u=a;a=s,s=u}t[0]=a,t[1]=o,t[2]=s},r.distance=function(t,e){return yr.distance(t.x,t.y,e.x,e.y)},r.crossProductZ=function(t,e,n){var i=e.x,a=e.y;return(n.x-i)*(t.y-a)-(n.y-a)*(t.x-i)},r}(),M0=function(){function r(t,e){this.bits=t,this.points=e}return r.prototype.getBits=function(){return this.bits},r.prototype.getPoints=function(){return this.points},r}(),lk=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),fk=function(r){lk(t,r);function t(e,n,i,a,o){var s=r.call(this,e,n)||this;return s.compact=i,s.nbDatablocks=a,s.nbLayers=o,s}return t.prototype.getNbLayers=function(){return this.nbLayers},t.prototype.getNbDatablocks=function(){return this.nbDatablocks},t.prototype.isCompact=function(){return this.compact},t}(M0),U0=function(){function r(t,e,n,i){this.image=t,this.height=t.getHeight(),this.width=t.getWidth(),e==null&&(e=r.INIT_SIZE),n==null&&(n=t.getWidth()/2|0),i==null&&(i=t.getHeight()/2|0);var a=e/2|0;if(this.leftInit=n-a,this.rightInit=n+a,this.upInit=i-a,this.downInit=i+a,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new ze}return r.prototype.detect=function(){for(var t=this.leftInit,e=this.rightInit,n=this.upInit,i=this.downInit,a=!1,o=!0,s=!1,u=!1,c=!1,l=!1,d=!1,h=this.width,f=this.height;o;){o=!1;for(var g=!0;(g||!u)&&e=h){a=!0;break}for(var m=!0;(m||!c)&&i=f){a=!0;break}for(var p=!0;(p||!l)&&t>=0;)p=this.containsBlackPoint(n,i,t,!1),p?(t--,o=!0,l=!0):l||t--;if(t<0){a=!0;break}for(var y=!0;(y||!d)&&n>=0;)y=this.containsBlackPoint(t,e,n,!0),y?(n--,o=!0,d=!0):d||n--;if(n<0){a=!0;break}o&&(s=!0)}if(!a&&s){for(var v=e-t,b=null,E=1;b===null&&En||u<-1||u>i)throw new ze;a=!1,s===-1?(e[o]=0,a=!0):s===n&&(e[o]=n-1,a=!0),u===-1?(e[o+1]=0,a=!0):u===i&&(e[o+1]=i-1,a=!0)}a=!0;for(var o=e.length-2;o>=0&&a;o-=2){var s=Math.floor(e[o]),u=Math.floor(e[o+1]);if(s<-1||s>n||u<-1||u>i)throw new ze;a=!1,s===-1?(e[o]=0,a=!0):s===n&&(e[o]=n-1,a=!0),u===-1?(e[o+1]=0,a=!0):u===i&&(e[o+1]=i-1,a=!0)}},r}(),Hy=function(){function r(t,e,n,i,a,o,s,u,c){this.a11=t,this.a21=e,this.a31=n,this.a12=i,this.a22=a,this.a32=o,this.a13=s,this.a23=u,this.a33=c}return r.quadrilateralToQuadrilateral=function(t,e,n,i,a,o,s,u,c,l,d,h,f,g,m,p){var y=r.quadrilateralToSquare(t,e,n,i,a,o,s,u),v=r.squareToQuadrilateral(c,l,d,h,f,g,m,p);return v.times(y)},r.prototype.transformPoints=function(t){for(var e=t.length,n=this.a11,i=this.a12,a=this.a13,o=this.a21,s=this.a22,u=this.a23,c=this.a31,l=this.a32,d=this.a33,h=0;h>1&127):(i<<=10,i+=(o>>2&31<<5)+(o>>1&31))}var s=this.getCorrectedParameterData(i,this.compact);this.compact?(this.nbLayers=(s>>6)+1,this.nbDataBlocks=(s&63)+1):(this.nbLayers=(s>>11)+1,this.nbDataBlocks=(s&2047)+1)},r.prototype.getRotation=function(t,e){var n=0;t.forEach(function(a,o,s){var u=(a>>e-2<<1)+(a&1);n=(n<<3)+u}),n=((n&1)<<11)+(n>>1);for(var i=0;i<4;i++)if(ln.bitCount(n^this.EXPECTED_CORNER_BITS[i])<=2)return i;throw new ze},r.prototype.getCorrectedParameterData=function(t,e){var n,i;e?(n=7,i=2):(n=10,i=4);for(var a=n-i,o=new Int32Array(n),s=n-1;s>=0;--s)o[s]=t&15,t>>=4;try{var u=new gh(mo.AZTEC_PARAM);u.decode(o,a)}catch{throw new ze}for(var c=0,s=0;s2){var d=this.distancePoint(l,s)*this.nbCenterLayers/(this.distancePoint(a,e)*(this.nbCenterLayers+2));if(d<.75||d>1.25||!this.isWhiteOrBlackRectangle(s,u,c,l))break}e=s,n=u,i=c,a=l,o=!o}if(this.nbCenterLayers!==5&&this.nbCenterLayers!==7)throw new ze;this.compact=this.nbCenterLayers===5;var h=new yt(e.getX()+.5,e.getY()-.5),f=new yt(n.getX()+.5,n.getY()+.5),g=new yt(i.getX()-.5,i.getY()+.5),m=new yt(a.getX()-.5,a.getY()-.5);return this.expandSquare([h,f,g,m],2*this.nbCenterLayers-3,2*this.nbCenterLayers)},r.prototype.getMatrixCenter=function(){var t,e,n,i;try{var a=new U0(this.image).detect();t=a[0],e=a[1],n=a[2],i=a[3]}catch{var o=this.image.getWidth()/2,s=this.image.getHeight()/2;t=this.getFirstDifferent(new Si(o+7,s-7),!1,1,-1).toResultPoint(),e=this.getFirstDifferent(new Si(o+7,s+7),!1,1,1).toResultPoint(),n=this.getFirstDifferent(new Si(o-7,s+7),!1,-1,1).toResultPoint(),i=this.getFirstDifferent(new Si(o-7,s-7),!1,-1,-1).toResultPoint()}var u=yr.round((t.getX()+i.getX()+e.getX()+n.getX())/4),c=yr.round((t.getY()+i.getY()+e.getY()+n.getY())/4);try{var a=new U0(this.image,15,u,c).detect();t=a[0],e=a[1],n=a[2],i=a[3]}catch{t=this.getFirstDifferent(new Si(u+7,c-7),!1,1,-1).toResultPoint(),e=this.getFirstDifferent(new Si(u+7,c+7),!1,1,1).toResultPoint(),n=this.getFirstDifferent(new Si(u-7,c+7),!1,-1,1).toResultPoint(),i=this.getFirstDifferent(new Si(u-7,c-7),!1,-1,-1).toResultPoint()}return u=yr.round((t.getX()+i.getX()+e.getX()+n.getX())/4),c=yr.round((t.getY()+i.getY()+e.getY()+n.getY())/4),new Si(u,c)},r.prototype.getMatrixCornerPoints=function(t){return this.expandSquare(t,2*this.nbCenterLayers,this.getDimension())},r.prototype.sampleGrid=function(t,e,n,i,a){var o=B0.getInstance(),s=this.getDimension(),u=s/2-this.nbCenterLayers,c=s/2+this.nbCenterLayers;return o.sampleGrid(t,s,s,u,u,c,u,c,c,u,c,e.getX(),e.getY(),n.getX(),n.getY(),i.getX(),i.getY(),a.getX(),a.getY())},r.prototype.sampleLine=function(t,e,n){for(var i=0,a=this.distanceResultPoint(t,e),o=a/n,s=t.getX(),u=t.getY(),c=o*(e.getX()-t.getX())/a,l=o*(e.getY()-t.getY())/a,d=0;d.1&&h<.9?0:h<=.1===c?1:-1},r.prototype.getFirstDifferent=function(t,e,n,i){for(var a=t.getX()+n,o=t.getY()+i;this.isValid(a,o)&&this.image.get(a,o)===e;)a+=n,o+=i;for(a-=n,o-=i;this.isValid(a,o)&&this.image.get(a,o)===e;)a+=n;for(a-=n;this.isValid(a,o)&&this.image.get(a,o)===e;)o+=i;return o-=i,new Si(a,o)},r.prototype.expandSquare=function(t,e,n){var i=n/(2*e),a=t[0].getX()-t[2].getX(),o=t[0].getY()-t[2].getY(),s=(t[0].getX()+t[2].getX())/2,u=(t[0].getY()+t[2].getY())/2,c=new yt(s+i*a,u+i*o),l=new yt(s-i*a,u-i*o);a=t[1].getX()-t[3].getX(),o=t[1].getY()-t[3].getY(),s=(t[1].getX()+t[3].getX())/2,u=(t[1].getY()+t[3].getY())/2;var d=new yt(s+i*a,u+i*o),h=new yt(s-i*a,u-i*o),f=[c,d,l,h];return f},r.prototype.isValid=function(t,e){return t>=0&&t0&&e>(o?8:5)),u;o?u=i:u=15;for(var c=Math.trunc(i/2),l=0;l=i)break;try{a=t.getBlackRow(f,a)}catch{continue}for(var g=function(v){if(v===1&&(a.reverse(),e&&e.get(Hr.NEED_RESULT_POINT_CALLBACK)===!0)){var b=new Map;e.forEach(function(F,z){return b.set(z,F)}),b.delete(Hr.NEED_RESULT_POINT_CALLBACK),e=b}try{var E=m.decodeRow(f,a,e);if(v===1){E.putMetadata(zn.ORIENTATION,180);var D=E.getResultPoints();D!==null&&(D[0]=new yt(n-D[0].getX()-1,D[0].getY()),D[1]=new yt(n-D[1].getX()-1,D[1].getY()))}return{value:E}}catch{}},m=this,p=0;p<2;p++){var y=g(p);if(typeof y=="object")return y.value}}throw new ze},r.recordPattern=function(t,e,n){for(var i=n.length,a=0;a=o)throw new ze;for(var s=!t.get(e),u=0,c=e;c0&&i>=0;)t.get(--e)!==a&&(i--,a=!a);if(i>=0)throw new ze;r.recordPattern(t,e+1,n)},r.patternMatchVariance=function(t,e,n){for(var i=t.length,a=0,o=0,s=0;sh?d-h:h-d;if(f>n)return Number.POSITIVE_INFINITY;c+=f}return c/a},r}(),gk=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),$y=function(r){gk(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.findStartPattern=function(e){for(var n=e.getSize(),i=e.getNextSet(0),a=0,o=Int32Array.from([0,0,0,0,0,0]),s=i,u=!1,c=6,l=i;l=0&&e.isRange(Math.max(0,s-(l-s)/2),s,!1))return Int32Array.from([s,l,h]);s+=o[0]+o[1],o=o.slice(2,o.length),o[a-1]=0,o[a]=0,a--}else a++;o[a]=1,u=!u}throw new ze},t.decodeCode=function(e,n,i){Dn.recordPattern(e,i,n);for(var a=t.MAX_AVG_VARIANCE,o=-1,s=0;s=0)return o;throw new ze},t.prototype.decodeRow=function(e,n,i){var a=i&&i.get(Hr.ASSUME_GS1)===!0,o=t.findStartPattern(n),s=o[2],u=0,c=new Uint8Array(20);c[u++]=s;var l;switch(s){case t.CODE_START_A:l=t.CODE_CODE_A;break;case t.CODE_START_B:l=t.CODE_CODE_B;break;case t.CODE_START_C:l=t.CODE_CODE_C;break;default:throw new ct}for(var d=!1,h=!1,f="",g=o[0],m=o[1],p=Int32Array.from([0,0,0,0,0,0]),y=0,v=0,b=s,E=0,D=!0,F=!1,z=!1;!d;){var W=h;switch(h=!1,y=v,v=t.decodeCode(n,p,m),c[u++]=v,v!==t.CODE_STOP&&(D=!0),v!==t.CODE_STOP&&(E++,b+=E*v),g=m,m+=p.reduce(function(w,x){return w+x},0),v){case t.CODE_START_A:case t.CODE_START_B:case t.CODE_START_C:throw new ct}switch(l){case t.CODE_CODE_A:if(v<64)z===F?f+=String.fromCharCode(" ".charCodeAt(0)+v):f+=String.fromCharCode(" ".charCodeAt(0)+v+128),z=!1;else if(v<96)z===F?f+=String.fromCharCode(v-64):f+=String.fromCharCode(v+64),z=!1;else switch(v!==t.CODE_STOP&&(D=!1),v){case t.CODE_FNC_1:a&&(f.length===0?f+="]C1":f+=String.fromCharCode(29));break;case t.CODE_FNC_2:case t.CODE_FNC_3:break;case t.CODE_FNC_4_A:!F&&z?(F=!0,z=!1):F&&z?(F=!1,z=!1):z=!0;break;case t.CODE_SHIFT:h=!0,l=t.CODE_CODE_B;break;case t.CODE_CODE_B:l=t.CODE_CODE_B;break;case t.CODE_CODE_C:l=t.CODE_CODE_C;break;case t.CODE_STOP:d=!0;break}break;case t.CODE_CODE_B:if(v<96)z===F?f+=String.fromCharCode(" ".charCodeAt(0)+v):f+=String.fromCharCode(" ".charCodeAt(0)+v+128),z=!1;else switch(v!==t.CODE_STOP&&(D=!1),v){case t.CODE_FNC_1:a&&(f.length===0?f+="]C1":f+=String.fromCharCode(29));break;case t.CODE_FNC_2:case t.CODE_FNC_3:break;case t.CODE_FNC_4_B:!F&&z?(F=!0,z=!1):F&&z?(F=!1,z=!1):z=!0;break;case t.CODE_SHIFT:h=!0,l=t.CODE_CODE_A;break;case t.CODE_CODE_A:l=t.CODE_CODE_A;break;case t.CODE_CODE_C:l=t.CODE_CODE_C;break;case t.CODE_STOP:d=!0;break}break;case t.CODE_CODE_C:if(v<100)v<10&&(f+="0"),f+=v;else switch(v!==t.CODE_STOP&&(D=!1),v){case t.CODE_FNC_1:a&&(f.length===0?f+="]C1":f+=String.fromCharCode(29));break;case t.CODE_CODE_A:l=t.CODE_CODE_A;break;case t.CODE_CODE_B:l=t.CODE_CODE_B;break;case t.CODE_STOP:d=!0;break}break}W&&(l=l===t.CODE_CODE_A?t.CODE_CODE_B:t.CODE_CODE_A)}var U=m-g;if(m=n.getNextUnset(m),!n.isRange(m,Math.min(n.getSize(),m+(m-g)/2),!1))throw new ze;if(b-=E*y,b%103!==y)throw new bn;var G=f.length;if(G===0)throw new ze;G>0&&D&&(l===t.CODE_CODE_C?f=f.substring(0,G-2):f=f.substring(0,G-1));for(var ee=(o[1]+o[0])/2,P=g+U/2,I=c.length,S=new Uint8Array(I),C=0;C=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Vy=function(r){vk(t,r);function t(e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var i=r.call(this)||this;return i.usingCheckDigit=e,i.extendedMode=n,i.decodeRowResult="",i.counters=new Int32Array(9),i}return t.prototype.decodeRow=function(e,n,i){var a,o,s,u,c=this.counters;c.fill(0),this.decodeRowResult="";var l=t.findAsteriskPattern(n,c),d=n.getNextSet(l[1]),h=n.getSize(),f,g;do{t.recordPattern(n,d,c);var m=t.toNarrowWidePattern(c);if(m<0)throw new ze;f=t.patternToChar(m),this.decodeRowResult+=f,g=d;try{for(var p=(a=void 0,P0(c)),y=p.next();!y.done;y=p.next()){var v=y.value;d+=v}}catch(I){a={error:I}}finally{try{y&&!y.done&&(o=p.return)&&o.call(p)}finally{if(a)throw a.error}}d=n.getNextSet(d)}while(f!=="*");this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var b=0;try{for(var E=P0(c),D=E.next();!D.done;D=E.next()){var v=D.value;b+=v}}catch(I){s={error:I}}finally{try{D&&!D.done&&(u=E.return)&&u.call(E)}finally{if(s)throw s.error}}var F=d-g-b;if(d!==h&&F*2o&&(u=d)}}catch(m){n={error:m}}finally{try{l&&!l.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}o=u,s=0;for(var h=0,f=0,g=0;go&&(f|=1<0;g++){var d=e[g];if(d>o&&(s--,d*2>=h))return-1}return f}}while(s>3);return-1},t.patternToChar=function(e){for(var n=0;n="A"&&s<="Z")u=String.fromCharCode(s.charCodeAt(0)+32);else throw new ct;break;case"$":if(s>="A"&&s<="Z")u=String.fromCharCode(s.charCodeAt(0)-64);else throw new ct;break;case"%":if(s>="A"&&s<="E")u=String.fromCharCode(s.charCodeAt(0)-38);else if(s>="F"&&s<="J")u=String.fromCharCode(s.charCodeAt(0)-11);else if(s>="K"&&s<="O")u=String.fromCharCode(s.charCodeAt(0)+16);else if(s>="P"&&s<="T")u=String.fromCharCode(s.charCodeAt(0)+43);else if(s==="U")u="\0";else if(s==="V")u="@";else if(s==="W")u="`";else if(s==="X"||s==="Y"||s==="Z")u="\x7F";else throw new ct;break;case"/":if(s>="A"&&s<="O")u=String.fromCharCode(s.charCodeAt(0)-32);else if(s==="Z")u=":";else throw new ct;break}i+=u,a++}else i+=o}return i},t.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%",t.CHARACTER_ENCODINGS=[52,289,97,352,49,304,112,37,292,100,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,168,162,138,42],t.ASTERISK_ENCODING=148,t}(Dn),yk=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),L0=globalThis&&globalThis.__values||function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},qy=function(r){yk(t,r);function t(){var e=r.call(this)||this;return e.decodeRowResult="",e.counters=new Int32Array(6),e}return t.prototype.decodeRow=function(e,n,i){var a,o,s,u,c=this.findAsteriskPattern(n),l=n.getNextSet(c[1]),d=n.getSize(),h=this.counters;h.fill(0),this.decodeRowResult="";var f,g;do{t.recordPattern(n,l,h);var m=this.toPattern(h);if(m<0)throw new ze;f=this.patternToChar(m),this.decodeRowResult+=f,g=l;try{for(var p=(a=void 0,L0(h)),y=p.next();!y.done;y=p.next()){var v=y.value;l+=v}}catch(U){a={error:U}}finally{try{y&&!y.done&&(o=p.return)&&o.call(p)}finally{if(a)throw a.error}}l=n.getNextSet(l)}while(f!=="*");this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var b=0;try{for(var E=L0(h),D=E.next();!D.done;D=E.next()){var v=D.value;b+=v}}catch(U){s={error:U}}finally{try{D&&!D.done&&(u=E.return)&&u.call(E)}finally{if(s)throw s.error}}if(l===d||!n.get(l))throw new ze;if(this.decodeRowResult.length<2)throw new ze;this.checkChecksums(this.decodeRowResult),this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-2);var F=this.decodeExtended(this.decodeRowResult),z=(c[1]+c[0])/2,W=g+b/2;return new Yn(F,null,0,[new yt(z,e),new yt(W,e)],It.CODE_93,new Date().getTime())},t.prototype.findAsteriskPattern=function(e){var n=e.getSize(),i=e.getNextSet(0);this.counters.fill(0);for(var a=this.counters,o=i,s=!1,u=a.length,c=0,l=i;l4)return-1;if((d&1)==0)for(var f=0;f="a"&&o<="d"){if(a>=n-1)throw new ct;var s=e.charAt(a+1),u="\0";switch(o){case"d":if(s>="A"&&s<="Z")u=String.fromCharCode(s.charCodeAt(0)+32);else throw new ct;break;case"a":if(s>="A"&&s<="Z")u=String.fromCharCode(s.charCodeAt(0)-64);else throw new ct;break;case"b":if(s>="A"&&s<="E")u=String.fromCharCode(s.charCodeAt(0)-38);else if(s>="F"&&s<="J")u=String.fromCharCode(s.charCodeAt(0)-11);else if(s>="K"&&s<="O")u=String.fromCharCode(s.charCodeAt(0)+16);else if(s>="P"&&s<="T")u=String.fromCharCode(s.charCodeAt(0)+43);else if(s==="U")u="\0";else if(s==="V")u="@";else if(s==="W")u="`";else if(s>="X"&&s<="Z")u=String.fromCharCode(127);else throw new ct;break;case"c":if(s>="A"&&s<="O")u=String.fromCharCode(s.charCodeAt(0)-32);else if(s==="Z")u=":";else throw new ct;break}i+=u,a++}else i+=o}return i},t.prototype.checkChecksums=function(e){var n=e.length;this.checkOneChecksum(e,n-2,20),this.checkOneChecksum(e,n-1,15)},t.prototype.checkOneChecksum=function(e,n,i){for(var a=1,o=0,s=n-1;s>=0;s--)o+=a*t.ALPHABET_STRING.indexOf(e.charAt(s)),++a>i&&(a=1);if(e.charAt(n)!==t.ALPHABET_STRING[o%47])throw new bn},t.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%abcd*",t.CHARACTER_ENCODINGS=[276,328,324,322,296,292,290,336,274,266,424,420,418,404,402,394,360,356,354,308,282,344,332,326,300,278,436,434,428,422,406,410,364,358,310,314,302,468,466,458,366,374,430,294,474,470,306,350],t.ASTERISK_ENCODING=t.CHARACTER_ENCODINGS[47],t}(Dn),bk=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),wk=globalThis&&globalThis.__values||function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Gy=function(r){bk(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.narrowLineWidth=-1,e}return t.prototype.decodeRow=function(e,n,i){var a,o,s=this.decodeStart(n),u=this.decodeEnd(n),c=new er;t.decodeMiddle(n,s[1],u[0],c);var l=c.toString(),d=null;i!=null&&(d=i.get(Hr.ALLOWED_LENGTHS)),d==null&&(d=t.DEFAULT_ALLOWED_LENGTHS);var h=l.length,f=!1,g=0;try{for(var m=wk(d),p=m.next();!p.done;p=m.next()){var y=p.value;if(h===y){f=!0;break}y>g&&(g=y)}}catch(E){a={error:E}}finally{try{p&&!p.done&&(o=m.return)&&o.call(m)}finally{if(a)throw a.error}}if(!f&&h>g&&(f=!0),!f)throw new ct;var v=[new yt(s[1],e),new yt(u[0],e)],b=new Yn(l,null,0,v,It.ITF,new Date().getTime());return b},t.decodeMiddle=function(e,n,i,a){var o=new Int32Array(10),s=new Int32Array(5),u=new Int32Array(5);for(o.fill(0),s.fill(0),u.fill(0);n0&&a>=0&&!e.get(a);a--)i--;if(i!==0)throw new ze},t.skipWhiteSpace=function(e){var n=e.getSize(),i=e.getNextSet(0);if(i===n)throw new ze;return i},t.prototype.decodeEnd=function(e){e.reverse();try{var n=t.skipWhiteSpace(e),i=void 0;try{i=t.findGuardPattern(e,n,t.END_PATTERN_REVERSED[0])}catch(o){o instanceof ze&&(i=t.findGuardPattern(e,n,t.END_PATTERN_REVERSED[1]))}this.validateQuietZone(e,i[0]);var a=i[0];return i[0]=e.getSize()-i[1],i[1]=e.getSize()-a,i}finally{e.reverse()}},t.findGuardPattern=function(e,n,i){var a=i.length,o=new Int32Array(a),s=e.getSize(),u=!1,c=0,l=n;o.fill(0);for(var d=n;d=0)return i%10;throw new ze},t.PATTERNS=[Int32Array.from([1,1,2,2,1]),Int32Array.from([2,1,1,1,2]),Int32Array.from([1,2,1,1,2]),Int32Array.from([2,2,1,1,1]),Int32Array.from([1,1,2,1,2]),Int32Array.from([2,1,2,1,1]),Int32Array.from([1,2,2,1,1]),Int32Array.from([1,1,1,2,2]),Int32Array.from([2,1,1,2,1]),Int32Array.from([1,2,1,2,1]),Int32Array.from([1,1,3,3,1]),Int32Array.from([3,1,1,1,3]),Int32Array.from([1,3,1,1,3]),Int32Array.from([3,3,1,1,1]),Int32Array.from([1,1,3,1,3]),Int32Array.from([3,1,3,1,1]),Int32Array.from([1,3,3,1,1]),Int32Array.from([1,1,1,3,3]),Int32Array.from([3,1,1,3,1]),Int32Array.from([1,3,1,3,1])],t.MAX_AVG_VARIANCE=.38,t.MAX_INDIVIDUAL_VARIANCE=.5,t.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],t.START_PATTERN=Int32Array.from([1,1,1,1]),t.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])],t}(Dn),_k=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),bu=function(r){_k(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.decodeRowStringBuffer="",e}return t.findStartGuardPattern=function(e){for(var n=!1,i,a=0,o=Int32Array.from([0,0,0]);!n;){o=Int32Array.from([0,0,0]),i=t.findGuardPattern(e,a,!1,this.START_END_PATTERN,o);var s=i[0];a=i[1];var u=s-(a-s);u>=0&&(n=e.isRange(u,s,!1))}return i},t.checkChecksum=function(e){return t.checkStandardUPCEANChecksum(e)},t.checkStandardUPCEANChecksum=function(e){var n=e.length;if(n===0)return!1;var i=parseInt(e.charAt(n-1),10);return t.getStandardUPCEANChecksum(e.substring(0,n-1))===i},t.getStandardUPCEANChecksum=function(e){for(var n=e.length,i=0,a=n-1;a>=0;a-=2){var o=e.charAt(a).charCodeAt(0)-"0".charCodeAt(0);if(o<0||o>9)throw new ct;i+=o}i*=3;for(var a=n-2;a>=0;a-=2){var o=e.charAt(a).charCodeAt(0)-"0".charCodeAt(0);if(o<0||o>9)throw new ct;i+=o}return(1e3-i)%10},t.decodeEnd=function(e,n){return t.findGuardPattern(e,n,!1,t.START_END_PATTERN,new Int32Array(t.START_END_PATTERN.length).fill(0))},t.findGuardPatternWithoutCounters=function(e,n,i,a){return this.findGuardPattern(e,n,i,a,new Int32Array(a.length))},t.findGuardPattern=function(e,n,i,a,o){var s=e.getSize();n=i?e.getNextUnset(n):e.getNextSet(n);for(var u=0,c=n,l=a.length,d=i,h=n;h=0)return s;throw new ze},t.MAX_AVG_VARIANCE=.48,t.MAX_INDIVIDUAL_VARIANCE=.7,t.START_END_PATTERN=Int32Array.from([1,1,1]),t.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),t.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),t.L_PATTERNS=[Int32Array.from([3,2,1,1]),Int32Array.from([2,2,2,1]),Int32Array.from([2,1,2,2]),Int32Array.from([1,4,1,1]),Int32Array.from([1,1,3,2]),Int32Array.from([1,2,3,1]),Int32Array.from([1,1,1,4]),Int32Array.from([1,3,1,2]),Int32Array.from([1,2,1,3]),Int32Array.from([3,1,1,2])],t}(Dn),xk=globalThis&&globalThis.__values||function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ek=function(){function r(){this.CHECK_DIGIT_ENCODINGS=[24,20,18,17,12,6,3,10,9,5],this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return r.prototype.decodeRow=function(t,e,n){var i=this.decodeRowStringBuffer,a=this.decodeMiddle(e,n,i),o=i.toString(),s=r.parseExtensionString(o),u=[new yt((n[0]+n[1])/2,t),new yt(a,t)],c=new Yn(o,null,0,u,It.UPC_EAN_EXTENSION,new Date().getTime());return s!=null&&c.putAllMetadata(s),c},r.prototype.decodeMiddle=function(t,e,n){var i,a,o=this.decodeMiddleCounters;o[0]=0,o[1]=0,o[2]=0,o[3]=0;for(var s=t.getSize(),u=e[1],c=0,l=0;l<5&&u=10&&(c|=1<<4-l),l!==4&&(u=t.getNextSet(u),u=t.getNextUnset(u))}if(n.length!==5)throw new ze;var m=this.determineCheckDigit(c);if(r.extensionChecksum(n.toString())!==m)throw new ze;return u},r.extensionChecksum=function(t){for(var e=t.length,n=0,i=e-2;i>=0;i-=2)n+=t.charAt(i).charCodeAt(0)-"0".charCodeAt(0);n*=3;for(var i=e-1;i>=0;i-=2)n+=t.charAt(i).charCodeAt(0)-"0".charCodeAt(0);return n*=3,n%10},r.prototype.determineCheckDigit=function(t){for(var e=0;e<10;e++)if(t===this.CHECK_DIGIT_ENCODINGS[e])return e;throw new ze},r.parseExtensionString=function(t){if(t.length!==5)return null;var e=r.parseExtension5String(t);return e==null?null:new Map([[zn.SUGGESTED_PRICE,e]])},r.parseExtension5String=function(t){var e;switch(t.charAt(0)){case"0":e="\xA3";break;case"5":e="$";break;case"9":switch(t){case"90000":return null;case"99991":return"0.00";case"99990":return"Used"}e="";break;default:e="";break}var n=parseInt(t.substring(1)),i=(n/100).toString(),a=n%100,o=a<10?"0"+a:a.toString();return e+i+"."+o},r}(),Ak=globalThis&&globalThis.__values||function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Tk=function(){function r(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return r.prototype.decodeRow=function(t,e,n){var i=this.decodeRowStringBuffer,a=this.decodeMiddle(e,n,i),o=i.toString(),s=r.parseExtensionString(o),u=[new yt((n[0]+n[1])/2,t),new yt(a,t)],c=new Yn(o,null,0,u,It.UPC_EAN_EXTENSION,new Date().getTime());return s!=null&&c.putAllMetadata(s),c},r.prototype.decodeMiddle=function(t,e,n){var i,a,o=this.decodeMiddleCounters;o[0]=0,o[1]=0,o[2]=0,o[3]=0;for(var s=t.getSize(),u=e[1],c=0,l=0;l<2&&u=10&&(c|=1<<1-l),l!==1&&(u=t.getNextSet(u),u=t.getNextUnset(u))}if(n.length!==2)throw new ze;if(parseInt(n.toString())%4!==c)throw new ze;return u},r.parseExtensionString=function(t){return t.length!==2?null:new Map([[zn.ISSUE_NUMBER,parseInt(t)]])},r}(),Sk=function(){function r(){}return r.decodeRow=function(t,e,n){var i=bu.findGuardPattern(e,n,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{var a=new Ek;return a.decodeRow(t,e,i)}catch{var o=new Tk;return o.decodeRow(t,e,i)}},r.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]),r}(),Dk=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Cn=function(r){Dk(t,r);function t(){var e=r.call(this)||this;e.decodeRowStringBuffer="",t.L_AND_G_PATTERNS=t.L_PATTERNS.map(function(s){return Int32Array.from(s)});for(var n=10;n<20;n++){for(var i=t.L_PATTERNS[n-10],a=new Int32Array(i.length),o=0;o=n.getSize()||!n.isRange(g,m,!1))throw new ze;var p=l.toString();if(p.length<8)throw new ct;if(!t.checkChecksum(p))throw new bn;var y=(a[1]+a[0])/2,v=(h[1]+h[0])/2,b=this.getBarcodeFormat(),E=[new yt(y,e),new yt(v,e)],D=new Yn(p,null,0,E,b,new Date().getTime()),F=0;try{var z=Sk.decodeRow(e,n,h[1]);D.putMetadata(zn.UPC_EAN_EXTENSION,z.getText()),D.putAllMetadata(z.getResultMetadata()),D.addResultPoints(z.getResultPoints()),F=z.getText().length}catch{}var W=i==null?null:i.get(Hr.ALLOWED_EAN_EXTENSIONS);if(W!=null){var U=!1;for(var G in W)if(F.toString()===G){U=!0;break}if(!U)throw new ze}return b===It.EAN_13||b===It.UPC_A,D},t.checkChecksum=function(e){return t.checkStandardUPCEANChecksum(e)},t.checkStandardUPCEANChecksum=function(e){var n=e.length;if(n===0)return!1;var i=parseInt(e.charAt(n-1),10);return t.getStandardUPCEANChecksum(e.substring(0,n-1))===i},t.getStandardUPCEANChecksum=function(e){for(var n=e.length,i=0,a=n-1;a>=0;a-=2){var o=e.charAt(a).charCodeAt(0)-"0".charCodeAt(0);if(o<0||o>9)throw new ct;i+=o}i*=3;for(var a=n-2;a>=0;a-=2){var o=e.charAt(a).charCodeAt(0)-"0".charCodeAt(0);if(o<0||o>9)throw new ct;i+=o}return(1e3-i)%10},t.decodeEnd=function(e,n){return t.findGuardPattern(e,n,!1,t.START_END_PATTERN,new Int32Array(t.START_END_PATTERN.length).fill(0))},t}(bu),Ck=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Xy=globalThis&&globalThis.__values||function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},j0=function(r){Ck(t,r);function t(){var e=r.call(this)||this;return e.decodeMiddleCounters=Int32Array.from([0,0,0,0]),e}return t.prototype.decodeMiddle=function(e,n,i){var a,o,s,u,c=this.decodeMiddleCounters;c[0]=0,c[1]=0,c[2]=0,c[3]=0;for(var l=e.getSize(),d=n[1],h=0,f=0;f<6&&d=10&&(h|=1<<5-f)}i=t.determineFirstDigit(i,h);var v=Cn.findGuardPattern(e,d,!0,Cn.MIDDLE_PATTERN,new Int32Array(Cn.MIDDLE_PATTERN.length).fill(0));d=v[1];for(var f=0;f<6&&d=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Zy=function(r){Ok(t,r);function t(){var e=r.call(this)||this;return e.decodeMiddleCounters=Int32Array.from([0,0,0,0]),e}return t.prototype.decodeMiddle=function(e,n,i){var a,o,s,u,c=this.decodeMiddleCounters;c[0]=0,c[1]=0,c[2]=0,c[3]=0;for(var l=e.getSize(),d=n[1],h=0;h<4&&d=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Jy=function(r){kk(t,r);function t(){var e=r.call(this)||this;return e.decodeMiddleCounters=new Int32Array(4),e}return t.prototype.decodeMiddle=function(e,n,i){var a,o,s=this.decodeMiddleCounters.map(function(p){return p});s[0]=0,s[1]=0,s[2]=0,s[3]=0;for(var u=e.getSize(),c=n[1],l=0,d=0;d<6&&c=10&&(l|=1<<5-d)}return t.determineNumSysAndCheckDigit(new er(i),l),c},t.prototype.decodeEnd=function(e,n){return t.findGuardPatternWithoutCounters(e,n,!0,t.MIDDLE_END_PATTERN)},t.prototype.checkChecksum=function(e){return Cn.checkChecksum(t.convertUPCEtoUPCA(e))},t.determineNumSysAndCheckDigit=function(e,n){for(var i=0;i<=1;i++)for(var a=0;a<10;a++)if(n===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[i][a]){e.insert(0,"0"+i),e.append("0"+a);return}throw ze.getNotFoundInstance()},t.prototype.getBarcodeFormat=function(){return It.UPC_E},t.convertUPCEtoUPCA=function(e){var n=e.slice(1,7).split("").map(function(o){return o.charCodeAt(0)}),i=new er;i.append(e.charAt(0));var a=n[5];switch(a){case 0:case 1:case 2:i.appendChars(n,0,2),i.append(a),i.append("0000"),i.appendChars(n,2,3);break;case 3:i.appendChars(n,0,3),i.append("00000"),i.appendChars(n,3,2);break;case 4:i.appendChars(n,0,4),i.append("00000"),i.append(n[4]);break;default:i.appendChars(n,0,5),i.append("0000"),i.append(a);break}return e.length>=8&&i.append(e.charAt(7)),i.toString()},t.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),t.NUMSYS_AND_CHECK_DIGIT_PATTERNS=[Int32Array.from([56,52,50,49,44,38,35,42,41,37]),Int32Array.from([7,11,13,14,19,25,28,21,22,1])],t}(Cn),Nk=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Qy=globalThis&&globalThis.__values||function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},W0=function(r){Nk(t,r);function t(e){var n=r.call(this)||this,i=e==null?null:e.get(Hr.POSSIBLE_FORMATS),a=[];return i!=null&&(i.indexOf(It.EAN_13)>-1&&a.push(new j0),i.indexOf(It.UPC_A)>-1&&a.push(new Yy),i.indexOf(It.EAN_8)>-1&&a.push(new Zy),i.indexOf(It.UPC_E)>-1&&a.push(new Jy)),a.length===0&&(a.push(new j0),a.push(new Yy),a.push(new Zy),a.push(new Jy)),n.readers=a,n}return t.prototype.decodeRow=function(e,n,i){var a,o;try{for(var s=Qy(this.readers),u=s.next();!u.done;u=s.next()){var c=u.value;try{var l=c.decodeRow(e,n,i),d=l.getBarcodeFormat()===It.EAN_13&&l.getText().charAt(0)==="0",h=i==null?null:i.get(Hr.POSSIBLE_FORMATS),f=h==null||h.includes(It.UPC_A);if(d&&f){var g=l.getRawBytes(),m=new Yn(l.getText().substring(1),g,g?g.length:null,l.getResultPoints(),It.UPC_A);return m.putAllMetadata(l.getResultMetadata()),m}return l}catch{}}}catch(p){a={error:p}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(a)throw a.error}}throw new ze},t.prototype.reset=function(){var e,n;try{for(var i=Qy(this.readers),a=i.next();!a.done;a=i.next()){var o=a.value;o.reset()}}catch(s){e={error:s}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}},t}(Dn),Fk=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Mk=function(r){Fk(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.CODA_BAR_CHAR_SET={nnnnnww:"0",nnnnwwn:"1",nnnwnnw:"2",wwnnnnn:"3",nnwnnwn:"4",wnnnnwn:"5",nwnnnnw:"6",nwnnwnn:"7",nwwnnnn:"8",wnnwnnn:"9",nnnwwnn:"-",nnwwnnn:"$",wnnnwnw:":",wnwnnnw:"/",wnwnwnn:".",nnwwwww:"+",nnwwnwn:"A",nwnwnnw:"B",nnnwnww:"C",nnnwwwn:"D"},e}return t.prototype.decodeRow=function(e,n,i){var a=this.getValidRowData(n);if(!a)throw new ze;var o=this.codaBarDecodeRow(a.row);if(!o)throw new ze;return new Yn(o,null,0,[new yt(a.left,e),new yt(a.right,e)],It.CODABAR,new Date().getTime())},t.prototype.getValidRowData=function(e){var n=e.toArray(),i=n.indexOf(!0);if(i===-1)return null;var a=n.lastIndexOf(!0);if(a<=i)return null;n=n.slice(i,a+1);for(var o=[],s=n[0],u=1,c=1;c0;){var a=e.splice(0,8).splice(0,7),o=a.map(function(u){return u=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Cs=function(r){Uk(t,r);function t(){var e=r.call(this)||this;return e.decodeFinderCounters=new Int32Array(4),e.dataCharacterCounters=new Int32Array(8),e.oddRoundingErrors=new Array(4),e.evenRoundingErrors=new Array(4),e.oddCounts=new Array(e.dataCharacterCounters.length/2),e.evenCounts=new Array(e.dataCharacterCounters.length/2),e}return t.prototype.getDecodeFinderCounters=function(){return this.decodeFinderCounters},t.prototype.getDataCharacterCounters=function(){return this.dataCharacterCounters},t.prototype.getOddRoundingErrors=function(){return this.oddRoundingErrors},t.prototype.getEvenRoundingErrors=function(){return this.evenRoundingErrors},t.prototype.getOddCounts=function(){return this.oddCounts},t.prototype.getEvenCounts=function(){return this.evenCounts},t.prototype.parseFinderValue=function(e,n){for(var i=0;ia&&(a=n[o],i=o);e[i]++},t.decrement=function(e,n){for(var i=0,a=n[0],o=1;o=t.MIN_FINDER_PATTERN_RATIO&&s<=t.MAX_FINDER_PATTERN_RATIO){var u=Number.MAX_SAFE_INTEGER,c=Number.MIN_SAFE_INTEGER;try{for(var l=Bk(e),d=l.next();!d.done;d=l.next()){var h=d.value;h>c&&(c=h),h=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},wu=function(){function r(){}return r.getRSSvalue=function(t,e,n){var i,a,o=0;try{for(var s=Pk(t),u=s.next();!u.done;u=s.next()){var c=u.value;o+=c}}catch(v){i={error:v}}finally{try{u&&!u.done&&(a=s.return)&&a.call(s)}finally{if(i)throw i.error}}for(var l=0,d=0,h=t.length,f=0;f=h-f-1&&(m-=r.combins(o-g-(h-f),h-f-2)),h-f-1>1){for(var p=0,y=o-g-(h-f-2);y>e;y--)p+=r.combins(o-g-y-1,h-f-3);m-=p*(h-1-f)}else o-g>e&&m--;l+=m}o-=g}return l},r.combins=function(t,e){var n,i;t-e>e?(i=e,n=t-e):(i=t-e,n=e);for(var a=1,o=1,s=t;s>n;s--)a*=s,o<=i&&(a/=o,o++);for(;o<=i;)a/=o,o++;return a},r}(),Lk=function(){function r(){}return r.buildBitArray=function(t){var e=t.length*2-1;t[t.length-1].getRightChar()==null&&(e-=1);for(var n=12*e,i=new Ti(n),a=0,o=t[0],s=o.getRightChar().getValue(),u=11;u>=0;--u)(s&1<=0;--d)(l&1<=0;--d)(h&1<10||i<0||i>10)throw new ct;return a.firstDigit=n,a.secondDigit=i,a}return t.prototype.getFirstDigit=function(){return this.firstDigit},t.prototype.getSecondDigit=function(){return this.secondDigit},t.prototype.getValue=function(){return this.firstDigit*10+this.secondDigit},t.prototype.isFirstDigitFNC1=function(){return this.firstDigit===t.FNC1},t.prototype.isSecondDigitFNC1=function(){return this.secondDigit===t.FNC1},t.prototype.isAnyFNC1=function(){return this.firstDigit===t.FNC1||this.secondDigit===t.FNC1},t.FNC1=10,t}(z0),bh=globalThis&&globalThis.__values||function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Hk=function(){function r(){}return r.parseFieldsInGeneralPurpose=function(t){var e,n,i,a,o,s,u,c;if(!t)return null;if(t.length<2)throw new ze;var l=t.substring(0,2);try{for(var d=bh(r.TWO_DIGIT_DATA_LENGTH),h=d.next();!h.done;h=d.next()){var f=h.value;if(f[0]===l)return f[1]===r.VARIABLE_LENGTH?r.processVariableAI(2,f[2],t):r.processFixedAI(2,f[1],t)}}catch(F){e={error:F}}finally{try{h&&!h.done&&(n=d.return)&&n.call(d)}finally{if(e)throw e.error}}if(t.length<3)throw new ze;var g=t.substring(0,3);try{for(var m=bh(r.THREE_DIGIT_DATA_LENGTH),p=m.next();!p.done;p=m.next()){var f=p.value;if(f[0]===g)return f[1]===r.VARIABLE_LENGTH?r.processVariableAI(3,f[2],t):r.processFixedAI(3,f[1],t)}}catch(F){i={error:F}}finally{try{p&&!p.done&&(a=m.return)&&a.call(m)}finally{if(i)throw i.error}}try{for(var y=bh(r.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH),v=y.next();!v.done;v=y.next()){var f=v.value;if(f[0]===g)return f[1]===r.VARIABLE_LENGTH?r.processVariableAI(4,f[2],t):r.processFixedAI(4,f[1],t)}}catch(F){o={error:F}}finally{try{v&&!v.done&&(s=y.return)&&s.call(y)}finally{if(o)throw o.error}}if(t.length<4)throw new ze;var b=t.substring(0,4);try{for(var E=bh(r.FOUR_DIGIT_DATA_LENGTH),D=E.next();!D.done;D=E.next()){var f=D.value;if(f[0]===b)return f[1]===r.VARIABLE_LENGTH?r.processVariableAI(4,f[2],t):r.processFixedAI(4,f[1],t)}}catch(F){u={error:F}}finally{try{D&&!D.done&&(c=E.return)&&c.call(E)}finally{if(u)throw u.error}}throw new ze},r.processFixedAI=function(t,e,n){if(n.lengththis.information.getSize())return t+4<=this.information.getSize();for(var e=t;ethis.information.getSize()){var e=this.extractNumericValueFromBitArray(t,4);return e===0?new _u(this.information.getSize(),_u.FNC1,_u.FNC1):new _u(this.information.getSize(),e-1,_u.FNC1)}var n=this.extractNumericValueFromBitArray(t,7),i=(n-8)/11,a=(n-8)%11;return new _u(t+7,i,a)},r.prototype.extractNumericValueFromBitArray=function(t,e){return r.extractNumericValueFromBitArray(this.information,t,e)},r.extractNumericValueFromBitArray=function(t,e,n){for(var i=0,a=0;athis.information.getSize())return!1;var e=this.extractNumericValueFromBitArray(t,5);if(e>=5&&e<16)return!0;if(t+7>this.information.getSize())return!1;var n=this.extractNumericValueFromBitArray(t,7);if(n>=64&&n<116)return!0;if(t+8>this.information.getSize())return!1;var i=this.extractNumericValueFromBitArray(t,8);return i>=232&&i<253},r.prototype.decodeIsoIec646=function(t){var e=this.extractNumericValueFromBitArray(t,5);if(e===15)return new va(t+5,va.FNC1);if(e>=5&&e<15)return new va(t+5,"0"+(e-5));var n=this.extractNumericValueFromBitArray(t,7);if(n>=64&&n<90)return new va(t+7,""+(n+1));if(n>=90&&n<116)return new va(t+7,""+(n+7));var i=this.extractNumericValueFromBitArray(t,8),a;switch(i){case 232:a="!";break;case 233:a='"';break;case 234:a="%";break;case 235:a="&";break;case 236:a="'";break;case 237:a="(";break;case 238:a=")";break;case 239:a="*";break;case 240:a="+";break;case 241:a=",";break;case 242:a="-";break;case 243:a=".";break;case 244:a="/";break;case 245:a=":";break;case 246:a=";";break;case 247:a="<";break;case 248:a="=";break;case 249:a=">";break;case 250:a="?";break;case 251:a="_";break;case 252:a=" ";break;default:throw new ct}return new va(t+8,a)},r.prototype.isStillAlpha=function(t){if(t+5>this.information.getSize())return!1;var e=this.extractNumericValueFromBitArray(t,5);if(e>=5&&e<16)return!0;if(t+6>this.information.getSize())return!1;var n=this.extractNumericValueFromBitArray(t,6);return n>=16&&n<63},r.prototype.decodeAlphanumeric=function(t){var e=this.extractNumericValueFromBitArray(t,5);if(e===15)return new va(t+5,va.FNC1);if(e>=5&&e<15)return new va(t+5,"0"+(e-5));var n=this.extractNumericValueFromBitArray(t,6);if(n>=32&&n<58)return new va(t+6,""+(n+33));var i;switch(n){case 58:i="*";break;case 59:i=",";break;case 60:i="-";break;case 61:i=".";break;case 62:i="/";break;default:throw new yu("Decoding invalid alphanumeric value: "+n)}return new va(t+6,i)},r.prototype.isAlphaTo646ToAlphaLatch=function(t){if(t+1>this.information.getSize())return!1;for(var e=0;e<5&&e+tthis.information.getSize())return!1;for(var e=t;ethis.information.getSize())return!1;for(var e=0;e<4&&e+t=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},cR=function(r){uR(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.pairs=new Array(t.MAX_PAIRS),e.rows=new Array,e.startEnd=[2],e}return t.prototype.decodeRow=function(e,n,i){this.pairs.length=0,this.startFromEven=!1;try{return t.constructResult(this.decodeRow2pairs(e,n))}catch{}return this.pairs.length=0,this.startFromEven=!0,t.constructResult(this.decodeRow2pairs(e,n))},t.prototype.reset=function(){this.pairs.length=0,this.rows.length=0},t.prototype.decodeRow2pairs=function(e,n){for(var i=!1;!i;)try{this.pairs.push(this.retrieveNextPair(n,this.pairs,e))}catch(s){if(s instanceof ze){if(!this.pairs.length)throw new ze;i=!0}}if(this.checkChecksum())return this.pairs;var a;if(this.rows.length?a=!0:a=!1,this.storeRow(e,!1),a){var o=this.checkRowsBoolean(!1);if(o!=null||(o=this.checkRowsBoolean(!0),o!=null))return o}throw new ze},t.prototype.checkRowsBoolean=function(e){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,e&&(this.rows=this.rows.reverse());var n=null;try{n=this.checkRows(new Array,0)}catch(i){console.log(i)}return e&&(this.rows=this.rows.reverse()),n},t.prototype.checkRows=function(e,n){for(var i,a,o=n;os.length)){for(var u=!0,c=0;ce){o=s.isEquivalent(this.pairs);break}a=s.isEquivalent(this.pairs),i++}o||a||t.isPartialRow(this.pairs,this.rows)||(this.rows.push(i,new sR(this.pairs,e,n)),this.removePartialRows(this.pairs,this.rows))},t.prototype.removePartialRows=function(e,n){var i,a,o,s,u,c;try{for(var l=Zo(n),d=l.next();!d.done;d=l.next()){var h=d.value;if(h.getPairs().length!==e.length){var f=!0;try{for(var g=(o=void 0,Zo(h.getPairs())),m=g.next();!m.done;m=g.next()){var p=m.value,y=!1;try{for(var v=(u=void 0,Zo(e)),b=v.next();!b.done;b=v.next()){var E=b.value;if(nb.equals(p,E)){y=!0;break}}}catch(D){u={error:D}}finally{try{b&&!b.done&&(c=v.return)&&c.call(v)}finally{if(u)throw u.error}}y||(f=!1)}}catch(D){o={error:D}}finally{try{m&&!m.done&&(s=g.return)&&s.call(g)}finally{if(o)throw o.error}}}}}catch(D){i={error:D}}finally{try{d&&!d.done&&(a=l.return)&&a.call(l)}finally{if(i)throw i.error}}},t.isPartialRow=function(e,n){var i,a,o,s,u,c;try{for(var l=Zo(n),d=l.next();!d.done;d=l.next()){var h=d.value,f=!0;try{for(var g=(o=void 0,Zo(e)),m=g.next();!m.done;m=g.next()){var p=m.value,y=!1;try{for(var v=(u=void 0,Zo(h.getPairs())),b=v.next();!b.done;b=v.next()){var E=b.value;if(p.equals(E)){y=!0;break}}}catch(D){u={error:D}}finally{try{b&&!b.done&&(c=v.return)&&c.call(v)}finally{if(u)throw u.error}}if(!y){f=!1;break}}}catch(D){o={error:D}}finally{try{m&&!m.done&&(s=g.return)&&s.call(g)}finally{if(o)throw o.error}}if(f)return!0}}catch(D){i={error:D}}finally{try{d&&!d.done&&(a=l.return)&&a.call(l)}finally{if(i)throw i.error}}return!1},t.prototype.getRows=function(){return this.rows},t.constructResult=function(e){var n=Lk.buildBitArray(e),i=oR(n),a=i.parseInformation(),o=e[0].getFinderPattern().getResultPoints(),s=e[e.length-1].getFinderPattern().getResultPoints(),u=[o[0],o[1],s[0],s[1]];return new Yn(a,null,null,u,It.RSS_EXPANDED,null)},t.prototype.checkChecksum=function(){var e=this.pairs.get(0),n=e.getLeftChar(),i=e.getRightChar();if(i===null)return!1;for(var a=i.getChecksumPortion(),o=2,s=1;s=0)s=i;else if(this.isEmptyPair(n))s=0;else{var u=n[n.length-1];s=u.getFinderPattern().getStartEnd()[1]}var c=n.length%2!=0;this.startFromEven&&(c=!c);for(var l=!1;s=0&&!e.get(u);)u--;u++,a=this.startEnd[0]-u,o=u,s=this.startEnd[1]}else o=this.startEnd[0],s=e.getNextUnset(this.startEnd[1]+1),a=s-this.startEnd[1];var c=this.getDecodeFinderCounters();zr.arraycopy(c,0,c,1,c.length-1),c[0]=a;var l;try{l=this.parseFinderValue(c,t.FINDER_PATTERNS)}catch{return null}return new eb(l,[o,s],o,s,n)},t.prototype.decodeDataCharacter=function(e,n,i,a){for(var o=this.getDataCharacterCounters(),s=0;s.3)throw new ze;for(var g=this.getOddCounts(),m=this.getEvenCounts(),p=this.getOddRoundingErrors(),y=this.getEvenRoundingErrors(),u=0;u8){if(v>8.7)throw new ze;b=8}var E=u/2;(u&1)==0?(g[E]=b,p[E]=v-b):(m[E]=b,y[E]=v-b)}this.adjustOddEvenCounts(d);for(var D=4*n.getValue()+(i?0:2)+(a?0:1)-1,F=0,z=0,u=g.length-1;u>=0;u--){if(t.isNotA1left(n,i,a)){var W=t.WEIGHTS[D][2*u];z+=g[u]*W}F+=g[u]}for(var U=0,u=m.length-1;u>=0;u--)if(t.isNotA1left(n,i,a)){var W=t.WEIGHTS[D][2*u+1];U+=m[u]*W}var G=z+U;if((F&1)!=0||F>13||F<4)throw new ze;var ee=(13-F)/2,P=t.SYMBOL_WIDEST[ee],I=9-P,S=wu.getRSSvalue(g,P,!0),C=wu.getRSSvalue(m,I,!1),_=t.EVEN_TOTAL_SUBSET[ee],w=t.GSUM[ee],x=S*_+C+w;return new yh(x,G)},t.isNotA1left=function(e,n,i){return!(e.getValue()===0&&n&&i)},t.prototype.adjustOddEvenCounts=function(e){var n=yr.sum(new Int32Array(this.getOddCounts())),i=yr.sum(new Int32Array(this.getEvenCounts())),a=!1,o=!1;n>13?o=!0:n<4&&(a=!0);var s=!1,u=!1;i>13?u=!0:i<4&&(s=!0);var c=n+i-e,l=(n&1)==1,d=(i&1)==0;if(c===1)if(l){if(d)throw new ze;o=!0}else{if(!d)throw new ze;u=!0}else if(c===-1)if(l){if(d)throw new ze;a=!0}else{if(!d)throw new ze;s=!0}else if(c===0){if(l){if(!d)throw new ze;n=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ib=function(r){hR(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.possibleLeftPairs=[],e.possibleRightPairs=[],e}return t.prototype.decodeRow=function(e,n,i){var a,o,s,u,c=this.decodePair(n,!1,e,i);t.addOrTally(this.possibleLeftPairs,c),n.reverse();var l=this.decodePair(n,!0,e,i);t.addOrTally(this.possibleRightPairs,l),n.reverse();try{for(var d=H0(this.possibleLeftPairs),h=d.next();!h.done;h=d.next()){var f=h.value;if(f.getCount()>1)try{for(var g=(s=void 0,H0(this.possibleRightPairs)),m=g.next();!m.done;m=g.next()){var p=m.value;if(p.getCount()>1&&t.checkChecksum(f,p))return t.constructResult(f,p)}}catch(y){s={error:y}}finally{try{m&&!m.done&&(u=g.return)&&u.call(g)}finally{if(s)throw s.error}}}}catch(y){a={error:y}}finally{try{h&&!h.done&&(o=d.return)&&o.call(d)}finally{if(a)throw a.error}}throw new ze},t.addOrTally=function(e,n){var i,a;if(n!=null){var o=!1;try{for(var s=H0(e),u=s.next();!u.done;u=s.next()){var c=u.value;if(c.getValue()===n.getValue()){c.incrementCount(),o=!0;break}}}catch(l){i={error:l}}finally{try{u&&!u.done&&(a=s.return)&&a.call(s)}finally{if(i)throw i.error}}o||e.push(n)}},t.prototype.reset=function(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0},t.constructResult=function(e,n){for(var i=4537077*e.getValue()+n.getValue(),a=new String(i).toString(),o=new er,s=13-a.length;s>0;s--)o.append("0");o.append(a);for(var u=0,s=0;s<13;s++){var c=o.charAt(s).charCodeAt(0)-"0".charCodeAt(0);u+=(s&1)==0?3*c:c}u=10-u%10,u===10&&(u=0),o.append(u.toString());var l=e.getFinderPattern().getResultPoints(),d=n.getFinderPattern().getResultPoints();return new Yn(o.toString(),null,0,[l[0],l[1],d[0],d[1]],It.RSS_14,new Date().getTime())},t.checkChecksum=function(e,n){var i=(e.getChecksumPortion()+16*n.getChecksumPortion())%79,a=9*e.getFinderPattern().getValue()+n.getFinderPattern().getValue();return a>72&&a--,a>8&&a--,i===a},t.prototype.decodePair=function(e,n,i,a){try{var o=this.findFinderPattern(e,n),s=this.parseFoundFinderPattern(e,i,n,o),u=a==null?null:a.get(Hr.NEED_RESULT_POINT_CALLBACK);if(u!=null){var c=(o[0]+o[1])/2;n&&(c=e.getSize()-1-c),u.foundPossibleResultPoint(new yt(c,i))}var l=this.decodeDataCharacter(e,s,!0),d=this.decodeDataCharacter(e,s,!1);return new fR(1597*l.getValue()+d.getValue(),l.getChecksumPortion()+4*d.getChecksumPortion(),s)}catch{return null}},t.prototype.decodeDataCharacter=function(e,n,i){for(var a=this.getDataCharacterCounters(),o=0;o8&&(y=8);var v=Math.floor(s/2);(s&1)==0?(h[v]=y,g[v]=p-y):(f[v]=y,m[v]=p-y)}this.adjustOddEvenCounts(i,l);for(var b=0,E=0,s=h.length-1;s>=0;s--)E*=9,E+=h[s],b+=h[s];for(var D=0,F=0,s=f.length-1;s>=0;s--)D*=9,D+=f[s],F+=f[s];var z=E+3*D;if(i){if((b&1)!=0||b>12||b<4)throw new ze;var W=(12-b)/2,U=t.OUTSIDE_ODD_WIDEST[W],G=9-U,ee=wu.getRSSvalue(h,U,!1),P=wu.getRSSvalue(f,G,!0),I=t.OUTSIDE_EVEN_TOTAL_SUBSET[W],S=t.OUTSIDE_GSUM[W];return new yh(ee*I+P+S,z)}else{if((F&1)!=0||F>10||F<4)throw new ze;var W=(10-F)/2,U=t.INSIDE_ODD_WIDEST[W],G=9-U,ee=wu.getRSSvalue(h,U,!0),P=wu.getRSSvalue(f,G,!1),C=t.INSIDE_ODD_TOTAL_SUBSET[W],S=t.INSIDE_GSUM[W];return new yh(P*C+ee+S,z)}},t.prototype.findFinderPattern=function(e,n){var i=this.getDecodeFinderCounters();i[0]=0,i[1]=0,i[2]=0,i[3]=0;for(var a=e.getSize(),o=!1,s=0;s=0&&o!==e.get(s);)s--;s++;var u=a[0]-s,c=this.getDecodeFinderCounters(),l=new Int32Array(c.length);zr.arraycopy(c,0,l,1,c.length-1),l[0]=u;var d=this.parseFinderValue(l,t.FINDER_PATTERNS),h=s,f=a[1];return i&&(h=e.getSize()-1-h,f=e.getSize()-1-f),new eb(d,[s,a[1]],h,f,n)},t.prototype.adjustOddEvenCounts=function(e,n){var i=yr.sum(new Int32Array(this.getOddCounts())),a=yr.sum(new Int32Array(this.getEvenCounts())),o=!1,s=!1,u=!1,c=!1;e?(i>12?s=!0:i<4&&(o=!0),a>12?c=!0:a<4&&(u=!0)):(i>11?s=!0:i<5&&(o=!0),a>10?c=!0:a<4&&(u=!0));var l=i+a-n,d=(i&1)==(e?1:0),h=(a&1)==1;if(l===1)if(d){if(h)throw new ze;s=!0}else{if(!h)throw new ze;c=!0}else if(l===-1)if(d){if(h)throw new ze;o=!0}else{if(!h)throw new ze;u=!0}else if(l===0){if(d){if(!h)throw new ze;i=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Tr=function(){function r(t,e,n){this.ecCodewords=t,this.ecBlocks=[e],n&&this.ecBlocks.push(n)}return r.prototype.getECCodewords=function(){return this.ecCodewords},r.prototype.getECBlocks=function(){return this.ecBlocks},r}(),wr=function(){function r(t,e){this.count=t,this.dataCodewords=e}return r.prototype.getCount=function(){return this.count},r.prototype.getDataCodewords=function(){return this.dataCodewords},r}(),mR=function(){function r(t,e,n,i,a,o){var s,u;this.versionNumber=t,this.symbolSizeRows=e,this.symbolSizeColumns=n,this.dataRegionSizeRows=i,this.dataRegionSizeColumns=a,this.ecBlocks=o;var c=0,l=o.getECCodewords(),d=o.getECBlocks();try{for(var h=ab(d),f=h.next();!f.done;f=h.next()){var g=f.value;c+=g.getCount()*(g.getDataCodewords()+l)}}catch(m){s={error:m}}finally{try{f&&!f.done&&(u=h.return)&&u.call(h)}finally{if(s)throw s.error}}this.totalCodewords=c}return r.prototype.getVersionNumber=function(){return this.versionNumber},r.prototype.getSymbolSizeRows=function(){return this.symbolSizeRows},r.prototype.getSymbolSizeColumns=function(){return this.symbolSizeColumns},r.prototype.getDataRegionSizeRows=function(){return this.dataRegionSizeRows},r.prototype.getDataRegionSizeColumns=function(){return this.dataRegionSizeColumns},r.prototype.getTotalCodewords=function(){return this.totalCodewords},r.prototype.getECBlocks=function(){return this.ecBlocks},r.getVersionForDimensions=function(t,e){var n,i;if((t&1)!=0||(e&1)!=0)throw new ct;try{for(var a=ab(r.VERSIONS),o=a.next();!o.done;o=a.next()){var s=o.value;if(s.symbolSizeRows===t&&s.symbolSizeColumns===e)return s}}catch(u){n={error:u}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}throw new ct},r.prototype.toString=function(){return""+this.versionNumber},r.buildVersions=function(){return[new r(1,10,10,8,8,new Tr(5,new wr(1,3))),new r(2,12,12,10,10,new Tr(7,new wr(1,5))),new r(3,14,14,12,12,new Tr(10,new wr(1,8))),new r(4,16,16,14,14,new Tr(12,new wr(1,12))),new r(5,18,18,16,16,new Tr(14,new wr(1,18))),new r(6,20,20,18,18,new Tr(18,new wr(1,22))),new r(7,22,22,20,20,new Tr(20,new wr(1,30))),new r(8,24,24,22,22,new Tr(24,new wr(1,36))),new r(9,26,26,24,24,new Tr(28,new wr(1,44))),new r(10,32,32,14,14,new Tr(36,new wr(1,62))),new r(11,36,36,16,16,new Tr(42,new wr(1,86))),new r(12,40,40,18,18,new Tr(48,new wr(1,114))),new r(13,44,44,20,20,new Tr(56,new wr(1,144))),new r(14,48,48,22,22,new Tr(68,new wr(1,174))),new r(15,52,52,24,24,new Tr(42,new wr(2,102))),new r(16,64,64,14,14,new Tr(56,new wr(2,140))),new r(17,72,72,16,16,new Tr(36,new wr(4,92))),new r(18,80,80,18,18,new Tr(48,new wr(4,114))),new r(19,88,88,20,20,new Tr(56,new wr(4,144))),new r(20,96,96,22,22,new Tr(68,new wr(4,174))),new r(21,104,104,24,24,new Tr(56,new wr(6,136))),new r(22,120,120,18,18,new Tr(68,new wr(6,175))),new r(23,132,132,20,20,new Tr(62,new wr(8,163))),new r(24,144,144,22,22,new Tr(62,new wr(8,156),new wr(2,155))),new r(25,8,18,6,16,new Tr(7,new wr(1,5))),new r(26,8,32,6,14,new Tr(11,new wr(1,10))),new r(27,12,26,10,24,new Tr(14,new wr(1,16))),new r(28,12,36,10,16,new Tr(18,new wr(1,22))),new r(29,16,36,14,16,new Tr(24,new wr(1,32))),new r(30,16,48,14,22,new Tr(28,new wr(1,49)))]},r.VERSIONS=r.buildVersions(),r}(),gR=function(){function r(t){var e=t.getHeight();if(e<8||e>144||(e&1)!=0)throw new ct;this.version=r.readVersion(t),this.mappingBitMatrix=this.extractDataRegion(t),this.readMappingMatrix=new po(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}return r.prototype.getVersion=function(){return this.version},r.readVersion=function(t){var e=t.getHeight(),n=t.getWidth();return mR.getVersionForDimensions(e,n)},r.prototype.readCodewords=function(){var t=new Int8Array(this.version.getTotalCodewords()),e=0,n=4,i=0,a=this.mappingBitMatrix.getHeight(),o=this.mappingBitMatrix.getWidth(),s=!1,u=!1,c=!1,l=!1;do if(n===a&&i===0&&!s)t[e++]=this.readCorner1(a,o)&255,n-=2,i+=2,s=!0;else if(n===a-2&&i===0&&(o&3)!=0&&!u)t[e++]=this.readCorner2(a,o)&255,n-=2,i+=2,u=!0;else if(n===a+4&&i===2&&(o&7)==0&&!c)t[e++]=this.readCorner3(a,o)&255,n-=2,i+=2,c=!0;else if(n===a-2&&i===0&&(o&7)==4&&!l)t[e++]=this.readCorner4(a,o)&255,n-=2,i+=2,l=!0;else{do n=0&&!this.readMappingMatrix.get(i,n)&&(t[e++]=this.readUtah(n,i,a,o)&255),n-=2,i+=2;while(n>=0&&i=0&&i=0);n+=3,i+=1}while(n=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},vR=function(){function r(t,e){this.numDataCodewords=t,this.codewords=e}return r.getDataBlocks=function(t,e){var n,i,a,o,s=e.getECBlocks(),u=0,c=s.getECBlocks();try{for(var l=ob(c),d=l.next();!d.done;d=l.next()){var h=d.value;u+=h.getCount()}}catch(S){n={error:S}}finally{try{d&&!d.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}var f=new Array(u),g=0;try{for(var m=ob(c),p=m.next();!p.done;p=m.next())for(var h=p.value,y=0;y7?y-1:y;f[P].codewords[I]=t[z++]}if(z!==t.length)throw new Bt;return f},r.prototype.getNumDataCodewords=function(){return this.numDataCodewords},r.prototype.getCodewords=function(){return this.codewords},r}(),sb=function(){function r(t){this.bytes=t,this.byteOffset=0,this.bitOffset=0}return r.prototype.getBitOffset=function(){return this.bitOffset},r.prototype.getByteOffset=function(){return this.byteOffset},r.prototype.readBits=function(t){if(t<1||t>32||t>this.available())throw new Bt(""+t);var e=0,n=this.bitOffset,i=this.byteOffset,a=this.bytes;if(n>0){var o=8-n,s=t>8-s<>u,t-=s,n+=s,n===8&&(n=0,i++)}if(t>0){for(;t>=8;)e=e<<8|a[i]&255,i++,t-=8;if(t>0){var u=8-t,c=255>>u<>u,n+=t}}return this.bitOffset=n,this.byteOffset=i,e},r.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},r}(),On;(function(r){r[r.PAD_ENCODE=0]="PAD_ENCODE",r[r.ASCII_ENCODE=1]="ASCII_ENCODE",r[r.C40_ENCODE=2]="C40_ENCODE",r[r.TEXT_ENCODE=3]="TEXT_ENCODE",r[r.ANSIX12_ENCODE=4]="ANSIX12_ENCODE",r[r.EDIFACT_ENCODE=5]="EDIFACT_ENCODE",r[r.BASE256_ENCODE=6]="BASE256_ENCODE"})(On||(On={}));var yR=function(){function r(){}return r.decode=function(t){var e=new sb(t),n=new er,i=new er,a=new Array,o=On.ASCII_ENCODE;do if(o===On.ASCII_ENCODE)o=this.decodeAsciiSegment(e,n,i);else{switch(o){case On.C40_ENCODE:this.decodeC40Segment(e,n);break;case On.TEXT_ENCODE:this.decodeTextSegment(e,n);break;case On.ANSIX12_ENCODE:this.decodeAnsiX12Segment(e,n);break;case On.EDIFACT_ENCODE:this.decodeEdifactSegment(e,n);break;case On.BASE256_ENCODE:this.decodeBase256Segment(e,n,a);break;default:throw new ct}o=On.ASCII_ENCODE}while(o!==On.PAD_ENCODE&&e.available()>0);return i.length()>0&&n.append(i.toString()),new ph(t,n.toString(),a.length===0?null:a,null)},r.decodeAsciiSegment=function(t,e,n){var i=!1;do{var a=t.readBits(8);if(a===0)throw new ct;if(a<=128)return i&&(a+=128),e.append(String.fromCharCode(a-1)),On.ASCII_ENCODE;if(a===129)return On.PAD_ENCODE;if(a<=229){var o=a-130;o<10&&e.append("0"),e.append(""+o)}else switch(a){case 230:return On.C40_ENCODE;case 231:return On.BASE256_ENCODE;case 232:e.append(String.fromCharCode(29));break;case 233:case 234:break;case 235:i=!0;break;case 236:e.append("[)>05"),n.insert(0,"");break;case 237:e.append("[)>06"),n.insert(0,"");break;case 238:return On.ANSIX12_ENCODE;case 239:return On.TEXT_ENCODE;case 240:return On.EDIFACT_ENCODE;case 241:break;default:if(a!==254||t.available()!==0)throw new ct;break}}while(t.available()>0);return On.ASCII_ENCODE},r.decodeC40Segment=function(t,e){var n=!1,i=[],a=0;do{if(t.available()===8)return;var o=t.readBits(8);if(o===254)return;this.parseTwoBytes(o,t.readBits(8),i);for(var s=0;s<3;s++){var u=i[s];switch(a){case 0:if(u<3)a=u+1;else if(u0)},r.decodeTextSegment=function(t,e){var n=!1,i=[],a=0;do{if(t.available()===8)return;var o=t.readBits(8);if(o===254)return;this.parseTwoBytes(o,t.readBits(8),i);for(var s=0;s<3;s++){var u=i[s];switch(a){case 0:if(u<3)a=u+1;else if(u0)},r.decodeAnsiX12Segment=function(t,e){var n=[];do{if(t.available()===8)return;var i=t.readBits(8);if(i===254)return;this.parseTwoBytes(i,t.readBits(8),n);for(var a=0;a<3;a++){var o=n[a];switch(o){case 0:e.append("\r");break;case 1:e.append("*");break;case 2:e.append(">");break;case 3:e.append(" ");break;default:if(o<14)e.append(String.fromCharCode(o+44));else if(o<40)e.append(String.fromCharCode(o+51));else throw new ct;break}}}while(t.available()>0)},r.parseTwoBytes=function(t,e,n){var i=(t<<8)+e-1,a=Math.floor(i/1600);n[0]=a,i-=a*1600,a=Math.floor(i/40),n[1]=a,n[2]=i-a*40},r.decodeEdifactSegment=function(t,e){do{if(t.available()<=16)return;for(var n=0;n<4;n++){var i=t.readBits(6);if(i===31){var a=8-t.getBitOffset();a!==8&&t.readBits(a);return}(i&32)==0&&(i|=64),e.append(String.fromCharCode(i))}}while(t.available()>0)},r.decodeBase256Segment=function(t,e,n){var i=1+t.getByteOffset(),a=this.unrandomize255State(t.readBits(8),i++),o;if(a===0?o=t.available()/8|0:a<250?o=a:o=250*(a-249)+this.unrandomize255State(t.readBits(8),i++),o<0)throw new ct;for(var s=new Uint8Array(o),u=0;u=0?i:i+256},r.C40_BASIC_SET_CHARS=["*","*","*"," ","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"],r.C40_SHIFT2_SET_CHARS=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],r.TEXT_BASIC_SET_CHARS=["*","*","*"," ","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"],r.TEXT_SHIFT2_SET_CHARS=r.C40_SHIFT2_SET_CHARS,r.TEXT_SHIFT3_SET_CHARS=["`","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","{","|","}","~",String.fromCharCode(127)],r}(),bR=globalThis&&globalThis.__values||function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},wR=function(){function r(){this.rsDecoder=new gh(mo.DATA_MATRIX_FIELD_256)}return r.prototype.decode=function(t){var e,n,i=new gR(t),a=i.getVersion(),o=i.readCodewords(),s=vR.getDataBlocks(o,a),u=0;try{for(var c=bR(s),l=c.next();!l.done;l=c.next()){var d=l.value;u+=d.getNumDataCodewords()}}catch(b){e={error:b}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}for(var h=new Uint8Array(u),f=s.length,g=0;gs&&(l=s,d[0]=e,d[1]=n,d[2]=i,d[3]=a),l>u&&(l=u,d[0]=n,d[1]=i,d[2]=a,d[3]=e),l>c&&(d[0]=i,d[1]=a,d[2]=e,d[3]=n),d},r.prototype.detectSolid2=function(t){var e=t[0],n=t[1],i=t[2],a=t[3],o=this.transitionsBetween(e,a),s=r.shiftPoint(n,i,(o+1)*4),u=r.shiftPoint(i,n,(o+1)*4),c=this.transitionsBetween(s,e),l=this.transitionsBetween(u,a);return cf?l:d},r.prototype.shiftToModuleCenter=function(t){var e=t[0],n=t[1],i=t[2],a=t[3],o=this.transitionsBetween(e,a)+1,s=this.transitionsBetween(i,a)+1,u=r.shiftPoint(e,n,s*4),c=r.shiftPoint(i,n,o*4);o=this.transitionsBetween(u,a)+1,s=this.transitionsBetween(c,a)+1,(o&1)==1&&(o+=1),(s&1)==1&&(s+=1);var l=(e.getX()+n.getX()+i.getX()+a.getX())/4,d=(e.getY()+n.getY()+i.getY()+a.getY())/4;e=r.moveAway(e,l,d),n=r.moveAway(n,l,d),i=r.moveAway(i,l,d),a=r.moveAway(a,l,d);var h,f;return u=r.shiftPoint(e,n,s*4),u=r.shiftPoint(u,a,o*4),h=r.shiftPoint(n,e,s*4),h=r.shiftPoint(h,i,o*4),c=r.shiftPoint(i,a,s*4),c=r.shiftPoint(c,n,o*4),f=r.shiftPoint(a,i,s*4),f=r.shiftPoint(f,e,o*4),[u,h,c,f]},r.prototype.isValid=function(t){return t.getX()>=0&&t.getX()0&&t.getY()Math.abs(a-n);if(s){var u=n;n=i,i=u,u=a,a=o,o=u}for(var c=Math.abs(a-n),l=Math.abs(o-i),d=-c/2,h=i0){if(y===o)break;y+=h,d-=c}}return g},r}(),xh=function(){function r(){this.decoder=new wR}return r.prototype.decode=function(t,e){e===void 0&&(e=null);var n,i;if(e!=null&&e.has(Hr.PURE_BARCODE)){var a=r.extractPureBits(t.getBlackMatrix());n=this.decoder.decode(a),i=r.NO_POINTS}else{var o=new _R(t.getBlackMatrix()).detect();n=this.decoder.decode(o.getBits()),i=o.getPoints()}var s=n.getRawBytes(),u=new Yn(n.getText(),s,8*s.length,i,It.DATA_MATRIX,zr.currentTimeMillis()),c=n.getByteSegments();c!=null&&u.putMetadata(zn.BYTE_SEGMENTS,c);var l=n.getECLevel();return l!=null&&u.putMetadata(zn.ERROR_CORRECTION_LEVEL,l),u},r.prototype.reset=function(){},r.extractPureBits=function(t){var e=t.getTopLeftOnBit(),n=t.getBottomRightOnBit();if(e==null||n==null)throw new ze;var i=this.moduleSize(e,t),a=e[1],o=n[1],s=e[0],u=n[0],c=(u-s+1)/i,l=(o-a+1)/i;if(c<=0||l<=0)throw new ze;var d=i/2;a+=d,s+=d;for(var h=new po(c,l),f=0;f=r.FOR_BITS.size)throw new Bt;return r.FOR_BITS.get(t)},r.FOR_BITS=new Map,r.FOR_VALUE=new Map,r.L=new r(Eu.L,"L",1),r.M=new r(Eu.M,"M",0),r.Q=new r(Eu.Q,"Q",3),r.H=new r(Eu.H,"H",2),r}(),ER=globalThis&&globalThis.__values||function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ub=function(){function r(t){this.errorCorrectionLevel=$0.forBits(t>>3&3),this.dataMask=t&7}return r.numBitsDiffering=function(t,e){return ln.bitCount(t^e)},r.decodeFormatInformation=function(t,e){var n=r.doDecodeFormatInformation(t,e);return n!==null?n:r.doDecodeFormatInformation(t^r.FORMAT_INFO_MASK_QR,e^r.FORMAT_INFO_MASK_QR)},r.doDecodeFormatInformation=function(t,e){var n,i,a=Number.MAX_SAFE_INTEGER,o=0;try{for(var s=ER(r.FORMAT_INFO_DECODE_LOOKUP),u=s.next();!u.done;u=s.next()){var c=u.value,l=c[0];if(l===t||l===e)return new r(c[1]);var d=r.numBitsDiffering(t,l);d=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ne=function(){function r(t){for(var e=[],n=1;n=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ks=function(){function r(t,e){for(var n,i,a=[],o=2;o40)throw new Bt;return r.VERSIONS[t-1]},r.decodeVersionInformation=function(t){for(var e=Number.MAX_SAFE_INTEGER,n=0,i=0;i6&&(e.setRegion(t-11,0,3,6),e.setRegion(0,t-11,6,3)),e},r.prototype.toString=function(){return""+this.versionNumber},r.VERSION_DECODE_INFO=Int32Array.from([31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017]),r.VERSIONS=[new r(1,new Int32Array(0),new Ne(7,new ye(1,19)),new Ne(10,new ye(1,16)),new Ne(13,new ye(1,13)),new Ne(17,new ye(1,9))),new r(2,Int32Array.from([6,18]),new Ne(10,new ye(1,34)),new Ne(16,new ye(1,28)),new Ne(22,new ye(1,22)),new Ne(28,new ye(1,16))),new r(3,Int32Array.from([6,22]),new Ne(15,new ye(1,55)),new Ne(26,new ye(1,44)),new Ne(18,new ye(2,17)),new Ne(22,new ye(2,13))),new r(4,Int32Array.from([6,26]),new Ne(20,new ye(1,80)),new Ne(18,new ye(2,32)),new Ne(26,new ye(2,24)),new Ne(16,new ye(4,9))),new r(5,Int32Array.from([6,30]),new Ne(26,new ye(1,108)),new Ne(24,new ye(2,43)),new Ne(18,new ye(2,15),new ye(2,16)),new Ne(22,new ye(2,11),new ye(2,12))),new r(6,Int32Array.from([6,34]),new Ne(18,new ye(2,68)),new Ne(16,new ye(4,27)),new Ne(24,new ye(4,19)),new Ne(28,new ye(4,15))),new r(7,Int32Array.from([6,22,38]),new Ne(20,new ye(2,78)),new Ne(18,new ye(4,31)),new Ne(18,new ye(2,14),new ye(4,15)),new Ne(26,new ye(4,13),new ye(1,14))),new r(8,Int32Array.from([6,24,42]),new Ne(24,new ye(2,97)),new Ne(22,new ye(2,38),new ye(2,39)),new Ne(22,new ye(4,18),new ye(2,19)),new Ne(26,new ye(4,14),new ye(2,15))),new r(9,Int32Array.from([6,26,46]),new Ne(30,new ye(2,116)),new Ne(22,new ye(3,36),new ye(2,37)),new Ne(20,new ye(4,16),new ye(4,17)),new Ne(24,new ye(4,12),new ye(4,13))),new r(10,Int32Array.from([6,28,50]),new Ne(18,new ye(2,68),new ye(2,69)),new Ne(26,new ye(4,43),new ye(1,44)),new Ne(24,new ye(6,19),new ye(2,20)),new Ne(28,new ye(6,15),new ye(2,16))),new r(11,Int32Array.from([6,30,54]),new Ne(20,new ye(4,81)),new Ne(30,new ye(1,50),new ye(4,51)),new Ne(28,new ye(4,22),new ye(4,23)),new Ne(24,new ye(3,12),new ye(8,13))),new r(12,Int32Array.from([6,32,58]),new Ne(24,new ye(2,92),new ye(2,93)),new Ne(22,new ye(6,36),new ye(2,37)),new Ne(26,new ye(4,20),new ye(6,21)),new Ne(28,new ye(7,14),new ye(4,15))),new r(13,Int32Array.from([6,34,62]),new Ne(26,new ye(4,107)),new Ne(22,new ye(8,37),new ye(1,38)),new Ne(24,new ye(8,20),new ye(4,21)),new Ne(22,new ye(12,11),new ye(4,12))),new r(14,Int32Array.from([6,26,46,66]),new Ne(30,new ye(3,115),new ye(1,116)),new Ne(24,new ye(4,40),new ye(5,41)),new Ne(20,new ye(11,16),new ye(5,17)),new Ne(24,new ye(11,12),new ye(5,13))),new r(15,Int32Array.from([6,26,48,70]),new Ne(22,new ye(5,87),new ye(1,88)),new Ne(24,new ye(5,41),new ye(5,42)),new Ne(30,new ye(5,24),new ye(7,25)),new Ne(24,new ye(11,12),new ye(7,13))),new r(16,Int32Array.from([6,26,50,74]),new Ne(24,new ye(5,98),new ye(1,99)),new Ne(28,new ye(7,45),new ye(3,46)),new Ne(24,new ye(15,19),new ye(2,20)),new Ne(30,new ye(3,15),new ye(13,16))),new r(17,Int32Array.from([6,30,54,78]),new Ne(28,new ye(1,107),new ye(5,108)),new Ne(28,new ye(10,46),new ye(1,47)),new Ne(28,new ye(1,22),new ye(15,23)),new Ne(28,new ye(2,14),new ye(17,15))),new r(18,Int32Array.from([6,30,56,82]),new Ne(30,new ye(5,120),new ye(1,121)),new Ne(26,new ye(9,43),new ye(4,44)),new Ne(28,new ye(17,22),new ye(1,23)),new Ne(28,new ye(2,14),new ye(19,15))),new r(19,Int32Array.from([6,30,58,86]),new Ne(28,new ye(3,113),new ye(4,114)),new Ne(26,new ye(3,44),new ye(11,45)),new Ne(26,new ye(17,21),new ye(4,22)),new Ne(26,new ye(9,13),new ye(16,14))),new r(20,Int32Array.from([6,34,62,90]),new Ne(28,new ye(3,107),new ye(5,108)),new Ne(26,new ye(3,41),new ye(13,42)),new Ne(30,new ye(15,24),new ye(5,25)),new Ne(28,new ye(15,15),new ye(10,16))),new r(21,Int32Array.from([6,28,50,72,94]),new Ne(28,new ye(4,116),new ye(4,117)),new Ne(26,new ye(17,42)),new Ne(28,new ye(17,22),new ye(6,23)),new Ne(30,new ye(19,16),new ye(6,17))),new r(22,Int32Array.from([6,26,50,74,98]),new Ne(28,new ye(2,111),new ye(7,112)),new Ne(28,new ye(17,46)),new Ne(30,new ye(7,24),new ye(16,25)),new Ne(24,new ye(34,13))),new r(23,Int32Array.from([6,30,54,78,102]),new Ne(30,new ye(4,121),new ye(5,122)),new Ne(28,new ye(4,47),new ye(14,48)),new Ne(30,new ye(11,24),new ye(14,25)),new Ne(30,new ye(16,15),new ye(14,16))),new r(24,Int32Array.from([6,28,54,80,106]),new Ne(30,new ye(6,117),new ye(4,118)),new Ne(28,new ye(6,45),new ye(14,46)),new Ne(30,new ye(11,24),new ye(16,25)),new Ne(30,new ye(30,16),new ye(2,17))),new r(25,Int32Array.from([6,32,58,84,110]),new Ne(26,new ye(8,106),new ye(4,107)),new Ne(28,new ye(8,47),new ye(13,48)),new Ne(30,new ye(7,24),new ye(22,25)),new Ne(30,new ye(22,15),new ye(13,16))),new r(26,Int32Array.from([6,30,58,86,114]),new Ne(28,new ye(10,114),new ye(2,115)),new Ne(28,new ye(19,46),new ye(4,47)),new Ne(28,new ye(28,22),new ye(6,23)),new Ne(30,new ye(33,16),new ye(4,17))),new r(27,Int32Array.from([6,34,62,90,118]),new Ne(30,new ye(8,122),new ye(4,123)),new Ne(28,new ye(22,45),new ye(3,46)),new Ne(30,new ye(8,23),new ye(26,24)),new Ne(30,new ye(12,15),new ye(28,16))),new r(28,Int32Array.from([6,26,50,74,98,122]),new Ne(30,new ye(3,117),new ye(10,118)),new Ne(28,new ye(3,45),new ye(23,46)),new Ne(30,new ye(4,24),new ye(31,25)),new Ne(30,new ye(11,15),new ye(31,16))),new r(29,Int32Array.from([6,30,54,78,102,126]),new Ne(30,new ye(7,116),new ye(7,117)),new Ne(28,new ye(21,45),new ye(7,46)),new Ne(30,new ye(1,23),new ye(37,24)),new Ne(30,new ye(19,15),new ye(26,16))),new r(30,Int32Array.from([6,26,52,78,104,130]),new Ne(30,new ye(5,115),new ye(10,116)),new Ne(28,new ye(19,47),new ye(10,48)),new Ne(30,new ye(15,24),new ye(25,25)),new Ne(30,new ye(23,15),new ye(25,16))),new r(31,Int32Array.from([6,30,56,82,108,134]),new Ne(30,new ye(13,115),new ye(3,116)),new Ne(28,new ye(2,46),new ye(29,47)),new Ne(30,new ye(42,24),new ye(1,25)),new Ne(30,new ye(23,15),new ye(28,16))),new r(32,Int32Array.from([6,34,60,86,112,138]),new Ne(30,new ye(17,115)),new Ne(28,new ye(10,46),new ye(23,47)),new Ne(30,new ye(10,24),new ye(35,25)),new Ne(30,new ye(19,15),new ye(35,16))),new r(33,Int32Array.from([6,30,58,86,114,142]),new Ne(30,new ye(17,115),new ye(1,116)),new Ne(28,new ye(14,46),new ye(21,47)),new Ne(30,new ye(29,24),new ye(19,25)),new Ne(30,new ye(11,15),new ye(46,16))),new r(34,Int32Array.from([6,34,62,90,118,146]),new Ne(30,new ye(13,115),new ye(6,116)),new Ne(28,new ye(14,46),new ye(23,47)),new Ne(30,new ye(44,24),new ye(7,25)),new Ne(30,new ye(59,16),new ye(1,17))),new r(35,Int32Array.from([6,30,54,78,102,126,150]),new Ne(30,new ye(12,121),new ye(7,122)),new Ne(28,new ye(12,47),new ye(26,48)),new Ne(30,new ye(39,24),new ye(14,25)),new Ne(30,new ye(22,15),new ye(41,16))),new r(36,Int32Array.from([6,24,50,76,102,128,154]),new Ne(30,new ye(6,121),new ye(14,122)),new Ne(28,new ye(6,47),new ye(34,48)),new Ne(30,new ye(46,24),new ye(10,25)),new Ne(30,new ye(2,15),new ye(64,16))),new r(37,Int32Array.from([6,28,54,80,106,132,158]),new Ne(30,new ye(17,122),new ye(4,123)),new Ne(28,new ye(29,46),new ye(14,47)),new Ne(30,new ye(49,24),new ye(10,25)),new Ne(30,new ye(24,15),new ye(46,16))),new r(38,Int32Array.from([6,32,58,84,110,136,162]),new Ne(30,new ye(4,122),new ye(18,123)),new Ne(28,new ye(13,46),new ye(32,47)),new Ne(30,new ye(48,24),new ye(14,25)),new Ne(30,new ye(42,15),new ye(32,16))),new r(39,Int32Array.from([6,26,54,82,110,138,166]),new Ne(30,new ye(20,117),new ye(4,118)),new Ne(28,new ye(40,47),new ye(7,48)),new Ne(30,new ye(43,24),new ye(22,25)),new Ne(30,new ye(10,15),new ye(67,16))),new r(40,Int32Array.from([6,30,58,86,114,142,170]),new Ne(30,new ye(19,118),new ye(6,119)),new Ne(28,new ye(18,47),new ye(31,48)),new Ne(30,new ye(34,24),new ye(34,25)),new Ne(30,new ye(20,15),new ye(61,16)))],r}(),Fn;(function(r){r[r.DATA_MASK_000=0]="DATA_MASK_000",r[r.DATA_MASK_001=1]="DATA_MASK_001",r[r.DATA_MASK_010=2]="DATA_MASK_010",r[r.DATA_MASK_011=3]="DATA_MASK_011",r[r.DATA_MASK_100=4]="DATA_MASK_100",r[r.DATA_MASK_101=5]="DATA_MASK_101",r[r.DATA_MASK_110=6]="DATA_MASK_110",r[r.DATA_MASK_111=7]="DATA_MASK_111"})(Fn||(Fn={}));var cb=function(){function r(t,e){this.value=t,this.isMasked=e}return r.prototype.unmaskBitMatrix=function(t,e){for(var n=0;n=0;n--)t=this.copyBit(8,n,t);for(var i=this.bitMatrix.getHeight(),a=0,o=i-7,n=i-1;n>=o;n--)a=this.copyBit(8,n,a);for(var e=i-8;e=0;a--)for(var o=t-9;o>=i;o--)n=this.copyBit(o,a,n);var s=ks.decodeVersionInformation(n);if(s!==null&&s.getDimensionForVersion()===t)return this.parsedVersion=s,s;n=0;for(var o=5;o>=0;o--)for(var a=t-9;a>=i;a--)n=this.copyBit(o,a,n);if(s=ks.decodeVersionInformation(n),s!==null&&s.getDimensionForVersion()===t)return this.parsedVersion=s,s;throw new ct},r.prototype.copyBit=function(t,e,n){var i=this.isMirror?this.bitMatrix.get(e,t):this.bitMatrix.get(t,e);return i?n<<1|1:n<<1},r.prototype.readCodewords=function(){var t=this.readFormatInformation(),e=this.readVersion(),n=cb.values.get(t.getDataMask()),i=this.bitMatrix.getHeight();n.unmaskBitMatrix(this.bitMatrix,i);for(var a=e.buildFunctionPattern(),o=!0,s=new Uint8Array(e.getTotalCodewords()),u=0,c=0,l=0,d=i-1;d>0;d-=2){d===6&&d--;for(var h=0;h=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},DR=function(){function r(t,e){this.numDataCodewords=t,this.codewords=e}return r.getDataBlocks=function(t,e,n){var i,a,o,s;if(t.length!==e.getTotalCodewords())throw new Bt;var u=e.getECBlocksForLevel(n),c=0,l=u.getECBlocks();try{for(var d=lb(l),h=d.next();!h.done;h=d.next()){var f=h.value;c+=f.getCount()}}catch(I){i={error:I}}finally{try{h&&!h.done&&(a=d.return)&&a.call(d)}finally{if(i)throw i.error}}var g=new Array(c),m=0;try{for(var p=lb(l),y=p.next();!y.done;y=p.next())for(var f=y.value,v=0;v=0;){var z=g[F].codewords.length;if(z===D)break;F--}F++;for(var W=D-u.getECCodewordsPerBlock(),U=0,v=0;vt.available())throw new ct;for(var i=new Uint8Array(2*n),a=0;n>0;){var o=t.readBits(13),s=o/96<<8&4294967295|o%96;s<959?s+=41377:s+=42657,i[a]=s>>8&255,i[a+1]=s&255,a+=2,n--}try{e.append(ta.decode(i,$r.GB2312))}catch(u){throw new ct(u)}},r.decodeKanjiSegment=function(t,e,n){if(n*13>t.available())throw new ct;for(var i=new Uint8Array(2*n),a=0;n>0;){var o=t.readBits(13),s=o/192<<8&4294967295|o%192;s<7936?s+=33088:s+=49472,i[a]=s>>8,i[a+1]=s,a+=2,n--}try{e.append(ta.decode(i,$r.SHIFT_JIS))}catch(u){throw new ct(u)}},r.decodeByteSegment=function(t,e,n,i,a,o){if(8*n>t.available())throw new ct;for(var s=new Uint8Array(n),u=0;u=r.ALPHANUMERIC_CHARS.length)throw new ct;return r.ALPHANUMERIC_CHARS[t]},r.decodeAlphanumericSegment=function(t,e,n,i){for(var a=e.length();n>1;){if(t.available()<11)throw new ct;var o=t.readBits(11);e.append(r.toAlphaNumericChar(Math.floor(o/45))),e.append(r.toAlphaNumericChar(o%45)),n-=2}if(n===1){if(t.available()<6)throw new ct;e.append(r.toAlphaNumericChar(t.readBits(6)))}if(i)for(var s=a;s=3;){if(t.available()<10)throw new ct;var i=t.readBits(10);if(i>=1e3)throw new ct;e.append(r.toAlphaNumericChar(Math.floor(i/100))),e.append(r.toAlphaNumericChar(Math.floor(i/10)%10)),e.append(r.toAlphaNumericChar(i%10)),n-=3}if(n===2){if(t.available()<7)throw new ct;var a=t.readBits(7);if(a>=100)throw new ct;e.append(r.toAlphaNumericChar(Math.floor(a/10))),e.append(r.toAlphaNumericChar(a%10))}else if(n===1){if(t.available()<4)throw new ct;var o=t.readBits(4);if(o>=10)throw new ct;e.append(r.toAlphaNumericChar(o))}},r.parseECIValue=function(t){var e=t.readBits(8);if((e&128)==0)return e&127;if((e&192)==128){var n=t.readBits(8);return(e&63)<<8&4294967295|n}if((e&224)==192){var i=t.readBits(16);return(e&31)<<16&4294967295|i}throw new ct},r.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",r.GB2312_SUBSET=1,r}(),fb=function(){function r(t){this.mirrored=t}return r.prototype.isMirrored=function(){return this.mirrored},r.prototype.applyMirroredCorrection=function(t){if(!(!this.mirrored||t===null||t.length<3)){var e=t[0];t[0]=t[2],t[2]=e}},r}(),hb=globalThis&&globalThis.__values||function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},OR=function(){function r(){this.rsDecoder=new gh(mo.QR_CODE_FIELD_256)}return r.prototype.decodeBooleanArray=function(t,e){return this.decodeBitMatrix(po.parseFromBooleanArray(t),e)},r.prototype.decodeBitMatrix=function(t,e){var n=new SR(t),i=null;try{return this.decodeBitMatrixParser(n,e)}catch(o){i=o}try{n.remask(),n.setMirror(!0),n.readVersion(),n.readFormatInformation(),n.mirror();var a=this.decodeBitMatrixParser(n,e);return a.setOther(new fb(!0)),a}catch(o){throw i!==null?i:o}},r.prototype.decodeBitMatrixParser=function(t,e){var n,i,a,o,s=t.readVersion(),u=t.readFormatInformation().getErrorCorrectionLevel(),c=t.readCodewords(),l=DR.getDataBlocks(c,s,u),d=0;try{for(var h=hb(l),f=h.next();!f.done;f=h.next()){var g=f.value;d+=g.getNumDataCodewords()}}catch(F){n={error:F}}finally{try{f&&!f.done&&(i=h.return)&&i.call(h)}finally{if(n)throw n.error}}var m=new Uint8Array(d),p=0;try{for(var y=hb(l),v=y.next();!v.done;v=y.next()){var g=v.value,b=g.getCodewords(),E=g.getNumDataCodewords();this.correctErrors(b,E);for(var D=0;D=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},NR=function(){function r(t,e,n,i,a,o,s){this.image=t,this.startX=e,this.startY=n,this.width=i,this.height=a,this.moduleSize=o,this.resultPointCallback=s,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(3)}return r.prototype.find=function(){for(var t=this.startX,e=this.height,n=this.width,i=t+n,a=this.startY+e/2,o=new Int32Array(3),s=this.image,u=0;u=n)return!1;return!0},r.prototype.crossCheckVertical=function(t,e,n,i){var a=this.image,o=a.getHeight(),s=this.crossCheckStateCount;s[0]=0,s[1]=0,s[2]=0;for(var u=t;u>=0&&a.get(e,u)&&s[1]<=n;)s[1]++,u--;if(u<0||s[1]>n)return NaN;for(;u>=0&&!a.get(e,u)&&s[0]<=n;)s[0]++,u--;if(s[0]>n)return NaN;for(u=t+1;un)return NaN;for(;un)return NaN;var c=s[0]+s[1]+s[2];return 5*Math.abs(c-i)>=2*i?NaN:this.foundPatternCross(s)?r.centerFromEnd(s,u):NaN},r.prototype.handlePossibleCenter=function(t,e,n){var i,a,o=t[0]+t[1]+t[2],s=r.centerFromEnd(t,n),u=this.crossCheckVertical(e,s,2*t[1],o);if(!isNaN(u)){var c=(t[0]+t[1]+t[2])/3;try{for(var l=RR(this.possibleCenters),d=l.next();!d.done;d=l.next()){var h=d.value;if(h.aboutEquals(c,u,s))return h.combineEstimate(u,s,c)}}catch(g){i={error:g}}finally{try{d&&!d.done&&(a=l.return)&&a.call(l)}finally{if(i)throw i.error}}var f=new kR(s,u,c);this.possibleCenters.push(f),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(f)}return null},r}(),FR=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),MR=function(r){FR(t,r);function t(e,n,i,a){var o=r.call(this,e,n)||this;return o.estimatedModuleSize=i,o.count=a,a===void 0&&(o.count=1),o}return t.prototype.getEstimatedModuleSize=function(){return this.estimatedModuleSize},t.prototype.getCount=function(){return this.count},t.prototype.aboutEquals=function(e,n,i){if(Math.abs(n-this.getY())<=e&&Math.abs(i-this.getX())<=e){var a=Math.abs(e-this.estimatedModuleSize);return a<=1||a<=this.estimatedModuleSize}return!1},t.prototype.combineEstimate=function(e,n,i){var a=this.count+1,o=(this.count*this.getX()+n)/a,s=(this.count*this.getY()+e)/a,u=(this.count*this.estimatedModuleSize+i)/a;return new t(o,s,u,a)},t}(yt),UR=function(){function r(t){this.bottomLeft=t[0],this.topLeft=t[1],this.topRight=t[2]}return r.prototype.getBottomLeft=function(){return this.bottomLeft},r.prototype.getTopLeft=function(){return this.topLeft},r.prototype.getTopRight=function(){return this.topRight},r}(),Gc=globalThis&&globalThis.__values||function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},BR=function(){function r(t,e){this.image=t,this.resultPointCallback=e,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=e}return r.prototype.getImage=function(){return this.image},r.prototype.getPossibleCenters=function(){return this.possibleCenters},r.prototype.find=function(t){var e=t!=null&&t.get(Hr.TRY_HARDER)!==void 0,n=t!=null&&t.get(Hr.PURE_BARCODE)!==void 0,i=this.image,a=i.getHeight(),o=i.getWidth(),s=Math.floor(3*a/(4*r.MAX_MODULES));(sc[2]&&(l+=g-c[2]-s,h=o-1)}else{c[0]=c[2],c[1]=c[3],c[2]=c[4],c[3]=1,c[4]=0,d=3;continue}d=0,c[0]=0,c[1]=0,c[2]=0,c[3]=0,c[4]=0}else c[0]=c[2],c[1]=c[3],c[2]=c[4],c[3]=1,c[4]=0,d=3;else c[++d]++;else c[d]++;if(r.foundPatternCross(c)){var f=this.handlePossibleCenter(c,l,o,n);f===!0&&(s=c[0],this.hasSkipped&&(u=this.haveMultiplyConfirmedCenters()))}}var m=this.selectBestPatterns();return yt.orderBestPatterns(m),new UR(m)},r.centerFromEnd=function(t,e){return e-t[4]-t[3]-t[2]/2},r.foundPatternCross=function(t){for(var e=0,n=0;n<5;n++){var i=t[n];if(i===0)return!1;e+=i}if(e<7)return!1;var a=e/7,o=a/2;return Math.abs(a-t[0])=o&&e>=o&&s.get(e-o,t-o);)a[2]++,o++;if(t=o&&e>=o&&!s.get(e-o,t-o)&&a[1]<=n;)a[1]++,o++;if(tn)return!1;for(;t>=o&&e>=o&&s.get(e-o,t-o)&&a[0]<=n;)a[0]++,o++;if(a[0]>n)return!1;var u=s.getHeight(),c=s.getWidth();for(o=1;t+o=u||e+o>=c)return!1;for(;t+o=u||e+o>=c||a[3]>=n)return!1;for(;t+o=n)return!1;var l=a[0]+a[1]+a[2]+a[3]+a[4];return Math.abs(l-i)<2*i&&r.foundPatternCross(a)},r.prototype.crossCheckVertical=function(t,e,n,i){for(var a=this.image,o=a.getHeight(),s=this.getCrossCheckStateCount(),u=t;u>=0&&a.get(e,u);)s[2]++,u--;if(u<0)return NaN;for(;u>=0&&!a.get(e,u)&&s[1]<=n;)s[1]++,u--;if(u<0||s[1]>n)return NaN;for(;u>=0&&a.get(e,u)&&s[0]<=n;)s[0]++,u--;if(s[0]>n)return NaN;for(u=t+1;u=n)return NaN;for(;u=n)return NaN;var c=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(c-i)>=2*i?NaN:r.foundPatternCross(s)?r.centerFromEnd(s,u):NaN},r.prototype.crossCheckHorizontal=function(t,e,n,i){for(var a=this.image,o=a.getWidth(),s=this.getCrossCheckStateCount(),u=t;u>=0&&a.get(u,e);)s[2]++,u--;if(u<0)return NaN;for(;u>=0&&!a.get(u,e)&&s[1]<=n;)s[1]++,u--;if(u<0||s[1]>n)return NaN;for(;u>=0&&a.get(u,e)&&s[0]<=n;)s[0]++,u--;if(s[0]>n)return NaN;for(u=t+1;u=n)return NaN;for(;u=n)return NaN;var c=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(c-i)>=i?NaN:r.foundPatternCross(s)?r.centerFromEnd(s,u):NaN},r.prototype.handlePossibleCenter=function(t,e,n,i){var a=t[0]+t[1]+t[2]+t[3]+t[4],o=r.centerFromEnd(t,n),s=this.crossCheckVertical(e,Math.floor(o),t[2],a);if(!isNaN(s)&&(o=this.crossCheckHorizontal(Math.floor(o),Math.floor(s),t[2],a),!isNaN(o)&&(!i||this.crossCheckDiagonal(Math.floor(s),Math.floor(o),t[2],a)))){for(var u=a/7,c=!1,l=this.possibleCenters,d=0,h=l.length;d=r.CENTER_QUORUM)if(i==null)i=s;else return this.hasSkipped=!0,Math.floor((Math.abs(i.getX()-s.getX())-Math.abs(i.getY()-s.getY()))/2)}}catch(u){t={error:u}}finally{try{o&&!o.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}return 0},r.prototype.haveMultiplyConfirmedCenters=function(){var t,e,n,i,a=0,o=0,s=this.possibleCenters.length;try{for(var u=Gc(this.possibleCenters),c=u.next();!c.done;c=u.next()){var l=c.value;l.getCount()>=r.CENTER_QUORUM&&(a++,o+=l.getEstimatedModuleSize())}}catch(m){t={error:m}}finally{try{c&&!c.done&&(e=u.return)&&e.call(u)}finally{if(t)throw t.error}}if(a<3)return!1;var d=o/s,h=0;try{for(var f=Gc(this.possibleCenters),g=f.next();!g.done;g=f.next()){var l=g.value;h+=Math.abs(l.getEstimatedModuleSize()-d)}}catch(m){n={error:m}}finally{try{g&&!g.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}return h<=.05*o},r.prototype.selectBestPatterns=function(){var t,e,n,i,a=this.possibleCenters.length;if(a<3)throw new ze;var o=this.possibleCenters,s;if(a>3){var u=0,c=0;try{for(var l=Gc(this.possibleCenters),d=l.next();!d.done;d=l.next()){var h=d.value,f=h.getEstimatedModuleSize();u+=f,c+=f*f}}catch(D){t={error:D}}finally{try{d&&!d.done&&(e=l.return)&&e.call(l)}finally{if(t)throw t.error}}s=u/a;var g=Math.sqrt(c/a-s*s);o.sort(function(D,F){var z=Math.abs(F.getEstimatedModuleSize()-s),W=Math.abs(D.getEstimatedModuleSize()-s);return zW?1:0});for(var m=Math.max(.2*s,g),p=0;p3;p++){var y=o[p];Math.abs(y.getEstimatedModuleSize()-s)>m&&(o.splice(p,1),p--)}}if(o.length>3){var u=0;try{for(var v=Gc(o),b=v.next();!b.done;b=v.next()){var E=b.value;u+=E.getEstimatedModuleSize()}}catch(F){n={error:F}}finally{try{b&&!b.done&&(i=v.return)&&i.call(v)}finally{if(n)throw n.error}}s=u/o.length,o.sort(function(F,z){if(z.getCount()===F.getCount()){var W=Math.abs(z.getEstimatedModuleSize()-s),U=Math.abs(F.getEstimatedModuleSize()-s);return WU?-1:0}else return z.getCount()-F.getCount()}),o.splice(3)}return[o[0],o[1],o[2]]},r.CENTER_QUORUM=2,r.MIN_SKIP=3,r.MAX_MODULES=57,r}(),PR=function(){function r(t){this.image=t}return r.prototype.getImage=function(){return this.image},r.prototype.getResultPointCallback=function(){return this.resultPointCallback},r.prototype.detect=function(t){this.resultPointCallback=t==null?null:t.get(Hr.NEED_RESULT_POINT_CALLBACK);var e=new BR(this.image,this.resultPointCallback),n=e.find(t);return this.processFinderPatternInfo(n)},r.prototype.processFinderPatternInfo=function(t){var e=t.getTopLeft(),n=t.getTopRight(),i=t.getBottomLeft(),a=this.calculateModuleSize(e,n,i);if(a<1)throw new ze("No pattern found in proccess finder.");var o=r.computeDimension(e,n,i,a),s=ks.getProvisionalVersionForDimension(o),u=s.getDimensionForVersion()-7,c=null;if(s.getAlignmentPatternCenters().length>0)for(var l=n.getX()-e.getX()+i.getX(),d=n.getY()-e.getY()+i.getY(),h=1-3/u,f=Math.floor(e.getX()+h*(l-e.getX())),g=Math.floor(e.getY()+h*(d-e.getY())),m=4;m<=16;m<<=1)try{c=this.findAlignmentInRegion(a,f,g,m);break}catch(b){if(!(b instanceof ze))throw b}var p=r.createTransform(e,n,i,c,o),y=r.sampleGrid(this.image,p,o),v;return c===null?v=[i,e,n]:v=[i,e,n,c],new M0(y,v)},r.createTransform=function(t,e,n,i,a){var o=a-3.5,s,u,c,l;return i!==null?(s=i.getX(),u=i.getY(),c=o-3,l=c):(s=e.getX()-t.getX()+n.getX(),u=e.getY()-t.getY()+n.getY(),c=o,l=o),Hy.quadrilateralToQuadrilateral(3.5,3.5,o,3.5,c,l,3.5,o,t.getX(),t.getY(),e.getX(),e.getY(),s,u,n.getX(),n.getY())},r.sampleGrid=function(t,e,n){var i=B0.getInstance();return i.sampleGridWithTransform(t,n,n,e)},r.computeDimension=function(t,e,n,i){var a=yr.round(yt.distance(t,e)/i),o=yr.round(yt.distance(t,n)/i),s=Math.floor((a+o)/2)+7;switch(s&3){case 0:s++;break;case 2:s--;break;case 3:throw new ze("Dimensions could be not found.")}return s},r.prototype.calculateModuleSize=function(t,e,n){return(this.calculateModuleSizeOneWay(t,e)+this.calculateModuleSizeOneWay(t,n))/2},r.prototype.calculateModuleSizeOneWay=function(t,e){var n=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(t.getX()),Math.floor(t.getY()),Math.floor(e.getX()),Math.floor(e.getY())),i=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(e.getX()),Math.floor(e.getY()),Math.floor(t.getX()),Math.floor(t.getY()));return isNaN(n)?i/7:isNaN(i)?n/7:(n+i)/14},r.prototype.sizeOfBlackWhiteBlackRunBothWays=function(t,e,n,i){var a=this.sizeOfBlackWhiteBlackRun(t,e,n,i),o=1,s=t-(n-t);s<0?(o=t/(t-s),s=0):s>=this.image.getWidth()&&(o=(this.image.getWidth()-1-t)/(s-t),s=this.image.getWidth()-1);var u=Math.floor(e-(i-e)*o);return o=1,u<0?(o=e/(e-u),u=0):u>=this.image.getHeight()&&(o=(this.image.getHeight()-1-e)/(u-e),u=this.image.getHeight()-1),s=Math.floor(t+(s-t)*o),a+=this.sizeOfBlackWhiteBlackRun(t,e,s,u),a-1},r.prototype.sizeOfBlackWhiteBlackRun=function(t,e,n,i){var a=Math.abs(i-e)>Math.abs(n-t);if(a){var o=t;t=e,e=o,o=n,n=i,i=o}for(var s=Math.abs(n-t),u=Math.abs(i-e),c=-s/2,l=t0){if(m===i)break;m+=d,c-=s}}return h===2?yr.distance(n+l,i,t,e):NaN},r.prototype.findAlignmentInRegion=function(t,e,n,i){var a=Math.floor(i*t),o=Math.max(0,e-a),s=Math.min(this.image.getWidth()-1,e+a);if(s-o=u||a>=o)throw new ze;if(o-a!=u-s&&(u=s+(o-a),u>=t.getWidth()))throw new ze;var c=Math.round((u-s+1)/i),l=Math.round((o-a+1)/i);if(c<=0||l<=0)throw new ze;if(l!==c)throw new ze;var d=Math.floor(i/2);a+=d,s+=d;var h=s+Math.floor((c-1)*i)-u;if(h>0){if(h>d)throw new ze;s-=h}var f=a+Math.floor((l-1)*i)-o;if(f>0){if(f>d)throw new ze;a-=f}for(var g=new po(c,l),m=0;m=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},vr=function(){function r(){}return r.prototype.PDF417Common=function(){},r.getBitCountSum=function(t){return yr.sum(t)},r.toIntArray=function(t){var e,n;if(t==null||!t.length)return r.EMPTY_INT_ARRAY;var i=new Int32Array(t.length),a=0;try{for(var o=LR(t),s=o.next();!s.done;s=o.next()){var u=s.value;i[a++]=u}}catch(c){e={error:c}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return i},r.getCodeword=function(t){var e=Tn.binarySearch(r.SYMBOL_TABLE,t&262143);return e<0?-1:(r.CODEWORD_TABLE[e]-1)%r.NUMBER_OF_CODEWORDS},r.NUMBER_OF_CODEWORDS=929,r.MAX_CODEWORDS_IN_BARCODE=r.NUMBER_OF_CODEWORDS-1,r.MIN_ROWS_IN_BARCODE=3,r.MAX_ROWS_IN_BARCODE=90,r.MODULES_IN_CODEWORD=17,r.MODULES_IN_STOP_PATTERN=18,r.BARS_IN_MODULE=8,r.EMPTY_INT_ARRAY=new Int32Array([]),r.SYMBOL_TABLE=Int32Array.from([66142,66170,66206,66236,66290,66292,66350,66382,66396,66454,66470,66476,66594,66600,66614,66626,66628,66632,66640,66654,66662,66668,66682,66690,66718,66720,66748,66758,66776,66798,66802,66804,66820,66824,66832,66846,66848,66876,66880,66936,66950,66956,66968,66992,67006,67022,67036,67042,67044,67048,67062,67118,67150,67164,67214,67228,67256,67294,67322,67350,67366,67372,67398,67404,67416,67438,67474,67476,67490,67492,67496,67510,67618,67624,67650,67656,67664,67678,67686,67692,67706,67714,67716,67728,67742,67744,67772,67782,67788,67800,67822,67826,67828,67842,67848,67870,67872,67900,67904,67960,67974,67992,68016,68030,68046,68060,68066,68068,68072,68086,68104,68112,68126,68128,68156,68160,68216,68336,68358,68364,68376,68400,68414,68448,68476,68494,68508,68536,68546,68548,68552,68560,68574,68582,68588,68654,68686,68700,68706,68708,68712,68726,68750,68764,68792,68802,68804,68808,68816,68830,68838,68844,68858,68878,68892,68920,68976,68990,68994,68996,69e3,69008,69022,69024,69052,69062,69068,69080,69102,69106,69108,69142,69158,69164,69190,69208,69230,69254,69260,69272,69296,69310,69326,69340,69386,69394,69396,69410,69416,69430,69442,69444,69448,69456,69470,69478,69484,69554,69556,69666,69672,69698,69704,69712,69726,69754,69762,69764,69776,69790,69792,69820,69830,69836,69848,69870,69874,69876,69890,69918,69920,69948,69952,70008,70022,70040,70064,70078,70094,70108,70114,70116,70120,70134,70152,70174,70176,70264,70384,70412,70448,70462,70496,70524,70542,70556,70584,70594,70600,70608,70622,70630,70636,70664,70672,70686,70688,70716,70720,70776,70896,71136,71180,71192,71216,71230,71264,71292,71360,71416,71452,71480,71536,71550,71554,71556,71560,71568,71582,71584,71612,71622,71628,71640,71662,71726,71732,71758,71772,71778,71780,71784,71798,71822,71836,71864,71874,71880,71888,71902,71910,71916,71930,71950,71964,71992,72048,72062,72066,72068,72080,72094,72096,72124,72134,72140,72152,72174,72178,72180,72206,72220,72248,72304,72318,72416,72444,72456,72464,72478,72480,72508,72512,72568,72588,72600,72624,72638,72654,72668,72674,72676,72680,72694,72726,72742,72748,72774,72780,72792,72814,72838,72856,72880,72894,72910,72924,72930,72932,72936,72950,72966,72972,72984,73008,73022,73056,73084,73102,73116,73144,73156,73160,73168,73182,73190,73196,73210,73226,73234,73236,73250,73252,73256,73270,73282,73284,73296,73310,73318,73324,73346,73348,73352,73360,73374,73376,73404,73414,73420,73432,73454,73498,73518,73522,73524,73550,73564,73570,73572,73576,73590,73800,73822,73858,73860,73872,73886,73888,73916,73944,73970,73972,73992,74014,74016,74044,74048,74104,74118,74136,74160,74174,74210,74212,74216,74230,74244,74256,74270,74272,74360,74480,74502,74508,74544,74558,74592,74620,74638,74652,74680,74690,74696,74704,74726,74732,74782,74784,74812,74992,75232,75288,75326,75360,75388,75456,75512,75576,75632,75646,75650,75652,75664,75678,75680,75708,75718,75724,75736,75758,75808,75836,75840,75896,76016,76256,76736,76824,76848,76862,76896,76924,76992,77048,77296,77340,77368,77424,77438,77536,77564,77572,77576,77584,77600,77628,77632,77688,77702,77708,77720,77744,77758,77774,77788,77870,77902,77916,77922,77928,77966,77980,78008,78018,78024,78032,78046,78060,78074,78094,78136,78192,78206,78210,78212,78224,78238,78240,78268,78278,78284,78296,78322,78324,78350,78364,78448,78462,78560,78588,78600,78622,78624,78652,78656,78712,78726,78744,78768,78782,78798,78812,78818,78820,78824,78838,78862,78876,78904,78960,78974,79072,79100,79296,79352,79368,79376,79390,79392,79420,79424,79480,79600,79628,79640,79664,79678,79712,79740,79772,79800,79810,79812,79816,79824,79838,79846,79852,79894,79910,79916,79942,79948,79960,79982,79988,80006,80024,80048,80062,80078,80092,80098,80100,80104,80134,80140,80176,80190,80224,80252,80270,80284,80312,80328,80336,80350,80358,80364,80378,80390,80396,80408,80432,80446,80480,80508,80576,80632,80654,80668,80696,80752,80766,80776,80784,80798,80800,80828,80844,80856,80878,80882,80884,80914,80916,80930,80932,80936,80950,80962,80968,80976,80990,80998,81004,81026,81028,81040,81054,81056,81084,81094,81100,81112,81134,81154,81156,81160,81168,81182,81184,81212,81216,81272,81286,81292,81304,81328,81342,81358,81372,81380,81384,81398,81434,81454,81458,81460,81486,81500,81506,81508,81512,81526,81550,81564,81592,81602,81604,81608,81616,81630,81638,81644,81702,81708,81722,81734,81740,81752,81774,81778,81780,82050,82078,82080,82108,82180,82184,82192,82206,82208,82236,82240,82296,82316,82328,82352,82366,82402,82404,82408,82440,82448,82462,82464,82492,82496,82552,82672,82694,82700,82712,82736,82750,82784,82812,82830,82882,82884,82888,82896,82918,82924,82952,82960,82974,82976,83004,83008,83064,83184,83424,83468,83480,83504,83518,83552,83580,83648,83704,83740,83768,83824,83838,83842,83844,83848,83856,83872,83900,83910,83916,83928,83950,83984,84e3,84028,84032,84088,84208,84448,84928,85040,85054,85088,85116,85184,85240,85488,85560,85616,85630,85728,85756,85764,85768,85776,85790,85792,85820,85824,85880,85894,85900,85912,85936,85966,85980,86048,86080,86136,86256,86496,86976,88160,88188,88256,88312,88560,89056,89200,89214,89312,89340,89536,89592,89608,89616,89632,89664,89720,89840,89868,89880,89904,89952,89980,89998,90012,90040,90190,90204,90254,90268,90296,90306,90308,90312,90334,90382,90396,90424,90480,90494,90500,90504,90512,90526,90528,90556,90566,90572,90584,90610,90612,90638,90652,90680,90736,90750,90848,90876,90884,90888,90896,90910,90912,90940,90944,91e3,91014,91020,91032,91056,91070,91086,91100,91106,91108,91112,91126,91150,91164,91192,91248,91262,91360,91388,91584,91640,91664,91678,91680,91708,91712,91768,91888,91928,91952,91966,92e3,92028,92046,92060,92088,92098,92100,92104,92112,92126,92134,92140,92188,92216,92272,92384,92412,92608,92664,93168,93200,93214,93216,93244,93248,93304,93424,93664,93720,93744,93758,93792,93820,93888,93944,93980,94008,94064,94078,94084,94088,94096,94110,94112,94140,94150,94156,94168,94246,94252,94278,94284,94296,94318,94342,94348,94360,94384,94398,94414,94428,94440,94470,94476,94488,94512,94526,94560,94588,94606,94620,94648,94658,94660,94664,94672,94686,94694,94700,94714,94726,94732,94744,94768,94782,94816,94844,94912,94968,94990,95004,95032,95088,95102,95112,95120,95134,95136,95164,95180,95192,95214,95218,95220,95244,95256,95280,95294,95328,95356,95424,95480,95728,95758,95772,95800,95856,95870,95968,95996,96008,96016,96030,96032,96060,96064,96120,96152,96176,96190,96220,96226,96228,96232,96290,96292,96296,96310,96322,96324,96328,96336,96350,96358,96364,96386,96388,96392,96400,96414,96416,96444,96454,96460,96472,96494,96498,96500,96514,96516,96520,96528,96542,96544,96572,96576,96632,96646,96652,96664,96688,96702,96718,96732,96738,96740,96744,96758,96772,96776,96784,96798,96800,96828,96832,96888,97008,97030,97036,97048,97072,97086,97120,97148,97166,97180,97208,97220,97224,97232,97246,97254,97260,97326,97330,97332,97358,97372,97378,97380,97384,97398,97422,97436,97464,97474,97476,97480,97488,97502,97510,97516,97550,97564,97592,97648,97666,97668,97672,97680,97694,97696,97724,97734,97740,97752,97774,97830,97836,97850,97862,97868,97880,97902,97906,97908,97926,97932,97944,97968,97998,98012,98018,98020,98024,98038,98618,98674,98676,98838,98854,98874,98892,98904,98926,98930,98932,98968,99006,99042,99044,99048,99062,99166,99194,99246,99286,99350,99366,99372,99386,99398,99416,99438,99442,99444,99462,99504,99518,99534,99548,99554,99556,99560,99574,99590,99596,99608,99632,99646,99680,99708,99726,99740,99768,99778,99780,99784,99792,99806,99814,99820,99834,99858,99860,99874,99880,99894,99906,99920,99934,99962,99970,99972,99976,99984,99998,1e5,100028,100038,100044,100056,100078,100082,100084,100142,100174,100188,100246,100262,100268,100306,100308,100390,100396,100410,100422,100428,100440,100462,100466,100468,100486,100504,100528,100542,100558,100572,100578,100580,100584,100598,100620,100656,100670,100704,100732,100750,100792,100802,100808,100816,100830,100838,100844,100858,100888,100912,100926,100960,100988,101056,101112,101148,101176,101232,101246,101250,101252,101256,101264,101278,101280,101308,101318,101324,101336,101358,101362,101364,101410,101412,101416,101430,101442,101448,101456,101470,101478,101498,101506,101508,101520,101534,101536,101564,101580,101618,101620,101636,101640,101648,101662,101664,101692,101696,101752,101766,101784,101838,101858,101860,101864,101934,101938,101940,101966,101980,101986,101988,101992,102030,102044,102072,102082,102084,102088,102096,102138,102166,102182,102188,102214,102220,102232,102254,102282,102290,102292,102306,102308,102312,102326,102444,102458,102470,102476,102488,102514,102516,102534,102552,102576,102590,102606,102620,102626,102632,102646,102662,102668,102704,102718,102752,102780,102798,102812,102840,102850,102856,102864,102878,102886,102892,102906,102936,102974,103008,103036,103104,103160,103224,103280,103294,103298,103300,103312,103326,103328,103356,103366,103372,103384,103406,103410,103412,103472,103486,103520,103548,103616,103672,103920,103992,104048,104062,104160,104188,104194,104196,104200,104208,104224,104252,104256,104312,104326,104332,104344,104368,104382,104398,104412,104418,104420,104424,104482,104484,104514,104520,104528,104542,104550,104570,104578,104580,104592,104606,104608,104636,104652,104690,104692,104706,104712,104734,104736,104764,104768,104824,104838,104856,104910,104930,104932,104936,104968,104976,104990,104992,105020,105024,105080,105200,105240,105278,105312,105372,105410,105412,105416,105424,105446,105518,105524,105550,105564,105570,105572,105576,105614,105628,105656,105666,105672,105680,105702,105722,105742,105756,105784,105840,105854,105858,105860,105864,105872,105888,105932,105970,105972,106006,106022,106028,106054,106060,106072,106100,106118,106124,106136,106160,106174,106190,106210,106212,106216,106250,106258,106260,106274,106276,106280,106306,106308,106312,106320,106334,106348,106394,106414,106418,106420,106566,106572,106610,106612,106630,106636,106648,106672,106686,106722,106724,106728,106742,106758,106764,106776,106800,106814,106848,106876,106894,106908,106936,106946,106948,106952,106960,106974,106982,106988,107032,107056,107070,107104,107132,107200,107256,107292,107320,107376,107390,107394,107396,107400,107408,107422,107424,107452,107462,107468,107480,107502,107506,107508,107544,107568,107582,107616,107644,107712,107768,108016,108060,108088,108144,108158,108256,108284,108290,108292,108296,108304,108318,108320,108348,108352,108408,108422,108428,108440,108464,108478,108494,108508,108514,108516,108520,108592,108640,108668,108736,108792,109040,109536,109680,109694,109792,109820,110016,110072,110084,110088,110096,110112,110140,110144,110200,110320,110342,110348,110360,110384,110398,110432,110460,110478,110492,110520,110532,110536,110544,110558,110658,110686,110714,110722,110724,110728,110736,110750,110752,110780,110796,110834,110836,110850,110852,110856,110864,110878,110880,110908,110912,110968,110982,111e3,111054,111074,111076,111080,111108,111112,111120,111134,111136,111164,111168,111224,111344,111372,111422,111456,111516,111554,111556,111560,111568,111590,111632,111646,111648,111676,111680,111736,111856,112096,112152,112224,112252,112320,112440,112514,112516,112520,112528,112542,112544,112588,112686,112718,112732,112782,112796,112824,112834,112836,112840,112848,112870,112890,112910,112924,112952,113008,113022,113026,113028,113032,113040,113054,113056,113100,113138,113140,113166,113180,113208,113264,113278,113376,113404,113416,113424,113440,113468,113472,113560,113614,113634,113636,113640,113686,113702,113708,113734,113740,113752,113778,113780,113798,113804,113816,113840,113854,113870,113890,113892,113896,113926,113932,113944,113968,113982,114016,114044,114076,114114,114116,114120,114128,114150,114170,114194,114196,114210,114212,114216,114242,114244,114248,114256,114270,114278,114306,114308,114312,114320,114334,114336,114364,114380,114420,114458,114478,114482,114484,114510,114524,114530,114532,114536,114842,114866,114868,114970,114994,114996,115042,115044,115048,115062,115130,115226,115250,115252,115278,115292,115298,115300,115304,115318,115342,115394,115396,115400,115408,115422,115430,115436,115450,115478,115494,115514,115526,115532,115570,115572,115738,115758,115762,115764,115790,115804,115810,115812,115816,115830,115854,115868,115896,115906,115912,115920,115934,115942,115948,115962,115996,116024,116080,116094,116098,116100,116104,116112,116126,116128,116156,116166,116172,116184,116206,116210,116212,116246,116262,116268,116282,116294,116300,116312,116334,116338,116340,116358,116364,116376,116400,116414,116430,116444,116450,116452,116456,116498,116500,116514,116520,116534,116546,116548,116552,116560,116574,116582,116588,116602,116654,116694,116714,116762,116782,116786,116788,116814,116828,116834,116836,116840,116854,116878,116892,116920,116930,116936,116944,116958,116966,116972,116986,117006,117048,117104,117118,117122,117124,117136,117150,117152,117180,117190,117196,117208,117230,117234,117236,117304,117360,117374,117472,117500,117506,117508,117512,117520,117536,117564,117568,117624,117638,117644,117656,117680,117694,117710,117724,117730,117732,117736,117750,117782,117798,117804,117818,117830,117848,117874,117876,117894,117936,117950,117966,117986,117988,117992,118022,118028,118040,118064,118078,118112,118140,118172,118210,118212,118216,118224,118238,118246,118266,118306,118312,118338,118352,118366,118374,118394,118402,118404,118408,118416,118430,118432,118460,118476,118514,118516,118574,118578,118580,118606,118620,118626,118628,118632,118678,118694,118700,118730,118738,118740,118830,118834,118836,118862,118876,118882,118884,118888,118902,118926,118940,118968,118978,118980,118984,118992,119006,119014,119020,119034,119068,119096,119152,119166,119170,119172,119176,119184,119198,119200,119228,119238,119244,119256,119278,119282,119284,119324,119352,119408,119422,119520,119548,119554,119556,119560,119568,119582,119584,119612,119616,119672,119686,119692,119704,119728,119742,119758,119772,119778,119780,119784,119798,119920,119934,120032,120060,120256,120312,120324,120328,120336,120352,120384,120440,120560,120582,120588,120600,120624,120638,120672,120700,120718,120732,120760,120770,120772,120776,120784,120798,120806,120812,120870,120876,120890,120902,120908,120920,120946,120948,120966,120972,120984,121008,121022,121038,121058,121060,121064,121078,121100,121112,121136,121150,121184,121212,121244,121282,121284,121288,121296,121318,121338,121356,121368,121392,121406,121440,121468,121536,121592,121656,121730,121732,121736,121744,121758,121760,121804,121842,121844,121890,121922,121924,121928,121936,121950,121958,121978,121986,121988,121992,122e3,122014,122016,122044,122060,122098,122100,122116,122120,122128,122142,122144,122172,122176,122232,122246,122264,122318,122338,122340,122344,122414,122418,122420,122446,122460,122466,122468,122472,122510,122524,122552,122562,122564,122568,122576,122598,122618,122646,122662,122668,122694,122700,122712,122738,122740,122762,122770,122772,122786,122788,122792,123018,123026,123028,123042,123044,123048,123062,123098,123146,123154,123156,123170,123172,123176,123190,123202,123204,123208,123216,123238,123244,123258,123290,123314,123316,123402,123410,123412,123426,123428,123432,123446,123458,123464,123472,123486,123494,123500,123514,123522,123524,123528,123536,123552,123580,123590,123596,123608,123630,123634,123636,123674,123698,123700,123740,123746,123748,123752,123834,123914,123922,123924,123938,123944,123958,123970,123976,123984,123998,124006,124012,124026,124034,124036,124048,124062,124064,124092,124102,124108,124120,124142,124146,124148,124162,124164,124168,124176,124190,124192,124220,124224,124280,124294,124300,124312,124336,124350,124366,124380,124386,124388,124392,124406,124442,124462,124466,124468,124494,124508,124514,124520,124558,124572,124600,124610,124612,124616,124624,124646,124666,124694,124710,124716,124730,124742,124748,124760,124786,124788,124818,124820,124834,124836,124840,124854,124946,124948,124962,124964,124968,124982,124994,124996,125e3,125008,125022,125030,125036,125050,125058,125060,125064,125072,125086,125088,125116,125126,125132,125144,125166,125170,125172,125186,125188,125192,125200,125216,125244,125248,125304,125318,125324,125336,125360,125374,125390,125404,125410,125412,125416,125430,125444,125448,125456,125472,125504,125560,125680,125702,125708,125720,125744,125758,125792,125820,125838,125852,125880,125890,125892,125896,125904,125918,125926,125932,125978,125998,126002,126004,126030,126044,126050,126052,126056,126094,126108,126136,126146,126148,126152,126160,126182,126202,126222,126236,126264,126320,126334,126338,126340,126344,126352,126366,126368,126412,126450,126452,126486,126502,126508,126522,126534,126540,126552,126574,126578,126580,126598,126604,126616,126640,126654,126670,126684,126690,126692,126696,126738,126754,126756,126760,126774,126786,126788,126792,126800,126814,126822,126828,126842,126894,126898,126900,126934,127126,127142,127148,127162,127178,127186,127188,127254,127270,127276,127290,127302,127308,127320,127342,127346,127348,127370,127378,127380,127394,127396,127400,127450,127510,127526,127532,127546,127558,127576,127598,127602,127604,127622,127628,127640,127664,127678,127694,127708,127714,127716,127720,127734,127754,127762,127764,127778,127784,127810,127812,127816,127824,127838,127846,127866,127898,127918,127922,127924,128022,128038,128044,128058,128070,128076,128088,128110,128114,128116,128134,128140,128152,128176,128190,128206,128220,128226,128228,128232,128246,128262,128268,128280,128304,128318,128352,128380,128398,128412,128440,128450,128452,128456,128464,128478,128486,128492,128506,128522,128530,128532,128546,128548,128552,128566,128578,128580,128584,128592,128606,128614,128634,128642,128644,128648,128656,128670,128672,128700,128716,128754,128756,128794,128814,128818,128820,128846,128860,128866,128868,128872,128886,128918,128934,128940,128954,128978,128980,129178,129198,129202,129204,129238,129258,129306,129326,129330,129332,129358,129372,129378,129380,129384,129398,129430,129446,129452,129466,129482,129490,129492,129562,129582,129586,129588,129614,129628,129634,129636,129640,129654,129678,129692,129720,129730,129732,129736,129744,129758,129766,129772,129814,129830,129836,129850,129862,129868,129880,129902,129906,129908,129930,129938,129940,129954,129956,129960,129974,130010]),r.CODEWORD_TABLE=Int32Array.from([2627,1819,2622,2621,1813,1812,2729,2724,2723,2779,2774,2773,902,896,908,868,865,861,859,2511,873,871,1780,835,2493,825,2491,842,837,844,1764,1762,811,810,809,2483,807,2482,806,2480,815,814,813,812,2484,817,816,1745,1744,1742,1746,2655,2637,2635,2626,2625,2623,2628,1820,2752,2739,2737,2728,2727,2725,2730,2785,2783,2778,2777,2775,2780,787,781,747,739,736,2413,754,752,1719,692,689,681,2371,678,2369,700,697,694,703,1688,1686,642,638,2343,631,2341,627,2338,651,646,643,2345,654,652,1652,1650,1647,1654,601,599,2322,596,2321,594,2319,2317,611,610,608,606,2324,603,2323,615,614,612,1617,1616,1614,1612,616,1619,1618,2575,2538,2536,905,901,898,909,2509,2507,2504,870,867,864,860,2512,875,872,1781,2490,2489,2487,2485,1748,836,834,832,830,2494,827,2492,843,841,839,845,1765,1763,2701,2676,2674,2653,2648,2656,2634,2633,2631,2629,1821,2638,2636,2770,2763,2761,2750,2745,2753,2736,2735,2733,2731,1848,2740,2738,2786,2784,591,588,576,569,566,2296,1590,537,534,526,2276,522,2274,545,542,539,548,1572,1570,481,2245,466,2242,462,2239,492,485,482,2249,496,494,1534,1531,1528,1538,413,2196,406,2191,2188,425,419,2202,415,2199,432,430,427,1472,1467,1464,433,1476,1474,368,367,2160,365,2159,362,2157,2155,2152,378,377,375,2166,372,2165,369,2162,383,381,379,2168,1419,1418,1416,1414,385,1411,384,1423,1422,1420,1424,2461,802,2441,2439,790,786,783,794,2409,2406,2403,750,742,738,2414,756,753,1720,2367,2365,2362,2359,1663,693,691,684,2373,680,2370,702,699,696,704,1690,1687,2337,2336,2334,2332,1624,2329,1622,640,637,2344,634,2342,630,2340,650,648,645,2346,655,653,1653,1651,1649,1655,2612,2597,2595,2571,2568,2565,2576,2534,2529,2526,1787,2540,2537,907,904,900,910,2503,2502,2500,2498,1768,2495,1767,2510,2508,2506,869,866,863,2513,876,874,1782,2720,2713,2711,2697,2694,2691,2702,2672,2670,2664,1828,2678,2675,2647,2646,2644,2642,1823,2639,1822,2654,2652,2650,2657,2771,1855,2765,2762,1850,1849,2751,2749,2747,2754,353,2148,344,342,336,2142,332,2140,345,1375,1373,306,2130,299,2128,295,2125,319,314,311,2132,1354,1352,1349,1356,262,257,2101,253,2096,2093,274,273,267,2107,263,2104,280,278,275,1316,1311,1308,1320,1318,2052,202,2050,2044,2040,219,2063,212,2060,208,2055,224,221,2066,1260,1258,1252,231,1248,229,1266,1264,1261,1268,155,1998,153,1996,1994,1991,1988,165,164,2007,162,2006,159,2003,2e3,172,171,169,2012,166,2010,1186,1184,1182,1179,175,1176,173,1192,1191,1189,1187,176,1194,1193,2313,2307,2305,592,589,2294,2292,2289,578,572,568,2297,580,1591,2272,2267,2264,1547,538,536,529,2278,525,2275,547,544,541,1574,1571,2237,2235,2229,1493,2225,1489,478,2247,470,2244,465,2241,493,488,484,2250,498,495,1536,1533,1530,1539,2187,2186,2184,2182,1432,2179,1430,2176,1427,414,412,2197,409,2195,405,2193,2190,426,424,421,2203,418,2201,431,429,1473,1471,1469,1466,434,1477,1475,2478,2472,2470,2459,2457,2454,2462,803,2437,2432,2429,1726,2443,2440,792,789,785,2401,2399,2393,1702,2389,1699,2411,2408,2405,745,741,2415,758,755,1721,2358,2357,2355,2353,1661,2350,1660,2347,1657,2368,2366,2364,2361,1666,690,687,2374,683,2372,701,698,705,1691,1689,2619,2617,2610,2608,2605,2613,2593,2588,2585,1803,2599,2596,2563,2561,2555,1797,2551,1795,2573,2570,2567,2577,2525,2524,2522,2520,1786,2517,1785,2514,1783,2535,2533,2531,2528,1788,2541,2539,906,903,911,2721,1844,2715,2712,1838,1836,2699,2696,2693,2703,1827,1826,1824,2673,2671,2669,2666,1829,2679,2677,1858,1857,2772,1854,1853,1851,1856,2766,2764,143,1987,139,1986,135,133,131,1984,128,1983,125,1981,138,137,136,1985,1133,1132,1130,112,110,1974,107,1973,104,1971,1969,122,121,119,117,1977,114,1976,124,1115,1114,1112,1110,1117,1116,84,83,1953,81,1952,78,1950,1948,1945,94,93,91,1959,88,1958,85,1955,99,97,95,1961,1086,1085,1083,1081,1078,100,1090,1089,1087,1091,49,47,1917,44,1915,1913,1910,1907,59,1926,56,1925,53,1922,1919,66,64,1931,61,1929,1042,1040,1038,71,1035,70,1032,68,1048,1047,1045,1043,1050,1049,12,10,1869,1867,1864,1861,21,1880,19,1877,1874,1871,28,1888,25,1886,22,1883,982,980,977,974,32,30,991,989,987,984,34,995,994,992,2151,2150,2147,2146,2144,356,355,354,2149,2139,2138,2136,2134,1359,343,341,338,2143,335,2141,348,347,346,1376,1374,2124,2123,2121,2119,1326,2116,1324,310,308,305,2131,302,2129,298,2127,320,318,316,313,2133,322,321,1355,1353,1351,1357,2092,2091,2089,2087,1276,2084,1274,2081,1271,259,2102,256,2100,252,2098,2095,272,269,2108,266,2106,281,279,277,1317,1315,1313,1310,282,1321,1319,2039,2037,2035,2032,1203,2029,1200,1197,207,2053,205,2051,201,2049,2046,2043,220,218,2064,215,2062,211,2059,228,226,223,2069,1259,1257,1254,232,1251,230,1267,1265,1263,2316,2315,2312,2311,2309,2314,2304,2303,2301,2299,1593,2308,2306,590,2288,2287,2285,2283,1578,2280,1577,2295,2293,2291,579,577,574,571,2298,582,581,1592,2263,2262,2260,2258,1545,2255,1544,2252,1541,2273,2271,2269,2266,1550,535,532,2279,528,2277,546,543,549,1575,1573,2224,2222,2220,1486,2217,1485,2214,1482,1479,2238,2236,2234,2231,1496,2228,1492,480,477,2248,473,2246,469,2243,490,487,2251,497,1537,1535,1532,2477,2476,2474,2479,2469,2468,2466,2464,1730,2473,2471,2453,2452,2450,2448,1729,2445,1728,2460,2458,2456,2463,805,804,2428,2427,2425,2423,1725,2420,1724,2417,1722,2438,2436,2434,2431,1727,2444,2442,793,791,788,795,2388,2386,2384,1697,2381,1696,2378,1694,1692,2402,2400,2398,2395,1703,2392,1701,2412,2410,2407,751,748,744,2416,759,757,1807,2620,2618,1806,1805,2611,2609,2607,2614,1802,1801,1799,2594,2592,2590,2587,1804,2600,2598,1794,1793,1791,1789,2564,2562,2560,2557,1798,2554,1796,2574,2572,2569,2578,1847,1846,2722,1843,1842,1840,1845,2716,2714,1835,1834,1832,1830,1839,1837,2700,2698,2695,2704,1817,1811,1810,897,862,1777,829,826,838,1760,1758,808,2481,1741,1740,1738,1743,2624,1818,2726,2776,782,740,737,1715,686,679,695,1682,1680,639,628,2339,647,644,1645,1643,1640,1648,602,600,597,595,2320,593,2318,609,607,604,1611,1610,1608,1606,613,1615,1613,2328,926,924,892,886,899,857,850,2505,1778,824,823,821,819,2488,818,2486,833,831,828,840,1761,1759,2649,2632,2630,2746,2734,2732,2782,2781,570,567,1587,531,527,523,540,1566,1564,476,467,463,2240,486,483,1524,1521,1518,1529,411,403,2192,399,2189,423,416,1462,1457,1454,428,1468,1465,2210,366,363,2158,360,2156,357,2153,376,373,370,2163,1410,1409,1407,1405,382,1402,380,1417,1415,1412,1421,2175,2174,777,774,771,784,732,725,722,2404,743,1716,676,674,668,2363,665,2360,685,1684,1681,626,624,622,2335,620,2333,617,2330,641,635,649,1646,1644,1642,2566,928,925,2530,2527,894,891,888,2501,2499,2496,858,856,854,851,1779,2692,2668,2665,2645,2643,2640,2651,2768,2759,2757,2744,2743,2741,2748,352,1382,340,337,333,1371,1369,307,300,296,2126,315,312,1347,1342,1350,261,258,250,2097,246,2094,271,268,264,1306,1301,1298,276,1312,1309,2115,203,2048,195,2045,191,2041,213,209,2056,1246,1244,1238,225,1234,222,1256,1253,1249,1262,2080,2079,154,1997,150,1995,147,1992,1989,163,160,2004,156,2001,1175,1174,1172,1170,1167,170,1164,167,1185,1183,1180,1177,174,1190,1188,2025,2024,2022,587,586,564,559,556,2290,573,1588,520,518,512,2268,508,2265,530,1568,1565,461,457,2233,450,2230,446,2226,479,471,489,1526,1523,1520,397,395,2185,392,2183,389,2180,2177,410,2194,402,422,1463,1461,1459,1456,1470,2455,799,2433,2430,779,776,773,2397,2394,2390,734,728,724,746,1717,2356,2354,2351,2348,1658,677,675,673,670,667,688,1685,1683,2606,2589,2586,2559,2556,2552,927,2523,2521,2518,2515,1784,2532,895,893,890,2718,2709,2707,2689,2687,2684,2663,2662,2660,2658,1825,2667,2769,1852,2760,2758,142,141,1139,1138,134,132,129,126,1982,1129,1128,1126,1131,113,111,108,105,1972,101,1970,120,118,115,1109,1108,1106,1104,123,1113,1111,82,79,1951,75,1949,72,1946,92,89,86,1956,1077,1076,1074,1072,98,1069,96,1084,1082,1079,1088,1968,1967,48,45,1916,42,1914,39,1911,1908,60,57,54,1923,50,1920,1031,1030,1028,1026,67,1023,65,1020,62,1041,1039,1036,1033,69,1046,1044,1944,1943,1941,11,9,1868,7,1865,1862,1859,20,1878,16,1875,13,1872,970,968,966,963,29,960,26,23,983,981,978,975,33,971,31,990,988,985,1906,1904,1902,993,351,2145,1383,331,330,328,326,2137,323,2135,339,1372,1370,294,293,291,289,2122,286,2120,283,2117,309,303,317,1348,1346,1344,245,244,242,2090,239,2088,236,2085,2082,260,2099,249,270,1307,1305,1303,1300,1314,189,2038,186,2036,183,2033,2030,2026,206,198,2047,194,216,1247,1245,1243,1240,227,1237,1255,2310,2302,2300,2286,2284,2281,565,563,561,558,575,1589,2261,2259,2256,2253,1542,521,519,517,514,2270,511,533,1569,1567,2223,2221,2218,2215,1483,2211,1480,459,456,453,2232,449,474,491,1527,1525,1522,2475,2467,2465,2451,2449,2446,801,800,2426,2424,2421,2418,1723,2435,780,778,775,2387,2385,2382,2379,1695,2375,1693,2396,735,733,730,727,749,1718,2616,2615,2604,2603,2601,2584,2583,2581,2579,1800,2591,2550,2549,2547,2545,1792,2542,1790,2558,929,2719,1841,2710,2708,1833,1831,2690,2688,2686,1815,1809,1808,1774,1756,1754,1737,1736,1734,1739,1816,1711,1676,1674,633,629,1638,1636,1633,1641,598,1605,1604,1602,1600,605,1609,1607,2327,887,853,1775,822,820,1757,1755,1584,524,1560,1558,468,464,1514,1511,1508,1519,408,404,400,1452,1447,1444,417,1458,1455,2208,364,361,358,2154,1401,1400,1398,1396,374,1393,371,1408,1406,1403,1413,2173,2172,772,726,723,1712,672,669,666,682,1678,1675,625,623,621,618,2331,636,632,1639,1637,1635,920,918,884,880,889,849,848,847,846,2497,855,852,1776,2641,2742,2787,1380,334,1367,1365,301,297,1340,1338,1335,1343,255,251,247,1296,1291,1288,265,1302,1299,2113,204,196,192,2042,1232,1230,1224,214,1220,210,1242,1239,1235,1250,2077,2075,151,148,1993,144,1990,1163,1162,1160,1158,1155,161,1152,157,1173,1171,1168,1165,168,1181,1178,2021,2020,2018,2023,585,560,557,1585,516,509,1562,1559,458,447,2227,472,1516,1513,1510,398,396,393,390,2181,386,2178,407,1453,1451,1449,1446,420,1460,2209,769,764,720,712,2391,729,1713,664,663,661,659,2352,656,2349,671,1679,1677,2553,922,919,2519,2516,885,883,881,2685,2661,2659,2767,2756,2755,140,1137,1136,130,127,1125,1124,1122,1127,109,106,102,1103,1102,1100,1098,116,1107,1105,1980,80,76,73,1947,1068,1067,1065,1063,90,1060,87,1075,1073,1070,1080,1966,1965,46,43,40,1912,36,1909,1019,1018,1016,1014,58,1011,55,1008,51,1029,1027,1024,1021,63,1037,1034,1940,1939,1937,1942,8,1866,4,1863,1,1860,956,954,952,949,946,17,14,969,967,964,961,27,957,24,979,976,972,1901,1900,1898,1896,986,1905,1903,350,349,1381,329,327,324,1368,1366,292,290,287,284,2118,304,1341,1339,1337,1345,243,240,237,2086,233,2083,254,1297,1295,1293,1290,1304,2114,190,187,184,2034,180,2031,177,2027,199,1233,1231,1229,1226,217,1223,1241,2078,2076,584,555,554,552,550,2282,562,1586,507,506,504,502,2257,499,2254,515,1563,1561,445,443,441,2219,438,2216,435,2212,460,454,475,1517,1515,1512,2447,798,797,2422,2419,770,768,766,2383,2380,2376,721,719,717,714,731,1714,2602,2582,2580,2548,2546,2543,923,921,2717,2706,2705,2683,2682,2680,1771,1752,1750,1733,1732,1731,1735,1814,1707,1670,1668,1631,1629,1626,1634,1599,1598,1596,1594,1603,1601,2326,1772,1753,1751,1581,1554,1552,1504,1501,1498,1509,1442,1437,1434,401,1448,1445,2206,1392,1391,1389,1387,1384,359,1399,1397,1394,1404,2171,2170,1708,1672,1669,619,1632,1630,1628,1773,1378,1363,1361,1333,1328,1336,1286,1281,1278,248,1292,1289,2111,1218,1216,1210,197,1206,193,1228,1225,1221,1236,2073,2071,1151,1150,1148,1146,152,1143,149,1140,145,1161,1159,1156,1153,158,1169,1166,2017,2016,2014,2019,1582,510,1556,1553,452,448,1506,1500,394,391,387,1443,1441,1439,1436,1450,2207,765,716,713,1709,662,660,657,1673,1671,916,914,879,878,877,882,1135,1134,1121,1120,1118,1123,1097,1096,1094,1092,103,1101,1099,1979,1059,1058,1056,1054,77,1051,74,1066,1064,1061,1071,1964,1963,1007,1006,1004,1002,999,41,996,37,1017,1015,1012,1009,52,1025,1022,1936,1935,1933,1938,942,940,938,935,932,5,2,955,953,950,947,18,943,15,965,962,958,1895,1894,1892,1890,973,1899,1897,1379,325,1364,1362,288,285,1334,1332,1330,241,238,234,1287,1285,1283,1280,1294,2112,188,185,181,178,2028,1219,1217,1215,1212,200,1209,1227,2074,2072,583,553,551,1583,505,503,500,513,1557,1555,444,442,439,436,2213,455,451,1507,1505,1502,796,763,762,760,767,711,710,708,706,2377,718,715,1710,2544,917,915,2681,1627,1597,1595,2325,1769,1749,1747,1499,1438,1435,2204,1390,1388,1385,1395,2169,2167,1704,1665,1662,1625,1623,1620,1770,1329,1282,1279,2109,1214,1207,1222,2068,2065,1149,1147,1144,1141,146,1157,1154,2013,2011,2008,2015,1579,1549,1546,1495,1487,1433,1431,1428,1425,388,1440,2205,1705,658,1667,1664,1119,1095,1093,1978,1057,1055,1052,1062,1962,1960,1005,1003,1e3,997,38,1013,1010,1932,1930,1927,1934,941,939,936,933,6,930,3,951,948,944,1889,1887,1884,1881,959,1893,1891,35,1377,1360,1358,1327,1325,1322,1331,1277,1275,1272,1269,235,1284,2110,1205,1204,1201,1198,182,1195,179,1213,2070,2067,1580,501,1551,1548,440,437,1497,1494,1490,1503,761,709,707,1706,913,912,2198,1386,2164,2161,1621,1766,2103,1208,2058,2054,1145,1142,2005,2002,1999,2009,1488,1429,1426,2200,1698,1659,1656,1975,1053,1957,1954,1001,998,1924,1921,1918,1928,937,934,931,1879,1876,1873,1870,945,1885,1882,1323,1273,1270,2105,1202,1199,1196,1211,2061,2057,1576,1543,1540,1484,1481,1478,1491,1700]),r}(),jR=function(){function r(t,e){this.bits=t,this.points=e}return r.prototype.getBits=function(){return this.bits},r.prototype.getPoints=function(){return this.points},r}(),WR=globalThis&&globalThis.__values||function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},zR=function(){function r(){}return r.detectMultiple=function(t,e,n){var i=t.getBlackMatrix(),a=r.detect(n,i);return a.length||(i=i.clone(),i.rotate180(),a=r.detect(n,i)),new jR(i,a)},r.detect=function(t,e){for(var n,i,a=new Array,o=0,s=0,u=!1;o0;){var d=r.findGuardPattern(t,a,--i,n,!1,o,c);if(d!=null)l=d;else{i++;break}}s[0]=new yt(l[0],i),s[1]=new yt(l[1],i),u=!0;break}}var h=i+1;if(u){for(var f=0,d=Int32Array.from([Math.trunc(s[0].getX()),Math.trunc(s[1].getX())]);hr.SKIPPED_ROW_COUNT_MAX)break;f++}}h-=f+1,s[2]=new yt(d[0],h),s[3]=new yt(d[1],h)}return h-i0&&c++h?d-h:h-d;if(f>n)return 1/0;c+=f}return c/a},r.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]),r.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]),r.MAX_AVG_VARIANCE=.42,r.MAX_INDIVIDUAL_VARIANCE=.8,r.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]),r.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]),r.MAX_PIXEL_DRIFT=3,r.MAX_PATTERN_DRIFT=5,r.SKIPPED_ROW_COUNT_MAX=25,r.ROW_STEP=5,r.BARCODE_MIN_HEIGHT=10,r}(),HR=globalThis&&globalThis.__values||function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Rs=function(){function r(t,e){if(e.length===0)throw new Bt;this.field=t;var n=e.length;if(n>1&&e[0]===0){for(var i=1;in.length){var i=e;e=n,n=i}var a=new Int32Array(n.length),o=n.length-e.length;zr.arraycopy(n,0,a,0,o);for(var s=o;s=0;e--){var n=this.getCoefficient(e);n!==0&&(n<0?(t.append(" - "),n=-n):t.length()>0&&t.append(" + "),(e===0||n!==1)&&t.append(n),e!==0&&(e===1?t.append("x"):(t.append("x^"),t.append(e))))}return t.toString()},r}(),$R=function(){function r(){}return r.prototype.add=function(t,e){return(t+e)%this.modulus},r.prototype.subtract=function(t,e){return(this.modulus+t-e)%this.modulus},r.prototype.exp=function(t){return this.expTable[t]},r.prototype.log=function(t){if(t===0)throw new Bt;return this.logTable[t]},r.prototype.inverse=function(t){if(t===0)throw new jy;return this.expTable[this.modulus-this.logTable[t]-1]},r.prototype.multiply=function(t,e){return t===0||e===0?0:this.expTable[(this.logTable[t]+this.logTable[e])%(this.modulus-1)]},r.prototype.getSize=function(){return this.modulus},r.prototype.equals=function(t){return t===this},r}(),VR=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),qR=function(r){VR(t,r);function t(e,n){var i=r.call(this)||this;i.modulus=e,i.expTable=new Int32Array(e),i.logTable=new Int32Array(e);for(var a=1,o=0;o=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},XR=function(){function r(){this.field=qR.PDF417_GF}return r.prototype.decode=function(t,e,n){for(var i,a,o=new Rs(this.field,t),s=new Int32Array(e),u=!1,c=e;c>0;c--){var l=o.evaluateAt(this.field.exp(c));s[e-c]=l,l!==0&&(u=!0)}if(!u)return 0;var d=this.field.getOne();if(n!=null)try{for(var h=GR(n),f=h.next();!f.done;f=h.next()){var g=f.value,m=this.field.exp(t.length-1-g),p=new Rs(this.field,new Int32Array([this.field.subtract(0,m),1]));d=d.multiply(p)}}catch(W){i={error:W}}finally{try{f&&!f.done&&(a=h.return)&&a.call(h)}finally{if(i)throw i.error}}for(var y=new Rs(this.field,s),v=this.runEuclideanAlgorithm(this.field.buildMonomial(e,1),y,e),b=v[0],E=v[1],D=this.findErrorLocations(b),F=this.findErrorMagnitudes(E,b,D),c=0;c=Math.round(n/2);){var c=a,l=s;if(a=o,s=u,a.isZero())throw bn.getChecksumInstance();o=c;for(var d=this.field.getZero(),h=a.getCoefficient(a.getDegree()),f=this.field.inverse(h);o.getDegree()>=a.getDegree()&&!o.isZero();){var g=o.getDegree()-a.getDegree(),m=this.field.multiply(o.getCoefficient(o.getDegree()),f);d=d.add(this.field.buildMonomial(g,m)),o=o.subtract(a.multiplyByMonomial(g,m))}u=d.multiply(s).subtract(l).negative()}var p=u.getCoefficient(0);if(p===0)throw bn.getChecksumInstance();var y=this.field.inverse(p),v=u.multiply(y),b=o.multiply(y);return[v,b]},r.prototype.findErrorLocations=function(t){for(var e=t.getDegree(),n=new Int32Array(e),i=0,a=1;a0){var u=n?this.topLeft:this.topRight,c=Math.trunc(u.getY()-t);c<0&&(c=0);var l=new yt(u.getX(),c);n?i=l:o=l}if(e>0){var d=n?this.bottomLeft:this.bottomRight,h=Math.trunc(d.getY()+e);h>=this.image.getHeight()&&(h=this.image.getHeight()-1);var f=new yt(d.getX(),h);n?a=f:s=f}return new r(this.image,i,a,o,s)},r.prototype.getMinX=function(){return this.minX},r.prototype.getMaxX=function(){return this.maxX},r.prototype.getMinY=function(){return this.minY},r.prototype.getMaxY=function(){return this.maxY},r.prototype.getTopLeft=function(){return this.topLeft},r.prototype.getTopRight=function(){return this.topRight},r.prototype.getBottomLeft=function(){return this.bottomLeft},r.prototype.getBottomRight=function(){return this.bottomRight},r}(),KR=function(){function r(t,e,n,i){this.columnCount=t,this.errorCorrectionLevel=i,this.rowCountUpperPart=e,this.rowCountLowerPart=n,this.rowCount=e+n}return r.prototype.getColumnCount=function(){return this.columnCount},r.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},r.prototype.getRowCount=function(){return this.rowCount},r.prototype.getRowCountUpperPart=function(){return this.rowCountUpperPart},r.prototype.getRowCountLowerPart=function(){return this.rowCountLowerPart},r}(),q0=function(){function r(){this.buffer=""}return r.form=function(t,e){var n=-1;function i(o,s,u,c,l,d){if(o==="%%")return"%";if(e[++n]!==void 0){o=c?parseInt(c.substr(1)):void 0;var h=l?parseInt(l.substr(1)):void 0,f;switch(d){case"s":f=e[n];break;case"c":f=e[n][0];break;case"f":f=parseFloat(e[n]).toFixed(o);break;case"p":f=parseFloat(e[n]).toPrecision(o);break;case"e":f=parseFloat(e[n]).toExponential(o);break;case"x":f=parseInt(e[n]).toString(h||16);break;case"d":f=parseFloat(parseInt(e[n],h||10).toPrecision(o)).toFixed(0);break}f=typeof f=="object"?JSON.stringify(f):(+f).toString(h);for(var g=parseInt(u),m=u&&u[0]+""=="0"?"0":" ";f.length=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},db=function(){function r(t){this.boundingBox=new V0(t),this.codewords=new Array(t.getMaxY()-t.getMinY()+1)}return r.prototype.getCodewordNearby=function(t){var e=this.getCodeword(t);if(e!=null)return e;for(var n=1;n=0&&(e=this.codewords[i],e!=null)||(i=this.imageRowToCodewordIndex(t)+n,i=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},JR=globalThis&&globalThis.__read||function(r,t){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var n=e.call(r),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(o)throw o.error}}return a},Xc=function(){function r(){this.values=new Map}return r.prototype.setValue=function(t){t=Math.trunc(t);var e=this.values.get(t);e==null&&(e=0),e++,this.values.set(t,e)},r.prototype.getValue=function(){var t,e,n=-1,i=new Array,a=function(d,h){var f={getKey:function(){return d},getValue:function(){return h}};f.getValue()>n?(n=f.getValue(),i=[],i.push(f.getKey())):f.getValue()===n&&i.push(f.getKey())};try{for(var o=YR(this.values.entries()),s=o.next();!s.done;s=o.next()){var u=JR(s.value,2),c=u[0],l=u[1];a(c,l)}}catch(d){t={error:d}}finally{try{s&&!s.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}return vr.toIntArray(i)},r.prototype.getConfidence=function(t){return this.values.get(t)},r}(),QR=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),G0=globalThis&&globalThis.__values||function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},pb=function(r){QR(t,r);function t(e,n){var i=r.call(this,e)||this;return i._isLeft=n,i}return t.prototype.setRowNumbers=function(){var e,n;try{for(var i=G0(this.getCodewords()),a=i.next();!a.done;a=i.next()){var o=a.value;o!=null&&o.setRowNumberAsRowIndicatorColumn()}}catch(s){e={error:s}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}},t.prototype.adjustCompleteIndicatorColumnRowNumbers=function(e){var n=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(n,e);for(var i=this.getBoundingBox(),a=this._isLeft?i.getTopLeft():i.getTopRight(),o=this._isLeft?i.getBottomLeft():i.getBottomRight(),s=this.imageRowToCodewordIndex(Math.trunc(a.getY())),u=this.imageRowToCodewordIndex(Math.trunc(o.getY())),c=-1,l=1,d=0,h=s;h=e.getRowCount()||g>h)n[h]=null;else{var m=void 0;l>2?m=(l-2)*g:m=g;for(var p=m>=h,y=1;y<=m&&!p;y++)p=n[h-y]!=null;p?n[h]=null:(c=f.getRowNumber(),d=1)}}},t.prototype.getRowHeights=function(){var e,n,i=this.getBarcodeMetadata();if(i==null)return null;this.adjustIncompleteIndicatorColumnRowNumbers(i);var a=new Int32Array(i.getRowCount());try{for(var o=G0(this.getCodewords()),s=o.next();!s.done;s=o.next()){var u=s.value;if(u!=null){var c=u.getRowNumber();if(c>=a.length)continue;a[c]++}}}catch(l){e={error:l}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return a},t.prototype.adjustIncompleteIndicatorColumnRowNumbers=function(e){for(var n=this.getBoundingBox(),i=this._isLeft?n.getTopLeft():n.getTopRight(),a=this._isLeft?n.getBottomLeft():n.getBottomRight(),o=this.imageRowToCodewordIndex(Math.trunc(i.getY())),s=this.imageRowToCodewordIndex(Math.trunc(a.getY())),u=this.getCodewords(),c=-1,l=o;l=e.getRowCount()?u[l]=null:c=d.getRowNumber())}},t.prototype.getBarcodeMetadata=function(){var e,n,i=this.getCodewords(),a=new Xc,o=new Xc,s=new Xc,u=new Xc;try{for(var c=G0(i),l=c.next();!l.done;l=c.next()){var d=l.value;if(d!=null){d.setRowNumberAsRowIndicatorColumn();var h=d.getValue()%30,f=d.getRowNumber();switch(this._isLeft||(f+=2),f%3){case 0:o.setValue(h*3+1);break;case 1:u.setValue(h/3),s.setValue(h%3);break;case 2:a.setValue(h+1);break}}}}catch(m){e={error:m}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}if(a.getValue().length===0||o.getValue().length===0||s.getValue().length===0||u.getValue().length===0||a.getValue()[0]<1||o.getValue()[0]+s.getValue()[0]vr.MAX_ROWS_IN_BARCODE)return null;var g=new KR(a.getValue()[0],o.getValue()[0],s.getValue()[0],u.getValue()[0]);return this.removeIncorrectCodewords(i,g),g},t.prototype.removeIncorrectCodewords=function(e,n){for(var i=0;in.getRowCount()){e[i]=null;continue}switch(this._isLeft||(s+=2),s%3){case 0:o*3+1!==n.getRowCountUpperPart()&&(e[i]=null);break;case 1:(Math.trunc(o/3)!==n.getErrorCorrectionLevel()||o%3!==n.getRowCountLowerPart())&&(e[i]=null);break;case 2:o+1!==n.getColumnCount()&&(e[i]=null);break}}}},t.prototype.isLeft=function(){return this._isLeft},t.prototype.toString=function(){return"IsLeft: "+this._isLeft+` `+r.prototype.toString.call(this)},t}(db),eN=globalThis&&globalThis.__values||function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},tN=function(){function r(t,e){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=t,this.barcodeColumnCount=t.getColumnCount(),this.boundingBox=e,this.detectionResultColumns=new Array(this.barcodeColumnCount+2)}return r.prototype.getDetectionResultColumns=function(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);var t=vr.MAX_CODEWORDS_IN_BARCODE,e;do e=t,t=this.adjustRowNumbersAndGetCount();while(t>0&&t0&&a0&&(c[0]=n[e-1],c[4]=s[e-1],c[5]=u[e-1]),e>1&&(c[8]=n[e-2],c[10]=s[e-2],c[11]=u[e-2]),e>=1;n=e&1,r.RATIOS_TABLE[t]||(r.RATIOS_TABLE[t]=new Array(vr.BARS_IN_MODULE)),r.RATIOS_TABLE[t][vr.BARS_IN_MODULE-i-1]=Math.fround(a/vr.MODULES_IN_CODEWORD)}this.bSymbolTableReady=!0},r.getDecodedValue=function(t){var e=r.getDecodedCodewordValue(r.sampleBitCounts(t));return e!==-1?e:r.getClosestDecodedValue(t)},r.sampleBitCounts=function(t){for(var e=yr.sum(t),n=new Int32Array(vr.BARS_IN_MODULE),i=0,a=0,o=0;o1)for(var i=0;i=a)break}ut.length||n<0||e+n>t.length||e+n<0)throw new I0;if(n===0)return;for(var i=0;i0&&this.grow(e)},t.prototype.grow=function(e){var n=this.buf.length,i=n<<1;if(i-e<0&&(i=e),i<0){if(e<0)throw new cN;i=ln.MAX_VALUE}this.buf=Tn.copyOfUint8Array(this.buf,i)},t.prototype.write=function(e){this.ensureCapacity(this.count+1),this.buf[this.count]=e,this.count+=1},t.prototype.writeBytesOffset=function(e,n,i){if(n<0||n>e.length||i<0||n+i-e.length>0)throw new I0;this.ensureCapacity(this.count+i),zr.arraycopy(e,n,this.buf,this.count,i),this.count+=i},t.prototype.writeTo=function(e){e.writeBytesOffset(this.buf,0,this.count)},t.prototype.reset=function(){this.count=0},t.prototype.toByteArray=function(){return Tn.copyOfUint8Array(this.buf,this.count)},t.prototype.size=function(){return this.count},t.prototype.toString=function(e){return e?typeof e=="string"?this.toString_string(e):this.toString_number(e):this.toString_void()},t.prototype.toString_void=function(){return new String(this.buf).toString()},t.prototype.toString_string=function(e){return new String(this.buf).toString()},t.prototype.toString_number=function(e){return new String(this.buf).toString()},t.prototype.close=function(){},t}(sN),Mr;(function(r){r[r.ALPHA=0]="ALPHA",r[r.LOWER=1]="LOWER",r[r.MIXED=2]="MIXED",r[r.PUNCT=3]="PUNCT",r[r.ALPHA_SHIFT=4]="ALPHA_SHIFT",r[r.PUNCT_SHIFT=5]="PUNCT_SHIFT"})(Mr||(Mr={}));function gb(){if(typeof window!="undefined")return window.BigInt||null;if(typeof global!="undefined")return global.BigInt||null;if(typeof self!="undefined")return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}var Ah;function Yo(r){if(typeof Ah=="undefined"&&(Ah=gb()),Ah===null)throw new Error("BigInt is not supported!");return Ah(r)}function hN(){var r=[];r[0]=Yo(1);var t=Yo(900);r[1]=t;for(var e=2;e<16;e++)r[e]=r[e-1]*t;return r}var dN=function(){function r(){}return r.decode=function(t,e){var n=new er(""),i=Sn.ISO8859_1;n.enableDecoding(i);for(var a=1,o=t[a++],s=new iN;at[0])throw ct.getFormatInstance();for(var i=new Int32Array(r.NUMBER_OF_SEQUENCE_CODEWORDS),a=0;a0){for(var h=0;h<6;++h)o.write(Number(Yo(u)>>Yo(8*(5-h))));u=0,s=0}break}i===e[0]&&d0){for(var h=0;h<6;++h)o.write(Number(Yo(u)>>Yo(8*(5-h))));u=0,s=0}}break}return a.append(ta.decode(o.toByteArray(),n)),i},r.numericCompaction=function(t,e,n){for(var i=0,a=!1,o=new Int32Array(r.MAX_NUMERIC_CODEWORDS);e0&&(n.append(r.decodeBase900toBase10(o,i)),i=0)}return e},r.decodeBase900toBase10=function(t,e){for(var n=Yo(0),i=0;i@[\\]_\`~!\r ,: -.$/"|*()?{}'`,r.MIXED_CHARS="0123456789&\r ,:#-.$/+%*=^",r.EXP900=gb()?hN():[],r.NUMBER_OF_SEQUENCE_CODEWORDS=2,r}(),Kc=globalThis&&globalThis.__values||function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},pN=function(){function r(){}return r.decode=function(t,e,n,i,a,o,s){for(var u=new V0(t,e,n,i,a),c=null,l=null,d,h=!0;;h=!1){if(e!=null&&(c=r.getRowIndicatorColumn(t,u,e,!0,o,s)),i!=null&&(l=r.getRowIndicatorColumn(t,u,i,!1,o,s)),d=r.merge(c,l),d==null)throw ze.getNotFoundInstance();var f=d.getBoundingBox();if(h&&f!=null&&(f.getMinY()u.getMaxY()))u=f;else break}d.setBoundingBox(u);var g=d.getBarcodeColumnCount()+1;d.setDetectionResultColumn(0,c),d.setDetectionResultColumn(g,l);for(var m=c!=null,p=1;p<=g;p++){var y=m?p:g-p;if(d.getDetectionResultColumn(y)===void 0){var v=void 0;y===0||y===g?v=new pb(u,y===0):v=new db(u),d.setDetectionResultColumn(y,v);for(var b=-1,E=b,D=u.getMinY();D<=u.getMaxY();D++){if(b=r.getStartColumn(d,y,D,m),b<0||b>u.getMaxX()){if(E===-1)continue;b=E}var F=r.detectCodeword(t,u.getMinX(),u.getMaxX(),m,b,D,o,s);F!=null&&(v.setCodeword(D,F),E=b,o=Math.min(o,F.getWidth()),s=Math.max(s,F.getWidth()))}}}return r.createDecoderResult(d)},r.merge=function(t,e){if(t==null&&e==null)return null;var n=r.getBarcodeMetadata(t,e);if(n==null)return null;var i=V0.merge(r.adjustBoundingBox(t),r.adjustBoundingBox(e));return new tN(n,i)},r.adjustBoundingBox=function(t){var e,n;if(t==null)return null;var i=t.getRowHeights();if(i==null)return null;var a=r.getMax(i),o=0;try{for(var s=Kc(i),u=s.next();!u.done;u=s.next()){var c=u.value;if(o+=a-c,c>0)break}}catch(f){e={error:f}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}for(var l=t.getCodewords(),d=0;o>0&&l[d]==null;d++)o--;for(var h=0,d=i.length-1;d>=0&&(h+=a-i[d],!(i[d]>0));d--);for(var d=l.length-1;h>0&&l[d]==null;d--)h--;return t.getBoundingBox().addMissingRows(o,h,t.isLeft())},r.getMax=function(t){var e,n,i=-1;try{for(var a=Kc(t),o=a.next();!o.done;o=a.next()){var s=o.value;i=Math.max(i,s)}}catch(u){e={error:u}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}return i},r.getBarcodeMetadata=function(t,e){var n;if(t==null||(n=t.getBarcodeMetadata())==null)return e==null?null:e.getBarcodeMetadata();var i;return e==null||(i=e.getBarcodeMetadata())==null?n:n.getColumnCount()!==i.getColumnCount()&&n.getErrorCorrectionLevel()!==i.getErrorCorrectionLevel()&&n.getRowCount()!==i.getRowCount()?null:n},r.getRowIndicatorColumn=function(t,e,n,i,a,o){for(var s=new pb(e,i),u=0;u<2;u++)for(var c=u===0?1:-1,l=Math.trunc(Math.trunc(n.getX())),d=Math.trunc(Math.trunc(n.getY()));d<=e.getMaxY()&&d>=e.getMinY();d+=c){var h=r.detectCodeword(t,0,t.getWidth(),i,l,d,a,o);h!=null&&(s.setCodeword(d,h),i?l=h.getStartX():l=h.getEndX())}return s},r.adjustCodewordCount=function(t,e){var n=e[0][1],i=n.getValue(),a=t.getBarcodeColumnCount()*t.getBarcodeRowCount()-r.getNumberOfECCodeWords(t.getBarcodeECLevel());if(i.length===0){if(a<1||a>vr.MAX_CODEWORDS_IN_BARCODE)throw ze.getNotFoundInstance();n.setValue(a)}else i[0]!==a&&n.setValue(a)},r.createDecoderResult=function(t){var e=r.createBarcodeMatrix(t);r.adjustCodewordCount(t,e);for(var n=new Array,i=new Int32Array(t.getBarcodeRowCount()*t.getBarcodeColumnCount()),a=[],o=new Array,s=0;s0;){for(var u=0;u=0){if(p>=o.length)continue;o[p][c].setValue(m.getValue())}}}}catch(y){i={error:y}}finally{try{g&&!g.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}c++}}catch(y){e={error:y}}finally{try{d&&!d.done&&(n=l.return)&&n.call(l)}finally{if(e)throw e.error}}return o},r.isValidBarcodeColumn=function(t,e){return e>=0&&e<=t.getBarcodeColumnCount()+1},r.getStartColumn=function(t,e,n,i){var a,o,s=i?1:-1,u=null;if(r.isValidBarcodeColumn(t,e-s)&&(u=t.getDetectionResultColumn(e-s).getCodeword(n)),u!=null)return i?u.getEndX():u.getStartX();if(u=t.getDetectionResultColumn(e).getCodewordNearby(n),u!=null)return i?u.getStartX():u.getEndX();if(r.isValidBarcodeColumn(t,e-s)&&(u=t.getDetectionResultColumn(e-s).getCodewordNearby(n)),u!=null)return i?u.getEndX():u.getStartX();for(var c=0;r.isValidBarcodeColumn(t,e-s);){e-=s;try{for(var l=(a=void 0,Kc(t.getDetectionResultColumn(e).getCodewords())),d=l.next();!d.done;d=l.next()){var h=d.value;if(h!=null)return(i?h.getEndX():h.getStartX())+s*c*(h.getEndX()-h.getStartX())}}catch(f){a={error:f}}finally{try{d&&!d.done&&(o=l.return)&&o.call(l)}finally{if(a)throw a.error}}c++}return i?t.getBoundingBox().getMinX():t.getBoundingBox().getMaxX()},r.detectCodeword=function(t,e,n,i,a,o,s,u){a=r.adjustCodewordStartColumn(t,e,n,i,a,o);var c=r.getModuleBitCount(t,e,n,i,a,o);if(c==null)return null;var l,d=yr.sum(c);if(i)l=a+d;else{for(var h=0;h=e)&&c=e:sr.CODEWORD_SKEW_SIZE)return a;s+=u}u=-u,i=!i}return s},r.checkCodewordSkew=function(t,e,n){return e-r.CODEWORD_SKEW_SIZE<=t&&t<=n+r.CODEWORD_SKEW_SIZE},r.decodeCodewords=function(t,e,n){if(t.length===0)throw ct.getFormatInstance();var i=1<n/2+r.MAX_ERRORS||n<0||n>r.MAX_EC_CODEWORDS)throw bn.getChecksumInstance();return r.errorCorrection.decode(t,n,e)},r.verifyCodewordCount=function(t,e){if(t.length<4)throw ct.getFormatInstance();var n=t[0];if(n>t.length)throw ct.getFormatInstance();if(n===0)if(e>=1;return e},r.getCodewordBucketNumber=function(t){return t instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(t):this.getCodewordBucketNumber_number(t)},r.getCodewordBucketNumber_number=function(t){return r.getCodewordBucketNumber(r.getBitCountForCodeword(t))},r.getCodewordBucketNumber_Int32Array=function(t){return(t[0]-t[2]+t[4]-t[6]+9)%9},r.toString=function(t){for(var e=new q0,n=0;n=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Th=function(){function r(){}return r.prototype.decode=function(t,e){e===void 0&&(e=null);var n=r.decode(t,e,!1);if(n==null||n.length===0||n[0]==null)throw ze.getNotFoundInstance();return n[0]},r.prototype.decodeMultiple=function(t,e){e===void 0&&(e=null);try{return r.decode(t,e,!0)}catch(n){throw n instanceof ct||n instanceof bn?ze.getNotFoundInstance():n}},r.decode=function(t,e,n){var i,a,o=new Array,s=zR.detectMultiple(t,e,n);try{for(var u=mN(s.getPoints()),c=u.next();!c.done;c=u.next()){var l=c.value,d=pN.decode(s.getBits(),l[4],l[5],l[6],l[7],r.getMinCodewordWidth(l),r.getMaxCodewordWidth(l)),h=new Yn(d.getText(),d.getRawBytes(),void 0,l,It.PDF_417);h.putMetadata(zn.ERROR_CORRECTION_LEVEL,d.getECLevel());var f=d.getOther();f!=null&&h.putMetadata(zn.PDF417_EXTRA_METADATA,f),o.push(h)}}catch(g){i={error:g}}finally{try{c&&!c.done&&(a=u.return)&&a.call(u)}finally{if(i)throw i.error}}return o.map(function(g){return g})},r.getMaxWidth=function(t,e){return t==null||e==null?0:Math.trunc(Math.abs(t.getX()-e.getX()))},r.getMinWidth=function(t,e){return t==null||e==null?ln.MAX_VALUE:Math.trunc(Math.abs(t.getX()-e.getX()))},r.getMaxCodewordWidth=function(t){return Math.floor(Math.max(Math.max(r.getMaxWidth(t[0],t[4]),r.getMaxWidth(t[6],t[2])*vr.MODULES_IN_CODEWORD/vr.MODULES_IN_STOP_PATTERN),Math.max(r.getMaxWidth(t[1],t[5]),r.getMaxWidth(t[7],t[3])*vr.MODULES_IN_CODEWORD/vr.MODULES_IN_STOP_PATTERN)))},r.getMinCodewordWidth=function(t){return Math.floor(Math.min(Math.min(r.getMinWidth(t[0],t[4]),r.getMinWidth(t[6],t[2])*vr.MODULES_IN_CODEWORD/vr.MODULES_IN_STOP_PATTERN),Math.min(r.getMinWidth(t[1],t[5]),r.getMinWidth(t[7],t[3])*vr.MODULES_IN_CODEWORD/vr.MODULES_IN_STOP_PATTERN)))},r.prototype.reset=function(){},r}(),gN=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),vb=function(r){gN(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="ReaderException",t}(Ai),yb=globalThis&&globalThis.__values||function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},bb=function(){function r(){}return r.prototype.decode=function(t,e){return this.setHints(e),this.decodeInternal(t)},r.prototype.decodeWithState=function(t){return(this.readers===null||this.readers===void 0)&&this.setHints(null),this.decodeInternal(t)},r.prototype.setHints=function(t){this.hints=t;var e=t!=null&&t.get(Hr.TRY_HARDER)!==void 0,n=t==null?null:t.get(Hr.POSSIBLE_FORMATS),i=new Array;if(n!=null){var a=n.some(function(o){return o===It.UPC_A||o===It.UPC_E||o===It.EAN_13||o===It.EAN_8||o===It.CODABAR||o===It.CODE_39||o===It.CODE_93||o===It.CODE_128||o===It.ITF||o===It.RSS_14||o===It.RSS_EXPANDED});a&&!e&&i.push(new xu(t)),n.includes(It.QR_CODE)&&i.push(new Eh),n.includes(It.DATA_MATRIX)&&i.push(new xh),n.includes(It.AZTEC)&&i.push(new vh),n.includes(It.PDF_417)&&i.push(new Th),a&&e&&i.push(new xu(t))}i.length===0&&(e||i.push(new xu(t)),i.push(new Eh),i.push(new xh),i.push(new vh),i.push(new Th),e&&i.push(new xu(t))),this.readers=i},r.prototype.reset=function(){var t,e;if(this.readers!==null)try{for(var n=yb(this.readers),i=n.next();!i.done;i=n.next()){var a=i.value;a.reset()}}catch(o){t={error:o}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}},r.prototype.decodeInternal=function(t){var e,n;if(this.readers===null)throw new vb("No readers where selected, nothing can be read.");try{for(var i=yb(this.readers),a=i.next();!a.done;a=i.next()){var o=a.value;try{return o.decode(t,this.hints)}catch(s){if(s instanceof vb)continue}}}catch(s){e={error:s}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}throw new ze("No MultiFormat Readers were able to detect the code.")},r}(),vN=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}();(function(r){vN(t,r);function t(e,n){e===void 0&&(e=null),n===void 0&&(n=500);var i=this,a=new bb;return a.setHints(e),i=r.call(this,a,n)||this,i}return t.prototype.decodeBitmap=function(e){return this.reader.decodeWithState(e)},t})(vu);var yN=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}();(function(r){yN(t,r);function t(e){return e===void 0&&(e=500),r.call(this,new Th,e)||this}return t})(vu);var bN=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}();(function(r){bN(t,r);function t(e){return e===void 0&&(e=500),r.call(this,new Eh,e)||this}return t})(vu);var X0;(function(r){r[r.ERROR_CORRECTION=0]="ERROR_CORRECTION",r[r.CHARACTER_SET=1]="CHARACTER_SET",r[r.DATA_MATRIX_SHAPE=2]="DATA_MATRIX_SHAPE",r[r.DATA_MATRIX_COMPACT=3]="DATA_MATRIX_COMPACT",r[r.MIN_SIZE=4]="MIN_SIZE",r[r.MAX_SIZE=5]="MAX_SIZE",r[r.MARGIN=6]="MARGIN",r[r.PDF417_COMPACT=7]="PDF417_COMPACT",r[r.PDF417_COMPACTION=8]="PDF417_COMPACTION",r[r.PDF417_DIMENSIONS=9]="PDF417_DIMENSIONS",r[r.AZTEC_LAYERS=10]="AZTEC_LAYERS",r[r.QR_VERSION=11]="QR_VERSION",r[r.GS1_FORMAT=12]="GS1_FORMAT",r[r.FORCE_C40=13]="FORCE_C40"})(X0||(X0={}));var Jo=X0,wN=function(){function r(t){this.field=t,this.cachedGenerators=[],this.cachedGenerators.push(new Xo(t,Int32Array.from([1])))}return r.prototype.buildGenerator=function(t){var e=this.cachedGenerators;if(t>=e.length)for(var n=e[e.length-1],i=this.field,a=e.length;a<=t;a++){var o=n.multiply(new Xo(i,Int32Array.from([1,i.exp(a-1+i.getGeneratorBase())])));e.push(o),n=o}return e[t]},r.prototype.encode=function(t,e){if(e===0)throw new Bt("No error correction bytes");var n=t.length-e;if(n<=0)throw new Bt("No data bytes provided");var i=this.buildGenerator(e),a=new Int32Array(n);zr.arraycopy(t,0,a,0,n);var o=new Xo(this.field,a);o=o.multiplyByMonomial(e,1);for(var s=o.divide(i)[1],u=s.getCoefficients(),c=e-u.length,l=0;l=5&&(n+=r.N1+(u-5)),u=1,c=d)}u>=5&&(n+=r.N1+(u-5))}return n},r.N1=3,r.N2=3,r.N3=40,r.N4=10,r}(),_N=globalThis&&globalThis.__values||function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},xN=function(){function r(t,e){this.width=t,this.height=e;for(var n=new Array(e),i=0;i!==e;i++)n[i]=new Uint8Array(t);this.bytes=n}return r.prototype.getHeight=function(){return this.height},r.prototype.getWidth=function(){return this.width},r.prototype.get=function(t,e){return this.bytes[e][t]},r.prototype.getArray=function(){return this.bytes},r.prototype.setNumber=function(t,e,n){this.bytes[e][t]=n},r.prototype.setBoolean=function(t,e,n){this.bytes[e][t]=n?1:0},r.prototype.clear=function(t){var e,n;try{for(var i=_N(this.bytes),a=i.next();!a.done;a=i.next()){var o=a.value;Tn.fill(o,t)}}catch(s){e={error:s}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}},r.prototype.equals=function(t){if(!(t instanceof r))return!1;var e=t;if(this.width!==e.width||this.height!==e.height)return!1;for(var n=0,i=this.height;n> `),t.toString()},r.prototype.setMode=function(t){this.mode=t},r.prototype.setECLevel=function(t){this.ecLevel=t},r.prototype.setVersion=function(t){this.version=t},r.prototype.setMaskPattern=function(t){this.maskPattern=t},r.prototype.setMatrix=function(t){this.matrix=t},r.isValidMaskPattern=function(t){return t>=0&&t0;){for(o===6&&(o-=1);s>=0&&s=n;)t^=e<=0)for(var u=0;u!==o;u++){var c=i[u];c>=0&&r.isEmpty(e.get(c,s))&&r.embedPositionAdjustmentPattern(c-2,s-2,e)}}},r.POSITION_DETECTION_PATTERN=Array.from([Int32Array.from([1,1,1,1,1,1,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,1,1,1,1,1,1])]),r.POSITION_ADJUSTMENT_PATTERN=Array.from([Int32Array.from([1,1,1,1,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,0,1,0,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,1,1,1,1])]),r.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE=Array.from([Int32Array.from([-1,-1,-1,-1,-1,-1,-1]),Int32Array.from([6,18,-1,-1,-1,-1,-1]),Int32Array.from([6,22,-1,-1,-1,-1,-1]),Int32Array.from([6,26,-1,-1,-1,-1,-1]),Int32Array.from([6,30,-1,-1,-1,-1,-1]),Int32Array.from([6,34,-1,-1,-1,-1,-1]),Int32Array.from([6,22,38,-1,-1,-1,-1]),Int32Array.from([6,24,42,-1,-1,-1,-1]),Int32Array.from([6,26,46,-1,-1,-1,-1]),Int32Array.from([6,28,50,-1,-1,-1,-1]),Int32Array.from([6,30,54,-1,-1,-1,-1]),Int32Array.from([6,32,58,-1,-1,-1,-1]),Int32Array.from([6,34,62,-1,-1,-1,-1]),Int32Array.from([6,26,46,66,-1,-1,-1]),Int32Array.from([6,26,48,70,-1,-1,-1]),Int32Array.from([6,26,50,74,-1,-1,-1]),Int32Array.from([6,30,54,78,-1,-1,-1]),Int32Array.from([6,30,56,82,-1,-1,-1]),Int32Array.from([6,30,58,86,-1,-1,-1]),Int32Array.from([6,34,62,90,-1,-1,-1]),Int32Array.from([6,28,50,72,94,-1,-1]),Int32Array.from([6,26,50,74,98,-1,-1]),Int32Array.from([6,30,54,78,102,-1,-1]),Int32Array.from([6,28,54,80,106,-1,-1]),Int32Array.from([6,32,58,84,110,-1,-1]),Int32Array.from([6,30,58,86,114,-1,-1]),Int32Array.from([6,34,62,90,118,-1,-1]),Int32Array.from([6,26,50,74,98,122,-1]),Int32Array.from([6,30,54,78,102,126,-1]),Int32Array.from([6,26,52,78,104,130,-1]),Int32Array.from([6,30,56,82,108,134,-1]),Int32Array.from([6,34,60,86,112,138,-1]),Int32Array.from([6,30,58,86,114,142,-1]),Int32Array.from([6,34,62,90,118,146,-1]),Int32Array.from([6,30,54,78,102,126,150]),Int32Array.from([6,24,50,76,102,128,154]),Int32Array.from([6,28,54,80,106,132,158]),Int32Array.from([6,32,58,84,110,136,162]),Int32Array.from([6,26,54,82,110,138,166]),Int32Array.from([6,30,58,86,114,142,170])]),r.TYPE_INFO_COORDINATES=Array.from([Int32Array.from([8,0]),Int32Array.from([8,1]),Int32Array.from([8,2]),Int32Array.from([8,3]),Int32Array.from([8,4]),Int32Array.from([8,5]),Int32Array.from([8,7]),Int32Array.from([8,8]),Int32Array.from([7,8]),Int32Array.from([5,8]),Int32Array.from([4,8]),Int32Array.from([3,8]),Int32Array.from([2,8]),Int32Array.from([1,8]),Int32Array.from([0,8])]),r.VERSION_INFO_POLY=7973,r.TYPE_INFO_POLY=1335,r.TYPE_INFO_MASK_PATTERN=21522,r}(),AN=function(){function r(t,e){this.dataBytes=t,this.errorCorrectionBytes=e}return r.prototype.getDataBytes=function(){return this.dataBytes},r.prototype.getErrorCorrectionBytes=function(){return this.errorCorrectionBytes},r}(),_b=globalThis&&globalThis.__values||function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},TN=function(){function r(){}return r.calculateMaskPenalty=function(t){return Zc.applyMaskPenaltyRule1(t)+Zc.applyMaskPenaltyRule2(t)+Zc.applyMaskPenaltyRule3(t)+Zc.applyMaskPenaltyRule4(t)},r.encode=function(t,e,n){n===void 0&&(n=null);var i=r.DEFAULT_BYTE_MODE_ENCODING,a=n!==null&&n.get(Jo.CHARACTER_SET)!==void 0;a&&(i=n.get(Jo.CHARACTER_SET).toString());var o=this.chooseMode(t,i),s=new Ti;if(o===Zr.BYTE&&(a||r.DEFAULT_BYTE_MODE_ENCODING!==i)){var u=Sn.getCharacterSetECIByName(i);u!==void 0&&this.appendECI(u,s)}this.appendModeInfo(o,s);var c=new Ti;this.appendBytes(t,o,c,i);var l;if(n!==null&&n.get(Jo.QR_VERSION)!==void 0){var d=Number.parseInt(n.get(Jo.QR_VERSION).toString(),10);l=ks.getVersionForNumber(d);var h=this.calculateBitsNeeded(o,s,c,l);if(!this.willFit(h,l,e))throw new Yr("Data too big for requested version")}else l=this.recommendVersion(e,o,s,c);var f=new Ti;f.appendBitArray(s);var g=o===Zr.BYTE?c.getSizeInBytes():t.length;this.appendLengthInfo(g,l,o,f),f.appendBitArray(c);var m=l.getECBlocksForLevel(e),p=l.getTotalCodewords()-m.getTotalECCodewords();this.terminateBits(p,f);var y=this.interleaveWithECBytes(f,l.getTotalCodewords(),p,m.getNumBlocks()),v=new K0;v.setECLevel(e),v.setMode(o),v.setVersion(l);var b=l.getDimensionForVersion(),E=new xN(b,b),D=this.chooseMaskPattern(y,e,l,E);return v.setMaskPattern(D),wb.buildMatrix(y,e,l,D,E),v.setMatrix(E),v},r.recommendVersion=function(t,e,n,i){var a=this.calculateBitsNeeded(e,n,i,ks.getVersionForNumber(1)),o=this.chooseVersion(a,t),s=this.calculateBitsNeeded(e,n,i,o);return this.chooseVersion(s,t)},r.calculateBitsNeeded=function(t,e,n,i){return e.getSize()+t.getCharacterCountBits(i)+n.getSize()},r.getAlphanumericCode=function(t){return t159)&&(a<224||a>235))return!1}return!0},r.chooseMaskPattern=function(t,e,n,i){for(var a=Number.MAX_SAFE_INTEGER,o=-1,s=0;s=u},r.terminateBits=function(t,e){var n=t*8;if(e.getSize()>n)throw new Yr("data bits cannot fit in the QR Code"+e.getSize()+" > "+n);for(var i=0;i<4&&e.getSize()0)for(var i=a;i<8;i++)e.appendBit(!1);for(var o=t-e.getSizeInBytes(),i=0;i=n)throw new Yr("Block ID too large");var s=t%n,u=n-s,c=Math.floor(t/n),l=c+1,d=Math.floor(e/n),h=d+1,f=c-d,g=l-h;if(f!==g)throw new Yr("EC bytes mismatch");if(n!==u+s)throw new Yr("RS blocks mismatch");if(t!==(d+f)*u+(h+g)*s)throw new Yr("Total bytes mismatch");i=1<=0&&e<=9},r.appendNumericBytes=function(t,e){for(var n=t.length,i=0;i=33088&&u<=40956?c=u-33088:u>=57408&&u<=60351&&(c=u-49472),c===-1)throw new Yr("Invalid byte sequence");var l=(c>>8)*192+(c&255);e.appendBits(l,13)}},r.appendECI=function(t,e){e.appendBits(Zr.ECI.getBits(),4),e.appendBits(t.getValue(),8)},r.ALPHANUMERIC_TABLE=Int32Array.from([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,36,-1,-1,-1,37,38,-1,-1,-1,-1,39,40,-1,41,42,43,0,1,2,3,4,5,6,7,8,9,44,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1]),r.DEFAULT_BYTE_MODE_ENCODING=Sn.UTF8.getName(),r}(),SN=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}();(function(r){SN(t,r);function t(e,n,i,a,o,s,u,c){var l=r.call(this,s,u)||this;if(l.yuvData=e,l.dataWidth=n,l.dataHeight=i,l.left=a,l.top=o,a+s>n||o+u>i)throw new Bt("Crop rectangle does not fit within image data.");return c&&l.reverseHorizontal(s,u),l}return t.prototype.getRow=function(e,n){if(e<0||e>=this.getHeight())throw new Bt("Requested row is outside the image: "+e);var i=this.getWidth();(n==null||n.length>16&255,m=f>>7&510,p=f&255;d[h]=(g+m+p)/4&255}c.luminances=d}else c.luminances=e;if(a===void 0&&(c.dataWidth=n),o===void 0&&(c.dataHeight=i),s===void 0&&(c.left=0),u===void 0&&(c.top=0),c.left+n>c.dataWidth||c.top+i>c.dataHeight)throw new Bt("Crop rectangle does not fit within image data.");return c}return t.prototype.getRow=function(e,n){if(e<0||e>=this.getHeight())throw new Bt("Requested row is outside the image: "+e);var i=this.getWidth();(n==null||n.length=256&&(e^=kN);return{LOG:r,ALOG:t}};Z0=RN([],[]),Z0.LOG;Z0.ALOG;var xb;(function(r){r[r.FORCE_NONE=0]="FORCE_NONE",r[r.FORCE_SQUARE=1]="FORCE_SQUARE",r[r.FORCE_RECTANGLE=2]="FORCE_RECTANGLE"})(xb||(xb={}));var Eb=129,Ab=230,NN=231,FN=235,MN=236,UN=237,BN=238,PN=239,LN=240,Y0=254,jN=254,Tb="[)>05",Sb="[)>06",Db="",Ir=0,$n=1,pi=2,In=3,Mn=4,Jn=5,WN=function(){function r(){}return r.prototype.getEncodingMode=function(){return Ir},r.prototype.encode=function(t){var e=ba.determineConsecutiveDigitCount(t.getMessage(),t.pos);if(e>=2)t.writeCodeword(this.encodeASCIIDigits(t.getMessage().charCodeAt(t.pos),t.getMessage().charCodeAt(t.pos+1))),t.pos+=2;else{var n=t.getCurrentChar(),i=ba.lookAheadTest(t.getMessage(),t.pos,this.getEncodingMode());if(i!==this.getEncodingMode())switch(i){case Jn:t.writeCodeword(NN),t.signalEncoderChange(Jn);return;case $n:t.writeCodeword(Ab),t.signalEncoderChange($n);return;case In:t.writeCodeword(BN),t.signalEncoderChange(In);break;case pi:t.writeCodeword(PN),t.signalEncoderChange(pi);break;case Mn:t.writeCodeword(LN),t.signalEncoderChange(Mn);break;default:throw new Error("Illegal mode: "+i)}else ba.isExtendedASCII(n)?(t.writeCodeword(FN),t.writeCodeword(n-128+1),t.pos++):(t.writeCodeword(n+1),t.pos++)}},r.prototype.encodeASCIIDigits=function(t,e){if(ba.isDigit(t)&&ba.isDigit(e)){var n=(t-48)*10+(e-48);return n+130}throw new Error("not digits: "+t+e)},r}(),zN=function(){function r(){}return r.prototype.getEncodingMode=function(){return Jn},r.prototype.encode=function(t){var e=new er;for(e.append(0);t.hasMoreCharacters();){var n=t.getCurrentChar();e.append(n),t.pos++;var i=ba.lookAheadTest(t.getMessage(),t.pos,this.getEncodingMode());if(i!==this.getEncodingMode()){t.signalEncoderChange(Ir);break}}var a=e.length()-1,o=1,s=t.getCodewordCount()+a+o;t.updateSymbolInfo(s);var u=t.getSymbolInfo().getDataCapacity()-s>0;if(t.hasMoreCharacters()||u)if(a<=249)e.setCharAt(0,$r.getCharAt(a));else if(a<=1555)e.setCharAt(0,$r.getCharAt(Math.floor(a/250)+249)),e.insert(1,$r.getCharAt(a%250));else throw new Error("Message length not in valid ranges: "+a);for(var c=0,n=e.length();c3||c!==1))&&(t.pos=i)}e.length()>0&&t.writeCodeword(Ab),this.handleEOD(t,e)},r.prototype.encode=function(t){for(var e=new er;t.hasMoreCharacters();){var n=t.getCurrentChar();t.pos++;var i=this.encodeChar(n,e),a=Math.floor(e.length()/3)*2,o=t.getCodewordCount()+a;t.updateSymbolInfo(o);var s=t.getSymbolInfo().getDataCapacity()-o;if(!t.hasMoreCharacters()){var u=new er;for(e.length()%3==2&&s!==2&&(i=this.backtrackOneCharacter(t,e,u,i));e.length()%3==1&&(i>3||s!==1);)i=this.backtrackOneCharacter(t,e,u,i);break}var c=e.length();if(c%3==0){var l=ba.lookAheadTest(t.getMessage(),t.pos,this.getEncodingMode());if(l!==this.getEncodingMode()){t.signalEncoderChange(Ir);break}}}this.handleEOD(t,e)},r.prototype.backtrackOneCharacter=function(t,e,n,i){var a=e.length(),o=e.toString().substring(0,a-i);e.setLengthToZero(),e.append(o),t.pos--;var s=t.getCurrentChar();return i=this.encodeChar(s,n),t.resetSymbolInfo(),i},r.prototype.writeNextTriplet=function(t,e){t.writeCodewords(this.encodeToCodewords(e.toString()));var n=e.toString().substring(3);e.setLengthToZero(),e.append(n)},r.prototype.handleEOD=function(t,e){var n=Math.floor(e.length()/3*2),i=e.length()%3,a=t.getCodewordCount()+n;t.updateSymbolInfo(a);var o=t.getSymbolInfo().getDataCapacity()-a;if(i===2){for(e.append("\0");e.length()>=3;)this.writeNextTriplet(t,e);t.hasMoreCharacters()&&t.writeCodeword(Y0)}else if(o===1&&i===1){for(;e.length()>=3;)this.writeNextTriplet(t,e);t.hasMoreCharacters()&&t.writeCodeword(Y0),t.pos--}else if(i===0){for(;e.length()>=3;)this.writeNextTriplet(t,e);(o>0||t.hasMoreCharacters())&&t.writeCodeword(Y0)}else throw new Error("Unexpected case. Please report!");t.signalEncoderChange(Ir)},r.prototype.encodeChar=function(t,e){if(t===" ".charCodeAt(0))return e.append(3),1;if(t>="0".charCodeAt(0)&&t<="9".charCodeAt(0))return e.append(t-48+4),1;if(t>="A".charCodeAt(0)&&t<="Z".charCodeAt(0))return e.append(t-65+14),1;if(t<" ".charCodeAt(0))return e.append(0),e.append(t),2;if(t<="/".charCodeAt(0))return e.append(1),e.append(t-33),2;if(t<="@".charCodeAt(0))return e.append(1),e.append(t-58+15),2;if(t<="_".charCodeAt(0))return e.append(1),e.append(t-91+22),2;if(t<=127)return e.append(2),e.append(t-96),2;e.append(1+"");var n=2;return n+=this.encodeChar(t-128,e),n},r.prototype.encodeToCodewords=function(t){var e=1600*t.charCodeAt(0)+40*t.charCodeAt(1)+t.charCodeAt(2)+1,n=e/256,i=e%256,a=new er;return a.append(n),a.append(i),a.toString()},r}(),HN=function(){function r(){}return r.prototype.getEncodingMode=function(){return Mn},r.prototype.encode=function(t){for(var e=new er;t.hasMoreCharacters();){var n=t.getCurrentChar();this.encodeChar(n,e),t.pos++;var i=e.length();if(i>=4){t.writeCodewords(this.encodeToCodewords(e.toString()));var a=e.toString().substring(4);e.setLengthToZero(),e.append(a);var o=ba.lookAheadTest(t.getMessage(),t.pos,this.getEncodingMode());if(o!==this.getEncodingMode()){t.signalEncoderChange(Ir);break}}}e.append($r.getCharAt(31)),this.handleEOD(t,e)},r.prototype.handleEOD=function(t,e){try{var n=e.length();if(n===0)return;if(n===1){t.updateSymbolInfo();var i=t.getSymbolInfo().getDataCapacity()-t.getCodewordCount(),a=t.getRemainingCharacters();if(a>i&&(t.updateSymbolInfo(t.getCodewordCount()+1),i=t.getSymbolInfo().getDataCapacity()-t.getCodewordCount()),a<=i&&i<=2)return}if(n>4)throw new Error("Count must not exceed 4");var o=n-1,s=this.encodeToCodewords(e.toString()),u=!t.hasMoreCharacters(),c=u&&o<=2;if(o<=2){t.updateSymbolInfo(t.getCodewordCount()+o);var i=t.getSymbolInfo().getDataCapacity()-t.getCodewordCount();i>=3&&(c=!1,t.updateSymbolInfo(t.getCodewordCount()+s.length))}c?(t.resetSymbolInfo(),t.pos-=o):t.writeCodewords(s)}finally{t.signalEncoderChange(Ir)}},r.prototype.encodeChar=function(t,e){t>=" ".charCodeAt(0)&&t<="?".charCodeAt(0)?e.append(t):t>="@".charCodeAt(0)&&t<="^".charCodeAt(0)?e.append($r.getCharAt(t-64)):ba.illegalCharacter($r.getCharAt(t))},r.prototype.encodeToCodewords=function(t){var e=t.length;if(e===0)throw new Error("StringBuilder must not be empty");var n=t.charAt(0).charCodeAt(0),i=e>=2?t.charAt(1).charCodeAt(0):0,a=e>=3?t.charAt(2).charCodeAt(0):0,o=e>=4?t.charAt(3).charCodeAt(0):0,s=(n<<18)+(i<<12)+(a<<6)+o,u=s>>16&255,c=s>>8&255,l=s&255,d=new er;return d.append(u),e>=2&&d.append(c),e>=3&&d.append(l),d.toString()},r}(),$N=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),VN=globalThis&&globalThis.__values||function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},_r=function(){function r(t,e,n,i,a,o,s,u){s===void 0&&(s=0),u===void 0&&(u=0),this.rectangular=t,this.dataCapacity=e,this.errorCodewords=n,this.matrixWidth=i,this.matrixHeight=a,this.dataRegions=o,this.rsBlockData=s,this.rsBlockError=u}return r.lookup=function(t,e,n,i,a){var o,s;e===void 0&&(e=0),n===void 0&&(n=null),i===void 0&&(i=null),a===void 0&&(a=!0);try{for(var u=VN(GN),c=u.next();!c.done;c=u.next()){var l=c.value;if(!(e===1&&l.rectangular)&&!(e===2&&!l.rectangular)&&!(n!=null&&(l.getSymbolWidth()i.getWidth()||l.getSymbolHeight()>i.getHeight()))&&t<=l.dataCapacity)return l}}catch(d){o={error:d}}finally{try{c&&!c.done&&(s=u.return)&&s.call(u)}finally{if(o)throw o.error}}if(a)throw new Error("Can't find a symbol arrangement that matches the message. Data codewords: "+t);return null},r.prototype.getHorizontalDataRegions=function(){switch(this.dataRegions){case 1:return 1;case 2:case 4:return 2;case 16:return 4;case 36:return 6;default:throw new Error("Cannot handle this number of data regions")}},r.prototype.getVerticalDataRegions=function(){switch(this.dataRegions){case 1:case 2:return 1;case 4:return 2;case 16:return 4;case 36:return 6;default:throw new Error("Cannot handle this number of data regions")}},r.prototype.getSymbolDataWidth=function(){return this.getHorizontalDataRegions()*this.matrixWidth},r.prototype.getSymbolDataHeight=function(){return this.getVerticalDataRegions()*this.matrixHeight},r.prototype.getSymbolWidth=function(){return this.getSymbolDataWidth()+this.getHorizontalDataRegions()*2},r.prototype.getSymbolHeight=function(){return this.getSymbolDataHeight()+this.getVerticalDataRegions()*2},r.prototype.getCodewordCount=function(){return this.dataCapacity+this.errorCodewords},r.prototype.getInterleavedBlockCount=function(){return this.rsBlockData?this.dataCapacity/this.rsBlockData:1},r.prototype.getDataCapacity=function(){return this.dataCapacity},r.prototype.getErrorCodewords=function(){return this.errorCodewords},r.prototype.getDataLengthForInterleavedBlock=function(t){return this.rsBlockData},r.prototype.getErrorLengthForInterleavedBlock=function(t){return this.rsBlockError},r}(),qN=function(r){$N(t,r);function t(){return r.call(this,!1,1558,620,22,22,36,-1,62)||this}return t.prototype.getInterleavedBlockCount=function(){return 10},t.prototype.getDataLengthForInterleavedBlock=function(e){return e<=8?156:155},t}(_r),GN=[new _r(!1,3,5,8,8,1),new _r(!1,5,7,10,10,1),new _r(!0,5,7,16,6,1),new _r(!1,8,10,12,12,1),new _r(!0,10,11,14,6,2),new _r(!1,12,12,14,14,1),new _r(!0,16,14,24,10,1),new _r(!1,18,14,16,16,1),new _r(!1,22,18,18,18,1),new _r(!0,22,18,16,10,2),new _r(!1,30,20,20,20,1),new _r(!0,32,24,16,14,2),new _r(!1,36,24,22,22,1),new _r(!1,44,28,24,24,1),new _r(!0,49,28,22,14,2),new _r(!1,62,36,14,14,4),new _r(!1,86,42,16,16,4),new _r(!1,114,48,18,18,4),new _r(!1,144,56,20,20,4),new _r(!1,174,68,22,22,4),new _r(!1,204,84,24,24,4,102,42),new _r(!1,280,112,14,14,16,140,56),new _r(!1,368,144,16,16,16,92,36),new _r(!1,456,192,18,18,16,114,48),new _r(!1,576,224,20,20,16,144,56),new _r(!1,696,272,22,22,16,174,68),new _r(!1,816,336,24,24,16,136,56),new _r(!1,1050,408,18,18,36,175,68),new _r(!1,1304,496,20,20,36,163,62),new qN],XN=function(){function r(t){this.msg=t,this.pos=0,this.skipAtEnd=0;for(var e=t.split("").map(function(s){return s.charCodeAt(0)}),n=new er,i=0,a=e.length;ithis.symbolInfo.getDataCapacity())&&(this.symbolInfo=_r.lookup(t,this.shape,this.minSize,this.maxSize,!0))},r.prototype.resetSymbolInfo=function(){this.symbolInfo=null},r}(),KN=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),ZN=function(r){KN(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.getEncodingMode=function(){return In},t.prototype.encode=function(e){for(var n=new er;e.hasMoreCharacters();){var i=e.getCurrentChar();e.pos++,this.encodeChar(i,n);var a=n.length();if(a%3==0){this.writeNextTriplet(e,n);var o=ba.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode());if(o!==this.getEncodingMode()){e.signalEncoderChange(Ir);break}}}this.handleEOD(e,n)},t.prototype.encodeChar=function(e,n){switch(e){case 13:n.append(0);break;case"*".charCodeAt(0):n.append(1);break;case">".charCodeAt(0):n.append(2);break;case" ".charCodeAt(0):n.append(3);break;default:e>="0".charCodeAt(0)&&e<="9".charCodeAt(0)?n.append(e-48+4):e>="A".charCodeAt(0)&&e<="Z".charCodeAt(0)?n.append(e-65+14):ba.illegalCharacter($r.getCharAt(e));break}return 1},t.prototype.handleEOD=function(e,n){e.updateSymbolInfo();var i=e.getSymbolInfo().getDataCapacity()-e.getCodewordCount(),a=n.length();e.pos-=a,(e.getRemainingCharacters()>1||i>1||e.getRemainingCharacters()!==i)&&e.writeCodeword(jN),e.getNewEncoding()<0&&e.signalEncoderChange(Ir)},t}(J0),YN=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),JN=function(r){YN(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.getEncodingMode=function(){return pi},t.prototype.encodeChar=function(e,n){if(e===" ".charCodeAt(0))return n.append(3),1;if(e>="0".charCodeAt(0)&&e<="9".charCodeAt(0))return n.append(e-48+4),1;if(e>="a".charCodeAt(0)&&e<="z".charCodeAt(0))return n.append(e-97+14),1;if(e<" ".charCodeAt(0))return n.append(0),n.append(e),2;if(e<="/".charCodeAt(0))return n.append(1),n.append(e-33),2;if(e<="@".charCodeAt(0))return n.append(1),n.append(e-58+15),2;if(e>="[".charCodeAt(0)&&e<="_".charCodeAt(0))return n.append(1),n.append(e-91+22),2;if(e==="`".charCodeAt(0))return n.append(2),n.append(0),2;if(e<="Z".charCodeAt(0))return n.append(2),n.append(e-65+1),2;if(e<=127)return n.append(2),n.append(e-123+27),2;n.append(1+"");var i=2;return i+=this.encodeChar(e-128,n),i},t}(J0),QN=function(){function r(){}return r.randomize253State=function(t){var e=149*t%253+1,n=Eb+e;return n<=254?n:n-254},r.encodeHighLevel=function(t,e,n,i,a){e===void 0&&(e=0),n===void 0&&(n=null),i===void 0&&(i=null),a===void 0&&(a=!1);var o=new J0,s=[new WN,o,new JN,new ZN,new HN,new zN],u=new XN(t);u.setSymbolShape(e),u.setSizeConstraints(n,i),t.startsWith(Tb)&&t.endsWith(Db)?(u.writeCodeword(MN),u.setSkipAtEnd(2),u.pos+=Tb.length):t.startsWith(Sb)&&t.endsWith(Db)&&(u.writeCodeword(UN),u.setSkipAtEnd(2),u.pos+=Sb.length);var c=Ir;for(a&&(o.encodeMaximal(u),c=u.getNewEncoding(),u.resetEncoderSignal());u.hasMoreCharacters();)s[c].encode(u),u.getNewEncoding()>=0&&(c=u.getNewEncoding(),u.resetEncoderSignal());var l=u.getCodewordCount();u.updateSymbolInfo();var d=u.getSymbolInfo().getDataCapacity();l=t.length)return n;var i;n===Ir?i=[0,1,1,1,1,1.25]:(i=[1,2,2,2,2,2.25],i[n]=0);for(var a=0,o=new Uint8Array(6),s=[];;){if(e+a===t.length){Tn.fill(o,0),Tn.fill(s,0);var u=this.findMinimums(i,s,ln.MAX_VALUE,o),c=this.getMinimumCount(o);if(s[Ir]===u)return Ir;if(c===1){if(o[Jn]>0)return Jn;if(o[Mn]>0)return Mn;if(o[pi]>0)return pi;if(o[In]>0)return In}return $n}var l=t.charCodeAt(e+a);if(a++,this.isDigit(l)?i[Ir]+=.5:this.isExtendedASCII(l)?(i[Ir]=Math.ceil(i[Ir]),i[Ir]+=2):(i[Ir]=Math.ceil(i[Ir]),i[Ir]++),this.isNativeC40(l)?i[$n]+=2/3:this.isExtendedASCII(l)?i[$n]+=8/3:i[$n]+=4/3,this.isNativeText(l)?i[pi]+=2/3:this.isExtendedASCII(l)?i[pi]+=8/3:i[pi]+=4/3,this.isNativeX12(l)?i[In]+=2/3:this.isExtendedASCII(l)?i[In]+=13/3:i[In]+=10/3,this.isNativeEDIFACT(l)?i[Mn]+=3/4:this.isExtendedASCII(l)?i[Mn]+=17/4:i[Mn]+=13/4,this.isSpecialB256(l)?i[Jn]+=4:i[Jn]++,a>=4){if(Tn.fill(o,0),Tn.fill(s,0),this.findMinimums(i,s,ln.MAX_VALUE,o),s[Ir]o&&(n=o,Tn.fill(i,0)),n===o&&(i[a]=i[a]+1)}return n},r.getMinimumCount=function(t){for(var e=0,n=0;n<6;n++)e+=t[n];return e||0},r.isDigit=function(t){return t>="0".charCodeAt(0)&&t<="9".charCodeAt(0)},r.isExtendedASCII=function(t){return t>=128&&t<=255},r.isNativeC40=function(t){return t===" ".charCodeAt(0)||t>="0".charCodeAt(0)&&t<="9".charCodeAt(0)||t>="A".charCodeAt(0)&&t<="Z".charCodeAt(0)},r.isNativeText=function(t){return t===" ".charCodeAt(0)||t>="0".charCodeAt(0)&&t<="9".charCodeAt(0)||t>="a".charCodeAt(0)&&t<="z".charCodeAt(0)},r.isNativeX12=function(t){return this.isX12TermSep(t)||t===" ".charCodeAt(0)||t>="0".charCodeAt(0)&&t<="9".charCodeAt(0)||t>="A".charCodeAt(0)&&t<="Z".charCodeAt(0)},r.isX12TermSep=function(t){return t===13||t==="*".charCodeAt(0)||t===">".charCodeAt(0)},r.isNativeEDIFACT=function(t){return t>=" ".charCodeAt(0)&&t<="^".charCodeAt(0)},r.isSpecialB256=function(t){return!1},r.determineConsecutiveDigitCount=function(t,e){e===void 0&&(e=0);for(var n=t.length,i=e;i=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Cb=function(){function r(t){this.charset=t,this.name=t.name}return r.prototype.canEncode=function(t){try{return ta.encode(t,this.charset)!=null}catch{return!1}},r}(),eF=function(){function r(t,e,n){var i,a,o,s,u,c;this.ENCODERS=["IBM437","ISO-8859-2","ISO-8859-3","ISO-8859-4","ISO-8859-5","ISO-8859-6","ISO-8859-7","ISO-8859-8","ISO-8859-9","ISO-8859-10","ISO-8859-11","ISO-8859-13","ISO-8859-14","ISO-8859-15","ISO-8859-16","windows-1250","windows-1251","windows-1252","windows-1256","Shift_JIS"].map(function(U){return new Cb(ON.forName(U))}),this.encoders=[];var l=[];l.push(new Cb(IN.ISO_8859_1));for(var d=e!=null&&e.name.startsWith("UTF"),h=0;h=this.bytes.length)return!1;for(var n=0;n=this.length())throw new Error(""+t);if(this.isECI(t))throw new Error("value at "+t+" is not a character but an ECI");return this.isFNC1(t)?this.fnc1:this.bytes[t]},r.prototype.subSequence=function(t,e){if(t<0||t>e||e>this.length())throw new Error(""+t);for(var n=new er,i=t;i=this.length())throw new Error(""+t);return this.bytes[t]>255&&this.bytes[t]<=999},r.prototype.isFNC1=function(t){if(t<0||t>=this.length())throw new Error(""+t);return this.bytes[t]===1e3},r.prototype.getECIValue=function(t){if(t<0||t>=this.length())throw new Error(""+t);if(!this.isECI(t))throw new Error("value at "+t+" is not an ECI but a character");return this.bytes[t]-256},r.prototype.addEdge=function(t,e,n){(t[e][n.encoderIndex]==null||t[e][n.encoderIndex].cachedTotalSize>n.cachedTotalSize)&&(t[e][n.encoderIndex]=n)},r.prototype.addEdges=function(t,e,n,i,a,o){var s=t.charAt(i).charCodeAt(0),u=0,c=e.length();e.getPriorityEncoderIndex()>=0&&(s===o||e.canEncode(s,e.getPriorityEncoderIndex()))&&(u=e.getPriorityEncoderIndex(),c=u+1);for(var l=u;l=0;o--)d.unshift(f[o]&255);var g=h.previous===null?0:h.previous.encoderIndex;g!==h.encoderIndex&&d.unshift(256+e.getECIValue(h.encoderIndex)),h=h.previous}for(var m=[],o=0;o0)&&!(i=n.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(o)throw o.error}}return a};globalThis&&globalThis.__spread;var Ib;(function(r){r[r.ASCII=0]="ASCII",r[r.C40=1]="C40",r[r.TEXT=2]="TEXT",r[r.X12=3]="X12",r[r.EDF=4]="EDF",r[r.B256=5]="B256"})(Ib||(Ib={}));(function(r){nF(t,r);function t(e,n,i,a,o){var s=r.call(this,e,n,i)||this;return s.shape=a,s.macroId=o,s}return t.prototype.getMacroId=function(){return this.macroId},t.prototype.getShapeHint=function(){return this.shape},t})(rF);var aF=function(){function r(t){this.previous=t}return r.prototype.getPrevious=function(){return this.previous},r}(),oF=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),kb=function(r){oF(t,r);function t(e,n,i){var a=r.call(this,e)||this;return a.value=n,a.bitCount=i,a}return t.prototype.appendTo=function(e,n){e.appendBits(this.value,this.bitCount)},t.prototype.add=function(e,n){return new t(this,e,n)},t.prototype.addBinaryShift=function(e,n){return console.warn("addBinaryShift on SimpleToken, this simply returns a copy of this token"),new t(this,e,n)},t.prototype.toString=function(){var e=this.value&(1<"},t}(aF),sF=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}();(function(r){sF(t,r);function t(e,n,i){var a=r.call(this,e,0,0)||this;return a.binaryShiftStart=n,a.binaryShiftByteCount=i,a}return t.prototype.appendTo=function(e,n){for(var i=0;i62?e.appendBits(this.binaryShiftByteCount-31,16):i===0?e.appendBits(Math.min(this.binaryShiftByteCount,31),5):e.appendBits(this.binaryShiftByteCount-31,5)),e.appendBits(n[this.binaryShiftStart+i],8)},t.prototype.addBinaryShift=function(e,n){return new t(this,e,n)},t.prototype.toString=function(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"},t})(kb);var Yc=0,Sh=1,Au=2,Rb=3,Jc=4;new kb(null,0,0);var uF=globalThis&&globalThis.__values||function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};function cF(r){var t,e;try{for(var n=uF(r),i=n.next();!i.done;i=n.next()){var a=i.value;Tn.fill(a,-1)}}catch(o){t={error:o}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}return r[Yc][Jc]=0,r[Sh][Jc]=0,r[Sh][Yc]=28,r[Rb][Jc]=0,r[Au][Jc]=0,r[Au][Yc]=15,r}cF(Tn.createInt32Array(6,6));globalThis&&globalThis.__values;function lF(r){var t=$r.getCharCode(" "),e=$r.getCharCode("."),n=$r.getCharCode(",");r[Yc][t]=1;for(var i=$r.getCharCode("Z"),a=$r.getCharCode("A"),o=a;o<=i;o++)r[Yc][o]=o-a+2;r[Sh][t]=1;for(var s=$r.getCharCode("z"),u=$r.getCharCode("a"),o=u;o<=s;o++)r[Sh][o]=o-u+2;r[Au][t]=1;for(var c=$r.getCharCode("9"),l=$r.getCharCode("0"),o=l;o<=c;o++)r[Au][o]=o-l+2;r[Au][n]=12,r[Au][e]=13;for(var d=["\0"," ","","","","","","","\x07","\b"," ",` `,"\v","\f","\r","","","","","","@","\\","^","_","`","|","~","\x7F"],h=0;h","?","[","]","{","}"],h=0;h0&&(r[Jc][$r.getCharCode(f[h])]=h);return r}lF(Tn.createInt32Array(5,256));globalThis&&globalThis.__values;globalThis&&globalThis.__values;var fF=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),hF=function(r){fF(t,r);function t(e){var n=r.call(this,e.width,e.height)||this;return n.canvas=e,n.tempCanvasElement=null,n.buffer=t.makeBufferFromCanvasImageData(e),n}return t.makeBufferFromCanvasImageData=function(e){var n;try{n=e.getContext("2d",{willReadFrequently:!0})}catch{n=e.getContext("2d")}if(!n)throw new Error("Couldn't get canvas context.");var i=n.getImageData(0,0,e.width,e.height);return t.toGrayscaleBuffer(i.data,e.width,e.height)},t.toGrayscaleBuffer=function(e,n,i){for(var a=new Uint8ClampedArray(n*i),o=0,s=0,u=e.length;o>10}a[s]=c}return a},t.prototype.getRow=function(e,n){if(e<0||e>=this.getHeight())throw new Bt("Requested row is outside the image: "+e);var i=this.getWidth(),a=e*i;return n===null?n=this.buffer.slice(a,a+i):(n.length0&&a[a.length-1])&&(c[0]===6||c[0]===2)){e=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},mF={delayBetweenScanAttempts:500,delayBetweenScanSuccess:500,tryPlayVideoTimeout:5e3},Su=function(){function r(t,e,n){e===void 0&&(e=new Map),n===void 0&&(n={}),this.reader=t,this.hints=e,this.options=Tu(Tu({},mF),n)}return Object.defineProperty(r.prototype,"possibleFormats",{set:function(t){this.hints.set(Hr.POSSIBLE_FORMATS,t)},enumerable:!1,configurable:!0}),r.addVideoSource=function(t,e){try{t.srcObject=e}catch{console.error("got interrupted by new loading request")}},r.mediaStreamSetTorch=function(t,e){return Qr(this,void 0,void 0,function(){return en(this,function(n){switch(n.label){case 0:return[4,t.applyConstraints({advanced:[{fillLightMode:e?"flash":"off",torch:!!e}]})];case 1:return n.sent(),[2]}})})},r.mediaStreamIsTorchCompatible=function(t){var e,n,i=t.getVideoTracks();try{for(var a=e1(i),o=a.next();!o.done;o=a.next()){var s=o.value;if(r.mediaStreamIsTorchCompatibleTrack(s))return!0}}catch(u){e={error:u}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}return!1},r.mediaStreamIsTorchCompatibleTrack=function(t){try{var e=t.getCapabilities();return"torch"in e}catch(n){return console.error(n),console.warn("Your browser may be not fully compatible with WebRTC and/or ImageCapture specs. Torch will not be available."),!1}},r.isVideoPlaying=function(t){return t.currentTime>0&&!t.paused&&t.readyState>2},r.getMediaElement=function(t,e){var n=document.getElementById(t);if(!n)throw new cn("element with id '".concat(t,"' not found"));if(n.nodeName.toLowerCase()!==e.toLowerCase())throw new cn("element with id '".concat(t,"' must be an ").concat(e," element"));return n},r.createVideoElement=function(t){if(t instanceof HTMLVideoElement)return t;if(typeof t=="string")return r.getMediaElement(t,"video");if(!t&&typeof document!="undefined"){var e=document.createElement("video");return e.width=200,e.height=200,e}throw new Error("Couldn't get videoElement from videoSource!")},r.prepareImageElement=function(t){if(t instanceof HTMLImageElement)return t;if(typeof t=="string")return r.getMediaElement(t,"img");if(typeof t=="undefined"){var e=document.createElement("img");return e.width=200,e.height=200,e}throw new Error("Couldn't get imageElement from imageSource!")},r.prepareVideoElement=function(t){var e=r.createVideoElement(t);return e.setAttribute("autoplay","true"),e.setAttribute("muted","true"),e.setAttribute("playsinline","true"),e},r.isImageLoaded=function(t){return!(!t.complete||t.naturalWidth===0)},r.createBinaryBitmapFromCanvas=function(t){var e=new hF(t),n=new Ly(e);return new By(n)},r.drawImageOnCanvas=function(t,e){t.drawImage(e,0,0)},r.getMediaElementDimensions=function(t){if(t instanceof HTMLVideoElement)return{height:t.videoHeight,width:t.videoWidth};if(t instanceof HTMLImageElement)return{height:t.naturalHeight||t.height,width:t.naturalWidth||t.width};throw new Error("Couldn't find the Source's dimensions!")},r.createCaptureCanvas=function(t){if(!t)throw new cn("Cannot create a capture canvas without a media element.");if(typeof document=="undefined")throw new Error(`The page "Document" is undefined, make sure you're running in a browser.`);var e=document.createElement("canvas"),n=r.getMediaElementDimensions(t),i=n.width,a=n.height;return e.style.width=i+"px",e.style.height=a+"px",e.width=i,e.height=a,e},r.tryPlayVideo=function(t){return Qr(this,void 0,void 0,function(){var e;return en(this,function(n){switch(n.label){case 0:if(t==null?void 0:t.ended)return console.error("Trying to play video that has ended."),[2,!1];if(r.isVideoPlaying(t))return console.warn("Trying to play video that is already playing."),[2,!0];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,t.play()];case 2:return n.sent(),[2,!0];case 3:return e=n.sent(),console.warn("It was not possible to play the video.",e),[2,!1];case 4:return[2]}})})},r.createCanvasFromMediaElement=function(t){var e=r.createCaptureCanvas(t),n=e.getContext("2d");if(!n)throw new Error("Couldn't find Canvas 2D Context.");return r.drawImageOnCanvas(n,t),e},r.createBinaryBitmapFromMediaElem=function(t){var e=r.createCanvasFromMediaElement(t);return r.createBinaryBitmapFromCanvas(e)},r.destroyImageElement=function(t){t.src="",t.removeAttribute("src"),t=void 0},r.listVideoInputDevices=function(){return Qr(this,void 0,void 0,function(){var t,e,n,i,a,o,s,u,c,l,d,h;return en(this,function(f){switch(f.label){case 0:if(!Nb())throw new Error("Can't enumerate devices, navigator is not present.");if(!pF())throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:t=f.sent(),e=[];try{for(n=e1(t),i=n.next();!i.done;i=n.next())a=i.value,o=a.kind==="video"?"videoinput":a.kind,o==="videoinput"&&(s=a.deviceId||a.id,u=a.label||"Video device ".concat(e.length+1),c=a.groupId,l={deviceId:s,label:u,kind:o,groupId:c},e.push(l))}catch(g){d={error:g}}finally{try{i&&!i.done&&(h=n.return)&&h.call(n)}finally{if(d)throw d.error}}return[2,e]}})})},r.findDeviceById=function(t){return Qr(this,void 0,void 0,function(){var e;return en(this,function(n){switch(n.label){case 0:return[4,r.listVideoInputDevices()];case 1:return e=n.sent(),e?[2,e.find(function(i){return i.deviceId===t})]:[2]}})})},r.cleanVideoSource=function(t){if(!!t){try{t.srcObject=null}catch{t.src=""}t&&t.removeAttribute("src")}},r.releaseAllStreams=function(){r.streamTracker.length!==0&&r.streamTracker.forEach(function(t){t.getTracks().forEach(function(e){return e.stop()})}),r.streamTracker=[]},r.playVideoOnLoadAsync=function(t,e){return Qr(this,void 0,void 0,function(){var n;return en(this,function(i){switch(i.label){case 0:return[4,r.tryPlayVideo(t)];case 1:return n=i.sent(),n?[2,!0]:[2,new Promise(function(a,o){var s=setTimeout(function(){r.isVideoPlaying(t)||(o(!1),t.removeEventListener("canplay",u))},e),u=function(){r.tryPlayVideo(t).then(function(c){clearTimeout(s),t.removeEventListener("canplay",u),a(c)})};t.addEventListener("canplay",u)})]}})})},r.attachStreamToVideo=function(t,e,n){return n===void 0&&(n=5e3),Qr(this,void 0,void 0,function(){var i;return en(this,function(a){switch(a.label){case 0:return i=r.prepareVideoElement(e),r.addVideoSource(i,t),[4,r.playVideoOnLoadAsync(i,n)];case 1:return a.sent(),[2,i]}})})},r._waitImageLoad=function(t){return new Promise(function(e,n){var i=1e4,a=setTimeout(function(){r.isImageLoaded(t)||(t.removeEventListener("load",o),n())},i),o=function(){clearTimeout(a),t.removeEventListener("load",o),e()};t.addEventListener("load",o)})},r.checkCallbackFnOrThrow=function(t){if(!t)throw new cn("`callbackFn` is a required parameter, you cannot capture results without it.")},r.disposeMediaStream=function(t){t.getVideoTracks().forEach(function(e){return e.stop()}),t=void 0},r.prototype.decode=function(t){var e=r.createCanvasFromMediaElement(t);return this.decodeFromCanvas(e)},r.prototype.decodeBitmap=function(t){return this.reader.decode(t,this.hints)},r.prototype.decodeFromCanvas=function(t){var e=r.createBinaryBitmapFromCanvas(t);return this.decodeBitmap(e)},r.prototype.decodeFromImageElement=function(t){return Qr(this,void 0,void 0,function(){var e;return en(this,function(n){switch(n.label){case 0:if(!t)throw new cn("An image element must be provided.");return e=r.prepareImageElement(t),[4,this._decodeOnLoadImage(e)];case 1:return[2,n.sent()]}})})},r.prototype.decodeFromImageUrl=function(t){return Qr(this,void 0,void 0,function(){var e;return en(this,function(n){switch(n.label){case 0:if(!t)throw new cn("An URL must be provided.");e=r.prepareImageElement(),e.src=t,n.label=1;case 1:return n.trys.push([1,,3,4]),[4,this.decodeFromImageElement(e)];case 2:return[2,n.sent()];case 3:return r.destroyImageElement(e),[7];case 4:return[2]}})})},r.prototype.decodeFromConstraints=function(t,e,n){return Qr(this,void 0,void 0,function(){var i,a;return en(this,function(o){switch(o.label){case 0:return r.checkCallbackFnOrThrow(n),[4,this.getUserMedia(t)];case 1:i=o.sent(),o.label=2;case 2:return o.trys.push([2,4,,5]),[4,this.decodeFromStream(i,e,n)];case 3:return[2,o.sent()];case 4:throw a=o.sent(),r.disposeMediaStream(i),a;case 5:return[2]}})})},r.prototype.decodeFromStream=function(t,e,n){return Qr(this,void 0,void 0,function(){var i,a,o,s,u,c,l,d,h,f=this;return en(this,function(g){switch(g.label){case 0:return r.checkCallbackFnOrThrow(n),i=this.options.tryPlayVideoTimeout,[4,r.attachStreamToVideo(t,e,i)];case 1:return a=g.sent(),o=function(){r.disposeMediaStream(t),r.cleanVideoSource(a)},s=this.scan(a,n,o),u=t.getVideoTracks(),c=Tu(Tu({},s),{stop:function(){s.stop()},streamVideoConstraintsApply:function(m,p){return Qr(this,void 0,void 0,function(){var y,v,b,E,D,F,z;return en(this,function(W){switch(W.label){case 0:y=p?u.filter(p):u,W.label=1;case 1:W.trys.push([1,6,7,8]),v=e1(y),b=v.next(),W.label=2;case 2:return b.done?[3,5]:(E=b.value,[4,E.applyConstraints(m)]);case 3:W.sent(),W.label=4;case 4:return b=v.next(),[3,2];case 5:return[3,8];case 6:return D=W.sent(),F={error:D},[3,8];case 7:try{b&&!b.done&&(z=v.return)&&z.call(v)}finally{if(F)throw F.error}return[7];case 8:return[2]}})})},streamVideoConstraintsGet:function(m){return u.find(m).getConstraints()},streamVideoSettingsGet:function(m){return u.find(m).getSettings()},streamVideoCapabilitiesGet:function(m){return u.find(m).getCapabilities()}}),l=r.mediaStreamIsTorchCompatible(t),l&&(d=u==null?void 0:u.find(function(m){return r.mediaStreamIsTorchCompatibleTrack(m)}),h=function(m){return Qr(f,void 0,void 0,function(){return en(this,function(p){switch(p.label){case 0:return[4,r.mediaStreamSetTorch(d,m)];case 1:return p.sent(),[2]}})})},c.switchTorch=h,c.stop=function(){return Qr(f,void 0,void 0,function(){return en(this,function(m){switch(m.label){case 0:return s.stop(),[4,h(!1)];case 1:return m.sent(),[2]}})})}),[2,c]}})})},r.prototype.decodeFromVideoDevice=function(t,e,n){return Qr(this,void 0,void 0,function(){var i,a;return en(this,function(o){switch(o.label){case 0:return r.checkCallbackFnOrThrow(n),t?i={deviceId:{exact:t}}:i={facingMode:"environment"},a={video:i},[4,this.decodeFromConstraints(a,e,n)];case 1:return[2,o.sent()]}})})},r.prototype.decodeFromVideoElement=function(t,e){return Qr(this,void 0,void 0,function(){var n,i;return en(this,function(a){switch(a.label){case 0:if(r.checkCallbackFnOrThrow(e),!t)throw new cn("A video element must be provided.");return n=r.prepareVideoElement(t),i=this.options.tryPlayVideoTimeout,[4,r.playVideoOnLoadAsync(n,i)];case 1:return a.sent(),[2,this.scan(n,e)]}})})},r.prototype.decodeFromVideoUrl=function(t,e){return Qr(this,void 0,void 0,function(){var n,i,a,o;return en(this,function(s){switch(s.label){case 0:if(r.checkCallbackFnOrThrow(e),!t)throw new cn("An URL must be provided.");return n=r.prepareVideoElement(),n.src=t,i=function(){r.cleanVideoSource(n)},a=this.options.tryPlayVideoTimeout,[4,r.playVideoOnLoadAsync(n,a)];case 1:return s.sent(),o=this.scan(n,e,i),[2,o]}})})},r.prototype.decodeOnceFromConstraints=function(t,e){return Qr(this,void 0,void 0,function(){var n;return en(this,function(i){switch(i.label){case 0:return[4,this.getUserMedia(t)];case 1:return n=i.sent(),[4,this.decodeOnceFromStream(n,e)];case 2:return[2,i.sent()]}})})},r.prototype.decodeOnceFromStream=function(t,e){return Qr(this,void 0,void 0,function(){var n,i,a;return en(this,function(o){switch(o.label){case 0:return n=Boolean(e),[4,r.attachStreamToVideo(t,e)];case 1:i=o.sent(),o.label=2;case 2:return o.trys.push([2,,4,5]),[4,this.scanOneResult(i)];case 3:return a=o.sent(),[2,a];case 4:return n||r.cleanVideoSource(i),[7];case 5:return[2]}})})},r.prototype.decodeOnceFromVideoDevice=function(t,e){return Qr(this,void 0,void 0,function(){var n,i;return en(this,function(a){switch(a.label){case 0:return t?n={deviceId:{exact:t}}:n={facingMode:"environment"},i={video:n},[4,this.decodeOnceFromConstraints(i,e)];case 1:return[2,a.sent()]}})})},r.prototype.decodeOnceFromVideoElement=function(t){return Qr(this,void 0,void 0,function(){var e,n;return en(this,function(i){switch(i.label){case 0:if(!t)throw new cn("A video element must be provided.");return e=r.prepareVideoElement(t),n=this.options.tryPlayVideoTimeout,[4,r.playVideoOnLoadAsync(e,n)];case 1:return i.sent(),[4,this.scanOneResult(e)];case 2:return[2,i.sent()]}})})},r.prototype.decodeOnceFromVideoUrl=function(t){return Qr(this,void 0,void 0,function(){var e,n;return en(this,function(i){switch(i.label){case 0:if(!t)throw new cn("An URL must be provided.");e=r.prepareVideoElement(),e.src=t,n=this.decodeOnceFromVideoElement(e),i.label=1;case 1:return i.trys.push([1,,3,4]),[4,n];case 2:return[2,i.sent()];case 3:return r.cleanVideoSource(e),[7];case 4:return[2]}})})},r.prototype.scanOneResult=function(t,e,n,i){var a=this;return e===void 0&&(e=!0),n===void 0&&(n=!0),i===void 0&&(i=!0),new Promise(function(o,s){a.scan(t,function(u,c,l){if(u){o(u),l.stop();return}if(c){if(c instanceof ze&&e||c instanceof bn&&n||c instanceof ct&&i)return;l.stop(),s(c)}})})},r.prototype.scan=function(t,e,n){var i=this;r.checkCallbackFnOrThrow(e);var a=r.createCaptureCanvas(t),o;try{o=a.getContext("2d",{willReadFrequently:!0})}catch{o=a.getContext("2d")}if(!o)throw new Error("Couldn't create canvas for visual element scan.");var s=function(){o=void 0,a=void 0},u=!1,c,l=function(){u=!0,clearTimeout(c),s(),n&&n()},d={stop:l},h=function(){if(!u)try{r.drawImageOnCanvas(o,t);var f=i.decodeFromCanvas(a);e(f,void 0,d),c=setTimeout(h,i.options.delayBetweenScanSuccess)}catch(y){e(void 0,y,d);var g=y instanceof bn,m=y instanceof ct,p=y instanceof ze;if(g||m||p){c=setTimeout(h,i.options.delayBetweenScanAttempts);return}s(),n&&n(y)}};return h(),d},r.prototype._decodeOnLoadImage=function(t){return Qr(this,void 0,void 0,function(){var e;return en(this,function(n){switch(n.label){case 0:return e=r.isImageLoaded(t),e?[3,2]:[4,r._waitImageLoad(t)];case 1:n.sent(),n.label=2;case 2:return[2,this.decode(t)]}})})},r.prototype.getUserMedia=function(t){return Qr(this,void 0,void 0,function(){var e;return en(this,function(n){switch(n.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return e=n.sent(),r.streamTracker.push(e),[2,e]}})})},r.streamTracker=[],r}(),gF=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}();(function(r){gF(t,r);function t(e,n){return r.call(this,new vh,e,n)||this}return t})(Su);var vF=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}();(function(r){vF(t,r);function t(e,n){return r.call(this,new xu(e),e,n)||this}return t})(Su);var yF=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}();(function(r){yF(t,r);function t(e,n){return r.call(this,new xh,e,n)||this}return t})(Su);var bF=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}();(function(r){bF(t,r);function t(e,n){var i=this,a=new bb;return a.setHints(e),i=r.call(this,a,e,n)||this,i.reader=a,i}return Object.defineProperty(t.prototype,"possibleFormats",{set:function(e){this.hints.set(Hr.POSSIBLE_FORMATS,e),this.reader.setHints(this.hints)},enumerable:!1,configurable:!0}),t.prototype.decodeBitmap=function(e){return this.reader.decodeWithState(e)},t.prototype.setHints=function(e){this.hints=e,this.reader.setHints(this.hints)},t})(Su);var wF=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}();(function(r){wF(t,r);function t(e,n){return r.call(this,new Th,e,n)||this}return t})(Su);var _F=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),uX=function(r){_F(t,r);function t(e,n){return r.call(this,new Eh,e,n)||this}return t}(Su),Fb="http://www.w3.org/2000/svg",cX=function(){function r(){}return r.prototype.write=function(t,e,n,i){if(t.length===0)throw new Bt("Found empty contents");if(e<0||n<0)throw new Bt("Requested dimensions are too small: "+e+"x"+n);var a=$0.L,o=r.QUIET_ZONE_SIZE;if(i){if(i.get(Jo.ERROR_CORRECTION)!==void 0){var s=i.get(Jo.ERROR_CORRECTION).toString();a=$0.fromString(s)}i.get(Jo.MARGIN)!==void 0&&(o=Number.parseInt(i.get(Jo.MARGIN).toString(),10))}var u=TN.encode(t,a,i);return this.renderResult(u,e,n,o)},r.prototype.writeToDom=function(t,e,n,i,a){if(typeof t=="string"){var o=document.querySelector(t);if(!o)throw new Error("Could no find the target HTML element.");t=o}var s=this.write(e,n,i,a);t instanceof HTMLElement&&t.appendChild(s)},r.prototype.renderResult=function(t,e,n,i){var a=t.getMatrix();if(a===null)throw new yu;for(var o=a.getWidth(),s=a.getHeight(),u=o+i*2,c=s+i*2,l=Math.max(e,u),d=Math.max(n,c),h=Math.min(Math.floor(l/u),Math.floor(d/c)),f=Math.floor((l-o*h)/2),g=Math.floor((d-s*h)/2),m=this.createSVGElement(l,d),p=0,y=g;p(()=>{var e={d:(_,w)=>{for(var x in w)e.o(w,x)&&!e.o(_,x)&&Object.defineProperty(_,x,{enumerable:!0,get:w[x]})},o:(_,w)=>Object.prototype.hasOwnProperty.call(_,w),r:_=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(_,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(_,"__esModule",{value:!0})}},n={};e.d(n,{default:()=>S});var i={};function a(_,w,x,A,k={}){w instanceof HTMLCollection||w instanceof NodeList?w=Array.from(w):Array.isArray(w)||(w=[w]),Array.isArray(x)||(x=[x]);for(const R of w)for(const M of x)R[_](M,A,An({capture:!1},k));return Array.prototype.slice.call(arguments,1)}e.r(i),e.d(i,{adjustableInputNumbers:()=>h,createElementFromString:()=>u,createFromTemplate:()=>c,eventPath:()=>l,off:()=>s,on:()=>o,resolveElement:()=>d});const o=a.bind(null,"addEventListener"),s=a.bind(null,"removeEventListener");function u(_){const w=document.createElement("div");return w.innerHTML=_.trim(),w.firstElementChild}function c(_){const w=(A,k)=>{const R=A.getAttribute(k);return A.removeAttribute(k),R},x=(A,k={})=>{const R=w(A,":obj"),M=w(A,":ref"),X=R?k[R]={}:k;M&&(k[M]=A);for(const K of Array.from(A.children)){const te=w(K,":arr"),$=x(K,te?{}:X);te&&(X[te]||(X[te]=[])).push(Object.keys($).length?$:K)}return k};return x(u(_))}function l(_){let w=_.path||_.composedPath&&_.composedPath();if(w)return w;let x=_.target.parentElement;for(w=[_.target,x];x=x.parentElement;)w.push(x);return w.push(document,window),w}function d(_){return _ instanceof Element?_:typeof _=="string"?_.split(/>>/g).reduce((w,x,A,k)=>(w=w.querySelector(x),Ax){function x(A){const k=[.001,.01,.1][Number(A.shiftKey||2*A.ctrlKey)]*(A.deltaY<0?1:-1);let R=0,M=_.selectionStart;_.value=_.value.replace(/[\d.]+/g,(X,K)=>K<=M&&K+X.length>=M?(M=K,w(Number(X),k,R)):(R++,X)),_.focus(),_.setSelectionRange(M,M),A.preventDefault(),_.dispatchEvent(new Event("input"))}o(_,"focus",()=>o(window,"wheel",x,{passive:!1})),o(_,"blur",()=>s(window,"wheel",x))}const{min:f,max:g,floor:m,round:p}=Math;function y(_,w,x){w/=100,x/=100;const A=m(_=_/360*6),k=_-A,R=x*(1-w),M=x*(1-k*w),X=x*(1-(1-k)*w),K=A%6;return[255*[x,M,R,R,X,x][K],255*[X,x,x,M,R,R][K],255*[R,R,X,x,x,M][K]]}function v(_,w,x){const A=(2-(w/=100))*(x/=100)/2;return A!==0&&(w=A===1?0:A<.5?w*x/(2*A):w*x/(2-2*A)),[_,100*w,100*A]}function b(_,w,x){const A=f(_/=255,w/=255,x/=255),k=g(_,w,x),R=k-A;let M,X;if(R===0)M=X=0;else{X=R/k;const K=((k-_)/6+R/2)/R,te=((k-w)/6+R/2)/R,$=((k-x)/6+R/2)/R;_===k?M=$-te:w===k?M=1/3+K-$:x===k&&(M=2/3+te-K),M<0?M+=1:M>1&&(M-=1)}return[360*M,100*X,100*k]}function E(_,w,x,A){return w/=100,x/=100,[...b(255*(1-f(1,(_/=100)*(1-(A/=100))+A)),255*(1-f(1,w*(1-A)+A)),255*(1-f(1,x*(1-A)+A)))]}function D(_,w,x){w/=100;const A=2*(w*=(x/=100)<.5?x:1-x)/(x+w)*100,k=100*(x+w);return[_,isNaN(A)?0:A,k]}function F(_){return b(..._.match(/.{2}/g).map(w=>parseInt(w,16)))}function z(_){_=_.match(/^[a-zA-Z]+$/)?function(k){if(k.toLowerCase()==="black")return"#000";const R=document.createElement("canvas").getContext("2d");return R.fillStyle=k,R.fillStyle==="#000"?null:R.fillStyle}(_):_;const w={cmyk:/^cmyk\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)/i,rgba:/^rgba?\D+([\d.]+)(%?)\D+([\d.]+)(%?)\D+([\d.]+)(%?)\D*?(([\d.]+)(%?)|$)/i,hsla:/^hsla?\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)\D*?(([\d.]+)(%?)|$)/i,hsva:/^hsva?\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)\D*?(([\d.]+)(%?)|$)/i,hexa:/^#?(([\dA-Fa-f]{3,4})|([\dA-Fa-f]{6})|([\dA-Fa-f]{8}))$/i},x=k=>k.map(R=>/^(|\d+)\.\d+|\d+$/.test(R)?Number(R):void 0);let A;e:for(const k in w)if(A=w[k].exec(_))switch(k){case"cmyk":{const[,R,M,X,K]=x(A);if(R>100||M>100||X>100||K>100)break e;return{values:E(R,M,X,K),type:k}}case"rgba":{let[,R,,M,,X,,,K]=x(A);if(R=A[2]==="%"?R/100*255:R,M=A[4]==="%"?M/100*255:M,X=A[6]==="%"?X/100*255:X,K=A[9]==="%"?K/100:K,R>255||M>255||X>255||K<0||K>1)break e;return{values:[...b(R,M,X),K],a:K,type:k}}case"hexa":{let[,R]=A;R.length!==4&&R.length!==3||(R=R.split("").map(K=>K+K).join(""));const M=R.substring(0,6);let X=R.substring(6);return X=X?parseInt(X,16)/255:void 0,{values:[...F(M),X],a:X,type:k}}case"hsla":{let[,R,M,X,,K]=x(A);if(K=A[6]==="%"?K/100:K,R>360||M>100||X>100||K<0||K>1)break e;return{values:[...D(R,M,X),K],a:K,type:k}}case"hsva":{let[,R,M,X,,K]=x(A);if(K=A[6]==="%"?K/100:K,R>360||M>100||X>100||K<0||K>1)break e;return{values:[R,M,X,K],a:K,type:k}}}return{values:null,type:null}}function W(_=0,w=0,x=0,A=1){const k=(M,X)=>(K=-1)=>X(~K?M.map(te=>Number(te.toFixed(K))):M),R={h:_,s:w,v:x,a:A,toHSVA(){const M=[R.h,R.s,R.v,R.a];return M.toString=k(M,X=>`hsva(${X[0]}, ${X[1]}%, ${X[2]}%, ${R.a})`),M},toHSLA(){const M=[...v(R.h,R.s,R.v),R.a];return M.toString=k(M,X=>`hsla(${X[0]}, ${X[1]}%, ${X[2]}%, ${R.a})`),M},toRGBA(){const M=[...y(R.h,R.s,R.v),R.a];return M.toString=k(M,X=>`rgba(${X[0]}, ${X[1]}, ${X[2]}, ${R.a})`),M},toCMYK(){const M=function(X,K,te){const $=y(X,K,te),q=$[0]/255,O=$[1]/255,L=$[2]/255,V=f(1-q,1-O,1-L);return[100*(V===1?0:(1-q-V)/(1-V)),100*(V===1?0:(1-O-V)/(1-V)),100*(V===1?0:(1-L-V)/(1-V)),100*V]}(R.h,R.s,R.v);return M.toString=k(M,X=>`cmyk(${X[0]}%, ${X[1]}%, ${X[2]}%, ${X[3]}%)`),M},toHEXA(){const M=function(K,te,$){return y(K,te,$).map(q=>p(q).toString(16).padStart(2,"0"))}(R.h,R.s,R.v),X=R.a>=1?"":Number((255*R.a).toFixed(0)).toString(16).toUpperCase().padStart(2,"0");return X&&M.push(X),M.toString=()=>`#${M.join("").toUpperCase()}`,M},clone:()=>W(R.h,R.s,R.v,R.a)};return R}const U=_=>Math.max(Math.min(_,1),0);function G(_){const w={options:Object.assign({lock:null,onchange:()=>0,onstop:()=>0},_),_keyboard(R){const{options:M}=w,{type:X,key:K}=R;if(document.activeElement===M.wrapper){const{lock:te}=w.options,$=K==="ArrowUp",q=K==="ArrowRight",O=K==="ArrowDown",L=K==="ArrowLeft";if(X==="keydown"&&($||q||O||L)){let V=0,J=0;te==="v"?V=$||q?1:-1:te==="h"?V=$||q?-1:1:(J=$?-1:O?1:0,V=L?-1:q?1:0),w.update(U(w.cache.x+.01*V),U(w.cache.y+.01*J)),R.preventDefault()}else K.startsWith("Arrow")&&(w.options.onstop(),R.preventDefault())}},_tapstart(R){o(document,["mouseup","touchend","touchcancel"],w._tapstop),o(document,["mousemove","touchmove"],w._tapmove),R.cancelable&&R.preventDefault(),w._tapmove(R)},_tapmove(R){const{options:M,cache:X}=w,{lock:K,element:te,wrapper:$}=M,q=$.getBoundingClientRect();let O=0,L=0;if(R){const re=R&&R.touches&&R.touches[0];O=R?(re||R).clientX:0,L=R?(re||R).clientY:0,Oq.left+q.width&&(O=q.left+q.width),Lq.top+q.height&&(L=q.top+q.height),O-=q.left,L-=q.top}else X&&(O=X.x*q.width,L=X.y*q.height);K!=="h"&&(te.style.left=`calc(${O/q.width*100}% - ${te.offsetWidth/2}px)`),K!=="v"&&(te.style.top=`calc(${L/q.height*100}% - ${te.offsetHeight/2}px)`),w.cache={x:O/q.width,y:L/q.height};const V=U(O/q.width),J=U(L/q.height);switch(K){case"v":return M.onchange(V);case"h":return M.onchange(J);default:return M.onchange(V,J)}},_tapstop(){w.options.onstop(),s(document,["mouseup","touchend","touchcancel"],w._tapstop),s(document,["mousemove","touchmove"],w._tapmove)},trigger(){w._tapmove()},update(R=0,M=0){const{left:X,top:K,width:te,height:$}=w.options.wrapper.getBoundingClientRect();w.options.lock==="h"&&(M=R),w._tapmove({clientX:X+te*R,clientY:K+$*M})},destroy(){const{options:R,_tapstart:M,_keyboard:X}=w;s(document,["keydown","keyup"],X),s([R.wrapper,R.element],"mousedown",M),s([R.wrapper,R.element],"touchstart",M,{passive:!1})}},{options:x,_tapstart:A,_keyboard:k}=w;return o([x.wrapper,x.element],"mousedown",A),o([x.wrapper,x.element],"touchstart",A,{passive:!1}),o(document,["keydown","keyup"],k),w}function ee(_={}){_=Object.assign({onchange:()=>0,className:"",elements:[]},_);const w=o(_.elements,"click",x=>{_.elements.forEach(A=>A.classList[x.target===A?"add":"remove"](_.className)),_.onchange(x),x.stopPropagation()});return{destroy:()=>s(...w)}}const P={variantFlipOrder:{start:"sme",middle:"mse",end:"ems"},positionFlipOrder:{top:"tbrl",right:"rltb",bottom:"btrl",left:"lrbt"},position:"bottom",margin:8,padding:0},I=(_,w,x)=>{const A=typeof _!="object"||_ instanceof HTMLElement?An({reference:_,popper:w},x):_;return{update(k=A){const{reference:R,popper:M}=Object.assign(A,k);if(!M||!R)throw new Error("Popper- or reference-element missing.");return((X,K,te)=>{const{container:$,arrow:q,margin:O,padding:L,position:V,variantFlipOrder:J,positionFlipOrder:re}=An(An({container:document.documentElement.getBoundingClientRect()},P),te),{left:ae,top:j}=K.style;K.style.left="0",K.style.top="0";const ue=X.getBoundingClientRect(),Q=K.getBoundingClientRect(),B={t:ue.top-Q.height-O,b:ue.bottom+O,r:ue.right+O,l:ue.left-Q.width-O},H={vs:ue.left,vm:ue.left+ue.width/2-Q.width/2,ve:ue.left+ue.width-Q.width,hs:ue.top,hm:ue.bottom-ue.height/2-Q.height/2,he:ue.bottom-Q.height},[Z,oe="middle"]=V.split("-"),ce=re[Z],ne=J[oe],{top:se,left:fe,bottom:de,right:ve}=$;for(const Ee of ce){const Se=Ee==="t"||Ee==="b";let Fe=B[Ee];const[He,qe]=Se?["top","left"]:["left","top"],[et,Be]=Se?[Q.height,Q.width]:[Q.width,Q.height],[Ge,tt]=Se?[de,ve]:[ve,de],[rt,lt]=Se?[se,fe]:[fe,se];if(!(FeGe))for(const Nt of ne){let Wt=H[(Se?"v":"h")+Nt];if(!(Wttt)){if(Wt-=Q[qe],Fe-=Q[He],K.style[qe]=`${Wt}px`,K.style[He]=`${Fe}px`,q){const dt=Se?ue.width/2:ue.height/2,Pt=Be/2,_t=dt>Pt,gt=Wt+{s:_t?Pt:dt,m:Pt,e:_t?Pt:Be-dt}[Nt],hr=Fe+{t:et,b:0,r:0,l:et}[Ee];q.style[qe]=`${gt}px`,q.style[He]=`${hr}px`}return Ee+Nt}}}return K.style.left=ae,K.style.top=j,null})(R,M,A)}}},C=class{constructor(w){fi(this,"_initializingActive",!0);fi(this,"_recalc",!0);fi(this,"_nanopop",null);fi(this,"_root",null);fi(this,"_color",W());fi(this,"_lastColor",W());fi(this,"_swatchColors",[]);fi(this,"_setupAnimationFrame",null);fi(this,"_eventListener",{init:[],save:[],hide:[],show:[],clear:[],change:[],changestop:[],cancel:[],swatchselect:[]});this.options=w=Object.assign(An({},C.DEFAULT_OPTIONS),w);const{swatches:x,components:A,theme:k,sliders:R,lockOpacity:M,padding:X}=w;["nano","monolith"].includes(k)&&!R&&(w.sliders="h"),A.interaction||(A.interaction={});const{preview:K,opacity:te,hue:$,palette:q}=A;A.opacity=!M&&te,A.palette=q||K||te||$,this._preBuild(),this._buildComponents(),this._bindEvents(),this._finalBuild(),x&&x.length&&x.forEach(J=>this.addSwatch(J));const{button:O,app:L}=this._root;this._nanopop=I(O,L,{margin:X}),O.setAttribute("role","button"),O.setAttribute("aria-label",this._t("btn:toggle"));const V=this;this._setupAnimationFrame=requestAnimationFrame(function J(){if(!L.offsetWidth)return requestAnimationFrame(J);V.setColor(w.default),V._rePositioningPicker(),w.defaultRepresentation&&(V._representation=w.defaultRepresentation,V.setColorRepresentation(V._representation)),w.showAlways&&V.show(),V._initializingActive=!1,V._emit("init")})}_preBuild(){const{options:w}=this;for(const x of["el","container"])w[x]=d(w[x]);this._root=(x=>{const{components:A,useAsButton:k,inline:R,appClass:M,theme:X,lockOpacity:K}=x.options,te=L=>L?"":'style="display:none" hidden',$=L=>x._t(L),q=c(`
${k?"":''}
`),O=q.interaction;return O.options.find(L=>!L.hidden&&!L.classList.add("active")),O.type=()=>O.options.find(L=>L.classList.contains("active")),q})(this),w.useAsButton&&(this._root.button=w.el),w.container.appendChild(this._root.root)}_finalBuild(){const w=this.options,x=this._root;if(w.container.removeChild(x.root),w.inline){const A=w.el.parentElement;w.el.nextSibling?A.insertBefore(x.app,w.el.nextSibling):A.appendChild(x.app)}else w.container.appendChild(x.app);w.useAsButton?w.inline&&w.el.remove():w.el.parentNode.replaceChild(x.root,w.el),w.disabled&&this.disable(),w.comparison||(x.button.style.transition="none",w.useAsButton||(x.preview.lastColor.style.transition="none")),this.hide()}_buildComponents(){const w=this,x=this.options.components,A=(w.options.sliders||"v").repeat(2),[k,R]=A.match(/^[vh]+$/g)?A:[],M=()=>this._color||(this._color=this._lastColor.clone()),X={palette:G({element:w._root.palette.picker,wrapper:w._root.palette.palette,onstop:()=>w._emit("changestop","slider",w),onchange(K,te){if(!x.palette)return;const $=M(),{_root:q,options:O}=w,{lastColor:L,currentColor:V}=q.preview;w._recalc&&($.s=100*K,$.v=100-100*te,$.v<0&&($.v=0),w._updateOutput("slider"));const J=$.toRGBA().toString(0);this.element.style.background=J,this.wrapper.style.background=` linear-gradient(to top, rgba(0, 0, 0, ${$.a}), transparent), linear-gradient(to left, hsla(${$.h}, 100%, 50%, ${$.a}), rgba(255, 255, 255, ${$.a})) `,O.comparison?O.useAsButton||w._lastColor||L.style.setProperty("--pcr-color",J):(q.button.style.setProperty("--pcr-color",J),q.button.classList.remove("clear"));const re=$.toHEXA().toString();for(const{el:ae,color:j}of w._swatchColors)ae.classList[re===j.toHEXA().toString()?"add":"remove"]("pcr-active");V.style.setProperty("--pcr-color",J)}}),hue:G({lock:R==="v"?"h":"v",element:w._root.hue.picker,wrapper:w._root.hue.slider,onstop:()=>w._emit("changestop","slider",w),onchange(K){if(!x.hue||!x.palette)return;const te=M();w._recalc&&(te.h=360*K),this.element.style.backgroundColor=`hsl(${te.h}, 100%, 50%)`,X.palette.trigger()}}),opacity:G({lock:k==="v"?"h":"v",element:w._root.opacity.picker,wrapper:w._root.opacity.slider,onstop:()=>w._emit("changestop","slider",w),onchange(K){if(!x.opacity||!x.palette)return;const te=M();w._recalc&&(te.a=Math.round(100*K)/100),this.element.style.background=`rgba(0, 0, 0, ${te.a})`,X.palette.trigger()}}),selectable:ee({elements:w._root.interaction.options,className:"active",onchange(K){w._representation=K.target.getAttribute("data-type").toUpperCase(),w._recalc&&w._updateOutput("swatch")}})};this._components=X}_bindEvents(){const{_root:w,options:x}=this,A=[o(w.interaction.clear,"click",()=>this._clearColor()),o([w.interaction.cancel,w.preview.lastColor],"click",()=>{this.setHSVA(...(this._lastColor||this._color).toHSVA(),!0),this._emit("cancel")}),o(w.interaction.save,"click",()=>{!this.applyColor()&&!x.showAlways&&this.hide()}),o(w.interaction.result,["keyup","input"],k=>{this.setColor(k.target.value,!0)&&!this._initializingActive&&(this._emit("change",this._color,"input",this),this._emit("changestop","input",this)),k.stopImmediatePropagation()}),o(w.interaction.result,["focus","blur"],k=>{this._recalc=k.type==="blur",this._recalc&&this._updateOutput(null)}),o([w.palette.palette,w.palette.picker,w.hue.slider,w.hue.picker,w.opacity.slider,w.opacity.picker],["mousedown","touchstart"],()=>this._recalc=!0,{passive:!0})];if(!x.showAlways){const k=x.closeWithKey;A.push(o(w.button,"click",()=>this.isOpen()?this.hide():this.show()),o(document,"keyup",R=>this.isOpen()&&(R.key===k||R.code===k)&&this.hide()),o(document,["touchstart","mousedown"],R=>{this.isOpen()&&!l(R).some(M=>M===w.app||M===w.button)&&this.hide()},{capture:!0}))}if(x.adjustableNumbers){const k={rgba:[255,255,255,1],hsva:[360,100,100,1],hsla:[360,100,100,1],cmyk:[100,100,100,100]};h(w.interaction.result,(R,M,X)=>{const K=k[this.getColorRepresentation().toLowerCase()];if(K){const te=K[X],$=R+(te>=100?1e3*M:M);return $<=0?0:Number((${R.isOpen()&&(x.closeOnScroll&&R.hide(),k===null?(k=setTimeout(()=>k=null,100),requestAnimationFrame(function M(){R._rePositioningPicker(),k!==null&&requestAnimationFrame(M)})):(clearTimeout(k),k=setTimeout(()=>k=null,100)))},{capture:!0}))}this._eventBindings=A}_rePositioningPicker(){const{options:w}=this;if(!w.inline&&!this._nanopop.update({container:document.body.getBoundingClientRect(),position:w.position})){const x=this._root.app,A=x.getBoundingClientRect();x.style.top=(window.innerHeight-A.height)/2+"px",x.style.left=(window.innerWidth-A.width)/2+"px"}}_updateOutput(w){const{_root:x,_color:A,options:k}=this;if(x.interaction.type()){const R=`to${x.interaction.type().getAttribute("data-type")}`;x.interaction.result.value=typeof A[R]=="function"?A[R]().toString(k.outputPrecision):""}!this._initializingActive&&this._recalc&&this._emit("change",A,w,this)}_clearColor(w=!1){const{_root:x,options:A}=this;A.useAsButton||x.button.style.setProperty("--pcr-color","rgba(0, 0, 0, 0.15)"),x.button.classList.add("clear"),A.showAlways||this.hide(),this._lastColor=null,this._initializingActive||w||(this._emit("save",null),this._emit("clear"))}_parseLocalColor(w){const{values:x,type:A,a:k}=z(w),{lockOpacity:R}=this.options,M=k!==void 0&&k!==1;return x&&x.length===3&&(x[3]=void 0),{values:!x||R&&M?null:x,type:A}}_t(w){return this.options.i18n[w]||C.I18N_DEFAULTS[w]}_emit(w,...x){this._eventListener[w].forEach(A=>A(...x,this))}on(w,x){return this._eventListener[w].push(x),this}off(w,x){const A=this._eventListener[w]||[],k=A.indexOf(x);return~k&&A.splice(k,1),this}addSwatch(w){const{values:x}=this._parseLocalColor(w);if(x){const{_swatchColors:A,_root:k}=this,R=W(...x),M=u(`