diff --git a/.eslintrc b/.eslintrc index fa01611..5103e0e 100644 --- a/.eslintrc +++ b/.eslintrc @@ -2,7 +2,8 @@ "extends": "airbnb", "env": { "browser": true, - "node": true + "node": true, + "mocha": true }, "rules": { "no-underscore-dangle": 0, diff --git a/.gitignore b/.gitignore index 53e3db6..2f837a7 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,6 @@ node_modules/* yarn.lock tesseract.dev.js worker.dev.js -*.traineddata \ No newline at end of file +/*.traineddata +/examples/**/*.traineddata +.nyc_output diff --git a/dist/tesseract.min.js b/dist/tesseract.min.js index b0e739d..39b7ec1 100644 --- a/dist/tesseract.min.js +++ b/dist/tesseract.min.js @@ -1,2 +1,2 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Tesseract=t():e.Tesseract=t()}(window,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t,n){const r=n(3),o={corePath:`https://cdn.jsdelivr.net/gh/naptha/tesseract.js-core@2.0.0-beta.4/tesseract${"object"==typeof WebAssembly?"":"asm"}.js`,langPath:"https://cdn.jsdelivr.net/gh/naptha/tessdata@gh-pages/3.02/"};{const{version:e}=n(4);o.workerPath=`https://cdn.jsdelivr.net/gh/naptha/tesseract.js@${e}/dist/worker.js`}t.defaultOptions=o,t.spawnWorker=((e,t)=>{let n;if(window.Blob&&window.URL){const e=new Blob([`importScripts("${t.workerPath}");`]);n=new Worker(window.URL.createObjectURL(e))}else n=new Worker(t.workerPath);return n.onmessage=(({data:t})=>{e._recv(t)}),n}),t.terminateWorker=(e=>{e.worker.terminate()}),t.sendPacket=((e,t)=>{(e=>r(e)?fetch(e).then(e=>e.buffer()):new Promise)(t.payload.image).then(e=>new Uint8Array(e)).then(n=>{e.worker.postMessage({...t,payload:{...t.payload,image:Array.from(n)}})})})},function(e,t,n){const r=n(2),o=n(0),s=n(5),i=n(6);e.exports={TesseractWorker:class{constructor(e={}){this.worker=null,this.workerOptions=Object.assign({},o.defaultOptions,e),this._currentJob=null,this._queue=[]}recognize(e,t={lang:"eng"}){return this._delay(n=>{n._send("recognize",{image:e,options:r.string(t)?{lang:t||"eng"}:t,workerOptions:this.workerOptions})})}detect(e,t={}){return this._delay(n=>{n._send("detect",{image:e,options:t,workerOptions:this.workerOptions})})}terminate(){this.worker&&o.terminateWorker(this),this.worker=null,this._currentJob=null,this._queue=[]}_delay(e){r.null(this.worker)&&(this.worker=o.spawnWorker(this,this.workerOptions));const t=new i(this);return this._queue.push(()=>{this._queue.shift(),this._currentJob=t,e(t)}),r.null(this._currentJob)&&this._dequeue(),t}_dequeue(){this._currentJob=null,this._queue.length&&this._queue[0]()}_recv(e){this._currentJob.id===e.jobId?this._currentJob._handle({...e,data:"resolve"===e.status&&"recognize"===e.action?s(e.data):e.data}):console.warn(`Job ID ${e.jobId} not known.`)}}}},function(e,t,n){var r;!function(o){"use strict";var s,i,u,a,c,f,l,p,h,b,d,y,g;function m(e){return null!=e}function v(e){return"number"==typeof e&&e>b&&et}function _(e,t){return v(e)&&e=t}function O(e,t){return v(e)&&e<=t}function E(e){return"string"==typeof e}function x(e){return E(e)&&""!==e}function P(e){return"[object Object]"===Object.prototype.toString.call(e)}function S(e,t){try{return e instanceof t}catch(e){return!1}}function I(e,t){var n;for(n in t)if(t.hasOwnProperty(n)){if(!1===e.hasOwnProperty(n)||typeof e[n]!=typeof t[n])return!1;if(P(e[n])&&!1===I(e[n],t[n]))return!1}return!0}function T(e){return y(e)}function q(e){return m(e)&&k(e.length,0)}function A(e){return"function"==typeof e}function J(e,t){var n;for(n=0;nn}},{n:"greaterOrEqual",f:k},{n:"lessOrEqual",f:O},{n:"inRange",f:function(e,t,n){if(t=n}},{n:"positive",f:function(e){return j(e,0)}},{n:"negative",f:function(e){return _(e,0)}},{n:"string",f:E,s:"s"},{n:"emptyString",f:function(e){return""===e},s:"s"},{n:"nonEmptyString",f:x,s:"s"},{n:"contains",f:function(e,t){return E(e)&&-1!==e.indexOf(t)},s:"s"},{n:"match",f:function(e,t){return E(e)&&!!e.match(t)},s:"s"},{n:"boolean",f:function(e){return!1===e||!0===e},s:"b"},{n:"object",f:P,s:"o"},{n:"emptyObject",f:function(e){return P(e)&&0===Object.keys(e).length},s:"o"},{n:"nonEmptyObject",f:function(e){return P(e)&&Object.keys(e).length>0},s:"o"},{n:"instanceStrict",f:S,s:"t"},{n:"instance",f:function(e,t){try{return S(e,t)||e.constructor.name===t.name||Object.prototype.toString.call(e)==="[object "+t.name+"]"}catch(e){return!1}},s:"t"},{n:"like",f:I,s:"t"},{n:"array",f:T,s:"a"},{n:"emptyArray",f:function(e){return T(e)&&0===e.length},s:"a"},{n:"nonEmptyArray",f:function(e){return T(e)&&j(e.length,0)},s:"a"},{n:"arrayLike",f:q,s:"al"},{n:"iterable",f:function(e){if(!g)return q(e);return m(e)&&A(e[Symbol.iterator])},s:"i"},{n:"date",f:function(e){return S(e,Date)&&w(e.getTime())},s:"d"},{n:"function",f:A,s:"f"},{n:"hasLength",f:function(e,t){return m(e)&&e.length===t},s:"l"}].map(function(e){var t=e.n;i[t]="Invalid "+s[e.s||"n"],u[t]=e.f}),a={apply:function(e,t){if(c.array(e),A(t))return e.map(function(e){return t(e)});return c.array(t),c.hasLength(e,t.length),e.map(function(e,n){return t[n](e)})},map:function(e,t){if(c.object(e),A(t))return function(e,t){var n={};return Object.keys(e).forEach(function(r){n[r]=t(e[r])}),n}(e,t);return c.object(t),function e(t,n){var r={};return Object.keys(n).forEach(function(o){var s=n[o];A(s)?f.assigned(t)?r[o]=!!s.m:r[o]=s(t[o]):P(s)&&(r[o]=e(t[o],s))}),r}(e,t)},all:function(e){if(T(e))return J(e,!1);return c.object(e),N(e,!1)},any:function(e){if(T(e))return J(e,!0);return c.object(e),N(e,!0)}},p=["array","arrayLike","iterable","object"],h=Array.prototype.slice,b=Number.NEGATIVE_INFINITY,d=Number.POSITIVE_INFINITY,y=Array.isArray,g="function"==typeof Symbol,a=M(a,u),c=z(W,L),f=z($,D),l=z(function(e){var t=function(){return!!f.assigned(arguments[0])||e.apply(null,arguments)};return t.l=e.length,t.m=!0,t},function(e){if(!1===m(e))return!0;return e}),c.not=V(W,f),c.maybe=V(W,l),p.forEach(function(e){u[e].of=U([R.bind(null,null),u[e],u,null])}),B(c,W),B(f,$),p.forEach(function(e){l[e].of=U([R.bind(null,"maybe"),u[e],u,null]),c.maybe[e].of=V(W,l[e].of),c.not[e].of=V(W,f[e].of)}),function(o){void 0===(r=function(){return o}.call(t,n,t,e))||(e.exports=r)}(M(a,{assert:c,not:f,maybe:l}))}()},function(e,t){e.exports=function(e){return n.test(e)};var n=/^(?:\w+:)?\/\/([^\s\.]+\.\S{2}|localhost[\:?\d]*)\S*$/},function(e){e.exports={name:"tesseract.js",version:"1.0.13",description:"Pure Javascript Multilingual OCR",main:"src/index.js",scripts:{start:'concurrently --kill-others "watchify src/index.js -t [ envify --NODE_ENV development ] -t [ babelify --presets [ es2015 ] ] -o dist/tesseract.dev.js --standalone Tesseract" "watchify src/browser/worker.js -t [ envify --NODE_ENV development ] -t [ babelify --presets [ es2015 ] ] -o dist/worker.dev.js" "http-server -p 7355"',build:"webpack --config webpack.config.js",prepublishOnly:"npm run build",lint:"eslint src"},browser:{"./src/node/index.js":"./src/browser/index.js"},author:"",contributors:["jeromewu"],license:"Apache-2.0",devDependencies:{eslint:"^5.9.0","eslint-config-airbnb":"^17.1.0","eslint-plugin-import":"^2.14.0","eslint-plugin-jsx-a11y":"^6.1.2","eslint-plugin-react":"^7.11.1",webpack:"^4.26.0","webpack-cli":"^3.1.2"},dependencies:{"check-types":"^7.4.0","is-url":"1.2.2","node-fetch":"^1.7.3","tesseract.js-core":"^2.0.0-beta.4","tesseract.js-utils":"^1.0.0-beta.1"},repository:{type:"git",url:"https://github.com/naptha/tesseract.js.git"},bugs:{url:"https://github.com/naptha/tesseract.js/issues"},homepage:"https://github.com/naptha/tesseract.js"}},function(e,t){e.exports=(e=>{const t={...e,paragraphs:[],lines:[],words:[],symbols:[]};return t.blocks.forEach(e=>{const n={...e,page:t,lines:[],words:[],symbols:[]};n.paragraphs.forEach(e=>{const r={...e,block:n,page:t,words:[],symbols:[]};r.lines.forEach(e=>{const o={...e,paragraph:r,block:n,page:t,symbols:[]};o.words.forEach(e=>{const s={...e,line:o,paragraph:r,block:n,page:t};s.symbols.forEach(e=>{const i={...e,word:s,line:o,paragraph:r,block:n,page:t};i.line.symbols.push(i),i.paragraph.symbols.push(i),i.block.symbols.push(i),i.page.symbols.push(i)}),s.paragraph.words.push(s),s.block.words.push(s),s.page.words.push(s)}),o.block.lines.push(o),o.page.lines.push(o)}),r.page.paragraphs.push(r)})}),t})},function(e,t,n){const r=n(0);let o=0;e.exports=class{constructor(e){o+=1,this.id=`Job-${o}-${Math.random().toString(16).slice(3,8)}`,this._instance=e,this._resolve=[],this._reject=[],this._progress=[],this._finally=[]}then(e,t){return this._resolve.push?this._resolve.push(e):e(this._resolve),t&&this.catch(t),this}catch(e){return this._reject.push?this._reject.push(e):e(this._reject),this}progress(e){return this._progress.push(e),this}finally(e){return this._finally.push(e),this}_send(e,t){r.sendPacket(this._instance,{jobId:this.id,action:e,payload:t})}_handle(e){const{data:t}=e;let n=!1;"resolve"===e.status?(0===this._resolve.length&&console.log(t),this._resolve.forEach(e=>{const n=e(t);n&&"function"==typeof n.then&&console.warn("TesseractJob instances do not chain like ES6 Promises. To convert it into a real promise, use Promise.resolve.")}),this._resolve=t,this._instance._dequeue(),n=!0):"reject"===e.status?(0===this._reject.length&&console.error(t),this._reject.forEach(e=>e(t)),this._reject=t,this._instance._dequeue(),n=!0):"progress"===e.status?this._progress.forEach(e=>e(t)):console.warn("Message type unknown",e.status),n&&this._finally.forEach(e=>e(t))}}}])}); +!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.Tesseract=n():e.Tesseract=n()}(window,function(){return function(e){var n={};function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)t.d(r,o,function(n){return e[n]}.bind(null,o));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=2)}([function(e,n,t){var r;!function(o){"use strict";var s,i,u,a,c,f,l,p,h,d,b,y,g;function m(e){return null!=e}function v(e){return"number"==typeof e&&e>d&&en}function _(e,n){return v(e)&&e=n}function O(e,n){return v(e)&&e<=n}function E(e){return"string"==typeof e}function x(e){return E(e)&&""!==e}function P(e){return"[object Object]"===Object.prototype.toString.call(e)}function S(e,n){try{return e instanceof n}catch(e){return!1}}function q(e,n){var t;for(t in n)if(n.hasOwnProperty(t)){if(!1===e.hasOwnProperty(t)||typeof e[t]!=typeof n[t])return!1;if(P(e[t])&&!1===q(e[t],n[t]))return!1}return!0}function I(e){return y(e)}function T(e){return m(e)&&k(e.length,0)}function A(e){return"function"==typeof e}function J(e,n){var t;for(t=0;tt}},{n:"greaterOrEqual",f:k},{n:"lessOrEqual",f:O},{n:"inRange",f:function(e,n,t){if(n=t}},{n:"positive",f:function(e){return j(e,0)}},{n:"negative",f:function(e){return _(e,0)}},{n:"string",f:E,s:"s"},{n:"emptyString",f:function(e){return""===e},s:"s"},{n:"nonEmptyString",f:x,s:"s"},{n:"contains",f:function(e,n){return E(e)&&-1!==e.indexOf(n)},s:"s"},{n:"match",f:function(e,n){return E(e)&&!!e.match(n)},s:"s"},{n:"boolean",f:function(e){return!1===e||!0===e},s:"b"},{n:"object",f:P,s:"o"},{n:"emptyObject",f:function(e){return P(e)&&0===Object.keys(e).length},s:"o"},{n:"nonEmptyObject",f:function(e){return P(e)&&Object.keys(e).length>0},s:"o"},{n:"instanceStrict",f:S,s:"t"},{n:"instance",f:function(e,n){try{return S(e,n)||e.constructor.name===n.name||Object.prototype.toString.call(e)==="[object "+n.name+"]"}catch(e){return!1}},s:"t"},{n:"like",f:q,s:"t"},{n:"array",f:I,s:"a"},{n:"emptyArray",f:function(e){return I(e)&&0===e.length},s:"a"},{n:"nonEmptyArray",f:function(e){return I(e)&&j(e.length,0)},s:"a"},{n:"arrayLike",f:T,s:"al"},{n:"iterable",f:function(e){if(!g)return T(e);return m(e)&&A(e[Symbol.iterator])},s:"i"},{n:"date",f:function(e){return S(e,Date)&&w(e.getTime())},s:"d"},{n:"function",f:A,s:"f"},{n:"hasLength",f:function(e,n){return m(e)&&e.length===n},s:"l"}].map(function(e){var n=e.n;i[n]="Invalid "+s[e.s||"n"],u[n]=e.f}),a={apply:function(e,n){if(c.array(e),A(n))return e.map(function(e){return n(e)});return c.array(n),c.hasLength(e,n.length),e.map(function(e,t){return n[t](e)})},map:function(e,n){if(c.object(e),A(n))return function(e,n){var t={};return Object.keys(e).forEach(function(r){t[r]=n(e[r])}),t}(e,n);return c.object(n),function e(n,t){var r={};return Object.keys(t).forEach(function(o){var s=t[o];A(s)?f.assigned(n)?r[o]=!!s.m:r[o]=s(n[o]):P(s)&&(r[o]=e(n[o],s))}),r}(e,n)},all:function(e){if(I(e))return J(e,!1);return c.object(e),M(e,!1)},any:function(e){if(I(e))return J(e,!0);return c.object(e),M(e,!0)}},p=["array","arrayLike","iterable","object"],h=Array.prototype.slice,d=Number.NEGATIVE_INFINITY,b=Number.POSITIVE_INFINITY,y=Array.isArray,g="function"==typeof Symbol,a=N(a,u),c=U(W,L),f=U(B,R),l=U(function(e){var n=function(){return!!f.assigned(arguments[0])||e.apply(null,arguments)};return n.l=e.length,n.m=!0,n},function(e){if(!1===m(e))return!0;return e}),c.not=F(W,f),c.maybe=F(W,l),p.forEach(function(e){u[e].of=z([$.bind(null,null),u[e],u,null])}),C(c,W),C(f,B),p.forEach(function(e){l[e].of=z([$.bind(null,"maybe"),u[e],u,null]),c.maybe[e].of=F(W,l[e].of),c.not[e].of=F(W,f[e].of)}),function(o){void 0===(r=function(){return o}.call(n,t,n,e))||(e.exports=r)}(N(a,{assert:c,not:f,maybe:l}))}()},function(e,n,t){const r=t(0),o=t(3),{defaultOptions:s}=t(4),{version:i}=t(5);n.defaultOptions={...s,workerPath:`https://cdn.jsdelivr.net/gh/naptha/tesseract.js@v${i}/dist/worker.min.js`,corePath:`https://cdn.jsdelivr.net/gh/naptha/tesseract.js-core@v2.0.0-beta.5/tesseract-core${"object"==typeof WebAssembly?"":".asm"}.js`},n.spawnWorker=((e,n)=>{let t;if(window.Blob&&window.URL){const e=new Blob([`importScripts("${n.workerPath}");`]);t=new Worker(window.URL.createObjectURL(e))}else t=new Worker(n.workerPath);return t.onmessage=(({data:n})=>{e._recv(n)}),t}),n.terminateWorker=(e=>{e.worker.terminate()}),n.sendPacket=((e,n)=>{(e=>r.string(e)?fetch(o(e)).then(e=>e.arrayBuffer()):r.instance(e,File)?new Promise(n=>{const t=new FileReader;t.onload=(()=>{n(t.result)}),t.readAsArrayBuffer(e)}):Promise.reject())(n.payload.image).then(e=>new Uint8Array(e)).then(t=>{e.worker.postMessage({...n,payload:{...n.payload,image:Array.from(t)}})})})},function(e,n,t){const r=t(0),o=t(1),s=t(6),i=t(7);e.exports={TesseractWorker:class{constructor(e={}){this.worker=null,this.workerOptions=Object.assign({},o.defaultOptions,e),this._currentJob=null,this._queue=[]}recognize(e,n={lang:"eng"}){return this._delay(t=>{t._send("recognize",{image:e,options:r.string(n)?{lang:n||"eng"}:n,workerOptions:this.workerOptions})})}detect(e,n={}){return this._delay(t=>{t._send("detect",{image:e,options:n,workerOptions:this.workerOptions})})}terminate(){this.worker&&o.terminateWorker(this),this.worker=null,this._currentJob=null,this._queue=[]}_delay(e){r.null(this.worker)&&(this.worker=o.spawnWorker(this,this.workerOptions));const n=new i(this);return this._queue.push(()=>{this._queue.shift(),this._currentJob=n,e(n)}),r.null(this._currentJob)&&this._dequeue(),n}_dequeue(){this._currentJob=null,this._queue.length&&this._queue[0]()}_recv(e){this._currentJob.id===e.jobId?this._currentJob._handle({...e,data:"resolve"===e.status&&"recognize"===e.action?s(e.data):e.data}):console.warn(`Job ID ${e.jobId} not known.`)}}}},function(e,n,t){var r,o;void 0===(o="function"==typeof(r=function(){return function(){var e=arguments.length;if(0===e)throw new Error("resolveUrl requires at least one argument; got none.");var n=document.createElement("base");if(n.href=arguments[0],1===e)return n.href;var t=document.getElementsByTagName("head")[0];t.insertBefore(n,t.firstChild);for(var r,o=document.createElement("a"),s=1;s{const n={...e,paragraphs:[],lines:[],words:[],symbols:[]};return n.blocks.forEach(e=>{const t={...e,page:n,lines:[],words:[],symbols:[]};t.paragraphs.forEach(e=>{const r={...e,block:t,page:n,words:[],symbols:[]};r.lines.forEach(e=>{const o={...e,paragraph:r,block:t,page:n,symbols:[]};o.words.forEach(e=>{const s={...e,line:o,paragraph:r,block:t,page:n};s.symbols.forEach(e=>{const i={...e,word:s,line:o,paragraph:r,block:t,page:n};i.line.symbols.push(i),i.paragraph.symbols.push(i),i.block.symbols.push(i),i.page.symbols.push(i)}),s.paragraph.words.push(s),s.block.words.push(s),s.page.words.push(s)}),o.block.lines.push(o),o.page.lines.push(o)}),r.page.paragraphs.push(r)})}),n})},function(e,n,t){const r=t(1);let o=0;e.exports=class{constructor(e){o+=1,this.id=`Job-${o}-${Math.random().toString(16).slice(3,8)}`,this._instance=e,this._resolve=[],this._reject=[],this._progress=[],this._finally=[]}then(e,n){return this._resolve.push?this._resolve.push(e):e(this._resolve),n&&this.catch(n),this}catch(e){return this._reject.push?this._reject.push(e):e(this._reject),this}progress(e){return this._progress.push(e),this}finally(e){return this._finally.push(e),this}_send(e,n){r.sendPacket(this._instance,{jobId:this.id,action:e,payload:n})}_handle(e){const{data:n}=e;let t=!1;"resolve"===e.status?(0===this._resolve.length&&console.log(n),this._resolve.forEach(e=>{const t=e(n);t&&"function"==typeof t.then&&console.warn("TesseractJob instances do not chain like ES6 Promises. To convert it into a real promise, use Promise.resolve.")}),this._resolve=n,this._instance._dequeue(),t=!0):"reject"===e.status?(0===this._reject.length&&console.error(n),this._reject.forEach(e=>e(n)),this._reject=n,this._instance._dequeue(),t=!0):"progress"===e.status?this._progress.forEach(e=>e(n)):console.warn("Message type unknown",e.status),t&&this._finally.forEach(e=>e(n))}}}])}); //# sourceMappingURL=tesseract.min.js.map \ No newline at end of file diff --git a/dist/tesseract.min.js.map b/dist/tesseract.min.js.map index e4a83a8..1faa7fe 100644 --- a/dist/tesseract.min.js.map +++ b/dist/tesseract.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://Tesseract/webpack/universalModuleDefinition","webpack://Tesseract/webpack/bootstrap","webpack://Tesseract/./src/browser/index.js","webpack://Tesseract/./src/index.js","webpack://Tesseract/./node_modules/check-types/src/check-types.js","webpack://Tesseract/./node_modules/is-url/index.js","webpack://Tesseract/./src/common/circularize.js","webpack://Tesseract/./src/common/job.js"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","isURL","defaultOptions","corePath","WebAssembly","langPath","version","workerPath","spawnWorker","instance","workerOptions","worker","Blob","URL","blob","Worker","createObjectURL","onmessage","data","_recv","terminateWorker","terminate","sendPacket","packet","imageURI","fetch","then","resp","buffer","Promise","loadImage","payload","image","buf","Uint8Array","img","postMessage","Array","from","check","adapter","circularize","TesseractJob","TesseractWorker","[object Object]","this","assign","_currentJob","_queue","options","lang","_delay","job","_send","string","fn","null","push","shift","_dequeue","length","id","jobId","_handle","status","action","console","warn","__WEBPACK_AMD_DEFINE_RESULT__","globals","strings","messages","predicates","functions","assert","not","maybe","collections","slice","neginf","posinf","isArray","haveSymbols","assigned","number","integer","greater","lhs","rhs","less","greaterOrEqual","lessOrEqual","nonEmptyString","toString","instanceStrict","error","like","archetype","array","arrayLike","isFunction","testArray","result","testObject","mixin","target","source","keys","forEach","assertModifier","predicate","defaultMessage","args","argCount","message","ErrorType","assertImpl","apply","TypeError","assertPredicate","arguments","Error","notModifier","modifiedPredicate","notImpl","ofModifier","type","collection","map","coerceCollection","item","concat","ignore","createModifiedPredicates","modifier","createModifiedFunctions","pop","configurable","writable","createModifiedModifier","modified","createOfModifiers","base","of","v","b","a","al","f","undefined","iterator","iteration","values","next","done","x","y","substring","indexOf","regex","match","constructor","Date","getTime","hasLength","index","mapSimple","mapComplex","all","any","Number","NEGATIVE_INFINITY","POSITIVE_INFINITY","exportFunctions","matcher","test","iPage","page","paragraphs","lines","words","symbols","blocks","iBlock","block","iPara","para","iLine","line","paragraph","iWord","word","iSym","sym","jobCounter","Math","random","_instance","_resolve","_reject","_progress","_finally","resolve","reject","catch","runFinallyCbs","log","ret"],"mappings":"CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,IACA,mBAAAG,eAAAC,IACAD,OAAA,GAAAH,GACA,iBAAAC,QACAA,QAAA,UAAAD,IAEAD,EAAA,UAAAC,IARA,CASCK,OAAA,WACD,mBCTA,IAAAC,EAAA,GAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAP,QAGA,IAAAC,EAAAI,EAAAE,GAAA,CACAC,EAAAD,EACAE,GAAA,EACAT,QAAA,IAUA,OANAU,EAAAH,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAQ,GAAA,EAGAR,EAAAD,QA0DA,OArDAM,EAAAM,EAAAF,EAGAJ,EAAAO,EAAAR,EAGAC,EAAAQ,EAAA,SAAAd,EAAAe,EAAAC,GACAV,EAAAW,EAAAjB,EAAAe,IACAG,OAAAC,eAAAnB,EAAAe,EAAA,CAA0CK,YAAA,EAAAC,IAAAL,KAK1CV,EAAAgB,EAAA,SAAAtB,GACA,oBAAAuB,eAAAC,aACAN,OAAAC,eAAAnB,EAAAuB,OAAAC,YAAA,CAAwDC,MAAA,WAExDP,OAAAC,eAAAnB,EAAA,cAAiDyB,OAAA,KAQjDnB,EAAAoB,EAAA,SAAAD,EAAAE,GAEA,GADA,EAAAA,IAAAF,EAAAnB,EAAAmB,IACA,EAAAE,EAAA,OAAAF,EACA,KAAAE,GAAA,iBAAAF,QAAAG,WAAA,OAAAH,EACA,IAAAI,EAAAX,OAAAY,OAAA,MAGA,GAFAxB,EAAAgB,EAAAO,GACAX,OAAAC,eAAAU,EAAA,WAAyCT,YAAA,EAAAK,UACzC,EAAAE,GAAA,iBAAAF,EAAA,QAAAM,KAAAN,EAAAn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efinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Tesseract\"] = factory();\n\telse\n\t\troot[\"Tesseract\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1);\n","const isURL = require('is-url');\n\nconst defaultOptions = {\n // workerPath: 'https://cdn.jsdelivr.net/gh/naptha/tesseract.js@0.2.0/dist/worker.js',\n corePath: `https://cdn.jsdelivr.net/gh/naptha/tesseract.js-core@2.0.0-beta.4/tesseract${typeof WebAssembly === 'object' ? '' : 'asm'}.js`,\n langPath: 'https://cdn.jsdelivr.net/gh/naptha/tessdata@gh-pages/3.02/',\n};\n\nif (process.env.NODE_ENV === 'development') {\n console.debug('Using Development Configuration');\n // eslint-disable-next-line\n const { protocol, host } = location;\n defaultOptions.workerPath = `${protocol}://${host}/dist/worker.dev.js?nocache=${Math.random().toString(36).slice(3)}`;\n} else {\n const { version } = require('../../package.json');\n defaultOptions.workerPath = `https://cdn.jsdelivr.net/gh/naptha/tesseract.js@${version}/dist/worker.js`;\n}\n\nconst loadImage = (imageURI) => {\n if (isURL(imageURI)) {\n return fetch(imageURI)\n .then(resp => resp.buffer());\n }\n return new Promise();\n};\n\nexports.defaultOptions = defaultOptions;\n\nexports.spawnWorker = (instance, workerOptions) => {\n let worker;\n if (window.Blob && window.URL) {\n const blob = new Blob([`importScripts(\"${workerOptions.workerPath}\");`]);\n worker = new Worker(window.URL.createObjectURL(blob));\n } else {\n worker = new Worker(workerOptions.workerPath);\n }\n\n worker.onmessage = ({ data }) => {\n instance._recv(data);\n };\n\n return worker;\n};\n\nexports.terminateWorker = (instance) => {\n instance.worker.terminate();\n};\n\nexports.sendPacket = (instance, packet) => {\n loadImage(packet.payload.image)\n .then(buf => new Uint8Array(buf))\n .then((img) => {\n instance.worker.postMessage({\n ...packet,\n payload: {\n ...packet.payload,\n image: Array.from(img),\n },\n });\n });\n};\n","const check = require('check-types');\nconst adapter = require('./node');\nconst circularize = require('./common/circularize');\nconst TesseractJob = require('./common/job');\n\nclass TesseractWorker {\n constructor(workerOptions = {}) {\n this.worker = null;\n this.workerOptions = Object.assign({}, adapter.defaultOptions, workerOptions);\n this._currentJob = null;\n this._queue = [];\n }\n\n recognize(image, options = { lang: 'eng' }) {\n return this._delay((job) => {\n job._send(\n 'recognize',\n {\n image,\n options: check.string(options)\n ? { lang: options || 'eng' }\n : options,\n workerOptions: this.workerOptions,\n },\n );\n });\n }\n\n detect(image, options = {}) {\n return this._delay((job) => {\n job._send(\n 'detect',\n {\n image,\n options,\n workerOptions: this.workerOptions,\n },\n );\n });\n }\n\n terminate() {\n if (this.worker) {\n adapter.terminateWorker(this);\n }\n this.worker = null;\n this._currentJob = null;\n this._queue = [];\n }\n\n _delay(fn) {\n if (check.null(this.worker)) {\n this.worker = adapter.spawnWorker(this, this.workerOptions);\n }\n\n const job = new TesseractJob(this);\n this._queue.push(() => {\n this._queue.shift();\n this._currentJob = job;\n fn(job);\n });\n if (check.null(this._currentJob)) {\n this._dequeue();\n }\n return job;\n }\n\n _dequeue() {\n this._currentJob = null;\n if (this._queue.length) {\n this._queue[0]();\n }\n }\n\n _recv(packet) {\n if (this._currentJob.id === packet.jobId) {\n this._currentJob._handle({\n ...packet,\n data: packet.status === 'resolve' && packet.action === 'recognize'\n ? circularize(packet.data)\n : packet.data,\n });\n } else {\n console.warn(`Job ID ${packet.jobId} not known.`);\n }\n }\n}\n\nmodule.exports = {\n TesseractWorker,\n};\n","/*globals define, module, Symbol */\n/*jshint -W056 */\n\n(function (globals) {\n 'use strict';\n\n var strings, messages, predicates, functions, assert, not, maybe,\n collections, slice, neginf, posinf, isArray, haveSymbols;\n\n strings = {\n v: 'value',\n n: 'number',\n s: 'string',\n b: 'boolean',\n o: 'object',\n t: 'type',\n a: 'array',\n al: 'array-like',\n i: 'iterable',\n d: 'date',\n f: 'function',\n l: 'length'\n };\n\n messages = {};\n predicates = {};\n\n [\n { n: 'equal', f: equal, s: 'v' },\n { n: 'undefined', f: isUndefined, s: 'v' },\n { n: 'null', f: isNull, s: 'v' },\n { n: 'assigned', f: assigned, s: 'v' },\n { n: 'primitive', f: primitive, s: 'v' },\n { n: 'includes', f: includes, s: 'v' },\n { n: 'zero', f: zero },\n { n: 'infinity', f: infinity },\n { n: 'number', f: number },\n { n: 'integer', f: integer },\n { n: 'even', f: even },\n { n: 'odd', f: odd },\n { n: 'greater', f: greater },\n { n: 'less', f: less },\n { n: 'between', f: between },\n { n: 'greaterOrEqual', f: greaterOrEqual },\n { n: 'lessOrEqual', f: lessOrEqual },\n { n: 'inRange', f: inRange },\n { n: 'positive', f: positive },\n { n: 'negative', f: negative },\n { n: 'string', f: string, s: 's' },\n { n: 'emptyString', f: emptyString, s: 's' },\n { n: 'nonEmptyString', f: nonEmptyString, s: 's' },\n { n: 'contains', f: contains, s: 's' },\n { n: 'match', f: match, s: 's' },\n { n: 'boolean', f: boolean, s: 'b' },\n { n: 'object', f: object, s: 'o' },\n { n: 'emptyObject', f: emptyObject, s: 'o' },\n { n: 'nonEmptyObject', f: nonEmptyObject, s: 'o' },\n { n: 'instanceStrict', f: instanceStrict, s: 't' },\n { n: 'instance', f: instance, s: 't' },\n { n: 'like', f: like, s: 't' },\n { n: 'array', f: array, s: 'a' },\n { n: 'emptyArray', f: emptyArray, s: 'a' },\n { n: 'nonEmptyArray', f: nonEmptyArray, s: 'a' },\n { n: 'arrayLike', f: arrayLike, s: 'al' },\n { n: 'iterable', f: iterable, s: 'i' },\n { n: 'date', f: date, s: 'd' },\n { n: 'function', f: isFunction, s: 'f' },\n { n: 'hasLength', f: hasLength, s: 'l' },\n ].map(function (data) {\n var n = data.n;\n messages[n] = 'Invalid ' + strings[data.s || 'n'];\n predicates[n] = data.f;\n });\n\n functions = {\n apply: apply,\n map: map,\n all: all,\n any: any\n };\n\n collections = [ 'array', 'arrayLike', 'iterable', 'object' ];\n slice = Array.prototype.slice;\n neginf = Number.NEGATIVE_INFINITY;\n posinf = Number.POSITIVE_INFINITY;\n isArray = Array.isArray;\n haveSymbols = typeof Symbol === 'function';\n\n functions = mixin(functions, predicates);\n assert = createModifiedPredicates(assertModifier, assertImpl);\n not = createModifiedPredicates(notModifier, notImpl);\n maybe = createModifiedPredicates(maybeModifier, maybeImpl);\n assert.not = createModifiedModifier(assertModifier, not);\n assert.maybe = createModifiedModifier(assertModifier, maybe);\n\n collections.forEach(createOfPredicates);\n createOfModifiers(assert, assertModifier);\n createOfModifiers(not, notModifier);\n collections.forEach(createMaybeOfModifiers);\n\n exportFunctions(mixin(functions, {\n assert: assert,\n not: not,\n maybe: maybe\n }));\n\n /**\n * Public function `equal`.\n *\n * Returns true if `lhs` and `rhs` are strictly equal, without coercion.\n * Returns false otherwise.\n */\n function equal (lhs, rhs) {\n return lhs === rhs;\n }\n\n /**\n * Public function `undefined`.\n *\n * Returns true if `data` is undefined, false otherwise.\n */\n function isUndefined (data) {\n return data === undefined;\n }\n\n /**\n * Public function `null`.\n *\n * Returns true if `data` is null, false otherwise.\n */\n function isNull (data) {\n return data === null;\n }\n\n /**\n * Public function `assigned`.\n *\n * Returns true if `data` is not null or undefined, false otherwise.\n */\n function assigned (data) {\n return data !== undefined && data !== null;\n }\n\n /**\n * Public function `primitive`.\n *\n * Returns true if `data` is a primitive type, false otherwise.\n */\n function primitive (data) {\n var type;\n\n switch (data) {\n case null:\n case undefined:\n case false:\n case true:\n return true;\n }\n\n type = typeof data;\n return type === 'string' || type === 'number' || (haveSymbols && type === 'symbol');\n }\n\n /**\n * Public function `zero`.\n *\n * Returns true if `data` is zero, false otherwise.\n */\n function zero (data) {\n return data === 0;\n }\n\n /**\n * Public function `infinity`.\n *\n * Returns true if `data` is positive or negative infinity, false otherwise.\n */\n function infinity (data) {\n return data === neginf || data === posinf;\n }\n\n /**\n * Public function `number`.\n *\n * Returns true if `data` is a number, false otherwise.\n */\n function number (data) {\n return typeof data === 'number' && data > neginf && data < posinf;\n }\n\n /**\n * Public function `integer`.\n *\n * Returns true if `data` is an integer, false otherwise.\n */\n function integer (data) {\n return typeof data === 'number' && data % 1 === 0;\n }\n\n /**\n * Public function `even`.\n *\n * Returns true if `data` is an even number, false otherwise.\n */\n function even (data) {\n return typeof data === 'number' && data % 2 === 0;\n }\n\n /**\n * Public function `odd`.\n *\n * Returns true if `data` is an odd number, false otherwise.\n */\n function odd (data) {\n return integer(data) && data % 2 !== 0;\n }\n\n /**\n * Public function `greater`.\n *\n * Returns true if `lhs` is a number greater than `rhs`, false otherwise.\n */\n function greater (lhs, rhs) {\n return number(lhs) && lhs > rhs;\n }\n\n /**\n * Public function `less`.\n *\n * Returns true if `lhs` is a number less than `rhs`, false otherwise.\n */\n function less (lhs, rhs) {\n return number(lhs) && lhs < rhs;\n }\n\n /**\n * Public function `between`.\n *\n * Returns true if `data` is a number between `x` and `y`, false otherwise.\n */\n function between (data, x, y) {\n if (x < y) {\n return greater(data, x) && data < y;\n }\n\n return less(data, x) && data > y;\n }\n\n /**\n * Public function `greaterOrEqual`.\n *\n * Returns true if `lhs` is a number greater than or equal to `rhs`, false\n * otherwise.\n */\n function greaterOrEqual (lhs, rhs) {\n return number(lhs) && lhs >= rhs;\n }\n\n /**\n * Public function `lessOrEqual`.\n *\n * Returns true if `lhs` is a number less than or equal to `rhs`, false\n * otherwise.\n */\n function lessOrEqual (lhs, rhs) {\n return number(lhs) && lhs <= rhs;\n }\n\n /**\n * Public function `inRange`.\n *\n * Returns true if `data` is a number in the range `x..y`, false otherwise.\n */\n function inRange (data, x, y) {\n if (x < y) {\n return greaterOrEqual(data, x) && data <= y;\n }\n\n return lessOrEqual(data, x) && data >= y;\n }\n\n /**\n * Public function `positive`.\n *\n * Returns true if `data` is a positive number, false otherwise.\n */\n function positive (data) {\n return greater(data, 0);\n }\n\n /**\n * Public function `negative`.\n *\n * Returns true if `data` is a negative number, false otherwise.\n */\n function negative (data) {\n return less(data, 0);\n }\n\n /**\n * Public function `string`.\n *\n * Returns true if `data` is a string, false otherwise.\n */\n function string (data) {\n return typeof data === 'string';\n }\n\n /**\n * Public function `emptyString`.\n *\n * Returns true if `data` is the empty string, false otherwise.\n */\n function emptyString (data) {\n return data === '';\n }\n\n /**\n * Public function `nonEmptyString`.\n *\n * Returns true if `data` is a non-empty string, false otherwise.\n */\n function nonEmptyString (data) {\n return string(data) && data !== '';\n }\n\n /**\n * Public function `contains`.\n *\n * Returns true if `data` is a string that contains `substring`, false\n * otherwise.\n */\n function contains (data, substring) {\n return string(data) && data.indexOf(substring) !== -1;\n }\n\n /**\n * Public function `match`.\n *\n * Returns true if `data` is a string that matches `regex`, false otherwise.\n */\n function match (data, regex) {\n return string(data) && !! data.match(regex);\n }\n\n /**\n * Public function `boolean`.\n *\n * Returns true if `data` is a boolean value, false otherwise.\n */\n function boolean (data) {\n return data === false || data === true;\n }\n\n /**\n * Public function `object`.\n *\n * Returns true if `data` is a plain-old JS object, false otherwise.\n */\n function object (data) {\n return Object.prototype.toString.call(data) === '[object Object]';\n }\n\n /**\n * Public function `emptyObject`.\n *\n * Returns true if `data` is an empty object, false otherwise.\n */\n function emptyObject (data) {\n return object(data) && Object.keys(data).length === 0;\n }\n\n /**\n * Public function `nonEmptyObject`.\n *\n * Returns true if `data` is a non-empty object, false otherwise.\n */\n function nonEmptyObject (data) {\n return object(data) && Object.keys(data).length > 0;\n }\n\n /**\n * Public function `instanceStrict`.\n *\n * Returns true if `data` is an instance of `prototype`, false otherwise.\n */\n function instanceStrict (data, prototype) {\n try {\n return data instanceof prototype;\n } catch (error) {\n return false;\n }\n }\n\n /**\n * Public function `instance`.\n *\n * Returns true if `data` is an instance of `prototype`, false otherwise.\n * Falls back to testing constructor.name and Object.prototype.toString\n * if the initial instanceof test fails.\n */\n function instance (data, prototype) {\n try {\n return instanceStrict(data, prototype) ||\n data.constructor.name === prototype.name ||\n Object.prototype.toString.call(data) === '[object ' + prototype.name + ']';\n } catch (error) {\n return false;\n }\n }\n\n /**\n * Public function `like`.\n *\n * Tests whether `data` 'quacks like a duck'. Returns true if `data` has all\n * of the properties of `archetype` (the 'duck'), false otherwise.\n */\n function like (data, archetype) {\n var name;\n\n for (name in archetype) {\n if (archetype.hasOwnProperty(name)) {\n if (data.hasOwnProperty(name) === false || typeof data[name] !== typeof archetype[name]) {\n return false;\n }\n\n if (object(data[name]) && like(data[name], archetype[name]) === false) {\n return false;\n }\n }\n }\n\n return true;\n }\n\n /**\n * Public function `array`.\n *\n * Returns true if `data` is an array, false otherwise.\n */\n function array (data) {\n return isArray(data);\n }\n\n /**\n * Public function `emptyArray`.\n *\n * Returns true if `data` is an empty array, false otherwise.\n */\n function emptyArray (data) {\n return array(data) && data.length === 0;\n }\n\n /**\n * Public function `nonEmptyArray`.\n *\n * Returns true if `data` is a non-empty array, false otherwise.\n */\n function nonEmptyArray (data) {\n return array(data) && greater(data.length, 0);\n }\n\n /**\n * Public function `arrayLike`.\n *\n * Returns true if `data` is an array-like object, false otherwise.\n */\n function arrayLike (data) {\n return assigned(data) && greaterOrEqual(data.length, 0);\n }\n\n /**\n * Public function `iterable`.\n *\n * Returns true if `data` is an iterable, false otherwise.\n */\n function iterable (data) {\n if (! haveSymbols) {\n // Fall back to `arrayLike` predicate in pre-ES6 environments.\n return arrayLike(data);\n }\n\n return assigned(data) && isFunction(data[Symbol.iterator]);\n }\n\n /**\n * Public function `includes`.\n *\n * Returns true if `data` contains `value`, false otherwise.\n */\n function includes (data, value) {\n var iterator, iteration, keys, length, i;\n\n if (! assigned(data)) {\n return false;\n }\n\n if (haveSymbols && data[Symbol.iterator] && isFunction(data.values)) {\n iterator = data.values();\n\n do {\n iteration = iterator.next();\n\n if (iteration.value === value) {\n return true;\n }\n } while (! iteration.done);\n\n return false;\n }\n\n keys = Object.keys(data);\n length = keys.length;\n for (i = 0; i < length; ++i) {\n if (data[keys[i]] === value) {\n return true;\n }\n }\n\n return false;\n }\n\n /**\n * Public function `hasLength`.\n *\n * Returns true if `data` has a length property that equals `length`, false\n * otherwise.\n */\n function hasLength (data, length) {\n return assigned(data) && data.length === length;\n }\n\n /**\n * Public function `date`.\n *\n * Returns true if `data` is a valid date, false otherwise.\n */\n function date (data) {\n return instanceStrict(data, Date) && integer(data.getTime());\n }\n\n /**\n * Public function `function`.\n *\n * Returns true if `data` is a function, false otherwise.\n */\n function isFunction (data) {\n return typeof data === 'function';\n }\n\n /**\n * Public function `apply`.\n *\n * Maps each value from the `data` to the corresponding predicate and returns\n * the result array. If the same function is to be applied across all of the\n * data, a single predicate function may be passed in.\n *\n */\n function apply (data, predicates) {\n assert.array(data);\n\n if (isFunction(predicates)) {\n return data.map(function (value) {\n return predicates(value);\n });\n }\n\n assert.array(predicates);\n assert.hasLength(data, predicates.length);\n\n return data.map(function (value, index) {\n return predicates[index](value);\n });\n }\n\n /**\n * Public function `map`.\n *\n * Maps each value from the `data` to the corresponding predicate and returns\n * the result object. Supports nested objects. If the `data` is not nested and\n * the same function is to be applied across all of it, a single predicate\n * function may be passed in.\n *\n */\n function map (data, predicates) {\n assert.object(data);\n\n if (isFunction(predicates)) {\n return mapSimple(data, predicates);\n }\n\n assert.object(predicates);\n\n return mapComplex(data, predicates);\n }\n\n function mapSimple (data, predicate) {\n var result = {};\n\n Object.keys(data).forEach(function (key) {\n result[key] = predicate(data[key]);\n });\n\n return result;\n }\n\n function mapComplex (data, predicates) {\n var result = {};\n\n Object.keys(predicates).forEach(function (key) {\n var predicate = predicates[key];\n\n if (isFunction(predicate)) {\n if (not.assigned(data)) {\n result[key] = !!predicate.m;\n } else {\n result[key] = predicate(data[key]);\n }\n } else if (object(predicate)) {\n result[key] = mapComplex(data[key], predicate);\n }\n });\n\n return result;\n }\n\n /**\n * Public function `all`\n *\n * Check that all boolean values are true\n * in an array (returned from `apply`)\n * or object (returned from `map`).\n *\n */\n function all (data) {\n if (array(data)) {\n return testArray(data, false);\n }\n\n assert.object(data);\n\n return testObject(data, false);\n }\n\n function testArray (data, result) {\n var i;\n\n for (i = 0; i < data.length; i += 1) {\n if (data[i] === result) {\n return result;\n }\n }\n\n return !result;\n }\n\n function testObject (data, result) {\n var key, value;\n\n for (key in data) {\n if (data.hasOwnProperty(key)) {\n value = data[key];\n\n if (object(value) && testObject(value, result) === result) {\n return result;\n }\n\n if (value === result) {\n return result;\n }\n }\n }\n\n return !result;\n }\n\n /**\n * Public function `any`\n *\n * Check that at least one boolean value is true\n * in an array (returned from `apply`)\n * or object (returned from `map`).\n *\n */\n function any (data) {\n if (array(data)) {\n return testArray(data, true);\n }\n\n assert.object(data);\n\n return testObject(data, true);\n }\n\n function mixin (target, source) {\n Object.keys(source).forEach(function (key) {\n target[key] = source[key];\n });\n\n return target;\n }\n\n /**\n * Public modifier `assert`.\n *\n * Throws if `predicate` returns false.\n */\n function assertModifier (predicate, defaultMessage) {\n return function () {\n return assertPredicate(predicate, arguments, defaultMessage);\n };\n }\n\n function assertPredicate (predicate, args, defaultMessage) {\n var argCount = predicate.l || predicate.length;\n var message = args[argCount];\n var ErrorType = args[argCount + 1];\n assertImpl(\n predicate.apply(null, args),\n nonEmptyString(message) ? message : defaultMessage,\n isFunction(ErrorType) ? ErrorType : TypeError\n );\n return args[0];\n }\n\n function assertImpl (value, message, ErrorType) {\n if (value) {\n return value;\n }\n throw new (ErrorType || Error)(message || 'Assertion failed');\n }\n\n /**\n * Public modifier `not`.\n *\n * Negates `predicate`.\n */\n function notModifier (predicate) {\n var modifiedPredicate = function () {\n return notImpl(predicate.apply(null, arguments));\n };\n modifiedPredicate.l = predicate.length;\n return modifiedPredicate;\n }\n\n function notImpl (value) {\n return !value;\n }\n\n /**\n * Public modifier `maybe`.\n *\n * Returns true if predicate argument is null or undefined,\n * otherwise propagates the return value from `predicate`.\n */\n function maybeModifier (predicate) {\n var modifiedPredicate = function () {\n if (not.assigned(arguments[0])) {\n return true;\n }\n\n return predicate.apply(null, arguments);\n };\n modifiedPredicate.l = predicate.length;\n\n // Hackishly indicate that this is a maybe.xxx predicate.\n // Without this flag, the alternative would be to iterate\n // through the maybe predicates or use indexOf to check,\n // which would be time-consuming.\n modifiedPredicate.m = true;\n\n return modifiedPredicate;\n }\n\n function maybeImpl (value) {\n if (assigned(value) === false) {\n return true;\n }\n\n return value;\n }\n\n /**\n * Public modifier `of`.\n *\n * Applies the chained predicate to members of the collection.\n */\n function ofModifier (target, type, predicate) {\n var modifiedPredicate = function () {\n var collection, args;\n\n collection = arguments[0];\n\n if (target === 'maybe' && not.assigned(collection)) {\n return true;\n }\n\n if (!type(collection)) {\n return false;\n }\n\n collection = coerceCollection(type, collection);\n args = slice.call(arguments, 1);\n\n try {\n collection.forEach(function (item) {\n if (\n (target !== 'maybe' || assigned(item)) &&\n !predicate.apply(null, [ item ].concat(args))\n ) {\n // TODO: Replace with for...of when ES6 is required.\n throw 0;\n }\n });\n } catch (ignore) {\n return false;\n }\n\n return true;\n };\n modifiedPredicate.l = predicate.length;\n return modifiedPredicate;\n }\n\n function coerceCollection (type, collection) {\n switch (type) {\n case arrayLike:\n return slice.call(collection);\n case object:\n return Object.keys(collection).map(function (key) {\n return collection[key];\n });\n default:\n return collection;\n }\n }\n\n function createModifiedPredicates (modifier, object) {\n return createModifiedFunctions([ modifier, predicates, object ]);\n }\n\n function createModifiedFunctions (args) {\n var modifier, object, functions, result;\n\n modifier = args.shift();\n object = args.pop();\n functions = args.pop();\n\n result = object || {};\n\n Object.keys(functions).forEach(function (key) {\n Object.defineProperty(result, key, {\n configurable: false,\n enumerable: true,\n writable: false,\n value: modifier.apply(null, args.concat(functions[key], messages[key]))\n });\n });\n\n return result;\n }\n\n function createModifiedModifier (modifier, modified) {\n return createModifiedFunctions([ modifier, modified, null ]);\n }\n\n function createOfPredicates (key) {\n predicates[key].of = createModifiedFunctions(\n [ ofModifier.bind(null, null), predicates[key], predicates, null ]\n );\n }\n\n function createOfModifiers (base, modifier) {\n collections.forEach(function (key) {\n base[key].of = createModifiedModifier(modifier, predicates[key].of);\n });\n }\n\n function createMaybeOfModifiers (key) {\n maybe[key].of = createModifiedFunctions(\n [ ofModifier.bind(null, 'maybe'), predicates[key], predicates, null ]\n );\n assert.maybe[key].of = createModifiedModifier(assertModifier, maybe[key].of);\n assert.not[key].of = createModifiedModifier(assertModifier, not[key].of);\n }\n\n function exportFunctions (functions) {\n if (typeof define === 'function' && define.amd) {\n define(function () {\n return functions;\n });\n } else if (typeof module !== 'undefined' && module !== null && module.exports) {\n module.exports = functions;\n } else {\n globals.check = functions;\n }\n }\n}(this));\n","\n/**\n * Expose `isUrl`.\n */\n\nmodule.exports = isUrl;\n\n/**\n * Matcher.\n */\n\nvar matcher = /^(?:\\w+:)?\\/\\/([^\\s\\.]+\\.\\S{2}|localhost[\\:?\\d]*)\\S*$/;\n\n/**\n * Loosely validate a URL `string`.\n *\n * @param {String} string\n * @return {Boolean}\n */\n\nfunction isUrl(string){\n return matcher.test(string);\n}\n","// The result of dump.js is a big JSON tree\n// which can be easily serialized (for instance\n// to be sent from a webworker to the main app\n// or through Node's IPC), but we want\n// a (circular) DOM-like interface for walking\n// through the data.\n\nmodule.exports = (iPage) => {\n const page = {\n ...iPage,\n paragraphs: [],\n lines: [],\n words: [],\n symbols: [],\n };\n\n page.blocks.forEach((iBlock) => {\n const block = {\n ...iBlock,\n page,\n lines: [],\n words: [],\n symbols: [],\n };\n\n block.paragraphs.forEach((iPara) => {\n const para = {\n ...iPara,\n block,\n page,\n words: [],\n symbols: [],\n };\n\n para.lines.forEach((iLine) => {\n const line = {\n ...iLine,\n paragraph: para,\n block,\n page,\n symbols: [],\n };\n\n line.words.forEach((iWord) => {\n const word = {\n ...iWord,\n line,\n paragraph: para,\n block,\n page,\n };\n\n word.symbols.forEach((iSym) => {\n const sym = {\n ...iSym,\n word,\n line,\n paragraph: para,\n block,\n page,\n };\n\n sym.line.symbols.push(sym);\n sym.paragraph.symbols.push(sym);\n sym.block.symbols.push(sym);\n sym.page.symbols.push(sym);\n });\n word.paragraph.words.push(word);\n word.block.words.push(word);\n word.page.words.push(word);\n });\n line.block.lines.push(line);\n line.page.lines.push(line);\n });\n para.page.paragraphs.push(para);\n });\n });\n return page;\n};\n","const adapter = require('../node/');\n\nlet jobCounter = 0;\n\nmodule.exports = class TesseractJob {\n constructor(instance) {\n jobCounter += 1;\n this.id = `Job-${jobCounter}-${Math.random().toString(16).slice(3, 8)}`;\n\n this._instance = instance;\n this._resolve = [];\n this._reject = [];\n this._progress = [];\n this._finally = [];\n }\n\n then(resolve, reject) {\n if (this._resolve.push) {\n this._resolve.push(resolve);\n } else {\n resolve(this._resolve);\n }\n\n if (reject) this.catch(reject);\n return this;\n }\n\n catch(reject) {\n if (this._reject.push) {\n this._reject.push(reject);\n } else {\n reject(this._reject);\n }\n return this;\n }\n\n progress(fn) {\n this._progress.push(fn);\n return this;\n }\n\n finally(fn) {\n this._finally.push(fn);\n return this;\n }\n\n _send(action, payload) {\n adapter.sendPacket(this._instance, {\n jobId: this.id,\n action,\n payload,\n });\n }\n\n _handle(packet) {\n const { data } = packet;\n let runFinallyCbs = false;\n\n if (packet.status === 'resolve') {\n if (this._resolve.length === 0) console.log(data);\n this._resolve.forEach((fn) => {\n const ret = fn(data);\n if (ret && typeof ret.then === 'function') {\n console.warn('TesseractJob instances do not chain like ES6 Promises. To convert it into a real promise, use Promise.resolve.');\n }\n });\n this._resolve = data;\n this._instance._dequeue();\n runFinallyCbs = true;\n } else if (packet.status === 'reject') {\n if (this._reject.length === 0) console.error(data);\n this._reject.forEach(fn => fn(data));\n this._reject = data;\n this._instance._dequeue();\n runFinallyCbs = true;\n } else if (packet.status === 'progress') {\n this._progress.forEach(fn => fn(data));\n } else {\n console.warn('Message type unknown', packet.status);\n }\n\n if (runFinallyCbs) {\n this._finally.forEach(fn => fn(data));\n }\n }\n};\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://Tesseract/webpack/universalModuleDefinition","webpack://Tesseract/webpack/bootstrap","webpack://Tesseract/./node_modules/check-types/src/check-types.js","webpack://Tesseract/./src/browser/index.js","webpack://Tesseract/./src/index.js","webpack://Tesseract/./node_modules/resolve-url/resolve-url.js","webpack://Tesseract/./src/common/options.js","webpack://Tesseract/./src/common/circularize.js","webpack://Tesseract/./src/common/job.js"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","__WEBPACK_AMD_DEFINE_RESULT__","globals","strings","messages","predicates","functions","assert","not","maybe","collections","slice","neginf","posinf","isArray","haveSymbols","assigned","data","number","integer","greater","lhs","rhs","less","greaterOrEqual","lessOrEqual","string","nonEmptyString","toString","instanceStrict","error","like","archetype","array","arrayLike","length","isFunction","testArray","result","testObject","mixin","target","source","keys","forEach","assertModifier","predicate","defaultMessage","args","argCount","message","ErrorType","assertImpl","apply","TypeError","assertPredicate","arguments","Error","notModifier","modifiedPredicate","notImpl","ofModifier","type","collection","map","coerceCollection","item","concat","ignore","createModifiedPredicates","modifier","createModifiedFunctions","shift","pop","configurable","writable","createModifiedModifier","modified","createOfModifiers","base","of","v","b","a","al","f","undefined","iterator","iteration","values","next","done","x","y","substring","indexOf","regex","match","constructor","Date","getTime","hasLength","index","mapSimple","mapComplex","all","any","Array","Number","NEGATIVE_INFINITY","POSITIVE_INFINITY","exportFunctions","check","resolveURL","defaultOptions","version","workerPath","corePath","WebAssembly","spawnWorker","instance","workerOptions","worker","Blob","URL","blob","Worker","createObjectURL","onmessage","_recv","terminateWorker","terminate","sendPacket","packet","image","fetch","then","resp","arrayBuffer","File","Promise","res","fileReader","FileReader","onload","readAsArrayBuffer","reject","loadImage","payload","buf","Uint8Array","img","postMessage","from","adapter","circularize","TesseractJob","TesseractWorker","[object Object]","this","assign","_currentJob","_queue","options","lang","_delay","job","_send","fn","null","push","_dequeue","id","jobId","_handle","status","action","console","warn","__WEBPACK_AMD_DEFINE_FACTORY__","numUrls","document","createElement","href","head","getElementsByTagName","insertBefore","firstChild","resolved","removeChild","langPath","iPage","page","paragraphs","lines","words","symbols","blocks","iBlock","block","iPara","para","iLine","line","paragraph","iWord","word","iSym","sym","jobCounter","Math","random","_instance","_resolve","_reject","_progress","_finally","resolve","catch","runFinallyCbs","log","ret"],"mappings":"CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,IACA,mBAAAG,eAAAC,IACAD,OAAA,GAAAH,GACA,iBAAAC,QACAA,QAAA,UAAAD,IAEAD,EAAA,UAAAC,IARA,CASCK,OAAA,WACD,mBCTA,IAAAC,EAAA,GAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAP,QAGA,IAAAC,EAAAI,EAAAE,GAAA,CACAC,EAAAD,EACAE,GAAA,EACAT,QAAA,IAUA,OANAU,EAAAH,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAQ,GAAA,EAGAR,EAAAD,QA0DA,OArDAM,EAAAM,EAAAF,EAGAJ,EAAAO,EAAAR,EAGAC,EAAAQ,EAAA,SAAAd,EAAAe,EAAAC,GACAV,EAAAW,EAAAjB,EAAAe,IACAG,OAAAC,eAAAnB,EAAAe,EAAA,CAA0CK,YAAA,EAAAC,IAAAL,KAK1CV,EAAAgB,EAAA,SAAAtB,GACA,oBAAAuB,eAAAC,aACAN,OAAAC,eAAAnB,EAAAuB,OAAAC,YAAA,CA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,GAMA,OALAa,KAAAuD,QAAA5C,KACAX,KAAAuD,QAAA5C,KAAAxB,GAEAA,EAAAa,KAAAuD,SAEAvD,KAGAD,SAAAU,GAEA,OADAT,KAAAwD,UAAA7C,KAAAF,GACAT,KAGAD,QAAAU,GAEA,OADAT,KAAAyD,SAAA9C,KAAAF,GACAT,KAGAD,MAAAkB,EAAA5B,GACAM,EAAAtB,WAAA2B,KAAAqD,UAAA,CACAvC,MAAAd,KAAAa,GACAI,SACA5B,YAIAU,QAAAzB,GACA,MAAApH,KAAWA,GAAOoH,EAClB,IAAAsF,GAAA,EAEA,YAAAtF,EAAA0C,QACA,IAAAhB,KAAAsD,SAAAlL,QAAA8I,QAAA2C,IAAA3M,GACA8I,KAAAsD,SAAAzK,QAAA4H,IACA,MAAAqD,EAAArD,EAAAvJ,GACA4M,GAAA,mBAAAA,EAAArF,MACAyC,QAAAC,KAAA,oHAGAnB,KAAAsD,SAAApM,EACA8I,KAAAqD,UAAAzC,WACAgD,GAAA,GACK,WAAAtF,EAAA0C,QACL,IAAAhB,KAAAuD,QAAAnL,QAAA8I,QAAAnJ,MAAAb,GACA8I,KAAAuD,QAAA1K,QAAA4H,KAAAvJ,IACA8I,KAAAuD,QAAArM,EACA8I,KAAAqD,UAAAzC,WACAgD,GAAA,GACK,aAAAtF,EAAA0C,OACLhB,KAAAwD,UAAA3K,QAAA4H,KAAAvJ,IAEAgK,QAAAC,KAAA,uBAAA7C,EAAA0C,QAGA4C,GACA5D,KAAAyD,SAAA5K,QAAA4H,KAAAvJ","file":"tesseract.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Tesseract\"] = factory();\n\telse\n\t\troot[\"Tesseract\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 2);\n","/*globals define, module, Symbol */\n/*jshint -W056 */\n\n(function (globals) {\n 'use strict';\n\n var strings, messages, predicates, functions, assert, not, maybe,\n collections, slice, neginf, posinf, isArray, haveSymbols;\n\n strings = {\n v: 'value',\n n: 'number',\n s: 'string',\n b: 'boolean',\n o: 'object',\n t: 'type',\n a: 'array',\n al: 'array-like',\n i: 'iterable',\n d: 'date',\n f: 'function',\n l: 'length'\n };\n\n messages = {};\n predicates = {};\n\n [\n { n: 'equal', f: equal, s: 'v' },\n { n: 'undefined', f: isUndefined, s: 'v' },\n { n: 'null', f: isNull, s: 'v' },\n { n: 'assigned', f: assigned, s: 'v' },\n { n: 'primitive', f: primitive, s: 'v' },\n { n: 'includes', f: includes, s: 'v' },\n { n: 'zero', f: zero },\n { n: 'infinity', f: infinity },\n { n: 'number', f: number },\n { n: 'integer', f: integer },\n { n: 'even', f: even },\n { n: 'odd', f: odd },\n { n: 'greater', f: greater },\n { n: 'less', f: less },\n { n: 'between', f: between },\n { n: 'greaterOrEqual', f: greaterOrEqual },\n { n: 'lessOrEqual', f: lessOrEqual },\n { n: 'inRange', f: inRange },\n { n: 'positive', f: positive },\n { n: 'negative', f: negative },\n { n: 'string', f: string, s: 's' },\n { n: 'emptyString', f: emptyString, s: 's' },\n { n: 'nonEmptyString', f: nonEmptyString, s: 's' },\n { n: 'contains', f: contains, s: 's' },\n { n: 'match', f: match, s: 's' },\n { n: 'boolean', f: boolean, s: 'b' },\n { n: 'object', f: object, s: 'o' },\n { n: 'emptyObject', f: emptyObject, s: 'o' },\n { n: 'nonEmptyObject', f: nonEmptyObject, s: 'o' },\n { n: 'instanceStrict', f: instanceStrict, s: 't' },\n { n: 'instance', f: instance, s: 't' },\n { n: 'like', f: like, s: 't' },\n { n: 'array', f: array, s: 'a' },\n { n: 'emptyArray', f: emptyArray, s: 'a' },\n { n: 'nonEmptyArray', f: nonEmptyArray, s: 'a' },\n { n: 'arrayLike', f: arrayLike, s: 'al' },\n { n: 'iterable', f: iterable, s: 'i' },\n { n: 'date', f: date, s: 'd' },\n { n: 'function', f: isFunction, s: 'f' },\n { n: 'hasLength', f: hasLength, s: 'l' },\n ].map(function (data) {\n var n = data.n;\n messages[n] = 'Invalid ' + strings[data.s || 'n'];\n predicates[n] = data.f;\n });\n\n functions = {\n apply: apply,\n map: map,\n all: all,\n any: any\n };\n\n collections = [ 'array', 'arrayLike', 'iterable', 'object' ];\n slice = Array.prototype.slice;\n neginf = Number.NEGATIVE_INFINITY;\n posinf = Number.POSITIVE_INFINITY;\n isArray = Array.isArray;\n haveSymbols = typeof Symbol === 'function';\n\n functions = mixin(functions, predicates);\n assert = createModifiedPredicates(assertModifier, assertImpl);\n not = createModifiedPredicates(notModifier, notImpl);\n maybe = createModifiedPredicates(maybeModifier, maybeImpl);\n assert.not = createModifiedModifier(assertModifier, not);\n assert.maybe = createModifiedModifier(assertModifier, maybe);\n\n collections.forEach(createOfPredicates);\n createOfModifiers(assert, assertModifier);\n createOfModifiers(not, notModifier);\n collections.forEach(createMaybeOfModifiers);\n\n exportFunctions(mixin(functions, {\n assert: assert,\n not: not,\n maybe: maybe\n }));\n\n /**\n * Public function `equal`.\n *\n * Returns true if `lhs` and `rhs` are strictly equal, without coercion.\n * Returns false otherwise.\n */\n function equal (lhs, rhs) {\n return lhs === rhs;\n }\n\n /**\n * Public function `undefined`.\n *\n * Returns true if `data` is undefined, false otherwise.\n */\n function isUndefined (data) {\n return data === undefined;\n }\n\n /**\n * Public function `null`.\n *\n * Returns true if `data` is null, false otherwise.\n */\n function isNull (data) {\n return data === null;\n }\n\n /**\n * Public function `assigned`.\n *\n * Returns true if `data` is not null or undefined, false otherwise.\n */\n function assigned (data) {\n return data !== undefined && data !== null;\n }\n\n /**\n * Public function `primitive`.\n *\n * Returns true if `data` is a primitive type, false otherwise.\n */\n function primitive (data) {\n var type;\n\n switch (data) {\n case null:\n case undefined:\n case false:\n case true:\n return true;\n }\n\n type = typeof data;\n return type === 'string' || type === 'number' || (haveSymbols && type === 'symbol');\n }\n\n /**\n * Public function `zero`.\n *\n * Returns true if `data` is zero, false otherwise.\n */\n function zero (data) {\n return data === 0;\n }\n\n /**\n * Public function `infinity`.\n *\n * Returns true if `data` is positive or negative infinity, false otherwise.\n */\n function infinity (data) {\n return data === neginf || data === posinf;\n }\n\n /**\n * Public function `number`.\n *\n * Returns true if `data` is a number, false otherwise.\n */\n function number (data) {\n return typeof data === 'number' && data > neginf && data < posinf;\n }\n\n /**\n * Public function `integer`.\n *\n * Returns true if `data` is an integer, false otherwise.\n */\n function integer (data) {\n return typeof data === 'number' && data % 1 === 0;\n }\n\n /**\n * Public function `even`.\n *\n * Returns true if `data` is an even number, false otherwise.\n */\n function even (data) {\n return typeof data === 'number' && data % 2 === 0;\n }\n\n /**\n * Public function `odd`.\n *\n * Returns true if `data` is an odd number, false otherwise.\n */\n function odd (data) {\n return integer(data) && data % 2 !== 0;\n }\n\n /**\n * Public function `greater`.\n *\n * Returns true if `lhs` is a number greater than `rhs`, false otherwise.\n */\n function greater (lhs, rhs) {\n return number(lhs) && lhs > rhs;\n }\n\n /**\n * Public function `less`.\n *\n * Returns true if `lhs` is a number less than `rhs`, false otherwise.\n */\n function less (lhs, rhs) {\n return number(lhs) && lhs < rhs;\n }\n\n /**\n * Public function `between`.\n *\n * Returns true if `data` is a number between `x` and `y`, false otherwise.\n */\n function between (data, x, y) {\n if (x < y) {\n return greater(data, x) && data < y;\n }\n\n return less(data, x) && data > y;\n }\n\n /**\n * Public function `greaterOrEqual`.\n *\n * Returns true if `lhs` is a number greater than or equal to `rhs`, false\n * otherwise.\n */\n function greaterOrEqual (lhs, rhs) {\n return number(lhs) && lhs >= rhs;\n }\n\n /**\n * Public function `lessOrEqual`.\n *\n * Returns true if `lhs` is a number less than or equal to `rhs`, false\n * otherwise.\n */\n function lessOrEqual (lhs, rhs) {\n return number(lhs) && lhs <= rhs;\n }\n\n /**\n * Public function `inRange`.\n *\n * Returns true if `data` is a number in the range `x..y`, false otherwise.\n */\n function inRange (data, x, y) {\n if (x < y) {\n return greaterOrEqual(data, x) && data <= y;\n }\n\n return lessOrEqual(data, x) && data >= y;\n }\n\n /**\n * Public function `positive`.\n *\n * Returns true if `data` is a positive number, false otherwise.\n */\n function positive (data) {\n return greater(data, 0);\n }\n\n /**\n * Public function `negative`.\n *\n * Returns true if `data` is a negative number, false otherwise.\n */\n function negative (data) {\n return less(data, 0);\n }\n\n /**\n * Public function `string`.\n *\n * Returns true if `data` is a string, false otherwise.\n */\n function string (data) {\n return typeof data === 'string';\n }\n\n /**\n * Public function `emptyString`.\n *\n * Returns true if `data` is the empty string, false otherwise.\n */\n function emptyString (data) {\n return data === '';\n }\n\n /**\n * Public function `nonEmptyString`.\n *\n * Returns true if `data` is a non-empty string, false otherwise.\n */\n function nonEmptyString (data) {\n return string(data) && data !== '';\n }\n\n /**\n * Public function `contains`.\n *\n * Returns true if `data` is a string that contains `substring`, false\n * otherwise.\n */\n function contains (data, substring) {\n return string(data) && data.indexOf(substring) !== -1;\n }\n\n /**\n * Public function `match`.\n *\n * Returns true if `data` is a string that matches `regex`, false otherwise.\n */\n function match (data, regex) {\n return string(data) && !! data.match(regex);\n }\n\n /**\n * Public function `boolean`.\n *\n * Returns true if `data` is a boolean value, false otherwise.\n */\n function boolean (data) {\n return data === false || data === true;\n }\n\n /**\n * Public function `object`.\n *\n * Returns true if `data` is a plain-old JS object, false otherwise.\n */\n function object (data) {\n return Object.prototype.toString.call(data) === '[object Object]';\n }\n\n /**\n * Public function `emptyObject`.\n *\n * Returns true if `data` is an empty object, false otherwise.\n */\n function emptyObject (data) {\n return object(data) && Object.keys(data).length === 0;\n }\n\n /**\n * Public function `nonEmptyObject`.\n *\n * Returns true if `data` is a non-empty object, false otherwise.\n */\n function nonEmptyObject (data) {\n return object(data) && Object.keys(data).length > 0;\n }\n\n /**\n * Public function `instanceStrict`.\n *\n * Returns true if `data` is an instance of `prototype`, false otherwise.\n */\n function instanceStrict (data, prototype) {\n try {\n return data instanceof prototype;\n } catch (error) {\n return false;\n }\n }\n\n /**\n * Public function `instance`.\n *\n * Returns true if `data` is an instance of `prototype`, false otherwise.\n * Falls back to testing constructor.name and Object.prototype.toString\n * if the initial instanceof test fails.\n */\n function instance (data, prototype) {\n try {\n return instanceStrict(data, prototype) ||\n data.constructor.name === prototype.name ||\n Object.prototype.toString.call(data) === '[object ' + prototype.name + ']';\n } catch (error) {\n return false;\n }\n }\n\n /**\n * Public function `like`.\n *\n * Tests whether `data` 'quacks like a duck'. Returns true if `data` has all\n * of the properties of `archetype` (the 'duck'), false otherwise.\n */\n function like (data, archetype) {\n var name;\n\n for (name in archetype) {\n if (archetype.hasOwnProperty(name)) {\n if (data.hasOwnProperty(name) === false || typeof data[name] !== typeof archetype[name]) {\n return false;\n }\n\n if (object(data[name]) && like(data[name], archetype[name]) === false) {\n return false;\n }\n }\n }\n\n return true;\n }\n\n /**\n * Public function `array`.\n *\n * Returns true if `data` is an array, false otherwise.\n */\n function array (data) {\n return isArray(data);\n }\n\n /**\n * Public function `emptyArray`.\n *\n * Returns true if `data` is an empty array, false otherwise.\n */\n function emptyArray (data) {\n return array(data) && data.length === 0;\n }\n\n /**\n * Public function `nonEmptyArray`.\n *\n * Returns true if `data` is a non-empty array, false otherwise.\n */\n function nonEmptyArray (data) {\n return array(data) && greater(data.length, 0);\n }\n\n /**\n * Public function `arrayLike`.\n *\n * Returns true if `data` is an array-like object, false otherwise.\n */\n function arrayLike (data) {\n return assigned(data) && greaterOrEqual(data.length, 0);\n }\n\n /**\n * Public function `iterable`.\n *\n * Returns true if `data` is an iterable, false otherwise.\n */\n function iterable (data) {\n if (! haveSymbols) {\n // Fall back to `arrayLike` predicate in pre-ES6 environments.\n return arrayLike(data);\n }\n\n return assigned(data) && isFunction(data[Symbol.iterator]);\n }\n\n /**\n * Public function `includes`.\n *\n * Returns true if `data` contains `value`, false otherwise.\n */\n function includes (data, value) {\n var iterator, iteration, keys, length, i;\n\n if (! assigned(data)) {\n return false;\n }\n\n if (haveSymbols && data[Symbol.iterator] && isFunction(data.values)) {\n iterator = data.values();\n\n do {\n iteration = iterator.next();\n\n if (iteration.value === value) {\n return true;\n }\n } while (! iteration.done);\n\n return false;\n }\n\n keys = Object.keys(data);\n length = keys.length;\n for (i = 0; i < length; ++i) {\n if (data[keys[i]] === value) {\n return true;\n }\n }\n\n return false;\n }\n\n /**\n * Public function `hasLength`.\n *\n * Returns true if `data` has a length property that equals `length`, false\n * otherwise.\n */\n function hasLength (data, length) {\n return assigned(data) && data.length === length;\n }\n\n /**\n * Public function `date`.\n *\n * Returns true if `data` is a valid date, false otherwise.\n */\n function date (data) {\n return instanceStrict(data, Date) && integer(data.getTime());\n }\n\n /**\n * Public function `function`.\n *\n * Returns true if `data` is a function, false otherwise.\n */\n function isFunction (data) {\n return typeof data === 'function';\n }\n\n /**\n * Public function `apply`.\n *\n * Maps each value from the `data` to the corresponding predicate and returns\n * the result array. If the same function is to be applied across all of the\n * data, a single predicate function may be passed in.\n *\n */\n function apply (data, predicates) {\n assert.array(data);\n\n if (isFunction(predicates)) {\n return data.map(function (value) {\n return predicates(value);\n });\n }\n\n assert.array(predicates);\n assert.hasLength(data, predicates.length);\n\n return data.map(function (value, index) {\n return predicates[index](value);\n });\n }\n\n /**\n * Public function `map`.\n *\n * Maps each value from the `data` to the corresponding predicate and returns\n * the result object. Supports nested objects. If the `data` is not nested and\n * the same function is to be applied across all of it, a single predicate\n * function may be passed in.\n *\n */\n function map (data, predicates) {\n assert.object(data);\n\n if (isFunction(predicates)) {\n return mapSimple(data, predicates);\n }\n\n assert.object(predicates);\n\n return mapComplex(data, predicates);\n }\n\n function mapSimple (data, predicate) {\n var result = {};\n\n Object.keys(data).forEach(function (key) {\n result[key] = predicate(data[key]);\n });\n\n return result;\n }\n\n function mapComplex (data, predicates) {\n var result = {};\n\n Object.keys(predicates).forEach(function (key) {\n var predicate = predicates[key];\n\n if (isFunction(predicate)) {\n if (not.assigned(data)) {\n result[key] = !!predicate.m;\n } else {\n result[key] = predicate(data[key]);\n }\n } else if (object(predicate)) {\n result[key] = mapComplex(data[key], predicate);\n }\n });\n\n return result;\n }\n\n /**\n * Public function `all`\n *\n * Check that all boolean values are true\n * in an array (returned from `apply`)\n * or object (returned from `map`).\n *\n */\n function all (data) {\n if (array(data)) {\n return testArray(data, false);\n }\n\n assert.object(data);\n\n return testObject(data, false);\n }\n\n function testArray (data, result) {\n var i;\n\n for (i = 0; i < data.length; i += 1) {\n if (data[i] === result) {\n return result;\n }\n }\n\n return !result;\n }\n\n function testObject (data, result) {\n var key, value;\n\n for (key in data) {\n if (data.hasOwnProperty(key)) {\n value = data[key];\n\n if (object(value) && testObject(value, result) === result) {\n return result;\n }\n\n if (value === result) {\n return result;\n }\n }\n }\n\n return !result;\n }\n\n /**\n * Public function `any`\n *\n * Check that at least one boolean value is true\n * in an array (returned from `apply`)\n * or object (returned from `map`).\n *\n */\n function any (data) {\n if (array(data)) {\n return testArray(data, true);\n }\n\n assert.object(data);\n\n return testObject(data, true);\n }\n\n function mixin (target, source) {\n Object.keys(source).forEach(function (key) {\n target[key] = source[key];\n });\n\n return target;\n }\n\n /**\n * Public modifier `assert`.\n *\n * Throws if `predicate` returns false.\n */\n function assertModifier (predicate, defaultMessage) {\n return function () {\n return assertPredicate(predicate, arguments, defaultMessage);\n };\n }\n\n function assertPredicate (predicate, args, defaultMessage) {\n var argCount = predicate.l || predicate.length;\n var message = args[argCount];\n var ErrorType = args[argCount + 1];\n assertImpl(\n predicate.apply(null, args),\n nonEmptyString(message) ? message : defaultMessage,\n isFunction(ErrorType) ? ErrorType : TypeError\n );\n return args[0];\n }\n\n function assertImpl (value, message, ErrorType) {\n if (value) {\n return value;\n }\n throw new (ErrorType || Error)(message || 'Assertion failed');\n }\n\n /**\n * Public modifier `not`.\n *\n * Negates `predicate`.\n */\n function notModifier (predicate) {\n var modifiedPredicate = function () {\n return notImpl(predicate.apply(null, arguments));\n };\n modifiedPredicate.l = predicate.length;\n return modifiedPredicate;\n }\n\n function notImpl (value) {\n return !value;\n }\n\n /**\n * Public modifier `maybe`.\n *\n * Returns true if predicate argument is null or undefined,\n * otherwise propagates the return value from `predicate`.\n */\n function maybeModifier (predicate) {\n var modifiedPredicate = function () {\n if (not.assigned(arguments[0])) {\n return true;\n }\n\n return predicate.apply(null, arguments);\n };\n modifiedPredicate.l = predicate.length;\n\n // Hackishly indicate that this is a maybe.xxx predicate.\n // Without this flag, the alternative would be to iterate\n // through the maybe predicates or use indexOf to check,\n // which would be time-consuming.\n modifiedPredicate.m = true;\n\n return modifiedPredicate;\n }\n\n function maybeImpl (value) {\n if (assigned(value) === false) {\n return true;\n }\n\n return value;\n }\n\n /**\n * Public modifier `of`.\n *\n * Applies the chained predicate to members of the collection.\n */\n function ofModifier (target, type, predicate) {\n var modifiedPredicate = function () {\n var collection, args;\n\n collection = arguments[0];\n\n if (target === 'maybe' && not.assigned(collection)) {\n return true;\n }\n\n if (!type(collection)) {\n return false;\n }\n\n collection = coerceCollection(type, collection);\n args = slice.call(arguments, 1);\n\n try {\n collection.forEach(function (item) {\n if (\n (target !== 'maybe' || assigned(item)) &&\n !predicate.apply(null, [ item ].concat(args))\n ) {\n // TODO: Replace with for...of when ES6 is required.\n throw 0;\n }\n });\n } catch (ignore) {\n return false;\n }\n\n return true;\n };\n modifiedPredicate.l = predicate.length;\n return modifiedPredicate;\n }\n\n function coerceCollection (type, collection) {\n switch (type) {\n case arrayLike:\n return slice.call(collection);\n case object:\n return Object.keys(collection).map(function (key) {\n return collection[key];\n });\n default:\n return collection;\n }\n }\n\n function createModifiedPredicates (modifier, object) {\n return createModifiedFunctions([ modifier, predicates, object ]);\n }\n\n function createModifiedFunctions (args) {\n var modifier, object, functions, result;\n\n modifier = args.shift();\n object = args.pop();\n functions = args.pop();\n\n result = object || {};\n\n Object.keys(functions).forEach(function (key) {\n Object.defineProperty(result, key, {\n configurable: false,\n enumerable: true,\n writable: false,\n value: modifier.apply(null, args.concat(functions[key], messages[key]))\n });\n });\n\n return result;\n }\n\n function createModifiedModifier (modifier, modified) {\n return createModifiedFunctions([ modifier, modified, null ]);\n }\n\n function createOfPredicates (key) {\n predicates[key].of = createModifiedFunctions(\n [ ofModifier.bind(null, null), predicates[key], predicates, null ]\n );\n }\n\n function createOfModifiers (base, modifier) {\n collections.forEach(function (key) {\n base[key].of = createModifiedModifier(modifier, predicates[key].of);\n });\n }\n\n function createMaybeOfModifiers (key) {\n maybe[key].of = createModifiedFunctions(\n [ ofModifier.bind(null, 'maybe'), predicates[key], predicates, null ]\n );\n assert.maybe[key].of = createModifiedModifier(assertModifier, maybe[key].of);\n assert.not[key].of = createModifiedModifier(assertModifier, not[key].of);\n }\n\n function exportFunctions (functions) {\n if (typeof define === 'function' && define.amd) {\n define(function () {\n return functions;\n });\n } else if (typeof module !== 'undefined' && module !== null && module.exports) {\n module.exports = functions;\n } else {\n globals.check = functions;\n }\n }\n}(this));\n","const check = require('check-types');\nconst resolveURL = require('resolve-url');\nconst { defaultOptions } = require('../common/options');\nconst { version } = require('../../package.json');\n\nconst loadImage = (image) => {\n if (check.string(image)) {\n return fetch(resolveURL(image))\n .then(resp => resp.arrayBuffer());\n }\n if (check.instance(image, File)) {\n return new Promise((res) => {\n const fileReader = new FileReader();\n fileReader.onload = () => {\n res(fileReader.result);\n };\n fileReader.readAsArrayBuffer(image);\n });\n }\n return Promise.reject();\n};\n\nexports.defaultOptions = {\n ...defaultOptions,\n workerPath: process.env.NODE_ENV === 'development'\n ? resolveURL(`/dist/worker.dev.js?nocache=${Math.random().toString(36).slice(3)}`)\n : `https://cdn.jsdelivr.net/gh/naptha/tesseract.js@v${version}/dist/worker.min.js`,\n corePath: `https://cdn.jsdelivr.net/gh/naptha/tesseract.js-core@v2.0.0-beta.5/tesseract-core${typeof WebAssembly === 'object' ? '' : '.asm'}.js`,\n};\n\nexports.spawnWorker = (instance, workerOptions) => {\n let worker;\n if (window.Blob && window.URL) {\n const blob = new Blob([`importScripts(\"${workerOptions.workerPath}\");`]);\n worker = new Worker(window.URL.createObjectURL(blob));\n } else {\n worker = new Worker(workerOptions.workerPath);\n }\n\n worker.onmessage = ({ data }) => {\n instance._recv(data);\n };\n\n return worker;\n};\n\nexports.terminateWorker = (instance) => {\n instance.worker.terminate();\n};\n\nexports.sendPacket = (instance, packet) => {\n loadImage(packet.payload.image)\n .then(buf => new Uint8Array(buf))\n .then((img) => {\n instance.worker.postMessage({\n ...packet,\n payload: {\n ...packet.payload,\n image: Array.from(img),\n },\n });\n });\n};\n","const check = require('check-types');\nconst adapter = require('./node');\nconst circularize = require('./common/circularize');\nconst TesseractJob = require('./common/job');\n\nclass TesseractWorker {\n constructor(workerOptions = {}) {\n this.worker = null;\n this.workerOptions = Object.assign({}, adapter.defaultOptions, workerOptions);\n this._currentJob = null;\n this._queue = [];\n }\n\n recognize(image, options = { lang: 'eng' }) {\n return this._delay((job) => {\n job._send(\n 'recognize',\n {\n image,\n options: check.string(options)\n ? { lang: options || 'eng' }\n : options,\n workerOptions: this.workerOptions,\n },\n );\n });\n }\n\n detect(image, options = {}) {\n return this._delay((job) => {\n job._send(\n 'detect',\n {\n image,\n options,\n workerOptions: this.workerOptions,\n },\n );\n });\n }\n\n terminate() {\n if (this.worker) {\n adapter.terminateWorker(this);\n }\n this.worker = null;\n this._currentJob = null;\n this._queue = [];\n }\n\n _delay(fn) {\n if (check.null(this.worker)) {\n this.worker = adapter.spawnWorker(this, this.workerOptions);\n }\n\n const job = new TesseractJob(this);\n this._queue.push(() => {\n this._queue.shift();\n this._currentJob = job;\n fn(job);\n });\n if (check.null(this._currentJob)) {\n this._dequeue();\n }\n return job;\n }\n\n _dequeue() {\n this._currentJob = null;\n if (this._queue.length) {\n this._queue[0]();\n }\n }\n\n _recv(packet) {\n if (this._currentJob.id === packet.jobId) {\n this._currentJob._handle({\n ...packet,\n data: packet.status === 'resolve' && packet.action === 'recognize'\n ? circularize(packet.data)\n : packet.data,\n });\n } else {\n console.warn(`Job ID ${packet.jobId} not known.`);\n }\n }\n}\n\nmodule.exports = {\n TesseractWorker,\n};\n","// Copyright 2014 Simon Lydell\r\n// X11 (“MIT”) Licensed. (See LICENSE.)\r\n\r\nvoid (function(root, factory) {\r\n if (typeof define === \"function\" && define.amd) {\r\n define(factory)\r\n } else if (typeof exports === \"object\") {\r\n module.exports = factory()\r\n } else {\r\n root.resolveUrl = factory()\r\n }\r\n}(this, function() {\r\n\r\n function resolveUrl(/* ...urls */) {\r\n var numUrls = arguments.length\r\n\r\n if (numUrls === 0) {\r\n throw new Error(\"resolveUrl requires at least one argument; got none.\")\r\n }\r\n\r\n var base = document.createElement(\"base\")\r\n base.href = arguments[0]\r\n\r\n if (numUrls === 1) {\r\n return base.href\r\n }\r\n\r\n var head = document.getElementsByTagName(\"head\")[0]\r\n head.insertBefore(base, head.firstChild)\r\n\r\n var a = document.createElement(\"a\")\r\n var resolved\r\n\r\n for (var index = 1; index < numUrls; index++) {\r\n a.href = arguments[index]\r\n resolved = a.href\r\n base.href = resolved\r\n }\r\n\r\n head.removeChild(base)\r\n\r\n return resolved\r\n }\r\n\r\n return resolveUrl\r\n\r\n}));\r\n","module.exports = {\n defaultOptions: {\n langPath: 'https://tessdata.projectnaptha.com/4.0.0',\n },\n};\n","// The result of dump.js is a big JSON tree\n// which can be easily serialized (for instance\n// to be sent from a webworker to the main app\n// or through Node's IPC), but we want\n// a (circular) DOM-like interface for walking\n// through the data.\n\nmodule.exports = (iPage) => {\n const page = {\n ...iPage,\n paragraphs: [],\n lines: [],\n words: [],\n symbols: [],\n };\n\n page.blocks.forEach((iBlock) => {\n const block = {\n ...iBlock,\n page,\n lines: [],\n words: [],\n symbols: [],\n };\n\n block.paragraphs.forEach((iPara) => {\n const para = {\n ...iPara,\n block,\n page,\n words: [],\n symbols: [],\n };\n\n para.lines.forEach((iLine) => {\n const line = {\n ...iLine,\n paragraph: para,\n block,\n page,\n symbols: [],\n };\n\n line.words.forEach((iWord) => {\n const word = {\n ...iWord,\n line,\n paragraph: para,\n block,\n page,\n };\n\n word.symbols.forEach((iSym) => {\n const sym = {\n ...iSym,\n word,\n line,\n paragraph: para,\n block,\n page,\n };\n\n sym.line.symbols.push(sym);\n sym.paragraph.symbols.push(sym);\n sym.block.symbols.push(sym);\n sym.page.symbols.push(sym);\n });\n word.paragraph.words.push(word);\n word.block.words.push(word);\n word.page.words.push(word);\n });\n line.block.lines.push(line);\n line.page.lines.push(line);\n });\n para.page.paragraphs.push(para);\n });\n });\n return page;\n};\n","const adapter = require('../node/');\n\nlet jobCounter = 0;\n\nmodule.exports = class TesseractJob {\n constructor(instance) {\n jobCounter += 1;\n this.id = `Job-${jobCounter}-${Math.random().toString(16).slice(3, 8)}`;\n\n this._instance = instance;\n this._resolve = [];\n this._reject = [];\n this._progress = [];\n this._finally = [];\n }\n\n then(resolve, reject) {\n if (this._resolve.push) {\n this._resolve.push(resolve);\n } else {\n resolve(this._resolve);\n }\n\n if (reject) this.catch(reject);\n return this;\n }\n\n catch(reject) {\n if (this._reject.push) {\n this._reject.push(reject);\n } else {\n reject(this._reject);\n }\n return this;\n }\n\n progress(fn) {\n this._progress.push(fn);\n return this;\n }\n\n finally(fn) {\n this._finally.push(fn);\n return this;\n }\n\n _send(action, payload) {\n adapter.sendPacket(this._instance, {\n jobId: this.id,\n action,\n payload,\n });\n }\n\n _handle(packet) {\n const { data } = packet;\n let runFinallyCbs = false;\n\n if (packet.status === 'resolve') {\n if (this._resolve.length === 0) console.log(data);\n this._resolve.forEach((fn) => {\n const ret = fn(data);\n if (ret && typeof ret.then === 'function') {\n console.warn('TesseractJob instances do not chain like ES6 Promises. To convert it into a real promise, use Promise.resolve.');\n }\n });\n this._resolve = data;\n this._instance._dequeue();\n runFinallyCbs = true;\n } else if (packet.status === 'reject') {\n if (this._reject.length === 0) console.error(data);\n this._reject.forEach(fn => fn(data));\n this._reject = data;\n this._instance._dequeue();\n runFinallyCbs = true;\n } else if (packet.status === 'progress') {\n this._progress.forEach(fn => fn(data));\n } else {\n console.warn('Message type unknown', packet.status);\n }\n\n if (runFinallyCbs) {\n this._finally.forEach(fn => fn(data));\n }\n }\n};\n"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/worker.min.js b/dist/worker.min.js index e8f906c..b718e7a 100644 --- a/dist/worker.min.js +++ b/dist/worker.min.js @@ -1,9 +1,9 @@ -!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r=e();for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(window,function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([function(t,e){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){(function(t){const e=r(2);t.addEventListener("message",({data:t})=>{e.dispatchHandlers(t,t=>postMessage(t))}),e.setAdapter({getCore:(e,r)=>(t.TesseractCore||(r.progress({status:"loading tesseract core",progress:0}),t.importScripts(e.workerOptions.corePath),t.TesseractCore="object"==typeof WebAssembly?t.TesseractCoreWASM:t.TesseractCoreASM,r.progress({status:"loading tesseract core",progress:1})),t.TesseractCore)})}).call(this,r(0))},function(t,e,r){const{readImage:n,loadLang:i}=r(3),o=r(17);let s,a,h,f={};const u=(t,e)=>{let r=100663296;if(["chi_sim","chi_tra","jpn"].includes(t.options.lang)&&(r=167772160),!s||s.TOTAL_MEMORY{a=new(s=t).TessBaseAPI,e.progress({status:"initialized tesseract",progress:1})})}return new Promise},c=t=>{const{w:e,h:r,data:i}=n(s,Array.from(t));return a.SetImage(i),a.SetRectangle(0,0,e,r),i},l=(t,e,r)=>{const{options:{lang:n},workerOptions:{langPath:o}}=t;return i({langs:n,tessModule:s,langURI:o,cache:!0}).then(r)};e.dispatchHandlers=((t,e)=>{const r=(r,n)=>{e({jobId:t.jobId,status:r,action:t.action,data:n})};r.resolve=r.bind(this,"resolve"),r.reject=r.bind(this,"reject"),r.progress=r.bind(this,"progress"),h=r;try{"recognize"===t.action?((t,e)=>{u(t,e).then(()=>{l(t,0,()=>{const{options:r}=t,n=t=>{e.progress({status:"initializing api",progress:t})};n(0),a.Init(null,r.lang),n(.3),Object.keys(r).forEach(t=>{a.SetVariable(t,r[t])}),n(.6);const i=c(t.image);n(1),a.Recognize(null);const h=o(s,a);a.End(),s._free(i),e.resolve(h)})})})(t.payload,r):"detect"===t.action&&((t,e)=>{u(t,e).then(()=>{t.options.lang="osd",l(t,0,()=>{a.Init(null,"osd"),a.SetPageSegMode(s.PSM_OSD_ONLY);const r=c(t.image),n=new s.OSResults;if(a.DetectOS(n)){const t=n.get_best_result(),i=t.get_orientation_id(),o=t.get_script_id();a.End(),s._free(r),e.resolve({tesseract_script_id:o,script:n.get_unicharset().get_script_from_script_id(o),script_confidence:t.get_sconfidence(),orientation_degrees:[0,270,180,90][i],orientation_confidence:t.get_oconfidence()})}else a.End(),s._free(r),e.reject("Failed to detect OS")})})})(t.payload,r)}catch(t){r.reject(t.toString())}}),e.setAdapter=(t=>{f=t})},function(t,e,r){t.exports={loadLang:r(4)({fetch:r(5),gunzip:r(7),...r(14)}),readImage:r(16)}},function(t,e){const r=t=>({tessModule:e,dataPath:r,cachePath:n,cache:i,lang:o})=>s=>{if(e){if(r)try{e.FS.mkdir(r)}catch(t){}e.FS.writeFile(`${r||"."}/${o}.traineddata`,s)}return i&&t.writeCache(`${n||"."}/${o}.traineddata`,s),s};t.exports=(t=>({langs:e,...n})=>Promise.all(e.split("+").map((t=>({langURI:e,cachePath:n,...i})=>o=>t.readCache(`${n||"."}/${o}.traineddata`).then(e=>void 0===e?Promise.reject():r(t)({cachePath:n,lang:o,...i})(e)).catch(()=>t.fetch(`${e}/${o}.traineddata.gz`).then(t=>t.arrayBuffer()).then(e=>t.gunzip(new Uint8Array(e))).then(r(t)({cachePath:n,lang:o,...i}))))(t)(n))))},function(t,e,r){const{fetch:n}=r(6);t.exports=n},function(t,e,r){"use strict";r.r(e),r.d(e,"Headers",function(){return f}),r.d(e,"Request",function(){return g}),r.d(e,"Response",function(){return w}),r.d(e,"DOMException",function(){return m}),r.d(e,"fetch",function(){return A});var n={searchParams:"URLSearchParams"in self,iterable:"Symbol"in self&&"iterator"in Symbol,blob:"FileReader"in self&&"Blob"in self&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in self,arrayBuffer:"ArrayBuffer"in self};if(n.arrayBuffer)var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],o=ArrayBuffer.isView||function(t){return t&&i.indexOf(Object.prototype.toString.call(t))>-1};function s(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function a(t){return"string"!=typeof t&&(t=String(t)),t}function h(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return n.iterable&&(e[Symbol.iterator]=function(){return e}),e}function f(t){this.map={},t instanceof f?t.forEach(function(t,e){this.append(e,t)},this):Array.isArray(t)?t.forEach(function(t){this.append(t[0],t[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function u(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function c(t){return new Promise(function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}})}function l(t){var e=new FileReader,r=c(e);return e.readAsArrayBuffer(t),r}function p(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function y(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:n.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:n.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:n.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():n.arrayBuffer&&n.blob&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=p(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):n.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||o(t))?this._bodyArrayBuffer=p(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},n.blob&&(this.blob=function(){var t=u(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?u(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(l)}),this.text=function(){var t,e,r,n=u(this);if(n)return n;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,r=c(e),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n-1?n:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function b(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(i))}}),e}function w(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new f(e.headers),this.url=e.url||"",this._initBody(t)}g.prototype.clone=function(){return new g(this,{body:this._bodyInit})},y.call(g.prototype),y.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},w.error=function(){var t=new w(null,{status:0,statusText:""});return t.type="error",t};var v=[301,302,303,307,308];w.redirect=function(t,e){if(-1===v.indexOf(e))throw new RangeError("Invalid status code");return new w(null,{status:e,headers:{location:t}})};var m=self.DOMException;try{new m}catch(t){(m=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack}).prototype=Object.create(Error.prototype),m.prototype.constructor=m}function A(t,e){return new Promise(function(r,i){var o=new g(t,e);if(o.signal&&o.signal.aborted)return i(new m("Aborted","AbortError"));var s=new XMLHttpRequest;function a(){s.abort()}s.onload=function(){var t,e,n={status:s.status,statusText:s.statusText,headers:(t=s.getAllResponseHeaders()||"",e=new f,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(t){var r=t.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();e.append(n,i)}}),e)};n.url="responseURL"in s?s.responseURL:n.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;r(new w(i,n))},s.onerror=function(){i(new TypeError("Network request failed"))},s.ontimeout=function(){i(new TypeError("Network request failed"))},s.onabort=function(){i(new m("Aborted","AbortError"))},s.open(o.method,o.url,!0),"include"===o.credentials?s.withCredentials=!0:"omit"===o.credentials&&(s.withCredentials=!1),"responseType"in s&&n.blob&&(s.responseType="blob"),o.headers.forEach(function(t,e){s.setRequestHeader(e,t)}),o.signal&&(o.signal.addEventListener("abort",a),s.onreadystatechange=function(){4===s.readyState&&o.signal.removeEventListener("abort",a)}),s.send(void 0===o._bodyInit?null:o._bodyInit)})}A.polyfill=!0,self.fetch||(self.fetch=A,self.Headers=f,self.Request=g,self.Response=w)},function(t,e,r){t.exports=r(8).gunzipSync},function(t,e,r){(function(t,r){/** @license zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License */(function(){"use strict";function n(t){throw t}var i=void 0,o=!0,s="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array&&"undefined"!=typeof DataView;function a(t,e){this.index="number"==typeof e?e:0,this.m=0,this.buffer=t instanceof(s?Uint8Array:Array)?t:new(s?Uint8Array:Array)(32768),2*this.buffer.length<=this.index&&n(Error("invalid index")),this.buffer.length<=this.index&&this.f()}a.prototype.f=function(){var t,e=this.buffer,r=e.length,n=new(s?Uint8Array:Array)(r<<1);if(s)n.set(e);else for(t=0;t>>8&255]<<16|p[t>>>16&255]<<8|p[t>>>24&255])>>32-e:p[t]>>8-e),8>e+s)a=a<>e-n-1&1,8==++s&&(s=0,i[o++]=p[a],a=0,o===i.length&&(i=this.f()));i[o]=a,this.buffer=i,this.m=s,this.index=o},a.prototype.finish=function(){var t,e=this.buffer,r=this.index;return 0h;++h){for(var u=l=h,c=7,l=l>>>1;l;l>>>=1)u<<=1,u|=1&l,--c;f[h]=(u<>>0}var p=f;function y(t,e,r){var n,i="number"==typeof e?e:e=0,o="number"==typeof r?r:t.length;for(n=-1,i=7&o;i--;++e)n=n>>>8^g[255&(n^t[e])];for(i=o>>3;i--;e+=8)n=(n=(n=(n=(n=(n=(n=(n=n>>>8^g[255&(n^t[e])])>>>8^g[255&(n^t[e+1])])>>>8^g[255&(n^t[e+2])])>>>8^g[255&(n^t[e+3])])>>>8^g[255&(n^t[e+4])])>>>8^g[255&(n^t[e+5])])>>>8^g[255&(n^t[e+6])])>>>8^g[255&(n^t[e+7])];return(4294967295^n)>>>0}var d=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],g=s?new Uint32Array(d):d;function b(){}function w(t){this.buffer=new(s?Uint16Array:Array)(2*t),this.length=0}function v(t){var e,r,n,i,o,a,h,f,u,c,l=t.length,p=0,y=Number.POSITIVE_INFINITY;for(f=0;fp&&(p=t[f]),t[f]>=1;for(c=n<<16|f,u=a;uo[n]);)i=o[r],o[r]=o[n],o[n]=i,i=o[r+1],o[r+1]=o[n+1],o[n+1]=i,r=n;return this.length},w.prototype.pop=function(){var t,e,r,n,i,o=this.buffer;for(e=o[0],t=o[1],this.length-=2,o[0]=o[this.length],o[1]=o[this.length+1],i=0;!((n=2*i+2)>=this.length)&&(n+2o[n]&&(n+=2),o[n]>o[i]);)r=o[i],o[i]=o[n],o[n]=r,r=o[i+1],o[i+1]=o[n+1],o[n+1]=r,i=n;return{index:t,value:e,length:this.length}};var A,_=2,E={NONE:0,L:1,t:_,X:3},T=[];for(A=0;288>A;A++)switch(o){case 143>=A:T.push([A+48,8]);break;case 255>=A:T.push([A-144+400,9]);break;case 279>=A:T.push([A-256+0,7]);break;case 287>=A:T.push([A-280+192,8]);break;default:n("invalid literal: "+A)}function B(t,e){this.length=t,this.N=e}m.prototype.h=function(){var t,e,r,h,f=this.input;switch(this.k){case 0:for(r=0,h=f.length;r>>8&255,b[w++]=255&l,b[w++]=l>>>8&255,s)b.set(p,w),w+=p.length,b=b.subarray(0,w);else{for(d=0,g=p.length;dK)for(;0K?K:138)>K-3&&Q=Q?(rt[J++]=17,rt[J++]=Q-3,nt[17]++):(rt[J++]=18,rt[J++]=Q-11,nt[18]++),K-=Q;else if(rt[J++]=et[q],nt[et[q]]++,3>--K)for(;0K?K:6)>K-3&&Qz;z++)W[z]=Y[V[z]];for(O=19;4=t:return[265,t-11,1];case 14>=t:return[266,t-13,1];case 16>=t:return[267,t-15,1];case 18>=t:return[268,t-17,1];case 22>=t:return[269,t-19,2];case 26>=t:return[270,t-23,2];case 30>=t:return[271,t-27,2];case 34>=t:return[272,t-31,2];case 42>=t:return[273,t-35,3];case 50>=t:return[274,t-43,3];case 58>=t:return[275,t-51,3];case 66>=t:return[276,t-59,3];case 82>=t:return[277,t-67,4];case 98>=t:return[278,t-83,4];case 114>=t:return[279,t-99,4];case 130>=t:return[280,t-115,4];case 162>=t:return[281,t-131,5];case 194>=t:return[282,t-163,5];case 226>=t:return[283,t-195,5];case 257>=t:return[284,t-227,5];case 258===t:return[285,t-258,0];default:n("invalid length: "+t)}}var e,r,i=[];for(e=3;258>=e;e++)r=t(e),i[e]=r[2]<<24|r[1]<<16|r[0];return i}(),U=s?new Uint32Array(R):R;function P(t,e){function r(t,e){var r,i,s,a,h=t.N,f=[],u=0;switch(r=U[t.length],f[u++]=65535&r,f[u++]=r>>16&255,f[u++]=r>>24,o){case 1===h:i=[0,h-1,0];break;case 2===h:i=[1,h-2,0];break;case 3===h:i=[2,h-3,0];break;case 4===h:i=[3,h-4,0];break;case 6>=h:i=[4,h-5,1];break;case 8>=h:i=[5,h-7,1];break;case 12>=h:i=[6,h-9,2];break;case 16>=h:i=[7,h-13,2];break;case 24>=h:i=[8,h-17,3];break;case 32>=h:i=[9,h-25,3];break;case 48>=h:i=[10,h-33,4];break;case 64>=h:i=[11,h-49,4];break;case 96>=h:i=[12,h-65,5];break;case 128>=h:i=[13,h-97,5];break;case 192>=h:i=[14,h-129,6];break;case 256>=h:i=[15,h-193,6];break;case 384>=h:i=[16,h-257,7];break;case 512>=h:i=[17,h-385,7];break;case 768>=h:i=[18,h-513,8];break;case 1024>=h:i=[19,h-769,8];break;case 1536>=h:i=[20,h-1025,9];break;case 2048>=h:i=[21,h-1537,9];break;case 3072>=h:i=[22,h-2049,10];break;case 4096>=h:i=[23,h-3073,10];break;case 6144>=h:i=[24,h-4097,11];break;case 8192>=h:i=[25,h-6145,11];break;case 12288>=h:i=[26,h-8193,12];break;case 16384>=h:i=[27,h-12289,12];break;case 24576>=h:i=[28,h-16385,13];break;case 32768>=h:i=[29,h-24577,13];break;default:n("invalid distance")}for(r=i,f[u++]=r[0],f[u++]=r[1],f[u++]=r[2],s=0,a=f.length;s=f;)m[f++]=0;for(f=0;29>=f;)A[f++]=0}for(m[256]=1,a=0,h=e.length;a=h){for(y&&r(y,-1),f=0,u=h-a;fo&&e+of&&(i=n,f=o),258===o)break}return new B(f,e-i)}function S(t,e){var r,n,i,o,a,h=t.length,f=new w(572),u=new(s?Uint8Array:Array)(h);if(!s)for(o=0;o2*u[o-1]+c[o]&&(u[o]=2*u[o-1]+c[o]),p[o]=Array(u[o]),y[o]=Array(u[o]);for(i=0;it[i]?(p[o][a]=h,y[o][a]=e,f+=2):(p[o][a]=t[i],y[o][a]=i,++i);d[o]=0,1===c[o]&&n(o)}return l}(n,n.length,e),o=0,a=r.length;o>>=1;return o}function k(t,e){this.input=t,this.b=this.c=0,this.g={},e&&(e.flags&&(this.g=e.flags),"string"==typeof e.filename&&(this.filename=e.filename),"string"==typeof e.comment&&(this.w=e.comment),e.deflateOptions&&(this.l=e.deflateOptions)),this.l||(this.l={})}k.prototype.h=function(){var t,e,r,n,o,a,h,f,u=new(s?Uint8Array:Array)(32768),c=0,l=this.input,p=this.c,d=this.filename,g=this.w;if(u[c++]=31,u[c++]=139,u[c++]=8,t=0,this.g.fname&&(t|=C),this.g.fcomment&&(t|=D),this.g.fhcrc&&(t|=L),u[c++]=t,e=(Date.now?Date.now():+new Date)/1e3|0,u[c++]=255&e,u[c++]=e>>>8&255,u[c++]=e>>>16&255,u[c++]=e>>>24&255,u[c++]=0,u[c++]=O,this.g.fname!==i){for(h=0,f=d.length;h>>8&255),u[c++]=255&a;u[c++]=0}if(this.g.comment){for(h=0,f=g.length;h>>8&255),u[c++]=255&a;u[c++]=0}return this.g.fhcrc&&(r=65535&y(u,0,c),u[c++]=255&r,u[c++]=r>>>8&255),this.l.outputBuffer=u,this.l.outputIndex=c,u=(o=new m(l,this.l)).h(),c=o.b,s&&(c+8>u.buffer.byteLength?(this.a=new Uint8Array(c+8),this.a.set(new Uint8Array(u.buffer)),u=this.a):u=new Uint8Array(u.buffer)),n=y(l,i,i),u[c++]=255&n,u[c++]=n>>>8&255,u[c++]=n>>>16&255,u[c++]=n>>>24&255,f=l.length,u[c++]=255&f,u[c++]=f>>>8&255,u[c++]=f>>>16&255,u[c++]=f>>>24&255,this.c=p,s&&c>>=1){case 0:var e=this.input,r=this.c,a=this.a,h=this.b,f=e.length,u=i,c=a.length,l=i;switch(this.e=this.j=0,r+1>=f&&n(Error("invalid uncompressed block header: LEN")),u=e[r++]|e[r++]<<8,r+1>=f&&n(Error("invalid uncompressed block header: NLEN")),u===~(e[r++]|e[r++]<<8)&&n(Error("invalid uncompressed block header: length verify")),r+u>e.length&&n(Error("input buffer is broken")),this.q){case Y:for(;h+u>a.length;){if(u-=l=c-h,s)a.set(e.subarray(r,r+l),h),h+=l,r+=l;else for(;l--;)a[h++]=e[r++];this.b=h,a=this.f(),h=this.b}break;case j:for(;h+u>a.length;)a=this.f({B:2});break;default:n(Error("invalid inflate mode"))}if(s)a.set(e.subarray(r,r+u),h),h+=u,r+=u;else for(;u--;)a[h++]=e[r++];this.c=r,this.b=h,this.a=a;break;case 1:this.r(et,nt);break;case 2:var p,y,d,g,b=it(this,5)+257,w=it(this,5)+1,m=it(this,4)+4,A=new(s?Uint8Array:Array)(G.length),_=i,E=i,T=i,B=i,R=i;for(R=0;R=N?8:255>=N?9:279>=N?7:8;var Z,tt,et=v(Q),rt=new(s?Uint8Array:Array)(30);for(Z=0,tt=rt.length;Z=h&&n(Error("input buffer is broken")),i|=s[a++]<>>e,t.e=o-e,t.c=a,r}function ot(t,e){for(var r,i,o=t.j,s=t.e,a=t.input,h=t.c,f=a.length,u=e[0],c=e[1];s=f);)o|=a[h++]<>>16)>s&&n(Error("invalid code length: "+i)),t.j=o>>i,t.e=s-i,t.c=h,65535&r}function st(t){this.input=t,this.c=0,this.G=[],this.R=!1}function at(t){if("string"==typeof t){var e,r,n=t.split("");for(e=0,r=n.length;e>>0;t=n}for(var i,o=1,s=0,a=t.length,h=0;0>>0}function ht(t,e){var r,i;switch(this.input=t,this.c=0,!e&&(e={})||(e.index&&(this.c=e.index),e.verify&&(this.V=e.verify)),r=t[this.c++],i=t[this.c++],15&r){case ft:this.method=ft;break;default:n(Error("unsupported compression method"))}0!=((r<<8)+i)%31&&n(Error("invalid fcheck flag:"+((r<<8)+i)%31)),32&i&&n(Error("fdict flag is not supported")),this.J=new M(t,{index:this.c,bufferSize:e.bufferSize,bufferType:e.bufferType,resize:e.resize})}M.prototype.r=function(t,e){var r=this.a,n=this.b;this.A=t;for(var i,o,s,a,h=r.length-258;256!==(i=ot(this,t));)if(256>i)n>=h&&(this.b=n,r=this.f(),n=this.b),r[n++]=i;else for(a=V[o=i-257],0=h&&(this.b=n,r=this.f(),n=this.b);a--;)r[n]=r[n++-s];for(;8<=this.e;)this.e-=8,this.c--;this.b=n},M.prototype.Q=function(t,e){var r=this.a,n=this.b;this.A=t;for(var i,o,s,a,h=r.length;256!==(i=ot(this,t));)if(256>i)n>=h&&(h=(r=this.f()).length),r[n++]=i;else for(a=V[o=i-257],0h&&(h=(r=this.f()).length);a--;)r[n]=r[n++-s];for(;8<=this.e;)this.e-=8,this.c--;this.b=n},M.prototype.f=function(){var t,e,r=new(s?Uint8Array:Array)(this.b-32768),n=this.b-32768,i=this.a;if(s)r.set(i.subarray(32768,r.length));else for(t=0,e=r.length;tt;++t)i[t]=i[n+t];return this.b=32768,i},M.prototype.S=function(t){var e,r,n,i=this.input.length/this.c+1|0,o=this.input,a=this.a;return t&&("number"==typeof t.B&&(i=t.B),"number"==typeof t.M&&(i+=t.M)),2>i?r=(n=(o.length-this.c)/this.A[2]/2*258|0)e&&(this.a.length=e),t=this.a),this.buffer=t},st.prototype.i=function(){for(var t=this.input.length;this.c>>0,y(e,i,i)!==d&&n(Error("invalid CRC-32 checksum: 0x"+y(e,i,i).toString(16)+" / 0x"+d.toString(16))),a.Z=h=(g[w++]|g[w++]<<8|g[w++]<<16|g[w++]<<24)>>>0,(4294967295&e.length)!==h&&n(Error("invalid input size: "+(4294967295&e.length)+" / "+h)),this.G.push(a),this.c=w}this.R=o;var v,m,A,_=this.G,E=0,T=0;for(v=0,m=_.length;v>>0!==at(t)&&n(Error("invalid adler-32 checksum"))),t};var ft=8;function ut(t,e){this.input=t,this.a=new(s?Uint8Array:Array)(32768),this.k=ct.t;var r,n={};for(r in!e&&(e={})||"number"!=typeof e.compressionType||(this.k=e.compressionType),e)n[r]=e[r];n.outputBuffer=this.a,this.I=new m(this.input,n)}var ct=E;function lt(t,e){var r;return r=new ut(t).h(),e||(e={}),e.H?r:gt(r)}function pt(t,e){var r;return t.subarray=t.slice,r=new ht(t).i(),e||(e={}),e.noBuffer?r:gt(r)}function yt(t,e){var r;return t.subarray=t.slice,r=new k(t).h(),e||(e={}),e.H?r:gt(r)}function dt(t,e){var r;return t.subarray=t.slice,r=new st(t).i(),e||(e={}),e.H?r:gt(r)}function gt(t){var e,n,i=new r(t.length);for(e=0,n=t.length;e>24&255,h[f++]=a>>16&255,h[f++]=a>>8&255,h[f++]=255&a,h},e.deflate=function(e,r,n){t.nextTick(function(){var t,i;try{i=lt(e,n)}catch(e){t=e}r(t,i)})},e.deflateSync=lt,e.inflate=function(e,r,n){t.nextTick(function(){var t,i;try{i=pt(e,n)}catch(e){t=e}r(t,i)})},e.inflateSync=pt,e.gzip=function(e,r,n){t.nextTick(function(){var t,i;try{i=yt(e,n)}catch(e){t=e}r(t,i)})},e.gzipSync=yt,e.gunzip=function(e,r,n){t.nextTick(function(){var t,i;try{i=dt(e,n)}catch(e){t=e}r(t,i)})},e.gunzipSync=dt}).call(this)}).call(this,r(9),r(10).Buffer)},function(t,e){var r,n,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(t){r=o}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(t){n=s}}();var h,f=[],u=!1,c=-1;function l(){u&&h&&(u=!1,h.length?f=h.concat(f):c=-1,f.length&&p())}function p(){if(!u){var t=a(l);u=!0;for(var e=f.length;e;){for(h=f,f=[];++c1)for(var r=1;r * @license MIT */ -var n=r(11),i=r(12),o=r(13);function s(){return h.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function y(t,e){if(h.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return N(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return F(t).length;default:if(n)return N(t).length;e=(""+e).toLowerCase(),n=!0}}function d(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function g(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=h.from(e,n)),h.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,i);if("number"==typeof e)return e&=255,h.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,n,i){var o,s=1,a=t.length,h=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,h/=2,r/=2}function f(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var u=-1;for(o=r;oa&&(r=a-h),o=r;o>=0;o--){for(var c=!0,l=0;li&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function T(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function B(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:f>223?3:f>191?2:1;if(i+c<=r)switch(c){case 1:f<128&&(u=f);break;case 2:128==(192&(o=t[i+1]))&&(h=(31&f)<<6|63&o)>127&&(u=h);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(h=(15&f)<<12|(63&o)<<6|63&s)>2047&&(h<55296||h>57343)&&(u=h);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(h=(15&f)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&h<1114112&&(u=h)}null===u?(u=65533,c=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),i+=c}return function(t){var e=t.length;if(e<=R)return String.fromCharCode.apply(String,t);var r="",n=0;for(;nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return I(this,e,r);case"utf8":case"utf-8":return B(this,e,r);case"ascii":return U(this,e,r);case"latin1":case"binary":return P(this,e,r);case"base64":return T(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},h.prototype.equals=function(t){if(!h.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===h.compare(this,t)},h.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},h.prototype.compare=function(t,e,r,n,i){if(!h.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s),f=this.slice(n,i),u=t.slice(e,r),c=0;ci)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return v(this,t,e,r);case"ascii":return m(this,t,e,r);case"latin1":case"binary":return A(this,t,e,r);case"base64":return _(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var R=4096;function U(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function k(t,e,r,n,i,o){if(!h.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function O(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i>>8*(n?i:1-i)}function L(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i>>8*(n?i:3-i)&255}function C(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(t,e,r,n,o){return o||C(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function M(t,e,r,n,o){return o||C(t,0,r,8),i.write(t,e,r,n,52,8),r+8}h.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e0&&(i*=256);)n+=this[t+--e]*i;return n},h.prototype.readUInt8=function(t,e){return e||x(t,1,this.length),this[t]},h.prototype.readUInt16LE=function(t,e){return e||x(t,2,this.length),this[t]|this[t+1]<<8},h.prototype.readUInt16BE=function(t,e){return e||x(t,2,this.length),this[t]<<8|this[t+1]},h.prototype.readUInt32LE=function(t,e){return e||x(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},h.prototype.readUInt32BE=function(t,e){return e||x(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},h.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||x(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},h.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||x(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},h.prototype.readInt8=function(t,e){return e||x(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},h.prototype.readInt16LE=function(t,e){e||x(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},h.prototype.readInt16BE=function(t,e){e||x(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},h.prototype.readInt32LE=function(t,e){return e||x(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},h.prototype.readInt32BE=function(t,e){return e||x(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},h.prototype.readFloatLE=function(t,e){return e||x(t,4,this.length),i.read(this,t,!0,23,4)},h.prototype.readFloatBE=function(t,e){return e||x(t,4,this.length),i.read(this,t,!1,23,4)},h.prototype.readDoubleLE=function(t,e){return e||x(t,8,this.length),i.read(this,t,!0,52,8)},h.prototype.readDoubleBE=function(t,e){return e||x(t,8,this.length),i.read(this,t,!1,52,8)},h.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||k(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+i]=t/o&255;return e+r},h.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||k(this,t,e,1,255,0),h.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},h.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||k(this,t,e,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):O(this,t,e,!0),e+2},h.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||k(this,t,e,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):O(this,t,e,!1),e+2},h.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||k(this,t,e,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):L(this,t,e,!0),e+4},h.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||k(this,t,e,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):L(this,t,e,!1),e+4},h.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);k(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+r},h.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);k(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},h.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||k(this,t,e,1,127,-128),h.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},h.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||k(this,t,e,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):O(this,t,e,!0),e+2},h.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||k(this,t,e,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):O(this,t,e,!1),e+2},h.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||k(this,t,e,4,2147483647,-2147483648),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):L(this,t,e,!0),e+4},h.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||k(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):L(this,t,e,!1),e+4},h.prototype.writeFloatLE=function(t,e,r){return D(this,t,e,!0,r)},h.prototype.writeFloatBE=function(t,e,r){return D(this,t,e,!1,r)},h.prototype.writeDoubleLE=function(t,e,r){return M(this,t,e,!0,r)},h.prototype.writeDoubleBE=function(t,e,r){return M(this,t,e,!1,r)},h.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(o<1e3||!h.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function F(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(Y,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function z(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}}).call(this,r(0))},function(t,e,r){"use strict";e.byteLength=function(t){return 3*t.length/4-f(t)},e.toByteArray=function(t){var e,r,n,s,a,h=t.length;s=f(t),a=new o(3*h/4-s),r=s>0?h-4:h;var u=0;for(e=0;e>16&255,a[u++]=n>>8&255,a[u++]=255&n;2===s?(n=i[t.charCodeAt(e)]<<2|i[t.charCodeAt(e+1)]>>4,a[u++]=255&n):1===s&&(n=i[t.charCodeAt(e)]<<10|i[t.charCodeAt(e+1)]<<4|i[t.charCodeAt(e+2)]>>2,a[u++]=n>>8&255,a[u++]=255&n);return a},e.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o="",s=[],a=0,h=r-i;ah?h:a+16383));1===i?(e=t[r-1],o+=n[e>>2],o+=n[e<<4&63],o+="=="):2===i&&(e=(t[r-2]<<8)+t[r-1],o+=n[e>>10],o+=n[e>>4&63],o+=n[e<<2&63],o+="=");return s.push(o),s.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,h=s.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function u(t,e,r){for(var i,o,s=[],a=e;a>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,h=(1<>1,u=-7,c=r?i-1:0,l=r?-1:1,p=t[e+c];for(c+=l,o=p&(1<<-u)-1,p>>=-u,u+=a;u>0;o=256*o+t[e+c],c+=l,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=n;u>0;s=256*s+t[e+c],c+=l,u-=8);if(0===o)o=1-f;else{if(o===h)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=f}return(p?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,h,f=8*o-i-1,u=(1<>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,y=n?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-s))<1&&(s--,h*=2),(e+=s+c>=1?l/h:l*Math.pow(2,1-c))*h>=2&&(s++,h/=2),s+c>=u?(a=0,s=u):s+c>=1?(a=(e*h-1)*Math.pow(2,i),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&a,p+=y,a/=256,i-=8);for(s=s<0;t[r+p]=255&s,p+=y,s/=256,f-=8);t[r+p-y]|=128*d}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){const{set:n,get:i}=r(15);t.exports={readCache:i,writeCache:n}},function(t,e,r){"use strict";r.r(e),r.d(e,"Store",function(){return n}),r.d(e,"get",function(){return s}),r.d(e,"set",function(){return a}),r.d(e,"del",function(){return h}),r.d(e,"clear",function(){return f}),r.d(e,"keys",function(){return u});class n{constructor(t="keyval-store",e="keyval"){this.storeName=e,this._dbp=new Promise((r,n)=>{const i=indexedDB.open(t,1);i.onerror=(()=>n(i.error)),i.onsuccess=(()=>r(i.result)),i.onupgradeneeded=(()=>{i.result.createObjectStore(e)})})}_withIDBStore(t,e){return this._dbp.then(r=>new Promise((n,i)=>{const o=r.transaction(this.storeName,t);o.oncomplete=(()=>n()),o.onabort=o.onerror=(()=>i(o.error)),e(o.objectStore(this.storeName))}))}}let i;function o(){return i||(i=new n),i}function s(t,e=o()){let r;return e._withIDBStore("readonly",e=>{r=e.get(t)}).then(()=>r.result)}function a(t,e,r=o()){return r._withIDBStore("readwrite",r=>{r.put(e,t)})}function h(t,e=o()){return e._withIDBStore("readwrite",e=>{e.delete(t)})}function f(t=o()){return t._withIDBStore("readwrite",t=>{t.clear()})}function u(t=o()){const e=[];return t._withIDBStore("readonly",t=>{(t.openKeyCursor||t.openCursor).call(t).onsuccess=function(){this.result&&(e.push(this.result.key),this.result.continue())}}).then(()=>e)}},function(t,e){t.exports=((t,e)=>{const r=t._malloc(e.length*Uint8Array.BYTES_PER_ELEMENT);t.HEAPU8.set(e,r);const n=t._pixReadMem(r,e.length);0===t.getValue(n+28,"i32")&&t.setValue(n+28,70,"i32");const[i,o,s,a,h,f,u,c,l,p]=Array(10).fill(0).map((e,r)=>t.getValue(n+4*r,"i32"));return{w:i,h:o,d:s,spp:a,wpl:h,refcount:f,xres:u,yres:c,informat:l,special:p,data:n}})},function(t,e){t.exports=((t,e)=>{const r=e.GetIterator(),n=[];let i,o,s,a,h;const f=(e,r)=>Object.keys(t).filter(t=>t.substr(0,r.length+1)===`${r}_`).filter(r=>t[r]===e).map(t=>t.slice(r.length+1))[0];r.Begin();do{if(r.IsAtBeginningOf(t.RIL_BLOCK)){const e=r.BlockPolygon();let o=null;if(t.getPointer(e)>0){const r=e.get_n(),n=e.get_x(),i=e.get_y();o=[];for(let t=0;t{const e=t.split("\n");if(" "===e[0].substring(0,2))for(let t=0;t=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function d(t,e){if(h.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return Y(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return N(t).length;default:if(i)return Y(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function m(t,e,r,i,n){if(0===t.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof e&&(e=h.from(e,i)),h.isBuffer(e))return 0===e.length?-1:y(t,e,r,i,n);if("number"==typeof e)return e&=255,h.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):y(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function y(t,e,r,i,n){var s,o=1,a=t.length,h=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;o=2,a/=2,h/=2,r/=2}function f(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(n){var u=-1;for(s=r;sa&&(r=a-h),s=r;s>=0;s--){for(var c=!0,p=0;pn&&(i=n):i=n;var s=e.length;if(s%2!=0)throw new TypeError("Invalid hex string");i>s/2&&(i=s/2);for(var o=0;o>8,n=r%256,s.push(n),s.push(i);return s}(e,t.length-r),t,r,i)}function E(t,e,r){return 0===e&&r===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,r))}function U(t,e,r){r=Math.min(t.length,r);for(var i=[],n=e;n239?4:f>223?3:f>191?2:1;if(n+c<=r)switch(c){case 1:f<128&&(u=f);break;case 2:128==(192&(s=t[n+1]))&&(h=(31&f)<<6|63&s)>127&&(u=h);break;case 3:s=t[n+1],o=t[n+2],128==(192&s)&&128==(192&o)&&(h=(15&f)<<12|(63&s)<<6|63&o)>2047&&(h<55296||h>57343)&&(u=h);break;case 4:s=t[n+1],o=t[n+2],a=t[n+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&(h=(15&f)<<18|(63&s)<<12|(63&o)<<6|63&a)>65535&&h<1114112&&(u=h)}null===u?(u=65533,c=1):u>65535&&(u-=65536,i.push(u>>>10&1023|55296),u=56320|1023&u),i.push(u),n+=c}return function(t){var e=t.length;if(e<=I)return String.fromCharCode.apply(String,t);var r="",i=0;for(;ithis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,r);case"utf8":case"utf-8":return U(this,e,r);case"ascii":return T(this,e,r);case"latin1":case"binary":return B(this,e,r);case"base64":return E(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}.apply(this,arguments)},h.prototype.equals=function(t){if(!h.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===h.compare(this,t)},h.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},h.prototype.compare=function(t,e,r,i,n){if(!h.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return-1;if(e>=r)return 1;if(this===t)return 0;for(var s=(n>>>=0)-(i>>>=0),o=(r>>>=0)-(e>>>=0),a=Math.min(s,o),f=this.slice(i,n),u=t.slice(e,r),c=0;cn)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return b(this,t,e,r);case"utf8":case"utf-8":return w(this,t,e,r);case"ascii":return v(this,t,e,r);case"latin1":case"binary":return x(this,t,e,r);case"base64":return A(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,t,e,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var I=4096;function T(t,e,r){var i="";r=Math.min(t.length,r);for(var n=e;ni)&&(r=i);for(var n="",s=e;sr)throw new RangeError("Trying to access beyond buffer length")}function S(t,e,r,i,n,s){if(!h.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||et.length)throw new RangeError("Index out of range")}function L(t,e,r,i){e<0&&(e=65535+e+1);for(var n=0,s=Math.min(t.length-r,2);n>>8*(i?n:1-n)}function O(t,e,r,i){e<0&&(e=4294967295+e+1);for(var n=0,s=Math.min(t.length-r,4);n>>8*(i?n:3-n)&255}function C(t,e,r,i,n,s){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(t,e,r,i,s){return s||C(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function D(t,e,r,i,s){return s||C(t,0,r,8),n.write(t,e,r,i,52,8),r+8}h.prototype.slice=function(t,e){var r,i=this.length;if((t=~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),(e=void 0===e?i:~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),e0&&(n*=256);)i+=this[t+--e]*n;return i},h.prototype.readUInt8=function(t,e){return e||k(t,1,this.length),this[t]},h.prototype.readUInt16LE=function(t,e){return e||k(t,2,this.length),this[t]|this[t+1]<<8},h.prototype.readUInt16BE=function(t,e){return e||k(t,2,this.length),this[t]<<8|this[t+1]},h.prototype.readUInt32LE=function(t,e){return e||k(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},h.prototype.readUInt32BE=function(t,e){return e||k(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},h.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||k(t,e,this.length);for(var i=this[t],n=1,s=0;++s=(n*=128)&&(i-=Math.pow(2,8*e)),i},h.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||k(t,e,this.length);for(var i=e,n=1,s=this[t+--i];i>0&&(n*=256);)s+=this[t+--i]*n;return s>=(n*=128)&&(s-=Math.pow(2,8*e)),s},h.prototype.readInt8=function(t,e){return e||k(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},h.prototype.readInt16LE=function(t,e){e||k(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},h.prototype.readInt16BE=function(t,e){e||k(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},h.prototype.readInt32LE=function(t,e){return e||k(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},h.prototype.readInt32BE=function(t,e){return e||k(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},h.prototype.readFloatLE=function(t,e){return e||k(t,4,this.length),n.read(this,t,!0,23,4)},h.prototype.readFloatBE=function(t,e){return e||k(t,4,this.length),n.read(this,t,!1,23,4)},h.prototype.readDoubleLE=function(t,e){return e||k(t,8,this.length),n.read(this,t,!0,52,8)},h.prototype.readDoubleBE=function(t,e){return e||k(t,8,this.length),n.read(this,t,!1,52,8)},h.prototype.writeUIntLE=function(t,e,r,i){(t=+t,e|=0,r|=0,i)||S(this,t,e,r,Math.pow(2,8*r)-1,0);var n=1,s=0;for(this[e]=255&t;++s=0&&(s*=256);)this[e+n]=t/s&255;return e+r},h.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||S(this,t,e,1,255,0),h.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},h.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||S(this,t,e,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):L(this,t,e,!0),e+2},h.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||S(this,t,e,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):L(this,t,e,!1),e+2},h.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||S(this,t,e,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):O(this,t,e,!0),e+4},h.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||S(this,t,e,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):O(this,t,e,!1),e+4},h.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e|=0,!i){var n=Math.pow(2,8*r-1);S(this,t,e,r,n-1,-n)}var s=0,o=1,a=0;for(this[e]=255&t;++s>0)-a&255;return e+r},h.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e|=0,!i){var n=Math.pow(2,8*r-1);S(this,t,e,r,n-1,-n)}var s=r-1,o=1,a=0;for(this[e+s]=255&t;--s>=0&&(o*=256);)t<0&&0===a&&0!==this[e+s+1]&&(a=1),this[e+s]=(t/o>>0)-a&255;return e+r},h.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||S(this,t,e,1,127,-128),h.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},h.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||S(this,t,e,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):L(this,t,e,!0),e+2},h.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||S(this,t,e,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):L(this,t,e,!1),e+2},h.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||S(this,t,e,4,2147483647,-2147483648),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):O(this,t,e,!0),e+4},h.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||S(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):O(this,t,e,!1),e+4},h.prototype.writeFloatLE=function(t,e,r){return M(this,t,e,!0,r)},h.prototype.writeFloatBE=function(t,e,r){return M(this,t,e,!1,r)},h.prototype.writeDoubleLE=function(t,e,r){return D(this,t,e,!0,r)},h.prototype.writeDoubleBE=function(t,e,r){return D(this,t,e,!1,r)},h.prototype.copy=function(t,e,r,i){if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e=0;--n)t[n+e]=this[n+r];else if(s<1e3||!h.TYPED_ARRAY_SUPPORT)for(n=0;n>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(s=e;s55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(o+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function N(t){return i.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(j,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function F(t,e,r,i){for(var n=0;n=e.length||n>=t.length);++n)e[n+r]=t[n];return n}}).call(this,r(1))},function(t,e){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){(function(t){const e=r(3);t.addEventListener("message",({data:t})=>{e.dispatchHandlers(t,t=>postMessage(t))}),e.setAdapter({getCore:(e,r)=>(t.TesseractCore||(r.progress({status:"loading tesseract core",progress:0}),t.importScripts(e.workerOptions.corePath),t.TesseractCore="object"==typeof WebAssembly?t.TesseractCoreWASM:t.TesseractCoreASM,r.progress({status:"loading tesseract core",progress:1})),t.TesseractCore)})}).call(this,r(1))},function(t,e,r){const{readImage:i,loadLang:n}=r(4),s=r(21);let o,a,h,f={};const u=t=>{const{w:e,h:r,bytesPerPixel:n,data:s,pix:h}=i(o,Array.from(t));return null===s?a.SetImage(h):a.SetImage(s,e,r,n,e*n),a.SetRectangle(0,0,e,r),s},c=(t,e)=>{let r=100663296;if(["chi_sim","chi_tra","jpn"].includes(t.options.lang)&&(r=167772160),!o||o.TOTAL_MEMORY{a=new(o=t).TessBaseAPI,e.progress({status:"initialized tesseract",progress:1})})}return Promise.resolve()},p=t=>{const{options:{lang:e},workerOptions:{langPath:r}}=t;return n({langs:e,tessModule:o,langURI:r})};e.dispatchHandlers=((t,e)=>{const r=(r,i)=>{e({jobId:t.jobId,status:r,action:t.action,data:i})};r.resolve=r.bind(this,"resolve"),r.reject=r.bind(this,"reject"),r.progress=r.bind(this,"progress"),h=r;try{"recognize"===t.action?((t,e)=>c(t,e).then(()=>p(t).then(()=>{const{options:r}=t,i=t=>{e.progress({status:"initializing api",progress:t})};i(0),a.Init(null,r.lang),i(.3),Object.keys(r).forEach(t=>{a.SetVariable(t,r[t])}),i(.6);const n=u(t.image);i(1),a.Recognize(null);const h=s(o,a);a.End(),o._free(n),e.resolve(h)})))(t.payload,r):"detect"===t.action&&((t,e)=>c(t,e).then(()=>p({...t,options:{...t.options,lang:"osd"}}).then(()=>{a.Init(null,"osd"),a.SetPageSegMode(o.PSM_OSD_ONLY);const r=u(t.image),i=new o.OSResults;if(a.DetectOS(i)){const t=i.get_best_result(),n=t.get_orientation_id(),s=t.get_script_id();a.End(),o._free(r),e.resolve({tesseract_script_id:s,script:i.get_unicharset().get_script_from_script_id(s),script_confidence:t.get_sconfidence(),orientation_degrees:[0,270,180,90][n],orientation_confidence:t.get_oconfidence()})}else a.End(),o._free(r),e.reject("Failed to detect OS")})))(t.payload,r)}catch(t){r.reject(t.toString())}}),e.setAdapter=(t=>{f=t})},function(t,e,r){const i=r(5);t.exports={loadLang:r(7)({fetch:r(8),gunzip:r(10),...i}),readImage:r(16),cache:i}},function(t,e,r){const{set:i,get:n,del:s}=r(6);t.exports={readCache:n,writeCache:i,deleteCache:s,checkCache:t=>n(t).then(t=>void 0!==t)}},function(t,e,r){"use strict";r.r(e),r.d(e,"Store",function(){return i}),r.d(e,"get",function(){return o}),r.d(e,"set",function(){return a}),r.d(e,"del",function(){return h}),r.d(e,"clear",function(){return f}),r.d(e,"keys",function(){return u});class i{constructor(t="keyval-store",e="keyval"){this.storeName=e,this._dbp=new Promise((r,i)=>{const n=indexedDB.open(t,1);n.onerror=(()=>i(n.error)),n.onsuccess=(()=>r(n.result)),n.onupgradeneeded=(()=>{n.result.createObjectStore(e)})})}_withIDBStore(t,e){return this._dbp.then(r=>new Promise((i,n)=>{const s=r.transaction(this.storeName,t);s.oncomplete=(()=>i()),s.onabort=s.onerror=(()=>n(s.error)),e(s.objectStore(this.storeName))}))}}let n;function s(){return n||(n=new i),n}function o(t,e=s()){let r;return e._withIDBStore("readonly",e=>{r=e.get(t)}).then(()=>r.result)}function a(t,e,r=s()){return r._withIDBStore("readwrite",r=>{r.put(e,t)})}function h(t,e=s()){return e._withIDBStore("readwrite",e=>{e.delete(t)})}function f(t=s()){return t._withIDBStore("readwrite",t=>{t.clear()})}function u(t=s()){const e=[];return t._withIDBStore("readonly",t=>{(t.openKeyCursor||t.openCursor).call(t).onsuccess=function(){this.result&&(e.push(this.result.key),this.result.continue())}}).then(()=>e)}},function(t,e){const r=t=>({tessModule:e,dataPath:r,cachePath:i,cacheMethod:n,lang:s})=>o=>{if(e){if(r)try{e.FS.mkdir(r)}catch(t){}e.FS.writeFile(`${r||"."}/${s}.traineddata`,o)}return["write","refresh",void 0].includes(n)?t.writeCache(`${i||"."}/${s}.traineddata`,o).then(()=>o):o};t.exports=(t=>({langs:e,...i})=>Promise.all(e.split("+").map((t=>({langURI:e,cachePath:i,cacheMethod:n,...s})=>o=>{let{readCache:a}=t;return["refresh","none"].includes(n)&&(a=(()=>Promise.resolve())),a(`${i||"."}/${o}.traineddata`).then(e=>void 0===e?Promise.reject():r(t)({cachePath:i,cacheMethod:n,lang:o,...s})(e)).catch(()=>t.fetch(`${e}/${o}.traineddata.gz`).then(t=>t.arrayBuffer()).then(e=>t.gunzip(new Uint8Array(e))).then(r(t)({cachePath:i,cacheMethod:n,lang:o,...s})))})(t)(i))))},function(t,e,r){const{fetch:i}=r(9);t.exports=i},function(t,e,r){"use strict";r.r(e),r.d(e,"Headers",function(){return f}),r.d(e,"Request",function(){return m}),r.d(e,"Response",function(){return b}),r.d(e,"DOMException",function(){return v}),r.d(e,"fetch",function(){return x});var i={searchParams:"URLSearchParams"in self,iterable:"Symbol"in self&&"iterator"in Symbol,blob:"FileReader"in self&&"Blob"in self&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in self,arrayBuffer:"ArrayBuffer"in self};if(i.arrayBuffer)var n=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],s=ArrayBuffer.isView||function(t){return t&&n.indexOf(Object.prototype.toString.call(t))>-1};function o(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function a(t){return"string"!=typeof t&&(t=String(t)),t}function h(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return i.iterable&&(e[Symbol.iterator]=function(){return e}),e}function f(t){this.map={},t instanceof f?t.forEach(function(t,e){this.append(e,t)},this):Array.isArray(t)?t.forEach(function(t){this.append(t[0],t[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function u(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function c(t){return new Promise(function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}})}function p(t){var e=new FileReader,r=c(e);return e.readAsArrayBuffer(t),r}function l(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function d(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:i.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:i.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:i.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():i.arrayBuffer&&i.blob&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=l(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):i.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||s(t))?this._bodyArrayBuffer=l(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):i.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i.blob&&(this.blob=function(){var t=u(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?u(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(p)}),this.text=function(){var t,e,r,i=u(this);if(i)return i;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,r=c(e),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),i=0;i-1?i:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function y(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var r=t.split("="),i=r.shift().replace(/\+/g," "),n=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(i),decodeURIComponent(n))}}),e}function b(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new f(e.headers),this.url=e.url||"",this._initBody(t)}m.prototype.clone=function(){return new m(this,{body:this._bodyInit})},d.call(m.prototype),d.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},b.error=function(){var t=new b(null,{status:0,statusText:""});return t.type="error",t};var w=[301,302,303,307,308];b.redirect=function(t,e){if(-1===w.indexOf(e))throw new RangeError("Invalid status code");return new b(null,{status:e,headers:{location:t}})};var v=self.DOMException;try{new v}catch(t){(v=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack}).prototype=Object.create(Error.prototype),v.prototype.constructor=v}function x(t,e){return new Promise(function(r,n){var s=new m(t,e);if(s.signal&&s.signal.aborted)return n(new v("Aborted","AbortError"));var o=new XMLHttpRequest;function a(){o.abort()}o.onload=function(){var t,e,i={status:o.status,statusText:o.statusText,headers:(t=o.getAllResponseHeaders()||"",e=new f,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(t){var r=t.split(":"),i=r.shift().trim();if(i){var n=r.join(":").trim();e.append(i,n)}}),e)};i.url="responseURL"in o?o.responseURL:i.headers.get("X-Request-URL");var n="response"in o?o.response:o.responseText;r(new b(n,i))},o.onerror=function(){n(new TypeError("Network request failed"))},o.ontimeout=function(){n(new TypeError("Network request failed"))},o.onabort=function(){n(new v("Aborted","AbortError"))},o.open(s.method,s.url,!0),"include"===s.credentials?o.withCredentials=!0:"omit"===s.credentials&&(o.withCredentials=!1),"responseType"in o&&i.blob&&(o.responseType="blob"),s.headers.forEach(function(t,e){o.setRequestHeader(e,t)}),s.signal&&(s.signal.addEventListener("abort",a),o.onreadystatechange=function(){4===o.readyState&&s.signal.removeEventListener("abort",a)}),o.send(void 0===s._bodyInit?null:s._bodyInit)})}x.polyfill=!0,self.fetch||(self.fetch=x,self.Headers=f,self.Request=m,self.Response=b)},function(t,e,r){t.exports=r(11).gunzipSync},function(t,e,r){(function(t,r){/** @license zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License */(function(){"use strict";function i(t){throw t}var n=void 0,s=!0,o="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array&&"undefined"!=typeof DataView;function a(t,e){this.index="number"==typeof e?e:0,this.m=0,this.buffer=t instanceof(o?Uint8Array:Array)?t:new(o?Uint8Array:Array)(32768),2*this.buffer.length<=this.index&&i(Error("invalid index")),this.buffer.length<=this.index&&this.f()}a.prototype.f=function(){var t,e=this.buffer,r=e.length,i=new(o?Uint8Array:Array)(r<<1);if(o)i.set(e);else for(t=0;t>>8&255]<<16|l[t>>>16&255]<<8|l[t>>>24&255])>>32-e:l[t]>>8-e),8>e+o)a=a<>e-i-1&1,8==++o&&(o=0,n[s++]=l[a],a=0,s===n.length&&(n=this.f()));n[s]=a,this.buffer=n,this.m=o,this.index=s},a.prototype.finish=function(){var t,e=this.buffer,r=this.index;return 0h;++h){for(var u=p=h,c=7,p=p>>>1;p;p>>>=1)u<<=1,u|=1&p,--c;f[h]=(u<>>0}var l=f;function d(t,e,r){var i,n="number"==typeof e?e:e=0,s="number"==typeof r?r:t.length;for(i=-1,n=7&s;n--;++e)i=i>>>8^m[255&(i^t[e])];for(n=s>>3;n--;e+=8)i=(i=(i=(i=(i=(i=(i=(i=i>>>8^m[255&(i^t[e])])>>>8^m[255&(i^t[e+1])])>>>8^m[255&(i^t[e+2])])>>>8^m[255&(i^t[e+3])])>>>8^m[255&(i^t[e+4])])>>>8^m[255&(i^t[e+5])])>>>8^m[255&(i^t[e+6])])>>>8^m[255&(i^t[e+7])];return(4294967295^i)>>>0}var g=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],m=o?new Uint32Array(g):g;function y(){}function b(t){this.buffer=new(o?Uint16Array:Array)(2*t),this.length=0}function w(t){var e,r,i,n,s,a,h,f,u,c,p=t.length,l=0,d=Number.POSITIVE_INFINITY;for(f=0;fl&&(l=t[f]),t[f]>=1;for(c=i<<16|f,u=a;us[i]);)n=s[r],s[r]=s[i],s[i]=n,n=s[r+1],s[r+1]=s[i+1],s[i+1]=n,r=i;return this.length},b.prototype.pop=function(){var t,e,r,i,n,s=this.buffer;for(e=s[0],t=s[1],this.length-=2,s[0]=s[this.length],s[1]=s[this.length+1],n=0;!((i=2*n+2)>=this.length)&&(i+2s[i]&&(i+=2),s[i]>s[n]);)r=s[n],s[n]=s[i],s[i]=r,r=s[n+1],s[n+1]=s[i+1],s[i+1]=r,n=i;return{index:t,value:e,length:this.length}};var x,A=2,_={NONE:0,L:1,t:A,X:3},E=[];for(x=0;288>x;x++)switch(s){case 143>=x:E.push([x+48,8]);break;case 255>=x:E.push([x-144+400,9]);break;case 279>=x:E.push([x-256+0,7]);break;case 287>=x:E.push([x-280+192,8]);break;default:i("invalid literal: "+x)}function U(t,e){this.length=t,this.N=e}v.prototype.h=function(){var t,e,r,h,f=this.input;switch(this.k){case 0:for(r=0,h=f.length;r>>8&255,y[b++]=255&p,y[b++]=p>>>8&255,o)y.set(l,b),b+=l.length,y=y.subarray(0,b);else{for(g=0,m=l.length;gK)for(;0K?K:138)>K-3&&Z=Z?(rt[J++]=17,rt[J++]=Z-3,it[17]++):(rt[J++]=18,rt[J++]=Z-11,it[18]++),K-=Z;else if(rt[J++]=et[W],it[et[W]]++,3>--K)for(;0K?K:6)>K-3&&ZF;F++)V[F]=j[H[F]];for(L=19;4=t:return[265,t-11,1];case 14>=t:return[266,t-13,1];case 16>=t:return[267,t-15,1];case 18>=t:return[268,t-17,1];case 22>=t:return[269,t-19,2];case 26>=t:return[270,t-23,2];case 30>=t:return[271,t-27,2];case 34>=t:return[272,t-31,2];case 42>=t:return[273,t-35,3];case 50>=t:return[274,t-43,3];case 58>=t:return[275,t-51,3];case 66>=t:return[276,t-59,3];case 82>=t:return[277,t-67,4];case 98>=t:return[278,t-83,4];case 114>=t:return[279,t-99,4];case 130>=t:return[280,t-115,4];case 162>=t:return[281,t-131,5];case 194>=t:return[282,t-163,5];case 226>=t:return[283,t-195,5];case 257>=t:return[284,t-227,5];case 258===t:return[285,t-258,0];default:i("invalid length: "+t)}}var e,r,n=[];for(e=3;258>=e;e++)r=t(e),n[e]=r[2]<<24|r[1]<<16|r[0];return n}(),T=o?new Uint32Array(I):I;function B(t,e){function r(t,e){var r,n,o,a,h=t.N,f=[],u=0;switch(r=T[t.length],f[u++]=65535&r,f[u++]=r>>16&255,f[u++]=r>>24,s){case 1===h:n=[0,h-1,0];break;case 2===h:n=[1,h-2,0];break;case 3===h:n=[2,h-3,0];break;case 4===h:n=[3,h-4,0];break;case 6>=h:n=[4,h-5,1];break;case 8>=h:n=[5,h-7,1];break;case 12>=h:n=[6,h-9,2];break;case 16>=h:n=[7,h-13,2];break;case 24>=h:n=[8,h-17,3];break;case 32>=h:n=[9,h-25,3];break;case 48>=h:n=[10,h-33,4];break;case 64>=h:n=[11,h-49,4];break;case 96>=h:n=[12,h-65,5];break;case 128>=h:n=[13,h-97,5];break;case 192>=h:n=[14,h-129,6];break;case 256>=h:n=[15,h-193,6];break;case 384>=h:n=[16,h-257,7];break;case 512>=h:n=[17,h-385,7];break;case 768>=h:n=[18,h-513,8];break;case 1024>=h:n=[19,h-769,8];break;case 1536>=h:n=[20,h-1025,9];break;case 2048>=h:n=[21,h-1537,9];break;case 3072>=h:n=[22,h-2049,10];break;case 4096>=h:n=[23,h-3073,10];break;case 6144>=h:n=[24,h-4097,11];break;case 8192>=h:n=[25,h-6145,11];break;case 12288>=h:n=[26,h-8193,12];break;case 16384>=h:n=[27,h-12289,12];break;case 24576>=h:n=[28,h-16385,13];break;case 32768>=h:n=[29,h-24577,13];break;default:i("invalid distance")}for(r=n,f[u++]=r[0],f[u++]=r[1],f[u++]=r[2],o=0,a=f.length;o=f;)v[f++]=0;for(f=0;29>=f;)x[f++]=0}for(v[256]=1,a=0,h=e.length;a=h){for(d&&r(d,-1),f=0,u=h-a;fs&&e+sf&&(n=i,f=s),258===s)break}return new U(f,e-n)}function P(t,e){var r,i,n,s,a,h=t.length,f=new b(572),u=new(o?Uint8Array:Array)(h);if(!o)for(s=0;s2*u[s-1]+c[s]&&(u[s]=2*u[s-1]+c[s]),l[s]=Array(u[s]),d[s]=Array(u[s]);for(n=0;nt[n]?(l[s][a]=h,d[s][a]=e,f+=2):(l[s][a]=t[n],d[s][a]=n,++n);g[s]=0,1===c[s]&&i(s)}return p}(i,i.length,e),s=0,a=r.length;s>>=1;return s}function S(t,e){this.input=t,this.b=this.c=0,this.g={},e&&(e.flags&&(this.g=e.flags),"string"==typeof e.filename&&(this.filename=e.filename),"string"==typeof e.comment&&(this.w=e.comment),e.deflateOptions&&(this.l=e.deflateOptions)),this.l||(this.l={})}S.prototype.h=function(){var t,e,r,i,s,a,h,f,u=new(o?Uint8Array:Array)(32768),c=0,p=this.input,l=this.c,g=this.filename,m=this.w;if(u[c++]=31,u[c++]=139,u[c++]=8,t=0,this.g.fname&&(t|=C),this.g.fcomment&&(t|=M),this.g.fhcrc&&(t|=O),u[c++]=t,e=(Date.now?Date.now():+new Date)/1e3|0,u[c++]=255&e,u[c++]=e>>>8&255,u[c++]=e>>>16&255,u[c++]=e>>>24&255,u[c++]=0,u[c++]=L,this.g.fname!==n){for(h=0,f=g.length;h>>8&255),u[c++]=255&a;u[c++]=0}if(this.g.comment){for(h=0,f=m.length;h>>8&255),u[c++]=255&a;u[c++]=0}return this.g.fhcrc&&(r=65535&d(u,0,c),u[c++]=255&r,u[c++]=r>>>8&255),this.l.outputBuffer=u,this.l.outputIndex=c,u=(s=new v(p,this.l)).h(),c=s.b,o&&(c+8>u.buffer.byteLength?(this.a=new Uint8Array(c+8),this.a.set(new Uint8Array(u.buffer)),u=this.a):u=new Uint8Array(u.buffer)),i=d(p,n,n),u[c++]=255&i,u[c++]=i>>>8&255,u[c++]=i>>>16&255,u[c++]=i>>>24&255,f=p.length,u[c++]=255&f,u[c++]=f>>>8&255,u[c++]=f>>>16&255,u[c++]=f>>>24&255,this.c=l,o&&c>>=1){case 0:var e=this.input,r=this.c,a=this.a,h=this.b,f=e.length,u=n,c=a.length,p=n;switch(this.e=this.j=0,r+1>=f&&i(Error("invalid uncompressed block header: LEN")),u=e[r++]|e[r++]<<8,r+1>=f&&i(Error("invalid uncompressed block header: NLEN")),u===~(e[r++]|e[r++]<<8)&&i(Error("invalid uncompressed block header: length verify")),r+u>e.length&&i(Error("input buffer is broken")),this.q){case j:for(;h+u>a.length;){if(u-=p=c-h,o)a.set(e.subarray(r,r+p),h),h+=p,r+=p;else for(;p--;)a[h++]=e[r++];this.b=h,a=this.f(),h=this.b}break;case z:for(;h+u>a.length;)a=this.f({B:2});break;default:i(Error("invalid inflate mode"))}if(o)a.set(e.subarray(r,r+u),h),h+=u,r+=u;else for(;u--;)a[h++]=e[r++];this.c=r,this.b=h,this.a=a;break;case 1:this.r(et,it);break;case 2:var l,d,g,m,y=nt(this,5)+257,b=nt(this,5)+1,v=nt(this,4)+4,x=new(o?Uint8Array:Array)(G.length),A=n,_=n,E=n,U=n,I=n;for(I=0;I=Y?8:255>=Y?9:279>=Y?7:8;var Q,tt,et=w(Z),rt=new(o?Uint8Array:Array)(30);for(Q=0,tt=rt.length;Q=h&&i(Error("input buffer is broken")),n|=o[a++]<>>e,t.e=s-e,t.c=a,r}function st(t,e){for(var r,n,s=t.j,o=t.e,a=t.input,h=t.c,f=a.length,u=e[0],c=e[1];o=f);)s|=a[h++]<>>16)>o&&i(Error("invalid code length: "+n)),t.j=s>>n,t.e=o-n,t.c=h,65535&r}function ot(t){this.input=t,this.c=0,this.G=[],this.R=!1}function at(t){if("string"==typeof t){var e,r,i=t.split("");for(e=0,r=i.length;e>>0;t=i}for(var n,s=1,o=0,a=t.length,h=0;0>>0}function ht(t,e){var r,n;switch(this.input=t,this.c=0,!e&&(e={})||(e.index&&(this.c=e.index),e.verify&&(this.V=e.verify)),r=t[this.c++],n=t[this.c++],15&r){case ft:this.method=ft;break;default:i(Error("unsupported compression method"))}0!=((r<<8)+n)%31&&i(Error("invalid fcheck flag:"+((r<<8)+n)%31)),32&n&&i(Error("fdict flag is not supported")),this.J=new D(t,{index:this.c,bufferSize:e.bufferSize,bufferType:e.bufferType,resize:e.resize})}D.prototype.r=function(t,e){var r=this.a,i=this.b;this.A=t;for(var n,s,o,a,h=r.length-258;256!==(n=st(this,t));)if(256>n)i>=h&&(this.b=i,r=this.f(),i=this.b),r[i++]=n;else for(a=H[s=n-257],0=h&&(this.b=i,r=this.f(),i=this.b);a--;)r[i]=r[i++-o];for(;8<=this.e;)this.e-=8,this.c--;this.b=i},D.prototype.Q=function(t,e){var r=this.a,i=this.b;this.A=t;for(var n,s,o,a,h=r.length;256!==(n=st(this,t));)if(256>n)i>=h&&(h=(r=this.f()).length),r[i++]=n;else for(a=H[s=n-257],0h&&(h=(r=this.f()).length);a--;)r[i]=r[i++-o];for(;8<=this.e;)this.e-=8,this.c--;this.b=i},D.prototype.f=function(){var t,e,r=new(o?Uint8Array:Array)(this.b-32768),i=this.b-32768,n=this.a;if(o)r.set(n.subarray(32768,r.length));else for(t=0,e=r.length;tt;++t)n[t]=n[i+t];return this.b=32768,n},D.prototype.S=function(t){var e,r,i,n=this.input.length/this.c+1|0,s=this.input,a=this.a;return t&&("number"==typeof t.B&&(n=t.B),"number"==typeof t.M&&(n+=t.M)),2>n?r=(i=(s.length-this.c)/this.A[2]/2*258|0)e&&(this.a.length=e),t=this.a),this.buffer=t},ot.prototype.i=function(){for(var t=this.input.length;this.c>>0,d(e,n,n)!==g&&i(Error("invalid CRC-32 checksum: 0x"+d(e,n,n).toString(16)+" / 0x"+g.toString(16))),a.Z=h=(m[b++]|m[b++]<<8|m[b++]<<16|m[b++]<<24)>>>0,(4294967295&e.length)!==h&&i(Error("invalid input size: "+(4294967295&e.length)+" / "+h)),this.G.push(a),this.c=b}this.R=s;var w,v,x,A=this.G,_=0,E=0;for(w=0,v=A.length;w>>0!==at(t)&&i(Error("invalid adler-32 checksum"))),t};var ft=8;function ut(t,e){this.input=t,this.a=new(o?Uint8Array:Array)(32768),this.k=ct.t;var r,i={};for(r in!e&&(e={})||"number"!=typeof e.compressionType||(this.k=e.compressionType),e)i[r]=e[r];i.outputBuffer=this.a,this.I=new v(this.input,i)}var ct=_;function pt(t,e){var r;return r=new ut(t).h(),e||(e={}),e.H?r:mt(r)}function lt(t,e){var r;return t.subarray=t.slice,r=new ht(t).i(),e||(e={}),e.noBuffer?r:mt(r)}function dt(t,e){var r;return t.subarray=t.slice,r=new S(t).h(),e||(e={}),e.H?r:mt(r)}function gt(t,e){var r;return t.subarray=t.slice,r=new ot(t).i(),e||(e={}),e.H?r:mt(r)}function mt(t){var e,i,n=new r(t.length);for(e=0,i=t.length;e>24&255,h[f++]=a>>16&255,h[f++]=a>>8&255,h[f++]=255&a,h},e.deflate=function(e,r,i){t.nextTick(function(){var t,n;try{n=pt(e,i)}catch(e){t=e}r(t,n)})},e.deflateSync=pt,e.inflate=function(e,r,i){t.nextTick(function(){var t,n;try{n=lt(e,i)}catch(e){t=e}r(t,n)})},e.inflateSync=lt,e.gzip=function(e,r,i){t.nextTick(function(){var t,n;try{n=dt(e,i)}catch(e){t=e}r(t,n)})},e.gzipSync=dt,e.gunzip=function(e,r,i){t.nextTick(function(){var t,n;try{n=gt(e,i)}catch(e){t=e}r(t,n)})},e.gunzipSync=gt}).call(this)}).call(this,r(12),r(0).Buffer)},function(t,e){var r,i,n=t.exports={};function s(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===s||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:s}catch(t){r=s}try{i="function"==typeof clearTimeout?clearTimeout:o}catch(t){i=o}}();var h,f=[],u=!1,c=-1;function p(){u&&h&&(u=!1,h.length?f=h.concat(f):c=-1,f.length&&l())}function l(){if(!u){var t=a(p);u=!0;for(var e=f.length;e;){for(h=f,f=[];++c1)for(var r=1;r0?h-4:h;var u=0;for(e=0;e>16&255,a[u++]=i>>8&255,a[u++]=255&i;2===o?(i=n[t.charCodeAt(e)]<<2|n[t.charCodeAt(e+1)]>>4,a[u++]=255&i):1===o&&(i=n[t.charCodeAt(e)]<<10|n[t.charCodeAt(e+1)]<<4|n[t.charCodeAt(e+2)]>>2,a[u++]=i>>8&255,a[u++]=255&i);return a},e.fromByteArray=function(t){for(var e,r=t.length,n=r%3,s="",o=[],a=0,h=r-n;ah?h:a+16383));1===n?(e=t[r-1],s+=i[e>>2],s+=i[e<<4&63],s+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],s+=i[e>>10],s+=i[e>>4&63],s+=i[e<<2&63],s+="=");return o.push(s),o.join("")};for(var i=[],n=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,h=o.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function u(t,e,r){for(var n,s,o=[],a=e;a>18&63]+i[s>>12&63]+i[s>>6&63]+i[63&s]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,r,i,n){var s,o,a=8*n-i-1,h=(1<>1,u=-7,c=r?n-1:0,p=r?-1:1,l=t[e+c];for(c+=p,s=l&(1<<-u)-1,l>>=-u,u+=a;u>0;s=256*s+t[e+c],c+=p,u-=8);for(o=s&(1<<-u)-1,s>>=-u,u+=i;u>0;o=256*o+t[e+c],c+=p,u-=8);if(0===s)s=1-f;else{if(s===h)return o?NaN:1/0*(l?-1:1);o+=Math.pow(2,i),s-=f}return(l?-1:1)*o*Math.pow(2,s-i)},e.write=function(t,e,r,i,n,s){var o,a,h,f=8*s-n-1,u=(1<>1,p=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,l=i?0:s-1,d=i?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-o))<1&&(o--,h*=2),(e+=o+c>=1?p/h:p*Math.pow(2,1-c))*h>=2&&(o++,h/=2),o+c>=u?(a=0,o=u):o+c>=1?(a=(e*h-1)*Math.pow(2,n),o+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,n),o=0));n>=8;t[r+l]=255&a,l+=d,a/=256,n-=8);for(o=o<0;t[r+l]=255&o,l+=d,o/=256,f-=8);t[r+l-d]|=128*g}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){(function(e){const i=r(17),n=r(20);t.exports=((t,r)=>{const s=e.from(r),o=n(s);let a=0,h=null,f=null,u=0,c=0;if(o&&"image/bmp"===o.mime){const e=i.decode(s);h=t._malloc(e.data.length*Uint8Array.BYTES_PER_ELEMENT),t.HEAPU8.set(e.data,h),u=e.width,c=e.height,a=4}else{const e=t._malloc(s.length*Uint8Array.BYTES_PER_ELEMENT);t.HEAPU8.set(s,e),f=t._pixReadMem(e,s.length),0===t.getValue(f+28,"i32")&&t.setValue(f+28,70,"i32"),[u,c]=Array(2).fill(0).map((e,r)=>t.getValue(f+4*r,"i32"))}return{w:u,h:c,bytesPerPixel:a,data:h,pix:f}})}).call(this,r(0).Buffer)},function(t,e,r){var i=r(18),n=r(19);t.exports={encode:i,decode:n}},function(t,e,r){(function(e){function r(t){this.buffer=t.data,this.width=t.width,this.height=t.height,this.extraBytes=this.width%4,this.rgbSize=this.height*(3*this.width+this.extraBytes),this.headerInfoSize=40,this.data=[],this.flag="BM",this.reserved=0,this.offset=54,this.fileSize=this.rgbSize+this.offset,this.planes=1,this.bitPP=24,this.compress=0,this.hr=0,this.vr=0,this.colors=0,this.importantColors=0}r.prototype.encode=function(){var t=new e(this.offset+this.rgbSize);this.pos=0,t.write(this.flag,this.pos,2),this.pos+=2,t.writeUInt32LE(this.fileSize,this.pos),this.pos+=4,t.writeUInt32LE(this.reserved,this.pos),this.pos+=4,t.writeUInt32LE(this.offset,this.pos),this.pos+=4,t.writeUInt32LE(this.headerInfoSize,this.pos),this.pos+=4,t.writeUInt32LE(this.width,this.pos),this.pos+=4,t.writeInt32LE(-this.height,this.pos),this.pos+=4,t.writeUInt16LE(this.planes,this.pos),this.pos+=2,t.writeUInt16LE(this.bitPP,this.pos),this.pos+=2,t.writeUInt32LE(this.compress,this.pos),this.pos+=4,t.writeUInt32LE(this.rgbSize,this.pos),this.pos+=4,t.writeUInt32LE(this.hr,this.pos),this.pos+=4,t.writeUInt32LE(this.vr,this.pos),this.pos+=4,t.writeUInt32LE(this.colors,this.pos),this.pos+=4,t.writeUInt32LE(this.importantColors,this.pos),this.pos+=4;for(var r=0,i=3*this.width+this.extraBytes,n=0;n0){var a=this.pos+n*i+3*this.width;t.fill(0,a,a+this.extraBytes)}}return t},t.exports=function(t,e){return void 0===e&&(e=100),{data:new r(t).encode(),width:t.width,height:t.height}}}).call(this,r(0).Buffer)},function(t,e,r){(function(e){function r(t,e){if(this.pos=0,this.buffer=t,this.is_with_alpha=!!e,this.bottom_up=!0,this.flag=this.buffer.toString("utf-8",0,this.pos+=2),"BM"!=this.flag)throw new Error("Invalid BMP File");this.parseHeader(),this.parseRGBA()}r.prototype.parseHeader=function(){if(this.fileSize=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.reserved=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.offset=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.headerSize=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.width=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.height=this.buffer.readInt32LE(this.pos),this.pos+=4,this.planes=this.buffer.readUInt16LE(this.pos),this.pos+=2,this.bitPP=this.buffer.readUInt16LE(this.pos),this.pos+=2,this.compress=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.rawSize=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.hr=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.vr=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.colors=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.importantColors=this.buffer.readUInt32LE(this.pos),this.pos+=4,16===this.bitPP&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var t=0===this.colors?1<=0?this.height-1:-this.height;for(r=this.height-1;r>=0;r--){for(var i=this.bottom_up?r:this.height-1-r,n=0;n>7-a&1];this.data[o+4*a]=0,this.data[o+4*a+1]=h.blue,this.data[o+4*a+2]=h.green,this.data[o+4*a+3]=h.red}0!=e&&(this.pos+=4-e)}},r.prototype.bit4=function(){if(2==this.compress){this.data.fill(255);for(var t=0,e=this.bottom_up?this.height-1:0,r=!1;t>4),1&h&&h+1>1&1)&&this.pos++}}else for(h=0;h>4),r=!r}function f(e){var r=this.palette[e];this.data[t]=0,this.data[t+1]=r.blue,this.data[t+2]=r.green,this.data[t+3]=r.red,t+=4}}else{var u=Math.ceil(this.width/2),c=u%4;for(o=this.height-1;o>=0;o--){var p=this.bottom_up?o:this.height-1-o;for(s=0;s>4,d=15&n,g=this.palette[l];if(this.data[t]=0,this.data[t+1]=g.blue,this.data[t+2]=g.green,this.data[t+3]=g.red,2*s+1>=this.width)break;g=this.palette[d],this.data[t+4]=0,this.data[t+4+1]=g.blue,this.data[t+4+2]=g.green,this.data[t+4+3]=g.red}0!=c&&(this.pos+=4-c)}}},r.prototype.bit8=function(){if(1==this.compress){this.data.fill(255);for(var t=0,e=this.bottom_up?this.height-1:0;t=0;s--){var u=this.bottom_up?s:this.height-1-s;for(n=0;n=0;r--){for(var i=this.bottom_up?r:this.height-1-r,n=0;n>5&e)/e*255|0,h=(s>>10&e)/e*255|0,f=s>>15?255:0,u=i*this.width*4+4*n;this.data[u]=f,this.data[u+1]=o,this.data[u+2]=a,this.data[u+3]=h}this.pos+=t}},r.prototype.bit16=function(){var t=this.width%2*2;this.maskRed=31744,this.maskGreen=992,this.maskBlue=31,this.mask0=0,3==this.compress&&(this.maskRed=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.maskGreen=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.maskBlue=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.mask0=this.buffer.readUInt32LE(this.pos),this.pos+=4);for(var e=[0,0,0],r=0;r<16;r++)this.maskRed>>r&1&&e[0]++,this.maskGreen>>r&1&&e[1]++,this.maskBlue>>r&1&&e[2]++;e[1]+=e[0],e[2]+=e[1],e[0]=8-e[0],e[1]-=8,e[2]-=8;for(var i=this.height-1;i>=0;i--){for(var n=this.bottom_up?i:this.height-1-i,s=0;s>e[1],f=(o&this.maskRed)>>e[2],u=n*this.width*4+4*s;this.data[u]=0,this.data[u+1]=a,this.data[u+2]=h,this.data[u+3]=f}this.pos+=t}},r.prototype.bit24=function(){for(var t=this.height-1;t>=0;t--){for(var e=this.bottom_up?t:this.height-1-t,r=0;r=0;t--)for(var e=this.bottom_up?t:this.height-1-t,r=0;r=0;t--)for(e=this.bottom_up?t:this.height-1-t,r=0;r[...t].map(t=>t.charCodeAt(0)),i=r("META-INF/mozilla.rsa"),n=r("[Content_Types].xml"),s=r("_rels/.rels");function o(t,e=0){let r=t[e],i=1,n=0;for(;++n<8;)i*=256,r+=t[e+n]*i;return r}t.exports=(t=>{if(!(t instanceof Uint8Array||e.isBuffer(t)))throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`Buffer\`, got \`${typeof t}\``);const a=t instanceof Uint8Array?t:new Uint8Array(t);if(!(a&&a.length>1))return null;const h=(t,e)=>{e=Object.assign({offset:0},e);for(let r=0;rh(r(t),e);if(h([255,216,255]))return{ext:"jpg",mime:"image/jpeg"};if(h([137,80,78,71,13,10,26,10]))return{ext:"png",mime:"image/png"};if(h([71,73,70]))return{ext:"gif",mime:"image/gif"};if(h([87,69,66,80],{offset:8}))return{ext:"webp",mime:"image/webp"};if(h([70,76,73,70]))return{ext:"flif",mime:"image/flif"};if((h([73,73,42,0])||h([77,77,0,42]))&&h([67,82],{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(h([73,73,42,0])||h([77,77,0,42]))return{ext:"tif",mime:"image/tiff"};if(h([66,77]))return{ext:"bmp",mime:"image/bmp"};if(h([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(h([56,66,80,83]))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(h([80,75,3,4])){if(h([109,105,109,101,116,121,112,101,97,112,112,108,105,99,97,116,105,111,110,47,101,112,117,98,43,122,105,112],{offset:30}))return{ext:"epub",mime:"application/epub+zip"};if(h(i,{offset:30}))return{ext:"xpi",mime:"application/x-xpinstall"};if(f("mimetypeapplication/vnd.oasis.opendocument.text",{offset:30}))return{ext:"odt",mime:"application/vnd.oasis.opendocument.text"};if(f("mimetypeapplication/vnd.oasis.opendocument.spreadsheet",{offset:30}))return{ext:"ods",mime:"application/vnd.oasis.opendocument.spreadsheet"};if(f("mimetypeapplication/vnd.oasis.opendocument.presentation",{offset:30}))return{ext:"odp",mime:"application/vnd.oasis.opendocument.presentation"};const t=(t,e=0)=>t.findIndex((t,r,i)=>r>=e&&80===i[r]&&75===i[r+1]&&3===i[r+2]&&4===i[r+3]);let e=0,r=!1,o=null;do{const i=e+30;if(r||(r=h(n,{offset:i})||h(s,{offset:i})),o||(f("word/",{offset:i})?o={ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"}:f("ppt/",{offset:i})?o={ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"}:f("xl/",{offset:i})&&(o={ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"})),r&&o)return o;e=t(a,i)}while(e>=0);if(o)return o}if(h([80,75])&&(3===a[2]||5===a[2]||7===a[2])&&(4===a[3]||6===a[3]||8===a[3]))return{ext:"zip",mime:"application/zip"};if(h([117,115,116,97,114],{offset:257}))return{ext:"tar",mime:"application/x-tar"};if(h([82,97,114,33,26,7])&&(0===a[6]||1===a[6]))return{ext:"rar",mime:"application/x-rar-compressed"};if(h([31,139,8]))return{ext:"gz",mime:"application/gzip"};if(h([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(h([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(h([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(h([51,103,112,53])||h([0,0,0])&&h([102,116,121,112],{offset:4})&&(h([109,112,52,49],{offset:8})||h([109,112,52,50],{offset:8})||h([105,115,111,109],{offset:8})||h([105,115,111,50],{offset:8})||h([109,109,112,52],{offset:8})||h([77,52,86],{offset:8})||h([100,97,115,104],{offset:8})))return{ext:"mp4",mime:"video/mp4"};if(h([77,84,104,100]))return{ext:"mid",mime:"audio/midi"};if(h([26,69,223,163])){const t=a.subarray(4,4100),e=t.findIndex((t,e,r)=>66===r[e]&&130===r[e+1]);if(-1!==e){const r=e+3,i=e=>[...e].every((e,i)=>t[r+i]===e.charCodeAt(0));if(i("matroska"))return{ext:"mkv",mime:"video/x-matroska"};if(i("webm"))return{ext:"webm",mime:"video/webm"}}}if(h([0,0,0,20,102,116,121,112,113,116,32,32])||h([102,114,101,101],{offset:4})||h([102,116,121,112,113,116,32,32],{offset:4})||h([109,100,97,116],{offset:4})||h([109,111,111,118],{offset:4})||h([119,105,100,101],{offset:4}))return{ext:"mov",mime:"video/quicktime"};if(h([82,73,70,70])){if(h([65,86,73],{offset:8}))return{ext:"avi",mime:"video/vnd.avi"};if(h([87,65,86,69],{offset:8}))return{ext:"wav",mime:"audio/vnd.wave"};if(h([81,76,67,77],{offset:8}))return{ext:"qcp",mime:"audio/qcelp"}}if(h([48,38,178,117,142,102,207,17,166,217])){let t=30;do{const e=o(a,t+16);if(h([145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101],{offset:t})){if(h([64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43],{offset:t+24}))return{ext:"wma",mime:"audio/x-ms-wma"};if(h([192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43],{offset:t+24}))return{ext:"wmv",mime:"video/x-ms-asf"};break}t+=e}while(t+24<=a.length);return{ext:"asf",mime:"application/vnd.ms-asf"}}if(h([0,0,1,186])||h([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};if(h([102,116,121,112,51,103],{offset:4}))return{ext:"3gp",mime:"video/3gpp"};for(let t=0;t<2&&t{const r=e.GetIterator(),i=[];let n,s,o,a,h;const f=(e,r)=>Object.keys(t).filter(t=>t.substr(0,r.length+1)===`${r}_`).filter(r=>t[r]===e).map(t=>t.slice(r.length+1))[0];r.Begin();do{if(r.IsAtBeginningOf(t.RIL_BLOCK)){const e=r.BlockPolygon();let s=null;if(t.getPointer(e)>0){const r=e.get_n(),i=e.get_x(),n=e.get_y();s=[];for(let t=0;t{const e=t.split("\n");if(" "===e[0].substring(0,2))for(let t=0;t {\n workerUtils.dispatchHandlers(data, obj => postMessage(obj));\n});\n\nworkerUtils.setAdapter({\n getCore: (req, res) => {\n if (!global.TesseractCore) {\n res.progress({ status: 'loading tesseract core', progress: 0 });\n global.importScripts(req.workerOptions.corePath);\n global.TesseractCore = typeof WebAssembly === 'object' ? global.TesseractCoreWASM : global.TesseractCoreASM;\n res.progress({ status: 'loading tesseract core', progress: 1 });\n }\n return global.TesseractCore;\n },\n});\n","const { readImage, loadLang } = require('tesseract.js-utils');\nconst dump = require('./dump');\n\nlet Module;\nlet base;\nlet latestJob;\nlet adapter = {};\n\nconst handleInit = (req, res) => {\n let MIN_MEMORY = 100663296;\n\n if (['chi_sim', 'chi_tra', 'jpn'].includes(req.options.lang)) {\n MIN_MEMORY = 167772160;\n }\n\n if (!Module || Module.TOTAL_MEMORY < MIN_MEMORY) {\n const Core = adapter.getCore(req, res);\n\n res.progress({ status: 'initializing tesseract', progress: 0 });\n\n return Core({\n // TOTAL_MEMORY: MIN_MEMORY,\n TesseractProgress(percent) {\n latestJob.progress({ status: 'recognizing text', progress: Math.max(0, (percent - 30) / 70) });\n },\n })\n .then((TessModule) => {\n Module = TessModule;\n base = new Module.TessBaseAPI();\n res.progress({ status: 'initialized tesseract', progress: 1 });\n });\n }\n\n return new Promise();\n};\n\nconst setImage = (image) => {\n const { w, h, data } = readImage(Module, Array.from(image));\n\n base.SetImage(data);\n base.SetRectangle(0, 0, w, h);\n return data;\n};\n\nconst loadLanguage = (req, res, cb) => {\n const { options: { lang }, workerOptions: { langPath } } = req;\n return loadLang({\n langs: lang,\n tessModule: Module,\n langURI: langPath,\n cache: true,\n }).then(cb);\n};\n\nconst handleRecognize = (req, res) => {\n handleInit(req, res)\n .then(() => {\n loadLanguage(req, res, () => {\n const { options } = req;\n\n const progressUpdate = (progress) => {\n res.progress({ status: 'initializing api', progress });\n };\n\n progressUpdate(0);\n base.Init(null, options.lang);\n progressUpdate(0.3);\n\n Object.keys(options).forEach((key) => {\n base.SetVariable(key, options[key]);\n });\n\n progressUpdate(0.6);\n const ptr = setImage(req.image);\n progressUpdate(1);\n\n base.Recognize(null);\n\n const result = dump(Module, base);\n\n base.End();\n Module._free(ptr);\n\n res.resolve(result);\n });\n });\n};\n\n\nconst handleDetect = (req, res) => {\n handleInit(req, res)\n .then(() => {\n req.options.lang = 'osd';\n loadLanguage(req, res, () => {\n base.Init(null, 'osd');\n base.SetPageSegMode(Module.PSM_OSD_ONLY);\n\n const ptr = setImage(req.image);\n const results = new Module.OSResults();\n\n if (!base.DetectOS(results)) {\n base.End();\n Module._free(ptr);\n res.reject('Failed to detect OS');\n } else {\n const best = results.get_best_result();\n const oid = best.get_orientation_id();\n const sid = best.get_script_id();\n\n base.End();\n Module._free(ptr);\n\n res.resolve({\n tesseract_script_id: sid,\n script: results.get_unicharset().get_script_from_script_id(sid),\n script_confidence: best.get_sconfidence(),\n orientation_degrees: [0, 270, 180, 90][oid],\n orientation_confidence: best.get_oconfidence(),\n });\n }\n });\n });\n};\n\nexports.dispatchHandlers = (packet, send) => {\n const respond = (status, data) => {\n send({\n jobId: packet.jobId,\n status,\n action: packet.action,\n data,\n });\n };\n respond.resolve = respond.bind(this, 'resolve');\n respond.reject = respond.bind(this, 'reject');\n respond.progress = respond.bind(this, 'progress');\n\n latestJob = respond;\n\n try {\n if (packet.action === 'recognize') {\n handleRecognize(packet.payload, respond);\n } else if (packet.action === 'detect') {\n handleDetect(packet.payload, respond);\n }\n } catch (err) {\n // Prepare exception to travel through postMessage\n respond.reject(err.toString());\n }\n};\n\nexports.setAdapter = (impl) => {\n adapter = impl;\n};\n","module.exports = {\n loadLang: require('./loadLang')({\n fetch: require('./common/browser/fetch'),\n gunzip: require('./common/browser/gunzip'),\n ...require('./common/browser/cache'),\n }),\n readImage: require('./readImage'),\n};\n","const handleLang = modules => ({\n tessModule,\n dataPath,\n cachePath,\n cache,\n lang,\n}) => (data) => {\n if (tessModule) {\n if (dataPath) {\n try {\n tessModule.FS.mkdir(dataPath);\n } catch (err) {\n // Do nothing\n }\n }\n tessModule.FS.writeFile(`${dataPath || '.'}/${lang}.traineddata`, data);\n }\n if (cache) {\n modules.writeCache(`${cachePath || '.'}/${lang}.traineddata`, data);\n }\n return data;\n};\n\nconst loadAndGunzipFile = modules => ({\n langURI,\n cachePath,\n ...options\n}) => lang => (\n modules.readCache(`${cachePath || '.'}/${lang}.traineddata`)\n .then((data) => {\n if (typeof data === 'undefined') {\n return Promise.reject();\n }\n return handleLang(modules)({ cachePath, lang, ...options })(data);\n })\n .catch(() => (\n // console.log(`Download ${lang}.traineddata.gz from ${langURI}/${lang}.traineddata.gz...`);\n modules.fetch(`${langURI}/${lang}.traineddata.gz`)\n .then(resp => resp.arrayBuffer())\n .then(buf => modules.gunzip(new Uint8Array(buf)))\n .then(handleLang(modules)({ cachePath, lang, ...options }))\n ))\n);\n\n/**\n * Load language(s) from local cache, download from remote if not in cache.\n *\n * All params below actually store in a object.\n *\n * ex:\n * loadLang({ langs, tesssModule, ... });\n *\n * @name loadLang\n * @function\n * @param {string} langs - langs to load, use '+' for multiple languages, ex: eng+chi_tra\n * @param {object} tessModule - TesseractModule\n * @param {string} langURI - prefix URI for downloading lang file\n * @param {string} cachePath - path to find cache\n * @param {string} dataPath - path to store data in mem\n * @param {boolean} cache - true for caching\n *\n */\nmodule.exports = modules => ({\n langs,\n ...options\n}) => (\n Promise\n .all(langs.split('+').map(loadAndGunzipFile(modules)(options)))\n);\n","const { fetch } = require('whatwg-fetch');\n\nmodule.exports = fetch;\n","var support = {\n searchParams: 'URLSearchParams' in self,\n iterable: 'Symbol' in self && 'iterator' in Symbol,\n blob:\n 'FileReader' in self &&\n 'Blob' in self &&\n (function() {\n try {\n new Blob()\n return true\n } catch (e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n}\n\nfunction isDataView(obj) {\n return obj && DataView.prototype.isPrototypeOf(obj)\n}\n\nif (support.arrayBuffer) {\n var viewClasses = [\n '[object Int8Array]',\n '[object Uint8Array]',\n '[object Uint8ClampedArray]',\n '[object Int16Array]',\n '[object Uint16Array]',\n '[object Int32Array]',\n '[object Uint32Array]',\n '[object Float32Array]',\n '[object Float64Array]'\n ]\n\n var isArrayBufferView =\n ArrayBuffer.isView ||\n function(obj) {\n return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1\n }\n}\n\nfunction normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n}\n\nfunction normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n}\n\n// Build a destructive iterator for the value list\nfunction iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n}\n\nexport function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n } else if (Array.isArray(headers)) {\n headers.forEach(function(header) {\n this.append(header[0], header[1])\n }, this)\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n}\n\nHeaders.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var oldValue = this.map[name]\n this.map[name] = oldValue ? oldValue + ', ' + value : value\n}\n\nHeaders.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n}\n\nHeaders.prototype.get = function(name) {\n name = normalizeName(name)\n return this.has(name) ? this.map[name] : null\n}\n\nHeaders.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n}\n\nHeaders.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = normalizeValue(value)\n}\n\nHeaders.prototype.forEach = function(callback, thisArg) {\n for (var name in this.map) {\n if (this.map.hasOwnProperty(name)) {\n callback.call(thisArg, this.map[name], name, this)\n }\n }\n}\n\nHeaders.prototype.keys = function() {\n var items = []\n this.forEach(function(value, name) {\n items.push(name)\n })\n return iteratorFor(items)\n}\n\nHeaders.prototype.values = function() {\n var items = []\n this.forEach(function(value) {\n items.push(value)\n })\n return iteratorFor(items)\n}\n\nHeaders.prototype.entries = function() {\n var items = []\n this.forEach(function(value, name) {\n items.push([name, value])\n })\n return iteratorFor(items)\n}\n\nif (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries\n}\n\nfunction consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n}\n\nfunction fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n}\n\nfunction readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n var promise = fileReaderReady(reader)\n reader.readAsArrayBuffer(blob)\n return promise\n}\n\nfunction readBlobAsText(blob) {\n var reader = new FileReader()\n var promise = fileReaderReady(reader)\n reader.readAsText(blob)\n return promise\n}\n\nfunction readArrayBufferAsText(buf) {\n var view = new Uint8Array(buf)\n var chars = new Array(view.length)\n\n for (var i = 0; i < view.length; i++) {\n chars[i] = String.fromCharCode(view[i])\n }\n return chars.join('')\n}\n\nfunction bufferClone(buf) {\n if (buf.slice) {\n return buf.slice(0)\n } else {\n var view = new Uint8Array(buf.byteLength)\n view.set(new Uint8Array(buf))\n return view.buffer\n }\n}\n\nfunction Body() {\n this.bodyUsed = false\n\n this._initBody = function(body) {\n this._bodyInit = body\n if (!body) {\n this._bodyText = ''\n } else if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString()\n } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n this._bodyArrayBuffer = bufferClone(body.buffer)\n // IE 10-11 can't handle a DataView body.\n this._bodyInit = new Blob([this._bodyArrayBuffer])\n } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n this._bodyArrayBuffer = bufferClone(body)\n } else {\n this._bodyText = body = Object.prototype.toString.call(body)\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(new Blob([this._bodyArrayBuffer]))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n if (this._bodyArrayBuffer) {\n return consumed(this) || Promise.resolve(this._bodyArrayBuffer)\n } else {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n }\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n}\n\n// HTTP methods whose capitalization should be normalized\nvar methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\nfunction normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return methods.indexOf(upcased) > -1 ? upcased : method\n}\n\nexport function Request(input, options) {\n options = options || {}\n var body = options.body\n\n if (input instanceof Request) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n this.signal = input.signal\n if (!body && input._bodyInit != null) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = String(input)\n }\n\n this.credentials = options.credentials || this.credentials || 'same-origin'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.signal = options.signal || this.signal\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n}\n\nRequest.prototype.clone = function() {\n return new Request(this, {body: this._bodyInit})\n}\n\nfunction decode(body) {\n var form = new FormData()\n body\n .trim()\n .split('&')\n .forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n}\n\nfunction parseHeaders(rawHeaders) {\n var headers = new Headers()\n // Replace instances of \\r\\n and \\n followed by at least one space or horizontal tab with a space\n // https://tools.ietf.org/html/rfc7230#section-3.2\n var preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, ' ')\n preProcessedHeaders.split(/\\r?\\n/).forEach(function(line) {\n var parts = line.split(':')\n var key = parts.shift().trim()\n if (key) {\n var value = parts.join(':').trim()\n headers.append(key, value)\n }\n })\n return headers\n}\n\nBody.call(Request.prototype)\n\nexport function Response(bodyInit, options) {\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status === undefined ? 200 : options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = 'statusText' in options ? options.statusText : 'OK'\n this.headers = new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n}\n\nBody.call(Response.prototype)\n\nResponse.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n}\n\nResponse.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n}\n\nvar redirectStatuses = [301, 302, 303, 307, 308]\n\nResponse.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n}\n\nexport var DOMException = self.DOMException\ntry {\n new DOMException()\n} catch (err) {\n DOMException = function(message, name) {\n this.message = message\n this.name = name\n var error = Error(message)\n this.stack = error.stack\n }\n DOMException.prototype = Object.create(Error.prototype)\n DOMException.prototype.constructor = DOMException\n}\n\nexport function fetch(input, init) {\n return new Promise(function(resolve, reject) {\n var request = new Request(input, init)\n\n if (request.signal && request.signal.aborted) {\n return reject(new DOMException('Aborted', 'AbortError'))\n }\n\n var xhr = new XMLHttpRequest()\n\n function abortXhr() {\n xhr.abort()\n }\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders() || '')\n }\n options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL')\n var body = 'response' in xhr ? xhr.response : xhr.responseText\n resolve(new Response(body, options))\n }\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.ontimeout = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.onabort = function() {\n reject(new DOMException('Aborted', 'AbortError'))\n }\n\n xhr.open(request.method, request.url, true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n } else if (request.credentials === 'omit') {\n xhr.withCredentials = false\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob'\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n\n if (request.signal) {\n request.signal.addEventListener('abort', abortXhr)\n\n xhr.onreadystatechange = function() {\n // DONE (success or failure)\n if (xhr.readyState === 4) {\n request.signal.removeEventListener('abort', abortXhr)\n }\n }\n }\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n}\n\nfetch.polyfill = true\n\nif (!self.fetch) {\n self.fetch = fetch\n self.Headers = Headers\n self.Request = Request\n self.Response = Response\n}\n","module.exports = require('zlibjs').gunzipSync;\n","/** @license zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License */(function() {'use strict';function q(b){throw b;}var t=void 0,v=!0;var B=\"undefined\"!==typeof Uint8Array&&\"undefined\"!==typeof Uint16Array&&\"undefined\"!==typeof Uint32Array&&\"undefined\"!==typeof DataView;function G(b,a){this.index=\"number\"===typeof a?a:0;this.m=0;this.buffer=b instanceof(B?Uint8Array:Array)?b:new (B?Uint8Array:Array)(32768);2*this.buffer.length<=this.index&&q(Error(\"invalid index\"));this.buffer.length<=this.index&&this.f()}G.prototype.f=function(){var b=this.buffer,a,c=b.length,d=new (B?Uint8Array:Array)(c<<1);if(B)d.set(b);else for(a=0;a>>8&255]<<16|I[b>>>16&255]<<8|I[b>>>24&255])>>32-a:I[b]>>8-a);if(8>a+f)g=g<>a-k-1&1,8===++f&&(f=0,d[e++]=I[g],g=0,e===d.length&&(d=this.f()));d[e]=g;this.buffer=d;this.m=f;this.index=e};G.prototype.finish=function(){var b=this.buffer,a=this.index,c;0L;++L){for(var R=L,ba=R,ca=7,R=R>>>1;R;R>>>=1)ba<<=1,ba|=R&1,--ca;aa[L]=(ba<>>0}var I=aa;function ha(b,a,c){var d,e=\"number\"===typeof a?a:a=0,f=\"number\"===typeof c?c:b.length;d=-1;for(e=f&7;e--;++a)d=d>>>8^S[(d^b[a])&255];for(e=f>>3;e--;a+=8)d=d>>>8^S[(d^b[a])&255],d=d>>>8^S[(d^b[a+1])&255],d=d>>>8^S[(d^b[a+2])&255],d=d>>>8^S[(d^b[a+3])&255],d=d>>>8^S[(d^b[a+4])&255],d=d>>>8^S[(d^b[a+5])&255],d=d>>>8^S[(d^b[a+6])&255],d=d>>>8^S[(d^b[a+7])&255];return(d^4294967295)>>>0}\nvar ia=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,\n2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,\n2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,\n2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,\n3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,\n936918E3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],S=B?new Uint32Array(ia):ia;function ja(){};function ka(b){this.buffer=new (B?Uint16Array:Array)(2*b);this.length=0}ka.prototype.getParent=function(b){return 2*((b-2)/4|0)};ka.prototype.push=function(b,a){var c,d,e=this.buffer,f;c=this.length;e[this.length++]=a;for(e[this.length++]=b;0e[d])f=e[c],e[c]=e[d],e[d]=f,f=e[c+1],e[c+1]=e[d+1],e[d+1]=f,c=d;else break;return this.length};\nka.prototype.pop=function(){var b,a,c=this.buffer,d,e,f;a=c[0];b=c[1];this.length-=2;c[0]=c[this.length];c[1]=c[this.length+1];for(f=0;;){e=2*f+2;if(e>=this.length)break;e+2c[e]&&(e+=2);if(c[e]>c[f])d=c[f],c[f]=c[e],c[e]=d,d=c[f+1],c[f+1]=c[e+1],c[e+1]=d;else break;f=e}return{index:b,value:a,length:this.length}};function T(b){var a=b.length,c=0,d=Number.POSITIVE_INFINITY,e,f,g,k,h,m,r,p,l,n;for(p=0;pc&&(c=b[p]),b[p]>=1;n=g<<16|p;for(l=m;lU;U++)switch(v){case 143>=U:qa.push([U+48,8]);break;case 255>=U:qa.push([U-144+400,9]);break;case 279>=U:qa.push([U-256+0,7]);break;case 287>=U:qa.push([U-280+192,8]);break;default:q(\"invalid literal: \"+U)}\nna.prototype.h=function(){var b,a,c,d,e=this.input;switch(this.k){case 0:c=0;for(d=e.length;c>>8&255;l[n++]=m&255;l[n++]=m>>>8&255;if(B)l.set(f,n),n+=f.length,l=l.subarray(0,n);else{r=0;for(p=f.length;rA)for(;0A?A:138,F>A-3&&F=F?(J[H++]=17,J[H++]=F-3,P[17]++):(J[H++]=18,J[H++]=F-11,P[18]++),A-=F;else if(J[H++]=K[y],P[K[y]]++,A--,3>A)for(;0A?A:6,F>A-3&&FE;E++)ta[E]=la[qb[E]];for(Y=19;4=a:return[265,a-11,1];case 14>=a:return[266,a-13,1];case 16>=a:return[267,a-15,1];case 18>=a:return[268,a-17,1];case 22>=a:return[269,a-19,2];case 26>=a:return[270,a-23,2];case 30>=a:return[271,a-27,2];case 34>=a:return[272,\na-31,2];case 42>=a:return[273,a-35,3];case 50>=a:return[274,a-43,3];case 58>=a:return[275,a-51,3];case 66>=a:return[276,a-59,3];case 82>=a:return[277,a-67,4];case 98>=a:return[278,a-83,4];case 114>=a:return[279,a-99,4];case 130>=a:return[280,a-115,4];case 162>=a:return[281,a-131,5];case 194>=a:return[282,a-163,5];case 226>=a:return[283,a-195,5];case 257>=a:return[284,a-227,5];case 258===a:return[285,a-258,0];default:q(\"invalid length: \"+a)}}var a=[],c,d;for(c=3;258>=c;c++)d=b(c),a[c]=d[2]<<24|d[1]<<\n16|d[0];return a}(),ya=B?new Uint32Array(xa):xa;\nfunction ra(b,a){function c(a,c){var b=a.N,d=[],f=0,e;e=ya[a.length];d[f++]=e&65535;d[f++]=e>>16&255;d[f++]=e>>24;var g;switch(v){case 1===b:g=[0,b-1,0];break;case 2===b:g=[1,b-2,0];break;case 3===b:g=[2,b-3,0];break;case 4===b:g=[3,b-4,0];break;case 6>=b:g=[4,b-5,1];break;case 8>=b:g=[5,b-7,1];break;case 12>=b:g=[6,b-9,2];break;case 16>=b:g=[7,b-13,2];break;case 24>=b:g=[8,b-17,3];break;case 32>=b:g=[9,b-25,3];break;case 48>=b:g=[10,b-33,4];break;case 64>=b:g=[11,b-49,4];break;case 96>=b:g=[12,b-\n65,5];break;case 128>=b:g=[13,b-97,5];break;case 192>=b:g=[14,b-129,6];break;case 256>=b:g=[15,b-193,6];break;case 384>=b:g=[16,b-257,7];break;case 512>=b:g=[17,b-385,7];break;case 768>=b:g=[18,b-513,8];break;case 1024>=b:g=[19,b-769,8];break;case 1536>=b:g=[20,b-1025,9];break;case 2048>=b:g=[21,b-1537,9];break;case 3072>=b:g=[22,b-2049,10];break;case 4096>=b:g=[23,b-3073,10];break;case 6144>=b:g=[24,b-4097,11];break;case 8192>=b:g=[25,b-6145,11];break;case 12288>=b:g=[26,b-8193,12];break;case 16384>=\nb:g=[27,b-12289,12];break;case 24576>=b:g=[28,b-16385,13];break;case 32768>=b:g=[29,b-24577,13];break;default:q(\"invalid distance\")}e=g;d[f++]=e[0];d[f++]=e[1];d[f++]=e[2];var h,k;h=0;for(k=d.length;h=f;)u[f++]=0;for(f=0;29>=f;)w[f++]=0}u[256]=1;d=0;for(e=a.length;d=e){p&&c(p,-1);f=0;for(g=e-d;fg&&a+gf&&(e=d,f=g);if(258===g)break}return new va(f,a-e)}\nfunction sa(b,a){var c=b.length,d=new ka(572),e=new (B?Uint8Array:Array)(c),f,g,k,h,m;if(!B)for(h=0;h2*e[n-1]+f[n]&&(e[n]=2*e[n-1]+f[n]),k[n]=Array(e[n]),h[n]=Array(e[n]);for(l=0;lb[l]?(k[n][s]=u,h[n][s]=a,w+=2):(k[n][s]=b[l],h[n][s]=l,++l);m[n]=0;1===f[n]&&d(n)}return g}\nfunction ua(b){var a=new (B?Uint16Array:Array)(b.length),c=[],d=[],e=0,f,g,k,h;f=0;for(g=b.length;f>>=1}return a};function Ba(b,a){this.input=b;this.b=this.c=0;this.g={};a&&(a.flags&&(this.g=a.flags),\"string\"===typeof a.filename&&(this.filename=a.filename),\"string\"===typeof a.comment&&(this.w=a.comment),a.deflateOptions&&(this.l=a.deflateOptions));this.l||(this.l={})}\nBa.prototype.h=function(){var b,a,c,d,e,f,g,k,h=new (B?Uint8Array:Array)(32768),m=0,r=this.input,p=this.c,l=this.filename,n=this.w;h[m++]=31;h[m++]=139;h[m++]=8;b=0;this.g.fname&&(b|=Ca);this.g.fcomment&&(b|=Da);this.g.fhcrc&&(b|=Ea);h[m++]=b;a=(Date.now?Date.now():+new Date)/1E3|0;h[m++]=a&255;h[m++]=a>>>8&255;h[m++]=a>>>16&255;h[m++]=a>>>24&255;h[m++]=0;h[m++]=Sa;if(this.g.fname!==t){g=0;for(k=l.length;g>>8&255),h[m++]=f&255;h[m++]=0}if(this.g.comment){g=\n0;for(k=n.length;g>>8&255),h[m++]=f&255;h[m++]=0}this.g.fhcrc&&(c=ha(h,0,m)&65535,h[m++]=c&255,h[m++]=c>>>8&255);this.l.outputBuffer=h;this.l.outputIndex=m;e=new na(r,this.l);h=e.h();m=e.b;B&&(m+8>h.buffer.byteLength?(this.a=new Uint8Array(m+8),this.a.set(new Uint8Array(h.buffer)),h=this.a):h=new Uint8Array(h.buffer));d=ha(r,t,t);h[m++]=d&255;h[m++]=d>>>8&255;h[m++]=d>>>16&255;h[m++]=d>>>24&255;k=r.length;h[m++]=k&255;h[m++]=k>>>8&255;h[m++]=k>>>16&255;h[m++]=\nk>>>24&255;this.c=p;B&&m>>=1;switch(b){case 0:var a=this.input,c=this.c,d=this.a,e=this.b,f=a.length,g=t,k=t,h=d.length,m=t;this.e=this.j=0;c+1>=f&&q(Error(\"invalid uncompressed block header: LEN\"));g=a[c++]|a[c++]<<8;c+1>=f&&q(Error(\"invalid uncompressed block header: NLEN\"));k=a[c++]|a[c++]<<8;g===~k&&q(Error(\"invalid uncompressed block header: length verify\"));c+g>a.length&&q(Error(\"input buffer is broken\"));switch(this.q){case Ua:for(;e+g>d.length;){m=\nh-e;g-=m;if(B)d.set(a.subarray(c,c+m),e),e+=m,c+=m;else for(;m--;)d[e++]=a[c++];this.b=e;d=this.f();e=this.b}break;case Ta:for(;e+g>d.length;)d=this.f({B:2});break;default:q(Error(\"invalid inflate mode\"))}if(B)d.set(a.subarray(c,c+g),e),e+=g,c+=g;else for(;g--;)d[e++]=a[c++];this.c=c;this.b=e;this.a=d;break;case 1:this.r(Va,Wa);break;case 2:for(var r=W(this,5)+257,p=W(this,5)+1,l=W(this,4)+4,n=new (B?Uint8Array:Array)(Xa.length),s=t,u=t,w=t,C=t,x=t,D=t,M=t,z=t,N=t,z=0;z=$?8:255>=$?9:279>=$?7:8;var Va=T(hb),jb=new (B?Uint8Array:Array)(30),kb,lb;kb=0;for(lb=jb.length;kb=g&&q(Error(\"input buffer is broken\")),c|=e[f++]<>>a;b.e=d-a;b.c=f;return k}\nfunction Ya(b,a){for(var c=b.j,d=b.e,e=b.input,f=b.c,g=e.length,k=a[0],h=a[1],m,r;d=g);)c|=e[f++]<>>16;r>d&&q(Error(\"invalid code length: \"+r));b.j=c>>r;b.e=d-r;b.c=f;return m&65535}\nV.prototype.r=function(b,a){var c=this.a,d=this.b;this.A=b;for(var e=c.length-258,f,g,k,h;256!==(f=Ya(this,b));)if(256>f)d>=e&&(this.b=d,c=this.f(),d=this.b),c[d++]=f;else{g=f-257;h=ab[g];0=e&&(this.b=d,c=this.f(),d=this.b);for(;h--;)c[d]=c[d++-k]}for(;8<=this.e;)this.e-=8,this.c--;this.b=d};\nV.prototype.Q=function(b,a){var c=this.a,d=this.b;this.A=b;for(var e=c.length,f,g,k,h;256!==(f=Ya(this,b));)if(256>f)d>=e&&(c=this.f(),e=c.length),c[d++]=f;else{g=f-257;h=ab[g];0e&&(c=this.f(),e=c.length);for(;h--;)c[d]=c[d++-k]}for(;8<=this.e;)this.e-=8,this.c--;this.b=d};\nV.prototype.f=function(){var b=new (B?Uint8Array:Array)(this.b-32768),a=this.b-32768,c,d,e=this.a;if(B)b.set(e.subarray(32768,b.length));else{c=0;for(d=b.length;cc;++c)e[c]=e[a+c];this.b=32768;return e};\nV.prototype.S=function(b){var a,c=this.input.length/this.c+1|0,d,e,f,g=this.input,k=this.a;b&&(\"number\"===typeof b.B&&(c=b.B),\"number\"===typeof b.M&&(c+=b.M));2>c?(d=(g.length-this.c)/this.A[2],f=258*(d/2)|0,e=fa&&(this.a.length=a),b=this.a);return this.buffer=b};function mb(b){this.input=b;this.c=0;this.G=[];this.R=!1}\nmb.prototype.i=function(){for(var b=this.input.length;this.c>>0;ha(e,t,t)!==r&&q(Error(\"invalid CRC-32 checksum: 0x\"+ha(e,t,t).toString(16)+\" / 0x\"+\nr.toString(16)));a.Z=c=(p[l++]|p[l++]<<8|p[l++]<<16|p[l++]<<24)>>>0;(e.length&4294967295)!==c&&q(Error(\"invalid input size: \"+(e.length&4294967295)+\" / \"+c));this.G.push(a);this.c=l}this.R=v;var n=this.G,s,u,w=0,C=0,x;s=0;for(u=n.length;s>>0;b=a}for(var e=1,f=0,g=b.length,k,h=0;0>>0};function ob(b,a){var c,d;this.input=b;this.c=0;if(a||!(a={}))a.index&&(this.c=a.index),a.verify&&(this.V=a.verify);c=b[this.c++];d=b[this.c++];switch(c&15){case pb:this.method=pb;break;default:q(Error(\"unsupported compression method\"))}0!==((c<<8)+d)%31&&q(Error(\"invalid fcheck flag:\"+((c<<8)+d)%31));d&32&&q(Error(\"fdict flag is not supported\"));this.J=new V(b,{index:this.c,bufferSize:a.bufferSize,bufferType:a.bufferType,resize:a.resize})}\nob.prototype.i=function(){var b=this.input,a,c;a=this.J.i();this.c=this.J.c;this.V&&(c=(b[this.c++]<<24|b[this.c++]<<16|b[this.c++]<<8|b[this.c++])>>>0,c!==nb(a)&&q(Error(\"invalid adler-32 checksum\")));return a};var pb=8;function rb(b,a){this.input=b;this.a=new (B?Uint8Array:Array)(32768);this.k=sb.t;var c={},d;if((a||!(a={}))&&\"number\"===typeof a.compressionType)this.k=a.compressionType;for(d in a)c[d]=a[d];c.outputBuffer=this.a;this.I=new na(this.input,c)}var sb=pa;\nrb.prototype.h=function(){var b,a,c,d,e,f,g,k=0;g=this.a;b=pb;switch(b){case pb:a=Math.LOG2E*Math.log(32768)-8;break;default:q(Error(\"invalid compression method\"))}c=a<<4|b;g[k++]=c;switch(b){case pb:switch(this.k){case sb.NONE:e=0;break;case sb.L:e=1;break;case sb.t:e=2;break;default:q(Error(\"unsupported compression type\"))}break;default:q(Error(\"invalid compression method\"))}d=e<<6|0;g[k++]=d|31-(256*c+d)%31;f=nb(this.input);this.I.b=k;g=this.I.h();k=g.length;B&&(g=new Uint8Array(g.buffer),g.length<=\nk+4&&(this.a=new Uint8Array(g.length+4),this.a.set(g),g=this.a),g=g.subarray(0,k+4));g[k++]=f>>24&255;g[k++]=f>>16&255;g[k++]=f>>8&255;g[k++]=f&255;return g};exports.deflate=tb;exports.deflateSync=ub;exports.inflate=vb;exports.inflateSync=wb;exports.gzip=xb;exports.gzipSync=yb;exports.gunzip=zb;exports.gunzipSync=Ab;function tb(b,a,c){process.nextTick(function(){var d,e;try{e=ub(b,c)}catch(f){d=f}a(d,e)})}function ub(b,a){var c;c=(new rb(b)).h();a||(a={});return a.H?c:Bb(c)}function vb(b,a,c){process.nextTick(function(){var d,e;try{e=wb(b,c)}catch(f){d=f}a(d,e)})}\nfunction wb(b,a){var c;b.subarray=b.slice;c=(new ob(b)).i();a||(a={});return a.noBuffer?c:Bb(c)}function xb(b,a,c){process.nextTick(function(){var d,e;try{e=yb(b,c)}catch(f){d=f}a(d,e)})}function yb(b,a){var c;b.subarray=b.slice;c=(new Ba(b)).h();a||(a={});return a.H?c:Bb(c)}function zb(b,a,c){process.nextTick(function(){var d,e;try{e=Ab(b,c)}catch(f){d=f}a(d,e)})}function Ab(b,a){var c;b.subarray=b.slice;c=(new mb(b)).i();a||(a={});return a.H?c:Bb(c)}\nfunction Bb(b){var a=new Buffer(b.length),c,d;c=0;for(d=b.length;c 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\nvar isArray = require('isarray')\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return ''\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction placeHoldersCount (b64) {\n var len = b64.length\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // the number of equal signs (place holders)\n // if there are two placeholders, than the two characters before it\n // represent one byte\n // if there is only one, then the three characters before it represent 2 bytes\n // this is just a cheap hack to not do indexOf twice\n return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0\n}\n\nfunction byteLength (b64) {\n // base64 is 4/3 + up to two characters of the original data\n return (b64.length * 3 / 4) - placeHoldersCount(b64)\n}\n\nfunction toByteArray (b64) {\n var i, l, tmp, placeHolders, arr\n var len = b64.length\n placeHolders = placeHoldersCount(b64)\n\n arr = new Arr((len * 3 / 4) - placeHolders)\n\n // if there are placeholders, only get up to the last complete 4 chars\n l = placeHolders > 0 ? len - 4 : len\n\n var L = 0\n\n for (i = 0; i < l; i += 4) {\n tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]\n arr[L++] = (tmp >> 16) & 0xFF\n arr[L++] = (tmp >> 8) & 0xFF\n arr[L++] = tmp & 0xFF\n }\n\n if (placeHolders === 2) {\n tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[L++] = tmp & 0xFF\n } else if (placeHolders === 1) {\n tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[L++] = (tmp >> 8) & 0xFF\n arr[L++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var output = ''\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n output += lookup[tmp >> 2]\n output += lookup[(tmp << 4) & 0x3F]\n output += '=='\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + (uint8[len - 1])\n output += lookup[tmp >> 10]\n output += lookup[(tmp >> 4) & 0x3F]\n output += lookup[(tmp << 2) & 0x3F]\n output += '='\n }\n\n parts.push(output)\n\n return parts.join('')\n}\n","exports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = nBytes * 8 - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = nBytes * 8 - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n","const { set, get } = require('idb-keyval');\n\nmodule.exports = {\n readCache: get,\n writeCache: set,\n};\n","class Store {\r\n constructor(dbName = 'keyval-store', storeName = 'keyval') {\r\n this.storeName = storeName;\r\n this._dbp = new Promise((resolve, reject) => {\r\n const openreq = indexedDB.open(dbName, 1);\r\n openreq.onerror = () => reject(openreq.error);\r\n openreq.onsuccess = () => resolve(openreq.result);\r\n // First time setup: create an empty object store\r\n openreq.onupgradeneeded = () => {\r\n openreq.result.createObjectStore(storeName);\r\n };\r\n });\r\n }\r\n _withIDBStore(type, callback) {\r\n return this._dbp.then(db => new Promise((resolve, reject) => {\r\n const transaction = db.transaction(this.storeName, type);\r\n transaction.oncomplete = () => resolve();\r\n transaction.onabort = transaction.onerror = () => reject(transaction.error);\r\n callback(transaction.objectStore(this.storeName));\r\n }));\r\n }\r\n}\r\nlet store;\r\nfunction getDefaultStore() {\r\n if (!store)\r\n store = new Store();\r\n return store;\r\n}\r\nfunction get(key, store = getDefaultStore()) {\r\n let req;\r\n return store._withIDBStore('readonly', store => {\r\n req = store.get(key);\r\n }).then(() => req.result);\r\n}\r\nfunction set(key, value, store = getDefaultStore()) {\r\n return store._withIDBStore('readwrite', store => {\r\n store.put(value, key);\r\n });\r\n}\r\nfunction del(key, store = getDefaultStore()) {\r\n return store._withIDBStore('readwrite', store => {\r\n store.delete(key);\r\n });\r\n}\r\nfunction clear(store = getDefaultStore()) {\r\n return store._withIDBStore('readwrite', store => {\r\n store.clear();\r\n });\r\n}\r\nfunction keys(store = getDefaultStore()) {\r\n const keys = [];\r\n return store._withIDBStore('readonly', store => {\r\n // This would be store.getAllKeys(), but it isn't supported by Edge or Safari.\r\n // And openKeyCursor isn't supported by Safari.\r\n (store.openKeyCursor || store.openCursor).call(store).onsuccess = function () {\r\n if (!this.result)\r\n return;\r\n keys.push(this.result.key);\r\n this.result.continue();\r\n };\r\n }).then(() => keys);\r\n}\n\nexport { Store, get, set, del, clear, keys };\n","module.exports = (TessModule, buf) => {\n const ptr = TessModule._malloc(buf.length * Uint8Array.BYTES_PER_ELEMENT);\n TessModule.HEAPU8.set(buf, ptr);\n const pix = TessModule._pixReadMem(ptr, buf.length);\n if (TessModule.getValue(pix + (7 * 4), 'i32') === 0) {\n /*\n * Set a yres default value to prevent warning from tesseract\n * See kMinCredibleResolution in tesseract/src/ccstruct/publictypes.h\n */\n TessModule.setValue(pix + (7 * 4), 70, 'i32');\n }\n const [w, h, d, spp, wpl, refcount, xres, yres, informat, special] = Array(10).fill(0)\n .map((v, idx) => (\n TessModule.getValue(pix + (idx * 4), 'i32')\n ));\n return {\n w,\n h,\n d,\n spp,\n wpl,\n refcount,\n xres,\n yres,\n informat,\n special,\n data: pix,\n };\n};\n","// the generated HOCR is excessively indented, so\n// we get rid of that indentation\n\nconst deindent = (html) => {\n const lines = html.split('\\n');\n if (lines[0].substring(0, 2) === ' ') {\n for (let i = 0; i < lines.length; i += 1) {\n if (lines[i].substring(0, 2) === ' ') {\n lines[i] = lines[i].slice(2);\n }\n }\n }\n return lines.join('\\n');\n};\n\nmodule.exports = (Module, base) => {\n const ri = base.GetIterator();\n const blocks = [];\n let block;\n let para;\n let textline;\n let word;\n let symbol;\n\n const enumToString = (value, prefix) => (\n Object.keys(Module)\n .filter(e => (e.substr(0, prefix.length + 1) === `${prefix}_`))\n .filter(e => Module[e] === value)\n .map(e => e.slice(prefix.length + 1))[0]\n );\n\n ri.Begin();\n do {\n if (ri.IsAtBeginningOf(Module.RIL_BLOCK)) {\n const poly = ri.BlockPolygon();\n let polygon = null;\n // BlockPolygon() returns null when automatic page segmentation is off\n if (Module.getPointer(poly) > 0) {\n const n = poly.get_n();\n const px = poly.get_x();\n const py = poly.get_y();\n polygon = [];\n for (let i = 0; i < n; i += 1) {\n polygon.push([px.getValue(i), py.getValue(i)]);\n }\n Module._ptaDestroy(Module.getPointer(poly));\n }\n\n block = {\n paragraphs: [],\n text: ri.GetUTF8Text(Module.RIL_BLOCK),\n confidence: ri.Confidence(Module.RIL_BLOCK),\n baseline: ri.getBaseline(Module.RIL_BLOCK),\n bbox: ri.getBoundingBox(Module.RIL_BLOCK),\n blocktype: enumToString(ri.BlockType(), 'PT'),\n polygon,\n };\n blocks.push(block);\n }\n if (ri.IsAtBeginningOf(Module.RIL_PARA)) {\n para = {\n lines: [],\n text: ri.GetUTF8Text(Module.RIL_PARA),\n confidence: ri.Confidence(Module.RIL_PARA),\n baseline: ri.getBaseline(Module.RIL_PARA),\n bbox: ri.getBoundingBox(Module.RIL_PARA),\n is_ltr: !!ri.ParagraphIsLtr(),\n };\n block.paragraphs.push(para);\n }\n if (ri.IsAtBeginningOf(Module.RIL_TEXTLINE)) {\n textline = {\n words: [],\n text: ri.GetUTF8Text(Module.RIL_TEXTLINE),\n confidence: ri.Confidence(Module.RIL_TEXTLINE),\n baseline: ri.getBaseline(Module.RIL_TEXTLINE),\n bbox: ri.getBoundingBox(Module.RIL_TEXTLINE),\n };\n para.lines.push(textline);\n }\n if (ri.IsAtBeginningOf(Module.RIL_WORD)) {\n const fontInfo = ri.getWordFontAttributes();\n const wordDir = ri.WordDirection();\n word = {\n symbols: [],\n choices: [],\n\n text: ri.GetUTF8Text(Module.RIL_WORD),\n confidence: ri.Confidence(Module.RIL_WORD),\n baseline: ri.getBaseline(Module.RIL_WORD),\n bbox: ri.getBoundingBox(Module.RIL_WORD),\n\n is_numeric: !!ri.WordIsNumeric(),\n in_dictionary: !!ri.WordIsFromDictionary(),\n direction: enumToString(wordDir, 'DIR'),\n language: ri.WordRecognitionLanguage(),\n\n is_bold: fontInfo.is_bold,\n is_italic: fontInfo.is_italic,\n is_underlined: fontInfo.is_underlined,\n is_monospace: fontInfo.is_monospace,\n is_serif: fontInfo.is_serif,\n is_smallcaps: fontInfo.is_smallcaps,\n font_size: fontInfo.pointsize,\n font_id: fontInfo.font_id,\n font_name: fontInfo.font_name,\n };\n const wc = new Module.WordChoiceIterator(ri);\n do {\n word.choices.push({\n text: wc.GetUTF8Text(),\n confidence: wc.Confidence(),\n });\n } while (wc.Next());\n Module.destroy(wc);\n textline.words.push(word);\n }\n\n // let image = null;\n // var pix = ri.GetBinaryImage(Module.RIL_SYMBOL)\n // var image = pix2array(pix);\n // // for some reason it seems that things stop working if you destroy pics\n // Module._pixDestroy(Module.getPointer(pix));\n if (ri.IsAtBeginningOf(Module.RIL_SYMBOL)) {\n symbol = {\n choices: [],\n image: null,\n text: ri.GetUTF8Text(Module.RIL_SYMBOL),\n confidence: ri.Confidence(Module.RIL_SYMBOL),\n baseline: ri.getBaseline(Module.RIL_SYMBOL),\n bbox: ri.getBoundingBox(Module.RIL_SYMBOL),\n is_superscript: !!ri.SymbolIsSuperscript(),\n is_subscript: !!ri.SymbolIsSubscript(),\n is_dropcap: !!ri.SymbolIsDropcap(),\n };\n word.symbols.push(symbol);\n const ci = new Module.ChoiceIterator(ri);\n do {\n symbol.choices.push({\n text: ci.GetUTF8Text(),\n confidence: ci.Confidence(),\n });\n } while (ci.Next());\n // Module.destroy(i);\n }\n } while (ri.Next(Module.RIL_SYMBOL));\n Module.destroy(ri);\n\n return {\n text: base.GetUTF8Text(),\n html: deindent(base.GetHOCRText()),\n confidence: base.MeanTextConf(),\n blocks,\n psm: enumToString(base.GetPageSegMode(), 'PSM'),\n oem: enumToString(base.oem(), 'OEM'),\n version: base.Version(),\n };\n};\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./node_modules/buffer/index.js","webpack:///(webpack)/buildin/global.js","webpack:///./src/browser/worker.js","webpack:///./src/common/worker.js","webpack:///./node_modules/tesseract.js-utils/src/index.browser.js","webpack:///./node_modules/tesseract.js-utils/src/common/browser/cache.js","webpack:///./node_modules/idb-keyval/dist/idb-keyval.mjs","webpack:///./node_modules/tesseract.js-utils/src/loadLang.js","webpack:///./node_modules/tesseract.js-utils/src/common/browser/fetch.js","webpack:///./node_modules/whatwg-fetch/fetch.js","webpack:///./node_modules/tesseract.js-utils/src/common/browser/gunzip.js","webpack:///./node_modules/zlibjs/bin/node-zlib.js","webpack:///./node_modules/process/browser.js","webpack:///./node_modules/base64-js/index.js","webpack:///./node_modules/ieee754/index.js","webpack:///./node_modules/isarray/index.js","webpack:///./node_modules/tesseract.js-utils/src/readImage.js","webpack:///./node_modules/bmp-js/index.js","webpack:///./node_modules/bmp-js/lib/encoder.js","webpack:///./node_modules/bmp-js/lib/decoder.js","webpack:///./node_modules/file-type/index.js","webpack:///./src/common/dump.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","global","base64","ieee754","isArray","kMaxLength","Buffer","TYPED_ARRAY_SUPPORT","createBuffer","that","length","RangeError","Uint8Array","__proto__","arg","encodingOrOffset","this","Error","allocUnsafe","from","TypeError","ArrayBuffer","array","byteOffset","byteLength","undefined","fromArrayLike","fromArrayBuffer","string","encoding","isEncoding","actual","write","slice","fromString","obj","isBuffer","len","checked","copy","buffer","val","type","data","fromObject","assertSize","size","toString","isView","loweredCase","utf8ToBytes","base64ToBytes","toLowerCase","swap","b","bidirectionalIndexOf","dir","isNaN","arrayIndexOf","indexOf","lastIndexOf","arr","indexSize","arrLength","valLength","String","read","buf","readUInt16BE","foundIndex","found","j","hexWrite","offset","Number","remaining","strLen","parsed","parseInt","substr","utf8Write","blitBuffer","asciiWrite","str","byteArray","push","charCodeAt","asciiToBytes","latin1Write","base64Write","ucs2Write","units","hi","lo","utf16leToBytes","base64Slice","start","end","fromByteArray","utf8Slice","Math","min","res","secondByte","thirdByte","fourthByte","tempCodePoint","firstByte","codePoint","bytesPerSequence","codePoints","MAX_ARGUMENTS_LENGTH","fromCharCode","apply","decodeCodePointsArray","SlowBuffer","alloc","INSPECT_MAX_BYTES","foo","subarray","e","typedArraySupport","poolSize","_augment","species","configurable","fill","allocUnsafeSlow","_isBuffer","compare","a","x","y","concat","list","pos","swap16","swap32","swap64","arguments","hexSlice","asciiSlice","latin1Slice","utf16leSlice","equals","inspect","max","match","join","target","thisStart","thisEnd","thisCopy","targetCopy","includes","isFinite","toJSON","Array","_arr","ret","out","toHex","bytes","checkOffset","ext","checkInt","objectWriteUInt16","littleEndian","objectWriteUInt32","checkIEEE754","writeFloat","noAssert","writeDouble","newBuf","sliceLen","readUIntLE","mul","readUIntBE","readUInt8","readUInt16LE","readUInt32LE","readUInt32BE","readIntLE","pow","readIntBE","readInt8","readInt16LE","readInt16BE","readInt32LE","readInt32BE","readFloatLE","readFloatBE","readDoubleLE","readDoubleBE","writeUIntLE","writeUIntBE","writeUInt8","floor","writeUInt16LE","writeUInt16BE","writeUInt32LE","writeUInt32BE","writeIntLE","limit","sub","writeIntBE","writeInt8","writeInt16LE","writeInt16BE","writeInt32LE","writeInt32BE","writeFloatLE","writeFloatBE","writeDoubleLE","writeDoubleBE","targetStart","set","code","INVALID_BASE64_RE","Infinity","leadSurrogate","toByteArray","trim","replace","stringtrim","base64clean","src","dst","g","Function","eval","window","workerUtils","addEventListener","dispatchHandlers","postMessage","setAdapter","getCore","req","TesseractCore","progress","status","importScripts","workerOptions","corePath","WebAssembly","TesseractCoreWASM","TesseractCoreASM","readImage","loadLang","dump","Module","base","latestJob","adapter","setImage","image","w","h","bytesPerPixel","pix","SetImage","SetRectangle","handleInit","MIN_MEMORY","options","lang","TOTAL_MEMORY","Core","[object Object]","percent","then","TessModule","TessBaseAPI","Promise","resolve","loadLanguage","langPath","langs","tessModule","langURI","packet","send","respond","jobId","action","reject","progressUpdate","Init","keys","forEach","SetVariable","ptr","Recognize","result","End","_free","handleRecognize","payload","SetPageSegMode","PSM_OSD_ONLY","results","OSResults","DetectOS","best","get_best_result","oid","get_orientation_id","sid","get_script_id","tesseract_script_id","script","get_unicharset","get_script_from_script_id","script_confidence","get_sconfidence","orientation_degrees","orientation_confidence","get_oconfidence","handleDetect","err","impl","cache","fetch","gunzip","del","readCache","writeCache","deleteCache","checkCache","path","v","__webpack_exports__","Store","clear","dbName","storeName","_dbp","openreq","indexedDB","open","onerror","error","onsuccess","onupgradeneeded","createObjectStore","callback","db","transaction","oncomplete","onabort","objectStore","store","getDefaultStore","_withIDBStore","put","delete","openKeyCursor","openCursor","continue","handleLang","dataPath","cachePath","cacheMethod","FS","mkdir","writeFile","all","split","map","catch","resp","arrayBuffer","loadAndGunzipFile","Headers","Request","Response","DOMException","support","searchParams","self","iterable","blob","Blob","formData","viewClasses","isArrayBufferView","normalizeName","test","normalizeValue","iteratorFor","items","iterator","next","shift","done","headers","append","header","getOwnPropertyNames","consumed","body","bodyUsed","fileReaderReady","reader","onload","readBlobAsArrayBuffer","FileReader","promise","readAsArrayBuffer","bufferClone","view","Body","_initBody","_bodyInit","_bodyText","isPrototypeOf","_bodyBlob","FormData","_bodyFormData","URLSearchParams","DataView","_bodyArrayBuffer","rejected","text","readAsText","chars","readArrayBufferAsText","decode","json","JSON","parse","oldValue","has","thisArg","values","entries","methods","input","method","upcased","url","credentials","signal","toUpperCase","referrer","form","decodeURIComponent","bodyInit","ok","statusText","clone","response","redirectStatuses","redirect","location","message","stack","constructor","init","request","aborted","xhr","XMLHttpRequest","abortXhr","abort","rawHeaders","getAllResponseHeaders","line","parts","responseURL","responseText","ontimeout","withCredentials","responseType","setRequestHeader","onreadystatechange","readyState","removeEventListener","polyfill","gunzipSync","process","q","B","Uint16Array","Uint32Array","G","index","f","k","I","finish","L","aa","ba","R","ca","ha","S","ia","ja","ka","T","POSITIVE_INFINITY","na","oa","F","lazy","compressionType","outputBuffer","outputIndex","getParent","pop","U","pa","NONE","X","qa","va","N","C","u","ra","M","z","Y","da","Fa","ea","Ga","la","Ha","Z","ma","E","Ia","D","qb","ta","ua","sa","O","A","fa","H","Ja","Ka","K","J","P","Q","Na","ga","wa","Oa","Pa","Qa","Ra","La","Ma","xa","ya","za","Aa","Ba","flags","filename","comment","deflateOptions","fname","Ca","fcomment","Da","fhcrc","Ea","Date","now","Sa","V","Ta","bufferSize","bufferType","resize","Ua","W","Va","Wa","Xa","Ya","$","ib","Za","$a","ab","bb","cb","eb","fb","gb","hb","kb","lb","jb","mb","nb","ob","verify","pb","rb","sb","ub","Bb","wb","noBuffer","yb","Ab","LOG2E","log","deflate","nextTick","deflateSync","inflate","inflateSync","gzip","gzipSync","cachedSetTimeout","cachedClearTimeout","defaultSetTimout","defaultClearTimeout","runTimeout","fun","setTimeout","clearTimeout","currentQueue","queue","draining","queueIndex","cleanUpNextTick","drainQueue","timeout","run","marker","runClearTimeout","Item","noop","args","title","browser","env","argv","version","versions","on","addListener","once","off","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","listeners","binding","cwd","chdir","umask","b64","placeHoldersCount","tmp","placeHolders","Arr","revLookup","uint8","extraBytes","output","len2","encodeChunk","lookup","num","isLE","mLen","nBytes","eLen","eMax","eBias","nBits","NaN","rt","abs","LN2","bmp","fileType","iBuf","mime","bmpBuf","_malloc","BYTES_PER_ELEMENT","HEAPU8","width","height","_pixReadMem","getValue","setValue","idx","encode","BmpEncoder","imgData","rgbSize","headerInfoSize","flag","reserved","fileSize","planes","bitPP","compress","hr","vr","colors","importantColors","tempBuffer","rowBytes","fillOffset","quality","BmpDecoder","is_with_alpha","bottom_up","parseHeader","parseRGBA","headerSize","rawSize","palette","blue","green","red","quad","bitn","bit1","xlen","ceil","rgb","bit4","lines","low_nibble","setPixelData","rgbIndex","before","after","bit8","bit15","dif_w","_1_5","alpha","bit16","maskRed","maskGreen","maskBlue","mask0","bit24","bit32","getData","bmpData","toBytes","xpiZipFilename","oxmlContentTypes","oxmlRels","readUInt64LE","check","assign","mask","checkString","findNextZipHeaderIndex","startAt","findIndex","el","zipHeaderIndex","oxmlFound","sliced","idPos","docTypePos","findDocType","every","objectSize","ri","GetIterator","blocks","block","para","textline","word","symbol","enumToString","prefix","filter","Begin","IsAtBeginningOf","RIL_BLOCK","poly","BlockPolygon","polygon","getPointer","get_n","px","get_x","py","get_y","_ptaDestroy","paragraphs","GetUTF8Text","confidence","Confidence","baseline","getBaseline","bbox","getBoundingBox","blocktype","BlockType","RIL_PARA","is_ltr","ParagraphIsLtr","RIL_TEXTLINE","words","RIL_WORD","fontInfo","getWordFontAttributes","wordDir","WordDirection","symbols","choices","is_numeric","WordIsNumeric","in_dictionary","WordIsFromDictionary","direction","language","WordRecognitionLanguage","is_bold","is_italic","is_underlined","is_monospace","is_serif","is_smallcaps","font_size","pointsize","font_id","font_name","wc","WordChoiceIterator","Next","destroy","RIL_SYMBOL","is_superscript","SymbolIsSuperscript","is_subscript","SymbolIsSubscript","is_dropcap","SymbolIsDropcap","ci","ChoiceIterator","html","substring","deindent","GetHOCRText","MeanTextConf","psm","GetPageSegMode","oem","Version"],"mappings":"aACA,IAAAA,EAAA,GAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,GAAA,CACAG,EAAAH,EACAI,GAAA,EACAH,QAAA,IAUA,OANAI,EAAAL,GAAAM,KAAAJ,EAAAD,QAAAC,IAAAD,QAAAF,GAGAG,EAAAE,GAAA,EAGAF,EAAAD,QAKAF,EAAAQ,EAAAF,EAGAN,EAAAS,EAAAV,EAGAC,EAAAU,EAAA,SAAAR,EAAAS,EAA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EAAAjlB,KAAA,OA0IAwsB,CAAAhmB,EAAAimB,eACArD,WAAA5iB,EAAAkmB,eACA9E,SACA+E,IAAAzE,EAAA1hB,EAAAomB,iBAAA,OACAC,IAAA3E,EAAA1hB,EAAAqmB,MAAA,OACAvN,QAAA9Y,EAAAsmB","file":"worker.min.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 2);\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\nvar isArray = require('isarray')\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return ''\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || Function(\"return this\")() || (1, eval)(\"this\");\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","const workerUtils = require('../common/worker');\n\nglobal.addEventListener('message', ({ data }) => {\n workerUtils.dispatchHandlers(data, obj => postMessage(obj));\n});\n\nworkerUtils.setAdapter({\n getCore: (req, res) => {\n if (!global.TesseractCore) {\n res.progress({ status: 'loading tesseract core', progress: 0 });\n global.importScripts(req.workerOptions.corePath);\n global.TesseractCore = typeof WebAssembly === 'object' ? global.TesseractCoreWASM : global.TesseractCoreASM;\n res.progress({ status: 'loading tesseract core', progress: 1 });\n }\n return global.TesseractCore;\n },\n});\n","const { readImage, loadLang } = require('tesseract.js-utils');\nconst dump = require('./dump');\n\nlet Module;\nlet base;\nlet latestJob;\nlet adapter = {};\n\nconst setImage = (image) => {\n const {\n w, h, bytesPerPixel, data, pix,\n } = readImage(Module, Array.from(image));\n\n if (data === null) {\n base.SetImage(pix);\n } else {\n base.SetImage(data, w, h, bytesPerPixel, w * bytesPerPixel);\n }\n base.SetRectangle(0, 0, w, h);\n return data;\n};\n\nconst handleInit = (req, res) => {\n let MIN_MEMORY = 100663296;\n\n if (['chi_sim', 'chi_tra', 'jpn'].includes(req.options.lang)) {\n MIN_MEMORY = 167772160;\n }\n\n if (!Module || Module.TOTAL_MEMORY < MIN_MEMORY) {\n const Core = adapter.getCore(req, res);\n\n res.progress({ status: 'initializing tesseract', progress: 0 });\n\n return Core({\n // TOTAL_MEMORY: MIN_MEMORY,\n TesseractProgress(percent) {\n latestJob.progress({ status: 'recognizing text', progress: Math.max(0, (percent - 30) / 70) });\n },\n })\n .then((TessModule) => {\n Module = TessModule;\n base = new Module.TessBaseAPI();\n res.progress({ status: 'initialized tesseract', progress: 1 });\n });\n }\n\n return Promise.resolve();\n};\n\nconst loadLanguage = (req) => {\n const { options: { lang }, workerOptions: { langPath } } = req;\n return loadLang({\n langs: lang,\n tessModule: Module,\n langURI: langPath,\n });\n};\n\nconst handleRecognize = (req, res) => (\n handleInit(req, res)\n .then(() => (\n loadLanguage(req)\n .then(() => {\n const { options } = req;\n const progressUpdate = (progress) => {\n res.progress({ status: 'initializing api', progress });\n };\n progressUpdate(0);\n base.Init(null, options.lang);\n progressUpdate(0.3);\n Object.keys(options).forEach((key) => {\n base.SetVariable(key, options[key]);\n });\n progressUpdate(0.6);\n const ptr = setImage(req.image);\n progressUpdate(1);\n base.Recognize(null);\n const result = dump(Module, base);\n base.End();\n Module._free(ptr);\n res.resolve(result);\n })\n ))\n);\n\n\nconst handleDetect = (req, res) => (\n handleInit(req, res)\n .then(() => (\n loadLanguage({ ...req, options: { ...req.options, lang: 'osd' } })\n .then(() => {\n base.Init(null, 'osd');\n base.SetPageSegMode(Module.PSM_OSD_ONLY);\n\n const ptr = setImage(req.image);\n const results = new Module.OSResults();\n\n if (!base.DetectOS(results)) {\n base.End();\n Module._free(ptr);\n res.reject('Failed to detect OS');\n } else {\n const best = results.get_best_result();\n const oid = best.get_orientation_id();\n const sid = best.get_script_id();\n\n base.End();\n Module._free(ptr);\n\n res.resolve({\n tesseract_script_id: sid,\n script: results.get_unicharset().get_script_from_script_id(sid),\n script_confidence: best.get_sconfidence(),\n orientation_degrees: [0, 270, 180, 90][oid],\n orientation_confidence: best.get_oconfidence(),\n });\n }\n })\n ))\n);\n\nexports.dispatchHandlers = (packet, send) => {\n const respond = (status, data) => {\n send({\n jobId: packet.jobId,\n status,\n action: packet.action,\n data,\n });\n };\n respond.resolve = respond.bind(this, 'resolve');\n respond.reject = respond.bind(this, 'reject');\n respond.progress = respond.bind(this, 'progress');\n\n latestJob = respond;\n\n try {\n if (packet.action === 'recognize') {\n handleRecognize(packet.payload, respond);\n } else if (packet.action === 'detect') {\n handleDetect(packet.payload, respond);\n }\n } catch (err) {\n // Prepare exception to travel through postMessage\n respond.reject(err.toString());\n }\n};\n\nexports.setAdapter = (impl) => {\n adapter = impl;\n};\n","const cache = require('./common/browser/cache');\n\nmodule.exports = {\n loadLang: require('./loadLang')({\n fetch: require('./common/browser/fetch'),\n gunzip: require('./common/browser/gunzip'),\n ...cache,\n }),\n readImage: require('./readImage'),\n cache,\n};\n","const { set, get, del } = require('idb-keyval');\n\nmodule.exports = {\n readCache: get,\n writeCache: set,\n deleteCache: del,\n checkCache: path => (\n get(path)\n .then(v => typeof v !== 'undefined')\n ),\n};\n","class Store {\r\n constructor(dbName = 'keyval-store', storeName = 'keyval') {\r\n this.storeName = storeName;\r\n this._dbp = new Promise((resolve, reject) => {\r\n const openreq = indexedDB.open(dbName, 1);\r\n openreq.onerror = () => reject(openreq.error);\r\n openreq.onsuccess = () => resolve(openreq.result);\r\n // First time setup: create an empty object store\r\n openreq.onupgradeneeded = () => {\r\n openreq.result.createObjectStore(storeName);\r\n };\r\n });\r\n }\r\n _withIDBStore(type, callback) {\r\n return this._dbp.then(db => new Promise((resolve, reject) => {\r\n const transaction = db.transaction(this.storeName, type);\r\n transaction.oncomplete = () => resolve();\r\n transaction.onabort = transaction.onerror = () => reject(transaction.error);\r\n callback(transaction.objectStore(this.storeName));\r\n }));\r\n }\r\n}\r\nlet store;\r\nfunction getDefaultStore() {\r\n if (!store)\r\n store = new Store();\r\n return store;\r\n}\r\nfunction get(key, store = getDefaultStore()) {\r\n let req;\r\n return store._withIDBStore('readonly', store => {\r\n req = store.get(key);\r\n }).then(() => req.result);\r\n}\r\nfunction set(key, value, store = getDefaultStore()) {\r\n return store._withIDBStore('readwrite', store => {\r\n store.put(value, key);\r\n });\r\n}\r\nfunction del(key, store = getDefaultStore()) {\r\n return store._withIDBStore('readwrite', store => {\r\n store.delete(key);\r\n });\r\n}\r\nfunction clear(store = getDefaultStore()) {\r\n return store._withIDBStore('readwrite', store => {\r\n store.clear();\r\n });\r\n}\r\nfunction keys(store = getDefaultStore()) {\r\n const keys = [];\r\n return store._withIDBStore('readonly', store => {\r\n // This would be store.getAllKeys(), but it isn't supported by Edge or Safari.\r\n // And openKeyCursor isn't supported by Safari.\r\n (store.openKeyCursor || store.openCursor).call(store).onsuccess = function () {\r\n if (!this.result)\r\n return;\r\n keys.push(this.result.key);\r\n this.result.continue();\r\n };\r\n }).then(() => keys);\r\n}\n\nexport { Store, get, set, del, clear, keys };\n","const handleLang = modules => ({\n tessModule,\n dataPath,\n cachePath,\n cacheMethod,\n lang,\n}) => (data) => {\n if (tessModule) {\n if (dataPath) {\n try {\n tessModule.FS.mkdir(dataPath);\n } catch (err) {\n // TODO: Do some error handling here.\n }\n }\n tessModule.FS.writeFile(`${dataPath || '.'}/${lang}.traineddata`, data);\n }\n if (['write', 'refresh', undefined].includes(cacheMethod)) {\n return modules.writeCache(`${cachePath || '.'}/${lang}.traineddata`, data)\n .then(() => data);\n }\n\n return data;\n};\n\nconst loadAndGunzipFile = modules => ({\n langURI,\n cachePath,\n cacheMethod,\n ...options\n}) => (lang) => {\n let { readCache } = modules;\n if (['refresh', 'none'].includes(cacheMethod)) {\n readCache = () => Promise.resolve();\n }\n\n return readCache(`${cachePath || '.'}/${lang}.traineddata`)\n .then((data) => {\n if (typeof data === 'undefined') {\n return Promise.reject();\n }\n return handleLang(modules)({\n cachePath, cacheMethod, lang, ...options,\n })(data);\n })\n .catch(() => (\n // console.log(`Download ${lang}.traineddata.gz from ${langURI}/${lang}.traineddata.gz...`);\n modules.fetch(`${langURI}/${lang}.traineddata.gz`)\n .then(resp => resp.arrayBuffer())\n .then(buf => modules.gunzip(new Uint8Array(buf)))\n .then(handleLang(modules)({\n cachePath, cacheMethod, lang, ...options,\n }))\n ));\n};\n\n/**\n * Load language(s) from local cache, download from remote if not in cache.\n *\n * All params below actually store in a object.\n *\n * ex:\n * loadLang({ langs, tesssModule, ... });\n *\n * @name loadLang\n * @function\n * @param {string} langs - langs to load, use '+' for multiple languages, ex: eng+chi_tra\n * @param {object} tessModule - TesseractModule\n * @param {string} langURI - prefix URI for downloading lang file\n * @param {string} cachePath - path to find cache\n * @param {string} dataPath - path to store data in mem\n * @param {string} cacheMethod - method of cache invaliation, should one of following options:\n * write: read cache and write back (default option)\n * readOnly: read cache and not to write back (if cache does not exist, it is the same as none)\n * refresh: not to read cache and write back\n * none: not to read cache and not to write back\n *\n */\nmodule.exports = modules => ({\n langs,\n ...options\n}) => (\n Promise\n .all(langs.split('+').map(loadAndGunzipFile(modules)(options)))\n);\n","const { fetch } = require('whatwg-fetch');\n\nmodule.exports = fetch;\n","var support = {\n searchParams: 'URLSearchParams' in self,\n iterable: 'Symbol' in self && 'iterator' in Symbol,\n blob:\n 'FileReader' in self &&\n 'Blob' in self &&\n (function() {\n try {\n new Blob()\n return true\n } catch (e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n}\n\nfunction isDataView(obj) {\n return obj && DataView.prototype.isPrototypeOf(obj)\n}\n\nif (support.arrayBuffer) {\n var viewClasses = [\n '[object Int8Array]',\n '[object Uint8Array]',\n '[object Uint8ClampedArray]',\n '[object Int16Array]',\n '[object Uint16Array]',\n '[object Int32Array]',\n '[object Uint32Array]',\n '[object Float32Array]',\n '[object Float64Array]'\n ]\n\n var isArrayBufferView =\n ArrayBuffer.isView ||\n function(obj) {\n return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1\n }\n}\n\nfunction normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n}\n\nfunction normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n}\n\n// Build a destructive iterator for the value list\nfunction iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n}\n\nexport function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n } else if (Array.isArray(headers)) {\n headers.forEach(function(header) {\n this.append(header[0], header[1])\n }, this)\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n}\n\nHeaders.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var oldValue = this.map[name]\n this.map[name] = oldValue ? oldValue + ', ' + value : value\n}\n\nHeaders.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n}\n\nHeaders.prototype.get = function(name) {\n name = normalizeName(name)\n return this.has(name) ? this.map[name] : null\n}\n\nHeaders.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n}\n\nHeaders.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = normalizeValue(value)\n}\n\nHeaders.prototype.forEach = function(callback, thisArg) {\n for (var name in this.map) {\n if (this.map.hasOwnProperty(name)) {\n callback.call(thisArg, this.map[name], name, this)\n }\n }\n}\n\nHeaders.prototype.keys = function() {\n var items = []\n this.forEach(function(value, name) {\n items.push(name)\n })\n return iteratorFor(items)\n}\n\nHeaders.prototype.values = function() {\n var items = []\n this.forEach(function(value) {\n items.push(value)\n })\n return iteratorFor(items)\n}\n\nHeaders.prototype.entries = function() {\n var items = []\n this.forEach(function(value, name) {\n items.push([name, value])\n })\n return iteratorFor(items)\n}\n\nif (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries\n}\n\nfunction consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n}\n\nfunction fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n}\n\nfunction readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n var promise = fileReaderReady(reader)\n reader.readAsArrayBuffer(blob)\n return promise\n}\n\nfunction readBlobAsText(blob) {\n var reader = new FileReader()\n var promise = fileReaderReady(reader)\n reader.readAsText(blob)\n return promise\n}\n\nfunction readArrayBufferAsText(buf) {\n var view = new Uint8Array(buf)\n var chars = new Array(view.length)\n\n for (var i = 0; i < view.length; i++) {\n chars[i] = String.fromCharCode(view[i])\n }\n return chars.join('')\n}\n\nfunction bufferClone(buf) {\n if (buf.slice) {\n return buf.slice(0)\n } else {\n var view = new Uint8Array(buf.byteLength)\n view.set(new Uint8Array(buf))\n return view.buffer\n }\n}\n\nfunction Body() {\n this.bodyUsed = false\n\n this._initBody = function(body) {\n this._bodyInit = body\n if (!body) {\n this._bodyText = ''\n } else if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString()\n } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n this._bodyArrayBuffer = bufferClone(body.buffer)\n // IE 10-11 can't handle a DataView body.\n this._bodyInit = new Blob([this._bodyArrayBuffer])\n } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n this._bodyArrayBuffer = bufferClone(body)\n } else {\n this._bodyText = body = Object.prototype.toString.call(body)\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(new Blob([this._bodyArrayBuffer]))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n if (this._bodyArrayBuffer) {\n return consumed(this) || Promise.resolve(this._bodyArrayBuffer)\n } else {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n }\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n}\n\n// HTTP methods whose capitalization should be normalized\nvar methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\nfunction normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return methods.indexOf(upcased) > -1 ? upcased : method\n}\n\nexport function Request(input, options) {\n options = options || {}\n var body = options.body\n\n if (input instanceof Request) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n this.signal = input.signal\n if (!body && input._bodyInit != null) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = String(input)\n }\n\n this.credentials = options.credentials || this.credentials || 'same-origin'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.signal = options.signal || this.signal\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n}\n\nRequest.prototype.clone = function() {\n return new Request(this, {body: this._bodyInit})\n}\n\nfunction decode(body) {\n var form = new FormData()\n body\n .trim()\n .split('&')\n .forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n}\n\nfunction parseHeaders(rawHeaders) {\n var headers = new Headers()\n // Replace instances of \\r\\n and \\n followed by at least one space or horizontal tab with a space\n // https://tools.ietf.org/html/rfc7230#section-3.2\n var preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, ' ')\n preProcessedHeaders.split(/\\r?\\n/).forEach(function(line) {\n var parts = line.split(':')\n var key = parts.shift().trim()\n if (key) {\n var value = parts.join(':').trim()\n headers.append(key, value)\n }\n })\n return headers\n}\n\nBody.call(Request.prototype)\n\nexport function Response(bodyInit, options) {\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status === undefined ? 200 : options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = 'statusText' in options ? options.statusText : 'OK'\n this.headers = new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n}\n\nBody.call(Response.prototype)\n\nResponse.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n}\n\nResponse.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n}\n\nvar redirectStatuses = [301, 302, 303, 307, 308]\n\nResponse.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n}\n\nexport var DOMException = self.DOMException\ntry {\n new DOMException()\n} catch (err) {\n DOMException = function(message, name) {\n this.message = message\n this.name = name\n var error = Error(message)\n this.stack = error.stack\n }\n DOMException.prototype = Object.create(Error.prototype)\n DOMException.prototype.constructor = DOMException\n}\n\nexport function fetch(input, init) {\n return new Promise(function(resolve, reject) {\n var request = new Request(input, init)\n\n if (request.signal && request.signal.aborted) {\n return reject(new DOMException('Aborted', 'AbortError'))\n }\n\n var xhr = new XMLHttpRequest()\n\n function abortXhr() {\n xhr.abort()\n }\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders() || '')\n }\n options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL')\n var body = 'response' in xhr ? xhr.response : xhr.responseText\n resolve(new Response(body, options))\n }\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.ontimeout = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.onabort = function() {\n reject(new DOMException('Aborted', 'AbortError'))\n }\n\n xhr.open(request.method, request.url, true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n } else if (request.credentials === 'omit') {\n xhr.withCredentials = false\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob'\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n\n if (request.signal) {\n request.signal.addEventListener('abort', abortXhr)\n\n xhr.onreadystatechange = function() {\n // DONE (success or failure)\n if (xhr.readyState === 4) {\n request.signal.removeEventListener('abort', abortXhr)\n }\n }\n }\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n}\n\nfetch.polyfill = true\n\nif (!self.fetch) {\n self.fetch = fetch\n self.Headers = Headers\n self.Request = Request\n self.Response = Response\n}\n","module.exports = require('zlibjs').gunzipSync;\n","/** @license zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License */(function() {'use strict';function q(b){throw b;}var t=void 0,v=!0;var B=\"undefined\"!==typeof Uint8Array&&\"undefined\"!==typeof Uint16Array&&\"undefined\"!==typeof Uint32Array&&\"undefined\"!==typeof DataView;function G(b,a){this.index=\"number\"===typeof a?a:0;this.m=0;this.buffer=b instanceof(B?Uint8Array:Array)?b:new (B?Uint8Array:Array)(32768);2*this.buffer.length<=this.index&&q(Error(\"invalid index\"));this.buffer.length<=this.index&&this.f()}G.prototype.f=function(){var b=this.buffer,a,c=b.length,d=new (B?Uint8Array:Array)(c<<1);if(B)d.set(b);else for(a=0;a>>8&255]<<16|I[b>>>16&255]<<8|I[b>>>24&255])>>32-a:I[b]>>8-a);if(8>a+f)g=g<>a-k-1&1,8===++f&&(f=0,d[e++]=I[g],g=0,e===d.length&&(d=this.f()));d[e]=g;this.buffer=d;this.m=f;this.index=e};G.prototype.finish=function(){var b=this.buffer,a=this.index,c;0L;++L){for(var R=L,ba=R,ca=7,R=R>>>1;R;R>>>=1)ba<<=1,ba|=R&1,--ca;aa[L]=(ba<>>0}var I=aa;function ha(b,a,c){var d,e=\"number\"===typeof a?a:a=0,f=\"number\"===typeof c?c:b.length;d=-1;for(e=f&7;e--;++a)d=d>>>8^S[(d^b[a])&255];for(e=f>>3;e--;a+=8)d=d>>>8^S[(d^b[a])&255],d=d>>>8^S[(d^b[a+1])&255],d=d>>>8^S[(d^b[a+2])&255],d=d>>>8^S[(d^b[a+3])&255],d=d>>>8^S[(d^b[a+4])&255],d=d>>>8^S[(d^b[a+5])&255],d=d>>>8^S[(d^b[a+6])&255],d=d>>>8^S[(d^b[a+7])&255];return(d^4294967295)>>>0}\nvar ia=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,\n2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,\n2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,\n2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,\n3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,\n936918E3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],S=B?new Uint32Array(ia):ia;function ja(){};function ka(b){this.buffer=new (B?Uint16Array:Array)(2*b);this.length=0}ka.prototype.getParent=function(b){return 2*((b-2)/4|0)};ka.prototype.push=function(b,a){var c,d,e=this.buffer,f;c=this.length;e[this.length++]=a;for(e[this.length++]=b;0e[d])f=e[c],e[c]=e[d],e[d]=f,f=e[c+1],e[c+1]=e[d+1],e[d+1]=f,c=d;else break;return this.length};\nka.prototype.pop=function(){var b,a,c=this.buffer,d,e,f;a=c[0];b=c[1];this.length-=2;c[0]=c[this.length];c[1]=c[this.length+1];for(f=0;;){e=2*f+2;if(e>=this.length)break;e+2c[e]&&(e+=2);if(c[e]>c[f])d=c[f],c[f]=c[e],c[e]=d,d=c[f+1],c[f+1]=c[e+1],c[e+1]=d;else break;f=e}return{index:b,value:a,length:this.length}};function T(b){var a=b.length,c=0,d=Number.POSITIVE_INFINITY,e,f,g,k,h,m,r,p,l,n;for(p=0;pc&&(c=b[p]),b[p]>=1;n=g<<16|p;for(l=m;lU;U++)switch(v){case 143>=U:qa.push([U+48,8]);break;case 255>=U:qa.push([U-144+400,9]);break;case 279>=U:qa.push([U-256+0,7]);break;case 287>=U:qa.push([U-280+192,8]);break;default:q(\"invalid literal: \"+U)}\nna.prototype.h=function(){var b,a,c,d,e=this.input;switch(this.k){case 0:c=0;for(d=e.length;c>>8&255;l[n++]=m&255;l[n++]=m>>>8&255;if(B)l.set(f,n),n+=f.length,l=l.subarray(0,n);else{r=0;for(p=f.length;rA)for(;0A?A:138,F>A-3&&F=F?(J[H++]=17,J[H++]=F-3,P[17]++):(J[H++]=18,J[H++]=F-11,P[18]++),A-=F;else if(J[H++]=K[y],P[K[y]]++,A--,3>A)for(;0A?A:6,F>A-3&&FE;E++)ta[E]=la[qb[E]];for(Y=19;4=a:return[265,a-11,1];case 14>=a:return[266,a-13,1];case 16>=a:return[267,a-15,1];case 18>=a:return[268,a-17,1];case 22>=a:return[269,a-19,2];case 26>=a:return[270,a-23,2];case 30>=a:return[271,a-27,2];case 34>=a:return[272,\na-31,2];case 42>=a:return[273,a-35,3];case 50>=a:return[274,a-43,3];case 58>=a:return[275,a-51,3];case 66>=a:return[276,a-59,3];case 82>=a:return[277,a-67,4];case 98>=a:return[278,a-83,4];case 114>=a:return[279,a-99,4];case 130>=a:return[280,a-115,4];case 162>=a:return[281,a-131,5];case 194>=a:return[282,a-163,5];case 226>=a:return[283,a-195,5];case 257>=a:return[284,a-227,5];case 258===a:return[285,a-258,0];default:q(\"invalid length: \"+a)}}var a=[],c,d;for(c=3;258>=c;c++)d=b(c),a[c]=d[2]<<24|d[1]<<\n16|d[0];return a}(),ya=B?new Uint32Array(xa):xa;\nfunction ra(b,a){function c(a,c){var b=a.N,d=[],f=0,e;e=ya[a.length];d[f++]=e&65535;d[f++]=e>>16&255;d[f++]=e>>24;var g;switch(v){case 1===b:g=[0,b-1,0];break;case 2===b:g=[1,b-2,0];break;case 3===b:g=[2,b-3,0];break;case 4===b:g=[3,b-4,0];break;case 6>=b:g=[4,b-5,1];break;case 8>=b:g=[5,b-7,1];break;case 12>=b:g=[6,b-9,2];break;case 16>=b:g=[7,b-13,2];break;case 24>=b:g=[8,b-17,3];break;case 32>=b:g=[9,b-25,3];break;case 48>=b:g=[10,b-33,4];break;case 64>=b:g=[11,b-49,4];break;case 96>=b:g=[12,b-\n65,5];break;case 128>=b:g=[13,b-97,5];break;case 192>=b:g=[14,b-129,6];break;case 256>=b:g=[15,b-193,6];break;case 384>=b:g=[16,b-257,7];break;case 512>=b:g=[17,b-385,7];break;case 768>=b:g=[18,b-513,8];break;case 1024>=b:g=[19,b-769,8];break;case 1536>=b:g=[20,b-1025,9];break;case 2048>=b:g=[21,b-1537,9];break;case 3072>=b:g=[22,b-2049,10];break;case 4096>=b:g=[23,b-3073,10];break;case 6144>=b:g=[24,b-4097,11];break;case 8192>=b:g=[25,b-6145,11];break;case 12288>=b:g=[26,b-8193,12];break;case 16384>=\nb:g=[27,b-12289,12];break;case 24576>=b:g=[28,b-16385,13];break;case 32768>=b:g=[29,b-24577,13];break;default:q(\"invalid distance\")}e=g;d[f++]=e[0];d[f++]=e[1];d[f++]=e[2];var h,k;h=0;for(k=d.length;h=f;)u[f++]=0;for(f=0;29>=f;)w[f++]=0}u[256]=1;d=0;for(e=a.length;d=e){p&&c(p,-1);f=0;for(g=e-d;fg&&a+gf&&(e=d,f=g);if(258===g)break}return new va(f,a-e)}\nfunction sa(b,a){var c=b.length,d=new ka(572),e=new (B?Uint8Array:Array)(c),f,g,k,h,m;if(!B)for(h=0;h2*e[n-1]+f[n]&&(e[n]=2*e[n-1]+f[n]),k[n]=Array(e[n]),h[n]=Array(e[n]);for(l=0;lb[l]?(k[n][s]=u,h[n][s]=a,w+=2):(k[n][s]=b[l],h[n][s]=l,++l);m[n]=0;1===f[n]&&d(n)}return g}\nfunction ua(b){var a=new (B?Uint16Array:Array)(b.length),c=[],d=[],e=0,f,g,k,h;f=0;for(g=b.length;f>>=1}return a};function Ba(b,a){this.input=b;this.b=this.c=0;this.g={};a&&(a.flags&&(this.g=a.flags),\"string\"===typeof a.filename&&(this.filename=a.filename),\"string\"===typeof a.comment&&(this.w=a.comment),a.deflateOptions&&(this.l=a.deflateOptions));this.l||(this.l={})}\nBa.prototype.h=function(){var b,a,c,d,e,f,g,k,h=new (B?Uint8Array:Array)(32768),m=0,r=this.input,p=this.c,l=this.filename,n=this.w;h[m++]=31;h[m++]=139;h[m++]=8;b=0;this.g.fname&&(b|=Ca);this.g.fcomment&&(b|=Da);this.g.fhcrc&&(b|=Ea);h[m++]=b;a=(Date.now?Date.now():+new Date)/1E3|0;h[m++]=a&255;h[m++]=a>>>8&255;h[m++]=a>>>16&255;h[m++]=a>>>24&255;h[m++]=0;h[m++]=Sa;if(this.g.fname!==t){g=0;for(k=l.length;g>>8&255),h[m++]=f&255;h[m++]=0}if(this.g.comment){g=\n0;for(k=n.length;g>>8&255),h[m++]=f&255;h[m++]=0}this.g.fhcrc&&(c=ha(h,0,m)&65535,h[m++]=c&255,h[m++]=c>>>8&255);this.l.outputBuffer=h;this.l.outputIndex=m;e=new na(r,this.l);h=e.h();m=e.b;B&&(m+8>h.buffer.byteLength?(this.a=new Uint8Array(m+8),this.a.set(new Uint8Array(h.buffer)),h=this.a):h=new Uint8Array(h.buffer));d=ha(r,t,t);h[m++]=d&255;h[m++]=d>>>8&255;h[m++]=d>>>16&255;h[m++]=d>>>24&255;k=r.length;h[m++]=k&255;h[m++]=k>>>8&255;h[m++]=k>>>16&255;h[m++]=\nk>>>24&255;this.c=p;B&&m>>=1;switch(b){case 0:var a=this.input,c=this.c,d=this.a,e=this.b,f=a.length,g=t,k=t,h=d.length,m=t;this.e=this.j=0;c+1>=f&&q(Error(\"invalid uncompressed block header: LEN\"));g=a[c++]|a[c++]<<8;c+1>=f&&q(Error(\"invalid uncompressed block header: NLEN\"));k=a[c++]|a[c++]<<8;g===~k&&q(Error(\"invalid uncompressed block header: length verify\"));c+g>a.length&&q(Error(\"input buffer is broken\"));switch(this.q){case Ua:for(;e+g>d.length;){m=\nh-e;g-=m;if(B)d.set(a.subarray(c,c+m),e),e+=m,c+=m;else for(;m--;)d[e++]=a[c++];this.b=e;d=this.f();e=this.b}break;case Ta:for(;e+g>d.length;)d=this.f({B:2});break;default:q(Error(\"invalid inflate mode\"))}if(B)d.set(a.subarray(c,c+g),e),e+=g,c+=g;else for(;g--;)d[e++]=a[c++];this.c=c;this.b=e;this.a=d;break;case 1:this.r(Va,Wa);break;case 2:for(var r=W(this,5)+257,p=W(this,5)+1,l=W(this,4)+4,n=new (B?Uint8Array:Array)(Xa.length),s=t,u=t,w=t,C=t,x=t,D=t,M=t,z=t,N=t,z=0;z=$?8:255>=$?9:279>=$?7:8;var Va=T(hb),jb=new (B?Uint8Array:Array)(30),kb,lb;kb=0;for(lb=jb.length;kb=g&&q(Error(\"input buffer is broken\")),c|=e[f++]<>>a;b.e=d-a;b.c=f;return k}\nfunction Ya(b,a){for(var c=b.j,d=b.e,e=b.input,f=b.c,g=e.length,k=a[0],h=a[1],m,r;d=g);)c|=e[f++]<>>16;r>d&&q(Error(\"invalid code length: \"+r));b.j=c>>r;b.e=d-r;b.c=f;return m&65535}\nV.prototype.r=function(b,a){var c=this.a,d=this.b;this.A=b;for(var e=c.length-258,f,g,k,h;256!==(f=Ya(this,b));)if(256>f)d>=e&&(this.b=d,c=this.f(),d=this.b),c[d++]=f;else{g=f-257;h=ab[g];0=e&&(this.b=d,c=this.f(),d=this.b);for(;h--;)c[d]=c[d++-k]}for(;8<=this.e;)this.e-=8,this.c--;this.b=d};\nV.prototype.Q=function(b,a){var c=this.a,d=this.b;this.A=b;for(var e=c.length,f,g,k,h;256!==(f=Ya(this,b));)if(256>f)d>=e&&(c=this.f(),e=c.length),c[d++]=f;else{g=f-257;h=ab[g];0e&&(c=this.f(),e=c.length);for(;h--;)c[d]=c[d++-k]}for(;8<=this.e;)this.e-=8,this.c--;this.b=d};\nV.prototype.f=function(){var b=new (B?Uint8Array:Array)(this.b-32768),a=this.b-32768,c,d,e=this.a;if(B)b.set(e.subarray(32768,b.length));else{c=0;for(d=b.length;cc;++c)e[c]=e[a+c];this.b=32768;return e};\nV.prototype.S=function(b){var a,c=this.input.length/this.c+1|0,d,e,f,g=this.input,k=this.a;b&&(\"number\"===typeof b.B&&(c=b.B),\"number\"===typeof b.M&&(c+=b.M));2>c?(d=(g.length-this.c)/this.A[2],f=258*(d/2)|0,e=fa&&(this.a.length=a),b=this.a);return this.buffer=b};function mb(b){this.input=b;this.c=0;this.G=[];this.R=!1}\nmb.prototype.i=function(){for(var b=this.input.length;this.c>>0;ha(e,t,t)!==r&&q(Error(\"invalid CRC-32 checksum: 0x\"+ha(e,t,t).toString(16)+\" / 0x\"+\nr.toString(16)));a.Z=c=(p[l++]|p[l++]<<8|p[l++]<<16|p[l++]<<24)>>>0;(e.length&4294967295)!==c&&q(Error(\"invalid input size: \"+(e.length&4294967295)+\" / \"+c));this.G.push(a);this.c=l}this.R=v;var n=this.G,s,u,w=0,C=0,x;s=0;for(u=n.length;s>>0;b=a}for(var e=1,f=0,g=b.length,k,h=0;0>>0};function ob(b,a){var c,d;this.input=b;this.c=0;if(a||!(a={}))a.index&&(this.c=a.index),a.verify&&(this.V=a.verify);c=b[this.c++];d=b[this.c++];switch(c&15){case pb:this.method=pb;break;default:q(Error(\"unsupported compression method\"))}0!==((c<<8)+d)%31&&q(Error(\"invalid fcheck flag:\"+((c<<8)+d)%31));d&32&&q(Error(\"fdict flag is not supported\"));this.J=new V(b,{index:this.c,bufferSize:a.bufferSize,bufferType:a.bufferType,resize:a.resize})}\nob.prototype.i=function(){var b=this.input,a,c;a=this.J.i();this.c=this.J.c;this.V&&(c=(b[this.c++]<<24|b[this.c++]<<16|b[this.c++]<<8|b[this.c++])>>>0,c!==nb(a)&&q(Error(\"invalid adler-32 checksum\")));return a};var pb=8;function rb(b,a){this.input=b;this.a=new (B?Uint8Array:Array)(32768);this.k=sb.t;var c={},d;if((a||!(a={}))&&\"number\"===typeof a.compressionType)this.k=a.compressionType;for(d in a)c[d]=a[d];c.outputBuffer=this.a;this.I=new na(this.input,c)}var sb=pa;\nrb.prototype.h=function(){var b,a,c,d,e,f,g,k=0;g=this.a;b=pb;switch(b){case pb:a=Math.LOG2E*Math.log(32768)-8;break;default:q(Error(\"invalid compression method\"))}c=a<<4|b;g[k++]=c;switch(b){case pb:switch(this.k){case sb.NONE:e=0;break;case sb.L:e=1;break;case sb.t:e=2;break;default:q(Error(\"unsupported compression type\"))}break;default:q(Error(\"invalid compression method\"))}d=e<<6|0;g[k++]=d|31-(256*c+d)%31;f=nb(this.input);this.I.b=k;g=this.I.h();k=g.length;B&&(g=new Uint8Array(g.buffer),g.length<=\nk+4&&(this.a=new Uint8Array(g.length+4),this.a.set(g),g=this.a),g=g.subarray(0,k+4));g[k++]=f>>24&255;g[k++]=f>>16&255;g[k++]=f>>8&255;g[k++]=f&255;return g};exports.deflate=tb;exports.deflateSync=ub;exports.inflate=vb;exports.inflateSync=wb;exports.gzip=xb;exports.gzipSync=yb;exports.gunzip=zb;exports.gunzipSync=Ab;function tb(b,a,c){process.nextTick(function(){var d,e;try{e=ub(b,c)}catch(f){d=f}a(d,e)})}function ub(b,a){var c;c=(new rb(b)).h();a||(a={});return a.H?c:Bb(c)}function vb(b,a,c){process.nextTick(function(){var d,e;try{e=wb(b,c)}catch(f){d=f}a(d,e)})}\nfunction wb(b,a){var c;b.subarray=b.slice;c=(new ob(b)).i();a||(a={});return a.noBuffer?c:Bb(c)}function xb(b,a,c){process.nextTick(function(){var d,e;try{e=yb(b,c)}catch(f){d=f}a(d,e)})}function yb(b,a){var c;b.subarray=b.slice;c=(new Ba(b)).h();a||(a={});return a.H?c:Bb(c)}function zb(b,a,c){process.nextTick(function(){var d,e;try{e=Ab(b,c)}catch(f){d=f}a(d,e)})}function Ab(b,a){var c;b.subarray=b.slice;c=(new mb(b)).i();a||(a={});return a.H?c:Bb(c)}\nfunction Bb(b){var a=new Buffer(b.length),c,d;c=0;for(d=b.length;c 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction placeHoldersCount (b64) {\n var len = b64.length\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // the number of equal signs (place holders)\n // if there are two placeholders, than the two characters before it\n // represent one byte\n // if there is only one, then the three characters before it represent 2 bytes\n // this is just a cheap hack to not do indexOf twice\n return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0\n}\n\nfunction byteLength (b64) {\n // base64 is 4/3 + up to two characters of the original data\n return (b64.length * 3 / 4) - placeHoldersCount(b64)\n}\n\nfunction toByteArray (b64) {\n var i, l, tmp, placeHolders, arr\n var len = b64.length\n placeHolders = placeHoldersCount(b64)\n\n arr = new Arr((len * 3 / 4) - placeHolders)\n\n // if there are placeholders, only get up to the last complete 4 chars\n l = placeHolders > 0 ? len - 4 : len\n\n var L = 0\n\n for (i = 0; i < l; i += 4) {\n tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]\n arr[L++] = (tmp >> 16) & 0xFF\n arr[L++] = (tmp >> 8) & 0xFF\n arr[L++] = tmp & 0xFF\n }\n\n if (placeHolders === 2) {\n tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[L++] = tmp & 0xFF\n } else if (placeHolders === 1) {\n tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[L++] = (tmp >> 8) & 0xFF\n arr[L++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var output = ''\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n output += lookup[tmp >> 2]\n output += lookup[(tmp << 4) & 0x3F]\n output += '=='\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + (uint8[len - 1])\n output += lookup[tmp >> 10]\n output += lookup[(tmp >> 4) & 0x3F]\n output += lookup[(tmp << 2) & 0x3F]\n output += '='\n }\n\n parts.push(output)\n\n return parts.join('')\n}\n","exports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = nBytes * 8 - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = nBytes * 8 - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n","const bmp = require('bmp-js');\nconst fileType = require('file-type');\n\nmodule.exports = (TessModule, iBuf) => {\n const buf = Buffer.from(iBuf);\n const type = fileType(buf);\n let bytesPerPixel = 0;\n let data = null;\n let pix = null;\n let w = 0;\n let h = 0;\n\n /*\n * Although leptonica should support reading bmp, there is a bug of \"compressed BMP files\".\n * As there is no solution, we need to use bmp-js for now.\n * @see https://groups.google.com/forum/#!topic/tesseract-ocr/4mPD9zTxdxE\n */\n if (type && type.mime === 'image/bmp') {\n const bmpBuf = bmp.decode(buf);\n data = TessModule._malloc(bmpBuf.data.length * Uint8Array.BYTES_PER_ELEMENT);\n TessModule.HEAPU8.set(bmpBuf.data, data);\n w = bmpBuf.width;\n h = bmpBuf.height;\n bytesPerPixel = 4;\n } else {\n const ptr = TessModule._malloc(buf.length * Uint8Array.BYTES_PER_ELEMENT);\n TessModule.HEAPU8.set(buf, ptr);\n pix = TessModule._pixReadMem(ptr, buf.length);\n if (TessModule.getValue(pix + (7 * 4), 'i32') === 0) {\n /*\n * Set a yres default value to prevent warning from tesseract\n * See kMinCredibleResolution in tesseract/src/ccstruct/publictypes.h\n */\n TessModule.setValue(pix + (7 * 4), 70, 'i32');\n }\n [w, h] = Array(2).fill(0)\n .map((v, idx) => (\n TessModule.getValue(pix + (idx * 4), 'i32')\n ));\n }\n\n return {\n w,\n h,\n bytesPerPixel,\n data,\n pix,\n };\n};\n","/**\n * @author shaozilee\n *\n * support 1bit 4bit 8bit 24bit decode\n * encode with 24bit\n * \n */\n\nvar encode = require('./lib/encoder'),\n decode = require('./lib/decoder');\n\nmodule.exports = {\n encode: encode,\n decode: decode\n};\n","/**\n * @author shaozilee\n *\n * BMP format encoder,encode 24bit BMP\n * Not support quality compression\n *\n */\n\nfunction BmpEncoder(imgData){\n\tthis.buffer = imgData.data;\n\tthis.width = imgData.width;\n\tthis.height = imgData.height;\n\tthis.extraBytes = this.width%4;\n\tthis.rgbSize = this.height*(3*this.width+this.extraBytes);\n\tthis.headerInfoSize = 40;\n\n\tthis.data = [];\n\t/******************header***********************/\n\tthis.flag = \"BM\";\n\tthis.reserved = 0;\n\tthis.offset = 54;\n\tthis.fileSize = this.rgbSize+this.offset;\n\tthis.planes = 1;\n\tthis.bitPP = 24;\n\tthis.compress = 0;\n\tthis.hr = 0;\n\tthis.vr = 0;\n\tthis.colors = 0;\n\tthis.importantColors = 0;\n}\n\nBmpEncoder.prototype.encode = function() {\n\tvar tempBuffer = new Buffer(this.offset+this.rgbSize);\n\tthis.pos = 0;\n\ttempBuffer.write(this.flag,this.pos,2);this.pos+=2;\n\ttempBuffer.writeUInt32LE(this.fileSize,this.pos);this.pos+=4;\n\ttempBuffer.writeUInt32LE(this.reserved,this.pos);this.pos+=4;\n\ttempBuffer.writeUInt32LE(this.offset,this.pos);this.pos+=4;\n\n\ttempBuffer.writeUInt32LE(this.headerInfoSize,this.pos);this.pos+=4;\n\ttempBuffer.writeUInt32LE(this.width,this.pos);this.pos+=4;\n\ttempBuffer.writeInt32LE(-this.height,this.pos);this.pos+=4;\n\ttempBuffer.writeUInt16LE(this.planes,this.pos);this.pos+=2;\n\ttempBuffer.writeUInt16LE(this.bitPP,this.pos);this.pos+=2;\n\ttempBuffer.writeUInt32LE(this.compress,this.pos);this.pos+=4;\n\ttempBuffer.writeUInt32LE(this.rgbSize,this.pos);this.pos+=4;\n\ttempBuffer.writeUInt32LE(this.hr,this.pos);this.pos+=4;\n\ttempBuffer.writeUInt32LE(this.vr,this.pos);this.pos+=4;\n\ttempBuffer.writeUInt32LE(this.colors,this.pos);this.pos+=4;\n\ttempBuffer.writeUInt32LE(this.importantColors,this.pos);this.pos+=4;\n\n\tvar i=0;\n\tvar rowBytes = 3*this.width+this.extraBytes;\n\n\tfor (var y = 0; y 0){\n\t\t\tvar fillOffset = this.pos+y*rowBytes+this.width*3;\n\t\t\ttempBuffer.fill(0,fillOffset,fillOffset+this.extraBytes);\n\t\t}\n\t}\n\n\treturn tempBuffer;\n};\n\nmodule.exports = function(imgData, quality) {\n if (typeof quality === 'undefined') quality = 100;\n \tvar encoder = new BmpEncoder(imgData);\n\tvar data = encoder.encode();\n return {\n data: data,\n width: imgData.width,\n height: imgData.height\n };\n};\n","/**\n * @author shaozilee\n *\n * Bmp format decoder,support 1bit 4bit 8bit 24bit bmp\n *\n */\n\nfunction BmpDecoder(buffer,is_with_alpha) {\n this.pos = 0;\n this.buffer = buffer;\n this.is_with_alpha = !!is_with_alpha;\n this.bottom_up = true;\n this.flag = this.buffer.toString(\"utf-8\", 0, this.pos += 2);\n if (this.flag != \"BM\") throw new Error(\"Invalid BMP File\");\n this.parseHeader();\n this.parseRGBA();\n}\n\nBmpDecoder.prototype.parseHeader = function() {\n this.fileSize = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.reserved = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.offset = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.headerSize = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.width = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.height = this.buffer.readInt32LE(this.pos);\n this.pos += 4;\n this.planes = this.buffer.readUInt16LE(this.pos);\n this.pos += 2;\n this.bitPP = this.buffer.readUInt16LE(this.pos);\n this.pos += 2;\n this.compress = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.rawSize = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.hr = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.vr = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.colors = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.importantColors = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n\n if(this.bitPP === 16 && this.is_with_alpha){\n this.bitPP = 15\n }\n if (this.bitPP < 15) {\n var len = this.colors === 0 ? 1 << this.bitPP : this.colors;\n this.palette = new Array(len);\n for (var i = 0; i < len; i++) {\n var blue = this.buffer.readUInt8(this.pos++);\n var green = this.buffer.readUInt8(this.pos++);\n var red = this.buffer.readUInt8(this.pos++);\n var quad = this.buffer.readUInt8(this.pos++);\n this.palette[i] = {\n red: red,\n green: green,\n blue: blue,\n quad: quad\n };\n }\n }\n if(this.height < 0) {\n this.height *= -1;\n this.bottom_up = false;\n }\n\n}\n\nBmpDecoder.prototype.parseRGBA = function() {\n var bitn = \"bit\" + this.bitPP;\n var len = this.width * this.height * 4;\n this.data = new Buffer(len);\n this[bitn]();\n};\n\nBmpDecoder.prototype.bit1 = function() {\n var xlen = Math.ceil(this.width / 8);\n var mode = xlen%4;\n var y = this.height >= 0 ? this.height - 1 : -this.height\n for (var y = this.height - 1; y >= 0; y--) {\n var line = this.bottom_up ? y : this.height - 1 - y\n for (var x = 0; x < xlen; x++) {\n var b = this.buffer.readUInt8(this.pos++);\n var location = line * this.width * 4 + x*8*4;\n for (var i = 0; i < 8; i++) {\n if(x*8+i>(7-i))&0x1)];\n\n this.data[location+i*4] = 0;\n this.data[location+i*4 + 1] = rgb.blue;\n this.data[location+i*4 + 2] = rgb.green;\n this.data[location+i*4 + 3] = rgb.red;\n\n }else{\n break;\n }\n }\n }\n\n if (mode != 0){\n this.pos+=(4 - mode);\n }\n }\n};\n\nBmpDecoder.prototype.bit4 = function() {\n //RLE-4\n if(this.compress == 2){\n this.data.fill(0xff);\n\n var location = 0;\n var lines = this.bottom_up?this.height-1:0;\n var low_nibble = false;//for all count of pixel\n\n while(location>4);\n }\n\n if ((i & 1) && (i+1 < b)){\n c = this.buffer.readUInt8(this.pos++);\n }\n\n low_nibble = !low_nibble;\n }\n\n if ((((b+1) >> 1) & 1 ) == 1){\n this.pos++\n }\n }\n\n }else{//encoded mode\n for (var i = 0; i < a; i++) {\n if (low_nibble) {\n setPixelData.call(this, (b & 0x0f));\n } else {\n setPixelData.call(this, (b & 0xf0)>>4);\n }\n low_nibble = !low_nibble;\n }\n }\n\n }\n\n\n\n\n function setPixelData(rgbIndex){\n var rgb = this.palette[rgbIndex];\n this.data[location] = 0;\n this.data[location + 1] = rgb.blue;\n this.data[location + 2] = rgb.green;\n this.data[location + 3] = rgb.red;\n location+=4;\n }\n }else{\n\n var xlen = Math.ceil(this.width/2);\n var mode = xlen%4;\n for (var y = this.height - 1; y >= 0; y--) {\n var line = this.bottom_up ? y : this.height - 1 - y\n for (var x = 0; x < xlen; x++) {\n var b = this.buffer.readUInt8(this.pos++);\n var location = line * this.width * 4 + x*2*4;\n\n var before = b>>4;\n var after = b&0x0F;\n\n var rgb = this.palette[before];\n this.data[location] = 0;\n this.data[location + 1] = rgb.blue;\n this.data[location + 2] = rgb.green;\n this.data[location + 3] = rgb.red;\n\n\n if(x*2+1>=this.width)break;\n\n rgb = this.palette[after];\n\n this.data[location+4] = 0;\n this.data[location+4 + 1] = rgb.blue;\n this.data[location+4 + 2] = rgb.green;\n this.data[location+4 + 3] = rgb.red;\n\n }\n\n if (mode != 0){\n this.pos+=(4 - mode);\n }\n }\n\n }\n\n};\n\nBmpDecoder.prototype.bit8 = function() {\n //RLE-8\n if(this.compress == 1){\n this.data.fill(0xff);\n\n var location = 0;\n var lines = this.bottom_up?this.height-1:0;\n\n while(location= 0; y--) {\n var line = this.bottom_up ? y : this.height - 1 - y\n for (var x = 0; x < this.width; x++) {\n var b = this.buffer.readUInt8(this.pos++);\n var location = line * this.width * 4 + x * 4;\n if (b < this.palette.length) {\n var rgb = this.palette[b];\n\n this.data[location] = 0;\n this.data[location + 1] = rgb.blue;\n this.data[location + 2] = rgb.green;\n this.data[location + 3] = rgb.red;\n\n } else {\n this.data[location] = 0;\n this.data[location + 1] = 0xFF;\n this.data[location + 2] = 0xFF;\n this.data[location + 3] = 0xFF;\n }\n }\n if (mode != 0) {\n this.pos += (4 - mode);\n }\n }\n }\n};\n\nBmpDecoder.prototype.bit15 = function() {\n var dif_w =this.width % 3;\n var _11111 = parseInt(\"11111\", 2),_1_5 = _11111;\n for (var y = this.height - 1; y >= 0; y--) {\n var line = this.bottom_up ? y : this.height - 1 - y\n for (var x = 0; x < this.width; x++) {\n\n var B = this.buffer.readUInt16LE(this.pos);\n this.pos+=2;\n var blue = (B & _1_5) / _1_5 * 255 | 0;\n var green = (B >> 5 & _1_5 ) / _1_5 * 255 | 0;\n var red = (B >> 10 & _1_5) / _1_5 * 255 | 0;\n var alpha = (B>>15)?0xFF:0x00;\n\n var location = line * this.width * 4 + x * 4;\n\n this.data[location] = alpha;\n this.data[location + 1] = blue;\n this.data[location + 2] = green;\n this.data[location + 3] = red;\n }\n //skip extra bytes\n this.pos += dif_w;\n }\n};\n\nBmpDecoder.prototype.bit16 = function() {\n var dif_w =(this.width % 2)*2;\n //default xrgb555\n this.maskRed = 0x7C00;\n this.maskGreen = 0x3E0;\n this.maskBlue =0x1F;\n this.mask0 = 0;\n\n if(this.compress == 3){\n this.maskRed = this.buffer.readUInt32LE(this.pos);\n this.pos+=4;\n this.maskGreen = this.buffer.readUInt32LE(this.pos);\n this.pos+=4;\n this.maskBlue = this.buffer.readUInt32LE(this.pos);\n this.pos+=4;\n this.mask0 = this.buffer.readUInt32LE(this.pos);\n this.pos+=4;\n }\n\n\n var ns=[0,0,0];\n for (var i=0;i<16;i++){\n if ((this.maskRed>>i)&0x01) ns[0]++;\n if ((this.maskGreen>>i)&0x01) ns[1]++;\n if ((this.maskBlue>>i)&0x01) ns[2]++;\n }\n ns[1]+=ns[0]; ns[2]+=ns[1];\tns[0]=8-ns[0]; ns[1]-=8; ns[2]-=8;\n\n for (var y = this.height - 1; y >= 0; y--) {\n var line = this.bottom_up ? y : this.height - 1 - y;\n for (var x = 0; x < this.width; x++) {\n\n var B = this.buffer.readUInt16LE(this.pos);\n this.pos+=2;\n\n var blue = (B&this.maskBlue)<>ns[1];\n var red = (B&this.maskRed)>>ns[2];\n\n var location = line * this.width * 4 + x * 4;\n\n this.data[location] = 0;\n this.data[location + 1] = blue;\n this.data[location + 2] = green;\n this.data[location + 3] = red;\n }\n //skip extra bytes\n this.pos += dif_w;\n }\n};\n\nBmpDecoder.prototype.bit24 = function() {\n for (var y = this.height - 1; y >= 0; y--) {\n var line = this.bottom_up ? y : this.height - 1 - y\n for (var x = 0; x < this.width; x++) {\n //Little Endian rgb\n var blue = this.buffer.readUInt8(this.pos++);\n var green = this.buffer.readUInt8(this.pos++);\n var red = this.buffer.readUInt8(this.pos++);\n var location = line * this.width * 4 + x * 4;\n this.data[location] = 0;\n this.data[location + 1] = blue;\n this.data[location + 2] = green;\n this.data[location + 3] = red;\n }\n //skip extra bytes\n this.pos += (this.width % 4);\n }\n\n};\n\n/**\n * add 32bit decode func\n * @author soubok\n */\nBmpDecoder.prototype.bit32 = function() {\n //BI_BITFIELDS\n if(this.compress == 3){\n this.maskRed = this.buffer.readUInt32LE(this.pos);\n this.pos+=4;\n this.maskGreen = this.buffer.readUInt32LE(this.pos);\n this.pos+=4;\n this.maskBlue = this.buffer.readUInt32LE(this.pos);\n this.pos+=4;\n this.mask0 = this.buffer.readUInt32LE(this.pos);\n this.pos+=4;\n for (var y = this.height - 1; y >= 0; y--) {\n var line = this.bottom_up ? y : this.height - 1 - y;\n for (var x = 0; x < this.width; x++) {\n //Little Endian rgba\n var alpha = this.buffer.readUInt8(this.pos++);\n var blue = this.buffer.readUInt8(this.pos++);\n var green = this.buffer.readUInt8(this.pos++);\n var red = this.buffer.readUInt8(this.pos++);\n var location = line * this.width * 4 + x * 4;\n this.data[location] = alpha;\n this.data[location + 1] = blue;\n this.data[location + 2] = green;\n this.data[location + 3] = red;\n }\n }\n\n }else{\n for (var y = this.height - 1; y >= 0; y--) {\n var line = this.bottom_up ? y : this.height - 1 - y;\n for (var x = 0; x < this.width; x++) {\n //Little Endian argb\n var blue = this.buffer.readUInt8(this.pos++);\n var green = this.buffer.readUInt8(this.pos++);\n var red = this.buffer.readUInt8(this.pos++);\n var alpha = this.buffer.readUInt8(this.pos++);\n var location = line * this.width * 4 + x * 4;\n this.data[location] = alpha;\n this.data[location + 1] = blue;\n this.data[location + 2] = green;\n this.data[location + 3] = red;\n }\n }\n\n }\n\n\n\n\n};\n\nBmpDecoder.prototype.getData = function() {\n return this.data;\n};\n\nmodule.exports = function(bmpData) {\n var decoder = new BmpDecoder(bmpData);\n return decoder;\n};\n","'use strict';\nconst toBytes = s => [...s].map(c => c.charCodeAt(0));\nconst xpiZipFilename = toBytes('META-INF/mozilla.rsa');\nconst oxmlContentTypes = toBytes('[Content_Types].xml');\nconst oxmlRels = toBytes('_rels/.rels');\n\nfunction readUInt64LE(buf, offset = 0) {\n\tlet n = buf[offset];\n\tlet mul = 1;\n\tlet i = 0;\n\twhile (++i < 8) {\n\t\tmul *= 0x100;\n\t\tn += buf[offset + i] * mul;\n\t}\n\treturn n;\n}\n\nmodule.exports = input => {\n\tif (!(input instanceof Uint8Array || Buffer.isBuffer(input))) {\n\t\tthrow new TypeError(`Expected the \\`input\\` argument to be of type \\`Uint8Array\\` or \\`Buffer\\`, got \\`${typeof input}\\``);\n\t}\n\n\tconst buf = input instanceof Uint8Array ? input : new Uint8Array(input);\n\n\tif (!(buf && buf.length > 1)) {\n\t\treturn null;\n\t}\n\n\tconst check = (header, options) => {\n\t\toptions = Object.assign({\n\t\t\toffset: 0\n\t\t}, options);\n\n\t\tfor (let i = 0; i < header.length; i++) {\n\t\t\t// If a bitmask is set\n\t\t\tif (options.mask) {\n\t\t\t\t// If header doesn't equal `buf` with bits masked off\n\t\t\t\tif (header[i] !== (options.mask[i] & buf[i + options.offset])) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else if (header[i] !== buf[i + options.offset]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t};\n\n\tconst checkString = (header, options) => check(toBytes(header), options);\n\n\tif (check([0xFF, 0xD8, 0xFF])) {\n\t\treturn {\n\t\t\text: 'jpg',\n\t\t\tmime: 'image/jpeg'\n\t\t};\n\t}\n\n\tif (check([0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A])) {\n\t\treturn {\n\t\t\text: 'png',\n\t\t\tmime: 'image/png'\n\t\t};\n\t}\n\n\tif (check([0x47, 0x49, 0x46])) {\n\t\treturn {\n\t\t\text: 'gif',\n\t\t\tmime: 'image/gif'\n\t\t};\n\t}\n\n\tif (check([0x57, 0x45, 0x42, 0x50], {offset: 8})) {\n\t\treturn {\n\t\t\text: 'webp',\n\t\t\tmime: 'image/webp'\n\t\t};\n\t}\n\n\tif (check([0x46, 0x4C, 0x49, 0x46])) {\n\t\treturn {\n\t\t\text: 'flif',\n\t\t\tmime: 'image/flif'\n\t\t};\n\t}\n\n\t// Needs to be before `tif` check\n\tif (\n\t\t(check([0x49, 0x49, 0x2A, 0x0]) || check([0x4D, 0x4D, 0x0, 0x2A])) &&\n\t\tcheck([0x43, 0x52], {offset: 8})\n\t) {\n\t\treturn {\n\t\t\text: 'cr2',\n\t\t\tmime: 'image/x-canon-cr2'\n\t\t};\n\t}\n\n\tif (\n\t\tcheck([0x49, 0x49, 0x2A, 0x0]) ||\n\t\tcheck([0x4D, 0x4D, 0x0, 0x2A])\n\t) {\n\t\treturn {\n\t\t\text: 'tif',\n\t\t\tmime: 'image/tiff'\n\t\t};\n\t}\n\n\tif (check([0x42, 0x4D])) {\n\t\treturn {\n\t\t\text: 'bmp',\n\t\t\tmime: 'image/bmp'\n\t\t};\n\t}\n\n\tif (check([0x49, 0x49, 0xBC])) {\n\t\treturn {\n\t\t\text: 'jxr',\n\t\t\tmime: 'image/vnd.ms-photo'\n\t\t};\n\t}\n\n\tif (check([0x38, 0x42, 0x50, 0x53])) {\n\t\treturn {\n\t\t\text: 'psd',\n\t\t\tmime: 'image/vnd.adobe.photoshop'\n\t\t};\n\t}\n\n\t// Zip-based file formats\n\t// Need to be before the `zip` check\n\tif (check([0x50, 0x4B, 0x3, 0x4])) {\n\t\tif (\n\t\t\tcheck([0x6D, 0x69, 0x6D, 0x65, 0x74, 0x79, 0x70, 0x65, 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x2F, 0x65, 0x70, 0x75, 0x62, 0x2B, 0x7A, 0x69, 0x70], {offset: 30})\n\t\t) {\n\t\t\treturn {\n\t\t\t\text: 'epub',\n\t\t\t\tmime: 'application/epub+zip'\n\t\t\t};\n\t\t}\n\n\t\t// Assumes signed `.xpi` from addons.mozilla.org\n\t\tif (check(xpiZipFilename, {offset: 30})) {\n\t\t\treturn {\n\t\t\t\text: 'xpi',\n\t\t\t\tmime: 'application/x-xpinstall'\n\t\t\t};\n\t\t}\n\n\t\tif (checkString('mimetypeapplication/vnd.oasis.opendocument.text', {offset: 30})) {\n\t\t\treturn {\n\t\t\t\text: 'odt',\n\t\t\t\tmime: 'application/vnd.oasis.opendocument.text'\n\t\t\t};\n\t\t}\n\n\t\tif (checkString('mimetypeapplication/vnd.oasis.opendocument.spreadsheet', {offset: 30})) {\n\t\t\treturn {\n\t\t\t\text: 'ods',\n\t\t\t\tmime: 'application/vnd.oasis.opendocument.spreadsheet'\n\t\t\t};\n\t\t}\n\n\t\tif (checkString('mimetypeapplication/vnd.oasis.opendocument.presentation', {offset: 30})) {\n\t\t\treturn {\n\t\t\t\text: 'odp',\n\t\t\t\tmime: 'application/vnd.oasis.opendocument.presentation'\n\t\t\t};\n\t\t}\n\n\t\t// The docx, xlsx and pptx file types extend the Office Open XML file format:\n\t\t// https://en.wikipedia.org/wiki/Office_Open_XML_file_formats\n\t\t// We look for:\n\t\t// - one entry named '[Content_Types].xml' or '_rels/.rels',\n\t\t// - one entry indicating specific type of file.\n\t\t// MS Office, OpenOffice and LibreOffice may put the parts in different order, so the check should not rely on it.\n\t\tconst findNextZipHeaderIndex = (arr, startAt = 0) => arr.findIndex((el, i, arr) => i >= startAt && arr[i] === 0x50 && arr[i + 1] === 0x4B && arr[i + 2] === 0x3 && arr[i + 3] === 0x4);\n\n\t\tlet zipHeaderIndex = 0; // The first zip header was already found at index 0\n\t\tlet oxmlFound = false;\n\t\tlet type = null;\n\n\t\tdo {\n\t\t\tconst offset = zipHeaderIndex + 30;\n\n\t\t\tif (!oxmlFound) {\n\t\t\t\toxmlFound = (check(oxmlContentTypes, {offset}) || check(oxmlRels, {offset}));\n\t\t\t}\n\n\t\t\tif (!type) {\n\t\t\t\tif (checkString('word/', {offset})) {\n\t\t\t\t\ttype = {\n\t\t\t\t\t\text: 'docx',\n\t\t\t\t\t\tmime: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'\n\t\t\t\t\t};\n\t\t\t\t} else if (checkString('ppt/', {offset})) {\n\t\t\t\t\ttype = {\n\t\t\t\t\t\text: 'pptx',\n\t\t\t\t\t\tmime: 'application/vnd.openxmlformats-officedocument.presentationml.presentation'\n\t\t\t\t\t};\n\t\t\t\t} else if (checkString('xl/', {offset})) {\n\t\t\t\t\ttype = {\n\t\t\t\t\t\text: 'xlsx',\n\t\t\t\t\t\tmime: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (oxmlFound && type) {\n\t\t\t\treturn type;\n\t\t\t}\n\n\t\t\tzipHeaderIndex = findNextZipHeaderIndex(buf, offset);\n\t\t} while (zipHeaderIndex >= 0);\n\n\t\t// No more zip parts available in the buffer, but maybe we are almost certain about the type?\n\t\tif (type) {\n\t\t\treturn type;\n\t\t}\n\t}\n\n\tif (\n\t\tcheck([0x50, 0x4B]) &&\n\t\t(buf[2] === 0x3 || buf[2] === 0x5 || buf[2] === 0x7) &&\n\t\t(buf[3] === 0x4 || buf[3] === 0x6 || buf[3] === 0x8)\n\t) {\n\t\treturn {\n\t\t\text: 'zip',\n\t\t\tmime: 'application/zip'\n\t\t};\n\t}\n\n\tif (check([0x75, 0x73, 0x74, 0x61, 0x72], {offset: 257})) {\n\t\treturn {\n\t\t\text: 'tar',\n\t\t\tmime: 'application/x-tar'\n\t\t};\n\t}\n\n\tif (\n\t\tcheck([0x52, 0x61, 0x72, 0x21, 0x1A, 0x7]) &&\n\t\t(buf[6] === 0x0 || buf[6] === 0x1)\n\t) {\n\t\treturn {\n\t\t\text: 'rar',\n\t\t\tmime: 'application/x-rar-compressed'\n\t\t};\n\t}\n\n\tif (check([0x1F, 0x8B, 0x8])) {\n\t\treturn {\n\t\t\text: 'gz',\n\t\t\tmime: 'application/gzip'\n\t\t};\n\t}\n\n\tif (check([0x42, 0x5A, 0x68])) {\n\t\treturn {\n\t\t\text: 'bz2',\n\t\t\tmime: 'application/x-bzip2'\n\t\t};\n\t}\n\n\tif (check([0x37, 0x7A, 0xBC, 0xAF, 0x27, 0x1C])) {\n\t\treturn {\n\t\t\text: '7z',\n\t\t\tmime: 'application/x-7z-compressed'\n\t\t};\n\t}\n\n\tif (check([0x78, 0x01])) {\n\t\treturn {\n\t\t\text: 'dmg',\n\t\t\tmime: 'application/x-apple-diskimage'\n\t\t};\n\t}\n\n\tif (check([0x33, 0x67, 0x70, 0x35]) || // 3gp5\n\t\t(\n\t\t\tcheck([0x0, 0x0, 0x0]) && check([0x66, 0x74, 0x79, 0x70], {offset: 4}) &&\n\t\t\t\t(\n\t\t\t\t\tcheck([0x6D, 0x70, 0x34, 0x31], {offset: 8}) || // MP41\n\t\t\t\t\tcheck([0x6D, 0x70, 0x34, 0x32], {offset: 8}) || // MP42\n\t\t\t\t\tcheck([0x69, 0x73, 0x6F, 0x6D], {offset: 8}) || // ISOM\n\t\t\t\t\tcheck([0x69, 0x73, 0x6F, 0x32], {offset: 8}) || // ISO2\n\t\t\t\t\tcheck([0x6D, 0x6D, 0x70, 0x34], {offset: 8}) || // MMP4\n\t\t\t\t\tcheck([0x4D, 0x34, 0x56], {offset: 8}) || // M4V\n\t\t\t\t\tcheck([0x64, 0x61, 0x73, 0x68], {offset: 8}) // DASH\n\t\t\t\t)\n\t\t)) {\n\t\treturn {\n\t\t\text: 'mp4',\n\t\t\tmime: 'video/mp4'\n\t\t};\n\t}\n\n\tif (check([0x4D, 0x54, 0x68, 0x64])) {\n\t\treturn {\n\t\t\text: 'mid',\n\t\t\tmime: 'audio/midi'\n\t\t};\n\t}\n\n\t// https://github.com/threatstack/libmagic/blob/master/magic/Magdir/matroska\n\tif (check([0x1A, 0x45, 0xDF, 0xA3])) {\n\t\tconst sliced = buf.subarray(4, 4 + 4096);\n\t\tconst idPos = sliced.findIndex((el, i, arr) => arr[i] === 0x42 && arr[i + 1] === 0x82);\n\n\t\tif (idPos !== -1) {\n\t\t\tconst docTypePos = idPos + 3;\n\t\t\tconst findDocType = type => [...type].every((c, i) => sliced[docTypePos + i] === c.charCodeAt(0));\n\n\t\t\tif (findDocType('matroska')) {\n\t\t\t\treturn {\n\t\t\t\t\text: 'mkv',\n\t\t\t\t\tmime: 'video/x-matroska'\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif (findDocType('webm')) {\n\t\t\t\treturn {\n\t\t\t\t\text: 'webm',\n\t\t\t\t\tmime: 'video/webm'\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t}\n\n\tif (check([0x0, 0x0, 0x0, 0x14, 0x66, 0x74, 0x79, 0x70, 0x71, 0x74, 0x20, 0x20]) ||\n\t\tcheck([0x66, 0x72, 0x65, 0x65], {offset: 4}) || // Type: `free`\n\t\tcheck([0x66, 0x74, 0x79, 0x70, 0x71, 0x74, 0x20, 0x20], {offset: 4}) ||\n\t\tcheck([0x6D, 0x64, 0x61, 0x74], {offset: 4}) || // MJPEG\n\t\tcheck([0x6D, 0x6F, 0x6F, 0x76], {offset: 4}) || // Type: `moov`\n\t\tcheck([0x77, 0x69, 0x64, 0x65], {offset: 4})) {\n\t\treturn {\n\t\t\text: 'mov',\n\t\t\tmime: 'video/quicktime'\n\t\t};\n\t}\n\n\t// RIFF file format which might be AVI, WAV, QCP, etc\n\tif (check([0x52, 0x49, 0x46, 0x46])) {\n\t\tif (check([0x41, 0x56, 0x49], {offset: 8})) {\n\t\t\treturn {\n\t\t\t\text: 'avi',\n\t\t\t\tmime: 'video/vnd.avi'\n\t\t\t};\n\t\t}\n\t\tif (check([0x57, 0x41, 0x56, 0x45], {offset: 8})) {\n\t\t\treturn {\n\t\t\t\text: 'wav',\n\t\t\t\tmime: 'audio/vnd.wave'\n\t\t\t};\n\t\t}\n\t\t// QLCM, QCP file\n\t\tif (check([0x51, 0x4C, 0x43, 0x4D], {offset: 8})) {\n\t\t\treturn {\n\t\t\t\text: 'qcp',\n\t\t\t\tmime: 'audio/qcelp'\n\t\t\t};\n\t\t}\n\t}\n\n\t// ASF_Header_Object first 80 bytes\n\tif (check([0x30, 0x26, 0xB2, 0x75, 0x8E, 0x66, 0xCF, 0x11, 0xA6, 0xD9])) {\n\t\t// Search for header should be in first 1KB of file.\n\n\t\tlet offset = 30;\n\t\tdo {\n\t\t\tconst objectSize = readUInt64LE(buf, offset + 16);\n\t\t\tif (check([0x91, 0x07, 0xDC, 0xB7, 0xB7, 0xA9, 0xCF, 0x11, 0x8E, 0xE6, 0x00, 0xC0, 0x0C, 0x20, 0x53, 0x65], {offset})) {\n\t\t\t\t// Sync on Stream-Properties-Object (B7DC0791-A9B7-11CF-8EE6-00C00C205365)\n\t\t\t\tif (check([0x40, 0x9E, 0x69, 0xF8, 0x4D, 0x5B, 0xCF, 0x11, 0xA8, 0xFD, 0x00, 0x80, 0x5F, 0x5C, 0x44, 0x2B], {offset: offset + 24})) {\n\t\t\t\t\t// Found audio:\n\t\t\t\t\treturn {\n\t\t\t\t\t\text: 'wma',\n\t\t\t\t\t\tmime: 'audio/x-ms-wma'\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tif (check([0xC0, 0xEF, 0x19, 0xBC, 0x4D, 0x5B, 0xCF, 0x11, 0xA8, 0xFD, 0x00, 0x80, 0x5F, 0x5C, 0x44, 0x2B], {offset: offset + 24})) {\n\t\t\t\t\t// Found video:\n\t\t\t\t\treturn {\n\t\t\t\t\t\text: 'wmv',\n\t\t\t\t\t\tmime: 'video/x-ms-asf'\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\toffset += objectSize;\n\t\t} while (offset + 24 <= buf.length);\n\n\t\t// Default to ASF generic extension\n\t\treturn {\n\t\t\text: 'asf',\n\t\t\tmime: 'application/vnd.ms-asf'\n\t\t};\n\t}\n\n\tif (\n\t\tcheck([0x0, 0x0, 0x1, 0xBA]) ||\n\t\tcheck([0x0, 0x0, 0x1, 0xB3])\n\t) {\n\t\treturn {\n\t\t\text: 'mpg',\n\t\t\tmime: 'video/mpeg'\n\t\t};\n\t}\n\n\tif (check([0x66, 0x74, 0x79, 0x70, 0x33, 0x67], {offset: 4})) {\n\t\treturn {\n\t\t\text: '3gp',\n\t\t\tmime: 'video/3gpp'\n\t\t};\n\t}\n\n\t// Check for MPEG header at different starting offsets\n\tfor (let start = 0; start < 2 && start < (buf.length - 16); start++) {\n\t\tif (\n\t\t\tcheck([0x49, 0x44, 0x33], {offset: start}) || // ID3 header\n\t\t\tcheck([0xFF, 0xE2], {offset: start, mask: [0xFF, 0xE2]}) // MPEG 1 or 2 Layer 3 header\n\t\t) {\n\t\t\treturn {\n\t\t\t\text: 'mp3',\n\t\t\t\tmime: 'audio/mpeg'\n\t\t\t};\n\t\t}\n\n\t\tif (\n\t\t\tcheck([0xFF, 0xE4], {offset: start, mask: [0xFF, 0xE4]}) // MPEG 1 or 2 Layer 2 header\n\t\t) {\n\t\t\treturn {\n\t\t\t\text: 'mp2',\n\t\t\t\tmime: 'audio/mpeg'\n\t\t\t};\n\t\t}\n\n\t\tif (\n\t\t\tcheck([0xFF, 0xF8], {offset: start, mask: [0xFF, 0xFC]}) // MPEG 2 layer 0 using ADTS\n\t\t) {\n\t\t\treturn {\n\t\t\t\text: 'mp2',\n\t\t\t\tmime: 'audio/mpeg'\n\t\t\t};\n\t\t}\n\n\t\tif (\n\t\t\tcheck([0xFF, 0xF0], {offset: start, mask: [0xFF, 0xFC]}) // MPEG 4 layer 0 using ADTS\n\t\t) {\n\t\t\treturn {\n\t\t\t\text: 'mp4',\n\t\t\t\tmime: 'audio/mpeg'\n\t\t\t};\n\t\t}\n\t}\n\n\tif (\n\t\tcheck([0x66, 0x74, 0x79, 0x70, 0x4D, 0x34, 0x41], {offset: 4}) ||\n\t\tcheck([0x4D, 0x34, 0x41, 0x20])\n\t) {\n\t\treturn { // MPEG-4 layer 3 (audio)\n\t\t\text: 'm4a',\n\t\t\tmime: 'audio/mp4' // RFC 4337\n\t\t};\n\t}\n\n\t// Needs to be before `ogg` check\n\tif (check([0x4F, 0x70, 0x75, 0x73, 0x48, 0x65, 0x61, 0x64], {offset: 28})) {\n\t\treturn {\n\t\t\text: 'opus',\n\t\t\tmime: 'audio/opus'\n\t\t};\n\t}\n\n\t// If 'OggS' in first bytes, then OGG container\n\tif (check([0x4F, 0x67, 0x67, 0x53])) {\n\t\t// This is a OGG container\n\n\t\t// If ' theora' in header.\n\t\tif (check([0x80, 0x74, 0x68, 0x65, 0x6F, 0x72, 0x61], {offset: 28})) {\n\t\t\treturn {\n\t\t\t\text: 'ogv',\n\t\t\t\tmime: 'video/ogg'\n\t\t\t};\n\t\t}\n\t\t// If '\\x01video' in header.\n\t\tif (check([0x01, 0x76, 0x69, 0x64, 0x65, 0x6F, 0x00], {offset: 28})) {\n\t\t\treturn {\n\t\t\t\text: 'ogm',\n\t\t\t\tmime: 'video/ogg'\n\t\t\t};\n\t\t}\n\t\t// If ' FLAC' in header https://xiph.org/flac/faq.html\n\t\tif (check([0x7F, 0x46, 0x4C, 0x41, 0x43], {offset: 28})) {\n\t\t\treturn {\n\t\t\t\text: 'oga',\n\t\t\t\tmime: 'audio/ogg'\n\t\t\t};\n\t\t}\n\n\t\t// 'Speex ' in header https://en.wikipedia.org/wiki/Speex\n\t\tif (check([0x53, 0x70, 0x65, 0x65, 0x78, 0x20, 0x20], {offset: 28})) {\n\t\t\treturn {\n\t\t\t\text: 'spx',\n\t\t\t\tmime: 'audio/ogg'\n\t\t\t};\n\t\t}\n\n\t\t// If '\\x01vorbis' in header\n\t\tif (check([0x01, 0x76, 0x6F, 0x72, 0x62, 0x69, 0x73], {offset: 28})) {\n\t\t\treturn {\n\t\t\t\text: 'ogg',\n\t\t\t\tmime: 'audio/ogg'\n\t\t\t};\n\t\t}\n\n\t\t// Default OGG container https://www.iana.org/assignments/media-types/application/ogg\n\t\treturn {\n\t\t\text: 'ogx',\n\t\t\tmime: 'application/ogg'\n\t\t};\n\t}\n\n\tif (check([0x66, 0x4C, 0x61, 0x43])) {\n\t\treturn {\n\t\t\text: 'flac',\n\t\t\tmime: 'audio/x-flac'\n\t\t};\n\t}\n\n\tif (check([0x4D, 0x41, 0x43, 0x20])) { // 'MAC '\n\t\treturn {\n\t\t\text: 'ape',\n\t\t\tmime: 'audio/ape'\n\t\t};\n\t}\n\n\tif (check([0x77, 0x76, 0x70, 0x6B])) { // 'wvpk'\n\t\treturn {\n\t\t\text: 'wv',\n\t\t\tmime: 'audio/wavpack'\n\t\t};\n\t}\n\n\tif (check([0x23, 0x21, 0x41, 0x4D, 0x52, 0x0A])) {\n\t\treturn {\n\t\t\text: 'amr',\n\t\t\tmime: 'audio/amr'\n\t\t};\n\t}\n\n\tif (check([0x25, 0x50, 0x44, 0x46])) {\n\t\treturn {\n\t\t\text: 'pdf',\n\t\t\tmime: 'application/pdf'\n\t\t};\n\t}\n\n\tif (check([0x4D, 0x5A])) {\n\t\treturn {\n\t\t\text: 'exe',\n\t\t\tmime: 'application/x-msdownload'\n\t\t};\n\t}\n\n\tif (\n\t\t(buf[0] === 0x43 || buf[0] === 0x46) &&\n\t\tcheck([0x57, 0x53], {offset: 1})\n\t) {\n\t\treturn {\n\t\t\text: 'swf',\n\t\t\tmime: 'application/x-shockwave-flash'\n\t\t};\n\t}\n\n\tif (check([0x7B, 0x5C, 0x72, 0x74, 0x66])) {\n\t\treturn {\n\t\t\text: 'rtf',\n\t\t\tmime: 'application/rtf'\n\t\t};\n\t}\n\n\tif (check([0x00, 0x61, 0x73, 0x6D])) {\n\t\treturn {\n\t\t\text: 'wasm',\n\t\t\tmime: 'application/wasm'\n\t\t};\n\t}\n\n\tif (\n\t\tcheck([0x77, 0x4F, 0x46, 0x46]) &&\n\t\t(\n\t\t\tcheck([0x00, 0x01, 0x00, 0x00], {offset: 4}) ||\n\t\t\tcheck([0x4F, 0x54, 0x54, 0x4F], {offset: 4})\n\t\t)\n\t) {\n\t\treturn {\n\t\t\text: 'woff',\n\t\t\tmime: 'font/woff'\n\t\t};\n\t}\n\n\tif (\n\t\tcheck([0x77, 0x4F, 0x46, 0x32]) &&\n\t\t(\n\t\t\tcheck([0x00, 0x01, 0x00, 0x00], {offset: 4}) ||\n\t\t\tcheck([0x4F, 0x54, 0x54, 0x4F], {offset: 4})\n\t\t)\n\t) {\n\t\treturn {\n\t\t\text: 'woff2',\n\t\t\tmime: 'font/woff2'\n\t\t};\n\t}\n\n\tif (\n\t\tcheck([0x4C, 0x50], {offset: 34}) &&\n\t\t(\n\t\t\tcheck([0x00, 0x00, 0x01], {offset: 8}) ||\n\t\t\tcheck([0x01, 0x00, 0x02], {offset: 8}) ||\n\t\t\tcheck([0x02, 0x00, 0x02], {offset: 8})\n\t\t)\n\t) {\n\t\treturn {\n\t\t\text: 'eot',\n\t\t\tmime: 'application/vnd.ms-fontobject'\n\t\t};\n\t}\n\n\tif (check([0x00, 0x01, 0x00, 0x00, 0x00])) {\n\t\treturn {\n\t\t\text: 'ttf',\n\t\t\tmime: 'font/ttf'\n\t\t};\n\t}\n\n\tif (check([0x4F, 0x54, 0x54, 0x4F, 0x00])) {\n\t\treturn {\n\t\t\text: 'otf',\n\t\t\tmime: 'font/otf'\n\t\t};\n\t}\n\n\tif (check([0x00, 0x00, 0x01, 0x00])) {\n\t\treturn {\n\t\t\text: 'ico',\n\t\t\tmime: 'image/x-icon'\n\t\t};\n\t}\n\n\tif (check([0x00, 0x00, 0x02, 0x00])) {\n\t\treturn {\n\t\t\text: 'cur',\n\t\t\tmime: 'image/x-icon'\n\t\t};\n\t}\n\n\tif (check([0x46, 0x4C, 0x56, 0x01])) {\n\t\treturn {\n\t\t\text: 'flv',\n\t\t\tmime: 'video/x-flv'\n\t\t};\n\t}\n\n\tif (check([0x25, 0x21])) {\n\t\treturn {\n\t\t\text: 'ps',\n\t\t\tmime: 'application/postscript'\n\t\t};\n\t}\n\n\tif (check([0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00])) {\n\t\treturn {\n\t\t\text: 'xz',\n\t\t\tmime: 'application/x-xz'\n\t\t};\n\t}\n\n\tif (check([0x53, 0x51, 0x4C, 0x69])) {\n\t\treturn {\n\t\t\text: 'sqlite',\n\t\t\tmime: 'application/x-sqlite3'\n\t\t};\n\t}\n\n\tif (check([0x4E, 0x45, 0x53, 0x1A])) {\n\t\treturn {\n\t\t\text: 'nes',\n\t\t\tmime: 'application/x-nintendo-nes-rom'\n\t\t};\n\t}\n\n\tif (check([0x43, 0x72, 0x32, 0x34])) {\n\t\treturn {\n\t\t\text: 'crx',\n\t\t\tmime: 'application/x-google-chrome-extension'\n\t\t};\n\t}\n\n\tif (\n\t\tcheck([0x4D, 0x53, 0x43, 0x46]) ||\n\t\tcheck([0x49, 0x53, 0x63, 0x28])\n\t) {\n\t\treturn {\n\t\t\text: 'cab',\n\t\t\tmime: 'application/vnd.ms-cab-compressed'\n\t\t};\n\t}\n\n\t// Needs to be before `ar` check\n\tif (check([0x21, 0x3C, 0x61, 0x72, 0x63, 0x68, 0x3E, 0x0A, 0x64, 0x65, 0x62, 0x69, 0x61, 0x6E, 0x2D, 0x62, 0x69, 0x6E, 0x61, 0x72, 0x79])) {\n\t\treturn {\n\t\t\text: 'deb',\n\t\t\tmime: 'application/x-deb'\n\t\t};\n\t}\n\n\tif (check([0x21, 0x3C, 0x61, 0x72, 0x63, 0x68, 0x3E])) {\n\t\treturn {\n\t\t\text: 'ar',\n\t\t\tmime: 'application/x-unix-archive'\n\t\t};\n\t}\n\n\tif (check([0xED, 0xAB, 0xEE, 0xDB])) {\n\t\treturn {\n\t\t\text: 'rpm',\n\t\t\tmime: 'application/x-rpm'\n\t\t};\n\t}\n\n\tif (\n\t\tcheck([0x1F, 0xA0]) ||\n\t\tcheck([0x1F, 0x9D])\n\t) {\n\t\treturn {\n\t\t\text: 'Z',\n\t\t\tmime: 'application/x-compress'\n\t\t};\n\t}\n\n\tif (check([0x4C, 0x5A, 0x49, 0x50])) {\n\t\treturn {\n\t\t\text: 'lz',\n\t\t\tmime: 'application/x-lzip'\n\t\t};\n\t}\n\n\tif (check([0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1])) {\n\t\treturn {\n\t\t\text: 'msi',\n\t\t\tmime: 'application/x-msi'\n\t\t};\n\t}\n\n\tif (check([0x06, 0x0E, 0x2B, 0x34, 0x02, 0x05, 0x01, 0x01, 0x0D, 0x01, 0x02, 0x01, 0x01, 0x02])) {\n\t\treturn {\n\t\t\text: 'mxf',\n\t\t\tmime: 'application/mxf'\n\t\t};\n\t}\n\n\tif (check([0x47], {offset: 4}) && (check([0x47], {offset: 192}) || check([0x47], {offset: 196}))) {\n\t\treturn {\n\t\t\text: 'mts',\n\t\t\tmime: 'video/mp2t'\n\t\t};\n\t}\n\n\tif (check([0x42, 0x4C, 0x45, 0x4E, 0x44, 0x45, 0x52])) {\n\t\treturn {\n\t\t\text: 'blend',\n\t\t\tmime: 'application/x-blender'\n\t\t};\n\t}\n\n\tif (check([0x42, 0x50, 0x47, 0xFB])) {\n\t\treturn {\n\t\t\text: 'bpg',\n\t\t\tmime: 'image/bpg'\n\t\t};\n\t}\n\n\tif (check([0x00, 0x00, 0x00, 0x0C, 0x6A, 0x50, 0x20, 0x20, 0x0D, 0x0A, 0x87, 0x0A])) {\n\t\t// JPEG-2000 family\n\n\t\tif (check([0x6A, 0x70, 0x32, 0x20], {offset: 20})) {\n\t\t\treturn {\n\t\t\t\text: 'jp2',\n\t\t\t\tmime: 'image/jp2'\n\t\t\t};\n\t\t}\n\n\t\tif (check([0x6A, 0x70, 0x78, 0x20], {offset: 20})) {\n\t\t\treturn {\n\t\t\t\text: 'jpx',\n\t\t\t\tmime: 'image/jpx'\n\t\t\t};\n\t\t}\n\n\t\tif (check([0x6A, 0x70, 0x6D, 0x20], {offset: 20})) {\n\t\t\treturn {\n\t\t\t\text: 'jpm',\n\t\t\t\tmime: 'image/jpm'\n\t\t\t};\n\t\t}\n\n\t\tif (check([0x6D, 0x6A, 0x70, 0x32], {offset: 20})) {\n\t\t\treturn {\n\t\t\t\text: 'mj2',\n\t\t\t\tmime: 'image/mj2'\n\t\t\t};\n\t\t}\n\t}\n\n\tif (check([0x46, 0x4F, 0x52, 0x4D, 0x00])) {\n\t\treturn {\n\t\t\text: 'aif',\n\t\t\tmime: 'audio/aiff'\n\t\t};\n\t}\n\n\tif (checkString(' {\n const lines = html.split('\\n');\n if (lines[0].substring(0, 2) === ' ') {\n for (let i = 0; i < lines.length; i += 1) {\n if (lines[i].substring(0, 2) === ' ') {\n lines[i] = lines[i].slice(2);\n }\n }\n }\n return lines.join('\\n');\n};\n\nmodule.exports = (Module, base) => {\n const ri = base.GetIterator();\n const blocks = [];\n let block;\n let para;\n let textline;\n let word;\n let symbol;\n\n const enumToString = (value, prefix) => (\n Object.keys(Module)\n .filter(e => (e.substr(0, prefix.length + 1) === `${prefix}_`))\n .filter(e => Module[e] === value)\n .map(e => e.slice(prefix.length + 1))[0]\n );\n\n ri.Begin();\n do {\n if (ri.IsAtBeginningOf(Module.RIL_BLOCK)) {\n const poly = ri.BlockPolygon();\n let polygon = null;\n // BlockPolygon() returns null when automatic page segmentation is off\n if (Module.getPointer(poly) > 0) {\n const n = poly.get_n();\n const px = poly.get_x();\n const py = poly.get_y();\n polygon = [];\n for (let i = 0; i < n; i += 1) {\n polygon.push([px.getValue(i), py.getValue(i)]);\n }\n Module._ptaDestroy(Module.getPointer(poly));\n }\n\n block = {\n paragraphs: [],\n text: ri.GetUTF8Text(Module.RIL_BLOCK),\n confidence: ri.Confidence(Module.RIL_BLOCK),\n baseline: ri.getBaseline(Module.RIL_BLOCK),\n bbox: ri.getBoundingBox(Module.RIL_BLOCK),\n blocktype: enumToString(ri.BlockType(), 'PT'),\n polygon,\n };\n blocks.push(block);\n }\n if (ri.IsAtBeginningOf(Module.RIL_PARA)) {\n para = {\n lines: [],\n text: ri.GetUTF8Text(Module.RIL_PARA),\n confidence: ri.Confidence(Module.RIL_PARA),\n baseline: ri.getBaseline(Module.RIL_PARA),\n bbox: ri.getBoundingBox(Module.RIL_PARA),\n is_ltr: !!ri.ParagraphIsLtr(),\n };\n block.paragraphs.push(para);\n }\n if (ri.IsAtBeginningOf(Module.RIL_TEXTLINE)) {\n textline = {\n words: [],\n text: ri.GetUTF8Text(Module.RIL_TEXTLINE),\n confidence: ri.Confidence(Module.RIL_TEXTLINE),\n baseline: ri.getBaseline(Module.RIL_TEXTLINE),\n bbox: ri.getBoundingBox(Module.RIL_TEXTLINE),\n };\n para.lines.push(textline);\n }\n if (ri.IsAtBeginningOf(Module.RIL_WORD)) {\n const fontInfo = ri.getWordFontAttributes();\n const wordDir = ri.WordDirection();\n word = {\n symbols: [],\n choices: [],\n\n text: ri.GetUTF8Text(Module.RIL_WORD),\n confidence: ri.Confidence(Module.RIL_WORD),\n baseline: ri.getBaseline(Module.RIL_WORD),\n bbox: ri.getBoundingBox(Module.RIL_WORD),\n\n is_numeric: !!ri.WordIsNumeric(),\n in_dictionary: !!ri.WordIsFromDictionary(),\n direction: enumToString(wordDir, 'DIR'),\n language: ri.WordRecognitionLanguage(),\n\n is_bold: fontInfo.is_bold,\n is_italic: fontInfo.is_italic,\n is_underlined: fontInfo.is_underlined,\n is_monospace: fontInfo.is_monospace,\n is_serif: fontInfo.is_serif,\n is_smallcaps: fontInfo.is_smallcaps,\n font_size: fontInfo.pointsize,\n font_id: fontInfo.font_id,\n font_name: fontInfo.font_name,\n };\n const wc = new Module.WordChoiceIterator(ri);\n do {\n word.choices.push({\n text: wc.GetUTF8Text(),\n confidence: wc.Confidence(),\n });\n } while (wc.Next());\n Module.destroy(wc);\n textline.words.push(word);\n }\n\n // let image = null;\n // var pix = ri.GetBinaryImage(Module.RIL_SYMBOL)\n // var image = pix2array(pix);\n // // for some reason it seems that things stop working if you destroy pics\n // Module._pixDestroy(Module.getPointer(pix));\n if (ri.IsAtBeginningOf(Module.RIL_SYMBOL)) {\n symbol = {\n choices: [],\n image: null,\n text: ri.GetUTF8Text(Module.RIL_SYMBOL),\n confidence: ri.Confidence(Module.RIL_SYMBOL),\n baseline: ri.getBaseline(Module.RIL_SYMBOL),\n bbox: ri.getBoundingBox(Module.RIL_SYMBOL),\n is_superscript: !!ri.SymbolIsSuperscript(),\n is_subscript: !!ri.SymbolIsSubscript(),\n is_dropcap: !!ri.SymbolIsDropcap(),\n };\n word.symbols.push(symbol);\n const ci = new Module.ChoiceIterator(ri);\n do {\n symbol.choices.push({\n text: ci.GetUTF8Text(),\n confidence: ci.Confidence(),\n });\n } while (ci.Next());\n // Module.destroy(i);\n }\n } while (ri.Next(Module.RIL_SYMBOL));\n Module.destroy(ri);\n\n return {\n text: base.GetUTF8Text(),\n html: deindent(base.GetHOCRText()),\n confidence: base.MeanTextConf(),\n blocks,\n psm: enumToString(base.GetPageSegMode(), 'PSM'),\n oem: enumToString(base.oem(), 'OEM'),\n version: base.Version(),\n };\n};\n"],"sourceRoot":""} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 9a2b64c..2875c49 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,56 @@ "@babel/highlight": "^7.0.0" } }, + "@babel/generator": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.1.6.tgz", + "integrity": "sha512-brwPBtVvdYdGxtenbQgfCdDPmtkmUBZPjUoK5SXJEBuHaA5BCubh9ly65fzXz7R6o5rA76Rs22ES8Z+HCc0YIQ==", + "dev": true, + "requires": { + "@babel/types": "^7.1.6", + "jsesc": "^2.5.1", + "lodash": "^4.17.10", + "source-map": "^0.5.0", + "trim-right": "^1.0.1" + }, + "dependencies": { + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + } + } + }, + "@babel/helper-function-name": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz", + "integrity": "sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.0.0", + "@babel/template": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz", + "integrity": "sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ==", + "dev": true, + "requires": { + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0.tgz", + "integrity": "sha512-MXkOJqva62dfC0w85mEf/LucPPS/1+04nmmRMPEBUB++hiiThQ2zPtX/mEWQ3mtzCEjIJvPY8nuwxXtQeQwUag==", + "dev": true, + "requires": { + "@babel/types": "^7.0.0" + } + }, "@babel/highlight": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", @@ -61,6 +111,82 @@ } } }, + "@babel/parser": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.1.6.tgz", + "integrity": "sha512-dWP6LJm9nKT6ALaa+bnL247GHHMWir3vSlZ2+IHgHgktZQx0L3Uvq2uAWcuzIe+fujRsYWBW2q622C5UvGK9iQ==", + "dev": true + }, + "@babel/template": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.1.2.tgz", + "integrity": "sha512-SY1MmplssORfFiLDcOETrW7fCLl+PavlwMh92rrGcikQaRq4iWPVH0MpwPpY3etVMx6RnDjXtr6VZYr/IbP/Ag==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.1.2", + "@babel/types": "^7.1.2" + } + }, + "@babel/traverse": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.1.6.tgz", + "integrity": "sha512-CXedit6GpISz3sC2k2FsGCUpOhUqKdyL0lqNrImQojagnUMXf8hex4AxYFRuMkNGcvJX5QAFGzB5WJQmSv8SiQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/generator": "^7.1.6", + "@babel/helper-function-name": "^7.1.0", + "@babel/helper-split-export-declaration": "^7.0.0", + "@babel/parser": "^7.1.6", + "@babel/types": "^7.1.6", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.10" + }, + "dependencies": { + "debug": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.0.tgz", + "integrity": "sha512-heNPJUJIqC+xB6ayLAMHaIrmN9HKa7aQO8MGqKpvCA+uJYVcvR6l5kgdrhRuwPFHU7P5/A1w0BjByPHwpfTDKg==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + } + } + }, + "@babel/types": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.1.6.tgz", + "integrity": "sha512-DMiUzlY9DSjVsOylJssxLHSgj6tWM9PRFJOGW/RaOglVOK9nzTxoOMfTfRQXGUCUQ/HmlG2efwC+XqUEJ5ay4w==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.10", + "to-fast-properties": "^2.0.0" + }, + "dependencies": { + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + } + } + }, "@webassemblyjs/ast": { "version": "1.7.11", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.7.11.tgz", @@ -588,6 +714,12 @@ "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", "dev": true }, + "browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, "browserify-aes": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.0.6.tgz", @@ -1228,6 +1360,12 @@ "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", "dev": true }, + "diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true + }, "diffie-hellman": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.2.tgz", @@ -1305,14 +1443,6 @@ "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", "dev": true }, - "encoding": { - "version": "0.1.12", - "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", - "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", - "requires": { - "iconv-lite": "~0.4.13" - } - }, "end-of-stream": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", @@ -1791,6 +1921,12 @@ "strip-eof": "^1.0.0" } }, + "expect.js": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/expect.js/-/expect.js-0.3.1.tgz", + "integrity": "sha1-sKWaDS7/VDdUTr8M6qYBWEHQm1s=", + "dev": true + }, "express": { "version": "4.16.4", "resolved": "https://registry.npmjs.org/express/-/express-4.16.4.tgz", @@ -2162,14 +2298,12 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -2184,20 +2318,17 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "core-util-is": { "version": "1.0.2", @@ -2314,8 +2445,7 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "ini": { "version": "1.3.5", @@ -2327,7 +2457,6 @@ "version": "1.0.0", "bundled": true, "dev": true, - "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -2342,7 +2471,6 @@ "version": "3.0.4", "bundled": true, "dev": true, - "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -2350,14 +2478,12 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "minipass": { "version": "2.2.4", "bundled": true, "dev": true, - "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -2376,7 +2502,6 @@ "version": "0.5.1", "bundled": true, "dev": true, - "optional": true, "requires": { "minimist": "0.0.8" } @@ -2457,8 +2582,7 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "object-assign": { "version": "4.1.1", @@ -2470,7 +2594,6 @@ "version": "1.4.0", "bundled": true, "dev": true, - "optional": true, "requires": { "wrappy": "1" } @@ -2592,7 +2715,6 @@ "version": "1.0.2", "bundled": true, "dev": true, - "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -2714,12 +2836,24 @@ "integrity": "sha512-HchvMJNYh9dGSCy8pOQ2O8u/hoXaL+0XhnrwH0RyLiSXMMTl9W3N6KUU73+JFOg5PGjtzl6VZzUQsnrpm7Szag==", "dev": true }, + "globals": { + "version": "11.9.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.9.0.tgz", + "integrity": "sha512-5cJVtyXWH8PiJPVLZzzoIizXx944O4OmRro5MWKx5fT4MgcN7OfaMutPeaTdJCCURwbWdhhcCWcKIffPnmTzBg==", + "dev": true + }, "graceful-fs": { "version": "4.1.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", "dev": true }, + "growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "dev": true + }, "has": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/has/-/has-1.0.1.tgz", @@ -2820,6 +2954,12 @@ "minimalistic-assert": "^1.0.0" } }, + "he": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", + "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "dev": true + }, "hmac-drbg": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", @@ -2849,11 +2989,6 @@ "statuses": ">= 1.4.0 < 2" } }, - "iconv-lite": { - "version": "0.4.18", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.18.tgz", - "integrity": "sha512-sr1ZQph3UwHTR0XftSbK85OvBbxe/abLGzEnPENCQwmHf7sck8Oyu4ob3LgBxWWxRoM+QszeUyl7jbqapu2TqA==" - }, "idb-keyval": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/idb-keyval/-/idb-keyval-3.1.0.tgz", @@ -3198,7 +3333,8 @@ "is-stream": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true }, "is-symbol": { "version": "1.0.2", @@ -3232,6 +3368,27 @@ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, + "istanbul-lib-coverage": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz", + "integrity": "sha512-nPvSZsVlbG9aLhZYaC3Oi1gT/tpyo3Yt5fNyf6NmcKIayz4VV/txxJFFKAK/gU4dcNn8ehsanBbVHVl0+amOLA==", + "dev": true + }, + "istanbul-lib-instrument": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.0.0.tgz", + "integrity": "sha512-eQY9vN9elYjdgN9Iv6NS/00bptm02EBBk70lRMaVjeA6QYocQgenVrSgC28TJurdnZa80AGO3ASdFN+w/njGiQ==", + "dev": true, + "requires": { + "@babel/generator": "^7.0.0", + "@babel/parser": "^7.0.0", + "@babel/template": "^7.0.0", + "@babel/traverse": "^7.0.0", + "@babel/types": "^7.0.0", + "istanbul-lib-coverage": "^2.0.1", + "semver": "^5.5.0" + } + }, "js-tokens": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", @@ -3256,6 +3413,12 @@ } } }, + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true + }, "json-parse-better-errors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", @@ -3567,6 +3730,42 @@ "minimist": "0.0.8" } }, + "mocha": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", + "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", + "dev": true, + "requires": { + "browser-stdout": "1.3.1", + "commander": "2.15.1", + "debug": "3.1.0", + "diff": "3.5.0", + "escape-string-regexp": "1.0.5", + "glob": "7.1.2", + "growl": "1.10.5", + "he": "1.1.1", + "minimatch": "3.0.4", + "mkdirp": "0.5.1", + "supports-color": "5.4.0" + }, + "dependencies": { + "commander": { + "version": "2.15.1", + "resolved": "http://registry.npmjs.org/commander/-/commander-2.15.1.tgz", + "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", + "dev": true + }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } + } + }, "move-concurrently": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", @@ -3664,13 +3863,9 @@ "dev": true }, "node-fetch": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz", - "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==", - "requires": { - "encoding": "^0.1.11", - "is-stream": "^1.0.1" - } + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.3.0.tgz", + "integrity": "sha512-MOd8pV3fxENbryESLgVIeaGKrdl+uaYhCSSVkjeOb/31/njTpcis5aWfdqgNlHIrKOLRbMnfPINPOML2CIFeXA==" }, "node-libs-browser": { "version": "2.1.0", @@ -3780,98 +3975,1237 @@ "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", "dev": true }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true - }, - "object-copy": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "nyc": { + "version": "13.1.0", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-13.1.0.tgz", + "integrity": "sha512-3GyY6TpQ58z9Frpv4GMExE1SV2tAgYqC7HSy2omEhNiCT3mhT9NyiOvIE8zkbuJVFzmvvNTnE4h/7/wQae7xLg==", "dev": true, "requires": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" + "archy": "^1.0.0", + "arrify": "^1.0.1", + "caching-transform": "^2.0.0", + "convert-source-map": "^1.6.0", + "debug-log": "^1.0.1", + "find-cache-dir": "^2.0.0", + "find-up": "^3.0.0", + "foreground-child": "^1.5.6", + "glob": "^7.1.3", + "istanbul-lib-coverage": "^2.0.1", + "istanbul-lib-hook": "^2.0.1", + "istanbul-lib-instrument": "^3.0.0", + "istanbul-lib-report": "^2.0.2", + "istanbul-lib-source-maps": "^2.0.1", + "istanbul-reports": "^2.0.1", + "make-dir": "^1.3.0", + "merge-source-map": "^1.1.0", + "resolve-from": "^4.0.0", + "rimraf": "^2.6.2", + "signal-exit": "^3.0.2", + "spawn-wrap": "^1.4.2", + "test-exclude": "^5.0.0", + "uuid": "^3.3.2", + "yargs": "11.1.0", + "yargs-parser": "^9.0.2" }, "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "align-text": { + "version": "0.1.4", + "bundled": true, "dev": true, "requires": { - "is-descriptor": "^0.1.0" + "kind-of": "^3.0.2", + "longest": "^1.0.1", + "repeat-string": "^1.5.2" } - } - } - }, - "object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", - "dev": true, - "requires": { - "isobject": "^3.0.0" - }, - "dependencies": { - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + }, + "amdefine": { + "version": "1.0.1", + "bundled": true, "dev": true - } - } - }, - "object.assign": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", - "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", - "dev": true, - "requires": { - "define-properties": "^1.1.2", - "function-bind": "^1.1.1", - "has-symbols": "^1.0.0", - "object-keys": "^1.0.11" - }, - "dependencies": { - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + }, + "ansi-regex": { + "version": "3.0.0", + "bundled": true, "dev": true }, - "object-keys": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", - "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==", + "append-transform": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "default-require-extensions": "^2.0.0" + } + }, + "archy": { + "version": "1.0.0", + "bundled": true, "dev": true - } - } - }, - "object.entries": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.0.4.tgz", - "integrity": "sha1-G/mk3SKI9bM/Opk9JXZh8F0WGl8=", - "dev": true, - "requires": { - "define-properties": "^1.1.2", - "es-abstract": "^1.6.1", - "function-bind": "^1.1.0", - "has": "^1.0.1" - } - }, - "object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", - "dev": true, - "requires": { - "isobject": "^3.0.1" - }, - "dependencies": { + }, + "arrify": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "async": { + "version": "1.5.2", + "bundled": true, + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "builtin-modules": { + "version": "1.1.1", + "bundled": true, + "dev": true + }, + "caching-transform": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "make-dir": "^1.0.0", + "md5-hex": "^2.0.0", + "package-hash": "^2.0.0", + "write-file-atomic": "^2.0.0" + } + }, + "camelcase": { + "version": "1.2.1", + "bundled": true, + "dev": true, + "optional": true + }, + "center-align": { + "version": "0.1.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "align-text": "^0.1.3", + "lazy-cache": "^1.0.3" + } + }, + "cliui": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "center-align": "^0.1.1", + "right-align": "^0.1.1", + "wordwrap": "0.0.2" + }, + "dependencies": { + "wordwrap": { + "version": "0.0.2", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "commondir": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true, + "dev": true + }, + "convert-source-map": { + "version": "1.6.0", + "bundled": true, + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + } + }, + "cross-spawn": { + "version": "4.0.2", + "bundled": true, + "dev": true, + "requires": { + "lru-cache": "^4.0.1", + "which": "^1.2.9" + } + }, + "debug": { + "version": "3.1.0", + "bundled": true, + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "debug-log": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "decamelize": { + "version": "1.2.0", + "bundled": true, + "dev": true + }, + "default-require-extensions": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "strip-bom": "^3.0.0" + } + }, + "error-ex": { + "version": "1.3.2", + "bundled": true, + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es6-error": { + "version": "4.1.1", + "bundled": true, + "dev": true + }, + "execa": { + "version": "0.7.0", + "bundled": true, + "dev": true, + "requires": { + "cross-spawn": "^5.0.1", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + }, + "dependencies": { + "cross-spawn": { + "version": "5.1.0", + "bundled": true, + "dev": true, + "requires": { + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + } + } + }, + "find-cache-dir": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^1.0.0", + "pkg-dir": "^3.0.0" + } + }, + "find-up": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "foreground-child": { + "version": "1.5.6", + "bundled": true, + "dev": true, + "requires": { + "cross-spawn": "^4", + "signal-exit": "^3.0.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "get-caller-file": { + "version": "1.0.3", + "bundled": true, + "dev": true + }, + "get-stream": { + "version": "3.0.0", + "bundled": true, + "dev": true + }, + "glob": { + "version": "7.1.3", + "bundled": true, + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "graceful-fs": { + "version": "4.1.11", + "bundled": true, + "dev": true + }, + "handlebars": { + "version": "4.0.11", + "bundled": true, + "dev": true, + "requires": { + "async": "^1.4.0", + "optimist": "^0.6.1", + "source-map": "^0.4.4", + "uglify-js": "^2.6" + }, + "dependencies": { + "source-map": { + "version": "0.4.4", + "bundled": true, + "dev": true, + "requires": { + "amdefine": ">=0.0.4" + } + } + } + }, + "has-flag": { + "version": "3.0.0", + "bundled": true, + "dev": true + }, + "hosted-git-info": { + "version": "2.7.1", + "bundled": true, + "dev": true + }, + "imurmurhash": { + "version": "0.1.4", + "bundled": true, + "dev": true + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true, + "dev": true + }, + "invert-kv": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "is-arrayish": { + "version": "0.2.1", + "bundled": true, + "dev": true + }, + "is-buffer": { + "version": "1.1.6", + "bundled": true, + "dev": true + }, + "is-builtin-module": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "builtin-modules": "^1.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "is-stream": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "isexe": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "istanbul-lib-coverage": { + "version": "2.0.1", + "bundled": true, + "dev": true + }, + "istanbul-lib-hook": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "append-transform": "^1.0.0" + } + }, + "istanbul-lib-report": { + "version": "2.0.2", + "bundled": true, + "dev": true, + "requires": { + "istanbul-lib-coverage": "^2.0.1", + "make-dir": "^1.3.0", + "supports-color": "^5.4.0" + } + }, + "istanbul-lib-source-maps": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "debug": "^3.1.0", + "istanbul-lib-coverage": "^2.0.1", + "make-dir": "^1.3.0", + "rimraf": "^2.6.2", + "source-map": "^0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "bundled": true, + "dev": true + } + } + }, + "istanbul-reports": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "handlebars": "^4.0.11" + } + }, + "json-parse-better-errors": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "kind-of": { + "version": "3.2.2", + "bundled": true, + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + }, + "lazy-cache": { + "version": "1.0.4", + "bundled": true, + "dev": true, + "optional": true + }, + "lcid": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "invert-kv": "^1.0.0" + } + }, + "load-json-file": { + "version": "4.0.0", + "bundled": true, + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "lodash.flattendeep": { + "version": "4.4.0", + "bundled": true, + "dev": true + }, + "longest": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "lru-cache": { + "version": "4.1.3", + "bundled": true, + "dev": true, + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "make-dir": { + "version": "1.3.0", + "bundled": true, + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "md5-hex": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "md5-o-matic": "^0.1.1" + } + }, + "md5-o-matic": { + "version": "0.1.1", + "bundled": true, + "dev": true + }, + "mem": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "merge-source-map": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "requires": { + "source-map": "^0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "bundled": true, + "dev": true + } + } + }, + "mimic-fn": { + "version": "1.2.0", + "bundled": true, + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.10", + "bundled": true, + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "requires": { + "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "bundled": true, + "dev": true + } + } + }, + "ms": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "normalize-package-data": { + "version": "2.4.0", + "bundled": true, + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "is-builtin-module": "^1.0.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "npm-run-path": { + "version": "2.0.2", + "bundled": true, + "dev": true, + "requires": { + "path-key": "^2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "optimist": { + "version": "0.6.1", + "bundled": true, + "dev": true, + "requires": { + "minimist": "~0.0.1", + "wordwrap": "~0.0.2" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "os-locale": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "requires": { + "execa": "^0.7.0", + "lcid": "^1.0.0", + "mem": "^1.1.0" + } + }, + "p-finally": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "p-limit": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "package-hash": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "lodash.flattendeep": "^4.4.0", + "md5-hex": "^2.0.0", + "release-zalgo": "^1.0.0" + } + }, + "parse-json": { + "version": "4.0.0", + "bundled": true, + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "path-exists": { + "version": "3.0.0", + "bundled": true, + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "path-key": { + "version": "2.0.1", + "bundled": true, + "dev": true + }, + "path-type": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "pify": { + "version": "3.0.0", + "bundled": true, + "dev": true + }, + "pkg-dir": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "find-up": "^3.0.0" + } + }, + "pseudomap": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "read-pkg": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + } + }, + "read-pkg-up": { + "version": "4.0.0", + "bundled": true, + "dev": true, + "requires": { + "find-up": "^3.0.0", + "read-pkg": "^3.0.0" + } + }, + "release-zalgo": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "es6-error": "^4.0.1" + } + }, + "repeat-string": { + "version": "1.6.1", + "bundled": true, + "dev": true + }, + "require-directory": { + "version": "2.1.1", + "bundled": true, + "dev": true + }, + "require-main-filename": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "resolve-from": { + "version": "4.0.0", + "bundled": true, + "dev": true + }, + "right-align": { + "version": "0.1.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "align-text": "^0.1.1" + } + }, + "rimraf": { + "version": "2.6.2", + "bundled": true, + "dev": true, + "requires": { + "glob": "^7.0.5" + } + }, + "safe-buffer": { + "version": "5.1.2", + "bundled": true, + "dev": true + }, + "semver": { + "version": "5.5.0", + "bundled": true, + "dev": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "shebang-command": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "dev": true + }, + "source-map": { + "version": "0.5.7", + "bundled": true, + "dev": true, + "optional": true + }, + "spawn-wrap": { + "version": "1.4.2", + "bundled": true, + "dev": true, + "requires": { + "foreground-child": "^1.5.6", + "mkdirp": "^0.5.0", + "os-homedir": "^1.0.1", + "rimraf": "^2.6.2", + "signal-exit": "^3.0.2", + "which": "^1.3.0" + } + }, + "spdx-correct": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.1.0", + "bundled": true, + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.0", + "bundled": true, + "dev": true + }, + "string-width": { + "version": "2.1.1", + "bundled": true, + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "strip-bom": { + "version": "3.0.0", + "bundled": true, + "dev": true + }, + "strip-eof": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "bundled": true, + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "test-exclude": { + "version": "5.0.0", + "bundled": true, + "dev": true, + "requires": { + "arrify": "^1.0.1", + "minimatch": "^3.0.4", + "read-pkg-up": "^4.0.0", + "require-main-filename": "^1.0.1" + } + }, + "uglify-js": { + "version": "2.8.29", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "source-map": "~0.5.1", + "uglify-to-browserify": "~1.0.0", + "yargs": "~3.10.0" + }, + "dependencies": { + "yargs": { + "version": "3.10.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "camelcase": "^1.0.2", + "cliui": "^2.1.0", + "decamelize": "^1.0.0", + "window-size": "0.1.0" + } + } + } + }, + "uglify-to-browserify": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "uuid": { + "version": "3.3.2", + "bundled": true, + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.3", + "bundled": true, + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "which": { + "version": "1.3.1", + "bundled": true, + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "window-size": { + "version": "0.1.0", + "bundled": true, + "dev": true, + "optional": true + }, + "wordwrap": { + "version": "0.0.3", + "bundled": true, + "dev": true + }, + "wrap-ansi": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "bundled": true, + "dev": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + } + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "write-file-atomic": { + "version": "2.3.0", + "bundled": true, + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.2" + } + }, + "y18n": { + "version": "3.2.1", + "bundled": true, + "dev": true + }, + "yallist": { + "version": "2.1.2", + "bundled": true, + "dev": true + }, + "yargs": { + "version": "11.1.0", + "bundled": true, + "dev": true, + "requires": { + "cliui": "^4.0.0", + "decamelize": "^1.1.1", + "find-up": "^2.1.0", + "get-caller-file": "^1.0.1", + "os-locale": "^2.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^9.0.2" + }, + "dependencies": { + "cliui": { + "version": "4.1.0", + "bundled": true, + "dev": true, + "requires": { + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" + } + }, + "find-up": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "1.3.0", + "bundled": true, + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "bundled": true, + "dev": true + } + } + }, + "yargs-parser": { + "version": "9.0.2", + "bundled": true, + "dev": true, + "requires": { + "camelcase": "^4.1.0" + }, + "dependencies": { + "camelcase": { + "version": "4.1.0", + "bundled": true, + "dev": true + } + } + } + } + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "requires": { + "isobject": "^3.0.0" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + }, + "dependencies": { + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "object-keys": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", + "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==", + "dev": true + } + } + }, + "object.entries": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.0.4.tgz", + "integrity": "sha1-G/mk3SKI9bM/Opk9JXZh8F0WGl8=", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "es-abstract": "^1.6.1", + "function-bind": "^1.1.0", + "has": "^1.0.1" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "requires": { + "isobject": "^3.0.1" + }, + "dependencies": { "isobject": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", @@ -5060,6 +6394,15 @@ "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "dev": true }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, "table": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/table/-/table-5.1.0.tgz", @@ -5226,6 +6569,12 @@ "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", "dev": true }, + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true + }, "to-object-path": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", @@ -5268,6 +6617,12 @@ } } }, + "trim-right": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", + "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", + "dev": true + }, "tslib": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", diff --git a/package.json b/package.json index 5e4fb5a..251bce8 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "start": "node scripts/server.js", "build": "webpack --config scripts/webpack.config.prod.js", "prepublishOnly": "npm run build", + "test:node": "nyc mocha --exit --require ./scripts/test-helper.js ./tests/*.test.js", "lint": "eslint src" }, "browser": { @@ -23,7 +24,10 @@ "eslint-plugin-import": "^2.14.0", "eslint-plugin-jsx-a11y": "^6.1.2", "eslint-plugin-react": "^7.11.1", + "expect.js": "^0.3.1", "express": "^4.16.4", + "mocha": "^5.2.0", + "nyc": "^13.1.0", "webpack": "^4.26.0", "webpack-cli": "^3.1.2", "webpack-dev-middleware": "^3.4.0" @@ -31,7 +35,7 @@ "dependencies": { "check-types": "^7.4.0", "is-url": "1.2.2", - "node-fetch": "^1.7.3", + "node-fetch": "^2.3.0", "resolve-url": "^0.2.1", "tesseract.js-core": "^2.0.0-beta.5", "tesseract.js-utils": "^1.0.0-beta.2" diff --git a/scripts/dist/tesseract.min.js b/scripts/dist/tesseract.min.js deleted file mode 100644 index f8ffa79..0000000 --- a/scripts/dist/tesseract.min.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Tesseract=t():e.Tesseract=t()}(window,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t,n){const r=n(3),o={corePath:`https://cdn.jsdelivr.net/gh/naptha/tesseract.js-core@v2.0.0-beta.5/tesseract-core${"object"==typeof WebAssembly?"":".asm"}.js`,langPath:"https://cdn.jsdelivr.net/gh/naptha/tessdata@gh-pages/4.0.0/"};{const{version:e}=n(4);o.workerPath=`https://cdn.jsdelivr.net/gh/naptha/tesseract.js@${e}/dist/worker.js`}t.defaultOptions=o,t.spawnWorker=((e,t)=>{let n;if(window.Blob&&window.URL){const e=new Blob([`importScripts("${t.workerPath}");`]);n=new Worker(window.URL.createObjectURL(e))}else n=new Worker(t.workerPath);return n.onmessage=(({data:t})=>{e._recv(t)}),n}),t.terminateWorker=(e=>{e.worker.terminate()}),t.sendPacket=((e,t)=>{(e=>r(e)?fetch(e).then(e=>e.arrayBuffer()):new Promise)(t.payload.image).then(e=>new Uint8Array(e)).then(n=>{e.worker.postMessage({...t,payload:{...t.payload,image:Array.from(n)}})})})},function(e,t,n){const r=n(2),o=n(0),s=n(5),i=n(6);e.exports={TesseractWorker:class{constructor(e={}){this.worker=null,this.workerOptions=Object.assign({},o.defaultOptions,e),this._currentJob=null,this._queue=[]}recognize(e,t={lang:"eng"}){return this._delay(n=>{n._send("recognize",{image:e,options:r.string(t)?{lang:t||"eng"}:t,workerOptions:this.workerOptions})})}detect(e,t={}){return this._delay(n=>{n._send("detect",{image:e,options:t,workerOptions:this.workerOptions})})}terminate(){this.worker&&o.terminateWorker(this),this.worker=null,this._currentJob=null,this._queue=[]}_delay(e){r.null(this.worker)&&(this.worker=o.spawnWorker(this,this.workerOptions));const t=new i(this);return this._queue.push(()=>{this._queue.shift(),this._currentJob=t,e(t)}),r.null(this._currentJob)&&this._dequeue(),t}_dequeue(){this._currentJob=null,this._queue.length&&this._queue[0]()}_recv(e){this._currentJob.id===e.jobId?this._currentJob._handle({...e,data:"resolve"===e.status&&"recognize"===e.action?s(e.data):e.data}):console.warn(`Job ID ${e.jobId} not known.`)}}}},function(e,t,n){var r;!function(o){"use strict";var s,i,u,a,c,f,l,p,h,b,d,y,g;function m(e){return null!=e}function v(e){return"number"==typeof e&&e>b&&et}function _(e,t){return v(e)&&e=t}function O(e,t){return v(e)&&e<=t}function E(e){return"string"==typeof e}function x(e){return E(e)&&""!==e}function P(e){return"[object Object]"===Object.prototype.toString.call(e)}function S(e,t){try{return e instanceof t}catch(e){return!1}}function I(e,t){var n;for(n in t)if(t.hasOwnProperty(n)){if(!1===e.hasOwnProperty(n)||typeof e[n]!=typeof t[n])return!1;if(P(e[n])&&!1===I(e[n],t[n]))return!1}return!0}function T(e){return y(e)}function q(e){return m(e)&&k(e.length,0)}function A(e){return"function"==typeof e}function J(e,t){var n;for(n=0;nn}},{n:"greaterOrEqual",f:k},{n:"lessOrEqual",f:O},{n:"inRange",f:function(e,t,n){if(t=n}},{n:"positive",f:function(e){return j(e,0)}},{n:"negative",f:function(e){return _(e,0)}},{n:"string",f:E,s:"s"},{n:"emptyString",f:function(e){return""===e},s:"s"},{n:"nonEmptyString",f:x,s:"s"},{n:"contains",f:function(e,t){return E(e)&&-1!==e.indexOf(t)},s:"s"},{n:"match",f:function(e,t){return E(e)&&!!e.match(t)},s:"s"},{n:"boolean",f:function(e){return!1===e||!0===e},s:"b"},{n:"object",f:P,s:"o"},{n:"emptyObject",f:function(e){return P(e)&&0===Object.keys(e).length},s:"o"},{n:"nonEmptyObject",f:function(e){return P(e)&&Object.keys(e).length>0},s:"o"},{n:"instanceStrict",f:S,s:"t"},{n:"instance",f:function(e,t){try{return S(e,t)||e.constructor.name===t.name||Object.prototype.toString.call(e)==="[object "+t.name+"]"}catch(e){return!1}},s:"t"},{n:"like",f:I,s:"t"},{n:"array",f:T,s:"a"},{n:"emptyArray",f:function(e){return T(e)&&0===e.length},s:"a"},{n:"nonEmptyArray",f:function(e){return T(e)&&j(e.length,0)},s:"a"},{n:"arrayLike",f:q,s:"al"},{n:"iterable",f:function(e){if(!g)return q(e);return m(e)&&A(e[Symbol.iterator])},s:"i"},{n:"date",f:function(e){return S(e,Date)&&w(e.getTime())},s:"d"},{n:"function",f:A,s:"f"},{n:"hasLength",f:function(e,t){return m(e)&&e.length===t},s:"l"}].map(function(e){var t=e.n;i[t]="Invalid "+s[e.s||"n"],u[t]=e.f}),a={apply:function(e,t){if(c.array(e),A(t))return e.map(function(e){return t(e)});return c.array(t),c.hasLength(e,t.length),e.map(function(e,n){return t[n](e)})},map:function(e,t){if(c.object(e),A(t))return function(e,t){var n={};return Object.keys(e).forEach(function(r){n[r]=t(e[r])}),n}(e,t);return c.object(t),function e(t,n){var r={};return Object.keys(n).forEach(function(o){var s=n[o];A(s)?f.assigned(t)?r[o]=!!s.m:r[o]=s(t[o]):P(s)&&(r[o]=e(t[o],s))}),r}(e,t)},all:function(e){if(T(e))return J(e,!1);return c.object(e),N(e,!1)},any:function(e){if(T(e))return J(e,!0);return c.object(e),N(e,!0)}},p=["array","arrayLike","iterable","object"],h=Array.prototype.slice,b=Number.NEGATIVE_INFINITY,d=Number.POSITIVE_INFINITY,y=Array.isArray,g="function"==typeof Symbol,a=M(a,u),c=z(W,L),f=z($,D),l=z(function(e){var t=function(){return!!f.assigned(arguments[0])||e.apply(null,arguments)};return t.l=e.length,t.m=!0,t},function(e){if(!1===m(e))return!0;return e}),c.not=V(W,f),c.maybe=V(W,l),p.forEach(function(e){u[e].of=U([R.bind(null,null),u[e],u,null])}),B(c,W),B(f,$),p.forEach(function(e){l[e].of=U([R.bind(null,"maybe"),u[e],u,null]),c.maybe[e].of=V(W,l[e].of),c.not[e].of=V(W,f[e].of)}),function(o){void 0===(r=function(){return o}.call(t,n,t,e))||(e.exports=r)}(M(a,{assert:c,not:f,maybe:l}))}()},function(e,t){e.exports=function(e){return n.test(e)};var n=/^(?:\w+:)?\/\/([^\s\.]+\.\S{2}|localhost[\:?\d]*)\S*$/},function(e){e.exports={name:"tesseract.js",version:"1.0.13",description:"Pure Javascript Multilingual OCR",main:"src/index.js",scripts:{start:'concurrently --kill-others "watchify src/index.js -t [ envify --NODE_ENV development ] -t [ babelify --presets [ es2015 ] ] -o dist/tesseract.dev.js --standalone Tesseract" "watchify src/browser/worker.js -t [ envify --NODE_ENV development ] -t [ babelify --presets [ es2015 ] ] -o dist/worker.dev.js" "http-server -p 7355"',build:"webpack --config scripts/webpack.config.prod.js",prepublishOnly:"npm run build",lint:"eslint src"},browser:{"./src/node/index.js":"./src/browser/index.js"},author:"",contributors:["jeromewu"],license:"Apache-2.0",devDependencies:{eslint:"^5.9.0","eslint-config-airbnb":"^17.1.0","eslint-plugin-import":"^2.14.0","eslint-plugin-jsx-a11y":"^6.1.2","eslint-plugin-react":"^7.11.1",express:"^4.16.4",webpack:"^4.26.0","webpack-cli":"^3.1.2","webpack-dev-middleware":"^3.4.0"},dependencies:{"check-types":"^7.4.0","is-url":"1.2.2","node-fetch":"^1.7.3","tesseract.js-core":"^2.0.0-beta.4","tesseract.js-utils":"^1.0.0-beta.1"},repository:{type:"git",url:"https://github.com/naptha/tesseract.js.git"},bugs:{url:"https://github.com/naptha/tesseract.js/issues"},homepage:"https://github.com/naptha/tesseract.js"}},function(e,t){e.exports=(e=>{const t={...e,paragraphs:[],lines:[],words:[],symbols:[]};return t.blocks.forEach(e=>{const n={...e,page:t,lines:[],words:[],symbols:[]};n.paragraphs.forEach(e=>{const r={...e,block:n,page:t,words:[],symbols:[]};r.lines.forEach(e=>{const o={...e,paragraph:r,block:n,page:t,symbols:[]};o.words.forEach(e=>{const s={...e,line:o,paragraph:r,block:n,page:t};s.symbols.forEach(e=>{const i={...e,word:s,line:o,paragraph:r,block:n,page:t};i.line.symbols.push(i),i.paragraph.symbols.push(i),i.block.symbols.push(i),i.page.symbols.push(i)}),s.paragraph.words.push(s),s.block.words.push(s),s.page.words.push(s)}),o.block.lines.push(o),o.page.lines.push(o)}),r.page.paragraphs.push(r)})}),t})},function(e,t,n){const r=n(0);let o=0;e.exports=class{constructor(e){o+=1,this.id=`Job-${o}-${Math.random().toString(16).slice(3,8)}`,this._instance=e,this._resolve=[],this._reject=[],this._progress=[],this._finally=[]}then(e,t){return this._resolve.push?this._resolve.push(e):e(this._resolve),t&&this.catch(t),this}catch(e){return this._reject.push?this._reject.push(e):e(this._reject),this}progress(e){return this._progress.push(e),this}finally(e){return this._finally.push(e),this}_send(e,t){r.sendPacket(this._instance,{jobId:this.id,action:e,payload:t})}_handle(e){const{data:t}=e;let n=!1;"resolve"===e.status?(0===this._resolve.length&&console.log(t),this._resolve.forEach(e=>{const n=e(t);n&&"function"==typeof n.then&&console.warn("TesseractJob instances do not chain like ES6 Promises. To convert it into a real promise, use Promise.resolve.")}),this._resolve=t,this._instance._dequeue(),n=!0):"reject"===e.status?(0===this._reject.length&&console.error(t),this._reject.forEach(e=>e(t)),this._reject=t,this._instance._dequeue(),n=!0):"progress"===e.status?this._progress.forEach(e=>e(t)):console.warn("Message type unknown",e.status),n&&this._finally.forEach(e=>e(t))}}}])}); -//# sourceMappingURL=tesseract.min.js.map \ No newline at end of file diff --git a/scripts/dist/tesseract.min.js.map b/scripts/dist/tesseract.min.js.map deleted file mode 100644 index a183153..0000000 --- a/scripts/dist/tesseract.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["webpack://Tesseract/webpack/universalModuleDefinition","webpack://Tesseract/webpack/bootstrap","webpack://Tesseract/./src/browser/index.js","webpack://Tesseract/./src/index.js","webpack://Tesseract/./node_modules/check-types/src/check-types.js","webpack://Tesseract/./node_modules/is-url/index.js","webpack://Tesseract/./src/common/circularize.js","webpack://Tesseract/./src/common/job.js"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","isURL","defaultOptions","corePath","WebAssembly","langPath","version","workerPath","spawnWorker","instance","workerOptions","worker","Blob","URL","blob","Worker","createObjectURL","onmessage","data","_recv","terminateWorker","terminate","sendPacket","packet","imageURI","fetch","then","resp","arrayBuffer","Promise","loadImage","payload","image","buf","Uint8Array","img","postMessage","Array","from","check","adapter","circularize","TesseractJob","TesseractWorker","[object Object]","this","assign","_currentJob","_queue","options","lang","_delay","job","_send","string","fn","null","push","shift","_dequeue","length","id","jobId","_handle","status","action","console","warn","__WEBPACK_AMD_DEFINE_RESULT__","globals","strings","messages","predicates","functions","assert","not","maybe","collections","slice","neginf","posinf","isArray","haveSymbols","assigned","number","integer","greater","lhs","rhs","less","greaterOrEqual","lessOrEqual","nonEmptyString","toString","instanceStrict","error","like","archetype","array","arrayLike","isFunction","testArray","result","testObject","mixin","target","source","keys","forEach","assertModifier","predicate","defaultMessage","args","argCount","message","ErrorType","assertImpl","apply","TypeError","assertPredicate","arguments","Error","notModifier","modifiedPredicate","notImpl","ofModifier","type","collection","map","coerceCollection","item","concat","ignore","createModifiedPredicates","modifier","createModifiedFunctions","pop","configurable","writable","createModifiedModifier","modified","createOfModifiers","base","of","v","b","a","al","f","undefined","iterator","iteration","values","next","done","x","y","substring","indexOf","regex","match","constructor","Date","getTime","hasLength","index","mapSimple","mapComplex","all","any","Number","NEGATIVE_INFINITY","POSITIVE_INFINITY","exportFunctions","matcher","test","iPage","page","paragraphs","lines","words","symbols","blocks","iBlock","block","iPara","para","iLine","line","paragraph","iWord","word","iSym","sym","jobCounter","Math","random","_instance","_resolve","_reject","_progress","_finally","resolve","reject","catch","runFinallyCbs","log","ret"],"mappings":"CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,IACA,mBAAAG,eAAAC,IACAD,OAAA,GAAAH,GACA,iBAAAC,QACAA,QAAA,UAAAD,IAEAD,EAAA,UAAAC,IARA,CASCK,OAAA,WACD,mBCTA,IAAAC,EAAA,GAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAP,QAGA,IAAAC,EAAAI,EAAAE,GAAA,CACAC,EAAAD,EACAE,GAAA,EACAT,QAAA,IAUA,OANAU,EAAAH,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAQ,GAAA,EAGAR,EAAAD,QA0DA,OArDAM,EAAAM,EAAAF,EAGAJ,EAAAO,EAAAR,EAGAC,EAAAQ,EAAA,SAAAd,EAAAe,EAAAC,GACAV,EAAAW,EAAAjB,EAAAe,IAC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AyJ,SAAA1F,QAAArD,IACA,MAAAwJ,EAAAxJ,EAAArC,GACA6L,GAAA,mBAAAA,EAAArL,MACAwC,QAAAC,KAAA,oHAGAtB,KAAAyJ,SAAApL,EACA2B,KAAAwJ,UAAA1I,WACAkJ,GAAA,GACK,WAAAtL,EAAAyC,QACL,IAAAnB,KAAA0J,QAAA3I,QAAAM,QAAA6B,MAAA7E,GACA2B,KAAA0J,QAAA3F,QAAArD,KAAArC,IACA2B,KAAA0J,QAAArL,EACA2B,KAAAwJ,UAAA1I,WACAkJ,GAAA,GACK,aAAAtL,EAAAyC,OACLnB,KAAA2J,UAAA5F,QAAArD,KAAArC,IAEAgD,QAAAC,KAAA,uBAAA5C,EAAAyC,QAGA6I,GACAhK,KAAA4J,SAAA7F,QAAArD,KAAArC","file":"tesseract.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Tesseract\"] = factory();\n\telse\n\t\troot[\"Tesseract\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1);\n","const isURL = require('is-url');\n\nconst defaultOptions = {\n // workerPath: 'https://cdn.jsdelivr.net/gh/naptha/tesseract.js@0.2.0/dist/worker.js',\n corePath: `https://cdn.jsdelivr.net/gh/naptha/tesseract.js-core@v2.0.0-beta.5/tesseract-core${typeof WebAssembly === 'object' ? '' : '.asm'}.js`,\n langPath: 'https://cdn.jsdelivr.net/gh/naptha/tessdata@gh-pages/4.0.0/',\n};\n\nif (process.env.NODE_ENV === 'development') {\n console.debug('Using Development Configuration');\n // eslint-disable-next-line\n const { protocol, host } = location;\n defaultOptions.workerPath = `${protocol}//${host}/dist/worker.dev.js?nocache=${Math.random().toString(36).slice(3)}`;\n} else {\n const { version } = require('../../package.json');\n defaultOptions.workerPath = `https://cdn.jsdelivr.net/gh/naptha/tesseract.js@${version}/dist/worker.js`;\n}\n\nconst loadImage = (imageURI) => {\n if (isURL(imageURI)) {\n return fetch(imageURI)\n .then(resp => resp.arrayBuffer());\n }\n return new Promise();\n};\n\nexports.defaultOptions = defaultOptions;\n\nexports.spawnWorker = (instance, workerOptions) => {\n let worker;\n if (window.Blob && window.URL) {\n const blob = new Blob([`importScripts(\"${workerOptions.workerPath}\");`]);\n worker = new Worker(window.URL.createObjectURL(blob));\n } else {\n worker = new Worker(workerOptions.workerPath);\n }\n\n worker.onmessage = ({ data }) => {\n instance._recv(data);\n };\n\n return worker;\n};\n\nexports.terminateWorker = (instance) => {\n instance.worker.terminate();\n};\n\nexports.sendPacket = (instance, packet) => {\n loadImage(packet.payload.image)\n .then(buf => new Uint8Array(buf))\n .then((img) => {\n instance.worker.postMessage({\n ...packet,\n payload: {\n ...packet.payload,\n image: Array.from(img),\n },\n });\n });\n};\n","const check = require('check-types');\nconst adapter = require('./node');\nconst circularize = require('./common/circularize');\nconst TesseractJob = require('./common/job');\n\nclass TesseractWorker {\n constructor(workerOptions = {}) {\n this.worker = null;\n this.workerOptions = Object.assign({}, adapter.defaultOptions, workerOptions);\n this._currentJob = null;\n this._queue = [];\n }\n\n recognize(image, options = { lang: 'eng' }) {\n return this._delay((job) => {\n job._send(\n 'recognize',\n {\n image,\n options: check.string(options)\n ? { lang: options || 'eng' }\n : options,\n workerOptions: this.workerOptions,\n },\n );\n });\n }\n\n detect(image, options = {}) {\n return this._delay((job) => {\n job._send(\n 'detect',\n {\n image,\n options,\n workerOptions: this.workerOptions,\n },\n );\n });\n }\n\n terminate() {\n if (this.worker) {\n adapter.terminateWorker(this);\n }\n this.worker = null;\n this._currentJob = null;\n this._queue = [];\n }\n\n _delay(fn) {\n if (check.null(this.worker)) {\n this.worker = adapter.spawnWorker(this, this.workerOptions);\n }\n\n const job = new TesseractJob(this);\n this._queue.push(() => {\n this._queue.shift();\n this._currentJob = job;\n fn(job);\n });\n if (check.null(this._currentJob)) {\n this._dequeue();\n }\n return job;\n }\n\n _dequeue() {\n this._currentJob = null;\n if (this._queue.length) {\n this._queue[0]();\n }\n }\n\n _recv(packet) {\n if (this._currentJob.id === packet.jobId) {\n this._currentJob._handle({\n ...packet,\n data: packet.status === 'resolve' && packet.action === 'recognize'\n ? circularize(packet.data)\n : packet.data,\n });\n } else {\n console.warn(`Job ID ${packet.jobId} not known.`);\n }\n }\n}\n\nmodule.exports = {\n TesseractWorker,\n};\n","/*globals define, module, Symbol */\n/*jshint -W056 */\n\n(function (globals) {\n 'use strict';\n\n var strings, messages, predicates, functions, assert, not, maybe,\n collections, slice, neginf, posinf, isArray, haveSymbols;\n\n strings = {\n v: 'value',\n n: 'number',\n s: 'string',\n b: 'boolean',\n o: 'object',\n t: 'type',\n a: 'array',\n al: 'array-like',\n i: 'iterable',\n d: 'date',\n f: 'function',\n l: 'length'\n };\n\n messages = {};\n predicates = {};\n\n [\n { n: 'equal', f: equal, s: 'v' },\n { n: 'undefined', f: isUndefined, s: 'v' },\n { n: 'null', f: isNull, s: 'v' },\n { n: 'assigned', f: assigned, s: 'v' },\n { n: 'primitive', f: primitive, s: 'v' },\n { n: 'includes', f: includes, s: 'v' },\n { n: 'zero', f: zero },\n { n: 'infinity', f: infinity },\n { n: 'number', f: number },\n { n: 'integer', f: integer },\n { n: 'even', f: even },\n { n: 'odd', f: odd },\n { n: 'greater', f: greater },\n { n: 'less', f: less },\n { n: 'between', f: between },\n { n: 'greaterOrEqual', f: greaterOrEqual },\n { n: 'lessOrEqual', f: lessOrEqual },\n { n: 'inRange', f: inRange },\n { n: 'positive', f: positive },\n { n: 'negative', f: negative },\n { n: 'string', f: string, s: 's' },\n { n: 'emptyString', f: emptyString, s: 's' },\n { n: 'nonEmptyString', f: nonEmptyString, s: 's' },\n { n: 'contains', f: contains, s: 's' },\n { n: 'match', f: match, s: 's' },\n { n: 'boolean', f: boolean, s: 'b' },\n { n: 'object', f: object, s: 'o' },\n { n: 'emptyObject', f: emptyObject, s: 'o' },\n { n: 'nonEmptyObject', f: nonEmptyObject, s: 'o' },\n { n: 'instanceStrict', f: instanceStrict, s: 't' },\n { n: 'instance', f: instance, s: 't' },\n { n: 'like', f: like, s: 't' },\n { n: 'array', f: array, s: 'a' },\n { n: 'emptyArray', f: emptyArray, s: 'a' },\n { n: 'nonEmptyArray', f: nonEmptyArray, s: 'a' },\n { n: 'arrayLike', f: arrayLike, s: 'al' },\n { n: 'iterable', f: iterable, s: 'i' },\n { n: 'date', f: date, s: 'd' },\n { n: 'function', f: isFunction, s: 'f' },\n { n: 'hasLength', f: hasLength, s: 'l' },\n ].map(function (data) {\n var n = data.n;\n messages[n] = 'Invalid ' + strings[data.s || 'n'];\n predicates[n] = data.f;\n });\n\n functions = {\n apply: apply,\n map: map,\n all: all,\n any: any\n };\n\n collections = [ 'array', 'arrayLike', 'iterable', 'object' ];\n slice = Array.prototype.slice;\n neginf = Number.NEGATIVE_INFINITY;\n posinf = Number.POSITIVE_INFINITY;\n isArray = Array.isArray;\n haveSymbols = typeof Symbol === 'function';\n\n functions = mixin(functions, predicates);\n assert = createModifiedPredicates(assertModifier, assertImpl);\n not = createModifiedPredicates(notModifier, notImpl);\n maybe = createModifiedPredicates(maybeModifier, maybeImpl);\n assert.not = createModifiedModifier(assertModifier, not);\n assert.maybe = createModifiedModifier(assertModifier, maybe);\n\n collections.forEach(createOfPredicates);\n createOfModifiers(assert, assertModifier);\n createOfModifiers(not, notModifier);\n collections.forEach(createMaybeOfModifiers);\n\n exportFunctions(mixin(functions, {\n assert: assert,\n not: not,\n maybe: maybe\n }));\n\n /**\n * Public function `equal`.\n *\n * Returns true if `lhs` and `rhs` are strictly equal, without coercion.\n * Returns false otherwise.\n */\n function equal (lhs, rhs) {\n return lhs === rhs;\n }\n\n /**\n * Public function `undefined`.\n *\n * Returns true if `data` is undefined, false otherwise.\n */\n function isUndefined (data) {\n return data === undefined;\n }\n\n /**\n * Public function `null`.\n *\n * Returns true if `data` is null, false otherwise.\n */\n function isNull (data) {\n return data === null;\n }\n\n /**\n * Public function `assigned`.\n *\n * Returns true if `data` is not null or undefined, false otherwise.\n */\n function assigned (data) {\n return data !== undefined && data !== null;\n }\n\n /**\n * Public function `primitive`.\n *\n * Returns true if `data` is a primitive type, false otherwise.\n */\n function primitive (data) {\n var type;\n\n switch (data) {\n case null:\n case undefined:\n case false:\n case true:\n return true;\n }\n\n type = typeof data;\n return type === 'string' || type === 'number' || (haveSymbols && type === 'symbol');\n }\n\n /**\n * Public function `zero`.\n *\n * Returns true if `data` is zero, false otherwise.\n */\n function zero (data) {\n return data === 0;\n }\n\n /**\n * Public function `infinity`.\n *\n * Returns true if `data` is positive or negative infinity, false otherwise.\n */\n function infinity (data) {\n return data === neginf || data === posinf;\n }\n\n /**\n * Public function `number`.\n *\n * Returns true if `data` is a number, false otherwise.\n */\n function number (data) {\n return typeof data === 'number' && data > neginf && data < posinf;\n }\n\n /**\n * Public function `integer`.\n *\n * Returns true if `data` is an integer, false otherwise.\n */\n function integer (data) {\n return typeof data === 'number' && data % 1 === 0;\n }\n\n /**\n * Public function `even`.\n *\n * Returns true if `data` is an even number, false otherwise.\n */\n function even (data) {\n return typeof data === 'number' && data % 2 === 0;\n }\n\n /**\n * Public function `odd`.\n *\n * Returns true if `data` is an odd number, false otherwise.\n */\n function odd (data) {\n return integer(data) && data % 2 !== 0;\n }\n\n /**\n * Public function `greater`.\n *\n * Returns true if `lhs` is a number greater than `rhs`, false otherwise.\n */\n function greater (lhs, rhs) {\n return number(lhs) && lhs > rhs;\n }\n\n /**\n * Public function `less`.\n *\n * Returns true if `lhs` is a number less than `rhs`, false otherwise.\n */\n function less (lhs, rhs) {\n return number(lhs) && lhs < rhs;\n }\n\n /**\n * Public function `between`.\n *\n * Returns true if `data` is a number between `x` and `y`, false otherwise.\n */\n function between (data, x, y) {\n if (x < y) {\n return greater(data, x) && data < y;\n }\n\n return less(data, x) && data > y;\n }\n\n /**\n * Public function `greaterOrEqual`.\n *\n * Returns true if `lhs` is a number greater than or equal to `rhs`, false\n * otherwise.\n */\n function greaterOrEqual (lhs, rhs) {\n return number(lhs) && lhs >= rhs;\n }\n\n /**\n * Public function `lessOrEqual`.\n *\n * Returns true if `lhs` is a number less than or equal to `rhs`, false\n * otherwise.\n */\n function lessOrEqual (lhs, rhs) {\n return number(lhs) && lhs <= rhs;\n }\n\n /**\n * Public function `inRange`.\n *\n * Returns true if `data` is a number in the range `x..y`, false otherwise.\n */\n function inRange (data, x, y) {\n if (x < y) {\n return greaterOrEqual(data, x) && data <= y;\n }\n\n return lessOrEqual(data, x) && data >= y;\n }\n\n /**\n * Public function `positive`.\n *\n * Returns true if `data` is a positive number, false otherwise.\n */\n function positive (data) {\n return greater(data, 0);\n }\n\n /**\n * Public function `negative`.\n *\n * Returns true if `data` is a negative number, false otherwise.\n */\n function negative (data) {\n return less(data, 0);\n }\n\n /**\n * Public function `string`.\n *\n * Returns true if `data` is a string, false otherwise.\n */\n function string (data) {\n return typeof data === 'string';\n }\n\n /**\n * Public function `emptyString`.\n *\n * Returns true if `data` is the empty string, false otherwise.\n */\n function emptyString (data) {\n return data === '';\n }\n\n /**\n * Public function `nonEmptyString`.\n *\n * Returns true if `data` is a non-empty string, false otherwise.\n */\n function nonEmptyString (data) {\n return string(data) && data !== '';\n }\n\n /**\n * Public function `contains`.\n *\n * Returns true if `data` is a string that contains `substring`, false\n * otherwise.\n */\n function contains (data, substring) {\n return string(data) && data.indexOf(substring) !== -1;\n }\n\n /**\n * Public function `match`.\n *\n * Returns true if `data` is a string that matches `regex`, false otherwise.\n */\n function match (data, regex) {\n return string(data) && !! data.match(regex);\n }\n\n /**\n * Public function `boolean`.\n *\n * Returns true if `data` is a boolean value, false otherwise.\n */\n function boolean (data) {\n return data === false || data === true;\n }\n\n /**\n * Public function `object`.\n *\n * Returns true if `data` is a plain-old JS object, false otherwise.\n */\n function object (data) {\n return Object.prototype.toString.call(data) === '[object Object]';\n }\n\n /**\n * Public function `emptyObject`.\n *\n * Returns true if `data` is an empty object, false otherwise.\n */\n function emptyObject (data) {\n return object(data) && Object.keys(data).length === 0;\n }\n\n /**\n * Public function `nonEmptyObject`.\n *\n * Returns true if `data` is a non-empty object, false otherwise.\n */\n function nonEmptyObject (data) {\n return object(data) && Object.keys(data).length > 0;\n }\n\n /**\n * Public function `instanceStrict`.\n *\n * Returns true if `data` is an instance of `prototype`, false otherwise.\n */\n function instanceStrict (data, prototype) {\n try {\n return data instanceof prototype;\n } catch (error) {\n return false;\n }\n }\n\n /**\n * Public function `instance`.\n *\n * Returns true if `data` is an instance of `prototype`, false otherwise.\n * Falls back to testing constructor.name and Object.prototype.toString\n * if the initial instanceof test fails.\n */\n function instance (data, prototype) {\n try {\n return instanceStrict(data, prototype) ||\n data.constructor.name === prototype.name ||\n Object.prototype.toString.call(data) === '[object ' + prototype.name + ']';\n } catch (error) {\n return false;\n }\n }\n\n /**\n * Public function `like`.\n *\n * Tests whether `data` 'quacks like a duck'. Returns true if `data` has all\n * of the properties of `archetype` (the 'duck'), false otherwise.\n */\n function like (data, archetype) {\n var name;\n\n for (name in archetype) {\n if (archetype.hasOwnProperty(name)) {\n if (data.hasOwnProperty(name) === false || typeof data[name] !== typeof archetype[name]) {\n return false;\n }\n\n if (object(data[name]) && like(data[name], archetype[name]) === false) {\n return false;\n }\n }\n }\n\n return true;\n }\n\n /**\n * Public function `array`.\n *\n * Returns true if `data` is an array, false otherwise.\n */\n function array (data) {\n return isArray(data);\n }\n\n /**\n * Public function `emptyArray`.\n *\n * Returns true if `data` is an empty array, false otherwise.\n */\n function emptyArray (data) {\n return array(data) && data.length === 0;\n }\n\n /**\n * Public function `nonEmptyArray`.\n *\n * Returns true if `data` is a non-empty array, false otherwise.\n */\n function nonEmptyArray (data) {\n return array(data) && greater(data.length, 0);\n }\n\n /**\n * Public function `arrayLike`.\n *\n * Returns true if `data` is an array-like object, false otherwise.\n */\n function arrayLike (data) {\n return assigned(data) && greaterOrEqual(data.length, 0);\n }\n\n /**\n * Public function `iterable`.\n *\n * Returns true if `data` is an iterable, false otherwise.\n */\n function iterable (data) {\n if (! haveSymbols) {\n // Fall back to `arrayLike` predicate in pre-ES6 environments.\n return arrayLike(data);\n }\n\n return assigned(data) && isFunction(data[Symbol.iterator]);\n }\n\n /**\n * Public function `includes`.\n *\n * Returns true if `data` contains `value`, false otherwise.\n */\n function includes (data, value) {\n var iterator, iteration, keys, length, i;\n\n if (! assigned(data)) {\n return false;\n }\n\n if (haveSymbols && data[Symbol.iterator] && isFunction(data.values)) {\n iterator = data.values();\n\n do {\n iteration = iterator.next();\n\n if (iteration.value === value) {\n return true;\n }\n } while (! iteration.done);\n\n return false;\n }\n\n keys = Object.keys(data);\n length = keys.length;\n for (i = 0; i < length; ++i) {\n if (data[keys[i]] === value) {\n return true;\n }\n }\n\n return false;\n }\n\n /**\n * Public function `hasLength`.\n *\n * Returns true if `data` has a length property that equals `length`, false\n * otherwise.\n */\n function hasLength (data, length) {\n return assigned(data) && data.length === length;\n }\n\n /**\n * Public function `date`.\n *\n * Returns true if `data` is a valid date, false otherwise.\n */\n function date (data) {\n return instanceStrict(data, Date) && integer(data.getTime());\n }\n\n /**\n * Public function `function`.\n *\n * Returns true if `data` is a function, false otherwise.\n */\n function isFunction (data) {\n return typeof data === 'function';\n }\n\n /**\n * Public function `apply`.\n *\n * Maps each value from the `data` to the corresponding predicate and returns\n * the result array. If the same function is to be applied across all of the\n * data, a single predicate function may be passed in.\n *\n */\n function apply (data, predicates) {\n assert.array(data);\n\n if (isFunction(predicates)) {\n return data.map(function (value) {\n return predicates(value);\n });\n }\n\n assert.array(predicates);\n assert.hasLength(data, predicates.length);\n\n return data.map(function (value, index) {\n return predicates[index](value);\n });\n }\n\n /**\n * Public function `map`.\n *\n * Maps each value from the `data` to the corresponding predicate and returns\n * the result object. Supports nested objects. If the `data` is not nested and\n * the same function is to be applied across all of it, a single predicate\n * function may be passed in.\n *\n */\n function map (data, predicates) {\n assert.object(data);\n\n if (isFunction(predicates)) {\n return mapSimple(data, predicates);\n }\n\n assert.object(predicates);\n\n return mapComplex(data, predicates);\n }\n\n function mapSimple (data, predicate) {\n var result = {};\n\n Object.keys(data).forEach(function (key) {\n result[key] = predicate(data[key]);\n });\n\n return result;\n }\n\n function mapComplex (data, predicates) {\n var result = {};\n\n Object.keys(predicates).forEach(function (key) {\n var predicate = predicates[key];\n\n if (isFunction(predicate)) {\n if (not.assigned(data)) {\n result[key] = !!predicate.m;\n } else {\n result[key] = predicate(data[key]);\n }\n } else if (object(predicate)) {\n result[key] = mapComplex(data[key], predicate);\n }\n });\n\n return result;\n }\n\n /**\n * Public function `all`\n *\n * Check that all boolean values are true\n * in an array (returned from `apply`)\n * or object (returned from `map`).\n *\n */\n function all (data) {\n if (array(data)) {\n return testArray(data, false);\n }\n\n assert.object(data);\n\n return testObject(data, false);\n }\n\n function testArray (data, result) {\n var i;\n\n for (i = 0; i < data.length; i += 1) {\n if (data[i] === result) {\n return result;\n }\n }\n\n return !result;\n }\n\n function testObject (data, result) {\n var key, value;\n\n for (key in data) {\n if (data.hasOwnProperty(key)) {\n value = data[key];\n\n if (object(value) && testObject(value, result) === result) {\n return result;\n }\n\n if (value === result) {\n return result;\n }\n }\n }\n\n return !result;\n }\n\n /**\n * Public function `any`\n *\n * Check that at least one boolean value is true\n * in an array (returned from `apply`)\n * or object (returned from `map`).\n *\n */\n function any (data) {\n if (array(data)) {\n return testArray(data, true);\n }\n\n assert.object(data);\n\n return testObject(data, true);\n }\n\n function mixin (target, source) {\n Object.keys(source).forEach(function (key) {\n target[key] = source[key];\n });\n\n return target;\n }\n\n /**\n * Public modifier `assert`.\n *\n * Throws if `predicate` returns false.\n */\n function assertModifier (predicate, defaultMessage) {\n return function () {\n return assertPredicate(predicate, arguments, defaultMessage);\n };\n }\n\n function assertPredicate (predicate, args, defaultMessage) {\n var argCount = predicate.l || predicate.length;\n var message = args[argCount];\n var ErrorType = args[argCount + 1];\n assertImpl(\n predicate.apply(null, args),\n nonEmptyString(message) ? message : defaultMessage,\n isFunction(ErrorType) ? ErrorType : TypeError\n );\n return args[0];\n }\n\n function assertImpl (value, message, ErrorType) {\n if (value) {\n return value;\n }\n throw new (ErrorType || Error)(message || 'Assertion failed');\n }\n\n /**\n * Public modifier `not`.\n *\n * Negates `predicate`.\n */\n function notModifier (predicate) {\n var modifiedPredicate = function () {\n return notImpl(predicate.apply(null, arguments));\n };\n modifiedPredicate.l = predicate.length;\n return modifiedPredicate;\n }\n\n function notImpl (value) {\n return !value;\n }\n\n /**\n * Public modifier `maybe`.\n *\n * Returns true if predicate argument is null or undefined,\n * otherwise propagates the return value from `predicate`.\n */\n function maybeModifier (predicate) {\n var modifiedPredicate = function () {\n if (not.assigned(arguments[0])) {\n return true;\n }\n\n return predicate.apply(null, arguments);\n };\n modifiedPredicate.l = predicate.length;\n\n // Hackishly indicate that this is a maybe.xxx predicate.\n // Without this flag, the alternative would be to iterate\n // through the maybe predicates or use indexOf to check,\n // which would be time-consuming.\n modifiedPredicate.m = true;\n\n return modifiedPredicate;\n }\n\n function maybeImpl (value) {\n if (assigned(value) === false) {\n return true;\n }\n\n return value;\n }\n\n /**\n * Public modifier `of`.\n *\n * Applies the chained predicate to members of the collection.\n */\n function ofModifier (target, type, predicate) {\n var modifiedPredicate = function () {\n var collection, args;\n\n collection = arguments[0];\n\n if (target === 'maybe' && not.assigned(collection)) {\n return true;\n }\n\n if (!type(collection)) {\n return false;\n }\n\n collection = coerceCollection(type, collection);\n args = slice.call(arguments, 1);\n\n try {\n collection.forEach(function (item) {\n if (\n (target !== 'maybe' || assigned(item)) &&\n !predicate.apply(null, [ item ].concat(args))\n ) {\n // TODO: Replace with for...of when ES6 is required.\n throw 0;\n }\n });\n } catch (ignore) {\n return false;\n }\n\n return true;\n };\n modifiedPredicate.l = predicate.length;\n return modifiedPredicate;\n }\n\n function coerceCollection (type, collection) {\n switch (type) {\n case arrayLike:\n return slice.call(collection);\n case object:\n return Object.keys(collection).map(function (key) {\n return collection[key];\n });\n default:\n return collection;\n }\n }\n\n function createModifiedPredicates (modifier, object) {\n return createModifiedFunctions([ modifier, predicates, object ]);\n }\n\n function createModifiedFunctions (args) {\n var modifier, object, functions, result;\n\n modifier = args.shift();\n object = args.pop();\n functions = args.pop();\n\n result = object || {};\n\n Object.keys(functions).forEach(function (key) {\n Object.defineProperty(result, key, {\n configurable: false,\n enumerable: true,\n writable: false,\n value: modifier.apply(null, args.concat(functions[key], messages[key]))\n });\n });\n\n return result;\n }\n\n function createModifiedModifier (modifier, modified) {\n return createModifiedFunctions([ modifier, modified, null ]);\n }\n\n function createOfPredicates (key) {\n predicates[key].of = createModifiedFunctions(\n [ ofModifier.bind(null, null), predicates[key], predicates, null ]\n );\n }\n\n function createOfModifiers (base, modifier) {\n collections.forEach(function (key) {\n base[key].of = createModifiedModifier(modifier, predicates[key].of);\n });\n }\n\n function createMaybeOfModifiers (key) {\n maybe[key].of = createModifiedFunctions(\n [ ofModifier.bind(null, 'maybe'), predicates[key], predicates, null ]\n );\n assert.maybe[key].of = createModifiedModifier(assertModifier, maybe[key].of);\n assert.not[key].of = createModifiedModifier(assertModifier, not[key].of);\n }\n\n function exportFunctions (functions) {\n if (typeof define === 'function' && define.amd) {\n define(function () {\n return functions;\n });\n } else if (typeof module !== 'undefined' && module !== null && module.exports) {\n module.exports = functions;\n } else {\n globals.check = functions;\n }\n }\n}(this));\n","\n/**\n * Expose `isUrl`.\n */\n\nmodule.exports = isUrl;\n\n/**\n * Matcher.\n */\n\nvar matcher = /^(?:\\w+:)?\\/\\/([^\\s\\.]+\\.\\S{2}|localhost[\\:?\\d]*)\\S*$/;\n\n/**\n * Loosely validate a URL `string`.\n *\n * @param {String} string\n * @return {Boolean}\n */\n\nfunction isUrl(string){\n return matcher.test(string);\n}\n","// The result of dump.js is a big JSON tree\n// which can be easily serialized (for instance\n// to be sent from a webworker to the main app\n// or through Node's IPC), but we want\n// a (circular) DOM-like interface for walking\n// through the data.\n\nmodule.exports = (iPage) => {\n const page = {\n ...iPage,\n paragraphs: [],\n lines: [],\n words: [],\n symbols: [],\n };\n\n page.blocks.forEach((iBlock) => {\n const block = {\n ...iBlock,\n page,\n lines: [],\n words: [],\n symbols: [],\n };\n\n block.paragraphs.forEach((iPara) => {\n const para = {\n ...iPara,\n block,\n page,\n words: [],\n symbols: [],\n };\n\n para.lines.forEach((iLine) => {\n const line = {\n ...iLine,\n paragraph: para,\n block,\n page,\n symbols: [],\n };\n\n line.words.forEach((iWord) => {\n const word = {\n ...iWord,\n line,\n paragraph: para,\n block,\n page,\n };\n\n word.symbols.forEach((iSym) => {\n const sym = {\n ...iSym,\n word,\n line,\n paragraph: para,\n block,\n page,\n };\n\n sym.line.symbols.push(sym);\n sym.paragraph.symbols.push(sym);\n sym.block.symbols.push(sym);\n sym.page.symbols.push(sym);\n });\n word.paragraph.words.push(word);\n word.block.words.push(word);\n word.page.words.push(word);\n });\n line.block.lines.push(line);\n line.page.lines.push(line);\n });\n para.page.paragraphs.push(para);\n });\n });\n return page;\n};\n","const adapter = require('../node/');\n\nlet jobCounter = 0;\n\nmodule.exports = class TesseractJob {\n constructor(instance) {\n jobCounter += 1;\n this.id = `Job-${jobCounter}-${Math.random().toString(16).slice(3, 8)}`;\n\n this._instance = instance;\n this._resolve = [];\n this._reject = [];\n this._progress = [];\n this._finally = [];\n }\n\n then(resolve, reject) {\n if (this._resolve.push) {\n this._resolve.push(resolve);\n } else {\n resolve(this._resolve);\n }\n\n if (reject) this.catch(reject);\n return this;\n }\n\n catch(reject) {\n if (this._reject.push) {\n this._reject.push(reject);\n } else {\n reject(this._reject);\n }\n return this;\n }\n\n progress(fn) {\n this._progress.push(fn);\n return this;\n }\n\n finally(fn) {\n this._finally.push(fn);\n return this;\n }\n\n _send(action, payload) {\n adapter.sendPacket(this._instance, {\n jobId: this.id,\n action,\n payload,\n });\n }\n\n _handle(packet) {\n const { data } = packet;\n let runFinallyCbs = false;\n\n if (packet.status === 'resolve') {\n if (this._resolve.length === 0) console.log(data);\n this._resolve.forEach((fn) => {\n const ret = fn(data);\n if (ret && typeof ret.then === 'function') {\n console.warn('TesseractJob instances do not chain like ES6 Promises. To convert it into a real promise, use Promise.resolve.');\n }\n });\n this._resolve = data;\n this._instance._dequeue();\n runFinallyCbs = true;\n } else if (packet.status === 'reject') {\n if (this._reject.length === 0) console.error(data);\n this._reject.forEach(fn => fn(data));\n this._reject = data;\n this._instance._dequeue();\n runFinallyCbs = true;\n } else if (packet.status === 'progress') {\n this._progress.forEach(fn => fn(data));\n } else {\n console.warn('Message type unknown', packet.status);\n }\n\n if (runFinallyCbs) {\n this._finally.forEach(fn => fn(data));\n }\n }\n};\n"],"sourceRoot":""} \ No newline at end of file diff --git a/scripts/dist/worker.min.js b/scripts/dist/worker.min.js deleted file mode 100644 index f828aee..0000000 --- a/scripts/dist/worker.min.js +++ /dev/null @@ -1,9 +0,0 @@ -!function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([function(t,e){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){(function(t){const e=r(2);t.addEventListener("message",({data:t})=>{e.dispatchHandlers(t,t=>postMessage(t))}),e.setAdapter({getCore:(e,r)=>(t.TesseractCore||(r.progress({status:"loading tesseract core",progress:0}),t.importScripts(e.workerOptions.corePath),t.TesseractCore="object"==typeof WebAssembly?t.TesseractCoreWASM:t.TesseractCoreASM,r.progress({status:"loading tesseract core",progress:1})),t.TesseractCore)})}).call(this,r(0))},function(t,e,r){const{readImage:n,loadLang:i}=r(3),o=r(17);let s,a,h,f={};const u=(t,e)=>{let r=100663296;if(["chi_sim","chi_tra","jpn"].includes(t.options.lang)&&(r=167772160),!s||s.TOTAL_MEMORY{a=new(s=t).TessBaseAPI,e.progress({status:"initialized tesseract",progress:1})})}return new Promise},c=t=>{const{w:e,h:r,data:i}=n(s,Array.from(t));return a.SetImage(i),a.SetRectangle(0,0,e,r),i},l=(t,e,r)=>{const{options:{lang:n},workerOptions:{langPath:o}}=t;return i({langs:n,tessModule:s,langURI:o,cache:!0}).then(r)};e.dispatchHandlers=((t,e)=>{const r=(r,n)=>{e({jobId:t.jobId,status:r,action:t.action,data:n})};r.resolve=r.bind(this,"resolve"),r.reject=r.bind(this,"reject"),r.progress=r.bind(this,"progress"),h=r;try{"recognize"===t.action?((t,e)=>{u(t,e).then(()=>{l(t,0,()=>{const{options:r}=t,n=t=>{e.progress({status:"initializing api",progress:t})};n(0),a.Init(null,r.lang),n(.3),Object.keys(r).forEach(t=>{a.SetVariable(t,r[t])}),n(.6);const i=c(t.image);n(1),a.Recognize(null);const h=o(s,a);a.End(),s._free(i),e.resolve(h)})})})(t.payload,r):"detect"===t.action&&((t,e)=>{u(t,e).then(()=>{t.options.lang="osd",l(t,0,()=>{a.Init(null,"osd"),a.SetPageSegMode(s.PSM_OSD_ONLY);const r=c(t.image),n=new s.OSResults;if(a.DetectOS(n)){const t=n.get_best_result(),i=t.get_orientation_id(),o=t.get_script_id();a.End(),s._free(r),e.resolve({tesseract_script_id:o,script:n.get_unicharset().get_script_from_script_id(o),script_confidence:t.get_sconfidence(),orientation_degrees:[0,270,180,90][i],orientation_confidence:t.get_oconfidence()})}else a.End(),s._free(r),e.reject("Failed to detect OS")})})})(t.payload,r)}catch(t){r.reject(t.toString())}}),e.setAdapter=(t=>{f=t})},function(t,e,r){t.exports={loadLang:r(4)({fetch:r(5),gunzip:r(7),...r(14)}),readImage:r(16)}},function(t,e){const r=t=>({tessModule:e,dataPath:r,cachePath:n,cache:i,lang:o})=>s=>{if(e){if(r)try{e.FS.mkdir(r)}catch(t){}e.FS.writeFile(`${r||"."}/${o}.traineddata`,s)}return i&&t.writeCache(`${n||"."}/${o}.traineddata`,s),s};t.exports=(t=>({langs:e,...n})=>Promise.all(e.split("+").map((t=>({langURI:e,cachePath:n,...i})=>o=>t.readCache(`${n||"."}/${o}.traineddata`).then(e=>void 0===e?Promise.reject():r(t)({cachePath:n,lang:o,...i})(e)).catch(()=>t.fetch(`${e}/${o}.traineddata.gz`).then(t=>t.arrayBuffer()).then(e=>t.gunzip(new Uint8Array(e))).then(r(t)({cachePath:n,lang:o,...i}))))(t)(n))))},function(t,e,r){const{fetch:n}=r(6);t.exports=n},function(t,e,r){"use strict";r.r(e),r.d(e,"Headers",function(){return f}),r.d(e,"Request",function(){return g}),r.d(e,"Response",function(){return w}),r.d(e,"DOMException",function(){return m}),r.d(e,"fetch",function(){return A});var n={searchParams:"URLSearchParams"in self,iterable:"Symbol"in self&&"iterator"in Symbol,blob:"FileReader"in self&&"Blob"in self&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in self,arrayBuffer:"ArrayBuffer"in self};if(n.arrayBuffer)var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],o=ArrayBuffer.isView||function(t){return t&&i.indexOf(Object.prototype.toString.call(t))>-1};function s(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function a(t){return"string"!=typeof t&&(t=String(t)),t}function h(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return n.iterable&&(e[Symbol.iterator]=function(){return e}),e}function f(t){this.map={},t instanceof f?t.forEach(function(t,e){this.append(e,t)},this):Array.isArray(t)?t.forEach(function(t){this.append(t[0],t[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function u(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function c(t){return new Promise(function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}})}function l(t){var e=new FileReader,r=c(e);return e.readAsArrayBuffer(t),r}function p(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function y(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:n.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:n.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:n.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():n.arrayBuffer&&n.blob&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=p(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):n.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||o(t))?this._bodyArrayBuffer=p(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},n.blob&&(this.blob=function(){var t=u(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?u(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(l)}),this.text=function(){var t,e,r,n=u(this);if(n)return n;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,r=c(e),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n-1?n:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function b(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(i))}}),e}function w(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new f(e.headers),this.url=e.url||"",this._initBody(t)}g.prototype.clone=function(){return new g(this,{body:this._bodyInit})},y.call(g.prototype),y.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},w.error=function(){var t=new w(null,{status:0,statusText:""});return t.type="error",t};var v=[301,302,303,307,308];w.redirect=function(t,e){if(-1===v.indexOf(e))throw new RangeError("Invalid status code");return new w(null,{status:e,headers:{location:t}})};var m=self.DOMException;try{new m}catch(t){(m=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack}).prototype=Object.create(Error.prototype),m.prototype.constructor=m}function A(t,e){return new Promise(function(r,i){var o=new g(t,e);if(o.signal&&o.signal.aborted)return i(new m("Aborted","AbortError"));var s=new XMLHttpRequest;function a(){s.abort()}s.onload=function(){var t,e,n={status:s.status,statusText:s.statusText,headers:(t=s.getAllResponseHeaders()||"",e=new f,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(t){var r=t.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();e.append(n,i)}}),e)};n.url="responseURL"in s?s.responseURL:n.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;r(new w(i,n))},s.onerror=function(){i(new TypeError("Network request failed"))},s.ontimeout=function(){i(new TypeError("Network request failed"))},s.onabort=function(){i(new m("Aborted","AbortError"))},s.open(o.method,o.url,!0),"include"===o.credentials?s.withCredentials=!0:"omit"===o.credentials&&(s.withCredentials=!1),"responseType"in s&&n.blob&&(s.responseType="blob"),o.headers.forEach(function(t,e){s.setRequestHeader(e,t)}),o.signal&&(o.signal.addEventListener("abort",a),s.onreadystatechange=function(){4===s.readyState&&o.signal.removeEventListener("abort",a)}),s.send(void 0===o._bodyInit?null:o._bodyInit)})}A.polyfill=!0,self.fetch||(self.fetch=A,self.Headers=f,self.Request=g,self.Response=w)},function(t,e,r){t.exports=r(8).gunzipSync},function(t,e,r){(function(t,r){/** @license zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License */(function(){"use strict";function n(t){throw t}var i=void 0,o=!0,s="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array&&"undefined"!=typeof DataView;function a(t,e){this.index="number"==typeof e?e:0,this.m=0,this.buffer=t instanceof(s?Uint8Array:Array)?t:new(s?Uint8Array:Array)(32768),2*this.buffer.length<=this.index&&n(Error("invalid index")),this.buffer.length<=this.index&&this.f()}a.prototype.f=function(){var t,e=this.buffer,r=e.length,n=new(s?Uint8Array:Array)(r<<1);if(s)n.set(e);else for(t=0;t>>8&255]<<16|p[t>>>16&255]<<8|p[t>>>24&255])>>32-e:p[t]>>8-e),8>e+s)a=a<>e-n-1&1,8==++s&&(s=0,i[o++]=p[a],a=0,o===i.length&&(i=this.f()));i[o]=a,this.buffer=i,this.m=s,this.index=o},a.prototype.finish=function(){var t,e=this.buffer,r=this.index;return 0h;++h){for(var u=l=h,c=7,l=l>>>1;l;l>>>=1)u<<=1,u|=1&l,--c;f[h]=(u<>>0}var p=f;function y(t,e,r){var n,i="number"==typeof e?e:e=0,o="number"==typeof r?r:t.length;for(n=-1,i=7&o;i--;++e)n=n>>>8^g[255&(n^t[e])];for(i=o>>3;i--;e+=8)n=(n=(n=(n=(n=(n=(n=(n=n>>>8^g[255&(n^t[e])])>>>8^g[255&(n^t[e+1])])>>>8^g[255&(n^t[e+2])])>>>8^g[255&(n^t[e+3])])>>>8^g[255&(n^t[e+4])])>>>8^g[255&(n^t[e+5])])>>>8^g[255&(n^t[e+6])])>>>8^g[255&(n^t[e+7])];return(4294967295^n)>>>0}var d=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],g=s?new Uint32Array(d):d;function b(){}function w(t){this.buffer=new(s?Uint16Array:Array)(2*t),this.length=0}function v(t){var e,r,n,i,o,a,h,f,u,c,l=t.length,p=0,y=Number.POSITIVE_INFINITY;for(f=0;fp&&(p=t[f]),t[f]>=1;for(c=n<<16|f,u=a;uo[n]);)i=o[r],o[r]=o[n],o[n]=i,i=o[r+1],o[r+1]=o[n+1],o[n+1]=i,r=n;return this.length},w.prototype.pop=function(){var t,e,r,n,i,o=this.buffer;for(e=o[0],t=o[1],this.length-=2,o[0]=o[this.length],o[1]=o[this.length+1],i=0;!((n=2*i+2)>=this.length)&&(n+2o[n]&&(n+=2),o[n]>o[i]);)r=o[i],o[i]=o[n],o[n]=r,r=o[i+1],o[i+1]=o[n+1],o[n+1]=r,i=n;return{index:t,value:e,length:this.length}};var A,_=2,E={NONE:0,L:1,t:_,X:3},T=[];for(A=0;288>A;A++)switch(o){case 143>=A:T.push([A+48,8]);break;case 255>=A:T.push([A-144+400,9]);break;case 279>=A:T.push([A-256+0,7]);break;case 287>=A:T.push([A-280+192,8]);break;default:n("invalid literal: "+A)}function B(t,e){this.length=t,this.N=e}m.prototype.h=function(){var t,e,r,h,f=this.input;switch(this.k){case 0:for(r=0,h=f.length;r>>8&255,b[w++]=255&l,b[w++]=l>>>8&255,s)b.set(p,w),w+=p.length,b=b.subarray(0,w);else{for(d=0,g=p.length;dK)for(;0K?K:138)>K-3&&Q=Q?(rt[J++]=17,rt[J++]=Q-3,nt[17]++):(rt[J++]=18,rt[J++]=Q-11,nt[18]++),K-=Q;else if(rt[J++]=et[q],nt[et[q]]++,3>--K)for(;0K?K:6)>K-3&&Qz;z++)W[z]=Y[V[z]];for(O=19;4=t:return[265,t-11,1];case 14>=t:return[266,t-13,1];case 16>=t:return[267,t-15,1];case 18>=t:return[268,t-17,1];case 22>=t:return[269,t-19,2];case 26>=t:return[270,t-23,2];case 30>=t:return[271,t-27,2];case 34>=t:return[272,t-31,2];case 42>=t:return[273,t-35,3];case 50>=t:return[274,t-43,3];case 58>=t:return[275,t-51,3];case 66>=t:return[276,t-59,3];case 82>=t:return[277,t-67,4];case 98>=t:return[278,t-83,4];case 114>=t:return[279,t-99,4];case 130>=t:return[280,t-115,4];case 162>=t:return[281,t-131,5];case 194>=t:return[282,t-163,5];case 226>=t:return[283,t-195,5];case 257>=t:return[284,t-227,5];case 258===t:return[285,t-258,0];default:n("invalid length: "+t)}}var e,r,i=[];for(e=3;258>=e;e++)r=t(e),i[e]=r[2]<<24|r[1]<<16|r[0];return i}(),U=s?new Uint32Array(R):R;function P(t,e){function r(t,e){var r,i,s,a,h=t.N,f=[],u=0;switch(r=U[t.length],f[u++]=65535&r,f[u++]=r>>16&255,f[u++]=r>>24,o){case 1===h:i=[0,h-1,0];break;case 2===h:i=[1,h-2,0];break;case 3===h:i=[2,h-3,0];break;case 4===h:i=[3,h-4,0];break;case 6>=h:i=[4,h-5,1];break;case 8>=h:i=[5,h-7,1];break;case 12>=h:i=[6,h-9,2];break;case 16>=h:i=[7,h-13,2];break;case 24>=h:i=[8,h-17,3];break;case 32>=h:i=[9,h-25,3];break;case 48>=h:i=[10,h-33,4];break;case 64>=h:i=[11,h-49,4];break;case 96>=h:i=[12,h-65,5];break;case 128>=h:i=[13,h-97,5];break;case 192>=h:i=[14,h-129,6];break;case 256>=h:i=[15,h-193,6];break;case 384>=h:i=[16,h-257,7];break;case 512>=h:i=[17,h-385,7];break;case 768>=h:i=[18,h-513,8];break;case 1024>=h:i=[19,h-769,8];break;case 1536>=h:i=[20,h-1025,9];break;case 2048>=h:i=[21,h-1537,9];break;case 3072>=h:i=[22,h-2049,10];break;case 4096>=h:i=[23,h-3073,10];break;case 6144>=h:i=[24,h-4097,11];break;case 8192>=h:i=[25,h-6145,11];break;case 12288>=h:i=[26,h-8193,12];break;case 16384>=h:i=[27,h-12289,12];break;case 24576>=h:i=[28,h-16385,13];break;case 32768>=h:i=[29,h-24577,13];break;default:n("invalid distance")}for(r=i,f[u++]=r[0],f[u++]=r[1],f[u++]=r[2],s=0,a=f.length;s=f;)m[f++]=0;for(f=0;29>=f;)A[f++]=0}for(m[256]=1,a=0,h=e.length;a=h){for(y&&r(y,-1),f=0,u=h-a;fo&&e+of&&(i=n,f=o),258===o)break}return new B(f,e-i)}function S(t,e){var r,n,i,o,a,h=t.length,f=new w(572),u=new(s?Uint8Array:Array)(h);if(!s)for(o=0;o2*u[o-1]+c[o]&&(u[o]=2*u[o-1]+c[o]),p[o]=Array(u[o]),y[o]=Array(u[o]);for(i=0;it[i]?(p[o][a]=h,y[o][a]=e,f+=2):(p[o][a]=t[i],y[o][a]=i,++i);d[o]=0,1===c[o]&&n(o)}return l}(n,n.length,e),o=0,a=r.length;o>>=1;return o}function k(t,e){this.input=t,this.b=this.c=0,this.g={},e&&(e.flags&&(this.g=e.flags),"string"==typeof e.filename&&(this.filename=e.filename),"string"==typeof e.comment&&(this.w=e.comment),e.deflateOptions&&(this.l=e.deflateOptions)),this.l||(this.l={})}k.prototype.h=function(){var t,e,r,n,o,a,h,f,u=new(s?Uint8Array:Array)(32768),c=0,l=this.input,p=this.c,d=this.filename,g=this.w;if(u[c++]=31,u[c++]=139,u[c++]=8,t=0,this.g.fname&&(t|=C),this.g.fcomment&&(t|=D),this.g.fhcrc&&(t|=L),u[c++]=t,e=(Date.now?Date.now():+new Date)/1e3|0,u[c++]=255&e,u[c++]=e>>>8&255,u[c++]=e>>>16&255,u[c++]=e>>>24&255,u[c++]=0,u[c++]=O,this.g.fname!==i){for(h=0,f=d.length;h>>8&255),u[c++]=255&a;u[c++]=0}if(this.g.comment){for(h=0,f=g.length;h>>8&255),u[c++]=255&a;u[c++]=0}return this.g.fhcrc&&(r=65535&y(u,0,c),u[c++]=255&r,u[c++]=r>>>8&255),this.l.outputBuffer=u,this.l.outputIndex=c,u=(o=new m(l,this.l)).h(),c=o.b,s&&(c+8>u.buffer.byteLength?(this.a=new Uint8Array(c+8),this.a.set(new Uint8Array(u.buffer)),u=this.a):u=new Uint8Array(u.buffer)),n=y(l,i,i),u[c++]=255&n,u[c++]=n>>>8&255,u[c++]=n>>>16&255,u[c++]=n>>>24&255,f=l.length,u[c++]=255&f,u[c++]=f>>>8&255,u[c++]=f>>>16&255,u[c++]=f>>>24&255,this.c=p,s&&c>>=1){case 0:var e=this.input,r=this.c,a=this.a,h=this.b,f=e.length,u=i,c=a.length,l=i;switch(this.e=this.j=0,r+1>=f&&n(Error("invalid uncompressed block header: LEN")),u=e[r++]|e[r++]<<8,r+1>=f&&n(Error("invalid uncompressed block header: NLEN")),u===~(e[r++]|e[r++]<<8)&&n(Error("invalid uncompressed block header: length verify")),r+u>e.length&&n(Error("input buffer is broken")),this.q){case Y:for(;h+u>a.length;){if(u-=l=c-h,s)a.set(e.subarray(r,r+l),h),h+=l,r+=l;else for(;l--;)a[h++]=e[r++];this.b=h,a=this.f(),h=this.b}break;case j:for(;h+u>a.length;)a=this.f({B:2});break;default:n(Error("invalid inflate mode"))}if(s)a.set(e.subarray(r,r+u),h),h+=u,r+=u;else for(;u--;)a[h++]=e[r++];this.c=r,this.b=h,this.a=a;break;case 1:this.r(et,nt);break;case 2:var p,y,d,g,b=it(this,5)+257,w=it(this,5)+1,m=it(this,4)+4,A=new(s?Uint8Array:Array)(G.length),_=i,E=i,T=i,B=i,R=i;for(R=0;R=N?8:255>=N?9:279>=N?7:8;var Z,tt,et=v(Q),rt=new(s?Uint8Array:Array)(30);for(Z=0,tt=rt.length;Z=h&&n(Error("input buffer is broken")),i|=s[a++]<>>e,t.e=o-e,t.c=a,r}function ot(t,e){for(var r,i,o=t.j,s=t.e,a=t.input,h=t.c,f=a.length,u=e[0],c=e[1];s=f);)o|=a[h++]<>>16)>s&&n(Error("invalid code length: "+i)),t.j=o>>i,t.e=s-i,t.c=h,65535&r}function st(t){this.input=t,this.c=0,this.G=[],this.R=!1}function at(t){if("string"==typeof t){var e,r,n=t.split("");for(e=0,r=n.length;e>>0;t=n}for(var i,o=1,s=0,a=t.length,h=0;0>>0}function ht(t,e){var r,i;switch(this.input=t,this.c=0,!e&&(e={})||(e.index&&(this.c=e.index),e.verify&&(this.V=e.verify)),r=t[this.c++],i=t[this.c++],15&r){case ft:this.method=ft;break;default:n(Error("unsupported compression method"))}0!=((r<<8)+i)%31&&n(Error("invalid fcheck flag:"+((r<<8)+i)%31)),32&i&&n(Error("fdict flag is not supported")),this.J=new M(t,{index:this.c,bufferSize:e.bufferSize,bufferType:e.bufferType,resize:e.resize})}M.prototype.r=function(t,e){var r=this.a,n=this.b;this.A=t;for(var i,o,s,a,h=r.length-258;256!==(i=ot(this,t));)if(256>i)n>=h&&(this.b=n,r=this.f(),n=this.b),r[n++]=i;else for(a=V[o=i-257],0=h&&(this.b=n,r=this.f(),n=this.b);a--;)r[n]=r[n++-s];for(;8<=this.e;)this.e-=8,this.c--;this.b=n},M.prototype.Q=function(t,e){var r=this.a,n=this.b;this.A=t;for(var i,o,s,a,h=r.length;256!==(i=ot(this,t));)if(256>i)n>=h&&(h=(r=this.f()).length),r[n++]=i;else for(a=V[o=i-257],0h&&(h=(r=this.f()).length);a--;)r[n]=r[n++-s];for(;8<=this.e;)this.e-=8,this.c--;this.b=n},M.prototype.f=function(){var t,e,r=new(s?Uint8Array:Array)(this.b-32768),n=this.b-32768,i=this.a;if(s)r.set(i.subarray(32768,r.length));else for(t=0,e=r.length;tt;++t)i[t]=i[n+t];return this.b=32768,i},M.prototype.S=function(t){var e,r,n,i=this.input.length/this.c+1|0,o=this.input,a=this.a;return t&&("number"==typeof t.B&&(i=t.B),"number"==typeof t.M&&(i+=t.M)),2>i?r=(n=(o.length-this.c)/this.A[2]/2*258|0)e&&(this.a.length=e),t=this.a),this.buffer=t},st.prototype.i=function(){for(var t=this.input.length;this.c>>0,y(e,i,i)!==d&&n(Error("invalid CRC-32 checksum: 0x"+y(e,i,i).toString(16)+" / 0x"+d.toString(16))),a.Z=h=(g[w++]|g[w++]<<8|g[w++]<<16|g[w++]<<24)>>>0,(4294967295&e.length)!==h&&n(Error("invalid input size: "+(4294967295&e.length)+" / "+h)),this.G.push(a),this.c=w}this.R=o;var v,m,A,_=this.G,E=0,T=0;for(v=0,m=_.length;v>>0!==at(t)&&n(Error("invalid adler-32 checksum"))),t};var ft=8;function ut(t,e){this.input=t,this.a=new(s?Uint8Array:Array)(32768),this.k=ct.t;var r,n={};for(r in!e&&(e={})||"number"!=typeof e.compressionType||(this.k=e.compressionType),e)n[r]=e[r];n.outputBuffer=this.a,this.I=new m(this.input,n)}var ct=E;function lt(t,e){var r;return r=new ut(t).h(),e||(e={}),e.H?r:gt(r)}function pt(t,e){var r;return t.subarray=t.slice,r=new ht(t).i(),e||(e={}),e.noBuffer?r:gt(r)}function yt(t,e){var r;return t.subarray=t.slice,r=new k(t).h(),e||(e={}),e.H?r:gt(r)}function dt(t,e){var r;return t.subarray=t.slice,r=new st(t).i(),e||(e={}),e.H?r:gt(r)}function gt(t){var e,n,i=new r(t.length);for(e=0,n=t.length;e>24&255,h[f++]=a>>16&255,h[f++]=a>>8&255,h[f++]=255&a,h},e.deflate=function(e,r,n){t.nextTick(function(){var t,i;try{i=lt(e,n)}catch(e){t=e}r(t,i)})},e.deflateSync=lt,e.inflate=function(e,r,n){t.nextTick(function(){var t,i;try{i=pt(e,n)}catch(e){t=e}r(t,i)})},e.inflateSync=pt,e.gzip=function(e,r,n){t.nextTick(function(){var t,i;try{i=yt(e,n)}catch(e){t=e}r(t,i)})},e.gzipSync=yt,e.gunzip=function(e,r,n){t.nextTick(function(){var t,i;try{i=dt(e,n)}catch(e){t=e}r(t,i)})},e.gunzipSync=dt}).call(this)}).call(this,r(9),r(10).Buffer)},function(t,e){var r,n,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(t){r=o}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(t){n=s}}();var h,f=[],u=!1,c=-1;function l(){u&&h&&(u=!1,h.length?f=h.concat(f):c=-1,f.length&&p())}function p(){if(!u){var t=a(l);u=!0;for(var e=f.length;e;){for(h=f,f=[];++c1)for(var r=1;r - * @license MIT - */ -var n=r(11),i=r(12),o=r(13);function s(){return h.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function y(t,e){if(h.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return N(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return F(t).length;default:if(n)return N(t).length;e=(""+e).toLowerCase(),n=!0}}function d(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function g(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=h.from(e,n)),h.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,i);if("number"==typeof e)return e&=255,h.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,n,i){var o,s=1,a=t.length,h=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,h/=2,r/=2}function f(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var u=-1;for(o=r;oa&&(r=a-h),o=r;o>=0;o--){for(var c=!0,l=0;li&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function T(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function B(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:f>223?3:f>191?2:1;if(i+c<=r)switch(c){case 1:f<128&&(u=f);break;case 2:128==(192&(o=t[i+1]))&&(h=(31&f)<<6|63&o)>127&&(u=h);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(h=(15&f)<<12|(63&o)<<6|63&s)>2047&&(h<55296||h>57343)&&(u=h);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(h=(15&f)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&h<1114112&&(u=h)}null===u?(u=65533,c=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),i+=c}return function(t){var e=t.length;if(e<=R)return String.fromCharCode.apply(String,t);var r="",n=0;for(;nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return I(this,e,r);case"utf8":case"utf-8":return B(this,e,r);case"ascii":return U(this,e,r);case"latin1":case"binary":return P(this,e,r);case"base64":return T(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},h.prototype.equals=function(t){if(!h.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===h.compare(this,t)},h.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},h.prototype.compare=function(t,e,r,n,i){if(!h.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s),f=this.slice(n,i),u=t.slice(e,r),c=0;ci)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return v(this,t,e,r);case"ascii":return m(this,t,e,r);case"latin1":case"binary":return A(this,t,e,r);case"base64":return _(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var R=4096;function U(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function k(t,e,r,n,i,o){if(!h.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function O(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i>>8*(n?i:1-i)}function L(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i>>8*(n?i:3-i)&255}function C(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(t,e,r,n,o){return o||C(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function M(t,e,r,n,o){return o||C(t,0,r,8),i.write(t,e,r,n,52,8),r+8}h.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e0&&(i*=256);)n+=this[t+--e]*i;return n},h.prototype.readUInt8=function(t,e){return e||x(t,1,this.length),this[t]},h.prototype.readUInt16LE=function(t,e){return e||x(t,2,this.length),this[t]|this[t+1]<<8},h.prototype.readUInt16BE=function(t,e){return e||x(t,2,this.length),this[t]<<8|this[t+1]},h.prototype.readUInt32LE=function(t,e){return e||x(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},h.prototype.readUInt32BE=function(t,e){return e||x(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},h.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||x(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},h.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||x(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},h.prototype.readInt8=function(t,e){return e||x(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},h.prototype.readInt16LE=function(t,e){e||x(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},h.prototype.readInt16BE=function(t,e){e||x(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},h.prototype.readInt32LE=function(t,e){return e||x(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},h.prototype.readInt32BE=function(t,e){return e||x(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},h.prototype.readFloatLE=function(t,e){return e||x(t,4,this.length),i.read(this,t,!0,23,4)},h.prototype.readFloatBE=function(t,e){return e||x(t,4,this.length),i.read(this,t,!1,23,4)},h.prototype.readDoubleLE=function(t,e){return e||x(t,8,this.length),i.read(this,t,!0,52,8)},h.prototype.readDoubleBE=function(t,e){return e||x(t,8,this.length),i.read(this,t,!1,52,8)},h.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||k(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+i]=t/o&255;return e+r},h.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||k(this,t,e,1,255,0),h.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},h.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||k(this,t,e,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):O(this,t,e,!0),e+2},h.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||k(this,t,e,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):O(this,t,e,!1),e+2},h.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||k(this,t,e,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):L(this,t,e,!0),e+4},h.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||k(this,t,e,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):L(this,t,e,!1),e+4},h.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);k(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+r},h.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);k(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},h.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||k(this,t,e,1,127,-128),h.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},h.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||k(this,t,e,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):O(this,t,e,!0),e+2},h.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||k(this,t,e,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):O(this,t,e,!1),e+2},h.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||k(this,t,e,4,2147483647,-2147483648),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):L(this,t,e,!0),e+4},h.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||k(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):L(this,t,e,!1),e+4},h.prototype.writeFloatLE=function(t,e,r){return D(this,t,e,!0,r)},h.prototype.writeFloatBE=function(t,e,r){return D(this,t,e,!1,r)},h.prototype.writeDoubleLE=function(t,e,r){return M(this,t,e,!0,r)},h.prototype.writeDoubleBE=function(t,e,r){return M(this,t,e,!1,r)},h.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(o<1e3||!h.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function F(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(Y,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function z(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}}).call(this,r(0))},function(t,e,r){"use strict";e.byteLength=function(t){return 3*t.length/4-f(t)},e.toByteArray=function(t){var e,r,n,s,a,h=t.length;s=f(t),a=new o(3*h/4-s),r=s>0?h-4:h;var u=0;for(e=0;e>16&255,a[u++]=n>>8&255,a[u++]=255&n;2===s?(n=i[t.charCodeAt(e)]<<2|i[t.charCodeAt(e+1)]>>4,a[u++]=255&n):1===s&&(n=i[t.charCodeAt(e)]<<10|i[t.charCodeAt(e+1)]<<4|i[t.charCodeAt(e+2)]>>2,a[u++]=n>>8&255,a[u++]=255&n);return a},e.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o="",s=[],a=0,h=r-i;ah?h:a+16383));1===i?(e=t[r-1],o+=n[e>>2],o+=n[e<<4&63],o+="=="):2===i&&(e=(t[r-2]<<8)+t[r-1],o+=n[e>>10],o+=n[e>>4&63],o+=n[e<<2&63],o+="=");return s.push(o),s.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,h=s.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function u(t,e,r){for(var i,o,s=[],a=e;a>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,h=(1<>1,u=-7,c=r?i-1:0,l=r?-1:1,p=t[e+c];for(c+=l,o=p&(1<<-u)-1,p>>=-u,u+=a;u>0;o=256*o+t[e+c],c+=l,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=n;u>0;s=256*s+t[e+c],c+=l,u-=8);if(0===o)o=1-f;else{if(o===h)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=f}return(p?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,h,f=8*o-i-1,u=(1<>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,y=n?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-s))<1&&(s--,h*=2),(e+=s+c>=1?l/h:l*Math.pow(2,1-c))*h>=2&&(s++,h/=2),s+c>=u?(a=0,s=u):s+c>=1?(a=(e*h-1)*Math.pow(2,i),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&a,p+=y,a/=256,i-=8);for(s=s<0;t[r+p]=255&s,p+=y,s/=256,f-=8);t[r+p-y]|=128*d}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){const{set:n,get:i}=r(15);t.exports={readCache:i,writeCache:n}},function(t,e,r){"use strict";r.r(e),r.d(e,"Store",function(){return n}),r.d(e,"get",function(){return s}),r.d(e,"set",function(){return a}),r.d(e,"del",function(){return h}),r.d(e,"clear",function(){return f}),r.d(e,"keys",function(){return u});class n{constructor(t="keyval-store",e="keyval"){this.storeName=e,this._dbp=new Promise((r,n)=>{const i=indexedDB.open(t,1);i.onerror=(()=>n(i.error)),i.onsuccess=(()=>r(i.result)),i.onupgradeneeded=(()=>{i.result.createObjectStore(e)})})}_withIDBStore(t,e){return this._dbp.then(r=>new Promise((n,i)=>{const o=r.transaction(this.storeName,t);o.oncomplete=(()=>n()),o.onabort=o.onerror=(()=>i(o.error)),e(o.objectStore(this.storeName))}))}}let i;function o(){return i||(i=new n),i}function s(t,e=o()){let r;return e._withIDBStore("readonly",e=>{r=e.get(t)}).then(()=>r.result)}function a(t,e,r=o()){return r._withIDBStore("readwrite",r=>{r.put(e,t)})}function h(t,e=o()){return e._withIDBStore("readwrite",e=>{e.delete(t)})}function f(t=o()){return t._withIDBStore("readwrite",t=>{t.clear()})}function u(t=o()){const e=[];return t._withIDBStore("readonly",t=>{(t.openKeyCursor||t.openCursor).call(t).onsuccess=function(){this.result&&(e.push(this.result.key),this.result.continue())}}).then(()=>e)}},function(t,e){t.exports=((t,e)=>{const r=t._malloc(e.length*Uint8Array.BYTES_PER_ELEMENT);t.HEAPU8.set(e,r);const n=t._pixReadMem(r,e.length);0===t.getValue(n+28,"i32")&&t.setValue(n+28,70,"i32");const[i,o,s,a,h,f,u,c,l,p]=Array(10).fill(0).map((e,r)=>t.getValue(n+4*r,"i32"));return{w:i,h:o,d:s,spp:a,wpl:h,refcount:f,xres:u,yres:c,informat:l,special:p,data:n}})},function(t,e){t.exports=((t,e)=>{const r=e.GetIterator(),n=[];let i,o,s,a,h;const f=(e,r)=>Object.keys(t).filter(t=>t.substr(0,r.length+1)===`${r}_`).filter(r=>t[r]===e).map(t=>t.slice(r.length+1))[0];r.Begin();do{if(r.IsAtBeginningOf(t.RIL_BLOCK)){const e=r.BlockPolygon();let o=null;if(t.getPointer(e)>0){const r=e.get_n(),n=e.get_x(),i=e.get_y();o=[];for(let t=0;t{const e=t.split("\n");if(" "===e[0].substring(0,2))for(let t=0;t {\n workerUtils.dispatchHandlers(data, obj => postMessage(obj));\n});\n\nworkerUtils.setAdapter({\n getCore: (req, res) => {\n if (!global.TesseractCore) {\n res.progress({ status: 'loading tesseract core', progress: 0 });\n global.importScripts(req.workerOptions.corePath);\n global.TesseractCore = typeof WebAssembly === 'object' ? global.TesseractCoreWASM : global.TesseractCoreASM;\n res.progress({ status: 'loading tesseract core', progress: 1 });\n }\n return global.TesseractCore;\n },\n});\n","const { readImage, loadLang } = require('tesseract.js-utils');\nconst dump = require('./dump');\n\nlet Module;\nlet base;\nlet latestJob;\nlet adapter = {};\n\nconst handleInit = (req, res) => {\n let MIN_MEMORY = 100663296;\n\n if (['chi_sim', 'chi_tra', 'jpn'].includes(req.options.lang)) {\n MIN_MEMORY = 167772160;\n }\n\n if (!Module || Module.TOTAL_MEMORY < MIN_MEMORY) {\n const Core = adapter.getCore(req, res);\n\n res.progress({ status: 'initializing tesseract', progress: 0 });\n\n return Core({\n // TOTAL_MEMORY: MIN_MEMORY,\n TesseractProgress(percent) {\n latestJob.progress({ status: 'recognizing text', progress: Math.max(0, (percent - 30) / 70) });\n },\n })\n .then((TessModule) => {\n Module = TessModule;\n base = new Module.TessBaseAPI();\n res.progress({ status: 'initialized tesseract', progress: 1 });\n });\n }\n\n return new Promise();\n};\n\nconst setImage = (image) => {\n const { w, h, data } = readImage(Module, Array.from(image));\n\n base.SetImage(data);\n base.SetRectangle(0, 0, w, h);\n return data;\n};\n\nconst loadLanguage = (req, res, cb) => {\n const { options: { lang }, workerOptions: { langPath } } = req;\n return loadLang({\n langs: lang,\n tessModule: Module,\n langURI: langPath,\n cache: true,\n }).then(cb);\n};\n\nconst handleRecognize = (req, res) => {\n handleInit(req, res)\n .then(() => {\n loadLanguage(req, res, () => {\n const { options } = req;\n\n const progressUpdate = (progress) => {\n res.progress({ status: 'initializing api', progress });\n };\n\n progressUpdate(0);\n base.Init(null, options.lang);\n progressUpdate(0.3);\n\n Object.keys(options).forEach((key) => {\n base.SetVariable(key, options[key]);\n });\n\n progressUpdate(0.6);\n const ptr = setImage(req.image);\n progressUpdate(1);\n\n base.Recognize(null);\n\n const result = dump(Module, base);\n\n base.End();\n Module._free(ptr);\n\n res.resolve(result);\n });\n });\n};\n\n\nconst handleDetect = (req, res) => {\n handleInit(req, res)\n .then(() => {\n req.options.lang = 'osd';\n loadLanguage(req, res, () => {\n base.Init(null, 'osd');\n base.SetPageSegMode(Module.PSM_OSD_ONLY);\n\n const ptr = setImage(req.image);\n const results = new Module.OSResults();\n\n if (!base.DetectOS(results)) {\n base.End();\n Module._free(ptr);\n res.reject('Failed to detect OS');\n } else {\n const best = results.get_best_result();\n const oid = best.get_orientation_id();\n const sid = best.get_script_id();\n\n base.End();\n Module._free(ptr);\n\n res.resolve({\n tesseract_script_id: sid,\n script: results.get_unicharset().get_script_from_script_id(sid),\n script_confidence: best.get_sconfidence(),\n orientation_degrees: [0, 270, 180, 90][oid],\n orientation_confidence: best.get_oconfidence(),\n });\n }\n });\n });\n};\n\nexports.dispatchHandlers = (packet, send) => {\n const respond = (status, data) => {\n send({\n jobId: packet.jobId,\n status,\n action: packet.action,\n data,\n });\n };\n respond.resolve = respond.bind(this, 'resolve');\n respond.reject = respond.bind(this, 'reject');\n respond.progress = respond.bind(this, 'progress');\n\n latestJob = respond;\n\n try {\n if (packet.action === 'recognize') {\n handleRecognize(packet.payload, respond);\n } else if (packet.action === 'detect') {\n handleDetect(packet.payload, respond);\n }\n } catch (err) {\n // Prepare exception to travel through postMessage\n respond.reject(err.toString());\n }\n};\n\nexports.setAdapter = (impl) => {\n adapter = impl;\n};\n","module.exports = {\n loadLang: require('./loadLang')({\n fetch: require('./common/browser/fetch'),\n gunzip: require('./common/browser/gunzip'),\n ...require('./common/browser/cache'),\n }),\n readImage: require('./readImage'),\n};\n","const handleLang = modules => ({\n tessModule,\n dataPath,\n cachePath,\n cache,\n lang,\n}) => (data) => {\n if (tessModule) {\n if (dataPath) {\n try {\n tessModule.FS.mkdir(dataPath);\n } catch (err) {\n // Do nothing\n }\n }\n tessModule.FS.writeFile(`${dataPath || '.'}/${lang}.traineddata`, data);\n }\n if (cache) {\n modules.writeCache(`${cachePath || '.'}/${lang}.traineddata`, data);\n }\n return data;\n};\n\nconst loadAndGunzipFile = modules => ({\n langURI,\n cachePath,\n ...options\n}) => lang => (\n modules.readCache(`${cachePath || '.'}/${lang}.traineddata`)\n .then((data) => {\n if (typeof data === 'undefined') {\n return Promise.reject();\n }\n return handleLang(modules)({ cachePath, lang, ...options })(data);\n })\n .catch(() => (\n // console.log(`Download ${lang}.traineddata.gz from ${langURI}/${lang}.traineddata.gz...`);\n modules.fetch(`${langURI}/${lang}.traineddata.gz`)\n .then(resp => resp.arrayBuffer())\n .then(buf => modules.gunzip(new Uint8Array(buf)))\n .then(handleLang(modules)({ cachePath, lang, ...options }))\n ))\n);\n\n/**\n * Load language(s) from local cache, download from remote if not in cache.\n *\n * All params below actually store in a object.\n *\n * ex:\n * loadLang({ langs, tesssModule, ... });\n *\n * @name loadLang\n * @function\n * @param {string} langs - langs to load, use '+' for multiple languages, ex: eng+chi_tra\n * @param {object} tessModule - TesseractModule\n * @param {string} langURI - prefix URI for downloading lang file\n * @param {string} cachePath - path to find cache\n * @param {string} dataPath - path to store data in mem\n * @param {boolean} cache - true for caching\n *\n */\nmodule.exports = modules => ({\n langs,\n ...options\n}) => (\n Promise\n .all(langs.split('+').map(loadAndGunzipFile(modules)(options)))\n);\n","const { fetch } = require('whatwg-fetch');\n\nmodule.exports = fetch;\n","var support = {\n searchParams: 'URLSearchParams' in self,\n iterable: 'Symbol' in self && 'iterator' in Symbol,\n blob:\n 'FileReader' in self &&\n 'Blob' in self &&\n (function() {\n try {\n new Blob()\n return true\n } catch (e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n}\n\nfunction isDataView(obj) {\n return obj && DataView.prototype.isPrototypeOf(obj)\n}\n\nif (support.arrayBuffer) {\n var viewClasses = [\n '[object Int8Array]',\n '[object Uint8Array]',\n '[object Uint8ClampedArray]',\n '[object Int16Array]',\n '[object Uint16Array]',\n '[object Int32Array]',\n '[object Uint32Array]',\n '[object Float32Array]',\n '[object Float64Array]'\n ]\n\n var isArrayBufferView =\n ArrayBuffer.isView ||\n function(obj) {\n return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1\n }\n}\n\nfunction normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n}\n\nfunction normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n}\n\n// Build a destructive iterator for the value list\nfunction iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n}\n\nexport function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n } else if (Array.isArray(headers)) {\n headers.forEach(function(header) {\n this.append(header[0], header[1])\n }, this)\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n}\n\nHeaders.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var oldValue = this.map[name]\n this.map[name] = oldValue ? oldValue + ', ' + value : value\n}\n\nHeaders.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n}\n\nHeaders.prototype.get = function(name) {\n name = normalizeName(name)\n return this.has(name) ? this.map[name] : null\n}\n\nHeaders.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n}\n\nHeaders.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = normalizeValue(value)\n}\n\nHeaders.prototype.forEach = function(callback, thisArg) {\n for (var name in this.map) {\n if (this.map.hasOwnProperty(name)) {\n callback.call(thisArg, this.map[name], name, this)\n }\n }\n}\n\nHeaders.prototype.keys = function() {\n var items = []\n this.forEach(function(value, name) {\n items.push(name)\n })\n return iteratorFor(items)\n}\n\nHeaders.prototype.values = function() {\n var items = []\n this.forEach(function(value) {\n items.push(value)\n })\n return iteratorFor(items)\n}\n\nHeaders.prototype.entries = function() {\n var items = []\n this.forEach(function(value, name) {\n items.push([name, value])\n })\n return iteratorFor(items)\n}\n\nif (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries\n}\n\nfunction consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n}\n\nfunction fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n}\n\nfunction readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n var promise = fileReaderReady(reader)\n reader.readAsArrayBuffer(blob)\n return promise\n}\n\nfunction readBlobAsText(blob) {\n var reader = new FileReader()\n var promise = fileReaderReady(reader)\n reader.readAsText(blob)\n return promise\n}\n\nfunction readArrayBufferAsText(buf) {\n var view = new Uint8Array(buf)\n var chars = new Array(view.length)\n\n for (var i = 0; i < view.length; i++) {\n chars[i] = String.fromCharCode(view[i])\n }\n return chars.join('')\n}\n\nfunction bufferClone(buf) {\n if (buf.slice) {\n return buf.slice(0)\n } else {\n var view = new Uint8Array(buf.byteLength)\n view.set(new Uint8Array(buf))\n return view.buffer\n }\n}\n\nfunction Body() {\n this.bodyUsed = false\n\n this._initBody = function(body) {\n this._bodyInit = body\n if (!body) {\n this._bodyText = ''\n } else if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString()\n } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n this._bodyArrayBuffer = bufferClone(body.buffer)\n // IE 10-11 can't handle a DataView body.\n this._bodyInit = new Blob([this._bodyArrayBuffer])\n } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n this._bodyArrayBuffer = bufferClone(body)\n } else {\n this._bodyText = body = Object.prototype.toString.call(body)\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(new Blob([this._bodyArrayBuffer]))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n if (this._bodyArrayBuffer) {\n return consumed(this) || Promise.resolve(this._bodyArrayBuffer)\n } else {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n }\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n}\n\n// HTTP methods whose capitalization should be normalized\nvar methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\nfunction normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return methods.indexOf(upcased) > -1 ? upcased : method\n}\n\nexport function Request(input, options) {\n options = options || {}\n var body = options.body\n\n if (input instanceof Request) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n this.signal = input.signal\n if (!body && input._bodyInit != null) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = String(input)\n }\n\n this.credentials = options.credentials || this.credentials || 'same-origin'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.signal = options.signal || this.signal\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n}\n\nRequest.prototype.clone = function() {\n return new Request(this, {body: this._bodyInit})\n}\n\nfunction decode(body) {\n var form = new FormData()\n body\n .trim()\n .split('&')\n .forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n}\n\nfunction parseHeaders(rawHeaders) {\n var headers = new Headers()\n // Replace instances of \\r\\n and \\n followed by at least one space or horizontal tab with a space\n // https://tools.ietf.org/html/rfc7230#section-3.2\n var preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, ' ')\n preProcessedHeaders.split(/\\r?\\n/).forEach(function(line) {\n var parts = line.split(':')\n var key = parts.shift().trim()\n if (key) {\n var value = parts.join(':').trim()\n headers.append(key, value)\n }\n })\n return headers\n}\n\nBody.call(Request.prototype)\n\nexport function Response(bodyInit, options) {\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status === undefined ? 200 : options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = 'statusText' in options ? options.statusText : 'OK'\n this.headers = new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n}\n\nBody.call(Response.prototype)\n\nResponse.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n}\n\nResponse.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n}\n\nvar redirectStatuses = [301, 302, 303, 307, 308]\n\nResponse.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n}\n\nexport var DOMException = self.DOMException\ntry {\n new DOMException()\n} catch (err) {\n DOMException = function(message, name) {\n this.message = message\n this.name = name\n var error = Error(message)\n this.stack = error.stack\n }\n DOMException.prototype = Object.create(Error.prototype)\n DOMException.prototype.constructor = DOMException\n}\n\nexport function fetch(input, init) {\n return new Promise(function(resolve, reject) {\n var request = new Request(input, init)\n\n if (request.signal && request.signal.aborted) {\n return reject(new DOMException('Aborted', 'AbortError'))\n }\n\n var xhr = new XMLHttpRequest()\n\n function abortXhr() {\n xhr.abort()\n }\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders() || '')\n }\n options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL')\n var body = 'response' in xhr ? xhr.response : xhr.responseText\n resolve(new Response(body, options))\n }\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.ontimeout = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.onabort = function() {\n reject(new DOMException('Aborted', 'AbortError'))\n }\n\n xhr.open(request.method, request.url, true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n } else if (request.credentials === 'omit') {\n xhr.withCredentials = false\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob'\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n\n if (request.signal) {\n request.signal.addEventListener('abort', abortXhr)\n\n xhr.onreadystatechange = function() {\n // DONE (success or failure)\n if (xhr.readyState === 4) {\n request.signal.removeEventListener('abort', abortXhr)\n }\n }\n }\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n}\n\nfetch.polyfill = true\n\nif (!self.fetch) {\n self.fetch = fetch\n self.Headers = Headers\n self.Request = Request\n self.Response = Response\n}\n","module.exports = require('zlibjs').gunzipSync;\n","/** @license zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License */(function() {'use strict';function q(b){throw b;}var t=void 0,v=!0;var B=\"undefined\"!==typeof Uint8Array&&\"undefined\"!==typeof Uint16Array&&\"undefined\"!==typeof Uint32Array&&\"undefined\"!==typeof DataView;function G(b,a){this.index=\"number\"===typeof a?a:0;this.m=0;this.buffer=b instanceof(B?Uint8Array:Array)?b:new (B?Uint8Array:Array)(32768);2*this.buffer.length<=this.index&&q(Error(\"invalid index\"));this.buffer.length<=this.index&&this.f()}G.prototype.f=function(){var b=this.buffer,a,c=b.length,d=new (B?Uint8Array:Array)(c<<1);if(B)d.set(b);else for(a=0;a>>8&255]<<16|I[b>>>16&255]<<8|I[b>>>24&255])>>32-a:I[b]>>8-a);if(8>a+f)g=g<>a-k-1&1,8===++f&&(f=0,d[e++]=I[g],g=0,e===d.length&&(d=this.f()));d[e]=g;this.buffer=d;this.m=f;this.index=e};G.prototype.finish=function(){var b=this.buffer,a=this.index,c;0L;++L){for(var R=L,ba=R,ca=7,R=R>>>1;R;R>>>=1)ba<<=1,ba|=R&1,--ca;aa[L]=(ba<>>0}var I=aa;function ha(b,a,c){var d,e=\"number\"===typeof a?a:a=0,f=\"number\"===typeof c?c:b.length;d=-1;for(e=f&7;e--;++a)d=d>>>8^S[(d^b[a])&255];for(e=f>>3;e--;a+=8)d=d>>>8^S[(d^b[a])&255],d=d>>>8^S[(d^b[a+1])&255],d=d>>>8^S[(d^b[a+2])&255],d=d>>>8^S[(d^b[a+3])&255],d=d>>>8^S[(d^b[a+4])&255],d=d>>>8^S[(d^b[a+5])&255],d=d>>>8^S[(d^b[a+6])&255],d=d>>>8^S[(d^b[a+7])&255];return(d^4294967295)>>>0}\nvar ia=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,\n2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,\n2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,\n2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,\n3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,\n936918E3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],S=B?new Uint32Array(ia):ia;function ja(){};function ka(b){this.buffer=new (B?Uint16Array:Array)(2*b);this.length=0}ka.prototype.getParent=function(b){return 2*((b-2)/4|0)};ka.prototype.push=function(b,a){var c,d,e=this.buffer,f;c=this.length;e[this.length++]=a;for(e[this.length++]=b;0e[d])f=e[c],e[c]=e[d],e[d]=f,f=e[c+1],e[c+1]=e[d+1],e[d+1]=f,c=d;else break;return this.length};\nka.prototype.pop=function(){var b,a,c=this.buffer,d,e,f;a=c[0];b=c[1];this.length-=2;c[0]=c[this.length];c[1]=c[this.length+1];for(f=0;;){e=2*f+2;if(e>=this.length)break;e+2c[e]&&(e+=2);if(c[e]>c[f])d=c[f],c[f]=c[e],c[e]=d,d=c[f+1],c[f+1]=c[e+1],c[e+1]=d;else break;f=e}return{index:b,value:a,length:this.length}};function T(b){var a=b.length,c=0,d=Number.POSITIVE_INFINITY,e,f,g,k,h,m,r,p,l,n;for(p=0;pc&&(c=b[p]),b[p]>=1;n=g<<16|p;for(l=m;lU;U++)switch(v){case 143>=U:qa.push([U+48,8]);break;case 255>=U:qa.push([U-144+400,9]);break;case 279>=U:qa.push([U-256+0,7]);break;case 287>=U:qa.push([U-280+192,8]);break;default:q(\"invalid literal: \"+U)}\nna.prototype.h=function(){var b,a,c,d,e=this.input;switch(this.k){case 0:c=0;for(d=e.length;c>>8&255;l[n++]=m&255;l[n++]=m>>>8&255;if(B)l.set(f,n),n+=f.length,l=l.subarray(0,n);else{r=0;for(p=f.length;rA)for(;0A?A:138,F>A-3&&F=F?(J[H++]=17,J[H++]=F-3,P[17]++):(J[H++]=18,J[H++]=F-11,P[18]++),A-=F;else if(J[H++]=K[y],P[K[y]]++,A--,3>A)for(;0A?A:6,F>A-3&&FE;E++)ta[E]=la[qb[E]];for(Y=19;4=a:return[265,a-11,1];case 14>=a:return[266,a-13,1];case 16>=a:return[267,a-15,1];case 18>=a:return[268,a-17,1];case 22>=a:return[269,a-19,2];case 26>=a:return[270,a-23,2];case 30>=a:return[271,a-27,2];case 34>=a:return[272,\na-31,2];case 42>=a:return[273,a-35,3];case 50>=a:return[274,a-43,3];case 58>=a:return[275,a-51,3];case 66>=a:return[276,a-59,3];case 82>=a:return[277,a-67,4];case 98>=a:return[278,a-83,4];case 114>=a:return[279,a-99,4];case 130>=a:return[280,a-115,4];case 162>=a:return[281,a-131,5];case 194>=a:return[282,a-163,5];case 226>=a:return[283,a-195,5];case 257>=a:return[284,a-227,5];case 258===a:return[285,a-258,0];default:q(\"invalid length: \"+a)}}var a=[],c,d;for(c=3;258>=c;c++)d=b(c),a[c]=d[2]<<24|d[1]<<\n16|d[0];return a}(),ya=B?new Uint32Array(xa):xa;\nfunction ra(b,a){function c(a,c){var b=a.N,d=[],f=0,e;e=ya[a.length];d[f++]=e&65535;d[f++]=e>>16&255;d[f++]=e>>24;var g;switch(v){case 1===b:g=[0,b-1,0];break;case 2===b:g=[1,b-2,0];break;case 3===b:g=[2,b-3,0];break;case 4===b:g=[3,b-4,0];break;case 6>=b:g=[4,b-5,1];break;case 8>=b:g=[5,b-7,1];break;case 12>=b:g=[6,b-9,2];break;case 16>=b:g=[7,b-13,2];break;case 24>=b:g=[8,b-17,3];break;case 32>=b:g=[9,b-25,3];break;case 48>=b:g=[10,b-33,4];break;case 64>=b:g=[11,b-49,4];break;case 96>=b:g=[12,b-\n65,5];break;case 128>=b:g=[13,b-97,5];break;case 192>=b:g=[14,b-129,6];break;case 256>=b:g=[15,b-193,6];break;case 384>=b:g=[16,b-257,7];break;case 512>=b:g=[17,b-385,7];break;case 768>=b:g=[18,b-513,8];break;case 1024>=b:g=[19,b-769,8];break;case 1536>=b:g=[20,b-1025,9];break;case 2048>=b:g=[21,b-1537,9];break;case 3072>=b:g=[22,b-2049,10];break;case 4096>=b:g=[23,b-3073,10];break;case 6144>=b:g=[24,b-4097,11];break;case 8192>=b:g=[25,b-6145,11];break;case 12288>=b:g=[26,b-8193,12];break;case 16384>=\nb:g=[27,b-12289,12];break;case 24576>=b:g=[28,b-16385,13];break;case 32768>=b:g=[29,b-24577,13];break;default:q(\"invalid distance\")}e=g;d[f++]=e[0];d[f++]=e[1];d[f++]=e[2];var h,k;h=0;for(k=d.length;h=f;)u[f++]=0;for(f=0;29>=f;)w[f++]=0}u[256]=1;d=0;for(e=a.length;d=e){p&&c(p,-1);f=0;for(g=e-d;fg&&a+gf&&(e=d,f=g);if(258===g)break}return new va(f,a-e)}\nfunction sa(b,a){var c=b.length,d=new ka(572),e=new (B?Uint8Array:Array)(c),f,g,k,h,m;if(!B)for(h=0;h2*e[n-1]+f[n]&&(e[n]=2*e[n-1]+f[n]),k[n]=Array(e[n]),h[n]=Array(e[n]);for(l=0;lb[l]?(k[n][s]=u,h[n][s]=a,w+=2):(k[n][s]=b[l],h[n][s]=l,++l);m[n]=0;1===f[n]&&d(n)}return g}\nfunction ua(b){var a=new (B?Uint16Array:Array)(b.length),c=[],d=[],e=0,f,g,k,h;f=0;for(g=b.length;f>>=1}return a};function Ba(b,a){this.input=b;this.b=this.c=0;this.g={};a&&(a.flags&&(this.g=a.flags),\"string\"===typeof a.filename&&(this.filename=a.filename),\"string\"===typeof a.comment&&(this.w=a.comment),a.deflateOptions&&(this.l=a.deflateOptions));this.l||(this.l={})}\nBa.prototype.h=function(){var b,a,c,d,e,f,g,k,h=new (B?Uint8Array:Array)(32768),m=0,r=this.input,p=this.c,l=this.filename,n=this.w;h[m++]=31;h[m++]=139;h[m++]=8;b=0;this.g.fname&&(b|=Ca);this.g.fcomment&&(b|=Da);this.g.fhcrc&&(b|=Ea);h[m++]=b;a=(Date.now?Date.now():+new Date)/1E3|0;h[m++]=a&255;h[m++]=a>>>8&255;h[m++]=a>>>16&255;h[m++]=a>>>24&255;h[m++]=0;h[m++]=Sa;if(this.g.fname!==t){g=0;for(k=l.length;g>>8&255),h[m++]=f&255;h[m++]=0}if(this.g.comment){g=\n0;for(k=n.length;g>>8&255),h[m++]=f&255;h[m++]=0}this.g.fhcrc&&(c=ha(h,0,m)&65535,h[m++]=c&255,h[m++]=c>>>8&255);this.l.outputBuffer=h;this.l.outputIndex=m;e=new na(r,this.l);h=e.h();m=e.b;B&&(m+8>h.buffer.byteLength?(this.a=new Uint8Array(m+8),this.a.set(new Uint8Array(h.buffer)),h=this.a):h=new Uint8Array(h.buffer));d=ha(r,t,t);h[m++]=d&255;h[m++]=d>>>8&255;h[m++]=d>>>16&255;h[m++]=d>>>24&255;k=r.length;h[m++]=k&255;h[m++]=k>>>8&255;h[m++]=k>>>16&255;h[m++]=\nk>>>24&255;this.c=p;B&&m>>=1;switch(b){case 0:var a=this.input,c=this.c,d=this.a,e=this.b,f=a.length,g=t,k=t,h=d.length,m=t;this.e=this.j=0;c+1>=f&&q(Error(\"invalid uncompressed block header: LEN\"));g=a[c++]|a[c++]<<8;c+1>=f&&q(Error(\"invalid uncompressed block header: NLEN\"));k=a[c++]|a[c++]<<8;g===~k&&q(Error(\"invalid uncompressed block header: length verify\"));c+g>a.length&&q(Error(\"input buffer is broken\"));switch(this.q){case Ua:for(;e+g>d.length;){m=\nh-e;g-=m;if(B)d.set(a.subarray(c,c+m),e),e+=m,c+=m;else for(;m--;)d[e++]=a[c++];this.b=e;d=this.f();e=this.b}break;case Ta:for(;e+g>d.length;)d=this.f({B:2});break;default:q(Error(\"invalid inflate mode\"))}if(B)d.set(a.subarray(c,c+g),e),e+=g,c+=g;else for(;g--;)d[e++]=a[c++];this.c=c;this.b=e;this.a=d;break;case 1:this.r(Va,Wa);break;case 2:for(var r=W(this,5)+257,p=W(this,5)+1,l=W(this,4)+4,n=new (B?Uint8Array:Array)(Xa.length),s=t,u=t,w=t,C=t,x=t,D=t,M=t,z=t,N=t,z=0;z=$?8:255>=$?9:279>=$?7:8;var Va=T(hb),jb=new (B?Uint8Array:Array)(30),kb,lb;kb=0;for(lb=jb.length;kb=g&&q(Error(\"input buffer is broken\")),c|=e[f++]<>>a;b.e=d-a;b.c=f;return k}\nfunction Ya(b,a){for(var c=b.j,d=b.e,e=b.input,f=b.c,g=e.length,k=a[0],h=a[1],m,r;d=g);)c|=e[f++]<>>16;r>d&&q(Error(\"invalid code length: \"+r));b.j=c>>r;b.e=d-r;b.c=f;return m&65535}\nV.prototype.r=function(b,a){var c=this.a,d=this.b;this.A=b;for(var e=c.length-258,f,g,k,h;256!==(f=Ya(this,b));)if(256>f)d>=e&&(this.b=d,c=this.f(),d=this.b),c[d++]=f;else{g=f-257;h=ab[g];0=e&&(this.b=d,c=this.f(),d=this.b);for(;h--;)c[d]=c[d++-k]}for(;8<=this.e;)this.e-=8,this.c--;this.b=d};\nV.prototype.Q=function(b,a){var c=this.a,d=this.b;this.A=b;for(var e=c.length,f,g,k,h;256!==(f=Ya(this,b));)if(256>f)d>=e&&(c=this.f(),e=c.length),c[d++]=f;else{g=f-257;h=ab[g];0e&&(c=this.f(),e=c.length);for(;h--;)c[d]=c[d++-k]}for(;8<=this.e;)this.e-=8,this.c--;this.b=d};\nV.prototype.f=function(){var b=new (B?Uint8Array:Array)(this.b-32768),a=this.b-32768,c,d,e=this.a;if(B)b.set(e.subarray(32768,b.length));else{c=0;for(d=b.length;cc;++c)e[c]=e[a+c];this.b=32768;return e};\nV.prototype.S=function(b){var a,c=this.input.length/this.c+1|0,d,e,f,g=this.input,k=this.a;b&&(\"number\"===typeof b.B&&(c=b.B),\"number\"===typeof b.M&&(c+=b.M));2>c?(d=(g.length-this.c)/this.A[2],f=258*(d/2)|0,e=fa&&(this.a.length=a),b=this.a);return this.buffer=b};function mb(b){this.input=b;this.c=0;this.G=[];this.R=!1}\nmb.prototype.i=function(){for(var b=this.input.length;this.c>>0;ha(e,t,t)!==r&&q(Error(\"invalid CRC-32 checksum: 0x\"+ha(e,t,t).toString(16)+\" / 0x\"+\nr.toString(16)));a.Z=c=(p[l++]|p[l++]<<8|p[l++]<<16|p[l++]<<24)>>>0;(e.length&4294967295)!==c&&q(Error(\"invalid input size: \"+(e.length&4294967295)+\" / \"+c));this.G.push(a);this.c=l}this.R=v;var n=this.G,s,u,w=0,C=0,x;s=0;for(u=n.length;s>>0;b=a}for(var e=1,f=0,g=b.length,k,h=0;0>>0};function ob(b,a){var c,d;this.input=b;this.c=0;if(a||!(a={}))a.index&&(this.c=a.index),a.verify&&(this.V=a.verify);c=b[this.c++];d=b[this.c++];switch(c&15){case pb:this.method=pb;break;default:q(Error(\"unsupported compression method\"))}0!==((c<<8)+d)%31&&q(Error(\"invalid fcheck flag:\"+((c<<8)+d)%31));d&32&&q(Error(\"fdict flag is not supported\"));this.J=new V(b,{index:this.c,bufferSize:a.bufferSize,bufferType:a.bufferType,resize:a.resize})}\nob.prototype.i=function(){var b=this.input,a,c;a=this.J.i();this.c=this.J.c;this.V&&(c=(b[this.c++]<<24|b[this.c++]<<16|b[this.c++]<<8|b[this.c++])>>>0,c!==nb(a)&&q(Error(\"invalid adler-32 checksum\")));return a};var pb=8;function rb(b,a){this.input=b;this.a=new (B?Uint8Array:Array)(32768);this.k=sb.t;var c={},d;if((a||!(a={}))&&\"number\"===typeof a.compressionType)this.k=a.compressionType;for(d in a)c[d]=a[d];c.outputBuffer=this.a;this.I=new na(this.input,c)}var sb=pa;\nrb.prototype.h=function(){var b,a,c,d,e,f,g,k=0;g=this.a;b=pb;switch(b){case pb:a=Math.LOG2E*Math.log(32768)-8;break;default:q(Error(\"invalid compression method\"))}c=a<<4|b;g[k++]=c;switch(b){case pb:switch(this.k){case sb.NONE:e=0;break;case sb.L:e=1;break;case sb.t:e=2;break;default:q(Error(\"unsupported compression type\"))}break;default:q(Error(\"invalid compression method\"))}d=e<<6|0;g[k++]=d|31-(256*c+d)%31;f=nb(this.input);this.I.b=k;g=this.I.h();k=g.length;B&&(g=new Uint8Array(g.buffer),g.length<=\nk+4&&(this.a=new Uint8Array(g.length+4),this.a.set(g),g=this.a),g=g.subarray(0,k+4));g[k++]=f>>24&255;g[k++]=f>>16&255;g[k++]=f>>8&255;g[k++]=f&255;return g};exports.deflate=tb;exports.deflateSync=ub;exports.inflate=vb;exports.inflateSync=wb;exports.gzip=xb;exports.gzipSync=yb;exports.gunzip=zb;exports.gunzipSync=Ab;function tb(b,a,c){process.nextTick(function(){var d,e;try{e=ub(b,c)}catch(f){d=f}a(d,e)})}function ub(b,a){var c;c=(new rb(b)).h();a||(a={});return a.H?c:Bb(c)}function vb(b,a,c){process.nextTick(function(){var d,e;try{e=wb(b,c)}catch(f){d=f}a(d,e)})}\nfunction wb(b,a){var c;b.subarray=b.slice;c=(new ob(b)).i();a||(a={});return a.noBuffer?c:Bb(c)}function xb(b,a,c){process.nextTick(function(){var d,e;try{e=yb(b,c)}catch(f){d=f}a(d,e)})}function yb(b,a){var c;b.subarray=b.slice;c=(new Ba(b)).h();a||(a={});return a.H?c:Bb(c)}function zb(b,a,c){process.nextTick(function(){var d,e;try{e=Ab(b,c)}catch(f){d=f}a(d,e)})}function Ab(b,a){var c;b.subarray=b.slice;c=(new mb(b)).i();a||(a={});return a.H?c:Bb(c)}\nfunction Bb(b){var a=new Buffer(b.length),c,d;c=0;for(d=b.length;c 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\nvar isArray = require('isarray')\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return ''\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction placeHoldersCount (b64) {\n var len = b64.length\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // the number of equal signs (place holders)\n // if there are two placeholders, than the two characters before it\n // represent one byte\n // if there is only one, then the three characters before it represent 2 bytes\n // this is just a cheap hack to not do indexOf twice\n return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0\n}\n\nfunction byteLength (b64) {\n // base64 is 4/3 + up to two characters of the original data\n return (b64.length * 3 / 4) - placeHoldersCount(b64)\n}\n\nfunction toByteArray (b64) {\n var i, l, tmp, placeHolders, arr\n var len = b64.length\n placeHolders = placeHoldersCount(b64)\n\n arr = new Arr((len * 3 / 4) - placeHolders)\n\n // if there are placeholders, only get up to the last complete 4 chars\n l = placeHolders > 0 ? len - 4 : len\n\n var L = 0\n\n for (i = 0; i < l; i += 4) {\n tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]\n arr[L++] = (tmp >> 16) & 0xFF\n arr[L++] = (tmp >> 8) & 0xFF\n arr[L++] = tmp & 0xFF\n }\n\n if (placeHolders === 2) {\n tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[L++] = tmp & 0xFF\n } else if (placeHolders === 1) {\n tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[L++] = (tmp >> 8) & 0xFF\n arr[L++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var output = ''\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n output += lookup[tmp >> 2]\n output += lookup[(tmp << 4) & 0x3F]\n output += '=='\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + (uint8[len - 1])\n output += lookup[tmp >> 10]\n output += lookup[(tmp >> 4) & 0x3F]\n output += lookup[(tmp << 2) & 0x3F]\n output += '='\n }\n\n parts.push(output)\n\n return parts.join('')\n}\n","exports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = nBytes * 8 - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = nBytes * 8 - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n","const { set, get } = require('idb-keyval');\n\nmodule.exports = {\n readCache: get,\n writeCache: set,\n};\n","class Store {\r\n constructor(dbName = 'keyval-store', storeName = 'keyval') {\r\n this.storeName = storeName;\r\n this._dbp = new Promise((resolve, reject) => {\r\n const openreq = indexedDB.open(dbName, 1);\r\n openreq.onerror = () => reject(openreq.error);\r\n openreq.onsuccess = () => resolve(openreq.result);\r\n // First time setup: create an empty object store\r\n openreq.onupgradeneeded = () => {\r\n openreq.result.createObjectStore(storeName);\r\n };\r\n });\r\n }\r\n _withIDBStore(type, callback) {\r\n return this._dbp.then(db => new Promise((resolve, reject) => {\r\n const transaction = db.transaction(this.storeName, type);\r\n transaction.oncomplete = () => resolve();\r\n transaction.onabort = transaction.onerror = () => reject(transaction.error);\r\n callback(transaction.objectStore(this.storeName));\r\n }));\r\n }\r\n}\r\nlet store;\r\nfunction getDefaultStore() {\r\n if (!store)\r\n store = new Store();\r\n return store;\r\n}\r\nfunction get(key, store = getDefaultStore()) {\r\n let req;\r\n return store._withIDBStore('readonly', store => {\r\n req = store.get(key);\r\n }).then(() => req.result);\r\n}\r\nfunction set(key, value, store = getDefaultStore()) {\r\n return store._withIDBStore('readwrite', store => {\r\n store.put(value, key);\r\n });\r\n}\r\nfunction del(key, store = getDefaultStore()) {\r\n return store._withIDBStore('readwrite', store => {\r\n store.delete(key);\r\n });\r\n}\r\nfunction clear(store = getDefaultStore()) {\r\n return store._withIDBStore('readwrite', store => {\r\n store.clear();\r\n });\r\n}\r\nfunction keys(store = getDefaultStore()) {\r\n const keys = [];\r\n return store._withIDBStore('readonly', store => {\r\n // This would be store.getAllKeys(), but it isn't supported by Edge or Safari.\r\n // And openKeyCursor isn't supported by Safari.\r\n (store.openKeyCursor || store.openCursor).call(store).onsuccess = function () {\r\n if (!this.result)\r\n return;\r\n keys.push(this.result.key);\r\n this.result.continue();\r\n };\r\n }).then(() => keys);\r\n}\n\nexport { Store, get, set, del, clear, keys };\n","module.exports = (TessModule, buf) => {\n const ptr = TessModule._malloc(buf.length * Uint8Array.BYTES_PER_ELEMENT);\n TessModule.HEAPU8.set(buf, ptr);\n const pix = TessModule._pixReadMem(ptr, buf.length);\n if (TessModule.getValue(pix + (7 * 4), 'i32') === 0) {\n /*\n * Set a yres default value to prevent warning from tesseract\n * See kMinCredibleResolution in tesseract/src/ccstruct/publictypes.h\n */\n TessModule.setValue(pix + (7 * 4), 70, 'i32');\n }\n const [w, h, d, spp, wpl, refcount, xres, yres, informat, special] = Array(10).fill(0)\n .map((v, idx) => (\n TessModule.getValue(pix + (idx * 4), 'i32')\n ));\n return {\n w,\n h,\n d,\n spp,\n wpl,\n refcount,\n xres,\n yres,\n informat,\n special,\n data: pix,\n };\n};\n","// the generated HOCR is excessively indented, so\n// we get rid of that indentation\n\nconst deindent = (html) => {\n const lines = html.split('\\n');\n if (lines[0].substring(0, 2) === ' ') {\n for (let i = 0; i < lines.length; i += 1) {\n if (lines[i].substring(0, 2) === ' ') {\n lines[i] = lines[i].slice(2);\n }\n }\n }\n return lines.join('\\n');\n};\n\nmodule.exports = (Module, base) => {\n const ri = base.GetIterator();\n const blocks = [];\n let block;\n let para;\n let textline;\n let word;\n let symbol;\n\n const enumToString = (value, prefix) => (\n Object.keys(Module)\n .filter(e => (e.substr(0, prefix.length + 1) === `${prefix}_`))\n .filter(e => Module[e] === value)\n .map(e => e.slice(prefix.length + 1))[0]\n );\n\n ri.Begin();\n do {\n if (ri.IsAtBeginningOf(Module.RIL_BLOCK)) {\n const poly = ri.BlockPolygon();\n let polygon = null;\n // BlockPolygon() returns null when automatic page segmentation is off\n if (Module.getPointer(poly) > 0) {\n const n = poly.get_n();\n const px = poly.get_x();\n const py = poly.get_y();\n polygon = [];\n for (let i = 0; i < n; i += 1) {\n polygon.push([px.getValue(i), py.getValue(i)]);\n }\n Module._ptaDestroy(Module.getPointer(poly));\n }\n\n block = {\n paragraphs: [],\n text: ri.GetUTF8Text(Module.RIL_BLOCK),\n confidence: ri.Confidence(Module.RIL_BLOCK),\n baseline: ri.getBaseline(Module.RIL_BLOCK),\n bbox: ri.getBoundingBox(Module.RIL_BLOCK),\n blocktype: enumToString(ri.BlockType(), 'PT'),\n polygon,\n };\n blocks.push(block);\n }\n if (ri.IsAtBeginningOf(Module.RIL_PARA)) {\n para = {\n lines: [],\n text: ri.GetUTF8Text(Module.RIL_PARA),\n confidence: ri.Confidence(Module.RIL_PARA),\n baseline: ri.getBaseline(Module.RIL_PARA),\n bbox: ri.getBoundingBox(Module.RIL_PARA),\n is_ltr: !!ri.ParagraphIsLtr(),\n };\n block.paragraphs.push(para);\n }\n if (ri.IsAtBeginningOf(Module.RIL_TEXTLINE)) {\n textline = {\n words: [],\n text: ri.GetUTF8Text(Module.RIL_TEXTLINE),\n confidence: ri.Confidence(Module.RIL_TEXTLINE),\n baseline: ri.getBaseline(Module.RIL_TEXTLINE),\n bbox: ri.getBoundingBox(Module.RIL_TEXTLINE),\n };\n para.lines.push(textline);\n }\n if (ri.IsAtBeginningOf(Module.RIL_WORD)) {\n const fontInfo = ri.getWordFontAttributes();\n const wordDir = ri.WordDirection();\n word = {\n symbols: [],\n choices: [],\n\n text: ri.GetUTF8Text(Module.RIL_WORD),\n confidence: ri.Confidence(Module.RIL_WORD),\n baseline: ri.getBaseline(Module.RIL_WORD),\n bbox: ri.getBoundingBox(Module.RIL_WORD),\n\n is_numeric: !!ri.WordIsNumeric(),\n in_dictionary: !!ri.WordIsFromDictionary(),\n direction: enumToString(wordDir, 'DIR'),\n language: ri.WordRecognitionLanguage(),\n\n is_bold: fontInfo.is_bold,\n is_italic: fontInfo.is_italic,\n is_underlined: fontInfo.is_underlined,\n is_monospace: fontInfo.is_monospace,\n is_serif: fontInfo.is_serif,\n is_smallcaps: fontInfo.is_smallcaps,\n font_size: fontInfo.pointsize,\n font_id: fontInfo.font_id,\n font_name: fontInfo.font_name,\n };\n const wc = new Module.WordChoiceIterator(ri);\n do {\n word.choices.push({\n text: wc.GetUTF8Text(),\n confidence: wc.Confidence(),\n });\n } while (wc.Next());\n Module.destroy(wc);\n textline.words.push(word);\n }\n\n // let image = null;\n // var pix = ri.GetBinaryImage(Module.RIL_SYMBOL)\n // var image = pix2array(pix);\n // // for some reason it seems that things stop working if you destroy pics\n // Module._pixDestroy(Module.getPointer(pix));\n if (ri.IsAtBeginningOf(Module.RIL_SYMBOL)) {\n symbol = {\n choices: [],\n image: null,\n text: ri.GetUTF8Text(Module.RIL_SYMBOL),\n confidence: ri.Confidence(Module.RIL_SYMBOL),\n baseline: ri.getBaseline(Module.RIL_SYMBOL),\n bbox: ri.getBoundingBox(Module.RIL_SYMBOL),\n is_superscript: !!ri.SymbolIsSuperscript(),\n is_subscript: !!ri.SymbolIsSubscript(),\n is_dropcap: !!ri.SymbolIsDropcap(),\n };\n word.symbols.push(symbol);\n const ci = new Module.ChoiceIterator(ri);\n do {\n symbol.choices.push({\n text: ci.GetUTF8Text(),\n confidence: ci.Confidence(),\n });\n } while (ci.Next());\n // Module.destroy(i);\n }\n } while (ri.Next(Module.RIL_SYMBOL));\n Module.destroy(ri);\n\n return {\n text: base.GetUTF8Text(),\n html: deindent(base.GetHOCRText()),\n confidence: base.MeanTextConf(),\n blocks,\n psm: enumToString(base.GetPageSegMode(), 'PSM'),\n oem: enumToString(base.oem(), 'OEM'),\n version: base.Version(),\n };\n};\n"],"sourceRoot":""} \ No newline at end of file diff --git a/scripts/server.js b/scripts/server.js index ddbf44f..eee81a6 100644 --- a/scripts/server.js +++ b/scripts/server.js @@ -7,9 +7,9 @@ const webpackConfig = require('./webpack.config.dev'); const compiler = webpack(webpackConfig); const app = express(); -express.static.mime.types.wasm = 'application/wasm'; - app.use('/', express.static(path.resolve(__dirname, '..'))); app.use(middleware(compiler, { publicPath: '/dist' })); -app.listen(3000, () => console.log('Server is running on port 3000')); +module.exports = app.listen(3000, () => { + console.log('Server is running on port 3000'); +}); diff --git a/scripts/test-helper.js b/scripts/test-helper.js new file mode 100644 index 0000000..bbfc19b --- /dev/null +++ b/scripts/test-helper.js @@ -0,0 +1,17 @@ +const express = require('express'); +const path = require('path'); +global.expect = require('expect.js'); +global.fetch = require('node-fetch'); +global.Tesseract = require('../src'); + +const app = express(); +let devServer = null; + +global.startServer = (done) => { + app.use('/', express.static(path.resolve(__dirname, '..'))); + devServer = app.listen(3000, done); +}; + +global.stopServer = (done) => { + devServer.close(done); +}; diff --git a/scripts/webpack.config.prod.js b/scripts/webpack.config.prod.js index 90e4166..fa161d6 100644 --- a/scripts/webpack.config.prod.js +++ b/scripts/webpack.config.prod.js @@ -7,7 +7,7 @@ const genConfig = ({ devtool: 'source-map', entry, output: { - path: path.resolve(__dirname, 'dist'), + path: path.resolve(__dirname, '..', 'dist'), filename, library, libraryTarget, diff --git a/src/common/worker.js b/src/common/worker.js index 03679b9..441c486 100644 --- a/src/common/worker.js +++ b/src/common/worker.js @@ -48,14 +48,21 @@ const handleInit = (req, res) => { return Promise.resolve(); }; -const loadLanguage = (req) => { - const { options: { lang }, workerOptions: { langPath } } = req; - return loadLang({ +const loadLanguage = ({ + options: { lang }, + workerOptions: { + langPath, cachePath, cacheMethod, dataPath, + }, +}) => ( + loadLang({ langs: lang, tessModule: Module, langURI: langPath, - }); -}; + cachePath, + cacheMethod, + dataPath, + }) +); const handleRecognize = (req, res) => ( handleInit(req, res) diff --git a/src/node/index.js b/src/node/index.js index 30957b3..a97f4c9 100644 --- a/src/node/index.js +++ b/src/node/index.js @@ -11,7 +11,7 @@ const readFile = util.promisify(fs.readFile); const loadImage = (imageURI) => { if (isURL(imageURI)) { return fetch(imageURI) - .then(resp => resp.buffer()); + .then(resp => resp.arrayBuffer()); } return readFile(imageURI); }; diff --git a/tests/.eslintrc b/tests/.eslintrc new file mode 100644 index 0000000..d117642 --- /dev/null +++ b/tests/.eslintrc @@ -0,0 +1,5 @@ +{ + "rules": { + "no-undef": 0 + } +} diff --git a/tests/assets/images/cosmic.png b/tests/assets/images/cosmic.png new file mode 100644 index 0000000..b78d9da Binary files /dev/null and b/tests/assets/images/cosmic.png differ diff --git a/tests/assets/images/simple.bmp b/tests/assets/images/simple.bmp new file mode 100644 index 0000000..7af3bec Binary files /dev/null and b/tests/assets/images/simple.bmp differ diff --git a/tests/assets/images/simple.jpg b/tests/assets/images/simple.jpg new file mode 100644 index 0000000..98b1b8c Binary files /dev/null and b/tests/assets/images/simple.jpg differ diff --git a/tests/assets/images/simple.pbm b/tests/assets/images/simple.pbm new file mode 100644 index 0000000..83c7b93 Binary files /dev/null and b/tests/assets/images/simple.pbm differ diff --git a/tests/assets/images/simple.png b/tests/assets/images/simple.png new file mode 100644 index 0000000..68c0a42 Binary files /dev/null and b/tests/assets/images/simple.png differ diff --git a/tests/assets/images/testocr.jpg b/tests/assets/images/testocr.jpg new file mode 100644 index 0000000..953bb73 Binary files /dev/null and b/tests/assets/images/testocr.jpg differ diff --git a/tests/assets/images/testocr.pbm b/tests/assets/images/testocr.pbm new file mode 100644 index 0000000..b70cc9e Binary files /dev/null and b/tests/assets/images/testocr.pbm differ diff --git a/tests/assets/images/testocr.png b/tests/assets/images/testocr.png new file mode 100644 index 0000000..ce8d0e7 Binary files /dev/null and b/tests/assets/images/testocr.png differ diff --git a/tests/assets/testocr.bmp b/tests/assets/testocr.bmp deleted file mode 100755 index b22531f..0000000 Binary files a/tests/assets/testocr.bmp and /dev/null differ diff --git a/tests/assets/traineddata/eng.traineddata b/tests/assets/traineddata/eng.traineddata new file mode 100644 index 0000000..f4744c2 Binary files /dev/null and b/tests/assets/traineddata/eng.traineddata differ diff --git a/tests/recognize.test.js b/tests/recognize.test.js new file mode 100644 index 0000000..22e8675 --- /dev/null +++ b/tests/recognize.test.js @@ -0,0 +1,100 @@ +const { TesseractWorker } = Tesseract; + +const IMAGE_PATH = 'http://localhost:3000/tests/assets/images'; +const cachePath = './tests/assets/traineddata'; +const cacheMethod = 'readOnly'; +const SIMPLE_TEXT = 'Tesseract.js\n'; +const COMSIC_TEXT = 'HellO World\nfrom beyond\nthe Cosmic Void\n'; +const TESTOCR_TEXT = 'This is a lot of 12 point text to test the\nocr code and see if it works on all types\nof file format.\n\nThe quick brown dog jumped over the\nlazy fox. The quick brown dog jumped\nover the lazy fox. The quick brown dog\njumped over the lazy fox. The quick\nbrown dog jumped over the lazy fox.\n'; + +before((done) => { + if (typeof startServer !== 'undefined') { + startServer(done); + } else { + done(); + } +}); + +after((done) => { + if (typeof stopServer !== 'undefined') { + stopServer(done); + } +}); + +describe('recognize()', () => { + describe('supports multiple formats', () => { + ['bmp', 'jpg', 'png', 'pbm'].forEach(format => ( + it(`support ${format} format`, (done) => { + const worker = new TesseractWorker({ cachePath, cacheMethod }); + worker + .recognize(`${IMAGE_PATH}/simple.${format}`) + .then((result) => { + expect(result.text).to.be(SIMPLE_TEXT); + worker.terminate(); + done(); + }); + }).timeout(10000) + )); + }); + + describe('1 worker multiple recognition', () => { + [3, 10, 20].forEach(num => ( + it(`recognize ${num} images with 1 worker`, (done) => { + const worker = new TesseractWorker({ cachePath, cacheMethod }); + Promise.all( + Array(num).fill(0).map(() => worker.recognize(`${IMAGE_PATH}/simple.png`)), + ).then((results) => { + results.forEach(({ text }) => { + expect(text).to.be(SIMPLE_TEXT); + }); + worker.terminate(); + done(); + }); + }).timeout(30000) + )); + }); + + describe('should recognize in order', () => { + [1, 2].forEach((num) => { + it(`recognize ${num * 2} images with 1 worker in order`, (done) => { + const worker = new TesseractWorker({ cachePath, cacheMethod }); + const cases = Array(num).fill(0) + .reduce(acc => ( + acc.concat([ + { name: 'simple.png', ans: SIMPLE_TEXT }, + { name: 'cosmic.png', ans: COMSIC_TEXT }, + ]) + ), + []); + Promise.all( + cases.map(({ name }) => worker.recognize(`${IMAGE_PATH}/${name}`)), + ).then((results) => { + results.forEach(({ text }, idx) => { + expect(text).to.be(cases[idx].ans); + }); + worker.terminate(); + done(); + }); + }).timeout(30000); + }); + }); + + describe('supports different complexity', () => { + [ + { name: 'simple.png', desc: 'simple', ans: SIMPLE_TEXT }, + { name: 'cosmic.png', desc: 'normal', ans: COMSIC_TEXT }, + { name: 'testocr.png', desc: 'complex', ans: TESTOCR_TEXT }, + ].forEach(({ name, desc, ans }) => ( + it(`recongize ${desc} image`, (done) => { + const worker = new TesseractWorker({ cachePath, cacheMethod }); + worker + .recognize(`${IMAGE_PATH}/${name}`) + .then(({ text }) => { + expect(text).to.be(ans); + worker.terminate(); + done(); + }); + }).timeout(10000) + )); + }); +});