favacli 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/BaseCommand.d.mts +16 -0
- package/build/BaseCommand.mjs +40 -0
- package/build/commands/entries/add.d.mts +15 -0
- package/build/commands/entries/add.mjs +31 -0
- package/build/commands/entries/list.d.mts +8 -0
- package/build/commands/entries/list.mjs +29 -0
- package/build/commands/entries/search.d.mts +10 -0
- package/build/commands/entries/search.mjs +31 -0
- package/build/commands/sync/connect.d.mts +9 -0
- package/build/commands/sync/connect.mjs +27 -0
- package/build/commands/sync/setServerUrl.d.mts +10 -0
- package/build/commands/sync/setServerUrl.mjs +15 -0
- package/build/commands/vault/create.d.mts +9 -0
- package/build/commands/vault/create.mjs +31 -0
- package/build/main.d.mts +2 -0
- package/build/main.mjs +21 -0
- package/build/utils/generateEntriesTable.d.mts +3 -0
- package/build/utils/generateEntriesTable.mjs +35 -0
- package/build/utils/init.d.mts +8 -0
- package/build/utils/init.mjs +30 -0
- package/build/utils/loadVault.d.mts +3 -0
- package/build/utils/loadVault.mjs +21 -0
- package/package.json +4 -5
- package/dist/007c5b826a6cdb53f76ac788701bcc44.node +0 -0
- package/dist/173.bundle.js +0 -1
- package/dist/1f6b895ee52944cdc760af87cc0776cf.node +0 -0
- package/dist/206.bundle.js +0 -1
- package/dist/260.bundle.js +0 -2
- package/dist/260.bundle.js.LICENSE.txt +0 -16
- package/dist/304.bundle.js +0 -1
- package/dist/411.bundle.js +0 -1
- package/dist/477.bundle.js +0 -1
- package/dist/479.bundle.js +0 -1
- package/dist/622.bundle.js +0 -2
- package/dist/622.bundle.js.LICENSE.txt +0 -41
- package/dist/770.bundle.js +0 -1
- package/dist/bundle.js +0 -2
- package/dist/bundle.js.LICENSE.txt +0 -15
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/*! *****************************************************************************
|
|
2
|
-
Copyright (c) Microsoft Corporation.
|
|
3
|
-
|
|
4
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
5
|
-
purpose with or without fee is hereby granted.
|
|
6
|
-
|
|
7
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
8
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
9
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
10
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
11
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
12
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
13
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
14
|
-
***************************************************************************** */
|
|
15
|
-
|
|
16
|
-
/*! OpenPGP.js v5.11.2 - 2024-06-19 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */
|
package/dist/304.bundle.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
exports.id=304,exports.ids=[304],exports.modules={3005:t=>{"use strict";var e={single_source_shortest_paths:function(t,n,r){var i={},o={};o[n]=0;var s,a,h,l,u,c,f,d=e.PriorityQueue.make();for(d.push(n,0);!d.empty();)for(h in a=(s=d.pop()).value,l=s.cost,u=t[a]||{})u.hasOwnProperty(h)&&(c=l+u[h],f=o[h],(void 0===o[h]||f>c)&&(o[h]=c,d.push(h,c),i[h]=a));if(void 0!==r&&void 0===o[r]){var p=["Could not find a path from ",n," to ",r,"."].join("");throw new Error(p)}return i},extract_shortest_path_from_predecessor_list:function(t,e){for(var n=[],r=e;r;)n.push(r),t[r],r=t[r];return n.reverse(),n},find_path:function(t,n,r){var i=e.single_source_shortest_paths(t,n,r);return e.extract_shortest_path_from_predecessor_list(i,r)},PriorityQueue:{make:function(t){var n,r=e.PriorityQueue,i={};for(n in t=t||{},r)r.hasOwnProperty(n)&&(i[n]=r[n]);return i.queue=[],i.sorter=t.sorter||r.default_sorter,i},default_sorter:function(t,e){return t.cost-e.cost},push:function(t,e){var n={value:t,cost:e};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};t.exports=e},104:(t,e,n)=>{"use strict";let r=n(2323),i=[function(){},function(t,e,n,r){if(r===e.length)throw new Error("Ran out of data");let i=e[r];t[n]=i,t[n+1]=i,t[n+2]=i,t[n+3]=255},function(t,e,n,r){if(r+1>=e.length)throw new Error("Ran out of data");let i=e[r];t[n]=i,t[n+1]=i,t[n+2]=i,t[n+3]=e[r+1]},function(t,e,n,r){if(r+2>=e.length)throw new Error("Ran out of data");t[n]=e[r],t[n+1]=e[r+1],t[n+2]=e[r+2],t[n+3]=255},function(t,e,n,r){if(r+3>=e.length)throw new Error("Ran out of data");t[n]=e[r],t[n+1]=e[r+1],t[n+2]=e[r+2],t[n+3]=e[r+3]}],o=[function(){},function(t,e,n,r){let i=e[0];t[n]=i,t[n+1]=i,t[n+2]=i,t[n+3]=r},function(t,e,n){let r=e[0];t[n]=r,t[n+1]=r,t[n+2]=r,t[n+3]=e[1]},function(t,e,n,r){t[n]=e[0],t[n+1]=e[1],t[n+2]=e[2],t[n+3]=r},function(t,e,n){t[n]=e[0],t[n+1]=e[1],t[n+2]=e[2],t[n+3]=e[3]}];function s(t,e,n,r,o,s){let a=t.width,h=t.height,l=t.index;for(let t=0;t<h;t++)for(let h=0;h<a;h++){let a=n(h,t,l);i[r](e,o,a,s),s+=r}return s}function a(t,e,n,r,i,s){let a=t.width,h=t.height,l=t.index;for(let t=0;t<h;t++){for(let h=0;h<a;h++){let a=i.get(r),u=n(h,t,l);o[r](e,a,u,s)}i.resetAfterLine()}}e.dataToBitMap=function(t,e){let n,i,o=e.width,h=e.height,l=e.depth,u=e.bpp,c=e.interlace;8!==l&&(n=function(t,e){let n=[],r=0;function i(){if(r===t.length)throw new Error("Ran out of data");let i,o,s,a,h,l,u,c,f=t[r];switch(r++,e){default:throw new Error("unrecognised depth");case 16:u=t[r],r++,n.push((f<<8)+u);break;case 4:u=15&f,c=f>>4,n.push(c,u);break;case 2:h=3&f,l=f>>2&3,u=f>>4&3,c=f>>6&3,n.push(c,u,l,h);break;case 1:i=1&f,o=f>>1&1,s=f>>2&1,a=f>>3&1,h=f>>4&1,l=f>>5&1,u=f>>6&1,c=f>>7&1,n.push(c,u,l,h,a,s,o,i)}}return{get:function(t){for(;n.length<t;)i();let e=n.slice(0,t);return n=n.slice(t),e},resetAfterLine:function(){n.length=0},end:function(){if(r!==t.length)throw new Error("extra data found")}}}(t,l)),i=l<=8?Buffer.alloc(o*h*4):new Uint16Array(o*h*4);let f,d,p=Math.pow(2,l)-1,g=0;if(c)f=r.getImagePasses(o,h),d=r.getInterlaceIterator(o,h);else{let t=0;d=function(){let e=t;return t+=4,e},f=[{width:o,height:h}]}for(let e=0;e<f.length;e++)8===l?g=s(f[e],i,d,u,t,g):a(f[e],i,d,u,n,p);if(8===l){if(g!==t.length)throw new Error("extra data found")}else n.end();return i}},495:(t,e,n)=>{"use strict";let r=n(8351);t.exports=function(t,e,n,i){let o=-1!==[r.COLORTYPE_COLOR_ALPHA,r.COLORTYPE_ALPHA].indexOf(i.colorType);if(i.colorType===i.inputColorType){let e=function(){let t=new ArrayBuffer(2);return new DataView(t).setInt16(0,256,!0),256!==new Int16Array(t)[0]}();if(8===i.bitDepth||16===i.bitDepth&&e)return t}let s=16!==i.bitDepth?t:new Uint16Array(t.buffer),a=255,h=r.COLORTYPE_TO_BPP_MAP[i.inputColorType];4!==h||i.inputHasAlpha||(h=3);let l=r.COLORTYPE_TO_BPP_MAP[i.colorType];16===i.bitDepth&&(a=65535,l*=2);let u=Buffer.alloc(e*n*l),c=0,f=0,d=i.bgColor||{};function p(){let t,e,n,h=a;switch(i.inputColorType){case r.COLORTYPE_COLOR_ALPHA:h=s[c+3],t=s[c],e=s[c+1],n=s[c+2];break;case r.COLORTYPE_COLOR:t=s[c],e=s[c+1],n=s[c+2];break;case r.COLORTYPE_ALPHA:h=s[c+1],t=s[c],e=t,n=t;break;case r.COLORTYPE_GRAYSCALE:t=s[c],e=t,n=t;break;default:throw new Error("input color type:"+i.inputColorType+" is not supported at present")}return i.inputHasAlpha&&(o||(h/=a,t=Math.min(Math.max(Math.round((1-h)*d.red+h*t),0),a),e=Math.min(Math.max(Math.round((1-h)*d.green+h*e),0),a),n=Math.min(Math.max(Math.round((1-h)*d.blue+h*n),0),a))),{red:t,green:e,blue:n,alpha:h}}void 0===d.red&&(d.red=a),void 0===d.green&&(d.green=a),void 0===d.blue&&(d.blue=a);for(let t=0;t<n;t++)for(let t=0;t<e;t++){let t=p();switch(i.colorType){case r.COLORTYPE_COLOR_ALPHA:case r.COLORTYPE_COLOR:8===i.bitDepth?(u[f]=t.red,u[f+1]=t.green,u[f+2]=t.blue,o&&(u[f+3]=t.alpha)):(u.writeUInt16BE(t.red,f),u.writeUInt16BE(t.green,f+2),u.writeUInt16BE(t.blue,f+4),o&&u.writeUInt16BE(t.alpha,f+6));break;case r.COLORTYPE_ALPHA:case r.COLORTYPE_GRAYSCALE:{let e=(t.red+t.green+t.blue)/3;8===i.bitDepth?(u[f]=e,o&&(u[f+1]=t.alpha)):(u.writeUInt16BE(e,f),o&&u.writeUInt16BE(t.alpha,f+2));break}default:throw new Error("unrecognised color Type "+i.colorType)}c+=h,f+=l}return u}},4267:(t,e,n)=>{"use strict";let r=n(9023),i=n(2203),o=t.exports=function(){i.call(this),this._buffers=[],this._buffered=0,this._reads=[],this._paused=!1,this._encoding="utf8",this.writable=!0};r.inherits(o,i),o.prototype.read=function(t,e){this._reads.push({length:Math.abs(t),allowLess:t<0,func:e}),process.nextTick(function(){this._process(),this._paused&&this._reads&&this._reads.length>0&&(this._paused=!1,this.emit("drain"))}.bind(this))},o.prototype.write=function(t,e){if(!this.writable)return this.emit("error",new Error("Stream not writable")),!1;let n;return n=Buffer.isBuffer(t)?t:Buffer.from(t,e||this._encoding),this._buffers.push(n),this._buffered+=n.length,this._process(),this._reads&&0===this._reads.length&&(this._paused=!0),this.writable&&!this._paused},o.prototype.end=function(t,e){t&&this.write(t,e),this.writable=!1,this._buffers&&(0===this._buffers.length?this._end():(this._buffers.push(null),this._process()))},o.prototype.destroySoon=o.prototype.end,o.prototype._end=function(){this._reads.length>0&&this.emit("error",new Error("Unexpected end of input")),this.destroy()},o.prototype.destroy=function(){this._buffers&&(this.writable=!1,this._reads=null,this._buffers=null,this.emit("close"))},o.prototype._processReadAllowingLess=function(t){this._reads.shift();let e=this._buffers[0];e.length>t.length?(this._buffered-=t.length,this._buffers[0]=e.slice(t.length),t.func.call(this,e.slice(0,t.length))):(this._buffered-=e.length,this._buffers.shift(),t.func.call(this,e))},o.prototype._processRead=function(t){this._reads.shift();let e=0,n=0,r=Buffer.alloc(t.length);for(;e<t.length;){let i=this._buffers[n++],o=Math.min(i.length,t.length-e);i.copy(r,e,0,o),e+=o,o!==i.length&&(this._buffers[--n]=i.slice(o))}n>0&&this._buffers.splice(0,n),this._buffered-=t.length,t.func.call(this,r)},o.prototype._process=function(){try{for(;this._buffered>0&&this._reads&&this._reads.length>0;){let t=this._reads[0];if(t.allowLess)this._processReadAllowingLess(t);else{if(!(this._buffered>=t.length))break;this._processRead(t)}}this._buffers&&!this.writable&&this._end()}catch(t){this.emit("error",t)}}},8351:t=>{"use strict";t.exports={PNG_SIGNATURE:[137,80,78,71,13,10,26,10],TYPE_IHDR:1229472850,TYPE_IEND:1229278788,TYPE_IDAT:1229209940,TYPE_PLTE:1347179589,TYPE_tRNS:1951551059,TYPE_gAMA:1732332865,COLORTYPE_GRAYSCALE:0,COLORTYPE_PALETTE:1,COLORTYPE_COLOR:2,COLORTYPE_ALPHA:4,COLORTYPE_PALETTE_COLOR:3,COLORTYPE_COLOR_ALPHA:6,COLORTYPE_TO_BPP_MAP:{0:1,2:3,3:1,4:2,6:4},GAMMA_DIVISION:1e5}},8456:t=>{"use strict";let e=[];!function(){for(let t=0;t<256;t++){let n=t;for(let t=0;t<8;t++)1&n?n=3988292384^n>>>1:n>>>=1;e[t]=n}}();let n=t.exports=function(){this._crc=-1};n.prototype.write=function(t){for(let n=0;n<t.length;n++)this._crc=e[255&(this._crc^t[n])]^this._crc>>>8;return!0},n.prototype.crc32=function(){return~this._crc},n.crc32=function(t){let n=-1;for(let r=0;r<t.length;r++)n=e[255&(n^t[r])]^n>>>8;return~n}},8502:(t,e,n)=>{"use strict";let r=n(7665),i={0:function(t,e,n,r,i){for(let o=0;o<n;o++)r[i+o]=t[e+o]},1:function(t,e,n,r,i,o){for(let s=0;s<n;s++){let n=s>=o?t[e+s-o]:0,a=t[e+s]-n;r[i+s]=a}},2:function(t,e,n,r,i){for(let o=0;o<n;o++){let s=e>0?t[e+o-n]:0,a=t[e+o]-s;r[i+o]=a}},3:function(t,e,n,r,i,o){for(let s=0;s<n;s++){let a=s>=o?t[e+s-o]:0,h=e>0?t[e+s-n]:0,l=t[e+s]-(a+h>>1);r[i+s]=l}},4:function(t,e,n,i,o,s){for(let a=0;a<n;a++){let h=a>=s?t[e+a-s]:0,l=e>0?t[e+a-n]:0,u=e>0&&a>=s?t[e+a-(n+s)]:0,c=t[e+a]-r(h,l,u);i[o+a]=c}}},o={0:function(t,e,n){let r=0,i=e+n;for(let n=e;n<i;n++)r+=Math.abs(t[n]);return r},1:function(t,e,n,r){let i=0;for(let o=0;o<n;o++){let n=o>=r?t[e+o-r]:0,s=t[e+o]-n;i+=Math.abs(s)}return i},2:function(t,e,n){let r=0,i=e+n;for(let o=e;o<i;o++){let i=e>0?t[o-n]:0,s=t[o]-i;r+=Math.abs(s)}return r},3:function(t,e,n,r){let i=0;for(let o=0;o<n;o++){let s=o>=r?t[e+o-r]:0,a=e>0?t[e+o-n]:0,h=t[e+o]-(s+a>>1);i+=Math.abs(h)}return i},4:function(t,e,n,i){let o=0;for(let s=0;s<n;s++){let a=s>=i?t[e+s-i]:0,h=e>0?t[e+s-n]:0,l=e>0&&s>=i?t[e+s-(n+i)]:0,u=t[e+s]-r(a,h,l);o+=Math.abs(u)}return o}};t.exports=function(t,e,n,r,s){let a;if("filterType"in r&&-1!==r.filterType){if("number"!=typeof r.filterType)throw new Error("unrecognised filter types");a=[r.filterType]}else a=[0,1,2,3,4];16===r.bitDepth&&(s*=2);let h=e*s,l=0,u=0,c=Buffer.alloc((h+1)*n),f=a[0];for(let e=0;e<n;e++){if(a.length>1){let e=1/0;for(let n=0;n<a.length;n++){let r=o[a[n]](t,u,h,s);r<e&&(f=a[n],e=r)}}c[l]=f,l++,i[f](t,u,h,c,l,s),l+=h,u+=h}return c}},5769:(t,e,n)=>{"use strict";let r=n(9023),i=n(4267),o=n(1496),s=t.exports=function(t){i.call(this);let e=[],n=this;this._filter=new o(t,{read:this.read.bind(this),write:function(t){e.push(t)},complete:function(){n.emit("complete",Buffer.concat(e))}}),this._filter.start()};r.inherits(s,i)},3122:(t,e,n)=>{"use strict";let r=n(9741),i=n(1496);e.process=function(t,e){let n=[],o=new r(t);return new i(e,{read:o.read.bind(o),write:function(t){n.push(t)},complete:function(){}}).start(),o.process(),Buffer.concat(n)}},1496:(t,e,n)=>{"use strict";let r=n(2323),i=n(7665);function o(t,e,n){let r=t*e;return 8!==n&&(r=Math.ceil(r/(8/n))),r}let s=t.exports=function(t,e){let n=t.width,i=t.height,s=t.interlace,a=t.bpp,h=t.depth;if(this.read=e.read,this.write=e.write,this.complete=e.complete,this._imageIndex=0,this._images=[],s){let t=r.getImagePasses(n,i);for(let e=0;e<t.length;e++)this._images.push({byteWidth:o(t[e].width,a,h),height:t[e].height,lineIndex:0})}else this._images.push({byteWidth:o(n,a,h),height:i,lineIndex:0});this._xComparison=8===h?a:16===h?2*a:1};s.prototype.start=function(){this.read(this._images[this._imageIndex].byteWidth+1,this._reverseFilterLine.bind(this))},s.prototype._unFilterType1=function(t,e,n){let r=this._xComparison,i=r-1;for(let o=0;o<n;o++){let n=t[1+o],s=o>i?e[o-r]:0;e[o]=n+s}},s.prototype._unFilterType2=function(t,e,n){let r=this._lastLine;for(let i=0;i<n;i++){let n=t[1+i],o=r?r[i]:0;e[i]=n+o}},s.prototype._unFilterType3=function(t,e,n){let r=this._xComparison,i=r-1,o=this._lastLine;for(let s=0;s<n;s++){let n=t[1+s],a=o?o[s]:0,h=s>i?e[s-r]:0,l=Math.floor((h+a)/2);e[s]=n+l}},s.prototype._unFilterType4=function(t,e,n){let r=this._xComparison,o=r-1,s=this._lastLine;for(let a=0;a<n;a++){let n=t[1+a],h=s?s[a]:0,l=a>o?e[a-r]:0,u=a>o&&s?s[a-r]:0,c=i(l,h,u);e[a]=n+c}},s.prototype._reverseFilterLine=function(t){let e,n=t[0],r=this._images[this._imageIndex],i=r.byteWidth;if(0===n)e=t.slice(1,i+1);else switch(e=Buffer.alloc(i),n){case 1:this._unFilterType1(t,e,i);break;case 2:this._unFilterType2(t,e,i);break;case 3:this._unFilterType3(t,e,i);break;case 4:this._unFilterType4(t,e,i);break;default:throw new Error("Unrecognised filter type - "+n)}this.write(e),r.lineIndex++,r.lineIndex>=r.height?(this._lastLine=null,this._imageIndex++,r=this._images[this._imageIndex]):this._lastLine=e,r?this.read(r.byteWidth+1,this._reverseFilterLine.bind(this)):(this._lastLine=null,this.complete())}},4948:t=>{"use strict";t.exports=function(t,e){let n=e.depth,r=e.width,i=e.height,o=e.colorType,s=e.transColor,a=e.palette,h=t;return 3===o?function(t,e,n,r,i){let o=0;for(let s=0;s<r;s++)for(let r=0;r<n;r++){let n=i[t[o]];if(!n)throw new Error("index "+t[o]+" not in palette");for(let t=0;t<4;t++)e[o+t]=n[t];o+=4}}(t,h,r,i,a):(s&&function(t,e,n,r,i){let o=0;for(let s=0;s<r;s++)for(let r=0;r<n;r++){let n=!1;if(1===i.length?i[0]===t[o]&&(n=!0):i[0]===t[o]&&i[1]===t[o+1]&&i[2]===t[o+2]&&(n=!0),n)for(let t=0;t<4;t++)e[o+t]=0;o+=4}}(t,h,r,i,s),8!==n&&(16===n&&(h=Buffer.alloc(r*i*4)),function(t,e,n,r,i){let o=Math.pow(2,i)-1,s=0;for(let i=0;i<r;i++)for(let r=0;r<n;r++){for(let n=0;n<4;n++)e[s+n]=Math.floor(255*t[s+n]/o+.5);s+=4}}(t,h,r,i,n))),h}},2323:(t,e)=>{"use strict";let n=[{x:[0],y:[0]},{x:[4],y:[0]},{x:[0,4],y:[4]},{x:[2,6],y:[0,4]},{x:[0,2,4,6],y:[2,6]},{x:[1,3,5,7],y:[0,2,4,6]},{x:[0,1,2,3,4,5,6,7],y:[1,3,5,7]}];e.getImagePasses=function(t,e){let r=[],i=t%8,o=e%8,s=(t-i)/8,a=(e-o)/8;for(let t=0;t<n.length;t++){let e=n[t],h=s*e.x.length,l=a*e.y.length;for(let t=0;t<e.x.length&&e.x[t]<i;t++)h++;for(let t=0;t<e.y.length&&e.y[t]<o;t++)l++;h>0&&l>0&&r.push({width:h,height:l,index:t})}return r},e.getInterlaceIterator=function(t){return function(e,r,i){let o=e%n[i].x.length,s=(e-o)/n[i].x.length*8+n[i].x[o],a=r%n[i].y.length;return 4*s+((r-a)/n[i].y.length*8+n[i].y[a])*t*4}}},2715:(t,e,n)=>{"use strict";let r=n(9023),i=n(2203),o=n(8351),s=n(4302),a=t.exports=function(t){i.call(this);let e=t||{};this._packer=new s(e),this._deflate=this._packer.createDeflate(),this.readable=!0};r.inherits(a,i),a.prototype.pack=function(t,e,n,r){this.emit("data",Buffer.from(o.PNG_SIGNATURE)),this.emit("data",this._packer.packIHDR(e,n)),r&&this.emit("data",this._packer.packGAMA(r));let i=this._packer.filterData(t,e,n);this._deflate.on("error",this.emit.bind(this,"error")),this._deflate.on("data",function(t){this.emit("data",this._packer.packIDAT(t))}.bind(this)),this._deflate.on("end",function(){this.emit("data",this._packer.packIEND()),this.emit("end")}.bind(this)),this._deflate.end(i)}},7800:(t,e,n)=>{"use strict";let r=!0,i=n(3106);i.deflateSync||(r=!1);let o=n(8351),s=n(4302);t.exports=function(t,e){if(!r)throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");let n=new s(e||{}),a=[];a.push(Buffer.from(o.PNG_SIGNATURE)),a.push(n.packIHDR(t.width,t.height)),t.gamma&&a.push(n.packGAMA(t.gamma));let h=n.filterData(t.data,t.width,t.height),l=i.deflateSync(h,n.getDeflateOptions());if(h=null,!l||!l.length)throw new Error("bad png - invalid compressed data response");return a.push(n.packIDAT(l)),a.push(n.packIEND()),Buffer.concat(a)}},4302:(t,e,n)=>{"use strict";let r=n(8351),i=n(8456),o=n(495),s=n(8502),a=n(3106),h=t.exports=function(t){if(this._options=t,t.deflateChunkSize=t.deflateChunkSize||32768,t.deflateLevel=null!=t.deflateLevel?t.deflateLevel:9,t.deflateStrategy=null!=t.deflateStrategy?t.deflateStrategy:3,t.inputHasAlpha=null==t.inputHasAlpha||t.inputHasAlpha,t.deflateFactory=t.deflateFactory||a.createDeflate,t.bitDepth=t.bitDepth||8,t.colorType="number"==typeof t.colorType?t.colorType:r.COLORTYPE_COLOR_ALPHA,t.inputColorType="number"==typeof t.inputColorType?t.inputColorType:r.COLORTYPE_COLOR_ALPHA,-1===[r.COLORTYPE_GRAYSCALE,r.COLORTYPE_COLOR,r.COLORTYPE_COLOR_ALPHA,r.COLORTYPE_ALPHA].indexOf(t.colorType))throw new Error("option color type:"+t.colorType+" is not supported at present");if(-1===[r.COLORTYPE_GRAYSCALE,r.COLORTYPE_COLOR,r.COLORTYPE_COLOR_ALPHA,r.COLORTYPE_ALPHA].indexOf(t.inputColorType))throw new Error("option input color type:"+t.inputColorType+" is not supported at present");if(8!==t.bitDepth&&16!==t.bitDepth)throw new Error("option bit depth:"+t.bitDepth+" is not supported at present")};h.prototype.getDeflateOptions=function(){return{chunkSize:this._options.deflateChunkSize,level:this._options.deflateLevel,strategy:this._options.deflateStrategy}},h.prototype.createDeflate=function(){return this._options.deflateFactory(this.getDeflateOptions())},h.prototype.filterData=function(t,e,n){let i=o(t,e,n,this._options),a=r.COLORTYPE_TO_BPP_MAP[this._options.colorType];return s(i,e,n,this._options,a)},h.prototype._packChunk=function(t,e){let n=e?e.length:0,r=Buffer.alloc(n+12);return r.writeUInt32BE(n,0),r.writeUInt32BE(t,4),e&&e.copy(r,8),r.writeInt32BE(i.crc32(r.slice(4,r.length-4)),r.length-4),r},h.prototype.packGAMA=function(t){let e=Buffer.alloc(4);return e.writeUInt32BE(Math.floor(t*r.GAMMA_DIVISION),0),this._packChunk(r.TYPE_gAMA,e)},h.prototype.packIHDR=function(t,e){let n=Buffer.alloc(13);return n.writeUInt32BE(t,0),n.writeUInt32BE(e,4),n[8]=this._options.bitDepth,n[9]=this._options.colorType,n[10]=0,n[11]=0,n[12]=0,this._packChunk(r.TYPE_IHDR,n)},h.prototype.packIDAT=function(t){return this._packChunk(r.TYPE_IDAT,t)},h.prototype.packIEND=function(){return this._packChunk(r.TYPE_IEND,null)}},7665:t=>{"use strict";t.exports=function(t,e,n){let r=t+e-n,i=Math.abs(r-t),o=Math.abs(r-e),s=Math.abs(r-n);return i<=o&&i<=s?t:o<=s?e:n}},5602:(t,e,n)=>{"use strict";let r=n(9023),i=n(3106),o=n(4267),s=n(5769),a=n(959),h=n(104),l=n(4948),u=t.exports=function(t){o.call(this),this._parser=new a(t,{read:this.read.bind(this),error:this._handleError.bind(this),metadata:this._handleMetaData.bind(this),gamma:this.emit.bind(this,"gamma"),palette:this._handlePalette.bind(this),transColor:this._handleTransColor.bind(this),finished:this._finished.bind(this),inflateData:this._inflateData.bind(this),simpleTransparency:this._simpleTransparency.bind(this),headersFinished:this._headersFinished.bind(this)}),this._options=t,this.writable=!0,this._parser.start()};r.inherits(u,o),u.prototype._handleError=function(t){this.emit("error",t),this.writable=!1,this.destroy(),this._inflate&&this._inflate.destroy&&this._inflate.destroy(),this._filter&&(this._filter.destroy(),this._filter.on("error",(function(){}))),this.errord=!0},u.prototype._inflateData=function(t){if(!this._inflate)if(this._bitmapInfo.interlace)this._inflate=i.createInflate(),this._inflate.on("error",this.emit.bind(this,"error")),this._filter.on("complete",this._complete.bind(this)),this._inflate.pipe(this._filter);else{let t=(1+(this._bitmapInfo.width*this._bitmapInfo.bpp*this._bitmapInfo.depth+7>>3))*this._bitmapInfo.height,e=Math.max(t,i.Z_MIN_CHUNK);this._inflate=i.createInflate({chunkSize:e});let n=t,r=this.emit.bind(this,"error");this._inflate.on("error",(function(t){n&&r(t)})),this._filter.on("complete",this._complete.bind(this));let o=this._filter.write.bind(this._filter);this._inflate.on("data",(function(t){n&&(t.length>n&&(t=t.slice(0,n)),n-=t.length,o(t))})),this._inflate.on("end",this._filter.end.bind(this._filter))}this._inflate.write(t)},u.prototype._handleMetaData=function(t){this._metaData=t,this._bitmapInfo=Object.create(t),this._filter=new s(this._bitmapInfo)},u.prototype._handleTransColor=function(t){this._bitmapInfo.transColor=t},u.prototype._handlePalette=function(t){this._bitmapInfo.palette=t},u.prototype._simpleTransparency=function(){this._metaData.alpha=!0},u.prototype._headersFinished=function(){this.emit("metadata",this._metaData)},u.prototype._finished=function(){this.errord||(this._inflate?this._inflate.end():this.emit("error","No Inflate block"))},u.prototype._complete=function(t){if(this.errord)return;let e;try{let n=h.dataToBitMap(t,this._bitmapInfo);e=l(n,this._bitmapInfo),n=null}catch(t){return void this._handleError(t)}this.emit("parsed",e)}},4487:(t,e,n)=>{"use strict";let r=!0,i=n(3106),o=n(8861);i.deflateSync||(r=!1);let s=n(9741),a=n(3122),h=n(959),l=n(104),u=n(4948);t.exports=function(t,e){if(!r)throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");let n,c,f,d=[],p=new s(t),g=new h(e,{read:p.read.bind(p),error:function(t){n=t},metadata:function(t){c=t},gamma:function(t){f=t},palette:function(t){c.palette=t},transColor:function(t){c.transColor=t},inflateData:function(t){d.push(t)},simpleTransparency:function(){c.alpha=!0}});if(g.start(),p.process(),n)throw n;let _,w=Buffer.concat(d);if(d.length=0,c.interlace)_=i.inflateSync(w);else{let t=(1+(c.width*c.bpp*c.depth+7>>3))*c.height;_=o(w,{chunkSize:t,maxLength:t})}if(w=null,!_||!_.length)throw new Error("bad png - invalid inflate data response");let m=a.process(_,c);w=null;let y=l.dataToBitMap(m,c);m=null;let E=u(y,c);return c.data=E,c.gamma=f||0,c}},959:(t,e,n)=>{"use strict";let r=n(8351),i=n(8456),o=t.exports=function(t,e){this._options=t,t.checkCRC=!1!==t.checkCRC,this._hasIHDR=!1,this._hasIEND=!1,this._emittedHeadersFinished=!1,this._palette=[],this._colorType=0,this._chunks={},this._chunks[r.TYPE_IHDR]=this._handleIHDR.bind(this),this._chunks[r.TYPE_IEND]=this._handleIEND.bind(this),this._chunks[r.TYPE_IDAT]=this._handleIDAT.bind(this),this._chunks[r.TYPE_PLTE]=this._handlePLTE.bind(this),this._chunks[r.TYPE_tRNS]=this._handleTRNS.bind(this),this._chunks[r.TYPE_gAMA]=this._handleGAMA.bind(this),this.read=e.read,this.error=e.error,this.metadata=e.metadata,this.gamma=e.gamma,this.transColor=e.transColor,this.palette=e.palette,this.parsed=e.parsed,this.inflateData=e.inflateData,this.finished=e.finished,this.simpleTransparency=e.simpleTransparency,this.headersFinished=e.headersFinished||function(){}};o.prototype.start=function(){this.read(r.PNG_SIGNATURE.length,this._parseSignature.bind(this))},o.prototype._parseSignature=function(t){let e=r.PNG_SIGNATURE;for(let n=0;n<e.length;n++)if(t[n]!==e[n])return void this.error(new Error("Invalid file signature"));this.read(8,this._parseChunkBegin.bind(this))},o.prototype._parseChunkBegin=function(t){let e=t.readUInt32BE(0),n=t.readUInt32BE(4),o="";for(let e=4;e<8;e++)o+=String.fromCharCode(t[e]);let s=Boolean(32&t[4]);if(this._hasIHDR||n===r.TYPE_IHDR){if(this._crc=new i,this._crc.write(Buffer.from(o)),this._chunks[n])return this._chunks[n](e);s?this.read(e+4,this._skipChunk.bind(this)):this.error(new Error("Unsupported critical chunk type "+o))}else this.error(new Error("Expected IHDR on beggining"))},o.prototype._skipChunk=function(){this.read(8,this._parseChunkBegin.bind(this))},o.prototype._handleChunkEnd=function(){this.read(4,this._parseChunkEnd.bind(this))},o.prototype._parseChunkEnd=function(t){let e=t.readInt32BE(0),n=this._crc.crc32();this._options.checkCRC&&n!==e?this.error(new Error("Crc error - "+e+" - "+n)):this._hasIEND||this.read(8,this._parseChunkBegin.bind(this))},o.prototype._handleIHDR=function(t){this.read(t,this._parseIHDR.bind(this))},o.prototype._parseIHDR=function(t){this._crc.write(t);let e=t.readUInt32BE(0),n=t.readUInt32BE(4),i=t[8],o=t[9],s=t[10],a=t[11],h=t[12];if(8!==i&&4!==i&&2!==i&&1!==i&&16!==i)return void this.error(new Error("Unsupported bit depth "+i));if(!(o in r.COLORTYPE_TO_BPP_MAP))return void this.error(new Error("Unsupported color type"));if(0!==s)return void this.error(new Error("Unsupported compression method"));if(0!==a)return void this.error(new Error("Unsupported filter method"));if(0!==h&&1!==h)return void this.error(new Error("Unsupported interlace method"));this._colorType=o;let l=r.COLORTYPE_TO_BPP_MAP[this._colorType];this._hasIHDR=!0,this.metadata({width:e,height:n,depth:i,interlace:Boolean(h),palette:Boolean(o&r.COLORTYPE_PALETTE),color:Boolean(o&r.COLORTYPE_COLOR),alpha:Boolean(o&r.COLORTYPE_ALPHA),bpp:l,colorType:o}),this._handleChunkEnd()},o.prototype._handlePLTE=function(t){this.read(t,this._parsePLTE.bind(this))},o.prototype._parsePLTE=function(t){this._crc.write(t);let e=Math.floor(t.length/3);for(let n=0;n<e;n++)this._palette.push([t[3*n],t[3*n+1],t[3*n+2],255]);this.palette(this._palette),this._handleChunkEnd()},o.prototype._handleTRNS=function(t){this.simpleTransparency(),this.read(t,this._parseTRNS.bind(this))},o.prototype._parseTRNS=function(t){if(this._crc.write(t),this._colorType===r.COLORTYPE_PALETTE_COLOR){if(0===this._palette.length)return void this.error(new Error("Transparency chunk must be after palette"));if(t.length>this._palette.length)return void this.error(new Error("More transparent colors than palette size"));for(let e=0;e<t.length;e++)this._palette[e][3]=t[e];this.palette(this._palette)}this._colorType===r.COLORTYPE_GRAYSCALE&&this.transColor([t.readUInt16BE(0)]),this._colorType===r.COLORTYPE_COLOR&&this.transColor([t.readUInt16BE(0),t.readUInt16BE(2),t.readUInt16BE(4)]),this._handleChunkEnd()},o.prototype._handleGAMA=function(t){this.read(t,this._parseGAMA.bind(this))},o.prototype._parseGAMA=function(t){this._crc.write(t),this.gamma(t.readUInt32BE(0)/r.GAMMA_DIVISION),this._handleChunkEnd()},o.prototype._handleIDAT=function(t){this._emittedHeadersFinished||(this._emittedHeadersFinished=!0,this.headersFinished()),this.read(-t,this._parseIDAT.bind(this,t))},o.prototype._parseIDAT=function(t,e){if(this._crc.write(e),this._colorType===r.COLORTYPE_PALETTE_COLOR&&0===this._palette.length)throw new Error("Expected palette not found");this.inflateData(e);let n=t-e.length;n>0?this._handleIDAT(n):this._handleChunkEnd()},o.prototype._handleIEND=function(t){this.read(t,this._parseIEND.bind(this))},o.prototype._parseIEND=function(t){this._crc.write(t),this._hasIEND=!0,this._handleChunkEnd(),this.finished&&this.finished()}},3154:(t,e,n)=>{"use strict";let r=n(4487),i=n(7800);e.read=function(t,e){return r(t,e||{})},e.write=function(t,e){return i(t,e)}},7597:(t,e,n)=>{"use strict";let r=n(9023),i=n(2203),o=n(5602),s=n(2715),a=n(3154),h=e.O=function(t){i.call(this),t=t||{},this.width=0|t.width,this.height=0|t.height,this.data=this.width>0&&this.height>0?Buffer.alloc(4*this.width*this.height):null,t.fill&&this.data&&this.data.fill(0),this.gamma=0,this.readable=this.writable=!0,this._parser=new o(t),this._parser.on("error",this.emit.bind(this,"error")),this._parser.on("close",this._handleClose.bind(this)),this._parser.on("metadata",this._metadata.bind(this)),this._parser.on("gamma",this._gamma.bind(this)),this._parser.on("parsed",function(t){this.data=t,this.emit("parsed",t)}.bind(this)),this._packer=new s(t),this._packer.on("data",this.emit.bind(this,"data")),this._packer.on("end",this.emit.bind(this,"end")),this._parser.on("close",this._handleClose.bind(this)),this._packer.on("error",this.emit.bind(this,"error"))};r.inherits(h,i),h.sync=a,h.prototype.pack=function(){return this.data&&this.data.length?(process.nextTick(function(){this._packer.pack(this.data,this.width,this.height,this.gamma)}.bind(this)),this):(this.emit("error","No data provided"),this)},h.prototype.parse=function(t,e){if(e){let t,n;t=function(t){this.removeListener("error",n),this.data=t,e(null,this)}.bind(this),n=function(n){this.removeListener("parsed",t),e(n,null)}.bind(this),this.once("parsed",t),this.once("error",n)}return this.end(t),this},h.prototype.write=function(t){return this._parser.write(t),!0},h.prototype.end=function(t){this._parser.end(t)},h.prototype._metadata=function(t){this.width=t.width,this.height=t.height,this.emit("metadata",t)},h.prototype._gamma=function(t){this.gamma=t},h.prototype._handleClose=function(){this._parser.writable||this._packer.readable||this.emit("close")},h.bitblt=function(t,e,n,r,i,o,s,a){if(r|=0,i|=0,o|=0,s|=0,a|=0,(n|=0)>t.width||r>t.height||n+i>t.width||r+o>t.height)throw new Error("bitblt reading outside image");if(s>e.width||a>e.height||s+i>e.width||a+o>e.height)throw new Error("bitblt writing outside image");for(let h=0;h<o;h++)t.data.copy(e.data,(a+h)*e.width+s<<2,(r+h)*t.width+n<<2,(r+h)*t.width+n+i<<2)},h.prototype.bitblt=function(t,e,n,r,i,o,s){return h.bitblt(this,t,e,n,r,i,o,s),this},h.adjustGamma=function(t){if(t.gamma){for(let e=0;e<t.height;e++)for(let n=0;n<t.width;n++){let r=t.width*e+n<<2;for(let e=0;e<3;e++){let n=t.data[r+e]/255;n=Math.pow(n,1/2.2/t.gamma),t.data[r+e]=Math.round(255*n)}}t.gamma=0}},h.prototype.adjustGamma=function(){h.adjustGamma(this)}},8861:(t,e,n)=>{"use strict";let r=n(2613).ok,i=n(3106),o=n(9023),s=n(181).kMaxLength;function a(t){if(!(this instanceof a))return new a(t);t&&t.chunkSize<i.Z_MIN_CHUNK&&(t.chunkSize=i.Z_MIN_CHUNK),i.Inflate.call(this,t),this._offset=void 0===this._offset?this._outOffset:this._offset,this._buffer=this._buffer||this._outBuffer,t&&null!=t.maxLength&&(this._maxLength=t.maxLength)}function h(t,e){e&&process.nextTick(e),t._handle&&(t._handle.close(),t._handle=null)}function l(t,e){return function(t,e){if("string"==typeof e&&(e=Buffer.from(e)),!(e instanceof Buffer))throw new TypeError("Not a string or buffer");let n=t._finishFlushFlag;return null==n&&(n=i.Z_FINISH),t._processChunk(e,n)}(new a(e),t)}a.prototype._processChunk=function(t,e,n){if("function"==typeof n)return i.Inflate._processChunk.call(this,t,e,n);let o,a,l=this,u=t&&t.length,c=this._chunkSize-this._offset,f=this._maxLength,d=0,p=[],g=0;function _(t,e){if(l._hadError)return;let n=c-e;if(r(n>=0,"have should not go down"),n>0){let t=l._buffer.slice(l._offset,l._offset+n);if(l._offset+=n,t.length>f&&(t=t.slice(0,f)),p.push(t),g+=t.length,f-=t.length,0===f)return!1}return(0===e||l._offset>=l._chunkSize)&&(c=l._chunkSize,l._offset=0,l._buffer=Buffer.allocUnsafe(l._chunkSize)),0===e&&(d+=u-t,u=t,!0)}this.on("error",(function(t){o=t})),r(this._handle,"zlib binding closed");do{a=this._handle.writeSync(e,t,d,u,this._buffer,this._offset,c),a=a||this._writeState}while(!this._hadError&&_(a[0],a[1]));if(this._hadError)throw o;if(g>=s)throw h(this),new RangeError("Cannot create final Buffer. It would be larger than 0x"+s.toString(16)+" bytes");let w=Buffer.concat(p,g);return h(this),w},o.inherits(a,i.Inflate),t.exports=e=l,e.Inflate=a,e.createInflate=function(t){return new a(t)},e.inflateSync=l},9741:t=>{"use strict";let e=t.exports=function(t){this._buffer=t,this._reads=[]};e.prototype.read=function(t,e){this._reads.push({length:Math.abs(t),allowLess:t<0,func:e})},e.prototype.process=function(){for(;this._reads.length>0&&this._buffer.length;){let t=this._reads[0];if(!this._buffer.length||!(this._buffer.length>=t.length||t.allowLess))break;{this._reads.shift();let e=this._buffer;this._buffer=e.slice(t.length),t.func.call(this,e.slice(0,t.length))}}return this._reads.length>0?new Error("There are some read requests waitng on finished stream"):this._buffer.length>0?new Error("unrecognised content at end of stream"):void 0}},6484:(t,e,n)=>{const r=n(3250),i=n(5282),o=n(6940),s=n(1169);function a(t,e,n,o,s){const a=[].slice.call(arguments,1),h=a.length,l="function"==typeof a[h-1];if(!l&&!r())throw new Error("Callback required as last argument");if(!l){if(h<1)throw new Error("Too few arguments provided");return 1===h?(n=e,e=o=void 0):2!==h||e.getContext||(o=n,n=e,e=void 0),new Promise((function(r,s){try{const s=i.create(n,o);r(t(s,e,o))}catch(t){s(t)}}))}if(h<2)throw new Error("Too few arguments provided");2===h?(s=n,n=e,e=o=void 0):3===h&&(e.getContext&&void 0===s?(s=o,o=void 0):(s=o,o=n,n=e,e=void 0));try{const r=i.create(n,o);s(null,t(r,e,o))}catch(t){s(t)}}i.create,e.toCanvas=a.bind(null,o.render),a.bind(null,o.renderToDataURL),a.bind(null,(function(t,e,n){return s.render(t,n)}))},3250:t=>{t.exports=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then}},4240:(t,e,n)=>{const r=n(6667).getSymbolSize;e.getRowColCoords=function(t){if(1===t)return[];const e=Math.floor(t/7)+2,n=r(t),i=145===n?26:2*Math.ceil((n-13)/(2*e-2)),o=[n-7];for(let t=1;t<e-1;t++)o[t]=o[t-1]-i;return o.push(6),o.reverse()},e.getPositions=function(t){const n=[],r=e.getRowColCoords(t),i=r.length;for(let t=0;t<i;t++)for(let e=0;e<i;e++)0===t&&0===e||0===t&&e===i-1||t===i-1&&0===e||n.push([r[t],r[e]]);return n}},532:(t,e,n)=>{const r=n(8491),i=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function o(t){this.mode=r.ALPHANUMERIC,this.data=t}o.getBitsLength=function(t){return 11*Math.floor(t/2)+t%2*6},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(t){let e;for(e=0;e+2<=this.data.length;e+=2){let n=45*i.indexOf(this.data[e]);n+=i.indexOf(this.data[e+1]),t.put(n,11)}this.data.length%2&&t.put(i.indexOf(this.data[e]),6)},t.exports=o},2100:t=>{function e(){this.buffer=[],this.length=0}e.prototype={get:function(t){const e=Math.floor(t/8);return 1==(this.buffer[e]>>>7-t%8&1)},put:function(t,e){for(let n=0;n<e;n++)this.putBit(1==(t>>>e-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}},t.exports=e},2839:t=>{function e(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}e.prototype.set=function(t,e,n,r){const i=t*this.size+e;this.data[i]=n,r&&(this.reservedBit[i]=!0)},e.prototype.get=function(t,e){return this.data[t*this.size+e]},e.prototype.xor=function(t,e,n){this.data[t*this.size+e]^=n},e.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]},t.exports=e},7787:(t,e,n)=>{const r=n(8491);function i(t){this.mode=r.BYTE,this.data="string"==typeof t?(new TextEncoder).encode(t):new Uint8Array(t)}i.getBitsLength=function(t){return 8*t},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){for(let e=0,n=this.data.length;e<n;e++)t.put(this.data[e],8)},t.exports=i},583:(t,e,n)=>{const r=n(9082),i=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],o=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];e.getBlocksCount=function(t,e){switch(e){case r.L:return i[4*(t-1)+0];case r.M:return i[4*(t-1)+1];case r.Q:return i[4*(t-1)+2];case r.H:return i[4*(t-1)+3];default:return}},e.getTotalCodewordsCount=function(t,e){switch(e){case r.L:return o[4*(t-1)+0];case r.M:return o[4*(t-1)+1];case r.Q:return o[4*(t-1)+2];case r.H:return o[4*(t-1)+3];default:return}}},9082:(t,e)=>{e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2},e.isValid=function(t){return t&&void 0!==t.bit&&t.bit>=0&&t.bit<4},e.from=function(t,n){if(e.isValid(t))return t;try{return function(t){if("string"!=typeof t)throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+t)}}(t)}catch(t){return n}}},3827:(t,e,n)=>{const r=n(6667).getSymbolSize;e.getPositions=function(t){const e=r(t);return[[0,0],[e-7,0],[0,e-7]]}},6068:(t,e,n)=>{const r=n(6667),i=r.getBCHDigit(1335);e.getEncodedBits=function(t,e){const n=t.bit<<3|e;let o=n<<10;for(;r.getBCHDigit(o)-i>=0;)o^=1335<<r.getBCHDigit(o)-i;return 21522^(n<<10|o)}},5072:(t,e)=>{const n=new Uint8Array(512),r=new Uint8Array(256);!function(){let t=1;for(let e=0;e<255;e++)n[e]=t,r[t]=e,t<<=1,256&t&&(t^=285);for(let t=255;t<512;t++)n[t]=n[t-255]}(),e.log=function(t){if(t<1)throw new Error("log("+t+")");return r[t]},e.exp=function(t){return n[t]},e.mul=function(t,e){return 0===t||0===e?0:n[r[t]+r[e]]}},4822:(t,e,n)=>{const r=n(8491),i=n(6667);function o(t){this.mode=r.KANJI,this.data=t}o.getBitsLength=function(t){return 13*t},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(t){let e;for(e=0;e<this.data.length;e++){let n=i.toSJIS(this.data[e]);if(n>=33088&&n<=40956)n-=33088;else{if(!(n>=57408&&n<=60351))throw new Error("Invalid SJIS character: "+this.data[e]+"\nMake sure your charset is UTF-8");n-=49472}n=192*(n>>>8&255)+(255&n),t.put(n,13)}},t.exports=o},8587:(t,e)=>{e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};function n(t,n,r){switch(t){case e.Patterns.PATTERN000:return(n+r)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return r%3==0;case e.Patterns.PATTERN011:return(n+r)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case e.Patterns.PATTERN101:return n*r%2+n*r%3==0;case e.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case e.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}}e.isValid=function(t){return null!=t&&""!==t&&!isNaN(t)&&t>=0&&t<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(t){const e=t.size;let n=0,r=0,i=0,o=null,s=null;for(let a=0;a<e;a++){r=i=0,o=s=null;for(let h=0;h<e;h++){let e=t.get(a,h);e===o?r++:(r>=5&&(n+=r-5+3),o=e,r=1),e=t.get(h,a),e===s?i++:(i>=5&&(n+=i-5+3),s=e,i=1)}r>=5&&(n+=r-5+3),i>=5&&(n+=i-5+3)}return n},e.getPenaltyN2=function(t){const e=t.size;let n=0;for(let r=0;r<e-1;r++)for(let i=0;i<e-1;i++){const e=t.get(r,i)+t.get(r,i+1)+t.get(r+1,i)+t.get(r+1,i+1);4!==e&&0!==e||n++}return 3*n},e.getPenaltyN3=function(t){const e=t.size;let n=0,r=0,i=0;for(let o=0;o<e;o++){r=i=0;for(let s=0;s<e;s++)r=r<<1&2047|t.get(o,s),s>=10&&(1488===r||93===r)&&n++,i=i<<1&2047|t.get(s,o),s>=10&&(1488===i||93===i)&&n++}return 40*n},e.getPenaltyN4=function(t){let e=0;const n=t.data.length;for(let r=0;r<n;r++)e+=t.data[r];return 10*Math.abs(Math.ceil(100*e/n/5)-10)},e.applyMask=function(t,e){const r=e.size;for(let i=0;i<r;i++)for(let o=0;o<r;o++)e.isReserved(o,i)||e.xor(o,i,n(t,o,i))},e.getBestMask=function(t,n){const r=Object.keys(e.Patterns).length;let i=0,o=1/0;for(let s=0;s<r;s++){n(s),e.applyMask(s,t);const r=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(s,t),r<o&&(o=r,i=s)}return i}},8491:(t,e,n)=>{const r=n(119),i=n(7165);e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(t,e){if(!t.ccBits)throw new Error("Invalid mode: "+t);if(!r.isValid(e))throw new Error("Invalid version: "+e);return e>=1&&e<10?t.ccBits[0]:e<27?t.ccBits[1]:t.ccBits[2]},e.getBestModeForData=function(t){return i.testNumeric(t)?e.NUMERIC:i.testAlphanumeric(t)?e.ALPHANUMERIC:i.testKanji(t)?e.KANJI:e.BYTE},e.toString=function(t){if(t&&t.id)return t.id;throw new Error("Invalid mode")},e.isValid=function(t){return t&&t.bit&&t.ccBits},e.from=function(t,n){if(e.isValid(t))return t;try{return function(t){if("string"!=typeof t)throw new Error("Param is not a string");switch(t.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+t)}}(t)}catch(t){return n}}},3410:(t,e,n)=>{const r=n(8491);function i(t){this.mode=r.NUMERIC,this.data=t.toString()}i.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){let e,n,r;for(e=0;e+3<=this.data.length;e+=3)n=this.data.substr(e,3),r=parseInt(n,10),t.put(r,10);const i=this.data.length-e;i>0&&(n=this.data.substr(e),r=parseInt(n,10),t.put(r,3*i+1))},t.exports=i},4470:(t,e,n)=>{const r=n(5072);e.mul=function(t,e){const n=new Uint8Array(t.length+e.length-1);for(let i=0;i<t.length;i++)for(let o=0;o<e.length;o++)n[i+o]^=r.mul(t[i],e[o]);return n},e.mod=function(t,e){let n=new Uint8Array(t);for(;n.length-e.length>=0;){const t=n[0];for(let i=0;i<e.length;i++)n[i]^=r.mul(e[i],t);let i=0;for(;i<n.length&&0===n[i];)i++;n=n.slice(i)}return n},e.generateECPolynomial=function(t){let n=new Uint8Array([1]);for(let i=0;i<t;i++)n=e.mul(n,new Uint8Array([1,r.exp(i)]));return n}},5282:(t,e,n)=>{const r=n(6667),i=n(9082),o=n(2100),s=n(2839),a=n(4240),h=n(3827),l=n(8587),u=n(583),c=n(4339),f=n(4542),d=n(6068),p=n(8491),g=n(7958);function _(t,e,n){const r=t.size,i=d.getEncodedBits(e,n);let o,s;for(o=0;o<15;o++)s=1==(i>>o&1),o<6?t.set(o,8,s,!0):o<8?t.set(o+1,8,s,!0):t.set(r-15+o,8,s,!0),o<8?t.set(8,r-o-1,s,!0):o<9?t.set(8,15-o-1+1,s,!0):t.set(8,15-o-1,s,!0);t.set(r-8,8,1,!0)}function w(t,e,n,i){let d;if(Array.isArray(t))d=g.fromArray(t);else{if("string"!=typeof t)throw new Error("Invalid data");{let r=e;if(!r){const e=g.rawSplit(t);r=f.getBestVersionForData(e,n)}d=g.fromString(t,r||40)}}const w=f.getBestVersionForData(d,n);if(!w)throw new Error("The amount of data is too big to be stored in a QR Code");if(e){if(e<w)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+w+".\n")}else e=w;const m=function(t,e,n){const i=new o;n.forEach((function(e){i.put(e.mode.bit,4),i.put(e.getLength(),p.getCharCountIndicator(e.mode,t)),e.write(i)}));const s=8*(r.getSymbolTotalCodewords(t)-u.getTotalCodewordsCount(t,e));for(i.getLengthInBits()+4<=s&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(0);const a=(s-i.getLengthInBits())/8;for(let t=0;t<a;t++)i.put(t%2?17:236,8);return function(t,e,n){const i=r.getSymbolTotalCodewords(e),o=i-u.getTotalCodewordsCount(e,n),s=u.getBlocksCount(e,n),a=s-i%s,h=Math.floor(i/s),l=Math.floor(o/s),f=l+1,d=h-l,p=new c(d);let g=0;const _=new Array(s),w=new Array(s);let m=0;const y=new Uint8Array(t.buffer);for(let t=0;t<s;t++){const e=t<a?l:f;_[t]=y.slice(g,g+e),w[t]=p.encode(_[t]),g+=e,m=Math.max(m,e)}const E=new Uint8Array(i);let b,T,C=0;for(b=0;b<m;b++)for(T=0;T<s;T++)b<_[T].length&&(E[C++]=_[T][b]);for(b=0;b<d;b++)for(T=0;T<s;T++)E[C++]=w[T][b];return E}(i,t,e)}(e,n,d),y=r.getSymbolSize(e),E=new s(y);return function(t,e){const n=t.size,r=h.getPositions(e);for(let e=0;e<r.length;e++){const i=r[e][0],o=r[e][1];for(let e=-1;e<=7;e++)if(!(i+e<=-1||n<=i+e))for(let r=-1;r<=7;r++)o+r<=-1||n<=o+r||(e>=0&&e<=6&&(0===r||6===r)||r>=0&&r<=6&&(0===e||6===e)||e>=2&&e<=4&&r>=2&&r<=4?t.set(i+e,o+r,!0,!0):t.set(i+e,o+r,!1,!0))}}(E,e),function(t){const e=t.size;for(let n=8;n<e-8;n++){const e=n%2==0;t.set(n,6,e,!0),t.set(6,n,e,!0)}}(E),function(t,e){const n=a.getPositions(e);for(let e=0;e<n.length;e++){const r=n[e][0],i=n[e][1];for(let e=-2;e<=2;e++)for(let n=-2;n<=2;n++)-2===e||2===e||-2===n||2===n||0===e&&0===n?t.set(r+e,i+n,!0,!0):t.set(r+e,i+n,!1,!0)}}(E,e),_(E,n,0),e>=7&&function(t,e){const n=t.size,r=f.getEncodedBits(e);let i,o,s;for(let e=0;e<18;e++)i=Math.floor(e/3),o=e%3+n-8-3,s=1==(r>>e&1),t.set(i,o,s,!0),t.set(o,i,s,!0)}(E,e),function(t,e){const n=t.size;let r=-1,i=n-1,o=7,s=0;for(let a=n-1;a>0;a-=2)for(6===a&&a--;;){for(let n=0;n<2;n++)if(!t.isReserved(i,a-n)){let r=!1;s<e.length&&(r=1==(e[s]>>>o&1)),t.set(i,a-n,r),o--,-1===o&&(s++,o=7)}if(i+=r,i<0||n<=i){i-=r,r=-r;break}}}(E,m),isNaN(i)&&(i=l.getBestMask(E,_.bind(null,E,n))),l.applyMask(i,E),_(E,n,i),{modules:E,version:e,errorCorrectionLevel:n,maskPattern:i,segments:d}}e.create=function(t,e){if(void 0===t||""===t)throw new Error("No input text");let n,o,s=i.M;return void 0!==e&&(s=i.from(e.errorCorrectionLevel,i.M),n=f.from(e.version),o=l.from(e.maskPattern),e.toSJISFunc&&r.setToSJISFunction(e.toSJISFunc)),w(t,n,s,o)}},4339:(t,e,n)=>{const r=n(4470);function i(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}i.prototype.initialize=function(t){this.degree=t,this.genPoly=r.generateECPolynomial(this.degree)},i.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");const e=new Uint8Array(t.length+this.degree);e.set(t);const n=r.mod(e,this.genPoly),i=this.degree-n.length;if(i>0){const t=new Uint8Array(this.degree);return t.set(n,i),t}return n},t.exports=i},7165:(t,e)=>{const n="[0-9]+";let r="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";r=r.replace(/u/g,"\\u");const i="(?:(?![A-Z0-9 $%*+\\-./:]|"+r+")(?:.|[\r\n]))+";e.KANJI=new RegExp(r,"g"),e.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),e.BYTE=new RegExp(i,"g"),e.NUMERIC=new RegExp(n,"g"),e.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");const o=new RegExp("^"+r+"$"),s=new RegExp("^"+n+"$"),a=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");e.testKanji=function(t){return o.test(t)},e.testNumeric=function(t){return s.test(t)},e.testAlphanumeric=function(t){return a.test(t)}},7958:(t,e,n)=>{const r=n(8491),i=n(3410),o=n(532),s=n(7787),a=n(4822),h=n(7165),l=n(6667),u=n(3005);function c(t){return unescape(encodeURIComponent(t)).length}function f(t,e,n){const r=[];let i;for(;null!==(i=t.exec(n));)r.push({data:i[0],index:i.index,mode:e,length:i[0].length});return r}function d(t){const e=f(h.NUMERIC,r.NUMERIC,t),n=f(h.ALPHANUMERIC,r.ALPHANUMERIC,t);let i,o;return l.isKanjiModeEnabled()?(i=f(h.BYTE,r.BYTE,t),o=f(h.KANJI,r.KANJI,t)):(i=f(h.BYTE_KANJI,r.BYTE,t),o=[]),e.concat(n,i,o).sort((function(t,e){return t.index-e.index})).map((function(t){return{data:t.data,mode:t.mode,length:t.length}}))}function p(t,e){switch(e){case r.NUMERIC:return i.getBitsLength(t);case r.ALPHANUMERIC:return o.getBitsLength(t);case r.KANJI:return a.getBitsLength(t);case r.BYTE:return s.getBitsLength(t)}}function g(t,e){let n;const h=r.getBestModeForData(t);if(n=r.from(e,h),n!==r.BYTE&&n.bit<h.bit)throw new Error('"'+t+'" cannot be encoded with mode '+r.toString(n)+".\n Suggested mode is: "+r.toString(h));switch(n!==r.KANJI||l.isKanjiModeEnabled()||(n=r.BYTE),n){case r.NUMERIC:return new i(t);case r.ALPHANUMERIC:return new o(t);case r.KANJI:return new a(t);case r.BYTE:return new s(t)}}e.fromArray=function(t){return t.reduce((function(t,e){return"string"==typeof e?t.push(g(e,null)):e.data&&t.push(g(e.data,e.mode)),t}),[])},e.fromString=function(t,n){const i=function(t){const e=[];for(let n=0;n<t.length;n++){const i=t[n];switch(i.mode){case r.NUMERIC:e.push([i,{data:i.data,mode:r.ALPHANUMERIC,length:i.length},{data:i.data,mode:r.BYTE,length:i.length}]);break;case r.ALPHANUMERIC:e.push([i,{data:i.data,mode:r.BYTE,length:i.length}]);break;case r.KANJI:e.push([i,{data:i.data,mode:r.BYTE,length:c(i.data)}]);break;case r.BYTE:e.push([{data:i.data,mode:r.BYTE,length:c(i.data)}])}}return e}(d(t,l.isKanjiModeEnabled())),o=function(t,e){const n={},i={start:{}};let o=["start"];for(let s=0;s<t.length;s++){const a=t[s],h=[];for(let t=0;t<a.length;t++){const l=a[t],u=""+s+t;h.push(u),n[u]={node:l,lastCount:0},i[u]={};for(let t=0;t<o.length;t++){const s=o[t];n[s]&&n[s].node.mode===l.mode?(i[s][u]=p(n[s].lastCount+l.length,l.mode)-p(n[s].lastCount,l.mode),n[s].lastCount+=l.length):(n[s]&&(n[s].lastCount=l.length),i[s][u]=p(l.length,l.mode)+4+r.getCharCountIndicator(l.mode,e))}}o=h}for(let t=0;t<o.length;t++)i[o[t]].end=0;return{map:i,table:n}}(i,n),s=u.find_path(o.map,"start","end"),a=[];for(let t=1;t<s.length-1;t++)a.push(o.table[s[t]].node);return e.fromArray(a.reduce((function(t,e){const n=t.length-1>=0?t[t.length-1]:null;return n&&n.mode===e.mode?(t[t.length-1].data+=e.data,t):(t.push(e),t)}),[]))},e.rawSplit=function(t){return e.fromArray(d(t,l.isKanjiModeEnabled()))}},6667:(t,e)=>{let n;const r=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];e.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return 4*t+17},e.getSymbolTotalCodewords=function(t){return r[t]},e.getBCHDigit=function(t){let e=0;for(;0!==t;)e++,t>>>=1;return e},e.setToSJISFunction=function(t){if("function"!=typeof t)throw new Error('"toSJISFunc" is not a valid function.');n=t},e.isKanjiModeEnabled=function(){return void 0!==n},e.toSJIS=function(t){return n(t)}},119:(t,e)=>{e.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}},4542:(t,e,n)=>{const r=n(6667),i=n(583),o=n(9082),s=n(8491),a=n(119),h=r.getBCHDigit(7973);function l(t,e){return s.getCharCountIndicator(t,e)+4}function u(t,e){let n=0;return t.forEach((function(t){const r=l(t.mode,e);n+=r+t.getBitsLength()})),n}e.from=function(t,e){return a.isValid(t)?parseInt(t,10):e},e.getCapacity=function(t,e,n){if(!a.isValid(t))throw new Error("Invalid QR Code version");void 0===n&&(n=s.BYTE);const o=8*(r.getSymbolTotalCodewords(t)-i.getTotalCodewordsCount(t,e));if(n===s.MIXED)return o;const h=o-l(n,t);switch(n){case s.NUMERIC:return Math.floor(h/10*3);case s.ALPHANUMERIC:return Math.floor(h/11*2);case s.KANJI:return Math.floor(h/13);case s.BYTE:default:return Math.floor(h/8)}},e.getBestVersionForData=function(t,n){let r;const i=o.from(n,o.M);if(Array.isArray(t)){if(t.length>1)return function(t,n){for(let r=1;r<=40;r++)if(u(t,r)<=e.getCapacity(r,n,s.MIXED))return r}(t,i);if(0===t.length)return 1;r=t[0]}else r=t;return function(t,n,r){for(let i=1;i<=40;i++)if(n<=e.getCapacity(i,r,t))return i}(r.mode,r.getLength(),i)},e.getEncodedBits=function(t){if(!a.isValid(t)||t<7)throw new Error("Invalid QR Code version");let e=t<<12;for(;r.getBCHDigit(e)-h>=0;)e^=7973<<r.getBCHDigit(e)-h;return t<<12|e}},7304:(t,e,n)=>{t.exports=n(7141)},6940:(t,e,n)=>{const r=n(4675);e.render=function(t,e,n){let i=n,o=e;void 0!==i||e&&e.getContext||(i=e,e=void 0),e||(o=function(){try{return document.createElement("canvas")}catch(t){throw new Error("You need to specify a canvas element")}}()),i=r.getOptions(i);const s=r.getImageWidth(t.modules.size,i),a=o.getContext("2d"),h=a.createImageData(s,s);return r.qrToImageData(h.data,t,i),function(t,e,n){t.clearRect(0,0,e.width,e.height),e.style||(e.style={}),e.height=n,e.width=n,e.style.height=n+"px",e.style.width=n+"px"}(a,o,s),a.putImageData(h,0,0),o},e.renderToDataURL=function(t,n,r){let i=r;void 0!==i||n&&n.getContext||(i=n,n=void 0),i||(i={});const o=e.render(t,n,i),s=i.type||"image/png",a=i.rendererOpts||{};return o.toDataURL(s,a.quality)}},7817:(t,e,n)=>{const r=n(9896),i=n(7597).O,o=n(4675);e.render=function(t,e){const n=o.getOptions(e),r=n.rendererOpts,s=o.getImageWidth(t.modules.size,n);r.width=s,r.height=s;const a=new i(r);return o.qrToImageData(a.data,t,n),a},e.renderToDataURL=function(t,n,r){void 0===r&&(r=n,n=void 0),e.renderToBuffer(t,n,(function(t,e){t&&r(t);let n="data:image/png;base64,";n+=e.toString("base64"),r(null,n)}))},e.renderToBuffer=function(t,n,r){void 0===r&&(r=n,n=void 0);const i=e.render(t,n),o=[];i.on("error",r),i.on("data",(function(t){o.push(t)})),i.on("end",(function(){r(null,Buffer.concat(o))})),i.pack()},e.renderToFile=function(t,n,i,o){void 0===o&&(o=i,i=void 0);let s=!1;const a=(...t)=>{s||(s=!0,o.apply(null,t))},h=r.createWriteStream(t);h.on("error",a),h.on("close",a),e.renderToFileStream(h,n,i)},e.renderToFileStream=function(t,n,r){e.render(n,r).pack().pipe(t)}},1169:(t,e,n)=>{const r=n(4675);function i(t,e){const n=t.a/255,r=e+'="'+t.hex+'"';return n<1?r+" "+e+'-opacity="'+n.toFixed(2).slice(1)+'"':r}function o(t,e,n){let r=t+e;return void 0!==n&&(r+=" "+n),r}e.render=function(t,e,n){const s=r.getOptions(e),a=t.modules.size,h=t.modules.data,l=a+2*s.margin,u=s.color.light.a?"<path "+i(s.color.light,"fill")+' d="M0 0h'+l+"v"+l+'H0z"/>':"",c="<path "+i(s.color.dark,"stroke")+' d="'+function(t,e,n){let r="",i=0,s=!1,a=0;for(let h=0;h<t.length;h++){const l=Math.floor(h%e),u=Math.floor(h/e);l||s||(s=!0),t[h]?(a++,h>0&&l>0&&t[h-1]||(r+=s?o("M",l+n,.5+u+n):o("m",i,0),i=0,s=!1),l+1<e&&t[h+1]||(r+=o("h",a),a=0)):i++}return r}(h,a,s.margin)+'"/>',f='viewBox="0 0 '+l+" "+l+'"',d='<svg xmlns="http://www.w3.org/2000/svg" '+(s.width?'width="'+s.width+'" height="'+s.width+'" ':"")+f+' shape-rendering="crispEdges">'+u+c+"</svg>\n";return"function"==typeof n&&n(null,d),d}},3700:(t,e,n)=>{const r=n(1169);e.render=r.render,e.renderToFile=function(t,r,i,o){void 0===o&&(o=i,i=void 0);const s=n(9896),a='<?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">'+e.render(r,i);s.writeFile(t,a,o)}},1044:(t,e,n)=>{const r=n(7431),i=n(2633);e.render=function(t,e,n){return e&&e.small?i.render(t,e,n):r.render(t,e,n)}},2633:(t,e)=>{const n="[37m",r="[30m",i="[0m",o="[47m"+r,s="[40m"+n,a=function(t,e,n,r){const i=e+1;return n>=i||r>=i||r<-1||n<-1?"0":n>=e||r>=e||r<0||n<0?"1":t[r*e+n]?"2":"1"},h=function(t,e,n,r){return a(t,e,n,r)+a(t,e,n,r+1)};e.render=function(t,e,a){const l=t.modules.size,u=t.modules.data,c=!(!e||!e.inverse),f=e&&e.inverse?s:o,d=function(t,e,n){return{"00":i+" "+t,"01":i+e+"▄"+t,"02":i+n+"▄"+t,10:i+e+"▀"+t,11:" ",12:"▄",20:i+n+"▀"+t,21:"▀",22:"█"}}(f,c?r:n,c?n:r),p=i+"\n"+f;let g=f;for(let t=-1;t<l+1;t+=2){for(let e=-1;e<l;e++)g+=d[h(u,l,e,t)];g+=d[h(u,l,l,t)]+p}return g+=i,"function"==typeof a&&a(null,g),g}},7431:(t,e)=>{e.render=function(t,e,n){const r=t.modules.size,i=t.modules.data,o="[47m [0m";let s="";const a=Array(r+3).join(o),h=Array(2).join(o);s+=a+"\n";for(let t=0;t<r;++t){s+=o;for(let e=0;e<r;e++)s+=i[t*r+e]?"[40m [0m":o;s+=h+"\n"}return s+=a+"\n","function"==typeof n&&n(null,s),s}},8843:(t,e,n)=>{const r=n(4675),i={WW:" ",WB:"▄",BB:"█",BW:"▀"},o={BB:" ",BW:"▄",WW:"█",WB:"▀"};function s(t,e,n){return t&&e?n.BB:t&&!e?n.BW:!t&&e?n.WB:n.WW}e.render=function(t,e,n){const a=r.getOptions(e);let h=i;"#ffffff"!==a.color.dark.hex&&"#000000"!==a.color.light.hex||(h=o);const l=t.modules.size,u=t.modules.data;let c="",f=Array(l+2*a.margin+1).join(h.WW);f=Array(a.margin/2+1).join(f+"\n");const d=Array(a.margin+1).join(h.WW);c+=f;for(let t=0;t<l;t+=2){c+=d;for(let e=0;e<l;e++)c+=s(u[t*l+e],u[(t+1)*l+e],h);c+=d+"\n"}return c+=f.slice(0,-1),"function"==typeof n&&n(null,c),c},e.renderToFile=function(t,r,i,o){void 0===o&&(o=i,i=void 0);const s=n(9896),a=e.render(r,i);s.writeFile(t,a,o)}},4675:(t,e)=>{function n(t){if("number"==typeof t&&(t=t.toString()),"string"!=typeof t)throw new Error("Color should be defined as hex string");let e=t.slice().replace("#","").split("");if(e.length<3||5===e.length||e.length>8)throw new Error("Invalid hex color: "+t);3!==e.length&&4!==e.length||(e=Array.prototype.concat.apply([],e.map((function(t){return[t,t]})))),6===e.length&&e.push("F","F");const n=parseInt(e.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:255&n,hex:"#"+e.slice(0,6).join("")}}e.getOptions=function(t){t||(t={}),t.color||(t.color={});const e=void 0===t.margin||null===t.margin||t.margin<0?4:t.margin,r=t.width&&t.width>=21?t.width:void 0,i=t.scale||4;return{width:r,scale:r?4:i,margin:e,color:{dark:n(t.color.dark||"#000000ff"),light:n(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}},e.getScale=function(t,e){return e.width&&e.width>=t+2*e.margin?e.width/(t+2*e.margin):e.scale},e.getImageWidth=function(t,n){const r=e.getScale(t,n);return Math.floor((t+2*n.margin)*r)},e.qrToImageData=function(t,n,r){const i=n.modules.size,o=n.modules.data,s=e.getScale(i,r),a=Math.floor((i+2*r.margin)*s),h=r.margin*s,l=[r.color.light,r.color.dark];for(let e=0;e<a;e++)for(let n=0;n<a;n++){let u=4*(e*a+n),c=r.color.light;e>=h&&n>=h&&e<a-h&&n<a-h&&(c=l[o[Math.floor((e-h)/s)*i+Math.floor((n-h)/s)]?1:0]),t[u++]=c.r,t[u++]=c.g,t[u++]=c.b,t[u]=c.a}}},7141:(t,e,n)=>{const r=n(3250),i=n(5282),o=n(7817),s=n(8843),a=n(1044),h=n(3700);function l(t,e,n){if(void 0===t)throw new Error("String required as first argument");if(void 0===n&&(n=e,e={}),"function"!=typeof n){if(!r())throw new Error("Callback required as last argument");e=n||{},n=null}return{opts:e,cb:n}}function u(t){switch(t){case"svg":return h;case"txt":case"utf8":return s;default:return o}}function c(t,e,n){if(!n.cb)return new Promise((function(r,o){try{const s=i.create(e,n.opts);return t(s,n.opts,(function(t,e){return t?o(t):r(e)}))}catch(t){o(t)}}));try{const r=i.create(e,n.opts);return t(r,n.opts,n.cb)}catch(t){n.cb(t)}}e.create=i.create,e.toCanvas=n(6484).toCanvas,e.toString=function(t,e,n){const r=l(t,e,n);return c(function(t){switch(t){case"svg":return h;case"terminal":return a;default:return s}}(r.opts?r.opts.type:void 0).render,t,r)},e.toDataURL=function(t,e,n){const r=l(t,e,n);return c(u(r.opts.type).renderToDataURL,t,r)},e.toBuffer=function(t,e,n){const r=l(t,e,n);return c(u(r.opts.type).renderToBuffer,t,r)},e.toFile=function(t,e,n,i){if("string"!=typeof t||"string"!=typeof e&&"object"!=typeof e)throw new Error("Invalid argument");if(arguments.length<3&&!r())throw new Error("Too few arguments provided");const o=l(e,n,i),s=o.opts.type||function(t){return t.slice(2+(t.lastIndexOf(".")-1>>>0)).toLowerCase()}(t);return c(u(s).renderToFile.bind(null,t),e,o)},e.toFileStream=function(t,e,n){if(arguments.length<2)throw new Error("Too few arguments provided");const r=l(e,n,t.emit.bind(t,"error"));c(u("png").renderToFileStream.bind(null,t),e,r)}}};
|
package/dist/411.bundle.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=411,exports.ids=[411],exports.modules={9792:(t,e,s)=>{s.d(e,{zxcvbn:()=>at,zxcvbnOptions:()=>A});const n=(t,e)=>t.push.apply(t,e),r=t=>t.sort(((t,e)=>t.i-e.i||t.j-e.j)),a=t=>{const e={};let s=1;return t.forEach((t=>{e[t]=s,s+=1})),e},i={4:[[1,2],[2,3]],5:[[1,3],[2,3],[2,4]],6:[[1,2],[2,4],[4,5]],7:[[1,3],[2,3],[4,5],[4,6]],8:[[2,4],[4,6]]},o=/^[A-Z\xbf-\xdf][^A-Z\xbf-\xdf]+$/,l=/^[^A-Z\xbf-\xdf]+[A-Z\xbf-\xdf]$/,c=/^[A-Z\xbf-\xdf]+$/,h=/^[^a-z\xdf-\xff]+$/,u=/^[a-z\xdf-\xff]+$/,d=/^[^A-Z\xbf-\xdf]+$/,g=/[a-z\xdf-\xff]/,p=/[A-Z\xbf-\xdf]/,f=/[^A-Za-z\xbf-\xdf]/gi,m=/^\d+$/,b=(new Date).getFullYear(),y={recentYear:/19\d\d|200\d|201\d|202\d/g},k=[" ",",",";",":","|","/","\\","_",".","-"],w=k.length;class x{match({password:t}){const e=[...this.getMatchesWithoutSeparator(t),...this.getMatchesWithSeparator(t)],s=this.filterNoise(e);return r(s)}getMatchesWithSeparator(t){const e=[],s=/^(\d{1,4})([\s/\\_.-])(\d{1,2})\2(\d{1,4})$/;for(let n=0;n<=Math.abs(t.length-6);n+=1)for(let r=n+5;r<=n+9&&!(r>=t.length);r+=1){const a=t.slice(n,+r+1||9e9),i=s.exec(a);if(null!=i){const t=this.mapIntegersToDayMonthYear([parseInt(i[1],10),parseInt(i[3],10),parseInt(i[4],10)]);null!=t&&e.push({pattern:"date",token:a,i:n,j:r,separator:i[2],year:t.year,month:t.month,day:t.day})}}return e}getMatchesWithoutSeparator(t){const e=[],s=/^\d{4,8}$/,n=t=>Math.abs(t.year-b);for(let r=0;r<=Math.abs(t.length-4);r+=1)for(let a=r+3;a<=r+7&&!(a>=t.length);a+=1){const o=t.slice(r,+a+1||9e9);if(s.exec(o)){const t=[],s=o.length;if(i[s].forEach((([e,s])=>{const n=this.mapIntegersToDayMonthYear([parseInt(o.slice(0,e),10),parseInt(o.slice(e,s),10),parseInt(o.slice(s),10)]);null!=n&&t.push(n)})),t.length>0){let s=t[0],i=n(t[0]);t.slice(1).forEach((t=>{const e=n(t);e<i&&(s=t,i=e)})),e.push({pattern:"date",token:o,i:r,j:a,separator:"",year:s.year,month:s.month,day:s.day})}}}return e}filterNoise(t){return t.filter((e=>{let s=!1;const n=t.length;for(let r=0;r<n;r+=1){const n=t[r];if(e!==n&&n.i<=e.i&&n.j>=e.j){s=!0;break}}return!s}))}mapIntegersToDayMonthYear(t){if(t[1]>31||t[1]<=0)return null;let e=0,s=0,n=0;for(let r=0,a=t.length;r<a;r+=1){const a=t[r];if(a>99&&a<1e3||a>2050)return null;a>31&&(s+=1),a>12&&(e+=1),a<=0&&(n+=1)}return s>=2||3===e||n>=2?null:this.getDayMonth(t)}getDayMonth(t){const e=[[t[2],t.slice(0,2)],[t[0],t.slice(1,3)]],s=e.length;for(let t=0;t<s;t+=1){const[s,n]=e[t];if(1e3<=s&&s<=2050){const t=this.mapIntegersToDayMonth(n);return null!=t?{year:s,month:t.month,day:t.day}:null}}for(let t=0;t<s;t+=1){const[s,n]=e[t],r=this.mapIntegersToDayMonth(n);if(null!=r)return{year:this.twoToFourDigitYear(s),month:r.month,day:r.day}}return null}mapIntegersToDayMonth(t){const e=[t,t.slice().reverse()];for(let t=0;t<e.length;t+=1){const s=e[t],n=s[0],r=s[1];if(n>=1&&n<=31&&r>=1&&r<=12)return{day:n,month:r}}return null}twoToFourDigitYear(t){return t>99?t:t>50?t+1900:t+2e3}}const M=new Uint32Array(65536),S=(t,e,s)=>{let n=0;const r=Object.keys(e).find((e=>{const r=((t,e,s)=>{const n=t.length<=e.length,r=t.length<=s;return n||r?Math.ceil(t.length/4):s})(t,e,s);if(Math.abs(t.length-e.length)>r)return!1;const a=((t,e)=>{if(t.length<e.length){const s=e;e=t,t=s}return 0===e.length?t.length:t.length<=32?((t,e)=>{const s=t.length,n=e.length,r=1<<s-1;let a=-1,i=0,o=s,l=s;for(;l--;)M[t.charCodeAt(l)]|=1<<l;for(l=0;l<n;l++){let t=M[e.charCodeAt(l)];const s=t|i;t|=(t&a)+a^a,i|=~(t|a),a&=t,i&r&&o++,a&r&&o--,i=i<<1|1,a=a<<1|~(s|i),i&=s}for(l=s;l--;)M[t.charCodeAt(l)]=0;return o})(t,e):((t,e)=>{const s=e.length,n=t.length,r=[],a=[],i=Math.ceil(s/32),o=Math.ceil(n/32);for(let t=0;t<i;t++)a[t]=-1,r[t]=0;let l=0;for(;l<o-1;l++){let i=0,o=-1;const c=32*l,h=Math.min(32,n)+c;for(let e=c;e<h;e++)M[t.charCodeAt(e)]|=1<<e;for(let t=0;t<s;t++){const s=M[e.charCodeAt(t)],n=a[t/32|0]>>>t&1,l=r[t/32|0]>>>t&1,c=s|i,h=((s|l)&o)+o^o|s|l;let u=i|~(h|o),d=o&h;u>>>31^n&&(a[t/32|0]^=1<<t),d>>>31^l&&(r[t/32|0]^=1<<t),u=u<<1|n,d=d<<1|l,o=d|~(c|u),i=u&c}for(let e=c;e<h;e++)M[t.charCodeAt(e)]=0}let c=0,h=-1;const u=32*l,d=Math.min(32,n-u)+u;for(let e=u;e<d;e++)M[t.charCodeAt(e)]|=1<<e;let g=n;for(let t=0;t<s;t++){const s=M[e.charCodeAt(t)],i=a[t/32|0]>>>t&1,o=r[t/32|0]>>>t&1,l=s|c,u=((s|o)&h)+h^h|s|o;let d=c|~(u|h),p=h&u;g+=d>>>n-1&1,g-=p>>>n-1&1,d>>>31^i&&(a[t/32|0]^=1<<t),p>>>31^o&&(r[t/32|0]^=1<<t),d=d<<1|i,p=p<<1|o,h=p|~(l|d),c=d&l}for(let e=u;e<d;e++)M[t.charCodeAt(e)]=0;return g})(t,e)})(t,e),i=a<=r;return i&&(n=a),i}));return r?{levenshteinDistance:n,levenshteinDistanceEntry:r}:{}};var v={a:["4","@"],b:["8"],c:["(","{","[","<"],d:["6","|)"],e:["3"],f:["#"],g:["6","9","&"],h:["#","|-|"],i:["1","!","|"],k:["<","|<"],l:["!","1","|","7"],m:["^^","nn","2n","/\\\\/\\\\"],n:["//"],o:["0","()"],q:["9"],u:["|_|"],s:["$","5"],t:["+","7"],v:["<",">","/"],w:["^/","uu","vv","2u","2v","\\\\/\\\\/"],x:["%","><"],z:["2"]},T={warnings:{straightRow:"straightRow",keyPattern:"keyPattern",simpleRepeat:"simpleRepeat",extendedRepeat:"extendedRepeat",sequences:"sequences",recentYears:"recentYears",dates:"dates",topTen:"topTen",topHundred:"topHundred",common:"common",similarToCommon:"similarToCommon",wordByItself:"wordByItself",namesByThemselves:"namesByThemselves",commonNames:"commonNames",userInputs:"userInputs",pwned:"pwned"},suggestions:{l33t:"l33t",reverseWords:"reverseWords",allUppercase:"allUppercase",capitalization:"capitalization",dates:"dates",recentYears:"recentYears",associatedYears:"associatedYears",sequences:"sequences",repeated:"repeated",longerKeyboardPattern:"longerKeyboardPattern",anotherWord:"anotherWord",useWords:"useWords",noNeed:"noNeed",pwned:"pwned"},timeEstimation:{ltSecond:"ltSecond",second:"second",seconds:"seconds",minute:"minute",minutes:"minutes",hour:"hour",hours:"hours",day:"day",days:"days",month:"month",months:"months",year:"year",years:"years",centuries:"centuries"}};class j{constructor(t=[]){this.parents=t,this.children=new Map}addSub(t,...e){const s=t.charAt(0);this.children.has(s)||this.children.set(s,new j([...this.parents,s]));let n=this.children.get(s);for(let e=1;e<t.length;e+=1){const s=t.charAt(e);n.hasChild(s)||n.addChild(s),n=n.getChild(s)}return n.subs=(n.subs||[]).concat(e),this}getChild(t){return this.children.get(t)}isTerminal(){return!!this.subs}addChild(t){this.hasChild(t)||this.children.set(t,new j([...this.parents,t]))}hasChild(t){return this.children.has(t)}}var I=(t,e)=>(Object.entries(t).forEach((([t,s])=>{s.forEach((s=>{e.addSub(s,t)}))})),e);const A=new class{constructor(){this.matchers={},this.l33tTable=v,this.trieNodeRoot=I(v,new j),this.dictionary={userInputs:[]},this.rankedDictionaries={},this.rankedDictionariesMaxWordSize={},this.translations=T,this.graphs={},this.useLevenshteinDistance=!1,this.levenshteinThreshold=2,this.l33tMaxSubstitutions=100,this.maxLength=256,this.setRankedDictionaries()}setOptions(t={}){t.l33tTable&&(this.l33tTable=t.l33tTable,this.trieNodeRoot=I(t.l33tTable,new j)),t.dictionary&&(this.dictionary=t.dictionary,this.setRankedDictionaries()),t.translations&&this.setTranslations(t.translations),t.graphs&&(this.graphs=t.graphs),void 0!==t.useLevenshteinDistance&&(this.useLevenshteinDistance=t.useLevenshteinDistance),void 0!==t.levenshteinThreshold&&(this.levenshteinThreshold=t.levenshteinThreshold),void 0!==t.l33tMaxSubstitutions&&(this.l33tMaxSubstitutions=t.l33tMaxSubstitutions),void 0!==t.maxLength&&(this.maxLength=t.maxLength)}setTranslations(t){if(!this.checkCustomTranslations(t))throw new Error("Invalid translations object fallback to keys");this.translations=t}checkCustomTranslations(t){let e=!0;return Object.keys(T).forEach((s=>{if(s in t){const n=s;Object.keys(T[n]).forEach((s=>{s in t[n]||(e=!1)}))}else e=!1})),e}setRankedDictionaries(){const t={},e={};Object.keys(this.dictionary).forEach((s=>{t[s]=a(this.dictionary[s]),e[s]=this.getRankedDictionariesMaxWordSize(this.dictionary[s])})),this.rankedDictionaries=t,this.rankedDictionariesMaxWordSize=e}getRankedDictionariesMaxWordSize(t){const e=t.map((t=>"string"!=typeof t?t.toString().length:t.length));return 0===e.length?0:e.reduce(((t,e)=>Math.max(t,e)),-1/0)}buildSanitizedRankedDictionary(t){const e=[];return t.forEach((t=>{const s=typeof t;"string"!==s&&"number"!==s&&"boolean"!==s||e.push(t.toString().toLowerCase())})),a(e)}extendUserInputsDictionary(t){this.dictionary.userInputs||(this.dictionary.userInputs=[]);const e=[...this.dictionary.userInputs,...t];this.rankedDictionaries.userInputs=this.buildSanitizedRankedDictionary(e),this.rankedDictionariesMaxWordSize.userInputs=this.getRankedDictionariesMaxWordSize(e)}addMatcher(t,e){this.matchers[t]?console.info(`Matcher ${t} already exists`):this.matchers[t]=e}};class C{constructor(t){this.defaultMatch=t}match({password:t}){const e=t.split("").reverse().join("");return this.defaultMatch({password:e}).map((e=>({...e,token:e.token.split("").reverse().join(""),reversed:!0,i:t.length-1-e.j,j:t.length-1-e.i})))}}class D{constructor({substr:t,limit:e,trieRoot:s}){this.buffer=[],this.finalPasswords=[],this.substr=t,this.limit=e,this.trieRoot=s}getAllPossibleSubsAtIndex(t){const e=[];let s=this.trieRoot;for(let n=t;n<this.substr.length;n+=1){const t=this.substr.charAt(n);if(s=s.getChild(t),!s)break;e.push(s)}return e}helper({onlyFullSub:t,isFullSub:e,index:s,subIndex:n,changes:r,lastSubLetter:a,consecutiveSubCount:i}){if(this.finalPasswords.length>=this.limit)return;if(s===this.substr.length)return void(t===e&&this.finalPasswords.push({password:this.buffer.join(""),changes:r}));const o=[...this.getAllPossibleSubsAtIndex(s)];let l=!1;for(let c=s+o.length-1;c>=s;c-=1){const h=o[c-s];if(h.isTerminal()){if(a===h.parents.join("")&&i>=3)continue;l=!0;const s=h.subs;for(const o of s){this.buffer.push(o);const s=r.concat({i:n,letter:o,substitution:h.parents.join("")});if(this.helper({onlyFullSub:t,isFullSub:e,index:c+1,subIndex:n+o.length,changes:s,lastSubLetter:h.parents.join(""),consecutiveSubCount:a===h.parents.join("")?i+1:1}),this.buffer.pop(),this.finalPasswords.length>=this.limit)return}}}if(!t||!l){const o=this.substr.charAt(s);this.buffer.push(o),this.helper({onlyFullSub:t,isFullSub:e&&!l,index:s+1,subIndex:n+1,changes:r,lastSubLetter:a,consecutiveSubCount:i}),this.buffer.pop()}}getAll(){return this.helper({onlyFullSub:!0,isFullSub:!0,index:0,subIndex:0,changes:[],lastSubLetter:void 0,consecutiveSubCount:0}),this.helper({onlyFullSub:!1,isFullSub:!0,index:0,subIndex:0,changes:[],lastSubLetter:void 0,consecutiveSubCount:0}),this.finalPasswords}}class E{constructor(t){this.defaultMatch=t}isAlreadyIncluded(t,e){return t.some((t=>Object.entries(t).every((([t,s])=>"subs"===t||s===e[t]))))}match({password:t}){const e=[],s=((t,e,s)=>new D({substr:t,limit:e,trieRoot:s}).getAll())(t,A.l33tMaxSubstitutions,A.trieNodeRoot);let n=!1,r=!0;return s.forEach((s=>{if(n)return;const a=this.defaultMatch({password:s.password,useLevenshtein:r});r=!1,a.forEach((r=>{n||(n=0===r.i&&r.j===t.length-1);const a=((t,e,s)=>{const n=t.changes.filter((t=>t.i<e)).reduce(((t,e)=>t-e.letter.length+e.substitution.length),e),r=t.changes.filter((t=>t.i>=e&&t.i<=s)),a=r.reduce(((t,e)=>t-e.letter.length+e.substitution.length),s-e+n),i=[],o=[];return r.forEach((t=>{i.findIndex((e=>e.letter===t.letter&&e.substitution===t.substitution))<0&&(i.push({letter:t.letter,substitution:t.substitution}),o.push(`${t.substitution} -> ${t.letter}`))})),{i:n,j:a,subs:i,subDisplay:o.join(", ")}})(s,r.i,r.j),i=t.slice(a.i,+a.j+1||9e9),o={...r,l33t:!0,token:i,...a},l=this.isAlreadyIncluded(e,o);i.toLowerCase()===r.matchedWord||l||e.push(o)}))})),e.filter((t=>t.token.length>1))}}class L{constructor(){this.l33t=new E(this.defaultMatch),this.reverse=new C(this.defaultMatch)}match({password:t}){const e=[...this.defaultMatch({password:t}),...this.reverse.match({password:t}),...this.l33t.match({password:t})];return r(e)}defaultMatch({password:t,useLevenshtein:e=!0}){const s=[],n=t.length,r=t.toLowerCase();return Object.keys(A.rankedDictionaries).forEach((a=>{const i=A.rankedDictionaries[a],o=A.rankedDictionariesMaxWordSize[a],l=Math.min(o,n);for(let o=0;o<n;o+=1){const c=Math.min(o+l,n);for(let l=o;l<c;l+=1){const c=r.slice(o,+l+1||9e9),h=c in i;let u={};const d=0===o&&l===n-1;A.useLevenshteinDistance&&d&&!h&&e&&(u=S(c,i,A.levenshteinThreshold));const g=0!==Object.keys(u).length;if(h||g){const e=i[g?u.levenshteinDistanceEntry:c];s.push({pattern:"dictionary",i:o,j:l,token:t.slice(o,+l+1||9e9),matchedWord:c,rank:e,dictionaryName:a,reversed:!1,l33t:!1,...u})}}}})),s}}class P{match({password:t,regexes:e=y}){const s=[];return Object.keys(e).forEach((n=>{const r=e[n];let a;for(r.lastIndex=0;a=r.exec(t);)if(a){const t=a[0];s.push({pattern:"regex",token:t,i:a.index,j:a.index+a[0].length-1,regexName:n,regexMatch:a})}})),r(s)}}var R={nCk(t,e){let s=t;if(e>s)return 0;if(0===e)return 1;let n=1;for(let t=1;t<=e;t+=1)n*=s,n/=t,s-=1;return n},log10:t=>0===t?0:Math.log(t)/Math.log(10),log2:t=>Math.log(t)/Math.log(2),factorial(t){let e=1;for(let s=2;s<=t;s+=1)e*=s;return e}};const O=(t,e)=>{let s=0,n=t.indexOf(e);for(;n>=0;)s+=1,n=t.indexOf(e,n+e.length);return s};const N={bruteforce:({token:t})=>{let e,s=10**t.length;return s===Number.POSITIVE_INFINITY&&(s=Number.MAX_VALUE),e=1===t.length?11:51,Math.max(s,e)},date:({year:t,separator:e})=>{let s=365*Math.max(Math.abs(t-b),20);return e&&(s*=4),s},dictionary:({rank:t,reversed:e,l33t:s,subs:n,token:r,dictionaryName:a})=>{const i=t,c=(t=>{const e=t.replace(f,"");if(e.match(d)||e.toLowerCase()===e)return 1;const s=[o,l,h],n=s.length;for(let t=0;t<n;t+=1){const n=s[t];if(e.match(n))return 2}return(t=>{const e=t.split(""),s=e.filter((t=>t.match(p))).length,n=e.filter((t=>t.match(g))).length;let r=0;const a=Math.min(s,n);for(let t=1;t<=a;t+=1)r+=R.nCk(s+n,t);return r})(e)})(r),u=(({l33t:t,subs:e,token:s})=>{if(!t)return 1;let n=1;return e.forEach((t=>{const{subbedCount:e,unsubbedCount:r}=(({sub:t,token:e})=>{const s=e.toLowerCase();return{subbedCount:O(s,t.substitution),unsubbedCount:O(s,t.letter)}})({sub:t,token:s});if(0===e||0===r)n*=2;else{const t=Math.min(r,e);let s=0;for(let n=1;n<=t;n+=1)s+=R.nCk(r+e,n);n*=s}})),n})({l33t:s,subs:n,token:r});let m;return m="diceware"===a?3888:i*c*u*(e?2:1),{baseGuesses:i,uppercaseVariations:c,l33tVariations:u,calculation:m}},regex:({regexName:t,regexMatch:e,token:s})=>{const n={alphaLower:26,alphaUpper:26,alpha:52,alphanumeric:62,digits:10,symbols:33};return t in n?n[t]**s.length:"recentYear"===t?Math.max(Math.abs(parseInt(e[0],10)-b),20):0},repeat:({baseGuesses:t,repeatCount:e})=>t*e,sequence:({token:t,ascending:e})=>{const s=t.charAt(0);let n=0;return n=["a","A","z","Z","0","1","9"].includes(s)?4:s.match(/\d/)?10:26,e||(n*=2),n*t.length},spatial:({graph:t,token:e,shiftedCount:s,turns:n})=>{let r=(({token:t,graph:e,turns:s})=>{const n=Object.keys(A.graphs[e]).length,r=(t=>{let e=0;return Object.keys(t).forEach((s=>{const n=t[s];e+=n.filter((t=>!!t)).length})),e/=Object.entries(t).length,e})(A.graphs[e]);let a=0;const i=t.length;for(let t=2;t<=i;t+=1){const e=Math.min(s,t-1);for(let s=1;s<=e;s+=1)a+=R.nCk(t-1,s-1)*n*r**s}return a})({token:e,graph:t,turns:n});if(s){const t=e.length-s;if(0===s||0===t)r*=2;else{let e=0;for(let n=1;n<=Math.min(s,t);n+=1)e+=R.nCk(s+t,n);r*=e}}return Math.round(r)},separator:()=>w};const F={password:"",optimal:{},excludeAdditive:!1,separatorRegex:void 0,fillArray(t,e){const s=[];for(let n=0;n<t;n+=1){let t=[];"object"===e&&(t={}),s.push(t)}return s},makeBruteforceMatch(t,e){return{pattern:"bruteforce",token:this.password.slice(t,+e+1||9e9),i:t,j:e}},update(t,e){const s=t.j,n=((t,e)=>{const s={};if("guesses"in t&&null!=t.guesses)return t;const n=((t,e)=>{let s=1;return t.token.length<e.length&&(s=1===t.token.length?10:50),s})(t,e),r=((t,e)=>N[t]?N[t](e):A.matchers[t]&&"scoring"in A.matchers[t]?A.matchers[t].scoring(e):0)(t.pattern,t);let a=0;"number"==typeof r?a=r:"dictionary"===t.pattern&&(a=r.calculation,s.baseGuesses=r.baseGuesses,s.uppercaseVariations=r.uppercaseVariations,s.l33tVariations=r.l33tVariations);const i=Math.max(a,n);return{...t,...s,guesses:i,guessesLog10:R.log10(i)}})(t,this.password);let r=n.guesses;e>1&&(r*=this.optimal.pi[n.i-1][e-1]);let a=R.factorial(e)*r;this.excludeAdditive||(a+=1e4**(e-1));let i=!1;Object.keys(this.optimal.g[s]).forEach((t=>{const n=this.optimal.g[s][t];parseInt(t,10)<=e&&n<=a&&(i=!0)})),i||(this.optimal.g[s][e]=a,this.optimal.m[s][e]=n,this.optimal.pi[s][e]=r)},bruteforceUpdate(t){let e=this.makeBruteforceMatch(0,t);this.update(e,1);for(let s=1;s<=t;s+=1){e=this.makeBruteforceMatch(s,t);const n=this.optimal.m[s-1];Object.keys(n).forEach((t=>{"bruteforce"!==n[t].pattern&&this.update(e,parseInt(t,10)+1)}))}},unwind(t){const e=[];let s=t-1,n=0,r=Infinity;const a=this.optimal.g[s];for(a&&Object.keys(a).forEach((t=>{const e=a[t];e<r&&(n=parseInt(t,10),r=e)}));s>=0;){const t=this.optimal.m[s][n];e.unshift(t),s=t.i-1,n-=1}return e}};var q={mostGuessableMatchSequence(t,e,s=!1){F.password=t,F.excludeAdditive=s;const n=t.length;let r=F.fillArray(n,"array");e.forEach((t=>{r[t.j].push(t)})),r=r.map((t=>t.sort(((t,e)=>t.i-e.i)))),F.optimal={m:F.fillArray(n,"object"),pi:F.fillArray(n,"object"),g:F.fillArray(n,"object")};for(let t=0;t<n;t+=1)r[t].forEach((t=>{t.i>0?Object.keys(F.optimal.m[t.i-1]).forEach((e=>{F.update(t,parseInt(e,10)+1)})):F.update(t,1)})),F.bruteforceUpdate(t);const a=F.unwind(n),i=a.length,o=this.getGuesses(t,i);return{password:t,guesses:o,guessesLog10:R.log10(o),sequence:a}},getGuesses(t,e){const s=t.length;let n=0;return n=0===t.length?1:F.optimal.g[s-1][e],n}};class z{match({password:t,omniMatch:e}){const s=[];let n=0;for(;n<t.length;){const r=this.getGreedyMatch(t,n),a=this.getLazyMatch(t,n);if(null==r)break;const{match:i,baseToken:o}=this.setMatchToken(r,a);if(i){const t=i.index+i[0].length-1,r=this.getBaseGuesses(o,e);s.push(this.normalizeMatch(o,t,i,r)),n=t+1}}return s.some((t=>t instanceof Promise))?Promise.all(s):s}normalizeMatch(t,e,s,n){const r={pattern:"repeat",i:s.index,j:e,token:s[0],baseToken:t,baseGuesses:0,repeatCount:s[0].length/t.length};return n instanceof Promise?n.then((t=>({...r,baseGuesses:t}))):{...r,baseGuesses:n}}getGreedyMatch(t,e){const s=/(.+)\1+/g;return s.lastIndex=e,s.exec(t)}getLazyMatch(t,e){const s=/(.+?)\1+/g;return s.lastIndex=e,s.exec(t)}setMatchToken(t,e){const s=/^(.+?)\1+$/;let n,r="";if(e&&t[0].length>e[0].length){n=t;const e=s.exec(n[0]);e&&(r=e[1])}else n=e,n&&(r=n[1]);return{match:n,baseToken:r}}getBaseGuesses(t,e){const s=e.match(t);return s instanceof Promise?s.then((e=>q.mostGuessableMatchSequence(t,e).guesses)):q.mostGuessableMatchSequence(t,s).guesses}}class W{constructor(){this.MAX_DELTA=5}match({password:t}){const e=[];if(1===t.length)return[];let s=0,n=null;const r=t.length;for(let a=1;a<r;a+=1){const r=t.charCodeAt(a)-t.charCodeAt(a-1);if(null==n&&(n=r),r!==n){const i=a-1;this.update({i:s,j:i,delta:n,password:t,result:e}),s=i,n=r}}return this.update({i:s,j:r-1,delta:n,password:t,result:e}),e}update({i:t,j:e,delta:s,password:n,result:r}){if(e-t>1||1===Math.abs(s)){const a=Math.abs(s);if(a>0&&a<=this.MAX_DELTA){const a=n.slice(t,+e+1||9e9),{sequenceName:i,sequenceSpace:o}=this.getSequence(a);return r.push({pattern:"sequence",i:t,j:e,token:n.slice(t,+e+1||9e9),sequenceName:i,sequenceSpace:o,ascending:s>0})}}return null}getSequence(t){let e="unicode",s=26;return u.test(t)?(e="lower",s=26):c.test(t)?(e="upper",s=26):m.test(t)&&(e="digits",s=10),{sequenceName:e,sequenceSpace:s}}}class Y{constructor(){this.SHIFTED_RX=/[~!@#$%^&*()_+QWERTYUIOP{}|ASDFGHJKL:"ZXCVBNM<>?]/}match({password:t}){const e=[];return Object.keys(A.graphs).forEach((s=>{const r=A.graphs[s];n(e,this.helper(t,r,s))})),r(e)}checkIfShifted(t,e,s){return!t.includes("keypad")&&this.SHIFTED_RX.test(e.charAt(s))?1:0}helper(t,e,s){let n;const r=[];let a=0;const i=t.length;for(;a<i-1;){let o=a+1,l=null,c=0;for(n=this.checkIfShifted(s,t,a);;){const h=e[t.charAt(o-1)]||[];let u=!1,d=-1,g=-1;if(o<i){const e=t.charAt(o),s=h.length;for(let t=0;t<s;t+=1){const s=h[t];if(g+=1,s){const t=s.indexOf(e);if(-1!==t){u=!0,d=g,1===t&&(n+=1),l!==d&&(c+=1,l=d);break}}}}if(!u){o-a>2&&r.push({pattern:"spatial",i:a,j:o-1,token:t.slice(a,o),graph:s,turns:c,shiftedCount:n}),a=o;break}o+=1}}return r}}const $=new RegExp(`[${k.join("")}]`);class G{static getMostUsedSeparatorChar(t){const e=[...t.split("").filter((t=>$.test(t))).reduce(((t,e)=>{const s=t.get(e);return s?t.set(e,s+1):t.set(e,1),t}),new Map).entries()].sort((([t,e],[s,n])=>n-e));if(!e.length)return;const s=e[0];return s[1]<2?void 0:s[0]}static getSeparatorRegex(t){return new RegExp(`([^${t}\n])(${t})(?!${t})`,"g")}match({password:t}){const e=[];if(0===t.length)return e;const s=G.getMostUsedSeparatorChar(t);if(void 0===s)return e;const n=G.getSeparatorRegex(s);for(const r of t.matchAll(n)){if(void 0===r.index)continue;const t=r.index+1;e.push({pattern:"separator",token:s,i:t,j:t})}return e}}class U{constructor(){this.matchers={date:x,dictionary:L,regex:P,repeat:z,sequence:W,spatial:Y,separator:G}}match(t){const e=[],s=[];return[...Object.keys(this.matchers),...Object.keys(A.matchers)].forEach((r=>{if(!this.matchers[r]&&!A.matchers[r])return;const a=(new(this.matchers[r]?this.matchers[r]:A.matchers[r].Matching)).match({password:t,omniMatch:this});a instanceof Promise?(a.then((t=>{n(e,t)})),s.push(a)):n(e,a)})),s.length>0?new Promise(((t,n)=>{Promise.all(s).then((()=>{t(r(e))})).catch((t=>{n(t)}))})):r(e)}}const B=32140800,H={second:1,minute:60,hour:3600,day:86400,month:2678400,year:B,century:100*B};class Z{translate(t,e){let s=t;void 0!==e&&1!==e&&(s+="s");const{timeEstimation:n}=A.translations;return n[s].replace("{base}",`${e}`)}estimateAttackTimes(t){const e={onlineThrottling100PerHour:t/(100/3600),onlineNoThrottling10PerSecond:t/10,offlineSlowHashing1e4PerSecond:t/1e4,offlineFastHashing1e10PerSecond:t/1e10},s={onlineThrottling100PerHour:"",onlineNoThrottling10PerSecond:"",offlineSlowHashing1e4PerSecond:"",offlineFastHashing1e10PerSecond:""};return Object.keys(e).forEach((t=>{const n=e[t];s[t]=this.displayTime(n)})),{crackTimesSeconds:e,crackTimesDisplay:s,score:this.guessesToScore(t)}}guessesToScore(t){return t<1005?0:t<1000005?1:t<100000005?2:t<10000000005?3:4}displayTime(t){let e,s="centuries";const n=Object.keys(H),r=n.findIndex((e=>t<H[e]));return r>-1&&(s=n[r-1],0!==r?e=Math.round(t/H[s]):s="ltSecond"),this.translate(s,e)}}var _=()=>null,V=()=>({warning:A.translations.warnings.dates,suggestions:[A.translations.suggestions.dates]});var X=(t,e)=>{const s=((t,e)=>{let s=null;const n=t.dictionaryName,r="lastnames"===n||n.toLowerCase().includes("firstnames");return"passwords"===n?s=((t,e)=>{let s=null;return!e||t.l33t||t.reversed?t.guessesLog10<=4&&(s=A.translations.warnings.similarToCommon):s=t.rank<=10?A.translations.warnings.topTen:t.rank<=100?A.translations.warnings.topHundred:A.translations.warnings.common,s})(t,e):n.includes("wikipedia")?s=((t,e)=>{let s=null;return e&&(s=A.translations.warnings.wordByItself),s})(0,e):r?s=((t,e)=>e?A.translations.warnings.namesByThemselves:A.translations.warnings.commonNames)(0,e):"userInputs"===n&&(s=A.translations.warnings.userInputs),s})(t,e),n=[],r=t.token;return r.match(o)?n.push(A.translations.suggestions.capitalization):r.match(h)&&r.toLowerCase()!==r&&n.push(A.translations.suggestions.allUppercase),t.reversed&&t.token.length>=4&&n.push(A.translations.suggestions.reverseWords),t.l33t&&n.push(A.translations.suggestions.l33t),{warning:s,suggestions:n}},K=t=>"recentYear"===t.regexName?{warning:A.translations.warnings.recentYears,suggestions:[A.translations.suggestions.recentYears,A.translations.suggestions.associatedYears]}:{warning:null,suggestions:[]},J=t=>{let e=A.translations.warnings.extendedRepeat;return 1===t.baseToken.length&&(e=A.translations.warnings.simpleRepeat),{warning:e,suggestions:[A.translations.suggestions.repeated]}},Q=()=>({warning:A.translations.warnings.sequences,suggestions:[A.translations.suggestions.sequences]}),tt=t=>{let e=A.translations.warnings.keyPattern;return 1===t.turns&&(e=A.translations.warnings.straightRow),{warning:e,suggestions:[A.translations.suggestions.longerKeyboardPattern]}},et=()=>null;const st={warning:null,suggestions:[]};class nt{constructor(){this.matchers={bruteforce:_,date:V,dictionary:X,regex:K,repeat:J,sequence:Q,spatial:tt,separator:et},this.defaultFeedback={warning:null,suggestions:[]},this.setDefaultSuggestions()}setDefaultSuggestions(){this.defaultFeedback.suggestions.push(A.translations.suggestions.useWords,A.translations.suggestions.noNeed)}getFeedback(t,e){if(0===e.length)return this.defaultFeedback;if(t>2)return st;const s=A.translations.suggestions.anotherWord,n=this.getLongestMatch(e);let r=this.getMatchFeedback(n,1===e.length);return null!=r?r.suggestions.unshift(s):r={warning:null,suggestions:[s]},r}getLongestMatch(t){let e=t[0];return t.slice(1).forEach((t=>{t.token.length>e.token.length&&(e=t)})),e}getMatchFeedback(t,e){return this.matchers[t.pattern]?this.matchers[t.pattern](t,e):A.matchers[t.pattern]&&"feedback"in A.matchers[t.pattern]?A.matchers[t.pattern].feedback(t,e):st}}const rt=()=>(new Date).getTime(),at=(t,e)=>{const s=rt(),n=((t,e)=>(e&&A.extendUserInputsDictionary(e),(new U).match(t)))(t,e);if(n instanceof Promise)throw new Error("You are using a Promised matcher, please use `zxcvbnAsync` for it.");return((t,e,s)=>{const n=new nt,r=new Z,a=q.mostGuessableMatchSequence(e,t),i=rt()-s,o=r.estimateAttackTimes(a.guesses);return{calcTime:i,...a,...o,feedback:n.getFeedback(o.score,a.sequence)}})(n,t,s)}}};
|