@unicitylabs/nostr-js-sdk 0.4.0 → 0.5.0-dev.2

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.
@@ -1,13 +1,13 @@
1
1
  const t="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;
2
- /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function e(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&"Uint8Array"===t.constructor.name}function n(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function r(t,...n){if(!e(t))throw new Error("Uint8Array expected");if(n.length>0&&!n.includes(t.length))throw new Error("Uint8Array expected of length "+n+", got length="+t.length)}function d(t){if("function"!=typeof t||"function"!=typeof t.create)throw new Error("Hash should be wrapped by utils.createHasher");n(t.outputLen),n(t.blockLen)}function i(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function o(t,e){r(t);const n=e.outputLen;if(t.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function s(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function a(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function u(t,e){return t<<32-e|t>>>e}const c=(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)(),$=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function l(t){if(r(t),c)return t.toHex();let e="";for(let n=0;n<t.length;n++)e+=$[t[n]];return e}const f=48,h=57,y=65,g=70,p=97,m=102;function b(t){return t>=f&&t<=h?t-f:t>=y&&t<=g?t-(y-10):t>=p&&t<=m?t-(p-10):void 0}function w(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);if(c)return Uint8Array.fromHex(t);const e=t.length,n=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(n);for(let e=0,d=0;e<n;e++,d+=2){const n=b(t.charCodeAt(d)),i=b(t.charCodeAt(d+1));if(void 0===n||void 0===i){const e=t[d]+t[d+1];throw new Error('hex string expected, got non-hex character "'+e+'" at index '+d)}r[e]=16*n+i}return r}function v(t){if("string"!=typeof t)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(t))}function E(t){return"string"==typeof t&&(t=v(t)),r(t),t}function O(...t){let e=0;for(let n=0;n<t.length;n++){const d=t[n];r(d),e+=d.length}const n=new Uint8Array(e);for(let e=0,r=0;e<t.length;e++){const d=t[e];n.set(d,r),r+=d.length}return n}class P{}function S(t){const e=e=>t().update(E(e)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function N(e=32){if(t&&"function"==typeof t.getRandomValues)return t.getRandomValues(new Uint8Array(e));if(t&&"function"==typeof t.randomBytes)return Uint8Array.from(t.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}var C=Object.freeze({__proto__:null,Hash:P,abytes:r,aexists:i,ahash:d,anumber:n,aoutput:o,bytesToHex:l,clean:s,concatBytes:O,createHasher:S,createView:a,hexToBytes:w,isBytes:e,randomBytes:N,rotr:u,toBytes:E,utf8ToBytes:v});const A="qpzry9x8gf2tvdw0s3jn54khce6mua7l",I=[996825010,642813549,513874426,1027748829,705979059];function x(t){let e=1;for(const n of t){const t=e>>25;e=(33554431&e)<<5^n;for(let n=0;n<5;n++)t>>n&1&&(e^=I[n])}return e}function T(t){const e=[];for(let n=0;n<t.length;n++)e.push(t.charCodeAt(n)>>5);e.push(0);for(let n=0;n<t.length;n++)e.push(31&t.charCodeAt(n));return e}function k(t,e,n,r){let d=0,i=0;const o=[],s=(1<<n)-1;for(const r of t){if(r<0||r>>e!==0)return null;for(d=d<<e|r,i+=e;i>=n;)i-=n,o.push(d>>i&s)}if(r)i>0&&o.push(d<<n-i&s);else if(i>=e||0!==(d<<n-i&s))return null;return o}function B(t,e){const n=k(Array.from(e),8,5,!0);if(null===n)throw new Error("Failed to convert bits for Bech32 encoding");const r=function(t,e){const n=1^x(T(t).concat(e).concat([0,0,0,0,0,0])),r=[];for(let t=0;t<6;t++)r.push(n>>5*(5-t)&31);return r}(t,n),d=n.concat(r);let i=t+"1";for(const t of d)i+=A.charAt(t);return i}function R(t){const e=t.toLowerCase(),n=e.lastIndexOf("1");if(n<1||n+7>e.length||e.length>90)throw new Error("Invalid Bech32 string");const r=e.slice(0,n),d=e.slice(n+1),i=[];for(const t of d){const e=A.indexOf(t);if(-1===e)throw new Error(`Invalid character '${t}' in Bech32 string`);i.push(e)}if(!function(t,e){return 1===x(T(t).concat(e))}(r,i))throw new Error("Invalid Bech32 checksum");const o=k(i.slice(0,-6),5,8,!1);if(null===o)throw new Error("Failed to convert bits in Bech32 decoding");return{hrp:r,data:new Uint8Array(o)}}function M(t){if(32!==t.length)throw new Error("Public key must be 32 bytes");return B("npub",t)}function _(t){const e=R(t);if("npub"!==e.hrp)throw new Error(`Expected 'npub' prefix, got '${e.hrp}'`);if(32!==e.data.length)throw new Error(`Expected 32 bytes, got ${e.data.length}`);return e.data}function L(t){if(32!==t.length)throw new Error("Private key must be 32 bytes");return B("nsec",t)}function U(t){const e=R(t);if("nsec"!==e.hrp)throw new Error(`Expected 'nsec' prefix, got '${e.hrp}'`);if(32!==e.data.length)throw new Error(`Expected 32 bytes, got ${e.data.length}`);return e.data}var F=Object.freeze({__proto__:null,decode:R,decodeNpub:_,decodeNsec:U,encode:B,encodeNpub:M,encodeNsec:L});function D(t,e,n){return t&e^~t&n}function j(t,e,n){return t&e^t&n^e&n}class K extends P{constructor(t,e,n,r){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=e,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(t),this.view=a(this.buffer)}update(t){i(this),r(t=E(t));const{view:e,buffer:n,blockLen:d}=this,o=t.length;for(let r=0;r<o;){const i=Math.min(d-this.pos,o-r);if(i===d){const e=a(t);for(;d<=o-r;r+=d)this.process(e,r);continue}n.set(t.subarray(r,r+i),this.pos),this.pos+=i,r+=i,this.pos===d&&(this.process(e,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){i(this),o(t,this),this.finished=!0;const{buffer:e,view:n,blockLen:r,isLE:d}=this;let{pos:u}=this;e[u++]=128,s(this.buffer.subarray(u)),this.padOffset>r-u&&(this.process(n,0),u=0);for(let t=u;t<r;t++)e[t]=0;!function(t,e,n,r){if("function"==typeof t.setBigUint64)return t.setBigUint64(e,n,r);const d=BigInt(32),i=BigInt(4294967295),o=Number(n>>d&i),s=Number(n&i),a=r?4:0,u=r?0:4;t.setUint32(e+a,o,r),t.setUint32(e+u,s,r)}(n,r-8,BigInt(8*this.length),d),this.process(n,0);const c=a(t),$=this.outputLen;if($%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=$/4,f=this.get();if(l>f.length)throw new Error("_sha2: outputLen bigger than state");for(let t=0;t<l;t++)c.setUint32(4*t,f[t],d)}digest(){const{buffer:t,outputLen:e}=this;this.digestInto(t);const n=t.slice(0,e);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:e,buffer:n,length:r,finished:d,destroyed:i,pos:o}=this;return t.destroyed=i,t.finished=d,t.length=r,t.pos=o,r%e&&t.buffer.set(n),t}clone(){return this._cloneInto()}}const H=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),G=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),V=new Uint32Array(64);class q extends K{constructor(t=32){super(64,t,8,!1),this.A=0|H[0],this.B=0|H[1],this.C=0|H[2],this.D=0|H[3],this.E=0|H[4],this.F=0|H[5],this.G=0|H[6],this.H=0|H[7]}get(){const{A:t,B:e,C:n,D:r,E:d,F:i,G:o,H:s}=this;return[t,e,n,r,d,i,o,s]}set(t,e,n,r,d,i,o,s){this.A=0|t,this.B=0|e,this.C=0|n,this.D=0|r,this.E=0|d,this.F=0|i,this.G=0|o,this.H=0|s}process(t,e){for(let n=0;n<16;n++,e+=4)V[n]=t.getUint32(e,!1);for(let t=16;t<64;t++){const e=V[t-15],n=V[t-2],r=u(e,7)^u(e,18)^e>>>3,d=u(n,17)^u(n,19)^n>>>10;V[t]=d+V[t-7]+r+V[t-16]|0}let{A:n,B:r,C:d,D:i,E:o,F:s,G:a,H:c}=this;for(let t=0;t<64;t++){const e=c+(u(o,6)^u(o,11)^u(o,25))+D(o,s,a)+G[t]+V[t]|0,$=(u(n,2)^u(n,13)^u(n,22))+j(n,r,d)|0;c=a,a=s,s=o,o=i+e|0,i=d,d=r,r=n,n=e+$|0}n=n+this.A|0,r=r+this.B|0,d=d+this.C|0,i=i+this.D|0,o=o+this.E|0,s=s+this.F|0,a=a+this.G|0,c=c+this.H|0,this.set(n,r,d,i,o,s,a,c)}roundClean(){s(V)}destroy(){this.set(0,0,0,0,0,0,0,0),s(this.buffer)}}const Z=S(()=>new q);class W extends P{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,d(t);const n=E(e);if(this.iHash=t.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const r=this.blockLen,i=new Uint8Array(r);i.set(n.length>r?t.create().update(n).digest():n);for(let t=0;t<i.length;t++)i[t]^=54;this.iHash.update(i),this.oHash=t.create();for(let t=0;t<i.length;t++)i[t]^=106;this.oHash.update(i),s(i)}update(t){return i(this),this.iHash.update(t),this}digestInto(t){i(this),r(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:e,iHash:n,finished:r,destroyed:d,blockLen:i,outputLen:o}=this;return t.finished=r,t.destroyed=d,t.blockLen=i,t.outputLen=o,t.oHash=e._cloneInto(t.oHash),t.iHash=n._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const J=(t,e,n)=>new W(t,e).update(n).digest();J.create=(t,e)=>new W(t,e);
2
+ /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function e(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&"Uint8Array"===t.constructor.name}function n(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function r(t,...n){if(!e(t))throw new Error("Uint8Array expected");if(n.length>0&&!n.includes(t.length))throw new Error("Uint8Array expected of length "+n+", got length="+t.length)}function d(t){if("function"!=typeof t||"function"!=typeof t.create)throw new Error("Hash should be wrapped by utils.createHasher");n(t.outputLen),n(t.blockLen)}function i(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function o(t,e){r(t);const n=e.outputLen;if(t.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function s(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function a(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function u(t,e){return t<<32-e|t>>>e}const c=(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)(),$=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function l(t){if(r(t),c)return t.toHex();let e="";for(let n=0;n<t.length;n++)e+=$[t[n]];return e}const f=48,h=57,y=65,g=70,p=97,m=102;function b(t){return t>=f&&t<=h?t-f:t>=y&&t<=g?t-(y-10):t>=p&&t<=m?t-(p-10):void 0}function w(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);if(c)return Uint8Array.fromHex(t);const e=t.length,n=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(n);for(let e=0,d=0;e<n;e++,d+=2){const n=b(t.charCodeAt(d)),i=b(t.charCodeAt(d+1));if(void 0===n||void 0===i){const e=t[d]+t[d+1];throw new Error('hex string expected, got non-hex character "'+e+'" at index '+d)}r[e]=16*n+i}return r}function v(t){if("string"!=typeof t)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(t))}function E(t){return"string"==typeof t&&(t=v(t)),r(t),t}function O(...t){let e=0;for(let n=0;n<t.length;n++){const d=t[n];r(d),e+=d.length}const n=new Uint8Array(e);for(let e=0,r=0;e<t.length;e++){const d=t[e];n.set(d,r),r+=d.length}return n}class S{}function P(t){const e=e=>t().update(E(e)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function C(e=32){if(t&&"function"==typeof t.getRandomValues)return t.getRandomValues(new Uint8Array(e));if(t&&"function"==typeof t.randomBytes)return Uint8Array.from(t.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}var N=Object.freeze({__proto__:null,Hash:S,abytes:r,aexists:i,ahash:d,anumber:n,aoutput:o,bytesToHex:l,clean:s,concatBytes:O,createHasher:P,createView:a,hexToBytes:w,isBytes:e,randomBytes:C,rotr:u,toBytes:E,utf8ToBytes:v});const A="qpzry9x8gf2tvdw0s3jn54khce6mua7l",I=[996825010,642813549,513874426,1027748829,705979059];function x(t){let e=1;for(const n of t){const t=e>>25;e=(33554431&e)<<5^n;for(let n=0;n<5;n++)t>>n&1&&(e^=I[n])}return e}function k(t){const e=[];for(let n=0;n<t.length;n++)e.push(t.charCodeAt(n)>>5);e.push(0);for(let n=0;n<t.length;n++)e.push(31&t.charCodeAt(n));return e}function T(t,e,n,r){let d=0,i=0;const o=[],s=(1<<n)-1;for(const r of t){if(r<0||r>>e!==0)return null;for(d=d<<e|r,i+=e;i>=n;)i-=n,o.push(d>>i&s)}if(r)i>0&&o.push(d<<n-i&s);else if(i>=e||0!==(d<<n-i&s))return null;return o}function B(t,e){const n=T(Array.from(e),8,5,!0);if(null===n)throw new Error("Failed to convert bits for Bech32 encoding");const r=function(t,e){const n=1^x(k(t).concat(e).concat([0,0,0,0,0,0])),r=[];for(let t=0;t<6;t++)r.push(n>>5*(5-t)&31);return r}(t,n),d=n.concat(r);let i=t+"1";for(const t of d)i+=A.charAt(t);return i}function R(t){const e=t.toLowerCase(),n=e.lastIndexOf("1");if(n<1||n+7>e.length||e.length>90)throw new Error("Invalid Bech32 string");const r=e.slice(0,n),d=e.slice(n+1),i=[];for(const t of d){const e=A.indexOf(t);if(-1===e)throw new Error(`Invalid character '${t}' in Bech32 string`);i.push(e)}if(!function(t,e){return 1===x(k(t).concat(e))}(r,i))throw new Error("Invalid Bech32 checksum");const o=T(i.slice(0,-6),5,8,!1);if(null===o)throw new Error("Failed to convert bits in Bech32 decoding");return{hrp:r,data:new Uint8Array(o)}}function M(t){if(32!==t.length)throw new Error("Public key must be 32 bytes");return B("npub",t)}function _(t){const e=R(t);if("npub"!==e.hrp)throw new Error(`Expected 'npub' prefix, got '${e.hrp}'`);if(32!==e.data.length)throw new Error(`Expected 32 bytes, got ${e.data.length}`);return e.data}function L(t){if(32!==t.length)throw new Error("Private key must be 32 bytes");return B("nsec",t)}function U(t){const e=R(t);if("nsec"!==e.hrp)throw new Error(`Expected 'nsec' prefix, got '${e.hrp}'`);if(32!==e.data.length)throw new Error(`Expected 32 bytes, got ${e.data.length}`);return e.data}var F=Object.freeze({__proto__:null,decode:R,decodeNpub:_,decodeNsec:U,encode:B,encodeNpub:M,encodeNsec:L});function D(t,e,n){return t&e^~t&n}function K(t,e,n){return t&e^t&n^e&n}class j extends S{constructor(t,e,n,r){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=e,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(t),this.view=a(this.buffer)}update(t){i(this),r(t=E(t));const{view:e,buffer:n,blockLen:d}=this,o=t.length;for(let r=0;r<o;){const i=Math.min(d-this.pos,o-r);if(i===d){const e=a(t);for(;d<=o-r;r+=d)this.process(e,r);continue}n.set(t.subarray(r,r+i),this.pos),this.pos+=i,r+=i,this.pos===d&&(this.process(e,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){i(this),o(t,this),this.finished=!0;const{buffer:e,view:n,blockLen:r,isLE:d}=this;let{pos:u}=this;e[u++]=128,s(this.buffer.subarray(u)),this.padOffset>r-u&&(this.process(n,0),u=0);for(let t=u;t<r;t++)e[t]=0;!function(t,e,n,r){if("function"==typeof t.setBigUint64)return t.setBigUint64(e,n,r);const d=BigInt(32),i=BigInt(4294967295),o=Number(n>>d&i),s=Number(n&i),a=r?4:0,u=r?0:4;t.setUint32(e+a,o,r),t.setUint32(e+u,s,r)}(n,r-8,BigInt(8*this.length),d),this.process(n,0);const c=a(t),$=this.outputLen;if($%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=$/4,f=this.get();if(l>f.length)throw new Error("_sha2: outputLen bigger than state");for(let t=0;t<l;t++)c.setUint32(4*t,f[t],d)}digest(){const{buffer:t,outputLen:e}=this;this.digestInto(t);const n=t.slice(0,e);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:e,buffer:n,length:r,finished:d,destroyed:i,pos:o}=this;return t.destroyed=i,t.finished=d,t.length=r,t.pos=o,r%e&&t.buffer.set(n),t}clone(){return this._cloneInto()}}const H=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),G=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),V=new Uint32Array(64);class q extends j{constructor(t=32){super(64,t,8,!1),this.A=0|H[0],this.B=0|H[1],this.C=0|H[2],this.D=0|H[3],this.E=0|H[4],this.F=0|H[5],this.G=0|H[6],this.H=0|H[7]}get(){const{A:t,B:e,C:n,D:r,E:d,F:i,G:o,H:s}=this;return[t,e,n,r,d,i,o,s]}set(t,e,n,r,d,i,o,s){this.A=0|t,this.B=0|e,this.C=0|n,this.D=0|r,this.E=0|d,this.F=0|i,this.G=0|o,this.H=0|s}process(t,e){for(let n=0;n<16;n++,e+=4)V[n]=t.getUint32(e,!1);for(let t=16;t<64;t++){const e=V[t-15],n=V[t-2],r=u(e,7)^u(e,18)^e>>>3,d=u(n,17)^u(n,19)^n>>>10;V[t]=d+V[t-7]+r+V[t-16]|0}let{A:n,B:r,C:d,D:i,E:o,F:s,G:a,H:c}=this;for(let t=0;t<64;t++){const e=c+(u(o,6)^u(o,11)^u(o,25))+D(o,s,a)+G[t]+V[t]|0,$=(u(n,2)^u(n,13)^u(n,22))+K(n,r,d)|0;c=a,a=s,s=o,o=i+e|0,i=d,d=r,r=n,n=e+$|0}n=n+this.A|0,r=r+this.B|0,d=d+this.C|0,i=i+this.D|0,o=o+this.E|0,s=s+this.F|0,a=a+this.G|0,c=c+this.H|0,this.set(n,r,d,i,o,s,a,c)}roundClean(){s(V)}destroy(){this.set(0,0,0,0,0,0,0,0),s(this.buffer)}}const Z=P(()=>new q);class W extends S{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,d(t);const n=E(e);if(this.iHash=t.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const r=this.blockLen,i=new Uint8Array(r);i.set(n.length>r?t.create().update(n).digest():n);for(let t=0;t<i.length;t++)i[t]^=54;this.iHash.update(i),this.oHash=t.create();for(let t=0;t<i.length;t++)i[t]^=106;this.oHash.update(i),s(i)}update(t){return i(this),this.iHash.update(t),this}digestInto(t){i(this),r(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:e,iHash:n,finished:r,destroyed:d,blockLen:i,outputLen:o}=this;return t.finished=r,t.destroyed=d,t.blockLen=i,t.outputLen=o,t.oHash=e._cloneInto(t.oHash),t.iHash=n._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const J=(t,e,n)=>new W(t,e).update(n).digest();J.create=(t,e)=>new W(t,e);
3
3
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
4
4
  const Y=BigInt(0),z=BigInt(1);function X(t,e=""){if("boolean"!=typeof t){throw new Error((e&&`"${e}"`)+"expected boolean, got type="+typeof t)}return t}function Q(t,n,r=""){const d=e(t),i=t?.length,o=void 0!==n;if(!d||o&&i!==n){throw new Error((r&&`"${r}" `)+"expected Uint8Array"+(o?` of length ${n}`:"")+", got "+(d?`length=${i}`:"type="+typeof t))}return t}function tt(t){const e=t.toString(16);return 1&e.length?"0"+e:e}function et(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);return""===t?Y:BigInt("0x"+t)}function nt(t){return et(l(t))}function rt(t){return r(t),et(l(Uint8Array.from(t).reverse()))}function dt(t,e){return w(t.toString(16).padStart(2*e,"0"))}function it(t,e){return dt(t,e).reverse()}function ot(t,n,r){let d;if("string"==typeof n)try{d=w(n)}catch(e){throw new Error(t+" must be hex string or Uint8Array, cause: "+e)}else{if(!e(n))throw new Error(t+" must be hex string or Uint8Array");d=Uint8Array.from(n)}const i=d.length;if("number"==typeof r&&i!==r)throw new Error(t+" of length "+r+" expected, got "+i);return d}const st=t=>"bigint"==typeof t&&Y<=t;function at(t,e,n){return st(t)&&st(e)&&st(n)&&e<=t&&t<n}function ut(t){let e;for(e=0;t>Y;t>>=z,e+=1);return e}const ct=t=>(z<<BigInt(t))-z;function $t(t,e,n={}){if(!t||"object"!=typeof t)throw new Error("expected valid options object");function r(e,n,r){const d=t[e];if(r&&void 0===d)return;const i=typeof d;if(i!==n||null===d)throw new Error(`param "${e}" is invalid: expected ${n}, got ${i}`)}Object.entries(e).forEach(([t,e])=>r(t,e,!1)),Object.entries(n).forEach(([t,e])=>r(t,e,!0))}function lt(t){const e=new WeakMap;return(n,...r)=>{const d=e.get(n);if(void 0!==d)return d;const i=t(n,...r);return e.set(n,i),i}}
5
- /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ft=BigInt(0),ht=BigInt(1),yt=BigInt(2),gt=BigInt(3),pt=BigInt(4),mt=BigInt(5),bt=BigInt(7),wt=BigInt(8),vt=BigInt(9),Et=BigInt(16);function Ot(t,e){const n=t%e;return n>=ft?n:e+n}function Pt(t,e,n){let r=t;for(;e-- >ft;)r*=r,r%=n;return r}function St(t,e){if(t===ft)throw new Error("invert: expected non-zero number");if(e<=ft)throw new Error("invert: expected positive modulus, got "+e);let n=Ot(t,e),r=e,d=ft,i=ht;for(;n!==ft;){const t=r%n,e=d-i*(r/n);r=n,n=t,d=i,i=e}if(r!==ht)throw new Error("invert: does not exist");return Ot(d,e)}function Nt(t,e,n){if(!t.eql(t.sqr(e),n))throw new Error("Cannot find square root")}function Ct(t,e){const n=(t.ORDER+ht)/pt,r=t.pow(e,n);return Nt(t,r,e),r}function At(t,e){const n=(t.ORDER-mt)/wt,r=t.mul(e,yt),d=t.pow(r,n),i=t.mul(e,d),o=t.mul(t.mul(i,yt),d),s=t.mul(i,t.sub(o,t.ONE));return Nt(t,s,e),s}function It(t){if(t<gt)throw new Error("sqrt is not defined for small field");let e=t-ht,n=0;for(;e%yt===ft;)e/=yt,n++;let r=yt;const d=Mt(t);for(;1===Bt(d,r);)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(1===n)return Ct;let i=d.pow(r,e);const o=(e+ht)/yt;return function(t,r){if(t.is0(r))return r;if(1!==Bt(t,r))throw new Error("Cannot find square root");let d=n,s=t.mul(t.ONE,i),a=t.pow(r,e),u=t.pow(r,o);for(;!t.eql(a,t.ONE);){if(t.is0(a))return t.ZERO;let e=1,n=t.sqr(a);for(;!t.eql(n,t.ONE);)if(e++,n=t.sqr(n),e===d)throw new Error("Cannot find square root");const r=ht<<BigInt(d-e-1),i=t.pow(s,r);d=e,s=t.sqr(i),a=t.mul(a,s),u=t.mul(u,i)}return u}}function xt(t){return t%pt===gt?Ct:t%wt===mt?At:t%Et===vt?function(t){const e=Mt(t),n=It(t),r=n(e,e.neg(e.ONE)),d=n(e,r),i=n(e,e.neg(r)),o=(t+bt)/Et;return(t,e)=>{let n=t.pow(e,o),s=t.mul(n,r);const a=t.mul(n,d),u=t.mul(n,i),c=t.eql(t.sqr(s),e),$=t.eql(t.sqr(a),e);n=t.cmov(n,s,c),s=t.cmov(u,a,$);const l=t.eql(t.sqr(s),e),f=t.cmov(n,s,l);return Nt(t,f,e),f}}(t):It(t)}const Tt=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function kt(t,e,n=!1){const r=new Array(e.length).fill(n?t.ZERO:void 0),d=e.reduce((e,n,d)=>t.is0(n)?e:(r[d]=e,t.mul(e,n)),t.ONE),i=t.inv(d);return e.reduceRight((e,n,d)=>t.is0(n)?e:(r[d]=t.mul(e,r[d]),t.mul(e,n)),i),r}function Bt(t,e){const n=(t.ORDER-ht)/yt,r=t.pow(e,n),d=t.eql(r,t.ONE),i=t.eql(r,t.ZERO),o=t.eql(r,t.neg(t.ONE));if(!d&&!i&&!o)throw new Error("invalid Legendre symbol result");return d?1:i?0:-1}function Rt(t,e){void 0!==e&&n(e);const r=void 0!==e?e:t.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function Mt(t,e,n=!1,r={}){if(t<=ft)throw new Error("invalid field: expected ORDER > 0, got "+t);let d,i,o,s=!1;if("object"==typeof e&&null!=e){if(r.sqrt||n)throw new Error("cannot specify opts in two arguments");const t=e;t.BITS&&(d=t.BITS),t.sqrt&&(i=t.sqrt),"boolean"==typeof t.isLE&&(n=t.isLE),"boolean"==typeof t.modFromBytes&&(s=t.modFromBytes),o=t.allowedLengths}else"number"==typeof e&&(d=e),r.sqrt&&(i=r.sqrt);const{nBitLength:a,nByteLength:u}=Rt(t,d);if(u>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let c;const $=Object.freeze({ORDER:t,isLE:n,BITS:a,BYTES:u,MASK:ct(a),ZERO:ft,ONE:ht,allowedLengths:o,create:e=>Ot(e,t),isValid:e=>{if("bigint"!=typeof e)throw new Error("invalid field element: expected bigint, got "+typeof e);return ft<=e&&e<t},is0:t=>t===ft,isValidNot0:t=>!$.is0(t)&&$.isValid(t),isOdd:t=>(t&ht)===ht,neg:e=>Ot(-e,t),eql:(t,e)=>t===e,sqr:e=>Ot(e*e,t),add:(e,n)=>Ot(e+n,t),sub:(e,n)=>Ot(e-n,t),mul:(e,n)=>Ot(e*n,t),pow:(t,e)=>function(t,e,n){if(n<ft)throw new Error("invalid exponent, negatives unsupported");if(n===ft)return t.ONE;if(n===ht)return e;let r=t.ONE,d=e;for(;n>ft;)n&ht&&(r=t.mul(r,d)),d=t.sqr(d),n>>=ht;return r}($,t,e),div:(e,n)=>Ot(e*St(n,t),t),sqrN:t=>t*t,addN:(t,e)=>t+e,subN:(t,e)=>t-e,mulN:(t,e)=>t*e,inv:e=>St(e,t),sqrt:i||(e=>(c||(c=xt(t)),c($,e))),toBytes:t=>n?it(t,u):dt(t,u),fromBytes:(e,r=!0)=>{if(o){if(!o.includes(e.length)||e.length>u)throw new Error("Field.fromBytes: expected "+o+" bytes, got "+e.length);const t=new Uint8Array(u);t.set(e,n?0:t.length-e.length),e=t}if(e.length!==u)throw new Error("Field.fromBytes: expected "+u+" bytes, got "+e.length);let d=n?rt(e):nt(e);if(s&&(d=Ot(d,t)),!r&&!$.isValid(d))throw new Error("invalid field element: outside of range 0..ORDER");return d},invertBatch:t=>kt($,t),cmov:(t,e,n)=>n?e:t});return Object.freeze($)}function _t(t){if("bigint"!=typeof t)throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function Lt(t){const e=_t(t);return e+Math.ceil(e/2)}function Ut(t,e,n=!1){const r=t.length,d=_t(e),i=Lt(e);if(r<16||r<i||r>1024)throw new Error("expected "+i+"-1024 bytes of input, got "+r);const o=Ot(n?rt(t):nt(t),e-ht)+ht;return n?it(o,d):dt(o,d)}
6
- /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ft=BigInt(0),Dt=BigInt(1);function jt(t,e){const n=e.negate();return t?n:e}function Kt(t,e){const n=kt(t.Fp,e.map(t=>t.Z));return e.map((e,r)=>t.fromAffine(e.toAffine(n[r])))}function Ht(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function Gt(t,e){Ht(t,e);const n=2**t;return{windows:Math.ceil(e/t)+1,windowSize:2**(t-1),mask:ct(t),maxNumber:n,shiftBy:BigInt(t)}}function Vt(t,e,n){const{windowSize:r,mask:d,maxNumber:i,shiftBy:o}=n;let s=Number(t&d),a=t>>o;s>r&&(s-=i,a+=Dt);const u=e*r;return{nextN:a,offset:u+Math.abs(s)-1,isZero:0===s,isNeg:s<0,isNegF:e%2!=0,offsetF:u}}const qt=new WeakMap,Zt=new WeakMap;function Wt(t){return Zt.get(t)||1}function Jt(t){if(t!==Ft)throw new Error("invalid wNAF")}class Yt{constructor(t,e){this.BASE=t.BASE,this.ZERO=t.ZERO,this.Fn=t.Fn,this.bits=e}_unsafeLadder(t,e,n=this.ZERO){let r=t;for(;e>Ft;)e&Dt&&(n=n.add(r)),r=r.double(),e>>=Dt;return n}precomputeWindow(t,e){const{windows:n,windowSize:r}=Gt(e,this.bits),d=[];let i=t,o=i;for(let t=0;t<n;t++){o=i,d.push(o);for(let t=1;t<r;t++)o=o.add(i),d.push(o);i=o.double()}return d}wNAF(t,e,n){if(!this.Fn.isValid(n))throw new Error("invalid scalar");let r=this.ZERO,d=this.BASE;const i=Gt(t,this.bits);for(let t=0;t<i.windows;t++){const{nextN:o,offset:s,isZero:a,isNeg:u,isNegF:c,offsetF:$}=Vt(n,t,i);n=o,a?d=d.add(jt(c,e[$])):r=r.add(jt(u,e[s]))}return Jt(n),{p:r,f:d}}wNAFUnsafe(t,e,n,r=this.ZERO){const d=Gt(t,this.bits);for(let t=0;t<d.windows&&n!==Ft;t++){const{nextN:i,offset:o,isZero:s,isNeg:a}=Vt(n,t,d);if(n=i,!s){const t=e[o];r=r.add(a?t.negate():t)}}return Jt(n),r}getPrecomputes(t,e,n){let r=qt.get(e);return r||(r=this.precomputeWindow(e,t),1!==t&&("function"==typeof n&&(r=n(r)),qt.set(e,r))),r}cached(t,e,n){const r=Wt(t);return this.wNAF(r,this.getPrecomputes(r,t,n),e)}unsafe(t,e,n,r){const d=Wt(t);return 1===d?this._unsafeLadder(t,e,r):this.wNAFUnsafe(d,this.getPrecomputes(d,t,n),e,r)}createCache(t,e){Ht(e,this.bits),Zt.set(t,e),qt.delete(t)}hasCache(t){return 1!==Wt(t)}}function zt(t,e,n,r){!function(t,e){if(!Array.isArray(t))throw new Error("array expected");t.forEach((t,n)=>{if(!(t instanceof e))throw new Error("invalid point at index "+n)})}(n,t),function(t,e){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((t,n)=>{if(!e.isValid(t))throw new Error("invalid scalar at index "+n)})}(r,e);const d=n.length,i=r.length;if(d!==i)throw new Error("arrays of points and scalars must have equal length");const o=t.ZERO,s=ut(BigInt(d));let a=1;s>12?a=s-3:s>4?a=s-2:s>0&&(a=2);const u=ct(a),c=new Array(Number(u)+1).fill(o);let $=o;for(let t=Math.floor((e.BITS-1)/a)*a;t>=0;t-=a){c.fill(o);for(let e=0;e<i;e++){const d=r[e],i=Number(d>>BigInt(t)&u);c[i]=c[i].add(n[e])}let e=o;for(let t=c.length-1,n=o;t>0;t--)n=n.add(c[t]),e=e.add(n);if($=$.add(e),0!==t)for(let t=0;t<a;t++)$=$.double()}return $}function Xt(t,e,n){if(e){if(e.ORDER!==t)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return function(t){$t(t,Tt.reduce((t,e)=>(t[e]="function",t),{ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"}))}(e),e}return Mt(t,{isLE:n})}
5
+ /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ft=BigInt(0),ht=BigInt(1),yt=BigInt(2),gt=BigInt(3),pt=BigInt(4),mt=BigInt(5),bt=BigInt(7),wt=BigInt(8),vt=BigInt(9),Et=BigInt(16);function Ot(t,e){const n=t%e;return n>=ft?n:e+n}function St(t,e,n){let r=t;for(;e-- >ft;)r*=r,r%=n;return r}function Pt(t,e){if(t===ft)throw new Error("invert: expected non-zero number");if(e<=ft)throw new Error("invert: expected positive modulus, got "+e);let n=Ot(t,e),r=e,d=ft,i=ht;for(;n!==ft;){const t=r%n,e=d-i*(r/n);r=n,n=t,d=i,i=e}if(r!==ht)throw new Error("invert: does not exist");return Ot(d,e)}function Ct(t,e,n){if(!t.eql(t.sqr(e),n))throw new Error("Cannot find square root")}function Nt(t,e){const n=(t.ORDER+ht)/pt,r=t.pow(e,n);return Ct(t,r,e),r}function At(t,e){const n=(t.ORDER-mt)/wt,r=t.mul(e,yt),d=t.pow(r,n),i=t.mul(e,d),o=t.mul(t.mul(i,yt),d),s=t.mul(i,t.sub(o,t.ONE));return Ct(t,s,e),s}function It(t){if(t<gt)throw new Error("sqrt is not defined for small field");let e=t-ht,n=0;for(;e%yt===ft;)e/=yt,n++;let r=yt;const d=Mt(t);for(;1===Bt(d,r);)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(1===n)return Nt;let i=d.pow(r,e);const o=(e+ht)/yt;return function(t,r){if(t.is0(r))return r;if(1!==Bt(t,r))throw new Error("Cannot find square root");let d=n,s=t.mul(t.ONE,i),a=t.pow(r,e),u=t.pow(r,o);for(;!t.eql(a,t.ONE);){if(t.is0(a))return t.ZERO;let e=1,n=t.sqr(a);for(;!t.eql(n,t.ONE);)if(e++,n=t.sqr(n),e===d)throw new Error("Cannot find square root");const r=ht<<BigInt(d-e-1),i=t.pow(s,r);d=e,s=t.sqr(i),a=t.mul(a,s),u=t.mul(u,i)}return u}}function xt(t){return t%pt===gt?Nt:t%wt===mt?At:t%Et===vt?function(t){const e=Mt(t),n=It(t),r=n(e,e.neg(e.ONE)),d=n(e,r),i=n(e,e.neg(r)),o=(t+bt)/Et;return(t,e)=>{let n=t.pow(e,o),s=t.mul(n,r);const a=t.mul(n,d),u=t.mul(n,i),c=t.eql(t.sqr(s),e),$=t.eql(t.sqr(a),e);n=t.cmov(n,s,c),s=t.cmov(u,a,$);const l=t.eql(t.sqr(s),e),f=t.cmov(n,s,l);return Ct(t,f,e),f}}(t):It(t)}const kt=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Tt(t,e,n=!1){const r=new Array(e.length).fill(n?t.ZERO:void 0),d=e.reduce((e,n,d)=>t.is0(n)?e:(r[d]=e,t.mul(e,n)),t.ONE),i=t.inv(d);return e.reduceRight((e,n,d)=>t.is0(n)?e:(r[d]=t.mul(e,r[d]),t.mul(e,n)),i),r}function Bt(t,e){const n=(t.ORDER-ht)/yt,r=t.pow(e,n),d=t.eql(r,t.ONE),i=t.eql(r,t.ZERO),o=t.eql(r,t.neg(t.ONE));if(!d&&!i&&!o)throw new Error("invalid Legendre symbol result");return d?1:i?0:-1}function Rt(t,e){void 0!==e&&n(e);const r=void 0!==e?e:t.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function Mt(t,e,n=!1,r={}){if(t<=ft)throw new Error("invalid field: expected ORDER > 0, got "+t);let d,i,o,s=!1;if("object"==typeof e&&null!=e){if(r.sqrt||n)throw new Error("cannot specify opts in two arguments");const t=e;t.BITS&&(d=t.BITS),t.sqrt&&(i=t.sqrt),"boolean"==typeof t.isLE&&(n=t.isLE),"boolean"==typeof t.modFromBytes&&(s=t.modFromBytes),o=t.allowedLengths}else"number"==typeof e&&(d=e),r.sqrt&&(i=r.sqrt);const{nBitLength:a,nByteLength:u}=Rt(t,d);if(u>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let c;const $=Object.freeze({ORDER:t,isLE:n,BITS:a,BYTES:u,MASK:ct(a),ZERO:ft,ONE:ht,allowedLengths:o,create:e=>Ot(e,t),isValid:e=>{if("bigint"!=typeof e)throw new Error("invalid field element: expected bigint, got "+typeof e);return ft<=e&&e<t},is0:t=>t===ft,isValidNot0:t=>!$.is0(t)&&$.isValid(t),isOdd:t=>(t&ht)===ht,neg:e=>Ot(-e,t),eql:(t,e)=>t===e,sqr:e=>Ot(e*e,t),add:(e,n)=>Ot(e+n,t),sub:(e,n)=>Ot(e-n,t),mul:(e,n)=>Ot(e*n,t),pow:(t,e)=>function(t,e,n){if(n<ft)throw new Error("invalid exponent, negatives unsupported");if(n===ft)return t.ONE;if(n===ht)return e;let r=t.ONE,d=e;for(;n>ft;)n&ht&&(r=t.mul(r,d)),d=t.sqr(d),n>>=ht;return r}($,t,e),div:(e,n)=>Ot(e*Pt(n,t),t),sqrN:t=>t*t,addN:(t,e)=>t+e,subN:(t,e)=>t-e,mulN:(t,e)=>t*e,inv:e=>Pt(e,t),sqrt:i||(e=>(c||(c=xt(t)),c($,e))),toBytes:t=>n?it(t,u):dt(t,u),fromBytes:(e,r=!0)=>{if(o){if(!o.includes(e.length)||e.length>u)throw new Error("Field.fromBytes: expected "+o+" bytes, got "+e.length);const t=new Uint8Array(u);t.set(e,n?0:t.length-e.length),e=t}if(e.length!==u)throw new Error("Field.fromBytes: expected "+u+" bytes, got "+e.length);let d=n?rt(e):nt(e);if(s&&(d=Ot(d,t)),!r&&!$.isValid(d))throw new Error("invalid field element: outside of range 0..ORDER");return d},invertBatch:t=>Tt($,t),cmov:(t,e,n)=>n?e:t});return Object.freeze($)}function _t(t){if("bigint"!=typeof t)throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function Lt(t){const e=_t(t);return e+Math.ceil(e/2)}function Ut(t,e,n=!1){const r=t.length,d=_t(e),i=Lt(e);if(r<16||r<i||r>1024)throw new Error("expected "+i+"-1024 bytes of input, got "+r);const o=Ot(n?rt(t):nt(t),e-ht)+ht;return n?it(o,d):dt(o,d)}
6
+ /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ft=BigInt(0),Dt=BigInt(1);function Kt(t,e){const n=e.negate();return t?n:e}function jt(t,e){const n=Tt(t.Fp,e.map(t=>t.Z));return e.map((e,r)=>t.fromAffine(e.toAffine(n[r])))}function Ht(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function Gt(t,e){Ht(t,e);const n=2**t;return{windows:Math.ceil(e/t)+1,windowSize:2**(t-1),mask:ct(t),maxNumber:n,shiftBy:BigInt(t)}}function Vt(t,e,n){const{windowSize:r,mask:d,maxNumber:i,shiftBy:o}=n;let s=Number(t&d),a=t>>o;s>r&&(s-=i,a+=Dt);const u=e*r;return{nextN:a,offset:u+Math.abs(s)-1,isZero:0===s,isNeg:s<0,isNegF:e%2!=0,offsetF:u}}const qt=new WeakMap,Zt=new WeakMap;function Wt(t){return Zt.get(t)||1}function Jt(t){if(t!==Ft)throw new Error("invalid wNAF")}class Yt{constructor(t,e){this.BASE=t.BASE,this.ZERO=t.ZERO,this.Fn=t.Fn,this.bits=e}_unsafeLadder(t,e,n=this.ZERO){let r=t;for(;e>Ft;)e&Dt&&(n=n.add(r)),r=r.double(),e>>=Dt;return n}precomputeWindow(t,e){const{windows:n,windowSize:r}=Gt(e,this.bits),d=[];let i=t,o=i;for(let t=0;t<n;t++){o=i,d.push(o);for(let t=1;t<r;t++)o=o.add(i),d.push(o);i=o.double()}return d}wNAF(t,e,n){if(!this.Fn.isValid(n))throw new Error("invalid scalar");let r=this.ZERO,d=this.BASE;const i=Gt(t,this.bits);for(let t=0;t<i.windows;t++){const{nextN:o,offset:s,isZero:a,isNeg:u,isNegF:c,offsetF:$}=Vt(n,t,i);n=o,a?d=d.add(Kt(c,e[$])):r=r.add(Kt(u,e[s]))}return Jt(n),{p:r,f:d}}wNAFUnsafe(t,e,n,r=this.ZERO){const d=Gt(t,this.bits);for(let t=0;t<d.windows&&n!==Ft;t++){const{nextN:i,offset:o,isZero:s,isNeg:a}=Vt(n,t,d);if(n=i,!s){const t=e[o];r=r.add(a?t.negate():t)}}return Jt(n),r}getPrecomputes(t,e,n){let r=qt.get(e);return r||(r=this.precomputeWindow(e,t),1!==t&&("function"==typeof n&&(r=n(r)),qt.set(e,r))),r}cached(t,e,n){const r=Wt(t);return this.wNAF(r,this.getPrecomputes(r,t,n),e)}unsafe(t,e,n,r){const d=Wt(t);return 1===d?this._unsafeLadder(t,e,r):this.wNAFUnsafe(d,this.getPrecomputes(d,t,n),e,r)}createCache(t,e){Ht(e,this.bits),Zt.set(t,e),qt.delete(t)}hasCache(t){return 1!==Wt(t)}}function zt(t,e,n,r){!function(t,e){if(!Array.isArray(t))throw new Error("array expected");t.forEach((t,n)=>{if(!(t instanceof e))throw new Error("invalid point at index "+n)})}(n,t),function(t,e){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((t,n)=>{if(!e.isValid(t))throw new Error("invalid scalar at index "+n)})}(r,e);const d=n.length,i=r.length;if(d!==i)throw new Error("arrays of points and scalars must have equal length");const o=t.ZERO,s=ut(BigInt(d));let a=1;s>12?a=s-3:s>4?a=s-2:s>0&&(a=2);const u=ct(a),c=new Array(Number(u)+1).fill(o);let $=o;for(let t=Math.floor((e.BITS-1)/a)*a;t>=0;t-=a){c.fill(o);for(let e=0;e<i;e++){const d=r[e],i=Number(d>>BigInt(t)&u);c[i]=c[i].add(n[e])}let e=o;for(let t=c.length-1,n=o;t>0;t--)n=n.add(c[t]),e=e.add(n);if($=$.add(e),0!==t)for(let t=0;t<a;t++)$=$.double()}return $}function Xt(t,e,n){if(e){if(e.ORDER!==t)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return function(t){$t(t,kt.reduce((t,e)=>(t[e]="function",t),{ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"}))}(e),e}return Mt(t,{isLE:n})}
7
7
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
8
- const Qt=(t,e)=>(t+(t>=0?e:-e)/oe)/e;function te(t){if(!["compact","recovered","der"].includes(t))throw new Error('Signature format must be "compact", "recovered", or "der"');return t}function ee(t,e){const n={};for(let r of Object.keys(e))n[r]=void 0===t[r]?e[r]:t[r];return X(n.lowS,"lowS"),X(n.prehash,"prehash"),void 0!==n.format&&te(n.format),n}class ne extends Error{constructor(t=""){super(t)}}const re={Err:ne,_tlv:{encode:(t,e)=>{const{Err:n}=re;if(t<0||t>256)throw new n("tlv.encode: wrong tag");if(1&e.length)throw new n("tlv.encode: unpadded data");const r=e.length/2,d=tt(r);if(d.length/2&128)throw new n("tlv.encode: long form length too big");const i=r>127?tt(d.length/2|128):"";return tt(t)+i+d+e},decode(t,e){const{Err:n}=re;let r=0;if(t<0||t>256)throw new n("tlv.encode: wrong tag");if(e.length<2||e[r++]!==t)throw new n("tlv.decode: wrong tlv");const d=e[r++];let i=0;if(!!(128&d)){const t=127&d;if(!t)throw new n("tlv.decode(long): indefinite length not supported");if(t>4)throw new n("tlv.decode(long): byte length is too big");const o=e.subarray(r,r+t);if(o.length!==t)throw new n("tlv.decode: length bytes not complete");if(0===o[0])throw new n("tlv.decode(long): zero leftmost byte");for(const t of o)i=i<<8|t;if(r+=t,i<128)throw new n("tlv.decode(long): not minimal encoding")}else i=d;const o=e.subarray(r,r+i);if(o.length!==i)throw new n("tlv.decode: wrong value length");return{v:o,l:e.subarray(r+i)}}},_int:{encode(t){const{Err:e}=re;if(t<de)throw new e("integer: negative integers are not allowed");let n=tt(t);if(8&Number.parseInt(n[0],16)&&(n="00"+n),1&n.length)throw new e("unexpected DER parsing assertion: unpadded hex");return n},decode(t){const{Err:e}=re;if(128&t[0])throw new e("invalid signature integer: negative");if(0===t[0]&&!(128&t[1]))throw new e("invalid signature integer: unnecessary leading zero");return nt(t)}},toSig(t){const{Err:e,_int:n,_tlv:r}=re,d=ot("signature",t),{v:i,l:o}=r.decode(48,d);if(o.length)throw new e("invalid signature: left bytes after parsing");const{v:s,l:a}=r.decode(2,i),{v:u,l:c}=r.decode(2,a);if(c.length)throw new e("invalid signature: left bytes after parsing");return{r:n.decode(s),s:n.decode(u)}},hexFromSig(t){const{_tlv:e,_int:n}=re,r=e.encode(2,n.encode(t.r))+e.encode(2,n.encode(t.s));return e.encode(48,r)}},de=BigInt(0),ie=BigInt(1),oe=BigInt(2),se=BigInt(3),ae=BigInt(4);function ue(t,e){const{BYTES:n}=t;let r;if("bigint"==typeof e)r=e;else{let d=ot("private key",e);try{r=t.fromBytes(d)}catch(t){throw new Error(`invalid private key: expected ui8a of size ${n}, got ${typeof e}`)}}if(!t.isValidNot0(r))throw new Error("invalid private key: out of range [1..N-1]");return r}function ce(t,e={}){const n=function(t,e,n={},r){if(void 0===r&&(r="edwards"===t),!e||"object"!=typeof e)throw new Error(`expected valid ${t} CURVE object`);for(const t of["p","n","h"]){const n=e[t];if(!("bigint"==typeof n&&n>Ft))throw new Error(`CURVE.${t} must be positive bigint`)}const d=Xt(e.p,n.Fp,r),i=Xt(e.n,n.Fn,r),o=["Gx","Gy","a","b"];for(const t of o)if(!d.isValid(e[t]))throw new Error(`CURVE.${t} must be valid field element of CURVE.Fp`);return{CURVE:e=Object.freeze(Object.assign({},e)),Fp:d,Fn:i}}("weierstrass",t,e),{Fp:r,Fn:d}=n;let i=n.CURVE;const{h:o,n:s}=i;$t(e,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});const{endo:a}=e;if(a&&(!r.is0(i.a)||"bigint"!=typeof a.beta||!Array.isArray(a.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');const u=le(r,d);function c(){if(!r.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}const $=e.toBytes||function(t,e,n){const{x:d,y:i}=e.toAffine(),o=r.toBytes(d);if(X(n,"isCompressed"),n){c();return O($e(!r.isOdd(i)),o)}return O(Uint8Array.of(4),o,r.toBytes(i))},f=e.fromBytes||function(t){Q(t,void 0,"Point");const{publicKey:e,publicKeyUncompressed:n}=u,d=t.length,i=t[0],o=t.subarray(1);if(d!==e||2!==i&&3!==i){if(d===n&&4===i){const t=r.BYTES,e=r.fromBytes(o.subarray(0,t)),n=r.fromBytes(o.subarray(t,2*t));if(!y(e,n))throw new Error("bad point: is not on curve");return{x:e,y:n}}throw new Error(`bad point: got length ${d}, expected compressed=${e} or uncompressed=${n}`)}{const t=r.fromBytes(o);if(!r.isValid(t))throw new Error("bad point: is not on curve, wrong x");const e=h(t);let n;try{n=r.sqrt(e)}catch(t){const e=t instanceof Error?": "+t.message:"";throw new Error("bad point: is not on curve, sqrt error"+e)}c();return!(1&~i)!==r.isOdd(n)&&(n=r.neg(n)),{x:t,y:n}}};function h(t){const e=r.sqr(t),n=r.mul(e,t);return r.add(r.add(n,r.mul(t,i.a)),i.b)}function y(t,e){const n=r.sqr(e),d=h(t);return r.eql(n,d)}if(!y(i.Gx,i.Gy))throw new Error("bad curve params: generator point");const g=r.mul(r.pow(i.a,se),ae),p=r.mul(r.sqr(i.b),BigInt(27));if(r.is0(r.add(g,p)))throw new Error("bad curve params: a or b");function m(t,e,n=!1){if(!r.isValid(e)||n&&r.is0(e))throw new Error(`bad point coordinate ${t}`);return e}function b(t){if(!(t instanceof S))throw new Error("ProjectivePoint expected")}function w(t){if(!a||!a.basises)throw new Error("no endo");return function(t,e,n){const[[r,d],[i,o]]=e,s=Qt(o*t,n),a=Qt(-d*t,n);let u=t-s*r-a*i,c=-s*d-a*o;const $=u<de,l=c<de;$&&(u=-u),l&&(c=-c);const f=ct(Math.ceil(ut(n)/2))+ie;if(u<de||u>=f||c<de||c>=f)throw new Error("splitScalar (endomorphism): failed, k="+t);return{k1neg:$,k1:u,k2neg:l,k2:c}}(t,a.basises,d.ORDER)}const v=lt((t,e)=>{const{X:n,Y:d,Z:i}=t;if(r.eql(i,r.ONE))return{x:n,y:d};const o=t.is0();null==e&&(e=o?r.ONE:r.inv(i));const s=r.mul(n,e),a=r.mul(d,e),u=r.mul(i,e);if(o)return{x:r.ZERO,y:r.ZERO};if(!r.eql(u,r.ONE))throw new Error("invZ was invalid");return{x:s,y:a}}),E=lt(t=>{if(t.is0()){if(e.allowInfinityPoint&&!r.is0(t.Y))return;throw new Error("bad point: ZERO")}const{x:n,y:d}=t.toAffine();if(!r.isValid(n)||!r.isValid(d))throw new Error("bad point: x or y not field elements");if(!y(n,d))throw new Error("bad point: equation left != right");if(!t.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});function P(t,e,n,d,i){return n=new S(r.mul(n.X,t),n.Y,n.Z),e=jt(d,e),n=jt(i,n),e.add(n)}class S{constructor(t,e,n){this.X=m("x",t),this.Y=m("y",e,!0),this.Z=m("z",n),Object.freeze(this)}static CURVE(){return i}static fromAffine(t){const{x:e,y:n}=t||{};if(!t||!r.isValid(e)||!r.isValid(n))throw new Error("invalid affine point");if(t instanceof S)throw new Error("projective point not allowed");return r.is0(e)&&r.is0(n)?S.ZERO:new S(e,n,r.ONE)}static fromBytes(t){const e=S.fromAffine(f(Q(t,void 0,"point")));return e.assertValidity(),e}static fromHex(t){return S.fromBytes(ot("pointHex",t))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(t=8,e=!0){return C.createCache(this,t),e||this.multiply(se),this}assertValidity(){E(this)}hasEvenY(){const{y:t}=this.toAffine();if(!r.isOdd)throw new Error("Field doesn't support isOdd");return!r.isOdd(t)}equals(t){b(t);const{X:e,Y:n,Z:d}=this,{X:i,Y:o,Z:s}=t,a=r.eql(r.mul(e,s),r.mul(i,d)),u=r.eql(r.mul(n,s),r.mul(o,d));return a&&u}negate(){return new S(this.X,r.neg(this.Y),this.Z)}double(){const{a:t,b:e}=i,n=r.mul(e,se),{X:d,Y:o,Z:s}=this;let a=r.ZERO,u=r.ZERO,c=r.ZERO,$=r.mul(d,d),l=r.mul(o,o),f=r.mul(s,s),h=r.mul(d,o);return h=r.add(h,h),c=r.mul(d,s),c=r.add(c,c),a=r.mul(t,c),u=r.mul(n,f),u=r.add(a,u),a=r.sub(l,u),u=r.add(l,u),u=r.mul(a,u),a=r.mul(h,a),c=r.mul(n,c),f=r.mul(t,f),h=r.sub($,f),h=r.mul(t,h),h=r.add(h,c),c=r.add($,$),$=r.add(c,$),$=r.add($,f),$=r.mul($,h),u=r.add(u,$),f=r.mul(o,s),f=r.add(f,f),$=r.mul(f,h),a=r.sub(a,$),c=r.mul(f,l),c=r.add(c,c),c=r.add(c,c),new S(a,u,c)}add(t){b(t);const{X:e,Y:n,Z:d}=this,{X:o,Y:s,Z:a}=t;let u=r.ZERO,c=r.ZERO,$=r.ZERO;const l=i.a,f=r.mul(i.b,se);let h=r.mul(e,o),y=r.mul(n,s),g=r.mul(d,a),p=r.add(e,n),m=r.add(o,s);p=r.mul(p,m),m=r.add(h,y),p=r.sub(p,m),m=r.add(e,d);let w=r.add(o,a);return m=r.mul(m,w),w=r.add(h,g),m=r.sub(m,w),w=r.add(n,d),u=r.add(s,a),w=r.mul(w,u),u=r.add(y,g),w=r.sub(w,u),$=r.mul(l,m),u=r.mul(f,g),$=r.add(u,$),u=r.sub(y,$),$=r.add(y,$),c=r.mul(u,$),y=r.add(h,h),y=r.add(y,h),g=r.mul(l,g),m=r.mul(f,m),y=r.add(y,g),g=r.sub(h,g),g=r.mul(l,g),m=r.add(m,g),h=r.mul(y,m),c=r.add(c,h),h=r.mul(w,m),u=r.mul(p,u),u=r.sub(u,h),h=r.mul(p,y),$=r.mul(w,$),$=r.add($,h),new S(u,c,$)}subtract(t){return this.add(t.negate())}is0(){return this.equals(S.ZERO)}multiply(t){const{endo:n}=e;if(!d.isValidNot0(t))throw new Error("invalid scalar: out of range");let r,i;const o=t=>C.cached(this,t,t=>Kt(S,t));if(n){const{k1neg:e,k1:d,k2neg:s,k2:a}=w(t),{p:u,f:c}=o(d),{p:$,f:l}=o(a);i=c.add(l),r=P(n.beta,u,$,e,s)}else{const{p:e,f:n}=o(t);r=e,i=n}return Kt(S,[r,i])[0]}multiplyUnsafe(t){const{endo:n}=e,r=this;if(!d.isValid(t))throw new Error("invalid scalar: out of range");if(t===de||r.is0())return S.ZERO;if(t===ie)return r;if(C.hasCache(this))return this.multiply(t);if(n){const{k1neg:e,k1:d,k2neg:i,k2:o}=w(t),{p1:s,p2:a}=function(t,e,n,r){let d=e,i=t.ZERO,o=t.ZERO;for(;n>Ft||r>Ft;)n&Dt&&(i=i.add(d)),r&Dt&&(o=o.add(d)),d=d.double(),n>>=Dt,r>>=Dt;return{p1:i,p2:o}}(S,r,d,o);return P(n.beta,s,a,e,i)}return C.unsafe(r,t)}multiplyAndAddUnsafe(t,e,n){const r=this.multiplyUnsafe(e).add(t.multiplyUnsafe(n));return r.is0()?void 0:r}toAffine(t){return v(this,t)}isTorsionFree(){const{isTorsionFree:t}=e;return o===ie||(t?t(S,this):C.unsafe(this,s).is0())}clearCofactor(){const{clearCofactor:t}=e;return o===ie?this:t?t(S,this):this.multiplyUnsafe(o)}isSmallOrder(){return this.multiplyUnsafe(o).is0()}toBytes(t=!0){return X(t,"isCompressed"),this.assertValidity(),$(S,this,t)}toHex(t=!0){return l(this.toBytes(t))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(t=!0){return this.toBytes(t)}_setWindowSize(t){this.precompute(t)}static normalizeZ(t){return Kt(S,t)}static msm(t,e){return zt(S,d,t,e)}static fromPrivateKey(t){return S.BASE.multiply(ue(d,t))}}S.BASE=new S(i.Gx,i.Gy,r.ONE),S.ZERO=new S(r.ZERO,r.ONE,r.ZERO),S.Fp=r,S.Fn=d;const N=d.BITS,C=new Yt(S,e.endo?Math.ceil(N/2):N);return S.BASE.precompute(8),S}function $e(t){return Uint8Array.of(t?2:3)}function le(t,e){return{secretKey:e.BYTES,publicKey:1+t.BYTES,publicKeyUncompressed:1+2*t.BYTES,publicKeyHasPrefix:!0,signature:2*e.BYTES}}function fe(t,n,r={}){d(n),$t(r,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const i=r.randomBytes||N,o=r.hmac||((t,...e)=>J(n,t,O(...e))),{Fp:s,Fn:a}=t,{ORDER:u,BITS:c}=a,{keygen:$,getPublicKey:f,getSharedSecret:h,utils:y,lengths:g}=function(t,e={}){const{Fn:n}=t,r=e.randomBytes||N,d=Object.assign(le(t.Fp,n),{seed:Lt(n.ORDER)});function i(t){try{return!!ue(n,t)}catch(t){return!1}}function o(t=r(d.seed)){return Ut(Q(t,d.seed,"seed"),n.ORDER)}function s(e,r=!0){return t.BASE.multiply(ue(n,e)).toBytes(r)}function a(e){if("bigint"==typeof e)return!1;if(e instanceof t)return!0;const{secretKey:r,publicKey:i,publicKeyUncompressed:o}=d;if(n.allowedLengths||r===i)return;const s=ot("key",e).length;return s===i||s===o}const u={isValidSecretKey:i,isValidPublicKey:function(e,n){const{publicKey:r,publicKeyUncompressed:i}=d;try{const d=e.length;return!(!0===n&&d!==r||!1===n&&d!==i||!t.fromBytes(e))}catch(t){return!1}},randomSecretKey:o,isValidPrivateKey:i,randomPrivateKey:o,normPrivateKeyToScalar:t=>ue(n,t),precompute:(e=8,n=t.BASE)=>n.precompute(e,!1)};return Object.freeze({getPublicKey:s,getSharedSecret:function(e,r,d=!0){if(!0===a(e))throw new Error("first arg must be private key");if(!1===a(r))throw new Error("second arg must be public key");const i=ue(n,e);return t.fromHex(r).multiply(i).toBytes(d)},keygen:function(t){const e=o(t);return{secretKey:e,publicKey:s(e)}},Point:t,utils:u,lengths:d})}(t,r),p={prehash:!1,lowS:"boolean"==typeof r.lowS&&r.lowS,format:void 0,extraEntropy:!1},m="compact";function b(t){return t>u>>ie}function v(t,e){if(!a.isValidNot0(e))throw new Error(`invalid signature ${t}: out of range 1..Point.Fn.ORDER`);return e}class E{constructor(t,e,n){this.r=v("r",t),this.s=v("s",e),null!=n&&(this.recovery=n),Object.freeze(this)}static fromBytes(t,e=m){let n;if(function(t,e){te(e);const n=g.signature;Q(t,"compact"===e?n:"recovered"===e?n+1:void 0,`${e} signature`)}(t,e),"der"===e){const{r:e,s:n}=re.toSig(Q(t));return new E(e,n)}"recovered"===e&&(n=t[0],e="compact",t=t.subarray(1));const r=a.BYTES,d=t.subarray(0,r),i=t.subarray(r,2*r);return new E(a.fromBytes(d),a.fromBytes(i),n)}static fromHex(t,e){return this.fromBytes(w(t),e)}addRecoveryBit(t){return new E(this.r,this.s,t)}recoverPublicKey(e){const n=s.ORDER,{r:r,s:d,recovery:i}=this;if(null==i||![0,1,2,3].includes(i))throw new Error("recovery id invalid");if(u*oe<n&&i>1)throw new Error("recovery id is ambiguous for h>1 curve");const o=2===i||3===i?r+u:r;if(!s.isValid(o))throw new Error("recovery id 2 or 3 invalid");const c=s.toBytes(o),$=t.fromBytes(O($e(!(1&i)),c)),l=a.inv(o),f=S(ot("msgHash",e)),h=a.create(-f*l),y=a.create(d*l),g=t.BASE.multiplyUnsafe(h).add($.multiplyUnsafe(y));if(g.is0())throw new Error("point at infinify");return g.assertValidity(),g}hasHighS(){return b(this.s)}toBytes(t=m){if(te(t),"der"===t)return w(re.hexFromSig(this));const e=a.toBytes(this.r),n=a.toBytes(this.s);if("recovered"===t){if(null==this.recovery)throw new Error("recovery bit must be present");return O(Uint8Array.of(this.recovery),e,n)}return O(e,n)}toHex(t){return l(this.toBytes(t))}assertValidity(){}static fromCompact(t){return E.fromBytes(ot("sig",t),"compact")}static fromDER(t){return E.fromBytes(ot("sig",t),"der")}normalizeS(){return this.hasHighS()?new E(this.r,a.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return l(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return l(this.toBytes("compact"))}}const P=r.bits2int||function(t){if(t.length>8192)throw new Error("input is too large");const e=nt(t),n=8*t.length-c;return n>0?e>>BigInt(n):e},S=r.bits2int_modN||function(t){return a.create(P(t))},C=ct(c);function A(t){return function(t,e,n,r){if(!at(e,n,r))throw new Error("expected valid "+t+": "+n+" <= n < "+r+", got "+e)}("num < 2^"+c,t,de,C),a.toBytes(t)}function I(t,e){return Q(t,void 0,"message"),e?Q(n(t),void 0,"prehashed message"):t}return Object.freeze({keygen:$,getPublicKey:f,getSharedSecret:h,utils:y,lengths:g,Point:t,sign:function(e,r,d={}){e=ot("message",e);const{seed:s,k2sig:u}=function(e,n,r){if(["recovered","canonical"].some(t=>t in r))throw new Error("sign() legacy options not supported");const{lowS:d,prehash:o,extraEntropy:s}=ee(r,p);e=I(e,o);const u=S(e),c=ue(a,n),$=[A(c),A(u)];if(null!=s&&!1!==s){const t=!0===s?i(g.secretKey):s;$.push(ot("extraEntropy",t))}const l=O(...$),f=u;return{seed:l,k2sig:function(e){const n=P(e);if(!a.isValidNot0(n))return;const r=a.inv(n),i=t.BASE.multiply(n).toAffine(),o=a.create(i.x);if(o===de)return;const s=a.create(r*a.create(f+o*c));if(s===de)return;let u=(i.x===o?0:2)|Number(i.y&ie),$=s;return d&&b(s)&&($=a.neg(s),u^=1),new E(o,$,u)}}}(e,r,d);return function(t,e,n){if("number"!=typeof t||t<2)throw new Error("hashLen must be a number");if("number"!=typeof e||e<2)throw new Error("qByteLen must be a number");if("function"!=typeof n)throw new Error("hmacFn must be a function");const r=t=>new Uint8Array(t),d=t=>Uint8Array.of(t);let i=r(t),o=r(t),s=0;const a=()=>{i.fill(1),o.fill(0),s=0},u=(...t)=>n(o,i,...t),c=(t=r(0))=>{o=u(d(0),t),i=u(),0!==t.length&&(o=u(d(1),t),i=u())},$=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let t=0;const n=[];for(;t<e;){i=u();const e=i.slice();n.push(e),t+=i.length}return O(...n)};return(t,e)=>{let n;for(a(),c(t);!(n=e($()));)c();return a(),n}}(n.outputLen,a.BYTES,o)(s,u)},verify:function(n,r,d,i={}){const{lowS:o,prehash:s,format:u}=ee(i,p);if(d=ot("publicKey",d),r=I(ot("message",r),s),"strict"in i)throw new Error("options.strict was renamed to lowS");const c=void 0===u?function(t){let n;const r="string"==typeof t||e(t),d=!r&&null!==t&&"object"==typeof t&&"bigint"==typeof t.r&&"bigint"==typeof t.s;if(!r&&!d)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(d)n=new E(t.r,t.s);else if(r){try{n=E.fromBytes(ot("sig",t),"der")}catch(t){if(!(t instanceof re.Err))throw t}if(!n)try{n=E.fromBytes(ot("sig",t),"compact")}catch(t){return!1}}return n||!1}(n):E.fromBytes(ot("sig",n),u);if(!1===c)return!1;try{const e=t.fromBytes(d);if(o&&c.hasHighS())return!1;const{r:n,s:i}=c,s=S(r),u=a.inv(i),$=a.create(s*u),l=a.create(n*u),f=t.BASE.multiplyUnsafe($).add(e.multiplyUnsafe(l));if(f.is0())return!1;return a.create(f.x)===n}catch(t){return!1}},recoverPublicKey:function(t,e,n={}){const{prehash:r}=ee(n,p);return e=I(e,r),E.fromBytes(t,"recovered").recoverPublicKey(e).toBytes()},Signature:E,hash:n})}function he(t){const{CURVE:e,curveOpts:n}=function(t){const e={a:t.a,b:t.b,p:t.Fp.ORDER,n:t.n,h:t.h,Gx:t.Gx,Gy:t.Gy},n=t.Fp;let r=t.allowedPrivateKeyLengths?Array.from(new Set(t.allowedPrivateKeyLengths.map(t=>Math.ceil(t/2)))):void 0;return{CURVE:e,curveOpts:{Fp:n,Fn:Mt(e.n,{BITS:t.nBitLength,allowedLengths:r,modFromBytes:t.wrapPrivateKey}),allowInfinityPoint:t.allowInfinityPoint,endo:t.endo,isTorsionFree:t.isTorsionFree,clearCofactor:t.clearCofactor,fromBytes:t.fromBytes,toBytes:t.toBytes}}}(t),r={hmac:t.hmac,randomBytes:t.randomBytes,lowS:t.lowS,bits2int:t.bits2int,bits2int_modN:t.bits2int_modN};return{CURVE:e,curveOpts:n,hash:t.hash,ecdsaOpts:r}}function ye(t){const{CURVE:e,curveOpts:n,hash:r,ecdsaOpts:d}=he(t);return function(t,e){const n=e.Point;return Object.assign({},e,{ProjectivePoint:n,CURVE:Object.assign({},t,Rt(n.Fn.ORDER,n.Fn.BITS))})}(t,fe(ce(e,n),r,d))}
8
+ const Qt=(t,e)=>(t+(t>=0?e:-e)/oe)/e;function te(t){if(!["compact","recovered","der"].includes(t))throw new Error('Signature format must be "compact", "recovered", or "der"');return t}function ee(t,e){const n={};for(let r of Object.keys(e))n[r]=void 0===t[r]?e[r]:t[r];return X(n.lowS,"lowS"),X(n.prehash,"prehash"),void 0!==n.format&&te(n.format),n}class ne extends Error{constructor(t=""){super(t)}}const re={Err:ne,_tlv:{encode:(t,e)=>{const{Err:n}=re;if(t<0||t>256)throw new n("tlv.encode: wrong tag");if(1&e.length)throw new n("tlv.encode: unpadded data");const r=e.length/2,d=tt(r);if(d.length/2&128)throw new n("tlv.encode: long form length too big");const i=r>127?tt(d.length/2|128):"";return tt(t)+i+d+e},decode(t,e){const{Err:n}=re;let r=0;if(t<0||t>256)throw new n("tlv.encode: wrong tag");if(e.length<2||e[r++]!==t)throw new n("tlv.decode: wrong tlv");const d=e[r++];let i=0;if(!!(128&d)){const t=127&d;if(!t)throw new n("tlv.decode(long): indefinite length not supported");if(t>4)throw new n("tlv.decode(long): byte length is too big");const o=e.subarray(r,r+t);if(o.length!==t)throw new n("tlv.decode: length bytes not complete");if(0===o[0])throw new n("tlv.decode(long): zero leftmost byte");for(const t of o)i=i<<8|t;if(r+=t,i<128)throw new n("tlv.decode(long): not minimal encoding")}else i=d;const o=e.subarray(r,r+i);if(o.length!==i)throw new n("tlv.decode: wrong value length");return{v:o,l:e.subarray(r+i)}}},_int:{encode(t){const{Err:e}=re;if(t<de)throw new e("integer: negative integers are not allowed");let n=tt(t);if(8&Number.parseInt(n[0],16)&&(n="00"+n),1&n.length)throw new e("unexpected DER parsing assertion: unpadded hex");return n},decode(t){const{Err:e}=re;if(128&t[0])throw new e("invalid signature integer: negative");if(0===t[0]&&!(128&t[1]))throw new e("invalid signature integer: unnecessary leading zero");return nt(t)}},toSig(t){const{Err:e,_int:n,_tlv:r}=re,d=ot("signature",t),{v:i,l:o}=r.decode(48,d);if(o.length)throw new e("invalid signature: left bytes after parsing");const{v:s,l:a}=r.decode(2,i),{v:u,l:c}=r.decode(2,a);if(c.length)throw new e("invalid signature: left bytes after parsing");return{r:n.decode(s),s:n.decode(u)}},hexFromSig(t){const{_tlv:e,_int:n}=re,r=e.encode(2,n.encode(t.r))+e.encode(2,n.encode(t.s));return e.encode(48,r)}},de=BigInt(0),ie=BigInt(1),oe=BigInt(2),se=BigInt(3),ae=BigInt(4);function ue(t,e){const{BYTES:n}=t;let r;if("bigint"==typeof e)r=e;else{let d=ot("private key",e);try{r=t.fromBytes(d)}catch(t){throw new Error(`invalid private key: expected ui8a of size ${n}, got ${typeof e}`)}}if(!t.isValidNot0(r))throw new Error("invalid private key: out of range [1..N-1]");return r}function ce(t,e={}){const n=function(t,e,n={},r){if(void 0===r&&(r="edwards"===t),!e||"object"!=typeof e)throw new Error(`expected valid ${t} CURVE object`);for(const t of["p","n","h"]){const n=e[t];if(!("bigint"==typeof n&&n>Ft))throw new Error(`CURVE.${t} must be positive bigint`)}const d=Xt(e.p,n.Fp,r),i=Xt(e.n,n.Fn,r),o=["Gx","Gy","a","b"];for(const t of o)if(!d.isValid(e[t]))throw new Error(`CURVE.${t} must be valid field element of CURVE.Fp`);return{CURVE:e=Object.freeze(Object.assign({},e)),Fp:d,Fn:i}}("weierstrass",t,e),{Fp:r,Fn:d}=n;let i=n.CURVE;const{h:o,n:s}=i;$t(e,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});const{endo:a}=e;if(a&&(!r.is0(i.a)||"bigint"!=typeof a.beta||!Array.isArray(a.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');const u=le(r,d);function c(){if(!r.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}const $=e.toBytes||function(t,e,n){const{x:d,y:i}=e.toAffine(),o=r.toBytes(d);if(X(n,"isCompressed"),n){c();return O($e(!r.isOdd(i)),o)}return O(Uint8Array.of(4),o,r.toBytes(i))},f=e.fromBytes||function(t){Q(t,void 0,"Point");const{publicKey:e,publicKeyUncompressed:n}=u,d=t.length,i=t[0],o=t.subarray(1);if(d!==e||2!==i&&3!==i){if(d===n&&4===i){const t=r.BYTES,e=r.fromBytes(o.subarray(0,t)),n=r.fromBytes(o.subarray(t,2*t));if(!y(e,n))throw new Error("bad point: is not on curve");return{x:e,y:n}}throw new Error(`bad point: got length ${d}, expected compressed=${e} or uncompressed=${n}`)}{const t=r.fromBytes(o);if(!r.isValid(t))throw new Error("bad point: is not on curve, wrong x");const e=h(t);let n;try{n=r.sqrt(e)}catch(t){const e=t instanceof Error?": "+t.message:"";throw new Error("bad point: is not on curve, sqrt error"+e)}c();return!(1&~i)!==r.isOdd(n)&&(n=r.neg(n)),{x:t,y:n}}};function h(t){const e=r.sqr(t),n=r.mul(e,t);return r.add(r.add(n,r.mul(t,i.a)),i.b)}function y(t,e){const n=r.sqr(e),d=h(t);return r.eql(n,d)}if(!y(i.Gx,i.Gy))throw new Error("bad curve params: generator point");const g=r.mul(r.pow(i.a,se),ae),p=r.mul(r.sqr(i.b),BigInt(27));if(r.is0(r.add(g,p)))throw new Error("bad curve params: a or b");function m(t,e,n=!1){if(!r.isValid(e)||n&&r.is0(e))throw new Error(`bad point coordinate ${t}`);return e}function b(t){if(!(t instanceof P))throw new Error("ProjectivePoint expected")}function w(t){if(!a||!a.basises)throw new Error("no endo");return function(t,e,n){const[[r,d],[i,o]]=e,s=Qt(o*t,n),a=Qt(-d*t,n);let u=t-s*r-a*i,c=-s*d-a*o;const $=u<de,l=c<de;$&&(u=-u),l&&(c=-c);const f=ct(Math.ceil(ut(n)/2))+ie;if(u<de||u>=f||c<de||c>=f)throw new Error("splitScalar (endomorphism): failed, k="+t);return{k1neg:$,k1:u,k2neg:l,k2:c}}(t,a.basises,d.ORDER)}const v=lt((t,e)=>{const{X:n,Y:d,Z:i}=t;if(r.eql(i,r.ONE))return{x:n,y:d};const o=t.is0();null==e&&(e=o?r.ONE:r.inv(i));const s=r.mul(n,e),a=r.mul(d,e),u=r.mul(i,e);if(o)return{x:r.ZERO,y:r.ZERO};if(!r.eql(u,r.ONE))throw new Error("invZ was invalid");return{x:s,y:a}}),E=lt(t=>{if(t.is0()){if(e.allowInfinityPoint&&!r.is0(t.Y))return;throw new Error("bad point: ZERO")}const{x:n,y:d}=t.toAffine();if(!r.isValid(n)||!r.isValid(d))throw new Error("bad point: x or y not field elements");if(!y(n,d))throw new Error("bad point: equation left != right");if(!t.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});function S(t,e,n,d,i){return n=new P(r.mul(n.X,t),n.Y,n.Z),e=Kt(d,e),n=Kt(i,n),e.add(n)}class P{constructor(t,e,n){this.X=m("x",t),this.Y=m("y",e,!0),this.Z=m("z",n),Object.freeze(this)}static CURVE(){return i}static fromAffine(t){const{x:e,y:n}=t||{};if(!t||!r.isValid(e)||!r.isValid(n))throw new Error("invalid affine point");if(t instanceof P)throw new Error("projective point not allowed");return r.is0(e)&&r.is0(n)?P.ZERO:new P(e,n,r.ONE)}static fromBytes(t){const e=P.fromAffine(f(Q(t,void 0,"point")));return e.assertValidity(),e}static fromHex(t){return P.fromBytes(ot("pointHex",t))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(t=8,e=!0){return N.createCache(this,t),e||this.multiply(se),this}assertValidity(){E(this)}hasEvenY(){const{y:t}=this.toAffine();if(!r.isOdd)throw new Error("Field doesn't support isOdd");return!r.isOdd(t)}equals(t){b(t);const{X:e,Y:n,Z:d}=this,{X:i,Y:o,Z:s}=t,a=r.eql(r.mul(e,s),r.mul(i,d)),u=r.eql(r.mul(n,s),r.mul(o,d));return a&&u}negate(){return new P(this.X,r.neg(this.Y),this.Z)}double(){const{a:t,b:e}=i,n=r.mul(e,se),{X:d,Y:o,Z:s}=this;let a=r.ZERO,u=r.ZERO,c=r.ZERO,$=r.mul(d,d),l=r.mul(o,o),f=r.mul(s,s),h=r.mul(d,o);return h=r.add(h,h),c=r.mul(d,s),c=r.add(c,c),a=r.mul(t,c),u=r.mul(n,f),u=r.add(a,u),a=r.sub(l,u),u=r.add(l,u),u=r.mul(a,u),a=r.mul(h,a),c=r.mul(n,c),f=r.mul(t,f),h=r.sub($,f),h=r.mul(t,h),h=r.add(h,c),c=r.add($,$),$=r.add(c,$),$=r.add($,f),$=r.mul($,h),u=r.add(u,$),f=r.mul(o,s),f=r.add(f,f),$=r.mul(f,h),a=r.sub(a,$),c=r.mul(f,l),c=r.add(c,c),c=r.add(c,c),new P(a,u,c)}add(t){b(t);const{X:e,Y:n,Z:d}=this,{X:o,Y:s,Z:a}=t;let u=r.ZERO,c=r.ZERO,$=r.ZERO;const l=i.a,f=r.mul(i.b,se);let h=r.mul(e,o),y=r.mul(n,s),g=r.mul(d,a),p=r.add(e,n),m=r.add(o,s);p=r.mul(p,m),m=r.add(h,y),p=r.sub(p,m),m=r.add(e,d);let w=r.add(o,a);return m=r.mul(m,w),w=r.add(h,g),m=r.sub(m,w),w=r.add(n,d),u=r.add(s,a),w=r.mul(w,u),u=r.add(y,g),w=r.sub(w,u),$=r.mul(l,m),u=r.mul(f,g),$=r.add(u,$),u=r.sub(y,$),$=r.add(y,$),c=r.mul(u,$),y=r.add(h,h),y=r.add(y,h),g=r.mul(l,g),m=r.mul(f,m),y=r.add(y,g),g=r.sub(h,g),g=r.mul(l,g),m=r.add(m,g),h=r.mul(y,m),c=r.add(c,h),h=r.mul(w,m),u=r.mul(p,u),u=r.sub(u,h),h=r.mul(p,y),$=r.mul(w,$),$=r.add($,h),new P(u,c,$)}subtract(t){return this.add(t.negate())}is0(){return this.equals(P.ZERO)}multiply(t){const{endo:n}=e;if(!d.isValidNot0(t))throw new Error("invalid scalar: out of range");let r,i;const o=t=>N.cached(this,t,t=>jt(P,t));if(n){const{k1neg:e,k1:d,k2neg:s,k2:a}=w(t),{p:u,f:c}=o(d),{p:$,f:l}=o(a);i=c.add(l),r=S(n.beta,u,$,e,s)}else{const{p:e,f:n}=o(t);r=e,i=n}return jt(P,[r,i])[0]}multiplyUnsafe(t){const{endo:n}=e,r=this;if(!d.isValid(t))throw new Error("invalid scalar: out of range");if(t===de||r.is0())return P.ZERO;if(t===ie)return r;if(N.hasCache(this))return this.multiply(t);if(n){const{k1neg:e,k1:d,k2neg:i,k2:o}=w(t),{p1:s,p2:a}=function(t,e,n,r){let d=e,i=t.ZERO,o=t.ZERO;for(;n>Ft||r>Ft;)n&Dt&&(i=i.add(d)),r&Dt&&(o=o.add(d)),d=d.double(),n>>=Dt,r>>=Dt;return{p1:i,p2:o}}(P,r,d,o);return S(n.beta,s,a,e,i)}return N.unsafe(r,t)}multiplyAndAddUnsafe(t,e,n){const r=this.multiplyUnsafe(e).add(t.multiplyUnsafe(n));return r.is0()?void 0:r}toAffine(t){return v(this,t)}isTorsionFree(){const{isTorsionFree:t}=e;return o===ie||(t?t(P,this):N.unsafe(this,s).is0())}clearCofactor(){const{clearCofactor:t}=e;return o===ie?this:t?t(P,this):this.multiplyUnsafe(o)}isSmallOrder(){return this.multiplyUnsafe(o).is0()}toBytes(t=!0){return X(t,"isCompressed"),this.assertValidity(),$(P,this,t)}toHex(t=!0){return l(this.toBytes(t))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(t=!0){return this.toBytes(t)}_setWindowSize(t){this.precompute(t)}static normalizeZ(t){return jt(P,t)}static msm(t,e){return zt(P,d,t,e)}static fromPrivateKey(t){return P.BASE.multiply(ue(d,t))}}P.BASE=new P(i.Gx,i.Gy,r.ONE),P.ZERO=new P(r.ZERO,r.ONE,r.ZERO),P.Fp=r,P.Fn=d;const C=d.BITS,N=new Yt(P,e.endo?Math.ceil(C/2):C);return P.BASE.precompute(8),P}function $e(t){return Uint8Array.of(t?2:3)}function le(t,e){return{secretKey:e.BYTES,publicKey:1+t.BYTES,publicKeyUncompressed:1+2*t.BYTES,publicKeyHasPrefix:!0,signature:2*e.BYTES}}function fe(t,n,r={}){d(n),$t(r,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const i=r.randomBytes||C,o=r.hmac||((t,...e)=>J(n,t,O(...e))),{Fp:s,Fn:a}=t,{ORDER:u,BITS:c}=a,{keygen:$,getPublicKey:f,getSharedSecret:h,utils:y,lengths:g}=function(t,e={}){const{Fn:n}=t,r=e.randomBytes||C,d=Object.assign(le(t.Fp,n),{seed:Lt(n.ORDER)});function i(t){try{return!!ue(n,t)}catch(t){return!1}}function o(t=r(d.seed)){return Ut(Q(t,d.seed,"seed"),n.ORDER)}function s(e,r=!0){return t.BASE.multiply(ue(n,e)).toBytes(r)}function a(e){if("bigint"==typeof e)return!1;if(e instanceof t)return!0;const{secretKey:r,publicKey:i,publicKeyUncompressed:o}=d;if(n.allowedLengths||r===i)return;const s=ot("key",e).length;return s===i||s===o}const u={isValidSecretKey:i,isValidPublicKey:function(e,n){const{publicKey:r,publicKeyUncompressed:i}=d;try{const d=e.length;return!(!0===n&&d!==r||!1===n&&d!==i||!t.fromBytes(e))}catch(t){return!1}},randomSecretKey:o,isValidPrivateKey:i,randomPrivateKey:o,normPrivateKeyToScalar:t=>ue(n,t),precompute:(e=8,n=t.BASE)=>n.precompute(e,!1)};return Object.freeze({getPublicKey:s,getSharedSecret:function(e,r,d=!0){if(!0===a(e))throw new Error("first arg must be private key");if(!1===a(r))throw new Error("second arg must be public key");const i=ue(n,e);return t.fromHex(r).multiply(i).toBytes(d)},keygen:function(t){const e=o(t);return{secretKey:e,publicKey:s(e)}},Point:t,utils:u,lengths:d})}(t,r),p={prehash:!1,lowS:"boolean"==typeof r.lowS&&r.lowS,format:void 0,extraEntropy:!1},m="compact";function b(t){return t>u>>ie}function v(t,e){if(!a.isValidNot0(e))throw new Error(`invalid signature ${t}: out of range 1..Point.Fn.ORDER`);return e}class E{constructor(t,e,n){this.r=v("r",t),this.s=v("s",e),null!=n&&(this.recovery=n),Object.freeze(this)}static fromBytes(t,e=m){let n;if(function(t,e){te(e);const n=g.signature;Q(t,"compact"===e?n:"recovered"===e?n+1:void 0,`${e} signature`)}(t,e),"der"===e){const{r:e,s:n}=re.toSig(Q(t));return new E(e,n)}"recovered"===e&&(n=t[0],e="compact",t=t.subarray(1));const r=a.BYTES,d=t.subarray(0,r),i=t.subarray(r,2*r);return new E(a.fromBytes(d),a.fromBytes(i),n)}static fromHex(t,e){return this.fromBytes(w(t),e)}addRecoveryBit(t){return new E(this.r,this.s,t)}recoverPublicKey(e){const n=s.ORDER,{r:r,s:d,recovery:i}=this;if(null==i||![0,1,2,3].includes(i))throw new Error("recovery id invalid");if(u*oe<n&&i>1)throw new Error("recovery id is ambiguous for h>1 curve");const o=2===i||3===i?r+u:r;if(!s.isValid(o))throw new Error("recovery id 2 or 3 invalid");const c=s.toBytes(o),$=t.fromBytes(O($e(!(1&i)),c)),l=a.inv(o),f=P(ot("msgHash",e)),h=a.create(-f*l),y=a.create(d*l),g=t.BASE.multiplyUnsafe(h).add($.multiplyUnsafe(y));if(g.is0())throw new Error("point at infinify");return g.assertValidity(),g}hasHighS(){return b(this.s)}toBytes(t=m){if(te(t),"der"===t)return w(re.hexFromSig(this));const e=a.toBytes(this.r),n=a.toBytes(this.s);if("recovered"===t){if(null==this.recovery)throw new Error("recovery bit must be present");return O(Uint8Array.of(this.recovery),e,n)}return O(e,n)}toHex(t){return l(this.toBytes(t))}assertValidity(){}static fromCompact(t){return E.fromBytes(ot("sig",t),"compact")}static fromDER(t){return E.fromBytes(ot("sig",t),"der")}normalizeS(){return this.hasHighS()?new E(this.r,a.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return l(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return l(this.toBytes("compact"))}}const S=r.bits2int||function(t){if(t.length>8192)throw new Error("input is too large");const e=nt(t),n=8*t.length-c;return n>0?e>>BigInt(n):e},P=r.bits2int_modN||function(t){return a.create(S(t))},N=ct(c);function A(t){return function(t,e,n,r){if(!at(e,n,r))throw new Error("expected valid "+t+": "+n+" <= n < "+r+", got "+e)}("num < 2^"+c,t,de,N),a.toBytes(t)}function I(t,e){return Q(t,void 0,"message"),e?Q(n(t),void 0,"prehashed message"):t}return Object.freeze({keygen:$,getPublicKey:f,getSharedSecret:h,utils:y,lengths:g,Point:t,sign:function(e,r,d={}){e=ot("message",e);const{seed:s,k2sig:u}=function(e,n,r){if(["recovered","canonical"].some(t=>t in r))throw new Error("sign() legacy options not supported");const{lowS:d,prehash:o,extraEntropy:s}=ee(r,p);e=I(e,o);const u=P(e),c=ue(a,n),$=[A(c),A(u)];if(null!=s&&!1!==s){const t=!0===s?i(g.secretKey):s;$.push(ot("extraEntropy",t))}const l=O(...$),f=u;return{seed:l,k2sig:function(e){const n=S(e);if(!a.isValidNot0(n))return;const r=a.inv(n),i=t.BASE.multiply(n).toAffine(),o=a.create(i.x);if(o===de)return;const s=a.create(r*a.create(f+o*c));if(s===de)return;let u=(i.x===o?0:2)|Number(i.y&ie),$=s;return d&&b(s)&&($=a.neg(s),u^=1),new E(o,$,u)}}}(e,r,d);return function(t,e,n){if("number"!=typeof t||t<2)throw new Error("hashLen must be a number");if("number"!=typeof e||e<2)throw new Error("qByteLen must be a number");if("function"!=typeof n)throw new Error("hmacFn must be a function");const r=t=>new Uint8Array(t),d=t=>Uint8Array.of(t);let i=r(t),o=r(t),s=0;const a=()=>{i.fill(1),o.fill(0),s=0},u=(...t)=>n(o,i,...t),c=(t=r(0))=>{o=u(d(0),t),i=u(),0!==t.length&&(o=u(d(1),t),i=u())},$=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let t=0;const n=[];for(;t<e;){i=u();const e=i.slice();n.push(e),t+=i.length}return O(...n)};return(t,e)=>{let n;for(a(),c(t);!(n=e($()));)c();return a(),n}}(n.outputLen,a.BYTES,o)(s,u)},verify:function(n,r,d,i={}){const{lowS:o,prehash:s,format:u}=ee(i,p);if(d=ot("publicKey",d),r=I(ot("message",r),s),"strict"in i)throw new Error("options.strict was renamed to lowS");const c=void 0===u?function(t){let n;const r="string"==typeof t||e(t),d=!r&&null!==t&&"object"==typeof t&&"bigint"==typeof t.r&&"bigint"==typeof t.s;if(!r&&!d)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(d)n=new E(t.r,t.s);else if(r){try{n=E.fromBytes(ot("sig",t),"der")}catch(t){if(!(t instanceof re.Err))throw t}if(!n)try{n=E.fromBytes(ot("sig",t),"compact")}catch(t){return!1}}return n||!1}(n):E.fromBytes(ot("sig",n),u);if(!1===c)return!1;try{const e=t.fromBytes(d);if(o&&c.hasHighS())return!1;const{r:n,s:i}=c,s=P(r),u=a.inv(i),$=a.create(s*u),l=a.create(n*u),f=t.BASE.multiplyUnsafe($).add(e.multiplyUnsafe(l));if(f.is0())return!1;return a.create(f.x)===n}catch(t){return!1}},recoverPublicKey:function(t,e,n={}){const{prehash:r}=ee(n,p);return e=I(e,r),E.fromBytes(t,"recovered").recoverPublicKey(e).toBytes()},Signature:E,hash:n})}function he(t){const{CURVE:e,curveOpts:n}=function(t){const e={a:t.a,b:t.b,p:t.Fp.ORDER,n:t.n,h:t.h,Gx:t.Gx,Gy:t.Gy},n=t.Fp;let r=t.allowedPrivateKeyLengths?Array.from(new Set(t.allowedPrivateKeyLengths.map(t=>Math.ceil(t/2)))):void 0;return{CURVE:e,curveOpts:{Fp:n,Fn:Mt(e.n,{BITS:t.nBitLength,allowedLengths:r,modFromBytes:t.wrapPrivateKey}),allowInfinityPoint:t.allowInfinityPoint,endo:t.endo,isTorsionFree:t.isTorsionFree,clearCofactor:t.clearCofactor,fromBytes:t.fromBytes,toBytes:t.toBytes}}}(t),r={hmac:t.hmac,randomBytes:t.randomBytes,lowS:t.lowS,bits2int:t.bits2int,bits2int_modN:t.bits2int_modN};return{CURVE:e,curveOpts:n,hash:t.hash,ecdsaOpts:r}}function ye(t){const{CURVE:e,curveOpts:n,hash:r,ecdsaOpts:d}=he(t);return function(t,e){const n=e.Point;return Object.assign({},e,{ProjectivePoint:n,CURVE:Object.assign({},t,Rt(n.Fn.ORDER,n.Fn.BITS))})}(t,fe(ce(e,n),r,d))}
9
9
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
10
10
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
11
- const ge={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},pe={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]},me=BigInt(0),be=BigInt(1),we=BigInt(2);const ve=Mt(ge.p,{sqrt:function(t){const e=ge.p,n=BigInt(3),r=BigInt(6),d=BigInt(11),i=BigInt(22),o=BigInt(23),s=BigInt(44),a=BigInt(88),u=t*t*t%e,c=u*u*t%e,$=Pt(c,n,e)*c%e,l=Pt($,n,e)*c%e,f=Pt(l,we,e)*u%e,h=Pt(f,d,e)*f%e,y=Pt(h,i,e)*h%e,g=Pt(y,s,e)*y%e,p=Pt(g,a,e)*g%e,m=Pt(p,s,e)*y%e,b=Pt(m,n,e)*c%e,w=Pt(b,o,e)*h%e,v=Pt(w,r,e)*u%e,E=Pt(v,we,e);if(!ve.eql(ve.sqr(E),t))throw new Error("Cannot find square root");return E}}),Ee=function(t,e){const n=e=>ye({...t,hash:e});return{...n(e),create:n}}({...ge,Fp:ve,lowS:!0,endo:pe},Z),Oe={};function Pe(t,...e){let n=Oe[t];if(void 0===n){const e=Z(v(t));n=O(e,e),Oe[t]=n}return Z(O(n,...e))}const Se=t=>t.toBytes(!0).slice(1),Ne=(()=>Ee.Point)(),Ce=t=>t%we===me;function Ae(t){const{Fn:e,BASE:n}=Ne,r=ue(e,t),d=n.multiply(r);return{scalar:Ce(d.y)?r:e.neg(r),bytes:Se(d)}}function Ie(t){const e=ve;if(!e.isValidNot0(t))throw new Error("invalid x: Fail if x ≥ p");const n=e.create(t*t),r=e.create(n*t+BigInt(7));let d=e.sqrt(r);Ce(d)||(d=e.neg(d));const i=Ne.fromAffine({x:t,y:d});return i.assertValidity(),i}const xe=nt;function Te(...t){return Ne.Fn.create(xe(Pe("BIP0340/challenge",...t)))}function ke(t){return Ae(t).bytes}function Be(t,e,n=N(32)){const{Fn:r}=Ne,d=ot("message",t),{bytes:i,scalar:o}=Ae(e),s=ot("auxRand",n,32),a=r.toBytes(o^xe(Pe("BIP0340/aux",s))),u=Pe("BIP0340/nonce",a,i,d),{bytes:c,scalar:$}=Ae(u),l=Te(c,i,d),f=new Uint8Array(64);if(f.set(c,0),f.set(r.toBytes(r.create($+l*o)),32),!Re(f,d,i))throw new Error("sign: Invalid signature produced");return f}function Re(t,e,n){const{Fn:r,BASE:d}=Ne,i=ot("signature",t,64),o=ot("message",e),s=ot("publicKey",n,32);try{const t=Ie(xe(s)),e=xe(i.subarray(0,32));if(!at(e,be,ge.p))return!1;const n=xe(i.subarray(32,64));if(!at(n,be,ge.n))return!1;const a=Te(r.toBytes(e),Se(t),o),u=d.multiplyUnsafe(n).add(t.multiplyUnsafe(r.neg(a))),{x:c,y:$}=u.toAffine();return!(u.is0()||!Ce($)||c!==e)}catch(t){return!1}}const Me=(()=>{const t=(t=N(48))=>Ut(t,ge.n);return Ee.utils.randomSecretKey,{keygen:function(e){const n=t(e);return{secretKey:n,publicKey:ke(n)}},getPublicKey:ke,sign:Be,verify:Re,Point:Ne,utils:{randomSecretKey:t,randomPrivateKey:t,taggedHash:Pe,lift_x:Ie,pointToBytes:Se,numberToBytesBE:dt,bytesToNumberBE:nt,mod:Ot},lengths:{secretKey:32,publicKey:32,publicKeyHasPrefix:!1,signature:64,seed:48}}})();function _e(t){if(32!==t.length)throw new Error("Private key must be 32 bytes");return Me.getPublicKey(t)}function Le(t){return l(_e(w(t)))}function Ue(t,e){if(32!==t.length)throw new Error("Message must be 32 bytes");if(32!==e.length)throw new Error("Private key must be 32 bytes");return Me.sign(t,e)}function Fe(t,e){return l(Ue(t,e))}function De(t,e,n){if(64!==t.length)return!1;if(32!==e.length)return!1;if(32!==n.length)return!1;try{return Me.verify(t,e,n)}catch{return!1}}function je(t,e,n){try{const r=w(t);return De(r,e,w(n))}catch{return!1}}var Ke=Object.freeze({__proto__:null,getPublicKey:_e,getPublicKeyHex:Le,sign:Ue,signHex:Fe,verify:De,verifyHex:je});const He=Z;async function Ge(){if(void 0!==globalThis.crypto?.subtle)return globalThis.crypto;return(await import("crypto")).webcrypto}const Ve="gz:";function qe(t){if("undefined"!=typeof Buffer)return Buffer.from(t).toString("base64");let e="";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return btoa(e)}function Ze(t){if("undefined"!=typeof Buffer)return new Uint8Array(Buffer.from(t,"base64"));const e=atob(t),n=new Uint8Array(e.length);for(let t=0;t<e.length;t++)n[t]=e.charCodeAt(t);return n}function We(t){const e=new ArrayBuffer(t.length);return new Uint8Array(e).set(t),e}async function Je(t){return(await Ge()).subtle.importKey("raw",We(t),{name:"AES-CBC"},!1,["encrypt","decrypt"])}function Ye(t,e){if(32!==t.length)throw new Error("Private key must be 32 bytes");if(32!==e.length)throw new Error("Public key must be 32 bytes");const n=new Uint8Array(33);n[0]=2,n.set(e,1);const r=Ee.getSharedSecret(t,n).slice(1,33);return He(r)}async function ze(t,e,n){let r=(new TextEncoder).encode(t),d=!1,i=r;if(r.length>1024){const t=await async function(t){if("undefined"!=typeof process&&process.versions?.node){const{gzipSync:e}=await import("zlib");return new Uint8Array(e(Buffer.from(t)))}if("undefined"!=typeof CompressionStream){const e=new CompressionStream("gzip"),n=e.writable.getWriter();n.write(We(t)),n.close();const r=[],d=e.readable.getReader();for(;;){const{done:t,value:e}=await d.read();if(t)break;r.push(e)}const i=r.reduce((t,e)=>t+e.length,0),o=new Uint8Array(i);let s=0;for(const t of r)o.set(t,s),s+=t.length;return o}throw new Error("GZIP compression not supported in this environment")}(r);t.length<r.length&&(i=new Uint8Array(t),d=!0)}const o=Ye(e,n),s=N(16),a=await async function(t,e,n){const r=await Ge(),d=await Je(e),i=await r.subtle.encrypt({name:"AES-CBC",iv:We(n)},d,We(t));return new Uint8Array(i)}(i,o,s),u=qe(a),c=qe(s);return d?`${Ve}${u}?iv=${c}`:`${u}?iv=${c}`}async function Xe(t,e,n){let r=t,d=!1;r.startsWith(Ve)&&(r=r.slice(3),d=!0);const i=r.split("?iv=");if(2!==i.length)throw new Error("Invalid encrypted content format");const o=i[0],s=i[1],a=Ze(o),u=Ze(s);if(16!==u.length)throw new Error("Invalid IV length");const c=Ye(e,n);let $=await async function(t,e,n){const r=await Ge(),d=await Je(e),i=await r.subtle.decrypt({name:"AES-CBC",iv:We(n)},d,We(t));return new Uint8Array(i)}(a,c,u);d&&($=await async function(t){if("undefined"!=typeof process&&process.versions?.node){const{gunzipSync:e}=await import("zlib");return new Uint8Array(e(Buffer.from(t)))}if("undefined"!=typeof DecompressionStream){const e=new DecompressionStream("gzip"),n=e.writable.getWriter();n.write(We(t)),n.close();const r=[],d=e.readable.getReader();for(;;){const{done:t,value:e}=await d.read();if(t)break;r.push(e)}const i=r.reduce((t,e)=>t+e.length,0),o=new Uint8Array(i);let s=0;for(const t of r)o.set(t,s),s+=t.length;return o}throw new Error("GZIP decompression not supported in this environment")}($));return(new TextDecoder).decode($)}var Qe=Object.freeze({__proto__:null,decrypt:Xe,decryptHex:async function(t,e,n){return Xe(t,w(e),w(n))},deriveSharedSecret:Ye,deriveSharedSecretHex:function(t,e){return l(Ye(w(t),w(e)))},encrypt:ze,encryptHex:async function(t,e,n){return ze(t,w(e),w(n))}});
12
- /*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */function tn(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&"Uint8Array"===t.constructor.name}function en(t){if("boolean"!=typeof t)throw new Error(`boolean expected, not ${t}`)}function nn(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function rn(t,...e){if(!tn(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function dn(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function on(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function sn(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}const an=(()=>68===new Uint8Array(new Uint32Array([287454020]).buffer)[0])();function un(t){if("string"==typeof t)t=function(t){if("string"!=typeof t)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(t))}(t);else{if(!tn(t))throw new Error("Uint8Array expected, got "+typeof t);t=hn(t)}return t}const cn=(t,e)=>{function n(n,...r){if(rn(n),!an)throw new Error("Non little-endian hardware is not yet supported");if(void 0!==t.nonceLength){const e=r[0];if(!e)throw new Error("nonce / iv required");t.varSizeNonce?rn(e):rn(e,t.nonceLength)}const d=t.tagLength;d&&void 0!==r[1]&&rn(r[1]);const i=e(n,...r),o=(t,e)=>{if(void 0!==e){if(2!==t)throw new Error("cipher output not supported");rn(e)}};let s=!1;return{encrypt(t,e){if(s)throw new Error("cannot encrypt() twice with same key + nonce");return s=!0,rn(t),o(i.encrypt.length,e),i.encrypt(t,e)},decrypt(t,e){if(rn(t),d&&t.length<d)throw new Error("invalid ciphertext length: smaller than tagLength="+d);return o(i.decrypt.length,e),i.decrypt(t,e)}}}return Object.assign(n,t),n};function $n(t,e,n=!0){if(void 0===e)return new Uint8Array(t);if(e.length!==t)throw new Error("invalid output length, expected "+t+", got: "+e.length);if(n&&e.byteOffset%4!=0)throw new Error("invalid output, must be aligned");return e}function ln(t,e,n,r){if("function"==typeof t.setBigUint64)return t.setBigUint64(e,n,r);const d=BigInt(32),i=BigInt(4294967295),o=Number(n>>d&i),s=Number(n&i);t.setUint32(e+4,o,r),t.setUint32(e+0,s,r)}function fn(t,e,n){en(n);const r=new Uint8Array(16),d=(i=r,new DataView(i.buffer,i.byteOffset,i.byteLength));var i;return ln(d,0,BigInt(e),n),ln(d,8,BigInt(t),n),r}function hn(t){return Uint8Array.from(t)}const yn=t=>Uint8Array.from(t.split("").map(t=>t.charCodeAt(0))),gn=yn("expand 16-byte k"),pn=yn("expand 32-byte k"),mn=on(gn),bn=on(pn);function wn(t,e){return t<<e|t>>>32-e}function vn(t){return t.byteOffset%4==0}const En=2**32-1,On=new Uint32Array;function Pn(t,e){const{allowShortKeys:n,extendNonceFn:r,counterLength:d,counterRight:i,rounds:o}=function(t,e){if(null==e||"object"!=typeof e)throw new Error("options must be defined");return Object.assign(t,e)}({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},e);if("function"!=typeof t)throw new Error("core must be a function");return nn(d),nn(o),en(i),en(n),(e,s,a,u,c=0)=>{rn(e),rn(s),rn(a);const $=a.length;if(void 0===u&&(u=new Uint8Array($)),rn(u),nn(c),c<0||c>=En)throw new Error("arx: counter overflow");if(u.length<$)throw new Error(`arx: output (${u.length}) is shorter than data (${$})`);const l=[];let f,h,y=e.length;if(32===y)l.push(f=hn(e)),h=bn;else{if(16!==y||!n)throw new Error(`arx: invalid 32-byte key, got length=${y}`);f=new Uint8Array(32),f.set(e),f.set(e,16),h=mn,l.push(f)}vn(s)||l.push(s=hn(s));const g=on(f);if(r){if(24!==s.length)throw new Error("arx: extended nonce must be 24 bytes");r(h,g,on(s.subarray(0,16)),g),s=s.subarray(16)}const p=16-d;if(p!==s.length)throw new Error(`arx: nonce must be ${p} or 16 bytes`);if(12!==p){const t=new Uint8Array(12);t.set(s,i?0:12-s.length),s=t,l.push(s)}const m=on(s);return function(t,e,n,r,d,i,o,s){const a=d.length,u=new Uint8Array(64),c=on(u),$=vn(d)&&vn(i),l=$?on(d):On,f=$?on(i):On;for(let h=0;h<a;o++){if(t(e,n,r,c,o,s),o>=En)throw new Error("arx: counter overflow");const y=Math.min(64,a-h);if($&&64===y){const t=h/4;if(h%4!=0)throw new Error("arx: invalid block position");for(let e,n=0;n<16;n++)e=t+n,f[e]=l[e]^c[n];h+=64;continue}for(let t,e=0;e<y;e++)t=h+e,i[t]=d[t]^u[e];h+=y}}(t,h,g,m,a,u,c,o),sn(...l),u}}const Sn=(t,e)=>255&t[e++]|(255&t[e++])<<8;class Nn{constructor(t){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,rn(t=un(t),32);const e=Sn(t,0),n=Sn(t,2),r=Sn(t,4),d=Sn(t,6),i=Sn(t,8),o=Sn(t,10),s=Sn(t,12),a=Sn(t,14);this.r[0]=8191&e,this.r[1]=8191&(e>>>13|n<<3),this.r[2]=7939&(n>>>10|r<<6),this.r[3]=8191&(r>>>7|d<<9),this.r[4]=255&(d>>>4|i<<12),this.r[5]=i>>>1&8190,this.r[6]=8191&(i>>>14|o<<2),this.r[7]=8065&(o>>>11|s<<5),this.r[8]=8191&(s>>>8|a<<8),this.r[9]=a>>>5&127;for(let e=0;e<8;e++)this.pad[e]=Sn(t,16+2*e)}process(t,e,n=!1){const r=n?0:2048,{h:d,r:i}=this,o=i[0],s=i[1],a=i[2],u=i[3],c=i[4],$=i[5],l=i[6],f=i[7],h=i[8],y=i[9],g=Sn(t,e+0),p=Sn(t,e+2),m=Sn(t,e+4),b=Sn(t,e+6),w=Sn(t,e+8),v=Sn(t,e+10),E=Sn(t,e+12),O=Sn(t,e+14);let P=d[0]+(8191&g),S=d[1]+(8191&(g>>>13|p<<3)),N=d[2]+(8191&(p>>>10|m<<6)),C=d[3]+(8191&(m>>>7|b<<9)),A=d[4]+(8191&(b>>>4|w<<12)),I=d[5]+(w>>>1&8191),x=d[6]+(8191&(w>>>14|v<<2)),T=d[7]+(8191&(v>>>11|E<<5)),k=d[8]+(8191&(E>>>8|O<<8)),B=d[9]+(O>>>5|r),R=0,M=R+P*o+S*(5*y)+N*(5*h)+C*(5*f)+A*(5*l);R=M>>>13,M&=8191,M+=I*(5*$)+x*(5*c)+T*(5*u)+k*(5*a)+B*(5*s),R+=M>>>13,M&=8191;let _=R+P*s+S*o+N*(5*y)+C*(5*h)+A*(5*f);R=_>>>13,_&=8191,_+=I*(5*l)+x*(5*$)+T*(5*c)+k*(5*u)+B*(5*a),R+=_>>>13,_&=8191;let L=R+P*a+S*s+N*o+C*(5*y)+A*(5*h);R=L>>>13,L&=8191,L+=I*(5*f)+x*(5*l)+T*(5*$)+k*(5*c)+B*(5*u),R+=L>>>13,L&=8191;let U=R+P*u+S*a+N*s+C*o+A*(5*y);R=U>>>13,U&=8191,U+=I*(5*h)+x*(5*f)+T*(5*l)+k*(5*$)+B*(5*c),R+=U>>>13,U&=8191;let F=R+P*c+S*u+N*a+C*s+A*o;R=F>>>13,F&=8191,F+=I*(5*y)+x*(5*h)+T*(5*f)+k*(5*l)+B*(5*$),R+=F>>>13,F&=8191;let D=R+P*$+S*c+N*u+C*a+A*s;R=D>>>13,D&=8191,D+=I*o+x*(5*y)+T*(5*h)+k*(5*f)+B*(5*l),R+=D>>>13,D&=8191;let j=R+P*l+S*$+N*c+C*u+A*a;R=j>>>13,j&=8191,j+=I*s+x*o+T*(5*y)+k*(5*h)+B*(5*f),R+=j>>>13,j&=8191;let K=R+P*f+S*l+N*$+C*c+A*u;R=K>>>13,K&=8191,K+=I*a+x*s+T*o+k*(5*y)+B*(5*h),R+=K>>>13,K&=8191;let H=R+P*h+S*f+N*l+C*$+A*c;R=H>>>13,H&=8191,H+=I*u+x*a+T*s+k*o+B*(5*y),R+=H>>>13,H&=8191;let G=R+P*y+S*h+N*f+C*l+A*$;R=G>>>13,G&=8191,G+=I*c+x*u+T*a+k*s+B*o,R+=G>>>13,G&=8191,R=(R<<2)+R|0,R=R+M|0,M=8191&R,R>>>=13,_+=R,d[0]=M,d[1]=_,d[2]=L,d[3]=U,d[4]=F,d[5]=D,d[6]=j,d[7]=K,d[8]=H,d[9]=G}finalize(){const{h:t,pad:e}=this,n=new Uint16Array(10);let r=t[1]>>>13;t[1]&=8191;for(let e=2;e<10;e++)t[e]+=r,r=t[e]>>>13,t[e]&=8191;t[0]+=5*r,r=t[0]>>>13,t[0]&=8191,t[1]+=r,r=t[1]>>>13,t[1]&=8191,t[2]+=r,n[0]=t[0]+5,r=n[0]>>>13,n[0]&=8191;for(let e=1;e<10;e++)n[e]=t[e]+r,r=n[e]>>>13,n[e]&=8191;n[9]-=8192;let d=(1^r)-1;for(let t=0;t<10;t++)n[t]&=d;d=~d;for(let e=0;e<10;e++)t[e]=t[e]&d|n[e];t[0]=65535&(t[0]|t[1]<<13),t[1]=65535&(t[1]>>>3|t[2]<<10),t[2]=65535&(t[2]>>>6|t[3]<<7),t[3]=65535&(t[3]>>>9|t[4]<<4),t[4]=65535&(t[4]>>>12|t[5]<<1|t[6]<<14),t[5]=65535&(t[6]>>>2|t[7]<<11),t[6]=65535&(t[7]>>>5|t[8]<<8),t[7]=65535&(t[8]>>>8|t[9]<<5);let i=t[0]+e[0];t[0]=65535&i;for(let n=1;n<8;n++)i=(t[n]+e[n]|0)+(i>>>16)|0,t[n]=65535&i;sn(n)}update(t){dn(this),rn(t=un(t));const{buffer:e,blockLen:n}=this,r=t.length;for(let d=0;d<r;){const i=Math.min(n-this.pos,r-d);if(i!==n)e.set(t.subarray(d,d+i),this.pos),this.pos+=i,d+=i,this.pos===n&&(this.process(e,0,!1),this.pos=0);else for(;n<=r-d;d+=n)this.process(t,d)}return this}destroy(){sn(this.h,this.r,this.buffer,this.pad)}digestInto(t){dn(this),function(t,e){rn(t);const n=e.outputLen;if(t.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}(t,this),this.finished=!0;const{buffer:e,h:n}=this;let{pos:r}=this;if(r){for(e[r++]=1;r<16;r++)e[r]=0;this.process(e,0,!0)}this.finalize();let d=0;for(let e=0;e<8;e++)t[d++]=n[e]>>>0,t[d++]=n[e]>>>8;return t}digest(){const{buffer:t,outputLen:e}=this;this.digestInto(t);const n=t.slice(0,e);return this.destroy(),n}}const Cn=function(t){const e=(e,n)=>t(n).update(un(e)).digest(),n=t(new Uint8Array(32));return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=e=>t(e),e}(t=>new Nn(t));function An(t,e,n,r,d,i=20){let o=t[0],s=t[1],a=t[2],u=t[3],c=e[0],$=e[1],l=e[2],f=e[3],h=e[4],y=e[5],g=e[6],p=e[7],m=d,b=n[0],w=n[1],v=n[2],E=o,O=s,P=a,S=u,N=c,C=$,A=l,I=f,x=h,T=y,k=g,B=p,R=m,M=b,_=w,L=v;for(let t=0;t<i;t+=2)E=E+N|0,R=wn(R^E,16),x=x+R|0,N=wn(N^x,12),E=E+N|0,R=wn(R^E,8),x=x+R|0,N=wn(N^x,7),O=O+C|0,M=wn(M^O,16),T=T+M|0,C=wn(C^T,12),O=O+C|0,M=wn(M^O,8),T=T+M|0,C=wn(C^T,7),P=P+A|0,_=wn(_^P,16),k=k+_|0,A=wn(A^k,12),P=P+A|0,_=wn(_^P,8),k=k+_|0,A=wn(A^k,7),S=S+I|0,L=wn(L^S,16),B=B+L|0,I=wn(I^B,12),S=S+I|0,L=wn(L^S,8),B=B+L|0,I=wn(I^B,7),E=E+C|0,L=wn(L^E,16),k=k+L|0,C=wn(C^k,12),E=E+C|0,L=wn(L^E,8),k=k+L|0,C=wn(C^k,7),O=O+A|0,R=wn(R^O,16),B=B+R|0,A=wn(A^B,12),O=O+A|0,R=wn(R^O,8),B=B+R|0,A=wn(A^B,7),P=P+I|0,M=wn(M^P,16),x=x+M|0,I=wn(I^x,12),P=P+I|0,M=wn(M^P,8),x=x+M|0,I=wn(I^x,7),S=S+N|0,_=wn(_^S,16),T=T+_|0,N=wn(N^T,12),S=S+N|0,_=wn(_^S,8),T=T+_|0,N=wn(N^T,7);let U=0;r[U++]=o+E|0,r[U++]=s+O|0,r[U++]=a+P|0,r[U++]=u+S|0,r[U++]=c+N|0,r[U++]=$+C|0,r[U++]=l+A|0,r[U++]=f+I|0,r[U++]=h+x|0,r[U++]=y+T|0,r[U++]=g+k|0,r[U++]=p+B|0,r[U++]=m+R|0,r[U++]=b+M|0,r[U++]=w+_|0,r[U++]=v+L|0}const In=Pn(An,{counterRight:!1,counterLength:4,allowShortKeys:!1}),xn=new Uint8Array(16),Tn=(t,e)=>{t.update(e);const n=e.length%16;n&&t.update(xn.subarray(n))},kn=new Uint8Array(32);function Bn(t,e,n,r,d){const i=t(e,n,kn),o=Cn.create(i);d&&Tn(o,d),Tn(o,r);const s=fn(r.length,d?d.length:0,!0);o.update(s);const a=o.digest();return sn(i,s),a}const Rn=cn({blockSize:64,nonceLength:12,tagLength:16},(Mn=In,(t,e,n)=>{const r=16;return{encrypt(d,i){const o=d.length;(i=$n(o+r,i,!1)).set(d);const s=i.subarray(0,-16);Mn(t,e,s,s,1);const a=Bn(Mn,t,e,s,n);return i.set(a,o),sn(a),i},decrypt(d,i){i=$n(d.length-r,i,!1);const o=d.subarray(0,-16),s=d.subarray(-16),a=Bn(Mn,t,e,o,n);if(!function(t,e){if(t.length!==e.length)return!1;let n=0;for(let r=0;r<t.length;r++)n|=t[r]^e[r];return 0===n}(s,a))throw new Error("invalid tag");return i.set(d.subarray(0,-16)),Mn(t,e,i,i,1),sn(a),i}}}));var Mn;const _n=Uint8Array.from([0]),Ln=Uint8Array.of();const Un=(t,e,r,i,o)=>function(t,e,r,i=32){d(t),n(i);const o=t.outputLen;if(i>255*o)throw new Error("Length should be <= 255*HashLen");const a=Math.ceil(i/o);void 0===r&&(r=Ln);const u=new Uint8Array(a*o),c=J.create(t,e),$=c._cloneInto(),l=new Uint8Array(c.outputLen);for(let t=0;t<a;t++)_n[0]=t+1,$.update(0===t?Ln:l).update(r).update(_n).digestInto(l),u.set(l,o*t),c._cloneInto($);return c.destroy(),$.destroy(),s(l,_n),u.slice(0,i)}(t,function(t,e,n){return d(t),void 0===n&&(n=new Uint8Array(t.outputLen)),J(t,E(n),E(e))}(t,e,r),i,o),Fn=24,Dn=65535,jn=(new TextEncoder).encode("nip44-v2");function Kn(t,e){if(32!==t.length)throw new Error("Private key must be 32 bytes");if(32!==e.length)throw new Error("Public key must be 32 bytes");const n=function(t,e){const n=new Uint8Array(33);n[0]=2,n.set(e,1);const r=Ee.getSharedSecret(t,n);return r.slice(1,33)}(t,e),r=Ee.getPublicKey(t,!0).slice(1),d=function(t,e){const n=Math.min(t.length,e.length);for(let r=0;r<n;r++){const n=t[r]-e[r];if(0!==n)return n}return t.length-e.length}(i=r,o=e)<=0?O(i,o):O(o,i);var i,o;return Un(He,n,d,jn,32)}function Hn(t){if(t<=0)throw new Error("Message too short");if(t>Dn)throw new Error("Message too long");if(t<=32)return 32;const e=1<<Math.ceil(Math.log2(t)),n=Math.max(32,e>>3);return Math.ceil(t/n)*n}function Gn(t){const e=t.length;if(e<1)throw new Error("Message too short");if(e>Dn)throw new Error("Message too long");const n=Hn(e),r=new Uint8Array(2+n);return r[0]=e>>8&255,r[1]=255&e,r.set(t,2),r}function Vn(t){if(t.length<34)throw new Error("Padded message too short");const e=t[0]<<8|t[1];if(e<1||e>Dn)throw new Error(`Invalid message length: ${e}`);const n=Hn(e);if(t.length!==2+n)throw new Error("Invalid padding");return t.slice(2,2+e)}function qn(t,e,n){return Zn(t,Kn(e,n))}function Zn(t,e){const n=(new TextEncoder).encode(t);if(n.length>Dn)throw new Error("Message too long (max 65535 bytes)");const r=Gn(n),d=N(Fn),i=Un(He,e,d,new Uint8Array(0),76),o=i.slice(0,32),s=i.slice(32,44),a=Rn(o,s).encrypt(r),u=new Uint8Array(25+a.length);return u[0]=2,u.set(d,1),u.set(a,25),function(t){if("undefined"!=typeof Buffer)return Buffer.from(t).toString("base64");let e="";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return btoa(e)}(u)}function Wn(t,e,n){return Jn(t,Kn(e,n))}function Jn(t,e){const n=function(t){if("undefined"!=typeof Buffer)return new Uint8Array(Buffer.from(t,"base64"));const e=atob(t),n=new Uint8Array(e.length);for(let t=0;t<e.length;t++)n[t]=e.charCodeAt(t);return n}(t);if(n.length<73)throw new Error("Payload too short");if(2!==n[0])throw new Error(`Unsupported NIP-44 version: ${n[0]}`);const r=n.slice(1,25),d=n.slice(25),i=Un(He,e,r,new Uint8Array(0),76),o=i.slice(0,32),s=i.slice(32,44),a=Vn(Rn(o,s).decrypt(d));return(new TextDecoder).decode(a)}var Yn=Object.freeze({__proto__:null,VERSION:2,calcPaddedLen:Hn,decrypt:Wn,decryptHex:function(t,e,n){return Wn(t,w(e),w(n))},decryptWithKey:Jn,deriveConversationKey:Kn,deriveConversationKeyHex:function(t,e){return l(Kn(w(t),w(e)))},encrypt:qn,encryptHex:function(t,e,n){return qn(t,w(e),w(n))},encryptWithKey:Zn,pad:Gn,unpad:Vn});class zn{privateKey;publicKey;cleared=!1;constructor(t){if(32!==t.length)throw new Error("Private key must be 32 bytes");this.privateKey=new Uint8Array(t),this.publicKey=_e(this.privateKey)}static fromPrivateKey(t){return new zn(t)}static fromPrivateKeyHex(t){const e=w(t);return new zn(e)}static fromNsec(t){const e=U(t);return new zn(e)}static generate(){const t=N(32);return new zn(t)}ensureNotCleared(){if(this.cleared)throw new Error("KeyManager has been cleared")}getPrivateKey(){return this.ensureNotCleared(),new Uint8Array(this.privateKey)}getPrivateKeyHex(){return this.ensureNotCleared(),l(this.privateKey)}getNsec(){return this.ensureNotCleared(),L(this.privateKey)}getPublicKey(){return this.ensureNotCleared(),new Uint8Array(this.publicKey)}getPublicKeyHex(){return this.ensureNotCleared(),l(this.publicKey)}getNpub(){return this.ensureNotCleared(),M(this.publicKey)}sign(t){return this.ensureNotCleared(),Ue(t,this.privateKey)}signHex(t){return this.ensureNotCleared(),Fe(t,this.privateKey)}static verify(t,e,n){return De(t,e,n)}static verifyHex(t,e,n){return je(t,e,n)}async encrypt(t,e){return this.ensureNotCleared(),ze(t,this.privateKey,e)}async encryptHex(t,e){this.ensureNotCleared();const n=w(e);return ze(t,this.privateKey,n)}async decrypt(t,e){return this.ensureNotCleared(),Xe(t,this.privateKey,e)}async decryptHex(t,e){this.ensureNotCleared();const n=w(e);return Xe(t,this.privateKey,n)}deriveSharedSecret(t){return this.ensureNotCleared(),Ye(this.privateKey,t)}encryptNip44(t,e){return this.ensureNotCleared(),qn(t,this.privateKey,e)}encryptNip44Hex(t,e){this.ensureNotCleared();const n=w(e);return qn(t,this.privateKey,n)}decryptNip44(t,e){return this.ensureNotCleared(),Wn(t,this.privateKey,e)}decryptNip44Hex(t,e){this.ensureNotCleared();const n=w(e);return Wn(t,this.privateKey,n)}deriveConversationKey(t){return this.ensureNotCleared(),Kn(this.privateKey,t)}isMyPublicKey(t){return this.ensureNotCleared(),this.getPublicKeyHex()===t.toLowerCase()}clear(){this.privateKey.fill(0),this.cleared=!0}}class Xn{id;pubkey;created_at;kind;tags;content;sig;constructor(t){this.id=t.id,this.pubkey=t.pubkey,this.created_at=t.created_at,this.kind=t.kind,this.tags=t.tags,this.content=t.content,this.sig=t.sig}static create(t,e){const n=t.getPublicKeyHex(),r=e.created_at??Math.floor(Date.now()/1e3),d=Xn.calculateId(n,r,e.kind,e.tags,e.content),i=w(d),o=t.signHex(i);return new Xn({id:d,pubkey:n,created_at:r,kind:e.kind,tags:e.tags,content:e.content,sig:o})}static calculateId(t,e,n,r,d){const i=JSON.stringify([0,t,e,n,r,d]);return l(He((new TextEncoder).encode(i)))}verify(){try{if(Xn.calculateId(this.pubkey,this.created_at,this.kind,this.tags,this.content)!==this.id)return!1;const t=w(this.id),e=w(this.sig);return De(e,t,w(this.pubkey))}catch{return!1}}static fromJSON(t){const e="string"==typeof t?JSON.parse(t):t;if(!Xn.isValidEventData(e))throw new Error("Invalid event data");return new Xn(e)}static isValidEventData(t){if("object"!=typeof t||null===t)return!1;const e=t;return"string"==typeof e.id&&"string"==typeof e.pubkey&&"number"==typeof e.created_at&&"number"==typeof e.kind&&Array.isArray(e.tags)&&"string"==typeof e.content&&"string"==typeof e.sig}toJSON(){return{id:this.id,pubkey:this.pubkey,created_at:this.created_at,kind:this.kind,tags:this.tags,content:this.content,sig:this.sig}}getTagValue(t){const e=this.tags.find(e=>e[0]===t);return e?.[1]}getTagValues(t){return this.tags.filter(e=>e[0]===t).map(t=>t[1]??"")}hasTag(t){return this.tags.some(e=>e[0]===t)}getTagEntryValues(t){const e=this.tags.find(e=>e[0]===t);return e?e.slice(1):[]}}class Qn{ids;authors;kinds;"#e";"#p";"#t";"#d";"#h";since;until;limit;constructor(t){t&&(t.ids&&(this.ids=[...t.ids]),t.authors&&(this.authors=[...t.authors]),t.kinds&&(this.kinds=[...t.kinds]),t["#e"]&&(this["#e"]=[...t["#e"]]),t["#p"]&&(this["#p"]=[...t["#p"]]),t["#t"]&&(this["#t"]=[...t["#t"]]),t["#d"]&&(this["#d"]=[...t["#d"]]),t["#h"]&&(this["#h"]=[...t["#h"]]),void 0!==t.since&&(this.since=t.since),void 0!==t.until&&(this.until=t.until),void 0!==t.limit&&(this.limit=t.limit))}static builder(){return new tr}toJSON(){const t={};return this.ids&&this.ids.length>0&&(t.ids=this.ids),this.authors&&this.authors.length>0&&(t.authors=this.authors),this.kinds&&this.kinds.length>0&&(t.kinds=this.kinds),this["#e"]&&this["#e"].length>0&&(t["#e"]=this["#e"]),this["#p"]&&this["#p"].length>0&&(t["#p"]=this["#p"]),this["#t"]&&this["#t"].length>0&&(t["#t"]=this["#t"]),this["#d"]&&this["#d"].length>0&&(t["#d"]=this["#d"]),this["#h"]&&this["#h"].length>0&&(t["#h"]=this["#h"]),void 0!==this.since&&(t.since=this.since),void 0!==this.until&&(t.until=this.until),void 0!==this.limit&&(t.limit=this.limit),t}static fromJSON(t){const e="string"==typeof t?JSON.parse(t):t;return new Qn(e)}}class tr{data={};ids(t,...e){return Array.isArray(t)?this.data.ids=[...t]:this.data.ids=[t,...e],this}authors(t,...e){return Array.isArray(t)?this.data.authors=[...t]:this.data.authors=[t,...e],this}kinds(t,...e){return Array.isArray(t)?this.data.kinds=[...t]:this.data.kinds=[t,...e],this}eTags(t,...e){return Array.isArray(t)?this.data["#e"]=[...t]:this.data["#e"]=[t,...e],this}pTags(t,...e){return Array.isArray(t)?this.data["#p"]=[...t]:this.data["#p"]=[t,...e],this}tTags(t,...e){return Array.isArray(t)?this.data["#t"]=[...t]:this.data["#t"]=[t,...e],this}dTags(t,...e){return Array.isArray(t)?this.data["#d"]=[...t]:this.data["#d"]=[t,...e],this}hTags(t,...e){return Array.isArray(t)?this.data["#h"]=[...t]:this.data["#h"]=[t,...e],this}since(t){return this.data.since=t,this}until(t){return this.data.until=t,this}limit(t){return this.data.limit=t,this}build(){return new Qn(this.data)}}const er=0,nr=1,rr=2,dr=3,ir=4,or=5,sr=13,ar=14,ur=15,cr=7,$r=1059,lr=10002,fr=22242,hr=30078,yr=31111,gr=31112,pr=31113,mr=31114,br=31115,wr=31116;function vr(t){return 0===t||3===t||t>=1e4&&t<2e4}function Er(t){return t>=2e4&&t<3e4}function Or(t){return t>=3e4&&t<4e4}function Pr(t){switch(t){case 0:return"Profile";case 1:return"Text Note";case 2:return"Recommend Relay";case 3:return"Contacts";case 4:return"Encrypted DM";case 5:return"Deletion";case 13:return"Seal";case 14:return"Chat Message";case 15:return"Read Receipt";case 7:return"Reaction";case $r:return"Gift Wrap";case lr:return"Relay List";case hr:return"App Data";case yr:return"Agent Profile";case gr:return"Agent Location";case pr:return"Token Transfer";case mr:return"File Metadata";case br:return"Payment Request";case wr:return"Payment Request Response";default:return vr(t)?`Replaceable (${t})`:Er(t)?`Ephemeral (${t})`:Or(t)?`Parameterized Replaceable (${t})`:`Unknown (${t})`}}var Sr=Object.freeze({__proto__:null,AGENT_LOCATION:gr,AGENT_PROFILE:yr,APP_DATA:hr,AUTH:fr,CHAT_MESSAGE:14,CONTACTS:3,DELETION:5,ENCRYPTED_DM:4,FILE_METADATA:mr,GIFT_WRAP:$r,PAYMENT_REQUEST:br,PAYMENT_REQUEST_RESPONSE:wr,PROFILE:0,REACTION:7,READ_RECEIPT:15,RECOMMEND_RELAY:2,RELAY_LIST:lr,SEAL:13,TEXT_NOTE:1,TOKEN_TRANSFER:pr,getName:Pr,isEphemeral:Er,isParameterizedReplaceable:Or,isReplaceable:vr});const Nr=0,Cr=1,Ar=2,Ir=3;async function xr(t){if("undefined"==typeof WebSocket)throw new Error("WebSocket not available in this environment");return new WebSocket(t)}function Tr(t){if("string"==typeof t.data)return t.data;if(t.data instanceof ArrayBuffer)return(new TextDecoder).decode(t.data);if("undefined"!=typeof Blob&&t.data instanceof Blob)throw new Error("Blob messages are not supported");return String(t.data)}const kr=172800;function Br(t,e,n,r){const d=function(t,e,n,r,d){const i=[["p",e]];d&&i.push(["e",d,"","reply"]);const o=Math.floor(Date.now()/1e3),s={id:"",pubkey:t,created_at:o,kind:r,tags:i,content:n};return s.id=_r(s),s}(t.getPublicKeyHex(),e,n,14,r?.replyToEventId);return Ur(Lr(t,e,d),e)}function Rr(t,e,n){const r=[["p",e],["e",n]],d=Math.floor(Date.now()/1e3),i={id:"",pubkey:t.getPublicKeyHex(),created_at:d,kind:15,tags:r,content:""};i.id=_r(i);return Ur(Lr(t,e,i),e)}function Mr(t,e){if(t.kind!==$r)throw new Error(`Event is not a gift wrap (kind ${t.kind})`);const n=w(t.pubkey),r=Wn(t.content,e.getPrivateKey(),n),d=JSON.parse(r);if(13!==d.kind)throw new Error(`Inner event is not a seal (kind ${d.kind})`);const i=d.pubkey,o=w(d.id),s=w(d.sig),a=w(i);if(!De(s,o,a))throw new Error("Seal signature verification failed");const u=Wn(d.content,e.getPrivateKey(),a),c=JSON.parse(u),$=function(t,e){const n=t.find(t=>t[0]===e);return n?.[1]}(c.tags,"e");return{eventId:t.id,senderPubkey:i,recipientPubkey:e.getPublicKeyHex(),content:c.content,timestamp:c.created_at,kind:c.kind,replyToEventId:$}}function _r(t){const e=JSON.stringify([0,t.pubkey,t.created_at,t.kind,t.tags,t.content]);return l(He((new TextEncoder).encode(e)))}function Lr(t,e,n){const r=JSON.stringify(n),d=w(e),i=qn(r,t.getPrivateKey(),d),o=t.getPublicKeyHex(),s=Fr(),a=[],u=i,c=Xn.calculateId(o,s,13,a,u),$=w(c),l=t.signHex($);return new Xn({id:c,pubkey:o,created_at:s,kind:13,tags:a,content:u,sig:l})}function Ur(t,e){const n=zn.generate(),r=JSON.stringify(t.toJSON()),d=w(e),i=qn(r,n.getPrivateKey(),d),o=n.getPublicKeyHex(),s=Fr(),a=$r,u=[["p",e]],c=i,$=Xn.calculateId(o,s,a,u,c),l=w($),f=n.signHex(l);return n.clear(),new Xn({id:$,pubkey:o,created_at:s,kind:a,tags:u,content:c,sig:f})}function Fr(){return Math.floor(Date.now()/1e3)+(Math.floor(2*Math.random()*kr)-kr)}var Dr=Object.freeze({__proto__:null,createGiftWrap:Br,createReadReceipt:Rr,unwrap:Mr}),jr={version:4,country_calling_codes:{1:["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"],7:["RU","KZ"],20:["EG"],27:["ZA"],30:["GR"],31:["NL"],32:["BE"],33:["FR"],34:["ES"],36:["HU"],39:["IT","VA"],40:["RO"],41:["CH"],43:["AT"],44:["GB","GG","IM","JE"],45:["DK"],46:["SE"],47:["NO","SJ"],48:["PL"],49:["DE"],51:["PE"],52:["MX"],53:["CU"],54:["AR"],55:["BR"],56:["CL"],57:["CO"],58:["VE"],60:["MY"],61:["AU","CC","CX"],62:["ID"],63:["PH"],64:["NZ"],65:["SG"],66:["TH"],81:["JP"],82:["KR"],84:["VN"],86:["CN"],90:["TR"],91:["IN"],92:["PK"],93:["AF"],94:["LK"],95:["MM"],98:["IR"],211:["SS"],212:["MA","EH"],213:["DZ"],216:["TN"],218:["LY"],220:["GM"],221:["SN"],222:["MR"],223:["ML"],224:["GN"],225:["CI"],226:["BF"],227:["NE"],228:["TG"],229:["BJ"],230:["MU"],231:["LR"],232:["SL"],233:["GH"],234:["NG"],235:["TD"],236:["CF"],237:["CM"],238:["CV"],239:["ST"],240:["GQ"],241:["GA"],242:["CG"],243:["CD"],244:["AO"],245:["GW"],246:["IO"],247:["AC"],248:["SC"],249:["SD"],250:["RW"],251:["ET"],252:["SO"],253:["DJ"],254:["KE"],255:["TZ"],256:["UG"],257:["BI"],258:["MZ"],260:["ZM"],261:["MG"],262:["RE","YT"],263:["ZW"],264:["NA"],265:["MW"],266:["LS"],267:["BW"],268:["SZ"],269:["KM"],290:["SH","TA"],291:["ER"],297:["AW"],298:["FO"],299:["GL"],350:["GI"],351:["PT"],352:["LU"],353:["IE"],354:["IS"],355:["AL"],356:["MT"],357:["CY"],358:["FI","AX"],359:["BG"],370:["LT"],371:["LV"],372:["EE"],373:["MD"],374:["AM"],375:["BY"],376:["AD"],377:["MC"],378:["SM"],380:["UA"],381:["RS"],382:["ME"],383:["XK"],385:["HR"],386:["SI"],387:["BA"],389:["MK"],420:["CZ"],421:["SK"],423:["LI"],500:["FK"],501:["BZ"],502:["GT"],503:["SV"],504:["HN"],505:["NI"],506:["CR"],507:["PA"],508:["PM"],509:["HT"],590:["GP","BL","MF"],591:["BO"],592:["GY"],593:["EC"],594:["GF"],595:["PY"],596:["MQ"],597:["SR"],598:["UY"],599:["CW","BQ"],670:["TL"],672:["NF"],673:["BN"],674:["NR"],675:["PG"],676:["TO"],677:["SB"],678:["VU"],679:["FJ"],680:["PW"],681:["WF"],682:["CK"],683:["NU"],685:["WS"],686:["KI"],687:["NC"],688:["TV"],689:["PF"],690:["TK"],691:["FM"],692:["MH"],850:["KP"],852:["HK"],853:["MO"],855:["KH"],856:["LA"],880:["BD"],886:["TW"],960:["MV"],961:["LB"],962:["JO"],963:["SY"],964:["IQ"],965:["KW"],966:["SA"],967:["YE"],968:["OM"],970:["PS"],971:["AE"],972:["IL"],973:["BH"],974:["QA"],975:["BT"],976:["MN"],977:["NP"],992:["TJ"],993:["TM"],994:["AZ"],995:["GE"],996:["KG"],998:["UZ"]},countries:{AC:["247","00","(?:[01589]\\d|[46])\\d{4}",[5,6]],AD:["376","00","(?:1|6\\d)\\d{7}|[135-9]\\d{5}",[6,8,9],[["(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],["(\\d{4})(\\d{4})","$1 $2",["1"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]]],AE:["971","00","(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",[5,6,7,8,9,10,11,12],[["(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],["(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"]],"0"],AF:["93","00","[2-7]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],"0"],AG:["1","011","(?:268|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([457]\\d{6})$|1","268$1",0,"268"],AI:["1","011","(?:264|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2457]\\d{6})$|1","264$1",0,"264"],AL:["355","00","(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",[6,7,8,9],[["(\\d{3})(\\d{3,4})","$1 $2",["80|9"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["[23578]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"]],"0"],AM:["374","00","(?:[1-489]\\d|55|60|77)\\d{6}",[8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[89]0"],"0 $1"],["(\\d{3})(\\d{5})","$1 $2",["2|3[12]"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[3-9]"],"0$1"]],"0"],AO:["244","00","[29]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[29]"]]]],AR:["54","00","(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}",[10,11],[["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])","2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["[23]"],"0$1",1],["(\\d)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9(?:2[2-469]|3[3-578])","9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))","9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",0,"$1 $2 $3-$4"],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 15-$3-$4",["91"],"0$1",0,"$1 $2 $3-$4"],["(\\d{3})(\\d{3})(\\d{5})","$1-$2-$3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9"],"0$1",0,"$1 $2 $3-$4"]],"0",0,"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?","9$1"],AS:["1","011","(?:[58]\\d\\d|684|900)\\d{7}",[10],0,"1",0,"([267]\\d{6})$|1","684$1",0,"684"],AT:["43","00","1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}",[4,5,6,7,8,9,10,11,12,13],[["(\\d)(\\d{3,12})","$1 $2",["1(?:11|[2-9])"],"0$1"],["(\\d{3})(\\d{2})","$1 $2",["517"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["5[079]"],"0$1"],["(\\d{3})(\\d{3,10})","$1 $2",["(?:31|4)6|51|6(?:48|5[0-3579]|[6-9])|7(?:20|32|8)|[89]","(?:31|4)6|51|6(?:485|5[0-3579]|[6-9])|7(?:20|32|8)|[89]"],"0$1"],["(\\d{4})(\\d{3,9})","$1 $2",["[2-467]|5[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["5"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,7})","$1 $2 $3",["5"],"0$1"]],"0"],AU:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}",[5,6,7,8,9,10,12],[["(\\d{2})(\\d{3,4})","$1 $2",["16"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["14|4"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:30|[89])"]]],"0",0,"(183[12])|0",0,0,0,[["(?:(?:241|349)0\\d\\d|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4])|[34]\\d\\d)|91(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79]))))\\d{3}|(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|3(?:[0-3589]\\d|4[0-578]|6[1-9]|7[0-35-9])|7(?:[013-57-9]\\d|2[0-8])|8(?:55|6[0-8]|[78]\\d|9[02-9]))\\d{6}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,["163\\d{2,6}",[5,6,7,8,9]],["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],AW:["297","00","(?:[25-79]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[25-9]"]]]],AX:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}",[5,6,7,8,9,10,11,12],0,"0",0,0,0,0,"18",0,"00"],AZ:["994","00","365\\d{6}|(?:[124579]\\d|60|88)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[28]|2|365|46","1[28]|2|365[45]|46","1[28]|2|365(?:4|5[02])|46"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[13-9]"],"0$1"]],"0"],BA:["387","00","6\\d{8}|(?:[35689]\\d|49|70)\\d{6}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-3]|[7-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]|6[56]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6"],"0$1"]],"0"],BB:["1","011","(?:246|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","246$1",0,"246"],BD:["880","00","[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{4,6})","$1-$2",["31[5-8]|[459]1"],"0$1"],["(\\d{3})(\\d{3,7})","$1-$2",["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"],"0$1"],["(\\d{4})(\\d{3,6})","$1-$2",["[13-9]|2[23]"],"0$1"],["(\\d)(\\d{7,8})","$1-$2",["2"],"0$1"]],"0"],BE:["32","00","4\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[239]|4[23]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[15-8]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4"],"0$1"]],"0"],BF:["226","00","(?:[025-7]\\d|44)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[024-7]"]]]],BG:["359","00","00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}",[6,7,8,9,12],[["(\\d)(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["43[1-6]|70[1-9]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:70|8)0"],"0$1"],["(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[1-7]|7"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[48]|9[08]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"]],"0"],BH:["973","00","[136-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[13679]|8[02-4679]"]]]],BI:["257","00","(?:[267]\\d|31)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2367]"]]]],BJ:["229","00","(?:01\\d|8)\\d{7}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["0"]]]],BL:["590","00","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:2[7-9]|3[3-7]|5[12]|87)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],BM:["1","011","(?:441|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","441$1",0,"441"],BN:["673","00","[2-578]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-578]"]]]],BO:["591","00(?:1\\d)?","8001\\d{5}|(?:[2-467]\\d|50)\\d{6}",[8,9],[["(\\d)(\\d{7})","$1 $2",["[235]|4[46]"]],["(\\d{8})","$1",["[67]"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["8"]]],"0",0,"0(1\\d)?"],BQ:["599","00","(?:[34]1|7\\d)\\d{5}",[7],0,0,0,0,0,0,"[347]"],BR:["55","00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","[1-467]\\d{9,10}|55[0-46-9]\\d{8}|[34]\\d{7}|55\\d{7,8}|(?:5[0-46-9]|[89]\\d)\\d{7,9}",[8,9,10,11],[["(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37|86)","300|4(?:0(?:0|20)|370|864)"]],["(\\d{3})(\\d{2,3})(\\d{4})","$1 $2 $3",["(?:[358]|90)0"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"],"($1)"],["(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["[16][1-9]|[2-57-9]"],"($1)"]],"0",0,"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2"],BS:["1","011","(?:242|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([3-8]\\d{6})$|1","242$1",0,"242"],BT:["975","00","[178]\\d{7}|[2-8]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[2-6]|7[246]|8[2-4]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[67]|[78]"]]]],BW:["267","00","(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}",[7,8,10],[["(\\d{2})(\\d{5})","$1 $2",["90"]],["(\\d{3})(\\d{4})","$1 $2",["[24-6]|3[15-9]"]],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37]"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["8"]]]],BY:["375","810","(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3})","$1 $2",["800"],"8 $1"],["(\\d{3})(\\d{2})(\\d{2,4})","$1 $2 $3",["800"],"8 $1"],["(\\d{4})(\\d{2})(\\d{3})","$1 $2-$3",["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])","1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"],"8 0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["1(?:[56]|7[467])|2[1-3]"],"8 0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-4]"],"8 0$1"],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["[89]"],"8 $1"]],"8",0,"0|80?",0,0,0,0,"8~10"],BZ:["501","00","(?:0800\\d|[2-8])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1-$2",["[2-8]"]],["(\\d)(\\d{3})(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"]]]],CA:["1","011","[2-9]\\d{9}|3\\d{6}",[7,10],0,"1",0,0,0,0,0,[["(?:2(?:04|[23]6|[48]9|5[07]|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|[26]8|3[178]|50|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|7[39])|9(?:0[25]|42))[2-9]\\d{6}",[10]],["",[10]],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",[10]],["900[2-9]\\d{6}",[10]],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:2[125-9]|33|44|66|77|88)|6(?:22|33))[2-9]\\d{6}",[10]],0,["310\\d{4}",[7]],0,["600[2-9]\\d{6}",[10]]]],CC:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CD:["243","00","(?:(?:[189]|5\\d)\\d|2)\\d{7}|[1-68]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1"],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["5"],"0$1"]],"0"],CF:["236","00","(?:[27]\\d{3}|8776)\\d{4}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[278]"]]]],CG:["242","00","222\\d{6}|(?:0\\d|80)\\d{7}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"]]]],CH:["41","00","8\\d{11}|[2-9]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]|81"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["8"],"0$1"]],"0"],CI:["225","00","[02]\\d{9}",[10],[["(\\d{2})(\\d{2})(\\d)(\\d{5})","$1 $2 $3 $4",["2"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3 $4",["0"]]]],CK:["682","00","[2-578]\\d{4}",[5],[["(\\d{2})(\\d{3})","$1 $2",["[2-578]"]]]],CL:["56","(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0","12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}",[9,10,11],[["(\\d{5})(\\d{4})","$1 $2",["219","2196"],"($1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["60|809"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["44"]],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[1-36]"],"($1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9(?:10|[2-9])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-8]|[1-9])"],"($1)"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["60|8"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{3})(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"]]]],CM:["237","00","[26]\\d{8}|88\\d{6,7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["88"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]|88"]]]],CN:["86","00|1(?:[12]\\d|79)\\d\\d00","(?:(?:1[03-689]|2\\d)\\d\\d|6)\\d{8}|1\\d{10}|[126]\\d{6}(?:\\d(?:\\d{2})?)?|86\\d{5,6}|(?:[3-579]\\d|8[0-57-9])\\d{5,9}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2[0-57-9])[19]|3(?:[157]|35|49|9[1-68])|4(?:1[124-9]|2[179]|6[47-9]|7|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:07|1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3|4[13]|5[1-5]|7[0-79]|9[0-35-9])|(?:4[35]|59|85)[1-9]","(?:10|2[0-57-9])(?:1[02]|9[56])|8078|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))1","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|80781|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))12","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|807812|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:078|1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123"],"0$1"],["(\\d{3})(\\d{5,6})","$1 $2",["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]","(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]","85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])","85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["(?:4|80)0"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|2(?:[02-57-9]|1[1-9])","10|2(?:[02-57-9]|1[1-9])","10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"],"0$1",1],["(\\d{3})(\\d{7,8})","$1 $2",["9"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[3-578]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-9]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["[12]"],"0$1",1]],"0",0,"(1(?:[12]\\d|79)\\d\\d)|0",0,0,0,0,"00"],CO:["57","00(?:4(?:[14]4|56)|[579])","(?:46|60\\d\\d)\\d{6}|(?:1\\d|[39])\\d{9}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["46"]],["(\\d{3})(\\d{7})","$1 $2",["6|90"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["3[0-357]|9[14]"]],["(\\d)(\\d{3})(\\d{7})","$1-$2-$3",["1"],"0$1",0,"$1 $2 $3"]],"0",0,"0([3579]|4(?:[14]4|56))?"],CR:["506","00","(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}",[8,10],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[3-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]"]]],0,0,"(19(?:0[0-2468]|1[09]|20|66|77|99))"],CU:["53","119","(?:[2-7]|8\\d\\d)\\d{7}|[2-47]\\d{6}|[34]\\d{5}",[6,7,8,10],[["(\\d{2})(\\d{4,6})","$1 $2",["2[1-4]|[34]"],"(0$1)"],["(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["[56]"],"0$1"],["(\\d{3})(\\d{7})","$1 $2",["8"],"0$1"]],"0"],CV:["238","0","(?:[2-59]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2-589]"]]]],CW:["599","00","(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[3467]"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["9[4-8]"]]],0,0,0,0,0,"[69]"],CX:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CY:["357","00","(?:[279]\\d|[58]0)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[257-9]"]]]],CZ:["420","00","(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}",[9,10,11,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["96"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]]],DE:["49","00","[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}",[4,5,6,7,8,9,10,11,12,13,14,15],[["(\\d{2})(\\d{3,13})","$1 $2",["3[02]|40|[68]9"],"0$1"],["(\\d{3})(\\d{3,12})","$1 $2",["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1","2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"],"0$1"],["(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]","[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["138"],"0$1"],["(\\d{5})(\\d{2,10})","$1 $2",["3"],"0$1"],["(\\d{3})(\\d{5,11})","$1 $2",["181"],"0$1"],["(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["1(?:3|80)|9"],"0$1"],["(\\d{3})(\\d{7,8})","$1 $2",["1[67]"],"0$1"],["(\\d{3})(\\d{7,12})","$1 $2",["8"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["185","1850","18500"],"0$1"],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["18[68]"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["15[1279]"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["15[03568]","15(?:[0568]|3[13])"],"0$1"],["(\\d{3})(\\d{8})","$1 $2",["18"],"0$1"],["(\\d{3})(\\d{2})(\\d{7,8})","$1 $2 $3",["1(?:6[023]|7)"],"0$1"],["(\\d{4})(\\d{2})(\\d{7})","$1 $2 $3",["15[279]"],"0$1"],["(\\d{3})(\\d{2})(\\d{8})","$1 $2 $3",["15"],"0$1"]],"0"],DJ:["253","00","(?:2\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[27]"]]]],DK:["45","00","[2-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-9]"]]]],DM:["1","011","(?:[58]\\d\\d|767|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","767$1",0,"767"],DO:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,0,0,0,"8001|8[024]9"],DZ:["213","00","(?:[1-4]|[5-79]\\d|80)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-8]"],"0$1"]],"0"],EC:["593","00","1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}",[8,9,10,11],[["(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[2-7]"],"(0$1)",0,"$1-$2-$3"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{3})(\\d{3,4})","$1 $2 $3",["1"]]],"0"],EE:["372","00","8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]],["(\\d{4})(\\d{3,4})","$1 $2",["[45]|8(?:00|[1-49])","[45]|8(?:00[1-9]|[1-49])"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],EG:["20","00","[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}",[8,9,10],[["(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1"],["(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|8[2468]|9[235-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{8})","$1 $2",["1"],"0$1"]],"0"],EH:["212","00","[5-8]\\d{8}",[9],0,"0",0,0,0,0,"528[89]"],ER:["291","00","[178]\\d{6}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[178]"],"0$1"]],"0"],ES:["34","00","[5-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]00"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-9]"]]]],ET:["251","00","(?:11|[2-579]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-579]"],"0$1"]],"0"],FI:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}",[5,6,7,8,9,10,11,12],[["(\\d{5})","$1",["20[2-59]"],"0$1"],["(\\d{3})(\\d{3,7})","$1 $2",["(?:[1-3]0|[68])0|70[07-9]"],"0$1"],["(\\d{2})(\\d{4,8})","$1 $2",["[14]|2[09]|50|7[135]"],"0$1"],["(\\d{2})(\\d{6,10})","$1 $2",["7"],"0$1"],["(\\d)(\\d{4,9})","$1 $2",["(?:19|[2568])[1-8]|3(?:0[1-9]|[1-9])|9"],"0$1"]],"0",0,0,0,0,"1[03-79]|[2-9]",0,"00"],FJ:["679","0(?:0|52)","45\\d{5}|(?:0800\\d|[235-9])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|45"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]]],0,0,0,0,0,0,0,"00"],FK:["500","00","[2-7]\\d{4}",[5]],FM:["691","00","(?:[39]\\d\\d|820)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[389]"]]]],FO:["298","00","[2-9]\\d{5}",[6],[["(\\d{6})","$1",["[2-9]"]]],0,0,"(10(?:01|[12]0|88))"],FR:["33","00","[1-9]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"]],"0"],GA:["241","00","(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}",[7,8],[["(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["11|[67]"],"0$1"]],0,0,"0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})","$1"],GB:["44","00","[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}",[7,9,10],[["(\\d{3})(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["845","8454","84546","845464"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["800"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:(?:38|69)7|5(?:24|39)|768|946)","1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["1(?:[2-69][02-9]|[78])"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[25]|7(?:0|6[02-9])","[25]|7(?:0|6(?:[03-9]|2[356]))"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[1389]"],"0$1"]],"0",0,"0|180020",0,0,0,[["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0-5])|4(?:(?:[0-5]\\d|70)\\d|69[7-9])|(?:(?:5[0-26-9]|[78][0-49])\\d|6(?:[0-4]\\d|5[01]))\\d)|(?:2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d|1(?:[0-7]\\d|8[0-3]))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d)\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}",[9,10]],["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]],0," x"],GD:["1","011","(?:473|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","473$1",0,"473"],GE:["995","00","(?:[3-57]\\d\\d|800)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["32"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[57]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[348]"],"0$1"]],"0"],GF:["594","00","(?:[56]94\\d|7093)\\d{5}|(?:80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]|9[47]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[89]"],"0$1"]],"0"],GG:["44","00","(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?",[7,9,10],0,"0",0,"([25-9]\\d{5})$|0|180020","1481$1",0,0,[["1481[25-9]\\d{5}",[10]],["7(?:(?:781|839)\\d|911[17])\\d{5}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]]],GH:["233","00","(?:[235]\\d{3}|800)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[235]"],"0$1"]],"0"],GI:["350","00","(?:[25]\\d|60)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["2"]]]],GL:["299","00","(?:19|[2-689]\\d|70)\\d{4}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["19|[2-9]"]]]],GM:["220","00","[2-9]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],GN:["224","00","722\\d{6}|(?:3|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"]]]],GP:["590","00","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["590(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1-9]|5[3-579]|[68][0-689]|7[08]|9\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],GQ:["240","00","222\\d{6}|(?:3\\d|55|[89]0)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"]],["(\\d{3})(\\d{6})","$1 $2",["[89]"]]]],GR:["30","00","5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}",[10,11,12],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["21|7"]],["(\\d{4})(\\d{6})","$1 $2",["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2689]"]],["(\\d{3})(\\d{3,4})(\\d{5})","$1 $2 $3",["8"]]]],GT:["502","00","80\\d{6}|(?:1\\d{3}|[2-7])\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1 $2",["[2-8]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],GU:["1","011","(?:[58]\\d\\d|671|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","671$1",0,"671"],GW:["245","00","[49]\\d{8}|4\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["40"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"]]]],GY:["592","001","(?:[2-8]\\d{3}|9008)\\d{3}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],HK:["852","00(?:30|5[09]|[126-9]?)","8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}",[5,6,7,8,9,11],[["(\\d{3})(\\d{2,5})","$1 $2",["900","9003"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{3})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,0,"00"],HN:["504","00","8\\d{10}|[237-9]\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1-$2",["[237-9]"]]]],HR:["385","00","[2-69]\\d{8}|80\\d{5,7}|[1-79]\\d{7}|6\\d{6}",[7,8,9],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["6[01]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6|7[245]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-57]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],"0"],HT:["509","00","[2-589]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[2-589]"]]]],HU:["36","00","[235-7]\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"06 $1"]],"06"],ID:["62","00[89]","00[1-9]\\d{9,14}|(?:[1-36]|8\\d{5})\\d{6}|00\\d{9}|[1-9]\\d{8,10}|[2-9]\\d{7}",[7,8,9,10,11,12,13,14,15,16,17],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["15"]],["(\\d{2})(\\d{5,9})","$1 $2",["2[124]|[36]1"],"(0$1)"],["(\\d{3})(\\d{5,7})","$1 $2",["800"],"0$1"],["(\\d{3})(\\d{5,8})","$1 $2",["[2-79]"],"(0$1)"],["(\\d{3})(\\d{3,4})(\\d{3})","$1-$2-$3",["8[1-35-9]"],"0$1"],["(\\d{3})(\\d{6,8})","$1 $2",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["804"],"0$1"],["(\\d{3})(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1-$2-$3",["8"],"0$1"]],"0"],IE:["353","00","(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)"],["(\\d{3})(\\d{5})","$1 $2",["[45]0"],"(0$1)"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2569]|4[1-69]|7[14]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[78]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["4"],"(0$1)"],["(\\d{2})(\\d)(\\d{3})(\\d{4})","$1 $2 $3 $4",["8"],"0$1"]],"0"],IL:["972","0(?:0|1[2-9])","1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}",[7,8,9,10,11,12],[["(\\d{4})(\\d{3})","$1-$2",["125"]],["(\\d{4})(\\d{2})(\\d{2})","$1-$2-$3",["121"]],["(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1-$2-$3",["12"]],["(\\d{4})(\\d{6})","$1-$2",["159"]],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"]],["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})","$1-$2 $3-$4",["15"]]],"0"],IM:["44","00","1624\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([25-8]\\d{5})$|0|180020","1624$1",0,"74576|(?:16|7[56])24"],IN:["91","00","(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}",[8,9,10,11,12,13],[["(\\d{8})","$1",["5(?:0|2[23]|3[03]|[67]1|88)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"],0,1],["(\\d{4})(\\d{4,5})","$1 $2",["180","1800"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["140"],0,1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79[1-7]|80[2-46]","11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])","11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[14]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:2[14]|3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:74[47]|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"],"0$1",1],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|28|3[129]|4[1-35689]|5[29]|6[02-5]|70)|807","1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]","1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|8(?:28[235-7]|3))|73179|807(?:1|9[1-3])|(?:1552|6(?:(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689])\\d|8(?:[14-6]\\d|2[0-79]))|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"],"0$1",1],["(\\d{5})(\\d{5})","$1 $2",["[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["1(?:6|8[06])","1(?:6|8[06]0)"],0,1],["(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18"],0,1]],"0"],IO:["246","00","3\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["3"]]]],IQ:["964","00","(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],IR:["98","00","[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}",[4,5,6,7,10],[["(\\d{4,5})","$1",["96"],"0$1"],["(\\d{2})(\\d{4,5})","$1 $2",["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1"]],"0"],IS:["354","00|1(?:0(?:01|[12]0)|100)","(?:38\\d|[4-9])\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[4-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["3"]]],0,0,0,0,0,0,0,"00"],IT:["39","00","0\\d{5,11}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:43|55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?",[6,7,8,9,10,11,12],[["(\\d{2})(\\d{4,6})","$1 $2",["0[26]"]],["(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]],["(\\d{4})(\\d{2,6})","$1 $2",["0(?:[13-579][2-46-8]|8[236-8])"]],["(\\d{4})(\\d{4})","$1 $2",["894"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|5"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["1(?:44|[679])|[378]|43"]],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]|14"]],["(\\d{2})(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[03]"]]],0,0,0,0,0,0,[["0(?:669[0-79]\\d{1,6}|831\\d{2,8})|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[2356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}"],["3[2-9]\\d{7,8}|(?:31|43)\\d{8}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],["3[2-8]\\d{9,10}",[11,12]],0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],JE:["44","00","1534\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([0-24-8]\\d{5})$|0|180020","1534$1",0,0,[["1534[0-24-8]\\d{5}"],["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97\\d))\\d{5}"],["80(?:07(?:35|81)|8901)\\d{4}"],["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"],["701511\\d{4}"],0,["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}"],["56\\d{8}"]]],JM:["1","011","(?:[58]\\d\\d|658|900)\\d{7}",[10],0,"1",0,0,0,0,"658|876"],JO:["962","00","(?:(?:[2689]|7\\d)\\d|32|427|53)\\d{6}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)"],["(\\d{3})(\\d{5,6})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["70"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[47]"],"0$1"]],"0"],JP:["81","010","00[1-9]\\d{6,14}|[25-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}",[8,9,10,11,12,13,14,15,16,17],[["(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],["(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51)|9(?:80|9[16])","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["3|4(?:2[09]|7[01])|6[1-9]","3|4(?:2(?:0|9[02-69])|7(?:0[019]|1))|6[1-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[0459]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[26-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9]|9[29])|5(?:2|3(?:[045]|9[0-8])|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|3(?:[29]|60)|49|51|6(?:[0-24]|36|5[0-3589]|7[23]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3(?:[045]|9(?:[0-58]|6[4-9]|7[0-35689]))|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|60|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[2-57-9]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|7(?:2[2-468]|3[78])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"],"0$1"],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["[14]|[289][2-9]|5[3-9]|7[2-4679]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[25-9]"],"0$1"]],"0",0,"(000[2569]\\d{4,6})$|(?:(?:003768)0?)|0","$1"],KE:["254","000","(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}",[7,8,9,10],[["(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[17]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0"],KG:["996","00","8\\d{9}|[235-9]\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["3(?:1[346]|[24-79])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-79]|88"],"0$1"],["(\\d{3})(\\d{3})(\\d)(\\d{2,3})","$1 $2 $3 $4",["8"],"0$1"]],"0"],KH:["855","00[14-9]","1\\d{9}|[1-9]\\d{7,8}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],KI:["686","00","(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}",[5,8],0,"0"],KM:["269","00","[3478]\\d{6}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[3478]"]]]],KN:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","869$1",0,"869"],KP:["850","00|99","85\\d{6}|(?:19\\d|[2-7])\\d{7}",[8,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"]],"0"],KR:["82","00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))","00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}",[5,6,8,9,10,11,12,13,14],[["(\\d{2})(\\d{3,4})","$1-$2",["(?:3[1-3]|[46][1-4]|5[1-5])1"],"0$1"],["(\\d{4})(\\d{4})","$1-$2",["1"]],["(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[36]0|8"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["[1346]|5[1-5]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{2})(\\d{5})(\\d{4})","$1-$2-$3",["5"],"0$1"]],"0",0,"0(8(?:[1-46-8]|5\\d\\d))?"],KW:["965","00","18\\d{5}|(?:[2569]\\d|41)\\d{6}",[7,8],[["(\\d{4})(\\d{3,4})","$1 $2",["[169]|2(?:[235]|4[1-35-9])|52"]],["(\\d{3})(\\d{5})","$1 $2",["[245]"]]]],KY:["1","011","(?:345|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","345$1",0,"345"],KZ:["7","810","(?:33622|8\\d{8})\\d{5}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"33622|7",0,"8~10"],LA:["856","00","[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["3"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[23]"],"0$1"]],"0"],LB:["961","00","[27-9]\\d{7}|[13-9]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-69]|7(?:[2-57]|62|8[0-6]|9[04-9])|8[02-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27-9]"]]],"0"],LC:["1","011","(?:[58]\\d\\d|758|900)\\d{7}",[10],0,"1",0,"([2-8]\\d{6})$|1","758$1",0,"758"],LI:["423","00","[68]\\d{8}|(?:[2378]\\d|90)\\d{5}",[7,9],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2379]|8(?:0[09]|7)","[2379]|8(?:0(?:02|9)|7)"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["69"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],"0",0,"(1001)|0"],LK:["94","00","[1-9]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[1-689]"],"0$1"]],"0"],LR:["231","00","(?:[2457]\\d|33|88)\\d{7}|(?:2\\d|[4-6])\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["4[67]|[56]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-578]"],"0$1"]],"0"],LS:["266","00","(?:[256]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2568]"]]]],LT:["370","00","(?:[3469]\\d|52|[78]0)\\d{6}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["52[0-7]"],"(0-$1)",1],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"0 $1",1],["(\\d{2})(\\d{6})","$1 $2",["37|4(?:[15]|6[1-8])"],"(0-$1)",1],["(\\d{3})(\\d{5})","$1 $2",["[3-6]"],"(0-$1)",1]],"0",0,"[08]"],LU:["352","00","35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}",[4,5,6,7,8,9,10,11],[["(\\d{2})(\\d{3})","$1 $2",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20[2-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["2(?:[0367]|4[3-8])"]],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["80[01]|90[015]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["20"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["2(?:[0367]|4[3-8])"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})","$1 $2 $3 $4",["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]]],0,0,"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"],LV:["371","00","(?:[268]\\d|78|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2679]|8[01]"]]]],LY:["218","00","[2-9]\\d{8}",[9],[["(\\d{2})(\\d{7})","$1-$2",["[2-9]"],"0$1"]],"0"],MA:["212","00","[5-8]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5[45]"],"0$1"],["(\\d{4})(\\d{5})","$1-$2",["5(?:[19]|2[2-46-9]|3[3-9])|8(?:0[89]|92)"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8"],"0$1"],["(\\d{3})(\\d{6})","$1-$2",["[5-7]"],"0$1"]],"0",0,0,0,0,0,[["5(?:(?:18|4[0679]|5[03])\\d|2(?:[0-25-79]\\d|3[1-578]|4[02-46-8]|8[0235-7])|3(?:[0-47]\\d|5[02-9]|6[02-8]|8[014-9]|9[3-9]))\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[016-8]\\d|2[0-8]|5[0-5]))\\d{6}"],["80[0-7]\\d{6}"],["89\\d{7}"],0,0,0,0,["(?:592(?:4[0-2]|93)|80[89]\\d\\d)\\d{4}"]]],MC:["377","00","(?:[3489]|[67]\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[389]"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[67]"],"0$1"]],"0"],MD:["373","00","(?:[235-7]\\d|[89]0)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[25-7]"],"0$1"]],"0"],ME:["382","00","(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"0$1"]],"0"],MF:["590","00","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:0[079]|[14]3|[27][79]|3[03-7]|5[0-268]|87)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],MG:["261","00","[23]\\d{8}",[9],[["(\\d{2})(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,"([24-9]\\d{6})$|0","20$1"],MH:["692","011","329\\d{4}|(?:[256]\\d|45)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1-$2",["[2-6]"]]],"1"],MK:["389","00","[2-578]\\d{7}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2|34[47]|4(?:[37]7|5[47]|64)"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1"]],"0"],ML:["223","00","[24-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-9]"]]]],MM:["95","00","1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}",[6,7,8,9,10],[["(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["4(?:[2-46]|5[3-5])|5|6(?:[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-5]|(?:60|86)[23]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]|452|678|86","[12]|452|6788|86"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[4-7]|8[1-35]"],"0$1"],["(\\d)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[137-9])"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["92"],"0$1"],["(\\d)(\\d{5})(\\d{4})","$1 $2 $3",["9"],"0$1"]],"0"],MN:["976","001","[12]\\d{7,9}|[5-9]\\d{7}",[8,9,10],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[12]1"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[5-9]"]],["(\\d{3})(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["[12](?:27|3[2-8]|4[2-68]|5[1-4689])","[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["[12]"],"0$1"]],"0"],MO:["853","00","0800\\d{3}|(?:28|[68]\\d)\\d{6}",[7,8],[["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{4})(\\d{4})","$1 $2",["[268]"]]]],MP:["1","011","[58]\\d{9}|(?:67|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","670$1",0,"670"],MQ:["596","00","(?:596\\d|7091)\\d{5}|(?:69|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]|8(?:0[6-9]|[36])"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],MR:["222","00","(?:[2-4]\\d\\d|800)\\d{5}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-48]"]]]],MS:["1","011","(?:[58]\\d\\d|664|900)\\d{7}",[10],0,"1",0,"([34]\\d{6})$|1","664$1",0,"664"],MT:["356","00","3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2357-9]"]]]],MU:["230","0(?:0|[24-7]0|3[03])","(?:[57]|8\\d\\d)\\d{7}|[2-468]\\d{6}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[2-46]|8[013]"]],["(\\d{4})(\\d{4})","$1 $2",["[57]"]],["(\\d{5})(\\d{5})","$1 $2",["8"]]],0,0,0,0,0,0,0,"020"],MV:["960","0(?:0|19)","(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}",[7,10],[["(\\d{3})(\\d{4})","$1-$2",["[34679]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,0,"00"],MW:["265","00","(?:[1289]\\d|31|77)\\d{7}|1\\d{6}",[7,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[137-9]"],"0$1"]],"0"],MX:["52","0[09]","[2-9]\\d{9}",[10],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["33|5[56]|81"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2-9]"]]],0,0,0,0,0,0,0,"00"],MY:["60","00","1\\d{8,9}|(?:3\\d|[4-9])\\d{7}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1-$2 $3",["1(?:[02469]|[378][1-9]|53)|8","1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3-$4",["1(?:[367]|80)"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2 $3",["1"],"0$1"]],"0"],MZ:["258","00","(?:2|8\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-79]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],NA:["264","00","[68]\\d{7,8}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["87"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],NC:["687","00","(?:050|[2-57-9]\\d\\d)\\d{3}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[02-57-9]"]]]],NE:["227","00","[027-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["08"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[089]|2[013]|7[0467]"]]]],NF:["672","00","[13]\\d{5}",[6],[["(\\d{2})(\\d{4})","$1 $2",["1[0-3]"]],["(\\d)(\\d{5})","$1 $2",["[13]"]]],0,0,"([0-258]\\d{4})$","3$1"],NG:["234","009","(?:20|9\\d)\\d{8}|[78]\\d{9,13}",[10,11,12,13,14],[["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["20[129]"],"0$1"],["(\\d{4})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[78]"],"0$1"],["(\\d{3})(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]"],"0$1"]],"0"],NI:["505","00","(?:1800|[25-8]\\d{3})\\d{4}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[125-8]"]]]],NL:["31","00","(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|8\\d{6,9}|9\\d{6,10}|1\\d{4,5}",[5,6,7,8,9,10,11],[["(\\d{3})(\\d{4,7})","$1 $2",["[89]0"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["66"],"0$1"],["(\\d)(\\d{8})","$1 $2",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-578]|91"],"0$1"],["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3",["9"],"0$1"]],"0"],NO:["47","00","(?:0|[2-9]\\d{3})\\d{4}",[5,8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]"]]],0,0,0,0,0,"[02-689]|7[0-8]"],NP:["977","00","(?:1\\d|9)\\d{9}|[1-9]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1-$2",["1[2-6]"],"0$1"],["(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-59]|[67][2-6])"],"0$1"],["(\\d{3})(\\d{7})","$1-$2",["9"]]],"0"],NR:["674","00","(?:222|444|(?:55|8\\d)\\d|666|777|999)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[24-9]"]]]],NU:["683","00","(?:[4-7]|888\\d)\\d{3}",[4,7],[["(\\d{3})(\\d{4})","$1 $2",["8"]]]],NZ:["64","0(?:0|161)","[1289]\\d{9}|50\\d{5}(?:\\d{2,3})?|[27-9]\\d{7,8}|(?:[34]\\d|6[0-35-9])\\d{6}|8\\d{4,6}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,8})","$1 $2",["8[1-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["50[036-8]|8|90","50(?:[0367]|88)|8|90"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["24|[346]|7[2-57-9]|9[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|[589]"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1|2[028]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:[169]|7[0-35-9])|7"],"0$1"]],"0",0,0,0,0,0,0,"00"],OM:["968","00","(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}",[7,8,9],[["(\\d{3})(\\d{4,6})","$1 $2",["[58]"]],["(\\d{2})(\\d{6})","$1 $2",["2"]],["(\\d{4})(\\d{4})","$1 $2",["[179]"]]]],PA:["507","00","(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}",[7,8,10,11],[["(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"]],["(\\d{4})(\\d{4})","$1-$2",["[68]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]]],PE:["51","00|19(?:1[124]|77|90)00","(?:[14-8]|9\\d)\\d{7}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["1"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[4-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,0,"00"," Anexo "],PF:["689","00","4\\d{5}(?:\\d{2})?|8\\d{7,8}",[6,8,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4|8[7-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],PG:["675","00|140[1-3]","(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["18|[2-69]|85"]],["(\\d{4})(\\d{4})","$1 $2",["[78]"]]],0,0,0,0,0,0,0,"00"],PH:["63","00","(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}",[6,8,9,10,11,12,13],[["(\\d)(\\d{5})","$1 $2",["2"],"(0$1)"],["(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2","3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"],"(0$1)"],["(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|8[2-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"]]],"0"],PK:["92","00","122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,7})","$1 $2 $3",["[89]0"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["1"]],["(\\d{3})(\\d{6,7})","$1 $2",["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])","9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"],"(0$1)"],["(\\d{2})(\\d{7,8})","$1 $2",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],"(0$1)"],["(\\d{5})(\\d{5})","$1 $2",["58"],"(0$1)"],["(\\d{3})(\\d{7})","$1 $2",["3"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[24-9]"],"(0$1)"]],"0"],PL:["48","00","(?:6|8\\d\\d)\\d{7}|[1-9]\\d{6}(?:\\d{2})?|[26]\\d{5}",[6,7,8,9,10],[["(\\d{5})","$1",["19"]],["(\\d{3})(\\d{3})","$1 $2",["11|20|64"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1","(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2-8]|[2-7]|8[1-79]|9[145]"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["8"]]]],PM:["508","00","[45]\\d{5}|(?:708|8\\d\\d)\\d{6}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[45]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],PR:["1","011","(?:[589]\\d\\d|787)\\d{7}",[10],0,"1",0,0,0,0,"787|939"],PS:["970","00","[2489]2\\d{6}|(?:1\\d|5)\\d{8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2489]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],PT:["351","00","1693\\d{5}|(?:[26-9]\\d|30)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["16|[236-9]"]]]],PW:["680","01[12]","(?:[24-8]\\d\\d|345|900)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],PY:["595","00","59\\d{4,6}|9\\d{5,10}|(?:[2-46-8]\\d|5[0-8])\\d{4,7}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]"],"(0$1)"],["(\\d{3})(\\d{4,5})","$1 $2",["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["87"]],["(\\d{3})(\\d{6})","$1 $2",["9(?:[5-79]|8[1-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["9"]]],"0"],QA:["974","00","800\\d{4}|(?:2|800)\\d{6}|(?:0080|[3-7])\\d{7}",[7,8,9,11],[["(\\d{3})(\\d{4})","$1 $2",["2[136]|8"]],["(\\d{4})(\\d{4})","$1 $2",["[3-7]"]]]],RE:["262","00","709\\d{6}|(?:26|[689]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[26-9]"],"0$1"]],"0",0,0,0,0,0,[["26(?:2\\d\\d|3(?:0\\d|1[0-6]))\\d{4}"],["(?:69(?:2\\d\\d|3(?:[06][0-6]|1[0-3]|2[0-2]|3[0-39]|4\\d|5[0-5]|7[0-37]|8[0-8]|9[0-479]))|7092[0-3])\\d{4}"],["80\\d{7}"],["89[1-37-9]\\d{6}"],0,0,0,0,["9(?:399[0-3]|479[0-6]|76(?:2[278]|3[0-37]))\\d{4}"],["8(?:1[019]|2[0156]|84|90)\\d{6}"]]],RO:["40","00","(?:[236-8]\\d|90)\\d{7}|[23]\\d{5}",[6,9],[["(\\d{3})(\\d{3})","$1 $2",["2[3-6]","2[3-6]\\d9"],"0$1"],["(\\d{2})(\\d{4})","$1 $2",["219|31"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[236-9]"],"0$1"]],"0",0,0,0,0,0,0,0," int "],RS:["381","00","38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}",[6,7,8,9,10,11,12],[["(\\d{3})(\\d{3,9})","$1 $2",["(?:2[389]|39)0|[7-9]"],"0$1"],["(\\d{2})(\\d{5,10})","$1 $2",["[1-36]"],"0$1"]],"0"],RU:["7","810","8\\d{13}|[347-9]\\d{9}",[10,14],[["(\\d{4})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-8]|2[1-9])","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"],"8 ($1)",1],["(\\d{5})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-68]|2[1-9])","7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))","7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[349]|8(?:[02-7]|1[1-8])"],"8 ($1)",1],["(\\d{4})(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["8"],"8 ($1)"]],"8",0,0,0,0,0,[["336(?:[013-9]\\d|2[013-9])\\d{5}|(?:3(?:0[12]|4[1-35-79]|5[1-3]|65|8[1-58]|9[0145])|4(?:01|1[1356]|2[13467]|7[1-5]|8[1-7]|9[1-689])|8(?:1[1-8]|2[01]|3[13-6]|4[0-8]|5[15-7]|6[0-35-79]|7[1-37-9]))\\d{7}",[10]],["9\\d{9}",[10]],["8(?:0[04]|108\\d{3})\\d{7}"],["80[39]\\d{7}",[10]],["808\\d{7}",[10]]],"8~10"],RW:["250","00","(?:06|[27]\\d\\d|[89]00)\\d{6}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[7-9]"],"0$1"]],"0"],SA:["966","00","(?:[15]\\d|800|92)\\d{7}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["9"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],"0"],SB:["677","0[01]","[6-9]\\d{6}|[1-6]\\d{4}",[5,7],[["(\\d{2})(\\d{5})","$1 $2",["6[89]|7|8[4-9]|9(?:[1-8]|9[0-8])"]]]],SC:["248","010|0[0-2]","(?:[2489]\\d|64)\\d{5}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]|9[57]"]]],0,0,0,0,0,0,0,"00"],SD:["249","00","[19]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[19]"],"0$1"]],"0"],SE:["46","00","(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}",[6,7,8,9,10,12],[["(\\d{2})(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{4})","$1-$2",["9(?:00|39|44|9)"],"0$1",0,"$1 $2"],["(\\d{2})(\\d{3})(\\d{2})","$1-$2 $3",["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3"],["(\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{2,3})(\\d{3})","$1-$2 $3",["9(?:00|39|44)"],"0$1",0,"$1 $2 $3"],["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3 $4"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["10|7"],"0$1",0,"$1 $2 $3 $4"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4 $5",["[26]"],"0$1",0,"$1 $2 $3 $4 $5"]],"0"],SG:["65","0[0-3]\\d","(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["[369]|8(?:0[1-9]|[1-9])"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]],["(\\d{4})(\\d{4})(\\d{3})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],SH:["290","00","(?:[256]\\d|8)\\d{3}",[4,5],0,0,0,0,0,0,"[256]"],SI:["386","00|10(?:22|66|88|99)","[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}",[5,6,7,8],[["(\\d{2})(\\d{3,6})","$1 $2",["8[09]|9"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["59|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[0139]|51|6"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-57]"],"(0$1)"]],"0",0,0,0,0,0,0,"00"],SJ:["47","00","0\\d{4}|(?:[489]\\d|79)\\d{6}",[5,8],0,0,0,0,0,0,"79"],SK:["421","00","[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}",[6,7,9],[["(\\d)(\\d{2})(\\d{3,4})","$1 $2 $3",["21"],"0$1"],["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["[3-5][1-8]1","[3-5][1-8]1[67]"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1/$2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1/$2 $3 $4",["[3-5]"],"0$1"]],"0"],SL:["232","00","(?:[237-9]\\d|66)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[236-9]"],"(0$1)"]],"0"],SM:["378","00","(?:0549|[5-7]\\d)\\d{6}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"]],["(\\d{4})(\\d{6})","$1 $2",["0"]]],0,0,"([89]\\d{5})$","0549$1"],SN:["221","00","(?:[378]\\d|93)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"]]]],SO:["252","00","[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}",[6,7,8,9],[["(\\d{2})(\\d{4})","$1 $2",["8[125]"]],["(\\d{6})","$1",["[134]"]],["(\\d)(\\d{6})","$1 $2",["[15]|2[0-79]|3[0-46-8]|4[0-7]"]],["(\\d)(\\d{7})","$1 $2",["(?:2|90)4|[67]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[348]|64|79|90"]],["(\\d{2})(\\d{5,7})","$1 $2",["1|28|6[0-35-9]|7[67]|9[2-9]"]]],"0"],SR:["597","00","(?:[2-5]|[6-8]\\d|90)\\d{5}",[6,7],[["(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"]],["(\\d{3})(\\d{3})","$1-$2",["[2-5]"]],["(\\d{3})(\\d{4})","$1-$2",["[6-9]"]]]],SS:["211","00","[19]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[19]"],"0$1"]],"0"],ST:["239","00","(?:22|9\\d)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[29]"]]]],SV:["503","00","[25-7]\\d{7}|(?:80\\d|900)\\d{4}(?:\\d{4})?",[7,8,11],[["(\\d{3})(\\d{4})","$1 $2",["[89]"]],["(\\d{4})(\\d{4})","$1 $2",["[25-7]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"]]]],SX:["1","011","7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"(5\\d{6})$|1","721$1",0,"721"],SY:["963","00","[1-359]\\d{8}|[1-5]\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-4]|5[1-3]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[59]"],"0$1",1]],"0"],SZ:["268","00","0800\\d{4}|(?:[237]\\d|900)\\d{6}",[8,9],[["(\\d{4})(\\d{4})","$1 $2",["[0237]"]],["(\\d{5})(\\d{4})","$1 $2",["9"]]]],TA:["290","00","8\\d{3}",[4],0,0,0,0,0,0,"8"],TC:["1","011","(?:[58]\\d\\d|649|900)\\d{7}",[10],0,"1",0,"([2-479]\\d{6})$|1","649$1",0,"649"],TD:["235","00|16","(?:22|30|[689]\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[236-9]"]]],0,0,0,0,0,0,0,"00"],TG:["228","00","[279]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[279]"]]]],TH:["66","00[1-9]","(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}",[8,9,10,13],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[13-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],TJ:["992","810","(?:[0-57-9]\\d|66)\\d{7}",[9],[["(\\d{6})(\\d)(\\d{2})","$1 $2 $3",["331","3317"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["44[02-479]|[34]7"]],["(\\d{4})(\\d)(\\d{4})","$1 $2 $3",["3(?:[1245]|3[12])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["\\d"]]],0,0,0,0,0,0,0,"8~10"],TK:["690","00","[2-47]\\d{3,6}",[4,5,6,7]],TL:["670","00","7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[2-489]|70"]],["(\\d{4})(\\d{4})","$1 $2",["7"]]]],TM:["993","810","(?:[1-6]\\d|71)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-5]"],"(8 $1)"],["(\\d{2})(\\d{6})","$1 $2",["[67]"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],TN:["216","00","[2-57-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]"]]]],TO:["676","00","(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}",[5,7],[["(\\d{2})(\\d{3})","$1-$2",["[2-4]|50|6[09]|7[0-24-69]|8[05]"]],["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[5-9]"]]]],TR:["90","00","4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}",[7,10,12,13],[["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["512|8[01589]|90"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5(?:[0-59]|61)","5(?:[0-59]|61[06])","5(?:[0-59]|61[06]1)"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24][1-8]|3[1-9]"],"(0$1)",1],["(\\d{3})(\\d{3})(\\d{6,7})","$1 $2 $3",["80"],"0$1",1]],"0"],TT:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-46-8]\\d{6})$|1","868$1",0,"868"],TV:["688","00","(?:2|7\\d\\d|90)\\d{4}",[5,6,7],[["(\\d{2})(\\d{3})","$1 $2",["2"]],["(\\d{2})(\\d{4})","$1 $2",["90"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],TW:["886","0(?:0[25-79]|19)","[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}",[7,8,9,10,11],[["(\\d{2})(\\d)(\\d{4})","$1 $2 $3",["202"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[258]0"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-47-9])|7[1-9]","[23568]|4(?:0[2-48]|[1-47-9])|(?:400|7)[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,5})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,0,0,"#"],TZ:["255","00[056]","(?:[25-8]\\d|41|90)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["5"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1"]],"0"],UA:["380","00","[89]\\d{9}|[3-9]\\d{8}",[9,10],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]","6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])","3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|89|9[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,0,"0~0"],UG:["256","00[057]","800\\d{6}|(?:[29]0|[347]\\d)\\d{7}",[9],[["(\\d{4})(\\d{5})","$1 $2",["202","2024"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[27-9]|4(?:6[45]|[7-9])"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[34]"],"0$1"]],"0"],US:["1","011","[2-9]\\d{9}|3\\d{6}",[10],[["(\\d{3})(\\d{4})","$1-$2",["310"],0,1],["(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],0,1,"$1-$2-$3"]],"1",0,0,0,0,0,[["3052(?:0[0-8]|[1-9]\\d)\\d{4}|(?:2742|305[3-9])\\d{6}|(?:472|983)[2-47-9]\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-47-9]|1[02-9]|2[013-79]|3[0-24679]|4[167]|5[0-2]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-269])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[0-247]|4[0378]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[0168]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-3589]|8[04-69]))[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"],0,0,0,["305209\\d{4}"]]],UY:["598","0(?:0|1[3-9]\\d)","0004\\d{2,9}|[1249]\\d{7}|2\\d{3,4}|(?:[49]\\d|80)\\d{5}",[4,5,6,7,8,9,10,11,12,13],[["(\\d{4,5})","$1",["21"]],["(\\d{3})(\\d{3,4})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[49]0|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[124]"]],["(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3 $4",["0"]]],"0",0,0,0,0,0,0,"00"," int. "],UZ:["998","00","(?:20|33|[5-9]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[235-9]"]]]],VA:["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11,12],0,0,0,0,0,0,"06698"],VC:["1","011","(?:[58]\\d\\d|784|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","784$1",0,"784"],VE:["58","00","[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}",[10],[["(\\d{3})(\\d{7})","$1-$2",["[24-689]"],"0$1"]],"0"],VG:["1","011","(?:284|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-578]\\d{6})$|1","284$1",0,"284"],VI:["1","011","[58]\\d{9}|(?:34|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","340$1",0,"340"],VN:["84","00","[12]\\d{9}|[135-9]\\d{8}|[16]\\d{7}|[16-8]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["80"],"0$1",1],["(\\d{4})(\\d{4,6})","$1 $2",["1"],0,1],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["6"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[357-9]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2[48]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["2"],"0$1",1]],"0"],VU:["678","00","[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}",[5,7],[["(\\d{3})(\\d{4})","$1 $2",["[57-9]"]]]],WF:["681","00","(?:40|72|8\\d{4})\\d{4}|[89]\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[47-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],WS:["685","0","(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}",[5,6,7,10],[["(\\d{5})","$1",["[2-5]|6[1-9]"]],["(\\d{3})(\\d{3,7})","$1 $2",["[68]"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],XK:["383","00","2\\d{7,8}|3\\d{7,11}|(?:4\\d\\d|[89]00)\\d{5}",[8,9,10,11,12],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2|39"],"0$1"],["(\\d{2})(\\d{7,10})","$1 $2",["3"],"0$1"]],"0"],YE:["967","00","(?:1|7\\d)\\d{7}|[1-7]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7(?:[24-6]|8[0-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1"]],"0"],YT:["262","00","7093\\d{5}|(?:80|9\\d)\\d{7}|(?:26|63)9\\d{6}",[9],0,"0",0,0,0,0,0,[["269(?:0[0-467]|15|5[0-4]|6\\d|[78]0)\\d{4}"],["(?:639(?:0[0-79]|1[019]|[267]\\d|3[09]|40|5[05-9]|9[04-79])|7093[5-7])\\d{4}"],["80\\d{7}"],0,0,0,0,0,["9(?:(?:39|47)8[01]|769\\d)\\d{4}"]]],ZA:["27","00","[1-79]\\d{8}|8\\d{4,9}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],ZM:["260","00","800\\d{6}|(?:21|[579]\\d|63)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[28]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[579]"],"0$1"]],"0"],ZW:["263","00","2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}",[5,6,7,8,9,10],[["(\\d{3})(\\d{3,5})","$1 $2",["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"],"0$1"],["(\\d)(\\d{3})(\\d{2,4})","$1 $2 $3",["[49]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["80"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2","2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)","2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["29[013-9]|39|54"],"0$1"],["(\\d{4})(\\d{3,5})","$1 $2",["(?:25|54)8","258|5483"],"0$1"]],"0"]},nonGeographic:{800:["800",0,"(?:00|[1-9]\\d)\\d{6}",[8],[["(\\d{4})(\\d{4})","$1 $2",["\\d"]]],0,0,0,0,0,0,[0,0,["(?:00|[1-9]\\d)\\d{6}"]]],808:["808",0,"[1-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[1-9]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,["[1-9]\\d{7}"]]],870:["870",0,"7\\d{11}|[235-7]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-7]"]]],0,0,0,0,0,0,[0,["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"],0,0,0,0,0,0,["2\\d{8}",[9]]]],878:["878",0,"10\\d{10}",[12],[["(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["10\\d{10}"]]],881:["881",0,"6\\d{9}|[0-36-9]\\d{8}",[9,10],[["(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[0-37-9]"]],["(\\d)(\\d{3})(\\d{5,6})","$1 $2 $3",["6"]]],0,0,0,0,0,0,[0,["6\\d{9}|[0-36-9]\\d{8}"]]],882:["882",0,"[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?",[7,8,9,10,11,12],[["(\\d{2})(\\d{5})","$1 $2",["16|342"]],["(\\d{2})(\\d{6})","$1 $2",["49"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["1[36]|9"]],["(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["16"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|23|3(?:[15]|4[57])|4|51"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["34"]],["(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["[1-35]"]]],0,0,0,0,0,0,[0,["342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|50\\d{3})\\d{7}",[7,8,9,10,12]],0,0,0,["348[57]\\d{7}",[11]],0,0,["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}"]]],883:["883",0,"(?:[1-4]\\d|51)\\d{6,10}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,8})","$1 $2 $3",["[14]|2[24-689]|3[02-689]|51[24-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["21"]],["(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["51[13]"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[235]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[0-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}"]]],888:["888",0,"\\d{11}",[11],[["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3"]],0,0,0,0,0,0,[0,0,0,0,0,0,["\\d{11}"]]],979:["979",0,"[1359]\\d{8}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[1359]"]]],0,0,0,0,0,0,[0,0,0,["[1359]\\d{8}"]]]}};function Kr(t,e){var n=Array.prototype.slice.call(e);return n.push(jr),t.apply(this,n)}function Hr(t,e){t=t.split("-"),e=e.split("-");for(var n=t[0].split("."),r=e[0].split("."),d=0;d<3;d++){var i=Number(n[d]),o=Number(r[d]);if(i>o)return 1;if(o>i)return-1;if(!isNaN(i)&&isNaN(o))return 1;if(isNaN(i)&&!isNaN(o))return-1}return t[1]&&e[1]?t[1]>e[1]?1:t[1]<e[1]?-1:0:!t[1]&&e[1]?1:t[1]&&!e[1]?-1:0}var Gr={}.constructor;function Vr(t){return null!=t&&t.constructor===Gr}function qr(t){return qr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qr(t)}function Zr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Wr(t,e,n){return e&&function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Jr(r.key),r)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Jr(t){var e=function(t,e){if("object"!=qr(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!=qr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==qr(e)?e:e+""}var Yr=" ext. ",zr=/^\d+$/,Xr=function(){return Wr(function t(e){Zr(this,t),dd(e),this.metadata=e,sd.call(this,e)},[{key:"getCountries",value:function(){return Object.keys(this.metadata.countries).filter(function(t){return"001"!==t})}},{key:"getCountryMetadata",value:function(t){return this.metadata.countries[t]}},{key:"nonGeographic",value:function(){if(!(this.v1||this.v2||this.v3))return this.metadata.nonGeographic||this.metadata.nonGeographical}},{key:"hasCountry",value:function(t){return void 0!==this.getCountryMetadata(t)}},{key:"hasCallingCode",value:function(t){if(this.getCountryCodesForCallingCode(t))return!0;if(this.nonGeographic()){if(this.nonGeographic()[t])return!0}else{var e=this.countryCallingCodes()[t];if(e&&1===e.length&&"001"===e[0])return!0}}},{key:"isNonGeographicCallingCode",value:function(t){return this.nonGeographic()?!!this.nonGeographic()[t]:!this.getCountryCodesForCallingCode(t)}},{key:"country",value:function(t){return this.selectNumberingPlan(t)}},{key:"selectNumberingPlan",value:function(t,e){if(t&&zr.test(t)&&(e=t,t=null),t&&"001"!==t){if(!this.hasCountry(t))throw new Error("Unknown country: ".concat(t));this.numberingPlan=new Qr(this.getCountryMetadata(t),this)}else if(e){if(!this.hasCallingCode(e))throw new Error("Unknown calling code: ".concat(e));this.numberingPlan=new Qr(this.getNumberingPlanMetadata(e),this)}else this.numberingPlan=void 0;return this}},{key:"getCountryCodesForCallingCode",value:function(t){var e=this.countryCallingCodes()[t];if(e){if(1===e.length&&3===e[0].length)return;return e}}},{key:"getCountryCodeForCallingCode",value:function(t){var e=this.getCountryCodesForCallingCode(t);if(e)return e[0]}},{key:"getNumberingPlanMetadata",value:function(t){var e=this.getCountryCodeForCallingCode(t);if(e)return this.getCountryMetadata(e);if(this.nonGeographic()){var n=this.nonGeographic()[t];if(n)return n}else{var r=this.countryCallingCodes()[t];if(r&&1===r.length&&"001"===r[0])return this.metadata.countries["001"]}}},{key:"countryCallingCode",value:function(){return this.numberingPlan.callingCode()}},{key:"IDDPrefix",value:function(){return this.numberingPlan.IDDPrefix()}},{key:"defaultIDDPrefix",value:function(){return this.numberingPlan.defaultIDDPrefix()}},{key:"nationalNumberPattern",value:function(){return this.numberingPlan.nationalNumberPattern()}},{key:"possibleLengths",value:function(){return this.numberingPlan.possibleLengths()}},{key:"formats",value:function(){return this.numberingPlan.formats()}},{key:"nationalPrefixForParsing",value:function(){return this.numberingPlan.nationalPrefixForParsing()}},{key:"nationalPrefixTransformRule",value:function(){return this.numberingPlan.nationalPrefixTransformRule()}},{key:"leadingDigits",value:function(){return this.numberingPlan.leadingDigits()}},{key:"hasTypes",value:function(){return this.numberingPlan.hasTypes()}},{key:"type",value:function(t){return this.numberingPlan.type(t)}},{key:"ext",value:function(){return this.numberingPlan.ext()}},{key:"countryCallingCodes",value:function(){return this.v1?this.metadata.country_phone_code_to_countries:this.metadata.country_calling_codes}},{key:"chooseCountryByCountryCallingCode",value:function(t){return this.selectNumberingPlan(t)}},{key:"hasSelectedNumberingPlan",value:function(){return void 0!==this.numberingPlan}}])}(),Qr=function(){return Wr(function t(e,n){Zr(this,t),this.globalMetadataObject=n,this.metadata=e,sd.call(this,n.metadata)},[{key:"callingCode",value:function(){return this.metadata[0]}},{key:"getDefaultCountryMetadataForRegion",value:function(){return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode())}},{key:"IDDPrefix",value:function(){if(!this.v1&&!this.v2)return this.metadata[1]}},{key:"defaultIDDPrefix",value:function(){if(!this.v1&&!this.v2)return this.metadata[12]}},{key:"nationalNumberPattern",value:function(){return this.v1||this.v2?this.metadata[1]:this.metadata[2]}},{key:"possibleLengths",value:function(){if(!this.v1)return this.metadata[this.v2?2:3]}},{key:"_getFormats",value:function(t){return t[this.v1?2:this.v2?3:4]}},{key:"formats",value:function(){var t=this,e=this._getFormats(this.metadata)||this._getFormats(this.getDefaultCountryMetadataForRegion())||[];return e.map(function(e){return new td(e,t)})}},{key:"nationalPrefix",value:function(){return this.metadata[this.v1?3:this.v2?4:5]}},{key:"_getNationalPrefixFormattingRule",value:function(t){return t[this.v1?4:this.v2?5:6]}},{key:"nationalPrefixFormattingRule",value:function(){return this._getNationalPrefixFormattingRule(this.metadata)||this._getNationalPrefixFormattingRule(this.getDefaultCountryMetadataForRegion())}},{key:"_nationalPrefixForParsing",value:function(){return this.metadata[this.v1?5:this.v2?6:7]}},{key:"nationalPrefixForParsing",value:function(){return this._nationalPrefixForParsing()||this.nationalPrefix()}},{key:"nationalPrefixTransformRule",value:function(){return this.metadata[this.v1?6:this.v2?7:8]}},{key:"_getNationalPrefixIsOptionalWhenFormatting",value:function(){return!!this.metadata[this.v1?7:this.v2?8:9]}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata)||this._getNationalPrefixIsOptionalWhenFormatting(this.getDefaultCountryMetadataForRegion())}},{key:"leadingDigits",value:function(){return this.metadata[this.v1?8:this.v2?9:10]}},{key:"types",value:function(){return this.metadata[this.v1?9:this.v2?10:11]}},{key:"hasTypes",value:function(){return(!this.types()||0!==this.types().length)&&!!this.types()}},{key:"type",value:function(t){if(this.hasTypes()&&rd(this.types(),t))return new nd(rd(this.types(),t),this)}},{key:"ext",value:function(){return this.v1||this.v2?Yr:this.metadata[13]||Yr}}])}(),td=function(){return Wr(function t(e,n){Zr(this,t),this._format=e,this.metadata=n},[{key:"pattern",value:function(){return this._format[0]}},{key:"format",value:function(){return this._format[1]}},{key:"leadingDigitsPatterns",value:function(){return this._format[2]||[]}},{key:"nationalPrefixFormattingRule",value:function(){return this._format[3]||this.metadata.nationalPrefixFormattingRule()}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return!!this._format[4]||this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"nationalPrefixIsMandatoryWhenFormattingInNationalFormat",value:function(){return this.usesNationalPrefix()&&!this.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"usesNationalPrefix",value:function(){return!(!this.nationalPrefixFormattingRule()||ed.test(this.nationalPrefixFormattingRule()))}},{key:"internationalFormat",value:function(){return this._format[5]||this.format()}}])}(),ed=/^\(?\$1\)?$/,nd=function(){return Wr(function t(e,n){Zr(this,t),this.type=e,this.metadata=n},[{key:"pattern",value:function(){return this.metadata.v1?this.type:this.type[0]}},{key:"possibleLengths",value:function(){if(!this.metadata.v1)return this.type[1]||this.metadata.possibleLengths()}}])}();function rd(t,e){switch(e){case"FIXED_LINE":return t[0];case"MOBILE":return t[1];case"TOLL_FREE":return t[2];case"PREMIUM_RATE":return t[3];case"PERSONAL_NUMBER":return t[4];case"VOICEMAIL":return t[5];case"UAN":return t[6];case"PAGER":return t[7];case"VOIP":return t[8];case"SHARED_COST":return t[9]}}function dd(t){if(!t)throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");if(!Vr(t)||!Vr(t.countries))throw new Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat(Vr(t)?"an object of shape: { "+Object.keys(t).join(", ")+" }":"a "+id(t)+": "+t,"."))}var id=function(t){return qr(t)};function od(t,e){if((e=new Xr(e)).hasCountry(t))return e.selectNumberingPlan(t).countryCallingCode();throw new Error("Unknown country: ".concat(t))}function sd(t){var e=t.version;"number"==typeof e?(this.v1=1===e,this.v2=2===e,this.v3=3===e,this.v4=4===e):e?-1===Hr(e,"1.2.0")?this.v2=!0:-1===Hr(e,"1.7.35")?this.v3=!0:this.v4=!0:this.v1=!0}function ad(t,e,n){return function(t,e,n,r){e&&(r=new Xr(r.metadata)).selectNumberingPlan(e);var d=r.type(n),i=d&&d.possibleLengths()||r.possibleLengths();if(!i)return"IS_POSSIBLE";var o=t.length,s=i[0];if(s===o)return"IS_POSSIBLE";if(s>o)return"TOO_SHORT";if(i[i.length-1]<o)return"TOO_LONG";return i.indexOf(o,1)>=0?"IS_POSSIBLE":"INVALID_LENGTH"}(t,e,void 0,n)}function ud(t,e,n){return"IS_POSSIBLE"===ad(t,e,n)}function cd(t,e){return t=t||"",new RegExp("^(?:"+e+")$").test(t)}function $d(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return ld(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ld(t,e):void 0}}(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ld(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var fd=["MOBILE","PREMIUM_RATE","TOLL_FREE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL"];function hd(t,e,n){if(e=e||{},t.country||t.countryCallingCode){(n=new Xr(n)).selectNumberingPlan(t.country,t.countryCallingCode);var r=e.v2?t.nationalNumber:t.phone;if(cd(r,n.nationalNumberPattern())){if(yd(r,"FIXED_LINE",n))return n.type("MOBILE")&&""===n.type("MOBILE").pattern()?"FIXED_LINE_OR_MOBILE":n.type("MOBILE")?yd(r,"MOBILE",n)?"FIXED_LINE_OR_MOBILE":"FIXED_LINE":"FIXED_LINE_OR_MOBILE";for(var d,i=$d(fd);!(d=i()).done;){var o=d.value;if(yd(r,o,n))return o}}}}function yd(t,e,n){return!(!(e=n.type(e))||!e.pattern())&&(!(e.possibleLengths()&&e.possibleLengths().indexOf(t.length)<0)&&cd(t,e.pattern()))}function gd(t,e,n){var r=new Xr(n).getCountryCodesForCallingCode(t);return r?r.filter(function(t){return function(t,e,n){var r=new Xr(n);if(r.selectNumberingPlan(e),r.numberingPlan.possibleLengths().indexOf(t.length)>=0)return!0;return!1}(e,t,n)}):[]}var pd="0-90-9٠-٩۰-۹",md="".concat("-‐-―−ー-").concat("//").concat("..").concat("  ­​⁠ ").concat("()()[]\\[\\]").concat("~⁓∼~"),bd=new RegExp("(["+pd+"])");function wd(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return vd(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vd(t,e):void 0}}(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function vd(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Ed(t,e){var n=e.nationalNumber,r=e.metadata,d=r.getCountryCodesForCallingCode(t);if(d)return 1===d.length?d[0]:function(t,e){var n=e.countries,r=e.metadata;r=new Xr(r);for(var d,i=wd(n);!(d=i()).done;){var o=d.value;if(r.selectNumberingPlan(o),r.leadingDigits()){if(t&&0===t.search(r.leadingDigits()))return o}else if(hd({phone:t,country:o},void 0,r.metadata))return o}}(n,{countries:d,metadata:r.metadata})}function Od(t,e,n){var r=function(t,e){if(t&&e.numberingPlan.nationalPrefixForParsing()){var n=new RegExp("^(?:"+e.numberingPlan.nationalPrefixForParsing()+")"),r=n.exec(t);if(r){var d,i,o,s=r.length-1,a=s>0&&r[s];if(e.nationalPrefixTransformRule()&&a)d=t.replace(n,e.nationalPrefixTransformRule()),s>1&&(i=r[1]);else{var u=r[0];d=t.slice(u.length),a&&(i=r[1])}if(a){var c=t.indexOf(r[1]);t.slice(0,c)===e.numberingPlan.nationalPrefix()&&(o=e.numberingPlan.nationalPrefix())}else o=r[0];return{nationalNumber:d,nationalPrefix:o,carrierCode:i}}}return{nationalNumber:t}}(t,n),d=r.carrierCode,i=r.nationalNumber;if(i!==t){if(!function(t,e,n){if(cd(t,n.nationalNumberPattern())&&!cd(e,n.nationalNumberPattern()))return!1;return!0}(t,i,n))return{nationalNumber:t};if(n.numberingPlan.possibleLengths()&&(e||(e=Ed(n.numberingPlan.callingCode(),{nationalNumber:i,metadata:n})),!function(t,e,n){switch(ad(t,e,n)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}(i,e,n)))return{nationalNumber:t}}return{nationalNumber:i,carrierCode:d}}function Pd(t,e,n,r,d){if(!t)return{};var i;if("+"!==t[0]){var o=function(t,e,n,r){if(e){var d=new Xr(r);d.selectNumberingPlan(e,n);var i=new RegExp(d.IDDPrefix());if(0===t.search(i)){var o=(t=t.slice(t.match(i)[0].length)).match(bd);if(!(o&&null!=o[1]&&o[1].length>0&&"0"===o[1]))return t}}}(t,n,r,d);if(!o||o===t){if(n||r){var s=function(t,e,n,r,d){var i=n?od(n,d):r;if(0===t.indexOf(i)){(d=new Xr(d)).selectNumberingPlan(n,i);var o=t.slice(i.length),s=Od(o,e,d).nationalNumber,a=Od(t,e,d).nationalNumber;if(!cd(a,d.nationalNumberPattern())&&cd(s,d.nationalNumberPattern())||"TOO_LONG"===ad(a,e,d))return{countryCallingCode:i,number:o}}return{number:t}}(t,e,n,r,d),a=s.countryCallingCode,u=s.number;if(a)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:a,number:u}}return{number:t}}i=!0,t="+"+o}if("0"===t[1])return{};d=new Xr(d);for(var c=2;c-1<=3&&c<=t.length;){var $=t.slice(1,c);if(d.hasCallingCode($))return d.selectNumberingPlan($),{countryCallingCodeSource:i?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:$,number:t.slice(c)};c++}return{}}var Sd=/(\$\d)/;function Nd(t,e,n){var r=n.useInternationalFormat,d=n.withNationalPrefix,i=t.replace(new RegExp(e.pattern()),r?e.internationalFormat():d&&e.nationalPrefixFormattingRule()?e.format().replace(Sd,e.nationalPrefixFormattingRule()):e.format());return r?function(t){return t.replace(new RegExp("[".concat(md,"]+"),"g")," ").trim()}(i):i}var Cd=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;var Ad=function(t){return"([".concat(pd,"]{1,").concat(t,"})")};function Id(t){var e="[  \\t,]*",n="[:\\..]?[  \\t,-]*",r="#?",d="[  \\t]*";return";ext="+Ad("20")+"|"+(e+"(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)"+n+Ad("20")+r)+"|"+(e+"(?:[xx##~~]|int|int)"+n+Ad("9")+r)+"|"+("[- ]+"+Ad("6")+"#")+"|"+(d+"(?:,{2}|;)"+n+Ad("15")+r)+"|"+(d+"(?:,)+"+n+Ad("9")+r)}var xd="["+pd+"]{2}",Td="[++]{0,1}(?:["+md+"]*["+pd+"]){3,}["+md+pd+"]*",kd=new RegExp("^[++]{0,1}(?:["+md+"]*["+pd+"]){1,2}$","i"),Bd=Td+"(?:"+Id()+")?",Rd=new RegExp("^"+xd+"$|^"+Bd+"$","i");var Md={formatExtension:function(t,e,n){return"".concat(t).concat(n.ext()).concat(e)}};function _d(t,e,n,r){if(n=n?function(){for(var t=1,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];for(;t<n.length;){if(n[t])for(var d in n[t])n[0][d]=n[t][d];t++}return n[0]}({},Md,n):Md,r=new Xr(r),t.country&&"001"!==t.country){if(!r.hasCountry(t.country))throw new Error("Unknown country: ".concat(t.country));r.selectNumberingPlan(t.country)}else{if(!t.countryCallingCode)return t.phone||"";r.selectNumberingPlan(t.countryCallingCode)}var d,i=r.countryCallingCode(),o=n.v2?t.nationalNumber:t.phone;switch(e){case"NATIONAL":return o?Ud(d=Ld(o,t.carrierCode,"NATIONAL",r,n),t.ext,r,n.formatExtension):"";case"INTERNATIONAL":return o?(d=Ld(o,null,"INTERNATIONAL",r,n),Ud(d="+".concat(i," ").concat(d),t.ext,r,n.formatExtension)):"+".concat(i);case"E.164":return"+".concat(i).concat(o);case"RFC3966":return function(t){var e=t.number,n=t.ext;if(!e)return"";if("+"!==e[0])throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');return"tel:".concat(e).concat(n?";ext="+n:"")}({number:"+".concat(i).concat(o),ext:t.ext});case"IDD":if(!n.fromCountry)return;var s=function(t,e,n,r,d){var i=od(r,d.metadata);if(i===n){var o=Ld(t,e,"NATIONAL",d);return"1"===n?n+" "+o:o}var s=function(t,e,n){var r=new Xr(n);return r.selectNumberingPlan(t,e),r.defaultIDDPrefix()?r.defaultIDDPrefix():Cd.test(r.IDDPrefix())?r.IDDPrefix():void 0}(r,void 0,d.metadata);if(s)return"".concat(s," ").concat(n," ").concat(Ld(t,null,"INTERNATIONAL",d))}(o,t.carrierCode,i,n.fromCountry,r);return Ud(s,t.ext,r,n.formatExtension);default:throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(e,'"'))}}function Ld(t,e,n,r,d){var i,o,s=(i=r.formats(),o=t,function(t,e){for(var n=0;n<t.length;){if(e(t[n]))return t[n];n++}}(i,function(t){if(t.leadingDigitsPatterns().length>0){var e=t.leadingDigitsPatterns()[t.leadingDigitsPatterns().length-1];if(0!==o.search(e))return!1}return cd(o,t.pattern())}));return s?Nd(t,s,{useInternationalFormat:"INTERNATIONAL"===n,withNationalPrefix:!s.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!d||!1!==d.nationalPrefix}):t}function Ud(t,e,n,r){return e?r(t,e,n):t}function Fd(t){return Fd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fd(t)}function Dd(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function jd(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Dd(Object(n),!0).forEach(function(e){Kd(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Dd(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function Kd(t,e,n){return(e=Gd(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Hd(t,e,n){return e&&function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Gd(r.key),r)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Gd(t){var e=function(t,e){if("object"!=Fd(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!=Fd(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==Fd(e)?e:e+""}var Vd=function(){return Hd(function t(e,n,r){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),!e)throw new TypeError("First argument is required");if("string"!=typeof e)throw new TypeError("First argument must be a string");if("+"===e[0]&&!n)throw new TypeError("`metadata` argument not passed");if(Vr(n)&&Vr(n.countries)){r=n;var d=e;if(!Zd.test(d))throw new Error('Invalid `number` argument passed: must consist of a "+" followed by digits');var i=Pd(d,void 0,void 0,void 0,r);if(e=i.countryCallingCode,!(n=i.number))throw new Error("Invalid `number` argument passed: too short")}if(!n)throw new TypeError("`nationalNumber` argument is required");if("string"!=typeof n)throw new TypeError("`nationalNumber` argument must be a string");dd(r);var o=function(t,e){var n,r,d=new Xr(e);qd(t)?(n=t,d.selectNumberingPlan(n),r=d.countryCallingCode()):r=t;return{country:n,countryCallingCode:r}}(e,r),s=o.country,a=o.countryCallingCode;this.country=s,this.countryCallingCode=a,this.nationalNumber=n,this.number="+"+this.countryCallingCode+this.nationalNumber,this.getMetadata=function(){return r}},[{key:"setExt",value:function(t){this.ext=t}},{key:"getPossibleCountries",value:function(){return this.country?[this.country]:gd(this.countryCallingCode,this.nationalNumber,this.getMetadata())}},{key:"isPossible",value:function(){return function(t,e,n){if(void 0===e&&(e={}),n=new Xr(n),e.v2){if(!t.countryCallingCode)throw new Error("Invalid phone number object passed");n.selectNumberingPlan(t.countryCallingCode)}else{if(!t.phone)return!1;if(t.country){if(!n.hasCountry(t.country))throw new Error("Unknown country: ".concat(t.country));n.selectNumberingPlan(t.country)}else{if(!t.countryCallingCode)throw new Error("Invalid phone number object passed");n.selectNumberingPlan(t.countryCallingCode)}}if(n.possibleLengths())return ud(t.phone||t.nationalNumber,t.country,n);if(t.countryCallingCode&&n.isNonGeographicCallingCode(t.countryCallingCode))return!0;throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.')}(this,{v2:!0},this.getMetadata())}},{key:"isValid",value:function(){return function(t,e,n){return e=e||{},(n=new Xr(n)).selectNumberingPlan(t.country,t.countryCallingCode),n.hasTypes()?void 0!==hd(t,e,n.metadata):cd(e.v2?t.nationalNumber:t.phone,n.nationalNumberPattern())}(this,{v2:!0},this.getMetadata())}},{key:"isNonGeographic",value:function(){return new Xr(this.getMetadata()).isNonGeographicCallingCode(this.countryCallingCode)}},{key:"isEqual",value:function(t){return this.number===t.number&&this.ext===t.ext}},{key:"getType",value:function(){return hd(this,{v2:!0},this.getMetadata())}},{key:"format",value:function(t,e){return _d(this,t,e?jd(jd({},e),{},{v2:!0}):{v2:!0},this.getMetadata())}},{key:"formatNational",value:function(t){return this.format("NATIONAL",t)}},{key:"formatInternational",value:function(t){return this.format("INTERNATIONAL",t)}},{key:"getURI",value:function(t){return this.format("RFC3966",t)}}])}(),qd=function(t){return/^[A-Z]{2}$/.test(t)};var Zd=/^\+\d+$/;function Wd(t){return Wd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wd(t)}function Jd(t,e,n){return e=Qd(e),function(t,e){if(e&&("object"==Wd(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,zd()?Reflect.construct(e,n||[],Qd(t).constructor):e.apply(t,n))}function Yd(t){var e="function"==typeof Map?new Map:void 0;return Yd=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if(zd())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var d=new(t.bind.apply(t,r));return n&&Xd(d,n.prototype),d}(t,arguments,Qd(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Xd(n,t)},Yd(t)}function zd(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(zd=function(){return!!t})()}function Xd(t,e){return Xd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Xd(t,e)}function Qd(t){return Qd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Qd(t)}var ti=function(){function t(e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),n=Jd(this,t,[e]),Object.setPrototypeOf(n,t.prototype),n.name=n.constructor.name,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Xd(t,e)}(t,Yd(Error)),e=t,Object.defineProperty(e,"prototype",{writable:!1}),e;var e}(),ei=new RegExp("(?:"+Id()+")$","i");var ni={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9"};function ri(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return di(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?di(t,e):void 0}}(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function di(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function ii(t){for(var e,n="",r=ri(t.split(""));!(e=r()).done;){n+=oi(e.value,n)||""}return n}function oi(t,e,n){if("+"===t){if(e)return;return"+"}return function(t){return ni[t]}(t)}var si="(["+pd+"]|[\\-\\.\\(\\)]?)",ai=new RegExp("^\\+"+si+"*["+pd+"]"+si+"*$","g"),ui=new RegExp("^("+("["+pd+"]+((\\-)*["+pd+"])*")+"\\.)*"+("[a-zA-Z]+((\\-)*["+pd+"])*")+"\\.?$","g"),ci="tel:",$i=";phone-context=";function li(t,e){var n,r=e.extractFormattedPhoneNumber,d=function(t){var e=t.indexOf($i);if(e<0)return null;var n=e+15;if(n>=t.length)return"";var r=t.indexOf(";",n);return r>=0?t.substring(n,r):t.substring(n)}(t);if(!function(t){return null===t||0!==t.length&&(ai.test(t)||ui.test(t))}(d))throw new ti("NOT_A_NUMBER");if(null===d)n=r(t)||"";else{n="","+"===d.charAt(0)&&(n+=d);var i,o=t.indexOf(ci);i=o>=0?o+4:0;var s=t.indexOf($i);n+=t.substring(i,s)}var a=n.indexOf(";isub=");if(a>0&&(n=n.substring(0,a)),""!==n)return n}var fi=new RegExp("[++"+pd+"]"),hi=new RegExp("[^"+pd+"#]+$");function yi(t,e,n){if(e=e||{},n=new Xr(n),e.defaultCountry&&!n.hasCountry(e.defaultCountry)){if(e.v2)throw new ti("INVALID_COUNTRY");throw new Error("Unknown country: ".concat(e.defaultCountry))}var r=function(t,e,n){var r=li(t,{extractFormattedPhoneNumber:function(t){return function(t,e,n){if(!t)return;if(t.length>250){if(n)throw new ti("TOO_LONG");return}if(!1===e)return t;var r=t.search(fi);if(r<0)return;return t.slice(r).replace(hi,"")}(t,n,e)}});if(!r)return{};if(!function(t){return t.length>=2&&Rd.test(t)}(r))return function(t){return kd.test(t)}(r)?{error:"TOO_SHORT"}:{};var d=function(t){var e=t.search(ei);if(e<0)return{};for(var n=t.slice(0,e),r=t.match(ei),d=1;d<r.length;){if(r[d])return{number:n,ext:r[d]};d++}}(r);if(d.ext)return d;return{number:r}}(t,e.v2,e.extract),d=r.number,i=r.ext,o=r.error;if(!d){if(e.v2){if("TOO_SHORT"===o)throw new ti("TOO_SHORT");throw new ti("NOT_A_NUMBER")}return{}}var s=function(t,e,n,r){var d,i=Pd(ii(t),void 0,e,n,r.metadata),o=i.countryCallingCodeSource,s=i.countryCallingCode,a=i.number;if(s)r.selectNumberingPlan(s);else{if(!a||!e&&!n)return{};r.selectNumberingPlan(e,n),e&&(d=e),s=n||od(e,r.metadata)}if(!a)return{countryCallingCodeSource:o,countryCallingCode:s};var u=Od(ii(a),d,r),c=u.nationalNumber,$=u.carrierCode,l=Ed(s,{nationalNumber:c,metadata:r});l&&(d=l,"001"===l||r.selectNumberingPlan(d));return{country:d,countryCallingCode:s,countryCallingCodeSource:o,nationalNumber:c,carrierCode:$}}(d,e.defaultCountry,e.defaultCallingCode,n),a=s.country,u=s.nationalNumber,c=s.countryCallingCode,$=s.countryCallingCodeSource,l=s.carrierCode;if(!n.hasSelectedNumberingPlan()){if(e.v2)throw new ti("INVALID_COUNTRY");return{}}if(!u||u.length<2){if(e.v2)throw new ti("TOO_SHORT");return{}}if(u.length>17){if(e.v2)throw new ti("TOO_LONG");return{}}if(e.v2){var f=new Vd(c,u,n.metadata);return a&&(f.country=a),l&&(f.carrierCode=l),i&&(f.ext=i),f.__countryCallingCodeSource=$,f}var h=!!(e.extended?n.hasSelectedNumberingPlan():a)&&cd(u,n.nationalNumberPattern());return e.extended?{country:a,countryCallingCode:c,carrierCode:l,valid:h,possible:!!h||!(!0!==e.extended||!n.possibleLengths()||!ud(u,a,n)),phone:u,ext:i}:h?function(t,e,n){var r={country:t,phone:e};n&&(r.ext=n);return r}(a,u,i):{}}function gi(t){return gi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gi(t)}function pi(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function mi(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?pi(Object(n),!0).forEach(function(e){bi(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):pi(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function bi(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=gi(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!=gi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==gi(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function wi(t,e,n){return yi(t,mi(mi({},e),{},{v2:!0}),n)}function vi(t){return vi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vi(t)}function Ei(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function Oi(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=vi(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!=vi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==vi(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Pi(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,d,i,o,s=[],a=!0,u=!1;try{if(i=(n=n.call(t)).next,0===e);else for(;!(a=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);a=!0);}catch(t){u=!0,d=t}finally{try{if(!a&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw d}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Si(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Si(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Si(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Ni(t){var e,n,r,d=Pi(Array.prototype.slice.call(t),4),i=d[0],o=d[1],s=d[2],a=d[3];if("string"!=typeof i)throw new TypeError("A text for parsing must be a string.");if(e=i,o&&"string"!=typeof o){if(!Vr(o))throw new Error("Invalid second argument: ".concat(o));s?(n=o,r=s):r=o}else a?(n=s,r=a):(n=void 0,r=s),o&&(n=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ei(Object(n),!0).forEach(function(e){Oi(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ei(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({defaultCountry:o},n));return{text:e,options:n,metadata:r}}function Ci(){var t=Ni(arguments);return wi(t.text,t.options,t.metadata)}function Ai(t){return Ai="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ai(t)}function Ii(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function xi(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ii(Object(n),!0).forEach(function(e){Ti(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ii(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function Ti(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=Ai(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!=Ai(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ai(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ki(t){return ki="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ki(t)}function Bi(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function Ri(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Bi(Object(n),!0).forEach(function(e){Mi(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Bi(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function Mi(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=ki(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!=ki(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ki(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _i(){var t=Ni(arguments),e=t.text,n=t.options,r=t.metadata,d=function(t,e,n){e&&e.defaultCountry&&!function(t,e){return e.countries.hasOwnProperty(t)}(e.defaultCountry,n)&&(e=xi(xi({},e),{},{defaultCountry:void 0}));try{return wi(t,e,n)}catch(t){if(!(t instanceof ti))throw t}}(e,n=Ri(Ri({},n),{},{extract:!1}),r);return d&&d.isValid()||!1}function Li(){return Kr(Ci,arguments)}function Ui(){return Kr(_i,arguments)}async function Fi(){if(void 0!==globalThis.crypto?.subtle)return globalThis.crypto;return(await import("crypto")).webcrypto}const Di=3,ji=20,Ki="US";function Hi(t){const e=(new TextEncoder).encode(t);return l(He(e))}function Gi(t){if(t.startsWith("+"))return!0;const e=t.replace(/\D/g,"").length;if(e<7)return!1;return e/t.replace(/[\s\-().]/g,"").length>.5}function Vi(t,e){try{if(Ui(t,e)){return Li(t,e).format("E.164")}if(Ui(t)){return Li(t).format("E.164")}return null}catch{return null}}function qi(t,e=Ki){const n=t.trim();if(Gi(n)){const t=Vi(n,e);if(t)return t}let r=n.toLowerCase();return r.endsWith("@unicity")&&(r=r.slice(0,-8)),r}function Zi(t,e=Ki){return Hi("unicity:nametag:"+qi(t,e))}function Wi(t,e,n=Ki){return qi(t,n)===qi(e,n)}function Ji(t,e=Ki){const n=t.trim();if(Gi(n)){const t=Vi(n,e);if(t){const e=t.slice(1);if(e.length>6){return"+"+e.slice(0,4)+"***"+e.slice(-4)}}}return qi(t,e)}function Yi(t,e=Ki){try{return Ui(t,e)||Ui(t)}catch{return!1}}function zi(t,e=Ki){const n=qi(t.startsWith("@")?t.slice(1):t,e);if(Yi(n))return!0;return new RegExp("^[a-z0-9_-]{3,20}$").test(n)}function Xi(t){return Hi("unicity:address:"+t)}function Qi(t){const e=function(t){const e=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2)e[n/2]=parseInt(t.substring(n,n+2),16);return e}(t),n=(new TextEncoder).encode("sphere-nametag-salt"),r=He(n),d=(new TextEncoder).encode("nametag-encryption");return Un(He,e,r,d,32)}async function to(t,e){const n=await Fi(),r=Qi(e),d=n.getRandomValues(new Uint8Array(12)),i=(new TextEncoder).encode(t),o=await n.subtle.importKey("raw",new Uint8Array(r).buffer,{name:"AES-GCM"},!1,["encrypt"]),s=await n.subtle.encrypt({name:"AES-GCM",iv:new Uint8Array(d).buffer},o,new Uint8Array(i).buffer),a=new Uint8Array(d.length+s.byteLength);return a.set(d,0),a.set(new Uint8Array(s),d.length),u=a,"undefined"!=typeof Buffer?Buffer.from(u).toString("base64"):btoa(String.fromCharCode(...Array.from(u)));var u}async function eo(t,e){try{const r=await Fi(),d=Qi(e),i=(n=t,"undefined"!=typeof Buffer?new Uint8Array(Buffer.from(n,"base64")):Uint8Array.from(atob(n),t=>t.charCodeAt(0))),o=i.slice(0,12),s=i.slice(12),a=await r.subtle.importKey("raw",new Uint8Array(d).buffer,{name:"AES-GCM"},!1,["decrypt"]),u=await r.subtle.decrypt({name:"AES-GCM",iv:new Uint8Array(o).buffer},a,new Uint8Array(s).buffer);return(new TextDecoder).decode(u)}catch{return null}var n}var no=Object.freeze({__proto__:null,NAMETAG_MAX_LENGTH:20,NAMETAG_MIN_LENGTH:3,areSameNametag:Wi,decryptNametag:eo,encryptNametag:to,formatForDisplay:Ji,hashAddressForTag:Xi,hashNametag:Zi,isPhoneNumber:Yi,isValidNametag:zi,normalizeNametag:qi,sha256Hex:Hi});async function ro(t,e,n,r="US",d){if(!zi(e,r))throw new Error(`Invalid nametag: "${e}". Must be 3-20 chars [a-z0-9_-] or a valid phone number.`);const i=Zi(e,r),o={nametag_hash:i,address:n,verified:Math.floor(Date.now()/1e3)},s=[["d",i],["nametag",i],["t",i],["address",n],["t",Xi(n)]];if(d){const n=await to(e,t.getPrivateKeyHex());o.encrypted_nametag=n,o.nametag=e,d.publicKey&&(o.public_key=d.publicKey,s.push(["t",Xi(d.publicKey)]),s.push(["pubkey",d.publicKey])),d.l1Address&&(o.l1_address=d.l1Address,s.push(["t",Xi(d.l1Address)]),s.push(["l1",d.l1Address])),d.directAddress&&(o.direct_address=d.directAddress,s.push(["t",Xi(d.directAddress)])),d.proxyAddress&&(o.proxy_address=d.proxyAddress,s.push(["t",Xi(d.proxyAddress)]))}return Xn.create(t,{kind:hr,tags:s,content:JSON.stringify(o)})}function io(t,e){const n={},r=[["d",Hi("unicity:identity:"+t.getPublicKeyHex())]];return e.publicKey&&(n.public_key=e.publicKey,r.push(["t",Xi(e.publicKey)])),e.l1Address&&(n.l1_address=e.l1Address,r.push(["t",Xi(e.l1Address)])),e.directAddress&&(n.direct_address=e.directAddress,r.push(["t",Xi(e.directAddress)])),e.proxyAddress&&(n.proxy_address=e.proxyAddress,r.push(["t",Xi(e.proxyAddress)])),Xn.create(t,{kind:hr,tags:r,content:JSON.stringify(n)})}function oo(t,e="US"){const n=Zi(t,e);return Qn.builder().kinds(hr).tTags(n).build()}function so(t){const e=Xi(t);return Qn.builder().kinds(hr).tTags(e).build()}function ao(t){return Qn.builder().kinds(hr).authors(t).limit(10).build()}function uo(t){try{const e=JSON.parse(t.content);return{transportPubkey:t.pubkey,publicKey:e.public_key,l1Address:e.l1_address,directAddress:e.direct_address,proxyAddress:e.proxy_address,nametag:e.nametag,timestamp:1e3*t.created_at}}catch(e){return"undefined"!=typeof console&&console.warn(`[nostr-sdk] Failed to parse binding event content (event ${t.id?.slice(0,8)}):`,e),{transportPubkey:t.pubkey,timestamp:1e3*t.created_at}}}function co(t){const e=t.getTagValue("nametag");if(e)return e;const n=t.getTagValue("d");if(n)return n;try{return JSON.parse(t.content).nametag_hash}catch{return}}function $o(t){const e=t.getTagValue("address");if(e)return e;try{return JSON.parse(t.content).address}catch{return}}function lo(t){if(t.kind!==hr)return!1;if(!t.hasTag("d"))return!1;try{const e=JSON.parse(t.content);if(!e.nametag_hash||!e.address)return!1}catch{return!1}return t.verify()}var fo=Object.freeze({__proto__:null,createAddressToBindingFilter:so,createBindingEvent:ro,createIdentityBindingEvent:io,createNametagToPubkeyFilter:oo,createPubkeyToNametagFilter:ao,isValidBindingEvent:lo,parseAddressFromEvent:$o,parseBindingInfo:uo,parseNametagHashFromEvent:co});class ho{keyManager;relays=new Map;subscriptions=new Map;eventQueue=[];pendingOks=new Map;subscriptionCounter=0;closed=!1;queryTimeoutMs;autoReconnect;reconnectIntervalMs;maxReconnectIntervalMs;pingIntervalMs;connectionListeners=[];constructor(t,e){this.keyManager=t,this.queryTimeoutMs=e?.queryTimeoutMs??5e3,this.autoReconnect=e?.autoReconnect??!0,this.reconnectIntervalMs=e?.reconnectIntervalMs??1e3,this.maxReconnectIntervalMs=e?.maxReconnectIntervalMs??3e4,this.pingIntervalMs=e?.pingIntervalMs??3e4}addConnectionListener(t){this.connectionListeners.push(t)}removeConnectionListener(t){const e=this.connectionListeners.indexOf(t);-1!==e&&this.connectionListeners.splice(e,1)}emitConnectionEvent(t,e,n){for(const r of this.connectionListeners)try{switch(t){case"connect":r.onConnect?.(e);break;case"disconnect":r.onDisconnect?.(e,n);break;case"reconnecting":r.onReconnecting?.(e,n);break;case"reconnected":r.onReconnected?.(e)}}catch{}}getKeyManager(){return this.keyManager}getQueryTimeout(){return this.queryTimeoutMs}setQueryTimeout(t){this.queryTimeoutMs=t}async connect(...t){if(this.closed)throw new Error("Client has been disconnected");const e=t.map(t=>this.connectToRelay(t));await Promise.all(e)}async connectToRelay(t,e=!1){const n=this.relays.get(t);if(!n?.connected)return new Promise((r,d)=>{const i=setTimeout(()=>{d(new Error(`Connection to ${t} timed out`))},3e4);xr(t).then(o=>{const s={url:t,socket:o,connected:!1,reconnecting:!1,reconnectAttempts:0,reconnectTimer:null,pingTimer:null,lastPongTime:Date.now(),wasConnected:n?.wasConnected??!1};o.onopen=()=>{clearTimeout(i),s.connected=!0,s.reconnectAttempts=0,s.lastPongTime=Date.now(),this.relays.set(t,s),e&&s.wasConnected?this.emitConnectionEvent("reconnected",t):this.emitConnectionEvent("connect",t),s.wasConnected=!0,this.startPingTimer(t),this.resubscribeAll(t),this.flushEventQueue(),r()},o.onmessage=e=>{try{const n=Tr(e),r=this.relays.get(t);r&&(r.lastPongTime=Date.now()),this.handleRelayMessage(t,n)}catch(e){console.error(`Error handling message from ${t}:`,e)}},o.onclose=e=>{const n=s.connected;if(s.connected=!1,this.stopPingTimer(t),n){const n=e?.reason||"Connection closed";this.emitConnectionEvent("disconnect",t,n)}this.closed||!this.autoReconnect||s.reconnecting||this.scheduleReconnect(t)},o.onerror=e=>{s.connected||(clearTimeout(i),d(new Error(`Failed to connect to ${t}: ${e.message||"Unknown error"}`)))},this.relays.set(t,s)}).catch(t=>{clearTimeout(i),d(t)})})}scheduleReconnect(t){const e=this.relays.get(t);if(!e||this.closed||!this.autoReconnect)return;e.reconnectTimer&&clearTimeout(e.reconnectTimer),e.reconnecting=!0,e.reconnectAttempts++;const n=this.reconnectIntervalMs*Math.pow(2,e.reconnectAttempts-1),r=Math.min(n,this.maxReconnectIntervalMs);this.emitConnectionEvent("reconnecting",t,e.reconnectAttempts),e.reconnectTimer=setTimeout(async()=>{if(!this.closed){e.reconnectTimer=null;try{e.reconnecting=!1,await this.connectToRelay(t,!0)}catch{!this.closed&&this.autoReconnect&&this.scheduleReconnect(t)}}},r)}startPingTimer(t){if(this.pingIntervalMs<=0)return;const e=this.relays.get(t);e&&(this.stopPingTimer(t),e.pingTimer=setInterval(()=>{if(!e.connected||!e.socket)return void this.stopPingTimer(t);const n=Date.now()-e.lastPongTime;if(n>2*this.pingIntervalMs){console.warn(`Relay ${t} appears stale (no response for ${n}ms), reconnecting...`),this.stopPingTimer(t);try{e.socket.close()}catch{}}else try{const t="ping",n=JSON.stringify(["CLOSE",t]);e.socket.send(n);const r=JSON.stringify(["REQ",t,{limit:1}]);e.socket.send(r)}catch{console.warn(`Ping to ${t} failed, reconnecting...`),this.stopPingTimer(t);try{e.socket.close()}catch{}}},this.pingIntervalMs))}stopPingTimer(t){const e=this.relays.get(t);e?.pingTimer&&(clearInterval(e.pingTimer),e.pingTimer=null)}resubscribeAll(t){const e=this.relays.get(t);if(e?.socket&&e.connected)for(const[t,n]of this.subscriptions){const r=JSON.stringify(["REQ",t,n.filter.toJSON()]);e.socket.send(r)}}flushEventQueue(){const t=[...this.eventQueue];this.eventQueue=[];for(const e of t)this.broadcastEvent(e.event).then(()=>e.resolve(e.event.id)).catch(e.reject)}handleRelayMessage(t,e){try{const n=JSON.parse(e);if(!Array.isArray(n)||n.length<2)return;switch(n[0]){case"EVENT":this.handleEventMessage(n);break;case"OK":this.handleOkMessage(n);break;case"EOSE":this.handleEOSEMessage(n);break;case"NOTICE":this.handleNoticeMessage(n);break;case"CLOSED":this.handleClosedMessage(n);break;case"AUTH":this.handleAuthMessage(t,n)}}catch{}}handleEventMessage(t){if(t.length<3)return;const e=t[1],n=t[2],r=this.subscriptions.get(e);if(r)try{const t=Xn.fromJSON(n);r.listener.onEvent(t)}catch{}}handleOkMessage(t){if(t.length<4)return;const e=t[1],n=t[2],r=t[3],d=this.pendingOks.get(e);d&&(clearTimeout(d.timer),this.pendingOks.delete(e),n?d.resolve(e):d.reject(new Error(`Event rejected: ${r}`)))}handleEOSEMessage(t){if(t.length<2)return;const e=t[1],n=this.subscriptions.get(e);n?.listener.onEndOfStoredEvents&&n.listener.onEndOfStoredEvents(e)}handleNoticeMessage(t){if(t.length<2)return;const e=t[1];console.warn("Relay notice:",e)}handleClosedMessage(t){if(t.length<3)return;const e=t[1],n=t[2],r=this.subscriptions.get(e);r?.listener.onError&&r.listener.onError(e,`Subscription closed: ${n}`)}handleAuthMessage(t,e){if(e.length<2)return;const n=e[1],r=this.relays.get(t);if(!r?.socket||!r.connected)return;const d=Xn.create(this.keyManager,{kind:fr,tags:[["relay",t],["challenge",n]],content:""}),i=JSON.stringify(["AUTH",d.toJSON()]);r.socket.send(i),setTimeout(()=>{this.resubscribeAll(t)},100)}disconnect(){this.closed=!0;for(const[,t]of this.pendingOks)clearTimeout(t.timer),t.reject(new Error("Client disconnected"));this.pendingOks.clear();for(const t of this.eventQueue)t.reject(new Error("Client disconnected"));this.eventQueue=[];for(const[t,e]of this.relays)e.pingTimer&&(clearInterval(e.pingTimer),e.pingTimer=null),e.reconnectTimer&&(clearTimeout(e.reconnectTimer),e.reconnectTimer=null),e.socket&&3!==e.socket.readyState&&e.socket.close(1e3,"Client disconnected"),this.emitConnectionEvent("disconnect",t,"Client disconnected");this.relays.clear(),this.subscriptions.clear()}isConnected(){for(const[,t]of this.relays)if(t.connected)return!0;return!1}getConnectedRelays(){const t=new Set;for(const[e,n]of this.relays)n.connected&&t.add(e);return t}async publishEvent(t){if(this.closed)throw new Error("Client has been disconnected");return this.isConnected()?this.broadcastEvent(t):new Promise((e,n)=>{this.eventQueue.push({event:t,timestamp:Date.now(),resolve:e,reject:n})})}async broadcastEvent(t){const e=JSON.stringify(["EVENT",t.toJSON()]);let n=!1;for(const[,t]of this.relays)t.connected&&1===t.socket?.readyState&&(t.socket.send(e),n=!0);if(!n)throw new Error("No connected relays");return new Promise((e,n)=>{const r=setTimeout(()=>{this.pendingOks.delete(t.id),e(t.id)},5e3);this.pendingOks.set(t.id,{resolve:e,reject:n,timer:r})})}async publishEncryptedMessage(t,e){const n=await this.keyManager.encryptHex(e,t),r=Xn.create(this.keyManager,{kind:4,tags:[["p",t]],content:n});return this.publishEvent(r)}async sendTokenTransfer(t,e,n){const r=await Promise.resolve().then(function(){return po}),d=await r.createTokenTransferEvent(this.keyManager,t,e,n);return this.publishEvent(d)}async sendPaymentRequest(t,e){const n=await Promise.resolve().then(function(){return Eo}),r=await n.createPaymentRequestEvent(this.keyManager,t,e);return this.publishEvent(r)}async sendPaymentRequestResponse(t,e){const n=await Promise.resolve().then(function(){return Eo}),r=await n.createPaymentRequestResponseEvent(this.keyManager,t,{requestId:e.requestId,originalEventId:e.originalEventId,status:"DECLINED"===e.status?n.ResponseStatus.DECLINED:n.ResponseStatus.EXPIRED,reason:e.reason});return this.publishEvent(r)}async sendPaymentRequestDecline(t,e,n,r){return this.sendPaymentRequestResponse(t,{requestId:n,originalEventId:e,status:"DECLINED",reason:r})}async publishNametagBinding(t,e,n){const r=await this.queryPubkeyByNametag(t);if(r&&r!==this.keyManager.getPublicKeyHex())throw new Error(`Nametag "${t}" is already claimed by another pubkey`);const d=await ro(this.keyManager,t,e,void 0,n);try{return await this.publishEvent(d),!0}catch{return!1}}async publishIdentityBinding(t){const e=io(this.keyManager,t);try{return await this.publishEvent(e),!0}catch{return!1}}subscribe(t,e,n){let r,d,i;"string"==typeof t?(r=t,d=e,i=n):(r="sub_"+ ++this.subscriptionCounter,d=t,i=e),this.subscriptions.set(r,{filter:d,listener:i});const o=JSON.stringify(["REQ",r,d.toJSON()]);for(const[,t]of this.relays)t.connected&&1===t.socket?.readyState&&t.socket.send(o);return r}unsubscribe(t){if(!this.subscriptions.has(t))return;this.subscriptions.delete(t);const e=JSON.stringify(["CLOSE",t]);for(const[,t]of this.relays)t.connected&&1===t.socket?.readyState&&t.socket.send(e)}queryWithFirstSeenWins(t,e){return new Promise(n=>{let r="";const d=setTimeout(()=>{r&&this.unsubscribe(r),n(null)},this.queryTimeoutMs),i=new Map;r=this.subscribe(t,{onEvent:t=>{if(!t.verify())return;const e=i.get(t.pubkey);e?(t.created_at<e.firstSeen&&(e.firstSeen=t.created_at),t.created_at>e.latestEvent.created_at&&(e.latestEvent=t)):i.set(t.pubkey,{firstSeen:t.created_at,latestEvent:t})},onEndOfStoredEvents:()=>{clearTimeout(d),this.unsubscribe(r);let t=null,o="";for(const[e,n]of i)(!t||n.firstSeen<t.firstSeen||n.firstSeen===t.firstSeen&&e<o)&&(t=n,o=e);n(t?e(t.latestEvent):null)}})})}async queryPubkeyByNametag(t){return this.queryWithFirstSeenWins(oo(t),t=>t.pubkey)}async queryBindingByNametag(t){return this.queryWithFirstSeenWins(oo(t),uo)}async queryBindingByAddress(t){return this.queryWithFirstSeenWins(so(t),uo)}async createAndPublishEvent(t){const e=Xn.create(this.keyManager,t);return this.publishEvent(e)}async sendPrivateMessage(t,e,n){const r=Br(this.keyManager,t,e,n);return this.publishEvent(r)}async sendPrivateMessageToNametag(t,e,n){const r=await this.queryPubkeyByNametag(t);if(!r)throw new Error(`Nametag not found: ${t}`);return this.sendPrivateMessage(r,e,n)}async sendReadReceipt(t,e){const n=Rr(this.keyManager,t,e);return this.publishEvent(n)}unwrapPrivateMessage(t){return Mr(t,this.keyManager)}}class yo{eventCallback;eoseCallback;errorCallback;constructor(t,e,n){this.eventCallback=t,this.eoseCallback=e,this.errorCallback=n}onEvent(t){this.eventCallback(t)}onEndOfStoredEvents(t){this.eoseCallback?.(t)}onError(t,e){this.errorCallback?.(t,e)}}const go="token_transfer:";var po=Object.freeze({__proto__:null,createTokenTransferEvent:async function(t,e,n,r,d){let i,o,s;void 0!==r&&"object"==typeof r?(i=r.amount,o=r.symbol,s=r.replyToEventId):(i=r,o=d);const a=go+n,u=await t.encryptHex(a,e),c=[["p",e],["type","token_transfer"]];return void 0!==i&&c.push(["amount",String(i)]),void 0!==o&&c.push(["symbol",o]),void 0!==s&&s.length>0&&c.push(["e",s,"","reply"]),Xn.create(t,{kind:pr,tags:c,content:u})},getAmount:function(t){const e=t.getTagValue("amount");if(void 0!==e)try{return BigInt(e)}catch{return}},getRecipient:function(t){return t.getTagValue("p")},getReplyToEventId:function(t){return t.getTagValue("e")},getSender:function(t){return t.pubkey},getSymbol:function(t){return t.getTagValue("symbol")},isTokenTransfer:function(t){return t.kind===pr&&"token_transfer"===t.getTagValue("type")},parseTokenTransfer:async function(t,e){if(t.kind!==pr)throw new Error("Event is not a token transfer");if("token_transfer"!==t.getTagValue("type"))throw new Error("Event type is not token_transfer");let n,r;if(e.isMyPublicKey(t.pubkey)){const e=t.getTagValue("p");if(!e)throw new Error("No recipient found in event");n=e}else n=t.pubkey;try{r=await e.decryptHex(t.content,n)}catch(e){try{const{hexToBytes:e}=await Promise.resolve().then(function(){return C});r=(new TextDecoder).decode(e(t.content))}catch{throw e}}if(!r.startsWith(go))throw new Error("Invalid token transfer format");return r.slice(15)}});const mo="payment_request:",bo="payment_request_response:",wo=3e5;var vo;!function(t){t.DECLINED="DECLINED",t.EXPIRED="EXPIRED"}(vo||(vo={}));var Eo=Object.freeze({__proto__:null,DEFAULT_DEADLINE_MS:wo,get ResponseStatus(){return vo},createPaymentRequestEvent:async function(t,e,n){const r=n.requestId||function(){const t=new Uint8Array(4);if("undefined"!=typeof crypto&&crypto.getRandomValues)crypto.getRandomValues(t);else for(let e=0;e<t.length;e++)t[e]=Math.floor(256*Math.random());return Array.from(t).map(t=>t.toString(16).padStart(2,"0")).join("")}(),d=null===n.deadline?null:void 0!==n.deadline?n.deadline:Date.now()+wo,i=JSON.stringify({amount:String(n.amount),coinId:n.coinId,message:n.message,recipientNametag:n.recipientNametag,requestId:r,deadline:d}),o=mo+i,s=await t.encryptHex(o,e),a=[["p",e],["type","payment_request"],["amount",String(n.amount)]];return n.recipientNametag&&a.push(["recipient",n.recipientNametag]),Xn.create(t,{kind:br,tags:a,content:s})},createPaymentRequestResponseEvent:async function(t,e,n){const r=JSON.stringify({requestId:n.requestId,originalEventId:n.originalEventId,status:n.status,reason:n.reason}),d=bo+r,i=await t.encryptHex(d,e),o=[["p",e],["type","payment_request_response"],["status",n.status]];return n.originalEventId&&o.push(["e",n.originalEventId,"","reply"]),Xn.create(t,{kind:wr,tags:o,content:i})},formatAmount:function(t,e=8){const n="bigint"==typeof t?t:BigInt(t),r=BigInt(10)**BigInt(e),d=n/r,i=n%r;return i===BigInt(0)?d.toString():`${d}.${i.toString().padStart(e,"0").replace(/0+$/,"")}`},getAmount:function(t){const e=t.getTagValue("amount");if(void 0!==e)try{return BigInt(e)}catch{return}},getOriginalEventId:function(t){return t.getTagValue("e")},getRecipientNametag:function(t){return t.getTagValue("recipient")},getRemainingTimeMs:function(t){if(null===t.deadline)return null;const e=t.deadline-Date.now();return e>0?e:0},getResponseStatus:function(t){return t.getTagValue("status")},getSender:function(t){return t.pubkey},getTarget:function(t){return t.getTagValue("p")},isExpired:function(t){return null!==t.deadline&&Date.now()>t.deadline},isPaymentRequest:function(t){return t.kind===br&&"payment_request"===t.getTagValue("type")},isPaymentRequestResponse:function(t){return t.kind===wr&&"payment_request_response"===t.getTagValue("type")},parseAmount:function(t,e=8){const n=BigInt(10)**BigInt(e),r=t.split("."),d=BigInt(r[0]||"0");if(1===r.length)return d*n;let i=r[1]||"0";return i.length<e?i=i.padEnd(e,"0"):i.length>e&&(i=i.slice(0,e)),d*n+BigInt(i)},parsePaymentRequest:async function(t,e){if(t.kind!==br)throw new Error("Event is not a payment request");if("payment_request"!==t.getTagValue("type"))throw new Error("Event type is not payment_request");let n;if(e.isMyPublicKey(t.pubkey)){const e=t.getTagValue("p");if(!e)throw new Error("No target found in event");n=e}else n=t.pubkey;const r=await e.decryptHex(t.content,n);if(!r.startsWith(mo))throw new Error("Invalid payment request format: missing prefix");const d=r.slice(16),i=JSON.parse(d);return{amount:BigInt(i.amount),coinId:i.coinId,message:i.message,recipientNametag:i.recipientNametag,requestId:i.requestId,senderPubkey:t.pubkey,timestamp:1e3*t.created_at,eventId:t.id,deadline:void 0!==i.deadline?i.deadline:null}},parsePaymentRequestResponse:async function(t,e){if(t.kind!==wr)throw new Error("Event is not a payment request response");let n;if(e.isMyPublicKey(t.pubkey)){const e=t.getTagValue("p");if(!e)throw new Error("No target found in event");n=e}else n=t.pubkey;const r=await e.decryptHex(t.content,n);if(!r.startsWith(bo))throw new Error("Invalid payment request response format: missing prefix");const d=r.slice(25),i=JSON.parse(d);return{requestId:i.requestId,originalEventId:i.originalEventId,status:i.status,reason:i.reason,senderPubkey:t.pubkey,eventId:t.id,timestamp:1e3*t.created_at}}});function Oo(t){return 14===t.kind}function Po(t){return 15===t.kind}export{gr as AGENT_LOCATION,yr as AGENT_PROFILE,hr as APP_DATA,fr as AUTH,F as Bech32,ar as CHAT_MESSAGE,Ir as CLOSED,Ar as CLOSING,Nr as CONNECTING,dr as CONTACTS,yo as CallbackEventListener,or as DELETION,ir as ENCRYPTED_DM,Xn as Event,Sr as EventKinds,mr as FILE_METADATA,Qn as Filter,tr as FilterBuilder,$r as GIFT_WRAP,ji as NAMETAG_MAX_LENGTH,Di as NAMETAG_MIN_LENGTH,Qe as NIP04,Dr as NIP17,Yn as NIP44,fo as NametagBinding,no as NametagUtils,ho as NostrClient,zn as NostrKeyManager,Cr as OPEN,br as PAYMENT_REQUEST,wr as PAYMENT_REQUEST_RESPONSE,er as PROFILE,Eo as PaymentRequestProtocol,cr as REACTION,ur as READ_RECEIPT,rr as RECOMMEND_RELAY,lr as RELAY_LIST,sr as SEAL,Ke as SchnorrSigner,nr as TEXT_NOTE,pr as TOKEN_TRANSFER,po as TokenTransferProtocol,Wi as areSameNametag,so as createAddressToBindingFilter,ro as createBindingEvent,Br as createGiftWrap,io as createIdentityBindingEvent,oo as createNametagToPubkeyFilter,ao as createPubkeyToNametagFilter,Rr as createReadReceipt,xr as createWebSocket,R as decode,_ as decodeNpub,U as decodeNsec,eo as decryptNametag,B as encode,M as encodeNpub,L as encodeNsec,to as encryptNametag,Tr as extractMessageData,Ji as formatForDisplay,Pr as getName,_e as getPublicKey,Le as getPublicKeyHex,Xi as hashAddressForTag,Zi as hashNametag,Oo as isChatMessage,Er as isEphemeral,Or as isParameterizedReplaceable,Yi as isPhoneNumber,Po as isReadReceipt,vr as isReplaceable,lo as isValidBindingEvent,zi as isValidNametag,qi as normalizeNametag,$o as parseAddressFromEvent,uo as parseBindingInfo,co as parseNametagHashFromEvent,Hi as sha256Hex,Ue as sign,Fe as signHex,Mr as unwrap,De as verify,je as verifyHex};
11
+ const ge={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},pe={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]},me=BigInt(0),be=BigInt(1),we=BigInt(2);const ve=Mt(ge.p,{sqrt:function(t){const e=ge.p,n=BigInt(3),r=BigInt(6),d=BigInt(11),i=BigInt(22),o=BigInt(23),s=BigInt(44),a=BigInt(88),u=t*t*t%e,c=u*u*t%e,$=St(c,n,e)*c%e,l=St($,n,e)*c%e,f=St(l,we,e)*u%e,h=St(f,d,e)*f%e,y=St(h,i,e)*h%e,g=St(y,s,e)*y%e,p=St(g,a,e)*g%e,m=St(p,s,e)*y%e,b=St(m,n,e)*c%e,w=St(b,o,e)*h%e,v=St(w,r,e)*u%e,E=St(v,we,e);if(!ve.eql(ve.sqr(E),t))throw new Error("Cannot find square root");return E}}),Ee=function(t,e){const n=e=>ye({...t,hash:e});return{...n(e),create:n}}({...ge,Fp:ve,lowS:!0,endo:pe},Z),Oe={};function Se(t,...e){let n=Oe[t];if(void 0===n){const e=Z(v(t));n=O(e,e),Oe[t]=n}return Z(O(n,...e))}const Pe=t=>t.toBytes(!0).slice(1),Ce=(()=>Ee.Point)(),Ne=t=>t%we===me;function Ae(t){const{Fn:e,BASE:n}=Ce,r=ue(e,t),d=n.multiply(r);return{scalar:Ne(d.y)?r:e.neg(r),bytes:Pe(d)}}function Ie(t){const e=ve;if(!e.isValidNot0(t))throw new Error("invalid x: Fail if x ≥ p");const n=e.create(t*t),r=e.create(n*t+BigInt(7));let d=e.sqrt(r);Ne(d)||(d=e.neg(d));const i=Ce.fromAffine({x:t,y:d});return i.assertValidity(),i}const xe=nt;function ke(...t){return Ce.Fn.create(xe(Se("BIP0340/challenge",...t)))}function Te(t){return Ae(t).bytes}function Be(t,e,n=C(32)){const{Fn:r}=Ce,d=ot("message",t),{bytes:i,scalar:o}=Ae(e),s=ot("auxRand",n,32),a=r.toBytes(o^xe(Se("BIP0340/aux",s))),u=Se("BIP0340/nonce",a,i,d),{bytes:c,scalar:$}=Ae(u),l=ke(c,i,d),f=new Uint8Array(64);if(f.set(c,0),f.set(r.toBytes(r.create($+l*o)),32),!Re(f,d,i))throw new Error("sign: Invalid signature produced");return f}function Re(t,e,n){const{Fn:r,BASE:d}=Ce,i=ot("signature",t,64),o=ot("message",e),s=ot("publicKey",n,32);try{const t=Ie(xe(s)),e=xe(i.subarray(0,32));if(!at(e,be,ge.p))return!1;const n=xe(i.subarray(32,64));if(!at(n,be,ge.n))return!1;const a=ke(r.toBytes(e),Pe(t),o),u=d.multiplyUnsafe(n).add(t.multiplyUnsafe(r.neg(a))),{x:c,y:$}=u.toAffine();return!(u.is0()||!Ne($)||c!==e)}catch(t){return!1}}const Me=(()=>{const t=(t=C(48))=>Ut(t,ge.n);return Ee.utils.randomSecretKey,{keygen:function(e){const n=t(e);return{secretKey:n,publicKey:Te(n)}},getPublicKey:Te,sign:Be,verify:Re,Point:Ce,utils:{randomSecretKey:t,randomPrivateKey:t,taggedHash:Se,lift_x:Ie,pointToBytes:Pe,numberToBytesBE:dt,bytesToNumberBE:nt,mod:Ot},lengths:{secretKey:32,publicKey:32,publicKeyHasPrefix:!1,signature:64,seed:48}}})();function _e(t){if(32!==t.length)throw new Error("Private key must be 32 bytes");return Me.getPublicKey(t)}function Le(t){return l(_e(w(t)))}function Ue(t,e){if(32!==t.length)throw new Error("Message must be 32 bytes");if(32!==e.length)throw new Error("Private key must be 32 bytes");return Me.sign(t,e)}function Fe(t,e){return l(Ue(t,e))}function De(t,e,n){if(64!==t.length)return!1;if(32!==e.length)return!1;if(32!==n.length)return!1;try{return Me.verify(t,e,n)}catch{return!1}}function Ke(t,e,n){try{const r=w(t);return De(r,e,w(n))}catch{return!1}}var je=Object.freeze({__proto__:null,getPublicKey:_e,getPublicKeyHex:Le,sign:Ue,signHex:Fe,verify:De,verifyHex:Ke});const He=Z;async function Ge(){if(void 0!==globalThis.crypto?.subtle)return globalThis.crypto;return(await import("crypto")).webcrypto}const Ve="gz:";function qe(t){if("undefined"!=typeof Buffer)return Buffer.from(t).toString("base64");let e="";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return btoa(e)}function Ze(t){if("undefined"!=typeof Buffer)return new Uint8Array(Buffer.from(t,"base64"));const e=atob(t),n=new Uint8Array(e.length);for(let t=0;t<e.length;t++)n[t]=e.charCodeAt(t);return n}function We(t){const e=new ArrayBuffer(t.length);return new Uint8Array(e).set(t),e}async function Je(t){return(await Ge()).subtle.importKey("raw",We(t),{name:"AES-CBC"},!1,["encrypt","decrypt"])}function Ye(t,e){if(32!==t.length)throw new Error("Private key must be 32 bytes");if(32!==e.length)throw new Error("Public key must be 32 bytes");const n=new Uint8Array(33);n[0]=2,n.set(e,1);const r=Ee.getSharedSecret(t,n).slice(1,33);return He(r)}async function ze(t,e,n){let r=(new TextEncoder).encode(t),d=!1,i=r;if(r.length>1024){const t=await async function(t){if("undefined"!=typeof process&&process.versions?.node){const{gzipSync:e}=await import("zlib");return new Uint8Array(e(Buffer.from(t)))}if("undefined"!=typeof CompressionStream){const e=new CompressionStream("gzip"),n=e.writable.getWriter();n.write(We(t)),n.close();const r=[],d=e.readable.getReader();for(;;){const{done:t,value:e}=await d.read();if(t)break;r.push(e)}const i=r.reduce((t,e)=>t+e.length,0),o=new Uint8Array(i);let s=0;for(const t of r)o.set(t,s),s+=t.length;return o}throw new Error("GZIP compression not supported in this environment")}(r);t.length<r.length&&(i=new Uint8Array(t),d=!0)}const o=Ye(e,n),s=C(16),a=await async function(t,e,n){const r=await Ge(),d=await Je(e),i=await r.subtle.encrypt({name:"AES-CBC",iv:We(n)},d,We(t));return new Uint8Array(i)}(i,o,s),u=qe(a),c=qe(s);return d?`${Ve}${u}?iv=${c}`:`${u}?iv=${c}`}async function Xe(t,e,n){let r=t,d=!1;r.startsWith(Ve)&&(r=r.slice(3),d=!0);const i=r.split("?iv=");if(2!==i.length)throw new Error("Invalid encrypted content format");const o=i[0],s=i[1],a=Ze(o),u=Ze(s);if(16!==u.length)throw new Error("Invalid IV length");const c=Ye(e,n);let $=await async function(t,e,n){const r=await Ge(),d=await Je(e),i=await r.subtle.decrypt({name:"AES-CBC",iv:We(n)},d,We(t));return new Uint8Array(i)}(a,c,u);d&&($=await async function(t){if("undefined"!=typeof process&&process.versions?.node){const{gunzipSync:e}=await import("zlib");return new Uint8Array(e(Buffer.from(t)))}if("undefined"!=typeof DecompressionStream){const e=new DecompressionStream("gzip"),n=e.writable.getWriter();n.write(We(t)),n.close();const r=[],d=e.readable.getReader();for(;;){const{done:t,value:e}=await d.read();if(t)break;r.push(e)}const i=r.reduce((t,e)=>t+e.length,0),o=new Uint8Array(i);let s=0;for(const t of r)o.set(t,s),s+=t.length;return o}throw new Error("GZIP decompression not supported in this environment")}($));return(new TextDecoder).decode($)}var Qe=Object.freeze({__proto__:null,decrypt:Xe,decryptHex:async function(t,e,n){return Xe(t,w(e),w(n))},deriveSharedSecret:Ye,deriveSharedSecretHex:function(t,e){return l(Ye(w(t),w(e)))},encrypt:ze,encryptHex:async function(t,e,n){return ze(t,w(e),w(n))}});
12
+ /*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */function tn(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&"Uint8Array"===t.constructor.name}function en(t){if("boolean"!=typeof t)throw new Error(`boolean expected, not ${t}`)}function nn(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function rn(t,...e){if(!tn(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function dn(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function on(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function sn(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}const an=(()=>68===new Uint8Array(new Uint32Array([287454020]).buffer)[0])();function un(t){if("string"==typeof t)t=function(t){if("string"!=typeof t)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(t))}(t);else{if(!tn(t))throw new Error("Uint8Array expected, got "+typeof t);t=hn(t)}return t}const cn=(t,e)=>{function n(n,...r){if(rn(n),!an)throw new Error("Non little-endian hardware is not yet supported");if(void 0!==t.nonceLength){const e=r[0];if(!e)throw new Error("nonce / iv required");t.varSizeNonce?rn(e):rn(e,t.nonceLength)}const d=t.tagLength;d&&void 0!==r[1]&&rn(r[1]);const i=e(n,...r),o=(t,e)=>{if(void 0!==e){if(2!==t)throw new Error("cipher output not supported");rn(e)}};let s=!1;return{encrypt(t,e){if(s)throw new Error("cannot encrypt() twice with same key + nonce");return s=!0,rn(t),o(i.encrypt.length,e),i.encrypt(t,e)},decrypt(t,e){if(rn(t),d&&t.length<d)throw new Error("invalid ciphertext length: smaller than tagLength="+d);return o(i.decrypt.length,e),i.decrypt(t,e)}}}return Object.assign(n,t),n};function $n(t,e,n=!0){if(void 0===e)return new Uint8Array(t);if(e.length!==t)throw new Error("invalid output length, expected "+t+", got: "+e.length);if(n&&e.byteOffset%4!=0)throw new Error("invalid output, must be aligned");return e}function ln(t,e,n,r){if("function"==typeof t.setBigUint64)return t.setBigUint64(e,n,r);const d=BigInt(32),i=BigInt(4294967295),o=Number(n>>d&i),s=Number(n&i);t.setUint32(e+4,o,r),t.setUint32(e+0,s,r)}function fn(t,e,n){en(n);const r=new Uint8Array(16),d=(i=r,new DataView(i.buffer,i.byteOffset,i.byteLength));var i;return ln(d,0,BigInt(e),n),ln(d,8,BigInt(t),n),r}function hn(t){return Uint8Array.from(t)}const yn=t=>Uint8Array.from(t.split("").map(t=>t.charCodeAt(0))),gn=yn("expand 16-byte k"),pn=yn("expand 32-byte k"),mn=on(gn),bn=on(pn);function wn(t,e){return t<<e|t>>>32-e}function vn(t){return t.byteOffset%4==0}const En=2**32-1,On=new Uint32Array;function Sn(t,e){const{allowShortKeys:n,extendNonceFn:r,counterLength:d,counterRight:i,rounds:o}=function(t,e){if(null==e||"object"!=typeof e)throw new Error("options must be defined");return Object.assign(t,e)}({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},e);if("function"!=typeof t)throw new Error("core must be a function");return nn(d),nn(o),en(i),en(n),(e,s,a,u,c=0)=>{rn(e),rn(s),rn(a);const $=a.length;if(void 0===u&&(u=new Uint8Array($)),rn(u),nn(c),c<0||c>=En)throw new Error("arx: counter overflow");if(u.length<$)throw new Error(`arx: output (${u.length}) is shorter than data (${$})`);const l=[];let f,h,y=e.length;if(32===y)l.push(f=hn(e)),h=bn;else{if(16!==y||!n)throw new Error(`arx: invalid 32-byte key, got length=${y}`);f=new Uint8Array(32),f.set(e),f.set(e,16),h=mn,l.push(f)}vn(s)||l.push(s=hn(s));const g=on(f);if(r){if(24!==s.length)throw new Error("arx: extended nonce must be 24 bytes");r(h,g,on(s.subarray(0,16)),g),s=s.subarray(16)}const p=16-d;if(p!==s.length)throw new Error(`arx: nonce must be ${p} or 16 bytes`);if(12!==p){const t=new Uint8Array(12);t.set(s,i?0:12-s.length),s=t,l.push(s)}const m=on(s);return function(t,e,n,r,d,i,o,s){const a=d.length,u=new Uint8Array(64),c=on(u),$=vn(d)&&vn(i),l=$?on(d):On,f=$?on(i):On;for(let h=0;h<a;o++){if(t(e,n,r,c,o,s),o>=En)throw new Error("arx: counter overflow");const y=Math.min(64,a-h);if($&&64===y){const t=h/4;if(h%4!=0)throw new Error("arx: invalid block position");for(let e,n=0;n<16;n++)e=t+n,f[e]=l[e]^c[n];h+=64;continue}for(let t,e=0;e<y;e++)t=h+e,i[t]=d[t]^u[e];h+=y}}(t,h,g,m,a,u,c,o),sn(...l),u}}const Pn=(t,e)=>255&t[e++]|(255&t[e++])<<8;class Cn{constructor(t){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,rn(t=un(t),32);const e=Pn(t,0),n=Pn(t,2),r=Pn(t,4),d=Pn(t,6),i=Pn(t,8),o=Pn(t,10),s=Pn(t,12),a=Pn(t,14);this.r[0]=8191&e,this.r[1]=8191&(e>>>13|n<<3),this.r[2]=7939&(n>>>10|r<<6),this.r[3]=8191&(r>>>7|d<<9),this.r[4]=255&(d>>>4|i<<12),this.r[5]=i>>>1&8190,this.r[6]=8191&(i>>>14|o<<2),this.r[7]=8065&(o>>>11|s<<5),this.r[8]=8191&(s>>>8|a<<8),this.r[9]=a>>>5&127;for(let e=0;e<8;e++)this.pad[e]=Pn(t,16+2*e)}process(t,e,n=!1){const r=n?0:2048,{h:d,r:i}=this,o=i[0],s=i[1],a=i[2],u=i[3],c=i[4],$=i[5],l=i[6],f=i[7],h=i[8],y=i[9],g=Pn(t,e+0),p=Pn(t,e+2),m=Pn(t,e+4),b=Pn(t,e+6),w=Pn(t,e+8),v=Pn(t,e+10),E=Pn(t,e+12),O=Pn(t,e+14);let S=d[0]+(8191&g),P=d[1]+(8191&(g>>>13|p<<3)),C=d[2]+(8191&(p>>>10|m<<6)),N=d[3]+(8191&(m>>>7|b<<9)),A=d[4]+(8191&(b>>>4|w<<12)),I=d[5]+(w>>>1&8191),x=d[6]+(8191&(w>>>14|v<<2)),k=d[7]+(8191&(v>>>11|E<<5)),T=d[8]+(8191&(E>>>8|O<<8)),B=d[9]+(O>>>5|r),R=0,M=R+S*o+P*(5*y)+C*(5*h)+N*(5*f)+A*(5*l);R=M>>>13,M&=8191,M+=I*(5*$)+x*(5*c)+k*(5*u)+T*(5*a)+B*(5*s),R+=M>>>13,M&=8191;let _=R+S*s+P*o+C*(5*y)+N*(5*h)+A*(5*f);R=_>>>13,_&=8191,_+=I*(5*l)+x*(5*$)+k*(5*c)+T*(5*u)+B*(5*a),R+=_>>>13,_&=8191;let L=R+S*a+P*s+C*o+N*(5*y)+A*(5*h);R=L>>>13,L&=8191,L+=I*(5*f)+x*(5*l)+k*(5*$)+T*(5*c)+B*(5*u),R+=L>>>13,L&=8191;let U=R+S*u+P*a+C*s+N*o+A*(5*y);R=U>>>13,U&=8191,U+=I*(5*h)+x*(5*f)+k*(5*l)+T*(5*$)+B*(5*c),R+=U>>>13,U&=8191;let F=R+S*c+P*u+C*a+N*s+A*o;R=F>>>13,F&=8191,F+=I*(5*y)+x*(5*h)+k*(5*f)+T*(5*l)+B*(5*$),R+=F>>>13,F&=8191;let D=R+S*$+P*c+C*u+N*a+A*s;R=D>>>13,D&=8191,D+=I*o+x*(5*y)+k*(5*h)+T*(5*f)+B*(5*l),R+=D>>>13,D&=8191;let K=R+S*l+P*$+C*c+N*u+A*a;R=K>>>13,K&=8191,K+=I*s+x*o+k*(5*y)+T*(5*h)+B*(5*f),R+=K>>>13,K&=8191;let j=R+S*f+P*l+C*$+N*c+A*u;R=j>>>13,j&=8191,j+=I*a+x*s+k*o+T*(5*y)+B*(5*h),R+=j>>>13,j&=8191;let H=R+S*h+P*f+C*l+N*$+A*c;R=H>>>13,H&=8191,H+=I*u+x*a+k*s+T*o+B*(5*y),R+=H>>>13,H&=8191;let G=R+S*y+P*h+C*f+N*l+A*$;R=G>>>13,G&=8191,G+=I*c+x*u+k*a+T*s+B*o,R+=G>>>13,G&=8191,R=(R<<2)+R|0,R=R+M|0,M=8191&R,R>>>=13,_+=R,d[0]=M,d[1]=_,d[2]=L,d[3]=U,d[4]=F,d[5]=D,d[6]=K,d[7]=j,d[8]=H,d[9]=G}finalize(){const{h:t,pad:e}=this,n=new Uint16Array(10);let r=t[1]>>>13;t[1]&=8191;for(let e=2;e<10;e++)t[e]+=r,r=t[e]>>>13,t[e]&=8191;t[0]+=5*r,r=t[0]>>>13,t[0]&=8191,t[1]+=r,r=t[1]>>>13,t[1]&=8191,t[2]+=r,n[0]=t[0]+5,r=n[0]>>>13,n[0]&=8191;for(let e=1;e<10;e++)n[e]=t[e]+r,r=n[e]>>>13,n[e]&=8191;n[9]-=8192;let d=(1^r)-1;for(let t=0;t<10;t++)n[t]&=d;d=~d;for(let e=0;e<10;e++)t[e]=t[e]&d|n[e];t[0]=65535&(t[0]|t[1]<<13),t[1]=65535&(t[1]>>>3|t[2]<<10),t[2]=65535&(t[2]>>>6|t[3]<<7),t[3]=65535&(t[3]>>>9|t[4]<<4),t[4]=65535&(t[4]>>>12|t[5]<<1|t[6]<<14),t[5]=65535&(t[6]>>>2|t[7]<<11),t[6]=65535&(t[7]>>>5|t[8]<<8),t[7]=65535&(t[8]>>>8|t[9]<<5);let i=t[0]+e[0];t[0]=65535&i;for(let n=1;n<8;n++)i=(t[n]+e[n]|0)+(i>>>16)|0,t[n]=65535&i;sn(n)}update(t){dn(this),rn(t=un(t));const{buffer:e,blockLen:n}=this,r=t.length;for(let d=0;d<r;){const i=Math.min(n-this.pos,r-d);if(i!==n)e.set(t.subarray(d,d+i),this.pos),this.pos+=i,d+=i,this.pos===n&&(this.process(e,0,!1),this.pos=0);else for(;n<=r-d;d+=n)this.process(t,d)}return this}destroy(){sn(this.h,this.r,this.buffer,this.pad)}digestInto(t){dn(this),function(t,e){rn(t);const n=e.outputLen;if(t.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}(t,this),this.finished=!0;const{buffer:e,h:n}=this;let{pos:r}=this;if(r){for(e[r++]=1;r<16;r++)e[r]=0;this.process(e,0,!0)}this.finalize();let d=0;for(let e=0;e<8;e++)t[d++]=n[e]>>>0,t[d++]=n[e]>>>8;return t}digest(){const{buffer:t,outputLen:e}=this;this.digestInto(t);const n=t.slice(0,e);return this.destroy(),n}}const Nn=function(t){const e=(e,n)=>t(n).update(un(e)).digest(),n=t(new Uint8Array(32));return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=e=>t(e),e}(t=>new Cn(t));function An(t,e,n,r,d,i=20){let o=t[0],s=t[1],a=t[2],u=t[3],c=e[0],$=e[1],l=e[2],f=e[3],h=e[4],y=e[5],g=e[6],p=e[7],m=d,b=n[0],w=n[1],v=n[2],E=o,O=s,S=a,P=u,C=c,N=$,A=l,I=f,x=h,k=y,T=g,B=p,R=m,M=b,_=w,L=v;for(let t=0;t<i;t+=2)E=E+C|0,R=wn(R^E,16),x=x+R|0,C=wn(C^x,12),E=E+C|0,R=wn(R^E,8),x=x+R|0,C=wn(C^x,7),O=O+N|0,M=wn(M^O,16),k=k+M|0,N=wn(N^k,12),O=O+N|0,M=wn(M^O,8),k=k+M|0,N=wn(N^k,7),S=S+A|0,_=wn(_^S,16),T=T+_|0,A=wn(A^T,12),S=S+A|0,_=wn(_^S,8),T=T+_|0,A=wn(A^T,7),P=P+I|0,L=wn(L^P,16),B=B+L|0,I=wn(I^B,12),P=P+I|0,L=wn(L^P,8),B=B+L|0,I=wn(I^B,7),E=E+N|0,L=wn(L^E,16),T=T+L|0,N=wn(N^T,12),E=E+N|0,L=wn(L^E,8),T=T+L|0,N=wn(N^T,7),O=O+A|0,R=wn(R^O,16),B=B+R|0,A=wn(A^B,12),O=O+A|0,R=wn(R^O,8),B=B+R|0,A=wn(A^B,7),S=S+I|0,M=wn(M^S,16),x=x+M|0,I=wn(I^x,12),S=S+I|0,M=wn(M^S,8),x=x+M|0,I=wn(I^x,7),P=P+C|0,_=wn(_^P,16),k=k+_|0,C=wn(C^k,12),P=P+C|0,_=wn(_^P,8),k=k+_|0,C=wn(C^k,7);let U=0;r[U++]=o+E|0,r[U++]=s+O|0,r[U++]=a+S|0,r[U++]=u+P|0,r[U++]=c+C|0,r[U++]=$+N|0,r[U++]=l+A|0,r[U++]=f+I|0,r[U++]=h+x|0,r[U++]=y+k|0,r[U++]=g+T|0,r[U++]=p+B|0,r[U++]=m+R|0,r[U++]=b+M|0,r[U++]=w+_|0,r[U++]=v+L|0}const In=Sn(An,{counterRight:!1,counterLength:4,allowShortKeys:!1}),xn=new Uint8Array(16),kn=(t,e)=>{t.update(e);const n=e.length%16;n&&t.update(xn.subarray(n))},Tn=new Uint8Array(32);function Bn(t,e,n,r,d){const i=t(e,n,Tn),o=Nn.create(i);d&&kn(o,d),kn(o,r);const s=fn(r.length,d?d.length:0,!0);o.update(s);const a=o.digest();return sn(i,s),a}const Rn=cn({blockSize:64,nonceLength:12,tagLength:16},(Mn=In,(t,e,n)=>{const r=16;return{encrypt(d,i){const o=d.length;(i=$n(o+r,i,!1)).set(d);const s=i.subarray(0,-16);Mn(t,e,s,s,1);const a=Bn(Mn,t,e,s,n);return i.set(a,o),sn(a),i},decrypt(d,i){i=$n(d.length-r,i,!1);const o=d.subarray(0,-16),s=d.subarray(-16),a=Bn(Mn,t,e,o,n);if(!function(t,e){if(t.length!==e.length)return!1;let n=0;for(let r=0;r<t.length;r++)n|=t[r]^e[r];return 0===n}(s,a))throw new Error("invalid tag");return i.set(d.subarray(0,-16)),Mn(t,e,i,i,1),sn(a),i}}}));var Mn;const _n=Uint8Array.from([0]),Ln=Uint8Array.of();const Un=(t,e,r,i,o)=>function(t,e,r,i=32){d(t),n(i);const o=t.outputLen;if(i>255*o)throw new Error("Length should be <= 255*HashLen");const a=Math.ceil(i/o);void 0===r&&(r=Ln);const u=new Uint8Array(a*o),c=J.create(t,e),$=c._cloneInto(),l=new Uint8Array(c.outputLen);for(let t=0;t<a;t++)_n[0]=t+1,$.update(0===t?Ln:l).update(r).update(_n).digestInto(l),u.set(l,o*t),c._cloneInto($);return c.destroy(),$.destroy(),s(l,_n),u.slice(0,i)}(t,function(t,e,n){return d(t),void 0===n&&(n=new Uint8Array(t.outputLen)),J(t,E(n),E(e))}(t,e,r),i,o),Fn=24,Dn=65535,Kn=(new TextEncoder).encode("nip44-v2");function jn(t,e){if(32!==t.length)throw new Error("Private key must be 32 bytes");if(32!==e.length)throw new Error("Public key must be 32 bytes");const n=function(t,e){const n=new Uint8Array(33);n[0]=2,n.set(e,1);const r=Ee.getSharedSecret(t,n);return r.slice(1,33)}(t,e),r=Ee.getPublicKey(t,!0).slice(1),d=function(t,e){const n=Math.min(t.length,e.length);for(let r=0;r<n;r++){const n=t[r]-e[r];if(0!==n)return n}return t.length-e.length}(i=r,o=e)<=0?O(i,o):O(o,i);var i,o;return Un(He,n,d,Kn,32)}function Hn(t){if(t<=0)throw new Error("Message too short");if(t>Dn)throw new Error("Message too long");if(t<=32)return 32;const e=1<<Math.ceil(Math.log2(t)),n=Math.max(32,e>>3);return Math.ceil(t/n)*n}function Gn(t){const e=t.length;if(e<1)throw new Error("Message too short");if(e>Dn)throw new Error("Message too long");const n=Hn(e),r=new Uint8Array(2+n);return r[0]=e>>8&255,r[1]=255&e,r.set(t,2),r}function Vn(t){if(t.length<34)throw new Error("Padded message too short");const e=t[0]<<8|t[1];if(e<1||e>Dn)throw new Error(`Invalid message length: ${e}`);const n=Hn(e);if(t.length!==2+n)throw new Error("Invalid padding");return t.slice(2,2+e)}function qn(t,e,n){return Zn(t,jn(e,n))}function Zn(t,e){const n=(new TextEncoder).encode(t);if(n.length>Dn)throw new Error("Message too long (max 65535 bytes)");const r=Gn(n),d=C(Fn),i=Un(He,e,d,new Uint8Array(0),76),o=i.slice(0,32),s=i.slice(32,44),a=Rn(o,s).encrypt(r),u=new Uint8Array(25+a.length);return u[0]=2,u.set(d,1),u.set(a,25),function(t){if("undefined"!=typeof Buffer)return Buffer.from(t).toString("base64");let e="";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return btoa(e)}(u)}function Wn(t,e,n){return Jn(t,jn(e,n))}function Jn(t,e){const n=function(t){if("undefined"!=typeof Buffer)return new Uint8Array(Buffer.from(t,"base64"));const e=atob(t),n=new Uint8Array(e.length);for(let t=0;t<e.length;t++)n[t]=e.charCodeAt(t);return n}(t);if(n.length<73)throw new Error("Payload too short");if(2!==n[0])throw new Error(`Unsupported NIP-44 version: ${n[0]}`);const r=n.slice(1,25),d=n.slice(25),i=Un(He,e,r,new Uint8Array(0),76),o=i.slice(0,32),s=i.slice(32,44),a=Vn(Rn(o,s).decrypt(d));return(new TextDecoder).decode(a)}var Yn=Object.freeze({__proto__:null,VERSION:2,calcPaddedLen:Hn,decrypt:Wn,decryptHex:function(t,e,n){return Wn(t,w(e),w(n))},decryptWithKey:Jn,deriveConversationKey:jn,deriveConversationKeyHex:function(t,e){return l(jn(w(t),w(e)))},encrypt:qn,encryptHex:function(t,e,n){return qn(t,w(e),w(n))},encryptWithKey:Zn,pad:Gn,unpad:Vn});class zn{privateKey;publicKey;cleared=!1;constructor(t){if(32!==t.length)throw new Error("Private key must be 32 bytes");this.privateKey=new Uint8Array(t),this.publicKey=_e(this.privateKey)}static fromPrivateKey(t){return new zn(t)}static fromPrivateKeyHex(t){const e=w(t);return new zn(e)}static fromNsec(t){const e=U(t);return new zn(e)}static generate(){const t=C(32);return new zn(t)}ensureNotCleared(){if(this.cleared)throw new Error("KeyManager has been cleared")}getPrivateKey(){return this.ensureNotCleared(),new Uint8Array(this.privateKey)}getPrivateKeyHex(){return this.ensureNotCleared(),l(this.privateKey)}getNsec(){return this.ensureNotCleared(),L(this.privateKey)}getPublicKey(){return this.ensureNotCleared(),new Uint8Array(this.publicKey)}getPublicKeyHex(){return this.ensureNotCleared(),l(this.publicKey)}getNpub(){return this.ensureNotCleared(),M(this.publicKey)}sign(t){return this.ensureNotCleared(),Ue(t,this.privateKey)}signHex(t){return this.ensureNotCleared(),Fe(t,this.privateKey)}static verify(t,e,n){return De(t,e,n)}static verifyHex(t,e,n){return Ke(t,e,n)}async encrypt(t,e){return this.ensureNotCleared(),ze(t,this.privateKey,e)}async encryptHex(t,e){this.ensureNotCleared();const n=w(e);return ze(t,this.privateKey,n)}async decrypt(t,e){return this.ensureNotCleared(),Xe(t,this.privateKey,e)}async decryptHex(t,e){this.ensureNotCleared();const n=w(e);return Xe(t,this.privateKey,n)}deriveSharedSecret(t){return this.ensureNotCleared(),Ye(this.privateKey,t)}encryptNip44(t,e){return this.ensureNotCleared(),qn(t,this.privateKey,e)}encryptNip44Hex(t,e){this.ensureNotCleared();const n=w(e);return qn(t,this.privateKey,n)}decryptNip44(t,e){return this.ensureNotCleared(),Wn(t,this.privateKey,e)}decryptNip44Hex(t,e){this.ensureNotCleared();const n=w(e);return Wn(t,this.privateKey,n)}deriveConversationKey(t){return this.ensureNotCleared(),jn(this.privateKey,t)}isMyPublicKey(t){return this.ensureNotCleared(),this.getPublicKeyHex()===t.toLowerCase()}clear(){this.privateKey.fill(0),this.cleared=!0}}class Xn{id;pubkey;created_at;kind;tags;content;sig;constructor(t){this.id=t.id,this.pubkey=t.pubkey,this.created_at=t.created_at,this.kind=t.kind,this.tags=t.tags,this.content=t.content,this.sig=t.sig}static create(t,e){const n=t.getPublicKeyHex(),r=e.created_at??Math.floor(Date.now()/1e3),d=Xn.calculateId(n,r,e.kind,e.tags,e.content),i=w(d),o=t.signHex(i);return new Xn({id:d,pubkey:n,created_at:r,kind:e.kind,tags:e.tags,content:e.content,sig:o})}static calculateId(t,e,n,r,d){const i=JSON.stringify([0,t,e,n,r,d]);return l(He((new TextEncoder).encode(i)))}verify(){try{if(Xn.calculateId(this.pubkey,this.created_at,this.kind,this.tags,this.content)!==this.id)return!1;const t=w(this.id),e=w(this.sig);return De(e,t,w(this.pubkey))}catch{return!1}}static fromJSON(t){const e="string"==typeof t?JSON.parse(t):t;if(!Xn.isValidEventData(e))throw new Error("Invalid event data");return new Xn(e)}static isValidEventData(t){if("object"!=typeof t||null===t)return!1;const e=t;return"string"==typeof e.id&&"string"==typeof e.pubkey&&"number"==typeof e.created_at&&"number"==typeof e.kind&&Array.isArray(e.tags)&&"string"==typeof e.content&&"string"==typeof e.sig}toJSON(){return{id:this.id,pubkey:this.pubkey,created_at:this.created_at,kind:this.kind,tags:this.tags,content:this.content,sig:this.sig}}getTagValue(t){const e=this.tags.find(e=>e[0]===t);return e?.[1]}getTagValues(t){return this.tags.filter(e=>e[0]===t).map(t=>t[1]??"")}hasTag(t){return this.tags.some(e=>e[0]===t)}getTagEntryValues(t){const e=this.tags.find(e=>e[0]===t);return e?e.slice(1):[]}}class Qn{ids;authors;kinds;"#e";"#p";"#t";"#d";"#h";since;until;limit;constructor(t){t&&(t.ids&&(this.ids=[...t.ids]),t.authors&&(this.authors=[...t.authors]),t.kinds&&(this.kinds=[...t.kinds]),t["#e"]&&(this["#e"]=[...t["#e"]]),t["#p"]&&(this["#p"]=[...t["#p"]]),t["#t"]&&(this["#t"]=[...t["#t"]]),t["#d"]&&(this["#d"]=[...t["#d"]]),t["#h"]&&(this["#h"]=[...t["#h"]]),void 0!==t.since&&(this.since=t.since),void 0!==t.until&&(this.until=t.until),void 0!==t.limit&&(this.limit=t.limit))}static builder(){return new tr}toJSON(){const t={};return this.ids&&this.ids.length>0&&(t.ids=this.ids),this.authors&&this.authors.length>0&&(t.authors=this.authors),this.kinds&&this.kinds.length>0&&(t.kinds=this.kinds),this["#e"]&&this["#e"].length>0&&(t["#e"]=this["#e"]),this["#p"]&&this["#p"].length>0&&(t["#p"]=this["#p"]),this["#t"]&&this["#t"].length>0&&(t["#t"]=this["#t"]),this["#d"]&&this["#d"].length>0&&(t["#d"]=this["#d"]),this["#h"]&&this["#h"].length>0&&(t["#h"]=this["#h"]),void 0!==this.since&&(t.since=this.since),void 0!==this.until&&(t.until=this.until),void 0!==this.limit&&(t.limit=this.limit),t}static fromJSON(t){const e="string"==typeof t?JSON.parse(t):t;return new Qn(e)}}class tr{data={};ids(t,...e){return Array.isArray(t)?this.data.ids=[...t]:this.data.ids=[t,...e],this}authors(t,...e){return Array.isArray(t)?this.data.authors=[...t]:this.data.authors=[t,...e],this}kinds(t,...e){return Array.isArray(t)?this.data.kinds=[...t]:this.data.kinds=[t,...e],this}eTags(t,...e){return Array.isArray(t)?this.data["#e"]=[...t]:this.data["#e"]=[t,...e],this}pTags(t,...e){return Array.isArray(t)?this.data["#p"]=[...t]:this.data["#p"]=[t,...e],this}tTags(t,...e){return Array.isArray(t)?this.data["#t"]=[...t]:this.data["#t"]=[t,...e],this}dTags(t,...e){return Array.isArray(t)?this.data["#d"]=[...t]:this.data["#d"]=[t,...e],this}hTags(t,...e){return Array.isArray(t)?this.data["#h"]=[...t]:this.data["#h"]=[t,...e],this}since(t){return this.data.since=t,this}until(t){return this.data.until=t,this}limit(t){return this.data.limit=t,this}build(){return new Qn(this.data)}}const er=0,nr=1,rr=2,dr=3,ir=4,or=5,sr=13,ar=14,ur=15,cr=7,$r=1059,lr=10002,fr=22242,hr=30078,yr=31111,gr=31112,pr=31113,mr=31114,br=31115,wr=31116;function vr(t){return 0===t||3===t||t>=1e4&&t<2e4}function Er(t){return t>=2e4&&t<3e4}function Or(t){return t>=3e4&&t<4e4}function Sr(t){switch(t){case 0:return"Profile";case 1:return"Text Note";case 2:return"Recommend Relay";case 3:return"Contacts";case 4:return"Encrypted DM";case 5:return"Deletion";case 13:return"Seal";case 14:return"Chat Message";case 15:return"Read Receipt";case 7:return"Reaction";case $r:return"Gift Wrap";case lr:return"Relay List";case hr:return"App Data";case yr:return"Agent Profile";case gr:return"Agent Location";case pr:return"Token Transfer";case mr:return"File Metadata";case br:return"Payment Request";case wr:return"Payment Request Response";default:return vr(t)?`Replaceable (${t})`:Er(t)?`Ephemeral (${t})`:Or(t)?`Parameterized Replaceable (${t})`:`Unknown (${t})`}}var Pr=Object.freeze({__proto__:null,AGENT_LOCATION:gr,AGENT_PROFILE:yr,APP_DATA:hr,AUTH:fr,CHAT_MESSAGE:14,CONTACTS:3,DELETION:5,ENCRYPTED_DM:4,FILE_METADATA:mr,GIFT_WRAP:$r,PAYMENT_REQUEST:br,PAYMENT_REQUEST_RESPONSE:wr,PROFILE:0,REACTION:7,READ_RECEIPT:15,RECOMMEND_RELAY:2,RELAY_LIST:lr,SEAL:13,TEXT_NOTE:1,TOKEN_TRANSFER:pr,getName:Sr,isEphemeral:Er,isParameterizedReplaceable:Or,isReplaceable:vr});const Cr=0,Nr=1,Ar=2,Ir=3;async function xr(t){if("undefined"==typeof WebSocket)throw new Error("WebSocket not available in this environment");return new WebSocket(t)}function kr(t){if("string"==typeof t.data)return t.data;if(t.data instanceof ArrayBuffer)return(new TextDecoder).decode(t.data);if("undefined"!=typeof Blob&&t.data instanceof Blob)throw new Error("Blob messages are not supported");return String(t.data)}const Tr=172800;function Br(t,e,n,r){const d=function(t,e,n,r,d){const i=[["p",e]];d&&i.push(["e",d,"","reply"]);const o=Math.floor(Date.now()/1e3),s={id:"",pubkey:t,created_at:o,kind:r,tags:i,content:n};return s.id=_r(s),s}(t.getPublicKeyHex(),e,n,14,r?.replyToEventId);return Ur(Lr(t,e,d),e)}function Rr(t,e,n){const r=[["p",e],["e",n]],d=Math.floor(Date.now()/1e3),i={id:"",pubkey:t.getPublicKeyHex(),created_at:d,kind:15,tags:r,content:""};i.id=_r(i);return Ur(Lr(t,e,i),e)}function Mr(t,e){if(t.kind!==$r)throw new Error(`Event is not a gift wrap (kind ${t.kind})`);const n=w(t.pubkey),r=Wn(t.content,e.getPrivateKey(),n),d=JSON.parse(r);if(13!==d.kind)throw new Error(`Inner event is not a seal (kind ${d.kind})`);const i=d.pubkey,o=w(d.id),s=w(d.sig),a=w(i);if(!De(s,o,a))throw new Error("Seal signature verification failed");const u=Wn(d.content,e.getPrivateKey(),a),c=JSON.parse(u),$=function(t,e){const n=t.find(t=>t[0]===e);return n?.[1]}(c.tags,"e");return{eventId:t.id,senderPubkey:i,recipientPubkey:e.getPublicKeyHex(),content:c.content,timestamp:c.created_at,kind:c.kind,replyToEventId:$}}function _r(t){const e=JSON.stringify([0,t.pubkey,t.created_at,t.kind,t.tags,t.content]);return l(He((new TextEncoder).encode(e)))}function Lr(t,e,n){const r=JSON.stringify(n),d=w(e),i=qn(r,t.getPrivateKey(),d),o=t.getPublicKeyHex(),s=Fr(),a=[],u=i,c=Xn.calculateId(o,s,13,a,u),$=w(c),l=t.signHex($);return new Xn({id:c,pubkey:o,created_at:s,kind:13,tags:a,content:u,sig:l})}function Ur(t,e){const n=zn.generate(),r=JSON.stringify(t.toJSON()),d=w(e),i=qn(r,n.getPrivateKey(),d),o=n.getPublicKeyHex(),s=Fr(),a=$r,u=[["p",e]],c=i,$=Xn.calculateId(o,s,a,u,c),l=w($),f=n.signHex(l);return n.clear(),new Xn({id:$,pubkey:o,created_at:s,kind:a,tags:u,content:c,sig:f})}function Fr(){return Math.floor(Date.now()/1e3)+(Math.floor(2*Math.random()*Tr)-Tr)}var Dr=Object.freeze({__proto__:null,createGiftWrap:Br,createReadReceipt:Rr,unwrap:Mr}),Kr={version:4,country_calling_codes:{1:["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"],7:["RU","KZ"],20:["EG"],27:["ZA"],30:["GR"],31:["NL"],32:["BE"],33:["FR"],34:["ES"],36:["HU"],39:["IT","VA"],40:["RO"],41:["CH"],43:["AT"],44:["GB","GG","IM","JE"],45:["DK"],46:["SE"],47:["NO","SJ"],48:["PL"],49:["DE"],51:["PE"],52:["MX"],53:["CU"],54:["AR"],55:["BR"],56:["CL"],57:["CO"],58:["VE"],60:["MY"],61:["AU","CC","CX"],62:["ID"],63:["PH"],64:["NZ"],65:["SG"],66:["TH"],81:["JP"],82:["KR"],84:["VN"],86:["CN"],90:["TR"],91:["IN"],92:["PK"],93:["AF"],94:["LK"],95:["MM"],98:["IR"],211:["SS"],212:["MA","EH"],213:["DZ"],216:["TN"],218:["LY"],220:["GM"],221:["SN"],222:["MR"],223:["ML"],224:["GN"],225:["CI"],226:["BF"],227:["NE"],228:["TG"],229:["BJ"],230:["MU"],231:["LR"],232:["SL"],233:["GH"],234:["NG"],235:["TD"],236:["CF"],237:["CM"],238:["CV"],239:["ST"],240:["GQ"],241:["GA"],242:["CG"],243:["CD"],244:["AO"],245:["GW"],246:["IO"],247:["AC"],248:["SC"],249:["SD"],250:["RW"],251:["ET"],252:["SO"],253:["DJ"],254:["KE"],255:["TZ"],256:["UG"],257:["BI"],258:["MZ"],260:["ZM"],261:["MG"],262:["RE","YT"],263:["ZW"],264:["NA"],265:["MW"],266:["LS"],267:["BW"],268:["SZ"],269:["KM"],290:["SH","TA"],291:["ER"],297:["AW"],298:["FO"],299:["GL"],350:["GI"],351:["PT"],352:["LU"],353:["IE"],354:["IS"],355:["AL"],356:["MT"],357:["CY"],358:["FI","AX"],359:["BG"],370:["LT"],371:["LV"],372:["EE"],373:["MD"],374:["AM"],375:["BY"],376:["AD"],377:["MC"],378:["SM"],380:["UA"],381:["RS"],382:["ME"],383:["XK"],385:["HR"],386:["SI"],387:["BA"],389:["MK"],420:["CZ"],421:["SK"],423:["LI"],500:["FK"],501:["BZ"],502:["GT"],503:["SV"],504:["HN"],505:["NI"],506:["CR"],507:["PA"],508:["PM"],509:["HT"],590:["GP","BL","MF"],591:["BO"],592:["GY"],593:["EC"],594:["GF"],595:["PY"],596:["MQ"],597:["SR"],598:["UY"],599:["CW","BQ"],670:["TL"],672:["NF"],673:["BN"],674:["NR"],675:["PG"],676:["TO"],677:["SB"],678:["VU"],679:["FJ"],680:["PW"],681:["WF"],682:["CK"],683:["NU"],685:["WS"],686:["KI"],687:["NC"],688:["TV"],689:["PF"],690:["TK"],691:["FM"],692:["MH"],850:["KP"],852:["HK"],853:["MO"],855:["KH"],856:["LA"],880:["BD"],886:["TW"],960:["MV"],961:["LB"],962:["JO"],963:["SY"],964:["IQ"],965:["KW"],966:["SA"],967:["YE"],968:["OM"],970:["PS"],971:["AE"],972:["IL"],973:["BH"],974:["QA"],975:["BT"],976:["MN"],977:["NP"],992:["TJ"],993:["TM"],994:["AZ"],995:["GE"],996:["KG"],998:["UZ"]},countries:{AC:["247","00","(?:[01589]\\d|[46])\\d{4}",[5,6]],AD:["376","00","(?:1|6\\d)\\d{7}|[135-9]\\d{5}",[6,8,9],[["(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],["(\\d{4})(\\d{4})","$1 $2",["1"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]]],AE:["971","00","(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",[5,6,7,8,9,10,11,12],[["(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],["(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"]],"0"],AF:["93","00","[2-7]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],"0"],AG:["1","011","(?:268|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([457]\\d{6})$|1","268$1",0,"268"],AI:["1","011","(?:264|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2457]\\d{6})$|1","264$1",0,"264"],AL:["355","00","(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",[6,7,8,9],[["(\\d{3})(\\d{3,4})","$1 $2",["80|9"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["[23578]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"]],"0"],AM:["374","00","(?:[1-489]\\d|55|60|77)\\d{6}",[8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[89]0"],"0 $1"],["(\\d{3})(\\d{5})","$1 $2",["2|3[12]"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[3-9]"],"0$1"]],"0"],AO:["244","00","[29]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[29]"]]]],AR:["54","00","(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}",[10,11],[["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])","2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["[23]"],"0$1",1],["(\\d)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9(?:2[2-469]|3[3-578])","9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))","9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",0,"$1 $2 $3-$4"],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 15-$3-$4",["91"],"0$1",0,"$1 $2 $3-$4"],["(\\d{3})(\\d{3})(\\d{5})","$1-$2-$3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9"],"0$1",0,"$1 $2 $3-$4"]],"0",0,"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?","9$1"],AS:["1","011","(?:[58]\\d\\d|684|900)\\d{7}",[10],0,"1",0,"([267]\\d{6})$|1","684$1",0,"684"],AT:["43","00","1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}",[4,5,6,7,8,9,10,11,12,13],[["(\\d)(\\d{3,12})","$1 $2",["1(?:11|[2-9])"],"0$1"],["(\\d{3})(\\d{2})","$1 $2",["517"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["5[079]"],"0$1"],["(\\d{3})(\\d{3,10})","$1 $2",["(?:31|4)6|51|6(?:48|5[0-3579]|[6-9])|7(?:20|32|8)|[89]","(?:31|4)6|51|6(?:485|5[0-3579]|[6-9])|7(?:20|32|8)|[89]"],"0$1"],["(\\d{4})(\\d{3,9})","$1 $2",["[2-467]|5[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["5"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,7})","$1 $2 $3",["5"],"0$1"]],"0"],AU:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}",[5,6,7,8,9,10,12],[["(\\d{2})(\\d{3,4})","$1 $2",["16"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["14|4"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:30|[89])"]]],"0",0,"(183[12])|0",0,0,0,[["(?:(?:241|349)0\\d\\d|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4])|[34]\\d\\d)|91(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79]))))\\d{3}|(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|3(?:[0-3589]\\d|4[0-578]|6[1-9]|7[0-35-9])|7(?:[013-57-9]\\d|2[0-8])|8(?:55|6[0-8]|[78]\\d|9[02-9]))\\d{6}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,["163\\d{2,6}",[5,6,7,8,9]],["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],AW:["297","00","(?:[25-79]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[25-9]"]]]],AX:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}",[5,6,7,8,9,10,11,12],0,"0",0,0,0,0,"18",0,"00"],AZ:["994","00","365\\d{6}|(?:[124579]\\d|60|88)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[28]|2|365|46","1[28]|2|365[45]|46","1[28]|2|365(?:4|5[02])|46"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[13-9]"],"0$1"]],"0"],BA:["387","00","6\\d{8}|(?:[35689]\\d|49|70)\\d{6}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-3]|[7-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]|6[56]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6"],"0$1"]],"0"],BB:["1","011","(?:246|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","246$1",0,"246"],BD:["880","00","[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{4,6})","$1-$2",["31[5-8]|[459]1"],"0$1"],["(\\d{3})(\\d{3,7})","$1-$2",["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"],"0$1"],["(\\d{4})(\\d{3,6})","$1-$2",["[13-9]|2[23]"],"0$1"],["(\\d)(\\d{7,8})","$1-$2",["2"],"0$1"]],"0"],BE:["32","00","4\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[239]|4[23]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[15-8]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4"],"0$1"]],"0"],BF:["226","00","(?:[025-7]\\d|44)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[024-7]"]]]],BG:["359","00","00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}",[6,7,8,9,12],[["(\\d)(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["43[1-6]|70[1-9]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:70|8)0"],"0$1"],["(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[1-7]|7"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[48]|9[08]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"]],"0"],BH:["973","00","[136-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[13679]|8[02-4679]"]]]],BI:["257","00","(?:[267]\\d|31)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2367]"]]]],BJ:["229","00","(?:01\\d|8)\\d{7}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["0"]]]],BL:["590","00","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:2[7-9]|3[3-7]|5[12]|87)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],BM:["1","011","(?:441|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","441$1",0,"441"],BN:["673","00","[2-578]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-578]"]]]],BO:["591","00(?:1\\d)?","8001\\d{5}|(?:[2-467]\\d|50)\\d{6}",[8,9],[["(\\d)(\\d{7})","$1 $2",["[235]|4[46]"]],["(\\d{8})","$1",["[67]"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["8"]]],"0",0,"0(1\\d)?"],BQ:["599","00","(?:[34]1|7\\d)\\d{5}",[7],0,0,0,0,0,0,"[347]"],BR:["55","00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","[1-467]\\d{9,10}|55[0-46-9]\\d{8}|[34]\\d{7}|55\\d{7,8}|(?:5[0-46-9]|[89]\\d)\\d{7,9}",[8,9,10,11],[["(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37|86)","300|4(?:0(?:0|20)|370|864)"]],["(\\d{3})(\\d{2,3})(\\d{4})","$1 $2 $3",["(?:[358]|90)0"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"],"($1)"],["(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["[16][1-9]|[2-57-9]"],"($1)"]],"0",0,"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2"],BS:["1","011","(?:242|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([3-8]\\d{6})$|1","242$1",0,"242"],BT:["975","00","[178]\\d{7}|[2-8]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[2-6]|7[246]|8[2-4]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[67]|[78]"]]]],BW:["267","00","(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}",[7,8,10],[["(\\d{2})(\\d{5})","$1 $2",["90"]],["(\\d{3})(\\d{4})","$1 $2",["[24-6]|3[15-9]"]],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37]"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["8"]]]],BY:["375","810","(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3})","$1 $2",["800"],"8 $1"],["(\\d{3})(\\d{2})(\\d{2,4})","$1 $2 $3",["800"],"8 $1"],["(\\d{4})(\\d{2})(\\d{3})","$1 $2-$3",["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])","1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"],"8 0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["1(?:[56]|7[467])|2[1-3]"],"8 0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-4]"],"8 0$1"],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["[89]"],"8 $1"]],"8",0,"0|80?",0,0,0,0,"8~10"],BZ:["501","00","(?:0800\\d|[2-8])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1-$2",["[2-8]"]],["(\\d)(\\d{3})(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"]]]],CA:["1","011","[2-9]\\d{9}|3\\d{6}",[7,10],0,"1",0,0,0,0,0,[["(?:2(?:04|[23]6|[48]9|5[07]|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|[26]8|3[178]|50|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|7[39])|9(?:0[25]|42))[2-9]\\d{6}",[10]],["",[10]],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",[10]],["900[2-9]\\d{6}",[10]],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:2[125-9]|33|44|66|77|88)|6(?:22|33))[2-9]\\d{6}",[10]],0,["310\\d{4}",[7]],0,["600[2-9]\\d{6}",[10]]]],CC:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CD:["243","00","(?:(?:[189]|5\\d)\\d|2)\\d{7}|[1-68]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1"],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["5"],"0$1"]],"0"],CF:["236","00","(?:[27]\\d{3}|8776)\\d{4}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[278]"]]]],CG:["242","00","222\\d{6}|(?:0\\d|80)\\d{7}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"]]]],CH:["41","00","8\\d{11}|[2-9]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]|81"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["8"],"0$1"]],"0"],CI:["225","00","[02]\\d{9}",[10],[["(\\d{2})(\\d{2})(\\d)(\\d{5})","$1 $2 $3 $4",["2"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3 $4",["0"]]]],CK:["682","00","[2-578]\\d{4}",[5],[["(\\d{2})(\\d{3})","$1 $2",["[2-578]"]]]],CL:["56","(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0","12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}",[9,10,11],[["(\\d{5})(\\d{4})","$1 $2",["219","2196"],"($1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["60|809"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["44"]],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[1-36]"],"($1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9(?:10|[2-9])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-8]|[1-9])"],"($1)"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["60|8"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{3})(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"]]]],CM:["237","00","[26]\\d{8}|88\\d{6,7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["88"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]|88"]]]],CN:["86","00|1(?:[12]\\d|79)\\d\\d00","(?:(?:1[03-689]|2\\d)\\d\\d|6)\\d{8}|1\\d{10}|[126]\\d{6}(?:\\d(?:\\d{2})?)?|86\\d{5,6}|(?:[3-579]\\d|8[0-57-9])\\d{5,9}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2[0-57-9])[19]|3(?:[157]|35|49|9[1-68])|4(?:1[124-9]|2[179]|6[47-9]|7|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:07|1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3|4[13]|5[1-5]|7[0-79]|9[0-35-9])|(?:4[35]|59|85)[1-9]","(?:10|2[0-57-9])(?:1[02]|9[56])|8078|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))1","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|80781|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))12","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|807812|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:078|1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123"],"0$1"],["(\\d{3})(\\d{5,6})","$1 $2",["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]","(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]","85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])","85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["(?:4|80)0"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|2(?:[02-57-9]|1[1-9])","10|2(?:[02-57-9]|1[1-9])","10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"],"0$1",1],["(\\d{3})(\\d{7,8})","$1 $2",["9"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[3-578]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-9]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["[12]"],"0$1",1]],"0",0,"(1(?:[12]\\d|79)\\d\\d)|0",0,0,0,0,"00"],CO:["57","00(?:4(?:[14]4|56)|[579])","(?:46|60\\d\\d)\\d{6}|(?:1\\d|[39])\\d{9}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["46"]],["(\\d{3})(\\d{7})","$1 $2",["6|90"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["3[0-357]|9[14]"]],["(\\d)(\\d{3})(\\d{7})","$1-$2-$3",["1"],"0$1",0,"$1 $2 $3"]],"0",0,"0([3579]|4(?:[14]4|56))?"],CR:["506","00","(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}",[8,10],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[3-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]"]]],0,0,"(19(?:0[0-2468]|1[09]|20|66|77|99))"],CU:["53","119","(?:[2-7]|8\\d\\d)\\d{7}|[2-47]\\d{6}|[34]\\d{5}",[6,7,8,10],[["(\\d{2})(\\d{4,6})","$1 $2",["2[1-4]|[34]"],"(0$1)"],["(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["[56]"],"0$1"],["(\\d{3})(\\d{7})","$1 $2",["8"],"0$1"]],"0"],CV:["238","0","(?:[2-59]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2-589]"]]]],CW:["599","00","(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[3467]"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["9[4-8]"]]],0,0,0,0,0,"[69]"],CX:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CY:["357","00","(?:[279]\\d|[58]0)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[257-9]"]]]],CZ:["420","00","(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}",[9,10,11,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["96"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]]],DE:["49","00","[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}",[4,5,6,7,8,9,10,11,12,13,14,15],[["(\\d{2})(\\d{3,13})","$1 $2",["3[02]|40|[68]9"],"0$1"],["(\\d{3})(\\d{3,12})","$1 $2",["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1","2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"],"0$1"],["(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]","[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["138"],"0$1"],["(\\d{5})(\\d{2,10})","$1 $2",["3"],"0$1"],["(\\d{3})(\\d{5,11})","$1 $2",["181"],"0$1"],["(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["1(?:3|80)|9"],"0$1"],["(\\d{3})(\\d{7,8})","$1 $2",["1[67]"],"0$1"],["(\\d{3})(\\d{7,12})","$1 $2",["8"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["185","1850","18500"],"0$1"],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["18[68]"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["15[1279]"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["15[03568]","15(?:[0568]|3[13])"],"0$1"],["(\\d{3})(\\d{8})","$1 $2",["18"],"0$1"],["(\\d{3})(\\d{2})(\\d{7,8})","$1 $2 $3",["1(?:6[023]|7)"],"0$1"],["(\\d{4})(\\d{2})(\\d{7})","$1 $2 $3",["15[279]"],"0$1"],["(\\d{3})(\\d{2})(\\d{8})","$1 $2 $3",["15"],"0$1"]],"0"],DJ:["253","00","(?:2\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[27]"]]]],DK:["45","00","[2-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-9]"]]]],DM:["1","011","(?:[58]\\d\\d|767|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","767$1",0,"767"],DO:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,0,0,0,"8001|8[024]9"],DZ:["213","00","(?:[1-4]|[5-79]\\d|80)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-8]"],"0$1"]],"0"],EC:["593","00","1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}",[8,9,10,11],[["(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[2-7]"],"(0$1)",0,"$1-$2-$3"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{3})(\\d{3,4})","$1 $2 $3",["1"]]],"0"],EE:["372","00","8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]],["(\\d{4})(\\d{3,4})","$1 $2",["[45]|8(?:00|[1-49])","[45]|8(?:00[1-9]|[1-49])"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],EG:["20","00","[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}",[8,9,10],[["(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1"],["(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|8[2468]|9[235-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{8})","$1 $2",["1"],"0$1"]],"0"],EH:["212","00","[5-8]\\d{8}",[9],0,"0",0,0,0,0,"528[89]"],ER:["291","00","[178]\\d{6}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[178]"],"0$1"]],"0"],ES:["34","00","[5-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]00"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-9]"]]]],ET:["251","00","(?:11|[2-579]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-579]"],"0$1"]],"0"],FI:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}",[5,6,7,8,9,10,11,12],[["(\\d{5})","$1",["20[2-59]"],"0$1"],["(\\d{3})(\\d{3,7})","$1 $2",["(?:[1-3]0|[68])0|70[07-9]"],"0$1"],["(\\d{2})(\\d{4,8})","$1 $2",["[14]|2[09]|50|7[135]"],"0$1"],["(\\d{2})(\\d{6,10})","$1 $2",["7"],"0$1"],["(\\d)(\\d{4,9})","$1 $2",["(?:19|[2568])[1-8]|3(?:0[1-9]|[1-9])|9"],"0$1"]],"0",0,0,0,0,"1[03-79]|[2-9]",0,"00"],FJ:["679","0(?:0|52)","45\\d{5}|(?:0800\\d|[235-9])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|45"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]]],0,0,0,0,0,0,0,"00"],FK:["500","00","[2-7]\\d{4}",[5]],FM:["691","00","(?:[39]\\d\\d|820)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[389]"]]]],FO:["298","00","[2-9]\\d{5}",[6],[["(\\d{6})","$1",["[2-9]"]]],0,0,"(10(?:01|[12]0|88))"],FR:["33","00","[1-9]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"]],"0"],GA:["241","00","(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}",[7,8],[["(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["11|[67]"],"0$1"]],0,0,"0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})","$1"],GB:["44","00","[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}",[7,9,10],[["(\\d{3})(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["845","8454","84546","845464"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["800"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:(?:38|69)7|5(?:24|39)|768|946)","1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["1(?:[2-69][02-9]|[78])"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[25]|7(?:0|6[02-9])","[25]|7(?:0|6(?:[03-9]|2[356]))"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[1389]"],"0$1"]],"0",0,"0|180020",0,0,0,[["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0-5])|4(?:(?:[0-5]\\d|70)\\d|69[7-9])|(?:(?:5[0-26-9]|[78][0-49])\\d|6(?:[0-4]\\d|5[01]))\\d)|(?:2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d|1(?:[0-7]\\d|8[0-3]))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d)\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}",[9,10]],["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]],0," x"],GD:["1","011","(?:473|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","473$1",0,"473"],GE:["995","00","(?:[3-57]\\d\\d|800)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["32"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[57]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[348]"],"0$1"]],"0"],GF:["594","00","(?:[56]94\\d|7093)\\d{5}|(?:80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]|9[47]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[89]"],"0$1"]],"0"],GG:["44","00","(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?",[7,9,10],0,"0",0,"([25-9]\\d{5})$|0|180020","1481$1",0,0,[["1481[25-9]\\d{5}",[10]],["7(?:(?:781|839)\\d|911[17])\\d{5}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]]],GH:["233","00","(?:[235]\\d{3}|800)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[235]"],"0$1"]],"0"],GI:["350","00","(?:[25]\\d|60)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["2"]]]],GL:["299","00","(?:19|[2-689]\\d|70)\\d{4}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["19|[2-9]"]]]],GM:["220","00","[2-9]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],GN:["224","00","722\\d{6}|(?:3|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"]]]],GP:["590","00","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["590(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1-9]|5[3-579]|[68][0-689]|7[08]|9\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],GQ:["240","00","222\\d{6}|(?:3\\d|55|[89]0)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"]],["(\\d{3})(\\d{6})","$1 $2",["[89]"]]]],GR:["30","00","5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}",[10,11,12],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["21|7"]],["(\\d{4})(\\d{6})","$1 $2",["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2689]"]],["(\\d{3})(\\d{3,4})(\\d{5})","$1 $2 $3",["8"]]]],GT:["502","00","80\\d{6}|(?:1\\d{3}|[2-7])\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1 $2",["[2-8]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],GU:["1","011","(?:[58]\\d\\d|671|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","671$1",0,"671"],GW:["245","00","[49]\\d{8}|4\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["40"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"]]]],GY:["592","001","(?:[2-8]\\d{3}|9008)\\d{3}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],HK:["852","00(?:30|5[09]|[126-9]?)","8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}",[5,6,7,8,9,11],[["(\\d{3})(\\d{2,5})","$1 $2",["900","9003"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{3})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,0,"00"],HN:["504","00","8\\d{10}|[237-9]\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1-$2",["[237-9]"]]]],HR:["385","00","[2-69]\\d{8}|80\\d{5,7}|[1-79]\\d{7}|6\\d{6}",[7,8,9],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["6[01]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6|7[245]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-57]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],"0"],HT:["509","00","[2-589]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[2-589]"]]]],HU:["36","00","[235-7]\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"06 $1"]],"06"],ID:["62","00[89]","00[1-9]\\d{9,14}|(?:[1-36]|8\\d{5})\\d{6}|00\\d{9}|[1-9]\\d{8,10}|[2-9]\\d{7}",[7,8,9,10,11,12,13,14,15,16,17],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["15"]],["(\\d{2})(\\d{5,9})","$1 $2",["2[124]|[36]1"],"(0$1)"],["(\\d{3})(\\d{5,7})","$1 $2",["800"],"0$1"],["(\\d{3})(\\d{5,8})","$1 $2",["[2-79]"],"(0$1)"],["(\\d{3})(\\d{3,4})(\\d{3})","$1-$2-$3",["8[1-35-9]"],"0$1"],["(\\d{3})(\\d{6,8})","$1 $2",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["804"],"0$1"],["(\\d{3})(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1-$2-$3",["8"],"0$1"]],"0"],IE:["353","00","(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)"],["(\\d{3})(\\d{5})","$1 $2",["[45]0"],"(0$1)"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2569]|4[1-69]|7[14]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[78]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["4"],"(0$1)"],["(\\d{2})(\\d)(\\d{3})(\\d{4})","$1 $2 $3 $4",["8"],"0$1"]],"0"],IL:["972","0(?:0|1[2-9])","1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}",[7,8,9,10,11,12],[["(\\d{4})(\\d{3})","$1-$2",["125"]],["(\\d{4})(\\d{2})(\\d{2})","$1-$2-$3",["121"]],["(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1-$2-$3",["12"]],["(\\d{4})(\\d{6})","$1-$2",["159"]],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"]],["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})","$1-$2 $3-$4",["15"]]],"0"],IM:["44","00","1624\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([25-8]\\d{5})$|0|180020","1624$1",0,"74576|(?:16|7[56])24"],IN:["91","00","(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}",[8,9,10,11,12,13],[["(\\d{8})","$1",["5(?:0|2[23]|3[03]|[67]1|88)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"],0,1],["(\\d{4})(\\d{4,5})","$1 $2",["180","1800"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["140"],0,1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79[1-7]|80[2-46]","11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])","11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[14]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:2[14]|3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:74[47]|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"],"0$1",1],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|28|3[129]|4[1-35689]|5[29]|6[02-5]|70)|807","1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]","1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|8(?:28[235-7]|3))|73179|807(?:1|9[1-3])|(?:1552|6(?:(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689])\\d|8(?:[14-6]\\d|2[0-79]))|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"],"0$1",1],["(\\d{5})(\\d{5})","$1 $2",["[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["1(?:6|8[06])","1(?:6|8[06]0)"],0,1],["(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18"],0,1]],"0"],IO:["246","00","3\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["3"]]]],IQ:["964","00","(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],IR:["98","00","[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}",[4,5,6,7,10],[["(\\d{4,5})","$1",["96"],"0$1"],["(\\d{2})(\\d{4,5})","$1 $2",["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1"]],"0"],IS:["354","00|1(?:0(?:01|[12]0)|100)","(?:38\\d|[4-9])\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[4-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["3"]]],0,0,0,0,0,0,0,"00"],IT:["39","00","0\\d{5,11}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:43|55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?",[6,7,8,9,10,11,12],[["(\\d{2})(\\d{4,6})","$1 $2",["0[26]"]],["(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]],["(\\d{4})(\\d{2,6})","$1 $2",["0(?:[13-579][2-46-8]|8[236-8])"]],["(\\d{4})(\\d{4})","$1 $2",["894"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|5"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["1(?:44|[679])|[378]|43"]],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]|14"]],["(\\d{2})(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[03]"]]],0,0,0,0,0,0,[["0(?:669[0-79]\\d{1,6}|831\\d{2,8})|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[2356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}"],["3[2-9]\\d{7,8}|(?:31|43)\\d{8}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],["3[2-8]\\d{9,10}",[11,12]],0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],JE:["44","00","1534\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([0-24-8]\\d{5})$|0|180020","1534$1",0,0,[["1534[0-24-8]\\d{5}"],["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97\\d))\\d{5}"],["80(?:07(?:35|81)|8901)\\d{4}"],["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"],["701511\\d{4}"],0,["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}"],["56\\d{8}"]]],JM:["1","011","(?:[58]\\d\\d|658|900)\\d{7}",[10],0,"1",0,0,0,0,"658|876"],JO:["962","00","(?:(?:[2689]|7\\d)\\d|32|427|53)\\d{6}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)"],["(\\d{3})(\\d{5,6})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["70"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[47]"],"0$1"]],"0"],JP:["81","010","00[1-9]\\d{6,14}|[25-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}",[8,9,10,11,12,13,14,15,16,17],[["(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],["(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51)|9(?:80|9[16])","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["3|4(?:2[09]|7[01])|6[1-9]","3|4(?:2(?:0|9[02-69])|7(?:0[019]|1))|6[1-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[0459]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[26-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9]|9[29])|5(?:2|3(?:[045]|9[0-8])|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|3(?:[29]|60)|49|51|6(?:[0-24]|36|5[0-3589]|7[23]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3(?:[045]|9(?:[0-58]|6[4-9]|7[0-35689]))|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|60|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[2-57-9]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|7(?:2[2-468]|3[78])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"],"0$1"],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["[14]|[289][2-9]|5[3-9]|7[2-4679]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[25-9]"],"0$1"]],"0",0,"(000[2569]\\d{4,6})$|(?:(?:003768)0?)|0","$1"],KE:["254","000","(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}",[7,8,9,10],[["(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[17]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0"],KG:["996","00","8\\d{9}|[235-9]\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["3(?:1[346]|[24-79])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-79]|88"],"0$1"],["(\\d{3})(\\d{3})(\\d)(\\d{2,3})","$1 $2 $3 $4",["8"],"0$1"]],"0"],KH:["855","00[14-9]","1\\d{9}|[1-9]\\d{7,8}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],KI:["686","00","(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}",[5,8],0,"0"],KM:["269","00","[3478]\\d{6}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[3478]"]]]],KN:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","869$1",0,"869"],KP:["850","00|99","85\\d{6}|(?:19\\d|[2-7])\\d{7}",[8,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"]],"0"],KR:["82","00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))","00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}",[5,6,8,9,10,11,12,13,14],[["(\\d{2})(\\d{3,4})","$1-$2",["(?:3[1-3]|[46][1-4]|5[1-5])1"],"0$1"],["(\\d{4})(\\d{4})","$1-$2",["1"]],["(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[36]0|8"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["[1346]|5[1-5]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{2})(\\d{5})(\\d{4})","$1-$2-$3",["5"],"0$1"]],"0",0,"0(8(?:[1-46-8]|5\\d\\d))?"],KW:["965","00","18\\d{5}|(?:[2569]\\d|41)\\d{6}",[7,8],[["(\\d{4})(\\d{3,4})","$1 $2",["[169]|2(?:[235]|4[1-35-9])|52"]],["(\\d{3})(\\d{5})","$1 $2",["[245]"]]]],KY:["1","011","(?:345|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","345$1",0,"345"],KZ:["7","810","(?:33622|8\\d{8})\\d{5}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"33622|7",0,"8~10"],LA:["856","00","[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["3"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[23]"],"0$1"]],"0"],LB:["961","00","[27-9]\\d{7}|[13-9]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-69]|7(?:[2-57]|62|8[0-6]|9[04-9])|8[02-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27-9]"]]],"0"],LC:["1","011","(?:[58]\\d\\d|758|900)\\d{7}",[10],0,"1",0,"([2-8]\\d{6})$|1","758$1",0,"758"],LI:["423","00","[68]\\d{8}|(?:[2378]\\d|90)\\d{5}",[7,9],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2379]|8(?:0[09]|7)","[2379]|8(?:0(?:02|9)|7)"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["69"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],"0",0,"(1001)|0"],LK:["94","00","[1-9]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[1-689]"],"0$1"]],"0"],LR:["231","00","(?:[2457]\\d|33|88)\\d{7}|(?:2\\d|[4-6])\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["4[67]|[56]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-578]"],"0$1"]],"0"],LS:["266","00","(?:[256]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2568]"]]]],LT:["370","00","(?:[3469]\\d|52|[78]0)\\d{6}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["52[0-7]"],"(0-$1)",1],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"0 $1",1],["(\\d{2})(\\d{6})","$1 $2",["37|4(?:[15]|6[1-8])"],"(0-$1)",1],["(\\d{3})(\\d{5})","$1 $2",["[3-6]"],"(0-$1)",1]],"0",0,"[08]"],LU:["352","00","35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}",[4,5,6,7,8,9,10,11],[["(\\d{2})(\\d{3})","$1 $2",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20[2-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["2(?:[0367]|4[3-8])"]],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["80[01]|90[015]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["20"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["2(?:[0367]|4[3-8])"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})","$1 $2 $3 $4",["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]]],0,0,"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"],LV:["371","00","(?:[268]\\d|78|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2679]|8[01]"]]]],LY:["218","00","[2-9]\\d{8}",[9],[["(\\d{2})(\\d{7})","$1-$2",["[2-9]"],"0$1"]],"0"],MA:["212","00","[5-8]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5[45]"],"0$1"],["(\\d{4})(\\d{5})","$1-$2",["5(?:[19]|2[2-46-9]|3[3-9])|8(?:0[89]|92)"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8"],"0$1"],["(\\d{3})(\\d{6})","$1-$2",["[5-7]"],"0$1"]],"0",0,0,0,0,0,[["5(?:(?:18|4[0679]|5[03])\\d|2(?:[0-25-79]\\d|3[1-578]|4[02-46-8]|8[0235-7])|3(?:[0-47]\\d|5[02-9]|6[02-8]|8[014-9]|9[3-9]))\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[016-8]\\d|2[0-8]|5[0-5]))\\d{6}"],["80[0-7]\\d{6}"],["89\\d{7}"],0,0,0,0,["(?:592(?:4[0-2]|93)|80[89]\\d\\d)\\d{4}"]]],MC:["377","00","(?:[3489]|[67]\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[389]"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[67]"],"0$1"]],"0"],MD:["373","00","(?:[235-7]\\d|[89]0)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[25-7]"],"0$1"]],"0"],ME:["382","00","(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"0$1"]],"0"],MF:["590","00","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:0[079]|[14]3|[27][79]|3[03-7]|5[0-268]|87)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],MG:["261","00","[23]\\d{8}",[9],[["(\\d{2})(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,"([24-9]\\d{6})$|0","20$1"],MH:["692","011","329\\d{4}|(?:[256]\\d|45)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1-$2",["[2-6]"]]],"1"],MK:["389","00","[2-578]\\d{7}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2|34[47]|4(?:[37]7|5[47]|64)"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1"]],"0"],ML:["223","00","[24-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-9]"]]]],MM:["95","00","1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}",[6,7,8,9,10],[["(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["4(?:[2-46]|5[3-5])|5|6(?:[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-5]|(?:60|86)[23]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]|452|678|86","[12]|452|6788|86"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[4-7]|8[1-35]"],"0$1"],["(\\d)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[137-9])"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["92"],"0$1"],["(\\d)(\\d{5})(\\d{4})","$1 $2 $3",["9"],"0$1"]],"0"],MN:["976","001","[12]\\d{7,9}|[5-9]\\d{7}",[8,9,10],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[12]1"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[5-9]"]],["(\\d{3})(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["[12](?:27|3[2-8]|4[2-68]|5[1-4689])","[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["[12]"],"0$1"]],"0"],MO:["853","00","0800\\d{3}|(?:28|[68]\\d)\\d{6}",[7,8],[["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{4})(\\d{4})","$1 $2",["[268]"]]]],MP:["1","011","[58]\\d{9}|(?:67|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","670$1",0,"670"],MQ:["596","00","(?:596\\d|7091)\\d{5}|(?:69|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]|8(?:0[6-9]|[36])"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],MR:["222","00","(?:[2-4]\\d\\d|800)\\d{5}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-48]"]]]],MS:["1","011","(?:[58]\\d\\d|664|900)\\d{7}",[10],0,"1",0,"([34]\\d{6})$|1","664$1",0,"664"],MT:["356","00","3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2357-9]"]]]],MU:["230","0(?:0|[24-7]0|3[03])","(?:[57]|8\\d\\d)\\d{7}|[2-468]\\d{6}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[2-46]|8[013]"]],["(\\d{4})(\\d{4})","$1 $2",["[57]"]],["(\\d{5})(\\d{5})","$1 $2",["8"]]],0,0,0,0,0,0,0,"020"],MV:["960","0(?:0|19)","(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}",[7,10],[["(\\d{3})(\\d{4})","$1-$2",["[34679]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,0,"00"],MW:["265","00","(?:[1289]\\d|31|77)\\d{7}|1\\d{6}",[7,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[137-9]"],"0$1"]],"0"],MX:["52","0[09]","[2-9]\\d{9}",[10],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["33|5[56]|81"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2-9]"]]],0,0,0,0,0,0,0,"00"],MY:["60","00","1\\d{8,9}|(?:3\\d|[4-9])\\d{7}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1-$2 $3",["1(?:[02469]|[378][1-9]|53)|8","1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3-$4",["1(?:[367]|80)"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2 $3",["1"],"0$1"]],"0"],MZ:["258","00","(?:2|8\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-79]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],NA:["264","00","[68]\\d{7,8}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["87"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],NC:["687","00","(?:050|[2-57-9]\\d\\d)\\d{3}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[02-57-9]"]]]],NE:["227","00","[027-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["08"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[089]|2[013]|7[0467]"]]]],NF:["672","00","[13]\\d{5}",[6],[["(\\d{2})(\\d{4})","$1 $2",["1[0-3]"]],["(\\d)(\\d{5})","$1 $2",["[13]"]]],0,0,"([0-258]\\d{4})$","3$1"],NG:["234","009","(?:20|9\\d)\\d{8}|[78]\\d{9,13}",[10,11,12,13,14],[["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["20[129]"],"0$1"],["(\\d{4})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[78]"],"0$1"],["(\\d{3})(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]"],"0$1"]],"0"],NI:["505","00","(?:1800|[25-8]\\d{3})\\d{4}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[125-8]"]]]],NL:["31","00","(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|8\\d{6,9}|9\\d{6,10}|1\\d{4,5}",[5,6,7,8,9,10,11],[["(\\d{3})(\\d{4,7})","$1 $2",["[89]0"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["66"],"0$1"],["(\\d)(\\d{8})","$1 $2",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-578]|91"],"0$1"],["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3",["9"],"0$1"]],"0"],NO:["47","00","(?:0|[2-9]\\d{3})\\d{4}",[5,8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]"]]],0,0,0,0,0,"[02-689]|7[0-8]"],NP:["977","00","(?:1\\d|9)\\d{9}|[1-9]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1-$2",["1[2-6]"],"0$1"],["(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-59]|[67][2-6])"],"0$1"],["(\\d{3})(\\d{7})","$1-$2",["9"]]],"0"],NR:["674","00","(?:222|444|(?:55|8\\d)\\d|666|777|999)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[24-9]"]]]],NU:["683","00","(?:[4-7]|888\\d)\\d{3}",[4,7],[["(\\d{3})(\\d{4})","$1 $2",["8"]]]],NZ:["64","0(?:0|161)","[1289]\\d{9}|50\\d{5}(?:\\d{2,3})?|[27-9]\\d{7,8}|(?:[34]\\d|6[0-35-9])\\d{6}|8\\d{4,6}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,8})","$1 $2",["8[1-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["50[036-8]|8|90","50(?:[0367]|88)|8|90"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["24|[346]|7[2-57-9]|9[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|[589]"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1|2[028]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:[169]|7[0-35-9])|7"],"0$1"]],"0",0,0,0,0,0,0,"00"],OM:["968","00","(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}",[7,8,9],[["(\\d{3})(\\d{4,6})","$1 $2",["[58]"]],["(\\d{2})(\\d{6})","$1 $2",["2"]],["(\\d{4})(\\d{4})","$1 $2",["[179]"]]]],PA:["507","00","(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}",[7,8,10,11],[["(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"]],["(\\d{4})(\\d{4})","$1-$2",["[68]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]]],PE:["51","00|19(?:1[124]|77|90)00","(?:[14-8]|9\\d)\\d{7}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["1"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[4-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,0,"00"," Anexo "],PF:["689","00","4\\d{5}(?:\\d{2})?|8\\d{7,8}",[6,8,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4|8[7-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],PG:["675","00|140[1-3]","(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["18|[2-69]|85"]],["(\\d{4})(\\d{4})","$1 $2",["[78]"]]],0,0,0,0,0,0,0,"00"],PH:["63","00","(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}",[6,8,9,10,11,12,13],[["(\\d)(\\d{5})","$1 $2",["2"],"(0$1)"],["(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2","3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"],"(0$1)"],["(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|8[2-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"]]],"0"],PK:["92","00","122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,7})","$1 $2 $3",["[89]0"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["1"]],["(\\d{3})(\\d{6,7})","$1 $2",["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])","9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"],"(0$1)"],["(\\d{2})(\\d{7,8})","$1 $2",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],"(0$1)"],["(\\d{5})(\\d{5})","$1 $2",["58"],"(0$1)"],["(\\d{3})(\\d{7})","$1 $2",["3"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[24-9]"],"(0$1)"]],"0"],PL:["48","00","(?:6|8\\d\\d)\\d{7}|[1-9]\\d{6}(?:\\d{2})?|[26]\\d{5}",[6,7,8,9,10],[["(\\d{5})","$1",["19"]],["(\\d{3})(\\d{3})","$1 $2",["11|20|64"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1","(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2-8]|[2-7]|8[1-79]|9[145]"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["8"]]]],PM:["508","00","[45]\\d{5}|(?:708|8\\d\\d)\\d{6}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[45]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],PR:["1","011","(?:[589]\\d\\d|787)\\d{7}",[10],0,"1",0,0,0,0,"787|939"],PS:["970","00","[2489]2\\d{6}|(?:1\\d|5)\\d{8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2489]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],PT:["351","00","1693\\d{5}|(?:[26-9]\\d|30)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["16|[236-9]"]]]],PW:["680","01[12]","(?:[24-8]\\d\\d|345|900)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],PY:["595","00","59\\d{4,6}|9\\d{5,10}|(?:[2-46-8]\\d|5[0-8])\\d{4,7}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]"],"(0$1)"],["(\\d{3})(\\d{4,5})","$1 $2",["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["87"]],["(\\d{3})(\\d{6})","$1 $2",["9(?:[5-79]|8[1-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["9"]]],"0"],QA:["974","00","800\\d{4}|(?:2|800)\\d{6}|(?:0080|[3-7])\\d{7}",[7,8,9,11],[["(\\d{3})(\\d{4})","$1 $2",["2[136]|8"]],["(\\d{4})(\\d{4})","$1 $2",["[3-7]"]]]],RE:["262","00","709\\d{6}|(?:26|[689]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[26-9]"],"0$1"]],"0",0,0,0,0,0,[["26(?:2\\d\\d|3(?:0\\d|1[0-6]))\\d{4}"],["(?:69(?:2\\d\\d|3(?:[06][0-6]|1[0-3]|2[0-2]|3[0-39]|4\\d|5[0-5]|7[0-37]|8[0-8]|9[0-479]))|7092[0-3])\\d{4}"],["80\\d{7}"],["89[1-37-9]\\d{6}"],0,0,0,0,["9(?:399[0-3]|479[0-6]|76(?:2[278]|3[0-37]))\\d{4}"],["8(?:1[019]|2[0156]|84|90)\\d{6}"]]],RO:["40","00","(?:[236-8]\\d|90)\\d{7}|[23]\\d{5}",[6,9],[["(\\d{3})(\\d{3})","$1 $2",["2[3-6]","2[3-6]\\d9"],"0$1"],["(\\d{2})(\\d{4})","$1 $2",["219|31"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[236-9]"],"0$1"]],"0",0,0,0,0,0,0,0," int "],RS:["381","00","38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}",[6,7,8,9,10,11,12],[["(\\d{3})(\\d{3,9})","$1 $2",["(?:2[389]|39)0|[7-9]"],"0$1"],["(\\d{2})(\\d{5,10})","$1 $2",["[1-36]"],"0$1"]],"0"],RU:["7","810","8\\d{13}|[347-9]\\d{9}",[10,14],[["(\\d{4})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-8]|2[1-9])","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"],"8 ($1)",1],["(\\d{5})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-68]|2[1-9])","7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))","7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[349]|8(?:[02-7]|1[1-8])"],"8 ($1)",1],["(\\d{4})(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["8"],"8 ($1)"]],"8",0,0,0,0,0,[["336(?:[013-9]\\d|2[013-9])\\d{5}|(?:3(?:0[12]|4[1-35-79]|5[1-3]|65|8[1-58]|9[0145])|4(?:01|1[1356]|2[13467]|7[1-5]|8[1-7]|9[1-689])|8(?:1[1-8]|2[01]|3[13-6]|4[0-8]|5[15-7]|6[0-35-79]|7[1-37-9]))\\d{7}",[10]],["9\\d{9}",[10]],["8(?:0[04]|108\\d{3})\\d{7}"],["80[39]\\d{7}",[10]],["808\\d{7}",[10]]],"8~10"],RW:["250","00","(?:06|[27]\\d\\d|[89]00)\\d{6}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[7-9]"],"0$1"]],"0"],SA:["966","00","(?:[15]\\d|800|92)\\d{7}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["9"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],"0"],SB:["677","0[01]","[6-9]\\d{6}|[1-6]\\d{4}",[5,7],[["(\\d{2})(\\d{5})","$1 $2",["6[89]|7|8[4-9]|9(?:[1-8]|9[0-8])"]]]],SC:["248","010|0[0-2]","(?:[2489]\\d|64)\\d{5}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]|9[57]"]]],0,0,0,0,0,0,0,"00"],SD:["249","00","[19]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[19]"],"0$1"]],"0"],SE:["46","00","(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}",[6,7,8,9,10,12],[["(\\d{2})(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{4})","$1-$2",["9(?:00|39|44|9)"],"0$1",0,"$1 $2"],["(\\d{2})(\\d{3})(\\d{2})","$1-$2 $3",["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3"],["(\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{2,3})(\\d{3})","$1-$2 $3",["9(?:00|39|44)"],"0$1",0,"$1 $2 $3"],["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3 $4"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["10|7"],"0$1",0,"$1 $2 $3 $4"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4 $5",["[26]"],"0$1",0,"$1 $2 $3 $4 $5"]],"0"],SG:["65","0[0-3]\\d","(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["[369]|8(?:0[1-9]|[1-9])"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]],["(\\d{4})(\\d{4})(\\d{3})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],SH:["290","00","(?:[256]\\d|8)\\d{3}",[4,5],0,0,0,0,0,0,"[256]"],SI:["386","00|10(?:22|66|88|99)","[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}",[5,6,7,8],[["(\\d{2})(\\d{3,6})","$1 $2",["8[09]|9"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["59|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[0139]|51|6"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-57]"],"(0$1)"]],"0",0,0,0,0,0,0,"00"],SJ:["47","00","0\\d{4}|(?:[489]\\d|79)\\d{6}",[5,8],0,0,0,0,0,0,"79"],SK:["421","00","[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}",[6,7,9],[["(\\d)(\\d{2})(\\d{3,4})","$1 $2 $3",["21"],"0$1"],["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["[3-5][1-8]1","[3-5][1-8]1[67]"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1/$2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1/$2 $3 $4",["[3-5]"],"0$1"]],"0"],SL:["232","00","(?:[237-9]\\d|66)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[236-9]"],"(0$1)"]],"0"],SM:["378","00","(?:0549|[5-7]\\d)\\d{6}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"]],["(\\d{4})(\\d{6})","$1 $2",["0"]]],0,0,"([89]\\d{5})$","0549$1"],SN:["221","00","(?:[378]\\d|93)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"]]]],SO:["252","00","[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}",[6,7,8,9],[["(\\d{2})(\\d{4})","$1 $2",["8[125]"]],["(\\d{6})","$1",["[134]"]],["(\\d)(\\d{6})","$1 $2",["[15]|2[0-79]|3[0-46-8]|4[0-7]"]],["(\\d)(\\d{7})","$1 $2",["(?:2|90)4|[67]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[348]|64|79|90"]],["(\\d{2})(\\d{5,7})","$1 $2",["1|28|6[0-35-9]|7[67]|9[2-9]"]]],"0"],SR:["597","00","(?:[2-5]|[6-8]\\d|90)\\d{5}",[6,7],[["(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"]],["(\\d{3})(\\d{3})","$1-$2",["[2-5]"]],["(\\d{3})(\\d{4})","$1-$2",["[6-9]"]]]],SS:["211","00","[19]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[19]"],"0$1"]],"0"],ST:["239","00","(?:22|9\\d)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[29]"]]]],SV:["503","00","[25-7]\\d{7}|(?:80\\d|900)\\d{4}(?:\\d{4})?",[7,8,11],[["(\\d{3})(\\d{4})","$1 $2",["[89]"]],["(\\d{4})(\\d{4})","$1 $2",["[25-7]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"]]]],SX:["1","011","7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"(5\\d{6})$|1","721$1",0,"721"],SY:["963","00","[1-359]\\d{8}|[1-5]\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-4]|5[1-3]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[59]"],"0$1",1]],"0"],SZ:["268","00","0800\\d{4}|(?:[237]\\d|900)\\d{6}",[8,9],[["(\\d{4})(\\d{4})","$1 $2",["[0237]"]],["(\\d{5})(\\d{4})","$1 $2",["9"]]]],TA:["290","00","8\\d{3}",[4],0,0,0,0,0,0,"8"],TC:["1","011","(?:[58]\\d\\d|649|900)\\d{7}",[10],0,"1",0,"([2-479]\\d{6})$|1","649$1",0,"649"],TD:["235","00|16","(?:22|30|[689]\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[236-9]"]]],0,0,0,0,0,0,0,"00"],TG:["228","00","[279]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[279]"]]]],TH:["66","00[1-9]","(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}",[8,9,10,13],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[13-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],TJ:["992","810","(?:[0-57-9]\\d|66)\\d{7}",[9],[["(\\d{6})(\\d)(\\d{2})","$1 $2 $3",["331","3317"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["44[02-479]|[34]7"]],["(\\d{4})(\\d)(\\d{4})","$1 $2 $3",["3(?:[1245]|3[12])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["\\d"]]],0,0,0,0,0,0,0,"8~10"],TK:["690","00","[2-47]\\d{3,6}",[4,5,6,7]],TL:["670","00","7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[2-489]|70"]],["(\\d{4})(\\d{4})","$1 $2",["7"]]]],TM:["993","810","(?:[1-6]\\d|71)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-5]"],"(8 $1)"],["(\\d{2})(\\d{6})","$1 $2",["[67]"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],TN:["216","00","[2-57-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]"]]]],TO:["676","00","(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}",[5,7],[["(\\d{2})(\\d{3})","$1-$2",["[2-4]|50|6[09]|7[0-24-69]|8[05]"]],["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[5-9]"]]]],TR:["90","00","4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}",[7,10,12,13],[["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["512|8[01589]|90"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5(?:[0-59]|61)","5(?:[0-59]|61[06])","5(?:[0-59]|61[06]1)"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24][1-8]|3[1-9]"],"(0$1)",1],["(\\d{3})(\\d{3})(\\d{6,7})","$1 $2 $3",["80"],"0$1",1]],"0"],TT:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-46-8]\\d{6})$|1","868$1",0,"868"],TV:["688","00","(?:2|7\\d\\d|90)\\d{4}",[5,6,7],[["(\\d{2})(\\d{3})","$1 $2",["2"]],["(\\d{2})(\\d{4})","$1 $2",["90"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],TW:["886","0(?:0[25-79]|19)","[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}",[7,8,9,10,11],[["(\\d{2})(\\d)(\\d{4})","$1 $2 $3",["202"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[258]0"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-47-9])|7[1-9]","[23568]|4(?:0[2-48]|[1-47-9])|(?:400|7)[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,5})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,0,0,"#"],TZ:["255","00[056]","(?:[25-8]\\d|41|90)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["5"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1"]],"0"],UA:["380","00","[89]\\d{9}|[3-9]\\d{8}",[9,10],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]","6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])","3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|89|9[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,0,"0~0"],UG:["256","00[057]","800\\d{6}|(?:[29]0|[347]\\d)\\d{7}",[9],[["(\\d{4})(\\d{5})","$1 $2",["202","2024"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[27-9]|4(?:6[45]|[7-9])"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[34]"],"0$1"]],"0"],US:["1","011","[2-9]\\d{9}|3\\d{6}",[10],[["(\\d{3})(\\d{4})","$1-$2",["310"],0,1],["(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],0,1,"$1-$2-$3"]],"1",0,0,0,0,0,[["3052(?:0[0-8]|[1-9]\\d)\\d{4}|(?:2742|305[3-9])\\d{6}|(?:472|983)[2-47-9]\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-47-9]|1[02-9]|2[013-79]|3[0-24679]|4[167]|5[0-2]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-269])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[0-247]|4[0378]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[0168]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-3589]|8[04-69]))[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"],0,0,0,["305209\\d{4}"]]],UY:["598","0(?:0|1[3-9]\\d)","0004\\d{2,9}|[1249]\\d{7}|2\\d{3,4}|(?:[49]\\d|80)\\d{5}",[4,5,6,7,8,9,10,11,12,13],[["(\\d{4,5})","$1",["21"]],["(\\d{3})(\\d{3,4})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[49]0|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[124]"]],["(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3 $4",["0"]]],"0",0,0,0,0,0,0,"00"," int. "],UZ:["998","00","(?:20|33|[5-9]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[235-9]"]]]],VA:["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11,12],0,0,0,0,0,0,"06698"],VC:["1","011","(?:[58]\\d\\d|784|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","784$1",0,"784"],VE:["58","00","[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}",[10],[["(\\d{3})(\\d{7})","$1-$2",["[24-689]"],"0$1"]],"0"],VG:["1","011","(?:284|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-578]\\d{6})$|1","284$1",0,"284"],VI:["1","011","[58]\\d{9}|(?:34|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","340$1",0,"340"],VN:["84","00","[12]\\d{9}|[135-9]\\d{8}|[16]\\d{7}|[16-8]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["80"],"0$1",1],["(\\d{4})(\\d{4,6})","$1 $2",["1"],0,1],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["6"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[357-9]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2[48]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["2"],"0$1",1]],"0"],VU:["678","00","[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}",[5,7],[["(\\d{3})(\\d{4})","$1 $2",["[57-9]"]]]],WF:["681","00","(?:40|72|8\\d{4})\\d{4}|[89]\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[47-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],WS:["685","0","(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}",[5,6,7,10],[["(\\d{5})","$1",["[2-5]|6[1-9]"]],["(\\d{3})(\\d{3,7})","$1 $2",["[68]"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],XK:["383","00","2\\d{7,8}|3\\d{7,11}|(?:4\\d\\d|[89]00)\\d{5}",[8,9,10,11,12],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2|39"],"0$1"],["(\\d{2})(\\d{7,10})","$1 $2",["3"],"0$1"]],"0"],YE:["967","00","(?:1|7\\d)\\d{7}|[1-7]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7(?:[24-6]|8[0-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1"]],"0"],YT:["262","00","7093\\d{5}|(?:80|9\\d)\\d{7}|(?:26|63)9\\d{6}",[9],0,"0",0,0,0,0,0,[["269(?:0[0-467]|15|5[0-4]|6\\d|[78]0)\\d{4}"],["(?:639(?:0[0-79]|1[019]|[267]\\d|3[09]|40|5[05-9]|9[04-79])|7093[5-7])\\d{4}"],["80\\d{7}"],0,0,0,0,0,["9(?:(?:39|47)8[01]|769\\d)\\d{4}"]]],ZA:["27","00","[1-79]\\d{8}|8\\d{4,9}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],ZM:["260","00","800\\d{6}|(?:21|[579]\\d|63)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[28]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[579]"],"0$1"]],"0"],ZW:["263","00","2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}",[5,6,7,8,9,10],[["(\\d{3})(\\d{3,5})","$1 $2",["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"],"0$1"],["(\\d)(\\d{3})(\\d{2,4})","$1 $2 $3",["[49]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["80"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2","2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)","2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["29[013-9]|39|54"],"0$1"],["(\\d{4})(\\d{3,5})","$1 $2",["(?:25|54)8","258|5483"],"0$1"]],"0"]},nonGeographic:{800:["800",0,"(?:00|[1-9]\\d)\\d{6}",[8],[["(\\d{4})(\\d{4})","$1 $2",["\\d"]]],0,0,0,0,0,0,[0,0,["(?:00|[1-9]\\d)\\d{6}"]]],808:["808",0,"[1-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[1-9]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,["[1-9]\\d{7}"]]],870:["870",0,"7\\d{11}|[235-7]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-7]"]]],0,0,0,0,0,0,[0,["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"],0,0,0,0,0,0,["2\\d{8}",[9]]]],878:["878",0,"10\\d{10}",[12],[["(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["10\\d{10}"]]],881:["881",0,"6\\d{9}|[0-36-9]\\d{8}",[9,10],[["(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[0-37-9]"]],["(\\d)(\\d{3})(\\d{5,6})","$1 $2 $3",["6"]]],0,0,0,0,0,0,[0,["6\\d{9}|[0-36-9]\\d{8}"]]],882:["882",0,"[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?",[7,8,9,10,11,12],[["(\\d{2})(\\d{5})","$1 $2",["16|342"]],["(\\d{2})(\\d{6})","$1 $2",["49"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["1[36]|9"]],["(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["16"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|23|3(?:[15]|4[57])|4|51"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["34"]],["(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["[1-35]"]]],0,0,0,0,0,0,[0,["342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|50\\d{3})\\d{7}",[7,8,9,10,12]],0,0,0,["348[57]\\d{7}",[11]],0,0,["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}"]]],883:["883",0,"(?:[1-4]\\d|51)\\d{6,10}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,8})","$1 $2 $3",["[14]|2[24-689]|3[02-689]|51[24-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["21"]],["(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["51[13]"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[235]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[0-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}"]]],888:["888",0,"\\d{11}",[11],[["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3"]],0,0,0,0,0,0,[0,0,0,0,0,0,["\\d{11}"]]],979:["979",0,"[1359]\\d{8}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[1359]"]]],0,0,0,0,0,0,[0,0,0,["[1359]\\d{8}"]]]}};function jr(t,e){var n=Array.prototype.slice.call(e);return n.push(Kr),t.apply(this,n)}function Hr(t,e){t=t.split("-"),e=e.split("-");for(var n=t[0].split("."),r=e[0].split("."),d=0;d<3;d++){var i=Number(n[d]),o=Number(r[d]);if(i>o)return 1;if(o>i)return-1;if(!isNaN(i)&&isNaN(o))return 1;if(isNaN(i)&&!isNaN(o))return-1}return t[1]&&e[1]?t[1]>e[1]?1:t[1]<e[1]?-1:0:!t[1]&&e[1]?1:t[1]&&!e[1]?-1:0}var Gr={}.constructor;function Vr(t){return null!=t&&t.constructor===Gr}function qr(t){return qr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qr(t)}function Zr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Wr(t,e,n){return e&&function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Jr(r.key),r)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Jr(t){var e=function(t,e){if("object"!=qr(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!=qr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==qr(e)?e:e+""}var Yr=" ext. ",zr=/^\d+$/,Xr=function(){return Wr(function t(e){Zr(this,t),dd(e),this.metadata=e,sd.call(this,e)},[{key:"getCountries",value:function(){return Object.keys(this.metadata.countries).filter(function(t){return"001"!==t})}},{key:"getCountryMetadata",value:function(t){return this.metadata.countries[t]}},{key:"nonGeographic",value:function(){if(!(this.v1||this.v2||this.v3))return this.metadata.nonGeographic||this.metadata.nonGeographical}},{key:"hasCountry",value:function(t){return void 0!==this.getCountryMetadata(t)}},{key:"hasCallingCode",value:function(t){if(this.getCountryCodesForCallingCode(t))return!0;if(this.nonGeographic()){if(this.nonGeographic()[t])return!0}else{var e=this.countryCallingCodes()[t];if(e&&1===e.length&&"001"===e[0])return!0}}},{key:"isNonGeographicCallingCode",value:function(t){return this.nonGeographic()?!!this.nonGeographic()[t]:!this.getCountryCodesForCallingCode(t)}},{key:"country",value:function(t){return this.selectNumberingPlan(t)}},{key:"selectNumberingPlan",value:function(t,e){if(t&&zr.test(t)&&(e=t,t=null),t&&"001"!==t){if(!this.hasCountry(t))throw new Error("Unknown country: ".concat(t));this.numberingPlan=new Qr(this.getCountryMetadata(t),this)}else if(e){if(!this.hasCallingCode(e))throw new Error("Unknown calling code: ".concat(e));this.numberingPlan=new Qr(this.getNumberingPlanMetadata(e),this)}else this.numberingPlan=void 0;return this}},{key:"getCountryCodesForCallingCode",value:function(t){var e=this.countryCallingCodes()[t];if(e){if(1===e.length&&3===e[0].length)return;return e}}},{key:"getCountryCodeForCallingCode",value:function(t){var e=this.getCountryCodesForCallingCode(t);if(e)return e[0]}},{key:"getNumberingPlanMetadata",value:function(t){var e=this.getCountryCodeForCallingCode(t);if(e)return this.getCountryMetadata(e);if(this.nonGeographic()){var n=this.nonGeographic()[t];if(n)return n}else{var r=this.countryCallingCodes()[t];if(r&&1===r.length&&"001"===r[0])return this.metadata.countries["001"]}}},{key:"countryCallingCode",value:function(){return this.numberingPlan.callingCode()}},{key:"IDDPrefix",value:function(){return this.numberingPlan.IDDPrefix()}},{key:"defaultIDDPrefix",value:function(){return this.numberingPlan.defaultIDDPrefix()}},{key:"nationalNumberPattern",value:function(){return this.numberingPlan.nationalNumberPattern()}},{key:"possibleLengths",value:function(){return this.numberingPlan.possibleLengths()}},{key:"formats",value:function(){return this.numberingPlan.formats()}},{key:"nationalPrefixForParsing",value:function(){return this.numberingPlan.nationalPrefixForParsing()}},{key:"nationalPrefixTransformRule",value:function(){return this.numberingPlan.nationalPrefixTransformRule()}},{key:"leadingDigits",value:function(){return this.numberingPlan.leadingDigits()}},{key:"hasTypes",value:function(){return this.numberingPlan.hasTypes()}},{key:"type",value:function(t){return this.numberingPlan.type(t)}},{key:"ext",value:function(){return this.numberingPlan.ext()}},{key:"countryCallingCodes",value:function(){return this.v1?this.metadata.country_phone_code_to_countries:this.metadata.country_calling_codes}},{key:"chooseCountryByCountryCallingCode",value:function(t){return this.selectNumberingPlan(t)}},{key:"hasSelectedNumberingPlan",value:function(){return void 0!==this.numberingPlan}}])}(),Qr=function(){return Wr(function t(e,n){Zr(this,t),this.globalMetadataObject=n,this.metadata=e,sd.call(this,n.metadata)},[{key:"callingCode",value:function(){return this.metadata[0]}},{key:"getDefaultCountryMetadataForRegion",value:function(){return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode())}},{key:"IDDPrefix",value:function(){if(!this.v1&&!this.v2)return this.metadata[1]}},{key:"defaultIDDPrefix",value:function(){if(!this.v1&&!this.v2)return this.metadata[12]}},{key:"nationalNumberPattern",value:function(){return this.v1||this.v2?this.metadata[1]:this.metadata[2]}},{key:"possibleLengths",value:function(){if(!this.v1)return this.metadata[this.v2?2:3]}},{key:"_getFormats",value:function(t){return t[this.v1?2:this.v2?3:4]}},{key:"formats",value:function(){var t=this,e=this._getFormats(this.metadata)||this._getFormats(this.getDefaultCountryMetadataForRegion())||[];return e.map(function(e){return new td(e,t)})}},{key:"nationalPrefix",value:function(){return this.metadata[this.v1?3:this.v2?4:5]}},{key:"_getNationalPrefixFormattingRule",value:function(t){return t[this.v1?4:this.v2?5:6]}},{key:"nationalPrefixFormattingRule",value:function(){return this._getNationalPrefixFormattingRule(this.metadata)||this._getNationalPrefixFormattingRule(this.getDefaultCountryMetadataForRegion())}},{key:"_nationalPrefixForParsing",value:function(){return this.metadata[this.v1?5:this.v2?6:7]}},{key:"nationalPrefixForParsing",value:function(){return this._nationalPrefixForParsing()||this.nationalPrefix()}},{key:"nationalPrefixTransformRule",value:function(){return this.metadata[this.v1?6:this.v2?7:8]}},{key:"_getNationalPrefixIsOptionalWhenFormatting",value:function(){return!!this.metadata[this.v1?7:this.v2?8:9]}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata)||this._getNationalPrefixIsOptionalWhenFormatting(this.getDefaultCountryMetadataForRegion())}},{key:"leadingDigits",value:function(){return this.metadata[this.v1?8:this.v2?9:10]}},{key:"types",value:function(){return this.metadata[this.v1?9:this.v2?10:11]}},{key:"hasTypes",value:function(){return(!this.types()||0!==this.types().length)&&!!this.types()}},{key:"type",value:function(t){if(this.hasTypes()&&rd(this.types(),t))return new nd(rd(this.types(),t),this)}},{key:"ext",value:function(){return this.v1||this.v2?Yr:this.metadata[13]||Yr}}])}(),td=function(){return Wr(function t(e,n){Zr(this,t),this._format=e,this.metadata=n},[{key:"pattern",value:function(){return this._format[0]}},{key:"format",value:function(){return this._format[1]}},{key:"leadingDigitsPatterns",value:function(){return this._format[2]||[]}},{key:"nationalPrefixFormattingRule",value:function(){return this._format[3]||this.metadata.nationalPrefixFormattingRule()}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return!!this._format[4]||this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"nationalPrefixIsMandatoryWhenFormattingInNationalFormat",value:function(){return this.usesNationalPrefix()&&!this.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"usesNationalPrefix",value:function(){return!(!this.nationalPrefixFormattingRule()||ed.test(this.nationalPrefixFormattingRule()))}},{key:"internationalFormat",value:function(){return this._format[5]||this.format()}}])}(),ed=/^\(?\$1\)?$/,nd=function(){return Wr(function t(e,n){Zr(this,t),this.type=e,this.metadata=n},[{key:"pattern",value:function(){return this.metadata.v1?this.type:this.type[0]}},{key:"possibleLengths",value:function(){if(!this.metadata.v1)return this.type[1]||this.metadata.possibleLengths()}}])}();function rd(t,e){switch(e){case"FIXED_LINE":return t[0];case"MOBILE":return t[1];case"TOLL_FREE":return t[2];case"PREMIUM_RATE":return t[3];case"PERSONAL_NUMBER":return t[4];case"VOICEMAIL":return t[5];case"UAN":return t[6];case"PAGER":return t[7];case"VOIP":return t[8];case"SHARED_COST":return t[9]}}function dd(t){if(!t)throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");if(!Vr(t)||!Vr(t.countries))throw new Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat(Vr(t)?"an object of shape: { "+Object.keys(t).join(", ")+" }":"a "+id(t)+": "+t,"."))}var id=function(t){return qr(t)};function od(t,e){if((e=new Xr(e)).hasCountry(t))return e.selectNumberingPlan(t).countryCallingCode();throw new Error("Unknown country: ".concat(t))}function sd(t){var e=t.version;"number"==typeof e?(this.v1=1===e,this.v2=2===e,this.v3=3===e,this.v4=4===e):e?-1===Hr(e,"1.2.0")?this.v2=!0:-1===Hr(e,"1.7.35")?this.v3=!0:this.v4=!0:this.v1=!0}function ad(t,e,n){return function(t,e,n,r){e&&(r=new Xr(r.metadata)).selectNumberingPlan(e);var d=r.type(n),i=d&&d.possibleLengths()||r.possibleLengths();if(!i)return"IS_POSSIBLE";var o=t.length,s=i[0];if(s===o)return"IS_POSSIBLE";if(s>o)return"TOO_SHORT";if(i[i.length-1]<o)return"TOO_LONG";return i.indexOf(o,1)>=0?"IS_POSSIBLE":"INVALID_LENGTH"}(t,e,void 0,n)}function ud(t,e,n){return"IS_POSSIBLE"===ad(t,e,n)}function cd(t,e){return t=t||"",new RegExp("^(?:"+e+")$").test(t)}function $d(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return ld(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ld(t,e):void 0}}(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ld(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var fd=["MOBILE","PREMIUM_RATE","TOLL_FREE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL"];function hd(t,e,n){if(e=e||{},t.country||t.countryCallingCode){(n=new Xr(n)).selectNumberingPlan(t.country,t.countryCallingCode);var r=e.v2?t.nationalNumber:t.phone;if(cd(r,n.nationalNumberPattern())){if(yd(r,"FIXED_LINE",n))return n.type("MOBILE")&&""===n.type("MOBILE").pattern()?"FIXED_LINE_OR_MOBILE":n.type("MOBILE")?yd(r,"MOBILE",n)?"FIXED_LINE_OR_MOBILE":"FIXED_LINE":"FIXED_LINE_OR_MOBILE";for(var d,i=$d(fd);!(d=i()).done;){var o=d.value;if(yd(r,o,n))return o}}}}function yd(t,e,n){return!(!(e=n.type(e))||!e.pattern())&&(!(e.possibleLengths()&&e.possibleLengths().indexOf(t.length)<0)&&cd(t,e.pattern()))}function gd(t,e,n){var r=new Xr(n).getCountryCodesForCallingCode(t);return r?r.filter(function(t){return function(t,e,n){var r=new Xr(n);if(r.selectNumberingPlan(e),r.numberingPlan.possibleLengths().indexOf(t.length)>=0)return!0;return!1}(e,t,n)}):[]}var pd="0-90-9٠-٩۰-۹",md="".concat("-‐-―−ー-").concat("//").concat("..").concat("  ­​⁠ ").concat("()()[]\\[\\]").concat("~⁓∼~"),bd=new RegExp("(["+pd+"])");function wd(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return vd(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vd(t,e):void 0}}(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function vd(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Ed(t,e){var n=e.nationalNumber,r=e.metadata,d=r.getCountryCodesForCallingCode(t);if(d)return 1===d.length?d[0]:function(t,e){var n=e.countries,r=e.metadata;r=new Xr(r);for(var d,i=wd(n);!(d=i()).done;){var o=d.value;if(r.selectNumberingPlan(o),r.leadingDigits()){if(t&&0===t.search(r.leadingDigits()))return o}else if(hd({phone:t,country:o},void 0,r.metadata))return o}}(n,{countries:d,metadata:r.metadata})}function Od(t,e,n){var r=function(t,e){if(t&&e.numberingPlan.nationalPrefixForParsing()){var n=new RegExp("^(?:"+e.numberingPlan.nationalPrefixForParsing()+")"),r=n.exec(t);if(r){var d,i,o,s=r.length-1,a=s>0&&r[s];if(e.nationalPrefixTransformRule()&&a)d=t.replace(n,e.nationalPrefixTransformRule()),s>1&&(i=r[1]);else{var u=r[0];d=t.slice(u.length),a&&(i=r[1])}if(a){var c=t.indexOf(r[1]);t.slice(0,c)===e.numberingPlan.nationalPrefix()&&(o=e.numberingPlan.nationalPrefix())}else o=r[0];return{nationalNumber:d,nationalPrefix:o,carrierCode:i}}}return{nationalNumber:t}}(t,n),d=r.carrierCode,i=r.nationalNumber;if(i!==t){if(!function(t,e,n){if(cd(t,n.nationalNumberPattern())&&!cd(e,n.nationalNumberPattern()))return!1;return!0}(t,i,n))return{nationalNumber:t};if(n.numberingPlan.possibleLengths()&&(e||(e=Ed(n.numberingPlan.callingCode(),{nationalNumber:i,metadata:n})),!function(t,e,n){switch(ad(t,e,n)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}(i,e,n)))return{nationalNumber:t}}return{nationalNumber:i,carrierCode:d}}function Sd(t,e,n,r,d){if(!t)return{};var i;if("+"!==t[0]){var o=function(t,e,n,r){if(e){var d=new Xr(r);d.selectNumberingPlan(e,n);var i=new RegExp(d.IDDPrefix());if(0===t.search(i)){var o=(t=t.slice(t.match(i)[0].length)).match(bd);if(!(o&&null!=o[1]&&o[1].length>0&&"0"===o[1]))return t}}}(t,n,r,d);if(!o||o===t){if(n||r){var s=function(t,e,n,r,d){var i=n?od(n,d):r;if(0===t.indexOf(i)){(d=new Xr(d)).selectNumberingPlan(n,i);var o=t.slice(i.length),s=Od(o,e,d).nationalNumber,a=Od(t,e,d).nationalNumber;if(!cd(a,d.nationalNumberPattern())&&cd(s,d.nationalNumberPattern())||"TOO_LONG"===ad(a,e,d))return{countryCallingCode:i,number:o}}return{number:t}}(t,e,n,r,d),a=s.countryCallingCode,u=s.number;if(a)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:a,number:u}}return{number:t}}i=!0,t="+"+o}if("0"===t[1])return{};d=new Xr(d);for(var c=2;c-1<=3&&c<=t.length;){var $=t.slice(1,c);if(d.hasCallingCode($))return d.selectNumberingPlan($),{countryCallingCodeSource:i?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:$,number:t.slice(c)};c++}return{}}var Pd=/(\$\d)/;function Cd(t,e,n){var r=n.useInternationalFormat,d=n.withNationalPrefix,i=t.replace(new RegExp(e.pattern()),r?e.internationalFormat():d&&e.nationalPrefixFormattingRule()?e.format().replace(Pd,e.nationalPrefixFormattingRule()):e.format());return r?function(t){return t.replace(new RegExp("[".concat(md,"]+"),"g")," ").trim()}(i):i}var Nd=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;var Ad=function(t){return"([".concat(pd,"]{1,").concat(t,"})")};function Id(t){var e="[  \\t,]*",n="[:\\..]?[  \\t,-]*",r="#?",d="[  \\t]*";return";ext="+Ad("20")+"|"+(e+"(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)"+n+Ad("20")+r)+"|"+(e+"(?:[xx##~~]|int|int)"+n+Ad("9")+r)+"|"+("[- ]+"+Ad("6")+"#")+"|"+(d+"(?:,{2}|;)"+n+Ad("15")+r)+"|"+(d+"(?:,)+"+n+Ad("9")+r)}var xd="["+pd+"]{2}",kd="[++]{0,1}(?:["+md+"]*["+pd+"]){3,}["+md+pd+"]*",Td=new RegExp("^[++]{0,1}(?:["+md+"]*["+pd+"]){1,2}$","i"),Bd=kd+"(?:"+Id()+")?",Rd=new RegExp("^"+xd+"$|^"+Bd+"$","i");var Md={formatExtension:function(t,e,n){return"".concat(t).concat(n.ext()).concat(e)}};function _d(t,e,n,r){if(n=n?function(){for(var t=1,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];for(;t<n.length;){if(n[t])for(var d in n[t])n[0][d]=n[t][d];t++}return n[0]}({},Md,n):Md,r=new Xr(r),t.country&&"001"!==t.country){if(!r.hasCountry(t.country))throw new Error("Unknown country: ".concat(t.country));r.selectNumberingPlan(t.country)}else{if(!t.countryCallingCode)return t.phone||"";r.selectNumberingPlan(t.countryCallingCode)}var d,i=r.countryCallingCode(),o=n.v2?t.nationalNumber:t.phone;switch(e){case"NATIONAL":return o?Ud(d=Ld(o,t.carrierCode,"NATIONAL",r,n),t.ext,r,n.formatExtension):"";case"INTERNATIONAL":return o?(d=Ld(o,null,"INTERNATIONAL",r,n),Ud(d="+".concat(i," ").concat(d),t.ext,r,n.formatExtension)):"+".concat(i);case"E.164":return"+".concat(i).concat(o);case"RFC3966":return function(t){var e=t.number,n=t.ext;if(!e)return"";if("+"!==e[0])throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');return"tel:".concat(e).concat(n?";ext="+n:"")}({number:"+".concat(i).concat(o),ext:t.ext});case"IDD":if(!n.fromCountry)return;var s=function(t,e,n,r,d){var i=od(r,d.metadata);if(i===n){var o=Ld(t,e,"NATIONAL",d);return"1"===n?n+" "+o:o}var s=function(t,e,n){var r=new Xr(n);return r.selectNumberingPlan(t,e),r.defaultIDDPrefix()?r.defaultIDDPrefix():Nd.test(r.IDDPrefix())?r.IDDPrefix():void 0}(r,void 0,d.metadata);if(s)return"".concat(s," ").concat(n," ").concat(Ld(t,null,"INTERNATIONAL",d))}(o,t.carrierCode,i,n.fromCountry,r);return Ud(s,t.ext,r,n.formatExtension);default:throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(e,'"'))}}function Ld(t,e,n,r,d){var i,o,s=(i=r.formats(),o=t,function(t,e){for(var n=0;n<t.length;){if(e(t[n]))return t[n];n++}}(i,function(t){if(t.leadingDigitsPatterns().length>0){var e=t.leadingDigitsPatterns()[t.leadingDigitsPatterns().length-1];if(0!==o.search(e))return!1}return cd(o,t.pattern())}));return s?Cd(t,s,{useInternationalFormat:"INTERNATIONAL"===n,withNationalPrefix:!s.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!d||!1!==d.nationalPrefix}):t}function Ud(t,e,n,r){return e?r(t,e,n):t}function Fd(t){return Fd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fd(t)}function Dd(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function Kd(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Dd(Object(n),!0).forEach(function(e){jd(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Dd(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function jd(t,e,n){return(e=Gd(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Hd(t,e,n){return e&&function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Gd(r.key),r)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Gd(t){var e=function(t,e){if("object"!=Fd(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!=Fd(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==Fd(e)?e:e+""}var Vd=function(){return Hd(function t(e,n,r){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),!e)throw new TypeError("First argument is required");if("string"!=typeof e)throw new TypeError("First argument must be a string");if("+"===e[0]&&!n)throw new TypeError("`metadata` argument not passed");if(Vr(n)&&Vr(n.countries)){r=n;var d=e;if(!Zd.test(d))throw new Error('Invalid `number` argument passed: must consist of a "+" followed by digits');var i=Sd(d,void 0,void 0,void 0,r);if(e=i.countryCallingCode,!(n=i.number))throw new Error("Invalid `number` argument passed: too short")}if(!n)throw new TypeError("`nationalNumber` argument is required");if("string"!=typeof n)throw new TypeError("`nationalNumber` argument must be a string");dd(r);var o=function(t,e){var n,r,d=new Xr(e);qd(t)?(n=t,d.selectNumberingPlan(n),r=d.countryCallingCode()):r=t;return{country:n,countryCallingCode:r}}(e,r),s=o.country,a=o.countryCallingCode;this.country=s,this.countryCallingCode=a,this.nationalNumber=n,this.number="+"+this.countryCallingCode+this.nationalNumber,this.getMetadata=function(){return r}},[{key:"setExt",value:function(t){this.ext=t}},{key:"getPossibleCountries",value:function(){return this.country?[this.country]:gd(this.countryCallingCode,this.nationalNumber,this.getMetadata())}},{key:"isPossible",value:function(){return function(t,e,n){if(void 0===e&&(e={}),n=new Xr(n),e.v2){if(!t.countryCallingCode)throw new Error("Invalid phone number object passed");n.selectNumberingPlan(t.countryCallingCode)}else{if(!t.phone)return!1;if(t.country){if(!n.hasCountry(t.country))throw new Error("Unknown country: ".concat(t.country));n.selectNumberingPlan(t.country)}else{if(!t.countryCallingCode)throw new Error("Invalid phone number object passed");n.selectNumberingPlan(t.countryCallingCode)}}if(n.possibleLengths())return ud(t.phone||t.nationalNumber,t.country,n);if(t.countryCallingCode&&n.isNonGeographicCallingCode(t.countryCallingCode))return!0;throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.')}(this,{v2:!0},this.getMetadata())}},{key:"isValid",value:function(){return function(t,e,n){return e=e||{},(n=new Xr(n)).selectNumberingPlan(t.country,t.countryCallingCode),n.hasTypes()?void 0!==hd(t,e,n.metadata):cd(e.v2?t.nationalNumber:t.phone,n.nationalNumberPattern())}(this,{v2:!0},this.getMetadata())}},{key:"isNonGeographic",value:function(){return new Xr(this.getMetadata()).isNonGeographicCallingCode(this.countryCallingCode)}},{key:"isEqual",value:function(t){return this.number===t.number&&this.ext===t.ext}},{key:"getType",value:function(){return hd(this,{v2:!0},this.getMetadata())}},{key:"format",value:function(t,e){return _d(this,t,e?Kd(Kd({},e),{},{v2:!0}):{v2:!0},this.getMetadata())}},{key:"formatNational",value:function(t){return this.format("NATIONAL",t)}},{key:"formatInternational",value:function(t){return this.format("INTERNATIONAL",t)}},{key:"getURI",value:function(t){return this.format("RFC3966",t)}}])}(),qd=function(t){return/^[A-Z]{2}$/.test(t)};var Zd=/^\+\d+$/;function Wd(t){return Wd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wd(t)}function Jd(t,e,n){return e=Qd(e),function(t,e){if(e&&("object"==Wd(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,zd()?Reflect.construct(e,n||[],Qd(t).constructor):e.apply(t,n))}function Yd(t){var e="function"==typeof Map?new Map:void 0;return Yd=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if(zd())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var d=new(t.bind.apply(t,r));return n&&Xd(d,n.prototype),d}(t,arguments,Qd(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Xd(n,t)},Yd(t)}function zd(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(zd=function(){return!!t})()}function Xd(t,e){return Xd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Xd(t,e)}function Qd(t){return Qd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Qd(t)}var ti=function(){function t(e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),n=Jd(this,t,[e]),Object.setPrototypeOf(n,t.prototype),n.name=n.constructor.name,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Xd(t,e)}(t,Yd(Error)),e=t,Object.defineProperty(e,"prototype",{writable:!1}),e;var e}(),ei=new RegExp("(?:"+Id()+")$","i");var ni={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9"};function ri(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return di(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?di(t,e):void 0}}(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function di(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function ii(t){for(var e,n="",r=ri(t.split(""));!(e=r()).done;){n+=oi(e.value,n)||""}return n}function oi(t,e,n){if("+"===t){if(e)return;return"+"}return function(t){return ni[t]}(t)}var si="(["+pd+"]|[\\-\\.\\(\\)]?)",ai=new RegExp("^\\+"+si+"*["+pd+"]"+si+"*$","g"),ui=new RegExp("^("+("["+pd+"]+((\\-)*["+pd+"])*")+"\\.)*"+("[a-zA-Z]+((\\-)*["+pd+"])*")+"\\.?$","g"),ci="tel:",$i=";phone-context=";function li(t,e){var n,r=e.extractFormattedPhoneNumber,d=function(t){var e=t.indexOf($i);if(e<0)return null;var n=e+15;if(n>=t.length)return"";var r=t.indexOf(";",n);return r>=0?t.substring(n,r):t.substring(n)}(t);if(!function(t){return null===t||0!==t.length&&(ai.test(t)||ui.test(t))}(d))throw new ti("NOT_A_NUMBER");if(null===d)n=r(t)||"";else{n="","+"===d.charAt(0)&&(n+=d);var i,o=t.indexOf(ci);i=o>=0?o+4:0;var s=t.indexOf($i);n+=t.substring(i,s)}var a=n.indexOf(";isub=");if(a>0&&(n=n.substring(0,a)),""!==n)return n}var fi=new RegExp("[++"+pd+"]"),hi=new RegExp("[^"+pd+"#]+$");function yi(t,e,n){if(e=e||{},n=new Xr(n),e.defaultCountry&&!n.hasCountry(e.defaultCountry)){if(e.v2)throw new ti("INVALID_COUNTRY");throw new Error("Unknown country: ".concat(e.defaultCountry))}var r=function(t,e,n){var r=li(t,{extractFormattedPhoneNumber:function(t){return function(t,e,n){if(!t)return;if(t.length>250){if(n)throw new ti("TOO_LONG");return}if(!1===e)return t;var r=t.search(fi);if(r<0)return;return t.slice(r).replace(hi,"")}(t,n,e)}});if(!r)return{};if(!function(t){return t.length>=2&&Rd.test(t)}(r))return function(t){return Td.test(t)}(r)?{error:"TOO_SHORT"}:{};var d=function(t){var e=t.search(ei);if(e<0)return{};for(var n=t.slice(0,e),r=t.match(ei),d=1;d<r.length;){if(r[d])return{number:n,ext:r[d]};d++}}(r);if(d.ext)return d;return{number:r}}(t,e.v2,e.extract),d=r.number,i=r.ext,o=r.error;if(!d){if(e.v2){if("TOO_SHORT"===o)throw new ti("TOO_SHORT");throw new ti("NOT_A_NUMBER")}return{}}var s=function(t,e,n,r){var d,i=Sd(ii(t),void 0,e,n,r.metadata),o=i.countryCallingCodeSource,s=i.countryCallingCode,a=i.number;if(s)r.selectNumberingPlan(s);else{if(!a||!e&&!n)return{};r.selectNumberingPlan(e,n),e&&(d=e),s=n||od(e,r.metadata)}if(!a)return{countryCallingCodeSource:o,countryCallingCode:s};var u=Od(ii(a),d,r),c=u.nationalNumber,$=u.carrierCode,l=Ed(s,{nationalNumber:c,metadata:r});l&&(d=l,"001"===l||r.selectNumberingPlan(d));return{country:d,countryCallingCode:s,countryCallingCodeSource:o,nationalNumber:c,carrierCode:$}}(d,e.defaultCountry,e.defaultCallingCode,n),a=s.country,u=s.nationalNumber,c=s.countryCallingCode,$=s.countryCallingCodeSource,l=s.carrierCode;if(!n.hasSelectedNumberingPlan()){if(e.v2)throw new ti("INVALID_COUNTRY");return{}}if(!u||u.length<2){if(e.v2)throw new ti("TOO_SHORT");return{}}if(u.length>17){if(e.v2)throw new ti("TOO_LONG");return{}}if(e.v2){var f=new Vd(c,u,n.metadata);return a&&(f.country=a),l&&(f.carrierCode=l),i&&(f.ext=i),f.__countryCallingCodeSource=$,f}var h=!!(e.extended?n.hasSelectedNumberingPlan():a)&&cd(u,n.nationalNumberPattern());return e.extended?{country:a,countryCallingCode:c,carrierCode:l,valid:h,possible:!!h||!(!0!==e.extended||!n.possibleLengths()||!ud(u,a,n)),phone:u,ext:i}:h?function(t,e,n){var r={country:t,phone:e};n&&(r.ext=n);return r}(a,u,i):{}}function gi(t){return gi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gi(t)}function pi(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function mi(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?pi(Object(n),!0).forEach(function(e){bi(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):pi(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function bi(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=gi(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!=gi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==gi(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function wi(t,e,n){return yi(t,mi(mi({},e),{},{v2:!0}),n)}function vi(t){return vi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vi(t)}function Ei(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function Oi(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=vi(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!=vi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==vi(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Si(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,d,i,o,s=[],a=!0,u=!1;try{if(i=(n=n.call(t)).next,0===e);else for(;!(a=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);a=!0);}catch(t){u=!0,d=t}finally{try{if(!a&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw d}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Pi(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Pi(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Ci(t){var e,n,r,d=Si(Array.prototype.slice.call(t),4),i=d[0],o=d[1],s=d[2],a=d[3];if("string"!=typeof i)throw new TypeError("A text for parsing must be a string.");if(e=i,o&&"string"!=typeof o){if(!Vr(o))throw new Error("Invalid second argument: ".concat(o));s?(n=o,r=s):r=o}else a?(n=s,r=a):(n=void 0,r=s),o&&(n=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ei(Object(n),!0).forEach(function(e){Oi(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ei(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({defaultCountry:o},n));return{text:e,options:n,metadata:r}}function Ni(){var t=Ci(arguments);return wi(t.text,t.options,t.metadata)}function Ai(t){return Ai="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ai(t)}function Ii(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function xi(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ii(Object(n),!0).forEach(function(e){ki(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ii(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function ki(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=Ai(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!=Ai(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ai(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ti(t){return Ti="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ti(t)}function Bi(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function Ri(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Bi(Object(n),!0).forEach(function(e){Mi(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Bi(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function Mi(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=Ti(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!=Ti(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ti(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _i(){var t=Ci(arguments),e=t.text,n=t.options,r=t.metadata,d=function(t,e,n){e&&e.defaultCountry&&!function(t,e){return e.countries.hasOwnProperty(t)}(e.defaultCountry,n)&&(e=xi(xi({},e),{},{defaultCountry:void 0}));try{return wi(t,e,n)}catch(t){if(!(t instanceof ti))throw t}}(e,n=Ri(Ri({},n),{},{extract:!1}),r);return d&&d.isValid()||!1}function Li(){return jr(Ni,arguments)}function Ui(){return jr(_i,arguments)}async function Fi(){if(void 0!==globalThis.crypto?.subtle)return globalThis.crypto;return(await import("crypto")).webcrypto}const Di=3,Ki=20,ji="US";function Hi(t){const e=(new TextEncoder).encode(t);return l(He(e))}function Gi(t){if(t.startsWith("+"))return!0;const e=t.replace(/\D/g,"").length;if(e<7)return!1;return e/t.replace(/[\s\-().]/g,"").length>.5}function Vi(t,e){try{if(Ui(t,e)){return Li(t,e).format("E.164")}if(Ui(t)){return Li(t).format("E.164")}return null}catch{return null}}function qi(t,e=ji){const n=t.trim();if(Gi(n)){const t=Vi(n,e);if(t)return t}let r=n.toLowerCase();return r.endsWith("@unicity")&&(r=r.slice(0,-8)),r}function Zi(t,e=ji){return Hi("unicity:nametag:"+qi(t,e))}function Wi(t,e,n=ji){return qi(t,n)===qi(e,n)}function Ji(t,e=ji){const n=t.trim();if(Gi(n)){const t=Vi(n,e);if(t){const e=t.slice(1);if(e.length>6){return"+"+e.slice(0,4)+"***"+e.slice(-4)}}}return qi(t,e)}function Yi(t,e=ji){try{return Ui(t,e)||Ui(t)}catch{return!1}}function zi(t,e=ji){const n=qi(t.startsWith("@")?t.slice(1):t,e);if(Yi(n))return!0;return new RegExp("^[a-z0-9_-]{3,20}$").test(n)}function Xi(t){return Hi("unicity:address:"+t)}function Qi(t){const e=function(t){const e=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2)e[n/2]=parseInt(t.substring(n,n+2),16);return e}(t),n=(new TextEncoder).encode("sphere-nametag-salt"),r=He(n),d=(new TextEncoder).encode("nametag-encryption");return Un(He,e,r,d,32)}async function to(t,e){const n=await Fi(),r=Qi(e),d=n.getRandomValues(new Uint8Array(12)),i=(new TextEncoder).encode(t),o=await n.subtle.importKey("raw",new Uint8Array(r).buffer,{name:"AES-GCM"},!1,["encrypt"]),s=await n.subtle.encrypt({name:"AES-GCM",iv:new Uint8Array(d).buffer},o,new Uint8Array(i).buffer),a=new Uint8Array(d.length+s.byteLength);return a.set(d,0),a.set(new Uint8Array(s),d.length),u=a,"undefined"!=typeof Buffer?Buffer.from(u).toString("base64"):btoa(String.fromCharCode(...Array.from(u)));var u}async function eo(t,e){try{const r=await Fi(),d=Qi(e),i=(n=t,"undefined"!=typeof Buffer?new Uint8Array(Buffer.from(n,"base64")):Uint8Array.from(atob(n),t=>t.charCodeAt(0))),o=i.slice(0,12),s=i.slice(12),a=await r.subtle.importKey("raw",new Uint8Array(d).buffer,{name:"AES-GCM"},!1,["decrypt"]),u=await r.subtle.decrypt({name:"AES-GCM",iv:new Uint8Array(o).buffer},a,new Uint8Array(s).buffer);return(new TextDecoder).decode(u)}catch{return null}var n}var no=Object.freeze({__proto__:null,NAMETAG_MAX_LENGTH:20,NAMETAG_MIN_LENGTH:3,areSameNametag:Wi,decryptNametag:eo,encryptNametag:to,formatForDisplay:Ji,hashAddressForTag:Xi,hashNametag:Zi,isPhoneNumber:Yi,isValidNametag:zi,normalizeNametag:qi,sha256Hex:Hi});async function ro(t,e,n,r="US",d){if(!zi(e,r))throw new Error(`Invalid nametag: "${e}". Must be 3-20 chars [a-z0-9_-] or a valid phone number.`);const i=Zi(e,r),o={nametag_hash:i,address:n,verified:Math.floor(Date.now()/1e3)},s=[["d",i],["nametag",i],["t",i],["address",n],["t",Xi(n)]];if(d){const n=await to(e,t.getPrivateKeyHex());o.encrypted_nametag=n,o.nametag=e,d.publicKey&&(o.public_key=d.publicKey,s.push(["t",Xi(d.publicKey)]),s.push(["pubkey",d.publicKey])),d.l1Address&&(o.l1_address=d.l1Address,s.push(["t",Xi(d.l1Address)]),s.push(["l1",d.l1Address])),d.directAddress&&(o.direct_address=d.directAddress,s.push(["t",Xi(d.directAddress)])),d.proxyAddress&&(o.proxy_address=d.proxyAddress,s.push(["t",Xi(d.proxyAddress)]))}return Xn.create(t,{kind:hr,tags:s,content:JSON.stringify(o)})}function io(t,e){const n={},r=[["d",Hi("unicity:identity:"+t.getPublicKeyHex())]];return e.publicKey&&(n.public_key=e.publicKey,r.push(["t",Xi(e.publicKey)])),e.l1Address&&(n.l1_address=e.l1Address,r.push(["t",Xi(e.l1Address)])),e.directAddress&&(n.direct_address=e.directAddress,r.push(["t",Xi(e.directAddress)])),e.proxyAddress&&(n.proxy_address=e.proxyAddress,r.push(["t",Xi(e.proxyAddress)])),Xn.create(t,{kind:hr,tags:r,content:JSON.stringify(n)})}function oo(t,e="US"){const n=Zi(t,e);return Qn.builder().kinds(hr).tTags(n).build()}function so(t){const e=Xi(t);return Qn.builder().kinds(hr).tTags(e).build()}function ao(t){return Qn.builder().kinds(hr).authors(t).limit(10).build()}function uo(t){try{const e=JSON.parse(t.content);return{transportPubkey:t.pubkey,publicKey:e.public_key,l1Address:e.l1_address,directAddress:e.direct_address,proxyAddress:e.proxy_address,nametag:e.nametag,timestamp:1e3*t.created_at}}catch(e){return"undefined"!=typeof console&&console.warn(`[nostr-sdk] Failed to parse binding event content (event ${t.id?.slice(0,8)}):`,e),{transportPubkey:t.pubkey,timestamp:1e3*t.created_at}}}function co(t){const e=t.getTagValue("nametag");if(e)return e;const n=t.getTagValue("d");if(n)return n;try{return JSON.parse(t.content).nametag_hash}catch{return}}function $o(t){const e=t.getTagValue("address");if(e)return e;try{return JSON.parse(t.content).address}catch{return}}function lo(t){if(t.kind!==hr)return!1;if(!t.hasTag("d"))return!1;try{const e=JSON.parse(t.content);if(!e.nametag_hash||!e.address)return!1}catch{return!1}return t.verify()}var fo=Object.freeze({__proto__:null,createAddressToBindingFilter:so,createBindingEvent:ro,createIdentityBindingEvent:io,createNametagToPubkeyFilter:oo,createPubkeyToNametagFilter:ao,isValidBindingEvent:lo,parseAddressFromEvent:$o,parseBindingInfo:uo,parseNametagHashFromEvent:co});const ho="__nostr-sdk-keepalive__";class yo{keyManager;relays=new Map;subscriptions=new Map;eventQueue=[];pendingOks=new Map;subscriptionCounter=0;closed=!1;queryTimeoutMs;autoReconnect;reconnectIntervalMs;maxReconnectIntervalMs;pingIntervalMs;connectionListeners=[];constructor(t,e){this.keyManager=t,this.queryTimeoutMs=e?.queryTimeoutMs??5e3,this.autoReconnect=e?.autoReconnect??!0,this.reconnectIntervalMs=e?.reconnectIntervalMs??1e3,this.maxReconnectIntervalMs=e?.maxReconnectIntervalMs??3e4,this.pingIntervalMs=e?.pingIntervalMs??3e4}setKeyManager(t){this.keyManager=t}getKeyManager(){return this.keyManager}addConnectionListener(t){this.connectionListeners.push(t)}removeConnectionListener(t){const e=this.connectionListeners.indexOf(t);-1!==e&&this.connectionListeners.splice(e,1)}emitConnectionEvent(t,e,n){for(const r of this.connectionListeners)try{switch(t){case"connect":r.onConnect?.(e);break;case"disconnect":r.onDisconnect?.(e,n);break;case"reconnecting":r.onReconnecting?.(e,n);break;case"reconnected":r.onReconnected?.(e)}}catch{}}getQueryTimeout(){return this.queryTimeoutMs}setQueryTimeout(t){this.queryTimeoutMs=t}async connect(...t){if(this.closed)throw new Error("Client has been disconnected");const e=t.map(t=>this.connectToRelay(t));await Promise.all(e)}async connectToRelay(t,e=!1){const n=this.relays.get(t);if(!n?.connected)return new Promise((r,d)=>{let i=!1,o=null;const s=setTimeout(()=>{if(i=!0,o)try{o.close(1e3,"Connection setup timed out")}catch{}d(new Error(`Connection to ${t} timed out`))},3e4);xr(t).then(a=>{if(i){try{a.close(1e3,"Connection setup timed out")}catch{}return}o=a;const u={url:t,socket:a,connected:!1,reconnecting:!1,reconnectAttempts:0,reconnectTimer:null,pingTimer:null,lastPongTime:Date.now(),unansweredPings:0,wasConnected:n?.wasConnected??!1,closedSubIds:new Set,eosedSubIds:new Set};a.onopen=()=>{if(i)try{a.close(1e3,"Connection setup timed out")}catch{}else clearTimeout(s),u.connected=!0,u.reconnectAttempts=0,u.lastPongTime=Date.now(),this.relays.set(t,u),e&&u.wasConnected?this.emitConnectionEvent("reconnected",t):this.emitConnectionEvent("connect",t),u.wasConnected=!0,this.startPingTimer(t),this.resubscribeAll(t),this.flushEventQueue(),r()},a.onmessage=e=>{try{const n=kr(e),r=this.relays.get(t);r&&(r.lastPongTime=Date.now(),r.unansweredPings=0),this.handleRelayMessage(t,n)}catch(e){console.error(`Error handling message from ${t}:`,e)}},a.onclose=e=>{const n=u.connected;if(u.connected=!1,this.stopPingTimer(t),n||i||(i=!0,clearTimeout(s),d(new Error(`Connection to ${t} closed during handshake: ${e?.reason||"no reason"}`))),n){const n=e?.reason||"Connection closed";this.emitConnectionEvent("disconnect",t,n);const r=Array.from(this.subscriptions.entries());for(const[e,d]of r)try{d.listener.onError?.(e,`Relay disconnected (${t}): ${n}`)}catch{}}this.closed||!this.autoReconnect||u.reconnecting||this.scheduleReconnect(t)},a.onerror=e=>{u.connected||(clearTimeout(s),d(new Error(`Failed to connect to ${t}: ${e.message||"Unknown error"}`)))}}).catch(t=>{clearTimeout(s),d(t)})})}scheduleReconnect(t){const e=this.relays.get(t);if(!e||this.closed||!this.autoReconnect)return;e.reconnectTimer&&clearTimeout(e.reconnectTimer),e.reconnecting=!0,e.reconnectAttempts++;const n=this.reconnectIntervalMs*Math.pow(2,e.reconnectAttempts-1),r=Math.min(n,this.maxReconnectIntervalMs);this.emitConnectionEvent("reconnecting",t,e.reconnectAttempts),e.reconnectTimer=setTimeout(async()=>{if(!this.closed){e.reconnectTimer=null;try{e.reconnecting=!1,await this.connectToRelay(t,!0)}catch{!this.closed&&this.autoReconnect&&this.scheduleReconnect(t)}}},r)}startPingTimer(t){if(this.pingIntervalMs<=0)return;const e=this.relays.get(t);e&&(this.stopPingTimer(t),e.pingTimer=setInterval(()=>{if(!e.connected||!e.socket)return void this.stopPingTimer(t);const n=Date.now()-e.lastPongTime;if(n>2*this.pingIntervalMs&&e.unansweredPings>=2){console.warn(`Relay ${t} appears stale (no response for ${n}ms, ${e.unansweredPings} unanswered pings), reconnecting...`),this.stopPingTimer(t);try{e.socket.close()}catch{}}else try{const t=this.keyManager.getPublicKeyHex(),n=JSON.stringify(["CLOSE",ho]);e.socket.send(n);const r=JSON.stringify(["REQ",ho,{authors:[t],limit:1}]);e.socket.send(r),e.unansweredPings++}catch{console.warn(`Ping to ${t} failed, reconnecting...`),this.stopPingTimer(t);try{e.socket.close()}catch{}}},this.pingIntervalMs))}stopPingTimer(t){const e=this.relays.get(t);e?.pingTimer&&(clearInterval(e.pingTimer),e.pingTimer=null)}resubscribeAll(t){const e=this.relays.get(t);if(e?.socket&&e.connected)for(const[t,n]of this.subscriptions){if(e.closedSubIds.has(t))continue;const r=JSON.stringify(["REQ",t,n.filter.toJSON()]);e.socket.send(r)}}flushEventQueue(){const t=[...this.eventQueue];this.eventQueue=[];for(const e of t)this.broadcastEvent(e.event).then(()=>e.resolve(e.event.id)).catch(e.reject)}handleRelayMessage(t,e){try{const n=JSON.parse(e);if(!Array.isArray(n)||n.length<2)return;switch(n[0]){case"EVENT":this.handleEventMessage(n);break;case"OK":this.handleOkMessage(n);break;case"EOSE":this.handleEOSEMessage(t,n);break;case"NOTICE":this.handleNoticeMessage(n);break;case"CLOSED":this.handleClosedMessage(t,n);break;case"AUTH":this.handleAuthMessage(t,n)}}catch{}}handleEventMessage(t){if(t.length<3||"string"!=typeof t[1])return;const e=t[1],n=t[2],r=this.subscriptions.get(e);if(r)try{const t=Xn.fromJSON(n);r.listener.onEvent(t)}catch{}}handleOkMessage(t){if(t.length<4)return;const e=t[1],n=t[2],r=t[3],d=this.pendingOks.get(e);d&&(clearTimeout(d.timer),this.pendingOks.delete(e),n?d.resolve(e):d.reject(new Error(`Event rejected: ${r}`)))}handleEOSEMessage(t,e){if(e.length<2||"string"!=typeof e[1])return;const n=e[1];if(!this.subscriptions.has(n))return;const r=this.relays.get(t);r&&r.eosedSubIds.add(n);const d=this.subscriptions.get(n);d?.listener.onEndOfStoredEvents&&d.listener.onEndOfStoredEvents(n)}handleNoticeMessage(t){if(t.length<2)return;const e=t[1];console.warn("Relay notice:",e)}handleClosedMessage(t,e){if(e.length<2||"string"!=typeof e[1])return;const n=e[1];if(!this.subscriptions.has(n))return;const r="string"==typeof e[2]?e[2]:"no reason provided",d="auth-required"===r||r.startsWith("auth-required:")||r.startsWith("auth-required "),i=this.relays.get(t);i&&!d&&i.closedSubIds.add(n);const o=this.subscriptions.get(n);o?.listener.onError&&o.listener.onError(n,r)}handleAuthMessage(t,e){if(e.length<2)return;const n=e[1],r=this.relays.get(t);if(!r?.socket||!r.connected)return;const d=Xn.create(this.keyManager,{kind:fr,tags:[["relay",t],["challenge",n]],content:""}),i=JSON.stringify(["AUTH",d.toJSON()]);r.socket.send(i),setTimeout(()=>{const e=this.relays.get(t);e&&e.eosedSubIds.clear(),this.resubscribeAll(t)},100)}disconnect(){this.closed=!0;for(const[,t]of this.pendingOks)clearTimeout(t.timer),t.reject(new Error("Client disconnected"));this.pendingOks.clear();for(const t of this.eventQueue)t.reject(new Error("Client disconnected"));this.eventQueue=[];for(const[t,e]of this.relays)e.connected=!1,e.pingTimer&&(clearInterval(e.pingTimer),e.pingTimer=null),e.reconnectTimer&&(clearTimeout(e.reconnectTimer),e.reconnectTimer=null),e.socket&&3!==e.socket.readyState&&e.socket.close(1e3,"Client disconnected"),this.emitConnectionEvent("disconnect",t,"Client disconnected");const t=Array.from(this.subscriptions.entries());for(const[e,n]of t)try{n.listener.onError?.(e,"Client disconnected")}catch{}this.relays.clear(),this.subscriptions.clear()}isConnected(){for(const[,t]of this.relays)if(t.connected)return!0;return!1}getConnectedRelays(){const t=new Set;for(const[e,n]of this.relays)n.connected&&t.add(e);return t}async publishEvent(t){if(this.closed)throw new Error("Client has been disconnected");return this.isConnected()?this.broadcastEvent(t):new Promise((e,n)=>{this.eventQueue.push({event:t,timestamp:Date.now(),resolve:e,reject:n})})}async broadcastEvent(t){const e=JSON.stringify(["EVENT",t.toJSON()]);let n=!1;for(const[,t]of this.relays)t.connected&&1===t.socket?.readyState&&(t.socket.send(e),n=!0);if(!n)throw new Error("No connected relays");return new Promise((e,n)=>{const r=setTimeout(()=>{this.pendingOks.delete(t.id),e(t.id)},5e3);this.pendingOks.set(t.id,{resolve:e,reject:n,timer:r})})}async publishEncryptedMessage(t,e){const n=await this.keyManager.encryptHex(e,t),r=Xn.create(this.keyManager,{kind:4,tags:[["p",t]],content:n});return this.publishEvent(r)}async sendTokenTransfer(t,e,n){const r=await Promise.resolve().then(function(){return mo}),d=await r.createTokenTransferEvent(this.keyManager,t,e,n);return this.publishEvent(d)}async sendPaymentRequest(t,e){const n=await Promise.resolve().then(function(){return Oo}),r=await n.createPaymentRequestEvent(this.keyManager,t,e);return this.publishEvent(r)}async sendPaymentRequestResponse(t,e){const n=await Promise.resolve().then(function(){return Oo}),r=await n.createPaymentRequestResponseEvent(this.keyManager,t,{requestId:e.requestId,originalEventId:e.originalEventId,status:"DECLINED"===e.status?n.ResponseStatus.DECLINED:n.ResponseStatus.EXPIRED,reason:e.reason});return this.publishEvent(r)}async sendPaymentRequestDecline(t,e,n,r){return this.sendPaymentRequestResponse(t,{requestId:n,originalEventId:e,status:"DECLINED",reason:r})}async publishNametagBinding(t,e,n){const r=await this.queryPubkeyByNametag(t);if(r&&r!==this.keyManager.getPublicKeyHex())throw new Error(`Nametag "${t}" is already claimed by another pubkey`);const d=await ro(this.keyManager,t,e,void 0,n);try{return await this.publishEvent(d),!0}catch{return!1}}async publishIdentityBinding(t){const e=io(this.keyManager,t);try{return await this.publishEvent(e),!0}catch{return!1}}subscribe(t,e,n){let r,d,i;if("string"==typeof t?(r=t,d=e,i=n):(r="sub_"+ ++this.subscriptionCounter,d=t,i=e),r.startsWith("__nostr-sdk-"))throw new Error(`Subscription ID "${r}" uses the reserved "__nostr-sdk-" prefix — pick a different id.`);this.subscriptions.set(r,{filter:d,listener:i});for(const[,t]of this.relays)t.closedSubIds.delete(r),t.eosedSubIds.delete(r);const o=JSON.stringify(["REQ",r,d.toJSON()]);for(const[,t]of this.relays)t.connected&&1===t.socket?.readyState&&t.socket.send(o);return r}unsubscribe(t){if(!this.subscriptions.has(t))return;this.subscriptions.delete(t);const e=JSON.stringify(["CLOSE",t]);for(const[,n]of this.relays)n.connected&&1===n.socket?.readyState&&!n.closedSubIds.has(t)&&n.socket.send(e),n.closedSubIds.delete(t),n.eosedSubIds.delete(t)}queryWithFirstSeenWins(t,e){return new Promise(n=>{let r,d="",i=!1;const o=(t,e)=>{if(i)return;i=!0,void 0!==r&&clearTimeout(r);const o=e||d;o&&this.unsubscribe(o),n(t)};r=setTimeout(()=>o(null),this.queryTimeoutMs);const s=new Map,a=t=>this.allRelaysDoneFor(t),u=()=>{let t=null,n="";for(const[e,r]of s)(!t||r.firstSeen<t.firstSeen||r.firstSeen===t.firstSeen&&e<n)&&(t=r,n=e);return t?e(t.latestEvent):null};d=this.subscribe(t,{onEvent:t=>{if(!t.verify())return;const e=s.get(t.pubkey);e?(t.created_at<e.firstSeen&&(e.firstSeen=t.created_at),t.created_at>e.latestEvent.created_at&&(e.latestEvent=t)):s.set(t.pubkey,{firstSeen:t.created_at,latestEvent:t})},onEndOfStoredEvents:t=>{a(t)&&o(u(),t)},onError:(t,e)=>{console.warn(`Subscription error on ${t}: ${e}`),a(t)&&o(u(),t)}})})}allRelaysDoneFor(t){const e=Array.from(this.relays.values()).filter(t=>t.connected);return 0===e.length||e.every(e=>e.eosedSubIds.has(t)||e.closedSubIds.has(t))}async queryPubkeyByNametag(t){return this.queryWithFirstSeenWins(oo(t),t=>t.pubkey)}async queryBindingByNametag(t){return this.queryWithFirstSeenWins(oo(t),uo)}async queryBindingByAddress(t){return this.queryWithFirstSeenWins(so(t),uo)}async createAndPublishEvent(t){const e=Xn.create(this.keyManager,t);return this.publishEvent(e)}async sendPrivateMessage(t,e,n){const r=Br(this.keyManager,t,e,n);return this.publishEvent(r)}async sendPrivateMessageToNametag(t,e,n){const r=await this.queryPubkeyByNametag(t);if(!r)throw new Error(`Nametag not found: ${t}`);return this.sendPrivateMessage(r,e,n)}async sendReadReceipt(t,e){const n=Rr(this.keyManager,t,e);return this.publishEvent(n)}unwrapPrivateMessage(t){return Mr(t,this.keyManager)}}class go{eventCallback;eoseCallback;errorCallback;constructor(t,e,n){this.eventCallback=t,this.eoseCallback=e,this.errorCallback=n}onEvent(t){this.eventCallback(t)}onEndOfStoredEvents(t){this.eoseCallback?.(t)}onError(t,e){this.errorCallback?.(t,e)}}const po="token_transfer:";var mo=Object.freeze({__proto__:null,createTokenTransferEvent:async function(t,e,n,r,d){let i,o,s;void 0!==r&&"object"==typeof r?(i=r.amount,o=r.symbol,s=r.replyToEventId):(i=r,o=d);const a=po+n,u=await t.encryptHex(a,e),c=[["p",e],["type","token_transfer"]];return void 0!==i&&c.push(["amount",String(i)]),void 0!==o&&c.push(["symbol",o]),void 0!==s&&s.length>0&&c.push(["e",s,"","reply"]),Xn.create(t,{kind:pr,tags:c,content:u})},getAmount:function(t){const e=t.getTagValue("amount");if(void 0!==e)try{return BigInt(e)}catch{return}},getRecipient:function(t){return t.getTagValue("p")},getReplyToEventId:function(t){return t.getTagValue("e")},getSender:function(t){return t.pubkey},getSymbol:function(t){return t.getTagValue("symbol")},isTokenTransfer:function(t){return t.kind===pr&&"token_transfer"===t.getTagValue("type")},parseTokenTransfer:async function(t,e){if(t.kind!==pr)throw new Error("Event is not a token transfer");if("token_transfer"!==t.getTagValue("type"))throw new Error("Event type is not token_transfer");let n,r;if(e.isMyPublicKey(t.pubkey)){const e=t.getTagValue("p");if(!e)throw new Error("No recipient found in event");n=e}else n=t.pubkey;try{r=await e.decryptHex(t.content,n)}catch(e){try{const{hexToBytes:e}=await Promise.resolve().then(function(){return N});r=(new TextDecoder).decode(e(t.content))}catch{throw e}}if(!r.startsWith(po))throw new Error("Invalid token transfer format");return r.slice(15)}});const bo="payment_request:",wo="payment_request_response:",vo=3e5;var Eo;!function(t){t.DECLINED="DECLINED",t.EXPIRED="EXPIRED"}(Eo||(Eo={}));var Oo=Object.freeze({__proto__:null,DEFAULT_DEADLINE_MS:vo,get ResponseStatus(){return Eo},createPaymentRequestEvent:async function(t,e,n){const r=n.requestId||function(){const t=new Uint8Array(4);if("undefined"!=typeof crypto&&crypto.getRandomValues)crypto.getRandomValues(t);else for(let e=0;e<t.length;e++)t[e]=Math.floor(256*Math.random());return Array.from(t).map(t=>t.toString(16).padStart(2,"0")).join("")}(),d=null===n.deadline?null:void 0!==n.deadline?n.deadline:Date.now()+vo,i=JSON.stringify({amount:String(n.amount),coinId:n.coinId,message:n.message,recipientNametag:n.recipientNametag,requestId:r,deadline:d}),o=bo+i,s=await t.encryptHex(o,e),a=[["p",e],["type","payment_request"],["amount",String(n.amount)]];return n.recipientNametag&&a.push(["recipient",n.recipientNametag]),Xn.create(t,{kind:br,tags:a,content:s})},createPaymentRequestResponseEvent:async function(t,e,n){const r=JSON.stringify({requestId:n.requestId,originalEventId:n.originalEventId,status:n.status,reason:n.reason}),d=wo+r,i=await t.encryptHex(d,e),o=[["p",e],["type","payment_request_response"],["status",n.status]];return n.originalEventId&&o.push(["e",n.originalEventId,"","reply"]),Xn.create(t,{kind:wr,tags:o,content:i})},formatAmount:function(t,e=8){const n="bigint"==typeof t?t:BigInt(t),r=BigInt(10)**BigInt(e),d=n/r,i=n%r;return i===BigInt(0)?d.toString():`${d}.${i.toString().padStart(e,"0").replace(/0+$/,"")}`},getAmount:function(t){const e=t.getTagValue("amount");if(void 0!==e)try{return BigInt(e)}catch{return}},getOriginalEventId:function(t){return t.getTagValue("e")},getRecipientNametag:function(t){return t.getTagValue("recipient")},getRemainingTimeMs:function(t){if(null===t.deadline)return null;const e=t.deadline-Date.now();return e>0?e:0},getResponseStatus:function(t){return t.getTagValue("status")},getSender:function(t){return t.pubkey},getTarget:function(t){return t.getTagValue("p")},isExpired:function(t){return null!==t.deadline&&Date.now()>t.deadline},isPaymentRequest:function(t){return t.kind===br&&"payment_request"===t.getTagValue("type")},isPaymentRequestResponse:function(t){return t.kind===wr&&"payment_request_response"===t.getTagValue("type")},parseAmount:function(t,e=8){const n=BigInt(10)**BigInt(e),r=t.split("."),d=BigInt(r[0]||"0");if(1===r.length)return d*n;let i=r[1]||"0";return i.length<e?i=i.padEnd(e,"0"):i.length>e&&(i=i.slice(0,e)),d*n+BigInt(i)},parsePaymentRequest:async function(t,e){if(t.kind!==br)throw new Error("Event is not a payment request");if("payment_request"!==t.getTagValue("type"))throw new Error("Event type is not payment_request");let n;if(e.isMyPublicKey(t.pubkey)){const e=t.getTagValue("p");if(!e)throw new Error("No target found in event");n=e}else n=t.pubkey;const r=await e.decryptHex(t.content,n);if(!r.startsWith(bo))throw new Error("Invalid payment request format: missing prefix");const d=r.slice(16),i=JSON.parse(d);return{amount:BigInt(i.amount),coinId:i.coinId,message:i.message,recipientNametag:i.recipientNametag,requestId:i.requestId,senderPubkey:t.pubkey,timestamp:1e3*t.created_at,eventId:t.id,deadline:void 0!==i.deadline?i.deadline:null}},parsePaymentRequestResponse:async function(t,e){if(t.kind!==wr)throw new Error("Event is not a payment request response");let n;if(e.isMyPublicKey(t.pubkey)){const e=t.getTagValue("p");if(!e)throw new Error("No target found in event");n=e}else n=t.pubkey;const r=await e.decryptHex(t.content,n);if(!r.startsWith(wo))throw new Error("Invalid payment request response format: missing prefix");const d=r.slice(25),i=JSON.parse(d);return{requestId:i.requestId,originalEventId:i.originalEventId,status:i.status,reason:i.reason,senderPubkey:t.pubkey,eventId:t.id,timestamp:1e3*t.created_at}}});function So(t){return 14===t.kind}function Po(t){return 15===t.kind}export{gr as AGENT_LOCATION,yr as AGENT_PROFILE,hr as APP_DATA,fr as AUTH,F as Bech32,ar as CHAT_MESSAGE,Ir as CLOSED,Ar as CLOSING,Cr as CONNECTING,dr as CONTACTS,go as CallbackEventListener,or as DELETION,ir as ENCRYPTED_DM,Xn as Event,Pr as EventKinds,mr as FILE_METADATA,Qn as Filter,tr as FilterBuilder,$r as GIFT_WRAP,Ki as NAMETAG_MAX_LENGTH,Di as NAMETAG_MIN_LENGTH,Qe as NIP04,Dr as NIP17,Yn as NIP44,fo as NametagBinding,no as NametagUtils,yo as NostrClient,zn as NostrKeyManager,Nr as OPEN,br as PAYMENT_REQUEST,wr as PAYMENT_REQUEST_RESPONSE,er as PROFILE,Oo as PaymentRequestProtocol,cr as REACTION,ur as READ_RECEIPT,rr as RECOMMEND_RELAY,lr as RELAY_LIST,sr as SEAL,je as SchnorrSigner,nr as TEXT_NOTE,pr as TOKEN_TRANSFER,mo as TokenTransferProtocol,Wi as areSameNametag,so as createAddressToBindingFilter,ro as createBindingEvent,Br as createGiftWrap,io as createIdentityBindingEvent,oo as createNametagToPubkeyFilter,ao as createPubkeyToNametagFilter,Rr as createReadReceipt,xr as createWebSocket,R as decode,_ as decodeNpub,U as decodeNsec,eo as decryptNametag,B as encode,M as encodeNpub,L as encodeNsec,to as encryptNametag,kr as extractMessageData,Ji as formatForDisplay,Sr as getName,_e as getPublicKey,Le as getPublicKeyHex,Xi as hashAddressForTag,Zi as hashNametag,So as isChatMessage,Er as isEphemeral,Or as isParameterizedReplaceable,Yi as isPhoneNumber,Po as isReadReceipt,vr as isReplaceable,lo as isValidBindingEvent,zi as isValidNametag,qi as normalizeNametag,$o as parseAddressFromEvent,uo as parseBindingInfo,co as parseNametagHashFromEvent,Hi as sha256Hex,Ue as sign,Fe as signHex,Mr as unwrap,De as verify,Ke as verifyHex};
13
13
  //# sourceMappingURL=index.min.js.map