From 52823626fcadb9fbc8b4345bf79e6ea342a65742 Mon Sep 17 00:00:00 2001 From: skyboy Date: Wed, 4 Sep 2024 09:26:55 +0800 Subject: [PATCH] change word style --- CHANGELOG.md | 2 + frontend/public/docx/assets/index.82ba8f6a.js | 248 ++++++++++++++++++ .../public/docx/assets/index.ea630926.css | 1 + .../docx/assets/vertical-align.bd5ac83a.svg | 1 + frontend/public/docx/index.html | 6 +- 5 files changed, 255 insertions(+), 3 deletions(-) create mode 100644 frontend/public/docx/assets/index.82ba8f6a.js create mode 100644 frontend/public/docx/assets/index.ea630926.css create mode 100644 frontend/public/docx/assets/vertical-align.bd5ac83a.svg diff --git a/CHANGELOG.md b/CHANGELOG.md index a58026a..6fcfa53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,6 @@ ## 变更记录 +-2024-09-04 +1. 修复word导入格式丢失问题 -2024-09-03 1. 修复文件重命名错误的bug 2. 修复拖拽上传中断的bug diff --git a/frontend/public/docx/assets/index.82ba8f6a.js b/frontend/public/docx/assets/index.82ba8f6a.js new file mode 100644 index 0000000..b4d6b8a --- /dev/null +++ b/frontend/public/docx/assets/index.82ba8f6a.js @@ -0,0 +1,248 @@ +var U1=Object.defineProperty;var W1=(r,e,t)=>e in r?U1(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var Rr=(r,e,t)=>(W1(r,typeof e!="symbol"?e+"":e,t),t);const V1=function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function t(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerpolicy&&(o.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?o.credentials="include":i.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=t(i);fetch(i.href,o)}};V1();const Y1=[],Yu=[],k1={margins:[100,120,100,120],watermark:{data:"",size:120},pageNumber:{format:"\u7B2C{pageNo}\u9875/\u5171{pageCount}\u9875"},placeholder:{data:"\u8BF7\u8F93\u5165\u6B63\u6587"},zone:{tipDisabled:!1},maskMargin:[60,0,30,0]};var Bn=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Z1(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Q1(r){if(r.__esModule)return r;var e=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(r).forEach(function(t){var n=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:function(){return r[t]}})}),e}function Ho(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 Ed={exports:{}};(function(r){var e=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 t=function(n){var i=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,o=0,a={},s={manual:n.Prism&&n.Prism.manual,disableWorkerMessageHandler:n.Prism&&n.Prism.disableWorkerMessageHandler,util:{encode:function m(x){return x instanceof l?new l(x.type,m(x.content),x.alias):Array.isArray(x)?x.map(m):x.replace(/&/g,"&").replace(/"+A.content+""};function c(m,x,T,P){m.lastIndex=x;var A=m.exec(T);if(A&&P&&A[1]){var D=A[1].length;A.index+=D,A[0]=A[0].slice(D)}return A}function u(m,x,T,P,A,D){for(var W in T)if(!(!T.hasOwnProperty(W)||!T[W])){var _=T[W];_=Array.isArray(_)?_:[_];for(var Q=0;Q<_.length;++Q){if(D&&D.cause==W+","+Q)return;var te=_[Q],O=te.inside,I=!!te.lookbehind,y=!!te.greedy,L=te.alias;if(y&&!te.pattern.global){var k=te.pattern.toString().match(/[imsuy]*$/)[0];te.pattern=RegExp(te.pattern.source,k+"g")}for(var F=te.pattern||te,Y=P.next,V=A;Y!==x.tail&&!(D&&V>=D.reach);V+=Y.value.length,Y=Y.next){var ie=Y.value;if(x.length>m.length)return;if(!(ie instanceof l)){var U=1,N;if(y){if(N=c(F,V,m,I),!N||N.index>=m.length)break;var ee=N.index,J=N.index+N[0].length,B=V;for(B+=Y.value.length;ee>=B;)Y=Y.next,B+=Y.value.length;if(B-=Y.value.length,V=B,Y.value instanceof l)continue;for(var re=Y;re!==x.tail&&(BD.reach&&(D.reach=z);var H=Y.prev;C&&(H=d(x,H,C),V+=C.length),f(x,H,U);var j=new l(W,O?s.tokenize(X,O):X,L,X);if(Y=d(x,H,j),G&&d(x,Y,G),U>1){var ue={cause:W+","+Q,reach:z};u(m,x,T,Y.prev,V,ue),D&&ue.reach>D.reach&&(D.reach=ue.reach)}}}}}}function h(){var m={value:null,prev:null,next:null},x={value:null,prev:m,next:null};m.next=x,this.head=m,this.tail=x,this.length=0}function d(m,x,T){var P=x.next,A={value:T,prev:x,next:P};return x.next=A,P.prev=A,m.length++,A}function f(m,x,T){for(var P=x.next,A=0;A/,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"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},t.languages.markup.tag.inside["attr-value"].inside.entity=t.languages.markup.entity,t.languages.markup.doctype.inside["internal-subset"].inside=t.languages.markup,t.hooks.add("wrap",function(n){n.type==="entity"&&(n.attributes.title=n.content.replace(/&/,"&"))}),Object.defineProperty(t.languages.markup.tag,"addInlined",{value:function(i,o){var a={};a["language-"+o]={pattern:/(^$)/i,lookbehind:!0,inside:t.languages[o]},a.cdata=/^$/i;var s={"included-cdata":{pattern://i,inside:a}};s["language-"+o]={pattern:/[\s\S]+/,inside:t.languages[o]};var l={};l[i]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return i}),"i"),lookbehind:!0,greedy:!0,inside:s},t.languages.insertBefore("markup","cdata",l)}}),Object.defineProperty(t.languages.markup.tag,"addAttribute",{value:function(n,i){t.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:t.languages[i]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),t.languages.html=t.languages.markup,t.languages.mathml=t.languages.markup,t.languages.svg=t.languages.markup,t.languages.xml=t.languages.extend("markup",{}),t.languages.ssml=t.languages.xml,t.languages.atom=t.languages.xml,t.languages.rss=t.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:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+i.source+")*?"+/(?:;|(?=\s*\{))/.source),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 o=n.languages.markup;o&&(o.tag.addInlined("style","css"),o.tag.addAttribute("style","css"))}(t),t.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:/[{}[\];(),.:]/},t.languages.javascript=t.languages.extend("clike",{"class-name":[t.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}|\?\?=?|\?\.?|[~:]/}),t.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,t.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:t.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:t.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:t.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:t.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:t.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),t.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:t.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"}}),t.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),t.languages.markup&&(t.languages.markup.tag.addInlined("script","javascript"),t.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")),t.languages.js=t.languages.javascript,function(){if(typeof t=="undefined"||typeof document=="undefined")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var n="Loading\u2026",i=function(g,v){return"\u2716 Error "+g+" while fetching file: "+v},o="\u2716 Error: File does not exist or is empty",a={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},s="data-src-status",l="loading",c="loaded",u="failed",h="pre[data-src]:not(["+s+'="'+c+'"]):not(['+s+'="'+l+'"])';function d(g,v,R){var m=new XMLHttpRequest;m.open("GET",g,!0),m.onreadystatechange=function(){m.readyState==4&&(m.status<400&&m.responseText?v(m.responseText):m.status>=400?R(i(m.status,m.statusText)):R(o))},m.send(null)}function f(g){var v=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(g||"");if(v){var R=Number(v[1]),m=v[2],x=v[3];return m?x?[R,Number(x)]:[R,void 0]:[R,R]}}t.hooks.add("before-highlightall",function(g){g.selector+=", "+h}),t.hooks.add("before-sanity-check",function(g){var v=g.element;if(v.matches(h)){g.code="",v.setAttribute(s,l);var R=v.appendChild(document.createElement("CODE"));R.textContent=n;var m=v.getAttribute("data-src"),x=g.language;if(x==="none"){var T=(/\.(\w+)$/.exec(m)||[,"none"])[1];x=a[T]||T}t.util.setLanguage(R,x),t.util.setLanguage(v,x);var P=t.plugins.autoloader;P&&P.loadLanguages(x),d(m,function(A){v.setAttribute(s,c);var D=f(v.getAttribute("data-range"));if(D){var W=A.split(/\r\n?|\n/g),_=D[0],Q=D[1]==null?W.length:D[1];_<0&&(_+=W.length),_=Math.max(0,Math.min(_-1,W.length)),Q<0&&(Q+=W.length),Q=Math.max(0,Math.min(Q,W.length)),A=W.slice(_,Q).join(` +`),v.hasAttribute("data-start")||v.setAttribute("data-start",String(_+1))}R.textContent=A,t.highlightElement(R)},function(A){v.setAttribute(s,u),R.textContent=A})}}),t.plugins.fileHighlight={highlight:function(v){for(var R=(v||document).querySelectorAll(h),m=0,x;x=R[m++];)t.highlightElement(x)}};var p=!1;t.fileHighlight=function(){p||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),p=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(Ed);var ku=Ed.exports;const K1="0.9.81";var Ei=(r=>(r.HALF="half",r.ONE_THIRD="one-third",r.QUARTER="quarter",r))(Ei||{}),Ia=(r=>(r.ARABIC="arabic",r.CHINESE="chinese",r))(Ia||{}),ze=(r=>(r.INLINE="inline",r.BLOCK="block",r.FLOAT_TOP="float-top",r.FLOAT_BOTTOM="float-bottom",r))(ze||{});const Ne="\u200B",Zu=` +`,H1=" ",Qu=" ",B1=["\xB7","\u3001",":","\uFF1A",",","\uFF0C",".","\u3002",";","\uFF1B","?","\uFF1F","!","\uFF01"],_d={[Ei.HALF]:1/2,[Ei.ONE_THIRD]:1/3,[Ei.QUARTER]:1/4},G1={ENGLISH:"A-Za-z",SPANISH:"A-Za-z\xC1\xC9\xCD\xD3\xDA\xE1\xE9\xED\xF3\xFA\xD1\xF1\xDC\xFC",FRENCH:"A-Za-z\xC0\xC2\xC7\xE0\xE2\xE7\xC9\xE9\xC8\xE8\xCA\xEA\xCB\xEB\xCE\xEE\xCF\xEF\xD4\xF4\xD9\xF9\xDB\xFB\u0178\xFF",GERMAN:"A-Za-z\xC4\xE4\xD6\xF6\xDC\xFC\xDF",RUSSIAN:"\u0410-\u042F\u0430-\u044F\u0401\u0451",PORTUGUESE:"A-Za-z\xC1\xC9\xCD\xD3\xDA\xE1\xE9\xED\xF3\xFA\xC3\xD5\xE3\xF5\xC7\xE7",ITALIAN:"A-Za-z\xC0\xE0\xC8\xE8\xC9\xE9\xCC\xEC\xCD\xED\xCE\xEE\xD3\xF3\xD2\xF2\xD9\xF9",DUTCH:"A-Za-z\xC0\xE0\xC1\xE1\xC2\xE2\xC4\xE4\xC8\xE8\xC9\xE9\xCA\xEA\xCB\xEB\xCC\xEC\xCD\xED\xCE\xEE\xCF\xEF\xD3\xF3\xD2\xF2\xD4\xF4\xD6\xF6\xD9\xF9\xDB\xFB\xDC\xFC",SWEDISH:"A-Za-z\xC5\xE5\xC4\xE4\xD6\xF6",GREEK:"\u0391\u03B1\u0392\u03B2\u0393\u03B3\u0394\u03B4\u0395\u03B5\u0396\u03B6\u0397\u03B7\u0398\u03B8\u0399\u03B9\u039A\u03BA\u039B\u03BB\u039C\u03BC\u039D\u03BD\u039E\u03BE\u039F\u03BF\u03A0\u03C0\u03A1\u03C1\u03A3\u03C3\u03C2\u03A4\u03C4\u03A5\u03C5\u03A6\u03C6\u03A7\u03C7\u03A8\u03C8\u03A9\u03C9"},J1="\u65E5";var Ge=(r=>(r.LEFT="left",r.CENTER="center",r.RIGHT="right",r.ALIGNMENT="alignment",r.JUSTIFY="justify",r))(Ge||{});const ms=/[0-9.]/,z1=/[\uD800-\uDBFF][\uDC00-\uDFFF]/,$1=/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,j1=new RegExp(`${$1.source}|${z1.source}`,"g"),q1=/[、,。?!;:……「」“”‘’*()【】〔〕〖〗〘〙〚〛《》———﹝﹞–—\\/·.,!?;:`~<>()[\]{}'"|]/,Id=new RegExp(`^[${Ne} +]`);function Nd(r,e){let t;return function(...n){t&&window.clearTimeout(t),t=window.setTimeout(()=>{r.apply(this,n)},e)}}function eg(r,e){let t=0,n;return function(...i){const o=Date.now();o-t>=e?(window.clearTimeout(n),r.apply(this,i),t=o):(window.clearTimeout(n),n=window.setTimeout(()=>{r.apply(this,i),t=o},e))}}function Cl(r,e){if(!r||typeof r!="object")return r;let t={};return Array.isArray(r)?t=r.map(n=>Cl(n,e)):Object.keys(r).forEach(n=>{if(!e.includes(n))return t[n]=Cl(r[n],e)}),t}function gt(r){if(!r||typeof r!="object")return r;let e={};return Array.isArray(r)?e=r.map(t=>gt(t)):Object.keys(r).forEach(t=>e[t]=gt(r[t])),e}function vs(r){return r&&r.nodeType===1&&r.tagName.toLowerCase()==="body"}function Na(r,e,t){if(r&&!vs(r))for(r=t?r:r.parentNode;r;){if(!e||e(r)||vs(r))return e&&!e(r)&&vs(r)?null:r;r=r.parentNode}return null}function it(){function r(){return((1+Math.random())*65536|0).toString(16).substring(1)}return r()+r()+"-"+r()+"-"+r()+"-"+r()+"-"+r()+r()+r()}function Wr(r){const e=[];if(Intl.Segmenter){const n=new Intl.Segmenter().segment(r);for(const{segment:i}of n)e.push(i)}else{const t=new Map;for(const i of r.matchAll(j1))t.set(i.index,i[0]);let n=0;for(;n=r-1&&(t(a),n=0)};e.addEventListener("click",o)}function Ma(r){return Object.prototype.toString.call(r)==="[object Object]"}function Ku(r){return Array.isArray(r)}function Ld(r,e){if(Ma(r)&&Ma(e)){const t=e;for(const[n,i]of Object.entries(r))t[n]?t[n]=Ld(i,t[n]):t[n]=i}else Ku(r)&&Ku(e)&&e.push(...r);return e}function La(r){setTimeout(()=>{r()},0)}function Hu(r){const e=["\u96F6","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D"],t=["","\u5341","\u767E","\u5343","\u4E07","\u5341","\u767E","\u5343","\u4EBF","\u5341","\u767E","\u5343","\u4E07","\u5341","\u767E","\u5343","\u4EBF"];if(!r||isNaN(r))return"\u96F6";const n=r.toString().split("");let i="";for(let o=0;oString.fromCharCode(o));return window.btoa(n.join(""))}function ig(r){let e=r.parentElement;for(;e;){const n=window.getComputedStyle(e).getPropertyValue("overflow-y");if(e.scrollHeight>e.clientHeight&&(n==="auto"||n==="scroll"))return e;e=e.parentElement}return document.documentElement}function og(r,e){return r.length!==e.length?!1:!r.some(t=>!e.includes(t))}function ag(r,e){if(!Ma(r)||!Ma(e))return!1;const t=Object.keys(r),n=Object.keys(e);return t.length!==n.length?!1:!t.some(i=>e[i]!==r[i])}const sg=12,lg={width:1,color:"#000000",dragWidth:2,dragColor:"#0000FF"},fn="editor-component",Fe="ce",Rc=`${Fe}-clipboard`;var ir=(r=>(r.UP="top",r.DOWN="down",r.LEFT="left",r.RIGHT="right",r))(ir||{}),ae=(r=>(r.TEXT="text",r.IMAGE="image",r.TABLE="table",r.HYPERLINK="hyperlink",r.SUPERSCRIPT="superscript",r.SUBSCRIPT="subscript",r.SEPARATOR="separator",r.PAGE_BREAK="pageBreak",r.CONTROL="control",r.CHECKBOX="checkbox",r.RADIO="radio",r.LATEX="latex",r.TAB="tab",r.DATE="date",r.BLOCK="block",r.TITLE="title",r.LIST="list",r))(ae||{});const ri=["bold","color","highlight","font","size","italic","underline","strikeout","textDecoration"],Mo=["rowFlex","rowMargin"],cg=["type","font","size","bold","color","italic","highlight","underline","strikeout","rowFlex","url","hyperlinkId","dateId","dateFormat","groupIds","rowMargin","textDecoration"],ug=["type","font","size","bold","color","italic","highlight","underline","strikeout","rowFlex","rowMargin","dashArray","trList","borderType","width","height","url","colgroup","valueList","control","checkbox","radio","dateFormat","block","level","title","listType","listStyle","listWrap","groupIds","conceptId","imgDisplay","imgFloatPosition","textDecoration","extension","externalId"],hg=["verticalAlign","backgroundColor","borderTypes","slashTypes"],mc=["tdId","trId","tableId"],fg=["level","titleId","title"],Fd=["listId","listType","listStyle"],Bu=["control","controlId","controlComponent"],Ci=["font","size","bold","highlight","italic","strikeout"],Cd=[...mc,...fg,...Fd,...Mo],Gr=[ae.TEXT,ae.HYPERLINK,ae.SUBSCRIPT,ae.SUPERSCRIPT,ae.CONTROL,ae.DATE],dg=[ae.IMAGE,ae.LATEX],pg=[ae.BLOCK,ae.PAGE_BREAK,ae.SEPARATOR,ae.TABLE],gg=["HR","TABLE","UL","OL"],Rg=[ae.TITLE,ae.LIST];class Ad{constructor(e){this.draw=e,this.options=e.getOptions(),this.container=e.getContainer(),this.imageCache=new Map,this.floatImageContainer=null,this.floatImage=null}createFloatImage(e){const{scale:t}=this.options;let n=this.floatImageContainer,i=this.floatImage;n||(n=document.createElement("div"),n.classList.add(`${Fe}-float-image`),this.container.append(n),this.floatImageContainer=n),i||(i=document.createElement("img"),n.append(i),this.floatImage=i),n.style.display="none",i.style.width=`${e.width*t}px`,i.style.height=`${e.height*t}px`;const o=this.draw.getHeight(),a=this.draw.getPageGap(),s=this.draw.getPageNo()*(o+a),l=e.imgFloatPosition;n.style.left=`${l.x}px`,n.style.top=`${s+l.y}px`,i.src=e.value}dragFloatImage(e,t){if(!this.floatImageContainer)return;this.floatImageContainer.style.display="block";const n=parseFloat(this.floatImageContainer.style.left)+e,i=parseFloat(this.floatImageContainer.style.top)+t;this.floatImageContainer.style.left=`${n}px`,this.floatImageContainer.style.top=`${i}px`}destroyFloatImage(){this.floatImageContainer&&(this.floatImageContainer.style.display="none")}addImageObserver(e){this.draw.getImageObserver().add(e)}getFallbackImage(e,t){const i=(e-Math.ceil(e/8)*8)/2,o=(t-Math.ceil(t/8)*8)/2,a=` + + + + + + + + `,s=new Image;return s.src=`data:image/svg+xml;base64,${ng(a)}`,s}render(e,t,n,i){const{scale:o}=this.options,a=t.width*o,s=t.height*o;if(this.imageCache.has(t.id)){const l=this.imageCache.get(t.id);e.drawImage(l,n,i,a,s)}else{const l=new Promise((c,u)=>{const h=new Image;h.setAttribute("crossOrigin","Anonymous"),h.src=t.value,h.onload=()=>{this.imageCache.set(t.id,h),c(t),t.imgDisplay===ze.FLOAT_BOTTOM?this.draw.render({isCompute:!1,isSetCursor:!1,isSubmitHistory:!1}):e.drawImage(h,n,i,a,s)},h.onerror=d=>{const f=this.getFallbackImage(a,s);f.onload=()=>{e.drawImage(f,n,i,a,s),this.imageCache.set(t.id,f)},u(d)}});this.addImageObserver(l)}}}const Bo="R".charCodeAt(0);function wi(r){return Al[r]==null&&mg(r),Al[r]}function mg(r){const e=vg[r];if(e==null)return;const t=e.substring(3,5),n=1*t.charCodeAt(0)-Bo,i=1*t.charCodeAt(1)-Bo,o=e.substring(5),a=[[]];let s=1/0,l=-1/0,c=1/0,u=-1/0,h=0;for(;hf>RfR",797:" 3D`D``D",798:" 3RRR>Rf",799:" 3D`DD``",800:" 3D`DR`R",801:" 3F^FY^K",802:" 3KYK^YF",803:" 3RRRDR`",804:" 3KYKFY^",805:" 3F^FK^Y",806:" 3KYKRYR",807:" 3MWMWWM",808:" 3RRRKRY",809:" 3MWMMWW",810:" 8GRRGPGMHJJHMGPGR",811:" 8GRGRGTHWJZM\\P]R]",812:" 8R]R]T]W\\ZZ\\W]T]R",813:" 8R]]R]P\\MZJWHTGRG",814:" 9D`DOGQKSPTTTYS]Q`O",815:" 9PUUDSGQKPPPTQYS]U`",816:" 9OTODQGSKTPTTSYQ]O`",817:" 9D`DUGSKQPPTPYQ]S`U",818:" 5KYRJYNKVRZ",819:" 5JZJRNKVYZR",820:" 5KYKVKNYVYN",821:" 5JZLXJPZTXL",822:" 23JZJ]L]O\\Q[TXUVVSVOULTJSIQIPJOLNONSOVPXS[U\\X]Z]",823:" 23I]]Z]X\\U[SXPVOSNONLOJPIQISJTLUOVSVVUXT[Q\\O]L]J",824:" 23JZZGXGUHSIPLONNQNUOXPZQ[S[TZUXVUVQUNTLQIOHLGJG",825:" 23G[GJGLHOIQLTNUQVUVXUZT[S[QZPXOUNQNNOLPISHUGXGZ",826:" 21E[EPFRHTJUMVQVUUXSZP[NZLWLSMQNNPLSKVKYL\\M^",827:" 19EYETHVKWPWSVVTXQYNYLXKVKSLPNNQMTMYN\\P_",828:" 26OUQOOQOSQUSUUSUQSOQO RQPPQPSQTSTTSTQSPQP RRQQRRSSRRQ",829:" 11RWRMSMUNVOWQWSVUUVSWRW",830:" 9D`DRJR RORUR RZR`R",831:" 5D`DUDO`O`U",832:" 6JZRDJR RRDZR",833:" 9D`DR`R RJYZY RP`T`",834:" 9D`DR`R RDRRb R`RRb",840:" 18KYQKNLLNKQKSLVNXQYSYVXXVYSYQXNVLSKQK",841:" 6LXLLLXXXXLLL",842:" 5KYRJKVYVRJ",843:" 6LXRHLRR\\XRRH",844:" 12JZRIPOJOOSMYRUWYUSZOTORI",845:" 6KYRKRY RKRYR",846:" 6MWMMWW RWMMW",847:" 9MWRLRX RMOWU RWOMU",850:" 35NVQNOONQNSOUQVSVUUVSVQUOSNQN ROQOS RPPPT RQOQU RRORU RSOSU RTPTT RUQUS",851:" 27NVNNNVVVVNNN ROOOU RPOPU RQOQU RRORU RSOSU RTOTU RUOUU",852:" 17MWRLMUWURL RROOT RROUT RRRQT RRRST",853:" 17LULRUWUMLR RORTU RORTO RRRTS RRRTQ",854:" 17MWRXWOMORX RRUUP RRUOP RRRSP RRRQP",855:" 17OXXROMOWXR RURPO RURPU RRRPQ RRRPS",856:" 22LXRLNWXPLPVWRL RRRRL RRRLP RRRNW RRRVW RRRXP",857:" 11RYRKRY RRKYNRQ RSMVNSO",860:" 13MWRLRX ROOUO RMUOWQXSXUWWU",861:" 11LXRLRX RLQMOWOXQ RPWTW",862:" 14KYMNWX RWNMX ROLLOKQ RULXOYQ",863:" 18I[NII[ RVI[[ RMM[[ RWMI[ RNIVI RMMWM",864:" 21I[RGRV RMJWP RWJMP RIVL\\ R[VX\\ RIV[V RL\\X\\",865:" 11G[MJSV RKPSL RG\\[\\[RG\\",866:" 14LXPLPPLPLTPTPXTXTTXTXPTPTLPL",867:" 32KYYPXNVLSKQKNLLNKQKSLVNXQYSYVXXVYT RYPWNUMSMQNPOOQOSPUQVSWUWWVYT",868:" 10KYRJKVYVRJ RRZYNKNRZ",869:" 34G]PIPGQFSFTGTI RGZHXJVKTLPLKMJOIUIWJXKXPYTZV\\X]Z RGZ]Z RQZP[Q\\S\\T[SZ",870:" 64JZRMRS RRSQ\\ RRSS\\ RQ\\S\\ RRMQJPHNG RQJNG RRMSJTHVG RSJVG RRMNKLKJM RPLLLJM RRMVKXKZM RTLXLZM RRMPNOOOR RRMPOOR RRMTNUOUR RRMTOUR",871:" 94JZRIRK RRNRP RRSRU RRYQ\\ RRYS\\ RQ\\S\\ RRGQIPJ RRGSITJ RPJRITJ RRKPNNOMN RRKTNVOWN RNOPORNTOVO RRPPSNTLTKRKSLT RRPTSVTXTYRYSXT RNTPTRSTTVT RRUPXOYMZLZKYJWJYLZ RRUTXUYWZXZYYZWZYXZ RMZOZRYUZWZ",872:" 40JZRYQ\\ RRYS\\ RQ\\S\\ RRYUZXZZXZUYTWTYRZOYMWLUMVJUHSGQGOHNJOMMLKMJOKRMTKTJUJXLZOZRY",873:" 32JZRYQ\\ RRYS\\ RQ\\S\\ RRYVXVVXUXRZQZLYIXHVHTGPGNHLHKIJLJQLRLUNVNXRY",874:" 15I[IPKR RLKNP RRGRO RXKVP R[PYR",899:" 6QSRQQRRSSRRQ",900:" 10PTQPPQPSQTSTTSTQSPQP",901:" 14NVQNOONQNSOUQVSVUUVSVQUOSNQN",902:" 18MWQMONNOMQMSNUOVQWSWUVVUWSWQVOUNSMQM",903:" 18KYQKNLLNKQKSLVNXQYSYVXXVYSYQXNVLSKQK",904:" 22G]PGMHJJHMGPGTHWJZM\\P]T]W\\ZZ\\W]T]P\\MZJWHTGPG",905:" 34AcPALBJCGEEGCJBLAPATBXCZE]G_JaLbPcTcXbZa]__]aZbXcTcPbLaJ_G]EZCXBTAPA",906:" 34fRAPCMDJDGCEA>H@JAMAZB]D_G`M`PaRc RRATCWDZD]C_AfHdJcMcZb]`_]`W`TaRc",909:" 33AcRAPCMDJDGCEABGAKAPBTDXG\\L`Rc RRATCWDZD]C_AbGcKcPbT`X]\\X`Rc RBHbH",997:" 3MWMXWX",998:" 3JZJZZZ",999:" 3JZJ]Z]",1001:" 18KYRKMX RRNVX RRKWX ROTTT RKXPX RTXYX",1002:" 35JZNKNX ROKOX RLKSKVLWNVPSQ RSKULVNUPSQ ROQSQVRWTWUVWSXLX RSQURVTVUUWSX",1003:" 24KYVLWKWOVLTKQKOLNMMPMSNVOWQXTXVWWU RQKOMNPNSOVQX",1004:" 26JZNKNX ROKOX RLKSKVLWMXPXSWVVWSXLX RSKULVMWPWSVVUWSX",1005:" 22JYNKNX ROKOX RSOSS RLKVKVOUK ROQSQ RLXVXVTUX",1006:" 20JXNKNX ROKOX RSOSS RLKVKVOUK ROQSQ RLXQX",1007:" 36K[VLWKWOVLTKQKOLNMMPMSNVOWQXTXVW RQKOMNPNSOVQX RTXUWVU RVSVX RWSWX RTSYS",1008:" 27J[NKNX ROKOX RVKVX RWKWX RLKQK RTKYK ROQVQ RLXQX RTXYX",1009:" 12NWRKRX RSKSX RPKUK RPXUX",1010:" 19LXSKSURWQX RTKTUSWQXPXNWMUNTOUNV RQKVK",1011:" 27JZNKNX ROKOX RWKOS RQQVX RRQWX RLKQK RTKYK RLXQX RTXYX",1012:" 14KXOKOX RPKPX RMKRK RMXWXWTVX",1013:" 30I\\MKMX RNNRX RNKRU RWKRX RWKWX RXKXX RKKNK RWKZK RKXOX RUXZX",1014:" 21JZNKNX ROMVX ROKVV RVKVX RLKOK RTKXK RLXPX",1015:" 32KZQKOLNMMPMSNVOWQXTXVWWVXSXPWMVLTKQK RQKOMNPNSOVQX RTXVVWSWPVMTK",1016:" 25JYNKNX ROKOX RLKSKVLWNWOVQSROR RSKULVNVOUQSR RLXQX",1017:" 47KZQKOLNMMPMSNVOWQXTXVWWVXSXPWMVLTKQK RQKOMNPNSOVQX RTXVVWSWPVMTK RPWPUQTSTTUUZV[W[XZ RTUUXVZW[",1018:" 37JZNKNX ROKOX RLKSKVLWNWOVQSROR RSKULVNVOUQSR RLXQX RSRTSUWVXWXXW RSRUSVWWX",1019:" 32KZVMWKWOVMULSKQKOLNMNOOPQQTRVSWT RNNOOQPTQVRWSWVVWTXRXPWOVNTNXOV",1020:" 16KZRKRX RSKSX RNKMOMKXKXOWK RPXUX",1021:" 20J[NKNUOWQXTXVWWUWK ROKOUPWQX RLKQK RUKYK",1022:" 15KYMKRX RNKRU RWKRX RKKPK RTKYK",1023:" 24I[LKOX RMKOT RRKOX RRKUX RSKUT RXKUX RJKOK RVKZK",1024:" 21KZNKVX ROKWX RWKNX RLKQK RTKYK RLXQX RTXYX",1025:" 20LYNKRRRX ROKSR RWKSRSX RLKQK RTKYK RPXUX",1026:" 16LYVKNX RWKOX ROKNONKWK RNXWXWTVX",1027:" 18KYRKMX RRNVX RRKWX ROTTT RKXPX RTXYX",1028:" 35JZNKNX ROKOX RLKSKVLWNVPSQ RSKULVNUPSQ ROQSQVRWTWUVWSXLX RSQURVTVUUWSX",1029:" 14KXOKOX RPKPX RMKWKWOVK RMXRX",1030:" 15KYRKLX RRMWX RRKXX RMWVW RLXXX",1031:" 22JYNKNX ROKOX RSOSS RLKVKVOUK ROQSQ RLXVXVTUX",1032:" 16LYVKNX RWKOX ROKNONKWK RNXWXWTVX",1033:" 27J[NKNX ROKOX RVKVX RWKWX RLKQK RTKYK ROQVQ RLXQX RTXYX",1034:" 44KZQKOLNMMPMSNVOWQXTXVWWVXSXPWMVLTKQK RQKOMNPNSOVQX RTXVVWSWPVMTK RQOQT RTOTT RQQTQ RQRTR",1035:" 12NWRKRX RSKSX RPKUK RPXUX",1036:" 27JZNKNX ROKOX RWKOS RQQVX RRQWX RLKQK RTKYK RLXQX RTXYX",1037:" 15KYRKMX RRNVX RRKWX RKXPX RTXYX",1038:" 30I\\MKMX RNNRX RNKRU RWKRX RWKWX RXKXX RKKNK RWKZK RKXOX RUXZX",1039:" 21JZNKNX ROMVX ROKVV RVKVX RLKOK RTKXK RLXPX",1040:" 36JZMJLM RXJWM RPPOS RUPTS RMVLY RXVWY RMKWK RMLWL RPQTQ RPRTR RMWWW RMXWX",1041:" 32KZQKOLNMMPMSNVOWQXTXVWWVXSXPWMVLTKQK RQKOMNPNSOVQX RTXVVWSWPVMTK",1042:" 21J[NKNX ROKOX RVKVX RWKWX RLKYK RLXQX RTXYX",1043:" 25JYNKNX ROKOX RLKSKVLWNWOVQSROR RSKULVNVOUQSR RLXQX",1044:" 20K[MKRQ RNKSQMX RMKWKXOVK RNWWW RMXWXXTVX",1045:" 16KZRKRX RSKSX RNKMOMKXKXOWK RPXUX",1046:" 33KZMONLOKPKQLRORX RXOWLVKUKTLSOSX RMONMOLPLQMRO RXOWMVLULTMSO RPXUX",1047:" 40KZRKRX RSKSX RQNNOMQMRNTQUTUWTXRXQWOTNQN RQNOONQNROTQU RTUVTWRWQVOTN RPKUK RPXUX",1048:" 21KZNKVX ROKWX RWKNX RLKQK RTKYK RLXQX RTXYX",1049:" 33J[RKRX RSKSX RLPMONOOSQU RTUVSWOXOYP RMONROTQUTUVTWRXO RPKUK RPXUX",1050:" 35KZMVNXQXMRMONMOLQKTKVLWMXOXRTXWXXV ROUNRNOOMQK RTKVMWOWRVU RNWPW RUWWW",1051:" 18KYTKKX RSMTX RTKUX RNTTT RIXNX RRXWX",1052:" 34JYPKLX RQKMX RNKUKWLWNVPSQ RUKVLVNUPSQ ROQRQTRUSUUTWQXJX RRQTSTUSWQX",1053:" 25KXVLWLXKWNVLTKRKPLOMNOMRMUNWPXRXTWUU RRKPMOONRNVPX",1054:" 26JYPKLX RQKMX RNKTKVLWNWQVTUVTWQXJX RTKULVNVQUTTVSWQX",1055:" 22JYPKLX RQKMX RSORS RNKXKWNWK ROQRQ RJXTXUUSX",1056:" 20JXPKLX RQKMX RSORS RNKXKWNWK ROQRQ RJXOX",1057:" 33KYVLWLXKWNVLTKRKPLOMNOMRMUNWPXRXTWUVVS RRKPMOONRNVPX RRXTVUS RSSXS",1058:" 27J[PKLX RQKMX RXKTX RYKUX RNKSK RVK[K ROQVQ RJXOX RRXWX",1059:" 12NWTKPX RUKQX RRKWK RNXSX",1060:" 19LXUKRUQWPX RVKSURWPXOXMWLUMTNUMV RSKXK",1061:" 27JZPKLX RQKMX RYKOR RRPTX RSPUX RNKSK RVK[K RJXOX RRXWX",1062:" 14KXQKMX RRKNX ROKTK RKXUXVUTX",1063:" 30I\\OKKX ROMPX RPKQV RYKPX RYKUX RZKVX RMKPK RYK\\K RIXMX RSXXX",1064:" 21JZPKLX RPKTX RQKTU RXKTX RNKQK RVKZK RJXNX",1065:" 32KYRKPLOMNOMRMUNWPXRXTWUVVTWQWNVLTKRK RRKPMOONRNVPX RRXTVUTVQVMTK",1066:" 24JYPKLX RQKMX RNKUKWLXMXOWQTROR RUKWMWOVQTR RJXOX",1067:" 46KYRKPLOMNOMRMUNWPXRXTWUVVTWQWNVLTKRK RRKPMOONRNVPX RRXTVUTVQVMTK ROWOVPUQURVRZS[T[UZ RRVSZT[",1068:" 35JZPKLX RQKMX RNKUKWLXMXOWQTROR RUKWMWOVQTR RSRTWUXVXWW RSRTSUWVX RJXOX",1069:" 28KZWLXLYKXNWLUKRKPLOMOOPPUSVT RONPOURVSVVUWSXPXNWMULXMWNW",1070:" 16KZTKPX RUKQX RPKNNOKZKYNYK RNXSX",1071:" 20J[PKMUMWOXSXUWVUYK RQKNUNWOX RNKSK RWK[K",1072:" 15KYOKPX RPKQV RYKPX RMKRK RVK[K",1073:" 24I[NKMX ROKNV RTKMX RTKSX RUKTV RZKSX RLKQK RXK\\K",1074:" 21KZPKTX RQKUX RYKLX RNKSK RVK[K RJXOX RRXWX",1075:" 20LYPKRQPX RQKSQ RYKSQQX RNKSK RVK[K RNXSX",1076:" 16LYXKLX RYKMX RQKONPKYK RLXUXVUTX",1101:" 32LZQOPPPQOQOPQOTOVQVWWXXX RTOUQUWWX RURRSPTOUOWPXSXTWUU RRSPUPWQX",1102:" 29JYNKNX ROKOX RORPPROTOVPWRWUVWTXRXPWOU RTOUPVRVUUWTX RLKOK",1103:" 24LXVQUQURVRVQUPSOQOOPNRNUOWQXSXUWVV RQOPPOROUPWQX",1104:" 32L[VKVX RWKWX RVRUPSOQOOPNRNUOWQXSXUWVU RQOPPOROUPWQX RTKWK RVXYX",1105:" 26LXOSVSVRUPSOQOOPNRNUOWQXSXUWVV RUSUQSO RQOPPOROUPWQX",1106:" 20LWTKULUMVMVLTKRKPMPX RRKQMQX RNOSO RNXSX",1107:" 42LYQOOQOSQUSUUSUQSOQO RQOPQPSQU RSUTSTQSO RTPUOVO RPTOUOXPYTYVZ ROWPXTXVYV[T\\P\\N[NYPX",1108:" 28J[NKNX ROKOX RORPPROTOVPWRWX RTOUPVRVX RLKOK RLXQX RTXYX",1109:" 18NWRKRLSLSKRK RRORX RSOSX RPOSO RPXUX",1110:" 23NWSKSLTLTKSK RSOSZR\\ RTOTZR\\P\\O[OZPZP[O[ RQOTO",1111:" 27JZNKNX ROKOX RWOOU RRSVX RSSWX RLKOK RTOYO RLXQX RTXYX",1112:" 12NWRKRX RSKSX RPKSK RPXUX",1113:" 44F_JOJX RKOKX RKRLPNOPORPSRSX RPOQPRRRX RSRTPVOXOZP[R[X RXOYPZRZX RHOKO RHXMX RPXUX RXX]X",1114:" 28J[NONX ROOOX RORPPROTOVPWRWX RTOUPVRVX RLOOO RLXQX RTXYX",1115:" 28LYQOOPNRNUOWQXTXVWWUWRVPTOQO RQOPPOROUPWQX RTXUWVUVRUPTO",1116:" 32JYNON\\ ROOO\\ RORPPROTOVPWRWUVWTXRXPWOU RTOUPVRVUUWTX RLOOO RL\\Q\\",1117:" 29KYUOU\\ RVOV\\ RURTPROPONPMRMUNWPXRXTWUU RPOOPNRNUOWPX RS\\X\\",1118:" 22KXOOOX RPOPX RPRQPSOUOVPVQUQUPVP RMOPO RMXRX",1119:" 26LYTOUPUQVQVPTOQOOPORQSTTVU ROQQRTSVTVWTXQXOWOVPVPWQX",1120:" 14LWPKPVRXTXUWUV RQKQVRX RNOTO",1121:" 28J[NONUOWQXSXUWVU ROOOUPWQX RVOVX RWOWX RLOOO RTOWO RVXYX",1122:" 15KYNORX ROORV RVORX RLOQO RTOXO",1123:" 24I[LOOX RMOOU RROOX RROUX RSOUU RXOUX RJOOO RVOZO",1124:" 21KYNOUX ROOVX RVONX RLOQO RTOXO RLXPX RSXXX",1125:" 23KYNORX ROORV RVORXP[N\\M\\L[LZMZM[L[ RLOQO RTOXO",1126:" 16LXUONX RVOOX ROONQNOVO RNXVXVVUX",1127:" 32K[QOOPNQMSMUNWPXQXSWUUWRXO RQOOQNSNUOWPX RQOSOUPWWXX RSOTPVWXXYX",1128:" 40KXRKPMOOMUK\\ RQLPNNTL\\ RRKTKVLVNUPRQ RTKULUNTPRQ RRQTRUTUVTWRXQXOWNT RRQSRTTTVRX",1129:" 19KYLQNOPORPSSSXR\\ RLQNPPPRQSS RWOVRSXQ\\",1130:" 39KYSOQOOPNQMSMUNWPXRXTWUVVTVRUPRNQLQKRJTJUKVM RQOOQNSNVPX RRXTVUTUQSO RQLRKTKVM",1131:" 27LXVPTOQOOPOQPRRS RQOPPPQRS RRSOTNUNWPXSXUW RRSPTOUOWPX",1132:" 28LWRKQLQMSNVNVMSNPOOPNRNTOVPWRXSYS[R\\P\\O[ RSNQOPPOROTPVRX",1133:" 26IYJRKPLONOOPOQMX RMONPNQLX ROQPPROTOVPVRS\\ RTOUPURR\\",1134:" 35IYJSKQLPNPOQOVPX RMPNQNUOWPXQXSWTVUTVQVNULTKRKQLQNRPURWS RQXSVTTUQUNTK",1135:" 13NWROPVPWQXSXUWVU RSOQVQWRX",1136:" 26KYOOLX RPOMX RUOVPWPVOTORQOR RORPSRWTXVWWU RORQSSWTX",1137:" 15LXLKNKPLWX RNKOLVX RRPMX RRPNX",1138:" 26KZOOK\\ RPOL\\ RNUNWOXQXSWTV RVOTVTWUXWXXWYU RWOUVUWVX",1139:" 19JYNOMX ROONUMX RVRVOWOVRTUQWNXMX RLOOO",1140:" 36MXRKQLQMSNVN RTNQOPPPRRSUS RTNROQPQRRS RSSPTOUOWQXSYTZT[S\\Q\\ RSSQTPUPWQX",1141:" 28KXQOOPNQMSMUNWPXRXTWUVVTVRUPSOQO RQOOQNSNVPX RRXTVUTUQSO",1142:" 20IZPPMX RPPNX RTPSX RTPTX RKQMOXO RKQMPXP",1143:" 29JXSOQOOPNQMSJ\\ RQOOQNSK\\ RSOUPVRVTUVTWRXPXNWMU RSOUQUTTVRX",1144:" 28K[YOQOOPNQMSMUNWPXRXTWUVVTVRUPYP RQOOQNSNVPX RRXTVUTUQSO",1145:" 14KZSPQX RSPRX RMQOOXO RMQOPXP",1146:" 24JXKRLPMOOOPPPROUOWPX RNOOPORNUNWPXQXSWUUVRVOUOVP",1147:" 35KZOPNQMSMUNWPXRXUWWUXRXPWOUOTPSRRUO\\ RMUNVPWRWUVWTXR RXQWPUPSR RRUQXP\\",1148:" 17KXMONOPPS[T\\ RNOOPR[T\\U\\ RVOTRNYL\\",1149:" 28I[TKQ\\ RUKP\\ RJRKPLONOOPOVPWSWUVWT RMONPNTOWPXSXUWWTXRYO",1150:" 36JZNPPPPONPMQLSLUMWNXPXQWRUSR RLUNWPWRU RRRRWSXUXWVXTXRWPVOVPWP RRUSWUWWV",1151:" 32KZVOTVTWUXWXXWYU RWOUVUWVX RUSUQSOQOOPNQMSMUNWPXRXTV RQOOQNSNVPX",1152:" 32JXOKMR RPKNRNVPX RNROPQOSOUPVRVTUVTWRXPXNWMUMR RSOUQUTTVRX RMKPK",1153:" 22KXUPUQVQUPSOQOOPNQMSMUNWPXRXTWUV RQOOQNSNVPX",1154:" 35KZWKTVTWUXWXXWYU RXKUVUWVX RUSUQSOQOOPNQMSMUNWPXRXTV RQOOQNSNVPX RUKXK",1155:" 23KWNURTTSURUPSOQOOPNQMSMUNWPXRXTWUV RQOOQNSNVPX",1156:" 23MXWKXLXKVKTLSNPYO[N\\ RVKULTNQYP[N\\L\\L[M\\ RPOVO",1157:" 34KYVOTVSYR[ RWOUVTYR[P\\M\\L[M[N\\ RUSUQSOQOOPNQMSMUNWPXRXTV RQOOQNSNVPX",1158:" 29KZPKLX RQKMX ROQPPROTOVPVRUUUWVX RTOUPURTUTWUXWXXWYU RNKQK",1159:" 26MWSKSLTLTKSK RNROPPOROSPSRRURWSX RQORPRRQUQWRXTXUWVU",1160:" 26MWTKTLULUKTK RORPPQOSOTPTRRYQ[O\\M\\M[N\\ RROSPSRQYP[O\\",1161:" 32KXPKLX RQKMX RVPUQVQVPUOTORQPROR RORPSQWRXTXUWVU RORQSRWSX RNKQK",1162:" 16NVSKPVPWQXSXTWUU RTKQVQWRX RQKTK",1163:" 46F^GRHPIOKOLPLQJX RJOKPKQIX RLQMPOOQOSPSQQX RQORPRQPX RSQTPVOXOZPZRYUYWZX RXOYPYRXUXWYX[X\\W]U",1164:" 33J[KRLPMOOOPPPQNX RNOOPOQMX RPQQPSOUOWPWRVUVWWX RUOVPVRUUUWVXXXYWZU",1165:" 28KXQOOPNQMSMUNWPXRXTWUVVTVRUPSOQO RQOOQNSNVPX RRXTVUTUQSO",1166:" 35JYKRLPMOOOPPPQM\\ RNOOPOQL\\ RPQROTOVPWRWTVVUWSXQXOVOT RTOVQVTUVSX RJ\\O\\",1167:" 28KYVOR\\ RWOS\\ RUSUQSOQOOPNQMSMUNWPXRXTV RQOOQNSNVPX RP\\U\\",1168:" 22LXMRNPOOQORPRQPX RPOQPQQOX RRQSPUOVOWPWQVQWP",1169:" 24LYVPVQWQVPTOQOOPORQSTTVU ROQQRTSVTVWTXQXOWNVOVOW",1170:" 16NWSKPVPWQXSXTWUU RTKQVQWRX RPOUO",1171:" 33IZJRKPLONOOPORNUNWOX RMONPNRMUMWOXQXSWTV RVOTVTWUXWXXWYU RWOUVUWVX",1172:" 24JXKRLPMOOOPPPROUOWPX RNOOPORNUNWPXQXSWUUVRVOUOVP",1173:" 37H\\IRJPKOMONPNRMUMWNX RLOMPMRLULWNXOXQWRV RTORVRWTX RUOSVSWTXUXWWYUZRZOYOZP",1174:" 38JZMRNPPOROSPSR RQORPRRQUPWNXMXLWLVMVLW RXPWQXQXPWOVOTPSRRURWSX RQUQWRXTXVWWU",1175:" 35IYJRKPLONOOPORNUNWOX RMONPNRMUMWOXQXSWTV RVOTVSYR[ RWOUVTYR[P\\M\\L[M[N\\",1176:" 27KYWOWPVQNVMWMX RNQOOROUQ ROPRPUQVQ RNVOVRWUW ROVRXUXVV",1177:" 39H[RKSLSMTMTLRKOKMLLNLX ROKNLMNMX RXKYLYMZMZLXKVKTMTX RVKUMUX RJOWO RJXOX RRXWX",1178:" 29J[UKVLWLWKQKOLNNNX RQKPLONOX RVOVX RWOWX RLOWO RLXQX RTXYX",1179:" 27J[WKQKOLNNNX RQKPLONOX RUKVLVX RWKWX RLOVO RLXQX RTXYX",1180:" 48F_PKQLQMRMRLPKMKKLJNJX RMKLLKNKX RYKZL[L[KUKSLRNRX RUKTLSNSX RZOZX R[O[X RHO[O RHXMX RPXUX RXX]X",1181:" 46F_PKQLQMRMRLPKMKKLJNJX RMKLLKNKX R[KUKSLRNRX RUKTLSNSX RYKZLZX R[K[X RHOZO RHXMX RPXUX RXX]X",1182:" 12NWRORX RSOSX RPOSO RPXUX",1184:" 21LXVPTOROPPOQNSNUOWQXSXUW RROPQOSOVQX ROSSS",1185:" 35LYSKQLPMOONRNUOWPXRXTWUVVTWQWNVLUKSK RSKQMPOOSOVPX RRXTVUTVPVMUK ROQVQ",1186:" 34KZTKQ\\ RUKP\\ RQONPMRMUNWQXTXWWXUXRWPTOQO RQOOPNRNUOWQX RTXVWWUWRVPTO",1187:" 22LXUPVRVQUPSOQOOPNRNTOVRX RQOOQOTPVRXSYS[R\\P\\",1191:" 45I[VKWLXLVKSKQLPMOOLYK[J\\ RSKQMPOMYL[J\\H\\H[I\\ RZK[L[KYKWLVNSYR[Q\\ RYKXLWNTYS[Q\\O\\O[P\\ RLOYO",1192:" 38IZVKWLXLXKSKQLPMOOLYK[J\\ RSKQMPOMYL[J\\H\\H[I\\ RVOTVTWUXWXXWYU RWOUVUWVX RLOWO",1193:" 38IZVKWL RXKSKQLPMOOLYK[J\\ RSKQMPOMYL[J\\H\\H[I\\ RWKTVTWUXWXXWYU RXKUVUWVX RLOVO",1194:" 63F^SKTLTM RULSKPKNLMMLOIYH[G\\ RPKNMMOJYI[G\\E\\E[F\\ RZK[L\\L\\KWKUL RTMSOPYO[N\\ RWKUMTOQYP[N\\L\\L[M\\ RZOXVXWYX[X\\W]U R[OYVYWZX RIO[O",1195:" 63F^SKTLTM RULSKPKNLMMLOIYH[G\\ RPKNMMOJYI[G\\E\\E[F\\ RZK[L R\\KWKUL RTMSOPYO[N\\ RWKUMTOQYP[N\\L\\L[M\\ R[KXVXWYX[X\\W]U R\\KYVYWZX RIOZO",1196:" 20MWNROPPOROSPSRRURWSX RQORPRRQUQWRXTXUWVU",1200:" 28LYQKOLNONTOWQXTXVWWTWOVLTKQK RQKPLOOOTPWQX RTXUWVTVOULTK",1201:" 10LYPNSKSX RRLRX ROXVX",1202:" 35LYOMONNNNMOLQKTKVLWNVPTQQROSNUNX RTKULVNUPTQ RNWOVPVSWVWWV RPVSXVXWVWU",1203:" 39LYOMONNNNMOLQKTKVLWNVPTQ RTKULVNUPTQ RRQTQVRWTWUVWTXQXOWNVNUOUOV RTQURVTVUUWTX",1204:" 13LYSMSX RTKTX RTKMTXT RQXVX",1205:" 33LYOKNQ ROKVK ROLSLVK RNQOPQOTOVPWRWUVWTXQXOWNVNUOUOV RTOUPVRVUUWTX",1206:" 36LYVMVNWNWMVLTKRKPLOMNPNUOWQXTXVWWUWSVQTPQPNR RRKPMOPOUPWQX RTXUWVUVSUQTP",1207:" 22LYNKNO RVMRTPX RWKTQQX RNMPKRKUM RNMPLRLUMVM",1208:" 51LYQKOLNNOPQQTQVPWNVLTKQK RQKPLONPPQQ RTQUPVNULTK RQQORNTNUOWQXTXVWWUWTVRTQ RQQPROTOUPWQX RTXUWVUVTURTQ",1209:" 36LYOVOUNUNVOWQXSXUWVVWSWNVLTKQKOLNNNPORQSTSWQ RSXUVVSVNULTK RQKPLONOPPRQS",1210:" 6NVRVQWRXSWRV",1211:" 8NVSWRXQWRVSWSYQ[",1212:" 12NVROQPRQSPRO RRVQWRXSWRV",1213:" 14NVROQPRQSPRO RSWRXQWRVSWSYQ[",1214:" 15NVRKQLRSSLRK RRLRO RRVQWRXSWRV",1215:" 29LYNNONOONONNOLQKTKVLWNWOVQSRRSRTST RTKVMVPUQSR RRWRXSXSWRW",1216:" 6OVRKRP RSKRP",1217:" 12LXOKOP RPKOP RUKUP RVKUP",1218:" 10MWQKPLPNQOSOTNTLSKQK",1219:" 9MWRJRP ROKUO RUKOO",1220:" 3KZXHM\\",1221:" 16MWUHSJQMPPPTQWSZU\\ RSJRLQPQTRXSZ",1222:" 16MWOHQJSMTPTTSWQZO\\ RQJRLSPSTRXQZ",1223:" 12MWPHP\\ RQHQ\\ RPHUH RP\\U\\",1224:" 12MWSHS\\ RTHT\\ ROHTH RO\\T\\",1225:" 38LWSHQIPJPLRNSP RQIPL RSNRQ RPJQLSNSPRQPRRSSTSVQXPZ RRSSV RPXQ[ RSTRVPXPZQ[S\\",1226:" 38MXQHSITJTLRNQP RSITL RQNRQ RTJSLQNQPRQTRRSQTQVSXTZ RRSQV RTXS[ RQTRVTXTZS[Q\\",1227:" 4MWTHPRT\\",1228:" 4MWPHTRP\\",1229:" 3OURHR\\",1230:" 6MWPHP\\ RTHT\\",1231:" 3I[LRXR",1232:" 6I[RLRX RLRXR",1233:" 9JZRMRX RMRWR RMXWX",1234:" 9JZRMRX RMMWM RMRWR",1235:" 6JZMMWW RWMMW",1236:" 6NVRQQRRSSRRQ",1237:" 15I[RLQMRNSMRL RLRXR RRVQWRXSWRV",1238:" 6I[LPXP RLTXT",1239:" 9I[WLMX RLPXP RLTXT",1240:" 9I[LNXN RLRXR RLVXV",1241:" 4JZWLMRWX",1242:" 4JZMLWRMX",1243:" 10JZWKMOWS RMTWT RMXWX",1244:" 10JZMKWOMS RMTWT RMXWX",1245:" 21H[YUWUUTTSRPQOONNNLOKQKRLTNUOUQTRSTPUOWNYN",1246:" 16JZLTLRMPOPUSWSXR RLRMQOQUTWTXRXP",1247:" 8JZMSRPWS RMSRQWS",1248:" 7NVSKPO RSKTLPO",1249:" 7NVQKTO RQKPLTO",1250:" 14LXNKOMQNSNUMVK RNKONQOSOUNVK",1251:" 8NVSLRMQLRKSLSNQP",1252:" 8NVSKQMQORPSORNQO",1253:" 8NVQLRMSLRKQLQNSP",1254:" 8NVQKSMSORPQORNSO",1256:" 11JZWMQMONNOMQMSNUOVQWWW",1257:" 11JZMMMSNUOVQWSWUVVUWSWM",1258:" 11JZMMSMUNVOWQWSVUUVSWMW",1259:" 11JZMWMQNOONQMSMUNVOWQWW",1260:" 14JZWMQMONNOMQMSNUOVQWWW RMRUR",1261:" 13I[TOUPXRUTTU RUPWRUT RLRWR",1262:" 13MWRMRX ROPPORLTOUP RPORMTO",1263:" 13I[POOPLROTPU ROPMROT RMRXR",1264:" 13MWRLRW ROTPURXTUUT RPURWTU",1265:" 37KYVSUPSOQOOPNQMSMUNWPXRXTWUVVTWQWNVLTKQKPLQLRK RQOOQNSNVPX RRXTVUTVQVNULTK",1266:" 15JZLKRX RMKRV RXKRX RLKXK RNLWL",1267:" 10G[IOLORW RKORX R[FRX",1268:" 26I[XIXJYJYIXHVHTJSLROQUPYO[ RUITKSORUQXPZN\\L\\K[KZLZL[",1269:" 40I[XIXJYJYIXHVHTJSLROQUPYO[ RUITKSORUQXPZN\\L\\K[KZLZL[ RQNOONQNSOUQVSVUUVSVQUOSNQN",1270:" 26H\\ZRYTWUVUTTSSQPPONNMNKOJQJRKTMUNUPTQSSPTOVNWNYOZQZR",1271:" 26JZXKLX ROKPLPNOOMOLNLLMKOKSLVLXK RUTTUTWUXWXXWXUWTUT",1272:" 41J[YPXPXQYQYPXOWOVPUTTVSWQXOXMWLVLTMSORRPSNSLRKPKOLONPQUWWXXXYW ROXMVMTOR RONPPVWWX",1273:" 29J[UPSOQOPQPRQTSTUS RUOUSVTXTYRYQXNVLSKRKOLMNLQLRMUOWRXSXVW",1274:" 34KZQHQ\\ RTHT\\ RWLVLVMWMWLUKPKNLNNOPVSWT RNNOOVRWTWVVWTXQXOWNVNUOUOVNV",1275:" 12KYRKN\\ RVKR\\ RNQWQ RMVVV",1276:" 40LXTLSLSMTMTLSKQKPLPNQPTRUS RPNQOTQUSUUSW RQPOROTPVSXTY ROTPUSWTYT[S\\Q\\P[PZQZQ[P[",1277:" 29LXRKQLRMSLRK RRMRQ RRQQSRVSSRQ RRVR\\ RPOONNOOPPOTOUNVOUPTO",1278:" 42LXRMSLRKQLRMRQQRSURV RRQSRQURVRZQ[R\\S[RZ RPOONNOOPPOTOUNVOUPTO RPXOWNXOYPXTXUWVXUYTX",1279:" 12LYVKVX RNKVK RQQVQ RNXVX",1281:" 24H\\QKNLLNKQKSLVNXQYSYVXXVYSYQXNVLSKQK RRQQRRSSRRQ",1282:" 33LYQKPLPMQN RTKULUMTN RRNPOOQORPTRUSUUTVRVQUOSNRN RRURY RSUSY ROWVW",1283:" 23LYRKPLONOOPQRRSRUQVOVNULSKRK RRRRX RSRSX ROUVU",1284:" 24H\\QKNLLNKQKSLVNXQYSYVXXVYSYQXNVLSKQK RRKRY RKRYR",1285:" 25JYRRPQOQMRLTLUMWOXPXRWSUSTRR RWMRR RRMWMWR RRMVNWR",1286:" 25JZLLMKOKQLRNRPQRPSNT ROKPLQNQQPS RVKUX RWKTX RNTXT",1287:" 27JYNKNU ROKNR RNROPQOSOUPVQVTTVTXUYVYWX RSOUQUTTV RLKOK",1288:" 27LYONRKRQ RVNSKSQ RRQPROTOUPWRXSXUWVUVTURSQ RRTRUSUSTRT",1289:" 27JZRKRY RMKMPNRPSTSVRWPWK RLMMKNM RQMRKSM RVMWKXM ROVUV",1290:" 27JYNKNX ROKOX RLKSKVLWNWOVQSROR RSKULVNVOUQSR RLXVXVUUX",1291:" 20LYWKTKQLONNQNSOVQXTYWY RWKTLRNQQQSRVTXWY",1292:" 23JZRRPQOQMRLTLUMWOXPXRWSUSTRR RSLQQ RWMRR RXQSS",1293:" 12KYPMTW RTMPW RMPWT RWPMT",1294:" 34J[OUMULVLXMYOYPXPVNTMRMONMOLQKTKVLWMXOXRWTUVUXVYXYYXYVXUVU RNMPLULWM",1295:" 34J[OOMOLNLLMKOKPLPNNPMRMUNWOXQYTYVXWWXUXRWPUNULVKXKYLYNXOVO RNWPXUXWW",1401:" 21F^KHK\\ RLHL\\ RXHX\\ RYHY\\ RHH\\H RH\\O\\ RU\\\\\\",1402:" 20H]KHRQJ\\ RJHQQ RJHYHZMXH RK[X[ RJ\\Y\\ZWX\\",1403:" 20KYVBTDRGPKOPOTPYR]T`Vb RTDRHQKPPPTQYR\\T`",1404:" 20KYNBPDRGTKUPUTTYR]P`Nb RPDRHSKTPTTSYR\\P`",1405:" 12KYOBOb RPBPb ROBVB RObVb",1406:" 12KYTBTb RUBUb RNBUB RNbUb",1407:" 40KYTBRCQDPFPHQJRKSMSOQQ RRCQEQGRISJTLTNSPORSTTVTXSZR[Q]Q_Ra RQSSUSWRYQZP\\P^Q`RaTb",1408:" 40KYPBRCSDTFTHSJRKQMQOSQ RRCSESGRIQJPLPNQPURQTPVPXQZR[S]S_Ra RSSQUQWRYSZT\\T^S`RaPb",1409:" 24KYU@RCPFOIOLPOSVTYT\\S_Ra RRCQEPHPKQNTUUXU[T^RaOd",1410:" 24KYO@RCTFUIULTOQVPYP\\Q_Ra RRCSETHTKSNPUOXO[P^RaUd",1411:" 13AXCRGRR` RGSRa RFSRb RX:Rb",1412:" 32F^[CZD[E\\D\\C[BYBWCUETGSJRNPZO^N` RVDUFTJRVQZP]O_MaKbIbHaH`I_J`Ia",2001:" 18H\\RFK[ RRFY[ RRIX[ RMUVU RI[O[ RU[[[",2002:" 45G]LFL[ RMFM[ RIFUFXGYHZJZLYNXOUP RUFWGXHYJYLXNWOUP RMPUPXQYRZTZWYYXZU[I[ RUPWQXRYTYWXYWZU[",2003:" 32G\\XIYLYFXIVGSFQFNGLIKKJNJSKVLXNZQ[S[VZXXYV RQFOGMILKKNKSLVMXOZQ[",2004:" 30G]LFL[ RMFM[ RIFSFVGXIYKZNZSYVXXVZS[I[ RSFUGWIXKYNYSXVWXUZS[",2005:" 22G\\LFL[ RMFM[ RSLST RIFYFYLXF RMPSP RI[Y[YUX[",2006:" 20G[LFL[ RMFM[ RSLST RIFYFYLXF RMPSP RI[P[",2007:" 40G^XIYLYFXIVGSFQFNGLIKKJNJSKVLXNZQ[S[VZXX RQFOGMILKKNKSLVMXOZQ[ RXSX[ RYSY[ RUS\\S",2008:" 27F^KFK[ RLFL[ RXFX[ RYFY[ RHFOF RUF\\F RLPXP RH[O[ RU[\\[",2009:" 12MXRFR[ RSFS[ ROFVF RO[V[",2010:" 20KZUFUWTZR[P[NZMXMVNUOVNW RTFTWSZR[ RQFXF",2011:" 27F\\KFK[ RLFL[ RYFLS RQOY[ RPOX[ RHFOF RUF[F RH[O[ RU[[[",2012:" 14I[NFN[ ROFO[ RKFRF RK[Z[ZUY[",2013:" 30F_KFK[ RLFRX RKFR[ RYFR[ RYFY[ RZFZ[ RHFLF RYF]F RH[N[ RV[][",2014:" 21G^LFL[ RMFYY RMHY[ RYFY[ RIFMF RVF\\F RI[O[",2015:" 44G]QFNGLIKKJOJRKVLXNZQ[S[VZXXYVZRZOYKXIVGSFQF RQFOGMILKKOKRLVMXOZQ[ RS[UZWXXVYRYOXKWIUGSF",2016:" 29G]LFL[ RMFM[ RIFUFXGYHZJZMYOXPUQMQ RUFWGXHYJYMXOWPUQ RI[P[",2017:" 64G]QFNGLIKKJOJRKVLXNZQ[S[VZXXYVZRZOYKXIVGSFQF RQFOGMILKKOKRLVMXOZQ[ RS[UZWXXVYRYOXKWIUGSF RNYNXOVQURUTVUXV_W`Y`Z^Z] RUXV\\W^X_Y_Z^",2018:" 45G]LFL[ RMFM[ RIFUFXGYHZJZLYNXOUPMP RUFWGXHYJYLXNWOUP RI[P[ RRPTQURXYYZZZ[Y RTQUSWZX[Z[[Y[X",2019:" 34H\\XIYFYLXIVGSFPFMGKIKKLMMNOOUQWRYT RKKMMONUPWQXRYTYXWZT[Q[NZLXKUK[LX",2020:" 16I\\RFR[ RSFS[ RLFKLKFZFZLYF RO[V[",2021:" 23F^KFKULXNZQ[S[VZXXYUYF RLFLUMXOZQ[ RHFOF RVF\\F",2022:" 15H\\KFR[ RLFRX RYFR[ RIFOF RUF[F",2023:" 24F^JFN[ RKFNV RRFN[ RRFV[ RSFVV RZFV[ RGFNF RWF]F",2024:" 21H\\KFX[ RLFY[ RYFK[ RIFOF RUF[F RI[O[ RU[[[",2025:" 20H]KFRQR[ RLFSQS[ RZFSQ RIFOF RVF\\F RO[V[",2026:" 16H\\XFK[ RYFL[ RLFKLKFYF RK[Y[YUX[",2027:" 18H\\RFK[ RRFY[ RRIX[ RMUVU RI[O[ RU[[[",2028:" 45G]LFL[ RMFM[ RIFUFXGYHZJZLYNXOUP RUFWGXHYJYLXNWOUP RMPUPXQYRZTZWYYXZU[I[ RUPWQXRYTYWXYWZU[",2029:" 14I[NFN[ ROFO[ RKFZFZLYF RK[R[",2030:" 15H\\RFJ[ RRFZ[ RRIY[ RKZYZ RJ[Z[",2031:" 22G\\LFL[ RMFM[ RSLST RIFYFYLXF RMPSP RI[Y[YUX[",2032:" 16H\\XFK[ RYFL[ RLFKLKFYF RK[Y[YUX[",2033:" 27F^KFK[ RLFL[ RXFX[ RYFY[ RHFOF RUF\\F RLPXP RH[O[ RU[\\[",2034:" 56G]QFNGLIKKJOJRKVLXNZQ[S[VZXXYVZRZOYKXIVGSFQF RQFOGMILKKOKRLVMXOZQ[ RS[UZWXXVYRYOXKWIUGSF ROMOT RUMUT ROPUP ROQUQ",2035:" 12MXRFR[ RSFS[ ROFVF RO[V[",2036:" 27F\\KFK[ RLFL[ RYFLS RQOY[ RPOX[ RHFOF RUF[F RH[O[ RU[[[",2037:" 15H\\RFK[ RRFY[ RRIX[ RI[O[ RU[[[",2038:" 30F_KFK[ RLFRX RKFR[ RYFR[ RYFY[ RZFZ[ RHFLF RYF]F RH[N[ RV[][",2039:" 21G^LFL[ RMFYY RMHY[ RYFY[ RIFMF RVF\\F RI[O[",2040:" 36G]KEJJ RZEYJ RONNS RVNUS RKWJ\\ RZWY\\ RKGYG RKHYH ROPUP ROQUQ RKYYY RKZYZ",2041:" 44G]QFNGLIKKJOJRKVLXNZQ[S[VZXXYVZRZOYKXIVGSFQF RQFOGMILKKOKRLVMXOZQ[ RS[UZWXXVYRYOXKWIUGSF",2042:" 21F^KFK[ RLFL[ RXFX[ RYFY[ RHF\\F RH[O[ RU[\\[",2043:" 29G]LFL[ RMFM[ RIFUFXGYHZJZMYOXPUQMQ RUFWGXHYJYMXOWPUQ RI[P[",2044:" 20H]KFRPJ[ RJFQP RJFYFZLXF RKZXZ RJ[Y[ZUX[",2045:" 16I\\RFR[ RSFS[ RLFKLKFZFZLYF RO[V[",2046:" 33I\\KKKILGMFOFPGQIRMR[ RKIMGOGQI RZKZIYGXFVFUGTISMS[ RZIXGVGTI RO[V[",2047:" 48H]RFR[ RSFS[ RPKMLLMKOKRLTMUPVUVXUYTZRZOYMXLUKPK RPKNLMMLOLRMTNUPV RUVWUXTYRYOXMWLUK ROFVF RO[V[",2048:" 21H\\KFX[ RLFY[ RYFK[ RIFOF RUF[F RI[O[ RU[[[",2049:" 41G^RFR[ RSFS[ RIMJLLMMQNSOTQU RJLKMLQMSNTQUTUWTXSYQZM[L RTUVTWSXQYM[L\\M ROFVF RO[V[",2050:" 43G]JXK[O[MWKSJPJLKIMGPFTFWGYIZLZPYSWWU[Y[ZX RMWLTKPKLLINGPF RTFVGXIYLYPXTWW RKZNZ RVZYZ",2051:" 18H\\UFH[ RUFV[ RTHU[ RLUUU RF[L[ RR[X[",2052:" 41F^OFI[ RPFJ[ RLFWFZG[I[KZNYOVP RWFYGZIZKYNXOVP RMPVPXQYSYUXXVZR[F[ RVPWQXSXUWXUZR[",2053:" 34H]ZH[H\\F[L[JZHYGWFTFQGOIMLLOKSKVLYMZP[S[UZWXXV RTFRGPINLMOLSLVMYNZP[",2054:" 30F]OFI[ RPFJ[ RLFUFXGYHZKZOYSWWUYSZO[F[ RUFWGXHYKYOXSVWTYRZO[",2055:" 22F]OFI[ RPFJ[ RTLRT RLF[FZLZF RMPSP RF[U[WVT[",2056:" 20F\\OFI[ RPFJ[ RTLRT RLF[FZLZF RMPSP RF[M[",2057:" 42H^ZH[H\\F[L[JZHYGWFTFQGOIMLLOKSKVLYMZP[R[UZWXYT RTFRGPINLMOLSLVMYNZP[ RR[TZVXXT RUT\\T",2058:" 27E_NFH[ ROFI[ R[FU[ R\\FV[ RKFRF RXF_F RLPXP RE[L[ RR[Y[",2059:" 12LYUFO[ RVFP[ RRFYF RL[S[",2060:" 21I[XFSWRYQZO[M[KZJXJVKULVKW RWFRWQYO[ RTF[F",2061:" 27F]OFI[ RPFJ[ R]FLS RSOW[ RROV[ RLFSF RYF_F RF[M[ RS[Y[",2062:" 14H\\QFK[ RRFL[ RNFUF RH[W[YUV[",2063:" 30E`NFH[ RNFO[ ROFPY R\\FO[ R\\FV[ R]FW[ RKFOF R\\F`F RE[K[ RS[Z[",2064:" 21F_OFI[ ROFVX ROIV[ R\\FV[ RLFOF RYF_F RF[L[",2065:" 42G]SFPGNILLKOJSJVKYLZN[Q[TZVXXUYRZNZKYHXGVFSF RSFQGOIMLLOKSKVLYN[ RQ[SZUXWUXRYNYKXHVF",2066:" 27F]OFI[ RPFJ[ RLFXF[G\\I\\K[NYPUQMQ RXFZG[I[KZNXPUQ RF[M[",2067:" 61G]SFPGNILLKOJSJVKYLZN[Q[TZVXXUYRZNZKYHXGVFSF RSFQGOIMLLOKSKVLYN[ RQ[SZUXWUXRYNYKXHVF RLYLXMVOUPURVSXS_T`V`W^W] RSXT^U_V_W^",2068:" 42F^OFI[ RPFJ[ RLFWFZG[I[KZNYOVPMP RWFYGZIZKYNXOVP RRPTQURVZW[Y[ZYZX RURWYXZYZZY RF[M[",2069:" 35G^ZH[H\\F[L[JZHYGVFRFOGMIMKNMONVRXT RMKOMVQWRXTXWWYVZS[O[LZKYJWJUI[JYKY",2070:" 16H]UFO[ RVFP[ ROFLLNF]F\\L\\F RL[S[",2071:" 25F_NFKQJUJXKZN[R[UZWXXU\\F ROFLQKUKXLZN[ RKFRF RYF_F",2072:" 15H\\NFO[ ROFPY R\\FO[ RLFRF RXF^F",2073:" 24E_MFK[ RNFLY RUFK[ RUFS[ RVFTY R]FS[ RJFQF RZF`F",2074:" 21G]NFU[ ROFV[ R\\FH[ RLFRF RXF^F RF[L[ RR[X[",2075:" 20H]NFRPO[ ROFSPP[ R]FSP RLFRF RYF_F RL[S[",2076:" 16G][FH[ R\\FI[ ROFLLNF\\F RH[V[XUU[",2077:" 46H\\KILKXWYYY[ RLLXX RKIKKLMXYY[ RPPLTKVKXLZK[ RKVMZ RLTLVMXMZK[ RSSXN RVIVLWNYNYLWKVI RVIWLYN",2101:" 39I]NONPMPMONNPMTMVNWOXQXXYZZ[ RWOWXXZZ[[[ RWQVRPSMTLVLXMZP[S[UZWX RPSNTMVMXNZP[",2102:" 33G\\LFL[ RMFM[ RMPONQMSMVNXPYSYUXXVZS[Q[OZMX RSMUNWPXSXUWXUZS[ RIFMF",2103:" 28H[WPVQWRXQXPVNTMQMNNLPKSKULXNZQ[S[VZXX RQMONMPLSLUMXOZQ[",2104:" 36H]WFW[ RXFX[ RWPUNSMQMNNLPKSKULXNZQ[S[UZWX RQMONMPLSLUMXOZQ[ RTFXF RW[[[",2105:" 31H[LSXSXQWOVNTMQMNNLPKSKULXNZQ[S[VZXX RWSWPVN RQMONMPLSLUMXOZQ[",2106:" 22KXUGTHUIVHVGUFSFQGPIP[ RSFRGQIQ[ RMMUM RM[T[",2107:" 60I\\QMONNOMQMSNUOVQWSWUVVUWSWQVOUNSMQM RONNPNTOV RUVVTVPUN RVOWNYMYNWN RNUMVLXLYM[P\\U\\X]Y^ RLYMZP[U[X\\Y^Y_XaUbObLaK_K^L\\O[",2108:" 28G]LFL[ RMFM[ RMPONRMTMWNXPX[ RTMVNWPW[ RIFMF RI[P[ RT[[[",2109:" 18MXRFQGRHSGRF RRMR[ RSMS[ ROMSM RO[V[",2110:" 25MXSFRGSHTGSF RTMT_SaQbObNaN`O_P`Oa RSMS_RaQb RPMTM",2111:" 27G\\LFL[ RMFM[ RWMMW RRSX[ RQSW[ RIFMF RTMZM RI[P[ RT[Z[",2112:" 12MXRFR[ RSFS[ ROFSF RO[V[",2113:" 44BcGMG[ RHMH[ RHPJNMMOMRNSPS[ ROMQNRPR[ RSPUNXMZM]N^P^[ RZM\\N]P][ RDMHM RD[K[ RO[V[ RZ[a[",2114:" 28G]LML[ RMMM[ RMPONRMTMWNXPX[ RTMVNWPW[ RIMMM RI[P[ RT[[[",2115:" 36H\\QMNNLPKSKULXNZQ[S[VZXXYUYSXPVNSMQM RQMONMPLSLUMXOZQ[ RS[UZWXXUXSWPUNSM",2116:" 36G\\LMLb RMMMb RMPONQMSMVNXPYSYUXXVZS[Q[OZMX RSMUNWPXSXUWXUZS[ RIMMM RIbPb",2117:" 33H\\WMWb RXMXb RWPUNSMQMNNLPKSKULXNZQ[S[UZWX RQMONMPLSLUMXOZQ[ RTb[b",2118:" 23IZNMN[ ROMO[ ROSPPRNTMWMXNXOWPVOWN RKMOM RK[R[",2119:" 32J[WOXMXQWOVNTMPMNNMOMQNRPSUUWVXW RMPNQPRUTWUXVXYWZU[Q[OZNYMWM[NY",2120:" 16KZPFPWQZS[U[WZXX RQFQWRZS[ RMMUM",2121:" 28G]LMLXMZP[R[UZWX RMMMXNZP[ RWMW[ RXMX[ RIMMM RTMXM RW[[[",2122:" 15I[LMR[ RMMRY RXMR[ RJMPM RTMZM",2123:" 24F^JMN[ RKMNX RRMN[ RRMV[ RSMVX RZMV[ RGMNM RWM]M",2124:" 21H\\LMW[ RMMX[ RXML[ RJMPM RTMZM RJ[P[ RT[Z[",2125:" 22H[LMR[ RMMRY RXMR[P_NaLbKbJaK`La RJMPM RTMZM",2126:" 16I[WML[ RXMM[ RMMLQLMXM RL[X[XWW[",2127:" 40G^QMNNLPKRJUJXKZN[P[RZUWWTYPZM RQMONMPLRKUKXLZN[ RQMSMUNVPXXYZZ[ RSMTNUPWXXZZ[[[",2128:" 57G\\TFQGOIMMLPKTJZIb RTFRGPINMMPLTKZJb RTFVFXGYHYKXMWNTOPO RVFXHXKWMVNTO RPOTPVRWTWWVYUZR[P[NZMYLV RPOSPURVTVWUYTZR[",2129:" 28H\\IPKNMMOMQNROSRSVRZOb RJOLNPNRO RZMYPXRSYP^Nb RYMXPWRSY",2130:" 44I\\VNTMRMONMQLTLWMYNZP[R[UZWWXTXQWOSJRHRFSEUEWFYH RRMPNNQMTMXNZ RR[TZVWWTWPVNTKSISGTFVFYH",2131:" 32I[XPVNTMPMNNNPPRSS RPMONOPQRSS RSSNTLVLXMZP[S[UZWX RSSOTMVMXNZP[",2132:" 31I[TFRGQHQIRJUKZKZJWKSMPOMRLULWMYP[S]T_TaSbQbPa RULQONRMUMWNYP[",2133:" 32G]HQIOKMNMONOPNTL[ RMMNNNPMTK[ RNTPPRNTMVMXNYOYRXWUb RVMXOXRWWTb",2134:" 44F]GQHOJMMMNNNPMUMXNZO[ RLMMNMPLULXMZO[Q[SZUXWUXRYMYIXGVFTFRHRJSMUPWRZT RSZUWVUWRXMXIWGVF",2135:" 15LXRMPTOXOZP[S[UYVW RSMQTPXPZQ[",2136:" 29H\\NMJ[ ROMK[ RXMYNZNYMWMUNQROSMS ROSQTSZT[ ROSPTRZS[U[WZYW",2137:" 23H\\KFMFOGPHQJWXXZY[ RMFOHPJVXWZY[Z[ RRMJ[ RRMK[",2138:" 28F]MMGb RNMHb RMPLVLYN[P[RZTXVU RXMUXUZV[Y[[Y\\W RYMVXVZW[",2139:" 24H\\NML[ ROMNSMXL[ RYMXQVU RZMYPXRVUTWQYOZL[ RKMOM",2140:" 45IZTFRGQHQIRJUKXK RUKQLOMNONQPSSTVT RUKRLPMOOOQQSST RSTOUMVLXLZN\\S^T_TaRbPb RSTPUNVMXMZO\\S^",2141:" 32I[RMONMQLTLWMYNZP[R[UZWWXTXQWOVNTMRM RRMPNNQMTMXNZ RR[TZVWWTWPVN",2142:" 22G]PNL[ RPNM[ RVNV[ RVNW[ RIPKNNM[M RIPKONN[N",2143:" 31H[LVMYNZP[R[UZWWXTXQWOVNTMRMONMQLTHb RR[TZVWWTWPVN RRMPNNQMTIb",2144:" 35H][MQMNNLQKTKWLYMZO[Q[TZVWWTWQVOUNSM RQMONMQLTLXMZ RQ[SZUWVTVPUN RUN[N",2145:" 16H\\SNP[ RSNQ[ RJPLNOMZM RJPLOONZN",2146:" 31H\\IQJOLMOMPNPPNVNYP[ RNMONOPMVMYNZP[Q[TZVXXUYRYOXMWNXOYR RXUYO",2147:" 37G]ONMOKQJTJWKYLZN[Q[TZWXYUZRZOXMVMTORSPXMb RJWLYNZQZTYWWYU RZOXNVNTPRSPYNb",2148:" 23I[KMMMONPPU_VaWb RMMNNOPT_UaWbYb RZMYOWRM]K`Jb",2149:" 34F]UFOb RVFNb RGQHOJMMMNNNPMUMXOZRZTYWVYS RLMMNMPLULXMZO[R[TZVXXUYS[M",2150:" 44F]JQLOONNMLNJQITIWJZK[M[OZQWRT RIWJYKZMZOYQW RQTQWRZS[U[WZYWZTZQYNXMWNYOZQ RQWRYSZUZWYYW",2151:" 39H]XMVTUXUZV[Y[[Y\\W RYMWTVXVZW[ RVTVQUNSMQMNNLQKTKWLYMZO[Q[SZUWVT RQMONMQLTLXMZ",2152:" 36H[PFLSLVMYNZ RQFMS RMSNPPNRMTMVNWOXQXTWWUZR[P[NZMWMS RVNWPWTVWTZR[ RMFQF",2153:" 25I[WPWQXQXPWNUMRMONMQLTLWMYNZP[R[UZWW RRMPNNQMTMXNZ",2154:" 42H]ZFVTUXUZV[Y[[Y\\W R[FWTVXVZW[ RVTVQUNSMQMNNLQKTKWLYMZO[Q[SZUWVT RQMONMQLTLXMZ RWF[F",2155:" 26I[MVQUTTWRXPWNUMRMONMQLTLWMYNZP[R[UZWX RRMPNNQMTMXNZ",2156:" 35KZZGYHZI[H[GZFXFVGUHTJSMP[O_Na RXFVHUJTNRWQ[P^O`NaLbJbIaI`J_K`Ja ROMYM",2157:" 43H\\YMU[T^RaObLbJaI`I_J^K_J` RXMT[S^QaOb RVTVQUNSMQMNNLQKTKWLYMZO[Q[SZUWVT RQMONMQLTLXMZ",2158:" 31H]PFJ[ RQFK[ RMTOPQNSMUMWNXOXQVWVZW[ RUMWOWQUWUZV[Y[[Y\\W RMFQF",2159:" 26LYUFTGUHVGUF RMQNOPMSMTNTQRWRZS[ RRMSNSQQWQZR[U[WYXW",2160:" 32LYVFUGVHWGVF RNQOOQMTMUNUQR[Q^P`OaMbKbJaJ`K_L`Ka RSMTNTQQ[P^O`Mb",2161:" 34H\\PFJ[ RQFK[ RXNWOXPYOYNXMWMUNQROSMS ROSQTSZT[ ROSPTRZS[U[WZYW RMFQF",2162:" 18MYUFQTPXPZQ[T[VYWW RVFRTQXQZR[ RRFVF",2163:" 52AbBQCOEMHMINIPHTF[ RGMHNHPGTE[ RHTJPLNNMPMRNSOSQP[ RPMRORQO[ RRTTPVNXMZM\\N]O]Q[W[Z\\[ RZM\\O\\QZWZZ[[^[`YaW",2164:" 37F]GQHOJMMMNNNPMTK[ RLMMNMPLTJ[ RMTOPQNSMUMWNXOXQVWVZW[ RUMWOWQUWUZV[Y[[Y\\W",2165:" 32I[RMONMQLTLWMYNZP[R[UZWWXTXQWOVNTMRM RRMPNNQMTMXNZ RR[TZVWWTWPVN",2166:" 42G\\HQIOKMNMONOPNTJb RMMNNNPMTIb RNTOQQNSMUMWNXOYQYTXWVZS[Q[OZNWNT RWNXPXTWWUZS[ RFbMb",2167:" 33H\\XMRb RYMSb RVTVQUNSMQMNNLQKTKWLYMZO[Q[SZUWVT RQMONMQLTLXMZ RObVb",2168:" 26IZJQKOMMPMQNQPPTN[ ROMPNPPOTM[ RPTRPTNVMXMYNYOXPWOXN",2169:" 28J[XOXPYPYOXNUMRMONNONQORVVWW RNPOQVUWVWYVZS[P[MZLYLXMXMY",2170:" 18KYTFPTOXOZP[S[UYVW RUFQTPXPZQ[ RNMWM",2171:" 37F]GQHOJMMMNNNQLWLYN[ RLMMNMQKWKYLZN[P[RZTXVT RXMVTUXUZV[Y[[Y\\W RYMWTVXVZW[",2172:" 26H\\IQJOLMOMPNPQNWNYP[ RNMONOQMWMYNZP[Q[TZVXXUYQYMXMYO",2173:" 41C`DQEOGMJMKNKQIWIYK[ RIMJNJQHWHYIZK[M[OZQXRV RTMRVRYSZU[W[YZ[X\\V]R]M\\M]O RUMSVSYU[",2174:" 42H\\KQMNOMRMSOSR RQMRORRQVPXNZL[K[JZJYKXLYKZ RQVQYR[U[WZYW RYNXOYPZOZNYMXMVNTPSRRVRYS[",2175:" 41G\\HQIOKMNMONOQMWMYO[ RMMNNNQLWLYMZO[Q[SZUXWT RZMV[U^SaPbMbKaJ`J_K^L_K` RYMU[T^RaPb",2176:" 31H\\YMXOVQNWLYK[ RLQMOOMRMVO RMOONRNVOXO RLYNYRZUZWY RNYR[U[WYXW",2177:" 43G^VGUHVIWHWGUFRFOGMILLL[ RRFPGNIMLM[ R\\G[H\\I]H]G\\FZFXGWIW[ RZFYGXIX[ RIM[M RI[P[ RT[[[",2178:" 33G]WGVHWIXHWGUFRFOGMILLL[ RRFPGNIMLM[ RWMW[ RXMX[ RIMXM RI[P[ RT[[[",2179:" 35G]VGUHVIWHWGUF RXFRFOGMILLL[ RRFPGNIMLM[ RWHW[ RXFX[ RIMWM RI[P[ RT[[[",2180:" 54BcRGQHRISHRGPFMFJGHIGLG[ RMFKGIIHLH[ R]G\\H]I^H]G[FXFUGSIRLR[ RXFVGTISLS[ R]M][ R^M^[ RDM^M RD[K[ RO[V[ RZ[a[",2181:" 56BcRGQHRISHRGPFMFJGHIGLG[ RMFKGIIHLH[ R\\G[H\\I]H]G[F R^FXFUGSIRLR[ RXFVGTISLS[ R]H][ R^F^[ RDM]M RD[K[ RO[V[ RZ[a[",2182:" 12MXRMR[ RSMS[ ROMSM RO[V[",2184:" 25IZWNUMRMONMPLSLVMYNZQ[T[VZ RRMPNNPMSMVNYOZQ[ RMTUT",2185:" 43I\\TFQGOJNLMOLTLXMZO[Q[TZVWWUXRYMYIXGVFTF RTFRGPJOLNOMTMXNZO[ RQ[SZUWVUWRXMXIWGVF RNPWP",2186:" 42G]UFOb RVFNb RQMMNKPJSJVKXMZP[S[WZYXZUZRYPWNTMQM RQMNNLPKSKVLXNZP[ RS[VZXXYUYRXPVNTM",2187:" 27I[TMVNXPXOWNTMQMNNMOLQLSMUOWSZ RQMONNOMQMSNUSZT\\T^S_Q_",2190:" 45G]LMKNJPJRKUOYP[ RJRKTOXP[P]O`MbLbKaJ_J\\KXMTOQRNTMVMYNZPZTYXWZU[T[SZSXTWUXTY RVMXNYPYTXXWZ",2191:" 69E_YGXHYIZHYGWFTFQGOINKMNLRJ[I_Ha RTFRGPIOKNNLWK[J^I`HaFbDbCaC`D_E`Da R_G^H_I`H`G_F]F[GZHYJXMU[T_Sa R]F[HZJYNWWV[U^T`SaQbObNaN`O_P`Oa RIM^M",2192:" 52F^[GZH[I\\H[GXFUFRGPIOKNNMRK[J_Ia RUFSGQIPKONMWL[K^J`IaGbEbDaD`E_F`Ea RYMWTVXVZW[Z[\\Y]W RZMXTWXWZX[ RJMZM",2193:" 54F^YGXHYIZHZGXF R\\FUFRGPIOKNNMRK[J_Ia RUFSGQIPKONMWL[K^J`IaGbEbDaD`E_F`Ea R[FWTVXVZW[Z[\\Y]W R\\FXTWXWZX[ RJMYM",2194:" 86@cTGSHTIUHTGRFOFLGJIIKHNGRE[D_Ca ROFMGKIJKINGWF[E^D`CaAb?b>a>`?_@`?a R`G_H`IaH`G]FZFWGUITKSNRRP[O_Na RZFXGVIUKTNRWQ[P^O`NaLbJbIaI`J_K`Ja R^M\\T[X[Z\\[_[aYbW R_M]T\\X\\Z][ RDM_M",2195:" 88@cTGSHTIUHTGRFOFLGJIIKHNGRE[D_Ca ROFMGKIJKINGWF[E^D`CaAb?b>a>`?_@`?a R^G]H^I_H_G]F RaFZFWGUITKSNRRP[O_Na RZFXGVIUKTNRWQ[P^O`NaLbJbIaI`J_K`Ja R`F\\T[X[Z\\[_[aYbW RaF]T\\X\\Z][ RDM^M",2196:" 20LYMQNOPMSMTNTQRWRZS[ RRMSNSQQWQZR[U[WYXW",2200:" 40H\\QFNGLJKOKRLWNZQ[S[VZXWYRYOXJVGSFQF RQFOGNHMJLOLRMWNYOZQ[ RS[UZVYWWXRXOWJVHUGSF",2201:" 11H\\NJPISFS[ RRGR[ RN[W[",2202:" 45H\\LJMKLLKKKJLHMGPFTFWGXHYJYLXNUPPRNSLUKXK[ RTFVGWHXJXLWNTPPR RKYLXNXSZVZXYYX RNXS[W[XZYXYV",2203:" 47H\\LJMKLLKKKJLHMGPFTFWGXIXLWNTOQO RTFVGWIWLVNTO RTOVPXRYTYWXYWZT[P[MZLYKWKVLUMVLW RWQXTXWWYVZT[",2204:" 13H\\THT[ RUFU[ RUFJUZU RQ[X[",2205:" 39H\\MFKP RKPMNPMSMVNXPYSYUXXVZS[P[MZLYKWKVLUMVLW RSMUNWPXSXUWXUZS[ RMFWF RMGRGWF",2206:" 48H\\WIVJWKXJXIWGUFRFOGMILKKOKULXNZQ[S[VZXXYUYTXQVOSNRNOOMQLT RRFPGNIMKLOLUMXOZQ[ RS[UZWXXUXTWQUOSN",2207:" 31H\\KFKL RKJLHNFPFUIWIXHYF RLHNGPGUI RYFYIXLTQSSRVR[ RXLSQRSQVQ[",2208:" 63H\\PFMGLILLMNPOTOWNXLXIWGTFPF RPFNGMIMLNNPO RTOVNWLWIVGTF RPOMPLQKSKWLYMZP[T[WZXYYWYSXQWPTO RPONPMQLSLWMYNZP[ RT[VZWYXWXSWQVPTO",2209:" 48H\\XMWPURRSQSNRLPKMKLLINGQFSFVGXIYLYRXVWXUZR[O[MZLXLWMVNWMX RQSORMPLMLLMIOGQF RSFUGWIXLXRWVVXTZR[",2210:" 6MWRYQZR[SZRY",2211:" 8MWR[QZRYSZS\\R^Q_",2212:" 12MWRMQNROSNRM RRYQZR[SZRY",2213:" 14MWRMQNROSNRM RR[QZRYSZS\\R^Q_",2214:" 15MWRFQHRTSHRF RRHRN RRYQZR[SZRY",2215:" 32I[MJNKMLLKLJMHNGPFSFVGWHXJXLWNVORQRT RSFUGVHWJWLVNTP RRYQZR[SZRY",2216:" 6NVRFQM RSFQM",2217:" 12JZNFMM ROFMM RVFUM RWFUM",2218:" 14KYQFOGNINKOMQNSNUMVKVIUGSFQF",2219:" 9JZRFRR RMIWO RWIMO",2220:" 3G][BIb",2221:" 20KYVBTDRGPKOPOTPYR]T`Vb RTDRHQKPPPTQYR\\T`",2222:" 20KYNBPDRGTKUPUTTYR]P`Nb RPDRHSKTPTTSYR\\P`",2223:" 12KYOBOb RPBPb ROBVB RObVb",2224:" 12KYTBTb RUBUb RNBUB RNbUb",2225:" 40KYTBRCQDPFPHQJRKSMSOQQ RRCQEQGRISJTLTNSPORSTTVTXSZR[Q]Q_Ra RQSSUSWRYQZP\\P^Q`RaTb",2226:" 40KYPBRCSDTFTHSJRKQMQOSQ RRCSESGRIQJPLPNQPURQTPVPXQZR[S]S_Ra RSSQUQWRYSZT\\T^S`RaPb",2227:" 4KYUBNRUb",2228:" 4KYOBVROb",2229:" 3NVRBRb",2230:" 6KYOBOb RUBUb",2231:" 3E_IR[R",2232:" 6E_RIR[ RIR[R",2233:" 9F^RJR[ RJRZR RJ[Z[",2234:" 9F^RJR[ RJJZJ RJRZR",2235:" 6G]KKYY RYKKY",2236:" 6MWRQQRRSSRRQ",2237:" 15E_RIQJRKSJRI RIR[R RRYQZR[SZRY",2238:" 6E_IO[O RIU[U",2239:" 9E_YIK[ RIO[O RIU[U",2240:" 9E_IM[M RIR[R RIW[W",2241:" 4F^ZIJRZ[",2242:" 4F^JIZRJ[",2243:" 10F^ZFJMZT RJVZV RJ[Z[",2244:" 10F^JFZMJT RJVZV RJ[Z[",2245:" 21F_[WYWWVUTRPQOONMNKOJQJSKUMVOVQURTUPWNYM[M",2246:" 24F^IUISJPLONOPPTSVTXTZS[Q RISJQLPNPPQTTVUXUZT[Q[O",2247:" 8G]JTROZT RJTRPZT",2248:" 7LXTFOL RTFUGOL",2249:" 7LXPFUL RPFOGUL",2250:" 18H\\KFLHNJQKSKVJXHYF RKFLINKQLSLVKXIYF",2251:" 8MWRHQGRFSGSIRKQL",2252:" 8MWSFRGQIQKRLSKRJ",2253:" 8MWRHSGRFQGQIRKSL",2254:" 8MWQFRGSISKRLQKRJ",2255:" 10E[HMLMRY RKMR[ R[BR[",2256:" 13F^ZJSJOKMLKNJQJSKVMXOYSZZZ",2257:" 13F^JJJQKULWNYQZSZVYXWYUZQZJ",2258:" 13F^JJQJUKWLYNZQZSYVWXUYQZJZ",2259:" 13F^JZJSKOLMNKQJSJVKXMYOZSZZ",2260:" 16F^ZJSJOKMLKNJQJSKVMXOYSZZZ RJRVR",2261:" 11E_XP[RXT RUMZRUW RIRZR",2262:" 11JZPLRITL RMORJWO RRJR[",2263:" 11E_LPIRLT ROMJROW RJR[R",2264:" 11JZPXR[TX RMURZWU RRIRZ",2265:" 44I\\XRWOVNTMRMONMQLTLWMYNZP[R[UZWXXUYPYKXHWGUFRFPGOHOIPIPH RRMPNNQMTMXNZ RR[TZVXWUXPXKWHUF",2266:" 15H\\JFR[ RKFRY RZFR[ RJFZF RKGYG",2267:" 10AbDMIMRY RHNR[ Rb:R[",2268:" 32F^[CZD[E\\D\\C[BYBWCUETGSJRNPZO^N` RVDUFTJRVQZP]O_MaKbIbHaH`I_J`Ia",2269:" 50F^[CZD[E\\D\\C[BYBWCUETGSJRNPZO^N` RVDUFTJRVQZP]O_MaKbIbHaH`I_J`Ia RQKNLLNKQKSLVNXQYSYVXXVYSYQXNVLSKQK",2270:" 26F_\\S[UYVWVUUTTQPPONNLNJOIQISJULVNVPUQTTPUOWNYN[O\\Q\\S",2271:" 32F^[FI[ RNFPHPJOLMMKMIKIIJGLFNFPGSHVHYG[F RWTUUTWTYV[X[ZZ[X[VYTWT",2272:" 49F_[NZO[P\\O\\N[MZMYNXPVUTXRZP[M[JZIXIUJSPORMSKSIRGPFNGMIMKNNPQUXWZZ[[[\\Z\\Y RM[KZJXJUKSMQ RMKNMVXXZZ[",2273:" 56E`WNVLTKQKOLNMMPMSNUPVSVUUVS RQKOMNPNSOUPV RWKVSVUXVZV\\T]Q]O\\L[JYHWGTFQFNGLHJJILHOHRIUJWLYNZQ[T[WZYYZX RXKWSWUXV",2274:" 42H\\PBP_ RTBT_ RXIWJXKYJYIWGTFPFMGKIKKLMMNOOUQWRYT RKKMMONUPWQXRYTYXWZT[P[MZKXKWLVMWLX",2275:" 12H]SFLb RYFRb RLQZQ RKWYW",2276:" 46JZUITJUKVJVIUGSFQFOGNINKOMQOVR ROMTPVRWTWVVXTZ RPNNPMRMTNVPXU[ RNVSYU[V]V_UaSbQbOaN_N^O]P^O_",2277:" 30JZRFQHRJSHRF RRFRb RRQQTRbSTRQ RLMNNPMNLLM RLMXM RTMVNXMVLTM",2278:" 56JZRFQHRJSHRF RRFRT RRPQRSVRXQVSRRP RRTRb RR^Q`RbS`R^ RLMNNPMNLLM RLMXM RTMVNXMVLTM RL[N\\P[NZL[ RL[X[ RT[V\\X[VZT[",2279:" 12I\\XFX[ RKFXF RPPXP RK[X[",2281:" 38E`QFNGKIILHOHRIUKXNZQ[T[WZZX\\U]R]O\\LZIWGTFQF RROQPQQRRSRTQTPSORO RRPRQSQSPRP",2282:" 45J[PFNGOIQJ RPFOGOI RUFWGVITJ RUFVGVI RQJOKNLMNMQNSOTQUTUVTWSXQXNWLVKTJQJ RRUR[ RSUS[ RNXWX",2283:" 27I\\RFOGMILLLMMPORRSSSVRXPYMYLXIVGSFRF RRSR[ RSSS[ RNWWW",2284:" 28D`PFMGJIHLGOGSHVJYM[P\\T\\W[ZY\\V]S]O\\LZIWGTFPF RRFR\\ RGQ]Q",2285:" 31G`PMMNKPJSJTKWMYPZQZTYVWWTWSVPTNQMPM R]GWG[HUN R]G]M\\IVO R\\HVN",2286:" 28F\\IIJGLFOFQGRIRLQOPQNSKU ROFPGQIQMPPNS RVFT[ RWFS[ RKUYU",2287:" 30I\\MFMU RNFMQ RMQNOONQMTMWNXPXRWTUV RTMVNWPWRTXTZU[W[YY RKFNF",2288:" 44I\\RNOOMQLTLUMXOZR[S[VZXXYUYTXQVOSNRN RRHNJRFRN RSHWJSFSN RRSQTQURVSVTUTTSSRS RRTRUSUSTRT",2289:" 37G^QHRFR[ RTHSFS[ RJHKFKMLPNRQSRS RMHLFLNMQ R[HZFZMYPWRTSSS RXHYFYNXQ RNWWW",2290:" 31G]LFL[ RMFM[ RIFUFXGYHZJZMYOXPUQMQ RUFWGXHYJYMXOWPUQ RI[Y[YVX[",2291:" 24H[YGUGQHNJLMKPKSLVNYQ[U\\Y\\ RYGVHSJQMPPPSQVSYV[Y\\",2292:" 27F_OQMQKRJSIUIWJYKZM[O[QZRYSWSURSQROQ RSHPQ RZJRR R\\QST",2293:" 12H\\OKUY RUKOY RKOYU RYOKU",2294:" 48F^NVLUKUIVHXHYI[K\\L\\N[OYOXNVKRJOJMKJMHPGTGWHYJZMZOYRVVUXUYV[X\\Y\\[[\\Y\\X[VYUXUVV RJMKKMIPHTHWIYKZM",2295:" 48F^NMLNKNIMHKHJIHKGLGNHOJOKNMKQJTJVKYM[P\\T\\W[YYZVZTYQVMUKUJVHXGYG[H\\J\\K[MYNXNVM RJVKXMZP[T[WZYXZV",2301:" 40F_JMILIJJHLGNGPHQIRKSP RIJKHMHOIPJQLRPR[ R[M\\L\\J[HYGWGUHTISKRP R\\JZHXHVIUJTLSPS[",2302:" 51F^IGJKKMMOPPTPWOYMZK[G RIGJJKLMNPOTOWNYLZJ[G RPONPMQLSLVMXOZQ[S[UZWXXVXSWQVPTO RPPNQMSMVNY RVYWVWSVQTP",2303:" 30F^MJMV RNKNU RVKVU RWJWV RIGKIMJPKTKWJYI[G RIYKWMVPUTUWVYW[Y",2304:" 48F^[ILIJJILINJPLQNQPPQNQLPJ[J RIMJOKPMQ RQMPKOJMI RIXXXZW[U[SZQXPVPTQSSSUTWIW R[TZRYQWP RSTTVUWWX",2305:" 48F]OUMTLTJUIWIXJZL[M[OZPXPWOUJPINIKJILHOGSGWHYJZLZOYRVUUWUYV[X[YZZX RMSKPJNJKKILH RSGVHXJYLYOXRVU",2306:" 48G_HKKHMKMV RJILLLV RMKPHRKRU ROIQLQU RRKUHWKW[ RTIVLV[ RWKZH[J\\M\\P[SZUXWUYP[ RYIZJ[M[PZSYUWWTYP[",2307:" 41F^ISMSLRKOKMLJNHQGSGVHXJYMYOXRWS[S RITOTMRLOLMMJOHQG RSGUHWJXMXOWRUT[T RKXYX RKYYY",2308:" 30F_GLJIMLMX RIJLMLX RMLPISLSX ROJRMRX RSLVIYLYW[Y RUJXMXXZZ]W",2309:" 33G]ZIJY RZIWJQJ RXKUKQJ RZIYLYR RXKXNYR RQRJR RPSMSJR RQRQY RPSPVQY",2310:" 33F^HOJKOU RJMOWRPWPZO[M[KZIXHWHUITKTMUPVRWUWXUZ RWHVIUKUMWQXTXWWYUZ",2311:" 36F^IOLLPN RKMOORLUN RQMTOWLYN RVMXO[L RIULRPT RKSOURRUT RQSTUWRYT RVSXU[R",2312:" 48F^JHNJPLQOQRPUNWJY RJHMIOJQLRO RRRQUOWMXJY RZHWIUJSLRO RRRSUUWWXZY RZHVJTLSOSRTUVWZY RIP[P RIQ[Q",2317:" 12NVQQQSSSSQQQ RQQSS RSQQS",2318:" 18JZMPQRTTVVWYW[V]U^ RMQST RMRPSTUVWWY",2319:" 18JZWKVMTOPQMR RSPMS RUFVGWIWKVNTPQRMT",2320:" 36H\\SMONLPKRKTLVNWQWUVXTYRYPXNVMSM RXNSM RVMQNLP RONKR RLVQW RNWSVXT RUVYR",2321:" 36H\\SMONLPKRKTLVNWQWUVXTYRYPXNVMSM RXNSM RVMQNLP RONKR RLVQW RNWSVXT RUVYR",2322:" 34J[SMPNNPMRMTNVPWRWUVWTXRXPWNUMSM ROPUM RNRVN RMTWO RNUXP ROVWR RPWVT",2323:" 18JZOGO^ RUFU] RMNWL RMOWM RMWWU RMXWV",2324:" 18JZNFNX RVLV^ RNNVL RNOVM RNWVU RNXVV",2325:" 25JZNBNW RNNQLTLVMWOWQVSSUQVNW RNNQMTMVN RUMVOVQUSSU",2326:" 18E_HIHL R\\I\\L RHI\\I RHJ\\J RHK\\K RHL\\L",2327:" 18JZMNMQ RWNWQ RMNWN RMOWO RMPWP RMQWQ",2328:" 49JZMLWX RMLONQOTOVNWMWKUKUMTO RONTO RQOWM RVKVN RULWL RWXUVSUPUNVMWMYOYOWPU RUVPU RSUMW RNVNY RMXOX",2329:" 26JZPOOMOKMKMMNNPOSOUNWL RNKNN RMLOL RMMSO RPOUN RWLWY",2330:" 86A^GfHfIeIdHcGcFdFfGhIiKiNhPfQdR`RUQ;Q4R/S-U,V,X-Y/Y3X6W8U;P?JCHEFHEJDNDREVGYJ[N\\R\\V[XZZW[T[PZMYKWITHPHMIKKJNJRKUMW RGdGeHeHdGd RU;Q?LCIFGIFKENERFVGXJ[ RR\\U[WZYWZTZPYMXKVITH",2331:"103EfNSOUQVSVUUVSVQUOSNQNOONPMSMVNYP[S\\V\\Y[[Y\\W]T]P\\MZJXIUHRHOIMJKLIOHSHXI]KaMcPeTfYf]e`cba RKLJNIRIXJ\\L`NbQdUeYe]d_cba RPOTO ROPUP RNQVQ RNRVR RNSVS ROTUT RPUTU RaLaNcNcLaL RbLbN RaMcM RaVaXcXcVaV RbVbX RaWcW",2332:" 30D`H@Hd RM@Md RW@Wd R\\@\\d RMMWK RMNWL RMOWM RMWWU RMXWV RMYWW",2367:" 12NVQQQSSSSQQQ RQQSS RSQQS",2368:" 18JZMPQRTTVVWYW[V]U^ RMQST RMRPSTUVWWY",2369:" 18JZWKVMTOPQMR RSPMS RUFVGWIWKVNTPQRMT",2370:" 32H\\PMMNLOKQKSLUMVPWTWWVXUYSYQXOWNTMPM RMNLPLSMUNVPW RWVXTXQWOVNTM",2371:" 36H\\SMONLPKRKTLVNWQWUVXTYRYPXNVMSM RXNSM RVMQNLP RONKR RLVQW RNWSVXT RUVYR",2372:" 34J[SMPNNPMRMTNVPWRWUVWTXRXPWNUMSM ROPUM RNRVN RMTWO RNUXP ROVWR RPWVT",2373:" 18JZOGO^ RUFU] RMNWL RMOWM RMWWU RMXWV",2374:" 18JZNFNX RVLV^ RNNVL RNOVM RNWVU RNXVV",2375:" 25JZNBNW RNNQLTLVMWOWQVSSUQVNW RNNQMTMVN RUMVOVQUSSU",2376:" 18E_HIHL R\\I\\L RHI\\I RHJ\\J RHK\\K RHL\\L",2377:" 18JZMNMQ RWNWQ RMNWN RMOWO RMPWP RMQWQ",2378:" 36JZQCVMRTRU RULQS RTITKPRRUUY RW\\UYSXQXOYN[N]O_Ra RW\\UZSYOYO]P_Ra RSXPZN]",2379:" 26JZPOOMOKMKMMNNPOSOUNWL RNKNN RMLOL RMMSO RPOUN RWLSY",2380:" 86A^GfHfIeIdHcGcFdFfGhIiKiNhPfQdR`RUQ;Q4R/S-U,V,X-Y/Y3X6W8U;P?JCHEFHEJDNDREVGYJ[N\\R\\V[XZZW[T[PZMYKWITHPHMIKKJNJRKUMW RGdGeHeHdGd RU;Q?LCIFGIFKENERFVGXJ[ RR\\U[WZYWZTZPYMXKVITH",2381:" 89IjNQOOQNSNUOVQVSUUSVQVOUNTMQMNNKPISHWH[I^K`NaRaW`[_]]`ZcVfQiMk RWHZI]K_N`R`W_[^]\\`YcTgQi RPOTO ROPUP RNQVQ RNRVR RNSVS ROTUT RPUTU ReLeNgNgLeL RfLfN ReMgM ReVeXgXgVeV RfVfX ReWgW",2382:" 85D`H>Hf RI>If RM>Mf RQBSBSDQDQAR?T>W>Y?[A\\D\\I[LYNWOUOSNRLQNOQNROSQVRXSVUUWUYV[X\\[\\`[cYeWfTfReQcQ`S`SbQb RRBRD RQCSC RY?ZA[D[IZLYN RRLRNPQNRPSRVRX RYVZX[[[`ZcYe RR`Rb RQaSa",2401:" 21AcHBHb RIBIb R[B[b R\\B\\b RDB`B RDbMb RWb`b",2402:" 23BaGBQPFb RFBPP REBPQ REB\\B^I[B RGa\\a RFb\\b^[[b",2403:" 28I[X+U1R8P=OANFMNMVN^OcPgRlUsXy RU1S6Q":2242,"~":2246,"@":2273,"\\":804}[r]}const Ur={SUB_SUP_SCALE:.5,SQRT_MAG_SCALE:.5,FRAC_SCALE:.85,LINE_SPACING:.5,FRAC_SPACING:.4};function yg(r){r=r.replace(/\n/g," ");let e=0;const t=[];let n="";for(;e0&&(r[h].text=="^"||r[h].text=="_"||r[h].text=="'");)h--;u=r[h].bbox.y,r[c].text=="'"?r[c].bbox.y=u:(Sr(r[c],Ur.SUB_SUP_SCALE,null,0,0),Be[r[h].text]&&Be[r[h].text].flags.big?r[c].bbox.y=u-r[c].bbox.h:r[h].text=="\\int"?r[c].bbox.y=u:r[c].bbox.y=u-r[c].bbox.h/2)}else if(r[c].text=="_"){let u=1,h=c;for(;h>0&&(r[h].text=="^"||r[h].text=="_"||r[h].text=="'");)h--;u=r[h].bbox.y+r[h].bbox.h,Sr(r[c],Ur.SUB_SUP_SCALE,null,0,0),Be[r[h].text]&&Be[r[h].text].flags.big?r[c].bbox.y=u:r[h].text=="\\int"?r[c].bbox.y=u-r[c].bbox.h:r[c].bbox.y=u-r[c].bbox.h/2}function t(c,u,h,d,f){let p=c,g=f,v=1/0,R=-1/0;for(;d>0?p=0;){if(r[p].text==u)g++;else if(r[p].text==h){if(g--,g==0)break}else r[p].text=="^"||r[p].text=="_"||r[p].bbox&&(v=Math.min(v,r[p].bbox.y),R=Math.max(R,r[p].bbox.y+r[p].bbox.h));p+=d}return[v,R]}for(let c=0;cc.text=="&"||c.text=="\\\\"))return;const n=[];let i=[],o=[];for(let c=0;c0&&(r.chld[R].text=="^"||r.chld[R].text=="_"||r.chld[R].text=="'");)R--;const m=Be[r.chld[R].text]&&Be[r.chld[R].text].flags.big;if(g.text=="'"){let x=R+1,T=0;for(;x1;xg(r.chld,u);const f=Xd(r.chld);r.text=="\\text"&&(f.x-=1,f.w+=2);for(let p=0;pn.bbox.w)u=u/Math.max(a.w,1)*n.bbox.w,u+=n.bbox.x;else{u=u/16*i;const d=(n.bbox.w-a.w/16*i)/2;u+=n.bbox.x+d}Be[n.text].flags.yfl?(h=(h-a.ymin)/Math.max(a.ymax-a.ymin,1)*n.bbox.h,h+=n.bbox.y):(h=h/16*i,o&&(h-=(a.ymax+a.ymin)/2/16*i),h+=n.bbox.y+n.bbox.h/2),l.push([u,h])}e.push(l)}}else if(Be[n.text]&&Be[n.text].flags.txt||n.type=="char"){let a=n.bbox.x;const s=!!(Be[n.text]&&Be[n.text].flags.txt);for(let l=Number(s);l16?f*=16/c.w:f+=(16-c.w)/2/16),f+=a,p+=n.bbox.y+n.bbox.h/2,h.push([f,p])}e.push(h)}n.mode=="tt"?a+=i:a+=c.w/16*i}}}return e}function jr(r){return Math.round(r*100)/100}class Tg{constructor(e){this._latex=e,this._tokens=yg(e),this._tree=Dl(this._tokens),Dd(this._tree.chld),qr(this._tree),bg(this._tree),this._polylines=Og(this._tree)}resolveScale(e){var a,s,l,c;if(e==null)return[16,16,16,16];let t=(a=e.SCALE_X)!=null?a:16,n=(s=e.SCALE_Y)!=null?s:16;if(e.MIN_CHAR_H!=null){let u=0;for(let d=0;d`;e.BG_COLOR&&(l+=``),l+='>endobj + 2 0 obj +<< /Type /Pages +/Kids [3 0 R] +/Count 1 +/MediaBox [0 0 ${a} ${s}] +>> +endobj + 3 0 obj +<< /Type /Page +/Parent 2 0 R +/Resources +<< /Font +<< /F1 +<< /Type /Font + /Subtype /Type1 +/BaseFont /Times-Roman +>> +>> +>> +/Contents [`,c="",u=4;for(let d=0;d> + stream + 1 j 1 J ${(h=e.STROKE_W)!=null?h:1} w +`;for(let f=0;f> +endobj +`,c+=` +trailer +<< /Root 1 0 R + /Size 0 + >>startxref + +%%EOF +`,l+c}boxes(e){e||(e={});const[t,n,i,o]=this.resolveScale(e),a=[];for(let s=0;s{const h=new Image;h.src=t.laTexSVG,h.onload=()=>{e.drawImage(h,n,i,a,s),this.imageCache.set(t.value,h),c(t)},h.onerror=d=>{u(d)}});this.addImageObserver(l)}}}var dn=(r=>(r.UL="ul",r.OL="ol",r))(dn||{}),Si=(r=>(r.DISC="disc",r.CIRCLE="circle",r.SQUARE="square",r.CHECKBOX="checkbox",r))(Si||{}),Er=(r=>(r.DISC="disc",r.CIRCLE="circle",r.SQUARE="square",r.DECIMAL="decimal",r.CHECKBOX="checkbox",r))(Er||{});const Xl={[Si.DISC]:"\u2022",[Si.CIRCLE]:"\u25E6",[Si.SQUARE]:"\u25AB\uFE0E",[Si.CHECKBOX]:"\u2611\uFE0F"},Pg={[dn.OL]:"ol",[dn.UL]:"ul"},Eg={[Er.DISC]:"disc",[Er.CIRCLE]:"circle",[Er.SQUARE]:"square",[Er.DECIMAL]:"decimal",[Er.CHECKBOX]:"checkbox"};var tt=(r=>(r.FIRST="first",r.SECOND="second",r.THIRD="third",r.FOURTH="fourth",r.FIFTH="fifth",r.SIXTH="sixth",r))(tt||{});const _g={defaultFirstSize:26,defaultSecondSize:24,defaultThirdSize:22,defaultFourthSize:20,defaultFifthSize:18,defaultSixthSize:16},Wd={[tt.FIRST]:"defaultFirstSize",[tt.SECOND]:"defaultSecondSize",[tt.THIRD]:"defaultThirdSize",[tt.FOURTH]:"defaultFourthSize",[tt.FIFTH]:"defaultFifthSize",[tt.SIXTH]:"defaultSixthSize"},Ul={[tt.FIRST]:1,[tt.SECOND]:2,[tt.THIRD]:3,[tt.FOURTH]:4,[tt.FIFTH]:5,[tt.SIXTH]:6},Ig={H1:tt.FIRST,H2:tt.SECOND,H3:tt.THIRD,H4:tt.FOURTH,H5:tt.FIFTH,H6:tt.SIXTH};var nt=(r=>(r.TEXT="text",r.SELECT="select",r.CHECKBOX="checkbox",r.RADIO="radio",r.DATE="date",r))(nt||{}),ye=(r=>(r.PREFIX="prefix",r.POSTFIX="postfix",r.PLACEHOLDER="placeholder",r.VALUE="value",r.CHECKBOX="checkbox",r.RADIO="radio",r))(ye||{}),Vd=(r=>(r.ROW_START="rowStart",r.VALUE_START="valueStart",r))(Vd||{});function Gu(r){const e=[];for(let t=0;tte.concat(O.value.split("").map(I=>({...O,value:I}))),[]);let Q=0;for(let te=0;teQ.concat(te.value.split("").map(O=>({...te,value:O}))),[]);let _=0;for(let Q=0;Q_.code===h);W&&(D=[{value:W.value}])}Nr(D,{...e,isHandleFirstElement:!1});for(let W=0;W1){r.splice(o,1);const s=Wr(a.value);for(let l=0;l{const a=r[o];a!==void 0&&(i[o]=a)}),i}function bt(r,e={}){const{extraPickAttrs:t}=e,n=gt(r),i=[];let o=0;for(;o{const p=h[f];p!==void 0&&(d[f]=p)}),c.tdList[u]=d}}}else if(a.type===ae.HYPERLINK){const l=a.hyperlinkId;if(l){const c={type:ae.HYPERLINK,value:"",url:a.url},u=[];for(;o{va(h,i,d)});continue}(l=u.valueList)!=null&&l.length&&ar(r,u.valueList,t),va(Cd,i,u)}}function Fg(r,e){let t="span";r.type===ae.SUPERSCRIPT?t="sup":r.type===ae.SUBSCRIPT&&(t="sub");const n=document.createElement(t);return n.style.fontFamily=r.font||e.defaultFont,r.rowFlex&&(n.style.textAlign=Yd(r.rowFlex)),r.color&&(n.style.color=r.color),r.bold&&(n.style.fontWeight="600"),r.italic&&(n.style.fontStyle="italic"),n.style.fontSize=`${r.size||e.defaultSize}px`,r.highlight&&(n.style.backgroundColor=r.highlight),r.underline&&(n.style.textDecoration="underline"),r.strikeout&&(n.style.textDecoration+=" line-through"),n.innerText=r.value.replace(new RegExp(`${Ne}`,"g"),` +`),n}function Zd(r){let e=0;const t=new Map;for(let n=0;n0&&(e+=1);const s=o[a],l=t.get(e)||[];l.push({...i,value:s}),t.set(e,l)}}}return t}function Cg(r){var n;const e=[];if(!r.length)return e;let t=((n=r[0])==null?void 0:n.rowFlex)||null;e.push({rowFlex:t,data:[r[0]]});for(let i=1;ix.value).join(""),R.url&&(m.href=R.url),a.append(m)}else if(R.type===ae.TITLE){const m=document.createElement(`h${Ul[R.level]}`),x=t(R.valueList);m.innerHTML=x.innerHTML,a.append(m)}else if(R.type===ae.LIST){const m=document.createElement(Pg[R.listType]);R.listStyle&&(m.style.listStyleType=Eg[R.listStyle]);const x=bt(R.valueList);Zd(x).forEach(P=>{const A=document.createElement("li"),D=t(P);A.innerHTML=D.innerHTML,m.append(A)}),a.append(m)}else if(R.type===ae.IMAGE){const m=document.createElement("img");R.value&&(m.src=R.value,m.width=R.width,m.height=R.height),a.append(m)}else if(R.type===ae.SEPARATOR){const m=document.createElement("hr");a.append(m)}else if(R.type===ae.CHECKBOX){const m=document.createElement("input");m.type="checkbox",(h=R.checkbox)!=null&&h.value&&m.setAttribute("checked","true"),a.append(m)}else if(R.type===ae.RADIO){const m=document.createElement("input");m.type="radio",(d=R.radio)!=null&&d.value&&m.setAttribute("checked","true"),a.append(m)}else if(R.type===ae.TAB){const m=document.createElement("span");m.innerHTML=`${Qu}${Qu}`,a.append(m)}else if(R.type===ae.CONTROL){const m=document.createElement("span"),x=t(((f=R.control)==null?void 0:f.value)||[]);m.innerHTML=x.innerHTML,a.append(m)}else if(!R.type||R.type===ae.LATEX||Gr.includes(R.type)){let m="";if(R.type===ae.DATE?m=((p=R.valueList)==null?void 0:p.map(T=>T.value).join(""))||"":m=R.value,!m)continue;const x=Fg(R,e);((g=o[v-1])==null?void 0:g.type)===ae.TITLE&&(m=m.replace(/^\n/,"")),x.innerText=m.replace(new RegExp(`${Ne}`,"g"),` +`),a.append(x)}}return a}const n=document.createElement("div"),i=Cg(r);for(let o=0;o{n.append(c.cloneNode(!0))}):n.append(l)}return n}function Ag(r){if(!r||r.nodeType!==3)return null;const e=r.parentNode,t=e.nodeName==="FONT"?e.parentNode:e,n=Mg(t),i=r.textContent,o=window.getComputedStyle(t);if(!i||t.nodeName==="STYLE")return null;const a={value:i,color:o.color,bold:Number(o.fontWeight)>500,italic:o.fontStyle.includes("italic"),size:Math.floor(parseFloat(o.fontSize))};return t.nodeName==="SUB"||o.verticalAlign==="sub"?a.type=ae.SUBSCRIPT:(t.nodeName==="SUP"||o.verticalAlign==="super")&&(a.type=ae.SUPERSCRIPT),n!==Ge.LEFT&&(a.rowFlex=n),o.backgroundColor!=="rgba(0, 0, 0, 0)"&&(a.highlight=o.backgroundColor),o.textDecorationLine.includes("underline")&&(a.underline=!0),o.textDecorationLine.includes("line-through")&&(a.strikeout=!0),a}function Oo(r,e){const t=[];function n(a){if(a.nodeType===3){const s=Ag(a);s&&t.push(s)}else if(a.nodeType===1){const s=a.childNodes;for(let l=0;l{const f=Oo(d.innerHTML,e);f.forEach(p=>{p.value===` +`&&(p.listWrap=!0)}),f.unshift({value:` +`}),h.valueList.push(...f)}),t.push(h)}else if(c.nodeName==="HR")t.push({value:` +`,type:ae.SEPARATOR});else if(c.nodeName==="IMG"){const{src:u,width:h,height:d}=c;u&&h&&d&&t.push({width:h,height:d,value:u,type:ae.IMAGE})}else if(c.nodeName==="TABLE"){const u=c,h={type:ae.TABLE,value:` +`,colgroup:[],trList:[]};if(u.querySelectorAll("tr").forEach(d=>{const f=window.getComputedStyle(d).height.replace("px",""),p={height:Number(f),tdList:[]};d.querySelectorAll("th,td").forEach(g=>{const v=g,R=Oo(v.innerHTML,e),m={colspan:v.colSpan,rowspan:v.rowSpan,value:R};v.style.backgroundColor&&(m.backgroundColor=v.style.backgroundColor),p.tdList.push(m)}),p.tdList.length&&h.trList.push(p)}),h.trList.length){const d=h.trList[0].tdList.reduce((p,g)=>p+g.colspan,0),f=Math.ceil(e.innerWidth/d);for(let p=0;p{var s;a.nodeType!==1&&!((s=a.textContent)!=null&&s.trim())&&o.push(a)}),o.forEach(a=>a.remove()),n(i),i.remove(),t}function Go(r){function e(t){var i,o,a,s,l;let n="";for(let c=0;ch.value).join("");else if(u.type===ae.TITLE)n+=`${e(bt(u.valueList))}`;else if(u.type===ae.LIST){const h=bt(u.valueList),d=Zd(h);let f="";u.listType===dn.UL&&(f=Xl[u.listStyle]),d.forEach((p,g)=>{const v=d.size-1===g;n+=` +${f||`${g+1}.`}${e(p)}${v?` +`:""}`})}else if(u.type===ae.CHECKBOX)n+=(i=u.checkbox)!=null&&i.value?"\u2611":"\u25A1";else if(u.type===ae.RADIO)n+=(o=u.radio)!=null&&o.value?"\u2609":"\u25CB";else if(!u.type||u.type===ae.LATEX||Gr.includes(u.type)){let h="";u.type===ae.CONTROL?h=((s=(a=u.control.value)==null?void 0:a[0])==null?void 0:s.value)||"":u.type===ae.DATE?h=((l=u.valueList)==null?void 0:l.map(d=>d.value).join(""))||"":h=u.value,n+=h.replace(new RegExp(`${Ne}`,"g"),` +`)}}return n}return e(bt(r))}function ys(r){return Cl(r,["metrics","style"])}function Fa(r){return!!(r!=null&&r.type)&&(pg.includes(r.type)||r.imgDisplay===ze.INLINE)}function Dg(r,e){const t=document.createElement(e);for(let n=0;n{const l=new Image,c=s.result;l.src=c,l.onload=()=>{const u={value:c,type:ae.IMAGE,width:l.width,height:l.height};~o&&ar(a,[u],o),t.insertElementList([u])}}}function Vg(r,e){const t=r.getDraw();if(t.isReadonly())return;const i=e.clipboardData;if(!i)return;const{paste:o}=t.getOverride();if(o){o(e);return}if(!Wg(i)){const s=i.getData("text"),l=Qd();if(s===(l==null?void 0:l.text)){vc(r,l.elementList);return}}Kd();let a=!1;for(let s=0;s{r.input(c)});break}if(l.type==="text/html"&&a){l.getAsString(c=>{Bd(r,c)});break}}else if(l.kind==="file"&&l.type.includes("image")){const c=l.getAsFile();c&&yc(r,c)}}}async function Yg(r,e){const t=r.getDraw();if(t.isReadonly())return;const{paste:i}=t.getOverride();if(i){i();return}const o=await navigator.clipboard.readText(),a=Qd();if(o===(a==null?void 0:a.text)){vc(r,a.elementList);return}if(Kd(),e!=null&&e.isPlainText)o&&r.input(o);else{const s=await navigator.clipboard.read();let l=!1;for(const c of s)if(c.types.includes("text/html")){l=!0;break}for(const c of s)if(c.types.includes("text/plain")&&!l){const h=await(await c.getType("text/plain")).text();h&&r.input(h)}else if(c.types.includes("text/html")&&l){const h=await(await c.getType("text/html")).text();h&&Bd(r,h)}else if(c.types.some(u=>u.startsWith("image/"))){const u=c.types.find(d=>d.startsWith("image/")),h=await c.getType(u);yc(r,h)}}}class kg{constructor(e,t){this.draw=e,this.container=e.getContainer(),this.canvasEvent=t;const n=document.createElement("textarea");n.autocomplete="off",n.classList.add(`${Fe}-inputarea`),n.innerText="",this.container.append(n),this.agentCursorDom=n,n.onkeydown=i=>this._keyDown(i),n.oninput=Nd(this._input.bind(this),0),n.onpaste=i=>this._paste(i),n.addEventListener("compositionstart",this._compositionstart.bind(this)),n.addEventListener("compositionend",this._compositionend.bind(this))}getAgentCursorDom(){return this.agentCursorDom}_keyDown(e){this.canvasEvent.keydown(e)}_input(e){!e.data||this.canvasEvent.input(e.data)}_paste(e){this.draw.isReadonly()||!e.clipboardData||(Vg(this.canvasEvent,e),e.preventDefault())}_compositionstart(){this.canvasEvent.compositionstart()}_compositionend(e){this.canvasEvent.compositionend(e)}}class Zg{constructor(e,t){this.ANIMATION_CLASS=`${Fe}-cursor--animation`,this.draw=e,this.container=e.getContainer(),this.position=e.getPosition(),this.options=e.getOptions(),this.cursorDom=document.createElement("div"),this.cursorDom.classList.add(`${Fe}-cursor`),this.container.append(this.cursorDom),this.cursorAgent=new kg(e,t),this.blinkTimeout=null}getCursorDom(){return this.cursorDom}getAgentDom(){return this.cursorAgent.getAgentCursorDom()}getAgentIsActive(){return this.getAgentDom()===document.activeElement}getAgentDomValue(){return this.getAgentDom().value}clearAgentDomValue(){this.getAgentDom().value=""}_blinkStart(){this.cursorDom.classList.add(this.ANIMATION_CLASS)}_blinkStop(){this.cursorDom.classList.remove(this.ANIMATION_CLASS)}_setBlinkTimeout(){this._clearBlinkTimeout(),this.blinkTimeout=window.setTimeout(()=>{this._blinkStart()},500)}_clearBlinkTimeout(){this.blinkTimeout&&(this._blinkStop(),window.clearTimeout(this.blinkTimeout),this.blinkTimeout=null)}drawCursor(e){let t=this.position.getCursorPosition();if(!t)return;const{scale:n,cursor:i}=this.options,{color:o,width:a,isShow:s=!0,isBlink:l=!0,isFocus:c=!0,hitLineStartIndex:u}={...i,...e},h=this.draw.getHeight(),d=this.draw.getPageGap();u&&(t=this.position.getPositionList()[u]);const{metrics:f,coordinate:{leftTop:p,rightTop:g},ascent:v,pageNo:R}=t,T=(this.draw.getZone().isMainActive()?R:this.draw.getPageNo())*(h+d),P=sg*n,A=Math.min(f.height/4,P),D=f.height+A*2,W=this.cursorAgent.getAgentCursorDom();c&&setTimeout(()=>{W.focus(),W.setSelectionRange(0,0)});const _=f.boundingBoxDescent<0?0:f.boundingBoxDescent,Q=p[1]+v+_-(D-A)+T,te=u?p[0]:g[0];if(W.style.left=`${te}px`,W.style.top=`${Q+D-P}px`,!s){this.recoveryCursor();return}const O=this.draw.isReadonly();this.cursorDom.style.width=`${a*n}px`,this.cursorDom.style.backgroundColor=o,this.cursorDom.style.left=`${te}px`,this.cursorDom.style.top=`${Q}px`,this.cursorDom.style.display=O?"none":"block",this.cursorDom.style.height=`${D}px`,l?this._setBlinkTimeout():this._clearBlinkTimeout()}recoveryCursor(){this.cursorDom.style.display="none",this._clearBlinkTimeout()}moveCursorToVisible(e){const{cursorPosition:t,direction:n}=e;if(!t||!n)return;const{pageNo:i,coordinate:{leftTop:o,leftBottom:a}}=t,s=i*(this.draw.getHeight()+this.draw.getPageGap())+this.container.getBoundingClientRect().top,l=n===ir.UP,c=a[0],u=l?o[1]+s:a[1]+s,h=ig(this.container),d={left:0,right:0,top:0,bottom:0};if(h===document.documentElement)d.right=window.innerWidth,d.bottom=window.innerHeight;else{const{left:p,right:g,top:v,bottom:R}=h.getBoundingClientRect();d.left=p,d.right=g,d.top=v,d.bottom=R}const{maskMargin:f}=this.options;if(d.top+=f[0],d.bottom-=f[2],!(c>=d.left&&c<=d.right&&u>=d.top&&u<=d.bottom)){const{scrollLeft:p,scrollTop:g}=h;l?h.scroll(p,g-(d.top-u)):h.scroll(p,g+u-d.bottom)}}}var Gd=(r=>(r[r.LEFT=0]="LEFT",r[r.CENTER=1]="CENTER",r[r.RIGHT=2]="RIGHT",r))(Gd||{});const Gn=typeof navigator!="undefined"&&/Mac OS X/.test(navigator.userAgent),Qg=typeof navigator!="undefined"&&/iPad|iPhone/.test(navigator.userAgent);function nn(r){return Gn?r.metaKey:r.ctrlKey}var Ce=(r=>(r.Delete="Delete",r.Backspace="Backspace",r.Enter="Enter",r.Left="ArrowLeft",r.Right="ArrowRight",r.Up="ArrowUp",r.Down="ArrowDown",r.ESC="Escape",r.TAB="Tab",r.META="Meta",r.LEFT_BRACKET="[",r.RIGHT_BRACKET="]",r.COMMA=",",r.PERIOD=".",r.LEFT_ANGLE_BRACKET="<",r.RIGHT_ANGLE_BRACKET=">",r.EQUAL="=",r.MINUS="-",r.PLUS="+",r.A="a",r.B="b",r.C="c",r.D="d",r.E="e",r.F="f",r.G="g",r.H="h",r.I="i",r.J="j",r.K="k",r.L="l",r.M="m",r.N="n",r.O="o",r.P="p",r.Q="q",r.R="r",r.S="s",r.T="t",r.U="u",r.V="v",r.W="w",r.X="x",r.Y="y",r.Z="z",r.A_UPPERCASE="A",r.B_UPPERCASE="B",r.C_UPPERCASE="C",r.D_UPPERCASE="D",r.E_UPPERCASE="E",r.F_UPPERCASE="F",r.G_UPPERCASE="G",r.H_UPPERCASE="H",r.I_UPPERCASE="I",r.J_UPPERCASE="J",r.K_UPPERCASE="K",r.L_UPPERCASE="L",r.M_UPPERCASE="M",r.N_UPPERCASE="N",r.O_UPPERCASE="O",r.P_UPPERCASE="P",r.Q_UPPERCASE="Q",r.R_UPPERCASE="R",r.S_UPPERCASE="S",r.T_UPPERCASE="T",r.U_UPPERCASE="U",r.V_UPPERCASE="V",r.W_UPPERCASE="W",r.X_UPPERCASE="X",r.Y_UPPERCASE="Y",r.Z_UPPERCASE="Z",r.ZERO="0",r.ONE="1",r.TWO="2",r.THREE="3",r.FOUR="4",r.FIVE="5",r.SIX="6",r.SEVEN="7",r.EIGHT="8",r.NINE="9",r))(Ce||{});class Ca{constructor(e,t){this.element=e,this.control=t}setElement(e){this.element=e}getElement(){return this.element}getCode(){var e;return((e=this.element.control)==null?void 0:e.code)||null}getValue(){const e=this.control.getElementList(),{startIndex:t}=this.control.getRange(),n=e[t],i=[];let o=t;for(;o>0;){const s=e[o];if(s.controlId!==n.controlId||s.controlComponent===ye.PREFIX)break;s.controlComponent===ye.VALUE&&i.unshift(s),o--}let a=t+1;for(;a0;){const u=o[l];if(u.controlId!==s.controlId||u.controlComponent===ye.PREFIX)break;if(u.controlComponent===ye.CHECKBOX){const h=u.checkbox;h.value=e.includes(h.code)}l--}let c=a+1;for(;c0;){const u=o[l];if(u.controlId!==s.controlId||u.controlComponent===ye.PREFIX)break;if(u.controlComponent===ye.RADIO){const h=u.radio;h.value=e.includes(h.code)}l--}let c=a+1;for(;cie===L.code);F.splice(V,1)}else L!=null&&L.code&&F.push(L.code);const Y=t.getControl().getActiveControl();Y instanceof Ca&&Y.setSelect(F)}}else if(y){const{control:L,radio:k}=T;if(!L)t.getRadioParticle().setSelect(T);else{const F=k!=null&&k.code?[k.code]:[],Y=t.getControl().getActiveControl();Y instanceof Wl&&Y.setSelect(F)}}else t.render({curIndex:x,isCompute:!1,isSubmitHistory:!1,isSetCursor:!P&&!A&&!D});v&&e.getDraw().getCursor().drawCursor({hitLineStartIndex:v})}const W=t.getPreviewer();W.clearResizer(),P&&(W.drawResizer(T,m[x],T.type===ae.LATEX?{mime:"svg",srcKey:"laTexSVG"}:{}),t.getCursor().drawCursor({isShow:!1}),Ju(e),(T.imgDisplay===ze.FLOAT_TOP||T.imgDisplay===ze.FLOAT_BOTTOM)&&t.getImageParticle().createFloatImage(T));const _=t.getTableTool();_.dispose(),p&&!n&&_.render();const Q=t.getHyperlinkParticle();Q.clearHyperlinkPopup(),T.type===ae.HYPERLINK&&(nn(r)?Q.openHyperlink(T):Q.drawHyperlinkPopup(T,m[x]));const te=t.getDateParticle();te.clearDatePicker(),T.type===ae.DATE&&!n&&te.renderDatePicker(T,m[x])}function Jo(r){const e=it();return Reflect.set(r,"dragId",e),e}function zo(r,e){return e.findIndex(t=>t.dragId===r)}function zu(r,e,t){const n=t.getDraw();if(r.imgDisplay===ze.FLOAT_TOP||r.imgDisplay===ze.FLOAT_BOTTOM){const i=e.offsetX-t.mouseDownStartPosition.x,o=e.offsetY-t.mouseDownStartPosition.y,a=r.imgFloatPosition;r.imgFloatPosition={x:a.x+i,y:a.y+o}}n.getImageParticle().destroyFloatImage()}function Hg(r,e){var t,n,i,o;if(e.isAllowDrop){const a=e.getDraw();if(a.isReadonly())return;const s=a.getPosition(),l=s.getPositionList(),c=s.getPositionContext(),u=a.getRange(),h=e.cacheRange,d=e.cacheElementList,f=e.cachePositionList,p=u.getRange(),g=h.startIndex===h.endIndex,v=g?h.startIndex-1:h.startIndex,R=h.endIndex;if(p.startIndex>=v&&p.endIndex<=R&&((t=e.cachePositionContext)==null?void 0:t.tdId)===c.tdId){a.clearSideEffect();let C=!1;if(g){const G=d[R];if(G.type===ae.IMAGE||G.type===ae.LATEX)if(zu(G,r,e),G.imgDisplay===ze.FLOAT_TOP||G.imgDisplay===ze.FLOAT_BOTTOM)a.getPreviewer().drawResizer(G),C=!0;else{const z=f[R];a.getPreviewer().drawResizer(G,z)}}u.replaceRange({...h}),a.render({isSetCursor:!1,isCompute:!1,isSubmitHistory:C});return}const m=d.slice(v+1,R+1),x=m.find(C=>C.controlId);if(x){const C=d[v+1],G=d[R];if(!((!C.controlId||C.controlComponent===ye.PREFIX)&&(!G.controlId||G.controlComponent===ye.POSTFIX)||C.controlId===G.controlId&&C.controlComponent===ye.PREFIX&&G.controlComponent===ye.POSTFIX||((n=C.control)==null?void 0:n.type)===nt.TEXT&&C.controlComponent===ye.VALUE&&((i=G.control)==null?void 0:i.type)===nt.TEXT&&G.controlComponent===ye.VALUE)){a.render({curIndex:p.startIndex,isCompute:!1,isSubmitHistory:!1});return}}const T=a.getControl(),P=a.getElementList(),A=!x||!!P[p.startIndex].controlId||!T.getIsElementListContainFullControl(m),D=a.getOptions(),W=m.map(C=>{if(!C.type||C.type===ae.TEXT){const G={value:C.value},z=ri;return A||z.push(...Bu),z.forEach(H=>{const j=C[H];j!==void 0&&(G[H]=j)}),G}else{let G=gt(C);return A&&(G=Eo(G,Bu)),Nr([G],{isHandleFirstElement:!1,editorOptions:D}),G}});ar(P,W,p.startIndex);const _=d[v],Q=f[v],te=Jo(d[v]),O=Jo(d[R]),I=W.length;let y=p.startIndex,L=y+I;const k=T.getActiveControl();if(k&&d[y].controlComponent!==ye.POSTFIX?(L=k.setValue(W),y=L-I):a.spliceElementList(P,y+1,0,...W),!~L){a.render({isSetCursor:!1});return}const F=Jo(P[y]),Y=Jo(P[L]),V=zo(te,d),ie=zo(O,d),U=d[ie];U.controlId&&U.controlComponent!==ye.POSTFIX?(u.replaceRange({...h,startIndex:V,endIndex:ie}),(o=T.getActiveControl())==null||o.cut()):a.spliceElementList(d,V+1,ie-V);const N=P[p.startIndex],J=l[p.startIndex];let B=c.index;B&&(N.tableId&&!_.tableId?Q.index=i&&r.x<=i+a&&r.y>=o&&r.y<=o+s||e.setIsAllowSelection(!1)}function Gg(r,e){var T;const t=e.getDraw();if(e.isAllowDrag){const P=r.offsetX,A=r.offsetY,{startIndex:D,endIndex:W}=e.cacheRange,_=e.cachePositionList;for(let te=D+1;te<=W;te++){const{coordinate:{leftTop:O,rightBottom:I}}=_[te];if(P>=O[0]&&P<=I[0]&&A>=O[1]&&A<=I[1])return}const Q=(T=e.cacheRange)==null?void 0:T.startIndex;if(Q){const te=e.cacheElementList[Q];(te==null?void 0:te.type)===ae.IMAGE&&(te.imgDisplay===ze.FLOAT_TOP||te.imgDisplay===ze.FLOAT_BOTTOM)&&(t.getPreviewer().clearResizer(),t.getImageParticle().dragFloatImage(r.movementX,r.movementY))}e.dragover(r),e.isAllowDrop=!0;return}if(!e.isAllowSelection||!e.mouseDownStartPosition)return;const i=r.target.dataset.index;i&&t.setPageNo(Number(i));const a=t.getPosition().getPositionByXY({x:r.offsetX,y:r.offsetY});if(!~a.index)return;const{index:s,isTable:l,tdValueIndex:c,tdIndex:u,trIndex:h,tableId:d}=a,{index:f,isTable:p,tdIndex:g,trIndex:v,tableId:R}=e.mouseDownStartPosition,m=l?c:s,x=t.getRange();if(l&&p&&(u!==g||h!==v))x.setRange(m,m,d,g,u,v,h);else{let P=~m?m:0;if((p||l)&&R!==d)return;let A=f;if(A>P&&([A,P]=[P,A]),A===P)return;const D=t.getElementList(),W=D[A+1],_=D[P];if((W==null?void 0:W.controlComponent)===ye.PLACEHOLDER&&(_==null?void 0:_.controlComponent)===ye.PLACEHOLDER&&W.controlId===_.controlId)return;x.setRange(A,P)}t.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1})}var pn=(r=>(r.COMPONENT="component",r.MENU="menu",r.MAIN="main",r.FOOTER="footer",r.CONTEXTMENU="contextmenu",r.POPUP="popup",r.CATALOG="catalog",r.COMMENT="comment",r))(pn||{}),Mn=(r=>(r.PAGE="page",r.TABLE="table",r))(Mn||{}),Mt=(r=>(r.EDIT="edit",r.CLEAN="clean",r.READONLY="readonly",r.FORM="form",r.PRINT="print",r))(Mt||{}),Ke=(r=>(r.HEADER="header",r.MAIN="main",r.FOOTER="footer",r))(Ke||{}),Ln=(r=>(r.PAGING="paging",r.CONTINUITY="continuity",r))(Ln||{}),jn=(r=>(r.VERTICAL="vertical",r.HORIZONTAL="horizontal",r))(jn||{}),wc=(r=>(r.BREAK_ALL="break-all",r.BREAK_WORD="break-word",r))(wc||{});function Jg(r,e){const t=e.getDraw();if(t.isReadonly())return;const n=t.getRange();if(!n.getIsCanInput())return;const i=t.getControl();let o;if(i.getActiveControl()&&i.getIsRangeCanCaptureEvent())o=i.keydown(r);else{const a=t.getPosition(),s=a.getCursorPosition();if(!s)return;const{index:l}=s,{startIndex:c,endIndex:u}=n.getRange(),h=n.getIsCollapsed(),d=t.getElementList();if(h&&l===0){const p=d[l];if(p.value===Ne){p.listId&&t.getListParticle().unsetList(),r.preventDefault();return}}const f=d[c];if(h&&f.rowFlex&&f.value===Ne){const p=t.getRowList(),v=a.getPositionList()[c].rowNo;p[v].elementList.forEach(m=>{delete m.rowFlex})}h?t.spliceElementList(d,l,1):t.spliceElementList(d,c+1,u-c),o=h?l-1:c}o!==null&&(t.getGlobalEvent().setCanvasEventAbility(),n.setRange(o,o),t.render({curIndex:o}))}function zg(r,e){var c;const t=e.getDraw();if(t.isReadonly())return;const n=t.getRange();if(!n.getIsCanInput())return;const{startIndex:i,endIndex:o}=n.getRange(),a=t.getElementList(),s=t.getControl();let l;if(s.getActiveControl()&&s.getIsRangeWithinControl())l=s.keydown(r);else if((c=a[o+1])!=null&&c.controlId)l=s.removeControl(o+1);else{const u=t.getPosition(),h=u.getCursorPosition();if(!h)return;const{index:d}=h,f=u.getPositionContext();if(f.isDirectHit&&f.isImage)t.spliceElementList(a,d,1),l=d-1;else{const p=n.getIsCollapsed();if(!p)t.spliceElementList(a,i+1,o-i);else{if(!a[d+1])return;t.spliceElementList(a,d+1,1)}l=p?d:i}}l!==null&&(t.getGlobalEvent().setCanvasEventAbility(),n.setRange(l,l),t.render({curIndex:l}))}function $g(r,e){var p,g;const t=e.getDraw();if(t.isReadonly())return;const n=t.getRange();if(!n.getIsCanInput())return;const{startIndex:i,endIndex:o}=n.getRange(),a=n.getIsCollapsed(),s=t.getElementList(),l=s[i],c=s[o];if(a&&c.listId&&c.value===Ne&&((p=s[o+1])==null?void 0:p.listId)!==c.listId){t.getListParticle().unsetList();return}const u={value:Ne};if(r.shiftKey&&l.listId&&(u.listWrap=!0),!(c.titleId&&c.titleId!==((g=s[o+1])==null?void 0:g.titleId))){ar(s,[u],i);const v=Lo(s,o);if(v){const R=[...Mo];v.controlComponent!==ye.POSTFIX&&R.push(...ri),R.forEach(m=>{const x=v[m];x!==void 0&&(u[m]=x)})}}const h=t.getControl(),d=h.getActiveControl();let f;if(d&&h.getIsRangeWithinControl())f=h.setValue([u]);else{const R=t.getPosition().getCursorPosition();if(!R)return;const{index:m}=R;a?t.spliceElementList(s,m+1,0,u):t.spliceElementList(s,i+1,o-i,u),f=m+1}~f&&(n.setRange(f,f),t.render({curIndex:f})),r.preventDefault()}function jg(r,e){var x,T;const t=e.getDraw();if(t.isReadonly())return;const i=t.getPosition(),o=i.getCursorPosition();if(!o)return;const a=i.getPositionContext(),{index:s}=o;if(s<=0&&!a.isTable)return;const l=t.getRange(),{startIndex:c,endIndex:u}=l.getRange(),h=l.getIsCollapsed(),d=t.getElementList(),f=t.getControl();if(t.getMode()===Mt.FORM&&f.getActiveControl()&&((x=d[s])==null?void 0:x.controlComponent)===ye.PREFIX){f.initNextControl({direction:ir.UP});return}let p=1;if(nn(r)){const P=t.getLetterReg(),A=r.shiftKey&&!h&&c===(o==null?void 0:o.index)?u:c;if(P.test((T=d[A])==null?void 0:T.value)){let D=A-1;for(;D>0;){const W=d[D];if(!P.test(W.value))break;p++,D--}}}const g=c-p;let v=g,R=g;if(r.shiftKey&&o&&(c!==u?c===o.index?(v=c,R=u-p):(v=g,R=u):R=u),!r.shiftKey){const P=d[c];if(P.type===ae.TABLE){const A=P.trList,D=A.length-1,W=A[D],_=W.tdList.length-1,Q=W.tdList[_];i.setPositionContext({isTable:!0,index:c,trIndex:D,tdIndex:_,tdId:Q.id,trId:W.id,tableId:P.id}),v=Q.value.length-1,R=v,t.getTableTool().render()}else if(P.tableId&&c===0){const D=t.getOriginalElementList()[a.index].trList;e:for(let W=0;Ws.length-1&&!l.isTable)return;const c=t.getRange(),{startIndex:u,endIndex:h}=c.getRange(),d=c.getIsCollapsed();let f=t.getElementList();const p=t.getControl();if(t.getMode()===Mt.FORM&&p.getActiveControl()&&((P=f[a+1])==null?void 0:P.controlComponent)===ye.POSTFIX){p.initNextControl({direction:ir.DOWN});return}let g=1;if(nn(r)){const D=t.getLetterReg(),W=r.shiftKey&&!d&&u===(o==null?void 0:o.index)?h:u;if(D.test((A=f[W+1])==null?void 0:A.value)){let _=W+2;for(;_I.length-1&&(k=te+1,F=0);const Y=Q[k],V=Y.tdList[F];i.setPositionContext({isTable:!0,index:l.index,trIndex:k,tdIndex:F,tdId:V.id,trId:Y.id,tableId:D.id}),R=0,m=R,t.getTableTool().render()}break e}}}}const x=f.length-1;if(R>x||m>x)return;c.setRange(R,m);const T=R===m;t.render({curIndex:T?R:void 0,isSetCursor:T,isSubmitHistory:!1,isCompute:!1}),r.preventDefault()}function eR(r,e){const t=e.getDraw();if(t.isReadonly())return;r.preventDefault();const i=t.getControl();if(i.getActiveControl()&&i.getIsRangeWithinControl())i.initNextControl({direction:r.shiftKey?ir.UP:ir.DOWN});else{const a={type:ae.TAB,value:""},s=t.getRange(),{startIndex:l}=s.getRange(),c=t.getElementList();ar(c,[a],l),t.insertElementList([a])}}function ws(r){const{positionList:e,index:t,isUp:n,rowNo:i,cursorX:o}=r;let a=-1;const s=[];if(n){let l=t-1;for(;l>=0;){const c=e[l];if(l--,c.rowNo!==i){if(s[0]&&s[0].rowNo!==c.rowNo)break;s.unshift(c)}}}else{let l=t+1;for(;lh)){a=c.index;break}}return a}function tR(r,e){const t=e.getDraw();if(t.isReadonly())return;const i=t.getPosition(),o=i.getCursorPosition();if(!o)return;const a=t.getRange(),{startIndex:s,endIndex:l}=a.getRange();let c=i.getPositionList();const u=r.key===Ce.Up;let h=-1,d=-1;const f=i.getPositionContext();if(!r.shiftKey&&f.isTable&&(u&&o.rowIndex===0||!u&&o.rowIndex===t.getRowCount()-1)){const{index:g,trIndex:v,tdIndex:R,tableId:m}=f;if(u)if(v===0)i.setPositionContext({isTable:!1}),h=g-1,d=h,t.getTableTool().dispose();else{let x=-1,T=-1;const A=t.getOriginalElementList()[g].trList,D=A[v].tdList[R].colIndex;e:for(let Q=v-1;Q>=0;Q--){const O=A[Q].tdList;for(let I=0;I=D&&y.colIndex<=D){x=Q,T=I;break e}}}if(!~x||!~T)return;const W=A[x],_=W.tdList[T];i.setPositionContext({isTable:!0,index:g,trIndex:x,tdIndex:T,tdId:W.id,trId:_.id,tableId:m}),h=_.value.length-1,d=h,t.getTableTool().render()}else{const T=t.getOriginalElementList()[g].trList;if(v===T.length-1)i.setPositionContext({isTable:!1}),h=g,d=h,t.getTableTool().dispose();else{let P=-1,A=-1;const D=T[v].tdList[R].colIndex;e:for(let Q=v+1;Q=D&&y.colIndex<=D){P=Q,A=I;break e}}}if(!~P||!~A)return;const W=T[P],_=W.tdList[A];i.setPositionContext({isTable:!0,index:g,trIndex:P,tdIndex:A,tdId:W.id,trId:_.id,tableId:m}),h=_.value.length-1,d=h,t.getTableTool().render()}}}else{let g=o;r.shiftKey&&(s===o.index?g=c[l]:g=c[s]);const{index:v,rowNo:R,rowIndex:m,coordinate:{rightTop:[x]}}=g;if(u&&m===0||!u&&m===t.getRowCount()-1)return;const T=ws({positionList:c,index:v,rowNo:R,isUp:u,cursorX:x});if(T<0)return;h=T,d=T,r.shiftKey&&(s!==l?s===o.index?h=s:d=l:u?d=l:h=s);const A=t.getElementList()[T];if(A.type===ae.TABLE){const{scale:D}=t.getOptions(),W=t.getMargins(),_=A.trList;let Q=-1,te=-1,O=-1;if(u){e:for(let I=_.length-1;I>=0;I--){const L=_[I].tdList;for(let k=0;k=Y&&x<=Y+V){const ie=F.positionList,U=ie[ie.length-1],N=ws({positionList:ie,index:U.index+1,rowNo:U.rowNo-1,isUp:u,cursorX:x})||U.index;Q=I,te=k,O=N;break e}}}}else{e:for(let I=0;I<_.length;I++){const L=_[I].tdList;for(let k=0;k=Y&&x<=Y+V){const ie=F.positionList,U=ws({positionList:ie,index:-1,rowNo:-1,isUp:u,cursorX:x})||0;Q=I,te=k,O=U;break e}}}}if(~Q&&~te&&~O){const I=_[Q],y=I.tdList[te];i.setPositionContext({isTable:!0,index:T,trIndex:Q,tdIndex:te,tdId:y.id,trId:I.id,tableId:A.id}),h=O,d=h,c=i.getPositionList(),t.getTableTool().render()}}}if(!~h||!~d)return;h>d&&([h,d]=[d,h]),a.setRange(h,d);const p=h===d;t.render({curIndex:p?h:void 0,isSetCursor:p,isSubmitHistory:!1,isCompute:!1}),t.getCursor().moveCursorToVisible({cursorPosition:c[u?h:d],direction:u?ir.UP:ir.DOWN})}function rR(r,e){if(e.isComposing)return;const t=e.getDraw();if(r.key===Ce.Backspace)Jg(r,e);else if(r.key===Ce.Delete)zg(r,e);else if(r.key===Ce.Enter)$g(r,e);else if(r.key===Ce.Left)jg(r,e);else if(r.key===Ce.Right)qg(r,e);else if(r.key===Ce.Up||r.key===Ce.Down)tR(r,e);else if(nn(r)&&r.key===Ce.Z){if(t.isReadonly()&&t.getMode()!==Mt.FORM)return;t.getHistoryManager().undo(),r.preventDefault()}else if(nn(r)&&r.key===Ce.Y){if(t.isReadonly()&&t.getMode()!==Mt.FORM)return;t.getHistoryManager().redo(),r.preventDefault()}else if(nn(r)&&r.key===Ce.C)e.copy(),r.preventDefault();else if(nn(r)&&r.key===Ce.X)e.cut(),r.preventDefault();else if(nn(r)&&r.key===Ce.A)e.selectAll(),r.preventDefault();else if(nn(r)&&r.key===Ce.S){if(t.isReadonly())return;const n=t.getListener();n.saved&&n.saved(t.getValue());const i=t.getEventBus();i.isSubscribe("saved")&&i.emit("saved",t.getValue()),r.preventDefault()}else if(r.key===Ce.ESC){e.clearPainterStyle();const n=t.getZone();n.isMainActive()||n.setZone(Ke.MAIN),r.preventDefault()}else r.key===Ce.TAB&&eR(r,e)}function Jd(r,e){var T;const t=e.getDraw();if(t.isReadonly())return;const i=t.getPosition().getCursorPosition();if(!r||!i)return;const o=e.isComposing;if(o&&((T=e.compositionInfo)==null?void 0:T.value)===r)return;const a=t.getRange();if(!a.getIsCanInput())return;zd(e),o||t.getCursor().clearAgentDomValue();const{TEXT:s,HYPERLINK:l,SUBSCRIPT:c,SUPERSCRIPT:u,DATE:h}=ae,d=r.replaceAll(` +`,Ne),{startIndex:f,endIndex:p}=a.getRange(),g=t.getElementList(),v=Lo(g,p);if(!v)return;const R=Wr(d).map(P=>{const A={value:P},D=g[p+1];return(!v.type||v.type===s||v.type===l&&(D==null?void 0:D.type)===l||v.type===h&&(D==null?void 0:D.type)===h||v.type===c&&(D==null?void 0:D.type)===c||v.type===u&&(D==null?void 0:D.type)===u)&&cg.forEach(W=>{if(W==="groupIds"&&!(D!=null&&D.groupIds))return;const _=v[W];_!==void 0&&(A[W]=_)}),o&&(A.underline=!0),A}),m=t.getControl();let x;if(m.getActiveControl()&&m.getIsRangeWithinControl())x=m.setValue(R);else{const P=f+1;f!==p&&t.spliceElementList(g,P,p-f),ar(g,R,f),t.spliceElementList(g,P,0,...R),x=f+R.length}~x&&(a.setRange(x,x),t.render({curIndex:x,isSubmitHistory:!o})),o&&(e.compositionInfo={elementList:g,value:d,startIndex:x-R.length,endIndex:x})}function zd(r){if(!r.compositionInfo)return;const{elementList:e,startIndex:t,endIndex:n}=r.compositionInfo;e.splice(t+1,n-t),r.getDraw().getRange().setRange(t,t),r.compositionInfo=null}function nR(r){const e=r.getDraw(),t=e.getRange(),{startIndex:n,endIndex:i}=t.getRange();if(!~n&&!~n||e.isReadonly()||!t.getIsCanInput())return;const o=e.getElementList();let a=n,s=i;if(n===i){const d=e.getPosition().getPositionList(),f=d[n],p=f.rowNo,g=f.pageNo,v=[];for(let m=0;mg)break;x.pageNo===g&&x.rowNo===p&&v.push(m)}const R=v[0]-1;a=R<0?0:R,s=v[v.length-1]}const l=e.getOptions();Hd(o.slice(a+1,s+1),l);const c=e.getControl();let u;c.getActiveControl()&&c.getIsRangeWithinControl()?u=c.cut():(e.spliceElementList(o,a+1,s-a),u=a),t.setRange(u,u),e.render({curIndex:u})}function iR(r){const e=r.getDraw(),{copy:t}=e.getOverride();if(t){t();return}const n=e.getRange(),i=n.getIsCollapsed()?n.getRangeRowElementList():n.getSelectionElementList();!(i!=null&&i.length)||Hd(i,e.getOptions())}function oR(r,e){var o,a;const t=e.getDraw(),{drop:n}=t.getOverride();if(n){n(r);return}r.preventDefault();const i=(o=r.dataTransfer)==null?void 0:o.getData("text");if(i)e.input(i);else{const s=(a=r.dataTransfer)==null?void 0:a.files;if(!s)return;for(let l=0;l!f.type||f.type!==ae.CONTROL&&Gr.includes(f.type)?f.value:Ne).join(""))||"";if(!o)return null;const a=t.index,s=i.startIndex,c=new Intl.Segmenter(void 0,{granularity:"word"}).segment(o);let u=-1,h=-1;for(const{segment:f,index:p,isWordLike:g}of c){const v=p+s;if(g&&a>=v&&a0;){const f=u[h].value;if(l&&ms.test(f)||!l&&o.test(f))a++,h--;else break}let d=i+1;for(;d0;){const g=o[l],v=o[l-1];if(g.value===Ne&&!g.listWrap||g.listId!==(v==null?void 0:v.listId)||g.titleId!==(v==null?void 0:v.titleId))break;a++,l--}let c=i+1;for(;c{r.compositionInfo&&Jd(e.data,r)},1);else{zd(r);const i=t.getRange(),{endIndex:o}=i.getRange();t.render({curIndex:o,isSubmitHistory:!1})}t.getCursor().clearAgentDomValue()}var ju={compositionstart:uR,compositionend:hR};function fR(r,e){const t=e.getDraw();if(t.isReadonly())return;r.preventDefault();const i=t.getPageContainer();if(!Na(r.target,m=>m===i,!0))return;const s=r.target.dataset.index;s&&t.setPageNo(Number(s));const l=t.getPosition(),c=l.adjustPositionContext({x:r.offsetX,y:r.offsetY});if(!c)return;const{isTable:u,tdValueIndex:h,index:d}=c,f=l.getPositionList(),p=u?h:d;~d&&(t.getRange().setRange(p,p),l.setCursorPosition(f[p]));const g=t.getCursor(),{cursor:{dragColor:v,dragWidth:R}}=t.getOptions();g.drawCursor({width:R,color:v,isBlink:!1})}var dR={dragover:fR};class pR{constructor(e){this.draw=e,this.pageContainer=e.getPageContainer(),this.pageList=e.getPageList(),this.range=this.draw.getRange(),this.position=this.draw.getPosition(),this.isAllowSelection=!1,this.isComposing=!1,this.compositionInfo=null,this.isAllowDrag=!1,this.isAllowDrop=!1,this.cacheRange=null,this.cacheElementList=null,this.cachePositionList=null,this.cachePositionContext=null,this.mouseDownStartPosition=null}getDraw(){return this.draw}register(){this.pageContainer.addEventListener("click",this.click.bind(this)),this.pageContainer.addEventListener("mousedown",this.mousedown.bind(this)),this.pageContainer.addEventListener("mouseup",this.mouseup.bind(this)),this.pageContainer.addEventListener("mouseleave",this.mouseleave.bind(this)),this.pageContainer.addEventListener("mousemove",this.mousemove.bind(this)),this.pageContainer.addEventListener("dblclick",this.dblclick.bind(this)),this.pageContainer.addEventListener("dragover",this.dragover.bind(this)),this.pageContainer.addEventListener("drop",this.drop.bind(this)),tg(this.pageContainer,this.threeClick.bind(this))}setIsAllowSelection(e){this.isAllowSelection=e,e||this.applyPainterStyle()}setIsAllowDrag(e){this.isAllowDrag=e,this.isAllowDrop=e}clearPainterStyle(){this.pageList.forEach(e=>{e.style.cursor="text"}),this.draw.setPainterStyle(null)}applyPainterStyle(){const e=this.draw.getPainterStyle();if(!e)return;const t=this.range.getSelection();if(!t)return;const n=Object.keys(e);t.forEach(o=>{n.forEach(a=>{const s=a;o[s]=e[s]})}),this.draw.render({isSetCursor:!1});const i=this.draw.getPainterOptions();(!i||!i.isDblclick)&&this.clearPainterStyle()}selectAll(){const e=this.position.getPositionList();this.range.setRange(0,e.length-1),this.draw.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1})}mousemove(e){Gg(e,this)}mousedown(e){Kg(e,this)}click(){Qg&&!this.draw.isReadonly()&&this.draw.getCursor().getAgentDom().focus()}mouseup(e){Hg(e,this)}mouseleave(e){Bg(e,this)}keydown(e){rR(e,this)}dblclick(e){$u.dblclick(this,e)}threeClick(){$u.threeClick(this)}input(e){Jd(e,this)}cut(){nR(this)}copy(){iR(this)}compositionstart(){ju.compositionstart(this)}compositionend(e){ju.compositionend(this,e)}drop(e){oR(e,this)}dragover(e){dR.dragover(e,this)}}class gR{constructor(e,t){this.clearSideEffect=n=>{if(!this.cursor)return;const i=(n==null?void 0:n.composedPath()[0])||n.target,o=this.draw.getPageList();if(Na(i,l=>o.includes(l),!0)){this.setRangeStyle();return}if(Na(i,l=>!!l&&l.nodeType===1&&!!l.getAttribute(fn),!0)){this.setRangeStyle(),this.watchCursorActive();return}this.cursor.recoveryCursor(),this.range.recoveryRangeStyle(),this.previewer.clearResizer(),this.tableTool.dispose(),this.hyperlinkParticle.clearHyperlinkPopup(),this.control.destroyControl(),this.dateParticle.clearDatePicker()},this.setCanvasEventAbility=()=>{this.canvasEvent.setIsAllowDrag(!1),this.canvasEvent.setIsAllowSelection(!1)},this.setRangeStyle=()=>{this.range.setRangeStyle()},this.setPageScale=n=>{if(!n.ctrlKey)return;n.preventDefault();const{scale:i}=this.options;if(n.deltaY<0){const o=i*10+1;o<=30&&this.draw.setPageScale(o/10)}else{const o=i*10-1;o>=5&&this.draw.setPageScale(o/10)}},this._handleVisibilityChange=()=>{if(document.visibilityState==="visible"){const n=this.range.getRange(),i=!!~n.startIndex&&!!~n.endIndex&&n.startIndex===n.endIndex;this.range.replaceRange(n),this.draw.render({isSetCursor:i,isCompute:!1,isSubmitHistory:!1,curIndex:n.startIndex})}},this._handleDprChange=()=>{this.draw.setPageDevicePixel()},this.draw=e,this.options=e.getOptions(),this.canvasEvent=t,this.cursor=null,this.range=e.getRange(),this.previewer=e.getPreviewer(),this.tableTool=e.getTableTool(),this.hyperlinkParticle=e.getHyperlinkParticle(),this.dateParticle=e.getDateParticle(),this.control=e.getControl(),this.dprMediaQueryList=window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`)}register(){this.cursor=this.draw.getCursor(),this.addEvent()}addEvent(){window.addEventListener("blur",this.clearSideEffect),document.addEventListener("keyup",this.setRangeStyle),document.addEventListener("click",this.clearSideEffect),document.addEventListener("mouseup",this.setCanvasEventAbility),document.addEventListener("wheel",this.setPageScale,{passive:!1}),document.addEventListener("visibilitychange",this._handleVisibilityChange),this.dprMediaQueryList.addEventListener("change",this._handleDprChange)}removeEvent(){window.removeEventListener("blur",this.clearSideEffect),document.removeEventListener("keyup",this.setRangeStyle),document.removeEventListener("click",this.clearSideEffect),document.removeEventListener("mouseup",this.setCanvasEventAbility),document.removeEventListener("wheel",this.setPageScale),document.removeEventListener("visibilitychange",this._handleVisibilityChange),this.dprMediaQueryList.removeEventListener("change",this._handleDprChange)}watchCursorActive(){!this.range.getIsCollapsed()||setTimeout(()=>{var e,t;(e=this.cursor)!=null&&e.getAgentIsActive()||(t=this.cursor)==null||t.drawCursor({isFocus:!1,isBlink:!1})})}}class RR{constructor(e){this.undoStack=[],this.redoStack=[],this.maxRecordCount=e.getOptions().historyMaxRecordCount+1}undo(){if(this.undoStack.length>1){const e=this.undoStack.pop();this.redoStack.push(e),this.undoStack.length&&this.undoStack[this.undoStack.length-1]()}}redo(){if(this.redoStack.length){const e=this.redoStack.pop();this.undoStack.push(e),e()}}execute(e){for(this.undoStack.push(e),this.redoStack.length&&(this.redoStack=[]);this.undoStack.length>this.maxRecordCount;)this.undoStack.shift()}isCanUndo(){return this.undoStack.length>1}isCanRedo(){return!!this.redoStack.length}isStackEmpty(){return!this.undoStack.length&&!this.redoStack.length}recovery(){this.undoStack=[],this.redoStack=[]}popUndo(){return this.undoStack.pop()}}class mR{constructor(e){this.positionList=[],this.floatPositionList=[],this.cursorPosition=null,this.positionContext={isTable:!1,isControl:!1},this.draw=e,this.options=e.getOptions()}getFloatPositionList(){return this.floatPositionList}getTablePositionList(e){const{index:t,trIndex:n,tdIndex:i}=this.positionContext;return e[t].trList[n].tdList[i].positionList||[]}getPositionList(){return this.positionContext.isTable?this.getTablePositionList(this.draw.getOriginalElementList()):this.getOriginalPositionList()}getMainPositionList(){return this.positionContext.isTable?this.getTablePositionList(this.draw.getOriginalMainElementList()):this.positionList}getOriginalPositionList(){const e=this.draw.getZone();return e.isHeaderActive()?this.draw.getHeader().getPositionList():e.isFooterActive()?this.draw.getFooter().getPositionList():this.positionList}getOriginalMainPositionList(){return this.positionList}getSelectionPositionList(){const{startIndex:e,endIndex:t}=this.draw.getRange().getRange();return e===t?null:this.getPositionList().slice(e+1,t+1)}setPositionList(e){this.positionList=e}setFloatPositionList(e){this.floatPositionList=e}computePageRowPosition(e){const{positionList:t,rowList:n,pageNo:i,startX:o,startY:a,startRowIndex:s,startIndex:l,innerWidth:c,zone:u}=e,{scale:h,table:{tdPadding:d}}=this.options;let f=o,p=a,g=l;for(let v=0;vU+N.height,0),V=(L.height-te)*h-Y,ie=L.verticalAlign===Fn.MIDDLE?V/2:V;Math.floor(ie)>0&&L.positionList.forEach(U=>{const{coordinate:{leftTop:N,leftBottom:J,rightBottom:B,rightTop:re}}=U;N[1]+=ie,J[1]+=ie,B[1]+=ie,re[1]+=ie})}f=F.x,p=F.y}}f=x,p=T}}f=o,p+=R.height}return{x:f,y:p,index:g}}computePositionList(){var c;this.positionList=[];const e=this.draw.getInnerWidth(),t=this.draw.getPageRowList(),n=this.draw.getMargins(),i=n[3],a=this.draw.getHeader().getExtraHeight(),s=n[0]+a;let l=0;for(let u=0;uu)break;if(_[0]-D<=t&&Q[0]>=t&&_[1]<=n&&te[1]>=n){let O=T;const I=o[T];if(I.type===ae.TABLE)for(let L=0;LT.isLastLetter&&T.pageNo===u);for(let T=0;TD[1]&&n<=W[1]){const _=a.findIndex(Q=>Q.pageNo===u&&Q.rowNo===A);if(t_)return{index:-1,zone:Ke.FOOTER}}else if(n<=_&&n>=A)return{index:-1,zone:Ke.MAIN};const Q=this.draw.getMargins();if(n<=Q[1])for(let te=0;te=I[0]&&t<=y[0]||((v=a[te+1])==null?void 0:v.rowNo)!==0)return{index:O.index}}else{const te=p[p.length-1];if(te){const O=te.rowNo;for(let I=0;I=L[0]&&t<=k[0]||((R=a[I+1])==null?void 0:R.rowNo)!==O)return{index:y.index}}}}return{index:((m=p[p.length-1])==null?void 0:m.index)||a.length-1}}return{hitLineStartIndex:f,index:d,isControl:!!((x=o[d])!=null&&x.controlId)}}getFloatPositionByXY(e){const{x:t,y:n}=e,i=this.draw.getZone().getZone();for(let o=0;o=p.x&&t<=p.x+s.width&&n>=p.y&&n<=p.y+s.height)return l?{index:c,isDirectHit:!0,isImage:!0,isTable:l,trIndex:u,tdIndex:h,tdValueIndex:d,tdId:s.tdId,trId:s.trId,tableId:s.tableId}:{index:a.index,isDirectHit:!0,isImage:!0}}}}adjustPositionContext(e){const t=this.getPositionByXY(e);if(!~t.index)return null;if(t.isControl&&this.draw.getMode()!==Mt.READONLY){const{index:g,isTable:v,trIndex:R,tdIndex:m,tdValueIndex:x}=t,T=this.draw.getControl(),{newIndex:P}=T.moveCursor({index:g,isTable:v,trIndex:R,tdIndex:m,tdValueIndex:x});v?t.tdValueIndex=P:t.index=P}const{index:n,isCheckbox:i,isRadio:o,isControl:a,isImage:s,isDirectHit:l,isTable:c,trIndex:u,tdIndex:h,tdId:d,trId:f,tableId:p}=t;return this.setPositionContext({isTable:c||!1,isCheckbox:i||!1,isRadio:o||!1,isControl:a||!1,isImage:s||!1,isDirectHit:l||!1,index:n,trIndex:u,tdIndex:h,tdId:d,trId:f,tableId:p}),t}}class vR{constructor(e){this.draw=e,this.options=e.getOptions(),this.listener=e.getListener(),this.eventBus=e.getEventBus(),this.position=e.getPosition(),this.historyManager=e.getHistoryManager(),this.range={startIndex:-1,endIndex:-1}}getRange(){return this.range}clearRange(){this.setRange(-1,-1)}getIsCollapsed(){const{startIndex:e,endIndex:t}=this.range;return e===t}getSelection(){const{startIndex:e,endIndex:t}=this.range;return e===t?null:this.draw.getElementList().slice(e+1,t+1)}getSelectionElementList(){if(this.range.isCrossRowCol){const e=this.draw.getTableParticle().getRangeRowCol();if(!e)return null;const t=[];for(let n=0;n!t.type||Gr.includes(t.type)):null}getTextLikeSelectionElementList(){const e=this.getSelectionElementList();return e?e.filter(t=>!t.type||Gr.includes(t.type)):null}getRangeRow(){const{startIndex:e,endIndex:t}=this.range;if(!~e&&!~t)return null;const n=this.position.getPositionList(),i=new Map;for(let o=e;o=0;){const{pageNo:l,rowNo:c}=n[a];let u=o.get(l);u||(u=[],o.set(l,u)),u.includes(c)||u.unshift(c);const h=i[a],d=i[a-1];if(h.value===Ne&&!h.listWrap||h.listId!==(d==null?void 0:d.listId)||h.titleId!==(d==null?void 0:d.titleId))break;a--}if(e!==t){let l=e+1;for(;l=l[0]&&e<=c[0]&&t>=l[1]&&t<=c[1])return!0}return!1}getKeywordRangeList(e){const t=this.draw.getSearch().getMatchList(e,this.draw.getOriginalElementList()),n=new Map;for(const o of t){const a=n.get(o.groupId);if(a)a.endIndex+=1;else{const{type:s,groupId:l,tableId:c,index:u,tdIndex:h,trIndex:d}=o,f={startIndex:u-1,endIndex:u};s===Mn.TABLE&&(f.tableId=c,f.startTdIndex=h,f.endTdIndex=h,f.startTrIndex=d,f.endTrIndex=d),n.set(l,f)}}const i=[];return n.forEach(o=>{i.push(o)}),i}getIsCanInput(){const{startIndex:e,endIndex:t}=this.getRange();if(!~e&&!~t)return!1;if(e===t)return!0;const n=this.draw.getElementList(),i=n[e],o=n[t];return!i.controlId&&!o.controlId||(!i.controlId||i.controlComponent===ye.POSTFIX)&&(!o.controlId||o.controlComponent===ye.POSTFIX)||!!i.controlId&&o.controlId===i.controlId&&o.controlComponent!==ye.POSTFIX}setRange(e,t,n,i,o,a,s){this.range.startIndex=e,this.range.endIndex=t,this.range.tableId=n,this.range.startTdIndex=i,this.range.endTdIndex=o,this.range.startTrIndex=a,this.range.endTrIndex=s,this.range.isCrossRowCol=!!(i||o||a||s),this.range.zone=this.draw.getZone().getZone();const l=this.draw.getControl();if(~e&&~t){const u=this.draw.getElementList()[e];if(u!=null&&u.controlId){l.initControl();return}}l.destroyControl()}replaceRange(e){this.setRange(e.startIndex,e.endIndex,e.tableId,e.startTdIndex,e.endTdIndex,e.startTrIndex,e.endTrIndex)}setRangeStyle(){var y;const e=this.listener.rangeStyleChange,t=this.eventBus.isSubscribe("rangeStyleChange");if(!e&&!t)return;const{startIndex:n,endIndex:i,isCrossRowCol:o}=this.range;if(!~n&&!~i)return;let a;if(o){const L=this.draw.getOriginalElementList(),k=this.position.getPositionContext();a=L[k.index]}else{const L=~i?i:0,k=this.draw.getElementList();a=Lo(k,L)}if(!a)return;const s=this.getSelection()||[a],l=a.type||ae.TEXT,c=a.font||this.options.defaultFont,u=a.size||this.options.defaultSize,h=!~s.findIndex(L=>!L.bold),d=!~s.findIndex(L=>!L.italic),f=!~s.findIndex(L=>{var k;return!L.underline&&!((k=L.control)!=null&&k.underline)}),p=!~s.findIndex(L=>!L.strikeout),g=a.color||null,v=a.highlight||null,R=a.rowFlex||null,m=a.rowMargin||this.options.defaultRowMargin,x=a.dashArray||[],T=a.level||null,P=a.listType||null,A=a.listStyle||null,D=f&&a.textDecoration||null,W=!!this.draw.getPainterStyle(),_=this.historyManager.isCanUndo(),Q=this.historyManager.isCanRedo(),te=a.groupIds||null,O=(y=a.extension)!=null?y:null,I={type:l,undo:_,redo:Q,painter:W,font:c,size:u,bold:h,italic:d,underline:f,strikeout:p,color:g,highlight:v,rowFlex:R,rowMargin:m,dashArray:x,level:T,listType:P,listStyle:A,groupIds:te,textDecoration:D,extension:O};e&&e(I),t&&this.eventBus.emit("rangeStyleChange",I)}recoveryRangeStyle(){const e=this.listener.rangeStyleChange,t=this.eventBus.isSubscribe("rangeStyleChange");if(!e&&!t)return;const n=this.options.defaultFont,i=this.options.defaultSize,o=this.options.defaultRowMargin,a=!!this.draw.getPainterStyle(),s=this.historyManager.isCanUndo(),l=this.historyManager.isCanRedo(),c={type:null,undo:s,redo:l,painter:a,font:n,size:i,bold:!1,italic:!1,underline:!1,strikeout:!1,color:null,highlight:null,rowFlex:null,rowMargin:o,dashArray:[],level:null,listType:null,listStyle:null,groupIds:null,textDecoration:null,extension:null};e&&e(c),t&&this.eventBus.emit("rangeStyleChange",c)}shrinkBoundary(e={}){const t=e.elementList||this.draw.getElementList(),n=e.range||this.getRange(),{startIndex:i,endIndex:o}=n;if(!~i&&!~o)return;const a=t[i],s=t[o];if(i===o){if(a.controlComponent===ye.PLACEHOLDER){let l=i-1;for(;l>0;){const c=t[l];if(c.controlId!==a.controlId||c.controlComponent===ye.PREFIX){n.startIndex=l,n.endIndex=l;break}l--}}}else{if(a.controlComponent===ye.PLACEHOLDER||s.controlComponent===ye.PLACEHOLDER){let l=o-1;for(;l>0;){const c=t[l];if(c.controlId!==s.controlId||c.controlComponent===ye.PREFIX){n.startIndex=l,n.endIndex=l;return}l--}}if(a.controlComponent===ye.PREFIX){let l=i+1;for(;l0;){const c=t[l];if(c.controlId!==a.controlId||c.controlComponent===ye.VALUE){n.startIndex=l;break}else if(c.controlComponent===ye.PLACEHOLDER){n.startIndex=l,n.endIndex=l;return}l--}}}}render(e,t,n,i,o){e.save(),e.globalAlpha=this.options.rangeAlpha,e.fillStyle=this.options.rangeColor,e.fillRect(t,n,i,o),e.restore()}toString(){const e=this.getTextLikeSelection();return e?e.map(t=>t.value).join("").replace(new RegExp(Ne,"g"),""):""}}var Sc=(r=>(r.CONTAIN="contain",r.COVER="cover",r))(Sc||{}),Hn=(r=>(r.REPEAT="repeat",r.NO_REPEAT="no-repeat",r.REPEAT_X="repeat-x",r.REPEAT_Y="repeat-y",r))(Hn||{});class yR{constructor(e){this.draw=e,this.options=e.getOptions(),this.imageCache=new Map}_renderBackgroundColor(e,t,n,i){e.save(),e.fillStyle=t,e.fillRect(0,0,n,i),e.restore()}_drawImage(e,t,n,i){const{background:o,scale:a}=this.options;if(o.size===Sc.CONTAIN){const s=t.width*a,l=t.height*a;if(!o.repeat||o.repeat===Hn.NO_REPEAT)e.drawImage(t,0,0,s,l);else{let c=0,u=0;const h=o.repeat===Hn.REPEAT||o.repeat===Hn.REPEAT_X?Math.ceil(n*a/s):1,d=o.repeat===Hn.REPEAT||o.repeat===Hn.REPEAT_Y?Math.ceil(i*a/l):1;for(let f=0;f{this.imageCache.set(i.image,a),this._drawImage(e,a,t,n),this.draw.render({isCompute:!1,isSubmitHistory:!1})}}}render(e,t){const{background:n}=this.options;if(n.image){const{width:i,height:o}=this.options;this._renderBackgroundImage(e,i,o)}else{const i=this.draw.getCanvasWidth(t),o=this.draw.getCanvasHeight(t);this._renderBackgroundColor(e,n.color,i,o)}}}class xc{constructor(){this.fillRect=this.clearFillInfo()}clearFillInfo(){return this.fillColor=void 0,this.fillDecorationStyle=void 0,this.fillRect={x:0,y:0,width:0,height:0},this.fillRect}recordFillInfo(e,t,n,i,o,a,s){const l=!this.fillRect.width;if(!l&&(this.fillColor!==a||this.fillDecorationStyle!==s)){this.render(e),this.clearFillInfo(),this.recordFillInfo(e,t,n,i,o,a,s);return}l&&(this.fillRect.x=t,this.fillRect.y=n),o&&this.fillRect.height=0;){const i=this.searchMatchList[e];if(n!==i.groupId){t=!0,this.searchNavigateIndex=e-(this.searchKeyword.length-1);break}e--}if(!t){if(this.searchMatchList[this.searchMatchList.length-1].groupId===n)return null;this.searchNavigateIndex=this.searchMatchList.length-1-(this.searchKeyword.length-1)}}return this.searchNavigateIndex}searchNavigateNext(){if(!this.searchMatchList.length||!this.searchKeyword)return null;if(this.searchNavigateIndex===null)this.searchNavigateIndex=0;else{let e=this.searchNavigateIndex+1,t=!1;const n=this.searchMatchList[this.searchNavigateIndex].groupId;for(;ee+t)}getSearchMatchList(){return this.searchMatchList}getSearchNavigateInfo(){if(!this.searchKeyword||!this.searchMatchList.length)return null;const e=this.searchNavigateIndex!==null?this.searchNavigateIndex/this.searchKeyword.length+1:0;let t=0,n=null;for(let i=0;i!m.type||Gr.includes(m.type)&&m.controlComponent!==ye.CHECKBOX?m.value:Ne).filter(Boolean).join("").toLocaleLowerCase(),v=[];let R=g.indexOf(h);for(;R!==-1;)v.push(R),R=g.indexOf(h,R+h.length);for(let m=0;m(r.SOLID="solid",r.DOUBLE="double",r.DASHED="dashed",r.DOTTED="dotted",r.WAVY="wavy",r))(Ro||{}),mo=(r=>(r.SOLID="solid",r.DASHED="dashed",r.DOTTED="dotted",r))(mo||{});class OR extends xc{constructor(e){super(),this.options=e.getOptions()}_drawLine(e,t,n,i,o){const a=t+i;switch(e.beginPath(),o){case mo.DASHED:e.setLineDash([3,1]);break;case mo.DOTTED:e.setLineDash([1,1]);break}e.moveTo(t,n),e.lineTo(a,n),e.stroke()}_drawDouble(e,t,n,i){const a=t+i,s=n+3*this.options.scale;e.beginPath(),e.moveTo(t,n),e.lineTo(a,n),e.stroke(),e.beginPath(),e.moveTo(t,s),e.lineTo(a,s),e.stroke()}_drawWave(e,t,n,i){const{scale:o}=this.options,a=1.2*o,s=1/o,l=n+2*a;e.beginPath();for(let c=0;c{const{intersectionPageNo:t,visiblePageNoList:n}=this.getPageVisibleInfo();this.draw.setIntersectionPageNo(t),this.draw.setVisiblePageNoList(n)},150),this.draw=e,this.options=e.getOptions(),this.scrollContainer=this.getScrollContainer(),setTimeout(()=>{window.scrollY||this._observer()}),this._addEvent()}getScrollContainer(){return this.options.scrollContainerSelector&&document.querySelector(this.options.scrollContainerSelector)||document}_addEvent(){this.scrollContainer.addEventListener("scroll",this._observer)}removeEvent(){this.scrollContainer.removeEventListener("scroll",this._observer)}getElementVisibleInfo(e){const t=e.getBoundingClientRect(),n=this.scrollContainer===document?Math.max(document.documentElement.clientHeight,window.innerHeight):this.scrollContainer.clientHeight,i=Math.min(t.bottom,n)-Math.max(t.top,0);return{intersectionHeight:i>0?i:0}}getPageVisibleInfo(){const e=this.draw.getPageList(),t=[];let n=0,i=0;for(let o=0;oi&&(i=s,n=o)}return{intersectionPageNo:n,visiblePageNoList:t}}}class IR{constructor(e){this.step=5,this.thresholdPoints=[70,40,10,20],this._mousedown=()=>{this.isMousedown=!0},this._mouseup=()=>{this.isMousedown=!1,this._stopMove()},this._mousemove=t=>{if(!this.isMousedown||this.rangeManager.getIsCollapsed())return;const{x:n,y:i}=t,o=document.documentElement.clientWidth,a=document.documentElement.clientHeight;i(r.ALL="all",r.EMPTY="empty",r.EXTERNAL="external",r))(hn||{}),Mr=(r=>(r.TOP="top",r.RIGHT="right",r.BOTTOM="bottom",r.LEFT="left",r))(Mr||{}),_o=(r=>(r.FORWARD="forward",r.BACK="back",r))(_o||{});class NR{constructor(e){this.draw=e,this.range=e.getRange(),this.options=e.getOptions()}getTrListGroupByCol(e){var n;const t=gt(e);for(let i=0;i=0;a--){const s=o.tdList[a],{rowspan:l,rowIndex:c,colIndex:u}=s,h=c+l-1;if(h!==a){const d=o.tdList.splice(a,1)[0];(n=t[h])==null||n.tdList.splice(u,0,d)}}}return t}getRangeRowCol(){const{isTable:e,index:t,trIndex:n,tdIndex:i}=this.draw.getPosition().getPositionContext();if(!e)return null;const{isCrossRowCol:o,startTdIndex:a,endTdIndex:s,startTrIndex:l,endTrIndex:c}=this.range.getRange(),d=this.draw.getOriginalElementList()[t].trList;if(!o)return[[d[n].tdList[i]]];let f=d[l].tdList[a],p=d[c].tdList[s];(f.x>p.x||f.y>p.y)&&([f,p]=[p,f]);const g=f.colIndex,v=p.colIndex+(p.colspan-1),R=f.rowIndex,m=p.rowIndex+(p.rowspan-1),x=[];for(let T=0;T=g&&_<=v&&Q>=R&&Q<=m&&A.push(W)}A.length&&x.push(A)}return x.length?x:null}_drawOuterBorder(e){const{ctx:t,startX:n,startY:i,width:o,height:a,isDrawFullBorder:s}=e;t.beginPath();const l=Math.round(n),c=Math.round(i);t.translate(.5,.5),s?t.rect(l,c,o,a):(t.moveTo(l,c+a),t.lineTo(l,c),t.lineTo(l+o,c)),t.stroke(),t.translate(-.5,-.5)}_drawSlash(e,t,n,i){var u,h;const{scale:o}=this.options;e.save();const a=t.width*o,s=t.height*o,l=Math.round(t.x*o+n),c=Math.round(t.y*o+i);(u=t.slashTypes)!=null&&u.includes(_o.FORWARD)&&(e.moveTo(l+a,c),e.lineTo(l,c+s)),(h=t.slashTypes)!=null&&h.includes(_o.BACK)&&(e.moveTo(l,c),e.lineTo(l+a,c+s)),e.stroke(),e.restore()}_drawBorder(e,t,n,i){var f,p,g,v,R,m;const{colgroup:o,trList:a,borderType:s}=t;if(!o||!a)return;const{scale:l}=this.options,c=t.width*l,u=t.height*l,h=s===hn.EMPTY,d=s===hn.EXTERNAL;e.save(),e.lineWidth=l,h||this._drawOuterBorder({ctx:e,startX:n,startY:i,width:c,height:u,isDrawFullBorder:d});for(let x=0;xt+n.width,0)}getTableHeight(e){const t=e.trList;return t!=null&&t.length?this.getTdListByColIndex(t,0).reduce((n,i)=>n+i.height,0):0}getRowCountByColIndex(e,t){return this.getTdListByColIndex(e,t).reduce((n,i)=>n+i.rowspan,0)}getTdListByColIndex(e,t){const n=[];for(let i=0;i=l&&t<=c&&n.push(s)}}return n}computeRowColInfo(e){const{colgroup:t,trList:n}=e;if(!t||!n)return;let i=0,o=0;for(let a=0;a1&&a!==0){const m=s.tdList[u-1],x=m?m.colIndex+m.colspan:u;for(let T=x;Tp)&&(c=p);const g=s.tdList.length-1===u;let v=l;if(!v&&h.rowspan>1){const m=n.length-1-a;v=h.rowspan-1===m}const R=l&&g;h.isLastRowTd=g,h.isLastColTd=v,h.isLastTd=R,h.x=i,h.y=o,h.width=f,h.height=p,h.rowIndex=a,h.colIndex=d,i+=f,g&&!R&&(i=0,o+=c)}}}drawRange(e,t,n,i){const{scale:o,rangeAlpha:a,rangeColor:s}=this.options,{type:l,trList:c}=t;if(!c||l!==ae.TABLE)return;const{isCrossRowCol:u,startTdIndex:h,endTdIndex:d,startTrIndex:f,endTrIndex:p}=this.range.getRange();if(!u)return;let g=c[f].tdList[h],v=c[p].tdList[d];(g.x>v.x||g.y>v.y)&&([g,v]=[v,g]);const R=g.colIndex,m=v.colIndex+(v.colspan-1),x=g.rowIndex,T=v.rowIndex+(v.rowspan-1);e.save();for(let P=0;P=R&&_<=m&&Q>=x&&Q<=T){const te=W.x*o,O=W.y*o,I=W.width*o,y=W.height*o;e.globalAlpha=a,e.fillStyle=s,e.fillRect(te+n,O+i,I,y)}}}e.restore()}render(e,t,n,i){this._drawBackgroundColor(e,t,n,i),this._drawBorder(e,t,n,i)}}var _n=(r=>(r.ROW="row",r.COL="col",r))(_n||{});class MR{constructor(e){this.MIN_TD_WIDTH=20,this.ROW_COL_OFFSET=18,this.BORDER_VALUE=4,this.draw=e,this.canvas=e.getPage(),this.options=e.getOptions(),this.position=e.getPosition(),this.container=e.getContainer(),this.toolRowContainer=null,this.toolColContainer=null,this.toolBorderContainer=null,this.anchorLine=null,this.mousedownX=0,this.mousedownY=0}dispose(){var e,t,n;(e=this.toolRowContainer)==null||e.remove(),(t=this.toolColContainer)==null||t.remove(),(n=this.toolBorderContainer)==null||n.remove(),this.toolRowContainer=null,this.toolColContainer=null,this.toolBorderContainer=null}render(){const{isTable:e,index:t,trIndex:n,tdIndex:i}=this.position.getPositionContext();if(!e)return;this.dispose();const{scale:o}=this.options,a=this.draw.getOriginalElementList(),s=this.position.getOriginalPositionList(),l=a[t],c=s[t],{colgroup:u,trList:h}=l,{coordinate:{leftTop:d}}=c,f=this.draw.getHeight(),p=this.draw.getPageGap(),g=this.draw.getPageNo()*(f+p),v=d[0],R=d[1]+g,m=l.trList[n].tdList[i],x=m.rowIndex,T=m.colIndex,P=h.map(O=>O.height),A=document.createElement("div");A.classList.add(`${Fe}-table-tool__row`),A.style.transform=`translateX(-${this.ROW_COL_OFFSET*o}px)`;for(let O=0;O{this._mousedown({evt:k,element:l,index:O,order:_n.ROW})},y.append(L),y.style.height=`${I}px`,A.append(y)}A.style.left=`${v}px`,A.style.top=`${R}px`,this.container.append(A),this.toolRowContainer=A;const D=u.map(O=>O.width),W=document.createElement("div");W.classList.add(`${Fe}-table-tool__col`),W.style.transform=`translateY(-${this.ROW_COL_OFFSET*o}px)`;for(let O=0;O{this._mousedown({evt:k,element:l,index:O,order:_n.COL})},y.append(L),y.style.width=`${I}px`,W.append(y)}W.style.left=`${v}px`,W.style.top=`${R}px`,this.container.append(W),this.toolColContainer=W;const _=l.height*o,Q=l.width*o,te=document.createElement("div");te.classList.add(`${Fe}-table-tool__border`),te.style.height=`${_}px`,te.style.width=`${Q}px`,te.style.left=`${v}px`,te.style.top=`${R}px`;for(let O=0;O{this._mousedown({evt:Y,element:l,index:L.rowIndex+L.rowspan-1,order:_n.ROW})},te.appendChild(k);const F=document.createElement("div");F.classList.add(`${Fe}-table-tool__border__col`),F.style.width=`${this.BORDER_VALUE}px`,F.style.height=`${L.height*o}px`,F.style.top=`${L.y*o}px`,F.style.left=`${(L.x+L.width)*o-this.BORDER_VALUE/2}px`,F.onmousedown=Y=>{this._mousedown({evt:Y,element:l,index:L.colIndex+L.colspan-1,order:_n.COL})},te.appendChild(F)}}this.container.append(te),this.toolBorderContainer=te}_mousedown(e){const{evt:t,index:n,order:i,element:o}=e;this.canvas=this.draw.getPage();const{scale:a}=this.options,s=this.draw.getWidth(),l=this.draw.getHeight(),c=this.draw.getPageGap(),u=this.draw.getPageNo()*(l+c);this.mousedownX=t.x,this.mousedownY=t.y;const h=t.target,d=this.canvas.getBoundingClientRect(),f=window.getComputedStyle(h).cursor;document.body.style.cursor=f,this.canvas.style.cursor=f;let p=0,g=0;const v=document.createElement("div");v.classList.add(`${Fe}-table-anchor__line`),i===_n.ROW?(v.classList.add(`${Fe}-table-anchor__line__row`),v.style.width=`${s}px`,p=0,g=u+this.mousedownY-d.top):(v.classList.add(`${Fe}-table-anchor__line__col`),v.style.height=`${l}px`,p=this.mousedownX-d.left,g=u),v.style.left=`${p}px`,v.style.top=`${g}px`,this.container.append(v),this.anchorLine=v;let R=0,m=0;const x=T=>{const P=this._mousemove(T,i,p,g);P&&(R=P.dx,m=P.dy)};document.addEventListener("mousemove",x),document.addEventListener("mouseup",()=>{var P;let T=!1;if(i===_n.ROW){const A=o.trList,D=A[n]||A[n-1],{defaultTrMinHeight:W}=this.options.table;m<0&&D.height+m0&&_&&_-RD){const O=o.width;R=D-O}}R&&(A.length-1!==n&&(A[n+1].width-=R/a),A[n].width+=R/a,T=!0)}}T&&this.draw.render({isSetCursor:!1}),v.remove(),document.removeEventListener("mousemove",x),document.body.style.cursor="",this.canvas.style.cursor="text"},{once:!0}),t.preventDefault()}_mousemove(e,t,n,i){if(!this.anchorLine)return null;const o=e.x-this.mousedownX,a=e.y-this.mousedownY;return t===_n.ROW?this.anchorLine.style.top=`${i+a}px`:this.anchorLine.style.left=`${n+o}px`,e.preventDefault(),{dx:o,dy:a}}}class LR{constructor(e){this.draw=e,this.options=e.getOptions(),this.container=e.getContainer();const{hyperlinkPopupContainer:t,hyperlinkDom:n}=this._createHyperlinkPopupDom();this.hyperlinkDom=n,this.hyperlinkPopupContainer=t}_createHyperlinkPopupDom(){const e=document.createElement("div");e.classList.add(`${Fe}-hyperlink-popup`);const t=document.createElement("a");return t.target="_blank",t.rel="noopener",e.append(t),this.container.append(e),{hyperlinkPopupContainer:e,hyperlinkDom:t}}drawHyperlinkPopup(e,t){const{coordinate:{leftTop:[n,i]},lineHeight:o}=t,a=this.draw.getHeight(),s=this.draw.getPageGap(),l=this.draw.getPageNo()*(a+s);this.hyperlinkPopupContainer.style.display="block",this.hyperlinkPopupContainer.style.left=`${n}px`,this.hyperlinkPopupContainer.style.top=`${i+l+o}px`;const c=e.url||"#";this.hyperlinkDom.href=c,this.hyperlinkDom.title=c,this.hyperlinkDom.innerText=c}clearHyperlinkPopup(){this.hyperlinkPopupContainer.style.display="none"}openHyperlink(e){const t=window.open(e.url,"_blank");t&&(t.opener=null)}render(e,t,n,i){e.save(),e.font=t.style,t.color||(t.color=this.options.defaultHyperlinkColor),e.fillStyle=t.color,t.underline===void 0&&(t.underline=!0),e.fillText(t.value,n,i),e.restore()}}class FR{constructor(e,t){this.draw=e,this.position=e.getPosition(),this.options=e.getOptions(),this.elementList=t||[],this.rowList=[],this.positionList=[]}getRowList(){return this.rowList}setElementList(e){this.elementList=e}getElementList(){return this.elementList}getPositionList(){return this.positionList}compute(){this.recovery(),this._computeRowList(),this._computePositionList()}recovery(){this.rowList=[],this.positionList=[]}_computeRowList(){const e=this.draw.getInnerWidth();this.rowList=this.draw.computeRowList({innerWidth:e,elementList:this.elementList})}_computePositionList(){const e=this.getHeaderTop(),t=this.draw.getInnerWidth(),i=this.draw.getMargins()[3],o=e;this.position.computePageRowPosition({positionList:this.positionList,rowList:this.rowList,pageNo:0,startRowIndex:0,startIndex:0,startX:i,startY:o,innerWidth:t,zone:Ke.HEADER})}getHeaderTop(){const{header:{top:e,disabled:t},scale:n}=this.options;return t?0:Math.floor(e*n)}getMaxHeight(){const{header:{maxHeightRadio:e}}=this.options,t=this.draw.getHeight();return Math.floor(t*_d[e])}getHeight(){const e=this.getMaxHeight(),t=this.getRowHeight();return t>e?e:t}getRowHeight(){return this.rowList.reduce((e,t)=>e+t.height,0)}getExtraHeight(){const e=this.draw.getMargins(),t=this.getHeight(),i=this.getHeaderTop()+t-e[0];return i<=0?0:i}render(e,t){e.globalAlpha=1;const n=this.draw.getInnerWidth(),i=this.getMaxHeight(),o=[];let a=0;for(let s=0;si)break;o.push(l),a+=l.height}this.draw.drawRow(e,{elementList:this.elementList,positionList:this.positionList,rowList:o,pageNo:t,startIndex:0,innerWidth:n,zone:Ke.HEADER})}}class CR{getOffsetY(e){return-e.metrics.height/2}render(e,t,n,i){e.save(),e.font=t.style,t.color&&(e.fillStyle=t.color),e.fillText(t.value,n,i+this.getOffsetY(t)),e.restore()}}class AR{getOffsetY(e){return e.metrics.height/2}render(e,t,n,i){e.save(),e.font=t.style,t.color&&(e.fillStyle=t.color),e.fillText(t.value,n,i+this.getOffsetY(t)),e.restore()}}class DR{constructor(e){this.options=e.getOptions()}render(e,t,n,i){var c;e.save();const{scale:o,separator:{lineWidth:a,strokeStyle:s}}=this.options;e.lineWidth=a*o,e.strokeStyle=t.color||s,(c=t.dashArray)!=null&&c.length&&e.setLineDash(t.dashArray);const l=Math.round(i);e.translate(0,e.lineWidth/2),e.beginPath(),e.moveTo(n,l),e.lineTo(n+t.width*o,l),e.stroke(),e.restore()}}class XR{constructor(e){this.draw=e,this.options=e.getOptions(),this.i18n=e.getI18n()}render(e,t,n,i){const{pageBreak:{font:o,fontSize:a,lineDash:s}}=this.options,l=this.i18n.t("pageBreak.displayName"),{scale:c,defaultRowMargin:u}=this.options,h=a*c,d=t.width*c,f=this.draw.getDefaultBasicRowMarginHeight()*u;e.save(),e.font=`${h}px ${o}`;const p=e.measureText(l),g=(d-p.width)/2;e.setLineDash(s),e.translate(0,.5+f),e.beginPath(),e.moveTo(n,i),e.lineTo(n+g,i),e.moveTo(n+g+p.width,i),e.lineTo(n+d,i),e.stroke(),e.fillText(l,n+g,i+p.actualBoundingBoxAscent-h/2),e.restore()}}class UR{constructor(e){this.draw=e,this.options=e.getOptions()}render(e){const{watermark:{data:t,opacity:n,font:i,size:o,color:a},scale:s}=this.options,l=this.draw.getWidth(),c=this.draw.getHeight(),u=l/2,h=c/2;e.save(),e.globalAlpha=n,e.font=`${o*s}px ${i}`,e.fillStyle=a;const d=e.measureText(t);e.translate(u,h),e.rotate(-45*Math.PI/180),e.fillText(t,-d.width/2,d.actualBoundingBoxAscent-o/2),e.restore()}}class WR{constructor(e){this.draw=e.getDraw(),this.options=this.draw.getOptions(),this.highlightList=[],this.highlightMatchResult=[]}getHighlightMatchResult(){return this.highlightMatchResult}getHighlightList(){return this.highlightList}setHighlightList(e){this.highlightList=e}computeHighlightList(){const e=this.draw.getSearch(),t=(n,i)=>{var a;let o=0;for(;og.conceptId===l);if(!~c)continue;const u=o;let h=o;for(;h({...m,...v,...i,index:m.index+u})))}}};this.highlightMatchResult=[],t(this.draw.getOriginalMainElementList())}renderHighlightList(e,t){var s,l,c;if(!((s=this.highlightMatchResult)!=null&&s.length))return;const{searchMatchAlpha:n,searchMatchColor:i}=this.options,o=this.draw.getPosition().getOriginalPositionList(),a=this.draw.getOriginalElementList();e.save();for(let u=0;u0;){const l=t[a];if(l.controlId!==i.controlId||l.controlComponent===ye.PREFIX)break;l.controlComponent===ye.VALUE&&o.unshift(l),a--}let s=n+1;for(;s0;){const f=o[u];if(f.controlId!==s.controlId||f.controlComponent===ye.PREFIX){l=u;break}u--}let h=a+1;for(;hR.code===e);if(!c)return;const u=this.getValue(t)[0],h=u?un(u,ri):un(i[o.startIndex],Ci),d=this.clearSelect(t,{isAddPlaceholder:!1});if(!~d)return;s||this.control.removePlaceholder(d,t);const f=Eo(i[d],ri),p=d+1,g=Wr(c.value),v=this.control.getDraw();for(let R=0;R{this.setSelect(d.code)},f.append(document.createTextNode(d.value)),o.append(f)}i.append(o);const{coordinate:{leftTop:[a,s]},lineHeight:l}=n,c=this.control.getPreY();i.style.left=`${a}px`,i.style.top=`${s+c+l}px`,this.control.getContainer().append(i),this.selectDom=i}awake(){var n;if(this.isPopup||this.control.getIsDisabledControl())return;const{startIndex:e}=this.control.getRange();((n=this.control.getElementList()[e+1])==null?void 0:n.controlId)===this.element.controlId&&(this._createSelectPopupDom(),this.isPopup=!0)}destroy(){var e;!this.isPopup||((e=this.selectDom)==null||e.remove(),this.isPopup=!1)}}class qu{constructor(e,t){this.element=e,this.control=t}setElement(e){this.element=e}getElement(){return this.element}getValue(e={}){const t=e.elementList||this.control.getElementList(),{startIndex:n}=e.range||this.control.getRange(),i=t[n],o=[];let a=n;for(;a>0;){const l=t[a];if(l.controlId!==i.controlId||l.controlComponent===ye.PREFIX)break;l.controlComponent===ye.VALUE&&o.unshift(l),a--}let s=n+1;for(;s";const l=document.createElement("span");l.classList.add(`${Fe}-date-title__next-year`),l.innerText=">>",n.append(i),n.append(o),n.append(a),n.append(s),n.append(l);const c=document.createElement("div");c.classList.add(`${Fe}-date-week`);const{weeks:{sun:u,mon:h,tue:d,wed:f,thu:p,fri:g,sat:v}}=this.lang;[u,h,d,f,p,g,v].forEach(O=>{const I=document.createElement("span");I.innerText=`${O}`,c.append(I)});const m=document.createElement("div");m.classList.add(`${Fe}-date-day`),t.append(n),t.append(c),t.append(m);const x=document.createElement("ul");x.classList.add(`${Fe}-time-wrap`);let T,P,A;[this.lang.hour,this.lang.minute,this.lang.second].forEach((O,I)=>{const y=document.createElement("li"),L=document.createElement("span");L.innerText=O,y.append(L);const k=document.createElement("ol"),F=I===0,Y=I===1,V=F?24:60;for(let ie=0;ie{this._preYear()},this.dom.title.preMonth.onclick=()=>{this._preMonth()},this.dom.title.nextMonth.onclick=()=>{this._nextMonth()},this.dom.title.nextYear.onclick=()=>{this._nextYear()},this.dom.menu.time.onclick=()=>{this.isDatePicker=!this.isDatePicker,this._toggleDateTimePicker()},this.dom.menu.now.onclick=()=>{this._now(),this._submit()},this.dom.menu.submit.onclick=()=>{this.dispose(),this._submit()},this.dom.time.hour.onclick=e=>{if(!this.pickDate)return;const n=e.target.dataset.id;!n||(this.pickDate.setHours(Number(n)),this._setTimePick(!1))},this.dom.time.minute.onclick=e=>{if(!this.pickDate)return;const n=e.target.dataset.id;!n||(this.pickDate.setMinutes(Number(n)),this._setTimePick(!1))},this.dom.time.second.onclick=e=>{if(!this.pickDate)return;const n=e.target.dataset.id;!n||(this.pickDate.setSeconds(Number(n)),this._setTimePick(!1))}}_setPosition(){if(!this.renderOptions)return;const{position:{coordinate:{leftTop:[e,t]},lineHeight:n,pageNo:i}}=this.renderOptions,o=this.draw.getHeight(),a=this.draw.getPageGap(),l=(i!=null?i:this.draw.getPageNo())*(o+a);this.dom.container.style.left=`${e}px`,this.dom.container.style.top=`${t+l+n}px`}isInvalidDate(e){return e.toDateString()==="Invalid Date"}_setValue(){var t;const e=(t=this.renderOptions)==null?void 0:t.value;if(e){const n=new Date(e);this.now=this.isInvalidDate(n)?new Date:n}else this.now=new Date;this.pickDate=new Date(this.now)}_getLang(){const e=this.draw.getI18n(),t=e.t.bind(e);return{now:t("datePicker.now"),confirm:t("datePicker.confirm"),return:t("datePicker.return"),timeSelect:t("datePicker.timeSelect"),weeks:{sun:t("datePicker.weeks.sun"),mon:t("datePicker.weeks.mon"),tue:t("datePicker.weeks.tue"),wed:t("datePicker.weeks.wed"),thu:t("datePicker.weeks.thu"),fri:t("datePicker.weeks.fri"),sat:t("datePicker.weeks.sat")},year:t("datePicker.year"),month:t("datePicker.month"),hour:t("datePicker.hour"),minute:t("datePicker.minute"),second:t("datePicker.second")}}_setLangChange(){this.dom.menu.time.innerText=this.lang.timeSelect,this.dom.menu.now.innerText=this.lang.now,this.dom.menu.submit.innerText=this.lang.confirm;const{weeks:{sun:e,mon:t,tue:n,wed:i,thu:o,fri:a,sat:s}}=this.lang,l=[e,t,n,i,o,a,s];this.dom.datePickerWeek.childNodes.forEach((d,f)=>{const p=d;p.innerText=l[f]});const c=this.dom.time.hour.previousElementSibling;c.innerText=this.lang.hour;const u=this.dom.time.minute.previousElementSibling;u.innerText=this.lang.minute;const h=this.dom.time.second.previousElementSibling;h.innerText=this.lang.second}_update(){const e=new Date,t=e.getFullYear(),n=e.getMonth()+1,i=e.getDate();let o=null,a=null,s=null;this.pickDate&&(o=this.pickDate.getFullYear(),a=this.pickDate.getMonth()+1,s=this.pickDate.getDate());const l=this.now.getFullYear(),c=this.now.getMonth()+1;this.dom.title.now.innerText=`${l}${this.lang.year} ${String(c).padStart(2,"0")}${this.lang.month}`;const h=new Date(l,c,0).getDate();let d=new Date(l,c-1,1).getDay();d===0&&(d=7);const f=new Date(l,c-1,0).getDate();this.dom.day.innerHTML="";const p=f-d+1;for(let v=p;v<=f;v++){const R=document.createElement("div");R.classList.add("disable"),R.innerText=`${v}`,R.onclick=()=>{const m=c-2;this.now=new Date(l,m,v),this._setDatePick(l,m,v)},this.dom.day.append(R)}for(let v=1;v<=h;v++){const R=document.createElement("div");t===l&&n===c&&i===v&&R.classList.add("active"),this.pickDate&&o===l&&a===c&&s===v&&R.classList.add("select"),R.innerText=`${v}`,R.onclick=m=>{const x=c-1;this.now=new Date(l,x,v),this._setDatePick(l,x,v),m.stopPropagation()},this.dom.day.append(R)}const g=6*7-d-h;for(let v=1;v<=g;v++){const R=document.createElement("div");R.classList.add("disable"),R.innerText=`${v}`,R.onclick=()=>{this.now=new Date(l,c,v),this._setDatePick(l,c,v)},this.dom.day.append(R)}}_toggleDateTimePicker(){this.isDatePicker?(this.dom.dateWrap.classList.add("active"),this.dom.timeWrap.classList.remove("active"),this.dom.menu.time.innerText=this.lang.timeSelect):(this.dom.dateWrap.classList.remove("active"),this.dom.timeWrap.classList.add("active"),this.dom.menu.time.innerText=this.lang.return,this._setTimePick())}_setDatePick(e,t,n){var i,o,a;this.now=new Date(e,t,n),(i=this.pickDate)==null||i.setFullYear(e),(o=this.pickDate)==null||o.setMonth(t),(a=this.pickDate)==null||a.setDate(n),this._update()}_setTimePick(e=!0){var u,h,d;const t=((u=this.pickDate)==null?void 0:u.getHours())||0,n=((h=this.pickDate)==null?void 0:h.getMinutes())||0,i=((d=this.pickDate)==null?void 0:d.getSeconds())||0,{hour:o,minute:a,second:s}=this.dom.time;[o,a,s].forEach(f=>{f.querySelectorAll("li").forEach(p=>p.classList.remove("active"))}),[[o,t],[a,n],[s,i]].forEach(([f,p])=>{const g=f.querySelector(`[data-id='${p}']`);g.classList.add("active"),e&&this._scrollIntoView(f,g)})}_scrollIntoView(e,t){if(!t){e.scrollTop=0;return}const n=[];let i=t.offsetParent;for(;i&&e!==i&&e.contains(i);)n.push(i),i=i.offsetParent;const o=t.offsetTop+n.reduce((c,u)=>c+u.offsetTop,0),a=o+t.offsetHeight,s=e.scrollTop,l=s+e.clientHeight;ol&&(e.scrollTop=a-e.clientHeight)}_preMonth(){this.now.setMonth(this.now.getMonth()-1),this._update()}_nextMonth(){this.now.setMonth(this.now.getMonth()+1),this._update()}_preYear(){this.now.setFullYear(this.now.getFullYear()-1),this._update()}_nextYear(){this.now.setFullYear(this.now.getFullYear()+1),this._update()}_now(){this.pickDate=new Date,this.dispose()}_toggleVisible(e){e?this.dom.container.classList.add("active"):this.dom.container.classList.remove("active")}_submit(){var e;if(this.options.onSubmit&&this.pickDate){const t=(e=this.renderOptions)==null?void 0:e.dateFormat,n=this.formatDate(this.pickDate,t);this.options.onSubmit(n)}}formatDate(e,t="yyyy-MM-dd hh:mm:ss"){let n=t;const i={"y+":e.getFullYear().toString(),"M+":(e.getMonth()+1).toString(),"d+":e.getDate().toString(),"h+":e.getHours().toString(),"m+":e.getMinutes().toString(),"s+":e.getSeconds().toString()};for(const o in i){const a=new RegExp("("+o+")").exec(t),s=o;a&&(n=n.replace(a[1],a[1].length===1?i[s]:i[s].padStart(a[1].length,"0")))}return n}render(e){this.renderOptions=e,this.lang=this._getLang(),this._setLangChange(),this._setValue(),this._update(),this._setPosition(),this.isDatePicker=!0,this._toggleDateTimePicker(),this._toggleVisible(!0)}dispose(){this._toggleVisible(!1)}destroy(){this.dom.container.remove()}}class ro{constructor(e,t){const n=t.getDraw();this.draw=n,this.element=e,this.control=t,this.isPopup=!1,this.datePicker=null}setElement(e){this.element=e}getElement(){return this.element}getIsPopup(){return this.isPopup}getValueRange(e={}){const t=e.elementList||this.control.getElementList(),{startIndex:n}=e.range||this.control.getRange(),i=t[n];let o=n;for(;o>0;){const s=t[o];if(s.controlId!==i.controlId||s.controlComponent===ye.PREFIX)break;o--}let a=n+1;for(;al.value).join("")||"",o=(s=this.element.control)==null?void 0:s.dateFormat;this.datePicker.render({value:i,position:e,dateFormat:o}),this.isPopup=!0}destroy(){var e;!this.isPopup||((e=this.datePicker)==null||e.destroy(),this.isPopup=!1)}_setDate(e){e?this.setSelect(e):this.clearSelect(),this.destroy()}}class YR{constructor(e){this.controlBorder=new VR(e),this.draw=e,this.range=e.getRange(),this.listener=e.getListener(),this.eventBus=e.getEventBus(),this.controlSearch=new WR(this),this.options=e.getOptions(),this.controlOptions=this.options.control,this.activeControl=null}setHighlightList(e){this.controlSearch.setHighlightList(e)}computeHighlightList(){this.controlSearch.getHighlightList().length&&this.controlSearch.computeHighlightList()}renderHighlightList(e,t){this.controlSearch.getHighlightMatchResult().length&&this.controlSearch.renderHighlightList(e,t)}getDraw(){return this.draw}filterAssistElement(e){return e.filter(t=>{var n;if(t.type===ae.TABLE){const i=t.trList;for(let o=0;oi.controlId))return!1;let t=0,n=0;for(let i=0;i{var u;const a=this.listener.controlChange,s=this.eventBus.isSubscribe("controlChange");if(!a&&!s)return;let l;const c=(u=this.activeControl)==null?void 0:u.getValue();c&&c.length?l=bt(c)[0].control:l=_i(gt(i)).control,a&&a(l),s&&this.eventBus.emit("controlChange",l)})}destroyControl(){this.activeControl&&((this.activeControl instanceof to||this.activeControl instanceof ro)&&this.activeControl.destroy(),this.activeControl=null,La(()=>{const e=this.listener.controlChange,t=this.eventBus.isSubscribe("controlChange");!e&&!t||(e&&e(null),t&&this.eventBus.emit("controlChange",null))}))}repaintControl(e={}){const{curIndex:t,isCompute:n=!0,isSubmitHistory:i=!0}=e;t===void 0?(this.range.clearRange(),this.draw.render({isCompute:n,isSubmitHistory:i,isSetCursor:!1})):(this.range.setRange(t,t),this.draw.render({curIndex:t,isCompute:n,isSubmitHistory:i}))}reAwakeControl(){if(!this.activeControl)return;const e=this.getElementList(),t=this.getRange(),n=e[t.startIndex];this.activeControl.setElement(n),(this.activeControl instanceof ro||this.activeControl instanceof to)&&this.activeControl.getIsPopup()&&(this.activeControl.destroy(),this.activeControl.awake())}moveCursor(e){const{index:t,trIndex:n,tdIndex:i,tdValueIndex:o}=e;let a=this.draw.getOriginalElementList(),s;const l=e.isTable?o:t;if(e.isTable?(a=a[t].trList[n].tdList[i].value,s=a[o]):s=a[t],s.controlComponent===ye.VALUE)return{newIndex:l,newElement:s};if(s.controlComponent===ye.POSTFIX){let c=l+1;for(;c0;){const u=a[c];if(u.controlId!==s.controlId||u.controlComponent===ye.PREFIX)return{newIndex:c,newElement:a[c]};c--}}return{newIndex:l,newElement:s}}removeControl(e,t={}){const n=t.elementList||this.getElementList(),i=n[e],{deletable:o=!0}=i.control;if(!o)return null;let a=-1,s=-1,l=e;for(;l>0;){if(n[l].controlId!==i.controlId){a=l;break}l--}let c=e+1;for(;c{var c;let l=0;for(;l{var m;return(m=f==null?void 0:f.find(x=>x.code===R))==null?void 0:m.value}).filter(Boolean).join("");n.push({...u.control,zone:s,value:d||null,innerText:v||null})}l=p}},o=[{zone:Ke.HEADER,elementList:this.draw.getHeaderElementList()},{zone:Ke.MAIN,elementList:this.draw.getOriginalMainElementList()},{zone:Ke.FOOTER,elementList:this.draw.getFooterElementList()}];for(const{zone:a,elementList:s}of o)i(s,a);return n}setValueByConceptId(e){if(this.draw.isReadonly())return;let n=!1;const{conceptId:i,value:o}=e,a=l=>{var u;let c=0;for(;c{var c;let l=0;for(;l0;u--){const h=l[u];if(h.type===ae.TABLE){const f=h.trList||[];for(let p=f.length-1;p>=0;p--){const g=f[p],v=g.tdList;for(let R=v.length-1;R>=0;R--){const m=v[R],x=i(m.value,m.value.length-1);if(x)return{positionContext:{isTable:!0,index:u,trIndex:p,tdIndex:R,tdId:m.id,trId:g.id,tableId:h.id},nextIndex:x.nextIndex}}}}if(!h.controlId||h.controlId===n.controlId)continue;let d=u;for(;d>0;){const f=l[d];if(f.controlComponent===ye.VALUE||f.controlComponent===ye.PREFIX)break;d--}return{positionContext:{isTable:!1},nextIndex:d}}return null}const{startIndex:o}=this.range.getRange(),a=this.getElementList(),s=i(a,o);if(s)return{positionContext:t.isTable?t:s.positionContext,nextIndex:s.nextIndex};if(n.tableId){const l=this.draw.getOriginalElementList(),{index:c,trIndex:u,tdIndex:h}=t,d=l[c].trList;for(let p=u;p>=0;p--){const g=d[p],v=g.tdList;for(let R=v.length-1;R>=0;R--){if(u===p&&R>=h)continue;const m=v[R],x=i(m.value,m.value.length-1);if(x)return{positionContext:{isTable:!0,index:t.index,trIndex:p,tdIndex:R,tdId:m.id,trId:g.id,tableId:n.tableId},nextIndex:x.nextIndex}}}const f=i(l,c-1);if(f)return{positionContext:{isTable:!1},nextIndex:f.nextIndex}}return null}getNextControlContext(){if(!this.activeControl)return null;const t=this.draw.getPosition().getPositionContext();if(!t)return null;const n=this.activeControl.getElement();function i(l,c){for(let u=c;u{this.wordCountWorker.onmessage=i=>{e(i.data)},this.wordCountWorker.onerror=i=>{t(i)};const n=this.draw.getOriginalMainElementList();this.wordCountWorker.postMessage(n)})}getCatalog(){return new Promise((e,t)=>{this.catalogWorker.onmessage=i=>{e(i.data)},this.catalogWorker.onerror=i=>{t(i)};const n=this.draw.getOriginalMainElementList();this.catalogWorker.postMessage(n)})}getGroupIds(){return new Promise((e,t)=>{this.groupWorker.onmessage=i=>{e(i.data)},this.groupWorker.onerror=i=>{t(i)};const n=this.draw.getOriginalMainElementList();this.groupWorker.postMessage(n)})}}class GR{constructor(e){this._keydown=()=>{this.resizerSelection.style.display==="block"&&(this.clearResizer(),document.removeEventListener("keydown",this._keydown))},this.container=e.getContainer(),this.canvas=e.getPage(),this.draw=e,this.options=e.getOptions(),this.curElement=null,this.curElementSrc="",this.previewerDrawOption={},this.curPosition=null;const{resizerSelection:t,resizerHandleList:n,resizerImageContainer:i,resizerImage:o,resizerSize:a}=this._createResizerDom();this.resizerSelection=t,this.resizerHandleList=n,this.resizerImageContainer=i,this.resizerImage=o,this.resizerSize=a,this.width=0,this.height=0,this.mousedownX=0,this.mousedownY=0,this.curHandleIndex=0,this.previewerContainer=null,this.previewerImage=null}_getElementPosition(e,t=null){var c;let n=0,i=0;const o=this.draw.getHeight(),a=this.draw.getPageGap(),l=((c=t==null?void 0:t.pageNo)!=null?c:this.draw.getPageNo())*(o+a);if(e.imgFloatPosition)n=e.imgFloatPosition.x,i=e.imgFloatPosition.y+l;else if(t){const{coordinate:{leftTop:[u,h]},ascent:d}=t;n=u,i=h+l+d}return{x:n,y:i}}_createResizerDom(){const e=document.createElement("div");e.classList.add(`${Fe}-resizer-selection`),e.style.display="none",e.style.borderColor=this.options.resizerColor;const t=[];for(let s=0;s<8;s++){const l=document.createElement("div");l.style.background=this.options.resizerColor,l.classList.add("resizer-handle"),l.classList.add(`handle-${s}`),l.setAttribute("data-index",String(s)),l.onmousedown=this._mousedown.bind(this),e.append(l),t.push(l)}this.container.append(e);const n=document.createElement("div");n.classList.add(`${Fe}-resizer-size-view`);const i=document.createElement("span");n.append(i),e.append(n);const o=document.createElement("div");o.classList.add(`${Fe}-resizer-image`),o.style.display="none";const a=document.createElement("img");return o.append(a),this.container.append(o),{resizerSelection:e,resizerHandleList:t,resizerImageContainer:o,resizerImage:a,resizerSize:i}}_mousedown(e){if(this.canvas=this.draw.getPage(),!this.curElement)return;const{scale:t}=this.options;this.mousedownX=e.x,this.mousedownY=e.y;const n=e.target;this.curHandleIndex=Number(n.dataset.index);const i=window.getComputedStyle(n).cursor;document.body.style.cursor=i,this.canvas.style.cursor=i,this.resizerImage.src=this.curElementSrc,this.resizerImageContainer.style.display="block";const{x:o,y:a}=this._getElementPosition(this.curElement,this.curPosition);this.resizerImageContainer.style.left=`${o}px`,this.resizerImageContainer.style.top=`${a}px`,this.resizerImage.style.width=`${this.curElement.width*t}px`,this.resizerImage.style.height=`${this.curElement.height*t}px`;const s=this._mousemove.bind(this);document.addEventListener("mousemove",s),document.addEventListener("mouseup",()=>{var l;this.curElement&&(this.curElement.width=this.width,this.curElement.height=this.height,this.draw.render({isSetCursor:!0,curIndex:(l=this.curPosition)==null?void 0:l.index})),this.resizerImageContainer.style.display="none",document.removeEventListener("mousemove",s),document.body.style.cursor="",this.canvas.style.cursor="text"},{once:!0}),e.preventDefault()}_mousemove(e){if(!this.curElement)return;const{scale:t}=this.options;let n=0,i=0;switch(this.curHandleIndex){case 0:{const c=this.mousedownX-e.x,u=this.mousedownY-e.y;n=Math.cbrt(c**3+u**3),i=this.curElement.height*n/this.curElement.width}break;case 1:i=this.mousedownY-e.y;break;case 2:{const c=e.x-this.mousedownX,u=this.mousedownY-e.y;n=Math.cbrt(c**3+u**3),i=this.curElement.height*n/this.curElement.width}break;case 4:{const c=e.x-this.mousedownX,u=e.y-this.mousedownY;n=Math.cbrt(c**3+u**3),i=this.curElement.height*n/this.curElement.width}break;case 3:n=e.x-this.mousedownX;break;case 5:i=e.y-this.mousedownY;break;case 6:{const c=this.mousedownX-e.x,u=e.y-this.mousedownY;n=Math.cbrt(c**3+u**3),i=this.curElement.height*n/this.curElement.width}break;case 7:n=this.mousedownX-e.x;break}const o=this.curElement.width+n/t,a=this.curElement.height+i/t;if(o<=0||a<=0)return;this.width=o,this.height=a;const s=o*t,l=a*t;this.resizerImage.style.width=`${s}px`,this.resizerImage.style.height=`${l}px`,this._updateResizerRect(s,l),this._updateResizerSizeView(s,l),e.preventDefault()}_drawPreviewer(){const e=document.createElement("div");e.classList.add(`${Fe}-image-previewer`);const t=document.createElement("i");t.classList.add("image-close"),t.onclick=()=>{this._clearPreviewer()},e.append(t);const n=document.createElement("div");n.classList.add(`${Fe}-image-container`);const i=document.createElement("img");i.src=this.curElementSrc,i.draggable=!1,n.append(i),this.previewerImage=i,e.append(n);let o=0,a=0,s=1,l=0;const c=document.createElement("div");c.classList.add(`${Fe}-image-menu`);const u=document.createElement("i");u.classList.add("zoom-in"),u.onclick=()=>{s+=.1,this._setPreviewerTransform(s,l,o,a)},c.append(u);const h=document.createElement("i");h.onclick=()=>{s-.1<=.1||(s-=.1,this._setPreviewerTransform(s,l,o,a))},h.classList.add("zoom-out"),c.append(h);const d=document.createElement("i");d.classList.add("rotate"),d.onclick=()=>{l+=1,this._setPreviewerTransform(s,l,o,a)},c.append(d);const f=document.createElement("i");f.classList.add("original-size"),f.onclick=()=>{o=0,a=0,s=1,l=0,this._setPreviewerTransform(s,l,o,a)},c.append(f);const p=document.createElement("i");p.classList.add("image-download"),p.onclick=()=>{var x;const{mime:m}=this.previewerDrawOption;Md(i.src,`${(x=this.curElement)==null?void 0:x.id}.${m||"png"}`)},c.append(p),e.append(c),this.previewerContainer=e,document.body.append(e);let g=0,v=0,R=!1;i.onmousedown=m=>{R=!0,g=m.x,v=m.y,e.style.cursor="move"},e.onmousemove=m=>{!R||(o+=m.x-g,a+=m.y-v,g=m.x,v=m.y,this._setPreviewerTransform(s,l,o,a))},e.onmouseup=()=>{R=!1,e.style.cursor="auto"},e.onwheel=m=>{if(m.preventDefault(),m.deltaY<0)s+=.1;else{if(s-.1<=.1)return;s-=.1}this._setPreviewerTransform(s,l,o,a)}}_setPreviewerTransform(e,t,n,i){!this.previewerImage||(this.previewerImage.style.left=`${n}px`,this.previewerImage.style.top=`${i}px`,this.previewerImage.style.transform=`scale(${e}) rotate(${t*90}deg)`)}_clearPreviewer(){var e;(e=this.previewerContainer)==null||e.remove(),this.previewerContainer=null,document.body.style.overflow="auto"}_updateResizerRect(e,t){const n=this.options.resizerSize;this.resizerSelection.style.width=`${e}px`,this.resizerSelection.style.height=`${t}px`;for(let i=0;i<8;i++){const o=i===0||i===6||i===7?-n:i===1||i===5?e/2:e-n,a=i===0||i===1||i===2?-n:i===3||i===7?t/2-n:t-n;this.resizerHandleList[i].style.left=`${o}px`,this.resizerHandleList[i].style.top=`${a}px`}}_updateResizerSizeView(e,t){this.resizerSize.innerText=`${Math.round(e)} \xD7 ${Math.round(t)}`}render(){this._drawPreviewer(),document.body.style.overflow="hidden"}drawResizer(e,t=null,n={}){this.previewerDrawOption=n,this.curElementSrc=e[n.srcKey||"value"]||"",this.updateResizer(e,t),document.addEventListener("keydown",this._keydown)}updateResizer(e,t=null){const{scale:n}=this.options,i=e.width*n,o=e.height*n;this._updateResizerSizeView(i,o);const{x:a,y:s}=this._getElementPosition(e,t);this.resizerSelection.style.left=`${a}px`,this.resizerSelection.style.top=`${s}px`,this._updateResizerRect(i,o),this.resizerSelection.style.display="block",this.curElement=e,this.curPosition=t,this.width=i,this.height=o}clearResizer(){this.resizerSelection.style.display="none",document.removeEventListener("keydown",this._keydown)}}class JR{constructor(e){this.draw=e,this.range=e.getRange(),this.datePicker=new $d(e,{onSubmit:this._setValue.bind(this)})}_setValue(e){if(!e)return;const t=this.getDateElementRange();if(!t)return;const[n,i]=t,o=this.draw.getElementList(),a=o[n+1];this.draw.spliceElementList(o,n+1,i-n),this.range.setRange(n,n);const s={type:ae.DATE,value:"",dateFormat:a.dateFormat,valueList:[{value:e}]};ar(o,[s],n),this.draw.insertElementList([s])}getDateElementRange(){let e=-1,t=-1;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return null;const o=this.draw.getElementList(),a=o[n];if(a.type!==ae.DATE)return null;let s=n;for(;s>0;){if(o[s].dateId!==a.dateId){e=s;break}s--}let l=n+1;for(;la.value).join(""):"";this.datePicker.render({value:o,position:t,dateFormat:e.dateFormat})}}var Io=(r=>(r.IFRAME="iframe",r.VIDEO="video",r))(Io||{});const t0=class{constructor(r){this.element=r}_defineIframeProperties(r){Object.defineProperties(r,{parent:{get:()=>null},__POWERED_BY_CANVAS_EDITOR__:{get:()=>!0}})}render(r){var n,i;const e=this.element.block,t=document.createElement("iframe");t.setAttribute("data-id",this.element.id),t.sandbox.add(...t0.sandbox),t.style.border="none",t.style.width="100%",t.style.height="100%",(n=e.iframeBlock)!=null&&n.src?t.src=e.iframeBlock.src:(i=e.iframeBlock)!=null&&i.srcdoc&&(t.srcdoc=e.iframeBlock.srcdoc),r.append(t),this._defineIframeProperties(t.contentWindow)}};let r0=t0;r0.sandbox=["allow-scripts","allow-same-origin"];class zR{constructor(e){this.element=e}render(e){var i;const t=this.element.block,n=document.createElement("video");n.style.width="100%",n.style.height="100%",n.style.objectFit="contain",n.src=((i=t.videoBlock)==null?void 0:i.src)||"",n.controls=!0,n.crossOrigin="anonymous",e.append(n)}}class $R{constructor(e,t){this.draw=e.getDraw(),this.blockContainer=e.getBlockContainer(),this.element=t,this.block=null,this.blockItem=this._createBlockItem(),this.blockContainer.append(this.blockItem)}getBlockElement(){return this.element}_createBlockItem(){const e=document.createElement("div");return e.classList.add(`${Fe}-block-item`),e}render(){const e=this.element.block;e.type===Io.IFRAME?(this.block=new r0(this.element),this.block.render(this.blockItem)):e.type===Io.VIDEO&&(this.block=new zR(this.element),this.block.render(this.blockItem))}setClientRects(e,t,n){const i=this.draw.getHeight(),o=this.draw.getPageGap(),a=e*(i+o),{metrics:s}=this.element;this.blockItem.style.width=`${s.width}px`,this.blockItem.style.height=`${s.height}px`,this.blockItem.style.left=`${t}px`,this.blockItem.style.top=`${a+n}px`}remove(){this.blockItem.remove()}}class jR{constructor(e){this.draw=e,this.container=e.getContainer(),this.blockMap=new Map,this.blockContainer=this._createBlockContainer(),this.container.append(this.blockContainer)}_createBlockContainer(){const e=document.createElement("div");return e.classList.add(`${Fe}-block-container`),e}getDraw(){return this.draw}getBlockContainer(){return this.blockContainer}render(e,t,n,i){const o=t.id,a=this.blockMap.get(o);if(a)a.setClientRects(e,n,i);else{const s=new $R(this,t);s.render(),s.setClientRects(e,n,i),this.blockMap.set(o,s)}}clear(){if(!this.blockMap.size)return;const e=this.draw.getElementList(),t=[];for(let n=0;n{const i=n.getBlockElement().id;t.includes(i)||(n.remove(),this.blockMap.delete(i))})}}const qR={global:{cut:"\u526A\u5207",copy:"\u590D\u5236",paste:"\u7C98\u8D34",selectAll:"\u5168\u9009",print:"\u6253\u5370"},control:{delete:"\u5220\u9664\u63A7\u4EF6"},hyperlink:{delete:"\u5220\u9664\u94FE\u63A5",cancel:"\u53D6\u6D88\u94FE\u63A5",edit:"\u7F16\u8F91\u94FE\u63A5"},image:{change:"\u66F4\u6539\u56FE\u7247",saveAs:"\u53E6\u5B58\u4E3A\u56FE\u7247",textWrap:"\u6587\u5B57\u73AF\u7ED5",textWrapType:{embed:"\u5D4C\u5165\u578B",upDown:"\u4E0A\u4E0B\u578B\u73AF\u7ED5",floatTop:"\u6D6E\u4E8E\u6587\u5B57\u4E0A\u65B9",floatBottom:"\u886C\u4E8E\u6587\u5B57\u4E0B\u65B9"}},table:{insertRowCol:"\u63D2\u5165\u884C\u5217",insertTopRow:"\u4E0A\u65B9\u63D2\u51651\u884C",insertBottomRow:"\u4E0B\u65B9\u63D2\u51651\u884C",insertLeftCol:"\u5DE6\u4FA7\u63D2\u51651\u5217",insertRightCol:"\u53F3\u4FA7\u63D2\u51651\u5217",deleteRowCol:"\u5220\u9664\u884C\u5217",deleteRow:"\u5220\u96641\u884C",deleteCol:"\u5220\u96641\u5217",deleteTable:"\u5220\u9664\u6574\u4E2A\u8868\u683C",mergeCell:"\u5408\u5E76\u5355\u5143\u683C",mergeCancelCell:"\u53D6\u6D88\u5408\u5E76",verticalAlign:"\u5782\u76F4\u5BF9\u9F50",verticalAlignTop:"\u9876\u7AEF\u5BF9\u9F50",verticalAlignMiddle:"\u5782\u76F4\u5C45\u4E2D",verticalAlignBottom:"\u5E95\u7AEF\u5BF9\u9F50",border:"\u8868\u683C\u8FB9\u6846",borderAll:"\u6240\u6709\u6846\u7EBF",borderEmpty:"\u65E0\u6846\u7EBF",borderExternal:"\u5916\u4FA7\u6846\u7EBF",borderTd:"\u5355\u5143\u683C\u8FB9\u6846",borderTdTop:"\u4E0A\u8FB9\u6846",borderTdRight:"\u53F3\u8FB9\u6846",borderTdBottom:"\u4E0B\u8FB9\u6846",borderTdLeft:"\u5DE6\u8FB9\u6846",borderTdForward:"\u6B63\u659C\u7EBF",borderTdBack:"\u53CD\u659C\u7EBF"}},em={now:"\u6B64\u523B",confirm:"\u786E\u5B9A",return:"\u8FD4\u56DE\u65E5\u671F",timeSelect:"\u65F6\u95F4\u9009\u62E9",weeks:{sun:"\u65E5",mon:"\u4E00",tue:"\u4E8C",wed:"\u4E09",thu:"\u56DB",fri:"\u4E94",sat:"\u516D"},year:"\u5E74",month:"\u6708",hour:"\u65F6",minute:"\u5206",second:"\u79D2"},tm={header:"\u9875\u7709",footer:"\u9875\u811A"},rm={displayName:"\u5206\u9875\u7B26"},nm={headerTip:"\u53CC\u51FB\u7F16\u8F91\u9875\u7709",footerTip:"\u53CC\u51FB\u7F16\u8F91\u9875\u811A"};var Ss={contextmenu:qR,datePicker:em,frame:tm,pageBreak:rm,zone:nm};const im={global:{cut:"Cut",copy:"Copy",paste:"Paste",selectAll:"Select all",print:"Print"},control:{delete:"Delete control"},hyperlink:{delete:"Delete hyperlink",cancel:"Cancel hyperlink",edit:"Edit hyperlink"},image:{change:"Change image",saveAs:"Save as image",textWrap:"Text wrap",textWrapType:{embed:"Embed",upDown:"Up down",floatTop:"Float above text",floatBottom:"Float below text"}},table:{insertRowCol:"Insert row col",insertTopRow:"Insert top 1 row",insertBottomRow:"Insert bottom 1 row",insertLeftCol:"Insert left 1 col",insertRightCol:"Insert right 1 col",deleteRowCol:"Delete row col",deleteRow:"Delete 1 row",deleteCol:"Delete 1 col",deleteTable:"Delete table",mergeCell:"Merge cell",mergeCancelCell:"Cancel merge cell",verticalAlign:"Vertical align",verticalAlignTop:"Top",verticalAlignMiddle:"Middle",verticalAlignBottom:"Bottom",border:"Table border",borderAll:"All",borderEmpty:"Empty",borderExternal:"External",borderTd:"Table cell border",borderTdTop:"Top",borderTdRight:"Right",borderTdBottom:"Bottom",borderTdLeft:"Left",borderTdForward:"Forward",borderTdBack:"Back"}},om={now:"Now",confirm:"Confirm",return:"Return",timeSelect:"Time select",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},year:" ",month:" ",hour:"Hour",minute:"Minute",second:"Second"},am={header:"Header",footer:"Footer"},sm={displayName:"Page Break"},lm={headerTip:"Double click to edit header",footerTip:"Double click to edit footer"};var cm={contextmenu:im,datePicker:om,frame:am,pageBreak:sm,zone:lm};class um{constructor(){this.langMap=new Map([["zhCN",Ss],["en",cm]]),this.currentLocale="zhCN"}registerLangMap(e,t){const n=this.langMap.get(e);this.langMap.set(e,Ld(n||Ss,t))}getLocale(){return this.currentLocale}setLocale(e){this.currentLocale=e}getLang(){return this.langMap.get(this.currentLocale)||Ss}t(e){const t=e.split(".");let n="",i=this.getLang();for(let o=0;o{if(!(this.isDisableMouseMove||!this.draw.getIsPagingMode())&&!!t.offsetY)if(t.target instanceof HTMLCanvasElement){const n=this.zone.getZoneByY(t.offsetY);if(!e.includes(n)){this._updateZoneTip(!1);return}this.currentMoveZone=n,this._updateZoneTip(this.zone.getZone()===Ke.MAIN&&(n===Ke.HEADER||n===Ke.FOOTER),t.x,t.y)}else this._updateZoneTip(!1)},250)),this.pageContainer.addEventListener("mouseenter",()=>{this.isDisableMouseMove=!1}),this.pageContainer.addEventListener("mouseleave",()=>{this.isDisableMouseMove=!0,this._updateZoneTip(!1)})}_drawZoneTip(){const e=document.createElement("div");e.classList.add(`${Fe}-zone-tip`);const t=document.createElement("span");return e.append(t),this.container.append(e),{tipContainer:e,tipContent:t}}_updateZoneTip(e,t,n){e?(this.tipContainer.classList.add("show"),this.tipContainer.style.left=`${t}px`,this.tipContainer.style.top=`${n}px`,this.tipContent.innerText=this.i18n.t(`zone.${this.currentMoveZone===Ke.HEADER?"headerTip":"footerTip"}`)):this.tipContainer.classList.remove("show")}}class dm{constructor(e){this.INDICATOR_PADDING=2,this.INDICATOR_TITLE_TRANSLATE=[20,5],this.draw=e,this.i18n=e.getI18n(),this.options=e.getOptions(),this.container=e.getContainer(),this.currentZone=Ke.MAIN,this.indicatorContainer=null,this.options.zone.tipDisabled||new fm(e,this)}isHeaderActive(){return this.getZone()===Ke.HEADER}isMainActive(){return this.getZone()===Ke.MAIN}isFooterActive(){return this.getZone()===Ke.FOOTER}getZone(){return this.currentZone}setZone(e){this.currentZone!==e&&(this.currentZone=e,this.draw.getRange().clearRange(),this.draw.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1}),this.drawZoneIndicator(),La(()=>{const t=this.draw.getListener();t.zoneChange&&t.zoneChange(e);const n=this.draw.getEventBus();n.isSubscribe("zoneChange")&&n.emit("zoneChange",e)}))}getZoneByY(e){const t=this.draw.getHeader(),n=t.getHeaderTop()+t.getHeight(),i=this.draw.getFooter(),a=this.draw.getHeight()-(i.getFooterBottom()+i.getHeight());return ea?Ke.FOOTER:Ke.MAIN}drawZoneIndicator(){if(this._clearZoneIndicator(),!this.isHeaderActive()&&!this.isFooterActive())return;const{scale:e}=this.options,t=this.isHeaderActive(),[n,i]=this.INDICATOR_TITLE_TRANSLATE,o=this.draw.getPageList(),a=this.draw.getMargins(),s=this.draw.getInnerWidth(),l=this.draw.getHeight(),c=this.draw.getPageGap(),u=l+c;this.indicatorContainer=document.createElement("div"),this.indicatorContainer.classList.add(`${Fe}-zone-indicator`);const h=this.draw.getHeader(),d=this.draw.getFooter(),f=t?h.getHeight():d.getHeight(),p=t?h.getHeaderTop():l-d.getFooterBottom()-f;for(let g=0;ge?e:t}getRowHeight(){return this.rowList.reduce((e,t)=>e+t.height,0)}getExtraHeight(){const e=this.draw.getMargins(),t=this.getHeight(),i=this.getFooterBottom()+t-e[2];return i<=0?0:i}render(e,t){e.globalAlpha=1;const n=this.draw.getInnerWidth(),i=this.getMaxHeight(),o=[];let a=0;for(let s=0;si)break;o.push(l),a+=l.height}this.draw.drawRow(e,{elementList:this.elementList,positionList:this.positionList,rowList:o,pageNo:t,startIndex:0,innerWidth:n,zone:Ke.FOOTER})}}class gm{constructor(e){this.UN_COUNT_STYLE_WIDTH=20,this.MEASURE_BASE_TEXT="0",this.LIST_GAP=10,this.draw=e,this.range=e.getRange(),this.options=e.getOptions()}setList(e,t){if(this.draw.isReadonly())return;const{startIndex:i,endIndex:o}=this.range.getRange();if(!~i&&!~o)return;const a=this.range.getRangeParagraphElementList();if(!a||!a.length)return;if(a.find(h=>h.listType===e&&h.listStyle===t)||!e){this.unsetList();return}const l=it();a.forEach(h=>{h.listId=l,h.listType=e,h.listStyle=t});const c=i===o,u=c?o:i;this.draw.render({curIndex:u,isSetCursor:c})}unsetList(){var c;if(this.draw.isReadonly())return;const{startIndex:t,endIndex:n}=this.range.getRange();if(!~t&&!~n)return;const i=(c=this.range.getRangeParagraphElementList())==null?void 0:c.filter(u=>u.listId);if(!i||!i.length)return;const o=this.draw.getElementList(),a=o[n];if(a.listId){let u=n+1;for(;u{delete u.listId,delete u.listType,delete u.listStyle,delete u.listWrap});const s=t===n,l=s?n:t;this.draw.render({curIndex:l,isSetCursor:s})}computeListStyle(e,t){const n=new Map;let i=0,o=t[i].listId,a=[];const s=t.length;for(;i(u.value===Ne&&(c+=1),c),0);if(!a)return 0;const s=`${this.MEASURE_BASE_TEXT.repeat(String(a).length)}${Ce.PERIOD}`,l=e.measureText(s);return Math.ceil((l.width+this.LIST_GAP)*n)}drawListStyle(e,t,n){var m;const{elementList:i,offsetX:o,listIndex:a,ascent:s}=t,l=i[0];if(l.value!==Ne||l.listWrap)return;let c=0;const{defaultTabWidth:u,scale:h,defaultFont:d,defaultSize:f}=this.options;for(let x=1;x{Array.isArray(n.groupIds)||(n.groupIds=[]),n.groupIds.push(t)}),this.draw.render({isSetCursor:!1,isCompute:!1}),t}getElementListByGroupId(e,t){var i,o;const n=[];for(let a=0;al===e);a.splice(s,1),a.length||delete o.groupIds}this.draw.render({isSetCursor:!1,isCompute:!1})}}getContextByGroupId(e,t){var n,i;for(let o=0;o{const{x:d,y:f,width:p,height:g}=u;i!=null&&i.includes(h)?(e.globalAlpha=s,e.fillStyle=l):(e.globalAlpha=a,e.fillStyle=o),e.fillRect(d,f,p,g)}),e.restore(),this.clearFillInfo()}}class vm{constructor(e,t,n,i,o,a){this.container=this._wrapContainer(e),this.pageList=[],this.ctxList=[],this.pageNo=0,this.pagePixelRatio=null,this.mode=t.mode,this.options=t,this.elementList=n.main,this.listener=i,this.eventBus=o,this.override=a,this._formatContainer(),this.pageContainer=this._createPageContainer(),this._createPage(0),this.i18n=new um,this.historyManager=new RR(this),this.position=new mR(this),this.zone=new dm(this),this.range=new vR(this),this.margin=new SR(this),this.background=new yR(this),this.search=new xR(this),this.group=new mm(this),this.underline=new OR(this),this.strikeout=new bR(this),this.highlight=new wR(this),this.previewer=new GR(this),this.imageParticle=new Ad(this),this.laTexParticle=new Ud(this),this.textParticle=new TR(this),this.tableParticle=new NR(this),this.tableTool=new MR(this),this.pageNumber=new ER(this),this.waterMark=new UR(this),this.placeholder=new Rm(this),this.header=new FR(this,n.header),this.footer=new pm(this,n.footer),this.hyperlinkParticle=new LR(this),this.dateParticle=new JR(this),this.separatorParticle=new DR(this),this.pageBreakParticle=new XR(this),this.superscriptParticle=new CR,this.subscriptParticle=new AR,this.checkboxParticle=new kR(this),this.radioParticle=new ZR(this),this.blockParticle=new jR(this),this.listParticle=new gm(this),this.lineBreakParticle=new Ai(this),this.control=new YR(this),this.scrollObserver=new _R(this),this.selectionObserver=new IR(this),this.imageObserver=new hm,this.canvasEvent=new pR(this),this.cursor=new Zg(this,this.canvasEvent),this.canvasEvent.register(),this.globalEvent=new gR(this,this.canvasEvent),this.globalEvent.register(),this.workerManager=new BR(this);const{letterClass:s}=t;this.LETTER_REG=new RegExp(`[${s.join("")}]`),this.WORD_LIKE_REG=new RegExp(`${s.map(l=>`[^${l}][${l}]`).join("|")}`),this.rowList=[],this.pageRowList=[],this.painterStyle=null,this.painterOptions=null,this.visiblePageNoList=[],this.intersectionPageNo=0,this.lazyRenderIntersectionObserver=null,this.printModeData=null,this.render({isInit:!0,isSetCursor:!1,isFirstRender:!0})}getLetterReg(){return this.LETTER_REG}getMode(){return this.mode}setMode(e){if(this.mode!==e){if(e===Mt.PRINT){this.printModeData={header:this.header.getElementList(),main:this.elementList,footer:this.footer.getElementList()};const t=gt(this.printModeData);["header","main","footer"].forEach(i=>{t[i]=this.control.filterAssistElement(t[i])}),this.setEditorData(t)}this.mode===Mt.PRINT&&this.printModeData&&(this.setEditorData(this.printModeData),this.printModeData=null),this.range.clearRange(),this.mode=e,this.render({isSetCursor:!1,isSubmitHistory:!1})}}isReadonly(){switch(this.mode){case Mt.READONLY:case Mt.PRINT:return!0;case Mt.FORM:return!this.control.getIsRangeWithinControl();default:return!1}}getOriginalWidth(){const{paperDirection:e,width:t,height:n}=this.options;return e===jn.VERTICAL?t:n}getOriginalHeight(){const{paperDirection:e,width:t,height:n}=this.options;return e===jn.VERTICAL?n:t}getWidth(){return Math.floor(this.getOriginalWidth()*this.options.scale)}getHeight(){return Math.floor(this.getOriginalHeight()*this.options.scale)}getMainHeight(){return this.getHeight()-this.getMainOuterHeight()}getMainOuterHeight(){const e=this.getMargins(),t=this.header.getExtraHeight(),n=this.footer.getExtraHeight();return e[0]+e[2]+t+n}getCanvasWidth(e=-1){return this.getPage(e).width}getCanvasHeight(e=-1){return this.getPage(e).height}getInnerWidth(){const e=this.getWidth(),t=this.getMargins();return e-t[1]-t[3]}getOriginalInnerWidth(){const e=this.getOriginalWidth(),t=this.getOriginalMargins();return e-t[1]-t[3]}getMargins(){return this.getOriginalMargins().map(e=>e*this.options.scale)}getOriginalMargins(){const{margins:e,paperDirection:t}=this.options;return t===jn.VERTICAL?e:[e[1],e[2],e[3],e[0]]}getPageGap(){return this.options.pageGap*this.options.scale}getOriginalPageGap(){return this.options.pageGap}getPageNumberBottom(){const{pageNumber:{bottom:e},scale:t}=this.options;return e*t}getMarginIndicatorSize(){return this.options.marginIndicatorSize*this.options.scale}getDefaultBasicRowMarginHeight(){return this.options.defaultBasicRowMarginHeight*this.options.scale}getTdPadding(){const{table:{tdPadding:e},scale:t}=this.options;return e.map(n=>n*t)}getContainer(){return this.container}getPageContainer(){return this.pageContainer}getVisiblePageNoList(){return this.visiblePageNoList}setVisiblePageNoList(e){this.visiblePageNoList=e,this.listener.visiblePageNoListChange&&this.listener.visiblePageNoListChange(this.visiblePageNoList),this.eventBus.isSubscribe("visiblePageNoListChange")&&this.eventBus.emit("visiblePageNoListChange",this.visiblePageNoList)}getIntersectionPageNo(){return this.intersectionPageNo}setIntersectionPageNo(e){this.intersectionPageNo=e,this.listener.intersectionPageNoChange&&this.listener.intersectionPageNoChange(this.intersectionPageNo),this.eventBus.isSubscribe("intersectionPageNoChange")&&this.eventBus.emit("intersectionPageNoChange",this.intersectionPageNo)}getPageNo(){return this.pageNo}setPageNo(e){this.pageNo=e}getPage(e=-1){return this.pageList[~e?e:this.pageNo]}getPageList(){return this.pageList}getPageCount(){return this.pageList.length}getTableRowList(e){const t=this.position.getPositionContext(),{index:n,trIndex:i,tdIndex:o}=t;return e[n].trList[i].tdList[o].rowList}getOriginalRowList(){const e=this.getZone();return e.isHeaderActive()?this.header.getRowList():e.isFooterActive()?this.footer.getRowList():this.rowList}getRowList(){return this.position.getPositionContext().isTable?this.getTableRowList(this.getOriginalElementList()):this.getOriginalRowList()}getPageRowList(){return this.pageRowList}getCtx(){return this.ctxList[this.pageNo]}getOptions(){return this.options}getSearch(){return this.search}getGroup(){return this.group}getHistoryManager(){return this.historyManager}getPosition(){return this.position}getZone(){return this.zone}getRange(){return this.range}getLineBreakParticle(){return this.lineBreakParticle}getHeaderElementList(){return this.header.getElementList()}getTableElementList(e){var a;const t=this.position.getPositionContext(),{index:n,trIndex:i,tdIndex:o}=t;return((a=e[n].trList)==null?void 0:a[i].tdList[o].value)||[]}getElementList(){const e=this.position.getPositionContext(),t=this.getOriginalElementList();return e.isTable?this.getTableElementList(t):t}getMainElementList(){return this.position.getPositionContext().isTable?this.getTableElementList(this.elementList):this.elementList}getOriginalElementList(){const e=this.getZone();return e.isHeaderActive()?this.getHeaderElementList():e.isFooterActive()?this.getFooterElementList():this.elementList}getOriginalMainElementList(){return this.elementList}getFooterElementList(){return this.footer.getElementList()}insertElementList(e){if(!e.length||!this.range.getIsCanInput())return;const{startIndex:t,endIndex:n}=this.range.getRange();if(!~t&&!~n)return;Nr(e,{isHandleFirstElement:!1,editorOptions:this.options});let i=-1,o=this.control.getActiveControl();if(!o&&this.control.getIsRangeWithinControl()&&(this.control.initControl(),o=this.control.getActiveControl()),o&&this.control.getIsRangeWithinControl())i=o.setValue(e,void 0,{isIgnoreDisabledRule:!0});else{const a=this.getElementList(),s=t===n,l=t+1;s||this.spliceElementList(a,l,n-t),this.spliceElementList(a,l,0,...e),i=t+e.length;const c=a[l-1];e[0].listId&&c&&!c.listId&&(c==null?void 0:c.value)===Ne&&(!c.type||c.type===ae.TEXT)&&(a.splice(t,1),i-=1)}~i&&(this.range.setRange(i,i),this.render({curIndex:i}))}appendElementList(e,t={}){if(!e.length)return;Nr(e,{isHandleFirstElement:!1,editorOptions:this.options});let n;const{isPrepend:i}=t;i?(this.elementList.splice(1,0,...e),n=e.length):(this.elementList.push(...e),n=this.elementList.length-1),this.range.setRange(n,n),this.render({curIndex:n})}spliceElementList(e,t,n,...i){var o,a,s;if(n>0){const l=t+n,c=e[l],u=c==null?void 0:c.listId;if(u&&((o=e[t-1])==null?void 0:o.listId)!==u){let h=l;for(;h=t;)((s=(a=e[h])==null?void 0:a.control)==null?void 0:s.deletable)!==!1&&e.splice(h,1),h--}}for(let l=0;ls.toDataURL());return t&&this.setPagePixelRatio(null),o&&this.setMode(i),a}getPainterStyle(){return this.painterStyle&&Object.keys(this.painterStyle).length?this.painterStyle:null}getPainterOptions(){return this.painterOptions}setPainterStyle(e,t){this.painterStyle=e,this.painterOptions=t||null,this.getPainterStyle()&&this.pageList.forEach(n=>n.style.cursor="copy")}setDefaultRange(){!this.elementList.length||setTimeout(()=>{const e=this.elementList.length-1;this.range.setRange(e,e),this.range.setRangeStyle()})}getIsPagingMode(){return this.options.pageMode===Ln.PAGING}setPageMode(e){if(!e||this.options.pageMode===e)return;if(this.options.pageMode=e,e===Ln.PAGING){const{height:i}=this.options,o=this.getPagePixelRatio(),a=this.pageList[0];a.style.height=`${i}px`,a.height=i*o,this._initPageContext(this.ctxList[0])}else this._disconnectLazyRender(),this.header.recovery(),this.footer.recovery(),this.zone.setZone(Ke.MAIN);const{startIndex:t}=this.range.getRange(),n=this.range.getIsCollapsed();this.render({isSetCursor:!0,curIndex:t,isSubmitHistory:!1}),n||this.cursor.drawCursor({isShow:!1}),setTimeout(()=>{this.listener.pageModeChange&&this.listener.pageModeChange(e),this.eventBus.isSubscribe("pageModeChange")&&this.eventBus.emit("pageModeChange",e)})}setPageScale(e){const t=this.getPagePixelRatio();this.options.scale=e;const n=this.getWidth(),i=this.getHeight();this.container.style.width=`${n}px`,this.pageList.forEach((a,s)=>{a.width=n*t,a.height=i*t,a.style.width=`${n}px`,a.style.height=`${i}px`,a.style.marginBottom=`${this.getPageGap()}px`,this._initPageContext(this.ctxList[s])});const o=this.position.getCursorPosition();this.render({isSubmitHistory:!1,isSetCursor:!!o,curIndex:o==null?void 0:o.index}),this.listener.pageScaleChange&&this.listener.pageScaleChange(e),this.eventBus.isSubscribe("pageScaleChange")&&this.eventBus.emit("pageScaleChange",e)}getPagePixelRatio(){return this.pagePixelRatio||window.devicePixelRatio}setPagePixelRatio(e){!this.pagePixelRatio&&e===window.devicePixelRatio||e===this.pagePixelRatio||(this.pagePixelRatio=e,this.setPageDevicePixel())}setPageDevicePixel(){const e=this.getPagePixelRatio(),t=this.getWidth(),n=this.getHeight();this.pageList.forEach((i,o)=>{i.width=t*e,i.height=n*e,this._initPageContext(this.ctxList[o])}),this.render({isSubmitHistory:!1,isSetCursor:!1})}setPaperSize(e,t){this.options.width=e,this.options.height=t;const n=this.getPagePixelRatio(),i=this.getWidth(),o=this.getHeight();this.container.style.width=`${i}px`,this.pageList.forEach((a,s)=>{a.width=i*n,a.height=o*n,a.style.width=`${i}px`,a.style.height=`${o}px`,this._initPageContext(this.ctxList[s])}),this.render({isSubmitHistory:!1,isSetCursor:!1})}setPaperDirection(e){const t=this.getPagePixelRatio();this.options.paperDirection=e;const n=this.getWidth(),i=this.getHeight();this.container.style.width=`${n}px`,this.pageList.forEach((o,a)=>{o.width=n*t,o.height=i*t,o.style.width=`${n}px`,o.style.height=`${i}px`,this._initPageContext(this.ctxList[a])}),this.render({isSubmitHistory:!1,isSetCursor:!1})}setPaperMargin(e){this.options.margins=e,this.render({isSubmitHistory:!1,isSetCursor:!1})}getValue(e={}){const{pageNo:t}=e;let n=this.elementList;Number.isInteger(t)&&t>=0&&to.elementList));const i={header:bt(this.getHeaderElementList()),main:bt(n),footer:bt(this.getFooterElementList())};return{version:K1,data:i,options:gt(this.options)}}setValue(e){const{header:t,main:n,footer:i}=gt(e);if(!t&&!n&&!i)return;[t,n,i].forEach(a=>{!a||Nr(a,{editorOptions:this.options})}),this.setEditorData({header:t,main:n,footer:i}),this.historyManager.recovery(),this.render({isSetCursor:!1,isFirstRender:!0})}setEditorData(e){const{header:t,main:n,footer:i}=e;t&&this.header.setElementList(t),n&&(this.elementList=n),i&&this.footer.setElementList(i)}_wrapContainer(e){const t=document.createElement("div");return e.append(t),t}_formatContainer(){this.container.style.position="relative",this.container.style.width=`${this.getWidth()}px`,this.container.setAttribute(fn,pn.MAIN)}_createPageContainer(){const e=document.createElement("div");return e.classList.add(`${Fe}-page-container`),this.container.append(e),e}_createPage(e){const t=this.getWidth(),n=this.getHeight(),i=document.createElement("canvas");i.style.width=`${t}px`,i.style.height=`${n}px`,i.style.display="block",i.style.backgroundColor="#ffffff",i.style.marginBottom=`${this.getPageGap()}px`,i.setAttribute("data-index",String(e)),this.pageContainer.append(i);const o=this.getPagePixelRatio();i.width=t*o,i.height=n*o,i.style.cursor="text";const a=i.getContext("2d");this._initPageContext(a),this.pageList.push(i),this.ctxList.push(a)}_initPageContext(e){const t=this.getPagePixelRatio();e.scale(t,t),e.letterSpacing="0px",e.wordSpacing="0px",e.direction="ltr"}getElementFont(e,t=1){const{defaultSize:n,defaultFont:i}=this.options,o=e.font||i,a=e.actualSize||e.size||n;return`${e.italic?"italic ":""}${e.bold?"bold ":""}${a*t}px ${o}`}getElementSize(e){return e.actualSize||e.size||this.options.defaultSize}getElementRowMargin(e){const{defaultBasicRowMarginHeight:t,defaultRowMargin:n,scale:i}=this.options;return t*(e.rowMargin||n)*i}computeRowList(e){var m,x,T,P,A,D,W,_,Q,te;const{innerWidth:t,elementList:n,isPagingMode:i=!1}=e,{defaultSize:o,defaultRowMargin:a,scale:s,table:{tdPadding:l},defaultTabWidth:c}=this.options,u=this.getDefaultBasicRowMarginHeight(),d=document.createElement("canvas").getContext("2d"),f=this.listParticle.computeListStyle(d,n),p=[];n.length&&p.push({width:0,height:0,ascent:0,elementList:[],startIndex:0,rowFlex:((m=n==null?void 0:n[0])==null?void 0:m.rowFlex)||((x=n==null?void 0:n[1])==null?void 0:x.rowFlex)});let g,v=0,R=0;for(let O=0;OY){const G=C*Y/X;y.width=Y/s,y.height=G/s,k.width=Y,k.height=G,k.boundingBoxDescent=G}else k.width=X,k.height=C,k.boundingBoxDescent=C}k.boundingBoxAscent=0}else if(y.type===ae.TABLE){const X=l[1]+l[3],C=l[0]+l[2];if(y.pagingId){let q=O+1,M=0;for(;q!E.pagingRepeat);y.trList.push(...S),y.height+=w.height,q++,M++}else break}M&&n.splice(O+1,M)}y.pagingIndex=(T=y.pagingIndex)!=null?T:0,this.tableParticle.computeRowColInfo(y);const G=y.trList;for(let q=0;qse+ge.height,0);S.rowList=E;const $=K/s+C;if(S.height<$){const se=$-S.height,ge=G[q+S.rowspan-1];ge.height+=se,ge.tdList.forEach(Oe=>{Oe.height+=se})}let Z=0,oe=0,ce=0;for(;ce0){const S=G[q];S.height-=w,S.tdList.forEach(E=>{E.height-=w})}}this.tableParticle.computeRowColInfo(y);const H=this.tableParticle.getTableHeight(y),j=this.tableParticle.getTableWidth(y);y.width=j,y.height=H;const ue=j*s,b=H*s;if(k.width=ue,k.height=b,k.boundingBoxDescent=b,k.boundingBoxAscent=-L,i){const q=this.getHeight(),M=this.getMainOuterHeight();let w=M;for(let E=0;Eq||((P=p[E-1])==null?void 0:P.isPageBreak)?w=M+K.height:w+=K.height}const S=L*2*s;if((w+y.trList[0].height+S>q||y.pagingIndex!==0&&y.trList[0].pagingRepeat)&&(w=M),w+S+b>q){const E=y.trList;let K=0,$=0,Z=0;if(E.length>1)for(let oe=0;oeq){const ge=ce.tdList.reduce((Oe,Te)=>Oe+Te.colspan,0);((A=y.colgroup)==null?void 0:A.length)!==ge&&($=0);break}else K=oe+1,$=E.length-K,Z+=se}if($){const oe=E.splice(K,$),ce=oe.reduce((Te,Ye)=>Te+Ye.height,0),se=y.pagingId||it();y.pagingId=se,y.height-=ce,k.height-=ce,k.boundingBoxDescent-=ce;const ge=gt(y);ge.pagingId=se,ge.pagingIndex=y.pagingIndex+1;const Oe=E.filter(Te=>Te.pagingRepeat);if(Oe.length){const Te=gt(Oe);Te.forEach(Ye=>Ye.id=it()),oe.unshift(...Te)}ge.trList=oe,ge.id=it(),this.spliceElementList(n,O+1,0,ge)}}if(y.pagingId){const E=this.position.getPositionContext();if(E.isTable){let K=-1,$=-1,Z=O;for(;Zse.id===E.trId);if(~ce){K=Z,$=ce;break}Z++}~K&&(E.index=K,E.trIndex=$,this.position.setPositionContext(E))}}}}else if(y.type===ae.SEPARATOR){const{separator:{lineWidth:X}}=this.options;y.width=Y/s,k.width=Y,k.height=X*s,k.boundingBoxAscent=-L,k.boundingBoxDescent=-L+k.height}else if(y.type===ae.PAGE_BREAK)y.width=Y/s,k.width=Y,k.height=o;else if(y.type===ae.RADIO||y.controlComponent===ye.RADIO){const{width:X,height:C,gap:G}=this.options.radio,z=X+G*2;y.width=z,k.width=z*s,k.height=C*s}else if(y.type===ae.CHECKBOX||y.controlComponent===ye.CHECKBOX){const{width:X,height:C,gap:G}=this.options.checkbox,z=X+G*2;y.width=z,k.width=z*s,k.height=C*s}else if(y.type===ae.TAB)k.width=c*s,k.height=o*s,k.boundingBoxDescent=0,k.boundingBoxAscent=k.height;else if(y.type===ae.BLOCK){if(!y.width)k.width=Y;else{const X=y.width*s;k.width=Math.min(X,Y)}k.height=y.height*s,k.boundingBoxDescent=k.height,k.boundingBoxAscent=0}else{const X=y.size||o;(y.type===ae.SUPERSCRIPT||y.type===ae.SUBSCRIPT)&&(y.actualSize=Math.ceil(X*.6)),k.height=(y.actualSize||X)*s,d.font=this.getElementFont(y);const C=this.textParticle.measureText(d,y);k.width=C.width*s,y.letterSpacing&&(k.width+=y.letterSpacing*s),k.boundingBoxAscent=(y.value===Ne?y.size||o:C.actualBoundingBoxAscent)*s,k.boundingBoxDescent=C.actualBoundingBoxDescent*s,y.type===ae.SUPERSCRIPT?k.boundingBoxAscent+=k.height/2:y.type===ae.SUBSCRIPT&&(k.boundingBoxDescent+=k.height/2)}const V=y.imgDisplay!==ze.INLINE&&y.type===ae.IMAGE||y.type===ae.LATEX?k.height+L:k.boundingBoxAscent+L,ie=L+k.boundingBoxAscent+k.boundingBoxDescent+L,U=Object.assign(y,{metrics:k,style:this.getElementFont(y,s)});if((D=U.control)!=null&&D.minWidth&&(U.controlComponent&&(R+=k.width),U.controlComponent===ye.POSTFIX)){const X=U.control.minWidth-R;if(X>0){const C=Y-I.width-k.width,G=Math.min(C,X)*s;U.left=G,I.width+=G}else U.left=0;R=0}const N=n[O-1];let J=n[O+1],B=I.width+k.width;if(this.options.wordBreak===wc.BREAK_WORD&&(!(N!=null&&N.type)||(N==null?void 0:N.type)===ae.TEXT)&&(!y.type||y.type===ae.TEXT)){const X=`${(N==null?void 0:N.value)||""}${y.value}`;if(this.WORD_LIKE_REG.test(X)){const{width:C,endElement:G}=this.textParticle.measureWord(d,n,O);C<=Y&&(B+=C,J=G)}B+=this.textParticle.measurePunctuationWidth(d,J)}y.listId&&(y.listId!==g?v=0:y.value===Ne&&!y.listWrap&&v++),g=y.listId;const re=y.type===ae.SEPARATOR||y.type===ae.TABLE||(N==null?void 0:N.type)===ae.TABLE||(N==null?void 0:N.type)===ae.BLOCK||y.type===ae.BLOCK||(N==null?void 0:N.imgDisplay)===ze.INLINE||y.imgDisplay===ze.INLINE||(N==null?void 0:N.listId)!==y.listId||O!==0&&y.value===Ne,ee=B>Y;if(re||ee){const X={width:k.width,height:ie,startIndex:O,elementList:[U],ascent:V,rowFlex:((W=n[O])==null?void 0:W.rowFlex)||((_=n[O+1])==null?void 0:_.rowFlex),isPageBreak:y.type===ae.PAGE_BREAK};if(U.controlComponent!==ye.PREFIX&&((Q=U.control)==null?void 0:Q.indentation)===Vd.VALUE_START){const C=I.elementList.findIndex(G=>G.controlId===U.controlId&&G.controlComponent!==ye.PREFIX);if(~C){const z=this.position.computeRowPosition({row:I,innerWidth:this.getInnerWidth()})[C];z&&(X.offsetX=z.coordinate.leftTop[0])}}y.listId&&(X.isList=!0,X.offsetX=f.get(y.listId),X.listIndex=v),p.push(X)}else I.width+=k.width,O===0&&Fa(n[1])?(I.height=u,I.ascent=u):I.heightd+f.height,0);const c=this.getPagePixelRatio(),u=this.pageList[0],h=Number(u.style.height.replace("px",""));if(a>h)u.style.height=`${a}px`,u.height=a*c;else{const d=ai||((l=this.rowList[c-1])==null?void 0:l.isPageBreak)){if(Number.isInteger(n)&&s>=n){this.elementList=this.elementList.slice(0,u.startIndex);break}a=o+u.height,e.push([u]),s++}else a+=u.height,e[s].push(u)}return e}_drawHighlight(e,t){const{rowList:n,positionList:i}=t;for(let o=0;o{n.forEach(i=>{if(i.isIntersecting){const o=Number(i.target.dataset.index);this._drawPage({elementList:t,positionList:e,rowList:this.pageRowList[o],pageNo:o})}})}),this.pageList.forEach(n=>{this.lazyRenderIntersectionObserver.observe(n)})}_immediateRender(){const e=this.position.getOriginalMainPositionList(),t=this.getOriginalMainElementList();for(let n=0;np){const v=g-p;this.ctxList.splice(p,v),this.pageList.splice(p,v).forEach(R=>R.remove())}s&&f?this._lazyRender():this._immediateRender(),o&&(h=this.setCursor(h)),(i&&!u||h!==void 0&&this.historyManager.isStackEmpty())&&this.submitHistory(h),La(()=>{a&&this.control.getActiveControl()&&this.control.reAwakeControl(),a&&!this.isReadonly()&&this.position.getPositionContext().isTable&&this.tableTool.render(),a&&!this.zone.isMainActive()&&this.zone.drawZoneIndicator(),this.listener.pageSizeChange&&this.listener.pageSizeChange(this.pageRowList.length),this.eventBus.isSubscribe("pageSizeChange")&&this.eventBus.emit("pageSizeChange",this.pageRowList.length),(i||c)&&!l&&(this.listener.contentChange&&this.listener.contentChange(),this.eventBus.isSubscribe("contentChange")&&this.eventBus.emit("contentChange"))})}setCursor(e){var o;const t=this.position.getPositionContext(),n=this.position.getPositionList();if(t.isTable){const{index:a,trIndex:s,tdIndex:l}=t,u=(o=this.getOriginalElementList()[a].trList)==null?void 0:o[s].tdList[l].positionList;e===void 0&&u&&(e=u.length-1);const h=u==null?void 0:u[e];this.position.setCursorPosition(h||null)}else this.position.setCursorPosition(e!==void 0?n[e]:null);let i=!0;if(e!==void 0&&t.isImage&&t.isDirectHit){const s=this.getElementList()[e];if(dg.includes(s.type)){i=!1;const l=this.position.getCursorPosition();this.previewer.updateResizer(s,l)}}return this.cursor.drawCursor({isShow:i}),e}submitHistory(e){const t=this.position.getPositionContext(),n=ys(this.elementList),i=ys(this.header.getElementList()),o=ys(this.footer.getElementList()),a=gt(this.range.getRange()),s=this.pageNo,l=gt(t),c=this.zone.getZone();this.historyManager.execute(()=>{this.zone.setZone(c),this.setPageNo(s),this.position.setPositionContext(gt(l)),this.header.setElementList(gt(i)),this.footer.setElementList(gt(o)),this.elementList=gt(n),this.range.replaceRange(gt(a)),this.render({curIndex:e,isSubmitHistory:!1,isSourceHistory:!0})})}destroy(){this.container.remove(),this.globalEvent.removeEvent(),this.scrollObserver.removeEvent(),this.selectionObserver.removeEvent()}clearSideEffect(){this.getPreviewer().clearResizer(),this.getTableTool().dispose(),this.getHyperlinkParticle().clearHyperlinkPopup(),this.getDateParticle().clearDatePicker()}}class ym{constructor(e){this.executeMode=e.mode.bind(e),this.executeCut=e.cut.bind(e),this.executeCopy=e.copy.bind(e),this.executePaste=e.paste.bind(e),this.executeSelectAll=e.selectAll.bind(e),this.executeBackspace=e.backspace.bind(e),this.executeSetRange=e.setRange.bind(e),this.executeReplaceRange=e.replaceRange.bind(e),this.executeSetPositionContext=e.setPositionContext.bind(e),this.executeForceUpdate=e.forceUpdate.bind(e),this.executeBlur=e.blur.bind(e),this.executeUndo=e.undo.bind(e),this.executeRedo=e.redo.bind(e),this.executePainter=e.painter.bind(e),this.executeApplyPainterStyle=e.applyPainterStyle.bind(e),this.executeFormat=e.format.bind(e),this.executeFont=e.font.bind(e),this.executeSize=e.size.bind(e),this.executeSizeAdd=e.sizeAdd.bind(e),this.executeSizeMinus=e.sizeMinus.bind(e),this.executeBold=e.bold.bind(e),this.executeItalic=e.italic.bind(e),this.executeUnderline=e.underline.bind(e),this.executeStrikeout=e.strikeout.bind(e),this.executeSuperscript=e.superscript.bind(e),this.executeSubscript=e.subscript.bind(e),this.executeColor=e.color.bind(e),this.executeHighlight=e.highlight.bind(e),this.executeTitle=e.title.bind(e),this.executeList=e.list.bind(e),this.executeRowFlex=e.rowFlex.bind(e),this.executeRowMargin=e.rowMargin.bind(e),this.executeInsertTable=e.insertTable.bind(e),this.executeInsertTableTopRow=e.insertTableTopRow.bind(e),this.executeInsertTableBottomRow=e.insertTableBottomRow.bind(e),this.executeInsertTableLeftCol=e.insertTableLeftCol.bind(e),this.executeInsertTableRightCol=e.insertTableRightCol.bind(e),this.executeDeleteTableRow=e.deleteTableRow.bind(e),this.executeDeleteTableCol=e.deleteTableCol.bind(e),this.executeDeleteTable=e.deleteTable.bind(e),this.executeMergeTableCell=e.mergeTableCell.bind(e),this.executeCancelMergeTableCell=e.cancelMergeTableCell.bind(e),this.executeTableTdVerticalAlign=e.tableTdVerticalAlign.bind(e),this.executeTableBorderType=e.tableBorderType.bind(e),this.executeTableTdBorderType=e.tableTdBorderType.bind(e),this.executeTableTdSlashType=e.tableTdSlashType.bind(e),this.executeTableTdBackgroundColor=e.tableTdBackgroundColor.bind(e),this.executeTableSelectAll=e.tableSelectAll.bind(e),this.executeImage=e.image.bind(e),this.executeHyperlink=e.hyperlink.bind(e),this.executeDeleteHyperlink=e.deleteHyperlink.bind(e),this.executeCancelHyperlink=e.cancelHyperlink.bind(e),this.executeEditHyperlink=e.editHyperlink.bind(e),this.executeSeparator=e.separator.bind(e),this.executePageBreak=e.pageBreak.bind(e),this.executeAddWatermark=e.addWatermark.bind(e),this.executeDeleteWatermark=e.deleteWatermark.bind(e),this.executeSearch=e.search.bind(e),this.executeSearchNavigatePre=e.searchNavigatePre.bind(e),this.executeSearchNavigateNext=e.searchNavigateNext.bind(e),this.executeReplace=e.replace.bind(e),this.executePrint=e.print.bind(e),this.executeReplaceImageElement=e.replaceImageElement.bind(e),this.executeSaveAsImageElement=e.saveAsImageElement.bind(e),this.executeChangeImageDisplay=e.changeImageDisplay.bind(e),this.executePageMode=e.pageMode.bind(e),this.executePageScaleRecovery=e.pageScaleRecovery.bind(e),this.executePageScaleMinus=e.pageScaleMinus.bind(e),this.executePageScaleAdd=e.pageScaleAdd.bind(e),this.executePaperSize=e.paperSize.bind(e),this.executePaperDirection=e.paperDirection.bind(e),this.executeSetPaperMargin=e.setPaperMargin.bind(e),this.executeInsertElementList=e.insertElementList.bind(e),this.executeAppendElementList=e.appendElementList.bind(e),this.executeSetValue=e.setValue.bind(e),this.executeRemoveControl=e.removeControl.bind(e),this.executeSetLocale=e.setLocale.bind(e),this.executeLocationCatalog=e.locationCatalog.bind(e),this.executeWordTool=e.wordTool.bind(e),this.executeSetHTML=e.setHTML.bind(e),this.executeSetGroup=e.setGroup.bind(e),this.executeDeleteGroup=e.deleteGroup.bind(e),this.executeLocationGroup=e.locationGroup.bind(e),this.executeSetZone=e.setZone.bind(e),this.executeUpdateOptions=e.updateOptions.bind(e),this.executeInsertTitle=e.insertTitle.bind(e),this.getImage=e.getImage.bind(e),this.getOptions=e.getOptions.bind(e),this.getValue=e.getValue.bind(e),this.getHTML=e.getHTML.bind(e),this.getText=e.getText.bind(e),this.getWordCount=e.getWordCount.bind(e),this.getRange=e.getRange.bind(e),this.getRangeText=e.getRangeText.bind(e),this.getRangeContext=e.getRangeContext.bind(e),this.getRangeRow=e.getRangeRow.bind(e),this.getRangeParagraph=e.getRangeParagraph.bind(e),this.getKeywordRangeList=e.getKeywordRangeList.bind(e),this.getCatalog=e.getCatalog.bind(e),this.getPaperMargin=e.getPaperMargin.bind(e),this.getSearchNavigateInfo=e.getSearchNavigateInfo.bind(e),this.getLocale=e.getLocale.bind(e),this.getGroupIds=e.getGroupIds.bind(e),this.getContainer=e.getContainer.bind(e),this.getTitleValue=e.getTitleValue.bind(e),this.executeSetControlValue=e.setControlValue.bind(e),this.executeSetControlExtension=e.setControlExtension.bind(e),this.executeSetControlProperties=e.setControlProperties.bind(e),this.executeSetControlHighlight=e.setControlHighlight.bind(e),this.getControlValue=e.getControlValue.bind(e),this.getControlList=e.getControlList.bind(e),this.executeLocationControl=e.locationControl.bind(e)}}const Yl={data:"",color:"#AEB5C0",opacity:.3,size:200,font:"Microsoft YaHei"};var Fn=(r=>(r.TOP="top",r.MIDDLE="middle",r.BOTTOM="bottom",r))(Fn||{});const wm={color:"#FFFFFF",image:"",size:Sc.COVER,repeat:Hn.NO_REPEAT},Sm={width:14,height:14,gap:5,lineWidth:1,fillStyle:"#5175f4",strokeStyle:"#ffffff"},xm={placeholderColor:"#9c9b9b",bracketColor:"#000000",prefix:"{",postfix:"}",borderWidth:1,borderColor:"#000000"},bm={bottom:30,maxHeightRadio:Ei.HALF,disabled:!1},Om={opacity:.1,backgroundColor:"#E99D00",activeOpacity:.5,activeBackgroundColor:"#E99D00",disabled:!1},Tm={top:30,maxHeightRadio:Ei.HALF,disabled:!1},Pm={disabled:!0,color:"#CCCCCC",lineWidth:1.5},Em={font:"Microsoft YaHei",fontSize:12,lineDash:[3,1]},_m={data:"",color:"#DCDFE6",opacity:1,size:16,font:"Microsoft YaHei"},Im={width:14,height:14,gap:5,lineWidth:1,fillStyle:"#5175f4",strokeStyle:"#000000"},Nm={lineWidth:1,strokeStyle:"#000000"},Mm={tdPadding:[0,5,5,5],defaultTrMinHeight:42,defaultColMinWidth:40},Lm={tipDisabled:!0};function i0(r={}){const e={...Mm,...r.table},t={...Tm,...r.header},n={...bm,...r.footer},i={...PR,...r.pageNumber},o={...Yl,...r.watermark},a={...xm,...r.control},s={...Sm,...r.checkbox},l={...Im,...r.radio},c={...lg,...r.cursor},u={..._g,...r.title},h={..._m,...r.placeholder},d={...Om,...r.group},f={...Em,...r.pageBreak},p={...Lm,...r.zone},g={...wm,...r.background},v={...Pm,...r.lineBreak},R={...Nm,...r.separator};return{mode:Mt.EDIT,defaultType:"TEXT",defaultColor:"#000000",defaultFont:"Microsoft YaHei",defaultSize:16,minSize:5,maxSize:72,defaultRowMargin:1,defaultBasicRowMarginHeight:8,defaultTabWidth:32,width:794,height:1123,scale:1,pageGap:20,underlineColor:"#000000",strikeoutColor:"#FF0000",rangeAlpha:.6,rangeColor:"#AECBFA",rangeMinWidth:5,searchMatchAlpha:.6,searchMatchColor:"#FFFF00",searchNavigateMatchColor:"#AAD280",highlightAlpha:.6,resizerColor:"#4182D9",resizerSize:5,marginIndicatorSize:35,marginIndicatorColor:"#BABABA",margins:[100,120,100,120],pageMode:Ln.PAGING,defaultHyperlinkColor:"#0000FF",paperDirection:jn.VERTICAL,inactiveAlpha:.6,historyMaxRecordCount:100,wordBreak:wc.BREAK_WORD,printPixelRatio:3,maskMargin:[0,0,0,0],letterClass:[G1.ENGLISH],contextMenuDisableKeys:[],scrollContainerSelector:"",...r,table:e,header:t,footer:n,pageNumber:i,watermark:o,control:a,checkbox:s,radio:l,cursor:c,title:u,placeholder:h,group:d,pageBreak:f,zone:p,background:g,lineBreak:v,separator:R}}function Fm(r,e){const{width:t,height:n,direction:i=jn.VERTICAL}=e,o=document.createElement("iframe");o.style.visibility="hidden",o.style.position="absolute",o.style.left="0",o.style.top="0",o.style.width="0",o.style.height="0",o.style.border="none",document.body.append(o);const a=o.contentWindow,s=a.document;s.open();const l=document.createElement("div");r.forEach(h=>{const d=document.createElement("img");d.style.width=`${t}px`,d.style.height=`${n}px`,d.src=h,l.append(d)});const c=document.createElement("style"),u=` + * { + margin: 0; + padding: 0; + } + @page { + margin: 0; + size: ${i===jn.HORIZONTAL?"landscape":"portrait"}; + }`;c.append(document.createTextNode(u)),setTimeout(()=>{s.write(`${c.outerHTML}${l.innerHTML}`),a.print(),s.close(),window.addEventListener("mouseover",()=>{o==null||o.remove()},{once:!0})})}class Cm{constructor(e){this.draw=e,this.range=e.getRange(),this.position=e.getPosition(),this.historyManager=e.getHistoryManager(),this.canvasEvent=e.getCanvasEvent(),this.tableTool=e.getTableTool(),this.options=e.getOptions(),this.control=e.getControl(),this.workerManager=e.getWorkerManager(),this.searchManager=e.getSearch(),this.i18n=e.getI18n()}mode(e){this.draw.setMode(e)}cut(){this.draw.isReadonly()||this.canvasEvent.cut()}copy(){this.canvasEvent.copy()}paste(e){this.draw.isReadonly()||Yg(this.canvasEvent,e)}selectAll(){this.canvasEvent.selectAll()}backspace(){if(this.draw.isReadonly())return;const t=this.draw.getElementList(),{startIndex:n,endIndex:i}=this.range.getRange(),o=n===i;if(o&&t[n].value===Ne&&n===0)return;o?this.draw.spliceElementList(t,n,1):this.draw.spliceElementList(t,n+1,i-n);const a=o?n-1:n;this.range.setRange(a,a),this.draw.render({curIndex:a})}setRange(e,t,n,i,o,a,s){if(e<0||t<0||tu.id===t);if(!~a)return;const l=o[a].trList[n],c=l.tdList[i];this.position.setPositionContext({isTable:!0,index:a,trIndex:n,tdIndex:i,tdId:c.id,trId:l.id,tableId:t})}else this.position.setPositionContext({isTable:!1})}forceUpdate(e){const{isSubmitHistory:t=!1}=e||{};this.range.clearRange(),this.draw.render({isSubmitHistory:t,isSetCursor:!1})}blur(){this.range.clearRange(),this.draw.getCursor().recoveryCursor()}undo(){this.draw.isReadonly()||this.historyManager.undo()}redo(){this.draw.isReadonly()||this.historyManager.redo()}painter(e){if(!e.isDblclick&&this.draw.getPainterStyle()){this.canvasEvent.clearPainterStyle();return}const t=this.range.getSelection();if(!t)return;const n={};t.forEach(i=>{ri.forEach(a=>{const s=a;n[s]===void 0&&(n[s]=i[s])})}),this.draw.setPainterStyle(n,e)}applyPainterStyle(){this.draw.isReadonly()||this.control.getIsDisabledControl()||this.canvasEvent.applyPainterStyle()}format(){if(this.draw.isReadonly()||this.control.getIsDisabledControl())return;const t=this.range.getSelectionElementList();let n={},i=[];if(t!=null&&t.length)i=t,n={isSetCursor:!1};else{const{endIndex:o}=this.range.getRange(),s=this.draw.getElementList()[o];(s==null?void 0:s.value)===Ne&&(i.push(s),n={curIndex:o})}!i.length||(i.forEach(o=>{delete o.size,delete o.font,delete o.color,delete o.bold,delete o.italic,delete o.underline,delete o.strikeout}),this.draw.render(n))}font(e){if(this.draw.isReadonly()||this.control.getIsDisabledControl())return;const n=this.range.getSelectionElementList();if(n!=null&&n.length)n.forEach(i=>{i.font=e}),this.draw.render({isSetCursor:!1});else{const{endIndex:i}=this.range.getRange(),a=this.draw.getElementList()[i];(a==null?void 0:a.value)===Ne&&(a.font=e,this.draw.render({curIndex:i,isCompute:!1}))}}size(e){const{minSize:t,maxSize:n,defaultSize:i}=this.options;if(en||this.draw.isReadonly()||this.control.getIsDisabledControl())return;let a={},s=[];const l=this.range.getTextLikeSelectionElementList();if(l!=null&&l.length)s=l,a={isSetCursor:!1};else{const{endIndex:u}=this.range.getRange(),d=this.draw.getElementList()[u];(d==null?void 0:d.value)===Ne&&(s.push(d),a={curIndex:u})}if(!s.length)return;let c=!1;s.forEach(u=>{!u.size&&e===i||u.size&&u.size===e||(u.size=e,c=!0)}),c&&this.draw.render(a)}sizeAdd(){if(this.draw.isReadonly()||this.control.getIsDisabledControl())return;const t=this.range.getTextLikeSelectionElementList();let n={},i=[];if(t!=null&&t.length)i=t,n={isSetCursor:!1};else{const{endIndex:l}=this.range.getRange(),u=this.draw.getElementList()[l];(u==null?void 0:u.value)===Ne&&(i.push(u),n={curIndex:l})}if(!i.length)return;const{defaultSize:o,maxSize:a}=this.options;let s=!1;i.forEach(l=>{l.size||(l.size=o),!(l.size>=a)&&(l.size+2>a?l.size=a:l.size+=2,s=!0)}),s&&this.draw.render(n)}sizeMinus(){if(this.draw.isReadonly()||this.control.getIsDisabledControl())return;const t=this.range.getTextLikeSelectionElementList();let n={},i=[];if(t!=null&&t.length)i=t,n={isSetCursor:!1};else{const{endIndex:l}=this.range.getRange(),u=this.draw.getElementList()[l];(u==null?void 0:u.value)===Ne&&(i.push(u),n={curIndex:l})}if(!i.length)return;const{defaultSize:o,minSize:a}=this.options;let s=!1;i.forEach(l=>{l.size||(l.size=o),!(l.size<=a)&&(l.size-2!i.bold);t.forEach(i=>{i.bold=!!~n}),this.draw.render({isSetCursor:!1})}else{const{endIndex:n}=this.range.getRange(),o=this.draw.getElementList()[n];(o==null?void 0:o.value)===Ne&&(o.bold=!o.bold,this.draw.render({curIndex:n,isCompute:!1}))}}italic(){if(this.draw.isReadonly()||this.control.getIsDisabledControl())return;const t=this.range.getSelectionElementList();if(t!=null&&t.length){const n=t.findIndex(i=>!i.italic);t.forEach(i=>{i.italic=!!~n}),this.draw.render({isSetCursor:!1})}else{const{endIndex:n}=this.range.getRange(),o=this.draw.getElementList()[n];(o==null?void 0:o.value)===Ne&&(o.italic=!o.italic,this.draw.render({curIndex:n,isCompute:!1}))}}underline(e){if(this.draw.isReadonly()||this.control.getIsDisabledControl())return;const n=this.range.getSelectionElementList();if(n!=null&&n.length){const i=n.some(o=>!o.underline||!e&&o.textDecoration||e&&!o.textDecoration||e&&o.textDecoration&&!ag(o.textDecoration,e));n.forEach(o=>{o.underline=i,i&&e?o.textDecoration=e:delete o.textDecoration}),this.draw.render({isSetCursor:!1,isCompute:!1})}else{const{endIndex:i}=this.range.getRange(),a=this.draw.getElementList()[i];(a==null?void 0:a.value)===Ne&&(a.underline=!a.underline,this.draw.render({curIndex:i,isCompute:!1}))}}strikeout(){if(this.draw.isReadonly()||this.control.getIsDisabledControl())return;const t=this.range.getSelectionElementList();if(t!=null&&t.length){const n=t.findIndex(i=>!i.strikeout);t.forEach(i=>{i.strikeout=!!~n}),this.draw.render({isSetCursor:!1,isCompute:!1})}else{const{endIndex:n}=this.range.getRange(),o=this.draw.getElementList()[n];(o==null?void 0:o.value)===Ne&&(o.strikeout=!o.strikeout,this.draw.render({curIndex:n,isCompute:!1}))}}superscript(){if(this.draw.isReadonly()||this.control.getIsDisabledControl())return;const t=this.range.getSelectionElementList();if(!t)return;const n=t.findIndex(i=>i.type===ae.SUPERSCRIPT);t.forEach(i=>{~n?i.type===ae.SUPERSCRIPT&&(i.type=ae.TEXT,delete i.actualSize):(!i.type||i.type===ae.TEXT||i.type===ae.SUBSCRIPT)&&(i.type=ae.SUPERSCRIPT)}),this.draw.render({isSetCursor:!1})}subscript(){if(this.draw.isReadonly()||this.control.getIsDisabledControl())return;const t=this.range.getSelectionElementList();if(!t)return;const n=t.findIndex(i=>i.type===ae.SUBSCRIPT);t.forEach(i=>{~n?i.type===ae.SUBSCRIPT&&(i.type=ae.TEXT,delete i.actualSize):(!i.type||i.type===ae.TEXT||i.type===ae.SUPERSCRIPT)&&(i.type=ae.SUBSCRIPT)}),this.draw.render({isSetCursor:!1})}color(e){if(this.draw.isReadonly()||this.control.getIsDisabledControl())return;const n=this.range.getSelectionElementList();if(n!=null&&n.length)n.forEach(i=>{e?i.color=e:delete i.color}),this.draw.render({isSetCursor:!1,isCompute:!1});else{const{endIndex:i}=this.range.getRange(),a=this.draw.getElementList()[i];(a==null?void 0:a.value)===Ne&&(e?a.color=e:delete a.color,this.draw.render({curIndex:i,isCompute:!1}))}}highlight(e){if(this.draw.isReadonly()||this.control.getIsDisabledControl())return;const n=this.range.getSelectionElementList();if(n!=null&&n.length)n.forEach(i=>{e?i.highlight=e:delete i.highlight}),this.draw.render({isSetCursor:!1,isCompute:!1});else{const{endIndex:i}=this.range.getRange(),a=this.draw.getElementList()[i];(a==null?void 0:a.value)===Ne&&(e?a.highlight=e:delete a.highlight,this.draw.render({curIndex:i,isCompute:!1}))}}title(e){if(this.draw.isReadonly())return;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return;const o=this.draw.getElementList(),a=n===i?this.range.getRangeParagraphElementList():o.slice(n+1,i+1);if(!a||!a.length)return;const s=it(),l=this.draw.getOptions().title;a.forEach(h=>{!h.type&&h.value===Ne||(e?(h.level=e,h.titleId=s,kd(h)&&(h.size=l[Wd[e]],h.bold=!0)):h.titleId&&(delete h.titleId,delete h.title,delete h.level,delete h.size,delete h.bold))});const c=n===i,u=c?i:n;this.draw.render({curIndex:u,isSetCursor:c})}list(e,t){this.draw.isReadonly()||this.draw.getListParticle().setList(e,t)}rowFlex(e){if(this.draw.isReadonly())return;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return;const o=this.range.getRangeRowElementList();if(!o)return;o.forEach(l=>{l.rowFlex=e});const a=n===i,s=a?i:n;this.draw.render({curIndex:s,isSetCursor:a})}rowMargin(e){if(this.draw.isReadonly())return;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return;const o=this.range.getRangeRowElementList();if(!o)return;o.forEach(l=>{l.rowMargin=e});const a=n===i,s=a?i:n;this.draw.render({curIndex:s,isSetCursor:a})}insertTable(e,t){var v;if(this.draw.isReadonly()||this.control.getActiveControl())return;const{startIndex:o,endIndex:a}=this.range.getRange();if(!~o&&!~a)return;const{defaultTrMinHeight:s}=this.options.table,l=this.draw.getElementList();let c=0;if((v=l[o])!=null&&v.listId){const R=this.position.getPositionList(),{rowIndex:m}=R[o],T=this.draw.getRowList()[m];c=(T==null?void 0:T.offsetX)||0}const u=this.draw.getOriginalInnerWidth()-c,h=[],d=u/t;for(let R=0;R1&&v.rowIndex+v.rowspan>=d+1&&(v.rowspan+=1)}}}const u=it(),h={height:c.height,id:u,tdList:[]};for(let d=0;d1&&R.rowIndex+R.rowspan>=f+1&&(R.rowspan+=1)}}}const h=it(),d={height:u.height,id:h,tdList:[]};for(let f=0;ff+p.width,0),d=this.draw.getOriginalInnerWidth();if(h>d){const f=(h-d)/u.length;for(let p=0;pf+p.width,0),d=this.draw.getOriginalInnerWidth();if(h>d){const f=(h-d)/u.length;for(let p=0;pu&&g.rowspan--}}for(let h=0;h1){const f=it(),p=l[i+1];p.tdList.splice(h,0,{id:f,rowspan:d.rowspan-1,colspan:d.colspan,value:[{value:Ne,size:16,tableId:s.id,trId:p.id,tdId:f}]})}}l.splice(i,1),this.position.setPositionContext({isTable:!1}),this.range.clearRange(),this.draw.render({curIndex:t.index}),this.tableTool.dispose()}deleteTableCol(){var d;if(this.draw.isReadonly())return;const t=this.position.getPositionContext();if(!t.isTable)return;const{index:n,tdIndex:i,trIndex:o}=t,s=this.draw.getOriginalElementList()[n],l=s.trList,u=l[o].tdList[i].colIndex;if(!l.find(f=>f.tdList.length>1)){this.deleteTable();return}for(let f=0;f1){const R=v.colIndex;R<=u&&R+v.colspan-1>=u&&(v.colspan-=1)}}}for(let f=0;ff.x||d.y>f.y)&&([d,f]=[f,d]);const p=d.colIndex,g=f.colIndex+(f.colspan-1),v=d.rowIndex,R=f.rowIndex+(f.rowspan-1),m=[];for(let I=0;I=p&&Y<=g&&V>=v&&V<=R&&L.push(F)}L.length&&m.push(L)}if(!m.length)return;const x=m[m.length-1],T=m[0][0],P=x[x.length-1],A=T.x,D=T.y,W=P.x+P.width,_=P.y+P.height;for(let I=0;IF||D>Y||W1){for(let f=1;f1){for(let f=1;f{var l;return!((l=s.borderTypes)!=null&&l.includes(e))});i.forEach(s=>{s.borderTypes||(s.borderTypes=[]);const l=s.borderTypes.findIndex(c=>c===e);o?~l||s.borderTypes.push(e):~l&&s.borderTypes.splice(l,1),s.borderTypes.length||delete s.borderTypes});const{endIndex:a}=this.range.getRange();this.draw.render({curIndex:a})}tableTdSlashType(e){if(this.draw.isReadonly())return;const n=this.draw.getTableParticle().getRangeRowCol();if(!n)return;const i=n.flat(),o=i.some(s=>{var l;return!((l=s.slashTypes)!=null&&l.includes(e))});i.forEach(s=>{s.slashTypes||(s.slashTypes=[]);const l=s.slashTypes.findIndex(c=>c===e);o?~l||s.slashTypes.push(e):~l&&s.slashTypes.splice(l,1),s.slashTypes.length||delete s.slashTypes});const{endIndex:a}=this.range.getRange();this.draw.render({curIndex:a})}tableTdBackgroundColor(e){if(this.draw.isReadonly())return;const n=this.draw.getTableParticle().getRangeRowCol();if(!n)return;for(let o=0;o({url:l,hyperlinkId:c,value:f.value,type:ae.HYPERLINK}));if(!u)return;const h=i+1;ar(a,u,i),this.draw.spliceElementList(a,h,i===o?0:o-i,...u);const d=h+u.length-1;this.range.setRange(d,d),this.draw.render({curIndex:d})}getHyperlinkRange(){let e=-1,t=-1;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return null;const o=this.draw.getElementList(),a=o[n];if(a.type!==ae.HYPERLINK)return null;let s=n;for(;s>0;){if(o[s].hyperlinkId!==a.hyperlinkId){e=s+1;break}s--}let l=n+1;for(;l=5&&this.draw.setPageScale(t/10)}pageScaleAdd(){const{scale:e}=this.options,t=e*10+1;t<=30&&this.draw.setPageScale(t/10)}paperSize(e,t){this.draw.setPaperSize(e,t)}paperDirection(e){this.draw.setPaperDirection(e)}getPaperMargin(){return this.options.margins}setPaperMargin(e){return this.draw.setPaperMargin(e)}insertElementList(e){if(!e.length||this.draw.isReadonly())return;const n=gt(e),{startIndex:i}=this.range.getRange(),o=this.draw.getElementList();ar(o,n,i),this.draw.insertElementList(n)}appendElementList(e,t){!e.length||this.draw.isReadonly()||this.draw.appendElementList(gt(e),t)}setValue(e){this.draw.setValue(e)}removeControl(){const{startIndex:e,endIndex:t}=this.range.getRange();if(e!==t||!this.draw.getElementList()[e].controlId)return;const a=this.draw.getControl().removeControl(e);a!==null&&(this.range.setRange(a,a),this.draw.render({curIndex:a}))}setLocale(e){this.i18n.setLocale(e)}getLocale(){return this.i18n.getLocale()}getCatalog(){return this.workerManager.getCatalog()}locationCatalog(e){var i;const t=this.draw.getMainElementList();let n=-1;for(let o=0;os!==void 0?Oo(s,{innerWidth:o}):void 0;this.setValue({header:a(t),main:a(n),footer:a(i)})}setGroup(){return this.draw.isReadonly()?null:this.draw.getGroup().setGroup()}deleteGroup(e){this.draw.isReadonly()||this.draw.getGroup().deleteGroup(e)}getGroupIds(){return this.draw.getWorkerManager().getGroupIds()}locationGroup(e){const t=this.draw.getOriginalMainElementList(),n=this.draw.getGroup().getContextByGroupId(t,e);if(!n)return;const{isTable:i,index:o,trIndex:a,tdIndex:s,tdId:l,trId:c,tableId:u,endIndex:h}=n;this.position.setPositionContext({isTable:i,index:o,trIndex:a,tdIndex:s,tdId:l,trId:c,tableId:u}),this.range.setRange(h,h),this.draw.render({curIndex:h,isCompute:!1,isSubmitHistory:!1})}setZone(e){this.draw.getZone().setZone(e)}getControlValue(e){return this.draw.getControl().getValueByConceptId(e)}setControlValue(e){this.draw.isReadonly()||this.draw.getControl().setValueByConceptId(e)}setControlExtension(e){this.draw.isReadonly()||this.draw.getControl().setExtensionByConceptId(e)}setControlProperties(e){this.draw.isReadonly()||this.draw.getControl().setPropertiesByConceptId(e)}setControlHighlight(e){this.draw.getControl().setHighlightList(e)}updateOptions(e){const t=i0(e);Object.entries(t).forEach(([n,i])=>{Reflect.set(this.options,n,i)}),this.forceUpdate()}getControlList(){return this.draw.getControl().getList()}locationControl(e){function t(i,o){let a=0;for(;a{var c;let l=0;for(;l{va(s,a,c)}),this.draw.insertElementList([n])}}class Am{constructor(){this.rangeStyleChange=null,this.visiblePageNoListChange=null,this.intersectionPageNoChange=null,this.pageSizeChange=null,this.pageScaleChange=null,this.saved=null,this.contentChange=null,this.controlChange=null,this.pageModeChange=null,this.zoneChange=null}}class Dm{constructor(e){const{contextMenu:t,shortcut:n,i18n:i}=e;this.contextMenuList=t.registerContextMenuList.bind(t),this.getContextMenuList=t.getContextMenuList.bind(t),this.shortcutList=n.registerShortcutList.bind(n),this.langMap=i.registerLangMap.bind(i)}}const nh={SELECTED_TEXT:"%s"},Fo={GLOBAL:{CUT:"globalCut",COPY:"globalCopy",PASTE:"globalPaste",SELECT_ALL:"globalSelectAll",PRINT:"globalPrint"},CONTROL:{DELETE:"controlDelete"},HYPERLINK:{DELETE:"hyperlinkDelete",CANCEL:"hyperlinkCancel",EDIT:"hyperlinkEdit"},IMAGE:{CHANGE:"imageChange",SAVE_AS:"imageSaveAs",TEXT_WRAP:"imageTextWrap",TEXT_WRAP_EMBED:"imageTextWrapEmbed",TEXT_WRAP_UP_DOWN:"imageTextWrapUpDown",TEXT_WRAP_FLOAT_TOP:"imageTextWrapFloatTop",TEXT_WRAP_FLOAT_BOTTOM:"imageTextWrapFloatBottom"},TABLE:{BORDER:"border",BORDER_ALL:"tableBorderAll",BORDER_EMPTY:"tableBorderEmpty",BORDER_EXTERNAL:"tableBorderExternal",BORDER_TD:"tableBorderTd",BORDER_TD_TOP:"tableBorderTdTop",BORDER_TD_RIGHT:"tableBorderTdRight",BORDER_TD_BOTTOM:"tableBorderTdBottom",BORDER_TD_LEFT:"tableBorderTdLeft",BORDER_TD_FORWARD:"tableBorderTdForward",BORDER_TD_BACK:"tableBorderTdBack",VERTICAL_ALIGN:"tableVerticalAlign",VERTICAL_ALIGN_TOP:"tableVerticalAlignTop",VERTICAL_ALIGN_MIDDLE:"tableVerticalAlignMiddle",VERTICAL_ALIGN_BOTTOM:"tableVerticalAlignBottom",INSERT_ROW_COL:"tableInsertRowCol",INSERT_TOP_ROW:"tableInsertTopRow",INSERT_BOTTOM_ROW:"tableInsertBottomRow",INSERT_LEFT_COL:"tableInsertLeftCol",INSERT_RIGHT_COL:"tableInsertRightCol",DELETE_ROW_COL:"tableDeleteRowCol",DELETE_ROW:"tableDeleteRow",DELETE_COL:"tableDeleteCol",DELETE_TABLE:"tableDeleteTable",MERGE_CELL:"tableMergeCell",CANCEL_MERGE_CELL:"tableCancelMergeCell"}},{CONTROL:{DELETE:Xm}}=Fo,Um=[{key:Xm,i18nPath:"contextmenu.control.delete",when:r=>{var e;return!r.isReadonly&&!r.editorHasSelection&&!!((e=r.startElement)!=null&&e.controlId)},callback:r=>{r.executeRemoveControl()}}],{GLOBAL:{CUT:Wm,COPY:Vm,PASTE:Ym,SELECT_ALL:km,PRINT:Zm}}=Fo,Qm=[{key:Wm,i18nPath:"contextmenu.global.cut",shortCut:`${Gn?"\u2318":"Ctrl"} + X`,when:r=>!r.isReadonly,callback:r=>{r.executeCut()}},{key:Vm,i18nPath:"contextmenu.global.copy",shortCut:`${Gn?"\u2318":"Ctrl"} + C`,when:r=>r.editorHasSelection||r.isCrossRowCol,callback:r=>{r.executeCopy()}},{key:Ym,i18nPath:"contextmenu.global.paste",shortCut:`${Gn?"\u2318":"Ctrl"} + V`,when:r=>!r.isReadonly&&r.editorTextFocus,callback:r=>{r.executePaste()}},{key:km,i18nPath:"contextmenu.global.selectAll",shortCut:`${Gn?"\u2318":"Ctrl"} + A`,when:r=>r.editorTextFocus,callback:r=>{r.executeSelectAll()}},{isDivider:!0},{key:Zm,i18nPath:"contextmenu.global.print",icon:"print",when:()=>!0,callback:r=>{r.executePrint()}}],{HYPERLINK:{DELETE:Km,CANCEL:Hm,EDIT:Bm}}=Fo,Gm=[{key:Km,i18nPath:"contextmenu.hyperlink.delete",when:r=>{var e;return!r.isReadonly&&((e=r.startElement)==null?void 0:e.type)===ae.HYPERLINK},callback:r=>{r.executeDeleteHyperlink()}},{key:Hm,i18nPath:"contextmenu.hyperlink.cancel",when:r=>{var e;return!r.isReadonly&&((e=r.startElement)==null?void 0:e.type)===ae.HYPERLINK},callback:r=>{r.executeCancelHyperlink()}},{key:Bm,i18nPath:"contextmenu.hyperlink.edit",when:r=>{var e;return!r.isReadonly&&((e=r.startElement)==null?void 0:e.type)===ae.HYPERLINK},callback:(r,e)=>{var n;const t=window.prompt("\u7F16\u8F91\u94FE\u63A5",(n=e.startElement)==null?void 0:n.url);t&&r.executeEditHyperlink(t)}}],{IMAGE:{CHANGE:Jm,SAVE_AS:zm,TEXT_WRAP:$m,TEXT_WRAP_EMBED:jm,TEXT_WRAP_UP_DOWN:qm,TEXT_WRAP_FLOAT_TOP:ev,TEXT_WRAP_FLOAT_BOTTOM:tv}}=Fo,rv=[{key:Jm,i18nPath:"contextmenu.image.change",icon:"image-change",when:r=>{var e;return!r.isReadonly&&!r.editorHasSelection&&((e=r.startElement)==null?void 0:e.type)===ae.IMAGE},callback:r=>{const e=document.createElement("input");e.type="file",e.accept=".png, .jpg, .jpeg",e.onchange=()=>{const t=e.files[0],n=new FileReader;n.readAsDataURL(t),n.onload=()=>{const i=n.result;r.executeReplaceImageElement(i)}},e.click()}},{key:zm,i18nPath:"contextmenu.image.saveAs",icon:"image",when:r=>{var e;return!r.editorHasSelection&&((e=r.startElement)==null?void 0:e.type)===ae.IMAGE},callback:r=>{r.executeSaveAsImageElement()}},{key:$m,i18nPath:"contextmenu.image.textWrap",when:r=>{var e;return!r.isReadonly&&!r.editorHasSelection&&((e=r.startElement)==null?void 0:e.type)===ae.IMAGE},childMenus:[{key:jm,i18nPath:"contextmenu.image.textWrapType.embed",when:()=>!0,callback:(r,e)=>{r.executeChangeImageDisplay(e.startElement,ze.BLOCK)}},{key:qm,i18nPath:"contextmenu.image.textWrapType.upDown",when:()=>!0,callback:(r,e)=>{r.executeChangeImageDisplay(e.startElement,ze.INLINE)}},{key:ev,i18nPath:"contextmenu.image.textWrapType.floatTop",when:()=>!0,callback:(r,e)=>{r.executeChangeImageDisplay(e.startElement,ze.FLOAT_TOP)}},{key:tv,i18nPath:"contextmenu.image.textWrapType.floatBottom",when:()=>!0,callback:(r,e)=>{r.executeChangeImageDisplay(e.startElement,ze.FLOAT_BOTTOM)}}]}],{TABLE:{BORDER:nv,BORDER_ALL:iv,BORDER_EMPTY:ov,BORDER_EXTERNAL:av,BORDER_TD:sv,BORDER_TD_TOP:lv,BORDER_TD_LEFT:cv,BORDER_TD_BOTTOM:uv,BORDER_TD_RIGHT:hv,BORDER_TD_BACK:fv,BORDER_TD_FORWARD:dv,VERTICAL_ALIGN:pv,VERTICAL_ALIGN_TOP:gv,VERTICAL_ALIGN_MIDDLE:Rv,VERTICAL_ALIGN_BOTTOM:mv,INSERT_ROW_COL:vv,INSERT_TOP_ROW:yv,INSERT_BOTTOM_ROW:wv,INSERT_LEFT_COL:Sv,INSERT_RIGHT_COL:xv,DELETE_ROW_COL:bv,DELETE_ROW:Ov,DELETE_COL:Tv,DELETE_TABLE:Pv,MERGE_CELL:Ev,CANCEL_MERGE_CELL:_v}}=Fo,Iv=[{isDivider:!0},{key:nv,i18nPath:"contextmenu.table.border",icon:"border-all",when:r=>!r.isReadonly&&r.isInTable,childMenus:[{key:iv,i18nPath:"contextmenu.table.borderAll",icon:"border-all",when:()=>!0,callback:r=>{r.executeTableBorderType(hn.ALL)}},{key:ov,i18nPath:"contextmenu.table.borderEmpty",icon:"border-empty",when:()=>!0,callback:r=>{r.executeTableBorderType(hn.EMPTY)}},{key:av,i18nPath:"contextmenu.table.borderExternal",icon:"border-external",when:()=>!0,callback:r=>{r.executeTableBorderType(hn.EXTERNAL)}},{key:sv,i18nPath:"contextmenu.table.borderTd",icon:"border-td",when:()=>!0,childMenus:[{key:lv,i18nPath:"contextmenu.table.borderTdTop",icon:"border-td-top",when:()=>!0,callback:r=>{r.executeTableTdBorderType(Mr.TOP)}},{key:hv,i18nPath:"contextmenu.table.borderTdRight",icon:"border-td-right",when:()=>!0,callback:r=>{r.executeTableTdBorderType(Mr.RIGHT)}},{key:uv,i18nPath:"contextmenu.table.borderTdBottom",icon:"border-td-bottom",when:()=>!0,callback:r=>{r.executeTableTdBorderType(Mr.BOTTOM)}},{key:cv,i18nPath:"contextmenu.table.borderTdLeft",icon:"border-td-left",when:()=>!0,callback:r=>{r.executeTableTdBorderType(Mr.LEFT)}},{key:dv,i18nPath:"contextmenu.table.borderTdForward",icon:"border-td-forward",when:()=>!0,callback:r=>{r.executeTableTdSlashType(_o.FORWARD)}},{key:fv,i18nPath:"contextmenu.table.borderTdBack",icon:"border-td-back",when:()=>!0,callback:r=>{r.executeTableTdSlashType(_o.BACK)}}]}]},{key:pv,i18nPath:"contextmenu.table.verticalAlign",icon:"vertical-align",when:r=>!r.isReadonly&&r.isInTable,childMenus:[{key:gv,i18nPath:"contextmenu.table.verticalAlignTop",icon:"vertical-align-top",when:()=>!0,callback:r=>{r.executeTableTdVerticalAlign(Fn.TOP)}},{key:Rv,i18nPath:"contextmenu.table.verticalAlignMiddle",icon:"vertical-align-middle",when:()=>!0,callback:r=>{r.executeTableTdVerticalAlign(Fn.MIDDLE)}},{key:mv,i18nPath:"contextmenu.table.verticalAlignBottom",icon:"vertical-align-bottom",when:()=>!0,callback:r=>{r.executeTableTdVerticalAlign(Fn.BOTTOM)}}]},{key:vv,i18nPath:"contextmenu.table.insertRowCol",icon:"insert-row-col",when:r=>!r.isReadonly&&r.isInTable,childMenus:[{key:yv,i18nPath:"contextmenu.table.insertTopRow",icon:"insert-top-row",when:()=>!0,callback:r=>{r.executeInsertTableTopRow()}},{key:wv,i18nPath:"contextmenu.table.insertBottomRow",icon:"insert-bottom-row",when:()=>!0,callback:r=>{r.executeInsertTableBottomRow()}},{key:Sv,i18nPath:"contextmenu.table.insertLeftCol",icon:"insert-left-col",when:()=>!0,callback:r=>{r.executeInsertTableLeftCol()}},{key:xv,i18nPath:"contextmenu.table.insertRightCol",icon:"insert-right-col",when:()=>!0,callback:r=>{r.executeInsertTableRightCol()}}]},{key:bv,i18nPath:"contextmenu.table.deleteRowCol",icon:"delete-row-col",when:r=>!r.isReadonly&&r.isInTable,childMenus:[{key:Ov,i18nPath:"contextmenu.table.deleteRow",icon:"delete-row",when:()=>!0,callback:r=>{r.executeDeleteTableRow()}},{key:Tv,i18nPath:"contextmenu.table.deleteCol",icon:"delete-col",when:()=>!0,callback:r=>{r.executeDeleteTableCol()}},{key:Pv,i18nPath:"contextmenu.table.deleteTable",icon:"delete-table",when:()=>!0,callback:r=>{r.executeDeleteTable()}}]},{key:Ev,i18nPath:"contextmenu.table.mergeCell",icon:"merge-cell",when:r=>!r.isReadonly&&r.isCrossRowCol,callback:r=>{r.executeMergeTableCell()}},{key:_v,i18nPath:"contextmenu.table.mergeCancelCell",icon:"merge-cancel-cell",when:r=>!r.isReadonly&&r.isInTable,callback:r=>{r.executeCancelMergeTableCell()}}];class Nv{constructor(e,t){this._proxyContextMenuEvent=n=>{this.context=this._getContext();const i=this._filterMenuList(this.contextMenuList);i.some(a=>!a.isDivider)&&(this.dispose(),this._render({contextMenuList:i,left:n.x,top:n.y})),n.preventDefault()},this._handleSideEffect=n=>{if(this.contextMenuContainerList.length){const i=(n==null?void 0:n.composedPath()[0])||n.target;Na(i,a=>!!a&&a.nodeType===1&&a.getAttribute(fn)===pn.CONTEXTMENU,!0)||this.dispose()}},this.options=e.getOptions(),this.draw=e,this.command=t,this.range=e.getRange(),this.position=e.getPosition(),this.i18n=e.getI18n(),this.container=e.getContainer(),this.context=null,this.contextMenuList=[...Qm,...Iv,...rv,...Um,...Gm],this.contextMenuContainerList=[],this.contextMenuRelationShip=new Map,this._addEvent()}getContextMenuList(){return this.contextMenuList}_addEvent(){this.container.addEventListener("contextmenu",this._proxyContextMenuEvent),document.addEventListener("mousedown",this._handleSideEffect)}removeEvent(){this.container.removeEventListener("contextmenu",this._proxyContextMenuEvent),document.removeEventListener("mousedown",this._handleSideEffect)}_filterMenuList(e){var i;const{contextMenuDisableKeys:t}=this.options,n=[];for(let o=0;o!_.isDivider)&&(x.classList.add(`${Fe}-contextmenu-sub-item`),x.onmouseenter=()=>{this._setHoverStatus(x,!0),this._removeSubMenu(a);const _=x.getBoundingClientRect(),Q=_.left+_.width,te=_.top;l=this._render({contextMenuList:D,left:Q,top:te,parentMenuContainer:a})},x.onmouseleave=_=>{(!l||!l.contains(_.relatedTarget))&&this._setHoverStatus(x,!1)})}else x.onmouseenter=()=>{this._setHoverStatus(x,!0),this._removeSubMenu(a)},x.onmouseleave=()=>{this._setHoverStatus(x,!1)},x.onclick=()=>{m.callback&&this.context&&m.callback(this.command,this.context),this.dispose()};const T=document.createElement("i");x.append(T),m.icon&&T.classList.add(`${Fe}-contextmenu-${m.icon}`);const P=document.createElement("span"),A=m.i18nPath?this._formatName(this.i18n.t(m.i18nPath)):this._formatName(m.name||"");if(P.append(document.createTextNode(A)),x.append(P),m.shortCut){const D=document.createElement("span");D.classList.add(`${Fe}-shortcut`),D.append(document.createTextNode(m.shortCut)),x.append(D)}s.append(x)}}a.append(s),a.style.display="block";const c=window.innerWidth,u=a.getBoundingClientRect(),h=u.width,d=n+h>c?n-h:n;a.style.left=`${d}px`;const f=window.innerHeight,p=u.height,g=i+p>f?i-p:i;return a.style.top=`${g}px`,this.contextMenuContainerList.push(a),a}_removeSubMenu(e){const t=this.contextMenuRelationShip.get(e);t&&(this._removeSubMenu(t),t.remove(),this.contextMenuRelationShip.delete(e))}_setHoverStatus(e,t){var n;t?((n=e.parentNode)==null||n.querySelectorAll(`${Fe}-contextmenu-item`).forEach(i=>i.classList.remove("hover")),e.classList.add("hover")):e.classList.remove("hover")}_formatName(e){const t=Object.values(nh),n=new RegExp(`${t.join("|")}`);let i=e;if(n.test(i)){const o=new RegExp(nh.SELECTED_TEXT,"g");if(o.test(i)){const a=this.range.toString();i=i.replace(o,a)}}return i}registerContextMenuList(e){this.contextMenuList.push(...e)}dispose(){this.contextMenuContainerList.forEach(e=>e.remove()),this.contextMenuContainerList=[],this.contextMenuRelationShip.clear()}}const Mv=[{key:Ce.X,ctrl:!0,shift:!0,callback:r=>{r.executeStrikeout()}},{key:Ce.LEFT_BRACKET,mod:!0,callback:r=>{r.executeSizeAdd()}},{key:Ce.RIGHT_BRACKET,mod:!0,callback:r=>{r.executeSizeMinus()}},{key:Ce.B,mod:!0,callback:r=>{r.executeBold()}},{key:Ce.I,mod:!0,callback:r=>{r.executeItalic()}},{key:Ce.U,mod:!0,callback:r=>{r.executeUnderline()}},{key:Gn?Ce.COMMA:Ce.RIGHT_ANGLE_BRACKET,mod:!0,shift:!0,callback:r=>{r.executeSuperscript()}},{key:Gn?Ce.PERIOD:Ce.LEFT_ANGLE_BRACKET,mod:!0,shift:!0,callback:r=>{r.executeSubscript()}},{key:Ce.L,mod:!0,callback:r=>{r.executeRowFlex(Ge.LEFT)}},{key:Ce.E,mod:!0,callback:r=>{r.executeRowFlex(Ge.CENTER)}},{key:Ce.R,mod:!0,callback:r=>{r.executeRowFlex(Ge.RIGHT)}},{key:Ce.J,mod:!0,callback:r=>{r.executeRowFlex(Ge.ALIGNMENT)}},{key:Ce.J,mod:!0,shift:!0,callback:r=>{r.executeRowFlex(Ge.JUSTIFY)}}],Lv=[{key:Ce.ZERO,alt:!0,ctrl:!0,callback:r=>{r.executeTitle(null)}},{key:Ce.ONE,alt:!0,ctrl:!0,callback:r=>{r.executeTitle(tt.FIRST)}},{key:Ce.TWO,alt:!0,ctrl:!0,callback:r=>{r.executeTitle(tt.SECOND)}},{key:Ce.THREE,alt:!0,ctrl:!0,callback:r=>{r.executeTitle(tt.THIRD)}},{key:Ce.FOUR,alt:!0,ctrl:!0,callback:r=>{r.executeTitle(tt.FOURTH)}},{key:Ce.FIVE,alt:!0,ctrl:!0,callback:r=>{r.executeTitle(tt.FIFTH)}},{key:Ce.SIX,alt:!0,ctrl:!0,callback:r=>{r.executeTitle(tt.SIXTH)}}],Fv=[{key:Ce.I,shift:!0,mod:!0,callback:r=>{r.executeList(dn.UL,Er.DISC)}},{key:Ce.U,shift:!0,mod:!0,callback:r=>{r.executeList(dn.OL)}}];class Cv{constructor(e,t){this._globalKeydown=i=>{!this.globalShortcutList.length||this._execute(i,this.globalShortcutList)},this.command=t,this.globalShortcutList=[],this.agentShortcutList=[],this._addShortcutList([...Mv,...Lv,...Fv]),this._addEvent(),e.getCursor().getAgentDom().addEventListener("keydown",this._agentKeydown.bind(this))}_addEvent(){document.addEventListener("keydown",this._globalKeydown)}removeEvent(){document.removeEventListener("keydown",this._globalKeydown)}_addShortcutList(e){for(let t=e.length-1;t>=0;t--){const n=e[t];n.isGlobal?this.globalShortcutList.unshift(n):this.agentShortcutList.unshift(n)}}registerShortcutList(e){this._addShortcutList(e)}_agentKeydown(e){!this.agentShortcutList.length||this._execute(e,this.agentShortcutList)}_execute(e,t){var n;for(let i=0;ii(t))}}off(e,t){if(!e||typeof t!="function")return;const n=this.eventHub.get(e);!n||n.delete(t)}isSubscribe(e){const t=this.eventHub.get(e);return!!t&&t.size>0}}class Xv{}class Uv{constructor(e,t,n={}){const i=i0(n);t=gt(t);let o=[],a=[],s=[];Array.isArray(t)?a=t:(o=t.header||[],a=t.main,s=t.footer||[]),[o,a,s].forEach(f=>{Nr(f,{editorOptions:i})}),this.listener=new Am,this.eventBus=new Dv,this.override=new Xv;const c=new vm(e,i,{header:o,main:a,footer:s},this.listener,this.eventBus,this.override);this.command=new ym(new Cm(c));const u=new Nv(c,this.command),h=new Cv(c,this.command);this.register=new Dm({contextMenu:u,shortcut:h,i18n:c.getI18n()}),this.destroy=()=>{c.destroy(),h.removeEvent(),u.removeEvent()};const d=new Av(this);this.use=d.use.bind(d)}}class zt{constructor(e){this.options=e,this.mask=null,this.container=null,this.inputList=[],this._render()}_render(){var v;const{title:e,data:t,onClose:n,onCancel:i,onConfirm:o}=this.options,a=document.createElement("div");a.classList.add("dialog-mask"),a.setAttribute(fn,pn.COMPONENT),document.body.append(a);const s=document.createElement("div");s.classList.add("dialog-container"),s.setAttribute(fn,pn.COMPONENT);const l=document.createElement("div");l.classList.add("dialog"),s.append(l);const c=document.createElement("div");c.classList.add("dialog-title");const u=document.createElement("span");u.append(document.createTextNode(e));const h=document.createElement("i");h.onclick=()=>{n&&n(),this._dispose()},c.append(u),c.append(h),l.append(c);const d=document.createElement("div");d.classList.add("dialog-option");for(let R=0;R{const A=document.createElement("option");A.value=P.value,A.label=P.label,T.append(A)})):m.type==="textarea"?T=document.createElement("textarea"):(T=document.createElement("input"),T.type=m.type),m.width&&(T.style.width=`${m.width}px`),m.height&&(T.style.height=`${m.height}px`),T.name=m.name,T.value=m.value||"",T instanceof HTMLSelectElement||(T.placeholder=m.placeholder||""),x.append(T),d.append(x),this.inputList.push(T)}l.append(d);const f=document.createElement("div");f.classList.add("dialog-menu");const p=document.createElement("button");p.classList.add("dialog-menu__cancel"),p.append(document.createTextNode("\u53D6\u6D88")),p.type="button",p.onclick=()=>{i&&i(),this._dispose()},f.append(p);const g=document.createElement("button");g.append(document.createTextNode("\u786E\u5B9A")),g.type="submit",g.onclick=()=>{if(o){const R=this.inputList.map(m=>({name:m.name,value:m.value}));o(R)}this._dispose()},f.append(g),l.append(f),document.body.append(s),this.container=s,this.mask=a}_dispose(){var e,t;(e=this.mask)==null||e.remove(),(t=this.container)==null||t.remove()}}function Wv(r){switch(r){case"comment":case"prolog":case"doctype":case"cdata":return{color:"#008000",italic:!0};case"namespace":return{opacity:.7};case"string":return{color:"#A31515"};case"punctuation":case"operator":return{color:"#393A34"};case"url":case"symbol":case"number":case"boolean":case"variable":case"constant":case"inserted":return{color:"#36acaa"};case"atrule":case"keyword":case"attr-value":return{color:"#0000ff"};case"function":return{color:"#b9a40a"};case"deleted":case"tag":return{color:"#9a050f"};case"selector":return{color:"#00009f"};case"important":return{color:"#e90",bold:!0};case"italic":return{italic:!0};case"class-name":case"property":return{color:"#2B91AF"};case"attr-name":case"regex":case"entity":return{color:"#ff0000"};default:return null}}function Vv(r){const e=[];function t(n){for(let i=0;i{e&&e(),this._dispose()},s.append(l),s.append(c),a.append(s);const u=document.createElement("div");u.classList.add("signature-operation");const h=document.createElement("div");h.classList.add("signature-operation__undo");const d=document.createElement("i"),f=document.createElement("span");f.innerText="\u64A4\u9500",h.append(d),h.append(f),u.append(h);const p=document.createElement("div");p.classList.add("signature-operation__trash");const g=document.createElement("i"),v=document.createElement("span");v.innerText="\u6E05\u7A7A",p.append(g),p.append(v),u.append(p),a.append(u);const R=document.createElement("div");R.classList.add("signature-canvas");const m=document.createElement("canvas");m.width=this.canvasWidth,m.height=this.canvasHeight,m.style.width=`${this.canvasWidth/this.dpr}px`,m.style.height=`${this.canvasHeight/this.dpr}px`,R.append(m),a.append(R);const x=document.createElement("div");x.classList.add("signature-menu");const T=document.createElement("button");T.classList.add("signature-menu__cancel"),T.append(document.createTextNode("\u53D6\u6D88")),T.type="button",T.onclick=()=>{t&&t(),this._dispose()},x.append(T);const P=document.createElement("button");return P.append(document.createTextNode("\u786E\u5B9A")),P.type="submit",P.onclick=()=>{n&&n(this._toData()),this._dispose()},x.append(P),a.append(x),document.body.append(o),this.container=o,this.mask=i,{mask:i,canvas:m,container:o,trashContainer:p,undoContainer:h}}_bindEvent(){this.trashContainer.onclick=this._clearCanvas.bind(this),this.undoContainer.onclick=this._undo.bind(this),this.canvas.onmousedown=this._startDraw.bind(this),this.canvas.onmousemove=this._draw.bind(this),this.container.onmouseup=this._stopDraw.bind(this)}_undo(){this.undoStack.length>1&&(this.undoStack.pop(),this.undoStack.length&&this.undoStack[this.undoStack.length-1]())}_saveUndoFn(e){for(this.undoStack.push(e);this.undoStack.length>this.MAX_RECORD_COUNT;)this.undoStack.shift()}_clearUndoFn(){const e=()=>{this.ctx.clearRect(0,0,this.canvasWidth,this.canvasHeight)};this.undoStack=[e]}_clearCanvas(){this._clearUndoFn(),this.ctx.clearRect(0,0,this.canvasWidth,this.canvasHeight)}_startDraw(e){this.isDrawing=!0,this.x=e.offsetX,this.y=e.offsetY,this.ctx.lineWidth=1}_draw(e){if(!this.isDrawing)return;const t=performance.now(),i=Math.sqrt(e.movementX**2+e.movementY**2)/(t-this.preTimeStamp),a=Math.min(5,Math.max(1,5-i*3)),s=.2;this.ctx.lineWidth=this.ctx.lineWidth*(1-s)+a*s;const{offsetX:l,offsetY:c}=e;this.ctx.beginPath(),this.ctx.moveTo(this.x,this.y),this.ctx.lineTo(l,c),this.ctx.stroke(),this.x=l,this.y=c,this.linePoints.push([l,c]),this.isDrawn=!0,this.preTimeStamp=t}_stopDraw(){if(this.isDrawing=!1,this.isDrawn){const e=this.ctx.getImageData(0,0,this.canvasWidth,this.canvasHeight),t=this;this._saveUndoFn(function(){t.ctx.clearRect(0,0,t.canvasWidth,t.canvasHeight),t.ctx.putImageData(e,0,0)}),this.isDrawn=!1}}_toData(){if(!this.linePoints.length)return null;const e=this.linePoints[0][0],t=this.linePoints[0][1];let n=e,i=t,o=e,a=t;for(let p=0;pg[0]&&(n=g[0]),og[1]&&(i=g[1]),a{r.apply(this,n)},e)}}function Zv(r,e){if(!e){r.scrollTop=0;return}const t=[];let n=e.offsetParent;for(;n&&r!==n&&r.contains(n);)t.push(n),n=n.offsetParent;const i=e.offsetTop+t.reduce((l,c)=>l+c.offsetTop,0),o=i+e.offsetHeight,a=r.scrollTop,s=a+r.clientHeight;is&&(r.scrollTop=o-r.clientHeight)}function ih(r){(window.requestIdleCallback||window.setTimeout)(()=>{r()})}var o0={exports:{}},a0={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},s0={exports:{}},Qv=function(e){return!e||typeof e=="string"?!1:e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&e.constructor.name!=="String")},Kv=Qv,Hv=Array.prototype.concat,Bv=Array.prototype.slice,oh=s0.exports=function(e){for(var t=[],n=0,i=e.length;n=4&&r[3]!==1&&(e=", "+r[3]),"hwb("+r[0]+", "+r[1]+"%, "+r[2]+"%"+e+")"};Lr.to.keyword=function(r){return c0[r.slice(0,3)]};function Cn(r,e,t){return Math.min(Math.max(e,r),t)}function $o(r){var e=Math.round(r).toString(16).toUpperCase();return e.length<2?"0"+e:e}const No=a0,u0={};for(const r of Object.keys(No))u0[No[r]]=r;const Le={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};var h0=Le;for(const r of Object.keys(Le)){if(!("channels"in Le[r]))throw new Error("missing channels property: "+r);if(!("labels"in Le[r]))throw new Error("missing channel labels property: "+r);if(Le[r].labels.length!==Le[r].channels)throw new Error("channel and label counts mismatch: "+r);const{channels:e,labels:t}=Le[r];delete Le[r].channels,delete Le[r].labels,Object.defineProperty(Le[r],"channels",{value:e}),Object.defineProperty(Le[r],"labels",{value:t})}Le.rgb.hsl=function(r){const e=r[0]/255,t=r[1]/255,n=r[2]/255,i=Math.min(e,t,n),o=Math.max(e,t,n),a=o-i;let s,l;o===i?s=0:e===o?s=(t-n)/a:t===o?s=2+(n-e)/a:n===o&&(s=4+(e-t)/a),s=Math.min(s*60,360),s<0&&(s+=360);const c=(i+o)/2;return o===i?l=0:c<=.5?l=a/(o+i):l=a/(2-o-i),[s,l*100,c*100]};Le.rgb.hsv=function(r){let e,t,n,i,o;const a=r[0]/255,s=r[1]/255,l=r[2]/255,c=Math.max(a,s,l),u=c-Math.min(a,s,l),h=function(d){return(c-d)/6/u+1/2};return u===0?(i=0,o=0):(o=u/c,e=h(a),t=h(s),n=h(l),a===c?i=n-t:s===c?i=1/3+e-n:l===c&&(i=2/3+t-e),i<0?i+=1:i>1&&(i-=1)),[i*360,o*100,c*100]};Le.rgb.hwb=function(r){const e=r[0],t=r[1];let n=r[2];const i=Le.rgb.hsl(r)[0],o=1/255*Math.min(e,Math.min(t,n));return n=1-1/255*Math.max(e,Math.max(t,n)),[i,o*100,n*100]};Le.rgb.cmyk=function(r){const e=r[0]/255,t=r[1]/255,n=r[2]/255,i=Math.min(1-e,1-t,1-n),o=(1-e-i)/(1-i)||0,a=(1-t-i)/(1-i)||0,s=(1-n-i)/(1-i)||0;return[o*100,a*100,s*100,i*100]};function Gv(r,e){return(r[0]-e[0])**2+(r[1]-e[1])**2+(r[2]-e[2])**2}Le.rgb.keyword=function(r){const e=u0[r];if(e)return e;let t=1/0,n;for(const i of Object.keys(No)){const o=No[i],a=Gv(r,o);a.04045?((e+.055)/1.055)**2.4:e/12.92,t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;const i=e*.4124+t*.3576+n*.1805,o=e*.2126+t*.7152+n*.0722,a=e*.0193+t*.1192+n*.9505;return[i*100,o*100,a*100]};Le.rgb.lab=function(r){const e=Le.rgb.xyz(r);let t=e[0],n=e[1],i=e[2];t/=95.047,n/=100,i/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;const o=116*n-16,a=500*(t-n),s=200*(n-i);return[o,a,s]};Le.hsl.rgb=function(r){const e=r[0]/360,t=r[1]/100,n=r[2]/100;let i,o,a;if(t===0)return a=n*255,[a,a,a];n<.5?i=n*(1+t):i=n+t-n*t;const s=2*n-i,l=[0,0,0];for(let c=0;c<3;c++)o=e+1/3*-(c-1),o<0&&o++,o>1&&o--,6*o<1?a=s+(i-s)*6*o:2*o<1?a=i:3*o<2?a=s+(i-s)*(2/3-o)*6:a=s,l[c]=a*255;return l};Le.hsl.hsv=function(r){const e=r[0];let t=r[1]/100,n=r[2]/100,i=t;const o=Math.max(n,.01);n*=2,t*=n<=1?n:2-n,i*=o<=1?o:2-o;const a=(n+t)/2,s=n===0?2*i/(o+i):2*t/(n+t);return[e,s*100,a*100]};Le.hsv.rgb=function(r){const e=r[0]/60,t=r[1]/100;let n=r[2]/100;const i=Math.floor(e)%6,o=e-Math.floor(e),a=255*n*(1-t),s=255*n*(1-t*o),l=255*n*(1-t*(1-o));switch(n*=255,i){case 0:return[n,l,a];case 1:return[s,n,a];case 2:return[a,n,l];case 3:return[a,s,n];case 4:return[l,a,n];case 5:return[n,a,s]}};Le.hsv.hsl=function(r){const e=r[0],t=r[1]/100,n=r[2]/100,i=Math.max(n,.01);let o,a;a=(2-t)*n;const s=(2-t)*i;return o=t*i,o/=s<=1?s:2-s,o=o||0,a/=2,[e,o*100,a*100]};Le.hwb.rgb=function(r){const e=r[0]/360;let t=r[1]/100,n=r[2]/100;const i=t+n;let o;i>1&&(t/=i,n/=i);const a=Math.floor(6*e),s=1-n;o=6*e-a,(a&1)!==0&&(o=1-o);const l=t+o*(s-t);let c,u,h;switch(a){default:case 6:case 0:c=s,u=l,h=t;break;case 1:c=l,u=s,h=t;break;case 2:c=t,u=s,h=l;break;case 3:c=t,u=l,h=s;break;case 4:c=l,u=t,h=s;break;case 5:c=s,u=t,h=l;break}return[c*255,u*255,h*255]};Le.cmyk.rgb=function(r){const e=r[0]/100,t=r[1]/100,n=r[2]/100,i=r[3]/100,o=1-Math.min(1,e*(1-i)+i),a=1-Math.min(1,t*(1-i)+i),s=1-Math.min(1,n*(1-i)+i);return[o*255,a*255,s*255]};Le.xyz.rgb=function(r){const e=r[0]/100,t=r[1]/100,n=r[2]/100;let i,o,a;return i=e*3.2406+t*-1.5372+n*-.4986,o=e*-.9689+t*1.8758+n*.0415,a=e*.0557+t*-.204+n*1.057,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92,i=Math.min(Math.max(0,i),1),o=Math.min(Math.max(0,o),1),a=Math.min(Math.max(0,a),1),[i*255,o*255,a*255]};Le.xyz.lab=function(r){let e=r[0],t=r[1],n=r[2];e/=95.047,t/=100,n/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;const i=116*t-16,o=500*(e-t),a=200*(t-n);return[i,o,a]};Le.lab.xyz=function(r){const e=r[0],t=r[1],n=r[2];let i,o,a;o=(e+16)/116,i=t/500+o,a=o-n/200;const s=o**3,l=i**3,c=a**3;return o=s>.008856?s:(o-16/116)/7.787,i=l>.008856?l:(i-16/116)/7.787,a=c>.008856?c:(a-16/116)/7.787,i*=95.047,o*=100,a*=108.883,[i,o,a]};Le.lab.lch=function(r){const e=r[0],t=r[1],n=r[2];let i;i=Math.atan2(n,t)*360/2/Math.PI,i<0&&(i+=360);const a=Math.sqrt(t*t+n*n);return[e,a,i]};Le.lch.lab=function(r){const e=r[0],t=r[1],i=r[2]/360*2*Math.PI,o=t*Math.cos(i),a=t*Math.sin(i);return[e,o,a]};Le.rgb.ansi16=function(r,e=null){const[t,n,i]=r;let o=e===null?Le.rgb.hsv(r)[2]:e;if(o=Math.round(o/50),o===0)return 30;let a=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(t/255));return o===2&&(a+=60),a};Le.hsv.ansi16=function(r){return Le.rgb.ansi16(Le.hsv.rgb(r),r[2])};Le.rgb.ansi256=function(r){const e=r[0],t=r[1],n=r[2];return e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5)};Le.ansi16.rgb=function(r){let e=r%10;if(e===0||e===7)return r>50&&(e+=3.5),e=e/10.5*255,[e,e,e];const t=(~~(r>50)+1)*.5,n=(e&1)*t*255,i=(e>>1&1)*t*255,o=(e>>2&1)*t*255;return[n,i,o]};Le.ansi256.rgb=function(r){if(r>=232){const o=(r-232)*10+8;return[o,o,o]}r-=16;let e;const t=Math.floor(r/36)/5*255,n=Math.floor((e=r%36)/6)/5*255,i=e%6/5*255;return[t,n,i]};Le.rgb.hex=function(r){const t=(((Math.round(r[0])&255)<<16)+((Math.round(r[1])&255)<<8)+(Math.round(r[2])&255)).toString(16).toUpperCase();return"000000".substring(t.length)+t};Le.hex.rgb=function(r){const e=r.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let t=e[0];e[0].length===3&&(t=t.split("").map(s=>s+s).join(""));const n=parseInt(t,16),i=n>>16&255,o=n>>8&255,a=n&255;return[i,o,a]};Le.rgb.hcg=function(r){const e=r[0]/255,t=r[1]/255,n=r[2]/255,i=Math.max(Math.max(e,t),n),o=Math.min(Math.min(e,t),n),a=i-o;let s,l;return a<1?s=o/(1-a):s=0,a<=0?l=0:i===e?l=(t-n)/a%6:i===t?l=2+(n-e)/a:l=4+(e-t)/a,l/=6,l%=1,[l*360,a*100,s*100]};Le.hsl.hcg=function(r){const e=r[1]/100,t=r[2]/100,n=t<.5?2*e*t:2*e*(1-t);let i=0;return n<1&&(i=(t-.5*n)/(1-n)),[r[0],n*100,i*100]};Le.hsv.hcg=function(r){const e=r[1]/100,t=r[2]/100,n=e*t;let i=0;return n<1&&(i=(t-n)/(1-n)),[r[0],n*100,i*100]};Le.hcg.rgb=function(r){const e=r[0]/360,t=r[1]/100,n=r[2]/100;if(t===0)return[n*255,n*255,n*255];const i=[0,0,0],o=e%1*6,a=o%1,s=1-a;let l=0;switch(Math.floor(o)){case 0:i[0]=1,i[1]=a,i[2]=0;break;case 1:i[0]=s,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=a;break;case 3:i[0]=0,i[1]=s,i[2]=1;break;case 4:i[0]=a,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=s}return l=(1-t)*n,[(t*i[0]+l)*255,(t*i[1]+l)*255,(t*i[2]+l)*255]};Le.hcg.hsv=function(r){const e=r[1]/100,t=r[2]/100,n=e+t*(1-e);let i=0;return n>0&&(i=e/n),[r[0],i*100,n*100]};Le.hcg.hsl=function(r){const e=r[1]/100,n=r[2]/100*(1-e)+.5*e;let i=0;return n>0&&n<.5?i=e/(2*n):n>=.5&&n<1&&(i=e/(2*(1-n))),[r[0],i*100,n*100]};Le.hcg.hwb=function(r){const e=r[1]/100,t=r[2]/100,n=e+t*(1-e);return[r[0],(n-e)*100,(1-n)*100]};Le.hwb.hcg=function(r){const e=r[1]/100,t=r[2]/100,n=1-t,i=n-e;let o=0;return i<1&&(o=(n-i)/(1-i)),[r[0],i*100,o*100]};Le.apple.rgb=function(r){return[r[0]/65535*255,r[1]/65535*255,r[2]/65535*255]};Le.rgb.apple=function(r){return[r[0]/255*65535,r[1]/255*65535,r[2]/255*65535]};Le.gray.rgb=function(r){return[r[0]/100*255,r[0]/100*255,r[0]/100*255]};Le.gray.hsl=function(r){return[0,0,r[0]]};Le.gray.hsv=Le.gray.hsl;Le.gray.hwb=function(r){return[0,100,r[0]]};Le.gray.cmyk=function(r){return[0,0,0,r[0]]};Le.gray.lab=function(r){return[r[0],0,0]};Le.gray.hex=function(r){const e=Math.round(r[0]/100*255)&255,n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n};Le.rgb.gray=function(r){return[(r[0]+r[1]+r[2])/3/255*100]};const Aa=h0;function Jv(){const r={},e=Object.keys(Aa);for(let t=e.length,n=0;n1&&(t=n),r(t))};return"conversion"in r&&(e.conversion=r.conversion),e}function ny(r){const e=function(...t){const n=t[0];if(n==null)return n;n.length>1&&(t=n);const i=r(t);if(typeof i=="object")for(let o=i.length,a=0;a{vi[r]={},Object.defineProperty(vi[r],"channels",{value:kl[r].channels}),Object.defineProperty(vi[r],"labels",{value:kl[r].labels});const e=ey(r);Object.keys(e).forEach(n=>{const i=e[n];vi[r][n]=ny(i),vi[r][n].raw=ry(i)})});var iy=vi;const yi=o0.exports,_r=iy,f0=["keyword","gray","hex"],Zl={};for(const r of Object.keys(_r))Zl[[..._r[r].labels].sort().join("")]=r;const Da={};function qt(r,e){if(!(this instanceof qt))return new qt(r,e);if(e&&e in f0&&(e=null),e&&!(e in _r))throw new Error("Unknown model: "+e);let t,n;if(r==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(r instanceof qt)this.model=r.model,this.color=[...r.color],this.valpha=r.valpha;else if(typeof r=="string"){const i=yi.get(r);if(i===null)throw new Error("Unable to parse color from string: "+r);this.model=i.model,n=_r[this.model].channels,this.color=i.value.slice(0,n),this.valpha=typeof i.value[n]=="number"?i.value[n]:1}else if(r.length>0){this.model=e||"rgb",n=_r[this.model].channels;const i=Array.prototype.slice.call(r,0,n);this.color=Ql(i,n),this.valpha=typeof r[n]=="number"?r[n]:1}else if(typeof r=="number")this.model="rgb",this.color=[r>>16&255,r>>8&255,r&255],this.valpha=1;else{this.valpha=1;const i=Object.keys(r);"alpha"in r&&(i.splice(i.indexOf("alpha"),1),this.valpha=typeof r.alpha=="number"?r.alpha:0);const o=i.sort().join("");if(!(o in Zl))throw new Error("Unable to parse color from object: "+JSON.stringify(r));this.model=Zl[o];const{labels:a}=_r[this.model],s=[];for(t=0;t(r%360+360)%360),saturationl:Lt("hsl",1,kt(100)),lightness:Lt("hsl",2,kt(100)),saturationv:Lt("hsv",1,kt(100)),value:Lt("hsv",2,kt(100)),chroma:Lt("hcg",1,kt(100)),gray:Lt("hcg",2,kt(100)),white:Lt("hwb",1,kt(100)),wblack:Lt("hwb",2,kt(100)),cyan:Lt("cmyk",0,kt(100)),magenta:Lt("cmyk",1,kt(100)),yellow:Lt("cmyk",2,kt(100)),black:Lt("cmyk",3,kt(100)),x:Lt("xyz",0,kt(95.047)),y:Lt("xyz",1,kt(100)),z:Lt("xyz",2,kt(108.833)),l:Lt("lab",0,kt(100)),a:Lt("lab",1),b:Lt("lab",2),keyword(r){return r!==void 0?new qt(r):_r[this.model].keyword(this.color)},hex(r){return r!==void 0?new qt(r):yi.to.hex(this.rgb().round().color)},hexa(r){if(r!==void 0)return new qt(r);const e=this.rgb().round().color;let t=Math.round(this.valpha*255).toString(16).toUpperCase();return t.length===1&&(t="0"+t),yi.to.hex(e)+t},rgbNumber(){const r=this.rgb().color;return(r[0]&255)<<16|(r[1]&255)<<8|r[2]&255},luminosity(){const r=this.rgb().color,e=[];for(const[t,n]of r.entries()){const i=n/255;e[t]=i<=.04045?i/12.92:((i+.055)/1.055)**2.4}return .2126*e[0]+.7152*e[1]+.0722*e[2]},contrast(r){const e=this.luminosity(),t=r.luminosity();return e>t?(e+.05)/(t+.05):(t+.05)/(e+.05)},level(r){const e=this.contrast(r);return e>=7?"AAA":e>=4.5?"AA":""},isDark(){const r=this.rgb().color;return(r[0]*2126+r[1]*7152+r[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){const r=this.rgb();for(let e=0;e<3;e++)r.color[e]=255-r.color[e];return r},lighten(r){const e=this.hsl();return e.color[2]+=e.color[2]*r,e},darken(r){const e=this.hsl();return e.color[2]-=e.color[2]*r,e},saturate(r){const e=this.hsl();return e.color[1]+=e.color[1]*r,e},desaturate(r){const e=this.hsl();return e.color[1]-=e.color[1]*r,e},whiten(r){const e=this.hwb();return e.color[1]+=e.color[1]*r,e},blacken(r){const e=this.hwb();return e.color[2]+=e.color[2]*r,e},grayscale(){const r=this.rgb().color,e=r[0]*.3+r[1]*.59+r[2]*.11;return qt.rgb(e,e,e)},fade(r){return this.alpha(this.valpha-this.valpha*r)},opaquer(r){return this.alpha(this.valpha+this.valpha*r)},rotate(r){const e=this.hsl();let t=e.color[0];return t=(t+r)%360,t=t<0?360+t:t,e.color[0]=t,e},mix(r,e){if(!r||!r.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof r);const t=r.rgb(),n=this.rgb(),i=e===void 0?.5:e,o=2*i-1,a=t.alpha()-n.alpha(),s=((o*a===-1?o:(o+a)/(1+o*a))+1)/2,l=1-s;return qt.rgb(s*t.red()+l*n.red(),s*t.green()+l*n.green(),s*t.blue()+l*n.blue(),t.alpha()*i+n.alpha()*(1-i))}};for(const r of Object.keys(_r)){if(f0.includes(r))continue;const{channels:e}=_r[r];qt.prototype[r]=function(...t){return this.model===r?new qt(this):t.length>0?new qt(t,r):new qt([...sy(_r[this.model][r].raw(this.color)),this.valpha],r)},qt[r]=function(...t){let n=t[0];return typeof n=="number"&&(n=Ql(t,e)),new qt(n,r)}}function oy(r,e){return Number(r.toFixed(e))}function ay(r){return function(e){return oy(e,r)}}function Lt(r,e,t){r=Array.isArray(r)?r:[r];for(const n of r)(Da[n]||(Da[n]=[]))[e]=t;return r=r[0],function(n){let i;return n!==void 0?(t&&(n=t(n)),i=this[r](),i.color[e]=n,i):(i=this[r]().color[e],t&&(i=t(i)),i)}}function kt(r){return function(e){return Math.max(0,Math.min(r,e))}}function sy(r){return Array.isArray(r)?r:[r]}function Ql(r,e){for(let t=0;te in r?cy(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,$e=(r,e)=>{for(var t in e||(e={}))fy.call(e,t)&&Kl(r,t,e[t]);if(sh)for(var t of sh(e))dy.call(e,t)&&Kl(r,t,e[t]);return r},Di=(r,e)=>uy(r,hy(e)),pe=(r,e,t)=>(Kl(r,typeof e!="symbol"?e+"":e,t),t),jo=(r,e,t)=>new Promise((n,i)=>{var o=l=>{try{s(t.next(l))}catch(c){i(c)}},a=l=>{try{s(t.throw(l))}catch(c){i(c)}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(o,a);s((t=t.apply(r,e)).next())});class Xa{constructor(e){pe(this,"rootKey"),this.rootKey=e}}const py=Object.seal({});class de extends Xa{constructor(e){super(e),pe(this,"root"),this.root=new Array}prepForXml(e){var t;e.stack.push(this);const n=this.root.map(i=>i instanceof Xa?i.prepForXml(e):i).filter(i=>i!==void 0);return e.stack.pop(),{[this.rootKey]:n.length?n.length===1&&((t=n[0])==null?void 0:t._attr)?n[0]:n:py}}addChildElement(e){return this.root.push(e),this}}class xn extends de{prepForXml(e){const t=super.prepForXml(e);if(t&&(typeof t[this.rootKey]!="object"||Object.keys(t[this.rootKey]).length))return t}}class _e extends Xa{constructor(e){super("_attr"),pe(this,"xmlKeys"),this.root=e}prepForXml(e){const t={};return Object.keys(this.root).forEach(n=>{const i=this.root[n];if(i!==void 0){const o=this.xmlKeys&&this.xmlKeys[n]||n;t[o]=i}}),{_attr:t}}}class bn extends Xa{constructor(e){super("_attr"),this.root=e}prepForXml(e){return{_attr:Object.values(this.root).filter(({value:n})=>n!==void 0).reduce((n,{key:i,value:o})=>Di($e({},n),{[i]:o}),{})}}}class Ft extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{val:"w:val",color:"w:color",fill:"w:fill",space:"w:space",sz:"w:sz",type:"w:type",rsidR:"w:rsidR",rsidRPr:"w:rsidRPr",rsidSect:"w:rsidSect",w:"w:w",h:"w:h",top:"w:top",right:"w:right",bottom:"w:bottom",left:"w:left",header:"w:header",footer:"w:footer",gutter:"w:gutter",linePitch:"w:linePitch",pos:"w:pos"})}}var an=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function d0(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var p0={},bc={exports:{}},Ii=typeof Reflect=="object"?Reflect:null,lh=Ii&&typeof Ii.apply=="function"?Ii.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},wa;Ii&&typeof Ii.ownKeys=="function"?wa=Ii.ownKeys:Object.getOwnPropertySymbols?wa=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:wa=function(e){return Object.getOwnPropertyNames(e)};function gy(r){console&&console.warn&&console.warn(r)}var g0=Number.isNaN||function(e){return e!==e};function ht(){ht.init.call(this)}bc.exports=ht;bc.exports.once=yy;ht.EventEmitter=ht;ht.prototype._events=void 0;ht.prototype._eventsCount=0;ht.prototype._maxListeners=void 0;var ch=10;function Ga(r){if(typeof r!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)}Object.defineProperty(ht,"defaultMaxListeners",{enumerable:!0,get:function(){return ch},set:function(r){if(typeof r!="number"||r<0||g0(r))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");ch=r}});ht.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};ht.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||g0(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function R0(r){return r._maxListeners===void 0?ht.defaultMaxListeners:r._maxListeners}ht.prototype.getMaxListeners=function(){return R0(this)};ht.prototype.emit=function(e){for(var t=[],n=1;n0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var l=o[e];if(l===void 0)return!1;if(typeof l=="function")lh(l,this,t);else for(var c=l.length,u=S0(l,c),n=0;n0&&a.length>i&&!a.warned){a.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=r,s.type=e,s.count=a.length,gy(s)}return r}ht.prototype.addListener=function(e,t){return m0(this,e,t,!1)};ht.prototype.on=ht.prototype.addListener;ht.prototype.prependListener=function(e,t){return m0(this,e,t,!0)};function Ry(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function v0(r,e,t){var n={fired:!1,wrapFn:void 0,target:r,type:e,listener:t},i=Ry.bind(n);return i.listener=t,n.wrapFn=i,i}ht.prototype.once=function(e,t){return Ga(t),this.on(e,v0(this,e,t)),this};ht.prototype.prependOnceListener=function(e,t){return Ga(t),this.prependListener(e,v0(this,e,t)),this};ht.prototype.removeListener=function(e,t){var n,i,o,a,s;if(Ga(t),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||t));else if(typeof n!="function"){for(o=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){s=n[a].listener,o=a;break}if(o<0)return this;o===0?n.shift():my(n,o),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,s||t)}return this};ht.prototype.off=ht.prototype.removeListener;ht.prototype.removeAllListeners=function(e){var t,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var o=Object.keys(n),a;for(i=0;i=0;i--)this.removeListener(e,t[i]);return this};function y0(r,e,t){var n=r._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?t?[i.listener||i]:[i]:t?vy(i):S0(i,i.length)}ht.prototype.listeners=function(e){return y0(this,e,!0)};ht.prototype.rawListeners=function(e){return y0(this,e,!1)};ht.listenerCount=function(r,e){return typeof r.listenerCount=="function"?r.listenerCount(e):w0.call(r,e)};ht.prototype.listenerCount=w0;function w0(r){var e=this._events;if(e!==void 0){var t=e[r];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}ht.prototype.eventNames=function(){return this._eventsCount>0?wa(this._events):[]};function S0(r,e){for(var t=new Array(e),n=0;n1)for(var t=1;t0)throw new Error("Invalid string. Length must be a multiple of 4");var g=f.indexOf("=");g===-1&&(g=p);var v=g===p?0:4-g%4;return[g,v]}function s(f){var p=a(f),g=p[0],v=p[1];return(g+v)*3/4-v}function l(f,p,g){return(p+g)*3/4-g}function c(f){var p,g=a(f),v=g[0],R=g[1],m=new t(l(f,v,R)),x=0,T=R>0?v-4:v,P;for(P=0;P>16&255,m[x++]=p>>8&255,m[x++]=p&255;return R===2&&(p=e[f.charCodeAt(P)]<<2|e[f.charCodeAt(P+1)]>>4,m[x++]=p&255),R===1&&(p=e[f.charCodeAt(P)]<<10|e[f.charCodeAt(P+1)]<<4|e[f.charCodeAt(P+2)]>>2,m[x++]=p>>8&255,m[x++]=p&255),m}function u(f){return r[f>>18&63]+r[f>>12&63]+r[f>>6&63]+r[f&63]}function h(f,p,g){for(var v,R=[],m=p;mT?T:x+m));return v===1?(p=f[g-1],R.push(r[p>>2]+r[p<<4&63]+"==")):v===2&&(p=(f[g-2]<<8)+f[g-1],R.push(r[p>>10]+r[p>>4&63]+r[p<<2&63]+"=")),R.join("")}return no}var qo={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */var fh;function Py(){return fh||(fh=1,qo.read=function(r,e,t,n,i){var o,a,s=i*8-n-1,l=(1<>1,u=-7,h=t?i-1:0,d=t?-1:1,f=r[e+h];for(h+=d,o=f&(1<<-u)-1,f>>=-u,u+=s;u>0;o=o*256+r[e+h],h+=d,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=n;u>0;a=a*256+r[e+h],h+=d,u-=8);if(o===0)o=1-c;else{if(o===l)return a?NaN:(f?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-c}return(f?-1:1)*a*Math.pow(2,o-n)},qo.write=function(r,e,t,n,i,o){var a,s,l,c=o*8-i-1,u=(1<>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,p=n?1:-1,g=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+h>=1?e+=d/l:e+=d*Math.pow(2,1-h),e*l>=2&&(a++,l/=2),a+h>=u?(s=0,a=u):a+h>=1?(s=(e*l-1)*Math.pow(2,i),a=a+h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;r[t+f]=s&255,f+=p,s/=256,i-=8);for(a=a<0;r[t+f]=a&255,f+=p,a/=256,c-=8);r[t+f-p]|=g*128}),qo}/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */var dh;function Ja(){return dh||(dh=1,function(r){var e=Ty(),t=Py(),n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;r.Buffer=s,r.SlowBuffer=m,r.INSPECT_MAX_BYTES=50;var i=2147483647;r.kMaxLength=i,s.TYPED_ARRAY_SUPPORT=o(),!s.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function o(){try{var M=new Uint8Array(1),w={foo:function(){return 42}};return Object.setPrototypeOf(w,Uint8Array.prototype),Object.setPrototypeOf(M,w),M.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(!!s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(!!s.isBuffer(this))return this.byteOffset}});function a(M){if(M>i)throw new RangeError('The value "'+M+'" is invalid for option "size"');var w=new Uint8Array(M);return Object.setPrototypeOf(w,s.prototype),w}function s(M,w,S){if(typeof M=="number"){if(typeof w=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return h(M)}return l(M,w,S)}s.poolSize=8192;function l(M,w,S){if(typeof M=="string")return d(M,w);if(ArrayBuffer.isView(M))return p(M);if(M==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof M);if(ue(M,ArrayBuffer)||M&&ue(M.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(ue(M,SharedArrayBuffer)||M&&ue(M.buffer,SharedArrayBuffer)))return g(M,w,S);if(typeof M=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var E=M.valueOf&&M.valueOf();if(E!=null&&E!==M)return s.from(E,w,S);var K=v(M);if(K)return K;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof M[Symbol.toPrimitive]=="function")return s.from(M[Symbol.toPrimitive]("string"),w,S);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof M)}s.from=function(M,w,S){return l(M,w,S)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function c(M){if(typeof M!="number")throw new TypeError('"size" argument must be of type number');if(M<0)throw new RangeError('The value "'+M+'" is invalid for option "size"')}function u(M,w,S){return c(M),M<=0?a(M):w!==void 0?typeof S=="string"?a(M).fill(w,S):a(M).fill(w):a(M)}s.alloc=function(M,w,S){return u(M,w,S)};function h(M){return c(M),a(M<0?0:R(M)|0)}s.allocUnsafe=function(M){return h(M)},s.allocUnsafeSlow=function(M){return h(M)};function d(M,w){if((typeof w!="string"||w==="")&&(w="utf8"),!s.isEncoding(w))throw new TypeError("Unknown encoding: "+w);var S=x(M,w)|0,E=a(S),K=E.write(M,w);return K!==S&&(E=E.slice(0,K)),E}function f(M){for(var w=M.length<0?0:R(M.length)|0,S=a(w),E=0;E=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return M|0}function m(M){return+M!=M&&(M=0),s.alloc(+M)}s.isBuffer=function(w){return w!=null&&w._isBuffer===!0&&w!==s.prototype},s.compare=function(w,S){if(ue(w,Uint8Array)&&(w=s.from(w,w.offset,w.byteLength)),ue(S,Uint8Array)&&(S=s.from(S,S.offset,S.byteLength)),!s.isBuffer(w)||!s.isBuffer(S))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(w===S)return 0;for(var E=w.length,K=S.length,$=0,Z=Math.min(E,K);$K.length?s.from(Z).copy(K,$):Uint8Array.prototype.set.call(K,Z,$);else if(s.isBuffer(Z))Z.copy(K,$);else throw new TypeError('"list" argument must be an Array of Buffers');$+=Z.length}return K};function x(M,w){if(s.isBuffer(M))return M.length;if(ArrayBuffer.isView(M)||ue(M,ArrayBuffer))return M.byteLength;if(typeof M!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof M);var S=M.length,E=arguments.length>2&&arguments[2]===!0;if(!E&&S===0)return 0;for(var K=!1;;)switch(w){case"ascii":case"latin1":case"binary":return S;case"utf8":case"utf-8":return C(M).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S*2;case"hex":return S>>>1;case"base64":return H(M).length;default:if(K)return E?-1:C(M).length;w=(""+w).toLowerCase(),K=!0}}s.byteLength=x;function T(M,w,S){var E=!1;if((w===void 0||w<0)&&(w=0),w>this.length||((S===void 0||S>this.length)&&(S=this.length),S<=0)||(S>>>=0,w>>>=0,S<=w))return"";for(M||(M="utf8");;)switch(M){case"hex":return V(this,w,S);case"utf8":case"utf-8":return y(this,w,S);case"ascii":return F(this,w,S);case"latin1":case"binary":return Y(this,w,S);case"base64":return I(this,w,S);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ie(this,w,S);default:if(E)throw new TypeError("Unknown encoding: "+M);M=(M+"").toLowerCase(),E=!0}}s.prototype._isBuffer=!0;function P(M,w,S){var E=M[w];M[w]=M[S],M[S]=E}s.prototype.swap16=function(){var w=this.length;if(w%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var S=0;SS&&(w+=" ... "),""},n&&(s.prototype[n]=s.prototype.inspect),s.prototype.compare=function(w,S,E,K,$){if(ue(w,Uint8Array)&&(w=s.from(w,w.offset,w.byteLength)),!s.isBuffer(w))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof w);if(S===void 0&&(S=0),E===void 0&&(E=w?w.length:0),K===void 0&&(K=0),$===void 0&&($=this.length),S<0||E>w.length||K<0||$>this.length)throw new RangeError("out of range index");if(K>=$&&S>=E)return 0;if(K>=$)return-1;if(S>=E)return 1;if(S>>>=0,E>>>=0,K>>>=0,$>>>=0,this===w)return 0;for(var Z=$-K,oe=E-S,ce=Math.min(Z,oe),se=this.slice(K,$),ge=w.slice(S,E),Oe=0;Oe2147483647?S=2147483647:S<-2147483648&&(S=-2147483648),S=+S,b(S)&&(S=K?0:M.length-1),S<0&&(S=M.length+S),S>=M.length){if(K)return-1;S=M.length-1}else if(S<0)if(K)S=0;else return-1;if(typeof w=="string"&&(w=s.from(w,E)),s.isBuffer(w))return w.length===0?-1:D(M,w,S,E,K);if(typeof w=="number")return w=w&255,typeof Uint8Array.prototype.indexOf=="function"?K?Uint8Array.prototype.indexOf.call(M,w,S):Uint8Array.prototype.lastIndexOf.call(M,w,S):D(M,[w],S,E,K);throw new TypeError("val must be string, number or Buffer")}function D(M,w,S,E,K){var $=1,Z=M.length,oe=w.length;if(E!==void 0&&(E=String(E).toLowerCase(),E==="ucs2"||E==="ucs-2"||E==="utf16le"||E==="utf-16le")){if(M.length<2||w.length<2)return-1;$=2,Z/=2,oe/=2,S/=2}function ce(Ye,Vt){return $===1?Ye[Vt]:Ye.readUInt16BE(Vt*$)}var se;if(K){var ge=-1;for(se=S;seZ&&(S=Z-oe),se=S;se>=0;se--){for(var Oe=!0,Te=0;TeK&&(E=K)):E=K;var $=w.length;E>$/2&&(E=$/2);for(var Z=0;Z>>0,isFinite(E)?(E=E>>>0,K===void 0&&(K="utf8")):(K=E,E=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var $=this.length-S;if((E===void 0||E>$)&&(E=$),w.length>0&&(E<0||S<0)||S>this.length)throw new RangeError("Attempt to write outside buffer bounds");K||(K="utf8");for(var Z=!1;;)switch(K){case"hex":return W(this,w,S,E);case"utf8":case"utf-8":return _(this,w,S,E);case"ascii":case"latin1":case"binary":return Q(this,w,S,E);case"base64":return te(this,w,S,E);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,w,S,E);default:if(Z)throw new TypeError("Unknown encoding: "+K);K=(""+K).toLowerCase(),Z=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function I(M,w,S){return w===0&&S===M.length?e.fromByteArray(M):e.fromByteArray(M.slice(w,S))}function y(M,w,S){S=Math.min(M.length,S);for(var E=[],K=w;K239?4:$>223?3:$>191?2:1;if(K+oe<=S){var ce,se,ge,Oe;switch(oe){case 1:$<128&&(Z=$);break;case 2:ce=M[K+1],(ce&192)===128&&(Oe=($&31)<<6|ce&63,Oe>127&&(Z=Oe));break;case 3:ce=M[K+1],se=M[K+2],(ce&192)===128&&(se&192)===128&&(Oe=($&15)<<12|(ce&63)<<6|se&63,Oe>2047&&(Oe<55296||Oe>57343)&&(Z=Oe));break;case 4:ce=M[K+1],se=M[K+2],ge=M[K+3],(ce&192)===128&&(se&192)===128&&(ge&192)===128&&(Oe=($&15)<<18|(ce&63)<<12|(se&63)<<6|ge&63,Oe>65535&&Oe<1114112&&(Z=Oe))}}Z===null?(Z=65533,oe=1):Z>65535&&(Z-=65536,E.push(Z>>>10&1023|55296),Z=56320|Z&1023),E.push(Z),K+=oe}return k(E)}var L=4096;function k(M){var w=M.length;if(w<=L)return String.fromCharCode.apply(String,M);for(var S="",E=0;EE)&&(S=E);for(var K="",$=w;$E&&(w=E),S<0?(S+=E,S<0&&(S=0)):S>E&&(S=E),SS)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(w,S,E){w=w>>>0,S=S>>>0,E||U(w,S,this.length);for(var K=this[w],$=1,Z=0;++Z>>0,S=S>>>0,E||U(w,S,this.length);for(var K=this[w+--S],$=1;S>0&&($*=256);)K+=this[w+--S]*$;return K},s.prototype.readUint8=s.prototype.readUInt8=function(w,S){return w=w>>>0,S||U(w,1,this.length),this[w]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(w,S){return w=w>>>0,S||U(w,2,this.length),this[w]|this[w+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(w,S){return w=w>>>0,S||U(w,2,this.length),this[w]<<8|this[w+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(w,S){return w=w>>>0,S||U(w,4,this.length),(this[w]|this[w+1]<<8|this[w+2]<<16)+this[w+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(w,S){return w=w>>>0,S||U(w,4,this.length),this[w]*16777216+(this[w+1]<<16|this[w+2]<<8|this[w+3])},s.prototype.readIntLE=function(w,S,E){w=w>>>0,S=S>>>0,E||U(w,S,this.length);for(var K=this[w],$=1,Z=0;++Z=$&&(K-=Math.pow(2,8*S)),K},s.prototype.readIntBE=function(w,S,E){w=w>>>0,S=S>>>0,E||U(w,S,this.length);for(var K=S,$=1,Z=this[w+--K];K>0&&($*=256);)Z+=this[w+--K]*$;return $*=128,Z>=$&&(Z-=Math.pow(2,8*S)),Z},s.prototype.readInt8=function(w,S){return w=w>>>0,S||U(w,1,this.length),this[w]&128?(255-this[w]+1)*-1:this[w]},s.prototype.readInt16LE=function(w,S){w=w>>>0,S||U(w,2,this.length);var E=this[w]|this[w+1]<<8;return E&32768?E|4294901760:E},s.prototype.readInt16BE=function(w,S){w=w>>>0,S||U(w,2,this.length);var E=this[w+1]|this[w]<<8;return E&32768?E|4294901760:E},s.prototype.readInt32LE=function(w,S){return w=w>>>0,S||U(w,4,this.length),this[w]|this[w+1]<<8|this[w+2]<<16|this[w+3]<<24},s.prototype.readInt32BE=function(w,S){return w=w>>>0,S||U(w,4,this.length),this[w]<<24|this[w+1]<<16|this[w+2]<<8|this[w+3]},s.prototype.readFloatLE=function(w,S){return w=w>>>0,S||U(w,4,this.length),t.read(this,w,!0,23,4)},s.prototype.readFloatBE=function(w,S){return w=w>>>0,S||U(w,4,this.length),t.read(this,w,!1,23,4)},s.prototype.readDoubleLE=function(w,S){return w=w>>>0,S||U(w,8,this.length),t.read(this,w,!0,52,8)},s.prototype.readDoubleBE=function(w,S){return w=w>>>0,S||U(w,8,this.length),t.read(this,w,!1,52,8)};function N(M,w,S,E,K,$){if(!s.isBuffer(M))throw new TypeError('"buffer" argument must be a Buffer instance');if(w>K||w<$)throw new RangeError('"value" argument is out of bounds');if(S+E>M.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(w,S,E,K){if(w=+w,S=S>>>0,E=E>>>0,!K){var $=Math.pow(2,8*E)-1;N(this,w,S,E,$,0)}var Z=1,oe=0;for(this[S]=w&255;++oe>>0,E=E>>>0,!K){var $=Math.pow(2,8*E)-1;N(this,w,S,E,$,0)}var Z=E-1,oe=1;for(this[S+Z]=w&255;--Z>=0&&(oe*=256);)this[S+Z]=w/oe&255;return S+E},s.prototype.writeUint8=s.prototype.writeUInt8=function(w,S,E){return w=+w,S=S>>>0,E||N(this,w,S,1,255,0),this[S]=w&255,S+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(w,S,E){return w=+w,S=S>>>0,E||N(this,w,S,2,65535,0),this[S]=w&255,this[S+1]=w>>>8,S+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(w,S,E){return w=+w,S=S>>>0,E||N(this,w,S,2,65535,0),this[S]=w>>>8,this[S+1]=w&255,S+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(w,S,E){return w=+w,S=S>>>0,E||N(this,w,S,4,4294967295,0),this[S+3]=w>>>24,this[S+2]=w>>>16,this[S+1]=w>>>8,this[S]=w&255,S+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(w,S,E){return w=+w,S=S>>>0,E||N(this,w,S,4,4294967295,0),this[S]=w>>>24,this[S+1]=w>>>16,this[S+2]=w>>>8,this[S+3]=w&255,S+4},s.prototype.writeIntLE=function(w,S,E,K){if(w=+w,S=S>>>0,!K){var $=Math.pow(2,8*E-1);N(this,w,S,E,$-1,-$)}var Z=0,oe=1,ce=0;for(this[S]=w&255;++Z>0)-ce&255;return S+E},s.prototype.writeIntBE=function(w,S,E,K){if(w=+w,S=S>>>0,!K){var $=Math.pow(2,8*E-1);N(this,w,S,E,$-1,-$)}var Z=E-1,oe=1,ce=0;for(this[S+Z]=w&255;--Z>=0&&(oe*=256);)w<0&&ce===0&&this[S+Z+1]!==0&&(ce=1),this[S+Z]=(w/oe>>0)-ce&255;return S+E},s.prototype.writeInt8=function(w,S,E){return w=+w,S=S>>>0,E||N(this,w,S,1,127,-128),w<0&&(w=255+w+1),this[S]=w&255,S+1},s.prototype.writeInt16LE=function(w,S,E){return w=+w,S=S>>>0,E||N(this,w,S,2,32767,-32768),this[S]=w&255,this[S+1]=w>>>8,S+2},s.prototype.writeInt16BE=function(w,S,E){return w=+w,S=S>>>0,E||N(this,w,S,2,32767,-32768),this[S]=w>>>8,this[S+1]=w&255,S+2},s.prototype.writeInt32LE=function(w,S,E){return w=+w,S=S>>>0,E||N(this,w,S,4,2147483647,-2147483648),this[S]=w&255,this[S+1]=w>>>8,this[S+2]=w>>>16,this[S+3]=w>>>24,S+4},s.prototype.writeInt32BE=function(w,S,E){return w=+w,S=S>>>0,E||N(this,w,S,4,2147483647,-2147483648),w<0&&(w=4294967295+w+1),this[S]=w>>>24,this[S+1]=w>>>16,this[S+2]=w>>>8,this[S+3]=w&255,S+4};function J(M,w,S,E,K,$){if(S+E>M.length)throw new RangeError("Index out of range");if(S<0)throw new RangeError("Index out of range")}function B(M,w,S,E,K){return w=+w,S=S>>>0,K||J(M,w,S,4),t.write(M,w,S,E,23,4),S+4}s.prototype.writeFloatLE=function(w,S,E){return B(this,w,S,!0,E)},s.prototype.writeFloatBE=function(w,S,E){return B(this,w,S,!1,E)};function re(M,w,S,E,K){return w=+w,S=S>>>0,K||J(M,w,S,8),t.write(M,w,S,E,52,8),S+8}s.prototype.writeDoubleLE=function(w,S,E){return re(this,w,S,!0,E)},s.prototype.writeDoubleBE=function(w,S,E){return re(this,w,S,!1,E)},s.prototype.copy=function(w,S,E,K){if(!s.isBuffer(w))throw new TypeError("argument should be a Buffer");if(E||(E=0),!K&&K!==0&&(K=this.length),S>=w.length&&(S=w.length),S||(S=0),K>0&&K=this.length)throw new RangeError("Index out of range");if(K<0)throw new RangeError("sourceEnd out of bounds");K>this.length&&(K=this.length),w.length-S>>0,E=E===void 0?this.length:E>>>0,w||(w=0);var Z;if(typeof w=="number")for(Z=S;Z55295&&S<57344){if(!K){if(S>56319){(w-=3)>-1&&$.push(239,191,189);continue}else if(Z+1===E){(w-=3)>-1&&$.push(239,191,189);continue}K=S;continue}if(S<56320){(w-=3)>-1&&$.push(239,191,189),K=S;continue}S=(K-55296<<10|S-56320)+65536}else K&&(w-=3)>-1&&$.push(239,191,189);if(K=null,S<128){if((w-=1)<0)break;$.push(S)}else if(S<2048){if((w-=2)<0)break;$.push(S>>6|192,S&63|128)}else if(S<65536){if((w-=3)<0)break;$.push(S>>12|224,S>>6&63|128,S&63|128)}else if(S<1114112){if((w-=4)<0)break;$.push(S>>18|240,S>>12&63|128,S>>6&63|128,S&63|128)}else throw new Error("Invalid code point")}return $}function G(M){for(var w=[],S=0;S>8,K=S%256,$.push(K),$.push(E);return $}function H(M){return e.toByteArray(X(M))}function j(M,w,S,E){for(var K=0;K=w.length||K>=M.length);++K)w[K+S]=M[K];return K}function ue(M,w){return M instanceof w||M!=null&&M.constructor!=null&&M.constructor.name!=null&&M.constructor.name===w.name}function b(M){return M!==M}var q=function(){for(var M="0123456789abcdef",w=new Array(256),S=0;S<16;++S)for(var E=S*16,K=0;K<16;++K)w[E+K]=M[S]+M[K];return w}()}(Os)),Os}var Ts={},Ps={},Es,ph;function _0(){return ph||(ph=1,Es=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[t]=i;for(t in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(e,t);if(a.value!==i||a.enumerable!==!0)return!1}return!0}),Es}var _s,gh;function Tc(){if(gh)return _s;gh=1;var r=_0();return _s=function(){return r()&&!!Symbol.toStringTag},_s}var Is,Rh;function Ey(){if(Rh)return Is;Rh=1;var r=typeof Symbol!="undefined"&&Symbol,e=_0();return Is=function(){return typeof r!="function"||typeof Symbol!="function"||typeof r("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},Is}var Ns,mh;function _y(){if(mh)return Ns;mh=1;var r={foo:{}},e=Object;return Ns=function(){return{__proto__:r}.foo===r.foo&&!({__proto__:null}instanceof e)},Ns}var Ms,vh;function Iy(){if(vh)return Ms;vh=1;var r="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,t=Math.max,n="[object Function]",i=function(l,c){for(var u=[],h=0;h1&&typeof y!="boolean")throw new n('"allowMissing" argument must be a boolean');if(D(/^%?[^%]*%?$/,I)===null)throw new e("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var L=Q(I),k=L.length>0?L[0]:"",F=te("%"+k+"%",y),Y=F.name,V=F.value,ie=!1,U=F.alias;U&&(k=U[0],T(L,x([0,1],U)));for(var N=1,J=!0;N=L.length){var X=o(V,B);J=!!X,J&&"get"in X&&!("originalValue"in X.get)?V=X.get:V=V[B]}else J=m(V,B),V=V[B];J&&!ie&&(f[Y]=V)}}return V},Cs}var As={exports:{}},Ds,xh;function I0(){if(xh)return Ds;xh=1;var r=Qi(),e=r("%Object.defineProperty%",!0),t=function(){if(e)try{return e({},"a",{value:1}),!0}catch{return!1}return!1};return t.hasArrayLengthDefineBug=function(){if(!t())return null;try{return e([],"length",{value:1}).length!==1}catch{return!0}},Ds=t,Ds}var Xs,bh;function Ec(){if(bh)return Xs;bh=1;var r=Qi(),e=r("%Object.getOwnPropertyDescriptor%",!0);if(e)try{e([],"length")}catch{e=null}return Xs=e,Xs}var Us,Oh;function My(){if(Oh)return Us;Oh=1;var r=I0()(),e=Qi(),t=r&&e("%Object.defineProperty%",!0);if(t)try{t({},"a",{value:1})}catch{t=!1}var n=e("%SyntaxError%"),i=e("%TypeError%"),o=Ec();return Us=function(s,l,c){if(!s||typeof s!="object"&&typeof s!="function")throw new i("`obj` must be an object or a function`");if(typeof l!="string"&&typeof l!="symbol")throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new i("`loose`, if provided, must be a boolean");var u=arguments.length>3?arguments[3]:null,h=arguments.length>4?arguments[4]:null,d=arguments.length>5?arguments[5]:null,f=arguments.length>6?arguments[6]:!1,p=!!o&&o(s,l);if(t)t(s,l,{configurable:d===null&&p?p.configurable:!d,enumerable:u===null&&p?p.enumerable:!u,value:c,writable:h===null&&p?p.writable:!h});else if(f||!u&&!h&&!d)s[l]=c;else throw new n("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Us}var Ws,Th;function Ly(){if(Th)return Ws;Th=1;var r=Qi(),e=My(),t=I0()(),n=Ec(),i=r("%TypeError%"),o=r("%Math.floor%");return Ws=function(s,l){if(typeof s!="function")throw new i("`fn` is not a function");if(typeof l!="number"||l<0||l>4294967295||o(l)!==l)throw new i("`length` must be a positive 32-bit integer");var c=arguments.length>2&&!!arguments[2],u=!0,h=!0;if("length"in s&&n){var d=n(s,"length");d&&!d.configurable&&(u=!1),d&&!d.writable&&(h=!1)}return(u||h||!c)&&(t?e(s,"length",l,!0,!0):e(s,"length",l)),s},Ws}var Ph;function N0(){return Ph||(Ph=1,function(r){var e=Pc(),t=Qi(),n=Ly(),i=t("%TypeError%"),o=t("%Function.prototype.apply%"),a=t("%Function.prototype.call%"),s=t("%Reflect.apply%",!0)||e.call(a,o),l=t("%Object.defineProperty%",!0),c=t("%Math.max%");if(l)try{l({},"a",{value:1})}catch{l=null}r.exports=function(d){if(typeof d!="function")throw new i("a function is required");var f=s(e,a,arguments);return n(f,1+c(0,d.length-(arguments.length-1)),!0)};var u=function(){return s(e,o,arguments)};l?l(r.exports,"apply",{value:u}):r.exports.apply=u}(As)),As.exports}var Vs,Eh;function M0(){if(Eh)return Vs;Eh=1;var r=Qi(),e=N0(),t=e(r("String.prototype.indexOf"));return Vs=function(i,o){var a=r(i,!!o);return typeof a=="function"&&t(i,".prototype.")>-1?e(a):a},Vs}var Ys,_h;function Fy(){if(_h)return Ys;_h=1;var r=Tc()(),e=M0(),t=e("Object.prototype.toString"),n=function(s){return r&&s&&typeof s=="object"&&Symbol.toStringTag in s?!1:t(s)==="[object Arguments]"},i=function(s){return n(s)?!0:s!==null&&typeof s=="object"&&typeof s.length=="number"&&s.length>=0&&t(s)!=="[object Array]"&&t(s.callee)==="[object Function]"},o=function(){return n(arguments)}();return n.isLegacyArguments=i,Ys=o?n:i,Ys}var ks,Ih;function Cy(){if(Ih)return ks;Ih=1;var r=Object.prototype.toString,e=Function.prototype.toString,t=/^\s*(?:function)?\*/,n=Tc()(),i=Object.getPrototypeOf,o=function(){if(!n)return!1;try{return Function("return function*() {}")()}catch{}},a;return ks=function(l){if(typeof l!="function")return!1;if(t.test(e.call(l)))return!0;if(!n){var c=r.call(l);return c==="[object GeneratorFunction]"}if(!i)return!1;if(typeof a=="undefined"){var u=o();a=u?i(u):!1}return i(l)===a},ks}var Zs,Nh;function Ay(){if(Nh)return Zs;Nh=1;var r=Function.prototype.toString,e=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,t,n;if(typeof e=="function"&&typeof Object.defineProperty=="function")try{t=Object.defineProperty({},"length",{get:function(){throw n}}),n={},e(function(){throw 42},null,t)}catch(m){m!==n&&(e=null)}else e=null;var i=/^\s*class\b/,o=function(x){try{var T=r.call(x);return i.test(T)}catch{return!1}},a=function(x){try{return o(x)?!1:(r.call(x),!0)}catch{return!1}},s=Object.prototype.toString,l="[object Object]",c="[object Function]",u="[object GeneratorFunction]",h="[object HTMLAllCollection]",d="[object HTML document.all class]",f="[object HTMLCollection]",p=typeof Symbol=="function"&&!!Symbol.toStringTag,g=!(0 in[,]),v=function(){return!1};if(typeof document=="object"){var R=document.all;s.call(R)===s.call(document.all)&&(v=function(x){if((g||!x)&&(typeof x=="undefined"||typeof x=="object"))try{var T=s.call(x);return(T===h||T===d||T===f||T===l)&&x("")==null}catch{}return!1})}return Zs=e?function(x){if(v(x))return!0;if(!x||typeof x!="function"&&typeof x!="object")return!1;try{e(x,null,t)}catch(T){if(T!==n)return!1}return!o(x)&&a(x)}:function(x){if(v(x))return!0;if(!x||typeof x!="function"&&typeof x!="object")return!1;if(p)return a(x);if(o(x))return!1;var T=s.call(x);return T!==c&&T!==u&&!/^\[object HTML/.test(T)?!1:a(x)},Zs}var Qs,Mh;function Dy(){if(Mh)return Qs;Mh=1;var r=Ay(),e=Object.prototype.toString,t=Object.prototype.hasOwnProperty,n=function(l,c,u){for(var h=0,d=l.length;h=3&&(h=u),e.call(l)==="[object Array]"?n(l,c,h):typeof l=="string"?i(l,c,h):o(l,c,h)};return Qs=a,Qs}var Ks,Lh;function Xy(){if(Lh)return Ks;Lh=1;var r=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],e=typeof globalThis=="undefined"?an:globalThis;return Ks=function(){for(var n=[],i=0;i-1?R:R!=="Object"?!1:p(v)}return i?f(v):null},Hs}var Bs,Ch;function Uy(){if(Ch)return Bs;Ch=1;var r=L0();return Bs=function(t){return!!r(t)},Bs}var Ah;function Wy(){return Ah||(Ah=1,function(r){var e=Fy(),t=Cy(),n=L0(),i=Uy();function o(E){return E.call.bind(E)}var a=typeof BigInt!="undefined",s=typeof Symbol!="undefined",l=o(Object.prototype.toString),c=o(Number.prototype.valueOf),u=o(String.prototype.valueOf),h=o(Boolean.prototype.valueOf);if(a)var d=o(BigInt.prototype.valueOf);if(s)var f=o(Symbol.prototype.valueOf);function p(E,K){if(typeof E!="object")return!1;try{return K(E),!0}catch{return!1}}r.isArgumentsObject=e,r.isGeneratorFunction=t,r.isTypedArray=i;function g(E){return typeof Promise!="undefined"&&E instanceof Promise||E!==null&&typeof E=="object"&&typeof E.then=="function"&&typeof E.catch=="function"}r.isPromise=g;function v(E){return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?ArrayBuffer.isView(E):i(E)||J(E)}r.isArrayBufferView=v;function R(E){return n(E)==="Uint8Array"}r.isUint8Array=R;function m(E){return n(E)==="Uint8ClampedArray"}r.isUint8ClampedArray=m;function x(E){return n(E)==="Uint16Array"}r.isUint16Array=x;function T(E){return n(E)==="Uint32Array"}r.isUint32Array=T;function P(E){return n(E)==="Int8Array"}r.isInt8Array=P;function A(E){return n(E)==="Int16Array"}r.isInt16Array=A;function D(E){return n(E)==="Int32Array"}r.isInt32Array=D;function W(E){return n(E)==="Float32Array"}r.isFloat32Array=W;function _(E){return n(E)==="Float64Array"}r.isFloat64Array=_;function Q(E){return n(E)==="BigInt64Array"}r.isBigInt64Array=Q;function te(E){return n(E)==="BigUint64Array"}r.isBigUint64Array=te;function O(E){return l(E)==="[object Map]"}O.working=typeof Map!="undefined"&&O(new Map);function I(E){return typeof Map=="undefined"?!1:O.working?O(E):E instanceof Map}r.isMap=I;function y(E){return l(E)==="[object Set]"}y.working=typeof Set!="undefined"&&y(new Set);function L(E){return typeof Set=="undefined"?!1:y.working?y(E):E instanceof Set}r.isSet=L;function k(E){return l(E)==="[object WeakMap]"}k.working=typeof WeakMap!="undefined"&&k(new WeakMap);function F(E){return typeof WeakMap=="undefined"?!1:k.working?k(E):E instanceof WeakMap}r.isWeakMap=F;function Y(E){return l(E)==="[object WeakSet]"}Y.working=typeof WeakSet!="undefined"&&Y(new WeakSet);function V(E){return Y(E)}r.isWeakSet=V;function ie(E){return l(E)==="[object ArrayBuffer]"}ie.working=typeof ArrayBuffer!="undefined"&&ie(new ArrayBuffer);function U(E){return typeof ArrayBuffer=="undefined"?!1:ie.working?ie(E):E instanceof ArrayBuffer}r.isArrayBuffer=U;function N(E){return l(E)==="[object DataView]"}N.working=typeof ArrayBuffer!="undefined"&&typeof DataView!="undefined"&&N(new DataView(new ArrayBuffer(1),0,1));function J(E){return typeof DataView=="undefined"?!1:N.working?N(E):E instanceof DataView}r.isDataView=J;var B=typeof SharedArrayBuffer!="undefined"?SharedArrayBuffer:void 0;function re(E){return l(E)==="[object SharedArrayBuffer]"}function ee(E){return typeof B=="undefined"?!1:(typeof re.working=="undefined"&&(re.working=re(new B)),re.working?re(E):E instanceof B)}r.isSharedArrayBuffer=ee;function X(E){return l(E)==="[object AsyncFunction]"}r.isAsyncFunction=X;function C(E){return l(E)==="[object Map Iterator]"}r.isMapIterator=C;function G(E){return l(E)==="[object Set Iterator]"}r.isSetIterator=G;function z(E){return l(E)==="[object Generator]"}r.isGeneratorObject=z;function H(E){return l(E)==="[object WebAssembly.Module]"}r.isWebAssemblyCompiledModule=H;function j(E){return p(E,c)}r.isNumberObject=j;function ue(E){return p(E,u)}r.isStringObject=ue;function b(E){return p(E,h)}r.isBooleanObject=b;function q(E){return a&&p(E,d)}r.isBigIntObject=q;function M(E){return s&&p(E,f)}r.isSymbolObject=M;function w(E){return j(E)||ue(E)||b(E)||q(E)||M(E)}r.isBoxedPrimitive=w;function S(E){return typeof Uint8Array!="undefined"&&(U(E)||ee(E))}r.isAnyArrayBuffer=S,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(E){Object.defineProperty(r,E,{enumerable:!1,value:function(){throw new Error(E+" is not supported in userland")}})})}(Ps)),Ps}var Gs,Dh;function Vy(){return Dh||(Dh=1,Gs=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"}),Gs}var Xh;function F0(){return Xh||(Xh=1,function(r){var e=Object.getOwnPropertyDescriptors||function(J){for(var B=Object.keys(J),re={},ee=0;ee=ee)return G;switch(G){case"%s":return String(re[B++]);case"%d":return Number(re[B++]);case"%j":try{return JSON.stringify(re[B++])}catch{return"[Circular]"}default:return G}}),C=re[B];B=3&&(B.depth=arguments[2]),arguments.length>=4&&(B.colors=arguments[3]),R(J)?B.showHidden=J:J&&r._extend(B,J),D(B.showHidden)&&(B.showHidden=!1),D(B.depth)&&(B.depth=2),D(B.colors)&&(B.colors=!1),D(B.customInspect)&&(B.customInspect=!0),B.colors&&(B.stylize=s),u(B,N,B.depth)}r.inspect=a,a.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function s(N,J){var B=a.styles[J];return B?"\x1B["+a.colors[B][0]+"m"+N+"\x1B["+a.colors[B][1]+"m":N}function l(N,J){return N}function c(N){var J={};return N.forEach(function(B,re){J[B]=!0}),J}function u(N,J,B){if(N.customInspect&&J&&O(J.inspect)&&J.inspect!==r.inspect&&!(J.constructor&&J.constructor.prototype===J)){var re=J.inspect(B,N);return P(re)||(re=u(N,re,B)),re}var ee=h(N,J);if(ee)return ee;var X=Object.keys(J),C=c(X);if(N.showHidden&&(X=Object.getOwnPropertyNames(J)),te(J)&&(X.indexOf("message")>=0||X.indexOf("description")>=0))return d(J);if(X.length===0){if(O(J)){var G=J.name?": "+J.name:"";return N.stylize("[Function"+G+"]","special")}if(W(J))return N.stylize(RegExp.prototype.toString.call(J),"regexp");if(Q(J))return N.stylize(Date.prototype.toString.call(J),"date");if(te(J))return d(J)}var z="",H=!1,j=["{","}"];if(v(J)&&(H=!0,j=["[","]"]),O(J)){var ue=J.name?": "+J.name:"";z=" [Function"+ue+"]"}if(W(J)&&(z=" "+RegExp.prototype.toString.call(J)),Q(J)&&(z=" "+Date.prototype.toUTCString.call(J)),te(J)&&(z=" "+d(J)),X.length===0&&(!H||J.length==0))return j[0]+z+j[1];if(B<0)return W(J)?N.stylize(RegExp.prototype.toString.call(J),"regexp"):N.stylize("[Object]","special");N.seen.push(J);var b;return H?b=f(N,J,B,C,X):b=X.map(function(q){return p(N,J,B,C,q,H)}),N.seen.pop(),g(b,z,j)}function h(N,J){if(D(J))return N.stylize("undefined","undefined");if(P(J)){var B="'"+JSON.stringify(J).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return N.stylize(B,"string")}if(T(J))return N.stylize(""+J,"number");if(R(J))return N.stylize(""+J,"boolean");if(m(J))return N.stylize("null","null")}function d(N){return"["+Error.prototype.toString.call(N)+"]"}function f(N,J,B,re,ee){for(var X=[],C=0,G=J.length;C-1&&(X?G=G.split(` +`).map(function(H){return" "+H}).join(` +`).slice(2):G=` +`+G.split(` +`).map(function(H){return" "+H}).join(` +`))):G=N.stylize("[Circular]","special")),D(C)){if(X&&ee.match(/^\d+$/))return G;C=JSON.stringify(""+ee),C.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(C=C.slice(1,-1),C=N.stylize(C,"name")):(C=C.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),C=N.stylize(C,"string"))}return C+": "+G}function g(N,J,B){var re=N.reduce(function(ee,X){return X.indexOf(` +`)>=0,ee+X.replace(/\u001b\[\d\d?m/g,"").length+1},0);return re>60?B[0]+(J===""?"":J+` + `)+" "+N.join(`, + `)+" "+B[1]:B[0]+J+" "+N.join(", ")+" "+B[1]}r.types=Wy();function v(N){return Array.isArray(N)}r.isArray=v;function R(N){return typeof N=="boolean"}r.isBoolean=R;function m(N){return N===null}r.isNull=m;function x(N){return N==null}r.isNullOrUndefined=x;function T(N){return typeof N=="number"}r.isNumber=T;function P(N){return typeof N=="string"}r.isString=P;function A(N){return typeof N=="symbol"}r.isSymbol=A;function D(N){return N===void 0}r.isUndefined=D;function W(N){return _(N)&&y(N)==="[object RegExp]"}r.isRegExp=W,r.types.isRegExp=W;function _(N){return typeof N=="object"&&N!==null}r.isObject=_;function Q(N){return _(N)&&y(N)==="[object Date]"}r.isDate=Q,r.types.isDate=Q;function te(N){return _(N)&&(y(N)==="[object Error]"||N instanceof Error)}r.isError=te,r.types.isNativeError=te;function O(N){return typeof N=="function"}r.isFunction=O;function I(N){return N===null||typeof N=="boolean"||typeof N=="number"||typeof N=="string"||typeof N=="symbol"||typeof N=="undefined"}r.isPrimitive=I,r.isBuffer=Vy();function y(N){return Object.prototype.toString.call(N)}function L(N){return N<10?"0"+N.toString(10):N.toString(10)}var k=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function F(){var N=new Date,J=[L(N.getHours()),L(N.getMinutes()),L(N.getSeconds())].join(":");return[N.getDate(),k[N.getMonth()],J].join(" ")}r.log=function(){console.log("%s - %s",F(),r.format.apply(r,arguments))},r.inherits=ni,r._extend=function(N,J){if(!J||!_(J))return N;for(var B=Object.keys(J),re=B.length;re--;)N[B[re]]=J[B[re]];return N};function Y(N,J){return Object.prototype.hasOwnProperty.call(N,J)}var V=typeof Symbol!="undefined"?Symbol("util.promisify.custom"):void 0;r.promisify=function(J){if(typeof J!="function")throw new TypeError('The "original" argument must be of type Function');if(V&&J[V]){var B=J[V];if(typeof B!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(B,V,{value:B,enumerable:!1,writable:!1,configurable:!0}),B}function B(){for(var re,ee,X=new Promise(function(z,H){re=z,ee=H}),C=[],G=0;G0?this.tail.next=g:this.head=g,this.tail=g,++this.length}},{key:"unshift",value:function(p){var g={data:p,next:this.head};this.length===0&&(this.tail=g),this.head=g,++this.length}},{key:"shift",value:function(){if(this.length!==0){var p=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,p}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(p){if(this.length===0)return"";for(var g=this.head,v=""+g.data;g=g.next;)v+=p+g.data;return v}},{key:"concat",value:function(p){if(this.length===0)return s.alloc(0);for(var g=s.allocUnsafe(p>>>0),v=this.head,R=0;v;)h(v.data,g,R),R+=v.data.length,v=v.next;return g}},{key:"consume",value:function(p,g){var v;return pm.length?m.length:p;if(x===m.length?R+=m:R+=m.slice(0,p),p-=x,p===0){x===m.length?(++v,g.next?this.head=g.next:this.head=this.tail=null):(this.head=g,g.data=m.slice(x));break}++v}return this.length-=v,R}},{key:"_getBuffer",value:function(p){var g=s.allocUnsafe(p),v=this.head,R=1;for(v.data.copy(g),p-=v.data.length;v=v.next;){var m=v.data,x=p>m.length?m.length:p;if(m.copy(g,g.length-p,0,x),p-=x,p===0){x===m.length?(++R,v.next?this.head=v.next:this.head=this.tail=null):(this.head=v,v.data=m.slice(x));break}++R}return this.length-=R,g}},{key:u,value:function(p,g){return c(this,e({},g,{depth:0,customInspect:!1}))}}]),d}(),Js}var zs,Wh;function C0(){if(Wh)return zs;Wh=1;function r(a,s){var l=this,c=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return c||u?(s?s(a):a&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,ke.nextTick(i,this,a)):ke.nextTick(i,this,a)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(a||null,function(h){!s&&h?l._writableState?l._writableState.errorEmitted?ke.nextTick(t,l):(l._writableState.errorEmitted=!0,ke.nextTick(e,l,h)):ke.nextTick(e,l,h):s?(ke.nextTick(t,l),s(h)):ke.nextTick(t,l)}),this)}function e(a,s){i(a,s),t(a)}function t(a){a._writableState&&!a._writableState.emitClose||a._readableState&&!a._readableState.emitClose||a.emit("close")}function n(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function i(a,s){a.emit("error",s)}function o(a,s){var l=a._readableState,c=a._writableState;l&&l.autoDestroy||c&&c.autoDestroy?a.destroy(s):a.emit("error",s)}return zs={destroy:r,undestroy:n,errorOrDestroy:o},zs}var $s={},Vh;function Ki(){if(Vh)return $s;Vh=1;function r(s,l){s.prototype=Object.create(l.prototype),s.prototype.constructor=s,s.__proto__=l}var e={};function t(s,l,c){c||(c=Error);function u(d,f,p){return typeof l=="string"?l:l(d,f,p)}var h=function(d){r(f,d);function f(p,g,v){return d.call(this,u(p,g,v))||this}return f}(c);h.prototype.name=c.name,h.prototype.code=s,e[s]=h}function n(s,l){if(Array.isArray(s)){var c=s.length;return s=s.map(function(u){return String(u)}),c>2?"one of ".concat(l," ").concat(s.slice(0,c-1).join(", "),", or ")+s[c-1]:c===2?"one of ".concat(l," ").concat(s[0]," or ").concat(s[1]):"of ".concat(l," ").concat(s[0])}else return"of ".concat(l," ").concat(String(s))}function i(s,l,c){return s.substr(!c||c<0?0:+c,l.length)===l}function o(s,l,c){return(c===void 0||c>s.length)&&(c=s.length),s.substring(c-l.length,c)===l}function a(s,l,c){return typeof c!="number"&&(c=0),c+l.length>s.length?!1:s.indexOf(l,c)!==-1}return t("ERR_INVALID_OPT_VALUE",function(s,l){return'The value "'+l+'" is invalid for option "'+s+'"'},TypeError),t("ERR_INVALID_ARG_TYPE",function(s,l,c){var u;typeof l=="string"&&i(l,"not ")?(u="must not be",l=l.replace(/^not /,"")):u="must be";var h;if(o(s," argument"))h="The ".concat(s," ").concat(u," ").concat(n(l,"type"));else{var d=a(s,".")?"property":"argument";h='The "'.concat(s,'" ').concat(d," ").concat(u," ").concat(n(l,"type"))}return h+=". Received type ".concat(typeof c),h},TypeError),t("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),t("ERR_METHOD_NOT_IMPLEMENTED",function(s){return"The "+s+" method is not implemented"}),t("ERR_STREAM_PREMATURE_CLOSE","Premature close"),t("ERR_STREAM_DESTROYED",function(s){return"Cannot call "+s+" after a stream was destroyed"}),t("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),t("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),t("ERR_STREAM_WRITE_AFTER_END","write after end"),t("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),t("ERR_UNKNOWN_ENCODING",function(s){return"Unknown encoding: "+s},TypeError),t("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),$s.codes=e,$s}var js,Yh;function A0(){if(Yh)return js;Yh=1;var r=Ki().codes.ERR_INVALID_OPT_VALUE;function e(n,i,o){return n.highWaterMark!=null?n.highWaterMark:i?n[o]:null}function t(n,i,o,a){var s=e(i,a,o);if(s!=null){if(!(isFinite(s)&&Math.floor(s)===s)||s<0){var l=a?o:"highWaterMark";throw new r(l,s)}return Math.floor(s)}return n.objectMode?16:16*1024}return js={getHighWaterMark:t},js}var qs,kh;function ky(){if(kh)return qs;kh=1,qs=r;function r(t,n){if(e("noDeprecation"))return t;var i=!1;function o(){if(!i){if(e("throwDeprecation"))throw new Error(n);e("traceDeprecation")?console.trace(n):console.warn(n),i=!0}return t.apply(this,arguments)}return o}function e(t){try{if(!an.localStorage)return!1}catch{return!1}var n=an.localStorage[t];return n==null?!1:String(n).toLowerCase()==="true"}return qs}var el,Zh;function D0(){if(Zh)return el;Zh=1,el=W;function r(ee){var X=this;this.next=null,this.entry=null,this.finish=function(){re(X,ee)}}var e;W.WritableState=A;var t={deprecate:ky()},n=E0(),i=Ja().Buffer,o=an.Uint8Array||function(){};function a(ee){return i.from(ee)}function s(ee){return i.isBuffer(ee)||ee instanceof o}var l=C0(),c=A0(),u=c.getHighWaterMark,h=Ki().codes,d=h.ERR_INVALID_ARG_TYPE,f=h.ERR_METHOD_NOT_IMPLEMENTED,p=h.ERR_MULTIPLE_CALLBACK,g=h.ERR_STREAM_CANNOT_PIPE,v=h.ERR_STREAM_DESTROYED,R=h.ERR_STREAM_NULL_VALUES,m=h.ERR_STREAM_WRITE_AFTER_END,x=h.ERR_UNKNOWN_ENCODING,T=l.errorOrDestroy;ni(W,n);function P(){}function A(ee,X,C){e=e||Xi(),ee=ee||{},typeof C!="boolean"&&(C=X instanceof e),this.objectMode=!!ee.objectMode,C&&(this.objectMode=this.objectMode||!!ee.writableObjectMode),this.highWaterMark=u(this,ee,"writableHighWaterMark",C),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var G=ee.decodeStrings===!1;this.decodeStrings=!G,this.defaultEncoding=ee.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(z){k(X,z)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=ee.emitClose!==!1,this.autoDestroy=!!ee.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new r(this)}A.prototype.getBuffer=function(){for(var X=this.bufferedRequest,C=[];X;)C.push(X),X=X.next;return C},function(){try{Object.defineProperty(A.prototype,"buffer",{get:t.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var D;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(D=Function.prototype[Symbol.hasInstance],Object.defineProperty(W,Symbol.hasInstance,{value:function(X){return D.call(this,X)?!0:this!==W?!1:X&&X._writableState instanceof A}})):D=function(X){return X instanceof this};function W(ee){e=e||Xi();var X=this instanceof e;if(!X&&!D.call(W,this))return new W(ee);this._writableState=new A(ee,this,X),this.writable=!0,ee&&(typeof ee.write=="function"&&(this._write=ee.write),typeof ee.writev=="function"&&(this._writev=ee.writev),typeof ee.destroy=="function"&&(this._destroy=ee.destroy),typeof ee.final=="function"&&(this._final=ee.final)),n.call(this)}W.prototype.pipe=function(){T(this,new g)};function _(ee,X){var C=new m;T(ee,C),ke.nextTick(X,C)}function Q(ee,X,C,G){var z;return C===null?z=new R:typeof C!="string"&&!X.objectMode&&(z=new d("chunk",["string","Buffer"],C)),z?(T(ee,z),ke.nextTick(G,z),!1):!0}W.prototype.write=function(ee,X,C){var G=this._writableState,z=!1,H=!G.objectMode&&s(ee);return H&&!i.isBuffer(ee)&&(ee=a(ee)),typeof X=="function"&&(C=X,X=null),H?X="buffer":X||(X=G.defaultEncoding),typeof C!="function"&&(C=P),G.ending?_(this,C):(H||Q(this,G,ee,C))&&(G.pendingcb++,z=O(this,G,H,ee,X,C)),z},W.prototype.cork=function(){this._writableState.corked++},W.prototype.uncork=function(){var ee=this._writableState;ee.corked&&(ee.corked--,!ee.writing&&!ee.corked&&!ee.bufferProcessing&&ee.bufferedRequest&&V(this,ee))},W.prototype.setDefaultEncoding=function(X){if(typeof X=="string"&&(X=X.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((X+"").toLowerCase())>-1))throw new x(X);return this._writableState.defaultEncoding=X,this},Object.defineProperty(W.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function te(ee,X,C){return!ee.objectMode&&ee.decodeStrings!==!1&&typeof X=="string"&&(X=i.from(X,C)),X}Object.defineProperty(W.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function O(ee,X,C,G,z,H){if(!C){var j=te(X,G,z);G!==j&&(C=!0,z="buffer",G=j)}var ue=X.objectMode?1:G.length;X.length+=ue;var b=X.length>5===6?2:R>>4===14?3:R>>3===30?4:R>>6===2?-1:-2}function a(R,m,x){var T=m.length-1;if(T=0?(P>0&&(R.lastNeed=P-1),P):--T=0?(P>0&&(R.lastNeed=P-2),P):--T=0?(P>0&&(P===2?P=0:R.lastNeed=P-3),P):0))}function s(R,m,x){if((m[0]&192)!==128)return R.lastNeed=0,"\uFFFD";if(R.lastNeed>1&&m.length>1){if((m[1]&192)!==128)return R.lastNeed=1,"\uFFFD";if(R.lastNeed>2&&m.length>2&&(m[2]&192)!==128)return R.lastNeed=2,"\uFFFD"}}function l(R){var m=this.lastTotal-this.lastNeed,x=s(this,R);if(x!==void 0)return x;if(this.lastNeed<=R.length)return R.copy(this.lastChar,m,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);R.copy(this.lastChar,m,0,R.length),this.lastNeed-=R.length}function c(R,m){var x=a(this,R,m);if(!this.lastNeed)return R.toString("utf8",m);this.lastTotal=x;var T=R.length-(x-this.lastNeed);return R.copy(this.lastChar,0,T),R.toString("utf8",m,T)}function u(R){var m=R&&R.length?this.write(R):"";return this.lastNeed?m+"\uFFFD":m}function h(R,m){if((R.length-m)%2===0){var x=R.toString("utf16le",m);if(x){var T=x.charCodeAt(x.length-1);if(T>=55296&&T<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=R[R.length-2],this.lastChar[1]=R[R.length-1],x.slice(0,-1)}return x}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=R[R.length-1],R.toString("utf16le",m,R.length-1)}function d(R){var m=R&&R.length?this.write(R):"";if(this.lastNeed){var x=this.lastTotal-this.lastNeed;return m+this.lastChar.toString("utf16le",0,x)}return m}function f(R,m){var x=(R.length-m)%3;return x===0?R.toString("base64",m):(this.lastNeed=3-x,this.lastTotal=3,x===1?this.lastChar[0]=R[R.length-1]:(this.lastChar[0]=R[R.length-2],this.lastChar[1]=R[R.length-1]),R.toString("base64",m,R.length-x))}function p(R){var m=R&&R.length?this.write(R):"";return this.lastNeed?m+this.lastChar.toString("base64",0,3-this.lastNeed):m}function g(R){return R.toString(this.encoding)}function v(R){return R&&R.length?this.write(R):""}return rl}var nl,Bh;function _c(){if(Bh)return nl;Bh=1;var r=Ki().codes.ERR_STREAM_PREMATURE_CLOSE;function e(o){var a=!1;return function(){if(!a){a=!0;for(var s=arguments.length,l=new Array(s),c=0;c0)if(typeof j!="string"&&!M.objectMode&&Object.getPrototypeOf(j)!==n.prototype&&(j=o(j)),b)M.endEmitted?P(H,new R):te(H,M,j,!0);else if(M.ended)P(H,new g);else{if(M.destroyed)return!1;M.reading=!1,M.decoder&&!ue?(j=M.decoder.write(j),M.objectMode||j.length!==0?te(H,M,j,!1):V(H,M)):te(H,M,j,!1)}else b||(M.reading=!1,V(H,M))}return!M.ended&&(M.length=I?H=I:(H--,H|=H>>>1,H|=H>>>2,H|=H>>>4,H|=H>>>8,H|=H>>>16,H++),H}function L(H,j){return H<=0||j.length===0&&j.ended?0:j.objectMode?1:H!==H?j.flowing&&j.length?j.buffer.head.data.length:j.length:(H>j.highWaterMark&&(j.highWaterMark=y(H)),H<=j.length?H:j.ended?j.length:(j.needReadable=!0,0))}_.prototype.read=function(H){l("read",H),H=parseInt(H,10);var j=this._readableState,ue=H;if(H!==0&&(j.emittedReadable=!1),H===0&&j.needReadable&&((j.highWaterMark!==0?j.length>=j.highWaterMark:j.length>0)||j.ended))return l("read: emitReadable",j.length,j.ended),j.length===0&&j.ended?C(this):F(this),null;if(H=L(H,j),H===0&&j.ended)return j.length===0&&C(this),null;var b=j.needReadable;l("need readable",b),(j.length===0||j.length-H0?q=X(H,j):q=null,q===null?(j.needReadable=j.length<=j.highWaterMark,H=0):(j.length-=H,j.awaitDrain=0),j.length===0&&(j.ended||(j.needReadable=!0),ue!==H&&j.ended&&C(this)),q!==null&&this.emit("data",q),q};function k(H,j){if(l("onEofChunk"),!j.ended){if(j.decoder){var ue=j.decoder.end();ue&&ue.length&&(j.buffer.push(ue),j.length+=j.objectMode?1:ue.length)}j.ended=!0,j.sync?F(H):(j.needReadable=!1,j.emittedReadable||(j.emittedReadable=!0,Y(H)))}}function F(H){var j=H._readableState;l("emitReadable",j.needReadable,j.emittedReadable),j.needReadable=!1,j.emittedReadable||(l("emitReadable",j.flowing),j.emittedReadable=!0,ke.nextTick(Y,H))}function Y(H){var j=H._readableState;l("emitReadable_",j.destroyed,j.length,j.ended),!j.destroyed&&(j.length||j.ended)&&(H.emit("readable"),j.emittedReadable=!1),j.needReadable=!j.flowing&&!j.ended&&j.length<=j.highWaterMark,ee(H)}function V(H,j){j.readingMore||(j.readingMore=!0,ke.nextTick(ie,H,j))}function ie(H,j){for(;!j.reading&&!j.ended&&(j.length1&&z(b.pipes,H)!==-1)&&!K&&(l("false write response, pause",b.awaitDrain),b.awaitDrain++),ue.pause())}function oe(Oe){l("onerror",Oe),ge(),H.removeListener("error",oe),e(H,"error")===0&&P(H,Oe)}D(H,"error",oe);function ce(){H.removeListener("finish",se),ge()}H.once("close",ce);function se(){l("onfinish"),H.removeListener("close",ce),ge()}H.once("finish",se);function ge(){l("unpipe"),ue.unpipe(H)}return H.emit("pipe",ue),b.flowing||(l("pipe resume"),ue.resume()),H};function U(H){return function(){var ue=H._readableState;l("pipeOnDrain",ue.awaitDrain),ue.awaitDrain&&ue.awaitDrain--,ue.awaitDrain===0&&e(H,"data")&&(ue.flowing=!0,ee(H))}}_.prototype.unpipe=function(H){var j=this._readableState,ue={hasUnpiped:!1};if(j.pipesCount===0)return this;if(j.pipesCount===1)return H&&H!==j.pipes?this:(H||(H=j.pipes),j.pipes=null,j.pipesCount=0,j.flowing=!1,H&&H.emit("unpipe",this,ue),this);if(!H){var b=j.pipes,q=j.pipesCount;j.pipes=null,j.pipesCount=0,j.flowing=!1;for(var M=0;M0,b.flowing!==!1&&this.resume()):H==="readable"&&!b.endEmitted&&!b.readableListening&&(b.readableListening=b.needReadable=!0,b.flowing=!1,b.emittedReadable=!1,l("on readable",b.length,b.reading),b.length?F(this):b.reading||ke.nextTick(J,this)),ue},_.prototype.addListener=_.prototype.on,_.prototype.removeListener=function(H,j){var ue=t.prototype.removeListener.call(this,H,j);return H==="readable"&&ke.nextTick(N,this),ue},_.prototype.removeAllListeners=function(H){var j=t.prototype.removeAllListeners.apply(this,arguments);return(H==="readable"||H===void 0)&&ke.nextTick(N,this),j};function N(H){var j=H._readableState;j.readableListening=H.listenerCount("readable")>0,j.resumeScheduled&&!j.paused?j.flowing=!0:H.listenerCount("data")>0&&H.resume()}function J(H){l("readable nexttick read 0"),H.read(0)}_.prototype.resume=function(){var H=this._readableState;return H.flowing||(l("resume"),H.flowing=!H.readableListening,B(this,H)),H.paused=!1,this};function B(H,j){j.resumeScheduled||(j.resumeScheduled=!0,ke.nextTick(re,H,j))}function re(H,j){l("resume",j.reading),j.reading||H.read(0),j.resumeScheduled=!1,H.emit("resume"),ee(H),j.flowing&&!j.reading&&H.read(0)}_.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function ee(H){var j=H._readableState;for(l("flow",j.flowing);j.flowing&&H.read()!==null;);}_.prototype.wrap=function(H){var j=this,ue=this._readableState,b=!1;H.on("end",function(){if(l("wrapped end"),ue.decoder&&!ue.ended){var w=ue.decoder.end();w&&w.length&&j.push(w)}j.push(null)}),H.on("data",function(w){if(l("wrapped data"),ue.decoder&&(w=ue.decoder.write(w)),!(ue.objectMode&&w==null)&&!(!ue.objectMode&&(!w||!w.length))){var S=j.push(w);S||(b=!0,H.pause())}});for(var q in H)this[q]===void 0&&typeof H[q]=="function"&&(this[q]=function(S){return function(){return H[S].apply(H,arguments)}}(q));for(var M=0;M=j.length?(j.decoder?ue=j.buffer.join(""):j.buffer.length===1?ue=j.buffer.first():ue=j.buffer.concat(j.length),j.buffer.clear()):ue=j.buffer.consume(H,j.decoder),ue}function C(H){var j=H._readableState;l("endReadable",j.endEmitted),j.endEmitted||(j.ended=!0,ke.nextTick(G,j,H))}function G(H,j){if(l("endReadableNT",H.endEmitted,H.length),!H.endEmitted&&H.length===0&&(H.endEmitted=!0,j.readable=!1,j.emit("end"),H.autoDestroy)){var ue=j._writableState;(!ue||ue.autoDestroy&&ue.finished)&&j.destroy()}}typeof Symbol=="function"&&(_.from=function(H,j){return T===void 0&&(T=Ky()),T(_,H,j)});function z(H,j){for(var ue=0,b=H.length;ue0;return s(m,T,P,function(A){v||(v=A),A&&R.forEach(l),!T&&(R.forEach(l),g(v))})});return f.reduce(c)}return cl=h,cl}var Ic=kr,Nc=Oc.EventEmitter,Gy=ni;Gy(kr,Nc);kr.Readable=X0();kr.Writable=D0();kr.Duplex=Xi();kr.Transform=U0();kr.PassThrough=Hy();kr.finished=_c();kr.pipeline=By();kr.Stream=kr;function kr(){Nc.call(this)}kr.prototype.pipe=function(r,e){var t=this;function n(u){r.writable&&r.write(u)===!1&&t.pause&&t.pause()}t.on("data",n);function i(){t.readable&&t.resume&&t.resume()}r.on("drain",i),!r._isStdio&&(!e||e.end!==!1)&&(t.on("end",a),t.on("close",s));var o=!1;function a(){o||(o=!0,r.end())}function s(){o||(o=!0,typeof r.destroy=="function"&&r.destroy())}function l(u){if(c(),Nc.listenerCount(this,"error")===0)throw u}t.on("error",l),r.on("error",l);function c(){t.removeListener("data",n),r.removeListener("drain",i),t.removeListener("end",a),t.removeListener("close",s),t.removeListener("error",l),r.removeListener("error",l),t.removeListener("end",c),t.removeListener("close",c),r.removeListener("close",c)}return t.on("end",c),t.on("close",c),r.on("close",c),r.emit("pipe",t),r};(function(r){(function(e){e.parser=function(X,C){return new n(X,C)},e.SAXParser=n,e.SAXStream=u,e.createStream=c,e.MAX_BUFFER_LENGTH=64*1024;var t=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];e.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function n(X,C){if(!(this instanceof n))return new n(X,C);var G=this;o(G),G.q=G.c="",G.bufferCheckPosition=e.MAX_BUFFER_LENGTH,G.opt=C||{},G.opt.lowercase=G.opt.lowercase||G.opt.lowercasetags,G.looseCase=G.opt.lowercase?"toLowerCase":"toUpperCase",G.tags=[],G.closed=G.closedRoot=G.sawRoot=!1,G.tag=G.error=null,G.strict=!!X,G.noscript=!!(X||G.opt.noscript),G.state=_.BEGIN,G.strictEntities=G.opt.strictEntities,G.ENTITIES=G.strictEntities?Object.create(e.XML_ENTITIES):Object.create(e.ENTITIES),G.attribList=[],G.opt.xmlns&&(G.ns=Object.create(g)),G.trackPosition=G.opt.position!==!1,G.trackPosition&&(G.position=G.line=G.column=0),te(G,"onready")}Object.create||(Object.create=function(X){function C(){}C.prototype=X;var G=new C;return G}),Object.keys||(Object.keys=function(X){var C=[];for(var G in X)X.hasOwnProperty(G)&&C.push(G);return C});function i(X){for(var C=Math.max(e.MAX_BUFFER_LENGTH,10),G=0,z=0,H=t.length;zC)switch(t[z]){case"textNode":I(X);break;case"cdata":O(X,"oncdata",X.cdata),X.cdata="";break;case"script":O(X,"onscript",X.script),X.script="";break;default:L(X,"Max buffer length exceeded: "+t[z])}G=Math.max(G,j)}var ue=e.MAX_BUFFER_LENGTH-G;X.bufferCheckPosition=ue+X.position}function o(X){for(var C=0,G=t.length;C"||T(X)}function D(X,C){return X.test(C)}function W(X,C){return!D(X,C)}var _=0;e.STATE={BEGIN:_++,BEGIN_WHITESPACE:_++,TEXT:_++,TEXT_ENTITY:_++,OPEN_WAKA:_++,SGML_DECL:_++,SGML_DECL_QUOTED:_++,DOCTYPE:_++,DOCTYPE_QUOTED:_++,DOCTYPE_DTD:_++,DOCTYPE_DTD_QUOTED:_++,COMMENT_STARTING:_++,COMMENT:_++,COMMENT_ENDING:_++,COMMENT_ENDED:_++,CDATA:_++,CDATA_ENDING:_++,CDATA_ENDING_2:_++,PROC_INST:_++,PROC_INST_BODY:_++,PROC_INST_ENDING:_++,OPEN_TAG:_++,OPEN_TAG_SLASH:_++,ATTRIB:_++,ATTRIB_NAME:_++,ATTRIB_NAME_SAW_WHITE:_++,ATTRIB_VALUE:_++,ATTRIB_VALUE_QUOTED:_++,ATTRIB_VALUE_CLOSED:_++,ATTRIB_VALUE_UNQUOTED:_++,ATTRIB_VALUE_ENTITY_Q:_++,ATTRIB_VALUE_ENTITY_U:_++,CLOSE_TAG:_++,CLOSE_TAG_SAW_WHITE:_++,SCRIPT:_++,SCRIPT_ENDING:_++},e.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},e.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(e.ENTITIES).forEach(function(X){var C=e.ENTITIES[X],G=typeof C=="number"?String.fromCharCode(C):C;e.ENTITIES[X]=G});for(var Q in e.STATE)e.STATE[e.STATE[Q]]=Q;_=e.STATE;function te(X,C,G){X[C]&&X[C](G)}function O(X,C,G){X.textNode&&I(X),te(X,C,G)}function I(X){X.textNode=y(X.opt,X.textNode),X.textNode&&te(X,"ontext",X.textNode),X.textNode=""}function y(X,C){return X.trim&&(C=C.trim()),X.normalize&&(C=C.replace(/\s+/g," ")),C}function L(X,C){return I(X),X.trackPosition&&(C+=` +Line: `+X.line+` +Column: `+X.column+` +Char: `+X.c),C=new Error(C),X.error=C,te(X,"onerror",C),X}function k(X){return X.sawRoot&&!X.closedRoot&&F(X,"Unclosed root tag"),X.state!==_.BEGIN&&X.state!==_.BEGIN_WHITESPACE&&X.state!==_.TEXT&&L(X,"Unexpected end"),I(X),X.c="",X.closed=!0,te(X,"onend"),n.call(X,X.strict,X.opt),X}function F(X,C){if(typeof X!="object"||!(X instanceof n))throw new Error("bad call to strictFail");X.strict&&L(X,C)}function Y(X){X.strict||(X.tagName=X.tagName[X.looseCase]());var C=X.tags[X.tags.length-1]||X,G=X.tag={name:X.tagName,attributes:{}};X.opt.xmlns&&(G.ns=C.ns),X.attribList.length=0,O(X,"onopentagstart",G)}function V(X,C){var G=X.indexOf(":"),z=G<0?["",X]:X.split(":"),H=z[0],j=z[1];return C&&X==="xmlns"&&(H="xmlns",j=""),{prefix:H,local:j}}function ie(X){if(X.strict||(X.attribName=X.attribName[X.looseCase]()),X.attribList.indexOf(X.attribName)!==-1||X.tag.attributes.hasOwnProperty(X.attribName)){X.attribName=X.attribValue="";return}if(X.opt.xmlns){var C=V(X.attribName,!0),G=C.prefix,z=C.local;if(G==="xmlns")if(z==="xml"&&X.attribValue!==f)F(X,"xml: prefix must be bound to "+f+` +Actual: `+X.attribValue);else if(z==="xmlns"&&X.attribValue!==p)F(X,"xmlns: prefix must be bound to "+p+` +Actual: `+X.attribValue);else{var H=X.tag,j=X.tags[X.tags.length-1]||X;H.ns===j.ns&&(H.ns=Object.create(j.ns)),H.ns[z]=X.attribValue}X.attribList.push([X.attribName,X.attribValue])}else X.tag.attributes[X.attribName]=X.attribValue,O(X,"onattribute",{name:X.attribName,value:X.attribValue});X.attribName=X.attribValue=""}function U(X,C){if(X.opt.xmlns){var G=X.tag,z=V(X.tagName);G.prefix=z.prefix,G.local=z.local,G.uri=G.ns[z.prefix]||"",G.prefix&&!G.uri&&(F(X,"Unbound namespace prefix: "+JSON.stringify(X.tagName)),G.uri=z.prefix);var H=X.tags[X.tags.length-1]||X;G.ns&&H.ns!==G.ns&&Object.keys(G.ns).forEach(function(Z){O(X,"onopennamespace",{prefix:Z,uri:G.ns[Z]})});for(var j=0,ue=X.attribList.length;j",X.tagName="",X.state=_.SCRIPT;return}O(X,"onscript",X.script),X.script=""}var C=X.tags.length,G=X.tagName;X.strict||(G=G[X.looseCase]());for(var z=G;C--;){var H=X.tags[C];if(H.name!==z)F(X,"Unexpected close tag");else break}if(C<0){F(X,"Unmatched closing tag: "+X.tagName),X.textNode+="",X.state=_.TEXT;return}X.tagName=G;for(var j=X.tags.length;j-- >C;){var ue=X.tag=X.tags.pop();X.tagName=X.tag.name,O(X,"onclosetag",X.tagName);var b={};for(var q in ue.ns)b[q]=ue.ns[q];var M=X.tags[X.tags.length-1]||X;X.opt.xmlns&&ue.ns!==M.ns&&Object.keys(ue.ns).forEach(function(w){var S=ue.ns[w];O(X,"onclosenamespace",{prefix:w,uri:S})})}C===0&&(X.closedRoot=!0),X.tagName=X.attribValue=X.attribName="",X.attribList.length=0,X.state=_.TEXT}function J(X){var C=X.entity,G=C.toLowerCase(),z,H="";return X.ENTITIES[C]?X.ENTITIES[C]:X.ENTITIES[G]?X.ENTITIES[G]:(C=G,C.charAt(0)==="#"&&(C.charAt(1)==="x"?(C=C.slice(2),z=parseInt(C,16),H=z.toString(16)):(C=C.slice(1),z=parseInt(C,10),H=z.toString(10))),C=C.replace(/^0+/,""),isNaN(z)||H.toLowerCase()!==C?(F(X,"Invalid character entity"),"&"+X.entity+";"):String.fromCodePoint(z))}function B(X,C){C==="<"?(X.state=_.OPEN_WAKA,X.startTagPosition=X.position):T(C)||(F(X,"Non-whitespace before first tag."),X.textNode=C,X.state=_.TEXT)}function re(X,C){var G="";return C"?(O(C,"onsgmldeclaration",C.sgmlDecl),C.sgmlDecl="",C.state=_.TEXT):(P(z)&&(C.state=_.SGML_DECL_QUOTED),C.sgmlDecl+=z);continue;case _.SGML_DECL_QUOTED:z===C.q&&(C.state=_.SGML_DECL,C.q=""),C.sgmlDecl+=z;continue;case _.DOCTYPE:z===">"?(C.state=_.TEXT,O(C,"ondoctype",C.doctype),C.doctype=!0):(C.doctype+=z,z==="["?C.state=_.DOCTYPE_DTD:P(z)&&(C.state=_.DOCTYPE_QUOTED,C.q=z));continue;case _.DOCTYPE_QUOTED:C.doctype+=z,z===C.q&&(C.q="",C.state=_.DOCTYPE);continue;case _.DOCTYPE_DTD:C.doctype+=z,z==="]"?C.state=_.DOCTYPE:P(z)&&(C.state=_.DOCTYPE_DTD_QUOTED,C.q=z);continue;case _.DOCTYPE_DTD_QUOTED:C.doctype+=z,z===C.q&&(C.state=_.DOCTYPE_DTD,C.q="");continue;case _.COMMENT:z==="-"?C.state=_.COMMENT_ENDING:C.comment+=z;continue;case _.COMMENT_ENDING:z==="-"?(C.state=_.COMMENT_ENDED,C.comment=y(C.opt,C.comment),C.comment&&O(C,"oncomment",C.comment),C.comment=""):(C.comment+="-"+z,C.state=_.COMMENT);continue;case _.COMMENT_ENDED:z!==">"?(F(C,"Malformed comment"),C.comment+="--"+z,C.state=_.COMMENT):C.state=_.TEXT;continue;case _.CDATA:z==="]"?C.state=_.CDATA_ENDING:C.cdata+=z;continue;case _.CDATA_ENDING:z==="]"?C.state=_.CDATA_ENDING_2:(C.cdata+="]"+z,C.state=_.CDATA);continue;case _.CDATA_ENDING_2:z===">"?(C.cdata&&O(C,"oncdata",C.cdata),O(C,"onclosecdata"),C.cdata="",C.state=_.TEXT):z==="]"?C.cdata+="]":(C.cdata+="]]"+z,C.state=_.CDATA);continue;case _.PROC_INST:z==="?"?C.state=_.PROC_INST_ENDING:T(z)?C.state=_.PROC_INST_BODY:C.procInstName+=z;continue;case _.PROC_INST_BODY:if(!C.procInstBody&&T(z))continue;z==="?"?C.state=_.PROC_INST_ENDING:C.procInstBody+=z;continue;case _.PROC_INST_ENDING:z===">"?(O(C,"onprocessinginstruction",{name:C.procInstName,body:C.procInstBody}),C.procInstName=C.procInstBody="",C.state=_.TEXT):(C.procInstBody+="?"+z,C.state=_.PROC_INST_BODY);continue;case _.OPEN_TAG:D(R,z)?C.tagName+=z:(Y(C),z===">"?U(C):z==="/"?C.state=_.OPEN_TAG_SLASH:(T(z)||F(C,"Invalid character in tag name"),C.state=_.ATTRIB));continue;case _.OPEN_TAG_SLASH:z===">"?(U(C,!0),N(C)):(F(C,"Forward-slash in opening tag not followed by >"),C.state=_.ATTRIB);continue;case _.ATTRIB:if(T(z))continue;z===">"?U(C):z==="/"?C.state=_.OPEN_TAG_SLASH:D(v,z)?(C.attribName=z,C.attribValue="",C.state=_.ATTRIB_NAME):F(C,"Invalid attribute name");continue;case _.ATTRIB_NAME:z==="="?C.state=_.ATTRIB_VALUE:z===">"?(F(C,"Attribute without value"),C.attribValue=C.attribName,ie(C),U(C)):T(z)?C.state=_.ATTRIB_NAME_SAW_WHITE:D(R,z)?C.attribName+=z:F(C,"Invalid attribute name");continue;case _.ATTRIB_NAME_SAW_WHITE:if(z==="=")C.state=_.ATTRIB_VALUE;else{if(T(z))continue;F(C,"Attribute without value"),C.tag.attributes[C.attribName]="",C.attribValue="",O(C,"onattribute",{name:C.attribName,value:""}),C.attribName="",z===">"?U(C):D(v,z)?(C.attribName=z,C.state=_.ATTRIB_NAME):(F(C,"Invalid attribute name"),C.state=_.ATTRIB)}continue;case _.ATTRIB_VALUE:if(T(z))continue;P(z)?(C.q=z,C.state=_.ATTRIB_VALUE_QUOTED):(F(C,"Unquoted attribute value"),C.state=_.ATTRIB_VALUE_UNQUOTED,C.attribValue=z);continue;case _.ATTRIB_VALUE_QUOTED:if(z!==C.q){z==="&"?C.state=_.ATTRIB_VALUE_ENTITY_Q:C.attribValue+=z;continue}ie(C),C.q="",C.state=_.ATTRIB_VALUE_CLOSED;continue;case _.ATTRIB_VALUE_CLOSED:T(z)?C.state=_.ATTRIB:z===">"?U(C):z==="/"?C.state=_.OPEN_TAG_SLASH:D(v,z)?(F(C,"No whitespace between attributes"),C.attribName=z,C.attribValue="",C.state=_.ATTRIB_NAME):F(C,"Invalid attribute name");continue;case _.ATTRIB_VALUE_UNQUOTED:if(!A(z)){z==="&"?C.state=_.ATTRIB_VALUE_ENTITY_U:C.attribValue+=z;continue}ie(C),z===">"?U(C):C.state=_.ATTRIB;continue;case _.CLOSE_TAG:if(C.tagName)z===">"?N(C):D(R,z)?C.tagName+=z:C.script?(C.script+=""?N(C):F(C,"Invalid characters in closing tag");continue;case _.TEXT_ENTITY:case _.ATTRIB_VALUE_ENTITY_Q:case _.ATTRIB_VALUE_ENTITY_U:var ue,b;switch(C.state){case _.TEXT_ENTITY:ue=_.TEXT,b="textNode";break;case _.ATTRIB_VALUE_ENTITY_Q:ue=_.ATTRIB_VALUE_QUOTED,b="attribValue";break;case _.ATTRIB_VALUE_ENTITY_U:ue=_.ATTRIB_VALUE_UNQUOTED,b="attribValue";break}z===";"?(C[b]+=J(C),C.entity="",C.state=ue):D(C.entity.length?x:m,z)?C.entity+=z:(F(C,"Invalid character in entity name"),C[b]+="&"+C.entity+z,C.entity="",C.state=ue);continue;default:throw new Error(C,"Unknown state: "+C.state)}return C.position>=C.bufferCheckPosition&&i(C),C}/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */String.fromCodePoint||function(){var X=String.fromCharCode,C=Math.floor,G=function(){var z=16384,H=[],j,ue,b=-1,q=arguments.length;if(!q)return"";for(var M="";++b1114111||C(w)!==w)throw RangeError("Invalid code point: "+w);w<=65535?H.push(w):(w-=65536,j=(w>>10)+55296,ue=w%1024+56320,H.push(j,ue)),(b+1===q||H.length>z)&&(M+=X.apply(null,H),H.length=0)}return M};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:G,configurable:!0,writable:!0}):String.fromCodePoint=G}()})(r)})(p0);var Mc={isArray:function(r){return Array.isArray?Array.isArray(r):Object.prototype.toString.call(r)==="[object Array]"}},Jy=Mc.isArray,Lc={copyOptions:function(r){var e,t={};for(e in r)r.hasOwnProperty(e)&&(t[e]=r[e]);return t},ensureFlagExists:function(r,e){(!(r in e)||typeof e[r]!="boolean")&&(e[r]=!1)},ensureSpacesExists:function(r){(!("spaces"in r)||typeof r.spaces!="number"&&typeof r.spaces!="string")&&(r.spaces=0)},ensureAlwaysArrayExists:function(r){(!("alwaysArray"in r)||typeof r.alwaysArray!="boolean"&&!Jy(r.alwaysArray))&&(r.alwaysArray=!1)},ensureKeyExists:function(r,e){(!(r+"Key"in e)||typeof e[r+"Key"]!="string")&&(e[r+"Key"]=e.compact?"_"+r:r)},checkFnExists:function(r,e){return r+"Fn"in e}},zy=p0,ot=Lc,Mi=Mc.isArray,me,We;function $y(r){return me=ot.copyOptions(r),ot.ensureFlagExists("ignoreDeclaration",me),ot.ensureFlagExists("ignoreInstruction",me),ot.ensureFlagExists("ignoreAttributes",me),ot.ensureFlagExists("ignoreText",me),ot.ensureFlagExists("ignoreComment",me),ot.ensureFlagExists("ignoreCdata",me),ot.ensureFlagExists("ignoreDoctype",me),ot.ensureFlagExists("compact",me),ot.ensureFlagExists("alwaysChildren",me),ot.ensureFlagExists("addParent",me),ot.ensureFlagExists("trim",me),ot.ensureFlagExists("nativeType",me),ot.ensureFlagExists("nativeTypeAttributes",me),ot.ensureFlagExists("sanitize",me),ot.ensureFlagExists("instructionHasAttributes",me),ot.ensureFlagExists("captureSpacesBetweenElements",me),ot.ensureAlwaysArrayExists(me),ot.ensureKeyExists("declaration",me),ot.ensureKeyExists("instruction",me),ot.ensureKeyExists("attributes",me),ot.ensureKeyExists("text",me),ot.ensureKeyExists("comment",me),ot.ensureKeyExists("cdata",me),ot.ensureKeyExists("doctype",me),ot.ensureKeyExists("type",me),ot.ensureKeyExists("name",me),ot.ensureKeyExists("elements",me),ot.ensureKeyExists("parent",me),me}function W0(r){var e=Number(r);if(!isNaN(e))return e;var t=r.toLowerCase();return t==="true"?!0:t==="false"?!1:r}function Ao(r,e){var t;if(me.compact){if(!We[me[r+"Key"]]&&(Mi(me.alwaysArray)?me.alwaysArray.indexOf(me[r+"Key"])!==-1:me.alwaysArray)&&(We[me[r+"Key"]]=[]),We[me[r+"Key"]]&&!Mi(We[me[r+"Key"]])&&(We[me[r+"Key"]]=[We[me[r+"Key"]]]),r+"Fn"in me&&typeof e=="string"&&(e=me[r+"Fn"](e,We)),r==="instruction"&&("instructionFn"in me||"instructionNameFn"in me)){for(t in e)if(e.hasOwnProperty(t))if("instructionFn"in me)e[t]=me.instructionFn(e[t],t,We);else{var n=e[t];delete e[t],e[me.instructionNameFn(t,n,We)]=n}}Mi(We[me[r+"Key"]])?We[me[r+"Key"]].push(e):We[me[r+"Key"]]=e}else{We[me.elementsKey]||(We[me.elementsKey]=[]);var i={};if(i[me.typeKey]=r,r==="instruction"){for(t in e)if(e.hasOwnProperty(t))break;i[me.nameKey]="instructionNameFn"in me?me.instructionNameFn(t,e,We):t,me.instructionHasAttributes?(i[me.attributesKey]=e[t][me.attributesKey],"instructionFn"in me&&(i[me.attributesKey]=me.instructionFn(i[me.attributesKey],t,We))):("instructionFn"in me&&(e[t]=me.instructionFn(e[t],t,We)),i[me.instructionKey]=e[t])}else r+"Fn"in me&&(e=me[r+"Fn"](e,We)),i[me[r+"Key"]]=e;me.addParent&&(i[me.parentKey]=We),We[me.elementsKey].push(i)}}function V0(r){if("attributesFn"in me&&r&&(r=me.attributesFn(r,We)),(me.trim||"attributeValueFn"in me||"attributeNameFn"in me||me.nativeTypeAttributes)&&r){var e;for(e in r)if(r.hasOwnProperty(e)&&(me.trim&&(r[e]=r[e].trim()),me.nativeTypeAttributes&&(r[e]=W0(r[e])),"attributeValueFn"in me&&(r[e]=me.attributeValueFn(r[e],e,We)),"attributeNameFn"in me)){var t=r[e];delete r[e],r[me.attributeNameFn(e,r[e],We)]=t}}return r}function jy(r){var e={};if(r.body&&(r.name.toLowerCase()==="xml"||me.instructionHasAttributes)){for(var t=/([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|(\w+))\s*/g,n;(n=t.exec(r.body))!==null;)e[n[1]]=n[2]||n[3]||n[4];e=V0(e)}if(r.name.toLowerCase()==="xml"){if(me.ignoreDeclaration)return;We[me.declarationKey]={},Object.keys(e).length&&(We[me.declarationKey][me.attributesKey]=e),me.addParent&&(We[me.declarationKey][me.parentKey]=We)}else{if(me.ignoreInstruction)return;me.trim&&(r.body=r.body.trim());var i={};me.instructionHasAttributes&&Object.keys(e).length?(i[r.name]={},i[r.name][me.attributesKey]=e):i[r.name]=r.body,Ao("instruction",i)}}function qy(r,e){var t;if(typeof r=="object"&&(e=r.attributes,r=r.name),e=V0(e),"elementNameFn"in me&&(r=me.elementNameFn(r,We)),me.compact){if(t={},!me.ignoreAttributes&&e&&Object.keys(e).length){t[me.attributesKey]={};var n;for(n in e)e.hasOwnProperty(n)&&(t[me.attributesKey][n]=e[n])}!(r in We)&&(Mi(me.alwaysArray)?me.alwaysArray.indexOf(r)!==-1:me.alwaysArray)&&(We[r]=[]),We[r]&&!Mi(We[r])&&(We[r]=[We[r]]),Mi(We[r])?We[r].push(t):We[r]=t}else We[me.elementsKey]||(We[me.elementsKey]=[]),t={},t[me.typeKey]="element",t[me.nameKey]=r,!me.ignoreAttributes&&e&&Object.keys(e).length&&(t[me.attributesKey]=e),me.alwaysChildren&&(t[me.elementsKey]=[]),We[me.elementsKey].push(t);t[me.parentKey]=We,We=t}function ew(r){me.ignoreText||!r.trim()&&!me.captureSpacesBetweenElements||(me.trim&&(r=r.trim()),me.nativeType&&(r=W0(r)),me.sanitize&&(r=r.replace(/&/g,"&").replace(//g,">")),Ao("text",r))}function tw(r){me.ignoreComment||(me.trim&&(r=r.trim()),Ao("comment",r))}function rw(r){var e=We[me.parentKey];me.addParent||delete We[me.parentKey],We=e}function nw(r){me.ignoreCdata||(me.trim&&(r=r.trim()),Ao("cdata",r))}function iw(r){me.ignoreDoctype||(r=r.replace(/^ /,""),me.trim&&(r=r.trim()),Ao("doctype",r))}function ow(r){r.note=r}var Y0=function(r,e){var t=zy.parser(!0,{}),n={};if(We=n,me=$y(e),t.opt={strictEntities:!0},t.onopentag=qy,t.ontext=ew,t.oncomment=tw,t.onclosetag=rw,t.onerror=ow,t.oncdata=nw,t.ondoctype=iw,t.onprocessinginstruction=jy,t.write(r).close(),n[me.elementsKey]){var i=n[me.elementsKey];delete n[me.elementsKey],n[me.elementsKey]=i,delete n.text}return n},ef=Lc,aw=Y0;function sw(r){var e=ef.copyOptions(r);return ef.ensureSpacesExists(e),e}var lw=function(r,e){var t,n,i,o;return t=sw(e),n=aw(r,t),o="compact"in t&&t.compact?"_parent":"parent","addParent"in t&&t.addParent?i=JSON.stringify(n,function(a,s){return a===o?"_":s},t.spaces):i=JSON.stringify(n,null,t.spaces),i.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")},pt=Lc,cw=Mc.isArray,hr,fr;function uw(r){var e=pt.copyOptions(r);return pt.ensureFlagExists("ignoreDeclaration",e),pt.ensureFlagExists("ignoreInstruction",e),pt.ensureFlagExists("ignoreAttributes",e),pt.ensureFlagExists("ignoreText",e),pt.ensureFlagExists("ignoreComment",e),pt.ensureFlagExists("ignoreCdata",e),pt.ensureFlagExists("ignoreDoctype",e),pt.ensureFlagExists("compact",e),pt.ensureFlagExists("indentText",e),pt.ensureFlagExists("indentCdata",e),pt.ensureFlagExists("indentAttributes",e),pt.ensureFlagExists("indentInstruction",e),pt.ensureFlagExists("fullTagEmptyElement",e),pt.ensureFlagExists("noQuotesForNativeAttributes",e),pt.ensureSpacesExists(e),typeof e.spaces=="number"&&(e.spaces=Array(e.spaces+1).join(" ")),pt.ensureKeyExists("declaration",e),pt.ensureKeyExists("instruction",e),pt.ensureKeyExists("attributes",e),pt.ensureKeyExists("text",e),pt.ensureKeyExists("comment",e),pt.ensureKeyExists("cdata",e),pt.ensureKeyExists("doctype",e),pt.ensureKeyExists("type",e),pt.ensureKeyExists("name",e),pt.ensureKeyExists("elements",e),e}function on(r,e,t){return(!t&&r.spaces?` +`:"")+Array(e+1).join(r.spaces)}function za(r,e,t){if(e.ignoreAttributes)return"";"attributesFn"in e&&(r=e.attributesFn(r,fr,hr));var n,i,o,a,s=[];for(n in r)r.hasOwnProperty(n)&&r[n]!==null&&r[n]!==void 0&&(a=e.noQuotesForNativeAttributes&&typeof r[n]!="string"?"":'"',i=""+r[n],i=i.replace(/"/g,"""),o="attributeNameFn"in e?e.attributeNameFn(n,i,fr,hr):n,s.push(e.spaces&&e.indentAttributes?on(e,t+1,!1):" "),s.push(o+"="+a+("attributeValueFn"in e?e.attributeValueFn(i,n,fr,hr):i)+a));return r&&Object.keys(r).length&&e.spaces&&e.indentAttributes&&s.push(on(e,t,!1)),s.join("")}function k0(r,e,t){return hr=r,fr="xml",e.ignoreDeclaration?"":""}function Z0(r,e,t){if(e.ignoreInstruction)return"";var n;for(n in r)if(r.hasOwnProperty(n))break;var i="instructionNameFn"in e?e.instructionNameFn(n,r[n],fr,hr):n;if(typeof r[n]=="object")return hr=r,fr=i,"";var o=r[n]?r[n]:"";return"instructionFn"in e&&(o=e.instructionFn(o,n,fr,hr)),""}function Q0(r,e){return e.ignoreComment?"":""}function K0(r,e){return e.ignoreCdata?"":"","]]]]>"))+"]]>"}function H0(r,e){return e.ignoreDoctype?"":""}function Fc(r,e){return e.ignoreText?"":(r=""+r,r=r.replace(/&/g,"&"),r=r.replace(/&/g,"&").replace(//g,">"),"textFn"in e?e.textFn(r,fr,hr):r)}function hw(r,e){var t;if(r.elements&&r.elements.length)for(t=0;t"),r[e.elementsKey]&&r[e.elementsKey].length&&(n.push(B0(r[e.elementsKey],e,t+1)),hr=r,fr=r.name),n.push(e.spaces&&hw(r,e)?` +`+Array(t+1).join(e.spaces):""),n.push("")):n.push("/>"),n.join("")}function B0(r,e,t,n){return r.reduce(function(i,o){var a=on(e,t,n&&!i);switch(o.type){case"element":return i+a+fw(o,e,t);case"comment":return i+a+Q0(o[e.commentKey],e);case"doctype":return i+a+H0(o[e.doctypeKey],e);case"cdata":return i+(e.indentCdata?a:"")+K0(o[e.cdataKey],e);case"text":return i+(e.indentText?a:"")+Fc(o[e.textKey],e);case"instruction":var s={};return s[o[e.nameKey]]=o[e.attributesKey]?o:o[e.instructionKey],i+(e.indentInstruction?a:"")+Z0(s,e,t)}},"")}function G0(r,e,t){var n;for(n in r)if(r.hasOwnProperty(n))switch(n){case e.parentKey:case e.attributesKey:break;case e.textKey:if(e.indentText||t)return!0;break;case e.cdataKey:if(e.indentCdata||t)return!0;break;case e.instructionKey:if(e.indentInstruction||t)return!0;break;case e.doctypeKey:case e.commentKey:return!0;default:return!0}return!1}function dw(r,e,t,n,i){hr=r,fr=e;var o="elementNameFn"in t?t.elementNameFn(e,r):e;if(typeof r=="undefined"||r===null||r==="")return"fullTagEmptyElementFn"in t&&t.fullTagEmptyElementFn(e,r)||t.fullTagEmptyElement?"<"+o+">":"<"+o+"/>";var a=[];if(e){if(a.push("<"+o),typeof r!="object")return a.push(">"+Fc(r,t)+""),a.join("");r[t.attributesKey]&&a.push(za(r[t.attributesKey],t,n));var s=G0(r,t,!0)||r[t.attributesKey]&&r[t.attributesKey]["xml:space"]==="preserve";if(s||("fullTagEmptyElementFn"in t?s=t.fullTagEmptyElementFn(e,r):s=t.fullTagEmptyElement),s)a.push(">");else return a.push("/>"),a.join("")}return a.push(J0(r,t,n+1,!1)),hr=r,fr=e,e&&a.push((i?on(t,n,!1):"")+""),a.join("")}function J0(r,e,t,n){var i,o,a,s=[];for(o in r)if(r.hasOwnProperty(o))for(a=cw(r[o])?r[o]:[r[o]],i=0;i{switch(r.type){case void 0:case"element":const e=new Sw(r.name,r.attributes),t=r.elements||[];for(const n of t){const i=Cc(n);i!==void 0&&e.push(i)}return e;case"text":return r.text;default:return}};class ww extends _e{}class Sw extends de{static fromXmlString(e){const t=$0.xml2js(e,{compact:!1});return Cc(t)}constructor(e,t){super(e),t&&this.root.push(new ww(t))}push(e){this.root.push(e)}}class xw extends de{constructor(e){super(""),this._attr=e}prepForXml(e){return{_attr:this._attr}}}class j0 extends de{constructor(e,t){super(e),t&&(this.root=t.root)}}const dr=r=>{if(isNaN(r))throw new Error(`Invalid value '${r}' specified. Must be an integer.`);return Math.floor(r)},$a=r=>{const e=dr(r);if(e<0)throw new Error(`Invalid value '${r}' specified. Must be a positive integer.`);return e},q0=(r,e)=>{const t=e*2;if(r.length!==t||isNaN(Number(`0x${r}`)))throw new Error(`Invalid hex value '${r}'. Expected ${t} digit hex value`);return r},tf=r=>q0(r,1),Ac=r=>{const e=r.slice(-2),t=r.substring(0,r.length-2);return`${Number(t)}${e}`},ep=r=>{const e=Ac(r);if(parseFloat(e)<0)throw new Error(`Invalid value '${e}' specified. Expected a positive number.`);return e},Ui=r=>{if(r==="auto")return r;const e=r.charAt(0)==="#"?r.substring(1):r;return q0(e,3)},vn=r=>typeof r=="string"?Ac(r):dr(r),bw=r=>typeof r=="string"?ep(r):$a(r),or=r=>typeof r=="string"?ep(r):$a(r),Ow=r=>{const e=r.substring(0,r.length-1);return`${Number(e)}%`},Tw=r=>typeof r=="number"?dr(r):r.slice(-1)==="%"?Ow(r):Ac(r),Pw=$a,Ew=$a,_w=r=>r.toISOString();class be extends de{constructor(e,t=!0){super(e),t!==!0&&this.root.push(new Ft({val:t}))}}class ul extends de{constructor(e,t){super(e),this.root.push(new Ft({val:bw(t)}))}}class Iw extends de{}class qn extends de{constructor(e,t){super(e),this.root.push(new Ft({val:t}))}}const io=(r,e)=>new pr({name:r,attributes:{value:{key:"w:val",value:e}}});class Dc extends de{constructor(e,t){super(e),this.root.push(new Ft({val:t}))}}class Nw extends de{constructor(e,t){super(e),this.root.push(new Ft({val:t}))}}class Vn extends de{constructor(e,t){super(e),this.root.push(t)}}class pr extends de{constructor({name:e,attributes:t,children:n}){super(e),t&&this.root.push(new bn(t)),n&&this.root.push(...n)}}const en={START:"start",CENTER:"center",END:"end",BOTH:"both",MEDIUM_KASHIDA:"mediumKashida",DISTRIBUTE:"distribute",NUM_TAB:"numTab",HIGH_KASHIDA:"highKashida",LOW_KASHIDA:"lowKashida",THAI_DISTRIBUTE:"thaiDistribute",LEFT:"left",RIGHT:"right",JUSTIFIED:"both"};class Mw extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{val:"w:val"})}}class tp extends de{constructor(e){super("w:jc"),this.root.push(new Mw({val:e}))}}class ut extends de{constructor(e,{color:t,size:n,space:i,style:o}){super(e),this.root.push(new Lw({style:o,color:t===void 0?void 0:Ui(t),size:n===void 0?void 0:Pw(n),space:i===void 0?void 0:Ew(i)}))}}class Lw extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{style:"w:val",color:"w:color",size:"w:sz",space:"w:space"})}}const Xc={SINGLE:"single",DASH_DOT_STROKED:"dashDotStroked",DASHED:"dashed",DASH_SMALL_GAP:"dashSmallGap",DOT_DASH:"dotDash",DOT_DOT_DASH:"dotDotDash",DOTTED:"dotted",DOUBLE:"double",DOUBLE_WAVE:"doubleWave",INSET:"inset",NIL:"nil",NONE:"none",OUTSET:"outset",THICK:"thick",THICK_THIN_LARGE_GAP:"thickThinLargeGap",THICK_THIN_MEDIUM_GAP:"thickThinMediumGap",THICK_THIN_SMALL_GAP:"thickThinSmallGap",THIN_THICK_LARGE_GAP:"thinThickLargeGap",THIN_THICK_MEDIUM_GAP:"thinThickMediumGap",THIN_THICK_SMALL_GAP:"thinThickSmallGap",THIN_THICK_THIN_LARGE_GAP:"thinThickThinLargeGap",THIN_THICK_THIN_MEDIUM_GAP:"thinThickThinMediumGap",THIN_THICK_THIN_SMALL_GAP:"thinThickThinSmallGap",THREE_D_EMBOSS:"threeDEmboss",THREE_D_ENGRAVE:"threeDEngrave",TRIPLE:"triple",WAVE:"wave"};class Fw extends xn{constructor(e){super("w:pBdr"),e.top&&this.root.push(new ut("w:top",e.top)),e.bottom&&this.root.push(new ut("w:bottom",e.bottom)),e.left&&this.root.push(new ut("w:left",e.left)),e.right&&this.root.push(new ut("w:right",e.right))}}class Cw extends de{constructor(){super("w:pBdr");const e=new ut("w:bottom",{color:"auto",space:1,style:Xc.SINGLE,size:6});this.root.push(e)}}class Aw extends de{constructor({start:e,end:t,left:n,right:i,hanging:o,firstLine:a}){super("w:ind"),this.root.push(new bn({start:{key:"w:start",value:e===void 0?void 0:vn(e)},end:{key:"w:end",value:t===void 0?void 0:vn(t)},left:{key:"w:left",value:n===void 0?void 0:vn(n)},right:{key:"w:right",value:i===void 0?void 0:vn(i)},hanging:{key:"w:hanging",value:o===void 0?void 0:or(o)},firstLine:{key:"w:firstLine",value:a===void 0?void 0:or(a)}}))}}let Dw=class extends de{constructor(){super("w:br")}};const Uc={BEGIN:"begin",END:"end",SEPARATE:"separate"};class Wc extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{type:"w:fldCharType",dirty:"w:dirty"})}}class ta extends de{constructor(e){super("w:fldChar"),this.root.push(new Wc({type:Uc.BEGIN,dirty:e}))}}class ra extends de{constructor(e){super("w:fldChar"),this.root.push(new Wc({type:Uc.SEPARATE,dirty:e}))}}class na extends de{constructor(e){super("w:fldChar"),this.root.push(new Wc({type:Uc.END,dirty:e}))}}const Wi={DEFAULT:"default",PRESERVE:"preserve"};class Vi extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{space:"xml:space"})}}class Xw extends de{constructor(){super("w:instrText"),this.root.push(new Vi({space:Wi.PRESERVE})),this.root.push("PAGE")}}class Uw extends de{constructor(){super("w:instrText"),this.root.push(new Vi({space:Wi.PRESERVE})),this.root.push("NUMPAGES")}}class Ww extends de{constructor(){super("w:instrText"),this.root.push(new Vi({space:Wi.PRESERVE})),this.root.push("SECTIONPAGES")}}class Vw extends de{constructor(){super("w:instrText"),this.root.push(new Vi({space:Wi.PRESERVE})),this.root.push("SECTION")}}class Yw extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{fill:"w:fill",color:"w:color",type:"w:val"})}}class ja extends de{constructor({fill:e,color:t,type:n}){super("w:shd"),this.root.push(new Yw({fill:e===void 0?void 0:Ui(e),color:t===void 0?void 0:Ui(t),type:n}))}}class kw extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{id:"w:id",author:"w:author",date:"w:date"})}}const Zw={DOT:"dot"};class Qw extends de{constructor(e){super("w:em"),this.root.push(new Ft({val:e}))}}class Kw extends Qw{constructor(e=Zw.DOT){super(e)}}class Hw extends de{constructor(e){super("w:spacing"),this.root.push(new Ft({val:vn(e)}))}}class Bw extends de{constructor(e){super("w:color"),this.root.push(new Ft({val:Ui(e)}))}}class Gw extends de{constructor(e){super("w:highlight"),this.root.push(new Ft({val:e}))}}class Jw extends de{constructor(e){super("w:highlightCs"),this.root.push(new Ft({val:e}))}}const zw=r=>new pr({name:"w:lang",attributes:{value:{key:"w:val",value:r.value},eastAsia:{key:"w:eastAsia",value:r.eastAsia},bidirectional:{key:"w:bidi",value:r.bidirectional}}});class rf extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{ascii:"w:ascii",cs:"w:cs",eastAsia:"w:eastAsia",hAnsi:"w:hAnsi",hint:"w:hint"})}}class hl extends de{constructor(e,t){if(super("w:rFonts"),typeof e=="string"){const n=e;this.root.push(new rf({ascii:n,cs:n,eastAsia:n,hAnsi:n,hint:t}))}else{const n=e;this.root.push(new rf(n))}}}let rp=class extends de{constructor(e){super("w:vertAlign"),this.root.push(new Ft({val:e}))}};class $w extends rp{constructor(){super("superscript")}}class jw extends rp{constructor(){super("subscript")}}const np={SINGLE:"single",WORDS:"words",DOUBLE:"double",THICK:"thick",DOTTED:"dotted",DOTTEDHEAVY:"dottedHeavy",DASH:"dash",DASHEDHEAVY:"dashedHeavy",DASHLONG:"dashLong",DASHLONGHEAVY:"dashLongHeavy",DOTDASH:"dotDash",DASHDOTHEAVY:"dashDotHeavy",DOTDOTDASH:"dotDotDash",DASHDOTDOTHEAVY:"dashDotDotHeavy",WAVE:"wave",WAVYHEAVY:"wavyHeavy",WAVYDOUBLE:"wavyDouble",NONE:"none"};class qw extends de{constructor(e=np.SINGLE,t){super("w:u"),this.root.push(new Ft({val:e,color:t===void 0?void 0:Ui(t)}))}}class ii extends xn{constructor(e){var t,n;if(super("w:rPr"),!e)return;e.noProof!==void 0&&this.push(new be("w:noProof",e.noProof)),e.bold!==void 0&&this.push(new be("w:b",e.bold)),(e.boldComplexScript===void 0&&e.bold!==void 0||e.boldComplexScript)&&this.push(new be("w:bCs",(t=e.boldComplexScript)!=null?t:e.bold)),e.italics!==void 0&&this.push(new be("w:i",e.italics)),(e.italicsComplexScript===void 0&&e.italics!==void 0||e.italicsComplexScript)&&this.push(new be("w:iCs",(n=e.italicsComplexScript)!=null?n:e.italics)),e.underline&&this.push(new qw(e.underline.type,e.underline.color)),e.effect&&this.push(new qn("w:effect",e.effect)),e.emphasisMark&&this.push(new Kw(e.emphasisMark.type)),e.color&&this.push(new Bw(e.color)),e.kern&&this.push(new ul("w:kern",e.kern)),e.position&&this.push(new qn("w:position",e.position)),e.size!==void 0&&this.push(new ul("w:sz",e.size));const i=e.sizeComplexScript===void 0||e.sizeComplexScript===!0?e.size:e.sizeComplexScript;i&&this.push(new ul("w:szCs",i)),e.rightToLeft!==void 0&&this.push(new be("w:rtl",e.rightToLeft)),e.smallCaps!==void 0?this.push(new be("w:smallCaps",e.smallCaps)):e.allCaps!==void 0&&this.push(new be("w:caps",e.allCaps)),e.strike!==void 0&&this.push(new be("w:strike",e.strike)),e.doubleStrike!==void 0&&this.push(new be("w:dstrike",e.doubleStrike)),e.subScript&&this.push(new jw),e.superScript&&this.push(new $w),e.style&&this.push(new qn("w:rStyle",e.style)),e.font&&(typeof e.font=="string"?this.push(new hl(e.font)):"name"in e.font?this.push(new hl(e.font.name,e.font.hint)):this.push(new hl(e.font))),e.highlight&&this.push(new Gw(e.highlight));const o=e.highlightComplexScript===void 0||e.highlightComplexScript===!0?e.highlight:e.highlightComplexScript;o&&this.push(new Jw(o)),e.characterSpacing&&this.push(new Hw(e.characterSpacing)),e.emboss!==void 0&&this.push(new be("w:emboss",e.emboss)),e.imprint!==void 0&&this.push(new be("w:imprint",e.imprint)),e.shading&&this.push(new ja(e.shading)),e.revision&&this.push(new eS(e.revision)),e.border&&this.push(new ut("w:bdr",e.border)),e.snapToGrid!==void 0&&this.push(new be("w:snapToGrid",e.snapToGrid)),e.vanish&&this.push(new be("w:vanish",e.vanish)),e.specVanish&&this.push(new be("w:specVanish",e.vanish)),e.scale!==void 0&&this.push(new Dc("w:w",e.scale)),e.language&&this.push(zw(e.language)),e.math&&this.push(new be("w:oMath",e.math))}push(e){this.root.push(e)}}class eS extends de{constructor(e){super("w:rPrChange"),this.root.push(new kw({id:e.id,author:e.author,date:e.date})),this.addChildElement(new ii(e))}}class zl extends de{constructor(e){var t;return super("w:t"),typeof e=="string"?(this.root.push(new Vi({space:Wi.PRESERVE})),this.root.push(e),this):(this.root.push(new Vi({space:(t=e.space)!=null?t:Wi.DEFAULT})),this.root.push(e.text),this)}}const ia={CURRENT:"CURRENT",TOTAL_PAGES:"TOTAL_PAGES",TOTAL_PAGES_IN_SECTION:"TOTAL_PAGES_IN_SECTION",CURRENT_SECTION:"SECTION"};class Do extends de{constructor(e){if(super("w:r"),pe(this,"properties"),this.properties=new ii(e),this.root.push(this.properties),e.break)for(let t=0;t(t=e)=>{let n="",i=t;for(;i--;)n+=r[Math.random()*r.length|0];return n},nS=(r=21)=>{let e="",t=r;for(;t--;)e+=tS[Math.random()*64|0];return e};const Qr=r=>Math.floor(r*72*20),qa=(r=0)=>{let e=r;return()=>++e},iS=()=>qa(),oS=()=>qa(1),aS=()=>qa(),sS=()=>qa(),ip=()=>nS().toLowerCase(),oo=r=>rS("1234567890abcdef",r)(),lS=()=>`${oo(8)}-${oo(4)}-${oo(4)}-${oo(4)}-${oo(12)}`,cS={CHARACTER:"character",COLUMN:"column",INSIDE_MARGIN:"insideMargin",LEFT_MARGIN:"leftMargin",MARGIN:"margin",OUTSIDE_MARGIN:"outsideMargin",PAGE:"page",RIGHT_MARGIN:"rightMargin"},uS={BOTTOM_MARGIN:"bottomMargin",INSIDE_MARGIN:"insideMargin",LINE:"line",MARGIN:"margin",OUTSIDE_MARGIN:"outsideMargin",PAGE:"page",PARAGRAPH:"paragraph",TOP_MARGIN:"topMargin"};class hS extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{x:"x",y:"y"})}}class fS extends de{constructor(){super("wp:simplePos"),this.root.push(new hS({x:0,y:0}))}}class op extends de{constructor(e){super("wp:align"),this.root.push(e)}}class ap extends de{constructor(e){super("wp:posOffset"),this.root.push(e.toString())}}class dS extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{relativeFrom:"relativeFrom"})}}class pS extends de{constructor(e){if(super("wp:positionH"),this.root.push(new dS({relativeFrom:e.relative||cS.PAGE})),e.align)this.root.push(new op(e.align));else if(e.offset!==void 0)this.root.push(new ap(e.offset));else throw new Error("There is no configuration provided for floating position (Align or offset)")}}class gS extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{relativeFrom:"relativeFrom"})}}class RS extends de{constructor(e){if(super("wp:positionV"),this.root.push(new gS({relativeFrom:e.relative||uS.PAGE})),e.align)this.root.push(new op(e.align));else if(e.offset!==void 0)this.root.push(new ap(e.offset));else throw new Error("There is no configuration provided for floating position (Align or offset)")}}class mS extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{uri:"uri"})}}class vS extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{embed:"r:embed",cstate:"cstate"})}}class yS extends de{constructor(e){super("a:blip"),this.root.push(new vS({embed:`rId{${e.fileName}}`,cstate:"none"}))}}class wS extends de{constructor(){super("a:srcRect")}}class SS extends de{constructor(){super("a:fillRect")}}class xS extends de{constructor(){super("a:stretch"),this.root.push(new SS)}}class bS extends de{constructor(e){super("pic:blipFill"),this.root.push(new yS(e)),this.root.push(new wS),this.root.push(new xS)}}class OS extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{noChangeAspect:"noChangeAspect",noChangeArrowheads:"noChangeArrowheads"})}}class TS extends de{constructor(){super("a:picLocks"),this.root.push(new OS({noChangeAspect:1,noChangeArrowheads:1}))}}class PS extends de{constructor(){super("pic:cNvPicPr"),this.root.push(new TS)}}const sp=(r,e)=>new pr({name:"a:hlinkClick",attributes:Di($e({},e?{xmlns:{key:"xmlns:a",value:"http://schemas.openxmlformats.org/drawingml/2006/main"}}:{}),{id:{key:"r:id",value:`rId${r}`}})});class ES extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{id:"id",name:"name",descr:"descr"})}}class _S extends de{constructor(){super("pic:cNvPr"),this.root.push(new ES({id:0,name:"",descr:""}))}prepForXml(e){for(let t=e.stack.length-1;t>=0;t--){const n=e.stack[t];if(n instanceof Vc){this.root.push(sp(n.linkId,!1));break}}return super.prepForXml(e)}}class IS extends de{constructor(){super("pic:nvPicPr"),this.root.push(new _S),this.root.push(new PS)}}class NS extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{xmlns:"xmlns:pic"})}}class MS extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{cx:"cx",cy:"cy"})}}class LS extends de{constructor(e,t){super("a:ext"),pe(this,"attributes"),this.attributes=new MS({cx:e,cy:t}),this.root.push(this.attributes)}}class FS extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{x:"x",y:"y"})}}class CS extends de{constructor(){super("a:off"),this.root.push(new FS({x:0,y:0}))}}class AS extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{flipVertical:"flipV",flipHorizontal:"flipH",rotation:"rot"})}}class DS extends de{constructor(e){var t,n;super("a:xfrm"),pe(this,"extents"),this.root.push(new AS({flipVertical:(t=e.flip)==null?void 0:t.vertical,flipHorizontal:(n=e.flip)==null?void 0:n.horizontal,rotation:e.rotation})),this.extents=new LS(e.emus.x,e.emus.y),this.root.push(new CS),this.root.push(this.extents)}}const lp=()=>new pr({name:"a:noFill"}),XS=r=>new pr({name:"a:schemeClr",attributes:{value:{key:"val",value:r.value}}}),US=r=>new pr({name:"a:srgbClr",attributes:{value:{key:"val",value:r.value}}}),nf=r=>new pr({name:"a:solidFill",children:[r.type==="rgb"?US(r):XS(r)]}),WS=r=>new pr({name:"a:ln",attributes:{width:{key:"w",value:r.width},cap:{key:"cap",value:r.cap},compoundLine:{key:"cmpd",value:r.compoundLine},align:{key:"algn",value:r.align}},children:[r.type==="noFill"?lp():r.solidFillType==="rgb"?nf({type:"rgb",value:r.value}):nf({type:"scheme",value:r.value})]});class VS extends de{constructor(){super("a:avLst")}}class YS extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{prst:"prst"})}}class kS extends de{constructor(){super("a:prstGeom"),this.root.push(new YS({prst:"rect"})),this.root.push(new VS)}}class ZS extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{bwMode:"bwMode"})}}class QS extends de{constructor({outline:e,transform:t}){super("pic:spPr"),pe(this,"form"),this.root.push(new ZS({bwMode:"auto"})),this.form=new DS(t),this.root.push(this.form),this.root.push(new kS),e&&(this.root.push(lp()),this.root.push(WS(e)))}}class KS extends de{constructor({mediaData:e,transform:t,outline:n}){super("pic:pic"),this.root.push(new NS({xmlns:"http://schemas.openxmlformats.org/drawingml/2006/picture"})),this.root.push(new IS),this.root.push(new bS(e)),this.root.push(new QS({transform:t,outline:n}))}}class HS extends de{constructor({mediaData:e,transform:t,outline:n}){super("a:graphicData"),pe(this,"pic"),this.root.push(new mS({uri:"http://schemas.openxmlformats.org/drawingml/2006/picture"})),this.pic=new KS({mediaData:e,transform:t,outline:n}),this.root.push(this.pic)}}class BS extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{a:"xmlns:a"})}}class cp extends de{constructor({mediaData:e,transform:t,outline:n}){super("a:graphic"),pe(this,"data"),this.root.push(new BS({a:"http://schemas.openxmlformats.org/drawingml/2006/main"})),this.data=new HS({mediaData:e,transform:t,outline:n}),this.root.push(this.data)}}const oa={NONE:0,SQUARE:1,TIGHT:2,TOP_AND_BOTTOM:3},GS={BOTH_SIDES:"bothSides",LEFT:"left",RIGHT:"right",LARGEST:"largest"};class of extends de{constructor(){super("wp:wrapNone")}}class JS extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{distT:"distT",distB:"distB",distL:"distL",distR:"distR",wrapText:"wrapText"})}}class zS extends de{constructor(e,t={top:0,bottom:0,left:0,right:0}){super("wp:wrapSquare"),this.root.push(new JS({wrapText:e.side||GS.BOTH_SIDES,distT:t.top,distB:t.bottom,distL:t.left,distR:t.right}))}}class $S extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{distT:"distT",distB:"distB"})}}class jS extends de{constructor(e={top:0,bottom:0}){super("wp:wrapTight"),this.root.push(new $S({distT:e.top,distB:e.bottom}))}}class qS extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{distT:"distT",distB:"distB"})}}class ex extends de{constructor(e={top:0,bottom:0}){super("wp:wrapTopAndBottom"),this.root.push(new qS({distT:e.top,distB:e.bottom}))}}class up extends de{constructor({name:e,description:t,title:n}={name:"",description:"",title:""}){super("wp:docPr"),pe(this,"docPropertiesUniqueNumericId",aS()),this.root.push(new bn({id:{key:"id",value:this.docPropertiesUniqueNumericId()},name:{key:"name",value:e},description:{key:"descr",value:t},title:{key:"title",value:n}}))}prepForXml(e){for(let t=e.stack.length-1;t>=0;t--){const n=e.stack[t];if(n instanceof Vc){this.root.push(sp(n.linkId,!0));break}}return super.prepForXml(e)}}const hp=({top:r,right:e,bottom:t,left:n})=>new pr({name:"wp:effectExtent",attributes:{top:{key:"t",value:r},right:{key:"r",value:e},bottom:{key:"b",value:t},left:{key:"l",value:n}}});class tx extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{cx:"cx",cy:"cy"})}}class fp extends de{constructor(e,t){super("wp:extent"),pe(this,"attributes"),this.attributes=new tx({cx:e,cy:t}),this.root.push(this.attributes)}}class rx extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{xmlns:"xmlns:a",noChangeAspect:"noChangeAspect"})}}class nx extends de{constructor(){super("a:graphicFrameLocks"),this.root.push(new rx({xmlns:"http://schemas.openxmlformats.org/drawingml/2006/main",noChangeAspect:1}))}}class dp extends de{constructor(){super("wp:cNvGraphicFramePr"),this.root.push(new nx)}}class ix extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{distT:"distT",distB:"distB",distL:"distL",distR:"distR",allowOverlap:"allowOverlap",behindDoc:"behindDoc",layoutInCell:"layoutInCell",locked:"locked",relativeHeight:"relativeHeight",simplePos:"simplePos"})}}class ox extends de{constructor({mediaData:e,transform:t,drawingOptions:n}){super("wp:anchor");const i=$e({allowOverlap:!0,behindDocument:!1,lockAnchor:!1,layoutInCell:!0,verticalPosition:{},horizontalPosition:{}},n.floating);if(this.root.push(new ix({distT:i.margins&&i.margins.top||0,distB:i.margins&&i.margins.bottom||0,distL:i.margins&&i.margins.left||0,distR:i.margins&&i.margins.right||0,simplePos:"0",allowOverlap:i.allowOverlap===!0?"1":"0",behindDoc:i.behindDocument===!0?"1":"0",locked:i.lockAnchor===!0?"1":"0",layoutInCell:i.layoutInCell===!0?"1":"0",relativeHeight:i.zIndex?i.zIndex:t.emus.y})),this.root.push(new fS),this.root.push(new pS(i.horizontalPosition)),this.root.push(new RS(i.verticalPosition)),this.root.push(new fp(t.emus.x,t.emus.y)),this.root.push(hp({top:0,right:0,bottom:0,left:0})),n.floating!==void 0&&n.floating.wrap!==void 0)switch(n.floating.wrap.type){case oa.SQUARE:this.root.push(new zS(n.floating.wrap,n.floating.margins));break;case oa.TIGHT:this.root.push(new jS(n.floating.margins));break;case oa.TOP_AND_BOTTOM:this.root.push(new ex(n.floating.margins));break;case oa.NONE:default:this.root.push(new of)}else this.root.push(new of);this.root.push(new up(n.docProperties)),this.root.push(new dp),this.root.push(new cp({mediaData:e,transform:t,outline:n.outline}))}}const ax=({mediaData:r,transform:e,docProperties:t,outline:n})=>{var i,o,a,s;return new pr({name:"wp:inline",attributes:{distanceTop:{key:"distT",value:0},distanceBottom:{key:"distB",value:0},distanceLeft:{key:"distL",value:0},distanceRight:{key:"distR",value:0}},children:[new fp(e.emus.x,e.emus.y),hp(n?{top:((i=n.width)!=null?i:9525)*2,right:((o=n.width)!=null?o:9525)*2,bottom:((a=n.width)!=null?a:9525)*2,left:((s=n.width)!=null?s:9525)*2}:{top:0,right:0,bottom:0,left:0}),new up(t),new dp,new cp({mediaData:r,transform:e,outline:n})]})};class sx extends de{constructor(e,t={}){super("w:drawing"),t.floating?this.root.push(new ox({mediaData:e,transform:e.transformation,drawingOptions:t})):this.root.push(ax({mediaData:e,transform:e.transformation,docProperties:t.docProperties,outline:t.outline}))}}class lx extends Do{constructor(e){super({}),pe(this,"key",`${ip()}.png`),pe(this,"imageData");const t=typeof e.data=="string"?this.convertDataURIToBinary(e.data):e.data;this.imageData={stream:t,fileName:this.key,transformation:{pixels:{x:Math.round(e.transformation.width),y:Math.round(e.transformation.height)},emus:{x:Math.round(e.transformation.width*9525),y:Math.round(e.transformation.height*9525)},flip:e.transformation.flip,rotation:e.transformation.rotation?e.transformation.rotation*6e4:void 0}};const n=new sx(this.imageData,{floating:e.floating,docProperties:e.altText,outline:e.outline});this.root.push(n)}prepForXml(e){return e.file.Media.addImage(this.key,this.imageData),super.prepForXml(e)}convertDataURIToBinary(e){if(typeof atob=="function"){const t=";base64,",n=e.indexOf(t),i=n===-1?0:n+t.length;return new Uint8Array(atob(e.substring(i)).split("").map(o=>o.charCodeAt(0)))}else{const t=require("buffer");return new t.Buffer(e,"base64")}}}class cx extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{id:"w:id",initials:"w:initials",author:"w:author",date:"w:date"})}}class ux extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{"xmlns:cx":"xmlns:cx","xmlns:cx1":"xmlns:cx1","xmlns:cx2":"xmlns:cx2","xmlns:cx3":"xmlns:cx3","xmlns:cx4":"xmlns:cx4","xmlns:cx5":"xmlns:cx5","xmlns:cx6":"xmlns:cx6","xmlns:cx7":"xmlns:cx7","xmlns:cx8":"xmlns:cx8","xmlns:mc":"xmlns:mc","xmlns:aink":"xmlns:aink","xmlns:am3d":"xmlns:am3d","xmlns:o":"xmlns:o","xmlns:r":"xmlns:r","xmlns:m":"xmlns:m","xmlns:v":"xmlns:v","xmlns:wp14":"xmlns:wp14","xmlns:wp":"xmlns:wp","xmlns:w10":"xmlns:w10","xmlns:w":"xmlns:w","xmlns:w14":"xmlns:w14","xmlns:w15":"xmlns:w15","xmlns:w16cex":"xmlns:w16cex","xmlns:w16cid":"xmlns:w16cid","xmlns:w16":"xmlns:w16","xmlns:w16sdtdh":"xmlns:w16sdtdh","xmlns:w16se":"xmlns:w16se","xmlns:wpg":"xmlns:wpg","xmlns:wpi":"xmlns:wpi","xmlns:wne":"xmlns:wne","xmlns:wps":"xmlns:wps"})}}class hx extends de{constructor({id:e,initials:t,author:n,date:i=new Date,children:o}){super("w:comment"),this.root.push(new cx({id:e,initials:t,author:n,date:i.toISOString()}));for(const a of o)this.root.push(a)}}class fx extends de{constructor({children:e}){super("w:comments"),this.root.push(new ux({"xmlns:cx":"http://schemas.microsoft.com/office/drawing/2014/chartex","xmlns:cx1":"http://schemas.microsoft.com/office/drawing/2015/9/8/chartex","xmlns:cx2":"http://schemas.microsoft.com/office/drawing/2015/10/21/chartex","xmlns:cx3":"http://schemas.microsoft.com/office/drawing/2016/5/9/chartex","xmlns:cx4":"http://schemas.microsoft.com/office/drawing/2016/5/10/chartex","xmlns:cx5":"http://schemas.microsoft.com/office/drawing/2016/5/11/chartex","xmlns:cx6":"http://schemas.microsoft.com/office/drawing/2016/5/12/chartex","xmlns:cx7":"http://schemas.microsoft.com/office/drawing/2016/5/13/chartex","xmlns:cx8":"http://schemas.microsoft.com/office/drawing/2016/5/14/chartex","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","xmlns:aink":"http://schemas.microsoft.com/office/drawing/2016/ink","xmlns:am3d":"http://schemas.microsoft.com/office/drawing/2017/model3d","xmlns:o":"urn:schemas-microsoft-com:office:office","xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","xmlns:m":"http://schemas.openxmlformats.org/officeDocument/2006/math","xmlns:v":"urn:schemas-microsoft-com:vml","xmlns:wp14":"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing","xmlns:wp":"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing","xmlns:w10":"urn:schemas-microsoft-com:office:word","xmlns:w":"http://schemas.openxmlformats.org/wordprocessingml/2006/main","xmlns:w14":"http://schemas.microsoft.com/office/word/2010/wordml","xmlns:w15":"http://schemas.microsoft.com/office/word/2012/wordml","xmlns:w16cex":"http://schemas.microsoft.com/office/word/2018/wordml/cex","xmlns:w16cid":"http://schemas.microsoft.com/office/word/2016/wordml/cid","xmlns:w16":"http://schemas.microsoft.com/office/word/2018/wordml","xmlns:w16sdtdh":"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash","xmlns:w16se":"http://schemas.microsoft.com/office/word/2015/wordml/symex","xmlns:wpg":"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup","xmlns:wpi":"http://schemas.microsoft.com/office/word/2010/wordprocessingInk","xmlns:wne":"http://schemas.microsoft.com/office/word/2006/wordml","xmlns:wps":"http://schemas.microsoft.com/office/word/2010/wordprocessingShape"}));for(const t of e)this.root.push(new hx(t))}}class dx extends Iw{constructor(){super("w:tab")}}class px extends de{constructor(){super("w:pageBreakBefore")}}const $l={AT_LEAST:"atLeast",EXACTLY:"exactly",EXACT:"exact",AUTO:"auto"};class gx extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{after:"w:after",before:"w:before",line:"w:line",lineRule:"w:lineRule"})}}class Rx extends de{constructor(e){super("w:spacing"),this.root.push(new gx(e))}}const ui={HEADING_1:"Heading1",HEADING_2:"Heading2",HEADING_3:"Heading3",HEADING_4:"Heading4",HEADING_5:"Heading5",HEADING_6:"Heading6",TITLE:"Title"};let aa=class extends de{constructor(e){super("w:pStyle"),this.root.push(new Ft({val:e}))}};class mx extends de{constructor(e){super("w:tabs");for(const t of e)this.root.push(new yx(t))}}const af={LEFT:"left",RIGHT:"right",CENTER:"center",BAR:"bar",CLEAR:"clear",DECIMAL:"decimal",END:"end",NUM:"num",START:"start"};class vx extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{val:"w:val",pos:"w:pos",leader:"w:leader"})}}class yx extends de{constructor({type:e,position:t,leader:n}){super("w:tab"),this.root.push(new vx({val:e,pos:t,leader:n}))}}class sf extends de{constructor(e,t){super("w:numPr"),this.root.push(new wx(t)),this.root.push(new Sx(e))}}class wx extends de{constructor(e){if(super("w:ilvl"),e>9)throw new Error("Level cannot be greater than 9. Read more here: https://answers.microsoft.com/en-us/msoffice/forum/all/does-word-support-more-than-9-list-levels/d130fdcd-1781-446d-8c84-c6c79124e4d7");this.root.push(new Ft({val:e}))}}class Sx extends de{constructor(e){super("w:numId"),this.root.push(new Ft({val:typeof e=="string"?`{${e}}`:e}))}}class pp extends de{constructor(){super(...arguments),pe(this,"fileChild",Symbol())}}class xx extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{id:"Id",type:"Type",target:"Target",targetMode:"TargetMode"})}}const bx={EXTERNAL:"External"};class Ox extends de{constructor(e,t,n,i){super("Relationship"),this.root.push(new xx({id:e,type:t,target:n,targetMode:i}))}}class Tx extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{id:"r:id",history:"w:history",anchor:"w:anchor"})}}class Vc extends de{constructor(e,t,n){super("w:hyperlink"),pe(this,"linkId"),this.linkId=t;const i={history:1,anchor:n||void 0,id:n?void 0:`rId${this.linkId}`},o=new Tx(i);this.root.push(o),e.forEach(a=>{this.root.push(a)})}}class gp extends de{constructor(e){super("w:externalHyperlink"),this.options=e}}class Px extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{id:"w:id",name:"w:name"})}}class Ex extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{id:"w:id"})}}class _x{constructor(e){pe(this,"bookmarkUniqueNumericId",sS()),pe(this,"start"),pe(this,"children"),pe(this,"end");const t=this.bookmarkUniqueNumericId();this.start=new Ix(e.id,t),this.children=e.children,this.end=new Nx(t)}}class Ix extends de{constructor(e,t){super("w:bookmarkStart");const n=new Px({name:e,id:t});this.root.push(n)}}class Nx extends de{constructor(e){super("w:bookmarkEnd");const t=new Ex({id:e});this.root.push(t)}}class Mx extends de{constructor(e){super("w:outlineLvl"),this.level=e,this.root.push(new Ft({val:e}))}}class Lx extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{verticalAlign:"w:val"})}}class Rp extends de{constructor(e){super("w:vAlign"),this.root.push(new Lx({verticalAlign:e}))}}const Fi={DEFAULT:"default",FIRST:"first",EVEN:"even"};class Fx extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{type:"w:type",id:"r:id"})}}const lf={HEADER:"w:headerReference",FOOTER:"w:footerReference"};class fl extends de{constructor(e,t){super(e),this.root.push(new Fx({type:t.type||Fi.DEFAULT,id:`rId${t.id}`}))}}class Cx extends de{constructor({space:e,count:t,separate:n,equalWidth:i,children:o}){super("w:cols"),this.root.push(new bn({space:{key:"w:space",value:e===void 0?void 0:or(e)},count:{key:"w:num",value:t===void 0?void 0:dr(t)},separate:{key:"w:sep",value:n},equalWidth:{key:"w:equalWidth",value:i}})),!i&&o&&o.forEach(a=>this.addChildElement(a))}}class Ax extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{type:"w:type",linePitch:"w:linePitch",charSpace:"w:charSpace"})}}class Dx extends de{constructor(e,t,n){super("w:docGrid"),this.root.push(new Ax({type:n,linePitch:dr(e),charSpace:t?dr(t):void 0}))}}const Xx=({countBy:r,start:e,restart:t,distance:n})=>new pr({name:"w:lnNumType",attributes:{countBy:{key:"w:countBy",value:r===void 0?void 0:dr(r)},start:{key:"w:start",value:e===void 0?void 0:dr(e)},restart:{key:"w:restart",value:t},distance:{key:"w:distance",value:n===void 0?void 0:or(n)}}});class cf extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{display:"w:display",offsetFrom:"w:offsetFrom",zOrder:"w:zOrder"})}}class Ux extends xn{constructor(e){if(super("w:pgBorders"),!e)return this;e.pageBorders?this.root.push(new cf({display:e.pageBorders.display,offsetFrom:e.pageBorders.offsetFrom,zOrder:e.pageBorders.zOrder})):this.root.push(new cf({})),e.pageBorderTop&&this.root.push(new ut("w:top",e.pageBorderTop)),e.pageBorderLeft&&this.root.push(new ut("w:left",e.pageBorderLeft)),e.pageBorderBottom&&this.root.push(new ut("w:bottom",e.pageBorderBottom)),e.pageBorderRight&&this.root.push(new ut("w:right",e.pageBorderRight))}}class Wx extends de{constructor(e,t,n,i,o,a,s){super("w:pgMar"),this.root.push(new bn({top:{key:"w:top",value:vn(e)},right:{key:"w:right",value:or(t)},bottom:{key:"w:bottom",value:vn(n)},left:{key:"w:left",value:or(i)},header:{key:"w:header",value:or(o)},footer:{key:"w:footer",value:or(a)},gutter:{key:"w:gutter",value:or(s)}}))}}class Vx extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{start:"w:start",formatType:"w:fmt",separator:"w:chapSep"})}}class Yx extends de{constructor({start:e,formatType:t,separator:n}){super("w:pgNumType"),this.root.push(new Vx({start:e===void 0?void 0:dr(e),formatType:t,separator:n}))}}const mp={PORTRAIT:"portrait",LANDSCAPE:"landscape"};class kx extends de{constructor(e,t,n){super("w:pgSz");const i=n===mp.LANDSCAPE,o=or(e),a=or(t);this.root.push(new bn({width:{key:"w:w",value:i?a:o},height:{key:"w:h",value:i?o:a},orientation:{key:"w:orient",value:n}}))}}class Zx extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{val:"w:val"})}}class Qx extends de{constructor(e){super("w:textDirection"),this.root.push(new Zx({val:e}))}}class Kx extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{val:"w:val"})}}class Hx extends de{constructor(e){super("w:type"),this.root.push(new Kx({val:e}))}}const Yn={TOP:1440,RIGHT:1440,BOTTOM:1440,LEFT:1440,HEADER:708,FOOTER:708,GUTTER:0},dl={WIDTH:11906,HEIGHT:16838,ORIENTATION:mp.PORTRAIT};class Bx extends de{constructor({page:{size:{width:e=dl.WIDTH,height:t=dl.HEIGHT,orientation:n=dl.ORIENTATION}={},margin:{top:i=Yn.TOP,right:o=Yn.RIGHT,bottom:a=Yn.BOTTOM,left:s=Yn.LEFT,header:l=Yn.HEADER,footer:c=Yn.FOOTER,gutter:u=Yn.GUTTER}={},pageNumbers:h={},borders:d,textDirection:f}={},grid:{linePitch:p=360,charSpace:g,type:v}={},headerWrapperGroup:R={},footerWrapperGroup:m={},lineNumbers:x,titlePage:T,verticalAlign:P,column:A,type:D}={}){super("w:sectPr"),this.addHeaderFooterGroup(lf.HEADER,R),this.addHeaderFooterGroup(lf.FOOTER,m),D&&this.root.push(new Hx(D)),this.root.push(new kx(e,t,n)),this.root.push(new Wx(i,o,a,s,l,c,u)),d&&this.root.push(new Ux(d)),x&&this.root.push(Xx(x)),this.root.push(new Yx(h)),A&&this.root.push(new Cx(A)),P&&this.root.push(new Rp(P)),T!==void 0&&this.root.push(new be("w:titlePg",T)),f&&this.root.push(new Qx(f)),this.root.push(new Dx(p,g,v))}addHeaderFooterGroup(e,t){t.default&&this.root.push(new fl(e,{type:Fi.DEFAULT,id:t.default.View.ReferenceId})),t.first&&this.root.push(new fl(e,{type:Fi.FIRST,id:t.first.View.ReferenceId})),t.even&&this.root.push(new fl(e,{type:Fi.EVEN,id:t.even.View.ReferenceId}))}}class Gx extends de{constructor(){super("w:body"),pe(this,"sections",[])}addSection(e){const t=this.sections.pop();this.root.push(this.createSectionParagraph(t)),this.sections.push(new Bx(e))}prepForXml(e){return this.sections.length===1&&(this.root.splice(0,1),this.root.push(this.sections.pop())),super.prepForXml(e)}push(e){this.root.push(e)}createSectionParagraph(e){const t=new An({}),n=new Yi({});return n.push(e),t.addChildElement(n),t}}class Xo extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",Ignorable:"mc:Ignorable",cp:"xmlns:cp",dc:"xmlns:dc",dcterms:"xmlns:dcterms",dcmitype:"xmlns:dcmitype",xsi:"xmlns:xsi",type:"xsi:type",cx:"xmlns:cx",cx1:"xmlns:cx1",cx2:"xmlns:cx2",cx3:"xmlns:cx3",cx4:"xmlns:cx4",cx5:"xmlns:cx5",cx6:"xmlns:cx6",cx7:"xmlns:cx7",cx8:"xmlns:cx8",aink:"xmlns:aink",am3d:"xmlns:am3d",w16cex:"xmlns:w16cex",w16cid:"xmlns:w16cid",w16:"xmlns:w16",w16sdtdh:"xmlns:w16sdtdh",w16se:"xmlns:w16se"})}}class Jx extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{color:"w:color",themeColor:"w:themeColor",themeShade:"w:themeShade",themeTint:"w:themeTint"})}}class zx extends de{constructor(e){super("w:background"),this.root.push(new Jx({color:e.color===void 0?void 0:Ui(e.color),themeColor:e.themeColor,themeShade:e.themeShade===void 0?void 0:tf(e.themeShade),themeTint:e.themeTint===void 0?void 0:tf(e.themeTint)}))}}class $x extends de{constructor(e){super("w:document"),pe(this,"body"),this.root.push(new Xo({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",cx:"http://schemas.microsoft.com/office/drawing/2014/chartex",cx1:"http://schemas.microsoft.com/office/drawing/2015/9/8/chartex",cx2:"http://schemas.microsoft.com/office/drawing/2015/10/21/chartex",cx3:"http://schemas.microsoft.com/office/drawing/2016/5/9/chartex",cx4:"http://schemas.microsoft.com/office/drawing/2016/5/10/chartex",cx5:"http://schemas.microsoft.com/office/drawing/2016/5/11/chartex",cx6:"http://schemas.microsoft.com/office/drawing/2016/5/12/chartex",cx7:"http://schemas.microsoft.com/office/drawing/2016/5/13/chartex",cx8:"http://schemas.microsoft.com/office/drawing/2016/5/14/chartex",aink:"http://schemas.microsoft.com/office/drawing/2016/ink",am3d:"http://schemas.microsoft.com/office/drawing/2017/model3d",w16cex:"http://schemas.microsoft.com/office/word/2018/wordml/cex",w16cid:"http://schemas.microsoft.com/office/word/2016/wordml/cid",w16:"http://schemas.microsoft.com/office/word/2018/wordml",w16sdtdh:"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash",w16se:"http://schemas.microsoft.com/office/word/2015/wordml/symex",Ignorable:"w14 w15 wp14"})),this.body=new Gx,e.background&&this.root.push(new zx(e.background)),this.root.push(this.body)}add(e){return this.body.push(e),this}get Body(){return this.body}}class jx extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{xmlns:"xmlns"})}}class Hi extends de{constructor(){super("Relationships"),this.root.push(new jx({xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"}))}createRelationship(e,t,n,i){const o=new Ox(`rId${e}`,t,n,i);return this.root.push(o),o}get RelationshipCount(){return this.root.length-1}}class vp{constructor(e){pe(this,"document"),pe(this,"relationships"),this.document=new $x(e),this.relationships=new Hi}get View(){return this.document}get Relationships(){return this.relationships}}class qx extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{val:"w:val"})}}class eb extends de{constructor(){super("w:wordWrap"),this.root.push(new qx({val:0}))}}const tb=r=>{var e,t;return new pr({name:"w:framePr",attributes:{anchorLock:{key:"w:anchorLock",value:r.anchorLock},dropCap:{key:"w:dropCap",value:r.dropCap},width:{key:"w:w",value:r.width},height:{key:"w:h",value:r.height},x:{key:"w:x",value:r.position?r.position.x:void 0},y:{key:"w:y",value:r.position?r.position.y:void 0},anchorHorizontal:{key:"w:hAnchor",value:r.anchor.horizontal},anchorVertical:{key:"w:vAnchor",value:r.anchor.vertical},spaceHorizontal:{key:"w:hSpace",value:(e=r.space)==null?void 0:e.horizontal},spaceVertical:{key:"w:vSpace",value:(t=r.space)==null?void 0:t.vertical},rule:{key:"w:hRule",value:r.rule},alignmentX:{key:"w:xAlign",value:r.alignment?r.alignment.x:void 0},alignmentY:{key:"w:yAlign",value:r.alignment?r.alignment.y:void 0},lines:{key:"w:lines",value:r.lines},wrap:{key:"w:wrap",value:r.wrap}}})};class Yi extends xn{constructor(e){var t,n;if(super("w:pPr"),pe(this,"numberingReferences",[]),!e)return this;e.heading&&this.push(new aa(e.heading)),e.bullet&&this.push(new aa("ListParagraph")),e.numbering&&!e.style&&!e.heading&&(e.numbering.custom||this.push(new aa("ListParagraph"))),e.style&&this.push(new aa(e.style)),e.keepNext!==void 0&&this.push(new be("w:keepNext",e.keepNext)),e.keepLines!==void 0&&this.push(new be("w:keepLines",e.keepLines)),e.pageBreakBefore&&this.push(new px),e.frame&&this.push(tb(e.frame)),e.widowControl!==void 0&&this.push(new be("w:widowControl",e.widowControl)),e.bullet&&this.push(new sf(1,e.bullet.level)),e.numbering&&(this.numberingReferences.push({reference:e.numbering.reference,instance:(t=e.numbering.instance)!=null?t:0}),this.push(new sf(`${e.numbering.reference}-${(n=e.numbering.instance)!=null?n:0}`,e.numbering.level))),e.border&&this.push(new Fw(e.border)),e.thematicBreak&&this.push(new Cw),e.shading&&this.push(new ja(e.shading)),e.wordWrap&&this.push(new eb),e.overflowPunctuation&&this.push(new be("w:overflowPunct",e.overflowPunctuation));const i=[...e.rightTabStop!==void 0?[{type:af.RIGHT,position:e.rightTabStop}]:[],...e.tabStops?e.tabStops:[],...e.leftTabStop!==void 0?[{type:af.LEFT,position:e.leftTabStop}]:[]];i.length>0&&this.push(new mx(i)),e.bidirectional!==void 0&&this.push(new be("w:bidi",e.bidirectional)),e.spacing&&this.push(new Rx(e.spacing)),e.indent&&this.push(new Aw(e.indent)),e.contextualSpacing!==void 0&&this.push(new be("w:contextualSpacing",e.contextualSpacing)),e.alignment&&this.push(new tp(e.alignment)),e.outlineLevel!==void 0&&this.push(new Mx(e.outlineLevel)),e.suppressLineNumbers!==void 0&&this.push(new be("w:suppressLineNumbers",e.suppressLineNumbers)),e.autoSpaceEastAsianText!==void 0&&this.push(new be("w:autoSpaceDN",e.autoSpaceEastAsianText)),e.run&&this.push(new ii(e.run))}push(e){this.root.push(e)}prepForXml(e){if(e.viewWrapper instanceof vp)for(const t of this.numberingReferences)e.file.Numbering.createConcreteNumberingInstance(t.reference,t.instance);return super.prepForXml(e)}}class An extends pp{constructor(e){if(super("w:p"),pe(this,"properties"),typeof e=="string")return this.properties=new Yi({}),this.root.push(this.properties),this.root.push(new Li(e)),this;if(this.properties=new Yi(e),this.root.push(this.properties),e.text&&this.root.push(new Li(e.text)),e.children)for(const t of e.children){if(t instanceof _x){this.root.push(t.start);for(const n of t.children)this.root.push(n);this.root.push(t.end);continue}this.root.push(t)}}prepForXml(e){for(const t of this.root)if(t instanceof gp){const n=this.root.indexOf(t),i=new Vc(t.options.children,ip());e.viewWrapper.Relationships.createRelationship(i.linkId,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",t.options.link,bx.EXTERNAL),this.root[n]=i}return super.prepForXml(e)}addRunToFront(e){return this.root.splice(1,0,e),this}}class rb extends de{constructor(e){super("m:t"),this.root.push(e)}}class nb extends de{constructor(e){super("m:r"),this.root.push(new rb(e))}}class ib extends de{constructor(e){super("w:tblGrid");for(const t of e)this.root.push(new ob(t))}}class ob extends de{constructor(e){super("w:gridCol"),e!==void 0&&this.root.push(new bn({width:{key:"w:w",value:or(e)}}))}}const yp={TABLE:"w:tblCellMar",TABLE_CELL:"w:tcMar"};class wp extends xn{constructor(e,{marginUnitType:t=Ua.DXA,top:n,left:i,bottom:o,right:a}){super(e),n!==void 0&&this.root.push(new zn("w:top",{type:t,size:n})),i!==void 0&&this.root.push(new zn("w:left",{type:t,size:i})),o!==void 0&&this.root.push(new zn("w:bottom",{type:t,size:o})),a!==void 0&&this.root.push(new zn("w:right",{type:t,size:a}))}}const Ua={AUTO:"auto",DXA:"dxa",NIL:"nil",PERCENTAGE:"pct"};class zn extends de{constructor(e,{type:t=Ua.AUTO,size:n}){super(e);let i=n;t===Ua.PERCENTAGE&&typeof n=="number"&&(i=`${n}%`),this.root.push(new bn({type:{key:"w:type",value:t},size:{key:"w:w",value:Tw(i)}}))}}class ab extends xn{constructor(e){super("w:tcBorders"),e.top&&this.root.push(new ut("w:top",e.top)),e.start&&this.root.push(new ut("w:start",e.start)),e.left&&this.root.push(new ut("w:left",e.left)),e.bottom&&this.root.push(new ut("w:bottom",e.bottom)),e.end&&this.root.push(new ut("w:end",e.end)),e.right&&this.root.push(new ut("w:right",e.right))}}class sb extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{val:"w:val"})}}class lb extends de{constructor(e){super("w:gridSpan"),this.root.push(new sb({val:dr(e)}))}}const Sp={CONTINUE:"continue",RESTART:"restart"};class cb extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{val:"w:val"})}}class uf extends de{constructor(e){super("w:vMerge"),this.root.push(new cb({val:e}))}}class ub extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{val:"w:val"})}}class hb extends de{constructor(e){super("w:textDirection"),this.root.push(new ub({val:e}))}}class fb extends xn{constructor(e){super("w:tcPr"),e.width&&this.root.push(new zn("w:tcW",e.width)),e.columnSpan&&this.root.push(new lb(e.columnSpan)),e.verticalMerge?this.root.push(new uf(e.verticalMerge)):e.rowSpan&&e.rowSpan>1&&this.root.push(new uf(Sp.RESTART)),e.borders&&this.root.push(new ab(e.borders)),e.shading&&this.root.push(new ja(e.shading)),e.margins&&this.root.push(new wp(yp.TABLE_CELL,e.margins)),e.textDirection&&this.root.push(new hb(e.textDirection)),e.verticalAlign&&this.root.push(new Rp(e.verticalAlign))}}class Yc extends de{constructor(e){super("w:tc"),this.options=e,this.root.push(new fb(e));for(const t of e.children)this.root.push(t)}prepForXml(e){return this.root[this.root.length-1]instanceof An||this.root.push(new An({})),super.prepForXml(e)}}const hi={style:Xc.NONE,size:0,color:"auto"},fi={style:Xc.SINGLE,size:4,color:"auto"};class xp extends de{constructor(e){super("w:tblBorders"),e.top?this.root.push(new ut("w:top",e.top)):this.root.push(new ut("w:top",fi)),e.left?this.root.push(new ut("w:left",e.left)):this.root.push(new ut("w:left",fi)),e.bottom?this.root.push(new ut("w:bottom",e.bottom)):this.root.push(new ut("w:bottom",fi)),e.right?this.root.push(new ut("w:right",e.right)):this.root.push(new ut("w:right",fi)),e.insideHorizontal?this.root.push(new ut("w:insideH",e.insideHorizontal)):this.root.push(new ut("w:insideH",fi)),e.insideVertical?this.root.push(new ut("w:insideV",e.insideVertical)):this.root.push(new ut("w:insideV",fi))}}pe(xp,"NONE",{top:hi,bottom:hi,left:hi,right:hi,insideHorizontal:hi,insideVertical:hi});class db extends de{constructor({horizontalAnchor:e,verticalAnchor:t,absoluteHorizontalPosition:n,relativeHorizontalPosition:i,absoluteVerticalPosition:o,relativeVerticalPosition:a,bottomFromText:s,topFromText:l,leftFromText:c,rightFromText:u,overlap:h}){super("w:tblpPr"),this.root.push(new bn({leftFromText:{key:"w:leftFromText",value:c===void 0?void 0:or(c)},rightFromText:{key:"w:rightFromText",value:u===void 0?void 0:or(u)},topFromText:{key:"w:topFromText",value:l===void 0?void 0:or(l)},bottomFromText:{key:"w:bottomFromText",value:s===void 0?void 0:or(s)},absoluteHorizontalPosition:{key:"w:tblpX",value:n===void 0?void 0:vn(n)},absoluteVerticalPosition:{key:"w:tblpY",value:o===void 0?void 0:vn(o)},horizontalAnchor:{key:"w:horzAnchor",value:e===void 0?void 0:e},relativeHorizontalPosition:{key:"w:tblpXSpec",value:i},relativeVerticalPosition:{key:"w:tblpYSpec",value:a},verticalAnchor:{key:"w:vertAnchor",value:t}})),h&&this.root.push(new Nw("w:tblOverlap",h))}}class pb extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{type:"w:type"})}}class gb extends de{constructor(e){super("w:tblLayout"),this.root.push(new pb({type:e}))}}class Rb extends xn{constructor(e){super("w:tblPr"),e.style&&this.root.push(new qn("w:tblStyle",e.style)),e.float&&this.root.push(new db(e.float)),e.visuallyRightToLeft!==void 0&&this.root.push(new be("w:bidiVisual",e.visuallyRightToLeft)),e.width&&this.root.push(new zn("w:tblW",e.width)),e.alignment&&this.root.push(new tp(e.alignment)),e.indent&&this.root.push(new zn("w:tblInd",e.indent)),e.borders&&this.root.push(new xp(e.borders)),e.shading&&this.root.push(new ja(e.shading)),e.layout&&this.root.push(new gb(e.layout)),e.cellMargin&&this.root.push(new wp(yp.TABLE,e.cellMargin))}}class mb extends pp{constructor({rows:e,width:t,columnWidths:n=Array(Math.max(...e.map(d=>d.CellCount))).fill(100),margins:i,indent:o,float:a,layout:s,style:l,borders:c,alignment:u,visuallyRightToLeft:h}){super("w:tbl"),this.root.push(new Rb({borders:c!=null?c:{},width:t!=null?t:{size:100},indent:o,float:a,layout:s,style:l,alignment:u,cellMargin:i,visuallyRightToLeft:h})),this.root.push(new ib(n));for(const d of e)this.root.push(d);e.forEach((d,f)=>{if(f===e.length-1)return;let p=0;d.cells.forEach(g=>{if(g.options.rowSpan&&g.options.rowSpan>1){const v=new Yc({rowSpan:g.options.rowSpan-1,columnSpan:g.options.columnSpan,borders:g.options.borders,children:[],verticalMerge:Sp.CONTINUE});e[f+1].addCellToColumnIndex(v,p)}p+=g.options.columnSpan||1})})}}class vb extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{value:"w:val",rule:"w:hRule"})}}class yb extends de{constructor(e,t){super("w:trHeight"),this.root.push(new vb({value:or(e),rule:t}))}}class wb extends xn{constructor(e){super("w:trPr"),e.cantSplit!==void 0&&this.root.push(new be("w:cantSplit",e.cantSplit)),e.tableHeader!==void 0&&this.root.push(new be("w:tblHeader",e.tableHeader)),e.height&&this.root.push(new yb(e.height.value,e.height.rule))}}class Sb extends de{constructor(e){super("w:tr"),this.options=e,this.root.push(new wb(e));for(const t of e.children)this.root.push(t)}get CellCount(){return this.options.children.length}get cells(){return this.root.filter(e=>e instanceof Yc)}addCellToIndex(e,t){this.root.splice(t+1,0,e)}addCellToColumnIndex(e,t){const n=this.columnIndexToRootIndex(t,!0);this.addCellToIndex(e,n-1)}rootIndexToColumnIndex(e){if(e<1||e>=this.root.length)throw new Error(`cell 'rootIndex' should between 1 to ${this.root.length-1}`);let t=0;for(let n=1;n=this.root.length){if(t)return this.root.length;throw new Error(`cell 'columnIndex' should not great than ${n-1}`)}const o=this.root[i];i+=1,n+=o&&o.options.columnSpan||1}return i-1}}class xb extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{xmlns:"xmlns",vt:"xmlns:vt"})}}class bb extends de{constructor(){super("Properties"),this.root.push(new xb({xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties",vt:"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"}))}}class Ob extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{xmlns:"xmlns"})}}class Tb extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{contentType:"ContentType",extension:"Extension"})}}class Tn extends de{constructor(e,t){super("Default"),this.root.push(new Tb({contentType:e,extension:t}))}}class Pb extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{contentType:"ContentType",partName:"PartName"})}}class Dr extends de{constructor(e,t){super("Override"),this.root.push(new Pb({contentType:e,partName:t}))}}class Eb extends de{constructor(){super("Types"),this.root.push(new Ob({xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"})),this.root.push(new Tn("image/png","png")),this.root.push(new Tn("image/jpeg","jpeg")),this.root.push(new Tn("image/jpeg","jpg")),this.root.push(new Tn("image/bmp","bmp")),this.root.push(new Tn("image/gif","gif")),this.root.push(new Tn("application/vnd.openxmlformats-package.relationships+xml","rels")),this.root.push(new Tn("application/xml","xml")),this.root.push(new Tn("application/vnd.openxmlformats-officedocument.obfuscatedFont","odttf")),this.root.push(new Dr("application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml","/word/document.xml")),this.root.push(new Dr("application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml","/word/styles.xml")),this.root.push(new Dr("application/vnd.openxmlformats-package.core-properties+xml","/docProps/core.xml")),this.root.push(new Dr("application/vnd.openxmlformats-officedocument.custom-properties+xml","/docProps/custom.xml")),this.root.push(new Dr("application/vnd.openxmlformats-officedocument.extended-properties+xml","/docProps/app.xml")),this.root.push(new Dr("application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml","/word/numbering.xml")),this.root.push(new Dr("application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml","/word/footnotes.xml")),this.root.push(new Dr("application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml","/word/settings.xml")),this.root.push(new Dr("application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml","/word/comments.xml")),this.root.push(new Dr("application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml","/word/fontTable.xml"))}addFooter(e){this.root.push(new Dr("application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml",`/word/footer${e}.xml`))}addHeader(e){this.root.push(new Dr("application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml",`/word/header${e}.xml`))}}class _b extends de{constructor(e){super("cp:coreProperties"),this.root.push(new Xo({cp:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties",dc:"http://purl.org/dc/elements/1.1/",dcterms:"http://purl.org/dc/terms/",dcmitype:"http://purl.org/dc/dcmitype/",xsi:"http://www.w3.org/2001/XMLSchema-instance"})),e.title&&this.root.push(new Vn("dc:title",e.title)),e.subject&&this.root.push(new Vn("dc:subject",e.subject)),e.creator&&this.root.push(new Vn("dc:creator",e.creator)),e.keywords&&this.root.push(new Vn("cp:keywords",e.keywords)),e.description&&this.root.push(new Vn("dc:description",e.description)),e.lastModifiedBy&&this.root.push(new Vn("cp:lastModifiedBy",e.lastModifiedBy)),e.revision&&this.root.push(new Vn("cp:revision",String(e.revision))),this.root.push(new hf("dcterms:created")),this.root.push(new hf("dcterms:modified"))}}class hf extends de{constructor(e){super(e),this.root.push(new Xo({type:"dcterms:W3CDTF"})),this.root.push(_w(new Date))}}class Ib extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{xmlns:"xmlns",vt:"xmlns:vt"})}}class Nb extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{fmtid:"fmtid",pid:"pid",name:"name"})}}class Mb extends de{constructor(e,t){super("property"),this.root.push(new Nb({fmtid:"{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",pid:e.toString(),name:t.name})),this.root.push(new Lb(t.value))}}class Lb extends de{constructor(e){super("vt:lpwstr"),this.root.push(e)}}class Fb extends de{constructor(e){super("Properties"),pe(this,"nextId"),pe(this,"properties",[]),this.root.push(new Ib({xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties",vt:"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"})),this.nextId=2;for(const t of e)this.addCustomProperty(t)}prepForXml(e){return this.properties.forEach(t=>this.root.push(t)),super.prepForXml(e)}addCustomProperty(e){this.properties.push(new Mb(this.nextId++,e))}}class Cb extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",cp:"xmlns:cp",dc:"xmlns:dc",dcterms:"xmlns:dcterms",dcmitype:"xmlns:dcmitype",xsi:"xmlns:xsi",type:"xsi:type"})}}let Ab=class extends j0{constructor(e,t){super("w:ftr",t),pe(this,"refId"),this.refId=e,t||this.root.push(new Cb({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape"}))}get ReferenceId(){return this.refId}add(e){this.root.push(e)}};class Db{constructor(e,t,n){pe(this,"footer"),pe(this,"relationships"),this.media=e,this.footer=new Ab(t,n),this.relationships=new Hi}add(e){this.footer.add(e)}addChildElement(e){this.footer.addChildElement(e)}get View(){return this.footer}get Relationships(){return this.relationships}get Media(){return this.media}}class Xb extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{type:"w:type",id:"w:id"})}}class Ub extends de{constructor(){super("w:footnoteRef")}}class Wb extends Do{constructor(){super({style:"FootnoteReference"}),this.root.push(new Ub)}}const ff={SEPERATOR:"separator",CONTINUATION_SEPERATOR:"continuationSeparator"};class pl extends de{constructor(e){super("w:footnote"),this.root.push(new Xb({type:e.type,id:e.id}));for(let t=0;t9)throw new Error("Level cannot be greater than 9. Read more here: https://answers.microsoft.com/en-us/msoffice/forum/all/does-word-support-more-than-9-list-levels/d130fdcd-1781-446d-8c84-c6c79124e4d7");this.root.push(new $b({ilvl:dr(e),tentative:1}))}}class iO extends nO{}class oO extends de{constructor(e){super("w:multiLevelType"),this.root.push(new Ft({val:e}))}}class aO extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{abstractNumId:"w:abstractNumId",restartNumberingAfterBreak:"w15:restartNumberingAfterBreak"})}}class df extends de{constructor(e,t){super("w:abstractNum"),pe(this,"id"),this.root.push(new aO({abstractNumId:dr(e),restartNumberingAfterBreak:0})),this.root.push(new oO("hybridMultilevel")),this.id=e;for(const n of t)this.root.push(new iO(n))}}class sO extends de{constructor(e){super("w:abstractNumId"),this.root.push(new Ft({val:e}))}}class lO extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{numId:"w:numId"})}}class pf extends de{constructor(e){if(super("w:num"),pe(this,"numId"),pe(this,"reference"),pe(this,"instance"),this.numId=e.numId,this.reference=e.reference,this.instance=e.instance,this.root.push(new lO({numId:dr(e.numId)})),this.root.push(new sO(dr(e.abstractNumId))),e.overrideLevels&&e.overrideLevels.length)for(const t of e.overrideLevels)this.root.push(new uO(t.num,t.start))}}class cO extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{ilvl:"w:ilvl"})}}class uO extends de{constructor(e,t){super("w:lvlOverride"),this.root.push(new cO({ilvl:e})),t!==void 0&&this.root.push(new fO(t))}}class hO extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{val:"w:val"})}}class fO extends de{constructor(e){super("w:startOverride"),this.root.push(new hO({val:e}))}}class dO extends de{constructor(e){super("w:numbering"),pe(this,"abstractNumberingMap",new Map),pe(this,"concreteNumberingMap",new Map),pe(this,"referenceConfigMap",new Map),pe(this,"abstractNumUniqueNumericId",iS()),pe(this,"concreteNumUniqueNumericId",oS()),this.root.push(new Xo({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",Ignorable:"w14 w15 wp14"}));const t=new df(this.abstractNumUniqueNumericId(),[{level:0,format:gn.BULLET,text:"\u25CF",alignment:en.LEFT,style:{paragraph:{indent:{left:Qr(.5),hanging:Qr(.25)}}}},{level:1,format:gn.BULLET,text:"\u25CB",alignment:en.LEFT,style:{paragraph:{indent:{left:Qr(1),hanging:Qr(.25)}}}},{level:2,format:gn.BULLET,text:"\u25A0",alignment:en.LEFT,style:{paragraph:{indent:{left:2160,hanging:Qr(.25)}}}},{level:3,format:gn.BULLET,text:"\u25CF",alignment:en.LEFT,style:{paragraph:{indent:{left:2880,hanging:Qr(.25)}}}},{level:4,format:gn.BULLET,text:"\u25CB",alignment:en.LEFT,style:{paragraph:{indent:{left:3600,hanging:Qr(.25)}}}},{level:5,format:gn.BULLET,text:"\u25A0",alignment:en.LEFT,style:{paragraph:{indent:{left:4320,hanging:Qr(.25)}}}},{level:6,format:gn.BULLET,text:"\u25CF",alignment:en.LEFT,style:{paragraph:{indent:{left:5040,hanging:Qr(.25)}}}},{level:7,format:gn.BULLET,text:"\u25CF",alignment:en.LEFT,style:{paragraph:{indent:{left:5760,hanging:Qr(.25)}}}},{level:8,format:gn.BULLET,text:"\u25CF",alignment:en.LEFT,style:{paragraph:{indent:{left:6480,hanging:Qr(.25)}}}}]);this.concreteNumberingMap.set("default-bullet-numbering",new pf({numId:1,abstractNumId:t.id,reference:"default-bullet-numbering",instance:0,overrideLevels:[{num:0,start:1}]})),this.abstractNumberingMap.set("default-bullet-numbering",t);for(const n of e.config)this.abstractNumberingMap.set(n.reference,new df(this.abstractNumUniqueNumericId(),n.levels)),this.referenceConfigMap.set(n.reference,n.levels)}prepForXml(e){for(const t of this.abstractNumberingMap.values())this.root.push(t);for(const t of this.concreteNumberingMap.values())this.root.push(t);return super.prepForXml(e)}createConcreteNumberingInstance(e,t){const n=this.abstractNumberingMap.get(e);if(!n)return;const i=`${e}-${t}`;if(this.concreteNumberingMap.has(i))return;const o=this.referenceConfigMap.get(e),a=o&&o[0].start,s={numId:this.concreteNumUniqueNumericId(),abstractNumId:n.id,reference:e,instance:t,overrideLevels:[a&&Number.isInteger(a)?{num:0,start:a}:{num:0,start:1}]};this.concreteNumberingMap.set(i,new pf(s))}get ConcreteNumbering(){return Array.from(this.concreteNumberingMap.values())}get ReferenceConfig(){return Array.from(this.referenceConfigMap.values())}}class pO extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{version:"w:val",name:"w:name",uri:"w:uri"})}}class gO extends de{constructor(e){super("w:compatSetting"),this.root.push(new pO({version:e,uri:"http://schemas.microsoft.com/office/word",name:"compatibilityMode"}))}}class RO extends de{constructor(e){super("w:compat"),e.version&&this.root.push(new gO(e.version)),e.useSingleBorderforContiguousCells&&this.root.push(new be("w:useSingleBorderforContiguousCells",e.useSingleBorderforContiguousCells)),e.wordPerfectJustification&&this.root.push(new be("w:wpJustification",e.wordPerfectJustification)),e.noTabStopForHangingIndent&&this.root.push(new be("w:noTabHangInd",e.noTabStopForHangingIndent)),e.noLeading&&this.root.push(new be("w:noLeading",e.noLeading)),e.spaceForUnderline&&this.root.push(new be("w:spaceForUL",e.spaceForUnderline)),e.noColumnBalance&&this.root.push(new be("w:noColumnBalance",e.noColumnBalance)),e.balanceSingleByteDoubleByteWidth&&this.root.push(new be("w:balanceSingleByteDoubleByteWidth",e.balanceSingleByteDoubleByteWidth)),e.noExtraLineSpacing&&this.root.push(new be("w:noExtraLineSpacing",e.noExtraLineSpacing)),e.doNotLeaveBackslashAlone&&this.root.push(new be("w:doNotLeaveBackslashAlone",e.doNotLeaveBackslashAlone)),e.underlineTrailingSpaces&&this.root.push(new be("w:ulTrailSpace",e.underlineTrailingSpaces)),e.doNotExpandShiftReturn&&this.root.push(new be("w:doNotExpandShiftReturn",e.doNotExpandShiftReturn)),e.spacingInWholePoints&&this.root.push(new be("w:spacingInWholePoints",e.spacingInWholePoints)),e.lineWrapLikeWord6&&this.root.push(new be("w:lineWrapLikeWord6",e.lineWrapLikeWord6)),e.printBodyTextBeforeHeader&&this.root.push(new be("w:printBodyTextBeforeHeader",e.printBodyTextBeforeHeader)),e.printColorsBlack&&this.root.push(new be("w:printColBlack",e.printColorsBlack)),e.spaceWidth&&this.root.push(new be("w:wpSpaceWidth",e.spaceWidth)),e.showBreaksInFrames&&this.root.push(new be("w:showBreaksInFrames",e.showBreaksInFrames)),e.subFontBySize&&this.root.push(new be("w:subFontBySize",e.subFontBySize)),e.suppressBottomSpacing&&this.root.push(new be("w:suppressBottomSpacing",e.suppressBottomSpacing)),e.suppressTopSpacing&&this.root.push(new be("w:suppressTopSpacing",e.suppressTopSpacing)),e.suppressSpacingAtTopOfPage&&this.root.push(new be("w:suppressSpacingAtTopOfPage",e.suppressSpacingAtTopOfPage)),e.suppressTopSpacingWP&&this.root.push(new be("w:suppressTopSpacingWP",e.suppressTopSpacingWP)),e.suppressSpBfAfterPgBrk&&this.root.push(new be("w:suppressSpBfAfterPgBrk",e.suppressSpBfAfterPgBrk)),e.swapBordersFacingPages&&this.root.push(new be("w:swapBordersFacingPages",e.swapBordersFacingPages)),e.convertMailMergeEsc&&this.root.push(new be("w:convMailMergeEsc",e.convertMailMergeEsc)),e.truncateFontHeightsLikeWP6&&this.root.push(new be("w:truncateFontHeightsLikeWP6",e.truncateFontHeightsLikeWP6)),e.macWordSmallCaps&&this.root.push(new be("w:mwSmallCaps",e.macWordSmallCaps)),e.usePrinterMetrics&&this.root.push(new be("w:usePrinterMetrics",e.usePrinterMetrics)),e.doNotSuppressParagraphBorders&&this.root.push(new be("w:doNotSuppressParagraphBorders",e.doNotSuppressParagraphBorders)),e.wrapTrailSpaces&&this.root.push(new be("w:wrapTrailSpaces",e.wrapTrailSpaces)),e.footnoteLayoutLikeWW8&&this.root.push(new be("w:footnoteLayoutLikeWW8",e.footnoteLayoutLikeWW8)),e.shapeLayoutLikeWW8&&this.root.push(new be("w:shapeLayoutLikeWW8",e.shapeLayoutLikeWW8)),e.alignTablesRowByRow&&this.root.push(new be("w:alignTablesRowByRow",e.alignTablesRowByRow)),e.forgetLastTabAlignment&&this.root.push(new be("w:forgetLastTabAlignment",e.forgetLastTabAlignment)),e.adjustLineHeightInTable&&this.root.push(new be("w:adjustLineHeightInTable",e.adjustLineHeightInTable)),e.autoSpaceLikeWord95&&this.root.push(new be("w:autoSpaceLikeWord95",e.autoSpaceLikeWord95)),e.noSpaceRaiseLower&&this.root.push(new be("w:noSpaceRaiseLower",e.noSpaceRaiseLower)),e.doNotUseHTMLParagraphAutoSpacing&&this.root.push(new be("w:doNotUseHTMLParagraphAutoSpacing",e.doNotUseHTMLParagraphAutoSpacing)),e.layoutRawTableWidth&&this.root.push(new be("w:layoutRawTableWidth",e.layoutRawTableWidth)),e.layoutTableRowsApart&&this.root.push(new be("w:layoutTableRowsApart",e.layoutTableRowsApart)),e.useWord97LineBreakRules&&this.root.push(new be("w:useWord97LineBreakRules",e.useWord97LineBreakRules)),e.doNotBreakWrappedTables&&this.root.push(new be("w:doNotBreakWrappedTables",e.doNotBreakWrappedTables)),e.doNotSnapToGridInCell&&this.root.push(new be("w:doNotSnapToGridInCell",e.doNotSnapToGridInCell)),e.selectFieldWithFirstOrLastCharacter&&this.root.push(new be("w:selectFldWithFirstOrLastChar",e.selectFieldWithFirstOrLastCharacter)),e.applyBreakingRules&&this.root.push(new be("w:applyBreakingRules",e.applyBreakingRules)),e.doNotWrapTextWithPunctuation&&this.root.push(new be("w:doNotWrapTextWithPunct",e.doNotWrapTextWithPunctuation)),e.doNotUseEastAsianBreakRules&&this.root.push(new be("w:doNotUseEastAsianBreakRules",e.doNotUseEastAsianBreakRules)),e.useWord2002TableStyleRules&&this.root.push(new be("w:useWord2002TableStyleRules",e.useWord2002TableStyleRules)),e.growAutofit&&this.root.push(new be("w:growAutofit",e.growAutofit)),e.useFELayout&&this.root.push(new be("w:useFELayout",e.useFELayout)),e.useNormalStyleForList&&this.root.push(new be("w:useNormalStyleForList",e.useNormalStyleForList)),e.doNotUseIndentAsNumberingTabStop&&this.root.push(new be("w:doNotUseIndentAsNumberingTabStop",e.doNotUseIndentAsNumberingTabStop)),e.useAlternateEastAsianLineBreakRules&&this.root.push(new be("w:useAltKinsokuLineBreakRules",e.useAlternateEastAsianLineBreakRules)),e.allowSpaceOfSameStyleInTable&&this.root.push(new be("w:allowSpaceOfSameStyleInTable",e.allowSpaceOfSameStyleInTable)),e.doNotSuppressIndentation&&this.root.push(new be("w:doNotSuppressIndentation",e.doNotSuppressIndentation)),e.doNotAutofitConstrainedTables&&this.root.push(new be("w:doNotAutofitConstrainedTables",e.doNotAutofitConstrainedTables)),e.autofitToFirstFixedWidthCell&&this.root.push(new be("w:autofitToFirstFixedWidthCell",e.autofitToFirstFixedWidthCell)),e.underlineTabInNumberingList&&this.root.push(new be("w:underlineTabInNumList",e.underlineTabInNumberingList)),e.displayHangulFixedWidth&&this.root.push(new be("w:displayHangulFixedWidth",e.displayHangulFixedWidth)),e.splitPgBreakAndParaMark&&this.root.push(new be("w:splitPgBreakAndParaMark",e.splitPgBreakAndParaMark)),e.doNotVerticallyAlignCellWithSp&&this.root.push(new be("w:doNotVertAlignCellWithSp",e.doNotVerticallyAlignCellWithSp)),e.doNotBreakConstrainedForcedTable&&this.root.push(new be("w:doNotBreakConstrainedForcedTable",e.doNotBreakConstrainedForcedTable)),e.ignoreVerticalAlignmentInTextboxes&&this.root.push(new be("w:doNotVertAlignInTxbx",e.ignoreVerticalAlignmentInTextboxes)),e.useAnsiKerningPairs&&this.root.push(new be("w:useAnsiKerningPairs",e.useAnsiKerningPairs)),e.cachedColumnBalance&&this.root.push(new be("w:cachedColBalance",e.cachedColumnBalance))}}class mO extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",Ignorable:"mc:Ignorable"})}}class vO extends de{constructor(e){var t,n,i,o;super("w:settings"),this.root.push(new mO({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",Ignorable:"w14 w15 wp14"})),this.root.push(new be("w:displayBackgroundShape",!0)),e.trackRevisions!==void 0&&this.root.push(new be("w:trackRevisions",e.trackRevisions)),e.evenAndOddHeaders!==void 0&&this.root.push(new be("w:evenAndOddHeaders",e.evenAndOddHeaders)),e.updateFields!==void 0&&this.root.push(new be("w:updateFields",e.updateFields)),e.defaultTabStop!==void 0&&this.root.push(new Dc("w:defaultTabStop",e.defaultTabStop)),this.root.push(new RO(Di($e({},(t=e.compatibility)!=null?t:{}),{version:(o=(i=(n=e.compatibility)==null?void 0:n.version)!=null?i:e.compatibilityModeVersion)!=null?o:15})))}}class bp extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{val:"w:val"})}}class yO extends de{constructor(e){super("w:name"),this.root.push(new bp({val:e}))}}class wO extends de{constructor(e){super("w:uiPriority"),this.root.push(new bp({val:dr(e)}))}}class SO extends _e{constructor(){super(...arguments),pe(this,"xmlKeys",{type:"w:type",styleId:"w:styleId",default:"w:default",customStyle:"w:customStyle"})}}class Op extends de{constructor(e,t){super("w:style"),this.root.push(new SO(e)),t.name&&this.root.push(new yO(t.name)),t.basedOn&&this.root.push(new qn("w:basedOn",t.basedOn)),t.next&&this.root.push(new qn("w:next",t.next)),t.link&&this.root.push(new qn("w:link",t.link)),t.uiPriority!==void 0&&this.root.push(new wO(t.uiPriority)),t.semiHidden!==void 0&&this.root.push(new be("w:semiHidden",t.semiHidden)),t.unhideWhenUsed!==void 0&&this.root.push(new be("w:unhideWhenUsed",t.unhideWhenUsed)),t.quickFormat!==void 0&&this.root.push(new be("w:qFormat",t.quickFormat))}}class es extends Op{constructor(e){super({type:"paragraph",styleId:e.id},e),pe(this,"paragraphProperties"),pe(this,"runProperties"),this.paragraphProperties=new Yi(e.paragraph),this.runProperties=new ii(e.run),this.root.push(this.paragraphProperties),this.root.push(this.runProperties)}}class ts extends Op{constructor(e){super({type:"character",styleId:e.id},$e({uiPriority:99,unhideWhenUsed:!0},e)),pe(this,"runProperties"),this.runProperties=new ii(e.run),this.root.push(this.runProperties)}}class Un extends es{constructor(e){super($e({basedOn:"Normal",next:"Normal",quickFormat:!0},e))}}class xO extends Un{constructor(e){super($e({id:"Title",name:"Title"},e))}}class bO extends Un{constructor(e){super($e({id:"Heading1",name:"Heading 1"},e))}}class OO extends Un{constructor(e){super($e({id:"Heading2",name:"Heading 2"},e))}}class TO extends Un{constructor(e){super($e({id:"Heading3",name:"Heading 3"},e))}}class PO extends Un{constructor(e){super($e({id:"Heading4",name:"Heading 4"},e))}}class EO extends Un{constructor(e){super($e({id:"Heading5",name:"Heading 5"},e))}}class _O extends Un{constructor(e){super($e({id:"Heading6",name:"Heading 6"},e))}}class IO extends Un{constructor(e){super($e({id:"Strong",name:"Strong"},e))}}class NO extends es{constructor(e){super($e({id:"ListParagraph",name:"List Paragraph",basedOn:"Normal",quickFormat:!0},e))}}class MO extends es{constructor(e){super($e({id:"FootnoteText",name:"footnote text",link:"FootnoteTextChar",basedOn:"Normal",uiPriority:99,semiHidden:!0,unhideWhenUsed:!0,paragraph:{spacing:{after:0,line:240,lineRule:$l.AUTO}},run:{size:20}},e))}}class LO extends ts{constructor(e){super($e({id:"FootnoteReference",name:"footnote reference",basedOn:"DefaultParagraphFont",semiHidden:!0,run:{superScript:!0}},e))}}class FO extends ts{constructor(e){super($e({id:"FootnoteTextChar",name:"Footnote Text Char",basedOn:"DefaultParagraphFont",link:"FootnoteText",semiHidden:!0,run:{size:20}},e))}}class CO extends ts{constructor(e){super($e({id:"Hyperlink",name:"Hyperlink",basedOn:"DefaultParagraphFont",run:{color:"0563C1",underline:{type:np.SINGLE}}},e))}}class jl extends de{constructor(e){if(super("w:styles"),e.initialStyles&&this.root.push(e.initialStyles),e.importedStyles)for(const t of e.importedStyles)this.root.push(t);if(e.paragraphStyles)for(const t of e.paragraphStyles)this.root.push(new es(t));if(e.characterStyles)for(const t of e.characterStyles)this.root.push(new ts(t))}}class AO extends de{constructor(e){super("w:pPrDefault"),this.root.push(new Yi(e))}}class DO extends de{constructor(e){super("w:rPrDefault"),this.root.push(new ii(e))}}class XO extends de{constructor(e){super("w:docDefaults"),pe(this,"runPropertiesDefaults"),pe(this,"paragraphPropertiesDefaults"),this.runPropertiesDefaults=new DO(e.run),this.paragraphPropertiesDefaults=new AO(e.paragraph),this.root.push(this.runPropertiesDefaults),this.root.push(this.paragraphPropertiesDefaults)}}class UO{newInstance(e){const t=$0.xml2js(e,{compact:!1});let n;for(const a of t.elements||[])a.name==="w:styles"&&(n=a);if(n===void 0)throw new Error("can not find styles element");const i=n.elements||[];return new jl({initialStyles:new xw(n.attributes),importedStyles:i.map(a=>Cc(a))})}}class gf{newInstance(e={}){var t;return{initialStyles:new Xo({mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",Ignorable:"w14 w15"}),importedStyles:[new XO((t=e.document)!=null?t:{}),new xO($e({run:{size:56}},e.title)),new bO($e({run:{color:"2E74B5",size:32}},e.heading1)),new OO($e({run:{color:"2E74B5",size:26}},e.heading2)),new TO($e({run:{color:"1F4D78",size:24}},e.heading3)),new PO($e({run:{color:"2E74B5",italics:!0}},e.heading4)),new EO($e({run:{color:"2E74B5"}},e.heading5)),new _O($e({run:{color:"1F4D78"}},e.heading6)),new IO($e({run:{bold:!0}},e.strong)),new NO(e.listParagraph||{}),new CO(e.hyperlink||{}),new LO(e.footnoteReference||{}),new MO(e.footnoteText||{}),new FO(e.footnoteTextChar||{})]}}}const sa=({id:r,fontKey:e,subsetted:t},n)=>new pr({name:n,attributes:$e({id:{key:"r:id",value:r}},e?{fontKey:{key:"w:fontKey",value:`{${e}}`}}:{}),children:[...t?[new be("w:subsetted",t)]:[]]}),WO=({name:r,altName:e,panose1:t,charset:n,family:i,notTrueType:o,pitch:a,sig:s,embedRegular:l,embedBold:c,embedItalic:u,embedBoldItalic:h})=>new pr({name:"w:font",attributes:{name:{key:"w:name",value:r}},children:[...e?[io("w:altName",e)]:[],...t?[io("w:panose1",t)]:[],...n?[io("w:charset",n)]:[],...i?[io("w:family",i)]:[],...o?[new be("w:notTrueType",o)]:[],...a?[io("w:pitch",a)]:[],...s?[new pr({name:"w:sig",attributes:{usb0:{key:"w:usb0",value:s.usb0},usb1:{key:"w:usb1",value:s.usb1},usb2:{key:"w:usb2",value:s.usb2},usb3:{key:"w:usb3",value:s.usb3},csb0:{key:"w:csb0",value:s.csb0},csb1:{key:"w:csb1",value:s.csb1}}})]:[],...l?[sa(l,"w:embedRegular")]:[],...c?[sa(c,"w:embedBold")]:[],...u?[sa(u,"w:embedItalic")]:[],...h?[sa(h,"w:embedBoldItalic")]:[]]}),VO=({name:r,index:e,fontKey:t,characterSet:n})=>WO({name:r,sig:{usb0:"E0002AFF",usb1:"C000247B",usb2:"00000009",usb3:"00000000",csb0:"000001FF",csb1:"00000000"},charset:n,family:"auto",pitch:"variable",embedRegular:{fontKey:t,id:`rId${e}`}}),YO=r=>new pr({name:"w:fonts",attributes:{mc:{key:"xmlns:mc",value:"http://schemas.openxmlformats.org/markup-compatibility/2006"},r:{key:"xmlns:r",value:"http://schemas.openxmlformats.org/officeDocument/2006/relationships"},w:{key:"xmlns:w",value:"http://schemas.openxmlformats.org/wordprocessingml/2006/main"},w14:{key:"xmlns:w14",value:"http://schemas.microsoft.com/office/word/2010/wordml"},w15:{key:"xmlns:w15",value:"http://schemas.microsoft.com/office/word/2012/wordml"},w16cex:{key:"xmlns:w16cex",value:"http://schemas.microsoft.com/office/word/2018/wordml/cex"},w16cid:{key:"xmlns:w16cid",value:"http://schemas.microsoft.com/office/word/2016/wordml/cid"},w16:{key:"xmlns:w16",value:"http://schemas.microsoft.com/office/word/2018/wordml"},w16sdtdh:{key:"xmlns:w16sdtdh",value:"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash"},w16se:{key:"xmlns:w16se",value:"http://schemas.microsoft.com/office/word/2015/wordml/symex"},Ignorable:{key:"mc:Ignorable",value:"w14 w15 w16se w16cid w16 w16cex w16sdtdh"}},children:r.map((e,t)=>VO({name:e.name,index:t+1,fontKey:e.fontKey}))});class kO{constructor(e){pe(this,"fontTable"),pe(this,"relationships"),pe(this,"fontOptionsWithKey",[]),this.options=e,this.fontOptionsWithKey=e.map(t=>Di($e({},t),{fontKey:lS()})),this.fontTable=YO(this.fontOptionsWithKey),this.relationships=new Hi;for(let t=0;te.header)}get Footers(){return this.footers.map(e=>e.footer)}get ContentTypes(){return this.contentTypes}get CustomProperties(){return this.customProperties}get AppProperties(){return this.appProperties}get FootNotes(){return this.footnotesWrapper}get Settings(){return this.settings}get Comments(){return this.comments}get FontTable(){return this.fontWrapper}}class QO{constructor(e={children:[]}){pe(this,"options"),this.options=e}}class KO{constructor(e={children:[]}){pe(this,"options"),this.options=e}}function la(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 Tp={exports:{}};(function(r,e){(function(t){r.exports=t()})(function(){return function t(n,i,o){function a(c,u){if(!i[c]){if(!n[c]){var h=typeof la=="function"&&la;if(!u&&h)return h(c,!0);if(s)return s(c,!0);var d=new Error("Cannot find module '"+c+"'");throw d.code="MODULE_NOT_FOUND",d}var f=i[c]={exports:{}};n[c][0].call(f.exports,function(p){var g=n[c][1][p];return a(g||p)},f,f.exports,t,n,i,o)}return i[c].exports}for(var s=typeof la=="function"&&la,l=0;l>2,f=(3&c)<<4|u>>4,p=1>6:64,g=2>4,u=(15&d)<<4|(f=s.indexOf(l.charAt(g++)))>>2,h=(3&f)<<6|(p=s.indexOf(l.charAt(g++))),m[v++]=c,f!==64&&(m[v++]=u),p!==64&&(m[v++]=h);return m}},{"./support":30,"./utils":32}],2:[function(t,n,i){var o=t("./external"),a=t("./stream/DataWorker"),s=t("./stream/Crc32Probe"),l=t("./stream/DataLengthProbe");function c(u,h,d,f,p){this.compressedSize=u,this.uncompressedSize=h,this.crc32=d,this.compression=f,this.compressedContent=p}c.prototype={getContentWorker:function(){var u=new a(o.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),h=this;return u.on("end",function(){if(this.streamInfo.data_length!==h.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),u},getCompressedWorker:function(){return new a(o.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},c.createWorkerFrom=function(u,h,d){return u.pipe(new s).pipe(new l("uncompressedSize")).pipe(h.compressWorker(d)).pipe(new l("compressedSize")).withStreamInfo("compression",h)},n.exports=c},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,n,i){var o=t("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(){return new o("STORE compression")},uncompressWorker:function(){return new o("STORE decompression")}},i.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,n,i){var o=t("./utils"),a=function(){for(var s,l=[],c=0;c<256;c++){s=c;for(var u=0;u<8;u++)s=1&s?3988292384^s>>>1:s>>>1;l[c]=s}return l}();n.exports=function(s,l){return s!==void 0&&s.length?o.getTypeOf(s)!=="string"?function(c,u,h,d){var f=a,p=d+h;c^=-1;for(var g=d;g>>8^f[255&(c^u[g])];return-1^c}(0|l,s,s.length,0):function(c,u,h,d){var f=a,p=d+h;c^=-1;for(var g=d;g>>8^f[255&(c^u.charCodeAt(g))];return-1^c}(0|l,s,s.length,0):0}},{"./utils":32}],5:[function(t,n,i){i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(t,n,i){var o=null;o=typeof Promise!="undefined"?Promise:t("lie"),n.exports={Promise:o}},{lie:37}],7:[function(t,n,i){var o=typeof Uint8Array!="undefined"&&typeof Uint16Array!="undefined"&&typeof Uint32Array!="undefined",a=t("pako"),s=t("./utils"),l=t("./stream/GenericWorker"),c=o?"uint8array":"array";function u(h,d){l.call(this,"FlateWorker/"+h),this._pako=null,this._pakoAction=h,this._pakoOptions=d,this.meta={}}i.magic="\b\0",s.inherits(u,l),u.prototype.processChunk=function(h){this.meta=h.meta,this._pako===null&&this._createPako(),this._pako.push(s.transformTo(c,h.data),!1)},u.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new a[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var h=this;this._pako.onData=function(d){h.push({data:d,meta:h.meta})}},i.compressWorker=function(h){return new u("Deflate",h)},i.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,n,i){function o(f,p){var g,v="";for(g=0;g>>=8;return v}function a(f,p,g,v,R,m){var x,T,P=f.file,A=f.compression,D=m!==c.utf8encode,W=s.transformTo("string",m(P.name)),_=s.transformTo("string",c.utf8encode(P.name)),Q=P.comment,te=s.transformTo("string",m(Q)),O=s.transformTo("string",c.utf8encode(Q)),I=_.length!==P.name.length,y=O.length!==Q.length,L="",k="",F="",Y=P.dir,V=P.date,ie={crc32:0,compressedSize:0,uncompressedSize:0};p&&!g||(ie.crc32=f.crc32,ie.compressedSize=f.compressedSize,ie.uncompressedSize=f.uncompressedSize);var U=0;p&&(U|=8),D||!I&&!y||(U|=2048);var N=0,J=0;Y&&(N|=16),R==="UNIX"?(J=798,N|=function(re,ee){var X=re;return re||(X=ee?16893:33204),(65535&X)<<16}(P.unixPermissions,Y)):(J=20,N|=function(re){return 63&(re||0)}(P.dosPermissions)),x=V.getUTCHours(),x<<=6,x|=V.getUTCMinutes(),x<<=5,x|=V.getUTCSeconds()/2,T=V.getUTCFullYear()-1980,T<<=4,T|=V.getUTCMonth()+1,T<<=5,T|=V.getUTCDate(),I&&(k=o(1,1)+o(u(W),4)+_,L+="up"+o(k.length,2)+k),y&&(F=o(1,1)+o(u(te),4)+O,L+="uc"+o(F.length,2)+F);var B="";return B+=` +\0`,B+=o(U,2),B+=A.magic,B+=o(x,2),B+=o(T,2),B+=o(ie.crc32,4),B+=o(ie.compressedSize,4),B+=o(ie.uncompressedSize,4),B+=o(W.length,2),B+=o(L.length,2),{fileRecord:h.LOCAL_FILE_HEADER+B+W+L,dirRecord:h.CENTRAL_FILE_HEADER+o(J,2)+B+o(te.length,2)+"\0\0\0\0"+o(N,4)+o(v,4)+W+L+te}}var s=t("../utils"),l=t("../stream/GenericWorker"),c=t("../utf8"),u=t("../crc32"),h=t("../signature");function d(f,p,g,v){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=p,this.zipPlatform=g,this.encodeFileName=v,this.streamFiles=f,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}s.inherits(d,l),d.prototype.push=function(f){var p=f.meta.percent||0,g=this.entriesCount,v=this._sources.length;this.accumulate?this.contentBuffer.push(f):(this.bytesWritten+=f.data.length,l.prototype.push.call(this,{data:f.data,meta:{currentFile:this.currentFile,percent:g?(p+100*(g-v-1))/g:100}}))},d.prototype.openedSource=function(f){this.currentSourceOffset=this.bytesWritten,this.currentFile=f.file.name;var p=this.streamFiles&&!f.file.dir;if(p){var g=a(f,p,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:g.fileRecord,meta:{percent:0}})}else this.accumulate=!0},d.prototype.closedSource=function(f){this.accumulate=!1;var p=this.streamFiles&&!f.file.dir,g=a(f,p,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(g.dirRecord),p)this.push({data:function(v){return h.DATA_DESCRIPTOR+o(v.crc32,4)+o(v.compressedSize,4)+o(v.uncompressedSize,4)}(f),meta:{percent:100}});else for(this.push({data:g.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},d.prototype.flush=function(){for(var f=this.bytesWritten,p=0;p=this.index;l--)c=(c<<8)+this.byteAt(l);return this.index+=s,c},readString:function(s){return o.transformTo("string",this.readData(s))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var s=this.readInt(4);return new Date(Date.UTC(1980+(s>>25&127),(s>>21&15)-1,s>>16&31,s>>11&31,s>>5&63,(31&s)<<1))}},n.exports=a},{"../utils":32}],19:[function(t,n,i){var o=t("./Uint8ArrayReader");function a(s){o.call(this,s)}t("../utils").inherits(a,o),a.prototype.readData=function(s){this.checkOffset(s);var l=this.data.slice(this.zero+this.index,this.zero+this.index+s);return this.index+=s,l},n.exports=a},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,n,i){var o=t("./DataReader");function a(s){o.call(this,s)}t("../utils").inherits(a,o),a.prototype.byteAt=function(s){return this.data.charCodeAt(this.zero+s)},a.prototype.lastIndexOfSignature=function(s){return this.data.lastIndexOf(s)-this.zero},a.prototype.readAndCheckSignature=function(s){return s===this.readData(4)},a.prototype.readData=function(s){this.checkOffset(s);var l=this.data.slice(this.zero+this.index,this.zero+this.index+s);return this.index+=s,l},n.exports=a},{"../utils":32,"./DataReader":18}],21:[function(t,n,i){var o=t("./ArrayReader");function a(s){o.call(this,s)}t("../utils").inherits(a,o),a.prototype.readData=function(s){if(this.checkOffset(s),s===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+s);return this.index+=s,l},n.exports=a},{"../utils":32,"./ArrayReader":17}],22:[function(t,n,i){var o=t("../utils"),a=t("../support"),s=t("./ArrayReader"),l=t("./StringReader"),c=t("./NodeBufferReader"),u=t("./Uint8ArrayReader");n.exports=function(h){var d=o.getTypeOf(h);return o.checkSupport(d),d!=="string"||a.uint8array?d==="nodebuffer"?new c(h):a.uint8array?new u(o.transformTo("uint8array",h)):new s(o.transformTo("array",h)):new l(h)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,n,i){i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(t,n,i){var o=t("./GenericWorker"),a=t("../utils");function s(l){o.call(this,"ConvertWorker to "+l),this.destType=l}a.inherits(s,o),s.prototype.processChunk=function(l){this.push({data:a.transformTo(this.destType,l.data),meta:l.meta})},n.exports=s},{"../utils":32,"./GenericWorker":28}],25:[function(t,n,i){var o=t("./GenericWorker"),a=t("../crc32");function s(){o.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(s,o),s.prototype.processChunk=function(l){this.streamInfo.crc32=a(l.data,this.streamInfo.crc32||0),this.push(l)},n.exports=s},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,n,i){var o=t("../utils"),a=t("./GenericWorker");function s(l){a.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}o.inherits(s,a),s.prototype.processChunk=function(l){if(l){var c=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=c+l.data.length}a.prototype.processChunk.call(this,l)},n.exports=s},{"../utils":32,"./GenericWorker":28}],27:[function(t,n,i){var o=t("../utils"),a=t("./GenericWorker");function s(l){a.call(this,"DataWorker");var c=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(u){c.dataIsReady=!0,c.data=u,c.max=u&&u.length||0,c.type=o.getTypeOf(u),c.isPaused||c._tickAndRepeat()},function(u){c.error(u)})}o.inherits(s,a),s.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,o.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(o.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,c=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,c);break;case"uint8array":l=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":l=this.data.slice(this.index,c)}return this.index=c,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},n.exports=s},{"../utils":32,"./GenericWorker":28}],28:[function(t,n,i){function o(a){this.name=a||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}o.prototype={push:function(a){this.emit("data",a)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(a){this.emit("error",a)}return!0},error:function(a){return!this.isFinished&&(this.isPaused?this.generatedError=a:(this.isFinished=!0,this.emit("error",a),this.previous&&this.previous.error(a),this.cleanUp()),!0)},on:function(a,s){return this._listeners[a].push(s),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(a,s){if(this._listeners[a])for(var l=0;l "+a:a}},n.exports=o},{}],29:[function(t,n,i){var o=t("../utils"),a=t("./ConvertWorker"),s=t("./GenericWorker"),l=t("../base64"),c=t("../support"),u=t("../external"),h=null;if(c.nodestream)try{h=t("../nodejs/NodejsStreamOutputAdapter")}catch{}function d(p,g){return new u.Promise(function(v,R){var m=[],x=p._internalType,T=p._outputType,P=p._mimeType;p.on("data",function(A,D){m.push(A),g&&g(D)}).on("error",function(A){m=[],R(A)}).on("end",function(){try{var A=function(D,W,_){switch(D){case"blob":return o.newBlob(o.transformTo("arraybuffer",W),_);case"base64":return l.encode(W);default:return o.transformTo(D,W)}}(T,function(D,W){var _,Q=0,te=null,O=0;for(_=0;_>>6:(v<65536?g[x++]=224|v>>>12:(g[x++]=240|v>>>18,g[x++]=128|v>>>12&63),g[x++]=128|v>>>6&63),g[x++]=128|63&v);return g}(f)},i.utf8decode=function(f){return a.nodebuffer?o.transformTo("nodebuffer",f).toString("utf-8"):function(p){var g,v,R,m,x=p.length,T=new Array(2*x);for(g=v=0;g>10&1023,T[v++]=56320|1023&R)}return T.length!==v&&(T.subarray?T=T.subarray(0,v):T.length=v),o.applyFromCharCode(T)}(f=o.transformTo(a.uint8array?"uint8array":"array",f))},o.inherits(h,l),h.prototype.processChunk=function(f){var p=o.transformTo(a.uint8array?"uint8array":"array",f.data);if(this.leftOver&&this.leftOver.length){if(a.uint8array){var g=p;(p=new Uint8Array(g.length+this.leftOver.length)).set(this.leftOver,0),p.set(g,this.leftOver.length)}else p=this.leftOver.concat(p);this.leftOver=null}var v=function(m,x){var T;for((x=x||m.length)>m.length&&(x=m.length),T=x-1;0<=T&&(192&m[T])==128;)T--;return T<0||T===0?x:T+c[m[T]]>x?T:x}(p),R=p;v!==p.length&&(a.uint8array?(R=p.subarray(0,v),this.leftOver=p.subarray(v,p.length)):(R=p.slice(0,v),this.leftOver=p.slice(v,p.length))),this.push({data:i.utf8decode(R),meta:f.meta})},h.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=h,o.inherits(d,l),d.prototype.processChunk=function(f){this.push({data:i.utf8encode(f.data),meta:f.meta})},i.Utf8EncodeWorker=d},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,n,i){var o=t("./support"),a=t("./base64"),s=t("./nodejsUtils"),l=t("./external");function c(g){return g}function u(g,v){for(var R=0;R>8;this.dir=!!(16&this.externalFileAttributes),f==0&&(this.dosPermissions=63&this.externalFileAttributes),f==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var f=o(this.extraFields[1].value);this.uncompressedSize===a.MAX_VALUE_32BITS&&(this.uncompressedSize=f.readInt(8)),this.compressedSize===a.MAX_VALUE_32BITS&&(this.compressedSize=f.readInt(8)),this.localHeaderOffset===a.MAX_VALUE_32BITS&&(this.localHeaderOffset=f.readInt(8)),this.diskNumberStart===a.MAX_VALUE_32BITS&&(this.diskNumberStart=f.readInt(4))}},readExtraFields:function(f){var p,g,v,R=f.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});f.index+4>>6:(f<65536?d[v++]=224|f>>>12:(d[v++]=240|f>>>18,d[v++]=128|f>>>12&63),d[v++]=128|f>>>6&63),d[v++]=128|63&f);return d},i.buf2binstring=function(h){return u(h,h.length)},i.binstring2buf=function(h){for(var d=new o.Buf8(h.length),f=0,p=d.length;f>10&1023,m[p++]=56320|1023&g)}return u(m,p)},i.utf8border=function(h,d){var f;for((d=d||h.length)>h.length&&(d=h.length),f=d-1;0<=f&&(192&h[f])==128;)f--;return f<0||f===0?d:f+l[h[f]]>d?f:d}},{"./common":41}],43:[function(t,n,i){n.exports=function(o,a,s,l){for(var c=65535&o|0,u=o>>>16&65535|0,h=0;s!==0;){for(s-=h=2e3>>1:a>>>1;s[l]=a}return s}();n.exports=function(a,s,l,c){var u=o,h=c+l;a^=-1;for(var d=c;d>>8^u[255&(a^s[d])];return-1^a}},{}],46:[function(t,n,i){var o,a=t("../utils/common"),s=t("./trees"),l=t("./adler32"),c=t("./crc32"),u=t("./messages"),h=0,d=4,f=0,p=-2,g=-1,v=4,R=2,m=8,x=9,T=286,P=30,A=19,D=2*T+1,W=15,_=3,Q=258,te=Q+_+1,O=42,I=113,y=1,L=2,k=3,F=4;function Y(b,q){return b.msg=u[q],q}function V(b){return(b<<1)-(4b.avail_out&&(M=b.avail_out),M!==0&&(a.arraySet(b.output,q.pending_buf,q.pending_out,M,b.next_out),b.next_out+=M,q.pending_out+=M,b.total_out+=M,b.avail_out-=M,q.pending-=M,q.pending===0&&(q.pending_out=0))}function N(b,q){s._tr_flush_block(b,0<=b.block_start?b.block_start:-1,b.strstart-b.block_start,q),b.block_start=b.strstart,U(b.strm)}function J(b,q){b.pending_buf[b.pending++]=q}function B(b,q){b.pending_buf[b.pending++]=q>>>8&255,b.pending_buf[b.pending++]=255&q}function re(b,q){var M,w,S=b.max_chain_length,E=b.strstart,K=b.prev_length,$=b.nice_match,Z=b.strstart>b.w_size-te?b.strstart-(b.w_size-te):0,oe=b.window,ce=b.w_mask,se=b.prev,ge=b.strstart+Q,Oe=oe[E+K-1],Te=oe[E+K];b.prev_length>=b.good_match&&(S>>=2),$>b.lookahead&&($=b.lookahead);do if(oe[(M=q)+K]===Te&&oe[M+K-1]===Oe&&oe[M]===oe[E]&&oe[++M]===oe[E+1]){E+=2,M++;do;while(oe[++E]===oe[++M]&&oe[++E]===oe[++M]&&oe[++E]===oe[++M]&&oe[++E]===oe[++M]&&oe[++E]===oe[++M]&&oe[++E]===oe[++M]&&oe[++E]===oe[++M]&&oe[++E]===oe[++M]&&EZ&&--S!=0);return K<=b.lookahead?K:b.lookahead}function ee(b){var q,M,w,S,E,K,$,Z,oe,ce,se=b.w_size;do{if(S=b.window_size-b.lookahead-b.strstart,b.strstart>=se+(se-te)){for(a.arraySet(b.window,b.window,se,se,0),b.match_start-=se,b.strstart-=se,b.block_start-=se,q=M=b.hash_size;w=b.head[--q],b.head[q]=se<=w?w-se:0,--M;);for(q=M=se;w=b.prev[--q],b.prev[q]=se<=w?w-se:0,--M;);S+=se}if(b.strm.avail_in===0)break;if(K=b.strm,$=b.window,Z=b.strstart+b.lookahead,oe=S,ce=void 0,ce=K.avail_in,oe=_)for(E=b.strstart-b.insert,b.ins_h=b.window[E],b.ins_h=(b.ins_h<=_&&(b.ins_h=(b.ins_h<=_)if(w=s._tr_tally(b,b.strstart-b.match_start,b.match_length-_),b.lookahead-=b.match_length,b.match_length<=b.max_lazy_match&&b.lookahead>=_){for(b.match_length--;b.strstart++,b.ins_h=(b.ins_h<=_&&(b.ins_h=(b.ins_h<=_&&b.match_length<=b.prev_length){for(S=b.strstart+b.lookahead-_,w=s._tr_tally(b,b.strstart-1-b.prev_match,b.prev_length-_),b.lookahead-=b.prev_length-1,b.prev_length-=2;++b.strstart<=S&&(b.ins_h=(b.ins_h<b.pending_buf_size-5&&(M=b.pending_buf_size-5);;){if(b.lookahead<=1){if(ee(b),b.lookahead===0&&q===h)return y;if(b.lookahead===0)break}b.strstart+=b.lookahead,b.lookahead=0;var w=b.block_start+M;if((b.strstart===0||b.strstart>=w)&&(b.lookahead=b.strstart-w,b.strstart=w,N(b,!1),b.strm.avail_out===0)||b.strstart-b.block_start>=b.w_size-te&&(N(b,!1),b.strm.avail_out===0))return y}return b.insert=0,q===d?(N(b,!0),b.strm.avail_out===0?k:F):(b.strstart>b.block_start&&(N(b,!1),b.strm.avail_out),y)}),new G(4,4,8,4,X),new G(4,5,16,8,X),new G(4,6,32,32,X),new G(4,4,16,16,C),new G(8,16,32,32,C),new G(8,16,128,128,C),new G(8,32,128,256,C),new G(32,128,258,1024,C),new G(32,258,258,4096,C)],i.deflateInit=function(b,q){return ue(b,q,m,15,8,0)},i.deflateInit2=ue,i.deflateReset=j,i.deflateResetKeep=H,i.deflateSetHeader=function(b,q){return b&&b.state?b.state.wrap!==2?p:(b.state.gzhead=q,f):p},i.deflate=function(b,q){var M,w,S,E;if(!b||!b.state||5>8&255),J(w,w.gzhead.time>>16&255),J(w,w.gzhead.time>>24&255),J(w,w.level===9?2:2<=w.strategy||w.level<2?4:0),J(w,255&w.gzhead.os),w.gzhead.extra&&w.gzhead.extra.length&&(J(w,255&w.gzhead.extra.length),J(w,w.gzhead.extra.length>>8&255)),w.gzhead.hcrc&&(b.adler=c(b.adler,w.pending_buf,w.pending,0)),w.gzindex=0,w.status=69):(J(w,0),J(w,0),J(w,0),J(w,0),J(w,0),J(w,w.level===9?2:2<=w.strategy||w.level<2?4:0),J(w,3),w.status=I);else{var K=m+(w.w_bits-8<<4)<<8;K|=(2<=w.strategy||w.level<2?0:w.level<6?1:w.level===6?2:3)<<6,w.strstart!==0&&(K|=32),K+=31-K%31,w.status=I,B(w,K),w.strstart!==0&&(B(w,b.adler>>>16),B(w,65535&b.adler)),b.adler=1}if(w.status===69)if(w.gzhead.extra){for(S=w.pending;w.gzindex<(65535&w.gzhead.extra.length)&&(w.pending!==w.pending_buf_size||(w.gzhead.hcrc&&w.pending>S&&(b.adler=c(b.adler,w.pending_buf,w.pending-S,S)),U(b),S=w.pending,w.pending!==w.pending_buf_size));)J(w,255&w.gzhead.extra[w.gzindex]),w.gzindex++;w.gzhead.hcrc&&w.pending>S&&(b.adler=c(b.adler,w.pending_buf,w.pending-S,S)),w.gzindex===w.gzhead.extra.length&&(w.gzindex=0,w.status=73)}else w.status=73;if(w.status===73)if(w.gzhead.name){S=w.pending;do{if(w.pending===w.pending_buf_size&&(w.gzhead.hcrc&&w.pending>S&&(b.adler=c(b.adler,w.pending_buf,w.pending-S,S)),U(b),S=w.pending,w.pending===w.pending_buf_size)){E=1;break}E=w.gzindexS&&(b.adler=c(b.adler,w.pending_buf,w.pending-S,S)),E===0&&(w.gzindex=0,w.status=91)}else w.status=91;if(w.status===91)if(w.gzhead.comment){S=w.pending;do{if(w.pending===w.pending_buf_size&&(w.gzhead.hcrc&&w.pending>S&&(b.adler=c(b.adler,w.pending_buf,w.pending-S,S)),U(b),S=w.pending,w.pending===w.pending_buf_size)){E=1;break}E=w.gzindexS&&(b.adler=c(b.adler,w.pending_buf,w.pending-S,S)),E===0&&(w.status=103)}else w.status=103;if(w.status===103&&(w.gzhead.hcrc?(w.pending+2>w.pending_buf_size&&U(b),w.pending+2<=w.pending_buf_size&&(J(w,255&b.adler),J(w,b.adler>>8&255),b.adler=0,w.status=I)):w.status=I),w.pending!==0){if(U(b),b.avail_out===0)return w.last_flush=-1,f}else if(b.avail_in===0&&V(q)<=V(M)&&q!==d)return Y(b,-5);if(w.status===666&&b.avail_in!==0)return Y(b,-5);if(b.avail_in!==0||w.lookahead!==0||q!==h&&w.status!==666){var $=w.strategy===2?function(Z,oe){for(var ce;;){if(Z.lookahead===0&&(ee(Z),Z.lookahead===0)){if(oe===h)return y;break}if(Z.match_length=0,ce=s._tr_tally(Z,0,Z.window[Z.strstart]),Z.lookahead--,Z.strstart++,ce&&(N(Z,!1),Z.strm.avail_out===0))return y}return Z.insert=0,oe===d?(N(Z,!0),Z.strm.avail_out===0?k:F):Z.last_lit&&(N(Z,!1),Z.strm.avail_out===0)?y:L}(w,q):w.strategy===3?function(Z,oe){for(var ce,se,ge,Oe,Te=Z.window;;){if(Z.lookahead<=Q){if(ee(Z),Z.lookahead<=Q&&oe===h)return y;if(Z.lookahead===0)break}if(Z.match_length=0,Z.lookahead>=_&&0Z.lookahead&&(Z.match_length=Z.lookahead)}if(Z.match_length>=_?(ce=s._tr_tally(Z,1,Z.match_length-_),Z.lookahead-=Z.match_length,Z.strstart+=Z.match_length,Z.match_length=0):(ce=s._tr_tally(Z,0,Z.window[Z.strstart]),Z.lookahead--,Z.strstart++),ce&&(N(Z,!1),Z.strm.avail_out===0))return y}return Z.insert=0,oe===d?(N(Z,!0),Z.strm.avail_out===0?k:F):Z.last_lit&&(N(Z,!1),Z.strm.avail_out===0)?y:L}(w,q):o[w.level].func(w,q);if($!==k&&$!==F||(w.status=666),$===y||$===k)return b.avail_out===0&&(w.last_flush=-1),f;if($===L&&(q===1?s._tr_align(w):q!==5&&(s._tr_stored_block(w,0,0,!1),q===3&&(ie(w.head),w.lookahead===0&&(w.strstart=0,w.block_start=0,w.insert=0))),U(b),b.avail_out===0))return w.last_flush=-1,f}return q!==d?f:w.wrap<=0?1:(w.wrap===2?(J(w,255&b.adler),J(w,b.adler>>8&255),J(w,b.adler>>16&255),J(w,b.adler>>24&255),J(w,255&b.total_in),J(w,b.total_in>>8&255),J(w,b.total_in>>16&255),J(w,b.total_in>>24&255)):(B(w,b.adler>>>16),B(w,65535&b.adler)),U(b),0=M.w_size&&(E===0&&(ie(M.head),M.strstart=0,M.block_start=0,M.insert=0),oe=new a.Buf8(M.w_size),a.arraySet(oe,q,ce-M.w_size,M.w_size,0),q=oe,ce=M.w_size),K=b.avail_in,$=b.next_in,Z=b.input,b.avail_in=ce,b.next_in=0,b.input=q,ee(M);M.lookahead>=_;){for(w=M.strstart,S=M.lookahead-(_-1);M.ins_h=(M.ins_h<>>=_=W>>>24,x-=_,(_=W>>>16&255)===0)L[u++]=65535&W;else{if(!(16&_)){if((64&_)==0){W=T[(65535&W)+(m&(1<<_)-1)];continue t}if(32&_){s.mode=12;break e}o.msg="invalid literal/length code",s.mode=30;break e}Q=65535&W,(_&=15)&&(x<_&&(m+=y[l++]<>>=_,x-=_),x<15&&(m+=y[l++]<>>=_=W>>>24,x-=_,!(16&(_=W>>>16&255))){if((64&_)==0){W=P[(65535&W)+(m&(1<<_)-1)];continue r}o.msg="invalid distance code",s.mode=30;break e}if(te=65535&W,x<(_&=15)&&(m+=y[l++]<>>=_,x-=_,(_=u-h)>3,m&=(1<<(x-=Q<<3))-1,o.next_in=l,o.next_out=u,o.avail_in=l>>24&255)+(O>>>8&65280)+((65280&O)<<8)+((255&O)<<24)}function m(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new o.Buf16(320),this.work=new o.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function x(O){var I;return O&&O.state?(I=O.state,O.total_in=O.total_out=I.total=0,O.msg="",I.wrap&&(O.adler=1&I.wrap),I.mode=p,I.last=0,I.havedict=0,I.dmax=32768,I.head=null,I.hold=0,I.bits=0,I.lencode=I.lendyn=new o.Buf32(g),I.distcode=I.distdyn=new o.Buf32(v),I.sane=1,I.back=-1,d):f}function T(O){var I;return O&&O.state?((I=O.state).wsize=0,I.whave=0,I.wnext=0,x(O)):f}function P(O,I){var y,L;return O&&O.state?(L=O.state,I<0?(y=0,I=-I):(y=1+(I>>4),I<48&&(I&=15)),I&&(I<8||15=F.wsize?(o.arraySet(F.window,I,y-F.wsize,F.wsize,0),F.wnext=0,F.whave=F.wsize):(L<(k=F.wsize-F.wnext)&&(k=L),o.arraySet(F.window,I,y-L,k,F.wnext),(L-=k)?(o.arraySet(F.window,I,y-L,L,0),F.wnext=L,F.whave=F.wsize):(F.wnext+=k,F.wnext===F.wsize&&(F.wnext=0),F.whave>>8&255,y.check=s(y.check,E,2,0),N=U=0,y.mode=2;break}if(y.flags=0,y.head&&(y.head.done=!1),!(1&y.wrap)||(((255&U)<<8)+(U>>8))%31){O.msg="incorrect header check",y.mode=30;break}if((15&U)!=8){O.msg="unknown compression method",y.mode=30;break}if(N-=4,b=8+(15&(U>>>=4)),y.wbits===0)y.wbits=b;else if(b>y.wbits){O.msg="invalid window size",y.mode=30;break}y.dmax=1<>8&1),512&y.flags&&(E[0]=255&U,E[1]=U>>>8&255,y.check=s(y.check,E,2,0)),N=U=0,y.mode=3;case 3:for(;N<32;){if(V===0)break e;V--,U+=L[F++]<>>8&255,E[2]=U>>>16&255,E[3]=U>>>24&255,y.check=s(y.check,E,4,0)),N=U=0,y.mode=4;case 4:for(;N<16;){if(V===0)break e;V--,U+=L[F++]<>8),512&y.flags&&(E[0]=255&U,E[1]=U>>>8&255,y.check=s(y.check,E,2,0)),N=U=0,y.mode=5;case 5:if(1024&y.flags){for(;N<16;){if(V===0)break e;V--,U+=L[F++]<>>8&255,y.check=s(y.check,E,2,0)),N=U=0}else y.head&&(y.head.extra=null);y.mode=6;case 6:if(1024&y.flags&&(V<(re=y.length)&&(re=V),re&&(y.head&&(b=y.head.extra_len-y.length,y.head.extra||(y.head.extra=new Array(y.head.extra_len)),o.arraySet(y.head.extra,L,F,re,b)),512&y.flags&&(y.check=s(y.check,L,re,F)),V-=re,F+=re,y.length-=re),y.length))break e;y.length=0,y.mode=7;case 7:if(2048&y.flags){if(V===0)break e;for(re=0;b=L[F+re++],y.head&&b&&y.length<65536&&(y.head.name+=String.fromCharCode(b)),b&&re>9&1,y.head.done=!0),O.adler=y.check=0,y.mode=12;break;case 10:for(;N<32;){if(V===0)break e;V--,U+=L[F++]<>>=7&N,N-=7&N,y.mode=27;break}for(;N<3;){if(V===0)break e;V--,U+=L[F++]<>>=1)){case 0:y.mode=14;break;case 1:if(Q(y),y.mode=20,I!==6)break;U>>>=2,N-=2;break e;case 2:y.mode=17;break;case 3:O.msg="invalid block type",y.mode=30}U>>>=2,N-=2;break;case 14:for(U>>>=7&N,N-=7&N;N<32;){if(V===0)break e;V--,U+=L[F++]<>>16^65535)){O.msg="invalid stored block lengths",y.mode=30;break}if(y.length=65535&U,N=U=0,y.mode=15,I===6)break e;case 15:y.mode=16;case 16:if(re=y.length){if(V>>=5,N-=5,y.ndist=1+(31&U),U>>>=5,N-=5,y.ncode=4+(15&U),U>>>=4,N-=4,286>>=3,N-=3}for(;y.have<19;)y.lens[K[y.have++]]=0;if(y.lencode=y.lendyn,y.lenbits=7,M={bits:y.lenbits},q=c(0,y.lens,0,19,y.lencode,0,y.work,M),y.lenbits=M.bits,q){O.msg="invalid code lengths set",y.mode=30;break}y.have=0,y.mode=19;case 19:for(;y.have>>16&255,z=65535&S,!((C=S>>>24)<=N);){if(V===0)break e;V--,U+=L[F++]<>>=C,N-=C,y.lens[y.have++]=z;else{if(z===16){for(w=C+2;N>>=C,N-=C,y.have===0){O.msg="invalid bit length repeat",y.mode=30;break}b=y.lens[y.have-1],re=3+(3&U),U>>>=2,N-=2}else if(z===17){for(w=C+3;N>>=C)),U>>>=3,N-=3}else{for(w=C+7;N>>=C)),U>>>=7,N-=7}if(y.have+re>y.nlen+y.ndist){O.msg="invalid bit length repeat",y.mode=30;break}for(;re--;)y.lens[y.have++]=b}}if(y.mode===30)break;if(y.lens[256]===0){O.msg="invalid code -- missing end-of-block",y.mode=30;break}if(y.lenbits=9,M={bits:y.lenbits},q=c(u,y.lens,0,y.nlen,y.lencode,0,y.work,M),y.lenbits=M.bits,q){O.msg="invalid literal/lengths set",y.mode=30;break}if(y.distbits=6,y.distcode=y.distdyn,M={bits:y.distbits},q=c(h,y.lens,y.nlen,y.ndist,y.distcode,0,y.work,M),y.distbits=M.bits,q){O.msg="invalid distances set",y.mode=30;break}if(y.mode=20,I===6)break e;case 20:y.mode=21;case 21:if(6<=V&&258<=ie){O.next_out=Y,O.avail_out=ie,O.next_in=F,O.avail_in=V,y.hold=U,y.bits=N,l(O,B),Y=O.next_out,k=O.output,ie=O.avail_out,F=O.next_in,L=O.input,V=O.avail_in,U=y.hold,N=y.bits,y.mode===12&&(y.back=-1);break}for(y.back=0;G=(S=y.lencode[U&(1<>>16&255,z=65535&S,!((C=S>>>24)<=N);){if(V===0)break e;V--,U+=L[F++]<>H)])>>>16&255,z=65535&S,!(H+(C=S>>>24)<=N);){if(V===0)break e;V--,U+=L[F++]<>>=H,N-=H,y.back+=H}if(U>>>=C,N-=C,y.back+=C,y.length=z,G===0){y.mode=26;break}if(32&G){y.back=-1,y.mode=12;break}if(64&G){O.msg="invalid literal/length code",y.mode=30;break}y.extra=15&G,y.mode=22;case 22:if(y.extra){for(w=y.extra;N>>=y.extra,N-=y.extra,y.back+=y.extra}y.was=y.length,y.mode=23;case 23:for(;G=(S=y.distcode[U&(1<>>16&255,z=65535&S,!((C=S>>>24)<=N);){if(V===0)break e;V--,U+=L[F++]<>H)])>>>16&255,z=65535&S,!(H+(C=S>>>24)<=N);){if(V===0)break e;V--,U+=L[F++]<>>=H,N-=H,y.back+=H}if(U>>>=C,N-=C,y.back+=C,64&G){O.msg="invalid distance code",y.mode=30;break}y.offset=z,y.extra=15&G,y.mode=24;case 24:if(y.extra){for(w=y.extra;N>>=y.extra,N-=y.extra,y.back+=y.extra}if(y.offset>y.dmax){O.msg="invalid distance too far back",y.mode=30;break}y.mode=25;case 25:if(ie===0)break e;if(re=B-ie,y.offset>re){if((re=y.offset-re)>y.whave&&y.sane){O.msg="invalid distance too far back",y.mode=30;break}ee=re>y.wnext?(re-=y.wnext,y.wsize-re):y.wnext-re,re>y.length&&(re=y.length),X=y.window}else X=k,ee=Y-y.offset,re=y.length;for(ieD?(_=ee[X+v[I]],N[J+v[I]]):(_=96,0),m=1<>Y)+(x-=m)]=W<<24|_<<16|Q|0,x!==0;);for(m=1<>=1;if(m!==0?(U&=m-1,U+=m):U=0,I++,--B[O]==0){if(O===L)break;O=h[d+v[I]]}if(k>>7)]}function J(S,E){S.pending_buf[S.pending++]=255&E,S.pending_buf[S.pending++]=E>>>8&255}function B(S,E,K){S.bi_valid>R-K?(S.bi_buf|=E<>R-S.bi_valid,S.bi_valid+=K-R):(S.bi_buf|=E<>>=1,K<<=1,0<--E;);return K>>>1}function X(S,E,K){var $,Z,oe=new Array(v+1),ce=0;for($=1;$<=v;$++)oe[$]=ce=ce+K[$-1]<<1;for(Z=0;Z<=E;Z++){var se=S[2*Z+1];se!==0&&(S[2*Z]=ee(oe[se]++,se))}}function C(S){var E;for(E=0;E>1;1<=K;K--)H(S,oe,K);for(Z=ge;K=S.heap[1],S.heap[1]=S.heap[S.heap_len--],H(S,oe,1),$=S.heap[1],S.heap[--S.heap_max]=K,S.heap[--S.heap_max]=$,oe[2*Z]=oe[2*K]+oe[2*$],S.depth[Z]=(S.depth[K]>=S.depth[$]?S.depth[K]:S.depth[$])+1,oe[2*K+1]=oe[2*$+1]=Z,S.heap[1]=Z++,H(S,oe,1),2<=S.heap_len;);S.heap[--S.heap_max]=S.heap[1],function(Te,Ye){var Vt,lt,ft,Ue,_t,Jt,Tt=Ye.dyn_tree,Cr=Ye.max_code,Jr=Ye.stat_desc.static_tree,lr=Ye.stat_desc.has_stree,zr=Ye.stat_desc.extra_bits,Ar=Ye.stat_desc.extra_base,er=Ye.stat_desc.max_length,cr=0;for(Ue=0;Ue<=v;Ue++)Te.bl_count[Ue]=0;for(Tt[2*Te.heap[Te.heap_max]+1]=0,Vt=Te.heap_max+1;Vt>=7;Z>>=1)if(1&Oe&&se.dyn_ltree[2*ge]!==0)return a;if(se.dyn_ltree[18]!==0||se.dyn_ltree[20]!==0||se.dyn_ltree[26]!==0)return s;for(ge=32;ge>>3,(oe=S.static_len+3+7>>>3)<=Z&&(Z=oe)):Z=oe=K+5,K+4<=Z&&E!==-1?w(S,E,K,$):S.strategy===4||oe===Z?(B(S,2+($?1:0),3),j(S,te,O)):(B(S,4+($?1:0),3),function(se,ge,Oe,Te){var Ye;for(B(se,ge-257,5),B(se,Oe-1,5),B(se,Te-4,4),Ye=0;Ye>>8&255,S.pending_buf[S.d_buf+2*S.last_lit+1]=255&E,S.pending_buf[S.l_buf+S.last_lit]=255&K,S.last_lit++,E===0?S.dyn_ltree[2*K]++:(S.matches++,E--,S.dyn_ltree[2*(y[K]+h+1)]++,S.dyn_dtree[2*N(E)]++),S.last_lit===S.lit_bufsize-1},i._tr_align=function(S){B(S,2,3),re(S,x,te),function(E){E.bi_valid===16?(J(E,E.bi_buf),E.bi_buf=0,E.bi_valid=0):8<=E.bi_valid&&(E.pending_buf[E.pending++]=255&E.bi_buf,E.bi_buf>>=8,E.bi_valid-=8)}(S)}},{"../utils/common":41}],53:[function(t,n,i){n.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,n,i){(function(o){(function(a,s){if(!a.setImmediate){var l,c,u,h,d=1,f={},p=!1,g=a.document,v=Object.getPrototypeOf&&Object.getPrototypeOf(a);v=v&&v.setTimeout?v:a,l={}.toString.call(a.process)==="[object process]"?function(T){ke.nextTick(function(){m(T)})}:function(){if(a.postMessage&&!a.importScripts){var T=!0,P=a.onmessage;return a.onmessage=function(){T=!1},a.postMessage("","*"),a.onmessage=P,T}}()?(h="setImmediate$"+Math.random()+"$",a.addEventListener?a.addEventListener("message",x,!1):a.attachEvent("onmessage",x),function(T){a.postMessage(h+T,"*")}):a.MessageChannel?((u=new MessageChannel).port1.onmessage=function(T){m(T.data)},function(T){u.port2.postMessage(T)}):g&&"onreadystatechange"in g.createElement("script")?(c=g.documentElement,function(T){var P=g.createElement("script");P.onreadystatechange=function(){m(T),P.onreadystatechange=null,c.removeChild(P),P=null},c.appendChild(P)}):function(T){setTimeout(m,0,T)},v.setImmediate=function(T){typeof T!="function"&&(T=new Function(""+T));for(var P=new Array(arguments.length-1),A=0;A":">"};function JO(r){return r&&r.replace?r.replace(/([&"<>'])/g,function(e,t){return GO[t]}):r}var zO=JO,ql=zO,Rf=Ic.Stream,$O=" ";function jO(r,e){typeof e!="object"&&(e={indent:e});var t=e.stream?new Rf:null,n="",i=!1,o=e.indent?e.indent===!0?$O:e.indent:"",a=!0;function s(d){a?ke.nextTick(d):d()}function l(d,f){if(f!==void 0&&(n+=f),d&&!i&&(t=t||new Rf,i=!0),d&&i){var p=n;s(function(){t.emit("data",p)}),n=""}}function c(d,f){kc(l,Va(d,o,o?1:0),f)}function u(){if(t){var d=n;s(function(){t.emit("data",d),t.emit("end"),t.readable=!1,t.emit("close")})}}function h(d){var f=d.encoding||"UTF-8",p={version:"1.0",encoding:f};d.standalone&&(p.standalone=d.standalone),c({"?xml":{_attr:p}}),n=n.replace("/>","?>")}return s(function(){a=!1}),e.declaration&&h(e.declaration),r&&r.forEach?r.forEach(function(d,f){var p;f+1===r.length&&(p=u),c(d,p)}):c(r,u),t?(t.readable=!0,t):n}function qO(){var r=Array.prototype.slice.call(arguments),e={_elem:Va(r)};return e.push=function(t){if(!this.append)throw new Error("not assigned to a parent!");var n=this,i=this._elem.indent;kc(this.append,Va(t,i,this._elem.icount+(i?1:0)),function(){n.append(!0)})},e.close=function(t){t!==void 0&&this.push(t),this.end&&this.end()},e}function e2(r,e){return new Array(e||0).join(r||"")}function Va(r,e,t){t=t||0;var n=e2(e,t),i,o=r,a=!1;if(typeof r=="object"){var s=Object.keys(r);if(i=s[0],o=r[i],o&&o._elem)return o._elem.name=i,o._elem.icount=t,o._elem.indent=e,o._elem.indents=n,o._elem.interrupt=o,o._elem}var l=[],c=[],u;function h(d){var f=Object.keys(d);f.forEach(function(p){l.push(t2(p,d[p]))})}switch(typeof o){case"object":if(o===null)break;o._attr&&h(o._attr),o._cdata&&c.push(("/g,"]]]]>")+"]]>"),o.forEach&&(u=!1,c.push(""),o.forEach(function(d){if(typeof d=="object"){var f=Object.keys(d)[0];f=="_attr"?h(d._attr):c.push(Va(d,e,t+1))}else c.pop(),u=!0,c.push(ql(d))}),u||c.push(""));break;default:c.push(ql(o))}return{name:i,interrupt:a,attributes:l,content:c,icount:t,indents:n,indent:e}}function kc(r,e,t){if(typeof e!="object")return r(!1,e);var n=e.interrupt?1:e.content.length;function i(){for(;e.content.length;){var a=e.content.shift();if(a!==void 0){if(o(a))return;kc(r,a)}}r(!1,(n>1?e.indents:"")+(e.name?"":"")+(e.indent&&!t?` +`:"")),t&&t()}function o(a){return a.interrupt?(a.interrupt.append=r,a.interrupt.end=i,a.interrupt=!1,r(!0),!0):!1}if(r(!1,e.indents+(e.name?"<"+e.name:"")+(e.attributes.length?" "+e.attributes.join(" "):"")+(n?e.name?">":"":e.name?"/>":"")+(e.indent&&n>1?` +`:"")),!n)return r(!1,e.indent?` +`:"");o(e)||i()}function t2(r,e){return r+'="'+ql(e)+'"'}Wa.exports=jO;Wa.exports.element=Wa.exports.Element=qO;var r2=Wa.exports;const Ct=d0(r2),mf=0,vf=32,n2=32,i2=(r,e)=>{const t=e.replace(/-/g,"");if(t.length!==n2)throw new Error(`Error: Cannot extract GUID from font filename: ${e}`);const i=t.replace(/(..)/g,"$1 ").trim().split(" ").map(l=>parseInt(l,16));i.reverse();const a=r.slice(mf,vf).map((l,c)=>l^i[c%i.length]);return Buffer.concat([r.slice(0,mf),a,r.slice(vf)])};class o2{format(e,t={stack:[]}){const n=e.prepForXml(t);if(n)return n;throw Error("XMLComponent did not format correctly")}}class a2{replace(e,t,n){let i=e;return t.forEach((o,a)=>{i=i.replace(new RegExp(`{${o.fileName}}`,"g"),(n+a).toString())}),i}getMediaData(e,t){return t.Array.filter(n=>e.search(`{${n.fileName}}`)>0)}}class s2{replace(e,t){let n=e;for(const i of t)n=n.replace(new RegExp(`{${i.reference}-${i.instance}}`,"g"),i.numId.toString());return n}}class l2{constructor(){pe(this,"formatter"),pe(this,"imageReplacer"),pe(this,"numberingReplacer"),this.formatter=new o2,this.imageReplacer=new a2,this.numberingReplacer=new s2}compile(e,t){const n=new BO,i=this.xmlifyFile(e,t),o=new Map(Object.entries(i));for(const[,a]of o)if(Array.isArray(a))for(const s of a)n.file(s.path,s.data);else n.file(a.path,a.data);for(const{stream:a,fileName:s}of e.Media.Array)n.file(`word/media/${s}`,a);for(const{data:a,name:s,fontKey:l}of e.FontTable.fontOptionsWithKey){const[c]=s.split(".");n.file(`word/fonts/${c}.odttf`,i2(a,l))}return n}xmlifyFile(e,t){const n=e.Document.Relationships.RelationshipCount+1,i=Ct(this.formatter.format(e.Document.View,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),o=this.imageReplacer.getMediaData(i,e.Media);return{Relationships:{data:(()=>(o.forEach((a,s)=>{e.Document.Relationships.createRelationship(n+s,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${a.fileName}`)}),Ct(this.formatter.format(e.Document.Relationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}})))(),path:"word/_rels/document.xml.rels"},Document:{data:(()=>{const a=this.imageReplacer.replace(i,o,n);return this.numberingReplacer.replace(a,e.Numbering.ConcreteNumbering)})(),path:"word/document.xml"},Styles:{data:(()=>{const a=Ct(this.formatter.format(e.Styles,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}});return this.numberingReplacer.replace(a,e.Numbering.ConcreteNumbering)})(),path:"word/styles.xml"},Properties:{data:Ct(this.formatter.format(e.CoreProperties,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"docProps/core.xml"},Numbering:{data:Ct(this.formatter.format(e.Numbering,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/numbering.xml"},FileRelationships:{data:Ct(this.formatter.format(e.FileRelationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:"_rels/.rels"},HeaderRelationships:e.Headers.map((a,s)=>{const l=Ct(this.formatter.format(a.View,{viewWrapper:a,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}});return this.imageReplacer.getMediaData(l,e.Media).forEach((u,h)=>{a.Relationships.createRelationship(h,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${u.fileName}`)}),{data:Ct(this.formatter.format(a.Relationships,{viewWrapper:a,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:`word/_rels/header${s+1}.xml.rels`}}),FooterRelationships:e.Footers.map((a,s)=>{const l=Ct(this.formatter.format(a.View,{viewWrapper:a,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}});return this.imageReplacer.getMediaData(l,e.Media).forEach((u,h)=>{a.Relationships.createRelationship(h,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${u.fileName}`)}),{data:Ct(this.formatter.format(a.Relationships,{viewWrapper:a,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:`word/_rels/footer${s+1}.xml.rels`}}),Headers:e.Headers.map((a,s)=>{const l=Ct(this.formatter.format(a.View,{viewWrapper:a,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),c=this.imageReplacer.getMediaData(l,e.Media),u=this.imageReplacer.replace(l,c,0);return{data:this.numberingReplacer.replace(u,e.Numbering.ConcreteNumbering),path:`word/header${s+1}.xml`}}),Footers:e.Footers.map((a,s)=>{const l=Ct(this.formatter.format(a.View,{viewWrapper:a,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),c=this.imageReplacer.getMediaData(l,e.Media),u=this.imageReplacer.replace(l,c,0);return{data:this.numberingReplacer.replace(u,e.Numbering.ConcreteNumbering),path:`word/footer${s+1}.xml`}}),ContentTypes:{data:Ct(this.formatter.format(e.ContentTypes,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:"[Content_Types].xml"},CustomProperties:{data:Ct(this.formatter.format(e.CustomProperties,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"docProps/custom.xml"},AppProperties:{data:Ct(this.formatter.format(e.AppProperties,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"docProps/app.xml"},FootNotes:{data:Ct(this.formatter.format(e.FootNotes.View,{viewWrapper:e.FootNotes,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:"word/footnotes.xml"},FootNotesRelationships:{data:Ct(this.formatter.format(e.FootNotes.Relationships,{viewWrapper:e.FootNotes,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:"word/_rels/footnotes.xml.rels"},Settings:{data:Ct(this.formatter.format(e.Settings,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/settings.xml"},Comments:{data:Ct(this.formatter.format(e.Comments,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/comments.xml"},FontTable:{data:Ct(this.formatter.format(e.FontTable.View,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/fontTable.xml"},FontTableRelationships:{data:(()=>Ct(this.formatter.format(e.FontTable.Relationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}))(),path:"word/_rels/fontTable.xml.rels"}}}}const c2={NONE:"",WITH_2_BLANKS:" ",WITH_4_BLANKS:" ",WITH_TAB:" "},ao=r=>r===!0?c2.WITH_2_BLANKS:r===!1?void 0:r;class xa{static toString(e,t){return jo(this,null,function*(){return yield this.compiler.compile(e,ao(t)).generateAsync({type:"string",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",compression:"DEFLATE"})})}static toBuffer(e,t){return jo(this,null,function*(){return yield this.compiler.compile(e,ao(t)).generateAsync({type:"nodebuffer",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",compression:"DEFLATE"})})}static toBase64String(e,t){return jo(this,null,function*(){return yield this.compiler.compile(e,ao(t)).generateAsync({type:"base64",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",compression:"DEFLATE"})})}static toBlob(e,t){return jo(this,null,function*(){return yield this.compiler.compile(e,ao(t)).generateAsync({type:"blob",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",compression:"DEFLATE"})})}static toStream(e,t){const n=new Ic.Stream;return this.compiler.compile(e,ao(t)).generateAsync({type:"nodebuffer",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",compression:"DEFLATE"}).then(o=>{n.emit("data",o),n.emit("end")}),n}}pe(xa,"compiler",new l2);function u2(r,e){const t=document.createElement("a");t.href=window.URL.createObjectURL(r),t.download=e,t.click(),window.URL.revokeObjectURL(t.href)}const h2={[tt.FIRST]:ui.HEADING_1,[tt.SECOND]:ui.HEADING_2,[tt.THIRD]:ui.HEADING_3,[tt.FOURTH]:ui.HEADING_4,[tt.FIFTH]:ui.HEADING_5,[tt.SIXTH]:ui.HEADING_6};function gl(r){var e;return r.type===ae.IMAGE?new lx({data:r.value,transformation:{width:r.width,height:r.height}}):r.type===ae.HYPERLINK?new gp({children:[new Li({text:(e=r.valueList)==null?void 0:e.map(t=>t.value).join(""),style:"Hyperlink"})],link:r.url}):r.type===ae.TAB?new Li({children:[new dx]}):r.type===ae.LATEX?new nb(r.value):new Li({font:r.font,text:r.value,bold:r.bold,size:`${(r.size||16)/.75}pt`,color:ah(r.color).hex()||"#000000",italics:r.italic,strike:r.strikeout,highlight:r.highlight?ah(r.highlight).hex():void 0,superScript:r.type===ae.SUPERSCRIPT,subScript:r.type===ae.SUBSCRIPT,underline:r.underline?{}:void 0})}function ba(r){var i,o,a;const e=[];let t=[];function n(){t.length&&(e.push(new An({children:t})),t=[])}for(let s=0;sgl(c)))||[]}));else if(l.type===ae.LIST){n();const c=((o=l.valueList)==null?void 0:o.map(u=>u.value).join("").split(` +`).map((u,h)=>new An({children:[new Li({text:`${!l.listStyle||l.listStyle===Er.DECIMAL?`${h+1}. `:"\u2022 "}${u}`})]})))||[];e.push(...c)}else if(l.type===ae.TABLE){n();const{trList:c}=l,u=[];for(let h=0;hgl(c)))||[]):(/^\n/.test(l.value)&&(n(),l.value=l.value.replace(/^\n/,"")),t.push(gl(l)))}return n(),e}function f2(r){return new Promise((e,t)=>{const n=new FileReader;n.onload=function(i){const o=i.target.result.split(";base64,");e(o[1])},n.onerror=function(i){t(i)},n.readAsDataURL(r)})}function yf(r,e,t){const{data:{header:n,main:i,footer:o}}=r.getValue(),a=new ZO({sections:[{headers:{default:new QO({children:ba(n||[])})},footers:{default:new KO({children:ba(o||[])})},children:ba(i||[])}]});return t==="blob"?xa.toBlob(a):t==="base64"?new Promise((s,l)=>{xa.toBlob(a).then(c=>{f2(c).then(u=>{s(u)}).catch(u=>{l(u)})}).catch(c=>{l(c)})}):new Promise((s,l)=>{xa.toBlob(a).then(c=>{u2(c,`${e}.docx`),s()}).catch(l)})}var Pp={exports:{}};/*! + +JSZip v3.10.1 - A JavaScript class for generating and reading zip files + + +(c) 2009-2016 Stuart Knightley +Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown. + +JSZip uses the library pako released under the MIT license : +https://github.com/nodeca/pako/blob/main/LICENSE +*/(function(r,e){(function(t){r.exports=t()})(function(){return function t(n,i,o){function a(c,u){if(!i[c]){if(!n[c]){var h=typeof Ho=="function"&&Ho;if(!u&&h)return h(c,!0);if(s)return s(c,!0);var d=new Error("Cannot find module '"+c+"'");throw d.code="MODULE_NOT_FOUND",d}var f=i[c]={exports:{}};n[c][0].call(f.exports,function(p){var g=n[c][1][p];return a(g||p)},f,f.exports,t,n,i,o)}return i[c].exports}for(var s=typeof Ho=="function"&&Ho,l=0;l>2,f=(3&c)<<4|u>>4,p=1>6:64,g=2>4,u=(15&d)<<4|(f=s.indexOf(l.charAt(g++)))>>2,h=(3&f)<<6|(p=s.indexOf(l.charAt(g++))),m[v++]=c,f!==64&&(m[v++]=u),p!==64&&(m[v++]=h);return m}},{"./support":30,"./utils":32}],2:[function(t,n,i){var o=t("./external"),a=t("./stream/DataWorker"),s=t("./stream/Crc32Probe"),l=t("./stream/DataLengthProbe");function c(u,h,d,f,p){this.compressedSize=u,this.uncompressedSize=h,this.crc32=d,this.compression=f,this.compressedContent=p}c.prototype={getContentWorker:function(){var u=new a(o.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),h=this;return u.on("end",function(){if(this.streamInfo.data_length!==h.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),u},getCompressedWorker:function(){return new a(o.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},c.createWorkerFrom=function(u,h,d){return u.pipe(new s).pipe(new l("uncompressedSize")).pipe(h.compressWorker(d)).pipe(new l("compressedSize")).withStreamInfo("compression",h)},n.exports=c},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,n,i){var o=t("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(){return new o("STORE compression")},uncompressWorker:function(){return new o("STORE decompression")}},i.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,n,i){var o=t("./utils"),a=function(){for(var s,l=[],c=0;c<256;c++){s=c;for(var u=0;u<8;u++)s=1&s?3988292384^s>>>1:s>>>1;l[c]=s}return l}();n.exports=function(s,l){return s!==void 0&&s.length?o.getTypeOf(s)!=="string"?function(c,u,h,d){var f=a,p=d+h;c^=-1;for(var g=d;g>>8^f[255&(c^u[g])];return-1^c}(0|l,s,s.length,0):function(c,u,h,d){var f=a,p=d+h;c^=-1;for(var g=d;g>>8^f[255&(c^u.charCodeAt(g))];return-1^c}(0|l,s,s.length,0):0}},{"./utils":32}],5:[function(t,n,i){i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(t,n,i){var o=null;o=typeof Promise!="undefined"?Promise:t("lie"),n.exports={Promise:o}},{lie:37}],7:[function(t,n,i){var o=typeof Uint8Array!="undefined"&&typeof Uint16Array!="undefined"&&typeof Uint32Array!="undefined",a=t("pako"),s=t("./utils"),l=t("./stream/GenericWorker"),c=o?"uint8array":"array";function u(h,d){l.call(this,"FlateWorker/"+h),this._pako=null,this._pakoAction=h,this._pakoOptions=d,this.meta={}}i.magic="\b\0",s.inherits(u,l),u.prototype.processChunk=function(h){this.meta=h.meta,this._pako===null&&this._createPako(),this._pako.push(s.transformTo(c,h.data),!1)},u.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new a[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var h=this;this._pako.onData=function(d){h.push({data:d,meta:h.meta})}},i.compressWorker=function(h){return new u("Deflate",h)},i.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,n,i){function o(f,p){var g,v="";for(g=0;g>>=8;return v}function a(f,p,g,v,R,m){var x,T,P=f.file,A=f.compression,D=m!==c.utf8encode,W=s.transformTo("string",m(P.name)),_=s.transformTo("string",c.utf8encode(P.name)),Q=P.comment,te=s.transformTo("string",m(Q)),O=s.transformTo("string",c.utf8encode(Q)),I=_.length!==P.name.length,y=O.length!==Q.length,L="",k="",F="",Y=P.dir,V=P.date,ie={crc32:0,compressedSize:0,uncompressedSize:0};p&&!g||(ie.crc32=f.crc32,ie.compressedSize=f.compressedSize,ie.uncompressedSize=f.uncompressedSize);var U=0;p&&(U|=8),D||!I&&!y||(U|=2048);var N=0,J=0;Y&&(N|=16),R==="UNIX"?(J=798,N|=function(re,ee){var X=re;return re||(X=ee?16893:33204),(65535&X)<<16}(P.unixPermissions,Y)):(J=20,N|=function(re){return 63&(re||0)}(P.dosPermissions)),x=V.getUTCHours(),x<<=6,x|=V.getUTCMinutes(),x<<=5,x|=V.getUTCSeconds()/2,T=V.getUTCFullYear()-1980,T<<=4,T|=V.getUTCMonth()+1,T<<=5,T|=V.getUTCDate(),I&&(k=o(1,1)+o(u(W),4)+_,L+="up"+o(k.length,2)+k),y&&(F=o(1,1)+o(u(te),4)+O,L+="uc"+o(F.length,2)+F);var B="";return B+=` +\0`,B+=o(U,2),B+=A.magic,B+=o(x,2),B+=o(T,2),B+=o(ie.crc32,4),B+=o(ie.compressedSize,4),B+=o(ie.uncompressedSize,4),B+=o(W.length,2),B+=o(L.length,2),{fileRecord:h.LOCAL_FILE_HEADER+B+W+L,dirRecord:h.CENTRAL_FILE_HEADER+o(J,2)+B+o(te.length,2)+"\0\0\0\0"+o(N,4)+o(v,4)+W+L+te}}var s=t("../utils"),l=t("../stream/GenericWorker"),c=t("../utf8"),u=t("../crc32"),h=t("../signature");function d(f,p,g,v){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=p,this.zipPlatform=g,this.encodeFileName=v,this.streamFiles=f,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}s.inherits(d,l),d.prototype.push=function(f){var p=f.meta.percent||0,g=this.entriesCount,v=this._sources.length;this.accumulate?this.contentBuffer.push(f):(this.bytesWritten+=f.data.length,l.prototype.push.call(this,{data:f.data,meta:{currentFile:this.currentFile,percent:g?(p+100*(g-v-1))/g:100}}))},d.prototype.openedSource=function(f){this.currentSourceOffset=this.bytesWritten,this.currentFile=f.file.name;var p=this.streamFiles&&!f.file.dir;if(p){var g=a(f,p,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:g.fileRecord,meta:{percent:0}})}else this.accumulate=!0},d.prototype.closedSource=function(f){this.accumulate=!1;var p=this.streamFiles&&!f.file.dir,g=a(f,p,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(g.dirRecord),p)this.push({data:function(v){return h.DATA_DESCRIPTOR+o(v.crc32,4)+o(v.compressedSize,4)+o(v.uncompressedSize,4)}(f),meta:{percent:100}});else for(this.push({data:g.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},d.prototype.flush=function(){for(var f=this.bytesWritten,p=0;p=this.index;l--)c=(c<<8)+this.byteAt(l);return this.index+=s,c},readString:function(s){return o.transformTo("string",this.readData(s))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var s=this.readInt(4);return new Date(Date.UTC(1980+(s>>25&127),(s>>21&15)-1,s>>16&31,s>>11&31,s>>5&63,(31&s)<<1))}},n.exports=a},{"../utils":32}],19:[function(t,n,i){var o=t("./Uint8ArrayReader");function a(s){o.call(this,s)}t("../utils").inherits(a,o),a.prototype.readData=function(s){this.checkOffset(s);var l=this.data.slice(this.zero+this.index,this.zero+this.index+s);return this.index+=s,l},n.exports=a},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,n,i){var o=t("./DataReader");function a(s){o.call(this,s)}t("../utils").inherits(a,o),a.prototype.byteAt=function(s){return this.data.charCodeAt(this.zero+s)},a.prototype.lastIndexOfSignature=function(s){return this.data.lastIndexOf(s)-this.zero},a.prototype.readAndCheckSignature=function(s){return s===this.readData(4)},a.prototype.readData=function(s){this.checkOffset(s);var l=this.data.slice(this.zero+this.index,this.zero+this.index+s);return this.index+=s,l},n.exports=a},{"../utils":32,"./DataReader":18}],21:[function(t,n,i){var o=t("./ArrayReader");function a(s){o.call(this,s)}t("../utils").inherits(a,o),a.prototype.readData=function(s){if(this.checkOffset(s),s===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+s);return this.index+=s,l},n.exports=a},{"../utils":32,"./ArrayReader":17}],22:[function(t,n,i){var o=t("../utils"),a=t("../support"),s=t("./ArrayReader"),l=t("./StringReader"),c=t("./NodeBufferReader"),u=t("./Uint8ArrayReader");n.exports=function(h){var d=o.getTypeOf(h);return o.checkSupport(d),d!=="string"||a.uint8array?d==="nodebuffer"?new c(h):a.uint8array?new u(o.transformTo("uint8array",h)):new s(o.transformTo("array",h)):new l(h)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,n,i){i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(t,n,i){var o=t("./GenericWorker"),a=t("../utils");function s(l){o.call(this,"ConvertWorker to "+l),this.destType=l}a.inherits(s,o),s.prototype.processChunk=function(l){this.push({data:a.transformTo(this.destType,l.data),meta:l.meta})},n.exports=s},{"../utils":32,"./GenericWorker":28}],25:[function(t,n,i){var o=t("./GenericWorker"),a=t("../crc32");function s(){o.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(s,o),s.prototype.processChunk=function(l){this.streamInfo.crc32=a(l.data,this.streamInfo.crc32||0),this.push(l)},n.exports=s},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,n,i){var o=t("../utils"),a=t("./GenericWorker");function s(l){a.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}o.inherits(s,a),s.prototype.processChunk=function(l){if(l){var c=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=c+l.data.length}a.prototype.processChunk.call(this,l)},n.exports=s},{"../utils":32,"./GenericWorker":28}],27:[function(t,n,i){var o=t("../utils"),a=t("./GenericWorker");function s(l){a.call(this,"DataWorker");var c=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(u){c.dataIsReady=!0,c.data=u,c.max=u&&u.length||0,c.type=o.getTypeOf(u),c.isPaused||c._tickAndRepeat()},function(u){c.error(u)})}o.inherits(s,a),s.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,o.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(o.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,c=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,c);break;case"uint8array":l=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":l=this.data.slice(this.index,c)}return this.index=c,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},n.exports=s},{"../utils":32,"./GenericWorker":28}],28:[function(t,n,i){function o(a){this.name=a||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}o.prototype={push:function(a){this.emit("data",a)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(a){this.emit("error",a)}return!0},error:function(a){return!this.isFinished&&(this.isPaused?this.generatedError=a:(this.isFinished=!0,this.emit("error",a),this.previous&&this.previous.error(a),this.cleanUp()),!0)},on:function(a,s){return this._listeners[a].push(s),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(a,s){if(this._listeners[a])for(var l=0;l "+a:a}},n.exports=o},{}],29:[function(t,n,i){var o=t("../utils"),a=t("./ConvertWorker"),s=t("./GenericWorker"),l=t("../base64"),c=t("../support"),u=t("../external"),h=null;if(c.nodestream)try{h=t("../nodejs/NodejsStreamOutputAdapter")}catch{}function d(p,g){return new u.Promise(function(v,R){var m=[],x=p._internalType,T=p._outputType,P=p._mimeType;p.on("data",function(A,D){m.push(A),g&&g(D)}).on("error",function(A){m=[],R(A)}).on("end",function(){try{var A=function(D,W,_){switch(D){case"blob":return o.newBlob(o.transformTo("arraybuffer",W),_);case"base64":return l.encode(W);default:return o.transformTo(D,W)}}(T,function(D,W){var _,Q=0,te=null,O=0;for(_=0;_>>6:(v<65536?g[x++]=224|v>>>12:(g[x++]=240|v>>>18,g[x++]=128|v>>>12&63),g[x++]=128|v>>>6&63),g[x++]=128|63&v);return g}(f)},i.utf8decode=function(f){return a.nodebuffer?o.transformTo("nodebuffer",f).toString("utf-8"):function(p){var g,v,R,m,x=p.length,T=new Array(2*x);for(g=v=0;g>10&1023,T[v++]=56320|1023&R)}return T.length!==v&&(T.subarray?T=T.subarray(0,v):T.length=v),o.applyFromCharCode(T)}(f=o.transformTo(a.uint8array?"uint8array":"array",f))},o.inherits(h,l),h.prototype.processChunk=function(f){var p=o.transformTo(a.uint8array?"uint8array":"array",f.data);if(this.leftOver&&this.leftOver.length){if(a.uint8array){var g=p;(p=new Uint8Array(g.length+this.leftOver.length)).set(this.leftOver,0),p.set(g,this.leftOver.length)}else p=this.leftOver.concat(p);this.leftOver=null}var v=function(m,x){var T;for((x=x||m.length)>m.length&&(x=m.length),T=x-1;0<=T&&(192&m[T])==128;)T--;return T<0||T===0?x:T+c[m[T]]>x?T:x}(p),R=p;v!==p.length&&(a.uint8array?(R=p.subarray(0,v),this.leftOver=p.subarray(v,p.length)):(R=p.slice(0,v),this.leftOver=p.slice(v,p.length))),this.push({data:i.utf8decode(R),meta:f.meta})},h.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=h,o.inherits(d,l),d.prototype.processChunk=function(f){this.push({data:i.utf8encode(f.data),meta:f.meta})},i.Utf8EncodeWorker=d},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,n,i){var o=t("./support"),a=t("./base64"),s=t("./nodejsUtils"),l=t("./external");function c(g){return g}function u(g,v){for(var R=0;R>8;this.dir=!!(16&this.externalFileAttributes),f==0&&(this.dosPermissions=63&this.externalFileAttributes),f==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var f=o(this.extraFields[1].value);this.uncompressedSize===a.MAX_VALUE_32BITS&&(this.uncompressedSize=f.readInt(8)),this.compressedSize===a.MAX_VALUE_32BITS&&(this.compressedSize=f.readInt(8)),this.localHeaderOffset===a.MAX_VALUE_32BITS&&(this.localHeaderOffset=f.readInt(8)),this.diskNumberStart===a.MAX_VALUE_32BITS&&(this.diskNumberStart=f.readInt(4))}},readExtraFields:function(f){var p,g,v,R=f.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});f.index+4>>6:(f<65536?d[v++]=224|f>>>12:(d[v++]=240|f>>>18,d[v++]=128|f>>>12&63),d[v++]=128|f>>>6&63),d[v++]=128|63&f);return d},i.buf2binstring=function(h){return u(h,h.length)},i.binstring2buf=function(h){for(var d=new o.Buf8(h.length),f=0,p=d.length;f>10&1023,m[p++]=56320|1023&g)}return u(m,p)},i.utf8border=function(h,d){var f;for((d=d||h.length)>h.length&&(d=h.length),f=d-1;0<=f&&(192&h[f])==128;)f--;return f<0||f===0?d:f+l[h[f]]>d?f:d}},{"./common":41}],43:[function(t,n,i){n.exports=function(o,a,s,l){for(var c=65535&o|0,u=o>>>16&65535|0,h=0;s!==0;){for(s-=h=2e3>>1:a>>>1;s[l]=a}return s}();n.exports=function(a,s,l,c){var u=o,h=c+l;a^=-1;for(var d=c;d>>8^u[255&(a^s[d])];return-1^a}},{}],46:[function(t,n,i){var o,a=t("../utils/common"),s=t("./trees"),l=t("./adler32"),c=t("./crc32"),u=t("./messages"),h=0,d=4,f=0,p=-2,g=-1,v=4,R=2,m=8,x=9,T=286,P=30,A=19,D=2*T+1,W=15,_=3,Q=258,te=Q+_+1,O=42,I=113,y=1,L=2,k=3,F=4;function Y(b,q){return b.msg=u[q],q}function V(b){return(b<<1)-(4b.avail_out&&(M=b.avail_out),M!==0&&(a.arraySet(b.output,q.pending_buf,q.pending_out,M,b.next_out),b.next_out+=M,q.pending_out+=M,b.total_out+=M,b.avail_out-=M,q.pending-=M,q.pending===0&&(q.pending_out=0))}function N(b,q){s._tr_flush_block(b,0<=b.block_start?b.block_start:-1,b.strstart-b.block_start,q),b.block_start=b.strstart,U(b.strm)}function J(b,q){b.pending_buf[b.pending++]=q}function B(b,q){b.pending_buf[b.pending++]=q>>>8&255,b.pending_buf[b.pending++]=255&q}function re(b,q){var M,w,S=b.max_chain_length,E=b.strstart,K=b.prev_length,$=b.nice_match,Z=b.strstart>b.w_size-te?b.strstart-(b.w_size-te):0,oe=b.window,ce=b.w_mask,se=b.prev,ge=b.strstart+Q,Oe=oe[E+K-1],Te=oe[E+K];b.prev_length>=b.good_match&&(S>>=2),$>b.lookahead&&($=b.lookahead);do if(oe[(M=q)+K]===Te&&oe[M+K-1]===Oe&&oe[M]===oe[E]&&oe[++M]===oe[E+1]){E+=2,M++;do;while(oe[++E]===oe[++M]&&oe[++E]===oe[++M]&&oe[++E]===oe[++M]&&oe[++E]===oe[++M]&&oe[++E]===oe[++M]&&oe[++E]===oe[++M]&&oe[++E]===oe[++M]&&oe[++E]===oe[++M]&&EZ&&--S!=0);return K<=b.lookahead?K:b.lookahead}function ee(b){var q,M,w,S,E,K,$,Z,oe,ce,se=b.w_size;do{if(S=b.window_size-b.lookahead-b.strstart,b.strstart>=se+(se-te)){for(a.arraySet(b.window,b.window,se,se,0),b.match_start-=se,b.strstart-=se,b.block_start-=se,q=M=b.hash_size;w=b.head[--q],b.head[q]=se<=w?w-se:0,--M;);for(q=M=se;w=b.prev[--q],b.prev[q]=se<=w?w-se:0,--M;);S+=se}if(b.strm.avail_in===0)break;if(K=b.strm,$=b.window,Z=b.strstart+b.lookahead,oe=S,ce=void 0,ce=K.avail_in,oe=_)for(E=b.strstart-b.insert,b.ins_h=b.window[E],b.ins_h=(b.ins_h<=_&&(b.ins_h=(b.ins_h<=_)if(w=s._tr_tally(b,b.strstart-b.match_start,b.match_length-_),b.lookahead-=b.match_length,b.match_length<=b.max_lazy_match&&b.lookahead>=_){for(b.match_length--;b.strstart++,b.ins_h=(b.ins_h<=_&&(b.ins_h=(b.ins_h<=_&&b.match_length<=b.prev_length){for(S=b.strstart+b.lookahead-_,w=s._tr_tally(b,b.strstart-1-b.prev_match,b.prev_length-_),b.lookahead-=b.prev_length-1,b.prev_length-=2;++b.strstart<=S&&(b.ins_h=(b.ins_h<b.pending_buf_size-5&&(M=b.pending_buf_size-5);;){if(b.lookahead<=1){if(ee(b),b.lookahead===0&&q===h)return y;if(b.lookahead===0)break}b.strstart+=b.lookahead,b.lookahead=0;var w=b.block_start+M;if((b.strstart===0||b.strstart>=w)&&(b.lookahead=b.strstart-w,b.strstart=w,N(b,!1),b.strm.avail_out===0)||b.strstart-b.block_start>=b.w_size-te&&(N(b,!1),b.strm.avail_out===0))return y}return b.insert=0,q===d?(N(b,!0),b.strm.avail_out===0?k:F):(b.strstart>b.block_start&&(N(b,!1),b.strm.avail_out),y)}),new G(4,4,8,4,X),new G(4,5,16,8,X),new G(4,6,32,32,X),new G(4,4,16,16,C),new G(8,16,32,32,C),new G(8,16,128,128,C),new G(8,32,128,256,C),new G(32,128,258,1024,C),new G(32,258,258,4096,C)],i.deflateInit=function(b,q){return ue(b,q,m,15,8,0)},i.deflateInit2=ue,i.deflateReset=j,i.deflateResetKeep=H,i.deflateSetHeader=function(b,q){return b&&b.state?b.state.wrap!==2?p:(b.state.gzhead=q,f):p},i.deflate=function(b,q){var M,w,S,E;if(!b||!b.state||5>8&255),J(w,w.gzhead.time>>16&255),J(w,w.gzhead.time>>24&255),J(w,w.level===9?2:2<=w.strategy||w.level<2?4:0),J(w,255&w.gzhead.os),w.gzhead.extra&&w.gzhead.extra.length&&(J(w,255&w.gzhead.extra.length),J(w,w.gzhead.extra.length>>8&255)),w.gzhead.hcrc&&(b.adler=c(b.adler,w.pending_buf,w.pending,0)),w.gzindex=0,w.status=69):(J(w,0),J(w,0),J(w,0),J(w,0),J(w,0),J(w,w.level===9?2:2<=w.strategy||w.level<2?4:0),J(w,3),w.status=I);else{var K=m+(w.w_bits-8<<4)<<8;K|=(2<=w.strategy||w.level<2?0:w.level<6?1:w.level===6?2:3)<<6,w.strstart!==0&&(K|=32),K+=31-K%31,w.status=I,B(w,K),w.strstart!==0&&(B(w,b.adler>>>16),B(w,65535&b.adler)),b.adler=1}if(w.status===69)if(w.gzhead.extra){for(S=w.pending;w.gzindex<(65535&w.gzhead.extra.length)&&(w.pending!==w.pending_buf_size||(w.gzhead.hcrc&&w.pending>S&&(b.adler=c(b.adler,w.pending_buf,w.pending-S,S)),U(b),S=w.pending,w.pending!==w.pending_buf_size));)J(w,255&w.gzhead.extra[w.gzindex]),w.gzindex++;w.gzhead.hcrc&&w.pending>S&&(b.adler=c(b.adler,w.pending_buf,w.pending-S,S)),w.gzindex===w.gzhead.extra.length&&(w.gzindex=0,w.status=73)}else w.status=73;if(w.status===73)if(w.gzhead.name){S=w.pending;do{if(w.pending===w.pending_buf_size&&(w.gzhead.hcrc&&w.pending>S&&(b.adler=c(b.adler,w.pending_buf,w.pending-S,S)),U(b),S=w.pending,w.pending===w.pending_buf_size)){E=1;break}E=w.gzindexS&&(b.adler=c(b.adler,w.pending_buf,w.pending-S,S)),E===0&&(w.gzindex=0,w.status=91)}else w.status=91;if(w.status===91)if(w.gzhead.comment){S=w.pending;do{if(w.pending===w.pending_buf_size&&(w.gzhead.hcrc&&w.pending>S&&(b.adler=c(b.adler,w.pending_buf,w.pending-S,S)),U(b),S=w.pending,w.pending===w.pending_buf_size)){E=1;break}E=w.gzindexS&&(b.adler=c(b.adler,w.pending_buf,w.pending-S,S)),E===0&&(w.status=103)}else w.status=103;if(w.status===103&&(w.gzhead.hcrc?(w.pending+2>w.pending_buf_size&&U(b),w.pending+2<=w.pending_buf_size&&(J(w,255&b.adler),J(w,b.adler>>8&255),b.adler=0,w.status=I)):w.status=I),w.pending!==0){if(U(b),b.avail_out===0)return w.last_flush=-1,f}else if(b.avail_in===0&&V(q)<=V(M)&&q!==d)return Y(b,-5);if(w.status===666&&b.avail_in!==0)return Y(b,-5);if(b.avail_in!==0||w.lookahead!==0||q!==h&&w.status!==666){var $=w.strategy===2?function(Z,oe){for(var ce;;){if(Z.lookahead===0&&(ee(Z),Z.lookahead===0)){if(oe===h)return y;break}if(Z.match_length=0,ce=s._tr_tally(Z,0,Z.window[Z.strstart]),Z.lookahead--,Z.strstart++,ce&&(N(Z,!1),Z.strm.avail_out===0))return y}return Z.insert=0,oe===d?(N(Z,!0),Z.strm.avail_out===0?k:F):Z.last_lit&&(N(Z,!1),Z.strm.avail_out===0)?y:L}(w,q):w.strategy===3?function(Z,oe){for(var ce,se,ge,Oe,Te=Z.window;;){if(Z.lookahead<=Q){if(ee(Z),Z.lookahead<=Q&&oe===h)return y;if(Z.lookahead===0)break}if(Z.match_length=0,Z.lookahead>=_&&0Z.lookahead&&(Z.match_length=Z.lookahead)}if(Z.match_length>=_?(ce=s._tr_tally(Z,1,Z.match_length-_),Z.lookahead-=Z.match_length,Z.strstart+=Z.match_length,Z.match_length=0):(ce=s._tr_tally(Z,0,Z.window[Z.strstart]),Z.lookahead--,Z.strstart++),ce&&(N(Z,!1),Z.strm.avail_out===0))return y}return Z.insert=0,oe===d?(N(Z,!0),Z.strm.avail_out===0?k:F):Z.last_lit&&(N(Z,!1),Z.strm.avail_out===0)?y:L}(w,q):o[w.level].func(w,q);if($!==k&&$!==F||(w.status=666),$===y||$===k)return b.avail_out===0&&(w.last_flush=-1),f;if($===L&&(q===1?s._tr_align(w):q!==5&&(s._tr_stored_block(w,0,0,!1),q===3&&(ie(w.head),w.lookahead===0&&(w.strstart=0,w.block_start=0,w.insert=0))),U(b),b.avail_out===0))return w.last_flush=-1,f}return q!==d?f:w.wrap<=0?1:(w.wrap===2?(J(w,255&b.adler),J(w,b.adler>>8&255),J(w,b.adler>>16&255),J(w,b.adler>>24&255),J(w,255&b.total_in),J(w,b.total_in>>8&255),J(w,b.total_in>>16&255),J(w,b.total_in>>24&255)):(B(w,b.adler>>>16),B(w,65535&b.adler)),U(b),0=M.w_size&&(E===0&&(ie(M.head),M.strstart=0,M.block_start=0,M.insert=0),oe=new a.Buf8(M.w_size),a.arraySet(oe,q,ce-M.w_size,M.w_size,0),q=oe,ce=M.w_size),K=b.avail_in,$=b.next_in,Z=b.input,b.avail_in=ce,b.next_in=0,b.input=q,ee(M);M.lookahead>=_;){for(w=M.strstart,S=M.lookahead-(_-1);M.ins_h=(M.ins_h<>>=_=W>>>24,x-=_,(_=W>>>16&255)===0)L[u++]=65535&W;else{if(!(16&_)){if((64&_)==0){W=T[(65535&W)+(m&(1<<_)-1)];continue t}if(32&_){s.mode=12;break e}o.msg="invalid literal/length code",s.mode=30;break e}Q=65535&W,(_&=15)&&(x<_&&(m+=y[l++]<>>=_,x-=_),x<15&&(m+=y[l++]<>>=_=W>>>24,x-=_,!(16&(_=W>>>16&255))){if((64&_)==0){W=P[(65535&W)+(m&(1<<_)-1)];continue r}o.msg="invalid distance code",s.mode=30;break e}if(te=65535&W,x<(_&=15)&&(m+=y[l++]<>>=_,x-=_,(_=u-h)>3,m&=(1<<(x-=Q<<3))-1,o.next_in=l,o.next_out=u,o.avail_in=l>>24&255)+(O>>>8&65280)+((65280&O)<<8)+((255&O)<<24)}function m(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new o.Buf16(320),this.work=new o.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function x(O){var I;return O&&O.state?(I=O.state,O.total_in=O.total_out=I.total=0,O.msg="",I.wrap&&(O.adler=1&I.wrap),I.mode=p,I.last=0,I.havedict=0,I.dmax=32768,I.head=null,I.hold=0,I.bits=0,I.lencode=I.lendyn=new o.Buf32(g),I.distcode=I.distdyn=new o.Buf32(v),I.sane=1,I.back=-1,d):f}function T(O){var I;return O&&O.state?((I=O.state).wsize=0,I.whave=0,I.wnext=0,x(O)):f}function P(O,I){var y,L;return O&&O.state?(L=O.state,I<0?(y=0,I=-I):(y=1+(I>>4),I<48&&(I&=15)),I&&(I<8||15=F.wsize?(o.arraySet(F.window,I,y-F.wsize,F.wsize,0),F.wnext=0,F.whave=F.wsize):(L<(k=F.wsize-F.wnext)&&(k=L),o.arraySet(F.window,I,y-L,k,F.wnext),(L-=k)?(o.arraySet(F.window,I,y-L,L,0),F.wnext=L,F.whave=F.wsize):(F.wnext+=k,F.wnext===F.wsize&&(F.wnext=0),F.whave>>8&255,y.check=s(y.check,E,2,0),N=U=0,y.mode=2;break}if(y.flags=0,y.head&&(y.head.done=!1),!(1&y.wrap)||(((255&U)<<8)+(U>>8))%31){O.msg="incorrect header check",y.mode=30;break}if((15&U)!=8){O.msg="unknown compression method",y.mode=30;break}if(N-=4,b=8+(15&(U>>>=4)),y.wbits===0)y.wbits=b;else if(b>y.wbits){O.msg="invalid window size",y.mode=30;break}y.dmax=1<>8&1),512&y.flags&&(E[0]=255&U,E[1]=U>>>8&255,y.check=s(y.check,E,2,0)),N=U=0,y.mode=3;case 3:for(;N<32;){if(V===0)break e;V--,U+=L[F++]<>>8&255,E[2]=U>>>16&255,E[3]=U>>>24&255,y.check=s(y.check,E,4,0)),N=U=0,y.mode=4;case 4:for(;N<16;){if(V===0)break e;V--,U+=L[F++]<>8),512&y.flags&&(E[0]=255&U,E[1]=U>>>8&255,y.check=s(y.check,E,2,0)),N=U=0,y.mode=5;case 5:if(1024&y.flags){for(;N<16;){if(V===0)break e;V--,U+=L[F++]<>>8&255,y.check=s(y.check,E,2,0)),N=U=0}else y.head&&(y.head.extra=null);y.mode=6;case 6:if(1024&y.flags&&(V<(re=y.length)&&(re=V),re&&(y.head&&(b=y.head.extra_len-y.length,y.head.extra||(y.head.extra=new Array(y.head.extra_len)),o.arraySet(y.head.extra,L,F,re,b)),512&y.flags&&(y.check=s(y.check,L,re,F)),V-=re,F+=re,y.length-=re),y.length))break e;y.length=0,y.mode=7;case 7:if(2048&y.flags){if(V===0)break e;for(re=0;b=L[F+re++],y.head&&b&&y.length<65536&&(y.head.name+=String.fromCharCode(b)),b&&re>9&1,y.head.done=!0),O.adler=y.check=0,y.mode=12;break;case 10:for(;N<32;){if(V===0)break e;V--,U+=L[F++]<>>=7&N,N-=7&N,y.mode=27;break}for(;N<3;){if(V===0)break e;V--,U+=L[F++]<>>=1)){case 0:y.mode=14;break;case 1:if(Q(y),y.mode=20,I!==6)break;U>>>=2,N-=2;break e;case 2:y.mode=17;break;case 3:O.msg="invalid block type",y.mode=30}U>>>=2,N-=2;break;case 14:for(U>>>=7&N,N-=7&N;N<32;){if(V===0)break e;V--,U+=L[F++]<>>16^65535)){O.msg="invalid stored block lengths",y.mode=30;break}if(y.length=65535&U,N=U=0,y.mode=15,I===6)break e;case 15:y.mode=16;case 16:if(re=y.length){if(V>>=5,N-=5,y.ndist=1+(31&U),U>>>=5,N-=5,y.ncode=4+(15&U),U>>>=4,N-=4,286>>=3,N-=3}for(;y.have<19;)y.lens[K[y.have++]]=0;if(y.lencode=y.lendyn,y.lenbits=7,M={bits:y.lenbits},q=c(0,y.lens,0,19,y.lencode,0,y.work,M),y.lenbits=M.bits,q){O.msg="invalid code lengths set",y.mode=30;break}y.have=0,y.mode=19;case 19:for(;y.have>>16&255,z=65535&S,!((C=S>>>24)<=N);){if(V===0)break e;V--,U+=L[F++]<>>=C,N-=C,y.lens[y.have++]=z;else{if(z===16){for(w=C+2;N>>=C,N-=C,y.have===0){O.msg="invalid bit length repeat",y.mode=30;break}b=y.lens[y.have-1],re=3+(3&U),U>>>=2,N-=2}else if(z===17){for(w=C+3;N>>=C)),U>>>=3,N-=3}else{for(w=C+7;N>>=C)),U>>>=7,N-=7}if(y.have+re>y.nlen+y.ndist){O.msg="invalid bit length repeat",y.mode=30;break}for(;re--;)y.lens[y.have++]=b}}if(y.mode===30)break;if(y.lens[256]===0){O.msg="invalid code -- missing end-of-block",y.mode=30;break}if(y.lenbits=9,M={bits:y.lenbits},q=c(u,y.lens,0,y.nlen,y.lencode,0,y.work,M),y.lenbits=M.bits,q){O.msg="invalid literal/lengths set",y.mode=30;break}if(y.distbits=6,y.distcode=y.distdyn,M={bits:y.distbits},q=c(h,y.lens,y.nlen,y.ndist,y.distcode,0,y.work,M),y.distbits=M.bits,q){O.msg="invalid distances set",y.mode=30;break}if(y.mode=20,I===6)break e;case 20:y.mode=21;case 21:if(6<=V&&258<=ie){O.next_out=Y,O.avail_out=ie,O.next_in=F,O.avail_in=V,y.hold=U,y.bits=N,l(O,B),Y=O.next_out,k=O.output,ie=O.avail_out,F=O.next_in,L=O.input,V=O.avail_in,U=y.hold,N=y.bits,y.mode===12&&(y.back=-1);break}for(y.back=0;G=(S=y.lencode[U&(1<>>16&255,z=65535&S,!((C=S>>>24)<=N);){if(V===0)break e;V--,U+=L[F++]<>H)])>>>16&255,z=65535&S,!(H+(C=S>>>24)<=N);){if(V===0)break e;V--,U+=L[F++]<>>=H,N-=H,y.back+=H}if(U>>>=C,N-=C,y.back+=C,y.length=z,G===0){y.mode=26;break}if(32&G){y.back=-1,y.mode=12;break}if(64&G){O.msg="invalid literal/length code",y.mode=30;break}y.extra=15&G,y.mode=22;case 22:if(y.extra){for(w=y.extra;N>>=y.extra,N-=y.extra,y.back+=y.extra}y.was=y.length,y.mode=23;case 23:for(;G=(S=y.distcode[U&(1<>>16&255,z=65535&S,!((C=S>>>24)<=N);){if(V===0)break e;V--,U+=L[F++]<>H)])>>>16&255,z=65535&S,!(H+(C=S>>>24)<=N);){if(V===0)break e;V--,U+=L[F++]<>>=H,N-=H,y.back+=H}if(U>>>=C,N-=C,y.back+=C,64&G){O.msg="invalid distance code",y.mode=30;break}y.offset=z,y.extra=15&G,y.mode=24;case 24:if(y.extra){for(w=y.extra;N>>=y.extra,N-=y.extra,y.back+=y.extra}if(y.offset>y.dmax){O.msg="invalid distance too far back",y.mode=30;break}y.mode=25;case 25:if(ie===0)break e;if(re=B-ie,y.offset>re){if((re=y.offset-re)>y.whave&&y.sane){O.msg="invalid distance too far back",y.mode=30;break}ee=re>y.wnext?(re-=y.wnext,y.wsize-re):y.wnext-re,re>y.length&&(re=y.length),X=y.window}else X=k,ee=Y-y.offset,re=y.length;for(ieD?(_=ee[X+v[I]],N[J+v[I]]):(_=96,0),m=1<>Y)+(x-=m)]=W<<24|_<<16|Q|0,x!==0;);for(m=1<>=1;if(m!==0?(U&=m-1,U+=m):U=0,I++,--B[O]==0){if(O===L)break;O=h[d+v[I]]}if(k>>7)]}function J(S,E){S.pending_buf[S.pending++]=255&E,S.pending_buf[S.pending++]=E>>>8&255}function B(S,E,K){S.bi_valid>R-K?(S.bi_buf|=E<>R-S.bi_valid,S.bi_valid+=K-R):(S.bi_buf|=E<>>=1,K<<=1,0<--E;);return K>>>1}function X(S,E,K){var $,Z,oe=new Array(v+1),ce=0;for($=1;$<=v;$++)oe[$]=ce=ce+K[$-1]<<1;for(Z=0;Z<=E;Z++){var se=S[2*Z+1];se!==0&&(S[2*Z]=ee(oe[se]++,se))}}function C(S){var E;for(E=0;E>1;1<=K;K--)H(S,oe,K);for(Z=ge;K=S.heap[1],S.heap[1]=S.heap[S.heap_len--],H(S,oe,1),$=S.heap[1],S.heap[--S.heap_max]=K,S.heap[--S.heap_max]=$,oe[2*Z]=oe[2*K]+oe[2*$],S.depth[Z]=(S.depth[K]>=S.depth[$]?S.depth[K]:S.depth[$])+1,oe[2*K+1]=oe[2*$+1]=Z,S.heap[1]=Z++,H(S,oe,1),2<=S.heap_len;);S.heap[--S.heap_max]=S.heap[1],function(Te,Ye){var Vt,lt,ft,Ue,_t,Jt,Tt=Ye.dyn_tree,Cr=Ye.max_code,Jr=Ye.stat_desc.static_tree,lr=Ye.stat_desc.has_stree,zr=Ye.stat_desc.extra_bits,Ar=Ye.stat_desc.extra_base,er=Ye.stat_desc.max_length,cr=0;for(Ue=0;Ue<=v;Ue++)Te.bl_count[Ue]=0;for(Tt[2*Te.heap[Te.heap_max]+1]=0,Vt=Te.heap_max+1;Vt>=7;Z>>=1)if(1&Oe&&se.dyn_ltree[2*ge]!==0)return a;if(se.dyn_ltree[18]!==0||se.dyn_ltree[20]!==0||se.dyn_ltree[26]!==0)return s;for(ge=32;ge>>3,(oe=S.static_len+3+7>>>3)<=Z&&(Z=oe)):Z=oe=K+5,K+4<=Z&&E!==-1?w(S,E,K,$):S.strategy===4||oe===Z?(B(S,2+($?1:0),3),j(S,te,O)):(B(S,4+($?1:0),3),function(se,ge,Oe,Te){var Ye;for(B(se,ge-257,5),B(se,Oe-1,5),B(se,Te-4,4),Ye=0;Ye>>8&255,S.pending_buf[S.d_buf+2*S.last_lit+1]=255&E,S.pending_buf[S.l_buf+S.last_lit]=255&K,S.last_lit++,E===0?S.dyn_ltree[2*K]++:(S.matches++,E--,S.dyn_ltree[2*(y[K]+h+1)]++,S.dyn_dtree[2*N(E)]++),S.last_lit===S.lit_bufsize-1},i._tr_align=function(S){B(S,2,3),re(S,x,te),function(E){E.bi_valid===16?(J(E,E.bi_buf),E.bi_buf=0,E.bi_valid=0):8<=E.bi_valid&&(E.pending_buf[E.pending++]=255&E.bi_buf,E.bi_buf>>=8,E.bi_valid-=8)}(S)}},{"../utils/common":41}],53:[function(t,n,i){n.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,n,i){(function(o){(function(a,s){if(!a.setImmediate){var l,c,u,h,d=1,f={},p=!1,g=a.document,v=Object.getPrototypeOf&&Object.getPrototypeOf(a);v=v&&v.setTimeout?v:a,l={}.toString.call(a.process)==="[object process]"?function(T){process.nextTick(function(){m(T)})}:function(){if(a.postMessage&&!a.importScripts){var T=!0,P=a.onmessage;return a.onmessage=function(){T=!1},a.postMessage("","*"),a.onmessage=P,T}}()?(h="setImmediate$"+Math.random()+"$",a.addEventListener?a.addEventListener("message",x,!1):a.attachEvent("onmessage",x),function(T){a.postMessage(h+T,"*")}):a.MessageChannel?((u=new MessageChannel).port1.onmessage=function(T){m(T.data)},function(T){u.port2.postMessage(T)}):g&&"onreadystatechange"in g.createElement("script")?(c=g.documentElement,function(T){var P=g.createElement("script");P.onreadystatechange=function(){m(T),P.onreadystatechange=null,c.removeChild(P),P=null},c.appendChild(P)}):function(T){setTimeout(m,0,T)},v.setImmediate=function(T){typeof T!="function"&&(T=new Function(""+T));for(var P=new Array(arguments.length-1),A=0;A({id:e.attr(t,"Id"),type:e.attr(t,"Type"),target:e.attr(t,"Target"),targetMode:e.attr(t,"TargetMode")}))}const Ep={wordml:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",drawingml:"http://schemas.openxmlformats.org/drawingml/2006/main",picture:"http://schemas.openxmlformats.org/drawingml/2006/picture",compatibility:"http://schemas.openxmlformats.org/markup-compatibility/2006",math:"http://schemas.openxmlformats.org/officeDocument/2006/math"},Dt={Dxa:{mul:.05,unit:"pt"},Emu:{mul:1/12700,unit:"pt"},FontSize:{mul:.5,unit:"pt"},Border:{mul:.125,unit:"pt"},Point:{mul:1,unit:"pt"},Percent:{mul:.02,unit:"%"},LineHeight:{mul:1/240,unit:""},VmlEmu:{mul:1/12700,unit:""}};function _p(r,e=Dt.Dxa){return r==null||/.+(p[xt]|[%])$/.test(r)?r:`${(parseInt(r)*e.mul).toFixed(2)}${e.unit}`}function g2(r,e=!1){switch(r){case"1":return!0;case"0":return!1;case"on":return!0;case"off":return!1;case"true":return!0;case"false":return!1;default:return e}}function Ip(r,e,t){if(r.namespaceURI!=Ep.wordml)return!1;switch(r.localName){case"color":e.color=t.attr(r,"val");break;case"sz":e.fontSize=t.lengthAttr(r,"val",Dt.FontSize);break;default:return!1}return!0}function R2(r,e=!1){e&&(r=r.replace(/<[?].*[?]>/,"")),r=v2(r);const t=new DOMParser().parseFromString(r,"application/xml"),n=m2(t);if(n)throw new Error(n);return t}function m2(r){var e;return(e=r.getElementsByTagName("parsererror")[0])==null?void 0:e.textContent}function v2(r){return r.charCodeAt(0)===65279?r.substring(1):r}function y2(r){return new XMLSerializer().serializeToString(r)}class Np{elements(e,t=null){const n=[];for(let i=0,o=e.childNodes.length;ix2(t,e))}function x2(r,e){let t={name:e.attr(r,"name"),embedFontRefs:[]};for(let n of e.elements(r))switch(n.localName){case"family":t.family=e.attr(n,"val");break;case"altName":t.altName=e.attr(n,"val");break;case"embedRegular":case"embedBold":case"embedItalic":case"embedBoldItalic":t.embedFontRefs.push(b2(n,e));break}return t}function b2(r,e){return{id:e.attr(r,"id"),key:e.attr(r,"fontKey"),type:w2[r.localName]}}class O2 extends Fr{parseXml(e){this.fonts=S2(e,this._package.xmlParser)}}function T2(r){return r==null?void 0:r.replace(/[ .]+/g,"-").replace(/[&]+/g,"and").toLowerCase()}function Oa(r){let e=r.lastIndexOf("/")+1,t=e==0?"":r.substring(0,e),n=e==0?r:r.substring(e);return[t,n]}function Rl(r,e){try{const t="http://docx/";return new URL(r,t+e).toString().substring(t.length)}catch{return`${e}${r}`}}function In(r,e){return r.reduce((t,n)=>(t[e(n)]=n,t),{})}function P2(r){return new Promise((e,t)=>{const n=new FileReader;n.onloadend=()=>e(n.result),n.onerror=()=>t(),n.readAsDataURL(r)})}function ml(r){return r&&typeof r=="object"&&!Array.isArray(r)}function E2(r){return typeof r=="string"||r instanceof String}function Ya(r,...e){var n;if(!e.length)return r;const t=e.shift();if(ml(r)&&ml(t))for(const i in t)if(ml(t[i])){const o=(n=r[i])!=null?n:r[i]={};Ya(o,t[i])}else r[i]=t[i];return Ya(r,...e)}function so(r){return Array.isArray(r)?r:[r]}class Zc{constructor(e,t){this._zip=e,this.options=t,this.xmlParser=new Np}get(e){var n;const t=_2(e);return(n=this._zip.files[t])!=null?n:this._zip.files[t.replace(/\//g,"\\")]}update(e,t){this._zip.file(e,t)}static async load(e,t){const n=await d2.loadAsync(e);return new Zc(n,t)}save(e="blob"){return this._zip.generateAsync({type:e})}load(e,t="string"){var n,i;return(i=(n=this.get(e))==null?void 0:n.async(t))!=null?i:Promise.resolve(null)}async loadRelationships(e=null){let t="_rels/.rels";if(e!=null){const[i,o]=Oa(e);t=`${i}_rels/${o}.rels`}const n=await this.load(t);return n?p2(this.parseXmlDocument(n).firstElementChild,this.xmlParser):null}parseXmlDocument(e){return R2(e,this.options.trimXmlDeclaration)}}function _2(r){return r.startsWith("/")?r.substr(1):r}class I2 extends Fr{constructor(e,t,n){super(e,t),this._documentParser=n}parseXml(e){this.body=this._documentParser.parseDocumentFile(e)}}function ca(r,e){return{type:e.attr(r,"val"),color:e.attr(r,"color"),size:e.lengthAttr(r,"sz",Dt.Border),offset:e.lengthAttr(r,"space",Dt.Point),frame:e.boolAttr(r,"frame"),shadow:e.boolAttr(r,"shadow")}}function N2(r,e){var t={};for(let n of e.elements(r))switch(n.localName){case"left":t.left=ca(n,e);break;case"top":t.top=ca(n,e);break;case"right":t.right=ca(n,e);break;case"bottom":t.bottom=ca(n,e);break}return t}var wf;(function(r){r.Continuous="continuous",r.NextPage="nextPage",r.NextColumn="nextColumn",r.EvenPage="evenPage",r.OddPage="oddPage"})(wf||(wf={}));function Mp(r,e=he){var n,i;var t={};for(let o of e.elements(r))switch(o.localName){case"pgSz":t.pageSize={width:e.lengthAttr(o,"w"),height:e.lengthAttr(o,"h"),orientation:e.attr(o,"orient")};break;case"type":t.type=e.attr(o,"val");break;case"pgMar":t.pageMargins={left:e.lengthAttr(o,"left"),right:e.lengthAttr(o,"right"),top:e.lengthAttr(o,"top"),bottom:e.lengthAttr(o,"bottom"),header:e.lengthAttr(o,"header"),footer:e.lengthAttr(o,"footer"),gutter:e.lengthAttr(o,"gutter")};break;case"cols":t.columns=M2(o,e);break;case"headerReference":((n=t.headerRefs)!=null?n:t.headerRefs=[]).push(Sf(o,e));break;case"footerReference":((i=t.footerRefs)!=null?i:t.footerRefs=[]).push(Sf(o,e));break;case"titlePg":t.titlePage=e.boolAttr(o,"val",!0);break;case"pgBorders":t.pageBorders=N2(o,e);break;case"pgNumType":t.pageNumber=L2(o,e);break}return t}function M2(r,e){return{numberOfColumns:e.intAttr(r,"num"),space:e.lengthAttr(r,"space"),separator:e.boolAttr(r,"sep"),equalWidth:e.boolAttr(r,"equalWidth",!0),columns:e.elements(r,"col").map(t=>({width:e.lengthAttr(t,"w"),space:e.lengthAttr(t,"space")}))}}function L2(r,e){return{chapSep:e.attr(r,"chapSep"),chapStyle:e.attr(r,"chapStyle"),format:e.attr(r,"fmt"),start:e.intAttr(r,"start")}}function Sf(r,e){return{id:e.attr(r,"id"),type:e.attr(r,"type")}}function F2(r,e){return{before:e.lengthAttr(r,"before"),after:e.lengthAttr(r,"after"),line:e.intAttr(r,"line"),lineRule:e.attr(r,"lineRule")}}function Qc(r,e){let t={};for(let n of e.elements(r))C2(n,t,e);return t}function C2(r,e,t){return!!Ip(r,e,t)}function Lp(r,e){let t={};for(let n of e.elements(r))Fp(n,t,e);return t}function Fp(r,e,t){if(r.namespaceURI!=Ep.wordml)return!1;if(Ip(r,e,t))return!0;switch(r.localName){case"tabs":e.tabs=A2(r,t);break;case"sectPr":e.sectionProps=Mp(r,t);break;case"numPr":e.numbering=D2(r,t);break;case"spacing":return e.lineSpacing=F2(r,t),!1;case"textAlignment":return e.textAlignment=t.attr(r,"val"),!1;case"keepLines":e.keepLines=t.boolAttr(r,"val",!0);break;case"keepNext":e.keepNext=t.boolAttr(r,"val",!0);break;case"pageBreakBefore":e.pageBreakBefore=t.boolAttr(r,"val",!0);break;case"outlineLvl":e.outlineLevel=t.intAttr(r,"val");break;case"pStyle":e.styleName=t.attr(r,"val");break;case"rPr":e.runProps=Qc(r,t);break;default:return!1}return!0}function A2(r,e){return e.elements(r,"tab").map(t=>({position:e.lengthAttr(t,"pos"),leader:e.attr(t,"leader"),style:e.attr(t,"val")}))}function D2(r,e){var t={};for(let n of e.elements(r))switch(n.localName){case"numId":t.id=e.attr(n,"val");break;case"ilvl":t.level=e.intAttr(n,"val");break}return t}function X2(r,e){let t={numberings:[],abstractNumberings:[],bulletPictures:[]};for(let n of e.elements(r))switch(n.localName){case"num":t.numberings.push(U2(n,e));break;case"abstractNum":t.abstractNumberings.push(W2(n,e));break;case"numPicBullet":t.bulletPictures.push(Y2(n,e));break}return t}function U2(r,e){let t={id:e.attr(r,"numId"),overrides:[]};for(let n of e.elements(r))switch(n.localName){case"abstractNumId":t.abstractId=e.attr(n,"val");break;case"lvlOverride":t.overrides.push(V2(n,e));break}return t}function W2(r,e){let t={id:e.attr(r,"abstractNumId"),levels:[]};for(let n of e.elements(r))switch(n.localName){case"name":t.name=e.attr(n,"val");break;case"multiLevelType":t.multiLevelType=e.attr(n,"val");break;case"numStyleLink":t.numberingStyleLink=e.attr(n,"val");break;case"styleLink":t.styleLink=e.attr(n,"val");break;case"lvl":t.levels.push(Cp(n,e));break}return t}function Cp(r,e){let t={level:e.intAttr(r,"ilvl")};for(let n of e.elements(r))switch(n.localName){case"start":t.start=e.attr(n,"val");break;case"lvlRestart":t.restart=e.intAttr(n,"val");break;case"numFmt":t.format=e.attr(n,"val");break;case"lvlText":t.text=e.attr(n,"val");break;case"lvlJc":t.justification=e.attr(n,"val");break;case"lvlPicBulletId":t.bulletPictureId=e.attr(n,"val");break;case"pStyle":t.paragraphStyle=e.attr(n,"val");break;case"pPr":t.paragraphProps=Lp(n,e);break;case"rPr":t.runProps=Qc(n,e);break}return t}function V2(r,e){let t={level:e.intAttr(r,"ilvl")};for(let n of e.elements(r))switch(n.localName){case"startOverride":t.start=e.intAttr(n,"val");break;case"lvl":t.numberingLevel=Cp(n,e);break}return t}function Y2(r,e){var t=e.element(r,"pict"),n=t&&e.element(t,"shape"),i=n&&e.element(n,"imagedata");return i?{id:e.attr(r,"numPicBulletId"),referenceId:e.attr(i,"id"),style:e.attr(n,"style")}:null}class k2 extends Fr{constructor(e,t,n){super(e,t),this._documentParser=n}parseXml(e){Object.assign(this,X2(e,this._package.xmlParser)),this.domNumberings=this._documentParser.parseNumberingFile(e)}}class Z2 extends Fr{constructor(e,t,n){super(e,t),this._documentParser=n}parseXml(e){this.styles=this._documentParser.parseStylesFile(e)}}var Re;(function(r){r.Document="document",r.Paragraph="paragraph",r.Run="run",r.Break="break",r.NoBreakHyphen="noBreakHyphen",r.Table="table",r.Row="row",r.Cell="cell",r.Hyperlink="hyperlink",r.SmartTag="smartTag",r.Drawing="drawing",r.Image="image",r.Text="text",r.Tab="tab",r.Symbol="symbol",r.BookmarkStart="bookmarkStart",r.BookmarkEnd="bookmarkEnd",r.Footer="footer",r.Header="header",r.FootnoteReference="footnoteReference",r.EndnoteReference="endnoteReference",r.Footnote="footnote",r.Endnote="endnote",r.SimpleField="simpleField",r.ComplexField="complexField",r.Instruction="instruction",r.VmlPicture="vmlPicture",r.MmlMath="mmlMath",r.MmlMathParagraph="mmlMathParagraph",r.MmlFraction="mmlFraction",r.MmlFunction="mmlFunction",r.MmlFunctionName="mmlFunctionName",r.MmlNumerator="mmlNumerator",r.MmlDenominator="mmlDenominator",r.MmlRadical="mmlRadical",r.MmlBase="mmlBase",r.MmlDegree="mmlDegree",r.MmlSuperscript="mmlSuperscript",r.MmlSubscript="mmlSubscript",r.MmlPreSubSuper="mmlPreSubSuper",r.MmlSubArgument="mmlSubArgument",r.MmlSuperArgument="mmlSuperArgument",r.MmlNary="mmlNary",r.MmlDelimiter="mmlDelimiter",r.MmlRun="mmlRun",r.MmlEquationArray="mmlEquationArray",r.MmlLimit="mmlLimit",r.MmlLimitLower="mmlLimitLower",r.MmlMatrix="mmlMatrix",r.MmlMatrixRow="mmlMatrixRow",r.MmlBox="mmlBox",r.MmlBar="mmlBar",r.MmlGroupChar="mmlGroupChar",r.VmlElement="vmlElement",r.Inserted="inserted",r.Deleted="deleted",r.DeletedText="deletedText",r.Comment="comment",r.CommentReference="commentReference",r.CommentRangeStart="commentRangeStart",r.CommentRangeEnd="commentRangeEnd"})(Re||(Re={}));class oi{constructor(){this.children=[],this.cssStyle={}}}class Q2 extends oi{constructor(){super(...arguments),this.type=Re.Header}}class K2 extends oi{constructor(){super(...arguments),this.type=Re.Footer}}class Ap extends Fr{constructor(e,t,n){super(e,t),this._documentParser=n}parseXml(e){this.rootElement=this.createRootElement(),this.rootElement.children=this._documentParser.parseBodyElements(e)}}class H2 extends Ap{createRootElement(){return new Q2}}class B2 extends Ap{createRootElement(){return new K2}}function G2(r,e){const t={};for(let n of e.elements(r))switch(n.localName){case"Template":t.template=n.textContent;break;case"Pages":t.pages=lo(n.textContent);break;case"Words":t.words=lo(n.textContent);break;case"Characters":t.characters=lo(n.textContent);break;case"Application":t.application=n.textContent;break;case"Lines":t.lines=lo(n.textContent);break;case"Paragraphs":t.paragraphs=lo(n.textContent);break;case"Company":t.company=n.textContent;break;case"AppVersion":t.appVersion=n.textContent;break}return t}function lo(r){if(typeof r!="undefined")return parseInt(r)}class J2 extends Fr{parseXml(e){this.props=G2(e,this._package.xmlParser)}}function z2(r,e){const t={};for(let n of e.elements(r))switch(n.localName){case"title":t.title=n.textContent;break;case"description":t.description=n.textContent;break;case"subject":t.subject=n.textContent;break;case"creator":t.creator=n.textContent;break;case"keywords":t.keywords=n.textContent;break;case"language":t.language=n.textContent;break;case"lastModifiedBy":t.lastModifiedBy=n.textContent;break;case"revision":n.textContent&&(t.revision=parseInt(n.textContent));break}return t}class $2 extends Fr{parseXml(e){this.props=z2(e,this._package.xmlParser)}}class j2{}function q2(r,e){var t=new j2,n=e.element(r,"themeElements");for(let i of e.elements(n))switch(i.localName){case"clrScheme":t.colorScheme=eT(i,e);break;case"fontScheme":t.fontScheme=tT(i,e);break}return t}function eT(r,e){var t={name:e.attr(r,"name"),colors:{}};for(let o of e.elements(r)){var n=e.element(o,"srgbClr"),i=e.element(o,"sysClr");n?t.colors[o.localName]=e.attr(n,"val"):i&&(t.colors[o.localName]=e.attr(i,"lastClr"))}return t}function tT(r,e){var t={name:e.attr(r,"name")};for(let n of e.elements(r))switch(n.localName){case"majorFont":t.majorFont=xf(n,e);break;case"minorFont":t.minorFont=xf(n,e);break}return t}function xf(r,e){return{latinTypeface:e.elementAttr(r,"latin","typeface"),eaTypeface:e.elementAttr(r,"ea","typeface"),csTypeface:e.elementAttr(r,"cs","typeface")}}class rT extends Fr{constructor(e,t){super(e,t)}parseXml(e){this.theme=q2(e,this._package.xmlParser)}}class Dp{}class nT extends Dp{constructor(){super(...arguments),this.type=Re.Footnote}}class iT extends Dp{constructor(){super(...arguments),this.type=Re.Endnote}}class Xp extends Fr{constructor(e,t,n){super(e,t),this._documentParser=n}}class oT extends Xp{constructor(e,t,n){super(e,t,n)}parseXml(e){this.notes=this._documentParser.parseNotes(e,"footnote",nT)}}class aT extends Xp{constructor(e,t,n){super(e,t,n)}parseXml(e){this.notes=this._documentParser.parseNotes(e,"endnote",iT)}}function sT(r,e){var t={};for(let n of e.elements(r))switch(n.localName){case"defaultTabStop":t.defaultTabStop=e.lengthAttr(n,"val");break;case"footnotePr":t.footnoteProps=bf(n,e);break;case"endnotePr":t.endnoteProps=bf(n,e);break;case"autoHyphenation":t.autoHyphenation=e.boolAttr(n,"val");break}return t}function bf(r,e){var t={defaultNoteIds:[]};for(let n of e.elements(r))switch(n.localName){case"numFmt":t.nummeringFormat=e.attr(n,"val");break;case"footnote":case"endnote":t.defaultNoteIds.push(e.attr(n,"id"));break}return t}class lT extends Fr{constructor(e,t){super(e,t)}parseXml(e){this.settings=sT(e,this._package.xmlParser)}}function cT(r,e){return e.elements(r,"property").map(t=>{const n=t.firstChild;return{formatId:e.attr(t,"fmtid"),name:e.attr(t,"name"),type:n.nodeName,value:n.textContent}})}class uT extends Fr{parseXml(e){this.props=cT(e,this._package.xmlParser)}}class hT extends Fr{constructor(e,t,n){super(e,t),this._documentParser=n}parseXml(e){this.comments=this._documentParser.parseComments(e),this.commentMap=In(this.comments,t=>t.id)}}class fT extends Fr{constructor(e,t){super(e,t),this.comments=[]}parseXml(e){const t=this._package.xmlParser;for(let n of t.elements(e,"commentEx"))this.comments.push({paraId:t.attr(n,"paraId"),paraIdParent:t.attr(n,"paraIdParent"),done:t.boolAttr(n,"done")});this.commentMap=In(this.comments,n=>n.paraId)}}const dT=[{type:At.OfficeDocument,target:"word/document.xml"},{type:At.ExtendedProperties,target:"docProps/app.xml"},{type:At.CoreProperties,target:"docProps/core.xml"},{type:At.CustomProperties,target:"docProps/custom.xml"}];class Kc{constructor(){this.parts=[],this.partsMap={}}static async load(e,t,n){var i=new Kc;return i._options=n,i._parser=t,i._package=await Zc.load(e,n),i.rels=await i._package.loadRelationships(),await Promise.all(dT.map(o=>{var s;const a=(s=i.rels.find(l=>l.type===o.type))!=null?s:o;return i.loadRelationshipPart(a.target,a.type)})),i}save(e="blob"){return this._package.save(e)}async loadRelationshipPart(e,t){var i;if(this.partsMap[e])return this.partsMap[e];if(!this._package.get(e))return null;let n=null;switch(t){case At.OfficeDocument:this.documentPart=n=new I2(this._package,e,this._parser);break;case At.FontTable:this.fontTablePart=n=new O2(this._package,e);break;case At.Numbering:this.numberingPart=n=new k2(this._package,e,this._parser);break;case At.Styles:this.stylesPart=n=new Z2(this._package,e,this._parser);break;case At.Theme:this.themePart=n=new rT(this._package,e);break;case At.Footnotes:this.footnotesPart=n=new oT(this._package,e,this._parser);break;case At.Endnotes:this.endnotesPart=n=new aT(this._package,e,this._parser);break;case At.Footer:n=new B2(this._package,e,this._parser);break;case At.Header:n=new H2(this._package,e,this._parser);break;case At.CoreProperties:this.corePropsPart=n=new $2(this._package,e);break;case At.ExtendedProperties:this.extendedPropsPart=n=new J2(this._package,e);break;case At.CustomProperties:n=new uT(this._package,e);break;case At.Settings:this.settingsPart=n=new lT(this._package,e);break;case At.Comments:this.commentsPart=n=new hT(this._package,e,this._parser);break;case At.CommentsExtended:this.commentsExtendedPart=n=new fT(this._package,e);break}if(n==null)return Promise.resolve(null);if(this.partsMap[e]=n,this.parts.push(n),await n.load(),((i=n.rels)==null?void 0:i.length)>0){const[o]=Oa(n.path);await Promise.all(n.rels.map(a=>this.loadRelationshipPart(Rl(a.target,o),a.type)))}return n}async loadDocumentImage(e,t){const n=await this.loadResource(t!=null?t:this.documentPart,e,"blob");return this.blobToURL(n)}async loadNumberingImage(e){const t=await this.loadResource(this.numberingPart,e,"blob");return this.blobToURL(t)}async loadFont(e,t){const n=await this.loadResource(this.fontTablePart,e,"uint8array");return n&&this.blobToURL(new Blob([pT(n,t)]))}blobToURL(e){return e?this._options.useBase64URL?P2(e):URL.createObjectURL(e):null}findPartByRelId(e,t=null){var o;var n=((o=t.rels)!=null?o:this.rels).find(a=>a.id==e);const i=t?Oa(t.path)[0]:"";return n?this.partsMap[Rl(n.target,i)]:null}getPathById(e,t){const n=e.rels.find(o=>o.id==t),[i]=Oa(e.path);return n?Rl(n.target,i):null}loadResource(e,t,n){const i=this.getPathById(e,t);return i?this._package.load(i,n):Promise.resolve(null)}}function pT(r,e){const n=e.replace(/{|}|-/g,""),i=new Array(16);for(let o=0;o<16;o++)i[16-o-1]=parseInt(n.substr(o*2,2),16);for(let o=0;o<32;o++)r[o]=r[o]^i[o%16];return r}function gT(r,e){return{type:Re.BookmarkStart,id:e.attr(r,"id"),name:e.attr(r,"name"),colFirst:e.intAttr(r,"colFirst"),colLast:e.intAttr(r,"colLast")}}function RT(r,e){return{type:Re.BookmarkEnd,id:e.attr(r,"id")}}class mT extends oi{constructor(){super(...arguments),this.type=Re.VmlElement,this.attrs={}}}function Up(r,e){var t=new mT;switch(r.localName){case"rect":t.tagName="rect",Object.assign(t.attrs,{width:"100%",height:"100%"});break;case"oval":t.tagName="ellipse",Object.assign(t.attrs,{cx:"50%",cy:"50%",rx:"50%",ry:"50%"});break;case"line":t.tagName="line";break;case"shape":t.tagName="g";break;case"textbox":t.tagName="foreignObject",Object.assign(t.attrs,{width:"100%",height:"100%"});break;default:return null}for(const n of he.attrs(r))switch(n.localName){case"style":t.cssStyleText=n.value;break;case"fillcolor":t.attrs.fill=n.value;break;case"from":const[i,o]=Of(n.value);Object.assign(t.attrs,{x1:i,y1:o});break;case"to":const[a,s]=Of(n.value);Object.assign(t.attrs,{x2:a,y2:s});break}for(const n of he.elements(r))switch(n.localName){case"stroke":Object.assign(t.attrs,vT(n));break;case"fill":Object.assign(t.attrs,yT());break;case"imagedata":t.tagName="image",Object.assign(t.attrs,{width:"100%",height:"100%"}),t.imageHref={id:he.attr(n,"id"),title:he.attr(n,"title")};break;case"txbxContent":t.children.push(...e.parseBodyElements(n));break;default:const i=Up(n,e);i&&t.children.push(i);break}return t}function vT(r){var e;return{stroke:he.attr(r,"color"),"stroke-width":(e=he.lengthAttr(r,"weight",Dt.Emu))!=null?e:"1px"}}function yT(r){return{}}function Of(r){return r.split(",")}class wT extends oi{constructor(){super(...arguments),this.type=Re.Comment}}class ST extends oi{constructor(e){super(),this.id=e,this.type=Re.CommentReference}}class xT extends oi{constructor(e){super(),this.id=e,this.type=Re.CommentRangeStart}}class bT extends oi{constructor(e){super(),this.id=e,this.type=Re.CommentRangeEnd}}var Ta={shd:"inherit",color:"black",borderColor:"black",highlight:"transparent"};const OT=[],Tf={oMath:Re.MmlMath,oMathPara:Re.MmlMathParagraph,f:Re.MmlFraction,func:Re.MmlFunction,fName:Re.MmlFunctionName,num:Re.MmlNumerator,den:Re.MmlDenominator,rad:Re.MmlRadical,deg:Re.MmlDegree,e:Re.MmlBase,sSup:Re.MmlSuperscript,sSub:Re.MmlSubscript,sPre:Re.MmlPreSubSuper,sup:Re.MmlSuperArgument,sub:Re.MmlSubArgument,d:Re.MmlDelimiter,nary:Re.MmlNary,eqArr:Re.MmlEquationArray,lim:Re.MmlLimit,limLow:Re.MmlLimitLower,m:Re.MmlMatrix,mr:Re.MmlMatrixRow,box:Re.MmlBox,bar:Re.MmlBar,groupChr:Re.MmlGroupChar};class TT{constructor(e){this.options={ignoreWidth:!1,debug:!1,...e}}parseNotes(e,t,n){var i=[];for(let o of he.elements(e,t)){const a=new n;a.id=he.attr(o,"id"),a.noteType=he.attr(o,"type"),a.children=this.parseBodyElements(o),i.push(a)}return i}parseComments(e){var t=[];for(let n of he.elements(e,"comment")){const i=new wT;i.id=he.attr(n,"id"),i.author=he.attr(n,"author"),i.initials=he.attr(n,"initials"),i.date=he.attr(n,"date"),i.children=this.parseBodyElements(n),t.push(i)}return t}parseDocumentFile(e){var t=he.element(e,"body"),n=he.element(e,"background"),i=he.element(t,"sectPr");return{type:Re.Document,children:this.parseBodyElements(t),props:i?Mp(i,he):{},cssStyle:n?this.parseBackground(n):{}}}parseBackground(e){var t={},n=Et.colorAttr(e,"color");return n&&(t["background-color"]=n),t}parseBodyElements(e){var t=[];for(let n of he.elements(e))switch(n.localName){case"p":t.push(this.parseParagraph(n));break;case"tbl":t.push(this.parseTable(n));break;case"sdt":t.push(...this.parseSdt(n,i=>this.parseBodyElements(i)));break}return t}parseStylesFile(e){var t=[];return Et.foreach(e,n=>{switch(n.localName){case"style":t.push(this.parseStyle(n));break;case"docDefaults":t.push(this.parseDefaultStyles(n));break}}),t}parseDefaultStyles(e){var t={id:null,name:null,target:null,basedOn:null,styles:[]};return Et.foreach(e,n=>{switch(n.localName){case"rPrDefault":var i=he.element(n,"rPr");i&&t.styles.push({target:"span",values:this.parseDefaultProperties(i,{})});break;case"pPrDefault":var o=he.element(n,"pPr");o&&t.styles.push({target:"p",values:this.parseDefaultProperties(o,{})});break}}),t}parseStyle(e){var t={id:he.attr(e,"styleId"),isDefault:he.boolAttr(e,"default"),name:null,target:null,basedOn:null,styles:[],linked:null};switch(he.attr(e,"type")){case"paragraph":t.target="p";break;case"table":t.target="table";break;case"character":t.target="span";break}return Et.foreach(e,n=>{switch(n.localName){case"basedOn":t.basedOn=he.attr(n,"val");break;case"name":t.name=he.attr(n,"val");break;case"link":t.linked=he.attr(n,"val");break;case"next":t.next=he.attr(n,"val");break;case"aliases":t.aliases=he.attr(n,"val").split(",");break;case"pPr":t.styles.push({target:"p",values:this.parseDefaultProperties(n,{})}),t.paragraphProps=Lp(n,he);break;case"rPr":t.styles.push({target:"span",values:this.parseDefaultProperties(n,{})}),t.runProps=Qc(n,he);break;case"tblPr":case"tcPr":t.styles.push({target:"td",values:this.parseDefaultProperties(n,{})});break;case"tblStylePr":for(let i of this.parseTableStyle(n))t.styles.push(i);break;case"rsid":case"qFormat":case"hidden":case"semiHidden":case"unhideWhenUsed":case"autoRedefine":case"uiPriority":break;default:this.options.debug&&console.warn(`DOCX: Unknown style element: ${n.localName}`)}}),t}parseTableStyle(e){var t=[],n=he.attr(e,"type"),i="",o="";switch(n){case"firstRow":o=".first-row",i="tr.first-row td";break;case"lastRow":o=".last-row",i="tr.last-row td";break;case"firstCol":o=".first-col",i="td.first-col";break;case"lastCol":o=".last-col",i="td.last-col";break;case"band1Vert":o=":not(.no-vband)",i="td.odd-col";break;case"band2Vert":o=":not(.no-vband)",i="td.even-col";break;case"band1Horz":o=":not(.no-hband)",i="tr.odd-row";break;case"band2Horz":o=":not(.no-hband)",i="tr.even-row";break;default:return[]}return Et.foreach(e,a=>{switch(a.localName){case"pPr":t.push({target:`${i} p`,mod:o,values:this.parseDefaultProperties(a,{})});break;case"rPr":t.push({target:`${i} span`,mod:o,values:this.parseDefaultProperties(a,{})});break;case"tblPr":case"tcPr":t.push({target:i,mod:o,values:this.parseDefaultProperties(a,{})});break}}),t}parseNumberingFile(e){var t=[],n={},i=[];return Et.foreach(e,o=>{switch(o.localName){case"abstractNum":this.parseAbstractNumbering(o,i).forEach(l=>t.push(l));break;case"numPicBullet":i.push(this.parseNumberingPicBullet(o));break;case"num":var a=he.attr(o,"numId"),s=he.elementAttr(o,"abstractNumId","val");n[s]=a;break}}),t.forEach(o=>o.id=n[o.id]),t}parseNumberingPicBullet(e){var t=he.element(e,"pict"),n=t&&he.element(t,"shape"),i=n&&he.element(n,"imagedata");return i?{id:he.intAttr(e,"numPicBulletId"),src:he.attr(i,"id"),style:he.attr(n,"style")}:null}parseAbstractNumbering(e,t){var n=[],i=he.attr(e,"abstractNumId");return Et.foreach(e,o=>{switch(o.localName){case"lvl":n.push(this.parseNumberingLevel(i,o,t));break}}),n}parseNumberingLevel(e,t,n){var i={id:e,level:he.intAttr(t,"ilvl"),start:1,pStyleName:void 0,pStyle:{},rStyle:{},suff:"tab"};return Et.foreach(t,o=>{switch(o.localName){case"start":i.start=he.intAttr(o,"val");break;case"pPr":this.parseDefaultProperties(o,i.pStyle);break;case"rPr":this.parseDefaultProperties(o,i.rStyle);break;case"lvlPicBulletId":var a=he.intAttr(o,"val");i.bullet=n.find(s=>(s==null?void 0:s.id)==a);break;case"lvlText":i.levelText=he.attr(o,"val");break;case"pStyle":i.pStyleName=he.attr(o,"val");break;case"numFmt":i.format=he.attr(o,"val");break;case"suff":i.suff=he.attr(o,"val");break}}),i}parseSdt(e,t){const n=he.element(e,"sdtContent");return n?t(n):[]}parseInserted(e,t){var n,i;return{type:Re.Inserted,children:(i=(n=t(e))==null?void 0:n.children)!=null?i:[]}}parseDeleted(e,t){var n,i;return{type:Re.Deleted,children:(i=(n=t(e))==null?void 0:n.children)!=null?i:[]}}parseParagraph(e){var t={type:Re.Paragraph,children:[]};for(let n of he.elements(e))switch(n.localName){case"pPr":this.parseParagraphProperties(n,t);break;case"r":t.children.push(this.parseRun(n,t));break;case"hyperlink":t.children.push(this.parseHyperlink(n,t));break;case"smartTag":t.children.push(this.parseSmartTag(n,t));break;case"bookmarkStart":t.children.push(gT(n,he));break;case"bookmarkEnd":t.children.push(RT(n,he));break;case"commentRangeStart":t.children.push(new xT(he.attr(n,"id")));break;case"commentRangeEnd":t.children.push(new bT(he.attr(n,"id")));break;case"oMath":case"oMathPara":t.children.push(this.parseMathElement(n));break;case"sdt":t.children.push(...this.parseSdt(n,i=>this.parseParagraph(i).children));break;case"ins":t.children.push(this.parseInserted(n,i=>this.parseParagraph(i)));break;case"del":t.children.push(this.parseDeleted(n,i=>this.parseParagraph(i)));break}return t}parseParagraphProperties(e,t){this.parseDefaultProperties(e,t.cssStyle={},null,n=>{if(Fp(n,t,he))return!0;switch(n.localName){case"pStyle":t.styleName=he.attr(n,"val");break;case"cnfStyle":t.className=yt.classNameOfCnfStyle(n);break;case"framePr":this.parseFrame(n,t);break;case"rPr":break;default:return!1}return!0})}parseFrame(e,t){var n=he.attr(e,"dropCap");n=="drop"&&(t.cssStyle.float="left")}parseHyperlink(e,t){var n={type:Re.Hyperlink,parent:t,children:[]},i=he.attr(e,"anchor"),o=he.attr(e,"id");return i&&(n.href="#"+i),o&&(n.id=o),Et.foreach(e,a=>{switch(a.localName){case"r":n.children.push(this.parseRun(a,n));break}}),n}parseSmartTag(e,t){var n={type:Re.SmartTag,parent:t,children:[]},i=he.attr(e,"uri"),o=he.attr(e,"element");return i&&(n.uri=i),o&&(n.element=o),Et.foreach(e,a=>{switch(a.localName){case"r":n.children.push(this.parseRun(a,n));break}}),n}parseRun(e,t){var n={type:Re.Run,parent:t,children:[]};return Et.foreach(e,i=>{switch(i=this.checkAlternateContent(i),i.localName){case"t":n.children.push({type:Re.Text,text:i.textContent});break;case"delText":n.children.push({type:Re.DeletedText,text:i.textContent});break;case"commentReference":n.children.push(new ST(he.attr(i,"id")));break;case"fldSimple":n.children.push({type:Re.SimpleField,instruction:he.attr(i,"instr"),lock:he.boolAttr(i,"lock",!1),dirty:he.boolAttr(i,"dirty",!1)});break;case"instrText":n.fieldRun=!0,n.children.push({type:Re.Instruction,text:i.textContent});break;case"fldChar":n.fieldRun=!0,n.children.push({type:Re.ComplexField,charType:he.attr(i,"fldCharType"),lock:he.boolAttr(i,"lock",!1),dirty:he.boolAttr(i,"dirty",!1)});break;case"noBreakHyphen":n.children.push({type:Re.NoBreakHyphen});break;case"br":n.children.push({type:Re.Break,break:he.attr(i,"type")||"textWrapping"});break;case"lastRenderedPageBreak":n.children.push({type:Re.Break,break:"lastRenderedPageBreak"});break;case"sym":n.children.push({type:Re.Symbol,font:he.attr(i,"font"),char:he.attr(i,"char")});break;case"tab":n.children.push({type:Re.Tab});break;case"footnoteReference":n.children.push({type:Re.FootnoteReference,id:he.attr(i,"id")});break;case"endnoteReference":n.children.push({type:Re.EndnoteReference,id:he.attr(i,"id")});break;case"drawing":let o=this.parseDrawing(i);o&&(n.children=[o]);break;case"pict":n.children.push(this.parseVmlPicture(i));break;case"rPr":this.parseRunProperties(i,n);break}}),n}parseMathElement(e){const t=`${e.localName}Pr`,n={type:Tf[e.localName],children:[]};for(const o of he.elements(e))if(Tf[o.localName])n.children.push(this.parseMathElement(o));else if(o.localName=="r"){var i=this.parseRun(o);i.type=Re.MmlRun,n.children.push(i)}else o.localName==t&&(n.props=this.parseMathProperies(o));return n}parseMathProperies(e){const t={};for(const n of he.elements(e))switch(n.localName){case"chr":t.char=he.attr(n,"val");break;case"vertJc":t.verticalJustification=he.attr(n,"val");break;case"pos":t.position=he.attr(n,"val");break;case"degHide":t.hideDegree=he.boolAttr(n,"val");break;case"begChr":t.beginChar=he.attr(n,"val");break;case"endChr":t.endChar=he.attr(n,"val");break}return t}parseRunProperties(e,t){this.parseDefaultProperties(e,t.cssStyle={},null,n=>{switch(n.localName){case"rStyle":t.styleName=he.attr(n,"val");break;case"vertAlign":t.verticalAlign=yt.valueOfVertAlign(n,!0);break;default:return!1}return!0})}parseVmlPicture(e){const t={type:Re.VmlPicture,children:[]};for(const n of he.elements(e)){const i=Up(n,this);i&&t.children.push(i)}return t}checkAlternateContent(e){var o;if(e.localName!="AlternateContent")return e;var t=he.element(e,"Choice");if(t){var n=he.attr(t,"Requires"),i=e.lookupNamespaceURI(n);if(OT.includes(i))return t.firstElementChild}return(o=he.element(e,"Fallback"))==null?void 0:o.firstElementChild}parseDrawing(e){for(var t of he.elements(e))switch(t.localName){case"inline":case"anchor":return this.parseDrawingWrapper(t)}}parseDrawingWrapper(e){var d;var t={type:Re.Drawing,children:[],cssStyle:{}},n=e.localName=="anchor";let i=null,o=he.boolAttr(e,"simplePos");he.boolAttr(e,"behindDoc");let a={relative:"page",align:"left",offset:"0"},s={relative:"page",align:"top",offset:"0"};for(var l of he.elements(e))switch(l.localName){case"simplePos":o&&(a.offset=he.lengthAttr(l,"x",Dt.Emu),s.offset=he.lengthAttr(l,"y",Dt.Emu));break;case"extent":t.cssStyle.width=he.lengthAttr(l,"cx",Dt.Emu),t.cssStyle.height=he.lengthAttr(l,"cy",Dt.Emu);break;case"positionH":case"positionV":if(!o){let f=l.localName=="positionH"?a:s;var c=he.element(l,"align"),u=he.element(l,"posOffset");f.relative=(d=he.attr(l,"relativeFrom"))!=null?d:f.relative,c&&(f.align=c.textContent),u&&(f.offset=Et.sizeValue(u,Dt.Emu))}break;case"wrapTopAndBottom":i="wrapTopAndBottom";break;case"wrapNone":i="wrapNone";break;case"graphic":var h=this.parseGraphic(l);h&&t.children.push(h);break}return i=="wrapTopAndBottom"?(t.cssStyle.display="block",a.align&&(t.cssStyle["text-align"]=a.align,t.cssStyle.width="100%")):i=="wrapNone"?(t.cssStyle.display="block",t.cssStyle.position="relative",t.cssStyle.width="0px",t.cssStyle.height="0px",a.offset&&(t.cssStyle.left=a.offset),s.offset&&(t.cssStyle.top=s.offset)):n&&(a.align=="left"||a.align=="right")&&(t.cssStyle.float=a.align),t}parseGraphic(e){var t=he.element(e,"graphicData");for(let n of he.elements(t))switch(n.localName){case"pic":return this.parsePicture(n)}return null}parsePicture(e){var t={type:Re.Image,src:"",cssStyle:{}},n=he.element(e,"blipFill"),i=he.element(n,"blip");t.src=he.attr(i,"embed");var o=he.element(e,"spPr"),a=he.element(o,"xfrm");t.cssStyle.position="relative";for(var s of he.elements(a))switch(s.localName){case"ext":t.cssStyle.width=he.lengthAttr(s,"cx",Dt.Emu),t.cssStyle.height=he.lengthAttr(s,"cy",Dt.Emu);break;case"off":t.cssStyle.left=he.lengthAttr(s,"x",Dt.Emu),t.cssStyle.top=he.lengthAttr(s,"y",Dt.Emu);break}return t}parseTable(e){var t={type:Re.Table,children:[]};return Et.foreach(e,n=>{switch(n.localName){case"tr":t.children.push(this.parseTableRow(n));break;case"tblGrid":t.columns=this.parseTableColumns(n);break;case"tblPr":this.parseTableProperties(n,t);break}}),t}parseTableColumns(e){var t=[];return Et.foreach(e,n=>{switch(n.localName){case"gridCol":t.push({width:he.lengthAttr(n,"w")});break}}),t}parseTableProperties(e,t){switch(t.cssStyle={},t.cellStyle={},this.parseDefaultProperties(e,t.cssStyle,t.cellStyle,n=>{switch(n.localName){case"tblStyle":t.styleName=he.attr(n,"val");break;case"tblLook":t.className=yt.classNameOftblLook(n);break;case"tblpPr":this.parseTablePosition(n,t);break;case"tblStyleColBandSize":t.colBandSize=he.intAttr(n,"val");break;case"tblStyleRowBandSize":t.rowBandSize=he.intAttr(n,"val");break;default:return!1}return!0}),t.cssStyle["text-align"]){case"center":delete t.cssStyle["text-align"],t.cssStyle["margin-left"]="auto",t.cssStyle["margin-right"]="auto";break;case"right":delete t.cssStyle["text-align"],t.cssStyle["margin-left"]="auto";break}}parseTablePosition(e,t){var n=he.lengthAttr(e,"topFromText"),i=he.lengthAttr(e,"bottomFromText"),o=he.lengthAttr(e,"rightFromText"),a=he.lengthAttr(e,"leftFromText");t.cssStyle.float="left",t.cssStyle["margin-bottom"]=yt.addSize(t.cssStyle["margin-bottom"],i),t.cssStyle["margin-left"]=yt.addSize(t.cssStyle["margin-left"],a),t.cssStyle["margin-right"]=yt.addSize(t.cssStyle["margin-right"],o),t.cssStyle["margin-top"]=yt.addSize(t.cssStyle["margin-top"],n)}parseTableRow(e){var t={type:Re.Row,children:[]};return Et.foreach(e,n=>{switch(n.localName){case"tc":t.children.push(this.parseTableCell(n));break;case"trPr":this.parseTableRowProperties(n,t);break}}),t}parseTableRowProperties(e,t){t.cssStyle=this.parseDefaultProperties(e,{},null,n=>{switch(n.localName){case"cnfStyle":t.className=yt.classNameOfCnfStyle(n);break;case"tblHeader":t.isHeader=he.boolAttr(n,"val");break;default:return!1}return!0})}parseTableCell(e){var t={type:Re.Cell,children:[]};return Et.foreach(e,n=>{switch(n.localName){case"tbl":t.children.push(this.parseTable(n));break;case"p":t.children.push(this.parseParagraph(n));break;case"tcPr":this.parseTableCellProperties(n,t);break}}),t}parseTableCellProperties(e,t){t.cssStyle=this.parseDefaultProperties(e,{},null,n=>{var i;switch(n.localName){case"gridSpan":t.span=he.intAttr(n,"val",null);break;case"vMerge":t.verticalMerge=(i=he.attr(n,"val"))!=null?i:"continue";break;case"cnfStyle":t.className=yt.classNameOfCnfStyle(n);break;default:return!1}return!0})}parseDefaultProperties(e,t=null,n=null,i=null){return t=t||{},Et.foreach(e,o=>{if(!(i!=null&&i(o)))switch(o.localName){case"jc":t["text-align"]=yt.valueOfJc(o);break;case"textAlignment":t["vertical-align"]=yt.valueOfTextAlignment(o);break;case"color":t.color=Et.colorAttr(o,"val",null,Ta.color);break;case"sz":t["font-size"]=t["min-height"]=he.lengthAttr(o,"val",Dt.FontSize);break;case"shd":t["background-color"]=Et.colorAttr(o,"fill",null,Ta.shd);break;case"highlight":t["background-color"]=Et.colorAttr(o,"val",null,Ta.highlight);break;case"vertAlign":break;case"position":t.verticalAlign=he.lengthAttr(o,"val",Dt.FontSize);break;case"tcW":if(this.options.ignoreWidth)break;case"tblW":t.width=yt.valueOfSize(o,"w");break;case"trHeight":this.parseTrHeight(o,t);break;case"strike":t["text-decoration"]=he.boolAttr(o,"val",!0)?"line-through":"none";break;case"b":t["font-weight"]=he.boolAttr(o,"val",!0)?"bold":"normal";break;case"i":t["font-style"]=he.boolAttr(o,"val",!0)?"italic":"normal";break;case"caps":t["text-transform"]=he.boolAttr(o,"val",!0)?"uppercase":"none";break;case"smallCaps":t["font-variant"]=he.boolAttr(o,"val",!0)?"small-caps":"none";break;case"u":this.parseUnderline(o,t);break;case"ind":case"tblInd":this.parseIndentation(o,t);break;case"rFonts":this.parseFont(o,t);break;case"tblBorders":this.parseBorderProperties(o,n||t);break;case"tblCellSpacing":t["border-spacing"]=yt.valueOfMargin(o),t["border-collapse"]="separate";break;case"pBdr":this.parseBorderProperties(o,t);break;case"bdr":t.border=yt.valueOfBorder(o);break;case"tcBorders":this.parseBorderProperties(o,t);break;case"vanish":he.boolAttr(o,"val",!0)&&(t.display="none");break;case"kern":break;case"noWrap":break;case"tblCellMar":case"tcMar":this.parseMarginProperties(o,n||t);break;case"tblLayout":t["table-layout"]=yt.valueOfTblLayout(o);break;case"vAlign":t["vertical-align"]=yt.valueOfTextAlignment(o);break;case"spacing":e.localName=="pPr"&&this.parseSpacing(o,t);break;case"wordWrap":he.boolAttr(o,"val")&&(t["overflow-wrap"]="break-word");break;case"suppressAutoHyphens":t.hyphens=he.boolAttr(o,"val",!0)?"none":"auto";break;case"lang":t.$lang=he.attr(o,"val");break;case"bCs":case"iCs":case"szCs":case"tabs":case"outlineLvl":case"contextualSpacing":case"tblStyleColBandSize":case"tblStyleRowBandSize":case"webHidden":case"pageBreakBefore":case"suppressLineNumbers":case"keepLines":case"keepNext":case"widowControl":case"bidi":case"rtl":case"noProof":break;default:this.options.debug&&console.warn(`DOCX: Unknown document element: ${e.localName}.${o.localName}`);break}}),t}parseUnderline(e,t){var n=he.attr(e,"val");if(n!=null){switch(n){case"dash":case"dashDotDotHeavy":case"dashDotHeavy":case"dashedHeavy":case"dashLong":case"dashLongHeavy":case"dotDash":case"dotDotDash":t["text-decoration"]="underline dashed";break;case"dotted":case"dottedHeavy":t["text-decoration"]="underline dotted";break;case"double":t["text-decoration"]="underline double";break;case"single":case"thick":t["text-decoration"]="underline";break;case"wave":case"wavyDouble":case"wavyHeavy":t["text-decoration"]="underline wavy";break;case"words":t["text-decoration"]="underline";break;case"none":t["text-decoration"]="none";break}var i=Et.colorAttr(e,"color");i&&(t["text-decoration-color"]=i)}}parseFont(e,t){var n=he.attr(e,"ascii"),i=yt.themeValue(e,"asciiTheme"),o=[n,i].filter(a=>a).join(", ");o.length>0&&(t["font-family"]=o)}parseIndentation(e,t){var n=he.lengthAttr(e,"firstLine"),i=he.lengthAttr(e,"hanging"),o=he.lengthAttr(e,"left"),a=he.lengthAttr(e,"start"),s=he.lengthAttr(e,"right"),l=he.lengthAttr(e,"end");n&&(t["text-indent"]=n),i&&(t["text-indent"]=`-${i}`),(o||a)&&(t["margin-left"]=o||a),(s||l)&&(t["margin-right"]=s||l)}parseSpacing(e,t){var n=he.lengthAttr(e,"before"),i=he.lengthAttr(e,"after"),o=he.intAttr(e,"line",null),a=he.attr(e,"lineRule");if(n&&(t["margin-top"]=n),i&&(t["margin-bottom"]=i),o!==null)switch(a){case"auto":t["line-height"]=`${(o/240).toFixed(2)}`;break;case"atLeast":t["line-height"]=`calc(100% + ${o/20}pt)`;break;default:t["line-height"]=t["min-height"]=`${o/20}pt`;break}}parseMarginProperties(e,t){Et.foreach(e,n=>{switch(n.localName){case"left":t["padding-left"]=yt.valueOfMargin(n);break;case"right":t["padding-right"]=yt.valueOfMargin(n);break;case"top":t["padding-top"]=yt.valueOfMargin(n);break;case"bottom":t["padding-bottom"]=yt.valueOfMargin(n);break}})}parseTrHeight(e,t){switch(he.attr(e,"hRule")){case"exact":t.height=he.lengthAttr(e,"val");break;case"atLeast":default:t.height=he.lengthAttr(e,"val");break}}parseBorderProperties(e,t){Et.foreach(e,n=>{switch(n.localName){case"start":case"left":t["border-left"]=yt.valueOfBorder(n);break;case"end":case"right":t["border-right"]=yt.valueOfBorder(n);break;case"top":t["border-top"]=yt.valueOfBorder(n);break;case"bottom":t["border-bottom"]=yt.valueOfBorder(n);break}})}}const PT=["black","blue","cyan","darkBlue","darkCyan","darkGray","darkGreen","darkMagenta","darkRed","darkYellow","green","lightGray","magenta","none","red","white","yellow"];class Et{static foreach(e,t){for(var n=0;nt[o]=="1").join(" ")}static valueOfJc(e){var t=he.attr(e,"val");switch(t){case"start":case"left":return"left";case"center":return"center";case"end":case"right":return"right";case"both":return"justify"}return t}static valueOfVertAlign(e,t=!1){var n=he.attr(e,"val");switch(n){case"subscript":return"sub";case"superscript":return t?"sup":"super"}return t?null:n}static valueOfTextAlignment(e){var t=he.attr(e,"val");switch(t){case"auto":case"baseline":return"baseline";case"top":return"top";case"center":return"middle";case"bottom":return"bottom"}return t}static addSize(e,t){return e==null?t:t==null?e:`calc(${e} + ${t})`}static classNameOftblLook(e){const t=he.hexAttr(e,"val",0);let n="";return(he.boolAttr(e,"firstRow")||t&32)&&(n+=" first-row"),(he.boolAttr(e,"lastRow")||t&64)&&(n+=" last-row"),(he.boolAttr(e,"firstColumn")||t&128)&&(n+=" first-col"),(he.boolAttr(e,"lastColumn")||t&256)&&(n+=" last-col"),(he.boolAttr(e,"noHBand")||t&512)&&(n+=" no-hband"),(he.boolAttr(e,"noVBand")||t&1024)&&(n+=" no-vband"),n.trim()}}const Pf={pos:0,leader:"none",style:"left"},ET=50;function _T(r=document.body){const e=document.createElement("div");e.style.width="100pt",r.appendChild(e);const t=100/e.offsetWidth;return r.removeChild(e),t}function IT(r,e,t,n=72/96){const i=r.closest("p"),o=r.getBoundingClientRect(),a=i.getBoundingClientRect(),s=getComputedStyle(i),l=(e==null?void 0:e.length)>0?e.map(m=>({pos:Ef(m.position),leader:m.leader,style:m.style})).sort((m,x)=>m.pos-x.pos):[Pf],c=l[l.length-1],u=a.width*n,h=Ef(t);let d=c.pos+h;if(dm.style!="clear"&&m.pos>g);if(v==null)return;let R=1;if(v.style=="right"||v.style=="center"){const m=Array.from(i.querySelectorAll(`.${r.className}`)),x=m.indexOf(r)+1,T=document.createRange();T.setStart(r,1),xs.id)),e.endnotesPart&&(this.endnoteMap=In(e.endnotesPart.notes,s=>s.id)),e.settingsPart&&(this.defaultTabSize=(a=e.settingsPart.settings)==null?void 0:a.defaultTabStop),!i.ignoreFonts&&e.fontTablePart&&this.renderFontTable(e.fontTablePart,n);var o=this.renderSections(e.documentPart.body);this.options.inWrapper?t.appendChild(this.renderWrapper(o)):ec(t,o),this.commentHighlight&&i.renderComments&&CSS.highlights.set(`${this.className}-comments`,this.commentHighlight),this.refreshTabStops(),this.postRenderTasks.forEach(s=>s())}renderTheme(e,t){var s,l;const n={},i=(s=e.theme)==null?void 0:s.fontScheme;i&&(i.majorFont&&(n["--docx-majorHAnsi-font"]=i.majorFont.latinTypeface),i.minorFont&&(n["--docx-minorHAnsi-font"]=i.minorFont.latinTypeface));const o=(l=e.theme)==null?void 0:l.colorScheme;if(o)for(let[c,u]of Object.entries(o.colors))n[`--docx-${c}-color`]=`#${u}`;const a=this.styleToString(`.${this.className}`,n);t.appendChild(di(a))}renderFontTable(e,t){for(let n of e.fonts)for(let i of n.embedFontRefs)this.tasks.push(this.document.loadFont(i.id,i.key).then(o=>{const a={"font-family":n.name,src:`url(${o})`};(i.type=="bold"||i.type=="boldItalic")&&(a["font-weight"]="bold"),(i.type=="italic"||i.type=="boldItalic")&&(a["font-style"]="italic"),co(t,`docxjs ${n.name} font`);const s=this.styleToString("@font-face",a);t.appendChild(di(s)),this.refreshTabStops()}))}processStyleName(e){return e?`${this.className}_${T2(e)}`:this.className}processStyles(e){const t=In(e.filter(i=>i.id!=null),i=>i.id);for(const i of e.filter(o=>o.basedOn)){var n=t[i.basedOn];if(n){i.paragraphProps=Ya(i.paragraphProps,n.paragraphProps),i.runProps=Ya(i.runProps,n.runProps);for(const o of n.styles){const a=i.styles.find(s=>s.target==o.target);a?this.copyStyleProperties(o.values,a.values):i.styles.push({...o,values:{...o.values}})}}else this.options.debug&&console.warn(`Can't find base style ${i.basedOn}`)}for(let i of e)i.cssName=this.processStyleName(i.id);return t}prodessNumberings(e){var t;for(let n of e.filter(i=>i.pStyleName)){const i=this.findStyle(n.pStyleName);(t=i==null?void 0:i.paragraphProps)!=null&&t.numbering&&(i.paragraphProps.numbering.level=n.level)}}processElement(e){if(e.children)for(var t of e.children)t.parent=e,t.type==Re.Table?this.processTable(t):this.processElement(t)}processTable(e){for(var t of e.children)for(var n of t.children)n.cssStyle=this.copyStyleProperties(e.cellStyle,n.cssStyle,["border-left","border-right","border-top","border-bottom","padding-left","padding-right","padding-top","padding-bottom"]),this.processElement(n)}copyStyleProperties(e,t,n=null){if(!e)return t;t==null&&(t={}),n==null&&(n=Object.getOwnPropertyNames(e));for(var i of n)e.hasOwnProperty(i)&&!t.hasOwnProperty(i)&&(t[i]=e[i]);return t}createPageElement(e,t){var n=this.createElement("section",{className:e});return t&&(t.pageMargins&&(n.style.paddingLeft=t.pageMargins.left,n.style.paddingRight=t.pageMargins.right,n.style.paddingTop=t.pageMargins.top,n.style.paddingBottom=t.pageMargins.bottom),t.pageSize&&(this.options.ignoreWidth||(n.style.width=t.pageSize.width),this.options.ignoreHeight||(n.style.minHeight=t.pageSize.height))),n}createSectionContent(e){var t=this.createElement("article");return e.columns&&e.columns.numberOfColumns&&(t.style.columnCount=`${e.columns.numberOfColumns}`,t.style.columnGap=e.columns.space,e.columns.separator&&(t.style.columnRule="1px solid black")),t}renderSections(e){const t=[];this.processElement(e);const n=this.splitBySection(e.children,e.props),i=this.groupByPageBreaks(n);let o=null;for(let s=0,l=i.length;su.type=="first"):null)!=null?l:n%2==1?e.find(u=>u.type=="even"):null)!=null?c:e.find(u=>u.type=="default"),s=a&&this.document.findPartByRelId(a.id,this.document.documentPart);if(s){this.currentPart=s,this.usedHederFooterParts.includes(s.path)||(this.processElement(s.rootElement),this.usedHederFooterParts.push(s.path));const[u]=this.renderElements([s.rootElement],o);t!=null&&t.pageMargins&&(s.rootElement.type===Re.Header?(u.style.marginTop=`calc(${t.pageMargins.header} - ${t.pageMargins.top})`,u.style.minHeight=`calc(${t.pageMargins.top} - ${t.pageMargins.header})`):s.rootElement.type===Re.Footer&&(u.style.marginBottom=`calc(${t.pageMargins.footer} - ${t.pageMargins.bottom})`,u.style.minHeight=`calc(${t.pageMargins.bottom} - ${t.pageMargins.footer})`)),this.currentPart=null}}}isPageBreakElement(e){return e.type!=Re.Break?!1:e.break=="lastRenderedPageBreak"?!this.options.ignoreLastRenderedPageBreak:e.break=="page"}isPageBreakSection(e,t){var n,i,o,a,s,l;return!e||!t?!1:((n=e.pageSize)==null?void 0:n.orientation)!=((i=t.pageSize)==null?void 0:i.orientation)||((o=e.pageSize)==null?void 0:o.width)!=((a=t.pageSize)==null?void 0:a.width)||((s=e.pageSize)==null?void 0:s.height)!=((l=t.pageSize)==null?void 0:l.height)}splitBySection(e,t){var h;var n={sectProps:null,elements:[],pageBreak:!1},i=[n];for(let d of e){if(d.type==Re.Paragraph){const f=this.findStyle(d.styleName);(h=f==null?void 0:f.paragraphProps)!=null&&h.pageBreakBefore&&(n.sectProps=o,n.pageBreak=!0,n={sectProps:null,elements:[],pageBreak:!1},i.push(n))}if(n.elements.push(d),d.type==Re.Paragraph){const f=d;var o=f.sectionProps,a=-1,s=-1;if(this.options.breakPages&&f.children&&(a=f.children.findIndex(p=>{var g,v;return s=(v=(g=p.children)==null?void 0:g.findIndex(this.isPageBreakElement.bind(this)))!=null?v:-1,s!=-1})),(o||a!=-1)&&(n.sectProps=o,n.pageBreak=a!=-1,n={sectProps:null,elements:[],pageBreak:!1},i.push(n)),a!=-1){let p=f.children[a],g=s=0;d--)i[d].sectProps==null?i[d].sectProps=u!=null?u:t:u=i[d].sectProps;return i}groupByPageBreaks(e){let t=[],n;const i=[t];for(let o of e)t.push(o),(this.options.ignoreLastRenderedPageBreak||o.pageBreak||this.isPageBreakSection(n,o.sectProps))&&i.push(t=[]),n=o.sectProps;return i.filter(o=>o.length>0)}renderWrapper(e){return this.createElement("div",{className:`${this.className}-wrapper`},e)}renderDefaultStyle(){var e=this.className,t=` +.${e}-wrapper { background: gray; padding: 30px; padding-bottom: 0px; display: flex; flex-flow: column; align-items: center; } +.${e}-wrapper>section.${e} { background: white; box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); margin-bottom: 30px; } +.${e} { color: black; hyphens: auto; text-underline-position: from-font; } +section.${e} { box-sizing: border-box; display: flex; flex-flow: column nowrap; position: relative; overflow: hidden; } +section.${e}>article { margin-bottom: auto; z-index: 1; } +section.${e}>footer { z-index: 1; } +.${e} table { border-collapse: collapse; } +.${e} table td, .${e} table th { vertical-align: top; } +.${e} p { margin: 0pt; min-height: 1em; } +.${e} span { white-space: pre-wrap; overflow-wrap: break-word; } +.${e} a { color: inherit; text-decoration: inherit; } +.${e} svg { fill: transparent; } +`;return this.options.renderComments&&(t+=` +.${e}-comment-ref { cursor: default; } +.${e}-comment-popover { display: none; z-index: 1000; padding: 0.5rem; background: white; position: absolute; box-shadow: 0 0 0.25rem rgba(0, 0, 0, 0.25); width: 30ch; } +.${e}-comment-ref:hover~.${e}-comment-popover { display: block; } +.${e}-comment-author,.${e}-comment-date { font-size: 0.875rem; color: #888; } +`),di(t)}renderNumbering(e,t){var n="",i=[];for(var o of e){var a=`p.${this.numberingClass(o.id,o.level)}`,s="none";if(o.bullet){let l=`--${this.className}-${o.bullet.src}`.toLowerCase();n+=this.styleToString(`${a}:before`,{content:"' '",display:"inline-block",background:`var(${l})`},o.bullet.style),this.tasks.push(this.document.loadNumberingImage(o.bullet.src).then(c=>{var u=`${this.rootSelector} { ${l}: url(${c}) }`;t.appendChild(di(u))}))}else if(o.levelText){let l=this.numberingCounter(o.id,o.level);const c=l+" "+(o.start-1);o.level>0&&(n+=this.styleToString(`p.${this.numberingClass(o.id,o.level-1)}`,{"counter-reset":c})),i.push(c),n+=this.styleToString(`${a}:before`,{content:this.levelTextToContent(o.levelText,o.suff,o.id,this.numFormatToCssValue(o.format)),"counter-increment":l,...o.rStyle})}else s=this.numFormatToCssValue(o.format);n+=this.styleToString(a,{display:"list-item","list-style-position":"inside","list-style-type":s,...o.pStyle})}return i.length>0&&(n+=this.styleToString(this.rootSelector,{"counter-reset":i.join(" ")})),di(n)}renderStyles(e){var l;var t="";const n=this.styleMap,i=In(e.filter(c=>c.isDefault),c=>c.target);for(const c of e){var o=c.styles;if(c.linked){var a=c.linked&&n[c.linked];a?o=o.concat(a.styles):this.options.debug&&console.warn(`Can't find linked style ${c.linked}`)}for(const u of o){var s=`${(l=c.target)!=null?l:""}.${c.cssName}`;c.target!=u.target&&(s+=` ${u.target}`),i[c.target]==c&&(s=`.${this.className} ${c.target}, `+s),t+=this.styleToString(s,u.values)}}return di(t)}renderNotes(e,t,n){var i=e.map(a=>t[a]).filter(a=>a);if(i.length>0){var o=this.createElement("ol",null,this.renderElements(i));n.appendChild(o)}}renderElement(e){switch(e.type){case Re.Paragraph:return this.renderParagraph(e);case Re.BookmarkStart:return this.renderBookmarkStart(e);case Re.BookmarkEnd:return null;case Re.Run:return this.renderRun(e);case Re.Table:return this.renderTable(e);case Re.Row:return this.renderTableRow(e);case Re.Cell:return this.renderTableCell(e);case Re.Hyperlink:return this.renderHyperlink(e);case Re.SmartTag:return this.renderSmartTag(e);case Re.Drawing:return this.renderDrawing(e);case Re.Image:return this.renderImage(e);case Re.Text:return this.renderText(e);case Re.Text:return this.renderText(e);case Re.DeletedText:return this.renderDeletedText(e);case Re.Tab:return this.renderTab(e);case Re.Symbol:return this.renderSymbol(e);case Re.Break:return this.renderBreak(e);case Re.Footer:return this.renderContainer(e,"footer");case Re.Header:return this.renderContainer(e,"header");case Re.Footnote:case Re.Endnote:return this.renderContainer(e,"li");case Re.FootnoteReference:return this.renderFootnoteReference(e);case Re.EndnoteReference:return this.renderEndnoteReference(e);case Re.NoBreakHyphen:return this.createElement("wbr");case Re.VmlPicture:return this.renderVmlPicture(e);case Re.VmlElement:return this.renderVmlElement(e);case Re.MmlMath:return this.renderContainerNS(e,He.mathML,"math",{xmlns:He.mathML});case Re.MmlMathParagraph:return this.renderContainer(e,"span");case Re.MmlFraction:return this.renderContainerNS(e,He.mathML,"mfrac");case Re.MmlBase:return this.renderContainerNS(e,He.mathML,e.parent.type==Re.MmlMatrixRow?"mtd":"mrow");case Re.MmlNumerator:case Re.MmlDenominator:case Re.MmlFunction:case Re.MmlLimit:case Re.MmlBox:return this.renderContainerNS(e,He.mathML,"mrow");case Re.MmlGroupChar:return this.renderMmlGroupChar(e);case Re.MmlLimitLower:return this.renderContainerNS(e,He.mathML,"munder");case Re.MmlMatrix:return this.renderContainerNS(e,He.mathML,"mtable");case Re.MmlMatrixRow:return this.renderContainerNS(e,He.mathML,"mtr");case Re.MmlRadical:return this.renderMmlRadical(e);case Re.MmlSuperscript:return this.renderContainerNS(e,He.mathML,"msup");case Re.MmlSubscript:return this.renderContainerNS(e,He.mathML,"msub");case Re.MmlDegree:case Re.MmlSuperArgument:case Re.MmlSubArgument:return this.renderContainerNS(e,He.mathML,"mn");case Re.MmlFunctionName:return this.renderContainerNS(e,He.mathML,"ms");case Re.MmlDelimiter:return this.renderMmlDelimiter(e);case Re.MmlRun:return this.renderMmlRun(e);case Re.MmlNary:return this.renderMmlNary(e);case Re.MmlPreSubSuper:return this.renderMmlPreSubSuper(e);case Re.MmlBar:return this.renderMmlBar(e);case Re.MmlEquationArray:return this.renderMllList(e);case Re.Inserted:return this.renderInserted(e);case Re.Deleted:return this.renderDeleted(e);case Re.CommentRangeStart:return this.renderCommentRangeStart(e);case Re.CommentRangeEnd:return this.renderCommentRangeEnd(e);case Re.CommentReference:return this.renderCommentReference(e)}return null}renderChildren(e,t){return this.renderElements(e.children,t)}renderElements(e,t){if(e==null)return null;var n=e.flatMap(i=>this.renderElement(i)).filter(i=>i!=null);return t&&ec(t,n),n}renderContainer(e,t,n){return this.createElement(t,n,this.renderChildren(e))}renderContainerNS(e,t,n,i){return wt(t,n,i,this.renderChildren(e))}renderParagraph(e){var o,a,s,l;var t=this.createElement("p");const n=this.findStyle(e.styleName);(a=e.tabs)!=null||(e.tabs=(o=n==null?void 0:n.paragraphProps)==null?void 0:o.tabs),this.renderClass(e,t),this.renderChildren(e,t),this.renderStyleValues(e.cssStyle,t),this.renderCommonProperties(t.style,e);const i=(l=e.numbering)!=null?l:(s=n==null?void 0:n.paragraphProps)==null?void 0:s.numbering;return i&&t.classList.add(this.numberingClass(i.id,i.level)),t}renderRunProperties(e,t){this.renderCommonProperties(e,t)}renderCommonProperties(e,t){t!=null&&(t.color&&(e.color=t.color),t.fontSize&&(e["font-size"]=t.fontSize))}renderHyperlink(e){var t=this.createElement("a");if(this.renderChildren(e,t),this.renderStyleValues(e.cssStyle,t),e.href)t.href=e.href;else if(e.id){const n=this.document.documentPart.rels.find(i=>i.id==e.id&&i.targetMode==="External");t.href=n==null?void 0:n.target}return t}renderSmartTag(e){var t=this.createElement("span");return this.renderChildren(e,t),t}renderCommentRangeStart(e){var i;if(!this.options.renderComments)return null;const t=new Range;(i=this.commentHighlight)==null||i.add(t);const n=this.htmlDocument.createComment(`start of comment #${e.id}`);return this.later(()=>t.setStart(n,0)),this.commentMap[e.id]=t,n}renderCommentRangeEnd(e){if(!this.options.renderComments)return null;const t=this.commentMap[e.id],n=this.htmlDocument.createComment(`end of comment #${e.id}`);return this.later(()=>t==null?void 0:t.setEnd(n,0)),n}renderCommentReference(e){var a;if(!this.options.renderComments)return null;var t=(a=this.document.commentsPart)==null?void 0:a.commentMap[e.id];if(!t)return null;const n=new DocumentFragment,i=Qn("span",{className:`${this.className}-comment-ref`},["\u{1F4AC}"]),o=Qn("div",{className:`${this.className}-comment-popover`});return this.renderCommentContent(t,o),n.appendChild(this.htmlDocument.createComment(`comment #${t.id} by ${t.author} on ${t.date}`)),n.appendChild(i),n.appendChild(o),n}renderCommentContent(e,t){t.appendChild(Qn("div",{className:`${this.className}-comment-author`},[e.author])),t.appendChild(Qn("div",{className:`${this.className}-comment-date`},[new Date(e.date).toLocaleString()])),this.renderChildren(e,t)}renderDrawing(e){var t=this.createElement("div");return t.style.display="inline-block",t.style.position="relative",t.style.textIndent="0px",this.renderChildren(e,t),this.renderStyleValues(e.cssStyle,t),t}renderImage(e){let t=this.createElement("img");return this.renderStyleValues(e.cssStyle,t),this.document&&this.tasks.push(this.document.loadDocumentImage(e.src,this.currentPart).then(n=>{t.src=n})),t}renderText(e){return this.htmlDocument.createTextNode(e.text)}renderDeletedText(e){return this.options.renderEndnotes?this.htmlDocument.createTextNode(e.text):null}renderBreak(e){return e.break=="textWrapping"?this.createElement("br"):null}renderInserted(e){return this.options.renderChanges?this.renderContainer(e,"ins"):this.renderChildren(e)}renderDeleted(e){return this.options.renderChanges?this.renderContainer(e,"del"):null}renderSymbol(e){var t=this.createElement("span");return t.style.fontFamily=e.font,t.innerHTML=`&#x${e.char};`,t}renderFootnoteReference(e){var t=this.createElement("sup");return this.currentFootnoteIds.push(e.id),t.textContent=`${this.currentFootnoteIds.length}`,t}renderEndnoteReference(e){var t=this.createElement("sup");return this.currentEndnoteIds.push(e.id),t.textContent=`${this.currentEndnoteIds.length}`,t}renderTab(e){var i;var t=this.createElement("span");if(t.innerHTML=" ",this.options.experimental){t.className=this.tabStopClass();var n=(i=MT(e,Re.Paragraph))==null?void 0:i.tabs;this.currentTabs.push({stops:n,span:t})}return t}renderBookmarkStart(e){var t=this.createElement("span");return t.id=e.name,t}renderRun(e){if(e.fieldRun)return null;const t=this.createElement("span");if(e.id&&(t.id=e.id),this.renderClass(e,t),this.renderStyleValues(e.cssStyle,t),e.verticalAlign){const n=this.createElement(e.verticalAlign);this.renderChildren(e,n),t.appendChild(n)}else this.renderChildren(e,t);return t}renderTable(e){let t=this.createElement("table");return this.tableCellPositions.push(this.currentCellPosition),this.tableVerticalMerges.push(this.currentVerticalMerge),this.currentVerticalMerge={},this.currentCellPosition={col:0,row:0},e.columns&&t.appendChild(this.renderTableColumns(e.columns)),this.renderClass(e,t),this.renderChildren(e,t),this.renderStyleValues(e.cssStyle,t),this.currentVerticalMerge=this.tableVerticalMerges.pop(),this.currentCellPosition=this.tableCellPositions.pop(),t}renderTableColumns(e){let t=this.createElement("colgroup");for(let n of e){let i=this.createElement("col");n.width&&(i.style.width=n.width),t.appendChild(i)}return t}renderTableRow(e){let t=this.createElement("tr");return this.currentCellPosition.col=0,this.renderClass(e,t),this.renderChildren(e,t),this.renderStyleValues(e.cssStyle,t),this.currentCellPosition.row++,t}renderTableCell(e){let t=this.createElement("td");const n=this.currentCellPosition.col;return e.verticalMerge?e.verticalMerge=="restart"?(this.currentVerticalMerge[n]=t,t.rowSpan=1):this.currentVerticalMerge[n]&&(this.currentVerticalMerge[n].rowSpan+=1,t.style.display="none"):this.currentVerticalMerge[n]=null,this.renderClass(e,t),this.renderChildren(e,t),this.renderStyleValues(e.cssStyle,t),e.span&&(t.colSpan=e.span),this.currentCellPosition.col+=t.colSpan,t}renderVmlPicture(e){var t=Qn("div");return this.renderChildren(e,t),t}renderVmlElement(e){var i,o;var t=_f("svg");t.setAttribute("style",e.cssStyleText);const n=this.renderVmlChildElement(e);return(i=e.imageHref)!=null&&i.id&&this.tasks.push((o=this.document)==null?void 0:o.loadDocumentImage(e.imageHref.id,this.currentPart).then(a=>n.setAttribute("href",a))),t.appendChild(n),requestAnimationFrame(()=>{const a=t.firstElementChild.getBBox();t.setAttribute("width",`${Math.ceil(a.x+a.width)}`),t.setAttribute("height",`${Math.ceil(a.y+a.height)}`)}),t}renderVmlChildElement(e){const t=_f(e.tagName);Object.entries(e.attrs).forEach(([n,i])=>t.setAttribute(n,i));for(let n of e.children)n.type==Re.VmlElement?t.appendChild(this.renderVmlChildElement(n)):t.appendChild(...so(this.renderElement(n)));return t}renderMmlRadical(e){var i;const t=e.children.find(o=>o.type==Re.MmlBase);if((i=e.props)!=null&&i.hideDegree)return wt(He.mathML,"msqrt",null,this.renderElements([t]));const n=e.children.find(o=>o.type==Re.MmlDegree);return wt(He.mathML,"mroot",null,this.renderElements([t,n]))}renderMmlDelimiter(e){var n,i;const t=[];return t.push(wt(He.mathML,"mo",null,[(n=e.props.beginChar)!=null?n:"("])),t.push(...this.renderElements(e.children)),t.push(wt(He.mathML,"mo",null,[(i=e.props.endChar)!=null?i:")"])),wt(He.mathML,"mrow",null,t)}renderMmlNary(e){var c,u;const t=[],n=In(e.children,h=>h.type),i=n[Re.MmlSuperArgument],o=n[Re.MmlSubArgument],a=i?wt(He.mathML,"mo",null,so(this.renderElement(i))):null,s=o?wt(He.mathML,"mo",null,so(this.renderElement(o))):null,l=wt(He.mathML,"mo",null,[(u=(c=e.props)==null?void 0:c.char)!=null?u:"\u222B"]);return a||s?t.push(wt(He.mathML,"munderover",null,[l,s,a])):a?t.push(wt(He.mathML,"mover",null,[l,a])):s?t.push(wt(He.mathML,"munder",null,[l,s])):t.push(l),t.push(...this.renderElements(n[Re.MmlBase].children)),wt(He.mathML,"mrow",null,t)}renderMmlPreSubSuper(e){const t=[],n=In(e.children,c=>c.type),i=n[Re.MmlSuperArgument],o=n[Re.MmlSubArgument],a=i?wt(He.mathML,"mo",null,so(this.renderElement(i))):null,s=o?wt(He.mathML,"mo",null,so(this.renderElement(o))):null,l=wt(He.mathML,"mo",null);return t.push(wt(He.mathML,"msubsup",null,[l,s,a])),t.push(...this.renderElements(n[Re.MmlBase].children)),wt(He.mathML,"mrow",null,t)}renderMmlGroupChar(e){const t=e.props.verticalJustification==="bot"?"mover":"munder",n=this.renderContainerNS(e,He.mathML,t);return e.props.char&&n.appendChild(wt(He.mathML,"mo",null,[e.props.char])),n}renderMmlBar(e){const t=this.renderContainerNS(e,He.mathML,"mrow");switch(e.props.position){case"top":t.style.textDecoration="overline";break;case"bottom":t.style.textDecoration="underline";break}return t}renderMmlRun(e){const t=wt(He.mathML,"ms");return this.renderClass(e,t),this.renderStyleValues(e.cssStyle,t),this.renderChildren(e,t),t}renderMllList(e){const t=wt(He.mathML,"mtable");this.renderClass(e,t),this.renderStyleValues(e.cssStyle,t),this.renderChildren(e);for(let n of this.renderChildren(e))t.appendChild(wt(He.mathML,"mtr",null,[wt(He.mathML,"mtd",null,[n])]));return t}renderStyleValues(e,t){for(let n in e)n.startsWith("$")?t.setAttribute(n.slice(1),e[n]):t.style[n]=e[n]}renderClass(e,t){e.className&&(t.className=e.className),e.styleName&&t.classList.add(this.processStyleName(e.styleName))}findStyle(e){var t;return e&&((t=this.styleMap)==null?void 0:t[e])}numberingClass(e,t){return`${this.className}-num-${e}-${t}`}tabStopClass(){return`${this.className}-tab-stop`}styleToString(e,t,n=null){let i=`${e} {\r +`;for(const o in t)o.startsWith("$")||(i+=` ${o}: ${t[o]};\r +`);return n&&(i+=n),i+`}\r +`}numberingCounter(e,t){return`${this.className}-num-${e}-${t}`}levelTextToContent(e,t,n,i){var s;const o={tab:"\\9",space:"\\a0"};var a=e.replace(/%\d*/g,l=>{let c=parseInt(l.substring(1),10)-1;return`"counter(${this.numberingCounter(n,c)}, ${i})"`});return`"${a}${(s=o[t])!=null?s:""}"`}numFormatToCssValue(e){var n;var t={none:"none",bullet:"disc",decimal:"decimal",lowerLetter:"lower-alpha",upperLetter:"upper-alpha",lowerRoman:"lower-roman",upperRoman:"upper-roman",decimalZero:"decimal-leading-zero",aiueo:"katakana",aiueoFullWidth:"katakana",chineseCounting:"simp-chinese-informal",chineseCountingThousand:"simp-chinese-informal",chineseLegalSimplified:"simp-chinese-formal",chosung:"hangul-consonant",ideographDigital:"cjk-ideographic",ideographTraditional:"cjk-heavenly-stem",ideographLegalTraditional:"trad-chinese-formal",ideographZodiac:"cjk-earthly-branch",iroha:"katakana-iroha",irohaFullWidth:"katakana-iroha",japaneseCounting:"japanese-informal",japaneseDigitalTenThousand:"cjk-decimal",japaneseLegal:"japanese-formal",thaiNumbers:"thai",koreanCounting:"korean-hangul-formal",koreanDigital:"korean-hangul-formal",koreanDigital2:"korean-hanja-informal",hebrew1:"hebrew",hebrew2:"hebrew",hindiNumbers:"devanagari",ganada:"hangul",taiwaneseCounting:"cjk-ideographic",taiwaneseCountingThousand:"cjk-ideographic",taiwaneseDigital:"cjk-decimal"};return(n=t[e])!=null?n:e}refreshTabStops(){!this.options.experimental||(clearTimeout(this.tabsTimeout),this.tabsTimeout=setTimeout(()=>{const e=_T();for(let t of this.currentTabs)IT(t.span,t.stops,this.defaultTabSize,e)},500))}later(e){this.postRenderTasks.push(e)}}function Qn(r,e,t){return wt(void 0,r,e,t)}function _f(r,e,t){return wt(He.svg,r,e,t)}function wt(r,e,t,n){var i=r?document.createElementNS(r,e):document.createElement(e);return Object.assign(i,t),n&&ec(i,n),i}function If(r){r.innerHTML=""}function ec(r,e){e.forEach(t=>r.appendChild(E2(t)?document.createTextNode(t):t))}function di(r){return Qn("style",{innerHTML:r})}function co(r,e){r.appendChild(document.createComment(e))}function MT(r,e){for(var t=r.parent;t!=null&&t.type!=e;)t=t.parent;return t}const Wp={ignoreHeight:!1,ignoreWidth:!1,ignoreFonts:!1,breakPages:!0,debug:!1,experimental:!1,className:"docx",inWrapper:!0,trimXmlDeclaration:!0,ignoreLastRenderedPageBreak:!0,renderHeaders:!0,renderFooters:!0,renderFootnotes:!0,renderEndnotes:!0,useBase64URL:!1,renderChanges:!1,renderComments:!1};function LT(r,e){const t={...Wp,...e};return Kc.load(r,new TT(t),t)}async function FT(r,e,t,n){const i={...Wp,...n},o=new NT(window.document);return o.render(r,e,t,i),Promise.allSettled(o.tasks)}async function CT(r,e,t,n){const i=await LT(r,n);return await FT(i,e,t,n),i}async function vl(r,e){const{arrayBuffer:t}=e,n=document.createElement("div"),i=document.createElement("style"),o=await CT(t,n,i,{useBase64URL:!0});console.log(o),r.executeSetHTML({main:n.innerHTML})}var Hc={},rs={},Or={};Object.defineProperty(Or,"__esModule",{value:!0});function AT(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var DT=function r(e,t){AT(this,r),this.data=e,this.text=t.text||e,this.options=t};Or.default=DT;Object.defineProperty(rs,"__esModule",{value:!0});rs.CODE39=void 0;var XT=function(){function r(e,t){for(var n=0;n=200){s=n.shift()-105;var l=Pr.SWAP[s];l!==void 0?a=e.next(n,i+1,l):((o===Pr.SET_A||o===Pr.SET_B)&&s===Pr.SHIFT&&(n[0]=o===Pr.SET_A?n[0]>95?n[0]-96:n[0]:n[0]<32?n[0]+96:n[0]),a=e.next(n,i+1,o))}else s=e.correctIndex(n,o),a=e.next(n,i+1,o);var c=e.getBar(s),u=s*i;return{result:c+a.result,checksum:u+a.checksum}}}]),e}(eP.default);Bi.default=oP;var Gc={};Object.defineProperty(Gc,"__esModule",{value:!0});var Dn=Ot,Kp=function(e){return e.match(new RegExp("^"+Dn.A_CHARS+"*"))[0].length},Hp=function(e){return e.match(new RegExp("^"+Dn.B_CHARS+"*"))[0].length},Bp=function(e){return e.match(new RegExp("^"+Dn.C_CHARS+"*"))[0]};function Jc(r,e){var t=e?Dn.A_CHARS:Dn.B_CHARS,n=r.match(new RegExp("^("+t+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(n)return n[1]+String.fromCharCode(204)+Gp(r.substring(n[1].length));var i=r.match(new RegExp("^"+t+"+"))[0];return i.length===r.length?r:i+String.fromCharCode(e?205:206)+Jc(r.substring(i.length),!e)}function Gp(r){var e=Bp(r),t=e.length;if(t===r.length)return r;r=r.substring(t);var n=Kp(r)>=Hp(r);return e+String.fromCharCode(n?206:205)+Jc(r,n)}Gc.default=function(r){var e=void 0,t=Bp(r).length;if(t>=2)e=Dn.C_START_CHAR+Gp(r);else{var n=Kp(r)>Hp(r);e=(n?Dn.A_START_CHAR:Dn.B_START_CHAR)+Jc(r,n)}return e.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(i,o){return String.fromCharCode(203)+o})};Object.defineProperty(Bc,"__esModule",{value:!0});var aP=Bi,sP=Jp(aP),lP=Gc,cP=Jp(lP);function Jp(r){return r&&r.__esModule?r:{default:r}}function uP(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function Sl(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function hP(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}var fP=function(r){hP(e,r);function e(t,n){if(uP(this,e),/^[\x00-\x7F\xC8-\xD3]+$/.test(t))var i=Sl(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,(0,cP.default)(t),n));else var i=Sl(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return Sl(i)}return e}(sP.default);Bc.default=fP;var zc={};Object.defineProperty(zc,"__esModule",{value:!0});var dP=function(){function r(e,t){for(var n=0;nn.width*10?n.width*10:n.fontSize,i.guardHeight=n.height+i.fontSize/2+n.textMargin,i}return BP(e,[{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,Ff.default)(n,i)}},{key:"rightText",value:function(n,i){return this.text.substr(n,i)}},{key:"rightEncode",value:function(n,i){return(0,Ff.default)(n,i)}},{key:"encodeGuarded",value:function(){var n={fontSize:this.fontSize},i={height:this.guardHeight};return[{data:pi.SIDE_BIN,options:i},{data:this.leftEncode(),text:this.leftText(),options:n},{data:pi.MIDDLE_BIN,options:i},{data:this.rightEncode(),text:this.rightText(),options:n},{data:pi.SIDE_BIN,options:i}]}},{key:"encodeFlat",value:function(){var n=[pi.SIDE_BIN,this.leftEncode(),pi.MIDDLE_BIN,this.rightEncode(),pi.SIDE_BIN];return{data:n.join(""),text:this.text}}}]),e}(zP.default);is.default=eE;Object.defineProperty(qc,"__esModule",{value:!0});var tE=function(){function r(e,t){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 WE(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{12}$/)!==-1&&this.data[11]==tc(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,gi.default)(this.data.substr(0,6),"LLLLLL"),n+="01010",n+=(0,gi.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,gi.default)(this.data[0],"L"),options:{height:this.guardHeight}}),n.push({data:(0,gi.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,gi.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),n.push({data:(0,gi.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}}]),e}(kE.default);function tc(r){var e=0,t;for(t=1;t<11;t+=2)e+=parseInt(r[t]);for(t=0;t<11;t+=2)e+=parseInt(r[t])*3;return(10-e%10)%10}Uo.default=HE;var nu={};Object.defineProperty(nu,"__esModule",{value:!0});var BE=function(){function r(e,t){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 BE(e,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var 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],o=r_[parseInt(i)][parseInt(n)];return(0,JE.default)(this.middleDigits,o)}}]),e}($E.default);function Df(r,e){for(var t=parseInt(r[r.length-1]),n=t_[t],i="",o=0,a=0;a=3&&this.number<=131070}}]),e}(AI.default);as.pharmacode=VI;var ss={};Object.defineProperty(ss,"__esModule",{value:!0});ss.codabar=void 0;var YI=function(){function r(e,t){for(var n=0;n0?e.fontSize+e.textMargin:0)+e.marginTop+e.marginBottom}function i1(r,e,t){if(t.displayValue&&ee&&(e=r[t].height);return e}function xN(r,e,t){var n;if(t)n=t;else if(typeof document!="undefined")n=document.createElement("canvas").getContext("2d");else return 0;n.font=e.fontOptions+" "+e.fontSize+"px "+e.font;var i=n.measureText(r);if(!i)return 0;var o=i.width;return o}Ir.getMaximumHeightOfEncodings=SN;Ir.getEncodingHeight=n1;Ir.getBarcodePadding=i1;Ir.calculateEncodingAttributes=yN;Ir.getTotalWidthOfEncodings=wN;Object.defineProperty(pu,"__esModule",{value:!0});var bN=function(){function r(e,t){for(var n=0;n0?(a=0,i.textAlign="left"):t.textAlign=="right"?(a=n.width-1,i.textAlign="right"):(a=n.width/2,i.textAlign="center"),i.fillText(n.text,a,s)}}},{key:"moveCanvasDrawing",value:function(t){var n=this.canvas.getContext("2d");n.translate(t.width,0)}},{key:"restoreCanvas",value:function(){var t=this.canvas.getContext("2d");t.restore()}}]),r}();pu.default=_N;var gu={};Object.defineProperty(gu,"__esModule",{value:!0});var IN=function(){function r(e,t){for(var n=0;n0&&(this.drawRect(l-n.width*s,a,n.width*s,n.height,t),s=0);s>0&&this.drawRect(l-n.width*(s-1),a,n.width*s,n.height,t)}},{key:"drawSVGText",value:function(t,n,i){var o=this.document.createElementNS(da,"text");if(n.displayValue){var a,s;o.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?(a=0,o.setAttribute("text-anchor","start")):n.textAlign=="right"?(a=i.width-1,o.setAttribute("text-anchor","end")):(a=i.width/2,o.setAttribute("text-anchor","middle")),o.setAttribute("x",a),o.setAttribute("y",s),o.appendChild(this.document.createTextNode(i.text)),t.appendChild(o)}}},{key:"setSvgAttributes",value:function(t,n){var i=this.svg;i.setAttribute("width",t+"px"),i.setAttribute("height",n+"px"),i.setAttribute("x","0px"),i.setAttribute("y","0px"),i.setAttribute("viewBox","0 0 "+t+" "+n),i.setAttribute("xmlns",da),i.setAttribute("version","1.1"),i.setAttribute("style","transform: translate(0,0)")}},{key:"createGroup",value:function(t,n,i){var o=this.document.createElementNS(da,"g");return o.setAttribute("transform","translate("+t+", "+n+")"),i.appendChild(o),o}},{key:"setGroupOptions",value:function(t,n){t.setAttribute("style","fill:"+n.lineColor+";")}},{key:"drawRect",value:function(t,n,i,o,a){var s=this.document.createElementNS(da,"rect");return s.setAttribute("x",t),s.setAttribute("y",n),s.setAttribute("width",i),s.setAttribute("height",o),a.appendChild(s),s}}]),r}();gu.default=CN;var Ru={};Object.defineProperty(Ru,"__esModule",{value:!0});var AN=function(){function r(e,t){for(var n=0;n=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Bt=function(){function r(){}return r.fill=function(e,t){for(var n=0,i=e.length;nn)throw new Xe("fromIndex("+t+") > toIndex("+n+")");if(t<0)throw new Qf(t);if(n>e)throw new Qf(n)},r.asList=function(){for(var e=[],t=0;t>1,s=n(t,e[a]);if(s>0)i=a+1;else if(s<0)o=a-1;else return a}return-i-1},r.numberComparator=function(e,t){return e-t},r}(),Ut=function(){function r(){}return r.numberOfTrailingZeros=function(e){var t;if(e===0)return 32;var n=31;return t=e<<16,t!==0&&(n-=16,e=t),t=e<<8,t!==0&&(n-=8,e=t),t=e<<4,t!==0&&(n-=4,e=t),t=e<<2,t!==0&&(n-=2,e=t),n-(e<<1>>>31)},r.numberOfLeadingZeros=function(e){if(e===0)return 32;var t=1;return e>>>16===0&&(t+=16,e<<=16),e>>>24===0&&(t+=8,e<<=8),e>>>28===0&&(t+=4,e<<=4),e>>>30===0&&(t+=2,e<<=2),t-=e>>>31,t},r.toHexString=function(e){return e.toString(16)},r.toBinaryString=function(e){return String(parseInt(String(e),2))},r.bitCount=function(e){return e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),e=e+(e>>>4)&252645135,e=e+(e>>>8),e=e+(e>>>16),e&63},r.truncDivision=function(e,t){return Math.trunc(e/t)},r.parseInt=function(e,t){return t===void 0&&(t=void 0),parseInt(e,t)},r.MIN_VALUE_32_BITS=-2147483648,r.MAX_VALUE=Number.MAX_SAFE_INTEGER,r}(),br=function(){function r(e,t){e===void 0?(this.size=0,this.bits=new Int32Array(1)):(this.size=e,t==null?this.bits=r.makeArray(e):this.bits=t)}return r.prototype.getSize=function(){return this.size},r.prototype.getSizeInBytes=function(){return Math.floor((this.size+7)/8)},r.prototype.ensureCapacity=function(e){if(e>this.bits.length*32){var t=r.makeArray(e);mt.arraycopy(this.bits,0,t,0,this.bits.length),this.bits=t}},r.prototype.get=function(e){return(this.bits[Math.floor(e/32)]&1<<(e&31))!==0},r.prototype.set=function(e){this.bits[Math.floor(e/32)]|=1<<(e&31)},r.prototype.flip=function(e){this.bits[Math.floor(e/32)]^=1<<(e&31)},r.prototype.getNextSet=function(e){var t=this.size;if(e>=t)return t;var n=this.bits,i=Math.floor(e/32),o=n[i];o&=~((1<<(e&31))-1);for(var a=n.length;o===0;){if(++i===a)return t;o=n[i]}var s=i*32+Ut.numberOfTrailingZeros(o);return s>t?t:s},r.prototype.getNextUnset=function(e){var t=this.size;if(e>=t)return t;var n=this.bits,i=Math.floor(e/32),o=~n[i];o&=~((1<<(e&31))-1);for(var a=n.length;o===0;){if(++i===a)return t;o=~n[i]}var s=i*32+Ut.numberOfTrailingZeros(o);return s>t?t:s},r.prototype.setBulk=function(e,t){this.bits[Math.floor(e/32)]=t},r.prototype.setRange=function(e,t){if(tthis.size)throw new Xe;if(t!==e){t--;for(var n=Math.floor(e/32),i=Math.floor(t/32),o=this.bits,a=n;a<=i;a++){var s=a>n?0:e&31,l=athis.size)throw new Xe;if(t===e)return!0;t--;for(var i=Math.floor(e/32),o=Math.floor(t/32),a=this.bits,s=i;s<=o;s++){var l=s>i?0:e&31,c=s32)throw new Xe("Num bits must be between 0 and 32");this.ensureCapacity(this.size+t);for(var n=t;n>0;n--)this.appendBit((e>>n-1&1)===1)},r.prototype.appendBitArray=function(e){var t=e.size;this.ensureCapacity(this.size+t);for(var n=0;n>1&1431655765|(a&1431655765)<<1,a=a>>2&858993459|(a&858993459)<<2,a=a>>4&252645135|(a&252645135)<<4,a=a>>8&16711935|(a&16711935)<<8,a=a>>16&65535|(a&65535)<<16,e[t-o]=a}if(this.size!==n*32){for(var s=n*32-this.size,l=e[0]>>>s,o=1;o>>s}e[n-1]=l}this.bits=e},r.makeArray=function(e){return new Int32Array(Math.floor((e+31)/32))},r.prototype.equals=function(e){if(!(e instanceof r))return!1;var t=e;return this.size===t.size&&Bt.equals(this.bits,t.bits)},r.prototype.hashCode=function(){return 31*this.size+Bt.hashCode(this.bits)},r.prototype.toString=function(){for(var e="",t=0,n=this.size;t=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},at;(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"})(at||(at={}));var Ht=function(){function r(e,t,n){for(var i,o,a=[],s=3;s=900)throw new Ee("incorect value");var t=r.VALUES_TO_ECI.get(e);if(t===void 0)throw new Ee("incorect value");return t},r.getCharacterSetECIByName=function(e){var t=r.NAME_TO_ECI.get(e);if(t===void 0)throw new Ee("incorect value");return t},r.prototype.equals=function(e){if(!(e instanceof r))return!1;var t=e;return this.getName()===t.getName()},r.VALUE_IDENTIFIER_TO_ECI=new Map,r.VALUES_TO_ECI=new Map,r.NAME_TO_ECI=new Map,r.Cp437=new r(at.Cp437,Int32Array.from([0,2]),"Cp437"),r.ISO8859_1=new r(at.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),r.ISO8859_2=new r(at.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),r.ISO8859_3=new r(at.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),r.ISO8859_4=new r(at.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),r.ISO8859_5=new r(at.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),r.ISO8859_6=new r(at.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),r.ISO8859_7=new r(at.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),r.ISO8859_8=new r(at.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),r.ISO8859_9=new r(at.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),r.ISO8859_10=new r(at.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),r.ISO8859_11=new r(at.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),r.ISO8859_13=new r(at.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),r.ISO8859_14=new r(at.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),r.ISO8859_15=new r(at.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),r.ISO8859_16=new r(at.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),r.SJIS=new r(at.SJIS,20,"SJIS","Shift_JIS"),r.Cp1250=new r(at.Cp1250,21,"Cp1250","windows-1250"),r.Cp1251=new r(at.Cp1251,22,"Cp1251","windows-1251"),r.Cp1252=new r(at.Cp1252,23,"Cp1252","windows-1252"),r.Cp1256=new r(at.Cp1256,24,"Cp1256","windows-1256"),r.UnicodeBigUnmarked=new r(at.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),r.UTF8=new r(at.UTF8,26,"UTF8","UTF-8"),r.ASCII=new r(at.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),r.Big5=new r(at.Big5,28,"Big5"),r.GB18030=new r(at.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),r.EUC_KR=new r(at.EUC_KR,30,"EUC_KR","EUC-KR"),r}(),MM=globalThis&&globalThis.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Pa=function(r){MM(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.kind="UnsupportedOperationException",e}(Tr),Yr=function(){function r(){}return r.decode=function(e,t){var n=this.encodingName(t);return this.customDecoder?this.customDecoder(e,n):typeof TextDecoder=="undefined"||this.shouldDecodeOnFallback(n)?this.decodeFallback(e,n):new TextDecoder(n).decode(e)},r.shouldDecodeOnFallback=function(e){return!r.isBrowser()&&e==="ISO-8859-1"},r.encode=function(e,t){var n=this.encodingName(t);return this.customEncoder?this.customEncoder(e,n):typeof TextEncoder=="undefined"?this.encodeFallback(e):new TextEncoder().encode(e)},r.isBrowser=function(){return typeof window!="undefined"&&{}.toString.call(window)==="[object Window]"},r.encodingName=function(e){return typeof e=="string"?e:e.getName()},r.encodingCharacterSet=function(e){return e instanceof Ht?e:Ht.getCharacterSetECIByName(e)},r.decodeFallback=function(e,t){var n=this.encodingCharacterSet(t);if(r.isDecodeFallbackSupported(n)){for(var i="",o=0,a=e.length;o3&&e[0]===239&&e[1]===187&&e[2]===191,x=0;x0?(T&128)===0?a=!1:s--:(T&128)!==0&&((T&64)===0?a=!1:(s++,(T&32)===0?l++:(s++,(T&16)===0?c++:(s++,(T&8)===0?u++:a=!1))))),i&&(T>127&&T<160?i=!1:T>159&&(T<192||T===215||T===247)&&R++),o&&(h>0?T<64||T===127||T>252?o=!1:h--:T===128||T===160||T>239?o=!1:T>160&&T<224?(d++,p=0,f++,f>g&&(g=f)):T>127?(h++,f=0,p++,p>v&&(v=p)):(f=0,p=0))}return a&&s>0&&(a=!1),o&&h>0&&(o=!1),a&&(m||l+c+u>0)?r.UTF8:o&&(r.ASSUME_SHIFT_JIS||g>=3||v>=3)?r.SHIFT_JIS:i&&o?g===2&&d===2||R*10>=n?r.SHIFT_JIS:r.ISO88591:i?r.ISO88591:o?r.SHIFT_JIS:a?r.UTF8:r.PLATFORM_DEFAULT_ENCODING},r.format=function(e){for(var t=[],n=1;na){if(s===-1)s=o-a;else if(o-a!==s)throw new Xe("row lengths do not match");a=o,l++}c++}else if(e.substring(c,c+t.length)===t)c+=t.length,i[o]=!0,o++;else if(e.substring(c,c+n.length)===n)c+=n.length,i[o]=!1,o++;else throw new Xe("illegal character encountered: "+e.substring(c));if(o>a){if(s===-1)s=o-a;else if(o-a!==s)throw new Xe("row lengths do not match");l++}for(var u=new r(s,l),h=0;h>>(e&31)&1)!==0},r.prototype.set=function(e,t){var n=t*this.rowSize+Math.floor(e/32);this.bits[n]|=1<<(e&31)&4294967295},r.prototype.unset=function(e,t){var n=t*this.rowSize+Math.floor(e/32);this.bits[n]&=~(1<<(e&31)&4294967295)},r.prototype.flip=function(e,t){var n=t*this.rowSize+Math.floor(e/32);this.bits[n]^=1<<(e&31)&4294967295},r.prototype.xor=function(e){if(this.width!==e.getWidth()||this.height!==e.getHeight()||this.rowSize!==e.getRowSize())throw new Xe("input matrix dimensions do not match");for(var t=new br(Math.floor(this.width/32)+1),n=this.rowSize,i=this.bits,o=0,a=this.height;othis.height||o>this.width)throw new Xe("The region must fit inside the matrix");for(var s=this.rowSize,l=this.bits,c=t;cl&&(l=c),u*32s){for(var d=31;h>>>d===0;)d--;u*32+d>s&&(s=u*32+d)}}}return s=0&&t[n]===0;)n--;if(n<0)return null;for(var i=Math.floor(n/e),o=Math.floor(n%e)*32,a=t[n],s=31;a>>>s===0;)s--;return o+=s,Int32Array.from([o,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(e){if(!(e instanceof r))return!1;var t=e;return this.width===t.width&&this.height===t.height&&this.rowSize===t.rowSize&&Bt.equals(this.bits,t.bits)},r.prototype.hashCode=function(){var e=this.width;return e=31*e+this.width,e=31*e+this.height,e=31*e+this.rowSize,e=31*e+Bt.hashCode(this.bits),e},r.prototype.toString=function(e,t,n){return e===void 0&&(e="X "),t===void 0&&(t=" "),n===void 0&&(n=` +`),this.buildToString(e,t,n)},r.prototype.buildToString=function(e,t,n){for(var i=new Ze,o=0,a=this.height;o>e.LUMINANCE_SHIFT]++;var c=e.estimateBlackPoint(s);if(o<3)for(var l=0;l>e.LUMINANCE_SHIFT]++}for(var f=e.estimateBlackPoint(a),p=t.getMatrix(),s=0;sa&&(o=s,a=t[s]),t[s]>i&&(i=t[s]);for(var l=0,c=0,s=0;sc&&(l=s,c=h)}if(o>l){var d=o;o=l,l=d}if(l-o<=n/16)throw new we;for(var f=l-1,p=-1,s=l-1;s>o;s--){var g=s-o,h=g*g*(l-s)*(i-t[s]);h>p&&(f=s,p=h)}return f<=e.MINIMUM_DIMENSION&&i>=e.MINIMUM_DIMENSION){var o=t.getMatrix(),a=n>>e.BLOCK_SIZE_POWER;(n&e.BLOCK_SIZE_MASK)!==0&&a++;var s=i>>e.BLOCK_SIZE_POWER;(i&e.BLOCK_SIZE_MASK)!==0&&s++;var l=e.calculateBlackPoints(o,a,s,n,i),c=new Sn(n,i);e.calculateThresholdForBlock(o,a,s,n,i,l,c),this.matrix=c}else this.matrix=r.prototype.getBlackMatrix.call(this);return this.matrix},e.prototype.createBinarizer=function(t){return new e(t)},e.calculateThresholdForBlock=function(t,n,i,o,a,s,l){for(var c=a-e.BLOCK_SIZE,u=o-e.BLOCK_SIZE,h=0;hc&&(d=c);for(var f=e.cap(h,2,i-3),p=0;pu&&(g=u);for(var v=e.cap(p,2,n-3),R=0,m=-2;m<=2;m++){var x=s[f+m];R+=x[v-2]+x[v-1]+x[v]+x[v+1]+x[v+2]}var T=R/25;e.thresholdBlock(t,g,d,T,o,l)}}},e.cap=function(t,n,i){return ti?i:t},e.thresholdBlock=function(t,n,i,o,a,s){for(var l=0,c=i*a+n;ls&&(h=s);for(var d=0;dl&&(f=l);for(var p=0,g=255,v=0,R=0,m=h*o+f;Rv&&(v=T)}if(v-g>e.MIN_DYNAMIC_RANGE)for(R++,m+=o;R>e.BLOCK_SIZE_POWER*2;if(v-g<=e.MIN_DYNAMIC_RANGE&&(P=g/2,u>0&&d>0)){var A=(c[u-1][d]+2*c[u][d-1]+c[u-1][d-1])/4;g>10}o[s]=c}else for(var a=0,s=0,p=t.length;a>10}o[s]=255-c}return o},e.prototype.getRow=function(t,n){if(t<0||t>=this.getHeight())throw new Xe("Requested row is outside the image: "+t);var i=this.getWidth(),o=t*i;return n===null?n=this.buffer.slice(o,o+i):(n.length0&&o[o.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},$i=function(){function r(e,t,n){t===void 0&&(t=500),this.reader=e,this.timeBetweenScansMillis=t,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(e){this._timeBetweenDecodingAttempts=e<0?0:e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"hints",{get:function(){return this._hints},set:function(e){this._hints=e||null},enumerable:!1,configurable:!0}),r.prototype.listVideoInputDevices=function(){return mr(this,void 0,void 0,function(){var e,t,n,i,o,a,s,l,c,u,h,d;return vr(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:e=f.sent(),t=[];try{for(n=VM(e),i=n.next();!i.done;i=n.next())o=i.value,a=o.kind==="video"?"videoinput":o.kind,a==="videoinput"&&(s=o.deviceId||o.id,l=o.label||"Video device "+(t.length+1),c=o.groupId,u={deviceId:s,label:l,kind:a,groupId:c},t.push(u))}catch(p){h={error:p}}finally{try{i&&!i.done&&(d=n.return)&&d.call(n)}finally{if(h)throw h.error}}return[2,t]}})})},r.prototype.getVideoInputDevices=function(){return mr(this,void 0,void 0,function(){var e;return vr(this,function(t){switch(t.label){case 0:return[4,this.listVideoInputDevices()];case 1:return e=t.sent(),[2,e.map(function(n){return new WM(n.deviceId,n.label)})]}})})},r.prototype.findDeviceById=function(e){return mr(this,void 0,void 0,function(){var t;return vr(this,function(n){switch(n.label){case 0:return[4,this.listVideoInputDevices()];case 1:return t=n.sent(),t?[2,t.find(function(i){return i.deviceId===e})]:[2,null]}})})},r.prototype.decodeFromInputVideoDevice=function(e,t){return mr(this,void 0,void 0,function(){return vr(this,function(n){switch(n.label){case 0:return[4,this.decodeOnceFromVideoDevice(e,t)];case 1:return[2,n.sent()]}})})},r.prototype.decodeOnceFromVideoDevice=function(e,t){return mr(this,void 0,void 0,function(){var n,i;return vr(this,function(o){switch(o.label){case 0:return this.reset(),e?n={deviceId:{exact:e}}:n={facingMode:"environment"},i={video:n},[4,this.decodeOnceFromConstraints(i,t)];case 1:return[2,o.sent()]}})})},r.prototype.decodeOnceFromConstraints=function(e,t){return mr(this,void 0,void 0,function(){var n;return vr(this,function(i){switch(i.label){case 0:return[4,navigator.mediaDevices.getUserMedia(e)];case 1:return n=i.sent(),[4,this.decodeOnceFromStream(n,t)];case 2:return[2,i.sent()]}})})},r.prototype.decodeOnceFromStream=function(e,t){return mr(this,void 0,void 0,function(){var n,i;return vr(this,function(o){switch(o.label){case 0:return this.reset(),[4,this.attachStreamToVideo(e,t)];case 1:return n=o.sent(),[4,this.decodeOnce(n)];case 2:return i=o.sent(),[2,i]}})})},r.prototype.decodeFromInputVideoDeviceContinuously=function(e,t,n){return mr(this,void 0,void 0,function(){return vr(this,function(i){switch(i.label){case 0:return[4,this.decodeFromVideoDevice(e,t,n)];case 1:return[2,i.sent()]}})})},r.prototype.decodeFromVideoDevice=function(e,t,n){return mr(this,void 0,void 0,function(){var i,o;return vr(this,function(a){switch(a.label){case 0:return e?i={deviceId:{exact:e}}:i={facingMode:"environment"},o={video:i},[4,this.decodeFromConstraints(o,t,n)];case 1:return[2,a.sent()]}})})},r.prototype.decodeFromConstraints=function(e,t,n){return mr(this,void 0,void 0,function(){var i;return vr(this,function(o){switch(o.label){case 0:return[4,navigator.mediaDevices.getUserMedia(e)];case 1:return i=o.sent(),[4,this.decodeFromStream(i,t,n)];case 2:return[2,o.sent()]}})})},r.prototype.decodeFromStream=function(e,t,n){return mr(this,void 0,void 0,function(){var i;return vr(this,function(o){switch(o.label){case 0:return this.reset(),[4,this.attachStreamToVideo(e,t)];case 1:return i=o.sent(),[4,this.decodeContinuously(i,n)];case 2:return[2,o.sent()]}})})},r.prototype.stopAsyncDecode=function(){this._stopAsyncDecode=!0},r.prototype.stopContinuousDecode=function(){this._stopContinuousDecode=!0},r.prototype.attachStreamToVideo=function(e,t){return mr(this,void 0,void 0,function(){var n;return vr(this,function(i){switch(i.label){case 0:return n=this.prepareVideoElement(t),this.addVideoSource(n,e),this.videoElement=n,this.stream=e,[4,this.playVideoOnLoadAsync(n)];case 1:return i.sent(),[2,n]}})})},r.prototype.playVideoOnLoadAsync=function(e){var t=this;return new Promise(function(n,i){return t.playVideoOnLoad(e,function(){return n()})})},r.prototype.playVideoOnLoad=function(e,t){var n=this;this.videoEndedListener=function(){return n.stopStreams()},this.videoCanPlayListener=function(){return n.tryPlayVideo(e)},e.addEventListener("ended",this.videoEndedListener),e.addEventListener("canplay",this.videoCanPlayListener),e.addEventListener("playing",t),this.tryPlayVideo(e)},r.prototype.isVideoPlaying=function(e){return e.currentTime>0&&!e.paused&&!e.ended&&e.readyState>2},r.prototype.tryPlayVideo=function(e){return mr(this,void 0,void 0,function(){return vr(this,function(t){switch(t.label){case 0:if(this.isVideoPlaying(e))return console.warn("Trying to play video that is already playing."),[2];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,e.play()];case 2:return t.sent(),[3,4];case 3:return t.sent(),console.warn("It was not possible to play the video."),[3,4];case 4:return[2]}})})},r.prototype.getMediaElement=function(e,t){var n=document.getElementById(e);if(!n)throw new Xt("element with id '"+e+"' not found");if(n.nodeName.toLowerCase()!==t.toLowerCase())throw new Xt("element with id '"+e+"' must be an "+t+" element");return n},r.prototype.decodeFromImage=function(e,t){if(!e&&!t)throw new Xt("either imageElement with a src set or an url must be provided");return t&&!e?this.decodeFromImageUrl(t):this.decodeFromImageElement(e)},r.prototype.decodeFromVideo=function(e,t){if(!e&&!t)throw new Xt("Either an element with a src set or an URL must be provided");return t&&!e?this.decodeFromVideoUrl(t):this.decodeFromVideoElement(e)},r.prototype.decodeFromVideoContinuously=function(e,t,n){if(e===void 0&&t===void 0)throw new Xt("Either an element with a src set or an URL must be provided");return t&&!e?this.decodeFromVideoUrlContinuously(t,n):this.decodeFromVideoElementContinuously(e,n)},r.prototype.decodeFromImageElement=function(e){if(!e)throw new Xt("An image element must be provided.");this.reset();var t=this.prepareImageElement(e);this.imageElement=t;var n;return this.isImageLoaded(t)?n=this.decodeOnce(t,!1,!0):n=this._decodeOnLoadImage(t),n},r.prototype.decodeFromVideoElement=function(e){var t=this._decodeFromVideoElementSetup(e);return this._decodeOnLoadVideo(t)},r.prototype.decodeFromVideoElementContinuously=function(e,t){var n=this._decodeFromVideoElementSetup(e);return this._decodeOnLoadVideoContinuously(n,t)},r.prototype._decodeFromVideoElementSetup=function(e){if(!e)throw new Xt("A video element must be provided.");this.reset();var t=this.prepareVideoElement(e);return this.videoElement=t,t},r.prototype.decodeFromImageUrl=function(e){if(!e)throw new Xt("An URL must be provided.");this.reset();var t=this.prepareImageElement();this.imageElement=t;var n=this._decodeOnLoadImage(t);return t.src=e,n},r.prototype.decodeFromVideoUrl=function(e){if(!e)throw new Xt("An URL must be provided.");this.reset();var t=this.prepareVideoElement(),n=this.decodeFromVideoElement(t);return t.src=e,n},r.prototype.decodeFromVideoUrlContinuously=function(e,t){if(!e)throw new Xt("An URL must be provided.");this.reset();var n=this.prepareVideoElement(),i=this.decodeFromVideoElementContinuously(n,t);return n.src=e,i},r.prototype._decodeOnLoadImage=function(e){var t=this;return new Promise(function(n,i){t.imageLoadedListener=function(){return t.decodeOnce(e,!1,!0).then(n,i)},e.addEventListener("load",t.imageLoadedListener)})},r.prototype._decodeOnLoadVideo=function(e){return mr(this,void 0,void 0,function(){return vr(this,function(t){switch(t.label){case 0:return[4,this.playVideoOnLoadAsync(e)];case 1:return t.sent(),[4,this.decodeOnce(e)];case 2:return[2,t.sent()]}})})},r.prototype._decodeOnLoadVideoContinuously=function(e,t){return mr(this,void 0,void 0,function(){return vr(this,function(n){switch(n.label){case 0:return[4,this.playVideoOnLoadAsync(e)];case 1:return n.sent(),this.decodeContinuously(e,t),[2]}})})},r.prototype.isImageLoaded=function(e){return!(!e.complete||e.naturalWidth===0)},r.prototype.prepareImageElement=function(e){var t;return typeof e=="undefined"&&(t=document.createElement("img"),t.width=200,t.height=200),typeof e=="string"&&(t=this.getMediaElement(e,"img")),e instanceof HTMLImageElement&&(t=e),t},r.prototype.prepareVideoElement=function(e){var t;return!e&&typeof document!="undefined"&&(t=document.createElement("video"),t.width=200,t.height=200),typeof e=="string"&&(t=this.getMediaElement(e,"video")),e instanceof HTMLVideoElement&&(t=e),t.setAttribute("autoplay","true"),t.setAttribute("muted","true"),t.setAttribute("playsinline","true"),t},r.prototype.decodeOnce=function(e,t,n){var i=this;t===void 0&&(t=!0),n===void 0&&(n=!0),this._stopAsyncDecode=!1;var o=function(a,s){if(i._stopAsyncDecode){s(new we("Video stream has ended before any code could be detected.")),i._stopAsyncDecode=void 0;return}try{var l=i.decode(e);a(l)}catch(d){var c=t&&d instanceof we,u=d instanceof Yt||d instanceof Ee,h=u&&n;if(c||h)return setTimeout(o,i._timeBetweenDecodingAttempts,a,s);s(d)}};return new Promise(function(a,s){return o(a,s)})},r.prototype.decodeContinuously=function(e,t){var n=this;this._stopContinuousDecode=!1;var i=function(){if(n._stopContinuousDecode){n._stopContinuousDecode=void 0;return}try{var o=n.decode(e);t(o,null),setTimeout(i,n.timeBetweenScansMillis)}catch(l){t(null,l);var a=l instanceof Yt||l instanceof Ee,s=l instanceof we;(a||s)&&setTimeout(i,n._timeBetweenDecodingAttempts)}};i()},r.prototype.decode=function(e){var t=this.createBinaryBitmap(e);return this.decodeBitmap(t)},r.prototype.createBinaryBitmap=function(e){this.getCaptureCanvasContext(e),e instanceof HTMLVideoElement?this.drawFrameOnCanvas(e):this.drawImageOnCanvas(e);var t=this.getCaptureCanvas(e),n=new UM(t),i=new f1(n);return new h1(i)},r.prototype.getCaptureCanvasContext=function(e){if(!this.captureCanvasContext){var t=this.getCaptureCanvas(e),n=void 0;try{n=t.getContext("2d",{willReadFrequently:!0})}catch{n=t.getContext("2d")}this.captureCanvasContext=n}return this.captureCanvasContext},r.prototype.getCaptureCanvas=function(e){if(!this.captureCanvas){var t=this.createCaptureCanvas(e);this.captureCanvas=t}return this.captureCanvas},r.prototype.drawFrameOnCanvas=function(e,t,n){t===void 0&&(t={sx:0,sy:0,sWidth:e.videoWidth,sHeight:e.videoHeight,dx:0,dy:0,dWidth:e.videoWidth,dHeight:e.videoHeight}),n===void 0&&(n=this.captureCanvasContext),n.drawImage(e,t.sx,t.sy,t.sWidth,t.sHeight,t.dx,t.dy,t.dWidth,t.dHeight)},r.prototype.drawImageOnCanvas=function(e,t,n){t===void 0&&(t={sx:0,sy:0,sWidth:e.naturalWidth,sHeight:e.naturalHeight,dx:0,dy:0,dWidth:e.naturalWidth,dHeight:e.naturalHeight}),n===void 0&&(n=this.captureCanvasContext),n.drawImage(e,t.sx,t.sy,t.sWidth,t.sHeight,t.dx,t.dy,t.dWidth,t.dHeight)},r.prototype.decodeBitmap=function(e){return this.reader.decode(e,this._hints)},r.prototype.createCaptureCanvas=function(e){if(typeof document=="undefined")return this._destroyCaptureCanvas(),null;var t=document.createElement("canvas"),n,i;return typeof e!="undefined"&&(e instanceof HTMLVideoElement?(n=e.videoWidth,i=e.videoHeight):e instanceof HTMLImageElement&&(n=e.naturalWidth||e.width,i=e.naturalHeight||e.height)),t.style.width=n+"px",t.style.height=i+"px",t.width=n,t.height=i,t},r.prototype.stopStreams=function(){this.stream&&(this.stream.getVideoTracks().forEach(function(e){return e.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(e,t){try{e.srcObject=t}catch{e.src=URL.createObjectURL(t)}},r.prototype.cleanVideoSource=function(e){try{e.srcObject=null}catch{e.src=""}this.videoElement.removeAttribute("src")},r}(),gr=function(){function r(e,t,n,i,o,a){n===void 0&&(n=t==null?0:8*t.length),a===void 0&&(a=mt.currentTimeMillis()),this.text=e,this.rawBytes=t,this.numBits=n,this.resultPoints=i,this.format=o,this.timestamp=a,this.text=e,this.rawBytes=t,n==null?this.numBits=t==null?0:8*t.length:this.numBits=n,this.resultPoints=i,this.format=o,this.resultMetadata=null,a==null?this.timestamp=mt.currentTimeMillis():this.timestamp=a}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(e,t){this.resultMetadata===null&&(this.resultMetadata=new Map),this.resultMetadata.set(e,t)},r.prototype.putAllMetadata=function(e){e!==null&&(this.resultMetadata===null?this.resultMetadata=e:this.resultMetadata=new Map(e))},r.prototype.addResultPoints=function(e){var t=this.resultPoints;if(t===null)this.resultPoints=e;else if(e!==null&&e.length>0){var n=new Array(t.length+e.length);mt.arraycopy(t,0,n,0,t.length),mt.arraycopy(e,0,n,t.length,e.length),this.resultPoints=n}},r.prototype.getTimestamp=function(){return this.timestamp},r.prototype.toString=function(){return this.text},r}(),oc;(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"})(oc||(oc={}));var De=oc,ac;(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"})(ac||(ac={}));var sr=ac,ds=function(){function r(e,t,n,i,o,a){o===void 0&&(o=-1),a===void 0&&(a=-1),this.rawBytes=e,this.text=t,this.byteSegments=n,this.ecLevel=i,this.structuredAppendSequenceNumber=o,this.structuredAppendParity=a,this.numBits=e==null?0:8*e.length}return r.prototype.getRawBytes=function(){return this.rawBytes},r.prototype.getNumBits=function(){return this.numBits},r.prototype.setNumBits=function(e){this.numBits=e},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(e){this.errorsCorrected=e},r.prototype.getErasures=function(){return this.erasures},r.prototype.setErasures=function(e){this.erasures=e},r.prototype.getOther=function(){return this.other},r.prototype.setOther=function(e){this.other=e},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}(),yo=function(){function r(){}return r.prototype.exp=function(e){return this.expTable[e]},r.prototype.log=function(e){if(e===0)throw new Xe;return this.logTable[e]},r.addOrSubtract=function(e,t){return e^t},r}(),Xn=function(){function r(e,t){if(t.length===0)throw new Xe;this.field=e;var n=t.length;if(n>1&&t[0]===0){for(var i=1;in.length){var i=t;t=n,n=i}var o=new Int32Array(n.length),a=n.length-t.length;mt.arraycopy(n,0,o,0,a);for(var s=a;s=e.getDegree()&&!i.isZero();){var s=i.getDegree()-e.getDegree(),l=t.multiply(i.getCoefficient(i.getDegree()),a),c=e.multiplyByMonomial(s,l),u=t.buildMonomial(s,l);n=n.addOrSubtract(u),i=i.addOrSubtract(c)}return[n,i]},r.prototype.toString=function(){for(var e="",t=this.getDegree();t>=0;t--){var n=this.getCoefficient(t);if(n!==0){if(n<0?(e+=" - ",n=-n):e.length>0&&(e+=" + "),t===0||n!==1){var i=this.field.log(n);i===0?e+="1":i===1?e+="a":(e+="a^",e+=i)}t!==0&&(t===1?e+="x":(e+="x^",e+=t))}}return e},r}(),YM=globalThis&&globalThis.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),d1=function(r){YM(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.kind="ArithmeticException",e}(Tr),kM=globalThis&&globalThis.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),yn=function(r){kM(e,r);function e(t,n,i){var o=r.call(this)||this;o.primitive=t,o.size=n,o.generatorBase=i;for(var a=new Int32Array(n),s=1,l=0;l=n&&(s^=t,s&=n-1);o.expTable=a;for(var c=new Int32Array(n),l=0;l=(n/2|0);){var u=a,h=l;if(a=s,l=c,a.isZero())throw new pa("r_{i-1} was zero");s=u;for(var d=o.getZero(),f=a.getCoefficient(a.getDegree()),p=o.inverse(f);s.getDegree()>=a.getDegree()&&!s.isZero();){var g=s.getDegree()-a.getDegree(),v=o.multiply(s.getCoefficient(s.getDegree()),p);d=d.addOrSubtract(o.buildMonomial(g,v)),s=s.addOrSubtract(a.multiplyByMonomial(g,v))}if(c=d.multiply(l).addOrSubtract(h),s.getDegree()>=a.getDegree())throw new ji("Division algorithm failed to reduce polynomial?")}var R=c.getCoefficient(0);if(R===0)throw new pa("sigmaTilde(0) was zero");var m=o.inverse(R),x=c.multiplyScalar(m),T=s.multiplyScalar(m);return[x,T]},r.prototype.findErrorLocations=function(e){var t=e.getDegree();if(t===1)return Int32Array.from([e.getCoefficient(1)]);for(var n=new Int32Array(t),i=0,o=this.field,a=1;a1,p,p+n-1),p+=n-1;else for(var g=n-1;g>=0;--g)f[p++]=(d&1<=8?r.readCode(e,t,8):r.readCode(e,t,n)<<8-n},r.convertBoolArrayToByteArray=function(e){for(var t=new Uint8Array((e.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}(),je=function(){function r(){}return r.round=function(e){return isNaN(e)?0:e<=Number.MIN_SAFE_INTEGER?Number.MIN_SAFE_INTEGER:e>=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:e+(e<0?-.5:.5)|0},r.distance=function(e,t,n,i){var o=e-n,a=t-i;return Math.sqrt(o*o+a*a)},r.sum=function(e){for(var t=0,n=0,i=e.length;n!==i;n++){var o=e[n];t+=o}return t},r}(),sc=function(){function r(){}return r.floatToIntBits=function(e){return e},r.MAX_VALUE=Number.MAX_SAFE_INTEGER,r}(),Me=function(){function r(e,t){this.x=e,this.y=t}return r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.equals=function(e){if(e instanceof r){var t=e;return this.x===t.x&&this.y===t.y}return!1},r.prototype.hashCode=function(){return 31*sc.floatToIntBits(this.x)+sc.floatToIntBits(this.y)},r.prototype.toString=function(){return"("+this.x+","+this.y+")"},r.orderBestPatterns=function(e){var t=this.distance(e[0],e[1]),n=this.distance(e[1],e[2]),i=this.distance(e[0],e[2]),o,a,s;if(n>=t&&n>=i?(a=e[0],o=e[1],s=e[2]):i>=n&&i>=t?(a=e[1],o=e[0],s=e[2]):(a=e[2],o=e[0],s=e[1]),this.crossProductZ(o,a,s)<0){var l=o;o=s,s=l}e[0]=o,e[1]=a,e[2]=s},r.distance=function(e,t){return je.distance(e.x,e.y,t.x,t.y)},r.crossProductZ=function(e,t,n){var i=t.x,o=t.y;return(n.x-i)*(e.y-o)-(n.y-o)*(e.x-i)},r}(),Ou=function(){function r(e,t){this.bits=e,this.points=t}return r.prototype.getBits=function(){return this.bits},r.prototype.getPoints=function(){return this.points},r}(),KM=globalThis&&globalThis.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),HM=function(r){KM(e,r);function e(t,n,i,o,a){var s=r.call(this,t,n)||this;return s.compact=i,s.nbDatablocks=o,s.nbLayers=a,s}return e.prototype.getNbLayers=function(){return this.nbLayers},e.prototype.getNbDatablocks=function(){return this.nbDatablocks},e.prototype.isCompact=function(){return this.compact},e}(Ou),lc=function(){function r(e,t,n,i){this.image=e,this.height=e.getHeight(),this.width=e.getWidth(),t==null&&(t=r.INIT_SIZE),n==null&&(n=e.getWidth()/2|0),i==null&&(i=e.getHeight()/2|0);var o=t/2|0;if(this.leftInit=n-o,this.rightInit=n+o,this.upInit=i-o,this.downInit=i+o,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new we}return r.prototype.detect=function(){for(var e=this.leftInit,t=this.rightInit,n=this.upInit,i=this.downInit,o=!1,a=!0,s=!1,l=!1,c=!1,u=!1,h=!1,d=this.width,f=this.height;a;){a=!1;for(var p=!0;(p||!l)&&t=d){o=!0;break}for(var g=!0;(g||!c)&&i=f){o=!0;break}for(var v=!0;(v||!u)&&e>=0;)v=this.containsBlackPoint(n,i,e,!1),v?(e--,a=!0,u=!0):u||e--;if(e<0){o=!0;break}for(var R=!0;(R||!h)&&n>=0;)R=this.containsBlackPoint(e,t,n,!0),R?(n--,a=!0,h=!0):h||n--;if(n<0){o=!0;break}a&&(s=!0)}if(!o&&s){for(var m=t-e,x=null,T=1;x===null&&Tn||l<-1||l>i)throw new we;o=!1,s===-1?(t[a]=0,o=!0):s===n&&(t[a]=n-1,o=!0),l===-1?(t[a+1]=0,o=!0):l===i&&(t[a+1]=i-1,o=!0)}o=!0;for(var a=t.length-2;a>=0&&o;a-=2){var s=Math.floor(t[a]),l=Math.floor(t[a+1]);if(s<-1||s>n||l<-1||l>i)throw new we;o=!1,s===-1?(t[a]=0,o=!0):s===n&&(t[a]=n-1,o=!0),l===-1?(t[a+1]=0,o=!0):l===i&&(t[a+1]=i-1,o=!0)}},r}(),p1=function(){function r(e,t,n,i,o,a,s,l,c){this.a11=e,this.a21=t,this.a31=n,this.a12=i,this.a22=o,this.a32=a,this.a13=s,this.a23=l,this.a33=c}return r.quadrilateralToQuadrilateral=function(e,t,n,i,o,a,s,l,c,u,h,d,f,p,g,v){var R=r.quadrilateralToSquare(e,t,n,i,o,a,s,l),m=r.squareToQuadrilateral(c,u,h,d,f,p,g,v);return m.times(R)},r.prototype.transformPoints=function(e){for(var t=e.length,n=this.a11,i=this.a12,o=this.a13,a=this.a21,s=this.a22,l=this.a23,c=this.a31,u=this.a32,h=this.a33,d=0;d>1&127):(i<<=10,i+=(a>>2&31<<5)+(a>>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(e,t){var n=0;e.forEach(function(o,a,s){var l=(o>>t-2<<1)+(o&1);n=(n<<3)+l}),n=((n&1)<<11)+(n>>1);for(var i=0;i<4;i++)if(Ut.bitCount(n^this.EXPECTED_CORNER_BITS[i])<=2)return i;throw new we},r.prototype.getCorrectedParameterData=function(e,t){var n,i;t?(n=7,i=2):(n=10,i=4);for(var o=n-i,a=new Int32Array(n),s=n-1;s>=0;--s)a[s]=e&15,e>>=4;try{var l=new ps(yn.AZTEC_PARAM);l.decode(a,o)}catch{throw new we}for(var c=0,s=0;s2){var h=this.distancePoint(u,s)*this.nbCenterLayers/(this.distancePoint(o,t)*(this.nbCenterLayers+2));if(h<.75||h>1.25||!this.isWhiteOrBlackRectangle(s,l,c,u))break}t=s,n=l,i=c,o=u,a=!a}if(this.nbCenterLayers!==5&&this.nbCenterLayers!==7)throw new we;this.compact=this.nbCenterLayers===5;var d=new Me(t.getX()+.5,t.getY()-.5),f=new Me(n.getX()+.5,n.getY()+.5),p=new Me(i.getX()-.5,i.getY()+.5),g=new Me(o.getX()-.5,o.getY()-.5);return this.expandSquare([d,f,p,g],2*this.nbCenterLayers-3,2*this.nbCenterLayers)},r.prototype.getMatrixCenter=function(){var e,t,n,i;try{var o=new lc(this.image).detect();e=o[0],t=o[1],n=o[2],i=o[3]}catch{var a=this.image.getWidth()/2,s=this.image.getHeight()/2;e=this.getFirstDifferent(new wr(a+7,s-7),!1,1,-1).toResultPoint(),t=this.getFirstDifferent(new wr(a+7,s+7),!1,1,1).toResultPoint(),n=this.getFirstDifferent(new wr(a-7,s+7),!1,-1,1).toResultPoint(),i=this.getFirstDifferent(new wr(a-7,s-7),!1,-1,-1).toResultPoint()}var l=je.round((e.getX()+i.getX()+t.getX()+n.getX())/4),c=je.round((e.getY()+i.getY()+t.getY()+n.getY())/4);try{var o=new lc(this.image,15,l,c).detect();e=o[0],t=o[1],n=o[2],i=o[3]}catch{e=this.getFirstDifferent(new wr(l+7,c-7),!1,1,-1).toResultPoint(),t=this.getFirstDifferent(new wr(l+7,c+7),!1,1,1).toResultPoint(),n=this.getFirstDifferent(new wr(l-7,c+7),!1,-1,1).toResultPoint(),i=this.getFirstDifferent(new wr(l-7,c-7),!1,-1,-1).toResultPoint()}return l=je.round((e.getX()+i.getX()+t.getX()+n.getX())/4),c=je.round((e.getY()+i.getY()+t.getY()+n.getY())/4),new wr(l,c)},r.prototype.getMatrixCornerPoints=function(e){return this.expandSquare(e,2*this.nbCenterLayers,this.getDimension())},r.prototype.sampleGrid=function(e,t,n,i,o){var a=Tu.getInstance(),s=this.getDimension(),l=s/2-this.nbCenterLayers,c=s/2+this.nbCenterLayers;return a.sampleGrid(e,s,s,l,l,c,l,c,c,l,c,t.getX(),t.getY(),n.getX(),n.getY(),i.getX(),i.getY(),o.getX(),o.getY())},r.prototype.sampleLine=function(e,t,n){for(var i=0,o=this.distanceResultPoint(e,t),a=o/n,s=e.getX(),l=e.getY(),c=a*(t.getX()-e.getX())/o,u=a*(t.getY()-e.getY())/o,h=0;h.1&&d<.9?0:d<=.1===c?1:-1},r.prototype.getFirstDifferent=function(e,t,n,i){for(var o=e.getX()+n,a=e.getY()+i;this.isValid(o,a)&&this.image.get(o,a)===t;)o+=n,a+=i;for(o-=n,a-=i;this.isValid(o,a)&&this.image.get(o,a)===t;)o+=n;for(o-=n;this.isValid(o,a)&&this.image.get(o,a)===t;)a+=i;return a-=i,new wr(o,a)},r.prototype.expandSquare=function(e,t,n){var i=n/(2*t),o=e[0].getX()-e[2].getX(),a=e[0].getY()-e[2].getY(),s=(e[0].getX()+e[2].getX())/2,l=(e[0].getY()+e[2].getY())/2,c=new Me(s+i*o,l+i*a),u=new Me(s-i*o,l-i*a);o=e[1].getX()-e[3].getX(),a=e[1].getY()-e[3].getY(),s=(e[1].getX()+e[3].getX())/2,l=(e[1].getY()+e[3].getY())/2;var h=new Me(s+i*o,l+i*a),d=new Me(s-i*o,l-i*a),f=[c,h,u,d];return f},r.prototype.isValid=function(e,t){return e>=0&&e0&&t>(a?8:5)),l;a?l=i:l=15;for(var c=Math.trunc(i/2),u=0;u=i)break;try{o=e.getBlackRow(f,o)}catch{continue}for(var p=function(m){if(m===1&&(o.reverse(),t&&t.get(vt.NEED_RESULT_POINT_CALLBACK)===!0)){var x=new Map;t.forEach(function(A,D){return x.set(D,A)}),x.delete(vt.NEED_RESULT_POINT_CALLBACK),t=x}try{var T=g.decodeRow(f,o,t);if(m===1){T.putMetadata(sr.ORIENTATION,180);var P=T.getResultPoints();P!==null&&(P[0]=new Me(n-P[0].getX()-1,P[0].getY()),P[1]=new Me(n-P[1].getX()-1,P[1].getY()))}return{value:T}}catch{}},g=this,v=0;v<2;v++){var R=p(v);if(typeof R=="object")return R.value}}throw new we},r.recordPattern=function(e,t,n){for(var i=n.length,o=0;o=a)throw new we;for(var s=!e.get(t),l=0,c=t;c0&&i>=0;)e.get(--t)!==o&&(i--,o=!o);if(i>=0)throw new we;r.recordPattern(e,t+1,n)},r.patternMatchVariance=function(e,t,n){for(var i=e.length,o=0,a=0,s=0;sd?h-d:d-h;if(f>n)return Number.POSITIVE_INFINITY;c+=f}return c/o},r}(),$M=globalThis&&globalThis.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Bf=function(r){$M(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.findStartPattern=function(t){for(var n=t.getSize(),i=t.getNextSet(0),o=0,a=Int32Array.from([0,0,0,0,0,0]),s=i,l=!1,c=6,u=i;u=0&&t.isRange(Math.max(0,s-(u-s)/2),s,!1))return Int32Array.from([s,u,d]);s+=a[0]+a[1],a=a.slice(2,a.length),a[o-1]=0,a[o]=0,o--}else o++;a[o]=1,l=!l}throw new we},e.decodeCode=function(t,n,i){Gt.recordPattern(t,i,n);for(var o=e.MAX_AVG_VARIANCE,a=-1,s=0;s=0)return a;throw new we},e.prototype.decodeRow=function(t,n,i){var o=i&&i.get(vt.ASSUME_GS1)===!0,a=e.findStartPattern(n),s=a[2],l=0,c=new Uint8Array(20);c[l++]=s;var u;switch(s){case e.CODE_START_A:u=e.CODE_CODE_A;break;case e.CODE_START_B:u=e.CODE_CODE_B;break;case e.CODE_START_C:u=e.CODE_CODE_C;break;default:throw new Ee}for(var h=!1,d=!1,f="",p=a[0],g=a[1],v=Int32Array.from([0,0,0,0,0,0]),R=0,m=0,x=s,T=0,P=!0,A=!1,D=!1;!h;){var W=d;switch(d=!1,R=m,m=e.decodeCode(n,v,g),c[l++]=m,m!==e.CODE_STOP&&(P=!0),m!==e.CODE_STOP&&(T++,x+=T*m),p=g,g+=v.reduce(function(F,Y){return F+Y},0),m){case e.CODE_START_A:case e.CODE_START_B:case e.CODE_START_C:throw new Ee}switch(u){case e.CODE_CODE_A:if(m<64)D===A?f+=String.fromCharCode(" ".charCodeAt(0)+m):f+=String.fromCharCode(" ".charCodeAt(0)+m+128),D=!1;else if(m<96)D===A?f+=String.fromCharCode(m-64):f+=String.fromCharCode(m+64),D=!1;else switch(m!==e.CODE_STOP&&(P=!1),m){case e.CODE_FNC_1:o&&(f.length===0?f+="]C1":f+=String.fromCharCode(29));break;case e.CODE_FNC_2:case e.CODE_FNC_3:break;case e.CODE_FNC_4_A:!A&&D?(A=!0,D=!1):A&&D?(A=!1,D=!1):D=!0;break;case e.CODE_SHIFT:d=!0,u=e.CODE_CODE_B;break;case e.CODE_CODE_B:u=e.CODE_CODE_B;break;case e.CODE_CODE_C:u=e.CODE_CODE_C;break;case e.CODE_STOP:h=!0;break}break;case e.CODE_CODE_B:if(m<96)D===A?f+=String.fromCharCode(" ".charCodeAt(0)+m):f+=String.fromCharCode(" ".charCodeAt(0)+m+128),D=!1;else switch(m!==e.CODE_STOP&&(P=!1),m){case e.CODE_FNC_1:o&&(f.length===0?f+="]C1":f+=String.fromCharCode(29));break;case e.CODE_FNC_2:case e.CODE_FNC_3:break;case e.CODE_FNC_4_B:!A&&D?(A=!0,D=!1):A&&D?(A=!1,D=!1):D=!0;break;case e.CODE_SHIFT:d=!0,u=e.CODE_CODE_A;break;case e.CODE_CODE_A:u=e.CODE_CODE_A;break;case e.CODE_CODE_C:u=e.CODE_CODE_C;break;case e.CODE_STOP:h=!0;break}break;case e.CODE_CODE_C:if(m<100)m<10&&(f+="0"),f+=m;else switch(m!==e.CODE_STOP&&(P=!1),m){case e.CODE_FNC_1:o&&(f.length===0?f+="]C1":f+=String.fromCharCode(29));break;case e.CODE_CODE_A:u=e.CODE_CODE_A;break;case e.CODE_CODE_B:u=e.CODE_CODE_B;break;case e.CODE_STOP:h=!0;break}break}W&&(u=u===e.CODE_CODE_A?e.CODE_CODE_B:e.CODE_CODE_A)}var _=g-p;if(g=n.getNextUnset(g),!n.isRange(g,Math.min(n.getSize(),g+(g-p)/2),!1))throw new we;if(x-=T*R,x%103!==R)throw new Yt;var Q=f.length;if(Q===0)throw new we;Q>0&&P&&(u===e.CODE_CODE_C?f=f.substring(0,Q-2):f=f.substring(0,Q-1));for(var te=(a[1]+a[0])/2,O=p+_/2,I=c.length,y=new Uint8Array(I),L=0;L=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Gf=function(r){jM(e,r);function e(t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var i=r.call(this)||this;return i.usingCheckDigit=t,i.extendedMode=n,i.decodeRowResult="",i.counters=new Int32Array(9),i}return e.prototype.decodeRow=function(t,n,i){var o,a,s,l,c=this.counters;c.fill(0),this.decodeRowResult="";var u=e.findAsteriskPattern(n,c),h=n.getNextSet(u[1]),d=n.getSize(),f,p;do{e.recordPattern(n,h,c);var g=e.toNarrowWidePattern(c);if(g<0)throw new we;f=e.patternToChar(g),this.decodeRowResult+=f,p=h;try{for(var v=(o=void 0,Tl(c)),R=v.next();!R.done;R=v.next()){var m=R.value;h+=m}}catch(I){o={error:I}}finally{try{R&&!R.done&&(a=v.return)&&a.call(v)}finally{if(o)throw o.error}}h=n.getNextSet(h)}while(f!=="*");this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var x=0;try{for(var T=Tl(c),P=T.next();!P.done;P=T.next()){var m=P.value;x+=m}}catch(I){s={error:I}}finally{try{P&&!P.done&&(l=T.return)&&l.call(T)}finally{if(s)throw s.error}}var A=h-p-x;if(h!==d&&A*2a&&(l=h)}}catch(g){n={error:g}}finally{try{u&&!u.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}a=l,s=0;for(var d=0,f=0,p=0;pa&&(f|=1<0;p++){var h=t[p];if(h>a&&(s--,h*2>=d))return-1}return f}}while(s>3);return-1},e.patternToChar=function(t){for(var n=0;n="A"&&s<="Z")l=String.fromCharCode(s.charCodeAt(0)+32);else throw new Ee;break;case"$":if(s>="A"&&s<="Z")l=String.fromCharCode(s.charCodeAt(0)-64);else throw new Ee;break;case"%":if(s>="A"&&s<="E")l=String.fromCharCode(s.charCodeAt(0)-38);else if(s>="F"&&s<="J")l=String.fromCharCode(s.charCodeAt(0)-11);else if(s>="K"&&s<="O")l=String.fromCharCode(s.charCodeAt(0)+16);else if(s>="P"&&s<="T")l=String.fromCharCode(s.charCodeAt(0)+43);else if(s==="U")l="\0";else if(s==="V")l="@";else if(s==="W")l="`";else if(s==="X"||s==="Y"||s==="Z")l="\x7F";else throw new Ee;break;case"/":if(s>="A"&&s<="O")l=String.fromCharCode(s.charCodeAt(0)-32);else if(s==="Z")l=":";else throw new Ee;break}i+=l,o++}else i+=a}return i},e.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%",e.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],e.ASTERISK_ENCODING=148,e}(Gt),qM=globalThis&&globalThis.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Pl=globalThis&&globalThis.__values||function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Jf=function(r){qM(e,r);function e(){var t=r.call(this)||this;return t.decodeRowResult="",t.counters=new Int32Array(6),t}return e.prototype.decodeRow=function(t,n,i){var o,a,s,l,c=this.findAsteriskPattern(n),u=n.getNextSet(c[1]),h=n.getSize(),d=this.counters;d.fill(0),this.decodeRowResult="";var f,p;do{e.recordPattern(n,u,d);var g=this.toPattern(d);if(g<0)throw new we;f=this.patternToChar(g),this.decodeRowResult+=f,p=u;try{for(var v=(o=void 0,Pl(d)),R=v.next();!R.done;R=v.next()){var m=R.value;u+=m}}catch(_){o={error:_}}finally{try{R&&!R.done&&(a=v.return)&&a.call(v)}finally{if(o)throw o.error}}u=n.getNextSet(u)}while(f!=="*");this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var x=0;try{for(var T=Pl(d),P=T.next();!P.done;P=T.next()){var m=P.value;x+=m}}catch(_){s={error:_}}finally{try{P&&!P.done&&(l=T.return)&&l.call(T)}finally{if(s)throw s.error}}if(u===h||!n.get(u))throw new we;if(this.decodeRowResult.length<2)throw new we;this.checkChecksums(this.decodeRowResult),this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-2);var A=this.decodeExtended(this.decodeRowResult),D=(c[1]+c[0])/2,W=p+x/2;return new gr(A,null,0,[new Me(D,t),new Me(W,t)],De.CODE_93,new Date().getTime())},e.prototype.findAsteriskPattern=function(t){var n=t.getSize(),i=t.getNextSet(0);this.counters.fill(0);for(var o=this.counters,a=i,s=!1,l=o.length,c=0,u=i;u4)return-1;if((h&1)===0)for(var f=0;f="a"&&a<="d"){if(o>=n-1)throw new Ee;var s=t.charAt(o+1),l="\0";switch(a){case"d":if(s>="A"&&s<="Z")l=String.fromCharCode(s.charCodeAt(0)+32);else throw new Ee;break;case"a":if(s>="A"&&s<="Z")l=String.fromCharCode(s.charCodeAt(0)-64);else throw new Ee;break;case"b":if(s>="A"&&s<="E")l=String.fromCharCode(s.charCodeAt(0)-38);else if(s>="F"&&s<="J")l=String.fromCharCode(s.charCodeAt(0)-11);else if(s>="K"&&s<="O")l=String.fromCharCode(s.charCodeAt(0)+16);else if(s>="P"&&s<="T")l=String.fromCharCode(s.charCodeAt(0)+43);else if(s==="U")l="\0";else if(s==="V")l="@";else if(s==="W")l="`";else if(s>="X"&&s<="Z")l=String.fromCharCode(127);else throw new Ee;break;case"c":if(s>="A"&&s<="O")l=String.fromCharCode(s.charCodeAt(0)-32);else if(s==="Z")l=":";else throw new Ee;break}i+=l,o++}else i+=a}return i},e.prototype.checkChecksums=function(t){var n=t.length;this.checkOneChecksum(t,n-2,20),this.checkOneChecksum(t,n-1,15)},e.prototype.checkOneChecksum=function(t,n,i){for(var o=1,a=0,s=n-1;s>=0;s--)a+=o*e.ALPHABET_STRING.indexOf(t.charAt(s)),++o>i&&(o=1);if(t.charAt(n)!==e.ALPHABET_STRING[a%47])throw new Yt},e.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%abcd*",e.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],e.ASTERISK_ENCODING=e.CHARACTER_ENCODINGS[47],e}(Gt),eL=globalThis&&globalThis.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),tL=globalThis&&globalThis.__values||function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")},zf=function(r){eL(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.narrowLineWidth=-1,t}return e.prototype.decodeRow=function(t,n,i){var o,a,s=this.decodeStart(n),l=this.decodeEnd(n),c=new Ze;e.decodeMiddle(n,s[1],l[0],c);var u=c.toString(),h=null;i!=null&&(h=i.get(vt.ALLOWED_LENGTHS)),h==null&&(h=e.DEFAULT_ALLOWED_LENGTHS);var d=u.length,f=!1,p=0;try{for(var g=tL(h),v=g.next();!v.done;v=g.next()){var R=v.value;if(d===R){f=!0;break}R>p&&(p=R)}}catch(T){o={error:T}}finally{try{v&&!v.done&&(a=g.return)&&a.call(g)}finally{if(o)throw o.error}}if(!f&&d>p&&(f=!0),!f)throw new Ee;var m=[new Me(s[1],t),new Me(l[0],t)],x=new gr(u,null,0,m,De.ITF,new Date().getTime());return x},e.decodeMiddle=function(t,n,i,o){var a=new Int32Array(10),s=new Int32Array(5),l=new Int32Array(5);for(a.fill(0),s.fill(0),l.fill(0);n0&&o>=0&&!t.get(o);o--)i--;if(i!==0)throw new we},e.skipWhiteSpace=function(t){var n=t.getSize(),i=t.getNextSet(0);if(i===n)throw new we;return i},e.prototype.decodeEnd=function(t){t.reverse();try{var n=e.skipWhiteSpace(t),i=void 0;try{i=e.findGuardPattern(t,n,e.END_PATTERN_REVERSED[0])}catch(a){a instanceof we&&(i=e.findGuardPattern(t,n,e.END_PATTERN_REVERSED[1]))}this.validateQuietZone(t,i[0]);var o=i[0];return i[0]=t.getSize()-i[1],i[1]=t.getSize()-o,i}finally{t.reverse()}},e.findGuardPattern=function(t,n,i){var o=i.length,a=new Int32Array(o),s=t.getSize(),l=!1,c=0,u=n;a.fill(0);for(var h=n;h=0)return i%10;throw new we},e.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])],e.MAX_AVG_VARIANCE=.38,e.MAX_INDIVIDUAL_VARIANCE=.5,e.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],e.START_PATTERN=Int32Array.from([1,1,1,1]),e.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])],e}(Gt),rL=globalThis&&globalThis.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Zi=function(r){rL(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.decodeRowStringBuffer="",t}return e.findStartGuardPattern=function(t){for(var n=!1,i,o=0,a=Int32Array.from([0,0,0]);!n;){a=Int32Array.from([0,0,0]),i=e.findGuardPattern(t,o,!1,this.START_END_PATTERN,a);var s=i[0];o=i[1];var l=s-(o-s);l>=0&&(n=t.isRange(l,s,!1))}return i},e.checkChecksum=function(t){return e.checkStandardUPCEANChecksum(t)},e.checkStandardUPCEANChecksum=function(t){var n=t.length;if(n===0)return!1;var i=parseInt(t.charAt(n-1),10);return e.getStandardUPCEANChecksum(t.substring(0,n-1))===i},e.getStandardUPCEANChecksum=function(t){for(var n=t.length,i=0,o=n-1;o>=0;o-=2){var a=t.charAt(o).charCodeAt(0)-"0".charCodeAt(0);if(a<0||a>9)throw new Ee;i+=a}i*=3;for(var o=n-2;o>=0;o-=2){var a=t.charAt(o).charCodeAt(0)-"0".charCodeAt(0);if(a<0||a>9)throw new Ee;i+=a}return(1e3-i)%10},e.decodeEnd=function(t,n){return e.findGuardPattern(t,n,!1,e.START_END_PATTERN,new Int32Array(e.START_END_PATTERN.length).fill(0))},e.findGuardPatternWithoutCounters=function(t,n,i,o){return this.findGuardPattern(t,n,i,o,new Int32Array(o.length))},e.findGuardPattern=function(t,n,i,o,a){var s=t.getSize();n=i?t.getNextUnset(n):t.getNextSet(n);for(var l=0,c=n,u=o.length,h=i,d=n;d=0)return s;throw new we},e.MAX_AVG_VARIANCE=.48,e.MAX_INDIVIDUAL_VARIANCE=.7,e.START_END_PATTERN=Int32Array.from([1,1,1]),e.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),e.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),e.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])],e}(Gt),nL=globalThis&&globalThis.__values||function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")},iL=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(e,t,n){var i=this.decodeRowStringBuffer,o=this.decodeMiddle(t,n,i),a=i.toString(),s=r.parseExtensionString(a),l=[new Me((n[0]+n[1])/2,e),new Me(o,e)],c=new gr(a,null,0,l,De.UPC_EAN_EXTENSION,new Date().getTime());return s!=null&&c.putAllMetadata(s),c},r.prototype.decodeMiddle=function(e,t,n){var i,o,a=this.decodeMiddleCounters;a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var s=e.getSize(),l=t[1],c=0,u=0;u<5&&l=10&&(c|=1<<4-u),u!==4&&(l=e.getNextSet(l),l=e.getNextUnset(l))}if(n.length!==5)throw new we;var g=this.determineCheckDigit(c);if(r.extensionChecksum(n.toString())!==g)throw new we;return l},r.extensionChecksum=function(e){for(var t=e.length,n=0,i=t-2;i>=0;i-=2)n+=e.charAt(i).charCodeAt(0)-"0".charCodeAt(0);n*=3;for(var i=t-1;i>=0;i-=2)n+=e.charAt(i).charCodeAt(0)-"0".charCodeAt(0);return n*=3,n%10},r.prototype.determineCheckDigit=function(e){for(var t=0;t<10;t++)if(e===this.CHECK_DIGIT_ENCODINGS[t])return t;throw new we},r.parseExtensionString=function(e){if(e.length!==5)return null;var t=r.parseExtension5String(e);return t==null?null:new Map([[sr.SUGGESTED_PRICE,t]])},r.parseExtension5String=function(e){var t;switch(e.charAt(0)){case"0":t="\xA3";break;case"5":t="$";break;case"9":switch(e){case"90000":return null;case"99991":return"0.00";case"99990":return"Used"}t="";break;default:t="";break}var n=parseInt(e.substring(1)),i=(n/100).toString(),o=n%100,a=o<10?"0"+o:o.toString();return t+i+"."+a},r}(),oL=globalThis&&globalThis.__values||function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")},aL=function(){function r(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return r.prototype.decodeRow=function(e,t,n){var i=this.decodeRowStringBuffer,o=this.decodeMiddle(t,n,i),a=i.toString(),s=r.parseExtensionString(a),l=[new Me((n[0]+n[1])/2,e),new Me(o,e)],c=new gr(a,null,0,l,De.UPC_EAN_EXTENSION,new Date().getTime());return s!=null&&c.putAllMetadata(s),c},r.prototype.decodeMiddle=function(e,t,n){var i,o,a=this.decodeMiddleCounters;a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var s=e.getSize(),l=t[1],c=0,u=0;u<2&&l=10&&(c|=1<<1-u),u!==1&&(l=e.getNextSet(l),l=e.getNextUnset(l))}if(n.length!==2)throw new we;if(parseInt(n.toString())%4!==c)throw new we;return l},r.parseExtensionString=function(e){return e.length!==2?null:new Map([[sr.ISSUE_NUMBER,parseInt(e)]])},r}(),sL=function(){function r(){}return r.decodeRow=function(e,t,n){var i=Zi.findGuardPattern(t,n,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{var o=new iL;return o.decodeRow(e,t,i)}catch{var a=new aL;return a.decodeRow(e,t,i)}},r.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]),r}(),lL=globalThis&&globalThis.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Kt=function(r){lL(e,r);function e(){var t=r.call(this)||this;t.decodeRowStringBuffer="",e.L_AND_G_PATTERNS=e.L_PATTERNS.map(function(s){return Int32Array.from(s)});for(var n=10;n<20;n++){for(var i=e.L_PATTERNS[n-10],o=new Int32Array(i.length),a=0;a=n.getSize()||!n.isRange(p,g,!1))throw new we;var v=u.toString();if(v.length<8)throw new Ee;if(!e.checkChecksum(v))throw new Yt;var R=(o[1]+o[0])/2,m=(d[1]+d[0])/2,x=this.getBarcodeFormat(),T=[new Me(R,t),new Me(m,t)],P=new gr(v,null,0,T,x,new Date().getTime()),A=0;try{var D=sL.decodeRow(t,n,d[1]);P.putMetadata(sr.UPC_EAN_EXTENSION,D.getText()),P.putAllMetadata(D.getResultMetadata()),P.addResultPoints(D.getResultPoints()),A=D.getText().length}catch{}var W=i==null?null:i.get(vt.ALLOWED_EAN_EXTENSIONS);if(W!=null){var _=!1;for(var Q in W)if(A.toString()===Q){_=!0;break}if(!_)throw new we}return x===De.EAN_13||De.UPC_A,P},e.checkChecksum=function(t){return e.checkStandardUPCEANChecksum(t)},e.checkStandardUPCEANChecksum=function(t){var n=t.length;if(n===0)return!1;var i=parseInt(t.charAt(n-1),10);return e.getStandardUPCEANChecksum(t.substring(0,n-1))===i},e.getStandardUPCEANChecksum=function(t){for(var n=t.length,i=0,o=n-1;o>=0;o-=2){var a=t.charAt(o).charCodeAt(0)-"0".charCodeAt(0);if(a<0||a>9)throw new Ee;i+=a}i*=3;for(var o=n-2;o>=0;o-=2){var a=t.charAt(o).charCodeAt(0)-"0".charCodeAt(0);if(a<0||a>9)throw new Ee;i+=a}return(1e3-i)%10},e.decodeEnd=function(t,n){return e.findGuardPattern(t,n,!1,e.START_END_PATTERN,new Int32Array(e.START_END_PATTERN.length).fill(0))},e}(Zi),cL=globalThis&&globalThis.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),$f=globalThis&&globalThis.__values||function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")},cc=function(r){cL(e,r);function e(){var t=r.call(this)||this;return t.decodeMiddleCounters=Int32Array.from([0,0,0,0]),t}return e.prototype.decodeMiddle=function(t,n,i){var o,a,s,l,c=this.decodeMiddleCounters;c[0]=0,c[1]=0,c[2]=0,c[3]=0;for(var u=t.getSize(),h=n[1],d=0,f=0;f<6&&h=10&&(d|=1<<5-f)}i=e.determineFirstDigit(i,d);var m=Kt.findGuardPattern(t,h,!0,Kt.MIDDLE_PATTERN,new Int32Array(Kt.MIDDLE_PATTERN.length).fill(0));h=m[1];for(var f=0;f<6&&h=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},qf=function(r){uL(e,r);function e(){var t=r.call(this)||this;return t.decodeMiddleCounters=Int32Array.from([0,0,0,0]),t}return e.prototype.decodeMiddle=function(t,n,i){var o,a,s,l,c=this.decodeMiddleCounters;c[0]=0,c[1]=0,c[2]=0,c[3]=0;for(var u=t.getSize(),h=n[1],d=0;d<4&&h=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},td=function(r){fL(e,r);function e(){var t=r.call(this)||this;return t.decodeMiddleCounters=new Int32Array(4),t}return e.prototype.decodeMiddle=function(t,n,i){var o,a,s=this.decodeMiddleCounters.map(function(v){return v});s[0]=0,s[1]=0,s[2]=0,s[3]=0;for(var l=t.getSize(),c=n[1],u=0,h=0;h<6&&c=10&&(u|=1<<5-h)}return e.determineNumSysAndCheckDigit(new Ze(i),u),c},e.prototype.decodeEnd=function(t,n){return e.findGuardPatternWithoutCounters(t,n,!0,e.MIDDLE_END_PATTERN)},e.prototype.checkChecksum=function(t){return Kt.checkChecksum(e.convertUPCEtoUPCA(t))},e.determineNumSysAndCheckDigit=function(t,n){for(var i=0;i<=1;i++)for(var o=0;o<10;o++)if(n===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[i][o]){t.insert(0,"0"+i),t.append("0"+o);return}throw we.getNotFoundInstance()},e.prototype.getBarcodeFormat=function(){return De.UPC_E},e.convertUPCEtoUPCA=function(t){var n=t.slice(1,7).split("").map(function(a){return a.charCodeAt(0)}),i=new Ze;i.append(t.charAt(0));var o=n[5];switch(o){case 0:case 1:case 2:i.appendChars(n,0,2),i.append(o),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(o);break}return t.length>=8&&i.append(t.charAt(7)),i.toString()},e.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),e.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])],e}(Kt),pL=globalThis&&globalThis.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),rd=globalThis&&globalThis.__values||function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")},El=function(r){pL(e,r);function e(t){var n=r.call(this)||this,i=t==null?null:t.get(vt.POSSIBLE_FORMATS),o=[];return i!=null&&(i.indexOf(De.EAN_13)>-1&&o.push(new cc),i.indexOf(De.UPC_A)>-1&&o.push(new ed),i.indexOf(De.EAN_8)>-1&&o.push(new qf),i.indexOf(De.UPC_E)>-1&&o.push(new td)),o.length===0&&(o.push(new cc),o.push(new ed),o.push(new qf),o.push(new td)),n.readers=o,n}return e.prototype.decodeRow=function(t,n,i){var o,a;try{for(var s=rd(this.readers),l=s.next();!l.done;l=s.next()){var c=l.value;try{var u=c.decodeRow(t,n,i),h=u.getBarcodeFormat()===De.EAN_13&&u.getText().charAt(0)==="0",d=i==null?null:i.get(vt.POSSIBLE_FORMATS),f=d==null||d.includes(De.UPC_A);if(h&&f){var p=u.getRawBytes(),g=new gr(u.getText().substring(1),p,p?p.length:null,u.getResultPoints(),De.UPC_A);return g.putAllMetadata(u.getResultMetadata()),g}return u}catch{}}}catch(v){o={error:v}}finally{try{l&&!l.done&&(a=s.return)&&a.call(s)}finally{if(o)throw o.error}}throw new we},e.prototype.reset=function(){var t,n;try{for(var i=rd(this.readers),o=i.next();!o.done;o=i.next()){var a=o.value;a.reset()}}catch(s){t={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}},e}(Gt),gL=globalThis&&globalThis.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),RL=function(r){gL(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.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"},t}return e.prototype.decodeRow=function(t,n,i){var o=this.getValidRowData(n);if(!o)throw new we;var a=this.codaBarDecodeRow(o.row);if(!a)throw new we;return new gr(a,null,0,[new Me(o.left,t),new Me(o.right,t)],De.CODABAR,new Date().getTime())},e.prototype.getValidRowData=function(t){var n=t.toArray(),i=n.indexOf(!0);if(i===-1)return null;var o=n.lastIndexOf(!0);if(o<=i)return null;n=n.slice(i,o+1);for(var a=[],s=n[0],l=1,c=1;c0;){var o=t.splice(0,8).splice(0,7),a=o.map(function(l){return l=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Kn=function(r){mL(e,r);function e(){var t=r.call(this)||this;return t.decodeFinderCounters=new Int32Array(4),t.dataCharacterCounters=new Int32Array(8),t.oddRoundingErrors=new Array(4),t.evenRoundingErrors=new Array(4),t.oddCounts=new Array(t.dataCharacterCounters.length/2),t.evenCounts=new Array(t.dataCharacterCounters.length/2),t}return e.prototype.getDecodeFinderCounters=function(){return this.decodeFinderCounters},e.prototype.getDataCharacterCounters=function(){return this.dataCharacterCounters},e.prototype.getOddRoundingErrors=function(){return this.oddRoundingErrors},e.prototype.getEvenRoundingErrors=function(){return this.evenRoundingErrors},e.prototype.getOddCounts=function(){return this.oddCounts},e.prototype.getEvenCounts=function(){return this.evenCounts},e.prototype.parseFinderValue=function(t,n){for(var i=0;io&&(o=n[a],i=a);t[i]++},e.decrement=function(t,n){for(var i=0,o=n[0],a=1;a=e.MIN_FINDER_PATTERN_RATIO&&s<=e.MAX_FINDER_PATTERN_RATIO){var l=Number.MAX_SAFE_INTEGER,c=Number.MIN_SAFE_INTEGER;try{for(var u=vL(t),h=u.next();!h.done;h=u.next()){var d=h.value;d>c&&(c=d),d=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},xi=function(){function r(){}return r.getRSSvalue=function(e,t,n){var i,o,a=0;try{for(var s=yL(e),l=s.next();!l.done;l=s.next()){var c=l.value;a+=c}}catch(m){i={error:m}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}for(var u=0,h=0,d=e.length,f=0;f=d-f-1&&(g-=r.combins(a-p-(d-f),d-f-2)),d-f-1>1){for(var v=0,R=a-p-(d-f-2);R>t;R--)v+=r.combins(a-p-R-1,d-f-3);g-=v*(d-1-f)}else a-p>t&&g--;u+=g}a-=p}return u},r.combins=function(e,t){var n,i;e-t>t?(i=t,n=e-t):(i=e-t,n=t);for(var o=1,a=1,s=e;s>n;s--)o*=s,a<=i&&(o/=a,a++);for(;a<=i;)o/=a,a++;return o},r}(),wL=function(){function r(){}return r.buildBitArray=function(e){var t=e.length*2-1;e[e.length-1].getRightChar()==null&&(t-=1);for(var n=12*t,i=new br(n),o=0,a=e[0],s=a.getRightChar().getValue(),l=11;l>=0;--l)(s&1<=0;--h)(u&1<=0;--h)(d&1<10||i<0||i>10)throw new Ee;return o.firstDigit=n,o.secondDigit=i,o}return e.prototype.getFirstDigit=function(){return this.firstDigit},e.prototype.getSecondDigit=function(){return this.secondDigit},e.prototype.getValue=function(){return this.firstDigit*10+this.secondDigit},e.prototype.isFirstDigitFNC1=function(){return this.firstDigit===e.FNC1},e.prototype.isSecondDigitFNC1=function(){return this.secondDigit===e.FNC1},e.prototype.isAnyFNC1=function(){return this.firstDigit===e.FNC1||this.secondDigit===e.FNC1},e.FNC1=10,e}(Pu),ga=globalThis&&globalThis.__values||function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")},OL=function(){function r(){}return r.parseFieldsInGeneralPurpose=function(e){var t,n,i,o,a,s,l,c;if(!e)return null;if(e.length<2)throw new we;var u=e.substring(0,2);try{for(var h=ga(r.TWO_DIGIT_DATA_LENGTH),d=h.next();!d.done;d=h.next()){var f=d.value;if(f[0]===u)return f[1]===r.VARIABLE_LENGTH?r.processVariableAI(2,f[2],e):r.processFixedAI(2,f[1],e)}}catch(A){t={error:A}}finally{try{d&&!d.done&&(n=h.return)&&n.call(h)}finally{if(t)throw t.error}}if(e.length<3)throw new we;var p=e.substring(0,3);try{for(var g=ga(r.THREE_DIGIT_DATA_LENGTH),v=g.next();!v.done;v=g.next()){var f=v.value;if(f[0]===p)return f[1]===r.VARIABLE_LENGTH?r.processVariableAI(3,f[2],e):r.processFixedAI(3,f[1],e)}}catch(A){i={error:A}}finally{try{v&&!v.done&&(o=g.return)&&o.call(g)}finally{if(i)throw i.error}}try{for(var R=ga(r.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH),m=R.next();!m.done;m=R.next()){var f=m.value;if(f[0]===p)return f[1]===r.VARIABLE_LENGTH?r.processVariableAI(4,f[2],e):r.processFixedAI(4,f[1],e)}}catch(A){a={error:A}}finally{try{m&&!m.done&&(s=R.return)&&s.call(R)}finally{if(a)throw a.error}}if(e.length<4)throw new we;var x=e.substring(0,4);try{for(var T=ga(r.FOUR_DIGIT_DATA_LENGTH),P=T.next();!P.done;P=T.next()){var f=P.value;if(f[0]===x)return f[1]===r.VARIABLE_LENGTH?r.processVariableAI(4,f[2],e):r.processFixedAI(4,f[1],e)}}catch(A){l={error:A}}finally{try{P&&!P.done&&(c=T.return)&&c.call(T)}finally{if(l)throw l.error}}throw new we},r.processFixedAI=function(e,t,n){if(n.lengththis.information.getSize())return e+4<=this.information.getSize();for(var t=e;tthis.information.getSize()){var t=this.extractNumericValueFromBitArray(e,4);return t===0?new mi(this.information.getSize(),mi.FNC1,mi.FNC1):new mi(this.information.getSize(),t-1,mi.FNC1)}var n=this.extractNumericValueFromBitArray(e,7),i=(n-8)/11,o=(n-8)%11;return new mi(e+7,i,o)},r.prototype.extractNumericValueFromBitArray=function(e,t){return r.extractNumericValueFromBitArray(this.information,e,t)},r.extractNumericValueFromBitArray=function(e,t,n){for(var i=0,o=0;othis.information.getSize())return!1;var t=this.extractNumericValueFromBitArray(e,5);if(t>=5&&t<16)return!0;if(e+7>this.information.getSize())return!1;var n=this.extractNumericValueFromBitArray(e,7);if(n>=64&&n<116)return!0;if(e+8>this.information.getSize())return!1;var i=this.extractNumericValueFromBitArray(e,8);return i>=232&&i<253},r.prototype.decodeIsoIec646=function(e){var t=this.extractNumericValueFromBitArray(e,5);if(t===15)return new Kr(e+5,Kr.FNC1);if(t>=5&&t<15)return new Kr(e+5,"0"+(t-5));var n=this.extractNumericValueFromBitArray(e,7);if(n>=64&&n<90)return new Kr(e+7,""+(n+1));if(n>=90&&n<116)return new Kr(e+7,""+(n+7));var i=this.extractNumericValueFromBitArray(e,8),o;switch(i){case 232:o="!";break;case 233:o='"';break;case 234:o="%";break;case 235:o="&";break;case 236:o="'";break;case 237:o="(";break;case 238:o=")";break;case 239:o="*";break;case 240:o="+";break;case 241:o=",";break;case 242:o="-";break;case 243:o=".";break;case 244:o="/";break;case 245:o=":";break;case 246:o=";";break;case 247:o="<";break;case 248:o="=";break;case 249:o=">";break;case 250:o="?";break;case 251:o="_";break;case 252:o=" ";break;default:throw new Ee}return new Kr(e+8,o)},r.prototype.isStillAlpha=function(e){if(e+5>this.information.getSize())return!1;var t=this.extractNumericValueFromBitArray(e,5);if(t>=5&&t<16)return!0;if(e+6>this.information.getSize())return!1;var n=this.extractNumericValueFromBitArray(e,6);return n>=16&&n<63},r.prototype.decodeAlphanumeric=function(e){var t=this.extractNumericValueFromBitArray(e,5);if(t===15)return new Kr(e+5,Kr.FNC1);if(t>=5&&t<15)return new Kr(e+5,"0"+(t-5));var n=this.extractNumericValueFromBitArray(e,6);if(n>=32&&n<58)return new Kr(e+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 ji("Decoding invalid alphanumeric value: "+n)}return new Kr(e+6,i)},r.prototype.isAlphaTo646ToAlphaLatch=function(e){if(e+1>this.information.getSize())return!1;for(var t=0;t<5&&t+ethis.information.getSize())return!1;for(var t=e;tthis.information.getSize())return!1;for(var t=0;t<4&&t+e=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},QL=function(r){ZL(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.pairs=new Array(e.MAX_PAIRS),t.rows=new Array,t.startEnd=[2],t}return e.prototype.decodeRow=function(t,n,i){this.pairs.length=0,this.startFromEven=!1;try{return e.constructResult(this.decodeRow2pairs(t,n))}catch{}return this.pairs.length=0,this.startFromEven=!0,e.constructResult(this.decodeRow2pairs(t,n))},e.prototype.reset=function(){this.pairs.length=0,this.rows.length=0},e.prototype.decodeRow2pairs=function(t,n){for(var i=!1;!i;)try{this.pairs.push(this.retrieveNextPair(n,this.pairs,t))}catch(s){if(s instanceof we){if(!this.pairs.length)throw new we;i=!0}}if(this.checkChecksum())return this.pairs;var o;if(this.rows.length?o=!0:o=!1,this.storeRow(t,!1),o){var a=this.checkRowsBoolean(!1);if(a!=null||(a=this.checkRowsBoolean(!0),a!=null))return a}throw new we},e.prototype.checkRowsBoolean=function(t){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,t&&(this.rows=this.rows.reverse());var n=null;try{n=this.checkRows(new Array,0)}catch(i){console.log(i)}return t&&(this.rows=this.rows.reverse()),n},e.prototype.checkRows=function(t,n){for(var i,o,a=n;as.length)){for(var l=!0,c=0;ct){a=s.isEquivalent(this.pairs);break}o=s.isEquivalent(this.pairs),i++}a||o||e.isPartialRow(this.pairs,this.rows)||(this.rows.push(i,new kL(this.pairs,t,n)),this.removePartialRows(this.pairs,this.rows))},e.prototype.removePartialRows=function(t,n){var i,o,a,s,l,c;try{for(var u=En(n),h=u.next();!h.done;h=u.next()){var d=h.value;if(d.getPairs().length!==t.length){var f=!0;try{for(var p=(a=void 0,En(d.getPairs())),g=p.next();!g.done;g=p.next()){var v=g.value,R=!1;try{for(var m=(l=void 0,En(t)),x=m.next();!x.done;x=m.next()){var T=x.value;if(nd.equals(v,T)){R=!0;break}}}catch(P){l={error:P}}finally{try{x&&!x.done&&(c=m.return)&&c.call(m)}finally{if(l)throw l.error}}R||(f=!1)}}catch(P){a={error:P}}finally{try{g&&!g.done&&(s=p.return)&&s.call(p)}finally{if(a)throw a.error}}}}}catch(P){i={error:P}}finally{try{h&&!h.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}},e.isPartialRow=function(t,n){var i,o,a,s,l,c;try{for(var u=En(n),h=u.next();!h.done;h=u.next()){var d=h.value,f=!0;try{for(var p=(a=void 0,En(t)),g=p.next();!g.done;g=p.next()){var v=g.value,R=!1;try{for(var m=(l=void 0,En(d.getPairs())),x=m.next();!x.done;x=m.next()){var T=x.value;if(v.equals(T)){R=!0;break}}}catch(P){l={error:P}}finally{try{x&&!x.done&&(c=m.return)&&c.call(m)}finally{if(l)throw l.error}}if(!R){f=!1;break}}}catch(P){a={error:P}}finally{try{g&&!g.done&&(s=p.return)&&s.call(p)}finally{if(a)throw a.error}}if(f)return!0}}catch(P){i={error:P}}finally{try{h&&!h.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}return!1},e.prototype.getRows=function(){return this.rows},e.constructResult=function(t){var n=wL.buildBitArray(t),i=YL(n),o=i.parseInformation(),a=t[0].getFinderPattern().getResultPoints(),s=t[t.length-1].getFinderPattern().getResultPoints(),l=[a[0],a[1],s[0],s[1]];return new gr(o,null,null,l,De.RSS_EXPANDED,null)},e.prototype.checkChecksum=function(){var t=this.pairs.get(0),n=t.getLeftChar(),i=t.getRightChar();if(i===null)return!1;for(var o=i.getChecksumPortion(),a=2,s=1;s=0)s=i;else if(this.isEmptyPair(n))s=0;else{var l=n[n.length-1];s=l.getFinderPattern().getStartEnd()[1]}var c=n.length%2!==0;this.startFromEven&&(c=!c);for(var u=!1;s=0&&!t.get(l);)l--;l++,o=this.startEnd[0]-l,a=l,s=this.startEnd[1]}else a=this.startEnd[0],s=t.getNextUnset(this.startEnd[1]+1),o=s-this.startEnd[1];var c=this.getDecodeFinderCounters();mt.arraycopy(c,0,c,1,c.length-1),c[0]=o;var u;try{u=this.parseFinderValue(c,e.FINDER_PATTERNS)}catch{return null}return new g1(u,[a,s],a,s,n)},e.prototype.decodeDataCharacter=function(t,n,i,o){for(var a=this.getDataCharacterCounters(),s=0;s.3)throw new we;for(var p=this.getOddCounts(),g=this.getEvenCounts(),v=this.getOddRoundingErrors(),R=this.getEvenRoundingErrors(),l=0;l8){if(m>8.7)throw new we;x=8}var T=l/2;(l&1)===0?(p[T]=x,v[T]=m-x):(g[T]=x,R[T]=m-x)}this.adjustOddEvenCounts(h);for(var P=4*n.getValue()+(i?0:2)+(o?0:1)-1,A=0,D=0,l=p.length-1;l>=0;l--){if(e.isNotA1left(n,i,o)){var W=e.WEIGHTS[P][2*l];D+=p[l]*W}A+=p[l]}for(var _=0,l=g.length-1;l>=0;l--)if(e.isNotA1left(n,i,o)){var W=e.WEIGHTS[P][2*l+1];_+=g[l]*W}var Q=D+_;if((A&1)!==0||A>13||A<4)throw new we;var te=(13-A)/2,O=e.SYMBOL_WIDEST[te],I=9-O,y=xi.getRSSvalue(p,O,!0),L=xi.getRSSvalue(g,I,!1),k=e.EVEN_TOTAL_SUBSET[te],F=e.GSUM[te],Y=y*k+L+F;return new Za(Y,Q)},e.isNotA1left=function(t,n,i){return!(t.getValue()===0&&n&&i)},e.prototype.adjustOddEvenCounts=function(t){var n=je.sum(new Int32Array(this.getOddCounts())),i=je.sum(new Int32Array(this.getEvenCounts())),o=!1,a=!1;n>13?a=!0:n<4&&(o=!0);var s=!1,l=!1;i>13?l=!0:i<4&&(s=!0);var c=n+i-t,u=(n&1)===1,h=(i&1)===0;if(c===1)if(u){if(h)throw new we;a=!0}else{if(!h)throw new we;l=!0}else if(c===-1)if(u){if(h)throw new we;o=!0}else{if(!h)throw new we;s=!0}else if(c===0){if(u){if(!h)throw new we;n=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},id=function(r){BL(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.possibleLeftPairs=[],t.possibleRightPairs=[],t}return e.prototype.decodeRow=function(t,n,i){var o,a,s,l,c=this.decodePair(n,!1,t,i);e.addOrTally(this.possibleLeftPairs,c),n.reverse();var u=this.decodePair(n,!0,t,i);e.addOrTally(this.possibleRightPairs,u),n.reverse();try{for(var h=_l(this.possibleLeftPairs),d=h.next();!d.done;d=h.next()){var f=d.value;if(f.getCount()>1)try{for(var p=(s=void 0,_l(this.possibleRightPairs)),g=p.next();!g.done;g=p.next()){var v=g.value;if(v.getCount()>1&&e.checkChecksum(f,v))return e.constructResult(f,v)}}catch(R){s={error:R}}finally{try{g&&!g.done&&(l=p.return)&&l.call(p)}finally{if(s)throw s.error}}}}catch(R){o={error:R}}finally{try{d&&!d.done&&(a=h.return)&&a.call(h)}finally{if(o)throw o.error}}throw new we},e.addOrTally=function(t,n){var i,o;if(n!=null){var a=!1;try{for(var s=_l(t),l=s.next();!l.done;l=s.next()){var c=l.value;if(c.getValue()===n.getValue()){c.incrementCount(),a=!0;break}}}catch(u){i={error:u}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}a||t.push(n)}},e.prototype.reset=function(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0},e.constructResult=function(t,n){for(var i=4537077*t.getValue()+n.getValue(),o=new String(i).toString(),a=new Ze,s=13-o.length;s>0;s--)a.append("0");a.append(o);for(var l=0,s=0;s<13;s++){var c=a.charAt(s).charCodeAt(0)-"0".charCodeAt(0);l+=(s&1)===0?3*c:c}l=10-l%10,l===10&&(l=0),a.append(l.toString());var u=t.getFinderPattern().getResultPoints(),h=n.getFinderPattern().getResultPoints();return new gr(a.toString(),null,0,[u[0],u[1],h[0],h[1]],De.RSS_14,new Date().getTime())},e.checkChecksum=function(t,n){var i=(t.getChecksumPortion()+16*n.getChecksumPortion())%79,o=9*t.getFinderPattern().getValue()+n.getFinderPattern().getValue();return o>72&&o--,o>8&&o--,i===o},e.prototype.decodePair=function(t,n,i,o){try{var a=this.findFinderPattern(t,n),s=this.parseFoundFinderPattern(t,i,n,a),l=o==null?null:o.get(vt.NEED_RESULT_POINT_CALLBACK);if(l!=null){var c=(a[0]+a[1])/2;n&&(c=t.getSize()-1-c),l.foundPossibleResultPoint(new Me(c,i))}var u=this.decodeDataCharacter(t,s,!0),h=this.decodeDataCharacter(t,s,!1);return new HL(1597*u.getValue()+h.getValue(),u.getChecksumPortion()+4*h.getChecksumPortion(),s)}catch{return null}},e.prototype.decodeDataCharacter=function(t,n,i){for(var o=this.getDataCharacterCounters(),a=0;a8&&(R=8);var m=Math.floor(s/2);(s&1)===0?(d[m]=R,p[m]=v-R):(f[m]=R,g[m]=v-R)}this.adjustOddEvenCounts(i,u);for(var x=0,T=0,s=d.length-1;s>=0;s--)T*=9,T+=d[s],x+=d[s];for(var P=0,A=0,s=f.length-1;s>=0;s--)P*=9,P+=f[s],A+=f[s];var D=T+3*P;if(i){if((x&1)!==0||x>12||x<4)throw new we;var W=(12-x)/2,_=e.OUTSIDE_ODD_WIDEST[W],Q=9-_,te=xi.getRSSvalue(d,_,!1),O=xi.getRSSvalue(f,Q,!0),I=e.OUTSIDE_EVEN_TOTAL_SUBSET[W],y=e.OUTSIDE_GSUM[W];return new Za(te*I+O+y,D)}else{if((A&1)!==0||A>10||A<4)throw new we;var W=(10-A)/2,_=e.INSIDE_ODD_WIDEST[W],Q=9-_,te=xi.getRSSvalue(d,_,!0),O=xi.getRSSvalue(f,Q,!1),L=e.INSIDE_ODD_TOTAL_SUBSET[W],y=e.INSIDE_GSUM[W];return new Za(O*L+te+y,D)}},e.prototype.findFinderPattern=function(t,n){var i=this.getDecodeFinderCounters();i[0]=0,i[1]=0,i[2]=0,i[3]=0;for(var o=t.getSize(),a=!1,s=0;s=0&&a!==t.get(s);)s--;s++;var l=o[0]-s,c=this.getDecodeFinderCounters(),u=new Int32Array(c.length);mt.arraycopy(c,0,u,1,c.length-1),u[0]=l;var h=this.parseFinderValue(u,e.FINDER_PATTERNS),d=s,f=o[1];return i&&(d=t.getSize()-1-d,f=t.getSize()-1-f),new g1(h,[s,o[1]],d,f,n)},e.prototype.adjustOddEvenCounts=function(t,n){var i=je.sum(new Int32Array(this.getOddCounts())),o=je.sum(new Int32Array(this.getEvenCounts())),a=!1,s=!1,l=!1,c=!1;t?(i>12?s=!0:i<4&&(a=!0),o>12?c=!0:o<4&&(l=!0)):(i>11?s=!0:i<5&&(a=!0),o>10?c=!0:o<4&&(l=!0));var u=i+o-n,h=(i&1)===(t?1:0),d=(o&1)===1;if(u===1)if(h){if(d)throw new we;s=!0}else{if(!d)throw new we;c=!0}else if(u===-1)if(h){if(d)throw new we;a=!0}else{if(!d)throw new we;l=!0}else if(u===0){if(h){if(!d)throw new we;i=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},rt=function(){function r(e,t,n){this.ecCodewords=e,this.ecBlocks=[t],n&&this.ecBlocks.push(n)}return r.prototype.getECCodewords=function(){return this.ecCodewords},r.prototype.getECBlocks=function(){return this.ecBlocks},r}(),qe=function(){function r(e,t){this.count=e,this.dataCodewords=t}return r.prototype.getCount=function(){return this.count},r.prototype.getDataCodewords=function(){return this.dataCodewords},r}(),zL=function(){function r(e,t,n,i,o,a){var s,l;this.versionNumber=e,this.symbolSizeRows=t,this.symbolSizeColumns=n,this.dataRegionSizeRows=i,this.dataRegionSizeColumns=o,this.ecBlocks=a;var c=0,u=a.getECCodewords(),h=a.getECBlocks();try{for(var d=od(h),f=d.next();!f.done;f=d.next()){var p=f.value;c+=p.getCount()*(p.getDataCodewords()+u)}}catch(g){s={error:g}}finally{try{f&&!f.done&&(l=d.return)&&l.call(d)}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(e,t){var n,i;if((e&1)!==0||(t&1)!==0)throw new Ee;try{for(var o=od(r.VERSIONS),a=o.next();!a.done;a=o.next()){var s=a.value;if(s.symbolSizeRows===e&&s.symbolSizeColumns===t)return s}}catch(l){n={error:l}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}throw new Ee},r.prototype.toString=function(){return""+this.versionNumber},r.buildVersions=function(){return[new r(1,10,10,8,8,new rt(5,new qe(1,3))),new r(2,12,12,10,10,new rt(7,new qe(1,5))),new r(3,14,14,12,12,new rt(10,new qe(1,8))),new r(4,16,16,14,14,new rt(12,new qe(1,12))),new r(5,18,18,16,16,new rt(14,new qe(1,18))),new r(6,20,20,18,18,new rt(18,new qe(1,22))),new r(7,22,22,20,20,new rt(20,new qe(1,30))),new r(8,24,24,22,22,new rt(24,new qe(1,36))),new r(9,26,26,24,24,new rt(28,new qe(1,44))),new r(10,32,32,14,14,new rt(36,new qe(1,62))),new r(11,36,36,16,16,new rt(42,new qe(1,86))),new r(12,40,40,18,18,new rt(48,new qe(1,114))),new r(13,44,44,20,20,new rt(56,new qe(1,144))),new r(14,48,48,22,22,new rt(68,new qe(1,174))),new r(15,52,52,24,24,new rt(42,new qe(2,102))),new r(16,64,64,14,14,new rt(56,new qe(2,140))),new r(17,72,72,16,16,new rt(36,new qe(4,92))),new r(18,80,80,18,18,new rt(48,new qe(4,114))),new r(19,88,88,20,20,new rt(56,new qe(4,144))),new r(20,96,96,22,22,new rt(68,new qe(4,174))),new r(21,104,104,24,24,new rt(56,new qe(6,136))),new r(22,120,120,18,18,new rt(68,new qe(6,175))),new r(23,132,132,20,20,new rt(62,new qe(8,163))),new r(24,144,144,22,22,new rt(62,new qe(8,156),new qe(2,155))),new r(25,8,18,6,16,new rt(7,new qe(1,5))),new r(26,8,32,6,14,new rt(11,new qe(1,10))),new r(27,12,26,10,24,new rt(14,new qe(1,16))),new r(28,12,36,10,16,new rt(18,new qe(1,22))),new r(29,16,36,14,16,new rt(24,new qe(1,32))),new r(30,16,48,14,22,new rt(28,new qe(1,49)))]},r.VERSIONS=r.buildVersions(),r}(),$L=function(){function r(e){var t=e.getHeight();if(t<8||t>144||(t&1)!==0)throw new Ee;this.version=r.readVersion(e),this.mappingBitMatrix=this.extractDataRegion(e),this.readMappingMatrix=new Sn(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}return r.prototype.getVersion=function(){return this.version},r.readVersion=function(e){var t=e.getHeight(),n=e.getWidth();return zL.getVersionForDimensions(t,n)},r.prototype.readCodewords=function(){var e=new Int8Array(this.version.getTotalCodewords()),t=0,n=4,i=0,o=this.mappingBitMatrix.getHeight(),a=this.mappingBitMatrix.getWidth(),s=!1,l=!1,c=!1,u=!1;do if(n===o&&i===0&&!s)e[t++]=this.readCorner1(o,a)&255,n-=2,i+=2,s=!0;else if(n===o-2&&i===0&&(a&3)!==0&&!l)e[t++]=this.readCorner2(o,a)&255,n-=2,i+=2,l=!0;else if(n===o+4&&i===2&&(a&7)===0&&!c)e[t++]=this.readCorner3(o,a)&255,n-=2,i+=2,c=!0;else if(n===o-2&&i===0&&(a&7)===4&&!u)e[t++]=this.readCorner4(o,a)&255,n-=2,i+=2,u=!0;else{do n=0&&!this.readMappingMatrix.get(i,n)&&(e[t++]=this.readUtah(n,i,o,a)&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(e?"Object is not iterable.":"Symbol.iterator is not defined.")},jL=function(){function r(e,t){this.numDataCodewords=e,this.codewords=t}return r.getDataBlocks=function(e,t){var n,i,o,a,s=t.getECBlocks(),l=0,c=s.getECBlocks();try{for(var u=ad(c),h=u.next();!h.done;h=u.next()){var d=h.value;l+=d.getCount()}}catch(y){n={error:y}}finally{try{h&&!h.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}var f=new Array(l),p=0;try{for(var g=ad(c),v=g.next();!v.done;v=g.next())for(var d=v.value,R=0;R7?R-1:R;f[O].codewords[I]=e[D++]}if(D!==e.length)throw new Xe;return f},r.prototype.getNumDataCodewords=function(){return this.numDataCodewords},r.prototype.getCodewords=function(){return this.codewords},r}(),v1=function(){function r(e){this.bytes=e,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(e){if(e<1||e>32||e>this.available())throw new Xe(""+e);var t=0,n=this.bitOffset,i=this.byteOffset,o=this.bytes;if(n>0){var a=8-n,s=e>8-s<>l,e-=s,n+=s,n===8&&(n=0,i++)}if(e>0){for(;e>=8;)t=t<<8|o[i]&255,i++,e-=8;if(e>0){var l=8-e,c=255>>l<>l,n+=e}}return this.bitOffset=n,this.byteOffset=i,t},r.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},r}(),Zt;(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"})(Zt||(Zt={}));var qL=function(){function r(){}return r.decode=function(e){var t=new v1(e),n=new Ze,i=new Ze,o=new Array,a=Zt.ASCII_ENCODE;do if(a===Zt.ASCII_ENCODE)a=this.decodeAsciiSegment(t,n,i);else{switch(a){case Zt.C40_ENCODE:this.decodeC40Segment(t,n);break;case Zt.TEXT_ENCODE:this.decodeTextSegment(t,n);break;case Zt.ANSIX12_ENCODE:this.decodeAnsiX12Segment(t,n);break;case Zt.EDIFACT_ENCODE:this.decodeEdifactSegment(t,n);break;case Zt.BASE256_ENCODE:this.decodeBase256Segment(t,n,o);break;default:throw new Ee}a=Zt.ASCII_ENCODE}while(a!==Zt.PAD_ENCODE&&t.available()>0);return i.length()>0&&n.append(i.toString()),new ds(e,n.toString(),o.length===0?null:o,null)},r.decodeAsciiSegment=function(e,t,n){var i=!1;do{var o=e.readBits(8);if(o===0)throw new Ee;if(o<=128)return i&&(o+=128),t.append(String.fromCharCode(o-1)),Zt.ASCII_ENCODE;if(o===129)return Zt.PAD_ENCODE;if(o<=229){var a=o-130;a<10&&t.append("0"),t.append(""+a)}else switch(o){case 230:return Zt.C40_ENCODE;case 231:return Zt.BASE256_ENCODE;case 232:t.append(String.fromCharCode(29));break;case 233:case 234:break;case 235:i=!0;break;case 236:t.append("[)>05"),n.insert(0,"");break;case 237:t.append("[)>06"),n.insert(0,"");break;case 238:return Zt.ANSIX12_ENCODE;case 239:return Zt.TEXT_ENCODE;case 240:return Zt.EDIFACT_ENCODE;case 241:break;default:if(o!==254||e.available()!==0)throw new Ee;break}}while(e.available()>0);return Zt.ASCII_ENCODE},r.decodeC40Segment=function(e,t){var n=!1,i=[],o=0;do{if(e.available()===8)return;var a=e.readBits(8);if(a===254)return;this.parseTwoBytes(a,e.readBits(8),i);for(var s=0;s<3;s++){var l=i[s];switch(o){case 0:if(l<3)o=l+1;else if(l0)},r.decodeTextSegment=function(e,t){var n=!1,i=[],o=0;do{if(e.available()===8)return;var a=e.readBits(8);if(a===254)return;this.parseTwoBytes(a,e.readBits(8),i);for(var s=0;s<3;s++){var l=i[s];switch(o){case 0:if(l<3)o=l+1;else if(l0)},r.decodeAnsiX12Segment=function(e,t){var n=[];do{if(e.available()===8)return;var i=e.readBits(8);if(i===254)return;this.parseTwoBytes(i,e.readBits(8),n);for(var o=0;o<3;o++){var a=n[o];switch(a){case 0:t.append("\r");break;case 1:t.append("*");break;case 2:t.append(">");break;case 3:t.append(" ");break;default:if(a<14)t.append(String.fromCharCode(a+44));else if(a<40)t.append(String.fromCharCode(a+51));else throw new Ee;break}}}while(e.available()>0)},r.parseTwoBytes=function(e,t,n){var i=(e<<8)+t-1,o=Math.floor(i/1600);n[0]=o,i-=o*1600,o=Math.floor(i/40),n[1]=o,n[2]=i-o*40},r.decodeEdifactSegment=function(e,t){do{if(e.available()<=16)return;for(var n=0;n<4;n++){var i=e.readBits(6);if(i===31){var o=8-e.getBitOffset();o!==8&&e.readBits(o);return}(i&32)===0&&(i|=64),t.append(String.fromCharCode(i))}}while(e.available()>0)},r.decodeBase256Segment=function(e,t,n){var i=1+e.getByteOffset(),o=this.unrandomize255State(e.readBits(8),i++),a;if(o===0?a=e.available()/8|0:o<250?a=o:a=250*(o-249)+this.unrandomize255State(e.readBits(8),i++),a<0)throw new Ee;for(var s=new Uint8Array(a),l=0;l=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}(),eF=globalThis&&globalThis.__values||function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")},tF=function(){function r(){this.rsDecoder=new ps(yn.DATA_MATRIX_FIELD_256)}return r.prototype.decode=function(e){var t,n,i=new $L(e),o=i.getVersion(),a=i.readCodewords(),s=jL.getDataBlocks(a,o),l=0;try{for(var c=eF(s),u=c.next();!u.done;u=c.next()){var h=u.value;l+=h.getNumDataCodewords()}}catch(x){t={error:x}}finally{try{u&&!u.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}for(var d=new Uint8Array(l),f=s.length,p=0;ps&&(u=s,h[0]=t,h[1]=n,h[2]=i,h[3]=o),u>l&&(u=l,h[0]=n,h[1]=i,h[2]=o,h[3]=t),u>c&&(h[0]=i,h[1]=o,h[2]=t,h[3]=n),h},r.prototype.detectSolid2=function(e){var t=e[0],n=e[1],i=e[2],o=e[3],a=this.transitionsBetween(t,o),s=r.shiftPoint(n,i,(a+1)*4),l=r.shiftPoint(i,n,(a+1)*4),c=this.transitionsBetween(s,t),u=this.transitionsBetween(l,o);return cf?u:h},r.prototype.shiftToModuleCenter=function(e){var t=e[0],n=e[1],i=e[2],o=e[3],a=this.transitionsBetween(t,o)+1,s=this.transitionsBetween(i,o)+1,l=r.shiftPoint(t,n,s*4),c=r.shiftPoint(i,n,a*4);a=this.transitionsBetween(l,o)+1,s=this.transitionsBetween(c,o)+1,(a&1)===1&&(a+=1),(s&1)===1&&(s+=1);var u=(t.getX()+n.getX()+i.getX()+o.getX())/4,h=(t.getY()+n.getY()+i.getY()+o.getY())/4;t=r.moveAway(t,u,h),n=r.moveAway(n,u,h),i=r.moveAway(i,u,h),o=r.moveAway(o,u,h);var d,f;return l=r.shiftPoint(t,n,s*4),l=r.shiftPoint(l,o,a*4),d=r.shiftPoint(n,t,s*4),d=r.shiftPoint(d,i,a*4),c=r.shiftPoint(i,o,s*4),c=r.shiftPoint(c,n,a*4),f=r.shiftPoint(o,i,s*4),f=r.shiftPoint(f,t,a*4),[l,d,c,f]},r.prototype.isValid=function(e){return e.getX()>=0&&e.getX()0&&e.getY()Math.abs(o-n);if(s){var l=n;n=i,i=l,l=o,o=a,a=l}for(var c=Math.abs(o-n),u=Math.abs(a-i),h=-c/2,d=i0){if(R===a)break;R+=d,h-=c}}return p},r}(),Qa=function(){function r(){this.decoder=new tF}return r.prototype.decode=function(e,t){t===void 0&&(t=null);var n,i;if(t!=null&&t.has(vt.PURE_BARCODE)){var o=r.extractPureBits(e.getBlackMatrix());n=this.decoder.decode(o),i=r.NO_POINTS}else{var a=new rF(e.getBlackMatrix()).detect();n=this.decoder.decode(a.getBits()),i=a.getPoints()}var s=n.getRawBytes(),l=new gr(n.getText(),s,8*s.length,i,De.DATA_MATRIX,mt.currentTimeMillis()),c=n.getByteSegments();c!=null&&l.putMetadata(sr.BYTE_SEGMENTS,c);var u=n.getECLevel();return u!=null&&l.putMetadata(sr.ERROR_CORRECTION_LEVEL,u),l},r.prototype.reset=function(){},r.extractPureBits=function(e){var t=e.getTopLeftOnBit(),n=e.getBottomRightOnBit();if(t==null||n==null)throw new we;var i=this.moduleSize(t,e),o=t[1],a=n[1],s=t[0],l=n[0],c=(l-s+1)/i,u=(a-o+1)/i;if(c<=0||u<=0)throw new we;var h=i/2;o+=h,s+=h;for(var d=new Sn(c,u),f=0;f=r.FOR_BITS.size)throw new Xe;return r.FOR_BITS.get(e)},r.FOR_BITS=new Map,r.FOR_VALUE=new Map,r.L=new r(Oi.L,"L",1),r.M=new r(Oi.M,"M",0),r.Q=new r(Oi.Q,"Q",3),r.H=new r(Oi.H,"H",2),r}(),iF=globalThis&&globalThis.__values||function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")},y1=function(){function r(e){this.errorCorrectionLevel=uc.forBits(e>>3&3),this.dataMask=e&7}return r.numBitsDiffering=function(e,t){return Ut.bitCount(e^t)},r.decodeFormatInformation=function(e,t){var n=r.doDecodeFormatInformation(e,t);return n!==null?n:r.doDecodeFormatInformation(e^r.FORMAT_INFO_MASK_QR,t^r.FORMAT_INFO_MASK_QR)},r.doDecodeFormatInformation=function(e,t){var n,i,o=Number.MAX_SAFE_INTEGER,a=0;try{for(var s=iF(r.FORMAT_INFO_DECODE_LOOKUP),l=s.next();!l.done;l=s.next()){var c=l.value,u=c[0];if(u===e||u===t)return new r(c[1]);var h=r.numBitsDiffering(e,u);h=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},fe=function(){function r(e){for(var t=[],n=1;n=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ti=function(){function r(e,t){for(var n,i,o=[],a=2;a40)throw new Xe;return r.VERSIONS[e-1]},r.decodeVersionInformation=function(e){for(var t=Number.MAX_SAFE_INTEGER,n=0,i=0;i6&&(t.setRegion(e-11,0,3,6),t.setRegion(0,e-11,6,3)),t},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 fe(7,new ne(1,19)),new fe(10,new ne(1,16)),new fe(13,new ne(1,13)),new fe(17,new ne(1,9))),new r(2,Int32Array.from([6,18]),new fe(10,new ne(1,34)),new fe(16,new ne(1,28)),new fe(22,new ne(1,22)),new fe(28,new ne(1,16))),new r(3,Int32Array.from([6,22]),new fe(15,new ne(1,55)),new fe(26,new ne(1,44)),new fe(18,new ne(2,17)),new fe(22,new ne(2,13))),new r(4,Int32Array.from([6,26]),new fe(20,new ne(1,80)),new fe(18,new ne(2,32)),new fe(26,new ne(2,24)),new fe(16,new ne(4,9))),new r(5,Int32Array.from([6,30]),new fe(26,new ne(1,108)),new fe(24,new ne(2,43)),new fe(18,new ne(2,15),new ne(2,16)),new fe(22,new ne(2,11),new ne(2,12))),new r(6,Int32Array.from([6,34]),new fe(18,new ne(2,68)),new fe(16,new ne(4,27)),new fe(24,new ne(4,19)),new fe(28,new ne(4,15))),new r(7,Int32Array.from([6,22,38]),new fe(20,new ne(2,78)),new fe(18,new ne(4,31)),new fe(18,new ne(2,14),new ne(4,15)),new fe(26,new ne(4,13),new ne(1,14))),new r(8,Int32Array.from([6,24,42]),new fe(24,new ne(2,97)),new fe(22,new ne(2,38),new ne(2,39)),new fe(22,new ne(4,18),new ne(2,19)),new fe(26,new ne(4,14),new ne(2,15))),new r(9,Int32Array.from([6,26,46]),new fe(30,new ne(2,116)),new fe(22,new ne(3,36),new ne(2,37)),new fe(20,new ne(4,16),new ne(4,17)),new fe(24,new ne(4,12),new ne(4,13))),new r(10,Int32Array.from([6,28,50]),new fe(18,new ne(2,68),new ne(2,69)),new fe(26,new ne(4,43),new ne(1,44)),new fe(24,new ne(6,19),new ne(2,20)),new fe(28,new ne(6,15),new ne(2,16))),new r(11,Int32Array.from([6,30,54]),new fe(20,new ne(4,81)),new fe(30,new ne(1,50),new ne(4,51)),new fe(28,new ne(4,22),new ne(4,23)),new fe(24,new ne(3,12),new ne(8,13))),new r(12,Int32Array.from([6,32,58]),new fe(24,new ne(2,92),new ne(2,93)),new fe(22,new ne(6,36),new ne(2,37)),new fe(26,new ne(4,20),new ne(6,21)),new fe(28,new ne(7,14),new ne(4,15))),new r(13,Int32Array.from([6,34,62]),new fe(26,new ne(4,107)),new fe(22,new ne(8,37),new ne(1,38)),new fe(24,new ne(8,20),new ne(4,21)),new fe(22,new ne(12,11),new ne(4,12))),new r(14,Int32Array.from([6,26,46,66]),new fe(30,new ne(3,115),new ne(1,116)),new fe(24,new ne(4,40),new ne(5,41)),new fe(20,new ne(11,16),new ne(5,17)),new fe(24,new ne(11,12),new ne(5,13))),new r(15,Int32Array.from([6,26,48,70]),new fe(22,new ne(5,87),new ne(1,88)),new fe(24,new ne(5,41),new ne(5,42)),new fe(30,new ne(5,24),new ne(7,25)),new fe(24,new ne(11,12),new ne(7,13))),new r(16,Int32Array.from([6,26,50,74]),new fe(24,new ne(5,98),new ne(1,99)),new fe(28,new ne(7,45),new ne(3,46)),new fe(24,new ne(15,19),new ne(2,20)),new fe(30,new ne(3,15),new ne(13,16))),new r(17,Int32Array.from([6,30,54,78]),new fe(28,new ne(1,107),new ne(5,108)),new fe(28,new ne(10,46),new ne(1,47)),new fe(28,new ne(1,22),new ne(15,23)),new fe(28,new ne(2,14),new ne(17,15))),new r(18,Int32Array.from([6,30,56,82]),new fe(30,new ne(5,120),new ne(1,121)),new fe(26,new ne(9,43),new ne(4,44)),new fe(28,new ne(17,22),new ne(1,23)),new fe(28,new ne(2,14),new ne(19,15))),new r(19,Int32Array.from([6,30,58,86]),new fe(28,new ne(3,113),new ne(4,114)),new fe(26,new ne(3,44),new ne(11,45)),new fe(26,new ne(17,21),new ne(4,22)),new fe(26,new ne(9,13),new ne(16,14))),new r(20,Int32Array.from([6,34,62,90]),new fe(28,new ne(3,107),new ne(5,108)),new fe(26,new ne(3,41),new ne(13,42)),new fe(30,new ne(15,24),new ne(5,25)),new fe(28,new ne(15,15),new ne(10,16))),new r(21,Int32Array.from([6,28,50,72,94]),new fe(28,new ne(4,116),new ne(4,117)),new fe(26,new ne(17,42)),new fe(28,new ne(17,22),new ne(6,23)),new fe(30,new ne(19,16),new ne(6,17))),new r(22,Int32Array.from([6,26,50,74,98]),new fe(28,new ne(2,111),new ne(7,112)),new fe(28,new ne(17,46)),new fe(30,new ne(7,24),new ne(16,25)),new fe(24,new ne(34,13))),new r(23,Int32Array.from([6,30,54,78,102]),new fe(30,new ne(4,121),new ne(5,122)),new fe(28,new ne(4,47),new ne(14,48)),new fe(30,new ne(11,24),new ne(14,25)),new fe(30,new ne(16,15),new ne(14,16))),new r(24,Int32Array.from([6,28,54,80,106]),new fe(30,new ne(6,117),new ne(4,118)),new fe(28,new ne(6,45),new ne(14,46)),new fe(30,new ne(11,24),new ne(16,25)),new fe(30,new ne(30,16),new ne(2,17))),new r(25,Int32Array.from([6,32,58,84,110]),new fe(26,new ne(8,106),new ne(4,107)),new fe(28,new ne(8,47),new ne(13,48)),new fe(30,new ne(7,24),new ne(22,25)),new fe(30,new ne(22,15),new ne(13,16))),new r(26,Int32Array.from([6,30,58,86,114]),new fe(28,new ne(10,114),new ne(2,115)),new fe(28,new ne(19,46),new ne(4,47)),new fe(28,new ne(28,22),new ne(6,23)),new fe(30,new ne(33,16),new ne(4,17))),new r(27,Int32Array.from([6,34,62,90,118]),new fe(30,new ne(8,122),new ne(4,123)),new fe(28,new ne(22,45),new ne(3,46)),new fe(30,new ne(8,23),new ne(26,24)),new fe(30,new ne(12,15),new ne(28,16))),new r(28,Int32Array.from([6,26,50,74,98,122]),new fe(30,new ne(3,117),new ne(10,118)),new fe(28,new ne(3,45),new ne(23,46)),new fe(30,new ne(4,24),new ne(31,25)),new fe(30,new ne(11,15),new ne(31,16))),new r(29,Int32Array.from([6,30,54,78,102,126]),new fe(30,new ne(7,116),new ne(7,117)),new fe(28,new ne(21,45),new ne(7,46)),new fe(30,new ne(1,23),new ne(37,24)),new fe(30,new ne(19,15),new ne(26,16))),new r(30,Int32Array.from([6,26,52,78,104,130]),new fe(30,new ne(5,115),new ne(10,116)),new fe(28,new ne(19,47),new ne(10,48)),new fe(30,new ne(15,24),new ne(25,25)),new fe(30,new ne(23,15),new ne(25,16))),new r(31,Int32Array.from([6,30,56,82,108,134]),new fe(30,new ne(13,115),new ne(3,116)),new fe(28,new ne(2,46),new ne(29,47)),new fe(30,new ne(42,24),new ne(1,25)),new fe(30,new ne(23,15),new ne(28,16))),new r(32,Int32Array.from([6,34,60,86,112,138]),new fe(30,new ne(17,115)),new fe(28,new ne(10,46),new ne(23,47)),new fe(30,new ne(10,24),new ne(35,25)),new fe(30,new ne(19,15),new ne(35,16))),new r(33,Int32Array.from([6,30,58,86,114,142]),new fe(30,new ne(17,115),new ne(1,116)),new fe(28,new ne(14,46),new ne(21,47)),new fe(30,new ne(29,24),new ne(19,25)),new fe(30,new ne(11,15),new ne(46,16))),new r(34,Int32Array.from([6,34,62,90,118,146]),new fe(30,new ne(13,115),new ne(6,116)),new fe(28,new ne(14,46),new ne(23,47)),new fe(30,new ne(44,24),new ne(7,25)),new fe(30,new ne(59,16),new ne(1,17))),new r(35,Int32Array.from([6,30,54,78,102,126,150]),new fe(30,new ne(12,121),new ne(7,122)),new fe(28,new ne(12,47),new ne(26,48)),new fe(30,new ne(39,24),new ne(14,25)),new fe(30,new ne(22,15),new ne(41,16))),new r(36,Int32Array.from([6,24,50,76,102,128,154]),new fe(30,new ne(6,121),new ne(14,122)),new fe(28,new ne(6,47),new ne(34,48)),new fe(30,new ne(46,24),new ne(10,25)),new fe(30,new ne(2,15),new ne(64,16))),new r(37,Int32Array.from([6,28,54,80,106,132,158]),new fe(30,new ne(17,122),new ne(4,123)),new fe(28,new ne(29,46),new ne(14,47)),new fe(30,new ne(49,24),new ne(10,25)),new fe(30,new ne(24,15),new ne(46,16))),new r(38,Int32Array.from([6,32,58,84,110,136,162]),new fe(30,new ne(4,122),new ne(18,123)),new fe(28,new ne(13,46),new ne(32,47)),new fe(30,new ne(48,24),new ne(14,25)),new fe(30,new ne(42,15),new ne(32,16))),new r(39,Int32Array.from([6,26,54,82,110,138,166]),new fe(30,new ne(20,117),new ne(4,118)),new fe(28,new ne(40,47),new ne(7,48)),new fe(30,new ne(43,24),new ne(22,25)),new fe(30,new ne(10,15),new ne(67,16))),new r(40,Int32Array.from([6,30,58,86,114,142,170]),new fe(30,new ne(19,118),new ne(6,119)),new fe(28,new ne(18,47),new ne(31,48)),new fe(30,new ne(34,24),new ne(34,25)),new fe(30,new ne(20,15),new ne(61,16)))],r}(),$t;(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"})($t||($t={}));var sd=function(){function r(e,t){this.value=e,this.isMasked=t}return r.prototype.unmaskBitMatrix=function(e,t){for(var n=0;n=0;n--)e=this.copyBit(8,n,e);for(var i=this.bitMatrix.getHeight(),o=0,a=i-7,n=i-1;n>=a;n--)o=this.copyBit(8,n,o);for(var t=i-8;t=0;o--)for(var a=e-9;a>=i;a--)n=this.copyBit(a,o,n);var s=ti.decodeVersionInformation(n);if(s!==null&&s.getDimensionForVersion()===e)return this.parsedVersion=s,s;n=0;for(var a=5;a>=0;a--)for(var o=e-9;o>=i;o--)n=this.copyBit(a,o,n);if(s=ti.decodeVersionInformation(n),s!==null&&s.getDimensionForVersion()===e)return this.parsedVersion=s,s;throw new Ee},r.prototype.copyBit=function(e,t,n){var i=this.isMirror?this.bitMatrix.get(t,e):this.bitMatrix.get(e,t);return i?n<<1|1:n<<1},r.prototype.readCodewords=function(){var e=this.readFormatInformation(),t=this.readVersion(),n=sd.values.get(e.getDataMask()),i=this.bitMatrix.getHeight();n.unmaskBitMatrix(this.bitMatrix,i);for(var o=t.buildFunctionPattern(),a=!0,s=new Uint8Array(t.getTotalCodewords()),l=0,c=0,u=0,h=i-1;h>0;h-=2){h===6&&h--;for(var d=0;d=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},lF=function(){function r(e,t){this.numDataCodewords=e,this.codewords=t}return r.getDataBlocks=function(e,t,n){var i,o,a,s;if(e.length!==t.getTotalCodewords())throw new Xe;var l=t.getECBlocksForLevel(n),c=0,u=l.getECBlocks();try{for(var h=ld(u),d=h.next();!d.done;d=h.next()){var f=d.value;c+=f.getCount()}}catch(I){i={error:I}}finally{try{d&&!d.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}var p=new Array(c),g=0;try{for(var v=ld(u),R=v.next();!R.done;R=v.next())for(var f=R.value,m=0;m=0;){var D=p[A].codewords.length;if(D===P)break;A--}A++;for(var W=P-l.getECCodewordsPerBlock(),_=0,m=0;me.available())throw new Ee;for(var i=new Uint8Array(2*n),o=0;n>0;){var a=e.readBits(13),s=a/96<<8&4294967295|a%96;s<959?s+=41377:s+=42657,i[o]=s>>8&255,i[o+1]=s&255,o+=2,n--}try{t.append(Yr.decode(i,Rt.GB2312))}catch(l){throw new Ee(l)}},r.decodeKanjiSegment=function(e,t,n){if(n*13>e.available())throw new Ee;for(var i=new Uint8Array(2*n),o=0;n>0;){var a=e.readBits(13),s=a/192<<8&4294967295|a%192;s<7936?s+=33088:s+=49472,i[o]=s>>8,i[o+1]=s,o+=2,n--}try{t.append(Yr.decode(i,Rt.SHIFT_JIS))}catch(l){throw new Ee(l)}},r.decodeByteSegment=function(e,t,n,i,o,a){if(8*n>e.available())throw new Ee;for(var s=new Uint8Array(n),l=0;l=r.ALPHANUMERIC_CHARS.length)throw new Ee;return r.ALPHANUMERIC_CHARS[e]},r.decodeAlphanumericSegment=function(e,t,n,i){for(var o=t.length();n>1;){if(e.available()<11)throw new Ee;var a=e.readBits(11);t.append(r.toAlphaNumericChar(Math.floor(a/45))),t.append(r.toAlphaNumericChar(a%45)),n-=2}if(n===1){if(e.available()<6)throw new Ee;t.append(r.toAlphaNumericChar(e.readBits(6)))}if(i)for(var s=o;s=3;){if(e.available()<10)throw new Ee;var i=e.readBits(10);if(i>=1e3)throw new Ee;t.append(r.toAlphaNumericChar(Math.floor(i/100))),t.append(r.toAlphaNumericChar(Math.floor(i/10)%10)),t.append(r.toAlphaNumericChar(i%10)),n-=3}if(n===2){if(e.available()<7)throw new Ee;var o=e.readBits(7);if(o>=100)throw new Ee;t.append(r.toAlphaNumericChar(Math.floor(o/10))),t.append(r.toAlphaNumericChar(o%10))}else if(n===1){if(e.available()<4)throw new Ee;var a=e.readBits(4);if(a>=10)throw new Ee;t.append(r.toAlphaNumericChar(a))}},r.parseECIValue=function(e){var t=e.readBits(8);if((t&128)===0)return t&127;if((t&192)===128){var n=e.readBits(8);return(t&63)<<8&4294967295|n}if((t&224)===192){var i=e.readBits(16);return(t&31)<<16&4294967295|i}throw new Ee},r.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",r.GB2312_SUBSET=1,r}(),w1=function(){function r(e){this.mirrored=e}return r.prototype.isMirrored=function(){return this.mirrored},r.prototype.applyMirroredCorrection=function(e){if(!(!this.mirrored||e===null||e.length<3)){var t=e[0];e[0]=e[2],e[2]=t}},r}(),cd=globalThis&&globalThis.__values||function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")},uF=function(){function r(){this.rsDecoder=new ps(yn.QR_CODE_FIELD_256)}return r.prototype.decodeBooleanArray=function(e,t){return this.decodeBitMatrix(Sn.parseFromBooleanArray(e),t)},r.prototype.decodeBitMatrix=function(e,t){var n=new sF(e),i=null;try{return this.decodeBitMatrixParser(n,t)}catch(a){i=a}try{n.remask(),n.setMirror(!0),n.readVersion(),n.readFormatInformation(),n.mirror();var o=this.decodeBitMatrixParser(n,t);return o.setOther(new w1(!0)),o}catch(a){throw i!==null?i:a}},r.prototype.decodeBitMatrixParser=function(e,t){var n,i,o,a,s=e.readVersion(),l=e.readFormatInformation().getErrorCorrectionLevel(),c=e.readCodewords(),u=lF.getDataBlocks(c,s,l),h=0;try{for(var d=cd(u),f=d.next();!f.done;f=d.next()){var p=f.value;h+=p.getNumDataCodewords()}}catch(A){n={error:A}}finally{try{f&&!f.done&&(i=d.return)&&i.call(d)}finally{if(n)throw n.error}}var g=new Uint8Array(h),v=0;try{for(var R=cd(u),m=R.next();!m.done;m=R.next()){var p=m.value,x=p.getCodewords(),T=p.getNumDataCodewords();this.correctErrors(x,T);for(var P=0;P=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},pF=function(){function r(e,t,n,i,o,a,s){this.image=e,this.startX=t,this.startY=n,this.width=i,this.height=o,this.moduleSize=a,this.resultPointCallback=s,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(3)}return r.prototype.find=function(){for(var e=this.startX,t=this.height,n=this.width,i=e+n,o=this.startY+t/2,a=new Int32Array(3),s=this.image,l=0;l=n)return!1;return!0},r.prototype.crossCheckVertical=function(e,t,n,i){var o=this.image,a=o.getHeight(),s=this.crossCheckStateCount;s[0]=0,s[1]=0,s[2]=0;for(var l=e;l>=0&&o.get(t,l)&&s[1]<=n;)s[1]++,l--;if(l<0||s[1]>n)return NaN;for(;l>=0&&!o.get(t,l)&&s[0]<=n;)s[0]++,l--;if(s[0]>n)return NaN;for(l=e+1;ln)return NaN;for(;ln)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,l):NaN},r.prototype.handlePossibleCenter=function(e,t,n){var i,o,a=e[0]+e[1]+e[2],s=r.centerFromEnd(e,n),l=this.crossCheckVertical(t,s,2*e[1],a);if(!isNaN(l)){var c=(e[0]+e[1]+e[2])/3;try{for(var u=dF(this.possibleCenters),h=u.next();!h.done;h=u.next()){var d=h.value;if(d.aboutEquals(c,l,s))return d.combineEstimate(l,s,c)}}catch(p){i={error:p}}finally{try{h&&!h.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}var f=new fF(s,l,c);this.possibleCenters.push(f),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(f)}return null},r}(),gF=globalThis&&globalThis.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),RF=function(r){gF(e,r);function e(t,n,i,o){var a=r.call(this,t,n)||this;return a.estimatedModuleSize=i,a.count=o,o===void 0&&(a.count=1),a}return e.prototype.getEstimatedModuleSize=function(){return this.estimatedModuleSize},e.prototype.getCount=function(){return this.count},e.prototype.aboutEquals=function(t,n,i){if(Math.abs(n-this.getY())<=t&&Math.abs(i-this.getX())<=t){var o=Math.abs(t-this.estimatedModuleSize);return o<=1||o<=this.estimatedModuleSize}return!1},e.prototype.combineEstimate=function(t,n,i){var o=this.count+1,a=(this.count*this.getX()+n)/o,s=(this.count*this.getY()+t)/o,l=(this.count*this.estimatedModuleSize+i)/o;return new e(a,s,l,o)},e}(Me),mF=function(){function r(e){this.bottomLeft=e[0],this.topLeft=e[1],this.topRight=e[2]}return r.prototype.getBottomLeft=function(){return this.bottomLeft},r.prototype.getTopLeft=function(){return this.topLeft},r.prototype.getTopRight=function(){return this.topRight},r}(),po=globalThis&&globalThis.__values||function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")},vF=function(){function r(e,t){this.image=e,this.resultPointCallback=t,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=t}return r.prototype.getImage=function(){return this.image},r.prototype.getPossibleCenters=function(){return this.possibleCenters},r.prototype.find=function(e){var t=e!=null&&e.get(vt.TRY_HARDER)!==void 0,n=e!=null&&e.get(vt.PURE_BARCODE)!==void 0,i=this.image,o=i.getHeight(),a=i.getWidth(),s=Math.floor(3*o/(4*r.MAX_MODULES));(sc[2]&&(u+=p-c[2]-s,d=a-1)}else{c[0]=c[2],c[1]=c[3],c[2]=c[4],c[3]=1,c[4]=0,h=3;continue}h=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,h=3;else c[++h]++;else c[h]++;if(r.foundPatternCross(c)){var f=this.handlePossibleCenter(c,u,a,n);f===!0&&(s=c[0],this.hasSkipped&&(l=this.haveMultiplyConfirmedCenters()))}}var g=this.selectBestPatterns();return Me.orderBestPatterns(g),new mF(g)},r.centerFromEnd=function(e,t){return t-e[4]-e[3]-e[2]/2},r.foundPatternCross=function(e){for(var t=0,n=0;n<5;n++){var i=e[n];if(i===0)return!1;t+=i}if(t<7)return!1;var o=t/7,a=o/2;return Math.abs(o-e[0])=a&&t>=a&&s.get(t-a,e-a);)o[2]++,a++;if(e=a&&t>=a&&!s.get(t-a,e-a)&&o[1]<=n;)o[1]++,a++;if(en)return!1;for(;e>=a&&t>=a&&s.get(t-a,e-a)&&o[0]<=n;)o[0]++,a++;if(o[0]>n)return!1;var l=s.getHeight(),c=s.getWidth();for(a=1;e+a=l||t+a>=c)return!1;for(;e+a=l||t+a>=c||o[3]>=n)return!1;for(;e+a=n)return!1;var u=o[0]+o[1]+o[2]+o[3]+o[4];return Math.abs(u-i)<2*i&&r.foundPatternCross(o)},r.prototype.crossCheckVertical=function(e,t,n,i){for(var o=this.image,a=o.getHeight(),s=this.getCrossCheckStateCount(),l=e;l>=0&&o.get(t,l);)s[2]++,l--;if(l<0)return NaN;for(;l>=0&&!o.get(t,l)&&s[1]<=n;)s[1]++,l--;if(l<0||s[1]>n)return NaN;for(;l>=0&&o.get(t,l)&&s[0]<=n;)s[0]++,l--;if(s[0]>n)return NaN;for(l=e+1;l=n)return NaN;for(;l=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,l):NaN},r.prototype.crossCheckHorizontal=function(e,t,n,i){for(var o=this.image,a=o.getWidth(),s=this.getCrossCheckStateCount(),l=e;l>=0&&o.get(l,t);)s[2]++,l--;if(l<0)return NaN;for(;l>=0&&!o.get(l,t)&&s[1]<=n;)s[1]++,l--;if(l<0||s[1]>n)return NaN;for(;l>=0&&o.get(l,t)&&s[0]<=n;)s[0]++,l--;if(s[0]>n)return NaN;for(l=e+1;l=n)return NaN;for(;l=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,l):NaN},r.prototype.handlePossibleCenter=function(e,t,n,i){var o=e[0]+e[1]+e[2]+e[3]+e[4],a=r.centerFromEnd(e,n),s=this.crossCheckVertical(t,Math.floor(a),e[2],o);if(!isNaN(s)&&(a=this.crossCheckHorizontal(Math.floor(a),Math.floor(s),e[2],o),!isNaN(a)&&(!i||this.crossCheckDiagonal(Math.floor(s),Math.floor(a),e[2],o)))){for(var l=o/7,c=!1,u=this.possibleCenters,h=0,d=u.length;h=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(l){e={error:l}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}return 0},r.prototype.haveMultiplyConfirmedCenters=function(){var e,t,n,i,o=0,a=0,s=this.possibleCenters.length;try{for(var l=po(this.possibleCenters),c=l.next();!c.done;c=l.next()){var u=c.value;u.getCount()>=r.CENTER_QUORUM&&(o++,a+=u.getEstimatedModuleSize())}}catch(g){e={error:g}}finally{try{c&&!c.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}if(o<3)return!1;var h=a/s,d=0;try{for(var f=po(this.possibleCenters),p=f.next();!p.done;p=f.next()){var u=p.value;d+=Math.abs(u.getEstimatedModuleSize()-h)}}catch(g){n={error:g}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}return d<=.05*a},r.prototype.selectBestPatterns=function(){var e,t,n,i,o=this.possibleCenters.length;if(o<3)throw new we;var a=this.possibleCenters,s;if(o>3){var l=0,c=0;try{for(var u=po(this.possibleCenters),h=u.next();!h.done;h=u.next()){var d=h.value,f=d.getEstimatedModuleSize();l+=f,c+=f*f}}catch(P){e={error:P}}finally{try{h&&!h.done&&(t=u.return)&&t.call(u)}finally{if(e)throw e.error}}s=l/o;var p=Math.sqrt(c/o-s*s);a.sort(function(P,A){var D=Math.abs(A.getEstimatedModuleSize()-s),W=Math.abs(P.getEstimatedModuleSize()-s);return DW?1:0});for(var g=Math.max(.2*s,p),v=0;v3;v++){var R=a[v];Math.abs(R.getEstimatedModuleSize()-s)>g&&(a.splice(v,1),v--)}}if(a.length>3){var l=0;try{for(var m=po(a),x=m.next();!x.done;x=m.next()){var T=x.value;l+=T.getEstimatedModuleSize()}}catch(A){n={error:A}}finally{try{x&&!x.done&&(i=m.return)&&i.call(m)}finally{if(n)throw n.error}}s=l/a.length,a.sort(function(A,D){if(D.getCount()===A.getCount()){var W=Math.abs(D.getEstimatedModuleSize()-s),_=Math.abs(A.getEstimatedModuleSize()-s);return W<_?1:W>_?-1:0}else return D.getCount()-A.getCount()}),a.splice(3)}return[a[0],a[1],a[2]]},r.CENTER_QUORUM=2,r.MIN_SKIP=3,r.MAX_MODULES=57,r}(),yF=function(){function r(e){this.image=e}return r.prototype.getImage=function(){return this.image},r.prototype.getResultPointCallback=function(){return this.resultPointCallback},r.prototype.detect=function(e){this.resultPointCallback=e==null?null:e.get(vt.NEED_RESULT_POINT_CALLBACK);var t=new vF(this.image,this.resultPointCallback),n=t.find(e);return this.processFinderPatternInfo(n)},r.prototype.processFinderPatternInfo=function(e){var t=e.getTopLeft(),n=e.getTopRight(),i=e.getBottomLeft(),o=this.calculateModuleSize(t,n,i);if(o<1)throw new we("No pattern found in proccess finder.");var a=r.computeDimension(t,n,i,o),s=ti.getProvisionalVersionForDimension(a),l=s.getDimensionForVersion()-7,c=null;if(s.getAlignmentPatternCenters().length>0)for(var u=n.getX()-t.getX()+i.getX(),h=n.getY()-t.getY()+i.getY(),d=1-3/l,f=Math.floor(t.getX()+d*(u-t.getX())),p=Math.floor(t.getY()+d*(h-t.getY())),g=4;g<=16;g<<=1)try{c=this.findAlignmentInRegion(o,f,p,g);break}catch(x){if(!(x instanceof we))throw x}var v=r.createTransform(t,n,i,c,a),R=r.sampleGrid(this.image,v,a),m;return c===null?m=[i,t,n]:m=[i,t,n,c],new Ou(R,m)},r.createTransform=function(e,t,n,i,o){var a=o-3.5,s,l,c,u;return i!==null?(s=i.getX(),l=i.getY(),c=a-3,u=c):(s=t.getX()-e.getX()+n.getX(),l=t.getY()-e.getY()+n.getY(),c=a,u=a),p1.quadrilateralToQuadrilateral(3.5,3.5,a,3.5,c,u,3.5,a,e.getX(),e.getY(),t.getX(),t.getY(),s,l,n.getX(),n.getY())},r.sampleGrid=function(e,t,n){var i=Tu.getInstance();return i.sampleGridWithTransform(e,n,n,t)},r.computeDimension=function(e,t,n,i){var o=je.round(Me.distance(e,t)/i),a=je.round(Me.distance(e,n)/i),s=Math.floor((o+a)/2)+7;switch(s&3){case 0:s++;break;case 2:s--;break;case 3:throw new we("Dimensions could be not found.")}return s},r.prototype.calculateModuleSize=function(e,t,n){return(this.calculateModuleSizeOneWay(e,t)+this.calculateModuleSizeOneWay(e,n))/2},r.prototype.calculateModuleSizeOneWay=function(e,t){var n=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(e.getX()),Math.floor(e.getY()),Math.floor(t.getX()),Math.floor(t.getY())),i=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(t.getX()),Math.floor(t.getY()),Math.floor(e.getX()),Math.floor(e.getY()));return isNaN(n)?i/7:isNaN(i)?n/7:(n+i)/14},r.prototype.sizeOfBlackWhiteBlackRunBothWays=function(e,t,n,i){var o=this.sizeOfBlackWhiteBlackRun(e,t,n,i),a=1,s=e-(n-e);s<0?(a=e/(e-s),s=0):s>=this.image.getWidth()&&(a=(this.image.getWidth()-1-e)/(s-e),s=this.image.getWidth()-1);var l=Math.floor(t-(i-t)*a);return a=1,l<0?(a=t/(t-l),l=0):l>=this.image.getHeight()&&(a=(this.image.getHeight()-1-t)/(l-t),l=this.image.getHeight()-1),s=Math.floor(e+(s-e)*a),o+=this.sizeOfBlackWhiteBlackRun(e,t,s,l),o-1},r.prototype.sizeOfBlackWhiteBlackRun=function(e,t,n,i){var o=Math.abs(i-t)>Math.abs(n-e);if(o){var a=e;e=t,t=a,a=n,n=i,i=a}for(var s=Math.abs(n-e),l=Math.abs(i-t),c=-s/2,u=e0){if(g===i)break;g+=h,c-=s}}return d===2?je.distance(n+u,i,e,t):NaN},r.prototype.findAlignmentInRegion=function(e,t,n,i){var o=Math.floor(i*e),a=Math.max(0,t-o),s=Math.min(this.image.getWidth()-1,t+o);if(s-a=l||o>=a)throw new we;if(a-o!==l-s&&(l=s+(a-o),l>=e.getWidth()))throw new we;var c=Math.round((l-s+1)/i),u=Math.round((a-o+1)/i);if(c<=0||u<=0)throw new we;if(u!==c)throw new we;var h=Math.floor(i/2);o+=h,s+=h;var d=s+Math.floor((c-1)*i)-l;if(d>0){if(d>h)throw new we;s-=d}var f=o+Math.floor((u-1)*i)-a;if(f>0){if(f>h)throw new we;o-=f}for(var p=new Sn(c,u),g=0;g=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Je=function(){function r(){}return r.prototype.PDF417Common=function(){},r.getBitCountSum=function(e){return je.sum(e)},r.toIntArray=function(e){var t,n;if(e==null||!e.length)return r.EMPTY_INT_ARRAY;var i=new Int32Array(e.length),o=0;try{for(var a=wF(e),s=a.next();!s.done;s=a.next()){var l=s.value;i[o++]=l}}catch(c){t={error:c}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return i},r.getCodeword=function(e){var t=Bt.binarySearch(r.SYMBOL_TABLE,e&262143);return t<0?-1:(r.CODEWORD_TABLE[t]-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}(),SF=function(){function r(e,t){this.bits=e,this.points=t}return r.prototype.getBits=function(){return this.bits},r.prototype.getPoints=function(){return this.points},r}(),xF=globalThis&&globalThis.__values||function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")},bF=function(){function r(){}return r.detectMultiple=function(e,t,n){var i=e.getBlackMatrix(),o=r.detect(n,i);return o.length||(i=i.clone(),i.rotate180(),o=r.detect(n,i)),new SF(i,o)},r.detect=function(e,t){for(var n,i,o=new Array,a=0,s=0,l=!1;a0;){var h=r.findGuardPattern(e,o,--i,n,!1,a,c);if(h!=null)u=h;else{i++;break}}s[0]=new Me(u[0],i),s[1]=new Me(u[1],i),l=!0;break}}var d=i+1;if(l){for(var f=0,h=Int32Array.from([Math.trunc(s[0].getX()),Math.trunc(s[1].getX())]);dr.SKIPPED_ROW_COUNT_MAX)break;f++}}d-=f+1,s[2]=new Me(h[0],d),s[3]=new Me(h[1],d)}return d-i0&&c++d?h-d:d-h;if(f>n)return 1/0;c+=f}return c/o},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}(),OF=globalThis&&globalThis.__values||function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")},$n=function(){function r(e,t){if(t.length===0)throw new Xe;this.field=e;var n=t.length;if(n>1&&t[0]===0){for(var i=1;in.length){var i=t;t=n,n=i}var o=new Int32Array(n.length),a=n.length-t.length;mt.arraycopy(n,0,o,0,a);for(var s=a;s=0;t--){var n=this.getCoefficient(t);n!==0&&(n<0?(e.append(" - "),n=-n):e.length()>0&&e.append(" + "),(t===0||n!==1)&&e.append(n),t!==0&&(t===1?e.append("x"):(e.append("x^"),e.append(t))))}return e.toString()},r}(),TF=function(){function r(){}return r.prototype.add=function(e,t){return(e+t)%this.modulus},r.prototype.subtract=function(e,t){return(this.modulus+e-t)%this.modulus},r.prototype.exp=function(e){return this.expTable[e]},r.prototype.log=function(e){if(e===0)throw new Xe;return this.logTable[e]},r.prototype.inverse=function(e){if(e===0)throw new d1;return this.expTable[this.modulus-this.logTable[e]-1]},r.prototype.multiply=function(e,t){return e===0||t===0?0:this.expTable[(this.logTable[e]+this.logTable[t])%(this.modulus-1)]},r.prototype.getSize=function(){return this.modulus},r.prototype.equals=function(e){return e===this},r}(),PF=globalThis&&globalThis.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),EF=function(r){PF(e,r);function e(t,n){var i=r.call(this)||this;i.modulus=t,i.expTable=new Int32Array(t),i.logTable=new Int32Array(t);for(var o=1,a=0;a=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},IF=function(){function r(){this.field=EF.PDF417_GF}return r.prototype.decode=function(e,t,n){for(var i,o,a=new $n(this.field,e),s=new Int32Array(t),l=!1,c=t;c>0;c--){var u=a.evaluateAt(this.field.exp(c));s[t-c]=u,u!==0&&(l=!0)}if(!l)return 0;var h=this.field.getOne();if(n!=null)try{for(var d=_F(n),f=d.next();!f.done;f=d.next()){var p=f.value,g=this.field.exp(e.length-1-p),v=new $n(this.field,new Int32Array([this.field.subtract(0,g),1]));h=h.multiply(v)}}catch(W){i={error:W}}finally{try{f&&!f.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}for(var R=new $n(this.field,s),m=this.runEuclideanAlgorithm(this.field.buildMonomial(t,1),R,t),x=m[0],T=m[1],P=this.findErrorLocations(x),A=this.findErrorMagnitudes(T,x,P),c=0;c=Math.round(n/2);){var c=o,u=s;if(o=a,s=l,o.isZero())throw Yt.getChecksumInstance();a=c;for(var h=this.field.getZero(),d=o.getCoefficient(o.getDegree()),f=this.field.inverse(d);a.getDegree()>=o.getDegree()&&!a.isZero();){var p=a.getDegree()-o.getDegree(),g=this.field.multiply(a.getCoefficient(a.getDegree()),f);h=h.add(this.field.buildMonomial(p,g)),a=a.subtract(o.multiplyByMonomial(p,g))}l=h.multiply(s).subtract(u).negative()}var v=l.getCoefficient(0);if(v===0)throw Yt.getChecksumInstance();var R=this.field.inverse(v),m=l.multiply(R),x=a.multiply(R);return[m,x]},r.prototype.findErrorLocations=function(e){for(var t=e.getDegree(),n=new Int32Array(t),i=0,o=1;o0){var l=n?this.topLeft:this.topRight,c=Math.trunc(l.getY()-e);c<0&&(c=0);var u=new Me(l.getX(),c);n?i=u:a=u}if(t>0){var h=n?this.bottomLeft:this.bottomRight,d=Math.trunc(h.getY()+t);d>=this.image.getHeight()&&(d=this.image.getHeight()-1);var f=new Me(h.getX(),d);n?o=f:s=f}return new r(this.image,i,o,a,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}(),NF=function(){function r(e,t,n,i){this.columnCount=e,this.errorCorrectionLevel=i,this.rowCountUpperPart=t,this.rowCountLowerPart=n,this.rowCount=t+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}(),Eu=function(){function r(){this.buffer=""}return r.form=function(e,t){var n=-1;function i(a,s,l,c,u,h){if(a==="%%")return"%";if(t[++n]!==void 0){a=c?parseInt(c.substr(1)):void 0;var d=u?parseInt(u.substr(1)):void 0,f;switch(h){case"s":f=t[n];break;case"c":f=t[n][0];break;case"f":f=parseFloat(t[n]).toFixed(a);break;case"p":f=parseFloat(t[n]).toPrecision(a);break;case"e":f=parseFloat(t[n]).toExponential(a);break;case"x":f=parseInt(t[n]).toString(d||16);break;case"d":f=parseFloat(parseInt(t[n],d||10).toPrecision(a)).toFixed(0);break}f=typeof f=="object"?JSON.stringify(f):(+f).toString(d);for(var p=parseInt(l),g=l&&l[0]+""=="0"?"0":" ";f.length=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},S1=function(){function r(e){this.boundingBox=new hc(e),this.codewords=new Array(e.getMaxY()-e.getMinY()+1)}return r.prototype.getCodewordNearby=function(e){var t=this.getCodeword(e);if(t!=null)return t;for(var n=1;n=0&&(t=this.codewords[i],t!=null)||(i=this.imageRowToCodewordIndex(e)+n,i=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},FF=globalThis&&globalThis.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(a)throw a.error}}return o},wo=function(){function r(){this.values=new Map}return r.prototype.setValue=function(e){e=Math.trunc(e);var t=this.values.get(e);t==null&&(t=0),t++,this.values.set(e,t)},r.prototype.getValue=function(){var e,t,n=-1,i=new Array,o=function(h,d){var f={getKey:function(){return h},getValue:function(){return d}};f.getValue()>n?(n=f.getValue(),i=[],i.push(f.getKey())):f.getValue()===n&&i.push(f.getKey())};try{for(var a=LF(this.values.entries()),s=a.next();!s.done;s=a.next()){var l=FF(s.value,2),c=l[0],u=l[1];o(c,u)}}catch(h){e={error:h}}finally{try{s&&!s.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}return Je.toIntArray(i)},r.prototype.getConfidence=function(e){return this.values.get(e)},r}(),CF=globalThis&&globalThis.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Il=globalThis&&globalThis.__values||function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ud=function(r){CF(e,r);function e(t,n){var i=r.call(this,t)||this;return i._isLeft=n,i}return e.prototype.setRowNumbers=function(){var t,n;try{for(var i=Il(this.getCodewords()),o=i.next();!o.done;o=i.next()){var a=o.value;a!=null&&a.setRowNumberAsRowIndicatorColumn()}}catch(s){t={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}},e.prototype.adjustCompleteIndicatorColumnRowNumbers=function(t){var n=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(n,t);for(var i=this.getBoundingBox(),o=this._isLeft?i.getTopLeft():i.getTopRight(),a=this._isLeft?i.getBottomLeft():i.getBottomRight(),s=this.imageRowToCodewordIndex(Math.trunc(o.getY())),l=this.imageRowToCodewordIndex(Math.trunc(a.getY())),c=-1,u=1,h=0,d=s;d=t.getRowCount()||p>d)n[d]=null;else{var g=void 0;u>2?g=(u-2)*p:g=p;for(var v=g>=d,R=1;R<=g&&!v;R++)v=n[d-R]!=null;v?n[d]=null:(c=f.getRowNumber(),h=1)}}},e.prototype.getRowHeights=function(){var t,n,i=this.getBarcodeMetadata();if(i==null)return null;this.adjustIncompleteIndicatorColumnRowNumbers(i);var o=new Int32Array(i.getRowCount());try{for(var a=Il(this.getCodewords()),s=a.next();!s.done;s=a.next()){var l=s.value;if(l!=null){var c=l.getRowNumber();if(c>=o.length)continue;o[c]++}}}catch(u){t={error:u}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return o},e.prototype.adjustIncompleteIndicatorColumnRowNumbers=function(t){for(var n=this.getBoundingBox(),i=this._isLeft?n.getTopLeft():n.getTopRight(),o=this._isLeft?n.getBottomLeft():n.getBottomRight(),a=this.imageRowToCodewordIndex(Math.trunc(i.getY())),s=this.imageRowToCodewordIndex(Math.trunc(o.getY())),l=this.getCodewords(),c=-1,u=a;u=t.getRowCount()?l[u]=null:c=h.getRowNumber())}},e.prototype.getBarcodeMetadata=function(){var t,n,i=this.getCodewords(),o=new wo,a=new wo,s=new wo,l=new wo;try{for(var c=Il(i),u=c.next();!u.done;u=c.next()){var h=u.value;if(h!=null){h.setRowNumberAsRowIndicatorColumn();var d=h.getValue()%30,f=h.getRowNumber();switch(this._isLeft||(f+=2),f%3){case 0:a.setValue(d*3+1);break;case 1:l.setValue(d/3),s.setValue(d%3);break;case 2:o.setValue(d+1);break}}}}catch(g){t={error:g}}finally{try{u&&!u.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}if(o.getValue().length===0||a.getValue().length===0||s.getValue().length===0||l.getValue().length===0||o.getValue()[0]<1||a.getValue()[0]+s.getValue()[0]Je.MAX_ROWS_IN_BARCODE)return null;var p=new NF(o.getValue()[0],a.getValue()[0],s.getValue()[0],l.getValue()[0]);return this.removeIncorrectCodewords(i,p),p},e.prototype.removeIncorrectCodewords=function(t,n){for(var i=0;in.getRowCount()){t[i]=null;continue}switch(this._isLeft||(s+=2),s%3){case 0:a*3+1!==n.getRowCountUpperPart()&&(t[i]=null);break;case 1:(Math.trunc(a/3)!==n.getErrorCorrectionLevel()||a%3!==n.getRowCountLowerPart())&&(t[i]=null);break;case 2:a+1!==n.getColumnCount()&&(t[i]=null);break}}}},e.prototype.isLeft=function(){return this._isLeft},e.prototype.toString=function(){return"IsLeft: "+this._isLeft+` +`+r.prototype.toString.call(this)},e}(S1),AF=globalThis&&globalThis.__values||function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")},DF=function(){function r(e,t){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=e,this.barcodeColumnCount=e.getColumnCount(),this.boundingBox=t,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 e=Je.MAX_CODEWORDS_IN_BARCODE,t;do t=e,e=this.adjustRowNumbersAndGetCount();while(e>0&&e0&&o0&&(c[0]=n[t-1],c[4]=s[t-1],c[5]=l[t-1]),t>1&&(c[8]=n[t-2],c[10]=s[t-2],c[11]=l[t-2]),t>=1;n=t&1,r.RATIOS_TABLE[e]||(r.RATIOS_TABLE[e]=new Array(Je.BARS_IN_MODULE)),r.RATIOS_TABLE[e][Je.BARS_IN_MODULE-i-1]=Math.fround(o/Je.MODULES_IN_CODEWORD)}this.bSymbolTableReady=!0},r.getDecodedValue=function(e){var t=r.getDecodedCodewordValue(r.sampleBitCounts(e));return t!==-1?t:r.getClosestDecodedValue(e)},r.sampleBitCounts=function(e){for(var t=je.sum(e),n=new Int32Array(Je.BARS_IN_MODULE),i=0,o=0,a=0;a1)for(var i=0;i=o)break}le.length||n<0||t+n>e.length||t+n<0)throw new bu;if(n===0)return;for(var i=0;i0&&this.grow(t)},e.prototype.grow=function(t){var n=this.buf.length,i=n<<1;if(i-t<0&&(i=t),i<0){if(t<0)throw new QF;i=Ut.MAX_VALUE}this.buf=Bt.copyOfUint8Array(this.buf,i)},e.prototype.write=function(t){this.ensureCapacity(this.count+1),this.buf[this.count]=t,this.count+=1},e.prototype.writeBytesOffset=function(t,n,i){if(n<0||n>t.length||i<0||n+i-t.length>0)throw new bu;this.ensureCapacity(this.count+i),mt.arraycopy(t,n,this.buf,this.count,i),this.count+=i},e.prototype.writeTo=function(t){t.writeBytesOffset(this.buf,0,this.count)},e.prototype.reset=function(){this.count=0},e.prototype.toByteArray=function(){return Bt.copyOfUint8Array(this.buf,this.count)},e.prototype.size=function(){return this.count},e.prototype.toString=function(t){return t?typeof t=="string"?this.toString_string(t):this.toString_number(t):this.toString_void()},e.prototype.toString_void=function(){return new String(this.buf).toString()},e.prototype.toString_string=function(t){return new String(this.buf).toString()},e.prototype.toString_number=function(t){return new String(this.buf).toString()},e.prototype.close=function(){},e}(kF),ct;(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"})(ct||(ct={}));function x1(){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 Ra;function Nn(r){if(typeof Ra=="undefined"&&(Ra=x1()),Ra===null)throw new Error("BigInt is not supported!");return Ra(r)}function BF(){var r=[];r[0]=Nn(1);var e=Nn(900);r[1]=e;for(var t=2;t<16;t++)r[t]=r[t-1]*e;return r}var GF=function(){function r(){}return r.decode=function(e,t){var n=new Ze(""),i=Ht.ISO8859_1;n.enableDecoding(i);for(var o=1,a=e[o++],s=new WF;oe[0])throw Ee.getFormatInstance();for(var i=new Int32Array(r.NUMBER_OF_SEQUENCE_CODEWORDS),o=0;o0){for(var d=0;d<6;++d)a.write(Number(Nn(l)>>Nn(8*(5-d))));l=0,s=0}break}i===t[0]&&h0){for(var d=0;d<6;++d)a.write(Number(Nn(l)>>Nn(8*(5-d))));l=0,s=0}}break}return o.append(Yr.decode(a.toByteArray(),n)),i},r.numericCompaction=function(e,t,n){for(var i=0,o=!1,a=new Int32Array(r.MAX_NUMERIC_CODEWORDS);t0&&(n.append(r.decodeBase900toBase10(a,i)),i=0)}return t},r.decodeBase900toBase10=function(e,t){for(var n=Nn(0),i=0;i@[\\]_\`~!\r ,: +-.$/"|*()?{}'`,r.MIXED_CHARS="0123456789&\r ,:#-.$/+%*=^",r.EXP900=x1()?BF():[],r.NUMBER_OF_SEQUENCE_CODEWORDS=2,r}(),go=globalThis&&globalThis.__values||function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")},JF=function(){function r(){}return r.decode=function(e,t,n,i,o,a,s){for(var l=new hc(e,t,n,i,o),c=null,u=null,h,d=!0;;d=!1){if(t!=null&&(c=r.getRowIndicatorColumn(e,l,t,!0,a,s)),i!=null&&(u=r.getRowIndicatorColumn(e,l,i,!1,a,s)),h=r.merge(c,u),h==null)throw we.getNotFoundInstance();var f=h.getBoundingBox();if(d&&f!=null&&(f.getMinY()l.getMaxY()))l=f;else break}h.setBoundingBox(l);var p=h.getBarcodeColumnCount()+1;h.setDetectionResultColumn(0,c),h.setDetectionResultColumn(p,u);for(var g=c!=null,v=1;v<=p;v++){var R=g?v:p-v;if(h.getDetectionResultColumn(R)===void 0){var m=void 0;R===0||R===p?m=new ud(l,R===0):m=new S1(l),h.setDetectionResultColumn(R,m);for(var x=-1,T=x,P=l.getMinY();P<=l.getMaxY();P++){if(x=r.getStartColumn(h,R,P,g),x<0||x>l.getMaxX()){if(T===-1)continue;x=T}var A=r.detectCodeword(e,l.getMinX(),l.getMaxX(),g,x,P,a,s);A!=null&&(m.setCodeword(P,A),T=x,a=Math.min(a,A.getWidth()),s=Math.max(s,A.getWidth()))}}}return r.createDecoderResult(h)},r.merge=function(e,t){if(e==null&&t==null)return null;var n=r.getBarcodeMetadata(e,t);if(n==null)return null;var i=hc.merge(r.adjustBoundingBox(e),r.adjustBoundingBox(t));return new DF(n,i)},r.adjustBoundingBox=function(e){var t,n;if(e==null)return null;var i=e.getRowHeights();if(i==null)return null;var o=r.getMax(i),a=0;try{for(var s=go(i),l=s.next();!l.done;l=s.next()){var c=l.value;if(a+=o-c,c>0)break}}catch(f){t={error:f}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}for(var u=e.getCodewords(),h=0;a>0&&u[h]==null;h++)a--;for(var d=0,h=i.length-1;h>=0&&(d+=o-i[h],!(i[h]>0));h--);for(var h=u.length-1;d>0&&u[h]==null;h--)d--;return e.getBoundingBox().addMissingRows(a,d,e.isLeft())},r.getMax=function(e){var t,n,i=-1;try{for(var o=go(e),a=o.next();!a.done;a=o.next()){var s=a.value;i=Math.max(i,s)}}catch(l){t={error:l}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return i},r.getBarcodeMetadata=function(e,t){var n;if(e==null||(n=e.getBarcodeMetadata())==null)return t==null?null:t.getBarcodeMetadata();var i;return t==null||(i=t.getBarcodeMetadata())==null?n:n.getColumnCount()!==i.getColumnCount()&&n.getErrorCorrectionLevel()!==i.getErrorCorrectionLevel()&&n.getRowCount()!==i.getRowCount()?null:n},r.getRowIndicatorColumn=function(e,t,n,i,o,a){for(var s=new ud(t,i),l=0;l<2;l++)for(var c=l===0?1:-1,u=Math.trunc(Math.trunc(n.getX())),h=Math.trunc(Math.trunc(n.getY()));h<=t.getMaxY()&&h>=t.getMinY();h+=c){var d=r.detectCodeword(e,0,e.getWidth(),i,u,h,o,a);d!=null&&(s.setCodeword(h,d),i?u=d.getStartX():u=d.getEndX())}return s},r.adjustCodewordCount=function(e,t){var n=t[0][1],i=n.getValue(),o=e.getBarcodeColumnCount()*e.getBarcodeRowCount()-r.getNumberOfECCodeWords(e.getBarcodeECLevel());if(i.length===0){if(o<1||o>Je.MAX_CODEWORDS_IN_BARCODE)throw we.getNotFoundInstance();n.setValue(o)}else i[0]!==o&&n.setValue(o)},r.createDecoderResult=function(e){var t=r.createBarcodeMatrix(e);r.adjustCodewordCount(e,t);for(var n=new Array,i=new Int32Array(e.getBarcodeRowCount()*e.getBarcodeColumnCount()),o=[],a=new Array,s=0;s0;){for(var l=0;l=0){if(v>=a.length)continue;a[v][c].setValue(g.getValue())}}}}catch(R){i={error:R}}finally{try{p&&!p.done&&(o=f.return)&&o.call(f)}finally{if(i)throw i.error}}c++}}catch(R){t={error:R}}finally{try{h&&!h.done&&(n=u.return)&&n.call(u)}finally{if(t)throw t.error}}return a},r.isValidBarcodeColumn=function(e,t){return t>=0&&t<=e.getBarcodeColumnCount()+1},r.getStartColumn=function(e,t,n,i){var o,a,s=i?1:-1,l=null;if(r.isValidBarcodeColumn(e,t-s)&&(l=e.getDetectionResultColumn(t-s).getCodeword(n)),l!=null)return i?l.getEndX():l.getStartX();if(l=e.getDetectionResultColumn(t).getCodewordNearby(n),l!=null)return i?l.getStartX():l.getEndX();if(r.isValidBarcodeColumn(e,t-s)&&(l=e.getDetectionResultColumn(t-s).getCodewordNearby(n)),l!=null)return i?l.getEndX():l.getStartX();for(var c=0;r.isValidBarcodeColumn(e,t-s);){t-=s;try{for(var u=(o=void 0,go(e.getDetectionResultColumn(t).getCodewords())),h=u.next();!h.done;h=u.next()){var d=h.value;if(d!=null)return(i?d.getEndX():d.getStartX())+s*c*(d.getEndX()-d.getStartX())}}catch(f){o={error:f}}finally{try{h&&!h.done&&(a=u.return)&&a.call(u)}finally{if(o)throw o.error}}c++}return i?e.getBoundingBox().getMinX():e.getBoundingBox().getMaxX()},r.detectCodeword=function(e,t,n,i,o,a,s,l){o=r.adjustCodewordStartColumn(e,t,n,i,o,a);var c=r.getModuleBitCount(e,t,n,i,o,a);if(c==null)return null;var u,h=je.sum(c);if(i)u=o+h;else{for(var d=0;d=t)&&c=t:sr.CODEWORD_SKEW_SIZE)return o;s+=l}l=-l,i=!i}return s},r.checkCodewordSkew=function(e,t,n){return t-r.CODEWORD_SKEW_SIZE<=e&&e<=n+r.CODEWORD_SKEW_SIZE},r.decodeCodewords=function(e,t,n){if(e.length===0)throw Ee.getFormatInstance();var i=1<n/2+r.MAX_ERRORS||n<0||n>r.MAX_EC_CODEWORDS)throw Yt.getChecksumInstance();return r.errorCorrection.decode(e,n,t)},r.verifyCodewordCount=function(e,t){if(e.length<4)throw Ee.getFormatInstance();var n=e[0];if(n>e.length)throw Ee.getFormatInstance();if(n===0)if(t>=1;return t},r.getCodewordBucketNumber=function(e){return e instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(e):this.getCodewordBucketNumber_number(e)},r.getCodewordBucketNumber_number=function(e){return r.getCodewordBucketNumber(r.getBitCountForCodeword(e))},r.getCodewordBucketNumber_Int32Array=function(e){return(e[0]-e[2]+e[4]-e[6]+9)%9},r.toString=function(e){for(var t=new Eu,n=0;n=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Ha=function(){function r(){}return r.prototype.decode=function(e,t){t===void 0&&(t=null);var n=r.decode(e,t,!1);if(n==null||n.length===0||n[0]==null)throw we.getNotFoundInstance();return n[0]},r.prototype.decodeMultiple=function(e,t){t===void 0&&(t=null);try{return r.decode(e,t,!0)}catch(n){throw n instanceof Ee||n instanceof Yt?we.getNotFoundInstance():n}},r.decode=function(e,t,n){var i,o,a=new Array,s=bF.detectMultiple(e,t,n);try{for(var l=zF(s.getPoints()),c=l.next();!c.done;c=l.next()){var u=c.value,h=JF.decode(s.getBits(),u[4],u[5],u[6],u[7],r.getMinCodewordWidth(u),r.getMaxCodewordWidth(u)),d=new gr(h.getText(),h.getRawBytes(),void 0,u,De.PDF_417);d.putMetadata(sr.ERROR_CORRECTION_LEVEL,h.getECLevel());var f=h.getOther();f!=null&&d.putMetadata(sr.PDF417_EXTRA_METADATA,f),a.push(d)}}catch(p){i={error:p}}finally{try{c&&!c.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}return a.map(function(p){return p})},r.getMaxWidth=function(e,t){return e==null||t==null?0:Math.trunc(Math.abs(e.getX()-t.getX()))},r.getMinWidth=function(e,t){return e==null||t==null?Ut.MAX_VALUE:Math.trunc(Math.abs(e.getX()-t.getX()))},r.getMaxCodewordWidth=function(e){return Math.floor(Math.max(Math.max(r.getMaxWidth(e[0],e[4]),r.getMaxWidth(e[6],e[2])*Je.MODULES_IN_CODEWORD/Je.MODULES_IN_STOP_PATTERN),Math.max(r.getMaxWidth(e[1],e[5]),r.getMaxWidth(e[7],e[3])*Je.MODULES_IN_CODEWORD/Je.MODULES_IN_STOP_PATTERN)))},r.getMinCodewordWidth=function(e){return Math.floor(Math.min(Math.min(r.getMinWidth(e[0],e[4]),r.getMinWidth(e[6],e[2])*Je.MODULES_IN_CODEWORD/Je.MODULES_IN_STOP_PATTERN),Math.min(r.getMinWidth(e[1],e[5]),r.getMinWidth(e[7],e[3])*Je.MODULES_IN_CODEWORD/Je.MODULES_IN_STOP_PATTERN)))},r.prototype.reset=function(){},r}(),$F=globalThis&&globalThis.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),fd=function(r){$F(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.kind="ReaderException",e}(Tr),dd=globalThis&&globalThis.__values||function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")},b1=function(){function r(){}return r.prototype.decode=function(e,t){return this.setHints(t),this.decodeInternal(e)},r.prototype.decodeWithState=function(e){return(this.readers===null||this.readers===void 0)&&this.setHints(null),this.decodeInternal(e)},r.prototype.setHints=function(e){this.hints=e;var t=e!=null&&e.get(vt.TRY_HARDER)!==void 0,n=e==null?null:e.get(vt.POSSIBLE_FORMATS),i=new Array;if(n!=null){var o=n.some(function(a){return a===De.UPC_A||a===De.UPC_E||a===De.EAN_13||a===De.EAN_8||a===De.CODABAR||a===De.CODE_39||a===De.CODE_93||a===De.CODE_128||a===De.ITF||a===De.RSS_14||a===De.RSS_EXPANDED});o&&!t&&i.push(new bi(e)),n.includes(De.QR_CODE)&&i.push(new Ka),n.includes(De.DATA_MATRIX)&&i.push(new Qa),n.includes(De.AZTEC)&&i.push(new ka),n.includes(De.PDF_417)&&i.push(new Ha),o&&t&&i.push(new bi(e))}i.length===0&&(t||i.push(new bi(e)),i.push(new Ka),i.push(new Qa),i.push(new ka),i.push(new Ha),t&&i.push(new bi(e))),this.readers=i},r.prototype.reset=function(){var e,t;if(this.readers!==null)try{for(var n=dd(this.readers),i=n.next();!i.done;i=n.next()){var o=i.value;o.reset()}}catch(a){e={error:a}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},r.prototype.decodeInternal=function(e){var t,n;if(this.readers===null)throw new fd("No readers where selected, nothing can be read.");try{for(var i=dd(this.readers),o=i.next();!o.done;o=i.next()){var a=o.value;try{return a.decode(e,this.hints)}catch(s){if(s instanceof fd)continue}}}catch(s){t={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}throw new we("No MultiFormat Readers were able to detect the code.")},r}(),jF=globalThis&&globalThis.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();(function(r){jF(e,r);function e(t,n){t===void 0&&(t=null),n===void 0&&(n=500);var i=this,o=new b1;return o.setHints(t),i=r.call(this,o,n)||this,i}return e.prototype.decodeBitmap=function(t){return this.reader.decodeWithState(t)},e})($i);var qF=globalThis&&globalThis.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();(function(r){qF(e,r);function e(t){return t===void 0&&(t=500),r.call(this,new Ha,t)||this}return e})($i);var eC=globalThis&&globalThis.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();(function(r){eC(e,r);function e(t){return t===void 0&&(t=500),r.call(this,new Ka,t)||this}return e})($i);var fc;(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"})(fc||(fc={}));var ln=fc,tC=function(){function r(e){this.field=e,this.cachedGenerators=[],this.cachedGenerators.push(new Xn(e,Int32Array.from([1])))}return r.prototype.buildGenerator=function(e){var t=this.cachedGenerators;if(e>=t.length)for(var n=t[t.length-1],i=this.field,o=t.length;o<=e;o++){var a=n.multiply(new Xn(i,Int32Array.from([1,i.exp(o-1+i.getGeneratorBase())])));t.push(a),n=a}return t[e]},r.prototype.encode=function(e,t){if(t===0)throw new Xe("No error correction bytes");var n=e.length-t;if(n<=0)throw new Xe("No data bytes provided");var i=this.buildGenerator(t),o=new Int32Array(n);mt.arraycopy(e,0,o,0,n);var a=new Xn(this.field,o);a=a.multiplyByMonomial(t,1);for(var s=a.divide(i)[1],l=s.getCoefficients(),c=t-l.length,u=0;u=5&&(n+=r.N1+(l-5)),l=1,c=h)}l>=5&&(n+=r.N1+(l-5))}return n},r.N1=3,r.N2=3,r.N3=40,r.N4=10,r}(),rC=globalThis&&globalThis.__values||function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")},nC=function(){function r(e,t){this.width=e,this.height=t;for(var n=new Array(t),i=0;i!==t;i++)n[i]=new Uint8Array(e);this.bytes=n}return r.prototype.getHeight=function(){return this.height},r.prototype.getWidth=function(){return this.width},r.prototype.get=function(e,t){return this.bytes[t][e]},r.prototype.getArray=function(){return this.bytes},r.prototype.setNumber=function(e,t,n){this.bytes[t][e]=n},r.prototype.setBoolean=function(e,t,n){this.bytes[t][e]=n?1:0},r.prototype.clear=function(e){var t,n;try{for(var i=rC(this.bytes),o=i.next();!o.done;o=i.next()){var a=o.value;Bt.fill(a,e)}}catch(s){t={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}},r.prototype.equals=function(e){if(!(e instanceof r))return!1;var t=e;if(this.width!==t.width||this.height!==t.height)return!1;for(var n=0,i=this.height;n> +`),e.toString()},r.prototype.setMode=function(e){this.mode=e},r.prototype.setECLevel=function(e){this.ecLevel=e},r.prototype.setVersion=function(e){this.version=e},r.prototype.setMaskPattern=function(e){this.maskPattern=e},r.prototype.setMatrix=function(e){this.matrix=e},r.isValidMaskPattern=function(e){return e>=0&&e0;){for(a===6&&(a-=1);s>=0&&s=n;)e^=t<=0)for(var l=0;l!==a;l++){var c=i[l];c>=0&&r.isEmpty(t.get(c,s))&&r.embedPositionAdjustmentPattern(c-2,s-2,t)}}},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}(),oC=function(){function r(e,t){this.dataBytes=e,this.errorCorrectionBytes=t}return r.prototype.getDataBytes=function(){return this.dataBytes},r.prototype.getErrorCorrectionBytes=function(){return this.errorCorrectionBytes},r}(),gd=globalThis&&globalThis.__values||function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")},aC=function(){function r(){}return r.calculateMaskPenalty=function(e){return So.applyMaskPenaltyRule1(e)+So.applyMaskPenaltyRule2(e)+So.applyMaskPenaltyRule3(e)+So.applyMaskPenaltyRule4(e)},r.encode=function(e,t,n){n===void 0&&(n=null);var i=r.DEFAULT_BYTE_MODE_ENCODING,o=n!==null&&n.get(ln.CHARACTER_SET)!==void 0;o&&(i=n.get(ln.CHARACTER_SET).toString());var a=this.chooseMode(e,i),s=new br;if(a===xt.BYTE&&(o||r.DEFAULT_BYTE_MODE_ENCODING!==i)){var l=Ht.getCharacterSetECIByName(i);l!==void 0&&this.appendECI(l,s)}this.appendModeInfo(a,s);var c=new br;this.appendBytes(e,a,c,i);var u;if(n!==null&&n.get(ln.QR_VERSION)!==void 0){var h=Number.parseInt(n.get(ln.QR_VERSION).toString(),10);u=ti.getVersionForNumber(h);var d=this.calculateBitsNeeded(a,s,c,u);if(!this.willFit(d,u,t))throw new St("Data too big for requested version")}else u=this.recommendVersion(t,a,s,c);var f=new br;f.appendBitArray(s);var p=a===xt.BYTE?c.getSizeInBytes():e.length;this.appendLengthInfo(p,u,a,f),f.appendBitArray(c);var g=u.getECBlocksForLevel(t),v=u.getTotalCodewords()-g.getTotalECCodewords();this.terminateBits(v,f);var R=this.interleaveWithECBytes(f,u.getTotalCodewords(),v,g.getNumBlocks()),m=new dc;m.setECLevel(t),m.setMode(a),m.setVersion(u);var x=u.getDimensionForVersion(),T=new nC(x,x),P=this.chooseMaskPattern(R,t,u,T);return m.setMaskPattern(P),pd.buildMatrix(R,t,u,P,T),m.setMatrix(T),m},r.recommendVersion=function(e,t,n,i){var o=this.calculateBitsNeeded(t,n,i,ti.getVersionForNumber(1)),a=this.chooseVersion(o,e),s=this.calculateBitsNeeded(t,n,i,a);return this.chooseVersion(s,e)},r.calculateBitsNeeded=function(e,t,n,i){return t.getSize()+e.getCharacterCountBits(i)+n.getSize()},r.getAlphanumericCode=function(e){return e159)&&(o<224||o>235))return!1}return!0},r.chooseMaskPattern=function(e,t,n,i){for(var o=Number.MAX_SAFE_INTEGER,a=-1,s=0;s=l},r.terminateBits=function(e,t){var n=e*8;if(t.getSize()>n)throw new St("data bits cannot fit in the QR Code"+t.getSize()+" > "+n);for(var i=0;i<4&&t.getSize()0)for(var i=o;i<8;i++)t.appendBit(!1);for(var a=e-t.getSizeInBytes(),i=0;i=n)throw new St("Block ID too large");var s=e%n,l=n-s,c=Math.floor(e/n),u=c+1,h=Math.floor(t/n),d=h+1,f=c-h,p=u-d;if(f!==p)throw new St("EC bytes mismatch");if(n!==l+s)throw new St("RS blocks mismatch");if(e!==(h+f)*l+(d+p)*s)throw new St("Total bytes mismatch");i=1<=0&&t<=9},r.appendNumericBytes=function(e,t){for(var n=e.length,i=0;i=33088&&l<=40956?c=l-33088:l>=57408&&l<=60351&&(c=l-49472),c===-1)throw new St("Invalid byte sequence");var u=(c>>8)*192+(c&255);t.appendBits(u,13)}},r.appendECI=function(e,t){t.appendBits(xt.ECI.getBits(),4),t.appendBits(e.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=Ht.UTF8.getName(),r}(),sC=globalThis&&globalThis.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();(function(r){sC(e,r);function e(t,n,i,o,a,s,l,c){var u=r.call(this,s,l)||this;if(u.yuvData=t,u.dataWidth=n,u.dataHeight=i,u.left=o,u.top=a,o+s>n||a+l>i)throw new Xe("Crop rectangle does not fit within image data.");return c&&u.reverseHorizontal(s,l),u}return e.prototype.getRow=function(t,n){if(t<0||t>=this.getHeight())throw new Xe("Requested row is outside the image: "+t);var i=this.getWidth();(n==null||n.length>16&255,g=f>>7&510,v=f&255;h[d]=(p+g+v)/4&255}c.luminances=h}else c.luminances=t;if(o===void 0&&(c.dataWidth=n),a===void 0&&(c.dataHeight=i),s===void 0&&(c.left=0),l===void 0&&(c.top=0),c.left+n>c.dataWidth||c.top+i>c.dataHeight)throw new Xe("Crop rectangle does not fit within image data.");return c}return e.prototype.getRow=function(t,n){if(t<0||t>=this.getHeight())throw new Xe("Requested row is outside the image: "+t);var i=this.getWidth();(n==null||n.length=256&&(t^=fC);return{LOG:r,ALOG:e}};pc=dC([],[]),pc.LOG;pc.ALOG;var Rd;(function(r){r[r.FORCE_NONE=0]="FORCE_NONE",r[r.FORCE_SQUARE=1]="FORCE_SQUARE",r[r.FORCE_RECTANGLE=2]="FORCE_RECTANGLE"})(Rd||(Rd={}));var md=129,O1=230,pC=231,gC=235,RC=236,mC=237,vC=238,yC=239,wC=240,Nl=254,SC=254,vd="[)>05",yd="[)>06",wd="",st=0,nr=1,yr=2,Qt=3,jt=4,ur=5,xC=function(){function r(){}return r.prototype.getEncodingMode=function(){return st},r.prototype.encode=function(e){var t=Br.determineConsecutiveDigitCount(e.getMessage(),e.pos);if(t>=2)e.writeCodeword(this.encodeASCIIDigits(e.getMessage().charCodeAt(e.pos),e.getMessage().charCodeAt(e.pos+1))),e.pos+=2;else{var n=e.getCurrentChar(),i=Br.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode());if(i!==this.getEncodingMode())switch(i){case ur:e.writeCodeword(pC),e.signalEncoderChange(ur);return;case nr:e.writeCodeword(O1),e.signalEncoderChange(nr);return;case Qt:e.writeCodeword(vC),e.signalEncoderChange(Qt);break;case yr:e.writeCodeword(yC),e.signalEncoderChange(yr);break;case jt:e.writeCodeword(wC),e.signalEncoderChange(jt);break;default:throw new Error("Illegal mode: "+i)}else Br.isExtendedASCII(n)?(e.writeCodeword(gC),e.writeCodeword(n-128+1),e.pos++):(e.writeCodeword(n+1),e.pos++)}},r.prototype.encodeASCIIDigits=function(e,t){if(Br.isDigit(e)&&Br.isDigit(t)){var n=(e-48)*10+(t-48);return n+130}throw new Error("not digits: "+e+t)},r}(),bC=function(){function r(){}return r.prototype.getEncodingMode=function(){return ur},r.prototype.encode=function(e){var t=new Ze;for(t.append(0);e.hasMoreCharacters();){var n=e.getCurrentChar();t.append(n),e.pos++;var i=Br.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode());if(i!==this.getEncodingMode()){e.signalEncoderChange(st);break}}var o=t.length()-1,a=1,s=e.getCodewordCount()+o+a;e.updateSymbolInfo(s);var l=e.getSymbolInfo().getDataCapacity()-s>0;if(e.hasMoreCharacters()||l)if(o<=249)t.setCharAt(0,Rt.getCharAt(o));else if(o<=1555)t.setCharAt(0,Rt.getCharAt(Math.floor(o/250)+249)),t.insert(1,Rt.getCharAt(o%250));else throw new Error("Message length not in valid ranges: "+o);for(var c=0,n=t.length();c3||c!==1))&&(e.pos=i)}t.length()>0&&e.writeCodeword(O1),this.handleEOD(e,t)},r.prototype.encode=function(e){for(var t=new Ze;e.hasMoreCharacters();){var n=e.getCurrentChar();e.pos++;var i=this.encodeChar(n,t),o=Math.floor(t.length()/3)*2,a=e.getCodewordCount()+o;e.updateSymbolInfo(a);var s=e.getSymbolInfo().getDataCapacity()-a;if(!e.hasMoreCharacters()){var l=new Ze;for(t.length()%3===2&&s!==2&&(i=this.backtrackOneCharacter(e,t,l,i));t.length()%3===1&&(i>3||s!==1);)i=this.backtrackOneCharacter(e,t,l,i);break}var c=t.length();if(c%3===0){var u=Br.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode());if(u!==this.getEncodingMode()){e.signalEncoderChange(st);break}}}this.handleEOD(e,t)},r.prototype.backtrackOneCharacter=function(e,t,n,i){var o=t.length(),a=t.toString().substring(0,o-i);t.setLengthToZero(),t.append(a),e.pos--;var s=e.getCurrentChar();return i=this.encodeChar(s,n),e.resetSymbolInfo(),i},r.prototype.writeNextTriplet=function(e,t){e.writeCodewords(this.encodeToCodewords(t.toString()));var n=t.toString().substring(3);t.setLengthToZero(),t.append(n)},r.prototype.handleEOD=function(e,t){var n=Math.floor(t.length()/3*2),i=t.length()%3,o=e.getCodewordCount()+n;e.updateSymbolInfo(o);var a=e.getSymbolInfo().getDataCapacity()-o;if(i===2){for(t.append("\0");t.length()>=3;)this.writeNextTriplet(e,t);e.hasMoreCharacters()&&e.writeCodeword(Nl)}else if(a===1&&i===1){for(;t.length()>=3;)this.writeNextTriplet(e,t);e.hasMoreCharacters()&&e.writeCodeword(Nl),e.pos--}else if(i===0){for(;t.length()>=3;)this.writeNextTriplet(e,t);(a>0||e.hasMoreCharacters())&&e.writeCodeword(Nl)}else throw new Error("Unexpected case. Please report!");e.signalEncoderChange(st)},r.prototype.encodeChar=function(e,t){if(e===" ".charCodeAt(0))return t.append(3),1;if(e>="0".charCodeAt(0)&&e<="9".charCodeAt(0))return t.append(e-48+4),1;if(e>="A".charCodeAt(0)&&e<="Z".charCodeAt(0))return t.append(e-65+14),1;if(e<" ".charCodeAt(0))return t.append(0),t.append(e),2;if(e<="/".charCodeAt(0))return t.append(1),t.append(e-33),2;if(e<="@".charCodeAt(0))return t.append(1),t.append(e-58+15),2;if(e<="_".charCodeAt(0))return t.append(1),t.append(e-91+22),2;if(e<=127)return t.append(2),t.append(e-96),2;t.append(1+"");var n=2;return n+=this.encodeChar(e-128,t),n},r.prototype.encodeToCodewords=function(e){var t=1600*e.charCodeAt(0)+40*e.charCodeAt(1)+e.charCodeAt(2)+1,n=t/256,i=t%256,o=new Ze;return o.append(n),o.append(i),o.toString()},r}(),OC=function(){function r(){}return r.prototype.getEncodingMode=function(){return jt},r.prototype.encode=function(e){for(var t=new Ze;e.hasMoreCharacters();){var n=e.getCurrentChar();this.encodeChar(n,t),e.pos++;var i=t.length();if(i>=4){e.writeCodewords(this.encodeToCodewords(t.toString()));var o=t.toString().substring(4);t.setLengthToZero(),t.append(o);var a=Br.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode());if(a!==this.getEncodingMode()){e.signalEncoderChange(st);break}}}t.append(Rt.getCharAt(31)),this.handleEOD(e,t)},r.prototype.handleEOD=function(e,t){try{var n=t.length();if(n===0)return;if(n===1){e.updateSymbolInfo();var i=e.getSymbolInfo().getDataCapacity()-e.getCodewordCount(),o=e.getRemainingCharacters();if(o>i&&(e.updateSymbolInfo(e.getCodewordCount()+1),i=e.getSymbolInfo().getDataCapacity()-e.getCodewordCount()),o<=i&&i<=2)return}if(n>4)throw new Error("Count must not exceed 4");var a=n-1,s=this.encodeToCodewords(t.toString()),l=!e.hasMoreCharacters(),c=l&&a<=2;if(a<=2){e.updateSymbolInfo(e.getCodewordCount()+a);var i=e.getSymbolInfo().getDataCapacity()-e.getCodewordCount();i>=3&&(c=!1,e.updateSymbolInfo(e.getCodewordCount()+s.length))}c?(e.resetSymbolInfo(),e.pos-=a):e.writeCodewords(s)}finally{e.signalEncoderChange(st)}},r.prototype.encodeChar=function(e,t){e>=" ".charCodeAt(0)&&e<="?".charCodeAt(0)?t.append(e):e>="@".charCodeAt(0)&&e<="^".charCodeAt(0)?t.append(Rt.getCharAt(e-64)):Br.illegalCharacter(Rt.getCharAt(e))},r.prototype.encodeToCodewords=function(e){var t=e.length;if(t===0)throw new Error("StringBuilder must not be empty");var n=e.charAt(0).charCodeAt(0),i=t>=2?e.charAt(1).charCodeAt(0):0,o=t>=3?e.charAt(2).charCodeAt(0):0,a=t>=4?e.charAt(3).charCodeAt(0):0,s=(n<<18)+(i<<12)+(o<<6)+a,l=s>>16&255,c=s>>8&255,u=s&255,h=new Ze;return h.append(l),t>=2&&h.append(c),t>=3&&h.append(u),h.toString()},r}(),TC=globalThis&&globalThis.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),PC=globalThis&&globalThis.__values||function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")},et=function(){function r(e,t,n,i,o,a,s,l){s===void 0&&(s=0),l===void 0&&(l=0),this.rectangular=e,this.dataCapacity=t,this.errorCodewords=n,this.matrixWidth=i,this.matrixHeight=o,this.dataRegions=a,this.rsBlockData=s,this.rsBlockError=l}return r.lookup=function(e,t,n,i,o){var a,s;t===void 0&&(t=0),n===void 0&&(n=null),i===void 0&&(i=null),o===void 0&&(o=!0);try{for(var l=PC(_C),c=l.next();!c.done;c=l.next()){var u=c.value;if(!(t===1&&u.rectangular)&&!(t===2&&!u.rectangular)&&!(n!=null&&(u.getSymbolWidth()i.getWidth()||u.getSymbolHeight()>i.getHeight()))&&e<=u.dataCapacity)return u}}catch(h){a={error:h}}finally{try{c&&!c.done&&(s=l.return)&&s.call(l)}finally{if(a)throw a.error}}if(o)throw new Error("Can't find a symbol arrangement that matches the message. Data codewords: "+e);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(e){return this.rsBlockData},r.prototype.getErrorLengthForInterleavedBlock=function(e){return this.rsBlockError},r}(),EC=function(r){TC(e,r);function e(){return r.call(this,!1,1558,620,22,22,36,-1,62)||this}return e.prototype.getInterleavedBlockCount=function(){return 10},e.prototype.getDataLengthForInterleavedBlock=function(t){return t<=8?156:155},e}(et),_C=[new et(!1,3,5,8,8,1),new et(!1,5,7,10,10,1),new et(!0,5,7,16,6,1),new et(!1,8,10,12,12,1),new et(!0,10,11,14,6,2),new et(!1,12,12,14,14,1),new et(!0,16,14,24,10,1),new et(!1,18,14,16,16,1),new et(!1,22,18,18,18,1),new et(!0,22,18,16,10,2),new et(!1,30,20,20,20,1),new et(!0,32,24,16,14,2),new et(!1,36,24,22,22,1),new et(!1,44,28,24,24,1),new et(!0,49,28,22,14,2),new et(!1,62,36,14,14,4),new et(!1,86,42,16,16,4),new et(!1,114,48,18,18,4),new et(!1,144,56,20,20,4),new et(!1,174,68,22,22,4),new et(!1,204,84,24,24,4,102,42),new et(!1,280,112,14,14,16,140,56),new et(!1,368,144,16,16,16,92,36),new et(!1,456,192,18,18,16,114,48),new et(!1,576,224,20,20,16,144,56),new et(!1,696,272,22,22,16,174,68),new et(!1,816,336,24,24,16,136,56),new et(!1,1050,408,18,18,36,175,68),new et(!1,1304,496,20,20,36,163,62),new EC],IC=function(){function r(e){this.msg=e,this.pos=0,this.skipAtEnd=0;for(var t=e.split("").map(function(s){return s.charCodeAt(0)}),n=new Ze,i=0,o=t.length;ithis.symbolInfo.getDataCapacity())&&(this.symbolInfo=et.lookup(e,this.shape,this.minSize,this.maxSize,!0))},r.prototype.resetSymbolInfo=function(){this.symbolInfo=null},r}(),NC=globalThis&&globalThis.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),MC=function(r){NC(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getEncodingMode=function(){return Qt},e.prototype.encode=function(t){for(var n=new Ze;t.hasMoreCharacters();){var i=t.getCurrentChar();t.pos++,this.encodeChar(i,n);var o=n.length();if(o%3===0){this.writeNextTriplet(t,n);var a=Br.lookAheadTest(t.getMessage(),t.pos,this.getEncodingMode());if(a!==this.getEncodingMode()){t.signalEncoderChange(st);break}}}this.handleEOD(t,n)},e.prototype.encodeChar=function(t,n){switch(t){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:t>="0".charCodeAt(0)&&t<="9".charCodeAt(0)?n.append(t-48+4):t>="A".charCodeAt(0)&&t<="Z".charCodeAt(0)?n.append(t-65+14):Br.illegalCharacter(Rt.getCharAt(t));break}return 1},e.prototype.handleEOD=function(t,n){t.updateSymbolInfo();var i=t.getSymbolInfo().getDataCapacity()-t.getCodewordCount(),o=n.length();t.pos-=o,(t.getRemainingCharacters()>1||i>1||t.getRemainingCharacters()!==i)&&t.writeCodeword(SC),t.getNewEncoding()<0&&t.signalEncoderChange(st)},e}(_u),LC=globalThis&&globalThis.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),FC=function(r){LC(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getEncodingMode=function(){return yr},e.prototype.encodeChar=function(t,n){if(t===" ".charCodeAt(0))return n.append(3),1;if(t>="0".charCodeAt(0)&&t<="9".charCodeAt(0))return n.append(t-48+4),1;if(t>="a".charCodeAt(0)&&t<="z".charCodeAt(0))return n.append(t-97+14),1;if(t<" ".charCodeAt(0))return n.append(0),n.append(t),2;if(t<="/".charCodeAt(0))return n.append(1),n.append(t-33),2;if(t<="@".charCodeAt(0))return n.append(1),n.append(t-58+15),2;if(t>="[".charCodeAt(0)&&t<="_".charCodeAt(0))return n.append(1),n.append(t-91+22),2;if(t==="`".charCodeAt(0))return n.append(2),n.append(0),2;if(t<="Z".charCodeAt(0))return n.append(2),n.append(t-65+1),2;if(t<=127)return n.append(2),n.append(t-123+27),2;n.append(1+"");var i=2;return i+=this.encodeChar(t-128,n),i},e}(_u),CC=function(){function r(){}return r.randomize253State=function(e){var t=149*e%253+1,n=md+t;return n<=254?n:n-254},r.encodeHighLevel=function(e,t,n,i,o){t===void 0&&(t=0),n===void 0&&(n=null),i===void 0&&(i=null),o===void 0&&(o=!1);var a=new _u,s=[new xC,a,new FC,new MC,new OC,new bC],l=new IC(e);l.setSymbolShape(t),l.setSizeConstraints(n,i),e.startsWith(vd)&&e.endsWith(wd)?(l.writeCodeword(RC),l.setSkipAtEnd(2),l.pos+=vd.length):e.startsWith(yd)&&e.endsWith(wd)&&(l.writeCodeword(mC),l.setSkipAtEnd(2),l.pos+=yd.length);var c=st;for(o&&(a.encodeMaximal(l),c=l.getNewEncoding(),l.resetEncoderSignal());l.hasMoreCharacters();)s[c].encode(l),l.getNewEncoding()>=0&&(c=l.getNewEncoding(),l.resetEncoderSignal());var u=l.getCodewordCount();l.updateSymbolInfo();var h=l.getSymbolInfo().getDataCapacity();u=e.length)return n;var i;n===st?i=[0,1,1,1,1,1.25]:(i=[1,2,2,2,2,2.25],i[n]=0);for(var o=0,a=new Uint8Array(6),s=[];;){if(t+o===e.length){Bt.fill(a,0),Bt.fill(s,0);var l=this.findMinimums(i,s,Ut.MAX_VALUE,a),c=this.getMinimumCount(a);if(s[st]===l)return st;if(c===1){if(a[ur]>0)return ur;if(a[jt]>0)return jt;if(a[yr]>0)return yr;if(a[Qt]>0)return Qt}return nr}var u=e.charCodeAt(t+o);if(o++,this.isDigit(u)?i[st]+=.5:this.isExtendedASCII(u)?(i[st]=Math.ceil(i[st]),i[st]+=2):(i[st]=Math.ceil(i[st]),i[st]++),this.isNativeC40(u)?i[nr]+=2/3:this.isExtendedASCII(u)?i[nr]+=8/3:i[nr]+=4/3,this.isNativeText(u)?i[yr]+=2/3:this.isExtendedASCII(u)?i[yr]+=8/3:i[yr]+=4/3,this.isNativeX12(u)?i[Qt]+=2/3:this.isExtendedASCII(u)?i[Qt]+=13/3:i[Qt]+=10/3,this.isNativeEDIFACT(u)?i[jt]+=3/4:this.isExtendedASCII(u)?i[jt]+=17/4:i[jt]+=13/4,this.isSpecialB256(u)?i[ur]+=4:i[ur]++,o>=4){if(Bt.fill(a,0),Bt.fill(s,0),this.findMinimums(i,s,Ut.MAX_VALUE,a),s[st]a&&(n=a,Bt.fill(i,0)),n===a&&(i[o]=i[o]+1)}return n},r.getMinimumCount=function(e){for(var t=0,n=0;n<6;n++)t+=e[n];return t||0},r.isDigit=function(e){return e>="0".charCodeAt(0)&&e<="9".charCodeAt(0)},r.isExtendedASCII=function(e){return e>=128&&e<=255},r.isNativeC40=function(e){return e===" ".charCodeAt(0)||e>="0".charCodeAt(0)&&e<="9".charCodeAt(0)||e>="A".charCodeAt(0)&&e<="Z".charCodeAt(0)},r.isNativeText=function(e){return e===" ".charCodeAt(0)||e>="0".charCodeAt(0)&&e<="9".charCodeAt(0)||e>="a".charCodeAt(0)&&e<="z".charCodeAt(0)},r.isNativeX12=function(e){return this.isX12TermSep(e)||e===" ".charCodeAt(0)||e>="0".charCodeAt(0)&&e<="9".charCodeAt(0)||e>="A".charCodeAt(0)&&e<="Z".charCodeAt(0)},r.isX12TermSep=function(e){return e===13||e==="*".charCodeAt(0)||e===">".charCodeAt(0)},r.isNativeEDIFACT=function(e){return e>=" ".charCodeAt(0)&&e<="^".charCodeAt(0)},r.isSpecialB256=function(e){return!1},r.determineConsecutiveDigitCount=function(e,t){t===void 0&&(t=0);for(var n=e.length,i=t;i=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Sd=function(){function r(e){this.charset=e,this.name=e.name}return r.prototype.canEncode=function(e){try{return Yr.encode(e,this.charset)!=null}catch{return!1}},r}(),AC=function(){function r(e,t,n){var i,o,a,s,l,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(_){return new Sd(uC.forName(_))}),this.encoders=[];var u=[];u.push(new Sd(hC.ISO_8859_1));for(var h=t!=null&&t.name.startsWith("UTF"),d=0;d=this.bytes.length)return!1;for(var n=0;n=this.length())throw new Error(""+e);if(this.isECI(e))throw new Error("value at "+e+" is not a character but an ECI");return this.isFNC1(e)?this.fnc1:this.bytes[e]},r.prototype.subSequence=function(e,t){if(e<0||e>t||t>this.length())throw new Error(""+e);for(var n=new Ze,i=e;i=this.length())throw new Error(""+e);return this.bytes[e]>255&&this.bytes[e]<=999},r.prototype.isFNC1=function(e){if(e<0||e>=this.length())throw new Error(""+e);return this.bytes[e]===1e3},r.prototype.getECIValue=function(e){if(e<0||e>=this.length())throw new Error(""+e);if(!this.isECI(e))throw new Error("value at "+e+" is not an ECI but a character");return this.bytes[e]-256},r.prototype.addEdge=function(e,t,n){(e[t][n.encoderIndex]==null||e[t][n.encoderIndex].cachedTotalSize>n.cachedTotalSize)&&(e[t][n.encoderIndex]=n)},r.prototype.addEdges=function(e,t,n,i,o,a){var s=e.charAt(i).charCodeAt(0),l=0,c=t.length();t.getPriorityEncoderIndex()>=0&&(s===a||t.canEncode(s,t.getPriorityEncoderIndex()))&&(l=t.getPriorityEncoderIndex(),c=l+1);for(var u=l;u=0;a--)h.unshift(f[a]&255);var p=d.previous===null?0:d.previous.encoderIndex;p!==d.encoderIndex&&h.unshift(256+t.getECIValue(d.encoderIndex)),d=d.previous}for(var g=[],a=0;a0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(a)throw a.error}}return o};globalThis&&globalThis.__spread;var bd;(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"})(bd||(bd={}));(function(r){UC(e,r);function e(t,n,i,o,a){var s=r.call(this,t,n,i)||this;return s.shape=o,s.macroId=a,s}return e.prototype.getMacroId=function(){return this.macroId},e.prototype.getShapeHint=function(){return this.shape},e})(XC);var VC=function(){function r(e){this.previous=e}return r.prototype.getPrevious=function(){return this.previous},r}(),YC=globalThis&&globalThis.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),T1=function(r){YC(e,r);function e(t,n,i){var o=r.call(this,t)||this;return o.value=n,o.bitCount=i,o}return e.prototype.appendTo=function(t,n){t.appendBits(this.value,this.bitCount)},e.prototype.add=function(t,n){return new e(this,t,n)},e.prototype.addBinaryShift=function(t,n){return console.warn("addBinaryShift on SimpleToken, this simply returns a copy of this token"),new e(this,t,n)},e.prototype.toString=function(){var t=this.value&(1<"},e}(VC),kC=globalThis&&globalThis.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();(function(r){kC(e,r);function e(t,n,i){var o=r.call(this,t,0,0)||this;return o.binaryShiftStart=n,o.binaryShiftByteCount=i,o}return e.prototype.appendTo=function(t,n){for(var i=0;i62?t.appendBits(this.binaryShiftByteCount-31,16):i===0?t.appendBits(Math.min(this.binaryShiftByteCount,31),5):t.appendBits(this.binaryShiftByteCount-31,5)),t.appendBits(n[this.binaryShiftStart+i],8)},e.prototype.addBinaryShift=function(t,n){return new e(this,t,n)},e.prototype.toString=function(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"},e})(T1);var Po=0,Ba=1,Ti=2,P1=3,xo=4;new T1(null,0,0);var ZC=globalThis&&globalThis.__values||function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")};function QC(r){var e,t;try{for(var n=ZC(r),i=n.next();!i.done;i=n.next()){var o=i.value;Bt.fill(o,-1)}}catch(a){e={error:a}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return r[Po][xo]=0,r[Ba][xo]=0,r[Ba][Po]=28,r[P1][xo]=0,r[Ti][xo]=0,r[Ti][Po]=15,r}QC(Bt.createInt32Array(6,6));globalThis&&globalThis.__values;function KC(r){var e=Rt.getCharCode(" "),t=Rt.getCharCode("."),n=Rt.getCharCode(",");r[Po][e]=1;for(var i=Rt.getCharCode("Z"),o=Rt.getCharCode("A"),a=o;a<=i;a++)r[Po][a]=a-o+2;r[Ba][e]=1;for(var s=Rt.getCharCode("z"),l=Rt.getCharCode("a"),a=l;a<=s;a++)r[Ba][a]=a-l+2;r[Ti][e]=1;for(var c=Rt.getCharCode("9"),u=Rt.getCharCode("0"),a=u;a<=c;a++)r[Ti][a]=a-u+2;r[Ti][n]=12,r[Ti][t]=13;for(var h=["\0"," ","","","","","","","\x07","\b"," ",` +`,"\v","\f","\r","\x1B","","","","","@","\\","^","_","`","|","~","\x7F"],d=0;d","?","[","]","{","}"],d=0;d0&&(r[xo][Rt.getCharCode(f[d])]=d);return r}KC(Bt.createInt32Array(5,256));globalThis&&globalThis.__values;globalThis&&globalThis.__values;var HC=globalThis&&globalThis.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),BC=function(r){HC(e,r);function e(t){var n=r.call(this,t.width,t.height)||this;return n.canvas=t,n.tempCanvasElement=null,n.buffer=e.makeBufferFromCanvasImageData(t),n}return e.makeBufferFromCanvasImageData=function(t){var n;try{n=t.getContext("2d",{willReadFrequently:!0})}catch{n=t.getContext("2d")}if(!n)throw new Error("Couldn't get canvas context.");var i=n.getImageData(0,0,t.width,t.height);return e.toGrayscaleBuffer(i.data,t.width,t.height)},e.toGrayscaleBuffer=function(t,n,i){for(var o=new Uint8ClampedArray(n*i),a=0,s=0,l=t.length;a>10}o[s]=c}return o},e.prototype.getRow=function(t,n){if(t<0||t>=this.getHeight())throw new Xe("Requested row is outside the image: "+t);var i=this.getWidth(),o=t*i;return n===null?n=this.buffer.slice(o,o+i):(n.length0&&o[o.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},zC={delayBetweenScanAttempts:500,delayBetweenScanSuccess:500,tryPlayVideoTimeout:5e3},qi=function(){function r(e,t,n){t===void 0&&(t=new Map),n===void 0&&(n={}),this.reader=e,this.hints=t,this.options=Pi(Pi({},zC),n)}return Object.defineProperty(r.prototype,"possibleFormats",{set:function(e){this.hints.set(vt.POSSIBLE_FORMATS,e)},enumerable:!1,configurable:!0}),r.addVideoSource=function(e,t){try{e.srcObject=t}catch{console.error("got interrupted by new loading request")}},r.mediaStreamSetTorch=function(e,t){return It(this,void 0,void 0,function(){return Nt(this,function(n){switch(n.label){case 0:return[4,e.applyConstraints({advanced:[{fillLightMode:t?"flash":"off",torch:!!t}]})];case 1:return n.sent(),[2]}})})},r.mediaStreamIsTorchCompatible=function(e){var t,n,i=e.getVideoTracks();try{for(var o=Ll(i),a=o.next();!a.done;a=o.next()){var s=a.value;if(r.mediaStreamIsTorchCompatibleTrack(s))return!0}}catch(l){t={error:l}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return!1},r.mediaStreamIsTorchCompatibleTrack=function(e){try{var t=e.getCapabilities();return"torch"in t}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(e){return e.currentTime>0&&!e.paused&&e.readyState>2},r.getMediaElement=function(e,t){var n=document.getElementById(e);if(!n)throw new Xt("element with id '".concat(e,"' not found"));if(n.nodeName.toLowerCase()!==t.toLowerCase())throw new Xt("element with id '".concat(e,"' must be an ").concat(t," element"));return n},r.createVideoElement=function(e){if(e instanceof HTMLVideoElement)return e;if(typeof e=="string")return r.getMediaElement(e,"video");if(!e&&typeof document!="undefined"){var t=document.createElement("video");return t.width=200,t.height=200,t}throw new Error("Couldn't get videoElement from videoSource!")},r.prepareImageElement=function(e){if(e instanceof HTMLImageElement)return e;if(typeof e=="string")return r.getMediaElement(e,"img");if(typeof e=="undefined"){var t=document.createElement("img");return t.width=200,t.height=200,t}throw new Error("Couldn't get imageElement from imageSource!")},r.prepareVideoElement=function(e){var t=r.createVideoElement(e);return t.setAttribute("autoplay","true"),t.setAttribute("muted","true"),t.setAttribute("playsinline","true"),t},r.isImageLoaded=function(e){return!(!e.complete||e.naturalWidth===0)},r.createBinaryBitmapFromCanvas=function(e){var t=new BC(e),n=new f1(t);return new h1(n)},r.drawImageOnCanvas=function(e,t){e.drawImage(t,0,0)},r.getMediaElementDimensions=function(e){if(e instanceof HTMLVideoElement)return{height:e.videoHeight,width:e.videoWidth};if(e instanceof HTMLImageElement)return{height:e.naturalHeight||e.height,width:e.naturalWidth||e.width};throw new Error("Couldn't find the Source's dimensions!")},r.createCaptureCanvas=function(e){if(!e)throw new Xt("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 t=document.createElement("canvas"),n=r.getMediaElementDimensions(e),i=n.width,o=n.height;return t.style.width=i+"px",t.style.height=o+"px",t.width=i,t.height=o,t},r.tryPlayVideo=function(e){return It(this,void 0,void 0,function(){var t;return Nt(this,function(n){switch(n.label){case 0:if(e!=null&&e.ended)return console.error("Trying to play video that has ended."),[2,!1];if(r.isVideoPlaying(e))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,e.play()];case 2:return n.sent(),[2,!0];case 3:return t=n.sent(),console.warn("It was not possible to play the video.",t),[2,!1];case 4:return[2]}})})},r.createCanvasFromMediaElement=function(e){var t=r.createCaptureCanvas(e),n=t.getContext("2d");if(!n)throw new Error("Couldn't find Canvas 2D Context.");return r.drawImageOnCanvas(n,e),t},r.createBinaryBitmapFromMediaElem=function(e){var t=r.createCanvasFromMediaElement(e);return r.createBinaryBitmapFromCanvas(t)},r.destroyImageElement=function(e){e.src="",e.removeAttribute("src"),e=void 0},r.listVideoInputDevices=function(){return It(this,void 0,void 0,function(){var e,t,n,i,o,a,s,l,c,u,h,d;return Nt(this,function(f){switch(f.label){case 0:if(!E1())throw new Error("Can't enumerate devices, navigator is not present.");if(!JC())throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:e=f.sent(),t=[];try{for(n=Ll(e),i=n.next();!i.done;i=n.next())o=i.value,a=o.kind==="video"?"videoinput":o.kind,a==="videoinput"&&(s=o.deviceId||o.id,l=o.label||"Video device ".concat(t.length+1),c=o.groupId,u={deviceId:s,label:l,kind:a,groupId:c},t.push(u))}catch(p){h={error:p}}finally{try{i&&!i.done&&(d=n.return)&&d.call(n)}finally{if(h)throw h.error}}return[2,t]}})})},r.findDeviceById=function(e){return It(this,void 0,void 0,function(){var t;return Nt(this,function(n){switch(n.label){case 0:return[4,r.listVideoInputDevices()];case 1:return t=n.sent(),t?[2,t.find(function(i){return i.deviceId===e})]:[2]}})})},r.cleanVideoSource=function(e){if(!!e){try{e.srcObject=null}catch{e.src=""}e&&e.removeAttribute("src")}},r.releaseAllStreams=function(){r.streamTracker.length!==0&&r.streamTracker.forEach(function(e){e.getTracks().forEach(function(t){return t.stop()})}),r.streamTracker=[]},r.playVideoOnLoadAsync=function(e,t){return It(this,void 0,void 0,function(){var n;return Nt(this,function(i){switch(i.label){case 0:return[4,r.tryPlayVideo(e)];case 1:return n=i.sent(),n?[2,!0]:[2,new Promise(function(o,a){var s=setTimeout(function(){r.isVideoPlaying(e)||(a(!1),e.removeEventListener("canplay",l))},t),l=function(){r.tryPlayVideo(e).then(function(c){clearTimeout(s),e.removeEventListener("canplay",l),o(c)})};e.addEventListener("canplay",l)})]}})})},r.attachStreamToVideo=function(e,t,n){return n===void 0&&(n=5e3),It(this,void 0,void 0,function(){var i;return Nt(this,function(o){switch(o.label){case 0:return i=r.prepareVideoElement(t),r.addVideoSource(i,e),[4,r.playVideoOnLoadAsync(i,n)];case 1:return o.sent(),[2,i]}})})},r._waitImageLoad=function(e){return new Promise(function(t,n){var i=1e4,o=setTimeout(function(){r.isImageLoaded(e)||(e.removeEventListener("load",a),n())},i),a=function(){clearTimeout(o),e.removeEventListener("load",a),t()};e.addEventListener("load",a)})},r.checkCallbackFnOrThrow=function(e){if(!e)throw new Xt("`callbackFn` is a required parameter, you cannot capture results without it.")},r.disposeMediaStream=function(e){e.getVideoTracks().forEach(function(t){return t.stop()}),e=void 0},r.prototype.decode=function(e){var t=r.createCanvasFromMediaElement(e);return this.decodeFromCanvas(t)},r.prototype.decodeBitmap=function(e){return this.reader.decode(e,this.hints)},r.prototype.decodeFromCanvas=function(e){var t=r.createBinaryBitmapFromCanvas(e);return this.decodeBitmap(t)},r.prototype.decodeFromImageElement=function(e){return It(this,void 0,void 0,function(){var t;return Nt(this,function(n){switch(n.label){case 0:if(!e)throw new Xt("An image element must be provided.");return t=r.prepareImageElement(e),[4,this._decodeOnLoadImage(t)];case 1:return[2,n.sent()]}})})},r.prototype.decodeFromImageUrl=function(e){return It(this,void 0,void 0,function(){var t;return Nt(this,function(n){switch(n.label){case 0:if(!e)throw new Xt("An URL must be provided.");t=r.prepareImageElement(),t.src=e,n.label=1;case 1:return n.trys.push([1,,3,4]),[4,this.decodeFromImageElement(t)];case 2:return[2,n.sent()];case 3:return r.destroyImageElement(t),[7];case 4:return[2]}})})},r.prototype.decodeFromConstraints=function(e,t,n){return It(this,void 0,void 0,function(){var i,o;return Nt(this,function(a){switch(a.label){case 0:return r.checkCallbackFnOrThrow(n),[4,this.getUserMedia(e)];case 1:i=a.sent(),a.label=2;case 2:return a.trys.push([2,4,,5]),[4,this.decodeFromStream(i,t,n)];case 3:return[2,a.sent()];case 4:throw o=a.sent(),r.disposeMediaStream(i),o;case 5:return[2]}})})},r.prototype.decodeFromStream=function(e,t,n){return It(this,void 0,void 0,function(){var i,o,a,s,l,c,u,h,d,f=this;return Nt(this,function(p){switch(p.label){case 0:return r.checkCallbackFnOrThrow(n),i=this.options.tryPlayVideoTimeout,[4,r.attachStreamToVideo(e,t,i)];case 1:return o=p.sent(),a=function(){r.disposeMediaStream(e),r.cleanVideoSource(o)},s=this.scan(o,n,a),l=e.getVideoTracks(),c=Pi(Pi({},s),{stop:function(){s.stop()},streamVideoConstraintsApply:function(g,v){return It(this,void 0,void 0,function(){var R,m,x,T,P,A,D;return Nt(this,function(W){switch(W.label){case 0:R=v?l.filter(v):l,W.label=1;case 1:W.trys.push([1,6,7,8]),m=Ll(R),x=m.next(),W.label=2;case 2:return x.done?[3,5]:(T=x.value,[4,T.applyConstraints(g)]);case 3:W.sent(),W.label=4;case 4:return x=m.next(),[3,2];case 5:return[3,8];case 6:return P=W.sent(),A={error:P},[3,8];case 7:try{x&&!x.done&&(D=m.return)&&D.call(m)}finally{if(A)throw A.error}return[7];case 8:return[2]}})})},streamVideoConstraintsGet:function(g){return l.find(g).getConstraints()},streamVideoSettingsGet:function(g){return l.find(g).getSettings()},streamVideoCapabilitiesGet:function(g){return l.find(g).getCapabilities()}}),u=r.mediaStreamIsTorchCompatible(e),u&&(h=l==null?void 0:l.find(function(g){return r.mediaStreamIsTorchCompatibleTrack(g)}),d=function(g){return It(f,void 0,void 0,function(){return Nt(this,function(v){switch(v.label){case 0:return[4,r.mediaStreamSetTorch(h,g)];case 1:return v.sent(),[2]}})})},c.switchTorch=d,c.stop=function(){return It(f,void 0,void 0,function(){return Nt(this,function(g){switch(g.label){case 0:return s.stop(),[4,d(!1)];case 1:return g.sent(),[2]}})})}),[2,c]}})})},r.prototype.decodeFromVideoDevice=function(e,t,n){return It(this,void 0,void 0,function(){var i,o;return Nt(this,function(a){switch(a.label){case 0:return r.checkCallbackFnOrThrow(n),e?i={deviceId:{exact:e}}:i={facingMode:"environment"},o={video:i},[4,this.decodeFromConstraints(o,t,n)];case 1:return[2,a.sent()]}})})},r.prototype.decodeFromVideoElement=function(e,t){return It(this,void 0,void 0,function(){var n,i;return Nt(this,function(o){switch(o.label){case 0:if(r.checkCallbackFnOrThrow(t),!e)throw new Xt("A video element must be provided.");return n=r.prepareVideoElement(e),i=this.options.tryPlayVideoTimeout,[4,r.playVideoOnLoadAsync(n,i)];case 1:return o.sent(),[2,this.scan(n,t)]}})})},r.prototype.decodeFromVideoUrl=function(e,t){return It(this,void 0,void 0,function(){var n,i,o,a;return Nt(this,function(s){switch(s.label){case 0:if(r.checkCallbackFnOrThrow(t),!e)throw new Xt("An URL must be provided.");return n=r.prepareVideoElement(),n.src=e,i=function(){r.cleanVideoSource(n)},o=this.options.tryPlayVideoTimeout,[4,r.playVideoOnLoadAsync(n,o)];case 1:return s.sent(),a=this.scan(n,t,i),[2,a]}})})},r.prototype.decodeOnceFromConstraints=function(e,t){return It(this,void 0,void 0,function(){var n;return Nt(this,function(i){switch(i.label){case 0:return[4,this.getUserMedia(e)];case 1:return n=i.sent(),[4,this.decodeOnceFromStream(n,t)];case 2:return[2,i.sent()]}})})},r.prototype.decodeOnceFromStream=function(e,t){return It(this,void 0,void 0,function(){var n,i,o;return Nt(this,function(a){switch(a.label){case 0:return n=Boolean(t),[4,r.attachStreamToVideo(e,t)];case 1:i=a.sent(),a.label=2;case 2:return a.trys.push([2,,4,5]),[4,this.scanOneResult(i)];case 3:return o=a.sent(),[2,o];case 4:return n||r.cleanVideoSource(i),[7];case 5:return[2]}})})},r.prototype.decodeOnceFromVideoDevice=function(e,t){return It(this,void 0,void 0,function(){var n,i;return Nt(this,function(o){switch(o.label){case 0:return e?n={deviceId:{exact:e}}:n={facingMode:"environment"},i={video:n},[4,this.decodeOnceFromConstraints(i,t)];case 1:return[2,o.sent()]}})})},r.prototype.decodeOnceFromVideoElement=function(e){return It(this,void 0,void 0,function(){var t,n;return Nt(this,function(i){switch(i.label){case 0:if(!e)throw new Xt("A video element must be provided.");return t=r.prepareVideoElement(e),n=this.options.tryPlayVideoTimeout,[4,r.playVideoOnLoadAsync(t,n)];case 1:return i.sent(),[4,this.scanOneResult(t)];case 2:return[2,i.sent()]}})})},r.prototype.decodeOnceFromVideoUrl=function(e){return It(this,void 0,void 0,function(){var t,n;return Nt(this,function(i){switch(i.label){case 0:if(!e)throw new Xt("An URL must be provided.");t=r.prepareVideoElement(),t.src=e,n=this.decodeOnceFromVideoElement(t),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(t),[7];case 4:return[2]}})})},r.prototype.scanOneResult=function(e,t,n,i){var o=this;return t===void 0&&(t=!0),n===void 0&&(n=!0),i===void 0&&(i=!0),new Promise(function(a,s){o.scan(e,function(l,c,u){if(l){a(l),u.stop();return}if(c){if(c instanceof we&&t||c instanceof Yt&&n||c instanceof Ee&&i)return;u.stop(),s(c)}})})},r.prototype.scan=function(e,t,n){var i=this;r.checkCallbackFnOrThrow(t);var o=r.createCaptureCanvas(e),a;try{a=o.getContext("2d",{willReadFrequently:!0})}catch{a=o.getContext("2d")}if(!a)throw new Error("Couldn't create canvas for visual element scan.");var s=function(){a=void 0,o=void 0},l=!1,c,u=function(){l=!0,clearTimeout(c),s(),n&&n()},h={stop:u},d=function(){if(!l)try{r.drawImageOnCanvas(a,e);var f=i.decodeFromCanvas(o);t(f,void 0,h),c=setTimeout(d,i.options.delayBetweenScanSuccess)}catch(R){t(void 0,R,h);var p=R instanceof Yt,g=R instanceof Ee,v=R instanceof we;if(p||g||v){c=setTimeout(d,i.options.delayBetweenScanAttempts);return}s(),n&&n(R)}};return d(),h},r.prototype._decodeOnLoadImage=function(e){return It(this,void 0,void 0,function(){var t;return Nt(this,function(n){switch(n.label){case 0:return t=r.isImageLoaded(e),t?[3,2]:[4,r._waitImageLoad(e)];case 1:n.sent(),n.label=2;case 2:return[2,this.decode(e)]}})})},r.prototype.getUserMedia=function(e){return It(this,void 0,void 0,function(){var t;return Nt(this,function(n){switch(n.label){case 0:return[4,navigator.mediaDevices.getUserMedia(e)];case 1:return t=n.sent(),r.streamTracker.push(t),[2,t]}})})},r.streamTracker=[],r}(),$C=globalThis&&globalThis.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();(function(r){$C(e,r);function e(t,n){return r.call(this,new ka,t,n)||this}return e})(qi);var jC=globalThis&&globalThis.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();(function(r){jC(e,r);function e(t,n){return r.call(this,new bi(t),t,n)||this}return e})(qi);var qC=globalThis&&globalThis.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();(function(r){qC(e,r);function e(t,n){return r.call(this,new Qa,t,n)||this}return e})(qi);var e3=globalThis&&globalThis.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();(function(r){e3(e,r);function e(t,n){var i=this,o=new b1;return o.setHints(t),i=r.call(this,o,t,n)||this,i.reader=o,i}return Object.defineProperty(e.prototype,"possibleFormats",{set:function(t){this.hints.set(vt.POSSIBLE_FORMATS,t),this.reader.setHints(this.hints)},enumerable:!1,configurable:!0}),e.prototype.decodeBitmap=function(t){return this.reader.decodeWithState(t)},e.prototype.setHints=function(t){this.hints=t,this.reader.setHints(this.hints)},e})(qi);var t3=globalThis&&globalThis.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();(function(r){t3(e,r);function e(t,n){return r.call(this,new Ha,t,n)||this}return e})(qi);var r3=globalThis&&globalThis.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),n3=function(r){r3(e,r);function e(t,n){return r.call(this,new Ka,t,n)||this}return e}(qi),Od="http://www.w3.org/2000/svg",i3=function(){function r(){}return r.prototype.write=function(e,t,n,i){if(e.length===0)throw new Xe("Found empty contents");if(t<0||n<0)throw new Xe("Requested dimensions are too small: "+t+"x"+n);var o=uc.L,a=r.QUIET_ZONE_SIZE;if(i){if(i.get(ln.ERROR_CORRECTION)!==void 0){var s=i.get(ln.ERROR_CORRECTION).toString();o=uc.fromString(s)}i.get(ln.MARGIN)!==void 0&&(a=Number.parseInt(i.get(ln.MARGIN).toString(),10))}var l=aC.encode(e,o,i);return this.renderResult(l,t,n,a)},r.prototype.writeToDom=function(e,t,n,i,o){if(typeof e=="string"){var a=document.querySelector(e);if(!a)throw new Error("Could no find the target HTML element.");e=a}var s=this.write(t,n,i,o);e instanceof HTMLElement&&e.appendChild(s)},r.prototype.renderResult=function(e,t,n,i){var o=e.getMatrix();if(o===null)throw new ji;for(var a=o.getWidth(),s=o.getHeight(),l=a+i*2,c=s+i*2,u=Math.max(t,l),h=Math.max(n,c),d=Math.min(Math.floor(u/l),Math.floor(h/c)),f=Math.floor((u-a*d)/2),p=Math.floor((h-s*d)/2),g=this.createSVGElement(u,h),v=0,R=p;v{var t;return e.startElement===e.endElement&&((t=e.startElement)==null?void 0:t.type)===ae.IMAGE},callback:async(e,t)=>{var i;const n=(i=t.startElement)==null?void 0:i.value;if(!!n)try{const s=(await new n3().decodeFromImageUrl(n)).getText();new zt({title:"\u8BC6\u522B\u7ED3\u679C",data:[{type:"textarea",label:"\u5185\u5BB9",height:100,name:"value",value:s}],onConfirm:l=>{console.log(l)}})}catch(o){console.log(o),alert("\u8BC6\u522B\u5931\u8D25")}}}])}var _1={exports:{}};/*! Pickr 1.9.1 MIT | https://github.com/Simonwep/pickr */(function(r,e){(function(t,n){r.exports=n()})(self,()=>(()=>{var t={d:(k,F)=>{for(var Y in F)t.o(F,Y)&&!t.o(k,Y)&&Object.defineProperty(k,Y,{enumerable:!0,get:F[Y]})},o:(k,F)=>Object.prototype.hasOwnProperty.call(k,F),r:k=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(k,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(k,"__esModule",{value:!0})}},n={};t.d(n,{default:()=>y});var i={};function o(k,F,Y,V,ie={}){F instanceof HTMLCollection||F instanceof NodeList?F=Array.from(F):Array.isArray(F)||(F=[F]),Array.isArray(Y)||(Y=[Y]);for(const U of F)for(const N of Y)U[k](N,V,{capture:!1,...ie});return Array.prototype.slice.call(arguments,1)}t.r(i),t.d(i,{adjustableInputNumbers:()=>d,createElementFromString:()=>l,createFromTemplate:()=>c,eventPath:()=>u,off:()=>s,on:()=>a,resolveElement:()=>h});const a=o.bind(null,"addEventListener"),s=o.bind(null,"removeEventListener");function l(k){const F=document.createElement("div");return F.innerHTML=k.trim(),F.firstElementChild}function c(k){const F=(V,ie)=>{const U=V.getAttribute(ie);return V.removeAttribute(ie),U},Y=(V,ie={})=>{const U=F(V,":obj"),N=F(V,":ref"),J=U?ie[U]={}:ie;N&&(ie[N]=V);for(const B of Array.from(V.children)){const re=F(B,":arr"),ee=Y(B,re?{}:J);re&&(J[re]||(J[re]=[])).push(Object.keys(ee).length?ee:B)}return ie};return Y(l(k))}function u(k){let F=k.path||k.composedPath&&k.composedPath();if(F)return F;let Y=k.target.parentElement;for(F=[k.target,Y];Y=Y.parentElement;)F.push(Y);return F.push(document,window),F}function h(k){return k instanceof Element?k:typeof k=="string"?k.split(/>>/g).reduce((F,Y,V,ie)=>(F=F.querySelector(Y),VY){function Y(V){const ie=[.001,.01,.1][Number(V.shiftKey||2*V.ctrlKey)]*(V.deltaY<0?1:-1);let U=0,N=k.selectionStart;k.value=k.value.replace(/[\d.]+/g,(J,B)=>B<=N&&B+J.length>=N?(N=B,F(Number(J),ie,U)):(U++,J)),k.focus(),k.setSelectionRange(N,N),V.preventDefault(),k.dispatchEvent(new Event("input"))}a(k,"focus",()=>a(window,"wheel",Y,{passive:!1})),a(k,"blur",()=>s(window,"wheel",Y))}const{min:f,max:p,floor:g,round:v}=Math;function R(k,F,Y){F/=100,Y/=100;const V=g(k=k/360*6),ie=k-V,U=Y*(1-F),N=Y*(1-ie*F),J=Y*(1-(1-ie)*F),B=V%6;return[255*[Y,N,U,U,J,Y][B],255*[J,Y,Y,N,U,U][B],255*[U,U,J,Y,Y,N][B]]}function m(k,F,Y){const V=(2-(F/=100))*(Y/=100)/2;return V!==0&&(F=V===1?0:V<.5?F*Y/(2*V):F*Y/(2-2*V)),[k,100*F,100*V]}function x(k,F,Y){const V=f(k/=255,F/=255,Y/=255),ie=p(k,F,Y),U=ie-V;let N,J;if(U===0)N=J=0;else{J=U/ie;const B=((ie-k)/6+U/2)/U,re=((ie-F)/6+U/2)/U,ee=((ie-Y)/6+U/2)/U;k===ie?N=ee-re:F===ie?N=1/3+B-ee:Y===ie&&(N=2/3+re-B),N<0?N+=1:N>1&&(N-=1)}return[360*N,100*J,100*ie]}function T(k,F,Y,V){return F/=100,Y/=100,[...x(255*(1-f(1,(k/=100)*(1-(V/=100))+V)),255*(1-f(1,F*(1-V)+V)),255*(1-f(1,Y*(1-V)+V)))]}function P(k,F,Y){F/=100;const V=2*(F*=(Y/=100)<.5?Y:1-Y)/(Y+F)*100,ie=100*(Y+F);return[k,isNaN(V)?0:V,ie]}function A(k){return x(...k.match(/.{2}/g).map(F=>parseInt(F,16)))}function D(k){k=k.match(/^[a-zA-Z]+$/)?function(ie){if(ie.toLowerCase()==="black")return"#000";const U=document.createElement("canvas").getContext("2d");return U.fillStyle=ie,U.fillStyle==="#000"?null:U.fillStyle}(k):k;const F={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},Y=ie=>ie.map(U=>/^(|\d+)\.\d+|\d+$/.test(U)?Number(U):void 0);let V;e:for(const ie in F)if(V=F[ie].exec(k))switch(ie){case"cmyk":{const[,U,N,J,B]=Y(V);if(U>100||N>100||J>100||B>100)break e;return{values:T(U,N,J,B),type:ie}}case"rgba":{let[,U,,N,,J,,,B]=Y(V);if(U=V[2]==="%"?U/100*255:U,N=V[4]==="%"?N/100*255:N,J=V[6]==="%"?J/100*255:J,B=V[9]==="%"?B/100:B,U>255||N>255||J>255||B<0||B>1)break e;return{values:[...x(U,N,J),B],a:B,type:ie}}case"hexa":{let[,U]=V;U.length!==4&&U.length!==3||(U=U.split("").map(B=>B+B).join(""));const N=U.substring(0,6);let J=U.substring(6);return J=J?parseInt(J,16)/255:void 0,{values:[...A(N),J],a:J,type:ie}}case"hsla":{let[,U,N,J,,B]=Y(V);if(B=V[6]==="%"?B/100:B,U>360||N>100||J>100||B<0||B>1)break e;return{values:[...P(U,N,J),B],a:B,type:ie}}case"hsva":{let[,U,N,J,,B]=Y(V);if(B=V[6]==="%"?B/100:B,U>360||N>100||J>100||B<0||B>1)break e;return{values:[U,N,J,B],a:B,type:ie}}}return{values:null,type:null}}function W(k=0,F=0,Y=0,V=1){const ie=(N,J)=>(B=-1)=>J(~B?N.map(re=>Number(re.toFixed(B))):N),U={h:k,s:F,v:Y,a:V,toHSVA(){const N=[U.h,U.s,U.v,U.a];return N.toString=ie(N,J=>`hsva(${J[0]}, ${J[1]}%, ${J[2]}%, ${U.a})`),N},toHSLA(){const N=[...m(U.h,U.s,U.v),U.a];return N.toString=ie(N,J=>`hsla(${J[0]}, ${J[1]}%, ${J[2]}%, ${U.a})`),N},toRGBA(){const N=[...R(U.h,U.s,U.v),U.a];return N.toString=ie(N,J=>`rgba(${J[0]}, ${J[1]}, ${J[2]}, ${U.a})`),N},toCMYK(){const N=function(J,B,re){const ee=R(J,B,re),X=ee[0]/255,C=ee[1]/255,G=ee[2]/255,z=f(1-X,1-C,1-G);return[100*(z===1?0:(1-X-z)/(1-z)),100*(z===1?0:(1-C-z)/(1-z)),100*(z===1?0:(1-G-z)/(1-z)),100*z]}(U.h,U.s,U.v);return N.toString=ie(N,J=>`cmyk(${J[0]}%, ${J[1]}%, ${J[2]}%, ${J[3]}%)`),N},toHEXA(){const N=function(B,re,ee){return R(B,re,ee).map(X=>v(X).toString(16).padStart(2,"0"))}(U.h,U.s,U.v),J=U.a>=1?"":Number((255*U.a).toFixed(0)).toString(16).toUpperCase().padStart(2,"0");return J&&N.push(J),N.toString=()=>`#${N.join("").toUpperCase()}`,N},clone:()=>W(U.h,U.s,U.v,U.a)};return U}const _=k=>Math.max(Math.min(k,1),0);function Q(k){const F={options:Object.assign({lock:null,onchange:()=>0,onstop:()=>0},k),_keyboard(U){const{options:N}=F,{type:J,key:B}=U;if(document.activeElement===N.wrapper){const{lock:re}=F.options,ee=B==="ArrowUp",X=B==="ArrowRight",C=B==="ArrowDown",G=B==="ArrowLeft";if(J==="keydown"&&(ee||X||C||G)){let z=0,H=0;re==="v"?z=ee||X?1:-1:re==="h"?z=ee||X?-1:1:(H=ee?-1:C?1:0,z=G?-1:X?1:0),F.update(_(F.cache.x+.01*z),_(F.cache.y+.01*H)),U.preventDefault()}else B.startsWith("Arrow")&&(F.options.onstop(),U.preventDefault())}},_tapstart(U){a(document,["mouseup","touchend","touchcancel"],F._tapstop),a(document,["mousemove","touchmove"],F._tapmove),U.cancelable&&U.preventDefault(),F._tapmove(U)},_tapmove(U){const{options:N,cache:J}=F,{lock:B,element:re,wrapper:ee}=N,X=ee.getBoundingClientRect();let C=0,G=0;if(U){const j=U&&U.touches&&U.touches[0];C=U?(j||U).clientX:0,G=U?(j||U).clientY:0,CX.left+X.width&&(C=X.left+X.width),GX.top+X.height&&(G=X.top+X.height),C-=X.left,G-=X.top}else J&&(C=J.x*X.width,G=J.y*X.height);B!=="h"&&(re.style.left=`calc(${C/X.width*100}% - ${re.offsetWidth/2}px)`),B!=="v"&&(re.style.top=`calc(${G/X.height*100}% - ${re.offsetHeight/2}px)`),F.cache={x:C/X.width,y:G/X.height};const z=_(C/X.width),H=_(G/X.height);switch(B){case"v":return N.onchange(z);case"h":return N.onchange(H);default:return N.onchange(z,H)}},_tapstop(){F.options.onstop(),s(document,["mouseup","touchend","touchcancel"],F._tapstop),s(document,["mousemove","touchmove"],F._tapmove)},trigger(){F._tapmove()},update(U=0,N=0){const{left:J,top:B,width:re,height:ee}=F.options.wrapper.getBoundingClientRect();F.options.lock==="h"&&(N=U),F._tapmove({clientX:J+re*U,clientY:B+ee*N})},destroy(){const{options:U,_tapstart:N,_keyboard:J}=F;s(document,["keydown","keyup"],J),s([U.wrapper,U.element],"mousedown",N),s([U.wrapper,U.element],"touchstart",N,{passive:!1})}},{options:Y,_tapstart:V,_keyboard:ie}=F;return a([Y.wrapper,Y.element],"mousedown",V),a([Y.wrapper,Y.element],"touchstart",V,{passive:!1}),a(document,["keydown","keyup"],ie),F}function te(k={}){k=Object.assign({onchange:()=>0,className:"",elements:[]},k);const F=a(k.elements,"click",Y=>{k.elements.forEach(V=>V.classList[Y.target===V?"add":"remove"](k.className)),k.onchange(Y),Y.stopPropagation()});return{destroy:()=>s(...F)}}const O={variantFlipOrder:{start:"sme",middle:"mse",end:"ems"},positionFlipOrder:{top:"tbrl",right:"rltb",bottom:"btrl",left:"lrbt"},position:"bottom",margin:8,padding:0},I=(k,F,Y)=>{const V=typeof k!="object"||k instanceof HTMLElement?{reference:k,popper:F,...Y}:k;return{update(ie=V){const{reference:U,popper:N}=Object.assign(V,ie);if(!N||!U)throw new Error("Popper- or reference-element missing.");return((J,B,re)=>{const{container:ee,arrow:X,margin:C,padding:G,position:z,variantFlipOrder:H,positionFlipOrder:j}={container:document.documentElement.getBoundingClientRect(),...O,...re},{left:ue,top:b}=B.style;B.style.left="0",B.style.top="0";const q=J.getBoundingClientRect(),M=B.getBoundingClientRect(),w={t:q.top-M.height-C,b:q.bottom+C,r:q.right+C,l:q.left-M.width-C},S={vs:q.left,vm:q.left+q.width/2-M.width/2,ve:q.left+q.width-M.width,hs:q.top,hm:q.bottom-q.height/2-M.height/2,he:q.bottom-M.height},[E,K="middle"]=z.split("-"),$=j[E],Z=H[K],{top:oe,left:ce,bottom:se,right:ge}=ee;for(const Oe of $){const Te=Oe==="t"||Oe==="b";let Ye=w[Oe];const[Vt,lt]=Te?["top","left"]:["left","top"],[ft,Ue]=Te?[M.height,M.width]:[M.width,M.height],[_t,Jt]=Te?[se,ge]:[ge,se],[Tt,Cr]=Te?[oe,ce]:[ce,oe];if(!(Ye_t))for(const Jr of Z){let lr=S[(Te?"v":"h")+Jr];if(!(lrJt)){if(lr-=M[lt],Ye-=M[Vt],B.style[lt]=`${lr}px`,B.style[Vt]=`${Ye}px`,X){const zr=Te?q.width/2:q.height/2,Ar=Ue/2,er=zr>Ar,cr=lr+{s:er?Ar:zr,m:Ar,e:er?Ar:Ue-zr}[Jr],Zo=Ye+{t:ft,b:0,r:0,l:ft}[Oe];X.style[lt]=`${cr}px`,X.style[Vt]=`${Zo}px`}return Oe+Jr}}}return B.style.left=ue,B.style.top=b,null})(U,N,V)}}},L=class{constructor(F){Rr(this,"_initializingActive",!0);Rr(this,"_recalc",!0);Rr(this,"_nanopop",null);Rr(this,"_root",null);Rr(this,"_color",W());Rr(this,"_lastColor",W());Rr(this,"_swatchColors",[]);Rr(this,"_setupAnimationFrame",null);Rr(this,"_eventListener",{init:[],save:[],hide:[],show:[],clear:[],change:[],changestop:[],cancel:[],swatchselect:[]});this.options=F=Object.assign({...L.DEFAULT_OPTIONS},F);const{swatches:Y,components:V,theme:ie,sliders:U,lockOpacity:N,padding:J}=F;["nano","monolith"].includes(ie)&&!U&&(F.sliders="h"),V.interaction||(V.interaction={});const{preview:B,opacity:re,hue:ee,palette:X}=V;V.opacity=!N&&re,V.palette=X||B||re||ee,this._preBuild(),this._buildComponents(),this._bindEvents(),this._finalBuild(),Y&&Y.length&&Y.forEach(H=>this.addSwatch(H));const{button:C,app:G}=this._root;this._nanopop=I(C,G,{margin:J}),C.setAttribute("role","button"),C.setAttribute("aria-label",this._t("btn:toggle"));const z=this;this._setupAnimationFrame=requestAnimationFrame(function H(){if(!G.offsetWidth)return requestAnimationFrame(H);z.setColor(F.default),z._rePositioningPicker(),F.defaultRepresentation&&(z._representation=F.defaultRepresentation,z.setColorRepresentation(z._representation)),F.showAlways&&z.show(),z._initializingActive=!1,z._emit("init")})}_preBuild(){const{options:F}=this;for(const Y of["el","container"])F[Y]=h(F[Y]);this._root=(Y=>{const{components:V,useAsButton:ie,inline:U,appClass:N,theme:J,lockOpacity:B}=Y.options,re=G=>G?"":'style="display:none" hidden',ee=G=>Y._t(G),X=c(` +
+ + ${ie?"":''} + +
+
+
+ +
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+ +
+ +
+ + + + + + + + + + + +
+
+
+ `),C=X.interaction;return C.options.find(G=>!G.hidden&&!G.classList.add("active")),C.type=()=>C.options.find(G=>G.classList.contains("active")),X})(this),F.useAsButton&&(this._root.button=F.el),F.container.appendChild(this._root.root)}_finalBuild(){const F=this.options,Y=this._root;if(F.container.removeChild(Y.root),F.inline){const V=F.el.parentElement;F.el.nextSibling?V.insertBefore(Y.app,F.el.nextSibling):V.appendChild(Y.app)}else F.container.appendChild(Y.app);F.useAsButton?F.inline&&F.el.remove():F.el.parentNode.replaceChild(Y.root,F.el),F.disabled&&this.disable(),F.comparison||(Y.button.style.transition="none",F.useAsButton||(Y.preview.lastColor.style.transition="none")),this.hide()}_buildComponents(){const F=this,Y=this.options.components,V=(F.options.sliders||"v").repeat(2),[ie,U]=V.match(/^[vh]+$/g)?V:[],N=()=>this._color||(this._color=this._lastColor.clone()),J={palette:Q({element:F._root.palette.picker,wrapper:F._root.palette.palette,onstop:()=>F._emit("changestop","slider",F),onchange(B,re){if(!Y.palette)return;const ee=N(),{_root:X,options:C}=F,{lastColor:G,currentColor:z}=X.preview;F._recalc&&(ee.s=100*B,ee.v=100-100*re,ee.v<0&&(ee.v=0),F._updateOutput("slider"));const H=ee.toRGBA().toString(0);this.element.style.background=H,this.wrapper.style.background=` + linear-gradient(to top, rgba(0, 0, 0, ${ee.a}), transparent), + linear-gradient(to left, hsla(${ee.h}, 100%, 50%, ${ee.a}), rgba(255, 255, 255, ${ee.a})) + `,C.comparison?C.useAsButton||F._lastColor||G.style.setProperty("--pcr-color",H):(X.button.style.setProperty("--pcr-color",H),X.button.classList.remove("clear"));const j=ee.toHEXA().toString();for(const{el:ue,color:b}of F._swatchColors)ue.classList[j===b.toHEXA().toString()?"add":"remove"]("pcr-active");z.style.setProperty("--pcr-color",H)}}),hue:Q({lock:U==="v"?"h":"v",element:F._root.hue.picker,wrapper:F._root.hue.slider,onstop:()=>F._emit("changestop","slider",F),onchange(B){if(!Y.hue||!Y.palette)return;const re=N();F._recalc&&(re.h=360*B),this.element.style.backgroundColor=`hsl(${re.h}, 100%, 50%)`,J.palette.trigger()}}),opacity:Q({lock:ie==="v"?"h":"v",element:F._root.opacity.picker,wrapper:F._root.opacity.slider,onstop:()=>F._emit("changestop","slider",F),onchange(B){if(!Y.opacity||!Y.palette)return;const re=N();F._recalc&&(re.a=Math.round(100*B)/100),this.element.style.background=`rgba(0, 0, 0, ${re.a})`,J.palette.trigger()}}),selectable:te({elements:F._root.interaction.options,className:"active",onchange(B){F._representation=B.target.getAttribute("data-type").toUpperCase(),F._recalc&&F._updateOutput("swatch")}})};this._components=J}_bindEvents(){const{_root:F,options:Y}=this,V=[a(F.interaction.clear,"click",()=>this._clearColor()),a([F.interaction.cancel,F.preview.lastColor],"click",()=>{this.setHSVA(...(this._lastColor||this._color).toHSVA(),!0),this._emit("cancel")}),a(F.interaction.save,"click",()=>{!this.applyColor()&&!Y.showAlways&&this.hide()}),a(F.interaction.result,["keyup","input"],ie=>{this.setColor(ie.target.value,!0)&&!this._initializingActive&&(this._emit("change",this._color,"input",this),this._emit("changestop","input",this)),ie.stopImmediatePropagation()}),a(F.interaction.result,["focus","blur"],ie=>{this._recalc=ie.type==="blur",this._recalc&&this._updateOutput(null)}),a([F.palette.palette,F.palette.picker,F.hue.slider,F.hue.picker,F.opacity.slider,F.opacity.picker],["mousedown","touchstart"],()=>this._recalc=!0,{passive:!0})];if(!Y.showAlways){const ie=Y.closeWithKey;V.push(a(F.button,"click",()=>this.isOpen()?this.hide():this.show()),a(document,"keyup",U=>this.isOpen()&&(U.key===ie||U.code===ie)&&this.hide()),a(document,["touchstart","mousedown"],U=>{this.isOpen()&&!u(U).some(N=>N===F.app||N===F.button)&&this.hide()},{capture:!0}))}if(Y.adjustableNumbers){const ie={rgba:[255,255,255,1],hsva:[360,100,100,1],hsla:[360,100,100,1],cmyk:[100,100,100,100]};d(F.interaction.result,(U,N,J)=>{const B=ie[this.getColorRepresentation().toLowerCase()];if(B){const re=B[J],ee=U+(re>=100?1e3*N:N);return ee<=0?0:Number((ee{U.isOpen()&&(Y.closeOnScroll&&U.hide(),ie===null?(ie=setTimeout(()=>ie=null,100),requestAnimationFrame(function N(){U._rePositioningPicker(),ie!==null&&requestAnimationFrame(N)})):(clearTimeout(ie),ie=setTimeout(()=>ie=null,100)))},{capture:!0}))}this._eventBindings=V}_rePositioningPicker(){const{options:F}=this;if(!F.inline&&!this._nanopop.update({container:document.body.getBoundingClientRect(),position:F.position})){const Y=this._root.app,V=Y.getBoundingClientRect();Y.style.top=(window.innerHeight-V.height)/2+"px",Y.style.left=(window.innerWidth-V.width)/2+"px"}}_updateOutput(F){const{_root:Y,_color:V,options:ie}=this;if(Y.interaction.type()){const U=`to${Y.interaction.type().getAttribute("data-type")}`;Y.interaction.result.value=typeof V[U]=="function"?V[U]().toString(ie.outputPrecision):""}!this._initializingActive&&this._recalc&&this._emit("change",V,F,this)}_clearColor(F=!1){const{_root:Y,options:V}=this;V.useAsButton||Y.button.style.setProperty("--pcr-color","rgba(0, 0, 0, 0.15)"),Y.button.classList.add("clear"),V.showAlways||this.hide(),this._lastColor=null,this._initializingActive||F||(this._emit("save",null),this._emit("clear"))}_parseLocalColor(F){const{values:Y,type:V,a:ie}=D(F),{lockOpacity:U}=this.options,N=ie!==void 0&&ie!==1;return Y&&Y.length===3&&(Y[3]=void 0),{values:!Y||U&&N?null:Y,type:V}}_t(F){return this.options.i18n[F]||L.I18N_DEFAULTS[F]}_emit(F,...Y){this._eventListener[F].forEach(V=>V(...Y,this))}on(F,Y){return this._eventListener[F].push(Y),this}off(F,Y){const V=this._eventListener[F]||[],ie=V.indexOf(Y);return~ie&&V.splice(ie,1),this}addSwatch(F){const{values:Y}=this._parseLocalColor(F);if(Y){const{_swatchColors:V,_root:ie}=this,U=W(...Y),N=l(`