use-mmdb-vanilla 1.0.1 → 1.1.0
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/README.md +6 -219
- package/dist/index.cjs.js +3 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.es.js +260 -292
- package/dist/index.es.js.map +1 -1
- package/dist/index.iife.js +3 -3
- package/dist/index.iife.js.map +1 -1
- package/dist/index.umd.js +3 -3
- package/dist/index.umd.js.map +1 -1
- package/package.json +11 -7
package/dist/index.iife.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
var mylib=function(rt){"use strict";var P=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ft={},W={},X={};X.byteLength=Mt,X.toByteArray=Pt,X.fromByteArray=Nt;for(var T=[],L=[],Rt=typeof Uint8Array<"u"?Uint8Array:Array,et="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",G=0,St=et.length;G<St;++G)T[G]=et[G],L[et.charCodeAt(G)]=G;L[45]=62,L[95]=63;function lt(u){var o=u.length;if(o%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var h=u.indexOf("=");h===-1&&(h=o);var f=h===o?0:4-h%4;return[h,f]}function Mt(u){var o=lt(u),h=o[0],f=o[1];return(h+f)*3/4-f}function Ct(u,o,h){return(o+h)*3/4-h}function Pt(u){var o,h=lt(u),f=h[0],l=h[1],d=new Rt(Ct(u,f,l)),p=0,c=l>0?f-4:f,x;for(x=0;x<c;x+=4)o=L[u.charCodeAt(x)]<<18|L[u.charCodeAt(x+1)]<<12|L[u.charCodeAt(x+2)]<<6|L[u.charCodeAt(x+3)],d[p++]=o>>16&255,d[p++]=o>>8&255,d[p++]=o&255;return l===2&&(o=L[u.charCodeAt(x)]<<2|L[u.charCodeAt(x+1)]>>4,d[p++]=o&255),l===1&&(o=L[u.charCodeAt(x)]<<10|L[u.charCodeAt(x+1)]<<4|L[u.charCodeAt(x+2)]>>2,d[p++]=o>>8&255,d[p++]=o&255),d}function Lt(u){return T[u>>18&63]+T[u>>12&63]+T[u>>6&63]+T[u&63]}function Tt(u,o,h){for(var f,l=[],d=o;d<h;d+=3)f=(u[d]<<16&16711680)+(u[d+1]<<8&65280)+(u[d+2]&255),l.push(Lt(f));return l.join("")}function Nt(u){for(var o,h=u.length,f=h%3,l=[],d=16383,p=0,c=h-f;p<c;p+=d)l.push(Tt(u,p,p+d>c?c:p+d));return f===1?(o=u[h-1],l.push(T[o>>2]+T[o<<4&63]+"==")):f===2&&(o=(u[h-2]<<8)+u[h-1],l.push(T[o>>10]+T[o>>4&63]+T[o<<2&63]+"=")),l.join("")}var nt={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */nt.read=function(u,o,h,f,l){var d,p,c=l*8-f-1,x=(1<<c)-1,m=x>>1,E=-7,g=h?l-1:0,y=h?-1:1,w=u[o+g];for(g+=y,d=w&(1<<-E)-1,w>>=-E,E+=c;E>0;d=d*256+u[o+g],g+=y,E-=8);for(p=d&(1<<-E)-1,d>>=-E,E+=f;E>0;p=p*256+u[o+g],g+=y,E-=8);if(d===0)d=1-m;else{if(d===x)return p?NaN:(w?-1:1)*(1/0);p=p+Math.pow(2,f),d=d-m}return(w?-1:1)*p*Math.pow(2,d-f)},nt.write=function(u,o,h,f,l,d){var p,c,x,m=d*8-l-1,E=(1<<m)-1,g=E>>1,y=l===23?Math.pow(2,-24)-Math.pow(2,-77):0,w=f?0:d-1,_=f?1:-1,S=o<0||o===0&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(c=isNaN(o)?1:0,p=E):(p=Math.floor(Math.log(o)/Math.LN2),o*(x=Math.pow(2,-p))<1&&(p--,x*=2),p+g>=1?o+=y/x:o+=y*Math.pow(2,1-g),o*x>=2&&(p++,x/=2),p+g>=E?(c=0,p=E):p+g>=1?(c=(o*x-1)*Math.pow(2,l),p=p+g):(c=o*Math.pow(2,g-1)*Math.pow(2,l),p=0));l>=8;u[h+w]=c&255,w+=_,c/=256,l-=8);for(p=p<<l|c,m+=l;m>0;u[h+w]=p&255,w+=_,p/=256,m-=8);u[h+w-_]|=S*128};/*!
|
|
2
2
|
* The buffer module from node.js, for the browser.
|
|
3
3
|
*
|
|
4
4
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
5
5
|
* @license MIT
|
|
6
|
-
*/(function(u){const o=X,s=et,f=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;u.Buffer=c,u.SlowBuffer=q,u.INSPECT_MAX_BYTES=50;const l=2147483647;u.kMaxLength=l,c.TYPED_ARRAY_SUPPORT=d(),!c.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function d(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}});function p(e){if(e>l)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,r){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return B(e)}return g(e,t,r)}c.poolSize=8192;function g(e,t,r){if(typeof e=="string")return w(e,t);if(ArrayBuffer.isView(e))return _(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(k(e,ArrayBuffer)||e&&k(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(k(e,SharedArrayBuffer)||e&&k(e.buffer,SharedArrayBuffer)))return S(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return c.from(n,t,r);const i=v(e);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return c.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}c.from=function(e,t,r){return g(e,t,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array);function m(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function E(e,t,r){return m(e),e<=0?p(e):t!==void 0?typeof r=="string"?p(e).fill(t,r):p(e).fill(t):p(e)}c.alloc=function(e,t,r){return E(e,t,r)};function B(e){return m(e),p(e<0?0:N(e)|0)}c.allocUnsafe=function(e){return B(e)},c.allocUnsafeSlow=function(e){return B(e)};function w(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=O(e,t)|0;let n=p(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function y(e){const t=e.length<0?0:N(e.length)|0,r=p(t);for(let n=0;n<t;n+=1)r[n]=e[n]&255;return r}function _(e){if(k(e,Uint8Array)){const t=new Uint8Array(e);return S(t.buffer,t.byteOffset,t.byteLength)}return y(e)}function S(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return t===void 0&&r===void 0?n=new Uint8Array(e):r===void 0?n=new Uint8Array(e,t):n=new Uint8Array(e,t,r),Object.setPrototypeOf(n,c.prototype),n}function v(e){if(c.isBuffer(e)){const t=N(e.length)|0,r=p(t);return r.length===0||e.copy(r,0,0,t),r}if(e.length!==void 0)return typeof e.length!="number"||st(e.length)?p(0):y(e);if(e.type==="Buffer"&&Array.isArray(e.data))return y(e.data)}function N(e){if(e>=l)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+l.toString(16)+" bytes");return e|0}function q(e){return+e!=e&&(e=0),c.alloc(+e)}c.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==c.prototype},c.compare=function(t,r){if(k(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),k(r,Uint8Array)&&(r=c.from(r,r.offset,r.byteLength)),!c.isBuffer(t)||!c.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===r)return 0;let n=t.length,i=r.length;for(let a=0,h=Math.min(n,i);a<h;++a)if(t[a]!==r[a]){n=t[a],i=r[a];break}return n<i?-1:i<n?1:0},c.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(t,r){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return c.alloc(0);let n;if(r===void 0)for(r=0,n=0;n<t.length;++n)r+=t[n].length;const i=c.allocUnsafe(r);let a=0;for(n=0;n<t.length;++n){let h=t[n];if(k(h,Uint8Array))a+h.length>i.length?(c.isBuffer(h)||(h=c.from(h)),h.copy(i,a)):Uint8Array.prototype.set.call(i,h,a);else if(c.isBuffer(h))h.copy(i,a);else throw new TypeError('"list" argument must be an Array of Buffers');a+=h.length}return i};function O(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||k(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return at(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Ut(e).length;default:if(i)return n?-1:at(e).length;t=(""+t).toLowerCase(),i=!0}}c.byteLength=O;function ar(e,t,r){let n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return xr(this,t,r);case"utf8":case"utf-8":return yt(this,t,r);case"ascii":return yr(this,t,r);case"latin1":case"binary":return Br(this,t,r);case"base64":return pr(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return gr(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}c.prototype._isBuffer=!0;function j(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}c.prototype.swap16=function(){const t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;r<t;r+=2)j(this,r,r+1);return this},c.prototype.swap32=function(){const t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<t;r+=4)j(this,r,r+3),j(this,r+1,r+2);return this},c.prototype.swap64=function(){const t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<t;r+=8)j(this,r,r+7),j(this,r+1,r+6),j(this,r+2,r+5),j(this,r+3,r+4);return this},c.prototype.toString=function(){const t=this.length;return t===0?"":arguments.length===0?yt(this,0,t):ar.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:c.compare(this,t)===0},c.prototype.inspect=function(){let t="";const r=u.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},f&&(c.prototype[f]=c.prototype.inspect),c.prototype.compare=function(t,r,n,i,a){if(k(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(r===void 0&&(r=0),n===void 0&&(n=t?t.length:0),i===void 0&&(i=0),a===void 0&&(a=this.length),r<0||n>t.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&r>=n)return 0;if(i>=a)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,a>>>=0,this===t)return 0;let h=a-i,x=n-r;const A=Math.min(h,x),F=this.slice(i,a),U=t.slice(r,n);for(let I=0;I<A;++I)if(F[I]!==U[I]){h=F[I],x=U[I];break}return h<x?-1:x<h?1:0};function pt(e,t,r,n,i){if(e.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,st(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof t=="string"&&(t=c.from(t,n)),c.isBuffer(t))return t.length===0?-1:wt(e,t,r,n,i);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):wt(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function wt(e,t,r,n,i){let a=1,h=e.length,x=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;a=2,h/=2,x/=2,r/=2}function A(U,I){return a===1?U[I]:U.readUInt16BE(I*a)}let F;if(i){let U=-1;for(F=r;F<h;F++)if(A(e,F)===A(t,U===-1?0:F-U)){if(U===-1&&(U=F),F-U+1===x)return U*a}else U!==-1&&(F-=F-U),U=-1}else for(r+x>h&&(r=h-x),F=r;F>=0;F--){let U=!0;for(let I=0;I<x;I++)if(A(e,F+I)!==A(t,I)){U=!1;break}if(U)return F}return-1}c.prototype.includes=function(t,r,n){return this.indexOf(t,r,n)!==-1},c.prototype.indexOf=function(t,r,n){return pt(this,t,r,n,!0)},c.prototype.lastIndexOf=function(t,r,n){return pt(this,t,r,n,!1)};function sr(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;const a=t.length;n>a/2&&(n=a/2);let h;for(h=0;h<n;++h){const x=parseInt(t.substr(h*2,2),16);if(st(x))return h;e[r+h]=x}return h}function hr(e,t,r,n){return tt(at(t,e.length-r),e,r,n)}function fr(e,t,r,n){return tt(Fr(t),e,r,n)}function lr(e,t,r,n){return tt(Ut(t),e,r,n)}function dr(e,t,r,n){return tt(Ar(t,e.length-r),e,r,n)}c.prototype.write=function(t,r,n,i){if(r===void 0)i="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")i=r,n=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const a=this.length-r;if((n===void 0||n>a)&&(n=a),t.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let h=!1;for(;;)switch(i){case"hex":return sr(this,t,r,n);case"utf8":case"utf-8":return hr(this,t,r,n);case"ascii":case"latin1":case"binary":return fr(this,t,r,n);case"base64":return lr(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return dr(this,t,r,n);default:if(h)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),h=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function pr(e,t,r){return t===0&&r===e.length?o.fromByteArray(e):o.fromByteArray(e.slice(t,r))}function yt(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const a=e[i];let h=null,x=a>239?4:a>223?3:a>191?2:1;if(i+x<=r){let A,F,U,I;switch(x){case 1:a<128&&(h=a);break;case 2:A=e[i+1],(A&192)===128&&(I=(a&31)<<6|A&63,I>127&&(h=I));break;case 3:A=e[i+1],F=e[i+2],(A&192)===128&&(F&192)===128&&(I=(a&15)<<12|(A&63)<<6|F&63,I>2047&&(I<55296||I>57343)&&(h=I));break;case 4:A=e[i+1],F=e[i+2],U=e[i+3],(A&192)===128&&(F&192)===128&&(U&192)===128&&(I=(a&15)<<18|(A&63)<<12|(F&63)<<6|U&63,I>65535&&I<1114112&&(h=I))}}h===null?(h=65533,x=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|h&1023),n.push(h),i+=x}return wr(n)}const Bt=4096;function wr(e){const t=e.length;if(t<=Bt)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=Bt));return r}function yr(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]&127);return n}function Br(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function xr(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let a=t;a<r;++a)i+=Ur[e[a]];return i}function gr(e,t,r){const n=e.slice(t,r);let i="";for(let a=0;a<n.length-1;a+=2)i+=String.fromCharCode(n[a]+n[a+1]*256);return i}c.prototype.slice=function(t,r){const n=this.length;t=~~t,r=r===void 0?n:~~r,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<t&&(r=t);const i=this.subarray(t,r);return Object.setPrototypeOf(i,c.prototype),i};function R(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUintLE=c.prototype.readUIntLE=function(t,r,n){t=t>>>0,r=r>>>0,n||R(t,r,this.length);let i=this[t],a=1,h=0;for(;++h<r&&(a*=256);)i+=this[t+h]*a;return i},c.prototype.readUintBE=c.prototype.readUIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||R(t,r,this.length);let i=this[t+--r],a=1;for(;r>0&&(a*=256);)i+=this[t+--r]*a;return i},c.prototype.readUint8=c.prototype.readUInt8=function(t,r){return t=t>>>0,r||R(t,1,this.length),this[t]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(t,r){return t=t>>>0,r||R(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(t,r){return t=t>>>0,r||R(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(t,r){return t=t>>>0,r||R(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(t,r){return t=t>>>0,r||R(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readBigUInt64LE=$(function(t){t=t>>>0,V(t,"offset");const r=this[t],n=this[t+7];(r===void 0||n===void 0)&&H(t,this.length-8);const i=r+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,a=this[++t]+this[++t]*2**8+this[++t]*2**16+n*2**24;return BigInt(i)+(BigInt(a)<<BigInt(32))}),c.prototype.readBigUInt64BE=$(function(t){t=t>>>0,V(t,"offset");const r=this[t],n=this[t+7];(r===void 0||n===void 0)&&H(t,this.length-8);const i=r*2**24+this[++t]*2**16+this[++t]*2**8+this[++t],a=this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n;return(BigInt(i)<<BigInt(32))+BigInt(a)}),c.prototype.readIntLE=function(t,r,n){t=t>>>0,r=r>>>0,n||R(t,r,this.length);let i=this[t],a=1,h=0;for(;++h<r&&(a*=256);)i+=this[t+h]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*r)),i},c.prototype.readIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||R(t,r,this.length);let i=r,a=1,h=this[t+--i];for(;i>0&&(a*=256);)h+=this[t+--i]*a;return a*=128,h>=a&&(h-=Math.pow(2,8*r)),h},c.prototype.readInt8=function(t,r){return t=t>>>0,r||R(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]},c.prototype.readInt16LE=function(t,r){t=t>>>0,r||R(t,2,this.length);const n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n},c.prototype.readInt16BE=function(t,r){t=t>>>0,r||R(t,2,this.length);const n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n},c.prototype.readInt32LE=function(t,r){return t=t>>>0,r||R(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,r){return t=t>>>0,r||R(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readBigInt64LE=$(function(t){t=t>>>0,V(t,"offset");const r=this[t],n=this[t+7];(r===void 0||n===void 0)&&H(t,this.length-8);const i=this[t+4]+this[t+5]*2**8+this[t+6]*2**16+(n<<24);return(BigInt(i)<<BigInt(32))+BigInt(r+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24)}),c.prototype.readBigInt64BE=$(function(t){t=t>>>0,V(t,"offset");const r=this[t],n=this[t+7];(r===void 0||n===void 0)&&H(t,this.length-8);const i=(r<<24)+this[++t]*2**16+this[++t]*2**8+this[++t];return(BigInt(i)<<BigInt(32))+BigInt(this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n)}),c.prototype.readFloatLE=function(t,r){return t=t>>>0,r||R(t,4,this.length),s.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,r){return t=t>>>0,r||R(t,4,this.length),s.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,r){return t=t>>>0,r||R(t,8,this.length),s.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,r){return t=t>>>0,r||R(t,8,this.length),s.read(this,t,!1,52,8)};function M(e,t,r,n,i,a){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}c.prototype.writeUintLE=c.prototype.writeUIntLE=function(t,r,n,i){if(t=+t,r=r>>>0,n=n>>>0,!i){const x=Math.pow(2,8*n)-1;M(this,t,r,n,x,0)}let a=1,h=0;for(this[r]=t&255;++h<n&&(a*=256);)this[r+h]=t/a&255;return r+n},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(t,r,n,i){if(t=+t,r=r>>>0,n=n>>>0,!i){const x=Math.pow(2,8*n)-1;M(this,t,r,n,x,0)}let a=n-1,h=1;for(this[r+a]=t&255;--a>=0&&(h*=256);)this[r+a]=t/h&255;return r+n},c.prototype.writeUint8=c.prototype.writeUInt8=function(t,r,n){return t=+t,r=r>>>0,n||M(this,t,r,1,255,0),this[r]=t&255,r+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||M(this,t,r,2,65535,0),this[r]=t&255,this[r+1]=t>>>8,r+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||M(this,t,r,2,65535,0),this[r]=t>>>8,this[r+1]=t&255,r+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||M(this,t,r,4,4294967295,0),this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=t&255,r+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||M(this,t,r,4,4294967295,0),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};function xt(e,t,r,n,i){At(t,n,i,e,r,7);let a=Number(t&BigInt(4294967295));e[r++]=a,a=a>>8,e[r++]=a,a=a>>8,e[r++]=a,a=a>>8,e[r++]=a;let h=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=h,h=h>>8,e[r++]=h,h=h>>8,e[r++]=h,h=h>>8,e[r++]=h,r}function gt(e,t,r,n,i){At(t,n,i,e,r,7);let a=Number(t&BigInt(4294967295));e[r+7]=a,a=a>>8,e[r+6]=a,a=a>>8,e[r+5]=a,a=a>>8,e[r+4]=a;let h=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=h,h=h>>8,e[r+2]=h,h=h>>8,e[r+1]=h,h=h>>8,e[r]=h,r+8}c.prototype.writeBigUInt64LE=$(function(t,r=0){return xt(this,t,r,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=$(function(t,r=0){return gt(this,t,r,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(t,r,n,i){if(t=+t,r=r>>>0,!i){const A=Math.pow(2,8*n-1);M(this,t,r,n,A-1,-A)}let a=0,h=1,x=0;for(this[r]=t&255;++a<n&&(h*=256);)t<0&&x===0&&this[r+a-1]!==0&&(x=1),this[r+a]=(t/h>>0)-x&255;return r+n},c.prototype.writeIntBE=function(t,r,n,i){if(t=+t,r=r>>>0,!i){const A=Math.pow(2,8*n-1);M(this,t,r,n,A-1,-A)}let a=n-1,h=1,x=0;for(this[r+a]=t&255;--a>=0&&(h*=256);)t<0&&x===0&&this[r+a+1]!==0&&(x=1),this[r+a]=(t/h>>0)-x&255;return r+n},c.prototype.writeInt8=function(t,r,n){return t=+t,r=r>>>0,n||M(this,t,r,1,127,-128),t<0&&(t=255+t+1),this[r]=t&255,r+1},c.prototype.writeInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||M(this,t,r,2,32767,-32768),this[r]=t&255,this[r+1]=t>>>8,r+2},c.prototype.writeInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||M(this,t,r,2,32767,-32768),this[r]=t>>>8,this[r+1]=t&255,r+2},c.prototype.writeInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||M(this,t,r,4,2147483647,-2147483648),this[r]=t&255,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24,r+4},c.prototype.writeInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||M(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4},c.prototype.writeBigInt64LE=$(function(t,r=0){return xt(this,t,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=$(function(t,r=0){return gt(this,t,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Et(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function mt(e,t,r,n,i){return t=+t,r=r>>>0,i||Et(e,t,r,4),s.write(e,t,r,n,23,4),r+4}c.prototype.writeFloatLE=function(t,r,n){return mt(this,t,r,!0,n)},c.prototype.writeFloatBE=function(t,r,n){return mt(this,t,r,!1,n)};function It(e,t,r,n,i){return t=+t,r=r>>>0,i||Et(e,t,r,8),s.write(e,t,r,n,52,8),r+8}c.prototype.writeDoubleLE=function(t,r,n){return It(this,t,r,!0,n)},c.prototype.writeDoubleBE=function(t,r,n){return It(this,t,r,!1,n)},c.prototype.copy=function(t,r,n,i){if(!c.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),r>=t.length&&(r=t.length),r||(r=0),i>0&&i<n&&(i=n),i===n||t.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-r<i-n&&(i=t.length-r+n);const a=i-n;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,n,i):Uint8Array.prototype.set.call(t,this.subarray(n,i),r),a},c.prototype.fill=function(t,r,n,i){if(typeof t=="string"){if(typeof r=="string"?(i=r,r=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!c.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(t.length===1){const h=t.charCodeAt(0);(i==="utf8"&&h<128||i==="latin1")&&(t=h)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);let a;if(typeof t=="number")for(a=r;a<n;++a)this[a]=t;else{const h=c.isBuffer(t)?t:c.from(t,i),x=h.length;if(x===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(a=0;a<n-r;++a)this[a+r]=h[a%x]}return this};const z={};function ct(e,t,r){z[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(i){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:i,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}ct("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),ct("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),ct("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=Ft(String(r)):typeof r=="bigint"&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=Ft(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);function Ft(e){let t="",r=e.length;const n=e[0]==="-"?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function Er(e,t,r){V(t,"offset"),(e[t]===void 0||e[t+r]===void 0)&&H(t,e.length-(r+1))}function At(e,t,r,n,i,a){if(e>r||e<t){const h=typeof t=="bigint"?"n":"";let x;throw a>3?t===0||t===BigInt(0)?x=`>= 0${h} and < 2${h} ** ${(a+1)*8}${h}`:x=`>= -(2${h} ** ${(a+1)*8-1}${h}) and < 2 ** ${(a+1)*8-1}${h}`:x=`>= ${t}${h} and <= ${r}${h}`,new z.ERR_OUT_OF_RANGE("value",x,e)}Er(n,i,a)}function V(e,t){if(typeof e!="number")throw new z.ERR_INVALID_ARG_TYPE(t,"number",e)}function H(e,t,r){throw Math.floor(e)!==e?(V(e,r),new z.ERR_OUT_OF_RANGE(r||"offset","an integer",e)):t<0?new z.ERR_BUFFER_OUT_OF_BOUNDS:new z.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}const mr=/[^+/0-9A-Za-z-_]/g;function Ir(e){if(e=e.split("=")[0],e=e.trim().replace(mr,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function at(e,t){t=t||1/0;let r;const n=e.length;let i=null;const a=[];for(let h=0;h<n;++h){if(r=e.charCodeAt(h),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}else if(h+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return a}function Fr(e){const t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function Ar(e,t){let r,n,i;const a=[];for(let h=0;h<e.length&&!((t-=2)<0);++h)r=e.charCodeAt(h),n=r>>8,i=r%256,a.push(i),a.push(n);return a}function Ut(e){return o.toByteArray(Ir(e))}function tt(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function k(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function st(e){return e!==e}const Ur=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=r*16;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function $(e){return typeof BigInt>"u"?_r:e}function _r(){throw new Error("BigInt not supported")}})(W);var J={},Y={};Object.defineProperty(Y,"__esModule",{value:!0});const Tt=(u,o)=>u<<8|o,Nt=(u,o,s)=>u<<16|o<<8|s,kt=(u,o,s,f)=>u<<24|o<<16|s<<8|f,Ot=`Maxmind v2 module has changed API.
|
|
6
|
+
*/(function(u){const o=X,h=nt,f=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;u.Buffer=c,u.SlowBuffer=q,u.INSPECT_MAX_BYTES=50;const l=2147483647;u.kMaxLength=l,c.TYPED_ARRAY_SUPPORT=d(),!c.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function d(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}});function p(e){if(e>l)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,r){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return g(e)}return x(e,t,r)}c.poolSize=8192;function x(e,t,r){if(typeof e=="string")return y(e,t);if(ArrayBuffer.isView(e))return _(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(k(e,ArrayBuffer)||e&&k(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(k(e,SharedArrayBuffer)||e&&k(e.buffer,SharedArrayBuffer)))return S(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return c.from(n,t,r);const i=v(e);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return c.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}c.from=function(e,t,r){return x(e,t,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array);function m(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function E(e,t,r){return m(e),e<=0?p(e):t!==void 0?typeof r=="string"?p(e).fill(t,r):p(e).fill(t):p(e)}c.alloc=function(e,t,r){return E(e,t,r)};function g(e){return m(e),p(e<0?0:N(e)|0)}c.allocUnsafe=function(e){return g(e)},c.allocUnsafeSlow=function(e){return g(e)};function y(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=O(e,t)|0;let n=p(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function w(e){const t=e.length<0?0:N(e.length)|0,r=p(t);for(let n=0;n<t;n+=1)r[n]=e[n]&255;return r}function _(e){if(k(e,Uint8Array)){const t=new Uint8Array(e);return S(t.buffer,t.byteOffset,t.byteLength)}return w(e)}function S(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return t===void 0&&r===void 0?n=new Uint8Array(e):r===void 0?n=new Uint8Array(e,t):n=new Uint8Array(e,t,r),Object.setPrototypeOf(n,c.prototype),n}function v(e){if(c.isBuffer(e)){const t=N(e.length)|0,r=p(t);return r.length===0||e.copy(r,0,0,t),r}if(e.length!==void 0)return typeof e.length!="number"||st(e.length)?p(0):w(e);if(e.type==="Buffer"&&Array.isArray(e.data))return w(e.data)}function N(e){if(e>=l)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+l.toString(16)+" bytes");return e|0}function q(e){return+e!=e&&(e=0),c.alloc(+e)}c.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==c.prototype},c.compare=function(t,r){if(k(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),k(r,Uint8Array)&&(r=c.from(r,r.offset,r.byteLength)),!c.isBuffer(t)||!c.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===r)return 0;let n=t.length,i=r.length;for(let a=0,s=Math.min(n,i);a<s;++a)if(t[a]!==r[a]){n=t[a],i=r[a];break}return n<i?-1:i<n?1:0},c.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(t,r){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return c.alloc(0);let n;if(r===void 0)for(r=0,n=0;n<t.length;++n)r+=t[n].length;const i=c.allocUnsafe(r);let a=0;for(n=0;n<t.length;++n){let s=t[n];if(k(s,Uint8Array))a+s.length>i.length?(c.isBuffer(s)||(s=c.from(s)),s.copy(i,a)):Uint8Array.prototype.set.call(i,s,a);else if(c.isBuffer(s))s.copy(i,a);else throw new TypeError('"list" argument must be an Array of Buffers');a+=s.length}return i};function O(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||k(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return ht(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return bt(e).length;default:if(i)return n?-1:ht(e).length;t=(""+t).toLowerCase(),i=!0}}c.byteLength=O;function hr(e,t,r){let n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return xr(this,t,r);case"utf8":case"utf-8":return Bt(this,t,r);case"ascii":return gr(this,t,r);case"latin1":case"binary":return Br(this,t,r);case"base64":return yr(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Er(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}c.prototype._isBuffer=!0;function j(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}c.prototype.swap16=function(){const t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;r<t;r+=2)j(this,r,r+1);return this},c.prototype.swap32=function(){const t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<t;r+=4)j(this,r,r+3),j(this,r+1,r+2);return this},c.prototype.swap64=function(){const t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<t;r+=8)j(this,r,r+7),j(this,r+1,r+6),j(this,r+2,r+5),j(this,r+3,r+4);return this},c.prototype.toString=function(){const t=this.length;return t===0?"":arguments.length===0?Bt(this,0,t):hr.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:c.compare(this,t)===0},c.prototype.inspect=function(){let t="";const r=u.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},f&&(c.prototype[f]=c.prototype.inspect),c.prototype.compare=function(t,r,n,i,a){if(k(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(r===void 0&&(r=0),n===void 0&&(n=t?t.length:0),i===void 0&&(i=0),a===void 0&&(a=this.length),r<0||n>t.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&r>=n)return 0;if(i>=a)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,a>>>=0,this===t)return 0;let s=a-i,B=n-r;const A=Math.min(s,B),F=this.slice(i,a),U=t.slice(r,n);for(let I=0;I<A;++I)if(F[I]!==U[I]){s=F[I],B=U[I];break}return s<B?-1:B<s?1:0};function wt(e,t,r,n,i){if(e.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,st(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof t=="string"&&(t=c.from(t,n)),c.isBuffer(t))return t.length===0?-1:gt(e,t,r,n,i);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):gt(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function gt(e,t,r,n,i){let a=1,s=e.length,B=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;a=2,s/=2,B/=2,r/=2}function A(U,I){return a===1?U[I]:U.readUInt16BE(I*a)}let F;if(i){let U=-1;for(F=r;F<s;F++)if(A(e,F)===A(t,U===-1?0:F-U)){if(U===-1&&(U=F),F-U+1===B)return U*a}else U!==-1&&(F-=F-U),U=-1}else for(r+B>s&&(r=s-B),F=r;F>=0;F--){let U=!0;for(let I=0;I<B;I++)if(A(e,F+I)!==A(t,I)){U=!1;break}if(U)return F}return-1}c.prototype.includes=function(t,r,n){return this.indexOf(t,r,n)!==-1},c.prototype.indexOf=function(t,r,n){return wt(this,t,r,n,!0)},c.prototype.lastIndexOf=function(t,r,n){return wt(this,t,r,n,!1)};function sr(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;const a=t.length;n>a/2&&(n=a/2);let s;for(s=0;s<n;++s){const B=parseInt(t.substr(s*2,2),16);if(st(B))return s;e[r+s]=B}return s}function fr(e,t,r,n){return tt(ht(t,e.length-r),e,r,n)}function lr(e,t,r,n){return tt(Ar(t),e,r,n)}function dr(e,t,r,n){return tt(bt(t),e,r,n)}function pr(e,t,r,n){return tt(Ur(t,e.length-r),e,r,n)}c.prototype.write=function(t,r,n,i){if(r===void 0)i="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")i=r,n=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const a=this.length-r;if((n===void 0||n>a)&&(n=a),t.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let s=!1;for(;;)switch(i){case"hex":return sr(this,t,r,n);case"utf8":case"utf-8":return fr(this,t,r,n);case"ascii":case"latin1":case"binary":return lr(this,t,r,n);case"base64":return dr(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pr(this,t,r,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function yr(e,t,r){return t===0&&r===e.length?o.fromByteArray(e):o.fromByteArray(e.slice(t,r))}function Bt(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const a=e[i];let s=null,B=a>239?4:a>223?3:a>191?2:1;if(i+B<=r){let A,F,U,I;switch(B){case 1:a<128&&(s=a);break;case 2:A=e[i+1],(A&192)===128&&(I=(a&31)<<6|A&63,I>127&&(s=I));break;case 3:A=e[i+1],F=e[i+2],(A&192)===128&&(F&192)===128&&(I=(a&15)<<12|(A&63)<<6|F&63,I>2047&&(I<55296||I>57343)&&(s=I));break;case 4:A=e[i+1],F=e[i+2],U=e[i+3],(A&192)===128&&(F&192)===128&&(U&192)===128&&(I=(a&15)<<18|(A&63)<<12|(F&63)<<6|U&63,I>65535&&I<1114112&&(s=I))}}s===null?(s=65533,B=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),i+=B}return wr(n)}const xt=4096;function wr(e){const t=e.length;if(t<=xt)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=xt));return r}function gr(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]&127);return n}function Br(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function xr(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let a=t;a<r;++a)i+=_r[e[a]];return i}function Er(e,t,r){const n=e.slice(t,r);let i="";for(let a=0;a<n.length-1;a+=2)i+=String.fromCharCode(n[a]+n[a+1]*256);return i}c.prototype.slice=function(t,r){const n=this.length;t=~~t,r=r===void 0?n:~~r,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<t&&(r=t);const i=this.subarray(t,r);return Object.setPrototypeOf(i,c.prototype),i};function R(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUintLE=c.prototype.readUIntLE=function(t,r,n){t=t>>>0,r=r>>>0,n||R(t,r,this.length);let i=this[t],a=1,s=0;for(;++s<r&&(a*=256);)i+=this[t+s]*a;return i},c.prototype.readUintBE=c.prototype.readUIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||R(t,r,this.length);let i=this[t+--r],a=1;for(;r>0&&(a*=256);)i+=this[t+--r]*a;return i},c.prototype.readUint8=c.prototype.readUInt8=function(t,r){return t=t>>>0,r||R(t,1,this.length),this[t]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(t,r){return t=t>>>0,r||R(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(t,r){return t=t>>>0,r||R(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(t,r){return t=t>>>0,r||R(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(t,r){return t=t>>>0,r||R(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readBigUInt64LE=$(function(t){t=t>>>0,V(t,"offset");const r=this[t],n=this[t+7];(r===void 0||n===void 0)&&H(t,this.length-8);const i=r+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,a=this[++t]+this[++t]*2**8+this[++t]*2**16+n*2**24;return BigInt(i)+(BigInt(a)<<BigInt(32))}),c.prototype.readBigUInt64BE=$(function(t){t=t>>>0,V(t,"offset");const r=this[t],n=this[t+7];(r===void 0||n===void 0)&&H(t,this.length-8);const i=r*2**24+this[++t]*2**16+this[++t]*2**8+this[++t],a=this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n;return(BigInt(i)<<BigInt(32))+BigInt(a)}),c.prototype.readIntLE=function(t,r,n){t=t>>>0,r=r>>>0,n||R(t,r,this.length);let i=this[t],a=1,s=0;for(;++s<r&&(a*=256);)i+=this[t+s]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*r)),i},c.prototype.readIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||R(t,r,this.length);let i=r,a=1,s=this[t+--i];for(;i>0&&(a*=256);)s+=this[t+--i]*a;return a*=128,s>=a&&(s-=Math.pow(2,8*r)),s},c.prototype.readInt8=function(t,r){return t=t>>>0,r||R(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]},c.prototype.readInt16LE=function(t,r){t=t>>>0,r||R(t,2,this.length);const n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n},c.prototype.readInt16BE=function(t,r){t=t>>>0,r||R(t,2,this.length);const n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n},c.prototype.readInt32LE=function(t,r){return t=t>>>0,r||R(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,r){return t=t>>>0,r||R(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readBigInt64LE=$(function(t){t=t>>>0,V(t,"offset");const r=this[t],n=this[t+7];(r===void 0||n===void 0)&&H(t,this.length-8);const i=this[t+4]+this[t+5]*2**8+this[t+6]*2**16+(n<<24);return(BigInt(i)<<BigInt(32))+BigInt(r+this[++t]*256+this[++t]*65536+this[++t]*16777216)}),c.prototype.readBigInt64BE=$(function(t){t=t>>>0,V(t,"offset");const r=this[t],n=this[t+7];(r===void 0||n===void 0)&&H(t,this.length-8);const i=(r<<24)+this[++t]*2**16+this[++t]*2**8+this[++t];return(BigInt(i)<<BigInt(32))+BigInt(this[++t]*16777216+this[++t]*65536+this[++t]*256+n)}),c.prototype.readFloatLE=function(t,r){return t=t>>>0,r||R(t,4,this.length),h.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,r){return t=t>>>0,r||R(t,4,this.length),h.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,r){return t=t>>>0,r||R(t,8,this.length),h.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,r){return t=t>>>0,r||R(t,8,this.length),h.read(this,t,!1,52,8)};function C(e,t,r,n,i,a){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}c.prototype.writeUintLE=c.prototype.writeUIntLE=function(t,r,n,i){if(t=+t,r=r>>>0,n=n>>>0,!i){const B=Math.pow(2,8*n)-1;C(this,t,r,n,B,0)}let a=1,s=0;for(this[r]=t&255;++s<n&&(a*=256);)this[r+s]=t/a&255;return r+n},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(t,r,n,i){if(t=+t,r=r>>>0,n=n>>>0,!i){const B=Math.pow(2,8*n)-1;C(this,t,r,n,B,0)}let a=n-1,s=1;for(this[r+a]=t&255;--a>=0&&(s*=256);)this[r+a]=t/s&255;return r+n},c.prototype.writeUint8=c.prototype.writeUInt8=function(t,r,n){return t=+t,r=r>>>0,n||C(this,t,r,1,255,0),this[r]=t&255,r+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||C(this,t,r,2,65535,0),this[r]=t&255,this[r+1]=t>>>8,r+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||C(this,t,r,2,65535,0),this[r]=t>>>8,this[r+1]=t&255,r+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||C(this,t,r,4,4294967295,0),this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=t&255,r+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||C(this,t,r,4,4294967295,0),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};function Et(e,t,r,n,i){_t(t,n,i,e,r,7);let a=Number(t&BigInt(4294967295));e[r++]=a,a=a>>8,e[r++]=a,a=a>>8,e[r++]=a,a=a>>8,e[r++]=a;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s=s>>8,e[r++]=s,s=s>>8,e[r++]=s,s=s>>8,e[r++]=s,r}function mt(e,t,r,n,i){_t(t,n,i,e,r,7);let a=Number(t&BigInt(4294967295));e[r+7]=a,a=a>>8,e[r+6]=a,a=a>>8,e[r+5]=a,a=a>>8,e[r+4]=a;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s=s>>8,e[r+2]=s,s=s>>8,e[r+1]=s,s=s>>8,e[r]=s,r+8}c.prototype.writeBigUInt64LE=$(function(t,r=0){return Et(this,t,r,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=$(function(t,r=0){return mt(this,t,r,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(t,r,n,i){if(t=+t,r=r>>>0,!i){const A=Math.pow(2,8*n-1);C(this,t,r,n,A-1,-A)}let a=0,s=1,B=0;for(this[r]=t&255;++a<n&&(s*=256);)t<0&&B===0&&this[r+a-1]!==0&&(B=1),this[r+a]=(t/s>>0)-B&255;return r+n},c.prototype.writeIntBE=function(t,r,n,i){if(t=+t,r=r>>>0,!i){const A=Math.pow(2,8*n-1);C(this,t,r,n,A-1,-A)}let a=n-1,s=1,B=0;for(this[r+a]=t&255;--a>=0&&(s*=256);)t<0&&B===0&&this[r+a+1]!==0&&(B=1),this[r+a]=(t/s>>0)-B&255;return r+n},c.prototype.writeInt8=function(t,r,n){return t=+t,r=r>>>0,n||C(this,t,r,1,127,-128),t<0&&(t=255+t+1),this[r]=t&255,r+1},c.prototype.writeInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||C(this,t,r,2,32767,-32768),this[r]=t&255,this[r+1]=t>>>8,r+2},c.prototype.writeInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||C(this,t,r,2,32767,-32768),this[r]=t>>>8,this[r+1]=t&255,r+2},c.prototype.writeInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||C(this,t,r,4,2147483647,-2147483648),this[r]=t&255,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24,r+4},c.prototype.writeInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||C(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4},c.prototype.writeBigInt64LE=$(function(t,r=0){return Et(this,t,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=$(function(t,r=0){return mt(this,t,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function It(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Ft(e,t,r,n,i){return t=+t,r=r>>>0,i||It(e,t,r,4),h.write(e,t,r,n,23,4),r+4}c.prototype.writeFloatLE=function(t,r,n){return Ft(this,t,r,!0,n)},c.prototype.writeFloatBE=function(t,r,n){return Ft(this,t,r,!1,n)};function At(e,t,r,n,i){return t=+t,r=r>>>0,i||It(e,t,r,8),h.write(e,t,r,n,52,8),r+8}c.prototype.writeDoubleLE=function(t,r,n){return At(this,t,r,!0,n)},c.prototype.writeDoubleBE=function(t,r,n){return At(this,t,r,!1,n)},c.prototype.copy=function(t,r,n,i){if(!c.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),r>=t.length&&(r=t.length),r||(r=0),i>0&&i<n&&(i=n),i===n||t.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-r<i-n&&(i=t.length-r+n);const a=i-n;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,n,i):Uint8Array.prototype.set.call(t,this.subarray(n,i),r),a},c.prototype.fill=function(t,r,n,i){if(typeof t=="string"){if(typeof r=="string"?(i=r,r=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!c.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(t.length===1){const s=t.charCodeAt(0);(i==="utf8"&&s<128||i==="latin1")&&(t=s)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);let a;if(typeof t=="number")for(a=r;a<n;++a)this[a]=t;else{const s=c.isBuffer(t)?t:c.from(t,i),B=s.length;if(B===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(a=0;a<n-r;++a)this[a+r]=s[a%B]}return this};const z={};function at(e,t,r){z[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(i){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:i,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}at("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),at("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),at("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>4294967296?i=Ut(String(r)):typeof r=="bigint"&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=Ut(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);function Ut(e){let t="",r=e.length;const n=e[0]==="-"?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function mr(e,t,r){V(t,"offset"),(e[t]===void 0||e[t+r]===void 0)&&H(t,e.length-(r+1))}function _t(e,t,r,n,i,a){if(e>r||e<t){const s=typeof t=="bigint"?"n":"";let B;throw t===0||t===BigInt(0)?B=`>= 0${s} and < 2${s} ** ${(a+1)*8}${s}`:B=`>= -(2${s} ** ${(a+1)*8-1}${s}) and < 2 ** ${(a+1)*8-1}${s}`,new z.ERR_OUT_OF_RANGE("value",B,e)}mr(n,i,a)}function V(e,t){if(typeof e!="number")throw new z.ERR_INVALID_ARG_TYPE(t,"number",e)}function H(e,t,r){throw Math.floor(e)!==e?(V(e,r),new z.ERR_OUT_OF_RANGE("offset","an integer",e)):t<0?new z.ERR_BUFFER_OUT_OF_BOUNDS:new z.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${t}`,e)}const Ir=/[^+/0-9A-Za-z-_]/g;function Fr(e){if(e=e.split("=")[0],e=e.trim().replace(Ir,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function ht(e,t){t=t||1/0;let r;const n=e.length;let i=null;const a=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}else if(s+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return a}function Ar(e){const t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function Ur(e,t){let r,n,i;const a=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,a.push(i),a.push(n);return a}function bt(e){return o.toByteArray(Fr(e))}function tt(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function k(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function st(e){return e!==e}const _r=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=r*16;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function $(e){return typeof BigInt>"u"?br:e}function br(){throw new Error("BigInt not supported")}})(W);var J={},Y={};Object.defineProperty(Y,"__esModule",{value:!0});const kt=(u,o)=>u<<8|o,Ot=(u,o,h)=>u<<16|o<<8|h,$t=(u,o,h,f)=>u<<24|o<<16|h<<8|f,Dt=`Maxmind v2 module has changed API.
|
|
7
7
|
Upgrade instructions can be found here: https://github.com/runk/node-maxmind/wiki/Migration-guide
|
|
8
|
-
If you want to use legacy library then explicitly install maxmind@1`;Y.default={concat2:
|
|
8
|
+
If you want to use legacy library then explicitly install maxmind@1`;Y.default={concat2:kt,concat3:Ot,concat4:$t,legacyErrorMessage:Dt};var jt=P&&P.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(J,"__esModule",{value:!0});const D=jt(Y),Gt=W;var M;(function(u){u[u.Extended=0]="Extended",u[u.Pointer=1]="Pointer",u[u.Utf8String=2]="Utf8String",u[u.Double=3]="Double",u[u.Bytes=4]="Bytes",u[u.Uint16=5]="Uint16",u[u.Uint32=6]="Uint32",u[u.Map=7]="Map",u[u.Int32=8]="Int32",u[u.Uint64=9]="Uint64",u[u.Uint128=10]="Uint128",u[u.Array=11]="Array",u[u.Container=12]="Container",u[u.EndMarker=13]="EndMarker",u[u.Boolean=14]="Boolean",u[u.Float=15]="Float"})(M||(M={}));const zt=[0,2048,526336,0],Vt={get:()=>{},set:()=>{}},b=(u,o)=>({value:u,offset:o});class Wt{constructor(o,h=0,f=Vt){this.telemetry={},this.db=o,this.baseOffset=h,this.cache=f}decode(o){let h;const f=this.db[o++];let l=f>>5;if(l===M.Pointer)return h=this.decodePointer(f,o),b(this.decodeFast(h.value).value,h.offset);if(l===M.Extended){if(h=this.db[o]+7,h<8)throw new Error("Invalid Extended Type at offset "+o+" val "+h);l=h,o++}const d=this.sizeFromCtrlByte(f,o);return this.decodeByType(l,d.offset,d.value)}decodeFast(o){const h=this.cache.get(o);if(h)return h;const f=this.decode(o);return this.cache.set(o,f),f}decodeByType(o,h,f){const l=h+f;switch(o){case M.Utf8String:return b(this.decodeString(h,f),l);case M.Map:return this.decodeMap(f,h);case M.Uint32:return b(this.decodeUint(h,f),l);case M.Double:return b(this.decodeDouble(h),l);case M.Array:return this.decodeArray(f,h);case M.Boolean:return b(this.decodeBoolean(f),h);case M.Float:return b(this.decodeFloat(h),l);case M.Bytes:return b(this.decodeBytes(h,f),l);case M.Uint16:return b(this.decodeUint(h,f),l);case M.Int32:return b(this.decodeInt32(h,f),l);case M.Uint64:return b(this.decodeUint(h,f),l);case M.Uint128:return b(this.decodeUint(h,f),l)}throw new Error("Unknown type "+o+" at offset "+h)}sizeFromCtrlByte(o,h){const f=o&31;return f<29?b(f,h):f===29?b(29+this.db[h],h+1):f===30?b(285+this.db.readUInt16BE(h),h+2):b(65821+D.default.concat3(this.db[h],this.db[h+1],this.db[h+2]),h+3)}decodeBytes(o,h){return this.db.slice(o,o+h)}decodePointer(o,h){const f=o>>3&3,l=this.baseOffset+zt[f];let d=0;return f===0?d=D.default.concat2(o&7,this.db[h]):f===1?d=D.default.concat3(o&7,this.db[h],this.db[h+1]):f===2?d=D.default.concat4(o&7,this.db[h],this.db[h+1],this.db[h+2]):d=this.db.readUInt32BE(h),h+=f+1,b(l+d,h)}decodeArray(o,h){let f;const l=[];for(let d=0;d<o;d++)f=this.decode(h),h=f.offset,l.push(f.value);return b(l,h)}decodeBoolean(o){return o!==0}decodeDouble(o){return this.db.readDoubleBE(o)}decodeFloat(o){return this.db.readFloatBE(o)}decodeMap(o,h){let f,l;const d={};for(let p=0;p<o;p++)f=this.decode(h),l=f.value,f=this.decode(f.offset),h=f.offset,d[l]=f.value;return b(d,h)}decodeInt32(o,h){return h===0?0:this.db.readInt32BE(o)}decodeUint(o,h){switch(h){case 0:return 0;case 1:return this.db[o];case 2:return D.default.concat2(this.db[o+0],this.db[o+1]);case 3:return D.default.concat3(this.db[o+0],this.db[o+1],this.db[o+2]);case 4:return D.default.concat4(this.db[o+0],this.db[o+1],this.db[o+2],this.db[o+3]);case 8:return this.decodeBigUint(o,h);case 16:return this.decodeBigUint(o,h)}return 0}decodeString(o,h){return this.db.slice(o,o+h).toString()}decodeBigUint(o,h){const f=Gt.Buffer.alloc(h);this.db.copy(f,0,o,o+h);let l=BigInt(0);const d=h/4;for(let p=0;p<d;p++)l=l*BigInt(4294967296)+BigInt(f.readUInt32BE(p<<2));return l.toString()}}J.default=Wt;var it={};Object.defineProperty(it,"__esModule",{value:!0});const Yt=u=>{const o=u.split(".",4),h=parseInt(o[0]),f=parseInt(o[1]),l=parseInt(o[2]),d=parseInt(o[3]);return[h,f,l,d]},Z=u=>{const o=parseInt(u,10).toString(16);return o.length===2?o:"0"+o},qt=u=>{const o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];let h,f,l;const d=u.indexOf(".")>-1?u.replace(/(\d+)\.(\d+)\.(\d+)\.(\d+)/,(x,m,E,g,y)=>Z(m)+Z(E)+":"+Z(g)+Z(y)):u,[p,c]=d.split("::",2);if(p)for(f=p.split(":"),h=0;h<f.length;h++)l=parseInt(f[h],16),o[h*2]=l>>8,o[h*2+1]=l&255;if(c){f=c.split(":");const x=16-f.length*2;for(h=0;h<f.length;h++)l=parseInt(f[h],16),o[x+h*2]=l>>8,o[x+(h*2+1)]=l&255}return o},Ht=u=>u.indexOf(":")===-1?Yt(u):qt(u),Xt=(u,o)=>{const h=o>>3,f=7^o&7;return u[h]>>>f&1},Jt=u=>/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(u),Zt=u=>/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/.test(u),Kt=u=>Jt(u)||Zt(u);it.default={bitAt:Xt,parse:Ht,validate:Kt};var dt={};(function(u){var o=P&&P.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(u,"__esModule",{value:!0}),u.isLegacyFormat=u.parseMetadata=void 0;const h=o(J),f=o(Y),d=W.Buffer.from("ABCDEF4D61784D696E642E636F6D","hex"),p=m=>{const E=c(m),y=new h.default(m,E).decode(E).value;if(!y)throw new Error((0,u.isLegacyFormat)(m)?f.default.legacyErrorMessage:"Cannot parse binary database");return[24,28,32].indexOf(y.record_size)>-1,{binaryFormatMajorVersion:y.binary_format_major_version,binaryFormatMinorVersion:y.binary_format_minor_version,buildEpoch:new Date(y.build_epoch*1e3),databaseType:y.database_type,description:y.description,ipVersion:y.ip_version,languages:y.languages,nodeByteSize:y.record_size/4,nodeCount:y.node_count,recordSize:y.record_size,searchTreeSize:y.node_count*y.record_size/4,treeDepth:Math.pow(2,y.ip_version+1)}};u.parseMetadata=p;const c=m=>{let E=0,g=m.length-1;const y=d.length-1;for(;E<=y&&g-- >0;)E+=m[g]===d[y-E]?1:-E;return g+E},x=m=>{for(let g=0;g<20;g++){const y=m.slice(m.length-3-g,m.length-g);if(y[0]===255&&y[1]===255&&y[2]===255)return!0}return!1};u.isLegacyFormat=x})(dt);var ot={},Qt=P&&P.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(ot,"__esModule",{value:!0});const K=Qt(Y),vt=u=>o=>K.default.concat3(u[o+3],u[o+4],u[o+5]),tr=u=>o=>K.default.concat3(u[o],u[o+1],u[o+2]),rr=u=>o=>K.default.concat4(u[o+3]>>4,u[o],u[o+1],u[o+2]),er=u=>o=>K.default.concat4(u[o+3]&15,u[o+4],u[o+5],u[o+6]),nr=u=>o=>u.readUInt32BE(o),ir=u=>o=>u.readUInt32BE(o+4);ot.default=(u,o)=>{switch(o){case 24:return{left:tr(u),right:vt(u)};case 28:return{left:rr(u),right:er(u)};case 32:return{left:nr(u),right:ir(u)}}throw new Error("Unsupported record size")};var ut={},pt;function or(){return pt||(pt=1,Object.defineProperty(ut,"__esModule",{value:!0})),ut}(function(u){var o=P&&P.__createBinding||(Object.create?function(g,y,w,_){_===void 0&&(_=w);var S=Object.getOwnPropertyDescriptor(y,w);(!S||("get"in S?!y.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return y[w]}}),Object.defineProperty(g,_,S)}:function(g,y,w,_){_===void 0&&(_=w),g[_]=y[w]}),h=P&&P.__exportStar||function(g,y){for(var w in g)w!=="default"&&!Object.prototype.hasOwnProperty.call(y,w)&&o(y,g,w)},f=P&&P.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(u,"__esModule",{value:!0}),u.Reader=void 0;const l=W,d=f(J),p=f(it),c=dt,x=f(ot),m=16;class E{constructor(y,w={}){this.opts=w,this.load(y)}load(y){if(!l.Buffer.isBuffer(y))throw new Error(`mmdb-lib expects an instance of Buffer, got: ${typeof y}`);this.db=y,this.metadata=(0,c.parseMetadata)(this.db),this.decoder=new d.default(this.db,this.metadata.searchTreeSize+m,this.opts.cache),this.walker=(0,x.default)(this.db,this.metadata.recordSize),this.ipv4StartNodeNumber=this.ipv4Start()}get(y){const[w]=this.getWithPrefixLength(y);return w}getWithPrefixLength(y){const[w,_]=this.findAddressInTree(y);return[w?this.resolveDataPointer(w):null,_]}findAddressInTree(y){const w=p.default.parse(y),_=this.metadata.nodeCount,S=w.length*8;let v,N=0,q,O=0;for(w.length===4&&(N=this.ipv4StartNodeNumber);O<S&&N<_;O++)v=p.default.bitAt(w,O),q=N*this.metadata.nodeByteSize,N=v?this.walker.right(q):this.walker.left(q);return N>_?[N,O]:[null,O]}resolveDataPointer(y){const w=y-this.metadata.nodeCount+this.metadata.searchTreeSize;return this.decoder.decodeFast(w).value}ipv4Start(){if(this.metadata.ipVersion===4)return 0;const y=this.metadata.nodeCount;let w=0,_=0;for(;_<96&&w<y;_++){const S=w*this.metadata.nodeByteSize;w=this.walker.left(S)}return w}}u.Reader=E,h(or(),u)})(ft);async function ur(u){try{const o=await fetch(u);if(!o.ok)throw new Error("Network response was not ok");const h=await o.arrayBuffer(),f=new Uint8Array(h);return W.Buffer.from(f)}catch(o){console.error("Fetching file failed:",o)}}const cr="https://raw.githubusercontent.com/Max-Sum/17mon-mmdb/release/Country.mmdb";let Q=null;const ar=async u=>{if(Q)return Q;const o=await ur(cr);if(o)return Q=new ft.Reader(o),Q},ct=new Map,yt=async u=>{var d;if(ct.has(u))return ct.get(u);const o=await ar(),h=o==null?void 0:o.get(u),f=(d=h==null?void 0:h.country)==null?void 0:d.names,l=(f==null?void 0:f["zh-CN"])??(f==null?void 0:f.en)??"n/a";return l&&ct.set(u,l),l};return window.getGeoFromIp=yt,rt.getGeoFromIp=yt,Object.defineProperty(rt,Symbol.toStringTag,{value:"Module"}),rt}({});
|
|
9
9
|
//# sourceMappingURL=index.iife.js.map
|